angular-docs-cn/aio/tools/transforms/authors-package/base-authoring-package.js
Pete Bacon Darwin 9491318c26 build(docs-infra): move docs-watch settings to a base package (#40479)
This new `base-authoring-package` captures all the settings, which
turns of potentially fatal checks, in one place. This new package is
then used as a base for all the docs-watch related packages, rather
than dotting the settings in a variety of different packages. This also
has the benefit that the standard configuration for doc-gen is fatal
on failed checks by default.

PR Close #40479
2021-01-20 16:12:15 -08:00

37 lines
1.3 KiB
JavaScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const Package = require('dgeni').Package;
const basePackage = require('../angular-base-package');
/**
* A base package used by all the authoring packages in this folder.
*
* This package turns off lots of the potentially fatal checks to allow
* doc-gen to complete when authors are using the `docs-watch` or `serve-and-sync`
* jobs.
*/
const baseAuthoringPackage = new Package('base-authoring', [basePackage]);
baseAuthoringPackage
.config(function(checkAnchorLinksProcessor, checkForUnusedExampleRegions) {
// These are disabled here to prevent false negatives for the `docs-watch` task.
checkAnchorLinksProcessor.$enabled = false;
checkForUnusedExampleRegions.$enabled = false;
})
.config(function(linkInlineTagDef) {
// Do not fail the processing if there is an invalid link
linkInlineTagDef.failOnBadLink = false;
})
.config(function(renderExamples) {
// Do not fail the processing if there is a broken example
renderExamples.ignoreBrokenExamples = true;
});
module.exports = baseAuthoringPackage;