@depup/angular-devkit__core 21.2.2-depup.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 (169) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/changes.json +5 -0
  4. package/index.d.ts +8 -0
  5. package/index.js +25 -0
  6. package/index.js.map +1 -0
  7. package/node/cli-logger.d.ts +15 -0
  8. package/node/cli-logger.js +58 -0
  9. package/node/cli-logger.js.map +1 -0
  10. package/node/host.d.ts +43 -0
  11. package/node/host.js +211 -0
  12. package/node/host.js.map +1 -0
  13. package/node/index.d.ts +9 -0
  14. package/node/index.js +26 -0
  15. package/node/index.js.map +1 -0
  16. package/node/testing/index.d.ts +20 -0
  17. package/node/testing/index.js +90 -0
  18. package/node/testing/index.js.map +1 -0
  19. package/package.json +76 -0
  20. package/src/exception.d.ts +25 -0
  21. package/src/exception.js +48 -0
  22. package/src/exception.js.map +1 -0
  23. package/src/index.d.ts +15 -0
  24. package/src/index.js +57 -0
  25. package/src/index.js.map +1 -0
  26. package/src/json/index.d.ts +10 -0
  27. package/src/json/index.js +50 -0
  28. package/src/json/index.js.map +1 -0
  29. package/src/json/schema/index.d.ts +15 -0
  30. package/src/json/schema/index.js +55 -0
  31. package/src/json/schema/index.js.map +1 -0
  32. package/src/json/schema/interface.d.ts +84 -0
  33. package/src/json/schema/interface.js +10 -0
  34. package/src/json/schema/interface.js.map +1 -0
  35. package/src/json/schema/pointer.d.ts +11 -0
  36. package/src/json/schema/pointer.js +39 -0
  37. package/src/json/schema/pointer.js.map +1 -0
  38. package/src/json/schema/registry.d.ts +79 -0
  39. package/src/json/schema/registry.js +565 -0
  40. package/src/json/schema/registry.js.map +1 -0
  41. package/src/json/schema/schema.d.ts +22 -0
  42. package/src/json/schema/schema.js +52 -0
  43. package/src/json/schema/schema.js.map +1 -0
  44. package/src/json/schema/transforms.d.ts +12 -0
  45. package/src/json/schema/transforms.js +101 -0
  46. package/src/json/schema/transforms.js.map +1 -0
  47. package/src/json/schema/utility.d.ts +9 -0
  48. package/src/json/schema/utility.js +88 -0
  49. package/src/json/schema/utility.js.map +1 -0
  50. package/src/json/schema/visitor.d.ts +34 -0
  51. package/src/json/schema/visitor.js +147 -0
  52. package/src/json/schema/visitor.js.map +1 -0
  53. package/src/json/utils.d.ts +15 -0
  54. package/src/json/utils.js +18 -0
  55. package/src/json/utils.js.map +1 -0
  56. package/src/logger/indent.d.ts +11 -0
  57. package/src/logger/indent.js +41 -0
  58. package/src/logger/indent.js.map +1 -0
  59. package/src/logger/index.d.ts +12 -0
  60. package/src/logger/index.js +29 -0
  61. package/src/logger/index.js.map +1 -0
  62. package/src/logger/level.d.ts +28 -0
  63. package/src/logger/level.js +51 -0
  64. package/src/logger/level.js.map +1 -0
  65. package/src/logger/logger.d.ts +55 -0
  66. package/src/logger/logger.js +123 -0
  67. package/src/logger/logger.js.map +1 -0
  68. package/src/logger/null-logger.d.ts +12 -0
  69. package/src/logger/null-logger.js +31 -0
  70. package/src/logger/null-logger.js.map +1 -0
  71. package/src/logger/transform-logger.d.ts +12 -0
  72. package/src/logger/transform-logger.js +19 -0
  73. package/src/logger/transform-logger.js.map +1 -0
  74. package/src/utils/index.d.ts +15 -0
  75. package/src/utils/index.js +56 -0
  76. package/src/utils/index.js.map +1 -0
  77. package/src/utils/lang.d.ts +11 -0
  78. package/src/utils/lang.js +21 -0
  79. package/src/utils/lang.js.map +1 -0
  80. package/src/utils/literals.d.ts +15 -0
  81. package/src/utils/literals.js +59 -0
  82. package/src/utils/literals.js.map +1 -0
  83. package/src/utils/object.d.ts +8 -0
  84. package/src/utils/object.js +37 -0
  85. package/src/utils/object.js.map +1 -0
  86. package/src/utils/partially-ordered-set.d.ts +38 -0
  87. package/src/utils/partially-ordered-set.js +145 -0
  88. package/src/utils/partially-ordered-set.js.map +1 -0
  89. package/src/utils/priority-queue.d.ts +19 -0
  90. package/src/utils/priority-queue.js +50 -0
  91. package/src/utils/priority-queue.js.map +1 -0
  92. package/src/utils/strings.d.ts +112 -0
  93. package/src/utils/strings.js +179 -0
  94. package/src/utils/strings.js.map +1 -0
  95. package/src/utils/template.d.ts +89 -0
  96. package/src/utils/template.js +260 -0
  97. package/src/utils/template.js.map +1 -0
  98. package/src/virtual-fs/host/alias.d.ts +60 -0
  99. package/src/virtual-fs/host/alias.js +84 -0
  100. package/src/virtual-fs/host/alias.js.map +1 -0
  101. package/src/virtual-fs/host/buffer.d.ts +10 -0
  102. package/src/virtual-fs/host/buffer.js +22 -0
  103. package/src/virtual-fs/host/buffer.js.map +1 -0
  104. package/src/virtual-fs/host/create.d.ts +21 -0
  105. package/src/virtual-fs/host/create.js +55 -0
  106. package/src/virtual-fs/host/create.js.map +1 -0
  107. package/src/virtual-fs/host/empty.d.ts +19 -0
  108. package/src/virtual-fs/host/empty.js +38 -0
  109. package/src/virtual-fs/host/empty.js.map +1 -0
  110. package/src/virtual-fs/host/index.d.ts +21 -0
  111. package/src/virtual-fs/host/index.js +61 -0
  112. package/src/virtual-fs/host/index.js.map +1 -0
  113. package/src/virtual-fs/host/interface.d.ts +53 -0
  114. package/src/virtual-fs/host/interface.js +18 -0
  115. package/src/virtual-fs/host/interface.js.map +1 -0
  116. package/src/virtual-fs/host/memory.d.ts +49 -0
  117. package/src/virtual-fs/host/memory.js +332 -0
  118. package/src/virtual-fs/host/memory.js.map +1 -0
  119. package/src/virtual-fs/host/pattern.d.ts +17 -0
  120. package/src/virtual-fs/host/pattern.js +35 -0
  121. package/src/virtual-fs/host/pattern.js.map +1 -0
  122. package/src/virtual-fs/host/record.d.ts +92 -0
  123. package/src/virtual-fs/host/record.js +315 -0
  124. package/src/virtual-fs/host/record.js.map +1 -0
  125. package/src/virtual-fs/host/resolver.d.ts +30 -0
  126. package/src/virtual-fs/host/resolver.js +57 -0
  127. package/src/virtual-fs/host/resolver.js.map +1 -0
  128. package/src/virtual-fs/host/safe.d.ts +25 -0
  129. package/src/virtual-fs/host/safe.js +46 -0
  130. package/src/virtual-fs/host/safe.js.map +1 -0
  131. package/src/virtual-fs/host/scoped.d.ts +15 -0
  132. package/src/virtual-fs/host/scoped.js +24 -0
  133. package/src/virtual-fs/host/scoped.js.map +1 -0
  134. package/src/virtual-fs/host/sync.d.ts +34 -0
  135. package/src/virtual-fs/host/sync.js +93 -0
  136. package/src/virtual-fs/host/sync.js.map +1 -0
  137. package/src/virtual-fs/host/test.d.ts +48 -0
  138. package/src/virtual-fs/host/test.js +119 -0
  139. package/src/virtual-fs/host/test.js.map +1 -0
  140. package/src/virtual-fs/index.d.ts +10 -0
  141. package/src/virtual-fs/index.js +50 -0
  142. package/src/virtual-fs/index.js.map +1 -0
  143. package/src/virtual-fs/path.d.ts +111 -0
  144. package/src/virtual-fs/path.js +286 -0
  145. package/src/virtual-fs/path.js.map +1 -0
  146. package/src/workspace/core.d.ts +61 -0
  147. package/src/workspace/core.js +133 -0
  148. package/src/workspace/core.js.map +1 -0
  149. package/src/workspace/definitions.d.ts +63 -0
  150. package/src/workspace/definitions.js +169 -0
  151. package/src/workspace/definitions.js.map +1 -0
  152. package/src/workspace/host.d.ts +15 -0
  153. package/src/workspace/host.js +43 -0
  154. package/src/workspace/host.js.map +1 -0
  155. package/src/workspace/index.d.ts +10 -0
  156. package/src/workspace/index.js +32 -0
  157. package/src/workspace/index.js.map +1 -0
  158. package/src/workspace/json/metadata.d.ts +40 -0
  159. package/src/workspace/json/metadata.js +60 -0
  160. package/src/workspace/json/metadata.js.map +1 -0
  161. package/src/workspace/json/reader.d.ts +14 -0
  162. package/src/workspace/json/reader.js +231 -0
  163. package/src/workspace/json/reader.js.map +1 -0
  164. package/src/workspace/json/utilities.d.ts +14 -0
  165. package/src/workspace/json/utilities.js +113 -0
  166. package/src/workspace/json/utilities.js.map +1 -0
  167. package/src/workspace/json/writer.d.ts +12 -0
  168. package/src/workspace/json/writer.js +145 -0
  169. package/src/workspace/json/writer.js.map +1 -0
@@ -0,0 +1,286 @@
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.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.path = exports.NormalizedRoot = exports.NormalizedSep = exports.PathCannotBeFragmentException = exports.PathMustBeAbsoluteException = exports.InvalidPathException = void 0;
11
+ exports.split = split;
12
+ exports.extname = extname;
13
+ exports.basename = basename;
14
+ exports.dirname = dirname;
15
+ exports.join = join;
16
+ exports.isAbsolute = isAbsolute;
17
+ exports.relative = relative;
18
+ exports.resolve = resolve;
19
+ exports.fragment = fragment;
20
+ exports.resetNormalizeCache = resetNormalizeCache;
21
+ exports.normalize = normalize;
22
+ exports.noCacheNormalize = noCacheNormalize;
23
+ exports.asWindowsPath = asWindowsPath;
24
+ exports.asPosixPath = asPosixPath;
25
+ exports.getSystemPath = getSystemPath;
26
+ const exception_1 = require("../exception");
27
+ class InvalidPathException extends exception_1.BaseException {
28
+ constructor(path) {
29
+ super(`Path ${JSON.stringify(path)} is invalid.`);
30
+ }
31
+ }
32
+ exports.InvalidPathException = InvalidPathException;
33
+ class PathMustBeAbsoluteException extends exception_1.BaseException {
34
+ constructor(path) {
35
+ super(`Path ${JSON.stringify(path)} must be absolute.`);
36
+ }
37
+ }
38
+ exports.PathMustBeAbsoluteException = PathMustBeAbsoluteException;
39
+ class PathCannotBeFragmentException extends exception_1.BaseException {
40
+ constructor(path) {
41
+ super(`Path ${JSON.stringify(path)} cannot be made a fragment.`);
42
+ }
43
+ }
44
+ exports.PathCannotBeFragmentException = PathCannotBeFragmentException;
45
+ /**
46
+ * The Separator for normalized path.
47
+ */
48
+ exports.NormalizedSep = '/';
49
+ /**
50
+ * The root of a normalized path.
51
+ */
52
+ exports.NormalizedRoot = exports.NormalizedSep;
53
+ /**
54
+ * Split a path into multiple path fragments. Each fragments except the last one will end with
55
+ * a path separator.
56
+ * @param {Path} path The path to split.
57
+ * @returns {Path[]} An array of path fragments.
58
+ */
59
+ function split(path) {
60
+ const fragments = path.split(exports.NormalizedSep).map((x) => fragment(x));
61
+ if (fragments.at(-1)?.length === 0) {
62
+ fragments.pop();
63
+ }
64
+ return fragments;
65
+ }
66
+ /**
67
+ *
68
+ */
69
+ function extname(path) {
70
+ const base = basename(path);
71
+ const i = base.lastIndexOf('.');
72
+ if (i < 1) {
73
+ return '';
74
+ }
75
+ else {
76
+ return base.slice(i);
77
+ }
78
+ }
79
+ /**
80
+ * Return the basename of the path, as a Path. See path.basename
81
+ */
82
+ function basename(path) {
83
+ const i = path.lastIndexOf(exports.NormalizedSep);
84
+ if (i == -1) {
85
+ return fragment(path);
86
+ }
87
+ else {
88
+ return fragment(path.slice(path.lastIndexOf(exports.NormalizedSep) + 1));
89
+ }
90
+ }
91
+ /**
92
+ * Return the dirname of the path, as a Path. See path.dirname
93
+ */
94
+ function dirname(path) {
95
+ const index = path.lastIndexOf(exports.NormalizedSep);
96
+ if (index === -1) {
97
+ return '';
98
+ }
99
+ const endIndex = index === 0 ? 1 : index; // case of file under root: '/file'
100
+ return normalize(path.slice(0, endIndex));
101
+ }
102
+ /**
103
+ * Join multiple paths together, and normalize the result. Accepts strings that will be
104
+ * normalized as well (but the original must be a path).
105
+ */
106
+ function join(p1, ...others) {
107
+ if (others.length > 0) {
108
+ return normalize((p1 ? p1 + exports.NormalizedSep : '') + others.join(exports.NormalizedSep));
109
+ }
110
+ else {
111
+ return p1;
112
+ }
113
+ }
114
+ /**
115
+ * Returns true if a path is absolute.
116
+ */
117
+ function isAbsolute(p) {
118
+ return p.startsWith(exports.NormalizedSep);
119
+ }
120
+ /**
121
+ * Returns a path such that `join(from, relative(from, to)) == to`.
122
+ * Both paths must be absolute, otherwise it does not make much sense.
123
+ */
124
+ function relative(from, to) {
125
+ if (!isAbsolute(from)) {
126
+ throw new PathMustBeAbsoluteException(from);
127
+ }
128
+ if (!isAbsolute(to)) {
129
+ throw new PathMustBeAbsoluteException(to);
130
+ }
131
+ let p;
132
+ if (from == to) {
133
+ p = '';
134
+ }
135
+ else {
136
+ const splitFrom = split(from);
137
+ const splitTo = split(to);
138
+ while (splitFrom.length > 0 && splitTo.length > 0 && splitFrom[0] == splitTo[0]) {
139
+ splitFrom.shift();
140
+ splitTo.shift();
141
+ }
142
+ if (splitFrom.length == 0) {
143
+ p = splitTo.join(exports.NormalizedSep);
144
+ }
145
+ else {
146
+ p = splitFrom
147
+ .map(() => '..')
148
+ .concat(splitTo)
149
+ .join(exports.NormalizedSep);
150
+ }
151
+ }
152
+ return normalize(p);
153
+ }
154
+ /**
155
+ * Returns a Path that is the resolution of p2, from p1. If p2 is absolute, it will return p2,
156
+ * otherwise will join both p1 and p2.
157
+ */
158
+ function resolve(p1, p2) {
159
+ if (isAbsolute(p2)) {
160
+ return p2;
161
+ }
162
+ else {
163
+ return join(p1, p2);
164
+ }
165
+ }
166
+ function fragment(path) {
167
+ if (path.indexOf(exports.NormalizedSep) != -1) {
168
+ throw new PathCannotBeFragmentException(path);
169
+ }
170
+ return path;
171
+ }
172
+ /**
173
+ * normalize() cache to reduce computation. For now this grows and we never flush it, but in the
174
+ * future we might want to add a few cache flush to prevent this from growing too large.
175
+ */
176
+ let normalizedCache = new Map();
177
+ /**
178
+ * Reset the cache. This is only useful for testing.
179
+ * @private
180
+ */
181
+ function resetNormalizeCache() {
182
+ normalizedCache = new Map();
183
+ }
184
+ /**
185
+ * Normalize a string into a Path. This is the only mean to get a Path type from a string that
186
+ * represents a system path. This method cache the results as real world paths tend to be
187
+ * duplicated often.
188
+ * Normalization includes:
189
+ * - Windows backslashes `\\` are replaced with `/`.
190
+ * - Windows drivers are replaced with `/X/`, where X is the drive letter.
191
+ * - Absolute paths starts with `/`.
192
+ * - Multiple `/` are replaced by a single one.
193
+ * - Path segments `.` are removed.
194
+ * - Path segments `..` are resolved.
195
+ * - If a path is absolute, having a `..` at the start is invalid (and will throw).
196
+ * @param path The path to be normalized.
197
+ */
198
+ function normalize(path) {
199
+ let maybePath = normalizedCache.get(path);
200
+ if (!maybePath) {
201
+ maybePath = noCacheNormalize(path);
202
+ normalizedCache.set(path, maybePath);
203
+ }
204
+ return maybePath;
205
+ }
206
+ /**
207
+ * The no cache version of the normalize() function. Used for benchmarking and testing.
208
+ */
209
+ function noCacheNormalize(path) {
210
+ if (path == '' || path == '.') {
211
+ return '';
212
+ }
213
+ else if (path == exports.NormalizedRoot) {
214
+ return exports.NormalizedRoot;
215
+ }
216
+ // Match absolute windows path.
217
+ const original = path;
218
+ if (path.match(/^[A-Z]:[/\\]/i)) {
219
+ path = '\\' + path[0].toUpperCase() + '\\' + path.slice(3);
220
+ }
221
+ // We convert Windows paths as well here.
222
+ const p = path.split(/[/\\]/g);
223
+ let relative = false;
224
+ let i = 1;
225
+ // Special case the first one.
226
+ if (p[0] != '') {
227
+ p.unshift('.');
228
+ relative = true;
229
+ }
230
+ while (i < p.length) {
231
+ if (p[i] == '.') {
232
+ p.splice(i, 1);
233
+ }
234
+ else if (p[i] == '..') {
235
+ if (i < 2 && !relative) {
236
+ throw new InvalidPathException(original);
237
+ }
238
+ else if (i >= 2 && p[i - 1] != '..') {
239
+ p.splice(i - 1, 2);
240
+ i--;
241
+ }
242
+ else {
243
+ i++;
244
+ }
245
+ }
246
+ else if (p[i] == '') {
247
+ p.splice(i, 1);
248
+ }
249
+ else {
250
+ i++;
251
+ }
252
+ }
253
+ if (p.length == 1) {
254
+ return p[0] == '' ? exports.NormalizedSep : '';
255
+ }
256
+ else {
257
+ if (p[0] == '.') {
258
+ p.shift();
259
+ }
260
+ return p.join(exports.NormalizedSep);
261
+ }
262
+ }
263
+ const path = (strings, ...values) => {
264
+ return normalize(String.raw(strings, ...values));
265
+ };
266
+ exports.path = path;
267
+ function asWindowsPath(path) {
268
+ const drive = path.match(/^\/(\w)(?:\/(.*))?$/);
269
+ if (drive) {
270
+ const subPath = drive[2] ? drive[2].replace(/\//g, '\\') : '';
271
+ return `${drive[1]}:\\${subPath}`;
272
+ }
273
+ return path.replace(/\//g, '\\');
274
+ }
275
+ function asPosixPath(path) {
276
+ return path;
277
+ }
278
+ function getSystemPath(path) {
279
+ if (process.platform.startsWith('win32')) {
280
+ return asWindowsPath(path);
281
+ }
282
+ else {
283
+ return asPosixPath(path);
284
+ }
285
+ }
286
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["path.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAmDH,sBAOC;AAKD,0BAQC;AAKD,4BAOC;AAKD,0BASC;AAMD,oBAMC;AAKD,gCAEC;AAMD,4BAgCC;AAMD,0BAMC;AAED,4BAMC;AAYD,kDAEC;AAgBD,8BAQC;AAKD,4CAoDC;AAcD,sCASC;AAED,kCAEC;AAED,sCAMC;AA9SD,4CAA6C;AAG7C,MAAa,oBAAqB,SAAQ,yBAAa;IACrD,YAAY,IAAY;QACtB,KAAK,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACpD,CAAC;CACF;AAJD,oDAIC;AACD,MAAa,2BAA4B,SAAQ,yBAAa;IAC5D,YAAY,IAAY;QACtB,KAAK,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC1D,CAAC;CACF;AAJD,kEAIC;AACD,MAAa,6BAA8B,SAAQ,yBAAa;IAC9D,YAAY,IAAY;QACtB,KAAK,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IACnE,CAAC;CACF;AAJD,sEAIC;AAgBD;;GAEG;AACU,QAAA,aAAa,GAAS,GAAW,CAAC;AAE/C;;GAEG;AACU,QAAA,cAAc,GAAS,qBAAa,CAAC;AAElD;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,IAAU;IAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAa,CAAC,CAAC,GAAG,CAAC,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O,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9D,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,OAAO,EAAiB,CAAC;IACnD,CAAC;IAED,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAgB,CAAC;AAClD,CAAC;AAED,SAAgB,WAAW,CAAC,IAAU;IACpC,OAAO,IAA2B,CAAC;AACrC,CAAC;AAED,SAAgB,aAAa,CAAC,IAAU;IACtC,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC"}
@@ -0,0 +1,61 @@
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.dev/license
7
+ */
8
+ import { WorkspaceDefinition } from './definitions';
9
+ import { WorkspaceHost } from './host';
10
+ /**
11
+ * Supported workspace formats
12
+ */
13
+ export declare enum WorkspaceFormat {
14
+ JSON = 0
15
+ }
16
+ /**
17
+ * @private
18
+ */
19
+ export declare function _test_addWorkspaceFile(name: string, format: WorkspaceFormat): void;
20
+ /**
21
+ * @private
22
+ */
23
+ export declare function _test_removeWorkspaceFile(name: string): void;
24
+ /**
25
+ * Reads and constructs a `WorkspaceDefinition`. If the function is provided with a path to a
26
+ * directory instead of a file, a search of the directory's files will commence to attempt to
27
+ * locate a known workspace file. Currently the following are considered known workspace files:
28
+ * - `angular.json`
29
+ * - `.angular.json`
30
+ *
31
+ * @param path The path to either a workspace file or a directory containing a workspace file.
32
+ * @param host The `WorkspaceHost` to use to access the file and directory data.
33
+ * @param format An optional `WorkspaceFormat` value. Used if the path specifies a non-standard
34
+ * file name that would prevent automatically discovering the format.
35
+ *
36
+ *
37
+ * @return An `Promise` of the read result object with the `WorkspaceDefinition` contained within
38
+ * the `workspace` property.
39
+ */
40
+ export declare function readWorkspace(path: string, host: WorkspaceHost, format?: WorkspaceFormat): Promise<{
41
+ workspace: WorkspaceDefinition;
42
+ }>;
43
+ /**
44
+ * Writes a `WorkspaceDefinition` to the underlying storage via the provided `WorkspaceHost`.
45
+ * If the `WorkspaceDefinition` was created via the `readWorkspace` function, metadata will be
46
+ * used to determine the path and format of the Workspace. In all other cases, the `path` and
47
+ * `format` options must be specified as they would be otherwise unknown.
48
+ *
49
+ * @param workspace The `WorkspaceDefinition` that will be written.
50
+ * @param host The `WorkspaceHost` to use to access/write the file and directory data.
51
+ * @param path The path to a file location for the output. Required if `readWorkspace` was not
52
+ * used to create the `WorkspaceDefinition`. Optional otherwise; will override the
53
+ * `WorkspaceDefinition` metadata if provided.
54
+ * @param format The `WorkspaceFormat` to use for output. Required if `readWorkspace` was not
55
+ * used to create the `WorkspaceDefinition`. Optional otherwise; will override the
56
+ * `WorkspaceDefinition` metadata if provided.
57
+ *
58
+ *
59
+ * @return An `Promise` of type `void`.
60
+ */
61
+ export declare function writeWorkspace(workspace: WorkspaceDefinition, host: WorkspaceHost, path?: string, format?: WorkspaceFormat): Promise<void>;
@@ -0,0 +1,133 @@
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.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.WorkspaceFormat = void 0;
11
+ exports._test_addWorkspaceFile = _test_addWorkspaceFile;
12
+ exports._test_removeWorkspaceFile = _test_removeWorkspaceFile;
13
+ exports.readWorkspace = readWorkspace;
14
+ exports.writeWorkspace = writeWorkspace;
15
+ const virtual_fs_1 = require("../virtual-fs");
16
+ const reader_1 = require("./json/reader");
17
+ const writer_1 = require("./json/writer");
18
+ const formatLookup = new WeakMap();
19
+ /**
20
+ * Supported workspace formats
21
+ */
22
+ var WorkspaceFormat;
23
+ (function (WorkspaceFormat) {
24
+ WorkspaceFormat[WorkspaceFormat["JSON"] = 0] = "JSON";
25
+ })(WorkspaceFormat || (exports.WorkspaceFormat = WorkspaceFormat = {}));
26
+ /**
27
+ * @private
28
+ */
29
+ function _test_addWorkspaceFile(name, format) {
30
+ workspaceFiles[name] = format;
31
+ }
32
+ /**
33
+ * @private
34
+ */
35
+ function _test_removeWorkspaceFile(name) {
36
+ delete workspaceFiles[name];
37
+ }
38
+ // NOTE: future additions could also perform content analysis to determine format/version
39
+ const workspaceFiles = {
40
+ 'angular.json': WorkspaceFormat.JSON,
41
+ '.angular.json': WorkspaceFormat.JSON,
42
+ };
43
+ /**
44
+ * Reads and constructs a `WorkspaceDefinition`. If the function is provided with a path to a
45
+ * directory instead of a file, a search of the directory's files will commence to attempt to
46
+ * locate a known workspace file. Currently the following are considered known workspace files:
47
+ * - `angular.json`
48
+ * - `.angular.json`
49
+ *
50
+ * @param path The path to either a workspace file or a directory containing a workspace file.
51
+ * @param host The `WorkspaceHost` to use to access the file and directory data.
52
+ * @param format An optional `WorkspaceFormat` value. Used if the path specifies a non-standard
53
+ * file name that would prevent automatically discovering the format.
54
+ *
55
+ *
56
+ * @return An `Promise` of the read result object with the `WorkspaceDefinition` contained within
57
+ * the `workspace` property.
58
+ */
59
+ async function readWorkspace(path, host, format) {
60
+ if (await host.isDirectory(path)) {
61
+ // TODO: Warn if multiple found (requires diagnostics support)
62
+ const directory = (0, virtual_fs_1.normalize)(path);
63
+ let found = false;
64
+ for (const [name, nameFormat] of Object.entries(workspaceFiles)) {
65
+ if (format !== undefined && format !== nameFormat) {
66
+ continue;
67
+ }
68
+ const potential = (0, virtual_fs_1.getSystemPath)((0, virtual_fs_1.join)(directory, name));
69
+ if (await host.isFile(potential)) {
70
+ path = potential;
71
+ format = nameFormat;
72
+ found = true;
73
+ break;
74
+ }
75
+ }
76
+ if (!found) {
77
+ throw new Error('Unable to locate a workspace file for workspace path. Are you missing an `angular.json`' +
78
+ ' or `.angular.json` file?');
79
+ }
80
+ }
81
+ else if (format === undefined) {
82
+ const filename = (0, virtual_fs_1.basename)((0, virtual_fs_1.normalize)(path));
83
+ if (filename in workspaceFiles) {
84
+ format = workspaceFiles[filename];
85
+ }
86
+ }
87
+ if (format === undefined) {
88
+ throw new Error('Unable to determine format for workspace path.');
89
+ }
90
+ let workspace;
91
+ switch (format) {
92
+ case WorkspaceFormat.JSON:
93
+ workspace = await (0, reader_1.readJsonWorkspace)(path, host);
94
+ break;
95
+ default:
96
+ throw new Error('Unsupported workspace format.');
97
+ }
98
+ formatLookup.set(workspace, WorkspaceFormat.JSON);
99
+ return { workspace };
100
+ }
101
+ /**
102
+ * Writes a `WorkspaceDefinition` to the underlying storage via the provided `WorkspaceHost`.
103
+ * If the `WorkspaceDefinition` was created via the `readWorkspace` function, metadata will be
104
+ * used to determine the path and format of the Workspace. In all other cases, the `path` and
105
+ * `format` options must be specified as they would be otherwise unknown.
106
+ *
107
+ * @param workspace The `WorkspaceDefinition` that will be written.
108
+ * @param host The `WorkspaceHost` to use to access/write the file and directory data.
109
+ * @param path The path to a file location for the output. Required if `readWorkspace` was not
110
+ * used to create the `WorkspaceDefinition`. Optional otherwise; will override the
111
+ * `WorkspaceDefinition` metadata if provided.
112
+ * @param format The `WorkspaceFormat` to use for output. Required if `readWorkspace` was not
113
+ * used to create the `WorkspaceDefinition`. Optional otherwise; will override the
114
+ * `WorkspaceDefinition` metadata if provided.
115
+ *
116
+ *
117
+ * @return An `Promise` of type `void`.
118
+ */
119
+ async function writeWorkspace(workspace, host, path, format) {
120
+ if (format === undefined) {
121
+ format = formatLookup.get(workspace);
122
+ if (format === undefined) {
123
+ throw new Error('A format is required for custom workspace objects.');
124
+ }
125
+ }
126
+ switch (format) {
127
+ case WorkspaceFormat.JSON:
128
+ return (0, writer_1.writeJsonWorkspace)(workspace, host, path);
129
+ default:
130
+ throw new Error('Unsupported workspace format.');
131
+ }
132
+ }
133
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAoBH,wDAEC;AAKD,8DAEC;AAwBD,sCAoDC;AAoBD,wCAmBC;AA9ID,8CAAyE;AAGzE,0CAAkD;AAClD,0CAAmD;AAEnD,MAAM,YAAY,GAAG,IAAI,OAAO,EAAwC,CAAC;AAEzE;;GAEG;AACH,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,qDAAI,CAAA;AACN,CAAC,EAFW,eAAe,+BAAf,eAAe,QAE1B;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAAC,IAAY,EAAE,MAAuB;IAC1E,cAAc,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CAAC,IAAY;IACpD,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,yFAAyF;AACzF,MAAM,cAAc,GAAoC;IACtD,cAAc,EAAE,eAAe,CAAC,IAAI;IACpC,eAAe,EAAE,eAAe,CAAC,IAAI;CACtC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,aAAa,CACjC,IAAY,EACZ,IAAmB,EACnB,MAAwB;IAGxB,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,8DAA8D;QAC9D,MAAM,SAAS,GAAG,IAAA,sBAAS,EAAC,IAAI,CAAC,CAAC;QAClC,IAAI,KAAK,GAAG,KAAK,CAAC;QAClB,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YAChE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iBG;AACI,KAAK,UAAU,cAAc,CAClC,SAA8B,EAC9B,IAAmB,EACnB,IAAa,EACb,MAAwB;IAExB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,eAAe,CAAC,IAAI;YACvB,OAAO,IAAA,2BAAkB,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACnD;YACE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -0,0 +1,63 @@
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.dev/license
7
+ */
8
+ import { JsonValue } from '../json';
9
+ export interface WorkspaceDefinition {
10
+ readonly extensions: Record<string, JsonValue | undefined>;
11
+ readonly projects: ProjectDefinitionCollection;
12
+ }
13
+ export interface ProjectDefinition {
14
+ readonly extensions: Record<string, JsonValue | undefined>;
15
+ readonly targets: TargetDefinitionCollection;
16
+ root: string;
17
+ prefix?: string;
18
+ sourceRoot?: string;
19
+ }
20
+ export interface TargetDefinition {
21
+ options?: Record<string, JsonValue | undefined>;
22
+ configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
23
+ defaultConfiguration?: string;
24
+ builder: string;
25
+ }
26
+ export type DefinitionCollectionListener<V extends object> = (name: string, newValue: V | undefined, collection: DefinitionCollection<V>) => void;
27
+ declare class DefinitionCollection<V extends object> implements ReadonlyMap<string, V> {
28
+ private _listener?;
29
+ private _map;
30
+ constructor(initial?: Record<string, V>, _listener?: DefinitionCollectionListener<V> | undefined);
31
+ delete(key: string): boolean;
32
+ set(key: string, value: V): this;
33
+ forEach<T>(callbackfn: (value: V, key: string, map: DefinitionCollection<V>) => void, thisArg?: T): void;
34
+ get(key: string): V | undefined;
35
+ has(key: string): boolean;
36
+ get size(): number;
37
+ [Symbol.iterator](): MapIterator<[string, V]>;
38
+ entries(): MapIterator<[string, V]>;
39
+ keys(): MapIterator<string>;
40
+ values(): MapIterator<V>;
41
+ }
42
+ export declare class ProjectDefinitionCollection extends DefinitionCollection<ProjectDefinition> {
43
+ constructor(initial?: Record<string, ProjectDefinition>, listener?: DefinitionCollectionListener<ProjectDefinition>);
44
+ add(definition: {
45
+ name: string;
46
+ root: string;
47
+ sourceRoot?: string;
48
+ prefix?: string;
49
+ targets?: Record<string, TargetDefinition | undefined>;
50
+ [key: string]: unknown;
51
+ }): ProjectDefinition;
52
+ set(name: string, value: ProjectDefinition): this;
53
+ private _validateName;
54
+ }
55
+ export declare class TargetDefinitionCollection extends DefinitionCollection<TargetDefinition> {
56
+ constructor(initial?: Record<string, TargetDefinition>, listener?: DefinitionCollectionListener<TargetDefinition>);
57
+ add(definition: {
58
+ name: string;
59
+ } & TargetDefinition): TargetDefinition;
60
+ set(name: string, value: TargetDefinition): this;
61
+ private _validateName;
62
+ }
63
+ export {};