@angular/compiler-cli 20.2.0-next.0 → 20.2.0-next.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/bundles/{chunk-5TMRGUHP.js → chunk-56QTHZ7G.js} +27 -11
- package/bundles/{chunk-UZOSFHTN.js → chunk-5LTXARS2.js} +2328 -750
- package/bundles/{chunk-SEKYV57I.js → chunk-6HOSNZU5.js} +2 -3
- package/bundles/{chunk-FPHHL4UV.js → chunk-BPDNYZBC.js} +253 -49
- package/bundles/chunk-DWRM7PIK.js +14 -0
- package/bundles/{chunk-TPEB2IXF.js → chunk-GWZQLAGK.js} +35 -7
- package/bundles/{chunk-PML5JK7B.js → chunk-HYJ2H3FU.js} +120 -7
- package/bundles/{chunk-6ECVYRSU.js → chunk-I2BHWRAU.js} +11 -6
- package/bundles/{chunk-YNE6T2TY.js → chunk-MQ6W6B7H.js} +613 -110
- package/bundles/{chunk-5JF7HF3W.js → chunk-SZY7NM6F.js} +2 -3
- package/bundles/{chunk-JXYBFWGA.js → chunk-UVWZGTBX.js} +19 -7
- package/bundles/index.js +34 -19
- package/bundles/linker/babel/index.js +70 -18
- package/bundles/linker/index.js +11 -5
- package/bundles/private/localize.js +5 -6
- package/bundles/private/migrations.js +5 -6
- package/bundles/private/tooling.js +27 -11
- package/bundles/src/bin/ng_xi18n.js +11 -12
- package/bundles/src/bin/ngc.js +9 -10
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +3 -3
- package/src/ngtsc/annotations/component/src/animations.d.ts +15 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +14 -0
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +2 -1
- package/src/ngtsc/perf/src/api.d.ts +24 -16
- package/src/ngtsc/typecheck/api/api.d.ts +1 -1
- package/src/ngtsc/typecheck/api/checker.d.ts +15 -0
- package/src/ngtsc/typecheck/diagnostics/src/diagnostic.d.ts +7 -1
- package/src/ngtsc/typecheck/extended/checks/uninvoked_function_in_text_interpolation/index.d.ts +10 -0
- package/src/ngtsc/typecheck/src/checker.d.ts +2 -0
- package/src/ngtsc/typecheck/src/dom.d.ts +2 -1
- package/src/ngtsc/typecheck/src/ts_util.d.ts +7 -0
- package/bundles/chunk-2FHBFXPC.js +0 -34
- package/bundles/chunk-2FHBFXPC.js.map +0 -6
- package/bundles/chunk-5JF7HF3W.js.map +0 -6
- package/bundles/chunk-5TMRGUHP.js.map +0 -6
- package/bundles/chunk-6ECVYRSU.js.map +0 -6
- package/bundles/chunk-FPHHL4UV.js.map +0 -6
- package/bundles/chunk-JXYBFWGA.js.map +0 -6
- package/bundles/chunk-KPQ72R34.js +0 -23
- package/bundles/chunk-KPQ72R34.js.map +0 -6
- package/bundles/chunk-PML5JK7B.js.map +0 -6
- package/bundles/chunk-SEKYV57I.js.map +0 -6
- package/bundles/chunk-TPEB2IXF.js.map +0 -6
- package/bundles/chunk-UZOSFHTN.js.map +0 -6
- package/bundles/chunk-YNE6T2TY.js.map +0 -6
- package/bundles/index.js.map +0 -6
- package/bundles/linker/babel/index.js.map +0 -6
- package/bundles/linker/index.js.map +0 -6
- package/bundles/private/localize.js.map +0 -6
- package/bundles/private/migrations.js.map +0 -6
- package/bundles/private/tooling.js.map +0 -6
- package/bundles/src/bin/ng_xi18n.js.map +0 -6
- package/bundles/src/bin/ngc.js.map +0 -6
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
import {createRequire as __cjsCompatRequire} from 'module';
|
|
3
|
+
const require = __cjsCompatRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
6
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
7
|
+
}) : x)(function(x) {
|
|
8
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
9
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
__require
|
|
14
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const require = __cjsCompatRequire(import.meta.url);
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.js
|
|
7
7
|
var InvalidFileSystem = class {
|
|
8
8
|
exists(path) {
|
|
9
9
|
throw makeError();
|
|
@@ -91,7 +91,7 @@ function makeError() {
|
|
|
91
91
|
return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
//
|
|
94
|
+
// packages/compiler-cli/src/ngtsc/file_system/src/util.js
|
|
95
95
|
var TS_DTS_JS_EXTENSION = /(?:\.d)?\.ts$|\.js$/;
|
|
96
96
|
function normalizeSeparators(path) {
|
|
97
97
|
return path.replace(/\\/g, "/");
|
|
@@ -107,7 +107,7 @@ function getSourceFileOrError(program, fileName) {
|
|
|
107
107
|
return sf;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// packages/compiler-cli/src/ngtsc/file_system/src/helpers.js
|
|
111
111
|
var fs = new InvalidFileSystem();
|
|
112
112
|
function getFileSystem() {
|
|
113
113
|
return fs;
|
|
@@ -164,7 +164,7 @@ function toRelativeImport(relativePath) {
|
|
|
164
164
|
return isLocalRelativePath(relativePath) ? `./${relativePath}` : relativePath;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
//
|
|
167
|
+
// packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.js
|
|
168
168
|
import * as os from "os";
|
|
169
169
|
import ts from "typescript";
|
|
170
170
|
var NgtscCompilerHost = class {
|
|
@@ -224,8 +224,14 @@ var NgtscCompilerHost = class {
|
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
|
|
227
|
-
//
|
|
227
|
+
// packages/compiler-cli/src/ngtsc/file_system/src/logical.js
|
|
228
228
|
var LogicalProjectPath = {
|
|
229
|
+
/**
|
|
230
|
+
* Get the relative path between two `LogicalProjectPath`s.
|
|
231
|
+
*
|
|
232
|
+
* This will return a `PathSegment` which would be a valid module specifier to use in `from` when
|
|
233
|
+
* importing from `to`.
|
|
234
|
+
*/
|
|
229
235
|
relativePathBetween: function(from, to) {
|
|
230
236
|
const relativePath = relative(dirname(resolve(from)), resolve(to));
|
|
231
237
|
return toRelativeImport(relativePath);
|
|
@@ -233,17 +239,40 @@ var LogicalProjectPath = {
|
|
|
233
239
|
};
|
|
234
240
|
var LogicalFileSystem = class {
|
|
235
241
|
compilerHost;
|
|
242
|
+
/**
|
|
243
|
+
* The root directories of the project, sorted with the longest path first.
|
|
244
|
+
*/
|
|
236
245
|
rootDirs;
|
|
246
|
+
/**
|
|
247
|
+
* The same root directories as `rootDirs` but with each one converted to its
|
|
248
|
+
* canonical form for matching in case-insensitive file-systems.
|
|
249
|
+
*/
|
|
237
250
|
canonicalRootDirs;
|
|
251
|
+
/**
|
|
252
|
+
* A cache of file paths to project paths, because computation of these paths is slightly
|
|
253
|
+
* expensive.
|
|
254
|
+
*/
|
|
238
255
|
cache = /* @__PURE__ */ new Map();
|
|
239
256
|
constructor(rootDirs, compilerHost) {
|
|
240
257
|
this.compilerHost = compilerHost;
|
|
241
258
|
this.rootDirs = rootDirs.concat([]).sort((a, b) => b.length - a.length);
|
|
242
259
|
this.canonicalRootDirs = this.rootDirs.map((dir) => this.compilerHost.getCanonicalFileName(dir));
|
|
243
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Get the logical path in the project of a `ts.SourceFile`.
|
|
263
|
+
*
|
|
264
|
+
* This method is provided as a convenient alternative to calling
|
|
265
|
+
* `logicalPathOfFile(absoluteFromSourceFile(sf))`.
|
|
266
|
+
*/
|
|
244
267
|
logicalPathOfSf(sf) {
|
|
245
268
|
return this.logicalPathOfFile(absoluteFromSourceFile(sf));
|
|
246
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Get the logical path in the project of a source file.
|
|
272
|
+
*
|
|
273
|
+
* @returns A `LogicalProjectPath` to the source file, or `null` if the source file is not in any
|
|
274
|
+
* of the TS project's root directories.
|
|
275
|
+
*/
|
|
247
276
|
logicalPathOfFile(physicalFile) {
|
|
248
277
|
if (!this.cache.has(physicalFile)) {
|
|
249
278
|
const canonicalFilePath = this.compilerHost.getCanonicalFileName(physicalFile);
|
|
@@ -273,7 +302,7 @@ function isWithinBasePath(base, path) {
|
|
|
273
302
|
return isLocalRelativePath(relative(base, path));
|
|
274
303
|
}
|
|
275
304
|
|
|
276
|
-
//
|
|
305
|
+
// packages/compiler-cli/src/ngtsc/file_system/src/ts_read_directory.js
|
|
277
306
|
import ts2 from "typescript";
|
|
278
307
|
function createFileSystemTsReadDirectoryFn(fs2) {
|
|
279
308
|
if (ts2.matchFiles === void 0) {
|
|
@@ -335,4 +364,3 @@ export {
|
|
|
335
364
|
* Use of this source code is governed by an MIT-style license that can be
|
|
336
365
|
* found in the LICENSE file at https://angular.dev/license
|
|
337
366
|
*/
|
|
338
|
-
//# sourceMappingURL=chunk-TPEB2IXF.js.map
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
const require = __cjsCompatRequire(import.meta.url);
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.js
|
|
7
7
|
import { decode, encode } from "@jridgewell/sourcemap-codec";
|
|
8
8
|
import mapHelpers from "convert-source-map";
|
|
9
9
|
|
|
10
|
-
//
|
|
10
|
+
// packages/compiler-cli/src/ngtsc/sourcemaps/src/segment_marker.js
|
|
11
11
|
function compareSegments(a, b) {
|
|
12
12
|
return a.position - b.position;
|
|
13
13
|
}
|
|
@@ -27,7 +27,7 @@ function offsetSegment(startOfLinePositions, marker, offset) {
|
|
|
27
27
|
return { line, column, position, next: void 0 };
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.js
|
|
31
31
|
function removeSourceMapComments(contents) {
|
|
32
32
|
return mapHelpers.removeMapFileComments(mapHelpers.removeComments(contents)).replace(/\n\n$/, "\n");
|
|
33
33
|
}
|
|
@@ -37,6 +37,13 @@ var SourceFile = class {
|
|
|
37
37
|
rawMap;
|
|
38
38
|
sources;
|
|
39
39
|
fs;
|
|
40
|
+
/**
|
|
41
|
+
* The parsed mappings that have been flattened so that any intermediate source mappings have been
|
|
42
|
+
* flattened.
|
|
43
|
+
*
|
|
44
|
+
* The result is that any source file mentioned in the flattened mappings have no source map (are
|
|
45
|
+
* pure original source files).
|
|
46
|
+
*/
|
|
40
47
|
flattenedMappings;
|
|
41
48
|
startOfLinePositions;
|
|
42
49
|
constructor(sourcePath, contents, rawMap, sources, fs) {
|
|
@@ -49,6 +56,9 @@ var SourceFile = class {
|
|
|
49
56
|
this.startOfLinePositions = computeStartOfLinePositions(this.contents);
|
|
50
57
|
this.flattenedMappings = this.flattenMappings();
|
|
51
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Render the raw source map generated from the flattened mappings.
|
|
61
|
+
*/
|
|
52
62
|
renderFlattenedSourceMap() {
|
|
53
63
|
const sources = new IndexedMap();
|
|
54
64
|
const names = new IndexedSet();
|
|
@@ -83,6 +93,14 @@ var SourceFile = class {
|
|
|
83
93
|
};
|
|
84
94
|
return sourceMap;
|
|
85
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Find the original mapped location for the given `line` and `column` in the generated file.
|
|
98
|
+
*
|
|
99
|
+
* First we search for a mapping whose generated segment is at or directly before the given
|
|
100
|
+
* location. Then we compute the offset between the given location and the matching generated
|
|
101
|
+
* segment. Finally we apply this offset to the original source segment to get the desired
|
|
102
|
+
* original location.
|
|
103
|
+
*/
|
|
86
104
|
getOriginalLocation(line, column) {
|
|
87
105
|
if (this.flattenedMappings.length === 0) {
|
|
88
106
|
return null;
|
|
@@ -107,6 +125,10 @@ var SourceFile = class {
|
|
|
107
125
|
column: offsetOriginalSegment.column
|
|
108
126
|
};
|
|
109
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Flatten the parsed mappings for this source file, so that all the mappings are to pure original
|
|
130
|
+
* source files with no transitive source maps.
|
|
131
|
+
*/
|
|
110
132
|
flattenMappings() {
|
|
111
133
|
const mappings = parseMappings(this.rawMap && this.rawMap.map, this.sources, this.startOfLinePositions);
|
|
112
134
|
ensureOriginalSegmentLinks(mappings);
|
|
@@ -244,8 +266,30 @@ function computeLineLengths(str) {
|
|
|
244
266
|
}
|
|
245
267
|
var IndexedMap = class {
|
|
246
268
|
map = /* @__PURE__ */ new Map();
|
|
269
|
+
/**
|
|
270
|
+
* An array of keys added to this map.
|
|
271
|
+
*
|
|
272
|
+
* This array is guaranteed to be in the order of the first time the key was added to the map.
|
|
273
|
+
*/
|
|
247
274
|
keys = [];
|
|
275
|
+
/**
|
|
276
|
+
* An array of values added to this map.
|
|
277
|
+
*
|
|
278
|
+
* This array is guaranteed to be in the order of the first time the associated key was added to
|
|
279
|
+
* the map.
|
|
280
|
+
*/
|
|
248
281
|
values = [];
|
|
282
|
+
/**
|
|
283
|
+
* Associate the `value` with the `key` and return the index of the key in the collection.
|
|
284
|
+
*
|
|
285
|
+
* If the `key` already exists then the `value` is not set and the index of that `key` is
|
|
286
|
+
* returned; otherwise the `key` and `value` are stored and the index of the new `key` is
|
|
287
|
+
* returned.
|
|
288
|
+
*
|
|
289
|
+
* @param key the key to associated with the `value`.
|
|
290
|
+
* @param value the value to associated with the `key`.
|
|
291
|
+
* @returns the index of the `key` in the `keys` array.
|
|
292
|
+
*/
|
|
249
293
|
set(key, value) {
|
|
250
294
|
if (this.map.has(key)) {
|
|
251
295
|
return this.map.get(key);
|
|
@@ -258,7 +302,21 @@ var IndexedMap = class {
|
|
|
258
302
|
};
|
|
259
303
|
var IndexedSet = class {
|
|
260
304
|
map = /* @__PURE__ */ new Map();
|
|
305
|
+
/**
|
|
306
|
+
* An array of values added to this set.
|
|
307
|
+
* This array is guaranteed to be in the order of the first time the value was added to the set.
|
|
308
|
+
*/
|
|
261
309
|
values = [];
|
|
310
|
+
/**
|
|
311
|
+
* Add the `value` to the `values` array, if it doesn't already exist; returning the index of the
|
|
312
|
+
* `value` in the `values` array.
|
|
313
|
+
*
|
|
314
|
+
* If the `value` already exists then the index of that `value` is returned, otherwise the new
|
|
315
|
+
* `value` is stored and the new index returned.
|
|
316
|
+
*
|
|
317
|
+
* @param value the value to add to the set.
|
|
318
|
+
* @returns the index of the `value` in the `values` array.
|
|
319
|
+
*/
|
|
262
320
|
add(value) {
|
|
263
321
|
if (this.map.has(value)) {
|
|
264
322
|
return this.map.get(value);
|
|
@@ -282,10 +340,10 @@ var Cache = class {
|
|
|
282
340
|
}
|
|
283
341
|
};
|
|
284
342
|
|
|
285
|
-
//
|
|
343
|
+
// packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.js
|
|
286
344
|
import mapHelpers2 from "convert-source-map";
|
|
287
345
|
|
|
288
|
-
//
|
|
346
|
+
// packages/compiler-cli/src/ngtsc/sourcemaps/src/content_origin.js
|
|
289
347
|
var ContentOrigin;
|
|
290
348
|
(function(ContentOrigin2) {
|
|
291
349
|
ContentOrigin2[ContentOrigin2["Provided"] = 0] = "Provided";
|
|
@@ -293,7 +351,7 @@ var ContentOrigin;
|
|
|
293
351
|
ContentOrigin2[ContentOrigin2["FileSystem"] = 2] = "FileSystem";
|
|
294
352
|
})(ContentOrigin || (ContentOrigin = {}));
|
|
295
353
|
|
|
296
|
-
//
|
|
354
|
+
// packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.js
|
|
297
355
|
var SCHEME_MATCHER = /^([a-z][a-z0-9.-]*):\/\//i;
|
|
298
356
|
var SourceFileLoader = class {
|
|
299
357
|
fs;
|
|
@@ -313,6 +371,22 @@ var SourceFileLoader = class {
|
|
|
313
371
|
};
|
|
314
372
|
return this.loadSourceFileInternal(sourcePath, contents, contentsOrigin, sourceMapInfo);
|
|
315
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* The overload used internally to load source files referenced in a source-map.
|
|
376
|
+
*
|
|
377
|
+
* In this case there is no guarantee that it will return a non-null SourceMap.
|
|
378
|
+
*
|
|
379
|
+
* @param sourcePath The path to the source file to load.
|
|
380
|
+
* @param contents The contents of the source file to load, if provided inline. If `null`,
|
|
381
|
+
* the contents will be read from the file at the `sourcePath`.
|
|
382
|
+
* @param sourceOrigin Describes where the source content came from.
|
|
383
|
+
* @param sourceMapInfo The raw contents and path of the source-map file. If `null` the
|
|
384
|
+
* source-map will be computed from the contents of the source file, either inline or loaded
|
|
385
|
+
* from the file-system.
|
|
386
|
+
*
|
|
387
|
+
* @returns a SourceFile if the content for one was provided or was able to be loaded from disk,
|
|
388
|
+
* `null` otherwise.
|
|
389
|
+
*/
|
|
316
390
|
loadSourceFileInternal(sourcePath, contents, sourceOrigin, sourceMapInfo) {
|
|
317
391
|
const previousPaths = this.currentPaths.slice();
|
|
318
392
|
try {
|
|
@@ -338,6 +412,19 @@ var SourceFileLoader = class {
|
|
|
338
412
|
this.currentPaths = previousPaths;
|
|
339
413
|
}
|
|
340
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* Find the source map associated with the source file whose `sourcePath` and `contents` are
|
|
417
|
+
* provided.
|
|
418
|
+
*
|
|
419
|
+
* Source maps can be inline, as part of a base64 encoded comment, or external as a separate file
|
|
420
|
+
* whose path is indicated in a comment or implied from the name of the source file itself.
|
|
421
|
+
*
|
|
422
|
+
* @param sourcePath the path to the source file.
|
|
423
|
+
* @param sourceContents the contents of the source file.
|
|
424
|
+
* @param sourceOrigin where the content of the source file came from.
|
|
425
|
+
* @returns the parsed contents and path of the source-map, if loading was successful, null
|
|
426
|
+
* otherwise.
|
|
427
|
+
*/
|
|
341
428
|
loadSourceMap(sourcePath, sourceContents, sourceOrigin) {
|
|
342
429
|
const lastLine = this.getLastNonEmptyLine(sourceContents);
|
|
343
430
|
const inline = mapHelpers2.commentRegex.exec(lastLine);
|
|
@@ -376,6 +463,10 @@ var SourceFileLoader = class {
|
|
|
376
463
|
}
|
|
377
464
|
return null;
|
|
378
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* Iterate over each of the "sources" for this source file's source map, recursively loading each
|
|
468
|
+
* source file and its associated source map.
|
|
469
|
+
*/
|
|
379
470
|
processSources(basePath, { map, origin: sourceMapOrigin }) {
|
|
380
471
|
const sourceRoot = this.fs.resolve(this.fs.dirname(basePath), this.replaceSchemeWithPath(map.sourceRoot || ""));
|
|
381
472
|
return map.sources.map((source, index) => {
|
|
@@ -385,14 +476,29 @@ var SourceFileLoader = class {
|
|
|
385
476
|
return this.loadSourceFileInternal(path, content, sourceOrigin, null);
|
|
386
477
|
});
|
|
387
478
|
}
|
|
479
|
+
/**
|
|
480
|
+
* Load the contents of the source file from disk.
|
|
481
|
+
*
|
|
482
|
+
* @param sourcePath The path to the source file.
|
|
483
|
+
*/
|
|
388
484
|
readSourceFile(sourcePath) {
|
|
389
485
|
this.trackPath(sourcePath);
|
|
390
486
|
return this.fs.readFile(sourcePath);
|
|
391
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* Load the source map from the file at `mapPath`, parsing its JSON contents into a `RawSourceMap`
|
|
490
|
+
* object.
|
|
491
|
+
*
|
|
492
|
+
* @param mapPath The path to the source-map file.
|
|
493
|
+
*/
|
|
392
494
|
readRawSourceMap(mapPath) {
|
|
393
495
|
this.trackPath(mapPath);
|
|
394
496
|
return JSON.parse(this.fs.readFile(mapPath));
|
|
395
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* Track source file paths if we have loaded them from disk so that we don't get into an infinite
|
|
500
|
+
* recursion.
|
|
501
|
+
*/
|
|
396
502
|
trackPath(path) {
|
|
397
503
|
if (this.currentPaths.includes(path)) {
|
|
398
504
|
throw new Error(`Circular source file mapping dependency: ${this.currentPaths.join(" -> ")} -> ${path}`);
|
|
@@ -410,6 +516,14 @@ var SourceFileLoader = class {
|
|
|
410
516
|
}
|
|
411
517
|
return contents.slice(lastRealLineIndex + 1);
|
|
412
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* Replace any matched URL schemes with their corresponding path held in the schemeMap.
|
|
521
|
+
*
|
|
522
|
+
* Some build tools replace real file paths with scheme prefixed paths - e.g. `webpack://`.
|
|
523
|
+
* We use the `schemeMap` passed to this class to convert such paths to "real" file paths.
|
|
524
|
+
* In some cases, this is not possible, since the file was actually synthesized by the build tool.
|
|
525
|
+
* But the end result is better than prefixing the sourceRoot in front of the scheme.
|
|
526
|
+
*/
|
|
413
527
|
replaceSchemeWithPath(path) {
|
|
414
528
|
return path.replace(SCHEME_MATCHER, (_, scheme) => this.schemeMap[scheme.toLowerCase()] || "");
|
|
415
529
|
}
|
|
@@ -426,4 +540,3 @@ export {
|
|
|
426
540
|
* Use of this source code is governed by an MIT-style license that can be
|
|
427
541
|
* found in the LICENSE file at https://angular.dev/license
|
|
428
542
|
*/
|
|
429
|
-
//# sourceMappingURL=chunk-PML5JK7B.js.map
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
const require = __cjsCompatRequire(import.meta.url);
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
var Context = class {
|
|
6
|
+
// packages/compiler-cli/src/ngtsc/translator/src/context.js
|
|
7
|
+
var Context = class _Context {
|
|
8
8
|
isStatement;
|
|
9
9
|
constructor(isStatement) {
|
|
10
10
|
this.isStatement = isStatement;
|
|
11
11
|
}
|
|
12
12
|
get withExpressionMode() {
|
|
13
|
-
return this.isStatement ? new
|
|
13
|
+
return this.isStatement ? new _Context(false) : this;
|
|
14
14
|
}
|
|
15
15
|
get withStatementMode() {
|
|
16
|
-
return !this.isStatement ? new
|
|
16
|
+
return !this.isStatement ? new _Context(true) : this;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// packages/compiler-cli/src/ngtsc/translator/src/translator.js
|
|
21
21
|
import * as o from "@angular/compiler";
|
|
22
22
|
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
23
23
|
[o.UnaryOperator.Minus, "-"],
|
|
@@ -121,6 +121,10 @@ var ExpressionTranslatorVisitor = class {
|
|
|
121
121
|
createTaggedTemplateExpression(tag, template) {
|
|
122
122
|
return this.downlevelTaggedTemplates ? this.createES5TaggedTemplateFunctionCall(tag, template) : this.factory.createTaggedTemplate(tag, template);
|
|
123
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Translate the tagged template literal into a call that is compatible with ES5, using the
|
|
126
|
+
* imported `__makeTemplateObject` helper for ES5 formatted output.
|
|
127
|
+
*/
|
|
124
128
|
createES5TaggedTemplateFunctionCall(tagHandler, { elements, expressions }) {
|
|
125
129
|
const __makeTemplateObjectHelper = this.imports.addImport({
|
|
126
130
|
exportModuleSpecifier: "tslib",
|
|
@@ -136,11 +140,13 @@ var ExpressionTranslatorVisitor = class {
|
|
|
136
140
|
const templateHelperCall = this.factory.createCallExpression(
|
|
137
141
|
__makeTemplateObjectHelper,
|
|
138
142
|
[this.factory.createArrayLiteral(cooked), this.factory.createArrayLiteral(raw)],
|
|
143
|
+
/* pure */
|
|
139
144
|
false
|
|
140
145
|
);
|
|
141
146
|
return this.factory.createCallExpression(
|
|
142
147
|
tagHandler,
|
|
143
148
|
[templateHelperCall, ...expressions],
|
|
149
|
+
/* pure */
|
|
144
150
|
false
|
|
145
151
|
);
|
|
146
152
|
}
|
|
@@ -293,4 +299,3 @@ export {
|
|
|
293
299
|
* Use of this source code is governed by an MIT-style license that can be
|
|
294
300
|
* found in the LICENSE file at https://angular.dev/license
|
|
295
301
|
*/
|
|
296
|
-
//# sourceMappingURL=chunk-6ECVYRSU.js.map
|