diff --git a/aio/tools/transforms/angular-api-package/index.js b/aio/tools/transforms/angular-api-package/index.js index e0465b14c1..8c86ed4bce 100644 --- a/aio/tools/transforms/angular-api-package/index.js +++ b/aio/tools/transforms/angular-api-package/index.js @@ -14,7 +14,6 @@ const { API_SOURCE_PATH, API_TEMPLATES_PATH, requireFolder } = require('../confi module.exports = new Package('angular-api', [basePackage, typeScriptPackage]) // Register the processors - .processor(require('./processors/migrateLegacyJSDocTags')) .processor(require('./processors/splitDescription')) .processor(require('./processors/convertPrivateClassesToInterfaces')) .processor(require('./processors/generateApiListDoc')) diff --git a/aio/tools/transforms/angular-api-package/processors/mergeDecoratorDocs.js b/aio/tools/transforms/angular-api-package/processors/mergeDecoratorDocs.js index 956f2f4318..414e742b62 100644 --- a/aio/tools/transforms/angular-api-package/processors/mergeDecoratorDocs.js +++ b/aio/tools/transforms/angular-api-package/processors/mergeDecoratorDocs.js @@ -42,7 +42,7 @@ const {mergeProperties} = require('../../helpers/utils'); * * Finally we want to capture the documentation attached to the call signature interface of the * associated decorator (1). We copy across the properties that we care about from this call - * signature (e.g. description, whatItDoes and howToUse). + * signature (e.g. `description` and `usageNotes`). */ module.exports = function mergeDecoratorDocs(log) { diff --git a/aio/tools/transforms/angular-api-package/processors/migrateLegacyJSDocTags.js b/aio/tools/transforms/angular-api-package/processors/migrateLegacyJSDocTags.js deleted file mode 100644 index cf3f10a322..0000000000 --- a/aio/tools/transforms/angular-api-package/processors/migrateLegacyJSDocTags.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = function migrateLegacyJSDocTags(log, createDocMessage) { - return { - $runAfter: ['tags-extracted'], - $runBefore: ['processing-docs'], - $process(docs) { - let migrated = false; - docs.forEach(doc => { - if (doc.howToUse) { - if (doc.usageNotes) { - throw new Error(createDocMessage('`@usageNotes` and the deprecated `@howToUse` are not allowed on the same doc', doc)); - } - log.debug(createDocMessage('Using deprecated `@howToUse` tag as though it was `@usageNotes` tag', doc)); - doc.usageNotes = doc.howToUse; - doc.howToUse = null; - migrated = true; - } - - if (doc.whatItDoes) { - log.debug(createDocMessage('Merging the content of `@whatItDoes` tag into the description.', doc)); - if (doc.description) { - doc.description = `${doc.whatItDoes}\n\n${doc.description}`; - } else { - doc.description = doc.whatItDoes; - } - doc.whatItDoes = null; - migrated = true; - } - }); - - if (migrated) { - log.warn('Some deprecated tags were migrated.'); - log.warn('This automatic handling will be removed in a future version of the doc generation.\n'); - } - } - }; -}; diff --git a/aio/tools/transforms/angular-api-package/processors/migrateLegacyJSDocTags.spec.js b/aio/tools/transforms/angular-api-package/processors/migrateLegacyJSDocTags.spec.js deleted file mode 100644 index e64a77dc81..0000000000 --- a/aio/tools/transforms/angular-api-package/processors/migrateLegacyJSDocTags.spec.js +++ /dev/null @@ -1,66 +0,0 @@ -const testPackage = require('../../helpers/test-package'); -const processorFactory = require('./migrateLegacyJSDocTags'); -const log = require('dgeni/lib/mocks/log')(false); -const createDocMessage = require('dgeni-packages/base/services/createDocMessage')(); -const Dgeni = require('dgeni'); - -describe('migrateLegacyJSDocTags processor', () => { - - it('should be available on the injector', () => { - const dgeni = new Dgeni([testPackage('angular-api-package')]); - const injector = dgeni.configureInjector(); - const processor = injector.get('migrateLegacyJSDocTags'); - expect(processor.$process).toBeDefined(); - }); - - it('should run before the correct processor', () => { - const processor = processorFactory(log, createDocMessage); - expect(processor.$runBefore).toEqual(['processing-docs']); - }); - - it('should run after the correct processor', () => { - const processor = processorFactory(log, createDocMessage); - expect(processor.$runAfter).toEqual(['tags-extracted']); - }); - - it('should migrate `howToUse` property to `usageNotes` property', () => { - const processor = processorFactory(log, createDocMessage); - const docs = [ - { howToUse: 'this is how to use it' } - ]; - processor.$process(docs); - expect(docs[0].howToUse).toBe(null); - expect(docs[0].usageNotes).toEqual('this is how to use it'); - }); - - it('should migrate `whatItDoes` property to the `description`', () => { - const processor = processorFactory(log, createDocMessage); - const docs = [ - { whatItDoes: 'what it does' }, - { whatItDoes: 'what it does', description: 'the description' }, - { description: 'the description' } - ]; - processor.$process(docs); - expect(docs[0].whatItDoes).toBe(null); - expect(docs[0].description).toEqual('what it does'); - - expect(docs[1].whatItDoes).toBe(null); - expect(docs[1].description).toEqual('what it does\n\nthe description'); - - expect(docs[2].whatItDoes).toBeUndefined(); - expect(docs[2].description).toEqual('the description'); - }); - - it('should ignore docs that have neither `howToUse` nor `whatItDoes` properties', () => { - const processor = processorFactory(log, createDocMessage); - const docs = [ - { }, - { description: 'the description' } - ]; - processor.$process(docs); - expect(docs).toEqual([ - { }, - { description: 'the description' } - ]); - }); -}); \ No newline at end of file diff --git a/aio/tools/transforms/angular-api-package/processors/splitDescription.js b/aio/tools/transforms/angular-api-package/processors/splitDescription.js index 2d6de6a9fc..dd5f584802 100644 --- a/aio/tools/transforms/angular-api-package/processors/splitDescription.js +++ b/aio/tools/transforms/angular-api-package/processors/splitDescription.js @@ -5,7 +5,7 @@ */ module.exports = function splitDescription() { return { - $runAfter: ['tags-extracted', 'migrateLegacyJSDocTags'], + $runAfter: ['tags-extracted'], $runBefore: ['processing-docs'], docTypes: [], $process(docs) { diff --git a/aio/tools/transforms/angular-api-package/processors/splitDescription.spec.js b/aio/tools/transforms/angular-api-package/processors/splitDescription.spec.js index 90b3b6b92b..313aa51cab 100644 --- a/aio/tools/transforms/angular-api-package/processors/splitDescription.spec.js +++ b/aio/tools/transforms/angular-api-package/processors/splitDescription.spec.js @@ -18,7 +18,7 @@ describe('splitDescription processor', () => { it('should run after the correct processor', () => { const processor = processorFactory(); - expect(processor.$runAfter).toEqual(['tags-extracted', 'migrateLegacyJSDocTags']); + expect(processor.$runAfter).toEqual(['tags-extracted']); }); it('should split the `description` property into the first paragraph and other paragraphs', () => { diff --git a/aio/tools/transforms/angular-api-package/tag-defs/howToUse.js b/aio/tools/transforms/angular-api-package/tag-defs/howToUse.js deleted file mode 100644 index a0d7968e07..0000000000 --- a/aio/tools/transforms/angular-api-package/tag-defs/howToUse.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = function(log, createDocMessage) { - return { - name: 'howToUse', - deprecated: true, - transforms(doc, tag, value) { - log.warn(createDocMessage('Deprecated `@howToUse` tag found', doc)); - log.warn('PLEASE FIX by renaming to `@usageNotes.'); - return value; - } - }; -}; diff --git a/aio/tools/transforms/angular-api-package/tag-defs/whatItDoes.js b/aio/tools/transforms/angular-api-package/tag-defs/whatItDoes.js deleted file mode 100644 index 8b995890a9..0000000000 --- a/aio/tools/transforms/angular-api-package/tag-defs/whatItDoes.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = function(log, createDocMessage) { - return { - name: 'whatItDoes', - deprecated: true, - transforms(doc, tag, value) { - log.warn(createDocMessage('Deprecated `@whatItDoes` tag found', doc)); - log.warn('PLEASE FIX by adding the content of this tag as the first paragraph of the `@description` tag.'); - return value; - } - }; -}; diff --git a/aio/tools/transforms/templates/README.md b/aio/tools/transforms/templates/README.md index 39defb73be..5c67886c39 100644 --- a/aio/tools/transforms/templates/README.md +++ b/aio/tools/transforms/templates/README.md @@ -8,21 +8,22 @@ other templates. Templates can also import macros from other template files. When extending a template, parent must declare blocks that can be overridden by the child. The template extension hierarchy looks like this (with declared blocks in parentheses): -- layout/base.template.html (base) - - module.template.html - - layout/api-base.template.html (jumpNav, jumpNavLinks, whatItDoes, infoBar, securityConsiderations, - deprecationNotes, howToUse, details) +- layout/base.template.html (bread-crumbs, header, embedded contents and body) + - package.template.html + - export-base.template.html (short-description, security-notes, deprecation, overview, see-also, details, usageNotes) - class.template.html - directive.template.html - - enum.template.html + - enum.template.html - var.template.html - const.template.html - let.template.html - decorator.template.html - function.template.html - interface.template.html - - type-alias.template.html + - value-module.template.html + - type-alias.template.html - pipe.template.html + - ngmodule.template.html # Doc Properties