@absolutejs/absolute 0.19.0-beta.1107 → 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
@@ -170644,6 +170644,9 @@ var SENTINEL, RISKY_STRING_CONTENT, isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c)
170644
170644
  const endOfInterp = (start) => {
170645
170645
  let j = start;
170646
170646
  let depth = 1;
170647
+ let ipChar = "";
170648
+ let ipWord = "";
170649
+ let ipSpace = false;
170647
170650
  while (j < n && depth > 0) {
170648
170651
  const c = src[j];
170649
170652
  if (c === "\\") {
@@ -170652,10 +170655,16 @@ var SENTINEL, RISKY_STRING_CONTENT, isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c)
170652
170655
  }
170653
170656
  if (c === "`") {
170654
170657
  j = endOfTemplate(j);
170658
+ ipChar = ")";
170659
+ ipWord = "";
170660
+ ipSpace = false;
170655
170661
  continue;
170656
170662
  }
170657
170663
  if (c === '"' || c === "'") {
170658
170664
  j = endOfString(j);
170665
+ ipChar = '"';
170666
+ ipWord = "";
170667
+ ipSpace = false;
170659
170668
  continue;
170660
170669
  }
170661
170670
  if (c === "/" && src[j + 1] === "/") {
@@ -170669,11 +170678,33 @@ var SENTINEL, RISKY_STRING_CONTENT, isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c)
170669
170678
  j = e < 0 ? n : e + 2;
170670
170679
  continue;
170671
170680
  }
170681
+ if (c === "/" && (ipChar === "" || REGEX_OK_AFTER_CHAR.has(ipChar) || REGEX_OK_AFTER_WORD.has(ipWord))) {
170682
+ const e = endOfRegex(j);
170683
+ if (e > 0) {
170684
+ j = e;
170685
+ ipChar = ")";
170686
+ ipWord = "";
170687
+ ipSpace = false;
170688
+ continue;
170689
+ }
170690
+ }
170672
170691
  if (c === "{")
170673
170692
  depth++;
170674
170693
  else if (c === "}")
170675
170694
  depth--;
170676
170695
  j++;
170696
+ if (c === " " || c === "\t" || c === "\r" || c === `
170697
+ `) {
170698
+ ipSpace = true;
170699
+ continue;
170700
+ }
170701
+ if (isIdentChar(c)) {
170702
+ ipWord = isIdentChar(ipChar) && !ipSpace ? ipWord + c : c;
170703
+ } else {
170704
+ ipWord = "";
170705
+ }
170706
+ ipChar = c;
170707
+ ipSpace = false;
170677
170708
  }
170678
170709
  return j;
170679
170710
  };
@@ -176085,15 +176116,216 @@ var init_logs = __esm(() => {
176085
176116
  init_tuiPrimitives();
176086
176117
  });
176087
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
+
176088
176320
  // src/cli/scripts/doctor.ts
176089
176321
  var exports_doctor = {};
176090
176322
  __export(exports_doctor, {
176091
176323
  runDoctor: () => runDoctor
176092
176324
  });
176093
- import { existsSync as existsSync32, mkdirSync as mkdirSync15, readFileSync as readFileSync30, writeFileSync as writeFileSync18 } from "fs";
176094
- 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";
176095
176327
  import { arch as arch4, platform as platform5 } from "os";
176096
- import { join as join28 } from "path";
176328
+ import { join as join29 } from "path";
176097
176329
  var FRAMEWORK_FIELDS2, projectRequire, check = (status2, label, detail) => ({
176098
176330
  detail,
176099
176331
  label,
@@ -176128,7 +176360,7 @@ var FRAMEWORK_FIELDS2, projectRequire, check = (status2, label, detail) => ({
176128
176360
  return [];
176129
176361
  const label = `${field.replace("Directory", "")} pages`;
176130
176362
  return [
176131
- 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)`)
176132
176364
  ];
176133
176365
  }), envCheck = async () => {
176134
176366
  const vars = await collectEnvVars();
@@ -176147,6 +176379,17 @@ var FRAMEWORK_FIELDS2, projectRequire, check = (status2, label, detail) => ({
176147
176379
  const port = devPort(config);
176148
176380
  const holder = (await scanListeners()).find((listener) => listener.port === port);
176149
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`);
176150
176393
  }, STATUS_MARK, renderCheck = (entry, labelWidth) => ` ${STATUS_MARK[entry.status]} ${entry.label.padEnd(labelWidth)} ${colors.dim}${entry.detail}${colors.reset}`, printReport3 = (checks) => {
176151
176394
  const labelWidth = Math.max(...checks.map((entry) => entry.label.length));
176152
176395
  const failed = checks.filter((entry) => entry.status === "fail").length;
@@ -176169,6 +176412,7 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176169
176412
  checkBun(),
176170
176413
  checkAbsolute(),
176171
176414
  checkNative(),
176415
+ typeGraphCheck(),
176172
176416
  configCheck,
176173
176417
  ...config === null ? [] : frameworkChecks(config),
176174
176418
  env5,
@@ -176178,9 +176422,9 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176178
176422
  const fixes = [];
176179
176423
  for (const field of FRAMEWORK_FIELDS2) {
176180
176424
  const dir = readString(config, field);
176181
- if (dir === undefined || existsSync32(join28(cwd, dir)))
176425
+ if (dir === undefined || existsSync33(join29(cwd, dir)))
176182
176426
  continue;
176183
- mkdirSync15(join28(cwd, dir, "pages"), { recursive: true });
176427
+ mkdirSync15(join29(cwd, dir, "pages"), { recursive: true });
176184
176428
  fixes.push(`created ${dir}/pages`);
176185
176429
  }
176186
176430
  return fixes;
@@ -176188,8 +176432,8 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176188
176432
  const missing = (await collectEnvVars()).filter((entry) => !entry.set);
176189
176433
  if (missing.length === 0)
176190
176434
  return null;
176191
- const envExample = join28(cwd, ".env.example");
176192
- const existing = existsSync32(envExample) ? readFileSync30(envExample, "utf-8") : "";
176435
+ const envExample = join29(cwd, ".env.example");
176436
+ const existing = existsSync33(envExample) ? readFileSync31(envExample, "utf-8") : "";
176193
176437
  const existingKeys = new Set(existing.split(`
176194
176438
  `).map((line) => line.split("=")[0]?.trim()));
176195
176439
  const toAdd = missing.filter((entry) => !existingKeys.has(entry.key));
@@ -176198,7 +176442,7 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176198
176442
  const prefix = existing === "" || existing.endsWith(`
176199
176443
  `) ? existing : `${existing}
176200
176444
  `;
176201
- writeFileSync18(envExample, `${prefix}${toAdd.map((entry) => `${entry.key}=`).join(`
176445
+ writeFileSync19(envExample, `${prefix}${toAdd.map((entry) => `${entry.key}=`).join(`
176202
176446
  `)}
176203
176447
  `);
176204
176448
  return `added ${toAdd.length} key(s) to .env.example`;
@@ -176209,6 +176453,20 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
176209
176453
  const envFix = await fixEnvExample(cwd);
176210
176454
  if (envFix)
176211
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
+ }
176212
176470
  return fixes;
176213
176471
  }, runDoctor = async (args) => {
176214
176472
  const fixes = args.includes("--fix") ? await applyFixes() : null;
@@ -176235,6 +176493,7 @@ var init_doctor = __esm(() => {
176235
176493
  init_loadConfig();
176236
176494
  init_portScan();
176237
176495
  init_tuiPrimitives();
176496
+ init_typeGraphCoherence();
176238
176497
  init_env();
176239
176498
  FRAMEWORK_FIELDS2 = [
176240
176499
  "reactDirectory",
@@ -176244,7 +176503,7 @@ var init_doctor = __esm(() => {
176244
176503
  "htmlDirectory",
176245
176504
  "htmxDirectory"
176246
176505
  ];
176247
- projectRequire = createRequire(join28(process.cwd(), "package.json"));
176506
+ projectRequire = createRequire2(join29(process.cwd(), "package.json"));
176248
176507
  STATUS_MARK = {
176249
176508
  fail: `${colors.red}\u2717${colors.reset}`,
176250
176509
  ok: `${colors.green}\u2713${colors.reset}`,
@@ -176548,10 +176807,10 @@ var init_inspect = __esm(() => {
176548
176807
  });
176549
176808
 
176550
176809
  // src/build/scanEntryPoints.ts
176551
- import { existsSync as existsSync33 } from "fs";
176810
+ import { existsSync as existsSync34 } from "fs";
176552
176811
  var {Glob: Glob4 } = globalThis.Bun;
176553
176812
  var scanEntryPoints = async (dir, pattern) => {
176554
- if (!existsSync33(dir))
176813
+ if (!existsSync34(dir))
176555
176814
  return [];
176556
176815
  const entryPaths = [];
176557
176816
  const glob = new Glob4(pattern);
@@ -176633,8 +176892,8 @@ var init_sourceMetadata = __esm(() => {
176633
176892
  });
176634
176893
 
176635
176894
  // src/islands/pageMetadata.ts
176636
- import { readFileSync as readFileSync31 } from "fs";
176637
- 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";
176638
176897
  var pagePatterns, getPageDirs = (config) => [
176639
176898
  { dir: config.angularDirectory, framework: "angular" },
176640
176899
  { dir: config.emberDirectory, framework: "ember" },
@@ -176654,8 +176913,8 @@ var pagePatterns, getPageDirs = (config) => [
176654
176913
  const source = definition.buildReference?.source;
176655
176914
  if (!source)
176656
176915
  continue;
176657
- const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve18(dirname13(buildInfo.resolvedRegistryPath), source);
176658
- 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));
176659
176918
  }
176660
176919
  return lookup;
176661
176920
  }, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage2) => {
@@ -176668,13 +176927,13 @@ var pagePatterns, getPageDirs = (config) => [
176668
176927
  const pattern = pagePatterns[entry.framework];
176669
176928
  if (!pattern)
176670
176929
  return;
176671
- const files = await scanEntryPoints(resolve18(entry.dir), pattern);
176930
+ const files = await scanEntryPoints(resolve19(entry.dir), pattern);
176672
176931
  for (const filePath of files) {
176673
- const source = readFileSync31(filePath, "utf-8");
176932
+ const source = readFileSync32(filePath, "utf-8");
176674
176933
  const islands = extractIslandUsagesFromSource(source);
176675
- pageMetadata.set(resolve18(filePath), {
176934
+ pageMetadata.set(resolve19(filePath), {
176676
176935
  islands: resolveIslandUsages(islands, islandSourceLookup),
176677
- pagePath: resolve18(filePath)
176936
+ pagePath: resolve19(filePath)
176678
176937
  });
176679
176938
  }
176680
176939
  }, loadPageIslandMetadata = async (config) => {
@@ -176703,14 +176962,14 @@ var exports_islands = {};
176703
176962
  __export(exports_islands, {
176704
176963
  runIslands: () => runIslands
176705
176964
  });
176706
- import { existsSync as existsSync34, readFileSync as readFileSync32, statSync as statSync5 } from "fs";
176707
- 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";
176708
176967
  var FRAMEWORK_DIR_KEY, FRAMEWORK_COLOR, printDim6 = (message) => process.stdout.write(`${colors.dim}${message}${colors.reset}
176709
176968
  `), hostFrameworkOf = (pagePath, cwd, config) => {
176710
- const resolved = resolve19(cwd, pagePath);
176969
+ const resolved = resolve20(cwd, pagePath);
176711
176970
  for (const [framework, key] of Object.entries(FRAMEWORK_DIR_KEY)) {
176712
176971
  const dir = config[key];
176713
- if (typeof dir === "string" && resolved.startsWith(resolve19(cwd, dir))) {
176972
+ if (typeof dir === "string" && resolved.startsWith(resolve20(cwd, dir))) {
176714
176973
  return framework;
176715
176974
  }
176716
176975
  }
@@ -176722,20 +176981,20 @@ var FRAMEWORK_DIR_KEY, FRAMEWORK_COLOR, printDim6 = (message) => process.stdout.
176722
176981
  return 0;
176723
176982
  }
176724
176983
  }, readManifestSizes2 = (manifestDir) => {
176725
- const manifestPath = join29(manifestDir, "manifest.json");
176726
- if (!existsSync34(manifestPath))
176984
+ const manifestPath = join30(manifestDir, "manifest.json");
176985
+ if (!existsSync35(manifestPath))
176727
176986
  return null;
176728
- const manifest = JSON.parse(readFileSync32(manifestPath, "utf-8"));
176987
+ const manifest = JSON.parse(readFileSync33(manifestPath, "utf-8"));
176729
176988
  const sizes = new Map;
176730
176989
  for (const [key, value] of Object.entries(manifest)) {
176731
- sizes.set(key, fileSize3(join29(manifestDir, value.replace(/^\//, ""))));
176990
+ sizes.set(key, fileSize3(join30(manifestDir, value.replace(/^\//, ""))));
176732
176991
  }
176733
176992
  return sizes;
176734
176993
  }, collectIslands = async (cwd, config, sizes) => {
176735
176994
  const registryPath = config.islands?.registry;
176736
176995
  if (typeof registryPath !== "string")
176737
176996
  return null;
176738
- const buildInfo = await loadIslandRegistryBuildInfo(resolve19(cwd, registryPath));
176997
+ const buildInfo = await loadIslandRegistryBuildInfo(resolve20(cwd, registryPath));
176739
176998
  const pageMetadata = await loadPageIslandMetadata(config);
176740
176999
  const usages = [...pageMetadata.values()].flatMap((meta) => meta.islands.map((island) => ({ ...island, page: meta.pagePath })));
176741
177000
  return buildInfo.definitions.map((definition) => {
@@ -176745,7 +177004,7 @@ var FRAMEWORK_DIR_KEY, FRAMEWORK_COLOR, printDim6 = (message) => process.stdout.
176745
177004
  crossFramework: hostFramework !== null && hostFramework !== definition.framework,
176746
177005
  hostFramework,
176747
177006
  hydrate: usage2.hydrate ?? "load",
176748
- page: relative10(cwd, resolve19(cwd, usage2.page))
177007
+ page: relative10(cwd, resolve20(cwd, usage2.page))
176749
177008
  };
176750
177009
  });
176751
177010
  const key = getIslandManifestKey(definition.framework, definition.component);
@@ -176814,7 +177073,7 @@ var FRAMEWORK_DIR_KEY, FRAMEWORK_COLOR, printDim6 = (message) => process.stdout.
176814
177073
  }
176815
177074
  const outdirIndex = args.indexOf("--outdir");
176816
177075
  const outdir = outdirIndex >= 0 ? args[outdirIndex + 1] : config.buildDirectory;
176817
- const sizes = args.includes("--sizes") ? readManifestSizes2(resolve19(cwd, outdir ?? "build")) : null;
177076
+ const sizes = args.includes("--sizes") ? readManifestSizes2(resolve20(cwd, outdir ?? "build")) : null;
176818
177077
  const islands = await collectIslands(cwd, config, sizes);
176819
177078
  if (islands === null) {
176820
177079
  printDim6('No island registry configured. Set `islands: { registry: "..." }` in absolute.config.ts.');
@@ -176863,13 +177122,13 @@ var init_islands2 = __esm(() => {
176863
177122
  });
176864
177123
 
176865
177124
  // src/build/externalAssetPlugin.ts
176866
- import { copyFileSync as copyFileSync2, existsSync as existsSync35, mkdirSync as mkdirSync16, statSync as statSync6 } from "fs";
176867
- 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";
176868
177127
  var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
176869
177128
  name: "absolute-external-asset",
176870
177129
  setup(bld) {
176871
177130
  const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
176872
- const skipRoots = userSourceRoots.map((root) => resolve20(root));
177131
+ const skipRoots = userSourceRoots.map((root) => resolve21(root));
176873
177132
  const isUserSource = (path) => skipRoots.some((root) => path.startsWith(`${root}/`));
176874
177133
  bld.onLoad({ filter: /\.[mc]?[jt]sx?$/ }, async (args) => {
176875
177134
  if (isUserSource(args.path))
@@ -176879,20 +177138,20 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
176879
177138
  return;
176880
177139
  urlPattern.lastIndex = 0;
176881
177140
  let match;
176882
- const sourceDir = dirname14(args.path);
177141
+ const sourceDir = dirname15(args.path);
176883
177142
  while ((match = urlPattern.exec(source)) !== null) {
176884
177143
  const relPath = match[1];
176885
177144
  if (!relPath)
176886
177145
  continue;
176887
- const assetPath = resolve20(sourceDir, relPath);
176888
- if (!existsSync35(assetPath))
177146
+ const assetPath = resolve21(sourceDir, relPath);
177147
+ if (!existsSync36(assetPath))
176889
177148
  continue;
176890
177149
  if (!statSync6(assetPath).isFile())
176891
177150
  continue;
176892
- const targetPath = join30(outDir, basename6(assetPath));
176893
- if (existsSync35(targetPath))
177151
+ const targetPath = join31(outDir, basename6(assetPath));
177152
+ if (existsSync36(targetPath))
176894
177153
  continue;
176895
- mkdirSync16(dirname14(targetPath), { recursive: true });
177154
+ mkdirSync16(dirname15(targetPath), { recursive: true });
176896
177155
  copyFileSync2(assetPath, targetPath);
176897
177156
  }
176898
177157
  return;
@@ -176910,17 +177169,17 @@ __export(exports_compile, {
176910
177169
  var {env: env5 } = globalThis.Bun;
176911
177170
  import {
176912
177171
  cpSync,
176913
- existsSync as existsSync36,
177172
+ existsSync as existsSync37,
176914
177173
  mkdirSync as mkdirSync17,
176915
177174
  readdirSync as readdirSync7,
176916
- readFileSync as readFileSync33,
176917
- rmSync as rmSync5,
177175
+ readFileSync as readFileSync34,
177176
+ rmSync as rmSync6,
176918
177177
  statSync as statSync7,
176919
177178
  unlinkSync as unlinkSync4,
176920
- writeFileSync as writeFileSync19
177179
+ writeFileSync as writeFileSync20
176921
177180
  } from "fs";
176922
- import { createRequire as createRequire2 } from "module";
176923
- 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";
176924
177183
  var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`, compileBanner = (version2) => {
176925
177184
  const resolvedVersion = version2 || "unknown";
176926
177185
  console.log("");
@@ -176933,7 +177192,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
176933
177192
  const entry = pending.pop();
176934
177193
  if (!entry)
176935
177194
  continue;
176936
- const fullPath = join31(entry.parentPath, entry.name);
177195
+ const fullPath = join32(entry.parentPath, entry.name);
176937
177196
  if (entry.isDirectory())
176938
177197
  pending = pending.concat(readdirSync7(fullPath, { withFileTypes: true }));
176939
177198
  else
@@ -176953,7 +177212,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
176953
177212
  const entry = pending.pop();
176954
177213
  if (!entry)
176955
177214
  continue;
176956
- const fullPath = join31(entry.parentPath, entry.name);
177215
+ const fullPath = join32(entry.parentPath, entry.name);
176957
177216
  if (entry.isDirectory()) {
176958
177217
  if (SERVER_RUNTIME_SCAN_SKIP_DIRS.has(entry.name))
176959
177218
  continue;
@@ -176965,22 +177224,22 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
176965
177224
  return result;
176966
177225
  }, copyServerRuntimeAssetReferences = (outdir) => {
176967
177226
  const copied = new Set;
176968
- const normalizedOutdir = resolve21(outdir);
177227
+ const normalizedOutdir = resolve22(outdir);
176969
177228
  const copyReference = (filePath, relPath) => {
176970
- const assetSource = resolve21(dirname15(filePath), relPath);
176971
- if (!existsSync36(assetSource) || !statSync7(assetSource).isFile())
177229
+ const assetSource = resolve22(dirname16(filePath), relPath);
177230
+ if (!existsSync37(assetSource) || !statSync7(assetSource).isFile())
176972
177231
  return;
176973
- const assetTarget = resolve21(normalizedOutdir, relPath.replace(/^\.\//, ""));
177232
+ const assetTarget = resolve22(normalizedOutdir, relPath.replace(/^\.\//, ""));
176974
177233
  if (assetTarget !== normalizedOutdir && !assetTarget.startsWith(`${normalizedOutdir}/`))
176975
177234
  return;
176976
177235
  if (copied.has(assetTarget))
176977
177236
  return;
176978
177237
  copied.add(assetTarget);
176979
- mkdirSync17(dirname15(assetTarget), { recursive: true });
177238
+ mkdirSync17(dirname16(assetTarget), { recursive: true });
176980
177239
  cpSync(assetSource, assetTarget, { force: true });
176981
177240
  };
176982
177241
  for (const filePath of collectProjectSourceFiles(process.cwd())) {
176983
- const source = readFileSync33(filePath, "utf-8");
177242
+ const source = readFileSync34(filePath, "utf-8");
176984
177243
  SERVER_RUNTIME_ASSET_RE.lastIndex = 0;
176985
177244
  let match;
176986
177245
  while ((match = SERVER_RUNTIME_ASSET_RE.exec(source)) !== null) {
@@ -177009,7 +177268,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177009
177268
  }
177010
177269
  }, readPackageVersion4 = (candidate) => {
177011
177270
  try {
177012
- const pkg = JSON.parse(readFileSync33(candidate, "utf-8"));
177271
+ const pkg = JSON.parse(readFileSync34(candidate, "utf-8"));
177013
177272
  if (pkg.name !== "@absolutejs/absolute")
177014
177273
  return null;
177015
177274
  const ver = pkg.version;
@@ -177044,18 +177303,18 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177044
177303
  return resolveBuildModule3(remaining);
177045
177304
  }, resolveJsxDevRuntimeCompatPath2 = () => {
177046
177305
  const candidates = [
177047
- resolve21(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
177048
- resolve21(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js"),
177049
- resolve21(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.ts"),
177050
- resolve21(import.meta.dir, "..", "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
177051
- resolve21(import.meta.dir, "..", "..", "..", "react", "jsxDevRuntimeCompat.js"),
177052
- 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")
177053
177312
  ];
177054
177313
  for (const candidate of candidates) {
177055
- if (existsSync36(candidate))
177314
+ if (existsSync37(candidate))
177056
177315
  return candidate;
177057
177316
  }
177058
- return resolve21(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js");
177317
+ return resolve22(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js");
177059
177318
  }, jsxDevRuntimeCompatPath2, shouldEmbedCompiledAsset = (relativePath, skip = new Set) => {
177060
177319
  if (skip.has(relativePath))
177061
177320
  return false;
@@ -177080,7 +177339,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177080
177339
  return true;
177081
177340
  }), requireForCompile, resolveNativeAssetForRuntime = (specifier) => {
177082
177341
  if (specifier.startsWith("."))
177083
- return resolve21(process.cwd(), specifier);
177342
+ return resolve22(process.cwd(), specifier);
177084
177343
  if (specifier.startsWith("/"))
177085
177344
  return specifier;
177086
177345
  return requireForCompile.resolve(specifier, { paths: [process.cwd()] });
@@ -177092,11 +177351,11 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177092
177351
  return env6;
177093
177352
  }, tryReadNodePackageJson = (packageDir) => {
177094
177353
  try {
177095
- return JSON.parse(readFileSync33(join31(packageDir, "package.json"), "utf-8"));
177354
+ return JSON.parse(readFileSync34(join32(packageDir, "package.json"), "utf-8"));
177096
177355
  } catch {
177097
177356
  return null;
177098
177357
  }
177099
- }, 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) => {
177100
177359
  if (seen.has(specifier))
177101
177360
  return;
177102
177361
  const srcDir = resolveProjectPackageDir(specifier);
@@ -177104,8 +177363,8 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177104
177363
  if (!pkg)
177105
177364
  return;
177106
177365
  seen.add(specifier);
177107
- const destDir = join31(outdir, "node_modules", ...specifier.split("/"));
177108
- rmSync5(destDir, { force: true, recursive: true });
177366
+ const destDir = join32(outdir, "node_modules", ...specifier.split("/"));
177367
+ rmSync6(destDir, { force: true, recursive: true });
177109
177368
  cpSync(srcDir, destDir, {
177110
177369
  force: true,
177111
177370
  recursive: true,
@@ -177126,8 +177385,8 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177126
177385
  }, copyAngularRuntimePackages = (buildConfig, outdir) => {
177127
177386
  if (!buildConfig.angularDirectory)
177128
177387
  return;
177129
- const angularScopeDir = resolve21(process.cwd(), "node_modules", "@angular");
177130
- 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}`) : [];
177131
177390
  const roots = new Set([...angularPackages, "rxjs", "tslib", "typescript"]);
177132
177391
  const seen = new Set;
177133
177392
  for (const specifier of roots) {
@@ -177145,15 +177404,15 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177145
177404
  copyAngularRuntimePackages(buildConfig, outdir);
177146
177405
  copyChunkReferencedPackages(outdir, seen);
177147
177406
  }, collectRuntimePackageSpecifiers = (distDir) => {
177148
- const nodeModulesDir = join31(distDir, "node_modules");
177149
- if (!existsSync36(nodeModulesDir))
177407
+ const nodeModulesDir = join32(distDir, "node_modules");
177408
+ if (!existsSync37(nodeModulesDir))
177150
177409
  return [];
177151
177410
  const specifiers = [];
177152
177411
  for (const entry of readdirSync7(nodeModulesDir, { withFileTypes: true })) {
177153
177412
  if (!entry.isDirectory())
177154
177413
  continue;
177155
177414
  if (entry.name.startsWith("@")) {
177156
- const scopeDir = join31(nodeModulesDir, entry.name);
177415
+ const scopeDir = join32(nodeModulesDir, entry.name);
177157
177416
  for (const scopedEntry of readdirSync7(scopeDir, {
177158
177417
  withFileTypes: true
177159
177418
  })) {
@@ -177167,7 +177426,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177167
177426
  }
177168
177427
  return specifiers.sort((a, b) => b.length - a.length);
177169
177428
  }, ensureRelativeModuleSpecifier = (fromFile, toFile) => {
177170
- const rel = relative11(dirname15(fromFile), toFile).replace(/\\/g, "/");
177429
+ const rel = relative11(dirname16(fromFile), toFile).replace(/\\/g, "/");
177171
177430
  return rel.startsWith(".") ? rel : `./${rel}`;
177172
177431
  }, pickExportEntry = (value) => {
177173
177432
  if (typeof value === "string")
@@ -177185,18 +177444,18 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177185
177444
  const packageSpecifier = packageSpecifiers.find((root) => specifier === root || specifier.startsWith(`${root}/`));
177186
177445
  if (!packageSpecifier)
177187
177446
  return null;
177188
- const packageDir = join31(distDir, "node_modules", ...packageSpecifier.split("/"));
177447
+ const packageDir = join32(distDir, "node_modules", ...packageSpecifier.split("/"));
177189
177448
  const subpath = specifier.slice(packageSpecifier.length);
177190
- const subPackageDir = subpath ? join31(packageDir, ...subpath.slice(1).split("/")) : null;
177191
- const resolvedPackageDir = subPackageDir && existsSync36(join31(subPackageDir, "package.json")) ? subPackageDir : packageDir;
177192
- const packageJsonPath = join31(resolvedPackageDir, "package.json");
177193
- 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))
177194
177453
  return null;
177195
- const pkg = JSON.parse(readFileSync33(packageJsonPath, "utf-8"));
177454
+ const pkg = JSON.parse(readFileSync34(packageJsonPath, "utf-8"));
177196
177455
  const exportKey = resolvedPackageDir !== subPackageDir && subpath ? `.${subpath}` : ".";
177197
177456
  const rootExport = pkg.exports?.[exportKey];
177198
177457
  const entry = pickExportEntry(rootExport) ?? (resolvedPackageDir === subPackageDir || !subpath ? pkg.module ?? pkg.main ?? "index.js" : `.${subpath}`);
177199
- return join31(resolvedPackageDir, entry);
177458
+ return join32(resolvedPackageDir, entry);
177200
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) => {
177201
177460
  try {
177202
177461
  return statSync7(filePath).isFile();
@@ -177209,16 +177468,16 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177209
177468
  const candidates = [
177210
177469
  candidate,
177211
177470
  ...RUNTIME_JS_EXTENSIONS.map((extension) => `${candidate}${extension}`),
177212
- ...RUNTIME_JS_EXTENSIONS.map((extension) => join31(candidate, `index${extension}`))
177471
+ ...RUNTIME_JS_EXTENSIONS.map((extension) => join32(candidate, `index${extension}`))
177213
177472
  ];
177214
177473
  return candidates.find((filePath) => isRuntimeJsFile(filePath) && isFile(filePath)) ?? null;
177215
177474
  }, findContainingRuntimePackageDir = (filePath) => {
177216
- let dir = dirname15(filePath);
177217
- while (dir !== dirname15(dir)) {
177218
- 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"))) {
177219
177478
  return dir;
177220
177479
  }
177221
- dir = dirname15(dir);
177480
+ dir = dirname16(dir);
177222
177481
  }
177223
177482
  return null;
177224
177483
  }, resolvePackageImportEntryFile = (fromFile, specifier) => {
@@ -177231,13 +177490,13 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177231
177490
  const entry = pickExportEntry(pkg?.imports?.[specifier]);
177232
177491
  if (!entry)
177233
177492
  return null;
177234
- return join31(packageDir, entry);
177493
+ return join32(packageDir, entry);
177235
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) => {
177236
- const distRoot = resolve21(distDir);
177495
+ const distRoot = resolve22(distDir);
177237
177496
  for (const filePath of collectRuntimeRewriteRoots(distDir)) {
177238
- if (resolve21(dirname15(filePath)) === distRoot)
177497
+ if (resolve22(dirname16(filePath)) === distRoot)
177239
177498
  continue;
177240
- const source = readFileSync33(filePath, "utf-8");
177499
+ const source = readFileSync34(filePath, "utf-8");
177241
177500
  for (const match of source.matchAll(MODULE_SPECIFIER_RE)) {
177242
177501
  const specifier = match[3];
177243
177502
  if (!specifier || specifier.startsWith(".") || specifier.startsWith("/") || specifier.startsWith("#") || specifier.startsWith("node:") || specifier.startsWith("bun:")) {
@@ -177267,11 +177526,11 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177267
177526
  if (!filePath || seen.has(filePath))
177268
177527
  continue;
177269
177528
  seen.add(filePath);
177270
- const source = readFileSync33(filePath, "utf-8");
177529
+ const source = readFileSync34(filePath, "utf-8");
177271
177530
  const { masked, restore } = maskLiterals(source);
177272
177531
  const rewrittenMasked = masked.replace(MODULE_SPECIFIER_RE, (match, prefix, quote, specifier) => {
177273
177532
  if (typeof specifier === "string" && specifier.startsWith(".")) {
177274
- enqueue(resolveRuntimeJsFile(resolve21(dirname15(filePath), specifier)));
177533
+ enqueue(resolveRuntimeJsFile(resolve22(dirname16(filePath), specifier)));
177275
177534
  return match;
177276
177535
  }
177277
177536
  const packageImportTarget = resolveRuntimeJsFile(resolvePackageImportEntryFile(filePath, specifier) ?? "");
@@ -177287,7 +177546,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177287
177546
  });
177288
177547
  const rewritten = restore(rewrittenMasked);
177289
177548
  if (rewritten !== source) {
177290
- writeFileSync19(filePath, rewritten);
177549
+ writeFileSync20(filePath, rewritten);
177291
177550
  }
177292
177551
  }
177293
177552
  }, generateEntrypoint = (distDir, serverEntry, prerenderMap, version2, buildConfig) => {
@@ -177315,7 +177574,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
177315
177574
  const nativeAssets = resolveCompileNativeAssets(buildConfig);
177316
177575
  nativeAssets.forEach((asset, idx) => {
177317
177576
  const varName = `__native${idx}`;
177318
- 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;
177319
177578
  nativeImports.push(`import ${varName} from ${JSON.stringify(importSpecifier)} with { type: "file" };`);
177320
177579
  nativeMappings.push(` [${JSON.stringify(asset.env)}, resolveNativeAssetPath(${varName})],`);
177321
177580
  });
@@ -177374,7 +177633,7 @@ import { websocket as elysiaWebsocket } from "elysia/ws";
177374
177633
  const SERVER_MODULE = (runtimeDir: string) => import(pathToFileURL(join(runtimeDir, ${JSON.stringify(serverBundleName)})).href);
177375
177634
  const RUNTIME_BUILD_ID = ${JSON.stringify(runtimeBuildId)};
177376
177635
  const RUNTIME_CONFIG_SOURCE = ${JSON.stringify(runtimeConfigSource)};
177377
- const ORIGINAL_BUILD_DIR = ${JSON.stringify(resolve21(distDir))};
177636
+ const ORIGINAL_BUILD_DIR = ${JSON.stringify(resolve22(distDir))};
177378
177637
  const ORIGINAL_BUILD_DIR_NORMALIZED = ORIGINAL_BUILD_DIR.replace(/\\\\/g, "/");
177379
177638
 
177380
177639
  const resolveNativeAssetPath = (assetPath: string) => {
@@ -177805,16 +178064,16 @@ console.log(\`
177805
178064
  }),
177806
178065
  ...collectUserServerExternals(buildConfig)
177807
178066
  ], compile = async (serverEntry, outdir, outfile, configPath2) => {
177808
- const resolvedOutdir = resolve21(outdir ?? "dist");
178067
+ const resolvedOutdir = resolve22(outdir ?? "dist");
177809
178068
  await withBuildDirectoryLock(resolvedOutdir, () => compileUnlocked(serverEntry, resolvedOutdir, outfile, configPath2));
177810
178069
  }, compileUnlocked = async (serverEntry, resolvedOutdir, outfile, configPath2) => {
177811
178070
  const prerenderPort = Number(env5.COMPILE_PORT) || Number(env5.PORT) || findFreePort();
177812
178071
  killStaleProcesses(prerenderPort);
177813
178072
  const entryName = basename7(serverEntry).replace(/\.[^.]+$/, "");
177814
- const resolvedOutfile = resolve21(outfile ?? "compiled-server");
178073
+ const resolvedOutfile = resolve22(outfile ?? "compiled-server");
177815
178074
  const absoluteVersion = resolvePackageVersion3([
177816
- resolve21(import.meta.dir, "..", "..", "..", "package.json"),
177817
- resolve21(import.meta.dir, "..", "..", "package.json")
178075
+ resolve22(import.meta.dir, "..", "..", "..", "package.json"),
178076
+ resolve22(import.meta.dir, "..", "..", "package.json")
177818
178077
  ]);
177819
178078
  compileBanner(absoluteVersion);
177820
178079
  const totalStart = performance.now();
@@ -177825,8 +178084,8 @@ console.log(\`
177825
178084
  buildConfig.mode = "production";
177826
178085
  try {
177827
178086
  const build2 = await resolveBuildModule3([
177828
- resolve21(import.meta.dir, "..", "..", "core", "build"),
177829
- resolve21(import.meta.dir, "..", "build")
178087
+ resolve22(import.meta.dir, "..", "..", "core", "build"),
178088
+ resolve22(import.meta.dir, "..", "build")
177830
178089
  ]);
177831
178090
  if (!build2)
177832
178091
  throw new Error("Could not locate build module");
@@ -177848,10 +178107,10 @@ console.log(\`
177848
178107
  buildConfig.htmxDirectory
177849
178108
  ].filter((dir) => Boolean(dir));
177850
178109
  const islandRegistrySpec = buildConfig.islands?.registry;
177851
- const islandRegistryPlugin = islandRegistrySpec ? createIslandRegistryDefinitionPlugin(await loadIslandRegistryBuildInfo(resolve21(islandRegistrySpec))) : undefined;
178110
+ const islandRegistryPlugin = islandRegistrySpec ? createIslandRegistryDefinitionPlugin(await loadIslandRegistryBuildInfo(resolve22(islandRegistrySpec))) : undefined;
177852
178111
  const serverBundle = await Bun.build({
177853
178112
  define: { "process.env.NODE_ENV": '"production"' },
177854
- entrypoints: [resolve21(serverEntry)],
178113
+ entrypoints: [resolve22(serverEntry)],
177855
178114
  external: resolveServerBundleExternals(buildConfig),
177856
178115
  outdir: resolvedOutdir,
177857
178116
  plugins: [
@@ -177873,13 +178132,13 @@ console.log(\`
177873
178132
  console.error(cliTag4("\x1B[31m", "Server bundle failed."));
177874
178133
  process.exit(1);
177875
178134
  }
177876
- const outputPath = resolve21(resolvedOutdir, `${entryName}.js`);
177877
- if (!existsSync36(outputPath)) {
178135
+ const outputPath = resolve22(resolvedOutdir, `${entryName}.js`);
178136
+ if (!existsSync37(outputPath)) {
177878
178137
  console.error(cliTag4("\x1B[31m", `Expected output not found: ${outputPath}`));
177879
178138
  process.exit(1);
177880
178139
  }
177881
- if (existsSync36(resolve21(resolvedOutdir, "angular", "vendor", "server"))) {
177882
- const vendorDir = resolve21(resolvedOutdir, "angular", "vendor", "server");
178140
+ if (existsSync37(resolve22(resolvedOutdir, "angular", "vendor", "server"))) {
178141
+ const vendorDir = resolve22(resolvedOutdir, "angular", "vendor", "server");
177883
178142
  const vendorEntries = readdirSync7(vendorDir).filter((f) => f.endsWith(".js"));
177884
178143
  const angularServerVendorPaths = {};
177885
178144
  for (const file of vendorEntries) {
@@ -177888,7 +178147,7 @@ console.log(\`
177888
178147
  if (scope !== "angular" || rest.length === 0)
177889
178148
  continue;
177890
178149
  const specifier = `@angular/${rest.join("/")}`;
177891
- const relPath = relative11(dirname15(outputPath), resolve21(vendorDir, file));
178150
+ const relPath = relative11(dirname16(outputPath), resolve22(vendorDir, file));
177892
178151
  angularServerVendorPaths[specifier] = relPath.startsWith(".") ? relPath : `./${relPath}`;
177893
178152
  }
177894
178153
  if (Object.keys(angularServerVendorPaths).length > 0) {
@@ -177900,7 +178159,7 @@ console.log(\`
177900
178159
  copyServerRuntimeAssetReferences(resolvedOutdir);
177901
178160
  const prerenderStart = performance.now();
177902
178161
  process.stdout.write(cliTag4("\x1B[36m", "Pre-rendering pages"));
177903
- rmSync5(join31(resolvedOutdir, "_prerendered"), {
178162
+ rmSync6(join32(resolvedOutdir, "_prerendered"), {
177904
178163
  force: true,
177905
178164
  recursive: true
177906
178165
  });
@@ -177920,9 +178179,9 @@ console.log(\`
177920
178179
  const compileStart = performance.now();
177921
178180
  process.stdout.write(cliTag4("\x1B[36m", "Compiling standalone executable"));
177922
178181
  const entrypointCode = generateEntrypoint(resolvedOutdir, serverEntry, prerenderMap, absoluteVersion, buildConfig);
177923
- const entrypointPath = join31(resolvedOutdir, "_compile_entrypoint.ts");
178182
+ const entrypointPath = join32(resolvedOutdir, "_compile_entrypoint.ts");
177924
178183
  await Bun.write(entrypointPath, entrypointCode);
177925
- mkdirSync17(dirname15(resolvedOutfile), { recursive: true });
178184
+ mkdirSync17(dirname16(resolvedOutfile), { recursive: true });
177926
178185
  const result = await Bun.build({
177927
178186
  compile: { outfile: resolvedOutfile },
177928
178187
  define: { "process.env.NODE_ENV": '"production"' },
@@ -177990,7 +178249,7 @@ var init_compile = __esm(() => {
177990
178249
  ]);
177991
178250
  jsxDevRuntimeCompatPath2 = resolveJsxDevRuntimeCompatPath2();
177992
178251
  ENV_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
177993
- requireForCompile = createRequire2(import.meta.url);
178252
+ requireForCompile = createRequire3(import.meta.url);
177994
178253
  RUNTIME_JS_EXTENSIONS = [".js", ".mjs", ".cjs"];
177995
178254
  MODULE_SPECIFIER_RE = /(from\s*|import\s*|import\(\s*|require\(\s*)(["'])([^"']+)\2/g;
177996
178255
  FRAMEWORK_EXTERNALS = [
@@ -178019,11 +178278,11 @@ var exports_typecheck = {};
178019
178278
  __export(exports_typecheck, {
178020
178279
  typecheck: () => typecheck
178021
178280
  });
178022
- import { resolve as resolve22, join as join32 } from "path";
178023
- 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";
178024
178283
  import { mkdir as mkdir2, writeFile } from "fs/promises";
178025
- var isCommandService3 = (service) => service.kind === "command" || Array.isArray(service.command), resolveConfigPath = (configPath2) => resolve22(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts"), getTypecheckTargets = async (configPath2) => {
178026
- 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))) {
178027
178286
  return [{}];
178028
178287
  }
178029
178288
  const rawConfig = await loadRawConfig(configPath2);
@@ -178043,8 +178302,8 @@ var isCommandService3 = (service) => service.kind === "command" || Array.isArray
178043
178302
  const exitCode = await proc.exited;
178044
178303
  return { exitCode, name, output: (stdout + stderr).trim() };
178045
178304
  }, shellEscape = (value) => `'${value.replaceAll("'", "'\\''")}'`, runShell = async (name, command) => run(name, ["/bin/bash", "-lc", command]), findBin = (name) => {
178046
- const local = resolve22("node_modules", ".bin", name);
178047
- return existsSync37(local) ? local : null;
178305
+ const local = resolve23("node_modules", ".bin", name);
178306
+ return existsSync38(local) ? local : null;
178048
178307
  }, ANSI_COLOR_REGEX, ANSI_PURPLE_REGEX, ANSI_CYAN_REGEX, ANSI_TOKEN_END_REGEX, stripAnsi3 = (str) => str.replace(ANSI_COLOR_REGEX, ""), formatSvelteOutput = (output) => {
178049
178308
  const cwd = `${process.cwd()}/`;
178050
178309
  const summaryMatch = stripAnsi3(output).match(/svelte-check found (\d+) error/);
@@ -178091,15 +178350,15 @@ Found ${errorCount} error${suffix}.`;
178091
178350
  return formatted;
178092
178351
  }, ABSOLUTE_INTERNAL_EXCLUDES, resolveAbsoluteTypeFile = (fileName) => {
178093
178352
  const candidates = [
178094
- resolve22("node_modules/@absolutejs/absolute/dist/types", fileName),
178095
- resolve22(import.meta.dir, "../types", fileName),
178096
- resolve22(import.meta.dir, "../../types", fileName),
178097
- 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)
178098
178357
  ];
178099
- return candidates.find((candidate) => existsSync37(candidate)) ?? candidates[0];
178358
+ return candidates.find((candidate) => existsSync38(candidate)) ?? candidates[0];
178100
178359
  }, ABSOLUTE_TYPECHECK_FILES, readProjectTsconfig = () => {
178101
178360
  try {
178102
- return JSON.parse(readFileSync34(resolve22("tsconfig.json"), "utf-8"));
178361
+ return JSON.parse(readFileSync35(resolve23("tsconfig.json"), "utf-8"));
178103
178362
  } catch {
178104
178363
  return {};
178105
178364
  }
@@ -178127,22 +178386,22 @@ Found ${errorCount} error${suffix}.`;
178127
178386
  console.error("\x1B[31m\u2717\x1B[0m vue-tsc is required for Vue type checking. Install it: bun add -d vue-tsc");
178128
178387
  process.exit(1);
178129
178388
  }
178130
- const vueTsconfigPath = join32(cacheDir, "tsconfig.vue-check.json");
178389
+ const vueTsconfigPath = join33(cacheDir, "tsconfig.vue-check.json");
178131
178390
  return writeFile(vueTsconfigPath, JSON.stringify({
178132
178391
  compilerOptions: {
178133
178392
  rootDir: ".."
178134
178393
  },
178135
178394
  exclude: getProjectTypecheckExcludes(),
178136
- extends: resolve22("tsconfig.json"),
178395
+ extends: resolve23("tsconfig.json"),
178137
178396
  include: getProjectTypecheckIncludes()
178138
178397
  }, null, "\t")).then(() => run("vue-tsc", [
178139
178398
  vueTscBin,
178140
178399
  "--noEmit",
178141
178400
  "--project",
178142
- resolve22(vueTsconfigPath),
178401
+ resolve23(vueTsconfigPath),
178143
178402
  "--incremental",
178144
178403
  "--tsBuildInfoFile",
178145
- join32(cacheDir, "vue-tsc.tsbuildinfo"),
178404
+ join33(cacheDir, "vue-tsc.tsbuildinfo"),
178146
178405
  "--pretty"
178147
178406
  ]));
178148
178407
  }, buildAngularCheck = async (cacheDir, angularDir) => {
@@ -178151,7 +178410,7 @@ Found ${errorCount} error${suffix}.`;
178151
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");
178152
178411
  process.exit(1);
178153
178412
  }
178154
- const angularTsconfigPath = join32(cacheDir, "tsconfig.angular-check.json");
178413
+ const angularTsconfigPath = join33(cacheDir, "tsconfig.angular-check.json");
178155
178414
  await writeFile(angularTsconfigPath, JSON.stringify({
178156
178415
  angularCompilerOptions: {
178157
178416
  strictTemplates: true
@@ -178161,32 +178420,32 @@ Found ${errorCount} error${suffix}.`;
178161
178420
  rootDir: ".."
178162
178421
  },
178163
178422
  exclude: ABSOLUTE_INTERNAL_EXCLUDES.map(toGeneratedConfigPath),
178164
- extends: resolve22("tsconfig.json"),
178423
+ extends: resolve23("tsconfig.json"),
178165
178424
  include: [`../${angularDir}/**/*`]
178166
178425
  }, null, "\t"));
178167
- return runShell("ngc", `${shellEscape(ngcBin)} -p ${shellEscape(resolve22(angularTsconfigPath))}`);
178426
+ return runShell("ngc", `${shellEscape(ngcBin)} -p ${shellEscape(resolve23(angularTsconfigPath))}`);
178168
178427
  }, buildTscCheck = (cacheDir) => {
178169
178428
  const tscBin = findBin("tsc");
178170
178429
  if (!tscBin) {
178171
178430
  console.error("\x1B[31m\u2717\x1B[0m typescript is required for type checking. Install it: bun add -d typescript");
178172
178431
  process.exit(1);
178173
178432
  }
178174
- const tscConfigPath = join32(cacheDir, "tsconfig.typecheck.json");
178433
+ const tscConfigPath = join33(cacheDir, "tsconfig.typecheck.json");
178175
178434
  return writeFile(tscConfigPath, JSON.stringify({
178176
178435
  compilerOptions: {
178177
178436
  rootDir: ".."
178178
178437
  },
178179
178438
  exclude: getProjectTypecheckExcludes(),
178180
- extends: resolve22("tsconfig.json"),
178439
+ extends: resolve23("tsconfig.json"),
178181
178440
  include: getProjectTypecheckIncludes()
178182
178441
  }, null, "\t")).then(() => run("tsc", [
178183
178442
  tscBin,
178184
178443
  "--noEmit",
178185
178444
  "--project",
178186
- resolve22(tscConfigPath),
178445
+ resolve23(tscConfigPath),
178187
178446
  "--incremental",
178188
178447
  "--tsBuildInfoFile",
178189
- join32(cacheDir, "tsc.tsbuildinfo"),
178448
+ join33(cacheDir, "tsc.tsbuildinfo"),
178190
178449
  "--pretty"
178191
178450
  ]));
178192
178451
  }, buildSvelteCheck = async (cacheDir, svelteDir) => {
@@ -178195,16 +178454,16 @@ Found ${errorCount} error${suffix}.`;
178195
178454
  console.error("\x1B[31m\u2717\x1B[0m svelte-check is required for Svelte type checking. Install it: bun add -d svelte-check");
178196
178455
  process.exit(1);
178197
178456
  }
178198
- const svelteTsconfigPath = join32(cacheDir, "tsconfig.svelte-check.json");
178457
+ const svelteTsconfigPath = join33(cacheDir, "tsconfig.svelte-check.json");
178199
178458
  await writeFile(svelteTsconfigPath, JSON.stringify({
178200
- extends: resolve22("tsconfig.json"),
178459
+ extends: resolve23("tsconfig.json"),
178201
178460
  files: ABSOLUTE_TYPECHECK_FILES,
178202
178461
  include: [`../${svelteDir}/**/*`]
178203
178462
  }, null, "\t"));
178204
178463
  return run("svelte-check", [
178205
178464
  svelteBin,
178206
178465
  "--tsconfig",
178207
- resolve22(svelteTsconfigPath),
178466
+ resolve23(svelteTsconfigPath),
178208
178467
  "--threshold",
178209
178468
  "error",
178210
178469
  "--compiler-warnings",
@@ -178398,11 +178657,11 @@ var DEFAULT_RELAY_PORT = 8787, DEFAULT_REQUEST_TIMEOUT_MS = 30000, headersToObje
178398
178657
  url: url.pathname + url.search,
178399
178658
  ...bodyBytes && bodyBytes.length > 0 ? { bodyBase64: Buffer.from(bodyBytes).toString("base64") } : {}
178400
178659
  };
178401
- const responsePromise = new Promise((resolve23) => {
178402
- pending.set(id, resolve23);
178660
+ const responsePromise = new Promise((resolve24) => {
178661
+ pending.set(id, resolve24);
178403
178662
  });
178404
178663
  client.send(encodeTunnelMessage(message));
178405
- 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));
178406
178665
  const result = await Promise.race([responsePromise, timeout]);
178407
178666
  pending.delete(id);
178408
178667
  if (result.type === "error") {
@@ -182261,7 +182520,7 @@ if (command === "dev") {
182261
182520
  console.error(" compile [entry] [--outdir dir] [--outfile path] Compile standalone executable");
182262
182521
  console.error(" config [--port n] Open the unified config UI (ESLint, tsconfig, Prettier)");
182263
182522
  console.error(" db <backup|restore|seed> Backup/restore any Postgres DB (ORM-agnostic, upsert by PK) or run the seed script");
182264
- 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)");
182265
182524
  console.error(" env [--check] [--json] Report env vars the app reads (getEnv) and which are missing");
182266
182525
  console.error(" add <framework> [--no-install] Add a framework (deps, config, starter page)");
182267
182526
  console.error(" analyze [--save] [--json] Bundle size breakdown + diff vs a saved baseline");