@angular/cli 12.0.3 → 12.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.
@@ -33,14 +33,17 @@ function shouldWrapSchematic(schematicFile) {
33
33
  return true;
34
34
  }
35
35
  }
36
+ const normalizedSchematicFile = schematicFile.replace(/\\/g, '/');
36
37
  // Never wrap the internal update schematic when executed directly
37
38
  // It communicates with the update command via `global`
38
- if (/[\/\\]node_modules[\/\\]@angular[\/\\]cli[\/\\]/.test(schematicFile)) {
39
+ // But we still want to redirect schematics located in `@angular/cli/node_modules`.
40
+ if (normalizedSchematicFile.includes('node_modules/@angular/cli/') &&
41
+ !normalizedSchematicFile.includes('node_modules/@angular/cli/node_modules/')) {
39
42
  return false;
40
43
  }
41
44
  // Default is only first-party Angular schematic packages
42
45
  // Angular schematics are safe to use in the wrapped VM context
43
- return /[\/\\]node_modules[\/\\]@(?:angular|schematics|nguniversal)[\/\\]/.test(schematicFile);
46
+ return /\/node_modules\/@(?:angular|schematics|nguniversal)\//.test(normalizedSchematicFile);
44
47
  }
45
48
  class SchematicEngineHost extends tools_1.NodeModulesEngineHost {
46
49
  _resolveReferenceString(refString, parentPath) {
@@ -94,10 +97,8 @@ const legacyModules = {
94
97
  * @param exportName An optional name of a specific export to return. Otherwise, return all exports.
95
98
  */
96
99
  function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
97
- const { createRequire, createRequireFromPath } = require('module');
98
- // Node.js 10.x does not support `createRequire` so fallback to `createRequireFromPath`
99
- // `createRequireFromPath` is deprecated in 12+ and can be removed once 10.x support is removed
100
- const scopedRequire = (createRequire === null || createRequire === void 0 ? void 0 : createRequire(schematicFile)) || createRequireFromPath(schematicFile);
100
+ const { createRequire } = require('module');
101
+ const scopedRequire = createRequire(schematicFile);
101
102
  const customRequire = function (id) {
102
103
  if (legacyModules[id]) {
103
104
  // Provide compatibility modules for older versions of @angular/cdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "12.0.3",
3
+ "version": "12.0.4",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/angular/angular-cli",
30
30
  "dependencies": {
31
- "@angular-devkit/architect": "0.1200.3",
32
- "@angular-devkit/core": "12.0.3",
33
- "@angular-devkit/schematics": "12.0.3",
34
- "@schematics/angular": "12.0.3",
31
+ "@angular-devkit/architect": "0.1200.4",
32
+ "@angular-devkit/core": "12.0.4",
33
+ "@angular-devkit/schematics": "12.0.4",
34
+ "@schematics/angular": "12.0.4",
35
35
  "@yarnpkg/lockfile": "1.1.0",
36
36
  "ansi-colors": "4.1.1",
37
37
  "debug": "4.3.1",
@@ -52,12 +52,12 @@
52
52
  "ng-update": {
53
53
  "migrations": "@schematics/angular/migrations/migration-collection.json",
54
54
  "packageGroup": {
55
- "@angular/cli": "12.0.3",
56
- "@angular-devkit/architect": "0.1200.3",
57
- "@angular-devkit/build-angular": "12.0.3",
58
- "@angular-devkit/build-webpack": "0.1200.3",
59
- "@angular-devkit/core": "12.0.3",
60
- "@angular-devkit/schematics": "12.0.3"
55
+ "@angular/cli": "12.0.4",
56
+ "@angular-devkit/architect": "0.1200.4",
57
+ "@angular-devkit/build-angular": "12.0.4",
58
+ "@angular-devkit/build-webpack": "0.1200.4",
59
+ "@angular-devkit/core": "12.0.4",
60
+ "@angular-devkit/schematics": "12.0.4"
61
61
  }
62
62
  },
63
63
  "engines": {
@@ -148,10 +148,8 @@ async function runTempPackageBin(packageName, packageManager = workspace_schema_
148
148
  if (!binPath) {
149
149
  throw new Error(`Cannot locate bin for temporary package: ${packageNameNoVersion}.`);
150
150
  }
151
- const argv = [`'${binPath}'`, ...args];
152
- const { status, error } = child_process_1.spawnSync('node', argv, {
151
+ const { status, error } = child_process_1.spawnSync(process.execPath, [binPath, ...args], {
153
152
  stdio: 'inherit',
154
- shell: true,
155
153
  env: {
156
154
  ...process.env,
157
155
  NG_DISABLE_VERSION_CHECK: 'true',