first commit

This commit is contained in:
2024-01-19 11:09:11 +01:00
commit b18af7a943
29473 changed files with 4500547 additions and 0 deletions

208
node_modules/@angular/compiler-cli/bundles/chunk-3IBJEGH3.js generated vendored Executable file
View File

@@ -0,0 +1,208 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/api.mjs
var PerfPhase;
(function(PerfPhase2) {
PerfPhase2[PerfPhase2["Unaccounted"] = 0] = "Unaccounted";
PerfPhase2[PerfPhase2["Setup"] = 1] = "Setup";
PerfPhase2[PerfPhase2["TypeScriptProgramCreate"] = 2] = "TypeScriptProgramCreate";
PerfPhase2[PerfPhase2["Reconciliation"] = 3] = "Reconciliation";
PerfPhase2[PerfPhase2["ResourceUpdate"] = 4] = "ResourceUpdate";
PerfPhase2[PerfPhase2["TypeScriptDiagnostics"] = 5] = "TypeScriptDiagnostics";
PerfPhase2[PerfPhase2["Analysis"] = 6] = "Analysis";
PerfPhase2[PerfPhase2["Resolve"] = 7] = "Resolve";
PerfPhase2[PerfPhase2["CycleDetection"] = 8] = "CycleDetection";
PerfPhase2[PerfPhase2["TcbGeneration"] = 9] = "TcbGeneration";
PerfPhase2[PerfPhase2["TcbUpdateProgram"] = 10] = "TcbUpdateProgram";
PerfPhase2[PerfPhase2["TypeScriptEmit"] = 11] = "TypeScriptEmit";
PerfPhase2[PerfPhase2["Compile"] = 12] = "Compile";
PerfPhase2[PerfPhase2["TtcAutocompletion"] = 13] = "TtcAutocompletion";
PerfPhase2[PerfPhase2["TtcDiagnostics"] = 14] = "TtcDiagnostics";
PerfPhase2[PerfPhase2["TtcSymbol"] = 15] = "TtcSymbol";
PerfPhase2[PerfPhase2["LsReferencesAndRenames"] = 16] = "LsReferencesAndRenames";
PerfPhase2[PerfPhase2["LsQuickInfo"] = 17] = "LsQuickInfo";
PerfPhase2[PerfPhase2["LsDefinition"] = 18] = "LsDefinition";
PerfPhase2[PerfPhase2["LsCompletions"] = 19] = "LsCompletions";
PerfPhase2[PerfPhase2["LsTcb"] = 20] = "LsTcb";
PerfPhase2[PerfPhase2["LsDiagnostics"] = 21] = "LsDiagnostics";
PerfPhase2[PerfPhase2["LsComponentLocations"] = 22] = "LsComponentLocations";
PerfPhase2[PerfPhase2["LsSignatureHelp"] = 23] = "LsSignatureHelp";
PerfPhase2[PerfPhase2["OutliningSpans"] = 24] = "OutliningSpans";
PerfPhase2[PerfPhase2["LAST"] = 25] = "LAST";
PerfPhase2[PerfPhase2["LsCodeFixes"] = 26] = "LsCodeFixes";
PerfPhase2[PerfPhase2["LsCodeFixesAll"] = 27] = "LsCodeFixesAll";
})(PerfPhase || (PerfPhase = {}));
var PerfEvent;
(function(PerfEvent2) {
PerfEvent2[PerfEvent2["InputDtsFile"] = 0] = "InputDtsFile";
PerfEvent2[PerfEvent2["InputTsFile"] = 1] = "InputTsFile";
PerfEvent2[PerfEvent2["AnalyzeComponent"] = 2] = "AnalyzeComponent";
PerfEvent2[PerfEvent2["AnalyzeDirective"] = 3] = "AnalyzeDirective";
PerfEvent2[PerfEvent2["AnalyzeInjectable"] = 4] = "AnalyzeInjectable";
PerfEvent2[PerfEvent2["AnalyzeNgModule"] = 5] = "AnalyzeNgModule";
PerfEvent2[PerfEvent2["AnalyzePipe"] = 6] = "AnalyzePipe";
PerfEvent2[PerfEvent2["TraitAnalyze"] = 7] = "TraitAnalyze";
PerfEvent2[PerfEvent2["TraitReuseAnalysis"] = 8] = "TraitReuseAnalysis";
PerfEvent2[PerfEvent2["SourceFilePhysicalChange"] = 9] = "SourceFilePhysicalChange";
PerfEvent2[PerfEvent2["SourceFileLogicalChange"] = 10] = "SourceFileLogicalChange";
PerfEvent2[PerfEvent2["SourceFileReuseAnalysis"] = 11] = "SourceFileReuseAnalysis";
PerfEvent2[PerfEvent2["GenerateTcb"] = 12] = "GenerateTcb";
PerfEvent2[PerfEvent2["SkipGenerateTcbNoInline"] = 13] = "SkipGenerateTcbNoInline";
PerfEvent2[PerfEvent2["ReuseTypeCheckFile"] = 14] = "ReuseTypeCheckFile";
PerfEvent2[PerfEvent2["UpdateTypeCheckProgram"] = 15] = "UpdateTypeCheckProgram";
PerfEvent2[PerfEvent2["EmitSkipSourceFile"] = 16] = "EmitSkipSourceFile";
PerfEvent2[PerfEvent2["EmitSourceFile"] = 17] = "EmitSourceFile";
PerfEvent2[PerfEvent2["LAST"] = 18] = "LAST";
})(PerfEvent || (PerfEvent = {}));
var PerfCheckpoint;
(function(PerfCheckpoint2) {
PerfCheckpoint2[PerfCheckpoint2["Initial"] = 0] = "Initial";
PerfCheckpoint2[PerfCheckpoint2["TypeScriptProgramCreate"] = 1] = "TypeScriptProgramCreate";
PerfCheckpoint2[PerfCheckpoint2["PreAnalysis"] = 2] = "PreAnalysis";
PerfCheckpoint2[PerfCheckpoint2["Analysis"] = 3] = "Analysis";
PerfCheckpoint2[PerfCheckpoint2["Resolve"] = 4] = "Resolve";
PerfCheckpoint2[PerfCheckpoint2["TtcGeneration"] = 5] = "TtcGeneration";
PerfCheckpoint2[PerfCheckpoint2["TtcUpdateProgram"] = 6] = "TtcUpdateProgram";
PerfCheckpoint2[PerfCheckpoint2["PreEmit"] = 7] = "PreEmit";
PerfCheckpoint2[PerfCheckpoint2["Emit"] = 8] = "Emit";
PerfCheckpoint2[PerfCheckpoint2["LAST"] = 9] = "LAST";
})(PerfCheckpoint || (PerfCheckpoint = {}));
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/noop.mjs
var NoopPerfRecorder = class {
eventCount() {
}
memory() {
}
phase() {
return PerfPhase.Unaccounted;
}
inPhase(phase, fn) {
return fn();
}
reset() {
}
};
var NOOP_PERF_RECORDER = new NoopPerfRecorder();
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/clock.mjs
function mark() {
return process.hrtime();
}
function timeSinceInMicros(mark2) {
const delta = process.hrtime(mark2);
return delta[0] * 1e6 + Math.floor(delta[1] / 1e3);
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/recorder.mjs
var ActivePerfRecorder = class {
static zeroedToNow() {
return new ActivePerfRecorder(mark());
}
constructor(zeroTime) {
this.zeroTime = zeroTime;
this.currentPhase = PerfPhase.Unaccounted;
this.currentPhaseEntered = this.zeroTime;
this.counters = Array(PerfEvent.LAST).fill(0);
this.phaseTime = Array(PerfPhase.LAST).fill(0);
this.bytes = Array(PerfCheckpoint.LAST).fill(0);
this.memory(PerfCheckpoint.Initial);
}
reset() {
this.counters = Array(PerfEvent.LAST).fill(0);
this.phaseTime = Array(PerfPhase.LAST).fill(0);
this.bytes = Array(PerfCheckpoint.LAST).fill(0);
this.zeroTime = mark();
this.currentPhase = PerfPhase.Unaccounted;
this.currentPhaseEntered = this.zeroTime;
}
memory(after) {
this.bytes[after] = process.memoryUsage().heapUsed;
}
phase(phase) {
const previous = this.currentPhase;
this.phaseTime[this.currentPhase] += timeSinceInMicros(this.currentPhaseEntered);
this.currentPhase = phase;
this.currentPhaseEntered = mark();
return previous;
}
inPhase(phase, fn) {
const previousPhase = this.phase(phase);
try {
return fn();
} finally {
this.phase(previousPhase);
}
}
eventCount(counter, incrementBy = 1) {
this.counters[counter] += incrementBy;
}
finalize() {
this.phase(PerfPhase.Unaccounted);
const results = {
events: {},
phases: {},
memory: {}
};
for (let i = 0; i < this.phaseTime.length; i++) {
if (this.phaseTime[i] > 0) {
results.phases[PerfPhase[i]] = this.phaseTime[i];
}
}
for (let i = 0; i < this.phaseTime.length; i++) {
if (this.counters[i] > 0) {
results.events[PerfEvent[i]] = this.counters[i];
}
}
for (let i = 0; i < this.bytes.length; i++) {
if (this.bytes[i] > 0) {
results.memory[PerfCheckpoint[i]] = this.bytes[i];
}
}
return results;
}
};
var DelegatingPerfRecorder = class {
constructor(target) {
this.target = target;
}
eventCount(counter, incrementBy) {
this.target.eventCount(counter, incrementBy);
}
phase(phase) {
return this.target.phase(phase);
}
inPhase(phase, fn) {
const previousPhase = this.target.phase(phase);
try {
return fn();
} finally {
this.target.phase(previousPhase);
}
}
memory(after) {
this.target.memory(after);
}
reset() {
this.target.reset();
}
};
export {
PerfPhase,
PerfEvent,
PerfCheckpoint,
ActivePerfRecorder,
DelegatingPerfRecorder
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=chunk-3IBJEGH3.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 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"],
"mappings": ";;;;;;AAWA,IAAY;CAAZ,SAAYA,YAAS;AAInB,EAAAA,WAAAA,WAAA,iBAAA,KAAA;AAOA,EAAAA,WAAAA,WAAA,WAAA,KAAA;AAQA,EAAAA,WAAAA,WAAA,6BAAA,KAAA;AAOA,EAAAA,WAAAA,WAAA,oBAAA,KAAA;AAOA,EAAAA,WAAAA,WAAA,oBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,2BAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,cAAA,KAAA;AAMA,EAAAA,WAAAA,WAAA,aAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,oBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,mBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,sBAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,oBAAA,MAAA;AAQA,EAAAA,WAAAA,WAAA,aAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,uBAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,oBAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,eAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,4BAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,iBAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,kBAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,mBAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,WAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,mBAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,0BAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,qBAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,oBAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,UAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,iBAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,oBAAA,MAAA;AACF,GA/JY,cAAA,YAAS,CAAA,EAAA;AAoKrB,IAAY;CAAZ,SAAYC,YAAS;AAInB,EAAAA,WAAAA,WAAA,kBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,iBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,sBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,sBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,uBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,qBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,iBAAA,KAAA;AAOA,EAAAA,WAAAA,WAAA,kBAAA,KAAA;AAMA,EAAAA,WAAAA,WAAA,wBAAA,KAAA;AAKA,EAAAA,WAAAA,WAAA,8BAAA,KAAA;AAMA,EAAAA,WAAAA,WAAA,6BAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,6BAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,iBAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,6BAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,wBAAA,MAAA;AAMA,EAAAA,WAAAA,WAAA,4BAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,wBAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,oBAAA,MAAA;AAKA,EAAAA,WAAAA,WAAA,UAAA,MAAA;AACF,GAvGY,cAAA,YAAS,CAAA,EAAA;AA6GrB,IAAY;CAAZ,SAAYC,iBAAc;AAKxB,EAAAA,gBAAAA,gBAAA,aAAA,KAAA;AAKA,EAAAA,gBAAAA,gBAAA,6BAAA,KAAA;AASA,EAAAA,gBAAAA,gBAAA,iBAAA,KAAA;AAKA,EAAAA,gBAAAA,gBAAA,cAAA,KAAA;AAKA,EAAAA,gBAAAA,gBAAA,aAAA,KAAA;AAKA,EAAAA,gBAAAA,gBAAA,mBAAA,KAAA;AAKA,EAAAA,gBAAAA,gBAAA,sBAAA,KAAA;AAQA,EAAAA,gBAAAA,gBAAA,aAAA,KAAA;AAKA,EAAAA,gBAAAA,gBAAA,UAAA,KAAA;AAKA,EAAAA,gBAAAA,gBAAA,UAAA,KAAA;AACF,GA1DY,mBAAA,iBAAc,CAAA,EAAA;;;ACnR1B,IAAM,mBAAN,MAAsB;EACpB,aAAU;EAAU;EAEpB,SAAM;EAAU;EAEhB,QAAK;AACH,WAAO,UAAU;EACnB;EAEA,QAAW,OAAkB,IAAW;AACtC,WAAO,GAAE;EACX;EAEA,QAAK;EAAU;;AAIV,IAAM,qBAAmC,IAAI,iBAAgB;;;ACb9D,SAAU,OAAI;AAClB,SAAO,QAAQ,OAAM;AACvB;AAEM,SAAU,kBAAkBC,OAAY;AAC5C,QAAM,QAAQ,QAAQ,OAAOA,KAAI;AACjC,SAAQ,MAAM,KAAK,MAAW,KAAK,MAAM,MAAM,KAAK,GAAI;AAC1D;;;ACIM,IAAO,qBAAP,MAAyB;EAW7B,OAAO,cAAW;AAChB,WAAO,IAAI,mBAAmB,KAAI,CAAE;EACtC;EAEA,YAA4B,UAAgB;AAAhB,SAAA,WAAA;AAVpB,SAAA,eAAe,UAAU;AAW/B,SAAK,sBAAsB,KAAK;AAChC,SAAK,WAAW,MAAM,UAAU,IAAI,EAAE,KAAK,CAAC;AAC5C,SAAK,YAAY,MAAM,UAAU,IAAI,EAAE,KAAK,CAAC;AAC7C,SAAK,QAAQ,MAAM,eAAe,IAAI,EAAE,KAAK,CAAC;AAG9C,SAAK,OAAO,eAAe,OAAO;EACpC;EAEA,QAAK;AACH,SAAK,WAAW,MAAM,UAAU,IAAI,EAAE,KAAK,CAAC;AAC5C,SAAK,YAAY,MAAM,UAAU,IAAI,EAAE,KAAK,CAAC;AAC7C,SAAK,QAAQ,MAAM,eAAe,IAAI,EAAE,KAAK,CAAC;AAC9C,SAAK,WAAW,KAAI;AACpB,SAAK,eAAe,UAAU;AAC9B,SAAK,sBAAsB,KAAK;EAClC;EAEA,OAAO,OAAqB;AAC1B,SAAK,MAAM,SAAS,QAAQ,YAAW,EAAG;EAC5C;EAEA,MAAM,OAAgB;AACpB,UAAM,WAAW,KAAK;AACtB,SAAK,UAAU,KAAK,iBAAiB,kBAAkB,KAAK,mBAAmB;AAC/E,SAAK,eAAe;AACpB,SAAK,sBAAsB,KAAI;AAC/B,WAAO;EACT;EAEA,QAAW,OAAkB,IAAW;AACtC,UAAM,gBAAgB,KAAK,MAAM,KAAK;AACtC,QAAI;AACF,aAAO,GAAE;;AAET,WAAK,MAAM,aAAa;;EAE5B;EAEA,WAAW,SAAoB,cAAsB,GAAC;AACpD,SAAK,SAAS,YAAY;EAC5B;EAKA,WAAQ;AAEN,SAAK,MAAM,UAAU,WAAW;AAEhC,UAAM,UAAuB;MAC3B,QAAQ,CAAA;MACR,QAAQ,CAAA;MACR,QAAQ,CAAA;;AAGV,aAAS,IAAI,GAAG,IAAI,KAAK,UAAU,QAAQ,KAAK;AAC9C,UAAI,KAAK,UAAU,KAAK,GAAG;AACzB,gBAAQ,OAAO,UAAU,MAAM,KAAK,UAAU;;;AAIlD,aAAS,IAAI,GAAG,IAAI,KAAK,UAAU,QAAQ,KAAK;AAC9C,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;EACT;;AAUI,IAAO,yBAAP,MAA6B;EACjC,YAAmB,QAAoB;AAApB,SAAA,SAAA;EAAuB;EAE1C,WAAW,SAAoB,aAAoB;AACjD,SAAK,OAAO,WAAW,SAAS,WAAW;EAC7C;EAEA,MAAM,OAAgB;AACpB,WAAO,KAAK,OAAO,MAAM,KAAK;EAChC;EAEA,QAAW,OAAkB,IAAW;AAGtC,UAAM,gBAAgB,KAAK,OAAO,MAAM,KAAK;AAC7C,QAAI;AACF,aAAO,GAAE;;AAET,WAAK,OAAO,MAAM,aAAa;;EAEnC;EAEA,OAAO,OAAqB;AAC1B,SAAK,OAAO,OAAO,KAAK;EAC1B;EAEA,QAAK;AACH,SAAK,OAAO,MAAK;EACnB;;",
"names": ["PerfPhase", "PerfEvent", "PerfCheckpoint", "mark"]
}

7640
node_modules/@angular/compiler-cli/bundles/chunk-B5URQIVL.js generated vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

410
node_modules/@angular/compiler-cli/bundles/chunk-CSOLWS7O.js generated vendored Executable file
View File

@@ -0,0 +1,410 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
__require
} from "./chunk-XI2RTGAL.js";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/util.mjs
var TS_DTS_JS_EXTENSION = /(?:\.d)?\.ts$|\.js$/;
function normalizeSeparators(path) {
return path.replace(/\\/g, "/");
}
function stripExtension(path) {
return path.replace(TS_DTS_JS_EXTENSION, "");
}
function getSourceFileOrError(program, fileName) {
const sf = program.getSourceFile(fileName);
if (sf === void 0) {
throw new Error(`Program does not contain "${fileName}" - available files are ${program.getSourceFiles().map((sf2) => sf2.fileName).join(", ")}`);
}
return sf;
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.mjs
var InvalidFileSystem = class {
exists(path) {
throw makeError();
}
readFile(path) {
throw makeError();
}
readFileBuffer(path) {
throw makeError();
}
writeFile(path, data, exclusive) {
throw makeError();
}
removeFile(path) {
throw makeError();
}
symlink(target, path) {
throw makeError();
}
readdir(path) {
throw makeError();
}
lstat(path) {
throw makeError();
}
stat(path) {
throw makeError();
}
pwd() {
throw makeError();
}
chdir(path) {
throw makeError();
}
extname(path) {
throw makeError();
}
copyFile(from, to) {
throw makeError();
}
moveFile(from, to) {
throw makeError();
}
ensureDir(path) {
throw makeError();
}
removeDeep(path) {
throw makeError();
}
isCaseSensitive() {
throw makeError();
}
resolve(...paths) {
throw makeError();
}
dirname(file) {
throw makeError();
}
join(basePath, ...paths) {
throw makeError();
}
isRoot(path) {
throw makeError();
}
isRooted(path) {
throw makeError();
}
relative(from, to) {
throw makeError();
}
basename(filePath, extension) {
throw makeError();
}
realpath(filePath) {
throw makeError();
}
getDefaultLibLocation() {
throw makeError();
}
normalize(path) {
throw makeError();
}
};
function makeError() {
return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/helpers.mjs
var fs = new InvalidFileSystem();
function getFileSystem() {
return fs;
}
function setFileSystem(fileSystem) {
fs = fileSystem;
}
function absoluteFrom(path) {
if (!fs.isRooted(path)) {
throw new Error(`Internal Error: absoluteFrom(${path}): path is not absolute`);
}
return fs.resolve(path);
}
var ABSOLUTE_PATH = Symbol("AbsolutePath");
function absoluteFromSourceFile(sf) {
const sfWithPatch = sf;
if (sfWithPatch[ABSOLUTE_PATH] === void 0) {
sfWithPatch[ABSOLUTE_PATH] = fs.resolve(sfWithPatch.fileName);
}
return sfWithPatch[ABSOLUTE_PATH];
}
function relativeFrom(path) {
const normalized = normalizeSeparators(path);
if (fs.isRooted(normalized)) {
throw new Error(`Internal Error: relativeFrom(${path}): path is not relative`);
}
return normalized;
}
function dirname(file) {
return fs.dirname(file);
}
function join(basePath, ...paths) {
return fs.join(basePath, ...paths);
}
function resolve(basePath, ...paths) {
return fs.resolve(basePath, ...paths);
}
function isRoot(path) {
return fs.isRoot(path);
}
function isRooted(path) {
return fs.isRooted(path);
}
function relative(from, to) {
return fs.relative(from, to);
}
function basename(filePath, extension) {
return fs.basename(filePath, extension);
}
function isLocalRelativePath(relativePath) {
return !isRooted(relativePath) && !relativePath.startsWith("..");
}
function toRelativeImport(relativePath) {
return isLocalRelativePath(relativePath) ? `./${relativePath}` : relativePath;
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
import * as os from "os";
import ts from "typescript";
var NgtscCompilerHost = class {
constructor(fs3, options = {}) {
this.fs = fs3;
this.options = options;
}
getSourceFile(fileName, languageVersion) {
const text = this.readFile(fileName);
return text !== void 0 ? ts.createSourceFile(fileName, text, languageVersion, true) : void 0;
}
getDefaultLibFileName(options) {
return this.fs.join(this.getDefaultLibLocation(), ts.getDefaultLibFileName(options));
}
getDefaultLibLocation() {
return this.fs.getDefaultLibLocation();
}
writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles) {
const path = absoluteFrom(fileName);
this.fs.ensureDir(this.fs.dirname(path));
this.fs.writeFile(path, data);
}
getCurrentDirectory() {
return this.fs.pwd();
}
getCanonicalFileName(fileName) {
return this.useCaseSensitiveFileNames() ? fileName : fileName.toLowerCase();
}
useCaseSensitiveFileNames() {
return this.fs.isCaseSensitive();
}
getNewLine() {
switch (this.options.newLine) {
case ts.NewLineKind.CarriageReturnLineFeed:
return "\r\n";
case ts.NewLineKind.LineFeed:
return "\n";
default:
return os.EOL;
}
}
fileExists(fileName) {
const absPath = this.fs.resolve(fileName);
return this.fs.exists(absPath) && this.fs.stat(absPath).isFile();
}
readFile(fileName) {
const absPath = this.fs.resolve(fileName);
if (!this.fileExists(absPath)) {
return void 0;
}
return this.fs.readFile(absPath);
}
realpath(path) {
return this.fs.realpath(this.fs.resolve(path));
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/logical.mjs
var LogicalProjectPath = {
relativePathBetween: function(from, to) {
const relativePath = relative(dirname(resolve(from)), resolve(to));
return toRelativeImport(relativePath);
}
};
var LogicalFileSystem = class {
constructor(rootDirs, compilerHost) {
this.compilerHost = compilerHost;
this.cache = /* @__PURE__ */ new Map();
this.rootDirs = rootDirs.concat([]).sort((a, b) => b.length - a.length);
this.canonicalRootDirs = this.rootDirs.map((dir) => this.compilerHost.getCanonicalFileName(dir));
}
logicalPathOfSf(sf) {
return this.logicalPathOfFile(absoluteFromSourceFile(sf));
}
logicalPathOfFile(physicalFile) {
if (!this.cache.has(physicalFile)) {
const canonicalFilePath = this.compilerHost.getCanonicalFileName(physicalFile);
let logicalFile = null;
for (let i = 0; i < this.rootDirs.length; i++) {
const rootDir = this.rootDirs[i];
const canonicalRootDir = this.canonicalRootDirs[i];
if (isWithinBasePath(canonicalRootDir, canonicalFilePath)) {
logicalFile = this.createLogicalProjectPath(physicalFile, rootDir);
if (logicalFile.indexOf("/node_modules/") !== -1) {
logicalFile = null;
} else {
break;
}
}
}
this.cache.set(physicalFile, logicalFile);
}
return this.cache.get(physicalFile);
}
createLogicalProjectPath(file, rootDir) {
const logicalPath = stripExtension(file.slice(rootDir.length));
return logicalPath.startsWith("/") ? logicalPath : "/" + logicalPath;
}
};
function isWithinBasePath(base, path) {
return isLocalRelativePath(relative(base, path));
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
import fs2 from "fs";
import module from "module";
import * as p from "path";
import { fileURLToPath } from "url";
var NodeJSPathManipulation = class {
pwd() {
return this.normalize(process.cwd());
}
chdir(dir) {
process.chdir(dir);
}
resolve(...paths) {
return this.normalize(p.resolve(...paths));
}
dirname(file) {
return this.normalize(p.dirname(file));
}
join(basePath, ...paths) {
return this.normalize(p.join(basePath, ...paths));
}
isRoot(path) {
return this.dirname(path) === this.normalize(path);
}
isRooted(path) {
return p.isAbsolute(path);
}
relative(from, to) {
return this.normalize(p.relative(from, to));
}
basename(filePath, extension) {
return p.basename(filePath, extension);
}
extname(path) {
return p.extname(path);
}
normalize(path) {
return path.replace(/\\/g, "/");
}
};
var isCommonJS = typeof __filename !== "undefined";
var currentFileUrl = isCommonJS ? null : import.meta.url;
var currentFileName = isCommonJS ? __filename : fileURLToPath(currentFileUrl);
var NodeJSReadonlyFileSystem = class extends NodeJSPathManipulation {
constructor() {
super(...arguments);
this._caseSensitive = void 0;
}
isCaseSensitive() {
if (this._caseSensitive === void 0) {
this._caseSensitive = !fs2.existsSync(this.normalize(toggleCase(currentFileName)));
}
return this._caseSensitive;
}
exists(path) {
return fs2.existsSync(path);
}
readFile(path) {
return fs2.readFileSync(path, "utf8");
}
readFileBuffer(path) {
return fs2.readFileSync(path);
}
readdir(path) {
return fs2.readdirSync(path);
}
lstat(path) {
return fs2.lstatSync(path);
}
stat(path) {
return fs2.statSync(path);
}
realpath(path) {
return this.resolve(fs2.realpathSync(path));
}
getDefaultLibLocation() {
const requireFn = isCommonJS ? __require : module.createRequire(currentFileUrl);
return this.resolve(requireFn.resolve("typescript"), "..");
}
};
var NodeJSFileSystem = class extends NodeJSReadonlyFileSystem {
writeFile(path, data, exclusive = false) {
fs2.writeFileSync(path, data, exclusive ? { flag: "wx" } : void 0);
}
removeFile(path) {
fs2.unlinkSync(path);
}
symlink(target, path) {
fs2.symlinkSync(target, path);
}
copyFile(from, to) {
fs2.copyFileSync(from, to);
}
moveFile(from, to) {
fs2.renameSync(from, to);
}
ensureDir(path) {
fs2.mkdirSync(path, { recursive: true });
}
removeDeep(path) {
fs2.rmdirSync(path, { recursive: true });
}
};
function toggleCase(str) {
return str.replace(/\w/g, (ch) => ch.toUpperCase() === ch ? ch.toLowerCase() : ch.toUpperCase());
}
export {
stripExtension,
getSourceFileOrError,
getFileSystem,
setFileSystem,
absoluteFrom,
absoluteFromSourceFile,
relativeFrom,
dirname,
join,
resolve,
isRoot,
isRooted,
relative,
basename,
isLocalRelativePath,
toRelativeImport,
NgtscCompilerHost,
LogicalProjectPath,
LogicalFileSystem,
NodeJSFileSystem
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=chunk-CSOLWS7O.js.map

File diff suppressed because one or more lines are too long

1644
node_modules/@angular/compiler-cli/bundles/chunk-G64XB6AU.js generated vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

1059
node_modules/@angular/compiler-cli/bundles/chunk-GT7FGHLZ.js generated vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

419
node_modules/@angular/compiler-cli/bundles/chunk-GYHDNUIK.js generated vendored Executable file
View File

@@ -0,0 +1,419 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
import { decode, encode } from "@jridgewell/sourcemap-codec";
import mapHelpers from "convert-source-map";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/segment_marker.mjs
function compareSegments(a, b) {
return a.position - b.position;
}
function offsetSegment(startOfLinePositions, marker, offset) {
if (offset === 0) {
return marker;
}
let line = marker.line;
const position = marker.position + offset;
while (line < startOfLinePositions.length - 1 && startOfLinePositions[line + 1] <= position) {
line++;
}
while (line > 0 && startOfLinePositions[line] > position) {
line--;
}
const column = position - startOfLinePositions[line];
return { line, column, position, next: void 0 };
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
function removeSourceMapComments(contents) {
return mapHelpers.removeMapFileComments(mapHelpers.removeComments(contents)).replace(/\n\n$/, "\n");
}
var SourceFile = class {
constructor(sourcePath, contents, rawMap, sources, fs) {
this.sourcePath = sourcePath;
this.contents = contents;
this.rawMap = rawMap;
this.sources = sources;
this.fs = fs;
this.contents = removeSourceMapComments(contents);
this.startOfLinePositions = computeStartOfLinePositions(this.contents);
this.flattenedMappings = this.flattenMappings();
}
renderFlattenedSourceMap() {
const sources = new IndexedMap();
const names = new IndexedSet();
const mappings = [];
const sourcePathDir = this.fs.dirname(this.sourcePath);
const relativeSourcePathCache = new Cache((input) => this.fs.relative(sourcePathDir, input));
for (const mapping of this.flattenedMappings) {
const sourceIndex = sources.set(relativeSourcePathCache.get(mapping.originalSource.sourcePath), mapping.originalSource.contents);
const mappingArray = [
mapping.generatedSegment.column,
sourceIndex,
mapping.originalSegment.line,
mapping.originalSegment.column
];
if (mapping.name !== void 0) {
const nameIndex = names.add(mapping.name);
mappingArray.push(nameIndex);
}
const line = mapping.generatedSegment.line;
while (line >= mappings.length) {
mappings.push([]);
}
mappings[line].push(mappingArray);
}
const sourceMap = {
version: 3,
file: this.fs.relative(sourcePathDir, this.sourcePath),
sources: sources.keys,
names: names.values,
mappings: encode(mappings),
sourcesContent: sources.values
};
return sourceMap;
}
getOriginalLocation(line, column) {
if (this.flattenedMappings.length === 0) {
return null;
}
let position;
if (line < this.startOfLinePositions.length) {
position = this.startOfLinePositions[line] + column;
} else {
position = this.contents.length;
}
const locationSegment = { line, column, position, next: void 0 };
let mappingIndex = findLastMappingIndexBefore(this.flattenedMappings, locationSegment, false, 0);
if (mappingIndex < 0) {
mappingIndex = 0;
}
const { originalSegment, originalSource, generatedSegment } = this.flattenedMappings[mappingIndex];
const offset = locationSegment.position - generatedSegment.position;
const offsetOriginalSegment = offsetSegment(originalSource.startOfLinePositions, originalSegment, offset);
return {
file: originalSource.sourcePath,
line: offsetOriginalSegment.line,
column: offsetOriginalSegment.column
};
}
flattenMappings() {
const mappings = parseMappings(this.rawMap && this.rawMap.map, this.sources, this.startOfLinePositions);
ensureOriginalSegmentLinks(mappings);
const flattenedMappings = [];
for (let mappingIndex = 0; mappingIndex < mappings.length; mappingIndex++) {
const aToBmapping = mappings[mappingIndex];
const bSource = aToBmapping.originalSource;
if (bSource.flattenedMappings.length === 0) {
flattenedMappings.push(aToBmapping);
continue;
}
const incomingStart = aToBmapping.originalSegment;
const incomingEnd = incomingStart.next;
let outgoingStartIndex = findLastMappingIndexBefore(bSource.flattenedMappings, incomingStart, false, 0);
if (outgoingStartIndex < 0) {
outgoingStartIndex = 0;
}
const outgoingEndIndex = incomingEnd !== void 0 ? findLastMappingIndexBefore(bSource.flattenedMappings, incomingEnd, true, outgoingStartIndex) : bSource.flattenedMappings.length - 1;
for (let bToCmappingIndex = outgoingStartIndex; bToCmappingIndex <= outgoingEndIndex; bToCmappingIndex++) {
const bToCmapping = bSource.flattenedMappings[bToCmappingIndex];
flattenedMappings.push(mergeMappings(this, aToBmapping, bToCmapping));
}
}
return flattenedMappings;
}
};
function findLastMappingIndexBefore(mappings, marker, exclusive, lowerIndex) {
let upperIndex = mappings.length - 1;
const test = exclusive ? -1 : 0;
if (compareSegments(mappings[lowerIndex].generatedSegment, marker) > test) {
return -1;
}
let matchingIndex = -1;
while (lowerIndex <= upperIndex) {
const index = upperIndex + lowerIndex >> 1;
if (compareSegments(mappings[index].generatedSegment, marker) <= test) {
matchingIndex = index;
lowerIndex = index + 1;
} else {
upperIndex = index - 1;
}
}
return matchingIndex;
}
function mergeMappings(generatedSource, ab, bc) {
const name = bc.name || ab.name;
const diff = compareSegments(bc.generatedSegment, ab.originalSegment);
if (diff > 0) {
return {
name,
generatedSegment: offsetSegment(generatedSource.startOfLinePositions, ab.generatedSegment, diff),
originalSource: bc.originalSource,
originalSegment: bc.originalSegment
};
} else {
return {
name,
generatedSegment: ab.generatedSegment,
originalSource: bc.originalSource,
originalSegment: offsetSegment(bc.originalSource.startOfLinePositions, bc.originalSegment, -diff)
};
}
}
function parseMappings(rawMap, sources, generatedSourceStartOfLinePositions) {
if (rawMap === null) {
return [];
}
const rawMappings = decode(rawMap.mappings);
if (rawMappings === null) {
return [];
}
const mappings = [];
for (let generatedLine = 0; generatedLine < rawMappings.length; generatedLine++) {
const generatedLineMappings = rawMappings[generatedLine];
for (const rawMapping of generatedLineMappings) {
if (rawMapping.length >= 4) {
const originalSource = sources[rawMapping[1]];
if (originalSource === null || originalSource === void 0) {
continue;
}
const generatedColumn = rawMapping[0];
const name = rawMapping.length === 5 ? rawMap.names[rawMapping[4]] : void 0;
const line = rawMapping[2];
const column = rawMapping[3];
const generatedSegment = {
line: generatedLine,
column: generatedColumn,
position: generatedSourceStartOfLinePositions[generatedLine] + generatedColumn,
next: void 0
};
const originalSegment = {
line,
column,
position: originalSource.startOfLinePositions[line] + column,
next: void 0
};
mappings.push({ name, generatedSegment, originalSegment, originalSource });
}
}
}
return mappings;
}
function extractOriginalSegments(mappings) {
const originalSegments = /* @__PURE__ */ new Map();
for (const mapping of mappings) {
const originalSource = mapping.originalSource;
if (!originalSegments.has(originalSource)) {
originalSegments.set(originalSource, []);
}
const segments = originalSegments.get(originalSource);
segments.push(mapping.originalSegment);
}
originalSegments.forEach((segmentMarkers) => segmentMarkers.sort(compareSegments));
return originalSegments;
}
function ensureOriginalSegmentLinks(mappings) {
const segmentsBySource = extractOriginalSegments(mappings);
segmentsBySource.forEach((markers) => {
for (let i = 0; i < markers.length - 1; i++) {
markers[i].next = markers[i + 1];
}
});
}
function computeStartOfLinePositions(str) {
const NEWLINE_MARKER_OFFSET = 1;
const lineLengths = computeLineLengths(str);
const startPositions = [0];
for (let i = 0; i < lineLengths.length - 1; i++) {
startPositions.push(startPositions[i] + lineLengths[i] + NEWLINE_MARKER_OFFSET);
}
return startPositions;
}
function computeLineLengths(str) {
return str.split(/\n/).map((s) => s.length);
}
var IndexedMap = class {
constructor() {
this.map = /* @__PURE__ */ new Map();
this.keys = [];
this.values = [];
}
set(key, value) {
if (this.map.has(key)) {
return this.map.get(key);
}
const index = this.values.push(value) - 1;
this.keys.push(key);
this.map.set(key, index);
return index;
}
};
var IndexedSet = class {
constructor() {
this.map = /* @__PURE__ */ new Map();
this.values = [];
}
add(value) {
if (this.map.has(value)) {
return this.map.get(value);
}
const index = this.values.push(value) - 1;
this.map.set(value, index);
return index;
}
};
var Cache = class {
constructor(computeFn) {
this.computeFn = computeFn;
this.map = /* @__PURE__ */ new Map();
}
get(input) {
if (!this.map.has(input)) {
this.map.set(input, this.computeFn(input));
}
return this.map.get(input);
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.mjs
import mapHelpers2 from "convert-source-map";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/content_origin.mjs
var ContentOrigin;
(function(ContentOrigin2) {
ContentOrigin2[ContentOrigin2["Provided"] = 0] = "Provided";
ContentOrigin2[ContentOrigin2["Inline"] = 1] = "Inline";
ContentOrigin2[ContentOrigin2["FileSystem"] = 2] = "FileSystem";
})(ContentOrigin || (ContentOrigin = {}));
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.mjs
var SCHEME_MATCHER = /^([a-z][a-z0-9.-]*):\/\//i;
var SourceFileLoader = class {
constructor(fs, logger, schemeMap) {
this.fs = fs;
this.logger = logger;
this.schemeMap = schemeMap;
this.currentPaths = [];
}
loadSourceFile(sourcePath, contents = null, mapAndPath = null) {
const contentsOrigin = contents !== null ? ContentOrigin.Provided : ContentOrigin.FileSystem;
const sourceMapInfo = mapAndPath && { origin: ContentOrigin.Provided, ...mapAndPath };
return this.loadSourceFileInternal(sourcePath, contents, contentsOrigin, sourceMapInfo);
}
loadSourceFileInternal(sourcePath, contents, sourceOrigin, sourceMapInfo) {
const previousPaths = this.currentPaths.slice();
try {
if (contents === null) {
if (!this.fs.exists(sourcePath)) {
return null;
}
contents = this.readSourceFile(sourcePath);
}
if (sourceMapInfo === null) {
sourceMapInfo = this.loadSourceMap(sourcePath, contents, sourceOrigin);
}
let sources = [];
if (sourceMapInfo !== null) {
const basePath = sourceMapInfo.mapPath || sourcePath;
sources = this.processSources(basePath, sourceMapInfo);
}
return new SourceFile(sourcePath, contents, sourceMapInfo, sources, this.fs);
} catch (e) {
this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
return null;
} finally {
this.currentPaths = previousPaths;
}
}
loadSourceMap(sourcePath, sourceContents, sourceOrigin) {
const lastLine = this.getLastNonEmptyLine(sourceContents);
const inline = mapHelpers2.commentRegex.exec(lastLine);
if (inline !== null) {
return {
map: mapHelpers2.fromComment(inline.pop()).sourcemap,
mapPath: null,
origin: ContentOrigin.Inline
};
}
if (sourceOrigin === ContentOrigin.Inline) {
return null;
}
const external = mapHelpers2.mapFileCommentRegex.exec(lastLine);
if (external) {
try {
const fileName = external[1] || external[2];
const externalMapPath = this.fs.resolve(this.fs.dirname(sourcePath), fileName);
return {
map: this.readRawSourceMap(externalMapPath),
mapPath: externalMapPath,
origin: ContentOrigin.FileSystem
};
} catch (e) {
this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
return null;
}
}
const impliedMapPath = this.fs.resolve(sourcePath + ".map");
if (this.fs.exists(impliedMapPath)) {
return {
map: this.readRawSourceMap(impliedMapPath),
mapPath: impliedMapPath,
origin: ContentOrigin.FileSystem
};
}
return null;
}
processSources(basePath, { map, origin: sourceMapOrigin }) {
const sourceRoot = this.fs.resolve(this.fs.dirname(basePath), this.replaceSchemeWithPath(map.sourceRoot || ""));
return map.sources.map((source, index) => {
const path = this.fs.resolve(sourceRoot, this.replaceSchemeWithPath(source));
const content = map.sourcesContent && map.sourcesContent[index] || null;
const sourceOrigin = content !== null && sourceMapOrigin !== ContentOrigin.Provided ? ContentOrigin.Inline : ContentOrigin.FileSystem;
return this.loadSourceFileInternal(path, content, sourceOrigin, null);
});
}
readSourceFile(sourcePath) {
this.trackPath(sourcePath);
return this.fs.readFile(sourcePath);
}
readRawSourceMap(mapPath) {
this.trackPath(mapPath);
return JSON.parse(this.fs.readFile(mapPath));
}
trackPath(path) {
if (this.currentPaths.includes(path)) {
throw new Error(`Circular source file mapping dependency: ${this.currentPaths.join(" -> ")} -> ${path}`);
}
this.currentPaths.push(path);
}
getLastNonEmptyLine(contents) {
let trailingWhitespaceIndex = contents.length - 1;
while (trailingWhitespaceIndex > 0 && (contents[trailingWhitespaceIndex] === "\n" || contents[trailingWhitespaceIndex] === "\r")) {
trailingWhitespaceIndex--;
}
let lastRealLineIndex = contents.lastIndexOf("\n", trailingWhitespaceIndex - 1);
if (lastRealLineIndex === -1) {
lastRealLineIndex = 0;
}
return contents.slice(lastRealLineIndex + 1);
}
replaceSchemeWithPath(path) {
return path.replace(SCHEME_MATCHER, (_, scheme) => this.schemeMap[scheme.toLowerCase()] || "");
}
};
export {
SourceFile,
SourceFileLoader
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=chunk-GYHDNUIK.js.map

File diff suppressed because one or more lines are too long

8872
node_modules/@angular/compiler-cli/bundles/chunk-KDLK7PF4.js generated vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

812
node_modules/@angular/compiler-cli/bundles/chunk-O55FKOOW.js generated vendored Executable file
View File

@@ -0,0 +1,812 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
AmbientImport,
ImportFlags,
NoopImportRewriter,
Reference,
assertSuccessfulReferenceEmit
} from "./chunk-G64XB6AU.js";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
var Context = class {
constructor(isStatement) {
this.isStatement = isStatement;
}
get withExpressionMode() {
return this.isStatement ? new Context(false) : this;
}
get withStatementMode() {
return !this.isStatement ? new Context(true) : this;
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
import * as o from "@angular/compiler";
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
[o.UnaryOperator.Minus, "-"],
[o.UnaryOperator.Plus, "+"]
]);
var BINARY_OPERATORS = /* @__PURE__ */ new Map([
[o.BinaryOperator.And, "&&"],
[o.BinaryOperator.Bigger, ">"],
[o.BinaryOperator.BiggerEquals, ">="],
[o.BinaryOperator.BitwiseAnd, "&"],
[o.BinaryOperator.Divide, "/"],
[o.BinaryOperator.Equals, "=="],
[o.BinaryOperator.Identical, "==="],
[o.BinaryOperator.Lower, "<"],
[o.BinaryOperator.LowerEquals, "<="],
[o.BinaryOperator.Minus, "-"],
[o.BinaryOperator.Modulo, "%"],
[o.BinaryOperator.Multiply, "*"],
[o.BinaryOperator.NotEquals, "!="],
[o.BinaryOperator.NotIdentical, "!=="],
[o.BinaryOperator.Or, "||"],
[o.BinaryOperator.Plus, "+"],
[o.BinaryOperator.NullishCoalesce, "??"]
]);
var ExpressionTranslatorVisitor = class {
constructor(factory, imports, options) {
this.factory = factory;
this.imports = imports;
this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
this.downlevelVariableDeclarations = options.downlevelVariableDeclarations === true;
this.recordWrappedNode = options.recordWrappedNode || (() => {
});
}
visitDeclareVarStmt(stmt, context) {
var _a;
const varType = this.downlevelVariableDeclarations ? "var" : stmt.hasModifier(o.StmtModifier.Final) ? "const" : "let";
return this.attachComments(this.factory.createVariableDeclaration(stmt.name, (_a = stmt.value) == null ? void 0 : _a.visitExpression(this, context.withExpressionMode), varType), stmt.leadingComments);
}
visitDeclareFunctionStmt(stmt, context) {
return this.attachComments(this.factory.createFunctionDeclaration(stmt.name, stmt.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(stmt.statements, context.withStatementMode))), stmt.leadingComments);
}
visitExpressionStmt(stmt, context) {
return this.attachComments(this.factory.createExpressionStatement(stmt.expr.visitExpression(this, context.withStatementMode)), stmt.leadingComments);
}
visitReturnStmt(stmt, context) {
return this.attachComments(this.factory.createReturnStatement(stmt.value.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
}
visitIfStmt(stmt, context) {
return this.attachComments(this.factory.createIfStatement(stmt.condition.visitExpression(this, context), this.factory.createBlock(this.visitStatements(stmt.trueCase, context.withStatementMode)), stmt.falseCase.length > 0 ? this.factory.createBlock(this.visitStatements(stmt.falseCase, context.withStatementMode)) : null), stmt.leadingComments);
}
visitReadVarExpr(ast, _context) {
const identifier = this.factory.createIdentifier(ast.name);
this.setSourceMapRange(identifier, ast.sourceSpan);
return identifier;
}
visitWriteVarExpr(expr, context) {
const assignment = this.factory.createAssignment(this.setSourceMapRange(this.factory.createIdentifier(expr.name), expr.sourceSpan), expr.value.visitExpression(this, context));
return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
}
visitWriteKeyExpr(expr, context) {
const exprContext = context.withExpressionMode;
const target = this.factory.createElementAccess(expr.receiver.visitExpression(this, exprContext), expr.index.visitExpression(this, exprContext));
const assignment = this.factory.createAssignment(target, expr.value.visitExpression(this, exprContext));
return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
}
visitWritePropExpr(expr, context) {
const target = this.factory.createPropertyAccess(expr.receiver.visitExpression(this, context), expr.name);
return this.factory.createAssignment(target, expr.value.visitExpression(this, context));
}
visitInvokeFunctionExpr(ast, context) {
return this.setSourceMapRange(this.factory.createCallExpression(ast.fn.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)), ast.pure), ast.sourceSpan);
}
visitTaggedTemplateExpr(ast, context) {
return this.setSourceMapRange(this.createTaggedTemplateExpression(ast.tag.visitExpression(this, context), {
elements: ast.template.elements.map((e) => {
var _a;
return createTemplateElement({
cooked: e.text,
raw: e.rawText,
range: (_a = e.sourceSpan) != null ? _a : ast.sourceSpan
});
}),
expressions: ast.template.expressions.map((e) => e.visitExpression(this, context))
}), ast.sourceSpan);
}
visitInstantiateExpr(ast, context) {
return this.factory.createNewExpression(ast.classExpr.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)));
}
visitLiteralExpr(ast, _context) {
return this.setSourceMapRange(this.factory.createLiteral(ast.value), ast.sourceSpan);
}
visitLocalizedString(ast, context) {
const elements = [createTemplateElement(ast.serializeI18nHead())];
const expressions = [];
for (let i = 0; i < ast.expressions.length; i++) {
const placeholder = this.setSourceMapRange(ast.expressions[i].visitExpression(this, context), ast.getPlaceholderSourceSpan(i));
expressions.push(placeholder);
elements.push(createTemplateElement(ast.serializeI18nTemplatePart(i + 1)));
}
const localizeTag = this.factory.createIdentifier("$localize");
return this.setSourceMapRange(this.createTaggedTemplateExpression(localizeTag, { elements, expressions }), ast.sourceSpan);
}
createTaggedTemplateExpression(tag, template) {
return this.downlevelTaggedTemplates ? this.createES5TaggedTemplateFunctionCall(tag, template) : this.factory.createTaggedTemplate(tag, template);
}
createES5TaggedTemplateFunctionCall(tagHandler, { elements, expressions }) {
const { moduleImport, symbol } = this.imports.generateNamedImport("tslib", "__makeTemplateObject");
const __makeTemplateObjectHelper = moduleImport === null ? this.factory.createIdentifier(symbol) : this.factory.createPropertyAccess(moduleImport, symbol);
const cooked = [];
const raw = [];
for (const element of elements) {
cooked.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.cooked), element.range));
raw.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.raw), element.range));
}
const templateHelperCall = this.factory.createCallExpression(
__makeTemplateObjectHelper,
[this.factory.createArrayLiteral(cooked), this.factory.createArrayLiteral(raw)],
false
);
return this.factory.createCallExpression(
tagHandler,
[templateHelperCall, ...expressions],
false
);
}
visitExternalExpr(ast, _context) {
if (ast.value.name === null) {
if (ast.value.moduleName === null) {
throw new Error("Invalid import without name nor moduleName");
}
return this.imports.generateNamespaceImport(ast.value.moduleName);
}
if (ast.value.moduleName !== null) {
const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
if (moduleImport === null) {
return this.factory.createIdentifier(symbol);
} else {
return this.factory.createPropertyAccess(moduleImport, symbol);
}
} else {
return this.factory.createIdentifier(ast.value.name);
}
}
visitConditionalExpr(ast, context) {
let cond = ast.condition.visitExpression(this, context);
if (ast.condition instanceof o.ConditionalExpr) {
cond = this.factory.createParenthesizedExpression(cond);
}
return this.factory.createConditional(cond, ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context));
}
visitDynamicImportExpr(ast, context) {
return this.factory.createDynamicImport(ast.url);
}
visitNotExpr(ast, context) {
return this.factory.createUnaryExpression("!", ast.condition.visitExpression(this, context));
}
visitFunctionExpr(ast, context) {
var _a;
return this.factory.createFunctionExpression((_a = ast.name) != null ? _a : null, ast.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(ast.statements, context)));
}
visitArrowFunctionExpr(ast, context) {
return this.factory.createArrowFunctionExpression(ast.params.map((param) => param.name), Array.isArray(ast.body) ? this.factory.createBlock(this.visitStatements(ast.body, context)) : ast.body.visitExpression(this, context));
}
visitBinaryOperatorExpr(ast, context) {
if (!BINARY_OPERATORS.has(ast.operator)) {
throw new Error(`Unknown binary operator: ${o.BinaryOperator[ast.operator]}`);
}
return this.factory.createBinaryExpression(ast.lhs.visitExpression(this, context), BINARY_OPERATORS.get(ast.operator), ast.rhs.visitExpression(this, context));
}
visitReadPropExpr(ast, context) {
return this.factory.createPropertyAccess(ast.receiver.visitExpression(this, context), ast.name);
}
visitReadKeyExpr(ast, context) {
return this.factory.createElementAccess(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context));
}
visitLiteralArrayExpr(ast, context) {
return this.factory.createArrayLiteral(ast.entries.map((expr) => this.setSourceMapRange(expr.visitExpression(this, context), ast.sourceSpan)));
}
visitLiteralMapExpr(ast, context) {
const properties = ast.entries.map((entry) => {
return {
propertyName: entry.key,
quoted: entry.quoted,
value: entry.value.visitExpression(this, context)
};
});
return this.setSourceMapRange(this.factory.createObjectLiteral(properties), ast.sourceSpan);
}
visitCommaExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitWrappedNodeExpr(ast, _context) {
this.recordWrappedNode(ast);
return ast.node;
}
visitTypeofExpr(ast, context) {
return this.factory.createTypeOfExpression(ast.expr.visitExpression(this, context));
}
visitUnaryOperatorExpr(ast, context) {
if (!UNARY_OPERATORS.has(ast.operator)) {
throw new Error(`Unknown unary operator: ${o.UnaryOperator[ast.operator]}`);
}
return this.factory.createUnaryExpression(UNARY_OPERATORS.get(ast.operator), ast.expr.visitExpression(this, context));
}
visitStatements(statements, context) {
return statements.map((stmt) => stmt.visitStatement(this, context)).filter((stmt) => stmt !== void 0);
}
setSourceMapRange(ast, span) {
return this.factory.setSourceMapRange(ast, createRange(span));
}
attachComments(statement, leadingComments) {
if (leadingComments !== void 0) {
this.factory.attachComments(statement, leadingComments);
}
return statement;
}
};
function createTemplateElement({ cooked, raw, range }) {
return { cooked, raw, range: createRange(range) };
}
function createRange(span) {
if (span === null) {
return null;
}
const { start, end } = span;
const { url, content } = start.file;
if (!url) {
return null;
}
return {
url,
content,
start: { offset: start.offset, line: start.line, column: start.col },
end: { offset: end.offset, line: end.line, column: end.col }
};
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
import ts from "typescript";
var ImportManager = class {
constructor(rewriter = new NoopImportRewriter(), prefix = "i") {
this.rewriter = rewriter;
this.prefix = prefix;
this.specifierToIdentifier = /* @__PURE__ */ new Map();
this.nextIndex = 0;
}
generateNamespaceImport(moduleName) {
if (!this.specifierToIdentifier.has(moduleName)) {
this.specifierToIdentifier.set(moduleName, ts.factory.createIdentifier(`${this.prefix}${this.nextIndex++}`));
}
return this.specifierToIdentifier.get(moduleName);
}
generateNamedImport(moduleName, originalSymbol) {
const symbol = this.rewriter.rewriteSymbol(originalSymbol, moduleName);
if (!this.rewriter.shouldImportSymbol(symbol, moduleName)) {
return { moduleImport: null, symbol };
}
const moduleImport = this.generateNamespaceImport(moduleName);
return { moduleImport, symbol };
}
getAllImports(contextPath) {
const imports = [];
for (const [originalSpecifier, qualifier] of this.specifierToIdentifier) {
const specifier = this.rewriter.rewriteSpecifier(originalSpecifier, contextPath);
imports.push({
specifier,
qualifier
});
}
return imports;
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_emitter.mjs
import ts2 from "typescript";
var INELIGIBLE = {};
function canEmitType(type, canEmit) {
return canEmitTypeWorker(type);
function canEmitTypeWorker(type2) {
return visitNode(type2) !== INELIGIBLE;
}
function visitNode(node) {
if (ts2.isImportTypeNode(node)) {
return INELIGIBLE;
}
if (ts2.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
return INELIGIBLE;
} else {
return ts2.forEachChild(node, visitNode);
}
}
function canEmitTypeReference(type2) {
if (!canEmit(type2)) {
return false;
}
return type2.typeArguments === void 0 || type2.typeArguments.every(canEmitTypeWorker);
}
}
var TypeEmitter = class {
constructor(translator) {
this.translator = translator;
}
emitType(type) {
const typeReferenceTransformer = (context) => {
const visitNode = (node) => {
if (ts2.isImportTypeNode(node)) {
throw new Error("Unable to emit import type");
}
if (ts2.isTypeReferenceNode(node)) {
return this.emitTypeReference(node);
} else if (ts2.isLiteralExpression(node)) {
let clone;
if (ts2.isStringLiteral(node)) {
clone = ts2.factory.createStringLiteral(node.text);
} else if (ts2.isNumericLiteral(node)) {
clone = ts2.factory.createNumericLiteral(node.text);
} else if (ts2.isBigIntLiteral(node)) {
clone = ts2.factory.createBigIntLiteral(node.text);
} else if (ts2.isNoSubstitutionTemplateLiteral(node)) {
clone = ts2.factory.createNoSubstitutionTemplateLiteral(node.text, node.rawText);
} else if (ts2.isRegularExpressionLiteral(node)) {
clone = ts2.factory.createRegularExpressionLiteral(node.text);
} else {
throw new Error(`Unsupported literal kind ${ts2.SyntaxKind[node.kind]}`);
}
ts2.setTextRange(clone, { pos: -1, end: -1 });
return clone;
} else {
return ts2.visitEachChild(node, visitNode, context);
}
};
return (node) => ts2.visitNode(node, visitNode, ts2.isTypeNode);
};
return ts2.transform(type, [typeReferenceTransformer]).transformed[0];
}
emitTypeReference(type) {
const translatedType = this.translator(type);
if (translatedType === null) {
throw new Error("Unable to emit an unresolved reference");
}
let typeArguments = void 0;
if (type.typeArguments !== void 0) {
typeArguments = ts2.factory.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
}
return ts2.factory.updateTypeReferenceNode(type, translatedType.typeName, typeArguments);
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
import * as o2 from "@angular/compiler";
import ts3 from "typescript";
function translateType(type, contextFile, reflector, refEmitter, imports) {
return type.visitType(new TypeTranslatorVisitor(imports, contextFile, reflector, refEmitter), new Context(false));
}
var TypeTranslatorVisitor = class {
constructor(imports, contextFile, reflector, refEmitter) {
this.imports = imports;
this.contextFile = contextFile;
this.reflector = reflector;
this.refEmitter = refEmitter;
}
visitBuiltinType(type, context) {
switch (type.name) {
case o2.BuiltinTypeName.Bool:
return ts3.factory.createKeywordTypeNode(ts3.SyntaxKind.BooleanKeyword);
case o2.BuiltinTypeName.Dynamic:
return ts3.factory.createKeywordTypeNode(ts3.SyntaxKind.AnyKeyword);
case o2.BuiltinTypeName.Int:
case o2.BuiltinTypeName.Number:
return ts3.factory.createKeywordTypeNode(ts3.SyntaxKind.NumberKeyword);
case o2.BuiltinTypeName.String:
return ts3.factory.createKeywordTypeNode(ts3.SyntaxKind.StringKeyword);
case o2.BuiltinTypeName.None:
return ts3.factory.createKeywordTypeNode(ts3.SyntaxKind.NeverKeyword);
default:
throw new Error(`Unsupported builtin type: ${o2.BuiltinTypeName[type.name]}`);
}
}
visitExpressionType(type, context) {
const typeNode = this.translateExpression(type.value, context);
if (type.typeParams === null) {
return typeNode;
}
if (!ts3.isTypeReferenceNode(typeNode)) {
throw new Error("An ExpressionType with type arguments must translate into a TypeReferenceNode");
} else if (typeNode.typeArguments !== void 0) {
throw new Error(`An ExpressionType with type arguments cannot have multiple levels of type arguments`);
}
const typeArgs = type.typeParams.map((param) => this.translateType(param, context));
return ts3.factory.createTypeReferenceNode(typeNode.typeName, typeArgs);
}
visitArrayType(type, context) {
return ts3.factory.createArrayTypeNode(this.translateType(type.of, context));
}
visitMapType(type, context) {
const parameter = ts3.factory.createParameterDeclaration(void 0, void 0, "key", void 0, ts3.factory.createKeywordTypeNode(ts3.SyntaxKind.StringKeyword));
const typeArgs = type.valueType !== null ? this.translateType(type.valueType, context) : ts3.factory.createKeywordTypeNode(ts3.SyntaxKind.UnknownKeyword);
const indexSignature = ts3.factory.createIndexSignature(void 0, [parameter], typeArgs);
return ts3.factory.createTypeLiteralNode([indexSignature]);
}
visitTransplantedType(ast, context) {
const node = ast.type instanceof Reference ? ast.type.node : ast.type;
if (!ts3.isTypeNode(node)) {
throw new Error(`A TransplantedType must wrap a TypeNode`);
}
const viaModule = ast.type instanceof Reference ? ast.type.bestGuessOwningModule : null;
const emitter = new TypeEmitter((typeRef) => this.translateTypeReference(typeRef, context, viaModule));
return emitter.emitType(node);
}
visitReadVarExpr(ast, context) {
if (ast.name === null) {
throw new Error(`ReadVarExpr with no variable name in type`);
}
return ts3.factory.createTypeQueryNode(ts3.factory.createIdentifier(ast.name));
}
visitWriteVarExpr(expr, context) {
throw new Error("Method not implemented.");
}
visitWriteKeyExpr(expr, context) {
throw new Error("Method not implemented.");
}
visitWritePropExpr(expr, context) {
throw new Error("Method not implemented.");
}
visitInvokeFunctionExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitTaggedTemplateExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitInstantiateExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitLiteralExpr(ast, context) {
if (ast.value === null) {
return ts3.factory.createLiteralTypeNode(ts3.factory.createNull());
} else if (ast.value === void 0) {
return ts3.factory.createKeywordTypeNode(ts3.SyntaxKind.UndefinedKeyword);
} else if (typeof ast.value === "boolean") {
return ts3.factory.createLiteralTypeNode(ast.value ? ts3.factory.createTrue() : ts3.factory.createFalse());
} else if (typeof ast.value === "number") {
return ts3.factory.createLiteralTypeNode(ts3.factory.createNumericLiteral(ast.value));
} else {
return ts3.factory.createLiteralTypeNode(ts3.factory.createStringLiteral(ast.value));
}
}
visitLocalizedString(ast, context) {
throw new Error("Method not implemented.");
}
visitExternalExpr(ast, context) {
if (ast.value.moduleName === null || ast.value.name === null) {
throw new Error(`Import unknown module or symbol`);
}
const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
const symbolIdentifier = ts3.factory.createIdentifier(symbol);
const typeName = moduleImport ? ts3.factory.createQualifiedName(moduleImport, symbolIdentifier) : symbolIdentifier;
const typeArguments = ast.typeParams !== null ? ast.typeParams.map((type) => this.translateType(type, context)) : void 0;
return ts3.factory.createTypeReferenceNode(typeName, typeArguments);
}
visitConditionalExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitDynamicImportExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitNotExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitFunctionExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitArrowFunctionExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitUnaryOperatorExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitBinaryOperatorExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitReadPropExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitReadKeyExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitLiteralArrayExpr(ast, context) {
const values = ast.entries.map((expr) => this.translateExpression(expr, context));
return ts3.factory.createTupleTypeNode(values);
}
visitLiteralMapExpr(ast, context) {
const entries = ast.entries.map((entry) => {
const { key, quoted } = entry;
const type = this.translateExpression(entry.value, context);
return ts3.factory.createPropertySignature(
void 0,
quoted ? ts3.factory.createStringLiteral(key) : key,
void 0,
type
);
});
return ts3.factory.createTypeLiteralNode(entries);
}
visitCommaExpr(ast, context) {
throw new Error("Method not implemented.");
}
visitWrappedNodeExpr(ast, context) {
const node = ast.node;
if (ts3.isEntityName(node)) {
return ts3.factory.createTypeReferenceNode(node, void 0);
} else if (ts3.isTypeNode(node)) {
return node;
} else if (ts3.isLiteralExpression(node)) {
return ts3.factory.createLiteralTypeNode(node);
} else {
throw new Error(`Unsupported WrappedNodeExpr in TypeTranslatorVisitor: ${ts3.SyntaxKind[node.kind]}`);
}
}
visitTypeofExpr(ast, context) {
const typeNode = this.translateExpression(ast.expr, context);
if (!ts3.isTypeReferenceNode(typeNode)) {
throw new Error(`The target of a typeof expression must be a type reference, but it was
${ts3.SyntaxKind[typeNode.kind]}`);
}
return ts3.factory.createTypeQueryNode(typeNode.typeName);
}
translateType(type, context) {
const typeNode = type.visitType(this, context);
if (!ts3.isTypeNode(typeNode)) {
throw new Error(`A Type must translate to a TypeNode, but was ${ts3.SyntaxKind[typeNode.kind]}`);
}
return typeNode;
}
translateExpression(expr, context) {
const typeNode = expr.visitExpression(this, context);
if (!ts3.isTypeNode(typeNode)) {
throw new Error(`An Expression must translate to a TypeNode, but was ${ts3.SyntaxKind[typeNode.kind]}`);
}
return typeNode;
}
translateTypeReference(type, context, viaModule) {
const target = ts3.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
const declaration = this.reflector.getDeclarationOfIdentifier(target);
if (declaration === null) {
throw new Error(`Unable to statically determine the declaration file of type node ${target.text}`);
}
let owningModule = viaModule;
if (typeof declaration.viaModule === "string") {
owningModule = {
specifier: declaration.viaModule,
resolutionContext: type.getSourceFile().fileName
};
}
const reference = new Reference(declaration.node, declaration.viaModule === AmbientImport ? AmbientImport : owningModule);
const emittedType = this.refEmitter.emit(reference, this.contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports | ImportFlags.AllowAmbientReferences);
assertSuccessfulReferenceEmit(emittedType, target, "type");
const typeNode = this.translateExpression(emittedType.expression, context);
if (!ts3.isTypeReferenceNode(typeNode)) {
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts3.SyntaxKind[typeNode.kind]}.`);
}
return typeNode;
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
import ts4 from "typescript";
var PureAnnotation;
(function(PureAnnotation2) {
PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
PureAnnotation2["TERSER"] = "@__PURE__";
})(PureAnnotation || (PureAnnotation = {}));
var UNARY_OPERATORS2 = {
"+": ts4.SyntaxKind.PlusToken,
"-": ts4.SyntaxKind.MinusToken,
"!": ts4.SyntaxKind.ExclamationToken
};
var BINARY_OPERATORS2 = {
"&&": ts4.SyntaxKind.AmpersandAmpersandToken,
">": ts4.SyntaxKind.GreaterThanToken,
">=": ts4.SyntaxKind.GreaterThanEqualsToken,
"&": ts4.SyntaxKind.AmpersandToken,
"/": ts4.SyntaxKind.SlashToken,
"==": ts4.SyntaxKind.EqualsEqualsToken,
"===": ts4.SyntaxKind.EqualsEqualsEqualsToken,
"<": ts4.SyntaxKind.LessThanToken,
"<=": ts4.SyntaxKind.LessThanEqualsToken,
"-": ts4.SyntaxKind.MinusToken,
"%": ts4.SyntaxKind.PercentToken,
"*": ts4.SyntaxKind.AsteriskToken,
"!=": ts4.SyntaxKind.ExclamationEqualsToken,
"!==": ts4.SyntaxKind.ExclamationEqualsEqualsToken,
"||": ts4.SyntaxKind.BarBarToken,
"+": ts4.SyntaxKind.PlusToken,
"??": ts4.SyntaxKind.QuestionQuestionToken
};
var VAR_TYPES = {
"const": ts4.NodeFlags.Const,
"let": ts4.NodeFlags.Let,
"var": ts4.NodeFlags.None
};
var TypeScriptAstFactory = class {
constructor(annotateForClosureCompiler) {
this.annotateForClosureCompiler = annotateForClosureCompiler;
this.externalSourceFiles = /* @__PURE__ */ new Map();
this.attachComments = attachComments;
this.createArrayLiteral = ts4.factory.createArrayLiteralExpression;
this.createElementAccess = ts4.factory.createElementAccessExpression;
this.createExpressionStatement = ts4.factory.createExpressionStatement;
this.createIdentifier = ts4.factory.createIdentifier;
this.createParenthesizedExpression = ts4.factory.createParenthesizedExpression;
this.createPropertyAccess = ts4.factory.createPropertyAccessExpression;
this.createThrowStatement = ts4.factory.createThrowStatement;
this.createTypeOfExpression = ts4.factory.createTypeOfExpression;
}
createAssignment(target, value) {
return ts4.factory.createBinaryExpression(target, ts4.SyntaxKind.EqualsToken, value);
}
createBinaryExpression(leftOperand, operator, rightOperand) {
return ts4.factory.createBinaryExpression(leftOperand, BINARY_OPERATORS2[operator], rightOperand);
}
createBlock(body) {
return ts4.factory.createBlock(body);
}
createCallExpression(callee, args, pure) {
const call = ts4.factory.createCallExpression(callee, void 0, args);
if (pure) {
ts4.addSyntheticLeadingComment(
call,
ts4.SyntaxKind.MultiLineCommentTrivia,
this.annotateForClosureCompiler ? PureAnnotation.CLOSURE : PureAnnotation.TERSER,
false
);
}
return call;
}
createConditional(condition, whenTrue, whenFalse) {
return ts4.factory.createConditionalExpression(condition, void 0, whenTrue, void 0, whenFalse);
}
createDynamicImport(url) {
return ts4.factory.createCallExpression(
ts4.factory.createToken(ts4.SyntaxKind.ImportKeyword),
void 0,
[ts4.factory.createStringLiteral(url)]
);
}
createFunctionDeclaration(functionName, parameters, body) {
if (!ts4.isBlock(body)) {
throw new Error(`Invalid syntax, expected a block, but got ${ts4.SyntaxKind[body.kind]}.`);
}
return ts4.factory.createFunctionDeclaration(void 0, void 0, functionName, void 0, parameters.map((param) => ts4.factory.createParameterDeclaration(void 0, void 0, param)), void 0, body);
}
createFunctionExpression(functionName, parameters, body) {
if (!ts4.isBlock(body)) {
throw new Error(`Invalid syntax, expected a block, but got ${ts4.SyntaxKind[body.kind]}.`);
}
return ts4.factory.createFunctionExpression(void 0, void 0, functionName != null ? functionName : void 0, void 0, parameters.map((param) => ts4.factory.createParameterDeclaration(void 0, void 0, param)), void 0, body);
}
createArrowFunctionExpression(parameters, body) {
if (ts4.isStatement(body) && !ts4.isBlock(body)) {
throw new Error(`Invalid syntax, expected a block, but got ${ts4.SyntaxKind[body.kind]}.`);
}
return ts4.factory.createArrowFunction(void 0, void 0, parameters.map((param) => ts4.factory.createParameterDeclaration(void 0, void 0, param)), void 0, void 0, body);
}
createIfStatement(condition, thenStatement, elseStatement) {
return ts4.factory.createIfStatement(condition, thenStatement, elseStatement != null ? elseStatement : void 0);
}
createLiteral(value) {
if (value === void 0) {
return ts4.factory.createIdentifier("undefined");
} else if (value === null) {
return ts4.factory.createNull();
} else if (typeof value === "boolean") {
return value ? ts4.factory.createTrue() : ts4.factory.createFalse();
} else if (typeof value === "number") {
return ts4.factory.createNumericLiteral(value);
} else {
return ts4.factory.createStringLiteral(value);
}
}
createNewExpression(expression, args) {
return ts4.factory.createNewExpression(expression, void 0, args);
}
createObjectLiteral(properties) {
return ts4.factory.createObjectLiteralExpression(properties.map((prop) => ts4.factory.createPropertyAssignment(prop.quoted ? ts4.factory.createStringLiteral(prop.propertyName) : ts4.factory.createIdentifier(prop.propertyName), prop.value)));
}
createReturnStatement(expression) {
return ts4.factory.createReturnStatement(expression != null ? expression : void 0);
}
createTaggedTemplate(tag, template) {
let templateLiteral;
const length = template.elements.length;
const head = template.elements[0];
if (length === 1) {
templateLiteral = ts4.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
} else {
const spans = [];
for (let i = 1; i < length - 1; i++) {
const { cooked, raw, range } = template.elements[i];
const middle = createTemplateMiddle(cooked, raw);
if (range !== null) {
this.setSourceMapRange(middle, range);
}
spans.push(ts4.factory.createTemplateSpan(template.expressions[i - 1], middle));
}
const resolvedExpression = template.expressions[length - 2];
const templatePart = template.elements[length - 1];
const templateTail = createTemplateTail(templatePart.cooked, templatePart.raw);
if (templatePart.range !== null) {
this.setSourceMapRange(templateTail, templatePart.range);
}
spans.push(ts4.factory.createTemplateSpan(resolvedExpression, templateTail));
templateLiteral = ts4.factory.createTemplateExpression(ts4.factory.createTemplateHead(head.cooked, head.raw), spans);
}
if (head.range !== null) {
this.setSourceMapRange(templateLiteral, head.range);
}
return ts4.factory.createTaggedTemplateExpression(tag, void 0, templateLiteral);
}
createUnaryExpression(operator, operand) {
return ts4.factory.createPrefixUnaryExpression(UNARY_OPERATORS2[operator], operand);
}
createVariableDeclaration(variableName, initializer, type) {
return ts4.factory.createVariableStatement(void 0, ts4.factory.createVariableDeclarationList([ts4.factory.createVariableDeclaration(variableName, void 0, void 0, initializer != null ? initializer : void 0)], VAR_TYPES[type]));
}
setSourceMapRange(node, sourceMapRange) {
if (sourceMapRange === null) {
return node;
}
const url = sourceMapRange.url;
if (!this.externalSourceFiles.has(url)) {
this.externalSourceFiles.set(url, ts4.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
}
const source = this.externalSourceFiles.get(url);
ts4.setSourceMapRange(node, { pos: sourceMapRange.start.offset, end: sourceMapRange.end.offset, source });
return node;
}
};
function createTemplateMiddle(cooked, raw) {
const node = ts4.factory.createTemplateHead(cooked, raw);
node.kind = ts4.SyntaxKind.TemplateMiddle;
return node;
}
function createTemplateTail(cooked, raw) {
const node = ts4.factory.createTemplateHead(cooked, raw);
node.kind = ts4.SyntaxKind.TemplateTail;
return node;
}
function attachComments(statement, leadingComments) {
for (const comment of leadingComments) {
const commentKind = comment.multiline ? ts4.SyntaxKind.MultiLineCommentTrivia : ts4.SyntaxKind.SingleLineCommentTrivia;
if (comment.multiline) {
ts4.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
} else {
for (const line of comment.toString().split("\n")) {
ts4.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
}
}
}
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_translator.mjs
function translateExpression(expression, imports, options = {}) {
return expression.visitExpression(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, options), new Context(false));
}
function translateStatement(statement, imports, options = {}) {
return statement.visitStatement(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, options), new Context(true));
}
export {
Context,
ImportManager,
ExpressionTranslatorVisitor,
canEmitType,
TypeEmitter,
translateType,
translateExpression,
translateStatement
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=chunk-O55FKOOW.js.map

File diff suppressed because one or more lines are too long

56
node_modules/@angular/compiler-cli/bundles/chunk-SBDNBITT.js generated vendored Executable file
View File

@@ -0,0 +1,56 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/logger.mjs
var LogLevel;
(function(LogLevel2) {
LogLevel2[LogLevel2["debug"] = 0] = "debug";
LogLevel2[LogLevel2["info"] = 1] = "info";
LogLevel2[LogLevel2["warn"] = 2] = "warn";
LogLevel2[LogLevel2["error"] = 3] = "error";
})(LogLevel || (LogLevel = {}));
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/console_logger.mjs
var RESET = "\x1B[0m";
var RED = "\x1B[31m";
var YELLOW = "\x1B[33m";
var BLUE = "\x1B[36m";
var DEBUG = `${BLUE}Debug:${RESET}`;
var WARN = `${YELLOW}Warning:${RESET}`;
var ERROR = `${RED}Error:${RESET}`;
var ConsoleLogger = class {
constructor(level) {
this.level = level;
}
debug(...args) {
if (this.level <= LogLevel.debug)
console.debug(DEBUG, ...args);
}
info(...args) {
if (this.level <= LogLevel.info)
console.info(...args);
}
warn(...args) {
if (this.level <= LogLevel.warn)
console.warn(WARN, ...args);
}
error(...args) {
if (this.level <= LogLevel.error)
console.error(ERROR, ...args);
}
};
export {
LogLevel,
ConsoleLogger
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=chunk-SBDNBITT.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": ["../../../../../../packages/compiler-cli/src/ngtsc/logging/src/logger.ts", "../../../../../../packages/compiler-cli/src/ngtsc/logging/src/console_logger.ts"],
"mappings": ";;;;;;AAoBA,IAAY;CAAZ,SAAYA,WAAQ;AAClB,EAAAA,UAAAA,UAAA,WAAA,KAAA;AACA,EAAAA,UAAAA,UAAA,UAAA,KAAA;AACA,EAAAA,UAAAA,UAAA,UAAA,KAAA;AACA,EAAAA,UAAAA,UAAA,WAAA,KAAA;AACF,GALY,aAAA,WAAQ,CAAA,EAAA;;;ACXpB,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,IAAO,gBAAP,MAAoB;EACxB,YAAmB,OAAe;AAAf,SAAA,QAAA;EAAkB;EACrC,SAAS,MAAc;AACrB,QAAI,KAAK,SAAS,SAAS;AAAO,cAAQ,MAAM,OAAO,GAAG,IAAI;EAChE;EACA,QAAQ,MAAc;AACpB,QAAI,KAAK,SAAS,SAAS;AAAM,cAAQ,KAAK,GAAG,IAAI;EACvD;EACA,QAAQ,MAAc;AACpB,QAAI,KAAK,SAAS,SAAS;AAAM,cAAQ,KAAK,MAAM,GAAG,IAAI;EAC7D;EACA,SAAS,MAAc;AACrB,QAAI,KAAK,SAAS,SAAS;AAAO,cAAQ,MAAM,OAAO,GAAG,IAAI;EAChE;;",
"names": ["LogLevel"]
}

345
node_modules/@angular/compiler-cli/bundles/chunk-T6CN22EQ.js generated vendored Executable file
View File

@@ -0,0 +1,345 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
DEFAULT_ERROR_CODE,
EmitFlags,
SOURCE,
createCompilerHost,
createMessageDiagnostic,
exitCodeFromResult,
formatDiagnostics,
performCompilation,
readConfiguration
} from "./chunk-KDLK7PF4.js";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/main.mjs
import ts2 from "typescript";
import yargs from "yargs";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_watch.mjs
import * as chokidar from "chokidar";
import * as path from "path";
import ts from "typescript";
function totalCompilationTimeDiagnostic(timeInMillis) {
let duration;
if (timeInMillis > 1e3) {
duration = `${(timeInMillis / 1e3).toPrecision(2)}s`;
} else {
duration = `${timeInMillis}ms`;
}
return {
category: ts.DiagnosticCategory.Message,
messageText: `Total time: ${duration}`,
code: DEFAULT_ERROR_CODE,
source: SOURCE,
file: void 0,
start: void 0,
length: void 0
};
}
var FileChangeEvent;
(function(FileChangeEvent2) {
FileChangeEvent2[FileChangeEvent2["Change"] = 0] = "Change";
FileChangeEvent2[FileChangeEvent2["CreateDelete"] = 1] = "CreateDelete";
FileChangeEvent2[FileChangeEvent2["CreateDeleteDir"] = 2] = "CreateDeleteDir";
})(FileChangeEvent || (FileChangeEvent = {}));
function createPerformWatchHost(configFileName, reportDiagnostics, existingOptions, createEmitCallback) {
return {
reportDiagnostics,
createCompilerHost: (options) => createCompilerHost({ options }),
readConfiguration: () => readConfiguration(configFileName, existingOptions),
createEmitCallback: (options) => createEmitCallback ? createEmitCallback(options) : void 0,
onFileChange: (options, listener, ready) => {
if (!options.basePath) {
reportDiagnostics([{
category: ts.DiagnosticCategory.Error,
messageText: "Invalid configuration option. baseDir not specified",
source: SOURCE,
code: DEFAULT_ERROR_CODE,
file: void 0,
start: void 0,
length: void 0
}]);
return { close: () => {
} };
}
const watcher = chokidar.watch(options.basePath, {
ignored: /((^[\/\\])\..)|(\.js$)|(\.map$)|(\.metadata\.json|node_modules)/,
ignoreInitial: true,
persistent: true
});
watcher.on("all", (event, path2) => {
switch (event) {
case "change":
listener(FileChangeEvent.Change, path2);
break;
case "unlink":
case "add":
listener(FileChangeEvent.CreateDelete, path2);
break;
case "unlinkDir":
case "addDir":
listener(FileChangeEvent.CreateDeleteDir, path2);
break;
}
});
watcher.on("ready", ready);
return { close: () => watcher.close(), ready };
},
setTimeout: ts.sys.clearTimeout && ts.sys.setTimeout || setTimeout,
clearTimeout: ts.sys.setTimeout && ts.sys.clearTimeout || clearTimeout
};
}
function performWatchCompilation(host) {
let cachedProgram;
let cachedCompilerHost;
let cachedOptions;
let timerHandleForRecompilation;
const ignoreFilesForWatch = /* @__PURE__ */ new Set();
const fileCache = /* @__PURE__ */ new Map();
const firstCompileResult = doCompilation();
let resolveReadyPromise;
const readyPromise = new Promise((resolve) => resolveReadyPromise = resolve);
const fileWatcher = host.onFileChange(cachedOptions.options, watchedFileChanged, resolveReadyPromise);
return { close, ready: (cb) => readyPromise.then(cb), firstCompileResult };
function cacheEntry(fileName) {
fileName = path.normalize(fileName);
let entry = fileCache.get(fileName);
if (!entry) {
entry = {};
fileCache.set(fileName, entry);
}
return entry;
}
function close() {
fileWatcher.close();
if (timerHandleForRecompilation) {
host.clearTimeout(timerHandleForRecompilation.timerHandle);
timerHandleForRecompilation = void 0;
}
}
function doCompilation() {
if (!cachedOptions) {
cachedOptions = host.readConfiguration();
}
if (cachedOptions.errors && cachedOptions.errors.length) {
host.reportDiagnostics(cachedOptions.errors);
return cachedOptions.errors;
}
const startTime = Date.now();
if (!cachedCompilerHost) {
cachedCompilerHost = host.createCompilerHost(cachedOptions.options);
const originalWriteFileCallback = cachedCompilerHost.writeFile;
cachedCompilerHost.writeFile = function(fileName, data, writeByteOrderMark, onError, sourceFiles = []) {
ignoreFilesForWatch.add(path.normalize(fileName));
return originalWriteFileCallback(fileName, data, writeByteOrderMark, onError, sourceFiles);
};
const originalFileExists = cachedCompilerHost.fileExists;
cachedCompilerHost.fileExists = function(fileName) {
const ce = cacheEntry(fileName);
if (ce.exists == null) {
ce.exists = originalFileExists.call(this, fileName);
}
return ce.exists;
};
const originalGetSourceFile = cachedCompilerHost.getSourceFile;
cachedCompilerHost.getSourceFile = function(fileName, languageVersion) {
const ce = cacheEntry(fileName);
if (!ce.sf) {
ce.sf = originalGetSourceFile.call(this, fileName, languageVersion);
}
return ce.sf;
};
const originalReadFile = cachedCompilerHost.readFile;
cachedCompilerHost.readFile = function(fileName) {
const ce = cacheEntry(fileName);
if (ce.content == null) {
ce.content = originalReadFile.call(this, fileName);
}
return ce.content;
};
cachedCompilerHost.getModifiedResourceFiles = function() {
if (timerHandleForRecompilation === void 0) {
return void 0;
}
return timerHandleForRecompilation.modifiedResourceFiles;
};
}
ignoreFilesForWatch.clear();
const oldProgram = cachedProgram;
cachedProgram = void 0;
const compileResult = performCompilation({
rootNames: cachedOptions.rootNames,
options: cachedOptions.options,
host: cachedCompilerHost,
oldProgram,
emitCallback: host.createEmitCallback(cachedOptions.options)
});
if (compileResult.diagnostics.length) {
host.reportDiagnostics(compileResult.diagnostics);
}
const endTime = Date.now();
if (cachedOptions.options.diagnostics) {
const totalTime = (endTime - startTime) / 1e3;
host.reportDiagnostics([totalCompilationTimeDiagnostic(endTime - startTime)]);
}
const exitCode = exitCodeFromResult(compileResult.diagnostics);
if (exitCode == 0) {
cachedProgram = compileResult.program;
host.reportDiagnostics([createMessageDiagnostic("Compilation complete. Watching for file changes.")]);
} else {
host.reportDiagnostics([createMessageDiagnostic("Compilation failed. Watching for file changes.")]);
}
return compileResult.diagnostics;
}
function resetOptions() {
cachedProgram = void 0;
cachedCompilerHost = void 0;
cachedOptions = void 0;
}
function watchedFileChanged(event, fileName) {
const normalizedPath = path.normalize(fileName);
if (cachedOptions && event === FileChangeEvent.Change && normalizedPath === path.normalize(cachedOptions.project)) {
resetOptions();
} else if (event === FileChangeEvent.CreateDelete || event === FileChangeEvent.CreateDeleteDir) {
cachedOptions = void 0;
}
if (event === FileChangeEvent.CreateDeleteDir) {
fileCache.clear();
} else {
fileCache.delete(normalizedPath);
}
if (!ignoreFilesForWatch.has(normalizedPath)) {
startTimerForRecompilation(normalizedPath);
}
}
function startTimerForRecompilation(changedPath) {
if (timerHandleForRecompilation) {
host.clearTimeout(timerHandleForRecompilation.timerHandle);
} else {
timerHandleForRecompilation = {
modifiedResourceFiles: /* @__PURE__ */ new Set(),
timerHandle: void 0
};
}
timerHandleForRecompilation.timerHandle = host.setTimeout(recompile, 250);
timerHandleForRecompilation.modifiedResourceFiles.add(changedPath);
}
function recompile() {
host.reportDiagnostics([createMessageDiagnostic("File change detected. Starting incremental compilation.")]);
doCompilation();
timerHandleForRecompilation = void 0;
}
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/main.mjs
function main(args, consoleError = console.error, config, customTransformers, programReuse, modifiedResourceFiles) {
let { project, rootNames, options, errors: configErrors, watch: watch2, emitFlags } = config || readNgcCommandLineAndConfiguration(args);
if (configErrors.length) {
return reportErrorsAndExit(configErrors, void 0, consoleError);
}
if (watch2) {
const result = watchMode(project, options, consoleError);
return reportErrorsAndExit(result.firstCompileResult, options, consoleError);
}
let oldProgram;
if (programReuse !== void 0) {
oldProgram = programReuse.program;
}
const { diagnostics: compileDiags, program } = performCompilation({ rootNames, options, emitFlags, oldProgram, customTransformers, modifiedResourceFiles });
if (programReuse !== void 0) {
programReuse.program = program;
}
return reportErrorsAndExit(compileDiags, options, consoleError);
}
function readNgcCommandLineAndConfiguration(args) {
const options = {};
const parsedArgs = yargs(args).parserConfiguration({ "strip-aliased": true }).option("i18nFile", { type: "string" }).option("i18nFormat", { type: "string" }).option("locale", { type: "string" }).option("missingTranslation", { type: "string", choices: ["error", "warning", "ignore"] }).option("outFile", { type: "string" }).option("watch", { type: "boolean", alias: ["w"] }).parseSync();
if (parsedArgs.i18nFile)
options.i18nInFile = parsedArgs.i18nFile;
if (parsedArgs.i18nFormat)
options.i18nInFormat = parsedArgs.i18nFormat;
if (parsedArgs.locale)
options.i18nInLocale = parsedArgs.locale;
if (parsedArgs.missingTranslation)
options.i18nInMissingTranslations = parsedArgs.missingTranslation;
const config = readCommandLineAndConfiguration(args, options, ["i18nFile", "i18nFormat", "locale", "missingTranslation", "watch"]);
return { ...config, watch: parsedArgs.watch };
}
function readCommandLineAndConfiguration(args, existingOptions = {}, ngCmdLineOptions = []) {
let cmdConfig = ts2.parseCommandLine(args);
const project = cmdConfig.options.project || ".";
const cmdErrors = cmdConfig.errors.filter((e) => {
if (typeof e.messageText === "string") {
const msg = e.messageText;
return !ngCmdLineOptions.some((o) => msg.indexOf(o) >= 0);
}
return true;
});
if (cmdErrors.length) {
return {
project,
rootNames: [],
options: cmdConfig.options,
errors: cmdErrors,
emitFlags: EmitFlags.Default
};
}
const config = readConfiguration(project, cmdConfig.options);
const options = { ...config.options, ...existingOptions };
if (options.locale) {
options.i18nInLocale = options.locale;
}
return {
project,
rootNames: config.rootNames,
options,
errors: config.errors,
emitFlags: config.emitFlags
};
}
function getFormatDiagnosticsHost(options) {
const basePath = options ? options.basePath : void 0;
return {
getCurrentDirectory: () => basePath || ts2.sys.getCurrentDirectory(),
getCanonicalFileName: (fileName) => fileName.replace(/\\/g, "/"),
getNewLine: () => {
if (options && options.newLine !== void 0) {
return options.newLine === ts2.NewLineKind.LineFeed ? "\n" : "\r\n";
}
return ts2.sys.newLine;
}
};
}
function reportErrorsAndExit(allDiagnostics, options, consoleError = console.error) {
const errorsAndWarnings = allDiagnostics.filter((d) => d.category !== ts2.DiagnosticCategory.Message);
printDiagnostics(errorsAndWarnings, options, consoleError);
return exitCodeFromResult(allDiagnostics);
}
function watchMode(project, options, consoleError) {
return performWatchCompilation(createPerformWatchHost(project, (diagnostics) => {
printDiagnostics(diagnostics, options, consoleError);
}, options, void 0));
}
function printDiagnostics(diagnostics, options, consoleError) {
if (diagnostics.length === 0) {
return;
}
const formatHost = getFormatDiagnosticsHost(options);
consoleError(formatDiagnostics(diagnostics, formatHost));
}
export {
main,
readCommandLineAndConfiguration
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=chunk-T6CN22EQ.js.map

File diff suppressed because one or more lines are too long

16
node_modules/@angular/compiler-cli/bundles/chunk-XI2RTGAL.js generated vendored Executable file
View File

@@ -0,0 +1,16 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined")
return require.apply(this, arguments);
throw new Error('Dynamic require of "' + x + '" is not supported');
});
export {
__require
};
//# sourceMappingURL=chunk-XI2RTGAL.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": [],
"mappings": "",
"names": []
}

347
node_modules/@angular/compiler-cli/bundles/chunk-XXICUNOF.js generated vendored Executable file
View File

@@ -0,0 +1,347 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
TypeScriptReflectionHost,
isAliasImportDeclaration,
loadIsReferencedAliasDeclarationPatch
} from "./chunk-G64XB6AU.js";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.mjs
import ts from "typescript";
function isAngularDecorator(decorator, isCore) {
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
}
var DECORATOR_INVOCATION_JSDOC_TYPE = "!Array<{type: !Function, args: (undefined|!Array<?>)}>";
function extractMetadataFromSingleDecorator(decorator, diagnostics) {
const metadataProperties = [];
const expr = decorator.expression;
switch (expr.kind) {
case ts.SyntaxKind.Identifier:
metadataProperties.push(ts.factory.createPropertyAssignment("type", expr));
break;
case ts.SyntaxKind.CallExpression:
const call = expr;
metadataProperties.push(ts.factory.createPropertyAssignment("type", call.expression));
if (call.arguments.length) {
const args = [];
for (const arg of call.arguments) {
args.push(arg);
}
const argsArrayLiteral = ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray(args, true));
metadataProperties.push(ts.factory.createPropertyAssignment("args", argsArrayLiteral));
}
break;
default:
diagnostics.push({
file: decorator.getSourceFile(),
start: decorator.getStart(),
length: decorator.getEnd() - decorator.getStart(),
messageText: `${ts.SyntaxKind[decorator.kind]} not implemented in gathering decorator metadata.`,
category: ts.DiagnosticCategory.Error,
code: 0
});
break;
}
return ts.factory.createObjectLiteralExpression(metadataProperties);
}
function createCtorParametersClassProperty(diagnostics, entityNameToExpression, ctorParameters, isClosureCompilerEnabled) {
const params = [];
for (const ctorParam of ctorParameters) {
if (!ctorParam.type && ctorParam.decorators.length === 0) {
params.push(ts.factory.createNull());
continue;
}
const paramType = ctorParam.type ? typeReferenceToExpression(entityNameToExpression, ctorParam.type) : void 0;
const members = [ts.factory.createPropertyAssignment("type", paramType || ts.factory.createIdentifier("undefined"))];
const decorators = [];
for (const deco of ctorParam.decorators) {
decorators.push(extractMetadataFromSingleDecorator(deco, diagnostics));
}
if (decorators.length) {
members.push(ts.factory.createPropertyAssignment("decorators", ts.factory.createArrayLiteralExpression(decorators)));
}
params.push(ts.factory.createObjectLiteralExpression(members));
}
const initializer = ts.factory.createArrowFunction(void 0, void 0, [], void 0, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createArrayLiteralExpression(params, true));
const ctorProp = ts.factory.createPropertyDeclaration([ts.factory.createToken(ts.SyntaxKind.StaticKeyword)], "ctorParameters", void 0, void 0, initializer);
if (isClosureCompilerEnabled) {
ts.setSyntheticLeadingComments(ctorProp, [
{
kind: ts.SyntaxKind.MultiLineCommentTrivia,
text: [
`*`,
` * @type {function(): !Array<(null|{`,
` * type: ?,`,
` * decorators: (undefined|${DECORATOR_INVOCATION_JSDOC_TYPE}),`,
` * })>}`,
` * @nocollapse`,
` `
].join("\n"),
pos: -1,
end: -1,
hasTrailingNewLine: true
}
]);
}
return ctorProp;
}
function typeReferenceToExpression(entityNameToExpression, node) {
let kind = node.kind;
if (ts.isLiteralTypeNode(node)) {
kind = node.literal.kind;
}
switch (kind) {
case ts.SyntaxKind.FunctionType:
case ts.SyntaxKind.ConstructorType:
return ts.factory.createIdentifier("Function");
case ts.SyntaxKind.ArrayType:
case ts.SyntaxKind.TupleType:
return ts.factory.createIdentifier("Array");
case ts.SyntaxKind.TypePredicate:
case ts.SyntaxKind.TrueKeyword:
case ts.SyntaxKind.FalseKeyword:
case ts.SyntaxKind.BooleanKeyword:
return ts.factory.createIdentifier("Boolean");
case ts.SyntaxKind.StringLiteral:
case ts.SyntaxKind.StringKeyword:
return ts.factory.createIdentifier("String");
case ts.SyntaxKind.ObjectKeyword:
return ts.factory.createIdentifier("Object");
case ts.SyntaxKind.NumberKeyword:
case ts.SyntaxKind.NumericLiteral:
return ts.factory.createIdentifier("Number");
case ts.SyntaxKind.TypeReference:
const typeRef = node;
return entityNameToExpression(typeRef.typeName);
case ts.SyntaxKind.UnionType:
const childTypeNodes = node.types.filter((t) => !(ts.isLiteralTypeNode(t) && t.literal.kind === ts.SyntaxKind.NullKeyword));
return childTypeNodes.length === 1 ? typeReferenceToExpression(entityNameToExpression, childTypeNodes[0]) : void 0;
default:
return void 0;
}
}
function symbolIsRuntimeValue(typeChecker, symbol) {
if (symbol.flags & ts.SymbolFlags.Alias) {
symbol = typeChecker.getAliasedSymbol(symbol);
}
return (symbol.flags & ts.SymbolFlags.Value & ts.SymbolFlags.ConstEnumExcludes) !== 0;
}
function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore, isClosureCompilerEnabled) {
function addJSDocTypeAnnotation(node, jsdocType) {
if (!isClosureCompilerEnabled) {
return;
}
ts.setSyntheticLeadingComments(node, [
{
kind: ts.SyntaxKind.MultiLineCommentTrivia,
text: `* @type {${jsdocType}} `,
pos: -1,
end: -1,
hasTrailingNewLine: true
}
]);
}
function createPropDecoratorsClassProperty(diagnostics2, properties) {
const entries = [];
for (const [name, decorators] of properties.entries()) {
entries.push(ts.factory.createPropertyAssignment(name, ts.factory.createArrayLiteralExpression(decorators.map((deco) => extractMetadataFromSingleDecorator(deco, diagnostics2)))));
}
const initializer = ts.factory.createObjectLiteralExpression(entries, true);
const prop = ts.factory.createPropertyDeclaration([ts.factory.createToken(ts.SyntaxKind.StaticKeyword)], "propDecorators", void 0, void 0, initializer);
addJSDocTypeAnnotation(prop, `!Object<string, ${DECORATOR_INVOCATION_JSDOC_TYPE}>`);
return prop;
}
return (context) => {
const referencedParameterTypes = loadIsReferencedAliasDeclarationPatch(context);
function entityNameToExpression(name) {
const symbol = typeChecker.getSymbolAtLocation(name);
if (!symbol || !symbolIsRuntimeValue(typeChecker, symbol) || !symbol.declarations || symbol.declarations.length === 0) {
return void 0;
}
if (ts.isQualifiedName(name)) {
const containerExpr = entityNameToExpression(name.left);
if (containerExpr === void 0) {
return void 0;
}
return ts.factory.createPropertyAccessExpression(containerExpr, name.right);
}
const decl = symbol.declarations[0];
if (isAliasImportDeclaration(decl)) {
referencedParameterTypes.add(decl);
if (decl.name !== void 0) {
return ts.setOriginalNode(ts.factory.createIdentifier(decl.name.text), decl.name);
}
}
return ts.setOriginalNode(ts.factory.createIdentifier(name.text), name);
}
function transformClassElement(element) {
element = ts.visitEachChild(element, decoratorDownlevelVisitor, context);
const decoratorsToKeep = [];
const toLower = [];
const decorators = host.getDecoratorsOfDeclaration(element) || [];
for (const decorator of decorators) {
const decoratorNode = decorator.node;
if (!isAngularDecorator(decorator, isCore)) {
decoratorsToKeep.push(decoratorNode);
continue;
}
toLower.push(decoratorNode);
}
if (!toLower.length)
return [void 0, element, []];
if (!element.name || !ts.isIdentifier(element.name)) {
diagnostics.push({
file: element.getSourceFile(),
start: element.getStart(),
length: element.getEnd() - element.getStart(),
messageText: `Cannot process decorators for class element with non-analyzable name.`,
category: ts.DiagnosticCategory.Error,
code: 0
});
return [void 0, element, []];
}
const elementModifiers = ts.canHaveModifiers(element) ? ts.getModifiers(element) : void 0;
let modifiers;
if (decoratorsToKeep.length || (elementModifiers == null ? void 0 : elementModifiers.length)) {
modifiers = ts.setTextRange(ts.factory.createNodeArray([...decoratorsToKeep, ...elementModifiers || []]), element.modifiers);
}
return [element.name.text, cloneClassElementWithModifiers(element, modifiers), toLower];
}
function transformConstructor(ctor) {
ctor = ts.visitEachChild(ctor, decoratorDownlevelVisitor, context);
const newParameters = [];
const oldParameters = ctor.parameters;
const parametersInfo = [];
for (const param of oldParameters) {
const decoratorsToKeep = [];
const paramInfo = { decorators: [], type: null };
const decorators = host.getDecoratorsOfDeclaration(param) || [];
for (const decorator of decorators) {
const decoratorNode = decorator.node;
if (!isAngularDecorator(decorator, isCore)) {
decoratorsToKeep.push(decoratorNode);
continue;
}
paramInfo.decorators.push(decoratorNode);
}
if (param.type) {
paramInfo.type = param.type;
}
parametersInfo.push(paramInfo);
let modifiers;
const paramModifiers = ts.getModifiers(param);
if (decoratorsToKeep.length || (paramModifiers == null ? void 0 : paramModifiers.length)) {
modifiers = [...decoratorsToKeep, ...paramModifiers || []];
}
const newParam = ts.factory.updateParameterDeclaration(param, modifiers, param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer);
newParameters.push(newParam);
}
const updated = ts.factory.updateConstructorDeclaration(ctor, ts.getModifiers(ctor), newParameters, ctor.body);
return [updated, parametersInfo];
}
function transformClassDeclaration(classDecl) {
const newMembers = [];
const decoratedProperties = /* @__PURE__ */ new Map();
let classParameters = null;
for (const member of classDecl.members) {
switch (member.kind) {
case ts.SyntaxKind.PropertyDeclaration:
case ts.SyntaxKind.GetAccessor:
case ts.SyntaxKind.SetAccessor:
case ts.SyntaxKind.MethodDeclaration: {
const [name, newMember, decorators] = transformClassElement(member);
newMembers.push(newMember);
if (name)
decoratedProperties.set(name, decorators);
continue;
}
case ts.SyntaxKind.Constructor: {
const ctor = member;
if (!ctor.body)
break;
const [newMember, parametersInfo] = transformConstructor(member);
classParameters = parametersInfo;
newMembers.push(newMember);
continue;
}
default:
break;
}
newMembers.push(ts.visitEachChild(member, decoratorDownlevelVisitor, context));
}
const possibleAngularDecorators = host.getDecoratorsOfDeclaration(classDecl) || [];
const hasAngularDecorator = possibleAngularDecorators.some((d) => isAngularDecorator(d, isCore));
if (classParameters) {
if (hasAngularDecorator || classParameters.some((p) => !!p.decorators.length)) {
newMembers.push(createCtorParametersClassProperty(diagnostics, entityNameToExpression, classParameters, isClosureCompilerEnabled));
}
}
if (decoratedProperties.size) {
newMembers.push(createPropDecoratorsClassProperty(diagnostics, decoratedProperties));
}
const members = ts.setTextRange(ts.factory.createNodeArray(newMembers, classDecl.members.hasTrailingComma), classDecl.members);
return ts.factory.updateClassDeclaration(classDecl, classDecl.modifiers, classDecl.name, classDecl.typeParameters, classDecl.heritageClauses, members);
}
function decoratorDownlevelVisitor(node) {
if (ts.isClassDeclaration(node)) {
return transformClassDeclaration(node);
}
return ts.visitEachChild(node, decoratorDownlevelVisitor, context);
}
return (sf) => {
return ts.visitEachChild(sf, decoratorDownlevelVisitor, context);
};
};
}
function cloneClassElementWithModifiers(node, modifiers) {
let clone;
if (ts.isMethodDeclaration(node)) {
clone = ts.factory.createMethodDeclaration(modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
} else if (ts.isPropertyDeclaration(node)) {
clone = ts.factory.createPropertyDeclaration(modifiers, node.name, node.questionToken, node.type, node.initializer);
} else if (ts.isGetAccessor(node)) {
clone = ts.factory.createGetAccessorDeclaration(modifiers, node.name, node.parameters, node.type, node.body);
} else if (ts.isSetAccessor(node)) {
clone = ts.factory.createSetAccessorDeclaration(modifiers, node.name, node.parameters, node.body);
} else {
throw new Error(`Unsupported decorated member with kind ${ts.SyntaxKind[node.kind]}`);
}
return ts.setOriginalNode(clone, node);
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/private/tooling.mjs
var GLOBAL_DEFS_FOR_TERSER = {
ngDevMode: false,
ngI18nClosureMode: false
};
var GLOBAL_DEFS_FOR_TERSER_WITH_AOT = {
...GLOBAL_DEFS_FOR_TERSER,
ngJitMode: false
};
function constructorParametersDownlevelTransform(program) {
const typeChecker = program.getTypeChecker();
const reflectionHost = new TypeScriptReflectionHost(typeChecker);
return getDownlevelDecoratorsTransform(
typeChecker,
reflectionHost,
[],
false,
false
);
}
export {
GLOBAL_DEFS_FOR_TERSER,
GLOBAL_DEFS_FOR_TERSER_WITH_AOT,
constructorParametersDownlevelTransform
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=chunk-XXICUNOF.js.map

File diff suppressed because one or more lines are too long

210
node_modules/@angular/compiler-cli/bundles/index.js generated vendored Executable file
View File

@@ -0,0 +1,210 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
GLOBAL_DEFS_FOR_TERSER,
GLOBAL_DEFS_FOR_TERSER_WITH_AOT,
constructorParametersDownlevelTransform
} from "./chunk-XXICUNOF.js";
import {
DEFAULT_ERROR_CODE,
DecoratorType,
EmitFlags,
EntryType,
MemberTags,
MemberType,
NgCompiler,
NgCompilerHost,
NgtscProgram,
PatchedProgramIncrementalBuildStrategy,
SOURCE,
TsCreateProgramDriver,
UNKNOWN_ERROR_CODE,
calcProjectFileAndBasePath,
createCompilerHost,
createProgram,
defaultGatherDiagnostics,
exitCodeFromResult,
formatDiagnostics,
freshCompilationTicket,
incrementalFromStateTicket,
isTsDiagnostic,
performCompilation,
readConfiguration,
untagAllTsFiles
} from "./chunk-KDLK7PF4.js";
import {
OptimizeFor
} from "./chunk-B5URQIVL.js";
import "./chunk-O55FKOOW.js";
import "./chunk-G64XB6AU.js";
import {
ActivePerfRecorder,
PerfPhase
} from "./chunk-3IBJEGH3.js";
import {
ConsoleLogger,
LogLevel
} from "./chunk-SBDNBITT.js";
import {
LogicalFileSystem,
LogicalProjectPath,
NgtscCompilerHost,
NodeJSFileSystem,
absoluteFrom,
absoluteFromSourceFile,
basename,
dirname,
getFileSystem,
getSourceFileOrError,
isLocalRelativePath,
isRoot,
isRooted,
join,
relative,
relativeFrom,
resolve,
setFileSystem,
toRelativeImport
} from "./chunk-CSOLWS7O.js";
import "./chunk-XI2RTGAL.js";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
import { Version } from "@angular/compiler";
var VERSION = new Version("17.0.8");
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/tsc_plugin.mjs
var NgTscPlugin = class {
get compiler() {
if (this._compiler === null) {
throw new Error("Lifecycle error: setupCompilation() must be called first.");
}
return this._compiler;
}
constructor(ngOptions) {
this.ngOptions = ngOptions;
this.name = "ngtsc";
this.options = null;
this.host = null;
this._compiler = null;
setFileSystem(new NodeJSFileSystem());
}
wrapHost(host, inputFiles, options) {
this.options = { ...this.ngOptions, ...options };
this.host = NgCompilerHost.wrap(host, inputFiles, this.options, null);
return this.host;
}
setupCompilation(program, oldProgram) {
var _a;
const perfRecorder = ActivePerfRecorder.zeroedToNow();
if (this.host === null || this.options === null) {
throw new Error("Lifecycle error: setupCompilation() before wrapHost().");
}
this.host.postProgramCreationCleanup();
untagAllTsFiles(program);
const programDriver = new TsCreateProgramDriver(program, this.host, this.options, this.host.shimExtensionPrefixes);
const strategy = new PatchedProgramIncrementalBuildStrategy();
const oldState = oldProgram !== void 0 ? strategy.getIncrementalState(oldProgram) : null;
let ticket;
const modifiedResourceFiles = /* @__PURE__ */ new Set();
if (this.host.getModifiedResourceFiles !== void 0) {
for (const resourceFile of (_a = this.host.getModifiedResourceFiles()) != null ? _a : []) {
modifiedResourceFiles.add(resolve(resourceFile));
}
}
if (oldProgram === void 0 || oldState === null) {
ticket = freshCompilationTicket(
program,
this.options,
strategy,
programDriver,
perfRecorder,
false,
false
);
} else {
strategy.toNextBuildStrategy().getIncrementalState(oldProgram);
ticket = incrementalFromStateTicket(oldProgram, oldState, program, this.options, strategy, programDriver, modifiedResourceFiles, perfRecorder, false, false);
}
this._compiler = NgCompiler.fromTicket(ticket, this.host);
return {
ignoreForDiagnostics: this._compiler.ignoreForDiagnostics,
ignoreForEmit: this._compiler.ignoreForEmit
};
}
getDiagnostics(file) {
if (file === void 0) {
return this.compiler.getDiagnostics();
}
return this.compiler.getDiagnosticsForFile(file, OptimizeFor.WholeProgram);
}
getOptionDiagnostics() {
return this.compiler.getOptionDiagnostics();
}
getNextProgram() {
return this.compiler.getCurrentProgram();
}
createTransformers() {
this.compiler.perfRecorder.phase(PerfPhase.TypeScriptEmit);
return this.compiler.prepareEmit().transformers;
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/index.mjs
setFileSystem(new NodeJSFileSystem());
export {
ConsoleLogger,
DEFAULT_ERROR_CODE,
DecoratorType,
EmitFlags,
EntryType,
GLOBAL_DEFS_FOR_TERSER,
GLOBAL_DEFS_FOR_TERSER_WITH_AOT,
LogLevel,
LogicalFileSystem,
LogicalProjectPath,
MemberTags,
MemberType,
NgTscPlugin,
NgtscCompilerHost,
NgtscProgram,
NodeJSFileSystem,
OptimizeFor,
SOURCE,
UNKNOWN_ERROR_CODE,
VERSION,
absoluteFrom,
absoluteFromSourceFile,
basename,
calcProjectFileAndBasePath,
constructorParametersDownlevelTransform,
createCompilerHost,
createProgram,
defaultGatherDiagnostics,
dirname,
exitCodeFromResult,
formatDiagnostics,
getFileSystem,
getSourceFileOrError,
isLocalRelativePath,
isRoot,
isRooted,
isTsDiagnostic,
join,
performCompilation,
readConfiguration,
relative,
relativeFrom,
resolve,
setFileSystem,
toRelativeImport
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=index.js.map

6
node_modules/@angular/compiler-cli/bundles/index.js.map generated vendored Executable file
View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": ["../../../../../../packages/compiler-cli/src/version.ts", "../../../../../../packages/compiler-cli/src/ngtsc/tsc_plugin.ts", "../../../../../../packages/compiler-cli/index.ts"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,SAAQ,eAAc;AAEf,IAAM,UAAU,IAAI,QAAQ,mBAAmB;;;AC+ChD,IAAO,cAAP,MAAkB;EAOtB,IAAI,WAAQ;AACV,QAAI,KAAK,cAAc,MAAM;AAC3B,YAAM,IAAI,MAAM,2DAA2D;;AAE7E,WAAO,KAAK;EACd;EAEA,YAAoB,WAAa;AAAb,SAAA,YAAA;AAbpB,SAAA,OAAO;AAEC,SAAA,UAAkC;AAClC,SAAA,OAA4B;AAC5B,SAAA,YAA6B;AAUnC,kBAAc,IAAI,iBAAgB,CAAE;EACtC;EAEA,SACI,MAAmD,YACnD,SAA2B;AAI7B,SAAK,UAAU,EAAC,GAAG,KAAK,WAAW,GAAG,QAAO;AAC7C,SAAK,OAAO,eAAe,KAAK,MAAM,YAAY,KAAK,SAA0B,IAAI;AACrF,WAAO,KAAK;EACd;EAEA,iBAAiB,SAAqB,YAAuB;AA5F/D;AAsGI,UAAM,eAAe,mBAAmB,YAAW;AACnD,QAAI,KAAK,SAAS,QAAQ,KAAK,YAAY,MAAM;AAC/C,YAAM,IAAI,MAAM,wDAAwD;;AAE1E,SAAK,KAAK,2BAA0B;AACpC,oBAAgB,OAAO;AACvB,UAAM,gBAAgB,IAAI,sBACtB,SAAS,KAAK,MAAM,KAAK,SAAS,KAAK,KAAK,qBAAqB;AACrE,UAAM,WAAW,IAAI,uCAAsC;AAC3D,UAAM,WAAW,eAAe,SAAY,SAAS,oBAAoB,UAAU,IAAI;AACvF,QAAI;AAEJ,UAAM,wBAAwB,oBAAI,IAAG;AACrC,QAAI,KAAK,KAAK,6BAA6B,QAAW;AACpD,iBAAW,iBAAgB,UAAK,KAAK,yBAAwB,MAAlC,YAAwC,CAAA,GAAI;AACrE,8BAAsB,IAAI,QAAQ,YAAY,CAAC;;;AAInD,QAAI,eAAe,UAAa,aAAa,MAAM;AACjD,eAAS;QACL;QAAS,KAAK;QAAS;QAAU;QAAe;QAChB;QAA6B;MAAK;WACjE;AACL,eAAS,oBAAmB,EAAG,oBAAoB,UAAU;AAC7D,eAAS,2BACL,YAAY,UAAU,SAAS,KAAK,SAAS,UAAU,eACvD,uBAAuB,cAAc,OAAO,KAAK;;AAEvD,SAAK,YAAY,WAAW,WAAW,QAAQ,KAAK,IAAI;AACxD,WAAO;MACL,sBAAsB,KAAK,UAAU;MACrC,eAAe,KAAK,UAAU;;EAElC;EAEA,eAAe,MAAoB;AACjC,QAAI,SAAS,QAAW;AACtB,aAAO,KAAK,SAAS,eAAc;;AAErC,WAAO,KAAK,SAAS,sBAAsB,MAAM,YAAY,YAAY;EAC3E;EAEA,uBAAoB;AAClB,WAAO,KAAK,SAAS,qBAAoB;EAC3C;EAEA,iBAAc;AACZ,WAAO,KAAK,SAAS,kBAAiB;EACxC;EAEA,qBAAkB;AAGhB,SAAK,SAAS,aAAa,MAAM,UAAU,cAAc;AACzD,WAAO,KAAK,SAAS,YAAW,EAAG;EACrC;;;;ACrHF,cAAc,IAAI,iBAAgB,CAAE;",
"names": []
}

View File

@@ -0,0 +1,418 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
FatalLinkerError,
FileLinker,
LinkerEnvironment,
assert,
isFatalLinkerError
} from "../../chunk-GT7FGHLZ.js";
import "../../chunk-O55FKOOW.js";
import "../../chunk-G64XB6AU.js";
import {
ConsoleLogger,
LogLevel
} from "../../chunk-SBDNBITT.js";
import "../../chunk-GYHDNUIK.js";
import {
NodeJSFileSystem
} from "../../chunk-CSOLWS7O.js";
import "../../chunk-XI2RTGAL.js";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/linker/babel/src/es2015_linker_plugin.mjs
import { types as t4 } from "@babel/core";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/linker/babel/src/ast/babel_ast_factory.mjs
import { types as t } from "@babel/core";
var BabelAstFactory = class {
constructor(sourceUrl) {
this.sourceUrl = sourceUrl;
this.createArrayLiteral = t.arrayExpression;
this.createBlock = t.blockStatement;
this.createConditional = t.conditionalExpression;
this.createExpressionStatement = t.expressionStatement;
this.createIdentifier = t.identifier;
this.createIfStatement = t.ifStatement;
this.createNewExpression = t.newExpression;
this.createParenthesizedExpression = t.parenthesizedExpression;
this.createReturnStatement = t.returnStatement;
this.createThrowStatement = t.throwStatement;
this.createUnaryExpression = t.unaryExpression;
}
attachComments(statement, leadingComments) {
for (let i = leadingComments.length - 1; i >= 0; i--) {
const comment = leadingComments[i];
t.addComment(statement, "leading", comment.toString(), !comment.multiline);
}
}
createAssignment(target, value) {
assert(target, isLExpression, "must be a left hand side expression");
return t.assignmentExpression("=", target, value);
}
createBinaryExpression(leftOperand, operator, rightOperand) {
switch (operator) {
case "&&":
case "||":
case "??":
return t.logicalExpression(operator, leftOperand, rightOperand);
default:
return t.binaryExpression(operator, leftOperand, rightOperand);
}
}
createCallExpression(callee, args, pure) {
const call = t.callExpression(callee, args);
if (pure) {
t.addComment(call, "leading", " @__PURE__ ", false);
}
return call;
}
createElementAccess(expression, element) {
return t.memberExpression(expression, element, true);
}
createFunctionDeclaration(functionName, parameters, body) {
assert(body, t.isBlockStatement, "a block");
return t.functionDeclaration(t.identifier(functionName), parameters.map((param) => t.identifier(param)), body);
}
createArrowFunctionExpression(parameters, body) {
if (t.isStatement(body)) {
assert(body, t.isBlockStatement, "a block");
}
return t.arrowFunctionExpression(parameters.map((param) => t.identifier(param)), body);
}
createFunctionExpression(functionName, parameters, body) {
assert(body, t.isBlockStatement, "a block");
const name = functionName !== null ? t.identifier(functionName) : null;
return t.functionExpression(name, parameters.map((param) => t.identifier(param)), body);
}
createDynamicImport(url) {
return this.createCallExpression(t.import(), [t.stringLiteral(url)], false);
}
createLiteral(value) {
if (typeof value === "string") {
return t.stringLiteral(value);
} else if (typeof value === "number") {
return t.numericLiteral(value);
} else if (typeof value === "boolean") {
return t.booleanLiteral(value);
} else if (value === void 0) {
return t.identifier("undefined");
} else if (value === null) {
return t.nullLiteral();
} else {
throw new Error(`Invalid literal: ${value} (${typeof value})`);
}
}
createObjectLiteral(properties) {
return t.objectExpression(properties.map((prop) => {
const key = prop.quoted ? t.stringLiteral(prop.propertyName) : t.identifier(prop.propertyName);
return t.objectProperty(key, prop.value);
}));
}
createPropertyAccess(expression, propertyName) {
return t.memberExpression(expression, t.identifier(propertyName), false);
}
createTaggedTemplate(tag, template) {
const elements = template.elements.map((element, i) => this.setSourceMapRange(t.templateElement(element, i === template.elements.length - 1), element.range));
return t.taggedTemplateExpression(tag, t.templateLiteral(elements, template.expressions));
}
createTypeOfExpression(expression) {
return t.unaryExpression("typeof", expression);
}
createVariableDeclaration(variableName, initializer, type) {
return t.variableDeclaration(type, [t.variableDeclarator(t.identifier(variableName), initializer)]);
}
setSourceMapRange(node, sourceMapRange) {
if (sourceMapRange === null) {
return node;
}
node.loc = {
filename: sourceMapRange.url !== this.sourceUrl ? sourceMapRange.url : void 0,
start: {
line: sourceMapRange.start.line + 1,
column: sourceMapRange.start.column
},
end: {
line: sourceMapRange.end.line + 1,
column: sourceMapRange.end.column
}
};
node.start = sourceMapRange.start.offset;
node.end = sourceMapRange.end.offset;
return node;
}
};
function isLExpression(expr) {
return t.isLVal(expr);
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/linker/babel/src/ast/babel_ast_host.mjs
import { types as t2 } from "@babel/core";
var BabelAstHost = class {
constructor() {
this.isStringLiteral = t2.isStringLiteral;
this.isNumericLiteral = t2.isNumericLiteral;
this.isArrayLiteral = t2.isArrayExpression;
this.isObjectLiteral = t2.isObjectExpression;
this.isCallExpression = t2.isCallExpression;
}
getSymbolName(node) {
if (t2.isIdentifier(node)) {
return node.name;
} else if (t2.isMemberExpression(node) && t2.isIdentifier(node.property)) {
return node.property.name;
} else {
return null;
}
}
parseStringLiteral(str) {
assert(str, t2.isStringLiteral, "a string literal");
return str.value;
}
parseNumericLiteral(num) {
assert(num, t2.isNumericLiteral, "a numeric literal");
return num.value;
}
isBooleanLiteral(bool) {
return t2.isBooleanLiteral(bool) || isMinifiedBooleanLiteral(bool);
}
parseBooleanLiteral(bool) {
if (t2.isBooleanLiteral(bool)) {
return bool.value;
} else if (isMinifiedBooleanLiteral(bool)) {
return !bool.argument.value;
} else {
throw new FatalLinkerError(bool, "Unsupported syntax, expected a boolean literal.");
}
}
parseArrayLiteral(array) {
assert(array, t2.isArrayExpression, "an array literal");
return array.elements.map((element) => {
assert(element, isNotEmptyElement, "element in array not to be empty");
assert(element, isNotSpreadElement, "element in array not to use spread syntax");
return element;
});
}
parseObjectLiteral(obj) {
assert(obj, t2.isObjectExpression, "an object literal");
const result = /* @__PURE__ */ new Map();
for (const property of obj.properties) {
assert(property, t2.isObjectProperty, "a property assignment");
assert(property.value, t2.isExpression, "an expression");
assert(property.key, isObjectExpressionPropertyName, "a property name");
const key = t2.isIdentifier(property.key) ? property.key.name : property.key.value;
result.set(`${key}`, property.value);
}
return result;
}
isFunctionExpression(node) {
return t2.isFunction(node);
}
parseReturnValue(fn) {
assert(fn, this.isFunctionExpression, "a function");
if (!t2.isBlockStatement(fn.body)) {
return fn.body;
}
if (fn.body.body.length !== 1) {
throw new FatalLinkerError(fn.body, "Unsupported syntax, expected a function body with a single return statement.");
}
const stmt = fn.body.body[0];
assert(stmt, t2.isReturnStatement, "a function body with a single return statement");
if (stmt.argument === null || stmt.argument === void 0) {
throw new FatalLinkerError(stmt, "Unsupported syntax, expected function to return a value.");
}
return stmt.argument;
}
parseCallee(call) {
assert(call, t2.isCallExpression, "a call expression");
assert(call.callee, t2.isExpression, "an expression");
return call.callee;
}
parseArguments(call) {
assert(call, t2.isCallExpression, "a call expression");
return call.arguments.map((arg) => {
assert(arg, isNotSpreadArgument, "argument not to use spread syntax");
assert(arg, t2.isExpression, "argument to be an expression");
return arg;
});
}
getRange(node) {
if (node.loc == null || node.start == null || node.end == null) {
throw new FatalLinkerError(node, "Unable to read range for node - it is missing location information.");
}
return {
startLine: node.loc.start.line - 1,
startCol: node.loc.start.column,
startPos: node.start,
endPos: node.end
};
}
};
function isNotEmptyElement(e) {
return e !== null;
}
function isNotSpreadElement(e) {
return !t2.isSpreadElement(e);
}
function isObjectExpressionPropertyName(n) {
return t2.isIdentifier(n) || t2.isStringLiteral(n) || t2.isNumericLiteral(n);
}
function isNotSpreadArgument(arg) {
return !t2.isSpreadElement(arg);
}
function isMinifiedBooleanLiteral(node) {
return t2.isUnaryExpression(node) && node.prefix && node.operator === "!" && t2.isNumericLiteral(node.argument) && (node.argument.value === 0 || node.argument.value === 1);
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/linker/babel/src/babel_declaration_scope.mjs
import { types as t3 } from "@babel/core";
var BabelDeclarationScope = class {
constructor(declarationScope) {
this.declarationScope = declarationScope;
}
getConstantScopeRef(expression) {
let bindingExpression = expression;
while (t3.isMemberExpression(bindingExpression)) {
bindingExpression = bindingExpression.object;
}
if (!t3.isIdentifier(bindingExpression)) {
return null;
}
const binding = this.declarationScope.getBinding(bindingExpression.name);
if (binding === void 0) {
return null;
}
const path = binding.scope.path;
if (!path.isFunctionDeclaration() && !path.isFunctionExpression() && !(path.isProgram() && path.node.sourceType === "module")) {
return null;
}
return path;
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/linker/babel/src/es2015_linker_plugin.mjs
function createEs2015LinkerPlugin({ fileSystem, logger, ...options }) {
let fileLinker = null;
return {
visitor: {
Program: {
enter(path) {
var _a, _b;
assertNull(fileLinker);
const file = path.hub.file;
const filename = (_a = file.opts.filename) != null ? _a : file.opts.filenameRelative;
if (!filename) {
throw new Error("No filename (nor filenameRelative) provided by Babel. This is required for the linking of partially compiled directives and components.");
}
const sourceUrl = fileSystem.resolve((_b = file.opts.cwd) != null ? _b : ".", filename);
const linkerEnvironment = LinkerEnvironment.create(fileSystem, logger, new BabelAstHost(), new BabelAstFactory(sourceUrl), options);
fileLinker = new FileLinker(linkerEnvironment, sourceUrl, file.code);
},
exit() {
assertNotNull(fileLinker);
for (const { constantScope, statements } of fileLinker.getConstantStatements()) {
insertStatements(constantScope, statements);
}
fileLinker = null;
}
},
CallExpression(call) {
if (fileLinker === null) {
return;
}
try {
const calleeName = getCalleeName(call);
if (calleeName === null) {
return;
}
const args = call.node.arguments;
if (!fileLinker.isPartialDeclaration(calleeName) || !isExpressionArray(args)) {
return;
}
const declarationScope = new BabelDeclarationScope(call.scope);
const replacement = fileLinker.linkPartialDeclaration(calleeName, args, declarationScope);
call.replaceWith(replacement);
} catch (e) {
const node = isFatalLinkerError(e) ? e.node : call.node;
throw buildCodeFrameError(call.hub.file, e.message, node);
}
}
}
};
}
function insertStatements(path, statements) {
if (path.isProgram()) {
insertIntoProgram(path, statements);
} else {
insertIntoFunction(path, statements);
}
}
function insertIntoFunction(fn, statements) {
const body = fn.get("body");
body.unshiftContainer("body", statements);
}
function insertIntoProgram(program, statements) {
const body = program.get("body");
const importStatements = body.filter((statement) => statement.isImportDeclaration());
if (importStatements.length === 0) {
program.unshiftContainer("body", statements);
} else {
importStatements[importStatements.length - 1].insertAfter(statements);
}
}
function getCalleeName(call) {
const callee = call.node.callee;
if (t4.isIdentifier(callee)) {
return callee.name;
} else if (t4.isMemberExpression(callee) && t4.isIdentifier(callee.property)) {
return callee.property.name;
} else if (t4.isMemberExpression(callee) && t4.isStringLiteral(callee.property)) {
return callee.property.value;
} else {
return null;
}
}
function isExpressionArray(nodes) {
return nodes.every((node) => t4.isExpression(node));
}
function assertNull(obj) {
if (obj !== null) {
throw new Error("BUG - expected `obj` to be null");
}
}
function assertNotNull(obj) {
if (obj === null) {
throw new Error("BUG - expected `obj` not to be null");
}
}
function buildCodeFrameError(file, message, node) {
const filename = file.opts.filename || "(unknown file)";
const error = file.buildCodeFrameError(node, message);
return `${filename}: ${error.message}`;
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/linker/babel/src/babel_plugin.mjs
function defaultLinkerPlugin(api, options) {
api.assertVersion(7);
return createEs2015LinkerPlugin({
...options,
fileSystem: new NodeJSFileSystem(),
logger: new ConsoleLogger(LogLevel.info)
});
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/linker/babel/index.mjs
var babel_default = defaultLinkerPlugin;
export {
createEs2015LinkerPlugin,
babel_default as default
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

28
node_modules/@angular/compiler-cli/bundles/linker/index.js generated vendored Executable file
View File

@@ -0,0 +1,28 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
DEFAULT_LINKER_OPTIONS,
FatalLinkerError,
FileLinker,
LinkerEnvironment,
assert,
isFatalLinkerError,
needsLinking
} from "../chunk-GT7FGHLZ.js";
import "../chunk-O55FKOOW.js";
import "../chunk-G64XB6AU.js";
import "../chunk-GYHDNUIK.js";
import "../chunk-CSOLWS7O.js";
import "../chunk-XI2RTGAL.js";
export {
DEFAULT_LINKER_OPTIONS,
FatalLinkerError,
FileLinker,
LinkerEnvironment,
assert,
isFatalLinkerError,
needsLinking
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": [],
"mappings": "",
"names": []
}

52
node_modules/@angular/compiler-cli/bundles/ngcc/index.js generated vendored Executable file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env node
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/ngcc/index.mjs
function stringEncaseCRLFWithFirstIndex(value, prefix, postfix, index) {
let endIndex = 0;
let returnValue = "";
do {
const gotCR = value[index - 1] === "\r";
returnValue += value.substring(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
endIndex = index + 1;
index = value.indexOf("\n", endIndex);
} while (index !== -1);
returnValue += value.substring(endIndex);
return returnValue;
}
function styleMessage(message) {
const open = "\x1B[31m\x1B[1m";
const close = "\x1B[22m\x1B[39m";
let styledMessage = message;
const lfIndex = styledMessage.indexOf("\n");
if (lfIndex !== -1) {
styledMessage = stringEncaseCRLFWithFirstIndex(styledMessage, close, open, lfIndex);
}
return open + styledMessage + close;
}
var warningMsg = `
==========================================
ALERT: As of Angular 16, "ngcc" is no longer required and not invoked during CLI builds. You are seeing this message because the current operation invoked the "ngcc" command directly. This "ngcc" invocation can be safely removed.
A common reason for this is invoking "ngcc" from a "postinstall" hook in package.json.
In Angular 17, this command will be removed. Remove this and any other invocations to prevent errors in later versions.
==========================================
`;
console.warn(styleMessage(warningMsg));
process.exit(0);
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": ["../../../../../../../packages/compiler-cli/ngcc/index.ts"],
"mappings": ";;;;;;;AAUA,SAAS,+BACL,OAAe,QAAgB,SAAiB,OAAa;AAC/D,MAAI,WAAW;AACf,MAAI,cAAc;AAElB,KAAG;AACD,UAAM,QAAQ,MAAM,QAAQ,OAAO;AACnC,mBAAe,MAAM,UAAU,UAAU,QAAQ,QAAQ,IAAI,KAAK,IAAI,UACjE,QAAQ,SAAS,QAAQ;AAC9B,eAAW,QAAQ;AACnB,YAAQ,MAAM,QAAQ,MAAM,QAAQ;WAC7B,UAAU;AAEnB,iBAAe,MAAM,UAAU,QAAQ;AACvC,SAAO;AACT;AAIA,SAAS,aAAa,SAAe;AAEnC,QAAM,OAAO;AACb,QAAM,QAAQ;AAEd,MAAI,gBAAgB;AACpB,QAAM,UAAU,cAAc,QAAQ,IAAI;AAC1C,MAAI,YAAY,IAAI;AAClB,oBAAgB,+BAA+B,eAAe,OAAO,MAAM,OAAO;;AAGpF,SAAO,OAAO,gBAAgB;AAChC;AAEA,IAAM,aAAa;;;;;;;;;;;;;AAcnB,QAAQ,KAAK,aAAa,UAAU,CAAC;AACrC,QAAQ,KAAK,CAAC;",
"names": []
}

19
node_modules/@angular/compiler-cli/bundles/private/bazel.js generated vendored Executable file
View File

@@ -0,0 +1,19 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
PerfPhase
} from "../chunk-3IBJEGH3.js";
import "../chunk-XI2RTGAL.js";
export {
PerfPhase
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=bazel.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": [],
"mappings": "",
"names": []
}

View File

@@ -0,0 +1,67 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
ConsoleLogger,
LogLevel
} from "../chunk-SBDNBITT.js";
import {
SourceFile,
SourceFileLoader
} from "../chunk-GYHDNUIK.js";
import {
LogicalFileSystem,
LogicalProjectPath,
NgtscCompilerHost,
NodeJSFileSystem,
absoluteFrom,
absoluteFromSourceFile,
basename,
dirname,
getFileSystem,
getSourceFileOrError,
isLocalRelativePath,
isRoot,
isRooted,
join,
relative,
relativeFrom,
resolve,
setFileSystem,
toRelativeImport
} from "../chunk-CSOLWS7O.js";
import "../chunk-XI2RTGAL.js";
export {
ConsoleLogger,
LogLevel,
LogicalFileSystem,
LogicalProjectPath,
NgtscCompilerHost,
NodeJSFileSystem,
SourceFile,
SourceFileLoader,
absoluteFrom,
absoluteFromSourceFile,
basename,
dirname,
getFileSystem,
getSourceFileOrError,
isLocalRelativePath,
isRoot,
isRooted,
join,
relative,
relativeFrom,
resolve,
setFileSystem,
toRelativeImport
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=localize.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": [],
"mappings": "",
"names": []
}

View File

@@ -0,0 +1,40 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
DynamicValue,
PartialEvaluator,
PotentialImportKind,
PotentialImportMode,
StaticInterpreter,
forwardRefResolver
} from "../chunk-B5URQIVL.js";
import "../chunk-O55FKOOW.js";
import {
Reference,
TypeScriptReflectionHost,
reflectObjectLiteral
} from "../chunk-G64XB6AU.js";
import "../chunk-3IBJEGH3.js";
import "../chunk-CSOLWS7O.js";
import "../chunk-XI2RTGAL.js";
export {
DynamicValue,
PartialEvaluator,
PotentialImportKind,
PotentialImportMode,
Reference,
StaticInterpreter,
TypeScriptReflectionHost,
forwardRefResolver,
reflectObjectLiteral
};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=migrations.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": [],
"mappings": "",
"names": []
}

View File

@@ -0,0 +1,18 @@
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
GLOBAL_DEFS_FOR_TERSER,
GLOBAL_DEFS_FOR_TERSER_WITH_AOT,
constructorParametersDownlevelTransform
} from "../chunk-XXICUNOF.js";
import "../chunk-G64XB6AU.js";
import "../chunk-CSOLWS7O.js";
import "../chunk-XI2RTGAL.js";
export {
GLOBAL_DEFS_FOR_TERSER,
GLOBAL_DEFS_FOR_TERSER_WITH_AOT,
constructorParametersDownlevelTransform
};
//# sourceMappingURL=tooling.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": [],
"mappings": "",
"names": []
}

View File

@@ -0,0 +1,61 @@
#!/usr/bin/env node
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
main,
readCommandLineAndConfiguration
} from "../../chunk-T6CN22EQ.js";
import {
EmitFlags
} from "../../chunk-KDLK7PF4.js";
import "../../chunk-B5URQIVL.js";
import "../../chunk-O55FKOOW.js";
import "../../chunk-G64XB6AU.js";
import "../../chunk-3IBJEGH3.js";
import {
NodeJSFileSystem,
setFileSystem
} from "../../chunk-CSOLWS7O.js";
import "../../chunk-XI2RTGAL.js";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/bin/ng_xi18n.mjs
import "reflect-metadata";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/extract_i18n.mjs
import yargs from "yargs";
function mainXi18n(args2, consoleError = console.error) {
const config = readXi18nCommandLineAndConfiguration(args2);
return main(args2, consoleError, config, void 0, void 0, void 0);
}
function readXi18nCommandLineAndConfiguration(args2) {
const options = {};
const parsedArgs = yargs(args2).option("i18nFormat", { type: "string" }).option("locale", { type: "string" }).option("outFile", { type: "string" }).parseSync();
if (parsedArgs.outFile)
options.i18nOutFile = parsedArgs.outFile;
if (parsedArgs.i18nFormat)
options.i18nOutFormat = parsedArgs.i18nFormat;
if (parsedArgs.locale)
options.i18nOutLocale = parsedArgs.locale;
const config = readCommandLineAndConfiguration(args2, options, [
"outFile",
"i18nFormat",
"locale"
]);
return { ...config, emitFlags: EmitFlags.I18nBundle };
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/bin/ng_xi18n.mjs
process.title = "Angular i18n Message Extractor (ng-xi18n)";
var args = process.argv.slice(2);
setFileSystem(new NodeJSFileSystem());
process.exitCode = mainXi18n(args);
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=ng_xi18n.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": ["../../../../../../../../packages/compiler-cli/src/bin/ng_xi18n.ts", "../../../../../../../../packages/compiler-cli/src/extract_i18n.ts"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAUA,OAAO;;;ACEP,OAAO,WAAW;AAMZ,SAAU,UACZA,OAAgB,eAAsC,QAAQ,OAAK;AACrE,QAAM,SAAS,qCAAqCA,KAAI;AACxD,SAAO,KAAKA,OAAM,cAAc,QAAQ,QAAW,QAAW,MAAS;AACzE;AAEA,SAAS,qCAAqCA,OAAc;AAC1D,QAAM,UAA+B,CAAA;AACrC,QAAM,aAAa,MAAMA,KAAI,EACL,OAAO,cAAc,EAAC,MAAM,SAAQ,CAAC,EACrC,OAAO,UAAU,EAAC,MAAM,SAAQ,CAAC,EACjC,OAAO,WAAW,EAAC,MAAM,SAAQ,CAAC,EAClC,UAAS;AAEjC,MAAI,WAAW;AAAS,YAAQ,cAAc,WAAW;AACzD,MAAI,WAAW;AAAY,YAAQ,gBAAgB,WAAW;AAC9D,MAAI,WAAW;AAAQ,YAAQ,gBAAgB,WAAW;AAE1D,QAAM,SAAS,gCAAgCA,OAAM,SAAS;IAC5D;IACA;IACA;GACD;AAED,SAAO,EAAC,GAAG,QAAQ,WAAe,UAAU,WAAU;AACxD;;;AD5BA,QAAQ,QAAQ;AAChB,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,cAAc,IAAI,iBAAgB,CAAE;AACpC,QAAQ,WAAW,UAAU,IAAI;",
"names": ["args"]
}

39
node_modules/@angular/compiler-cli/bundles/src/bin/ngc.js generated vendored Executable file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env node
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
import {
main
} from "../../chunk-T6CN22EQ.js";
import "../../chunk-KDLK7PF4.js";
import "../../chunk-B5URQIVL.js";
import "../../chunk-O55FKOOW.js";
import "../../chunk-G64XB6AU.js";
import "../../chunk-3IBJEGH3.js";
import {
NodeJSFileSystem,
setFileSystem
} from "../../chunk-CSOLWS7O.js";
import "../../chunk-XI2RTGAL.js";
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/bin/ngc.mjs
import "reflect-metadata";
async function runNgcComamnd() {
process.title = "Angular Compiler (ngc)";
const args = process.argv.slice(2);
setFileSystem(new NodeJSFileSystem());
process.exitCode = main(args, void 0, void 0, void 0, void 0, void 0);
}
runNgcComamnd().catch((e) => {
console.error(e);
process.exitCode = 1;
});
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
//# sourceMappingURL=ngc.js.map

View File

@@ -0,0 +1,6 @@
{
"version": 3,
"sources": ["../../../../../../../../packages/compiler-cli/src/bin/ngc.ts"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAUA,OAAO;AAKP,eAAe,gBAAa;AAC1B,UAAQ,QAAQ;AAChB,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,gBAAc,IAAI,iBAAgB,CAAE;AAEpC,UAAQ,WAAW,KAAK,MAAM,QAAW,QAAW,QAAW,QAAW,MAAS;AACrF;AAEA,cAAa,EAAG,MAAM,OAAI;AACxB,UAAQ,MAAM,CAAC;AACf,UAAQ,WAAW;AACrB,CAAC;",
"names": []
}

1
node_modules/@angular/compiler-cli/bundles_metadata.json generated vendored Executable file

File diff suppressed because one or more lines are too long

14
node_modules/@angular/compiler-cli/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,14 @@
export { VERSION } from './src/version';
export * from './src/transformers/api';
export * from './src/transformers/entry_points';
export * from './src/perform_compile';
export { CompilerOptions as AngularCompilerOptions } from './src/transformers/api';
export * from './private/tooling';
export * from './src/ngtsc/logging';
export * from './src/ngtsc/file_system';
export { NgTscPlugin, PluginCompilerHost } from './src/ngtsc/tsc_plugin';
export { NgtscProgram } from './src/ngtsc/program';
export { OptimizeFor } from './src/ngtsc/typecheck/api';
export { ConsoleLogger, Logger, LogLevel } from './src/ngtsc/logging';
export { NodeJSFileSystem } from './src/ngtsc/file_system';
export * from './src/ngtsc/docs/src/entities';

10
node_modules/@angular/compiler-cli/linker/babel/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,10 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { defaultLinkerPlugin } from './src/babel_plugin';
export { createEs2015LinkerPlugin } from './src/es2015_linker_plugin';
export default defaultLinkerPlugin;

View File

@@ -0,0 +1,46 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { types as t } from '@babel/core';
import { AstFactory, BinaryOperator, LeadingComment, ObjectLiteralProperty, SourceMapRange, TemplateLiteral, VariableDeclarationType } from '../../../../src/ngtsc/translator';
/**
* A Babel flavored implementation of the AstFactory.
*/
export declare class BabelAstFactory implements AstFactory<t.Statement, t.Expression> {
/** The absolute path to the source file being compiled. */
private sourceUrl;
constructor(
/** The absolute path to the source file being compiled. */
sourceUrl: string);
attachComments(statement: t.Statement, leadingComments: LeadingComment[]): void;
createArrayLiteral: typeof t.arrayExpression;
createAssignment(target: t.Expression, value: t.Expression): t.Expression;
createBinaryExpression(leftOperand: t.Expression, operator: BinaryOperator, rightOperand: t.Expression): t.Expression;
createBlock: typeof t.blockStatement;
createCallExpression(callee: t.Expression, args: t.Expression[], pure: boolean): t.Expression;
createConditional: typeof t.conditionalExpression;
createElementAccess(expression: t.Expression, element: t.Expression): t.Expression;
createExpressionStatement: typeof t.expressionStatement;
createFunctionDeclaration(functionName: string, parameters: string[], body: t.Statement): t.Statement;
createArrowFunctionExpression(parameters: string[], body: t.Statement | t.Expression): t.Expression;
createFunctionExpression(functionName: string | null, parameters: string[], body: t.Statement): t.Expression;
createIdentifier: typeof t.identifier;
createIfStatement: typeof t.ifStatement;
createDynamicImport(url: string): t.Expression;
createLiteral(value: string | number | boolean | null | undefined): t.Expression;
createNewExpression: typeof t.newExpression;
createObjectLiteral(properties: ObjectLiteralProperty<t.Expression>[]): t.Expression;
createParenthesizedExpression: typeof t.parenthesizedExpression;
createPropertyAccess(expression: t.Expression, propertyName: string): t.Expression;
createReturnStatement: typeof t.returnStatement;
createTaggedTemplate(tag: t.Expression, template: TemplateLiteral<t.Expression>): t.Expression;
createThrowStatement: typeof t.throwStatement;
createTypeOfExpression(expression: t.Expression): t.Expression;
createUnaryExpression: typeof t.unaryExpression;
createVariableDeclaration(variableName: string, initializer: t.Expression | null, type: VariableDeclarationType): t.Statement;
setSourceMapRange<T extends t.Statement | t.Expression | t.TemplateElement>(node: T, sourceMapRange: SourceMapRange | null): T;
}

View File

@@ -0,0 +1,31 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { types as t } from '@babel/core';
import { AstHost, Range } from '../../../../linker';
/**
* This implementation of `AstHost` is able to get information from Babel AST nodes.
*/
export declare class BabelAstHost implements AstHost<t.Expression> {
getSymbolName(node: t.Expression): string | null;
isStringLiteral: typeof t.isStringLiteral;
parseStringLiteral(str: t.Expression): string;
isNumericLiteral: typeof t.isNumericLiteral;
parseNumericLiteral(num: t.Expression): number;
isBooleanLiteral(bool: t.Expression): boolean;
parseBooleanLiteral(bool: t.Expression): boolean;
isArrayLiteral: typeof t.isArrayExpression;
parseArrayLiteral(array: t.Expression): t.Expression[];
isObjectLiteral: typeof t.isObjectExpression;
parseObjectLiteral(obj: t.Expression): Map<string, t.Expression>;
isFunctionExpression(node: t.Expression): node is Extract<t.Function, t.Expression>;
parseReturnValue(fn: t.Expression): t.Expression;
isCallExpression: typeof t.isCallExpression;
parseCallee(call: t.Expression): t.Expression;
parseArguments(call: t.Expression): t.Expression[];
getRange(node: t.Expression): Range;
}

View File

@@ -0,0 +1,37 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { types as t } from '@babel/core';
import { NodePath, Scope } from '@babel/traverse';
import { DeclarationScope } from '../../../linker';
export type ConstantScopePath = NodePath<t.FunctionDeclaration> | NodePath<t.FunctionExpression> | NodePath<t.Program>;
/**
* This class represents the lexical scope of a partial declaration in Babel source code.
*
* Its only responsibility is to compute a reference object for the scope of shared constant
* statements that will be generated during partial linking.
*/
export declare class BabelDeclarationScope implements DeclarationScope<ConstantScopePath, t.Expression> {
private declarationScope;
/**
* Construct a new `BabelDeclarationScope`.
*
* @param declarationScope the Babel scope containing the declaration call expression.
*/
constructor(declarationScope: Scope);
/**
* Compute the Babel `NodePath` that can be used to reference the lexical scope where any
* shared constant statements would be inserted.
*
* There will only be a shared constant scope if the expression is in an ECMAScript module, or a
* UMD module. Otherwise `null` is returned to indicate that constant statements must be emitted
* locally to the generated linked definition, to avoid polluting the global scope.
*
* @param expression the expression that points to the Angular core framework import.
*/
getConstantScopeRef(expression: t.Expression): ConstantScopePath | null;
}

View File

@@ -0,0 +1,25 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConfigAPI, PluginObj } from '@babel/core';
import { LinkerOptions } from '../../src/file_linker/linker_options';
/**
* This is the Babel plugin definition that is provided as a default export from the package, such
* that the plugin can be used using the module specifier of the package. This is the recommended
* way of integrating the Angular Linker into a build pipeline other than the Angular CLI.
*
* When the module specifier `@angular/compiler-cli/linker/babel` is used as a plugin in a Babel
* configuration, Babel invokes this function (by means of the default export) to create the plugin
* instance according to the provided options.
*
* The linker plugin that is created uses the native NodeJS filesystem APIs to interact with the
* filesystem. Any logging output is printed to the console.
*
* @param api Provides access to the Babel environment that is configuring this plugin.
* @param options The plugin options that have been configured.
*/
export declare function defaultLinkerPlugin(api: ConfigAPI, options: Partial<LinkerOptions>): PluginObj;

View File

@@ -0,0 +1,16 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { PluginObj } from '@babel/core';
import { LinkerPluginOptions } from './linker_plugin_options';
/**
* Create a Babel plugin that visits the program, identifying and linking partial declarations.
*
* The plugin delegates most of its work to a generic `FileLinker` for each file (`t.Program` in
* Babel) that is visited.
*/
export declare function createEs2015LinkerPlugin({ fileSystem, logger, ...options }: LinkerPluginOptions): PluginObj;

View File

@@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { LinkerOptions } from '../..';
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
import { Logger } from '../../../src/ngtsc/logging';
export interface LinkerPluginOptions extends Partial<LinkerOptions> {
/**
* File-system, used to load up the input source-map and content.
*/
fileSystem: ReadonlyFileSystem;
/**
* Logger used by the linker.
*/
logger: Logger;
}

15
node_modules/@angular/compiler-cli/linker/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,15 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export { AstHost, Range } from './src/ast/ast_host';
export { assert } from './src/ast/utils';
export { FatalLinkerError, isFatalLinkerError } from './src/fatal_linker_error';
export { DeclarationScope } from './src/file_linker/declaration_scope';
export { FileLinker } from './src/file_linker/file_linker';
export { LinkerEnvironment } from './src/file_linker/linker_environment';
export { DEFAULT_LINKER_OPTIONS, LinkerOptions } from './src/file_linker/linker_options';
export { needsLinking } from './src/file_linker/needs_linking';

View File

@@ -0,0 +1,106 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* An abstraction for getting information from an AST while being agnostic to the underlying AST
* implementation.
*/
export interface AstHost<TExpression> {
/**
* Get the name of the symbol represented by the given expression node, or `null` if it is not a
* symbol.
*/
getSymbolName(node: TExpression): string | null;
/**
* Return `true` if the given expression is a string literal, or false otherwise.
*/
isStringLiteral(node: TExpression): boolean;
/**
* Parse the string value from the given expression, or throw if it is not a string literal.
*/
parseStringLiteral(str: TExpression): string;
/**
* Return `true` if the given expression is a numeric literal, or false otherwise.
*/
isNumericLiteral(node: TExpression): boolean;
/**
* Parse the numeric value from the given expression, or throw if it is not a numeric literal.
*/
parseNumericLiteral(num: TExpression): number;
/**
* Return `true` if the given expression can be considered a boolean literal, or false otherwise.
*
* Note that this should also cover the special case of some minified code where `true` and
* `false` are replaced by `!0` and `!1` respectively.
*/
isBooleanLiteral(node: TExpression): boolean;
/**
* Parse the boolean value from the given expression, or throw if it is not a boolean literal.
*
* Note that this should also cover the special case of some minified code where `true` and
* `false` are replaced by `!0` and `!1` respectively.
*/
parseBooleanLiteral(bool: TExpression): boolean;
/**
* Return `true` if the given expression is an array literal, or false otherwise.
*/
isArrayLiteral(node: TExpression): boolean;
/**
* Parse an array of expressions from the given expression, or throw if it is not an array
* literal.
*/
parseArrayLiteral(array: TExpression): TExpression[];
/**
* Return `true` if the given expression is an object literal, or false otherwise.
*/
isObjectLiteral(node: TExpression): boolean;
/**
* Parse the given expression into a map of object property names to property expressions, or
* throw if it is not an object literal.
*/
parseObjectLiteral(obj: TExpression): Map<string, TExpression>;
/**
* Return `true` if the given expression is a function, or false otherwise.
*/
isFunctionExpression(node: TExpression): boolean;
/**
* Compute the "value" of a function expression by parsing its body for a single `return`
* statement, extracting the returned expression, or throw if it is not possible.
*/
parseReturnValue(fn: TExpression): TExpression;
/**
* Return true if the given expression is a call expression, or false otherwise.
*/
isCallExpression(node: TExpression): boolean;
/**
* Returns the expression that is called in the provided call expression, or throw if it is not
* a call expression.
*/
parseCallee(call: TExpression): TExpression;
/**
* Returns the argument expressions for the provided call expression, or throw if it is not
* a call expression.
*/
parseArguments(call: TExpression): TExpression[];
/**
* Compute the location range of the expression in the source file, to be used for source-mapping.
*/
getRange(node: TExpression): Range;
}
/**
* The location of the start and end of an expression in the original source file.
*/
export interface Range {
/** 0-based character position of the range start in the source file text. */
startPos: number;
/** 0-based line index of the range start in the source file text. */
startLine: number;
/** 0-based column position of the range start in the source file text. */
startCol: number;
/** 0-based character position of the range end in the source file text. */
endPos: number;
}

View File

@@ -0,0 +1,196 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as o from '@angular/compiler';
import { AstHost, Range } from './ast_host';
/**
* Represents only those types in `T` that are object types.
*/
type ObjectType<T> = Extract<T, object>;
/**
* Represents the value type of an object literal.
*/
type ObjectValueType<T> = T extends Record<string, infer R> ? R : never;
/**
* Represents the value type of an array literal.
*/
type ArrayValueType<T> = T extends Array<infer R> ? R : never;
/**
* Ensures that `This` has its generic type `Actual` conform to the expected generic type in
* `Expected`, to disallow calling a method if the generic type does not conform.
*/
type ConformsTo<This, Actual, Expected> = Actual extends Expected ? This : never;
/**
* Represents only the string keys of type `T`.
*/
type PropertyKey<T> = keyof T & string;
/**
* This helper class wraps an object expression along with an `AstHost` object, exposing helper
* methods that make it easier to extract the properties of the object.
*
* The generic `T` is used as reference type of the expected structure that is represented by this
* object. It does not achieve full type-safety for the provided operations in correspondence with
* `T`; its main goal is to provide references to a documented type and ensure that the properties
* that are read from the object are present.
*
* Unfortunately, the generic types are unable to prevent reading an optional property from the
* object without first having called `has` to ensure that the property exists. This is one example
* of where full type-safety is not achieved.
*/
export declare class AstObject<T extends object, TExpression> {
readonly expression: TExpression;
private obj;
private host;
/**
* Create a new `AstObject` from the given `expression` and `host`.
*/
static parse<T extends object, TExpression>(expression: TExpression, host: AstHost<TExpression>): AstObject<T, TExpression>;
private constructor();
/**
* Returns true if the object has a property called `propertyName`.
*/
has(propertyName: PropertyKey<T>): boolean;
/**
* Returns the number value of the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not a number.
*/
getNumber<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], number>, propertyName: K): number;
/**
* Returns the string value of the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not a string.
*/
getString<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], string>, propertyName: K): string;
/**
* Returns the boolean value of the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not a boolean.
*/
getBoolean<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], boolean>, propertyName: K): boolean;
/**
* Returns the nested `AstObject` parsed from the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not an object.
*/
getObject<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], object>, propertyName: K): AstObject<ObjectType<T[K]>, TExpression>;
/**
* Returns an array of `AstValue` objects parsed from the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not an array.
*/
getArray<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], unknown[]>, propertyName: K): AstValue<ArrayValueType<T[K]>, TExpression>[];
/**
* Returns a `WrappedNodeExpr` object that wraps the expression at the property called
* `propertyName`.
*
* Throws an error if there is no such property.
*/
getOpaque(propertyName: PropertyKey<T>): o.WrappedNodeExpr<TExpression>;
/**
* Returns the raw `TExpression` value of the property called `propertyName`.
*
* Throws an error if there is no such property.
*/
getNode(propertyName: PropertyKey<T>): TExpression;
/**
* Returns an `AstValue` that wraps the value of the property called `propertyName`.
*
* Throws an error if there is no such property.
*/
getValue<K extends PropertyKey<T>>(propertyName: K): AstValue<T[K], TExpression>;
/**
* Converts the AstObject to a raw JavaScript object, mapping each property value (as an
* `AstValue`) to the generic type (`T`) via the `mapper` function.
*/
toLiteral<V>(mapper: (value: AstValue<ObjectValueType<T>, TExpression>, key: string) => V): Record<string, V>;
/**
* Converts the AstObject to a JavaScript Map, mapping each property value (as an
* `AstValue`) to the generic type (`T`) via the `mapper` function.
*/
toMap<V>(mapper: (value: AstValue<ObjectValueType<T>, TExpression>) => V): Map<string, V>;
private getRequiredProperty;
}
/**
* This helper class wraps an `expression`, exposing methods that use the `host` to give
* access to the underlying value of the wrapped expression.
*
* The generic `T` is used as reference type of the expected type that is represented by this value.
* It does not achieve full type-safety for the provided operations in correspondence with `T`; its
* main goal is to provide references to a documented type.
*/
export declare class AstValue<T, TExpression> {
readonly expression: TExpression;
private host;
constructor(expression: TExpression, host: AstHost<TExpression>);
/**
* Get the name of the symbol represented by the given expression node, or `null` if it is not a
* symbol.
*/
getSymbolName(): string | null;
/**
* Is this value a number?
*/
isNumber(): boolean;
/**
* Parse the number from this value, or error if it is not a number.
*/
getNumber(this: ConformsTo<this, T, number>): number;
/**
* Is this value a string?
*/
isString(): boolean;
/**
* Parse the string from this value, or error if it is not a string.
*/
getString(this: ConformsTo<this, T, string>): string;
/**
* Is this value a boolean?
*/
isBoolean(): boolean;
/**
* Parse the boolean from this value, or error if it is not a boolean.
*/
getBoolean(this: ConformsTo<this, T, boolean>): boolean;
/**
* Is this value an object literal?
*/
isObject(): boolean;
/**
* Parse this value into an `AstObject`, or error if it is not an object literal.
*/
getObject(this: ConformsTo<this, T, object>): AstObject<ObjectType<T>, TExpression>;
/**
* Is this value an array literal?
*/
isArray(): boolean;
/**
* Parse this value into an array of `AstValue` objects, or error if it is not an array literal.
*/
getArray(this: ConformsTo<this, T, unknown[]>): AstValue<ArrayValueType<T>, TExpression>[];
/**
* Is this value a function expression?
*/
isFunction(): boolean;
/**
* Extract the return value as an `AstValue` from this value as a function expression, or error if
* it is not a function expression.
*/
getFunctionReturnValue<R>(this: ConformsTo<this, T, Function>): AstValue<R, TExpression>;
isCallExpression(): boolean;
getCallee(): AstValue<unknown, TExpression>;
getArguments(): AstValue<unknown, TExpression>[];
/**
* Return the `TExpression` of this value wrapped in a `WrappedNodeExpr`.
*/
getOpaque(): o.WrappedNodeExpr<TExpression>;
/**
* Get the range of the location of this value in the original source.
*/
getRange(): Range;
}
export {};

View File

@@ -0,0 +1,37 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import ts from 'typescript';
import { AstHost, Range } from '../ast_host';
/**
* This implementation of `AstHost` is able to get information from TypeScript AST nodes.
*
* This host is not actually used at runtime in the current code.
*
* It is implemented here to ensure that the `AstHost` abstraction is not unfairly skewed towards
* the Babel implementation. It could also provide a basis for a 3rd TypeScript compiler plugin to
* do linking in the future.
*/
export declare class TypeScriptAstHost implements AstHost<ts.Expression> {
getSymbolName(node: ts.Expression): string | null;
isStringLiteral: typeof ts.isStringLiteral;
parseStringLiteral(str: ts.Expression): string;
isNumericLiteral: typeof ts.isNumericLiteral;
parseNumericLiteral(num: ts.Expression): number;
isBooleanLiteral(node: ts.Expression): boolean;
parseBooleanLiteral(bool: ts.Expression): boolean;
isArrayLiteral: typeof ts.isArrayLiteralExpression;
parseArrayLiteral(array: ts.Expression): ts.Expression[];
isObjectLiteral: typeof ts.isObjectLiteralExpression;
parseObjectLiteral(obj: ts.Expression): Map<string, ts.Expression>;
isFunctionExpression(node: ts.Expression): node is ts.FunctionExpression | ts.ArrowFunction;
parseReturnValue(fn: ts.Expression): ts.Expression;
isCallExpression: typeof ts.isCallExpression;
parseCallee(call: ts.Expression): ts.Expression;
parseArguments(call: ts.Expression): ts.Expression[];
getRange(node: ts.Expression): Range;
}

View File

@@ -0,0 +1,4 @@
/**
* Assert that the given `node` is of the type guarded by the `predicate` function.
*/
export declare function assert<T, K extends T>(node: T, predicate: (node: T) => node is K, expected: string): asserts node is K;

View File

@@ -0,0 +1,25 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* An unrecoverable error during linking.
*/
export declare class FatalLinkerError extends Error {
node: unknown;
readonly type = "FatalLinkerError";
/**
* Create a new FatalLinkerError.
*
* @param node The AST node where the error occurred.
* @param message A description of the error.
*/
constructor(node: unknown, message: string);
}
/**
* Whether the given object `e` is a FatalLinkerError.
*/
export declare function isFatalLinkerError(e: any): e is FatalLinkerError;

View File

@@ -0,0 +1,44 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* This interface represents the lexical scope of a partial declaration in the source code.
*
* For example, if you had the following code:
*
* ```
* function foo() {
* function bar () {
* ɵɵngDeclareDirective({...});
* }
* }
* ```
*
* The `DeclarationScope` of the `ɵɵngDeclareDirective()` call is the body of the `bar()` function.
*
* The `FileLinker` uses this object to identify the lexical scope of any constant statements that
* might be generated by the linking process (i.e. where the `ConstantPool` lives for a set of
* partial linkers).
*/
export interface DeclarationScope<TSharedConstantScope, TExpression> {
/**
* Get a `TSharedConstantScope` object that can be used to reference the lexical scope where any
* shared constant statements would be inserted.
*
* This object is generic because different AST implementations will need different
* `TConstantScope` types to be able to insert shared constant statements. For example in Babel
* this would be a `NodePath` object; in TS it would just be a `Node` object.
*
* If it is not possible to find such a shared scope, then constant statements will be wrapped up
* with their generated linked definition expression, in the form of an IIFE.
*
* @param expression the expression that points to the Angular core framework import.
* @returns a reference to a reference object for where the shared constant statements will be
* inserted, or `null` if it is not possible to have a shared scope.
*/
getConstantScopeRef(expression: TExpression): TSharedConstantScope | null;
}

View File

@@ -0,0 +1,38 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool } from '@angular/compiler';
import { AstFactory } from '../../../../src/ngtsc/translator';
import { LinkedDefinition } from '../partial_linkers/partial_linker';
import { Translator } from '../translator';
/**
* This class represents (from the point of view of the `FileLinker`) the scope in which
* statements and expressions related to a linked partial declaration will be emitted.
*
* It holds a copy of a `ConstantPool` that is used to capture any constant statements that need to
* be emitted in this context.
*
* This implementation will emit the definition and the constant statements separately.
*/
export declare class EmitScope<TStatement, TExpression> {
protected readonly ngImport: TExpression;
protected readonly translator: Translator<TStatement, TExpression>;
private readonly factory;
readonly constantPool: ConstantPool;
constructor(ngImport: TExpression, translator: Translator<TStatement, TExpression>, factory: AstFactory<TStatement, TExpression>);
/**
* Translate the given Output AST definition expression into a generic `TExpression`.
*
* Use a `LinkerImportGenerator` to handle any imports in the definition.
*/
translateDefinition(definition: LinkedDefinition): TExpression;
/**
* Return any constant statements that are shared between all uses of this `EmitScope`.
*/
getConstantStatements(): TStatement[];
private wrapInIifeWithStatements;
}

View File

@@ -0,0 +1,28 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { LinkedDefinition } from '../partial_linkers/partial_linker';
import { EmitScope } from './emit_scope';
/**
* This class is a specialization of the `EmitScope` class that is designed for the situation where
* there is no clear shared scope for constant statements. In this case they are bundled with the
* translated definition and will be emitted into an IIFE.
*/
export declare class LocalEmitScope<TStatement, TExpression> extends EmitScope<TStatement, TExpression> {
/**
* Translate the given Output AST definition expression into a generic `TExpression`.
*
* Merges the `ConstantPool` statements with the definition statements when generating the
* definition expression. This means that `ConstantPool` statements will be emitted into an IIFE.
*/
translateDefinition(definition: LinkedDefinition): TExpression;
/**
* It is not valid to call this method, since there will be no shared constant statements - they
* are already emitted in the IIFE alongside the translated definition.
*/
getConstantStatements(): TStatement[];
}

View File

@@ -0,0 +1,39 @@
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { DeclarationScope } from './declaration_scope';
import { LinkerEnvironment } from './linker_environment';
export declare const NO_STATEMENTS: Readonly<any[]>;
/**
* This class is responsible for linking all the partial declarations found in a single file.
*/
export declare class FileLinker<TConstantScope, TStatement, TExpression> {
private linkerEnvironment;
private linkerSelector;
private emitScopes;
constructor(linkerEnvironment: LinkerEnvironment<TStatement, TExpression>, sourceUrl: AbsoluteFsPath, code: string);
/**
* Return true if the given callee name matches a partial declaration that can be linked.
*/
isPartialDeclaration(calleeName: string): boolean;
/**
* Link the metadata extracted from the args of a call to a partial declaration function.
*
* The `declarationScope` is used to determine the scope and strategy of emission of the linked
* definition and any shared constant statements.
*
* @param declarationFn the name of the function used to declare the partial declaration - e.g.
* `ɵɵngDeclareDirective`.
* @param args the arguments passed to the declaration function, should be a single object that
* corresponds to the `R3DeclareDirectiveMetadata` or `R3DeclareComponentMetadata` interfaces.
* @param declarationScope the scope that contains this call to the declaration function.
*/
linkPartialDeclaration(declarationFn: string, args: TExpression[], declarationScope: DeclarationScope<TConstantScope, TExpression>): TExpression;
/**
* Return all the shared constant statements and their associated constant scope references, so
* that they can be inserted into the source code.
*/
getConstantStatements(): {
constantScope: TConstantScope;
statements: TStatement[];
}[];
private getEmitScope;
}

View File

@@ -0,0 +1,18 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { SourceFile, SourceFileLoader } from '../../../src/ngtsc/sourcemaps';
/**
* A function that will return a `SourceFile` object (or null) for the current file being linked.
*/
export type GetSourceFileFn = () => SourceFile | null;
/**
* Create a `GetSourceFileFn` that will return the `SourceFile` being linked or `null`, if not
* available.
*/
export declare function createGetSourceFile(sourceUrl: AbsoluteFsPath, code: string, loader: SourceFileLoader | null): GetSourceFileFn;

View File

@@ -0,0 +1,25 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
import { Logger } from '../../../src/ngtsc/logging';
import { SourceFileLoader } from '../../../src/ngtsc/sourcemaps';
import { AstFactory } from '../../../src/ngtsc/translator';
import { AstHost } from '../ast/ast_host';
import { LinkerOptions } from './linker_options';
import { Translator } from './translator';
export declare class LinkerEnvironment<TStatement, TExpression> {
readonly fileSystem: ReadonlyFileSystem;
readonly logger: Logger;
readonly host: AstHost<TExpression>;
readonly factory: AstFactory<TStatement, TExpression>;
readonly options: LinkerOptions;
readonly translator: Translator<TStatement, TExpression>;
readonly sourceFileLoader: SourceFileLoader | null;
private constructor();
static create<TStatement, TExpression>(fileSystem: ReadonlyFileSystem, logger: Logger, host: AstHost<TExpression>, factory: AstFactory<TStatement, TExpression>, options: Partial<LinkerOptions>): LinkerEnvironment<TStatement, TExpression>;
}

View File

@@ -0,0 +1,41 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Options to configure the linking behavior.
*/
export interface LinkerOptions {
/**
* Whether to use source-mapping to compute the original source for external templates.
* The default is `true`.
*/
sourceMapping: boolean;
/**
* This option tells the linker to generate information used by a downstream JIT compiler.
*
* Specifically, in JIT mode, NgModule definitions must describe the `declarations`, `imports`,
* `exports`, etc, which are otherwise not needed.
*/
linkerJitMode: boolean;
/**
* How to handle a situation where a partial declaration matches none of the supported
* partial-linker versions.
*
* - `error` - the version mismatch is a fatal error.
* - `warn` - a warning is sent to the logger but the most recent partial-linker
* will attempt to process the declaration anyway.
* - `ignore` - the most recent partial-linker will, silently, attempt to process
* the declaration.
*
* The default is `error`.
*/
unknownDeclarationVersionHandling: 'ignore' | 'warn' | 'error';
}
/**
* The default linker options to use if properties are not provided.
*/
export declare const DEFAULT_LINKER_OPTIONS: LinkerOptions;

View File

@@ -0,0 +1,23 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Determines if the provided source file may need to be processed by the linker, i.e. whether it
* potentially contains any declarations. If true is returned, then the source file should be
* processed by the linker as it may contain declarations that need to be fully compiled. If false
* is returned, parsing and processing of the source file can safely be skipped to improve
* performance.
*
* This function may return true even for source files that don't actually contain any declarations
* that need to be compiled.
*
* @param path the absolute path of the source file for which to determine whether linking may be
* needed.
* @param source the source file content as a string.
* @returns whether the source file may contain declarations that need to be linked.
*/
export declare function needsLinking(path: string, source: string): boolean;

View File

@@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3ClassMetadata, R3DeclareClassMetadata, R3PartialDeclaration } from '@angular/compiler';
import { AstObject } from '../../ast/ast_value';
import { LinkedDefinition, PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareClassMetadata()` call expressions.
*/
export declare class PartialClassMetadataLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
}
/**
* Derives the `R3ClassMetadata` structure from the AST object.
*/
export declare function toR3ClassMetadata<TExpression>(metaObj: AstObject<R3DeclareClassMetadata, TExpression>): R3ClassMetadata;

View File

@@ -0,0 +1,34 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3PartialDeclaration } from '@angular/compiler';
import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
import { AstObject } from '../../ast/ast_value';
import { GetSourceFileFn } from '../get_source_file';
import { LinkedDefinition, PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareComponent()` call expressions.
*/
export declare class PartialComponentLinkerVersion1<TStatement, TExpression> implements PartialLinker<TExpression> {
private readonly getSourceFile;
private sourceUrl;
private code;
constructor(getSourceFile: GetSourceFileFn, sourceUrl: AbsoluteFsPath, code: string);
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>, version: string): LinkedDefinition;
/**
* This function derives the `R3ComponentMetadata` from the provided AST object.
*/
private toR3ComponentMeta;
/**
* Update the range to remove the start and end chars, which should be quotes around the template.
*/
private getTemplateInfo;
private tryExternalTemplate;
private templateFromPartialCode;
private createR3DeferredMetadata;
private resolveDeferTriggers;
}

View File

@@ -0,0 +1,26 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, ParseSourceSpan, R3DeclareDirectiveMetadata, R3DirectiveMetadata, R3PartialDeclaration } from '@angular/compiler';
import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
import { Range } from '../../ast/ast_host';
import { AstObject } from '../../ast/ast_value';
import { LinkedDefinition, PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareDirective()` call expressions.
*/
export declare class PartialDirectiveLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
private sourceUrl;
private code;
constructor(sourceUrl: AbsoluteFsPath, code: string);
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
}
/**
* Derives the `R3DirectiveMetadata` structure from the AST object.
*/
export declare function toR3DirectiveMeta<TExpression>(metaObj: AstObject<R3DeclareDirectiveMetadata, TExpression>, code: string, sourceUrl: AbsoluteFsPath): R3DirectiveMetadata;
export declare function createSourceSpan(range: Range, code: string, sourceUrl: string): ParseSourceSpan;

View File

@@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclareFactoryMetadata, R3FactoryMetadata, R3PartialDeclaration } from '@angular/compiler';
import { AstObject } from '../../ast/ast_value';
import { LinkedDefinition, PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareFactory()` call expressions.
*/
export declare class PartialFactoryLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
}
/**
* Derives the `R3FactoryMetadata` structure from the AST object.
*/
export declare function toR3FactoryMeta<TExpression>(metaObj: AstObject<R3DeclareFactoryMetadata, TExpression>): R3FactoryMetadata;

View File

@@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclareInjectableMetadata, R3InjectableMetadata, R3PartialDeclaration } from '@angular/compiler';
import { AstObject } from '../../ast/ast_value';
import { LinkedDefinition, PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareInjectable()` call expressions.
*/
export declare class PartialInjectableLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
}
/**
* Derives the `R3InjectableMetadata` structure from the AST object.
*/
export declare function toR3InjectableMeta<TExpression>(metaObj: AstObject<R3DeclareInjectableMetadata, TExpression>): R3InjectableMetadata;

View File

@@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclareInjectorMetadata, R3InjectorMetadata, R3PartialDeclaration } from '@angular/compiler';
import { AstObject } from '../../ast/ast_value';
import { LinkedDefinition, PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareInjector()` call expressions.
*/
export declare class PartialInjectorLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
}
/**
* Derives the `R3InjectorMetadata` structure from the AST object.
*/
export declare function toR3InjectorMeta<TExpression>(metaObj: AstObject<R3DeclareInjectorMetadata, TExpression>): R3InjectorMetadata;

View File

@@ -0,0 +1,28 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, outputAst as o, R3PartialDeclaration } from '@angular/compiler';
import { AstObject } from '../../ast/ast_value';
/**
* A definition generated by a `PartialLinker`, ready to emit.
*/
export interface LinkedDefinition {
expression: o.Expression;
statements: o.Statement[];
}
/**
* An interface for classes that can link partial declarations into full definitions.
*/
export interface PartialLinker<TExpression> {
/**
* Link the partial declaration `metaObj` information to generate a full definition expression.
*
* @param metaObj An object that fits one of the `R3DeclareDirectiveMetadata` or
* `R3DeclareComponentMetadata` interfaces.
*/
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>, version: string): LinkedDefinition;
}

View File

@@ -0,0 +1,80 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import semver from 'semver';
import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
import { Logger } from '../../../../src/ngtsc/logging';
import { LinkerEnvironment } from '../linker_environment';
import { PartialLinker } from './partial_linker';
export declare const ɵɵngDeclareDirective = "\u0275\u0275ngDeclareDirective";
export declare const ɵɵngDeclareClassMetadata = "\u0275\u0275ngDeclareClassMetadata";
export declare const ɵɵngDeclareComponent = "\u0275\u0275ngDeclareComponent";
export declare const ɵɵngDeclareFactory = "\u0275\u0275ngDeclareFactory";
export declare const ɵɵngDeclareInjectable = "\u0275\u0275ngDeclareInjectable";
export declare const ɵɵngDeclareInjector = "\u0275\u0275ngDeclareInjector";
export declare const ɵɵngDeclareNgModule = "\u0275\u0275ngDeclareNgModule";
export declare const ɵɵngDeclarePipe = "\u0275\u0275ngDeclarePipe";
export declare const declarationFunctions: string[];
export interface LinkerRange<TExpression> {
range: semver.Range;
linker: PartialLinker<TExpression>;
}
/**
* Create a mapping between partial-declaration call name and collections of partial-linkers.
*
* Each collection of partial-linkers will contain a version range that will be matched against the
* `minVersion` of the partial-declaration. (Additionally, a partial-linker may modify its behaviour
* internally based on the `version` property of the declaration.)
*
* Versions should be sorted in ascending order. The most recent partial-linker will be used as the
* fallback linker if none of the other version ranges match. For example:
*
* ```
* {range: getRange('<=', '13.0.0'), linker PartialDirectiveLinkerVersion2(...) },
* {range: getRange('<=', '13.1.0'), linker PartialDirectiveLinkerVersion3(...) },
* {range: getRange('<=', '14.0.0'), linker PartialDirectiveLinkerVersion4(...) },
* {range: LATEST_VERSION_RANGE, linker: new PartialDirectiveLinkerVersion1(...)},
* ```
*
* If the `LATEST_VERSION_RANGE` is `<=15.0.0` then the fallback linker would be
* `PartialDirectiveLinkerVersion1` for any version greater than `15.0.0`.
*
* When there is a change to a declaration interface that requires a new partial-linker, the
* `minVersion` of the partial-declaration should be updated, the new linker implementation should
* be added to the end of the collection, and the version of the previous linker should be updated.
*/
export declare function createLinkerMap<TStatement, TExpression>(environment: LinkerEnvironment<TStatement, TExpression>, sourceUrl: AbsoluteFsPath, code: string): Map<string, LinkerRange<TExpression>[]>;
/**
* A helper that selects the appropriate `PartialLinker` for a given declaration.
*
* The selection is made from a database of linker instances, chosen if their given semver range
* satisfies the `minVersion` of the partial declaration to be linked.
*
* Note that the ranges are checked in order, and the first matching range will be selected. So
* ranges should be most restrictive first. In practice, since ranges are always `<=X.Y.Z` this
* means that ranges should be in ascending order.
*
* Note that any "pre-release" versions are stripped from ranges. Therefore if a `minVersion` is
* `11.1.0-next.1` then this would match `11.1.0-next.2` and also `12.0.0-next.1`. (This is
* different to standard semver range checking, where pre-release versions do not cross full version
* boundaries.)
*/
export declare class PartialLinkerSelector<TExpression> {
private readonly linkers;
private readonly logger;
private readonly unknownDeclarationVersionHandling;
constructor(linkers: Map<string, LinkerRange<TExpression>[]>, logger: Logger, unknownDeclarationVersionHandling: 'ignore' | 'warn' | 'error');
/**
* Returns true if there are `PartialLinker` classes that can handle functions with this name.
*/
supportsDeclaration(functionName: string): boolean;
/**
* Returns the `PartialLinker` that can handle functions with the given name and version.
* Throws an error if there is none.
*/
getLinker(functionName: string, minVersion: string, version: string): PartialLinker<TExpression>;
}

View File

@@ -0,0 +1,31 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclareNgModuleMetadata, R3NgModuleMetadata, R3PartialDeclaration } from '@angular/compiler';
import { AstObject } from '../../ast/ast_value';
import { LinkedDefinition, PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareNgModule()` call expressions.
*/
export declare class PartialNgModuleLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
/**
* If true then emit the additional declarations, imports, exports, etc in the NgModule
* definition. These are only used by JIT compilation.
*/
private emitInline;
constructor(
/**
* If true then emit the additional declarations, imports, exports, etc in the NgModule
* definition. These are only used by JIT compilation.
*/
emitInline: boolean);
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
}
/**
* Derives the `R3NgModuleMetadata` structure from the AST object.
*/
export declare function toR3NgModuleMeta<TExpression>(metaObj: AstObject<R3DeclareNgModuleMetadata, TExpression>, supportJit: boolean): R3NgModuleMetadata;

View File

@@ -0,0 +1,21 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclarePipeMetadata, R3PartialDeclaration, R3PipeMetadata } from '@angular/compiler';
import { AstObject } from '../../ast/ast_value';
import { LinkedDefinition, PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclarePipe()` call expressions.
*/
export declare class PartialPipeLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
constructor();
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): LinkedDefinition;
}
/**
* Derives the `R3PipeMetadata` structure from the AST object.
*/
export declare function toR3PipeMeta<TExpression>(metaObj: AstObject<R3DeclarePipeMetadata, TExpression>): R3PipeMetadata;

View File

@@ -0,0 +1,30 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
import { AstObject, AstValue } from '../../ast/ast_value';
export declare const PLACEHOLDER_VERSION = "17.0.8";
export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
/**
* Parses the value of an enum from the AST value's symbol name.
*/
export declare function parseEnum<TExpression, TEnum>(value: AstValue<unknown, TExpression>, Enum: TEnum): TEnum[keyof TEnum];
/**
* Parse a dependency structure from an AST object.
*/
export declare function getDependency<TExpression>(depObj: AstObject<R3DeclareDependencyMetadata, TExpression>): R3DependencyMetadata;
/**
* Return an `R3ProviderExpression` that represents either the extracted type reference expression
* from a `forwardRef` function call, or the type itself.
*
* For example, the expression `forwardRef(function() { return FooDir; })` returns `FooDir`. Note
* that this expression is required to be wrapped in a closure, as otherwise the forward reference
* would be resolved before initialization.
*
* If there is no forwardRef call expression then we just return the opaque type.
*/
export declare function extractForwardRef<TExpression>(expr: AstValue<unknown, TExpression>): MaybeForwardRefExpression<o.WrappedNodeExpr<TExpression>>;

View File

@@ -0,0 +1,25 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as o from '@angular/compiler';
import { AstFactory, ImportGenerator, TranslatorOptions } from '../../../src/ngtsc/translator';
/**
* Generic translator helper class, which exposes methods for translating expressions and
* statements.
*/
export declare class Translator<TStatement, TExpression> {
private factory;
constructor(factory: AstFactory<TStatement, TExpression>);
/**
* Translate the given output AST in the context of an expression.
*/
translateExpression(expression: o.Expression, imports: ImportGenerator<TExpression>, options?: TranslatorOptions<TExpression>): TExpression;
/**
* Translate the given output AST in the context of a statement.
*/
translateStatement(statement: o.Statement, imports: ImportGenerator<TExpression>, options?: TranslatorOptions<TExpression>): TStatement;
}

View File

@@ -0,0 +1,23 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ImportGenerator, NamedImport } from '../../src/ngtsc/translator';
/**
* A class that is used to generate imports when translating from Angular Output AST to an AST to
* render, such as Babel.
*
* Note that, in the linker, there can only be imports from `@angular/core` and that these imports
* must be achieved by property access on an `ng` namespace identifier, which is passed in via the
* constructor.
*/
export declare class LinkerImportGenerator<TExpression> implements ImportGenerator<TExpression> {
private ngImport;
constructor(ngImport: TExpression);
generateNamespaceImport(moduleName: string): TExpression;
generateNamedImport(moduleName: string, originalSymbol: string): NamedImport<TExpression>;
private assertModuleName;
}

11
node_modules/@angular/compiler-cli/ngcc/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env node
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
declare function stringEncaseCRLFWithFirstIndex(value: string, prefix: string, postfix: string, index: number): string;
declare function styleMessage(message: string): string;
declare const warningMsg = "\n\n==========================================\n\nALERT: As of Angular 16, \"ngcc\" is no longer required and not invoked during CLI builds. You are seeing this message because the current operation invoked the \"ngcc\" command directly. This \"ngcc\" invocation can be safely removed.\n\nA common reason for this is invoking \"ngcc\" from a \"postinstall\" hook in package.json.\n\nIn Angular 17, this command will be removed. Remove this and any other invocations to prevent errors in later versions.\n\n==========================================\n\n";

96
node_modules/@angular/compiler-cli/package.json generated vendored Executable file
View File

@@ -0,0 +1,96 @@
{
"name": "@angular/compiler-cli",
"version": "17.0.8",
"description": "Angular - the compiler CLI for Node.js",
"typings": "index.d.ts",
"bin": {
"ngcc": "./bundles/ngcc/index.js",
"ngc": "./bundles/src/bin/ngc.js",
"ng-xi18n": "./bundles/src/bin/ng_xi18n.js"
},
"type": "module",
"exports": {
".": {
"types": "./index.d.ts",
"default": "./bundles/index.js"
},
"./package.json": {
"default": "./package.json"
},
"./linker": {
"types": "./linker/index.d.ts",
"default": "./bundles/linker/index.js"
},
"./linker/babel": {
"types": "./linker/babel/index.d.ts",
"default": "./bundles/linker/babel/index.js"
},
"./private/bazel": {
"types": "./private/bazel.d.ts",
"default": "./bundles/private/bazel.js"
},
"./private/localize": {
"types": "./private/localize.d.ts",
"default": "./bundles/private/localize.js"
},
"./private/migrations": {
"types": "./private/migrations.d.ts",
"default": "./bundles/private/migrations.js"
},
"./private/tooling": {
"types": "./private/tooling.d.ts",
"default": "./bundles/private/tooling.js"
}
},
"dependencies": {
"@babel/core": "7.23.2",
"@jridgewell/sourcemap-codec": "^1.4.14",
"reflect-metadata": "^0.1.2",
"chokidar": "^3.0.0",
"convert-source-map": "^1.5.1",
"semver": "^7.0.0",
"tslib": "^2.3.0",
"yargs": "^17.2.1"
},
"peerDependencies": {
"@angular/compiler": "17.0.8",
"typescript": ">=5.2 <5.3"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.git",
"directory": "packages/compiler-cli"
},
"keywords": [
"angular",
"compiler"
],
"license": "MIT",
"engines": {
"node": "^18.13.0 || >=20.9.0"
},
"bugs": {
"url": "https://github.com/angular/angular/issues"
},
"homepage": "https://github.com/angular/angular/tree/main/packages/compiler-cli",
"ng-update": {
"packageGroup": [
"@angular/core",
"@angular/bazel",
"@angular/common",
"@angular/compiler",
"@angular/compiler-cli",
"@angular/animations",
"@angular/elements",
"@angular/platform-browser",
"@angular/platform-browser-dynamic",
"@angular/forms",
"@angular/platform-server",
"@angular/upgrade",
"@angular/router",
"@angular/language-service",
"@angular/localize",
"@angular/service-worker"
]
}
}

42
node_modules/@angular/compiler-cli/private/babel.d.ts generated vendored Executable file
View File

@@ -0,0 +1,42 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { BabelFile, types as t } from '@babel/core';
/**
* Augment some Babel types to add symbols that we rely on, but are not included in the Babel typings.
*/
declare module '@babel/traverse' {
interface Hub {
file: BabelFile;
}
}
declare module '@babel/core' {
interface BabelFile {
buildCodeFrameError(node: t.Node, message: string): Error;
}
}
// The following modules are declared to work around a limitation in tsc_wrapped's `strict_deps`
// check. Since Babel uses scoped packages, the corresponding lookup for declaration files in the
// `node_modules/@types/` directory follows a special strategy: the `@types` package has to be
// named `{scope}__{package}`, e.g. `@types/babel__generator`. When `tsc` performs module
// resolution for the `@babel/generator` module specifier, it will first try the `paths` mappings
// but resolution through path mappings does _not_ apply this special naming convention rule for
// `@types` packages, `tsc` only applies that rule in its `@types` resolution step. Consequently,
// the path mapping into Bazel's private `node_modules` directory fails to resolve, causing `tsc`
// to find the nearest `node_modules` directory in an ancestor directory of the origin source
// file. This finds the `node_modules` directory in the workspace, _not_ Bazel's private copy of
// `node_modules` and therefore the `@types` end up being resolved from a `node_modules` tree
// that is not governed by Bazel, and therefore not expected by the `strict_deps` rule.
// Declaring the modules here allows `strict_deps` to always find a declaration of the modules
// in an input file to the compilation, therefore accepting the module import.
declare module '@babel/generator' {}
declare module '@babel/template' {}
declare module '@babel/parser' {}

12
node_modules/@angular/compiler-cli/private/bazel.d.ts generated vendored Executable file
View File

@@ -0,0 +1,12 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @fileoverview The API from compiler-cli that the `@angular/bazel`
* package requires for ngc-wrapped.
*/
export { PerfPhase } from '../src/ngtsc/perf';

14
node_modules/@angular/compiler-cli/private/localize.d.ts generated vendored Executable file
View File

@@ -0,0 +1,14 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @fileoverview The API from compiler-cli that the `@angular/localize`
* package requires.
*/
export * from '../src/ngtsc/logging';
export * from '../src/ngtsc/file_system';
export { SourceFile, SourceFileLoader } from '../src/ngtsc/sourcemaps';

16
node_modules/@angular/compiler-cli/private/migrations.d.ts generated vendored Executable file
View File

@@ -0,0 +1,16 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @fileoverview The API from compiler-cli that the `@angular/core`
* package requires for migration schematics.
*/
export { forwardRefResolver } from '../src/ngtsc/annotations';
export { Reference } from '../src/ngtsc/imports';
export { DynamicValue, PartialEvaluator, ResolvedValue, ResolvedValueMap, StaticInterpreter } from '../src/ngtsc/partial_evaluator';
export { reflectObjectLiteral, TypeScriptReflectionHost } from '../src/ngtsc/reflection';
export { PotentialImport, PotentialImportKind, PotentialImportMode, TemplateTypeChecker } from '../src/ngtsc/typecheck/api';

35
node_modules/@angular/compiler-cli/private/tooling.d.ts generated vendored Executable file
View File

@@ -0,0 +1,35 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @fileoverview
* This file is used as a private API channel to shared Angular FW APIs with @angular/cli.
*
* Any changes to this file should be discussed with the Angular CLI team.
*/
import ts from 'typescript';
/**
* Known values for global variables in `@angular/core` that Terser should set using
* https://github.com/terser-js/terser#conditional-compilation
*/
export declare const GLOBAL_DEFS_FOR_TERSER: {
ngDevMode: boolean;
ngI18nClosureMode: boolean;
};
export declare const GLOBAL_DEFS_FOR_TERSER_WITH_AOT: {
ngJitMode: boolean;
ngDevMode: boolean;
ngI18nClosureMode: boolean;
};
/**
* Transform for downleveling Angular decorators and Angular-decorated class constructor
* parameters for dependency injection. This transform can be used by the CLI for JIT-mode
* compilation where constructor parameters and associated Angular decorators should be
* downleveled so that apps are not exposed to the ES2015 temporal dead zone limitation
* in TypeScript. See https://github.com/angular/angular-cli/pull/14473 for more details.
*/
export declare function constructorParametersDownlevelTransform(program: ts.Program): ts.TransformerFactory<ts.SourceFile>;

9
node_modules/@angular/compiler-cli/src/bin/ng_xi18n.d.ts generated vendored Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env node
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import 'reflect-metadata';

9
node_modules/@angular/compiler-cli/src/bin/ngc.d.ts generated vendored Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env node
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import 'reflect-metadata';

8
node_modules/@angular/compiler-cli/src/extract_i18n.d.ts generated vendored Executable file
View File

@@ -0,0 +1,8 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export declare function mainXi18n(args: string[], consoleError?: (msg: string) => void): number;

29
node_modules/@angular/compiler-cli/src/main.d.ts generated vendored Executable file
View File

@@ -0,0 +1,29 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import ts from 'typescript';
import { ParsedConfiguration } from './perform_compile';
import * as api from './transformers/api';
export declare function main(args: string[], consoleError?: (s: string) => void, config?: NgcParsedConfiguration, customTransformers?: api.CustomTransformers, programReuse?: {
program: api.Program | undefined;
}, modifiedResourceFiles?: Set<string> | null): number;
export declare function mainDiagnosticsForTest(args: string[], config?: NgcParsedConfiguration, programReuse?: {
program: api.Program | undefined;
}, modifiedResourceFiles?: Set<string> | null): {
exitCode: number;
diagnostics: ReadonlyArray<ts.Diagnostic>;
};
export interface NgcParsedConfiguration extends ParsedConfiguration {
watch?: boolean;
}
export declare function readNgcCommandLineAndConfiguration(args: string[]): NgcParsedConfiguration;
export declare function readCommandLineAndConfiguration(args: string[], existingOptions?: api.CompilerOptions, ngCmdLineOptions?: string[]): ParsedConfiguration;
export declare function watchMode(project: string, options: api.CompilerOptions, consoleError: (s: string) => void): {
close: () => void;
ready: (cb: () => void) => void;
firstCompileResult: readonly ts.Diagnostic[];
};

View File

@@ -0,0 +1,19 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export * from './src/api';
export * from './src/di';
export * from './src/diagnostics';
export * from './src/evaluation';
export * from './src/factory';
export * from './src/injectable_registry';
export * from './src/metadata';
export * from './src/debug_info';
export * from './src/references_registry';
export * from './src/schema';
export * from './src/util';
export * from './src/input_transforms';

View File

@@ -0,0 +1,82 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Resolves and loads resource files that are referenced in Angular metadata.
*
* Note that `preload()` and `load()` take a `resolvedUrl`, which can be found
* by calling `resolve()`. These two steps are separated because sometimes the
* resolved URL to the resource is needed as well as its contents.
*/
export interface ResourceLoader {
/**
* True if this resource loader can preload resources.
*
* Sometimes a `ResourceLoader` is not able to do asynchronous pre-loading of resources.
*/
canPreload: boolean;
/**
* If true, the resource loader is able to preprocess inline resources.
*/
canPreprocess: boolean;
/**
* Resolve the url of a resource relative to the file that contains the reference to it.
* The return value of this method can be used in the `load()` and `preload()` methods.
*
* @param url The, possibly relative, url of the resource.
* @param fromFile The path to the file that contains the URL of the resource.
* @returns A resolved url of resource.
* @throws An error if the resource cannot be resolved.
*/
resolve(file: string, basePath: string): string;
/**
* Preload the specified resource, asynchronously. Once the resource is loaded, its value
* should be cached so it can be accessed synchronously via the `load()` method.
*
* @param resolvedUrl The url (resolved by a call to `resolve()`) of the resource to preload.
* @param context Information regarding the resource such as the type and containing file.
* @returns A Promise that is resolved once the resource has been loaded or `undefined`
* if the file has already been loaded.
* @throws An Error if pre-loading is not available.
*/
preload(resolvedUrl: string, context: ResourceLoaderContext): Promise<void> | undefined;
/**
* Preprocess the content data of an inline resource, asynchronously.
*
* @param data The existing content data from the inline resource.
* @param context Information regarding the resource such as the type and containing file.
* @returns A Promise that resolves to the processed data. If no processing occurs, the
* same data string that was passed to the function will be resolved.
*/
preprocessInline(data: string, context: ResourceLoaderContext): Promise<string>;
/**
* Load the resource at the given url, synchronously.
*
* The contents of the resource may have been cached by a previous call to `preload()`.
*
* @param resolvedUrl The url (resolved by a call to `resolve()`) of the resource to load.
* @returns The contents of the resource.
*/
load(resolvedUrl: string): string;
}
/**
* Contextual information used by members of the ResourceLoader interface.
*/
export interface ResourceLoaderContext {
/**
* The type of the component resource.
* * Resources referenced via a component's `styles` or `styleUrls` properties are of
* type `style`.
* * Resources referenced via a component's `template` or `templateUrl` properties are of type
* `template`.
*/
type: 'style' | 'template';
/**
* The absolute path to the file that contains the resource or reference to the resource.
*/
containingFile: string;
}

View File

@@ -0,0 +1,10 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { R3ClassDebugInfo } from '@angular/compiler';
import { DeclarationNode, ReflectionHost } from '../../../reflection';
export declare function extractClassDebugInfo(clazz: DeclarationNode, reflection: ReflectionHost, rootDirs: ReadonlyArray<string>, forbidOrphanRendering: boolean): R3ClassDebugInfo | null;

View File

@@ -0,0 +1,38 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { R3DependencyMetadata } from '@angular/compiler';
import { ClassDeclaration, CtorParameter, ReflectionHost, UnavailableValue } from '../../../reflection';
import { CompilationMode } from '../../../transform';
export type ConstructorDeps = {
deps: R3DependencyMetadata[];
} | {
deps: null;
errors: ConstructorDepError[];
};
export interface ConstructorDepError {
index: number;
param: CtorParameter;
reason: UnavailableValue;
}
export declare function getConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean, compilationMode: CompilationMode): ConstructorDeps | null;
/**
* Convert `ConstructorDeps` into the `R3DependencyMetadata` array for those deps if they're valid,
* or into an `'invalid'` signal if they're not.
*
* This is a companion function to `validateConstructorDependencies` which accepts invalid deps.
*/
export declare function unwrapConstructorDependencies(deps: ConstructorDeps | null): R3DependencyMetadata[] | 'invalid' | null;
export declare function getValidConstructorDependencies(clazz: ClassDeclaration, reflector: ReflectionHost, isCore: boolean, compilationMode: CompilationMode): R3DependencyMetadata[] | null;
/**
* Validate that `ConstructorDeps` does not have any invalid dependencies and convert them into the
* `R3DependencyMetadata` array if so, or raise a diagnostic if some deps are invalid.
*
* This is a companion function to `unwrapConstructorDependencies` which does not accept invalid
* deps.
*/
export declare function validateConstructorDependencies(clazz: ClassDeclaration, deps: ConstructorDeps | null): R3DependencyMetadata[] | null;

View File

@@ -0,0 +1,52 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import ts from 'typescript';
import { FatalDiagnosticError } from '../../../diagnostics';
import { Reference } from '../../../imports';
import { HostDirectiveMeta, MetadataReader } from '../../../metadata';
import { PartialEvaluator, ResolvedValue } from '../../../partial_evaluator';
import { ClassDeclaration, ReflectionHost } from '../../../reflection';
import { DeclarationData, LocalModuleScopeRegistry } from '../../../scope';
import { InjectableClassRegistry } from './injectable_registry';
/**
* Create a `ts.Diagnostic` which indicates the given class is part of the declarations of two or
* more NgModules.
*
* The resulting `ts.Diagnostic` will have a context entry for each NgModule showing the point where
* the directive/pipe exists in its `declarations` (if possible).
*/
export declare function makeDuplicateDeclarationError(node: ClassDeclaration, data: DeclarationData[], kind: string): ts.Diagnostic;
/**
* Creates a `FatalDiagnosticError` for a node that did not evaluate to the expected type. The
* diagnostic that is created will include details on why the value is incorrect, i.e. it includes
* a representation of the actual type that was unsupported, or in the case of a dynamic value the
* trace to the node where the dynamic value originated.
*
* @param node The node for which the diagnostic should be produced.
* @param value The evaluated value that has the wrong type.
* @param messageText The message text of the error.
*/
export declare function createValueHasWrongTypeError(node: ts.Node, value: ResolvedValue, messageText: string): FatalDiagnosticError;
/**
* Gets the diagnostics for a set of provider classes.
* @param providerClasses Classes that should be checked.
* @param providersDeclaration Node that declares the providers array.
* @param registry Registry that keeps track of the registered injectable classes.
*/
export declare function getProviderDiagnostics(providerClasses: Set<Reference<ClassDeclaration>>, providersDeclaration: ts.Expression, registry: InjectableClassRegistry): ts.Diagnostic[];
export declare function getDirectiveDiagnostics(node: ClassDeclaration, injectableRegistry: InjectableClassRegistry, evaluator: PartialEvaluator, reflector: ReflectionHost, scopeRegistry: LocalModuleScopeRegistry, strictInjectionParameters: boolean, kind: 'Directive' | 'Component'): ts.Diagnostic[] | null;
export declare function validateHostDirectives(origin: ts.Expression, hostDirectives: HostDirectiveMeta[], metaReader: MetadataReader): ts.DiagnosticWithLocation[];
export declare function getUndecoratedClassWithAngularFeaturesDiagnostic(node: ClassDeclaration): ts.Diagnostic;
export declare function checkInheritanceOfInjectable(node: ClassDeclaration, injectableRegistry: InjectableClassRegistry, reflector: ReflectionHost, evaluator: PartialEvaluator, strictInjectionParameters: boolean, kind: 'Directive' | 'Component' | 'Pipe' | 'Injectable'): ts.Diagnostic | null;
interface ClassWithCtor {
ref: Reference<ClassDeclaration>;
isCtorValid: boolean;
isDecorated: boolean;
}
export declare function findInheritedCtor(node: ClassDeclaration, injectableRegistry: InjectableClassRegistry, reflector: ReflectionHost, evaluator: PartialEvaluator): ClassWithCtor | null;
export {};

View File

@@ -0,0 +1,25 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import ts from 'typescript';
import { Reference } from '../../../imports';
import { PartialEvaluator, ResolvedValue } from '../../../partial_evaluator';
import { ClassDeclaration, Decorator } from '../../../reflection';
export declare function resolveEnumValue(evaluator: PartialEvaluator, metadata: Map<string, ts.Expression>, field: string, enumSymbolName: string): number | null;
/**
* Resolves a EncapsulationEnum expression locally on best effort without having to calculate the
* reference. This suites local compilation mode where each file is compiled individually.
*
* The static analysis is still needed in local compilation mode since the value of this enum will
* be used later to decide the generated code for styles.
*/
export declare function resolveEncapsulationEnumValueLocally(expr?: ts.Expression): number | null;
/** Determines if the result of an evaluation is a string array. */
export declare function isStringArray(resolvedValue: ResolvedValue): resolvedValue is string[];
export declare function isClassReferenceArray(resolvedValue: ResolvedValue): resolvedValue is Reference<ClassDeclaration>[];
export declare function isArray(value: ResolvedValue): value is Array<ResolvedValue>;
export declare function resolveLiteral(decorator: Decorator, literalCache: Map<Decorator, ts.ObjectLiteralExpression>): ts.ObjectLiteralExpression;

View File

@@ -0,0 +1,12 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { R3FactoryMetadata } from '@angular/compiler';
import { CompileResult } from '../../../transform';
export type CompileFactoryFn = (metadata: R3FactoryMetadata) => CompileResult;
export declare function compileNgFactoryDefField(metadata: R3FactoryMetadata): CompileResult;
export declare function compileDeclareFactory(metadata: R3FactoryMetadata): CompileResult;

View File

@@ -0,0 +1,24 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { R3DependencyMetadata } from '@angular/compiler';
import { ClassDeclaration, ReflectionHost } from '../../../reflection';
export interface InjectableMeta {
ctorDeps: R3DependencyMetadata[] | 'invalid' | null;
}
/**
* Registry that keeps track of classes that can be constructed via dependency injection (e.g.
* injectables, directives, pipes).
*/
export declare class InjectableClassRegistry {
private host;
private isCore;
private classes;
constructor(host: ReflectionHost, isCore: boolean);
registerInjectable(declaration: ClassDeclaration, meta: InjectableMeta): void;
getInjectableMeta(declaration: ClassDeclaration): InjectableMeta | null;
}

View File

@@ -0,0 +1,11 @@
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ClassPropertyMapping, InputMapping } from '../../../metadata';
import { CompileResult } from '../../../transform';
/** Generates additional fields to be added to a class that has inputs with transform functions. */
export declare function compileInputTransformFields(inputs: ClassPropertyMapping<InputMapping>): CompileResult[];

Some files were not shown because too many files have changed in this diff Show More