Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old docs annotations #7227

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 8 additions & 74 deletions docs_app/tools/transforms/angular-api-package/index.js
Expand Up @@ -9,6 +9,7 @@ const Package = require('dgeni').Package;

const basePackage = require('../angular-base-package');
const typeScriptPackage = require('dgeni-packages/typescript');
// prettier-ignore
const { API_SOURCE_PATH, API_TEMPLATES_PATH, MARBLE_IMAGES_PATH, MARBLE_IMAGES_WEB_PATH,
requireFolder } = require('../config');

Expand All @@ -21,7 +22,6 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
.processor(require('./processors/convertPrivateClassesToInterfaces'))
.processor(require('./processors/generateApiListDoc'))
.processor(require('./processors/generateDeprecationsListDoc'))
.processor(require('./processors/addNotYetDocumentedProperty'))
.processor(require('./processors/mergeDecoratorDocs'))
.processor(require('./processors/extractDecoratedClasses'))
.processor(require('./processors/matchUpDirectiveDecorators'))
Expand Down Expand Up @@ -56,12 +56,7 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
})

// Where do we get the source files?
.config(function(readTypeScriptModules, readFilesProcessor, tsParser) {

// Tell TypeScript how to load modules that start with `@angular`
tsParser.options.paths = { '@angular/*': [API_SOURCE_PATH + '/*'] };
tsParser.options.baseUrl = '.';

.config(function (readTypeScriptModules) {
// API files are typescript
readTypeScriptModules.basePath = API_SOURCE_PATH;
readTypeScriptModules.ignoreExportsMatching = [/^[_ɵ]|^VERSION$/];
Expand All @@ -76,83 +71,22 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
'webSocket/index.ts',
'testing/index.ts'
];

// API Examples
readFilesProcessor.sourceFiles = [
{
basePath: API_SOURCE_PATH,
include: API_SOURCE_PATH + '/examples/**/*',
fileReader: 'exampleFileReader'
}
];
})

// Configure jsdoc-style tag parsing
.config(function(parseTagsProcessor, getInjectables) {
.config(function (parseTagsProcessor, getInjectables) {
// Load up all the tag definitions in the tag-defs folder
parseTagsProcessor.tagDefinitions =
parseTagsProcessor.tagDefinitions.concat(getInjectables(requireFolder(__dirname, './tag-defs')));
})

// Additional jsdoc config (for RxJS source)
.config(function(parseTagsProcessor) {
parseTagsProcessor.tagDefinitions.push({ name: 'owner' });
parseTagsProcessor.tagDefinitions.push({ name: 'static' });
parseTagsProcessor.tagDefinitions.push({ name: 'nocollapse' });
// Replace the Catharsis type parsing, as it doesn't understand TypeScript type annotations (i.e. `foo(x: SomeType)`), with a simpler dummy transform
const typeTags = parseTagsProcessor.tagDefinitions.filter(tagDef => ['param', 'returns', 'type', 'private', 'property', 'protected', 'public'].indexOf(tagDef.name) !== -1);
typeTags.forEach(typeTag => typeTag.transforms[0] = function dummyTypeTransform(doc, tag, value) {
var TYPE_EXPRESSION_START = /^\s*\{[^@]/;
var start, position, count, length;

var match = TYPE_EXPRESSION_START.exec(value);
if (match) {
length = value.length;
// the start is the beginning of the `{`
start = match[0].length - 2;
// advance to the first character in the type expression
position = match[0].length - 1;
count = 1;

while (position < length) {
switch (value[position]) {
case '\\':
// backslash is an escape character, so skip the next character
position++;
break;
case '{':
count++;
break;
case '}':
count--;
break;
default:
// do nothing
}

if (count === 0) {
break;
}
position++;
}

tag.typeExpression = value.slice(start + 1, position).trim().replace('\\}', '}').replace('\\{', '{');
tag.description = (value.substring(0, start) + value.substring(position + 1)).trim();
return tag.description;
} else {
return value;
}
});
})

.config(function(computeStability, splitDescription, EXPORT_DOC_TYPES, API_DOC_TYPES) {
.config(function (computeStability, splitDescription, EXPORT_DOC_TYPES, API_DOC_TYPES) {
computeStability.docTypes = EXPORT_DOC_TYPES;
// Only split the description on the API docs
splitDescription.docTypes = API_DOC_TYPES;
})

.config(function(computePathsProcessor, EXPORT_DOC_TYPES, generateApiListDoc, generateDeprecationListDoc) {

.config(function (computePathsProcessor, EXPORT_DOC_TYPES, generateApiListDoc, generateDeprecationListDoc) {
const API_SEGMENT = 'api';

generateApiListDoc.outputFolder = API_SEGMENT;
Expand Down Expand Up @@ -180,17 +114,17 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
});
})

.config(function(templateFinder) {
.config(function (templateFinder) {
// Where to find the templates for the API doc rendering
templateFinder.templateFolders.unshift(API_TEMPLATES_PATH);
})

.config(function(embedMarbleDiagramsPostProcessor) {
.config(function (embedMarbleDiagramsPostProcessor) {
embedMarbleDiagramsPostProcessor.marbleImagesPath = MARBLE_IMAGES_PATH;
embedMarbleDiagramsPostProcessor.marbleImagesOutputWebPath = `/${MARBLE_IMAGES_WEB_PATH}`;
})

.config(function(convertToJsonProcessor, postProcessHtml, API_DOC_TYPES_TO_RENDER, API_DOC_TYPES, autoLinkCode, embedMarbleDiagramsPostProcessor) {
.config(function (convertToJsonProcessor, postProcessHtml, API_DOC_TYPES_TO_RENDER, API_DOC_TYPES, autoLinkCode, embedMarbleDiagramsPostProcessor) {
convertToJsonProcessor.docTypes = convertToJsonProcessor.docTypes.concat(API_DOC_TYPES_TO_RENDER);
postProcessHtml.docTypes = convertToJsonProcessor.docTypes.concat(API_DOC_TYPES_TO_RENDER);
postProcessHtml.plugins.push(embedMarbleDiagramsPostProcessor.process);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions docs_app/tools/transforms/angular-api-package/tag-defs/howToUse.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions docs_app/tools/transforms/angular-api-package/tag-defs/stable.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions docs_app/tools/transforms/angular-base-package/index.js
Expand Up @@ -11,7 +11,6 @@ const Package = require('dgeni').Package;
const jsdocPackage = require('dgeni-packages/jsdoc');
const nunjucksPackage = require('dgeni-packages/nunjucks');
const linksPackage = require('../links-package');
const targetPackage = require('../target-package');
const remarkPackage = require('../remark-package');
const postProcessPackage = require('dgeni-packages/post-process-html');

Expand All @@ -22,7 +21,6 @@ module.exports = new Package('angular-base', [
jsdocPackage,
nunjucksPackage,
linksPackage,
targetPackage,
remarkPackage,
postProcessPackage,
])
Expand Down Expand Up @@ -82,15 +80,6 @@ module.exports = new Package('angular-base', [
writeFilesProcessor.outputFolder = DOCS_OUTPUT_PATH;
})

// Target environments
.config(function (targetEnvironments) {
const ALLOWED_LANGUAGES = ['ts', 'js', 'dart'];
const TARGET_LANGUAGE = 'ts';

ALLOWED_LANGUAGES.forEach((target) => targetEnvironments.addAllowed(target));
targetEnvironments.activate(TARGET_LANGUAGE);
})

// Configure nunjucks rendering of docs via templates
.config(function (renderDocsProcessor, templateFinder, templateEngine, getInjectables) {
// Where to find the templates for the doc rendering
Expand Down
10 changes: 0 additions & 10 deletions docs_app/tools/transforms/target-package/index.js

This file was deleted.

33 changes: 0 additions & 33 deletions docs_app/tools/transforms/target-package/inline-tag-defs/target.js

This file was deleted.