@absolutejs/absolute 0.19.0-beta.809 → 0.19.0-beta.810

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6847,13 +6847,11 @@ var ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER = "x-skip-transfer-cache", buildAbs
6847
6847
  };
6848
6848
 
6849
6849
  // src/angular/requestProviders.ts
6850
- import { REQUEST, REQUEST_CONTEXT, RESPONSE_INIT } from "@angular/core";
6851
6850
  var buildRequestProviders = (deps, request, requestContext, responseInit) => [
6852
6851
  { provide: deps.REQUEST, useValue: request ?? null },
6853
6852
  { provide: deps.REQUEST_CONTEXT, useValue: requestContext ?? null },
6854
6853
  { provide: deps.RESPONSE_INIT, useValue: responseInit ?? null }
6855
6854
  ];
6856
- var init_requestProviders = () => {};
6857
6855
 
6858
6856
  // src/angular/ssrRender.ts
6859
6857
  var routePropsCache, cacheRouteData = (pagePath, data) => {
@@ -6939,7 +6937,6 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
6939
6937
  };
6940
6938
  var init_ssrRender = __esm(() => {
6941
6939
  init_registerClientScript();
6942
- init_requestProviders();
6943
6940
  routePropsCache = new Map;
6944
6941
  selectorCache = new Map;
6945
6942
  });
@@ -9844,6 +9841,53 @@ var commonAncestor = (paths, fallback) => {
9844
9841
  };
9845
9842
  var init_commonAncestor = () => {};
9846
9843
 
9844
+ // src/utils/buildDirectoryLock.ts
9845
+ import { mkdir as mkdir3, rm as rm4, stat as stat2, writeFile as writeFile4 } from "fs/promises";
9846
+ import { dirname as dirname10, join as join14 } from "path";
9847
+ var DEFAULT_LOCK_TIMEOUT_MS = 120000, DEFAULT_STALE_LOCK_MS, LOCK_POLL_MS = 250, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join14(dirname10(buildDirectory), `.${buildDirectory.split(/[\\/]/).pop()}.lock`), acquireBuildDirectoryLock = async (buildDirectory, options = {}) => {
9848
+ const lockPath = lockPathForBuildDirectory(buildDirectory);
9849
+ const staleLockMs = options.staleLockMs ?? DEFAULT_STALE_LOCK_MS;
9850
+ const timeoutMs = options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS;
9851
+ const start = Date.now();
9852
+ while (true) {
9853
+ try {
9854
+ await mkdir3(lockPath);
9855
+ await writeFile4(join14(lockPath, "owner"), JSON.stringify({
9856
+ buildDirectory,
9857
+ createdAt: new Date().toISOString(),
9858
+ pid: process.pid
9859
+ }, null, 2));
9860
+ return async () => {
9861
+ await rm4(lockPath, { force: true, recursive: true }).catch(() => {});
9862
+ };
9863
+ } catch (error) {
9864
+ if (!isAlreadyExistsError(error))
9865
+ throw error;
9866
+ try {
9867
+ const lockStat = await stat2(lockPath);
9868
+ if (Date.now() - lockStat.mtimeMs > staleLockMs) {
9869
+ await rm4(lockPath, { force: true, recursive: true });
9870
+ continue;
9871
+ }
9872
+ } catch {}
9873
+ if (Date.now() - start > timeoutMs) {
9874
+ throw new Error(`Timed out waiting for AbsoluteJS build directory lock: ${buildDirectory}`);
9875
+ }
9876
+ await Bun.sleep(LOCK_POLL_MS);
9877
+ }
9878
+ }
9879
+ }, withBuildDirectoryLock = async (buildDirectory, action) => {
9880
+ const release = await acquireBuildDirectoryLock(buildDirectory);
9881
+ try {
9882
+ return await action();
9883
+ } finally {
9884
+ await release();
9885
+ }
9886
+ };
9887
+ var init_buildDirectoryLock = __esm(() => {
9888
+ DEFAULT_STALE_LOCK_MS = 10 * 60000;
9889
+ });
9890
+
9847
9891
  // src/utils/validateSafePath.ts
9848
9892
  import { resolve as resolve16, relative as relative6 } from "path";
9849
9893
  var validateSafePath = (targetPath, baseDirectory) => {
@@ -9920,10 +9964,10 @@ __export(exports_compileSvelte, {
9920
9964
  clearSvelteCompilerCache: () => clearSvelteCompilerCache
9921
9965
  });
9922
9966
  import { existsSync as existsSync15 } from "fs";
9923
- import { mkdir as mkdir3, stat as stat2 } from "fs/promises";
9967
+ import { mkdir as mkdir4, stat as stat3 } from "fs/promises";
9924
9968
  import {
9925
- dirname as dirname10,
9926
- join as join14,
9969
+ dirname as dirname11,
9970
+ join as join15,
9927
9971
  basename as basename5,
9928
9972
  extname as extname5,
9929
9973
  resolve as resolve17,
@@ -9963,7 +10007,7 @@ var resolveDevClientDir2 = () => {
9963
10007
  return /\b__require\b/.test(stripped) ? code : stripped;
9964
10008
  }, exists = async (path) => {
9965
10009
  try {
9966
- await stat2(path);
10010
+ await stat3(path);
9967
10011
  return true;
9968
10012
  } catch {
9969
10013
  return false;
@@ -9971,7 +10015,7 @@ var resolveDevClientDir2 = () => {
9971
10015
  }, resolveRelativeModule2 = async (spec, from) => {
9972
10016
  if (!spec.startsWith("."))
9973
10017
  return null;
9974
- const basePath = resolve17(dirname10(from), spec);
10018
+ const basePath = resolve17(dirname11(from), spec);
9975
10019
  const candidates = [
9976
10020
  basePath,
9977
10021
  `${basePath}.ts`,
@@ -9982,14 +10026,14 @@ var resolveDevClientDir2 = () => {
9982
10026
  `${basePath}.svelte`,
9983
10027
  `${basePath}.svelte.ts`,
9984
10028
  `${basePath}.svelte.js`,
9985
- join14(basePath, "index.ts"),
9986
- join14(basePath, "index.js"),
9987
- join14(basePath, "index.mjs"),
9988
- join14(basePath, "index.cjs"),
9989
- join14(basePath, "index.json"),
9990
- join14(basePath, "index.svelte"),
9991
- join14(basePath, "index.svelte.ts"),
9992
- join14(basePath, "index.svelte.js")
10029
+ join15(basePath, "index.ts"),
10030
+ join15(basePath, "index.js"),
10031
+ join15(basePath, "index.mjs"),
10032
+ join15(basePath, "index.cjs"),
10033
+ join15(basePath, "index.json"),
10034
+ join15(basePath, "index.svelte"),
10035
+ join15(basePath, "index.svelte.ts"),
10036
+ join15(basePath, "index.svelte.js")
9993
10037
  ];
9994
10038
  const checks = await Promise.all(candidates.map(exists));
9995
10039
  return candidates.find((_2, index) => checks[index]) ?? null;
@@ -9998,7 +10042,7 @@ var resolveDevClientDir2 = () => {
9998
10042
  const resolved = resolvePackageImport(spec);
9999
10043
  return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
10000
10044
  }
10001
- const basePath = resolve17(dirname10(from), spec);
10045
+ const basePath = resolve17(dirname11(from), spec);
10002
10046
  const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
10003
10047
  if (!explicit) {
10004
10048
  const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
@@ -10027,11 +10071,11 @@ var resolveDevClientDir2 = () => {
10027
10071
  });
10028
10072
  }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
10029
10073
  const { compile, compileModule, preprocess } = await import("svelte/compiler");
10030
- const generatedDir = join14(svelteRoot, "generated");
10031
- const clientDir = join14(generatedDir, "client");
10032
- const indexDir = join14(generatedDir, "indexes");
10033
- const serverDir = join14(generatedDir, "server");
10034
- await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir3(dir, { recursive: true })));
10074
+ const generatedDir = join15(svelteRoot, "generated");
10075
+ const clientDir = join15(generatedDir, "client");
10076
+ const indexDir = join15(generatedDir, "indexes");
10077
+ const serverDir = join15(generatedDir, "server");
10078
+ await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir4(dir, { recursive: true })));
10035
10079
  const dev = env2.NODE_ENV !== "production";
10036
10080
  const build2 = async (src) => {
10037
10081
  const memoized = cache.get(src);
@@ -10058,8 +10102,8 @@ var resolveDevClientDir2 = () => {
10058
10102
  const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
10059
10103
  const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedServer) : preprocessedServer;
10060
10104
  const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedClient) : preprocessedClient;
10061
- const rawRel = dirname10(relative7(svelteRoot, src)).replace(/\\/g, "/");
10062
- const relDir = rawRel.startsWith("..") ? `_ext/${relative7(process.cwd(), dirname10(src)).replace(/\\/g, "/")}` : rawRel;
10105
+ const rawRel = dirname11(relative7(svelteRoot, src)).replace(/\\/g, "/");
10106
+ const relDir = rawRel.startsWith("..") ? `_ext/${relative7(process.cwd(), dirname11(src)).replace(/\\/g, "/")}` : rawRel;
10063
10107
  const baseName = basename5(src).replace(/\.svelte(\.(ts|js))?$/, "");
10064
10108
  const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
10065
10109
  const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
@@ -10068,8 +10112,8 @@ var resolveDevClientDir2 = () => {
10068
10112
  const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
10069
10113
  const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
10070
10114
  const externalRewrites = new Map;
10071
- const ssrOutputDir = dirname10(join14(serverDir, relDir, `${baseName}.js`));
10072
- const clientOutputDir = dirname10(join14(clientDir, relDir, `${baseName}.js`));
10115
+ const ssrOutputDir = dirname11(join15(serverDir, relDir, `${baseName}.js`));
10116
+ const clientOutputDir = dirname11(join15(clientDir, relDir, `${baseName}.js`));
10073
10117
  for (let idx = 0;idx < importPaths.length; idx++) {
10074
10118
  const rawSpec = importPaths[idx];
10075
10119
  if (!rawSpec)
@@ -10134,11 +10178,11 @@ var resolveDevClientDir2 = () => {
10134
10178
  code += islandMetadataExports;
10135
10179
  return code;
10136
10180
  };
10137
- const ssrPath = join14(serverDir, relDir, `${baseName}.js`);
10138
- const clientPath = join14(clientDir, relDir, `${baseName}.js`);
10181
+ const ssrPath = join15(serverDir, relDir, `${baseName}.js`);
10182
+ const clientPath = join15(clientDir, relDir, `${baseName}.js`);
10139
10183
  await Promise.all([
10140
- mkdir3(dirname10(ssrPath), { recursive: true }),
10141
- mkdir3(dirname10(clientPath), { recursive: true })
10184
+ mkdir4(dirname11(ssrPath), { recursive: true }),
10185
+ mkdir4(dirname11(clientPath), { recursive: true })
10142
10186
  ]);
10143
10187
  if (isModule) {
10144
10188
  const bundle = rewriteExternalImports(generate("client"), "client");
@@ -10165,10 +10209,10 @@ var resolveDevClientDir2 = () => {
10165
10209
  };
10166
10210
  const roots = await Promise.all(entryPoints.map(build2));
10167
10211
  await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
10168
- const relClientDir = dirname10(relative7(clientDir, client2));
10212
+ const relClientDir = dirname11(relative7(clientDir, client2));
10169
10213
  const name = basename5(client2, extname5(client2));
10170
- const indexPath = join14(indexDir, relClientDir, `${name}.js`);
10171
- const importRaw = relative7(dirname10(indexPath), client2).split(sep2).join("/");
10214
+ const indexPath = join15(indexDir, relClientDir, `${name}.js`);
10215
+ const importRaw = relative7(dirname11(indexPath), client2).split(sep2).join("/");
10172
10216
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
10173
10217
  const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
10174
10218
  import "${hmrClientPath3}";
@@ -10239,14 +10283,14 @@ if (typeof window !== "undefined") {
10239
10283
  setTimeout(releaseStreamingSlots, 0);
10240
10284
  }
10241
10285
  }`;
10242
- await mkdir3(dirname10(indexPath), { recursive: true });
10286
+ await mkdir4(dirname11(indexPath), { recursive: true });
10243
10287
  return write(indexPath, bootstrap);
10244
10288
  }));
10245
10289
  return {
10246
10290
  svelteClientPaths: roots.map(({ client: client2 }) => client2),
10247
10291
  svelteIndexPaths: roots.map(({ client: client2 }) => {
10248
- const rel = dirname10(relative7(clientDir, client2));
10249
- return join14(indexDir, rel, basename5(client2));
10292
+ const rel = dirname11(relative7(clientDir, client2));
10293
+ return join15(indexDir, rel, basename5(client2));
10250
10294
  }),
10251
10295
  svelteServerPaths: roots.map(({ ssr }) => ssr)
10252
10296
  };
@@ -10260,7 +10304,7 @@ var init_compileSvelte = __esm(() => {
10260
10304
  init_lowerAwaitSlotSyntax();
10261
10305
  init_renderToReadableStream();
10262
10306
  devClientDir2 = resolveDevClientDir2();
10263
- hmrClientPath3 = join14(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
10307
+ hmrClientPath3 = join15(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
10264
10308
  persistentCache = new Map;
10265
10309
  sourceHashCache = new Map;
10266
10310
  transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
@@ -10276,12 +10320,12 @@ __export(exports_compileVue, {
10276
10320
  clearVueHmrCaches: () => clearVueHmrCaches
10277
10321
  });
10278
10322
  import { existsSync as existsSync16 } from "fs";
10279
- import { mkdir as mkdir4 } from "fs/promises";
10323
+ import { mkdir as mkdir5 } from "fs/promises";
10280
10324
  import {
10281
10325
  basename as basename6,
10282
- dirname as dirname11,
10326
+ dirname as dirname12,
10283
10327
  isAbsolute as isAbsolute3,
10284
- join as join15,
10328
+ join as join16,
10285
10329
  relative as relative8,
10286
10330
  resolve as resolve18
10287
10331
  } from "path";
@@ -10400,12 +10444,12 @@ var resolveDevClientDir3 = () => {
10400
10444
  const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
10401
10445
  const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
10402
10446
  const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
10403
- const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve18(dirname11(sourceFilePath), path));
10447
+ const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve18(dirname12(sourceFilePath), path));
10404
10448
  for (const stylePath of stylePathsImported) {
10405
10449
  addStyleImporter(sourceFilePath, stylePath);
10406
10450
  }
10407
10451
  const childBuildResults = await Promise.all([
10408
- ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve18(dirname11(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
10452
+ ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve18(dirname12(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
10409
10453
  ...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
10410
10454
  ]);
10411
10455
  const hasScript = descriptor.script || descriptor.scriptSetup;
@@ -10414,7 +10458,7 @@ var resolveDevClientDir3 = () => {
10414
10458
  inlineTemplate: false
10415
10459
  }) : { bindings: {}, content: "export default {};" };
10416
10460
  const strippedScript = stripExports(compiledScript.content);
10417
- const sourceDir = dirname11(sourceFilePath);
10461
+ const sourceDir = dirname12(sourceFilePath);
10418
10462
  const transpiledScript = transpiler3.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
10419
10463
  const packageImportRewrites = new Map;
10420
10464
  for (const [bareImport, absolutePath] of packageComponentPaths) {
@@ -10451,8 +10495,8 @@ var resolveDevClientDir3 = () => {
10451
10495
  ];
10452
10496
  let cssOutputPaths = [];
10453
10497
  if (isEntryPoint && allCss.length) {
10454
- const cssOutputFile = join15(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
10455
- await mkdir4(dirname11(cssOutputFile), { recursive: true });
10498
+ const cssOutputFile = join16(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
10499
+ await mkdir5(dirname12(cssOutputFile), { recursive: true });
10456
10500
  await write2(cssOutputFile, allCss.join(`
10457
10501
  `));
10458
10502
  cssOutputPaths = [cssOutputFile];
@@ -10482,9 +10526,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10482
10526
  };
10483
10527
  const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
10484
10528
  const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
10485
- const clientOutputPath = join15(outputDirs.client, `${relativeWithoutExtension}.js`);
10486
- const serverOutputPath = join15(outputDirs.server, `${relativeWithoutExtension}.js`);
10487
- const relDir = dirname11(relativeFilePath);
10529
+ const clientOutputPath = join16(outputDirs.client, `${relativeWithoutExtension}.js`);
10530
+ const serverOutputPath = join16(outputDirs.server, `${relativeWithoutExtension}.js`);
10531
+ const relDir = dirname12(relativeFilePath);
10488
10532
  const relDepth = relDir === "." ? 0 : relDir.split("/").length;
10489
10533
  const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
10490
10534
  const upCount = dots.split("/").length - 1;
@@ -10496,15 +10540,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10496
10540
  let result2 = code;
10497
10541
  for (const [bareImport, paths] of packageImportRewrites) {
10498
10542
  const targetPath = mode === "server" ? paths.server : paths.client;
10499
- let rel = relative8(dirname11(outputPath), targetPath).replace(/\\/g, "/");
10543
+ let rel = relative8(dirname12(outputPath), targetPath).replace(/\\/g, "/");
10500
10544
  if (!rel.startsWith("."))
10501
10545
  rel = `./${rel}`;
10502
10546
  result2 = result2.replaceAll(bareImport, rel);
10503
10547
  }
10504
10548
  return result2;
10505
10549
  };
10506
- await mkdir4(dirname11(clientOutputPath), { recursive: true });
10507
- await mkdir4(dirname11(serverOutputPath), { recursive: true });
10550
+ await mkdir5(dirname12(clientOutputPath), { recursive: true });
10551
+ await mkdir5(dirname12(serverOutputPath), { recursive: true });
10508
10552
  await write2(clientOutputPath, rewritePackageImports(adjustImports(clientCode), clientOutputPath, "client"));
10509
10553
  await write2(serverOutputPath, rewritePackageImports(adjustImports(serverCode), serverOutputPath, "server"));
10510
10554
  const result = {
@@ -10514,7 +10558,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10514
10558
  hmrId,
10515
10559
  serverPath: serverOutputPath,
10516
10560
  tsHelperPaths: [
10517
- ...helperModulePaths.map((helper) => resolve18(dirname11(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
10561
+ ...helperModulePaths.map((helper) => resolve18(dirname12(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
10518
10562
  ...childBuildResults.flatMap((child) => child.tsHelperPaths)
10519
10563
  ]
10520
10564
  };
@@ -10523,16 +10567,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10523
10567
  return result;
10524
10568
  }, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors) => {
10525
10569
  const compiler = await import("@vue/compiler-sfc");
10526
- const generatedDir = join15(vueRootDir, "generated");
10527
- const clientOutputDir = join15(generatedDir, "client");
10528
- const indexOutputDir = join15(generatedDir, "indexes");
10529
- const serverOutputDir = join15(generatedDir, "server");
10530
- const cssOutputDir = join15(generatedDir, "compiled");
10570
+ const generatedDir = join16(vueRootDir, "generated");
10571
+ const clientOutputDir = join16(generatedDir, "client");
10572
+ const indexOutputDir = join16(generatedDir, "indexes");
10573
+ const serverOutputDir = join16(generatedDir, "server");
10574
+ const cssOutputDir = join16(generatedDir, "compiled");
10531
10575
  await Promise.all([
10532
- mkdir4(clientOutputDir, { recursive: true }),
10533
- mkdir4(indexOutputDir, { recursive: true }),
10534
- mkdir4(serverOutputDir, { recursive: true }),
10535
- mkdir4(cssOutputDir, { recursive: true })
10576
+ mkdir5(clientOutputDir, { recursive: true }),
10577
+ mkdir5(indexOutputDir, { recursive: true }),
10578
+ mkdir5(serverOutputDir, { recursive: true }),
10579
+ mkdir5(cssOutputDir, { recursive: true })
10536
10580
  ]);
10537
10581
  const buildCache = new Map;
10538
10582
  const allTsHelperPaths = new Set;
@@ -10544,16 +10588,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10544
10588
  }, buildCache, true, vueRootDir, compiler, stylePreprocessors);
10545
10589
  result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
10546
10590
  const entryBaseName = basename6(entryPath, ".vue");
10547
- const indexOutputFile = join15(indexOutputDir, `${entryBaseName}.js`);
10548
- const clientOutputFile = join15(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
10549
- await mkdir4(dirname11(indexOutputFile), { recursive: true });
10591
+ const indexOutputFile = join16(indexOutputDir, `${entryBaseName}.js`);
10592
+ const clientOutputFile = join16(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
10593
+ await mkdir5(dirname12(indexOutputFile), { recursive: true });
10550
10594
  const vueHmrImports = isDev2 ? [
10551
10595
  `window.__HMR_FRAMEWORK__ = "vue";`,
10552
10596
  `import "${hmrClientPath4}";`
10553
10597
  ] : [];
10554
10598
  await write2(indexOutputFile, [
10555
10599
  ...vueHmrImports,
10556
- `import Comp from "${relative8(dirname11(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
10600
+ `import Comp from "${relative8(dirname12(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
10557
10601
  'import { createSSRApp, createApp } from "vue";',
10558
10602
  "",
10559
10603
  "// HMR State Preservation: Check for preserved state from HMR",
@@ -10674,10 +10718,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10674
10718
  const sourceCode = await file3(tsPath).text();
10675
10719
  const transpiledCode = transpiler3.transformSync(sourceCode);
10676
10720
  const relativeJsPath = relative8(vueRootDir, tsPath).replace(/\.ts$/, ".js");
10677
- const outClientPath = join15(clientOutputDir, relativeJsPath);
10678
- const outServerPath = join15(serverOutputDir, relativeJsPath);
10679
- await mkdir4(dirname11(outClientPath), { recursive: true });
10680
- await mkdir4(dirname11(outServerPath), { recursive: true });
10721
+ const outClientPath = join16(clientOutputDir, relativeJsPath);
10722
+ const outServerPath = join16(serverOutputDir, relativeJsPath);
10723
+ await mkdir5(dirname12(outClientPath), { recursive: true });
10724
+ await mkdir5(dirname12(outServerPath), { recursive: true });
10681
10725
  await write2(outClientPath, transpiledCode);
10682
10726
  await write2(outServerPath, transpiledCode);
10683
10727
  }));
@@ -10695,7 +10739,7 @@ var init_compileVue = __esm(() => {
10695
10739
  init_sourceMetadata();
10696
10740
  init_stylePreprocessor();
10697
10741
  devClientDir3 = resolveDevClientDir3();
10698
- hmrClientPath4 = join15(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
10742
+ hmrClientPath4 = join16(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
10699
10743
  transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
10700
10744
  scriptCache = new Map;
10701
10745
  scriptSetupCache = new Map;
@@ -11176,7 +11220,7 @@ __export(exports_compileAngular, {
11176
11220
  compileAngular: () => compileAngular
11177
11221
  });
11178
11222
  import { existsSync as existsSync17, readFileSync as readFileSync12, promises as fs } from "fs";
11179
- import { join as join16, basename as basename7, sep as sep3, dirname as dirname12, resolve as resolve19, relative as relative9 } from "path";
11223
+ import { join as join17, basename as basename7, sep as sep3, dirname as dirname13, resolve as resolve19, relative as relative9 } from "path";
11180
11224
  import ts2 from "typescript";
11181
11225
  var traceAngularPhase = async (name, fn2, metadata2) => {
11182
11226
  const tracePhase = globalThis.__absoluteBuildTracePhase;
@@ -11218,10 +11262,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
11218
11262
  `${candidate}.tsx`,
11219
11263
  `${candidate}.js`,
11220
11264
  `${candidate}.jsx`,
11221
- join16(candidate, "index.ts"),
11222
- join16(candidate, "index.tsx"),
11223
- join16(candidate, "index.js"),
11224
- join16(candidate, "index.jsx")
11265
+ join17(candidate, "index.ts"),
11266
+ join17(candidate, "index.tsx"),
11267
+ join17(candidate, "index.js"),
11268
+ join17(candidate, "index.jsx")
11225
11269
  ];
11226
11270
  return candidates.find((file4) => existsSync17(file4));
11227
11271
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
@@ -11293,7 +11337,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
11293
11337
  if (scan.usesLegacyAnimations)
11294
11338
  return true;
11295
11339
  for (const specifier of scan.imports) {
11296
- const importedPath = resolveLocalImport(specifier, dirname12(resolved));
11340
+ const importedPath = resolveLocalImport(specifier, dirname13(resolved));
11297
11341
  if (importedPath && await visit(importedPath, visited)) {
11298
11342
  return true;
11299
11343
  }
@@ -11358,7 +11402,7 @@ ${registrations}
11358
11402
  return specifier.replace(/\.ts$/, ".js");
11359
11403
  if (hasJsLikeExtension(specifier))
11360
11404
  return specifier;
11361
- const importerDir = dirname12(importerOutputPath);
11405
+ const importerDir = dirname13(importerOutputPath);
11362
11406
  const fileCandidate = resolve19(importerDir, `${specifier}.js`);
11363
11407
  if (outputFiles?.has(fileCandidate) || existsSync17(fileCandidate)) {
11364
11408
  return `${specifier}.js`;
@@ -11391,16 +11435,16 @@ ${registrations}
11391
11435
  }, resolveLocalTsImport = (fromFile, specifier) => {
11392
11436
  if (!isRelativeModuleSpecifier(specifier))
11393
11437
  return null;
11394
- const basePath = resolve19(dirname12(fromFile), specifier);
11438
+ const basePath = resolve19(dirname13(fromFile), specifier);
11395
11439
  const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
11396
11440
  `${basePath}.ts`,
11397
11441
  `${basePath}.tsx`,
11398
11442
  `${basePath}.mts`,
11399
11443
  `${basePath}.cts`,
11400
- join16(basePath, "index.ts"),
11401
- join16(basePath, "index.tsx"),
11402
- join16(basePath, "index.mts"),
11403
- join16(basePath, "index.cts")
11444
+ join17(basePath, "index.ts"),
11445
+ join17(basePath, "index.tsx"),
11446
+ join17(basePath, "index.mts"),
11447
+ join17(basePath, "index.cts")
11404
11448
  ];
11405
11449
  return candidates.map((candidate) => resolve19(candidate)).find((candidate) => existsSync17(candidate) && !candidate.endsWith(".d.ts")) ?? null;
11406
11450
  }, readFileForAotTransform = async (fileName, readFile5) => {
@@ -11426,15 +11470,15 @@ ${registrations}
11426
11470
  const paths = [];
11427
11471
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
11428
11472
  if (templateUrlMatch?.[1])
11429
- paths.push(join16(fileDir, templateUrlMatch[1]));
11473
+ paths.push(join17(fileDir, templateUrlMatch[1]));
11430
11474
  const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
11431
11475
  if (styleUrlMatch?.[1])
11432
- paths.push(join16(fileDir, styleUrlMatch[1]));
11476
+ paths.push(join17(fileDir, styleUrlMatch[1]));
11433
11477
  const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
11434
11478
  const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
11435
11479
  if (urlMatches) {
11436
11480
  for (const urlMatch of urlMatches) {
11437
- paths.push(join16(fileDir, urlMatch.replace(/['"]/g, "")));
11481
+ paths.push(join17(fileDir, urlMatch.replace(/['"]/g, "")));
11438
11482
  }
11439
11483
  }
11440
11484
  return paths.map((path) => resolve19(path));
@@ -11449,13 +11493,13 @@ ${registrations}
11449
11493
  return null;
11450
11494
  }
11451
11495
  }, writeResourceCacheFile = async (cachePath, source) => {
11452
- await fs.mkdir(dirname12(cachePath), { recursive: true });
11496
+ await fs.mkdir(dirname13(cachePath), { recursive: true });
11453
11497
  await fs.writeFile(cachePath, JSON.stringify({
11454
11498
  source,
11455
11499
  version: 1
11456
11500
  }), "utf-8");
11457
11501
  }, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
11458
- const resourcePaths = collectAngularResourcePaths(source, dirname12(filePath));
11502
+ const resourcePaths = collectAngularResourcePaths(source, dirname13(filePath));
11459
11503
  const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
11460
11504
  const content = await fs.readFile(resourcePath, "utf-8");
11461
11505
  return `${resourcePath}\x00${content}`;
@@ -11468,7 +11512,7 @@ ${registrations}
11468
11512
  safeStableStringify(stylePreprocessors ?? null)
11469
11513
  ].join("\x00");
11470
11514
  const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
11471
- return join16(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
11515
+ return join17(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
11472
11516
  }, precomputeAotResourceTransforms = async (inputPaths, readFile5, stylePreprocessors) => {
11473
11517
  const transformedSources = new Map;
11474
11518
  const visited = new Set;
@@ -11495,7 +11539,7 @@ ${registrations}
11495
11539
  transformedSource = cached.source;
11496
11540
  } else {
11497
11541
  stats.cacheMisses += 1;
11498
- const transformed = await inlineResources(source, dirname12(resolvedPath), stylePreprocessors);
11542
+ const transformed = await inlineResources(source, dirname13(resolvedPath), stylePreprocessors);
11499
11543
  transformedSource = transformed.source;
11500
11544
  await writeResourceCacheFile(cachePath, transformedSource);
11501
11545
  }
@@ -11514,7 +11558,7 @@ ${registrations}
11514
11558
  return { stats, transformedSources };
11515
11559
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
11516
11560
  const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
11517
- const outputPath = resolve19(join16(outDir, relative9(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
11561
+ const outputPath = resolve19(join17(outDir, relative9(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
11518
11562
  return [
11519
11563
  outputPath,
11520
11564
  buildIslandMetadataExports(readFileSync12(inputPath, "utf-8"))
@@ -11524,7 +11568,7 @@ ${registrations}
11524
11568
  const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
11525
11569
  const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
11526
11570
  const tsPath = __require.resolve("typescript");
11527
- const tsRootDir = dirname12(tsPath);
11571
+ const tsRootDir = dirname13(tsPath);
11528
11572
  return tsRootDir.endsWith("lib") ? tsRootDir : resolve19(tsRootDir, "lib");
11529
11573
  });
11530
11574
  const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
@@ -11561,7 +11605,7 @@ ${registrations}
11561
11605
  const originalGetSourceFile = host.getSourceFile;
11562
11606
  host.getSourceFile = (fileName, languageVersion, onError) => {
11563
11607
  if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
11564
- const resolvedPath = join16(tsLibDir, fileName);
11608
+ const resolvedPath = join17(tsLibDir, fileName);
11565
11609
  return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
11566
11610
  }
11567
11611
  return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
@@ -11616,7 +11660,7 @@ ${registrations}
11616
11660
  const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
11617
11661
  const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
11618
11662
  content,
11619
- target: join16(outDir, fileName)
11663
+ target: join17(outDir, fileName)
11620
11664
  }));
11621
11665
  const outputFiles = new Set(rawEntries.map(({ target }) => resolve19(target)));
11622
11666
  return rawEntries.map(({ content, target }) => {
@@ -11638,7 +11682,7 @@ ${registrations}
11638
11682
  });
11639
11683
  });
11640
11684
  await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
11641
- await fs.mkdir(dirname12(target), { recursive: true });
11685
+ await fs.mkdir(dirname13(target), { recursive: true });
11642
11686
  await fs.writeFile(target, content, "utf-8");
11643
11687
  })), { outputs: entries.length });
11644
11688
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
@@ -11791,7 +11835,7 @@ ${fields}
11791
11835
  }, inlineTemplateAndLowerDefer = async (source, fileDir) => {
11792
11836
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
11793
11837
  if (templateUrlMatch?.[1]) {
11794
- const templatePath = join16(fileDir, templateUrlMatch[1]);
11838
+ const templatePath = join17(fileDir, templateUrlMatch[1]);
11795
11839
  if (!existsSync17(templatePath)) {
11796
11840
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
11797
11841
  }
@@ -11822,7 +11866,7 @@ ${fields}
11822
11866
  }, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
11823
11867
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
11824
11868
  if (templateUrlMatch?.[1]) {
11825
- const templatePath = join16(fileDir, templateUrlMatch[1]);
11869
+ const templatePath = join17(fileDir, templateUrlMatch[1]);
11826
11870
  if (!existsSync17(templatePath)) {
11827
11871
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
11828
11872
  }
@@ -11859,7 +11903,7 @@ ${fields}
11859
11903
  return source;
11860
11904
  const stylePromises = urlMatches.map((urlMatch) => {
11861
11905
  const styleUrl = urlMatch.replace(/['"]/g, "");
11862
- return readAndEscapeFile(join16(fileDir, styleUrl), stylePreprocessors);
11906
+ return readAndEscapeFile(join17(fileDir, styleUrl), stylePreprocessors);
11863
11907
  });
11864
11908
  const results = await Promise.all(stylePromises);
11865
11909
  const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
@@ -11870,7 +11914,7 @@ ${fields}
11870
11914
  const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
11871
11915
  if (!styleUrlMatch?.[1])
11872
11916
  return source;
11873
- const escaped = await readAndEscapeFile(join16(fileDir, styleUrlMatch[1]), stylePreprocessors);
11917
+ const escaped = await readAndEscapeFile(join17(fileDir, styleUrlMatch[1]), stylePreprocessors);
11874
11918
  if (!escaped)
11875
11919
  return source;
11876
11920
  return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
@@ -11905,10 +11949,10 @@ ${fields}
11905
11949
  `${candidate}.tsx`,
11906
11950
  `${candidate}.js`,
11907
11951
  `${candidate}.jsx`,
11908
- join16(candidate, "index.ts"),
11909
- join16(candidate, "index.tsx"),
11910
- join16(candidate, "index.js"),
11911
- join16(candidate, "index.jsx")
11952
+ join17(candidate, "index.ts"),
11953
+ join17(candidate, "index.tsx"),
11954
+ join17(candidate, "index.js"),
11955
+ join17(candidate, "index.jsx")
11912
11956
  ];
11913
11957
  return candidates.find((file4) => existsSync17(file4));
11914
11958
  };
@@ -11932,10 +11976,10 @@ ${fields}
11932
11976
  }
11933
11977
  };
11934
11978
  const toOutputPath = (sourcePath) => {
11935
- const inputDir = dirname12(sourcePath);
11979
+ const inputDir = dirname13(sourcePath);
11936
11980
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
11937
11981
  const fileBase = basename7(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
11938
- return join16(outDir, relativeDir, fileBase);
11982
+ return join17(outDir, relativeDir, fileBase);
11939
11983
  };
11940
11984
  const transpileAndRewrite = (sourceCode, relativeDir, actualPath, importRewrites) => {
11941
11985
  let processedContent = angularTranspiler.transformSync(sourceCode);
@@ -11983,12 +12027,12 @@ ${fields}
11983
12027
  if (!existsSync17(actualPath))
11984
12028
  return;
11985
12029
  let sourceCode = await fs.readFile(actualPath, "utf-8");
11986
- const inlined = await inlineResources(sourceCode, dirname12(actualPath), stylePreprocessors);
11987
- sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname12(actualPath)).source;
11988
- const inputDir = dirname12(actualPath);
12030
+ const inlined = await inlineResources(sourceCode, dirname13(actualPath), stylePreprocessors);
12031
+ sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname13(actualPath)).source;
12032
+ const inputDir = dirname13(actualPath);
11989
12033
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
11990
12034
  const fileBase = basename7(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
11991
- const targetDir = join16(outDir, relativeDir);
12035
+ const targetDir = join17(outDir, relativeDir);
11992
12036
  const targetPath = toOutputPath(actualPath);
11993
12037
  const localImports = [];
11994
12038
  const importRewrites = new Map;
@@ -12042,13 +12086,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12042
12086
  }
12043
12087
  return allOutputs;
12044
12088
  }, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
12045
- const compiledParent = join16(outRoot, "generated");
12089
+ const compiledParent = join17(outRoot, "generated");
12046
12090
  if (entryPoints.length === 0) {
12047
12091
  const emptyPaths = [];
12048
12092
  return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
12049
12093
  }
12050
12094
  const compiledRoot = compiledParent;
12051
- const indexesDir = join16(compiledParent, "indexes");
12095
+ const indexesDir = join17(compiledParent, "indexes");
12052
12096
  await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
12053
12097
  const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve19(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
12054
12098
  const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
@@ -12062,9 +12106,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12062
12106
  const fileBase = basename7(resolvedEntry).replace(/\.[tj]s$/, "");
12063
12107
  const jsName = `${fileBase}.js`;
12064
12108
  const compiledFallbackPaths = [
12065
- join16(compiledRoot, relativeEntry),
12066
- join16(compiledRoot, "pages", jsName),
12067
- join16(compiledRoot, jsName)
12109
+ join17(compiledRoot, relativeEntry),
12110
+ join17(compiledRoot, "pages", jsName),
12111
+ join17(compiledRoot, jsName)
12068
12112
  ].map((file4) => resolve19(file4));
12069
12113
  const resolveRawServerFile = (candidatePaths) => {
12070
12114
  const normalizedCandidates = [
@@ -12108,7 +12152,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12108
12152
  const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
12109
12153
  const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
12110
12154
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
12111
- const clientFile = join16(indexesDir, jsName);
12155
+ const clientFile = join17(indexesDir, jsName);
12112
12156
  if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync17(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
12113
12157
  return {
12114
12158
  clientPath: clientFile,
@@ -12344,8 +12388,8 @@ var init_compileAngular = __esm(() => {
12344
12388
  init_lowerDeferSyntax();
12345
12389
  init_stylePreprocessor();
12346
12390
  devClientDir4 = resolveDevClientDir4();
12347
- hmrClientPath5 = join16(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
12348
- hmrRuntimePath = join16(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
12391
+ hmrClientPath5 = join17(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
12392
+ hmrRuntimePath = join17(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
12349
12393
  jitContentCache = new Map;
12350
12394
  wrapperOutputCache = new Map;
12351
12395
  });
@@ -12357,8 +12401,8 @@ __export(exports_buildReactVendor, {
12357
12401
  buildReactVendor: () => buildReactVendor
12358
12402
  });
12359
12403
  import { existsSync as existsSync18, mkdirSync as mkdirSync6 } from "fs";
12360
- import { join as join17, resolve as resolve20 } from "path";
12361
- import { rm as rm4 } from "fs/promises";
12404
+ import { join as join18, resolve as resolve20 } from "path";
12405
+ import { rm as rm5 } from "fs/promises";
12362
12406
  var {build: bunBuild2 } = globalThis.Bun;
12363
12407
  var resolveJsxDevRuntimeCompatPath = () => {
12364
12408
  const candidates = [
@@ -12411,14 +12455,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
12411
12455
  `)}
12412
12456
  `;
12413
12457
  }, buildReactVendor = async (buildDir) => {
12414
- const vendorDir = join17(buildDir, "react", "vendor");
12458
+ const vendorDir = join18(buildDir, "react", "vendor");
12415
12459
  mkdirSync6(vendorDir, { recursive: true });
12416
- const tmpDir = join17(buildDir, "_vendor_tmp");
12460
+ const tmpDir = join18(buildDir, "_vendor_tmp");
12417
12461
  mkdirSync6(tmpDir, { recursive: true });
12418
12462
  const specifiers = resolveVendorSpecifiers();
12419
12463
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
12420
12464
  const safeName = toSafeFileName(specifier);
12421
- const entryPath = join17(tmpDir, `${safeName}.ts`);
12465
+ const entryPath = join18(tmpDir, `${safeName}.ts`);
12422
12466
  const source = await generateEntrySource(specifier);
12423
12467
  await Bun.write(entryPath, source);
12424
12468
  return entryPath;
@@ -12433,7 +12477,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
12433
12477
  target: "browser",
12434
12478
  throw: false
12435
12479
  });
12436
- await rm4(tmpDir, { force: true, recursive: true });
12480
+ await rm5(tmpDir, { force: true, recursive: true });
12437
12481
  if (!result.success) {
12438
12482
  console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
12439
12483
  }
@@ -12466,8 +12510,8 @@ __export(exports_buildAngularVendor, {
12466
12510
  buildAngularServerVendor: () => buildAngularServerVendor
12467
12511
  });
12468
12512
  import { mkdirSync as mkdirSync7 } from "fs";
12469
- import { join as join18 } from "path";
12470
- import { rm as rm5 } from "fs/promises";
12513
+ import { join as join19 } from "path";
12514
+ import { rm as rm6 } from "fs/promises";
12471
12515
  var {build: bunBuild3, Glob: Glob6 } = globalThis.Bun;
12472
12516
  var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
12473
12517
  try {
@@ -12563,14 +12607,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
12563
12607
  await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
12564
12608
  return Array.from(angular).filter(isResolvable2);
12565
12609
  }, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
12566
- const vendorDir = join18(buildDir, "angular", "vendor");
12610
+ const vendorDir = join19(buildDir, "angular", "vendor");
12567
12611
  mkdirSync7(vendorDir, { recursive: true });
12568
- const tmpDir = join18(buildDir, "_angular_vendor_tmp");
12612
+ const tmpDir = join19(buildDir, "_angular_vendor_tmp");
12569
12613
  mkdirSync7(tmpDir, { recursive: true });
12570
12614
  const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
12571
12615
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
12572
12616
  const safeName = toSafeFileName2(specifier);
12573
- const entryPath = join18(tmpDir, `${safeName}.ts`);
12617
+ const entryPath = join19(tmpDir, `${safeName}.ts`);
12574
12618
  await Bun.write(entryPath, generateVendorEntrySource(specifier));
12575
12619
  return entryPath;
12576
12620
  }));
@@ -12586,7 +12630,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
12586
12630
  target: "browser",
12587
12631
  throw: false
12588
12632
  });
12589
- await rm5(tmpDir, { force: true, recursive: true });
12633
+ await rm6(tmpDir, { force: true, recursive: true });
12590
12634
  if (!result.success) {
12591
12635
  console.warn("\u26A0\uFE0F Angular vendor build had errors:", result.logs);
12592
12636
  }
@@ -12601,9 +12645,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
12601
12645
  const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
12602
12646
  return computeAngularVendorPaths(specifiers);
12603
12647
  }, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
12604
- const vendorDir = join18(buildDir, "angular", "vendor", "server");
12648
+ const vendorDir = join19(buildDir, "angular", "vendor", "server");
12605
12649
  mkdirSync7(vendorDir, { recursive: true });
12606
- const tmpDir = join18(buildDir, "_angular_server_vendor_tmp");
12650
+ const tmpDir = join19(buildDir, "_angular_server_vendor_tmp");
12607
12651
  mkdirSync7(tmpDir, { recursive: true });
12608
12652
  const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
12609
12653
  const allSpecs = new Set(browserSpecs);
@@ -12614,7 +12658,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
12614
12658
  const specifiers = Array.from(allSpecs);
12615
12659
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
12616
12660
  const safeName = toSafeFileName2(specifier);
12617
- const entryPath = join18(tmpDir, `${safeName}.ts`);
12661
+ const entryPath = join19(tmpDir, `${safeName}.ts`);
12618
12662
  await Bun.write(entryPath, generateVendorEntrySource(specifier));
12619
12663
  return entryPath;
12620
12664
  }));
@@ -12629,16 +12673,16 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
12629
12673
  target: "bun",
12630
12674
  throw: false
12631
12675
  });
12632
- await rm5(tmpDir, { force: true, recursive: true });
12676
+ await rm6(tmpDir, { force: true, recursive: true });
12633
12677
  if (!result.success) {
12634
12678
  console.warn("\u26A0\uFE0F Angular server vendor build had errors:", result.logs);
12635
12679
  }
12636
12680
  return specifiers;
12637
12681
  }, computeAngularServerVendorPaths = (buildDir, specifiers) => {
12638
12682
  const paths = {};
12639
- const vendorDir = join18(buildDir, "angular", "vendor", "server");
12683
+ const vendorDir = join19(buildDir, "angular", "vendor", "server");
12640
12684
  for (const specifier of specifiers) {
12641
- paths[specifier] = join18(vendorDir, `${toSafeFileName2(specifier)}.js`);
12685
+ paths[specifier] = join19(vendorDir, `${toSafeFileName2(specifier)}.js`);
12642
12686
  }
12643
12687
  return paths;
12644
12688
  }, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
@@ -12689,17 +12733,17 @@ __export(exports_buildVueVendor, {
12689
12733
  buildVueVendor: () => buildVueVendor
12690
12734
  });
12691
12735
  import { mkdirSync as mkdirSync8 } from "fs";
12692
- import { join as join19 } from "path";
12693
- import { rm as rm6 } from "fs/promises";
12736
+ import { join as join20 } from "path";
12737
+ import { rm as rm7 } from "fs/promises";
12694
12738
  var {build: bunBuild4 } = globalThis.Bun;
12695
12739
  var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
12696
- const vendorDir = join19(buildDir, "vue", "vendor");
12740
+ const vendorDir = join20(buildDir, "vue", "vendor");
12697
12741
  mkdirSync8(vendorDir, { recursive: true });
12698
- const tmpDir = join19(buildDir, "_vue_vendor_tmp");
12742
+ const tmpDir = join20(buildDir, "_vue_vendor_tmp");
12699
12743
  mkdirSync8(tmpDir, { recursive: true });
12700
12744
  const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
12701
12745
  const safeName = toSafeFileName3(specifier);
12702
- const entryPath = join19(tmpDir, `${safeName}.ts`);
12746
+ const entryPath = join20(tmpDir, `${safeName}.ts`);
12703
12747
  await Bun.write(entryPath, `export * from '${specifier}';
12704
12748
  `);
12705
12749
  return entryPath;
@@ -12719,7 +12763,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
12719
12763
  target: "browser",
12720
12764
  throw: false
12721
12765
  });
12722
- await rm6(tmpDir, { force: true, recursive: true });
12766
+ await rm7(tmpDir, { force: true, recursive: true });
12723
12767
  if (!result.success) {
12724
12768
  console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
12725
12769
  return;
@@ -12727,7 +12771,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
12727
12771
  const { readFileSync: readFileSync13, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
12728
12772
  const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
12729
12773
  for (const file4 of files) {
12730
- const filePath = join19(vendorDir, file4);
12774
+ const filePath = join20(vendorDir, file4);
12731
12775
  const content = readFileSync13(filePath, "utf-8");
12732
12776
  if (!content.includes("__VUE_HMR_RUNTIME__"))
12733
12777
  continue;
@@ -12754,8 +12798,8 @@ __export(exports_buildSvelteVendor, {
12754
12798
  buildSvelteVendor: () => buildSvelteVendor
12755
12799
  });
12756
12800
  import { mkdirSync as mkdirSync9 } from "fs";
12757
- import { join as join20 } from "path";
12758
- import { rm as rm7 } from "fs/promises";
12801
+ import { join as join21 } from "path";
12802
+ import { rm as rm8 } from "fs/promises";
12759
12803
  var {build: bunBuild5 } = globalThis.Bun;
12760
12804
  var svelteSpecifiers, isResolvable3 = (specifier) => {
12761
12805
  try {
@@ -12768,13 +12812,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
12768
12812
  const specifiers = resolveVendorSpecifiers2();
12769
12813
  if (specifiers.length === 0)
12770
12814
  return;
12771
- const vendorDir = join20(buildDir, "svelte", "vendor");
12815
+ const vendorDir = join21(buildDir, "svelte", "vendor");
12772
12816
  mkdirSync9(vendorDir, { recursive: true });
12773
- const tmpDir = join20(buildDir, "_svelte_vendor_tmp");
12817
+ const tmpDir = join21(buildDir, "_svelte_vendor_tmp");
12774
12818
  mkdirSync9(tmpDir, { recursive: true });
12775
12819
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
12776
12820
  const safeName = toSafeFileName4(specifier);
12777
- const entryPath = join20(tmpDir, `${safeName}.ts`);
12821
+ const entryPath = join21(tmpDir, `${safeName}.ts`);
12778
12822
  await Bun.write(entryPath, `export * from '${specifier}';
12779
12823
  `);
12780
12824
  return entryPath;
@@ -12789,7 +12833,7 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
12789
12833
  target: "browser",
12790
12834
  throw: false
12791
12835
  });
12792
- await rm7(tmpDir, { force: true, recursive: true });
12836
+ await rm8(tmpDir, { force: true, recursive: true });
12793
12837
  if (!result.success) {
12794
12838
  console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
12795
12839
  }
@@ -12847,11 +12891,11 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
12847
12891
  if (Object.keys(vendorPaths).length === 0)
12848
12892
  return;
12849
12893
  const { readdirSync } = await import("fs");
12850
- const { join: join21 } = await import("path");
12894
+ const { join: join22 } = await import("path");
12851
12895
  const allFiles = [];
12852
12896
  for (const dir of vendorDirs) {
12853
12897
  try {
12854
- const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) => join21(dir, f2));
12898
+ const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) => join22(dir, f2));
12855
12899
  allFiles.push(...files);
12856
12900
  } catch {}
12857
12901
  }
@@ -12927,7 +12971,7 @@ import {
12927
12971
  statSync,
12928
12972
  writeFileSync as writeFileSync7
12929
12973
  } from "fs";
12930
- import { basename as basename8, dirname as dirname13, extname as extname6, join as join21, relative as relative10, resolve as resolve21 } from "path";
12974
+ import { basename as basename8, dirname as dirname14, extname as extname6, join as join22, relative as relative10, resolve as resolve21 } from "path";
12931
12975
  import { cwd, env as env3, exit } from "process";
12932
12976
  var {build: bunBuild6, Glob: Glob7 } = globalThis.Bun;
12933
12977
  var isDev2, isBuildTraceEnabled = () => {
@@ -13005,8 +13049,8 @@ var isDev2, isBuildTraceEnabled = () => {
13005
13049
  mkdirSync10(htmxDestDir, { recursive: true });
13006
13050
  const glob = new Glob7("htmx*.min.js");
13007
13051
  for (const relPath of glob.scanSync({ cwd: htmxDir })) {
13008
- const src = join21(htmxDir, relPath);
13009
- const dest = join21(htmxDestDir, "htmx.min.js");
13052
+ const src = join22(htmxDir, relPath);
13053
+ const dest = join22(htmxDestDir, "htmx.min.js");
13010
13054
  copyFileSync(src, dest);
13011
13055
  return;
13012
13056
  }
@@ -13081,7 +13125,7 @@ var isDev2, isBuildTraceEnabled = () => {
13081
13125
  vuePagesPath
13082
13126
  }) => {
13083
13127
  const { readdirSync: readDir } = await import("fs");
13084
- const devIndexDir = join21(buildPath, "_src_indexes");
13128
+ const devIndexDir = join22(buildPath, "_src_indexes");
13085
13129
  mkdirSync10(devIndexDir, { recursive: true });
13086
13130
  if (reactIndexesPath && reactPagesPath) {
13087
13131
  copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
@@ -13099,35 +13143,35 @@ var isDev2, isBuildTraceEnabled = () => {
13099
13143
  const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
13100
13144
  const pagesRel = relative10(process.cwd(), resolve21(reactPagesPath)).replace(/\\/g, "/");
13101
13145
  for (const file4 of indexFiles) {
13102
- let content = readFileSync13(join21(reactIndexesPath, file4), "utf-8");
13146
+ let content = readFileSync13(join22(reactIndexesPath, file4), "utf-8");
13103
13147
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
13104
- writeFileSync7(join21(devIndexDir, file4), content);
13148
+ writeFileSync7(join22(devIndexDir, file4), content);
13105
13149
  }
13106
13150
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
13107
- const svelteIndexDir = join21(svelteDir, "generated", "indexes");
13151
+ const svelteIndexDir = join22(svelteDir, "generated", "indexes");
13108
13152
  const sveltePageEntries = svelteEntries.filter((file4) => resolve21(file4).startsWith(resolve21(sveltePagesPath)));
13109
13153
  for (const entry of sveltePageEntries) {
13110
13154
  const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
13111
- const indexFile = join21(svelteIndexDir, "pages", `${name}.js`);
13155
+ const indexFile = join22(svelteIndexDir, "pages", `${name}.js`);
13112
13156
  if (!existsSync19(indexFile))
13113
13157
  continue;
13114
13158
  let content = readFileSync13(indexFile, "utf-8");
13115
13159
  const srcRel = relative10(process.cwd(), resolve21(entry)).replace(/\\/g, "/");
13116
13160
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
13117
- writeFileSync7(join21(devIndexDir, `${name}.svelte.js`), content);
13161
+ writeFileSync7(join22(devIndexDir, `${name}.svelte.js`), content);
13118
13162
  }
13119
13163
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
13120
- const vueIndexDir = join21(vueDir, "generated", "indexes");
13164
+ const vueIndexDir = join22(vueDir, "generated", "indexes");
13121
13165
  const vuePageEntries = vueEntries.filter((file4) => resolve21(file4).startsWith(resolve21(vuePagesPath)));
13122
13166
  for (const entry of vuePageEntries) {
13123
13167
  const name = basename8(entry, ".vue");
13124
- const indexFile = join21(vueIndexDir, `${name}.js`);
13168
+ const indexFile = join22(vueIndexDir, `${name}.js`);
13125
13169
  if (!existsSync19(indexFile))
13126
13170
  continue;
13127
13171
  let content = readFileSync13(indexFile, "utf-8");
13128
13172
  const srcRel = relative10(process.cwd(), resolve21(entry)).replace(/\\/g, "/");
13129
13173
  content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
13130
- writeFileSync7(join21(devIndexDir, `${name}.vue.js`), content);
13174
+ writeFileSync7(join22(devIndexDir, `${name}.vue.js`), content);
13131
13175
  }
13132
13176
  }, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
13133
13177
  const varIdx = content.indexOf(`var ${firstUseName} =`);
@@ -13278,7 +13322,7 @@ ${content.slice(firstUseIdx)}`;
13278
13322
  ]),
13279
13323
  plugins: [...base.plugins ?? [], ...sanitized.plugins ?? []]
13280
13324
  };
13281
- }, build2 = async ({
13325
+ }, buildUnlocked = async ({
13282
13326
  buildDirectory = "build",
13283
13327
  assetsDirectory,
13284
13328
  publicDirectory,
@@ -13348,10 +13392,10 @@ ${content.slice(firstUseIdx)}`;
13348
13392
  restoreTracePhase();
13349
13393
  return;
13350
13394
  }
13351
- const traceDir = join21(buildPath2, ".absolute-trace");
13395
+ const traceDir = join22(buildPath2, ".absolute-trace");
13352
13396
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
13353
13397
  mkdirSync10(traceDir, { recursive: true });
13354
- writeFileSync7(join21(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
13398
+ writeFileSync7(join22(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
13355
13399
  events: traceEvents,
13356
13400
  frameworks: traceFrameworkNames,
13357
13401
  generatedAt: new Date().toISOString(),
@@ -13381,14 +13425,14 @@ ${content.slice(firstUseIdx)}`;
13381
13425
  const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
13382
13426
  const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
13383
13427
  const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
13384
- const reactIndexesPath = reactDir && join21(reactDir, "generated", "indexes");
13385
- const reactPagesPath = reactDir && join21(reactDir, "pages");
13386
- const htmlPagesPath = htmlDir && join21(htmlDir, "pages");
13387
- const htmlScriptsPath = htmlDir && join21(htmlDir, "scripts");
13388
- const sveltePagesPath = svelteDir && join21(svelteDir, "pages");
13389
- const vuePagesPath = vueDir && join21(vueDir, "pages");
13390
- const htmxPagesPath = htmxDir && join21(htmxDir, "pages");
13391
- const angularPagesPath = angularDir && join21(angularDir, "pages");
13428
+ const reactIndexesPath = reactDir && join22(reactDir, "generated", "indexes");
13429
+ const reactPagesPath = reactDir && join22(reactDir, "pages");
13430
+ const htmlPagesPath = htmlDir && join22(htmlDir, "pages");
13431
+ const htmlScriptsPath = htmlDir && join22(htmlDir, "scripts");
13432
+ const sveltePagesPath = svelteDir && join22(svelteDir, "pages");
13433
+ const vuePagesPath = vueDir && join22(vueDir, "pages");
13434
+ const htmxPagesPath = htmxDir && join22(htmxDir, "pages");
13435
+ const angularPagesPath = angularDir && join22(angularDir, "pages");
13392
13436
  const frontends = [
13393
13437
  reactDir,
13394
13438
  htmlDir,
@@ -13419,19 +13463,19 @@ ${content.slice(firstUseIdx)}`;
13419
13463
  htmlDir,
13420
13464
  vueDir,
13421
13465
  angularDir,
13422
- islandBootstrapPath && dirname13(islandBootstrapPath)
13466
+ islandBootstrapPath && dirname14(islandBootstrapPath)
13423
13467
  ].filter((dir) => Boolean(dir));
13424
13468
  const clientRoot = isSingle ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
13425
13469
  const serverDirMap = [];
13426
13470
  if (svelteDir)
13427
13471
  serverDirMap.push({
13428
13472
  dir: svelteDir,
13429
- subdir: join21("generated", "server")
13473
+ subdir: join22("generated", "server")
13430
13474
  });
13431
13475
  if (vueDir)
13432
13476
  serverDirMap.push({
13433
13477
  dir: vueDir,
13434
- subdir: join21("generated", "server")
13478
+ subdir: join22("generated", "server")
13435
13479
  });
13436
13480
  if (angularDir)
13437
13481
  serverDirMap.push({ dir: angularDir, subdir: "generated" });
@@ -13441,8 +13485,8 @@ ${content.slice(firstUseIdx)}`;
13441
13485
  const [firstEntry] = serverDirMap;
13442
13486
  if (!firstEntry)
13443
13487
  throw new Error("Expected at least one server directory entry");
13444
- serverRoot = join21(firstEntry.dir, firstEntry.subdir);
13445
- serverOutDir = join21(buildPath, basename8(firstEntry.dir));
13488
+ serverRoot = join22(firstEntry.dir, firstEntry.subdir);
13489
+ serverOutDir = join22(buildPath, basename8(firstEntry.dir));
13446
13490
  } else if (serverDirMap.length > 1) {
13447
13491
  serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
13448
13492
  serverOutDir = buildPath;
@@ -13470,7 +13514,7 @@ ${content.slice(firstUseIdx)}`;
13470
13514
  await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
13471
13515
  }
13472
13516
  if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
13473
- await tracePhase("assets/copy", () => cpSync(assetsPath, join21(buildPath, "assets"), {
13517
+ await tracePhase("assets/copy", () => cpSync(assetsPath, join22(buildPath, "assets"), {
13474
13518
  force: true,
13475
13519
  recursive: true
13476
13520
  }));
@@ -13519,7 +13563,7 @@ ${content.slice(firstUseIdx)}`;
13519
13563
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
13520
13564
  if (entry.startsWith(resolve21(reactIndexesPath))) {
13521
13565
  const pageName = basename8(entry, ".tsx");
13522
- return join21(reactPagesPath, `${pageName}.tsx`);
13566
+ return join22(reactPagesPath, `${pageName}.tsx`);
13523
13567
  }
13524
13568
  return null;
13525
13569
  }) : allReactEntries;
@@ -13616,7 +13660,7 @@ ${content.slice(firstUseIdx)}`;
13616
13660
  const compileReactConventions = async () => {
13617
13661
  if (reactConventionSources.length === 0)
13618
13662
  return emptyStringArray;
13619
- const destDir = join21(buildPath, "conventions", "react");
13663
+ const destDir = join22(buildPath, "conventions", "react");
13620
13664
  rmSync2(destDir, { force: true, recursive: true });
13621
13665
  mkdirSync10(destDir, { recursive: true });
13622
13666
  const destPaths = [];
@@ -13632,7 +13676,7 @@ ${content.slice(firstUseIdx)}`;
13632
13676
  naming: `${idx}-[name].[ext]`,
13633
13677
  outdir: destDir,
13634
13678
  plugins: [stylePreprocessorPlugin2],
13635
- root: dirname13(source),
13679
+ root: dirname14(source),
13636
13680
  target: "bun",
13637
13681
  throw: false,
13638
13682
  tsconfig: "./tsconfig.json"
@@ -13660,7 +13704,7 @@ ${content.slice(firstUseIdx)}`;
13660
13704
  angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
13661
13705
  ]);
13662
13706
  const bundleConventionFiles = async (framework, compiledPaths) => {
13663
- const destDir = join21(buildPath, "conventions", framework);
13707
+ const destDir = join22(buildPath, "conventions", framework);
13664
13708
  rmSync2(destDir, { force: true, recursive: true });
13665
13709
  mkdirSync10(destDir, { recursive: true });
13666
13710
  const destPaths = [];
@@ -13733,7 +13777,7 @@ ${content.slice(firstUseIdx)}`;
13733
13777
  }
13734
13778
  })) : {
13735
13779
  entries: [],
13736
- generatedRoot: join21(buildPath, "_island_entries")
13780
+ generatedRoot: join22(buildPath, "_island_entries")
13737
13781
  };
13738
13782
  const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
13739
13783
  if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
@@ -13769,7 +13813,7 @@ ${content.slice(firstUseIdx)}`;
13769
13813
  return {};
13770
13814
  }
13771
13815
  if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
13772
- const refreshEntry = join21(reactIndexesPath, "_refresh.tsx");
13816
+ const refreshEntry = join22(reactIndexesPath, "_refresh.tsx");
13773
13817
  if (!reactClientEntryPoints.includes(refreshEntry))
13774
13818
  reactClientEntryPoints.push(refreshEntry);
13775
13819
  }
@@ -13872,19 +13916,19 @@ ${content.slice(firstUseIdx)}`;
13872
13916
  throw: false
13873
13917
  }, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
13874
13918
  if (reactDir && reactClientEntryPoints.length > 0) {
13875
- rmSync2(join21(buildPath, "react", "generated", "indexes"), {
13919
+ rmSync2(join22(buildPath, "react", "generated", "indexes"), {
13876
13920
  force: true,
13877
13921
  recursive: true
13878
13922
  });
13879
13923
  }
13880
13924
  if (angularDir && angularClientPaths.length > 0) {
13881
- rmSync2(join21(buildPath, "angular", "indexes"), {
13925
+ rmSync2(join22(buildPath, "angular", "indexes"), {
13882
13926
  force: true,
13883
13927
  recursive: true
13884
13928
  });
13885
13929
  }
13886
13930
  if (islandClientEntryPoints.length > 0) {
13887
- rmSync2(join21(buildPath, "islands"), {
13931
+ rmSync2(join22(buildPath, "islands"), {
13888
13932
  force: true,
13889
13933
  recursive: true
13890
13934
  });
@@ -13950,7 +13994,7 @@ ${content.slice(firstUseIdx)}`;
13950
13994
  globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild6(mergeBunBuildConfig({
13951
13995
  entrypoints: globalCssEntries,
13952
13996
  naming: `[dir]/[name].[hash].[ext]`,
13953
- outdir: stylesDir ? join21(buildPath, basename8(stylesDir)) : buildPath,
13997
+ outdir: stylesDir ? join22(buildPath, basename8(stylesDir)) : buildPath,
13954
13998
  plugins: [stylePreprocessorPlugin2],
13955
13999
  root: stylesDir || clientRoot,
13956
14000
  target: "browser",
@@ -13959,7 +14003,7 @@ ${content.slice(firstUseIdx)}`;
13959
14003
  vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild6(mergeBunBuildConfig({
13960
14004
  entrypoints: vueCssPaths,
13961
14005
  naming: `[name].[hash].[ext]`,
13962
- outdir: join21(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
14006
+ outdir: join22(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
13963
14007
  target: "browser",
13964
14008
  throw: false
13965
14009
  }, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
@@ -14027,7 +14071,7 @@ ${content.slice(firstUseIdx)}`;
14027
14071
  const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
14028
14072
  const jsArtifacts = serverOutputs.filter((artifact) => artifact.path.endsWith(".js"));
14029
14073
  await tracePhase("postprocess/server-angular-vendor-imports", () => Promise.all(jsArtifacts.map(async (artifact) => {
14030
- const fileDir = dirname13(artifact.path);
14074
+ const fileDir = dirname14(artifact.path);
14031
14075
  const relativePaths = {};
14032
14076
  for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
14033
14077
  const rel = relative10(fileDir, absolute);
@@ -14107,7 +14151,7 @@ ${content.slice(firstUseIdx)}`;
14107
14151
  const processHtmlPages = async () => {
14108
14152
  if (!(htmlDir && htmlPagesPath))
14109
14153
  return;
14110
- const outputHtmlPages = isSingle ? join21(buildPath, "pages") : join21(buildPath, basename8(htmlDir), "pages");
14154
+ const outputHtmlPages = isSingle ? join22(buildPath, "pages") : join22(buildPath, basename8(htmlDir), "pages");
14111
14155
  mkdirSync10(outputHtmlPages, { recursive: true });
14112
14156
  cpSync(htmlPagesPath, outputHtmlPages, {
14113
14157
  force: true,
@@ -14129,14 +14173,14 @@ ${content.slice(firstUseIdx)}`;
14129
14173
  const processHtmxPages = async () => {
14130
14174
  if (!(htmxDir && htmxPagesPath))
14131
14175
  return;
14132
- const outputHtmxPages = isSingle ? join21(buildPath, "pages") : join21(buildPath, basename8(htmxDir), "pages");
14176
+ const outputHtmxPages = isSingle ? join22(buildPath, "pages") : join22(buildPath, basename8(htmxDir), "pages");
14133
14177
  mkdirSync10(outputHtmxPages, { recursive: true });
14134
14178
  cpSync(htmxPagesPath, outputHtmxPages, {
14135
14179
  force: true,
14136
14180
  recursive: true
14137
14181
  });
14138
14182
  if (shouldCopyHtmx) {
14139
- const htmxDestDir = isSingle ? buildPath : join21(buildPath, basename8(htmxDir));
14183
+ const htmxDestDir = isSingle ? buildPath : join22(buildPath, basename8(htmxDir));
14140
14184
  copyHtmxVendor(htmxDir, htmxDestDir);
14141
14185
  }
14142
14186
  if (shouldUpdateHtmxAssetPaths) {
@@ -14197,15 +14241,19 @@ ${content.slice(firstUseIdx)}`;
14197
14241
  writeBuildTrace(buildPath);
14198
14242
  return { conventions: conventionsMap, manifest };
14199
14243
  }
14200
- writeFileSync7(join21(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
14244
+ writeFileSync7(join22(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
14201
14245
  if (Object.keys(conventionsMap).length > 0) {
14202
- writeFileSync7(join21(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
14246
+ writeFileSync7(join22(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
14203
14247
  }
14204
14248
  writeBuildTrace(buildPath);
14205
14249
  if (tailwind && mode === "production") {
14206
14250
  disposeTailwindCompiler(tailwind.input);
14207
14251
  }
14208
14252
  return { conventions: conventionsMap, manifest };
14253
+ }, build2 = async (config) => {
14254
+ const projectRoot = cwd();
14255
+ const buildPath = validateSafePath(config.buildDirectory ?? "build", projectRoot);
14256
+ return await withBuildDirectoryLock(buildPath, () => buildUnlocked(config));
14209
14257
  };
14210
14258
  var init_build = __esm(() => {
14211
14259
  init_constants();
@@ -14230,6 +14278,7 @@ var init_build = __esm(() => {
14230
14278
  init_cleanStaleOutputs();
14231
14279
  init_cleanup();
14232
14280
  init_commonAncestor();
14281
+ init_buildDirectoryLock();
14233
14282
  init_logger();
14234
14283
  init_validateSafePath();
14235
14284
  isDev2 = env3.NODE_ENV === "development";
@@ -14749,7 +14798,7 @@ var init_pathUtils = __esm(() => {
14749
14798
  // src/dev/fileWatcher.ts
14750
14799
  import { watch } from "fs";
14751
14800
  import { existsSync as existsSync21 } from "fs";
14752
- import { join as join22, resolve as resolve24 } from "path";
14801
+ import { join as join23, resolve as resolve24 } from "path";
14753
14802
  var safeRemoveFromGraph = (graph, fullPath) => {
14754
14803
  try {
14755
14804
  removeFileFromGraph(graph, fullPath);
@@ -14776,7 +14825,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
14776
14825
  if (shouldSkipFilename(filename, isStylesDir)) {
14777
14826
  return;
14778
14827
  }
14779
- const fullPath = join22(absolutePath, filename).replace(/\\/g, "/");
14828
+ const fullPath = join23(absolutePath, filename).replace(/\\/g, "/");
14780
14829
  if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
14781
14830
  return;
14782
14831
  }
@@ -15237,7 +15286,7 @@ __export(exports_moduleServer, {
15237
15286
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
15238
15287
  });
15239
15288
  import { existsSync as existsSync22, readFileSync as readFileSync16, statSync as statSync2 } from "fs";
15240
- import { basename as basename10, dirname as dirname14, extname as extname7, resolve as resolve28, relative as relative11 } from "path";
15289
+ import { basename as basename10, dirname as dirname15, extname as extname7, resolve as resolve28, relative as relative11 } from "path";
15241
15290
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
15242
15291
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
15243
15292
  const allExports = [];
@@ -15322,7 +15371,7 @@ ${stubs}
15322
15371
  };
15323
15372
  result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
15324
15373
  result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
15325
- const fileDir = dirname14(filePath);
15374
+ const fileDir = dirname15(filePath);
15326
15375
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
15327
15376
  result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
15328
15377
  result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
@@ -15817,20 +15866,20 @@ export default {};
15817
15866
  return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
15818
15867
  if (!TRANSPILABLE.has(ext))
15819
15868
  return;
15820
- const stat3 = statSync2(filePath);
15869
+ const stat4 = statSync2(filePath);
15821
15870
  const resolvedVueDir = vueDir ? resolve28(vueDir) : undefined;
15822
15871
  const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
15823
- setTransformed(filePath, content, stat3.mtimeMs, extractImportedFiles(content, projectRoot));
15872
+ setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
15824
15873
  return jsResponse(content);
15825
15874
  }, transformAndCacheSvelte = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
15826
- const stat3 = statSync2(filePath);
15875
+ const stat4 = statSync2(filePath);
15827
15876
  const content = await transformSvelteFile(filePath, projectRoot, rewriter, stylePreprocessors);
15828
- setTransformed(filePath, content, stat3.mtimeMs, extractImportedFiles(content, projectRoot));
15877
+ setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
15829
15878
  return jsResponse(content);
15830
15879
  }, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
15831
- const stat3 = statSync2(filePath);
15880
+ const stat4 = statSync2(filePath);
15832
15881
  const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
15833
- setTransformed(filePath, content, stat3.mtimeMs, extractImportedFiles(content, projectRoot));
15882
+ setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
15834
15883
  return jsResponse(content);
15835
15884
  }, transformErrorResponse = (err) => {
15836
15885
  const errMsg = err instanceof Error ? err.message : String(err);
@@ -16003,7 +16052,7 @@ var init_simpleHTMXHMR = () => {};
16003
16052
 
16004
16053
  // src/dev/rebuildTrigger.ts
16005
16054
  import { existsSync as existsSync23 } from "fs";
16006
- import { basename as basename11, dirname as dirname15, relative as relative12, resolve as resolve31 } from "path";
16055
+ import { basename as basename11, dirname as dirname16, relative as relative12, resolve as resolve31 } from "path";
16007
16056
  var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
16008
16057
  if (!config.tailwind)
16009
16058
  return;
@@ -16868,7 +16917,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16868
16917
  if (!buildReference?.source) {
16869
16918
  return;
16870
16919
  }
16871
- const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve31(dirname15(buildInfo.resolvedRegistryPath), buildReference.source);
16920
+ const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve31(dirname16(buildInfo.resolvedRegistryPath), buildReference.source);
16872
16921
  islandFiles.add(resolve31(sourcePath));
16873
16922
  }, resolveIslandSourceFiles = async (config) => {
16874
16923
  const registryPath = config.islands?.registry;
@@ -17627,8 +17676,8 @@ __export(exports_buildDepVendor, {
17627
17676
  buildDepVendor: () => buildDepVendor
17628
17677
  });
17629
17678
  import { mkdirSync as mkdirSync11 } from "fs";
17630
- import { join as join23 } from "path";
17631
- import { rm as rm8 } from "fs/promises";
17679
+ import { join as join24 } from "path";
17680
+ import { rm as rm9 } from "fs/promises";
17632
17681
  var {build: bunBuild7, Glob: Glob9 } = globalThis.Bun;
17633
17682
  var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_"), isResolvable4 = (specifier) => {
17634
17683
  try {
@@ -17722,7 +17771,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17722
17771
  }, buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
17723
17772
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
17724
17773
  const safeName = toSafeFileName5(specifier);
17725
- const entryPath = join23(tmpDir, `${safeName}.ts`);
17774
+ const entryPath = join24(tmpDir, `${safeName}.ts`);
17726
17775
  await Bun.write(entryPath, generateVendorEntrySource(specifier));
17727
17776
  return entryPath;
17728
17777
  }));
@@ -17741,9 +17790,9 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17741
17790
  const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
17742
17791
  if (initialSpecs.length === 0 && frameworkRoots.length === 0)
17743
17792
  return {};
17744
- const vendorDir = join23(buildDir, "vendor");
17793
+ const vendorDir = join24(buildDir, "vendor");
17745
17794
  mkdirSync11(vendorDir, { recursive: true });
17746
- const tmpDir = join23(buildDir, "_dep_vendor_tmp");
17795
+ const tmpDir = join24(buildDir, "_dep_vendor_tmp");
17747
17796
  mkdirSync11(tmpDir, { recursive: true });
17748
17797
  const allSpecs = new Set(initialSpecs);
17749
17798
  const alreadyScanned = new Set;
@@ -17763,7 +17812,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17763
17812
  if (!success) {
17764
17813
  console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
17765
17814
  }
17766
- await rm8(tmpDir, { force: true, recursive: true });
17815
+ await rm9(tmpDir, { force: true, recursive: true });
17767
17816
  const paths = {};
17768
17817
  for (const specifier of allSpecs) {
17769
17818
  paths[specifier] = `/vendor/${toSafeFileName5(specifier)}.js`;
@@ -18310,12 +18359,12 @@ __export(exports_devtoolsJson, {
18310
18359
  devtoolsJson: () => devtoolsJson
18311
18360
  });
18312
18361
  import { existsSync as existsSync24, mkdirSync as mkdirSync12, readFileSync as readFileSync17, writeFileSync as writeFileSync8 } from "fs";
18313
- import { dirname as dirname16, join as join24, resolve as resolve33 } from "path";
18362
+ import { dirname as dirname17, join as join25, resolve as resolve33 } from "path";
18314
18363
  import { Elysia as Elysia3 } from "elysia";
18315
18364
  var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
18316
18365
  Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
18317
18366
  return uuid;
18318
- }, 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) => resolve33(uuidCachePath ?? join24(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
18367
+ }, 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) => resolve33(uuidCachePath ?? join25(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
18319
18368
  if (!existsSync24(cachePath))
18320
18369
  return null;
18321
18370
  try {
@@ -18337,7 +18386,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
18337
18386
  if (cachedUuid)
18338
18387
  return setGlobalUuid(cachedUuid);
18339
18388
  const uuid = crypto.randomUUID();
18340
- mkdirSync12(dirname16(cachePath), { recursive: true });
18389
+ mkdirSync12(dirname17(cachePath), { recursive: true });
18341
18390
  writeFileSync8(cachePath, uuid, "utf-8");
18342
18391
  return setGlobalUuid(uuid);
18343
18392
  }, devtoolsJson = (buildDir, options = {}) => {
@@ -18354,11 +18403,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
18354
18403
  if (process.env.WSL_DISTRO_NAME) {
18355
18404
  const distro = process.env.WSL_DISTRO_NAME;
18356
18405
  const withoutLeadingSlash = root.replace(/^\//, "");
18357
- return join24("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
18406
+ return join25("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
18358
18407
  }
18359
18408
  if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
18360
18409
  const withoutLeadingSlash = root.replace(/^\//, "");
18361
- return join24("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
18410
+ return join25("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
18362
18411
  }
18363
18412
  return root;
18364
18413
  };
@@ -18675,7 +18724,7 @@ __export(exports_prerender, {
18675
18724
  PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
18676
18725
  });
18677
18726
  import { mkdirSync as mkdirSync13, readFileSync as readFileSync18 } from "fs";
18678
- import { join as join25 } from "path";
18727
+ import { join as join26 } from "path";
18679
18728
  var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
18680
18729
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
18681
18730
  await Bun.write(metaPath, String(Date.now()));
@@ -18741,7 +18790,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
18741
18790
  return false;
18742
18791
  const html = await res.text();
18743
18792
  const fileName = routeToFilename(route);
18744
- const filePath = join25(prerenderDir, fileName);
18793
+ const filePath = join26(prerenderDir, fileName);
18745
18794
  await Bun.write(filePath, html);
18746
18795
  await writeTimestamp(filePath);
18747
18796
  return true;
@@ -18767,13 +18816,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
18767
18816
  }
18768
18817
  const html = await res.text();
18769
18818
  const fileName = routeToFilename(route);
18770
- const filePath = join25(prerenderDir, fileName);
18819
+ const filePath = join26(prerenderDir, fileName);
18771
18820
  await Bun.write(filePath, html);
18772
18821
  await writeTimestamp(filePath);
18773
18822
  result.routes.set(route, filePath);
18774
18823
  log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
18775
18824
  }, prerender = async (port, outDir, staticConfig, log2) => {
18776
- const prerenderDir = join25(outDir, "_prerendered");
18825
+ const prerenderDir = join26(outDir, "_prerendered");
18777
18826
  mkdirSync13(prerenderDir, { recursive: true });
18778
18827
  const baseUrl = `http://localhost:${port}`;
18779
18828
  let routes;
@@ -19370,7 +19419,7 @@ var handleHTMXPageRequest = async (pagePath) => {
19370
19419
  };
19371
19420
  // src/core/prepare.ts
19372
19421
  import { existsSync as existsSync26, readdirSync as readdirSync2, readFileSync as readFileSync19 } from "fs";
19373
- import { basename as basename12, join as join26, relative as relative13, resolve as resolve35 } from "path";
19422
+ import { basename as basename12, join as join27, relative as relative13, resolve as resolve35 } from "path";
19374
19423
  import { Elysia as Elysia5 } from "elysia";
19375
19424
 
19376
19425
  // src/utils/loadConfig.ts
@@ -19946,7 +19995,7 @@ var loadPrerenderMap = (prerenderDir) => {
19946
19995
  continue;
19947
19996
  const name = basename12(entry, ".html");
19948
19997
  const route = name === "index" ? "/" : `/${name}`;
19949
- map.set(route, join26(prerenderDir, entry));
19998
+ map.set(route, join27(prerenderDir, entry));
19950
19999
  }
19951
20000
  return map;
19952
20001
  };
@@ -19995,7 +20044,7 @@ var prepare = async (configOrPath) => {
19995
20044
  setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
19996
20045
  recordStep("load production manifest and island metadata", stepStartedAt);
19997
20046
  stepStartedAt = performance.now();
19998
- const conventionsPath = join26(buildDir, "conventions.json");
20047
+ const conventionsPath = join27(buildDir, "conventions.json");
19999
20048
  if (existsSync26(conventionsPath)) {
20000
20049
  const conventions2 = JSON.parse(readFileSync19(conventionsPath, "utf-8"));
20001
20050
  setConventions(conventions2);
@@ -20011,7 +20060,7 @@ var prepare = async (configOrPath) => {
20011
20060
  });
20012
20061
  recordStep("create static plugin", stepStartedAt);
20013
20062
  stepStartedAt = performance.now();
20014
- const prerenderDir = join26(buildDir, "_prerendered");
20063
+ const prerenderDir = join27(buildDir, "_prerendered");
20015
20064
  const prerenderMap = loadPrerenderMap(prerenderDir);
20016
20065
  recordStep("load prerender map", stepStartedAt);
20017
20066
  if (prerenderMap.size > 0) {
@@ -20070,10 +20119,10 @@ var {env: env4 } = globalThis.Bun;
20070
20119
 
20071
20120
  // src/dev/devCert.ts
20072
20121
  import { existsSync as existsSync27, mkdirSync as mkdirSync14, readFileSync as readFileSync20, rmSync as rmSync3 } from "fs";
20073
- import { join as join27 } from "path";
20074
- var CERT_DIR = join27(process.cwd(), ".absolutejs");
20075
- var CERT_PATH = join27(CERT_DIR, "cert.pem");
20076
- var KEY_PATH = join27(CERT_DIR, "key.pem");
20122
+ import { join as join28 } from "path";
20123
+ var CERT_DIR = join28(process.cwd(), ".absolutejs");
20124
+ var CERT_PATH = join28(CERT_DIR, "cert.pem");
20125
+ var KEY_PATH = join28(CERT_DIR, "key.pem");
20077
20126
  var CERT_VALIDITY_DAYS = 365;
20078
20127
  var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
20079
20128
  var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
@@ -26691,5 +26740,5 @@ export {
26691
26740
  ANGULAR_INIT_TIMEOUT_MS
26692
26741
  };
26693
26742
 
26694
- //# debugId=AEA253A7A1AF353364756E2164756E21
26743
+ //# debugId=6E3DD50B655058AD64756E2164756E21
26695
26744
  //# sourceMappingURL=index.js.map