Skip to content

chore: typo in dgeni processor #9892

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

Merged
merged 1 commit into from
Feb 13, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tools/dgeni/common/decorators.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* We want to avoid emitting selectors that are deprecated but don't have a way to mark
* them as such in the source code. Thus, we maintain a separate blacklist of selectors
* that should not be emitted in the documentation.
*/
import {ClassExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
import {PropertyMemberDoc} from 'dgeni-packages/typescript/api-doc-types/PropertyMemberDoc';
import {MemberDoc} from 'dgeni-packages/typescript/api-doc-types/MemberDoc';
import {CategorizedClassDoc, DeprecationDoc, HasDecoratorsDoc} from './dgeni-definitions';

/**
* We want to avoid emitting selectors that are deprecated but don't have a way to mark
* them as such in the source code. Thus, we maintain a separate blacklist of selectors
* that should not be emitted in the documentation.
*/
const SELECTOR_BLACKLIST = new Set([
'[portal]',
'[portalHost]',
Expand Down
43 changes: 21 additions & 22 deletions tools/dgeni/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {TsParser} from 'dgeni-packages/typescript/services/TsParser';
import {sync as globSync} from 'glob';
import * as path from 'path';

// Dgeni packages
// Dgeni packages that the Material docs package depends on.
const jsdocPackage = require('dgeni-packages/jsdoc');
const nunjucksPackage = require('dgeni-packages/nunjucks');
const typescriptPackage = require('dgeni-packages/typescript');
Expand All @@ -22,24 +22,6 @@ const sourceDir = path.resolve(projectRootDir, 'src');
const outputDir = path.resolve(projectRootDir, 'dist/docs/api');
const templateDir = path.resolve(__dirname, './templates');

// Package definition for material2 api docs. This only *defines* the package- it does not yet
// actually *run* anything.
//
// A dgeni package is very similar to an AngularJS module. Modules contain:
// "services" (injectables)
// "processors" (injectables that conform to a specific interface)
// "templates": nunjucks templates that can be used to render content
//
// A dgeni package also has a `config` method, similar to an AngularJS module.
// A config block can inject any services/processors and configure them before
// docs processing begins.

const dgeniPackageDeps = [
jsdocPackage,
nunjucksPackage,
typescriptPackage,
];

/** List of CDK packages that need to be documented. */
const cdkPackages = globSync(path.join(sourceDir, 'cdk', '*/'))
.filter(packagePath => !packagePath.endsWith('testing/'))
Expand All @@ -49,7 +31,24 @@ const cdkPackages = globSync(path.join(sourceDir, 'cdk', '*/'))
const materialPackages = globSync(path.join(sourceDir, 'lib', '*/'))
.map(packagePath => path.basename(packagePath));

export const apiDocsPackage = new Package('material2-api-docs', dgeniPackageDeps);
/**
* Dgeni package for the Angular Material docs. This just defines the package, but doesn't
* generate the docs yet.
*
* Dgeni packages are very similar to AngularJS modules. Those can contain:
*
* - Services that can be injected
* - Templates that are used to convert the data into HTML output.
* - Processors that can modify the doc items (like a build pipeline).
*
* Similar to AngularJS, there is also a `config` lifecycle hook, that can be used to
* configure specific processors, services before the procession begins.
*/
export const apiDocsPackage = new Package('material2-api-docs', [
jsdocPackage,
nunjucksPackage,
typescriptPackage,
]);

// Processor that filters out duplicate exports that should not be shown in the docs.
apiDocsPackage.processor(new FilterDuplicateExports());
Expand Down Expand Up @@ -121,7 +120,7 @@ apiDocsPackage.config((readTypeScriptModules: ReadTypeScriptModules, tsParser: T
tsParser.options.paths = typescriptPathMap;
tsParser.options.baseUrl = sourceDir;

// Entry points for docs generation. All publically exported symbols found through these
// Entry points for docs generation. All publicly exported symbols found through these
// files will have docs generated.
readTypeScriptModules.sourceFiles = [
...cdkPackages.map(packageName => `./cdk/${packageName}/index.ts`),
Expand Down Expand Up @@ -149,7 +148,7 @@ apiDocsPackage.config((templateFinder: any, templateEngine: any) => {
'common.template.html'
];

// dgeni disables autoescape by default, but we want this turned on.
// Dgeni disables autoescape by default, but we want this turned on.
templateEngine.config.autoescape = true;

// Nunjucks and Angular conflict in their template bindings so change Nunjucks
Expand Down
4 changes: 2 additions & 2 deletions tools/dgeni/processors/merge-inherited-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export class MergeInheritedProperties implements Processor {
$process(docs: DocCollection) {
return docs
.filter(doc => doc.docType === 'class')
.forEach(doc => this.addInhertiedProperties(doc));
.forEach(doc => this.addInheritedProperties(doc));
}

private addInhertiedProperties(doc: ClassExportDoc) {
private addInheritedProperties(doc: ClassExportDoc) {
doc.implementsClauses.filter(clause => clause.doc).forEach(clause => {
clause.doc!.members.forEach(member => this.addMemberDocIfNotPresent(doc, member));
});
Expand Down