@schematics/angular 13.2.3 → 14.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations/migration-collection.json +12 -22
- package/migrations/update-14/angular-packages-version-prefix.d.ts +29 -0
- package/migrations/update-14/angular-packages-version-prefix.js +61 -0
- package/migrations/{update-13/update-gitignore.d.ts → update-14/remove-show-circular-dependencies-option.d.ts} +1 -0
- package/migrations/update-14/remove-show-circular-dependencies-option.js +26 -0
- package/migrations/{update-13/update-angular-config.d.ts → update-14/update-tsconfig-target.d.ts} +1 -0
- package/migrations/update-14/update-tsconfig-target.js +51 -0
- package/package.json +3 -3
- package/utility/latest-versions/package.json +1 -1
- package/utility/latest-versions.js +2 -2
- package/workspace/files/tsconfig.json.template +1 -1
- package/migrations/update-13/drop-ie-polyfills.d.ts +0 -51
- package/migrations/update-13/drop-ie-polyfills.js +0 -290
- package/migrations/update-13/schematic-options.d.ts +0 -9
- package/migrations/update-13/schematic-options.js +0 -51
- package/migrations/update-13/update-angular-config.js +0 -43
- package/migrations/update-13/update-gitignore.js +0 -48
- package/migrations/update-13/update-libraries.d.ts +0 -9
- package/migrations/update-13/update-libraries.js +0 -93
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schematics": {
|
|
3
|
-
"
|
|
4
|
-
"version": "
|
|
5
|
-
"factory": "./update-
|
|
6
|
-
"description": "
|
|
3
|
+
"update-angular-packages-version-prefix": {
|
|
4
|
+
"version": "14.0.0",
|
|
5
|
+
"factory": "./update-14/angular-packages-version-prefix",
|
|
6
|
+
"description": "Update Angular packages 'dependencies' and 'devDependencies' version prefix to '^' instead of '~'."
|
|
7
7
|
},
|
|
8
|
-
"update-
|
|
9
|
-
"version": "
|
|
10
|
-
"factory": "./update-
|
|
11
|
-
"description": "
|
|
8
|
+
"update-tsconfig-target": {
|
|
9
|
+
"version": "14.0.0",
|
|
10
|
+
"factory": "./update-14/update-tsconfig-target",
|
|
11
|
+
"description": "Update TypeScript compilation target to 'ES2020'."
|
|
12
12
|
},
|
|
13
|
-
"
|
|
14
|
-
"version": "
|
|
15
|
-
"factory": "./update-
|
|
16
|
-
"description": "
|
|
17
|
-
},
|
|
18
|
-
"drop-ie-polyfills": {
|
|
19
|
-
"version": "13.0.0",
|
|
20
|
-
"factory": "./update-13/drop-ie-polyfills",
|
|
21
|
-
"description": "Remove polyfills required only for Internet Explorer which is no longer supported."
|
|
22
|
-
},
|
|
23
|
-
"update-gitignore": {
|
|
24
|
-
"version": "13.0.0",
|
|
25
|
-
"factory": "./update-13/update-gitignore",
|
|
26
|
-
"description": "Updating '.gitignore' to include '.angular/cache'."
|
|
13
|
+
"remove-show-circular-dependencies-option": {
|
|
14
|
+
"version": "14.0.0",
|
|
15
|
+
"factory": "./update-14/remove-show-circular-dependencies-option",
|
|
16
|
+
"description": "Remove 'showCircularDependencies' option from browser and server builders."
|
|
27
17
|
}
|
|
28
18
|
}
|
|
29
19
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
9
|
+
/**
|
|
10
|
+
* This migrations updates Angular packages 'dependencies' and 'devDependencies' version prefix to '^' instead of '~'.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* **Before**
|
|
14
|
+
* ```json
|
|
15
|
+
* dependencies: {
|
|
16
|
+
* "@angular/animations": "~13.1.0",
|
|
17
|
+
* "@angular/common": "~13.1.0"
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* **After**
|
|
22
|
+
* ```json
|
|
23
|
+
* dependencies: {
|
|
24
|
+
* "@angular/animations": "^13.1.0",
|
|
25
|
+
* "@angular/common": "^13.1.0"
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export default function (): Rule;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
11
|
+
const dependencies_1 = require("../../utility/dependencies");
|
|
12
|
+
const json_file_1 = require("../../utility/json-file");
|
|
13
|
+
const PACKAGES_REGEXP = /^@(?:angular|nguniversal|schematics|angular-devkit)\/|^ng-packagr$/;
|
|
14
|
+
/**
|
|
15
|
+
* This migrations updates Angular packages 'dependencies' and 'devDependencies' version prefix to '^' instead of '~'.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* **Before**
|
|
19
|
+
* ```json
|
|
20
|
+
* dependencies: {
|
|
21
|
+
* "@angular/animations": "~13.1.0",
|
|
22
|
+
* "@angular/common": "~13.1.0"
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* **After**
|
|
27
|
+
* ```json
|
|
28
|
+
* dependencies: {
|
|
29
|
+
* "@angular/animations": "^13.1.0",
|
|
30
|
+
* "@angular/common": "^13.1.0"
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
function default_1() {
|
|
35
|
+
return (tree, context) => {
|
|
36
|
+
const json = new json_file_1.JSONFile(tree, '/package.json');
|
|
37
|
+
updateVersionPrefixToTilde(json, dependencies_1.NodeDependencyType.Default);
|
|
38
|
+
updateVersionPrefixToTilde(json, dependencies_1.NodeDependencyType.Dev);
|
|
39
|
+
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.default = default_1;
|
|
43
|
+
function updateVersionPrefixToTilde(json, dependencyType) {
|
|
44
|
+
const dependencyTypePath = [dependencyType];
|
|
45
|
+
const dependencies = json.get(dependencyTypePath);
|
|
46
|
+
if (!dependencies || typeof dependencies !== 'object') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const updatedDependencies = new Map();
|
|
50
|
+
for (const [name, version] of Object.entries(dependencies)) {
|
|
51
|
+
if (typeof version === 'string' && version.charAt(0) === '~' && PACKAGES_REGEXP.test(name)) {
|
|
52
|
+
updatedDependencies.set(name, `^${version.substring(1)}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (updatedDependencies.size) {
|
|
56
|
+
json.modify(dependencyTypePath, {
|
|
57
|
+
...dependencies,
|
|
58
|
+
...Object.fromEntries(updatedDependencies),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const workspace_1 = require("../../utility/workspace");
|
|
11
|
+
/** Migration to remove 'showCircularDependencies' option from browser and server builders. */
|
|
12
|
+
function default_1() {
|
|
13
|
+
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
14
|
+
for (const project of workspace.projects.values()) {
|
|
15
|
+
for (const target of project.targets.values()) {
|
|
16
|
+
if (target.builder === '@angular-devkit/build-angular:server' ||
|
|
17
|
+
target.builder === '@angular-devkit/build-angular:browser') {
|
|
18
|
+
for (const [, options] of (0, workspace_1.allTargetOptions)(target)) {
|
|
19
|
+
delete options.showCircularDependencies;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const json_file_1 = require("../../utility/json-file");
|
|
11
|
+
const workspace_1 = require("../../utility/workspace");
|
|
12
|
+
const workspace_models_1 = require("../../utility/workspace-models");
|
|
13
|
+
/** Migration to update tsconfig compilation target option to es2020. */
|
|
14
|
+
function default_1() {
|
|
15
|
+
return async (host) => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
/** Builders for which the migration will run. */
|
|
18
|
+
const supportedBuilders = [workspace_models_1.Builders.Karma, workspace_models_1.Builders.NgPackagr, workspace_models_1.Builders.Browser];
|
|
19
|
+
/** Compilation targets values that should not be amended. */
|
|
20
|
+
const skipTargets = ['es2020', 'es2021', 'es2022', 'esnext'];
|
|
21
|
+
const uniqueTsConfigs = new Set(['/tsconfig.json']);
|
|
22
|
+
// Find all tsconfig files which are refereced by the builders.
|
|
23
|
+
const workspace = await (0, workspace_1.getWorkspace)(host);
|
|
24
|
+
for (const project of workspace.projects.values()) {
|
|
25
|
+
for (const target of project.targets.values()) {
|
|
26
|
+
if (!supportedBuilders.includes(target.builder)) {
|
|
27
|
+
// Unknown builder.
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
// Update all other known CLI builders that use a tsconfig.
|
|
31
|
+
const allOptions = [(_a = target.options) !== null && _a !== void 0 ? _a : {}, ...Object.values((_b = target.configurations) !== null && _b !== void 0 ? _b : {})];
|
|
32
|
+
for (const opt of allOptions) {
|
|
33
|
+
if (typeof (opt === null || opt === void 0 ? void 0 : opt.tsConfig) === 'string') {
|
|
34
|
+
uniqueTsConfigs.add(opt.tsConfig);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// Modify tsconfig files
|
|
40
|
+
const targetJsonPath = ['compilerOptions', 'target'];
|
|
41
|
+
for (const tsConfigPath of uniqueTsConfigs) {
|
|
42
|
+
const json = new json_file_1.JSONFile(host, tsConfigPath);
|
|
43
|
+
const target = json.get(targetJsonPath);
|
|
44
|
+
// Update compilation target when it's current set lower than es2020.
|
|
45
|
+
if (typeof target === 'string' && !skipTargets.includes(target.toLowerCase())) {
|
|
46
|
+
json.modify(targetJsonPath, 'es2020');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
exports.default = default_1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0-next.2",
|
|
4
4
|
"description": "Schematics specific to Angular",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
],
|
|
16
16
|
"schematics": "./collection.json",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@angular-devkit/core": "
|
|
19
|
-
"@angular-devkit/schematics": "
|
|
18
|
+
"@angular-devkit/core": "14.0.0-next.2",
|
|
19
|
+
"@angular-devkit/schematics": "14.0.0-next.2",
|
|
20
20
|
"jsonc-parser": "3.0.0"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
@@ -13,9 +13,9 @@ exports.latestVersions = {
|
|
|
13
13
|
// but ts_library doesn't support JSON inputs.
|
|
14
14
|
...require('./latest-versions/package.json')['dependencies'],
|
|
15
15
|
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
|
|
16
|
-
Angular: '
|
|
16
|
+
Angular: '^14.0.0-next.0',
|
|
17
17
|
// Since @angular-devkit/build-angular and @schematics/angular are always
|
|
18
18
|
// published together from the same monorepo, and they are both
|
|
19
19
|
// non-experimental, they will always have the same version.
|
|
20
|
-
DevkitBuildAngular: '
|
|
20
|
+
DevkitBuildAngular: '^' + require('../package.json')['version'],
|
|
21
21
|
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
9
|
-
/**
|
|
10
|
-
* Migrates all polyfills files of projects to remove two dependencies originally needed by Internet
|
|
11
|
-
* Explorer, but which are no longer needed now that support for IE has been dropped (`classlist.js`
|
|
12
|
-
* and `web-animations-js`).
|
|
13
|
-
*
|
|
14
|
-
* The polyfills file includes side-effectful imports of these dependencies with comments about
|
|
15
|
-
* their usage:
|
|
16
|
-
*
|
|
17
|
-
* ```
|
|
18
|
-
* /**
|
|
19
|
-
* * IE11 requires the following for NgClass support on SVG elements
|
|
20
|
-
* *\/
|
|
21
|
-
* import 'classlist.js';
|
|
22
|
-
*
|
|
23
|
-
* /**
|
|
24
|
-
* * Web Animations `@angular/platform-browser/animations`
|
|
25
|
-
* * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
|
26
|
-
* * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
|
27
|
-
* *\/
|
|
28
|
-
* import 'web-animations-js';
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* This migration removes the `import` statements as well as any preceeding comments. It also
|
|
32
|
-
* removes these dependencies from `package.json` if present and schedules an `npm install` task to
|
|
33
|
-
* remove them from `node_modules/`.
|
|
34
|
-
*
|
|
35
|
-
* Also, the polyfills file has previously been generated with these imports commented out, to not
|
|
36
|
-
* include the dependencies by default, but still allow users to easily uncomment and enable them
|
|
37
|
-
* when required. So the migration also looks for:
|
|
38
|
-
*
|
|
39
|
-
* ```
|
|
40
|
-
* // import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
41
|
-
* // OR
|
|
42
|
-
* // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* And removes them as well. This keeps the polyfills files clean and up to date. Whitespace is
|
|
46
|
-
* handled by leaving all trailing whitespace alone, and deleting all the leading newlines until the
|
|
47
|
-
* previous non-empty line of code. This means any extra lines before a removed polyfill is dropped,
|
|
48
|
-
* while any extra lines after a polyfill are retained. This roughly correlates to how a real
|
|
49
|
-
* developer might write such a file.
|
|
50
|
-
*/
|
|
51
|
-
export default function (): Rule;
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
33
|
-
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
34
|
-
const assert_1 = __importDefault(require("assert"));
|
|
35
|
-
const ts = __importStar(require("../../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
36
|
-
const dependencies_1 = require("../../utility/dependencies");
|
|
37
|
-
const workspace_1 = require("../../utility/workspace");
|
|
38
|
-
/**
|
|
39
|
-
* Migrates all polyfills files of projects to remove two dependencies originally needed by Internet
|
|
40
|
-
* Explorer, but which are no longer needed now that support for IE has been dropped (`classlist.js`
|
|
41
|
-
* and `web-animations-js`).
|
|
42
|
-
*
|
|
43
|
-
* The polyfills file includes side-effectful imports of these dependencies with comments about
|
|
44
|
-
* their usage:
|
|
45
|
-
*
|
|
46
|
-
* ```
|
|
47
|
-
* /**
|
|
48
|
-
* * IE11 requires the following for NgClass support on SVG elements
|
|
49
|
-
* *\/
|
|
50
|
-
* import 'classlist.js';
|
|
51
|
-
*
|
|
52
|
-
* /**
|
|
53
|
-
* * Web Animations `@angular/platform-browser/animations`
|
|
54
|
-
* * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
|
55
|
-
* * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
|
56
|
-
* *\/
|
|
57
|
-
* import 'web-animations-js';
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* This migration removes the `import` statements as well as any preceeding comments. It also
|
|
61
|
-
* removes these dependencies from `package.json` if present and schedules an `npm install` task to
|
|
62
|
-
* remove them from `node_modules/`.
|
|
63
|
-
*
|
|
64
|
-
* Also, the polyfills file has previously been generated with these imports commented out, to not
|
|
65
|
-
* include the dependencies by default, but still allow users to easily uncomment and enable them
|
|
66
|
-
* when required. So the migration also looks for:
|
|
67
|
-
*
|
|
68
|
-
* ```
|
|
69
|
-
* // import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
70
|
-
* // OR
|
|
71
|
-
* // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* And removes them as well. This keeps the polyfills files clean and up to date. Whitespace is
|
|
75
|
-
* handled by leaving all trailing whitespace alone, and deleting all the leading newlines until the
|
|
76
|
-
* previous non-empty line of code. This means any extra lines before a removed polyfill is dropped,
|
|
77
|
-
* while any extra lines after a polyfill are retained. This roughly correlates to how a real
|
|
78
|
-
* developer might write such a file.
|
|
79
|
-
*/
|
|
80
|
-
function default_1() {
|
|
81
|
-
return async (tree, ctx) => {
|
|
82
|
-
const modulesToDrop = new Set(['classlist.js', 'web-animations-js']);
|
|
83
|
-
// Remove modules from `package.json` dependencies.
|
|
84
|
-
const moduleDeps = Array.from(modulesToDrop.values())
|
|
85
|
-
.map((module) => (0, dependencies_1.getPackageJsonDependency)(tree, module))
|
|
86
|
-
.filter((dep) => !!dep);
|
|
87
|
-
for (const { name } of moduleDeps) {
|
|
88
|
-
(0, dependencies_1.removePackageJsonDependency)(tree, name);
|
|
89
|
-
}
|
|
90
|
-
// Run `npm install` after removal. This isn't strictly necessary, as keeping the dependencies
|
|
91
|
-
// in `node_modules/` doesn't break anything. however non-polyfill usages of these dependencies
|
|
92
|
-
// will work while they are in `node_modules/` but then break on the next `npm install`. If any
|
|
93
|
-
// such usages exist, it is better for them to fail immediately after the migration instead of
|
|
94
|
-
// the next time the user happens to `npm install`. As an optimization, only run `npm install`
|
|
95
|
-
// if a dependency was actually removed.
|
|
96
|
-
if (moduleDeps.length > 0) {
|
|
97
|
-
ctx.addTask(new tasks_1.NodePackageInstallTask());
|
|
98
|
-
}
|
|
99
|
-
// Find all the polyfill files in the workspace.
|
|
100
|
-
const wksp = await (0, workspace_1.getWorkspace)(tree);
|
|
101
|
-
const polyfills = Array.from((0, workspace_1.allWorkspaceTargets)(wksp))
|
|
102
|
-
.filter(([_, target]) => { var _a; return !!((_a = target.options) === null || _a === void 0 ? void 0 : _a.polyfills); })
|
|
103
|
-
.map(([_, target]) => { var _a; return (_a = target.options) === null || _a === void 0 ? void 0 : _a.polyfills; });
|
|
104
|
-
const uniquePolyfills = Array.from(new Set(polyfills));
|
|
105
|
-
// Drop the modules from each polyfill.
|
|
106
|
-
return (0, schematics_1.chain)(uniquePolyfills.map((polyfillPath) => dropModules(polyfillPath, modulesToDrop)));
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
exports.default = default_1;
|
|
110
|
-
/** Processes the given polyfill path and removes any `import` statements for the given modules. */
|
|
111
|
-
function dropModules(polyfillPath, modules) {
|
|
112
|
-
return (tree, ctx) => {
|
|
113
|
-
const sourceContent = tree.read(polyfillPath);
|
|
114
|
-
if (!sourceContent) {
|
|
115
|
-
ctx.logger.warn('Polyfill path from workspace configuration could not be read, does the file exist?', { polyfillPath });
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const content = sourceContent.toString('utf8');
|
|
119
|
-
const sourceFile = ts.createSourceFile(polyfillPath, content.replace(/^\uFEFF/, ''), ts.ScriptTarget.Latest, true /* setParentNodes */);
|
|
120
|
-
// Remove polyfills for the given module specifiers.
|
|
121
|
-
const recorder = tree.beginUpdate(polyfillPath);
|
|
122
|
-
removePolyfillImports(recorder, sourceFile, modules);
|
|
123
|
-
removePolyfillImportComments(recorder, sourceFile, modules);
|
|
124
|
-
tree.commitUpdate(recorder);
|
|
125
|
-
return tree;
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Searches the source file for any `import '${module}';` statements and removes them along with
|
|
130
|
-
* any preceeding comments.
|
|
131
|
-
*
|
|
132
|
-
* @param recorder The recorder to remove from.
|
|
133
|
-
* @param sourceFile The source file containing the `import` statements.
|
|
134
|
-
* @param modules The module specifiers to remove.
|
|
135
|
-
*/
|
|
136
|
-
function removePolyfillImports(recorder, sourceFile, modules) {
|
|
137
|
-
const imports = sourceFile.statements.filter((stmt) => ts.isImportDeclaration(stmt));
|
|
138
|
-
for (const i of imports) {
|
|
139
|
-
// Should always be a string literal.
|
|
140
|
-
(0, assert_1.default)(ts.isStringLiteral(i.moduleSpecifier));
|
|
141
|
-
// Ignore other modules.
|
|
142
|
-
if (!modules.has(i.moduleSpecifier.text)) {
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
// Remove the module import statement.
|
|
146
|
-
recorder.remove(i.getStart(), i.getWidth());
|
|
147
|
-
// Remove leading comments. "Leading" comments seems to include comments within the node, so
|
|
148
|
-
// even though `getFullText()` returns an index before any leading comments to a node, it will
|
|
149
|
-
// still find and process them.
|
|
150
|
-
ts.forEachLeadingCommentRange(sourceFile.getFullText(), i.getFullStart(), (start, end, _, hasTrailingNewLine) => {
|
|
151
|
-
// Include both leading **and** trailing newlines because these are comments that *preceed*
|
|
152
|
-
// the `import` statement, so "trailing" newlines here are actually in-between the `import`
|
|
153
|
-
// and it's leading comments.
|
|
154
|
-
const commentRangeWithoutNewLines = { start, end };
|
|
155
|
-
const commentRangeWithTrailingNewLines = hasTrailingNewLine
|
|
156
|
-
? includeTrailingNewLine(sourceFile, commentRangeWithoutNewLines)
|
|
157
|
-
: commentRangeWithoutNewLines;
|
|
158
|
-
const commentRange = includeLeadingNewLines(sourceFile, commentRangeWithTrailingNewLines);
|
|
159
|
-
if (!isProtectedComment(sourceFile, commentRange)) {
|
|
160
|
-
recorder.remove(commentRange.start, commentRange.end - commentRange.start);
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Searches the source file for any `// import '${module}';` comments and removes them along with
|
|
167
|
-
* any preceeding comments.
|
|
168
|
-
*
|
|
169
|
-
* Recent `ng new` invocations generate polyfills commented out and not used by default. Ex:
|
|
170
|
-
* /**
|
|
171
|
-
* * IE11 requires the following for NgClass support on SVG elements
|
|
172
|
-
* *\/
|
|
173
|
-
* // import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
174
|
-
*
|
|
175
|
-
* This function identifies any commented out import statements for the given module specifiers and
|
|
176
|
-
* removes them along with immediately preceeding comments.
|
|
177
|
-
*
|
|
178
|
-
* @param recorder The recorder to remove from.
|
|
179
|
-
* @param sourceFile The source file containing the commented `import` statements.
|
|
180
|
-
* @param modules The module specifiers to remove.
|
|
181
|
-
*/
|
|
182
|
-
function removePolyfillImportComments(recorder, sourceFile, modules) {
|
|
183
|
-
// Find all comment ranges in the source file.
|
|
184
|
-
const commentRanges = getCommentRanges(sourceFile);
|
|
185
|
-
// Find the indexes of comments which contain `import` statements for the given modules.
|
|
186
|
-
const moduleImportCommentIndexes = filterIndex(commentRanges, ({ start, end }) => {
|
|
187
|
-
const comment = getCommentText(sourceFile.getFullText().slice(start, end));
|
|
188
|
-
return Array.from(modules.values()).some((module) => comment.startsWith(`import '${module}';`));
|
|
189
|
-
});
|
|
190
|
-
// Use the module import comment **and** it's preceding comment if present.
|
|
191
|
-
const commentIndexesToRemove = moduleImportCommentIndexes.flatMap((index) => {
|
|
192
|
-
if (index === 0) {
|
|
193
|
-
return [0];
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
return [index - 1, index];
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
// Get all the ranges for the comments to remove.
|
|
200
|
-
const commentRangesToRemove = commentIndexesToRemove
|
|
201
|
-
.map((index) => commentRanges[index])
|
|
202
|
-
// Include leading newlines but **not** trailing newlines in order to leave appropriate space
|
|
203
|
-
// between any remaining polyfills.
|
|
204
|
-
.map((range) => includeLeadingNewLines(sourceFile, range))
|
|
205
|
-
.filter((range) => !isProtectedComment(sourceFile, range));
|
|
206
|
-
// Remove the comments.
|
|
207
|
-
for (const { start, end } of commentRangesToRemove) {
|
|
208
|
-
recorder.remove(start, end - start);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Returns whether a comment range is "protected", meaning it should **not** be deleted.
|
|
213
|
-
*
|
|
214
|
-
* There are two comments which are considered "protected":
|
|
215
|
-
* 1. The file overview doc comment previously generated by `ng new`.
|
|
216
|
-
* 2. The browser polyfills header (/***** BROWSER POLYFILLS *\/).
|
|
217
|
-
*/
|
|
218
|
-
function isProtectedComment(sourceFile, { start, end }) {
|
|
219
|
-
const comment = getCommentText(sourceFile.getFullText().slice(start, end));
|
|
220
|
-
const isFileOverviewDocComment = comment.startsWith('This file includes polyfills needed by Angular and is loaded before the app.');
|
|
221
|
-
const isBrowserPolyfillsHeader = comment.startsWith('BROWSER POLYFILLS');
|
|
222
|
-
return isFileOverviewDocComment || isBrowserPolyfillsHeader;
|
|
223
|
-
}
|
|
224
|
-
/** Returns all the comments in the given source file. */
|
|
225
|
-
function getCommentRanges(sourceFile) {
|
|
226
|
-
const commentRanges = [];
|
|
227
|
-
// Comments trailing the last node are also included in this.
|
|
228
|
-
ts.forEachChild(sourceFile, (node) => {
|
|
229
|
-
ts.forEachLeadingCommentRange(sourceFile.getFullText(), node.getFullStart(), (start, end) => {
|
|
230
|
-
commentRanges.push({ start, end });
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
return commentRanges;
|
|
234
|
-
}
|
|
235
|
-
/** Returns a `SourceRange` with any leading newlines' characters included if present. */
|
|
236
|
-
function includeLeadingNewLines(sourceFile, { start, end }) {
|
|
237
|
-
const text = sourceFile.getFullText();
|
|
238
|
-
while (start > 0) {
|
|
239
|
-
if (start > 2 && text.slice(start - 2, start) === '\r\n') {
|
|
240
|
-
// Preceeded by `\r\n`, include that.
|
|
241
|
-
start -= 2;
|
|
242
|
-
}
|
|
243
|
-
else if (start > 1 && text[start - 1] === '\n') {
|
|
244
|
-
// Preceeded by `\n`, include that.
|
|
245
|
-
start--;
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
// Not preceeded by any newline characters, don't include anything else.
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return { start, end };
|
|
253
|
-
}
|
|
254
|
-
/** Returns a `SourceRange` with the trailing newline characters included if present. */
|
|
255
|
-
function includeTrailingNewLine(sourceFile, { start, end }) {
|
|
256
|
-
const newline = sourceFile.getFullText().slice(end, end + 2);
|
|
257
|
-
if (newline === '\r\n') {
|
|
258
|
-
return { start, end: end + 2 };
|
|
259
|
-
}
|
|
260
|
-
else if (newline.startsWith('\n')) {
|
|
261
|
-
return { start, end: end + 1 };
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
throw new Error('Expected comment to end in a newline character (either `\\n` or `\\r\\n`).');
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Extracts the text from a comment. Attempts to remove any extraneous syntax and trims the content.
|
|
269
|
-
*/
|
|
270
|
-
function getCommentText(commentInput) {
|
|
271
|
-
const comment = commentInput.trim();
|
|
272
|
-
if (comment.startsWith('//')) {
|
|
273
|
-
return comment.slice('//'.length).trim();
|
|
274
|
-
}
|
|
275
|
-
else if (comment.startsWith('/*')) {
|
|
276
|
-
const withoutPrefix = comment.replace(/\/\*+/, '');
|
|
277
|
-
const withoutSuffix = withoutPrefix.replace(/\*+\//, '');
|
|
278
|
-
const withoutNewlineAsterisks = withoutSuffix.replace(/^\s*\*\s*/, '');
|
|
279
|
-
return withoutNewlineAsterisks.trim();
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
throw new Error(`Expected a comment, but got: "${comment}".`);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
/** Like `Array.prototype.filter`, but returns the index of each item rather than its value. */
|
|
286
|
-
function filterIndex(items, filter) {
|
|
287
|
-
return Array.from(items.entries())
|
|
288
|
-
.filter(([_, item]) => filter(item))
|
|
289
|
-
.map(([index]) => index);
|
|
290
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
9
|
-
export default function (): Rule;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const core_1 = require("@angular-devkit/core");
|
|
11
|
-
const workspace_1 = require("../../utility/workspace");
|
|
12
|
-
function default_1() {
|
|
13
|
-
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
14
|
-
// Update root level schematics options if present
|
|
15
|
-
const rootSchematics = workspace.extensions.schematics;
|
|
16
|
-
if (rootSchematics && core_1.json.isJsonObject(rootSchematics)) {
|
|
17
|
-
updateSchematicsField(rootSchematics);
|
|
18
|
-
}
|
|
19
|
-
// Update project level schematics options if present
|
|
20
|
-
for (const [, project] of workspace.projects) {
|
|
21
|
-
const projectSchematics = project.extensions.schematics;
|
|
22
|
-
if (projectSchematics && core_1.json.isJsonObject(projectSchematics)) {
|
|
23
|
-
updateSchematicsField(projectSchematics);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
exports.default = default_1;
|
|
29
|
-
function updateSchematicsField(schematics) {
|
|
30
|
-
for (const [schematicName, schematicOptions] of Object.entries(schematics)) {
|
|
31
|
-
if (!core_1.json.isJsonObject(schematicOptions)) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (schematicName.startsWith('@schematics/angular')) {
|
|
35
|
-
delete schematicOptions.lintFix;
|
|
36
|
-
}
|
|
37
|
-
switch (schematicName) {
|
|
38
|
-
case '@schematics/angular:service-worker':
|
|
39
|
-
delete schematicOptions.configuration;
|
|
40
|
-
break;
|
|
41
|
-
case '@schematics/angular:web-worker':
|
|
42
|
-
delete schematicOptions.target;
|
|
43
|
-
break;
|
|
44
|
-
case '@schematics/angular:application':
|
|
45
|
-
delete schematicOptions.legacyBrowsers;
|
|
46
|
-
break;
|
|
47
|
-
default:
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const workspace_1 = require("../../utility/workspace");
|
|
11
|
-
function default_1() {
|
|
12
|
-
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
13
|
-
for (const [, project] of workspace.projects) {
|
|
14
|
-
for (const [name, target] of project.targets) {
|
|
15
|
-
// Delete removed tslint builder
|
|
16
|
-
if (target.builder === '@angular-devkit/build-angular:tslint') {
|
|
17
|
-
project.targets.delete(name);
|
|
18
|
-
}
|
|
19
|
-
else if (target.builder === '@angular-devkit/build-angular:dev-server') {
|
|
20
|
-
for (const [, options] of (0, workspace_1.allTargetOptions)(target)) {
|
|
21
|
-
delete options.optimization;
|
|
22
|
-
delete options.aot;
|
|
23
|
-
delete options.progress;
|
|
24
|
-
delete options.deployUrl;
|
|
25
|
-
delete options.sourceMap;
|
|
26
|
-
delete options.vendorChunk;
|
|
27
|
-
delete options.commonChunk;
|
|
28
|
-
delete options.baseHref;
|
|
29
|
-
delete options.servePathDefaultWarning;
|
|
30
|
-
delete options.hmrWarning;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
else if (target.builder.startsWith('@angular-devkit/build-angular')) {
|
|
34
|
-
// Only interested in Angular Devkit builders
|
|
35
|
-
for (const [, options] of (0, workspace_1.allTargetOptions)(target)) {
|
|
36
|
-
delete options.extractCss;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
exports.default = default_1;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
function default_1() {
|
|
11
|
-
return (tree, context) => {
|
|
12
|
-
var _a;
|
|
13
|
-
const gitIgnoreEntry = '/.angular/cache';
|
|
14
|
-
const gitIgnorePath = '.gitignore';
|
|
15
|
-
const contents = (_a = tree.read(gitIgnorePath)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
16
|
-
if (!contents) {
|
|
17
|
-
context.logger.warn(`Could not find '${gitIgnorePath}'.`);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (contents.includes(gitIgnoreEntry)) {
|
|
21
|
-
// The migration has run already.
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// Try to insert the new entry in the misc section.
|
|
25
|
-
const recorder = tree.beginUpdate(gitIgnorePath);
|
|
26
|
-
let idx = contents.indexOf('# misc');
|
|
27
|
-
if (idx < 0) {
|
|
28
|
-
idx = 0;
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
switch (contents[idx + 6]) {
|
|
32
|
-
case '\n':
|
|
33
|
-
idx += 7;
|
|
34
|
-
break;
|
|
35
|
-
case '\r':
|
|
36
|
-
idx += 8;
|
|
37
|
-
break;
|
|
38
|
-
default:
|
|
39
|
-
// the word is something else.
|
|
40
|
-
idx = 0;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
recorder.insertLeft(idx, `${gitIgnoreEntry}\n`);
|
|
45
|
-
tree.commitUpdate(recorder);
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
exports.default = default_1;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
9
|
-
export default function (): Rule;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const core_1 = require("@angular-devkit/core");
|
|
11
|
-
const json_file_1 = require("../../utility/json-file");
|
|
12
|
-
const workspace_1 = require("../../utility/workspace");
|
|
13
|
-
function* visit(directory) {
|
|
14
|
-
for (const path of directory.subfiles) {
|
|
15
|
-
if (path === 'package.json') {
|
|
16
|
-
const entry = directory.file(path);
|
|
17
|
-
if ((entry === null || entry === void 0 ? void 0 : entry.content.toString().includes('ngPackage')) !== true) {
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else if (path !== 'ng-package.json') {
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
yield (0, core_1.join)(directory.path, path);
|
|
25
|
-
}
|
|
26
|
-
for (const path of directory.subdirs) {
|
|
27
|
-
if (path === 'node_modules' || path.startsWith('.')) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
yield* visit(directory.dir(path));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function default_1() {
|
|
34
|
-
const ENABLE_IVY_JSON_PATH = ['angularCompilerOptions', 'enableIvy'];
|
|
35
|
-
const COMPILATION_MODE_JSON_PATH = ['angularCompilerOptions', 'compilationMode'];
|
|
36
|
-
const NG_PACKAGR_DEPRECATED_OPTIONS_PATHS = [
|
|
37
|
-
['lib', 'umdModuleIds'],
|
|
38
|
-
['lib', 'amdId'],
|
|
39
|
-
['lib', 'umdId'],
|
|
40
|
-
['ngPackage', 'lib', 'umdModuleIds'],
|
|
41
|
-
['ngPackage', 'lib', 'amdId'],
|
|
42
|
-
['ngPackage', 'lib', 'umdId'],
|
|
43
|
-
];
|
|
44
|
-
return async (tree, context) => {
|
|
45
|
-
const workspace = await (0, workspace_1.getWorkspace)(tree);
|
|
46
|
-
const librariesTsConfig = new Set();
|
|
47
|
-
const ngPackagrConfig = new Set();
|
|
48
|
-
for (const [, project] of workspace.projects) {
|
|
49
|
-
for (const [_, target] of project.targets) {
|
|
50
|
-
if (target.builder !== '@angular-devkit/build-angular:ng-packagr') {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
for (const [, options] of (0, workspace_1.allTargetOptions)(target)) {
|
|
54
|
-
if (typeof options.tsConfig === 'string') {
|
|
55
|
-
librariesTsConfig.add(options.tsConfig);
|
|
56
|
-
}
|
|
57
|
-
if (typeof options.project === 'string') {
|
|
58
|
-
if (options.project.endsWith('.json')) {
|
|
59
|
-
ngPackagrConfig.add(options.project);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
context.logger
|
|
63
|
-
.warn(core_1.tags.stripIndent `Expected a JSON configuration file but found "${options.project}".
|
|
64
|
-
You may need to adjust the configuration file to remove invalid options.
|
|
65
|
-
For more information, see the breaking changes section within the release notes: https://github.com/ng-packagr/ng-packagr/releases/tag/v13.0.0/.`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
// Gather configurations which are not referecned in angular.json
|
|
72
|
-
// (This happens when users have secondary entry-points)
|
|
73
|
-
for (const p of visit(tree.root)) {
|
|
74
|
-
ngPackagrConfig.add(p);
|
|
75
|
-
}
|
|
76
|
-
// Update ng-packagr configuration
|
|
77
|
-
for (const config of ngPackagrConfig) {
|
|
78
|
-
const json = new json_file_1.JSONFile(tree, config);
|
|
79
|
-
for (const optionPath of NG_PACKAGR_DEPRECATED_OPTIONS_PATHS) {
|
|
80
|
-
json.remove(optionPath);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// Update tsconfig files
|
|
84
|
-
for (const tsConfig of librariesTsConfig) {
|
|
85
|
-
const json = new json_file_1.JSONFile(tree, tsConfig);
|
|
86
|
-
if (json.get(ENABLE_IVY_JSON_PATH) === false) {
|
|
87
|
-
json.remove(ENABLE_IVY_JSON_PATH);
|
|
88
|
-
json.modify(COMPILATION_MODE_JSON_PATH, 'partial');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
exports.default = default_1;
|