@angular-devkit/core 13.0.0-next.8 → 13.0.0-rc.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/node/BUILD.bazel CHANGED
@@ -28,6 +28,7 @@ ts_library(
28
28
  deps = [
29
29
  "//packages/angular_devkit/core",
30
30
  "@npm//@types/node",
31
+ "@npm//chokidar",
31
32
  "@npm//rxjs",
32
33
  ],
33
34
  )
package/node/host.js CHANGED
@@ -6,9 +6,28 @@
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
8
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
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.NodeJsSyncHost = exports.NodeJsAsyncHost = void 0;
11
- const fs_1 = require("fs");
30
+ const fs_1 = __importStar(require("fs"));
12
31
  const path_1 = require("path");
13
32
  const rxjs_1 = require("rxjs");
14
33
  const operators_1 = require("rxjs/operators");
@@ -58,20 +77,14 @@ class NodeJsAsyncHost {
58
77
  delete(path) {
59
78
  return this.isDirectory(path).pipe((0, operators_1.mergeMap)(async (isDirectory) => {
60
79
  if (isDirectory) {
61
- const recursiveDelete = async (dirPath) => {
62
- for (const fragment of await fs_1.promises.readdir(dirPath)) {
63
- const sysPath = (0, path_1.join)(dirPath, fragment);
64
- const stats = await fs_1.promises.stat(sysPath);
65
- if (stats.isDirectory()) {
66
- await recursiveDelete(sysPath);
67
- await fs_1.promises.rmdir(sysPath);
68
- }
69
- else {
70
- await fs_1.promises.unlink(sysPath);
71
- }
72
- }
73
- };
74
- await recursiveDelete((0, src_1.getSystemPath)(path));
80
+ // The below should be removed and replaced with just `rm` when support for Node.Js 12 is removed.
81
+ const { rm, rmdir } = fs_1.promises;
82
+ if (rm) {
83
+ await rm((0, src_1.getSystemPath)(path), { force: true, recursive: true, maxRetries: 3 });
84
+ }
85
+ else {
86
+ await rmdir((0, src_1.getSystemPath)(path), { recursive: true, maxRetries: 3 });
87
+ }
75
88
  }
76
89
  else {
77
90
  await fs_1.promises.unlink((0, src_1.getSystemPath)(path));
@@ -101,7 +114,8 @@ class NodeJsAsyncHost {
101
114
  watch(path, _options) {
102
115
  return new rxjs_1.Observable((obs) => {
103
116
  loadFSWatcher();
104
- const watcher = new FSWatcher({ persistent: true }).add((0, src_1.getSystemPath)(path));
117
+ const watcher = new FSWatcher({ persistent: true });
118
+ watcher.add((0, src_1.getSystemPath)(path));
105
119
  watcher
106
120
  .on('change', (path) => {
107
121
  obs.next({
@@ -156,7 +170,14 @@ class NodeJsSyncHost {
156
170
  if (isDir) {
157
171
  const dirPaths = (0, fs_1.readdirSync)((0, src_1.getSystemPath)(path));
158
172
  const rmDirComplete = new rxjs_1.Observable((obs) => {
159
- (0, fs_1.rmdirSync)((0, src_1.getSystemPath)(path));
173
+ // The below should be removed and replaced with just `rmSync` when support for Node.Js 12 is removed.
174
+ const { rmSync, rmdirSync } = fs_1.default;
175
+ if (rmSync) {
176
+ rmSync((0, src_1.getSystemPath)(path), { force: true, recursive: true, maxRetries: 3 });
177
+ }
178
+ else {
179
+ rmdirSync((0, src_1.getSystemPath)(path), { recursive: true, maxRetries: 3 });
180
+ }
160
181
  obs.complete();
161
182
  });
162
183
  return (0, rxjs_1.concat)(...dirPaths.map((name) => this.delete((0, src_1.join)(path, name))), rmDirComplete);
@@ -212,9 +233,9 @@ class NodeJsSyncHost {
212
233
  // Some hosts may not support watching.
213
234
  watch(path, _options) {
214
235
  return new rxjs_1.Observable((obs) => {
215
- const opts = { persistent: false };
216
236
  loadFSWatcher();
217
- const watcher = new FSWatcher(opts).add((0, src_1.getSystemPath)(path));
237
+ const watcher = new FSWatcher({ persistent: false });
238
+ watcher.add((0, src_1.getSystemPath)(path));
218
239
  watcher
219
240
  .on('change', (path) => {
220
241
  obs.next({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/core",
3
- "version": "13.0.0-next.8",
3
+ "version": "13.0.0-rc.2",
4
4
  "description": "Angular DevKit - Core Utility Library",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -20,13 +20,21 @@
20
20
  "rxjs": "6.6.7",
21
21
  "source-map": "0.7.3"
22
22
  },
23
+ "peerDependencies": {
24
+ "chokidar": "^3.5.2"
25
+ },
26
+ "peerDependenciesMeta": {
27
+ "chokidar": {
28
+ "optional": true
29
+ }
30
+ },
23
31
  "repository": {
24
32
  "type": "git",
25
33
  "url": "https://github.com/angular/angular-cli.git"
26
34
  },
27
35
  "engines": {
28
- "node": "^12.20.0 || >=14.0.0",
29
- "npm": "^6.11.0 || ^7.5.6",
36
+ "node": "^12.20.0 || ^14.15.0 || >=16.10.0",
37
+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
30
38
  "yarn": ">= 1.13.0"
31
39
  },
32
40
  "author": "Angular Authors",
@@ -25,7 +25,7 @@ export declare enum NgCliAnalyticsDimensions {
25
25
  RamInGigabytes = 3,
26
26
  NodeVersion = 4,
27
27
  NgAddCollection = 6,
28
- NgIvyEnabled = 8,
28
+ AotEnabled = 8,
29
29
  BuildErrors = 20
30
30
  }
31
31
  export declare enum NgCliAnalyticsMetrics {
@@ -39,7 +39,7 @@ var NgCliAnalyticsDimensions;
39
39
  NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["RamInGigabytes"] = 3] = "RamInGigabytes";
40
40
  NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["NodeVersion"] = 4] = "NodeVersion";
41
41
  NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["NgAddCollection"] = 6] = "NgAddCollection";
42
- NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["NgIvyEnabled"] = 8] = "NgIvyEnabled";
42
+ NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["AotEnabled"] = 8] = "AotEnabled";
43
43
  NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["BuildErrors"] = 20] = "BuildErrors";
44
44
  })(NgCliAnalyticsDimensions = exports.NgCliAnalyticsDimensions || (exports.NgCliAnalyticsDimensions = {}));
45
45
  var NgCliAnalyticsMetrics;
@@ -68,7 +68,7 @@ exports.NgCliAnalyticsDimensionsFlagInfo = {
68
68
  RamInGigabytes: ['RAM (In GB)', 'number'],
69
69
  NodeVersion: ['Node Version', 'number'],
70
70
  NgAddCollection: ['--collection', 'string'],
71
- NgIvyEnabled: ['Ivy Enabled', 'boolean'],
71
+ AotEnabled: ['AOT Enabled', 'boolean'],
72
72
  BuildErrors: ['Build Errors (comma separated)', 'string'],
73
73
  };
74
74
  // This table is used when generating the analytics.md file. It should match the enum above
@@ -11,4 +11,4 @@ export declare function mapObject<T, V>(obj: {
11
11
  }, mapper: (k: string, v: T) => V): {
12
12
  [k: string]: V;
13
13
  };
14
- export declare function deepCopy<T extends any>(value: T): T;
14
+ export declare function deepCopy<T>(value: T): T;
@@ -17,10 +17,8 @@ function mapObject(obj, mapper) {
17
17
  }
18
18
  exports.mapObject = mapObject;
19
19
  const copySymbol = Symbol();
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
20
  function deepCopy(value) {
22
21
  if (Array.isArray(value)) {
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
22
  return value.map((o) => deepCopy(o));
25
23
  }
26
24
  else if (value && typeof value === 'object') {