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
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.9 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 apiPackage = require('../angular-api-package');
 | 
						|
const { API_SOURCE_PATH } = require('../config');
 | 
						|
const baseAuthoringPackage = require('./base-authoring-package');
 | 
						|
 | 
						|
const packageMap = {
 | 
						|
  animations: ['animations/index.ts', 'animations/browser/index.ts', 'animations/browser/testing/index.ts'],
 | 
						|
  common: ['common/index.ts', 'common/testing/index.ts', 'common/upgrade/index.ts', 'common/http/index.ts', 'common/http/testing/index.ts'],
 | 
						|
  core: ['core/index.ts', 'core/testing/index.ts'],
 | 
						|
  elements: ['elements/index.ts'],
 | 
						|
  forms: ['forms/index.ts'],
 | 
						|
  'platform-browser': ['platform-browser/index.ts', 'platform-browser/animations/index.ts', 'platform-browser/testing/index.ts'],
 | 
						|
  'platform-browser-dynamic': ['platform-browser-dynamic/index.ts', 'platform-browser-dynamic/testing/index.ts'],
 | 
						|
  'platform-server': ['platform-server/index.ts', 'platform-server/testing/index.ts'],
 | 
						|
  router: ['router/index.ts', 'router/testing/index.ts', 'router/upgrade/index.ts'],
 | 
						|
  'service-worker': ['service-worker/index.ts'],
 | 
						|
  upgrade: ['upgrade/index.ts', 'upgrade/static/index.ts', 'upgrade/static/testing/index.ts']
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
function createPackage(packageName) {
 | 
						|
 | 
						|
  return new Package('author-api', [baseAuthoringPackage, apiPackage])
 | 
						|
      .config(function(readTypeScriptModules) {
 | 
						|
        readTypeScriptModules.sourceFiles = packageMap[packageName];
 | 
						|
      })
 | 
						|
      .config(function(readFilesProcessor) {
 | 
						|
        readFilesProcessor.sourceFiles = [
 | 
						|
          {
 | 
						|
            basePath: API_SOURCE_PATH,
 | 
						|
            include: `${API_SOURCE_PATH}/examples/${packageName}/**/*`,
 | 
						|
            fileReader: 'exampleFileReader'
 | 
						|
          }
 | 
						|
        ];
 | 
						|
      });
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
module.exports = {
 | 
						|
  createPackage
 | 
						|
};
 |