@angular/compiler-cli 18.2.0-next.2 → 18.2.0-next.4
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-XNL3EK5H.js → chunk-3W345P4E.js} +7 -7
- package/bundles/{chunk-YDQXTFSY.js → chunk-A35M6UXY.js} +18 -21
- package/bundles/{chunk-YDQXTFSY.js.map → chunk-A35M6UXY.js.map} +1 -1
- package/bundles/{chunk-THQF5ZZE.js → chunk-ERN7RQQ7.js} +5 -5
- package/bundles/{chunk-CW5TTYLY.js → chunk-JN25LQVK.js} +148 -138
- package/bundles/chunk-JN25LQVK.js.map +6 -0
- package/bundles/{chunk-GJ2BX3NZ.js → chunk-KCKRBU6N.js} +31 -31
- package/bundles/{chunk-6OFVLEJY.js → chunk-LRE5TVUW.js} +81 -81
- package/bundles/{chunk-6OFVLEJY.js.map → chunk-LRE5TVUW.js.map} +1 -1
- package/bundles/{chunk-SBDNBITT.js → chunk-LYJKWJUC.js} +3 -3
- package/bundles/{chunk-BR33BNGB.js → chunk-OPQN45UO.js} +3 -3
- package/bundles/{chunk-WR7TUJ7M.js → chunk-QYV344EV.js} +7 -7
- package/bundles/{chunk-I56P56EE.js → chunk-WYWH4ABE.js} +117 -51
- package/bundles/{chunk-I56P56EE.js.map → chunk-WYWH4ABE.js.map} +1 -1
- package/bundles/{chunk-XVC3L7YN.js → chunk-Y6YVL6KE.js} +5 -5
- package/bundles/index.js +12 -12
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +1 -1
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +4 -4
- package/bundles/private/tooling.js +6 -6
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +3 -2
- package/src/ngtsc/core/api/src/options.d.ts +1 -1
- package/src/ngtsc/transform/jit/src/initializer_api_transforms/transform_api.d.ts +1 -1
- package/src/ngtsc/translator/src/import_manager/import_manager.d.ts +17 -0
- package/src/ngtsc/translator/src/import_manager/import_typescript_transform.d.ts +1 -0
- package/bundles/chunk-CW5TTYLY.js.map +0 -6
- /package/bundles/{chunk-XNL3EK5H.js.map → chunk-3W345P4E.js.map} +0 -0
- /package/bundles/{chunk-THQF5ZZE.js.map → chunk-ERN7RQQ7.js.map} +0 -0
- /package/bundles/{chunk-GJ2BX3NZ.js.map → chunk-KCKRBU6N.js.map} +0 -0
- /package/bundles/{chunk-SBDNBITT.js.map → chunk-LYJKWJUC.js.map} +0 -0
- /package/bundles/{chunk-BR33BNGB.js.map → chunk-OPQN45UO.js.map} +0 -0
- /package/bundles/{chunk-WR7TUJ7M.js.map → chunk-QYV344EV.js.map} +0 -0
- /package/bundles/{chunk-XVC3L7YN.js.map → chunk-Y6YVL6KE.js.map} +0 -0
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
resolve,
|
|
13
13
|
stripExtension,
|
|
14
14
|
toRelativeImport
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3W345P4E.js";
|
|
16
16
|
|
|
17
|
-
// bazel-out/
|
|
17
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
18
18
|
import ts from "typescript";
|
|
19
19
|
|
|
20
|
-
// bazel-out/
|
|
20
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
|
|
21
21
|
var ErrorCode;
|
|
22
22
|
(function(ErrorCode2) {
|
|
23
23
|
ErrorCode2[ErrorCode2["DECORATOR_ARG_NOT_LITERAL"] = 1001] = "DECORATOR_ARG_NOT_LITERAL";
|
|
@@ -112,7 +112,7 @@ var ErrorCode;
|
|
|
112
112
|
ErrorCode2[ErrorCode2["LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION"] = 11003] = "LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION";
|
|
113
113
|
})(ErrorCode || (ErrorCode = {}));
|
|
114
114
|
|
|
115
|
-
// bazel-out/
|
|
115
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
116
116
|
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
117
117
|
function replaceTsWithNgInErrors(errors) {
|
|
118
118
|
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
@@ -121,7 +121,7 @@ function ngErrorCode(code) {
|
|
|
121
121
|
return parseInt("-99" + code);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
// bazel-out/
|
|
124
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
125
125
|
var FatalDiagnosticError = class extends Error {
|
|
126
126
|
constructor(code, node, diagnosticMessage, relatedInformation) {
|
|
127
127
|
super(`FatalDiagnosticError: Code: ${code}, Message: ${ts.flattenDiagnosticMessageText(diagnosticMessage, "\n")}`);
|
|
@@ -185,7 +185,7 @@ function isLocalCompilationDiagnostics(diagnostic) {
|
|
|
185
185
|
return diagnostic.code === ngErrorCode(ErrorCode.LOCAL_COMPILATION_UNRESOLVED_CONST) || diagnostic.code === ngErrorCode(ErrorCode.LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
// bazel-out/
|
|
188
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
189
189
|
var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
|
|
190
190
|
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
|
|
191
191
|
ErrorCode.IMPORT_CYCLE_DETECTED,
|
|
@@ -197,10 +197,10 @@ var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
|
|
|
197
197
|
ErrorCode.WARN_NGMODULE_ID_UNNECESSARY
|
|
198
198
|
]);
|
|
199
199
|
|
|
200
|
-
// bazel-out/
|
|
200
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.mjs
|
|
201
201
|
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.dev/errors";
|
|
202
202
|
|
|
203
|
-
// bazel-out/
|
|
203
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.mjs
|
|
204
204
|
var ExtendedTemplateDiagnosticName;
|
|
205
205
|
(function(ExtendedTemplateDiagnosticName2) {
|
|
206
206
|
ExtendedTemplateDiagnosticName2["INVALID_BANANA_IN_BOX"] = "invalidBananaInBox";
|
|
@@ -217,10 +217,10 @@ var ExtendedTemplateDiagnosticName;
|
|
|
217
217
|
ExtendedTemplateDiagnosticName2["UNUSED_LET_DECLARATION"] = "unusedLetDeclaration";
|
|
218
218
|
})(ExtendedTemplateDiagnosticName || (ExtendedTemplateDiagnosticName = {}));
|
|
219
219
|
|
|
220
|
-
// bazel-out/
|
|
220
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
|
|
221
221
|
import ts5 from "typescript";
|
|
222
222
|
|
|
223
|
-
// bazel-out/
|
|
223
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/host.mjs
|
|
224
224
|
import ts2 from "typescript";
|
|
225
225
|
function isDecoratorIdentifier(exp) {
|
|
226
226
|
return ts2.isIdentifier(exp) || ts2.isPropertyAccessExpression(exp) && ts2.isIdentifier(exp.expression) && ts2.isIdentifier(exp.name);
|
|
@@ -243,7 +243,7 @@ var ClassMemberAccessLevel;
|
|
|
243
243
|
})(ClassMemberAccessLevel || (ClassMemberAccessLevel = {}));
|
|
244
244
|
var AmbientImport = {};
|
|
245
245
|
|
|
246
|
-
// bazel-out/
|
|
246
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.mjs
|
|
247
247
|
import ts3 from "typescript";
|
|
248
248
|
function typeToValue(typeNode, checker, isLocalCompilation) {
|
|
249
249
|
var _a, _b;
|
|
@@ -427,7 +427,7 @@ function extractModuleName(node) {
|
|
|
427
427
|
return node.moduleSpecifier.text;
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
-
// bazel-out/
|
|
430
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/util.mjs
|
|
431
431
|
import ts4 from "typescript";
|
|
432
432
|
function isNamedClassDeclaration(node) {
|
|
433
433
|
return ts4.isClassDeclaration(node) && isIdentifier(node.name);
|
|
@@ -451,7 +451,7 @@ function classMemberAccessLevelToString(level) {
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
-
// bazel-out/
|
|
454
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
|
|
455
455
|
var TypeScriptReflectionHost = class {
|
|
456
456
|
constructor(checker, isLocalCompilation = false) {
|
|
457
457
|
this.checker = checker;
|
|
@@ -939,7 +939,7 @@ function getExportedName(decl, originalId) {
|
|
|
939
939
|
}
|
|
940
940
|
var LocalExportedDeclarations = Symbol("LocalExportedDeclarations");
|
|
941
941
|
|
|
942
|
-
// bazel-out/
|
|
942
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
|
|
943
943
|
import ts6 from "typescript";
|
|
944
944
|
var TS = /\.tsx?$/i;
|
|
945
945
|
var D_TS = /\.d\.ts$/i;
|
|
@@ -1040,7 +1040,7 @@ function toUnredirectedSourceFile(sf) {
|
|
|
1040
1040
|
return redirectInfo.unredirected;
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
1043
|
-
// bazel-out/
|
|
1043
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/references.mjs
|
|
1044
1044
|
var Reference = class {
|
|
1045
1045
|
constructor(node, bestGuessOwningModule = null) {
|
|
1046
1046
|
this.node = node;
|
|
@@ -1109,14 +1109,14 @@ var Reference = class {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
};
|
|
1111
1111
|
|
|
1112
|
-
// bazel-out/
|
|
1112
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
|
|
1113
1113
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
1114
1114
|
|
|
1115
|
-
// bazel-out/
|
|
1115
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
1116
1116
|
import { ExternalExpr, ExternalReference, WrappedNodeExpr } from "@angular/compiler";
|
|
1117
1117
|
import ts7 from "typescript";
|
|
1118
1118
|
|
|
1119
|
-
// bazel-out/
|
|
1119
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
|
|
1120
1120
|
function findExportedNameOfNode(target, file, reflector) {
|
|
1121
1121
|
const exports = reflector.getExportsOfModule(file);
|
|
1122
1122
|
if (exports === null) {
|
|
@@ -1136,7 +1136,7 @@ function findExportedNameOfNode(target, file, reflector) {
|
|
|
1136
1136
|
return foundExportName;
|
|
1137
1137
|
}
|
|
1138
1138
|
|
|
1139
|
-
// bazel-out/
|
|
1139
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
1140
1140
|
var ImportFlags;
|
|
1141
1141
|
(function(ImportFlags2) {
|
|
1142
1142
|
ImportFlags2[ImportFlags2["None"] = 0] = "None";
|
|
@@ -1367,7 +1367,7 @@ var UnifiedModulesStrategy = class {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
1369
|
|
|
1370
|
-
// bazel-out/
|
|
1370
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
|
|
1371
1371
|
var CHARS_TO_ESCAPE = /[^a-zA-Z0-9/_]/g;
|
|
1372
1372
|
var UnifiedModulesAliasingHost = class {
|
|
1373
1373
|
constructor(unifiedModulesHost) {
|
|
@@ -1434,7 +1434,7 @@ var AliasStrategy = class {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
};
|
|
1436
1436
|
|
|
1437
|
-
// bazel-out/
|
|
1437
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/path.mjs
|
|
1438
1438
|
function relativePathBetween(from, to) {
|
|
1439
1439
|
const relativePath = stripExtension(relative(dirname(resolve(from)), resolve(to)));
|
|
1440
1440
|
return relativePath !== "" ? toRelativeImport(relativePath) : null;
|
|
@@ -1443,7 +1443,7 @@ function normalizeSeparators(path) {
|
|
|
1443
1443
|
return path.replace(/\\/g, "/");
|
|
1444
1444
|
}
|
|
1445
1445
|
|
|
1446
|
-
// bazel-out/
|
|
1446
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
|
|
1447
1447
|
var NoopImportRewriter = class {
|
|
1448
1448
|
rewriteSymbol(symbol, specifier) {
|
|
1449
1449
|
return symbol;
|
|
@@ -1496,7 +1496,7 @@ function validateAndRewriteCoreSymbol(name) {
|
|
|
1496
1496
|
return CORE_SUPPORTED_SYMBOLS.get(name);
|
|
1497
1497
|
}
|
|
1498
1498
|
|
|
1499
|
-
// bazel-out/
|
|
1499
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/patch_alias_reference_resolution.mjs
|
|
1500
1500
|
import ts8 from "typescript";
|
|
1501
1501
|
var patchedReferencedAliasesSymbol = Symbol("patchedReferencedAliases");
|
|
1502
1502
|
function loadIsReferencedAliasDeclarationPatch(context) {
|
|
@@ -1531,7 +1531,7 @@ function throwIncompatibleTransformationContextError() {
|
|
|
1531
1531
|
throw Error("Angular compiler is incompatible with this version of the TypeScript compiler.\n\nIf you recently updated TypeScript and this issue surfaces now, consider downgrading.\n\nPlease report an issue on the Angular repositories when this issue surfaces and you are using a supposedly compatible TypeScript version.");
|
|
1532
1532
|
}
|
|
1533
1533
|
|
|
1534
|
-
// bazel-out/
|
|
1534
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
|
|
1535
1535
|
var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
|
|
1536
1536
|
function attachDefaultImportDeclaration(expr, importDecl) {
|
|
1537
1537
|
expr[DefaultImportDeclaration] = importDecl;
|
|
@@ -1572,7 +1572,7 @@ var DefaultImportTracker = class {
|
|
|
1572
1572
|
}
|
|
1573
1573
|
};
|
|
1574
1574
|
|
|
1575
|
-
// bazel-out/
|
|
1575
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/deferred_symbol_tracker.mjs
|
|
1576
1576
|
import ts9 from "typescript";
|
|
1577
1577
|
var AssumeEager = "AssumeEager";
|
|
1578
1578
|
var DeferredSymbolTracker = class {
|
|
@@ -1693,7 +1693,7 @@ var DeferredSymbolTracker = class {
|
|
|
1693
1693
|
}
|
|
1694
1694
|
};
|
|
1695
1695
|
|
|
1696
|
-
// bazel-out/
|
|
1696
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/imported_symbols_tracker.mjs
|
|
1697
1697
|
import ts10 from "typescript";
|
|
1698
1698
|
var ImportedSymbolsTracker = class {
|
|
1699
1699
|
constructor() {
|
|
@@ -1763,7 +1763,7 @@ var ImportedSymbolsTracker = class {
|
|
|
1763
1763
|
}
|
|
1764
1764
|
};
|
|
1765
1765
|
|
|
1766
|
-
// bazel-out/
|
|
1766
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/local_compilation_extra_imports_tracker.mjs
|
|
1767
1767
|
import ts11 from "typescript";
|
|
1768
1768
|
var LocalCompilationExtraImportsTracker = class {
|
|
1769
1769
|
constructor(typeChecker) {
|
|
@@ -1814,7 +1814,7 @@ function removeQuotations(s) {
|
|
|
1814
1814
|
return s.substring(1, s.length - 1).trim();
|
|
1815
1815
|
}
|
|
1816
1816
|
|
|
1817
|
-
// bazel-out/
|
|
1817
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/resolver.mjs
|
|
1818
1818
|
var ModuleResolver = class {
|
|
1819
1819
|
constructor(program, compilerOptions, host, moduleResolutionCache) {
|
|
1820
1820
|
this.program = program;
|
|
@@ -1831,10 +1831,10 @@ var ModuleResolver = class {
|
|
|
1831
1831
|
}
|
|
1832
1832
|
};
|
|
1833
1833
|
|
|
1834
|
-
// bazel-out/
|
|
1834
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager/import_manager.mjs
|
|
1835
1835
|
import ts16 from "typescript";
|
|
1836
1836
|
|
|
1837
|
-
// bazel-out/
|
|
1837
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager/check_unique_identifier_name.mjs
|
|
1838
1838
|
import ts12 from "typescript";
|
|
1839
1839
|
function createGenerateUniqueIdentifierHelper() {
|
|
1840
1840
|
const generatedIdentifiers = /* @__PURE__ */ new Set();
|
|
@@ -1860,11 +1860,11 @@ function createGenerateUniqueIdentifierHelper() {
|
|
|
1860
1860
|
};
|
|
1861
1861
|
}
|
|
1862
1862
|
|
|
1863
|
-
// bazel-out/
|
|
1863
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager/import_typescript_transform.mjs
|
|
1864
1864
|
import ts13 from "typescript";
|
|
1865
1865
|
function createTsTransformForImportManager(manager, extraStatementsForFiles) {
|
|
1866
1866
|
return (ctx) => {
|
|
1867
|
-
const { affectedFiles, newImports, updatedImports, reusedOriginalAliasDeclarations } = manager.finalize();
|
|
1867
|
+
const { affectedFiles, newImports, updatedImports, reusedOriginalAliasDeclarations, deletedImports } = manager.finalize();
|
|
1868
1868
|
if (reusedOriginalAliasDeclarations.size > 0) {
|
|
1869
1869
|
const referencedAliasDeclarations = loadIsReferencedAliasDeclarationPatch(ctx);
|
|
1870
1870
|
reusedOriginalAliasDeclarations.forEach((aliasDecl) => referencedAliasDeclarations.add(aliasDecl));
|
|
@@ -1877,7 +1877,13 @@ function createTsTransformForImportManager(manager, extraStatementsForFiles) {
|
|
|
1877
1877
|
}
|
|
1878
1878
|
}
|
|
1879
1879
|
const visitStatement = (node) => {
|
|
1880
|
-
if (!ts13.isImportDeclaration(node)
|
|
1880
|
+
if (!ts13.isImportDeclaration(node)) {
|
|
1881
|
+
return node;
|
|
1882
|
+
}
|
|
1883
|
+
if (deletedImports.has(node)) {
|
|
1884
|
+
return void 0;
|
|
1885
|
+
}
|
|
1886
|
+
if (node.importClause === void 0 || !ts13.isImportClause(node.importClause)) {
|
|
1881
1887
|
return node;
|
|
1882
1888
|
}
|
|
1883
1889
|
const clause = node.importClause;
|
|
@@ -1921,7 +1927,7 @@ function isImportStatement(stmt) {
|
|
|
1921
1927
|
return ts13.isImportDeclaration(stmt) || ts13.isImportEqualsDeclaration(stmt) || ts13.isNamespaceImport(stmt);
|
|
1922
1928
|
}
|
|
1923
1929
|
|
|
1924
|
-
// bazel-out/
|
|
1930
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager/reuse_generated_imports.mjs
|
|
1925
1931
|
import ts14 from "typescript";
|
|
1926
1932
|
function attemptToReuseGeneratedImports(tracker, request) {
|
|
1927
1933
|
const requestHash = hashImportRequest(request);
|
|
@@ -1948,7 +1954,7 @@ function hashImportRequest(req) {
|
|
|
1948
1954
|
return `${req.requestedFile.fileName}:${req.exportModuleSpecifier}:${req.exportSymbolName}${req.unsafeAliasOverride ? ":" + req.unsafeAliasOverride : ""}`;
|
|
1949
1955
|
}
|
|
1950
1956
|
|
|
1951
|
-
// bazel-out/
|
|
1957
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager/reuse_source_file_imports.mjs
|
|
1952
1958
|
import ts15 from "typescript";
|
|
1953
1959
|
function attemptToReuseExistingSourceFileImports(tracker, sourceFile, request) {
|
|
1954
1960
|
let candidateImportToBeUpdated = null;
|
|
@@ -2008,7 +2014,7 @@ function attemptToReuseExistingSourceFileImports(tracker, sourceFile, request) {
|
|
|
2008
2014
|
return fileUniqueAlias != null ? fileUniqueAlias : propertyName;
|
|
2009
2015
|
}
|
|
2010
2016
|
|
|
2011
|
-
// bazel-out/
|
|
2017
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager/import_manager.mjs
|
|
2012
2018
|
var presetImportManagerForceNamespaceImports = {
|
|
2013
2019
|
disableOriginalSourceFileReuse: true,
|
|
2014
2020
|
forceGenerateNamespacesForNewImports: true
|
|
@@ -2017,6 +2023,7 @@ var ImportManager = class {
|
|
|
2017
2023
|
constructor(config = {}) {
|
|
2018
2024
|
var _a, _b, _c, _d, _e, _f;
|
|
2019
2025
|
this.newImports = /* @__PURE__ */ new Map();
|
|
2026
|
+
this.removedImports = /* @__PURE__ */ new Map();
|
|
2020
2027
|
this.nextUniqueIndex = 0;
|
|
2021
2028
|
this.reuseGeneratedImportsTracker = {
|
|
2022
2029
|
directReuseCache: /* @__PURE__ */ new Map(),
|
|
@@ -2043,12 +2050,16 @@ var ImportManager = class {
|
|
|
2043
2050
|
this._getNewImportsTrackerForFile(requestedFile).sideEffectImports.add(moduleSpecifier);
|
|
2044
2051
|
}
|
|
2045
2052
|
addImport(request) {
|
|
2053
|
+
var _a, _b;
|
|
2046
2054
|
if (this.config.rewriter !== null) {
|
|
2047
2055
|
if (request.exportSymbolName !== null) {
|
|
2048
2056
|
request.exportSymbolName = this.config.rewriter.rewriteSymbol(request.exportSymbolName, request.exportModuleSpecifier);
|
|
2049
2057
|
}
|
|
2050
2058
|
request.exportModuleSpecifier = this.config.rewriter.rewriteSpecifier(request.exportModuleSpecifier, request.requestedFile.fileName);
|
|
2051
2059
|
}
|
|
2060
|
+
if (request.exportSymbolName !== null && !request.asTypeReference) {
|
|
2061
|
+
(_b = (_a = this.removedImports.get(request.requestedFile)) == null ? void 0 : _a.get(request.exportModuleSpecifier)) == null ? void 0 : _b.delete(request.exportSymbolName);
|
|
2062
|
+
}
|
|
2052
2063
|
const previousGeneratedImportRef = attemptToReuseGeneratedImports(this.reuseGeneratedImportsTracker, request);
|
|
2053
2064
|
if (previousGeneratedImportRef !== null) {
|
|
2054
2065
|
return createImportReference(!!request.asTypeReference, previousGeneratedImportRef);
|
|
@@ -2057,6 +2068,19 @@ var ImportManager = class {
|
|
|
2057
2068
|
captureGeneratedImport(request, this.reuseGeneratedImportsTracker, resultImportRef);
|
|
2058
2069
|
return createImportReference(!!request.asTypeReference, resultImportRef);
|
|
2059
2070
|
}
|
|
2071
|
+
removeImport(requestedFile, exportSymbolName, moduleSpecifier) {
|
|
2072
|
+
let moduleMap = this.removedImports.get(requestedFile);
|
|
2073
|
+
if (!moduleMap) {
|
|
2074
|
+
moduleMap = /* @__PURE__ */ new Map();
|
|
2075
|
+
this.removedImports.set(requestedFile, moduleMap);
|
|
2076
|
+
}
|
|
2077
|
+
let removedSymbols = moduleMap.get(moduleSpecifier);
|
|
2078
|
+
if (!removedSymbols) {
|
|
2079
|
+
removedSymbols = /* @__PURE__ */ new Set();
|
|
2080
|
+
moduleMap.set(moduleSpecifier, removedSymbols);
|
|
2081
|
+
}
|
|
2082
|
+
removedSymbols.add(exportSymbolName);
|
|
2083
|
+
}
|
|
2060
2084
|
_generateNewImport(request) {
|
|
2061
2085
|
var _a;
|
|
2062
2086
|
const { requestedFile: sourceFile } = request;
|
|
@@ -2103,6 +2127,8 @@ var ImportManager = class {
|
|
|
2103
2127
|
const affectedFiles = /* @__PURE__ */ new Set();
|
|
2104
2128
|
const updatedImportsResult = /* @__PURE__ */ new Map();
|
|
2105
2129
|
const newImportsResult = /* @__PURE__ */ new Map();
|
|
2130
|
+
const deletedImports = /* @__PURE__ */ new Set();
|
|
2131
|
+
const importDeclarationsPerFile = /* @__PURE__ */ new Map();
|
|
2106
2132
|
const addNewImport = (fileName, importDecl) => {
|
|
2107
2133
|
affectedFiles.add(fileName);
|
|
2108
2134
|
if (newImportsResult.has(fileName)) {
|
|
@@ -2112,10 +2138,42 @@ var ImportManager = class {
|
|
|
2112
2138
|
}
|
|
2113
2139
|
};
|
|
2114
2140
|
this.reuseSourceFileImportsTracker.updatedImports.forEach((expressions, importDecl) => {
|
|
2141
|
+
const sourceFile = importDecl.getSourceFile();
|
|
2115
2142
|
const namedBindings = importDecl.importClause.namedBindings;
|
|
2116
|
-
const
|
|
2117
|
-
|
|
2118
|
-
|
|
2143
|
+
const moduleName = importDecl.moduleSpecifier.text;
|
|
2144
|
+
const newElements = namedBindings.elements.concat(expressions.map(({ propertyName, fileUniqueAlias }) => ts16.factory.createImportSpecifier(false, fileUniqueAlias !== null ? propertyName : void 0, fileUniqueAlias != null ? fileUniqueAlias : propertyName))).filter((specifier) => this._canAddSpecifier(sourceFile, moduleName, specifier));
|
|
2145
|
+
affectedFiles.add(sourceFile.fileName);
|
|
2146
|
+
if (newElements.length === 0) {
|
|
2147
|
+
deletedImports.add(importDecl);
|
|
2148
|
+
} else {
|
|
2149
|
+
updatedImportsResult.set(namedBindings, ts16.factory.updateNamedImports(namedBindings, newElements));
|
|
2150
|
+
}
|
|
2151
|
+
});
|
|
2152
|
+
this.removedImports.forEach((removeMap, sourceFile) => {
|
|
2153
|
+
var _a;
|
|
2154
|
+
if (removeMap.size === 0) {
|
|
2155
|
+
return;
|
|
2156
|
+
}
|
|
2157
|
+
let allImports = importDeclarationsPerFile.get(sourceFile);
|
|
2158
|
+
if (!allImports) {
|
|
2159
|
+
allImports = sourceFile.statements.filter(ts16.isImportDeclaration);
|
|
2160
|
+
importDeclarationsPerFile.set(sourceFile, allImports);
|
|
2161
|
+
}
|
|
2162
|
+
for (const node of allImports) {
|
|
2163
|
+
if (!((_a = node.importClause) == null ? void 0 : _a.namedBindings) || !ts16.isNamedImports(node.importClause.namedBindings) || this.reuseSourceFileImportsTracker.updatedImports.has(node) || deletedImports.has(node)) {
|
|
2164
|
+
continue;
|
|
2165
|
+
}
|
|
2166
|
+
const namedBindings = node.importClause.namedBindings;
|
|
2167
|
+
const moduleName = node.moduleSpecifier.text;
|
|
2168
|
+
const newImports = namedBindings.elements.filter((specifier) => this._canAddSpecifier(sourceFile, moduleName, specifier));
|
|
2169
|
+
if (newImports.length === 0) {
|
|
2170
|
+
affectedFiles.add(sourceFile.fileName);
|
|
2171
|
+
deletedImports.add(node);
|
|
2172
|
+
} else if (newImports.length !== namedBindings.elements.length) {
|
|
2173
|
+
affectedFiles.add(sourceFile.fileName);
|
|
2174
|
+
updatedImportsResult.set(namedBindings, ts16.factory.updateNamedImports(namedBindings, newImports));
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2119
2177
|
});
|
|
2120
2178
|
this.newImports.forEach(({ namedImports, namespaceImports, sideEffectImports }, sourceFile) => {
|
|
2121
2179
|
const useSingleQuotes = this.config.shouldUseSingleQuotes(sourceFile);
|
|
@@ -2129,15 +2187,19 @@ var ImportManager = class {
|
|
|
2129
2187
|
addNewImport(fileName, newImport);
|
|
2130
2188
|
});
|
|
2131
2189
|
namedImports.forEach((specifiers, moduleName) => {
|
|
2132
|
-
const
|
|
2133
|
-
|
|
2190
|
+
const filteredSpecifiers = specifiers.filter((specifier) => this._canAddSpecifier(sourceFile, moduleName, specifier));
|
|
2191
|
+
if (filteredSpecifiers.length > 0) {
|
|
2192
|
+
const newImport = ts16.factory.createImportDeclaration(void 0, ts16.factory.createImportClause(false, void 0, ts16.factory.createNamedImports(filteredSpecifiers)), ts16.factory.createStringLiteral(moduleName, useSingleQuotes));
|
|
2193
|
+
addNewImport(fileName, newImport);
|
|
2194
|
+
}
|
|
2134
2195
|
});
|
|
2135
2196
|
});
|
|
2136
2197
|
return {
|
|
2137
2198
|
affectedFiles,
|
|
2138
2199
|
newImports: newImportsResult,
|
|
2139
2200
|
updatedImports: updatedImportsResult,
|
|
2140
|
-
reusedOriginalAliasDeclarations: this.reuseSourceFileImportsTracker.reusedAliasDeclarations
|
|
2201
|
+
reusedOriginalAliasDeclarations: this.reuseSourceFileImportsTracker.reusedAliasDeclarations,
|
|
2202
|
+
deletedImports
|
|
2141
2203
|
};
|
|
2142
2204
|
}
|
|
2143
2205
|
toTsTransform(extraStatementsMap) {
|
|
@@ -2157,6 +2219,10 @@ var ImportManager = class {
|
|
|
2157
2219
|
}
|
|
2158
2220
|
return this.newImports.get(file);
|
|
2159
2221
|
}
|
|
2222
|
+
_canAddSpecifier(sourceFile, moduleSpecifier, specifier) {
|
|
2223
|
+
var _a, _b;
|
|
2224
|
+
return !((_b = (_a = this.removedImports.get(sourceFile)) == null ? void 0 : _a.get(moduleSpecifier)) == null ? void 0 : _b.has((specifier.propertyName || specifier.name).text));
|
|
2225
|
+
}
|
|
2160
2226
|
};
|
|
2161
2227
|
function createImportReference(asTypeReference, ref) {
|
|
2162
2228
|
if (asTypeReference) {
|
|
@@ -2166,7 +2232,7 @@ function createImportReference(asTypeReference, ref) {
|
|
|
2166
2232
|
}
|
|
2167
2233
|
}
|
|
2168
2234
|
|
|
2169
|
-
// bazel-out/
|
|
2235
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
|
|
2170
2236
|
var Context = class {
|
|
2171
2237
|
constructor(isStatement) {
|
|
2172
2238
|
this.isStatement = isStatement;
|
|
@@ -2179,7 +2245,7 @@ var Context = class {
|
|
|
2179
2245
|
}
|
|
2180
2246
|
};
|
|
2181
2247
|
|
|
2182
|
-
// bazel-out/
|
|
2248
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
|
|
2183
2249
|
import * as o from "@angular/compiler";
|
|
2184
2250
|
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
2185
2251
|
[o.UnaryOperator.Minus, "-"],
|
|
@@ -2425,7 +2491,7 @@ function createRange(span) {
|
|
|
2425
2491
|
};
|
|
2426
2492
|
}
|
|
2427
2493
|
|
|
2428
|
-
// bazel-out/
|
|
2494
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_emitter.mjs
|
|
2429
2495
|
import ts17 from "typescript";
|
|
2430
2496
|
var INELIGIBLE = {};
|
|
2431
2497
|
function canEmitType(type, canEmit) {
|
|
@@ -2500,11 +2566,11 @@ var TypeEmitter = class {
|
|
|
2500
2566
|
}
|
|
2501
2567
|
};
|
|
2502
2568
|
|
|
2503
|
-
// bazel-out/
|
|
2569
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
2504
2570
|
import * as o2 from "@angular/compiler";
|
|
2505
2571
|
import ts19 from "typescript";
|
|
2506
2572
|
|
|
2507
|
-
// bazel-out/
|
|
2573
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/ts_util.mjs
|
|
2508
2574
|
import ts18 from "typescript";
|
|
2509
2575
|
function tsNumericExpression(value) {
|
|
2510
2576
|
if (value < 0) {
|
|
@@ -2514,7 +2580,7 @@ function tsNumericExpression(value) {
|
|
|
2514
2580
|
return ts18.factory.createNumericLiteral(value);
|
|
2515
2581
|
}
|
|
2516
2582
|
|
|
2517
|
-
// bazel-out/
|
|
2583
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
2518
2584
|
function translateType(type, contextFile, reflector, refEmitter, imports) {
|
|
2519
2585
|
return type.visitType(new TypeTranslatorVisitor(imports, contextFile, reflector, refEmitter), new Context(false));
|
|
2520
2586
|
}
|
|
@@ -2731,7 +2797,7 @@ var TypeTranslatorVisitor = class {
|
|
|
2731
2797
|
}
|
|
2732
2798
|
};
|
|
2733
2799
|
|
|
2734
|
-
// bazel-out/
|
|
2800
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
|
|
2735
2801
|
import ts20 from "typescript";
|
|
2736
2802
|
var PureAnnotation;
|
|
2737
2803
|
(function(PureAnnotation2) {
|
|
@@ -2934,7 +3000,7 @@ function attachComments(statement, leadingComments) {
|
|
|
2934
3000
|
}
|
|
2935
3001
|
}
|
|
2936
3002
|
|
|
2937
|
-
// bazel-out/
|
|
3003
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_translator.mjs
|
|
2938
3004
|
function translateExpression(contextFile, expression, imports, options = {}) {
|
|
2939
3005
|
return expression.visitExpression(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, contextFile, options), new Context(false));
|
|
2940
3006
|
}
|
|
@@ -3031,4 +3097,4 @@ export {
|
|
|
3031
3097
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3032
3098
|
* found in the LICENSE file at https://angular.io/license
|
|
3033
3099
|
*/
|
|
3034
|
-
//# sourceMappingURL=chunk-
|
|
3100
|
+
//# sourceMappingURL=chunk-WYWH4ABE.js.map
|