@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.
Files changed (47) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/changelog.json +11 -0
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/angular/index.js +47 -27
  6. package/dist/angular/index.js.map +6 -5
  7. package/dist/angular/server.js +47 -27
  8. package/dist/angular/server.js.map +6 -5
  9. package/dist/build.js +635 -613
  10. package/dist/build.js.map +25 -24
  11. package/dist/cli/{add-ae6mg79m.js → add-ntg96znk.js} +32 -31
  12. package/dist/cli/{compile-ndc36zna.js → compile-n6fs2vmx.js} +16 -14
  13. package/dist/cli/config/server.js +85 -65
  14. package/dist/cli/{dev-x49583aj.js → dev-6h1f0mzq.js} +1 -1
  15. package/dist/cli/{expoProject-h404n2r8.js → expoProject-1qtw97js.js} +2 -1
  16. package/dist/cli/{generate-brvjesd6.js → generate-5vyz1s44.js} +7 -6
  17. package/dist/cli/{htmx-5twhjz7p.js → htmx-26hs6jdm.js} +2 -1
  18. package/dist/cli/{index-gyjxrnnz.js → index-23hvdyxf.js} +18 -16
  19. package/dist/cli/index-4j1twret.js +22 -0
  20. package/dist/cli/{index-25e7k849.js → index-bhyd3ejc.js} +4 -4
  21. package/dist/cli/{index-s0r5q839.js → index-cksezef8.js} +10 -8
  22. package/dist/cli/{index-q3snnhyd.js → index-enbw9484.js} +34 -33
  23. package/dist/cli/{index-b1wht4q5.js → index-kes8he5s.js} +6 -4
  24. package/dist/cli/{index-z794p5qg.js → index-mqevg32w.js} +22 -19
  25. package/dist/cli/{index-vh68jb0e.js → index-pkw3jktb.js} +17 -16
  26. package/dist/cli/{index-rervww4p.js → index-zyd80s3h.js} +119 -119
  27. package/dist/cli/index.js +11 -11
  28. package/dist/cli/{islands-p4vgx7a2.js → islands-vk05sj6v.js} +5 -4
  29. package/dist/cli/{mobile-nqdkk3gd.js → mobile-62b6j3j7.js} +5 -4
  30. package/dist/cli/{remove-abaf0w6k.js → remove-4jh862qa.js} +6 -5
  31. package/dist/cli/{start-t3cq57wn.js → start-jh6kyp92.js} +5 -4
  32. package/dist/cli/{typecheck-fag7djt5.js → typecheck-7fvww3b7.js} +28 -26
  33. package/dist/dev/importCostReport.js +45 -26
  34. package/dist/index.js +633 -611
  35. package/dist/index.js.map +25 -24
  36. package/dist/mobile/index.js +115 -95
  37. package/dist/mobile/index.js.map +6 -5
  38. package/dist/mobile/remoteMacAgentEntry.js +205 -651
  39. package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +3 -3
  40. package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +3 -3
  41. package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
  42. package/dist/src/dev/angular/hmrImportGenerator.d.ts +2 -2
  43. package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +2 -2
  44. package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +40 -40
  45. package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +3 -3
  46. package/dist/src/utils/lazyTypescript.d.ts +3 -0
  47. package/package.json +1 -1
@@ -1910,11 +1910,30 @@ var init_materializedBundle = __esm(() => {
1910
1910
  BUNDLE_ID_PATTERN = /^amb_[a-f0-9]{64}$/;
1911
1911
  });
1912
1912
 
1913
+ // src/utils/lazyTypescript.ts
1914
+ import { createRequire } from "module";
1915
+ var loaded, loadTypescript = () => {
1916
+ if (loaded)
1917
+ return loaded;
1918
+ const requireFromHere = createRequire(import.meta.url);
1919
+ const typescript = requireFromHere("typescript");
1920
+ loaded = typescript;
1921
+ return typescript;
1922
+ }, createLazyTypescript = () => {
1923
+ const target = Object.create(null);
1924
+ return new Proxy(target, {
1925
+ get: (_target, key) => Reflect.get(loadTypescript(), key),
1926
+ has: (_target, key) => Reflect.has(loadTypescript(), key)
1927
+ });
1928
+ }, lazyTypescript;
1929
+ var init_lazyTypescript = __esm(() => {
1930
+ lazyTypescript = createLazyTypescript();
1931
+ });
1932
+
1913
1933
  // src/mobile/deviceCapabilities.ts
1914
1934
  import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
1915
1935
  import { extname as extname3, join as join15, relative as relative12, resolve as resolve13 } from "path";
1916
1936
  import { fileURLToPath } from "url";
1917
- import ts from "typescript";
1918
1937
  var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES, ADAPTERS, 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) => {
1919
1938
  const value = JSON.parse(readFileSync3(path, "utf8"));
1920
1939
  if (!object(value))
@@ -2069,29 +2088,29 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
2069
2088
  const names = new Set;
2070
2089
  const namespaces = new Set;
2071
2090
  const visit = (node) => {
2072
- if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && !node.importClause?.isTypeOnly) {
2091
+ if (lazyTypescript.isImportDeclaration(node) && lazyTypescript.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && !node.importClause?.isTypeOnly) {
2073
2092
  const bindings = node.importClause?.namedBindings;
2074
- if (bindings && ts.isNamedImports(bindings)) {
2093
+ if (bindings && lazyTypescript.isNamedImports(bindings)) {
2075
2094
  for (const element of bindings.elements)
2076
2095
  if (!element.isTypeOnly)
2077
2096
  names.add((element.propertyName ?? element.name).text);
2078
2097
  }
2079
- if (bindings && ts.isNamespaceImport(bindings))
2098
+ if (bindings && lazyTypescript.isNamespaceImport(bindings))
2080
2099
  namespaces.add(bindings.name.text);
2081
2100
  }
2082
- if (ts.isExportDeclaration(node) && !node.isTypeOnly && node.moduleSpecifier !== undefined && ts.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && node.exportClause && ts.isNamedExports(node.exportClause)) {
2101
+ if (lazyTypescript.isExportDeclaration(node) && !node.isTypeOnly && node.moduleSpecifier !== undefined && lazyTypescript.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && node.exportClause && lazyTypescript.isNamedExports(node.exportClause)) {
2083
2102
  for (const element of node.exportClause.elements)
2084
2103
  if (!element.isTypeOnly)
2085
2104
  names.add((element.propertyName ?? element.name).text);
2086
2105
  }
2087
- if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.expression) && namespaces.has(node.expression.text))
2106
+ if (lazyTypescript.isPropertyAccessExpression(node) && lazyTypescript.isIdentifier(node.expression) && namespaces.has(node.expression.text))
2088
2107
  names.add(node.name.text);
2089
- ts.forEachChild(node, visit);
2108
+ lazyTypescript.forEachChild(node, visit);
2090
2109
  };
2091
2110
  const extension = extname3(file).toLowerCase();
2092
2111
  const sources = extension === ".svelte" || extension === ".vue" ? [...source.matchAll(/<script\b[^>]*>([\s\S]*?)<\/script\s*>/giu)].map((match) => match[1]).filter((value) => value !== undefined) : [source];
2093
2112
  for (const [index, script] of sources.entries())
2094
- visit(ts.createSourceFile(`${file}#script-${index}`, script, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX));
2113
+ visit(lazyTypescript.createSourceFile(`${file}#script-${index}`, script, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TSX));
2095
2114
  return names;
2096
2115
  }, assertAbsoluteDeviceCapabilityPackages = (projectRoot, plan) => {
2097
2116
  const missing = missingAbsoluteDeviceCapabilityPackages(plan, directAbsoluteProjectPackages(projectRoot));
@@ -2172,6 +2191,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
2172
2191
  };
2173
2192
  };
2174
2193
  var init_deviceCapabilities = __esm(() => {
2194
+ init_lazyTypescript();
2175
2195
  ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES = [
2176
2196
  "keyboard",
2177
2197
  "systemBars"
@@ -20308,11 +20328,11 @@ var publishAbsoluteIosRelease = async (options) => {
20308
20328
  return publication;
20309
20329
  };
20310
20330
  // src/mobile/routeMetadataTransform.ts
20331
+ init_lazyTypescript();
20311
20332
  init_pageProtocol();
20312
20333
  init_releaseArtifact();
20313
20334
  import { existsSync as existsSync7, readFileSync as readFileSync8 } from "fs";
20314
20335
  import { dirname as dirname24, extname as extname6, relative as relative22, resolve as resolve24 } from "path";
20315
- import ts2 from "typescript";
20316
20336
  var ROUTE_METHODS = new Set(["get", "head"]);
20317
20337
  var SOURCE_FILTER = /\.[cm]?[jt]sx?$/;
20318
20338
  var PAGE_HANDLERS = new Map([
@@ -20362,60 +20382,60 @@ var PAGE_HANDLERS = new Map([
20362
20382
  ]
20363
20383
  ]);
20364
20384
  var posixPath = (value) => value.replace(/\\/g, "/");
20365
- var findTsconfig = (entry, projectRoot) => ts2.findConfigFile(dirname24(entry), existsSync7, "tsconfig.json") ?? ts2.findConfigFile(projectRoot, existsSync7, "tsconfig.json");
20385
+ var findTsconfig = (entry, projectRoot) => lazyTypescript.findConfigFile(dirname24(entry), existsSync7, "tsconfig.json") ?? lazyTypescript.findConfigFile(projectRoot, existsSync7, "tsconfig.json");
20366
20386
  var createProgram = (entry, projectRoot) => {
20367
20387
  const configPath = findTsconfig(entry, projectRoot);
20368
20388
  if (!configPath) {
20369
- return ts2.createProgram([entry], {
20389
+ return lazyTypescript.createProgram([entry], {
20370
20390
  allowJs: true,
20371
- jsx: ts2.JsxEmit.ReactJSX,
20372
- module: ts2.ModuleKind.ESNext,
20373
- moduleResolution: ts2.ModuleResolutionKind.Bundler,
20374
- target: ts2.ScriptTarget.ESNext
20391
+ jsx: lazyTypescript.JsxEmit.ReactJSX,
20392
+ module: lazyTypescript.ModuleKind.ESNext,
20393
+ moduleResolution: lazyTypescript.ModuleResolutionKind.Bundler,
20394
+ target: lazyTypescript.ScriptTarget.ESNext
20375
20395
  });
20376
20396
  }
20377
- const parsed = ts2.parseJsonConfigFileContent(ts2.readConfigFile(configPath, (path) => readFileSync8(path, "utf8")).config, ts2.sys, dirname24(configPath));
20397
+ const parsed = lazyTypescript.parseJsonConfigFileContent(lazyTypescript.readConfigFile(configPath, (path) => readFileSync8(path, "utf8")).config, lazyTypescript.sys, dirname24(configPath));
20378
20398
  if (!parsed.fileNames.includes(entry))
20379
20399
  parsed.fileNames.push(entry);
20380
- return ts2.createProgram(parsed.fileNames, parsed.options);
20400
+ return lazyTypescript.createProgram(parsed.fileNames, parsed.options);
20381
20401
  };
20382
20402
  var propertyName = (property) => {
20383
20403
  if (!("name" in property) || !property.name)
20384
20404
  return;
20385
- if (ts2.isIdentifier(property.name))
20405
+ if (lazyTypescript.isIdentifier(property.name))
20386
20406
  return property.name.text;
20387
- if (ts2.isStringLiteralLike(property.name))
20407
+ if (lazyTypescript.isStringLiteralLike(property.name))
20388
20408
  return property.name.text;
20389
20409
  return;
20390
20410
  };
20391
20411
  var objectPropertyExpression = (object, name) => {
20392
20412
  const property = object.properties.find((candidate) => propertyName(candidate) === name);
20393
- if (property && ts2.isPropertyAssignment(property)) {
20413
+ if (property && lazyTypescript.isPropertyAssignment(property)) {
20394
20414
  return property.initializer;
20395
20415
  }
20396
- if (property && ts2.isShorthandPropertyAssignment(property)) {
20416
+ if (property && lazyTypescript.isShorthandPropertyAssignment(property)) {
20397
20417
  return property.name;
20398
20418
  }
20399
20419
  return;
20400
20420
  };
20401
20421
  var serializeType = (type, checker, ancestors = new Set) => {
20402
- if (type.flags & ts2.TypeFlags.Any)
20422
+ if (type.flags & lazyTypescript.TypeFlags.Any)
20403
20423
  return { type: "any" };
20404
- if (type.flags & ts2.TypeFlags.Unknown)
20424
+ if (type.flags & lazyTypescript.TypeFlags.Unknown)
20405
20425
  return { type: "unknown" };
20406
- if (type.flags & ts2.TypeFlags.Never)
20426
+ if (type.flags & lazyTypescript.TypeFlags.Never)
20407
20427
  return { type: "never" };
20408
- if (type.flags & ts2.TypeFlags.StringLike)
20428
+ if (type.flags & lazyTypescript.TypeFlags.StringLike)
20409
20429
  return { type: "string" };
20410
- if (type.flags & ts2.TypeFlags.NumberLike)
20430
+ if (type.flags & lazyTypescript.TypeFlags.NumberLike)
20411
20431
  return { type: "number" };
20412
- if (type.flags & ts2.TypeFlags.BooleanLike)
20432
+ if (type.flags & lazyTypescript.TypeFlags.BooleanLike)
20413
20433
  return { type: "boolean" };
20414
- if (type.flags & ts2.TypeFlags.BigIntLike)
20434
+ if (type.flags & lazyTypescript.TypeFlags.BigIntLike)
20415
20435
  return { type: "bigint" };
20416
- if (type.flags & ts2.TypeFlags.Null)
20436
+ if (type.flags & lazyTypescript.TypeFlags.Null)
20417
20437
  return { type: "null" };
20418
- if (type.flags & ts2.TypeFlags.Undefined)
20438
+ if (type.flags & lazyTypescript.TypeFlags.Undefined)
20419
20439
  return { type: "undefined" };
20420
20440
  if (type.isUnion()) {
20421
20441
  return {
@@ -20429,11 +20449,11 @@ var serializeType = (type, checker, ancestors = new Set) => {
20429
20449
  }
20430
20450
  if (ancestors.has(type)) {
20431
20451
  return {
20432
- ref: checker.typeToString(type, undefined, ts2.TypeFormatFlags.NoTruncation)
20452
+ ref: checker.typeToString(type, undefined, lazyTypescript.TypeFormatFlags.NoTruncation)
20433
20453
  };
20434
20454
  }
20435
20455
  ancestors.add(type);
20436
- const arrayElement = checker.getIndexTypeOfType(type, ts2.IndexKind.Number);
20456
+ const arrayElement = checker.getIndexTypeOfType(type, lazyTypescript.IndexKind.Number);
20437
20457
  const properties = checker.getPropertiesOfType(type);
20438
20458
  let schema;
20439
20459
  if (arrayElement && properties.some(({ name }) => name === "length")) {
@@ -20448,7 +20468,7 @@ var serializeType = (type, checker, ancestors = new Set) => {
20448
20468
  return [
20449
20469
  property.name,
20450
20470
  {
20451
- optional: Boolean(property.flags & ts2.SymbolFlags.Optional),
20471
+ optional: Boolean(property.flags & lazyTypescript.SymbolFlags.Optional),
20452
20472
  schema: serializeType(propertyType, checker, ancestors)
20453
20473
  }
20454
20474
  ];
@@ -20456,7 +20476,7 @@ var serializeType = (type, checker, ancestors = new Set) => {
20456
20476
  schema = { properties: Object.fromEntries(entries), type: "object" };
20457
20477
  } else {
20458
20478
  schema = {
20459
- type: checker.typeToString(type, undefined, ts2.TypeFormatFlags.NoTruncation)
20479
+ type: checker.typeToString(type, undefined, lazyTypescript.TypeFormatFlags.NoTruncation)
20460
20480
  };
20461
20481
  }
20462
20482
  ancestors.delete(type);
@@ -20474,7 +20494,7 @@ var pagePropsType = (pageExpression, propsExpression, checker) => {
20474
20494
  };
20475
20495
  var resolvePageIdentity = (expression, sourceFile, checker, projectRoot) => {
20476
20496
  let symbol = checker.getSymbolAtLocation(expression);
20477
- if (symbol?.flags && symbol.flags & ts2.SymbolFlags.Alias) {
20497
+ if (symbol?.flags && symbol.flags & lazyTypescript.SymbolFlags.Alias) {
20478
20498
  symbol = checker.getAliasedSymbol(symbol);
20479
20499
  }
20480
20500
  const declaration = symbol?.declarations?.[0];
@@ -20484,15 +20504,15 @@ var resolvePageIdentity = (expression, sourceFile, checker, projectRoot) => {
20484
20504
  return `${source}#${exportedName}`;
20485
20505
  };
20486
20506
  var resolveAlias = (symbol, checker) => {
20487
- if (!(symbol.flags & ts2.SymbolFlags.Alias))
20507
+ if (!(symbol.flags & lazyTypescript.SymbolFlags.Alias))
20488
20508
  return symbol;
20489
20509
  return checker.getAliasedSymbol(symbol);
20490
20510
  };
20491
20511
  var assetKey = (expression, checker, seen = new Set) => {
20492
20512
  if (!expression)
20493
20513
  return;
20494
- if (ts2.isIdentifier(expression)) {
20495
- const unresolved = ts2.isShorthandPropertyAssignment(expression.parent) ? checker.getShorthandAssignmentValueSymbol(expression.parent) : checker.getSymbolAtLocation(expression);
20514
+ if (lazyTypescript.isIdentifier(expression)) {
20515
+ const unresolved = lazyTypescript.isShorthandPropertyAssignment(expression.parent) ? checker.getShorthandAssignmentValueSymbol(expression.parent) : checker.getSymbolAtLocation(expression);
20496
20516
  if (!unresolved)
20497
20517
  return;
20498
20518
  const symbol = resolveAlias(unresolved, checker);
@@ -20500,26 +20520,26 @@ var assetKey = (expression, checker, seen = new Set) => {
20500
20520
  return;
20501
20521
  seen.add(symbol);
20502
20522
  const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];
20503
- if (!declaration || !ts2.isVariableDeclaration(declaration))
20523
+ if (!declaration || !lazyTypescript.isVariableDeclaration(declaration))
20504
20524
  return;
20505
20525
  return assetKey(declaration.initializer, checker, seen);
20506
20526
  }
20507
- if (!ts2.isCallExpression(expression))
20527
+ if (!lazyTypescript.isCallExpression(expression))
20508
20528
  return;
20509
- if (!ts2.isIdentifier(expression.expression) || expression.expression.text !== "asset") {
20529
+ if (!lazyTypescript.isIdentifier(expression.expression) || expression.expression.text !== "asset") {
20510
20530
  return;
20511
20531
  }
20512
20532
  const [, key] = expression.arguments;
20513
- return key && ts2.isStringLiteralLike(key) ? key.text : undefined;
20533
+ return key && lazyTypescript.isStringLiteralLike(key) ? key.text : undefined;
20514
20534
  };
20515
20535
  var staticString = (expression, bindings) => {
20516
- if (ts2.isStringLiteralLike(expression))
20536
+ if (lazyTypescript.isStringLiteralLike(expression))
20517
20537
  return expression.text;
20518
- if (ts2.isIdentifier(expression))
20538
+ if (lazyTypescript.isIdentifier(expression))
20519
20539
  return bindings.get(expression.text);
20520
- if (ts2.isNoSubstitutionTemplateLiteral(expression))
20540
+ if (lazyTypescript.isNoSubstitutionTemplateLiteral(expression))
20521
20541
  return expression.text;
20522
- if (!ts2.isTemplateExpression(expression))
20542
+ if (!lazyTypescript.isTemplateExpression(expression))
20523
20543
  return;
20524
20544
  let value = expression.head.text;
20525
20545
  for (const span of expression.templateSpans) {
@@ -20533,7 +20553,7 @@ var staticString = (expression, bindings) => {
20533
20553
  var assetKeyWithBindings = (expression, checker, bindings = new Map) => {
20534
20554
  if (!expression)
20535
20555
  return;
20536
- if (ts2.isCallExpression(expression) && ts2.isIdentifier(expression.expression) && expression.expression.text === "asset") {
20556
+ if (lazyTypescript.isCallExpression(expression) && lazyTypescript.isIdentifier(expression.expression) && expression.expression.text === "asset") {
20537
20557
  const [, key] = expression.arguments;
20538
20558
  return key ? staticString(key, bindings) : undefined;
20539
20559
  }
@@ -20544,16 +20564,16 @@ var callableObject = (call, checker) => {
20544
20564
  const resolved = symbol ? resolveAlias(symbol, checker) : undefined;
20545
20565
  const declaration = resolved?.valueDeclaration ?? resolved?.declarations?.[0];
20546
20566
  let callable;
20547
- if (declaration && ts2.isFunctionDeclaration(declaration)) {
20567
+ if (declaration && lazyTypescript.isFunctionDeclaration(declaration)) {
20548
20568
  callable = declaration;
20549
- } else if (declaration && ts2.isVariableDeclaration(declaration) && declaration.initializer && (ts2.isArrowFunction(declaration.initializer) || ts2.isFunctionExpression(declaration.initializer))) {
20569
+ } else if (declaration && lazyTypescript.isVariableDeclaration(declaration) && declaration.initializer && (lazyTypescript.isArrowFunction(declaration.initializer) || lazyTypescript.isFunctionExpression(declaration.initializer))) {
20550
20570
  callable = declaration.initializer;
20551
20571
  }
20552
20572
  if (!callable)
20553
20573
  return;
20554
20574
  const bindings = new Map;
20555
20575
  callable.parameters.forEach((parameter, index) => {
20556
- if (!ts2.isIdentifier(parameter.name))
20576
+ if (!lazyTypescript.isIdentifier(parameter.name))
20557
20577
  return;
20558
20578
  const argument = call.arguments[index];
20559
20579
  if (!argument)
@@ -20565,35 +20585,35 @@ var callableObject = (call, checker) => {
20565
20585
  const { body } = callable;
20566
20586
  if (!body)
20567
20587
  return;
20568
- const expressionBody = ts2.isParenthesizedExpression(body) ? body.expression : body;
20569
- if (ts2.isObjectLiteralExpression(expressionBody)) {
20588
+ const expressionBody = lazyTypescript.isParenthesizedExpression(body) ? body.expression : body;
20589
+ if (lazyTypescript.isObjectLiteralExpression(expressionBody)) {
20570
20590
  return { bindings, object: expressionBody };
20571
20591
  }
20572
- if (ts2.isBlock(body)) {
20573
- const returned = body.statements.find(ts2.isReturnStatement)?.expression;
20574
- if (returned && ts2.isObjectLiteralExpression(returned)) {
20592
+ if (lazyTypescript.isBlock(body)) {
20593
+ const returned = body.statements.find(lazyTypescript.isReturnStatement)?.expression;
20594
+ if (returned && lazyTypescript.isObjectLiteralExpression(returned)) {
20575
20595
  return { bindings, object: returned };
20576
20596
  }
20577
20597
  }
20578
20598
  return;
20579
20599
  };
20580
20600
  var spreadObject = (expression, checker, bindings) => {
20581
- if (ts2.isObjectLiteralExpression(expression)) {
20601
+ if (lazyTypescript.isObjectLiteralExpression(expression)) {
20582
20602
  return { bindings, object: expression };
20583
20603
  }
20584
- if (!ts2.isCallExpression(expression))
20604
+ if (!lazyTypescript.isCallExpression(expression))
20585
20605
  return;
20586
20606
  return callableObject(expression, checker);
20587
20607
  };
20588
20608
  var objectAssetKey = (object, name, checker, bindings = new Map) => {
20589
20609
  for (const property of [...object.properties].reverse()) {
20590
- if (propertyName(property) === name && ts2.isShorthandPropertyAssignment(property)) {
20610
+ if (propertyName(property) === name && lazyTypescript.isShorthandPropertyAssignment(property)) {
20591
20611
  return assetKeyWithBindings(property.name, checker, bindings);
20592
20612
  }
20593
- if (propertyName(property) === name && ts2.isPropertyAssignment(property)) {
20613
+ if (propertyName(property) === name && lazyTypescript.isPropertyAssignment(property)) {
20594
20614
  return assetKeyWithBindings(property.initializer, checker, bindings);
20595
20615
  }
20596
- if (!ts2.isSpreadAssignment(property))
20616
+ if (!lazyTypescript.isSpreadAssignment(property))
20597
20617
  continue;
20598
20618
  const nestedObject = spreadObject(property.expression, checker, bindings);
20599
20619
  if (!nestedObject)
@@ -20609,14 +20629,14 @@ var findPageCall = (nodes) => {
20609
20629
  const visit = (candidate) => {
20610
20630
  if (found)
20611
20631
  return;
20612
- if (ts2.isCallExpression(candidate) && ts2.isIdentifier(candidate.expression) && PAGE_HANDLERS.has(candidate.expression.text)) {
20632
+ if (lazyTypescript.isCallExpression(candidate) && lazyTypescript.isIdentifier(candidate.expression) && PAGE_HANDLERS.has(candidate.expression.text)) {
20613
20633
  const definition = PAGE_HANDLERS.get(candidate.expression.text);
20614
20634
  if (!definition)
20615
20635
  return;
20616
20636
  found = { definition, node: candidate };
20617
20637
  return;
20618
20638
  }
20619
- ts2.forEachChild(candidate, visit);
20639
+ lazyTypescript.forEachChild(candidate, visit);
20620
20640
  };
20621
20641
  for (const node of nodes)
20622
20642
  visit(node);
@@ -20625,12 +20645,12 @@ var findPageCall = (nodes) => {
20625
20645
  var isProjectSource = (sourceFile, resolvedFile, projectRoot) => !sourceFile.isDeclarationFile && !resolvedFile.includes("/node_modules/") && resolvedFile.startsWith(`${projectRoot}/`);
20626
20646
  var analyzeRouteCall = (node, sourceFile, checker, projectRoot) => {
20627
20647
  const callee = node.expression;
20628
- if (!ts2.isPropertyAccessExpression(callee))
20648
+ if (!lazyTypescript.isPropertyAccessExpression(callee))
20629
20649
  return;
20630
20650
  if (!ROUTE_METHODS.has(callee.name.text))
20631
20651
  return;
20632
20652
  const [routePath] = node.arguments;
20633
- if (!routePath || !ts2.isStringLiteralLike(routePath))
20653
+ if (!routePath || !lazyTypescript.isStringLiteralLike(routePath))
20634
20654
  return;
20635
20655
  const foundPageCall = findPageCall(node.arguments.slice(1));
20636
20656
  const pageCall = foundPageCall?.node;
@@ -20663,7 +20683,7 @@ var analyzeRouteCall = (node, sourceFile, checker, projectRoot) => {
20663
20683
  routeCallSpan: `${node.getStart(sourceFile)}:${node.end}`
20664
20684
  };
20665
20685
  }
20666
- if (!ts2.isObjectLiteralExpression(input) || !definition.bundleProperty) {
20686
+ if (!lazyTypescript.isObjectLiteralExpression(input) || !definition.bundleProperty) {
20667
20687
  return;
20668
20688
  }
20669
20689
  const page = definition.pageProperty ? objectPropertyExpression(input, definition.pageProperty) : undefined;
@@ -20705,14 +20725,14 @@ var analyzeSourceFile = (sourceFile, checker, projectRoot) => {
20705
20725
  byRouteCall: new Map
20706
20726
  };
20707
20727
  const visit = (node) => {
20708
- const result = ts2.isCallExpression(node) ? analyzeRouteCall(node, sourceFile, checker, projectRoot) : undefined;
20728
+ const result = lazyTypescript.isCallExpression(node) ? analyzeRouteCall(node, sourceFile, checker, projectRoot) : undefined;
20709
20729
  if (result) {
20710
20730
  analysis.byPageCall.set(result.pageCallStart, result);
20711
20731
  analysis.byRouteCall.set(result.routeCallSpan, result);
20712
20732
  }
20713
- ts2.forEachChild(node, visit);
20733
+ lazyTypescript.forEachChild(node, visit);
20714
20734
  };
20715
- ts2.forEachChild(sourceFile, visit);
20735
+ lazyTypescript.forEachChild(sourceFile, visit);
20716
20736
  return analysis;
20717
20737
  };
20718
20738
  var analyzeProgram = (program, projectRoot) => {
@@ -20728,21 +20748,21 @@ var analyzeProgram = (program, projectRoot) => {
20728
20748
  }
20729
20749
  return analyzed;
20730
20750
  };
20731
- var metadataExpression = (metadata) => ts2.factory.createObjectLiteralExpression(Object.entries(metadata).map(([key, item]) => ts2.factory.createPropertyAssignment(ts2.factory.createStringLiteral(key), ts2.factory.createStringLiteral(item))), false);
20751
+ var metadataExpression = (metadata) => lazyTypescript.factory.createObjectLiteralExpression(Object.entries(metadata).map(([key, item]) => lazyTypescript.factory.createPropertyAssignment(lazyTypescript.factory.createStringLiteral(key), lazyTypescript.factory.createStringLiteral(item))), false);
20732
20752
  var routeOptions = (existing, metadata) => {
20733
- const detail = ts2.factory.createObjectLiteralExpression([
20734
- ts2.factory.createPropertyAssignment(ts2.factory.createStringLiteral(ABSOLUTE_MOBILE_ROUTE_DETAIL), metadataExpression(metadata))
20753
+ const detail = lazyTypescript.factory.createObjectLiteralExpression([
20754
+ lazyTypescript.factory.createPropertyAssignment(lazyTypescript.factory.createStringLiteral(ABSOLUTE_MOBILE_ROUTE_DETAIL), metadataExpression(metadata))
20735
20755
  ]);
20736
20756
  if (!existing) {
20737
- return ts2.factory.createObjectLiteralExpression([
20738
- ts2.factory.createPropertyAssignment("detail", detail)
20757
+ return lazyTypescript.factory.createObjectLiteralExpression([
20758
+ lazyTypescript.factory.createPropertyAssignment("detail", detail)
20739
20759
  ]);
20740
20760
  }
20741
- return ts2.factory.createObjectLiteralExpression([
20742
- ts2.factory.createSpreadAssignment(existing),
20743
- ts2.factory.createPropertyAssignment("detail", ts2.factory.createObjectLiteralExpression([
20744
- ts2.factory.createSpreadAssignment(ts2.factory.createPropertyAccessExpression(existing, "detail")),
20745
- ts2.factory.createPropertyAssignment(ts2.factory.createStringLiteral(ABSOLUTE_MOBILE_ROUTE_DETAIL), metadataExpression(metadata))
20761
+ return lazyTypescript.factory.createObjectLiteralExpression([
20762
+ lazyTypescript.factory.createSpreadAssignment(existing),
20763
+ lazyTypescript.factory.createPropertyAssignment("detail", lazyTypescript.factory.createObjectLiteralExpression([
20764
+ lazyTypescript.factory.createSpreadAssignment(lazyTypescript.factory.createPropertyAccessExpression(existing, "detail")),
20765
+ lazyTypescript.factory.createPropertyAssignment(lazyTypescript.factory.createStringLiteral(ABSOLUTE_MOBILE_ROUTE_DETAIL), metadataExpression(metadata))
20746
20766
  ]))
20747
20767
  ]);
20748
20768
  };
@@ -20753,19 +20773,19 @@ var transformPageCall = (node, page) => {
20753
20773
  const [pagePath, existingOptions, ...rest] = node.arguments;
20754
20774
  if (!pagePath)
20755
20775
  return;
20756
- const options = ts2.factory.createObjectLiteralExpression([
20757
- ...existingOptions ? [ts2.factory.createSpreadAssignment(existingOptions)] : [],
20758
- ts2.factory.createPropertyAssignment("__absoluteMobile", metadataExpression(page.metadata))
20776
+ const options = lazyTypescript.factory.createObjectLiteralExpression([
20777
+ ...existingOptions ? [lazyTypescript.factory.createSpreadAssignment(existingOptions)] : [],
20778
+ lazyTypescript.factory.createPropertyAssignment("__absoluteMobile", metadataExpression(page.metadata))
20759
20779
  ]);
20760
- return ts2.factory.updateCallExpression(node, node.expression, node.typeArguments, [pagePath, options, ...rest]);
20780
+ return lazyTypescript.factory.updateCallExpression(node, node.expression, node.typeArguments, [pagePath, options, ...rest]);
20761
20781
  }
20762
20782
  const [input] = node.arguments;
20763
- if (!input || !ts2.isObjectLiteralExpression(input))
20783
+ if (!input || !lazyTypescript.isObjectLiteralExpression(input))
20764
20784
  return;
20765
- return ts2.factory.updateCallExpression(node, node.expression, node.typeArguments, [
20766
- ts2.factory.updateObjectLiteralExpression(input, [
20785
+ return lazyTypescript.factory.updateCallExpression(node, node.expression, node.typeArguments, [
20786
+ lazyTypescript.factory.updateObjectLiteralExpression(input, [
20767
20787
  ...input.properties,
20768
- ts2.factory.createPropertyAssignment("__absoluteMobile", metadataExpression(page.metadata))
20788
+ lazyTypescript.factory.createPropertyAssignment("__absoluteMobile", metadataExpression(page.metadata))
20769
20789
  ]),
20770
20790
  ...node.arguments.slice(1)
20771
20791
  ]);
@@ -20778,16 +20798,16 @@ var transformRouteCall = (node, route) => {
20778
20798
  return;
20779
20799
  const options = maybeHandler ? maybeOptions : undefined;
20780
20800
  const handler = maybeHandler ?? maybeOptions;
20781
- return ts2.factory.updateCallExpression(node, node.expression, node.typeArguments, [path, routeOptions(options, route.metadata), handler, ...rest]);
20801
+ return lazyTypescript.factory.updateCallExpression(node, node.expression, node.typeArguments, [path, routeOptions(options, route.metadata), handler, ...rest]);
20782
20802
  };
20783
20803
  var transformFile = (source, fileName, analysis) => {
20784
- const sourceFile = ts2.createSourceFile(fileName, source, ts2.ScriptTarget.Latest, true, fileName.endsWith("x") ? ts2.ScriptKind.TSX : ts2.ScriptKind.TS);
20804
+ const sourceFile = lazyTypescript.createSourceFile(fileName, source, lazyTypescript.ScriptTarget.Latest, true, fileName.endsWith("x") ? lazyTypescript.ScriptKind.TSX : lazyTypescript.ScriptKind.TS);
20785
20805
  const transformer = (context) => {
20786
20806
  const visit = (node) => {
20787
- if (!ts2.isCallExpression(node)) {
20788
- return ts2.visitEachChild(node, visit, context);
20807
+ if (!lazyTypescript.isCallExpression(node)) {
20808
+ return lazyTypescript.visitEachChild(node, visit, context);
20789
20809
  }
20790
- const transformedChildren = ts2.visitEachChild(node, visit, context);
20810
+ const transformedChildren = lazyTypescript.visitEachChild(node, visit, context);
20791
20811
  const page = analysis.byPageCall.get(node.getStart(sourceFile));
20792
20812
  const transformedPage = transformPageCall(transformedChildren, page);
20793
20813
  if (transformedPage)
@@ -20798,14 +20818,14 @@ var transformFile = (source, fileName, analysis) => {
20798
20818
  return transformedRoute;
20799
20819
  return transformedChildren;
20800
20820
  };
20801
- return (node) => ts2.visitNode(node, visit, ts2.isSourceFile) ?? node;
20821
+ return (node) => lazyTypescript.visitNode(node, visit, lazyTypescript.isSourceFile) ?? node;
20802
20822
  };
20803
- const result = ts2.transform(sourceFile, [transformer]);
20823
+ const result = lazyTypescript.transform(sourceFile, [transformer]);
20804
20824
  try {
20805
20825
  const [transformed] = result.transformed;
20806
20826
  if (!transformed)
20807
20827
  throw new TypeError("Mobile route transform failed.");
20808
- return ts2.createPrinter().printFile(transformed);
20828
+ return lazyTypescript.createPrinter().printFile(transformed);
20809
20829
  } finally {
20810
20830
  result.dispose();
20811
20831
  }
@@ -27659,5 +27679,5 @@ export {
27659
27679
  writeAbsoluteMobileUpdateRegistry
27660
27680
  };
27661
27681
 
27662
- //# debugId=CDE65FCB7B21BC4364756E2164756E21
27682
+ //# debugId=C21432985745295564756E2164756E21
27663
27683
  //# sourceMappingURL=index.js.map