diff --git a/aio/tools/transforms/angular-api-package/index.js b/aio/tools/transforms/angular-api-package/index.js index 523b42de88..b86b541a9e 100644 --- a/aio/tools/transforms/angular-api-package/index.js +++ b/aio/tools/transforms/angular-api-package/index.js @@ -23,14 +23,13 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage]) .processor(require('./processors/filterMemberDocs')) .processor(require('./processors/markBarredODocsAsPrivate')) .processor(require('./processors/filterPrivateDocs')) - .processor(require('./processors/filterIgnoredDocs')) // Where do we get the source files? .config(function(readTypeScriptModules, readFilesProcessor, collectExamples) { // API files are typescript readTypeScriptModules.basePath = API_SOURCE_PATH; - readTypeScriptModules.ignoreExportsMatching = [/^[_ɵ]/]; + readTypeScriptModules.ignoreExportsMatching = [/^[_ɵ]|^VERSION$/]; readTypeScriptModules.hidePrivateMembers = true; readTypeScriptModules.sourceFiles = [ 'animations/index.ts', @@ -70,13 +69,6 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage]) collectExamples.exampleFolders.push('examples'); }) - // Ignore certain problematic files - .config(function(filterIgnoredDocs) { - filterIgnoredDocs.ignore = [ - /\/VERSION$/ // Ignore the `VERSION` const, since it would be written to the same file as the `Version` class - ]; - }) - // Configure jsdoc-style tag parsing .config(function(parseTagsProcessor, getInjectables) { // Load up all the tag definitions in the tag-defs folder diff --git a/aio/tools/transforms/angular-api-package/processors/filterIgnoredDocs.js b/aio/tools/transforms/angular-api-package/processors/filterIgnoredDocs.js deleted file mode 100644 index f1ec0fe177..0000000000 --- a/aio/tools/transforms/angular-api-package/processors/filterIgnoredDocs.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Filter out docs whose id matches a pattern in the `filterIgnoredDocs.ignore` list - */ -module.exports = function filterIgnoredDocs() { - return { - ignore: [], - $runAfter: ['ids-computed'], - $runBefore: ['computing-paths'], - $process: function(docs) { - return docs.filter(doc => !this.ignore.some(regexp => regexp.test(doc.id))); - } - }; -}; diff --git a/aio/tools/transforms/angular-api-package/processors/filterIgnoredDocs.spec.js b/aio/tools/transforms/angular-api-package/processors/filterIgnoredDocs.spec.js deleted file mode 100644 index c47c6b1966..0000000000 --- a/aio/tools/transforms/angular-api-package/processors/filterIgnoredDocs.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -const testPackage = require('../../helpers/test-package'); -const processorFactory = require('./filterIgnoredDocs'); -const Dgeni = require('dgeni'); - -describe('filterIgnoredDocs processor', () => { - - it('should be available on the injector', () => { - const dgeni = new Dgeni([testPackage('angular-api-package')]); - const injector = dgeni.configureInjector(); - const processor = injector.get('filterIgnoredDocs'); - expect(processor.$process).toBeDefined(); - }); - - it('should run before the correct processor', () => { - const processor = processorFactory(); - expect(processor.$runBefore).toEqual(['computing-paths']); - }); - - it('should run after the correct processor', () => { - const processor = processorFactory(); - expect(processor.$runAfter).toEqual(['ids-computed']); - }); - - it('should remove docs that match the ignore list', () => { - const processor = processorFactory(); - processor.ignore = [/\/VERSION$/, /ignore-me/]; - const docs = [ - { id: 'public1'}, - { id: 'ignore-me/something' }, - { id: 'public2'}, - { id: 'and-me/VERSION' } - ]; - const filteredDocs = processor.$process(docs); - expect(filteredDocs).toEqual([ - { id: 'public1'}, - { id: 'public2'} - ]); - }); -});