@angular-devkit/core 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.
Files changed (162) hide show
  1. package/README.md +36 -34
  2. package/node/_golden-api.d.ts +1 -1
  3. package/node/_golden-api.js +1 -1
  4. package/node/cli-logger.d.ts +7 -0
  5. package/node/cli-logger.js +4 -6
  6. package/node/experimental/index.d.ts +2 -2
  7. package/node/experimental/index.js +3 -3
  8. package/node/experimental/jobs/index.d.ts +1 -1
  9. package/node/experimental/jobs/index.js +7 -7
  10. package/node/experimental/jobs/job-registry.d.ts +1 -1
  11. package/node/experimental/jobs/job-registry.js +4 -4
  12. package/node/fs.d.ts +7 -0
  13. package/node/fs.js +3 -3
  14. package/node/host.d.ts +2 -2
  15. package/node/host.js +31 -33
  16. package/node/index.d.ts +2 -2
  17. package/node/index.js +1 -1
  18. package/node/testing/index.d.ts +2 -2
  19. package/node/testing/index.js +8 -5
  20. package/package.json +3 -3
  21. package/src/_golden-api.d.ts +1 -1
  22. package/src/_golden-api.js +1 -1
  23. package/src/analytics/api.d.ts +1 -1
  24. package/src/analytics/api.js +7 -0
  25. package/src/analytics/forwarder.d.ts +1 -1
  26. package/src/analytics/forwarder.js +7 -0
  27. package/src/analytics/index.d.ts +1 -1
  28. package/src/analytics/index.js +7 -7
  29. package/src/analytics/logging.d.ts +1 -1
  30. package/src/analytics/logging.js +7 -0
  31. package/src/analytics/multi.d.ts +1 -1
  32. package/src/analytics/multi.js +6 -6
  33. package/src/analytics/noop.d.ts +1 -1
  34. package/src/analytics/noop.js +10 -1
  35. package/src/exception/exception.d.ts +1 -1
  36. package/src/exception/exception.js +25 -9
  37. package/src/exception/index.d.ts +1 -1
  38. package/src/exception/index.js +1 -1
  39. package/src/experimental/jobs/README.md +133 -112
  40. package/src/experimental/jobs/api.d.ts +1 -1
  41. package/src/experimental/jobs/api.js +8 -3
  42. package/src/experimental/jobs/architecture.md +43 -38
  43. package/src/experimental/jobs/create-job-handler.d.ts +1 -2
  44. package/src/experimental/jobs/create-job-handler.js +17 -14
  45. package/src/experimental/jobs/dispatcher.d.ts +1 -2
  46. package/src/experimental/jobs/dispatcher.js +7 -0
  47. package/src/experimental/jobs/exception.d.ts +1 -1
  48. package/src/experimental/jobs/exception.js +3 -3
  49. package/src/experimental/jobs/fallback-registry.d.ts +1 -1
  50. package/src/experimental/jobs/fallback-registry.js +4 -4
  51. package/src/experimental/jobs/index.d.ts +1 -1
  52. package/src/experimental/jobs/index.js +7 -7
  53. package/src/experimental/jobs/simple-registry.d.ts +1 -1
  54. package/src/experimental/jobs/simple-registry.js +6 -4
  55. package/src/experimental/jobs/simple-scheduler.d.ts +1 -1
  56. package/src/experimental/jobs/simple-scheduler.js +38 -29
  57. package/src/experimental/jobs/strategy.d.ts +7 -0
  58. package/src/experimental/jobs/strategy.js +10 -9
  59. package/src/experimental.d.ts +2 -2
  60. package/src/experimental.js +3 -3
  61. package/src/index.d.ts +2 -2
  62. package/src/index.js +7 -7
  63. package/src/json/index.d.ts +2 -2
  64. package/src/json/index.js +9 -9
  65. package/src/json/interface.d.ts +1 -1
  66. package/src/json/interface.js +7 -0
  67. package/src/json/parser.d.ts +1 -1
  68. package/src/json/parser.js +39 -22
  69. package/src/json/schema/index.d.ts +2 -2
  70. package/src/json/schema/index.js +9 -9
  71. package/src/json/schema/interface.d.ts +1 -1
  72. package/src/json/schema/interface.js +7 -0
  73. package/src/json/schema/pointer.d.ts +1 -1
  74. package/src/json/schema/pointer.js +17 -5
  75. package/src/json/schema/registry.d.ts +1 -1
  76. package/src/json/schema/registry.js +28 -47
  77. package/src/json/schema/schema.d.ts +1 -1
  78. package/src/json/schema/schema.js +3 -3
  79. package/src/json/schema/transforms.d.ts +1 -1
  80. package/src/json/schema/transforms.js +14 -13
  81. package/src/json/schema/utility.d.ts +7 -0
  82. package/src/json/schema/utility.js +7 -7
  83. package/src/json/schema/visitor.d.ts +1 -1
  84. package/src/json/schema/visitor.js +8 -7
  85. package/src/logger/indent.d.ts +7 -0
  86. package/src/logger/indent.js +5 -5
  87. package/src/logger/index.d.ts +1 -1
  88. package/src/logger/index.js +7 -7
  89. package/src/logger/level.d.ts +1 -1
  90. package/src/logger/level.js +7 -0
  91. package/src/logger/logger.d.ts +1 -1
  92. package/src/logger/logger.js +13 -6
  93. package/src/logger/null-logger.d.ts +7 -0
  94. package/src/logger/null-logger.js +3 -3
  95. package/src/logger/transform-logger.d.ts +1 -1
  96. package/src/logger/transform-logger.js +7 -0
  97. package/src/utils/array.d.ts +1 -1
  98. package/src/utils/array.js +2 -2
  99. package/src/utils/index.d.ts +1 -1
  100. package/src/utils/index.js +7 -7
  101. package/src/utils/lang.d.ts +1 -1
  102. package/src/utils/lang.js +3 -3
  103. package/src/utils/literals.d.ts +1 -1
  104. package/src/utils/literals.js +15 -8
  105. package/src/utils/object.d.ts +1 -1
  106. package/src/utils/object.js +3 -3
  107. package/src/utils/partially-ordered-set.d.ts +2 -2
  108. package/src/utils/partially-ordered-set.js +12 -8
  109. package/src/utils/priority-queue.d.ts +1 -1
  110. package/src/utils/priority-queue.js +2 -2
  111. package/src/utils/strings.d.ts +7 -0
  112. package/src/utils/strings.js +12 -9
  113. package/src/utils/template.d.ts +1 -1
  114. package/src/utils/template.js +24 -30
  115. package/src/virtual-fs/host/alias.d.ts +1 -1
  116. package/src/virtual-fs/host/alias.js +7 -5
  117. package/src/virtual-fs/host/buffer.d.ts +1 -1
  118. package/src/virtual-fs/host/buffer.js +7 -0
  119. package/src/virtual-fs/host/create.d.ts +7 -0
  120. package/src/virtual-fs/host/create.js +3 -3
  121. package/src/virtual-fs/host/empty.d.ts +1 -1
  122. package/src/virtual-fs/host/empty.js +3 -3
  123. package/src/virtual-fs/host/index.d.ts +1 -1
  124. package/src/virtual-fs/host/index.js +1 -1
  125. package/src/virtual-fs/host/interface.d.ts +1 -1
  126. package/src/virtual-fs/host/interface.js +7 -0
  127. package/src/virtual-fs/host/memory.d.ts +1 -1
  128. package/src/virtual-fs/host/memory.js +32 -20
  129. package/src/virtual-fs/host/pattern.d.ts +1 -1
  130. package/src/virtual-fs/host/pattern.js +17 -8
  131. package/src/virtual-fs/host/record.d.ts +1 -1
  132. package/src/virtual-fs/host/record.js +45 -28
  133. package/src/virtual-fs/host/resolver.d.ts +1 -1
  134. package/src/virtual-fs/host/resolver.js +10 -1
  135. package/src/virtual-fs/host/safe.d.ts +1 -1
  136. package/src/virtual-fs/host/safe.js +3 -3
  137. package/src/virtual-fs/host/scoped.d.ts +1 -1
  138. package/src/virtual-fs/host/scoped.js +3 -3
  139. package/src/virtual-fs/host/sync.d.ts +1 -1
  140. package/src/virtual-fs/host/sync.js +12 -3
  141. package/src/virtual-fs/host/test.d.ts +1 -1
  142. package/src/virtual-fs/host/test.js +11 -2
  143. package/src/virtual-fs/index.d.ts +2 -2
  144. package/src/virtual-fs/index.js +8 -8
  145. package/src/virtual-fs/path.d.ts +1 -1
  146. package/src/virtual-fs/path.js +17 -8
  147. package/src/workspace/core.d.ts +7 -0
  148. package/src/workspace/core.js +3 -3
  149. package/src/workspace/definitions.d.ts +1 -1
  150. package/src/workspace/definitions.js +7 -0
  151. package/src/workspace/host.d.ts +1 -1
  152. package/src/workspace/host.js +3 -3
  153. package/src/workspace/index.d.ts +1 -1
  154. package/src/workspace/index.js +7 -7
  155. package/src/workspace/json/metadata.d.ts +1 -1
  156. package/src/workspace/json/metadata.js +8 -1
  157. package/src/workspace/json/reader.d.ts +7 -0
  158. package/src/workspace/json/reader.js +4 -4
  159. package/src/workspace/json/utilities.d.ts +1 -1
  160. package/src/workspace/json/utilities.js +12 -5
  161. package/src/workspace/json/writer.d.ts +7 -0
  162. package/src/workspace/json/writer.js +4 -4
@@ -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 { WorkspaceDefinition } from './definitions';
2
9
  import { WorkspaceHost } from './host';
3
10
  /**
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.writeWorkspace = exports.readWorkspace = exports._test_removeWorkspaceFile = exports._test_addWorkspaceFile = exports.WorkspaceFormat = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.writeWorkspace = exports.readWorkspace = exports._test_removeWorkspaceFile = exports._test_addWorkspaceFile = exports.WorkspaceFormat = void 0;
11
11
  const virtual_fs_1 = require("../virtual-fs");
12
12
  const reader_1 = require("./json/reader");
13
13
  const writer_1 = require("./json/writer");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -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
  exports.TargetDefinitionCollection = exports.ProjectDefinitionCollection = void 0;
4
11
  class DefinitionCollection {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createWorkspaceHost = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.createWorkspaceHost = void 0;
11
11
  const virtual_fs_1 = require("../virtual-fs");
12
12
  function createWorkspaceHost(host) {
13
13
  const workspaceHost = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -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
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
10
  if (k2 === undefined) k2 = k;
4
11
  Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
@@ -11,13 +18,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
18
  };
12
19
  Object.defineProperty(exports, "__esModule", { value: true });
13
20
  exports.writeWorkspace = exports.readWorkspace = exports.WorkspaceFormat = exports.createWorkspaceHost = void 0;
14
- /**
15
- * @license
16
- * Copyright Google Inc. All Rights Reserved.
17
- *
18
- * Use of this source code is governed by an MIT-style license that can be
19
- * found in the LICENSE file at https://angular.io/license
20
- */
21
21
  __exportStar(require("./definitions"), exports);
22
22
  var host_1 = require("./host");
23
23
  Object.defineProperty(exports, "createWorkspaceHost", { enumerable: true, get: function () { return host_1.createWorkspaceHost; } });
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -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
  exports.JsonWorkspaceMetadata = exports.JsonWorkspaceSymbol = void 0;
4
11
  exports.JsonWorkspaceSymbol = Symbol.for('@angular/core:workspace-json');
@@ -16,7 +23,7 @@ class JsonWorkspaceMetadata {
16
23
  return this.changes.length;
17
24
  }
18
25
  findChangesForPath(path) {
19
- return this.changes.filter(c => c.path === path);
26
+ return this.changes.filter((c) => c.path === path);
20
27
  }
21
28
  addChange(op, path, node, value, type) {
22
29
  // Remove redundant operations
@@ -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 { WorkspaceDefinition } from '../definitions';
2
9
  import { WorkspaceHost } from '../host';
3
10
  export declare function readJsonWorkspace(path: string, host: WorkspaceHost): Promise<WorkspaceDefinition>;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readJsonWorkspace = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.readJsonWorkspace = void 0;
11
11
  const json_1 = require("../../json");
12
12
  const definitions_1 = require("../definitions");
13
13
  const metadata_1 = require("./metadata");
@@ -22,7 +22,7 @@ async function readJsonWorkspace(path, host) {
22
22
  throw new Error('Invalid workspace file - expected JSON object.');
23
23
  }
24
24
  // Version check
25
- const versionNode = ast.properties.find(pair => pair.key.value === 'version');
25
+ const versionNode = ast.properties.find((pair) => pair.key.value === 'version');
26
26
  if (!versionNode) {
27
27
  throw new Error('Unknown format - version specifier not found.');
28
28
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,10 +1,17 @@
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.createVirtualAstObject = exports.unescapeKey = exports.escapeKey = void 0;
4
- const stableStringify = require("fast-json-stable-stringify");
11
+ const stableStringify = require('fast-json-stable-stringify');
5
12
  function findNode(parent, p) {
6
13
  if (parent.kind === 'object') {
7
- const entry = parent.properties.find(entry => entry.key.value === p);
14
+ const entry = parent.properties.find((entry) => entry.key.value === p);
8
15
  if (entry) {
9
16
  return { node: entry.value, parent: entry };
10
17
  }
@@ -128,7 +135,7 @@ function create(ast, path, reporter, excluded = new Set(), included, base) {
128
135
  set(target, p, value) {
129
136
  if (value === undefined) {
130
137
  // setting to undefined is equivalent to a delete
131
- // tslint:disable-next-line: no-non-null-assertion
138
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
132
139
  return this.deleteProperty(target, p);
133
140
  }
134
141
  if (typeof p === 'symbol' || Reflect.has(target, p)) {
@@ -208,8 +215,8 @@ function create(ast, path, reporter, excluded = new Set(), included, base) {
208
215
  let keys;
209
216
  if (ast.kind === 'object') {
210
217
  keys = ast.properties
211
- .map(entry => entry.key.value)
212
- .filter(p => !excluded.has(p) && (!included || included.has(p)));
218
+ .map((entry) => entry.key.value)
219
+ .filter((p) => !excluded.has(p) && (!included || included.has(p)));
213
220
  }
214
221
  else {
215
222
  keys = [];
@@ -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 { WorkspaceDefinition } from '../definitions';
2
9
  import { WorkspaceHost } from '../host';
3
10
  export declare function writeJsonWorkspace(workspace: WorkspaceDefinition, host: WorkspaceHost, path?: string, options?: {
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.writeJsonWorkspace = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.writeJsonWorkspace = void 0;
11
11
  const magic_string_1 = require("magic-string");
12
12
  const metadata_1 = require("./metadata");
13
13
  const utilities_1 = require("./utilities");
@@ -212,7 +212,7 @@ function updateJsonWorkspace(metadata) {
212
212
  case 'remove':
213
213
  let removalIndex = -1;
214
214
  if (node.kind === 'object') {
215
- removalIndex = elements.findIndex(e => {
215
+ removalIndex = elements.findIndex((e) => {
216
216
  return typeof e != 'string' && e.kind === 'keyvalue' && e.key.value === propertyOrIndex;
217
217
  });
218
218
  }