@absolutejs/absolute 0.19.0-beta.1108 → 0.19.0-beta.1109

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/dist/cli/index.js CHANGED
@@ -176116,15 +176116,216 @@ var init_logs = __esm(() => {
176116
176116
  init_tuiPrimitives();
176117
176117
  });
176118
176118
 
176119
+ // src/cli/typeGraphCoherence.ts
176120
+ import {
176121
+ existsSync as existsSync32,
176122
+ readFileSync as readFileSync30,
176123
+ realpathSync,
176124
+ rmSync as rmSync5,
176125
+ writeFileSync as writeFileSync18
176126
+ } from "fs";
176127
+ import { createRequire } from "module";
176128
+ import { dirname as dirname13, join as join28, resolve as resolve18, sep } from "path";
176129
+ var DEPENDENCY_FIELDS, TYPE_GRAPH_PACKAGES, readManifest = (path) => {
176130
+ try {
176131
+ const parsed = JSON.parse(readFileSync30(path, "utf-8"));
176132
+ return isRecord4(parsed) ? parsed : null;
176133
+ } catch {
176134
+ return null;
176135
+ }
176136
+ }, dependencyRecord = (manifest, field) => {
176137
+ const value = Reflect.get(manifest, field);
176138
+ return isRecord4(value) ? value : {};
176139
+ }, dependencyNames = (manifest) => [
176140
+ ...new Set(DEPENDENCY_FIELDS.flatMap((field) => Object.keys(dependencyRecord(manifest, field))))
176141
+ ], declaresPackage = (manifest, name) => DEPENDENCY_FIELDS.some((field) => Object.hasOwn(dependencyRecord(manifest, field), name)), manifestName = (manifest, fallback) => {
176142
+ const name = Reflect.get(manifest, "name");
176143
+ return typeof name === "string" ? name : fallback;
176144
+ }, manifestVersion = (manifest) => {
176145
+ const version2 = Reflect.get(manifest, "version");
176146
+ return typeof version2 === "string" ? version2 : "unknown";
176147
+ }, packageJsonFromEntry = (entry, expectedName) => {
176148
+ let directory = dirname13(entry);
176149
+ for (;; ) {
176150
+ const candidate = join28(directory, "package.json");
176151
+ const manifest = readManifest(candidate);
176152
+ if (manifest && manifestName(manifest, "") === expectedName)
176153
+ return candidate;
176154
+ const parent = dirname13(directory);
176155
+ if (parent === directory)
176156
+ return null;
176157
+ directory = parent;
176158
+ }
176159
+ }, resolvePackageJson = (requireFromConsumer, name) => {
176160
+ try {
176161
+ return requireFromConsumer.resolve(`${name}/package.json`);
176162
+ } catch {
176163
+ try {
176164
+ return packageJsonFromEntry(requireFromConsumer.resolve(name), name);
176165
+ } catch {
176166
+ return null;
176167
+ }
176168
+ }
176169
+ }, findInstallRoot = (cwd) => {
176170
+ let directory = resolve18(cwd);
176171
+ for (;; ) {
176172
+ if (existsSync32(join28(directory, "bun.lock")) || existsSync32(join28(directory, "bun.lockb"))) {
176173
+ return directory;
176174
+ }
176175
+ const parent = dirname13(directory);
176176
+ if (parent === directory)
176177
+ return resolve18(cwd);
176178
+ directory = parent;
176179
+ }
176180
+ }, findProjectManifest = (cwd, installRoot) => {
176181
+ let directory = resolve18(cwd);
176182
+ for (;; ) {
176183
+ const candidate = join28(directory, "package.json");
176184
+ if (existsSync32(candidate))
176185
+ return candidate;
176186
+ if (directory === installRoot)
176187
+ return join28(installRoot, "package.json");
176188
+ const parent = dirname13(directory);
176189
+ if (parent === directory)
176190
+ return join28(installRoot, "package.json");
176191
+ directory = parent;
176192
+ }
176193
+ }, appendConsumer = (consumers, consumerPaths, path, manifest) => {
176194
+ const physicalPath = realpathSync(path);
176195
+ if (!manifest || consumerPaths.has(physicalPath))
176196
+ return;
176197
+ consumerPaths.add(physicalPath);
176198
+ consumers.push({ manifest, path });
176199
+ }, inspectTarget = (consumer, consumerName, target) => {
176200
+ if (!declaresPackage(consumer.manifest, target))
176201
+ return {};
176202
+ const path = resolvePackageJson(createRequire(consumer.path), target);
176203
+ if (!path) {
176204
+ return {
176205
+ unresolved: { consumer: consumerName, packageName: target }
176206
+ };
176207
+ }
176208
+ const manifest = readManifest(path) ?? {};
176209
+ return {
176210
+ consumer: { manifest, path },
176211
+ identity: {
176212
+ consumer: consumerName,
176213
+ packageName: target,
176214
+ packagePath: realpathSync(path),
176215
+ version: manifestVersion(manifest)
176216
+ }
176217
+ };
176218
+ }, collectInspection = (inspection, consumers, consumerPaths, identities, unresolved) => {
176219
+ if (inspection.identity)
176220
+ identities.push(inspection.identity);
176221
+ if (inspection.unresolved)
176222
+ unresolved.push(inspection.unresolved);
176223
+ if (!inspection.consumer)
176224
+ return;
176225
+ appendConsumer(consumers, consumerPaths, inspection.consumer.path, inspection.consumer.manifest);
176226
+ }, inspectTypeGraph = (cwd) => {
176227
+ const installRoot = findInstallRoot(cwd);
176228
+ const rootManifestPath = join28(installRoot, "package.json");
176229
+ const rootManifest = readManifest(rootManifestPath) ?? {};
176230
+ const consumers = [
176231
+ { manifest: rootManifest, path: rootManifestPath }
176232
+ ];
176233
+ const consumerPaths = new Set([realpathSync(rootManifestPath)]);
176234
+ const projectManifestPath = findProjectManifest(cwd, installRoot);
176235
+ appendConsumer(consumers, consumerPaths, projectManifestPath, readManifest(projectManifestPath));
176236
+ const projectConsumers = [...consumers];
176237
+ projectConsumers.forEach((consumer) => {
176238
+ const projectRequire = createRequire(consumer.path);
176239
+ dependencyNames(consumer.manifest).forEach((dependency) => {
176240
+ const path = resolvePackageJson(projectRequire, dependency);
176241
+ if (!path)
176242
+ return;
176243
+ appendConsumer(consumers, consumerPaths, path, readManifest(path));
176244
+ });
176245
+ });
176246
+ const identities = [];
176247
+ const unresolved = [];
176248
+ for (const consumer of consumers) {
176249
+ const consumerName = manifestName(consumer.manifest, "<workspace>");
176250
+ const inspections = TYPE_GRAPH_PACKAGES.map((target) => inspectTarget(consumer, consumerName, target));
176251
+ inspections.forEach((inspection) => collectInspection(inspection, consumers, consumerPaths, identities, unresolved));
176252
+ }
176253
+ return { identities, installRoot, unresolved };
176254
+ }, duplicateTypeGraphPackages = (report) => TYPE_GRAPH_PACKAGES.flatMap((name) => {
176255
+ const identities = report.identities.filter((identity) => identity.packageName === name);
176256
+ const paths = [
176257
+ ...new Set(identities.map((identity) => identity.packagePath))
176258
+ ];
176259
+ return paths.length > 1 ? [{ identities, name, paths }] : [];
176260
+ }), preferredIdentity = (duplicate, rootName) => duplicate.identities.find((identity) => identity.consumer === rootName) ?? duplicate.identities.toSorted((left, right) => left.packagePath.length - right.packagePath.length)[0], alignTypeGraphOverrides = (report) => {
176261
+ const duplicates = duplicateTypeGraphPackages(report);
176262
+ if (duplicates.length === 0)
176263
+ return [];
176264
+ const manifestPath = join28(report.installRoot, "package.json");
176265
+ const manifest = readManifest(manifestPath);
176266
+ if (!manifest)
176267
+ return [];
176268
+ const existing = Reflect.get(manifest, "overrides");
176269
+ const overrides = isRecord4(existing) ? existing : {};
176270
+ const changes = [];
176271
+ const rootName = manifestName(manifest, "<workspace>");
176272
+ for (const duplicate of duplicates) {
176273
+ const selected = preferredIdentity(duplicate, rootName);
176274
+ if (!selected || Reflect.get(overrides, duplicate.name) === selected.version)
176275
+ continue;
176276
+ Reflect.set(overrides, duplicate.name, selected.version);
176277
+ changes.push(`${duplicate.name}@${selected.version}`);
176278
+ }
176279
+ if (changes.length > 0) {
176280
+ Reflect.set(manifest, "overrides", overrides);
176281
+ writeFileSync18(manifestPath, `${JSON.stringify(manifest, null, "\t")}
176282
+ `);
176283
+ }
176284
+ return changes;
176285
+ }, removeDuplicateTypeGraphPackages = (report) => {
176286
+ const manifest = readManifest(join28(report.installRoot, "package.json")) ?? {};
176287
+ const rootName = manifestName(manifest, "<workspace>");
176288
+ const installPrefix = `${realpathSync(report.installRoot)}${sep}`;
176289
+ const nodeModulesSegment = `${sep}node_modules${sep}`;
176290
+ const removed = [];
176291
+ const stalePaths = duplicateTypeGraphPackages(report).flatMap((duplicate) => {
176292
+ const selected = preferredIdentity(duplicate, rootName);
176293
+ return selected ? duplicate.paths.filter((path) => path !== selected.packagePath) : [];
176294
+ });
176295
+ for (const stalePath of stalePaths) {
176296
+ if (!stalePath.startsWith(installPrefix) || !stalePath.includes(nodeModulesSegment))
176297
+ continue;
176298
+ rmSync5(dirname13(stalePath), { force: true, recursive: true });
176299
+ removed.push(stalePath);
176300
+ }
176301
+ return removed;
176302
+ }, typeGraphCoherence;
176303
+ var init_typeGraphCoherence = __esm(() => {
176304
+ DEPENDENCY_FIELDS = [
176305
+ "dependencies",
176306
+ "devDependencies",
176307
+ "optionalDependencies",
176308
+ "peerDependencies"
176309
+ ];
176310
+ TYPE_GRAPH_PACKAGES = ["elysia", "@sinclair/typebox"];
176311
+ typeGraphCoherence = {
176312
+ alignTypeGraphOverrides,
176313
+ duplicateTypeGraphPackages,
176314
+ findInstallRoot,
176315
+ inspectTypeGraph,
176316
+ removeDuplicateTypeGraphPackages
176317
+ };
176318
+ });
176319
+
176119
176320
  // src/cli/scripts/doctor.ts
176120
176321
  var exports_doctor = {};
176121
176322
  __export(exports_doctor, {
176122
176323
  runDoctor: () => runDoctor
176123
176324
  });
176124
- import { existsSync as existsSync32, mkdirSync as mkdirSync15, readFileSync as readFileSync30, writeFileSync as writeFileSync18 } from "fs";
176125
- import { createRequire } from "module";
176325
+ import { existsSync as existsSync33, mkdirSync as mkdirSync15, readFileSync as readFileSync31, writeFileSync as writeFileSync19 } from "fs";
176326
+ import { createRequire as createRequire2 } from "module";
176126
176327
  import { arch as arch4, platform as platform5 } from "os";
176127
- import { join as join28 } from "path";
176328
+ import { join as join29 } from "path";
176128
176329
  var FRAMEWORK_FIELDS2, projectRequire, check = (status2, label, detail) => ({
176129
176330
  detail,
176130
176331
  label,
@@ -176159,7 +176360,7 @@ var FRAMEWORK_FIELDS2, projectRequire, check = (status2, label, detail) => ({
176159
176360
  return [];
176160
176361
  const label = `${field.replace("Directory", "")} pages`;
176161
176362
  return [
176162
- existsSync32(join28(process.cwd(), dir)) ? check("ok", label, dir) : check("fail", label, `${dir} (missing)`)
176363
+ existsSync33(join29(process.cwd(), dir)) ? check("ok", label, dir) : check("fail", label, `${dir} (missing)`)
176163
176364
  ];
176164
176365
  }), envCheck = async () => {
176165
176366
  const vars = await collectEnvVars();
@@ -176178,6 +176379,17 @@ var FRAMEWORK_FIELDS2, projectRequire, check = (status2, label, detail) => ({
176178
176379
  const port = devPort(config);
176179
176380
  const holder = (await scanListeners()).find((listener) => listener.port === port);
176180
176381
  return holder ? check("warn", "Dev port", `${port} in use by pid ${holder.pid}`) : check("ok", "Dev port", `${port} free`);
176382
+ }, typeGraphCheck = () => {
176383
+ const report = typeGraphCoherence.inspectTypeGraph(process.cwd());
176384
+ const duplicates = typeGraphCoherence.duplicateTypeGraphPackages(report);
176385
+ if (report.unresolved.length > 0) {
176386
+ return check("fail", "Elysia type graph", `unresolved: ${report.unresolved.map((entry) => `${entry.consumer} \u2192 ${entry.packageName}`).join(", ")}`);
176387
+ }
176388
+ if (duplicates.length > 0) {
176389
+ return check("fail", "Elysia type graph", duplicates.map((entry) => `${entry.name}: ${entry.paths.length} physical copies`).join(", "));
176390
+ }
176391
+ const consumers = new Set(report.identities.map((entry) => entry.consumer));
176392
+ return check("ok", "Elysia type graph", `${consumers.size} consumer${consumers.size === 1 ? "" : "s"} share one package identity`);
176181
176393
  }, STATUS_MARK, renderCheck = (entry, labelWidth) => ` ${STATUS_MARK[entry.status]} ${entry.label.padEnd(labelWidth)} ${colors.dim}${entry.detail}${colors.reset}`, printReport3 = (checks) => {
176182
176394
  const labelWidth = Math.max(...checks.map((entry) => entry.label.length));
176183
176395
  const failed = checks.filter((entry) => entry.status === "fail").length;
@@ -176200,6 +176412,7 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176200
176412
  checkBun(),
176201
176413
  checkAbsolute(),
176202
176414
  checkNative(),
176415
+ typeGraphCheck(),
176203
176416
  configCheck,
176204
176417
  ...config === null ? [] : frameworkChecks(config),
176205
176418
  env5,
@@ -176209,9 +176422,9 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176209
176422
  const fixes = [];
176210
176423
  for (const field of FRAMEWORK_FIELDS2) {
176211
176424
  const dir = readString(config, field);
176212
- if (dir === undefined || existsSync32(join28(cwd, dir)))
176425
+ if (dir === undefined || existsSync33(join29(cwd, dir)))
176213
176426
  continue;
176214
- mkdirSync15(join28(cwd, dir, "pages"), { recursive: true });
176427
+ mkdirSync15(join29(cwd, dir, "pages"), { recursive: true });
176215
176428
  fixes.push(`created ${dir}/pages`);
176216
176429
  }
176217
176430
  return fixes;
@@ -176219,8 +176432,8 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176219
176432
  const missing = (await collectEnvVars()).filter((entry) => !entry.set);
176220
176433
  if (missing.length === 0)
176221
176434
  return null;
176222
- const envExample = join28(cwd, ".env.example");
176223
- const existing = existsSync32(envExample) ? readFileSync30(envExample, "utf-8") : "";
176435
+ const envExample = join29(cwd, ".env.example");
176436
+ const existing = existsSync33(envExample) ? readFileSync31(envExample, "utf-8") : "";
176224
176437
  const existingKeys = new Set(existing.split(`
176225
176438
  `).map((line) => line.split("=")[0]?.trim()));
176226
176439
  const toAdd = missing.filter((entry) => !existingKeys.has(entry.key));
@@ -176229,7 +176442,7 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176229
176442
  const prefix = existing === "" || existing.endsWith(`
176230
176443
  `) ? existing : `${existing}
176231
176444
  `;
176232
- writeFileSync18(envExample, `${prefix}${toAdd.map((entry) => `${entry.key}=`).join(`
176445
+ writeFileSync19(envExample, `${prefix}${toAdd.map((entry) => `${entry.key}=`).join(`
176233
176446
  `)}
176234
176447
  `);
176235
176448
  return `added ${toAdd.length} key(s) to .env.example`;
@@ -176240,6 +176453,20 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176240
176453
  const envFix = await fixEnvExample(cwd);
176241
176454
  if (envFix)
176242
176455
  fixes.push(envFix);
176456
+ const report = typeGraphCoherence.inspectTypeGraph(cwd);
176457
+ const graphFixes = typeGraphCoherence.alignTypeGraphOverrides(report);
176458
+ const removedPackages = typeGraphCoherence.removeDuplicateTypeGraphPackages(report);
176459
+ if (graphFixes.length > 0 || removedPackages.length > 0) {
176460
+ const install = Bun.spawnSync(["bun", "install", "--force"], {
176461
+ cwd: report.installRoot,
176462
+ stderr: "inherit",
176463
+ stdout: "inherit"
176464
+ });
176465
+ if (install.exitCode !== 0) {
176466
+ throw new Error("bun install --force failed while repairing type graph");
176467
+ }
176468
+ fixes.push(`aligned ${graphFixes.join(", ") || "existing overrides"}, removed ${removedPackages.length} stale package cop${removedPackages.length === 1 ? "y" : "ies"}, and rebuilt bun.lock`);
176469
+ }
176243
176470
  return fixes;
176244
176471
  }, runDoctor = async (args) => {
176245
176472
  const fixes = args.includes("--fix") ? await applyFixes() : null;
@@ -176266,6 +176493,7 @@ var init_doctor = __esm(() => {
176266
176493
  init_loadConfig();
176267
176494
  init_portScan();
176268
176495
  init_tuiPrimitives();
176496
+ init_typeGraphCoherence();
176269
176497
  init_env();
176270
176498
  FRAMEWORK_FIELDS2 = [
176271
176499
  "reactDirectory",
@@ -176275,7 +176503,7 @@ var init_doctor = __esm(() => {
176275
176503
  "htmlDirectory",
176276
176504
  "htmxDirectory"
176277
176505
  ];
176278
- projectRequire = createRequire(join28(process.cwd(), "package.json"));
176506
+ projectRequire = createRequire2(join29(process.cwd(), "package.json"));
176279
176507
  STATUS_MARK = {
176280
176508
  fail: `${colors.red}\u2717${colors.reset}`,
176281
176509
  ok: `${colors.green}\u2713${colors.reset}`,
@@ -176579,10 +176807,10 @@ var init_inspect = __esm(() => {
176579
176807
  });
176580
176808
 
176581
176809
  // src/build/scanEntryPoints.ts
176582
- import { existsSync as existsSync33 } from "fs";
176810
+ import { existsSync as existsSync34 } from "fs";
176583
176811
  var {Glob: Glob4 } = globalThis.Bun;
176584
176812
  var scanEntryPoints = async (dir, pattern) => {
176585
- if (!existsSync33(dir))
176813
+ if (!existsSync34(dir))
176586
176814
  return [];
176587
176815
  const entryPaths = [];
176588
176816
  const glob = new Glob4(pattern);
@@ -176664,8 +176892,8 @@ var init_sourceMetadata = __esm(() => {
176664
176892
  });
176665
176893
 
176666
176894
  // src/islands/pageMetadata.ts
176667
- import { readFileSync as readFileSync31 } from "fs";
176668
- import { dirname as dirname13, resolve as resolve18 } from "path";
176895
+ import { readFileSync as readFileSync32 } from "fs";
176896
+ import { dirname as dirname14, resolve as resolve19 } from "path";
176669
176897
  var pagePatterns, getPageDirs = (config) => [
176670
176898
  { dir: config.angularDirectory, framework: "angular" },
176671
176899
  { dir: config.emberDirectory, framework: "ember" },
@@ -176685,8 +176913,8 @@ var pagePatterns, getPageDirs = (config) => [
176685
176913
  const source = definition.buildReference?.source;
176686
176914
  if (!source)
176687
176915
  continue;
176688
- const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve18(dirname13(buildInfo.resolvedRegistryPath), source);
176689
- lookup.set(`${definition.framework}:${definition.component}`, resolve18(resolvedSource));
176916
+ const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve19(dirname14(buildInfo.resolvedRegistryPath), source);
176917
+ lookup.set(`${definition.framework}:${definition.component}`, resolve19(resolvedSource));
176690
176918
  }
176691
176919
  return lookup;
176692
176920
  }, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage2) => {
@@ -176699,13 +176927,13 @@ var pagePatterns, getPageDirs = (config) => [
176699
176927
  const pattern = pagePatterns[entry.framework];
176700
176928
  if (!pattern)
176701
176929
  return;
176702
- const files = await scanEntryPoints(resolve18(entry.dir), pattern);
176930
+ const files = await scanEntryPoints(resolve19(entry.dir), pattern);
176703
176931
  for (const filePath of files) {
176704
- const source = readFileSync31(filePath, "utf-8");
176932
+ const source = readFileSync32(filePath, "utf-8");
176705
176933
  const islands = extractIslandUsagesFromSource(source);
176706
- pageMetadata.set(resolve18(filePath), {
176934
+ pageMetadata.set(resolve19(filePath), {
176707
176935
  islands: resolveIslandUsages(islands, islandSourceLookup),
176708
- pagePath: resolve18(filePath)
176936
+ pagePath: resolve19(filePath)
176709
176937
  });
176710
176938
  }
176711
176939
  }, loadPageIslandMetadata = async (config) => {
@@ -176734,14 +176962,14 @@ var exports_islands = {};
176734
176962
  __export(exports_islands, {
176735
176963
  runIslands: () => runIslands
176736
176964
  });
176737
- import { existsSync as existsSync34, readFileSync as readFileSync32, statSync as statSync5 } from "fs";
176738
- import { join as join29, relative as relative10, resolve as resolve19 } from "path";
176965
+ import { existsSync as existsSync35, readFileSync as readFileSync33, statSync as statSync5 } from "fs";
176966
+ import { join as join30, relative as relative10, resolve as resolve20 } from "path";
176739
176967
  var FRAMEWORK_DIR_KEY, FRAMEWORK_COLOR, printDim6 = (message) => process.stdout.write(`${colors.dim}${message}${colors.reset}
176740
176968
  `), hostFrameworkOf = (pagePath, cwd, config) => {
176741
- const resolved = resolve19(cwd, pagePath);
176969
+ const resolved = resolve20(cwd, pagePath);
176742
176970
  for (const [framework, key] of Object.entries(FRAMEWORK_DIR_KEY)) {
176743
176971
  const dir = config[key];
176744
- if (typeof dir === "string" && resolved.startsWith(resolve19(cwd, dir))) {
176972
+ if (typeof dir === "string" && resolved.startsWith(resolve20(cwd, dir))) {
176745
176973
  return framework;
176746
176974
  }
176747
176975
  }
@@ -176753,20 +176981,20 @@ var FRAMEWORK_DIR_KEY, FRAMEWORK_COLOR, printDim6 = (message) => process.stdout.
176753
176981
  return 0;
176754
176982
  }
176755
176983
  }, readManifestSizes2 = (manifestDir) => {
176756
- const manifestPath = join29(manifestDir, "manifest.json");
176757
- if (!existsSync34(manifestPath))
176984
+ const manifestPath = join30(manifestDir, "manifest.json");
176985
+ if (!existsSync35(manifestPath))
176758
176986
  return null;
176759
- const manifest = JSON.parse(readFileSync32(manifestPath, "utf-8"));
176987
+ const manifest = JSON.parse(readFileSync33(manifestPath, "utf-8"));
176760
176988
  const sizes = new Map;
176761
176989
  for (const [key, value] of Object.entries(manifest)) {
176762
- sizes.set(key, fileSize3(join29(manifestDir, value.replace(/^\//, ""))));
176990
+ sizes.set(key, fileSize3(join30(manifestDir, value.replace(/^\//, ""))));
176763
176991
  }
176764
176992
  return sizes;
176765
176993
  }, collectIslands = async (cwd, config, sizes) => {
176766
176994
  const registryPath = config.islands?.registry;
176767
176995
  if (typeof registryPath !== "string")
176768
176996
  return null;
176769
- const buildInfo = await loadIslandRegistryBuildInfo(resolve19(cwd, registryPath));
176997
+ const buildInfo = await loadIslandRegistryBuildInfo(resolve20(cwd, registryPath));
176770
176998
  const pageMetadata = await loadPageIslandMetadata(config);
176771
176999
  const usages = [...pageMetadata.values()].flatMap((meta) => meta.islands.map((island) => ({ ...island, page: meta.pagePath })));
176772
177000
  return buildInfo.definitions.map((definition) => {
@@ -176776,7 +177004,7 @@ var FRAMEWORK_DIR_KEY, FRAMEWORK_COLOR, printDim6 = (message) => process.stdout.
176776
177004
  crossFramework: hostFramework !== null && hostFramework !== definition.framework,
176777
177005
  hostFramework,
176778
177006
  hydrate: usage2.hydrate ?? "load",
176779
- page: relative10(cwd, resolve19(cwd, usage2.page))
177007
+ page: relative10(cwd, resolve20(cwd, usage2.page))
176780
177008
  };
176781
177009
  });
176782
177010
  const key = getIslandManifestKey(definition.framework, definition.component);
@@ -176845,7 +177073,7 @@ var FRAMEWORK_DIR_KEY, FRAMEWORK_COLOR, printDim6 = (message) => process.stdout.
176845
177073
  }
176846
177074
  const outdirIndex = args.indexOf("--outdir");
176847
177075
  const outdir = outdirIndex >= 0 ? args[outdirIndex + 1] : config.buildDirectory;
176848
- const sizes = args.includes("--sizes") ? readManifestSizes2(resolve19(cwd, outdir ?? "build")) : null;
177076
+ const sizes = args.includes("--sizes") ? readManifestSizes2(resolve20(cwd, outdir ?? "build")) : null;
176849
177077
  const islands = await collectIslands(cwd, config, sizes);
176850
177078
  if (islands === null) {
176851
177079
  printDim6('No island registry configured. Set `islands: { registry: "..." }` in absolute.config.ts.');
@@ -176894,13 +177122,13 @@ var init_islands2 = __esm(() => {
176894
177122
  });
176895
177123
 
176896
177124
  // src/build/externalAssetPlugin.ts
176897
- import { copyFileSync as copyFileSync2, existsSync as existsSync35, mkdirSync as mkdirSync16, statSync as statSync6 } from "fs";
176898
- import { basename as basename6, dirname as dirname14, join as join30, resolve as resolve20 } from "path";
177125
+ import { copyFileSync as copyFileSync2, existsSync as existsSync36, mkdirSync as mkdirSync16, statSync as statSync6 } from "fs";
177126
+ import { basename as basename6, dirname as dirname15, join as join31, resolve as resolve21 } from "path";
176899
177127
  var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
176900
177128
  name: "absolute-external-asset",
176901
177129
  setup(bld) {
176902
177130
  const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
176903
- const skipRoots = userSourceRoots.map((root) => resolve20(root));
177131
+ const skipRoots = userSourceRoots.map((root) => resolve21(root));
176904
177132
  const isUserSource = (path) => skipRoots.some((root) => path.startsWith(`${root}/`));
176905
177133
  bld.onLoad({ filter: /\.[mc]?[jt]sx?$/ }, async (args) => {
176906
177134
  if (isUserSource(args.path))
@@ -176910,20 +177138,20 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
176910
177138
  return;
176911
177139
  urlPattern.lastIndex = 0;
176912
177140
  let match;
176913
- const sourceDir = dirname14(args.path);
177141
+ const sourceDir = dirname15(args.path);
176914
177142
  while ((match = urlPattern.exec(source)) !== null) {
176915
177143
  const relPath = match[1];
176916
177144
  if (!relPath)
176917
177145
  continue;
176918
- const assetPath = resolve20(sourceDir, relPath);
176919
- if (!existsSync35(assetPath))
177146
+ const assetPath = resolve21(sourceDir, relPath);
177147
+ if (!existsSync36(assetPath))
176920
177148
  continue;
176921
177149
  if (!statSync6(assetPath).isFile())
176922
177150
  continue;
176923
- const targetPath = join30(outDir, basename6(assetPath));
176924
- if (existsSync35(targetPath))
177151
+ const targetPath = join31(outDir, basename6(assetPath));
177152
+ if (existsSync36(targetPath))
176925
177153
  continue;
176926
- mkdirSync16(dirname14(targetPath), { recursive: true });
177154
+ mkdirSync16(dirname15(targetPath), { recursive: true });
176927
177155
  copyFileSync2(assetPath, targetPath);
176928
177156
  }
176929
177157
  return;
@@ -176941,17 +177169,17 @@ __export(exports_compile, {
176941
177169
  var {env: env5 } = globalThis.Bun;
176942
177170
  import {
176943
177171
  cpSync,
176944
- existsSync as existsSync36,
177172
+ existsSync as existsSync37,
176945
177173
  mkdirSync as mkdirSync17,
176946
177174
  readdirSync as readdirSync7,
176947
- readFileSync as readFileSync33,
176948
- rmSync as rmSync5,
177175
+ readFileSync as readFileSync34,
177176
+ rmSync as rmSync6,
176949
177177
  statSync as statSync7,
176950
177178
  unlinkSync as unlinkSync4,
176951
- writeFileSync as writeFileSync19
177179
+ writeFileSync as writeFileSync20
176952
177180
  } from "fs";
176953
- import { createRequire as createRequire2 } from "module";
176954
- import { basename as basename7, dirname as dirname15, join as join31, relative as relative11, resolve as resolve21 } from "path";
177181
+ import { createRequire as createRequire3 } from "module";
177182
+ import { basename as basename7, dirname as dirname16, join as join32, relative as relative11, resolve as resolve22 } from "path";
176955
177183
  var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`, compileBanner = (version2) => {
176956
177184
  const resolvedVersion = version2 || "unknown";
176957
177185
  console.log("");
@@ -176964,7 +177192,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
176964
177192
  const entry = pending.pop();
176965
177193
  if (!entry)
176966
177194
  continue;
176967
- const fullPath = join31(entry.parentPath, entry.name);
177195
+ const fullPath = join32(entry.parentPath, entry.name);
176968
177196
  if (entry.isDirectory())
176969
177197
  pending = pending.concat(readdirSync7(fullPath, { withFileTypes: true }));
176970
177198
  else
@@ -176984,7 +177212,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
176984
177212
  const entry = pending.pop();
176985
177213
  if (!entry)
176986
177214
  continue;
176987
- const fullPath = join31(entry.parentPath, entry.name);
177215
+ const fullPath = join32(entry.parentPath, entry.name);
176988
177216
  if (entry.isDirectory()) {
176989
177217
  if (SERVER_RUNTIME_SCAN_SKIP_DIRS.has(entry.name))
176990
177218
  continue;
@@ -176996,22 +177224,22 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
176996
177224
  return result;
176997
177225
  }, copyServerRuntimeAssetReferences = (outdir) => {
176998
177226
  const copied = new Set;
176999
- const normalizedOutdir = resolve21(outdir);
177227
+ const normalizedOutdir = resolve22(outdir);
177000
177228
  const copyReference = (filePath, relPath) => {
177001
- const assetSource = resolve21(dirname15(filePath), relPath);
177002
- if (!existsSync36(assetSource) || !statSync7(assetSource).isFile())
177229
+ const assetSource = resolve22(dirname16(filePath), relPath);
177230
+ if (!existsSync37(assetSource) || !statSync7(assetSource).isFile())
177003
177231
  return;
177004
- const assetTarget = resolve21(normalizedOutdir, relPath.replace(/^\.\//, ""));
177232
+ const assetTarget = resolve22(normalizedOutdir, relPath.replace(/^\.\//, ""));
177005
177233
  if (assetTarget !== normalizedOutdir && !assetTarget.startsWith(`${normalizedOutdir}/`))
177006
177234
  return;
177007
177235
  if (copied.has(assetTarget))
177008
177236
  return;
177009
177237
  copied.add(assetTarget);
177010
- mkdirSync17(dirname15(assetTarget), { recursive: true });
177238
+ mkdirSync17(dirname16(assetTarget), { recursive: true });
177011
177239
  cpSync(assetSource, assetTarget, { force: true });
177012
177240
  };
177013
177241
  for (const filePath of collectProjectSourceFiles(process.cwd())) {
177014
- const source = readFileSync33(filePath, "utf-8");
177242
+ const source = readFileSync34(filePath, "utf-8");
177015
177243
  SERVER_RUNTIME_ASSET_RE.lastIndex = 0;
177016
177244
  let match;
177017
177245
  while ((match = SERVER_RUNTIME_ASSET_RE.exec(source)) !== null) {
@@ -177040,7 +177268,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177040
177268
  }
177041
177269
  }, readPackageVersion4 = (candidate) => {
177042
177270
  try {
177043
- const pkg = JSON.parse(readFileSync33(candidate, "utf-8"));
177271
+ const pkg = JSON.parse(readFileSync34(candidate, "utf-8"));
177044
177272
  if (pkg.name !== "@absolutejs/absolute")
177045
177273
  return null;
177046
177274
  const ver = pkg.version;
@@ -177075,18 +177303,18 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177075
177303
  return resolveBuildModule3(remaining);
177076
177304
  }, resolveJsxDevRuntimeCompatPath2 = () => {
177077
177305
  const candidates = [
177078
- resolve21(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
177079
- resolve21(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js"),
177080
- resolve21(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.ts"),
177081
- resolve21(import.meta.dir, "..", "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
177082
- resolve21(import.meta.dir, "..", "..", "..", "react", "jsxDevRuntimeCompat.js"),
177083
- resolve21(import.meta.dir, "..", "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
177306
+ resolve22(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
177307
+ resolve22(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js"),
177308
+ resolve22(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.ts"),
177309
+ resolve22(import.meta.dir, "..", "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
177310
+ resolve22(import.meta.dir, "..", "..", "..", "react", "jsxDevRuntimeCompat.js"),
177311
+ resolve22(import.meta.dir, "..", "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
177084
177312
  ];
177085
177313
  for (const candidate of candidates) {
177086
- if (existsSync36(candidate))
177314
+ if (existsSync37(candidate))
177087
177315
  return candidate;
177088
177316
  }
177089
- return resolve21(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js");
177317
+ return resolve22(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js");
177090
177318
  }, jsxDevRuntimeCompatPath2, shouldEmbedCompiledAsset = (relativePath, skip = new Set) => {
177091
177319
  if (skip.has(relativePath))
177092
177320
  return false;
@@ -177111,7 +177339,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177111
177339
  return true;
177112
177340
  }), requireForCompile, resolveNativeAssetForRuntime = (specifier) => {
177113
177341
  if (specifier.startsWith("."))
177114
- return resolve21(process.cwd(), specifier);
177342
+ return resolve22(process.cwd(), specifier);
177115
177343
  if (specifier.startsWith("/"))
177116
177344
  return specifier;
177117
177345
  return requireForCompile.resolve(specifier, { paths: [process.cwd()] });
@@ -177123,11 +177351,11 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177123
177351
  return env6;
177124
177352
  }, tryReadNodePackageJson = (packageDir) => {
177125
177353
  try {
177126
- return JSON.parse(readFileSync33(join31(packageDir, "package.json"), "utf-8"));
177354
+ return JSON.parse(readFileSync34(join32(packageDir, "package.json"), "utf-8"));
177127
177355
  } catch {
177128
177356
  return null;
177129
177357
  }
177130
- }, resolveProjectPackageDir = (specifier) => resolve21(process.cwd(), "node_modules", ...specifier.split("/")), copyPackageToBuild = (specifier, outdir, seen) => {
177358
+ }, resolveProjectPackageDir = (specifier) => resolve22(process.cwd(), "node_modules", ...specifier.split("/")), copyPackageToBuild = (specifier, outdir, seen) => {
177131
177359
  if (seen.has(specifier))
177132
177360
  return;
177133
177361
  const srcDir = resolveProjectPackageDir(specifier);
@@ -177135,8 +177363,8 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177135
177363
  if (!pkg)
177136
177364
  return;
177137
177365
  seen.add(specifier);
177138
- const destDir = join31(outdir, "node_modules", ...specifier.split("/"));
177139
- rmSync5(destDir, { force: true, recursive: true });
177366
+ const destDir = join32(outdir, "node_modules", ...specifier.split("/"));
177367
+ rmSync6(destDir, { force: true, recursive: true });
177140
177368
  cpSync(srcDir, destDir, {
177141
177369
  force: true,
177142
177370
  recursive: true,
@@ -177157,8 +177385,8 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177157
177385
  }, copyAngularRuntimePackages = (buildConfig, outdir) => {
177158
177386
  if (!buildConfig.angularDirectory)
177159
177387
  return;
177160
- const angularScopeDir = resolve21(process.cwd(), "node_modules", "@angular");
177161
- const angularPackages = existsSync36(angularScopeDir) ? readdirSync7(angularScopeDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).filter((entry) => entry.name !== "compiler-cli").map((entry) => `@angular/${entry.name}`) : [];
177388
+ const angularScopeDir = resolve22(process.cwd(), "node_modules", "@angular");
177389
+ const angularPackages = existsSync37(angularScopeDir) ? readdirSync7(angularScopeDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).filter((entry) => entry.name !== "compiler-cli").map((entry) => `@angular/${entry.name}`) : [];
177162
177390
  const roots = new Set([...angularPackages, "rxjs", "tslib", "typescript"]);
177163
177391
  const seen = new Set;
177164
177392
  for (const specifier of roots) {
@@ -177176,15 +177404,15 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177176
177404
  copyAngularRuntimePackages(buildConfig, outdir);
177177
177405
  copyChunkReferencedPackages(outdir, seen);
177178
177406
  }, collectRuntimePackageSpecifiers = (distDir) => {
177179
- const nodeModulesDir = join31(distDir, "node_modules");
177180
- if (!existsSync36(nodeModulesDir))
177407
+ const nodeModulesDir = join32(distDir, "node_modules");
177408
+ if (!existsSync37(nodeModulesDir))
177181
177409
  return [];
177182
177410
  const specifiers = [];
177183
177411
  for (const entry of readdirSync7(nodeModulesDir, { withFileTypes: true })) {
177184
177412
  if (!entry.isDirectory())
177185
177413
  continue;
177186
177414
  if (entry.name.startsWith("@")) {
177187
- const scopeDir = join31(nodeModulesDir, entry.name);
177415
+ const scopeDir = join32(nodeModulesDir, entry.name);
177188
177416
  for (const scopedEntry of readdirSync7(scopeDir, {
177189
177417
  withFileTypes: true
177190
177418
  })) {
@@ -177198,7 +177426,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177198
177426
  }
177199
177427
  return specifiers.sort((a, b) => b.length - a.length);
177200
177428
  }, ensureRelativeModuleSpecifier = (fromFile, toFile) => {
177201
- const rel = relative11(dirname15(fromFile), toFile).replace(/\\/g, "/");
177429
+ const rel = relative11(dirname16(fromFile), toFile).replace(/\\/g, "/");
177202
177430
  return rel.startsWith(".") ? rel : `./${rel}`;
177203
177431
  }, pickExportEntry = (value) => {
177204
177432
  if (typeof value === "string")
@@ -177216,18 +177444,18 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177216
177444
  const packageSpecifier = packageSpecifiers.find((root) => specifier === root || specifier.startsWith(`${root}/`));
177217
177445
  if (!packageSpecifier)
177218
177446
  return null;
177219
- const packageDir = join31(distDir, "node_modules", ...packageSpecifier.split("/"));
177447
+ const packageDir = join32(distDir, "node_modules", ...packageSpecifier.split("/"));
177220
177448
  const subpath = specifier.slice(packageSpecifier.length);
177221
- const subPackageDir = subpath ? join31(packageDir, ...subpath.slice(1).split("/")) : null;
177222
- const resolvedPackageDir = subPackageDir && existsSync36(join31(subPackageDir, "package.json")) ? subPackageDir : packageDir;
177223
- const packageJsonPath = join31(resolvedPackageDir, "package.json");
177224
- if (!existsSync36(packageJsonPath))
177449
+ const subPackageDir = subpath ? join32(packageDir, ...subpath.slice(1).split("/")) : null;
177450
+ const resolvedPackageDir = subPackageDir && existsSync37(join32(subPackageDir, "package.json")) ? subPackageDir : packageDir;
177451
+ const packageJsonPath = join32(resolvedPackageDir, "package.json");
177452
+ if (!existsSync37(packageJsonPath))
177225
177453
  return null;
177226
- const pkg = JSON.parse(readFileSync33(packageJsonPath, "utf-8"));
177454
+ const pkg = JSON.parse(readFileSync34(packageJsonPath, "utf-8"));
177227
177455
  const exportKey = resolvedPackageDir !== subPackageDir && subpath ? `.${subpath}` : ".";
177228
177456
  const rootExport = pkg.exports?.[exportKey];
177229
177457
  const entry = pickExportEntry(rootExport) ?? (resolvedPackageDir === subPackageDir || !subpath ? pkg.module ?? pkg.main ?? "index.js" : `.${subpath}`);
177230
- return join31(resolvedPackageDir, entry);
177458
+ return join32(resolvedPackageDir, entry);
177231
177459
  }, RUNTIME_JS_EXTENSIONS, MODULE_SPECIFIER_RE, isRuntimeJsFile = (filePath) => RUNTIME_JS_EXTENSIONS.some((extension) => filePath.endsWith(extension)), isNodeModulesPath = (filePath) => filePath.split(/[\\/]/).includes("node_modules"), isFile = (filePath) => {
177232
177460
  try {
177233
177461
  return statSync7(filePath).isFile();
@@ -177240,16 +177468,16 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177240
177468
  const candidates = [
177241
177469
  candidate,
177242
177470
  ...RUNTIME_JS_EXTENSIONS.map((extension) => `${candidate}${extension}`),
177243
- ...RUNTIME_JS_EXTENSIONS.map((extension) => join31(candidate, `index${extension}`))
177471
+ ...RUNTIME_JS_EXTENSIONS.map((extension) => join32(candidate, `index${extension}`))
177244
177472
  ];
177245
177473
  return candidates.find((filePath) => isRuntimeJsFile(filePath) && isFile(filePath)) ?? null;
177246
177474
  }, findContainingRuntimePackageDir = (filePath) => {
177247
- let dir = dirname15(filePath);
177248
- while (dir !== dirname15(dir)) {
177249
- if (isNodeModulesPath(dir) && existsSync36(join31(dir, "package.json"))) {
177475
+ let dir = dirname16(filePath);
177476
+ while (dir !== dirname16(dir)) {
177477
+ if (isNodeModulesPath(dir) && existsSync37(join32(dir, "package.json"))) {
177250
177478
  return dir;
177251
177479
  }
177252
- dir = dirname15(dir);
177480
+ dir = dirname16(dir);
177253
177481
  }
177254
177482
  return null;
177255
177483
  }, resolvePackageImportEntryFile = (fromFile, specifier) => {
@@ -177262,13 +177490,13 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177262
177490
  const entry = pickExportEntry(pkg?.imports?.[specifier]);
177263
177491
  if (!entry)
177264
177492
  return null;
177265
- return join31(packageDir, entry);
177493
+ return join32(packageDir, entry);
177266
177494
  }, collectRuntimeRewriteRoots = (distDir) => collectFiles2(distDir).filter((filePath) => isRuntimeJsFile(filePath) && !isNodeModulesPath(filePath)), toTopLevelPackage = (specifier) => specifier.split("/").slice(0, specifier.startsWith("@") ? 2 : 1).join("/"), FRAMEWORK_PACKAGE_NAME = "@absolutejs/absolute", copyChunkReferencedPackages = (distDir, seen) => {
177267
- const distRoot = resolve21(distDir);
177495
+ const distRoot = resolve22(distDir);
177268
177496
  for (const filePath of collectRuntimeRewriteRoots(distDir)) {
177269
- if (resolve21(dirname15(filePath)) === distRoot)
177497
+ if (resolve22(dirname16(filePath)) === distRoot)
177270
177498
  continue;
177271
- const source = readFileSync33(filePath, "utf-8");
177499
+ const source = readFileSync34(filePath, "utf-8");
177272
177500
  for (const match of source.matchAll(MODULE_SPECIFIER_RE)) {
177273
177501
  const specifier = match[3];
177274
177502
  if (!specifier || specifier.startsWith(".") || specifier.startsWith("/") || specifier.startsWith("#") || specifier.startsWith("node:") || specifier.startsWith("bun:")) {
@@ -177298,11 +177526,11 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177298
177526
  if (!filePath || seen.has(filePath))
177299
177527
  continue;
177300
177528
  seen.add(filePath);
177301
- const source = readFileSync33(filePath, "utf-8");
177529
+ const source = readFileSync34(filePath, "utf-8");
177302
177530
  const { masked, restore } = maskLiterals(source);
177303
177531
  const rewrittenMasked = masked.replace(MODULE_SPECIFIER_RE, (match, prefix, quote, specifier) => {
177304
177532
  if (typeof specifier === "string" && specifier.startsWith(".")) {
177305
- enqueue(resolveRuntimeJsFile(resolve21(dirname15(filePath), specifier)));
177533
+ enqueue(resolveRuntimeJsFile(resolve22(dirname16(filePath), specifier)));
177306
177534
  return match;
177307
177535
  }
177308
177536
  const packageImportTarget = resolveRuntimeJsFile(resolvePackageImportEntryFile(filePath, specifier) ?? "");
@@ -177318,7 +177546,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177318
177546
  });
177319
177547
  const rewritten = restore(rewrittenMasked);
177320
177548
  if (rewritten !== source) {
177321
- writeFileSync19(filePath, rewritten);
177549
+ writeFileSync20(filePath, rewritten);
177322
177550
  }
177323
177551
  }
177324
177552
  }, generateEntrypoint = (distDir, serverEntry, prerenderMap, version2, buildConfig) => {
@@ -177346,7 +177574,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177346
177574
  const nativeAssets = resolveCompileNativeAssets(buildConfig);
177347
177575
  nativeAssets.forEach((asset, idx) => {
177348
177576
  const varName = `__native${idx}`;
177349
- const importSpecifier = asset.import.startsWith(".") ? resolve21(process.cwd(), asset.import) : asset.import;
177577
+ const importSpecifier = asset.import.startsWith(".") ? resolve22(process.cwd(), asset.import) : asset.import;
177350
177578
  nativeImports.push(`import ${varName} from ${JSON.stringify(importSpecifier)} with { type: "file" };`);
177351
177579
  nativeMappings.push(` [${JSON.stringify(asset.env)}, resolveNativeAssetPath(${varName})],`);
177352
177580
  });
@@ -177405,7 +177633,7 @@ import { websocket as elysiaWebsocket } from "elysia/ws";
177405
177633
  const SERVER_MODULE = (runtimeDir: string) => import(pathToFileURL(join(runtimeDir, ${JSON.stringify(serverBundleName)})).href);
177406
177634
  const RUNTIME_BUILD_ID = ${JSON.stringify(runtimeBuildId)};
177407
177635
  const RUNTIME_CONFIG_SOURCE = ${JSON.stringify(runtimeConfigSource)};
177408
- const ORIGINAL_BUILD_DIR = ${JSON.stringify(resolve21(distDir))};
177636
+ const ORIGINAL_BUILD_DIR = ${JSON.stringify(resolve22(distDir))};
177409
177637
  const ORIGINAL_BUILD_DIR_NORMALIZED = ORIGINAL_BUILD_DIR.replace(/\\\\/g, "/");
177410
177638
 
177411
177639
  const resolveNativeAssetPath = (assetPath: string) => {
@@ -177836,16 +178064,16 @@ console.log(\`
177836
178064
  }),
177837
178065
  ...collectUserServerExternals(buildConfig)
177838
178066
  ], compile = async (serverEntry, outdir, outfile, configPath2) => {
177839
- const resolvedOutdir = resolve21(outdir ?? "dist");
178067
+ const resolvedOutdir = resolve22(outdir ?? "dist");
177840
178068
  await withBuildDirectoryLock(resolvedOutdir, () => compileUnlocked(serverEntry, resolvedOutdir, outfile, configPath2));
177841
178069
  }, compileUnlocked = async (serverEntry, resolvedOutdir, outfile, configPath2) => {
177842
178070
  const prerenderPort = Number(env5.COMPILE_PORT) || Number(env5.PORT) || findFreePort();
177843
178071
  killStaleProcesses(prerenderPort);
177844
178072
  const entryName = basename7(serverEntry).replace(/\.[^.]+$/, "");
177845
- const resolvedOutfile = resolve21(outfile ?? "compiled-server");
178073
+ const resolvedOutfile = resolve22(outfile ?? "compiled-server");
177846
178074
  const absoluteVersion = resolvePackageVersion3([
177847
- resolve21(import.meta.dir, "..", "..", "..", "package.json"),
177848
- resolve21(import.meta.dir, "..", "..", "package.json")
178075
+ resolve22(import.meta.dir, "..", "..", "..", "package.json"),
178076
+ resolve22(import.meta.dir, "..", "..", "package.json")
177849
178077
  ]);
177850
178078
  compileBanner(absoluteVersion);
177851
178079
  const totalStart = performance.now();
@@ -177856,8 +178084,8 @@ console.log(\`
177856
178084
  buildConfig.mode = "production";
177857
178085
  try {
177858
178086
  const build2 = await resolveBuildModule3([
177859
- resolve21(import.meta.dir, "..", "..", "core", "build"),
177860
- resolve21(import.meta.dir, "..", "build")
178087
+ resolve22(import.meta.dir, "..", "..", "core", "build"),
178088
+ resolve22(import.meta.dir, "..", "build")
177861
178089
  ]);
177862
178090
  if (!build2)
177863
178091
  throw new Error("Could not locate build module");
@@ -177879,10 +178107,10 @@ console.log(\`
177879
178107
  buildConfig.htmxDirectory
177880
178108
  ].filter((dir) => Boolean(dir));
177881
178109
  const islandRegistrySpec = buildConfig.islands?.registry;
177882
- const islandRegistryPlugin = islandRegistrySpec ? createIslandRegistryDefinitionPlugin(await loadIslandRegistryBuildInfo(resolve21(islandRegistrySpec))) : undefined;
178110
+ const islandRegistryPlugin = islandRegistrySpec ? createIslandRegistryDefinitionPlugin(await loadIslandRegistryBuildInfo(resolve22(islandRegistrySpec))) : undefined;
177883
178111
  const serverBundle = await Bun.build({
177884
178112
  define: { "process.env.NODE_ENV": '"production"' },
177885
- entrypoints: [resolve21(serverEntry)],
178113
+ entrypoints: [resolve22(serverEntry)],
177886
178114
  external: resolveServerBundleExternals(buildConfig),
177887
178115
  outdir: resolvedOutdir,
177888
178116
  plugins: [
@@ -177904,13 +178132,13 @@ console.log(\`
177904
178132
  console.error(cliTag4("\x1B[31m", "Server bundle failed."));
177905
178133
  process.exit(1);
177906
178134
  }
177907
- const outputPath = resolve21(resolvedOutdir, `${entryName}.js`);
177908
- if (!existsSync36(outputPath)) {
178135
+ const outputPath = resolve22(resolvedOutdir, `${entryName}.js`);
178136
+ if (!existsSync37(outputPath)) {
177909
178137
  console.error(cliTag4("\x1B[31m", `Expected output not found: ${outputPath}`));
177910
178138
  process.exit(1);
177911
178139
  }
177912
- if (existsSync36(resolve21(resolvedOutdir, "angular", "vendor", "server"))) {
177913
- const vendorDir = resolve21(resolvedOutdir, "angular", "vendor", "server");
178140
+ if (existsSync37(resolve22(resolvedOutdir, "angular", "vendor", "server"))) {
178141
+ const vendorDir = resolve22(resolvedOutdir, "angular", "vendor", "server");
177914
178142
  const vendorEntries = readdirSync7(vendorDir).filter((f) => f.endsWith(".js"));
177915
178143
  const angularServerVendorPaths = {};
177916
178144
  for (const file of vendorEntries) {
@@ -177919,7 +178147,7 @@ console.log(\`
177919
178147
  if (scope !== "angular" || rest.length === 0)
177920
178148
  continue;
177921
178149
  const specifier = `@angular/${rest.join("/")}`;
177922
- const relPath = relative11(dirname15(outputPath), resolve21(vendorDir, file));
178150
+ const relPath = relative11(dirname16(outputPath), resolve22(vendorDir, file));
177923
178151
  angularServerVendorPaths[specifier] = relPath.startsWith(".") ? relPath : `./${relPath}`;
177924
178152
  }
177925
178153
  if (Object.keys(angularServerVendorPaths).length > 0) {
@@ -177931,7 +178159,7 @@ console.log(\`
177931
178159
  copyServerRuntimeAssetReferences(resolvedOutdir);
177932
178160
  const prerenderStart = performance.now();
177933
178161
  process.stdout.write(cliTag4("\x1B[36m", "Pre-rendering pages"));
177934
- rmSync5(join31(resolvedOutdir, "_prerendered"), {
178162
+ rmSync6(join32(resolvedOutdir, "_prerendered"), {
177935
178163
  force: true,
177936
178164
  recursive: true
177937
178165
  });
@@ -177951,9 +178179,9 @@ console.log(\`
177951
178179
  const compileStart = performance.now();
177952
178180
  process.stdout.write(cliTag4("\x1B[36m", "Compiling standalone executable"));
177953
178181
  const entrypointCode = generateEntrypoint(resolvedOutdir, serverEntry, prerenderMap, absoluteVersion, buildConfig);
177954
- const entrypointPath = join31(resolvedOutdir, "_compile_entrypoint.ts");
178182
+ const entrypointPath = join32(resolvedOutdir, "_compile_entrypoint.ts");
177955
178183
  await Bun.write(entrypointPath, entrypointCode);
177956
- mkdirSync17(dirname15(resolvedOutfile), { recursive: true });
178184
+ mkdirSync17(dirname16(resolvedOutfile), { recursive: true });
177957
178185
  const result = await Bun.build({
177958
178186
  compile: { outfile: resolvedOutfile },
177959
178187
  define: { "process.env.NODE_ENV": '"production"' },
@@ -178021,7 +178249,7 @@ var init_compile = __esm(() => {
178021
178249
  ]);
178022
178250
  jsxDevRuntimeCompatPath2 = resolveJsxDevRuntimeCompatPath2();
178023
178251
  ENV_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
178024
- requireForCompile = createRequire2(import.meta.url);
178252
+ requireForCompile = createRequire3(import.meta.url);
178025
178253
  RUNTIME_JS_EXTENSIONS = [".js", ".mjs", ".cjs"];
178026
178254
  MODULE_SPECIFIER_RE = /(from\s*|import\s*|import\(\s*|require\(\s*)(["'])([^"']+)\2/g;
178027
178255
  FRAMEWORK_EXTERNALS = [
@@ -178050,11 +178278,11 @@ var exports_typecheck = {};
178050
178278
  __export(exports_typecheck, {
178051
178279
  typecheck: () => typecheck
178052
178280
  });
178053
- import { resolve as resolve22, join as join32 } from "path";
178054
- import { existsSync as existsSync37, readFileSync as readFileSync34 } from "fs";
178281
+ import { resolve as resolve23, join as join33 } from "path";
178282
+ import { existsSync as existsSync38, readFileSync as readFileSync35 } from "fs";
178055
178283
  import { mkdir as mkdir2, writeFile } from "fs/promises";
178056
- var isCommandService3 = (service) => service.kind === "command" || Array.isArray(service.command), resolveConfigPath = (configPath2) => resolve22(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts"), getTypecheckTargets = async (configPath2) => {
178057
- if (!existsSync37(resolveConfigPath(configPath2))) {
178284
+ var isCommandService3 = (service) => service.kind === "command" || Array.isArray(service.command), resolveConfigPath = (configPath2) => resolve23(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts"), getTypecheckTargets = async (configPath2) => {
178285
+ if (!existsSync38(resolveConfigPath(configPath2))) {
178058
178286
  return [{}];
178059
178287
  }
178060
178288
  const rawConfig = await loadRawConfig(configPath2);
@@ -178074,8 +178302,8 @@ var isCommandService3 = (service) => service.kind === "command" || Array.isArray
178074
178302
  const exitCode = await proc.exited;
178075
178303
  return { exitCode, name, output: (stdout + stderr).trim() };
178076
178304
  }, shellEscape = (value) => `'${value.replaceAll("'", "'\\''")}'`, runShell = async (name, command) => run(name, ["/bin/bash", "-lc", command]), findBin = (name) => {
178077
- const local = resolve22("node_modules", ".bin", name);
178078
- return existsSync37(local) ? local : null;
178305
+ const local = resolve23("node_modules", ".bin", name);
178306
+ return existsSync38(local) ? local : null;
178079
178307
  }, ANSI_COLOR_REGEX, ANSI_PURPLE_REGEX, ANSI_CYAN_REGEX, ANSI_TOKEN_END_REGEX, stripAnsi3 = (str) => str.replace(ANSI_COLOR_REGEX, ""), formatSvelteOutput = (output) => {
178080
178308
  const cwd = `${process.cwd()}/`;
178081
178309
  const summaryMatch = stripAnsi3(output).match(/svelte-check found (\d+) error/);
@@ -178122,15 +178350,15 @@ Found ${errorCount} error${suffix}.`;
178122
178350
  return formatted;
178123
178351
  }, ABSOLUTE_INTERNAL_EXCLUDES, resolveAbsoluteTypeFile = (fileName) => {
178124
178352
  const candidates = [
178125
- resolve22("node_modules/@absolutejs/absolute/dist/types", fileName),
178126
- resolve22(import.meta.dir, "../types", fileName),
178127
- resolve22(import.meta.dir, "../../types", fileName),
178128
- resolve22(import.meta.dir, "../../../types", fileName)
178353
+ resolve23("node_modules/@absolutejs/absolute/dist/types", fileName),
178354
+ resolve23(import.meta.dir, "../types", fileName),
178355
+ resolve23(import.meta.dir, "../../types", fileName),
178356
+ resolve23(import.meta.dir, "../../../types", fileName)
178129
178357
  ];
178130
- return candidates.find((candidate) => existsSync37(candidate)) ?? candidates[0];
178358
+ return candidates.find((candidate) => existsSync38(candidate)) ?? candidates[0];
178131
178359
  }, ABSOLUTE_TYPECHECK_FILES, readProjectTsconfig = () => {
178132
178360
  try {
178133
- return JSON.parse(readFileSync34(resolve22("tsconfig.json"), "utf-8"));
178361
+ return JSON.parse(readFileSync35(resolve23("tsconfig.json"), "utf-8"));
178134
178362
  } catch {
178135
178363
  return {};
178136
178364
  }
@@ -178158,22 +178386,22 @@ Found ${errorCount} error${suffix}.`;
178158
178386
  console.error("\x1B[31m\u2717\x1B[0m vue-tsc is required for Vue type checking. Install it: bun add -d vue-tsc");
178159
178387
  process.exit(1);
178160
178388
  }
178161
- const vueTsconfigPath = join32(cacheDir, "tsconfig.vue-check.json");
178389
+ const vueTsconfigPath = join33(cacheDir, "tsconfig.vue-check.json");
178162
178390
  return writeFile(vueTsconfigPath, JSON.stringify({
178163
178391
  compilerOptions: {
178164
178392
  rootDir: ".."
178165
178393
  },
178166
178394
  exclude: getProjectTypecheckExcludes(),
178167
- extends: resolve22("tsconfig.json"),
178395
+ extends: resolve23("tsconfig.json"),
178168
178396
  include: getProjectTypecheckIncludes()
178169
178397
  }, null, "\t")).then(() => run("vue-tsc", [
178170
178398
  vueTscBin,
178171
178399
  "--noEmit",
178172
178400
  "--project",
178173
- resolve22(vueTsconfigPath),
178401
+ resolve23(vueTsconfigPath),
178174
178402
  "--incremental",
178175
178403
  "--tsBuildInfoFile",
178176
- join32(cacheDir, "vue-tsc.tsbuildinfo"),
178404
+ join33(cacheDir, "vue-tsc.tsbuildinfo"),
178177
178405
  "--pretty"
178178
178406
  ]));
178179
178407
  }, buildAngularCheck = async (cacheDir, angularDir) => {
@@ -178182,7 +178410,7 @@ Found ${errorCount} error${suffix}.`;
178182
178410
  console.error("\x1B[31m\u2717\x1B[0m @angular/compiler-cli is required for Angular type checking. Install it: bun add -d @angular/compiler-cli");
178183
178411
  process.exit(1);
178184
178412
  }
178185
- const angularTsconfigPath = join32(cacheDir, "tsconfig.angular-check.json");
178413
+ const angularTsconfigPath = join33(cacheDir, "tsconfig.angular-check.json");
178186
178414
  await writeFile(angularTsconfigPath, JSON.stringify({
178187
178415
  angularCompilerOptions: {
178188
178416
  strictTemplates: true
@@ -178192,32 +178420,32 @@ Found ${errorCount} error${suffix}.`;
178192
178420
  rootDir: ".."
178193
178421
  },
178194
178422
  exclude: ABSOLUTE_INTERNAL_EXCLUDES.map(toGeneratedConfigPath),
178195
- extends: resolve22("tsconfig.json"),
178423
+ extends: resolve23("tsconfig.json"),
178196
178424
  include: [`../${angularDir}/**/*`]
178197
178425
  }, null, "\t"));
178198
- return runShell("ngc", `${shellEscape(ngcBin)} -p ${shellEscape(resolve22(angularTsconfigPath))}`);
178426
+ return runShell("ngc", `${shellEscape(ngcBin)} -p ${shellEscape(resolve23(angularTsconfigPath))}`);
178199
178427
  }, buildTscCheck = (cacheDir) => {
178200
178428
  const tscBin = findBin("tsc");
178201
178429
  if (!tscBin) {
178202
178430
  console.error("\x1B[31m\u2717\x1B[0m typescript is required for type checking. Install it: bun add -d typescript");
178203
178431
  process.exit(1);
178204
178432
  }
178205
- const tscConfigPath = join32(cacheDir, "tsconfig.typecheck.json");
178433
+ const tscConfigPath = join33(cacheDir, "tsconfig.typecheck.json");
178206
178434
  return writeFile(tscConfigPath, JSON.stringify({
178207
178435
  compilerOptions: {
178208
178436
  rootDir: ".."
178209
178437
  },
178210
178438
  exclude: getProjectTypecheckExcludes(),
178211
- extends: resolve22("tsconfig.json"),
178439
+ extends: resolve23("tsconfig.json"),
178212
178440
  include: getProjectTypecheckIncludes()
178213
178441
  }, null, "\t")).then(() => run("tsc", [
178214
178442
  tscBin,
178215
178443
  "--noEmit",
178216
178444
  "--project",
178217
- resolve22(tscConfigPath),
178445
+ resolve23(tscConfigPath),
178218
178446
  "--incremental",
178219
178447
  "--tsBuildInfoFile",
178220
- join32(cacheDir, "tsc.tsbuildinfo"),
178448
+ join33(cacheDir, "tsc.tsbuildinfo"),
178221
178449
  "--pretty"
178222
178450
  ]));
178223
178451
  }, buildSvelteCheck = async (cacheDir, svelteDir) => {
@@ -178226,16 +178454,16 @@ Found ${errorCount} error${suffix}.`;
178226
178454
  console.error("\x1B[31m\u2717\x1B[0m svelte-check is required for Svelte type checking. Install it: bun add -d svelte-check");
178227
178455
  process.exit(1);
178228
178456
  }
178229
- const svelteTsconfigPath = join32(cacheDir, "tsconfig.svelte-check.json");
178457
+ const svelteTsconfigPath = join33(cacheDir, "tsconfig.svelte-check.json");
178230
178458
  await writeFile(svelteTsconfigPath, JSON.stringify({
178231
- extends: resolve22("tsconfig.json"),
178459
+ extends: resolve23("tsconfig.json"),
178232
178460
  files: ABSOLUTE_TYPECHECK_FILES,
178233
178461
  include: [`../${svelteDir}/**/*`]
178234
178462
  }, null, "\t"));
178235
178463
  return run("svelte-check", [
178236
178464
  svelteBin,
178237
178465
  "--tsconfig",
178238
- resolve22(svelteTsconfigPath),
178466
+ resolve23(svelteTsconfigPath),
178239
178467
  "--threshold",
178240
178468
  "error",
178241
178469
  "--compiler-warnings",
@@ -178429,11 +178657,11 @@ var DEFAULT_RELAY_PORT = 8787, DEFAULT_REQUEST_TIMEOUT_MS = 30000, headersToObje
178429
178657
  url: url.pathname + url.search,
178430
178658
  ...bodyBytes && bodyBytes.length > 0 ? { bodyBase64: Buffer.from(bodyBytes).toString("base64") } : {}
178431
178659
  };
178432
- const responsePromise = new Promise((resolve23) => {
178433
- pending.set(id, resolve23);
178660
+ const responsePromise = new Promise((resolve24) => {
178661
+ pending.set(id, resolve24);
178434
178662
  });
178435
178663
  client.send(encodeTunnelMessage(message));
178436
- const timeout = new Promise((resolve23) => setTimeout(() => resolve23({ id, message: "timeout", type: "error" }), requestTimeoutMs));
178664
+ const timeout = new Promise((resolve24) => setTimeout(() => resolve24({ id, message: "timeout", type: "error" }), requestTimeoutMs));
178437
178665
  const result = await Promise.race([responsePromise, timeout]);
178438
178666
  pending.delete(id);
178439
178667
  if (result.type === "error") {
@@ -182292,7 +182520,7 @@ if (command === "dev") {
182292
182520
  console.error(" compile [entry] [--outdir dir] [--outfile path] Compile standalone executable");
182293
182521
  console.error(" config [--port n] Open the unified config UI (ESLint, tsconfig, Prettier)");
182294
182522
  console.error(" db <backup|restore|seed> Backup/restore any Postgres DB (ORM-agnostic, upsert by PK) or run the seed script");
182295
- console.error(" doctor [--fix] [--json] Diagnose the project (bun, config, framework dirs, env, port)");
182523
+ console.error(" doctor [--fix] [--json] Diagnose the project (bun, type graph, config, framework dirs, env, port)");
182296
182524
  console.error(" env [--check] [--json] Report env vars the app reads (getEnv) and which are missing");
182297
182525
  console.error(" add <framework> [--no-install] Add a framework (deps, config, starter page)");
182298
182526
  console.error(" analyze [--save] [--json] Bundle size breakdown + diff vs a saved baseline");