1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | (function (factory) {
|
---|
9 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
10 | var v = factory(require, exports);
|
---|
11 | if (v !== undefined) module.exports = v;
|
---|
12 | }
|
---|
13 | else if (typeof define === "function" && define.amd) {
|
---|
14 | define("@angular/compiler-cli/src/transformers/program", ["require", "exports", "tslib", "@angular/compiler", "fs", "path", "typescript", "@angular/compiler-cli/src/diagnostics/translate_diagnostics", "@angular/compiler-cli/src/metadata/index", "@angular/compiler-cli/src/ngtsc/core/src/compiler", "@angular/compiler-cli/src/ngtsc/program", "@angular/compiler-cli/src/ngtsc/reflection", "@angular/compiler-cli/src/typescript_support", "@angular/compiler-cli/src/transformers/api", "@angular/compiler-cli/src/transformers/compiler_host", "@angular/compiler-cli/src/transformers/downlevel_decorators_transform", "@angular/compiler-cli/src/transformers/i18n", "@angular/compiler-cli/src/transformers/inline_resources", "@angular/compiler-cli/src/transformers/lower_expressions", "@angular/compiler-cli/src/transformers/metadata_cache", "@angular/compiler-cli/src/transformers/node_emitter_transform", "@angular/compiler-cli/src/transformers/r3_metadata_transform", "@angular/compiler-cli/src/transformers/r3_transform", "@angular/compiler-cli/src/transformers/util"], factory);
|
---|
15 | }
|
---|
16 | })(function (require, exports) {
|
---|
17 | "use strict";
|
---|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
19 | exports.createSrcToOutPathMapper = exports.createProgram = exports.resetTempProgramHandlerForTest = exports.setTempProgramHandlerForTest = void 0;
|
---|
20 | var tslib_1 = require("tslib");
|
---|
21 | var compiler_1 = require("@angular/compiler");
|
---|
22 | var fs = require("fs");
|
---|
23 | var path = require("path");
|
---|
24 | var ts = require("typescript");
|
---|
25 | var translate_diagnostics_1 = require("@angular/compiler-cli/src/diagnostics/translate_diagnostics");
|
---|
26 | var metadata_1 = require("@angular/compiler-cli/src/metadata/index");
|
---|
27 | var compiler_2 = require("@angular/compiler-cli/src/ngtsc/core/src/compiler");
|
---|
28 | var program_1 = require("@angular/compiler-cli/src/ngtsc/program");
|
---|
29 | var reflection_1 = require("@angular/compiler-cli/src/ngtsc/reflection");
|
---|
30 | var typescript_support_1 = require("@angular/compiler-cli/src/typescript_support");
|
---|
31 | var api_1 = require("@angular/compiler-cli/src/transformers/api");
|
---|
32 | var compiler_host_1 = require("@angular/compiler-cli/src/transformers/compiler_host");
|
---|
33 | var downlevel_decorators_transform_1 = require("@angular/compiler-cli/src/transformers/downlevel_decorators_transform");
|
---|
34 | var i18n_1 = require("@angular/compiler-cli/src/transformers/i18n");
|
---|
35 | var inline_resources_1 = require("@angular/compiler-cli/src/transformers/inline_resources");
|
---|
36 | var lower_expressions_1 = require("@angular/compiler-cli/src/transformers/lower_expressions");
|
---|
37 | var metadata_cache_1 = require("@angular/compiler-cli/src/transformers/metadata_cache");
|
---|
38 | var node_emitter_transform_1 = require("@angular/compiler-cli/src/transformers/node_emitter_transform");
|
---|
39 | var r3_metadata_transform_1 = require("@angular/compiler-cli/src/transformers/r3_metadata_transform");
|
---|
40 | var r3_transform_1 = require("@angular/compiler-cli/src/transformers/r3_transform");
|
---|
41 | var util_1 = require("@angular/compiler-cli/src/transformers/util");
|
---|
42 | /**
|
---|
43 | * Maximum number of files that are emitable via calling ts.Program.emit
|
---|
44 | * passing individual targetSourceFiles.
|
---|
45 | */
|
---|
46 | var MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT = 20;
|
---|
47 | /**
|
---|
48 | * Fields to lower within metadata in render2 mode.
|
---|
49 | */
|
---|
50 | var LOWER_FIELDS = ['useValue', 'useFactory', 'data', 'id', 'loadChildren'];
|
---|
51 | /**
|
---|
52 | * Fields to lower within metadata in render3 mode.
|
---|
53 | */
|
---|
54 | var R3_LOWER_FIELDS = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(LOWER_FIELDS)), ['providers', 'imports', 'exports']);
|
---|
55 | /**
|
---|
56 | * Installs a handler for testing purposes to allow inspection of the temporary program.
|
---|
57 | */
|
---|
58 | var tempProgramHandlerForTest = null;
|
---|
59 | function setTempProgramHandlerForTest(handler) {
|
---|
60 | tempProgramHandlerForTest = handler;
|
---|
61 | }
|
---|
62 | exports.setTempProgramHandlerForTest = setTempProgramHandlerForTest;
|
---|
63 | function resetTempProgramHandlerForTest() {
|
---|
64 | tempProgramHandlerForTest = null;
|
---|
65 | }
|
---|
66 | exports.resetTempProgramHandlerForTest = resetTempProgramHandlerForTest;
|
---|
67 | var emptyModules = {
|
---|
68 | ngModules: [],
|
---|
69 | ngModuleByPipeOrDirective: new Map(),
|
---|
70 | files: []
|
---|
71 | };
|
---|
72 | var defaultEmitCallback = function (_a) {
|
---|
73 | var program = _a.program, targetSourceFile = _a.targetSourceFile, writeFile = _a.writeFile, cancellationToken = _a.cancellationToken, emitOnlyDtsFiles = _a.emitOnlyDtsFiles, customTransformers = _a.customTransformers;
|
---|
74 | return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
---|
75 | };
|
---|
76 | var AngularCompilerProgram = /** @class */ (function () {
|
---|
77 | function AngularCompilerProgram(rootNames, options, host, oldProgram) {
|
---|
78 | var _a;
|
---|
79 | var _this = this;
|
---|
80 | this.options = options;
|
---|
81 | this.host = host;
|
---|
82 | this._optionsDiagnostics = [];
|
---|
83 | this._transformTsDiagnostics = [];
|
---|
84 | this._isCompilingAngularCore = null;
|
---|
85 | this.rootNames = tslib_1.__spreadArray([], tslib_1.__read(rootNames));
|
---|
86 | if (!options.disableTypeScriptVersionCheck) {
|
---|
87 | typescript_support_1.verifySupportedTypeScriptVersion();
|
---|
88 | }
|
---|
89 | this.oldTsProgram = oldProgram ? oldProgram.getTsProgram() : undefined;
|
---|
90 | if (oldProgram) {
|
---|
91 | this.oldProgramLibrarySummaries = oldProgram.getLibrarySummaries();
|
---|
92 | this.oldProgramEmittedGeneratedFiles = oldProgram.getEmittedGeneratedFiles();
|
---|
93 | this.oldProgramEmittedSourceFiles = oldProgram.getEmittedSourceFiles();
|
---|
94 | }
|
---|
95 | if (options.flatModuleOutFile) {
|
---|
96 | var _b = metadata_1.createBundleIndexHost(options, this.rootNames, host, function () { return _this.flatModuleMetadataCache; }), bundleHost = _b.host, indexName = _b.indexName, errors = _b.errors;
|
---|
97 | if (errors) {
|
---|
98 | (_a = this._optionsDiagnostics).push.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(errors.map(function (e) { return ({
|
---|
99 | category: e.category,
|
---|
100 | messageText: e.messageText,
|
---|
101 | source: api_1.SOURCE,
|
---|
102 | code: api_1.DEFAULT_ERROR_CODE
|
---|
103 | }); }))));
|
---|
104 | }
|
---|
105 | else {
|
---|
106 | this.rootNames.push(indexName);
|
---|
107 | this.host = bundleHost;
|
---|
108 | }
|
---|
109 | }
|
---|
110 | this.loweringMetadataTransform =
|
---|
111 | new lower_expressions_1.LowerMetadataTransform(options.enableIvy !== false ? R3_LOWER_FIELDS : LOWER_FIELDS);
|
---|
112 | this.metadataCache = this.createMetadataCache([this.loweringMetadataTransform]);
|
---|
113 | }
|
---|
114 | AngularCompilerProgram.prototype.createMetadataCache = function (transformers) {
|
---|
115 | return new metadata_cache_1.MetadataCache(new metadata_1.MetadataCollector({ quotedNames: true }), !!this.options.strictMetadataEmit, transformers);
|
---|
116 | };
|
---|
117 | AngularCompilerProgram.prototype.getLibrarySummaries = function () {
|
---|
118 | var result = new Map();
|
---|
119 | if (this.oldProgramLibrarySummaries) {
|
---|
120 | this.oldProgramLibrarySummaries.forEach(function (summary, fileName) { return result.set(fileName, summary); });
|
---|
121 | }
|
---|
122 | if (this.emittedLibrarySummaries) {
|
---|
123 | this.emittedLibrarySummaries.forEach(function (summary, fileName) { return result.set(summary.fileName, summary); });
|
---|
124 | }
|
---|
125 | return result;
|
---|
126 | };
|
---|
127 | AngularCompilerProgram.prototype.getEmittedGeneratedFiles = function () {
|
---|
128 | var result = new Map();
|
---|
129 | if (this.oldProgramEmittedGeneratedFiles) {
|
---|
130 | this.oldProgramEmittedGeneratedFiles.forEach(function (genFile, fileName) { return result.set(fileName, genFile); });
|
---|
131 | }
|
---|
132 | if (this.emittedGeneratedFiles) {
|
---|
133 | this.emittedGeneratedFiles.forEach(function (genFile) { return result.set(genFile.genFileUrl, genFile); });
|
---|
134 | }
|
---|
135 | return result;
|
---|
136 | };
|
---|
137 | AngularCompilerProgram.prototype.getEmittedSourceFiles = function () {
|
---|
138 | var result = new Map();
|
---|
139 | if (this.oldProgramEmittedSourceFiles) {
|
---|
140 | this.oldProgramEmittedSourceFiles.forEach(function (sf, fileName) { return result.set(fileName, sf); });
|
---|
141 | }
|
---|
142 | if (this.emittedSourceFiles) {
|
---|
143 | this.emittedSourceFiles.forEach(function (sf) { return result.set(sf.fileName, sf); });
|
---|
144 | }
|
---|
145 | return result;
|
---|
146 | };
|
---|
147 | AngularCompilerProgram.prototype.getTsProgram = function () {
|
---|
148 | return this.tsProgram;
|
---|
149 | };
|
---|
150 | AngularCompilerProgram.prototype.getTsOptionDiagnostics = function (cancellationToken) {
|
---|
151 | return this.tsProgram.getOptionsDiagnostics(cancellationToken);
|
---|
152 | };
|
---|
153 | AngularCompilerProgram.prototype.getNgOptionDiagnostics = function (cancellationToken) {
|
---|
154 | return tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(this._optionsDiagnostics)), tslib_1.__read(getNgOptionDiagnostics(this.options)));
|
---|
155 | };
|
---|
156 | AngularCompilerProgram.prototype.getTsSyntacticDiagnostics = function (sourceFile, cancellationToken) {
|
---|
157 | return this.tsProgram.getSyntacticDiagnostics(sourceFile, cancellationToken);
|
---|
158 | };
|
---|
159 | AngularCompilerProgram.prototype.getNgStructuralDiagnostics = function (cancellationToken) {
|
---|
160 | return this.structuralDiagnostics;
|
---|
161 | };
|
---|
162 | AngularCompilerProgram.prototype.getTsSemanticDiagnostics = function (sourceFile, cancellationToken) {
|
---|
163 | var _this = this;
|
---|
164 | var sourceFiles = sourceFile ? [sourceFile] : this.tsProgram.getSourceFiles();
|
---|
165 | var diags = [];
|
---|
166 | sourceFiles.forEach(function (sf) {
|
---|
167 | if (!util_1.GENERATED_FILES.test(sf.fileName)) {
|
---|
168 | diags.push.apply(diags, tslib_1.__spreadArray([], tslib_1.__read(_this.tsProgram.getSemanticDiagnostics(sf, cancellationToken))));
|
---|
169 | }
|
---|
170 | });
|
---|
171 | return diags;
|
---|
172 | };
|
---|
173 | AngularCompilerProgram.prototype.getNgSemanticDiagnostics = function (fileName, cancellationToken) {
|
---|
174 | var _this = this;
|
---|
175 | var diags = [];
|
---|
176 | this.tsProgram.getSourceFiles().forEach(function (sf) {
|
---|
177 | if (util_1.GENERATED_FILES.test(sf.fileName) && !sf.isDeclarationFile) {
|
---|
178 | diags.push.apply(diags, tslib_1.__spreadArray([], tslib_1.__read(_this.tsProgram.getSemanticDiagnostics(sf, cancellationToken))));
|
---|
179 | }
|
---|
180 | });
|
---|
181 | var ng = translate_diagnostics_1.translateDiagnostics(this.hostAdapter, diags).ng;
|
---|
182 | return ng;
|
---|
183 | };
|
---|
184 | AngularCompilerProgram.prototype.loadNgStructureAsync = function () {
|
---|
185 | var _this = this;
|
---|
186 | if (this._analyzedModules) {
|
---|
187 | throw new Error('Angular structure already loaded');
|
---|
188 | }
|
---|
189 | return Promise.resolve()
|
---|
190 | .then(function () {
|
---|
191 | var _a = _this._createProgramWithBasicStubs(), tmpProgram = _a.tmpProgram, sourceFiles = _a.sourceFiles, tsFiles = _a.tsFiles, rootNames = _a.rootNames;
|
---|
192 | return _this.compiler.loadFilesAsync(sourceFiles, tsFiles)
|
---|
193 | .then(function (_a) {
|
---|
194 | var analyzedModules = _a.analyzedModules, analyzedInjectables = _a.analyzedInjectables;
|
---|
195 | if (_this._analyzedModules) {
|
---|
196 | throw new Error('Angular structure loaded both synchronously and asynchronously');
|
---|
197 | }
|
---|
198 | _this._updateProgramWithTypeCheckStubs(tmpProgram, analyzedModules, analyzedInjectables, rootNames);
|
---|
199 | });
|
---|
200 | })
|
---|
201 | .catch(function (e) { return _this._createProgramOnError(e); });
|
---|
202 | };
|
---|
203 | AngularCompilerProgram.prototype.listLazyRoutes = function (route) {
|
---|
204 | // Note: Don't analyzedModules if a route is given
|
---|
205 | // to be fast enough.
|
---|
206 | return this.compiler.listLazyRoutes(route, route ? undefined : this.analyzedModules);
|
---|
207 | };
|
---|
208 | AngularCompilerProgram.prototype.emit = function (parameters) {
|
---|
209 | if (parameters === void 0) { parameters = {}; }
|
---|
210 | if (this.options.enableIvy !== false) {
|
---|
211 | throw new Error('Cannot run legacy compiler in ngtsc mode');
|
---|
212 | }
|
---|
213 | return this._emitRender2(parameters);
|
---|
214 | };
|
---|
215 | AngularCompilerProgram.prototype._emitRender2 = function (_a) {
|
---|
216 | var e_1, _b, e_2, _c;
|
---|
217 | var _this = this;
|
---|
218 | var _d = _a === void 0 ? {} : _a, _e = _d.emitFlags, emitFlags = _e === void 0 ? api_1.EmitFlags.Default : _e, cancellationToken = _d.cancellationToken, customTransformers = _d.customTransformers, _f = _d.emitCallback, emitCallback = _f === void 0 ? defaultEmitCallback : _f, _g = _d.mergeEmitResultsCallback, mergeEmitResultsCallback = _g === void 0 ? mergeEmitResults : _g;
|
---|
219 | var emitStart = Date.now();
|
---|
220 | if (emitFlags & api_1.EmitFlags.I18nBundle) {
|
---|
221 | var locale = this.options.i18nOutLocale || null;
|
---|
222 | var file = this.options.i18nOutFile || null;
|
---|
223 | var format = this.options.i18nOutFormat || null;
|
---|
224 | var bundle = this.compiler.emitMessageBundle(this.analyzedModules, locale);
|
---|
225 | i18n_1.i18nExtract(format, file, this.host, this.options, bundle);
|
---|
226 | }
|
---|
227 | if ((emitFlags & (api_1.EmitFlags.JS | api_1.EmitFlags.DTS | api_1.EmitFlags.Metadata | api_1.EmitFlags.Codegen)) ===
|
---|
228 | 0) {
|
---|
229 | return { emitSkipped: true, diagnostics: [], emittedFiles: [] };
|
---|
230 | }
|
---|
231 | var _h = this.generateFilesForEmit(emitFlags), genFiles = _h.genFiles, genDiags = _h.genDiags;
|
---|
232 | if (genDiags.length) {
|
---|
233 | return {
|
---|
234 | diagnostics: genDiags,
|
---|
235 | emitSkipped: true,
|
---|
236 | emittedFiles: [],
|
---|
237 | };
|
---|
238 | }
|
---|
239 | this.emittedGeneratedFiles = genFiles;
|
---|
240 | var outSrcMapping = [];
|
---|
241 | var genFileByFileName = new Map();
|
---|
242 | genFiles.forEach(function (genFile) { return genFileByFileName.set(genFile.genFileUrl, genFile); });
|
---|
243 | this.emittedLibrarySummaries = [];
|
---|
244 | this._transformTsDiagnostics = [];
|
---|
245 | var emittedSourceFiles = [];
|
---|
246 | var writeTsFile = function (outFileName, outData, writeByteOrderMark, onError, sourceFiles) {
|
---|
247 | var sourceFile = sourceFiles && sourceFiles.length == 1 ? sourceFiles[0] : null;
|
---|
248 | var genFile;
|
---|
249 | if (sourceFile) {
|
---|
250 | outSrcMapping.push({ outFileName: outFileName, sourceFile: sourceFile });
|
---|
251 | genFile = genFileByFileName.get(sourceFile.fileName);
|
---|
252 | if (!sourceFile.isDeclarationFile && !util_1.GENERATED_FILES.test(sourceFile.fileName)) {
|
---|
253 | // Note: sourceFile is the transformed sourcefile, not the original one!
|
---|
254 | var originalFile = _this.tsProgram.getSourceFile(sourceFile.fileName);
|
---|
255 | if (originalFile) {
|
---|
256 | emittedSourceFiles.push(originalFile);
|
---|
257 | }
|
---|
258 | }
|
---|
259 | }
|
---|
260 | _this.writeFile(outFileName, outData, writeByteOrderMark, onError, genFile, sourceFiles);
|
---|
261 | };
|
---|
262 | var modules = this._analyzedInjectables &&
|
---|
263 | this.compiler.emitAllPartialModules2(this._analyzedInjectables);
|
---|
264 | var tsCustomTransformers = this.calculateTransforms(genFileByFileName, modules, customTransformers);
|
---|
265 | var emitOnlyDtsFiles = (emitFlags & (api_1.EmitFlags.DTS | api_1.EmitFlags.JS)) == api_1.EmitFlags.DTS;
|
---|
266 | // Restore the original references before we emit so TypeScript doesn't emit
|
---|
267 | // a reference to the .d.ts file.
|
---|
268 | var augmentedReferences = new Map();
|
---|
269 | try {
|
---|
270 | for (var _j = tslib_1.__values(this.tsProgram.getSourceFiles()), _k = _j.next(); !_k.done; _k = _j.next()) {
|
---|
271 | var sourceFile = _k.value;
|
---|
272 | var originalReferences = compiler_host_1.getOriginalReferences(sourceFile);
|
---|
273 | if (originalReferences) {
|
---|
274 | augmentedReferences.set(sourceFile, sourceFile.referencedFiles);
|
---|
275 | sourceFile.referencedFiles = originalReferences;
|
---|
276 | }
|
---|
277 | }
|
---|
278 | }
|
---|
279 | catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
---|
280 | finally {
|
---|
281 | try {
|
---|
282 | if (_k && !_k.done && (_b = _j.return)) _b.call(_j);
|
---|
283 | }
|
---|
284 | finally { if (e_1) throw e_1.error; }
|
---|
285 | }
|
---|
286 | var genTsFiles = [];
|
---|
287 | var genJsonFiles = [];
|
---|
288 | genFiles.forEach(function (gf) {
|
---|
289 | if (gf.stmts) {
|
---|
290 | genTsFiles.push(gf);
|
---|
291 | }
|
---|
292 | if (gf.source) {
|
---|
293 | genJsonFiles.push(gf);
|
---|
294 | }
|
---|
295 | });
|
---|
296 | var emitResult;
|
---|
297 | var emittedUserTsCount;
|
---|
298 | try {
|
---|
299 | var sourceFilesToEmit = this.getSourceFilesForEmit();
|
---|
300 | if (sourceFilesToEmit &&
|
---|
301 | (sourceFilesToEmit.length + genTsFiles.length) < MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT) {
|
---|
302 | var fileNamesToEmit = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(sourceFilesToEmit.map(function (sf) { return sf.fileName; }))), tslib_1.__read(genTsFiles.map(function (gf) { return gf.genFileUrl; })));
|
---|
303 | emitResult = mergeEmitResultsCallback(fileNamesToEmit.map(function (fileName) { return emitResult = emitCallback({
|
---|
304 | program: _this.tsProgram,
|
---|
305 | host: _this.host,
|
---|
306 | options: _this.options,
|
---|
307 | writeFile: writeTsFile,
|
---|
308 | emitOnlyDtsFiles: emitOnlyDtsFiles,
|
---|
309 | customTransformers: tsCustomTransformers,
|
---|
310 | targetSourceFile: _this.tsProgram.getSourceFile(fileName),
|
---|
311 | }); }));
|
---|
312 | emittedUserTsCount = sourceFilesToEmit.length;
|
---|
313 | }
|
---|
314 | else {
|
---|
315 | emitResult = emitCallback({
|
---|
316 | program: this.tsProgram,
|
---|
317 | host: this.host,
|
---|
318 | options: this.options,
|
---|
319 | writeFile: writeTsFile,
|
---|
320 | emitOnlyDtsFiles: emitOnlyDtsFiles,
|
---|
321 | customTransformers: tsCustomTransformers
|
---|
322 | });
|
---|
323 | emittedUserTsCount = this.tsProgram.getSourceFiles().length - genTsFiles.length;
|
---|
324 | }
|
---|
325 | }
|
---|
326 | finally {
|
---|
327 | try {
|
---|
328 | // Restore the references back to the augmented value to ensure that the
|
---|
329 | // checks that TypeScript makes for project structure reuse will succeed.
|
---|
330 | for (var _l = tslib_1.__values(Array.from(augmentedReferences)), _m = _l.next(); !_m.done; _m = _l.next()) {
|
---|
331 | var _o = tslib_1.__read(_m.value, 2), sourceFile = _o[0], references = _o[1];
|
---|
332 | // TODO(chuckj): Remove any cast after updating build to 2.6
|
---|
333 | sourceFile.referencedFiles = references;
|
---|
334 | }
|
---|
335 | }
|
---|
336 | catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
---|
337 | finally {
|
---|
338 | try {
|
---|
339 | if (_m && !_m.done && (_c = _l.return)) _c.call(_l);
|
---|
340 | }
|
---|
341 | finally { if (e_2) throw e_2.error; }
|
---|
342 | }
|
---|
343 | }
|
---|
344 | this.emittedSourceFiles = emittedSourceFiles;
|
---|
345 | // Match behavior of tsc: only produce emit diagnostics if it would block
|
---|
346 | // emit. If noEmitOnError is false, the emit will happen in spite of any
|
---|
347 | // errors, so we should not report them.
|
---|
348 | if (emitResult && this.options.noEmitOnError === true) {
|
---|
349 | // translate the diagnostics in the emitResult as well.
|
---|
350 | var translatedEmitDiags = translate_diagnostics_1.translateDiagnostics(this.hostAdapter, emitResult.diagnostics);
|
---|
351 | emitResult.diagnostics = translatedEmitDiags.ts.concat(this.structuralDiagnostics.concat(translatedEmitDiags.ng).map(util_1.ngToTsDiagnostic));
|
---|
352 | }
|
---|
353 | if (emitResult && !outSrcMapping.length) {
|
---|
354 | // if no files were emitted by TypeScript, also don't emit .json files
|
---|
355 | emitResult.diagnostics =
|
---|
356 | emitResult.diagnostics.concat([util_1.createMessageDiagnostic("Emitted no files.")]);
|
---|
357 | return emitResult;
|
---|
358 | }
|
---|
359 | var sampleSrcFileName;
|
---|
360 | var sampleOutFileName;
|
---|
361 | if (outSrcMapping.length) {
|
---|
362 | sampleSrcFileName = outSrcMapping[0].sourceFile.fileName;
|
---|
363 | sampleOutFileName = outSrcMapping[0].outFileName;
|
---|
364 | }
|
---|
365 | var srcToOutPath = createSrcToOutPathMapper(this.options.outDir, sampleSrcFileName, sampleOutFileName);
|
---|
366 | if (emitFlags & api_1.EmitFlags.Codegen) {
|
---|
367 | genJsonFiles.forEach(function (gf) {
|
---|
368 | var outFileName = srcToOutPath(gf.genFileUrl);
|
---|
369 | _this.writeFile(outFileName, gf.source, false, undefined, gf);
|
---|
370 | });
|
---|
371 | }
|
---|
372 | var metadataJsonCount = 0;
|
---|
373 | if (emitFlags & api_1.EmitFlags.Metadata) {
|
---|
374 | this.tsProgram.getSourceFiles().forEach(function (sf) {
|
---|
375 | if (!sf.isDeclarationFile && !util_1.GENERATED_FILES.test(sf.fileName)) {
|
---|
376 | metadataJsonCount++;
|
---|
377 | var metadata = _this.metadataCache.getMetadata(sf);
|
---|
378 | if (metadata) {
|
---|
379 | var metadataText = JSON.stringify([metadata]);
|
---|
380 | var outFileName = srcToOutPath(sf.fileName.replace(/\.tsx?$/, '.metadata.json'));
|
---|
381 | _this.writeFile(outFileName, metadataText, false, undefined, undefined, [sf]);
|
---|
382 | }
|
---|
383 | }
|
---|
384 | });
|
---|
385 | }
|
---|
386 | var emitEnd = Date.now();
|
---|
387 | if (emitResult && this.options.diagnostics) {
|
---|
388 | emitResult.diagnostics = emitResult.diagnostics.concat([util_1.createMessageDiagnostic([
|
---|
389 | "Emitted in " + (emitEnd - emitStart) + "ms",
|
---|
390 | "- " + emittedUserTsCount + " user ts files",
|
---|
391 | "- " + genTsFiles.length + " generated ts files",
|
---|
392 | "- " + (genJsonFiles.length + metadataJsonCount) + " generated json files",
|
---|
393 | ].join('\n'))]);
|
---|
394 | }
|
---|
395 | return emitResult;
|
---|
396 | };
|
---|
397 | Object.defineProperty(AngularCompilerProgram.prototype, "compiler", {
|
---|
398 | // Private members
|
---|
399 | get: function () {
|
---|
400 | if (!this._compiler) {
|
---|
401 | this._createCompiler();
|
---|
402 | }
|
---|
403 | return this._compiler;
|
---|
404 | },
|
---|
405 | enumerable: false,
|
---|
406 | configurable: true
|
---|
407 | });
|
---|
408 | Object.defineProperty(AngularCompilerProgram.prototype, "hostAdapter", {
|
---|
409 | get: function () {
|
---|
410 | if (!this._hostAdapter) {
|
---|
411 | this._createCompiler();
|
---|
412 | }
|
---|
413 | return this._hostAdapter;
|
---|
414 | },
|
---|
415 | enumerable: false,
|
---|
416 | configurable: true
|
---|
417 | });
|
---|
418 | Object.defineProperty(AngularCompilerProgram.prototype, "analyzedModules", {
|
---|
419 | get: function () {
|
---|
420 | if (!this._analyzedModules) {
|
---|
421 | this.initSync();
|
---|
422 | }
|
---|
423 | return this._analyzedModules;
|
---|
424 | },
|
---|
425 | enumerable: false,
|
---|
426 | configurable: true
|
---|
427 | });
|
---|
428 | Object.defineProperty(AngularCompilerProgram.prototype, "structuralDiagnostics", {
|
---|
429 | get: function () {
|
---|
430 | var diagnostics = this._structuralDiagnostics;
|
---|
431 | if (!diagnostics) {
|
---|
432 | this.initSync();
|
---|
433 | diagnostics = (this._structuralDiagnostics = this._structuralDiagnostics || []);
|
---|
434 | }
|
---|
435 | return diagnostics;
|
---|
436 | },
|
---|
437 | enumerable: false,
|
---|
438 | configurable: true
|
---|
439 | });
|
---|
440 | Object.defineProperty(AngularCompilerProgram.prototype, "tsProgram", {
|
---|
441 | get: function () {
|
---|
442 | if (!this._tsProgram) {
|
---|
443 | this.initSync();
|
---|
444 | }
|
---|
445 | return this._tsProgram;
|
---|
446 | },
|
---|
447 | enumerable: false,
|
---|
448 | configurable: true
|
---|
449 | });
|
---|
450 | Object.defineProperty(AngularCompilerProgram.prototype, "isCompilingAngularCore", {
|
---|
451 | /** Whether the program is compiling the Angular core package. */
|
---|
452 | get: function () {
|
---|
453 | if (this._isCompilingAngularCore !== null) {
|
---|
454 | return this._isCompilingAngularCore;
|
---|
455 | }
|
---|
456 | return this._isCompilingAngularCore = compiler_2.isAngularCorePackage(this.tsProgram);
|
---|
457 | },
|
---|
458 | enumerable: false,
|
---|
459 | configurable: true
|
---|
460 | });
|
---|
461 | AngularCompilerProgram.prototype.calculateTransforms = function (genFiles, partialModules, customTransformers) {
|
---|
462 | var beforeTs = [];
|
---|
463 | var metadataTransforms = [];
|
---|
464 | var flatModuleMetadataTransforms = [];
|
---|
465 | var annotateForClosureCompiler = this.options.annotateForClosureCompiler || false;
|
---|
466 | if (this.options.enableResourceInlining) {
|
---|
467 | beforeTs.push(inline_resources_1.getInlineResourcesTransformFactory(this.tsProgram, this.hostAdapter));
|
---|
468 | var transformer = new inline_resources_1.InlineResourcesMetadataTransformer(this.hostAdapter);
|
---|
469 | metadataTransforms.push(transformer);
|
---|
470 | flatModuleMetadataTransforms.push(transformer);
|
---|
471 | }
|
---|
472 | if (!this.options.disableExpressionLowering) {
|
---|
473 | beforeTs.push(lower_expressions_1.getExpressionLoweringTransformFactory(this.loweringMetadataTransform, this.tsProgram));
|
---|
474 | metadataTransforms.push(this.loweringMetadataTransform);
|
---|
475 | }
|
---|
476 | if (genFiles) {
|
---|
477 | beforeTs.push(node_emitter_transform_1.getAngularEmitterTransformFactory(genFiles, this.getTsProgram(), annotateForClosureCompiler));
|
---|
478 | }
|
---|
479 | if (partialModules) {
|
---|
480 | beforeTs.push(r3_transform_1.getAngularClassTransformerFactory(partialModules, annotateForClosureCompiler));
|
---|
481 | // If we have partial modules, the cached metadata might be incorrect as it doesn't reflect
|
---|
482 | // the partial module transforms.
|
---|
483 | var transformer = new r3_metadata_transform_1.PartialModuleMetadataTransformer(partialModules);
|
---|
484 | metadataTransforms.push(transformer);
|
---|
485 | flatModuleMetadataTransforms.push(transformer);
|
---|
486 | }
|
---|
487 | if (customTransformers && customTransformers.beforeTs) {
|
---|
488 | beforeTs.push.apply(beforeTs, tslib_1.__spreadArray([], tslib_1.__read(customTransformers.beforeTs)));
|
---|
489 | }
|
---|
490 | // If decorators should be converted to static fields (enabled by default), we set up
|
---|
491 | // the decorator downlevel transform. Note that we set it up as last transform as that
|
---|
492 | // allows custom transformers to strip Angular decorators without having to deal with
|
---|
493 | // identifying static properties. e.g. it's more difficult handling `<..>.decorators`
|
---|
494 | // or `<..>.ctorParameters` compared to the `ts.Decorator` AST nodes.
|
---|
495 | if (this.options.annotationsAs !== 'decorators') {
|
---|
496 | var typeChecker = this.getTsProgram().getTypeChecker();
|
---|
497 | var reflectionHost = new reflection_1.TypeScriptReflectionHost(typeChecker);
|
---|
498 | // Similarly to how we handled tsickle decorator downleveling in the past, we just
|
---|
499 | // ignore diagnostics that have been collected by the transformer. These are
|
---|
500 | // non-significant failures that shouldn't prevent apps from compiling.
|
---|
501 | beforeTs.push(downlevel_decorators_transform_1.getDownlevelDecoratorsTransform(typeChecker, reflectionHost, [], this.isCompilingAngularCore, annotateForClosureCompiler,
|
---|
502 | /* skipClassDecorators */ false));
|
---|
503 | }
|
---|
504 | if (metadataTransforms.length > 0) {
|
---|
505 | this.metadataCache = this.createMetadataCache(metadataTransforms);
|
---|
506 | }
|
---|
507 | if (flatModuleMetadataTransforms.length > 0) {
|
---|
508 | this.flatModuleMetadataCache = this.createMetadataCache(flatModuleMetadataTransforms);
|
---|
509 | }
|
---|
510 | var afterTs = customTransformers ? customTransformers.afterTs : undefined;
|
---|
511 | return { before: beforeTs, after: afterTs };
|
---|
512 | };
|
---|
513 | AngularCompilerProgram.prototype.initSync = function () {
|
---|
514 | if (this._analyzedModules) {
|
---|
515 | return;
|
---|
516 | }
|
---|
517 | try {
|
---|
518 | var _a = this._createProgramWithBasicStubs(), tmpProgram = _a.tmpProgram, sourceFiles = _a.sourceFiles, tsFiles = _a.tsFiles, rootNames = _a.rootNames;
|
---|
519 | var _b = this.compiler.loadFilesSync(sourceFiles, tsFiles), analyzedModules = _b.analyzedModules, analyzedInjectables = _b.analyzedInjectables;
|
---|
520 | this._updateProgramWithTypeCheckStubs(tmpProgram, analyzedModules, analyzedInjectables, rootNames);
|
---|
521 | }
|
---|
522 | catch (e) {
|
---|
523 | this._createProgramOnError(e);
|
---|
524 | }
|
---|
525 | };
|
---|
526 | AngularCompilerProgram.prototype._createCompiler = function () {
|
---|
527 | var _this = this;
|
---|
528 | var codegen = {
|
---|
529 | generateFile: function (genFileName, baseFileName) {
|
---|
530 | return _this._compiler.emitBasicStub(genFileName, baseFileName);
|
---|
531 | },
|
---|
532 | findGeneratedFileNames: function (fileName) { return _this._compiler.findGeneratedFileNames(fileName); },
|
---|
533 | };
|
---|
534 | this._hostAdapter = new compiler_host_1.TsCompilerAotCompilerTypeCheckHostAdapter(this.rootNames, this.options, this.host, this.metadataCache, codegen, this.oldProgramLibrarySummaries);
|
---|
535 | var aotOptions = getAotCompilerOptions(this.options);
|
---|
536 | var errorCollector = (this.options.collectAllErrors || this.options.fullTemplateTypeCheck) ?
|
---|
537 | function (err) { return _this._addStructuralDiagnostics(err); } :
|
---|
538 | undefined;
|
---|
539 | this._compiler = compiler_1.createAotCompiler(this._hostAdapter, aotOptions, errorCollector).compiler;
|
---|
540 | };
|
---|
541 | AngularCompilerProgram.prototype._createProgramWithBasicStubs = function () {
|
---|
542 | var _this = this;
|
---|
543 | if (this._analyzedModules) {
|
---|
544 | throw new Error("Internal Error: already initialized!");
|
---|
545 | }
|
---|
546 | // Note: This is important to not produce a memory leak!
|
---|
547 | var oldTsProgram = this.oldTsProgram;
|
---|
548 | this.oldTsProgram = undefined;
|
---|
549 | var codegen = {
|
---|
550 | generateFile: function (genFileName, baseFileName) {
|
---|
551 | return _this.compiler.emitBasicStub(genFileName, baseFileName);
|
---|
552 | },
|
---|
553 | findGeneratedFileNames: function (fileName) { return _this.compiler.findGeneratedFileNames(fileName); },
|
---|
554 | };
|
---|
555 | var rootNames = tslib_1.__spreadArray([], tslib_1.__read(this.rootNames));
|
---|
556 | if (this.options.generateCodeForLibraries !== false) {
|
---|
557 | // if we should generateCodeForLibraries, never include
|
---|
558 | // generated files in the program as otherwise we will
|
---|
559 | // overwrite them and typescript will report the error
|
---|
560 | // TS5055: Cannot write file ... because it would overwrite input file.
|
---|
561 | rootNames = rootNames.filter(function (fn) { return !util_1.GENERATED_FILES.test(fn); });
|
---|
562 | }
|
---|
563 | if (this.options.noResolve) {
|
---|
564 | this.rootNames.forEach(function (rootName) {
|
---|
565 | if (_this.hostAdapter.shouldGenerateFilesFor(rootName)) {
|
---|
566 | rootNames.push.apply(rootNames, tslib_1.__spreadArray([], tslib_1.__read(_this.compiler.findGeneratedFileNames(rootName))));
|
---|
567 | }
|
---|
568 | });
|
---|
569 | }
|
---|
570 | var tmpProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, oldTsProgram);
|
---|
571 | if (tempProgramHandlerForTest !== null) {
|
---|
572 | tempProgramHandlerForTest(tmpProgram);
|
---|
573 | }
|
---|
574 | var sourceFiles = [];
|
---|
575 | var tsFiles = [];
|
---|
576 | tmpProgram.getSourceFiles().forEach(function (sf) {
|
---|
577 | if (_this.hostAdapter.isSourceFile(sf.fileName)) {
|
---|
578 | sourceFiles.push(sf.fileName);
|
---|
579 | }
|
---|
580 | if (util_1.TS.test(sf.fileName) && !util_1.DTS.test(sf.fileName)) {
|
---|
581 | tsFiles.push(sf.fileName);
|
---|
582 | }
|
---|
583 | });
|
---|
584 | return { tmpProgram: tmpProgram, sourceFiles: sourceFiles, tsFiles: tsFiles, rootNames: rootNames };
|
---|
585 | };
|
---|
586 | AngularCompilerProgram.prototype._updateProgramWithTypeCheckStubs = function (tmpProgram, analyzedModules, analyzedInjectables, rootNames) {
|
---|
587 | var _this = this;
|
---|
588 | this._analyzedModules = analyzedModules;
|
---|
589 | this._analyzedInjectables = analyzedInjectables;
|
---|
590 | tmpProgram.getSourceFiles().forEach(function (sf) {
|
---|
591 | if (sf.fileName.endsWith('.ngfactory.ts')) {
|
---|
592 | var _a = _this.hostAdapter.shouldGenerateFile(sf.fileName), generate = _a.generate, baseFileName = _a.baseFileName;
|
---|
593 | if (generate) {
|
---|
594 | // Note: ! is ok as hostAdapter.shouldGenerateFile will always return a baseFileName
|
---|
595 | // for .ngfactory.ts files.
|
---|
596 | var genFile = _this.compiler.emitTypeCheckStub(sf.fileName, baseFileName);
|
---|
597 | if (genFile) {
|
---|
598 | _this.hostAdapter.updateGeneratedFile(genFile);
|
---|
599 | }
|
---|
600 | }
|
---|
601 | }
|
---|
602 | });
|
---|
603 | this._tsProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, tmpProgram);
|
---|
604 | // Note: the new ts program should be completely reusable by TypeScript as:
|
---|
605 | // - we cache all the files in the hostAdapter
|
---|
606 | // - new new stubs use the exactly same imports/exports as the old once (we assert that in
|
---|
607 | // hostAdapter.updateGeneratedFile).
|
---|
608 | if (util_1.tsStructureIsReused(this._tsProgram) !== 2 /* Completely */) {
|
---|
609 | throw new Error("Internal Error: The structure of the program changed during codegen.");
|
---|
610 | }
|
---|
611 | };
|
---|
612 | AngularCompilerProgram.prototype._createProgramOnError = function (e) {
|
---|
613 | // Still fill the analyzedModules and the tsProgram
|
---|
614 | // so that we don't cause other errors for users who e.g. want to emit the ngProgram.
|
---|
615 | this._analyzedModules = emptyModules;
|
---|
616 | this.oldTsProgram = undefined;
|
---|
617 | this._hostAdapter.isSourceFile = function () { return false; };
|
---|
618 | this._tsProgram = ts.createProgram(this.rootNames, this.options, this.hostAdapter);
|
---|
619 | if (compiler_1.isSyntaxError(e)) {
|
---|
620 | this._addStructuralDiagnostics(e);
|
---|
621 | return;
|
---|
622 | }
|
---|
623 | throw e;
|
---|
624 | };
|
---|
625 | AngularCompilerProgram.prototype._addStructuralDiagnostics = function (error) {
|
---|
626 | var diagnostics = this._structuralDiagnostics || (this._structuralDiagnostics = []);
|
---|
627 | if (compiler_1.isSyntaxError(error)) {
|
---|
628 | diagnostics.push.apply(diagnostics, tslib_1.__spreadArray([], tslib_1.__read(syntaxErrorToDiagnostics(error, this.tsProgram))));
|
---|
629 | }
|
---|
630 | else {
|
---|
631 | diagnostics.push({
|
---|
632 | messageText: error.toString(),
|
---|
633 | category: ts.DiagnosticCategory.Error,
|
---|
634 | source: api_1.SOURCE,
|
---|
635 | code: api_1.DEFAULT_ERROR_CODE
|
---|
636 | });
|
---|
637 | }
|
---|
638 | };
|
---|
639 | // Note: this returns a ts.Diagnostic so that we
|
---|
640 | // can return errors in a ts.EmitResult
|
---|
641 | AngularCompilerProgram.prototype.generateFilesForEmit = function (emitFlags) {
|
---|
642 | var _this = this;
|
---|
643 | try {
|
---|
644 | if (!(emitFlags & api_1.EmitFlags.Codegen)) {
|
---|
645 | return { genFiles: [], genDiags: [] };
|
---|
646 | }
|
---|
647 | // TODO(tbosch): allow generating files that are not in the rootDir
|
---|
648 | // See https://github.com/angular/angular/issues/19337
|
---|
649 | var genFiles = this.compiler.emitAllImpls(this.analyzedModules)
|
---|
650 | .filter(function (genFile) { return util_1.isInRootDir(genFile.genFileUrl, _this.options); });
|
---|
651 | if (this.oldProgramEmittedGeneratedFiles) {
|
---|
652 | var oldProgramEmittedGeneratedFiles_1 = this.oldProgramEmittedGeneratedFiles;
|
---|
653 | genFiles = genFiles.filter(function (genFile) {
|
---|
654 | var oldGenFile = oldProgramEmittedGeneratedFiles_1.get(genFile.genFileUrl);
|
---|
655 | return !oldGenFile || !genFile.isEquivalent(oldGenFile);
|
---|
656 | });
|
---|
657 | }
|
---|
658 | return { genFiles: genFiles, genDiags: [] };
|
---|
659 | }
|
---|
660 | catch (e) {
|
---|
661 | // TODO(tbosch): check whether we can actually have syntax errors here,
|
---|
662 | // as we already parsed the metadata and templates before to create the type check block.
|
---|
663 | if (compiler_1.isSyntaxError(e)) {
|
---|
664 | var genDiags = [{
|
---|
665 | file: undefined,
|
---|
666 | start: undefined,
|
---|
667 | length: undefined,
|
---|
668 | messageText: e.message,
|
---|
669 | category: ts.DiagnosticCategory.Error,
|
---|
670 | source: api_1.SOURCE,
|
---|
671 | code: api_1.DEFAULT_ERROR_CODE
|
---|
672 | }];
|
---|
673 | return { genFiles: [], genDiags: genDiags };
|
---|
674 | }
|
---|
675 | throw e;
|
---|
676 | }
|
---|
677 | };
|
---|
678 | /**
|
---|
679 | * Returns undefined if all files should be emitted.
|
---|
680 | */
|
---|
681 | AngularCompilerProgram.prototype.getSourceFilesForEmit = function () {
|
---|
682 | var _this = this;
|
---|
683 | // TODO(tbosch): if one of the files contains a `const enum`
|
---|
684 | // always emit all files -> return undefined!
|
---|
685 | var sourceFilesToEmit = this.tsProgram.getSourceFiles().filter(function (sf) {
|
---|
686 | return !sf.isDeclarationFile && !util_1.GENERATED_FILES.test(sf.fileName);
|
---|
687 | });
|
---|
688 | if (this.oldProgramEmittedSourceFiles) {
|
---|
689 | sourceFilesToEmit = sourceFilesToEmit.filter(function (sf) {
|
---|
690 | var oldFile = _this.oldProgramEmittedSourceFiles.get(sf.fileName);
|
---|
691 | return sf !== oldFile;
|
---|
692 | });
|
---|
693 | }
|
---|
694 | return sourceFilesToEmit;
|
---|
695 | };
|
---|
696 | AngularCompilerProgram.prototype.writeFile = function (outFileName, outData, writeByteOrderMark, onError, genFile, sourceFiles) {
|
---|
697 | // collect emittedLibrarySummaries
|
---|
698 | var baseFile;
|
---|
699 | if (genFile) {
|
---|
700 | baseFile = this.tsProgram.getSourceFile(genFile.srcFileUrl);
|
---|
701 | if (baseFile) {
|
---|
702 | if (!this.emittedLibrarySummaries) {
|
---|
703 | this.emittedLibrarySummaries = [];
|
---|
704 | }
|
---|
705 | if (genFile.genFileUrl.endsWith('.ngsummary.json') && baseFile.fileName.endsWith('.d.ts')) {
|
---|
706 | this.emittedLibrarySummaries.push({
|
---|
707 | fileName: baseFile.fileName,
|
---|
708 | text: baseFile.text,
|
---|
709 | sourceFile: baseFile,
|
---|
710 | });
|
---|
711 | this.emittedLibrarySummaries.push({ fileName: genFile.genFileUrl, text: outData });
|
---|
712 | if (!this.options.declaration) {
|
---|
713 | // If we don't emit declarations, still record an empty .ngfactory.d.ts file,
|
---|
714 | // as we might need it later on for resolving module names from summaries.
|
---|
715 | var ngFactoryDts = genFile.genFileUrl.substring(0, genFile.genFileUrl.length - 15) + '.ngfactory.d.ts';
|
---|
716 | this.emittedLibrarySummaries.push({ fileName: ngFactoryDts, text: '' });
|
---|
717 | }
|
---|
718 | }
|
---|
719 | else if (outFileName.endsWith('.d.ts') && baseFile.fileName.endsWith('.d.ts')) {
|
---|
720 | var dtsSourceFilePath = genFile.genFileUrl.replace(/\.ts$/, '.d.ts');
|
---|
721 | // Note: Don't use sourceFiles here as the created .d.ts has a path in the outDir,
|
---|
722 | // but we need one that is next to the .ts file
|
---|
723 | this.emittedLibrarySummaries.push({ fileName: dtsSourceFilePath, text: outData });
|
---|
724 | }
|
---|
725 | }
|
---|
726 | }
|
---|
727 | // Filter out generated files for which we didn't generate code.
|
---|
728 | // This can happen as the stub calculation is not completely exact.
|
---|
729 | // Note: sourceFile refers to the .ngfactory.ts / .ngsummary.ts file
|
---|
730 | // node_emitter_transform already set the file contents to be empty,
|
---|
731 | // so this code only needs to skip the file if !allowEmptyCodegenFiles.
|
---|
732 | var isGenerated = util_1.GENERATED_FILES.test(outFileName);
|
---|
733 | if (isGenerated && !this.options.allowEmptyCodegenFiles &&
|
---|
734 | (!genFile || !genFile.stmts || genFile.stmts.length === 0)) {
|
---|
735 | return;
|
---|
736 | }
|
---|
737 | if (baseFile) {
|
---|
738 | sourceFiles = sourceFiles ? tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(sourceFiles)), [baseFile]) : [baseFile];
|
---|
739 | }
|
---|
740 | // TODO: remove any when TS 2.4 support is removed.
|
---|
741 | this.host.writeFile(outFileName, outData, writeByteOrderMark, onError, sourceFiles);
|
---|
742 | };
|
---|
743 | return AngularCompilerProgram;
|
---|
744 | }());
|
---|
745 | function createProgram(_a) {
|
---|
746 | var rootNames = _a.rootNames, options = _a.options, host = _a.host, oldProgram = _a.oldProgram;
|
---|
747 | if (options.enableIvy !== false) {
|
---|
748 | return new program_1.NgtscProgram(rootNames, options, host, oldProgram);
|
---|
749 | }
|
---|
750 | else {
|
---|
751 | return new AngularCompilerProgram(rootNames, options, host, oldProgram);
|
---|
752 | }
|
---|
753 | }
|
---|
754 | exports.createProgram = createProgram;
|
---|
755 | // Compute the AotCompiler options
|
---|
756 | function getAotCompilerOptions(options) {
|
---|
757 | var missingTranslation = compiler_1.core.MissingTranslationStrategy.Warning;
|
---|
758 | switch (options.i18nInMissingTranslations) {
|
---|
759 | case 'ignore':
|
---|
760 | missingTranslation = compiler_1.core.MissingTranslationStrategy.Ignore;
|
---|
761 | break;
|
---|
762 | case 'error':
|
---|
763 | missingTranslation = compiler_1.core.MissingTranslationStrategy.Error;
|
---|
764 | break;
|
---|
765 | }
|
---|
766 | var translations = '';
|
---|
767 | if (options.i18nInFile) {
|
---|
768 | if (!options.i18nInLocale) {
|
---|
769 | throw new Error("The translation file (" + options.i18nInFile + ") locale must be provided.");
|
---|
770 | }
|
---|
771 | translations = fs.readFileSync(options.i18nInFile, 'utf8');
|
---|
772 | }
|
---|
773 | else {
|
---|
774 | // No translations are provided, ignore any errors
|
---|
775 | // We still go through i18n to remove i18n attributes
|
---|
776 | missingTranslation = compiler_1.core.MissingTranslationStrategy.Ignore;
|
---|
777 | }
|
---|
778 | return {
|
---|
779 | locale: options.i18nInLocale,
|
---|
780 | i18nFormat: options.i18nInFormat || options.i18nOutFormat,
|
---|
781 | i18nUseExternalIds: options.i18nUseExternalIds,
|
---|
782 | translations: translations,
|
---|
783 | missingTranslation: missingTranslation,
|
---|
784 | enableSummariesForJit: options.enableSummariesForJit,
|
---|
785 | preserveWhitespaces: options.preserveWhitespaces,
|
---|
786 | fullTemplateTypeCheck: options.fullTemplateTypeCheck,
|
---|
787 | allowEmptyCodegenFiles: options.allowEmptyCodegenFiles,
|
---|
788 | enableIvy: options.enableIvy,
|
---|
789 | createExternalSymbolFactoryReexports: options.createExternalSymbolFactoryReexports,
|
---|
790 | };
|
---|
791 | }
|
---|
792 | function getNgOptionDiagnostics(options) {
|
---|
793 | if (options.annotationsAs) {
|
---|
794 | switch (options.annotationsAs) {
|
---|
795 | case 'decorators':
|
---|
796 | case 'static fields':
|
---|
797 | break;
|
---|
798 | default:
|
---|
799 | return [{
|
---|
800 | messageText: 'Angular compiler options "annotationsAs" only supports "static fields" and "decorators"',
|
---|
801 | category: ts.DiagnosticCategory.Error,
|
---|
802 | source: api_1.SOURCE,
|
---|
803 | code: api_1.DEFAULT_ERROR_CODE
|
---|
804 | }];
|
---|
805 | }
|
---|
806 | }
|
---|
807 | return [];
|
---|
808 | }
|
---|
809 | function normalizeSeparators(path) {
|
---|
810 | return path.replace(/\\/g, '/');
|
---|
811 | }
|
---|
812 | /**
|
---|
813 | * Returns a function that can adjust a path from source path to out path,
|
---|
814 | * based on an existing mapping from source to out path.
|
---|
815 | *
|
---|
816 | * TODO(tbosch): talk to the TypeScript team to expose their logic for calculating the `rootDir`
|
---|
817 | * if none was specified.
|
---|
818 | *
|
---|
819 | * Note: This function works on normalized paths from typescript but should always return
|
---|
820 | * POSIX normalized paths for output paths.
|
---|
821 | */
|
---|
822 | function createSrcToOutPathMapper(outDir, sampleSrcFileName, sampleOutFileName, host) {
|
---|
823 | if (host === void 0) { host = path; }
|
---|
824 | if (outDir) {
|
---|
825 | var path_1 = {}; // Ensure we error if we use `path` instead of `host`.
|
---|
826 | if (sampleSrcFileName == null || sampleOutFileName == null) {
|
---|
827 | throw new Error("Can't calculate the rootDir without a sample srcFileName / outFileName. ");
|
---|
828 | }
|
---|
829 | var srcFileDir = normalizeSeparators(host.dirname(sampleSrcFileName));
|
---|
830 | var outFileDir = normalizeSeparators(host.dirname(sampleOutFileName));
|
---|
831 | if (srcFileDir === outFileDir) {
|
---|
832 | return function (srcFileName) { return srcFileName; };
|
---|
833 | }
|
---|
834 | // calculate the common suffix, stopping
|
---|
835 | // at `outDir`.
|
---|
836 | var srcDirParts = srcFileDir.split('/');
|
---|
837 | var outDirParts = normalizeSeparators(host.relative(outDir, outFileDir)).split('/');
|
---|
838 | var i = 0;
|
---|
839 | while (i < Math.min(srcDirParts.length, outDirParts.length) &&
|
---|
840 | srcDirParts[srcDirParts.length - 1 - i] === outDirParts[outDirParts.length - 1 - i])
|
---|
841 | i++;
|
---|
842 | var rootDir_1 = srcDirParts.slice(0, srcDirParts.length - i).join('/');
|
---|
843 | return function (srcFileName) {
|
---|
844 | // Note: Before we return the mapped output path, we need to normalize the path delimiters
|
---|
845 | // because the output path is usually passed to TypeScript which sometimes only expects
|
---|
846 | // posix normalized paths (e.g. if a custom compiler host is used)
|
---|
847 | return normalizeSeparators(host.resolve(outDir, host.relative(rootDir_1, srcFileName)));
|
---|
848 | };
|
---|
849 | }
|
---|
850 | else {
|
---|
851 | // Note: Before we return the output path, we need to normalize the path delimiters because
|
---|
852 | // the output path is usually passed to TypeScript which only passes around posix
|
---|
853 | // normalized paths (e.g. if a custom compiler host is used)
|
---|
854 | return function (srcFileName) { return normalizeSeparators(srcFileName); };
|
---|
855 | }
|
---|
856 | }
|
---|
857 | exports.createSrcToOutPathMapper = createSrcToOutPathMapper;
|
---|
858 | function mergeEmitResults(emitResults) {
|
---|
859 | var e_3, _a;
|
---|
860 | var diagnostics = [];
|
---|
861 | var emitSkipped = false;
|
---|
862 | var emittedFiles = [];
|
---|
863 | try {
|
---|
864 | for (var emitResults_1 = tslib_1.__values(emitResults), emitResults_1_1 = emitResults_1.next(); !emitResults_1_1.done; emitResults_1_1 = emitResults_1.next()) {
|
---|
865 | var er = emitResults_1_1.value;
|
---|
866 | diagnostics.push.apply(diagnostics, tslib_1.__spreadArray([], tslib_1.__read(er.diagnostics)));
|
---|
867 | emitSkipped = emitSkipped || er.emitSkipped;
|
---|
868 | emittedFiles.push.apply(emittedFiles, tslib_1.__spreadArray([], tslib_1.__read((er.emittedFiles || []))));
|
---|
869 | }
|
---|
870 | }
|
---|
871 | catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
---|
872 | finally {
|
---|
873 | try {
|
---|
874 | if (emitResults_1_1 && !emitResults_1_1.done && (_a = emitResults_1.return)) _a.call(emitResults_1);
|
---|
875 | }
|
---|
876 | finally { if (e_3) throw e_3.error; }
|
---|
877 | }
|
---|
878 | return { diagnostics: diagnostics, emitSkipped: emitSkipped, emittedFiles: emittedFiles };
|
---|
879 | }
|
---|
880 | function diagnosticSourceOfSpan(span) {
|
---|
881 | // For diagnostics, TypeScript only uses the fileName and text properties.
|
---|
882 | // The redundant '()' are here is to avoid having clang-format breaking the line incorrectly.
|
---|
883 | return { fileName: span.start.file.url, text: span.start.file.content };
|
---|
884 | }
|
---|
885 | function diagnosticSourceOfFileName(fileName, program) {
|
---|
886 | var sourceFile = program.getSourceFile(fileName);
|
---|
887 | if (sourceFile)
|
---|
888 | return sourceFile;
|
---|
889 | // If we are reporting diagnostics for a source file that is not in the project then we need
|
---|
890 | // to fake a source file so the diagnostic formatting routines can emit the file name.
|
---|
891 | // The redundant '()' are here is to avoid having clang-format breaking the line incorrectly.
|
---|
892 | return { fileName: fileName, text: '' };
|
---|
893 | }
|
---|
894 | function diagnosticChainFromFormattedDiagnosticChain(chain) {
|
---|
895 | return {
|
---|
896 | messageText: chain.message,
|
---|
897 | next: chain.next && chain.next.map(diagnosticChainFromFormattedDiagnosticChain),
|
---|
898 | position: chain.position
|
---|
899 | };
|
---|
900 | }
|
---|
901 | function syntaxErrorToDiagnostics(error, program) {
|
---|
902 | var parserErrors = compiler_1.getParseErrors(error);
|
---|
903 | if (parserErrors && parserErrors.length) {
|
---|
904 | return parserErrors.map(function (e) { return ({
|
---|
905 | messageText: e.contextualMessage(),
|
---|
906 | file: diagnosticSourceOfSpan(e.span),
|
---|
907 | start: e.span.start.offset,
|
---|
908 | length: e.span.end.offset - e.span.start.offset,
|
---|
909 | category: ts.DiagnosticCategory.Error,
|
---|
910 | source: api_1.SOURCE,
|
---|
911 | code: api_1.DEFAULT_ERROR_CODE
|
---|
912 | }); });
|
---|
913 | }
|
---|
914 | else if (compiler_1.isFormattedError(error)) {
|
---|
915 | return [{
|
---|
916 | messageText: error.message,
|
---|
917 | chain: error.chain && diagnosticChainFromFormattedDiagnosticChain(error.chain),
|
---|
918 | category: ts.DiagnosticCategory.Error,
|
---|
919 | source: api_1.SOURCE,
|
---|
920 | code: api_1.DEFAULT_ERROR_CODE,
|
---|
921 | position: error.position
|
---|
922 | }];
|
---|
923 | }
|
---|
924 | var ngModuleErrorData = compiler_1.getMissingNgModuleMetadataErrorData(error);
|
---|
925 | if (ngModuleErrorData !== null) {
|
---|
926 | // This error represents the import or export of an `NgModule` that didn't have valid metadata.
|
---|
927 | // This _might_ happen because the NgModule in question is an Ivy-compiled library, and we want
|
---|
928 | // to show a more useful error if that's the case.
|
---|
929 | var ngModuleClass = getDtsClass(program, ngModuleErrorData.fileName, ngModuleErrorData.className);
|
---|
930 | if (ngModuleClass !== null && isIvyNgModule(ngModuleClass)) {
|
---|
931 | return [{
|
---|
932 | messageText: "The NgModule '" + ngModuleErrorData.className + "' in '" + ngModuleErrorData
|
---|
933 | .fileName + "' is imported by this compilation, but appears to be part of a library compiled for Angular Ivy. This may occur because:\n\n 1) the library was processed with 'ngcc'. Removing and reinstalling node_modules may fix this problem.\n\n 2) the library was published for Angular Ivy and v12+ applications only. Check its peer dependencies carefully and ensure that you're using a compatible version of Angular.\n\nSee https://angular.io/errors/NG6999 for more information.\n",
|
---|
934 | category: ts.DiagnosticCategory.Error,
|
---|
935 | code: api_1.DEFAULT_ERROR_CODE,
|
---|
936 | source: api_1.SOURCE,
|
---|
937 | }];
|
---|
938 | }
|
---|
939 | }
|
---|
940 | // Produce a Diagnostic anyway since we know for sure `error` is a SyntaxError
|
---|
941 | return [{
|
---|
942 | messageText: error.message,
|
---|
943 | category: ts.DiagnosticCategory.Error,
|
---|
944 | code: api_1.DEFAULT_ERROR_CODE,
|
---|
945 | source: api_1.SOURCE,
|
---|
946 | }];
|
---|
947 | }
|
---|
948 | function getDtsClass(program, fileName, className) {
|
---|
949 | var e_4, _a;
|
---|
950 | var sf = program.getSourceFile(fileName);
|
---|
951 | if (sf === undefined || !sf.isDeclarationFile) {
|
---|
952 | return null;
|
---|
953 | }
|
---|
954 | try {
|
---|
955 | for (var _b = tslib_1.__values(sf.statements), _c = _b.next(); !_c.done; _c = _b.next()) {
|
---|
956 | var stmt = _c.value;
|
---|
957 | if (!ts.isClassDeclaration(stmt)) {
|
---|
958 | continue;
|
---|
959 | }
|
---|
960 | if (stmt.name === undefined || stmt.name.text !== className) {
|
---|
961 | continue;
|
---|
962 | }
|
---|
963 | return stmt;
|
---|
964 | }
|
---|
965 | }
|
---|
966 | catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
---|
967 | finally {
|
---|
968 | try {
|
---|
969 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
---|
970 | }
|
---|
971 | finally { if (e_4) throw e_4.error; }
|
---|
972 | }
|
---|
973 | // No classes found that matched the given name.
|
---|
974 | return null;
|
---|
975 | }
|
---|
976 | function isIvyNgModule(clazz) {
|
---|
977 | var e_5, _a;
|
---|
978 | try {
|
---|
979 | for (var _b = tslib_1.__values(clazz.members), _c = _b.next(); !_c.done; _c = _b.next()) {
|
---|
980 | var member = _c.value;
|
---|
981 | if (!ts.isPropertyDeclaration(member)) {
|
---|
982 | continue;
|
---|
983 | }
|
---|
984 | if (ts.isIdentifier(member.name) && member.name.text === 'ɵmod') {
|
---|
985 | return true;
|
---|
986 | }
|
---|
987 | }
|
---|
988 | }
|
---|
989 | catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
---|
990 | finally {
|
---|
991 | try {
|
---|
992 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
---|
993 | }
|
---|
994 | finally { if (e_5) throw e_5.error; }
|
---|
995 | }
|
---|
996 | // No Ivy 'ɵmod' property found.
|
---|
997 | return false;
|
---|
998 | }
|
---|
999 | });
|
---|
1000 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3JhbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9zcmMvdHJhbnNmb3JtZXJzL3Byb2dyYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0E7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7OztJQUVILDhDQUF3VDtJQUN4VCx1QkFBeUI7SUFDekIsMkJBQTZCO0lBQzdCLCtCQUFpQztJQUVqQyxxR0FBMEU7SUFDMUUscUVBQXFFO0lBQ3JFLDhFQUFnRTtJQUNoRSxtRUFBOEM7SUFDOUMseUVBQTZEO0lBQzdELG1GQUF1RTtJQUV2RSxrRUFBbU87SUFDbk8sc0ZBQWdIO0lBQ2hILHdIQUFpRjtJQUNqRixvRUFBbUM7SUFDbkMsNEZBQTBHO0lBQzFHLDhGQUFrRztJQUNsRyx3RkFBb0U7SUFDcEUsd0dBQTJFO0lBQzNFLHNHQUF5RTtJQUN6RSxvRkFBaUU7SUFDakUsb0VBQWdKO0lBR2hKOzs7T0FHRztJQUNILElBQU0sbUNBQW1DLEdBQUcsRUFBRSxDQUFDO0lBRy9DOztPQUVHO0lBQ0gsSUFBTSxZQUFZLEdBQUcsQ0FBQyxVQUFVLEVBQUUsWUFBWSxFQUFFLE1BQU0sR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dGhpcy5vbGRQcm9ncmFtRW1pdHRlZFNvdXJjZUZpbGVzID0gb2xkUHJvZ3JhbS5nZXRFbWl0dGVkU291cmNlRmlsZXMoKTtcbiAgICB9XG5cbiAgICBpZiAob3B0aW9ucy5mbGF0TW9kdWxlT3V0RmlsZSkge1xuICAgICAgY29uc3Qge2hvc3Q6IGJ1bmRsZUhvc3QsIGluZGV4TmFtZSwgZXJyb3JzfSA9XG4gICAgICAgICAgY3JlYXRlQnVuZGxlSW5kZXhIb3N0KG9wdGlvbnMsIHRoaXMucm9vdE5hbWVzLCBob3N0LCAoKSA9PiB0aGlzLmZsYXRNb2R1bGVNZXRhZGF0YUNhY2hlKTtcbiAgICAgIGlmIChlcnJvcnMpIHtcbiAgICAgICAgdGhpcy5fb3B0aW9uc0RpYWdub3N0aWNzLnB1c2goLi4uZXJyb3JzLm1hcChlID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlZ29yeTogZS5jYXRlZ29yeSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VUZXh0OiBlLm1lc3NhZ2VUZXh0IGFzIHN0cmluZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogU09VUkNFLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogREVGQVVMVF9FUlJPUl9DT0RFXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHRoaXMucm9vdE5hbWVzLnB1c2goaW5kZXhOYW1lISk7XG4gICAgICAgIHRoaXMuaG9zdCA9IGJ1bmRsZUhvc3Q7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdGhpcy5sb3dlcmlu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k7XG4gICAgICBpZiAoc291cmNlRmlsZXNUb0VtaXQgJiZcbiAgICAgICAgICAoc291cmNlRmlsZXNUb0VtaXQubGVuZ3RoICsgZ2VuVHNGaWxlcy5sZW5ndGgpIDwgTUFYX0ZJTEVfQ09VTlRfRk9SX1NJTkdMRV9GSUxFX0VNSVQpIHtcbiAgICAgICAgY29uc3QgZmlsZU5hbWVzVG9FbWl0ID1cbiAgICAgICAgICAgIFsuLi5zb3VyY2VGaWxlc1RvRW1pdC5tYXAoc2YgPT4gc2YuZmlsZU5hbWUpLCAuLi5nZW5Uc0ZpbGVzLm1hcChnZiA9PiBnZi5nZW5GaWxlVXJsKV07XG4gICAgICAgIGVtaXRSZXN1bHQgPSBtZXJnZUVtaXRSZXN1bHRzQ2FsbGJhY2soXG4gICAgICAgICAgICBmaWxlTmFtZXNUb0VtaXQubWFwKChmaWxlTmFtZSkgPT4gZW1pdFJlc3VsdCA9IGVtaXRDYWxsYmFjayh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3JhbTogdGhpcy50c1Byb2dyYW0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaG9zdDogdGhpcy5ob3N0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IHRoaXMub3B0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGU6IHdyaXRlVHNGaWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVtaXRPbmx5RHRzRmlsZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VzdG9tVHJhbnNmb3JtZXJzOiB0c0N1c3RvbVRyYW5zZm9ybWVycyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRTb3VyY2VGaWxlOiB0aGlzLnRzUHJvZ3JhbS5nZXRTb3VyY2VGaWxlKGZpbGVOYW1lKSxcbiAgIC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gICAgICAgICAgICBsZW5ndGg6IGUuc3Bhbi5lbmQub2Zmc2V0IC0gZS5zcGFuLnN0YXJ0Lm9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5OiB0cy5EaWFnbm9zdGljQ2F0ZWdvcnkuRXJyb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6IFNPVVJDRSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IERFRkFVTFRfRVJST1JfQ09ERVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgfSBlbHNlIGlmIChpc0Zvcm1hdHRlZEVycm9yKGVycm9yKSkge1xuICAgIHJldHVybiBbe1xuICAgICAgbWVzc2FnZVRleHQ6IGVycm9yLm1lc3NhZ2UsXG4gICAgICBjaGFpbjogZXJyb3IuY2hhaW4gJiYgZGlhZ25vc3RpY0NoYWluRnJvbUZvcm1hdHRlZERpYWdub3N0aWNDaGFpbihlcnJvci5jaGFpbiksXG4gICAgICBjYXRlZ29yeTogdHMuRGlhZ25vc3RpY0NhdGVnb3J5LkVycm9yLFxuICAgICAgc291cmNlOiBTT1VSQ0UsXG4gICAgICBjb2RlOiBERUZBVUxUX0VSUk9SX0NPREUsXG4gICAgICBwb3NpdGlvbjogZXJyb3IucG9zaXRpb25cbiAgICB9XTtcbiAgfVxuXG4gIGNvbnN0IG5nTW9kdWxlRXJyb3JEYXRhID0gZ2V0TWlzc2luZ05nTW9kdWxlTWV0YWRhdGFFcnJvckRhdGEoZXJyb3IpO1xuICBpZiAobmdNb2R1bGVFcnJvckRhdGEgIT09IG51bGwpIHtcbiAgICAvLyBUaGlzIGVycm9yIHJlcHJlc2VudHMgdGhlIGltcG9ydCBvciBleHBvcnQgb2YgYW4gYE5nTW9kdWxlYCB0aGF0IGRpZG4ndCBoYXZlIHZhbGlkIG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