build(aio): ignore the VERSION constant correctly
We were filtering this document from the docs list but not removing it from the module export lists. We can actually filter it out much easier at the TypeScript parsing point, which means we do not need the `filterIgnoredDocs` processor any more. Closes #16287
This commit is contained in:

committed by
Pete Bacon Darwin

parent
23e6502ef3
commit
f5aaa55f21
@ -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)));
|
||||
}
|
||||
};
|
||||
};
|
@ -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'}
|
||||
]);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user