@schematics/angular 10.0.0 → 10.0.4
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/application/files/.browserslistrc.template +5 -3
- package/application/index.js +1 -1
- package/e2e/index.js +0 -3
- package/migrations/migration-collection.json +5 -5
- package/migrations/update-10/solution-style-tsconfig.js +18 -6
- package/migrations/update-10/update-dependencies.js +1 -0
- package/migrations/update-10/update-module-and-target-compiler-options.js +1 -1
- package/module/files/__name@dasherize@if-flat__/__name@dasherize__-routing.module.ts.template +2 -2
- package/ng-new/index.js +2 -0
- package/package.json +3 -3
- package/service-worker/files/ngsw-config.json.template +2 -1
- package/utility/latest-versions.js +4 -4
- package/workspace/files/package.json.template +1 -1
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
last 1 Chrome version
|
|
12
12
|
last 1 Firefox version
|
|
13
13
|
last 2 Edge major versions
|
|
14
|
-
last 2 Safari major
|
|
14
|
+
last 2 Safari major versions
|
|
15
15
|
last 2 iOS major versions
|
|
16
16
|
Firefox ESR<% if (legacyBrowsers) { %>
|
|
17
|
-
IE 9-
|
|
18
|
-
|
|
17
|
+
IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11.
|
|
18
|
+
IE 11<% } else { %>
|
|
19
|
+
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
|
|
20
|
+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.<% } %>
|
package/application/index.js
CHANGED
|
@@ -349,7 +349,7 @@ function default_1(options) {
|
|
|
349
349
|
]), schematics_1.MergeStrategy.Overwrite),
|
|
350
350
|
tsconfig_1.addTsConfigProjectReferences([
|
|
351
351
|
core_1.join(appDir, 'tsconfig.app.json'),
|
|
352
|
-
core_1.join(appDir, 'tsconfig.spec.json'),
|
|
352
|
+
...options.minimal ? [] : [core_1.join(appDir, 'tsconfig.spec.json')],
|
|
353
353
|
]),
|
|
354
354
|
options.minimal ? schematics_1.noop() : schematics_1.schematic('e2e', e2eOptions),
|
|
355
355
|
options.skipPackageJson ? schematics_1.noop() : addDependenciesToPackageJson(options),
|
package/e2e/index.js
CHANGED
|
@@ -95,15 +95,15 @@
|
|
|
95
95
|
"factory": "./update-10/solution-style-tsconfig",
|
|
96
96
|
"description": "Add \"Solution Style\" TypeScript configuration file support. This improves developer experience using editors powered by TypeScript’s language server. Read more about this here: https://v10.angular.io/guide/migration-solution-style-tsconfig"
|
|
97
97
|
},
|
|
98
|
-
"update-module-and-target-compiler-options": {
|
|
99
|
-
"version": "10.0.0-rc.1",
|
|
100
|
-
"factory": "./update-10/update-module-and-target-compiler-options",
|
|
101
|
-
"description": "Update 'module' and 'target' TypeScript compiler options. Read more about this here: https://v10.angular.io/guide/migration-update-module-and-target-compiler-options"
|
|
102
|
-
},
|
|
103
98
|
"update-workspace-dependencies": {
|
|
104
99
|
"version": "10.0.0-rc.2",
|
|
105
100
|
"factory": "./update-10/update-dependencies",
|
|
106
101
|
"description": "Update workspace dependencies to match a new v10 project."
|
|
102
|
+
},
|
|
103
|
+
"update-module-and-target-compiler-options": {
|
|
104
|
+
"version": "10.0.1",
|
|
105
|
+
"factory": "./update-10/update-module-and-target-compiler-options",
|
|
106
|
+
"description": "Update 'module' and 'target' TypeScript compiler options. Read more about this here: https://v10.angular.io/guide/migration-update-module-and-target-compiler-options"
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -18,16 +18,28 @@ const SOLUTIONS_TS_CONFIG_HEADER = `/*
|
|
|
18
18
|
To learn more about this file see: https://angular.io/config/solution-tsconfig.
|
|
19
19
|
*/
|
|
20
20
|
`;
|
|
21
|
-
function* visitExtendedJsonFiles(directory) {
|
|
21
|
+
function* visitExtendedJsonFiles(directory, logger) {
|
|
22
22
|
for (const path of directory.subfiles) {
|
|
23
23
|
if (!path.endsWith('.json')) {
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
26
26
|
const entry = directory.file(path);
|
|
27
|
-
|
|
27
|
+
const content = entry === null || entry === void 0 ? void 0 : entry.content.toString();
|
|
28
|
+
if (!content) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
let jsonAst;
|
|
32
|
+
try {
|
|
33
|
+
jsonAst = core_1.parseJsonAst(content, core_1.JsonParseMode.Loose);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
let jsonFilePath = `${core_1.join(directory.path, path)}`;
|
|
37
|
+
jsonFilePath = jsonFilePath.startsWith('/') ? jsonFilePath.substr(1) : jsonFilePath;
|
|
38
|
+
const msg = error instanceof Error ? error.message : error;
|
|
39
|
+
logger.warn(`Failed to parse "${jsonFilePath}" as JSON AST Object. ${msg}\n` +
|
|
40
|
+
'If this is a TypeScript configuration file you will need to update the "extends" value manually.');
|
|
28
41
|
continue;
|
|
29
42
|
}
|
|
30
|
-
const jsonAst = core_1.parseJsonAst(entry.content.toString(), core_1.JsonParseMode.Loose);
|
|
31
43
|
if (jsonAst.kind !== 'object') {
|
|
32
44
|
continue;
|
|
33
45
|
}
|
|
@@ -42,18 +54,18 @@ function* visitExtendedJsonFiles(directory) {
|
|
|
42
54
|
if (path === 'node_modules' || path.startsWith('.')) {
|
|
43
55
|
continue;
|
|
44
56
|
}
|
|
45
|
-
yield* visitExtendedJsonFiles(directory.dir(path));
|
|
57
|
+
yield* visitExtendedJsonFiles(directory.dir(path), logger);
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
function updateTsconfigExtendsRule() {
|
|
49
|
-
return host => {
|
|
61
|
+
return (host, context) => {
|
|
50
62
|
if (!host.exists('tsconfig.json')) {
|
|
51
63
|
return;
|
|
52
64
|
}
|
|
53
65
|
// Rename workspace tsconfig to base tsconfig.
|
|
54
66
|
host.rename('tsconfig.json', 'tsconfig.base.json');
|
|
55
67
|
// Iterate over all tsconfig files and change the extends from 'tsconfig.json' 'tsconfig.base.json'
|
|
56
|
-
for (const [tsconfigPath, extendsAst] of visitExtendedJsonFiles(host.root)) {
|
|
68
|
+
for (const [tsconfigPath, extendsAst] of visitExtendedJsonFiles(host.root, context.logger)) {
|
|
57
69
|
const tsConfigDir = core_1.dirname(core_1.normalize(tsconfigPath));
|
|
58
70
|
if ('/tsconfig.json' !== core_1.resolve(tsConfigDir, core_1.normalize(extendsAst.value))) {
|
|
59
71
|
// tsconfig extends doesn't refer to the workspace tsconfig path.
|
|
@@ -6,6 +6,7 @@ const latest_versions_1 = require("../../utility/latest-versions");
|
|
|
6
6
|
function default_1() {
|
|
7
7
|
return (host, context) => {
|
|
8
8
|
const dependenciesToUpdate = {
|
|
9
|
+
'codelyzer': '^6.0.0',
|
|
9
10
|
'jasmine-core': '~3.5.0',
|
|
10
11
|
'jasmine-spec-reporter': '~5.0.0',
|
|
11
12
|
'karma': '~5.0.0',
|
package/module/files/__name@dasherize@if-flat__/__name@dasherize__-routing.module.ts.template
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
-
import { Routes, RouterModule } from '@angular/router'
|
|
3
|
-
|
|
2
|
+
import { Routes, RouterModule } from '@angular/router';<% if (lazyRoute) { %>
|
|
3
|
+
|
|
4
4
|
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% } %>
|
|
5
5
|
|
|
6
6
|
const routes: Routes = [<% if (lazyRoute) { %>{ path: '', component: <%= classify(name) %>Component }<% } %>];
|
package/ng-new/index.js
CHANGED
|
@@ -9,10 +9,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
*/
|
|
10
10
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
11
11
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
12
|
+
const validation_1 = require("../utility/validation");
|
|
12
13
|
function default_1(options) {
|
|
13
14
|
if (!options.name) {
|
|
14
15
|
throw new schematics_1.SchematicsException(`Invalid options, "name" is required.`);
|
|
15
16
|
}
|
|
17
|
+
validation_1.validateProjectName(options.name);
|
|
16
18
|
if (!options.directory) {
|
|
17
19
|
options.directory = options.name;
|
|
18
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.4",
|
|
4
4
|
"description": "Schematics specific to Angular",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
],
|
|
15
15
|
"schematics": "./collection.json",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@angular-devkit/core": "10.0.
|
|
18
|
-
"@angular-devkit/schematics": "10.0.
|
|
17
|
+
"@angular-devkit/core": "10.0.4",
|
|
18
|
+
"@angular-devkit/schematics": "10.0.4"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.latestVersions = void 0;
|
|
11
11
|
exports.latestVersions = {
|
|
12
12
|
// These versions should be kept up to date with latest Angular peer dependencies.
|
|
13
|
-
Angular: '~10.0.
|
|
13
|
+
Angular: '~10.0.5',
|
|
14
14
|
RxJs: '~6.5.5',
|
|
15
15
|
ZoneJs: '~0.10.3',
|
|
16
16
|
TypeScript: '~3.9.5',
|
|
@@ -19,8 +19,8 @@ exports.latestVersions = {
|
|
|
19
19
|
// For our e2e tests, these versions must match the latest tag present on the branch.
|
|
20
20
|
// During RC periods they will not match the latest RC until there's a new git tag, and
|
|
21
21
|
// should not be updated.
|
|
22
|
-
DevkitBuildAngular: '~0.1000.
|
|
23
|
-
DevkitBuildNgPackagr: '~0.1000.
|
|
24
|
-
DevkitBuildWebpack: '~0.1000.
|
|
22
|
+
DevkitBuildAngular: '~0.1000.4',
|
|
23
|
+
DevkitBuildNgPackagr: '~0.1000.4',
|
|
24
|
+
DevkitBuildWebpack: '~0.1000.4',
|
|
25
25
|
ngPackagr: '^10.0.0',
|
|
26
26
|
};
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@types/node": "^12.11.1",<% if (!minimal) { %>
|
|
30
30
|
"@types/jasmine": "~3.5.0",
|
|
31
31
|
"@types/jasminewd2": "~2.0.3",
|
|
32
|
-
"codelyzer": "^6.0.0
|
|
32
|
+
"codelyzer": "^6.0.0",
|
|
33
33
|
"jasmine-core": "~3.5.0",
|
|
34
34
|
"jasmine-spec-reporter": "~5.0.0",
|
|
35
35
|
"karma": "~5.0.0",
|