chore(doc-gen): put typescript stuff into its own package

This means that we can now run just the d.ts file generation by running:

```bash
gulp docs/typings
```

In addition the type definition generation was messing with the other docs tasks
so separating it also fixes problems there.
This commit is contained in:
Peter Bacon Darwin
2015-07-11 07:21:21 +01:00
parent 927454c8fa
commit 9fa7d38133
55 changed files with 359 additions and 78 deletions

View File

@ -380,10 +380,10 @@ gulp.task('docs/bower', function() {
});
function createDocsTasks(publicBuild) {
var dgeniPackage = publicBuild ? './docs/public-docs-package' : './docs/dgeni-package';
var distDocsPath = publicBuild ? 'dist/public_docs' : 'dist/docs';
var taskPrefix = publicBuild ? 'public_docs' : 'docs';
function createDocsTasks(options) {
var dgeniPackage = options.package;
var distDocsPath = options.path;
var taskPrefix = options.prefix;
gulp.task(taskPrefix + '/dgeni', function() {
try {
@ -423,8 +423,9 @@ function createDocsTasks(publicBuild) {
});
}
createDocsTasks(true);
createDocsTasks(false);
createDocsTasks({ package: './docs/docs-package', path: 'dist/docs', prefix: 'docs'});
createDocsTasks({ package: './docs/public-docs-package', path: 'dist/public_docs', prefix: 'public_docs'});
gulp.task('docs/angular.io', ['build/clean.docs_angular_io'], function() {
try {
@ -437,6 +438,17 @@ gulp.task('docs/angular.io', ['build/clean.docs_angular_io'], function() {
}
});
gulp.task('docs/typings', [], function() {
try {
var dgeni = new Dgeni([require('./docs/typescript-definition-package')]);
return dgeni.generate();
} catch(x) {
console.log(x);
console.log(x.stack);
throw x;
}
});
// ------------------
// CI tests suites
@ -642,7 +654,7 @@ gulp.task('post-test-checks', function(done) {
});
gulp.task('!pre.test.typings', [], function() {
gulp.task('!pre.test.typings', ['docs/typings'], function() {
return gulp
.src([
'modules/angular2/typings/**/*'], {