api-builder: consolidate readTypescriptProcessor configuration
closes #1440
This commit is contained in:
parent
0cb0bd7949
commit
16dccb6a6b
@ -1,3 +1,4 @@
|
|||||||
|
var fs = require('fs');
|
||||||
var path = require('canonical-path');
|
var path = require('canonical-path');
|
||||||
var Package = require('dgeni').Package;
|
var Package = require('dgeni').Package;
|
||||||
var basePackage = require('../docs-package');
|
var basePackage = require('../docs-package');
|
||||||
@ -40,6 +41,21 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
|
|||||||
|
|
||||||
.config(function(readTypeScriptModules, writeFilesProcessor, readFilesProcessor) {
|
.config(function(readTypeScriptModules, writeFilesProcessor, readFilesProcessor) {
|
||||||
|
|
||||||
|
var angular_repo_path = path.resolve(__dirname, '../../../../angular');
|
||||||
|
// confirm that the angular repo is actually there.
|
||||||
|
if (!fs.existsSync(angular_repo_path)) {
|
||||||
|
throw new Error('build-api-docs task requires the angular2 repo to be at ' + angular_repo_path);
|
||||||
|
}
|
||||||
|
readTypeScriptModules.basePath = path.resolve(angular_repo_path, 'modules');
|
||||||
|
readTypeScriptModules.ignoreExportsMatching = [
|
||||||
|
'___esModule',
|
||||||
|
'___core_private_types__',
|
||||||
|
'___platform_browser_private__',
|
||||||
|
'___compiler_private__',
|
||||||
|
'__core_private__',
|
||||||
|
'___core_private__'
|
||||||
|
];
|
||||||
|
|
||||||
readTypeScriptModules.sourceFiles = [
|
readTypeScriptModules.sourceFiles = [
|
||||||
'@angular/common/index.ts',
|
'@angular/common/index.ts',
|
||||||
'@angular/common/testing.ts',
|
'@angular/common/testing.ts',
|
||||||
@ -61,6 +77,7 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
|
|||||||
];
|
];
|
||||||
readTypeScriptModules.hidePrivateMembers = true;
|
readTypeScriptModules.hidePrivateMembers = true;
|
||||||
|
|
||||||
|
|
||||||
readFilesProcessor.basePath = DOCS_PATH;
|
readFilesProcessor.basePath = DOCS_PATH;
|
||||||
readFilesProcessor.sourceFiles = [{
|
readFilesProcessor.sourceFiles = [{
|
||||||
basePath: ANGULAR2_DOCS_PATH,
|
basePath: ANGULAR2_DOCS_PATH,
|
||||||
|
@ -5,7 +5,6 @@ var typescriptPackage = require('dgeni-packages/typescript');
|
|||||||
var linksPackage = require('../links-package');
|
var linksPackage = require('../links-package');
|
||||||
var gitPackage = require('dgeni-packages/git');
|
var gitPackage = require('dgeni-packages/git');
|
||||||
var path = require('canonical-path');
|
var path = require('canonical-path');
|
||||||
var fs = require('fs');
|
|
||||||
|
|
||||||
// Define the dgeni package for generating the docs
|
// Define the dgeni package for generating the docs
|
||||||
module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, typescriptPackage, linksPackage, gitPackage])
|
module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, typescriptPackage, linksPackage, gitPackage])
|
||||||
@ -36,29 +35,6 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
|
|||||||
renderDocsProcessor.extraData.versionInfo = versionInfo;
|
renderDocsProcessor.extraData.versionInfo = versionInfo;
|
||||||
})
|
})
|
||||||
|
|
||||||
// Configure file reading
|
|
||||||
.config(function(readTypeScriptModules) {
|
|
||||||
|
|
||||||
var angular_repo_path = path.resolve(__dirname, '../../../../angular');
|
|
||||||
// confirm that the angular repo is actually there.
|
|
||||||
if (!fs.existsSync(angular_repo_path)) {
|
|
||||||
throw new Error('build-api-docs task requires the angular2 repo to be at ' + angular_repo_path);
|
|
||||||
}
|
|
||||||
readTypeScriptModules.sourceFiles = [
|
|
||||||
'*/*.@(js|es6|ts)',
|
|
||||||
'*/src/**/*.@(js|es6|ts)'
|
|
||||||
];
|
|
||||||
readTypeScriptModules.basePath = path.resolve(angular_repo_path, 'modules');
|
|
||||||
readTypeScriptModules.ignoreExportsMatching = [
|
|
||||||
'___esModule',
|
|
||||||
'___core_private_types__',
|
|
||||||
'___platform_browser_private__',
|
|
||||||
'___compiler_private__',
|
|
||||||
'__core_private__',
|
|
||||||
'___core_private__'
|
|
||||||
];
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
.config(function(parseTagsProcessor, getInjectables) {
|
.config(function(parseTagsProcessor, getInjectables) {
|
||||||
// We actually don't want to parse param docs in this package as we are getting the data out using TS
|
// We actually don't want to parse param docs in this package as we are getting the data out using TS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user