@angular/compiler-cli 21.0.0-next.9 → 21.0.0-rc.1

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 (32) hide show
  1. package/bundles/{chunk-SIOKS4LN.js → chunk-5UJIUEKT.js} +285 -799
  2. package/bundles/chunk-DBAV4W4V.js +644 -0
  3. package/bundles/chunk-DT6FD4OE.js +1 -1
  4. package/bundles/{chunk-3UF7UI6H.js → chunk-VBBJY6IR.js} +17827 -17100
  5. package/bundles/{chunk-IE2YQNTQ.js → chunk-YVYYMXOI.js} +1 -1
  6. package/bundles/index.js +18 -18
  7. package/bundles/private/migrations.js +49 -5
  8. package/bundles/private/testing.js +526 -0
  9. package/bundles/private/tooling.js +1 -2
  10. package/bundles/src/bin/ng_xi18n.js +4 -4
  11. package/bundles/src/bin/ngc.js +4 -4
  12. package/index.d.ts +1 -1
  13. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
  14. package/package.json +5 -13
  15. package/private/migrations.d.ts +11 -5
  16. package/private/testing.d.ts +11 -0
  17. package/src/ngtsc/annotations/index.d.ts +3 -2
  18. package/src/ngtsc/core/index.d.ts +1 -0
  19. package/src/ngtsc/diagnostics/src/error_code.d.ts +2 -0
  20. package/src/ngtsc/docs/src/entities.d.ts +7 -1
  21. package/src/ngtsc/docs/src/extractor.d.ts +6 -0
  22. package/src/ngtsc/docs/src/namespace_extractor.d.ts +15 -0
  23. package/src/ngtsc/docs/src/variable_extractor.d.ts +16 -0
  24. package/src/ngtsc/file_system/testing/index.d.ts +12 -0
  25. package/src/ngtsc/file_system/testing/src/mock_file_system.d.ts +71 -0
  26. package/src/ngtsc/file_system/testing/src/mock_file_system_native.d.ts +15 -0
  27. package/src/ngtsc/file_system/testing/src/mock_file_system_posix.d.ts +12 -0
  28. package/src/ngtsc/file_system/testing/src/mock_file_system_windows.d.ts +12 -0
  29. package/src/ngtsc/file_system/testing/src/test_helper.d.ts +16 -0
  30. package/src/ngtsc/translator/src/translator.d.ts +1 -1
  31. package/src/ngtsc/typecheck/src/oob.d.ts +5 -0
  32. package/bundles/chunk-HRLHX4UA.js +0 -548
@@ -12,7 +12,7 @@ import {
12
12
  formatDiagnostics,
13
13
  performCompilation,
14
14
  readConfiguration
15
- } from "./chunk-SIOKS4LN.js";
15
+ } from "./chunk-DBAV4W4V.js";
16
16
 
17
17
  // packages/compiler-cli/src/main.js
18
18
  import ts2 from "typescript";
package/bundles/index.js CHANGED
@@ -4,16 +4,8 @@
4
4
 
5
5
  import {
6
6
  DEFAULT_ERROR_CODE,
7
- DecoratorType,
8
- DocsExtractor,
9
7
  EmitFlags,
10
- EntryType,
11
- MemberTags,
12
- MemberType,
13
- NgCompiler,
14
- NgCompilerHost,
15
8
  NgtscProgram,
16
- PatchedProgramIncrementalBuildStrategy,
17
9
  SOURCE,
18
10
  UNKNOWN_ERROR_CODE,
19
11
  calcProjectFileAndBasePath,
@@ -22,31 +14,39 @@ import {
22
14
  defaultGatherDiagnostics,
23
15
  exitCodeFromResult,
24
16
  formatDiagnostics,
25
- freshCompilationTicket,
26
- incrementalFromStateTicket,
27
- isDocEntryWithSourceInfo,
28
17
  isTsDiagnostic,
29
18
  performCompilation,
30
19
  readConfiguration
31
- } from "./chunk-SIOKS4LN.js";
20
+ } from "./chunk-DBAV4W4V.js";
32
21
  import {
33
22
  ConsoleLogger,
34
23
  LogLevel
35
24
  } from "./chunk-6HOSNZU5.js";
36
25
  import {
37
- angularJitApplicationTransform,
38
- getDownlevelDecoratorsTransform,
39
- getInitializerApiJitTransform
40
- } from "./chunk-HRLHX4UA.js";
26
+ DecoratorType,
27
+ DocsExtractor,
28
+ EntryType,
29
+ MemberTags,
30
+ MemberType,
31
+ NgCompiler,
32
+ NgCompilerHost,
33
+ PatchedProgramIncrementalBuildStrategy,
34
+ freshCompilationTicket,
35
+ incrementalFromStateTicket,
36
+ isDocEntryWithSourceInfo
37
+ } from "./chunk-5UJIUEKT.js";
41
38
  import {
42
39
  ActivePerfRecorder,
43
40
  ErrorCode,
44
41
  OptimizeFor,
45
42
  PerfPhase,
46
43
  TsCreateProgramDriver,
44
+ angularJitApplicationTransform,
45
+ getDownlevelDecoratorsTransform,
46
+ getInitializerApiJitTransform,
47
47
  isLocalCompilationDiagnostics,
48
48
  ngErrorCode
49
- } from "./chunk-3UF7UI6H.js";
49
+ } from "./chunk-VBBJY6IR.js";
50
50
  import "./chunk-LS5RJ5CS.js";
51
51
  import {
52
52
  InvalidFileSystem,
@@ -77,7 +77,7 @@ import "./chunk-G7GFT6BU.js";
77
77
 
78
78
  // packages/compiler-cli/src/version.js
79
79
  import { Version } from "@angular/compiler";
80
- var VERSION = new Version("21.0.0-next.9");
80
+ var VERSION = new Version("21.0.0-rc.1");
81
81
 
82
82
  // packages/compiler-cli/private/tooling.js
83
83
  var GLOBAL_DEFS_FOR_TERSER = {
@@ -3,32 +3,76 @@
3
3
  const require = __cjsCompatRequire(import.meta.url);
4
4
 
5
5
  import {
6
+ DiagnosticCategoryLabel,
7
+ NgCompiler
8
+ } from "../chunk-5UJIUEKT.js";
9
+ import {
10
+ CompilationMode,
11
+ DtsMetadataReader,
6
12
  DynamicValue,
13
+ FatalDiagnosticError,
7
14
  ImportManager,
8
15
  PartialEvaluator,
9
16
  PotentialImportKind,
10
17
  PotentialImportMode,
11
18
  Reference,
19
+ ReferenceEmitKind,
20
+ ReferenceEmitter,
12
21
  StaticInterpreter,
22
+ SymbolKind,
13
23
  TypeScriptReflectionHost,
14
24
  createForwardRefResolver,
15
- reflectObjectLiteral
16
- } from "../chunk-3UF7UI6H.js";
25
+ extractDecoratorQueryMetadata,
26
+ extractTemplate,
27
+ findAngularDecorator,
28
+ getAngularDecorators,
29
+ getRootDirs,
30
+ isShim,
31
+ parseDecoratorInputTransformFunction,
32
+ queryDecoratorNames,
33
+ reflectObjectLiteral,
34
+ unwrapExpression
35
+ } from "../chunk-VBBJY6IR.js";
17
36
  import "../chunk-LS5RJ5CS.js";
18
- import "../chunk-GWZQLAGK.js";
19
- import "../chunk-XYYEESKY.js";
37
+ import {
38
+ getFileSystem,
39
+ isLocalRelativePath
40
+ } from "../chunk-GWZQLAGK.js";
41
+ import {
42
+ NodeJSFileSystem
43
+ } from "../chunk-XYYEESKY.js";
20
44
  import "../chunk-G7GFT6BU.js";
21
45
  export {
46
+ CompilationMode,
47
+ DiagnosticCategoryLabel,
48
+ DtsMetadataReader,
22
49
  DynamicValue,
50
+ FatalDiagnosticError,
23
51
  ImportManager,
52
+ NgCompiler,
53
+ NodeJSFileSystem,
24
54
  PartialEvaluator,
25
55
  PotentialImportKind,
26
56
  PotentialImportMode,
27
57
  Reference,
58
+ ReferenceEmitKind,
59
+ ReferenceEmitter,
28
60
  StaticInterpreter,
61
+ SymbolKind,
29
62
  TypeScriptReflectionHost,
30
63
  createForwardRefResolver,
31
- reflectObjectLiteral
64
+ extractDecoratorQueryMetadata,
65
+ extractTemplate,
66
+ findAngularDecorator,
67
+ getAngularDecorators,
68
+ getFileSystem,
69
+ getRootDirs,
70
+ isLocalRelativePath,
71
+ isShim,
72
+ parseDecoratorInputTransformFunction,
73
+ queryDecoratorNames,
74
+ reflectObjectLiteral,
75
+ unwrapExpression
32
76
  };
33
77
  /**
34
78
  * @license
@@ -0,0 +1,526 @@
1
+
2
+ import {createRequire as __cjsCompatRequire} from 'module';
3
+ const require = __cjsCompatRequire(import.meta.url);
4
+
5
+ import {
6
+ ImportedSymbolsTracker,
7
+ TypeScriptReflectionHost,
8
+ getInitializerApiJitTransform
9
+ } from "../chunk-VBBJY6IR.js";
10
+ import "../chunk-LS5RJ5CS.js";
11
+ import {
12
+ InvalidFileSystem,
13
+ absoluteFrom,
14
+ basename,
15
+ dirname,
16
+ resolve,
17
+ setFileSystem
18
+ } from "../chunk-GWZQLAGK.js";
19
+ import {
20
+ NodeJSFileSystem
21
+ } from "../chunk-XYYEESKY.js";
22
+ import "../chunk-G7GFT6BU.js";
23
+
24
+ // packages/compiler-cli/src/ngtsc/file_system/testing/src/mock_file_system.js
25
+ var MockFileSystem = class {
26
+ _isCaseSensitive;
27
+ _fileTree = {};
28
+ _cwd;
29
+ constructor(_isCaseSensitive = false, cwd = "/") {
30
+ this._isCaseSensitive = _isCaseSensitive;
31
+ this._cwd = this.normalize(cwd);
32
+ }
33
+ isCaseSensitive() {
34
+ return this._isCaseSensitive;
35
+ }
36
+ exists(path) {
37
+ return this.findFromPath(path).entity !== null;
38
+ }
39
+ readFile(path) {
40
+ const { entity } = this.findFromPath(path);
41
+ if (isFile(entity)) {
42
+ if (entity instanceof Uint8Array) {
43
+ return new TextDecoder().decode(entity);
44
+ }
45
+ return entity.toString();
46
+ } else {
47
+ throw new MockFileSystemError("ENOENT", path, `File "${path}" does not exist.`);
48
+ }
49
+ }
50
+ readFileBuffer(path) {
51
+ const { entity } = this.findFromPath(path);
52
+ if (isFile(entity)) {
53
+ if (entity instanceof Uint8Array) {
54
+ return entity;
55
+ }
56
+ const encoder = new TextEncoder();
57
+ return encoder.encode(entity);
58
+ } else {
59
+ throw new MockFileSystemError("ENOENT", path, `File "${path}" does not exist.`);
60
+ }
61
+ }
62
+ writeFile(path, data, exclusive = false) {
63
+ const [folderPath, basename2] = this.splitIntoFolderAndFile(path);
64
+ const { entity } = this.findFromPath(folderPath);
65
+ if (entity === null || !isFolder(entity)) {
66
+ throw new MockFileSystemError("ENOENT", path, `Unable to write file "${path}". The containing folder does not exist.`);
67
+ }
68
+ if (exclusive && entity[basename2] !== void 0) {
69
+ throw new MockFileSystemError("EEXIST", path, `Unable to exclusively write file "${path}". The file already exists.`);
70
+ }
71
+ entity[basename2] = data;
72
+ }
73
+ removeFile(path) {
74
+ const [folderPath, basename2] = this.splitIntoFolderAndFile(path);
75
+ const { entity } = this.findFromPath(folderPath);
76
+ if (entity === null || !isFolder(entity)) {
77
+ throw new MockFileSystemError("ENOENT", path, `Unable to remove file "${path}". The containing folder does not exist.`);
78
+ }
79
+ if (isFolder(entity[basename2])) {
80
+ throw new MockFileSystemError("EISDIR", path, `Unable to remove file "${path}". The path to remove is a folder.`);
81
+ }
82
+ delete entity[basename2];
83
+ }
84
+ symlink(target, path) {
85
+ const [folderPath, basename2] = this.splitIntoFolderAndFile(path);
86
+ const { entity } = this.findFromPath(folderPath);
87
+ if (entity === null || !isFolder(entity)) {
88
+ throw new MockFileSystemError("ENOENT", path, `Unable to create symlink at "${path}". The containing folder does not exist.`);
89
+ }
90
+ entity[basename2] = new SymLink(target);
91
+ }
92
+ readdir(path) {
93
+ const { entity } = this.findFromPath(path);
94
+ if (entity === null) {
95
+ throw new MockFileSystemError("ENOENT", path, `Unable to read directory "${path}". It does not exist.`);
96
+ }
97
+ if (isFile(entity)) {
98
+ throw new MockFileSystemError("ENOTDIR", path, `Unable to read directory "${path}". It is a file.`);
99
+ }
100
+ return Object.keys(entity);
101
+ }
102
+ lstat(path) {
103
+ const { entity } = this.findFromPath(path);
104
+ if (entity === null) {
105
+ throw new MockFileSystemError("ENOENT", path, `File "${path}" does not exist.`);
106
+ }
107
+ return new MockFileStats(entity);
108
+ }
109
+ stat(path) {
110
+ const { entity } = this.findFromPath(path, { followSymLinks: true });
111
+ if (entity === null) {
112
+ throw new MockFileSystemError("ENOENT", path, `File "${path}" does not exist.`);
113
+ }
114
+ return new MockFileStats(entity);
115
+ }
116
+ copyFile(from, to) {
117
+ this.writeFile(to, this.readFile(from));
118
+ }
119
+ moveFile(from, to) {
120
+ this.writeFile(to, this.readFile(from));
121
+ const result = this.findFromPath(dirname(from));
122
+ const folder = result.entity;
123
+ const name = basename(from);
124
+ delete folder[name];
125
+ }
126
+ ensureDir(path) {
127
+ const segments = this.splitPath(path).map((segment) => this.getCanonicalPath(segment));
128
+ segments[0] = "";
129
+ if (segments.length > 1 && segments[segments.length - 1] === "") {
130
+ segments.pop();
131
+ }
132
+ let current = this._fileTree;
133
+ for (const segment of segments) {
134
+ if (isFile(current[segment])) {
135
+ throw new Error(`Folder already exists as a file.`);
136
+ }
137
+ if (!current[segment]) {
138
+ current[segment] = {};
139
+ }
140
+ current = current[segment];
141
+ }
142
+ return current;
143
+ }
144
+ removeDeep(path) {
145
+ const [folderPath, basename2] = this.splitIntoFolderAndFile(path);
146
+ const { entity } = this.findFromPath(folderPath);
147
+ if (entity === null || !isFolder(entity)) {
148
+ throw new MockFileSystemError("ENOENT", path, `Unable to remove folder "${path}". The containing folder does not exist.`);
149
+ }
150
+ delete entity[basename2];
151
+ }
152
+ isRoot(path) {
153
+ return this.dirname(path) === path;
154
+ }
155
+ extname(path) {
156
+ const match = /.+(\.[^.]*)$/.exec(path);
157
+ return match !== null ? match[1] : "";
158
+ }
159
+ realpath(filePath) {
160
+ const result = this.findFromPath(filePath, { followSymLinks: true });
161
+ if (result.entity === null) {
162
+ throw new MockFileSystemError("ENOENT", filePath, `Unable to find the real path of "${filePath}". It does not exist.`);
163
+ } else {
164
+ return result.path;
165
+ }
166
+ }
167
+ pwd() {
168
+ return this._cwd;
169
+ }
170
+ chdir(path) {
171
+ this._cwd = this.normalize(path);
172
+ }
173
+ getDefaultLibLocation() {
174
+ let path = "node_modules/typescript/lib";
175
+ let resolvedPath = this.resolve(path);
176
+ const topLevelNodeModules = this.resolve("/" + path);
177
+ while (resolvedPath !== topLevelNodeModules) {
178
+ if (this.exists(resolvedPath)) {
179
+ return resolvedPath;
180
+ }
181
+ path = "../" + path;
182
+ resolvedPath = this.resolve(path);
183
+ }
184
+ return topLevelNodeModules;
185
+ }
186
+ dump() {
187
+ const { entity } = this.findFromPath(this.resolve("/"));
188
+ if (entity === null || !isFolder(entity)) {
189
+ return {};
190
+ }
191
+ return this.cloneFolder(entity);
192
+ }
193
+ init(folder) {
194
+ this.mount(this.resolve("/"), folder);
195
+ }
196
+ mount(path, folder) {
197
+ if (this.exists(path)) {
198
+ throw new Error(`Unable to mount in '${path}' as it already exists.`);
199
+ }
200
+ const mountFolder = this.ensureDir(path);
201
+ this.copyInto(folder, mountFolder);
202
+ }
203
+ cloneFolder(folder) {
204
+ const clone = {};
205
+ this.copyInto(folder, clone);
206
+ return clone;
207
+ }
208
+ copyInto(from, to) {
209
+ for (const path in from) {
210
+ const item = from[path];
211
+ const canonicalPath = this.getCanonicalPath(path);
212
+ if (isSymLink(item)) {
213
+ to[canonicalPath] = new SymLink(this.getCanonicalPath(item.path));
214
+ } else if (isFolder(item)) {
215
+ to[canonicalPath] = this.cloneFolder(item);
216
+ } else {
217
+ to[canonicalPath] = from[path];
218
+ }
219
+ }
220
+ }
221
+ findFromPath(path, options) {
222
+ const followSymLinks = !!options && options.followSymLinks;
223
+ const segments = this.splitPath(path);
224
+ if (segments.length > 1 && segments[segments.length - 1] === "") {
225
+ segments.pop();
226
+ }
227
+ segments[0] = "";
228
+ let current = this._fileTree;
229
+ while (segments.length) {
230
+ current = current[this.getCanonicalPath(segments.shift())];
231
+ if (current === void 0) {
232
+ return { path, entity: null };
233
+ }
234
+ if (segments.length > 0) {
235
+ if (isFile(current)) {
236
+ current = null;
237
+ break;
238
+ }
239
+ if (isSymLink(current)) {
240
+ return this.findFromPath(resolve(current.path, ...segments), { followSymLinks });
241
+ }
242
+ }
243
+ if (isFile(current)) {
244
+ break;
245
+ }
246
+ if (isSymLink(current)) {
247
+ if (followSymLinks) {
248
+ return this.findFromPath(resolve(current.path, ...segments), { followSymLinks });
249
+ } else {
250
+ break;
251
+ }
252
+ }
253
+ }
254
+ return { path, entity: current };
255
+ }
256
+ splitIntoFolderAndFile(path) {
257
+ const segments = this.splitPath(this.getCanonicalPath(path));
258
+ const file = segments.pop();
259
+ return [path.substring(0, path.length - file.length - 1), file];
260
+ }
261
+ getCanonicalPath(p3) {
262
+ return this.isCaseSensitive() ? p3 : p3.toLowerCase();
263
+ }
264
+ };
265
+ var SymLink = class {
266
+ path;
267
+ constructor(path) {
268
+ this.path = path;
269
+ }
270
+ };
271
+ var MockFileStats = class {
272
+ entity;
273
+ constructor(entity) {
274
+ this.entity = entity;
275
+ }
276
+ isFile() {
277
+ return isFile(this.entity);
278
+ }
279
+ isDirectory() {
280
+ return isFolder(this.entity);
281
+ }
282
+ isSymbolicLink() {
283
+ return isSymLink(this.entity);
284
+ }
285
+ };
286
+ var MockFileSystemError = class extends Error {
287
+ code;
288
+ path;
289
+ constructor(code, path, message) {
290
+ super(message);
291
+ this.code = code;
292
+ this.path = path;
293
+ }
294
+ };
295
+ function isFile(item) {
296
+ return item instanceof Uint8Array || typeof item === "string";
297
+ }
298
+ function isSymLink(item) {
299
+ return item instanceof SymLink;
300
+ }
301
+ function isFolder(item) {
302
+ return item !== null && !isFile(item) && !isSymLink(item);
303
+ }
304
+
305
+ // packages/compiler-cli/src/ngtsc/file_system/testing/src/mock_file_system_native.js
306
+ import * as os from "os";
307
+ var isWindows = os.platform?.() === "win32";
308
+ var MockFileSystemNative = class extends MockFileSystem {
309
+ constructor(cwd = "/") {
310
+ super(void 0, cwd);
311
+ }
312
+ // Delegate to the real NodeJSFileSystem for these path related methods
313
+ resolve(...paths) {
314
+ return NodeJSFileSystem.prototype.resolve.call(this, this.pwd(), ...paths);
315
+ }
316
+ dirname(file) {
317
+ return NodeJSFileSystem.prototype.dirname.call(this, file);
318
+ }
319
+ join(basePath, ...paths) {
320
+ return NodeJSFileSystem.prototype.join.call(this, basePath, ...paths);
321
+ }
322
+ relative(from, to) {
323
+ return NodeJSFileSystem.prototype.relative.call(this, from, to);
324
+ }
325
+ basename(filePath, extension) {
326
+ return NodeJSFileSystem.prototype.basename.call(this, filePath, extension);
327
+ }
328
+ isCaseSensitive() {
329
+ return NodeJSFileSystem.prototype.isCaseSensitive.call(this);
330
+ }
331
+ isRooted(path) {
332
+ return NodeJSFileSystem.prototype.isRooted.call(this, path);
333
+ }
334
+ isRoot(path) {
335
+ return NodeJSFileSystem.prototype.isRoot.call(this, path);
336
+ }
337
+ normalize(path) {
338
+ if (isWindows) {
339
+ path = path.replace(/^[\/\\]/i, "C:/");
340
+ }
341
+ return NodeJSFileSystem.prototype.normalize.call(this, path);
342
+ }
343
+ splitPath(path) {
344
+ return path.split(/[\\\/]/);
345
+ }
346
+ };
347
+
348
+ // packages/compiler-cli/src/ngtsc/file_system/testing/src/mock_file_system_posix.js
349
+ import * as p from "path";
350
+ var MockFileSystemPosix = class extends MockFileSystem {
351
+ resolve(...paths) {
352
+ const resolved = p.posix.resolve(this.pwd(), ...paths);
353
+ return this.normalize(resolved);
354
+ }
355
+ dirname(file) {
356
+ return this.normalize(p.posix.dirname(file));
357
+ }
358
+ join(basePath, ...paths) {
359
+ return this.normalize(p.posix.join(basePath, ...paths));
360
+ }
361
+ relative(from, to) {
362
+ return this.normalize(p.posix.relative(from, to));
363
+ }
364
+ basename(filePath, extension) {
365
+ return p.posix.basename(filePath, extension);
366
+ }
367
+ isRooted(path) {
368
+ return path.startsWith("/");
369
+ }
370
+ splitPath(path) {
371
+ return path.split("/");
372
+ }
373
+ normalize(path) {
374
+ return path.replace(/^[a-z]:\//i, "/").replace(/\\/g, "/");
375
+ }
376
+ };
377
+
378
+ // packages/compiler-cli/src/ngtsc/file_system/testing/src/mock_file_system_windows.js
379
+ import * as p2 from "path";
380
+ var MockFileSystemWindows = class extends MockFileSystem {
381
+ resolve(...paths) {
382
+ const resolved = p2.win32.resolve(this.pwd(), ...paths);
383
+ return this.normalize(resolved);
384
+ }
385
+ dirname(path) {
386
+ return this.normalize(p2.win32.dirname(path));
387
+ }
388
+ join(basePath, ...paths) {
389
+ return this.normalize(p2.win32.join(basePath, ...paths));
390
+ }
391
+ relative(from, to) {
392
+ return this.normalize(p2.win32.relative(from, to));
393
+ }
394
+ basename(filePath, extension) {
395
+ return p2.win32.basename(filePath, extension);
396
+ }
397
+ isRooted(path) {
398
+ return /^([A-Z]:)?([\\\/]|$)/i.test(path);
399
+ }
400
+ splitPath(path) {
401
+ return path.split(/[\\\/]/);
402
+ }
403
+ normalize(path) {
404
+ return path.replace(/^[\/\\]/i, "C:/").replace(/\\/g, "/");
405
+ }
406
+ };
407
+
408
+ // packages/compiler-cli/src/ngtsc/file_system/testing/src/test_helper.js
409
+ import ts from "typescript";
410
+ var FS_NATIVE = "Native";
411
+ var FS_OS_X = "OS/X";
412
+ var FS_UNIX = "Unix";
413
+ var FS_WINDOWS = "Windows";
414
+ var FS_ALL = [FS_OS_X, FS_WINDOWS, FS_UNIX, FS_NATIVE];
415
+ function runInEachFileSystemFn(callback) {
416
+ FS_ALL.forEach((os2) => runInFileSystem(os2, callback, false));
417
+ }
418
+ function runInFileSystem(os2, callback, error) {
419
+ describe(`<<FileSystem: ${os2}>>`, () => {
420
+ beforeEach(() => initMockFileSystem(os2));
421
+ afterEach(() => setFileSystem(new InvalidFileSystem()));
422
+ callback(os2);
423
+ if (error) {
424
+ afterAll(() => {
425
+ throw new Error(`runInFileSystem limited to ${os2}, cannot pass`);
426
+ });
427
+ }
428
+ });
429
+ }
430
+ var runInEachFileSystem = runInEachFileSystemFn;
431
+ runInEachFileSystem.native = (callback) => runInFileSystem(FS_NATIVE, callback, true);
432
+ runInEachFileSystem.osX = (callback) => runInFileSystem(FS_OS_X, callback, true);
433
+ runInEachFileSystem.unix = (callback) => runInFileSystem(FS_UNIX, callback, true);
434
+ runInEachFileSystem.windows = (callback) => runInFileSystem(FS_WINDOWS, callback, true);
435
+ function initMockFileSystem(os2, cwd) {
436
+ const fs = createMockFileSystem(os2, cwd);
437
+ setFileSystem(fs);
438
+ monkeyPatchTypeScript(fs);
439
+ return fs;
440
+ }
441
+ function createMockFileSystem(os2, cwd) {
442
+ switch (os2) {
443
+ case "OS/X":
444
+ return new MockFileSystemPosix(
445
+ /* isCaseSensitive */
446
+ false,
447
+ cwd
448
+ );
449
+ case "Unix":
450
+ return new MockFileSystemPosix(
451
+ /* isCaseSensitive */
452
+ true,
453
+ cwd
454
+ );
455
+ case "Windows":
456
+ return new MockFileSystemWindows(
457
+ /* isCaseSensitive*/
458
+ false,
459
+ cwd
460
+ );
461
+ case "Native":
462
+ return new MockFileSystemNative(cwd);
463
+ default:
464
+ throw new Error("FileSystem not supported");
465
+ }
466
+ }
467
+ function monkeyPatchTypeScript(fs) {
468
+ ts.sys.fileExists = (path) => {
469
+ const absPath = fs.resolve(path);
470
+ return fs.exists(absPath) && fs.stat(absPath).isFile();
471
+ };
472
+ ts.sys.getCurrentDirectory = () => fs.pwd();
473
+ ts.sys.getDirectories = getDirectories;
474
+ ts.sys.readFile = fs.readFile.bind(fs);
475
+ ts.sys.resolvePath = fs.resolve.bind(fs);
476
+ ts.sys.writeFile = fs.writeFile.bind(fs);
477
+ ts.sys.directoryExists = directoryExists;
478
+ ts.sys.readDirectory = readDirectory;
479
+ function getDirectories(path) {
480
+ return fs.readdir(absoluteFrom(path)).filter((p3) => fs.stat(fs.resolve(path, p3)).isDirectory());
481
+ }
482
+ function getFileSystemEntries(path) {
483
+ const files = [];
484
+ const directories = [];
485
+ const absPath = fs.resolve(path);
486
+ const entries = fs.readdir(absPath);
487
+ for (const entry of entries) {
488
+ if (entry == "." || entry === "..") {
489
+ continue;
490
+ }
491
+ const absPath2 = fs.resolve(path, entry);
492
+ const stat = fs.stat(absPath2);
493
+ if (stat.isDirectory()) {
494
+ directories.push(absPath2);
495
+ } else if (stat.isFile()) {
496
+ files.push(absPath2);
497
+ }
498
+ }
499
+ return { files, directories };
500
+ }
501
+ function realPath(path) {
502
+ return fs.realpath(fs.resolve(path));
503
+ }
504
+ function directoryExists(path) {
505
+ const absPath = fs.resolve(path);
506
+ return fs.exists(absPath) && fs.stat(absPath).isDirectory();
507
+ }
508
+ const tsMatchFiles = ts.matchFiles;
509
+ function readDirectory(path, extensions, excludes, includes, depth) {
510
+ return tsMatchFiles(path, extensions, excludes, includes, fs.isCaseSensitive(), fs.pwd(), depth, getFileSystemEntries, realPath, directoryExists);
511
+ }
512
+ }
513
+ export {
514
+ ImportedSymbolsTracker,
515
+ MockFileSystem,
516
+ TypeScriptReflectionHost,
517
+ getInitializerApiJitTransform,
518
+ initMockFileSystem
519
+ };
520
+ /**
521
+ * @license
522
+ * Copyright Google LLC All Rights Reserved.
523
+ *
524
+ * Use of this source code is governed by an MIT-style license that can be
525
+ * found in the LICENSE file at https://angular.dev/license
526
+ */
@@ -4,8 +4,7 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "../chunk-HRLHX4UA.js";
8
- import "../chunk-3UF7UI6H.js";
7
+ } from "../chunk-VBBJY6IR.js";
9
8
  import "../chunk-LS5RJ5CS.js";
10
9
  import "../chunk-GWZQLAGK.js";
11
10
  import "../chunk-XYYEESKY.js";