@schematics/angular 10.0.0-rc.5 → 10.0.3

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.
@@ -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 version
14
+ last 2 Safari major versions
15
15
  last 2 iOS major versions
16
16
  Firefox ESR<% if (legacyBrowsers) { %>
17
- IE 9-11<% } else { %>
18
- not IE 9-11 # For IE 9-11 support, remove 'not'.<% } %>
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/e2e/index.js CHANGED
@@ -52,9 +52,6 @@ function default_1(options) {
52
52
  }),
53
53
  schematics_1.move(root),
54
54
  ])),
55
- tsconfig_1.addTsConfigProjectReferences([
56
- e2eTsConfig,
57
- ]),
58
55
  ]);
59
56
  };
60
57
  }
@@ -58,12 +58,12 @@
58
58
  "tslint-version-6": {
59
59
  "version": "10.0.0-beta.0",
60
60
  "factory": "./update-10/update-tslint",
61
- "description": "Update tslint to version 6."
61
+ "description": "Update tslint to version 6 and adjust rules to maintain existing behavior."
62
62
  },
63
63
  "rename-browserslist-config": {
64
64
  "version": "10.0.0-beta.0",
65
65
  "factory": "./update-10/rename-browserslist-config",
66
- "description": "Update Browserslist configurations to '.browserslistrc'."
66
+ "description": "Update Browserslist configuration file name to '.browserslistrc' from deprecated 'browserslist'."
67
67
  },
68
68
  "remove-es5-browser-support-option": {
69
69
  "version": "10.0.0-beta.2",
@@ -73,37 +73,37 @@
73
73
  "schematic-options-10": {
74
74
  "version": "10.0.0-beta.2",
75
75
  "factory": "./update-9/schematic-options",
76
- "description": "Replace deprecated 'styleext' and 'spec' Angular schematic options."
76
+ "description": "Replace deprecated and removed 'styleext' and 'spec' Angular schematic options with 'style' and 'skipTests', respectively."
77
77
  },
78
78
  "update-angular-config": {
79
79
  "version": "10.0.0-beta.6",
80
80
  "factory": "./update-10/update-angular-config",
81
- "description": "Remove various deprecated builders options from 'angular.json'."
81
+ "description": "Remove deprecated options from 'angular.json' that are no longer present in v10."
82
82
  },
83
83
  "tslint-add-deprecation-rule": {
84
84
  "version": "10.0.0-beta.7",
85
85
  "factory": "./update-10/add-deprecation-rule-tslint",
86
- "description": "Adds the tslint deprecation rule to tslint JSON configuration files."
86
+ "description": "Add the tslint deprecation rule to tslint JSON configuration files."
87
87
  },
88
88
  "update-libraries-tslib": {
89
89
  "version": "10.0.0-beta.7",
90
90
  "factory": "./update-10/update-libraries-tslib",
91
- "description": "Update library projects to use tslib version 2 as a direct dependency."
91
+ "description": "Update library projects to use tslib version 2 as a direct dependency. Read more about this here: https://v10.angular.io/guide/migration-update-libraries-tslib"
92
92
  },
93
93
  "solution-style-tsconfig": {
94
94
  "version": "10.0.0-beta.7",
95
95
  "factory": "./update-10/solution-style-tsconfig",
96
- "description": "Adding \"Solution Style\" tsconfig.json. This improves developer experience using editors powered by TypeScript’s language server."
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."
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"
102
97
  },
103
98
  "update-workspace-dependencies": {
104
99
  "version": "10.0.0-rc.2",
105
100
  "factory": "./update-10/update-dependencies",
106
- "description": "Workspace dependencies updates."
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
- if (!entry) {
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',
@@ -16,7 +16,7 @@ function default_1() {
16
16
  return async (host) => {
17
17
  var _a;
18
18
  // Workspace level tsconfig
19
- updateModuleAndTarget(host, 'tsconfig.json', {
19
+ updateModuleAndTarget(host, 'tsconfig.base.json', {
20
20
  oldModule: 'esnext',
21
21
  newModule: 'es2020',
22
22
  });
@@ -1,6 +1,6 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { Routes, RouterModule } from '@angular/router';
3
- <% if (lazyRoute) { %>
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.0-rc.5",
3
+ "version": "10.0.3",
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.0-rc.5",
18
- "@angular-devkit/schematics": "10.0.0-rc.5"
17
+ "@angular-devkit/core": "10.0.3",
18
+ "@angular-devkit/schematics": "10.0.3"
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",
@@ -14,7 +14,8 @@
14
14
  "/*.js"
15
15
  ]
16
16
  }
17
- }, {
17
+ },
18
+ {
18
19
  "name": "assets",
19
20
  "installMode": "lazy",
20
21
  "updateMode": "prefetch",
@@ -30,7 +30,7 @@ export declare function findNodes(node: ts.Node, kind: ts.SyntaxKind, max?: numb
30
30
  /**
31
31
  * Get all the nodes from a source.
32
32
  * @param sourceFile The source file object.
33
- * @returns {Observable<ts.Node>} An observable of all the nodes in the source.
33
+ * @returns {Array<ts.Node>} An array of all the nodes in the source.
34
34
  */
35
35
  export declare function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[];
36
36
  export declare function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null;
@@ -107,7 +107,7 @@ exports.findNodes = findNodes;
107
107
  /**
108
108
  * Get all the nodes from a source.
109
109
  * @param sourceFile The source file object.
110
- * @returns {Observable<ts.Node>} An observable of all the nodes in the source.
110
+ * @returns {Array<ts.Node>} An array of all the nodes in the source.
111
111
  */
112
112
  function getSourceNodes(sourceFile) {
113
113
  const nodes = [sourceFile];
@@ -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.0-rc.6',
13
+ Angular: '~10.0.4',
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.0-rc.5',
23
- DevkitBuildNgPackagr: '~0.1000.0-rc.5',
24
- DevkitBuildWebpack: '~0.1000.0-rc.5',
25
- ngPackagr: '^10.0.0-rc.0',
22
+ DevkitBuildAngular: '~0.1000.3',
23
+ DevkitBuildNgPackagr: '~0.1000.3',
24
+ DevkitBuildWebpack: '~0.1000.3',
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-next.1",
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",