@absolutejs/absolute 0.20.0-beta.174 → 0.20.0-beta.175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/changelog.json +60 -0
  3. package/dist/angular/browser.js +13 -2
  4. package/dist/angular/browser.js.map +3 -3
  5. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  6. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  7. package/dist/angular/index.js +67 -8
  8. package/dist/angular/index.js.map +10 -8
  9. package/dist/angular/server.js +67 -8
  10. package/dist/angular/server.js.map +10 -8
  11. package/dist/build.js +312 -119
  12. package/dist/build.js.map +20 -18
  13. package/dist/cli/{compile-n6fs2vmx.js → compile-w2z6c9vt.js} +1 -1
  14. package/dist/cli/{dev-6h1f0mzq.js → dev-8br5mr7t.js} +16 -2
  15. package/dist/cli/{index-mqevg32w.js → index-6522t968.js} +21 -2
  16. package/dist/cli/{index-bhyd3ejc.js → index-7z1hh3fg.js} +1 -1
  17. package/dist/cli/index.js +6 -6
  18. package/dist/cli/{islands-vk05sj6v.js → islands-bx67g15t.js} +4 -4
  19. package/dist/cli/{mobile-62b6j3j7.js → mobile-we5q51ey.js} +2 -2
  20. package/dist/cli/{start-jh6kyp92.js → start-srs11bm8.js} +2 -2
  21. package/dist/client/chunks/index-4j1snyh2.js +18 -0
  22. package/dist/client/chunks/index-4j1snyh2.js.map +10 -0
  23. package/dist/client/chunks/{index-6b66nzyf.js → index-a3rpg5kw.js} +6 -16
  24. package/dist/client/chunks/{index-6b66nzyf.js.map → index-a3rpg5kw.js.map} +3 -4
  25. package/dist/client/chunks/{islands-s2ta5ajb.js → islands-mfjmdwnb.js} +11 -4
  26. package/dist/client/chunks/{islands-s2ta5ajb.js.map → islands-mfjmdwnb.js.map} +3 -3
  27. package/dist/client/chunks/{react-dcvkaba2.js → react-sprprqzs.js} +20 -4
  28. package/dist/client/chunks/react-sprprqzs.js.map +10 -0
  29. package/dist/client/chunks/svelte-6ewphsvj.js +30 -0
  30. package/dist/client/chunks/svelte-6ewphsvj.js.map +10 -0
  31. package/dist/client/chunks/{vue-a84fzp3v.js → vue-db6ppn1f.js} +14 -4
  32. package/dist/client/chunks/vue-db6ppn1f.js.map +10 -0
  33. package/dist/client/index.js +65 -8
  34. package/dist/client/index.js.map +4 -4
  35. package/dist/client/navigation.js +5 -3
  36. package/dist/client/navigation.js.map +2 -2
  37. package/dist/client/prefetch.js +1 -1
  38. package/dist/dev/client/handlers/islands.ts +85 -0
  39. package/dist/dev/client/hmrClient.ts +6 -0
  40. package/dist/index.js +448 -242
  41. package/dist/index.js.map +21 -19
  42. package/dist/islands/index.js +57 -10
  43. package/dist/islands/index.js.map +9 -7
  44. package/dist/react/browser.js +15 -4
  45. package/dist/react/browser.js.map +5 -5
  46. package/dist/react/components/client.js +506 -0
  47. package/dist/react/components/index.js +14 -15
  48. package/dist/react/components/index.js.map +4 -4
  49. package/dist/react/components/server/index.js +728 -0
  50. package/dist/react/hooks/index.js +14 -15
  51. package/dist/react/hooks/index.js.map +4 -4
  52. package/dist/react/index.js +66 -6
  53. package/dist/react/index.js.map +11 -9
  54. package/dist/react/router/browser.js +7 -8
  55. package/dist/react/router/browser.js.map +4 -4
  56. package/dist/react/router/index.js +7 -8
  57. package/dist/react/router/index.js.map +4 -4
  58. package/dist/react/server.js +14 -1
  59. package/dist/react/server.js.map +4 -4
  60. package/dist/src/build/buildReactServerComponents.d.ts +4 -0
  61. package/dist/src/build/islandEntries.d.ts +5 -0
  62. package/dist/src/client/hydrators/react.d.ts +7 -0
  63. package/dist/src/client/hydrators/svelte.d.ts +3 -0
  64. package/dist/src/client/hydrators/vue.d.ts +3 -0
  65. package/dist/src/client/preserveIslandMarkup.d.ts +5 -0
  66. package/dist/src/core/islandServerGeneration.d.ts +3 -0
  67. package/dist/src/react/components/client.d.ts +4 -0
  68. package/dist/src/react/components/server/index.d.ts +8 -0
  69. package/dist/src/react/serverComponents/constants.d.ts +2 -1
  70. package/dist/svelte/index.js +66 -6
  71. package/dist/svelte/index.js.map +10 -8
  72. package/dist/svelte/server.js +38 -3
  73. package/dist/svelte/server.js.map +6 -5
  74. package/dist/types/build.d.ts +3 -2
  75. package/dist/types/globals.d.ts +15 -0
  76. package/dist/vue/browser.js +26 -16
  77. package/dist/vue/browser.js.map +5 -5
  78. package/dist/vue/index.js +65 -21
  79. package/dist/vue/index.js.map +10 -9
  80. package/package.json +1 -1
  81. package/dist/client/chunks/react-dcvkaba2.js.map +0 -10
  82. package/dist/client/chunks/svelte-4yfa5bxa.js +0 -17
  83. package/dist/client/chunks/svelte-4yfa5bxa.js.map +0 -10
  84. package/dist/client/chunks/vue-a84fzp3v.js.map +0 -10
package/dist/index.js CHANGED
@@ -7852,6 +7852,19 @@ var init_ssrRender = __esm(() => {
7852
7852
  selectorCache = new Map;
7853
7853
  });
7854
7854
 
7855
+ // src/dev/client/cspNonce.ts
7856
+ var applyPageNonce = (element) => {
7857
+ const nonce = readPageNonce();
7858
+ if (nonce)
7859
+ element.nonce = nonce;
7860
+ return element;
7861
+ }, readPageNonce = () => {
7862
+ if (typeof document === "undefined")
7863
+ return;
7864
+ const carrier = document.querySelector("script[nonce], style[nonce]");
7865
+ return carrier?.nonce || undefined;
7866
+ };
7867
+
7855
7868
  // src/angular/islands.ts
7856
7869
  var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
7857
7870
  const requestId = getSsrContextId();
@@ -8769,10 +8782,25 @@ var init_lazyModule = __esm(() => {
8769
8782
  LAZY_RESOLVED_KEY = Symbol.for("absolutejs.svelte.lazy-resolved");
8770
8783
  });
8771
8784
 
8785
+ // src/core/islandServerGeneration.ts
8786
+ var readGeneration = () => globalThis.__absoluteIslandServerGeneration ?? 0, bumpIslandServerGeneration = () => {
8787
+ globalThis.__absoluteIslandServerGeneration = readGeneration() + 1;
8788
+ }, createIslandGenerationGuard = (reset) => {
8789
+ let seen = readGeneration();
8790
+ return () => {
8791
+ const current = readGeneration();
8792
+ if (current === seen)
8793
+ return current;
8794
+ seen = current;
8795
+ reset();
8796
+ return current;
8797
+ };
8798
+ };
8799
+
8772
8800
  // src/core/svelteServerModule.ts
8773
8801
  import { mkdir as mkdir3, readdir as readdir2 } from "fs/promises";
8774
8802
  import { basename as basename2, dirname as dirname6, extname as extname3, join as join8, relative as relative3, resolve as resolve6 } from "path";
8775
- var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
8803
+ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
8776
8804
  const importPath = relative3(dirname6(from), target).replace(/\\/g, "/");
8777
8805
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
8778
8806
  }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
@@ -8839,7 +8867,9 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
8839
8867
  }, getCachedModulePath2 = (sourcePath) => {
8840
8868
  const relativeSourcePath = relative3(process.cwd(), sourcePath).replace(/\\/g, "/");
8841
8869
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
8842
- return join8(serverCacheRoot2, `${normalizedSourcePath}.server.js`);
8870
+ const generation = syncIslandGeneration();
8871
+ const generationSuffix = generation > 0 ? `.g${generation}` : "";
8872
+ return join8(serverCacheRoot2, `${normalizedSourcePath}${generationSuffix}.server.js`);
8843
8873
  }, resolveSvelteImport = async (spec, from) => {
8844
8874
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
8845
8875
  const resolved = resolvePackageImport(spec);
@@ -8871,6 +8901,7 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
8871
8901
  }
8872
8902
  await Bun.write(path, content);
8873
8903
  }, compileSvelteServerModule = async (sourcePath) => {
8904
+ syncIslandGeneration();
8874
8905
  const cachedModulePath = compiledModuleCache2.get(sourcePath);
8875
8906
  if (cachedModulePath) {
8876
8907
  return cachedModulePath;
@@ -8953,6 +8984,10 @@ var init_svelteServerModule = __esm(() => {
8953
8984
  serverCacheRoot2 = join8(process.cwd(), ".absolutejs", "islands", "svelte");
8954
8985
  compiledModuleCache2 = new Map;
8955
8986
  originalSourcePathCache = new Map;
8987
+ syncIslandGeneration = createIslandGenerationGuard(() => {
8988
+ compiledModuleCache2.clear();
8989
+ originalSourcePathCache.clear();
8990
+ });
8956
8991
  transpiler = new Bun.Transpiler({
8957
8992
  loader: "ts",
8958
8993
  target: "browser"
@@ -8986,13 +9021,15 @@ import { readFileSync as readFileSync6, realpathSync } from "fs";
8986
9021
  import { mkdir as mkdir4 } from "fs/promises";
8987
9022
  import { dirname as dirname7, join as join9, relative as relative4, resolve as resolve7 } from "path";
8988
9023
  var {Transpiler } = globalThis.Bun;
8989
- var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, transpiler2, ensureRelativeImportPath2 = (from, target) => {
9024
+ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
8990
9025
  const importPath = relative4(dirname7(from), target).replace(/\\/g, "/");
8991
9026
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
8992
9027
  }, getCachedModulePath3 = (sourcePath) => {
8993
9028
  const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
8994
9029
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
8995
- return join9(serverCacheRoot3, `${normalizedSourcePath}.server.js`);
9030
+ const generation = syncIslandGeneration2();
9031
+ const generationSuffix = generation > 0 ? `.g${generation}` : "";
9032
+ return join9(serverCacheRoot3, `${normalizedSourcePath}${generationSuffix}.server.js`);
8996
9033
  }, writeIfChanged2 = async (path, content) => {
8997
9034
  const targetFile = Bun.file(path);
8998
9035
  if (await targetFile.exists()) {
@@ -9019,6 +9056,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
9019
9056
  `) : nonVueLines.join(`
9020
9057
  `);
9021
9058
  }, extractRelativeVueImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => typeof importPath === "string" && importPath.startsWith(".") && importPath.endsWith(".vue")), compileVueServerModule = async (sourcePath) => {
9059
+ syncIslandGeneration2();
9022
9060
  const cachedModulePath = compiledModuleCache3.get(sourcePath);
9023
9061
  if (cachedModulePath)
9024
9062
  return cachedModulePath;
@@ -9079,6 +9117,9 @@ var init_vueServerModule = __esm(() => {
9079
9117
  init_isFile();
9080
9118
  serverCacheRoot3 = join9(process.cwd(), ".absolutejs", "islands", "vue");
9081
9119
  compiledModuleCache3 = new Map;
9120
+ syncIslandGeneration2 = createIslandGenerationGuard(() => {
9121
+ compiledModuleCache3.clear();
9122
+ });
9082
9123
  transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
9083
9124
  });
9084
9125
 
@@ -9096,7 +9137,7 @@ var init_islandMarkupAttributes = __esm(() => {
9096
9137
  });
9097
9138
 
9098
9139
  // src/core/renderIslandMarkup.ts
9099
- var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, nextIslandId = () => {
9140
+ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, syncIslandGeneration3, nextIslandId = () => {
9100
9141
  islandSequence += 1;
9101
9142
  return `island-${islandSequence}`;
9102
9143
  }, isRecord7 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord7(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => {
@@ -9110,6 +9151,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
9110
9151
  const loadedModule = await import(compiledModulePath);
9111
9152
  return "default" in loadedModule ? loadedModule.default : loadedModule;
9112
9153
  }, loadServerBuildComponent = async (buildReferencePath) => {
9154
+ syncIslandGeneration3();
9113
9155
  const cachedBuildComponent = resolvedServerBuildComponentCache.get(buildReferencePath);
9114
9156
  if (cachedBuildComponent) {
9115
9157
  return cachedBuildComponent;
@@ -9148,6 +9190,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
9148
9190
  }
9149
9191
  return loadServerImportComponent(resolvedComponent);
9150
9192
  }, resolveServerIslandComponent = async (component) => {
9193
+ syncIslandGeneration3();
9151
9194
  const cachedResolvedComponent = resolvedServerComponentCache.get(component);
9152
9195
  if (cachedResolvedComponent) {
9153
9196
  return cachedResolvedComponent;
@@ -9246,6 +9289,10 @@ var init_renderIslandMarkup = __esm(() => {
9246
9289
  init_islands();
9247
9290
  resolvedServerComponentCache = new Map;
9248
9291
  resolvedServerBuildComponentCache = new Map;
9292
+ syncIslandGeneration3 = createIslandGenerationGuard(() => {
9293
+ resolvedServerComponentCache.clear();
9294
+ resolvedServerBuildComponentCache.clear();
9295
+ });
9249
9296
  });
9250
9297
 
9251
9298
  // src/utils/lazyTypescript.ts
@@ -9269,8 +9316,9 @@ var init_lazyTypescript = __esm(() => {
9269
9316
  });
9270
9317
 
9271
9318
  // src/build/islandEntries.ts
9272
- import { mkdirSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
9319
+ import { mkdirSync, rmSync, statSync as statSync2, writeFileSync as writeFileSync2 } from "fs";
9273
9320
  import { dirname as dirname8, extname as extname4, join as join10, relative as relative5, resolve as resolve8 } from "path";
9321
+ import { fileURLToPath as fileURLToPath2 } from "url";
9274
9322
  var frameworks, isRecord8 = (value) => typeof value === "object" && value !== null, resolveRegistryExport = (mod) => {
9275
9323
  if (isRecord8(mod.islandRegistry))
9276
9324
  return mod.islandRegistry;
@@ -9282,9 +9330,24 @@ var frameworks, isRecord8 = (value) => typeof value === "object" && value !== nu
9282
9330
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
9283
9331
  }, isIdentifier = (value) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value), resolveIslandSourcePath = (registryPath, sourcePath) => {
9284
9332
  if (sourcePath.startsWith("file://")) {
9285
- return new URL(sourcePath).pathname;
9333
+ return fileURLToPath2(sourcePath);
9286
9334
  }
9287
9335
  return resolve8(dirname8(registryPath), sourcePath);
9336
+ }, isExistingFile = (path) => {
9337
+ try {
9338
+ return statSync2(path).isFile();
9339
+ } catch {
9340
+ return false;
9341
+ }
9342
+ }, resolveIslandSourceFile = (registryPath, sourcePath) => {
9343
+ const joinedPath = resolveIslandSourcePath(registryPath, sourcePath);
9344
+ if (isExistingFile(joinedPath))
9345
+ return joinedPath;
9346
+ try {
9347
+ return Bun.resolveSync(joinedPath, dirname8(registryPath));
9348
+ } catch {
9349
+ return joinedPath;
9350
+ }
9288
9351
  }, getObjectPropertyName = (name) => {
9289
9352
  if (lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name)) {
9290
9353
  return name.text;
@@ -11072,7 +11135,7 @@ var init_sourceMetadata = __esm(() => {
11072
11135
 
11073
11136
  // src/islands/pageMetadata.ts
11074
11137
  import { readFileSync as readFileSync12 } from "fs";
11075
- import { dirname as dirname9, resolve as resolve11 } from "path";
11138
+ import { resolve as resolve11 } from "path";
11076
11139
  var pagePatterns, getPageDirs = (config) => [
11077
11140
  { dir: config.angularDirectory, framework: "angular" },
11078
11141
  { dir: config.emberDirectory, framework: "ember" },
@@ -11092,17 +11155,10 @@ var pagePatterns, getPageDirs = (config) => [
11092
11155
  const source = definition.buildReference?.source;
11093
11156
  if (!source)
11094
11157
  continue;
11095
- const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve11(dirname9(buildInfo.resolvedRegistryPath), source);
11096
- lookup.set(`${definition.framework}:${definition.component}`, resolve11(resolvedSource));
11158
+ lookup.set(`${definition.framework}:${definition.component}`, resolve11(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, source)));
11097
11159
  }
11098
11160
  return lookup;
11099
- }, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
11100
- const candidate = usage.source;
11101
- return candidate ? resolve11(candidate) === target : false;
11102
- }), getPagesUsingIslandSource = (sourcePath) => {
11103
- const target = resolve11(sourcePath);
11104
- return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
11105
- }, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
11161
+ }, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
11106
11162
  const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
11107
11163
  return sourcePath ? {
11108
11164
  ...usage,
@@ -12482,7 +12538,7 @@ var init_telemetry = __esm(() => {
12482
12538
  // src/cli/telemetryEvent.ts
12483
12539
  import { existsSync as existsSync14, readFileSync as readFileSync17 } from "fs";
12484
12540
  import { arch, platform } from "os";
12485
- import { dirname as dirname10, join as join17, parse } from "path";
12541
+ import { dirname as dirname9, join as join17, parse } from "path";
12486
12542
  var checkCandidate = (candidate) => {
12487
12543
  if (!existsSync14(candidate)) {
12488
12544
  return null;
@@ -12507,7 +12563,7 @@ var checkCandidate = (candidate) => {
12507
12563
  if (version) {
12508
12564
  return version;
12509
12565
  }
12510
- dir = dirname10(dir);
12566
+ dir = dirname9(dir);
12511
12567
  }
12512
12568
  return "unknown";
12513
12569
  }, sendTelemetryEvent = (event, payload) => {
@@ -12618,7 +12674,7 @@ var init_mobilePreview = __esm(() => {
12618
12674
  // src/mobile/deviceCapabilities.ts
12619
12675
  import { existsSync as existsSync15, readFileSync as readFileSync18 } from "fs";
12620
12676
  import { extname as extname6, join as join18, relative as relative8, resolve as resolve15 } from "path";
12621
- import { fileURLToPath as fileURLToPath2 } from "url";
12677
+ import { fileURLToPath as fileURLToPath3 } from "url";
12622
12678
  var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES, ADAPTERS, SOURCE_GLOB, IGNORED_DIRECTORIES, IDENTIFIER_PATTERN, providerModulePattern = (provider) => new RegExp(`^@absolutejs/devices-${provider}/[a-z][a-z0-9-]*$`, "u"), providerPackagePattern = (provider) => provider === "capacitor" ? /^@capacitor\/[a-z][a-z0-9-]*@\d+\.\d+\.\d+$/u : /^(?:expo-[a-z][a-z0-9-]*|@react-native-[a-z0-9-]+\/[a-z][a-z0-9-]*)@\d+\.\d+\.\d+$/u, providerLabel = (provider) => provider === "capacitor" ? "Capacitor" : "Expo", ANDROID_PERMISSION_PATTERN, IOS_USAGE_DESCRIPTIONS, IOS_PRIVACY_ACCESSED_API_REASONS, IOS_PRIVACY_ACCESSED_APIS, object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readJson = (path) => {
12623
12679
  const value = JSON.parse(readFileSync18(path, "utf8"));
12624
12680
  if (!object(value))
@@ -12744,7 +12800,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
12744
12800
  };
12745
12801
  }, resolveAdapterManifest = (adapter, provider) => {
12746
12802
  try {
12747
- return fileURLToPath2(import.meta.resolve(`${adapter}/package.json`));
12803
+ return fileURLToPath3(import.meta.resolve(`${adapter}/package.json`));
12748
12804
  } catch {
12749
12805
  throw new TypeError(`${adapter} is not installed. Run \`absolute mobile init\` to install the ${provider === "expo" ? "Expo" : "Capacitor"} device adapters.`);
12750
12806
  }
@@ -13089,7 +13145,7 @@ var init_client = __esm(() => {
13089
13145
 
13090
13146
  // src/mobile/syncSchema.ts
13091
13147
  import { readFileSync as readFileSync20 } from "fs";
13092
- import { dirname as dirname11, join as join20, resolve as resolve16 } from "path";
13148
+ import { dirname as dirname10, join as join20, resolve as resolve16 } from "path";
13093
13149
  var object2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
13094
13150
  try {
13095
13151
  const value = JSON.parse(readFileSync20(path, "utf8"));
@@ -13112,7 +13168,7 @@ var object2 = (value) => typeof value === "object" && value !== null && !Array.i
13112
13168
  const manifest = manifestAt(candidate);
13113
13169
  if (manifest && Reflect.get(manifest, "name") === packageName)
13114
13170
  return candidate;
13115
- const parent = dirname11(directory);
13171
+ const parent = dirname10(directory);
13116
13172
  if (parent === directory)
13117
13173
  return;
13118
13174
  directory = parent;
@@ -14007,7 +14063,7 @@ import {
14007
14063
  X509Certificate as X509Certificate3
14008
14064
  } from "crypto";
14009
14065
  import { access as access4, mkdir as mkdir6 } from "fs/promises";
14010
- import { dirname as dirname12, isAbsolute as isAbsolute4, relative as relative9, resolve as resolve17, sep as sep3 } from "path";
14066
+ import { dirname as dirname11, isAbsolute as isAbsolute4, relative as relative9, resolve as resolve17, sep as sep3 } from "path";
14011
14067
  import { pathToFileURL as pathToFileURL2 } from "url";
14012
14068
  import { Elysia as Elysia8 } from "elysia";
14013
14069
  var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MODULE = "mobile.update.ts", object4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), projectPath = (projectRoot, requested) => {
@@ -14232,7 +14288,7 @@ ${generated}`);
14232
14288
  return;
14233
14289
  });
14234
14290
  }
14235
- await mkdir6(dirname12(path), { recursive: true });
14291
+ await mkdir6(dirname11(path), { recursive: true });
14236
14292
  await Bun.write(path, renderAbsoluteMobileUpdateRegistry({
14237
14293
  ...options.health ? { health: options.health } : {},
14238
14294
  ...options.rollout ? { rollout: options.rollout } : {},
@@ -15611,7 +15667,7 @@ var init_validateSafePath = () => {};
15611
15667
  // src/build/buildReactServerComponents.ts
15612
15668
  import { createHash as createHash6 } from "crypto";
15613
15669
  import { existsSync as existsSync19, mkdirSync as mkdirSync5, readFileSync as readFileSync22, writeFileSync as writeFileSync7 } from "fs";
15614
- import { basename as basename5, dirname as dirname13, extname as extname9, join as join25, relative as relative12, resolve as resolve23 } from "path";
15670
+ import { basename as basename5, dirname as dirname12, extname as extname9, join as join25, relative as relative12, resolve as resolve23 } from "path";
15615
15671
  var {
15616
15672
  build: bunBuild,
15617
15673
  Glob: Glob3,
@@ -15629,9 +15685,9 @@ var PAGE_PATTERN = "*.{tsx,jsx,ts,js}", SOURCE_FILTER, USE_CLIENT_PATTERN, MANIF
15629
15685
  }, clientModuleId = (projectRoot, path) => createHash6("sha256").update(relative12(projectRoot, path).replace(/\\/g, "/")).digest("hex").slice(0, MODULE_ID_LENGTH), isClientModuleSource = (source) => USE_CLIENT_PATTERN.test(source), scanExportNames = (path, source) => {
15630
15686
  const transpiler = new Transpiler2({ loader: loaderFor(path) });
15631
15687
  return transpiler.scan(source).exports;
15632
- }, clientReferenceSource = (module) => {
15688
+ }, clientReferenceSource = (module, flightServer) => {
15633
15689
  const lines = [
15634
- `import { registerClientReference } from 'react-server-dom-webpack/server.edge';`,
15690
+ `import { registerClientReference } from ${JSON.stringify(flightServer)};`,
15635
15691
  `import { clientManifest } from ${JSON.stringify(MANIFEST_SPECIFIER)};`,
15636
15692
  `const id = ${JSON.stringify(module.id)};`,
15637
15693
  `clientManifest[id] = { chunks: [id, id], id, name: '' };`,
@@ -15643,7 +15699,16 @@ var PAGE_PATTERN = "*.{tsx,jsx,ts,js}", SOURCE_FILTER, USE_CLIENT_PATTERN, MANIF
15643
15699
  return `${lines.join(`
15644
15700
  `)}
15645
15701
  `;
15702
+ }, REACT_COMPONENTS_SPECIFIER, resolveReactComponentsServerEntry = (importer) => {
15703
+ try {
15704
+ const regularEntry = Bun.resolveSync("@absolutejs/absolute/react/components", dirname12(importer));
15705
+ const serverEntry = join25(dirname12(regularEntry), "server", "index.js");
15706
+ return existsSync19(serverEntry) ? serverEntry : undefined;
15707
+ } catch {
15708
+ return;
15709
+ }
15646
15710
  }, createClientReferencePlugin = (projectRoot, clientModules) => {
15711
+ const flightServer = Bun.resolveSync("react-server-dom-webpack/server.edge", projectRoot);
15647
15712
  const plugin = {
15648
15713
  name: "absolute-react-server-client-references",
15649
15714
  setup(builder) {
@@ -15656,6 +15721,10 @@ var PAGE_PATTERN = "*.{tsx,jsx,ts,js}", SOURCE_FILTER, USE_CLIENT_PATTERN, MANIF
15656
15721
  `,
15657
15722
  loader: "js"
15658
15723
  }));
15724
+ builder.onResolve({ filter: REACT_COMPONENTS_SPECIFIER }, (args) => {
15725
+ const path = resolveReactComponentsServerEntry(args.importer);
15726
+ return path ? { path } : undefined;
15727
+ });
15659
15728
  builder.onLoad({ filter: SOURCE_FILTER }, (args) => {
15660
15729
  const source = readFileSync22(args.path, "utf8");
15661
15730
  const loader = loaderFor(args.path);
@@ -15669,7 +15738,7 @@ var PAGE_PATTERN = "*.{tsx,jsx,ts,js}", SOURCE_FILTER, USE_CLIENT_PATTERN, MANIF
15669
15738
  };
15670
15739
  clientModules.set(module.id, module);
15671
15740
  return {
15672
- contents: clientReferenceSource(module),
15741
+ contents: clientReferenceSource(module, flightServer),
15673
15742
  loader: "js"
15674
15743
  };
15675
15744
  });
@@ -15790,10 +15859,21 @@ hydrateRoot(document, createElement(Root));
15790
15859
  outputPaths: [],
15791
15860
  success: true
15792
15861
  }), writeGeneratedFile = (path, contents) => {
15793
- mkdirSync5(dirname13(path), { recursive: true });
15862
+ mkdirSync5(dirname12(path), { recursive: true });
15794
15863
  writeFileSync7(path, contents);
15795
15864
  return path;
15796
- }, pageEntryName = (pagePath) => toPascal(basename5(pagePath, extname9(pagePath))), buildReactServerComponents = async ({
15865
+ }, pageEntryName = (pagePath) => toPascal(basename5(pagePath, extname9(pagePath))), endsWithPageSuffix = (name) => name.length > REACT_SERVER_PAGE_MANIFEST_SUFFIX.length && name.endsWith(REACT_SERVER_PAGE_MANIFEST_SUFFIX), pageManifestKeys = (name, names) => {
15866
+ const doubled = `${name}${REACT_SERVER_PAGE_MANIFEST_SUFFIX}`;
15867
+ if (!endsWithPageSuffix(name))
15868
+ return { keys: [doubled] };
15869
+ const base = name.slice(0, -REACT_SERVER_PAGE_MANIFEST_SUFFIX.length);
15870
+ if (!names.has(base))
15871
+ return { keys: [name, doubled] };
15872
+ return {
15873
+ collision: `React Server Components pages ${base} and ${name} both map to the manifest key "${name}"; ${base} keeps it and ${name} is only reachable as "${doubled}". Rename one of them.`,
15874
+ keys: [doubled]
15875
+ };
15876
+ }, buildReactServerComponents = async ({
15797
15877
  buildPath,
15798
15878
  directory,
15799
15879
  isDev,
@@ -15894,10 +15974,15 @@ hydrateRoot(document, createElement(Root));
15894
15974
  [REACT_SERVER_CLIENT_MANIFEST_KEY]: clientUrl,
15895
15975
  [REACT_SERVER_RENDERER_MANIFEST_KEY]: resolve23(ssrOutput.path)
15896
15976
  };
15977
+ const pageKeys = reactServerPageManifestKeys(pageEntries.map((page) => page.name));
15978
+ for (const collision of pageKeys.collisions)
15979
+ logWarn(collision);
15897
15980
  for (const page of pageEntries) {
15898
15981
  const output = findOutput(serverResult.outputs, page.name);
15899
- if (output)
15900
- manifest[`${page.name}${REACT_SERVER_PAGE_MANIFEST_SUFFIX}`] = resolve23(output.path);
15982
+ if (!output)
15983
+ continue;
15984
+ for (const key of pageKeys.keys.get(page.name) ?? [])
15985
+ manifest[key] = resolve23(output.path);
15901
15986
  }
15902
15987
  const result = {
15903
15988
  logs,
@@ -15927,11 +16012,24 @@ hydrateRoot(document, createElement(Root));
15927
16012
  ...options,
15928
16013
  directory: absoluteDirectory
15929
16014
  });
16015
+ }, reactServerPageManifestKeys = (pageNames) => {
16016
+ const names = new Set(pageNames);
16017
+ const keys = new Map;
16018
+ const collisions = [];
16019
+ for (const name of pageNames) {
16020
+ const page = pageManifestKeys(name, names);
16021
+ keys.set(name, page.keys);
16022
+ if (page.collision)
16023
+ collisions.push(page.collision);
16024
+ }
16025
+ return { collisions, keys };
15930
16026
  };
15931
16027
  var init_buildReactServerComponents = __esm(() => {
16028
+ init_logger();
15932
16029
  init_validateSafePath();
15933
16030
  SOURCE_FILTER = /\.[cm]?[jt]sx?$/;
15934
16031
  USE_CLIENT_PATTERN = /^(?:\s|\/\/[^\n]*\n|\/\*[\s\S]*?\*\/)*(['"])use client\1/;
16032
+ REACT_COMPONENTS_SPECIFIER = /^@absolutejs\/absolute\/react\/components$/;
15935
16033
  });
15936
16034
 
15937
16035
  // src/build/wrapHTMLScript.ts
@@ -15997,14 +16095,14 @@ var init_outputLogs = __esm(() => {
15997
16095
  });
15998
16096
 
15999
16097
  // src/build/stampedFileCache.ts
16000
- import { statSync as statSync2 } from "fs";
16098
+ import { statSync as statSync3 } from "fs";
16001
16099
  var STAMP_SETTLE_MS = 2000, createStampedFileCache = () => {
16002
16100
  const entries = new Map;
16003
16101
  const seen = new Set;
16004
16102
  const read = (path, compute) => {
16005
16103
  let stamp;
16006
16104
  try {
16007
- const stats = statSync2(path);
16105
+ const stats = statSync3(path);
16008
16106
  stamp = { mtimeMs: stats.mtimeMs, size: stats.size };
16009
16107
  } catch {
16010
16108
  return compute();
@@ -16085,7 +16183,7 @@ var init_scanConventions = __esm(() => {
16085
16183
 
16086
16184
  // src/build/htmlIncludes.ts
16087
16185
  import { readFileSync as readFileSync23 } from "fs";
16088
- import { dirname as dirname14, relative as relative13, resolve as resolve24 } from "path";
16186
+ import { dirname as dirname13, relative as relative13, resolve as resolve24 } from "path";
16089
16187
  var describe = (path, root) => relative13(root, path) || path, includeError = (context, message) => new Error(`${message}
16090
16188
  include chain: ${context.chain.map((path) => describe(path, context.root)).join(" \u2192 ")}`), findTagClose = (html, start) => {
16091
16189
  const match = /^<[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/.exec(html.slice(start));
@@ -16156,7 +16254,7 @@ var describe = (path, root) => relative13(root, path) || path, includeError = (c
16156
16254
  const src = readAttribute(element.attributes, "src");
16157
16255
  if (!src)
16158
16256
  throw includeError(context, `<abs-include> without a src in ${describe(file, context.root)}`);
16159
- const target = resolve24(dirname14(file), src);
16257
+ const target = resolve24(dirname13(file), src);
16160
16258
  const chain = [...context.chain, target];
16161
16259
  if (context.chain.includes(target)) {
16162
16260
  throw includeError({ ...context, chain }, `Include cycle: ${describe(target, context.root)} includes itself`);
@@ -16199,7 +16297,7 @@ var init_htmlIncludes = () => {};
16199
16297
 
16200
16298
  // src/build/spaSideManifests.ts
16201
16299
  import { writeFile as writeFile6 } from "fs/promises";
16202
- import { basename as basename7, dirname as dirname15, relative as relative14, resolve as resolve25 } from "path";
16300
+ import { basename as basename7, dirname as dirname14, relative as relative14, resolve as resolve25 } from "path";
16203
16301
  var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
16204
16302
  const manifestEntries = {};
16205
16303
  await Promise.all([...spaRoutesBySource.entries()].map(async ([source, routes]) => {
@@ -16207,7 +16305,7 @@ var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
16207
16305
  const parentJsPath = resolveServerJsPath(parentName);
16208
16306
  if (!parentJsPath)
16209
16307
  return;
16210
- const sourceDir = dirname15(source);
16308
+ const sourceDir = dirname14(source);
16211
16309
  const entries = routes.flatMap(({ path, importPath }) => {
16212
16310
  const childSourcePath = resolve25(sourceDir, importPath);
16213
16311
  const childName = basename7(childSourcePath, ".vue");
@@ -16215,7 +16313,7 @@ var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
16215
16313
  if (!childJsPath)
16216
16314
  return [];
16217
16315
  const absoluteCssPath = childJsPath.replace(/\.js$/, ".css");
16218
- const cssPath = relative14(dirname15(parentJsPath), absoluteCssPath);
16316
+ const cssPath = relative14(dirname14(parentJsPath), absoluteCssPath);
16219
16317
  return [{ cssPath, path }];
16220
16318
  });
16221
16319
  if (entries.length === 0)
@@ -16236,7 +16334,7 @@ __export(exports_serverExternals, {
16236
16334
  });
16237
16335
  import { existsSync as existsSync21, readdirSync, readFileSync as readFileSync24 } from "fs";
16238
16336
  import { isBuiltin } from "module";
16239
- import { dirname as dirname16, extname as extname10, join as join26 } from "path";
16337
+ import { dirname as dirname15, extname as extname10, join as join26 } from "path";
16240
16338
  var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVendorPaths) => {
16241
16339
  const angularPartialDeclSpecs = Object.keys(angularVendorPaths ?? {}).filter((spec) => !spec.startsWith("@angular/")).flatMap((spec) => [spec, `${spec}/*`]);
16242
16340
  return [
@@ -16290,12 +16388,12 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
16290
16388
  return false;
16291
16389
  }
16292
16390
  }, findPackageRoot = (filePath) => {
16293
- let dir = dirname16(filePath);
16391
+ let dir = dirname15(filePath);
16294
16392
  while (true) {
16295
16393
  const manifestPath = join26(dir, "package.json");
16296
16394
  if (existsSync21(manifestPath) && hasPackageName(manifestPath))
16297
16395
  return dir;
16298
- const parent = dirname16(dir);
16396
+ const parent = dirname15(dir);
16299
16397
  if (parent === dir)
16300
16398
  return null;
16301
16399
  dir = parent;
@@ -16370,7 +16468,7 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
16370
16468
  return verdict;
16371
16469
  };
16372
16470
  const entryIsRuntimeLoadable = (resolvedPath) => {
16373
- const entryDir = dirname16(resolvedPath);
16471
+ const entryDir = dirname15(resolvedPath);
16374
16472
  const cached = entryDecisions.get(entryDir);
16375
16473
  if (cached !== undefined)
16376
16474
  return cached;
@@ -16390,14 +16488,14 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
16390
16488
  return false;
16391
16489
  if (!RUNTIME_LOADABLE_EXTENSIONS.has(extname10(fromRoot)))
16392
16490
  return false;
16393
- const importerDir = importer ? dirname16(importer) : projectRoot;
16491
+ const importerDir = importer ? dirname15(importer) : projectRoot;
16394
16492
  if (importerDir !== projectRoot && resolveOrNull(specifier, importerDir) !== fromRoot)
16395
16493
  return false;
16396
16494
  return packageIsRuntimeResolvable(fromRoot) && entryIsRuntimeLoadable(fromRoot);
16397
16495
  };
16398
16496
  return {
16399
16497
  isExternal: (specifier, importer) => {
16400
- const key = `${specifier}\x00${importer ? dirname16(importer) : ""}`;
16498
+ const key = `${specifier}\x00${importer ? dirname15(importer) : ""}`;
16401
16499
  const cached = decisions.get(key);
16402
16500
  if (cached !== undefined)
16403
16501
  return cached;
@@ -16436,7 +16534,7 @@ var init_serverExternals = __esm(() => {
16436
16534
 
16437
16535
  // src/build/islandBootstrap.ts
16438
16536
  import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync8 } from "fs";
16439
- import { basename as basename8, dirname as dirname17, extname as extname11, join as join27, relative as relative15 } from "path";
16537
+ import { basename as basename8, dirname as dirname16, extname as extname11, join as join27, relative as relative15 } from "path";
16440
16538
  var DEFAULT_ISLAND_BOOTSTRAP_NAME = "absoluteIslandBootstrap", DEFAULT_ISLAND_BOOTSTRAP_SOURCE = `import {
16441
16539
  createIslandManifestResolver,
16442
16540
  startIslands
@@ -16448,7 +16546,7 @@ startIslands({
16448
16546
  });
16449
16547
  `, writeDefaultIslandBootstrap = (islandEntriesRoot) => {
16450
16548
  const entryPath = join27(islandEntriesRoot, "islands", `${DEFAULT_ISLAND_BOOTSTRAP_NAME}.js`);
16451
- mkdirSync6(dirname17(entryPath), { recursive: true });
16549
+ mkdirSync6(dirname16(entryPath), { recursive: true });
16452
16550
  writeFileSync8(entryPath, DEFAULT_ISLAND_BOOTSTRAP_SOURCE);
16453
16551
  return entryPath;
16454
16552
  }, artifactStem = (artifact) => {
@@ -16462,9 +16560,9 @@ startIslands({
16462
16560
  outputs,
16463
16561
  passRoot
16464
16562
  }) => {
16465
- const expectedDir = passRoot === undefined ? undefined : normalizePath2(join27(buildPath, relative15(passRoot, dirname17(bootstrapPath))));
16563
+ const expectedDir = passRoot === undefined ? undefined : normalizePath2(join27(buildPath, relative15(passRoot, dirname16(bootstrapPath))));
16466
16564
  const expectedStem = basename8(bootstrapPath, extname11(bootstrapPath));
16467
- const artifact = outputs.find((output) => output.kind === "entry-point" && extname11(output.path) === ".js" && (expectedDir === undefined || normalizePath2(dirname17(output.path)) === expectedDir) && artifactStem(output) === expectedStem);
16565
+ const artifact = outputs.find((output) => output.kind === "entry-point" && extname11(output.path) === ".js" && (expectedDir === undefined || normalizePath2(dirname16(output.path)) === expectedDir) && artifactStem(output) === expectedStem);
16468
16566
  if (!artifact)
16469
16567
  return;
16470
16568
  const webPath = normalizePath2(relative15(buildPath, artifact.path));
@@ -16474,13 +16572,13 @@ var init_islandBootstrap = () => {};
16474
16572
 
16475
16573
  // src/build/missingClientFrameworks.ts
16476
16574
  import { existsSync as existsSync22 } from "fs";
16477
- import { dirname as dirname18, join as join28 } from "path";
16575
+ import { dirname as dirname17, join as join28 } from "path";
16478
16576
  var CLIENT_FRAMEWORK_PACKAGES, CLIENT_FRAMEWORKS, isPackageInstalled = (packageName, projectRoot) => {
16479
16577
  let dir = projectRoot;
16480
16578
  while (true) {
16481
16579
  if (existsSync22(join28(dir, "node_modules", packageName, "package.json")))
16482
16580
  return true;
16483
- const parent = dirname18(dir);
16581
+ const parent = dirname17(dir);
16484
16582
  if (parent === dir)
16485
16583
  return false;
16486
16584
  dir = parent;
@@ -16540,7 +16638,7 @@ var init_missingClientFrameworks = __esm(() => {
16540
16638
 
16541
16639
  // src/build/missingReactRouter.ts
16542
16640
  import { existsSync as existsSync23, readFileSync as readFileSync25, realpathSync as realpathSync2 } from "fs";
16543
- import { dirname as dirname19, join as join29 } from "path";
16641
+ import { dirname as dirname18, join as join29 } from "path";
16544
16642
  var PACKAGE_NAME = "@absolutejs/absolute", REACT_ROUTER_SPECIFIER, readPackageName2 = (manifestPath) => {
16545
16643
  try {
16546
16644
  const parsed = JSON.parse(readFileSync25(manifestPath, "utf-8"));
@@ -16552,7 +16650,7 @@ var PACKAGE_NAME = "@absolutejs/absolute", REACT_ROUTER_SPECIFIER, readPackageNa
16552
16650
  return;
16553
16651
  }
16554
16652
  }, owningPackageName = (filePath) => {
16555
- let dir = dirname19(filePath);
16653
+ let dir = dirname18(filePath);
16556
16654
  while (true) {
16557
16655
  const manifestPath = join29(dir, "package.json");
16558
16656
  if (existsSync23(manifestPath)) {
@@ -16560,7 +16658,7 @@ var PACKAGE_NAME = "@absolutejs/absolute", REACT_ROUTER_SPECIFIER, readPackageNa
16560
16658
  if (name !== undefined)
16561
16659
  return name;
16562
16660
  }
16563
- const parent = dirname19(dir);
16661
+ const parent = dirname18(dir);
16564
16662
  if (parent === dir)
16565
16663
  return;
16566
16664
  dir = parent;
@@ -18439,7 +18537,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
18439
18537
  // src/build/fileRoutes.ts
18440
18538
  import { existsSync as existsSync31, mkdirSync as mkdirSync8, readFileSync as readFileSync28, writeFileSync as writeFileSync10 } from "fs";
18441
18539
  import {
18442
- dirname as dirname20,
18540
+ dirname as dirname19,
18443
18541
  extname as extname12,
18444
18542
  isAbsolute as isAbsolute5,
18445
18543
  join as join36,
@@ -18603,7 +18701,7 @@ var DEFAULT_DIRECTORY = "routes", DEFAULT_OUTPUT, HASH_LENGTH2 = 6, HASH_RADIX =
18603
18701
  return lines.join(`
18604
18702
  `);
18605
18703
  }, renderFileRouteModule = (routes, output) => {
18606
- const outputDir = dirname20(output);
18704
+ const outputDir = dirname19(output);
18607
18705
  const frameworks = [...new Set(routes.map((route) => route.framework))].sort().map((framework) => ADAPTERS2[framework]);
18608
18706
  const imports = [
18609
18707
  `import type { FileRouteDefinition } from '@absolutejs/absolute';`,
@@ -18630,7 +18728,7 @@ var DEFAULT_DIRECTORY = "routes", DEFAULT_OUTPUT, HASH_LENGTH2 = 6, HASH_RADIX =
18630
18728
  const current = existsSync31(path) ? readFileSync28(path, "utf-8") : undefined;
18631
18729
  if (current === contents)
18632
18730
  return false;
18633
- mkdirSync8(dirname20(path), { recursive: true });
18731
+ mkdirSync8(dirname19(path), { recursive: true });
18634
18732
  writeFileSync10(path, contents);
18635
18733
  return true;
18636
18734
  }, syncFileRoutes = (config) => {
@@ -18803,7 +18901,7 @@ var init_lazyPages = __esm(() => {
18803
18901
 
18804
18902
  // src/build/angularLinkerPlugin.ts
18805
18903
  import { existsSync as existsSync33, mkdirSync as mkdirSync9, readFileSync as readFileSync29, writeFileSync as writeFileSync11 } from "fs";
18806
- import { dirname as dirname21, join as join38, relative as relative17, resolve as resolve30 } from "path";
18904
+ import { dirname as dirname20, join as join38, relative as relative17, resolve as resolve30 } from "path";
18807
18905
  import { createHash as createHash7 } from "crypto";
18808
18906
  var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
18809
18907
  name: "angular-linker",
@@ -18841,7 +18939,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
18841
18939
  const mod = await import(linkerSpecifier);
18842
18940
  linkerPlugin = mod.createEs2015LinkerPlugin({
18843
18941
  fileSystem: {
18844
- dirname: dirname21,
18942
+ dirname: dirname20,
18845
18943
  exists: existsSync33,
18846
18944
  readFile: readFileSync29,
18847
18945
  relative: relative17,
@@ -18957,8 +19055,8 @@ var init_bunStringRawUnicodePlugin = __esm(() => {
18957
19055
  });
18958
19056
 
18959
19057
  // src/build/externalAssetPlugin.ts
18960
- import { copyFileSync, existsSync as existsSync34, mkdirSync as mkdirSync10, statSync as statSync3 } from "fs";
18961
- import { basename as basename11, dirname as dirname22, join as join39, resolve as resolve31 } from "path";
19058
+ import { copyFileSync, existsSync as existsSync34, mkdirSync as mkdirSync10, statSync as statSync4 } from "fs";
19059
+ import { basename as basename11, dirname as dirname21, join as join39, resolve as resolve31 } from "path";
18962
19060
  var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
18963
19061
  name: "absolute-external-asset",
18964
19062
  setup(bld) {
@@ -18973,7 +19071,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
18973
19071
  return;
18974
19072
  urlPattern.lastIndex = 0;
18975
19073
  let match;
18976
- const sourceDir = dirname22(args.path);
19074
+ const sourceDir = dirname21(args.path);
18977
19075
  while ((match = urlPattern.exec(source)) !== null) {
18978
19076
  const relPath = match[1];
18979
19077
  if (!relPath)
@@ -18981,12 +19079,12 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
18981
19079
  const assetPath = resolve31(sourceDir, relPath);
18982
19080
  if (!existsSync34(assetPath))
18983
19081
  continue;
18984
- if (!statSync3(assetPath).isFile())
19082
+ if (!statSync4(assetPath).isFile())
18985
19083
  continue;
18986
19084
  const targetPath = join39(outDir, basename11(assetPath));
18987
19085
  if (existsSync34(targetPath))
18988
19086
  continue;
18989
- mkdirSync10(dirname22(targetPath), { recursive: true });
19087
+ mkdirSync10(dirname21(targetPath), { recursive: true });
18990
19088
  copyFileSync(assetPath, targetPath);
18991
19089
  }
18992
19090
  return;
@@ -19189,7 +19287,7 @@ var init_islandRegistryTransform = __esm(() => {
19189
19287
 
19190
19288
  // src/build/vueModuleOutputPath.ts
19191
19289
  import {
19192
- dirname as dirname23,
19290
+ dirname as dirname22,
19193
19291
  isAbsolute as isAbsolute7,
19194
19292
  join as join40,
19195
19293
  parse as parse2,
@@ -19198,7 +19296,7 @@ import {
19198
19296
  sep as sep6
19199
19297
  } from "path";
19200
19298
  var SOURCES_DIR = "sources", EXTERNAL_DIR = "_external", UNRELATED_PREFIX = "h-", HASH_LENGTH3 = 13, toOutputName = (path) => path.replace(/\.(vue|ts)$/, ".js"), unrelatedMirrorPath = (absolutePath) => {
19201
- const directory = dirname23(absolutePath);
19299
+ const directory = dirname22(absolutePath);
19202
19300
  const directoryHash = Bun.hash(directory).toString(BASE_36_RADIX).padStart(HASH_LENGTH3, "0");
19203
19301
  return join40(EXTERNAL_DIR, `${UNRELATED_PREFIX}${directoryHash}`, toOutputName(relative18(directory, absolutePath)));
19204
19302
  }, sourceMirrorPath = (sourcePath, projectRoot) => {
@@ -19216,7 +19314,7 @@ var SOURCES_DIR = "sources", EXTERNAL_DIR = "_external", UNRELATED_PREFIX = "h-"
19216
19314
  return unrelatedMirrorPath(absolutePath);
19217
19315
  return join40(EXTERNAL_DIR, String(levelsUp), toOutputName(segments.slice(levelsUp).join(sep6)));
19218
19316
  }, vueModuleOutputPath = (outputDir, sourcePath, projectRoot = process.cwd()) => join40(outputDir, SOURCES_DIR, sourceMirrorPath(sourcePath, projectRoot)), vueRelativeOutputImport = (importerSource, targetSource, projectRoot = process.cwd()) => {
19219
- const specifier = relative18(dirname23(sourceMirrorPath(importerSource, projectRoot)), sourceMirrorPath(targetSource, projectRoot)).replace(/\\/g, "/");
19317
+ const specifier = relative18(dirname22(sourceMirrorPath(importerSource, projectRoot)), sourceMirrorPath(targetSource, projectRoot)).replace(/\\/g, "/");
19220
19318
  return specifier.startsWith("../") ? specifier : `./${specifier}`;
19221
19319
  }, mirrorRegion = (sourcePath, projectRoot) => {
19222
19320
  const [first, second] = sourceMirrorPath(sourcePath, projectRoot).split(sep6);
@@ -19773,7 +19871,7 @@ var init_commonAncestor = () => {};
19773
19871
 
19774
19872
  // src/utils/buildDirectoryLock.ts
19775
19873
  import { mkdirSync as mkdirSync12, unlinkSync, writeFileSync as writeFileSync14, readFileSync as readFileSync32 } from "fs";
19776
- import { dirname as dirname24, join as join44 } from "path";
19874
+ import { dirname as dirname23, join as join44 } from "path";
19777
19875
  var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
19778
19876
  if (exitHandlersRegistered)
19779
19877
  return;
@@ -19800,7 +19898,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
19800
19898
  console.error(err);
19801
19899
  process.exit(1);
19802
19900
  });
19803
- }, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join44(dirname24(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
19901
+ }, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join44(dirname23(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
19804
19902
  `).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
19805
19903
  if (locks.size === 0) {
19806
19904
  delete process.env[HELD_LOCKS_ENV];
@@ -19817,7 +19915,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
19817
19915
  locks.delete(buildDirectory);
19818
19916
  writeHeldLockEnv(locks);
19819
19917
  }, writeLockFileSync = (lockPath, metadata) => {
19820
- mkdirSync12(dirname24(lockPath), { recursive: true });
19918
+ mkdirSync12(dirname23(lockPath), { recursive: true });
19821
19919
  writeFileSync14(lockPath, JSON.stringify(metadata, null, 2), { flag: "wx" });
19822
19920
  }, readLockMetadata = (lockPath) => {
19823
19921
  try {
@@ -19944,7 +20042,7 @@ var isTestSourcePath = (file) => {
19944
20042
 
19945
20043
  // src/build/pwa.ts
19946
20044
  import { mkdir as mkdir7, rm as rm8, writeFile as writeFile9 } from "fs/promises";
19947
- import { dirname as dirname25, join as join45 } from "path";
20045
+ import { dirname as dirname24, join as join45 } from "path";
19948
20046
  var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
19949
20047
  const input = value ?? fallback;
19950
20048
  if (!input.startsWith("/") || input.startsWith("//")) {
@@ -20033,7 +20131,7 @@ ${push ? `,
20033
20131
  const syncSchema = config.sync ? discoverAbsoluteSyncSchema(projectRoot) : undefined;
20034
20132
  const { createWebAppManifest, pushServiceWorker } = await import("@absolutejs/pwa");
20035
20133
  const workerDestination = destinationFor(buildPath, serviceWorkerPath);
20036
- await mkdir7(dirname25(workerDestination), { recursive: true });
20134
+ await mkdir7(dirname24(workerDestination), { recursive: true });
20037
20135
  await writeFile9(workerDestination, `${pushServiceWorker({
20038
20136
  ...config.serviceWorker ?? {},
20039
20137
  ...pushRequested && pushApplicationServerKey && pushRoute ? {
@@ -20048,7 +20146,7 @@ ${push ? `,
20048
20146
  if (config.manifest && manifestPath) {
20049
20147
  const { path: _path, ...manifestConfig } = config.manifest;
20050
20148
  const manifestDestination = destinationFor(buildPath, manifestPath);
20051
- await mkdir7(dirname25(manifestDestination), { recursive: true });
20149
+ await mkdir7(dirname24(manifestDestination), { recursive: true });
20052
20150
  await writeFile9(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
20053
20151
  `);
20054
20152
  }
@@ -20903,8 +21001,8 @@ var init_typescript_translator = __esm(() => {
20903
21001
  });
20904
21002
 
20905
21003
  // src/dev/angular/fastHmrCompiler.ts
20906
- import { existsSync as existsSync37, readFileSync as readFileSync33, statSync as statSync4 } from "fs";
20907
- import { dirname as dirname26, extname as extname15, relative as relative22, resolve as resolve36 } from "path";
21004
+ import { existsSync as existsSync37, readFileSync as readFileSync33, statSync as statSync5 } from "fs";
21005
+ import { dirname as dirname25, extname as extname15, relative as relative22, resolve as resolve36 } from "path";
20908
21006
  var fail2 = (reason, detail, location) => ({
20909
21007
  detail,
20910
21008
  ok: false,
@@ -21033,7 +21131,7 @@ var fail2 = (reason, detail, location) => ({
21033
21131
  continue;
21034
21132
  const decoratorMeta = readDecoratorMeta(args);
21035
21133
  const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
21036
- const componentDir = dirname26(componentFilePath);
21134
+ const componentDir = dirname25(componentFilePath);
21037
21135
  const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
21038
21136
  fingerprintCache.set(id, fingerprint);
21039
21137
  } else {
@@ -21807,7 +21905,7 @@ var fail2 = (reason, detail, location) => ({
21807
21905
  const cacheKey = `ts:${filePath}:${className}`;
21808
21906
  let stat;
21809
21907
  try {
21810
- stat = statSync4(filePath);
21908
+ stat = statSync5(filePath);
21811
21909
  } catch {
21812
21910
  return null;
21813
21911
  }
@@ -21861,7 +21959,7 @@ var fail2 = (reason, detail, location) => ({
21861
21959
  const cacheKey = `dts:${dtsPath}:${className}`;
21862
21960
  let stat;
21863
21961
  try {
21864
- stat = statSync4(dtsPath);
21962
+ stat = statSync5(dtsPath);
21865
21963
  } catch {
21866
21964
  return null;
21867
21965
  }
@@ -22012,7 +22110,7 @@ var fail2 = (reason, detail, location) => ({
22012
22110
  });
22013
22111
  if (!names.includes(className))
22014
22112
  continue;
22015
- const nextDts = resolveDtsFromSpec(fromPath, dirname26(startDtsPath));
22113
+ const nextDts = resolveDtsFromSpec(fromPath, dirname25(startDtsPath));
22016
22114
  if (!nextDts)
22017
22115
  continue;
22018
22116
  const found = findDtsContainingClass(nextDts, className, visited);
@@ -22022,7 +22120,7 @@ var fail2 = (reason, detail, location) => ({
22022
22120
  const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
22023
22121
  while ((item = starReExportRe.exec(content)) !== null) {
22024
22122
  const fromPath = item[1] || "";
22025
- const nextDts = resolveDtsFromSpec(fromPath, dirname26(startDtsPath));
22123
+ const nextDts = resolveDtsFromSpec(fromPath, dirname25(startDtsPath));
22026
22124
  if (!nextDts)
22027
22125
  continue;
22028
22126
  const found = findDtsContainingClass(nextDts, className, visited);
@@ -22202,7 +22300,7 @@ var fail2 = (reason, detail, location) => ({
22202
22300
  }, providerProbeCache, fileHasModuleProviders = (filePath) => {
22203
22301
  let stat;
22204
22302
  try {
22205
- stat = statSync4(filePath);
22303
+ stat = statSync5(filePath);
22206
22304
  } catch {
22207
22305
  return true;
22208
22306
  }
@@ -22635,7 +22733,7 @@ ${block}
22635
22733
  rebootstrapRequired: false
22636
22734
  };
22637
22735
  }
22638
- if (inheritsDecoratedClass(classNode, sourceFile, dirname26(componentFilePath), projectRoot)) {
22736
+ if (inheritsDecoratedClass(classNode, sourceFile, dirname25(componentFilePath), projectRoot)) {
22639
22737
  return fail2("inherits-decorated-class");
22640
22738
  }
22641
22739
  const decorator = findComponentDecorator(classNode);
@@ -22647,7 +22745,7 @@ ${block}
22647
22745
  const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
22648
22746
  const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
22649
22747
  const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
22650
- const componentDir = dirname26(componentFilePath);
22748
+ const componentDir = dirname25(componentFilePath);
22651
22749
  let templateText;
22652
22750
  let templatePath;
22653
22751
  if (decoratorMeta.template !== null) {
@@ -23427,7 +23525,7 @@ var init_runAngularHandlerScan = __esm(() => {
23427
23525
 
23428
23526
  // src/build/parseAngularConfigImports.ts
23429
23527
  import { existsSync as existsSync38, readFileSync as readFileSync37 } from "fs";
23430
- import { dirname as dirname27, isAbsolute as isAbsolute9, join as join50 } from "path";
23528
+ import { dirname as dirname26, isAbsolute as isAbsolute9, join as join50 } from "path";
23431
23529
  var findDefineConfigCall = (sf) => {
23432
23530
  let result = null;
23433
23531
  const visit = (node) => {
@@ -23521,7 +23619,7 @@ var findDefineConfigCall = (sf) => {
23521
23619
  const importInfo = findImportForBinding(sf, binding);
23522
23620
  if (!importInfo)
23523
23621
  return null;
23524
- const configDir = dirname27(configPath);
23622
+ const configDir = dirname26(configPath);
23525
23623
  const absolutePath = importInfo.source.startsWith(".") ? join50(configDir, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute9(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
23526
23624
  return {
23527
23625
  absolutePath,
@@ -23635,7 +23733,7 @@ var inlineSourceMapComment = (map) => [
23635
23733
  import { existsSync as existsSync39 } from "fs";
23636
23734
  import { mkdir as mkdir9, stat as stat3 } from "fs/promises";
23637
23735
  import {
23638
- dirname as dirname28,
23736
+ dirname as dirname27,
23639
23737
  isAbsolute as isAbsolute10,
23640
23738
  join as join51,
23641
23739
  basename as basename15,
@@ -23654,7 +23752,7 @@ var withResolvedSources = (map, sourceFile) => {
23654
23752
  return map;
23655
23753
  return {
23656
23754
  ...map,
23657
- sources: sources.map((source) => typeof source === "string" && !isAbsolute10(source) ? resolve37(dirname28(sourceFile), source) : source)
23755
+ sources: sources.map((source) => typeof source === "string" && !isAbsolute10(source) ? resolve37(dirname27(sourceFile), source) : source)
23658
23756
  };
23659
23757
  }, resolveDevClientDir2 = () => {
23660
23758
  const projectRoot = process.cwd();
@@ -23692,7 +23790,7 @@ var withResolvedSources = (map, sourceFile) => {
23692
23790
  }, resolveRelativeModule2 = async (spec, from) => {
23693
23791
  if (!spec.startsWith("."))
23694
23792
  return null;
23695
- const basePath = resolve37(dirname28(from), spec);
23793
+ const basePath = resolve37(dirname27(from), spec);
23696
23794
  const candidates = [
23697
23795
  basePath,
23698
23796
  `${basePath}.ts`,
@@ -23719,7 +23817,7 @@ var withResolvedSources = (map, sourceFile) => {
23719
23817
  const resolved = resolvePackageImport(spec);
23720
23818
  return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
23721
23819
  }
23722
- const basePath = resolve37(dirname28(from), spec);
23820
+ const basePath = resolve37(dirname27(from), spec);
23723
23821
  const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
23724
23822
  if (!explicit) {
23725
23823
  const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
@@ -23780,8 +23878,8 @@ var withResolvedSources = (map, sourceFile) => {
23780
23878
  const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
23781
23879
  const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
23782
23880
  const fileRoute = fileRouteFor(src);
23783
- const rawRel = fileRoute ? "pages" : dirname28(relative23(svelteRoot, src)).replace(/\\/g, "/");
23784
- const relDir = rawRel.startsWith("..") ? `_ext/${relative23(process.cwd(), dirname28(src)).replace(/\\/g, "/")}` : rawRel;
23881
+ const rawRel = fileRoute ? "pages" : dirname27(relative23(svelteRoot, src)).replace(/\\/g, "/");
23882
+ const relDir = rawRel.startsWith("..") ? `_ext/${relative23(process.cwd(), dirname27(src)).replace(/\\/g, "/")}` : rawRel;
23785
23883
  const baseName = fileRoute?.name ?? basename15(src).replace(/\.svelte(\.(ts|js))?$/, "");
23786
23884
  const staticImportPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
23787
23885
  const dynamicImportPaths = Array.from(transpiledServer.matchAll(DYNAMIC_IMPORT_PATTERN)).map((match) => match[1]).filter((path) => path !== undefined);
@@ -23792,8 +23890,8 @@ var withResolvedSources = (map, sourceFile) => {
23792
23890
  const childBuilt = await Promise.all(childSources.map((child) => build(child)));
23793
23891
  const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
23794
23892
  const externalRewrites = new Map;
23795
- const ssrOutputDir = dirname28(join51(serverDir, relDir, `${baseName}.js`));
23796
- const clientOutputDir = dirname28(join51(clientDir, relDir, `${baseName}.js`));
23893
+ const ssrOutputDir = dirname27(join51(serverDir, relDir, `${baseName}.js`));
23894
+ const clientOutputDir = dirname27(join51(clientDir, relDir, `${baseName}.js`));
23797
23895
  for (let idx = 0;idx < importPaths.length; idx++) {
23798
23896
  const rawSpec = importPaths[idx];
23799
23897
  if (!rawSpec)
@@ -23877,8 +23975,8 @@ ${componentName}.${LAZY_SOURCE_EXPORT} = ${sourceId};` : "";
23877
23975
  export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
23878
23976
  };
23879
23977
  await Promise.all([
23880
- mkdir9(dirname28(ssrPath), { recursive: true }),
23881
- mkdir9(dirname28(clientPath), { recursive: true })
23978
+ mkdir9(dirname27(ssrPath), { recursive: true }),
23979
+ mkdir9(dirname27(clientPath), { recursive: true })
23882
23980
  ]);
23883
23981
  const inlineMap = (map) => map ? `${inlineSourceMapComment(withResolvedSources(map, src))}
23884
23982
  ` : "";
@@ -23913,10 +24011,10 @@ export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
23913
24011
  const roots = await Promise.all(entryPoints.map(build));
23914
24012
  const componentRoots = roots.filter((root) => !root.isModule);
23915
24013
  await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
23916
- const relClientDir = dirname28(relative23(clientDir, client));
24014
+ const relClientDir = dirname27(relative23(clientDir, client));
23917
24015
  const name = basename15(client, extname16(client));
23918
24016
  const indexPath = join51(indexDir, relClientDir, `${name}.js`);
23919
- const importRaw = relative23(dirname28(indexPath), client).split(sep8).join("/");
24017
+ const importRaw = relative23(dirname27(indexPath), client).split(sep8).join("/");
23920
24018
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
23921
24019
  const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
23922
24020
  import "${hmrClientPath3}";
@@ -24024,13 +24122,13 @@ if (typeof window !== "undefined") {
24024
24122
  setTimeout(releaseStreamingSlots, 0);
24025
24123
  }
24026
24124
  }`;
24027
- await mkdir9(dirname28(indexPath), { recursive: true });
24125
+ await mkdir9(dirname27(indexPath), { recursive: true });
24028
24126
  return write2(indexPath, bootstrap);
24029
24127
  }));
24030
24128
  return {
24031
24129
  svelteClientPaths: roots.map(({ client }) => client),
24032
24130
  svelteIndexPaths: componentRoots.map(({ client }) => {
24033
- const rel = dirname28(relative23(clientDir, client));
24131
+ const rel = dirname27(relative23(clientDir, client));
24034
24132
  return join51(indexDir, rel, basename15(client));
24035
24133
  }),
24036
24134
  svelteServerPaths: roots.map(({ ssr }) => ssr)
@@ -24642,9 +24740,9 @@ __export(exports_emitTsHelpers, {
24642
24740
  emitTsHelpers: () => emitTsHelpers
24643
24741
  });
24644
24742
  var {file: file3, Transpiler: Transpiler4, write: write3 } = globalThis.Bun;
24645
- import { copyFileSync as copyFileSync2, existsSync as existsSync41, readdirSync as readdirSync6, statSync as statSync5 } from "fs";
24743
+ import { copyFileSync as copyFileSync2, existsSync as existsSync41, readdirSync as readdirSync6, statSync as statSync6 } from "fs";
24646
24744
  import { mkdir as mkdir11, rename as rename3, writeFile as writeFile12 } from "fs/promises";
24647
- import { dirname as dirname29, join as join53, resolve as resolve39, sep as sep9 } from "path";
24745
+ import { dirname as dirname28, join as join53, resolve as resolve39, sep as sep9 } from "path";
24648
24746
  var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 24, transpiler4, cacheDir = () => join53(process.cwd(), ".absolutejs", "compile-cache", CACHE_DIR_NAME2), cacheKey2 = (sourcePath, sourceCode) => {
24649
24747
  const frameworkVersion = frameworkVersionForCache();
24650
24748
  if (!frameworkVersion || !vueCompileCacheEnabled())
@@ -24690,8 +24788,8 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 2
24690
24788
  } catch {}
24691
24789
  }, writeBoth = async (clientOutputPath, serverOutputPath, content) => {
24692
24790
  await Promise.all([
24693
- mkdir11(dirname29(clientOutputPath), { recursive: true }),
24694
- mkdir11(dirname29(serverOutputPath), { recursive: true })
24791
+ mkdir11(dirname28(clientOutputPath), { recursive: true }),
24792
+ mkdir11(dirname28(serverOutputPath), { recursive: true })
24695
24793
  ]);
24696
24794
  await Promise.all([
24697
24795
  write3(clientOutputPath, content),
@@ -24699,14 +24797,14 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 2
24699
24797
  ]);
24700
24798
  }, copyBoth = async (clientOutputPath, serverOutputPath, cachedPath) => {
24701
24799
  await Promise.all([
24702
- mkdir11(dirname29(clientOutputPath), { recursive: true }),
24703
- mkdir11(dirname29(serverOutputPath), { recursive: true })
24800
+ mkdir11(dirname28(clientOutputPath), { recursive: true }),
24801
+ mkdir11(dirname28(serverOutputPath), { recursive: true })
24704
24802
  ]);
24705
24803
  copyFileSync2(cachedPath, clientOutputPath);
24706
24804
  copyFileSync2(cachedPath, serverOutputPath);
24707
24805
  }, QUOTES2, MIRRORED_MODULE, IMPORT_CANDIDATE_SUFFIXES, isFilePath = (path) => {
24708
24806
  try {
24709
- return statSync5(path).isFile();
24807
+ return statSync6(path).isFile();
24710
24808
  } catch {
24711
24809
  return false;
24712
24810
  }
@@ -24714,7 +24812,7 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 2
24714
24812
  const base = resolve39(sourceDir, specifier);
24715
24813
  return IMPORT_CANDIDATE_SUFFIXES.map((suffix) => `${base}${suffix}`).find(isFilePath) ?? base;
24716
24814
  }, rewriteMirrorImports = (code, sourcePath) => {
24717
- const sourceDir = dirname29(sourcePath);
24815
+ const sourceDir = dirname28(sourcePath);
24718
24816
  const rewrites = new Map;
24719
24817
  for (const { path } of transpiler4.scanImports(code)) {
24720
24818
  if (!path.startsWith("./") && !path.startsWith("../"))
@@ -24776,7 +24874,7 @@ var init_emitTsHelpers = __esm(() => {
24776
24874
 
24777
24875
  // src/build/inlineCssImports.ts
24778
24876
  import { readFileSync as readFileSync40, realpathSync as realpathSync3 } from "fs";
24779
- import { dirname as dirname30, resolve as resolve40 } from "path";
24877
+ import { dirname as dirname29, resolve as resolve40 } from "path";
24780
24878
  var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
24781
24879
  const resolved = realpathSync3(cssFilePath);
24782
24880
  if (visited.has(resolved))
@@ -24784,7 +24882,7 @@ var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
24784
24882
  visited.add(resolved);
24785
24883
  const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
24786
24884
  return cssContent.replace(importRegex, (match, _quote, relPath) => {
24787
- const importedPath = resolve40(dirname30(cssFilePath), relPath);
24885
+ const importedPath = resolve40(dirname29(cssFilePath), relPath);
24788
24886
  if (!isFile(importedPath))
24789
24887
  return match;
24790
24888
  const importedContent = readFileSync40(importedPath, "utf-8");
@@ -24797,7 +24895,7 @@ var init_inlineCssImports = __esm(() => {
24797
24895
 
24798
24896
  // src/build/compileVueSfc.ts
24799
24897
  import { existsSync as existsSync42, readFileSync as readFileSync41, realpathSync as realpathSync4 } from "fs";
24800
- import { dirname as dirname31, join as join54, relative as relative24, resolve as resolve41 } from "path";
24898
+ import { dirname as dirname30, join as join54, relative as relative24, resolve as resolve41 } from "path";
24801
24899
  var {Transpiler: Transpiler5 } = globalThis.Bun;
24802
24900
  var transpiler5, toJs = (filePath, sourceDir) => {
24803
24901
  if (filePath.endsWith(".vue"))
@@ -24902,7 +25000,7 @@ const ${localName} = (source) => ${importedName}(
24902
25000
  typeDepHashes[dep] = hashContent(readFileSync41(dep, "utf-8"));
24903
25001
  }
24904
25002
  const strippedScript = stripExports2(compiledScript.content);
24905
- const sourceDir = dirname31(sourceFilePath);
25003
+ const sourceDir = dirname30(sourceFilePath);
24906
25004
  const transpiledScript = rewriteRelativeImports(transpiler5.transformSync(strippedScript), sourceDir);
24907
25005
  const generateRenderFunction = (ssr) => {
24908
25006
  const rendered = compiler.compileTemplate({
@@ -24957,7 +25055,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
24957
25055
  let result = code;
24958
25056
  for (const [bareImport, paths] of packageImportRewrites) {
24959
25057
  const targetPath = mode === "server" ? paths.server : paths.client;
24960
- let rel = relative24(dirname31(outputPath), targetPath).replace(/\\/g, "/");
25058
+ let rel = relative24(dirname30(outputPath), targetPath).replace(/\\/g, "/");
24961
25059
  if (!rel.startsWith("."))
24962
25060
  rel = `./${rel}`;
24963
25061
  result = result.replaceAll(bareImport, rel);
@@ -25057,7 +25155,7 @@ var init_workerJobs = __esm(() => {
25057
25155
  // src/build/workerPool.ts
25058
25156
  import { existsSync as existsSync43, readFileSync as readFileSync42 } from "fs";
25059
25157
  import { availableParallelism, freemem } from "os";
25060
- import { dirname as dirname32, join as join55 } from "path";
25158
+ import { dirname as dirname31, join as join55 } from "path";
25061
25159
  import { pathToFileURL as pathToFileURL3 } from "url";
25062
25160
  var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_MEMORY_BUDGET_BYTES, DEFAULT_IDLE_TIMEOUT_MS = 2000, DEFAULT_MIN_BATCH = 4, PACKAGE_WALK_DEPTH = 6, PERCENT2 = 100, OWN_PACKAGE_NAME = "@absolutejs/absolute", parseWorkerOverride = (raw) => {
25063
25161
  if (raw === undefined || raw.trim() === "")
@@ -25088,7 +25186,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
25088
25186
  for (let depth = 0;depth < PACKAGE_WALK_DEPTH; depth++) {
25089
25187
  if (isOwnPackageRoot(dir))
25090
25188
  return dir;
25091
- const parent = dirname32(dir);
25189
+ const parent = dirname31(dir);
25092
25190
  if (parent === dir)
25093
25191
  break;
25094
25192
  dir = parent;
@@ -25384,7 +25482,7 @@ import { existsSync as existsSync44 } from "fs";
25384
25482
  import { mkdir as mkdir12 } from "fs/promises";
25385
25483
  import {
25386
25484
  basename as basename16,
25387
- dirname as dirname33,
25485
+ dirname as dirname32,
25388
25486
  isAbsolute as isAbsolute11,
25389
25487
  join as join56,
25390
25488
  relative as relative25,
@@ -25472,7 +25570,7 @@ var resolveDevClientDir3 = () => {
25472
25570
  if (!inline)
25473
25571
  pool.warm("vue-sfc");
25474
25572
  const runSfc = (input) => pool.run("vue-sfc", input, {
25475
- affinity: dirname33(input.sourceFilePath),
25573
+ affinity: dirname32(input.sourceFilePath),
25476
25574
  inline
25477
25575
  });
25478
25576
  return runSfc;
@@ -25534,9 +25632,9 @@ var resolveDevClientDir3 = () => {
25534
25632
  serverPath
25535
25633
  }) => {
25536
25634
  await Promise.all([
25537
- mkdir12(dirname33(clientPath), { recursive: true }),
25538
- mkdir12(dirname33(serverPath), { recursive: true }),
25539
- ...css ? [mkdir12(dirname33(css.path), { recursive: true })] : []
25635
+ mkdir12(dirname32(clientPath), { recursive: true }),
25636
+ mkdir12(dirname32(serverPath), { recursive: true }),
25637
+ ...css ? [mkdir12(dirname32(css.path), { recursive: true })] : []
25540
25638
  ]);
25541
25639
  await Promise.all([
25542
25640
  write4(clientPath, clientCode),
@@ -25605,12 +25703,12 @@ var resolveDevClientDir3 = () => {
25605
25703
  const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
25606
25704
  const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
25607
25705
  const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
25608
- const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute11(path)) && isStylePath(path)).map((path) => isAbsolute11(path) ? path : resolve42(dirname33(sourceFilePath), path));
25706
+ const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute11(path)) && isStylePath(path)).map((path) => isAbsolute11(path) ? path : resolve42(dirname32(sourceFilePath), path));
25609
25707
  for (const stylePath of stylePathsImported) {
25610
25708
  addStyleImporter(sourceFilePath, stylePath);
25611
25709
  }
25612
25710
  const childBuildResults = await Promise.all([
25613
- ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve42(dirname33(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
25711
+ ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve42(dirname32(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
25614
25712
  ...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors))
25615
25713
  ]);
25616
25714
  const cacheKeyStartedAt = performance.now();
@@ -25679,7 +25777,7 @@ var resolveDevClientDir3 = () => {
25679
25777
  serverPath: serverOutputPath,
25680
25778
  spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
25681
25779
  tsHelperPaths: [
25682
- ...helperModulePaths.map((helper) => resolveHelperTsPath(dirname33(sourceFilePath), helper)),
25780
+ ...helperModulePaths.map((helper) => resolveHelperTsPath(dirname32(sourceFilePath), helper)),
25683
25781
  ...childBuildResults.flatMap((child) => child.tsHelperPaths)
25684
25782
  ]
25685
25783
  };
@@ -25735,7 +25833,7 @@ var resolveDevClientDir3 = () => {
25735
25833
  });
25736
25834
  const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
25737
25835
  for (const { importPath } of routes) {
25738
- const childPath = resolve42(dirname33(entryPath), importPath);
25836
+ const childPath = resolve42(dirname32(entryPath), importPath);
25739
25837
  if (expanded.has(childPath) || !existsSync44(childPath)) {
25740
25838
  continue;
25741
25839
  }
@@ -25770,14 +25868,14 @@ var resolveDevClientDir3 = () => {
25770
25868
  const entryBaseName = basename16(entryPath, ".vue");
25771
25869
  const indexOutputFile = join56(indexOutputDir, `${entryBaseName}.js`);
25772
25870
  const clientOutputFile = result.clientPath;
25773
- await mkdir12(dirname33(indexOutputFile), { recursive: true });
25871
+ await mkdir12(dirname32(indexOutputFile), { recursive: true });
25774
25872
  const vueHmrImports = isDev ? [
25775
25873
  `window.__HMR_FRAMEWORK__ = "vue";`,
25776
25874
  `import "${hmrClientPath4}";`
25777
25875
  ] : [];
25778
25876
  await write4(indexOutputFile, [
25779
25877
  ...vueHmrImports,
25780
- `import Comp, * as PageModule from "${relative25(dirname33(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
25878
+ `import Comp, * as PageModule from "${relative25(dirname32(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
25781
25879
  'import { createSSRApp, createApp } from "vue";',
25782
25880
  'import { prepareBrowserTranslationHydration } from "@absolutejs/absolute/vue";',
25783
25881
  "",
@@ -25943,7 +26041,7 @@ var resolveDevClientDir3 = () => {
25943
26041
  }));
25944
26042
  vueCompileProfile.stagePagesMs = performance.now() - stageStartedAt;
25945
26043
  stageStartedAt = performance.now();
25946
- const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname33(tsPath), dep)).filter((resolved) => existsSync44(resolved) && !allTsHelperPaths.has(resolved));
26044
+ const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname32(tsPath), dep)).filter((resolved) => existsSync44(resolved) && !allTsHelperPaths.has(resolved));
25947
26045
  const readHelperWave = (paths) => Promise.all(paths.map((tsPath) => file4(tsPath).text().then((sourceCode) => helperDependencies(tsPath, sourceCode)).catch(() => [])));
25948
26046
  const expandHelpers = async (frontier) => {
25949
26047
  if (frontier.length === 0)
@@ -26534,7 +26632,7 @@ __export(exports_compileAngular, {
26534
26632
  invalidateAngularJitCache: () => invalidateAngularJitCache
26535
26633
  });
26536
26634
  import { existsSync as existsSync45, readFileSync as readFileSync43, promises as fs5 } from "fs";
26537
- import { join as join57, basename as basename17, sep as sep10, dirname as dirname34, resolve as resolve43, relative as relative26 } from "path";
26635
+ import { join as join57, basename as basename17, sep as sep10, dirname as dirname33, resolve as resolve43, relative as relative26 } from "path";
26538
26636
  var {Glob: Glob8 } = globalThis.Bun;
26539
26637
  var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
26540
26638
  const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
@@ -26659,7 +26757,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
26659
26757
  if (scan.usesLegacyAnimations)
26660
26758
  return true;
26661
26759
  for (const specifier of scan.imports) {
26662
- const importedPath = resolveLocalImport(specifier, dirname34(resolved));
26760
+ const importedPath = resolveLocalImport(specifier, dirname33(resolved));
26663
26761
  if (importedPath && await visit(importedPath, visited)) {
26664
26762
  return true;
26665
26763
  }
@@ -26718,7 +26816,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
26718
26816
  return `${path.replace(/\.ts$/, ".js")}${query}`;
26719
26817
  if (hasJsLikeExtension(path))
26720
26818
  return `${path}${query}`;
26721
- const importerDir = dirname34(importerOutputPath);
26819
+ const importerDir = dirname33(importerOutputPath);
26722
26820
  const fileCandidate = resolve43(importerDir, `${path}.js`);
26723
26821
  if (outputFiles?.has(fileCandidate) || existsSync45(fileCandidate)) {
26724
26822
  return `${path}.js${query}`;
@@ -26751,7 +26849,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
26751
26849
  }, resolveLocalTsImport = (fromFile, specifier) => {
26752
26850
  if (!isRelativeModuleSpecifier(specifier))
26753
26851
  return null;
26754
- const basePath = resolve43(dirname34(fromFile), specifier);
26852
+ const basePath = resolve43(dirname33(fromFile), specifier);
26755
26853
  const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
26756
26854
  `${basePath}.ts`,
26757
26855
  `${basePath}.tsx`,
@@ -26809,13 +26907,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
26809
26907
  return null;
26810
26908
  }
26811
26909
  }, writeResourceCacheFile = async (cachePath, source) => {
26812
- await fs5.mkdir(dirname34(cachePath), { recursive: true });
26910
+ await fs5.mkdir(dirname33(cachePath), { recursive: true });
26813
26911
  await writeTextFileAtomically(cachePath, JSON.stringify({
26814
26912
  source,
26815
26913
  version: 1
26816
26914
  }));
26817
26915
  }, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
26818
- const resourcePaths = collectAngularResourcePaths(source, dirname34(filePath));
26916
+ const resourcePaths = collectAngularResourcePaths(source, dirname33(filePath));
26819
26917
  const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
26820
26918
  const content = await fs5.readFile(resourcePath, "utf-8");
26821
26919
  return `${resourcePath}\x00${content}`;
@@ -26855,7 +26953,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
26855
26953
  transformedSource = cached.source;
26856
26954
  } else {
26857
26955
  stats.cacheMisses += 1;
26858
- const transformed = await inlineResources(source, dirname34(resolvedPath), stylePreprocessors);
26956
+ const transformed = await inlineResources(source, dirname33(resolvedPath), stylePreprocessors);
26859
26957
  transformedSource = transformed.source;
26860
26958
  await writeResourceCacheFile(cachePath, transformedSource);
26861
26959
  }
@@ -26884,7 +26982,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
26884
26982
  const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
26885
26983
  const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
26886
26984
  const tsPath = __require.resolve("typescript");
26887
- const tsRootDir = dirname34(tsPath);
26985
+ const tsRootDir = dirname33(tsPath);
26888
26986
  return tsRootDir.endsWith("lib") ? tsRootDir : resolve43(tsRootDir, "lib");
26889
26987
  });
26890
26988
  const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
@@ -26999,7 +27097,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
26999
27097
  });
27000
27098
  });
27001
27099
  await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
27002
- await fs5.mkdir(dirname34(target), { recursive: true });
27100
+ await fs5.mkdir(dirname33(target), { recursive: true });
27003
27101
  await writeTextFileAtomically(target, content);
27004
27102
  })), { outputs: entries.length });
27005
27103
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
@@ -27356,7 +27454,7 @@ ${fields}
27356
27454
  }
27357
27455
  };
27358
27456
  const toOutputPath = (sourcePath) => {
27359
- const inputDir = dirname34(sourcePath);
27457
+ const inputDir = dirname33(sourcePath);
27360
27458
  const fileBase = basename17(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
27361
27459
  if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep10}`)) {
27362
27460
  return join57(inputDir, fileBase);
@@ -27410,7 +27508,7 @@ ${fields}
27410
27508
  return;
27411
27509
  visited.add(resolved);
27412
27510
  if (resolved.endsWith(".json") && existsSync45(resolved)) {
27413
- const inputDir = dirname34(resolved);
27511
+ const inputDir = dirname33(resolved);
27414
27512
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
27415
27513
  const targetDir = join57(outDir, relativeDir);
27416
27514
  const targetPath = join57(targetDir, basename17(resolved));
@@ -27425,12 +27523,12 @@ ${fields}
27425
27523
  if (!existsSync45(actualPath))
27426
27524
  return;
27427
27525
  let sourceCode = await fs5.readFile(actualPath, "utf-8");
27428
- const inlined = await inlineResources(sourceCode, dirname34(actualPath), stylePreprocessors);
27429
- sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname34(actualPath)).source;
27430
- const inputDir = dirname34(actualPath);
27526
+ const inlined = await inlineResources(sourceCode, dirname33(actualPath), stylePreprocessors);
27527
+ sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname33(actualPath)).source;
27528
+ const inputDir = dirname33(actualPath);
27431
27529
  const fileBase = basename17(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
27432
27530
  const targetPath = toOutputPath(actualPath);
27433
- const targetDir = dirname34(targetPath);
27531
+ const targetDir = dirname33(targetPath);
27434
27532
  const relativeDir = relative26(outDir, targetDir).replace(/\\/g, "/");
27435
27533
  const localImports = [];
27436
27534
  const importRewrites = new Map;
@@ -27544,7 +27642,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
27544
27642
  const sourcePath = join57(angularSrcDir, rel);
27545
27643
  const cwdRel = relative26(cwd, sourcePath);
27546
27644
  const targetPath = join57(compiledRoot, cwdRel);
27547
- await fs5.mkdir(dirname34(targetPath), { recursive: true });
27645
+ await fs5.mkdir(dirname33(targetPath), { recursive: true });
27548
27646
  await fs5.copyFile(sourcePath, targetPath);
27549
27647
  }
27550
27648
  });
@@ -27653,7 +27751,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
27653
27751
  return join57(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
27654
27752
  })();
27655
27753
  const appProvidersSpec = (() => {
27656
- const rel = relative26(dirname34(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
27754
+ const rel = relative26(dirname33(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
27657
27755
  return rel.startsWith(".") ? rel : `./${rel}`;
27658
27756
  })();
27659
27757
  importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
@@ -27693,7 +27791,7 @@ import '@angular/compiler';
27693
27791
  import { bootstrapApplication } from '@angular/platform-browser';
27694
27792
  import { provideClientHydration } from '@angular/platform-browser';
27695
27793
  import { withHttpTransferCacheOptions } from '@angular/platform-browser';
27696
- import { ${changeDetectionImport}, REQUEST_CONTEXT } from '@angular/core';
27794
+ import { ${changeDetectionImport}, CSP_NONCE, REQUEST_CONTEXT } from '@angular/core';
27697
27795
  import { APP_BASE_HREF as __abs_APP_BASE_HREF } from '@angular/common';
27698
27796
  import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
27699
27797
  import * as pageModule from '${normalizedImportPath}';
@@ -27710,6 +27808,12 @@ var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-ra
27710
27808
  var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
27711
27809
  var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
27712
27810
  var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
27811
+ // Under secureHeaders() the policy only allows <style> elements that carry
27812
+ // the page's nonce. Angular adds one for every component it renders or
27813
+ // hot-updates in the browser, so hand it the nonce the server put on the
27814
+ // page (browsers hide the attribute's value; the property keeps it).
27815
+ var cspNonce = (document.querySelector('script[nonce], style[nonce]') || {}).nonce;
27816
+ if (cspNonce) contextProviders.push({ provide: CSP_NONCE, useValue: cspNonce });
27713
27817
  // Page-level providers are injected directly into the page module's
27714
27818
  // server output by \`compileAngular\`'s providers-injection step
27715
27819
  // (\`...appProviders, provideRouter(routes), { APP_BASE_HREF }\`),
@@ -27813,7 +27917,7 @@ ${zoneImport}import '@angular/compiler';
27813
27917
  import { bootstrapApplication } from '@angular/platform-browser';
27814
27918
  import { provideClientHydration } from '@angular/platform-browser';
27815
27919
  import { withHttpTransferCacheOptions } from '@angular/platform-browser';
27816
- import { enableProdMode, ${changeDetectionImport}, REQUEST_CONTEXT } from '@angular/core';
27920
+ import { enableProdMode, ${changeDetectionImport}, CSP_NONCE, REQUEST_CONTEXT } from '@angular/core';
27817
27921
  import { APP_BASE_HREF as __abs_APP_BASE_HREF } from '@angular/common';
27818
27922
  import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
27819
27923
  import * as pageModule from '${normalizedImportPath}';
@@ -27830,6 +27934,12 @@ var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-ra
27830
27934
  var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
27831
27935
  var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
27832
27936
  var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
27937
+ // Under secureHeaders() the policy only allows <style> elements that carry
27938
+ // the page's nonce. Angular adds one for every component it renders or
27939
+ // hot-updates in the browser, so hand it the nonce the server put on the
27940
+ // page (browsers hide the attribute's value; the property keeps it).
27941
+ var cspNonce = (document.querySelector('script[nonce], style[nonce]') || {}).nonce;
27942
+ if (cspNonce) contextProviders.push({ provide: CSP_NONCE, useValue: cspNonce });
27833
27943
  // Page-level providers are injected directly into the page module's
27834
27944
  // server output by \`compileAngular\`'s providers-injection step
27835
27945
  // (\`...appProviders, provideRouter(routes), { APP_BASE_HREF }\`),
@@ -28383,7 +28493,7 @@ var require_node = __commonJS(function(exports, module) {
28383
28493
  // src/build/compileEmber.ts
28384
28494
  import { existsSync as existsSync46 } from "fs";
28385
28495
  import { mkdir as mkdir13, rm as rm10 } from "fs/promises";
28386
- import { basename as basename18, dirname as dirname35, extname as extname17, join as join58, resolve as resolve44 } from "path";
28496
+ import { basename as basename18, dirname as dirname34, extname as extname17, join as join58, resolve as resolve44 } from "path";
28387
28497
  var {build: bunBuild3, Transpiler: Transpiler6, write: write5, file: file5 } = globalThis.Bun;
28388
28498
  var cachedPreprocessor = null, getPreprocessor = async () => {
28389
28499
  if (cachedPreprocessor)
@@ -28479,7 +28589,7 @@ export const importSync = (specifier) => {
28479
28589
  const originalImporter = stagedSourceMap.get(args.importer);
28480
28590
  if (!originalImporter)
28481
28591
  return;
28482
- const candidateBase = resolve44(dirname35(originalImporter), args.path);
28592
+ const candidateBase = resolve44(dirname34(originalImporter), args.path);
28483
28593
  const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
28484
28594
  for (const ext of extensionsToTry) {
28485
28595
  const candidate = candidateBase + ext;
@@ -29092,12 +29202,12 @@ import {
29092
29202
  readFileSync as readFileSync44,
29093
29203
  renameSync,
29094
29204
  rmSync as rmSync2,
29095
- statSync as statSync6,
29205
+ statSync as statSync7,
29096
29206
  writeFileSync as writeFileSync16
29097
29207
  } from "fs";
29098
29208
  import {
29099
29209
  basename as basename19,
29100
- dirname as dirname36,
29210
+ dirname as dirname35,
29101
29211
  extname as extname18,
29102
29212
  join as join63,
29103
29213
  relative as relative27,
@@ -29304,7 +29414,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
29304
29414
  }, SKIP_DIRS5, addWorkerPathIfExists = (file, relPath, workerPaths) => {
29305
29415
  const absPath = resolve46(file, "..", relPath);
29306
29416
  try {
29307
- statSync6(absPath);
29417
+ statSync7(absPath);
29308
29418
  workerPaths.add(absPath);
29309
29419
  } catch {}
29310
29420
  }, extractWorkerSpecifiers = (file, patterns) => {
@@ -29449,7 +29559,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
29449
29559
  for (const srcPath of urlReferencedFiles) {
29450
29560
  const rel = relative27(projectRoot, srcPath).replace(/\\/g, "/");
29451
29561
  const name = basename19(srcPath);
29452
- const mtime = Math.round(statSync6(srcPath).mtimeMs);
29562
+ const mtime = Math.round(statSync7(srcPath).mtimeMs);
29453
29563
  const url = `/@src/${rel}?v=${mtime}`;
29454
29564
  urlFileMap.set(name, url);
29455
29565
  urlFileMap.set(name.replace(/\.tsx?$/, ".js"), url);
@@ -29693,7 +29803,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
29693
29803
  const sourceClientRoots = [
29694
29804
  htmlDir,
29695
29805
  htmxDir,
29696
- islandBootstrapPath && dirname36(islandBootstrapPath)
29806
+ islandBootstrapPath && dirname35(islandBootstrapPath)
29697
29807
  ].filter((dir) => Boolean(dir));
29698
29808
  const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
29699
29809
  if (usesGenerated)
@@ -30149,7 +30259,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
30149
30259
  stylePreprocessorPlugin,
30150
30260
  createBunStringRawUnicodePlugin()
30151
30261
  ],
30152
- root: dirname36(source),
30262
+ root: dirname35(source),
30153
30263
  target: "bun",
30154
30264
  throw: false,
30155
30265
  ...projectTsconfig()
@@ -30242,7 +30352,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
30242
30352
  ...islandBootstrapPath ? [islandBootstrapPath] : []
30243
30353
  ];
30244
30354
  const [onlyWorkerClientEntry] = urlReferencedFiles;
30245
- const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname36(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file) => dirname36(file)), projectRoot);
30355
+ const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname35(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file) => dirname35(file)), projectRoot);
30246
30356
  const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
30247
30357
  buildInfo: islandBuildInfo,
30248
30358
  buildPath,
@@ -30676,7 +30786,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
30676
30786
  if (serverOutputs.length > 0 && angularServerVendorPaths && Object.keys(angularServerVendorPaths).length > 0) {
30677
30787
  await Promise.resolve().then(() => init_rewriteImportsPlugin());
30678
30788
  await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith(serverOutputs, (artifact) => {
30679
- const fileDir = dirname36(artifact.path);
30789
+ const fileDir = dirname35(artifact.path);
30680
30790
  const relativePaths = {};
30681
30791
  for (const [specifier, absolute] of Object.entries(angularServerVendorPaths)) {
30682
30792
  const rel = relative27(fileDir, absolute);
@@ -30909,9 +31019,18 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
30909
31019
  recordManifestKey(basename19(htmxFile, ".html"), htmxFile, join63(htmxPagesPath, relative27(outputHtmxPages, htmxFile)));
30910
31020
  }
30911
31021
  };
31022
+ const processStaticConventions = async () => {
31023
+ const conventionDirs = ["html", "htmx"].filter((framework) => conventionsMap[framework]).map((framework) => join63(buildPath, "conventions", framework)).filter((dir) => existsSync48(dir));
31024
+ await Promise.all(conventionDirs.map(async (dir) => {
31025
+ await updateAssetPaths(manifest, dir);
31026
+ if (fonts && fonts.injectHtml !== false)
31027
+ await injectFontTags(dir, fontAssets(manifest));
31028
+ }));
31029
+ };
30912
31030
  await Promise.all([
30913
31031
  tracePhase("postprocess/html-pages", processHtmlPages),
30914
- tracePhase("postprocess/htmx-pages", processHtmxPages)
31032
+ tracePhase("postprocess/htmx-pages", processHtmxPages),
31033
+ tracePhase("postprocess/static-conventions", processStaticConventions)
30915
31034
  ]);
30916
31035
  if (manifestKeyCollisions.length > 0) {
30917
31036
  const message = formatManifestKeyCollisions(manifestKeyCollisions, projectRoot);
@@ -31781,7 +31900,7 @@ var init_clientManager = __esm(() => {
31781
31900
 
31782
31901
  // src/dev/pathUtils.ts
31783
31902
  import { existsSync as existsSync51, readdirSync as readdirSync8, readFileSync as readFileSync47 } from "fs";
31784
- import { dirname as dirname37, resolve as resolve49 } from "path";
31903
+ import { dirname as dirname36, resolve as resolve49 } from "path";
31785
31904
  var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
31786
31905
  if (shouldIgnorePath(filePath, resolved)) {
31787
31906
  return "ignored";
@@ -31914,10 +32033,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
31914
32033
  refs.push(strMatch[1]);
31915
32034
  }
31916
32035
  }
31917
- const componentDir = dirname37(full);
32036
+ const componentDir = dirname36(full);
31918
32037
  for (const ref of refs) {
31919
32038
  const refAbs = normalizePath2(resolve49(componentDir, ref));
31920
- const refDir = normalizePath2(dirname37(refAbs));
32039
+ const refDir = normalizePath2(dirname36(refAbs));
31921
32040
  if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
31922
32041
  continue;
31923
32042
  }
@@ -31979,6 +32098,13 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
31979
32098
  }
31980
32099
  } catch {}
31981
32100
  }
32101
+ const registryPath = config.islands?.registry;
32102
+ if (registryPath) {
32103
+ const registryDir = normalizePath2(dirname36(resolve49(cwd, registryPath)));
32104
+ const isWatched = roots.some((root) => registryDir === root || registryDir.startsWith(`${root}/`));
32105
+ if (!isWatched && registryDir !== normalizePath2(cwd))
32106
+ push(registryDir);
32107
+ }
31982
32108
  const extraDirs = config.dev?.watchDirs ?? [];
31983
32109
  for (const dir of extraDirs)
31984
32110
  push(dir);
@@ -32157,8 +32283,8 @@ var init_editorTempFiles = __esm(() => {
32157
32283
 
32158
32284
  // src/dev/fileWatcher.ts
32159
32285
  import { watch } from "fs";
32160
- import { existsSync as existsSync53, readdirSync as readdirSync10, statSync as statSync7 } from "fs";
32161
- import { dirname as dirname38, join as join67, resolve as resolve50 } from "path";
32286
+ import { existsSync as existsSync53, readdirSync as readdirSync10, statSync as statSync8 } from "fs";
32287
+ import { dirname as dirname37, join as join67, resolve as resolve50 } from "path";
32162
32288
  var safeRemoveFromGraph = (graph, fullPath) => {
32163
32289
  try {
32164
32290
  removeFileFromGraph(graph, fullPath);
@@ -32195,7 +32321,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
32195
32321
  continue;
32196
32322
  let st;
32197
32323
  try {
32198
- st = statSync7(child);
32324
+ st = statSync8(child);
32199
32325
  } catch {
32200
32326
  continue;
32201
32327
  }
@@ -32213,7 +32339,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
32213
32339
  return;
32214
32340
  if (shouldSkipFilename(filename, isStylesDir)) {
32215
32341
  if (event === "rename") {
32216
- const eventDir = dirname38(join67(absolutePath, filename)).replace(/\\/g, "/");
32342
+ const eventDir = dirname37(join67(absolutePath, filename)).replace(/\\/g, "/");
32217
32343
  atomicRecoveryScan(eventDir);
32218
32344
  for (const delay of [25, 100]) {
32219
32345
  const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
@@ -32259,7 +32385,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
32259
32385
  ];
32260
32386
  const fingerprint = (name) => {
32261
32387
  try {
32262
- const value = statSync7(join67(root, name));
32388
+ const value = statSync8(join67(root, name));
32263
32389
  return value.isFile() ? `${value.ino}:${value.size}:${value.mtimeMs}:${value.ctimeMs}` : null;
32264
32390
  } catch {
32265
32391
  return null;
@@ -32326,9 +32452,9 @@ var init_fileWatcher = __esm(() => {
32326
32452
  });
32327
32453
 
32328
32454
  // src/build/svelteDeclarations.ts
32329
- import { existsSync as existsSync54, readdirSync as readdirSync11, readFileSync as readFileSync48, statSync as statSync8 } from "fs";
32455
+ import { existsSync as existsSync54, readdirSync as readdirSync11, readFileSync as readFileSync48, statSync as statSync9 } from "fs";
32330
32456
  import { mkdir as mkdir15, rename as rename5, rm as rm16, writeFile as writeFile14 } from "fs/promises";
32331
- import { dirname as dirname39, join as join68, relative as relative28, resolve as resolve51 } from "path";
32457
+ import { dirname as dirname38, join as join68, relative as relative28, resolve as resolve51 } from "path";
32332
32458
  var SVELTE_DECLARATIONS_ROOT = ".absolutejs/types/svelte", FINGERPRINT_FILE = ".fingerprint", SKIPPED_DIRECTORIES, EMIT_SCRIPT = `
32333
32459
  const { resolve, sep } = require('node:path');
32334
32460
  const { shimsPath, stagingDir, svelte2tsxPath, svelteDir, tsconfigPath, typescriptPath } =
@@ -32384,10 +32510,10 @@ emitDts({
32384
32510
  return SKIPPED_DIRECTORIES.has(entry.name) ? [] : collectInputs(path);
32385
32511
  if (!DECLARATION_INPUT.test(entry.name))
32386
32512
  return [];
32387
- const { mtimeMs, size } = statSync8(path);
32513
+ const { mtimeMs, size } = statSync9(path);
32388
32514
  return [`${path}\x00${mtimeMs}\x00${size}`];
32389
32515
  }), fingerprintOf = (svelteDir, tsconfigPath, svelte2tsxPath) => {
32390
- const svelte2tsxManifest = join68(dirname39(svelte2tsxPath), "package.json");
32516
+ const svelte2tsxManifest = join68(dirname38(svelte2tsxPath), "package.json");
32391
32517
  const inputs = [
32392
32518
  ...collectInputs(svelteDir).sort(),
32393
32519
  readFileSync48(tsconfigPath, "utf-8"),
@@ -32414,7 +32540,7 @@ emitDts({
32414
32540
  const shimsPath = resolveFrom("svelte2tsx/svelte-shims-v4.d.ts", projectRoot);
32415
32541
  if (!svelte2tsxPath || !shimsPath)
32416
32542
  return { reason: "svelte2tsx is not installed", status: "unavailable" };
32417
- const typescriptPath = resolveFrom("typescript", dirname39(svelte2tsxPath));
32543
+ const typescriptPath = resolveFrom("typescript", dirname38(svelte2tsxPath));
32418
32544
  if (!typescriptPath)
32419
32545
  return { reason: "typescript is not installed", status: "unavailable" };
32420
32546
  const outDir = join68(projectRoot, SVELTE_DECLARATIONS_ROOT, relative28(projectRoot, svelteDir));
@@ -32442,7 +32568,7 @@ emitDts({
32442
32568
  }
32443
32569
  await mkdir15(stagingDir, { recursive: true });
32444
32570
  await writeFile14(join68(stagingDir, FINGERPRINT_FILE), fingerprint);
32445
- await mkdir15(dirname39(outDir), { recursive: true });
32571
+ await mkdir15(dirname38(outDir), { recursive: true });
32446
32572
  await rm16(outDir, { force: true, recursive: true });
32447
32573
  await rename5(stagingDir, outDir);
32448
32574
  return {
@@ -32673,19 +32799,25 @@ var init_assetStore = __esm(() => {
32673
32799
  });
32674
32800
 
32675
32801
  // src/dev/restartScope.ts
32676
- import { realpathSync as realpathSync7 } from "fs";
32802
+ import { realpathSync as realpathSync7, statSync as statSync10 } from "fs";
32677
32803
  var MODULE_FILE, DOCUMENT_FILE, realPath = (path) => {
32678
32804
  try {
32679
32805
  return realpathSync7(path);
32680
32806
  } catch {
32681
32807
  return path;
32682
32808
  }
32809
+ }, isDirectory = (path) => {
32810
+ try {
32811
+ return statSync10(path).isDirectory();
32812
+ } catch {
32813
+ return false;
32814
+ }
32683
32815
  }, isLoadedByThisProcess = (path) => (path in __require.cache) || (realPath(path) in __require.cache), changeNeedsRestart = (path, isLoaded = isLoadedByThisProcess) => {
32684
32816
  if (DOCUMENT_FILE.test(path) || isTestSourcePath(path))
32685
32817
  return false;
32686
32818
  if (MODULE_FILE.test(path))
32687
32819
  return isLoaded(path);
32688
- return true;
32820
+ return !isDirectory(path);
32689
32821
  };
32690
32822
  var init_restartScope = __esm(() => {
32691
32823
  MODULE_FILE = /\.(?:[cm]?[jt]sx?|mts|cts)$/;
@@ -32693,7 +32825,7 @@ var init_restartScope = __esm(() => {
32693
32825
  });
32694
32826
 
32695
32827
  // src/dev/fileHashTracker.ts
32696
- import { readFileSync as readFileSync49, statSync as statSync9 } from "fs";
32828
+ import { readFileSync as readFileSync49, statSync as statSync11 } from "fs";
32697
32829
  var computeFileHash = (filePath) => {
32698
32830
  try {
32699
32831
  const fileContent = readFileSync49(filePath);
@@ -32712,7 +32844,7 @@ var computeFileHash = (filePath) => {
32712
32844
  if (previousHashes.has(normalizePath2(filePath)))
32713
32845
  return false;
32714
32846
  try {
32715
- return statSync9(filePath).mtimeMs < processStart;
32847
+ return statSync11(filePath).mtimeMs < processStart;
32716
32848
  } catch {
32717
32849
  return false;
32718
32850
  }
@@ -32942,7 +33074,7 @@ var init_reactServerComponentsRebuild = __esm(() => {
32942
33074
 
32943
33075
  // src/utils/spaRouteCss.ts
32944
33076
  import { readFile as readFile10 } from "fs/promises";
32945
- import { dirname as dirname40, isAbsolute as isAbsolute12, resolve as resolve57 } from "path";
33077
+ import { dirname as dirname39, isAbsolute as isAbsolute12, resolve as resolve57 } from "path";
32946
33078
  var sideManifestCache, readSideManifest = async (sideManifestPath) => {
32947
33079
  const cached = sideManifestCache.get(sideManifestPath);
32948
33080
  if (cached !== undefined)
@@ -32980,7 +33112,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
32980
33112
  }, readChildCss = async (cssPath, sideManifestPath) => {
32981
33113
  if (!cssPath)
32982
33114
  return "";
32983
- const resolvedCssPath = isAbsolute12(cssPath) ? cssPath : resolve57(dirname40(sideManifestPath), cssPath);
33115
+ const resolvedCssPath = isAbsolute12(cssPath) ? cssPath : resolve57(dirname39(sideManifestPath), cssPath);
32984
33116
  const cached = childCssCache.get(resolvedCssPath);
32985
33117
  if (cached !== undefined)
32986
33118
  return cached;
@@ -33064,8 +33196,8 @@ __export(exports_resolveOwningComponents, {
33064
33196
  resolveDescendantsOfParent: () => resolveDescendantsOfParent,
33065
33197
  resolveOwningComponents: () => resolveOwningComponents
33066
33198
  });
33067
- import { readdirSync as readdirSync12, readFileSync as readFileSync50, statSync as statSync10 } from "fs";
33068
- import { dirname as dirname41, extname as extname19, join as join69, resolve as resolve58 } from "path";
33199
+ import { readdirSync as readdirSync12, readFileSync as readFileSync50, statSync as statSync12 } from "fs";
33200
+ import { dirname as dirname40, extname as extname19, join as join69, resolve as resolve58 } from "path";
33069
33201
  var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
33070
33202
  const out = [];
33071
33203
  const visit = (dir) => {
@@ -33198,7 +33330,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
33198
33330
  }
33199
33331
  let rootStat;
33200
33332
  try {
33201
- rootStat = statSync10(userAngularRoot);
33333
+ rootStat = statSync12(userAngularRoot);
33202
33334
  } catch {
33203
33335
  return out;
33204
33336
  }
@@ -33218,7 +33350,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
33218
33350
  return null;
33219
33351
  }
33220
33352
  const sourceFile = lazyTypescript.createSourceFile(childFilePath, source, lazyTypescript.ScriptTarget.ES2022, true, lazyTypescript.ScriptKind.TS);
33221
- const childDir = dirname41(childFilePath);
33353
+ const childDir = dirname40(childFilePath);
33222
33354
  for (const stmt of sourceFile.statements) {
33223
33355
  if (!lazyTypescript.isImportDeclaration(stmt))
33224
33356
  continue;
@@ -33256,7 +33388,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
33256
33388
  const angularRootNorm = safeNormalize(angularRoot);
33257
33389
  for (const candidate of candidates) {
33258
33390
  try {
33259
- if (statSync10(candidate).isFile()) {
33391
+ if (statSync12(candidate).isFile()) {
33260
33392
  const norm = safeNormalize(candidate);
33261
33393
  if (!norm.startsWith(angularRootNorm))
33262
33394
  return null;
@@ -33275,7 +33407,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
33275
33407
  const parentFile = new Map;
33276
33408
  for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
33277
33409
  const classes = parseDecoratedClasses(tsPath);
33278
- const componentDir = dirname41(tsPath);
33410
+ const componentDir = dirname40(tsPath);
33279
33411
  for (const cls of classes) {
33280
33412
  const entity = {
33281
33413
  className: cls.className,
@@ -33313,7 +33445,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
33313
33445
  const norm = safeNormalize(params.changedFilePath);
33314
33446
  let rootStat;
33315
33447
  try {
33316
- rootStat = statSync10(params.userAngularRoot);
33448
+ rootStat = statSync12(params.userAngularRoot);
33317
33449
  } catch {
33318
33450
  return [];
33319
33451
  }
@@ -33547,8 +33679,8 @@ __export(exports_moduleServer, {
33547
33679
  warmPage: () => warmPage,
33548
33680
  warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
33549
33681
  });
33550
- import { existsSync as existsSync55, readFileSync as readFileSync51, realpathSync as realpathSync8, statSync as statSync11 } from "fs";
33551
- import { basename as basename21, dirname as dirname42, extname as extname20, join as join70, resolve as resolve59, relative as relative30 } from "path";
33682
+ import { existsSync as existsSync55, readFileSync as readFileSync51, realpathSync as realpathSync8, statSync as statSync13 } from "fs";
33683
+ import { basename as basename21, dirname as dirname41, extname as extname20, join as join70, resolve as resolve59, relative as relative30 } from "path";
33552
33684
  var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
33553
33685
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
33554
33686
  const allExports = [];
@@ -33605,7 +33737,7 @@ ${stubs}
33605
33737
  if (cached !== undefined)
33606
33738
  return `${base}?v=${buildVersion(cached, absPath)}`;
33607
33739
  try {
33608
- const mtime = Math.round(statSync11(absPath).mtimeMs);
33740
+ const mtime = Math.round(statSync13(absPath).mtimeMs);
33609
33741
  mtimeCache.set(absPath, mtime);
33610
33742
  return `${base}?v=${buildVersion(mtime, absPath)}`;
33611
33743
  } catch {
@@ -33682,7 +33814,7 @@ ${stubs}
33682
33814
  };
33683
33815
  result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
33684
33816
  result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
33685
- const fileDir = dirname42(filePath);
33817
+ const fileDir = dirname41(filePath);
33686
33818
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
33687
33819
  result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
33688
33820
  result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
@@ -33922,7 +34054,7 @@ ${code}`;
33922
34054
  if (compiled.css?.code) {
33923
34055
  const cssPath = `${filePath}.css`;
33924
34056
  svelteExternalCss.set(cssPath, compiled.css.code);
33925
- const cssUrl = srcUrl(relative30(projectRoot, cssPath), projectRoot);
34057
+ const cssUrl = `${SRC_PREFIX}${encodeSrcPath(relative30(projectRoot, cssPath))}?v=${Bun.hash(compiled.css.code).toString(BASE_36_RADIX)}`;
33926
34058
  code = `import "${cssUrl}";
33927
34059
  ${code}`;
33928
34060
  }
@@ -33931,7 +34063,7 @@ ${code}`;
33931
34063
  ` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
33932
34064
  ` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
33933
34065
  return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
33934
- }, svelteLazyRegistrations = (raw, filePath, projectRoot) => Array.from(raw.matchAll(/\bimport\s*\(\s*['"](\.[^'"]+\.svelte)['"]\s*\)/g)).map((match) => match[1]).filter((spec) => spec !== undefined).filter((spec) => existsSync55(resolve59(dirname42(filePath), spec))).map((spec) => lazyModuleRegistration(relative30(projectRoot, resolve59(dirname42(filePath), spec)).replace(/\\/g, "/"), spec)).join(""), transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
34066
+ }, svelteLazyRegistrations = (raw, filePath, projectRoot) => Array.from(raw.matchAll(/\bimport\s*\(\s*['"](\.[^'"]+\.svelte)['"]\s*\)/g)).map((match) => match[1]).filter((spec) => spec !== undefined).filter((spec) => existsSync55(resolve59(dirname41(filePath), spec))).map((spec) => lazyModuleRegistration(relative30(projectRoot, resolve59(dirname41(filePath), spec)).replace(/\\/g, "/"), spec)).join(""), transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
33935
34067
  const raw = readFileSync51(filePath, "utf-8");
33936
34068
  if (!svelteCompiler) {
33937
34069
  svelteCompiler = await import("svelte/compiler");
@@ -34250,7 +34382,7 @@ export default {};
34250
34382
  return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
34251
34383
  if (!TRANSPILABLE.has(ext))
34252
34384
  return;
34253
- const stat = statSync11(filePath);
34385
+ const stat = statSync13(filePath);
34254
34386
  const resolvedVueDir = vueDir ? resolve59(vueDir) : undefined;
34255
34387
  let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
34256
34388
  const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
@@ -34278,12 +34410,12 @@ export default {};
34278
34410
  cachedAngularUserRoot = configuredAngularUserRoot ?? null;
34279
34411
  return cachedAngularUserRoot;
34280
34412
  }, configuredAngularUserRoot, transformAndCacheSvelte = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
34281
- const stat = statSync11(filePath);
34413
+ const stat = statSync13(filePath);
34282
34414
  const content = await transformSvelteFile(filePath, projectRoot, rewriter, stylePreprocessors);
34283
34415
  setTransformed(filePath, content, stat.mtimeMs, extractImportedFiles(content, projectRoot));
34284
34416
  return jsResponse(content);
34285
34417
  }, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
34286
- const stat = statSync11(filePath);
34418
+ const stat = statSync13(filePath);
34287
34419
  const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
34288
34420
  setTransformed(filePath, content, stat.mtimeMs, extractImportedFiles(content, projectRoot));
34289
34421
  return jsResponse(content);
@@ -34587,7 +34719,7 @@ var init_rewriteImports = __esm(() => {
34587
34719
  });
34588
34720
 
34589
34721
  // src/dev/angular/hmrCompiler.ts
34590
- import { dirname as dirname43, relative as relative31, resolve as resolve60 } from "path";
34722
+ import { dirname as dirname42, relative as relative31, resolve as resolve60 } from "path";
34591
34723
  import { performance as performance2 } from "perf_hooks";
34592
34724
  var encodeHmrComponentId = (absoluteFilePath, className) => {
34593
34725
  const projectRel = relative31(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
@@ -34610,7 +34742,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
34610
34742
  await Promise.resolve().then(() => init_resolveOwningComponents());
34611
34743
  const owners = resolveOwningComponents({
34612
34744
  changedFilePath: componentFilePath,
34613
- userAngularRoot: dirname43(componentFilePath)
34745
+ userAngularRoot: dirname42(componentFilePath)
34614
34746
  });
34615
34747
  const owner = owners.find((o) => o.className === className);
34616
34748
  const kind = owner?.kind ?? "component";
@@ -34746,8 +34878,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
34746
34878
  var init_simpleHTMXHMR = () => {};
34747
34879
 
34748
34880
  // src/dev/backendGraph.ts
34749
- import { readFileSync as readFileSync52, realpathSync as realpathSync9, statSync as statSync12 } from "fs";
34750
- import { dirname as dirname44, extname as extname21, resolve as resolve63 } from "path";
34881
+ import { readFileSync as readFileSync52, realpathSync as realpathSync9, statSync as statSync14 } from "fs";
34882
+ import { dirname as dirname43, extname as extname21, resolve as resolve63 } from "path";
34751
34883
  var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
34752
34884
  const loader = LOADERS[extname21(path)] ?? "ts";
34753
34885
  const existing = transpilers.get(loader);
@@ -34764,14 +34896,14 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
34764
34896
  }
34765
34897
  }, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) && resolve63(path).startsWith(resolve63(root)), resolveImport = (specifier, fromFile) => {
34766
34898
  try {
34767
- return realPath2(Bun.resolveSync(specifier, dirname44(fromFile)));
34899
+ return realPath2(Bun.resolveSync(specifier, dirname43(fromFile)));
34768
34900
  } catch {
34769
34901
  return;
34770
34902
  }
34771
34903
  }, readImports = (path) => {
34772
34904
  let mtimeMs;
34773
34905
  try {
34774
- ({ mtimeMs } = statSync12(path));
34906
+ ({ mtimeMs } = statSync14(path));
34775
34907
  } catch {
34776
34908
  fileCache.delete(path);
34777
34909
  return [];
@@ -34823,7 +34955,7 @@ var init_backendGraph = __esm(() => {
34823
34955
  });
34824
34956
 
34825
34957
  // src/dev/hot/analyze.ts
34826
- import { dirname as dirname45, extname as extname22 } from "path";
34958
+ import { dirname as dirname44, extname as extname22 } from "path";
34827
34959
  var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
34828
34960
  switch (extname22(path)) {
34829
34961
  case ".tsx":
@@ -35581,7 +35713,7 @@ var ANALYZER_VERSION = 2, hashText = (text) => Bun.hash(text).toString(36), scri
35581
35713
  return analysis;
35582
35714
  }, resolveFrom2 = (fromFile, isManaged) => (specifier) => {
35583
35715
  try {
35584
- const resolved = Bun.resolveSync(specifier, dirname45(fromFile));
35716
+ const resolved = Bun.resolveSync(specifier, dirname44(fromFile));
35585
35717
  return isManaged(resolved) ? resolved : undefined;
35586
35718
  } catch {
35587
35719
  return;
@@ -35939,10 +36071,10 @@ var init_reload = __esm(() => {
35939
36071
  });
35940
36072
 
35941
36073
  // src/dev/rebuildTrigger.ts
35942
- import { existsSync as existsSync56, readdirSync as readdirSync13, rmSync as rmSync4, statSync as statSync13 } from "fs";
36074
+ import { existsSync as existsSync56, readdirSync as readdirSync13, rmSync as rmSync4, statSync as statSync15 } from "fs";
35943
36075
  import {
35944
36076
  basename as basename22,
35945
- dirname as dirname46,
36077
+ dirname as dirname45,
35946
36078
  isAbsolute as isAbsolute13,
35947
36079
  join as join72,
35948
36080
  relative as relative34,
@@ -36297,6 +36429,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
36297
36429
  if (!hasFileChanged(filePath, currentHash, state.fileHashes)) {
36298
36430
  return;
36299
36431
  }
36432
+ if (framework === "unknown")
36433
+ state.fileHashes.set(normalizePath2(filePath), currentHash);
36300
36434
  const { publicDir } = state.resolvedPaths;
36301
36435
  const { assetsDir } = state.resolvedPaths;
36302
36436
  const handleStaticMirror = async (sourceDir, urlPrefix) => {
@@ -36311,7 +36445,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
36311
36445
  const { buildDir } = state.resolvedPaths;
36312
36446
  const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
36313
36447
  const { mkdir, copyFile, readFile } = await import("fs/promises");
36314
- await mkdir(dirname46(destPath), { recursive: true });
36448
+ await mkdir(dirname45(destPath), { recursive: true });
36315
36449
  await copyFile(absSource, destPath);
36316
36450
  const bytes = await readFile(destPath);
36317
36451
  const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
@@ -36510,7 +36644,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
36510
36644
  const keepStemsByDir = new Map;
36511
36645
  const prefixByDir = new Map;
36512
36646
  for (const artifact of freshOutputs) {
36513
- const dir = dirname46(artifact.path);
36647
+ const dir = dirname45(artifact.path);
36514
36648
  const name = basename22(artifact.path);
36515
36649
  const [prefix] = name.split(".");
36516
36650
  if (!prefix)
@@ -37108,7 +37242,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
37108
37242
  return url;
37109
37243
  }, getReactModuleUrl, isReactComponentPath = (file) => file.endsWith(".tsx") || file.endsWith(".jsx"), isReactPagePath = (file) => file.replace(/\\/g, "/").includes("/pages/"), isImportableModule = (file) => {
37110
37244
  try {
37111
- return statSync13(file).isFile();
37245
+ return statSync15(file).isFile();
37112
37246
  } catch {
37113
37247
  return false;
37114
37248
  }
@@ -37927,8 +38061,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
37927
38061
  if (!buildReference?.source) {
37928
38062
  return;
37929
38063
  }
37930
- const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname46(buildInfo.resolvedRegistryPath), buildReference.source);
37931
- islandFiles.add(resolvePath(sourcePath));
38064
+ islandFiles.add(resolvePath(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, buildReference.source)));
37932
38065
  }, resolveIslandSourceFiles = async (config) => {
37933
38066
  const registryPath = config.islands?.registry;
37934
38067
  if (!registryPath) {
@@ -37948,15 +38081,33 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
37948
38081
  return false;
37949
38082
  }
37950
38083
  return filesToRebuild.some((file) => islandFiles.has(resolvePath(file)));
37951
- }, handleIslandSourceReload = async (state, config, filesToRebuild, manifest, serverDuration) => {
37952
- const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
37953
- if (!shouldReload) {
38084
+ }, collectChangedIslands = async (config, filesToRebuild) => {
38085
+ const registryPath = config.islands?.registry;
38086
+ if (!registryPath)
38087
+ return [];
38088
+ const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
38089
+ const changedFiles = new Set(filesToRebuild.map((file) => resolvePath(file)));
38090
+ return buildInfo.definitions.filter((definition) => {
38091
+ const source = definition.buildReference?.source;
38092
+ if (!source)
38093
+ return false;
38094
+ return changedFiles.has(resolvePath(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, source)));
38095
+ });
38096
+ }, filterFilesReachingPages = async (state, config, files) => {
38097
+ const islandFiles = await resolveIslandSourceFiles(config);
38098
+ return files.filter((file) => {
38099
+ const resolvedFile = resolvePath(file);
38100
+ const dependents = getAffectedFiles(state.dependencyGraph, resolvedFile).filter((dependent) => dependent !== resolvedFile);
38101
+ if (dependents.length === 0)
38102
+ return !islandFiles.has(resolvedFile);
38103
+ return dependents.some((dependent) => !islandFiles.has(dependent));
38104
+ });
38105
+ }, isRegistryEdit = (state, config) => {
38106
+ const registryPath = config.islands?.registry;
38107
+ if (!registryPath)
37954
38108
  return false;
37955
- }
37956
- setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
37957
- const affectedPages = filesToRebuild.flatMap((file) => getPagesUsingIslandSource(file));
37958
- if (affectedPages.length === 0)
37959
- return true;
38109
+ return state.lastUserEditedFiles?.has(resolvePath(registryPath)) === true;
38110
+ }, broadcastIslandFullReload = (state, affectedPages, manifest, serverDuration, sourceFile) => {
37960
38111
  const affectedFrameworks = [
37961
38112
  ...new Set(affectedPages.map((page) => detectFramework(page, state.resolvedPaths)).filter((framework) => framework !== "ignored"))
37962
38113
  ];
@@ -37967,10 +38118,40 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
37967
38118
  framework: "islands",
37968
38119
  manifest,
37969
38120
  serverDuration,
37970
- sourceFile: filesToRebuild[0]
38121
+ sourceFile
37971
38122
  },
37972
38123
  type: "full-reload"
37973
38124
  });
38125
+ }, handleIslandSourceReload = async (state, config, filesToRebuild, manifest, serverDuration) => {
38126
+ const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
38127
+ if (!shouldReload) {
38128
+ return false;
38129
+ }
38130
+ bumpIslandServerGeneration();
38131
+ setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
38132
+ const [sourceFile] = filesToRebuild;
38133
+ if (isRegistryEdit(state, config)) {
38134
+ const pagesWithIslands = [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadata.islands.length > 0).map((metadata) => metadata.pagePath);
38135
+ if (pagesWithIslands.length > 0)
38136
+ broadcastIslandFullReload(state, pagesWithIslands, manifest, serverDuration, sourceFile);
38137
+ return true;
38138
+ }
38139
+ const changedIslands = await collectChangedIslands(config, filesToRebuild);
38140
+ const islands = changedIslands.flatMap(({ component, framework }) => {
38141
+ const modulePath = manifest[getIslandManifestKey(framework, component)];
38142
+ return modulePath ? [{ component, framework, modulePath }] : [];
38143
+ });
38144
+ if (islands.length === 0)
38145
+ return true;
38146
+ logHmrUpdate(relative34(process.cwd(), sourceFile ?? ""), "islands", serverDuration);
38147
+ broadcastToClients(state, {
38148
+ data: {
38149
+ islands,
38150
+ serverDuration,
38151
+ sourceFile
38152
+ },
38153
+ type: "island-update"
38154
+ });
37974
38155
  return true;
37975
38156
  }, handleHTMLScriptHMR = (state, filesToRebuild, manifest, duration) => {
37976
38157
  if (!state.resolvedPaths.htmlDir) {
@@ -37991,8 +38172,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
37991
38172
  }, resolveStaticPageTargets = async (files, sourcePagesDir) => {
37992
38173
  const pagesDir = resolvePath(sourcePagesDir);
37993
38174
  const htmlFiles = files.filter((file) => file.endsWith(".html")).map((file) => resolvePath(file));
37994
- const pages = htmlFiles.filter((file) => dirname46(file) === pagesDir);
37995
- const partials = new Set(htmlFiles.filter((file) => dirname46(file) !== pagesDir));
38175
+ const pages = htmlFiles.filter((file) => dirname45(file) === pagesDir);
38176
+ const partials = new Set(htmlFiles.filter((file) => dirname45(file) !== pagesDir));
37996
38177
  if (partials.size === 0)
37997
38178
  return pages;
37998
38179
  await Promise.resolve().then(() => init_htmlIncludes());
@@ -38508,14 +38689,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
38508
38689
  handled.add(configPath);
38509
38690
  }
38510
38691
  return files.every((f) => handled.has(f));
38692
+ }, keepReactIndexesOnModuleServer = async (state, manifest) => {
38693
+ const reactIndexes = Object.fromEntries(Object.entries(manifest).filter(([key, value]) => key.endsWith("Index") && value.includes("/indexes/") && value.includes("/react/")));
38694
+ if (Object.keys(reactIndexes).length === 0)
38695
+ return;
38696
+ await Promise.resolve().then(() => init_prepare());
38697
+ await Promise.resolve().then(() => init_moduleServer());
38698
+ patchManifestIndexes(reactIndexes, resolvePath(state.resolvedPaths.buildDir, "_src_indexes"), SRC_URL_PREFIX2);
38699
+ Object.assign(manifest, reactIndexes);
38511
38700
  }, performFullRebuild = async (state, config, affectedFrameworks, filesToRebuild, startTime, onRebuildComplete, options) => {
38512
38701
  state.svelteSurgicallyHandled = undefined;
38513
38702
  const hasManifest = Object.keys(state.manifest).length > 0;
38514
38703
  const files = filesToRebuild ?? [];
38515
38704
  const onDemandPage = options?.onDemandPage;
38516
- let allHandled = !onDemandPage && files.length > 0 && hasManifest;
38517
38705
  const hasIslandSourceChanges = files.length > 0 ? await didStaticPagesNeedIslandRefresh(config, files) : false;
38518
- if (allHandled && !hasIslandSourceChanges) {
38706
+ let allHandled = !onDemandPage && files.length > 0 && hasManifest && !hasIslandSourceChanges;
38707
+ if (allHandled) {
38519
38708
  allHandled = await runFrameworkFastPaths(state, config, affectedFrameworks, files, startTime, onRebuildComplete);
38520
38709
  }
38521
38710
  if (allHandled && config.htmlDirectory && affectedFrameworks.includes("html")) {
@@ -38547,6 +38736,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
38547
38736
  throw new Error("Build failed - no manifest generated");
38548
38737
  }
38549
38738
  const { manifest } = buildResult;
38739
+ await keepReactIndexesOnModuleServer(state, manifest);
38550
38740
  if (state.lazyPages && buildResult.pageEntries) {
38551
38741
  updateLazyPageRegistry(state.lazyPages.registry, buildResult.pageEntries);
38552
38742
  }
@@ -38625,7 +38815,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
38625
38815
  const hasFilesToRebuild = filesToRebuild && filesToRebuild.length > 0;
38626
38816
  const didReloadForIslandChange = hasFilesToRebuild ? await handleIslandSourceReload(state, config, filesToRebuild, manifest, duration) : false;
38627
38817
  if (didReloadForIslandChange) {
38628
- await runFrameworkFastPaths(state, config, affectedFrameworks, filesToRebuild ?? [], startTime, onRebuildComplete);
38818
+ const pageFiles = await filterFilesReachingPages(state, config, filesToRebuild ?? []);
38819
+ if (pageFiles.length > 0)
38820
+ await runFrameworkFastPaths(state, config, affectedFrameworks, pageFiles, startTime, onRebuildComplete);
38629
38821
  onRebuildComplete({ hmrState: state, manifest });
38630
38822
  return manifest;
38631
38823
  }
@@ -39225,7 +39417,7 @@ var init_vendorCache = __esm(() => {
39225
39417
 
39226
39418
  // src/core/devBuild.ts
39227
39419
  import { readdir as readdir6 } from "fs/promises";
39228
- import { existsSync as existsSync58, statSync as statSync14 } from "fs";
39420
+ import { existsSync as existsSync58, statSync as statSync16 } from "fs";
39229
39421
  import { resolve as resolve66 } from "path";
39230
39422
  var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (config) => {
39231
39423
  const configuredDirs = [
@@ -39365,7 +39557,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
39365
39557
  });
39366
39558
  }
39367
39559
  }, handleCachedReload = async () => {
39368
- const serverMtime = statSync14(resolve66(Bun.main)).mtimeMs;
39560
+ const serverMtime = statSync16(resolve66(Bun.main)).mtimeMs;
39369
39561
  const lastMtime = globalThis.__hmrServerMtime;
39370
39562
  globalThis.__hmrServerMtime = serverMtime;
39371
39563
  const cached = globalThis.__hmrDevResult;
@@ -39746,7 +39938,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
39746
39938
  manifest
39747
39939
  };
39748
39940
  globalThis.__hmrDevResult = result;
39749
- globalThis.__hmrServerMtime = statSync14(resolve66(Bun.main)).mtimeMs;
39941
+ globalThis.__hmrServerMtime = statSync16(resolve66(Bun.main)).mtimeMs;
39750
39942
  return result;
39751
39943
  };
39752
39944
  var init_devBuild = __esm(() => {
@@ -40001,7 +40193,7 @@ var init_hmr = __esm(() => {
40001
40193
 
40002
40194
  // src/plugins/devtoolsJson.ts
40003
40195
  import { existsSync as existsSync59, mkdirSync as mkdirSync22, readFileSync as readFileSync56, writeFileSync as writeFileSync18 } from "fs";
40004
- import { dirname as dirname47, join as join75, resolve as resolve67 } from "path";
40196
+ import { dirname as dirname46, join as join75, resolve as resolve67 } from "path";
40005
40197
  import { Elysia as Elysia11 } from "elysia";
40006
40198
  var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
40007
40199
  Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
@@ -40028,7 +40220,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
40028
40220
  if (cachedUuid)
40029
40221
  return setGlobalUuid(cachedUuid);
40030
40222
  const uuid = crypto.randomUUID();
40031
- mkdirSync22(dirname47(cachePath), { recursive: true });
40223
+ mkdirSync22(dirname46(cachePath), { recursive: true });
40032
40224
  writeFileSync18(cachePath, uuid, "utf-8");
40033
40225
  return setGlobalUuid(uuid);
40034
40226
  }, devtoolsJson = (buildDir, options = {}) => {
@@ -40797,7 +40989,7 @@ import {
40797
40989
  rm as rm20,
40798
40990
  writeFile as writeFile17
40799
40991
  } from "fs/promises";
40800
- import { dirname as dirname48, join as join77, resolve as resolvePath3 } from "path";
40992
+ import { dirname as dirname47, join as join77, resolve as resolvePath3 } from "path";
40801
40993
  import { pathToFileURL as pathToFileURL5 } from "url";
40802
40994
  var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "current.json", BUNDLES_DIRECTORY = "bundles", ARTIFACT_FILE2 = "artifact.json", BUNDLE_ID_PATTERN, isRecord15 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), errorHasCode2 = (error, code) => typeof error === "object" && error !== null && Reflect.get(error, "code") === code, bundleIdFor = (currentReleaseId, releases) => {
40803
40995
  const identity = JSON.stringify({
@@ -40830,7 +41022,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
40830
41022
  }, writeRelease = async (root, release) => {
40831
41023
  const directory = join77(root, release.artifact.releaseId);
40832
41024
  const producerPath = join77(directory, release.artifact.producer.module);
40833
- await mkdir18(dirname48(producerPath), { recursive: true });
41025
+ await mkdir18(dirname47(producerPath), { recursive: true });
40834
41026
  await Promise.all([
40835
41027
  writeFile17(join77(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
40836
41028
  `),
@@ -41636,6 +41828,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
41636
41828
  return statusCode === undefined || statusCode === HTTP_STATUS_INTERNAL_SERVER_ERROR;
41637
41829
  }, createStaticErrorPlugin = (owner) => {
41638
41830
  let startedApp;
41831
+ const loggedErrors = new WeakSet;
41639
41832
  return new Elysia16({ name: "absolutejs-static-error" }).onStart((app) => {
41640
41833
  startedApp = app;
41641
41834
  }).onError("global", async ({ error, request, set }) => {
@@ -41644,11 +41837,11 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
41644
41837
  const app = globalThis.__absoluteLiveApp ?? startedApp;
41645
41838
  if (hasForeignErrorHook(app, owner()))
41646
41839
  return;
41647
- const response = await renderStaticRouteError(request, error);
41648
- if (!response)
41649
- return;
41650
- console.error(`[SSR] ${request.method} ${new URL(request.url).pathname} threw:`, error);
41651
- return response;
41840
+ if (!loggedErrors.has(error)) {
41841
+ loggedErrors.add(error);
41842
+ console.error(`[SSR] ${request.method} ${new URL(request.url).pathname} threw:`, error);
41843
+ }
41844
+ return await renderStaticRouteError(request, error) ?? undefined;
41652
41845
  });
41653
41846
  }, createBuildErrorRecoveryPlugin = () => new Elysia16({ name: "absolutejs-build-error-recovery" }).onError("global", async ({ error }) => {
41654
41847
  const message = error instanceof Error ? error.message : String(error);
@@ -41905,11 +42098,11 @@ import {
41905
42098
  existsSync as existsSync63,
41906
42099
  readdirSync as readdirSync17,
41907
42100
  readFileSync as readFileSync61,
41908
- statSync as statSync15,
42101
+ statSync as statSync17,
41909
42102
  watch as watch2
41910
42103
  } from "fs";
41911
42104
  import { createHash as createHash14 } from "crypto";
41912
- import { dirname as dirname49, join as join82, resolve as resolve69 } from "path";
42105
+ import { dirname as dirname48, join as join82, resolve as resolve69 } from "path";
41913
42106
  var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETRY_DELAY_MS = 250, MAX_ENTRY_IMPORT_ATTEMPTS = 3, WATCH_FALLBACK_INTERVAL_MS = 250, isAtomicWriteTemp = (filename) => isEditorTempFile(filename) || isAbsoluteServerEntryCopyPath(filename), fileHash = (path) => {
41914
42107
  try {
41915
42108
  return createHash14("sha256").update(readFileSync61(path)).digest("hex");
@@ -41938,10 +42131,10 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
41938
42131
  globalThis.__absoluteEntryWatcherStarted = true;
41939
42132
  globalThis.__absoluteEntryWatcherReady = false;
41940
42133
  const entryPath = resolve69(originalEntry);
41941
- const entryDir = dirname49(entryPath);
42134
+ const entryDir = dirname48(entryPath);
41942
42135
  const entryBase = entryPath.slice(entryDir.length + 1);
41943
42136
  const configPath = resolve69(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
41944
- const configDir = dirname49(configPath);
42137
+ const configDir = dirname48(configPath);
41945
42138
  const configBase = configPath.slice(configDir.length + 1);
41946
42139
  const recentlyHandled = new Map;
41947
42140
  let entryReloadTimer = null;
@@ -42088,7 +42281,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
42088
42281
  continue;
42089
42282
  let st;
42090
42283
  try {
42091
- st = statSync15(join82(dir, entry.name));
42284
+ st = statSync17(join82(dir, entry.name));
42092
42285
  } catch {
42093
42286
  continue;
42094
42287
  }
@@ -42235,6 +42428,17 @@ init_constants();
42235
42428
 
42236
42429
  // src/core/lookup.ts
42237
42430
  init_requestContext();
42431
+ var DOUBLED_RSC_SUFFIX = "RSCRSC";
42432
+ var warnedDoubledRscKeys = new Set;
42433
+ var warnDoubledRscKey = (source, name, assetPath) => {
42434
+ if (!name.endsWith(DOUBLED_RSC_SUFFIX))
42435
+ return;
42436
+ const current = name.slice(0, -"RSC".length);
42437
+ if (source[current] !== assetPath || warnedDoubledRscKeys.has(name))
42438
+ return;
42439
+ warnedDoubledRscKeys.add(name);
42440
+ console.warn(`[asset] key "${name}" is deprecated: React Server Components pages whose file name ends in RSC no longer get the suffix twice. Use asset(manifest, '${current}').`);
42441
+ };
42238
42442
  var asset = (source, name) => {
42239
42443
  const assetPath = source[name];
42240
42444
  if (assetPath === undefined) {
@@ -42248,6 +42452,8 @@ var asset = (source, name) => {
42248
42452
  console.warn(`[asset] key "${name}" not found in manifest (dev mode \u2014 skipping)`);
42249
42453
  return "";
42250
42454
  }
42455
+ if (!isProductionRuntime())
42456
+ warnDoubledRscKey(source, name, assetPath);
42251
42457
  return assetPath;
42252
42458
  };
42253
42459
  // src/core/fileRoutes.ts
@@ -48921,7 +49127,7 @@ var getEnv = (key) => {
48921
49127
  };
48922
49128
  // src/utils/projectRoot.ts
48923
49129
  import { existsSync as existsSync65 } from "fs";
48924
- import { dirname as dirname50, resolve as resolve71 } from "path";
49130
+ import { dirname as dirname49, resolve as resolve71 } from "path";
48925
49131
  var CONFIG_CANDIDATES = [
48926
49132
  "absolute.config.ts",
48927
49133
  "absolute.config.js",
@@ -48942,7 +49148,7 @@ var findProjectRoot = () => {
48942
49148
  if (packageRoot === null && existsSync65(resolve71(directory, "package.json"))) {
48943
49149
  packageRoot = directory;
48944
49150
  }
48945
- const parent = dirname50(directory);
49151
+ const parent = dirname49(directory);
48946
49152
  if (parent === directory) {
48947
49153
  return packageRoot ?? start;
48948
49154
  }
@@ -49227,5 +49433,5 @@ export {
49227
49433
  wrapPageHandlerWithStreamingSlots
49228
49434
  };
49229
49435
 
49230
- //# debugId=14106FA8219E534064756E2164756E21
49436
+ //# debugId=BB263212A593230964756E2164756E21
49231
49437
  //# sourceMappingURL=index.js.map