source: trip-planner-front/node_modules/@angular/compiler-cli/src/ngtsc/tsc_plugin.js@ e29cc2e

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

initial commit

  • Property mode set to 100644
File size: 19.2 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/ngtsc/tsc_plugin", ["require", "exports", "tslib", "@angular/compiler-cli/src/ngtsc/core", "@angular/compiler-cli/src/ngtsc/file_system", "@angular/compiler-cli/src/ngtsc/incremental", "@angular/compiler-cli/src/ngtsc/perf", "@angular/compiler-cli/src/ngtsc/program_driver", "@angular/compiler-cli/src/ngtsc/shims", "@angular/compiler-cli/src/ngtsc/typecheck/api"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.NgTscPlugin = void 0;
20 var tslib_1 = require("tslib");
21 var core_1 = require("@angular/compiler-cli/src/ngtsc/core");
22 var file_system_1 = require("@angular/compiler-cli/src/ngtsc/file_system");
23 var incremental_1 = require("@angular/compiler-cli/src/ngtsc/incremental");
24 var perf_1 = require("@angular/compiler-cli/src/ngtsc/perf");
25 var program_driver_1 = require("@angular/compiler-cli/src/ngtsc/program_driver");
26 var shims_1 = require("@angular/compiler-cli/src/ngtsc/shims");
27 var api_1 = require("@angular/compiler-cli/src/ngtsc/typecheck/api");
28 /**
29 * A plugin for `tsc_wrapped` which allows Angular compilation from a plain `ts_library`.
30 */
31 var NgTscPlugin = /** @class */ (function () {
32 function NgTscPlugin(ngOptions) {
33 this.ngOptions = ngOptions;
34 this.name = 'ngtsc';
35 this.options = null;
36 this.host = null;
37 this._compiler = null;
38 file_system_1.setFileSystem(new file_system_1.NodeJSFileSystem());
39 }
40 Object.defineProperty(NgTscPlugin.prototype, "compiler", {
41 get: function () {
42 if (this._compiler === null) {
43 throw new Error('Lifecycle error: setupCompilation() must be called first.');
44 }
45 return this._compiler;
46 },
47 enumerable: false,
48 configurable: true
49 });
50 NgTscPlugin.prototype.wrapHost = function (host, inputFiles, options) {
51 // TODO(alxhub): Eventually the `wrapHost()` API will accept the old `ts.Program` (if one is
52 // available). When it does, its `ts.SourceFile`s need to be re-tagged to enable proper
53 // incremental compilation.
54 this.options = tslib_1.__assign(tslib_1.__assign({}, this.ngOptions), options);
55 this.host = core_1.NgCompilerHost.wrap(host, inputFiles, this.options, /* oldProgram */ null);
56 return this.host;
57 };
58 NgTscPlugin.prototype.setupCompilation = function (program, oldProgram) {
59 var e_1, _a;
60 var _b;
61 // TODO(alxhub): we provide a `PerfRecorder` to the compiler, but because we're not driving the
62 // compilation, the information captured within it is incomplete, and may not include timings
63 // for phases such as emit.
64 //
65 // Additionally, nothing actually captures the perf results here, so recording stats at all is
66 // somewhat moot for now :)
67 var perfRecorder = perf_1.ActivePerfRecorder.zeroedToNow();
68 if (this.host === null || this.options === null) {
69 throw new Error('Lifecycle error: setupCompilation() before wrapHost().');
70 }
71 this.host.postProgramCreationCleanup();
72 shims_1.untagAllTsFiles(program);
73 var programDriver = new program_driver_1.TsCreateProgramDriver(program, this.host, this.options, this.host.shimExtensionPrefixes);
74 var strategy = new incremental_1.PatchedProgramIncrementalBuildStrategy();
75 var oldState = oldProgram !== undefined ? strategy.getIncrementalState(oldProgram) : null;
76 var ticket;
77 var modifiedResourceFiles = new Set();
78 if (this.host.getModifiedResourceFiles !== undefined) {
79 try {
80 for (var _c = tslib_1.__values((_b = this.host.getModifiedResourceFiles()) !== null && _b !== void 0 ? _b : []), _d = _c.next(); !_d.done; _d = _c.next()) {
81 var resourceFile = _d.value;
82 modifiedResourceFiles.add(file_system_1.resolve(resourceFile));
83 }
84 }
85 catch (e_1_1) { e_1 = { error: e_1_1 }; }
86 finally {
87 try {
88 if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
89 }
90 finally { if (e_1) throw e_1.error; }
91 }
92 }
93 if (oldProgram === undefined || oldState === null) {
94 ticket = core_1.freshCompilationTicket(program, this.options, strategy, programDriver, perfRecorder,
95 /* enableTemplateTypeChecker */ false, /* usePoisonedData */ false);
96 }
97 else {
98 strategy.toNextBuildStrategy().getIncrementalState(oldProgram);
99 ticket = core_1.incrementalFromStateTicket(oldProgram, oldState, program, this.options, strategy, programDriver, modifiedResourceFiles, perfRecorder, false, false);
100 }
101 this._compiler = core_1.NgCompiler.fromTicket(ticket, this.host);
102 return {
103 ignoreForDiagnostics: this._compiler.ignoreForDiagnostics,
104 ignoreForEmit: this._compiler.ignoreForEmit,
105 };
106 };
107 NgTscPlugin.prototype.getDiagnostics = function (file) {
108 if (file === undefined) {
109 return this.compiler.getDiagnostics();
110 }
111 return this.compiler.getDiagnosticsForFile(file, api_1.OptimizeFor.WholeProgram);
112 };
113 NgTscPlugin.prototype.getOptionDiagnostics = function () {
114 return this.compiler.getOptionDiagnostics();
115 };
116 NgTscPlugin.prototype.getNextProgram = function () {
117 return this.compiler.getCurrentProgram();
118 };
119 NgTscPlugin.prototype.createTransformers = function () {
120 // The plugin consumer doesn't know about our perf tracing system, so we consider the emit phase
121 // as beginning now.
122 this.compiler.perfRecorder.phase(perf_1.PerfPhase.TypeScriptEmit);
123 return this.compiler.prepareEmit().transformers;
124 };
125 return NgTscPlugin;
126 }());
127 exports.NgTscPlugin = NgTscPlugin;
128});
129//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNjX3BsdWdpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9zcmMvbmd0c2MvdHNjX3BsdWdpbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIj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AgICAgIHJldHVybiB0aGlzLmNvbXBpbGVyLmdldERpYWdub3N0aWNzKCk7XG4gICAgfVxuICAgIHJldHVybiB0aGlzLmNvbXBpbGVyLmdldERpYWdub3N0aWNzRm9yRmlsZShmaWxlLCBPcHRpbWl6ZUZvci5XaG9sZVByb2dyYW0pO1xuICB9XG5cbiAgZ2V0T3B0aW9uRGlhZ25vc3RpY3MoKTogdHMuRGlhZ25vc3RpY1tdIHtcbiAgICByZXR1cm4gdGhpcy5jb21waWxlci5nZXRPcHRpb25EaWFnbm9zdGljcygpO1xuICB9XG5cbiAgZ2V0TmV4dFByb2dyYW0oKTogdHMuUHJvZ3JhbSB7XG4gICAgcmV0dXJuIHRoaXMuY29tcGlsZXIuZ2V0Q3VycmVudFByb2dyYW0oKTtcbiAgfVxuXG4gIGNyZWF0ZVRyYW5zZm9ybWVycygpOiB0cy5DdXN0b21UcmFuc2Zvcm1lcnMge1xuICAgIC8vIFRoZSBwbHVnaW4gY29uc3VtZXIgZG9lc24ndCBrbm93IGFib3V0IG91ciBwZXJmIHRyYWNpbmcgc3lzdGVtLCBzbyB3ZSBjb25zaWRlciB0aGUgZW1pdCBwaGFzZVxuICAgIC8vIGFzIGJlZ2lubmluZyBub3cuXG4gICAgdGhpcy5jb21waWxlci5wZXJmUmVjb3JkZXIucGhhc2UoUGVyZlBoYXNlLlR5cGVTY3JpcHRFbWl0KTtcbiAgICByZXR1cm4gdGhpcy5jb21waWxlci5wcmVwYXJlRW1pdCgpLnRyYW5zZm9ybWVycztcbiAgfVxufVxuIl19
Note: See TracBrowser for help on using the repository browser.