@angular/compiler-cli 13.0.0-rc.1 → 13.1.0-next.0
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-5VGHS4A4.js +68 -0
- package/bundles/chunk-5VGHS4A4.js.map +6 -0
- package/bundles/chunk-AMD3PZ5E.js +5094 -0
- package/bundles/chunk-AMD3PZ5E.js.map +6 -0
- package/bundles/chunk-BPCUCINV.js +29 -0
- package/bundles/chunk-BPCUCINV.js.map +6 -0
- package/bundles/chunk-CRTDZEUV.js +678 -0
- package/bundles/chunk-CRTDZEUV.js.map +6 -0
- package/bundles/chunk-DDB2HQYR.js +5663 -0
- package/bundles/chunk-DDB2HQYR.js.map +6 -0
- package/bundles/chunk-DLQQUCPJ.js +448 -0
- package/bundles/chunk-DLQQUCPJ.js.map +6 -0
- package/bundles/chunk-E64KJMKN.js +968 -0
- package/bundles/chunk-E64KJMKN.js.map +6 -0
- package/bundles/chunk-GKA4YGOR.js +43 -0
- package/bundles/chunk-GKA4YGOR.js.map +6 -0
- package/bundles/chunk-IG72ZKR7.js +424 -0
- package/bundles/chunk-IG72ZKR7.js.map +6 -0
- package/bundles/chunk-J6CW3T62.js +206 -0
- package/bundles/chunk-J6CW3T62.js.map +6 -0
- package/bundles/chunk-JTYUTYS2.js +56 -0
- package/bundles/chunk-JTYUTYS2.js.map +6 -0
- package/bundles/chunk-M7P4HAA4.js +358 -0
- package/bundles/chunk-M7P4HAA4.js.map +6 -0
- package/bundles/chunk-QKLPWCHI.js +1261 -0
- package/bundles/chunk-QKLPWCHI.js.map +6 -0
- package/bundles/chunk-QLSZVEIC.js +11992 -0
- package/bundles/chunk-QLSZVEIC.js.map +6 -0
- package/bundles/chunk-WOCQ7IIB.js +2175 -0
- package/bundles/chunk-WOCQ7IIB.js.map +6 -0
- package/bundles/chunk-XKKOHZ3B.js +116 -0
- package/bundles/chunk-XKKOHZ3B.js.map +6 -0
- package/bundles/chunk-XPUO7JIT.js +380 -0
- package/bundles/chunk-XPUO7JIT.js.map +6 -0
- package/bundles/index.js +96 -20254
- 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 -16027
- package/bundles/ngcc/index.js.map +2 -2
- package/bundles/ngcc/main-ngcc.js +19 -16111
- package/bundles/ngcc/main-ngcc.js.map +2 -2
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +32 -13784
- 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 -2156
- 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 -20424
- package/bundles/src/bin/ng_xi18n.js.map +2 -2
- package/bundles/src/bin/ngc.js +16 -20437
- package/bundles/src/bin/ngc.js.map +2 -2
- package/bundles_metadata.json +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/src/ng_module.d.ts +1 -2
- package/src/ngtsc/diagnostics/index.d.ts +4 -2
- package/src/ngtsc/diagnostics/src/docs.d.ts +14 -0
- package/src/ngtsc/diagnostics/src/error_details_base_url.d.ts +16 -0
- package/src/ngtsc/diagnostics/src/util.d.ts +2 -0
|
@@ -0,0 +1,206 @@
|
|
|
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
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/api.mjs
|
|
7
|
+
var PerfPhase;
|
|
8
|
+
(function(PerfPhase2) {
|
|
9
|
+
PerfPhase2[PerfPhase2["Unaccounted"] = 0] = "Unaccounted";
|
|
10
|
+
PerfPhase2[PerfPhase2["Setup"] = 1] = "Setup";
|
|
11
|
+
PerfPhase2[PerfPhase2["TypeScriptProgramCreate"] = 2] = "TypeScriptProgramCreate";
|
|
12
|
+
PerfPhase2[PerfPhase2["Reconciliation"] = 3] = "Reconciliation";
|
|
13
|
+
PerfPhase2[PerfPhase2["ResourceUpdate"] = 4] = "ResourceUpdate";
|
|
14
|
+
PerfPhase2[PerfPhase2["TypeScriptDiagnostics"] = 5] = "TypeScriptDiagnostics";
|
|
15
|
+
PerfPhase2[PerfPhase2["Analysis"] = 6] = "Analysis";
|
|
16
|
+
PerfPhase2[PerfPhase2["Resolve"] = 7] = "Resolve";
|
|
17
|
+
PerfPhase2[PerfPhase2["CycleDetection"] = 8] = "CycleDetection";
|
|
18
|
+
PerfPhase2[PerfPhase2["TcbGeneration"] = 9] = "TcbGeneration";
|
|
19
|
+
PerfPhase2[PerfPhase2["TcbUpdateProgram"] = 10] = "TcbUpdateProgram";
|
|
20
|
+
PerfPhase2[PerfPhase2["TypeScriptEmit"] = 11] = "TypeScriptEmit";
|
|
21
|
+
PerfPhase2[PerfPhase2["Compile"] = 12] = "Compile";
|
|
22
|
+
PerfPhase2[PerfPhase2["TtcAutocompletion"] = 13] = "TtcAutocompletion";
|
|
23
|
+
PerfPhase2[PerfPhase2["TtcDiagnostics"] = 14] = "TtcDiagnostics";
|
|
24
|
+
PerfPhase2[PerfPhase2["TtcSymbol"] = 15] = "TtcSymbol";
|
|
25
|
+
PerfPhase2[PerfPhase2["LsReferencesAndRenames"] = 16] = "LsReferencesAndRenames";
|
|
26
|
+
PerfPhase2[PerfPhase2["LsQuickInfo"] = 17] = "LsQuickInfo";
|
|
27
|
+
PerfPhase2[PerfPhase2["LsDefinition"] = 18] = "LsDefinition";
|
|
28
|
+
PerfPhase2[PerfPhase2["LsCompletions"] = 19] = "LsCompletions";
|
|
29
|
+
PerfPhase2[PerfPhase2["LsTcb"] = 20] = "LsTcb";
|
|
30
|
+
PerfPhase2[PerfPhase2["LsDiagnostics"] = 21] = "LsDiagnostics";
|
|
31
|
+
PerfPhase2[PerfPhase2["LsComponentLocations"] = 22] = "LsComponentLocations";
|
|
32
|
+
PerfPhase2[PerfPhase2["LsSignatureHelp"] = 23] = "LsSignatureHelp";
|
|
33
|
+
PerfPhase2[PerfPhase2["LAST"] = 24] = "LAST";
|
|
34
|
+
})(PerfPhase || (PerfPhase = {}));
|
|
35
|
+
var PerfEvent;
|
|
36
|
+
(function(PerfEvent2) {
|
|
37
|
+
PerfEvent2[PerfEvent2["InputDtsFile"] = 0] = "InputDtsFile";
|
|
38
|
+
PerfEvent2[PerfEvent2["InputTsFile"] = 1] = "InputTsFile";
|
|
39
|
+
PerfEvent2[PerfEvent2["AnalyzeComponent"] = 2] = "AnalyzeComponent";
|
|
40
|
+
PerfEvent2[PerfEvent2["AnalyzeDirective"] = 3] = "AnalyzeDirective";
|
|
41
|
+
PerfEvent2[PerfEvent2["AnalyzeInjectable"] = 4] = "AnalyzeInjectable";
|
|
42
|
+
PerfEvent2[PerfEvent2["AnalyzeNgModule"] = 5] = "AnalyzeNgModule";
|
|
43
|
+
PerfEvent2[PerfEvent2["AnalyzePipe"] = 6] = "AnalyzePipe";
|
|
44
|
+
PerfEvent2[PerfEvent2["TraitAnalyze"] = 7] = "TraitAnalyze";
|
|
45
|
+
PerfEvent2[PerfEvent2["TraitReuseAnalysis"] = 8] = "TraitReuseAnalysis";
|
|
46
|
+
PerfEvent2[PerfEvent2["SourceFilePhysicalChange"] = 9] = "SourceFilePhysicalChange";
|
|
47
|
+
PerfEvent2[PerfEvent2["SourceFileLogicalChange"] = 10] = "SourceFileLogicalChange";
|
|
48
|
+
PerfEvent2[PerfEvent2["SourceFileReuseAnalysis"] = 11] = "SourceFileReuseAnalysis";
|
|
49
|
+
PerfEvent2[PerfEvent2["GenerateTcb"] = 12] = "GenerateTcb";
|
|
50
|
+
PerfEvent2[PerfEvent2["SkipGenerateTcbNoInline"] = 13] = "SkipGenerateTcbNoInline";
|
|
51
|
+
PerfEvent2[PerfEvent2["ReuseTypeCheckFile"] = 14] = "ReuseTypeCheckFile";
|
|
52
|
+
PerfEvent2[PerfEvent2["UpdateTypeCheckProgram"] = 15] = "UpdateTypeCheckProgram";
|
|
53
|
+
PerfEvent2[PerfEvent2["EmitSkipSourceFile"] = 16] = "EmitSkipSourceFile";
|
|
54
|
+
PerfEvent2[PerfEvent2["EmitSourceFile"] = 17] = "EmitSourceFile";
|
|
55
|
+
PerfEvent2[PerfEvent2["LAST"] = 18] = "LAST";
|
|
56
|
+
})(PerfEvent || (PerfEvent = {}));
|
|
57
|
+
var PerfCheckpoint;
|
|
58
|
+
(function(PerfCheckpoint2) {
|
|
59
|
+
PerfCheckpoint2[PerfCheckpoint2["Initial"] = 0] = "Initial";
|
|
60
|
+
PerfCheckpoint2[PerfCheckpoint2["TypeScriptProgramCreate"] = 1] = "TypeScriptProgramCreate";
|
|
61
|
+
PerfCheckpoint2[PerfCheckpoint2["PreAnalysis"] = 2] = "PreAnalysis";
|
|
62
|
+
PerfCheckpoint2[PerfCheckpoint2["Analysis"] = 3] = "Analysis";
|
|
63
|
+
PerfCheckpoint2[PerfCheckpoint2["Resolve"] = 4] = "Resolve";
|
|
64
|
+
PerfCheckpoint2[PerfCheckpoint2["TtcGeneration"] = 5] = "TtcGeneration";
|
|
65
|
+
PerfCheckpoint2[PerfCheckpoint2["TtcUpdateProgram"] = 6] = "TtcUpdateProgram";
|
|
66
|
+
PerfCheckpoint2[PerfCheckpoint2["PreEmit"] = 7] = "PreEmit";
|
|
67
|
+
PerfCheckpoint2[PerfCheckpoint2["Emit"] = 8] = "Emit";
|
|
68
|
+
PerfCheckpoint2[PerfCheckpoint2["LAST"] = 9] = "LAST";
|
|
69
|
+
})(PerfCheckpoint || (PerfCheckpoint = {}));
|
|
70
|
+
|
|
71
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/noop.mjs
|
|
72
|
+
var NoopPerfRecorder = class {
|
|
73
|
+
eventCount() {
|
|
74
|
+
}
|
|
75
|
+
memory() {
|
|
76
|
+
}
|
|
77
|
+
phase() {
|
|
78
|
+
return PerfPhase.Unaccounted;
|
|
79
|
+
}
|
|
80
|
+
inPhase(phase, fn) {
|
|
81
|
+
return fn();
|
|
82
|
+
}
|
|
83
|
+
reset() {
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var NOOP_PERF_RECORDER = new NoopPerfRecorder();
|
|
87
|
+
|
|
88
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/clock.mjs
|
|
89
|
+
function mark() {
|
|
90
|
+
return process.hrtime();
|
|
91
|
+
}
|
|
92
|
+
function timeSinceInMicros(mark2) {
|
|
93
|
+
const delta = process.hrtime(mark2);
|
|
94
|
+
return delta[0] * 1e6 + Math.floor(delta[1] / 1e3);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/recorder.mjs
|
|
98
|
+
var ActivePerfRecorder = class {
|
|
99
|
+
constructor(zeroTime) {
|
|
100
|
+
this.zeroTime = zeroTime;
|
|
101
|
+
this.currentPhase = PerfPhase.Unaccounted;
|
|
102
|
+
this.currentPhaseEntered = this.zeroTime;
|
|
103
|
+
this.counters = Array(PerfEvent.LAST).fill(0);
|
|
104
|
+
this.phaseTime = Array(PerfPhase.LAST).fill(0);
|
|
105
|
+
this.bytes = Array(PerfCheckpoint.LAST).fill(0);
|
|
106
|
+
this.memory(PerfCheckpoint.Initial);
|
|
107
|
+
}
|
|
108
|
+
static zeroedToNow() {
|
|
109
|
+
return new ActivePerfRecorder(mark());
|
|
110
|
+
}
|
|
111
|
+
reset() {
|
|
112
|
+
this.counters = Array(PerfEvent.LAST).fill(0);
|
|
113
|
+
this.phaseTime = Array(PerfPhase.LAST).fill(0);
|
|
114
|
+
this.bytes = Array(PerfCheckpoint.LAST).fill(0);
|
|
115
|
+
this.zeroTime = mark();
|
|
116
|
+
this.currentPhase = PerfPhase.Unaccounted;
|
|
117
|
+
this.currentPhaseEntered = this.zeroTime;
|
|
118
|
+
}
|
|
119
|
+
memory(after) {
|
|
120
|
+
this.bytes[after] = process.memoryUsage().heapUsed;
|
|
121
|
+
}
|
|
122
|
+
phase(phase) {
|
|
123
|
+
const previous = this.currentPhase;
|
|
124
|
+
this.phaseTime[this.currentPhase] += timeSinceInMicros(this.currentPhaseEntered);
|
|
125
|
+
this.currentPhase = phase;
|
|
126
|
+
this.currentPhaseEntered = mark();
|
|
127
|
+
return previous;
|
|
128
|
+
}
|
|
129
|
+
inPhase(phase, fn) {
|
|
130
|
+
const previousPhase = this.phase(phase);
|
|
131
|
+
try {
|
|
132
|
+
return fn();
|
|
133
|
+
} finally {
|
|
134
|
+
this.phase(previousPhase);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
eventCount(counter, incrementBy = 1) {
|
|
138
|
+
this.counters[counter] += incrementBy;
|
|
139
|
+
}
|
|
140
|
+
finalize() {
|
|
141
|
+
this.phase(PerfPhase.Unaccounted);
|
|
142
|
+
const results = {
|
|
143
|
+
events: {},
|
|
144
|
+
phases: {},
|
|
145
|
+
memory: {}
|
|
146
|
+
};
|
|
147
|
+
for (let i = 0; i < this.phaseTime.length; i++) {
|
|
148
|
+
if (this.phaseTime[i] > 0) {
|
|
149
|
+
results.phases[PerfPhase[i]] = this.phaseTime[i];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
for (let i = 0; i < this.phaseTime.length; i++) {
|
|
153
|
+
if (this.counters[i] > 0) {
|
|
154
|
+
results.events[PerfEvent[i]] = this.counters[i];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
for (let i = 0; i < this.bytes.length; i++) {
|
|
158
|
+
if (this.bytes[i] > 0) {
|
|
159
|
+
results.memory[PerfCheckpoint[i]] = this.bytes[i];
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return results;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
var DelegatingPerfRecorder = class {
|
|
166
|
+
constructor(target) {
|
|
167
|
+
this.target = target;
|
|
168
|
+
}
|
|
169
|
+
eventCount(counter, incrementBy) {
|
|
170
|
+
this.target.eventCount(counter, incrementBy);
|
|
171
|
+
}
|
|
172
|
+
phase(phase) {
|
|
173
|
+
return this.target.phase(phase);
|
|
174
|
+
}
|
|
175
|
+
inPhase(phase, fn) {
|
|
176
|
+
const previousPhase = this.target.phase(phase);
|
|
177
|
+
try {
|
|
178
|
+
return fn();
|
|
179
|
+
} finally {
|
|
180
|
+
this.target.phase(previousPhase);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
memory(after) {
|
|
184
|
+
this.target.memory(after);
|
|
185
|
+
}
|
|
186
|
+
reset() {
|
|
187
|
+
this.target.reset();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export {
|
|
192
|
+
PerfPhase,
|
|
193
|
+
PerfEvent,
|
|
194
|
+
PerfCheckpoint,
|
|
195
|
+
NOOP_PERF_RECORDER,
|
|
196
|
+
ActivePerfRecorder,
|
|
197
|
+
DelegatingPerfRecorder
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* @license
|
|
201
|
+
* Copyright Google LLC All Rights Reserved.
|
|
202
|
+
*
|
|
203
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
204
|
+
* found in the LICENSE file at https://angular.io/license
|
|
205
|
+
*/
|
|
206
|
+
//# sourceMappingURL=chunk-J6CW3T62.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../packages/compiler-cli/src/ngtsc/perf/src/api.ts", "../../../../../../packages/compiler-cli/src/ngtsc/perf/src/noop.ts", "../../../../../../packages/compiler-cli/src/ngtsc/perf/src/clock.ts", "../../../../../../packages/compiler-cli/src/ngtsc/perf/src/recorder.ts", "../../../../../../packages/compiler-cli/src/ngtsc/perf/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;AAAA,AAWA,IAAY;AAAZ,AAAA,UAAY,YAAS;AAInB,aAAA,WAAA,iBAAA,KAAA;AAOA,aAAA,WAAA,WAAA,KAAA;AAQA,aAAA,WAAA,6BAAA,KAAA;AAOA,aAAA,WAAA,oBAAA,KAAA;AAOA,aAAA,WAAA,oBAAA,KAAA;AAKA,aAAA,WAAA,2BAAA,KAAA;AAKA,aAAA,WAAA,cAAA,KAAA;AAMA,aAAA,WAAA,aAAA,KAAA;AAKA,aAAA,WAAA,oBAAA,KAAA;AAKA,aAAA,WAAA,mBAAA,KAAA;AAKA,aAAA,WAAA,sBAAA,MAAA;AAMA,aAAA,WAAA,oBAAA,MAAA;AAQA,aAAA,WAAA,aAAA,MAAA;AAKA,aAAA,WAAA,uBAAA,MAAA;AAKA,aAAA,WAAA,oBAAA,MAAA;AAKA,aAAA,WAAA,eAAA,MAAA;AAMA,aAAA,WAAA,4BAAA,MAAA;AAKA,aAAA,WAAA,iBAAA,MAAA;AAMA,aAAA,WAAA,kBAAA,MAAA;AAMA,aAAA,WAAA,mBAAA,MAAA;AAMA,aAAA,WAAA,WAAA,MAAA;AAKA,aAAA,WAAA,mBAAA,MAAA;AAMA,aAAA,WAAA,0BAAA,MAAA;AAKA,aAAA,WAAA,qBAAA,MAAA;AAKA,aAAA,WAAA,UAAA,MAAA;GA/IU,aAAA,aAAS;AAqJrB,IAAY;AAAZ,AAAA,UAAY,YAAS;AAInB,aAAA,WAAA,kBAAA,KAAA;AAKA,aAAA,WAAA,iBAAA,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,UAAI,KAAK,SAAS,KAAK,GAAG;AACxB,gBAAQ,OAAO,UAAU,MAAM,KAAK,SAAS;;;AAIjD,aAAS,IAAI,GAAG,IAAI,KAAK,MAAM,QAAQ,KAAK;AAC1C,UAAI,KAAK,MAAM,KAAK,GAAG;AACrB,gBAAQ,OAAO,eAAe,MAAM,KAAK,MAAM;;;AAInD,WAAO;;;AAWL,mCAA6B;EACjC,YAAmB,QAAoB;AAApB,SAAA,SAAA;;EAEnB,WAAW,SAAoB,aAAoB;AACjD,SAAK,OAAO,WAAW,SAAS;;EAGlC,MAAM,OAAgB;AACpB,WAAO,KAAK,OAAO,MAAM;;EAG3B,QAAW,OAAkB,IAAW;AAGtC,UAAM,gBAAgB,KAAK,OAAO,MAAM;AACxC,QAAI;AACF,aAAO;;AAEP,WAAK,OAAO,MAAM;;;EAItB,OAAO,OAAqB;AAC1B,SAAK,OAAO,OAAO;;EAGrB,QAAK;AACH,SAAK,OAAO;;;ACvJhB",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/logger.mjs
|
|
7
|
+
var LogLevel;
|
|
8
|
+
(function(LogLevel2) {
|
|
9
|
+
LogLevel2[LogLevel2["debug"] = 0] = "debug";
|
|
10
|
+
LogLevel2[LogLevel2["info"] = 1] = "info";
|
|
11
|
+
LogLevel2[LogLevel2["warn"] = 2] = "warn";
|
|
12
|
+
LogLevel2[LogLevel2["error"] = 3] = "error";
|
|
13
|
+
})(LogLevel || (LogLevel = {}));
|
|
14
|
+
|
|
15
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/console_logger.mjs
|
|
16
|
+
var RESET = "[0m";
|
|
17
|
+
var RED = "[31m";
|
|
18
|
+
var YELLOW = "[33m";
|
|
19
|
+
var BLUE = "[36m";
|
|
20
|
+
var DEBUG = `${BLUE}Debug:${RESET}`;
|
|
21
|
+
var WARN = `${YELLOW}Warning:${RESET}`;
|
|
22
|
+
var ERROR = `${RED}Error:${RESET}`;
|
|
23
|
+
var ConsoleLogger = class {
|
|
24
|
+
constructor(level) {
|
|
25
|
+
this.level = level;
|
|
26
|
+
}
|
|
27
|
+
debug(...args) {
|
|
28
|
+
if (this.level <= LogLevel.debug)
|
|
29
|
+
console.debug(DEBUG, ...args);
|
|
30
|
+
}
|
|
31
|
+
info(...args) {
|
|
32
|
+
if (this.level <= LogLevel.info)
|
|
33
|
+
console.info(...args);
|
|
34
|
+
}
|
|
35
|
+
warn(...args) {
|
|
36
|
+
if (this.level <= LogLevel.warn)
|
|
37
|
+
console.warn(WARN, ...args);
|
|
38
|
+
}
|
|
39
|
+
error(...args) {
|
|
40
|
+
if (this.level <= LogLevel.error)
|
|
41
|
+
console.error(ERROR, ...args);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
LogLevel,
|
|
47
|
+
ConsoleLogger
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @license
|
|
51
|
+
* Copyright Google LLC All Rights Reserved.
|
|
52
|
+
*
|
|
53
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
54
|
+
* found in the LICENSE file at https://angular.io/license
|
|
55
|
+
*/
|
|
56
|
+
//# sourceMappingURL=chunk-JTYUTYS2.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../packages/compiler-cli/src/ngtsc/logging/src/logger.ts", "../../../../../../packages/compiler-cli/src/ngtsc/logging/src/console_logger.ts", "../../../../../../packages/compiler-cli/src/ngtsc/logging/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;AAAA,AAoBA,IAAY;AAAZ,AAAA,UAAY,WAAQ;AAClB,YAAA,UAAA,WAAA,KAAA;AACA,YAAA,UAAA,UAAA,KAAA;AACA,YAAA,UAAA,UAAA,KAAA;AACA,YAAA,UAAA,WAAA,KAAA;GAJU,YAAA,YAAQ;;;ACpBpB,AASA,IAAM,QAAQ;AACd,IAAM,MAAM;AACZ,IAAM,SAAS;AACf,IAAM,OAAO;AAEN,IAAM,QAAQ,GAAG,aAAa;AAC9B,IAAM,OAAO,GAAG,iBAAiB;AACjC,IAAM,QAAQ,GAAG,YAAY;AAQ9B,0BAAoB;EACxB,YAAmB,OAAe;AAAf,SAAA,QAAA;;EACnB,SAAS,MAAc;AACrB,QAAI,KAAK,SAAS,SAAS;AAAO,cAAQ,MAAM,OAAO,GAAG;;EAE5D,QAAQ,MAAc;AACpB,QAAI,KAAK,SAAS,SAAS;AAAM,cAAQ,KAAK,GAAG;;EAEnD,QAAQ,MAAc;AACpB,QAAI,KAAK,SAAS,SAAS;AAAM,cAAQ,KAAK,MAAM,GAAG;;EAEzD,SAAS,MAAc;AACrB,QAAI,KAAK,SAAS,SAAS;AAAO,cAAQ,MAAM,OAAO,GAAG;;;ACpC9D",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,358 @@
|
|
|
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
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.mjs
|
|
7
|
+
import ts2 from "typescript";
|
|
8
|
+
|
|
9
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/patch_alias_reference_resolution.mjs
|
|
10
|
+
import ts from "typescript";
|
|
11
|
+
var patchedReferencedAliasesSymbol = Symbol("patchedReferencedAliases");
|
|
12
|
+
function loadIsReferencedAliasDeclarationPatch(context) {
|
|
13
|
+
if (!isTransformationContextWithEmitResolver(context)) {
|
|
14
|
+
throwIncompatibleTransformationContextError();
|
|
15
|
+
}
|
|
16
|
+
const emitResolver = context.getEmitResolver();
|
|
17
|
+
const existingReferencedAliases = emitResolver[patchedReferencedAliasesSymbol];
|
|
18
|
+
if (existingReferencedAliases !== void 0) {
|
|
19
|
+
return existingReferencedAliases;
|
|
20
|
+
}
|
|
21
|
+
const originalIsReferencedAliasDeclaration = emitResolver.isReferencedAliasDeclaration;
|
|
22
|
+
if (originalIsReferencedAliasDeclaration === void 0) {
|
|
23
|
+
throwIncompatibleTransformationContextError();
|
|
24
|
+
}
|
|
25
|
+
const referencedAliases = new Set();
|
|
26
|
+
emitResolver.isReferencedAliasDeclaration = function(node, ...args) {
|
|
27
|
+
if (isAliasImportDeclaration(node) && referencedAliases.has(node)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return originalIsReferencedAliasDeclaration.call(emitResolver, node, ...args);
|
|
31
|
+
};
|
|
32
|
+
return emitResolver[patchedReferencedAliasesSymbol] = referencedAliases;
|
|
33
|
+
}
|
|
34
|
+
function isAliasImportDeclaration(node) {
|
|
35
|
+
return ts.isImportSpecifier(node) || ts.isNamespaceImport(node) || ts.isImportClause(node);
|
|
36
|
+
}
|
|
37
|
+
function isTransformationContextWithEmitResolver(context) {
|
|
38
|
+
return context.getEmitResolver !== void 0;
|
|
39
|
+
}
|
|
40
|
+
function throwIncompatibleTransformationContextError() {
|
|
41
|
+
throw Error("Unable to downlevel Angular decorators due to an incompatible TypeScript version.\nIf you recently updated TypeScript and this issue surfaces now, consider downgrading.\n\nPlease report an issue on the Angular repositories when this issue surfaces and you are using a supposedly compatible TypeScript version.");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.mjs
|
|
45
|
+
function isAngularDecorator(decorator, isCore) {
|
|
46
|
+
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
47
|
+
}
|
|
48
|
+
var DECORATOR_INVOCATION_JSDOC_TYPE = "!Array<{type: !Function, args: (undefined|!Array<?>)}>";
|
|
49
|
+
function extractMetadataFromSingleDecorator(decorator, diagnostics) {
|
|
50
|
+
const metadataProperties = [];
|
|
51
|
+
const expr = decorator.expression;
|
|
52
|
+
switch (expr.kind) {
|
|
53
|
+
case ts2.SyntaxKind.Identifier:
|
|
54
|
+
metadataProperties.push(ts2.createPropertyAssignment("type", expr));
|
|
55
|
+
break;
|
|
56
|
+
case ts2.SyntaxKind.CallExpression:
|
|
57
|
+
const call = expr;
|
|
58
|
+
metadataProperties.push(ts2.createPropertyAssignment("type", call.expression));
|
|
59
|
+
if (call.arguments.length) {
|
|
60
|
+
const args = [];
|
|
61
|
+
for (const arg of call.arguments) {
|
|
62
|
+
args.push(arg);
|
|
63
|
+
}
|
|
64
|
+
const argsArrayLiteral = ts2.createArrayLiteral(ts2.createNodeArray(args, true));
|
|
65
|
+
metadataProperties.push(ts2.createPropertyAssignment("args", argsArrayLiteral));
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
diagnostics.push({
|
|
70
|
+
file: decorator.getSourceFile(),
|
|
71
|
+
start: decorator.getStart(),
|
|
72
|
+
length: decorator.getEnd() - decorator.getStart(),
|
|
73
|
+
messageText: `${ts2.SyntaxKind[decorator.kind]} not implemented in gathering decorator metadata.`,
|
|
74
|
+
category: ts2.DiagnosticCategory.Error,
|
|
75
|
+
code: 0
|
|
76
|
+
});
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
return ts2.createObjectLiteral(metadataProperties);
|
|
80
|
+
}
|
|
81
|
+
function createCtorParametersClassProperty(diagnostics, entityNameToExpression, ctorParameters, isClosureCompilerEnabled) {
|
|
82
|
+
const params = [];
|
|
83
|
+
for (const ctorParam of ctorParameters) {
|
|
84
|
+
if (!ctorParam.type && ctorParam.decorators.length === 0) {
|
|
85
|
+
params.push(ts2.createNull());
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const paramType = ctorParam.type ? typeReferenceToExpression(entityNameToExpression, ctorParam.type) : void 0;
|
|
89
|
+
const members = [ts2.createPropertyAssignment("type", paramType || ts2.createIdentifier("undefined"))];
|
|
90
|
+
const decorators = [];
|
|
91
|
+
for (const deco of ctorParam.decorators) {
|
|
92
|
+
decorators.push(extractMetadataFromSingleDecorator(deco, diagnostics));
|
|
93
|
+
}
|
|
94
|
+
if (decorators.length) {
|
|
95
|
+
members.push(ts2.createPropertyAssignment("decorators", ts2.createArrayLiteral(decorators)));
|
|
96
|
+
}
|
|
97
|
+
params.push(ts2.createObjectLiteral(members));
|
|
98
|
+
}
|
|
99
|
+
const initializer = ts2.createArrowFunction(void 0, void 0, [], void 0, ts2.createToken(ts2.SyntaxKind.EqualsGreaterThanToken), ts2.createArrayLiteral(params, true));
|
|
100
|
+
const ctorProp = ts2.createProperty(void 0, [ts2.createToken(ts2.SyntaxKind.StaticKeyword)], "ctorParameters", void 0, void 0, initializer);
|
|
101
|
+
if (isClosureCompilerEnabled) {
|
|
102
|
+
ts2.setSyntheticLeadingComments(ctorProp, [
|
|
103
|
+
{
|
|
104
|
+
kind: ts2.SyntaxKind.MultiLineCommentTrivia,
|
|
105
|
+
text: [
|
|
106
|
+
`*`,
|
|
107
|
+
` * @type {function(): !Array<(null|{`,
|
|
108
|
+
` * type: ?,`,
|
|
109
|
+
` * decorators: (undefined|${DECORATOR_INVOCATION_JSDOC_TYPE}),`,
|
|
110
|
+
` * })>}`,
|
|
111
|
+
` * @nocollapse`,
|
|
112
|
+
` `
|
|
113
|
+
].join("\n"),
|
|
114
|
+
pos: -1,
|
|
115
|
+
end: -1,
|
|
116
|
+
hasTrailingNewLine: true
|
|
117
|
+
}
|
|
118
|
+
]);
|
|
119
|
+
}
|
|
120
|
+
return ctorProp;
|
|
121
|
+
}
|
|
122
|
+
function typeReferenceToExpression(entityNameToExpression, node) {
|
|
123
|
+
let kind = node.kind;
|
|
124
|
+
if (ts2.isLiteralTypeNode(node)) {
|
|
125
|
+
kind = node.literal.kind;
|
|
126
|
+
}
|
|
127
|
+
switch (kind) {
|
|
128
|
+
case ts2.SyntaxKind.FunctionType:
|
|
129
|
+
case ts2.SyntaxKind.ConstructorType:
|
|
130
|
+
return ts2.createIdentifier("Function");
|
|
131
|
+
case ts2.SyntaxKind.ArrayType:
|
|
132
|
+
case ts2.SyntaxKind.TupleType:
|
|
133
|
+
return ts2.createIdentifier("Array");
|
|
134
|
+
case ts2.SyntaxKind.TypePredicate:
|
|
135
|
+
case ts2.SyntaxKind.TrueKeyword:
|
|
136
|
+
case ts2.SyntaxKind.FalseKeyword:
|
|
137
|
+
case ts2.SyntaxKind.BooleanKeyword:
|
|
138
|
+
return ts2.createIdentifier("Boolean");
|
|
139
|
+
case ts2.SyntaxKind.StringLiteral:
|
|
140
|
+
case ts2.SyntaxKind.StringKeyword:
|
|
141
|
+
return ts2.createIdentifier("String");
|
|
142
|
+
case ts2.SyntaxKind.ObjectKeyword:
|
|
143
|
+
return ts2.createIdentifier("Object");
|
|
144
|
+
case ts2.SyntaxKind.NumberKeyword:
|
|
145
|
+
case ts2.SyntaxKind.NumericLiteral:
|
|
146
|
+
return ts2.createIdentifier("Number");
|
|
147
|
+
case ts2.SyntaxKind.TypeReference:
|
|
148
|
+
const typeRef = node;
|
|
149
|
+
return entityNameToExpression(typeRef.typeName);
|
|
150
|
+
case ts2.SyntaxKind.UnionType:
|
|
151
|
+
const childTypeNodes = node.types.filter((t) => !(ts2.isLiteralTypeNode(t) && t.literal.kind === ts2.SyntaxKind.NullKeyword));
|
|
152
|
+
return childTypeNodes.length === 1 ? typeReferenceToExpression(entityNameToExpression, childTypeNodes[0]) : void 0;
|
|
153
|
+
default:
|
|
154
|
+
return void 0;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function symbolIsRuntimeValue(typeChecker, symbol) {
|
|
158
|
+
if (symbol.flags & ts2.SymbolFlags.Alias) {
|
|
159
|
+
symbol = typeChecker.getAliasedSymbol(symbol);
|
|
160
|
+
}
|
|
161
|
+
return (symbol.flags & ts2.SymbolFlags.Value & ts2.SymbolFlags.ConstEnumExcludes) !== 0;
|
|
162
|
+
}
|
|
163
|
+
function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore, isClosureCompilerEnabled, skipClassDecorators) {
|
|
164
|
+
function addJSDocTypeAnnotation(node, jsdocType) {
|
|
165
|
+
if (!isClosureCompilerEnabled) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
ts2.setSyntheticLeadingComments(node, [
|
|
169
|
+
{
|
|
170
|
+
kind: ts2.SyntaxKind.MultiLineCommentTrivia,
|
|
171
|
+
text: `* @type {${jsdocType}} `,
|
|
172
|
+
pos: -1,
|
|
173
|
+
end: -1,
|
|
174
|
+
hasTrailingNewLine: true
|
|
175
|
+
}
|
|
176
|
+
]);
|
|
177
|
+
}
|
|
178
|
+
function createDecoratorClassProperty(decoratorList) {
|
|
179
|
+
const modifier = ts2.createToken(ts2.SyntaxKind.StaticKeyword);
|
|
180
|
+
const initializer = ts2.createArrayLiteral(decoratorList, true);
|
|
181
|
+
const prop = ts2.createProperty(void 0, [modifier], "decorators", void 0, void 0, initializer);
|
|
182
|
+
addJSDocTypeAnnotation(prop, DECORATOR_INVOCATION_JSDOC_TYPE);
|
|
183
|
+
return prop;
|
|
184
|
+
}
|
|
185
|
+
function createPropDecoratorsClassProperty(diagnostics2, properties) {
|
|
186
|
+
const entries = [];
|
|
187
|
+
for (const [name, decorators] of properties.entries()) {
|
|
188
|
+
entries.push(ts2.createPropertyAssignment(name, ts2.createArrayLiteral(decorators.map((deco) => extractMetadataFromSingleDecorator(deco, diagnostics2)))));
|
|
189
|
+
}
|
|
190
|
+
const initializer = ts2.createObjectLiteral(entries, true);
|
|
191
|
+
const prop = ts2.createProperty(void 0, [ts2.createToken(ts2.SyntaxKind.StaticKeyword)], "propDecorators", void 0, void 0, initializer);
|
|
192
|
+
addJSDocTypeAnnotation(prop, `!Object<string, ${DECORATOR_INVOCATION_JSDOC_TYPE}>`);
|
|
193
|
+
return prop;
|
|
194
|
+
}
|
|
195
|
+
return (context) => {
|
|
196
|
+
const referencedParameterTypes = loadIsReferencedAliasDeclarationPatch(context);
|
|
197
|
+
function entityNameToExpression(name) {
|
|
198
|
+
const symbol = typeChecker.getSymbolAtLocation(name);
|
|
199
|
+
if (!symbol || !symbolIsRuntimeValue(typeChecker, symbol) || !symbol.declarations || symbol.declarations.length === 0) {
|
|
200
|
+
return void 0;
|
|
201
|
+
}
|
|
202
|
+
if (ts2.isQualifiedName(name)) {
|
|
203
|
+
const containerExpr = entityNameToExpression(name.left);
|
|
204
|
+
if (containerExpr === void 0) {
|
|
205
|
+
return void 0;
|
|
206
|
+
}
|
|
207
|
+
return ts2.createPropertyAccess(containerExpr, name.right);
|
|
208
|
+
}
|
|
209
|
+
const decl = symbol.declarations[0];
|
|
210
|
+
if (isAliasImportDeclaration(decl)) {
|
|
211
|
+
referencedParameterTypes.add(decl);
|
|
212
|
+
if (decl.name !== void 0) {
|
|
213
|
+
return ts2.getMutableClone(decl.name);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return ts2.getMutableClone(name);
|
|
217
|
+
}
|
|
218
|
+
function transformClassElement(element) {
|
|
219
|
+
element = ts2.visitEachChild(element, decoratorDownlevelVisitor, context);
|
|
220
|
+
const decoratorsToKeep = [];
|
|
221
|
+
const toLower = [];
|
|
222
|
+
const decorators = host.getDecoratorsOfDeclaration(element) || [];
|
|
223
|
+
for (const decorator of decorators) {
|
|
224
|
+
const decoratorNode = decorator.node;
|
|
225
|
+
if (!isAngularDecorator(decorator, isCore)) {
|
|
226
|
+
decoratorsToKeep.push(decoratorNode);
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
toLower.push(decoratorNode);
|
|
230
|
+
}
|
|
231
|
+
if (!toLower.length)
|
|
232
|
+
return [void 0, element, []];
|
|
233
|
+
if (!element.name || !ts2.isIdentifier(element.name)) {
|
|
234
|
+
diagnostics.push({
|
|
235
|
+
file: element.getSourceFile(),
|
|
236
|
+
start: element.getStart(),
|
|
237
|
+
length: element.getEnd() - element.getStart(),
|
|
238
|
+
messageText: `Cannot process decorators for class element with non-analyzable name.`,
|
|
239
|
+
category: ts2.DiagnosticCategory.Error,
|
|
240
|
+
code: 0
|
|
241
|
+
});
|
|
242
|
+
return [void 0, element, []];
|
|
243
|
+
}
|
|
244
|
+
const name = element.name.text;
|
|
245
|
+
const mutable = ts2.getMutableClone(element);
|
|
246
|
+
mutable.decorators = decoratorsToKeep.length ? ts2.setTextRange(ts2.createNodeArray(decoratorsToKeep), mutable.decorators) : void 0;
|
|
247
|
+
return [name, mutable, toLower];
|
|
248
|
+
}
|
|
249
|
+
function transformConstructor(ctor) {
|
|
250
|
+
ctor = ts2.visitEachChild(ctor, decoratorDownlevelVisitor, context);
|
|
251
|
+
const newParameters = [];
|
|
252
|
+
const oldParameters = ts2.visitParameterList(ctor.parameters, decoratorDownlevelVisitor, context);
|
|
253
|
+
const parametersInfo = [];
|
|
254
|
+
for (const param of oldParameters) {
|
|
255
|
+
const decoratorsToKeep = [];
|
|
256
|
+
const paramInfo = { decorators: [], type: null };
|
|
257
|
+
const decorators = host.getDecoratorsOfDeclaration(param) || [];
|
|
258
|
+
for (const decorator of decorators) {
|
|
259
|
+
const decoratorNode = decorator.node;
|
|
260
|
+
if (!isAngularDecorator(decorator, isCore)) {
|
|
261
|
+
decoratorsToKeep.push(decoratorNode);
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
paramInfo.decorators.push(decoratorNode);
|
|
265
|
+
}
|
|
266
|
+
if (param.type) {
|
|
267
|
+
paramInfo.type = param.type;
|
|
268
|
+
}
|
|
269
|
+
parametersInfo.push(paramInfo);
|
|
270
|
+
const newParam = ts2.updateParameter(param, decoratorsToKeep.length ? decoratorsToKeep : void 0, param.modifiers, param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer);
|
|
271
|
+
newParameters.push(newParam);
|
|
272
|
+
}
|
|
273
|
+
const updated = ts2.updateConstructor(ctor, ctor.decorators, ctor.modifiers, newParameters, ts2.visitFunctionBody(ctor.body, decoratorDownlevelVisitor, context));
|
|
274
|
+
return [updated, parametersInfo];
|
|
275
|
+
}
|
|
276
|
+
function transformClassDeclaration(classDecl) {
|
|
277
|
+
classDecl = ts2.getMutableClone(classDecl);
|
|
278
|
+
const newMembers = [];
|
|
279
|
+
const decoratedProperties = new Map();
|
|
280
|
+
let classParameters = null;
|
|
281
|
+
for (const member of classDecl.members) {
|
|
282
|
+
switch (member.kind) {
|
|
283
|
+
case ts2.SyntaxKind.PropertyDeclaration:
|
|
284
|
+
case ts2.SyntaxKind.GetAccessor:
|
|
285
|
+
case ts2.SyntaxKind.SetAccessor:
|
|
286
|
+
case ts2.SyntaxKind.MethodDeclaration: {
|
|
287
|
+
const [name, newMember, decorators] = transformClassElement(member);
|
|
288
|
+
newMembers.push(newMember);
|
|
289
|
+
if (name)
|
|
290
|
+
decoratedProperties.set(name, decorators);
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
case ts2.SyntaxKind.Constructor: {
|
|
294
|
+
const ctor = member;
|
|
295
|
+
if (!ctor.body)
|
|
296
|
+
break;
|
|
297
|
+
const [newMember, parametersInfo] = transformConstructor(member);
|
|
298
|
+
classParameters = parametersInfo;
|
|
299
|
+
newMembers.push(newMember);
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
default:
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
newMembers.push(ts2.visitEachChild(member, decoratorDownlevelVisitor, context));
|
|
306
|
+
}
|
|
307
|
+
const decoratorsToKeep = new Set(classDecl.decorators);
|
|
308
|
+
const possibleAngularDecorators = host.getDecoratorsOfDeclaration(classDecl) || [];
|
|
309
|
+
let hasAngularDecorator = false;
|
|
310
|
+
const decoratorsToLower = [];
|
|
311
|
+
for (const decorator of possibleAngularDecorators) {
|
|
312
|
+
const decoratorNode = decorator.node;
|
|
313
|
+
const isNgDecorator = isAngularDecorator(decorator, isCore);
|
|
314
|
+
if (isNgDecorator) {
|
|
315
|
+
hasAngularDecorator = true;
|
|
316
|
+
}
|
|
317
|
+
if (isNgDecorator && !skipClassDecorators) {
|
|
318
|
+
decoratorsToLower.push(extractMetadataFromSingleDecorator(decoratorNode, diagnostics));
|
|
319
|
+
decoratorsToKeep.delete(decoratorNode);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (decoratorsToLower.length) {
|
|
323
|
+
newMembers.push(createDecoratorClassProperty(decoratorsToLower));
|
|
324
|
+
}
|
|
325
|
+
if (classParameters) {
|
|
326
|
+
if (hasAngularDecorator || classParameters.some((p) => !!p.decorators.length)) {
|
|
327
|
+
newMembers.push(createCtorParametersClassProperty(diagnostics, entityNameToExpression, classParameters, isClosureCompilerEnabled));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
if (decoratedProperties.size) {
|
|
331
|
+
newMembers.push(createPropDecoratorsClassProperty(diagnostics, decoratedProperties));
|
|
332
|
+
}
|
|
333
|
+
const members = ts2.setTextRange(ts2.createNodeArray(newMembers, classDecl.members.hasTrailingComma), classDecl.members);
|
|
334
|
+
return ts2.updateClassDeclaration(classDecl, decoratorsToKeep.size ? Array.from(decoratorsToKeep) : void 0, classDecl.modifiers, classDecl.name, classDecl.typeParameters, classDecl.heritageClauses, members);
|
|
335
|
+
}
|
|
336
|
+
function decoratorDownlevelVisitor(node) {
|
|
337
|
+
if (ts2.isClassDeclaration(node)) {
|
|
338
|
+
return transformClassDeclaration(node);
|
|
339
|
+
}
|
|
340
|
+
return ts2.visitEachChild(node, decoratorDownlevelVisitor, context);
|
|
341
|
+
}
|
|
342
|
+
return (sf) => {
|
|
343
|
+
return ts2.visitEachChild(sf, decoratorDownlevelVisitor, context);
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export {
|
|
349
|
+
getDownlevelDecoratorsTransform
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* @license
|
|
353
|
+
* Copyright Google LLC All Rights Reserved.
|
|
354
|
+
*
|
|
355
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
356
|
+
* found in the LICENSE file at https://angular.io/license
|
|
357
|
+
*/
|
|
358
|
+
//# sourceMappingURL=chunk-M7P4HAA4.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.ts", "../../../../../../packages/compiler-cli/src/transformers/downlevel_decorators_transform/patch_alias_reference_resolution.ts", "../../../../../../packages/compiler-cli/src/transformers/downlevel_decorators_transform/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;AAQA;;;ACAA;AARA,AAmBA,IAAM,iCAAiC,OAAO;AAsDxC,+CAAgD,SAAiC;AAIrF,MAAI,CAAC,wCAAwC,UAAU;AACrD;;AAEF,QAAM,eAAe,QAAQ;AAK7B,QAAM,4BAA4B,aAAa;AAC/C,MAAI,8BAA8B,QAAW;AAC3C,WAAO;;AAGT,QAAM,uCAAuC,aAAa;AAG1D,MAAI,yCAAyC,QAAW;AACtD;;AAGF,QAAM,oBAAoB,IAAI;AAC9B,eAAa,+BAA+B,SAAS,SAAS,MAAI;AAChE,QAAI,yBAAyB,SAAS,kBAAkB,IAAI,OAAO;AACjE,aAAO;;AAET,WAAO,qCAAqC,KAAK,cAAc,MAAM,GAAG;;AAE1E,SAAO,aAAa,kCAAkC;;AAQlD,kCAAmC,MAAa;AAEpD,SAAO,GAAG,kBAAkB,SAAS,GAAG,kBAAkB,SAAS,GAAG,eAAe;;AAIvF,iDAAiD,SAAiC;AAEhF,SAAQ,QAAuD,oBAAo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