@schematics/angular 12.0.0-rc.0 → 12.0.0
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/README.md +20 -20
- package/app-shell/app-shell-long.md +2 -2
- package/app-shell/index.d.ts +7 -0
- package/app-shell/index.js +17 -19
- package/app-shell/schema.d.ts +4 -4
- package/app-shell/schema.json +2 -4
- package/application/index.d.ts +7 -0
- package/application/index.js +46 -47
- package/application/other-files/app.component.html.template +0 -11
- package/application/schema.json +15 -13
- package/class/index.d.ts +7 -0
- package/class/index.js +9 -9
- package/class/schema.json +1 -3
- package/collection.json +13 -13
- package/component/index.d.ts +7 -0
- package/component/index.js +23 -20
- package/component/schema.json +3 -10
- package/directive/index.d.ts +7 -0
- package/directive/index.js +13 -13
- package/directive/schema.json +1 -3
- package/e2e/e2e-long.md +1 -1
- package/e2e/index.d.ts +7 -0
- package/e2e/index.js +20 -8
- package/e2e/schema.json +1 -3
- package/enum/files/{__name@dasherize__.enum.ts.template → __name@dasherize____type__.ts.template} +0 -0
- package/enum/index.d.ts +7 -0
- package/enum/index.js +8 -7
- package/enum/schema.d.ts +4 -0
- package/enum/schema.json +5 -3
- package/guard/files/__name@dasherize__.guard.ts.template +1 -1
- package/guard/index.d.ts +7 -0
- package/guard/index.js +20 -12
- package/guard/schema.json +3 -12
- package/interceptor/index.d.ts +7 -0
- package/interceptor/index.js +4 -4
- package/interface/index.d.ts +7 -0
- package/interface/index.js +3 -3
- package/interface/schema.json +1 -3
- package/library/index.d.ts +7 -0
- package/library/index.js +4 -4
- package/library/library-long.md +1 -1
- package/migrations/update-10/add-deprecation-rule-tslint.d.ts +7 -0
- package/migrations/update-10/add-deprecation-rule-tslint.js +8 -1
- package/migrations/update-10/remove-es5-browser-support.d.ts +1 -1
- package/migrations/update-10/remove-es5-browser-support.js +5 -9
- package/migrations/update-10/remove-solution-style-tsconfig.d.ts +7 -0
- package/migrations/update-10/remove-solution-style-tsconfig.js +4 -3
- package/migrations/update-10/rename-browserslist-config.d.ts +7 -0
- package/migrations/update-10/rename-browserslist-config.js +3 -3
- package/migrations/update-10/update-angular-config.d.ts +1 -1
- package/migrations/update-10/update-angular-config.js +2 -2
- package/migrations/update-10/update-dependencies.d.ts +1 -1
- package/migrations/update-10/update-dependencies.js +7 -0
- package/migrations/update-10/update-libraries-tslib.d.ts +1 -1
- package/migrations/update-10/update-libraries-tslib.js +1 -1
- package/migrations/update-10/update-module-and-target-compiler-options.d.ts +7 -0
- package/migrations/update-10/update-module-and-target-compiler-options.js +11 -12
- package/migrations/update-10/update-tslint.d.ts +7 -0
- package/migrations/update-10/update-tslint.js +13 -8
- package/migrations/update-11/add-declaration-map-compiler-option.d.ts +1 -1
- package/migrations/update-11/add-declaration-map-compiler-option.js +1 -1
- package/migrations/update-11/replace-ng-packagr-builder.d.ts +1 -1
- package/migrations/update-11/replace-ng-packagr-builder.js +3 -3
- package/migrations/update-11/update-angular-config.d.ts +1 -1
- package/migrations/update-11/update-angular-config.js +3 -3
- package/migrations/update-11/update-dependencies.d.ts +1 -1
- package/migrations/update-11/update-dependencies.js +7 -0
- package/migrations/update-12/production-default-config.d.ts +1 -1
- package/migrations/update-12/production-default-config.js +4 -3
- package/migrations/update-12/remove-emit-decorator-metadata.d.ts +7 -0
- package/migrations/update-12/remove-emit-decorator-metadata.js +15 -3
- package/migrations/update-12/update-angular-config.d.ts +1 -1
- package/migrations/update-12/update-angular-config.js +6 -5
- package/migrations/update-12/update-lazy-module-paths.d.ts +1 -1
- package/migrations/update-12/update-lazy-module-paths.js +9 -4
- package/migrations/update-12/update-web-workers.d.ts +1 -1
- package/migrations/update-12/update-web-workers.js +7 -0
- package/migrations/update-12/update-zonejs.d.ts +7 -0
- package/migrations/update-12/update-zonejs.js +3 -4
- package/migrations/update-9/add-tslib.d.ts +1 -1
- package/migrations/update-9/add-tslib.js +8 -1
- package/migrations/update-9/index.d.ts +1 -1
- package/migrations/update-9/index.js +2 -2
- package/migrations/update-9/ivy-libraries.d.ts +1 -1
- package/migrations/update-9/ivy-libraries.js +2 -2
- package/migrations/update-9/ngsw-config.d.ts +1 -1
- package/migrations/update-9/ngsw-config.js +7 -0
- package/migrations/update-9/remove-tsickle.d.ts +1 -1
- package/migrations/update-9/remove-tsickle.js +7 -0
- package/migrations/update-9/schematic-options.d.ts +7 -0
- package/migrations/update-9/schematic-options.js +3 -3
- package/migrations/update-9/update-app-tsconfigs.d.ts +7 -0
- package/migrations/update-9/update-app-tsconfigs.js +3 -3
- package/migrations/update-9/update-dependencies.d.ts +1 -1
- package/migrations/update-9/update-dependencies.js +7 -0
- package/migrations/update-9/update-i18n.d.ts +7 -0
- package/migrations/update-9/update-i18n.js +9 -4
- package/migrations/update-9/update-server-main-file.d.ts +1 -1
- package/migrations/update-9/update-server-main-file.js +12 -5
- package/migrations/update-9/update-workspace-config.d.ts +7 -0
- package/migrations/update-9/update-workspace-config.js +7 -0
- package/migrations/update-9/utils.d.ts +7 -0
- package/migrations/update-9/utils.js +3 -3
- package/module/index.d.ts +7 -0
- package/module/index.js +14 -16
- package/module/schema.json +2 -4
- package/ng-new/index.d.ts +1 -1
- package/ng-new/index.js +3 -5
- package/package.json +4 -4
- package/pipe/index.d.ts +7 -0
- package/pipe/index.js +8 -8
- package/pipe/schema.json +1 -3
- package/resolver/index.d.ts +7 -0
- package/resolver/index.js +9 -11
- package/resolver/schema.json +1 -3
- package/service/index.d.ts +7 -0
- package/service/index.js +4 -4
- package/service-worker/index.d.ts +7 -0
- package/service-worker/index.js +2 -2
- package/service-worker/schema.d.ts +13 -13
- package/service-worker/schema.json +1 -3
- package/universal/index.d.ts +7 -0
- package/universal/index.js +15 -14
- package/universal/schema.d.ts +4 -4
- package/universal/schema.json +6 -5
- package/utility/ast-utils.d.ts +7 -0
- package/utility/ast-utils.js +40 -45
- package/utility/change.d.ts +1 -1
- package/utility/change.js +13 -4
- package/utility/dependencies.d.ts +1 -1
- package/utility/dependencies.js +7 -0
- package/utility/find-module.d.ts +1 -1
- package/utility/find-module.js +14 -14
- package/utility/json-file.d.ts +1 -1
- package/utility/json-file.js +2 -2
- package/utility/latest-versions.d.ts +1 -1
- package/utility/latest-versions.js +3 -3
- package/utility/lint-fix.d.ts +1 -1
- package/utility/lint-fix.js +4 -4
- package/utility/ng-ast-utils.d.ts +7 -0
- package/utility/ng-ast-utils.js +8 -7
- package/utility/parse-name.d.ts +1 -1
- package/utility/parse-name.js +3 -3
- package/utility/paths.d.ts +1 -1
- package/utility/paths.js +1 -1
- package/utility/project-targets.d.ts +1 -1
- package/utility/project-targets.js +1 -1
- package/utility/test/create-app-module.d.ts +1 -1
- package/utility/test/create-app-module.js +7 -0
- package/utility/test/get-file-content.d.ts +1 -1
- package/utility/test/get-file-content.js +7 -0
- package/utility/test/index.d.ts +1 -1
- package/utility/test/index.js +7 -7
- package/utility/validation.d.ts +7 -0
- package/utility/validation.js +5 -5
- package/utility/workspace-models.d.ts +3 -3
- package/utility/workspace-models.js +3 -3
- package/utility/workspace.d.ts +1 -1
- package/utility/workspace.js +3 -3
- package/web-worker/index.d.ts +7 -0
- package/web-worker/index.js +8 -6
- package/web-worker/schema.json +1 -4
- package/workspace/files/package.json.template +2 -5
- package/workspace/index.d.ts +7 -0
- package/workspace/index.js +3 -3
- package/workspace/schema.json +1 -4
|
@@ -1,2 +1,9 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
9
|
export default function (): Rule;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const core_1 = require("@angular-devkit/core");
|
|
11
11
|
const json_file_1 = require("../../utility/json-file");
|
|
12
12
|
function* visitExtendedJsonFiles(directory) {
|
|
@@ -54,7 +54,8 @@ function default_1() {
|
|
|
54
54
|
const tsConfigDir = core_1.dirname(core_1.normalize(path));
|
|
55
55
|
const tsConfigJson = new json_file_1.JSONFile(host, path);
|
|
56
56
|
const extendsValue = tsConfigJson.get(extendsJsonPath);
|
|
57
|
-
if (typeof extendsValue === 'string' &&
|
|
57
|
+
if (typeof extendsValue === 'string' &&
|
|
58
|
+
'/tsconfig.base.json' === core_1.resolve(tsConfigDir, core_1.normalize(extendsValue))) {
|
|
58
59
|
// tsconfig extends the workspace tsconfig path.
|
|
59
60
|
tsConfigJson.modify(extendsJsonPath, extendsValue.replace('tsconfig.base.json', 'tsconfig.json'));
|
|
60
61
|
}
|
|
@@ -1,2 +1,9 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
9
|
export default function (): Rule;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const core_1 = require("@angular-devkit/core");
|
|
11
11
|
function* visit(directory) {
|
|
12
12
|
for (const path of directory.subfiles) {
|
|
@@ -23,7 +23,7 @@ function* visit(directory) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
function default_1() {
|
|
26
|
-
return tree => {
|
|
26
|
+
return (tree) => {
|
|
27
27
|
for (const path of visit(tree.root)) {
|
|
28
28
|
tree.rename(path, path.replace(/browserslist$/, '.browserslistrc'));
|
|
29
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -11,7 +11,7 @@ const core_1 = require("@angular-devkit/core");
|
|
|
11
11
|
const workspace_1 = require("../../utility/workspace");
|
|
12
12
|
const workspace_models_1 = require("../../utility/workspace-models");
|
|
13
13
|
function default_1() {
|
|
14
|
-
return workspace_1.updateWorkspace(workspace => {
|
|
14
|
+
return workspace_1.updateWorkspace((workspace) => {
|
|
15
15
|
// Remove deprecated CLI root level options
|
|
16
16
|
removeDeprecatedCLIOptions(workspace.extensions);
|
|
17
17
|
for (const [, project] of workspace.projects) {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
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
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
4
11
|
const dependencies_1 = require("../../utility/dependencies");
|
|
@@ -1,2 +1,9 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
9
|
export default function (): Rule;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const core_1 = require("@angular-devkit/core");
|
|
11
11
|
const json_file_1 = require("../../utility/json-file");
|
|
12
12
|
const workspace_1 = require("../../utility/workspace");
|
|
@@ -29,7 +29,8 @@ function default_1() {
|
|
|
29
29
|
for (const [, project] of workspace.projects) {
|
|
30
30
|
for (const [, target] of project.targets) {
|
|
31
31
|
// E2E builder doesn't reference a tsconfig but it uses one found in the root folder.
|
|
32
|
-
if (target.builder === workspace_models_1.Builders.Protractor &&
|
|
32
|
+
if (target.builder === workspace_models_1.Builders.Protractor &&
|
|
33
|
+
typeof ((_a = target.options) === null || _a === void 0 ? void 0 : _a.protractorConfig) === 'string') {
|
|
33
34
|
const tsConfigPath = core_1.join(core_1.dirname(core_1.normalize(target.options.protractorConfig)), 'tsconfig.json');
|
|
34
35
|
try {
|
|
35
36
|
updateModuleAndTarget(host, tsConfigPath, {
|
|
@@ -43,19 +44,16 @@ function default_1() {
|
|
|
43
44
|
continue;
|
|
44
45
|
}
|
|
45
46
|
// Update all other known CLI builders that use a tsconfig
|
|
46
|
-
const tsConfigs = [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
]
|
|
50
|
-
.filter(opt => typeof (opt === null || opt === void 0 ? void 0 : opt.tsConfig) === 'string')
|
|
51
|
-
.map(opt => opt.tsConfig);
|
|
47
|
+
const tsConfigs = [target.options || {}, ...Object.values(target.configurations || {})]
|
|
48
|
+
.filter((opt) => typeof (opt === null || opt === void 0 ? void 0 : opt.tsConfig) === 'string')
|
|
49
|
+
.map((opt) => opt.tsConfig);
|
|
52
50
|
const uniqueTsConfigs = [...new Set(tsConfigs)];
|
|
53
51
|
if (uniqueTsConfigs.length < 1) {
|
|
54
52
|
continue;
|
|
55
53
|
}
|
|
56
54
|
switch (target.builder) {
|
|
57
55
|
case workspace_models_1.Builders.Server:
|
|
58
|
-
uniqueTsConfigs.forEach(p => {
|
|
56
|
+
uniqueTsConfigs.forEach((p) => {
|
|
59
57
|
try {
|
|
60
58
|
updateModuleAndTarget(host, p, {
|
|
61
59
|
oldModule: 'commonjs',
|
|
@@ -81,7 +79,7 @@ function default_1() {
|
|
|
81
79
|
case workspace_models_1.Builders.Karma:
|
|
82
80
|
case workspace_models_1.Builders.Browser:
|
|
83
81
|
case workspace_models_1.Builders.DeprecatedNgPackagr:
|
|
84
|
-
uniqueTsConfigs.forEach(p => {
|
|
82
|
+
uniqueTsConfigs.forEach((p) => {
|
|
85
83
|
try {
|
|
86
84
|
updateModuleAndTarget(host, p, {
|
|
87
85
|
oldModule: 'esnext',
|
|
@@ -104,7 +102,8 @@ function updateModuleAndTarget(host, tsConfigPath, replacements) {
|
|
|
104
102
|
const { oldTarget, newTarget, newModule, oldModule } = replacements;
|
|
105
103
|
if (newTarget) {
|
|
106
104
|
const target = json.get(['compilerOptions', 'target']);
|
|
107
|
-
if ((typeof target === 'string' && (!oldTarget || oldTarget === target.toLowerCase())) ||
|
|
105
|
+
if ((typeof target === 'string' && (!oldTarget || oldTarget === target.toLowerCase())) ||
|
|
106
|
+
!target) {
|
|
108
107
|
json.modify(['compilerOptions', 'target'], newTarget);
|
|
109
108
|
}
|
|
110
109
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
9
|
export declare const TSLINT_VERSION = "~6.1.0";
|
|
3
10
|
export default function (): Rule;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
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
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.TSLINT_VERSION = void 0;
|
|
4
11
|
const dependencies_1 = require("../../utility/dependencies");
|
|
5
12
|
const json_file_1 = require("../../utility/json-file");
|
|
6
13
|
exports.TSLINT_VERSION = '~6.1.0';
|
|
7
14
|
const TSLINT_CONFIG_PATH = '/tslint.json';
|
|
8
|
-
const RULES_TO_DELETE = [
|
|
9
|
-
'no-use-before-declare',
|
|
10
|
-
'no-unused-variable',
|
|
11
|
-
];
|
|
15
|
+
const RULES_TO_DELETE = ['no-use-before-declare', 'no-unused-variable'];
|
|
12
16
|
const RULES_TO_ADD = {
|
|
13
17
|
align: {
|
|
14
18
|
options: ['parameters', 'statements'],
|
|
@@ -85,7 +89,7 @@ function default_1() {
|
|
|
85
89
|
json = new json_file_1.JSONFile(tree, TSLINT_CONFIG_PATH);
|
|
86
90
|
}
|
|
87
91
|
catch {
|
|
88
|
-
const config = ['tslint.js', 'tslint.yaml'].find(c => tree.exists(c));
|
|
92
|
+
const config = ['tslint.js', 'tslint.yaml'].find((c) => tree.exists(c));
|
|
89
93
|
if (config) {
|
|
90
94
|
logger.warn(`Expected a JSON configuration file but found "${config}".`);
|
|
91
95
|
}
|
|
@@ -101,9 +105,10 @@ function default_1() {
|
|
|
101
105
|
// Add new rules only iif the configuration extends 'tslint:recommended'.
|
|
102
106
|
// This is because some rules conflict with prettier or other tools.
|
|
103
107
|
const extend = json.get(['extends']);
|
|
104
|
-
if (extend !== 'tslint:recommended' ||
|
|
105
|
-
|
|
106
|
-
|
|
108
|
+
if (extend !== 'tslint:recommended' ||
|
|
109
|
+
(Array.isArray(extend) && extend.some((e) => e.value !== 'tslint:recommended'))) {
|
|
110
|
+
logger.warn(`tslint configuration does not extend "tslint:recommended" or it extends multiple configurations.` +
|
|
111
|
+
'\nSkipping rule changes as some rules might conflict.');
|
|
107
112
|
return;
|
|
108
113
|
}
|
|
109
114
|
for (const [name, value] of Object.entries(RULES_TO_ADD)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -14,7 +14,7 @@ const workspace_1 = require("../../utility/workspace");
|
|
|
14
14
|
const workspace_models_1 = require("../../utility/workspace-models");
|
|
15
15
|
function default_1() {
|
|
16
16
|
return schematics_1.chain([
|
|
17
|
-
workspace_1.updateWorkspace(workspace => {
|
|
17
|
+
workspace_1.updateWorkspace((workspace) => {
|
|
18
18
|
for (const [, project] of workspace.projects) {
|
|
19
19
|
for (const [, target] of project.targets) {
|
|
20
20
|
if (target.builder === workspace_models_1.Builders.DeprecatedNgPackagr) {
|
|
@@ -23,7 +23,7 @@ function default_1() {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}),
|
|
26
|
-
host => {
|
|
26
|
+
(host) => {
|
|
27
27
|
dependencies_1.removePackageJsonDependency(host, '@angular-devkit/build-ng-packagr');
|
|
28
28
|
dependencies_1.addPackageJsonDependency(host, {
|
|
29
29
|
type: dependencies_1.NodeDependencyType.Dev,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
const core_1 = require("@angular-devkit/core");
|
|
11
11
|
const workspace_1 = require("../../utility/workspace");
|
|
12
12
|
function default_1() {
|
|
13
|
-
return workspace_1.updateWorkspace(workspace => {
|
|
13
|
+
return workspace_1.updateWorkspace((workspace) => {
|
|
14
14
|
const optionsToRemove = {
|
|
15
15
|
environment: undefined,
|
|
16
16
|
extractCss: undefined,
|
|
@@ -47,7 +47,7 @@ function default_1() {
|
|
|
47
47
|
exports.default = default_1;
|
|
48
48
|
function updateLazyScriptsStyleOption(options) {
|
|
49
49
|
function visitor(options, type) {
|
|
50
|
-
//
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
51
51
|
if (!options[type] || !core_1.isJsonArray(options[type])) {
|
|
52
52
|
return undefined;
|
|
53
53
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
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
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
4
11
|
const dependencies_1 = require("../../utility/dependencies");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -11,7 +11,7 @@ const core_1 = require("@angular-devkit/core");
|
|
|
11
11
|
const workspace_1 = require("../../utility/workspace");
|
|
12
12
|
const workspace_models_1 = require("../../utility/workspace-models");
|
|
13
13
|
function default_1() {
|
|
14
|
-
return async (_host, context) => workspace_1.updateWorkspace(workspace => {
|
|
14
|
+
return async (_host, context) => workspace_1.updateWorkspace((workspace) => {
|
|
15
15
|
for (const [name, target] of workspace_1.allWorkspaceTargets(workspace)) {
|
|
16
16
|
let defaultConfiguration;
|
|
17
17
|
// Only interested in 1st party builders
|
|
@@ -33,7 +33,8 @@ function default_1() {
|
|
|
33
33
|
// Nothing to update
|
|
34
34
|
break;
|
|
35
35
|
default:
|
|
36
|
-
context.logger
|
|
36
|
+
context.logger
|
|
37
|
+
.warn(core_1.tags.stripIndents `Cannot update "${name}" target configuration as it's using "${target.builder}"
|
|
37
38
|
which is a third-party builder. This target configuration will require manual review.`);
|
|
38
39
|
continue;
|
|
39
40
|
}
|
|
@@ -1,2 +1,9 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
9
|
export default function (): Rule;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const core_1 = require("@angular-devkit/core");
|
|
11
11
|
const json_file_1 = require("../../utility/json-file");
|
|
12
|
+
const workspace_1 = require("../../utility/workspace");
|
|
12
13
|
function* visitJsonFiles(directory) {
|
|
13
14
|
for (const path of directory.subfiles) {
|
|
14
15
|
if (!path.endsWith('.json')) {
|
|
@@ -24,7 +25,18 @@ function* visitJsonFiles(directory) {
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
function default_1() {
|
|
27
|
-
return tree => {
|
|
28
|
+
return async (tree, { logger }) => {
|
|
29
|
+
const workspace = await workspace_1.getWorkspace(tree);
|
|
30
|
+
const hasThirdPartyBuilders = [...workspace_1.allWorkspaceTargets(workspace)].some(([, target]) => {
|
|
31
|
+
const { builder } = target;
|
|
32
|
+
return !(builder.startsWith('@angular-devkit/build-angular') ||
|
|
33
|
+
builder.startsWith('@nguniversal/builders'));
|
|
34
|
+
});
|
|
35
|
+
if (hasThirdPartyBuilders) {
|
|
36
|
+
logger.warn('Skipping migration as the workspace uses third-party builders which may ' +
|
|
37
|
+
'require "emitDecoratorMetadata" TypeScript compiler option.');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
28
40
|
for (const path of visitJsonFiles(tree.root)) {
|
|
29
41
|
const content = tree.read(path);
|
|
30
42
|
if (content === null || content === void 0 ? void 0 : content.toString().includes('"emitDecoratorMetadata"')) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -11,18 +11,18 @@ const workspace_1 = require("../../utility/workspace");
|
|
|
11
11
|
const BrowserBuilderOptions = [
|
|
12
12
|
['aot', false, true],
|
|
13
13
|
['vendorChunk', true, false],
|
|
14
|
-
['extractLicenses',
|
|
14
|
+
['extractLicenses', false, true],
|
|
15
15
|
['buildOptimizer', false, true],
|
|
16
16
|
['sourceMap', true, false],
|
|
17
17
|
['optimization', false, true],
|
|
18
|
-
['namedChunks',
|
|
18
|
+
['namedChunks', true, false],
|
|
19
19
|
];
|
|
20
20
|
const ServerBuilderOptions = [
|
|
21
21
|
['sourceMap', true, false],
|
|
22
22
|
['optimization', false, true],
|
|
23
23
|
];
|
|
24
24
|
function default_1() {
|
|
25
|
-
return workspace_1.updateWorkspace(workspace => {
|
|
25
|
+
return workspace_1.updateWorkspace((workspace) => {
|
|
26
26
|
for (const [, target] of workspace_1.allWorkspaceTargets(workspace)) {
|
|
27
27
|
if (!(target === null || target === void 0 ? void 0 : target.builder.startsWith('@angular-devkit/build-angular'))) {
|
|
28
28
|
continue;
|
|
@@ -39,6 +39,7 @@ function default_1() {
|
|
|
39
39
|
for (const [, options] of workspace_1.allTargetOptions(target)) {
|
|
40
40
|
delete options.experimentalRollupPass;
|
|
41
41
|
delete options.lazyModules;
|
|
42
|
+
delete options.forkTypeChecker;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
});
|
|
@@ -61,6 +62,6 @@ function updateOptions(target, optionsToUpdate) {
|
|
|
61
62
|
value = oldDefault;
|
|
62
63
|
}
|
|
63
64
|
// Remove overrides in configurations which are no longer needed.
|
|
64
|
-
configurationOptions === null || configurationOptions === void 0 ? void 0 : configurationOptions.filter(o => o && o[optionName] === value).forEach(o => o && delete o[optionName]);
|
|
65
|
+
configurationOptions === null || configurationOptions === void 0 ? void 0 : configurationOptions.filter((o) => o && o[optionName] === value).forEach((o) => o && delete o[optionName]);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
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
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
const ts = require("../../third_party/github.com/Microsoft/TypeScript/lib/typescript");
|
|
4
11
|
function* visit(directory) {
|
|
@@ -22,7 +29,7 @@ function* visit(directory) {
|
|
|
22
29
|
}
|
|
23
30
|
}
|
|
24
31
|
function default_1() {
|
|
25
|
-
return tree => {
|
|
32
|
+
return (tree) => {
|
|
26
33
|
for (const sourceFile of visit(tree.root)) {
|
|
27
34
|
let recorder;
|
|
28
35
|
ts.forEachChild(sourceFile, function analyze(node) {
|
|
@@ -40,9 +47,7 @@ function default_1() {
|
|
|
40
47
|
}
|
|
41
48
|
const index = valueNode.getStart();
|
|
42
49
|
const length = valueNode.getWidth();
|
|
43
|
-
recorder
|
|
44
|
-
.remove(index, length)
|
|
45
|
-
.insertLeft(index, fix);
|
|
50
|
+
recorder.remove(index, length).insertLeft(index, fix);
|
|
46
51
|
}
|
|
47
52
|
ts.forEachChild(node, analyze);
|
|
48
53
|
});
|
|
@@ -1,4 +1,11 @@
|
|
|
1
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
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
const ts = require("../../third_party/github.com/Microsoft/TypeScript/lib/typescript");
|
|
4
11
|
function* visit(directory) {
|
|
@@ -1,2 +1,9 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
9
|
export default function (): Rule;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const core_1 = require("@angular-devkit/core");
|
|
11
11
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
12
12
|
const dependencies_1 = require("../../utility/dependencies");
|
|
@@ -53,8 +53,7 @@ function default_1() {
|
|
|
53
53
|
// - require('zone.js/dist/zone') -> require('zone.js')
|
|
54
54
|
// - import 'zone.js/dist/zone-error' -> import 'zone.js/plugins/zone-error'
|
|
55
55
|
// - require('zone.js/dist/zone-error') -> require('zone.js/plugins/zone-error')
|
|
56
|
-
tree.overwrite(path, content
|
|
57
|
-
.replace(/(?<=(?:require\s*\(|import\s+)['"]zone\.js)\/dist\/zone-?\w*(?=['"]\)?)/g, match => {
|
|
56
|
+
tree.overwrite(path, content.replace(/(?<=(?:require\s*\(|import\s+)['"]zone\.js)\/dist\/zone-?\w*(?=['"]\)?)/g, (match) => {
|
|
58
57
|
switch (match) {
|
|
59
58
|
case '/dist/zone':
|
|
60
59
|
case '/dist/zone-evergreen':
|