source: trip-planner-front/node_modules/@angular/compiler-cli/src/perform_compile.js@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 48.9 KB
Line 
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/perform_compile", ["require", "exports", "tslib", "@angular/compiler", "typescript", "@angular/compiler-cli/src/ngtsc/file_system", "@angular/compiler-cli/src/ngtsc/diagnostics", "@angular/compiler-cli/src/transformers/api", "@angular/compiler-cli/src/transformers/entry_points", "@angular/compiler-cli/src/transformers/util"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.defaultGatherDiagnostics = exports.performCompilation = exports.exitCodeFromResult = exports.readConfiguration = exports.calcProjectFileAndBasePath = exports.formatDiagnostics = exports.formatDiagnostic = exports.flattenDiagnosticMessageChain = exports.formatDiagnosticPosition = exports.filterErrorsAndWarnings = void 0;
20 var tslib_1 = require("tslib");
21 var compiler_1 = require("@angular/compiler");
22 var ts = require("typescript");
23 var file_system_1 = require("@angular/compiler-cli/src/ngtsc/file_system");
24 var diagnostics_1 = require("@angular/compiler-cli/src/ngtsc/diagnostics");
25 var api = require("@angular/compiler-cli/src/transformers/api");
26 var ng = require("@angular/compiler-cli/src/transformers/entry_points");
27 var util_1 = require("@angular/compiler-cli/src/transformers/util");
28 function filterErrorsAndWarnings(diagnostics) {
29 return diagnostics.filter(function (d) { return d.category !== ts.DiagnosticCategory.Message; });
30 }
31 exports.filterErrorsAndWarnings = filterErrorsAndWarnings;
32 var defaultFormatHost = {
33 getCurrentDirectory: function () { return ts.sys.getCurrentDirectory(); },
34 getCanonicalFileName: function (fileName) { return fileName; },
35 getNewLine: function () { return ts.sys.newLine; }
36 };
37 function displayFileName(fileName, host) {
38 return file_system_1.relative(file_system_1.resolve(host.getCurrentDirectory()), file_system_1.resolve(host.getCanonicalFileName(fileName)));
39 }
40 function formatDiagnosticPosition(position, host) {
41 if (host === void 0) { host = defaultFormatHost; }
42 return displayFileName(position.fileName, host) + "(" + (position.line + 1) + "," + (position.column + 1) + ")";
43 }
44 exports.formatDiagnosticPosition = formatDiagnosticPosition;
45 function flattenDiagnosticMessageChain(chain, host, indent) {
46 var e_1, _a;
47 if (host === void 0) { host = defaultFormatHost; }
48 if (indent === void 0) { indent = 0; }
49 var newLine = host.getNewLine();
50 var result = '';
51 if (indent) {
52 result += newLine;
53 for (var i = 0; i < indent; i++) {
54 result += ' ';
55 }
56 }
57 result += chain.messageText;
58 var position = chain.position;
59 // add position if available, and we are not at the depest frame
60 if (position && indent !== 0) {
61 result += " at " + formatDiagnosticPosition(position, host);
62 }
63 indent++;
64 if (chain.next) {
65 try {
66 for (var _b = tslib_1.__values(chain.next), _c = _b.next(); !_c.done; _c = _b.next()) {
67 var kid = _c.value;
68 result += flattenDiagnosticMessageChain(kid, host, indent);
69 }
70 }
71 catch (e_1_1) { e_1 = { error: e_1_1 }; }
72 finally {
73 try {
74 if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
75 }
76 finally { if (e_1) throw e_1.error; }
77 }
78 }
79 return result;
80 }
81 exports.flattenDiagnosticMessageChain = flattenDiagnosticMessageChain;
82 function formatDiagnostic(diagnostic, host) {
83 if (host === void 0) { host = defaultFormatHost; }
84 var result = '';
85 var newLine = host.getNewLine();
86 var span = diagnostic.span;
87 if (span) {
88 result += formatDiagnosticPosition({ fileName: span.start.file.url, line: span.start.line, column: span.start.col }, host) + ": ";
89 }
90 else if (diagnostic.position) {
91 result += formatDiagnosticPosition(diagnostic.position, host) + ": ";
92 }
93 if (diagnostic.span && diagnostic.span.details) {
94 result += diagnostic.span.details + ", " + diagnostic.messageText + newLine;
95 }
96 else if (diagnostic.chain) {
97 result += flattenDiagnosticMessageChain(diagnostic.chain, host) + "." + newLine;
98 }
99 else {
100 result += "" + diagnostic.messageText + newLine;
101 }
102 return result;
103 }
104 exports.formatDiagnostic = formatDiagnostic;
105 function formatDiagnostics(diags, host) {
106 if (host === void 0) { host = defaultFormatHost; }
107 if (diags && diags.length) {
108 return diags
109 .map(function (diagnostic) {
110 if (api.isTsDiagnostic(diagnostic)) {
111 return diagnostics_1.replaceTsWithNgInErrors(ts.formatDiagnosticsWithColorAndContext([diagnostic], host));
112 }
113 else {
114 return formatDiagnostic(diagnostic, host);
115 }
116 })
117 .join('');
118 }
119 else {
120 return '';
121 }
122 }
123 exports.formatDiagnostics = formatDiagnostics;
124 function calcProjectFileAndBasePath(project, host) {
125 if (host === void 0) { host = file_system_1.getFileSystem(); }
126 var absProject = host.resolve(project);
127 var projectIsDir = host.lstat(absProject).isDirectory();
128 var projectFile = projectIsDir ? host.join(absProject, 'tsconfig.json') : absProject;
129 var projectDir = projectIsDir ? absProject : host.dirname(absProject);
130 var basePath = host.resolve(projectDir);
131 return { projectFile: projectFile, basePath: basePath };
132 }
133 exports.calcProjectFileAndBasePath = calcProjectFileAndBasePath;
134 function readConfiguration(project, existingOptions, host) {
135 var _a;
136 if (host === void 0) { host = file_system_1.getFileSystem(); }
137 try {
138 var fs_1 = file_system_1.getFileSystem();
139 var readConfigFile_1 = function (configFile) {
140 return ts.readConfigFile(configFile, function (file) { return host.readFile(host.resolve(file)); });
141 };
142 var readAngularCompilerOptions_1 = function (configFile, parentOptions) {
143 if (parentOptions === void 0) { parentOptions = {}; }
144 var _a = readConfigFile_1(configFile), config = _a.config, error = _a.error;
145 if (error) {
146 // Errors are handled later on by 'parseJsonConfigFileContent'
147 return parentOptions;
148 }
149 // we are only interested into merging 'angularCompilerOptions' as
150 // other options like 'compilerOptions' are merged by TS
151 var existingNgCompilerOptions = tslib_1.__assign(tslib_1.__assign({}, config.angularCompilerOptions), parentOptions);
152 if (config.extends && typeof config.extends === 'string') {
153 var extendedConfigPath = getExtendedConfigPath(configFile, config.extends, host, fs_1);
154 if (extendedConfigPath !== null) {
155 // Call readAngularCompilerOptions recursively to merge NG Compiler options
156 return readAngularCompilerOptions_1(extendedConfigPath, existingNgCompilerOptions);
157 }
158 }
159 return existingNgCompilerOptions;
160 };
161 var _b = calcProjectFileAndBasePath(project, host), projectFile = _b.projectFile, basePath = _b.basePath;
162 var configFileName = host.resolve(host.pwd(), projectFile);
163 var _c = readConfigFile_1(projectFile), config = _c.config, error = _c.error;
164 if (error) {
165 return {
166 project: project,
167 errors: [error],
168 rootNames: [],
169 options: {},
170 emitFlags: api.EmitFlags.Default
171 };
172 }
173 var existingCompilerOptions = tslib_1.__assign(tslib_1.__assign({ genDir: basePath, basePath: basePath }, readAngularCompilerOptions_1(configFileName)), existingOptions);
174 var parseConfigHost = createParseConfigHost(host, fs_1);
175 var _d = ts.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName), options = _d.options, errors = _d.errors, rootNames = _d.fileNames, projectReferences = _d.projectReferences;
176 // Coerce to boolean as `enableIvy` can be `ngtsc|true|false|undefined` here.
177 options.enableIvy = !!((_a = options.enableIvy) !== null && _a !== void 0 ? _a : true);
178 var emitFlags = api.EmitFlags.Default;
179 if (!(options.skipMetadataEmit || options.flatModuleOutFile)) {
180 emitFlags |= api.EmitFlags.Metadata;
181 }
182 if (options.skipTemplateCodegen) {
183 emitFlags = emitFlags & ~api.EmitFlags.Codegen;
184 }
185 return { project: projectFile, rootNames: rootNames, projectReferences: projectReferences, options: options, errors: errors, emitFlags: emitFlags };
186 }
187 catch (e) {
188 var errors = [{
189 category: ts.DiagnosticCategory.Error,
190 messageText: e.stack,
191 file: undefined,
192 start: undefined,
193 length: undefined,
194 source: 'angular',
195 code: api.UNKNOWN_ERROR_CODE,
196 }];
197 return { project: '', errors: errors, rootNames: [], options: {}, emitFlags: api.EmitFlags.Default };
198 }
199 }
200 exports.readConfiguration = readConfiguration;
201 function createParseConfigHost(host, fs) {
202 if (fs === void 0) { fs = file_system_1.getFileSystem(); }
203 return {
204 fileExists: host.exists.bind(host),
205 readDirectory: ts.sys.readDirectory,
206 readFile: host.readFile.bind(host),
207 useCaseSensitiveFileNames: fs.isCaseSensitive(),
208 };
209 }
210 function getExtendedConfigPath(configFile, extendsValue, host, fs) {
211 var result = getExtendedConfigPathWorker(configFile, extendsValue, host, fs);
212 if (result !== null) {
213 return result;
214 }
215 // Try to resolve the paths with a json extension append a json extension to the file in case if
216 // it is missing and the resolution failed. This is to replicate TypeScript behaviour, see:
217 // https://github.com/microsoft/TypeScript/blob/294a5a7d784a5a95a8048ee990400979a6bc3a1c/src/compiler/commandLineParser.ts#L2806
218 return getExtendedConfigPathWorker(configFile, extendsValue + ".json", host, fs);
219 }
220 function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
221 if (extendsValue.startsWith('.') || fs.isRooted(extendsValue)) {
222 var extendedConfigPath = host.resolve(host.dirname(configFile), extendsValue);
223 if (host.exists(extendedConfigPath)) {
224 return extendedConfigPath;
225 }
226 }
227 else {
228 var parseConfigHost = createParseConfigHost(host, fs);
229 // Path isn't a rooted or relative path, resolve like a module.
230 var resolvedModule = ts.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts.ModuleResolutionKind.NodeJs, resolveJsonModule: true }, parseConfigHost).resolvedModule;
231 if (resolvedModule) {
232 return file_system_1.absoluteFrom(resolvedModule.resolvedFileName);
233 }
234 }
235 return null;
236 }
237 function exitCodeFromResult(diags) {
238 if (!diags || filterErrorsAndWarnings(diags).length === 0) {
239 // If we have a result and didn't get any errors, we succeeded.
240 return 0;
241 }
242 // Return 2 if any of the errors were unknown.
243 return diags.some(function (d) { return d.source === 'angular' && d.code === api.UNKNOWN_ERROR_CODE; }) ? 2 : 1;
244 }
245 exports.exitCodeFromResult = exitCodeFromResult;
246 function performCompilation(_a) {
247 var rootNames = _a.rootNames, options = _a.options, host = _a.host, oldProgram = _a.oldProgram, emitCallback = _a.emitCallback, mergeEmitResultsCallback = _a.mergeEmitResultsCallback, _b = _a.gatherDiagnostics, gatherDiagnostics = _b === void 0 ? defaultGatherDiagnostics : _b, customTransformers = _a.customTransformers, _c = _a.emitFlags, emitFlags = _c === void 0 ? api.EmitFlags.Default : _c, _d = _a.modifiedResourceFiles, modifiedResourceFiles = _d === void 0 ? null : _d;
248 var program;
249 var emitResult;
250 var allDiagnostics = [];
251 try {
252 if (!host) {
253 host = ng.createCompilerHost({ options: options });
254 }
255 if (modifiedResourceFiles) {
256 host.getModifiedResourceFiles = function () { return modifiedResourceFiles; };
257 }
258 program = ng.createProgram({ rootNames: rootNames, host: host, options: options, oldProgram: oldProgram });
259 var beforeDiags = Date.now();
260 allDiagnostics.push.apply(allDiagnostics, tslib_1.__spreadArray([], tslib_1.__read(gatherDiagnostics(program))));
261 if (options.diagnostics) {
262 var afterDiags = Date.now();
263 allDiagnostics.push(util_1.createMessageDiagnostic("Time for diagnostics: " + (afterDiags - beforeDiags) + "ms."));
264 }
265 if (!hasErrors(allDiagnostics)) {
266 emitResult =
267 program.emit({ emitCallback: emitCallback, mergeEmitResultsCallback: mergeEmitResultsCallback, customTransformers: customTransformers, emitFlags: emitFlags });
268 allDiagnostics.push.apply(allDiagnostics, tslib_1.__spreadArray([], tslib_1.__read(emitResult.diagnostics)));
269 return { diagnostics: allDiagnostics, program: program, emitResult: emitResult };
270 }
271 return { diagnostics: allDiagnostics, program: program };
272 }
273 catch (e) {
274 var errMsg = void 0;
275 var code = void 0;
276 if (compiler_1.isSyntaxError(e)) {
277 // don't report the stack for syntax errors as they are well known errors.
278 errMsg = e.message;
279 code = api.DEFAULT_ERROR_CODE;
280 }
281 else {
282 errMsg = e.stack;
283 // It is not a syntax error we might have a program with unknown state, discard it.
284 program = undefined;
285 code = api.UNKNOWN_ERROR_CODE;
286 }
287 allDiagnostics.push({ category: ts.DiagnosticCategory.Error, messageText: errMsg, code: code, source: api.SOURCE });
288 return { diagnostics: allDiagnostics, program: program };
289 }
290 }
291 exports.performCompilation = performCompilation;
292 function defaultGatherDiagnostics(program) {
293 var allDiagnostics = [];
294 function checkDiagnostics(diags) {
295 if (diags) {
296 allDiagnostics.push.apply(allDiagnostics, tslib_1.__spreadArray([], tslib_1.__read(diags)));
297 return !hasErrors(diags);
298 }
299 return true;
300 }
301 var checkOtherDiagnostics = true;
302 // Check parameter diagnostics
303 checkOtherDiagnostics = checkOtherDiagnostics &&
304 checkDiagnostics(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(program.getTsOptionDiagnostics())), tslib_1.__read(program.getNgOptionDiagnostics())));
305 // Check syntactic diagnostics
306 checkOtherDiagnostics =
307 checkOtherDiagnostics && checkDiagnostics(program.getTsSyntacticDiagnostics());
308 // Check TypeScript semantic and Angular structure diagnostics
309 checkOtherDiagnostics =
310 checkOtherDiagnostics &&
311 checkDiagnostics(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(program.getTsSemanticDiagnostics())), tslib_1.__read(program.getNgStructuralDiagnostics())));
312 // Check Angular semantic diagnostics
313 checkOtherDiagnostics =
314 checkOtherDiagnostics && checkDiagnostics(program.getNgSemanticDiagnostics());
315 return allDiagnostics;
316 }
317 exports.defaultGatherDiagnostics = defaultGatherDiagnostics;
318 function hasErrors(diags) {
319 return diags.some(function (d) { return d.category === ts.DiagnosticCategory.Error; });
320 }
321});
322//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVyZm9ybV9jb21waWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL3NyYy9wZXJmb3JtX2NvbXBpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7OztJQUVILDhDQUEwRDtJQUMxR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JzZUpzb25Db25maWdGaWxlQ29udGVudCdcbiAgICAgICAgICAgIHJldHVybiBwYXJlbnRPcHRpb25zO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIHdlIGFyZSBvbmx5IGludGVyZXN0ZWQgaW50byBtZXJnaW5nICdhbmd1bGFyQ29tcGlsZXJPcHRpb25zJyBhc1xuICAgICAgICAgIC8vIG90aGVyIG9wdGlvbnMgbGlrZSAnY29tcGlsZXJPcHRpb25zJyBhcmUgbWVyZ2VkIGJ5IFRTXG4gICAgICAgICAgY29uc3QgZXhpc3RpbmdOZ0NvbXBpbGVyT3B0aW9ucyA9IHsuLi5jb25maWcuYW5ndWxhckNvbXBpbGVyT3B0aW9ucywgLi4ucGFyZW50T3B0aW9uc307XG5cbiAgICAgICAgICBpZiAoY29uZmlnLmV4dGVuZHMgJiYgdHlwZW9mIGNvbmZpZy5leHRlbmRzID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgY29uc3QgZXh0ZW5kZWRDb25maWdQYXRoID0gZ2V0RXh0ZW5kZWRDb25maWdQYXRoKFxuICAgICAgICAgICAgICAgIGNvbmZpZ0ZpbGUsIGNvbmZpZy5leHRlbmRzLCBob3N0LCBmcyxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIGlmIChleHRlbmRlZENvbmZpZ1BhdGggIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgLy8gQ2FsbCByZWFkQW5ndWxhckNvbXBpbGVyT3B0aW9ucyByZWN1cnNpdmVseSB0byBtZXJnZSBORyBDb21waWxlciBvcHRpb25zXG4gICAgICAgICAgICAgIHJldHVybiByZWFkQW5ndWxhckNvbXBpbGVyT3B0aW9ucyhleHRlbmRlZENvbmZpZ1BhdGgsIGV4aXN0aW5nTmdDb21waWxlck9wdGlvbnMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBleGlzdGluZ05nQ29tcGlsZXJPcHRpb25zO1xuICAgICAgICB9O1xu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