@absolutejs/absolute 0.20.0-beta.177 → 0.20.0-beta.179

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 (88) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/changelog.json +72 -0
  3. package/dist/angular/browser.js +17 -2
  4. package/dist/angular/browser.js.map +4 -4
  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 +100 -54
  8. package/dist/angular/index.js.map +10 -9
  9. package/dist/angular/server.js +100 -54
  10. package/dist/angular/server.js.map +10 -9
  11. package/dist/build/buildWorker.js +6 -5
  12. package/dist/build.js +595 -454
  13. package/dist/build.js.map +20 -20
  14. package/dist/cli/{add-ntg96znk.js → add-8gw9mk2b.js} +1 -1
  15. package/dist/cli/{compile-w2z6c9vt.js → compile-p5yv6ecp.js} +2 -2
  16. package/dist/cli/config/server.js +45 -12
  17. package/dist/cli/{dev-8br5mr7t.js → dev-2hbcsvkp.js} +1 -1
  18. package/dist/cli/{index-420h9hq7.js → index-1ewba8ye.js} +32 -3
  19. package/dist/cli/index-5q6k5mvr.js +86 -0
  20. package/dist/cli/{index-7z1hh3fg.js → index-9dzdbbfc.js} +1 -1
  21. package/dist/cli/index.js +9 -9
  22. package/dist/cli/{islands-bx67g15t.js → islands-6zgb7501.js} +1 -1
  23. package/dist/cli/{mobile-we5q51ey.js → mobile-93vaawcz.js} +3 -3
  24. package/dist/cli/{remove-4jh862qa.js → remove-x987pvd3.js} +1 -1
  25. package/dist/cli/{start-srs11bm8.js → start-asxb79rc.js} +2 -2
  26. package/dist/cli/{typecheck-7fvww3b7.js → typecheck-m2j4tkdk.js} +165 -35
  27. package/dist/client/chunks/{index-8m2qq61n.js → index-58svs66p.js} +13 -3
  28. package/dist/client/chunks/{index-8m2qq61n.js.map → index-58svs66p.js.map} +5 -4
  29. package/dist/client/chunks/{islands-mfjmdwnb.js → islands-tcadmgcx.js} +3 -6
  30. package/dist/client/chunks/{islands-mfjmdwnb.js.map → islands-tcadmgcx.js.map} +3 -4
  31. package/dist/client/chunks/{react-sprprqzs.js → react-khr6ewhr.js} +2 -2
  32. package/dist/client/index.js +82 -6
  33. package/dist/client/index.js.map +7 -6
  34. package/dist/dev/client/handlers/islands.ts +2 -0
  35. package/dist/dev/client/handlers/react.ts +92 -111
  36. package/dist/dev/client/handlers/reactUpdateQueue.ts +153 -0
  37. package/dist/index.js +568 -427
  38. package/dist/index.js.map +20 -20
  39. package/dist/islands/browser.js +2 -2
  40. package/dist/islands/browser.js.map +3 -3
  41. package/dist/islands/index.js +56 -27
  42. package/dist/islands/index.js.map +7 -6
  43. package/dist/react/browser.js +113 -12
  44. package/dist/react/browser.js.map +10 -7
  45. package/dist/react/components/index.js +31 -7
  46. package/dist/react/components/index.js.map +5 -4
  47. package/dist/react/components/server/index.js +22 -6
  48. package/dist/react/index.js +233 -67
  49. package/dist/react/index.js.map +16 -12
  50. package/dist/react/server.js +82 -23
  51. package/dist/react/server.js.map +11 -9
  52. package/dist/src/build/compileSvelte.d.ts +12 -1
  53. package/dist/src/build/compileVue.d.ts +1 -0
  54. package/dist/src/build/islandEntries.d.ts +3 -1
  55. package/dist/src/cli/add/dependencies.d.ts +34 -6
  56. package/dist/src/cli/scripts/typecheck.d.ts +8 -0
  57. package/dist/src/cli/scripts/typecheckDiagnostics.d.ts +17 -0
  58. package/dist/src/client/preserveIslandMarkup.d.ts +4 -0
  59. package/dist/src/core/islandManifest.d.ts +6 -0
  60. package/dist/src/core/islandStylesheet.d.ts +17 -0
  61. package/dist/src/react/Island.d.ts +9 -2
  62. package/dist/src/react/IslandStyleLink.d.ts +11 -0
  63. package/dist/src/react/createIsland.d.ts +1 -1
  64. package/dist/src/react/serverComponents/nodeRendererRef.d.ts +13 -0
  65. package/dist/src/utils/requestRenderUrl.d.ts +1 -0
  66. package/dist/src/utils/resolveConvention.d.ts +1 -0
  67. package/dist/src/vue/Island.browser.d.ts +3 -1
  68. package/dist/src/vue/Island.d.ts +2 -2
  69. package/dist/src/vue/createIsland.browser.d.ts +2 -2
  70. package/dist/src/vue/createIsland.d.ts +2 -2
  71. package/dist/src/vue/islandStyleLink.d.ts +30 -0
  72. package/dist/svelte/browser.js +2 -2
  73. package/dist/svelte/browser.js.map +3 -3
  74. package/dist/svelte/index.js +94 -70
  75. package/dist/svelte/index.js.map +10 -9
  76. package/dist/svelte/server.js +65 -59
  77. package/dist/svelte/server.js.map +9 -8
  78. package/dist/types/globals.d.ts +3 -0
  79. package/dist/vue/browser.js +105 -10
  80. package/dist/vue/browser.js.map +10 -7
  81. package/dist/vue/index.js +213 -68
  82. package/dist/vue/index.js.map +15 -12
  83. package/dist/vue/server.js +81 -22
  84. package/dist/vue/server.js.map +9 -7
  85. package/package.json +1 -1
  86. package/dist/cli/index-jjfbjv1z.js +0 -65
  87. /package/dist/cli/{index-6522t968.js → index-yd672jyq.js} +0 -0
  88. /package/dist/client/chunks/{react-sprprqzs.js.map → react-khr6ewhr.js.map} +0 -0
package/dist/build.js CHANGED
@@ -786,7 +786,7 @@ var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOO
786
786
  islands[framework] = entries;
787
787
  }
788
788
  return islands;
789
- }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
789
+ }, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`, ISLAND_STYLE_PREFIX = "IslandStyle", getIslandStyleManifestEntries = (manifest) => Object.entries(manifest).filter(([key]) => key.startsWith(ISLAND_STYLE_PREFIX)), getIslandStyleManifestKey = (framework, component) => `${ISLAND_STYLE_PREFIX}${toIslandFrameworkSegment(framework)}${component}`;
790
790
 
791
791
  // src/utils/runtimeMode.ts
792
792
  var ENV_VAR = "NODE_ENV", readEnv = () => typeof process === "undefined" ? undefined : process.env?.[ENV_VAR], getNodeEnv = () => readEnv(), isDevelopmentRuntime = () => readEnv() === "development", isProductionRuntime = () => readEnv() === "production";
@@ -1011,6 +1011,11 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
1011
1011
  if (ext === ".css") {
1012
1012
  if (segments.includes("server"))
1013
1013
  return manifest;
1014
+ const islandStyleFramework = islandIndex > UNFOUND_INDEX ? segments[islandIndex + 1] : undefined;
1015
+ if (islandStyleFramework === "react" || islandStyleFramework === "svelte" || islandStyleFramework === "vue" || islandStyleFramework === "angular") {
1016
+ manifest[getIslandStyleManifestKey(islandStyleFramework, pascalName)] = `/${relative}`;
1017
+ return manifest;
1018
+ }
1014
1019
  const cssKey = getCssKey(pascalName, segments);
1015
1020
  if (manifest[cssKey] && manifest[cssKey] !== `/${relative}`)
1016
1021
  logWarn(`Duplicate manifest key "${cssKey}" \u2014 "${manifest[cssKey]}" will be overwritten by "/${relative}". Use unique page names across frameworks.`);
@@ -1417,10 +1422,12 @@ export default component;
1417
1422
  sources[definition.framework] = frameworkSources;
1418
1423
  }
1419
1424
  return sources;
1420
- }, generateIslandEntryPoints = async ({
1425
+ }, createCssImports = (entryPath, cssPaths) => cssPaths.map((cssPath) => `import ${JSON.stringify(normalizeImportPath(entryPath, cssPath))};
1426
+ `).join(""), generateIslandEntryPoints = async ({
1421
1427
  buildInfo,
1422
1428
  buildPath,
1423
- clientPathMaps = {}
1429
+ clientPathMaps = {},
1430
+ cssPathMaps = {}
1424
1431
  }) => {
1425
1432
  const generatedRoot = join2(buildPath, "_island_entries");
1426
1433
  rmSync(generatedRoot, { force: true, recursive: true });
@@ -1431,8 +1438,9 @@ export default component;
1431
1438
  const source = buildReference ? resolveIslandSourcePath(buildInfo.resolvedRegistryPath, buildReference.source) : null;
1432
1439
  const compiledSourcePath = source && shouldUseCompiledClientPath(definition.framework, source) ? clientPathMaps[definition.framework]?.get(source) : undefined;
1433
1440
  const entrySource = source && (compiledSourcePath || !shouldUseCompiledClientPath(definition.framework, source)) ? createDirectEntrySource(entryPath, compiledSourcePath ?? source, compiledSourcePath ? undefined : buildReference?.export) : createRegistryEntrySource(entryPath, buildInfo.resolvedRegistryPath, buildInfo.hasNamedExport, definition.framework, definition.component);
1441
+ const cssPaths = source ? cssPathMaps[definition.framework]?.get(source) ?? [] : [];
1434
1442
  mkdirSync2(dirname(entryPath), { recursive: true });
1435
- writeFileSync2(entryPath, entrySource);
1443
+ writeFileSync2(entryPath, `${createCssImports(entryPath, cssPaths)}${entrySource}`);
1436
1444
  entries.push({
1437
1445
  component: definition.component,
1438
1446
  entryPath,
@@ -2036,6 +2044,22 @@ export const renderHtml = (flight, options) => {
2036
2044
 
2037
2045
  return renderToReadableStream(createElement(Root), options);
2038
2046
  };
2047
+
2048
+ // A fragment (a SuspenseSlot's resolved content) rendered to an HTML string.
2049
+ export const renderStaticHtml = async (flight) => {
2050
+ const root = createFromReadableStream(flight, {
2051
+ serverConsumerManifest: {
2052
+ moduleLoading: null,
2053
+ moduleMap,
2054
+ serverModuleMap: null
2055
+ }
2056
+ });
2057
+ const Root = () => use(root);
2058
+ const stream = await renderToReadableStream(createElement(Root));
2059
+ await stream.allReady;
2060
+
2061
+ return new Response(stream).text();
2062
+ };
2039
2063
  `;
2040
2064
  }, clientRuntimeSource = (modules) => {
2041
2065
  const loaders = modules.map((module) => ` ${JSON.stringify(module.id)}: () => import(${JSON.stringify(module.path)})`);
@@ -2061,7 +2085,7 @@ globalThis.__webpack_chunk_load__ = (id) => {
2061
2085
  }, clientEntrySource = () => `import './ReactServerClientRuntime';
2062
2086
  import { createFromReadableStream } from 'react-server-dom-webpack/client.browser';
2063
2087
  import { hydrateRoot } from 'react-dom/client';
2064
- import { createElement, use } from 'react';
2088
+ import { createElement, use, useEffect } from 'react';
2065
2089
 
2066
2090
  const encoder = new TextEncoder();
2067
2091
  const stream = new ReadableStream({
@@ -2083,7 +2107,21 @@ const stream = new ReadableStream({
2083
2107
  }
2084
2108
  });
2085
2109
  const root = createFromReadableStream(stream);
2086
- const Root = () => use(root);
2110
+ // The page's inline bootstrap holds streamed slot content back
2111
+ // (__ABS_SLOT_HYDRATION_PENDING__) so hydration compares against the HTML the
2112
+ // server rendered: a slot whose fallback is a React node would otherwise
2113
+ // mismatch, and React's client re-render would drop every patched slot.
2114
+ const releaseStreamingSlots = () => {
2115
+ self.__ABS_SLOT_HYDRATION_PENDING__ = false;
2116
+ if (typeof self.__ABS_SLOT_FLUSH__ === 'function') self.__ABS_SLOT_FLUSH__();
2117
+ };
2118
+ const Root = () => {
2119
+ useEffect(() => {
2120
+ setTimeout(releaseStreamingSlots, 0);
2121
+ }, []);
2122
+
2123
+ return use(root);
2124
+ };
2087
2125
  hydrateRoot(document, createElement(Root));
2088
2126
  `, findOutput = (outputs, name) => outputs.find((artifact) => artifact.kind === "entry-point" && basename2(artifact.path).startsWith(`${name}.`)), toWebPath2 = (buildPath, path) => `/${relative4(buildPath, path).replace(/\\/g, "/")}`, assertFlightPackage = (projectRoot) => {
2089
2127
  try {
@@ -5068,7 +5106,7 @@ import { basename as basename3, dirname as dirname5, extname as extname6, join a
5068
5106
  var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
5069
5107
  const importPath = relative7(dirname5(from), target).replace(/\\/g, "/");
5070
5108
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
5071
- }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
5109
+ }, escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), replaceQuotedSpecifier = (code, spec, target) => code.replace(new RegExp(`(['"])${escapeRegExp(spec)}\\1`, "g"), (_match, quote) => `${quote}${target}${quote}`), processDirectoryEntries = (entries, dir, targetFileName, stack) => {
5072
5110
  for (const entry of entries) {
5073
5111
  const entryPath = join10(dir, entry.name);
5074
5112
  if (entry.isDirectory())
@@ -5113,18 +5151,21 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
5113
5151
  return null;
5114
5152
  }
5115
5153
  const basePath = resolve10(dirname5(from), spec);
5154
+ const extensions = [
5155
+ ".ts",
5156
+ ".tsx",
5157
+ ".mts",
5158
+ ".cts",
5159
+ ".js",
5160
+ ".jsx",
5161
+ ".mjs",
5162
+ ".cjs",
5163
+ ".json"
5164
+ ];
5116
5165
  const candidates = [
5117
5166
  basePath,
5118
- `${basePath}.ts`,
5119
- `${basePath}.js`,
5120
- `${basePath}.mjs`,
5121
- `${basePath}.cjs`,
5122
- `${basePath}.json`,
5123
- join10(basePath, "index.ts"),
5124
- join10(basePath, "index.js"),
5125
- join10(basePath, "index.mjs"),
5126
- join10(basePath, "index.cjs"),
5127
- join10(basePath, "index.json")
5167
+ ...extensions.map((extension) => `${basePath}${extension}`),
5168
+ ...extensions.map((extension) => join10(basePath, `index${extension}`))
5128
5169
  ];
5129
5170
  const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
5130
5171
  const foundIndex = existResults.indexOf(true);
@@ -5209,7 +5250,7 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
5209
5250
  rewrittenModulePaths.set(spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), resolvedModuleImport));
5210
5251
  }
5211
5252
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
5212
- transpiled = transpiled.replaceAll(spec, resolvedModuleImport);
5253
+ transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
5213
5254
  }
5214
5255
  let compiledCode = compile(transpiled, {
5215
5256
  css: "injected",
@@ -5221,10 +5262,10 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandG
5221
5262
  hmr: isDevelopmentRuntime()
5222
5263
  }).js.code;
5223
5264
  for (const [spec, compiledChildPath] of childModulePaths) {
5224
- compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
5265
+ compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
5225
5266
  }
5226
5267
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
5227
- compiledCode = compiledCode.replaceAll(spec, resolvedModuleImport);
5268
+ compiledCode = replaceQuotedSpecifier(compiledCode, spec, resolvedModuleImport);
5228
5269
  }
5229
5270
  const sourceId = JSON.stringify(relative7(process.cwd(), resolutionSourcePath).replace(/\\/g, "/"));
5230
5271
  const componentName = /export default function ([\w$]+)\s*\(/.exec(compiledCode)?.[1];
@@ -5284,9 +5325,9 @@ var createVueCompiler = async () => {
5284
5325
  // src/core/vueServerModule.ts
5285
5326
  import { readFileSync as readFileSync6, realpathSync } from "fs";
5286
5327
  import { mkdir as mkdir3 } from "fs/promises";
5287
- import { dirname as dirname6, join as join11, relative as relative8, resolve as resolve11 } from "path";
5328
+ import { basename as basename4, dirname as dirname6, join as join11, relative as relative8, resolve as resolve11 } from "path";
5288
5329
  var {Transpiler: Transpiler2 } = globalThis.Bun;
5289
- var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
5330
+ var serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
5290
5331
  const importPath = relative8(dirname6(from), target).replace(/\\/g, "/");
5291
5332
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
5292
5333
  }, getCachedModulePath3 = (sourcePath) => {
@@ -5320,7 +5361,13 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
5320
5361
  ].join(`
5321
5362
  `) : nonVueLines.join(`
5322
5363
  `);
5323
- }, 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) => {
5364
+ }, RELATIVE_SPECIFIER_PATTERN, extractRelativeImports = (code) => Array.from(new Set(Array.from(code.matchAll(RELATIVE_SPECIFIER_PATTERN), (match) => match.groups?.spec).filter((spec) => spec !== undefined))), resolveFromSource = (spec, sourcePath) => {
5365
+ try {
5366
+ return Bun.resolveSync(spec, dirname6(sourcePath));
5367
+ } catch {
5368
+ return null;
5369
+ }
5370
+ }, compileVueServerModule = async (sourcePath) => {
5324
5371
  syncIslandGeneration2();
5325
5372
  const cachedModulePath = compiledModuleCache3.get(sourcePath);
5326
5373
  if (cachedModulePath)
@@ -5328,7 +5375,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
5328
5375
  const compiler = await loadVueCompiler();
5329
5376
  const source = await Bun.file(sourcePath).text();
5330
5377
  const { descriptor } = compiler.parse(source, { filename: sourcePath });
5331
- const componentId = Bun.hash(sourcePath).toString(BASE_36_RADIX).slice(0, ISLAND_COMPONENT_ID_LENGTH);
5378
+ const componentId = toKebab(basename4(sourcePath, ".vue"));
5332
5379
  const hasScript = descriptor.script || descriptor.scriptSetup;
5333
5380
  const compiledScript = hasScript ? compiler.compileScript(descriptor, {
5334
5381
  fs: {
@@ -5353,10 +5400,10 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
5353
5400
  ssr: true,
5354
5401
  ssrCssVars: descriptor.cssVars
5355
5402
  }).code : "const ssrRender = () => {};";
5356
- const childImportPaths = extractRelativeVueImports(compiledScript.content);
5357
- const compiledChildren = await Promise.all(childImportPaths.map(async (relativeImport) => ({
5358
- compiledPath: await compileVueServerModule(resolve11(dirname6(sourcePath), relativeImport)),
5359
- spec: relativeImport
5403
+ const relativeImports = extractRelativeImports(compiledScript.content);
5404
+ const compiledChildren = await Promise.all(relativeImports.filter((spec) => spec.endsWith(".vue")).map(async (spec) => ({
5405
+ compiledPath: await compileVueServerModule(resolve11(dirname6(sourcePath), spec)),
5406
+ spec
5360
5407
  })));
5361
5408
  const strippedScript = stripExports(compiledScript.content);
5362
5409
  const transpiledScript = transpiler2.transformSync(strippedScript);
@@ -5368,17 +5415,28 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, sync
5368
5415
  ].join(`
5369
5416
  `));
5370
5417
  const compiledModulePath = getCachedModulePath3(sourcePath);
5371
- let rewritten = assembled;
5418
+ const rewrittenSpecifiers = new Map;
5372
5419
  for (const child of compiledChildren) {
5373
- rewritten = rewritten.replaceAll(child.spec, ensureRelativeImportPath2(compiledModulePath, child.compiledPath));
5420
+ rewrittenSpecifiers.set(child.spec, ensureRelativeImportPath2(compiledModulePath, child.compiledPath));
5421
+ }
5422
+ for (const spec of extractRelativeImports(assembled)) {
5423
+ if (rewrittenSpecifiers.has(spec))
5424
+ continue;
5425
+ const resolvedImport = resolveFromSource(spec, sourcePath);
5426
+ if (!resolvedImport)
5427
+ continue;
5428
+ rewrittenSpecifiers.set(spec, ensureRelativeImportPath2(compiledModulePath, resolvedImport));
5374
5429
  }
5430
+ const rewritten = assembled.replace(RELATIVE_SPECIFIER_PATTERN, (match, prefix, quote, spec) => {
5431
+ const target = rewrittenSpecifiers.get(spec);
5432
+ return target ? `${prefix}${quote}${target}${quote}` : match;
5433
+ });
5375
5434
  await mkdir3(dirname6(compiledModulePath), { recursive: true });
5376
5435
  await writeIfChanged2(compiledModulePath, rewritten);
5377
5436
  compiledModuleCache3.set(sourcePath, compiledModulePath);
5378
5437
  return compiledModulePath;
5379
5438
  };
5380
5439
  var init_vueServerModule = __esm(() => {
5381
- init_constants();
5382
5440
  init_isFile();
5383
5441
  serverCacheRoot3 = join11(process.cwd(), ".absolutejs", "islands", "vue");
5384
5442
  compiledModuleCache3 = new Map;
@@ -5386,6 +5444,7 @@ var init_vueServerModule = __esm(() => {
5386
5444
  compiledModuleCache3.clear();
5387
5445
  });
5388
5446
  transpiler2 = new Transpiler2({ loader: "ts", target: "browser" });
5447
+ RELATIVE_SPECIFIER_PATTERN = /(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(?<spec>\.{1,2}\/[^'"]*)\2/g;
5389
5448
  });
5390
5449
 
5391
5450
  // src/core/islandMarkupAttributes.ts
@@ -5846,11 +5905,11 @@ var STAMP_SETTLE_MS = 2000, createStampedFileCache = () => {
5846
5905
  var init_stampedFileCache = () => {};
5847
5906
 
5848
5907
  // src/build/scanConventions.ts
5849
- import { basename as basename4 } from "path";
5908
+ import { basename as basename5 } from "path";
5850
5909
  var {Glob: Glob4 } = globalThis.Bun;
5851
5910
  import { existsSync as existsSync8 } from "fs";
5852
- var CONVENTION_RE, isConventionFile = (fileName) => CONVENTION_RE.test(basename4(fileName)), classifyFile = (file, pageFiles, defaults, pages) => {
5853
- const fileName = basename4(file);
5911
+ var CONVENTION_RE, isConventionFile = (fileName) => CONVENTION_RE.test(basename5(fileName)), classifyFile = (file, pageFiles, defaults, pages) => {
5912
+ const fileName = basename5(file);
5854
5913
  const match = CONVENTION_RE.exec(fileName);
5855
5914
  if (!match) {
5856
5915
  pageFiles.push(file);
@@ -5898,7 +5957,7 @@ var init_scanConventions = __esm(() => {
5898
5957
  // src/core/serverOnlyStaticFiles.ts
5899
5958
  import { existsSync as existsSync9, readFileSync as readFileSync8 } from "fs";
5900
5959
  import { isAbsolute as isAbsolute2, join as join12, relative as relative9, sep as sep2 } from "path";
5901
- var STATIC_PLUGIN_DEFAULTS, SERVER_OUTPUTS_FILE = "server-outputs.json", RUNTIME_FILE_NAMES, SERVER_ONLY_PATTERNS, escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), isStringArray = (value) => Array.isArray(value) && value.every((entry) => typeof entry === "string"), readServerOutputs = (buildDir) => {
5960
+ var STATIC_PLUGIN_DEFAULTS, SERVER_OUTPUTS_FILE = "server-outputs.json", RUNTIME_FILE_NAMES, SERVER_ONLY_PATTERNS, escapeRegExp2 = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), isStringArray = (value) => Array.isArray(value) && value.every((entry) => typeof entry === "string"), readServerOutputs = (buildDir) => {
5902
5961
  const path = join12(buildDir, SERVER_OUTPUTS_FILE);
5903
5962
  if (!existsSync9(path))
5904
5963
  return [];
@@ -5912,7 +5971,7 @@ var STATIC_PLUGIN_DEFAULTS, SERVER_OUTPUTS_FILE = "server-outputs.json", RUNTIME
5912
5971
  const outputs = readServerOutputs(buildDir);
5913
5972
  if (outputs.length === 0)
5914
5973
  return null;
5915
- return new RegExp(`^/(?:${outputs.map(escapeRegExp).join("|")})(?:\\.br|\\.gz|\\.map)?$`);
5974
+ return new RegExp(`^/(?:${outputs.map(escapeRegExp2).join("|")})(?:\\.br|\\.gz|\\.map)?$`);
5916
5975
  }, productionStaticIgnorePatterns = (buildDir, serverBundle) => {
5917
5976
  const patterns = [
5918
5977
  ...STATIC_PLUGIN_DEFAULTS,
@@ -5925,7 +5984,7 @@ var STATIC_PLUGIN_DEFAULTS, SERVER_OUTPUTS_FILE = "server-outputs.json", RUNTIME
5925
5984
  const insideBuildDir = bundlePath !== "" && !bundlePath.startsWith("..") && !isAbsolute2(bundlePath);
5926
5985
  if (insideBuildDir) {
5927
5986
  const urlPath = bundlePath.split(sep2).join("/");
5928
- patterns.push(new RegExp(`^/${escapeRegExp(urlPath)}(?:\\.br|\\.gz|\\.map)?$`));
5987
+ patterns.push(new RegExp(`^/${escapeRegExp2(urlPath)}(?:\\.br|\\.gz|\\.map)?$`));
5929
5988
  }
5930
5989
  return patterns;
5931
5990
  };
@@ -6064,18 +6123,18 @@ var init_htmlIncludes = () => {};
6064
6123
 
6065
6124
  // src/build/spaSideManifests.ts
6066
6125
  import { writeFile as writeFile3 } from "fs/promises";
6067
- import { basename as basename5, dirname as dirname8, relative as relative11, resolve as resolve13 } from "path";
6126
+ import { basename as basename6, dirname as dirname8, relative as relative11, resolve as resolve13 } from "path";
6068
6127
  var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
6069
6128
  const manifestEntries = {};
6070
6129
  await Promise.all([...spaRoutesBySource.entries()].map(async ([source, routes]) => {
6071
- const parentName = basename5(source, ".vue");
6130
+ const parentName = basename6(source, ".vue");
6072
6131
  const parentJsPath = resolveServerJsPath(parentName);
6073
6132
  if (!parentJsPath)
6074
6133
  return;
6075
6134
  const sourceDir = dirname8(source);
6076
6135
  const entries = routes.flatMap(({ path, importPath }) => {
6077
6136
  const childSourcePath = resolve13(sourceDir, importPath);
6078
- const childName = basename5(childSourcePath, ".vue");
6137
+ const childName = basename6(childSourcePath, ".vue");
6079
6138
  const childJsPath = resolveServerJsPath(childName);
6080
6139
  if (!childJsPath)
6081
6140
  return [];
@@ -6301,7 +6360,7 @@ var init_serverExternals = __esm(() => {
6301
6360
 
6302
6361
  // src/build/islandBootstrap.ts
6303
6362
  import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync5 } from "fs";
6304
- import { basename as basename6, dirname as dirname10, extname as extname8, join as join14, relative as relative12 } from "path";
6363
+ import { basename as basename7, dirname as dirname10, extname as extname8, join as join14, relative as relative12 } from "path";
6305
6364
  var DEFAULT_ISLAND_BOOTSTRAP_NAME = "absoluteIslandBootstrap", DEFAULT_ISLAND_BOOTSTRAP_SOURCE = `import {
6306
6365
  createIslandManifestResolver,
6307
6366
  startIslands
@@ -6317,7 +6376,7 @@ startIslands({
6317
6376
  writeFileSync5(entryPath, DEFAULT_ISLAND_BOOTSTRAP_SOURCE);
6318
6377
  return entryPath;
6319
6378
  }, artifactStem = (artifact) => {
6320
- const fileName = basename6(artifact.path);
6379
+ const fileName = basename7(artifact.path);
6321
6380
  const stem = fileName.slice(0, fileName.length - extname8(fileName).length);
6322
6381
  const hashSuffix = artifact.hash ? `.${artifact.hash}` : "";
6323
6382
  return hashSuffix && stem.endsWith(hashSuffix) ? stem.slice(0, stem.length - hashSuffix.length) : stem;
@@ -6328,7 +6387,7 @@ startIslands({
6328
6387
  passRoot
6329
6388
  }) => {
6330
6389
  const expectedDir = passRoot === undefined ? undefined : normalizePath(join14(buildPath, relative12(passRoot, dirname10(bootstrapPath))));
6331
- const expectedStem = basename6(bootstrapPath, extname8(bootstrapPath));
6390
+ const expectedStem = basename7(bootstrapPath, extname8(bootstrapPath));
6332
6391
  const artifact = outputs.find((output) => output.kind === "entry-point" && extname8(output.path) === ".js" && (expectedDir === undefined || normalizePath(dirname10(output.path)) === expectedDir) && artifactStem(output) === expectedStem);
6333
6392
  if (!artifact)
6334
6393
  return;
@@ -6362,7 +6421,7 @@ var CLIENT_FRAMEWORK_PACKAGES, CLIENT_FRAMEWORKS, isPackageInstalled = (packageN
6362
6421
  vue: config.vueDirectory
6363
6422
  },
6364
6423
  projectRoot
6365
- }), escapeRegExp2 = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), packagePattern = (pattern) => pattern.endsWith("/*") ? `${escapeRegExp2(pattern.slice(0, -1))}.+` : `${escapeRegExp2(pattern)}(?:/.*)?`, missingFrameworkSpecifierPattern = (frameworks) => {
6424
+ }), escapeRegExp3 = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), packagePattern = (pattern) => pattern.endsWith("/*") ? `${escapeRegExp3(pattern.slice(0, -1))}.+` : `${escapeRegExp3(pattern)}(?:/.*)?`, missingFrameworkSpecifierPattern = (frameworks) => {
6366
6425
  const alternatives = frameworks.flatMap((framework) => CLIENT_FRAMEWORK_PACKAGES[framework].packages.map(packagePattern));
6367
6426
  return alternatives.length > 0 ? new RegExp(`^(?:${alternatives.join("|")})$`) : null;
6368
6427
  }, frameworkOf = (specifier) => CLIENT_FRAMEWORKS.find((framework) => {
@@ -13476,7 +13535,7 @@ var init_rewriteReactImports = __esm(() => {
13476
13535
  });
13477
13536
 
13478
13537
  // src/build/rewriteClientOutputs.ts
13479
- import { basename as basename7 } from "path";
13538
+ import { basename as basename8 } from "path";
13480
13539
  var reduceVendorPaths = (vendorPaths, reactPaths) => Object.fromEntries(Object.entries(vendorPaths).filter(([specifier, webPath]) => reactPaths[specifier] !== webPath)), hasEntries = (paths) => Object.keys(paths).length > 0, compileClientRewriteFamilies = (options) => {
13481
13540
  const reactPaths = options.reactPaths ?? {};
13482
13541
  const react = hasEntries(reactPaths) ? compileSpecifierRewriter(reactPaths) : undefined;
@@ -13544,7 +13603,7 @@ var reduceVendorPaths = (vendorPaths, reactPaths) => Object.fromEntries(Object.e
13544
13603
  if (!content.includes("URL("))
13545
13604
  return content;
13546
13605
  return content.replace(URL_REFERENCE_PATTERN, (match, relPath) => {
13547
- const resolvedPath = urlFileMap.get(basename7(relPath));
13606
+ const resolvedPath = urlFileMap.get(basename8(relPath));
13548
13607
  if (!resolvedPath)
13549
13608
  return match;
13550
13609
  return `new URL('${resolvedPath}', import.meta.url)`;
@@ -13854,7 +13913,7 @@ var init_fileRoutes = __esm(() => {
13854
13913
 
13855
13914
  // src/dev/lazyPages.ts
13856
13915
  import { existsSync as existsSync24 } from "fs";
13857
- import { basename as basename8, extname as extname11, isAbsolute as isAbsolute5, join as join27, resolve as resolve19 } from "path";
13916
+ import { basename as basename9, extname as extname11, isAbsolute as isAbsolute5, join as join27, resolve as resolve19 } from "path";
13858
13917
  var PAGE_EXTENSIONS2, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag = (value) => value === "1" || value === "true", looksLikePath = (value) => value.includes("/") || value.includes("\\") || value.startsWith("."), probeDirForName = ({ dir, framework }, name) => {
13859
13918
  const extension = PAGE_EXTENSIONS2[framework].find((ext) => existsSync24(join27(dir, `${name}${ext}`)));
13860
13919
  return extension === undefined ? undefined : toDevPageEntry(framework, join27(dir, `${name}${extension}`));
@@ -13929,7 +13988,7 @@ var PAGE_EXTENSIONS2, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag = (v
13929
13988
  const resolved = resolve19(source);
13930
13989
  const entry = {
13931
13990
  framework,
13932
- name: fileRouteFor(resolved)?.name ?? toPascal(basename8(resolved, extname11(resolved))),
13991
+ name: fileRouteFor(resolved)?.name ?? toPascal(basename9(resolved, extname11(resolved))),
13933
13992
  source: resolved
13934
13993
  };
13935
13994
  return entry;
@@ -14125,7 +14184,7 @@ var init_bunStringRawUnicodePlugin = __esm(() => {
14125
14184
 
14126
14185
  // src/build/externalAssetPlugin.ts
14127
14186
  import { copyFileSync, existsSync as existsSync26, mkdirSync as mkdirSync10, statSync as statSync4 } from "fs";
14128
- import { basename as basename9, dirname as dirname18, join as join29, resolve as resolve21 } from "path";
14187
+ import { basename as basename10, dirname as dirname18, join as join29, resolve as resolve21 } from "path";
14129
14188
  var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
14130
14189
  name: "absolute-external-asset",
14131
14190
  setup(bld) {
@@ -14150,7 +14209,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
14150
14209
  continue;
14151
14210
  if (!statSync4(assetPath).isFile())
14152
14211
  continue;
14153
- const targetPath = join29(outDir, basename9(assetPath));
14212
+ const targetPath = join29(outDir, basename10(assetPath));
14154
14213
  if (existsSync26(targetPath))
14155
14214
  continue;
14156
14215
  mkdirSync10(dirname18(targetPath), { recursive: true });
@@ -14163,7 +14222,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
14163
14222
  var init_externalAssetPlugin = () => {};
14164
14223
 
14165
14224
  // src/build/islandRegistryTransform.ts
14166
- import { basename as basename10 } from "path";
14225
+ import { basename as basename11 } from "path";
14167
14226
  var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => lazyTypescript.isIdentifier(name) || lazyTypescript.isStringLiteral(name) ? name.text : null, isIslandRegistryHelperImport2 = (source) => source === "@absolutejs/absolute/islands" || source.endsWith("/islands") || source.endsWith("/core/islands"), collectRegistryFactory = (sourceFile) => {
14168
14227
  const factoryNames = new Set;
14169
14228
  const namespaceNames = new Set;
@@ -14316,7 +14375,7 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => lazyTypescript.isIdenti
14316
14375
  output = output.slice(0, edit.start) + edit.text + output.slice(edit.end);
14317
14376
  }
14318
14377
  return output;
14319
- }, escapeRegExp3 = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), loaderForPath = (filePath) => {
14378
+ }, escapeRegExp4 = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), loaderForPath = (filePath) => {
14320
14379
  if (filePath.endsWith(".tsx"))
14321
14380
  return "tsx";
14322
14381
  if (filePath.endsWith(".jsx"))
@@ -14326,8 +14385,8 @@ var VALID_FRAMEWORKS, getObjectPropertyName2 = (name) => lazyTypescript.isIdenti
14326
14385
  }
14327
14386
  return "ts";
14328
14387
  }, createIslandRegistryDefinitionPlugin = (info) => {
14329
- const registryBase = basename10(info.resolvedRegistryPath).replace(/\.[mc]?[jt]sx?$/, "");
14330
- const filter = new RegExp(`(^|[/\\\\])${escapeRegExp3(registryBase)}\\.[mc]?[jt]sx?$`);
14388
+ const registryBase = basename11(info.resolvedRegistryPath).replace(/\.[mc]?[jt]sx?$/, "");
14389
+ const filter = new RegExp(`(^|[/\\\\])${escapeRegExp4(registryBase)}\\.[mc]?[jt]sx?$`);
14331
14390
  return {
14332
14391
  name: "absolute-island-registry-definitions",
14333
14392
  setup(build) {
@@ -14413,7 +14472,7 @@ var init_vueModuleOutputPath = __esm(() => {
14413
14472
 
14414
14473
  // src/build/injectVueComposableTracking.ts
14415
14474
  import { existsSync as existsSync27, readFileSync as readFileSync19, writeFileSync as writeFileSync10 } from "fs";
14416
- import { basename as basename11, isAbsolute as isAbsolute7, relative as relative16, resolve as resolve23 } from "path";
14475
+ import { basename as basename12, isAbsolute as isAbsolute7, relative as relative16, resolve as resolve23 } from "path";
14417
14476
  var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT_OPENER, SOURCE_EXTENSIONS2, CHUNK_REFERENCE, isSharedChunkFile = (fileName) => fileName.startsWith("chunk-") && fileName.endsWith(".js"), collectModuleComments = (content) => Array.from(content.matchAll(MODULE_COMMENT), (match) => ({
14418
14477
  index: match.index,
14419
14478
  path: match[1] ?? ""
@@ -14454,7 +14513,7 @@ var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT
14454
14513
  return text;
14455
14514
  return `${text.slice(0, declaration.exprStart)}__hmr_wrap(${JSON.stringify(moduleId)}, ${JSON.stringify(declaration.name)}, ${expression})${text.slice(end)}`;
14456
14515
  }, collectVueHmrOutputPaths = (vueOutputPaths, chunkOutputPaths) => {
14457
- const chunkByName = new Map(chunkOutputPaths.filter(isSharedChunkPath).map((path) => [basename11(path), path]));
14516
+ const chunkByName = new Map(chunkOutputPaths.filter(isSharedChunkPath).map((path) => [basename12(path), path]));
14458
14517
  const selected = new Set(vueOutputPaths);
14459
14518
  if (chunkByName.size === 0)
14460
14519
  return [...selected];
@@ -14514,7 +14573,7 @@ var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT
14514
14573
  const insertAt = firstDeclaration?.start ?? 0;
14515
14574
  return restore(`${wrapped.slice(0, insertAt)}${VUE_HMR_RUNTIME}
14516
14575
  ${wrapped.slice(insertAt)}`);
14517
- }, isSharedChunkPath = (path) => isSharedChunkFile(basename11(path)), resolveVueComposableModuleId = (commentPath, options) => {
14576
+ }, isSharedChunkPath = (path) => isSharedChunkFile(basename12(path)), resolveVueComposableModuleId = (commentPath, options) => {
14518
14577
  const absolutePath = resolve23(options.projectRoot, commentPath);
14519
14578
  const { vueDir, generatedVueDir } = options;
14520
14579
  if (!vueDir || !generatedVueDir)
@@ -14960,8 +15019,14 @@ var commonAncestor = (paths, fallback) => {
14960
15019
  var init_commonAncestor = () => {};
14961
15020
 
14962
15021
  // src/utils/buildDirectoryLock.ts
14963
- import { mkdirSync as mkdirSync12, unlinkSync, writeFileSync as writeFileSync12, readFileSync as readFileSync21 } from "fs";
14964
- import { dirname as dirname20, join as join34 } from "path";
15022
+ import {
15023
+ mkdirSync as mkdirSync12,
15024
+ readFileSync as readFileSync21,
15025
+ realpathSync as realpathSync3,
15026
+ unlinkSync,
15027
+ writeFileSync as writeFileSync12
15028
+ } from "fs";
15029
+ import { dirname as dirname20, join as join34, resolve as resolve26 } from "path";
14965
15030
  var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
14966
15031
  if (exitHandlersRegistered)
14967
15032
  return;
@@ -15004,6 +15069,13 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
15004
15069
  const locks = readHeldLockEnv();
15005
15070
  locks.delete(buildDirectory);
15006
15071
  writeHeldLockEnv(locks);
15072
+ }, lockProjectRoot = (buildDirectory) => {
15073
+ const projectRoot = dirname20(resolve26(buildDirectory));
15074
+ try {
15075
+ return realpathSync3.native(projectRoot);
15076
+ } catch {
15077
+ return projectRoot;
15078
+ }
15007
15079
  }, writeLockFileSync = (lockPath, metadata) => {
15008
15080
  mkdirSync12(dirname20(lockPath), { recursive: true });
15009
15081
  writeFileSync12(lockPath, JSON.stringify(metadata, null, 2), { flag: "wx" });
@@ -15012,11 +15084,13 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
15012
15084
  const raw = readFileSync21(lockPath, "utf-8");
15013
15085
  const parsed = JSON.parse(raw);
15014
15086
  if (typeof parsed === "object" && parsed !== null && typeof parsed.pid === "number") {
15015
- return {
15087
+ const metadata = {
15016
15088
  pid: parsed.pid,
15017
15089
  port: typeof parsed.port === "number" ? parsed.port : null,
15090
+ projectRoot: typeof parsed.projectRoot === "string" ? parsed.projectRoot : undefined,
15018
15091
  startedAt: typeof parsed.startedAt === "string" ? parsed.startedAt : new Date().toISOString()
15019
15092
  };
15093
+ return metadata;
15020
15094
  }
15021
15095
  } catch {}
15022
15096
  return null;
@@ -15037,6 +15111,11 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
15037
15111
  unlinkSync(lockPath);
15038
15112
  console.warn(`[absolutejs] removed stale lock from PID ${pid}`);
15039
15113
  } catch {}
15114
+ }, removeForeignLockSync = (lockPath, existing) => {
15115
+ try {
15116
+ unlinkSync(lockPath);
15117
+ console.warn(`[absolutejs] removed a build lock copied from ${existing.projectRoot} (PID ${existing.pid} holds the original project, not this one)`);
15118
+ } catch {}
15040
15119
  }, LOCK_POLL_MS = 250, DEFAULT_WAIT_TIMEOUT_MS = 120000, acquireBuildDirectoryLock = async (buildDirectory, options = {}) => {
15041
15120
  registerExitHandlersOnce();
15042
15121
  if (readHeldLockEnv().has(buildDirectory)) {
@@ -15058,9 +15137,11 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
15058
15137
  const waitTimeoutMs = options.waitTimeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
15059
15138
  const start = Date.now();
15060
15139
  const tryCreate = () => {
15140
+ mkdirSync12(dirname20(lockPath), { recursive: true });
15061
15141
  writeLockFileSync(lockPath, {
15062
15142
  pid: process.pid,
15063
15143
  port: options.port ?? null,
15144
+ projectRoot: lockProjectRoot(buildDirectory),
15064
15145
  startedAt: new Date().toISOString()
15065
15146
  });
15066
15147
  };
@@ -15082,6 +15163,10 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
15082
15163
  removeStaleLockSync(lockPath, existing.pid);
15083
15164
  continue;
15084
15165
  }
15166
+ if (existing.projectRoot !== undefined && existing.projectRoot !== lockProjectRoot(buildDirectory)) {
15167
+ removeForeignLockSync(lockPath, existing);
15168
+ continue;
15169
+ }
15085
15170
  if (wait && Date.now() - start < waitTimeoutMs) {
15086
15171
  await Bun.sleep(LOCK_POLL_MS);
15087
15172
  continue;
@@ -15238,7 +15323,7 @@ var init_ssrErrorPage = __esm(() => {
15238
15323
  });
15239
15324
 
15240
15325
  // src/utils/resolveConvention.ts
15241
- import { basename as basename12 } from "path";
15326
+ import { basename as basename13 } from "path";
15242
15327
  var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boolean(value) && typeof value === "object", getMap = () => {
15243
15328
  const value = Reflect.get(globalThis, CONVENTIONS_KEY);
15244
15329
  if (isConventionsMap(value))
@@ -15246,7 +15331,7 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15246
15331
  const empty = {};
15247
15332
  return empty;
15248
15333
  }, derivePageName = (pagePath) => {
15249
- const base = basename12(pagePath);
15334
+ const base = basename13(pagePath);
15250
15335
  const dotIndex = base.indexOf(".");
15251
15336
  const name = dotIndex > 0 ? base.slice(0, dotIndex) : base;
15252
15337
  return toPascal(name);
@@ -15387,6 +15472,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15387
15472
  logConventionRenderError(framework, "error", renderError);
15388
15473
  }
15389
15474
  return null;
15475
+ }, isPageRequest = (request) => {
15476
+ if (request.headers.get("hx-request") === "true")
15477
+ return true;
15478
+ if (request.headers.get("sec-fetch-dest") === "document")
15479
+ return true;
15480
+ return (request.headers.get("accept") ?? "").includes("text/html");
15390
15481
  }, renderConventionError = async (framework, pageName, error) => {
15391
15482
  const errorProps = buildErrorProps(error);
15392
15483
  const frameworkResponse = await tryFrameworkErrorConvention(framework, pageName, errorProps, error);
@@ -15398,12 +15489,6 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
15398
15489
  return htmlResponse;
15399
15490
  }
15400
15491
  return null;
15401
- }, isPageRequest = (request) => {
15402
- if (request.headers.get("hx-request") === "true")
15403
- return true;
15404
- if (request.headers.get("sec-fetch-dest") === "document")
15405
- return true;
15406
- return (request.headers.get("accept") ?? "").includes("text/html");
15407
15492
  }, renderStaticRouteError = async (request, error) => {
15408
15493
  if (!isPageRequest(request))
15409
15494
  return null;
@@ -15545,7 +15630,7 @@ var init_resolveConvention = __esm(() => {
15545
15630
  });
15546
15631
 
15547
15632
  // src/utils/spaRouteManifest.ts
15548
- import { basename as basename13 } from "path";
15633
+ import { basename as basename14 } from "path";
15549
15634
  var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
15550
15635
  Reflect.set(globalThis, SPA_ROUTES_KEY, hosts);
15551
15636
  }, isRuntimeSpaHost = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "framework") === "string", getSpaRouteManifest = () => {
@@ -15581,7 +15666,7 @@ var SPA_ROUTES_KEY = "__absoluteSpaRoutes", setSpaRouteManifest = (hosts) => {
15581
15666
  expression += `/${segment.replace(/[.+?^${}()|[\]\\]/g, "\\$&")}`;
15582
15667
  }
15583
15668
  return new RegExp(`${expression || "^/"}/?$`);
15584
- }, sourcePageName = (sourceFile) => basename13(sourceFile).replace(/\.[^.]+$/, "").toLowerCase(), isKnownSpaRoute = (framework, pageName, request) => {
15669
+ }, sourcePageName = (sourceFile) => basename14(sourceFile).replace(/\.[^.]+$/, "").toLowerCase(), isKnownSpaRoute = (framework, pageName, request) => {
15585
15670
  if (!request)
15586
15671
  return true;
15587
15672
  let pathname;
@@ -15621,7 +15706,7 @@ var isTestSourcePath = (file) => {
15621
15706
 
15622
15707
  // src/mobile/deviceCapabilities.ts
15623
15708
  import { existsSync as existsSync29, readFileSync as readFileSync22 } from "fs";
15624
- import { extname as extname13, join as join35, relative as relative19, resolve as resolve26 } from "path";
15709
+ import { extname as extname13, join as join35, relative as relative19, resolve as resolve27 } from "path";
15625
15710
  import { fileURLToPath as fileURLToPath3 } from "url";
15626
15711
  var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES, ADAPTERS2, 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) => {
15627
15712
  const value = JSON.parse(readFileSync22(path, "utf8"));
@@ -15754,7 +15839,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
15754
15839
  }
15755
15840
  }, loadAbsoluteDeviceCapabilityProviders = (projectRoot, provider = "capacitor") => {
15756
15841
  const adapter = ADAPTERS2[provider];
15757
- let path = join35(resolve26(projectRoot), "node_modules", adapter, "package.json");
15842
+ let path = join35(resolve27(projectRoot), "node_modules", adapter, "package.json");
15758
15843
  try {
15759
15844
  readFileSync22(path, "utf8");
15760
15845
  } catch {
@@ -15809,7 +15894,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
15809
15894
  if (missing.includes(spec))
15810
15895
  return false;
15811
15896
  try {
15812
- return readJson(join35(resolve26(projectRoot), "node_modules", packageName, "package.json")).version !== spec.slice(separator + 1);
15897
+ return readJson(join35(resolve27(projectRoot), "node_modules", packageName, "package.json")).version !== spec.slice(separator + 1);
15813
15898
  } catch {
15814
15899
  return true;
15815
15900
  }
@@ -15818,7 +15903,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
15818
15903
  if (unmet.length > 0)
15819
15904
  throw new TypeError(`Device capabilities ${plan.capabilities.join(", ")} require ${unmet.join(", ")}. Run absolute mobile sync and approve the detected capability plugins.`);
15820
15905
  }, directAbsoluteProjectPackages = (projectRoot) => {
15821
- const manifest = readJson(join35(resolve26(projectRoot), "package.json"));
15906
+ const manifest = readJson(join35(resolve27(projectRoot), "package.json"));
15822
15907
  const packages = new Set;
15823
15908
  for (const field of ["dependencies", "devDependencies"]) {
15824
15909
  const dependencies = manifest[field];
@@ -15828,16 +15913,16 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
15828
15913
  }
15829
15914
  return packages;
15830
15915
  }, discoverAbsoluteDeviceCapabilities = (projectRoot, providers = loadAbsoluteDeviceCapabilityProviders(projectRoot)) => {
15831
- const root = resolve26(projectRoot);
15916
+ const root = resolve27(projectRoot);
15832
15917
  if (!existsSync29(root))
15833
15918
  return [];
15834
15919
  const known = new Set(Object.keys(providers));
15835
15920
  const capabilities = new Set;
15836
15921
  for (const path of SOURCE_GLOB.scanSync({ cwd: root })) {
15837
- const portable = relative19(root, resolve26(root, path)).replaceAll("\\", "/");
15922
+ const portable = relative19(root, resolve27(root, path)).replaceAll("\\", "/");
15838
15923
  if (isIgnored(portable))
15839
15924
  continue;
15840
- const source = readFileSync22(resolve26(root, portable), "utf8");
15925
+ const source = readFileSync22(resolve27(root, portable), "utf8");
15841
15926
  for (const name of importedCapabilities(source, portable))
15842
15927
  if (known.has(name))
15843
15928
  capabilities.add(name);
@@ -15847,12 +15932,12 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
15847
15932
  const packageName = spec.slice(0, spec.lastIndexOf("@"));
15848
15933
  return !directPackages.has(packageName);
15849
15934
  }), projectImportsAbsoluteDeviceCapability = (projectRoot, capability) => {
15850
- const root = resolve26(projectRoot);
15935
+ const root = resolve27(projectRoot);
15851
15936
  for (const path of SOURCE_GLOB.scanSync({ cwd: root })) {
15852
- const portable = relative19(root, resolve26(root, path)).replaceAll("\\", "/");
15937
+ const portable = relative19(root, resolve27(root, path)).replaceAll("\\", "/");
15853
15938
  if (isIgnored(portable))
15854
15939
  continue;
15855
- const source = readFileSync22(resolve26(root, portable), "utf8");
15940
+ const source = readFileSync22(resolve27(root, portable), "utf8");
15856
15941
  if (importedCapabilities(source, portable).has(capability))
15857
15942
  return true;
15858
15943
  }
@@ -16049,7 +16134,7 @@ var init_client = __esm(() => {
16049
16134
 
16050
16135
  // src/mobile/syncSchema.ts
16051
16136
  import { readFileSync as readFileSync23 } from "fs";
16052
- import { dirname as dirname21, join as join36, resolve as resolve27 } from "path";
16137
+ import { dirname as dirname21, join as join36, resolve as resolve28 } from "path";
16053
16138
  var object2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
16054
16139
  try {
16055
16140
  const value = JSON.parse(readFileSync23(path, "utf8"));
@@ -16066,7 +16151,7 @@ var object2 = (value) => typeof value === "object" && value !== null && !Array.i
16066
16151
  return;
16067
16152
  return Reflect.get(sync, "localSchema");
16068
16153
  }, packageManifestPath = (projectRoot, packageName) => {
16069
- let directory = resolve27(projectRoot);
16154
+ let directory = resolve28(projectRoot);
16070
16155
  while (true) {
16071
16156
  const candidate = join36(directory, "node_modules", packageName, "package.json");
16072
16157
  const manifest = manifestAt(candidate);
@@ -16299,7 +16384,7 @@ var object2 = (value) => typeof value === "object" && value !== null && !Array.i
16299
16384
  Reflect.get(manifest, "devDependencies"),
16300
16385
  Reflect.get(manifest, "peerDependencies")
16301
16386
  ].flatMap((dependencies) => object2(dependencies) ? Object.keys(dependencies) : []).filter((name, index, names) => names.indexOf(name) === index).sort(), discoverAbsoluteSyncSchema = (projectRoot) => {
16302
- const appManifestPath = join36(resolve27(projectRoot), "package.json");
16387
+ const appManifestPath = join36(resolve28(projectRoot), "package.json");
16303
16388
  const appManifest = manifestAt(appManifestPath);
16304
16389
  if (!appManifest)
16305
16390
  return {
@@ -16602,7 +16687,7 @@ var init_vitals = () => {};
16602
16687
 
16603
16688
  // src/core/precompressed.ts
16604
16689
  import { readdir as readdir4, readFile as readFile7, stat as stat2, writeFile as writeFile8 } from "fs/promises";
16605
- import { extname as extname14, join as join39, relative as relative20, resolve as resolve28, sep as sep6 } from "path";
16690
+ import { extname as extname14, join as join39, relative as relative20, resolve as resolve29, sep as sep6 } from "path";
16606
16691
  import { promisify } from "util";
16607
16692
  import { brotliCompress, constants, gzip } from "zlib";
16608
16693
  import { Elysia as Elysia2 } from "elysia";
@@ -16630,7 +16715,7 @@ var COMPRESSIBLE_EXTENSIONS, MIN_COMPRESSIBLE_BYTES = 1024, MIN_SAVING_RATIO = 0
16630
16715
  if (set.headers["cache-control"] !== undefined)
16631
16716
  set.headers["cache-control"] = policy;
16632
16717
  }), createPrecompressedPlugin = async (buildDir, ignorePatterns = []) => {
16633
- const root = resolve28(buildDir);
16718
+ const root = resolve29(buildDir);
16634
16719
  const copies = new Map;
16635
16720
  const isIgnored = (pathname) => ignorePatterns.some((pattern) => typeof pattern === "string" ? pathname.includes(pattern) : pattern.test(pathname));
16636
16721
  for (const path of await listFiles(root)) {
@@ -17428,7 +17513,7 @@ var init_typescript_translator = __esm(() => {
17428
17513
 
17429
17514
  // src/dev/angular/fastHmrCompiler.ts
17430
17515
  import { existsSync as existsSync30, readFileSync as readFileSync24, statSync as statSync5 } from "fs";
17431
- import { dirname as dirname23, extname as extname15, relative as relative21, resolve as resolve29 } from "path";
17516
+ import { dirname as dirname23, extname as extname15, relative as relative21, resolve as resolve30 } from "path";
17432
17517
  var fail2 = (reason, detail, location) => ({
17433
17518
  detail,
17434
17519
  ok: false,
@@ -17740,7 +17825,7 @@ var fail2 = (reason, detail, location) => ({
17740
17825
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
17741
17826
  return true;
17742
17827
  }
17743
- const base = resolve29(componentDir, spec);
17828
+ const base = resolve30(componentDir, spec);
17744
17829
  const candidates = [
17745
17830
  `${base}.ts`,
17746
17831
  `${base}.tsx`,
@@ -18556,7 +18641,7 @@ var fail2 = (reason, detail, location) => ({
18556
18641
  return null;
18557
18642
  }, resolveDtsFromSpec = (spec, fromDir) => {
18558
18643
  const stripped = spec.replace(/\.[mc]?js$/, "");
18559
- const base = resolve29(fromDir, stripped);
18644
+ const base = resolve30(fromDir, stripped);
18560
18645
  const candidates = [
18561
18646
  `${base}.d.ts`,
18562
18647
  `${base}.d.mts`,
@@ -18580,7 +18665,7 @@ var fail2 = (reason, detail, location) => ({
18580
18665
  return null;
18581
18666
  }, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
18582
18667
  if (spec.startsWith(".") || spec.startsWith("/")) {
18583
- const base = resolve29(componentDir, spec);
18668
+ const base = resolve30(componentDir, spec);
18584
18669
  const candidates = [
18585
18670
  `${base}.ts`,
18586
18671
  `${base}.tsx`,
@@ -18799,13 +18884,13 @@ var fail2 = (reason, detail, location) => ({
18799
18884
  }
18800
18885
  if (!matches)
18801
18886
  continue;
18802
- const resolved = resolve29(componentDir, spec);
18887
+ const resolved = resolve30(componentDir, spec);
18803
18888
  for (const ext of TS_EXTENSIONS) {
18804
18889
  const candidate = resolved + ext;
18805
18890
  if (existsSync30(candidate))
18806
18891
  return candidate;
18807
18892
  }
18808
- const indexCandidate = resolve29(resolved, "index.ts");
18893
+ const indexCandidate = resolve30(resolved, "index.ts");
18809
18894
  if (existsSync30(indexCandidate))
18810
18895
  return indexCandidate;
18811
18896
  }
@@ -19050,7 +19135,7 @@ ${transpiled}
19050
19135
  return compileStyleFileIfNeeded(abs);
19051
19136
  return compileStyleFileIfNeededSync(abs);
19052
19137
  }, resolveAndReadStyleResource = async (componentDir, url) => {
19053
- const abs = resolve29(componentDir, url);
19138
+ const abs = resolve30(componentDir, url);
19054
19139
  if (!existsSync30(abs)) {
19055
19140
  const failure = {
19056
19141
  detail: `Style file not found: ${url} (looked for ${abs})`,
@@ -19094,7 +19179,7 @@ ${block}
19094
19179
  const cached = projectOptionsCache.get(projectRoot);
19095
19180
  if (cached !== undefined)
19096
19181
  return cached;
19097
- const tsconfigPath = resolve29(projectRoot, "tsconfig.json");
19182
+ const tsconfigPath = resolve30(projectRoot, "tsconfig.json");
19098
19183
  const opts = {};
19099
19184
  if (existsSync30(tsconfigPath)) {
19100
19185
  try {
@@ -19178,7 +19263,7 @@ ${block}
19178
19263
  templateText = decoratorMeta.template;
19179
19264
  templatePath = componentFilePath;
19180
19265
  } else if (decoratorMeta.templateUrl) {
19181
- const tplAbs = resolve29(componentDir, decoratorMeta.templateUrl);
19266
+ const tplAbs = resolve30(componentDir, decoratorMeta.templateUrl);
19182
19267
  if (!existsSync30(tplAbs)) {
19183
19268
  return fail2("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
19184
19269
  }
@@ -19840,7 +19925,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
19840
19925
 
19841
19926
  // src/build/scanAngularPageRoutes.ts
19842
19927
  import { readdirSync as readdirSync5, readFileSync as readFileSync27 } from "fs";
19843
- import { basename as basename14, join as join42 } from "path";
19928
+ import { basename as basename15, join as join42 } from "path";
19844
19929
  var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
19845
19930
  const idx = filePath.lastIndexOf(".");
19846
19931
  if (idx === -1)
@@ -19849,7 +19934,7 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
19849
19934
  }, isPageFile = (filePath) => {
19850
19935
  if (!hasSourceExtension4(filePath))
19851
19936
  return false;
19852
- const base = basename14(filePath);
19937
+ const base = basename15(filePath);
19853
19938
  if (base.endsWith(".d.ts"))
19854
19939
  return false;
19855
19940
  if (base.endsWith(".test.ts"))
@@ -19915,7 +20000,7 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
19915
20000
  continue;
19916
20001
  }
19917
20002
  const hasRoutes = hasTopLevelRoutesExport(source, file);
19918
- const base = basename14(file).replace(/\.[cm]?[tj]sx?$/, "");
20003
+ const base = basename15(file).replace(/\.[cm]?[tj]sx?$/, "");
19919
20004
  const manifestKey = toPascal(base);
19920
20005
  out.push({
19921
20006
  hasRoutes,
@@ -20239,9 +20324,9 @@ import {
20239
20324
  dirname as dirname25,
20240
20325
  isAbsolute as isAbsolute9,
20241
20326
  join as join44,
20242
- basename as basename15,
20327
+ basename as basename16,
20243
20328
  extname as extname16,
20244
- resolve as resolve30,
20329
+ resolve as resolve31,
20245
20330
  relative as relative22,
20246
20331
  sep as sep7
20247
20332
  } from "path";
@@ -20255,19 +20340,19 @@ var withResolvedSources = (map, sourceFile) => {
20255
20340
  return map;
20256
20341
  return {
20257
20342
  ...map,
20258
- sources: sources.map((source) => typeof source === "string" && !isAbsolute9(source) ? resolve30(dirname25(sourceFile), source) : source)
20343
+ sources: sources.map((source) => typeof source === "string" && !isAbsolute9(source) ? resolve31(dirname25(sourceFile), source) : source)
20259
20344
  };
20260
20345
  }, resolveDevClientDir2 = () => {
20261
20346
  const projectRoot = process.cwd();
20262
- const fromSource = resolve30(import.meta.dir, "../dev/client");
20347
+ const fromSource = resolve31(import.meta.dir, "../dev/client");
20263
20348
  if (existsSync32(fromSource) && fromSource.startsWith(projectRoot)) {
20264
20349
  return fromSource;
20265
20350
  }
20266
- const fromNodeModules = resolve30(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
20351
+ const fromNodeModules = resolve31(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
20267
20352
  if (existsSync32(fromNodeModules))
20268
20353
  return fromNodeModules;
20269
- return resolve30(import.meta.dir, "./dev/client");
20270
- }, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, transpiler3, DYNAMIC_IMPORT_PATTERN, LAZY_MODULE_REGISTRY_NAME = "absolutejs.svelte.lazy-modules", LAZY_RESOLVED_NAME = "absolutejs.svelte.lazy-resolved", LAZY_PRELOAD_MAX_DEPTH = 5, toSourceId = (path) => relative22(process.cwd(), path).replace(/\\/g, "/"), removeUnusedRequireHelper = (code) => {
20354
+ return resolve31(import.meta.dir, "./dev/client");
20355
+ }, devClientDir2, hmrClientPath3, persistentCaches, sourceHashCaches, transpiler3, DYNAMIC_IMPORT_PATTERN, LAZY_MODULE_REGISTRY_NAME = "absolutejs.svelte.lazy-modules", LAZY_RESOLVED_NAME = "absolutejs.svelte.lazy-resolved", LAZY_PRELOAD_MAX_DEPTH = 5, toSourceId = (path) => relative22(process.cwd(), path).replace(/\\/g, "/"), removeUnusedRequireHelper = (code) => {
20271
20356
  const helperStart = code.indexOf("var __require = /* @__PURE__ */");
20272
20357
  if (helperStart === -1) {
20273
20358
  return code;
@@ -20293,7 +20378,7 @@ var withResolvedSources = (map, sourceFile) => {
20293
20378
  }, resolveRelativeModule2 = async (spec, from) => {
20294
20379
  if (!spec.startsWith("."))
20295
20380
  return null;
20296
- const basePath = resolve30(dirname25(from), spec);
20381
+ const basePath = resolve31(dirname25(from), spec);
20297
20382
  const candidates = [
20298
20383
  basePath,
20299
20384
  `${basePath}.ts`,
@@ -20320,7 +20405,7 @@ var withResolvedSources = (map, sourceFile) => {
20320
20405
  const resolved = resolvePackageImport(spec);
20321
20406
  return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
20322
20407
  }
20323
- const basePath = resolve30(dirname25(from), spec);
20408
+ const basePath = resolve31(dirname25(from), spec);
20324
20409
  const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
20325
20410
  if (!explicit) {
20326
20411
  const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
@@ -20347,9 +20432,13 @@ var withResolvedSources = (map, sourceFile) => {
20347
20432
  client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
20348
20433
  server: toServer.startsWith(".") ? toServer : `./${toServer}`
20349
20434
  });
20350
- }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
20435
+ }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors, options = {}) => {
20351
20436
  const { compile, compileModule, preprocess } = await import("svelte/compiler");
20352
- const generatedDir = getFrameworkGeneratedDir("svelte");
20437
+ const externalCss = options.externalCss === true;
20438
+ const cssMode = externalCss ? "external" : "injected";
20439
+ const persistentCache = persistentCaches[cssMode];
20440
+ const sourceHashCache = sourceHashCaches[cssMode];
20441
+ const generatedDir = externalCss ? join44(getFrameworkGeneratedDir("svelte"), "islands") : getFrameworkGeneratedDir("svelte");
20353
20442
  const clientDir = join44(generatedDir, "client");
20354
20443
  const indexDir = join44(generatedDir, "indexes");
20355
20444
  const serverDir = join44(generatedDir, "server");
@@ -20364,7 +20453,7 @@ var withResolvedSources = (map, sourceFile) => {
20364
20453
  const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
20365
20454
  const prevHash = sourceHashCache.get(src);
20366
20455
  const persistent = persistentCache.get(src);
20367
- if (prevHash === contentHash && persistent && existsSync32(persistent.ssr) && existsSync32(persistent.client)) {
20456
+ if (prevHash === contentHash && persistent && existsSync32(persistent.ssr) && existsSync32(persistent.client) && (!persistent.css || existsSync32(persistent.css))) {
20368
20457
  cache.set(src, persistent);
20369
20458
  return persistent;
20370
20459
  }
@@ -20383,7 +20472,7 @@ var withResolvedSources = (map, sourceFile) => {
20383
20472
  const fileRoute = fileRouteFor(src);
20384
20473
  const rawRel = fileRoute ? "pages" : dirname25(relative22(svelteRoot, src)).replace(/\\/g, "/");
20385
20474
  const relDir = rawRel.startsWith("..") ? `_ext/${relative22(process.cwd(), dirname25(src)).replace(/\\/g, "/")}` : rawRel;
20386
- const baseName = fileRoute?.name ?? basename15(src).replace(/\.svelte(\.(ts|js))?$/, "");
20475
+ const baseName = fileRoute?.name ?? basename16(src).replace(/\.svelte(\.(ts|js))?$/, "");
20387
20476
  const staticImportPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
20388
20477
  const dynamicImportPaths = Array.from(transpiledServer.matchAll(DYNAMIC_IMPORT_PATTERN)).map((match) => match[1]).filter((path) => path !== undefined);
20389
20478
  const importPaths = Array.from(new Set([...staticImportPaths, ...dynamicImportPaths]));
@@ -20429,14 +20518,14 @@ var withResolvedSources = (map, sourceFile) => {
20429
20518
  };
20430
20519
  const generate = (mode) => {
20431
20520
  const transpiled = mode === "server" ? transpiledServer : transpiledClient;
20432
- const compiledJs = isModule ? compileModule(transpiled, {
20521
+ const compiled = isModule ? compileModule(transpiled, {
20433
20522
  dev: mode === "client" && dev,
20434
20523
  experimental: {
20435
20524
  async: transformedByLowering
20436
20525
  },
20437
20526
  filename: src
20438
- }).js : compile(transpiled, {
20439
- css: "injected",
20527
+ }) : compile(transpiled, {
20528
+ css: externalCss && mode === "client" ? "external" : "injected",
20440
20529
  dev: mode === "client" && dev,
20441
20530
  experimental: {
20442
20531
  async: transformedByLowering
@@ -20444,7 +20533,8 @@ var withResolvedSources = (map, sourceFile) => {
20444
20533
  filename: src,
20445
20534
  generate: mode,
20446
20535
  hmr: isDev
20447
- }).js;
20536
+ });
20537
+ const compiledJs = compiled.js;
20448
20538
  let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
20449
20539
  if (mode === "client" && isDev) {
20450
20540
  const moduleKey = `/@src/${relative22(process.cwd(), src).replace(/\\/g, "/")}`;
@@ -20457,7 +20547,8 @@ var withResolvedSources = (map, sourceFile) => {
20457
20547
  code = removeUnusedRequireHelper(code);
20458
20548
  }
20459
20549
  code += islandMetadataExports;
20460
- return { code, map: compiledJs.map };
20550
+ const css = !isModule && externalCss && mode === "client" ? (compiled.css?.code ?? "").trim() : "";
20551
+ return { code, css, map: compiledJs.map };
20461
20552
  };
20462
20553
  const ssrPath = join44(serverDir, relDir, `${baseName}.js`);
20463
20554
  const clientPath = join44(clientDir, relDir, `${baseName}.js`);
@@ -20483,6 +20574,7 @@ export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
20483
20574
  ]);
20484
20575
  const inlineMap = (map) => map ? `${inlineSourceMapComment(withResolvedSources(map, src))}
20485
20576
  ` : "";
20577
+ let cssFile;
20486
20578
  if (isModule) {
20487
20579
  const generated = generate("client");
20488
20580
  const bundle = rewriteExternalImports(generated.code, "client") + inlineMap(generated.map);
@@ -20495,14 +20587,21 @@ export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
20495
20587
  const clientGen = generate("client");
20496
20588
  const serverCode = rewriteExternalImports(serverGen.code, "server");
20497
20589
  const serverBundle = serverCode + sourceExport(serverCode) + inlineMap(serverGen.map);
20498
- const clientBundle = rewriteExternalImports(clientGen.code, "client") + lazyRegistrations + inlineMap(clientGen.map);
20590
+ const cssPath = clientPath.replace(/\.js$/, ".css");
20591
+ const cssImport = clientGen.css ? `
20592
+ import ${JSON.stringify(`./${basename16(cssPath)}`)};
20593
+ ` : "";
20594
+ const clientBundle = rewriteExternalImports(clientGen.code, "client") + lazyRegistrations + cssImport + inlineMap(clientGen.map);
20595
+ cssFile = clientGen.css ? cssPath : undefined;
20499
20596
  await Promise.all([
20500
20597
  write2(ssrPath, serverBundle),
20501
- write2(clientPath, clientBundle)
20598
+ write2(clientPath, clientBundle),
20599
+ ...clientGen.css ? [write2(cssPath, clientGen.css)] : []
20502
20600
  ]);
20503
20601
  }
20504
20602
  const built = {
20505
20603
  client: clientPath,
20604
+ css: cssFile,
20506
20605
  hasAwaitSlot: loweredAwaitServerSource.transformed || loweredAwaitClientSource.transformed || loweredServerSource.transformed || loweredClientSource.transformed || hasAwaitSlotFromChildren,
20507
20606
  isModule,
20508
20607
  ssr: ssrPath
@@ -20515,7 +20614,7 @@ export const ${LAZY_SOURCE_EXPORT} = ${sourceId};${componentStamp}`;
20515
20614
  const componentRoots = roots.filter((root) => !root.isModule);
20516
20615
  await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
20517
20616
  const relClientDir = dirname25(relative22(clientDir, client));
20518
- const name = basename15(client, extname16(client));
20617
+ const name = basename16(client, extname16(client));
20519
20618
  const indexPath = join44(indexDir, relClientDir, `${name}.js`);
20520
20619
  const importRaw = relative22(dirname25(indexPath), client).split(sep7).join("/");
20521
20620
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
@@ -20632,7 +20731,7 @@ if (typeof window !== "undefined") {
20632
20731
  svelteClientPaths: roots.map(({ client }) => client),
20633
20732
  svelteIndexPaths: componentRoots.map(({ client }) => {
20634
20733
  const rel = dirname25(relative22(clientDir, client));
20635
- return join44(indexDir, rel, basename15(client));
20734
+ return join44(indexDir, rel, basename16(client));
20636
20735
  }),
20637
20736
  svelteServerPaths: roots.map(({ ssr }) => ssr)
20638
20737
  };
@@ -20650,8 +20749,14 @@ var init_compileSvelte = __esm(() => {
20650
20749
  init_lazyModule();
20651
20750
  devClientDir2 = resolveDevClientDir2();
20652
20751
  hmrClientPath3 = join44(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
20653
- persistentCache = new Map;
20654
- sourceHashCache = new Map;
20752
+ persistentCaches = {
20753
+ external: new Map,
20754
+ injected: new Map
20755
+ };
20756
+ sourceHashCaches = {
20757
+ external: new Map,
20758
+ injected: new Map
20759
+ };
20655
20760
  transpiler3 = new Transpiler3({ loader: "ts", target: "browser" });
20656
20761
  DYNAMIC_IMPORT_PATTERN = /\bimport\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
20657
20762
  });
@@ -21162,8 +21267,8 @@ var init_chainInlineSourcemaps = __esm(() => {
21162
21267
  import { createHash as createHash5 } from "crypto";
21163
21268
  import { existsSync as existsSync33, readFileSync as readFileSync30 } from "fs";
21164
21269
  import { mkdir as mkdir8, rename, writeFile as writeFile9 } from "fs/promises";
21165
- import { join as join45, resolve as resolve31 } from "path";
21166
- var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs", CACHE_FORMAT_VERSION = 3, FILE_NAME_HASH_LENGTH = 32, vueCompileCacheEnabled = () => process.env.ABSOLUTE_COMPILE_CACHE !== "0", hashContent = (content) => createHash5("sha256").update(content).digest("hex"), hashParts = (parts) => {
21270
+ import { join as join45, resolve as resolve32 } from "path";
21271
+ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs", CACHE_FORMAT_VERSION = 4, FILE_NAME_HASH_LENGTH = 32, vueCompileCacheEnabled = () => process.env.ABSOLUTE_COMPILE_CACHE !== "0", hashContent = (content) => createHash5("sha256").update(content).digest("hex"), hashParts = (parts) => {
21167
21272
  const hash = createHash5("sha256");
21168
21273
  for (const part of parts) {
21169
21274
  hash.update(part);
@@ -21172,8 +21277,8 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
21172
21277
  return hash.digest("hex");
21173
21278
  }, readOwnPackageVersion = () => {
21174
21279
  const candidates = [
21175
- resolve31(import.meta.dir, "..", "..", "package.json"),
21176
- resolve31(import.meta.dir, "..", "package.json")
21280
+ resolve32(import.meta.dir, "..", "..", "package.json"),
21281
+ resolve32(import.meta.dir, "..", "package.json")
21177
21282
  ];
21178
21283
  for (const candidate of candidates) {
21179
21284
  try {
@@ -21254,7 +21359,7 @@ __export(exports_emitTsHelpers, {
21254
21359
  var {file: file2, Transpiler: Transpiler4, write: write3 } = globalThis.Bun;
21255
21360
  import { copyFileSync as copyFileSync2, existsSync as existsSync34, readdirSync as readdirSync6, statSync as statSync6 } from "fs";
21256
21361
  import { mkdir as mkdir9, rename as rename2, writeFile as writeFile10 } from "fs/promises";
21257
- import { dirname as dirname26, join as join46, resolve as resolve32, sep as sep8 } from "path";
21362
+ import { dirname as dirname26, join as join46, resolve as resolve33, sep as sep8 } from "path";
21258
21363
  var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 24, transpiler4, cacheDir = () => join46(process.cwd(), ".absolutejs", "compile-cache", CACHE_DIR_NAME2), cacheKey2 = (sourcePath, sourceCode) => {
21259
21364
  const frameworkVersion = frameworkVersionForCache();
21260
21365
  if (!frameworkVersion || !vueCompileCacheEnabled())
@@ -21321,7 +21426,7 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 2, HASH_LENGTH4 = 2
21321
21426
  return false;
21322
21427
  }
21323
21428
  }, resolveImportTarget = (sourceDir, specifier) => {
21324
- const base = resolve32(sourceDir, specifier);
21429
+ const base = resolve33(sourceDir, specifier);
21325
21430
  return IMPORT_CANDIDATE_SUFFIXES.map((suffix) => `${base}${suffix}`).find(isFilePath) ?? base;
21326
21431
  }, rewriteMirrorImports = (code, sourcePath) => {
21327
21432
  const sourceDir = dirname26(sourcePath);
@@ -21385,16 +21490,16 @@ var init_emitTsHelpers = __esm(() => {
21385
21490
  });
21386
21491
 
21387
21492
  // src/build/inlineCssImports.ts
21388
- import { readFileSync as readFileSync31, realpathSync as realpathSync3 } from "fs";
21389
- import { dirname as dirname27, resolve as resolve33 } from "path";
21493
+ import { readFileSync as readFileSync31, realpathSync as realpathSync4 } from "fs";
21494
+ import { dirname as dirname27, resolve as resolve34 } from "path";
21390
21495
  var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
21391
- const resolved = realpathSync3(cssFilePath);
21496
+ const resolved = realpathSync4(cssFilePath);
21392
21497
  if (visited.has(resolved))
21393
21498
  return "";
21394
21499
  visited.add(resolved);
21395
21500
  const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
21396
21501
  return cssContent.replace(importRegex, (match, _quote, relPath) => {
21397
- const importedPath = resolve33(dirname27(cssFilePath), relPath);
21502
+ const importedPath = resolve34(dirname27(cssFilePath), relPath);
21398
21503
  if (!isFile(importedPath))
21399
21504
  return match;
21400
21505
  const importedContent = readFileSync31(importedPath, "utf-8");
@@ -21406,8 +21511,8 @@ var init_inlineCssImports = __esm(() => {
21406
21511
  });
21407
21512
 
21408
21513
  // src/build/compileVueSfc.ts
21409
- import { existsSync as existsSync35, readFileSync as readFileSync32, realpathSync as realpathSync4 } from "fs";
21410
- import { dirname as dirname28, join as join47, relative as relative23, resolve as resolve34 } from "path";
21514
+ import { existsSync as existsSync35, readFileSync as readFileSync32, realpathSync as realpathSync5 } from "fs";
21515
+ import { dirname as dirname28, join as join47, relative as relative23, resolve as resolve35 } from "path";
21411
21516
  var {Transpiler: Transpiler5 } = globalThis.Bun;
21412
21517
  var transpiler5, toJs = (filePath, sourceDir) => {
21413
21518
  if (filePath.endsWith(".vue"))
@@ -21416,20 +21521,20 @@ var transpiler5, toJs = (filePath, sourceDir) => {
21416
21521
  return filePath.replace(/\.ts$/, ".js");
21417
21522
  if (isStylePath(filePath)) {
21418
21523
  if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
21419
- return resolve34(sourceDir, filePath);
21524
+ return resolve35(sourceDir, filePath);
21420
21525
  }
21421
21526
  return filePath;
21422
21527
  }
21423
21528
  if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
21424
- const directTs = resolve34(sourceDir, `${filePath}.ts`);
21529
+ const directTs = resolve35(sourceDir, `${filePath}.ts`);
21425
21530
  if (existsSync35(directTs))
21426
21531
  return `${filePath}.js`;
21427
- const indexedTs = resolve34(sourceDir, filePath, "index.ts");
21532
+ const indexedTs = resolve35(sourceDir, filePath, "index.ts");
21428
21533
  if (existsSync35(indexedTs))
21429
21534
  return `${filePath}/index.js`;
21430
21535
  }
21431
21536
  return `${filePath}.js`;
21432
- }, stripExports2 = (code) => code.replace(/export\s+default/, "const script ="), mergeVueImports2 = (code) => {
21537
+ }, mergeVueImports2 = (code) => {
21433
21538
  const lines = code.split(`
21434
21539
  `);
21435
21540
  const specifierSet = new Set;
@@ -21472,7 +21577,7 @@ const ${localName} = (source) => ${importedName}(
21472
21577
  : { ...source, loader: () => __absoluteResolveAsyncVueComponent(source.loader) },
21473
21578
  );`;
21474
21579
  return code.replace(vueImportRegex, `import { ${specifiers.join(", ")} } from 'vue';${wrapper}`);
21475
- }, toOutputImport = (specifier, sourceDir) => specifier.startsWith("./") || specifier.startsWith("../") ? vueMirrorImport(join47(sourceDir, "__importer__"), specifier, resolve34(sourceDir, specifier)) : specifier, rewriteRelativeImports = (code, sourceDir) => code.replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toOutputImport(toJs(relativeImport, sourceDir), sourceDir)}${quoteEnd}`), compileVueSfc = async ({
21580
+ }, toOutputImport = (specifier, sourceDir) => specifier.startsWith("./") || specifier.startsWith("../") ? vueMirrorImport(join47(sourceDir, "__importer__"), specifier, resolve35(sourceDir, specifier)) : specifier, rewriteRelativeImports = (code, sourceDir) => code.replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toOutputImport(toJs(relativeImport, sourceDir), sourceDir)}${quoteEnd}`), compileVueSfc = async ({
21476
21581
  clientOutputPath,
21477
21582
  componentId,
21478
21583
  hmrId,
@@ -21492,7 +21597,7 @@ const ${localName} = (source) => ${importedName}(
21492
21597
  const compiledScript = hasScript ? compiler.compileScript(descriptor, {
21493
21598
  fs: {
21494
21599
  fileExists: isFile,
21495
- realpath: realpathSync4,
21600
+ realpath: realpathSync5,
21496
21601
  readFile: (file) => {
21497
21602
  if (!isFile(file))
21498
21603
  return;
@@ -21501,19 +21606,20 @@ const ${localName} = (source) => ${importedName}(
21501
21606
  return content;
21502
21607
  }
21503
21608
  },
21609
+ genDefaultAs: "script",
21504
21610
  id: componentId,
21505
21611
  inlineTemplate: false,
21506
21612
  sourceMap: true
21507
- }) : { bindings: {}, content: "export default {};", map: undefined };
21613
+ }) : { bindings: {}, content: "const script = {};", map: undefined };
21508
21614
  const typeDependencies = "deps" in compiledScript ? compiledScript.deps ?? [] : [];
21509
21615
  for (const dep of typeDependencies) {
21510
21616
  if (dep in typeDepHashes || !existsSync35(dep))
21511
21617
  continue;
21512
21618
  typeDepHashes[dep] = hashContent(readFileSync32(dep, "utf-8"));
21513
21619
  }
21514
- const strippedScript = stripExports2(compiledScript.content);
21620
+ const scriptCode = compiledScript.content;
21515
21621
  const sourceDir = dirname28(sourceFilePath);
21516
- const transpiledScript = rewriteRelativeImports(transpiler5.transformSync(strippedScript), sourceDir);
21622
+ const transpiledScript = rewriteRelativeImports(transpiler5.transformSync(scriptCode), sourceDir);
21517
21623
  const generateRenderFunction = (ssr) => {
21518
21624
  const rendered = compiler.compileTemplate({
21519
21625
  compilerOptions: {
@@ -21579,7 +21685,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
21579
21685
  const inlineSourceMapFor = (finalContent) => {
21580
21686
  if (!compiledScript.map || !hasScript)
21581
21687
  return "";
21582
- const remap = buildLineRemap(strippedScript, finalContent);
21688
+ const remap = buildLineRemap(scriptCode, finalContent);
21583
21689
  const mappings = remapGeneratedLines(compiledScript.map.mappings, remap);
21584
21690
  const map = {
21585
21691
  ...compiledScript.map,
@@ -21993,24 +22099,24 @@ var init_workerPool = __esm(() => {
21993
22099
  import { existsSync as existsSync37 } from "fs";
21994
22100
  import { mkdir as mkdir10 } from "fs/promises";
21995
22101
  import {
21996
- basename as basename16,
22102
+ basename as basename17,
21997
22103
  dirname as dirname30,
21998
22104
  isAbsolute as isAbsolute10,
21999
22105
  join as join49,
22000
22106
  relative as relative24,
22001
- resolve as resolve35
22107
+ resolve as resolve36
22002
22108
  } from "path";
22003
22109
  var {file: file3, write: write4 } = globalThis.Bun;
22004
22110
  var resolveDevClientDir3 = () => {
22005
22111
  const projectRoot = process.cwd();
22006
- const fromSource = resolve35(import.meta.dir, "../dev/client");
22112
+ const fromSource = resolve36(import.meta.dir, "../dev/client");
22007
22113
  if (existsSync37(fromSource) && fromSource.startsWith(projectRoot)) {
22008
22114
  return fromSource;
22009
22115
  }
22010
- const fromNodeModules = resolve35(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
22116
+ const fromNodeModules = resolve36(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
22011
22117
  if (existsSync37(fromNodeModules))
22012
22118
  return fromNodeModules;
22013
- return resolve35(import.meta.dir, "./dev/client");
22119
+ return resolve36(import.meta.dir, "./dev/client");
22014
22120
  }, devClientDir3, hmrClientPath4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, detectVueChangeType = (filePath, descriptor) => {
22015
22121
  const prevScript = scriptCache.get(filePath);
22016
22122
  const prevScriptSetup = scriptSetupCache.get(filePath);
@@ -22051,11 +22157,11 @@ var resolveDevClientDir3 = () => {
22051
22157
  return Array.from(new Set(found));
22052
22158
  }, resolveHelperTsPath = (sourceDir, helper) => {
22053
22159
  if (helper.endsWith(".ts"))
22054
- return resolve35(sourceDir, helper);
22055
- const direct = resolve35(sourceDir, `${helper}.ts`);
22160
+ return resolve36(sourceDir, helper);
22161
+ const direct = resolve36(sourceDir, `${helper}.ts`);
22056
22162
  if (existsSync37(direct))
22057
22163
  return direct;
22058
- const indexed = resolve35(sourceDir, helper, "index.ts");
22164
+ const indexed = resolve36(sourceDir, helper, "index.ts");
22059
22165
  if (existsSync37(indexed))
22060
22166
  return indexed;
22061
22167
  return direct;
@@ -22178,7 +22284,7 @@ var resolveDevClientDir3 = () => {
22178
22284
  throw error;
22179
22285
  }
22180
22286
  }, compileVueFileUncached = async (sourceFilePath, outputDirs, cacheMap, isEntryPoint, vueRootDir, compiler, runSfc, stylePreprocessors) => {
22181
- const fileBaseName = basename16(sourceFilePath, ".vue");
22287
+ const fileBaseName = basename17(sourceFilePath, ".vue");
22182
22288
  const componentId = toKebab(fileBaseName);
22183
22289
  vueCompileProfile.files += 1;
22184
22290
  const rawSourceContent = await timed("readMs", () => file3(sourceFilePath).text());
@@ -22215,12 +22321,12 @@ var resolveDevClientDir3 = () => {
22215
22321
  const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
22216
22322
  const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
22217
22323
  const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
22218
- const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute10(path)) && isStylePath(path)).map((path) => isAbsolute10(path) ? path : resolve35(dirname30(sourceFilePath), path));
22324
+ const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute10(path)) && isStylePath(path)).map((path) => isAbsolute10(path) ? path : resolve36(dirname30(sourceFilePath), path));
22219
22325
  for (const stylePath of stylePathsImported) {
22220
22326
  addStyleImporter(sourceFilePath, stylePath);
22221
22327
  }
22222
22328
  const childBuildResults = await Promise.all([
22223
- ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve35(dirname30(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
22329
+ ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve36(dirname30(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
22224
22330
  ...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors))
22225
22331
  ]);
22226
22332
  const cacheKeyStartedAt = performance.now();
@@ -22328,7 +22434,7 @@ var resolveDevClientDir3 = () => {
22328
22434
  const buildCache = new Map;
22329
22435
  const allTsHelperPaths = new Set;
22330
22436
  const expandSpaRouteChildren = async (entries) => {
22331
- const expanded = new Set(entries.map((entry) => resolve35(entry)));
22437
+ const expanded = new Set(entries.map((entry) => resolve36(entry)));
22332
22438
  const queue = [...expanded];
22333
22439
  while (queue.length > 0) {
22334
22440
  const entryPath = queue.pop();
@@ -22345,7 +22451,7 @@ var resolveDevClientDir3 = () => {
22345
22451
  });
22346
22452
  const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
22347
22453
  for (const { importPath } of routes) {
22348
- const childPath = resolve35(dirname30(entryPath), importPath);
22454
+ const childPath = resolve36(dirname30(entryPath), importPath);
22349
22455
  if (expanded.has(childPath) || !existsSync37(childPath)) {
22350
22456
  continue;
22351
22457
  }
@@ -22360,7 +22466,7 @@ var resolveDevClientDir3 = () => {
22360
22466
  vueCompileProfile.stageExpandMs = performance.now() - stageStartedAt;
22361
22467
  stageStartedAt = performance.now();
22362
22468
  const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
22363
- const resolvedEntryPath = resolve35(entryPath);
22469
+ const resolvedEntryPath = resolve36(entryPath);
22364
22470
  const result = await compileVueFile(resolvedEntryPath, {
22365
22471
  client: clientOutputDir,
22366
22472
  css: cssOutputDir,
@@ -22377,7 +22483,7 @@ var resolveDevClientDir3 = () => {
22377
22483
  spaRoutes: result.spaRoutes
22378
22484
  };
22379
22485
  }
22380
- const entryBaseName = basename16(entryPath, ".vue");
22486
+ const entryBaseName = basename17(entryPath, ".vue");
22381
22487
  const indexOutputFile = join49(indexOutputDir, `${entryBaseName}.js`);
22382
22488
  const clientOutputFile = result.clientPath;
22383
22489
  await mkdir10(dirname30(indexOutputFile), { recursive: true });
@@ -22598,6 +22704,7 @@ var resolveDevClientDir3 = () => {
22598
22704
  hmrMetadata: new Map(vueHmrMetadata),
22599
22705
  vueClientPaths: compiledPages.map((p) => p.clientPath).filter(isString),
22600
22706
  vueCssPaths: compiledPages.flatMap((result) => result.cssPaths),
22707
+ vueCssPathsBySource: new Map(compiledPages.map((page) => [page.sourcePath, page.cssPaths])),
22601
22708
  vueIndexPaths: compiledPages.map((p) => p.indexPath).filter(isString),
22602
22709
  vueServerPaths: compiledPages.map((result) => result.serverPath),
22603
22710
  vueSpaRoutesBySource
@@ -23144,7 +23251,7 @@ __export(exports_compileAngular, {
23144
23251
  invalidateAngularJitCache: () => invalidateAngularJitCache
23145
23252
  });
23146
23253
  import { existsSync as existsSync38, readFileSync as readFileSync34, promises as fs5 } from "fs";
23147
- import { join as join50, basename as basename17, sep as sep9, dirname as dirname31, resolve as resolve36, relative as relative25 } from "path";
23254
+ import { join as join50, basename as basename18, sep as sep9, dirname as dirname31, resolve as resolve37, relative as relative25 } from "path";
23148
23255
  var {Glob: Glob8 } = globalThis.Bun;
23149
23256
  var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
23150
23257
  const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
@@ -23159,10 +23266,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23159
23266
  return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
23160
23267
  }, readTsconfigPathAliases = () => {
23161
23268
  try {
23162
- const configPath = resolve36(process.cwd(), "tsconfig.json");
23269
+ const configPath = resolve37(process.cwd(), "tsconfig.json");
23163
23270
  const config = lazyTypescript.readConfigFile(configPath, lazyTypescript.sys.readFile).config;
23164
23271
  const compilerOptions = config?.compilerOptions ?? {};
23165
- const baseUrl = resolve36(process.cwd(), compilerOptions.baseUrl ?? ".");
23272
+ const baseUrl = resolve37(process.cwd(), compilerOptions.baseUrl ?? ".");
23166
23273
  const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
23167
23274
  return { aliases, baseUrl };
23168
23275
  } catch {
@@ -23182,7 +23289,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23182
23289
  const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
23183
23290
  for (const replacement of alias.replacements) {
23184
23291
  const candidate = replacement.replace("*", wildcardValue);
23185
- const resolved = resolveSourceFile(resolve36(baseUrl, candidate));
23292
+ const resolved = resolveSourceFile(resolve37(baseUrl, candidate));
23186
23293
  if (resolved)
23187
23294
  return resolved;
23188
23295
  }
@@ -23201,13 +23308,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23201
23308
  ];
23202
23309
  return candidates.find((file) => existsSync38(file));
23203
23310
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
23204
- const baseDir = resolve36(rootDir);
23311
+ const baseDir = resolve37(rootDir);
23205
23312
  const tsconfigAliases = readTsconfigPathAliases();
23206
23313
  const transpiler = new Bun.Transpiler({ loader: "tsx" });
23207
23314
  const scanCache = new Map;
23208
23315
  const resolveLocalImport = (specifier, fromDir) => {
23209
23316
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
23210
- return resolveSourceFile(resolve36(fromDir, specifier));
23317
+ return resolveSourceFile(resolve37(fromDir, specifier));
23211
23318
  }
23212
23319
  const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
23213
23320
  if (aliased)
@@ -23216,7 +23323,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23216
23323
  const resolved = Bun.resolveSync(specifier, fromDir);
23217
23324
  if (resolved.includes("/node_modules/"))
23218
23325
  return;
23219
- const absolute = resolve36(resolved);
23326
+ const absolute = resolve37(resolved);
23220
23327
  if (!absolute.startsWith(baseDir))
23221
23328
  return;
23222
23329
  return resolveSourceFile(absolute);
@@ -23232,7 +23339,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23232
23339
  usesLegacyAnimations: false
23233
23340
  });
23234
23341
  }
23235
- const resolved = resolve36(actualPath);
23342
+ const resolved = resolve37(actualPath);
23236
23343
  const cached = scanCache.get(resolved);
23237
23344
  if (cached)
23238
23345
  return cached;
@@ -23261,7 +23368,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23261
23368
  const actualPath = resolveSourceFile(filePath);
23262
23369
  if (!actualPath)
23263
23370
  return false;
23264
- const resolved = resolve36(actualPath);
23371
+ const resolved = resolve37(actualPath);
23265
23372
  if (visited.has(resolved))
23266
23373
  return false;
23267
23374
  visited.add(resolved);
@@ -23279,14 +23386,14 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23279
23386
  return (entryPath) => visit(entryPath);
23280
23387
  }, resolveDevClientDir4 = () => {
23281
23388
  const projectRoot = process.cwd();
23282
- const fromSource = resolve36(import.meta.dir, "../dev/client");
23389
+ const fromSource = resolve37(import.meta.dir, "../dev/client");
23283
23390
  if (existsSync38(fromSource) && fromSource.startsWith(projectRoot)) {
23284
23391
  return fromSource;
23285
23392
  }
23286
- const fromNodeModules = resolve36(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
23393
+ const fromNodeModules = resolve37(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
23287
23394
  if (existsSync38(fromNodeModules))
23288
23395
  return fromNodeModules;
23289
- return resolve36(import.meta.dir, "./dev/client");
23396
+ return resolve37(import.meta.dir, "./dev/client");
23290
23397
  }, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
23291
23398
  try {
23292
23399
  return lazyTypescript.flattenDiagnosticMessageText(diagnostic.messageText, `
@@ -23329,11 +23436,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23329
23436
  if (hasJsLikeExtension(path))
23330
23437
  return `${path}${query}`;
23331
23438
  const importerDir = dirname31(importerOutputPath);
23332
- const fileCandidate = resolve36(importerDir, `${path}.js`);
23439
+ const fileCandidate = resolve37(importerDir, `${path}.js`);
23333
23440
  if (outputFiles?.has(fileCandidate) || existsSync38(fileCandidate)) {
23334
23441
  return `${path}.js${query}`;
23335
23442
  }
23336
- const indexCandidate = resolve36(importerDir, path, "index.js");
23443
+ const indexCandidate = resolve37(importerDir, path, "index.js");
23337
23444
  if (outputFiles?.has(indexCandidate) || existsSync38(indexCandidate)) {
23338
23445
  return `${path}/index.js${query}`;
23339
23446
  }
@@ -23361,7 +23468,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23361
23468
  }, resolveLocalTsImport = (fromFile, specifier) => {
23362
23469
  if (!isRelativeModuleSpecifier(specifier))
23363
23470
  return null;
23364
- const basePath = resolve36(dirname31(fromFile), specifier);
23471
+ const basePath = resolve37(dirname31(fromFile), specifier);
23365
23472
  const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
23366
23473
  `${basePath}.ts`,
23367
23474
  `${basePath}.tsx`,
@@ -23372,7 +23479,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23372
23479
  join50(basePath, "index.mts"),
23373
23480
  join50(basePath, "index.cts")
23374
23481
  ];
23375
- return candidates.map((candidate) => resolve36(candidate)).find((candidate) => existsSync38(candidate) && !candidate.endsWith(".d.ts")) ?? null;
23482
+ return candidates.map((candidate) => resolve37(candidate)).find((candidate) => existsSync38(candidate) && !candidate.endsWith(".d.ts")) ?? null;
23376
23483
  }, readFileForAotTransform = async (fileName, readFile) => {
23377
23484
  const hostSource = readFile?.(fileName);
23378
23485
  if (typeof hostSource === "string")
@@ -23407,7 +23514,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23407
23514
  paths.push(join50(fileDir, urlMatch.replace(/['"]/g, "")));
23408
23515
  }
23409
23516
  }
23410
- return paths.map((path) => resolve36(path));
23517
+ return paths.map((path) => resolve37(path));
23411
23518
  }, readResourceCacheFile = async (cachePath) => {
23412
23519
  try {
23413
23520
  const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
@@ -23449,7 +23556,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23449
23556
  transformedFiles: 0
23450
23557
  };
23451
23558
  const transformFile = async (filePath) => {
23452
- const resolvedPath = resolve36(filePath);
23559
+ const resolvedPath = resolve37(filePath);
23453
23560
  if (visited.has(resolvedPath))
23454
23561
  return;
23455
23562
  visited.add(resolvedPath);
@@ -23484,7 +23591,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23484
23591
  return { stats, transformedSources };
23485
23592
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
23486
23593
  const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
23487
- const outputPath = resolve36(join50(outDir, relative25(process.cwd(), resolve36(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
23594
+ const outputPath = resolve37(join50(outDir, relative25(process.cwd(), resolve37(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
23488
23595
  return [
23489
23596
  outputPath,
23490
23597
  buildIslandMetadataExports(readFileSync34(inputPath, "utf-8"))
@@ -23495,7 +23602,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23495
23602
  const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
23496
23603
  const tsPath = __require.resolve("typescript");
23497
23604
  const tsRootDir = dirname31(tsPath);
23498
- return tsRootDir.endsWith("lib") ? tsRootDir : resolve36(tsRootDir, "lib");
23605
+ return tsRootDir.endsWith("lib") ? tsRootDir : resolve37(tsRootDir, "lib");
23499
23606
  });
23500
23607
  const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
23501
23608
  const options = {
@@ -23526,7 +23633,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23526
23633
  const originalGetDefaultLibFileName = host.getDefaultLibFileName;
23527
23634
  host.getDefaultLibFileName = (opts) => {
23528
23635
  const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
23529
- return basename17(fileName);
23636
+ return basename18(fileName);
23530
23637
  };
23531
23638
  const originalGetSourceFile = host.getSourceFile;
23532
23639
  host.getSourceFile = (fileName, languageVersion, onError) => {
@@ -23537,7 +23644,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23537
23644
  return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
23538
23645
  };
23539
23646
  const emitted = {};
23540
- const resolvedOutDir = resolve36(outDir);
23647
+ const resolvedOutDir = resolve37(outDir);
23541
23648
  host.writeFile = (fileName, text) => {
23542
23649
  const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
23543
23650
  emitted[relativePath] = text;
@@ -23559,12 +23666,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23559
23666
  if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
23560
23667
  return source;
23561
23668
  }
23562
- const resolvedPath = resolve36(fileName);
23669
+ const resolvedPath = resolve37(fileName);
23563
23670
  return transformedSources.get(resolvedPath) ?? source;
23564
23671
  };
23565
23672
  const originalGetSourceFileForCompile = host.getSourceFile;
23566
23673
  host.getSourceFile = (fileName, languageVersion, onError) => {
23567
- const source = transformedSources.get(resolve36(fileName));
23674
+ const source = transformedSources.get(resolve37(fileName));
23568
23675
  if (source) {
23569
23676
  return lazyTypescript.createSourceFile(fileName, source, languageVersion, true);
23570
23677
  }
@@ -23588,7 +23695,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23588
23695
  content,
23589
23696
  target: join50(outDir, fileName)
23590
23697
  }));
23591
- const outputFiles = new Set(rawEntries.map(({ target }) => resolve36(target)));
23698
+ const outputFiles = new Set(rawEntries.map(({ target }) => resolve37(target)));
23592
23699
  return rawEntries.map(({ content, target }) => {
23593
23700
  let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
23594
23701
  const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
@@ -23603,7 +23710,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23603
23710
  return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
23604
23711
  });
23605
23712
  processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
23606
- processedContent += islandMetadataByOutputPath.get(resolve36(target)) ?? "";
23713
+ processedContent += islandMetadataByOutputPath.get(resolve37(target)) ?? "";
23607
23714
  processedContent = downlevelAsyncForZone(processedContent, target);
23608
23715
  return { content: processedContent, target };
23609
23716
  });
@@ -23614,7 +23721,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23614
23721
  })), { outputs: entries.length });
23615
23722
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
23616
23723
  }, jitContentCache, invalidateAngularJitCache = (filePath) => {
23617
- jitContentCache.delete(resolve36(filePath));
23724
+ jitContentCache.delete(resolve37(filePath));
23618
23725
  }, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
23619
23726
  const re = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
23620
23727
  let match;
@@ -23627,7 +23734,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
23627
23734
  }
23628
23735
  return null;
23629
23736
  }, resolveAngularDeferImportSpecifier = () => {
23630
- const sourceEntry = resolve36(import.meta.dir, "../angular/components/index.ts");
23737
+ const sourceEntry = resolve37(import.meta.dir, "../angular/components/index.ts");
23631
23738
  if (existsSync38(sourceEntry)) {
23632
23739
  return sourceEntry.replace(/\\/g, "/");
23633
23740
  }
@@ -23917,10 +24024,10 @@ ${fields}
23917
24024
  return "";
23918
24025
  }
23919
24026
  }, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
23920
- const entryPath = resolve36(inputPath);
24027
+ const entryPath = resolve37(inputPath);
23921
24028
  const allOutputs = [];
23922
24029
  const visited = new Set;
23923
- const baseDir = resolve36(rootDir ?? process.cwd());
24030
+ const baseDir = resolve37(rootDir ?? process.cwd());
23924
24031
  let usesLegacyAnimations = false;
23925
24032
  const angularTranspiler = new Bun.Transpiler({
23926
24033
  loader: "ts",
@@ -23948,7 +24055,7 @@ ${fields}
23948
24055
  };
23949
24056
  const resolveLocalImport = (specifier, fromDir) => {
23950
24057
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
23951
- return resolveSourceFile(resolve36(fromDir, specifier));
24058
+ return resolveSourceFile(resolve37(fromDir, specifier));
23952
24059
  }
23953
24060
  const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
23954
24061
  if (aliased)
@@ -23957,7 +24064,7 @@ ${fields}
23957
24064
  const resolved = Bun.resolveSync(specifier, fromDir);
23958
24065
  if (resolved.includes("/node_modules/"))
23959
24066
  return;
23960
- const absolute = resolve36(resolved);
24067
+ const absolute = resolve37(resolved);
23961
24068
  if (!absolute.startsWith(baseDir))
23962
24069
  return;
23963
24070
  return resolveSourceFile(absolute);
@@ -23967,7 +24074,7 @@ ${fields}
23967
24074
  };
23968
24075
  const toOutputPath = (sourcePath) => {
23969
24076
  const inputDir = dirname31(sourcePath);
23970
- const fileBase = basename17(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
24077
+ const fileBase = basename18(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
23971
24078
  if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep9}`)) {
23972
24079
  return join50(inputDir, fileBase);
23973
24080
  }
@@ -24009,13 +24116,13 @@ ${fields}
24009
24116
  return `${prefix}${dots}`;
24010
24117
  return `${prefix}../${dots}`;
24011
24118
  });
24012
- if (resolve36(actualPath) === entryPath) {
24119
+ if (resolve37(actualPath) === entryPath) {
24013
24120
  processedContent += buildIslandMetadataExports(sourceCode);
24014
24121
  }
24015
24122
  return processedContent;
24016
24123
  };
24017
24124
  const transpileFile = async (filePath) => {
24018
- const resolved = resolve36(filePath);
24125
+ const resolved = resolve37(filePath);
24019
24126
  if (visited.has(resolved))
24020
24127
  return;
24021
24128
  visited.add(resolved);
@@ -24023,7 +24130,7 @@ ${fields}
24023
24130
  const inputDir = dirname31(resolved);
24024
24131
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
24025
24132
  const targetDir = join50(outDir, relativeDir);
24026
- const targetPath = join50(targetDir, basename17(resolved));
24133
+ const targetPath = join50(targetDir, basename18(resolved));
24027
24134
  await fs5.mkdir(targetDir, { recursive: true });
24028
24135
  await fs5.copyFile(resolved, targetPath);
24029
24136
  allOutputs.push(targetPath);
@@ -24038,7 +24145,7 @@ ${fields}
24038
24145
  const inlined = await inlineResources(sourceCode, dirname31(actualPath), stylePreprocessors);
24039
24146
  sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname31(actualPath)).source;
24040
24147
  const inputDir = dirname31(actualPath);
24041
- const fileBase = basename17(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
24148
+ const fileBase = basename18(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
24042
24149
  const targetPath = toOutputPath(actualPath);
24043
24150
  const targetDir = dirname31(targetPath);
24044
24151
  const relativeDir = relative25(outDir, targetDir).replace(/\\/g, "/");
@@ -24067,7 +24174,7 @@ ${fields}
24067
24174
  importRewrites.set(specifier, relativeRewrite);
24068
24175
  return resolved;
24069
24176
  }).filter((path) => Boolean(path));
24070
- const isEntry = resolve36(actualPath) === resolve36(entryPath);
24177
+ const isEntry = resolve37(actualPath) === resolve37(entryPath);
24071
24178
  const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
24072
24179
  const cacheKey = actualPath;
24073
24180
  const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync38(targetPath);
@@ -24139,11 +24246,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
24139
24246
  const compiledRoot = compiledParent;
24140
24247
  const indexesDir = join50(compiledParent, "indexes");
24141
24248
  await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
24142
- const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve36(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
24249
+ const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve37(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
24143
24250
  if (!hmr) {
24144
24251
  await traceAngularPhase("aot/copy-json-resources", async () => {
24145
24252
  const cwd = process.cwd();
24146
- const angularSrcDir = resolve36(outRoot);
24253
+ const angularSrcDir = resolve37(outRoot);
24147
24254
  if (!existsSync38(angularSrcDir))
24148
24255
  return;
24149
24256
  const jsonGlob = new Glob8("**/*.json");
@@ -24161,22 +24268,22 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
24161
24268
  }
24162
24269
  const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
24163
24270
  const compileTasks = entryPoints.map(async (entry) => {
24164
- const resolvedEntry = resolve36(entry);
24271
+ const resolvedEntry = resolve37(entry);
24165
24272
  const relativeEntry = relative25(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
24166
24273
  const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
24167
24274
  let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
24168
24275
  entry: resolvedEntry
24169
24276
  }) : aotOutputs;
24170
- const fileBase = basename17(resolvedEntry).replace(/\.[tj]s$/, "");
24277
+ const fileBase = basename18(resolvedEntry).replace(/\.[tj]s$/, "");
24171
24278
  const jsName = `${fileBase}.js`;
24172
24279
  const compiledFallbackPaths = [
24173
24280
  join50(compiledRoot, relativeEntry),
24174
24281
  join50(compiledRoot, "pages", jsName),
24175
24282
  join50(compiledRoot, jsName)
24176
- ].map((file) => resolve36(file));
24283
+ ].map((file) => resolve37(file));
24177
24284
  const resolveRawServerFile = (candidatePaths) => {
24178
24285
  const normalizedCandidates = [
24179
- ...candidatePaths.map((file) => resolve36(file)),
24286
+ ...candidatePaths.map((file) => resolve37(file)),
24180
24287
  ...compiledFallbackPaths
24181
24288
  ];
24182
24289
  let candidate = normalizedCandidates.find((file) => existsSync38(file) && file.endsWith(`${sep9}${relativeEntry}`));
@@ -24257,8 +24364,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
24257
24364
  const fragments = [];
24258
24365
  if (providersInjection.appProvidersSource) {
24259
24366
  const compiledAppProvidersPath = (() => {
24260
- const angularDirAbs = resolve36(outRoot);
24261
- const appSourceAbs = resolve36(providersInjection.appProvidersSource);
24367
+ const angularDirAbs = resolve37(outRoot);
24368
+ const appSourceAbs = resolve37(providersInjection.appProvidersSource);
24262
24369
  const rel = relative25(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
24263
24370
  return join50(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
24264
24371
  })();
@@ -25005,7 +25112,7 @@ var require_node = __commonJS(function(exports, module) {
25005
25112
  // src/build/compileEmber.ts
25006
25113
  import { existsSync as existsSync39 } from "fs";
25007
25114
  import { mkdir as mkdir11, rm as rm6 } from "fs/promises";
25008
- import { basename as basename18, dirname as dirname32, extname as extname17, join as join51, resolve as resolve37 } from "path";
25115
+ import { basename as basename19, dirname as dirname32, extname as extname17, join as join51, resolve as resolve38 } from "path";
25009
25116
  var {build: bunBuild3, Transpiler: Transpiler6, write: write5, file: file4 } = globalThis.Bun;
25010
25117
  var cachedPreprocessor = null, getPreprocessor = async () => {
25011
25118
  if (cachedPreprocessor)
@@ -25101,7 +25208,7 @@ export const importSync = (specifier) => {
25101
25208
  const originalImporter = stagedSourceMap.get(args.importer);
25102
25209
  if (!originalImporter)
25103
25210
  return;
25104
- const candidateBase = resolve37(dirname32(originalImporter), args.path);
25211
+ const candidateBase = resolve38(dirname32(originalImporter), args.path);
25105
25212
  const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
25106
25213
  for (const ext of extensionsToTry) {
25107
25214
  const candidate = candidateBase + ext;
@@ -25160,7 +25267,7 @@ export const renderToHTML = (props = {}) => {
25160
25267
  export { PageComponent };
25161
25268
  export default PageComponent;
25162
25269
  `, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
25163
- const resolvedEntry = resolve37(entry);
25270
+ const resolvedEntry = resolve38(entry);
25164
25271
  const source = await file4(resolvedEntry).text();
25165
25272
  let preprocessed = source;
25166
25273
  if (isTemplateTagFile(resolvedEntry)) {
@@ -25171,7 +25278,7 @@ export default PageComponent;
25171
25278
  preprocessed = rewriteTemplateEvalToScope(result.code);
25172
25279
  }
25173
25280
  const transpiled = transpiler6.transformSync(preprocessed);
25174
- const baseName = basename18(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
25281
+ const baseName = basename19(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
25175
25282
  const tmpDir = join51(compiledRoot, "_tmp");
25176
25283
  const serverDir = join51(compiledRoot, "server");
25177
25284
  const clientDir = join51(compiledRoot, "client");
@@ -25180,8 +25287,8 @@ export default PageComponent;
25180
25287
  mkdir11(serverDir, { recursive: true }),
25181
25288
  mkdir11(clientDir, { recursive: true })
25182
25289
  ]);
25183
- const tmpPagePath = resolve37(join51(tmpDir, `${baseName}.module.js`));
25184
- const tmpHarnessPath = resolve37(join51(tmpDir, `${baseName}.harness.js`));
25290
+ const tmpPagePath = resolve38(join51(tmpDir, `${baseName}.module.js`));
25291
+ const tmpHarnessPath = resolve38(join51(tmpDir, `${baseName}.harness.js`));
25185
25292
  await Promise.all([
25186
25293
  write5(tmpPagePath, transpiled),
25187
25294
  write5(tmpHarnessPath, generateServerHarness(tmpPagePath))
@@ -25246,24 +25353,24 @@ var importFromProject = (specifier, projectRoot = process.cwd()) => {
25246
25353
 
25247
25354
  // src/build/buildReactVendor.ts
25248
25355
  import { existsSync as existsSync40, mkdirSync as mkdirSync13 } from "fs";
25249
- import { join as join52, resolve as resolve38 } from "path";
25356
+ import { join as join52, resolve as resolve39 } from "path";
25250
25357
  import { rm as rm7 } from "fs/promises";
25251
25358
  var {build: bunBuild4 } = globalThis.Bun;
25252
25359
  var resolveJsxDevRuntimeCompatPath = () => {
25253
25360
  const candidates = [
25254
- resolve38(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
25255
- resolve38(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
25256
- resolve38(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
25257
- resolve38(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
25258
- resolve38(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
25259
- resolve38(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
25361
+ resolve39(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
25362
+ resolve39(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
25363
+ resolve39(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
25364
+ resolve39(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
25365
+ resolve39(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
25366
+ resolve39(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
25260
25367
  ];
25261
25368
  for (const candidate of candidates) {
25262
25369
  if (existsSync40(candidate)) {
25263
25370
  return candidate.replace(/\\/g, "/");
25264
25371
  }
25265
25372
  }
25266
- return (candidates[0] ?? resolve38(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
25373
+ return (candidates[0] ?? resolve39(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
25267
25374
  }, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
25268
25375
  const paths = {};
25269
25376
  for (const specifier of reactSpecifiers) {
@@ -25718,12 +25825,12 @@ import {
25718
25825
  writeFileSync as writeFileSync14
25719
25826
  } from "fs";
25720
25827
  import {
25721
- basename as basename19,
25828
+ basename as basename20,
25722
25829
  dirname as dirname33,
25723
25830
  extname as extname18,
25724
25831
  join as join56,
25725
25832
  relative as relative26,
25726
- resolve as resolve39,
25833
+ resolve as resolve40,
25727
25834
  sep as sep10
25728
25835
  } from "path";
25729
25836
  import { cwd, env as env2, exit } from "process";
@@ -25860,7 +25967,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
25860
25967
  const copyFile = (path) => {
25861
25968
  if (!path)
25862
25969
  return;
25863
- const dest = join56(outDir, basename19(path));
25970
+ const dest = join56(outDir, basename20(path));
25864
25971
  cpSync(path, dest, { force: true });
25865
25972
  return dest;
25866
25973
  };
@@ -25886,7 +25993,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
25886
25993
  }, formatManifestKeyCollisions = (collisions, projectRoot) => collisions.map(({ key, next, previous }) => {
25887
25994
  const first = relative26(projectRoot, previous);
25888
25995
  const second = relative26(projectRoot, next);
25889
- return `Manifest key "${key}" belongs to two pages: ${first} and ${second}. Pages are looked up by file name (asset(manifest, '${key}')), so each name must be unique across htmlDirectory, htmxDirectory and the other page directories. Rename one of them, for example ${basename19(second)} to ${basename19(second).replace(key, `${key}Page`)}, and update its route.`;
25996
+ return `Manifest key "${key}" belongs to two pages: ${first} and ${second}. Pages are looked up by file name (asset(manifest, '${key}')), so each name must be unique across htmlDirectory, htmxDirectory and the other page directories. Rename one of them, for example ${basename20(second)} to ${basename20(second).replace(key, `${key}Page`)}, and update its route.`;
25890
25997
  }).join(`
25891
25998
  `), copyHtmxVendor = (htmxDir, htmxDestDir) => {
25892
25999
  mkdirSync17(htmxDestDir, { recursive: true });
@@ -25907,8 +26014,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
25907
26014
  if (globalThis.__absoluteVersion)
25908
26015
  return;
25909
26016
  const candidates = [
25910
- resolve39(import.meta.dir, "..", "..", "package.json"),
25911
- resolve39(import.meta.dir, "..", "package.json")
26017
+ resolve40(import.meta.dir, "..", "..", "package.json"),
26018
+ resolve40(import.meta.dir, "..", "package.json")
25912
26019
  ];
25913
26020
  const resolveCandidate = async (remaining) => {
25914
26021
  const [candidate, ...rest] = remaining;
@@ -25924,7 +26031,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
25924
26031
  };
25925
26032
  await resolveCandidate(candidates);
25926
26033
  }, SKIP_DIRS5, addWorkerPathIfExists = (file, relPath, workerPaths) => {
25927
- const absPath = resolve39(file, "..", relPath);
26034
+ const absPath = resolve40(file, "..", relPath);
25928
26035
  try {
25929
26036
  statSync7(absPath);
25930
26037
  workerPaths.add(absPath);
@@ -26015,7 +26122,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26015
26122
  copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
26016
26123
  }
26017
26124
  }, rewriteFileRouteImports = (content, indexesDir) => content.replace(/from\s*'(\.{1,2}\/[^']+)'/g, (match, specifier) => {
26018
- const target = resolve39(indexesDir, specifier);
26125
+ const target = resolve40(indexesDir, specifier);
26019
26126
  if (!isInFileRouteRoot(target))
26020
26127
  return match;
26021
26128
  return `from '/@src/${relative26(process.cwd(), target).replace(/\\/g, "/")}'`;
@@ -26033,7 +26140,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26033
26140
  return;
26034
26141
  }
26035
26142
  const indexFiles = readDir(reactIndexesPath).filter((file) => file.endsWith(".tsx"));
26036
- const pagesRel = relative26(process.cwd(), resolve39(reactPagesPath)).replace(/\\/g, "/");
26143
+ const pagesRel = relative26(process.cwd(), resolve40(reactPagesPath)).replace(/\\/g, "/");
26037
26144
  for (const file of indexFiles) {
26038
26145
  let content = readFileSync35(join56(reactIndexesPath, file), "utf-8");
26039
26146
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
@@ -26042,27 +26149,27 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26042
26149
  }
26043
26150
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
26044
26151
  const svelteIndexDir = join56(getFrameworkGeneratedDir("svelte"), "indexes");
26045
- const sveltePageEntries = svelteEntries.filter((file) => resolve39(file).startsWith(resolve39(sveltePagesPath)) || fileRouteFor(file) !== undefined);
26152
+ const sveltePageEntries = svelteEntries.filter((file) => resolve40(file).startsWith(resolve40(sveltePagesPath)) || fileRouteFor(file) !== undefined);
26046
26153
  for (const entry of sveltePageEntries) {
26047
- const name = fileRouteFor(entry)?.name ?? basename19(entry).replace(/\.svelte(\.(ts|js))?$/, "");
26154
+ const name = fileRouteFor(entry)?.name ?? basename20(entry).replace(/\.svelte(\.(ts|js))?$/, "");
26048
26155
  const indexFile = join56(svelteIndexDir, "pages", `${name}.js`);
26049
26156
  if (!existsSync41(indexFile))
26050
26157
  continue;
26051
26158
  let content = readFileSync35(indexFile, "utf-8");
26052
- const srcRel = relative26(process.cwd(), resolve39(entry)).replace(/\\/g, "/");
26159
+ const srcRel = relative26(process.cwd(), resolve40(entry)).replace(/\\/g, "/");
26053
26160
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
26054
26161
  writeFileSync14(join56(devIndexDir, `${name}.svelte.js`), content);
26055
26162
  }
26056
26163
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
26057
26164
  const vueIndexDir = join56(getFrameworkGeneratedDir("vue"), "indexes");
26058
- const vuePageEntries = vueEntries.filter((file) => resolve39(file).startsWith(resolve39(vuePagesPath)));
26165
+ const vuePageEntries = vueEntries.filter((file) => resolve40(file).startsWith(resolve40(vuePagesPath)));
26059
26166
  for (const entry of vuePageEntries) {
26060
- const name = basename19(entry, ".vue");
26167
+ const name = basename20(entry, ".vue");
26061
26168
  const indexFile = join56(vueIndexDir, `${name}.js`);
26062
26169
  if (!existsSync41(indexFile))
26063
26170
  continue;
26064
26171
  let content = readFileSync35(indexFile, "utf-8");
26065
- const srcRel = relative26(process.cwd(), resolve39(entry)).replace(/\\/g, "/");
26172
+ const srcRel = relative26(process.cwd(), resolve40(entry)).replace(/\\/g, "/");
26066
26173
  content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
26067
26174
  writeFileSync14(join56(devIndexDir, `${name}.vue.js`), content);
26068
26175
  }
@@ -26070,7 +26177,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26070
26177
  const urlFileMap = new Map;
26071
26178
  for (const srcPath of urlReferencedFiles) {
26072
26179
  const rel = relative26(projectRoot, srcPath).replace(/\\/g, "/");
26073
- const name = basename19(srcPath);
26180
+ const name = basename20(srcPath);
26074
26181
  const mtime = Math.round(statSync7(srcPath).mtimeMs);
26075
26182
  const url = `/@src/${rel}?v=${mtime}`;
26076
26183
  urlFileMap.set(name, url);
@@ -26080,13 +26187,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26080
26187
  }, buildProdUrlFileMap = (urlReferencedFiles, buildPath, nonReactClientOutputs) => {
26081
26188
  const urlFileMap = new Map;
26082
26189
  for (const srcPath of urlReferencedFiles) {
26083
- const srcBase = basename19(srcPath).replace(/\.[^.]+$/, "");
26084
- const output = nonReactClientOutputs.find((artifact) => basename19(artifact.path).startsWith(`${srcBase}.`));
26190
+ const srcBase = basename20(srcPath).replace(/\.[^.]+$/, "");
26191
+ const output = nonReactClientOutputs.find((artifact) => basename20(artifact.path).startsWith(`${srcBase}.`));
26085
26192
  if (!output)
26086
26193
  continue;
26087
26194
  const url = `/${relative26(buildPath, output.path).replace(/\\/g, "/")}`;
26088
- urlFileMap.set(basename19(srcPath), url);
26089
- urlFileMap.set(basename19(srcPath).replace(/\.tsx?$/, ".js"), url);
26195
+ urlFileMap.set(basename20(srcPath), url);
26196
+ urlFileMap.set(basename20(srcPath).replace(/\.tsx?$/, ".js"), url);
26090
26197
  }
26091
26198
  return urlFileMap;
26092
26199
  }, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
@@ -26344,7 +26451,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26344
26451
  if (!firstEntry)
26345
26452
  throw new Error("Expected at least one server directory entry");
26346
26453
  serverRoot = join56(firstEntry.dir, firstEntry.subdir);
26347
- serverOutDir = join56(buildPath, basename19(firstEntry.dir));
26454
+ serverOutDir = join56(buildPath, basename20(firstEntry.dir));
26348
26455
  } else if (serverDirMap.length > 1) {
26349
26456
  serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
26350
26457
  serverOutDir = buildPath;
@@ -26377,13 +26484,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26377
26484
  const filterToIncrementalEntries = (entryPoints, mapToSource) => {
26378
26485
  if (!isIncremental || !incrementalFiles)
26379
26486
  return entryPoints;
26380
- const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve39(f)));
26487
+ const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve40(f)));
26381
26488
  const matchingEntries = [];
26382
26489
  for (const entry of entryPoints) {
26383
26490
  const sourceFile = mapToSource(entry);
26384
26491
  if (!sourceFile)
26385
26492
  continue;
26386
- if (!normalizedIncremental.has(resolve39(sourceFile)))
26493
+ if (!normalizedIncremental.has(resolve40(sourceFile)))
26387
26494
  continue;
26388
26495
  matchingEntries.push(entry);
26389
26496
  }
@@ -26517,7 +26624,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26517
26624
  mkdirSync17(htmlConventionsOutDir, { recursive: true });
26518
26625
  const htmlPathRemap = new Map;
26519
26626
  for (const sourcePath of htmlConventionSources) {
26520
- const dest = join56(htmlConventionsOutDir, basename19(sourcePath));
26627
+ const dest = join56(htmlConventionsOutDir, basename20(sourcePath));
26521
26628
  cpSync(sourcePath, dest, { force: true });
26522
26629
  htmlPathRemap.set(sourcePath, dest);
26523
26630
  }
@@ -26569,12 +26676,12 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26569
26676
  return scoped;
26570
26677
  return scoped.filter((entry) => {
26571
26678
  const source = mapToSource(entry);
26572
- return source !== null && deferPageEntries.except.has(resolve39(source));
26679
+ return source !== null && deferPageEntries.except.has(resolve40(source));
26573
26680
  });
26574
26681
  };
26575
26682
  const mapReactIndexToPage = (entry) => {
26576
- if (reactIndexesPath && reactPagesPath && entry.startsWith(resolve39(reactIndexesPath))) {
26577
- const pageName = basename19(entry, ".tsx");
26683
+ if (reactIndexesPath && reactPagesPath && entry.startsWith(resolve40(reactIndexesPath))) {
26684
+ const pageName = basename20(entry, ".tsx");
26578
26685
  return fileRouteNamed(pageName)?.source ?? join56(reactPagesPath, `${pageName}.tsx`);
26579
26686
  }
26580
26687
  return null;
@@ -26613,9 +26720,9 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26613
26720
  return new Set;
26614
26721
  const resolved = new Set;
26615
26722
  for (const entry of vueEntries) {
26616
- const name = basename19(entry, ".vue");
26723
+ const name = basename20(entry, ".vue");
26617
26724
  if (ssrOnlyPageNames.has(name)) {
26618
- resolved.add(resolve39(entry));
26725
+ resolved.add(resolve40(entry));
26619
26726
  }
26620
26727
  }
26621
26728
  return resolved;
@@ -26678,7 +26785,10 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26678
26785
  { clientPaths: angularClientPaths, serverPaths: angularServerPaths },
26679
26786
  { serverPaths: emberServerPaths },
26680
26787
  { svelteClientPaths: islandSvelteClientPaths },
26681
- { vueClientPaths: islandVueClientPaths },
26788
+ {
26789
+ vueClientPaths: islandVueClientPaths,
26790
+ vueCssPathsBySource: islandVueCssPathsBySource
26791
+ },
26682
26792
  { clientPaths: islandAngularClientPaths }
26683
26793
  ] = await Promise.all([
26684
26794
  shouldCompileSvelte ? tracePhase("compile/svelte", () => Promise.resolve().then(() => (init_compileSvelte(), {})).then((mod) => compileSvelte(svelteEntries, svelteDir, new Map, hmr, styleTransformConfig))) : {
@@ -26712,11 +26822,12 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26712
26822
  clientPaths: [...emptyStringArray],
26713
26823
  serverPaths: [...emptyStringArray]
26714
26824
  },
26715
- shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), {})).then((mod) => compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig))) : {
26825
+ shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), {})).then((mod) => compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig, { externalCss: true }))) : {
26716
26826
  svelteClientPaths: [...emptyStringArray]
26717
26827
  },
26718
26828
  shouldCompileIslandVue ? tracePhase("compile/island-vue", () => Promise.resolve().then(() => (init_compileVue(), {})).then((mod) => compileVue(islandVueSources, vueDir, hmr, styleTransformConfig))) : {
26719
- vueClientPaths: [...emptyStringArray]
26829
+ vueClientPaths: [...emptyStringArray],
26830
+ vueCssPathsBySource: new Map
26720
26831
  },
26721
26832
  shouldCompileIslandAngular ? tracePhase("compile/island-angular", () => Promise.resolve().then(() => (init_compileAngular(), {})).then((mod) => compileAngular(islandAngularSources, angularDir, hmr, styleTransformConfig))) : {
26722
26833
  clientPaths: [...emptyStringArray]
@@ -26728,7 +26839,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26728
26839
  const clientPath = islandSvelteClientPaths[idx];
26729
26840
  if (!sourcePath || !clientPath)
26730
26841
  continue;
26731
- islandSvelteClientPathMap.set(resolve39(sourcePath), clientPath);
26842
+ islandSvelteClientPathMap.set(resolve40(sourcePath), clientPath);
26732
26843
  }
26733
26844
  const islandVueClientPathMap = new Map;
26734
26845
  for (let idx = 0;idx < islandVueSources.length; idx++) {
@@ -26736,7 +26847,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26736
26847
  const clientPath = islandVueClientPaths[idx];
26737
26848
  if (!sourcePath || !clientPath)
26738
26849
  continue;
26739
- islandVueClientPathMap.set(resolve39(sourcePath), clientPath);
26850
+ islandVueClientPathMap.set(resolve40(sourcePath), clientPath);
26740
26851
  }
26741
26852
  const islandAngularClientPathMap = new Map;
26742
26853
  for (let idx = 0;idx < islandAngularSources.length; idx++) {
@@ -26744,7 +26855,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26744
26855
  const clientPath = islandAngularClientPaths[idx];
26745
26856
  if (!sourcePath || !clientPath)
26746
26857
  continue;
26747
- islandAngularClientPathMap.set(resolve39(sourcePath), clientPath);
26858
+ islandAngularClientPathMap.set(resolve40(sourcePath), clientPath);
26748
26859
  }
26749
26860
  const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
26750
26861
  const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
@@ -26803,7 +26914,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26803
26914
  rmSync2(destDir, { force: true, recursive: true });
26804
26915
  mkdirSync17(destDir, { recursive: true });
26805
26916
  const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
26806
- const name = basename19(compiledPath).replace(/\.[^.]+$/, "");
26917
+ const name = basename20(compiledPath).replace(/\.[^.]+$/, "");
26807
26918
  const result = await bunBuild8({
26808
26919
  define: serverDefine,
26809
26920
  entrypoints: [compiledPath],
@@ -26872,6 +26983,9 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26872
26983
  angular: islandAngularClientPathMap,
26873
26984
  svelte: islandSvelteClientPathMap,
26874
26985
  vue: islandVueClientPathMap
26986
+ },
26987
+ cssPathMaps: {
26988
+ vue: islandVueCssPathsBySource
26875
26989
  }
26876
26990
  })) : {
26877
26991
  entries: [],
@@ -27177,7 +27291,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27177
27291
  globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild8(mergeBunBuildConfig({
27178
27292
  entrypoints: globalCssEntries,
27179
27293
  naming: `[dir]/[name].[hash].[ext]`,
27180
- outdir: stylesDir ? join56(buildPath, basename19(stylesDir)) : buildPath,
27294
+ outdir: stylesDir ? join56(buildPath, basename20(stylesDir)) : buildPath,
27181
27295
  plugins: [stylePreprocessorPlugin],
27182
27296
  root: stylesDir || clientRoot,
27183
27297
  target: "browser",
@@ -27186,7 +27300,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27186
27300
  vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild8(mergeBunBuildConfig({
27187
27301
  entrypoints: vueCssPaths,
27188
27302
  naming: `[name].[hash].[ext]`,
27189
- outdir: join56(buildPath, assetsPath ? basename19(assetsPath) : "assets", "css"),
27303
+ outdir: join56(buildPath, assetsPath ? basename20(assetsPath) : "assets", "css"),
27190
27304
  target: "browser",
27191
27305
  throw: false
27192
27306
  }, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
@@ -27216,7 +27330,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27216
27330
  }).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join56(buildPath, entry));
27217
27331
  for (const mapPath of mapFiles) {
27218
27332
  chainExternalSourcemap(mapPath);
27219
- renameSync(mapPath, join56(sourcemapDir, basename19(mapPath)));
27333
+ renameSync(mapPath, join56(sourcemapDir, basename20(mapPath)));
27220
27334
  const jsPath = mapPath.slice(0, -4);
27221
27335
  try {
27222
27336
  const javascript = readFileSync35(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
@@ -27380,7 +27494,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27380
27494
  for (const artifact of serverOutputs) {
27381
27495
  if (extname18(artifact.path) !== ".js")
27382
27496
  continue;
27383
- const fileWithHash = basename19(artifact.path);
27497
+ const fileWithHash = basename20(artifact.path);
27384
27498
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
27385
27499
  if (!baseName)
27386
27500
  continue;
@@ -27400,7 +27514,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27400
27514
  for (const artifact of cssOutputs) {
27401
27515
  if (extname18(artifact.path) !== ".css")
27402
27516
  continue;
27403
- const cssName = stripHash(basename19(artifact.path), artifact.hash);
27517
+ const cssName = stripHash(basename20(artifact.path), artifact.hash);
27404
27518
  if (cssName)
27405
27519
  cssByName.set(cssName, artifact);
27406
27520
  }
@@ -27410,7 +27524,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27410
27524
  await Promise.all(serverOutputs.map(async (artifact) => {
27411
27525
  if (extname18(artifact.path) !== ".js")
27412
27526
  return;
27413
- const pascalName = stripHash(basename19(artifact.path), artifact.hash);
27527
+ const pascalName = stripHash(basename20(artifact.path), artifact.hash);
27414
27528
  if (!pascalName)
27415
27529
  return;
27416
27530
  serverJsByPascalName.set(pascalName, artifact);
@@ -27429,12 +27543,12 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27429
27543
  spaSideManifestPaths.push(sideManifestPath);
27430
27544
  }
27431
27545
  for (const serverPath of emberServerPaths) {
27432
- const fileBase = basename19(serverPath, ".js");
27546
+ const fileBase = basename20(serverPath, ".js");
27433
27547
  manifest[toPascal(fileBase)] = serverPath;
27434
27548
  }
27435
27549
  if (skipAngularClientBundle) {
27436
27550
  for (const clientPath of angularClientPaths) {
27437
- const fileBase = basename19(clientPath, ".js");
27551
+ const fileBase = basename20(clientPath, ".js");
27438
27552
  const relFromCwd = relative26(projectRoot, clientPath).replace(/\\/g, "/");
27439
27553
  manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
27440
27554
  }
@@ -27461,7 +27575,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27461
27575
  let html = readFileSync35(filePath, "utf-8");
27462
27576
  if (html.includes("data-hmr-client"))
27463
27577
  return;
27464
- const pageName = JSON.stringify(basename19(filePath)).replace(/</g, "\\u003c");
27578
+ const pageName = JSON.stringify(basename20(filePath)).replace(/</g, "\\u003c");
27465
27579
  const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";window.__HMR_PAGE__=${pageName};</script><script data-hmr-client>${hmrClientBundle}</script>`;
27466
27580
  const bodyClose = /<\/body\s*>/i.exec(html);
27467
27581
  html = bodyClose ? html.slice(0, bodyClose.index) + tag + html.slice(bodyClose.index) : html + tag;
@@ -27470,7 +27584,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27470
27584
  const processHtmlPages = async () => {
27471
27585
  if (!(htmlDir && htmlPagesPath))
27472
27586
  return;
27473
- const outputHtmlPages = isSingle ? join56(buildPath, "pages") : join56(buildPath, basename19(htmlDir), "pages");
27587
+ const outputHtmlPages = isSingle ? join56(buildPath, "pages") : join56(buildPath, basename20(htmlDir), "pages");
27474
27588
  mkdirSync17(outputHtmlPages, { recursive: true });
27475
27589
  cpSync(htmlPagesPath, outputHtmlPages, {
27476
27590
  force: true,
@@ -27494,13 +27608,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27494
27608
  const source = readFileSync35(htmlFile, "utf8");
27495
27609
  writeFileSync14(htmlFile, injectVitalsReporterHtml(source));
27496
27610
  }
27497
- recordManifestKey(basename19(htmlFile, ".html"), htmlFile, join56(htmlPagesPath, relative26(outputHtmlPages, htmlFile)));
27611
+ recordManifestKey(basename20(htmlFile, ".html"), htmlFile, join56(htmlPagesPath, relative26(outputHtmlPages, htmlFile)));
27498
27612
  }
27499
27613
  };
27500
27614
  const processHtmxPages = async () => {
27501
27615
  if (!(htmxDir && htmxPagesPath))
27502
27616
  return;
27503
- const outputHtmxPages = isSingle ? join56(buildPath, "pages") : join56(buildPath, basename19(htmxDir), "pages");
27617
+ const outputHtmxPages = isSingle ? join56(buildPath, "pages") : join56(buildPath, basename20(htmxDir), "pages");
27504
27618
  mkdirSync17(outputHtmxPages, { recursive: true });
27505
27619
  cpSync(htmxPagesPath, outputHtmxPages, {
27506
27620
  force: true,
@@ -27508,7 +27622,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27508
27622
  });
27509
27623
  await expandStaticPageIncludes(htmxPagesPath, outputHtmxPages);
27510
27624
  if (shouldCopyHtmx) {
27511
- const htmxDestDir = isSingle ? buildPath : join56(buildPath, basename19(htmxDir));
27625
+ const htmxDestDir = isSingle ? buildPath : join56(buildPath, basename20(htmxDir));
27512
27626
  copyHtmxVendor(htmxDir, htmxDestDir);
27513
27627
  }
27514
27628
  await updateAssetPaths(manifest, outputHtmxPages);
@@ -27528,7 +27642,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27528
27642
  const source = readFileSync35(htmxFile, "utf8");
27529
27643
  writeFileSync14(htmxFile, injectVitalsReporterHtml(source));
27530
27644
  }
27531
- recordManifestKey(basename19(htmxFile, ".html"), htmxFile, join56(htmxPagesPath, relative26(outputHtmxPages, htmxFile)));
27645
+ recordManifestKey(basename20(htmxFile, ".html"), htmxFile, join56(htmxPagesPath, relative26(outputHtmxPages, htmxFile)));
27532
27646
  }
27533
27647
  };
27534
27648
  const processStaticConventions = async () => {
@@ -27678,7 +27792,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
27678
27792
  pageEntries,
27679
27793
  tailwindChanged: tailwindResult?.cssChanged ?? false
27680
27794
  };
27681
- }, projectTsconfig = () => existsSync41(resolve39("tsconfig.json")) ? { tsconfig: "./tsconfig.json" } : {}, build = async (config) => {
27795
+ }, projectTsconfig = () => existsSync41(resolve40("tsconfig.json")) ? { tsconfig: "./tsconfig.json" } : {}, build = async (config) => {
27682
27796
  const projectRoot = cwd();
27683
27797
  const buildPath = validateSafePath(config.buildDirectory ?? "build", projectRoot);
27684
27798
  return withBuildDirectoryLock(buildPath, () => buildUnlocked(config));
@@ -27779,14 +27893,14 @@ var init_build = __esm(() => {
27779
27893
 
27780
27894
  // src/dev/runtimePaths.ts
27781
27895
  import { existsSync as existsSync42 } from "fs";
27782
- import { resolve as resolve40 } from "path";
27896
+ import { resolve as resolve41 } from "path";
27783
27897
  var resolveDevClientDirectory = () => {
27784
27898
  const candidates = [
27785
- resolve40(import.meta.dir, "client"),
27786
- resolve40(import.meta.dir, "dev/client"),
27787
- resolve40(import.meta.dir, "../dev/client")
27899
+ resolve41(import.meta.dir, "client"),
27900
+ resolve41(import.meta.dir, "dev/client"),
27901
+ resolve41(import.meta.dir, "../dev/client")
27788
27902
  ];
27789
- const directory = candidates.find((candidate) => existsSync42(resolve40(candidate, "hmrClient.ts")));
27903
+ const directory = candidates.find((candidate) => existsSync42(resolve41(candidate, "hmrClient.ts")));
27790
27904
  if (!directory) {
27791
27905
  throw new Error("AbsoluteJS browser HMR sources are missing from the installed package.");
27792
27906
  }
@@ -27943,7 +28057,7 @@ var init_buildEmberVendor = __esm(() => {
27943
28057
  });
27944
28058
 
27945
28059
  // src/build/workspacePackages.ts
27946
- import { readFileSync as readFileSync36, realpathSync as realpathSync5 } from "fs";
28060
+ import { readFileSync as readFileSync36, realpathSync as realpathSync6 } from "fs";
27947
28061
  import { join as join58, sep as sep11 } from "path";
27948
28062
  var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, projectRoot = process.cwd()) => {
27949
28063
  const key = `${projectRoot}\x00${specifier}`;
@@ -27952,7 +28066,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
27952
28066
  return known;
27953
28067
  let verdict = false;
27954
28068
  try {
27955
- const resolved = realpathSync5(Bun.resolveSync(specifier, projectRoot));
28069
+ const resolved = realpathSync6(Bun.resolveSync(specifier, projectRoot));
27956
28070
  verdict = !resolved.includes(NODE_MODULES_SEGMENT);
27957
28071
  } catch {
27958
28072
  verdict = false;
@@ -27977,7 +28091,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
27977
28091
  const dirs = new Set;
27978
28092
  for (const name of names) {
27979
28093
  try {
27980
- const linked = realpathSync5(join58(projectRoot, "node_modules", name));
28094
+ const linked = realpathSync6(join58(projectRoot, "node_modules", name));
27981
28095
  if (!`${linked}${sep11}`.includes(NODE_MODULES_SEGMENT))
27982
28096
  dirs.add(linked);
27983
28097
  } catch {}
@@ -28093,9 +28207,9 @@ var stripStringsAndComments = (source) => {
28093
28207
  };
28094
28208
 
28095
28209
  // src/dev/dependencyGraph.ts
28096
- import { existsSync as existsSync44, readFileSync as readFileSync37, realpathSync as realpathSync6 } from "fs";
28210
+ import { existsSync as existsSync44, readFileSync as readFileSync37, realpathSync as realpathSync7 } from "fs";
28097
28211
  var {Glob: Glob11 } = globalThis.Bun;
28098
- import { resolve as resolve41 } from "path";
28212
+ import { resolve as resolve42 } from "path";
28099
28213
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
28100
28214
  const lower = filePath.toLowerCase();
28101
28215
  if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
@@ -28106,17 +28220,17 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
28106
28220
  return "html";
28107
28221
  return null;
28108
28222
  }, resolveImportPath2 = (importPath, fromFile) => {
28109
- const fromDir = resolve41(fromFile, "..");
28223
+ const fromDir = resolve42(fromFile, "..");
28110
28224
  if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
28111
28225
  if (!isWorkspacePackageSpecifier(importPath, fromDir))
28112
28226
  return null;
28113
28227
  try {
28114
- return realpathSync6(Bun.resolveSync(importPath, fromDir));
28228
+ return realpathSync7(Bun.resolveSync(importPath, fromDir));
28115
28229
  } catch {
28116
28230
  return null;
28117
28231
  }
28118
28232
  }
28119
- const normalized = resolve41(fromDir, importPath);
28233
+ const normalized = resolve42(fromDir, importPath);
28120
28234
  const extensions = [
28121
28235
  ".ts",
28122
28236
  ".tsx",
@@ -28146,7 +28260,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
28146
28260
  dependents.delete(normalizedPath);
28147
28261
  }
28148
28262
  }, addFileToGraph = (graph, filePath) => {
28149
- const normalizedPath = resolve41(filePath);
28263
+ const normalizedPath = resolve42(filePath);
28150
28264
  if (!existsSync44(normalizedPath))
28151
28265
  return;
28152
28266
  const dependencies = extractDependencies(normalizedPath);
@@ -28173,10 +28287,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
28173
28287
  }, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
28174
28288
  const processedFiles = new Set;
28175
28289
  const glob = new Glob11("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
28176
- const resolvedDirs = directories.map((dir) => resolve41(dir)).filter((dir) => existsSync44(dir));
28290
+ const resolvedDirs = directories.map((dir) => resolve42(dir)).filter((dir) => existsSync44(dir));
28177
28291
  const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
28178
28292
  for (const file of allFiles) {
28179
- const fullPath = resolve41(file);
28293
+ const fullPath = resolve42(file);
28180
28294
  if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
28181
28295
  continue;
28182
28296
  if (processedFiles.has(fullPath))
@@ -28289,7 +28403,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
28289
28403
  return [];
28290
28404
  }
28291
28405
  }, getAffectedFiles = (graph, changedFile) => {
28292
- const normalizedPath = resolve41(changedFile);
28406
+ const normalizedPath = resolve42(changedFile);
28293
28407
  const affected = new Set;
28294
28408
  const toProcess = [normalizedPath];
28295
28409
  const processNode = (current) => {
@@ -28320,7 +28434,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
28320
28434
  }, removeDependentsForFile = (graph, normalizedPath) => {
28321
28435
  graph.dependents.delete(normalizedPath);
28322
28436
  }, removeFileFromGraph = (graph, filePath) => {
28323
- const normalizedPath = resolve41(filePath);
28437
+ const normalizedPath = resolve42(filePath);
28324
28438
  removeDepsForFile(graph, normalizedPath);
28325
28439
  removeDependentsForFile(graph, normalizedPath);
28326
28440
  };
@@ -28364,12 +28478,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
28364
28478
  };
28365
28479
 
28366
28480
  // src/dev/configResolver.ts
28367
- import { resolve as resolve42 } from "path";
28481
+ import { resolve as resolve43 } from "path";
28368
28482
  var resolveBuildPaths = (config) => {
28369
28483
  const cwd = process.cwd();
28370
28484
  const normalize = (path) => path.replace(/\\/g, "/");
28371
- const withDefault = (value, fallback) => normalize(resolve42(cwd, value ?? fallback));
28372
- const optional = (value) => value ? normalize(resolve42(cwd, value)) : undefined;
28485
+ const withDefault = (value, fallback) => normalize(resolve43(cwd, value ?? fallback));
28486
+ const optional = (value) => value ? normalize(resolve43(cwd, value)) : undefined;
28373
28487
  return {
28374
28488
  angularDir: optional(config.angularDirectory),
28375
28489
  assetsDir: optional(config.assetsDirectory),
@@ -28429,7 +28543,7 @@ var init_clientManager = __esm(() => {
28429
28543
 
28430
28544
  // src/dev/pathUtils.ts
28431
28545
  import { existsSync as existsSync45, readdirSync as readdirSync8, readFileSync as readFileSync38 } from "fs";
28432
- import { dirname as dirname34, resolve as resolve43 } from "path";
28546
+ import { dirname as dirname34, resolve as resolve44 } from "path";
28433
28547
  var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28434
28548
  if (shouldIgnorePath(filePath, resolved)) {
28435
28549
  return "ignored";
@@ -28510,7 +28624,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28510
28624
  return "unknown";
28511
28625
  }, collectAngularResourceDirs = (angularDir) => {
28512
28626
  const out = new Set;
28513
- const angularRoot = resolve43(angularDir);
28627
+ const angularRoot = resolve44(angularDir);
28514
28628
  const angularRootNormalized = normalizePath(angularRoot);
28515
28629
  const walk = (dir) => {
28516
28630
  let entries;
@@ -28523,7 +28637,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28523
28637
  if (entry.name.startsWith(".") || entry.name === "node_modules") {
28524
28638
  continue;
28525
28639
  }
28526
- const full = resolve43(dir, entry.name);
28640
+ const full = resolve44(dir, entry.name);
28527
28641
  if (entry.isDirectory()) {
28528
28642
  walk(full);
28529
28643
  continue;
@@ -28564,7 +28678,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28564
28678
  }
28565
28679
  const componentDir = dirname34(full);
28566
28680
  for (const ref of refs) {
28567
- const refAbs = normalizePath(resolve43(componentDir, ref));
28681
+ const refAbs = normalizePath(resolve44(componentDir, ref));
28568
28682
  const refDir = normalizePath(dirname34(refAbs));
28569
28683
  if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
28570
28684
  continue;
@@ -28581,7 +28695,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28581
28695
  const push = (path) => {
28582
28696
  if (!path)
28583
28697
  return;
28584
- const abs = normalizePath(resolve43(cwd, path));
28698
+ const abs = normalizePath(resolve44(cwd, path));
28585
28699
  if (!roots.includes(abs))
28586
28700
  roots.push(abs);
28587
28701
  };
@@ -28606,7 +28720,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28606
28720
  push(cfg.assetsDir);
28607
28721
  push(cfg.stylesDir);
28608
28722
  for (const candidate of ["src", "db", "assets", "styles"]) {
28609
- const abs = normalizePath(resolve43(cwd, candidate));
28723
+ const abs = normalizePath(resolve44(cwd, candidate));
28610
28724
  if (existsSync45(abs) && !roots.includes(abs))
28611
28725
  roots.push(abs);
28612
28726
  }
@@ -28618,7 +28732,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28618
28732
  continue;
28619
28733
  if (entry.name.startsWith("."))
28620
28734
  continue;
28621
- const abs = normalizePath(resolve43(cwd, entry.name));
28735
+ const abs = normalizePath(resolve44(cwd, entry.name));
28622
28736
  if (roots.includes(abs))
28623
28737
  continue;
28624
28738
  if (shouldIgnorePath(abs, resolved))
@@ -28629,7 +28743,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
28629
28743
  }
28630
28744
  const registryPath = config.islands?.registry;
28631
28745
  if (registryPath) {
28632
- const registryDir = normalizePath(dirname34(resolve43(cwd, registryPath)));
28746
+ const registryDir = normalizePath(dirname34(resolve44(cwd, registryPath)));
28633
28747
  const isWatched = roots.some((root) => registryDir === root || registryDir.startsWith(`${root}/`));
28634
28748
  if (!isWatched && registryDir !== normalizePath(cwd))
28635
28749
  push(registryDir);
@@ -28813,7 +28927,7 @@ var init_editorTempFiles = __esm(() => {
28813
28927
  // src/dev/fileWatcher.ts
28814
28928
  import { watch } from "fs";
28815
28929
  import { existsSync as existsSync47, readdirSync as readdirSync10, statSync as statSync8 } from "fs";
28816
- import { dirname as dirname35, join as join60, resolve as resolve44 } from "path";
28930
+ import { dirname as dirname35, join as join60, resolve as resolve45 } from "path";
28817
28931
  var safeRemoveFromGraph = (graph, fullPath) => {
28818
28932
  try {
28819
28933
  removeFileFromGraph(graph, fullPath);
@@ -28895,7 +29009,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
28895
29009
  }, addFileWatchers = (state, paths, onFileChange) => {
28896
29010
  const stylesDir = state.resolvedPaths?.stylesDir;
28897
29011
  paths.forEach((path) => {
28898
- const absolutePath = resolve44(path).replace(/\\/g, "/");
29012
+ const absolutePath = resolve45(path).replace(/\\/g, "/");
28899
29013
  if (!existsSync47(absolutePath)) {
28900
29014
  return;
28901
29015
  }
@@ -28964,7 +29078,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
28964
29078
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
28965
29079
  const stylesDir = state.resolvedPaths?.stylesDir;
28966
29080
  watchPaths.forEach((path) => {
28967
- const absolutePath = resolve44(path).replace(/\\/g, "/");
29081
+ const absolutePath = resolve45(path).replace(/\\/g, "/");
28968
29082
  if (!existsSync47(absolutePath)) {
28969
29083
  return;
28970
29084
  }
@@ -28983,7 +29097,7 @@ var init_fileWatcher = __esm(() => {
28983
29097
  // src/build/svelteDeclarations.ts
28984
29098
  import { existsSync as existsSync48, readdirSync as readdirSync11, readFileSync as readFileSync39, statSync as statSync9 } from "fs";
28985
29099
  import { mkdir as mkdir13, rename as rename4, rm as rm12, writeFile as writeFile12 } from "fs/promises";
28986
- import { dirname as dirname36, join as join61, relative as relative27, resolve as resolve45 } from "path";
29100
+ import { dirname as dirname36, join as join61, relative as relative27, resolve as resolve46 } from "path";
28987
29101
  var SVELTE_DECLARATIONS_ROOT = ".absolutejs/types/svelte", FINGERPRINT_FILE = ".fingerprint", SKIPPED_DIRECTORIES, EMIT_SCRIPT = `
28988
29102
  const { resolve, sep } = require('node:path');
28989
29103
  const { shimsPath, stagingDir, svelte2tsxPath, svelteDir, tsconfigPath, typescriptPath } =
@@ -29056,7 +29170,7 @@ emitDts({
29056
29170
  projectRoot,
29057
29171
  svelteDirectory
29058
29172
  }) => {
29059
- const svelteDir = resolve45(projectRoot, svelteDirectory);
29173
+ const svelteDir = resolve46(projectRoot, svelteDirectory);
29060
29174
  const tsconfigPath = join61(projectRoot, "tsconfig.json");
29061
29175
  if (!existsSync48(svelteDir))
29062
29176
  return {
@@ -29112,13 +29226,13 @@ var init_svelteDeclarations = __esm(() => {
29112
29226
  });
29113
29227
 
29114
29228
  // src/dev/svelteDeclarationRefresher.ts
29115
- import { resolve as resolve46, sep as sep12 } from "path";
29229
+ import { resolve as resolve47, sep as sep12 } from "path";
29116
29230
  var REFRESH_DEBOUNCE_MS = 400, createSvelteDeclarationRefresher = (config) => {
29117
29231
  const { svelteDirectory } = config;
29118
29232
  if (!svelteDirectory)
29119
29233
  return null;
29120
29234
  const projectRoot = process.cwd();
29121
- const svelteRoot = resolve46(projectRoot, svelteDirectory) + sep12;
29235
+ const svelteRoot = resolve47(projectRoot, svelteDirectory) + sep12;
29122
29236
  let timer;
29123
29237
  let running = false;
29124
29238
  let pending = false;
@@ -29149,7 +29263,7 @@ var REFRESH_DEBOUNCE_MS = 400, createSvelteDeclarationRefresher = (config) => {
29149
29263
  return {
29150
29264
  refresh: schedule,
29151
29265
  onFileChange: (filePath) => {
29152
- if (resolve46(filePath).startsWith(svelteRoot))
29266
+ if (resolve47(filePath).startsWith(svelteRoot))
29153
29267
  schedule();
29154
29268
  }
29155
29269
  };
@@ -29200,13 +29314,13 @@ var init_fileRouteRefresher = __esm(() => {
29200
29314
  });
29201
29315
 
29202
29316
  // src/dev/assetStore.ts
29203
- import { resolve as resolve47 } from "path";
29317
+ import { resolve as resolve48 } from "path";
29204
29318
  import { readdir as readdir5, unlink } from "fs/promises";
29205
29319
  var mimeTypes, getMimeType = (filePath) => {
29206
29320
  const ext = filePath.slice(filePath.lastIndexOf("."));
29207
29321
  return mimeTypes[ext] ?? "application/octet-stream";
29208
29322
  }, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
29209
- const fullPath = resolve47(dir, entry.name);
29323
+ const fullPath = resolve48(dir, entry.name);
29210
29324
  if (entry.isDirectory()) {
29211
29325
  return walkAndClean(fullPath);
29212
29326
  }
@@ -29222,10 +29336,10 @@ var mimeTypes, getMimeType = (filePath) => {
29222
29336
  }, cleanStaleAssets = async (store, manifest, buildDir) => {
29223
29337
  const liveByIdentity = new Map;
29224
29338
  for (const webPath of store.keys()) {
29225
- const diskPath = resolve47(buildDir, webPath.slice(1));
29339
+ const diskPath = resolve48(buildDir, webPath.slice(1));
29226
29340
  liveByIdentity.set(stripHash(diskPath), diskPath);
29227
29341
  }
29228
- const absBuildDir = resolve47(buildDir);
29342
+ const absBuildDir = resolve48(buildDir);
29229
29343
  Object.values(manifest).forEach((val) => {
29230
29344
  if (!HASHED_FILE_RE.test(val))
29231
29345
  return;
@@ -29245,13 +29359,13 @@ var mimeTypes, getMimeType = (filePath) => {
29245
29359
  }, evictMissingChunks = async (store, buildDir) => {
29246
29360
  const chunkKeys = [...store.keys()].filter((webPath) => webPath.includes("/chunk-"));
29247
29361
  await Promise.all(chunkKeys.map(async (webPath) => {
29248
- const onDisk = await Bun.file(resolve47(buildDir, webPath.slice(1))).exists().catch(() => false);
29362
+ const onDisk = await Bun.file(resolve48(buildDir, webPath.slice(1))).exists().catch(() => false);
29249
29363
  if (!onDisk)
29250
29364
  store.delete(webPath);
29251
29365
  }));
29252
29366
  }, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
29253
29367
  if (entry.isDirectory()) {
29254
- return scanDir(resolve47(dir, entry.name), `${prefix}${entry.name}/`);
29368
+ return scanDir(resolve48(dir, entry.name), `${prefix}${entry.name}/`);
29255
29369
  }
29256
29370
  if (!entry.name.startsWith("chunk-")) {
29257
29371
  return null;
@@ -29260,7 +29374,7 @@ var mimeTypes, getMimeType = (filePath) => {
29260
29374
  if (store.has(webPath)) {
29261
29375
  return null;
29262
29376
  }
29263
- return Bun.file(resolve47(dir, entry.name)).bytes().then((bytes) => {
29377
+ return Bun.file(resolve48(dir, entry.name)).bytes().then((bytes) => {
29264
29378
  store.set(webPath, bytes);
29265
29379
  return;
29266
29380
  }).catch(() => {});
@@ -29282,7 +29396,7 @@ var mimeTypes, getMimeType = (filePath) => {
29282
29396
  for (const webPath of newIdentities.values()) {
29283
29397
  if (store.has(webPath))
29284
29398
  continue;
29285
- loadPromises.push(Bun.file(resolve47(buildDir, webPath.slice(1))).bytes().then((bytes) => {
29399
+ loadPromises.push(Bun.file(resolve48(buildDir, webPath.slice(1))).bytes().then((bytes) => {
29286
29400
  store.set(webPath, bytes);
29287
29401
  return;
29288
29402
  }).catch(() => {}));
@@ -29328,10 +29442,10 @@ var init_assetStore = __esm(() => {
29328
29442
  });
29329
29443
 
29330
29444
  // src/dev/restartScope.ts
29331
- import { realpathSync as realpathSync7, statSync as statSync10 } from "fs";
29445
+ import { realpathSync as realpathSync8, statSync as statSync10 } from "fs";
29332
29446
  var MODULE_FILE, DOCUMENT_FILE, realPath = (path) => {
29333
29447
  try {
29334
- return realpathSync7(path);
29448
+ return realpathSync8(path);
29335
29449
  } catch {
29336
29450
  return path;
29337
29451
  }
@@ -29355,7 +29469,7 @@ var init_restartScope = __esm(() => {
29355
29469
 
29356
29470
  // src/islands/pageMetadata.ts
29357
29471
  import { readFileSync as readFileSync40 } from "fs";
29358
- import { resolve as resolve48 } from "path";
29472
+ import { resolve as resolve49 } from "path";
29359
29473
  var pagePatterns, getPageDirs = (config) => [
29360
29474
  { dir: config.angularDirectory, framework: "angular" },
29361
29475
  { dir: config.emberDirectory, framework: "ember" },
@@ -29375,7 +29489,7 @@ var pagePatterns, getPageDirs = (config) => [
29375
29489
  const source = definition.buildReference?.source;
29376
29490
  if (!source)
29377
29491
  continue;
29378
- lookup.set(`${definition.framework}:${definition.component}`, resolve48(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, source)));
29492
+ lookup.set(`${definition.framework}:${definition.component}`, resolve49(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, source)));
29379
29493
  }
29380
29494
  return lookup;
29381
29495
  }, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
@@ -29388,13 +29502,13 @@ var pagePatterns, getPageDirs = (config) => [
29388
29502
  const pattern = pagePatterns[entry.framework];
29389
29503
  if (!pattern)
29390
29504
  return;
29391
- const files = await scanEntryPoints(resolve48(entry.dir), pattern);
29505
+ const files = await scanEntryPoints(resolve49(entry.dir), pattern);
29392
29506
  for (const filePath of files) {
29393
29507
  const source = readFileSync40(filePath, "utf-8");
29394
29508
  const islands = extractIslandUsagesFromSource(source);
29395
- pageMetadata.set(resolve48(filePath), {
29509
+ pageMetadata.set(resolve49(filePath), {
29396
29510
  islands: resolveIslandUsages(islands, islandSourceLookup),
29397
- pagePath: resolve48(filePath)
29511
+ pagePath: resolve49(filePath)
29398
29512
  });
29399
29513
  }
29400
29514
  }, loadPageIslandMetadata = async (config) => {
@@ -29512,9 +29626,9 @@ var init_transformCache = __esm(() => {
29512
29626
  });
29513
29627
 
29514
29628
  // src/dev/reactComponentClassifier.ts
29515
- import { resolve as resolve49 } from "path";
29629
+ import { resolve as resolve50 } from "path";
29516
29630
  var classifyComponent = (filePath) => {
29517
- const normalizedPath = resolve49(filePath);
29631
+ const normalizedPath = resolve50(filePath);
29518
29632
  if (normalizedPath.includes("/react/pages/")) {
29519
29633
  return "server";
29520
29634
  }
@@ -29526,7 +29640,7 @@ var classifyComponent = (filePath) => {
29526
29640
  var init_reactComponentClassifier = () => {};
29527
29641
 
29528
29642
  // src/dev/moduleMapper.ts
29529
- import { basename as basename20, resolve as resolve50 } from "path";
29643
+ import { basename as basename21, resolve as resolve51 } from "path";
29530
29644
  var buildModulePaths = (moduleKeys, manifest) => {
29531
29645
  const modulePaths = {};
29532
29646
  moduleKeys.forEach((key) => {
@@ -29536,7 +29650,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
29536
29650
  });
29537
29651
  return modulePaths;
29538
29652
  }, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
29539
- const normalizedFile = resolve50(sourceFile);
29653
+ const normalizedFile = resolve51(sourceFile);
29540
29654
  const normalizedPath = normalizedFile.replace(/\\/g, "/");
29541
29655
  if (processedFiles.has(normalizedFile)) {
29542
29656
  return null;
@@ -29572,8 +29686,8 @@ var buildModulePaths = (moduleKeys, manifest) => {
29572
29686
  });
29573
29687
  return grouped;
29574
29688
  }, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
29575
- const normalizedFile = resolve50(sourceFile);
29576
- const fileName = basename20(normalizedFile);
29689
+ const normalizedFile = resolve51(sourceFile);
29690
+ const fileName = basename21(normalizedFile);
29577
29691
  const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
29578
29692
  const pascalName = toPascal(baseName);
29579
29693
  const keys = [];
@@ -29627,7 +29741,7 @@ var init_moduleMapper = __esm(() => {
29627
29741
  });
29628
29742
 
29629
29743
  // src/dev/reactServerComponentsRebuild.ts
29630
- import { relative as relative28, resolve as resolve51 } from "path";
29744
+ import { relative as relative28, resolve as resolve52 } from "path";
29631
29745
  var toError = (error) => error instanceof Error ? error : new Error(String(error)), runPass = async (state, directory) => {
29632
29746
  const { buildDir } = state.resolvedPaths;
29633
29747
  const result = await buildReactServerComponentsPass({
@@ -29649,8 +29763,8 @@ var toError = (error) => error instanceof Error ? error : new Error(String(error
29649
29763
  const directory = config.reactServerComponentsDirectory;
29650
29764
  if (!directory)
29651
29765
  return false;
29652
- const absolutePath = normalizePath(resolve51(filePath));
29653
- if (!absolutePath.startsWith(`${normalizePath(resolve51(directory))}/`))
29766
+ const absolutePath = normalizePath(resolve52(filePath));
29767
+ if (!absolutePath.startsWith(`${normalizePath(resolve52(directory))}/`))
29654
29768
  return false;
29655
29769
  state.fileHashes.set(absolutePath, currentHash);
29656
29770
  const startedAt = performance.now();
@@ -29670,7 +29784,7 @@ var init_reactServerComponentsRebuild = __esm(() => {
29670
29784
 
29671
29785
  // src/utils/spaRouteCss.ts
29672
29786
  import { readFile as readFile9 } from "fs/promises";
29673
- import { dirname as dirname37, isAbsolute as isAbsolute11, resolve as resolve52 } from "path";
29787
+ import { dirname as dirname37, isAbsolute as isAbsolute11, resolve as resolve53 } from "path";
29674
29788
  var sideManifestCache, readSideManifest = async (sideManifestPath) => {
29675
29789
  const cached = sideManifestCache.get(sideManifestPath);
29676
29790
  if (cached !== undefined)
@@ -29708,7 +29822,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
29708
29822
  }, readChildCss = async (cssPath, sideManifestPath) => {
29709
29823
  if (!cssPath)
29710
29824
  return "";
29711
- const resolvedCssPath = isAbsolute11(cssPath) ? cssPath : resolve52(dirname37(sideManifestPath), cssPath);
29825
+ const resolvedCssPath = isAbsolute11(cssPath) ? cssPath : resolve53(dirname37(sideManifestPath), cssPath);
29712
29826
  const cached = childCssCache.get(resolvedCssPath);
29713
29827
  if (cached !== undefined)
29714
29828
  return cached;
@@ -29793,7 +29907,7 @@ __export(exports_resolveOwningComponents, {
29793
29907
  resolveOwningComponents: () => resolveOwningComponents
29794
29908
  });
29795
29909
  import { readdirSync as readdirSync12, readFileSync as readFileSync42, statSync as statSync12 } from "fs";
29796
- import { dirname as dirname38, extname as extname19, join as join62, resolve as resolve53 } from "path";
29910
+ import { dirname as dirname38, extname as extname19, join as join62, resolve as resolve54 } from "path";
29797
29911
  var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
29798
29912
  const out = [];
29799
29913
  const visit = (dir) => {
@@ -29905,7 +30019,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
29905
30019
  };
29906
30020
  visit(sourceFile);
29907
30021
  return out;
29908
- }, safeNormalize = (path) => resolve53(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
30022
+ }, safeNormalize = (path) => resolve54(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
29909
30023
  const { changedFilePath, userAngularRoot } = params;
29910
30024
  const changedAbs = safeNormalize(changedFilePath);
29911
30025
  const out = [];
@@ -29974,7 +30088,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
29974
30088
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
29975
30089
  return null;
29976
30090
  }
29977
- const base = resolve53(childDir, spec);
30091
+ const base = resolve54(childDir, spec);
29978
30092
  const candidates = [
29979
30093
  `${base}.ts`,
29980
30094
  `${base}.tsx`,
@@ -30012,7 +30126,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
30012
30126
  };
30013
30127
  if (cls.kind === "component") {
30014
30128
  for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
30015
- const abs = safeNormalize(resolve53(componentDir, url));
30129
+ const abs = safeNormalize(resolve54(componentDir, url));
30016
30130
  const existing = resource.get(abs);
30017
30131
  if (existing)
30018
30132
  existing.push(entity);
@@ -30281,7 +30395,7 @@ var init_webSocket = __esm(() => {
30281
30395
  });
30282
30396
 
30283
30397
  // src/utils/loadConfig.ts
30284
- import { resolve as resolve54 } from "path";
30398
+ import { resolve as resolve55 } from "path";
30285
30399
  var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject2(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
30286
30400
  if (!isObject2(config)) {
30287
30401
  return false;
@@ -30332,7 +30446,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
30332
30446
  }
30333
30447
  return config;
30334
30448
  }, loadRawConfig = async (configPath) => {
30335
- const resolved = resolve54(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
30449
+ const resolved = resolve55(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
30336
30450
  const mod = await import(resolved);
30337
30451
  const config = mod.default ?? mod.config;
30338
30452
  if (!config) {
@@ -30611,12 +30725,27 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
30611
30725
  browserManifest[key] = value;
30612
30726
  }
30613
30727
  return browserManifest;
30614
- }, buildIslandsHeadMarkup = (manifest) => {
30728
+ }, ISLAND_MARKER_TAG, ISLAND_FRAMEWORKS, readMarkerAttribute = (tag, name) => new RegExp(`\\b${name}="([^"]*)"`).exec(tag)?.[1]?.replaceAll("&quot;", '"').replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&"), toIslandFramework = (value) => ISLAND_FRAMEWORKS.find((framework) => framework === value), collectRenderedIslandStyleKeys = (html) => {
30729
+ const keys = new Set;
30730
+ for (const [tag] of html.matchAll(ISLAND_MARKER_TAG)) {
30731
+ const framework = toIslandFramework(readMarkerAttribute(tag, "data-framework"));
30732
+ const component = readMarkerAttribute(tag, "data-component");
30733
+ if (framework && component)
30734
+ keys.add(getIslandStyleManifestKey(framework, component));
30735
+ }
30736
+ return keys;
30737
+ }, buildIslandStyleLinks = (manifest, html) => {
30738
+ if (html === undefined)
30739
+ return "";
30740
+ const renderedKeys = collectRenderedIslandStyleKeys(html);
30741
+ return getIslandStyleManifestEntries(manifest).filter(([key]) => renderedKeys.has(key)).filter(([, href]) => !html.includes(`href="${href}"`)).map(([key, href]) => `<link rel="stylesheet" href="${href}" data-island-style="${key}"${nonceAttr()}>`).join("");
30742
+ }, buildIslandsHeadMarkup = (manifest, html) => {
30743
+ const styleLinks = buildIslandStyleLinks(manifest, html);
30615
30744
  const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(toBrowserManifest(manifest)))}</script>`;
30616
30745
  const islandStateScript = `<script${nonceAttr()}>window.__ABS_ISLAND_STATE__ = ${escapeScriptContent(JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {}))}</script>`;
30617
30746
  const bootstrapPath = getIslandBootstrapPath(manifest);
30618
30747
  const bootstrapScript = bootstrapPath ? `<script${nonceAttr()} type="module" src="${bootstrapPath}"></script>` : "";
30619
- return `${manifestScript}${islandStateScript}${bootstrapScript}`;
30748
+ return `${styleLinks}${manifestScript}${islandStateScript}${bootstrapScript}`;
30620
30749
  }, injectHeadMarkup = (html, markup) => {
30621
30750
  const closingHeadIndex = html.indexOf("</head>");
30622
30751
  if (closingHeadIndex >= 0) {
@@ -30798,7 +30927,7 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
30798
30927
  return html;
30799
30928
  }
30800
30929
  warnIfBootstrapMissing(manifest);
30801
- return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));
30930
+ return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest, html));
30802
30931
  }, injectIslandPageContextStream = (stream, options) => {
30803
30932
  const manifest = globalThis.__absoluteManifest;
30804
30933
  if (!manifest)
@@ -30822,6 +30951,13 @@ var init_islandPageContext = __esm(() => {
30822
30951
  init_logger();
30823
30952
  MANIFEST_BUILD_DIR_KEY = Symbol.for("absolutejs.islandManifestBuildDir");
30824
30953
  WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]|^\\\\/;
30954
+ ISLAND_MARKER_TAG = /<[^>]*\bdata-island="true"[^>]*>/g;
30955
+ ISLAND_FRAMEWORKS = [
30956
+ "react",
30957
+ "svelte",
30958
+ "vue",
30959
+ "angular"
30960
+ ];
30825
30961
  });
30826
30962
 
30827
30963
  // src/core/requestContext.ts
@@ -31138,7 +31274,7 @@ var init_formActionFlash = __esm(() => {
31138
31274
  });
31139
31275
 
31140
31276
  // src/core/loadIslandRegistry.ts
31141
- import { resolve as resolve55 } from "path";
31277
+ import { resolve as resolve56 } from "path";
31142
31278
  var isRecord10 = (value) => typeof value === "object" && value !== null, resolveRegistryExport2 = (mod) => {
31143
31279
  if (isRecord10(mod.islandRegistry))
31144
31280
  return mod.islandRegistry;
@@ -31146,7 +31282,7 @@ var isRecord10 = (value) => typeof value === "object" && value !== null, resolve
31146
31282
  return mod.default;
31147
31283
  throw new Error("Island registry module must export `islandRegistry` or a default registry object.");
31148
31284
  }, isRegistryModuleExport = (value) => isRecord10(value), isIslandRegistryInput = (value) => isRecord10(value), loadIslandRegistry = async (registryPath) => {
31149
- const resolvedRegistryPath = resolve55(registryPath);
31285
+ const resolvedRegistryPath = resolve56(registryPath);
31150
31286
  const buildInfo = await loadIslandRegistryBuildInfo(resolvedRegistryPath);
31151
31287
  if (buildInfo.definitions.length > 0) {
31152
31288
  return buildInfo.registry;
@@ -31533,11 +31669,11 @@ __export(exports_config, {
31533
31669
  normalizeAbsoluteMobileConfig: () => normalizeAbsoluteMobileConfig
31534
31670
  });
31535
31671
  import { readFileSync as readFileSync47 } from "fs";
31536
- import { resolve as resolve56 } from "path";
31672
+ import { resolve as resolve57 } from "path";
31537
31673
  import { createHash as createHash6, createPublicKey, X509Certificate } from "crypto";
31538
31674
  var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FINGERPRINT_PATTERN, UPDATE_NAME_PATTERN, RELEASE_TARGET_PATTERN, UPDATE_PUBLIC_KEY_PATTERN, ENVIRONMENT_NAME_PATTERN, COLOR_PATTERN, DEFAULT_UPDATE_BOOT_TIMEOUT_MS = 20000, DEFAULT_UPDATE_HEALTH_FAILURE_RATE = 0.2, DEFAULT_UPDATE_HEALTH_MINIMUM_REPORTS = 20, DEFAULT_UPDATE_ROLLOUT_FAILURE_RATE = 0.05, DEFAULT_UPDATE_ROLLOUT_OBSERVATION_MINUTES = 60, MINUTE_MS, DEFAULT_UPDATE_ROLLOUT_STAGES, MINIMUM_UPDATE_BOOT_TIMEOUT_MS = 5000, MAXIMUM_UPDATE_BOOT_TIMEOUT_MS = 120000, HOSTNAME_PATTERN, EXPO_RESERVED_ROUTE_PREFIXES, resolveProjectPath = (projectRoot, value, field) => {
31539
- const root = resolve56(projectRoot);
31540
- const path = resolve56(root, value);
31675
+ const root = resolve57(projectRoot);
31676
+ const path = resolve57(root, value);
31541
31677
  if (path !== root && !path.startsWith(`${root}/`)) {
31542
31678
  throw new TypeError(`${field} must remain inside the project root.`);
31543
31679
  }
@@ -32056,7 +32192,7 @@ import {
32056
32192
  rm as rm14,
32057
32193
  writeFile as writeFile13
32058
32194
  } from "fs/promises";
32059
- import { resolve as resolve57 } from "path";
32195
+ import { resolve as resolve58 } from "path";
32060
32196
  import { Elysia as Elysia6 } from "elysia";
32061
32197
  var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_OK = 200, VERIFY_TIMEOUT_MS = 1e4, ANDROID_ASSOCIATION_PATH = "/.well-known/assetlinks.json", APPLE_ASSOCIATION_PATH = "/.well-known/apple-app-site-association", missingIdentity = (field, platform) => new TypeError(`${field} is required to publish ${platform} deep-link association files.`), createAppleDocument = (config, requireAll) => {
32062
32198
  if (!config.platforms.includes("ios"))
@@ -32143,7 +32279,7 @@ var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_
32143
32279
  return false;
32144
32280
  }
32145
32281
  }, assertOwnedOutput = async (root) => {
32146
- const path = resolve57(root, OWNERSHIP_FILE);
32282
+ const path = resolve58(root, OWNERSHIP_FILE);
32147
32283
  let ownership;
32148
32284
  try {
32149
32285
  ownership = JSON.parse(await readFile10(path, "utf8"));
@@ -32170,10 +32306,10 @@ var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_
32170
32306
  if (hasCurrent)
32171
32307
  await rm14(backup, { force: true, recursive: true });
32172
32308
  }, materializeHost = async (root, host, files) => {
32173
- const directory = resolve57(root, host, ".well-known");
32309
+ const directory = resolve58(root, host, ".well-known");
32174
32310
  await mkdir14(directory, { recursive: true });
32175
32311
  return Promise.all(files.map(async ([name, document2]) => {
32176
- const path = resolve57(directory, name);
32312
+ const path = resolve58(directory, name);
32177
32313
  await writeAtomic(path, `${JSON.stringify(document2, null, 2)}
32178
32314
  `);
32179
32315
  return path;
@@ -32196,7 +32332,7 @@ var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_
32196
32332
  });
32197
32333
  return endpoints;
32198
32334
  }), materializeAbsoluteMobileAssociationFiles = async (config, outputDirectory) => {
32199
- const root = resolve57(outputDirectory);
32335
+ const root = resolve58(outputDirectory);
32200
32336
  const temporary = `${root}.${crypto.randomUUID()}.tmp`;
32201
32337
  const documents = createAbsoluteMobileAssociationDocuments(config, {
32202
32338
  requireAll: true
@@ -32210,10 +32346,10 @@ var JSON_HEADERS, OWNERSHIP_FILE = ".absolutejs-mobile-associations.json", HTTP_
32210
32346
  await mkdir14(temporary, { recursive: true });
32211
32347
  try {
32212
32348
  const temporaryPaths = (await Promise.all(config.deepLinkHosts.map((host) => materializeHost(temporary, host, files)))).flat();
32213
- await writeAtomic(resolve57(temporary, OWNERSHIP_FILE), `${JSON.stringify({ format: 1, hosts: config.deepLinkHosts }, null, 2)}
32349
+ await writeAtomic(resolve58(temporary, OWNERSHIP_FILE), `${JSON.stringify({ format: 1, hosts: config.deepLinkHosts }, null, 2)}
32214
32350
  `);
32215
32351
  await publishGeneratedDirectory(temporary, root);
32216
- const written = temporaryPaths.map((path) => resolve57(root, path.slice(temporary.length + 1)));
32352
+ const written = temporaryPaths.map((path) => resolve58(root, path.slice(temporary.length + 1)));
32217
32353
  return { root, written };
32218
32354
  } catch (error) {
32219
32355
  await rm14(temporary, { force: true, recursive: true });
@@ -33002,12 +33138,12 @@ import {
33002
33138
  X509Certificate as X509Certificate3
33003
33139
  } from "crypto";
33004
33140
  import { access as access4, mkdir as mkdir15 } from "fs/promises";
33005
- import { dirname as dirname39, isAbsolute as isAbsolute12, relative as relative29, resolve as resolve58, sep as sep13 } from "path";
33141
+ import { dirname as dirname39, isAbsolute as isAbsolute12, relative as relative29, resolve as resolve59, sep as sep13 } from "path";
33006
33142
  import { pathToFileURL as pathToFileURL3 } from "url";
33007
33143
  import { Elysia as Elysia8 } from "elysia";
33008
33144
  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) => {
33009
- const root = resolve58(projectRoot);
33010
- const path = resolve58(root, requested);
33145
+ const root = resolve59(projectRoot);
33146
+ const path = resolve59(root, requested);
33011
33147
  const projectRelative = relative29(root, path);
33012
33148
  if (projectRelative === ".." || projectRelative.startsWith(`..${sep13}`) || isAbsolute12(projectRelative))
33013
33149
  throw new TypeError("mobile.updates.server.registry must remain inside the project.");
@@ -33278,7 +33414,7 @@ var init_bridgeInternals = __esm(() => {
33278
33414
  });
33279
33415
 
33280
33416
  // src/dev/angular/hmrCompiler.ts
33281
- import { dirname as dirname40, relative as relative30, resolve as resolve59 } from "path";
33417
+ import { dirname as dirname40, relative as relative30, resolve as resolve60 } from "path";
33282
33418
  import { performance as performance2 } from "perf_hooks";
33283
33419
  var encodeHmrComponentId = (absoluteFilePath, className) => {
33284
33420
  const projectRel = relative30(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
@@ -33290,7 +33426,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
33290
33426
  return null;
33291
33427
  const filePathRel = decoded.slice(0, separatorIndex);
33292
33428
  const className = decoded.slice(separatorIndex + 1);
33293
- const componentFilePath = resolve59(process.cwd(), filePathRel);
33429
+ const componentFilePath = resolve60(process.cwd(), filePathRel);
33294
33430
  const projectRelPath = relative30(process.cwd(), componentFilePath).replace(/\\/g, "/");
33295
33431
  const cacheKey = encodeURIComponent(`${projectRelPath}@${className}`);
33296
33432
  await Promise.resolve().then(() => init_fastHmrCompiler());
@@ -33496,12 +33632,12 @@ var init_hmr = __esm(() => {
33496
33632
 
33497
33633
  // src/plugins/devtoolsJson.ts
33498
33634
  import { existsSync as existsSync53, mkdirSync as mkdirSync19, readFileSync as readFileSync49, writeFileSync as writeFileSync16 } from "fs";
33499
- import { dirname as dirname41, join as join69, resolve as resolve60 } from "path";
33635
+ import { dirname as dirname41, join as join69, resolve as resolve61 } from "path";
33500
33636
  import { Elysia as Elysia10 } from "elysia";
33501
33637
  var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
33502
33638
  Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
33503
33639
  return uuid;
33504
- }, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve60(uuidCachePath ?? join69(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
33640
+ }, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve61(uuidCachePath ?? join69(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
33505
33641
  if (!existsSync53(cachePath))
33506
33642
  return null;
33507
33643
  try {
@@ -33527,7 +33663,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
33527
33663
  writeFileSync16(cachePath, uuid, "utf-8");
33528
33664
  return setGlobalUuid(uuid);
33529
33665
  }, devtoolsJson = (buildDir, options = {}) => {
33530
- const rootPath = resolve60(options.projectRoot ?? process.cwd());
33666
+ const rootPath = resolve61(options.projectRoot ?? process.cwd());
33531
33667
  const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
33532
33668
  const uuid = getOrCreateUuid(buildDir, options);
33533
33669
  return new Elysia10({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
@@ -33552,7 +33688,7 @@ var init_devtoolsJson = () => {};
33552
33688
 
33553
33689
  // src/plugins/imageOptimizer.ts
33554
33690
  import { existsSync as existsSync54 } from "fs";
33555
- import { resolve as resolve61 } from "path";
33691
+ import { resolve as resolve62 } from "path";
33556
33692
  import { Elysia as Elysia11 } from "elysia";
33557
33693
  var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
33558
33694
  try {
@@ -33565,7 +33701,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
33565
33701
  }
33566
33702
  }, resolveLocalImage = (url, buildDir) => {
33567
33703
  const cleanPath = url.startsWith("/") ? url.slice(1) : url;
33568
- return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve61(process.cwd()));
33704
+ return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve62(process.cwd()));
33569
33705
  }, parseQueryParams = (query, allowedSizes, defaultQuality) => {
33570
33706
  const url = typeof query["url"] === "string" ? query["url"] : undefined;
33571
33707
  const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
@@ -35195,7 +35331,7 @@ var init_partialPrerenderServe = __esm(() => {
35195
35331
  // src/core/prepare.ts
35196
35332
  import { createHash as createHash11 } from "crypto";
35197
35333
  import { existsSync as existsSync56, readdirSync as readdirSync13, readFileSync as readFileSync52 } from "fs";
35198
- import { basename as basename21, join as join73, relative as relative31, resolve as resolvePath3 } from "path";
35334
+ import { basename as basename22, join as join73, relative as relative31, resolve as resolvePath3 } from "path";
35199
35335
  import { Elysia as Elysia15, ElysiaError, InternalServerError, NotFound } from "elysia";
35200
35336
  var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
35201
35337
  setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
@@ -35478,7 +35614,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
35478
35614
  for (const entry of entries) {
35479
35615
  if (!entry.endsWith(".html"))
35480
35616
  continue;
35481
- const name = basename21(entry, ".html");
35617
+ const name = basename22(entry, ".html");
35482
35618
  const route = name === "index" ? "/" : `/${name}`;
35483
35619
  map.set(route, join73(prerenderDir, entry));
35484
35620
  }
@@ -35504,6 +35640,8 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
35504
35640
  const { endpoint } = resolveVitalsConfig(config.vitals);
35505
35641
  return endpoint.startsWith("/") ? createVitalsPlugin(endpoint) : new Elysia15({ name: "absolutejs-vitals-remote" });
35506
35642
  }, createNotFoundPlugin = () => new Elysia15({ name: "absolutejs-not-found" }).onError("global", NotFound, async ({ request }) => {
35643
+ if (!isPageRequest(request))
35644
+ return;
35507
35645
  const response = await renderFirstNotFound({
35508
35646
  preferHtmx: request.headers.get("hx-request") === "true"
35509
35647
  });
@@ -35793,8 +35931,8 @@ __export(exports_moduleServer, {
35793
35931
  warmPage: () => warmPage,
35794
35932
  warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
35795
35933
  });
35796
- import { existsSync as existsSync57, readFileSync as readFileSync53, realpathSync as realpathSync8, statSync as statSync13 } from "fs";
35797
- import { basename as basename22, dirname as dirname43, extname as extname20, join as join74, resolve as resolve62, relative as relative32 } from "path";
35934
+ import { existsSync as existsSync57, readFileSync as readFileSync53, realpathSync as realpathSync9, statSync as statSync13 } from "fs";
35935
+ import { basename as basename23, dirname as dirname43, extname as extname20, join as join74, resolve as resolve63, relative as relative32 } from "path";
35798
35936
  var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
35799
35937
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
35800
35938
  const allExports = [];
@@ -35814,10 +35952,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
35814
35952
  ${stubs}
35815
35953
  `;
35816
35954
  }, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
35817
- const directHit = extensions.find((ext) => existsSync57(resolve62(projectRoot, srcPath + ext)));
35955
+ const directHit = extensions.find((ext) => existsSync57(resolve63(projectRoot, srcPath + ext)));
35818
35956
  if (directHit)
35819
35957
  return srcPath + directHit;
35820
- const indexHit = extensions.find((ext) => existsSync57(resolve62(projectRoot, srcPath, `index${ext}`)));
35958
+ const indexHit = extensions.find((ext) => existsSync57(resolve63(projectRoot, srcPath, `index${ext}`)));
35821
35959
  if (indexHit)
35822
35960
  return `${srcPath}/index${indexHit}`;
35823
35961
  return srcPath;
@@ -35846,7 +35984,7 @@ ${stubs}
35846
35984
  return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
35847
35985
  }, srcUrl = (relPath, projectRoot) => {
35848
35986
  const base = `${SRC_PREFIX}${encodeSrcPath(relPath)}`;
35849
- const absPath = resolve62(projectRoot, relPath);
35987
+ const absPath = resolve63(projectRoot, relPath);
35850
35988
  const cached = mtimeCache.get(absPath);
35851
35989
  if (cached !== undefined)
35852
35990
  return `${base}?v=${buildVersion(cached, absPath)}`;
@@ -35858,12 +35996,12 @@ ${stubs}
35858
35996
  return base;
35859
35997
  }
35860
35998
  }, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
35861
- const absPath = resolve62(fileDir, relPath);
35999
+ const absPath = resolve63(fileDir, relPath);
35862
36000
  const rel = relative32(projectRoot, absPath);
35863
36001
  const extension = extname20(rel);
35864
36002
  let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
35865
36003
  if (extname20(srcPath) === ".svelte") {
35866
- srcPath = relative32(projectRoot, resolveSvelteModulePath(resolve62(projectRoot, srcPath)));
36004
+ srcPath = relative32(projectRoot, resolveSvelteModulePath(resolve63(projectRoot, srcPath)));
35867
36005
  }
35868
36006
  return srcUrl(srcPath, projectRoot);
35869
36007
  }, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
@@ -35882,13 +36020,13 @@ ${stubs}
35882
36020
  const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
35883
36021
  const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
35884
36022
  if (!subpath) {
35885
- const pkgDir = resolve62(projectRoot, "node_modules", packageName ?? "");
36023
+ const pkgDir = resolve63(projectRoot, "node_modules", packageName ?? "");
35886
36024
  const pkgJsonPath = join74(pkgDir, "package.json");
35887
36025
  if (existsSync57(pkgJsonPath)) {
35888
36026
  const pkg = JSON.parse(readFileSync53(pkgJsonPath, "utf-8"));
35889
36027
  const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
35890
36028
  if (esmEntry) {
35891
- const resolved = resolve62(pkgDir, esmEntry);
36029
+ const resolved = resolve63(pkgDir, esmEntry);
35892
36030
  if (existsSync57(resolved))
35893
36031
  return relative32(projectRoot, resolved);
35894
36032
  }
@@ -35945,12 +36083,12 @@ ${stubs}
35945
36083
  result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
35946
36084
  result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
35947
36085
  result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
35948
- const absPath = resolve62(fileDir, relPath);
36086
+ const absPath = resolve63(fileDir, relPath);
35949
36087
  const rel = relative32(projectRoot, absPath);
35950
36088
  return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
35951
36089
  });
35952
36090
  result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
35953
- const absPath = resolve62(fileDir, relPath);
36091
+ const absPath = resolve63(fileDir, relPath);
35954
36092
  const rel = relative32(projectRoot, absPath);
35955
36093
  return `'${srcUrl(rel, projectRoot)}'`;
35956
36094
  });
@@ -36177,7 +36315,7 @@ ${code}`;
36177
36315
  ` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
36178
36316
  ` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
36179
36317
  return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
36180
- }, svelteLazyRegistrations = (raw, filePath, projectRoot) => Array.from(raw.matchAll(/\bimport\s*\(\s*['"](\.[^'"]+\.svelte)['"]\s*\)/g)).map((match) => match[1]).filter((spec) => spec !== undefined).filter((spec) => existsSync57(resolve62(dirname43(filePath), spec))).map((spec) => lazyModuleRegistration(relative32(projectRoot, resolve62(dirname43(filePath), spec)).replace(/\\/g, "/"), spec)).join(""), transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
36318
+ }, svelteLazyRegistrations = (raw, filePath, projectRoot) => Array.from(raw.matchAll(/\bimport\s*\(\s*['"](\.[^'"]+\.svelte)['"]\s*\)/g)).map((match) => match[1]).filter((spec) => spec !== undefined).filter((spec) => existsSync57(resolve63(dirname43(filePath), spec))).map((spec) => lazyModuleRegistration(relative32(projectRoot, resolve63(dirname43(filePath), spec)).replace(/\\/g, "/"), spec)).join(""), transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
36181
36319
  const raw = readFileSync53(filePath, "utf-8");
36182
36320
  if (!svelteCompiler) {
36183
36321
  svelteCompiler = await import("svelte/compiler");
@@ -36192,8 +36330,10 @@ ${code}`;
36192
36330
  }, compileVueTemplate = (descriptor, compiledScript, filePath, componentId) => {
36193
36331
  const compiler = getLoadedVueCompiler();
36194
36332
  const scriptContent = compiledScript.content;
36195
- if (!descriptor.template)
36196
- return scriptContent;
36333
+ if (!descriptor.template) {
36334
+ return `${scriptContent}
36335
+ export default __script__;`;
36336
+ }
36197
36337
  const isScoped = descriptor.styles.some((style) => style.scoped);
36198
36338
  const templateResult = compiler.compileTemplate({
36199
36339
  compilerOptions: {
@@ -36207,8 +36347,7 @@ ${code}`;
36207
36347
  scoped: isScoped,
36208
36348
  source: descriptor.template.content
36209
36349
  });
36210
- let code = scriptContent.replace("export default", "const __script__ =");
36211
- code += `
36350
+ let code = `${scriptContent}
36212
36351
  ${templateResult.code}`;
36213
36352
  code += `
36214
36353
  __script__.render = render;`;
@@ -36250,19 +36389,20 @@ ${code}`;
36250
36389
  if (!vueCompiler) {
36251
36390
  vueCompiler = await loadVueCompiler();
36252
36391
  }
36253
- const fileName = basename22(filePath, ".vue");
36392
+ const fileName = basename23(filePath, ".vue");
36254
36393
  const componentId = toKebab(fileName);
36255
36394
  const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
36256
36395
  const hasScript = descriptor.script || descriptor.scriptSetup;
36257
36396
  const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
36258
36397
  fs: {
36259
36398
  fileExists: isFile,
36260
- realpath: realpathSync8,
36399
+ realpath: realpathSync9,
36261
36400
  readFile: (file) => isFile(file) ? readFileSync53(file, "utf-8") : undefined
36262
36401
  },
36402
+ genDefaultAs: "__script__",
36263
36403
  id: componentId,
36264
36404
  inlineTemplate: false
36265
- }) : { bindings: {}, content: "export default {};" };
36405
+ }) : { bindings: {}, content: "const __script__ = {};" };
36266
36406
  const compiledSfcScript = {
36267
36407
  bindings: compiledScript.bindings ?? {},
36268
36408
  content: compiledScript.content
@@ -36273,7 +36413,7 @@ ${code}`;
36273
36413
  code = injectVueHmr(code, filePath, projectRoot, vueDir);
36274
36414
  return rewriteImports(code, filePath, projectRoot, rewriter);
36275
36415
  }, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
36276
- const hmrBase = vueDir ? resolve62(vueDir) : projectRoot;
36416
+ const hmrBase = vueDir ? resolve63(vueDir) : projectRoot;
36277
36417
  const hmrId = relative32(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
36278
36418
  let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
36279
36419
  result += [
@@ -36422,7 +36562,7 @@ export default {};
36422
36562
  const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
36423
36563
  return jsResponse(`var s=document.createElement('style');var __absNonce=(document.querySelector('script[nonce],style[nonce]')||{}).nonce;if(__absNonce)s.nonce=__absNonce;s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
36424
36564
  }, resolveSourcePath2 = (relPath, projectRoot) => {
36425
- const filePath = resolve62(projectRoot, decodeSrcPath(relPath));
36565
+ const filePath = resolve63(projectRoot, decodeSrcPath(relPath));
36426
36566
  const ext = extname20(filePath);
36427
36567
  if (ext === ".svelte")
36428
36568
  return { ext, filePath: resolveSvelteModulePath(filePath) };
@@ -36459,14 +36599,14 @@ export default {};
36459
36599
  const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
36460
36600
  const candidates = [
36461
36601
  absoluteCandidate,
36462
- resolve62(projectRoot, tail)
36602
+ resolve63(projectRoot, tail)
36463
36603
  ];
36464
36604
  try {
36465
36605
  await Promise.resolve().then(() => init_loadConfig());
36466
36606
  const cfg = await loadConfig();
36467
- const angularDir = cfg.angularDirectory && resolve62(projectRoot, cfg.angularDirectory);
36607
+ const angularDir = cfg.angularDirectory && resolve63(projectRoot, cfg.angularDirectory);
36468
36608
  if (angularDir)
36469
- candidates.push(resolve62(angularDir, tail));
36609
+ candidates.push(resolve63(angularDir, tail));
36470
36610
  } catch {}
36471
36611
  for (const candidate of candidates) {
36472
36612
  if (await fileExists(candidate)) {
@@ -36497,7 +36637,7 @@ export default {};
36497
36637
  if (!TRANSPILABLE.has(ext))
36498
36638
  return;
36499
36639
  const stat = statSync13(filePath);
36500
- const resolvedVueDir = vueDir ? resolve62(vueDir) : undefined;
36640
+ const resolvedVueDir = vueDir ? resolve63(vueDir) : undefined;
36501
36641
  let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
36502
36642
  const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
36503
36643
  if (isAngularGeneratedJs) {
@@ -36553,7 +36693,7 @@ export default {};
36553
36693
  const ownMessage = source && typeof source === "object" ? Reflect.get(source, "message") : undefined;
36554
36694
  const message = typeof ownMessage === "string" ? ownMessage : String(source);
36555
36695
  return { message, ...readPosition(first) };
36556
- }, getTransformError = (filePath) => transformErrors.get(resolve62(filePath)), transformErrorResponse = (err) => {
36696
+ }, getTransformError = (filePath) => transformErrors.get(resolve63(filePath)), transformErrorResponse = (err) => {
36557
36697
  const errMsg = err instanceof Error ? err.message : String(err);
36558
36698
  return new Response(`console.error('[ModuleServer] Transform error:', ${JSON.stringify(errMsg)});`, {
36559
36699
  headers: { "Content-Type": "application/javascript" },
@@ -36576,16 +36716,16 @@ export default {};
36576
36716
  const relPath = pathname.slice(SRC_PREFIX.length);
36577
36717
  if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
36578
36718
  return handleBunWrapRequest();
36579
- const virtualCssResponse = handleVirtualSvelteCss(resolve62(projectRoot, decodeSrcPath(relPath)));
36719
+ const virtualCssResponse = handleVirtualSvelteCss(resolve63(projectRoot, decodeSrcPath(relPath)));
36580
36720
  if (virtualCssResponse)
36581
36721
  return virtualCssResponse;
36582
36722
  const { filePath, ext } = resolveSourcePath2(relPath, projectRoot);
36583
36723
  try {
36584
36724
  const response = await transformAndCache(filePath, ext, projectRoot, rewriter, frameworkDirs?.vue, stylePreprocessors);
36585
- transformErrors.delete(resolve62(filePath));
36725
+ transformErrors.delete(resolve63(filePath));
36586
36726
  return response;
36587
36727
  } catch (err) {
36588
- transformErrors.set(resolve62(filePath), describeTransformError(err));
36728
+ transformErrors.set(resolve63(filePath), describeTransformError(err));
36589
36729
  return transformErrorResponse(err);
36590
36730
  }
36591
36731
  };
@@ -36595,11 +36735,11 @@ export default {};
36595
36735
  SRC_IMPORT_RE.lastIndex = 0;
36596
36736
  while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
36597
36737
  if (match[1])
36598
- files.push(resolve62(projectRoot, decodeSrcPath(match[1])));
36738
+ files.push(resolve63(projectRoot, decodeSrcPath(match[1])));
36599
36739
  }
36600
36740
  return files;
36601
36741
  }, SRC_URL_PREFIX2, invalidateModule = (filePath) => {
36602
- const resolved = resolve62(filePath);
36742
+ const resolved = resolve63(filePath);
36603
36743
  transformErrors.delete(resolved);
36604
36744
  invalidate(filePath);
36605
36745
  if (resolved !== filePath)
@@ -36665,7 +36805,7 @@ export default {};
36665
36805
  return false;
36666
36806
  }
36667
36807
  await Promise.resolve().then(() => init_prepare());
36668
- patchManifestIndexes(cached.manifest, resolve62(state.resolvedPaths.buildDir, "_src_indexes"), SRC_PREFIX);
36808
+ patchManifestIndexes(cached.manifest, resolve63(state.resolvedPaths.buildDir, "_src_indexes"), SRC_PREFIX);
36669
36809
  logPageBuild(entry.source, entry.framework, Math.round(durationMs));
36670
36810
  logStartupTimingBlock("AbsoluteJS on-demand page build", [
36671
36811
  { durationMs, label: entry.name }
@@ -36932,11 +37072,11 @@ var exports_simpleHTMLHMR = {};
36932
37072
  __export(exports_simpleHTMLHMR, {
36933
37073
  handleHTMLUpdate: () => handleHTMLUpdate
36934
37074
  });
36935
- import { resolve as resolve63 } from "path";
37075
+ import { resolve as resolve64 } from "path";
36936
37076
  var handleHTMLUpdate = async (htmlFilePath) => {
36937
37077
  let htmlContent;
36938
37078
  try {
36939
- const resolvedPath = resolve63(htmlFilePath);
37079
+ const resolvedPath = resolve64(htmlFilePath);
36940
37080
  const file = Bun.file(resolvedPath);
36941
37081
  if (!await file.exists()) {
36942
37082
  return null;
@@ -36962,11 +37102,11 @@ var exports_simpleHTMXHMR = {};
36962
37102
  __export(exports_simpleHTMXHMR, {
36963
37103
  handleHTMXUpdate: () => handleHTMXUpdate
36964
37104
  });
36965
- import { resolve as resolve64 } from "path";
37105
+ import { resolve as resolve65 } from "path";
36966
37106
  var handleHTMXUpdate = async (htmxFilePath) => {
36967
37107
  let htmlContent;
36968
37108
  try {
36969
- const resolvedPath = resolve64(htmxFilePath);
37109
+ const resolvedPath = resolve65(htmxFilePath);
36970
37110
  const file = Bun.file(resolvedPath);
36971
37111
  if (!await file.exists()) {
36972
37112
  return null;
@@ -36988,8 +37128,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
36988
37128
  var init_simpleHTMXHMR = () => {};
36989
37129
 
36990
37130
  // src/dev/backendGraph.ts
36991
- import { readFileSync as readFileSync54, realpathSync as realpathSync9, statSync as statSync14 } from "fs";
36992
- import { dirname as dirname44, extname as extname21, resolve as resolve65 } from "path";
37131
+ import { readFileSync as readFileSync54, realpathSync as realpathSync10, statSync as statSync14 } from "fs";
37132
+ import { dirname as dirname44, extname as extname21, resolve as resolve66 } from "path";
36993
37133
  var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
36994
37134
  const loader = LOADERS[extname21(path)] ?? "ts";
36995
37135
  const existing = transpilers.get(loader);
@@ -37000,11 +37140,11 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
37000
37140
  return created;
37001
37141
  }, realPath2 = (path) => {
37002
37142
  try {
37003
- return realpathSync9(path);
37143
+ return realpathSync10(path);
37004
37144
  } catch {
37005
37145
  return path;
37006
37146
  }
37007
- }, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) && resolve65(path).startsWith(resolve65(root)), resolveImport = (specifier, fromFile) => {
37147
+ }, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) && resolve66(path).startsWith(resolve66(root)), resolveImport = (specifier, fromFile) => {
37008
37148
  try {
37009
37149
  return realPath2(Bun.resolveSync(specifier, dirname44(fromFile)));
37010
37150
  } catch {
@@ -37029,14 +37169,14 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
37029
37169
  fileCache.set(path, { imports, mtimeMs });
37030
37170
  return imports;
37031
37171
  }, importersOf = (target, entry, loaded = loadedProjectModules(entry)) => {
37032
- const goal = realPath2(resolve65(target));
37172
+ const goal = realPath2(resolve66(target));
37033
37173
  const importers = [];
37034
37174
  for (const file of loaded)
37035
37175
  if (readImports(file).includes(goal))
37036
37176
  importers.push(file);
37037
37177
  return importers;
37038
37178
  }, loadedProjectModules = (entry, loaded = Object.keys(__require.cache), root = process.cwd()) => {
37039
- const entryPath = realPath2(resolve65(entry));
37179
+ const entryPath = realPath2(resolve66(entry));
37040
37180
  const modules = new Set([entryPath]);
37041
37181
  for (const path of loaded) {
37042
37182
  if (isAbsoluteServerEntryCopyPath(path))
@@ -37903,11 +38043,11 @@ var init_runtime = __esm(() => {
37903
38043
  });
37904
38044
 
37905
38045
  // src/dev/hot/plugin.ts
37906
- import { mkdirSync as mkdirSync21, readFileSync as readFileSync55, realpathSync as realpathSync10, writeFileSync as writeFileSync17 } from "fs";
37907
- import { extname as extname23, join as join75, relative as relative33, resolve as resolve66, sep as sep14 } from "path";
38046
+ import { mkdirSync as mkdirSync21, readFileSync as readFileSync55, realpathSync as realpathSync11, writeFileSync as writeFileSync17 } from "fs";
38047
+ import { extname as extname23, join as join75, relative as relative33, resolve as resolve67, sep as sep14 } from "path";
37908
38048
  var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
37909
38049
  try {
37910
- return realpathSync10(path);
38050
+ return realpathSync11(path);
37911
38051
  } catch {
37912
38052
  return path;
37913
38053
  }
@@ -37983,7 +38123,7 @@ var init_plugin = __esm(() => {
37983
38123
  SOURCE = /\.(?:[cm]?[jt]sx?)$/;
37984
38124
  TEST_FILE = /(?:\.(?:spec|test)\.[cm]?[jt]sx?$)|(?:[\\/]__tests__[\\/])/;
37985
38125
  GENERATED = /(?:^|[\\/])(?:build|generated|compiled|indexes|\.absolutejs|node_modules|dist)(?:[\\/]|$)/;
37986
- ABSOLUTE_ROOT = resolve66(import.meta.dir, "..", "..", "..");
38126
+ ABSOLUTE_ROOT = resolve67(import.meta.dir, "..", "..", "..");
37987
38127
  shared = globalThis.__absoluteHotPlugin ??= {
37988
38128
  analyses: new Map,
37989
38129
  installed: undefined
@@ -37992,11 +38132,11 @@ var init_plugin = __esm(() => {
37992
38132
  });
37993
38133
 
37994
38134
  // src/dev/hot/reload.ts
37995
- import { readFileSync as readFileSync56, realpathSync as realpathSync11 } from "fs";
38135
+ import { readFileSync as readFileSync56, realpathSync as realpathSync12 } from "fs";
37996
38136
  import { relative as relative34 } from "path";
37997
38137
  var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
37998
38138
  try {
37999
- return realpathSync11(path);
38139
+ return realpathSync12(path);
38000
38140
  } catch {
38001
38141
  return path;
38002
38142
  }
@@ -38185,7 +38325,7 @@ var init_reload = __esm(() => {
38185
38325
  // src/dev/rebuildTrigger.ts
38186
38326
  import { existsSync as existsSync58, readdirSync as readdirSync14, rmSync as rmSync4, statSync as statSync15 } from "fs";
38187
38327
  import {
38188
- basename as basename23,
38328
+ basename as basename24,
38189
38329
  dirname as dirname46,
38190
38330
  isAbsolute as isAbsolute13,
38191
38331
  join as join76,
@@ -38733,7 +38873,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
38733
38873
  if (serverDirs.length <= 1) {
38734
38874
  const dir = getFrameworkGeneratedDir(framework, projectRoot);
38735
38875
  return {
38736
- serverOutDir: resolvePath4(resolvedPaths.buildDir, basename23(dir)),
38876
+ serverOutDir: resolvePath4(resolvedPaths.buildDir, basename24(dir)),
38737
38877
  serverRoot: resolvePath4(dir, "server")
38738
38878
  };
38739
38879
  }
@@ -38742,7 +38882,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
38742
38882
  serverRoot: commonAncestor(serverDirs.map((entry) => entry.dir), projectRoot)
38743
38883
  };
38744
38884
  }, updateServerManifestEntry = (state, artifact) => {
38745
- const fileWithHash = basename23(artifact.path);
38885
+ const fileWithHash = basename24(artifact.path);
38746
38886
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
38747
38887
  if (!baseName) {
38748
38888
  return;
@@ -38757,7 +38897,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
38757
38897
  const prefixByDir = new Map;
38758
38898
  for (const artifact of freshOutputs) {
38759
38899
  const dir = dirname46(artifact.path);
38760
- const name = basename23(artifact.path);
38900
+ const name = basename24(artifact.path);
38761
38901
  const [prefix] = name.split(".");
38762
38902
  if (!prefix)
38763
38903
  continue;
@@ -39275,7 +39415,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
39275
39415
  await rewriteImports2(ssrPaths, angServerVendorPaths);
39276
39416
  }
39277
39417
  serverPaths.forEach((serverPath, idx) => {
39278
- const fileBase = basename23(serverPath, ".js");
39418
+ const fileBase = basename24(serverPath, ".js");
39279
39419
  const ssrPath = ssrPaths[idx] ?? serverPath;
39280
39420
  state.manifest[toPascal(fileBase)] = resolvePath4(ssrPath);
39281
39421
  });
@@ -39394,7 +39534,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
39394
39534
  }, resolveAffectedPageModules = async (reactFiles) => {
39395
39535
  const pages = reactFiles.filter((file) => isReactPagePath(file) && isReactComponentPath(file) && isImportableModule(file));
39396
39536
  const entries = await Promise.all(pages.map(async (page) => [
39397
- `${basename23(page).replace(/\.[jt]sx$/, "")}Index`,
39537
+ `${basename24(page).replace(/\.[jt]sx$/, "")}Index`,
39398
39538
  await getReactModuleUrl(page)
39399
39539
  ]));
39400
39540
  return Object.fromEntries(entries);
@@ -39528,7 +39668,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
39528
39668
  for (const artifact of cssResult.outputs) {
39529
39669
  if (!artifact.path.endsWith(".css"))
39530
39670
  continue;
39531
- const cssName = stripArtifactHash(basename23(artifact.path), artifact.hash);
39671
+ const cssName = stripArtifactHash(basename24(artifact.path), artifact.hash);
39532
39672
  if (cssName)
39533
39673
  cssByName.set(cssName, artifact.path);
39534
39674
  }
@@ -39538,7 +39678,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
39538
39678
  await Promise.all(serverResult.outputs.map(async (artifact) => {
39539
39679
  if (!artifact.path.endsWith(".js"))
39540
39680
  return;
39541
- const pascalName = stripArtifactHash(basename23(artifact.path), artifact.hash);
39681
+ const pascalName = stripArtifactHash(basename24(artifact.path), artifact.hash);
39542
39682
  if (!pascalName)
39543
39683
  return;
39544
39684
  const cssBundlePath = cssByName.get(`${toKebab(pascalName)}-compiled`);
@@ -39811,7 +39951,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
39811
39951
  const duration = Date.now() - startTime;
39812
39952
  const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
39813
39953
  broadcastFiles.forEach((sveltePagePath) => {
39814
- const fileName = basename23(sveltePagePath);
39954
+ const fileName = basename24(sveltePagePath);
39815
39955
  const baseName = fileName.replace(/\.svelte$/, "");
39816
39956
  const pascalName = toPascal(baseName);
39817
39957
  const cssKey = `${pascalName}CSS`;
@@ -39894,7 +40034,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
39894
40034
  } = await compileVue(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
39895
40035
  const serverEntries = [...vueServerPaths];
39896
40036
  const clientEntries = [...vueIndexPaths, ...vueClientPaths];
39897
- const cssOutDir = join76(buildDir, state.resolvedPaths.assetsDir ? basename23(state.resolvedPaths.assetsDir) : "assets", "css");
40037
+ const cssOutDir = join76(buildDir, state.resolvedPaths.assetsDir ? basename24(state.resolvedPaths.assetsDir) : "assets", "css");
39898
40038
  const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
39899
40039
  const serverExternals = await getServerBundleExternals();
39900
40040
  const serverExternalsPlugins = await getServerBundleExternalsPlugins(state.config);
@@ -40071,7 +40211,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40071
40211
  await Promise.resolve().then(() => init_compileEmber());
40072
40212
  const { serverPaths } = await compileEmber(allPageEntries, emberDir, process.cwd(), true);
40073
40213
  for (const serverPath of serverPaths) {
40074
- const fileBase = basename23(serverPath, ".js");
40214
+ const fileBase = basename24(serverPath, ".js");
40075
40215
  state.manifest[toPascal(fileBase)] = resolvePath4(serverPath);
40076
40216
  }
40077
40217
  await Promise.resolve().then(() => init_ember());
@@ -40150,7 +40290,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40150
40290
  });
40151
40291
  }
40152
40292
  }, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
40153
- const scriptBaseName = basename23(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
40293
+ const scriptBaseName = basename24(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
40154
40294
  const pascalName = toPascal(scriptBaseName);
40155
40295
  const scriptPath = manifest[pascalName] || null;
40156
40296
  if (!scriptPath) {
@@ -40251,7 +40391,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40251
40391
  const changedIslands = await collectChangedIslands(config, filesToRebuild);
40252
40392
  const islands = changedIslands.flatMap(({ component, framework }) => {
40253
40393
  const modulePath = manifest[getIslandManifestKey(framework, component)];
40254
- return modulePath ? [{ component, framework, modulePath }] : [];
40394
+ const stylePath = manifest[getIslandStyleManifestKey(framework, component)];
40395
+ return modulePath ? [{ component, framework, modulePath, stylePath }] : [];
40255
40396
  });
40256
40397
  if (islands.length === 0)
40257
40398
  return true;
@@ -40296,7 +40437,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40296
40437
  if (isSingle) {
40297
40438
  return resolvePath4(state.resolvedPaths.buildDir, "pages");
40298
40439
  }
40299
- const dirName = framework === "html" ? basename23(config.htmlDirectory ?? "html") : basename23(config.htmxDirectory ?? "htmx");
40440
+ const dirName = framework === "html" ? basename24(config.htmlDirectory ?? "html") : basename24(config.htmxDirectory ?? "htmx");
40300
40441
  return resolvePath4(state.resolvedPaths.buildDir, dirName, "pages");
40301
40442
  }, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
40302
40443
  try {
@@ -40337,7 +40478,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40337
40478
  const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
40338
40479
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
40339
40480
  await runSequentially(pageFilesToUpdate, async (pageFile) => {
40340
- const htmlPageName = basename23(pageFile);
40481
+ const htmlPageName = basename24(pageFile);
40341
40482
  const builtHtmlPagePath = resolvePath4(outputHtmlPages, htmlPageName);
40342
40483
  await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
40343
40484
  });
@@ -40346,7 +40487,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40346
40487
  if (!cssFile) {
40347
40488
  return;
40348
40489
  }
40349
- const cssBaseName = basename23(getStyleBaseName(cssFile));
40490
+ const cssBaseName = basename24(getStyleBaseName(cssFile));
40350
40491
  const cssPascalName = toPascal(cssBaseName);
40351
40492
  const cssKey = `${cssPascalName}CSS`;
40352
40493
  const cssUrl = manifest[cssKey] || null;
@@ -40398,7 +40539,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40398
40539
  type: "vue-update"
40399
40540
  });
40400
40541
  }, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
40401
- const fileName = basename23(vuePagePath);
40542
+ const fileName = basename24(vuePagePath);
40402
40543
  const baseName = fileName.replace(/\.vue$/, "");
40403
40544
  const pascalName = toPascal(baseName);
40404
40545
  const vueRoot = config.vueDirectory;
@@ -40445,7 +40586,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40445
40586
  if (!cssFile) {
40446
40587
  return;
40447
40588
  }
40448
- const cssBaseName = basename23(getStyleBaseName(cssFile));
40589
+ const cssBaseName = basename24(getStyleBaseName(cssFile));
40449
40590
  const cssPascalName = toPascal(cssBaseName);
40450
40591
  const cssKey = `${cssPascalName}CSS`;
40451
40592
  const cssUrl = manifest[cssKey] || null;
@@ -40464,7 +40605,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40464
40605
  });
40465
40606
  }, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
40466
40607
  try {
40467
- const fileName = basename23(sveltePagePath);
40608
+ const fileName = basename24(sveltePagePath);
40468
40609
  const baseName = fileName.replace(/\.svelte$/, "");
40469
40610
  const pascalName = toPascal(baseName);
40470
40611
  const cssKey = `${pascalName}CSS`;
@@ -40515,7 +40656,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40515
40656
  if (!cssFile) {
40516
40657
  return;
40517
40658
  }
40518
- const cssBaseName = basename23(getStyleBaseName(cssFile));
40659
+ const cssBaseName = basename24(getStyleBaseName(cssFile));
40519
40660
  const cssPascalName = toPascal(cssBaseName);
40520
40661
  const cssKey = `${cssPascalName}CSS`;
40521
40662
  const cssUrl = manifest[cssKey] || null;
@@ -40598,7 +40739,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40598
40739
  const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
40599
40740
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
40600
40741
  await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
40601
- const htmxPageName = basename23(htmxPageFile);
40742
+ const htmxPageName = basename24(htmxPageFile);
40602
40743
  const builtHtmxPagePath = resolvePath4(outputHtmxPages, htmxPageName);
40603
40744
  await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
40604
40745
  });
@@ -40710,7 +40851,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40710
40851
  html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
40711
40852
  writeFs(destPath, html);
40712
40853
  }, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths, handleUpdate, readFs, writeFs) => {
40713
- const destPath = resolvePath4(outputDir, basename23(sourceFile));
40854
+ const destPath = resolvePath4(outputDir, basename24(sourceFile));
40714
40855
  const hmrScript = extractHmrScript(destPath, readFs);
40715
40856
  const source = await Bun.file(sourceFile).text();
40716
40857
  await Bun.write(destPath, source);
@@ -40796,9 +40937,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
40796
40937
  await fastPath.handler(state, config, files, startTime, onRebuildComplete);
40797
40938
  markHandledFiles(files, fastPath.framework, state.resolvedPaths, handled);
40798
40939
  });
40799
- const configPath = resolvePath4(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
40800
- if (affectedFrameworks.includes("angular") && files.includes(configPath) && !state.lastUserEditedFiles?.has(configPath)) {
40801
- handled.add(configPath);
40940
+ for (const file of files) {
40941
+ if (!handled.has(file) && detectFramework(file, state.resolvedPaths) === "unknown" && !state.lastUserEditedFiles?.has(resolvePath4(file)))
40942
+ handled.add(file);
40802
40943
  }
40803
40944
  return files.every((f) => handled.has(f));
40804
40945
  }, keepReactIndexesOnModuleServer = async (state, manifest) => {
@@ -41425,7 +41566,7 @@ import {
41425
41566
  readFileSync as readFileSync57
41426
41567
  } from "fs";
41427
41568
  import { mkdir as mkdir18, readFile as readFile13, rename as rename8, rm as rm20, writeFile as writeFile17 } from "fs/promises";
41428
- import { basename as basename24, join as join78, resolve as resolve67 } from "path";
41569
+ import { basename as basename25, join as join78, resolve as resolve68 } from "path";
41429
41570
  var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
41430
41571
  const hash = createHash13("sha256");
41431
41572
  hash.update(String(CACHE_FORMAT_VERSION3));
@@ -41445,7 +41586,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
41445
41586
  }
41446
41587
  for (const dir of inputs.vendorDirs) {
41447
41588
  hash.update("\x00v");
41448
- hash.update(basename24(resolve67(dir, "..")));
41589
+ hash.update(basename25(resolve68(dir, "..")));
41449
41590
  }
41450
41591
  return hash.digest("hex").slice(0, KEY_LENGTH);
41451
41592
  }, readLockfileHash = (projectRoot = process.cwd()) => {
@@ -41484,7 +41625,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
41484
41625
  continue;
41485
41626
  copyTree(dir, join78(stagingDir, slotName(index, dir)));
41486
41627
  }
41487
- }, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve67(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename24(resolve67(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
41628
+ }, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve68(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename25(resolve68(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
41488
41629
  const cacheDir = cacheDirFor(key, projectRoot);
41489
41630
  const payloadPath = join78(cacheDir, "payload.json");
41490
41631
  if (!existsSync59(payloadPath))
@@ -41530,7 +41671,7 @@ var init_vendorCache = __esm(() => {
41530
41671
  // src/core/devBuild.ts
41531
41672
  import { readdir as readdir7 } from "fs/promises";
41532
41673
  import { existsSync as existsSync60, statSync as statSync16 } from "fs";
41533
- import { resolve as resolve68 } from "path";
41674
+ import { resolve as resolve69 } from "path";
41534
41675
  var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (config) => {
41535
41676
  const configuredDirs = [
41536
41677
  ...collectConfigVendorSourceDirs(config),
@@ -41554,7 +41695,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
41554
41695
  return Object.keys(config).length > 0 ? config : null;
41555
41696
  }, reloadConfig = async () => {
41556
41697
  try {
41557
- const configPath = resolve68(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
41698
+ const configPath = resolve69(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
41558
41699
  const source = await Bun.file(configPath).text();
41559
41700
  return parseDirectoryConfig(source);
41560
41701
  } catch {
@@ -41669,7 +41810,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
41669
41810
  });
41670
41811
  }
41671
41812
  }, handleCachedReload = async () => {
41672
- const serverMtime = statSync16(resolve68(Bun.main)).mtimeMs;
41813
+ const serverMtime = statSync16(resolve69(Bun.main)).mtimeMs;
41673
41814
  const lastMtime = globalThis.__hmrServerMtime;
41674
41815
  globalThis.__hmrServerMtime = serverMtime;
41675
41816
  const cached = globalThis.__hmrDevResult;
@@ -41710,8 +41851,8 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
41710
41851
  return true;
41711
41852
  }, resolveAbsoluteVersion2 = async () => {
41712
41853
  const candidates = [
41713
- resolve68(import.meta.dir, "..", "..", "package.json"),
41714
- resolve68(import.meta.dir, "..", "package.json")
41854
+ resolve69(import.meta.dir, "..", "..", "package.json"),
41855
+ resolve69(import.meta.dir, "..", "package.json")
41715
41856
  ];
41716
41857
  const [candidate, ...remaining] = candidates;
41717
41858
  if (!candidate) {
@@ -41737,7 +41878,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
41737
41878
  const entries = await readdir7(vendorDir).catch(() => emptyStringArray);
41738
41879
  await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
41739
41880
  const webPath = `/${framework}/vendor/${entry}`;
41740
- const bytes = await Bun.file(resolve68(vendorDir, entry)).bytes();
41881
+ const bytes = await Bun.file(resolve69(vendorDir, entry)).bytes();
41741
41882
  assetStore.set(webPath, bytes);
41742
41883
  }));
41743
41884
  }, devBuild = async (config) => {
@@ -41929,11 +42070,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
41929
42070
  }
41930
42071
  stepStartedAt = performance.now();
41931
42072
  setBootPhase("build vendor bundles");
41932
- const reactVendorDir = resolve68(state.resolvedPaths.buildDir, "react", "vendor");
41933
- const angularVendorDir = resolve68(state.resolvedPaths.buildDir, "angular", "vendor");
41934
- const svelteVendorDir = resolve68(state.resolvedPaths.buildDir, "svelte", "vendor");
41935
- const vueVendorDir = resolve68(state.resolvedPaths.buildDir, "vue", "vendor");
41936
- const depVendorDir = resolve68(state.resolvedPaths.buildDir, "vendor");
42073
+ const reactVendorDir = resolve69(state.resolvedPaths.buildDir, "react", "vendor");
42074
+ const angularVendorDir = resolve69(state.resolvedPaths.buildDir, "angular", "vendor");
42075
+ const svelteVendorDir = resolve69(state.resolvedPaths.buildDir, "svelte", "vendor");
42076
+ const vueVendorDir = resolve69(state.resolvedPaths.buildDir, "vue", "vendor");
42077
+ const depVendorDir = resolve69(state.resolvedPaths.buildDir, "vendor");
41937
42078
  await Promise.resolve().then(() => init_buildDepVendor());
41938
42079
  const activeVendorDirs = [
41939
42080
  reactVendorEnabled ? reactVendorDir : null,
@@ -42050,7 +42191,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
42050
42191
  manifest
42051
42192
  };
42052
42193
  globalThis.__hmrDevResult = result;
42053
- globalThis.__hmrServerMtime = statSync16(resolve68(Bun.main)).mtimeMs;
42194
+ globalThis.__hmrServerMtime = statSync16(resolve69(Bun.main)).mtimeMs;
42054
42195
  return result;
42055
42196
  };
42056
42197
  var init_devBuild = __esm(() => {
@@ -42096,5 +42237,5 @@ export {
42096
42237
  devBuild
42097
42238
  };
42098
42239
 
42099
- //# debugId=2C9457EC4704C29664756E2164756E21
42240
+ //# debugId=6F7474A77E6F0F0D64756E2164756E21
42100
42241
  //# sourceMappingURL=build.js.map