Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 16dccb6

Browse files
petebacondarwinwardbell
authored andcommitted
api-builder: consolidate readTypescriptProcessor configuration
closes #1440
1 parent 0cb0bd7 commit 16dccb6

File tree

2 files changed

+17
-24
lines changed

2 files changed

+17
-24
lines changed

tools/api-builder/angular.io-package/index.js

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
var fs = require('fs');
12
var path = require('canonical-path');
23
var Package = require('dgeni').Package;
34
var basePackage = require('../docs-package');
@@ -40,6 +41,21 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
4041

4142
.config(function(readTypeScriptModules, writeFilesProcessor, readFilesProcessor) {
4243

44+
var angular_repo_path = path.resolve(__dirname, '../../../../angular');
45+
// confirm that the angular repo is actually there.
46+
if (!fs.existsSync(angular_repo_path)) {
47+
throw new Error('build-api-docs task requires the angular2 repo to be at ' + angular_repo_path);
48+
}
49+
readTypeScriptModules.basePath = path.resolve(angular_repo_path, 'modules');
50+
readTypeScriptModules.ignoreExportsMatching = [
51+
'___esModule',
52+
'___core_private_types__',
53+
'___platform_browser_private__',
54+
'___compiler_private__',
55+
'__core_private__',
56+
'___core_private__'
57+
];
58+
4359
readTypeScriptModules.sourceFiles = [
4460
'@angular/common/index.ts',
4561
'@angular/common/testing.ts',
@@ -61,6 +77,7 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
6177
];
6278
readTypeScriptModules.hidePrivateMembers = true;
6379

80+
6481
readFilesProcessor.basePath = DOCS_PATH;
6582
readFilesProcessor.sourceFiles = [{
6683
basePath: ANGULAR2_DOCS_PATH,

tools/api-builder/docs-package/index.js

-24
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ var typescriptPackage = require('dgeni-packages/typescript');
55
var linksPackage = require('../links-package');
66
var gitPackage = require('dgeni-packages/git');
77
var path = require('canonical-path');
8-
var fs = require('fs');
98

109
// Define the dgeni package for generating the docs
1110
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,
3635
renderDocsProcessor.extraData.versionInfo = versionInfo;
3736
})
3837

39-
// Configure file reading
40-
.config(function(readTypeScriptModules) {
41-
42-
var angular_repo_path = path.resolve(__dirname, '../../../../angular');
43-
// confirm that the angular repo is actually there.
44-
if (!fs.existsSync(angular_repo_path)) {
45-
throw new Error('build-api-docs task requires the angular2 repo to be at ' + angular_repo_path);
46-
}
47-
readTypeScriptModules.sourceFiles = [
48-
'*/*.@(js|es6|ts)',
49-
'*/src/**/*.@(js|es6|ts)'
50-
];
51-
readTypeScriptModules.basePath = path.resolve(angular_repo_path, 'modules');
52-
readTypeScriptModules.ignoreExportsMatching = [
53-
'___esModule',
54-
'___core_private_types__',
55-
'___platform_browser_private__',
56-
'___compiler_private__',
57-
'__core_private__',
58-
'___core_private__'
59-
];
60-
})
61-
6238

6339
.config(function(parseTagsProcessor, getInjectables) {
6440
// We actually don't want to parse param docs in this package as we are getting the data out using TS

0 commit comments

Comments
 (0)