2017-04-16 15:48:22 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. 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;
|
2017-04-21 08:10:52 -04:00
|
|
|
const apiPackage = require('../angular-api-package');
|
|
|
|
const { API_SOURCE_PATH } = require('../config');
|
|
|
|
|
2017-04-16 15:48:22 -04:00
|
|
|
const packageMap = {
|
2017-04-26 14:02:28 -04:00
|
|
|
animations: ['animations/index.ts', 'animations/browser/index.ts', 'animations/browser/testing/index.ts'],
|
2019-05-20 13:54:40 -04:00
|
|
|
common: ['common/index.ts', 'common/testing/index.ts', 'common/upgrade/index.ts', 'common/http/index.ts', 'common/http/testing/index.ts'],
|
2017-04-16 15:48:22 -04:00
|
|
|
core: ['core/index.ts', 'core/testing/index.ts'],
|
2018-02-28 12:45:11 -05:00
|
|
|
elements: ['elements/index.ts'],
|
2017-04-16 15:48:22 -04:00
|
|
|
forms: ['forms/index.ts'],
|
2019-03-27 13:50:39 -04:00
|
|
|
// Current plan for Angular v8 is to hide the @angular/http package
|
|
|
|
// http: ['http/index.ts', 'http/testing/index.ts'],
|
2017-04-26 14:02:28 -04:00
|
|
|
'platform-browser': ['platform-browser/index.ts', 'platform-browser/animations/index.ts', 'platform-browser/testing/index.ts'],
|
2017-04-16 15:48:22 -04:00
|
|
|
'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'],
|
|
|
|
'platform-webworker': ['platform-webworker/index.ts'],
|
2018-02-28 12:45:11 -05:00
|
|
|
'platform-webworker-dynamic': ['platform-webworker-dynamic/index.ts'],
|
2017-04-26 14:02:28 -04:00
|
|
|
router: ['router/index.ts', 'router/testing/index.ts', 'router/upgrade/index.ts'],
|
2017-10-23 12:47:49 -04:00
|
|
|
'service-worker': ['service-worker/index.ts'],
|
2019-03-22 05:42:52 -04:00
|
|
|
upgrade: ['upgrade/index.ts', 'upgrade/static/index.ts', 'upgrade/static/testing/index.ts']
|
2017-04-16 15:48:22 -04:00
|
|
|
};
|
2017-04-21 08:10:52 -04:00
|
|
|
|
|
|
|
|
2017-04-16 15:48:22 -04:00
|
|
|
function createPackage(packageName) {
|
|
|
|
|
2017-04-21 08:10:52 -04:00
|
|
|
return new Package('author-api', [apiPackage])
|
2017-04-16 15:48:22 -04:00
|
|
|
.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
|
|
|
|
};
|