@absolutejs/absolute 0.20.0-beta.173 → 0.20.0-beta.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/changelog.json +11 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +47 -27
- package/dist/angular/index.js.map +6 -5
- package/dist/angular/server.js +47 -27
- package/dist/angular/server.js.map +6 -5
- package/dist/build.js +635 -613
- package/dist/build.js.map +25 -24
- package/dist/cli/{add-ae6mg79m.js → add-ntg96znk.js} +32 -31
- package/dist/cli/{compile-ndc36zna.js → compile-n6fs2vmx.js} +16 -14
- package/dist/cli/config/server.js +85 -65
- package/dist/cli/{dev-x49583aj.js → dev-6h1f0mzq.js} +1 -1
- package/dist/cli/{expoProject-h404n2r8.js → expoProject-1qtw97js.js} +2 -1
- package/dist/cli/{generate-brvjesd6.js → generate-5vyz1s44.js} +7 -6
- package/dist/cli/{htmx-5twhjz7p.js → htmx-26hs6jdm.js} +2 -1
- package/dist/cli/{index-gyjxrnnz.js → index-23hvdyxf.js} +18 -16
- package/dist/cli/index-4j1twret.js +22 -0
- package/dist/cli/{index-25e7k849.js → index-bhyd3ejc.js} +4 -4
- package/dist/cli/{index-s0r5q839.js → index-cksezef8.js} +10 -8
- package/dist/cli/{index-q3snnhyd.js → index-enbw9484.js} +34 -33
- package/dist/cli/{index-b1wht4q5.js → index-kes8he5s.js} +6 -4
- package/dist/cli/{index-z794p5qg.js → index-mqevg32w.js} +22 -19
- package/dist/cli/{index-vh68jb0e.js → index-pkw3jktb.js} +17 -16
- package/dist/cli/{index-rervww4p.js → index-zyd80s3h.js} +119 -119
- package/dist/cli/index.js +11 -11
- package/dist/cli/{islands-p4vgx7a2.js → islands-vk05sj6v.js} +5 -4
- package/dist/cli/{mobile-nqdkk3gd.js → mobile-62b6j3j7.js} +5 -4
- package/dist/cli/{remove-abaf0w6k.js → remove-4jh862qa.js} +6 -5
- package/dist/cli/{start-t3cq57wn.js → start-jh6kyp92.js} +5 -4
- package/dist/cli/{typecheck-fag7djt5.js → typecheck-7fvww3b7.js} +28 -26
- package/dist/dev/importCostReport.js +45 -26
- package/dist/index.js +633 -611
- package/dist/index.js.map +25 -24
- package/dist/mobile/index.js +115 -95
- package/dist/mobile/index.js.map +6 -5
- package/dist/mobile/remoteMacAgentEntry.js +205 -651
- package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +3 -3
- package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +3 -3
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
- package/dist/src/dev/angular/hmrImportGenerator.d.ts +2 -2
- package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +2 -2
- package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +40 -40
- package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +3 -3
- package/dist/src/utils/lazyTypescript.d.ts +3 -0
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -1127,6 +1127,26 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
|
|
|
1127
1127
|
ANGULAR_CORE_PACKAGE_RE = /(?:(?:^|\/)@angular\/core(?:\/|$)|(?:^|\/)angular_core\.[mc]?js$)/;
|
|
1128
1128
|
});
|
|
1129
1129
|
|
|
1130
|
+
// src/utils/lazyTypescript.ts
|
|
1131
|
+
import { createRequire } from "module";
|
|
1132
|
+
var loaded, loadTypescript = () => {
|
|
1133
|
+
if (loaded)
|
|
1134
|
+
return loaded;
|
|
1135
|
+
const requireFromHere = createRequire(import.meta.url);
|
|
1136
|
+
const typescript = requireFromHere("typescript");
|
|
1137
|
+
loaded = typescript;
|
|
1138
|
+
return typescript;
|
|
1139
|
+
}, createLazyTypescript = () => {
|
|
1140
|
+
const target = Object.create(null);
|
|
1141
|
+
return new Proxy(target, {
|
|
1142
|
+
get: (_target, key) => Reflect.get(loadTypescript(), key),
|
|
1143
|
+
has: (_target, key) => Reflect.has(loadTypescript(), key)
|
|
1144
|
+
});
|
|
1145
|
+
}, lazyTypescript;
|
|
1146
|
+
var init_lazyTypescript = __esm(() => {
|
|
1147
|
+
lazyTypescript = createLazyTypescript();
|
|
1148
|
+
});
|
|
1149
|
+
|
|
1130
1150
|
// src/core/islands.ts
|
|
1131
1151
|
function getIslandComponent(component) {
|
|
1132
1152
|
if (isIslandComponentDefinition(component)) {
|
|
@@ -1155,7 +1175,6 @@ var init_islands = () => {};
|
|
|
1155
1175
|
// src/build/islandEntries.ts
|
|
1156
1176
|
import { mkdirSync as mkdirSync2, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
1157
1177
|
import { dirname, extname as extname3, join as join2, relative, resolve as resolve3 } from "path";
|
|
1158
|
-
import ts from "typescript";
|
|
1159
1178
|
var frameworks, isRecord2 = (value) => typeof value === "object" && value !== null, resolveRegistryExport = (mod) => {
|
|
1160
1179
|
if (isRecord2(mod.islandRegistry))
|
|
1161
1180
|
return mod.islandRegistry;
|
|
@@ -1171,7 +1190,7 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1171
1190
|
}
|
|
1172
1191
|
return resolve3(dirname(registryPath), sourcePath);
|
|
1173
1192
|
}, getObjectPropertyName = (name) => {
|
|
1174
|
-
if (
|
|
1193
|
+
if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name)) {
|
|
1175
1194
|
return name.text;
|
|
1176
1195
|
}
|
|
1177
1196
|
return null;
|
|
@@ -1184,7 +1203,7 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1184
1203
|
});
|
|
1185
1204
|
}, collectNamedImports = (imports, importClause, source) => {
|
|
1186
1205
|
const bindings = importClause.namedBindings;
|
|
1187
|
-
if (!bindings || !
|
|
1206
|
+
if (!bindings || !lazyTypescript.isNamedImports(bindings))
|
|
1188
1207
|
return;
|
|
1189
1208
|
for (const element of bindings.elements) {
|
|
1190
1209
|
imports.set(element.name.text, {
|
|
@@ -1198,7 +1217,7 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1198
1217
|
const bindings = importClause.namedBindings;
|
|
1199
1218
|
if (!bindings)
|
|
1200
1219
|
return;
|
|
1201
|
-
if (
|
|
1220
|
+
if (lazyTypescript.isNamespaceImport(bindings)) {
|
|
1202
1221
|
registryNamespaceNames.add(bindings.name.text);
|
|
1203
1222
|
return;
|
|
1204
1223
|
}
|
|
@@ -1216,13 +1235,13 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1216
1235
|
const frameworkRegistry = registry[framework] ?? {};
|
|
1217
1236
|
registry[framework] = frameworkRegistry;
|
|
1218
1237
|
for (const property of frameworkNode.properties) {
|
|
1219
|
-
if (!
|
|
1238
|
+
if (!lazyTypescript.isPropertyAssignment(property) && !lazyTypescript.isShorthandPropertyAssignment(property))
|
|
1220
1239
|
continue;
|
|
1221
1240
|
const componentName = getObjectPropertyName(property.name);
|
|
1222
1241
|
if (!componentName)
|
|
1223
1242
|
continue;
|
|
1224
|
-
const initializer =
|
|
1225
|
-
if (!
|
|
1243
|
+
const initializer = lazyTypescript.isPropertyAssignment(property) ? property.initializer : property.name;
|
|
1244
|
+
if (!lazyTypescript.isIdentifier(initializer))
|
|
1226
1245
|
continue;
|
|
1227
1246
|
const reference = imports.get(initializer.text);
|
|
1228
1247
|
if (!reference)
|
|
@@ -1236,7 +1255,7 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1236
1255
|
}
|
|
1237
1256
|
}, processDefineIslandRegistry = (node, imports, definitions, registry) => {
|
|
1238
1257
|
const [firstArg] = node.arguments;
|
|
1239
|
-
if (!firstArg || !
|
|
1258
|
+
if (!firstArg || !lazyTypescript.isObjectLiteralExpression(firstArg))
|
|
1240
1259
|
return;
|
|
1241
1260
|
const validFrameworks = [
|
|
1242
1261
|
"react",
|
|
@@ -1245,7 +1264,7 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1245
1264
|
"angular"
|
|
1246
1265
|
];
|
|
1247
1266
|
for (const property of firstArg.properties) {
|
|
1248
|
-
if (!
|
|
1267
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
1249
1268
|
continue;
|
|
1250
1269
|
const frameworkName = getObjectPropertyName(property.name);
|
|
1251
1270
|
if (!frameworkName)
|
|
@@ -1253,28 +1272,28 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1253
1272
|
const framework = validFrameworks.find((f) => f === frameworkName);
|
|
1254
1273
|
if (!framework)
|
|
1255
1274
|
continue;
|
|
1256
|
-
if (!
|
|
1275
|
+
if (!lazyTypescript.isObjectLiteralExpression(property.initializer))
|
|
1257
1276
|
continue;
|
|
1258
1277
|
addRegistryEntries(property.initializer, framework, imports, definitions, registry);
|
|
1259
1278
|
}
|
|
1260
1279
|
}, walkRegistryNode = (node, imports, registryFactoryNames, registryNamespaceNames, definitions, registry) => {
|
|
1261
|
-
if (
|
|
1280
|
+
if (lazyTypescript.isCallExpression(node) && isDefineIslandRegistryCall(node.expression, registryFactoryNames, registryNamespaceNames)) {
|
|
1262
1281
|
processDefineIslandRegistry(node, imports, definitions, registry);
|
|
1263
1282
|
}
|
|
1264
|
-
|
|
1283
|
+
lazyTypescript.forEachChild(node, (child) => walkRegistryNode(child, imports, registryFactoryNames, registryNamespaceNames, definitions, registry));
|
|
1265
1284
|
}, isDefineIslandRegistryCall = (expression, registryFactoryNames, registryNamespaceNames) => {
|
|
1266
|
-
if (
|
|
1285
|
+
if (lazyTypescript.isIdentifier(expression)) {
|
|
1267
1286
|
return registryFactoryNames.has(expression.text);
|
|
1268
1287
|
}
|
|
1269
|
-
return
|
|
1288
|
+
return lazyTypescript.isPropertyAccessExpression(expression) && expression.name.text === "defineIslandRegistry" && lazyTypescript.isIdentifier(expression.expression) && registryNamespaceNames.has(expression.expression.text);
|
|
1270
1289
|
}, hasIslandRegistryNamedExport = (sourceFile) => {
|
|
1271
1290
|
for (const statement of sourceFile.statements) {
|
|
1272
|
-
if (
|
|
1291
|
+
if (lazyTypescript.isVariableStatement(statement) && statement.modifiers?.some((modifier) => modifier.kind === lazyTypescript.SyntaxKind.ExportKeyword) && statement.declarationList.declarations.some((declaration) => lazyTypescript.isIdentifier(declaration.name) && declaration.name.text === "islandRegistry")) {
|
|
1273
1292
|
return true;
|
|
1274
1293
|
}
|
|
1275
|
-
if (!
|
|
1294
|
+
if (!lazyTypescript.isExportDeclaration(statement) || !statement.exportClause)
|
|
1276
1295
|
continue;
|
|
1277
|
-
if (!
|
|
1296
|
+
if (!lazyTypescript.isNamedExports(statement.exportClause))
|
|
1278
1297
|
continue;
|
|
1279
1298
|
if (statement.exportClause.elements.some((element) => element.name.text === "islandRegistry")) {
|
|
1280
1299
|
return true;
|
|
@@ -1283,7 +1302,7 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1283
1302
|
return false;
|
|
1284
1303
|
}, collectImportDeclarations = (sourceFile, registryPath, imports, registryFactoryNames, registryNamespaceNames) => {
|
|
1285
1304
|
for (const statement of sourceFile.statements) {
|
|
1286
|
-
if (!
|
|
1305
|
+
if (!lazyTypescript.isImportDeclaration(statement) || !lazyTypescript.isStringLiteral(statement.moduleSpecifier))
|
|
1287
1306
|
continue;
|
|
1288
1307
|
const { importClause } = statement;
|
|
1289
1308
|
if (!importClause)
|
|
@@ -1294,7 +1313,7 @@ var frameworks, isRecord2 = (value) => typeof value === "object" && value !== nu
|
|
|
1294
1313
|
collectRegistryHelperImports(importClause, statement.moduleSpecifier.text, registryFactoryNames, registryNamespaceNames);
|
|
1295
1314
|
}
|
|
1296
1315
|
}, parseIslandRegistryBuildInfo = (registrySource, registryPath) => {
|
|
1297
|
-
const sourceFile =
|
|
1316
|
+
const sourceFile = lazyTypescript.createSourceFile(registryPath, registrySource, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
1298
1317
|
const imports = new Map;
|
|
1299
1318
|
const registryFactoryNames = new Set(["defineIslandRegistry"]);
|
|
1300
1319
|
const registryNamespaceNames = new Set;
|
|
@@ -1433,6 +1452,7 @@ export default component;
|
|
|
1433
1452
|
};
|
|
1434
1453
|
};
|
|
1435
1454
|
var init_islandEntries = __esm(() => {
|
|
1455
|
+
init_lazyTypescript();
|
|
1436
1456
|
init_islands();
|
|
1437
1457
|
frameworks = ["react", "svelte", "vue", "angular"];
|
|
1438
1458
|
});
|
|
@@ -4357,7 +4377,7 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
4357
4377
|
// src/build/stylePreprocessor.ts
|
|
4358
4378
|
import { existsSync as existsSync7, readFileSync as readFileSync5 } from "fs";
|
|
4359
4379
|
import { readFile as readFile2 } from "fs/promises";
|
|
4360
|
-
import { createRequire } from "module";
|
|
4380
|
+
import { createRequire as createRequire2 } from "module";
|
|
4361
4381
|
import {
|
|
4362
4382
|
dirname as dirname4,
|
|
4363
4383
|
extname as extname5,
|
|
@@ -4923,7 +4943,7 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
4923
4943
|
STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less|styl(?:us)?)$/i;
|
|
4924
4944
|
importOptionalPeer = new Function("specifier", "return import(specifier)");
|
|
4925
4945
|
requireOptionalPeer = new Function("specifier", "return require(specifier)");
|
|
4926
|
-
requireFromCwd =
|
|
4946
|
+
requireFromCwd = createRequire2(join9(process.cwd(), "package.json"));
|
|
4927
4947
|
styleDependencyGraph = new Map;
|
|
4928
4948
|
styleOutputHashes = new Map;
|
|
4929
4949
|
stylePreprocessorPlugin = createStylePreprocessorPlugin();
|
|
@@ -6334,15 +6354,14 @@ var init_missingReactRouter = __esm(() => {
|
|
|
6334
6354
|
// src/build/scanRouteRegistrations.ts
|
|
6335
6355
|
import { readdirSync as readdirSync2, readFileSync as readFileSync12 } from "fs";
|
|
6336
6356
|
import { join as join17 } from "path";
|
|
6337
|
-
import ts2 from "typescript";
|
|
6338
6357
|
var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePath) => {
|
|
6339
6358
|
if (filePath.endsWith(".tsx"))
|
|
6340
|
-
return
|
|
6359
|
+
return lazyTypescript.ScriptKind.TSX;
|
|
6341
6360
|
if (filePath.endsWith(".mts"))
|
|
6342
|
-
return
|
|
6361
|
+
return lazyTypescript.ScriptKind.TS;
|
|
6343
6362
|
if (filePath.endsWith(".cts"))
|
|
6344
|
-
return
|
|
6345
|
-
return
|
|
6363
|
+
return lazyTypescript.ScriptKind.TS;
|
|
6364
|
+
return lazyTypescript.ScriptKind.TS;
|
|
6346
6365
|
}, hasSourceExtension = (filePath) => {
|
|
6347
6366
|
const idx = filePath.lastIndexOf(".");
|
|
6348
6367
|
if (idx === -1)
|
|
@@ -6392,15 +6411,15 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
6392
6411
|
}
|
|
6393
6412
|
if (!fileMayContainRouteRegistrations(source))
|
|
6394
6413
|
return;
|
|
6395
|
-
const sf =
|
|
6414
|
+
const sf = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, getScriptKind(filePath));
|
|
6396
6415
|
const visit = (node) => {
|
|
6397
|
-
if (
|
|
6416
|
+
if (lazyTypescript.isCallExpression(node)) {
|
|
6398
6417
|
const callee = node.expression;
|
|
6399
|
-
if (
|
|
6418
|
+
if (lazyTypescript.isPropertyAccessExpression(callee) && lazyTypescript.isIdentifier(callee.name)) {
|
|
6400
6419
|
const methodName = callee.name.text;
|
|
6401
6420
|
if (ELYSIA_ROUTE_METHODS.has(methodName)) {
|
|
6402
6421
|
const firstArg = node.arguments[0];
|
|
6403
|
-
if (firstArg &&
|
|
6422
|
+
if (firstArg && lazyTypescript.isStringLiteral(firstArg) && firstArg.text.startsWith("/")) {
|
|
6404
6423
|
const argTexts = [];
|
|
6405
6424
|
for (let i = 1;i < node.arguments.length; i++) {
|
|
6406
6425
|
const arg = node.arguments[i];
|
|
@@ -6417,9 +6436,9 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
6417
6436
|
}
|
|
6418
6437
|
}
|
|
6419
6438
|
}
|
|
6420
|
-
|
|
6439
|
+
lazyTypescript.forEachChild(node, visit);
|
|
6421
6440
|
};
|
|
6422
|
-
|
|
6441
|
+
lazyTypescript.forEachChild(sf, visit);
|
|
6423
6442
|
}, scanRouteRegistrations = (projectRoot) => {
|
|
6424
6443
|
const files = collectSourceFiles(projectRoot);
|
|
6425
6444
|
const collected = [];
|
|
@@ -6429,6 +6448,7 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
6429
6448
|
return collected;
|
|
6430
6449
|
};
|
|
6431
6450
|
var init_scanRouteRegistrations = __esm(() => {
|
|
6451
|
+
init_lazyTypescript();
|
|
6432
6452
|
ELYSIA_ROUTE_METHODS = new Set([
|
|
6433
6453
|
"all",
|
|
6434
6454
|
"delete",
|
|
@@ -6694,17 +6714,16 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
6694
6714
|
// src/angular/staticAnalyzeSpaRoutes.ts
|
|
6695
6715
|
import { existsSync as existsSync13, promises as fs } from "fs";
|
|
6696
6716
|
import { join as join18 } from "path";
|
|
6697
|
-
import ts3 from "typescript";
|
|
6698
6717
|
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (sourceFile, localName, moduleSpecifier) => {
|
|
6699
6718
|
for (const statement of sourceFile.statements) {
|
|
6700
|
-
if (!
|
|
6719
|
+
if (!lazyTypescript.isImportDeclaration(statement))
|
|
6701
6720
|
continue;
|
|
6702
|
-
if (!
|
|
6721
|
+
if (!lazyTypescript.isStringLiteral(statement.moduleSpecifier))
|
|
6703
6722
|
continue;
|
|
6704
6723
|
if (statement.moduleSpecifier.text !== moduleSpecifier)
|
|
6705
6724
|
continue;
|
|
6706
6725
|
const named = statement.importClause?.namedBindings;
|
|
6707
|
-
if (!named || !
|
|
6726
|
+
if (!named || !lazyTypescript.isNamedImports(named))
|
|
6708
6727
|
continue;
|
|
6709
6728
|
for (const element of named.elements) {
|
|
6710
6729
|
if (element.name.text === localName)
|
|
@@ -6713,17 +6732,17 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6713
6732
|
}
|
|
6714
6733
|
return false;
|
|
6715
6734
|
}, readStringLiteral = (expression) => {
|
|
6716
|
-
if (
|
|
6735
|
+
if (lazyTypescript.isStringLiteral(expression) || lazyTypescript.isNoSubstitutionTemplateLiteral(expression)) {
|
|
6717
6736
|
return expression.text;
|
|
6718
6737
|
}
|
|
6719
6738
|
return null;
|
|
6720
6739
|
}, readPropertyKey = (property) => {
|
|
6721
|
-
if (
|
|
6740
|
+
if (lazyTypescript.isPropertyAssignment(property)) {
|
|
6722
6741
|
const { name } = property;
|
|
6723
|
-
if (
|
|
6742
|
+
if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name))
|
|
6724
6743
|
return name.text;
|
|
6725
6744
|
}
|
|
6726
|
-
if (
|
|
6745
|
+
if (lazyTypescript.isShorthandPropertyAssignment(property)) {
|
|
6727
6746
|
return property.name.text;
|
|
6728
6747
|
}
|
|
6729
6748
|
return null;
|
|
@@ -6732,20 +6751,20 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6732
6751
|
const visit = (node) => {
|
|
6733
6752
|
if (found)
|
|
6734
6753
|
return;
|
|
6735
|
-
if (
|
|
6754
|
+
if (lazyTypescript.isVariableDeclaration(node) && lazyTypescript.isIdentifier(node.name) && node.name.text === identifierName && node.initializer && lazyTypescript.isArrayLiteralExpression(node.initializer)) {
|
|
6736
6755
|
found = node.initializer;
|
|
6737
6756
|
return;
|
|
6738
6757
|
}
|
|
6739
|
-
|
|
6758
|
+
lazyTypescript.forEachChild(node, visit);
|
|
6740
6759
|
};
|
|
6741
|
-
|
|
6760
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
6742
6761
|
return found;
|
|
6743
6762
|
}, extractSitemapData = (dataLiteral) => {
|
|
6744
6763
|
for (const prop of dataLiteral.properties) {
|
|
6745
6764
|
const key = readPropertyKey(prop);
|
|
6746
6765
|
if (key !== "sitemap")
|
|
6747
6766
|
continue;
|
|
6748
|
-
if (!
|
|
6767
|
+
if (!lazyTypescript.isPropertyAssignment(prop))
|
|
6749
6768
|
continue;
|
|
6750
6769
|
const value = readStringLiteral(prop.initializer);
|
|
6751
6770
|
if (value === "exclude")
|
|
@@ -6760,7 +6779,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6760
6779
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
6761
6780
|
}, extractRoutePaths = (routeArray, parentPath, parentExcluded, routes) => {
|
|
6762
6781
|
for (const element of routeArray.elements) {
|
|
6763
|
-
if (!
|
|
6782
|
+
if (!lazyTypescript.isObjectLiteralExpression(element))
|
|
6764
6783
|
continue;
|
|
6765
6784
|
let pathSegment = null;
|
|
6766
6785
|
let redirected = false;
|
|
@@ -6770,16 +6789,16 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6770
6789
|
const key = readPropertyKey(property);
|
|
6771
6790
|
if (!key)
|
|
6772
6791
|
continue;
|
|
6773
|
-
if (!
|
|
6792
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
6774
6793
|
continue;
|
|
6775
6794
|
if (key === "path") {
|
|
6776
6795
|
pathSegment = readStringLiteral(property.initializer);
|
|
6777
6796
|
} else if (key === "redirectTo") {
|
|
6778
6797
|
redirected = true;
|
|
6779
|
-
} else if (key === "data" &&
|
|
6798
|
+
} else if (key === "data" && lazyTypescript.isObjectLiteralExpression(property.initializer)) {
|
|
6780
6799
|
if (extractSitemapData(property.initializer))
|
|
6781
6800
|
sitemapExcluded = true;
|
|
6782
|
-
} else if (key === "children" &&
|
|
6801
|
+
} else if (key === "children" && lazyTypescript.isArrayLiteralExpression(property.initializer)) {
|
|
6783
6802
|
childrenLiteral = property.initializer;
|
|
6784
6803
|
}
|
|
6785
6804
|
}
|
|
@@ -6804,29 +6823,29 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6804
6823
|
const visit = (node) => {
|
|
6805
6824
|
if (result.found)
|
|
6806
6825
|
return;
|
|
6807
|
-
if (
|
|
6826
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "provideRouter") {
|
|
6808
6827
|
result.found = node.arguments[0] ?? null;
|
|
6809
6828
|
return;
|
|
6810
6829
|
}
|
|
6811
|
-
|
|
6830
|
+
lazyTypescript.forEachChild(node, visit);
|
|
6812
6831
|
};
|
|
6813
|
-
|
|
6832
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
6814
6833
|
return result.found;
|
|
6815
6834
|
}, findAppBaseHrefValue = (sourceFile) => {
|
|
6816
6835
|
let found = null;
|
|
6817
6836
|
const visit = (node) => {
|
|
6818
6837
|
if (found)
|
|
6819
6838
|
return;
|
|
6820
|
-
if (
|
|
6839
|
+
if (lazyTypescript.isObjectLiteralExpression(node)) {
|
|
6821
6840
|
let isAppBaseHref = false;
|
|
6822
6841
|
let value = null;
|
|
6823
6842
|
for (const property of node.properties) {
|
|
6824
6843
|
const key = readPropertyKey(property);
|
|
6825
6844
|
if (!key)
|
|
6826
6845
|
continue;
|
|
6827
|
-
if (!
|
|
6846
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
6828
6847
|
continue;
|
|
6829
|
-
if (key === "provide" &&
|
|
6848
|
+
if (key === "provide" && lazyTypescript.isIdentifier(property.initializer) && property.initializer.text === "APP_BASE_HREF") {
|
|
6830
6849
|
isAppBaseHref = true;
|
|
6831
6850
|
} else if (key === "useValue") {
|
|
6832
6851
|
value = readStringLiteral(property.initializer);
|
|
@@ -6837,9 +6856,9 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6837
6856
|
return;
|
|
6838
6857
|
}
|
|
6839
6858
|
}
|
|
6840
|
-
|
|
6859
|
+
lazyTypescript.forEachChild(node, visit);
|
|
6841
6860
|
};
|
|
6842
|
-
|
|
6861
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
6843
6862
|
return found;
|
|
6844
6863
|
}, analyzeFile = async (filePath) => {
|
|
6845
6864
|
let source;
|
|
@@ -6851,7 +6870,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6851
6870
|
if (!source.includes("APP_BASE_HREF") || !source.includes("provideRouter")) {
|
|
6852
6871
|
return null;
|
|
6853
6872
|
}
|
|
6854
|
-
const sourceFile =
|
|
6873
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
6855
6874
|
if (!importsSymbolFrom(sourceFile, "APP_BASE_HREF", "@angular/common"))
|
|
6856
6875
|
return null;
|
|
6857
6876
|
if (!importsSymbolFrom(sourceFile, "provideRouter", "@angular/router"))
|
|
@@ -6863,9 +6882,9 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6863
6882
|
if (!firstArg)
|
|
6864
6883
|
return null;
|
|
6865
6884
|
let routesArray = null;
|
|
6866
|
-
if (
|
|
6885
|
+
if (lazyTypescript.isIdentifier(firstArg)) {
|
|
6867
6886
|
routesArray = findRoutesArrayDeclaration(sourceFile, firstArg.text);
|
|
6868
|
-
} else if (
|
|
6887
|
+
} else if (lazyTypescript.isArrayLiteralExpression(firstArg)) {
|
|
6869
6888
|
routesArray = firstArg;
|
|
6870
6889
|
}
|
|
6871
6890
|
if (!routesArray)
|
|
@@ -6916,38 +6935,38 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
6916
6935
|
return pages;
|
|
6917
6936
|
};
|
|
6918
6937
|
var init_staticAnalyzeSpaRoutes = __esm(() => {
|
|
6938
|
+
init_lazyTypescript();
|
|
6919
6939
|
DYNAMIC_SEGMENT_PATTERN = /^[:*]/;
|
|
6920
6940
|
});
|
|
6921
6941
|
|
|
6922
6942
|
// src/react/staticAnalyzeSpaRoutes.ts
|
|
6923
6943
|
import { existsSync as existsSync14, promises as fs2 } from "fs";
|
|
6924
6944
|
import { join as join19 } from "path";
|
|
6925
|
-
import ts4 from "typescript";
|
|
6926
6945
|
var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN2.test(seg) || seg === "**"), readStringLiteral2 = (expression) => {
|
|
6927
|
-
if (
|
|
6946
|
+
if (lazyTypescript.isStringLiteral(expression) || lazyTypescript.isNoSubstitutionTemplateLiteral(expression)) {
|
|
6928
6947
|
return expression.text;
|
|
6929
6948
|
}
|
|
6930
6949
|
return null;
|
|
6931
6950
|
}, readPropertyKey2 = (property) => {
|
|
6932
|
-
if (
|
|
6951
|
+
if (lazyTypescript.isPropertyAssignment(property)) {
|
|
6933
6952
|
const { name } = property;
|
|
6934
|
-
if (
|
|
6953
|
+
if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name))
|
|
6935
6954
|
return name.text;
|
|
6936
6955
|
}
|
|
6937
|
-
if (
|
|
6956
|
+
if (lazyTypescript.isShorthandPropertyAssignment(property)) {
|
|
6938
6957
|
return property.name.text;
|
|
6939
6958
|
}
|
|
6940
6959
|
return null;
|
|
6941
6960
|
}, importsSymbolFromAny = (sourceFile, localName, moduleSpecifiers) => {
|
|
6942
6961
|
for (const statement of sourceFile.statements) {
|
|
6943
|
-
if (!
|
|
6962
|
+
if (!lazyTypescript.isImportDeclaration(statement))
|
|
6944
6963
|
continue;
|
|
6945
|
-
if (!
|
|
6964
|
+
if (!lazyTypescript.isStringLiteral(statement.moduleSpecifier))
|
|
6946
6965
|
continue;
|
|
6947
6966
|
if (!moduleSpecifiers.includes(statement.moduleSpecifier.text))
|
|
6948
6967
|
continue;
|
|
6949
6968
|
const named = statement.importClause?.namedBindings;
|
|
6950
|
-
if (!named || !
|
|
6969
|
+
if (!named || !lazyTypescript.isNamedImports(named))
|
|
6951
6970
|
continue;
|
|
6952
6971
|
for (const element of named.elements) {
|
|
6953
6972
|
if (element.name.text === localName)
|
|
@@ -6960,13 +6979,13 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
6960
6979
|
const visit = (node) => {
|
|
6961
6980
|
if (found)
|
|
6962
6981
|
return;
|
|
6963
|
-
if (
|
|
6982
|
+
if (lazyTypescript.isVariableDeclaration(node) && lazyTypescript.isIdentifier(node.name) && node.name.text === identifierName && node.initializer && lazyTypescript.isArrayLiteralExpression(node.initializer)) {
|
|
6964
6983
|
found = node.initializer;
|
|
6965
6984
|
return;
|
|
6966
6985
|
}
|
|
6967
|
-
|
|
6986
|
+
lazyTypescript.forEachChild(node, visit);
|
|
6968
6987
|
};
|
|
6969
|
-
|
|
6988
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
6970
6989
|
return found;
|
|
6971
6990
|
}, joinSegments2 = (parent, child) => {
|
|
6972
6991
|
if (!child)
|
|
@@ -6976,7 +6995,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
6976
6995
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
6977
6996
|
}, extractRouteEntries = (routeArray, parentPath, routes) => {
|
|
6978
6997
|
for (const element of routeArray.elements) {
|
|
6979
|
-
if (!
|
|
6998
|
+
if (!lazyTypescript.isObjectLiteralExpression(element))
|
|
6980
6999
|
continue;
|
|
6981
7000
|
let pathSegment = null;
|
|
6982
7001
|
let redirected = false;
|
|
@@ -6987,22 +7006,22 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
6987
7006
|
const key = readPropertyKey2(property);
|
|
6988
7007
|
if (!key)
|
|
6989
7008
|
continue;
|
|
6990
|
-
if (!
|
|
7009
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
6991
7010
|
continue;
|
|
6992
7011
|
if (key === "path") {
|
|
6993
7012
|
pathSegment = readStringLiteral2(property.initializer);
|
|
6994
7013
|
} else if (key === "index") {
|
|
6995
7014
|
isIndex = true;
|
|
6996
|
-
} else if (key === "loader" || key === "lazy") {} else if (key === "children" &&
|
|
7015
|
+
} else if (key === "loader" || key === "lazy") {} else if (key === "children" && lazyTypescript.isArrayLiteralExpression(property.initializer)) {
|
|
6997
7016
|
childrenLiteral = property.initializer;
|
|
6998
7017
|
} else if (key === "redirectTo") {
|
|
6999
7018
|
redirected = true;
|
|
7000
|
-
} else if (key === "handle" &&
|
|
7019
|
+
} else if (key === "handle" && lazyTypescript.isObjectLiteralExpression(property.initializer)) {
|
|
7001
7020
|
for (const handleProp of property.initializer.properties) {
|
|
7002
7021
|
const handleKey = readPropertyKey2(handleProp);
|
|
7003
7022
|
if (handleKey !== "sitemap")
|
|
7004
7023
|
continue;
|
|
7005
|
-
if (!
|
|
7024
|
+
if (!lazyTypescript.isPropertyAssignment(handleProp))
|
|
7006
7025
|
continue;
|
|
7007
7026
|
const value = readStringLiteral2(handleProp.initializer);
|
|
7008
7027
|
if (value === "exclude")
|
|
@@ -7032,22 +7051,22 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
7032
7051
|
const visit = (node) => {
|
|
7033
7052
|
if (result.found)
|
|
7034
7053
|
return;
|
|
7035
|
-
if (
|
|
7054
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "createBrowserRouter") {
|
|
7036
7055
|
result.found = node;
|
|
7037
7056
|
return;
|
|
7038
7057
|
}
|
|
7039
|
-
|
|
7058
|
+
lazyTypescript.forEachChild(node, visit);
|
|
7040
7059
|
};
|
|
7041
|
-
|
|
7060
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
7042
7061
|
return result.found;
|
|
7043
7062
|
}, readBasenameFromOptions = (expression) => {
|
|
7044
|
-
if (!expression || !
|
|
7063
|
+
if (!expression || !lazyTypescript.isObjectLiteralExpression(expression))
|
|
7045
7064
|
return null;
|
|
7046
7065
|
for (const property of expression.properties) {
|
|
7047
7066
|
const key = readPropertyKey2(property);
|
|
7048
7067
|
if (key !== "basename")
|
|
7049
7068
|
continue;
|
|
7050
|
-
if (!
|
|
7069
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
7051
7070
|
continue;
|
|
7052
7071
|
const value = readStringLiteral2(property.initializer);
|
|
7053
7072
|
if (value !== null)
|
|
@@ -7063,7 +7082,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
7063
7082
|
}
|
|
7064
7083
|
if (!source.includes("createBrowserRouter"))
|
|
7065
7084
|
return null;
|
|
7066
|
-
const sourceFile =
|
|
7085
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, filePath.endsWith(".tsx") ? lazyTypescript.ScriptKind.TSX : lazyTypescript.ScriptKind.TS);
|
|
7067
7086
|
if (!importsSymbolFromAny(sourceFile, "createBrowserRouter", [
|
|
7068
7087
|
"react-router-dom",
|
|
7069
7088
|
"react-router"
|
|
@@ -7077,9 +7096,9 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
7077
7096
|
if (!routesArg)
|
|
7078
7097
|
return null;
|
|
7079
7098
|
let routesArray = null;
|
|
7080
|
-
if (
|
|
7099
|
+
if (lazyTypescript.isArrayLiteralExpression(routesArg)) {
|
|
7081
7100
|
routesArray = routesArg;
|
|
7082
|
-
} else if (
|
|
7101
|
+
} else if (lazyTypescript.isIdentifier(routesArg)) {
|
|
7083
7102
|
routesArray = findVariableArrayDeclaration(sourceFile, routesArg.text);
|
|
7084
7103
|
}
|
|
7085
7104
|
if (!routesArray)
|
|
@@ -7126,6 +7145,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
7126
7145
|
return hosts;
|
|
7127
7146
|
};
|
|
7128
7147
|
var init_staticAnalyzeSpaRoutes2 = __esm(() => {
|
|
7148
|
+
init_lazyTypescript();
|
|
7129
7149
|
DYNAMIC_SEGMENT_PATTERN2 = /^[:*]/;
|
|
7130
7150
|
});
|
|
7131
7151
|
|
|
@@ -7261,32 +7281,31 @@ var init_staticAnalyzeSpaRoutes3 = __esm(() => {
|
|
|
7261
7281
|
// src/vue/staticAnalyzeSpaRoutes.ts
|
|
7262
7282
|
import { existsSync as existsSync16, promises as fs4 } from "fs";
|
|
7263
7283
|
import { join as join21 } from "path";
|
|
7264
|
-
import ts5 from "typescript";
|
|
7265
7284
|
var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN4.test(seg) || seg === "**"), readStringLiteral3 = (expression) => {
|
|
7266
|
-
if (
|
|
7285
|
+
if (lazyTypescript.isStringLiteral(expression) || lazyTypescript.isNoSubstitutionTemplateLiteral(expression)) {
|
|
7267
7286
|
return expression.text;
|
|
7268
7287
|
}
|
|
7269
7288
|
return null;
|
|
7270
7289
|
}, readPropertyKey3 = (property) => {
|
|
7271
|
-
if (
|
|
7290
|
+
if (lazyTypescript.isPropertyAssignment(property)) {
|
|
7272
7291
|
const { name } = property;
|
|
7273
|
-
if (
|
|
7292
|
+
if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name))
|
|
7274
7293
|
return name.text;
|
|
7275
7294
|
}
|
|
7276
|
-
if (
|
|
7295
|
+
if (lazyTypescript.isShorthandPropertyAssignment(property)) {
|
|
7277
7296
|
return property.name.text;
|
|
7278
7297
|
}
|
|
7279
7298
|
return null;
|
|
7280
7299
|
}, importsSymbolFrom2 = (sourceFile, localName, moduleSpecifier) => {
|
|
7281
7300
|
for (const statement of sourceFile.statements) {
|
|
7282
|
-
if (!
|
|
7301
|
+
if (!lazyTypescript.isImportDeclaration(statement))
|
|
7283
7302
|
continue;
|
|
7284
|
-
if (!
|
|
7303
|
+
if (!lazyTypescript.isStringLiteral(statement.moduleSpecifier))
|
|
7285
7304
|
continue;
|
|
7286
7305
|
if (statement.moduleSpecifier.text !== moduleSpecifier)
|
|
7287
7306
|
continue;
|
|
7288
7307
|
const named = statement.importClause?.namedBindings;
|
|
7289
|
-
if (!named || !
|
|
7308
|
+
if (!named || !lazyTypescript.isNamedImports(named))
|
|
7290
7309
|
continue;
|
|
7291
7310
|
for (const element of named.elements) {
|
|
7292
7311
|
if (element.name.text === localName)
|
|
@@ -7299,13 +7318,13 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7299
7318
|
const visit = (node) => {
|
|
7300
7319
|
if (found)
|
|
7301
7320
|
return;
|
|
7302
|
-
if (
|
|
7321
|
+
if (lazyTypescript.isVariableDeclaration(node) && lazyTypescript.isIdentifier(node.name) && node.name.text === identifierName && node.initializer && lazyTypescript.isArrayLiteralExpression(node.initializer)) {
|
|
7303
7322
|
found = node.initializer;
|
|
7304
7323
|
return;
|
|
7305
7324
|
}
|
|
7306
|
-
|
|
7325
|
+
lazyTypescript.forEachChild(node, visit);
|
|
7307
7326
|
};
|
|
7308
|
-
|
|
7327
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
7309
7328
|
return found;
|
|
7310
7329
|
}, joinSegments4 = (parent, child) => {
|
|
7311
7330
|
if (!child)
|
|
@@ -7315,7 +7334,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7315
7334
|
return `${parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}`;
|
|
7316
7335
|
}, extractRouteEntries2 = (routeArray, parentPath, routes) => {
|
|
7317
7336
|
for (const element of routeArray.elements) {
|
|
7318
|
-
if (!
|
|
7337
|
+
if (!lazyTypescript.isObjectLiteralExpression(element))
|
|
7319
7338
|
continue;
|
|
7320
7339
|
let pathSegment = null;
|
|
7321
7340
|
let redirected = false;
|
|
@@ -7326,7 +7345,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7326
7345
|
const key = readPropertyKey3(property);
|
|
7327
7346
|
if (!key)
|
|
7328
7347
|
continue;
|
|
7329
|
-
if (!
|
|
7348
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
7330
7349
|
continue;
|
|
7331
7350
|
if (key === "path") {
|
|
7332
7351
|
pathSegment = readStringLiteral3(property.initializer);
|
|
@@ -7334,14 +7353,14 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7334
7353
|
alias = readStringLiteral3(property.initializer);
|
|
7335
7354
|
} else if (key === "redirect") {
|
|
7336
7355
|
redirected = true;
|
|
7337
|
-
} else if (key === "children" &&
|
|
7356
|
+
} else if (key === "children" && lazyTypescript.isArrayLiteralExpression(property.initializer)) {
|
|
7338
7357
|
childrenLiteral = property.initializer;
|
|
7339
|
-
} else if (key === "meta" &&
|
|
7358
|
+
} else if (key === "meta" && lazyTypescript.isObjectLiteralExpression(property.initializer)) {
|
|
7340
7359
|
for (const metaProp of property.initializer.properties) {
|
|
7341
7360
|
const metaKey = readPropertyKey3(metaProp);
|
|
7342
7361
|
if (metaKey !== "sitemap")
|
|
7343
7362
|
continue;
|
|
7344
|
-
if (!
|
|
7363
|
+
if (!lazyTypescript.isPropertyAssignment(metaProp))
|
|
7345
7364
|
continue;
|
|
7346
7365
|
const value = readStringLiteral3(metaProp.initializer);
|
|
7347
7366
|
if (value === "exclude")
|
|
@@ -7378,16 +7397,16 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7378
7397
|
const visit = (node) => {
|
|
7379
7398
|
if (found)
|
|
7380
7399
|
return;
|
|
7381
|
-
if (
|
|
7400
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "defineRoutes") {
|
|
7382
7401
|
const [routesArgument] = node.arguments;
|
|
7383
|
-
if (!routesArgument || !
|
|
7402
|
+
if (!routesArgument || !lazyTypescript.isArrayLiteralExpression(routesArgument))
|
|
7384
7403
|
return;
|
|
7385
7404
|
found = routesArgument;
|
|
7386
7405
|
return;
|
|
7387
7406
|
}
|
|
7388
|
-
|
|
7407
|
+
lazyTypescript.forEachChild(node, visit);
|
|
7389
7408
|
};
|
|
7390
|
-
|
|
7409
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
7391
7410
|
return found;
|
|
7392
7411
|
}, inferBaseHref = (routes) => {
|
|
7393
7412
|
const firstSegments = routes.map((route) => route.path.split("/").filter(Boolean)[0]).filter((segment) => Boolean(segment));
|
|
@@ -7400,20 +7419,20 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7400
7419
|
const visit = (node) => {
|
|
7401
7420
|
if (result.found)
|
|
7402
7421
|
return;
|
|
7403
|
-
if (
|
|
7422
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "createRouter") {
|
|
7404
7423
|
result.found = node;
|
|
7405
7424
|
return;
|
|
7406
7425
|
}
|
|
7407
|
-
|
|
7426
|
+
lazyTypescript.forEachChild(node, visit);
|
|
7408
7427
|
};
|
|
7409
|
-
|
|
7428
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
7410
7429
|
return result.found;
|
|
7411
7430
|
}, findCreateWebHistoryBase = (sourceFile) => {
|
|
7412
7431
|
let found = null;
|
|
7413
7432
|
const visit = (node) => {
|
|
7414
7433
|
if (found)
|
|
7415
7434
|
return;
|
|
7416
|
-
if (
|
|
7435
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && (node.expression.text === "createWebHistory" || node.expression.text === "createWebHashHistory")) {
|
|
7417
7436
|
const [baseArg] = node.arguments;
|
|
7418
7437
|
if (baseArg) {
|
|
7419
7438
|
const text = readStringLiteral3(baseArg);
|
|
@@ -7426,26 +7445,26 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7426
7445
|
return;
|
|
7427
7446
|
}
|
|
7428
7447
|
}
|
|
7429
|
-
|
|
7448
|
+
lazyTypescript.forEachChild(node, visit);
|
|
7430
7449
|
};
|
|
7431
|
-
|
|
7450
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
7432
7451
|
return found;
|
|
7433
7452
|
}, readRoutesFromCreateRouterOptions = (sourceFile, optionsExpr) => {
|
|
7434
|
-
if (!
|
|
7453
|
+
if (!lazyTypescript.isObjectLiteralExpression(optionsExpr))
|
|
7435
7454
|
return null;
|
|
7436
7455
|
for (const property of optionsExpr.properties) {
|
|
7437
7456
|
const key = readPropertyKey3(property);
|
|
7438
7457
|
if (key !== "routes")
|
|
7439
7458
|
continue;
|
|
7440
|
-
if (
|
|
7459
|
+
if (lazyTypescript.isShorthandPropertyAssignment(property)) {
|
|
7441
7460
|
return findVariableArrayDeclaration2(sourceFile, property.name.text);
|
|
7442
7461
|
}
|
|
7443
|
-
if (!
|
|
7462
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
7444
7463
|
continue;
|
|
7445
|
-
if (
|
|
7464
|
+
if (lazyTypescript.isArrayLiteralExpression(property.initializer)) {
|
|
7446
7465
|
return property.initializer;
|
|
7447
7466
|
}
|
|
7448
|
-
if (
|
|
7467
|
+
if (lazyTypescript.isIdentifier(property.initializer)) {
|
|
7449
7468
|
return findVariableArrayDeclaration2(sourceFile, property.initializer.text);
|
|
7450
7469
|
}
|
|
7451
7470
|
}
|
|
@@ -7470,7 +7489,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7470
7489
|
}
|
|
7471
7490
|
if (!analysisSource.includes("createRouter") && !analysisSource.includes("defineRoutes"))
|
|
7472
7491
|
return null;
|
|
7473
|
-
const sourceFile =
|
|
7492
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, analysisSource, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
7474
7493
|
const defineRoutesArray = findDefineRoutesArray(sourceFile);
|
|
7475
7494
|
const call = importsSymbolFrom2(sourceFile, "createRouter", "vue-router") ? findCreateRouterCall(sourceFile) : null;
|
|
7476
7495
|
const [optionsArg] = call?.arguments ?? [];
|
|
@@ -7519,6 +7538,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
7519
7538
|
return hosts;
|
|
7520
7539
|
};
|
|
7521
7540
|
var init_staticAnalyzeSpaRoutes4 = __esm(() => {
|
|
7541
|
+
init_lazyTypescript();
|
|
7522
7542
|
DYNAMIC_SEGMENT_PATTERN4 = /^[:*]/;
|
|
7523
7543
|
});
|
|
7524
7544
|
|
|
@@ -13925,15 +13945,14 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
13925
13945
|
|
|
13926
13946
|
// src/build/bunStringRawUnicodePlugin.ts
|
|
13927
13947
|
import { extname as extname12 } from "path";
|
|
13928
|
-
import ts6 from "typescript";
|
|
13929
13948
|
var NON_ASCII, getScriptKind2 = (filePath) => {
|
|
13930
13949
|
if (/\.[cm]?tsx$/.test(filePath))
|
|
13931
|
-
return
|
|
13950
|
+
return lazyTypescript.ScriptKind.TSX;
|
|
13932
13951
|
if (/\.[cm]?jsx$/.test(filePath))
|
|
13933
|
-
return
|
|
13952
|
+
return lazyTypescript.ScriptKind.JSX;
|
|
13934
13953
|
if (/\.[cm]?ts$/.test(filePath))
|
|
13935
|
-
return
|
|
13936
|
-
return
|
|
13954
|
+
return lazyTypescript.ScriptKind.TS;
|
|
13955
|
+
return lazyTypescript.ScriptKind.JS;
|
|
13937
13956
|
}, getLoader = (filePath) => {
|
|
13938
13957
|
const extension = extname12(filePath);
|
|
13939
13958
|
if (extension === ".tsx")
|
|
@@ -13944,19 +13963,19 @@ var NON_ASCII, getScriptKind2 = (filePath) => {
|
|
|
13944
13963
|
return "ts";
|
|
13945
13964
|
}
|
|
13946
13965
|
return "js";
|
|
13947
|
-
}, isStringRawTag = (node) =>
|
|
13966
|
+
}, isStringRawTag = (node) => lazyTypescript.isPropertyAccessExpression(node.tag) && lazyTypescript.isIdentifier(node.tag.expression) && node.tag.expression.text === "String" && node.tag.name.text === "raw", getRawText = (node) => node.rawText ?? node.text, rewriteBunStringRawUnicode = (source, filePath = "input.ts") => {
|
|
13948
13967
|
if (!source.includes("String.raw") || !NON_ASCII.test(source))
|
|
13949
13968
|
return source;
|
|
13950
|
-
const sourceFile =
|
|
13969
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, getScriptKind2(filePath));
|
|
13951
13970
|
const replacements = [];
|
|
13952
13971
|
const visit = (node) => {
|
|
13953
|
-
if (
|
|
13954
|
-
const rawSegments =
|
|
13972
|
+
if (lazyTypescript.isTaggedTemplateExpression(node) && isStringRawTag(node)) {
|
|
13973
|
+
const rawSegments = lazyTypescript.isNoSubstitutionTemplateLiteral(node.template) ? [getRawText(node.template)] : [
|
|
13955
13974
|
getRawText(node.template.head),
|
|
13956
13975
|
...node.template.templateSpans.map((span) => getRawText(span.literal))
|
|
13957
13976
|
];
|
|
13958
13977
|
if (rawSegments.some((segment) => NON_ASCII.test(segment))) {
|
|
13959
|
-
const expressions =
|
|
13978
|
+
const expressions = lazyTypescript.isTemplateExpression(node.template) ? node.template.templateSpans.map((span) => {
|
|
13960
13979
|
const expression = source.slice(span.expression.getStart(sourceFile), span.expression.end);
|
|
13961
13980
|
return rewriteBunStringRawUnicode(expression, filePath);
|
|
13962
13981
|
}) : [];
|
|
@@ -13972,7 +13991,7 @@ var NON_ASCII, getScriptKind2 = (filePath) => {
|
|
|
13972
13991
|
return;
|
|
13973
13992
|
}
|
|
13974
13993
|
}
|
|
13975
|
-
|
|
13994
|
+
lazyTypescript.forEachChild(node, visit);
|
|
13976
13995
|
};
|
|
13977
13996
|
visit(sourceFile);
|
|
13978
13997
|
let result = source;
|
|
@@ -13995,6 +14014,7 @@ var NON_ASCII, getScriptKind2 = (filePath) => {
|
|
|
13995
14014
|
}
|
|
13996
14015
|
});
|
|
13997
14016
|
var init_bunStringRawUnicodePlugin = __esm(() => {
|
|
14017
|
+
init_lazyTypescript();
|
|
13998
14018
|
NON_ASCII = /[^\x00-\x7f]/;
|
|
13999
14019
|
});
|
|
14000
14020
|
|
|
@@ -14039,25 +14059,24 @@ var init_externalAssetPlugin = () => {};
|
|
|
14039
14059
|
|
|
14040
14060
|
// src/build/islandRegistryTransform.ts
|
|
14041
14061
|
import { basename as basename10 } from "path";
|
|
14042
|
-
|
|
14043
|
-
var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name) || ts7.isStringLiteral(name) ? name.text : null, isIslandRegistryHelperImport2 = (source) => source === "@absolutejs/absolute/islands" || source.endsWith("/islands") || source.endsWith("/core/islands"), collectRegistryFactory = (sourceFile) => {
|
|
14062
|
+
var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name) ? name.text : null, isIslandRegistryHelperImport2 = (source) => source === "@absolutejs/absolute/islands" || source.endsWith("/islands") || source.endsWith("/core/islands"), collectRegistryFactory = (sourceFile) => {
|
|
14044
14063
|
const factoryNames = new Set;
|
|
14045
14064
|
const namespaceNames = new Set;
|
|
14046
14065
|
for (const statement of sourceFile.statements) {
|
|
14047
|
-
if (!
|
|
14066
|
+
if (!lazyTypescript.isImportDeclaration(statement))
|
|
14048
14067
|
continue;
|
|
14049
|
-
if (!
|
|
14068
|
+
if (!lazyTypescript.isStringLiteral(statement.moduleSpecifier))
|
|
14050
14069
|
continue;
|
|
14051
14070
|
if (!isIslandRegistryHelperImport2(statement.moduleSpecifier.text))
|
|
14052
14071
|
continue;
|
|
14053
14072
|
const bindings = statement.importClause?.namedBindings;
|
|
14054
14073
|
if (!bindings)
|
|
14055
14074
|
continue;
|
|
14056
|
-
if (
|
|
14075
|
+
if (lazyTypescript.isNamespaceImport(bindings)) {
|
|
14057
14076
|
namespaceNames.add(bindings.name.text);
|
|
14058
14077
|
continue;
|
|
14059
14078
|
}
|
|
14060
|
-
if (!
|
|
14079
|
+
if (!lazyTypescript.isNamedImports(bindings))
|
|
14061
14080
|
continue;
|
|
14062
14081
|
for (const element of bindings.elements) {
|
|
14063
14082
|
const imported = element.propertyName?.text ?? element.name.text;
|
|
@@ -14068,20 +14087,20 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name)
|
|
|
14068
14087
|
}
|
|
14069
14088
|
return { factoryNames, namespaceNames };
|
|
14070
14089
|
}, isDefineIslandRegistryCall2 = (expression, factoryNames, namespaceNames) => {
|
|
14071
|
-
if (
|
|
14090
|
+
if (lazyTypescript.isIdentifier(expression))
|
|
14072
14091
|
return factoryNames.has(expression.text);
|
|
14073
|
-
return
|
|
14092
|
+
return lazyTypescript.isPropertyAccessExpression(expression) && expression.name.text === "defineIslandRegistry" && lazyTypescript.isIdentifier(expression.expression) && namespaceNames.has(expression.expression.text);
|
|
14074
14093
|
}, findDefineIslandRegistryCall = (sourceFile, factoryNames, namespaceNames) => {
|
|
14075
14094
|
let found = null;
|
|
14076
14095
|
const visit = (node) => {
|
|
14077
14096
|
if (found)
|
|
14078
14097
|
return;
|
|
14079
|
-
const [firstArg] =
|
|
14080
|
-
if (
|
|
14098
|
+
const [firstArg] = lazyTypescript.isCallExpression(node) ? node.arguments : [];
|
|
14099
|
+
if (lazyTypescript.isCallExpression(node) && isDefineIslandRegistryCall2(node.expression, factoryNames, namespaceNames) && firstArg && lazyTypescript.isObjectLiteralExpression(firstArg)) {
|
|
14081
14100
|
found = node;
|
|
14082
14101
|
return;
|
|
14083
14102
|
}
|
|
14084
|
-
|
|
14103
|
+
lazyTypescript.forEachChild(node, visit);
|
|
14085
14104
|
};
|
|
14086
14105
|
visit(sourceFile);
|
|
14087
14106
|
return found;
|
|
@@ -14091,8 +14110,8 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name)
|
|
|
14091
14110
|
}, transformIslandRegistrySource = (source, filePath, info) => {
|
|
14092
14111
|
if (!source.includes("defineIslandRegistry"))
|
|
14093
14112
|
return null;
|
|
14094
|
-
const scriptKind = filePath.endsWith(".tsx") || filePath.endsWith(".jsx") ?
|
|
14095
|
-
const sourceFile =
|
|
14113
|
+
const scriptKind = filePath.endsWith(".tsx") || filePath.endsWith(".jsx") ? lazyTypescript.ScriptKind.TSX : lazyTypescript.ScriptKind.TS;
|
|
14114
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, scriptKind);
|
|
14096
14115
|
const { factoryNames, namespaceNames } = collectRegistryFactory(sourceFile);
|
|
14097
14116
|
if (factoryNames.size === 0 && namespaceNames.size === 0)
|
|
14098
14117
|
return null;
|
|
@@ -14100,7 +14119,7 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name)
|
|
|
14100
14119
|
if (!call)
|
|
14101
14120
|
return null;
|
|
14102
14121
|
const [objectLiteral] = call.arguments;
|
|
14103
|
-
if (!objectLiteral || !
|
|
14122
|
+
if (!objectLiteral || !lazyTypescript.isObjectLiteralExpression(objectLiteral)) {
|
|
14104
14123
|
return null;
|
|
14105
14124
|
}
|
|
14106
14125
|
const definitionLookup = new Map;
|
|
@@ -14115,20 +14134,20 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name)
|
|
|
14115
14134
|
const edits = [];
|
|
14116
14135
|
const replacedLocals = new Set;
|
|
14117
14136
|
for (const frameworkProperty of objectLiteral.properties) {
|
|
14118
|
-
if (!
|
|
14137
|
+
if (!lazyTypescript.isPropertyAssignment(frameworkProperty))
|
|
14119
14138
|
continue;
|
|
14120
14139
|
const frameworkName = getObjectPropertyName2(frameworkProperty.name);
|
|
14121
14140
|
const framework = VALID_FRAMEWORKS.find((f) => f === frameworkName);
|
|
14122
14141
|
if (!framework)
|
|
14123
14142
|
continue;
|
|
14124
|
-
if (!
|
|
14143
|
+
if (!lazyTypescript.isObjectLiteralExpression(frameworkProperty.initializer))
|
|
14125
14144
|
continue;
|
|
14126
14145
|
for (const componentProperty of frameworkProperty.initializer.properties) {
|
|
14127
14146
|
let componentKey = null;
|
|
14128
14147
|
let localName = null;
|
|
14129
14148
|
let replaceNode = null;
|
|
14130
14149
|
let replacementText = "";
|
|
14131
|
-
if (
|
|
14150
|
+
if (lazyTypescript.isShorthandPropertyAssignment(componentProperty)) {
|
|
14132
14151
|
componentKey = componentProperty.name.text;
|
|
14133
14152
|
localName = componentProperty.name.text;
|
|
14134
14153
|
const reference = definitionLookup.get(`${framework}:${componentKey}`);
|
|
@@ -14136,7 +14155,7 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name)
|
|
|
14136
14155
|
continue;
|
|
14137
14156
|
replaceNode = componentProperty;
|
|
14138
14157
|
replacementText = `${quoteKey(componentKey)}: ${definitionLiteral(reference)}`;
|
|
14139
|
-
} else if (
|
|
14158
|
+
} else if (lazyTypescript.isPropertyAssignment(componentProperty) && lazyTypescript.isIdentifier(componentProperty.initializer)) {
|
|
14140
14159
|
componentKey = getObjectPropertyName2(componentProperty.name);
|
|
14141
14160
|
localName = componentProperty.initializer.text;
|
|
14142
14161
|
if (!componentKey)
|
|
@@ -14160,7 +14179,7 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name)
|
|
|
14160
14179
|
if (edits.length === 0)
|
|
14161
14180
|
return null;
|
|
14162
14181
|
for (const statement of sourceFile.statements) {
|
|
14163
|
-
if (!
|
|
14182
|
+
if (!lazyTypescript.isImportDeclaration(statement))
|
|
14164
14183
|
continue;
|
|
14165
14184
|
const clause = statement.importClause;
|
|
14166
14185
|
if (!clause)
|
|
@@ -14169,11 +14188,11 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name)
|
|
|
14169
14188
|
if (clause.name)
|
|
14170
14189
|
localNames.push(clause.name.text);
|
|
14171
14190
|
const bindings = clause.namedBindings;
|
|
14172
|
-
if (bindings &&
|
|
14191
|
+
if (bindings && lazyTypescript.isNamedImports(bindings)) {
|
|
14173
14192
|
for (const element of bindings.elements) {
|
|
14174
14193
|
localNames.push(element.name.text);
|
|
14175
14194
|
}
|
|
14176
|
-
} else if (bindings &&
|
|
14195
|
+
} else if (bindings && lazyTypescript.isNamespaceImport(bindings)) {
|
|
14177
14196
|
localNames.push(bindings.name.text);
|
|
14178
14197
|
}
|
|
14179
14198
|
if (localNames.length === 0)
|
|
@@ -14221,6 +14240,7 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => ts7.isIdentifier(name)
|
|
|
14221
14240
|
};
|
|
14222
14241
|
};
|
|
14223
14242
|
var init_islandRegistryTransform = __esm(() => {
|
|
14243
|
+
init_lazyTypescript();
|
|
14224
14244
|
VALID_FRAMEWORKS = [
|
|
14225
14245
|
"react",
|
|
14226
14246
|
"svelte",
|
|
@@ -15498,7 +15518,6 @@ var isTestSourcePath = (file) => {
|
|
|
15498
15518
|
import { existsSync as existsSync29, readFileSync as readFileSync22 } from "fs";
|
|
15499
15519
|
import { extname as extname13, join as join35, relative as relative19, resolve as resolve26 } from "path";
|
|
15500
15520
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
15501
|
-
import ts8 from "typescript";
|
|
15502
15521
|
var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES, ADAPTERS2, SOURCE_GLOB, IGNORED_DIRECTORIES, IDENTIFIER_PATTERN, providerModulePattern = (provider) => new RegExp(`^@absolutejs/devices-${provider}/[a-z][a-z0-9-]*$`, "u"), providerPackagePattern = (provider) => provider === "capacitor" ? /^@capacitor\/[a-z][a-z0-9-]*@\d+\.\d+\.\d+$/u : /^(?:expo-[a-z][a-z0-9-]*|@react-native-[a-z0-9-]+\/[a-z][a-z0-9-]*)@\d+\.\d+\.\d+$/u, providerLabel = (provider) => provider === "capacitor" ? "Capacitor" : "Expo", ANDROID_PERMISSION_PATTERN, IOS_USAGE_DESCRIPTIONS, IOS_PRIVACY_ACCESSED_API_REASONS, IOS_PRIVACY_ACCESSED_APIS, object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readJson = (path) => {
|
|
15503
15522
|
const value = JSON.parse(readFileSync22(path, "utf8"));
|
|
15504
15523
|
if (!object(value))
|
|
@@ -15653,29 +15672,29 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
15653
15672
|
const names = new Set;
|
|
15654
15673
|
const namespaces = new Set;
|
|
15655
15674
|
const visit = (node) => {
|
|
15656
|
-
if (
|
|
15675
|
+
if (lazyTypescript.isImportDeclaration(node) && lazyTypescript.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && !node.importClause?.isTypeOnly) {
|
|
15657
15676
|
const bindings = node.importClause?.namedBindings;
|
|
15658
|
-
if (bindings &&
|
|
15677
|
+
if (bindings && lazyTypescript.isNamedImports(bindings)) {
|
|
15659
15678
|
for (const element of bindings.elements)
|
|
15660
15679
|
if (!element.isTypeOnly)
|
|
15661
15680
|
names.add((element.propertyName ?? element.name).text);
|
|
15662
15681
|
}
|
|
15663
|
-
if (bindings &&
|
|
15682
|
+
if (bindings && lazyTypescript.isNamespaceImport(bindings))
|
|
15664
15683
|
namespaces.add(bindings.name.text);
|
|
15665
15684
|
}
|
|
15666
|
-
if (
|
|
15685
|
+
if (lazyTypescript.isExportDeclaration(node) && !node.isTypeOnly && node.moduleSpecifier !== undefined && lazyTypescript.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && node.exportClause && lazyTypescript.isNamedExports(node.exportClause)) {
|
|
15667
15686
|
for (const element of node.exportClause.elements)
|
|
15668
15687
|
if (!element.isTypeOnly)
|
|
15669
15688
|
names.add((element.propertyName ?? element.name).text);
|
|
15670
15689
|
}
|
|
15671
|
-
if (
|
|
15690
|
+
if (lazyTypescript.isPropertyAccessExpression(node) && lazyTypescript.isIdentifier(node.expression) && namespaces.has(node.expression.text))
|
|
15672
15691
|
names.add(node.name.text);
|
|
15673
|
-
|
|
15692
|
+
lazyTypescript.forEachChild(node, visit);
|
|
15674
15693
|
};
|
|
15675
15694
|
const extension = extname13(file).toLowerCase();
|
|
15676
15695
|
const sources = extension === ".svelte" || extension === ".vue" ? [...source.matchAll(/<script\b[^>]*>([\s\S]*?)<\/script\s*>/giu)].map((match) => match[1]).filter((value) => value !== undefined) : [source];
|
|
15677
15696
|
for (const [index, script] of sources.entries())
|
|
15678
|
-
visit(
|
|
15697
|
+
visit(lazyTypescript.createSourceFile(`${file}#script-${index}`, script, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TSX));
|
|
15679
15698
|
return names;
|
|
15680
15699
|
}, assertAbsoluteDeviceCapabilityPackages = (projectRoot, plan) => {
|
|
15681
15700
|
const missing = missingAbsoluteDeviceCapabilityPackages(plan, directAbsoluteProjectPackages(projectRoot));
|
|
@@ -15756,6 +15775,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
15756
15775
|
};
|
|
15757
15776
|
};
|
|
15758
15777
|
var init_deviceCapabilities = __esm(() => {
|
|
15778
|
+
init_lazyTypescript();
|
|
15759
15779
|
ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES = [
|
|
15760
15780
|
"keyboard",
|
|
15761
15781
|
"systemBars"
|
|
@@ -16601,21 +16621,22 @@ var init_precompressed = __esm(() => {
|
|
|
16601
16621
|
});
|
|
16602
16622
|
|
|
16603
16623
|
// src/dev/angular/hmrImportGenerator.ts
|
|
16604
|
-
import ts9 from "typescript";
|
|
16605
16624
|
var createHmrImportGenerator = (namespaceMap) => ({
|
|
16606
16625
|
addImport(request) {
|
|
16607
16626
|
const namespace = namespaceMap.get(request.exportModuleSpecifier);
|
|
16608
16627
|
if (!namespace) {
|
|
16609
16628
|
throw new Error(`HMR import generator has no namespace mapping for ${request.exportModuleSpecifier}. ` + `Add it to namespaceDependencies before calling compileHmrUpdateCallback.`);
|
|
16610
16629
|
}
|
|
16611
|
-
const namespaceId =
|
|
16630
|
+
const namespaceId = lazyTypescript.factory.createIdentifier(namespace);
|
|
16612
16631
|
if (request.exportSymbolName === null) {
|
|
16613
16632
|
return namespaceId;
|
|
16614
16633
|
}
|
|
16615
|
-
return
|
|
16634
|
+
return lazyTypescript.factory.createPropertyAccessExpression(namespaceId, lazyTypescript.factory.createIdentifier(request.exportSymbolName));
|
|
16616
16635
|
}
|
|
16617
16636
|
});
|
|
16618
|
-
var init_hmrImportGenerator = () => {
|
|
16637
|
+
var init_hmrImportGenerator = __esm(() => {
|
|
16638
|
+
init_lazyTypescript();
|
|
16639
|
+
});
|
|
16619
16640
|
|
|
16620
16641
|
// src/dev/angular/vendor/translator/context.ts
|
|
16621
16642
|
class Context {
|
|
@@ -16978,15 +16999,15 @@ var init_translator = __esm(() => {
|
|
|
16978
16999
|
});
|
|
16979
17000
|
|
|
16980
17001
|
// src/dev/angular/vendor/translator/ts_util.ts
|
|
16981
|
-
import ts10 from "typescript";
|
|
16982
17002
|
function tsNumericExpression(value) {
|
|
16983
17003
|
if (value < 0) {
|
|
16984
|
-
const operand =
|
|
16985
|
-
return
|
|
17004
|
+
const operand = lazyTypescript.factory.createNumericLiteral(Math.abs(value));
|
|
17005
|
+
return lazyTypescript.factory.createPrefixUnaryExpression(lazyTypescript.SyntaxKind.MinusToken, operand);
|
|
16986
17006
|
}
|
|
16987
|
-
return
|
|
17007
|
+
return lazyTypescript.factory.createNumericLiteral(value);
|
|
16988
17008
|
}
|
|
16989
17009
|
var init_ts_util = __esm(() => {
|
|
17010
|
+
init_lazyTypescript();
|
|
16990
17011
|
/*!
|
|
16991
17012
|
* @license
|
|
16992
17013
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -16997,144 +17018,142 @@ var init_ts_util = __esm(() => {
|
|
|
16997
17018
|
});
|
|
16998
17019
|
|
|
16999
17020
|
// src/dev/angular/vendor/translator/typescript_ast_factory.ts
|
|
17000
|
-
import ts11 from "typescript";
|
|
17001
|
-
|
|
17002
17021
|
class TypeScriptAstFactory {
|
|
17003
17022
|
constructor(annotateForClosureCompiler) {
|
|
17004
17023
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
17005
17024
|
this.externalSourceFiles = new Map;
|
|
17006
17025
|
this.UNARY_OPERATORS = /* @__PURE__ */ (() => ({
|
|
17007
|
-
"+":
|
|
17008
|
-
"-":
|
|
17009
|
-
"!":
|
|
17026
|
+
"+": lazyTypescript.SyntaxKind.PlusToken,
|
|
17027
|
+
"-": lazyTypescript.SyntaxKind.MinusToken,
|
|
17028
|
+
"!": lazyTypescript.SyntaxKind.ExclamationToken
|
|
17010
17029
|
}))();
|
|
17011
17030
|
this.BINARY_OPERATORS = /* @__PURE__ */ (() => ({
|
|
17012
|
-
"&&":
|
|
17013
|
-
">":
|
|
17014
|
-
">=":
|
|
17015
|
-
"&":
|
|
17016
|
-
"|":
|
|
17017
|
-
"/":
|
|
17018
|
-
"==":
|
|
17019
|
-
"===":
|
|
17020
|
-
"<":
|
|
17021
|
-
"<=":
|
|
17022
|
-
"-":
|
|
17023
|
-
"%":
|
|
17024
|
-
"*":
|
|
17025
|
-
"**":
|
|
17026
|
-
"!=":
|
|
17027
|
-
"!==":
|
|
17028
|
-
"||":
|
|
17029
|
-
"+":
|
|
17030
|
-
"??":
|
|
17031
|
-
"=":
|
|
17032
|
-
"+=":
|
|
17033
|
-
"-=":
|
|
17034
|
-
"*=":
|
|
17035
|
-
"/=":
|
|
17036
|
-
"%=":
|
|
17037
|
-
"**=":
|
|
17038
|
-
"&&=":
|
|
17039
|
-
"||=":
|
|
17040
|
-
"??=":
|
|
17041
|
-
in:
|
|
17042
|
-
instanceof:
|
|
17031
|
+
"&&": lazyTypescript.SyntaxKind.AmpersandAmpersandToken,
|
|
17032
|
+
">": lazyTypescript.SyntaxKind.GreaterThanToken,
|
|
17033
|
+
">=": lazyTypescript.SyntaxKind.GreaterThanEqualsToken,
|
|
17034
|
+
"&": lazyTypescript.SyntaxKind.AmpersandToken,
|
|
17035
|
+
"|": lazyTypescript.SyntaxKind.BarToken,
|
|
17036
|
+
"/": lazyTypescript.SyntaxKind.SlashToken,
|
|
17037
|
+
"==": lazyTypescript.SyntaxKind.EqualsEqualsToken,
|
|
17038
|
+
"===": lazyTypescript.SyntaxKind.EqualsEqualsEqualsToken,
|
|
17039
|
+
"<": lazyTypescript.SyntaxKind.LessThanToken,
|
|
17040
|
+
"<=": lazyTypescript.SyntaxKind.LessThanEqualsToken,
|
|
17041
|
+
"-": lazyTypescript.SyntaxKind.MinusToken,
|
|
17042
|
+
"%": lazyTypescript.SyntaxKind.PercentToken,
|
|
17043
|
+
"*": lazyTypescript.SyntaxKind.AsteriskToken,
|
|
17044
|
+
"**": lazyTypescript.SyntaxKind.AsteriskAsteriskToken,
|
|
17045
|
+
"!=": lazyTypescript.SyntaxKind.ExclamationEqualsToken,
|
|
17046
|
+
"!==": lazyTypescript.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
17047
|
+
"||": lazyTypescript.SyntaxKind.BarBarToken,
|
|
17048
|
+
"+": lazyTypescript.SyntaxKind.PlusToken,
|
|
17049
|
+
"??": lazyTypescript.SyntaxKind.QuestionQuestionToken,
|
|
17050
|
+
"=": lazyTypescript.SyntaxKind.EqualsToken,
|
|
17051
|
+
"+=": lazyTypescript.SyntaxKind.PlusEqualsToken,
|
|
17052
|
+
"-=": lazyTypescript.SyntaxKind.MinusEqualsToken,
|
|
17053
|
+
"*=": lazyTypescript.SyntaxKind.AsteriskEqualsToken,
|
|
17054
|
+
"/=": lazyTypescript.SyntaxKind.SlashEqualsToken,
|
|
17055
|
+
"%=": lazyTypescript.SyntaxKind.PercentEqualsToken,
|
|
17056
|
+
"**=": lazyTypescript.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
17057
|
+
"&&=": lazyTypescript.SyntaxKind.AmpersandAmpersandEqualsToken,
|
|
17058
|
+
"||=": lazyTypescript.SyntaxKind.BarBarEqualsToken,
|
|
17059
|
+
"??=": lazyTypescript.SyntaxKind.QuestionQuestionEqualsToken,
|
|
17060
|
+
in: lazyTypescript.SyntaxKind.InKeyword,
|
|
17061
|
+
instanceof: lazyTypescript.SyntaxKind.InstanceOfKeyword
|
|
17043
17062
|
}))();
|
|
17044
17063
|
this.VAR_TYPES = /* @__PURE__ */ (() => ({
|
|
17045
|
-
const:
|
|
17046
|
-
let:
|
|
17047
|
-
var:
|
|
17064
|
+
const: lazyTypescript.NodeFlags.Const,
|
|
17065
|
+
let: lazyTypescript.NodeFlags.Let,
|
|
17066
|
+
var: lazyTypescript.NodeFlags.None
|
|
17048
17067
|
}))();
|
|
17049
17068
|
this.attachComments = attachComments;
|
|
17050
|
-
this.createArrayLiteral =
|
|
17051
|
-
this.createElementAccess =
|
|
17052
|
-
this.createExpressionStatement =
|
|
17053
|
-
this.createIdentifier =
|
|
17054
|
-
this.createParenthesizedExpression =
|
|
17055
|
-
this.createPropertyAccess =
|
|
17056
|
-
this.createSpreadElement =
|
|
17057
|
-
this.createThrowStatement =
|
|
17058
|
-
this.createTypeOfExpression =
|
|
17059
|
-
this.createVoidExpression =
|
|
17069
|
+
this.createArrayLiteral = lazyTypescript.factory.createArrayLiteralExpression;
|
|
17070
|
+
this.createElementAccess = lazyTypescript.factory.createElementAccessExpression;
|
|
17071
|
+
this.createExpressionStatement = lazyTypescript.factory.createExpressionStatement;
|
|
17072
|
+
this.createIdentifier = lazyTypescript.factory.createIdentifier;
|
|
17073
|
+
this.createParenthesizedExpression = lazyTypescript.factory.createParenthesizedExpression;
|
|
17074
|
+
this.createPropertyAccess = lazyTypescript.factory.createPropertyAccessExpression;
|
|
17075
|
+
this.createSpreadElement = lazyTypescript.factory.createSpreadElement;
|
|
17076
|
+
this.createThrowStatement = lazyTypescript.factory.createThrowStatement;
|
|
17077
|
+
this.createTypeOfExpression = lazyTypescript.factory.createTypeOfExpression;
|
|
17078
|
+
this.createVoidExpression = lazyTypescript.factory.createVoidExpression;
|
|
17060
17079
|
}
|
|
17061
17080
|
createAssignment(target, operator, value) {
|
|
17062
|
-
return
|
|
17081
|
+
return lazyTypescript.factory.createBinaryExpression(target, this.BINARY_OPERATORS[operator], value);
|
|
17063
17082
|
}
|
|
17064
17083
|
createBinaryExpression(leftOperand, operator, rightOperand) {
|
|
17065
|
-
return
|
|
17084
|
+
return lazyTypescript.factory.createBinaryExpression(leftOperand, this.BINARY_OPERATORS[operator], rightOperand);
|
|
17066
17085
|
}
|
|
17067
17086
|
createBlock(body) {
|
|
17068
|
-
return
|
|
17087
|
+
return lazyTypescript.factory.createBlock(body);
|
|
17069
17088
|
}
|
|
17070
17089
|
createCallExpression(callee, args, pure) {
|
|
17071
|
-
const call =
|
|
17090
|
+
const call = lazyTypescript.factory.createCallExpression(callee, undefined, args);
|
|
17072
17091
|
if (pure) {
|
|
17073
|
-
|
|
17092
|
+
lazyTypescript.addSyntheticLeadingComment(call, lazyTypescript.SyntaxKind.MultiLineCommentTrivia, this.annotateForClosureCompiler ? "* @pureOrBreakMyCode " /* CLOSURE */ : "@__PURE__" /* TERSER */, false);
|
|
17074
17093
|
}
|
|
17075
17094
|
return call;
|
|
17076
17095
|
}
|
|
17077
17096
|
createConditional(condition, whenTrue, whenFalse) {
|
|
17078
|
-
return
|
|
17097
|
+
return lazyTypescript.factory.createConditionalExpression(condition, undefined, whenTrue, undefined, whenFalse);
|
|
17079
17098
|
}
|
|
17080
17099
|
createDynamicImport(url) {
|
|
17081
|
-
return
|
|
17082
|
-
typeof url === "string" ?
|
|
17100
|
+
return lazyTypescript.factory.createCallExpression(lazyTypescript.factory.createToken(lazyTypescript.SyntaxKind.ImportKeyword), undefined, [
|
|
17101
|
+
typeof url === "string" ? lazyTypescript.factory.createStringLiteral(url) : url
|
|
17083
17102
|
]);
|
|
17084
17103
|
}
|
|
17085
17104
|
createFunctionDeclaration(functionName, parameters, body) {
|
|
17086
|
-
if (!
|
|
17087
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
17105
|
+
if (!lazyTypescript.isBlock(body)) {
|
|
17106
|
+
throw new Error(`Invalid syntax, expected a block, but got ${lazyTypescript.SyntaxKind[body.kind]}.`);
|
|
17088
17107
|
}
|
|
17089
|
-
return
|
|
17108
|
+
return lazyTypescript.factory.createFunctionDeclaration(undefined, undefined, functionName, undefined, parameters.map((param) => this.createParameter(param)), undefined, body);
|
|
17090
17109
|
}
|
|
17091
17110
|
createFunctionExpression(functionName, parameters, body) {
|
|
17092
|
-
if (!
|
|
17093
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
17111
|
+
if (!lazyTypescript.isBlock(body)) {
|
|
17112
|
+
throw new Error(`Invalid syntax, expected a block, but got ${lazyTypescript.SyntaxKind[body.kind]}.`);
|
|
17094
17113
|
}
|
|
17095
|
-
return
|
|
17114
|
+
return lazyTypescript.factory.createFunctionExpression(undefined, undefined, functionName ?? undefined, undefined, parameters.map((param) => this.createParameter(param)), undefined, body);
|
|
17096
17115
|
}
|
|
17097
17116
|
createArrowFunctionExpression(parameters, body) {
|
|
17098
|
-
if (
|
|
17099
|
-
throw new Error(`Invalid syntax, expected a block, but got ${
|
|
17117
|
+
if (lazyTypescript.isStatement(body) && !lazyTypescript.isBlock(body)) {
|
|
17118
|
+
throw new Error(`Invalid syntax, expected a block, but got ${lazyTypescript.SyntaxKind[body.kind]}.`);
|
|
17100
17119
|
}
|
|
17101
|
-
return
|
|
17120
|
+
return lazyTypescript.factory.createArrowFunction(undefined, undefined, parameters.map((param) => this.createParameter(param)), undefined, undefined, body);
|
|
17102
17121
|
}
|
|
17103
17122
|
createParameter(param) {
|
|
17104
|
-
return
|
|
17123
|
+
return lazyTypescript.factory.createParameterDeclaration(undefined, undefined, param.name, undefined, param.type ?? undefined);
|
|
17105
17124
|
}
|
|
17106
17125
|
createIfStatement(condition, thenStatement, elseStatement) {
|
|
17107
|
-
return
|
|
17126
|
+
return lazyTypescript.factory.createIfStatement(condition, thenStatement, elseStatement ?? undefined);
|
|
17108
17127
|
}
|
|
17109
17128
|
createLiteral(value) {
|
|
17110
17129
|
if (value === undefined) {
|
|
17111
|
-
return
|
|
17130
|
+
return lazyTypescript.factory.createIdentifier("undefined");
|
|
17112
17131
|
} else if (value === null) {
|
|
17113
|
-
return
|
|
17132
|
+
return lazyTypescript.factory.createNull();
|
|
17114
17133
|
} else if (typeof value === "boolean") {
|
|
17115
|
-
return value ?
|
|
17134
|
+
return value ? lazyTypescript.factory.createTrue() : lazyTypescript.factory.createFalse();
|
|
17116
17135
|
} else if (typeof value === "number") {
|
|
17117
17136
|
return tsNumericExpression(value);
|
|
17118
17137
|
} else {
|
|
17119
|
-
return
|
|
17138
|
+
return lazyTypescript.factory.createStringLiteral(value);
|
|
17120
17139
|
}
|
|
17121
17140
|
}
|
|
17122
17141
|
createNewExpression(expression, args) {
|
|
17123
|
-
return
|
|
17142
|
+
return lazyTypescript.factory.createNewExpression(expression, undefined, args);
|
|
17124
17143
|
}
|
|
17125
17144
|
createObjectLiteral(properties) {
|
|
17126
|
-
return
|
|
17145
|
+
return lazyTypescript.factory.createObjectLiteralExpression(properties.map((prop) => {
|
|
17127
17146
|
if (prop.kind === "spread") {
|
|
17128
|
-
return
|
|
17147
|
+
return lazyTypescript.factory.createSpreadAssignment(prop.expression);
|
|
17129
17148
|
}
|
|
17130
|
-
return
|
|
17149
|
+
return lazyTypescript.factory.createPropertyAssignment(prop.quoted ? lazyTypescript.factory.createStringLiteral(prop.propertyName) : lazyTypescript.factory.createIdentifier(prop.propertyName), prop.value);
|
|
17131
17150
|
}));
|
|
17132
17151
|
}
|
|
17133
17152
|
createReturnStatement(expression) {
|
|
17134
|
-
return
|
|
17153
|
+
return lazyTypescript.factory.createReturnStatement(expression ?? undefined);
|
|
17135
17154
|
}
|
|
17136
17155
|
createTaggedTemplate(tag, template) {
|
|
17137
|
-
return
|
|
17156
|
+
return lazyTypescript.factory.createTaggedTemplateExpression(tag, undefined, this.createTemplateLiteral(template));
|
|
17138
17157
|
}
|
|
17139
17158
|
createTemplateLiteral(template) {
|
|
17140
17159
|
let templateLiteral;
|
|
@@ -17144,7 +17163,7 @@ class TypeScriptAstFactory {
|
|
|
17144
17163
|
throw new Error("createTemplateLiteral: template has no elements");
|
|
17145
17164
|
}
|
|
17146
17165
|
if (length === 1) {
|
|
17147
|
-
templateLiteral =
|
|
17166
|
+
templateLiteral = lazyTypescript.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
|
|
17148
17167
|
} else {
|
|
17149
17168
|
const spans = [];
|
|
17150
17169
|
for (let i = 1;i < length - 1; i++) {
|
|
@@ -17158,7 +17177,7 @@ class TypeScriptAstFactory {
|
|
|
17158
17177
|
if (range !== null) {
|
|
17159
17178
|
this.setSourceMapRange(middle, range);
|
|
17160
17179
|
}
|
|
17161
|
-
spans.push(
|
|
17180
|
+
spans.push(lazyTypescript.factory.createTemplateSpan(expression, middle));
|
|
17162
17181
|
}
|
|
17163
17182
|
const resolvedExpression = template.expressions[length - 2];
|
|
17164
17183
|
const templatePart = template.elements[length - 1];
|
|
@@ -17169,8 +17188,8 @@ class TypeScriptAstFactory {
|
|
|
17169
17188
|
if (templatePart.range !== null) {
|
|
17170
17189
|
this.setSourceMapRange(templateTail, templatePart.range);
|
|
17171
17190
|
}
|
|
17172
|
-
spans.push(
|
|
17173
|
-
templateLiteral =
|
|
17191
|
+
spans.push(lazyTypescript.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
17192
|
+
templateLiteral = lazyTypescript.factory.createTemplateExpression(lazyTypescript.factory.createTemplateHead(head.cooked, head.raw), spans);
|
|
17174
17193
|
}
|
|
17175
17194
|
if (head.range !== null) {
|
|
17176
17195
|
this.setSourceMapRange(templateLiteral, head.range);
|
|
@@ -17178,15 +17197,15 @@ class TypeScriptAstFactory {
|
|
|
17178
17197
|
return templateLiteral;
|
|
17179
17198
|
}
|
|
17180
17199
|
createUnaryExpression(operator, operand) {
|
|
17181
|
-
return
|
|
17200
|
+
return lazyTypescript.factory.createPrefixUnaryExpression(this.UNARY_OPERATORS[operator], operand);
|
|
17182
17201
|
}
|
|
17183
17202
|
createVariableDeclaration(variableName, initializer, variableType, type) {
|
|
17184
|
-
return
|
|
17185
|
-
|
|
17203
|
+
return lazyTypescript.factory.createVariableStatement(undefined, lazyTypescript.factory.createVariableDeclarationList([
|
|
17204
|
+
lazyTypescript.factory.createVariableDeclaration(variableName, undefined, type ?? undefined, initializer ?? undefined)
|
|
17186
17205
|
], this.VAR_TYPES[variableType]));
|
|
17187
17206
|
}
|
|
17188
17207
|
createRegularExpressionLiteral(body, flags) {
|
|
17189
|
-
return
|
|
17208
|
+
return lazyTypescript.factory.createRegularExpressionLiteral(`/${body}/${flags ?? ""}`);
|
|
17190
17209
|
}
|
|
17191
17210
|
setSourceMapRange(node, sourceMapRange) {
|
|
17192
17211
|
if (sourceMapRange === null) {
|
|
@@ -17194,10 +17213,10 @@ class TypeScriptAstFactory {
|
|
|
17194
17213
|
}
|
|
17195
17214
|
const url = sourceMapRange.url;
|
|
17196
17215
|
if (!this.externalSourceFiles.has(url)) {
|
|
17197
|
-
this.externalSourceFiles.set(url,
|
|
17216
|
+
this.externalSourceFiles.set(url, lazyTypescript.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
|
|
17198
17217
|
}
|
|
17199
17218
|
const source = this.externalSourceFiles.get(url);
|
|
17200
|
-
|
|
17219
|
+
lazyTypescript.setSourceMapRange(node, {
|
|
17201
17220
|
pos: sourceMapRange.start.offset,
|
|
17202
17221
|
end: sourceMapRange.end.offset,
|
|
17203
17222
|
source
|
|
@@ -17207,79 +17226,80 @@ class TypeScriptAstFactory {
|
|
|
17207
17226
|
createBuiltInType(type) {
|
|
17208
17227
|
switch (type) {
|
|
17209
17228
|
case "any":
|
|
17210
|
-
return
|
|
17229
|
+
return lazyTypescript.factory.createKeywordTypeNode(lazyTypescript.SyntaxKind.AnyKeyword);
|
|
17211
17230
|
case "boolean":
|
|
17212
|
-
return
|
|
17231
|
+
return lazyTypescript.factory.createKeywordTypeNode(lazyTypescript.SyntaxKind.BooleanKeyword);
|
|
17213
17232
|
case "number":
|
|
17214
|
-
return
|
|
17233
|
+
return lazyTypescript.factory.createKeywordTypeNode(lazyTypescript.SyntaxKind.NumberKeyword);
|
|
17215
17234
|
case "string":
|
|
17216
|
-
return
|
|
17235
|
+
return lazyTypescript.factory.createKeywordTypeNode(lazyTypescript.SyntaxKind.StringKeyword);
|
|
17217
17236
|
case "function":
|
|
17218
|
-
return
|
|
17237
|
+
return lazyTypescript.factory.createTypeReferenceNode(lazyTypescript.factory.createIdentifier("Function"));
|
|
17219
17238
|
case "never":
|
|
17220
|
-
return
|
|
17239
|
+
return lazyTypescript.factory.createKeywordTypeNode(lazyTypescript.SyntaxKind.NeverKeyword);
|
|
17221
17240
|
case "unknown":
|
|
17222
|
-
return
|
|
17241
|
+
return lazyTypescript.factory.createKeywordTypeNode(lazyTypescript.SyntaxKind.UnknownKeyword);
|
|
17223
17242
|
}
|
|
17224
17243
|
}
|
|
17225
17244
|
createExpressionType(expression, typeParams) {
|
|
17226
17245
|
const typeName = getEntityTypeFromExpression(expression);
|
|
17227
|
-
return
|
|
17246
|
+
return lazyTypescript.factory.createTypeReferenceNode(typeName, typeParams ?? undefined);
|
|
17228
17247
|
}
|
|
17229
17248
|
createArrayType(elementType) {
|
|
17230
|
-
return
|
|
17249
|
+
return lazyTypescript.factory.createArrayTypeNode(elementType);
|
|
17231
17250
|
}
|
|
17232
17251
|
createMapType(valueType) {
|
|
17233
|
-
return
|
|
17234
|
-
|
|
17235
|
-
|
|
17252
|
+
return lazyTypescript.factory.createTypeLiteralNode([
|
|
17253
|
+
lazyTypescript.factory.createIndexSignature(undefined, [
|
|
17254
|
+
lazyTypescript.factory.createParameterDeclaration(undefined, undefined, "key", undefined, lazyTypescript.factory.createKeywordTypeNode(lazyTypescript.SyntaxKind.StringKeyword))
|
|
17236
17255
|
], valueType)
|
|
17237
17256
|
]);
|
|
17238
17257
|
}
|
|
17239
17258
|
transplantType(type) {
|
|
17240
|
-
if (typeof type.kind === "number" && typeof type.getSourceFile === "function" &&
|
|
17259
|
+
if (typeof type.kind === "number" && typeof type.getSourceFile === "function" && lazyTypescript.isTypeNode(type)) {
|
|
17241
17260
|
return type;
|
|
17242
17261
|
}
|
|
17243
17262
|
throw new Error("Attempting to transplant a type node from a non-TypeScript AST: " + type);
|
|
17244
17263
|
}
|
|
17245
17264
|
}
|
|
17246
17265
|
function createTemplateMiddle(cooked, raw) {
|
|
17247
|
-
const node =
|
|
17248
|
-
node.kind =
|
|
17266
|
+
const node = lazyTypescript.factory.createTemplateHead(cooked, raw);
|
|
17267
|
+
node.kind = lazyTypescript.SyntaxKind.TemplateMiddle;
|
|
17249
17268
|
return node;
|
|
17250
17269
|
}
|
|
17251
17270
|
function createTemplateTail(cooked, raw) {
|
|
17252
|
-
const node =
|
|
17253
|
-
node.kind =
|
|
17271
|
+
const node = lazyTypescript.factory.createTemplateHead(cooked, raw);
|
|
17272
|
+
node.kind = lazyTypescript.SyntaxKind.TemplateTail;
|
|
17254
17273
|
return node;
|
|
17255
17274
|
}
|
|
17256
17275
|
function attachComments(statement, leadingComments) {
|
|
17257
17276
|
for (const comment of leadingComments) {
|
|
17258
|
-
const commentKind = comment.multiline ?
|
|
17277
|
+
const commentKind = comment.multiline ? lazyTypescript.SyntaxKind.MultiLineCommentTrivia : lazyTypescript.SyntaxKind.SingleLineCommentTrivia;
|
|
17259
17278
|
if (comment.multiline) {
|
|
17260
|
-
|
|
17279
|
+
lazyTypescript.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
|
|
17261
17280
|
} else {
|
|
17262
17281
|
for (const line of comment.toString().split(`
|
|
17263
17282
|
`)) {
|
|
17264
|
-
|
|
17283
|
+
lazyTypescript.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
|
|
17265
17284
|
}
|
|
17266
17285
|
}
|
|
17267
17286
|
}
|
|
17268
17287
|
}
|
|
17269
17288
|
function getEntityTypeFromExpression(expression) {
|
|
17270
|
-
if (
|
|
17289
|
+
if (lazyTypescript.isIdentifier(expression)) {
|
|
17271
17290
|
return expression;
|
|
17272
17291
|
}
|
|
17273
|
-
if (
|
|
17292
|
+
if (lazyTypescript.isPropertyAccessExpression(expression)) {
|
|
17274
17293
|
const left = getEntityTypeFromExpression(expression.expression);
|
|
17275
|
-
if (!
|
|
17294
|
+
if (!lazyTypescript.isIdentifier(expression.name)) {
|
|
17276
17295
|
throw new Error(`Unsupported property access for type reference: ${expression.name.text}`);
|
|
17277
17296
|
}
|
|
17278
|
-
return
|
|
17297
|
+
return lazyTypescript.factory.createQualifiedName(left, expression.name);
|
|
17279
17298
|
}
|
|
17280
|
-
throw new Error(`Unsupported expression for type reference: ${
|
|
17299
|
+
throw new Error(`Unsupported expression for type reference: ${lazyTypescript.SyntaxKind[expression.kind]}`);
|
|
17281
17300
|
}
|
|
17282
17301
|
var init_typescript_ast_factory = __esm(() => {
|
|
17302
|
+
init_lazyTypescript();
|
|
17283
17303
|
init_ts_util();
|
|
17284
17304
|
});
|
|
17285
17305
|
|
|
@@ -17304,7 +17324,6 @@ var init_typescript_translator = __esm(() => {
|
|
|
17304
17324
|
// src/dev/angular/fastHmrCompiler.ts
|
|
17305
17325
|
import { existsSync as existsSync30, readFileSync as readFileSync24, statSync as statSync4 } from "fs";
|
|
17306
17326
|
import { dirname as dirname23, extname as extname15, relative as relative21, resolve as resolve29 } from "path";
|
|
17307
|
-
import ts12 from "typescript";
|
|
17308
17327
|
var fail2 = (reason, detail, location) => ({
|
|
17309
17328
|
detail,
|
|
17310
17329
|
ok: false,
|
|
@@ -17312,10 +17331,10 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17312
17331
|
...location ?? {}
|
|
17313
17332
|
}), fingerprintCache, pendingModuleCache, ANGULAR_DECORATOR_NAMES, findAngularDecoratorName = (decorators) => {
|
|
17314
17333
|
for (const decorator of decorators) {
|
|
17315
|
-
if (!
|
|
17334
|
+
if (!lazyTypescript.isCallExpression(decorator.expression))
|
|
17316
17335
|
continue;
|
|
17317
17336
|
const { expression } = decorator.expression;
|
|
17318
|
-
if (!
|
|
17337
|
+
if (!lazyTypescript.isIdentifier(expression))
|
|
17319
17338
|
continue;
|
|
17320
17339
|
if (ANGULAR_DECORATOR_NAMES.has(expression.text)) {
|
|
17321
17340
|
return expression.text;
|
|
@@ -17401,17 +17420,17 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17401
17420
|
}
|
|
17402
17421
|
let sourceFile;
|
|
17403
17422
|
try {
|
|
17404
|
-
sourceFile =
|
|
17423
|
+
sourceFile = lazyTypescript.createSourceFile(componentFilePath, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
17405
17424
|
} catch {
|
|
17406
17425
|
return;
|
|
17407
17426
|
}
|
|
17408
17427
|
for (const stmt of sourceFile.statements) {
|
|
17409
|
-
if (!
|
|
17428
|
+
if (!lazyTypescript.isClassDeclaration(stmt))
|
|
17410
17429
|
continue;
|
|
17411
17430
|
const className = stmt.name?.text;
|
|
17412
17431
|
if (!className)
|
|
17413
17432
|
continue;
|
|
17414
|
-
const decorators =
|
|
17433
|
+
const decorators = lazyTypescript.getDecorators(stmt) ?? [];
|
|
17415
17434
|
const decoratorName = findAngularDecoratorName(decorators);
|
|
17416
17435
|
if (!decoratorName)
|
|
17417
17436
|
continue;
|
|
@@ -17419,17 +17438,17 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17419
17438
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
17420
17439
|
if (decoratorName === "Component") {
|
|
17421
17440
|
const componentDecorator = decorators.find((d) => {
|
|
17422
|
-
if (!
|
|
17441
|
+
if (!lazyTypescript.isCallExpression(d.expression))
|
|
17423
17442
|
return false;
|
|
17424
17443
|
const expr = d.expression.expression;
|
|
17425
|
-
return
|
|
17444
|
+
return lazyTypescript.isIdentifier(expr) && expr.text === "Component";
|
|
17426
17445
|
});
|
|
17427
17446
|
if (!componentDecorator)
|
|
17428
17447
|
continue;
|
|
17429
|
-
if (!
|
|
17448
|
+
if (!lazyTypescript.isCallExpression(componentDecorator.expression))
|
|
17430
17449
|
continue;
|
|
17431
17450
|
const [args] = componentDecorator.expression.arguments;
|
|
17432
|
-
if (!args || !
|
|
17451
|
+
if (!args || !lazyTypescript.isObjectLiteralExpression(args))
|
|
17433
17452
|
continue;
|
|
17434
17453
|
const decoratorMeta = readDecoratorMeta(args);
|
|
17435
17454
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
@@ -17460,11 +17479,11 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17460
17479
|
return false;
|
|
17461
17480
|
return true;
|
|
17462
17481
|
}, ENTITY_DECORATOR_NAMES, findEntityDecorator = (cls) => {
|
|
17463
|
-
for (const dec of
|
|
17482
|
+
for (const dec of lazyTypescript.getDecorators(cls) ?? []) {
|
|
17464
17483
|
const expr = dec.expression;
|
|
17465
|
-
if (!
|
|
17484
|
+
if (!lazyTypescript.isCallExpression(expr))
|
|
17466
17485
|
continue;
|
|
17467
|
-
if (!
|
|
17486
|
+
if (!lazyTypescript.isIdentifier(expr.expression))
|
|
17468
17487
|
continue;
|
|
17469
17488
|
if (ENTITY_DECORATOR_NAMES.has(expr.expression.text))
|
|
17470
17489
|
return dec;
|
|
@@ -17474,7 +17493,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17474
17493
|
const decorator = findEntityDecorator(cls);
|
|
17475
17494
|
let decoratorArgsText = "";
|
|
17476
17495
|
if (decorator !== null) {
|
|
17477
|
-
if (!
|
|
17496
|
+
if (!lazyTypescript.isCallExpression(decorator.expression)) {
|
|
17478
17497
|
return {
|
|
17479
17498
|
arrowFieldSig: extractArrowFieldSig(cls),
|
|
17480
17499
|
className,
|
|
@@ -17492,18 +17511,18 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17492
17511
|
}
|
|
17493
17512
|
const ctorParamTypes = [];
|
|
17494
17513
|
for (const member of cls.members) {
|
|
17495
|
-
if (!
|
|
17514
|
+
if (!lazyTypescript.isConstructorDeclaration(member))
|
|
17496
17515
|
continue;
|
|
17497
17516
|
for (const param of member.parameters) {
|
|
17498
17517
|
const typeText = param.type ? param.type.getText() : "";
|
|
17499
|
-
const decorators =
|
|
17518
|
+
const decorators = lazyTypescript.getDecorators(param) ?? [];
|
|
17500
17519
|
const decoratorSig = decorators.length === 0 ? "" : decorators.map((d) => {
|
|
17501
17520
|
const e = d.expression;
|
|
17502
|
-
if (
|
|
17521
|
+
if (lazyTypescript.isCallExpression(e) && lazyTypescript.isIdentifier(e.expression)) {
|
|
17503
17522
|
const args = e.arguments.map((a) => a.getText()).join(",");
|
|
17504
17523
|
return `@${e.expression.text}(${args})`;
|
|
17505
17524
|
}
|
|
17506
|
-
if (
|
|
17525
|
+
if (lazyTypescript.isIdentifier(e))
|
|
17507
17526
|
return `@${e.text}`;
|
|
17508
17527
|
return "@<unknown>";
|
|
17509
17528
|
}).join("");
|
|
@@ -17525,23 +17544,23 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17525
17544
|
const walk = (node) => {
|
|
17526
17545
|
if (found)
|
|
17527
17546
|
return;
|
|
17528
|
-
if (
|
|
17547
|
+
if (lazyTypescript.isClassDeclaration(node) && node.name?.text === className) {
|
|
17529
17548
|
found = node;
|
|
17530
17549
|
return;
|
|
17531
17550
|
}
|
|
17532
|
-
|
|
17551
|
+
lazyTypescript.forEachChild(node, walk);
|
|
17533
17552
|
};
|
|
17534
17553
|
walk(sourceFile);
|
|
17535
17554
|
return found;
|
|
17536
17555
|
}, getClassDecorators = (cls) => {
|
|
17537
|
-
const modifiers =
|
|
17556
|
+
const modifiers = lazyTypescript.getDecorators(cls) ?? [];
|
|
17538
17557
|
return [...modifiers];
|
|
17539
17558
|
}, findComponentDecorator = (cls) => {
|
|
17540
17559
|
for (const decorator of getClassDecorators(cls)) {
|
|
17541
17560
|
const expr = decorator.expression;
|
|
17542
|
-
if (
|
|
17561
|
+
if (lazyTypescript.isCallExpression(expr)) {
|
|
17543
17562
|
const functionNode = expr.expression;
|
|
17544
|
-
if (
|
|
17563
|
+
if (lazyTypescript.isIdentifier(functionNode) && functionNode.text === "Component") {
|
|
17545
17564
|
return decorator;
|
|
17546
17565
|
}
|
|
17547
17566
|
}
|
|
@@ -17549,15 +17568,15 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17549
17568
|
return null;
|
|
17550
17569
|
}, getDecoratorArgsObject = (decorator) => {
|
|
17551
17570
|
const call = decorator.expression;
|
|
17552
|
-
if (!
|
|
17571
|
+
if (!lazyTypescript.isCallExpression(call))
|
|
17553
17572
|
return null;
|
|
17554
17573
|
const [arg] = call.arguments;
|
|
17555
|
-
if (!arg || !
|
|
17574
|
+
if (!arg || !lazyTypescript.isObjectLiteralExpression(arg))
|
|
17556
17575
|
return null;
|
|
17557
17576
|
return arg;
|
|
17558
17577
|
}, getProperty = (obj, name) => {
|
|
17559
17578
|
for (const prop of obj.properties) {
|
|
17560
|
-
if (
|
|
17579
|
+
if (lazyTypescript.isPropertyAssignment(prop) && (lazyTypescript.isIdentifier(prop.name) && prop.name.text === name || lazyTypescript.isStringLiteral(prop.name) && prop.name.text === name)) {
|
|
17561
17580
|
return prop.initializer;
|
|
17562
17581
|
}
|
|
17563
17582
|
}
|
|
@@ -17566,7 +17585,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17566
17585
|
const expr = getProperty(obj, name);
|
|
17567
17586
|
if (!expr)
|
|
17568
17587
|
return null;
|
|
17569
|
-
if (
|
|
17588
|
+
if (lazyTypescript.isStringLiteral(expr) || lazyTypescript.isNoSubstitutionTemplateLiteral(expr)) {
|
|
17570
17589
|
return expr.text;
|
|
17571
17590
|
}
|
|
17572
17591
|
return null;
|
|
@@ -17574,22 +17593,22 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17574
17593
|
const expr = getProperty(obj, name);
|
|
17575
17594
|
if (!expr)
|
|
17576
17595
|
return null;
|
|
17577
|
-
if (expr.kind ===
|
|
17596
|
+
if (expr.kind === lazyTypescript.SyntaxKind.TrueKeyword)
|
|
17578
17597
|
return true;
|
|
17579
|
-
if (expr.kind ===
|
|
17598
|
+
if (expr.kind === lazyTypescript.SyntaxKind.FalseKeyword)
|
|
17580
17599
|
return false;
|
|
17581
17600
|
return null;
|
|
17582
17601
|
}, isAngularDecoratorIdentifier = (name) => name === "Component" || name === "Directive" || name === "Pipe" || name === "Injectable", classHasAngularDecorator = (cls) => {
|
|
17583
|
-
for (const dec of
|
|
17602
|
+
for (const dec of lazyTypescript.getDecorators(cls) ?? []) {
|
|
17584
17603
|
const expr = dec.expression;
|
|
17585
|
-
if (
|
|
17604
|
+
if (lazyTypescript.isCallExpression(expr) && lazyTypescript.isIdentifier(expr.expression) && isAngularDecoratorIdentifier(expr.expression.text)) {
|
|
17586
17605
|
return true;
|
|
17587
17606
|
}
|
|
17588
17607
|
}
|
|
17589
17608
|
return false;
|
|
17590
17609
|
}, findClassInSourceFile = (sourceFile, className) => {
|
|
17591
17610
|
for (const stmt of sourceFile.statements) {
|
|
17592
|
-
if (
|
|
17611
|
+
if (lazyTypescript.isClassDeclaration(stmt) && stmt.name?.text === className) {
|
|
17593
17612
|
return stmt;
|
|
17594
17613
|
}
|
|
17595
17614
|
}
|
|
@@ -17599,15 +17618,15 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17599
17618
|
if (sameFile)
|
|
17600
17619
|
return classHasAngularDecorator(sameFile);
|
|
17601
17620
|
for (const stmt of sourceFile.statements) {
|
|
17602
|
-
if (!
|
|
17621
|
+
if (!lazyTypescript.isImportDeclaration(stmt))
|
|
17603
17622
|
continue;
|
|
17604
|
-
if (!
|
|
17623
|
+
if (!lazyTypescript.isStringLiteral(stmt.moduleSpecifier))
|
|
17605
17624
|
continue;
|
|
17606
17625
|
const clause = stmt.importClause;
|
|
17607
17626
|
if (!clause || clause.isTypeOnly)
|
|
17608
17627
|
continue;
|
|
17609
17628
|
const named = clause.namedBindings;
|
|
17610
|
-
if (!named || !
|
|
17629
|
+
if (!named || !lazyTypescript.isNamedImports(named))
|
|
17611
17630
|
continue;
|
|
17612
17631
|
const found = named.elements.find((element) => element.name.text === parentClassName);
|
|
17613
17632
|
if (!found)
|
|
@@ -17632,7 +17651,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17632
17651
|
} catch {
|
|
17633
17652
|
continue;
|
|
17634
17653
|
}
|
|
17635
|
-
const parentSf =
|
|
17654
|
+
const parentSf = lazyTypescript.createSourceFile(candidate, content, lazyTypescript.ScriptTarget.Latest, true);
|
|
17636
17655
|
const parentCls = findClassInSourceFile(parentSf, parentClassName);
|
|
17637
17656
|
if (!parentCls)
|
|
17638
17657
|
continue;
|
|
@@ -17644,11 +17663,11 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17644
17663
|
}, inheritsDecoratedClass = (cls, sourceFile, componentDir, projectRoot) => {
|
|
17645
17664
|
const heritage = cls.heritageClauses ?? [];
|
|
17646
17665
|
for (const clause of heritage) {
|
|
17647
|
-
if (clause.token !==
|
|
17666
|
+
if (clause.token !== lazyTypescript.SyntaxKind.ExtendsKeyword)
|
|
17648
17667
|
continue;
|
|
17649
17668
|
for (const typeNode of clause.types) {
|
|
17650
17669
|
const expr = typeNode.expression;
|
|
17651
|
-
if (!
|
|
17670
|
+
if (!lazyTypescript.isIdentifier(expr)) {
|
|
17652
17671
|
return true;
|
|
17653
17672
|
}
|
|
17654
17673
|
if (parentHasAngularDecoratorAcrossFiles(expr.text, sourceFile, componentDir, projectRoot)) {
|
|
@@ -17659,18 +17678,18 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17659
17678
|
return false;
|
|
17660
17679
|
}, CONTROL_CREATE_METHOD_NAME = "\u0275ngControlCreate", extractControlCreate = (cls) => {
|
|
17661
17680
|
for (const member of cls.members) {
|
|
17662
|
-
if (!
|
|
17681
|
+
if (!lazyTypescript.isMethodDeclaration(member))
|
|
17663
17682
|
continue;
|
|
17664
|
-
if (member.modifiers?.some((item) => item.kind ===
|
|
17683
|
+
if (member.modifiers?.some((item) => item.kind === lazyTypescript.SyntaxKind.StaticKeyword))
|
|
17665
17684
|
continue;
|
|
17666
17685
|
const { name } = member;
|
|
17667
17686
|
if (name === undefined)
|
|
17668
17687
|
continue;
|
|
17669
|
-
const nameText =
|
|
17688
|
+
const nameText = lazyTypescript.isIdentifier(name) ? name.text : name.getText();
|
|
17670
17689
|
if (nameText !== CONTROL_CREATE_METHOD_NAME)
|
|
17671
17690
|
continue;
|
|
17672
17691
|
const [firstParam] = member.parameters;
|
|
17673
|
-
if (firstParam === undefined || firstParam.type === undefined || !
|
|
17692
|
+
if (firstParam === undefined || firstParam.type === undefined || !lazyTypescript.isTypeReferenceNode(firstParam.type)) {
|
|
17674
17693
|
return { passThroughInput: null };
|
|
17675
17694
|
}
|
|
17676
17695
|
const typeArgs = firstParam.type.typeArguments;
|
|
@@ -17678,16 +17697,16 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17678
17697
|
return { passThroughInput: null };
|
|
17679
17698
|
}
|
|
17680
17699
|
const [arg] = typeArgs;
|
|
17681
|
-
if (arg === undefined || !
|
|
17700
|
+
if (arg === undefined || !lazyTypescript.isLiteralTypeNode(arg) || !lazyTypescript.isStringLiteral(arg.literal)) {
|
|
17682
17701
|
return { passThroughInput: null };
|
|
17683
17702
|
}
|
|
17684
17703
|
return { passThroughInput: arg.literal.text };
|
|
17685
17704
|
}
|
|
17686
17705
|
return null;
|
|
17687
17706
|
}, resolveEnumPropertyAccess = (expr, enumName, values) => {
|
|
17688
|
-
if (!
|
|
17707
|
+
if (!lazyTypescript.isPropertyAccessExpression(expr))
|
|
17689
17708
|
return null;
|
|
17690
|
-
if (!
|
|
17709
|
+
if (!lazyTypescript.isIdentifier(expr.expression))
|
|
17691
17710
|
return null;
|
|
17692
17711
|
if (expr.expression.text !== enumName)
|
|
17693
17712
|
return null;
|
|
@@ -17706,21 +17725,21 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17706
17725
|
const hostExpr = getProperty(args, "host");
|
|
17707
17726
|
const schemasExpr = getProperty(args, "schemas");
|
|
17708
17727
|
const styleUrls = [];
|
|
17709
|
-
if (styleUrlsExpr &&
|
|
17728
|
+
if (styleUrlsExpr && lazyTypescript.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
17710
17729
|
for (const element of styleUrlsExpr.elements) {
|
|
17711
|
-
if (
|
|
17730
|
+
if (lazyTypescript.isStringLiteral(element))
|
|
17712
17731
|
styleUrls.push(element.text);
|
|
17713
17732
|
}
|
|
17714
17733
|
}
|
|
17715
17734
|
const styles = [];
|
|
17716
17735
|
if (stylesExpr) {
|
|
17717
|
-
if (
|
|
17736
|
+
if (lazyTypescript.isArrayLiteralExpression(stylesExpr)) {
|
|
17718
17737
|
for (const element of stylesExpr.elements) {
|
|
17719
|
-
if (
|
|
17738
|
+
if (lazyTypescript.isStringLiteral(element) || lazyTypescript.isNoSubstitutionTemplateLiteral(element)) {
|
|
17720
17739
|
styles.push(element.text);
|
|
17721
17740
|
}
|
|
17722
17741
|
}
|
|
17723
|
-
} else if (
|
|
17742
|
+
} else if (lazyTypescript.isStringLiteral(stylesExpr) || lazyTypescript.isNoSubstitutionTemplateLiteral(stylesExpr)) {
|
|
17724
17743
|
styles.push(stylesExpr.text);
|
|
17725
17744
|
}
|
|
17726
17745
|
}
|
|
@@ -17729,19 +17748,19 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17729
17748
|
const changeDetectionExpr = getProperty(args, "changeDetection");
|
|
17730
17749
|
const changeDetection = changeDetectionExpr ? resolveEnumPropertyAccess(changeDetectionExpr, "ChangeDetectionStrategy", CHANGE_DETECTION_VALUES) : null;
|
|
17731
17750
|
return {
|
|
17732
|
-
animationsExpr: animationsExpr &&
|
|
17751
|
+
animationsExpr: animationsExpr && lazyTypescript.isArrayLiteralExpression(animationsExpr) ? animationsExpr : null,
|
|
17733
17752
|
changeDetection,
|
|
17734
17753
|
encapsulation,
|
|
17735
17754
|
hasProviders: getProperty(args, "providers") !== null,
|
|
17736
17755
|
hasViewProviders: getProperty(args, "viewProviders") !== null,
|
|
17737
|
-
hostDirectivesExpr: hostDirectivesExpr &&
|
|
17738
|
-
hostExpr: hostExpr &&
|
|
17739
|
-
importsExpr: importsExpr &&
|
|
17740
|
-
inputsArrayExpr: inputsArrayExpr &&
|
|
17741
|
-
outputsArrayExpr: outputsArrayExpr &&
|
|
17756
|
+
hostDirectivesExpr: hostDirectivesExpr && lazyTypescript.isArrayLiteralExpression(hostDirectivesExpr) ? hostDirectivesExpr : null,
|
|
17757
|
+
hostExpr: hostExpr && lazyTypescript.isObjectLiteralExpression(hostExpr) ? hostExpr : null,
|
|
17758
|
+
importsExpr: importsExpr && lazyTypescript.isArrayLiteralExpression(importsExpr) ? importsExpr : null,
|
|
17759
|
+
inputsArrayExpr: inputsArrayExpr && lazyTypescript.isArrayLiteralExpression(inputsArrayExpr) ? inputsArrayExpr : null,
|
|
17760
|
+
outputsArrayExpr: outputsArrayExpr && lazyTypescript.isArrayLiteralExpression(outputsArrayExpr) ? outputsArrayExpr : null,
|
|
17742
17761
|
preserveWhitespaces: getBooleanProperty(args, "preserveWhitespaces") ?? projectDefaults.preserveWhitespaces ?? false,
|
|
17743
|
-
providersExpr: providersExpr &&
|
|
17744
|
-
schemasExpr: schemasExpr &&
|
|
17762
|
+
providersExpr: providersExpr && lazyTypescript.isArrayLiteralExpression(providersExpr) ? providersExpr : null,
|
|
17763
|
+
schemasExpr: schemasExpr && lazyTypescript.isArrayLiteralExpression(schemasExpr) ? schemasExpr : null,
|
|
17745
17764
|
selector: getStringProperty(args, "selector"),
|
|
17746
17765
|
standalone: getBooleanProperty(args, "standalone") ?? true,
|
|
17747
17766
|
styles,
|
|
@@ -17749,16 +17768,16 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17749
17768
|
styleUrls,
|
|
17750
17769
|
template: getStringProperty(args, "template"),
|
|
17751
17770
|
templateUrl: getStringProperty(args, "templateUrl"),
|
|
17752
|
-
viewProvidersExpr: viewProvidersExpr &&
|
|
17771
|
+
viewProvidersExpr: viewProvidersExpr && lazyTypescript.isArrayLiteralExpression(viewProvidersExpr) ? viewProvidersExpr : null
|
|
17753
17772
|
};
|
|
17754
17773
|
}, extractDecoratorInput = (prop, compiler) => {
|
|
17755
|
-
const decorators =
|
|
17774
|
+
const decorators = lazyTypescript.getDecorators(prop) ?? [];
|
|
17756
17775
|
for (const decorator of decorators) {
|
|
17757
17776
|
const expr = decorator.expression;
|
|
17758
|
-
if (!
|
|
17777
|
+
if (!lazyTypescript.isCallExpression(expr))
|
|
17759
17778
|
continue;
|
|
17760
17779
|
const functionNode = expr.expression;
|
|
17761
|
-
if (!
|
|
17780
|
+
if (!lazyTypescript.isIdentifier(functionNode) || functionNode.text !== "Input")
|
|
17762
17781
|
continue;
|
|
17763
17782
|
const classPropertyName = prop.name.getText();
|
|
17764
17783
|
let bindingPropertyName = classPropertyName;
|
|
@@ -17766,9 +17785,9 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17766
17785
|
let transformFunction = null;
|
|
17767
17786
|
const [arg] = expr.arguments;
|
|
17768
17787
|
if (arg) {
|
|
17769
|
-
if (
|
|
17788
|
+
if (lazyTypescript.isStringLiteral(arg)) {
|
|
17770
17789
|
bindingPropertyName = arg.text;
|
|
17771
|
-
} else if (
|
|
17790
|
+
} else if (lazyTypescript.isObjectLiteralExpression(arg)) {
|
|
17772
17791
|
const aliasNode = getStringProperty(arg, "alias");
|
|
17773
17792
|
if (aliasNode !== null)
|
|
17774
17793
|
bindingPropertyName = aliasNode;
|
|
@@ -17792,11 +17811,11 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17792
17811
|
}
|
|
17793
17812
|
return null;
|
|
17794
17813
|
}, isInputSignalCall = (init) => {
|
|
17795
|
-
if (
|
|
17814
|
+
if (lazyTypescript.isCallExpression(init)) {
|
|
17796
17815
|
const functionNode = init.expression;
|
|
17797
|
-
if (
|
|
17816
|
+
if (lazyTypescript.isIdentifier(functionNode) && functionNode.text === "input")
|
|
17798
17817
|
return true;
|
|
17799
|
-
if (
|
|
17818
|
+
if (lazyTypescript.isPropertyAccessExpression(functionNode) && lazyTypescript.isIdentifier(functionNode.expression) && functionNode.expression.text === "input") {
|
|
17800
17819
|
return true;
|
|
17801
17820
|
}
|
|
17802
17821
|
}
|
|
@@ -17804,18 +17823,18 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17804
17823
|
}, extractSignalInput = (prop, compiler) => {
|
|
17805
17824
|
if (!prop.initializer || !isInputSignalCall(prop.initializer))
|
|
17806
17825
|
return null;
|
|
17807
|
-
if (!
|
|
17826
|
+
if (!lazyTypescript.isCallExpression(prop.initializer))
|
|
17808
17827
|
return null;
|
|
17809
17828
|
const classPropertyName = prop.name.getText();
|
|
17810
17829
|
const call = prop.initializer;
|
|
17811
17830
|
let required = false;
|
|
17812
|
-
if (
|
|
17831
|
+
if (lazyTypescript.isPropertyAccessExpression(call.expression) && lazyTypescript.isIdentifier(call.expression.name) && call.expression.name.text === "required") {
|
|
17813
17832
|
required = true;
|
|
17814
17833
|
}
|
|
17815
17834
|
let bindingPropertyName = classPropertyName;
|
|
17816
17835
|
let transformFunction = null;
|
|
17817
17836
|
const optsArg = call.arguments[required ? 0 : 1];
|
|
17818
|
-
if (optsArg &&
|
|
17837
|
+
if (optsArg && lazyTypescript.isObjectLiteralExpression(optsArg)) {
|
|
17819
17838
|
const aliasNode = getStringProperty(optsArg, "alias");
|
|
17820
17839
|
if (aliasNode !== null)
|
|
17821
17840
|
bindingPropertyName = aliasNode;
|
|
@@ -17835,28 +17854,28 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17835
17854
|
}
|
|
17836
17855
|
};
|
|
17837
17856
|
}, extractDecoratorOutput = (prop) => {
|
|
17838
|
-
const decorators =
|
|
17857
|
+
const decorators = lazyTypescript.getDecorators(prop) ?? [];
|
|
17839
17858
|
for (const decorator of decorators) {
|
|
17840
17859
|
const expr = decorator.expression;
|
|
17841
|
-
if (!
|
|
17860
|
+
if (!lazyTypescript.isCallExpression(expr))
|
|
17842
17861
|
continue;
|
|
17843
17862
|
const functionNode = expr.expression;
|
|
17844
|
-
if (!
|
|
17863
|
+
if (!lazyTypescript.isIdentifier(functionNode) || functionNode.text !== "Output")
|
|
17845
17864
|
continue;
|
|
17846
17865
|
const classPropertyName = prop.name.getText();
|
|
17847
17866
|
let bindingName = classPropertyName;
|
|
17848
17867
|
const [arg] = expr.arguments;
|
|
17849
|
-
if (arg &&
|
|
17868
|
+
if (arg && lazyTypescript.isStringLiteral(arg))
|
|
17850
17869
|
bindingName = arg.text;
|
|
17851
17870
|
return { bindingName, classPropertyName };
|
|
17852
17871
|
}
|
|
17853
17872
|
return null;
|
|
17854
17873
|
}, isOutputSignalCall = (init) => {
|
|
17855
|
-
if (
|
|
17874
|
+
if (lazyTypescript.isCallExpression(init)) {
|
|
17856
17875
|
const functionNode = init.expression;
|
|
17857
|
-
if (
|
|
17876
|
+
if (lazyTypescript.isIdentifier(functionNode) && functionNode.text === "output")
|
|
17858
17877
|
return true;
|
|
17859
|
-
if (
|
|
17878
|
+
if (lazyTypescript.isPropertyAccessExpression(functionNode) && lazyTypescript.isIdentifier(functionNode.expression) && functionNode.expression.text === "output") {
|
|
17860
17879
|
return true;
|
|
17861
17880
|
}
|
|
17862
17881
|
}
|
|
@@ -17864,13 +17883,13 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17864
17883
|
}, extractSignalOutput = (prop) => {
|
|
17865
17884
|
if (!prop.initializer || !isOutputSignalCall(prop.initializer))
|
|
17866
17885
|
return null;
|
|
17867
|
-
if (!
|
|
17886
|
+
if (!lazyTypescript.isCallExpression(prop.initializer))
|
|
17868
17887
|
return null;
|
|
17869
17888
|
const classPropertyName = prop.name.getText();
|
|
17870
17889
|
const call = prop.initializer;
|
|
17871
17890
|
let bindingName = classPropertyName;
|
|
17872
17891
|
const [optsArg] = call.arguments;
|
|
17873
|
-
if (optsArg &&
|
|
17892
|
+
if (optsArg && lazyTypescript.isObjectLiteralExpression(optsArg)) {
|
|
17874
17893
|
const aliasNode = getStringProperty(optsArg, "alias");
|
|
17875
17894
|
if (aliasNode !== null)
|
|
17876
17895
|
bindingName = aliasNode;
|
|
@@ -17882,7 +17901,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17882
17901
|
let hasDecoratorIO = false;
|
|
17883
17902
|
let hasSignalIO = false;
|
|
17884
17903
|
for (const member of cls.members) {
|
|
17885
|
-
if (!
|
|
17904
|
+
if (!lazyTypescript.isPropertyDeclaration(member))
|
|
17886
17905
|
continue;
|
|
17887
17906
|
const decoratorIn = extractDecoratorInput(member, compiler);
|
|
17888
17907
|
if (decoratorIn) {
|
|
@@ -17916,21 +17935,21 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17916
17935
|
specialAttributes: {}
|
|
17917
17936
|
}), parseHostObjectInto = (host, args, hostExprNode, compiler) => {
|
|
17918
17937
|
const hostNode = getProperty(args, "host");
|
|
17919
|
-
if (!hostNode || !
|
|
17938
|
+
if (!hostNode || !lazyTypescript.isObjectLiteralExpression(hostNode)) {
|
|
17920
17939
|
if (!hostExprNode)
|
|
17921
17940
|
return;
|
|
17922
17941
|
}
|
|
17923
|
-
const obj = hostNode &&
|
|
17942
|
+
const obj = hostNode && lazyTypescript.isObjectLiteralExpression(hostNode) ? hostNode : hostExprNode;
|
|
17924
17943
|
if (!obj)
|
|
17925
17944
|
return;
|
|
17926
17945
|
for (const prop of obj.properties) {
|
|
17927
|
-
if (!
|
|
17946
|
+
if (!lazyTypescript.isPropertyAssignment(prop))
|
|
17928
17947
|
continue;
|
|
17929
17948
|
const keyNode = prop.name;
|
|
17930
17949
|
let key;
|
|
17931
|
-
if (
|
|
17950
|
+
if (lazyTypescript.isStringLiteral(keyNode) || lazyTypescript.isNoSubstitutionTemplateLiteral(keyNode)) {
|
|
17932
17951
|
key = keyNode.text;
|
|
17933
|
-
} else if (
|
|
17952
|
+
} else if (lazyTypescript.isIdentifier(keyNode)) {
|
|
17934
17953
|
key = keyNode.text;
|
|
17935
17954
|
} else {
|
|
17936
17955
|
continue;
|
|
@@ -17947,39 +17966,39 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17947
17966
|
}
|
|
17948
17967
|
}, mergeMemberHostDecorators = (host, cls) => {
|
|
17949
17968
|
for (const member of cls.members) {
|
|
17950
|
-
if (!
|
|
17969
|
+
if (!lazyTypescript.canHaveDecorators(member))
|
|
17951
17970
|
continue;
|
|
17952
|
-
const decorators =
|
|
17971
|
+
const decorators = lazyTypescript.getDecorators(member) ?? [];
|
|
17953
17972
|
for (const dec of decorators) {
|
|
17954
17973
|
const expr = dec.expression;
|
|
17955
|
-
if (!
|
|
17974
|
+
if (!lazyTypescript.isCallExpression(expr))
|
|
17956
17975
|
continue;
|
|
17957
17976
|
const functionNode = expr.expression;
|
|
17958
|
-
if (!
|
|
17977
|
+
if (!lazyTypescript.isIdentifier(functionNode))
|
|
17959
17978
|
continue;
|
|
17960
17979
|
if (functionNode.text === "HostBinding") {
|
|
17961
|
-
if (!
|
|
17980
|
+
if (!lazyTypescript.isPropertyDeclaration(member) && !lazyTypescript.isGetAccessor(member))
|
|
17962
17981
|
continue;
|
|
17963
|
-
if (!
|
|
17982
|
+
if (!lazyTypescript.isIdentifier(member.name))
|
|
17964
17983
|
continue;
|
|
17965
17984
|
const propertyName = member.name.text;
|
|
17966
17985
|
const [target] = expr.arguments;
|
|
17967
|
-
const key = target &&
|
|
17986
|
+
const key = target && lazyTypescript.isStringLiteral(target) ? target.text : propertyName;
|
|
17968
17987
|
host.properties[key] = propertyName;
|
|
17969
17988
|
} else if (functionNode.text === "HostListener") {
|
|
17970
|
-
if (!
|
|
17989
|
+
if (!lazyTypescript.isMethodDeclaration(member))
|
|
17971
17990
|
continue;
|
|
17972
|
-
if (!
|
|
17991
|
+
if (!lazyTypescript.isIdentifier(member.name))
|
|
17973
17992
|
continue;
|
|
17974
17993
|
const methodName = member.name.text;
|
|
17975
17994
|
const [eventArg, argsArg] = expr.arguments;
|
|
17976
|
-
if (!eventArg || !
|
|
17995
|
+
if (!eventArg || !lazyTypescript.isStringLiteral(eventArg))
|
|
17977
17996
|
continue;
|
|
17978
17997
|
const event = eventArg.text;
|
|
17979
17998
|
const argsList = [];
|
|
17980
|
-
if (argsArg &&
|
|
17999
|
+
if (argsArg && lazyTypescript.isArrayLiteralExpression(argsArg)) {
|
|
17981
18000
|
for (const element of argsArg.elements) {
|
|
17982
|
-
if (
|
|
18001
|
+
if (lazyTypescript.isStringLiteral(element))
|
|
17983
18002
|
argsList.push(element.text);
|
|
17984
18003
|
}
|
|
17985
18004
|
}
|
|
@@ -17992,14 +18011,14 @@ var fail2 = (reason, detail, location) => ({
|
|
|
17992
18011
|
let descendants = true;
|
|
17993
18012
|
let emitDistinctChangesOnly = true;
|
|
17994
18013
|
const [, opts] = args;
|
|
17995
|
-
if (opts &&
|
|
18014
|
+
if (opts && lazyTypescript.isObjectLiteralExpression(opts)) {
|
|
17996
18015
|
static_ = getBooleanProperty(opts, "static") ?? false;
|
|
17997
18016
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
17998
18017
|
emitDistinctChangesOnly = getBooleanProperty(opts, "emitDistinctChangesOnly") ?? true;
|
|
17999
18018
|
}
|
|
18000
18019
|
return { descendants, emitDistinctChangesOnly, static_ };
|
|
18001
18020
|
}, queryPredicateFromArg = (arg, compiler) => {
|
|
18002
|
-
if (
|
|
18021
|
+
if (lazyTypescript.isStringLiteral(arg)) {
|
|
18003
18022
|
return arg.text.split(",").map((item) => item.trim()).filter(Boolean);
|
|
18004
18023
|
}
|
|
18005
18024
|
return {
|
|
@@ -18010,17 +18029,17 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18010
18029
|
const contentQueries = [];
|
|
18011
18030
|
const viewQueries = [];
|
|
18012
18031
|
for (const member of cls.members) {
|
|
18013
|
-
if (!
|
|
18032
|
+
if (!lazyTypescript.isPropertyDeclaration(member))
|
|
18014
18033
|
continue;
|
|
18015
|
-
const decorators =
|
|
18034
|
+
const decorators = lazyTypescript.getDecorators(member) ?? [];
|
|
18016
18035
|
for (const dec of decorators) {
|
|
18017
18036
|
const expr = dec.expression;
|
|
18018
|
-
if (!
|
|
18037
|
+
if (!lazyTypescript.isCallExpression(expr))
|
|
18019
18038
|
continue;
|
|
18020
18039
|
const functionNode = expr.expression;
|
|
18021
|
-
if (!
|
|
18040
|
+
if (!lazyTypescript.isIdentifier(functionNode) || !QUERY_DECORATORS.has(functionNode.text))
|
|
18022
18041
|
continue;
|
|
18023
|
-
if (!
|
|
18042
|
+
if (!lazyTypescript.isIdentifier(member.name))
|
|
18024
18043
|
continue;
|
|
18025
18044
|
const propertyName = member.name.text;
|
|
18026
18045
|
const [tokenArg, opts] = expr.arguments;
|
|
@@ -18031,7 +18050,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18031
18050
|
continue;
|
|
18032
18051
|
const { static_, descendants, emitDistinctChangesOnly } = parseQueryDecoratorOptions(expr.arguments);
|
|
18033
18052
|
let read = null;
|
|
18034
|
-
if (opts &&
|
|
18053
|
+
if (opts && lazyTypescript.isObjectLiteralExpression(opts)) {
|
|
18035
18054
|
const readNode = getProperty(opts, "read");
|
|
18036
18055
|
if (readNode) {
|
|
18037
18056
|
read = new compiler.WrappedNodeExpr(readNode);
|
|
@@ -18059,15 +18078,15 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18059
18078
|
const contentQueries = [];
|
|
18060
18079
|
const viewQueries = [];
|
|
18061
18080
|
for (const member of cls.members) {
|
|
18062
|
-
if (!
|
|
18081
|
+
if (!lazyTypescript.isPropertyDeclaration(member) || !member.initializer)
|
|
18063
18082
|
continue;
|
|
18064
18083
|
const init = member.initializer;
|
|
18065
|
-
if (!
|
|
18084
|
+
if (!lazyTypescript.isCallExpression(init))
|
|
18066
18085
|
continue;
|
|
18067
18086
|
let queryName;
|
|
18068
|
-
if (
|
|
18087
|
+
if (lazyTypescript.isIdentifier(init.expression)) {
|
|
18069
18088
|
queryName = init.expression.text;
|
|
18070
|
-
} else if (
|
|
18089
|
+
} else if (lazyTypescript.isPropertyAccessExpression(init.expression) && lazyTypescript.isIdentifier(init.expression.expression) && init.expression.name.text === "required") {
|
|
18071
18090
|
queryName = init.expression.expression.text;
|
|
18072
18091
|
} else {
|
|
18073
18092
|
continue;
|
|
@@ -18075,7 +18094,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18075
18094
|
const runtime = SIGNAL_QUERY_TO_RUNTIME[queryName];
|
|
18076
18095
|
if (!runtime)
|
|
18077
18096
|
continue;
|
|
18078
|
-
if (!
|
|
18097
|
+
if (!lazyTypescript.isIdentifier(member.name))
|
|
18079
18098
|
continue;
|
|
18080
18099
|
const propertyName = member.name.text;
|
|
18081
18100
|
const [tokenArg, opts] = init.arguments;
|
|
@@ -18086,7 +18105,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18086
18105
|
continue;
|
|
18087
18106
|
let descendants = true;
|
|
18088
18107
|
let read = null;
|
|
18089
|
-
if (opts &&
|
|
18108
|
+
if (opts && lazyTypescript.isObjectLiteralExpression(opts)) {
|
|
18090
18109
|
descendants = getBooleanProperty(opts, "descendants") ?? true;
|
|
18091
18110
|
const readNode = getProperty(opts, "read");
|
|
18092
18111
|
if (readNode)
|
|
@@ -18112,13 +18131,13 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18112
18131
|
const node = getProperty(args, "exportAs");
|
|
18113
18132
|
if (!node)
|
|
18114
18133
|
return null;
|
|
18115
|
-
if (
|
|
18134
|
+
if (lazyTypescript.isStringLiteral(node)) {
|
|
18116
18135
|
return node.text.split(",").map((item) => item.trim()).filter(Boolean);
|
|
18117
18136
|
}
|
|
18118
|
-
if (
|
|
18137
|
+
if (lazyTypescript.isArrayLiteralExpression(node)) {
|
|
18119
18138
|
const out = [];
|
|
18120
18139
|
for (const element of node.elements) {
|
|
18121
|
-
if (
|
|
18140
|
+
if (lazyTypescript.isStringLiteral(element))
|
|
18122
18141
|
out.push(element.text);
|
|
18123
18142
|
}
|
|
18124
18143
|
return out.length > 0 ? out : null;
|
|
@@ -18126,11 +18145,11 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18126
18145
|
return null;
|
|
18127
18146
|
}, extractHostDirectives = (args, compiler) => {
|
|
18128
18147
|
const node = getProperty(args, "hostDirectives");
|
|
18129
|
-
if (!node || !
|
|
18148
|
+
if (!node || !lazyTypescript.isArrayLiteralExpression(node))
|
|
18130
18149
|
return null;
|
|
18131
18150
|
const out = [];
|
|
18132
18151
|
for (const element of node.elements) {
|
|
18133
|
-
if (
|
|
18152
|
+
if (lazyTypescript.isIdentifier(element)) {
|
|
18134
18153
|
out.push({
|
|
18135
18154
|
directive: {
|
|
18136
18155
|
type: new compiler.WrappedNodeExpr(element),
|
|
@@ -18142,7 +18161,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18142
18161
|
});
|
|
18143
18162
|
continue;
|
|
18144
18163
|
}
|
|
18145
|
-
if (!
|
|
18164
|
+
if (!lazyTypescript.isObjectLiteralExpression(element))
|
|
18146
18165
|
continue;
|
|
18147
18166
|
const directiveNode = getProperty(element, "directive");
|
|
18148
18167
|
if (!directiveNode)
|
|
@@ -18150,11 +18169,11 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18150
18169
|
const inputsNode = getProperty(element, "inputs");
|
|
18151
18170
|
const outputsNode = getProperty(element, "outputs");
|
|
18152
18171
|
const collectMap = (expression) => {
|
|
18153
|
-
if (!expression || !
|
|
18172
|
+
if (!expression || !lazyTypescript.isArrayLiteralExpression(expression))
|
|
18154
18173
|
return null;
|
|
18155
18174
|
const map = {};
|
|
18156
18175
|
for (const mappingElement of expression.elements) {
|
|
18157
|
-
if (!
|
|
18176
|
+
if (!lazyTypescript.isStringLiteral(mappingElement))
|
|
18158
18177
|
continue;
|
|
18159
18178
|
const [name, alias] = mappingElement.text.split(":").map((segment) => segment.trim());
|
|
18160
18179
|
if (name)
|
|
@@ -18224,10 +18243,10 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18224
18243
|
});
|
|
18225
18244
|
return null;
|
|
18226
18245
|
}
|
|
18227
|
-
const sourceFile =
|
|
18246
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true);
|
|
18228
18247
|
let info = null;
|
|
18229
18248
|
for (const stmt of sourceFile.statements) {
|
|
18230
|
-
if (!
|
|
18249
|
+
if (!lazyTypescript.isClassDeclaration(stmt))
|
|
18231
18250
|
continue;
|
|
18232
18251
|
if (!stmt.name || stmt.name.text !== className)
|
|
18233
18252
|
continue;
|
|
@@ -18365,9 +18384,9 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18365
18384
|
}, buildClassToSpecMap = (sourceFile) => {
|
|
18366
18385
|
const result = new Map;
|
|
18367
18386
|
for (const stmt of sourceFile.statements) {
|
|
18368
|
-
if (!
|
|
18387
|
+
if (!lazyTypescript.isImportDeclaration(stmt))
|
|
18369
18388
|
continue;
|
|
18370
|
-
if (!
|
|
18389
|
+
if (!lazyTypescript.isStringLiteral(stmt.moduleSpecifier))
|
|
18371
18390
|
continue;
|
|
18372
18391
|
const spec = stmt.moduleSpecifier.text;
|
|
18373
18392
|
const clause = stmt.importClause;
|
|
@@ -18376,7 +18395,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18376
18395
|
if (clause.name)
|
|
18377
18396
|
result.set(clause.name.text, spec);
|
|
18378
18397
|
const named = clause.namedBindings;
|
|
18379
|
-
if (named &&
|
|
18398
|
+
if (named && lazyTypescript.isNamedImports(named)) {
|
|
18380
18399
|
for (const element of named.elements) {
|
|
18381
18400
|
if (element.isTypeOnly)
|
|
18382
18401
|
continue;
|
|
@@ -18489,7 +18508,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18489
18508
|
return result;
|
|
18490
18509
|
const classToSpec = buildClassToSpecMap(sourceFile);
|
|
18491
18510
|
for (const element of importsExpr.elements) {
|
|
18492
|
-
if (!
|
|
18511
|
+
if (!lazyTypescript.isIdentifier(element))
|
|
18493
18512
|
continue;
|
|
18494
18513
|
const className = element.text;
|
|
18495
18514
|
const spec = classToSpec.get(className);
|
|
@@ -18508,35 +18527,35 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18508
18527
|
}
|
|
18509
18528
|
return (hash >>> 0).toString(36);
|
|
18510
18529
|
}, initializerShapeIsStructural = (node) => {
|
|
18511
|
-
if (
|
|
18530
|
+
if (lazyTypescript.isArrowFunction(node) || lazyTypescript.isFunctionExpression(node) || lazyTypescript.isCallExpression(node) || lazyTypescript.isNewExpression(node)) {
|
|
18512
18531
|
return true;
|
|
18513
18532
|
}
|
|
18514
|
-
if (
|
|
18533
|
+
if (lazyTypescript.isConditionalExpression(node)) {
|
|
18515
18534
|
return initializerShapeIsStructural(node.whenTrue) || initializerShapeIsStructural(node.whenFalse);
|
|
18516
18535
|
}
|
|
18517
|
-
if (
|
|
18536
|
+
if (lazyTypescript.isParenthesizedExpression(node)) {
|
|
18518
18537
|
return initializerShapeIsStructural(node.expression);
|
|
18519
18538
|
}
|
|
18520
|
-
if (
|
|
18539
|
+
if (lazyTypescript.isAsExpression(node) || lazyTypescript.isTypeAssertionExpression(node)) {
|
|
18521
18540
|
return initializerShapeIsStructural(node.expression);
|
|
18522
18541
|
}
|
|
18523
|
-
if (
|
|
18542
|
+
if (lazyTypescript.isNonNullExpression(node)) {
|
|
18524
18543
|
return initializerShapeIsStructural(node.expression);
|
|
18525
18544
|
}
|
|
18526
|
-
if (
|
|
18545
|
+
if (lazyTypescript.isObjectLiteralExpression(node)) {
|
|
18527
18546
|
for (const prop of node.properties) {
|
|
18528
|
-
if (
|
|
18547
|
+
if (lazyTypescript.isPropertyAssignment(prop) && initializerShapeIsStructural(prop.initializer)) {
|
|
18529
18548
|
return true;
|
|
18530
18549
|
}
|
|
18531
|
-
if (
|
|
18550
|
+
if (lazyTypescript.isShorthandPropertyAssignment(prop))
|
|
18532
18551
|
continue;
|
|
18533
|
-
if (
|
|
18552
|
+
if (lazyTypescript.isSpreadAssignment(prop) && initializerShapeIsStructural(prop.expression)) {
|
|
18534
18553
|
return true;
|
|
18535
18554
|
}
|
|
18536
18555
|
}
|
|
18537
18556
|
return false;
|
|
18538
18557
|
}
|
|
18539
|
-
if (
|
|
18558
|
+
if (lazyTypescript.isArrayLiteralExpression(node)) {
|
|
18540
18559
|
for (const element of node.elements) {
|
|
18541
18560
|
if (initializerShapeIsStructural(element))
|
|
18542
18561
|
return true;
|
|
@@ -18547,7 +18566,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18547
18566
|
}, extractArrowFieldSig = (cls) => {
|
|
18548
18567
|
const entries = [];
|
|
18549
18568
|
for (const member of cls.members) {
|
|
18550
|
-
if (!
|
|
18569
|
+
if (!lazyTypescript.isPropertyDeclaration(member))
|
|
18551
18570
|
continue;
|
|
18552
18571
|
const init = member.initializer;
|
|
18553
18572
|
if (!init)
|
|
@@ -18557,12 +18576,12 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18557
18576
|
const name = member.name.getText();
|
|
18558
18577
|
let bodyText;
|
|
18559
18578
|
try {
|
|
18560
|
-
const printer =
|
|
18561
|
-
newLine:
|
|
18579
|
+
const printer = lazyTypescript.createPrinter({
|
|
18580
|
+
newLine: lazyTypescript.NewLineKind.LineFeed,
|
|
18562
18581
|
omitTrailingSemicolon: true,
|
|
18563
18582
|
removeComments: true
|
|
18564
18583
|
});
|
|
18565
|
-
bodyText = printer.printNode(
|
|
18584
|
+
bodyText = printer.printNode(lazyTypescript.EmitHint.Unspecified, init, cls.getSourceFile());
|
|
18566
18585
|
} catch {
|
|
18567
18586
|
bodyText = init.getText();
|
|
18568
18587
|
}
|
|
@@ -18573,9 +18592,9 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18573
18592
|
}, INPUT_OUTPUT_DECORATORS, extractMemberDecoratorSig = (cls) => {
|
|
18574
18593
|
const entries = [];
|
|
18575
18594
|
for (const member of cls.members) {
|
|
18576
|
-
if (!
|
|
18595
|
+
if (!lazyTypescript.canHaveDecorators(member))
|
|
18577
18596
|
continue;
|
|
18578
|
-
const decorators =
|
|
18597
|
+
const decorators = lazyTypescript.getDecorators(member) ?? [];
|
|
18579
18598
|
if (decorators.length === 0)
|
|
18580
18599
|
continue;
|
|
18581
18600
|
const memberName = member.name?.getText() ?? "<anon>";
|
|
@@ -18583,14 +18602,14 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18583
18602
|
const expr = decorator.expression;
|
|
18584
18603
|
let decName = "<unknown>";
|
|
18585
18604
|
let argText = "";
|
|
18586
|
-
if (
|
|
18587
|
-
if (
|
|
18605
|
+
if (lazyTypescript.isCallExpression(expr)) {
|
|
18606
|
+
if (lazyTypescript.isIdentifier(expr.expression)) {
|
|
18588
18607
|
decName = expr.expression.text;
|
|
18589
18608
|
}
|
|
18590
18609
|
if (expr.arguments.length > 0) {
|
|
18591
18610
|
argText = expr.arguments.map((leftValue) => leftValue.getText()).join(",");
|
|
18592
18611
|
}
|
|
18593
|
-
} else if (
|
|
18612
|
+
} else if (lazyTypescript.isIdentifier(expr)) {
|
|
18594
18613
|
decName = expr.text;
|
|
18595
18614
|
}
|
|
18596
18615
|
if (INPUT_OUTPUT_DECORATORS.has(decName))
|
|
@@ -18615,18 +18634,18 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18615
18634
|
} catch {
|
|
18616
18635
|
return true;
|
|
18617
18636
|
}
|
|
18618
|
-
const sourceFile =
|
|
18637
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.ES2022, true, lazyTypescript.ScriptKind.TS);
|
|
18619
18638
|
let hasProviders = false;
|
|
18620
18639
|
const visit = (node) => {
|
|
18621
18640
|
if (hasProviders)
|
|
18622
18641
|
return;
|
|
18623
|
-
if (
|
|
18624
|
-
for (const decorator of
|
|
18642
|
+
if (lazyTypescript.isClassDeclaration(node)) {
|
|
18643
|
+
for (const decorator of lazyTypescript.getDecorators(node) ?? []) {
|
|
18625
18644
|
const expr = decorator.expression;
|
|
18626
|
-
if (!
|
|
18645
|
+
if (!lazyTypescript.isCallExpression(expr))
|
|
18627
18646
|
continue;
|
|
18628
18647
|
const [arg] = expr.arguments;
|
|
18629
|
-
if (!arg || !
|
|
18648
|
+
if (!arg || !lazyTypescript.isObjectLiteralExpression(arg))
|
|
18630
18649
|
continue;
|
|
18631
18650
|
if (getProperty(arg, "providers") !== null) {
|
|
18632
18651
|
hasProviders = true;
|
|
@@ -18634,7 +18653,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18634
18653
|
}
|
|
18635
18654
|
}
|
|
18636
18655
|
}
|
|
18637
|
-
|
|
18656
|
+
lazyTypescript.forEachChild(node, visit);
|
|
18638
18657
|
};
|
|
18639
18658
|
visit(sourceFile);
|
|
18640
18659
|
providerProbeCache.set(filePath, {
|
|
@@ -18644,10 +18663,10 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18644
18663
|
return hasProviders;
|
|
18645
18664
|
}, TS_EXTENSIONS, resolveImportSource = (identifierName, sourceFile, componentDir) => {
|
|
18646
18665
|
for (const stmt of sourceFile.statements) {
|
|
18647
|
-
if (!
|
|
18666
|
+
if (!lazyTypescript.isImportDeclaration(stmt))
|
|
18648
18667
|
continue;
|
|
18649
18668
|
const moduleSpec = stmt.moduleSpecifier;
|
|
18650
|
-
if (!
|
|
18669
|
+
if (!lazyTypescript.isStringLiteral(moduleSpec))
|
|
18651
18670
|
continue;
|
|
18652
18671
|
const spec = moduleSpec.text;
|
|
18653
18672
|
if (!spec.startsWith(".") && !spec.startsWith("/"))
|
|
@@ -18661,7 +18680,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18661
18680
|
}
|
|
18662
18681
|
if (importClause.namedBindings) {
|
|
18663
18682
|
const item = importClause.namedBindings;
|
|
18664
|
-
if (
|
|
18683
|
+
if (lazyTypescript.isNamespaceImport(item)) {
|
|
18665
18684
|
if (item.name.text === identifierName)
|
|
18666
18685
|
matches = true;
|
|
18667
18686
|
} else {
|
|
@@ -18691,7 +18710,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18691
18710
|
return [];
|
|
18692
18711
|
const sig = [];
|
|
18693
18712
|
for (const entry of importsExpr.elements) {
|
|
18694
|
-
if (
|
|
18713
|
+
if (lazyTypescript.isIdentifier(entry)) {
|
|
18695
18714
|
const importPath = resolveImportSource(entry.text, sourceFile, componentDir);
|
|
18696
18715
|
if (importPath) {
|
|
18697
18716
|
if (fileHasModuleProviders(importPath)) {
|
|
@@ -18708,14 +18727,14 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18708
18727
|
}
|
|
18709
18728
|
return sig.sort();
|
|
18710
18729
|
}, getPropertyNameText = (name) => {
|
|
18711
|
-
if (
|
|
18730
|
+
if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name) || lazyTypescript.isNoSubstitutionTemplateLiteral(name)) {
|
|
18712
18731
|
return name.text;
|
|
18713
18732
|
}
|
|
18714
18733
|
return name.getText();
|
|
18715
18734
|
}, extractPropertyFieldNames = (cls) => {
|
|
18716
18735
|
const names = [];
|
|
18717
18736
|
for (const member of cls.members) {
|
|
18718
|
-
if (!
|
|
18737
|
+
if (!lazyTypescript.isPropertyDeclaration(member) && !lazyTypescript.isMethodDeclaration(member) && !lazyTypescript.isGetAccessorDeclaration(member) && !lazyTypescript.isSetAccessorDeclaration(member)) {
|
|
18719
18738
|
continue;
|
|
18720
18739
|
}
|
|
18721
18740
|
const { name } = member;
|
|
@@ -18729,7 +18748,7 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18729
18748
|
}, extractTopLevelImports = (sourceFile) => {
|
|
18730
18749
|
const names = new Set;
|
|
18731
18750
|
for (const stmt of sourceFile.statements) {
|
|
18732
|
-
if (!
|
|
18751
|
+
if (!lazyTypescript.isImportDeclaration(stmt))
|
|
18733
18752
|
continue;
|
|
18734
18753
|
const clause = stmt.importClause;
|
|
18735
18754
|
if (!clause)
|
|
@@ -18741,9 +18760,9 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18741
18760
|
const bindings = clause.namedBindings;
|
|
18742
18761
|
if (!bindings)
|
|
18743
18762
|
continue;
|
|
18744
|
-
if (
|
|
18763
|
+
if (lazyTypescript.isNamespaceImport(bindings)) {
|
|
18745
18764
|
names.add(bindings.name.text);
|
|
18746
|
-
} else if (
|
|
18765
|
+
} else if (lazyTypescript.isNamedImports(bindings)) {
|
|
18747
18766
|
for (const element of bindings.elements) {
|
|
18748
18767
|
if (element.isTypeOnly)
|
|
18749
18768
|
continue;
|
|
@@ -18755,18 +18774,18 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18755
18774
|
}, extractFingerprint = (cls, className, decoratorMeta, inputs, outputs, sourceFile, componentDir) => {
|
|
18756
18775
|
const ctorParamTypes = [];
|
|
18757
18776
|
for (const member of cls.members) {
|
|
18758
|
-
if (!
|
|
18777
|
+
if (!lazyTypescript.isConstructorDeclaration(member))
|
|
18759
18778
|
continue;
|
|
18760
18779
|
for (const param of member.parameters) {
|
|
18761
18780
|
const typeText = param.type ? param.type.getText() : "";
|
|
18762
|
-
const decorators =
|
|
18781
|
+
const decorators = lazyTypescript.getDecorators(param) ?? [];
|
|
18763
18782
|
const decoratorSig = decorators.length === 0 ? "" : decorators.map((d) => {
|
|
18764
18783
|
const expr = d.expression;
|
|
18765
|
-
if (
|
|
18784
|
+
if (lazyTypescript.isCallExpression(expr) && lazyTypescript.isIdentifier(expr.expression)) {
|
|
18766
18785
|
const args = expr.arguments.map((a) => a.getText()).join(",");
|
|
18767
18786
|
return `@${expr.expression.text}(${args})`;
|
|
18768
18787
|
}
|
|
18769
|
-
if (
|
|
18788
|
+
if (lazyTypescript.isIdentifier(expr)) {
|
|
18770
18789
|
return `@${expr.text}`;
|
|
18771
18790
|
}
|
|
18772
18791
|
return "@<unknown>";
|
|
@@ -18782,12 +18801,12 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18782
18801
|
const providerImportSig = extractProviderImportSig(decoratorMeta.importsExpr, sourceFile, componentDir);
|
|
18783
18802
|
const topLevelImports = extractTopLevelImports(sourceFile);
|
|
18784
18803
|
const propertyFieldNames = extractPropertyFieldNames(cls);
|
|
18785
|
-
const printer =
|
|
18786
|
-
newLine:
|
|
18804
|
+
const printer = lazyTypescript.createPrinter({
|
|
18805
|
+
newLine: lazyTypescript.NewLineKind.LineFeed,
|
|
18787
18806
|
omitTrailingSemicolon: true,
|
|
18788
18807
|
removeComments: true
|
|
18789
18808
|
});
|
|
18790
|
-
const canonicalText = (node) => printer.printNode(
|
|
18809
|
+
const canonicalText = (node) => printer.printNode(lazyTypescript.EmitHint.Unspecified, node, sourceFile);
|
|
18791
18810
|
const importsArraySig = decoratorMeta.importsExpr ? djb2Hash(canonicalText(decoratorMeta.importsExpr)) : "";
|
|
18792
18811
|
const hostDirectivesSig = decoratorMeta.hostDirectivesExpr ? djb2Hash(canonicalText(decoratorMeta.hostDirectivesExpr)) : "";
|
|
18793
18812
|
const animationsArraySig = decoratorMeta.animationsExpr ? djb2Hash(canonicalText(decoratorMeta.animationsExpr)) : "";
|
|
@@ -18800,13 +18819,13 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18800
18819
|
const PAGE_EXPORT_NAMES = new Set(["providers", "routes"]);
|
|
18801
18820
|
const pageExportEntries = [];
|
|
18802
18821
|
for (const stmt of sourceFile.statements) {
|
|
18803
|
-
if (!
|
|
18822
|
+
if (!lazyTypescript.isVariableStatement(stmt))
|
|
18804
18823
|
continue;
|
|
18805
|
-
const isExported = stmt.modifiers?.some((item) => item.kind ===
|
|
18824
|
+
const isExported = stmt.modifiers?.some((item) => item.kind === lazyTypescript.SyntaxKind.ExportKeyword);
|
|
18806
18825
|
if (!isExported)
|
|
18807
18826
|
continue;
|
|
18808
18827
|
for (const decl of stmt.declarationList.declarations) {
|
|
18809
|
-
if (!
|
|
18828
|
+
if (!lazyTypescript.isIdentifier(decl.name))
|
|
18810
18829
|
continue;
|
|
18811
18830
|
if (!PAGE_EXPORT_NAMES.has(decl.name.text))
|
|
18812
18831
|
continue;
|
|
@@ -18847,35 +18866,35 @@ var fail2 = (reason, detail, location) => ({
|
|
|
18847
18866
|
}, buildFreshClassMethodsBlock = (classNode, className) => {
|
|
18848
18867
|
const memberSources = [];
|
|
18849
18868
|
let hasStatic = false;
|
|
18850
|
-
const printer =
|
|
18869
|
+
const printer = lazyTypescript.createPrinter({ removeComments: true });
|
|
18851
18870
|
for (const member of classNode.members) {
|
|
18852
|
-
if (
|
|
18853
|
-
const modifiers = (
|
|
18854
|
-
const cleaned =
|
|
18855
|
-
memberSources.push(printer.printNode(
|
|
18871
|
+
if (lazyTypescript.isPropertyDeclaration(member)) {
|
|
18872
|
+
const modifiers = (lazyTypescript.getModifiers(member) ?? []).filter((m) => m.kind !== lazyTypescript.SyntaxKind.PrivateKeyword && m.kind !== lazyTypescript.SyntaxKind.PublicKeyword && m.kind !== lazyTypescript.SyntaxKind.ProtectedKeyword && m.kind !== lazyTypescript.SyntaxKind.ReadonlyKeyword && m.kind !== lazyTypescript.SyntaxKind.OverrideKeyword);
|
|
18873
|
+
const cleaned = lazyTypescript.factory.createPropertyDeclaration(modifiers, member.name, undefined, undefined, member.initializer);
|
|
18874
|
+
memberSources.push(printer.printNode(lazyTypescript.EmitHint.Unspecified, cleaned, classNode.getSourceFile()));
|
|
18856
18875
|
continue;
|
|
18857
18876
|
}
|
|
18858
|
-
if (
|
|
18859
|
-
const cleanedParams = member.parameters.map((param) =>
|
|
18860
|
-
const cleaned =
|
|
18861
|
-
memberSources.push(printer.printNode(
|
|
18877
|
+
if (lazyTypescript.isConstructorDeclaration(member)) {
|
|
18878
|
+
const cleanedParams = member.parameters.map((param) => lazyTypescript.factory.updateParameterDeclaration(param, (lazyTypescript.getModifiers(param) ?? []).filter((item) => item.kind !== lazyTypescript.SyntaxKind.PrivateKeyword && item.kind !== lazyTypescript.SyntaxKind.PublicKeyword && item.kind !== lazyTypescript.SyntaxKind.ProtectedKeyword && item.kind !== lazyTypescript.SyntaxKind.ReadonlyKeyword && item.kind !== lazyTypescript.SyntaxKind.OverrideKeyword), param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer));
|
|
18879
|
+
const cleaned = lazyTypescript.factory.createConstructorDeclaration([], cleanedParams, member.body);
|
|
18880
|
+
memberSources.push(printer.printNode(lazyTypescript.EmitHint.Unspecified, cleaned, classNode.getSourceFile()));
|
|
18862
18881
|
continue;
|
|
18863
18882
|
}
|
|
18864
|
-
if (
|
|
18865
|
-
const modifiers =
|
|
18866
|
-
const isStatic = modifiers.some((m) => m.kind ===
|
|
18883
|
+
if (lazyTypescript.isMethodDeclaration(member) || lazyTypescript.isGetAccessorDeclaration(member) || lazyTypescript.isSetAccessorDeclaration(member)) {
|
|
18884
|
+
const modifiers = lazyTypescript.getModifiers(member) ?? [];
|
|
18885
|
+
const isStatic = modifiers.some((m) => m.kind === lazyTypescript.SyntaxKind.StaticKeyword);
|
|
18867
18886
|
if (isStatic)
|
|
18868
18887
|
hasStatic = true;
|
|
18869
|
-
const cleanedParams = member.parameters.map((param) =>
|
|
18888
|
+
const cleanedParams = member.parameters.map((param) => lazyTypescript.factory.updateParameterDeclaration(param, lazyTypescript.getModifiers(param) ?? [], param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer));
|
|
18870
18889
|
let cleaned;
|
|
18871
|
-
if (
|
|
18872
|
-
cleaned =
|
|
18873
|
-
} else if (
|
|
18874
|
-
cleaned =
|
|
18890
|
+
if (lazyTypescript.isMethodDeclaration(member)) {
|
|
18891
|
+
cleaned = lazyTypescript.factory.createMethodDeclaration(modifiers, member.asteriskToken, member.name, member.questionToken, member.typeParameters, cleanedParams, member.type, member.body);
|
|
18892
|
+
} else if (lazyTypescript.isGetAccessorDeclaration(member)) {
|
|
18893
|
+
cleaned = lazyTypescript.factory.createGetAccessorDeclaration(modifiers, member.name, cleanedParams, member.type, member.body);
|
|
18875
18894
|
} else {
|
|
18876
|
-
cleaned =
|
|
18895
|
+
cleaned = lazyTypescript.factory.createSetAccessorDeclaration(modifiers, member.name, cleanedParams, member.body);
|
|
18877
18896
|
}
|
|
18878
|
-
const printed = printer.printNode(
|
|
18897
|
+
const printed = printer.printNode(lazyTypescript.EmitHint.Unspecified, cleaned, classNode.getSourceFile());
|
|
18879
18898
|
memberSources.push(printed);
|
|
18880
18899
|
}
|
|
18881
18900
|
}
|
|
@@ -18887,10 +18906,10 @@ ${memberSources.join(`
|
|
|
18887
18906
|
}`;
|
|
18888
18907
|
let transpiled;
|
|
18889
18908
|
try {
|
|
18890
|
-
transpiled =
|
|
18909
|
+
transpiled = lazyTypescript.transpileModule(wrappedSource, {
|
|
18891
18910
|
compilerOptions: {
|
|
18892
|
-
module:
|
|
18893
|
-
target:
|
|
18911
|
+
module: lazyTypescript.ModuleKind.ES2022,
|
|
18912
|
+
target: lazyTypescript.ScriptTarget.ES2022
|
|
18894
18913
|
},
|
|
18895
18914
|
reportDiagnostics: false
|
|
18896
18915
|
}).outputText;
|
|
@@ -18975,7 +18994,7 @@ ${block}
|
|
|
18975
18994
|
if (existsSync30(tsconfigPath)) {
|
|
18976
18995
|
try {
|
|
18977
18996
|
const text = readFileSync24(tsconfigPath, "utf8");
|
|
18978
|
-
const parsed =
|
|
18997
|
+
const parsed = lazyTypescript.parseConfigFileTextToJson(tsconfigPath, text);
|
|
18979
18998
|
if (!parsed.error && parsed.config) {
|
|
18980
18999
|
const cfg = parsed.config;
|
|
18981
19000
|
const ang = cfg.angularCompilerOptions ?? {};
|
|
@@ -19009,7 +19028,7 @@ ${block}
|
|
|
19009
19028
|
return fail2("unexpected-error", `import @angular/compiler: ${err}`);
|
|
19010
19029
|
}
|
|
19011
19030
|
const tsSource = readFileSync24(componentFilePath, "utf8");
|
|
19012
|
-
const sourceFile =
|
|
19031
|
+
const sourceFile = lazyTypescript.createSourceFile(componentFilePath, tsSource, lazyTypescript.ScriptTarget.ES2022, true, lazyTypescript.ScriptKind.TS);
|
|
19013
19032
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
19014
19033
|
if (!classNode) {
|
|
19015
19034
|
return fail2("class-not-found", `${className} in ${componentFilePath}`);
|
|
@@ -19138,7 +19157,7 @@ ${block}
|
|
|
19138
19157
|
isSignal: (hasSignalIO || advancedMetadata.contentQueries.some((item) => item.isSignal) || advancedMetadata.viewQueries.some((item) => item.isSignal)) && !hasDecoratorIO && !advancedMetadata.contentQueries.some((item) => !item.isSignal) && !advancedMetadata.viewQueries.some((item) => !item.isSignal),
|
|
19139
19158
|
isStandalone: decoratorMeta.standalone,
|
|
19140
19159
|
lifecycle: {
|
|
19141
|
-
usesOnChanges: classNode.members.some((m) =>
|
|
19160
|
+
usesOnChanges: classNode.members.some((m) => lazyTypescript.isMethodDeclaration(m) && m.name !== undefined && lazyTypescript.isIdentifier(m.name) && m.name.text === "ngOnChanges")
|
|
19142
19161
|
},
|
|
19143
19162
|
name: className,
|
|
19144
19163
|
outputs,
|
|
@@ -19187,18 +19206,18 @@ ${block}
|
|
|
19187
19206
|
}
|
|
19188
19207
|
const importGenerator = createHmrImportGenerator(namespaceMap);
|
|
19189
19208
|
const tsFunctionDecl = translateStatement(sourceFile, callback, importGenerator);
|
|
19190
|
-
if (!
|
|
19209
|
+
if (!lazyTypescript.isFunctionDeclaration(tsFunctionDecl)) {
|
|
19191
19210
|
return fail2("unexpected-error", "Angular HMR callback did not translate to a function declaration");
|
|
19192
19211
|
}
|
|
19193
|
-
const exportedDecl =
|
|
19194
|
-
|
|
19195
|
-
|
|
19212
|
+
const exportedDecl = lazyTypescript.factory.updateFunctionDeclaration(tsFunctionDecl, [
|
|
19213
|
+
lazyTypescript.factory.createToken(lazyTypescript.SyntaxKind.ExportKeyword),
|
|
19214
|
+
lazyTypescript.factory.createToken(lazyTypescript.SyntaxKind.DefaultKeyword)
|
|
19196
19215
|
], tsFunctionDecl.asteriskToken, tsFunctionDecl.name, tsFunctionDecl.typeParameters, tsFunctionDecl.parameters, tsFunctionDecl.type, tsFunctionDecl.body);
|
|
19197
|
-
const printer =
|
|
19198
|
-
newLine:
|
|
19216
|
+
const printer = lazyTypescript.createPrinter({
|
|
19217
|
+
newLine: lazyTypescript.NewLineKind.LineFeed,
|
|
19199
19218
|
removeComments: false
|
|
19200
19219
|
});
|
|
19201
|
-
const fnText = printer.printNode(
|
|
19220
|
+
const fnText = printer.printNode(lazyTypescript.EmitHint.Unspecified, exportedDecl, sourceFile);
|
|
19202
19221
|
const provisionalMethodsBlock = buildFreshClassMethodsBlock(classNode, className) ?? "";
|
|
19203
19222
|
const referencedNames = new Set;
|
|
19204
19223
|
const identRe = /[A-Za-z_$][A-Za-z0-9_$]*/g;
|
|
@@ -19208,32 +19227,32 @@ ${block}
|
|
|
19208
19227
|
}
|
|
19209
19228
|
const sourceScopeNames = new Set;
|
|
19210
19229
|
for (const stmt of sourceFile.statements) {
|
|
19211
|
-
if (
|
|
19212
|
-
if (!
|
|
19230
|
+
if (lazyTypescript.isImportDeclaration(stmt)) {
|
|
19231
|
+
if (!lazyTypescript.isStringLiteral(stmt.moduleSpecifier))
|
|
19213
19232
|
continue;
|
|
19214
19233
|
const clause = stmt.importClause;
|
|
19215
19234
|
if (clause?.name)
|
|
19216
19235
|
sourceScopeNames.add(clause.name.text);
|
|
19217
|
-
if (clause?.namedBindings &&
|
|
19236
|
+
if (clause?.namedBindings && lazyTypescript.isNamedImports(clause.namedBindings)) {
|
|
19218
19237
|
for (const element of clause.namedBindings.elements) {
|
|
19219
19238
|
if (element.isTypeOnly)
|
|
19220
19239
|
continue;
|
|
19221
19240
|
sourceScopeNames.add(element.name.text);
|
|
19222
19241
|
}
|
|
19223
|
-
} else if (clause?.namedBindings &&
|
|
19242
|
+
} else if (clause?.namedBindings && lazyTypescript.isNamespaceImport(clause.namedBindings)) {
|
|
19224
19243
|
sourceScopeNames.add(clause.namedBindings.name.text);
|
|
19225
19244
|
}
|
|
19226
19245
|
continue;
|
|
19227
19246
|
}
|
|
19228
|
-
if (
|
|
19247
|
+
if (lazyTypescript.isVariableStatement(stmt)) {
|
|
19229
19248
|
for (const decl of stmt.declarationList.declarations) {
|
|
19230
|
-
if (
|
|
19249
|
+
if (lazyTypescript.isIdentifier(decl.name)) {
|
|
19231
19250
|
sourceScopeNames.add(decl.name.text);
|
|
19232
19251
|
}
|
|
19233
19252
|
}
|
|
19234
19253
|
continue;
|
|
19235
19254
|
}
|
|
19236
|
-
if (
|
|
19255
|
+
if (lazyTypescript.isFunctionDeclaration(stmt) || lazyTypescript.isClassDeclaration(stmt)) {
|
|
19237
19256
|
if (stmt.name)
|
|
19238
19257
|
sourceScopeNames.add(stmt.name.text);
|
|
19239
19258
|
}
|
|
@@ -19244,7 +19263,7 @@ ${block}
|
|
|
19244
19263
|
}
|
|
19245
19264
|
const allImportedNames = new Set;
|
|
19246
19265
|
for (const stmt of sourceFile.statements) {
|
|
19247
|
-
if (!
|
|
19266
|
+
if (!lazyTypescript.isImportDeclaration(stmt))
|
|
19248
19267
|
continue;
|
|
19249
19268
|
const clause = stmt.importClause;
|
|
19250
19269
|
if (!clause || clause.isTypeOnly)
|
|
@@ -19254,7 +19273,7 @@ ${block}
|
|
|
19254
19273
|
const bindings = clause.namedBindings;
|
|
19255
19274
|
if (!bindings)
|
|
19256
19275
|
continue;
|
|
19257
|
-
if (
|
|
19276
|
+
if (lazyTypescript.isNamespaceImport(bindings)) {
|
|
19258
19277
|
allImportedNames.add(bindings.name.text);
|
|
19259
19278
|
} else {
|
|
19260
19279
|
for (const element of bindings.elements) {
|
|
@@ -19266,10 +19285,10 @@ ${block}
|
|
|
19266
19285
|
}
|
|
19267
19286
|
const depsToDestructure = [...sourceScopeNames].filter((n) => referencedNames.has(n) || allImportedNames.has(n));
|
|
19268
19287
|
const tsSourceText = fnText;
|
|
19269
|
-
const transpiled =
|
|
19288
|
+
const transpiled = lazyTypescript.transpileModule(tsSourceText, {
|
|
19270
19289
|
compilerOptions: {
|
|
19271
|
-
module:
|
|
19272
|
-
target:
|
|
19290
|
+
module: lazyTypescript.ModuleKind.ES2022,
|
|
19291
|
+
target: lazyTypescript.ScriptTarget.ES2022
|
|
19273
19292
|
},
|
|
19274
19293
|
fileName: componentFilePath,
|
|
19275
19294
|
reportDiagnostics: false
|
|
@@ -19326,6 +19345,7 @@ ${methodsBlock}
|
|
|
19326
19345
|
}
|
|
19327
19346
|
};
|
|
19328
19347
|
var init_fastHmrCompiler = __esm(() => {
|
|
19348
|
+
init_lazyTypescript();
|
|
19329
19349
|
init_stylePreprocessor();
|
|
19330
19350
|
init_hmrImportGenerator();
|
|
19331
19351
|
init_typescript_translator();
|
|
@@ -19382,11 +19402,10 @@ var init_fastHmrCompiler = __esm(() => {
|
|
|
19382
19402
|
// src/build/scanVueSsrOnlyPages.ts
|
|
19383
19403
|
import { readdirSync as readdirSync3, readFileSync as readFileSync25 } from "fs";
|
|
19384
19404
|
import { join as join40 } from "path";
|
|
19385
|
-
import ts13 from "typescript";
|
|
19386
19405
|
var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
19387
19406
|
if (filePath.endsWith(".tsx"))
|
|
19388
|
-
return
|
|
19389
|
-
return
|
|
19407
|
+
return lazyTypescript.ScriptKind.TSX;
|
|
19408
|
+
return lazyTypescript.ScriptKind.TS;
|
|
19390
19409
|
}, hasSourceExtension2 = (filePath) => {
|
|
19391
19410
|
const idx = filePath.lastIndexOf(".");
|
|
19392
19411
|
if (idx === -1)
|
|
@@ -19422,51 +19441,51 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
19422
19441
|
}
|
|
19423
19442
|
return out;
|
|
19424
19443
|
}, fileMayContainVueHandler = (source) => source.includes("handleVuePageRequest"), isHandleVuePageRequestCallee = (expression) => {
|
|
19425
|
-
if (
|
|
19444
|
+
if (lazyTypescript.isIdentifier(expression)) {
|
|
19426
19445
|
return expression.text === "handleVuePageRequest";
|
|
19427
19446
|
}
|
|
19428
|
-
if (
|
|
19447
|
+
if (lazyTypescript.isPropertyAccessExpression(expression) && lazyTypescript.isIdentifier(expression.name)) {
|
|
19429
19448
|
return expression.name.text === "handleVuePageRequest";
|
|
19430
19449
|
}
|
|
19431
19450
|
return false;
|
|
19432
19451
|
}, getPropertyName = (name) => {
|
|
19433
|
-
if (
|
|
19452
|
+
if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name)) {
|
|
19434
19453
|
return name.text;
|
|
19435
19454
|
}
|
|
19436
19455
|
return null;
|
|
19437
19456
|
}, unwrapExpression = (node) => {
|
|
19438
|
-
if (
|
|
19457
|
+
if (lazyTypescript.isAsExpression(node) || lazyTypescript.isSatisfiesExpression(node) || lazyTypescript.isParenthesizedExpression(node) || lazyTypescript.isTypeAssertionExpression(node)) {
|
|
19439
19458
|
return unwrapExpression(node.expression);
|
|
19440
19459
|
}
|
|
19441
19460
|
return node;
|
|
19442
19461
|
}, readLiteral = (node) => {
|
|
19443
19462
|
const inner = unwrapExpression(node);
|
|
19444
|
-
if (
|
|
19463
|
+
if (lazyTypescript.isStringLiteral(inner) || lazyTypescript.isNoSubstitutionTemplateLiteral(inner)) {
|
|
19445
19464
|
return inner.text;
|
|
19446
19465
|
}
|
|
19447
19466
|
return null;
|
|
19448
|
-
}, isConstDeclaration = (declaration) =>
|
|
19467
|
+
}, isConstDeclaration = (declaration) => lazyTypescript.isVariableDeclarationList(declaration.parent) && (declaration.parent.flags & lazyTypescript.NodeFlags.Const) !== 0, collectConstStrings = (sourceFile) => {
|
|
19449
19468
|
const constants = new Map;
|
|
19450
19469
|
const visit = (node) => {
|
|
19451
|
-
if (
|
|
19470
|
+
if (lazyTypescript.isVariableDeclaration(node) && lazyTypescript.isIdentifier(node.name) && node.initializer && isConstDeclaration(node)) {
|
|
19452
19471
|
const name = node.name.text;
|
|
19453
19472
|
const value = readLiteral(node.initializer);
|
|
19454
19473
|
const known = constants.has(name);
|
|
19455
19474
|
constants.set(name, known && constants.get(name) !== value ? null : value);
|
|
19456
19475
|
}
|
|
19457
|
-
|
|
19476
|
+
lazyTypescript.forEachChild(node, visit);
|
|
19458
19477
|
};
|
|
19459
|
-
|
|
19478
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
19460
19479
|
return constants;
|
|
19461
19480
|
}, readStringValue = (node, constants) => {
|
|
19462
19481
|
const inner = unwrapExpression(node);
|
|
19463
|
-
if (
|
|
19482
|
+
if (lazyTypescript.isIdentifier(inner))
|
|
19464
19483
|
return constants.get(inner.text) ?? null;
|
|
19465
19484
|
return readLiteral(inner);
|
|
19466
19485
|
}, isAssetCall = (node) => {
|
|
19467
|
-
if (!
|
|
19486
|
+
if (!lazyTypescript.isCallExpression(node))
|
|
19468
19487
|
return false;
|
|
19469
|
-
if (!
|
|
19488
|
+
if (!lazyTypescript.isIdentifier(node.expression))
|
|
19470
19489
|
return false;
|
|
19471
19490
|
return node.expression.text === "asset";
|
|
19472
19491
|
}, extractAssetLiteralKey = (call, constants) => {
|
|
@@ -19479,14 +19498,14 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
19479
19498
|
}, extractPagePathAssetKey = (initializer, constants) => {
|
|
19480
19499
|
if (!isAssetCall(initializer))
|
|
19481
19500
|
return null;
|
|
19482
|
-
if (!
|
|
19501
|
+
if (!lazyTypescript.isCallExpression(initializer))
|
|
19483
19502
|
return null;
|
|
19484
19503
|
return extractAssetLiteralKey(initializer, constants);
|
|
19485
19504
|
}, readProperty = (property) => {
|
|
19486
|
-
if (
|
|
19505
|
+
if (lazyTypescript.isShorthandPropertyAssignment(property)) {
|
|
19487
19506
|
return { name: property.name.text, value: property.name };
|
|
19488
19507
|
}
|
|
19489
|
-
if (!
|
|
19508
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
19490
19509
|
return null;
|
|
19491
19510
|
const name = getPropertyName(property.name);
|
|
19492
19511
|
return name ? { name, value: property.initializer } : null;
|
|
@@ -19518,20 +19537,20 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
19518
19537
|
}
|
|
19519
19538
|
if (!fileMayContainVueHandler(source))
|
|
19520
19539
|
return [];
|
|
19521
|
-
const sourceFile =
|
|
19540
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, getScriptKind3(filePath));
|
|
19522
19541
|
const constants = collectConstStrings(sourceFile);
|
|
19523
19542
|
const visit = (node) => {
|
|
19524
|
-
if (
|
|
19543
|
+
if (lazyTypescript.isCallExpression(node) && isHandleVuePageRequestCallee(node.expression)) {
|
|
19525
19544
|
const firstArg = node.arguments[0];
|
|
19526
|
-
if (firstArg &&
|
|
19545
|
+
if (firstArg && lazyTypescript.isObjectLiteralExpression(firstArg)) {
|
|
19527
19546
|
const pageName = extractSsrOnlyPageName(firstArg, constants);
|
|
19528
19547
|
if (pageName)
|
|
19529
19548
|
out.add(pageName);
|
|
19530
19549
|
}
|
|
19531
19550
|
}
|
|
19532
|
-
|
|
19551
|
+
lazyTypescript.forEachChild(node, visit);
|
|
19533
19552
|
};
|
|
19534
|
-
|
|
19553
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
19535
19554
|
return [...out];
|
|
19536
19555
|
}, ssrOnlyNameCache, scanVueSsrOnlyPages = (projectRoot, memoise = false) => {
|
|
19537
19556
|
const files = collectSourceFiles2(projectRoot);
|
|
@@ -19546,6 +19565,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
19546
19565
|
return ssrOnlyPageNames;
|
|
19547
19566
|
};
|
|
19548
19567
|
var init_scanVueSsrOnlyPages = __esm(() => {
|
|
19568
|
+
init_lazyTypescript();
|
|
19549
19569
|
init_stampedFileCache();
|
|
19550
19570
|
SKIP_DIRS2 = new Set([
|
|
19551
19571
|
".absolutejs",
|
|
@@ -19566,11 +19586,10 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
19566
19586
|
// src/build/scanAngularHandlerCalls.ts
|
|
19567
19587
|
import { readdirSync as readdirSync4, readFileSync as readFileSync26 } from "fs";
|
|
19568
19588
|
import { join as join41 } from "path";
|
|
19569
|
-
import ts14 from "typescript";
|
|
19570
19589
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
19571
19590
|
if (filePath.endsWith(".tsx"))
|
|
19572
|
-
return
|
|
19573
|
-
return
|
|
19591
|
+
return lazyTypescript.ScriptKind.TSX;
|
|
19592
|
+
return lazyTypescript.ScriptKind.TS;
|
|
19574
19593
|
}, hasSourceExtension3 = (filePath) => {
|
|
19575
19594
|
const idx = filePath.lastIndexOf(".");
|
|
19576
19595
|
if (idx === -1)
|
|
@@ -19606,25 +19625,25 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PRE
|
|
|
19606
19625
|
}
|
|
19607
19626
|
return out;
|
|
19608
19627
|
}, fileMayContainAngularHandler = (source) => source.includes("handleAngularPageRequest"), extractManifestKey = (pagePathValue) => {
|
|
19609
|
-
if (!
|
|
19628
|
+
if (!lazyTypescript.isCallExpression(pagePathValue))
|
|
19610
19629
|
return null;
|
|
19611
19630
|
const callee = pagePathValue.expression;
|
|
19612
|
-
if (!
|
|
19631
|
+
if (!lazyTypescript.isIdentifier(callee) || callee.text !== "asset")
|
|
19613
19632
|
return null;
|
|
19614
19633
|
const [, second] = pagePathValue.arguments;
|
|
19615
19634
|
if (!second)
|
|
19616
19635
|
return null;
|
|
19617
|
-
if (!
|
|
19636
|
+
if (!lazyTypescript.isStringLiteral(second))
|
|
19618
19637
|
return null;
|
|
19619
19638
|
return second.text;
|
|
19620
19639
|
}, findEnclosingMountPath = (node) => {
|
|
19621
19640
|
let cursor = node.parent;
|
|
19622
19641
|
while (cursor) {
|
|
19623
|
-
if (
|
|
19642
|
+
if (lazyTypescript.isCallExpression(cursor)) {
|
|
19624
19643
|
const callee = cursor.expression;
|
|
19625
|
-
if (
|
|
19644
|
+
if (lazyTypescript.isPropertyAccessExpression(callee) && lazyTypescript.isIdentifier(callee.name) && ELYSIA_ROUTE_METHODS2.has(callee.name.text)) {
|
|
19626
19645
|
const firstArg = cursor.arguments[0];
|
|
19627
|
-
if (firstArg &&
|
|
19646
|
+
if (firstArg && lazyTypescript.isStringLiteral(firstArg) && firstArg.text.startsWith("/")) {
|
|
19628
19647
|
return firstArg.text;
|
|
19629
19648
|
}
|
|
19630
19649
|
}
|
|
@@ -19641,27 +19660,27 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PRE
|
|
|
19641
19660
|
}
|
|
19642
19661
|
if (!fileMayContainAngularHandler(source))
|
|
19643
19662
|
return;
|
|
19644
|
-
const sf =
|
|
19663
|
+
const sf = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, getScriptKind4(filePath));
|
|
19645
19664
|
const visit = (node) => {
|
|
19646
|
-
if (
|
|
19665
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "handleAngularPageRequest") {
|
|
19647
19666
|
const [arg] = node.arguments;
|
|
19648
|
-
if (arg &&
|
|
19667
|
+
if (arg && lazyTypescript.isObjectLiteralExpression(arg)) {
|
|
19649
19668
|
let manifestKey = null;
|
|
19650
19669
|
for (const prop of arg.properties) {
|
|
19651
|
-
if (
|
|
19670
|
+
if (lazyTypescript.isPropertyAssignment(prop)) {
|
|
19652
19671
|
if (!prop.name)
|
|
19653
19672
|
continue;
|
|
19654
|
-
const name =
|
|
19673
|
+
const name = lazyTypescript.isIdentifier(prop.name) ? prop.name.text : lazyTypescript.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
19655
19674
|
if (name === "pagePath") {
|
|
19656
19675
|
manifestKey = extractManifestKey(prop.initializer);
|
|
19657
19676
|
}
|
|
19658
|
-
} else if (
|
|
19677
|
+
} else if (lazyTypescript.isSpreadAssignment(prop)) {
|
|
19659
19678
|
if (manifestKey)
|
|
19660
19679
|
continue;
|
|
19661
19680
|
const spreadExpr = prop.expression;
|
|
19662
|
-
if (
|
|
19681
|
+
if (lazyTypescript.isCallExpression(spreadExpr) && spreadExpr.arguments.length > 0) {
|
|
19663
19682
|
const [firstArg] = spreadExpr.arguments;
|
|
19664
|
-
if (firstArg &&
|
|
19683
|
+
if (firstArg && lazyTypescript.isStringLiteral(firstArg)) {
|
|
19665
19684
|
manifestKey = firstArg.text;
|
|
19666
19685
|
}
|
|
19667
19686
|
}
|
|
@@ -19676,9 +19695,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PRE
|
|
|
19676
19695
|
}
|
|
19677
19696
|
}
|
|
19678
19697
|
}
|
|
19679
|
-
|
|
19698
|
+
lazyTypescript.forEachChild(node, visit);
|
|
19680
19699
|
};
|
|
19681
|
-
|
|
19700
|
+
lazyTypescript.forEachChild(sf, visit);
|
|
19682
19701
|
}, scanAngularHandlerCalls = (projectRoot) => {
|
|
19683
19702
|
const files = collectSourceFiles3(projectRoot);
|
|
19684
19703
|
const collected = [];
|
|
@@ -19688,6 +19707,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PRE
|
|
|
19688
19707
|
return collected;
|
|
19689
19708
|
};
|
|
19690
19709
|
var init_scanAngularHandlerCalls = __esm(() => {
|
|
19710
|
+
init_lazyTypescript();
|
|
19691
19711
|
ELYSIA_ROUTE_METHODS2 = new Set([
|
|
19692
19712
|
"all",
|
|
19693
19713
|
"delete",
|
|
@@ -19716,7 +19736,6 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
19716
19736
|
// src/build/scanAngularPageRoutes.ts
|
|
19717
19737
|
import { readdirSync as readdirSync5, readFileSync as readFileSync27 } from "fs";
|
|
19718
19738
|
import { basename as basename14, join as join42 } from "path";
|
|
19719
|
-
import ts15 from "typescript";
|
|
19720
19739
|
var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
19721
19740
|
const idx = filePath.lastIndexOf(".");
|
|
19722
19741
|
if (idx === -1)
|
|
@@ -19765,15 +19784,15 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
19765
19784
|
}, hasTopLevelRoutesExport = (source, filePath) => {
|
|
19766
19785
|
if (!source.includes("routes"))
|
|
19767
19786
|
return false;
|
|
19768
|
-
const sf =
|
|
19787
|
+
const sf = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
19769
19788
|
for (const statement of sf.statements) {
|
|
19770
|
-
if (!
|
|
19789
|
+
if (!lazyTypescript.isVariableStatement(statement))
|
|
19771
19790
|
continue;
|
|
19772
|
-
const isExported = statement.modifiers?.some((modifier) => modifier.kind ===
|
|
19791
|
+
const isExported = statement.modifiers?.some((modifier) => modifier.kind === lazyTypescript.SyntaxKind.ExportKeyword);
|
|
19773
19792
|
if (!isExported)
|
|
19774
19793
|
continue;
|
|
19775
19794
|
for (const declaration of statement.declarationList.declarations) {
|
|
19776
|
-
if (!
|
|
19795
|
+
if (!lazyTypescript.isIdentifier(declaration.name))
|
|
19777
19796
|
continue;
|
|
19778
19797
|
if (declaration.name.text === "routes")
|
|
19779
19798
|
return true;
|
|
@@ -19802,6 +19821,7 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
19802
19821
|
return out;
|
|
19803
19822
|
};
|
|
19804
19823
|
var init_scanAngularPageRoutes = __esm(() => {
|
|
19824
|
+
init_lazyTypescript();
|
|
19805
19825
|
SOURCE_EXTENSIONS5 = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
19806
19826
|
SKIP_DIRS4 = new Set([
|
|
19807
19827
|
".absolutejs",
|
|
@@ -19827,44 +19847,43 @@ var init_runAngularHandlerScan = __esm(() => {
|
|
|
19827
19847
|
// src/build/parseAngularConfigImports.ts
|
|
19828
19848
|
import { existsSync as existsSync31, readFileSync as readFileSync28 } from "fs";
|
|
19829
19849
|
import { dirname as dirname24, isAbsolute as isAbsolute8, join as join43 } from "path";
|
|
19830
|
-
import ts16 from "typescript";
|
|
19831
19850
|
var findDefineConfigCall = (sf) => {
|
|
19832
19851
|
let result = null;
|
|
19833
19852
|
const visit = (node) => {
|
|
19834
19853
|
if (result)
|
|
19835
19854
|
return;
|
|
19836
|
-
if (
|
|
19855
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "defineConfig") {
|
|
19837
19856
|
const [arg] = node.arguments;
|
|
19838
|
-
if (arg &&
|
|
19857
|
+
if (arg && lazyTypescript.isObjectLiteralExpression(arg)) {
|
|
19839
19858
|
result = arg;
|
|
19840
19859
|
return;
|
|
19841
19860
|
}
|
|
19842
19861
|
}
|
|
19843
|
-
|
|
19862
|
+
lazyTypescript.forEachChild(node, visit);
|
|
19844
19863
|
};
|
|
19845
|
-
|
|
19864
|
+
lazyTypescript.forEachChild(sf, visit);
|
|
19846
19865
|
return result;
|
|
19847
19866
|
}, findPropertyInitializer = (object, name) => {
|
|
19848
19867
|
for (const prop of object.properties) {
|
|
19849
|
-
if (!
|
|
19868
|
+
if (!lazyTypescript.isPropertyAssignment(prop))
|
|
19850
19869
|
continue;
|
|
19851
19870
|
if (!prop.name)
|
|
19852
19871
|
continue;
|
|
19853
|
-
const key =
|
|
19872
|
+
const key = lazyTypescript.isIdentifier(prop.name) ? prop.name.text : lazyTypescript.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
19854
19873
|
if (key === name)
|
|
19855
19874
|
return prop.initializer;
|
|
19856
19875
|
}
|
|
19857
19876
|
return null;
|
|
19858
19877
|
}, findImportForBinding = (sf, binding) => {
|
|
19859
19878
|
for (const statement of sf.statements) {
|
|
19860
|
-
if (!
|
|
19879
|
+
if (!lazyTypescript.isImportDeclaration(statement))
|
|
19861
19880
|
continue;
|
|
19862
|
-
if (!
|
|
19881
|
+
if (!lazyTypescript.isStringLiteral(statement.moduleSpecifier))
|
|
19863
19882
|
continue;
|
|
19864
19883
|
if (statement.importClause?.isTypeOnly)
|
|
19865
19884
|
continue;
|
|
19866
19885
|
const named = statement.importClause?.namedBindings;
|
|
19867
|
-
if (!named || !
|
|
19886
|
+
if (!named || !lazyTypescript.isNamedImports(named))
|
|
19868
19887
|
continue;
|
|
19869
19888
|
for (const element of named.elements) {
|
|
19870
19889
|
if (element.isTypeOnly)
|
|
@@ -19905,17 +19924,17 @@ var findDefineConfigCall = (sf) => {
|
|
|
19905
19924
|
return null;
|
|
19906
19925
|
if (!source.includes("providers"))
|
|
19907
19926
|
return null;
|
|
19908
|
-
const sf =
|
|
19927
|
+
const sf = lazyTypescript.createSourceFile(configPath, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
19909
19928
|
const configObject = findDefineConfigCall(sf);
|
|
19910
19929
|
if (!configObject)
|
|
19911
19930
|
return null;
|
|
19912
19931
|
const angularField = findPropertyInitializer(configObject, "angular");
|
|
19913
|
-
if (!angularField || !
|
|
19932
|
+
if (!angularField || !lazyTypescript.isObjectLiteralExpression(angularField))
|
|
19914
19933
|
return null;
|
|
19915
19934
|
const providersField = findPropertyInitializer(angularField, "providers");
|
|
19916
19935
|
if (!providersField)
|
|
19917
19936
|
return null;
|
|
19918
|
-
if (!
|
|
19937
|
+
if (!lazyTypescript.isIdentifier(providersField))
|
|
19919
19938
|
return null;
|
|
19920
19939
|
const binding = providersField.text;
|
|
19921
19940
|
const importInfo = findImportForBinding(sf, binding);
|
|
@@ -19929,7 +19948,9 @@ var findDefineConfigCall = (sf) => {
|
|
|
19929
19948
|
importedName: importInfo.importedName
|
|
19930
19949
|
};
|
|
19931
19950
|
};
|
|
19932
|
-
var init_parseAngularConfigImports = () => {
|
|
19951
|
+
var init_parseAngularConfigImports = __esm(() => {
|
|
19952
|
+
init_lazyTypescript();
|
|
19953
|
+
});
|
|
19933
19954
|
|
|
19934
19955
|
// src/islands/sourceMetadata.ts
|
|
19935
19956
|
var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => islandFrameworks2.some((framework) => framework === value), isIslandHydrate = (value) => islandHydrationModes2.some((hydrate) => hydrate === value), parseIslandTagAttributes = (attributeString) => {
|
|
@@ -20554,27 +20575,26 @@ var dedupeCssBlocks = (blocks) => {
|
|
|
20554
20575
|
};
|
|
20555
20576
|
|
|
20556
20577
|
// src/build/parseVueSpaRoutes.ts
|
|
20557
|
-
|
|
20558
|
-
|
|
20559
|
-
if (ts17.isCallExpression(node) && node.expression.kind === ts17.SyntaxKind.ImportKeyword) {
|
|
20578
|
+
var propertyName = (node) => lazyTypescript.isIdentifier(node) || lazyTypescript.isStringLiteralLike(node) ? node.text : null, stringValue = (node) => lazyTypescript.isStringLiteralLike(node) ? node.text : null, findVueImport = (node) => {
|
|
20579
|
+
if (lazyTypescript.isCallExpression(node) && node.expression.kind === lazyTypescript.SyntaxKind.ImportKeyword) {
|
|
20560
20580
|
const [specifier] = node.arguments;
|
|
20561
|
-
if (specifier &&
|
|
20581
|
+
if (specifier && lazyTypescript.isStringLiteralLike(specifier)) {
|
|
20562
20582
|
return specifier.text.endsWith(".vue") ? specifier.text : null;
|
|
20563
20583
|
}
|
|
20564
20584
|
}
|
|
20565
20585
|
let found = null;
|
|
20566
|
-
|
|
20586
|
+
lazyTypescript.forEachChild(node, (child) => {
|
|
20567
20587
|
if (found === null)
|
|
20568
20588
|
found = findVueImport(child);
|
|
20569
20589
|
});
|
|
20570
20590
|
return found;
|
|
20571
20591
|
}, parseRoute = (node) => {
|
|
20572
|
-
if (!
|
|
20592
|
+
if (!lazyTypescript.isObjectLiteralExpression(node))
|
|
20573
20593
|
return null;
|
|
20574
20594
|
let path = null;
|
|
20575
20595
|
let importPath = null;
|
|
20576
20596
|
for (const property of node.properties) {
|
|
20577
|
-
if (!
|
|
20597
|
+
if (!lazyTypescript.isPropertyAssignment(property))
|
|
20578
20598
|
continue;
|
|
20579
20599
|
const name = propertyName(property.name);
|
|
20580
20600
|
if (name === "path")
|
|
@@ -20584,12 +20604,12 @@ var propertyName = (node) => ts17.isIdentifier(node) || ts17.isStringLiteralLike
|
|
|
20584
20604
|
}
|
|
20585
20605
|
return path && importPath ? { importPath, path } : null;
|
|
20586
20606
|
}, parseVueSpaRoutes = (source) => {
|
|
20587
|
-
const sourceFile =
|
|
20607
|
+
const sourceFile = lazyTypescript.createSourceFile("absolute-vue-routes.ts", source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
20588
20608
|
const entries = [];
|
|
20589
20609
|
const visit = (node) => {
|
|
20590
|
-
if (
|
|
20610
|
+
if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "defineRoutes") {
|
|
20591
20611
|
const [routes] = node.arguments;
|
|
20592
|
-
if (routes &&
|
|
20612
|
+
if (routes && lazyTypescript.isArrayLiteralExpression(routes)) {
|
|
20593
20613
|
for (const element of routes.elements) {
|
|
20594
20614
|
const route = parseRoute(element);
|
|
20595
20615
|
if (route)
|
|
@@ -20597,12 +20617,14 @@ var propertyName = (node) => ts17.isIdentifier(node) || ts17.isStringLiteralLike
|
|
|
20597
20617
|
}
|
|
20598
20618
|
}
|
|
20599
20619
|
}
|
|
20600
|
-
|
|
20620
|
+
lazyTypescript.forEachChild(node, visit);
|
|
20601
20621
|
};
|
|
20602
|
-
|
|
20622
|
+
lazyTypescript.forEachChild(sourceFile, visit);
|
|
20603
20623
|
return entries;
|
|
20604
20624
|
};
|
|
20605
|
-
var init_parseVueSpaRoutes = () => {
|
|
20625
|
+
var init_parseVueSpaRoutes = __esm(() => {
|
|
20626
|
+
init_lazyTypescript();
|
|
20627
|
+
});
|
|
20606
20628
|
|
|
20607
20629
|
// src/build/vueAutoRouterTransform.ts
|
|
20608
20630
|
var SCRIPT_REGEX, ROUTES_EXPORT_REGEX, SENTINEL2 = "__ABSOLUTE_AUTO_ROUTER__", SETUP_APP_DECLARATION_REGEX, SETUP_APP_FUNCTION_REGEX, addAutoRouterSetupApp = (sourceContent) => {
|
|
@@ -22990,22 +23012,22 @@ var init_lowerDeferSyntax = __esm(() => {
|
|
|
22990
23012
|
});
|
|
22991
23013
|
|
|
22992
23014
|
// src/build/downlevelAsyncForZone.ts
|
|
22993
|
-
import ts18 from "typescript";
|
|
22994
23015
|
var ASYNC_KEYWORD, downlevelAsyncForZone = (code, fileName) => {
|
|
22995
23016
|
if (!isAngularZoneMode() || !ASYNC_KEYWORD.test(code))
|
|
22996
23017
|
return code;
|
|
22997
|
-
return
|
|
23018
|
+
return lazyTypescript.transpileModule(code, {
|
|
22998
23019
|
compilerOptions: {
|
|
22999
23020
|
importHelpers: false,
|
|
23000
|
-
module:
|
|
23021
|
+
module: lazyTypescript.ModuleKind.ESNext,
|
|
23001
23022
|
sourceMap: false,
|
|
23002
|
-
target:
|
|
23023
|
+
target: lazyTypescript.ScriptTarget.ES2016,
|
|
23003
23024
|
useDefineForClassFields: false
|
|
23004
23025
|
},
|
|
23005
23026
|
fileName: fileName.replace(/\.[cm]?[tj]sx?$/, ".js")
|
|
23006
23027
|
}).outputText;
|
|
23007
23028
|
};
|
|
23008
23029
|
var init_downlevelAsyncForZone = __esm(() => {
|
|
23030
|
+
init_lazyTypescript();
|
|
23009
23031
|
ASYNC_KEYWORD = /\basync\b/;
|
|
23010
23032
|
});
|
|
23011
23033
|
|
|
@@ -23019,7 +23041,6 @@ __export(exports_compileAngular, {
|
|
|
23019
23041
|
import { existsSync as existsSync38, readFileSync as readFileSync34, promises as fs5 } from "fs";
|
|
23020
23042
|
import { join as join50, basename as basename17, sep as sep9, dirname as dirname31, resolve as resolve36, relative as relative25 } from "path";
|
|
23021
23043
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
23022
|
-
import ts19 from "typescript";
|
|
23023
23044
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
23024
23045
|
const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
|
|
23025
23046
|
try {
|
|
@@ -23034,7 +23055,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23034
23055
|
}, readTsconfigPathAliases = () => {
|
|
23035
23056
|
try {
|
|
23036
23057
|
const configPath = resolve36(process.cwd(), "tsconfig.json");
|
|
23037
|
-
const config =
|
|
23058
|
+
const config = lazyTypescript.readConfigFile(configPath, lazyTypescript.sys.readFile).config;
|
|
23038
23059
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
23039
23060
|
const baseUrl = resolve36(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
23040
23061
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
@@ -23163,7 +23184,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23163
23184
|
return resolve36(import.meta.dir, "./dev/client");
|
|
23164
23185
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
23165
23186
|
try {
|
|
23166
|
-
return
|
|
23187
|
+
return lazyTypescript.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
23167
23188
|
`);
|
|
23168
23189
|
} catch {
|
|
23169
23190
|
return String(diagnostic.messageText || "Unknown error");
|
|
@@ -23171,7 +23192,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23171
23192
|
}, throwOnCompilationErrors = (diagnostics) => {
|
|
23172
23193
|
if (!diagnostics?.length)
|
|
23173
23194
|
return;
|
|
23174
|
-
const errors = diagnostics.filter((diag) => diag.category ===
|
|
23195
|
+
const errors = diagnostics.filter((diag) => diag.category === lazyTypescript.DiagnosticCategory.Error);
|
|
23175
23196
|
if (!errors.length)
|
|
23176
23197
|
return;
|
|
23177
23198
|
const fullMessage = errors.map(formatDiagnosticMessage).join(`
|
|
@@ -23213,22 +23234,22 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23213
23234
|
}
|
|
23214
23235
|
return `${path}.js${query}`;
|
|
23215
23236
|
}, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
|
|
23216
|
-
const sourceFile =
|
|
23237
|
+
const sourceFile = lazyTypescript.createSourceFile(fileName, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
23217
23238
|
const specifiers = [];
|
|
23218
23239
|
const addSpecifier = (node) => {
|
|
23219
|
-
if (!node || !
|
|
23240
|
+
if (!node || !lazyTypescript.isStringLiteralLike(node))
|
|
23220
23241
|
return;
|
|
23221
23242
|
const specifier = node.text;
|
|
23222
23243
|
if (isRelativeModuleSpecifier(specifier))
|
|
23223
23244
|
specifiers.push(specifier);
|
|
23224
23245
|
};
|
|
23225
23246
|
const visit = (node) => {
|
|
23226
|
-
if (
|
|
23247
|
+
if (lazyTypescript.isImportDeclaration(node) || lazyTypescript.isExportDeclaration(node)) {
|
|
23227
23248
|
addSpecifier(node.moduleSpecifier);
|
|
23228
|
-
} else if (
|
|
23249
|
+
} else if (lazyTypescript.isCallExpression(node) && node.expression.kind === lazyTypescript.SyntaxKind.ImportKeyword) {
|
|
23229
23250
|
addSpecifier(node.arguments[0]);
|
|
23230
23251
|
}
|
|
23231
|
-
|
|
23252
|
+
lazyTypescript.forEachChild(node, visit);
|
|
23232
23253
|
};
|
|
23233
23254
|
visit(sourceFile);
|
|
23234
23255
|
return specifiers;
|
|
@@ -23376,25 +23397,25 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23376
23397
|
emitDecoratorMetadata: true,
|
|
23377
23398
|
esModuleInterop: true,
|
|
23378
23399
|
experimentalDecorators: true,
|
|
23379
|
-
module:
|
|
23380
|
-
moduleResolution:
|
|
23381
|
-
newLine:
|
|
23400
|
+
module: lazyTypescript.ModuleKind.ESNext,
|
|
23401
|
+
moduleResolution: lazyTypescript.ModuleResolutionKind.Bundler,
|
|
23402
|
+
newLine: lazyTypescript.NewLineKind.LineFeed,
|
|
23382
23403
|
noLib: false,
|
|
23383
23404
|
outDir,
|
|
23384
23405
|
skipLibCheck: true,
|
|
23385
|
-
target:
|
|
23406
|
+
target: lazyTypescript.ScriptTarget.ES2022,
|
|
23386
23407
|
...config.options
|
|
23387
23408
|
};
|
|
23388
|
-
options.target =
|
|
23409
|
+
options.target = lazyTypescript.ScriptTarget.ES2022;
|
|
23389
23410
|
options.experimentalDecorators = true;
|
|
23390
23411
|
options.emitDecoratorMetadata = true;
|
|
23391
|
-
options.newLine =
|
|
23412
|
+
options.newLine = lazyTypescript.NewLineKind.LineFeed;
|
|
23392
23413
|
options.outDir = outDir;
|
|
23393
23414
|
options.noEmit = false;
|
|
23394
23415
|
options.incremental = false;
|
|
23395
23416
|
options.tsBuildInfoFile = undefined;
|
|
23396
23417
|
options.rootDir = process.cwd();
|
|
23397
|
-
const host = await traceAngularPhase("aot/create-compiler-host", () =>
|
|
23418
|
+
const host = await traceAngularPhase("aot/create-compiler-host", () => lazyTypescript.createCompilerHost(options));
|
|
23398
23419
|
const originalGetDefaultLibLocation = host.getDefaultLibLocation;
|
|
23399
23420
|
host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
23400
23421
|
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
@@ -23440,7 +23461,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23440
23461
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
23441
23462
|
const source = transformedSources.get(resolve36(fileName));
|
|
23442
23463
|
if (source) {
|
|
23443
|
-
return
|
|
23464
|
+
return lazyTypescript.createSourceFile(fileName, source, languageVersion, true);
|
|
23444
23465
|
}
|
|
23445
23466
|
return originalGetSourceFileForCompile?.call(host, fileName, languageVersion, onError);
|
|
23446
23467
|
};
|
|
@@ -23969,8 +23990,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
23969
23990
|
}
|
|
23970
23991
|
}
|
|
23971
23992
|
return allOutputs;
|
|
23972
|
-
}, ROUTER_OUTLET_PATTERN, COMPONENT_MARKER_PATTERN, isExportedClass = (statement) =>
|
|
23973
|
-
if (!
|
|
23993
|
+
}, ROUTER_OUTLET_PATTERN, COMPONENT_MARKER_PATTERN, isExportedClass = (statement) => lazyTypescript.isClassDeclaration(statement) && statement.name !== undefined && (lazyTypescript.getModifiers(statement) ?? []).some((modifier) => modifier.kind === lazyTypescript.SyntaxKind.ExportKeyword), statementReferencesClass = (statement, className, sourceFile) => {
|
|
23994
|
+
if (!lazyTypescript.isExpressionStatement(statement))
|
|
23974
23995
|
return false;
|
|
23975
23996
|
const text = statement.getText(sourceFile);
|
|
23976
23997
|
return new RegExp(`^\\s*${className}\\s*=`).test(text) || new RegExp(`\u0275setClassMetadata\\(\\s*${className}\\b`).test(text);
|
|
@@ -23978,16 +23999,16 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
23978
23999
|
const defaultMatch = source.match(/export\s+default\s+([A-Za-z_$][\w$]*)\s*;/);
|
|
23979
24000
|
if (defaultMatch)
|
|
23980
24001
|
return defaultMatch[1] ?? null;
|
|
23981
|
-
const sourceFile =
|
|
24002
|
+
const sourceFile = lazyTypescript.createSourceFile("page.js", source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.JS);
|
|
23982
24003
|
const exportedNames = new Set;
|
|
23983
24004
|
for (const statement of sourceFile.statements) {
|
|
23984
|
-
if (!
|
|
24005
|
+
if (!lazyTypescript.isExportDeclaration(statement) || statement.moduleSpecifier || !statement.exportClause || !lazyTypescript.isNamedExports(statement.exportClause))
|
|
23985
24006
|
continue;
|
|
23986
24007
|
for (const element of statement.exportClause.elements) {
|
|
23987
24008
|
exportedNames.add((element.propertyName ?? element.name).text);
|
|
23988
24009
|
}
|
|
23989
24010
|
}
|
|
23990
|
-
const candidates = sourceFile.statements.filter(
|
|
24011
|
+
const candidates = sourceFile.statements.filter(lazyTypescript.isClassDeclaration).filter((statement) => isExportedClass(statement) || exportedNames.has(statement.name?.text ?? "")).map((statement) => {
|
|
23991
24012
|
const className = statement.name?.text ?? "";
|
|
23992
24013
|
const related = sourceFile.statements.filter((other) => statementReferencesClass(other, className, sourceFile)).map((other) => other.getText(sourceFile));
|
|
23993
24014
|
const text = [statement.getText(sourceFile), ...related].join(`
|
|
@@ -24414,6 +24435,7 @@ window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
|
24414
24435
|
};
|
|
24415
24436
|
};
|
|
24416
24437
|
var init_compileAngular = __esm(() => {
|
|
24438
|
+
init_lazyTypescript();
|
|
24417
24439
|
init_constants();
|
|
24418
24440
|
init_sourceMetadata();
|
|
24419
24441
|
init_lowerDeferSyntax();
|
|
@@ -29640,7 +29662,6 @@ __export(exports_resolveOwningComponents, {
|
|
|
29640
29662
|
});
|
|
29641
29663
|
import { readdirSync as readdirSync12, readFileSync as readFileSync42, statSync as statSync10 } from "fs";
|
|
29642
29664
|
import { dirname as dirname39, extname as extname19, join as join62, resolve as resolve53 } from "path";
|
|
29643
|
-
import ts20 from "typescript";
|
|
29644
29665
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
29645
29666
|
const out = [];
|
|
29646
29667
|
const visit = (dir) => {
|
|
@@ -29666,13 +29687,13 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29666
29687
|
return out;
|
|
29667
29688
|
}, getStringPropertyValue = (obj, name) => {
|
|
29668
29689
|
for (const prop of obj.properties) {
|
|
29669
|
-
if (!
|
|
29690
|
+
if (!lazyTypescript.isPropertyAssignment(prop))
|
|
29670
29691
|
continue;
|
|
29671
|
-
const propName =
|
|
29692
|
+
const propName = lazyTypescript.isIdentifier(prop.name) || lazyTypescript.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
29672
29693
|
if (propName !== name)
|
|
29673
29694
|
continue;
|
|
29674
29695
|
const init = prop.initializer;
|
|
29675
|
-
if (
|
|
29696
|
+
if (lazyTypescript.isStringLiteral(init) || lazyTypescript.isNoSubstitutionTemplateLiteral(init)) {
|
|
29676
29697
|
return init.text;
|
|
29677
29698
|
}
|
|
29678
29699
|
}
|
|
@@ -29680,16 +29701,16 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29680
29701
|
}, getStringArrayProperty = (obj, name) => {
|
|
29681
29702
|
const out = [];
|
|
29682
29703
|
for (const prop of obj.properties) {
|
|
29683
|
-
if (!
|
|
29704
|
+
if (!lazyTypescript.isPropertyAssignment(prop))
|
|
29684
29705
|
continue;
|
|
29685
|
-
const propName =
|
|
29706
|
+
const propName = lazyTypescript.isIdentifier(prop.name) || lazyTypescript.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
29686
29707
|
if (propName !== name)
|
|
29687
29708
|
continue;
|
|
29688
29709
|
const init = prop.initializer;
|
|
29689
|
-
if (!
|
|
29710
|
+
if (!lazyTypescript.isArrayLiteralExpression(init))
|
|
29690
29711
|
continue;
|
|
29691
29712
|
for (const element of init.elements) {
|
|
29692
|
-
if (
|
|
29713
|
+
if (lazyTypescript.isStringLiteral(element) || lazyTypescript.isNoSubstitutionTemplateLiteral(element)) {
|
|
29693
29714
|
out.push(element.text);
|
|
29694
29715
|
}
|
|
29695
29716
|
}
|
|
@@ -29702,27 +29723,27 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29702
29723
|
} catch {
|
|
29703
29724
|
return [];
|
|
29704
29725
|
}
|
|
29705
|
-
const sourceFile =
|
|
29726
|
+
const sourceFile = lazyTypescript.createSourceFile(filePath, source, lazyTypescript.ScriptTarget.ES2022, true, lazyTypescript.ScriptKind.TS);
|
|
29706
29727
|
const out = [];
|
|
29707
29728
|
const visit = (node) => {
|
|
29708
|
-
if (
|
|
29709
|
-
for (const decorator of
|
|
29729
|
+
if (lazyTypescript.isClassDeclaration(node) && node.name) {
|
|
29730
|
+
for (const decorator of lazyTypescript.getDecorators(node) ?? []) {
|
|
29710
29731
|
const expr = decorator.expression;
|
|
29711
|
-
if (!
|
|
29732
|
+
if (!lazyTypescript.isCallExpression(expr))
|
|
29712
29733
|
continue;
|
|
29713
29734
|
const functionNode = expr.expression;
|
|
29714
|
-
if (!
|
|
29735
|
+
if (!lazyTypescript.isIdentifier(functionNode))
|
|
29715
29736
|
continue;
|
|
29716
29737
|
const kind = ENTITY_DECORATORS[functionNode.text];
|
|
29717
29738
|
if (!kind)
|
|
29718
29739
|
continue;
|
|
29719
29740
|
let extendsName = null;
|
|
29720
29741
|
for (const heritage of node.heritageClauses ?? []) {
|
|
29721
|
-
if (heritage.token !==
|
|
29742
|
+
if (heritage.token !== lazyTypescript.SyntaxKind.ExtendsKeyword) {
|
|
29722
29743
|
continue;
|
|
29723
29744
|
}
|
|
29724
29745
|
const [first] = heritage.types;
|
|
29725
|
-
if (first &&
|
|
29746
|
+
if (first && lazyTypescript.isIdentifier(first.expression)) {
|
|
29726
29747
|
extendsName = first.expression.text;
|
|
29727
29748
|
}
|
|
29728
29749
|
break;
|
|
@@ -29735,7 +29756,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29735
29756
|
templateUrls: []
|
|
29736
29757
|
};
|
|
29737
29758
|
const [arg] = expr.arguments;
|
|
29738
|
-
if (arg &&
|
|
29759
|
+
if (arg && lazyTypescript.isObjectLiteralExpression(arg) && kind === "component") {
|
|
29739
29760
|
const tplUrl = getStringPropertyValue(arg, "templateUrl");
|
|
29740
29761
|
if (tplUrl)
|
|
29741
29762
|
entry.templateUrls.push(tplUrl);
|
|
@@ -29748,7 +29769,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29748
29769
|
break;
|
|
29749
29770
|
}
|
|
29750
29771
|
}
|
|
29751
|
-
|
|
29772
|
+
lazyTypescript.forEachChild(node, visit);
|
|
29752
29773
|
};
|
|
29753
29774
|
visit(sourceFile);
|
|
29754
29775
|
return out;
|
|
@@ -29792,12 +29813,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29792
29813
|
} catch {
|
|
29793
29814
|
return null;
|
|
29794
29815
|
}
|
|
29795
|
-
const sourceFile =
|
|
29816
|
+
const sourceFile = lazyTypescript.createSourceFile(childFilePath, source, lazyTypescript.ScriptTarget.ES2022, true, lazyTypescript.ScriptKind.TS);
|
|
29796
29817
|
const childDir = dirname39(childFilePath);
|
|
29797
29818
|
for (const stmt of sourceFile.statements) {
|
|
29798
|
-
if (!
|
|
29819
|
+
if (!lazyTypescript.isImportDeclaration(stmt))
|
|
29799
29820
|
continue;
|
|
29800
|
-
if (!
|
|
29821
|
+
if (!lazyTypescript.isStringLiteral(stmt.moduleSpecifier))
|
|
29801
29822
|
continue;
|
|
29802
29823
|
const clause = stmt.importClause;
|
|
29803
29824
|
if (!clause || clause.isTypeOnly)
|
|
@@ -29805,7 +29826,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29805
29826
|
let matchesName = false;
|
|
29806
29827
|
if (clause.name && clause.name.text === parentName)
|
|
29807
29828
|
matchesName = true;
|
|
29808
|
-
if (!matchesName && clause.namedBindings &&
|
|
29829
|
+
if (!matchesName && clause.namedBindings && lazyTypescript.isNamedImports(clause.namedBindings)) {
|
|
29809
29830
|
for (const element of clause.namedBindings.elements) {
|
|
29810
29831
|
if (element.isTypeOnly)
|
|
29811
29832
|
continue;
|
|
@@ -29898,6 +29919,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29898
29919
|
return bundle.parentFile.get(norm) ?? [];
|
|
29899
29920
|
};
|
|
29900
29921
|
var init_resolveOwningComponents = __esm(() => {
|
|
29922
|
+
init_lazyTypescript();
|
|
29901
29923
|
ENTITY_DECORATORS = {
|
|
29902
29924
|
Component: "component",
|
|
29903
29925
|
Directive: "directive",
|
|
@@ -37756,7 +37778,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
37756
37778
|
} catch {
|
|
37757
37779
|
return path;
|
|
37758
37780
|
}
|
|
37759
|
-
}, typescript,
|
|
37781
|
+
}, typescript, loadTypescript2 = async () => {
|
|
37760
37782
|
typescript ??= await import("typescript");
|
|
37761
37783
|
return typescript;
|
|
37762
37784
|
}, shared, analyses, isHotManaged = (path) => {
|
|
@@ -37807,7 +37829,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
37807
37829
|
writeFileSync17(cachePath(state.cacheDir, key), JSON.stringify(analysis));
|
|
37808
37830
|
} catch {}
|
|
37809
37831
|
}, analyzeFresh = async (canonicalPath, source) => {
|
|
37810
|
-
const typescriptModule = await
|
|
37832
|
+
const typescriptModule = await loadTypescript2();
|
|
37811
37833
|
return analyzeModule(typescriptModule, canonicalPath, source, resolveFrom2(canonicalPath, isHotManaged));
|
|
37812
37834
|
}, analyzeSource = async (canonicalPath, source) => {
|
|
37813
37835
|
const memo = analyses.get(canonicalPath);
|
|
@@ -41879,5 +41901,5 @@ export {
|
|
|
41879
41901
|
devBuild
|
|
41880
41902
|
};
|
|
41881
41903
|
|
|
41882
|
-
//# debugId=
|
|
41904
|
+
//# debugId=63DFF81D034C7C2D64756E2164756E21
|
|
41883
41905
|
//# sourceMappingURL=build.js.map
|