@absolutejs/absolute 0.20.0-beta.172 → 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 (93) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +3 -2
  3. package/changelog.json +68 -0
  4. package/dist/angular/browser.js +12 -12
  5. package/dist/angular/browser.js.map +6 -7
  6. package/dist/angular/components/core/streamingSlotRegistrar.js +2 -6
  7. package/dist/angular/components/core/streamingSlotRegistry.js +3 -7
  8. package/dist/angular/components/defer-slot.component.js +12 -7
  9. package/dist/angular/components/stream-slot.component.js +3 -1
  10. package/dist/angular/index.js +86 -39
  11. package/dist/angular/index.js.map +11 -10
  12. package/dist/angular/server.js +85 -38
  13. package/dist/angular/server.js.map +10 -9
  14. package/dist/build/buildWorker.js +135 -57
  15. package/dist/build.js +1817 -1623
  16. package/dist/build.js.map +38 -36
  17. package/dist/cli/{add-ae6mg79m.js → add-ntg96znk.js} +32 -31
  18. package/dist/cli/{compile-ndc36zna.js → compile-n6fs2vmx.js} +16 -14
  19. package/dist/cli/config/server.js +128 -77
  20. package/dist/cli/{dev-x49583aj.js → dev-6h1f0mzq.js} +1 -1
  21. package/dist/cli/{doctor-repprx92.js → doctor-m36tmx4d.js} +70 -15
  22. package/dist/cli/{expoProject-h404n2r8.js → expoProject-1qtw97js.js} +2 -1
  23. package/dist/cli/{generate-brvjesd6.js → generate-5vyz1s44.js} +7 -6
  24. package/dist/cli/{htmx-5twhjz7p.js → htmx-26hs6jdm.js} +2 -1
  25. package/dist/cli/{index-gyjxrnnz.js → index-23hvdyxf.js} +18 -16
  26. package/dist/cli/index-4j1twret.js +22 -0
  27. package/dist/cli/{index-25e7k849.js → index-bhyd3ejc.js} +4 -4
  28. package/dist/cli/{index-s0r5q839.js → index-cksezef8.js} +10 -8
  29. package/dist/cli/{index-q3snnhyd.js → index-enbw9484.js} +34 -33
  30. package/dist/cli/{index-b1wht4q5.js → index-kes8he5s.js} +6 -4
  31. package/dist/cli/{index-z794p5qg.js → index-mqevg32w.js} +22 -19
  32. package/dist/cli/{index-vh68jb0e.js → index-pkw3jktb.js} +17 -16
  33. package/dist/cli/{index-rervww4p.js → index-zyd80s3h.js} +119 -119
  34. package/dist/cli/index.js +12 -12
  35. package/dist/cli/{islands-p4vgx7a2.js → islands-vk05sj6v.js} +5 -4
  36. package/dist/cli/{mobile-nqdkk3gd.js → mobile-62b6j3j7.js} +5 -4
  37. package/dist/cli/{remove-abaf0w6k.js → remove-4jh862qa.js} +6 -5
  38. package/dist/cli/{start-t3cq57wn.js → start-jh6kyp92.js} +5 -4
  39. package/dist/cli/{typecheck-fag7djt5.js → typecheck-7fvww3b7.js} +28 -26
  40. package/dist/core/streamingSlotRegistrar.js +2 -5
  41. package/dist/core/streamingSlotRegistrar.js.map +4 -5
  42. package/dist/core/streamingSlotRegistry.js +2 -5
  43. package/dist/core/streamingSlotRegistry.js.map +4 -5
  44. package/dist/dev/importCostReport.js +45 -26
  45. package/dist/dev/serverBootstrap.js +2 -1
  46. package/dist/index.js +1748 -1550
  47. package/dist/index.js.map +40 -38
  48. package/dist/islands/index.js +2 -2
  49. package/dist/islands/index.js.map +3 -3
  50. package/dist/mobile/browser.js +2 -2
  51. package/dist/mobile/browser.js.map +3 -3
  52. package/dist/mobile/index.js +116 -96
  53. package/dist/mobile/index.js.map +7 -6
  54. package/dist/mobile/remoteMacAgentEntry.js +205 -651
  55. package/dist/react/components/index.js +2 -5
  56. package/dist/react/components/index.js.map +5 -6
  57. package/dist/react/index.js +45 -16
  58. package/dist/react/index.js.map +8 -8
  59. package/dist/react/router/browser.js.map +2 -2
  60. package/dist/react/router/index.js.map +2 -2
  61. package/dist/react/server.js +45 -16
  62. package/dist/react/server.js.map +8 -8
  63. package/dist/src/angular/components/defer-slot.component.d.ts +1 -0
  64. package/dist/src/build/missingReactRouter.d.ts +8 -0
  65. package/dist/src/build/vueModuleOutputPath.d.ts +10 -6
  66. package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +3 -3
  67. package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +3 -3
  68. package/dist/src/cli/scripts/doctor.d.ts +10 -0
  69. package/dist/src/core/streamingSlotWarningScope.d.ts +3 -0
  70. package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
  71. package/dist/src/dev/angular/hmrImportGenerator.d.ts +2 -2
  72. package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +2 -2
  73. package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +40 -40
  74. package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +3 -3
  75. package/dist/src/dev/hot/reload.d.ts +5 -0
  76. package/dist/src/dev/hot/runtime.d.ts +2 -0
  77. package/dist/src/dev/srcPath.d.ts +2 -1
  78. package/dist/src/react/pageHandler.d.ts +5 -0
  79. package/dist/src/react/router/Link.d.ts +6 -1
  80. package/dist/src/react/serverComponents/pageHandler.d.ts +2 -0
  81. package/dist/src/utils/lazyTypescript.d.ts +3 -0
  82. package/dist/src/utils/portInUse.d.ts +16 -0
  83. package/dist/svelte/index.js +39 -12
  84. package/dist/svelte/index.js.map +6 -6
  85. package/dist/svelte/server.js +39 -12
  86. package/dist/svelte/server.js.map +6 -6
  87. package/dist/vue/components/index.js +2 -5
  88. package/dist/vue/components/index.js.map +4 -5
  89. package/dist/vue/index.js +39 -12
  90. package/dist/vue/index.js.map +6 -6
  91. package/dist/vue/server.js +39 -12
  92. package/dist/vue/server.js.map +6 -6
  93. package/package.json +1 -1
@@ -14,15 +14,70 @@ import {
14
14
  import {
15
15
  isRecord
16
16
  } from "./index-tx0kx9zx.js";
17
- import {
18
- scanListeners
19
- } from "./index-x8x0f3ha.js";
20
17
 
21
18
  // src/cli/scripts/doctor.ts
22
19
  import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
23
20
  import { createRequire as createRequire2 } from "module";
24
21
  import { join as join2 } from "path";
25
22
 
23
+ // src/utils/portInUse.ts
24
+ import { spawnSync } from "child_process";
25
+ import { createConnection, createServer } from "net";
26
+ var CONNECT_TIMEOUT_MS = 300;
27
+ var IPV4_LOOPBACK = "127.0.0.1";
28
+ var IPV6_LOOPBACK = "::1";
29
+ var IPV4_ANY = "0.0.0.0";
30
+ var IPV6_ANY = "::";
31
+ var acceptsConnection = (port, host) => new Promise((resolve) => {
32
+ const socket = createConnection({ host, port });
33
+ const finish = (accepted) => {
34
+ clearTimeout(timer);
35
+ socket.removeAllListeners();
36
+ socket.on("error", () => {
37
+ return;
38
+ });
39
+ socket.destroy();
40
+ resolve(accepted);
41
+ };
42
+ const timer = setTimeout(() => finish(false), CONNECT_TIMEOUT_MS);
43
+ socket.once("connect", () => finish(true));
44
+ socket.once("error", () => finish(false));
45
+ });
46
+ var bindConflicts = (port, host, ipv6Only) => new Promise((resolve) => {
47
+ const server = createServer();
48
+ server.unref();
49
+ server.once("error", (error) => {
50
+ server.close(() => {
51
+ return;
52
+ });
53
+ resolve(error.code === "EADDRINUSE");
54
+ });
55
+ server.listen({ exclusive: true, host, ipv6Only, port }, () => {
56
+ server.close(() => resolve(false));
57
+ });
58
+ });
59
+ var isPortInUse = async (port) => {
60
+ if (await acceptsConnection(port, IPV4_LOOPBACK))
61
+ return true;
62
+ if (await acceptsConnection(port, IPV6_LOOPBACK))
63
+ return true;
64
+ if (await bindConflicts(port, IPV4_ANY, false))
65
+ return true;
66
+ return bindConflicts(port, IPV6_ANY, true);
67
+ };
68
+ var portListenerPids = (port) => {
69
+ try {
70
+ const result = spawnSync("lsof", ["-nP", "-t", `-iTCP:${port}`, "-sTCP:LISTEN"], { encoding: "utf-8", timeout: 2000 });
71
+ const output = typeof result.stdout === "string" ? result.stdout : "";
72
+ return [
73
+ ...new Set(output.split(`
74
+ `).map(Number).filter((pid) => Number.isInteger(pid) && pid > 0 && pid !== process.pid))
75
+ ];
76
+ } catch {
77
+ return [];
78
+ }
79
+ };
80
+
26
81
  // src/cli/typeGraphCoherence.ts
27
82
  import {
28
83
  existsSync,
@@ -312,15 +367,18 @@ var envCheck = async () => {
312
367
  }
313
368
  return check("fail", "Env vars", `missing ${missing.map((entry) => entry.key).join(", ")}`);
314
369
  };
315
- var devPort = (config) => {
316
- const dev = Reflect.get(config, "dev");
317
- const port = dev && typeof dev === "object" ? Reflect.get(dev, "port") : undefined;
318
- return typeof port === "number" ? port : DEFAULT_PORT;
370
+ var devPort = (config, env = process.env) => {
371
+ const dev = config ? Reflect.get(config, "dev") : undefined;
372
+ const configured = dev && typeof dev === "object" ? Reflect.get(dev, "port") : undefined;
373
+ return Number(env.ABSOLUTE_PORT) || Number(env.PORT) || (typeof configured === "number" && configured > 0 ? configured : DEFAULT_PORT);
319
374
  };
320
- var portCheck = async (config) => {
321
- const port = devPort(config);
322
- const holder = (await scanListeners()).find((listener) => listener.port === port);
323
- return holder ? check("warn", "Dev port", `${port} in use by pid ${holder.pid}`) : check("ok", "Dev port", `${port} free`);
375
+ var portCheck = async (config, env = process.env) => {
376
+ const port = devPort(config, env);
377
+ if (!await isPortInUse(port)) {
378
+ return check("ok", "Dev port", `${port} free`);
379
+ }
380
+ const pids = portListenerPids(port);
381
+ return check("warn", "Dev port", pids.length > 0 ? `${port} in use by pid ${pids.join(", ")}` : `${port} in use`);
324
382
  };
325
383
  var typeGraphCheck = () => {
326
384
  const report = typeGraphCoherence.inspectTypeGraph(process.cwd());
@@ -364,10 +422,7 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
364
422
  var gatherChecks = async () => {
365
423
  const config = await loadConfigOrNull();
366
424
  const configCheck = config === null ? check("fail", "Config", "absolute.config.ts not found or invalid") : check("ok", "Config", "absolute.config.ts loaded");
367
- const [env, port] = await Promise.all([
368
- envCheck(),
369
- config === null ? check("warn", "Dev port", "skipped (no config)") : portCheck(config)
370
- ]);
425
+ const [env, port] = await Promise.all([envCheck(), portCheck(config)]);
371
426
  return [
372
427
  checkBun(),
373
428
  checkAbsolute(),
@@ -2,7 +2,8 @@
2
2
  import {
3
3
  writeAbsoluteExpoProject2,
4
4
  syncAbsoluteExpoWebAssets2
5
- } from "./index-s0r5q839.js";
5
+ } from "./index-cksezef8.js";
6
+ import"./index-4j1twret.js";
6
7
  import"./index-pch0v1z6.js";
7
8
  export {
8
9
  syncAbsoluteExpoWebAssets2 as syncAbsoluteExpoWebAssets,
@@ -1,15 +1,19 @@
1
1
  // @bun
2
2
  import"./index-wk0pyxrg.js";
3
+ import"./index-4j1twret.js";
3
4
  import {
4
5
  frameworks,
5
6
  resolveProject,
6
7
  selectFramework,
7
8
  toModuleSpecifier
8
- } from "./index-q3snnhyd.js";
9
+ } from "./index-enbw9484.js";
9
10
  import"./index-t8jmj8w1.js";
10
11
  import {
11
12
  wirePluginUse
12
- } from "./index-gyjxrnnz.js";
13
+ } from "./index-23hvdyxf.js";
14
+ import {
15
+ colors
16
+ } from "./index-9djrap79.js";
13
17
  import {
14
18
  isValidName,
15
19
  toCamelCase,
@@ -18,10 +22,7 @@ import {
18
22
  toTitleCase,
19
23
  emptyOutcome,
20
24
  generatePage
21
- } from "./index-vh68jb0e.js";
22
- import {
23
- colors
24
- } from "./index-9djrap79.js";
25
+ } from "./index-pkw3jktb.js";
25
26
  import"./index-125cfzvn.js";
26
27
  import"./index-3ewt17wm.js";
27
28
  import"./index-pr1skxen.js";
@@ -1,8 +1,9 @@
1
1
  // @bun
2
2
  import"./index-wk0pyxrg.js";
3
+ import"./index-4j1twret.js";
3
4
  import {
4
5
  resolveProject
5
- } from "./index-q3snnhyd.js";
6
+ } from "./index-enbw9484.js";
6
7
  import"./index-t8jmj8w1.js";
7
8
  import {
8
9
  colors
@@ -1,10 +1,12 @@
1
1
  // @bun
2
+ import {
3
+ lazyTypescript
4
+ } from "./index-4j1twret.js";
2
5
  import {
3
6
  toModuleSpecifier
4
- } from "./index-q3snnhyd.js";
7
+ } from "./index-enbw9484.js";
5
8
 
6
9
  // src/cli/generate/routeWiring.ts
7
- import ts from "typescript";
8
10
  import { existsSync, readFileSync, readdirSync, writeFileSync } from "fs";
9
11
  import { dirname, join } from "path";
10
12
  var DEFAULT_SEPARATOR = `
@@ -19,24 +21,24 @@ var applyEdits = (text, edits) => {
19
21
  return output;
20
22
  };
21
23
  var stripExtension = (path) => path.replace(/\.[^./\\]+$/, "");
22
- var parse = (path, text) => ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true);
24
+ var parse = (path, text) => lazyTypescript.createSourceFile(path, text, lazyTypescript.ScriptTarget.Latest, true);
23
25
  var findElysiaNew = (sourceFile) => {
24
26
  let found = null;
25
27
  const visit = (node) => {
26
28
  if (found)
27
29
  return;
28
- if (ts.isNewExpression(node) && ts.isIdentifier(node.expression) && node.expression.text === "Elysia") {
30
+ if (lazyTypescript.isNewExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "Elysia") {
29
31
  found = node;
30
32
  return;
31
33
  }
32
- ts.forEachChild(node, visit);
34
+ lazyTypescript.forEachChild(node, visit);
33
35
  };
34
36
  visit(sourceFile);
35
37
  return found;
36
38
  };
37
39
  var climbChain = (start) => {
38
40
  let top = start;
39
- while (ts.isPropertyAccessExpression(top.parent) && top.parent.expression === top && ts.isCallExpression(top.parent.parent) && top.parent.parent.expression === top.parent) {
41
+ while (lazyTypescript.isPropertyAccessExpression(top.parent) && top.parent.expression === top && lazyTypescript.isCallExpression(top.parent.parent) && top.parent.parent.expression === top.parent) {
40
42
  top = top.parent.parent;
41
43
  }
42
44
  return top;
@@ -44,22 +46,22 @@ var climbChain = (start) => {
44
46
  var collectCalls = (top) => {
45
47
  const calls = [];
46
48
  let node = top;
47
- while (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression)) {
49
+ while (lazyTypescript.isCallExpression(node) && lazyTypescript.isPropertyAccessExpression(node.expression)) {
48
50
  calls.push(node);
49
51
  node = node.expression.expression;
50
52
  }
51
53
  return calls.reverse();
52
54
  };
53
- var methodName = (call) => ts.isPropertyAccessExpression(call.expression) ? call.expression.name.text : null;
55
+ var methodName = (call) => lazyTypescript.isPropertyAccessExpression(call.expression) ? call.expression.name.text : null;
54
56
  var isBoundary = (call) => {
55
57
  const name = methodName(call);
56
58
  const [arg] = call.arguments;
57
- if (name === "use" && arg && ts.isIdentifier(arg)) {
59
+ if (name === "use" && arg && lazyTypescript.isIdentifier(arg)) {
58
60
  return BOUNDARY_USE.has(arg.text);
59
61
  }
60
- return name === "on" && arg !== undefined && ts.isStringLiteralLike(arg);
62
+ return name === "on" && arg !== undefined && lazyTypescript.isStringLiteralLike(arg);
61
63
  };
62
- var receiverEnd = (call) => ts.isPropertyAccessExpression(call.expression) ? call.expression.expression.getEnd() : call.getEnd();
64
+ var receiverEnd = (call) => lazyTypescript.isPropertyAccessExpression(call.expression) ? call.expression.expression.getEnd() : call.getEnd();
63
65
  var separatorBefore = (text, offset) => {
64
66
  const match = text.slice(offset).match(/^(\s*\n[ \t]*)\./);
65
67
  return match ? match[1] : DEFAULT_SEPARATOR;
@@ -76,22 +78,22 @@ var findRouteInsertion = (text, top) => {
76
78
  const sepProbe = last ? receiverEnd(last) : top.getEnd();
77
79
  return { offset, separator: separatorBefore(text, sepProbe) };
78
80
  };
79
- var namedImportDecl = (sourceFile, module) => sourceFile.statements.find((statement) => ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier) && statement.moduleSpecifier.text === module && statement.importClause !== undefined && !statement.importClause.isTypeOnly && statement.importClause.namedBindings !== undefined && ts.isNamedImports(statement.importClause.namedBindings));
81
+ var namedImportDecl = (sourceFile, module) => sourceFile.statements.find((statement) => lazyTypescript.isImportDeclaration(statement) && lazyTypescript.isStringLiteral(statement.moduleSpecifier) && statement.moduleSpecifier.text === module && statement.importClause !== undefined && !statement.importClause.isTypeOnly && statement.importClause.namedBindings !== undefined && lazyTypescript.isNamedImports(statement.importClause.namedBindings));
80
82
  var importedNames = (decl) => {
81
83
  const bindings = decl.importClause?.namedBindings;
82
- if (!bindings || !ts.isNamedImports(bindings))
84
+ if (!bindings || !lazyTypescript.isNamedImports(bindings))
83
85
  return new Set;
84
86
  return new Set(bindings.elements.map((element) => (element.propertyName ?? element.name).text));
85
87
  };
86
88
  var lastImportEnd = (sourceFile) => {
87
89
  let end = 0;
88
90
  for (const statement of sourceFile.statements) {
89
- if (ts.isImportDeclaration(statement))
91
+ if (lazyTypescript.isImportDeclaration(statement))
90
92
  end = statement.getEnd();
91
93
  }
92
94
  return end;
93
95
  };
94
- var hasTypeImport = (sourceFile, module, local) => sourceFile.statements.some((statement) => ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier) && statement.moduleSpecifier.text === module && statement.getText().includes(local));
96
+ var hasTypeImport = (sourceFile, module, local) => sourceFile.statements.some((statement) => lazyTypescript.isImportDeclaration(statement) && lazyTypescript.isStringLiteral(statement.moduleSpecifier) && statement.moduleSpecifier.text === module && statement.getText().includes(local));
95
97
  var renderTypeImport = (spec) => {
96
98
  if (spec.kind === "typeDefault") {
97
99
  return `import type ${spec.local} from '${spec.module}';`;
@@ -114,7 +116,7 @@ var groupNamed = (specs) => {
114
116
  };
115
117
  var mergeNamedEdit = (decl, sourceFile, missing) => {
116
118
  const bindings = decl.importClause?.namedBindings;
117
- if (!bindings || !ts.isNamedImports(bindings))
119
+ if (!bindings || !lazyTypescript.isNamedImports(bindings))
118
120
  return null;
119
121
  const { elements } = bindings;
120
122
  const additions = missing.join(", ");
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ // src/utils/lazyTypescript.ts
3
+ import { createRequire } from "module";
4
+ var loaded;
5
+ var loadTypescript = () => {
6
+ if (loaded)
7
+ return loaded;
8
+ const requireFromHere = createRequire(import.meta.url);
9
+ const typescript = requireFromHere("typescript");
10
+ loaded = typescript;
11
+ return typescript;
12
+ };
13
+ var createLazyTypescript = () => {
14
+ const target = Object.create(null);
15
+ return new Proxy(target, {
16
+ get: (_target, key) => Reflect.get(loadTypescript(), key),
17
+ has: (_target, key) => Reflect.has(loadTypescript(), key)
18
+ });
19
+ };
20
+ var lazyTypescript = createLazyTypescript();
21
+
22
+ export { lazyTypescript };
@@ -9,9 +9,6 @@ import {
9
9
  registerInstance,
10
10
  resolveProjectName
11
11
  } from "./index-71gchbzt.js";
12
- import {
13
- loadIslandRegistryBuildInfo
14
- } from "./index-z794p5qg.js";
15
12
  import {
16
13
  createIslandRegistryDefinitionPlugin,
17
14
  createBunStringRawUnicodePlugin,
@@ -20,7 +17,7 @@ import {
20
17
  createElysiaOpenApiTypeboxPlugin,
21
18
  createOptionalPeerPlugin,
22
19
  resolveServerBundleExternals
23
- } from "./index-rervww4p.js";
20
+ } from "./index-zyd80s3h.js";
24
21
  import {
25
22
  normalizeAbsoluteMobileConfig2
26
23
  } from "./index-t7yf3vxs.js";
@@ -30,6 +27,9 @@ import {
30
27
  import {
31
28
  loadConfig
32
29
  } from "./index-wk0pyxrg.js";
30
+ import {
31
+ loadIslandRegistryBuildInfo
32
+ } from "./index-mqevg32w.js";
33
33
  import {
34
34
  stripStringsAndComments
35
35
  } from "./index-prs14ys9.js";
@@ -9,6 +9,9 @@ import {
9
9
  projectUsesAbsoluteSync2,
10
10
  resolveAbsoluteMobileAuthManifest2
11
11
  } from "./index-pch0v1z6.js";
12
+ import {
13
+ lazyTypescript
14
+ } from "./index-4j1twret.js";
12
15
 
13
16
  // src/mobile/expoProject.ts
14
17
  import {
@@ -544,7 +547,6 @@ var discoverAbsoluteSyncSchema = (projectRoot) => {
544
547
  import { existsSync, readFileSync as readFileSync2 } from "fs";
545
548
  import { extname, join as join3, relative, resolve as resolve3 } from "path";
546
549
  import { fileURLToPath } from "url";
547
- import ts from "typescript";
548
550
  var DEVICES_PACKAGE = "@absolutejs/devices";
549
551
  var ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES = [
550
552
  "keyboard",
@@ -749,29 +751,29 @@ var importedCapabilities = (source, file) => {
749
751
  const names = new Set;
750
752
  const namespaces = new Set;
751
753
  const visit = (node) => {
752
- if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && !node.importClause?.isTypeOnly) {
754
+ if (lazyTypescript.isImportDeclaration(node) && lazyTypescript.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && !node.importClause?.isTypeOnly) {
753
755
  const bindings = node.importClause?.namedBindings;
754
- if (bindings && ts.isNamedImports(bindings)) {
756
+ if (bindings && lazyTypescript.isNamedImports(bindings)) {
755
757
  for (const element of bindings.elements)
756
758
  if (!element.isTypeOnly)
757
759
  names.add((element.propertyName ?? element.name).text);
758
760
  }
759
- if (bindings && ts.isNamespaceImport(bindings))
761
+ if (bindings && lazyTypescript.isNamespaceImport(bindings))
760
762
  namespaces.add(bindings.name.text);
761
763
  }
762
- if (ts.isExportDeclaration(node) && !node.isTypeOnly && node.moduleSpecifier !== undefined && ts.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && node.exportClause && ts.isNamedExports(node.exportClause)) {
764
+ if (lazyTypescript.isExportDeclaration(node) && !node.isTypeOnly && node.moduleSpecifier !== undefined && lazyTypescript.isStringLiteral(node.moduleSpecifier) && node.moduleSpecifier.text === DEVICES_PACKAGE && node.exportClause && lazyTypescript.isNamedExports(node.exportClause)) {
763
765
  for (const element of node.exportClause.elements)
764
766
  if (!element.isTypeOnly)
765
767
  names.add((element.propertyName ?? element.name).text);
766
768
  }
767
- if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.expression) && namespaces.has(node.expression.text))
769
+ if (lazyTypescript.isPropertyAccessExpression(node) && lazyTypescript.isIdentifier(node.expression) && namespaces.has(node.expression.text))
768
770
  names.add(node.name.text);
769
- ts.forEachChild(node, visit);
771
+ lazyTypescript.forEachChild(node, visit);
770
772
  };
771
773
  const extension = extname(file).toLowerCase();
772
774
  const sources = extension === ".svelte" || extension === ".vue" ? [...source.matchAll(/<script\b[^>]*>([\s\S]*?)<\/script\s*>/giu)].map((match) => match[1]).filter((value) => value !== undefined) : [source];
773
775
  for (const [index, script] of sources.entries())
774
- visit(ts.createSourceFile(`${file}#script-${index}`, script, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX));
776
+ visit(lazyTypescript.createSourceFile(`${file}#script-${index}`, script, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TSX));
775
777
  return names;
776
778
  };
777
779
  var assertAbsoluteDeviceCapabilityPackages = (projectRoot, plan) => {
@@ -2,6 +2,9 @@
2
2
  import {
3
3
  loadConfig
4
4
  } from "./index-wk0pyxrg.js";
5
+ import {
6
+ lazyTypescript
7
+ } from "./index-4j1twret.js";
5
8
  import {
6
9
  isRecord
7
10
  } from "./index-tx0kx9zx.js";
@@ -135,12 +138,10 @@ var frameworks = {
135
138
  import { dirname, isAbsolute, join, relative, resolve as resolve3 } from "path";
136
139
 
137
140
  // src/cli/config/absolute/resolveAbsoluteConfig.ts
138
- import ts2 from "typescript";
139
141
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
140
142
  import { resolve as resolve2 } from "path";
141
143
 
142
144
  // src/cli/config/schema/fromType.ts
143
- import ts from "typescript";
144
145
  import {
145
146
  existsSync,
146
147
  mkdirSync,
@@ -160,14 +161,14 @@ var isFrameworkRepo = (cwd) => {
160
161
  }
161
162
  };
162
163
  var compilerOptionsFor = (cwd) => {
163
- const tsconfigPath = ts.findConfigFile(cwd, ts.sys.fileExists, "tsconfig.json");
164
+ const tsconfigPath = lazyTypescript.findConfigFile(cwd, lazyTypescript.sys.fileExists, "tsconfig.json");
164
165
  const parseConfigHost = {
165
- ...ts.sys,
166
+ ...lazyTypescript.sys,
166
167
  onUnRecoverableConfigFileDiagnostic: () => {}
167
168
  };
168
- const base = tsconfigPath && ts.getParsedCommandLineOfConfigFile(tsconfigPath, {}, parseConfigHost)?.options;
169
+ const base = tsconfigPath && lazyTypescript.getParsedCommandLineOfConfigFile(tsconfigPath, {}, parseConfigHost)?.options;
169
170
  return {
170
- ...base ?? ts.getDefaultCompilerOptions(),
171
+ ...base ?? lazyTypescript.getDefaultCompilerOptions(),
171
172
  noEmit: true,
172
173
  skipDefaultLibCheck: true,
173
174
  skipLibCheck: true,
@@ -223,7 +224,7 @@ var writeDiskCache = (cwd, typeName, signature, fields, specifier) => {
223
224
  writeFileSync(cacheFile(cwd, typeName, specifier), JSON.stringify({ fields, signature }));
224
225
  } catch {}
225
226
  };
226
- var docOf = (symbol, checker) => ts.displayPartsToString(symbol.getDocumentationComment(checker)).trim();
227
+ var docOf = (symbol, checker) => lazyTypescript.displayPartsToString(symbol.getDocumentationComment(checker)).trim();
227
228
  var typeOfSymbol = (symbol, checker) => {
228
229
  const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];
229
230
  return declaration ? checker.getTypeOfSymbolAtLocation(symbol, declaration) : checker.getDeclaredTypeOfSymbol(symbol);
@@ -244,10 +245,10 @@ var toSchema = (type, checker, depth, seen) => {
244
245
  });
245
246
  if (depth > MAX_DEPTH)
246
247
  return opaque();
247
- const parts = unionParts(type).filter((part) => !hasFlag(part, ts.TypeFlags.Undefined) && !hasFlag(part, ts.TypeFlags.Null));
248
+ const parts = unionParts(type).filter((part) => !hasFlag(part, lazyTypescript.TypeFlags.Undefined) && !hasFlag(part, lazyTypescript.TypeFlags.Null));
248
249
  if (parts.length === 0)
249
250
  return opaque();
250
- if (parts.every((part) => hasFlag(part, ts.TypeFlags.BooleanLike))) {
251
+ if (parts.every((part) => hasFlag(part, lazyTypescript.TypeFlags.BooleanLike))) {
251
252
  return { kind: "boolean" };
252
253
  }
253
254
  const choices = parts.map(literalChoice);
@@ -268,13 +269,13 @@ var single = (type, checker, depth, seen) => {
268
269
  kind: "opaque",
269
270
  typeText: checker.typeToString(type)
270
271
  });
271
- if (hasFlag(type, ts.TypeFlags.BooleanLike))
272
+ if (hasFlag(type, lazyTypescript.TypeFlags.BooleanLike))
272
273
  return { kind: "boolean" };
273
- if (hasFlag(type, ts.TypeFlags.NumberLike))
274
+ if (hasFlag(type, lazyTypescript.TypeFlags.NumberLike))
274
275
  return { kind: "number" };
275
- if (hasFlag(type, ts.TypeFlags.StringLike))
276
+ if (hasFlag(type, lazyTypescript.TypeFlags.StringLike))
276
277
  return { kind: "string" };
277
- if (!hasFlag(type, ts.TypeFlags.Object))
278
+ if (!hasFlag(type, lazyTypescript.TypeFlags.Object))
278
279
  return opaque();
279
280
  if (type.getCallSignatures().length > 0)
280
281
  return opaque();
@@ -295,7 +296,7 @@ var single = (type, checker, depth, seen) => {
295
296
  const fields = props.map((symbol) => ({
296
297
  description: docOf(symbol, checker),
297
298
  name: symbol.getName(),
298
- optional: (symbol.flags & ts.SymbolFlags.Optional) !== 0,
299
+ optional: (symbol.flags & lazyTypescript.SymbolFlags.Optional) !== 0,
299
300
  schema: toSchema(typeOfSymbol(symbol, checker), checker, depth + 1, seen)
300
301
  }));
301
302
  return { fields, kind: "object" };
@@ -317,21 +318,21 @@ var introspectFrom = (cwd, specifier, typeName, options, exclude) => {
317
318
  declare const value: ${typeName};
318
319
  export { value };
319
320
  `;
320
- const host = ts.createCompilerHost(options, true);
321
+ const host = lazyTypescript.createCompilerHost(options, true);
321
322
  const getSourceFile = host.getSourceFile.bind(host);
322
- host.getSourceFile = (fileName, languageVersion, onError, shouldCreate) => fileName === virtualPath ? ts.createSourceFile(fileName, source, languageVersion, true) : getSourceFile(fileName, languageVersion, onError, shouldCreate);
323
+ host.getSourceFile = (fileName, languageVersion, onError, shouldCreate) => fileName === virtualPath ? lazyTypescript.createSourceFile(fileName, source, languageVersion, true) : getSourceFile(fileName, languageVersion, onError, shouldCreate);
323
324
  const fileExists = host.fileExists.bind(host);
324
325
  host.fileExists = (fileName) => fileName === virtualPath ? true : fileExists(fileName);
325
326
  const readFile = host.readFile.bind(host);
326
327
  host.readFile = (fileName) => fileName === virtualPath ? source : readFile(fileName);
327
- const program = ts.createProgram([virtualPath], options, host);
328
+ const program = lazyTypescript.createProgram([virtualPath], options, host);
328
329
  const checker = program.getTypeChecker();
329
330
  const sourceFile = program.getSourceFile(virtualPath);
330
331
  if (!sourceFile)
331
332
  return [];
332
333
  const nodes = [];
333
334
  sourceFile.forEachChild((node) => {
334
- if (!ts.isVariableStatement(node))
335
+ if (!lazyTypescript.isVariableStatement(node))
335
336
  return;
336
337
  const [declaration] = node.declarationList.declarations;
337
338
  if (!declaration)
@@ -344,7 +345,7 @@ export { value };
344
345
  nodes.push({
345
346
  description: docOf(symbol, checker),
346
347
  name,
347
- optional: (symbol.flags & ts.SymbolFlags.Optional) !== 0,
348
+ optional: (symbol.flags & lazyTypescript.SymbolFlags.Optional) !== 0,
348
349
  schema: toSchema(typeOfSymbol(symbol, checker), checker, 1, new Set)
349
350
  });
350
351
  }
@@ -405,18 +406,18 @@ var findConfigPath = (cwd, override) => {
405
406
  }
406
407
  return null;
407
408
  };
408
- var parseSource = (configPath, text) => ts2.createSourceFile(configPath, text, ts2.ScriptTarget.Latest, true);
409
+ var parseSource = (configPath, text) => lazyTypescript.createSourceFile(configPath, text, lazyTypescript.ScriptTarget.Latest, true);
409
410
  var findConfigObject = (sourceFile) => {
410
411
  const pending = [sourceFile];
411
412
  while (pending.length > 0) {
412
413
  const node = pending.pop();
413
414
  if (!node)
414
415
  continue;
415
- const [firstArgument] = ts2.isCallExpression(node) ? node.arguments : [];
416
- if (ts2.isCallExpression(node) && ts2.isIdentifier(node.expression) && node.expression.text === "defineConfig" && firstArgument && ts2.isObjectLiteralExpression(firstArgument)) {
416
+ const [firstArgument] = lazyTypescript.isCallExpression(node) ? node.arguments : [];
417
+ if (lazyTypescript.isCallExpression(node) && lazyTypescript.isIdentifier(node.expression) && node.expression.text === "defineConfig" && firstArgument && lazyTypescript.isObjectLiteralExpression(firstArgument)) {
417
418
  return firstArgument;
418
419
  }
419
- if (ts2.isExportAssignment(node) && ts2.isObjectLiteralExpression(node.expression)) {
420
+ if (lazyTypescript.isExportAssignment(node) && lazyTypescript.isObjectLiteralExpression(node.expression)) {
420
421
  return node.expression;
421
422
  }
422
423
  node.forEachChild((child) => {
@@ -430,25 +431,25 @@ var parseConfigObject = (configPath) => {
430
431
  return { object: findConfigObject(parseSource(configPath, text)), text };
431
432
  };
432
433
  var evalLiteral = (node) => {
433
- if (ts2.isStringLiteralLike(node)) {
434
+ if (lazyTypescript.isStringLiteralLike(node)) {
434
435
  return { opaque: false, value: node.text };
435
436
  }
436
- if (node.kind === ts2.SyntaxKind.TrueKeyword) {
437
+ if (node.kind === lazyTypescript.SyntaxKind.TrueKeyword) {
437
438
  return { opaque: false, value: true };
438
439
  }
439
- if (node.kind === ts2.SyntaxKind.FalseKeyword) {
440
+ if (node.kind === lazyTypescript.SyntaxKind.FalseKeyword) {
440
441
  return { opaque: false, value: false };
441
442
  }
442
- if (node.kind === ts2.SyntaxKind.NullKeyword) {
443
+ if (node.kind === lazyTypescript.SyntaxKind.NullKeyword) {
443
444
  return { opaque: false, value: null };
444
445
  }
445
- if (ts2.isNumericLiteral(node)) {
446
+ if (lazyTypescript.isNumericLiteral(node)) {
446
447
  return { opaque: false, value: Number(node.text) };
447
448
  }
448
- if (ts2.isPrefixUnaryExpression(node) && node.operator === ts2.SyntaxKind.MinusToken && ts2.isNumericLiteral(node.operand)) {
449
+ if (lazyTypescript.isPrefixUnaryExpression(node) && node.operator === lazyTypescript.SyntaxKind.MinusToken && lazyTypescript.isNumericLiteral(node.operand)) {
449
450
  return { opaque: false, value: -Number(node.operand.text) };
450
451
  }
451
- if (ts2.isArrayLiteralExpression(node)) {
452
+ if (lazyTypescript.isArrayLiteralExpression(node)) {
452
453
  const items = [];
453
454
  for (const element of node.elements) {
454
455
  const result = evalLiteral(element);
@@ -458,10 +459,10 @@ var evalLiteral = (node) => {
458
459
  }
459
460
  return { opaque: false, value: items };
460
461
  }
461
- if (ts2.isObjectLiteralExpression(node)) {
462
+ if (lazyTypescript.isObjectLiteralExpression(node)) {
462
463
  const object = {};
463
464
  for (const property of node.properties) {
464
- if (!ts2.isPropertyAssignment(property) || !(ts2.isIdentifier(property.name) || ts2.isStringLiteral(property.name))) {
465
+ if (!lazyTypescript.isPropertyAssignment(property) || !(lazyTypescript.isIdentifier(property.name) || lazyTypescript.isStringLiteral(property.name))) {
465
466
  return { opaque: true, value: undefined };
466
467
  }
467
468
  const result = evalLiteral(property.initializer);
@@ -480,7 +481,7 @@ var readCurrent = (configPath) => {
480
481
  if (!object)
481
482
  return { current, opaqueKeys };
482
483
  for (const property of object.properties) {
483
- if (!ts2.isPropertyAssignment(property) || !(ts2.isIdentifier(property.name) || ts2.isStringLiteral(property.name))) {
484
+ if (!lazyTypescript.isPropertyAssignment(property) || !(lazyTypescript.isIdentifier(property.name) || lazyTypescript.isStringLiteral(property.name))) {
484
485
  continue;
485
486
  }
486
487
  const name = property.name.text;
@@ -1,13 +1,15 @@
1
1
  // @bun
2
+ import {
3
+ lazyTypescript
4
+ } from "./index-4j1twret.js";
2
5
  import {
3
6
  findConfigObject
4
- } from "./index-q3snnhyd.js";
7
+ } from "./index-enbw9484.js";
5
8
  import {
6
9
  isRecord
7
10
  } from "./index-tx0kx9zx.js";
8
11
 
9
12
  // src/cli/config/absolute/editAbsoluteConfig.ts
10
- import ts from "typescript";
11
13
  import { readFileSync, writeFileSync } from "fs";
12
14
 
13
15
  // src/cli/config/schema/serialize.ts
@@ -55,11 +57,11 @@ var lineStartOffset = (text, position) => {
55
57
  return index;
56
58
  };
57
59
  var indentBefore = (text, position) => text.slice(lineStartOffset(text, position), position);
58
- var findProperty = (object, name) => object.properties.find((property) => ts.isPropertyAssignment(property) && (ts.isIdentifier(property.name) || ts.isStringLiteral(property.name)) && property.name.text === name);
60
+ var findProperty = (object, name) => object.properties.find((property) => lazyTypescript.isPropertyAssignment(property) && (lazyTypescript.isIdentifier(property.name) || lazyTypescript.isStringLiteral(property.name)) && property.name.text === name);
59
61
  var applyAbsoluteConfigEdit = (configPath, request) => {
60
62
  try {
61
63
  const text = readFileSync(configPath, "utf-8");
62
- const sourceFile = ts.createSourceFile(configPath, text, ts.ScriptTarget.Latest, true);
64
+ const sourceFile = lazyTypescript.createSourceFile(configPath, text, lazyTypescript.ScriptTarget.Latest, true);
63
65
  const object = findConfigObject(sourceFile);
64
66
  if (!object) {
65
67
  return {