@angular/compiler-cli 13.0.0-rc.3 → 13.1.0-next.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.
- package/bundles/chunk-2DL256T3.js +5105 -0
- package/bundles/chunk-2DL256T3.js.map +6 -0
- package/bundles/chunk-ACINBTQB.js +43 -0
- package/bundles/chunk-ACINBTQB.js.map +6 -0
- package/bundles/chunk-BUHTODFL.js +380 -0
- package/bundles/chunk-BUHTODFL.js.map +6 -0
- package/bundles/chunk-EP5JHXG2.js +448 -0
- package/bundles/chunk-EP5JHXG2.js.map +6 -0
- package/bundles/chunk-GLCRIILX.js +206 -0
- package/bundles/chunk-GLCRIILX.js.map +6 -0
- package/bundles/chunk-JNWO3JB2.js +968 -0
- package/bundles/chunk-JNWO3JB2.js.map +6 -0
- package/bundles/chunk-MIQ5UCHZ.js +5663 -0
- package/bundles/chunk-MIQ5UCHZ.js.map +6 -0
- package/bundles/chunk-PBA67OV4.js +358 -0
- package/bundles/chunk-PBA67OV4.js.map +6 -0
- package/bundles/chunk-QDWL7SZJ.js +29 -0
- package/bundles/chunk-QDWL7SZJ.js.map +6 -0
- package/bundles/chunk-QL6ZC3U3.js +424 -0
- package/bundles/chunk-QL6ZC3U3.js.map +6 -0
- package/bundles/chunk-S3QIIFH7.js +678 -0
- package/bundles/chunk-S3QIIFH7.js.map +6 -0
- package/bundles/chunk-SKBLJA43.js +56 -0
- package/bundles/chunk-SKBLJA43.js.map +6 -0
- package/bundles/chunk-UMUIU7TE.js +116 -0
- package/bundles/chunk-UMUIU7TE.js.map +6 -0
- package/bundles/chunk-VKIZ4TCJ.js +11997 -0
- package/bundles/chunk-VKIZ4TCJ.js.map +6 -0
- package/bundles/chunk-WOC6KEUY.js +2177 -0
- package/bundles/chunk-WOC6KEUY.js.map +6 -0
- package/bundles/chunk-WYO7JO2T.js +1261 -0
- package/bundles/chunk-WYO7JO2T.js.map +6 -0
- package/bundles/chunk-XA5IZLLC.js +68 -0
- package/bundles/chunk-XA5IZLLC.js.map +6 -0
- package/bundles/index.js +96 -20249
- package/bundles/index.js.map +2 -2
- package/bundles/linker/babel/index.js +24 -1987
- package/bundles/linker/babel/index.js.map +2 -2
- package/bundles/linker/index.js +12 -1833
- package/bundles/linker/index.js.map +2 -2
- package/bundles/ngcc/index.js +27 -16011
- package/bundles/ngcc/index.js.map +2 -2
- package/bundles/ngcc/main-ngcc.js +19 -16095
- package/bundles/ngcc/main-ngcc.js.map +2 -2
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +32 -13768
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +2 -2
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +11 -310
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +2 -2
- package/bundles/private/bazel.js +4 -81
- package/bundles/private/bazel.js.map +2 -2
- package/bundles/private/localize.js +27 -870
- package/bundles/private/localize.js.map +2 -2
- package/bundles/private/migrations.js +13 -2158
- package/bundles/private/migrations.js.map +2 -2
- package/bundles/private/tooling.js +8 -931
- package/bundles/private/tooling.js.map +2 -2
- package/bundles/src/bin/ng_xi18n.js +22 -20419
- package/bundles/src/bin/ng_xi18n.js.map +2 -2
- package/bundles/src/bin/ngc.js +16 -20432
- package/bundles/src/bin/ngc.js.map +2 -2
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +2 -2
- package/linker/src/file_linker/translator.d.ts +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/ngcc/src/packages/entry_point.d.ts +5 -0
- package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/typecheck/api/checker.d.ts +1 -1
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +1 -1
|
@@ -0,0 +1,968 @@
|
|
|
1
|
+
|
|
2
|
+
import {createRequire as __cjsCompatRequire} from 'module';
|
|
3
|
+
const require = __cjsCompatRequire(import.meta.url);
|
|
4
|
+
const __ESM_IMPORT_META_URL__ = import.meta.url;
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
SourceFileLoader
|
|
8
|
+
} from "./chunk-QL6ZC3U3.js";
|
|
9
|
+
import {
|
|
10
|
+
Context,
|
|
11
|
+
ExpressionTranslatorVisitor
|
|
12
|
+
} from "./chunk-WYO7JO2T.js";
|
|
13
|
+
import {
|
|
14
|
+
__spreadProps,
|
|
15
|
+
__spreadValues
|
|
16
|
+
} from "./chunk-XA5IZLLC.js";
|
|
17
|
+
|
|
18
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/fatal_linker_error.mjs
|
|
19
|
+
var FatalLinkerError = class extends Error {
|
|
20
|
+
constructor(node, message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.node = node;
|
|
23
|
+
this.type = "FatalLinkerError";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function isFatalLinkerError(e) {
|
|
27
|
+
return e && e.type === "FatalLinkerError";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/ast/utils.mjs
|
|
31
|
+
function assert(node, predicate, expected) {
|
|
32
|
+
if (!predicate(node)) {
|
|
33
|
+
throw new FatalLinkerError(node, `Unsupported syntax, expected ${expected}.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/ast/ast_value.mjs
|
|
38
|
+
import {
|
|
39
|
+
WrappedNodeExpr
|
|
40
|
+
} from "@angular/compiler";
|
|
41
|
+
var AstObject = class {
|
|
42
|
+
constructor(expression, obj, host) {
|
|
43
|
+
this.expression = expression;
|
|
44
|
+
this.obj = obj;
|
|
45
|
+
this.host = host;
|
|
46
|
+
}
|
|
47
|
+
static parse(expression, host) {
|
|
48
|
+
const obj = host.parseObjectLiteral(expression);
|
|
49
|
+
return new AstObject(expression, obj, host);
|
|
50
|
+
}
|
|
51
|
+
has(propertyName) {
|
|
52
|
+
return this.obj.has(propertyName);
|
|
53
|
+
}
|
|
54
|
+
getNumber(propertyName) {
|
|
55
|
+
return this.host.parseNumericLiteral(this.getRequiredProperty(propertyName));
|
|
56
|
+
}
|
|
57
|
+
getString(propertyName) {
|
|
58
|
+
return this.host.parseStringLiteral(this.getRequiredProperty(propertyName));
|
|
59
|
+
}
|
|
60
|
+
getBoolean(propertyName) {
|
|
61
|
+
return this.host.parseBooleanLiteral(this.getRequiredProperty(propertyName));
|
|
62
|
+
}
|
|
63
|
+
getObject(propertyName) {
|
|
64
|
+
const expr = this.getRequiredProperty(propertyName);
|
|
65
|
+
const obj = this.host.parseObjectLiteral(expr);
|
|
66
|
+
return new AstObject(expr, obj, this.host);
|
|
67
|
+
}
|
|
68
|
+
getArray(propertyName) {
|
|
69
|
+
const arr = this.host.parseArrayLiteral(this.getRequiredProperty(propertyName));
|
|
70
|
+
return arr.map((entry) => new AstValue(entry, this.host));
|
|
71
|
+
}
|
|
72
|
+
getOpaque(propertyName) {
|
|
73
|
+
return new WrappedNodeExpr(this.getRequiredProperty(propertyName));
|
|
74
|
+
}
|
|
75
|
+
getNode(propertyName) {
|
|
76
|
+
return this.getRequiredProperty(propertyName);
|
|
77
|
+
}
|
|
78
|
+
getValue(propertyName) {
|
|
79
|
+
return new AstValue(this.getRequiredProperty(propertyName), this.host);
|
|
80
|
+
}
|
|
81
|
+
toLiteral(mapper) {
|
|
82
|
+
const result = {};
|
|
83
|
+
for (const [key, expression] of this.obj) {
|
|
84
|
+
result[key] = mapper(new AstValue(expression, this.host));
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
toMap(mapper) {
|
|
89
|
+
const result = new Map();
|
|
90
|
+
for (const [key, expression] of this.obj) {
|
|
91
|
+
result.set(key, mapper(new AstValue(expression, this.host)));
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
getRequiredProperty(propertyName) {
|
|
96
|
+
if (!this.obj.has(propertyName)) {
|
|
97
|
+
throw new FatalLinkerError(this.expression, `Expected property '${propertyName}' to be present.`);
|
|
98
|
+
}
|
|
99
|
+
return this.obj.get(propertyName);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var AstValue = class {
|
|
103
|
+
constructor(expression, host) {
|
|
104
|
+
this.expression = expression;
|
|
105
|
+
this.host = host;
|
|
106
|
+
}
|
|
107
|
+
getSymbolName() {
|
|
108
|
+
return this.host.getSymbolName(this.expression);
|
|
109
|
+
}
|
|
110
|
+
isNumber() {
|
|
111
|
+
return this.host.isNumericLiteral(this.expression);
|
|
112
|
+
}
|
|
113
|
+
getNumber() {
|
|
114
|
+
return this.host.parseNumericLiteral(this.expression);
|
|
115
|
+
}
|
|
116
|
+
isString() {
|
|
117
|
+
return this.host.isStringLiteral(this.expression);
|
|
118
|
+
}
|
|
119
|
+
getString() {
|
|
120
|
+
return this.host.parseStringLiteral(this.expression);
|
|
121
|
+
}
|
|
122
|
+
isBoolean() {
|
|
123
|
+
return this.host.isBooleanLiteral(this.expression);
|
|
124
|
+
}
|
|
125
|
+
getBoolean() {
|
|
126
|
+
return this.host.parseBooleanLiteral(this.expression);
|
|
127
|
+
}
|
|
128
|
+
isObject() {
|
|
129
|
+
return this.host.isObjectLiteral(this.expression);
|
|
130
|
+
}
|
|
131
|
+
getObject() {
|
|
132
|
+
return AstObject.parse(this.expression, this.host);
|
|
133
|
+
}
|
|
134
|
+
isArray() {
|
|
135
|
+
return this.host.isArrayLiteral(this.expression);
|
|
136
|
+
}
|
|
137
|
+
getArray() {
|
|
138
|
+
const arr = this.host.parseArrayLiteral(this.expression);
|
|
139
|
+
return arr.map((entry) => new AstValue(entry, this.host));
|
|
140
|
+
}
|
|
141
|
+
isFunction() {
|
|
142
|
+
return this.host.isFunctionExpression(this.expression);
|
|
143
|
+
}
|
|
144
|
+
getFunctionReturnValue() {
|
|
145
|
+
return new AstValue(this.host.parseReturnValue(this.expression), this.host);
|
|
146
|
+
}
|
|
147
|
+
isCallExpression() {
|
|
148
|
+
return this.host.isCallExpression(this.expression);
|
|
149
|
+
}
|
|
150
|
+
getCallee() {
|
|
151
|
+
return new AstValue(this.host.parseCallee(this.expression), this.host);
|
|
152
|
+
}
|
|
153
|
+
getArguments() {
|
|
154
|
+
const args = this.host.parseArguments(this.expression);
|
|
155
|
+
return args.map((arg) => new AstValue(arg, this.host));
|
|
156
|
+
}
|
|
157
|
+
getOpaque() {
|
|
158
|
+
return new WrappedNodeExpr(this.expression);
|
|
159
|
+
}
|
|
160
|
+
getRange() {
|
|
161
|
+
return this.host.getRange(this.expression);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
|
|
166
|
+
import { ConstantPool } from "@angular/compiler";
|
|
167
|
+
|
|
168
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/linker_import_generator.mjs
|
|
169
|
+
var LinkerImportGenerator = class {
|
|
170
|
+
constructor(ngImport) {
|
|
171
|
+
this.ngImport = ngImport;
|
|
172
|
+
}
|
|
173
|
+
generateNamespaceImport(moduleName) {
|
|
174
|
+
this.assertModuleName(moduleName);
|
|
175
|
+
return this.ngImport;
|
|
176
|
+
}
|
|
177
|
+
generateNamedImport(moduleName, originalSymbol) {
|
|
178
|
+
this.assertModuleName(moduleName);
|
|
179
|
+
return { moduleImport: this.ngImport, symbol: originalSymbol };
|
|
180
|
+
}
|
|
181
|
+
assertModuleName(moduleName) {
|
|
182
|
+
if (moduleName !== "@angular/core") {
|
|
183
|
+
throw new FatalLinkerError(this.ngImport, `Unable to import from anything other than '@angular/core'`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
|
|
189
|
+
var EmitScope = class {
|
|
190
|
+
constructor(ngImport, translator) {
|
|
191
|
+
this.ngImport = ngImport;
|
|
192
|
+
this.translator = translator;
|
|
193
|
+
this.constantPool = new ConstantPool();
|
|
194
|
+
}
|
|
195
|
+
translateDefinition(definition) {
|
|
196
|
+
return this.translator.translateExpression(definition, new LinkerImportGenerator(this.ngImport));
|
|
197
|
+
}
|
|
198
|
+
getConstantStatements() {
|
|
199
|
+
const importGenerator = new LinkerImportGenerator(this.ngImport);
|
|
200
|
+
return this.constantPool.statements.map((statement) => this.translator.translateStatement(statement, importGenerator));
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/iife_emit_scope.mjs
|
|
205
|
+
var IifeEmitScope = class extends EmitScope {
|
|
206
|
+
constructor(ngImport, translator, factory) {
|
|
207
|
+
super(ngImport, translator);
|
|
208
|
+
this.factory = factory;
|
|
209
|
+
}
|
|
210
|
+
translateDefinition(definition) {
|
|
211
|
+
const constantStatements = super.getConstantStatements();
|
|
212
|
+
const returnStatement = this.factory.createReturnStatement(super.translateDefinition(definition));
|
|
213
|
+
const body = this.factory.createBlock([...constantStatements, returnStatement]);
|
|
214
|
+
const fn = this.factory.createFunctionExpression(null, [], body);
|
|
215
|
+
return this.factory.createCallExpression(fn, [], false);
|
|
216
|
+
}
|
|
217
|
+
getConstantStatements() {
|
|
218
|
+
throw new Error("BUG - IifeEmitScope should not expose any constant statements");
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
|
|
223
|
+
import semver from "semver";
|
|
224
|
+
|
|
225
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/get_source_file.mjs
|
|
226
|
+
function createGetSourceFile(sourceUrl, code, loader) {
|
|
227
|
+
if (loader === null) {
|
|
228
|
+
return () => null;
|
|
229
|
+
} else {
|
|
230
|
+
let sourceFile = void 0;
|
|
231
|
+
return () => {
|
|
232
|
+
if (sourceFile === void 0) {
|
|
233
|
+
sourceFile = loader.loadSourceFile(sourceUrl, code);
|
|
234
|
+
}
|
|
235
|
+
return sourceFile;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.mjs
|
|
241
|
+
import { compileClassMetadata } from "@angular/compiler";
|
|
242
|
+
var PartialClassMetadataLinkerVersion1 = class {
|
|
243
|
+
linkPartialDeclaration(constantPool, metaObj) {
|
|
244
|
+
const meta = toR3ClassMetadata(metaObj);
|
|
245
|
+
return compileClassMetadata(meta);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
function toR3ClassMetadata(metaObj) {
|
|
249
|
+
return {
|
|
250
|
+
type: metaObj.getOpaque("type"),
|
|
251
|
+
decorators: metaObj.getOpaque("decorators"),
|
|
252
|
+
ctorParameters: metaObj.has("ctorParameters") ? metaObj.getOpaque("ctorParameters") : null,
|
|
253
|
+
propDecorators: metaObj.has("propDecorators") ? metaObj.getOpaque("propDecorators") : null
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
|
|
258
|
+
import { ChangeDetectionStrategy, compileComponentFromMetadata, DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, makeBindingParser as makeBindingParser2, parseTemplate, ViewEncapsulation } from "@angular/compiler";
|
|
259
|
+
|
|
260
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
|
|
261
|
+
import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSourceFile, ParseSourceSpan } from "@angular/compiler";
|
|
262
|
+
|
|
263
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/util.mjs
|
|
264
|
+
import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
|
|
265
|
+
function wrapReference(wrapped) {
|
|
266
|
+
return { value: wrapped, type: wrapped };
|
|
267
|
+
}
|
|
268
|
+
function parseEnum(value, Enum) {
|
|
269
|
+
const symbolName = value.getSymbolName();
|
|
270
|
+
if (symbolName === null) {
|
|
271
|
+
throw new FatalLinkerError(value.expression, "Expected value to have a symbol name");
|
|
272
|
+
}
|
|
273
|
+
const enumValue = Enum[symbolName];
|
|
274
|
+
if (enumValue === void 0) {
|
|
275
|
+
throw new FatalLinkerError(value.expression, `Unsupported enum value for ${Enum}`);
|
|
276
|
+
}
|
|
277
|
+
return enumValue;
|
|
278
|
+
}
|
|
279
|
+
function getDependency(depObj) {
|
|
280
|
+
const isAttribute = depObj.has("attribute") && depObj.getBoolean("attribute");
|
|
281
|
+
const token = depObj.getOpaque("token");
|
|
282
|
+
const attributeNameType = isAttribute ? o2.literal("unknown") : null;
|
|
283
|
+
return {
|
|
284
|
+
token,
|
|
285
|
+
attributeNameType,
|
|
286
|
+
host: depObj.has("host") && depObj.getBoolean("host"),
|
|
287
|
+
optional: depObj.has("optional") && depObj.getBoolean("optional"),
|
|
288
|
+
self: depObj.has("self") && depObj.getBoolean("self"),
|
|
289
|
+
skipSelf: depObj.has("skipSelf") && depObj.getBoolean("skipSelf")
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
function extractForwardRef(expr) {
|
|
293
|
+
if (!expr.isCallExpression()) {
|
|
294
|
+
return createMayBeForwardRefExpression(expr.getOpaque(), 0);
|
|
295
|
+
}
|
|
296
|
+
const callee = expr.getCallee();
|
|
297
|
+
if (callee.getSymbolName() !== "forwardRef") {
|
|
298
|
+
throw new FatalLinkerError(callee.expression, "Unsupported expression, expected a `forwardRef()` call or a type reference");
|
|
299
|
+
}
|
|
300
|
+
const args = expr.getArguments();
|
|
301
|
+
if (args.length !== 1) {
|
|
302
|
+
throw new FatalLinkerError(expr, "Unsupported `forwardRef(fn)` call, expected a single argument");
|
|
303
|
+
}
|
|
304
|
+
const wrapperFn = args[0];
|
|
305
|
+
if (!wrapperFn.isFunction()) {
|
|
306
|
+
throw new FatalLinkerError(wrapperFn, "Unsupported `forwardRef(fn)` call, expected its argument to be a function");
|
|
307
|
+
}
|
|
308
|
+
return createMayBeForwardRefExpression(wrapperFn.getFunctionReturnValue().getOpaque(), 2);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
|
|
312
|
+
var PartialDirectiveLinkerVersion1 = class {
|
|
313
|
+
constructor(sourceUrl, code) {
|
|
314
|
+
this.sourceUrl = sourceUrl;
|
|
315
|
+
this.code = code;
|
|
316
|
+
}
|
|
317
|
+
linkPartialDeclaration(constantPool, metaObj) {
|
|
318
|
+
const meta = toR3DirectiveMeta(metaObj, this.code, this.sourceUrl);
|
|
319
|
+
const def = compileDirectiveFromMetadata(meta, constantPool, makeBindingParser());
|
|
320
|
+
return def.expression;
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
function toR3DirectiveMeta(metaObj, code, sourceUrl) {
|
|
324
|
+
const typeExpr = metaObj.getValue("type");
|
|
325
|
+
const typeName = typeExpr.getSymbolName();
|
|
326
|
+
if (typeName === null) {
|
|
327
|
+
throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
typeSourceSpan: createSourceSpan(typeExpr.getRange(), code, sourceUrl),
|
|
331
|
+
type: wrapReference(typeExpr.getOpaque()),
|
|
332
|
+
typeArgumentCount: 0,
|
|
333
|
+
internalType: metaObj.getOpaque("type"),
|
|
334
|
+
deps: null,
|
|
335
|
+
host: toHostMetadata(metaObj),
|
|
336
|
+
inputs: metaObj.has("inputs") ? metaObj.getObject("inputs").toLiteral(toInputMapping) : {},
|
|
337
|
+
outputs: metaObj.has("outputs") ? metaObj.getObject("outputs").toLiteral((value) => value.getString()) : {},
|
|
338
|
+
queries: metaObj.has("queries") ? metaObj.getArray("queries").map((entry) => toQueryMetadata(entry.getObject())) : [],
|
|
339
|
+
viewQueries: metaObj.has("viewQueries") ? metaObj.getArray("viewQueries").map((entry) => toQueryMetadata(entry.getObject())) : [],
|
|
340
|
+
providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
|
|
341
|
+
fullInheritance: false,
|
|
342
|
+
selector: metaObj.has("selector") ? metaObj.getString("selector") : null,
|
|
343
|
+
exportAs: metaObj.has("exportAs") ? metaObj.getArray("exportAs").map((entry) => entry.getString()) : null,
|
|
344
|
+
lifecycle: {
|
|
345
|
+
usesOnChanges: metaObj.has("usesOnChanges") ? metaObj.getBoolean("usesOnChanges") : false
|
|
346
|
+
},
|
|
347
|
+
name: typeName,
|
|
348
|
+
usesInheritance: metaObj.has("usesInheritance") ? metaObj.getBoolean("usesInheritance") : false
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function toInputMapping(value) {
|
|
352
|
+
if (value.isString()) {
|
|
353
|
+
return value.getString();
|
|
354
|
+
}
|
|
355
|
+
const values = value.getArray().map((innerValue) => innerValue.getString());
|
|
356
|
+
if (values.length !== 2) {
|
|
357
|
+
throw new FatalLinkerError(value.expression, "Unsupported input, expected a string or an array containing exactly two strings");
|
|
358
|
+
}
|
|
359
|
+
return values;
|
|
360
|
+
}
|
|
361
|
+
function toHostMetadata(metaObj) {
|
|
362
|
+
if (!metaObj.has("host")) {
|
|
363
|
+
return {
|
|
364
|
+
attributes: {},
|
|
365
|
+
listeners: {},
|
|
366
|
+
properties: {},
|
|
367
|
+
specialAttributes: {}
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
const host = metaObj.getObject("host");
|
|
371
|
+
const specialAttributes = {};
|
|
372
|
+
if (host.has("styleAttribute")) {
|
|
373
|
+
specialAttributes.styleAttr = host.getString("styleAttribute");
|
|
374
|
+
}
|
|
375
|
+
if (host.has("classAttribute")) {
|
|
376
|
+
specialAttributes.classAttr = host.getString("classAttribute");
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
attributes: host.has("attributes") ? host.getObject("attributes").toLiteral((value) => value.getOpaque()) : {},
|
|
380
|
+
listeners: host.has("listeners") ? host.getObject("listeners").toLiteral((value) => value.getString()) : {},
|
|
381
|
+
properties: host.has("properties") ? host.getObject("properties").toLiteral((value) => value.getString()) : {},
|
|
382
|
+
specialAttributes
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
function toQueryMetadata(obj) {
|
|
386
|
+
let predicate;
|
|
387
|
+
const predicateExpr = obj.getValue("predicate");
|
|
388
|
+
if (predicateExpr.isArray()) {
|
|
389
|
+
predicate = predicateExpr.getArray().map((entry) => entry.getString());
|
|
390
|
+
} else {
|
|
391
|
+
predicate = extractForwardRef(predicateExpr);
|
|
392
|
+
}
|
|
393
|
+
return {
|
|
394
|
+
propertyName: obj.getString("propertyName"),
|
|
395
|
+
first: obj.has("first") ? obj.getBoolean("first") : false,
|
|
396
|
+
predicate,
|
|
397
|
+
descendants: obj.has("descendants") ? obj.getBoolean("descendants") : false,
|
|
398
|
+
emitDistinctChangesOnly: obj.has("emitDistinctChangesOnly") ? obj.getBoolean("emitDistinctChangesOnly") : true,
|
|
399
|
+
read: obj.has("read") ? obj.getOpaque("read") : null,
|
|
400
|
+
static: obj.has("static") ? obj.getBoolean("static") : false
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
function createSourceSpan(range, code, sourceUrl) {
|
|
404
|
+
const sourceFile = new ParseSourceFile(code, sourceUrl);
|
|
405
|
+
const startLocation = new ParseLocation(sourceFile, range.startPos, range.startLine, range.startCol);
|
|
406
|
+
return new ParseSourceSpan(startLocation, startLocation.moveBy(range.endPos - range.startPos));
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
|
|
410
|
+
var PartialComponentLinkerVersion1 = class {
|
|
411
|
+
constructor(getSourceFile, sourceUrl, code) {
|
|
412
|
+
this.getSourceFile = getSourceFile;
|
|
413
|
+
this.sourceUrl = sourceUrl;
|
|
414
|
+
this.code = code;
|
|
415
|
+
}
|
|
416
|
+
linkPartialDeclaration(constantPool, metaObj) {
|
|
417
|
+
const meta = this.toR3ComponentMeta(metaObj);
|
|
418
|
+
const def = compileComponentFromMetadata(meta, constantPool, makeBindingParser2());
|
|
419
|
+
return def.expression;
|
|
420
|
+
}
|
|
421
|
+
toR3ComponentMeta(metaObj) {
|
|
422
|
+
const interpolation = parseInterpolationConfig(metaObj);
|
|
423
|
+
const templateSource = metaObj.getValue("template");
|
|
424
|
+
const isInline = metaObj.has("isInline") ? metaObj.getBoolean("isInline") : false;
|
|
425
|
+
const templateInfo = this.getTemplateInfo(templateSource, isInline);
|
|
426
|
+
const template = parseTemplate(templateInfo.code, templateInfo.sourceUrl, {
|
|
427
|
+
escapedString: templateInfo.isEscaped,
|
|
428
|
+
interpolationConfig: interpolation,
|
|
429
|
+
range: templateInfo.range,
|
|
430
|
+
enableI18nLegacyMessageIdFormat: false,
|
|
431
|
+
preserveWhitespaces: metaObj.has("preserveWhitespaces") ? metaObj.getBoolean("preserveWhitespaces") : false,
|
|
432
|
+
i18nNormalizeLineEndingsInICUs: isInline
|
|
433
|
+
});
|
|
434
|
+
if (template.errors !== null) {
|
|
435
|
+
const errors = template.errors.map((err) => err.toString()).join("\n");
|
|
436
|
+
throw new FatalLinkerError(templateSource.expression, `Errors found in the template:
|
|
437
|
+
${errors}`);
|
|
438
|
+
}
|
|
439
|
+
let declarationListEmitMode = 0;
|
|
440
|
+
const collectUsedDirectives = (directives2) => {
|
|
441
|
+
return directives2.map((directive) => {
|
|
442
|
+
const directiveExpr = directive.getObject();
|
|
443
|
+
const type = directiveExpr.getValue("type");
|
|
444
|
+
const selector = directiveExpr.getString("selector");
|
|
445
|
+
const { expression: typeExpr, forwardRef } = extractForwardRef(type);
|
|
446
|
+
if (forwardRef === 2) {
|
|
447
|
+
declarationListEmitMode = 1;
|
|
448
|
+
}
|
|
449
|
+
return {
|
|
450
|
+
type: typeExpr,
|
|
451
|
+
selector,
|
|
452
|
+
inputs: directiveExpr.has("inputs") ? directiveExpr.getArray("inputs").map((input) => input.getString()) : [],
|
|
453
|
+
outputs: directiveExpr.has("outputs") ? directiveExpr.getArray("outputs").map((input) => input.getString()) : [],
|
|
454
|
+
exportAs: directiveExpr.has("exportAs") ? directiveExpr.getArray("exportAs").map((exportAs) => exportAs.getString()) : null
|
|
455
|
+
};
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
let directives = [];
|
|
459
|
+
if (metaObj.has("components")) {
|
|
460
|
+
directives.push(...collectUsedDirectives(metaObj.getArray("components")));
|
|
461
|
+
}
|
|
462
|
+
if (metaObj.has("directives")) {
|
|
463
|
+
directives.push(...collectUsedDirectives(metaObj.getArray("directives")));
|
|
464
|
+
}
|
|
465
|
+
let pipes = new Map();
|
|
466
|
+
if (metaObj.has("pipes")) {
|
|
467
|
+
pipes = metaObj.getObject("pipes").toMap((pipe) => {
|
|
468
|
+
const { expression: pipeType, forwardRef } = extractForwardRef(pipe);
|
|
469
|
+
if (forwardRef === 2) {
|
|
470
|
+
declarationListEmitMode = 1;
|
|
471
|
+
}
|
|
472
|
+
return pipeType;
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
return __spreadProps(__spreadValues({}, toR3DirectiveMeta(metaObj, this.code, this.sourceUrl)), {
|
|
476
|
+
viewProviders: metaObj.has("viewProviders") ? metaObj.getOpaque("viewProviders") : null,
|
|
477
|
+
template: {
|
|
478
|
+
nodes: template.nodes,
|
|
479
|
+
ngContentSelectors: template.ngContentSelectors
|
|
480
|
+
},
|
|
481
|
+
declarationListEmitMode,
|
|
482
|
+
styles: metaObj.has("styles") ? metaObj.getArray("styles").map((entry) => entry.getString()) : [],
|
|
483
|
+
encapsulation: metaObj.has("encapsulation") ? parseEncapsulation(metaObj.getValue("encapsulation")) : ViewEncapsulation.Emulated,
|
|
484
|
+
interpolation,
|
|
485
|
+
changeDetection: metaObj.has("changeDetection") ? parseChangeDetectionStrategy(metaObj.getValue("changeDetection")) : ChangeDetectionStrategy.Default,
|
|
486
|
+
animations: metaObj.has("animations") ? metaObj.getOpaque("animations") : null,
|
|
487
|
+
relativeContextFilePath: this.sourceUrl,
|
|
488
|
+
i18nUseExternalIds: false,
|
|
489
|
+
pipes,
|
|
490
|
+
directives
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
getTemplateInfo(templateNode, isInline) {
|
|
494
|
+
const range = templateNode.getRange();
|
|
495
|
+
if (!isInline) {
|
|
496
|
+
const externalTemplate = this.tryExternalTemplate(range);
|
|
497
|
+
if (externalTemplate !== null) {
|
|
498
|
+
return externalTemplate;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return this.templateFromPartialCode(templateNode, range);
|
|
502
|
+
}
|
|
503
|
+
tryExternalTemplate(range) {
|
|
504
|
+
const sourceFile = this.getSourceFile();
|
|
505
|
+
if (sourceFile === null) {
|
|
506
|
+
return null;
|
|
507
|
+
}
|
|
508
|
+
const pos = sourceFile.getOriginalLocation(range.startLine, range.startCol);
|
|
509
|
+
if (pos === null || pos.file === this.sourceUrl || /\.[jt]s$/.test(pos.file) || pos.line !== 0 || pos.column !== 0) {
|
|
510
|
+
return null;
|
|
511
|
+
}
|
|
512
|
+
const templateContents = sourceFile.sources.find((src) => (src == null ? void 0 : src.sourcePath) === pos.file).contents;
|
|
513
|
+
return {
|
|
514
|
+
code: templateContents,
|
|
515
|
+
sourceUrl: pos.file,
|
|
516
|
+
range: { startPos: 0, startLine: 0, startCol: 0, endPos: templateContents.length },
|
|
517
|
+
isEscaped: false
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
templateFromPartialCode(templateNode, { startPos, endPos, startLine, startCol }) {
|
|
521
|
+
if (!/["'`]/.test(this.code[startPos]) || this.code[startPos] !== this.code[endPos - 1]) {
|
|
522
|
+
throw new FatalLinkerError(templateNode.expression, `Expected the template string to be wrapped in quotes but got: ${this.code.substring(startPos, endPos)}`);
|
|
523
|
+
}
|
|
524
|
+
return {
|
|
525
|
+
code: this.code,
|
|
526
|
+
sourceUrl: this.sourceUrl,
|
|
527
|
+
range: { startPos: startPos + 1, endPos: endPos - 1, startLine, startCol: startCol + 1 },
|
|
528
|
+
isEscaped: true
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
function parseInterpolationConfig(metaObj) {
|
|
533
|
+
if (!metaObj.has("interpolation")) {
|
|
534
|
+
return DEFAULT_INTERPOLATION_CONFIG;
|
|
535
|
+
}
|
|
536
|
+
const interpolationExpr = metaObj.getValue("interpolation");
|
|
537
|
+
const values = interpolationExpr.getArray().map((entry) => entry.getString());
|
|
538
|
+
if (values.length !== 2) {
|
|
539
|
+
throw new FatalLinkerError(interpolationExpr.expression, "Unsupported interpolation config, expected an array containing exactly two strings");
|
|
540
|
+
}
|
|
541
|
+
return InterpolationConfig.fromArray(values);
|
|
542
|
+
}
|
|
543
|
+
function parseEncapsulation(encapsulation) {
|
|
544
|
+
const symbolName = encapsulation.getSymbolName();
|
|
545
|
+
if (symbolName === null) {
|
|
546
|
+
throw new FatalLinkerError(encapsulation.expression, "Expected encapsulation to have a symbol name");
|
|
547
|
+
}
|
|
548
|
+
const enumValue = ViewEncapsulation[symbolName];
|
|
549
|
+
if (enumValue === void 0) {
|
|
550
|
+
throw new FatalLinkerError(encapsulation.expression, "Unsupported encapsulation");
|
|
551
|
+
}
|
|
552
|
+
return enumValue;
|
|
553
|
+
}
|
|
554
|
+
function parseChangeDetectionStrategy(changeDetectionStrategy) {
|
|
555
|
+
const symbolName = changeDetectionStrategy.getSymbolName();
|
|
556
|
+
if (symbolName === null) {
|
|
557
|
+
throw new FatalLinkerError(changeDetectionStrategy.expression, "Expected change detection strategy to have a symbol name");
|
|
558
|
+
}
|
|
559
|
+
const enumValue = ChangeDetectionStrategy[symbolName];
|
|
560
|
+
if (enumValue === void 0) {
|
|
561
|
+
throw new FatalLinkerError(changeDetectionStrategy.expression, "Unsupported change detection strategy");
|
|
562
|
+
}
|
|
563
|
+
return enumValue;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_factory_linker_1.mjs
|
|
567
|
+
import { compileFactoryFunction, FactoryTarget } from "@angular/compiler";
|
|
568
|
+
var PartialFactoryLinkerVersion1 = class {
|
|
569
|
+
linkPartialDeclaration(constantPool, metaObj) {
|
|
570
|
+
const meta = toR3FactoryMeta(metaObj);
|
|
571
|
+
const def = compileFactoryFunction(meta);
|
|
572
|
+
return def.expression;
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
function toR3FactoryMeta(metaObj) {
|
|
576
|
+
const typeExpr = metaObj.getValue("type");
|
|
577
|
+
const typeName = typeExpr.getSymbolName();
|
|
578
|
+
if (typeName === null) {
|
|
579
|
+
throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
|
|
580
|
+
}
|
|
581
|
+
return {
|
|
582
|
+
name: typeName,
|
|
583
|
+
type: wrapReference(typeExpr.getOpaque()),
|
|
584
|
+
internalType: metaObj.getOpaque("type"),
|
|
585
|
+
typeArgumentCount: 0,
|
|
586
|
+
target: parseEnum(metaObj.getValue("target"), FactoryTarget),
|
|
587
|
+
deps: getDependencies(metaObj, "deps")
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
function getDependencies(metaObj, propName) {
|
|
591
|
+
if (!metaObj.has(propName)) {
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
const deps = metaObj.getValue(propName);
|
|
595
|
+
if (deps.isArray()) {
|
|
596
|
+
return deps.getArray().map((dep) => getDependency(dep.getObject()));
|
|
597
|
+
}
|
|
598
|
+
if (deps.isString()) {
|
|
599
|
+
return "invalid";
|
|
600
|
+
}
|
|
601
|
+
return null;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.mjs
|
|
605
|
+
import { compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, outputAst as o3 } from "@angular/compiler";
|
|
606
|
+
var PartialInjectableLinkerVersion1 = class {
|
|
607
|
+
linkPartialDeclaration(constantPool, metaObj) {
|
|
608
|
+
const meta = toR3InjectableMeta(metaObj);
|
|
609
|
+
const def = compileInjectable(meta, false);
|
|
610
|
+
return def.expression;
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
function toR3InjectableMeta(metaObj) {
|
|
614
|
+
const typeExpr = metaObj.getValue("type");
|
|
615
|
+
const typeName = typeExpr.getSymbolName();
|
|
616
|
+
if (typeName === null) {
|
|
617
|
+
throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
|
|
618
|
+
}
|
|
619
|
+
const meta = {
|
|
620
|
+
name: typeName,
|
|
621
|
+
type: wrapReference(typeExpr.getOpaque()),
|
|
622
|
+
internalType: typeExpr.getOpaque(),
|
|
623
|
+
typeArgumentCount: 0,
|
|
624
|
+
providedIn: metaObj.has("providedIn") ? extractForwardRef(metaObj.getValue("providedIn")) : createMayBeForwardRefExpression2(o3.literal(null), 0)
|
|
625
|
+
};
|
|
626
|
+
if (metaObj.has("useClass")) {
|
|
627
|
+
meta.useClass = extractForwardRef(metaObj.getValue("useClass"));
|
|
628
|
+
}
|
|
629
|
+
if (metaObj.has("useFactory")) {
|
|
630
|
+
meta.useFactory = metaObj.getOpaque("useFactory");
|
|
631
|
+
}
|
|
632
|
+
if (metaObj.has("useExisting")) {
|
|
633
|
+
meta.useExisting = extractForwardRef(metaObj.getValue("useExisting"));
|
|
634
|
+
}
|
|
635
|
+
if (metaObj.has("useValue")) {
|
|
636
|
+
meta.useValue = extractForwardRef(metaObj.getValue("useValue"));
|
|
637
|
+
}
|
|
638
|
+
if (metaObj.has("deps")) {
|
|
639
|
+
meta.deps = metaObj.getArray("deps").map((dep) => getDependency(dep.getObject()));
|
|
640
|
+
}
|
|
641
|
+
return meta;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1.mjs
|
|
645
|
+
import { compileInjector } from "@angular/compiler";
|
|
646
|
+
var PartialInjectorLinkerVersion1 = class {
|
|
647
|
+
linkPartialDeclaration(constantPool, metaObj) {
|
|
648
|
+
const meta = toR3InjectorMeta(metaObj);
|
|
649
|
+
const def = compileInjector(meta);
|
|
650
|
+
return def.expression;
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
function toR3InjectorMeta(metaObj) {
|
|
654
|
+
const typeExpr = metaObj.getValue("type");
|
|
655
|
+
const typeName = typeExpr.getSymbolName();
|
|
656
|
+
if (typeName === null) {
|
|
657
|
+
throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
|
|
658
|
+
}
|
|
659
|
+
return {
|
|
660
|
+
name: typeName,
|
|
661
|
+
type: wrapReference(typeExpr.getOpaque()),
|
|
662
|
+
internalType: metaObj.getOpaque("type"),
|
|
663
|
+
providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
|
|
664
|
+
imports: metaObj.has("imports") ? metaObj.getArray("imports").map((i) => i.getOpaque()) : []
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.mjs
|
|
669
|
+
import { compileNgModule } from "@angular/compiler";
|
|
670
|
+
var PartialNgModuleLinkerVersion1 = class {
|
|
671
|
+
constructor(emitInline) {
|
|
672
|
+
this.emitInline = emitInline;
|
|
673
|
+
}
|
|
674
|
+
linkPartialDeclaration(constantPool, metaObj) {
|
|
675
|
+
const meta = toR3NgModuleMeta(metaObj, this.emitInline);
|
|
676
|
+
const def = compileNgModule(meta);
|
|
677
|
+
return def.expression;
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
function toR3NgModuleMeta(metaObj, emitInline) {
|
|
681
|
+
const wrappedType = metaObj.getOpaque("type");
|
|
682
|
+
const meta = {
|
|
683
|
+
type: wrapReference(wrappedType),
|
|
684
|
+
internalType: wrappedType,
|
|
685
|
+
adjacentType: wrappedType,
|
|
686
|
+
bootstrap: [],
|
|
687
|
+
declarations: [],
|
|
688
|
+
imports: [],
|
|
689
|
+
exports: [],
|
|
690
|
+
emitInline,
|
|
691
|
+
containsForwardDecls: false,
|
|
692
|
+
schemas: [],
|
|
693
|
+
id: metaObj.has("id") ? metaObj.getOpaque("id") : null
|
|
694
|
+
};
|
|
695
|
+
if (metaObj.has("bootstrap")) {
|
|
696
|
+
const bootstrap = metaObj.getValue("bootstrap");
|
|
697
|
+
if (bootstrap.isFunction()) {
|
|
698
|
+
meta.containsForwardDecls = true;
|
|
699
|
+
meta.bootstrap = wrapReferences(unwrapForwardRefs(bootstrap));
|
|
700
|
+
} else
|
|
701
|
+
meta.bootstrap = wrapReferences(bootstrap);
|
|
702
|
+
}
|
|
703
|
+
if (metaObj.has("declarations")) {
|
|
704
|
+
const declarations = metaObj.getValue("declarations");
|
|
705
|
+
if (declarations.isFunction()) {
|
|
706
|
+
meta.containsForwardDecls = true;
|
|
707
|
+
meta.declarations = wrapReferences(unwrapForwardRefs(declarations));
|
|
708
|
+
} else
|
|
709
|
+
meta.declarations = wrapReferences(declarations);
|
|
710
|
+
}
|
|
711
|
+
if (metaObj.has("imports")) {
|
|
712
|
+
const imports = metaObj.getValue("imports");
|
|
713
|
+
if (imports.isFunction()) {
|
|
714
|
+
meta.containsForwardDecls = true;
|
|
715
|
+
meta.imports = wrapReferences(unwrapForwardRefs(imports));
|
|
716
|
+
} else
|
|
717
|
+
meta.imports = wrapReferences(imports);
|
|
718
|
+
}
|
|
719
|
+
if (metaObj.has("exports")) {
|
|
720
|
+
const exports = metaObj.getValue("exports");
|
|
721
|
+
if (exports.isFunction()) {
|
|
722
|
+
meta.containsForwardDecls = true;
|
|
723
|
+
meta.exports = wrapReferences(unwrapForwardRefs(exports));
|
|
724
|
+
} else
|
|
725
|
+
meta.exports = wrapReferences(exports);
|
|
726
|
+
}
|
|
727
|
+
if (metaObj.has("schemas")) {
|
|
728
|
+
const schemas = metaObj.getValue("schemas");
|
|
729
|
+
meta.schemas = wrapReferences(schemas);
|
|
730
|
+
}
|
|
731
|
+
return meta;
|
|
732
|
+
}
|
|
733
|
+
function unwrapForwardRefs(field) {
|
|
734
|
+
return field.getFunctionReturnValue();
|
|
735
|
+
}
|
|
736
|
+
function wrapReferences(values) {
|
|
737
|
+
return values.getArray().map((i) => wrapReference(i.getOpaque()));
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.mjs
|
|
741
|
+
import { compilePipeFromMetadata } from "@angular/compiler";
|
|
742
|
+
var PartialPipeLinkerVersion1 = class {
|
|
743
|
+
constructor() {
|
|
744
|
+
}
|
|
745
|
+
linkPartialDeclaration(constantPool, metaObj) {
|
|
746
|
+
const meta = toR3PipeMeta(metaObj);
|
|
747
|
+
const def = compilePipeFromMetadata(meta);
|
|
748
|
+
return def.expression;
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
function toR3PipeMeta(metaObj) {
|
|
752
|
+
const typeExpr = metaObj.getValue("type");
|
|
753
|
+
const typeName = typeExpr.getSymbolName();
|
|
754
|
+
if (typeName === null) {
|
|
755
|
+
throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
|
|
756
|
+
}
|
|
757
|
+
const pure = metaObj.has("pure") ? metaObj.getBoolean("pure") : true;
|
|
758
|
+
return {
|
|
759
|
+
name: typeName,
|
|
760
|
+
type: wrapReference(typeExpr.getOpaque()),
|
|
761
|
+
internalType: metaObj.getOpaque("type"),
|
|
762
|
+
typeArgumentCount: 0,
|
|
763
|
+
deps: null,
|
|
764
|
+
pipeName: metaObj.getString("name"),
|
|
765
|
+
pure
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
|
|
770
|
+
var \u0275\u0275ngDeclareDirective = "\u0275\u0275ngDeclareDirective";
|
|
771
|
+
var \u0275\u0275ngDeclareClassMetadata = "\u0275\u0275ngDeclareClassMetadata";
|
|
772
|
+
var \u0275\u0275ngDeclareComponent = "\u0275\u0275ngDeclareComponent";
|
|
773
|
+
var \u0275\u0275ngDeclareFactory = "\u0275\u0275ngDeclareFactory";
|
|
774
|
+
var \u0275\u0275ngDeclareInjectable = "\u0275\u0275ngDeclareInjectable";
|
|
775
|
+
var \u0275\u0275ngDeclareInjector = "\u0275\u0275ngDeclareInjector";
|
|
776
|
+
var \u0275\u0275ngDeclareNgModule = "\u0275\u0275ngDeclareNgModule";
|
|
777
|
+
var \u0275\u0275ngDeclarePipe = "\u0275\u0275ngDeclarePipe";
|
|
778
|
+
var declarationFunctions = [
|
|
779
|
+
\u0275\u0275ngDeclareDirective,
|
|
780
|
+
\u0275\u0275ngDeclareClassMetadata,
|
|
781
|
+
\u0275\u0275ngDeclareComponent,
|
|
782
|
+
\u0275\u0275ngDeclareFactory,
|
|
783
|
+
\u0275\u0275ngDeclareInjectable,
|
|
784
|
+
\u0275\u0275ngDeclareInjector,
|
|
785
|
+
\u0275\u0275ngDeclareNgModule,
|
|
786
|
+
\u0275\u0275ngDeclarePipe
|
|
787
|
+
];
|
|
788
|
+
function createLinkerMap(environment, sourceUrl, code) {
|
|
789
|
+
const linkers = new Map();
|
|
790
|
+
const LATEST_VERSION_RANGE = getRange("<=", "13.1.0-next.1");
|
|
791
|
+
linkers.set(\u0275\u0275ngDeclareDirective, [
|
|
792
|
+
{ range: LATEST_VERSION_RANGE, linker: new PartialDirectiveLinkerVersion1(sourceUrl, code) }
|
|
793
|
+
]);
|
|
794
|
+
linkers.set(\u0275\u0275ngDeclareClassMetadata, [
|
|
795
|
+
{ range: LATEST_VERSION_RANGE, linker: new PartialClassMetadataLinkerVersion1() }
|
|
796
|
+
]);
|
|
797
|
+
linkers.set(\u0275\u0275ngDeclareComponent, [
|
|
798
|
+
{
|
|
799
|
+
range: LATEST_VERSION_RANGE,
|
|
800
|
+
linker: new PartialComponentLinkerVersion1(createGetSourceFile(sourceUrl, code, environment.sourceFileLoader), sourceUrl, code)
|
|
801
|
+
}
|
|
802
|
+
]);
|
|
803
|
+
linkers.set(\u0275\u0275ngDeclareFactory, [
|
|
804
|
+
{ range: LATEST_VERSION_RANGE, linker: new PartialFactoryLinkerVersion1() }
|
|
805
|
+
]);
|
|
806
|
+
linkers.set(\u0275\u0275ngDeclareInjectable, [
|
|
807
|
+
{ range: LATEST_VERSION_RANGE, linker: new PartialInjectableLinkerVersion1() }
|
|
808
|
+
]);
|
|
809
|
+
linkers.set(\u0275\u0275ngDeclareInjector, [
|
|
810
|
+
{ range: LATEST_VERSION_RANGE, linker: new PartialInjectorLinkerVersion1() }
|
|
811
|
+
]);
|
|
812
|
+
linkers.set(\u0275\u0275ngDeclareNgModule, [
|
|
813
|
+
{
|
|
814
|
+
range: LATEST_VERSION_RANGE,
|
|
815
|
+
linker: new PartialNgModuleLinkerVersion1(environment.options.linkerJitMode)
|
|
816
|
+
}
|
|
817
|
+
]);
|
|
818
|
+
linkers.set(\u0275\u0275ngDeclarePipe, [
|
|
819
|
+
{ range: LATEST_VERSION_RANGE, linker: new PartialPipeLinkerVersion1() }
|
|
820
|
+
]);
|
|
821
|
+
return linkers;
|
|
822
|
+
}
|
|
823
|
+
var PartialLinkerSelector = class {
|
|
824
|
+
constructor(linkers, logger, unknownDeclarationVersionHandling) {
|
|
825
|
+
this.linkers = linkers;
|
|
826
|
+
this.logger = logger;
|
|
827
|
+
this.unknownDeclarationVersionHandling = unknownDeclarationVersionHandling;
|
|
828
|
+
}
|
|
829
|
+
supportsDeclaration(functionName) {
|
|
830
|
+
return this.linkers.has(functionName);
|
|
831
|
+
}
|
|
832
|
+
getLinker(functionName, minVersion, version) {
|
|
833
|
+
if (!this.linkers.has(functionName)) {
|
|
834
|
+
throw new Error(`Unknown partial declaration function ${functionName}.`);
|
|
835
|
+
}
|
|
836
|
+
const linkerRanges = this.linkers.get(functionName);
|
|
837
|
+
if (version === "13.1.0-next.1") {
|
|
838
|
+
return linkerRanges[linkerRanges.length - 1].linker;
|
|
839
|
+
}
|
|
840
|
+
const declarationRange = getRange(">=", minVersion);
|
|
841
|
+
for (const { range: linkerRange, linker } of linkerRanges) {
|
|
842
|
+
if (semver.intersects(declarationRange, linkerRange)) {
|
|
843
|
+
return linker;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
const message = `This application depends upon a library published using Angular version ${version}, which requires Angular version ${minVersion} or newer to work correctly.
|
|
847
|
+
Consider upgrading your application to use a more recent version of Angular.`;
|
|
848
|
+
if (this.unknownDeclarationVersionHandling === "error") {
|
|
849
|
+
throw new Error(message);
|
|
850
|
+
} else if (this.unknownDeclarationVersionHandling === "warn") {
|
|
851
|
+
this.logger.warn(`${message}
|
|
852
|
+
Attempting to continue using this version of Angular.`);
|
|
853
|
+
}
|
|
854
|
+
return linkerRanges[linkerRanges.length - 1].linker;
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
function getRange(comparator, versionStr) {
|
|
858
|
+
const version = new semver.SemVer(versionStr);
|
|
859
|
+
version.prerelease = [];
|
|
860
|
+
return new semver.Range(`${comparator}${version.format()}`);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/file_linker.mjs
|
|
864
|
+
var FileLinker = class {
|
|
865
|
+
constructor(linkerEnvironment, sourceUrl, code) {
|
|
866
|
+
this.linkerEnvironment = linkerEnvironment;
|
|
867
|
+
this.emitScopes = new Map();
|
|
868
|
+
this.linkerSelector = new PartialLinkerSelector(createLinkerMap(this.linkerEnvironment, sourceUrl, code), this.linkerEnvironment.logger, this.linkerEnvironment.options.unknownDeclarationVersionHandling);
|
|
869
|
+
}
|
|
870
|
+
isPartialDeclaration(calleeName) {
|
|
871
|
+
return this.linkerSelector.supportsDeclaration(calleeName);
|
|
872
|
+
}
|
|
873
|
+
linkPartialDeclaration(declarationFn, args, declarationScope) {
|
|
874
|
+
if (args.length !== 1) {
|
|
875
|
+
throw new Error(`Invalid function call: It should have only a single object literal argument, but contained ${args.length}.`);
|
|
876
|
+
}
|
|
877
|
+
const metaObj = AstObject.parse(args[0], this.linkerEnvironment.host);
|
|
878
|
+
const ngImport = metaObj.getNode("ngImport");
|
|
879
|
+
const emitScope = this.getEmitScope(ngImport, declarationScope);
|
|
880
|
+
const minVersion = metaObj.getString("minVersion");
|
|
881
|
+
const version = metaObj.getString("version");
|
|
882
|
+
const linker = this.linkerSelector.getLinker(declarationFn, minVersion, version);
|
|
883
|
+
const definition = linker.linkPartialDeclaration(emitScope.constantPool, metaObj);
|
|
884
|
+
return emitScope.translateDefinition(definition);
|
|
885
|
+
}
|
|
886
|
+
getConstantStatements() {
|
|
887
|
+
const results = [];
|
|
888
|
+
for (const [constantScope, emitScope] of this.emitScopes.entries()) {
|
|
889
|
+
const statements = emitScope.getConstantStatements();
|
|
890
|
+
results.push({ constantScope, statements });
|
|
891
|
+
}
|
|
892
|
+
return results;
|
|
893
|
+
}
|
|
894
|
+
getEmitScope(ngImport, declarationScope) {
|
|
895
|
+
const constantScope = declarationScope.getConstantScopeRef(ngImport);
|
|
896
|
+
if (constantScope === null) {
|
|
897
|
+
return new IifeEmitScope(ngImport, this.linkerEnvironment.translator, this.linkerEnvironment.factory);
|
|
898
|
+
}
|
|
899
|
+
if (!this.emitScopes.has(constantScope)) {
|
|
900
|
+
this.emitScopes.set(constantScope, new EmitScope(ngImport, this.linkerEnvironment.translator));
|
|
901
|
+
}
|
|
902
|
+
return this.emitScopes.get(constantScope);
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_options.mjs
|
|
907
|
+
var DEFAULT_LINKER_OPTIONS = {
|
|
908
|
+
sourceMapping: true,
|
|
909
|
+
linkerJitMode: false,
|
|
910
|
+
unknownDeclarationVersionHandling: "error"
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/translator.mjs
|
|
914
|
+
var Translator = class {
|
|
915
|
+
constructor(factory) {
|
|
916
|
+
this.factory = factory;
|
|
917
|
+
}
|
|
918
|
+
translateExpression(expression, imports, options = {}) {
|
|
919
|
+
return expression.visitExpression(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(false));
|
|
920
|
+
}
|
|
921
|
+
translateStatement(statement, imports, options = {}) {
|
|
922
|
+
return statement.visitStatement(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(true));
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_environment.mjs
|
|
927
|
+
var LinkerEnvironment = class {
|
|
928
|
+
constructor(fileSystem, logger, host, factory, options) {
|
|
929
|
+
this.fileSystem = fileSystem;
|
|
930
|
+
this.logger = logger;
|
|
931
|
+
this.host = host;
|
|
932
|
+
this.factory = factory;
|
|
933
|
+
this.options = options;
|
|
934
|
+
this.translator = new Translator(this.factory);
|
|
935
|
+
this.sourceFileLoader = this.options.sourceMapping ? new SourceFileLoader(this.fileSystem, this.logger, {}) : null;
|
|
936
|
+
}
|
|
937
|
+
static create(fileSystem, logger, host, factory, options) {
|
|
938
|
+
var _a, _b, _c;
|
|
939
|
+
return new LinkerEnvironment(fileSystem, logger, host, factory, {
|
|
940
|
+
sourceMapping: (_a = options.sourceMapping) != null ? _a : DEFAULT_LINKER_OPTIONS.sourceMapping,
|
|
941
|
+
linkerJitMode: (_b = options.linkerJitMode) != null ? _b : DEFAULT_LINKER_OPTIONS.linkerJitMode,
|
|
942
|
+
unknownDeclarationVersionHandling: (_c = options.unknownDeclarationVersionHandling) != null ? _c : DEFAULT_LINKER_OPTIONS.unknownDeclarationVersionHandling
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/needs_linking.mjs
|
|
948
|
+
function needsLinking(path, source) {
|
|
949
|
+
return declarationFunctions.some((fn) => source.includes(fn));
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
export {
|
|
953
|
+
FatalLinkerError,
|
|
954
|
+
isFatalLinkerError,
|
|
955
|
+
assert,
|
|
956
|
+
FileLinker,
|
|
957
|
+
DEFAULT_LINKER_OPTIONS,
|
|
958
|
+
LinkerEnvironment,
|
|
959
|
+
needsLinking
|
|
960
|
+
};
|
|
961
|
+
/**
|
|
962
|
+
* @license
|
|
963
|
+
* Copyright Google LLC All Rights Reserved.
|
|
964
|
+
*
|
|
965
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
966
|
+
* found in the LICENSE file at https://angular.io/license
|
|
967
|
+
*/
|
|
968
|
+
//# sourceMappingURL=chunk-JNWO3JB2.js.map
|