refactor(api-builder): remove obsolete stuff
This commit is contained in:
parent
9c806f67b7
commit
ed6be8316f
|
@ -15,7 +15,6 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
|
|||
|
||||
.factory(require('./services/renderMarkdown'))
|
||||
.processor(require('./processors/addJadeDataDocsProcessor'))
|
||||
.processor(require('./processors/filterUnwantedDecorators'))
|
||||
.processor(require('./processors/matchUpDirectiveDecorators'))
|
||||
.processor(require('./processors/filterMemberDocs'))
|
||||
|
||||
|
@ -47,20 +46,13 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
|
|||
}
|
||||
readTypeScriptModules.basePath = path.resolve(angular_repo_path, 'modules');
|
||||
readTypeScriptModules.ignoreExportsMatching = [
|
||||
'___esModule',
|
||||
'___core_private_types__',
|
||||
'___platform_browser_private__',
|
||||
'___platform_browser_private_types__',
|
||||
'___platform_browser_dynamic_private__',
|
||||
'___platform_browser_dynamic_private_types__',
|
||||
'___platform_server_private__',
|
||||
'___router_private__' ,
|
||||
'___core_private_testing_types__',
|
||||
'___compiler_private__',
|
||||
'__esModule',
|
||||
'__core_private__',
|
||||
'___core_private__',
|
||||
'___core_private_testing_placeholder__',
|
||||
'___core_private_testing__'
|
||||
'__core_private_testing__',
|
||||
'__platform_browser_private__',
|
||||
'__platform_browser_dynamic_private__',
|
||||
'__platform_server_private__',
|
||||
'__router_private__',
|
||||
];
|
||||
|
||||
readTypeScriptModules.sourceFiles = [
|
||||
|
@ -81,7 +73,6 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
|
|||
'@angular/platform-webworker-dynamic/index.ts',
|
||||
'@angular/router/index.ts',
|
||||
'@angular/router/testing/index.ts',
|
||||
'@angular/router-deprecated/index.ts',
|
||||
'@angular/upgrade/index.ts',
|
||||
];
|
||||
readTypeScriptModules.hidePrivateMembers = true;
|
||||
|
@ -167,12 +158,4 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
|
|||
require('./rendering/toId'),
|
||||
require('./rendering/indentForMarkdown')
|
||||
]));
|
||||
})
|
||||
|
||||
.config(function(filterUnwantedDecorators) {
|
||||
filterUnwantedDecorators.decoratorsToIgnore = [
|
||||
'CONST',
|
||||
'IMPLEMENTS',
|
||||
'ABSTRACT'
|
||||
];
|
||||
});
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
var _ = require('lodash');
|
||||
|
||||
module.exports = function filterUnwantedDecorators() {
|
||||
return {
|
||||
decoratorsToIgnore: [],
|
||||
$runAfter: ['processing-docs'],
|
||||
$runBefore: ['docs-processed'],
|
||||
$process: function(docs) {
|
||||
var decoratorsToIgnore = this.decoratorsToIgnore || [];
|
||||
_.forEach(docs, function(doc) {
|
||||
if (doc.decorators) {
|
||||
doc.decorators = _.filter(doc.decorators, function(decorator) {
|
||||
return decoratorsToIgnore.indexOf(decorator.name) === -1;
|
||||
});
|
||||
}
|
||||
});
|
||||
return docs;
|
||||
}
|
||||
};
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
var mockPackage = require('../mocks/mockPackage');
|
||||
var Dgeni = require('dgeni');
|
||||
|
||||
describe('filterUnwantedDecorators', function() {
|
||||
var dgeni, injector, processor;
|
||||
|
||||
beforeEach(function() {
|
||||
dgeni = new Dgeni([mockPackage()]);
|
||||
injector = dgeni.configureInjector();
|
||||
processor = injector.get('filterUnwantedDecorators');
|
||||
});
|
||||
|
||||
|
||||
it('should remove decorators specified by name', function() {
|
||||
var docs = [
|
||||
{ id: 'doc1', decorators: [ { name: 'A' }, { name: 'B' } ] },
|
||||
{ id: 'doc2', decorators: [ { name: 'B' }, { name: 'C' } ] },
|
||||
{ id: 'doc3', decorators: [ { name: 'A' }, { name: 'C' } ] }
|
||||
];
|
||||
processor.decoratorsToIgnore = ['D', 'B'];
|
||||
docs = processor.$process(docs);
|
||||
|
||||
expect(docs).toEqual([
|
||||
{ id: 'doc1', decorators: [ { name: 'A' } ] },
|
||||
{ id: 'doc2', decorators: [ { name: 'C' } ] },
|
||||
{ id: 'doc3', decorators: [ { name: 'A' }, { name: 'C' } ] }
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
it('should ignore docs that have no decorators', function() {
|
||||
var docs = [
|
||||
{ id: 'doc1', decorators: [ { name: 'A' }, { name: 'B' } ] },
|
||||
{ id: 'doc2' },
|
||||
{ id: 'doc3', decorators: [ { name: 'A' }, { name: 'C' } ] }
|
||||
];
|
||||
processor.decoratorsToIgnore = ['D', 'B'];
|
||||
docs = processor.$process(docs);
|
||||
|
||||
expect(docs).toEqual([
|
||||
{ id: 'doc1', decorators: [ { name: 'A' } ] },
|
||||
{ id: 'doc2' },
|
||||
{ id: 'doc3', decorators: [ { name: 'A' }, { name: 'C' } ] }
|
||||
]);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue