@absolutejs/absolute 0.19.0-beta.847 → 0.19.0-beta.848

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
@@ -615,12 +615,42 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
615
615
  code: await compileStyleSource(path, content, language, config)
616
616
  };
617
617
  }
618
- }), compileStyleFileIfNeeded = async (filePath, config) => {
618
+ }), CSS_IMPORT_PATTERN, resolveCssImportsAsync = async (content, baseDir, visited) => {
619
+ const matches = Array.from(content.matchAll(CSS_IMPORT_PATTERN));
620
+ if (matches.length === 0)
621
+ return content;
622
+ let cursor = 0;
623
+ const parts = [];
624
+ for (const match of matches) {
625
+ const importPath = match[1];
626
+ if (importPath === undefined)
627
+ continue;
628
+ const start = match.index ?? 0;
629
+ const end = start + match[0].length;
630
+ parts.push(content.slice(cursor, start));
631
+ const fullPath = isAbsolute(importPath) ? importPath : resolve2(baseDir, importPath);
632
+ if (visited.has(fullPath) || !existsSync3(fullPath)) {
633
+ parts.push(visited.has(fullPath) ? "" : match[0]);
634
+ cursor = end;
635
+ continue;
636
+ }
637
+ const nextVisited = new Set(visited);
638
+ nextVisited.add(fullPath);
639
+ const imported = await readFile(fullPath, "utf-8");
640
+ parts.push(await resolveCssImportsAsync(imported, dirname2(fullPath), nextVisited));
641
+ cursor = end;
642
+ }
643
+ parts.push(content.slice(cursor));
644
+ return parts.join("");
645
+ }, compileStyleFileIfNeeded = async (filePath, config) => {
619
646
  if (!isPreprocessableStylePath(filePath)) {
620
- return runPostcss(await readFile(filePath, "utf-8"), filePath, config);
647
+ const raw = await readFile(filePath, "utf-8");
648
+ const processed = await runPostcss(raw, filePath, config);
649
+ return resolveCssImportsAsync(processed, dirname2(filePath), new Set([filePath]));
621
650
  }
622
- return compileStyleSource(filePath, undefined, undefined, config);
623
- }, CSS_IMPORT_PATTERN, resolveCssImportsSync = (content, baseDir, visited) => {
651
+ const compiled = await compileStyleSource(filePath, undefined, undefined, config);
652
+ return resolveCssImportsAsync(compiled, dirname2(filePath), new Set([filePath]));
653
+ }, resolveCssImportsSync = (content, baseDir, visited) => {
624
654
  return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
625
655
  const fullPath = isAbsolute(importPath) ? importPath : resolve2(baseDir, importPath);
626
656
  if (visited.has(fullPath))
@@ -9815,35 +9845,42 @@ var init_cleanStaleOutputs = __esm(() => {
9815
9845
  HASHED_FILE_PATTERN = /\.[a-f0-9]{8,}\.\w+$/;
9816
9846
  });
9817
9847
 
9848
+ // src/utils/generatedDir.ts
9849
+ var exports_generatedDir = {};
9850
+ __export(exports_generatedDir, {
9851
+ getGeneratedRoot: () => getGeneratedRoot,
9852
+ getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
9853
+ });
9854
+ import { join as join13 } from "path";
9855
+ var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) => join13(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME), getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join13(getGeneratedRoot(projectRoot), framework);
9856
+ var init_generatedDir = () => {};
9857
+
9818
9858
  // src/utils/cleanup.ts
9819
9859
  import { rm as rm3 } from "fs/promises";
9820
- import { join as join13 } from "path";
9821
- var cleanup = async ({
9860
+ import { join as join14 } from "path";
9861
+ var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), cleanFramework = (framework, frameworkDir) => {
9862
+ const tasks = [
9863
+ removeIfExists(getFrameworkGeneratedDir(framework))
9864
+ ];
9865
+ if (frameworkDir)
9866
+ tasks.push(removeIfExists(join14(frameworkDir, "generated")));
9867
+ return Promise.all(tasks);
9868
+ }, cleanup = async ({
9822
9869
  angularDir,
9823
9870
  reactDir,
9824
9871
  svelteDir,
9825
9872
  vueDir
9826
9873
  }) => {
9827
9874
  await Promise.all([
9828
- angularDir ? rm3(join13(angularDir, "generated"), {
9829
- force: true,
9830
- recursive: true
9831
- }) : undefined,
9832
- reactDir ? rm3(join13(reactDir, "generated"), {
9833
- force: true,
9834
- recursive: true
9835
- }) : undefined,
9836
- svelteDir ? rm3(join13(svelteDir, "generated"), {
9837
- force: true,
9838
- recursive: true
9839
- }) : undefined,
9840
- vueDir ? rm3(join13(vueDir, "generated"), {
9841
- force: true,
9842
- recursive: true
9843
- }) : undefined
9875
+ cleanFramework("angular", angularDir),
9876
+ cleanFramework("react", reactDir),
9877
+ cleanFramework("svelte", svelteDir),
9878
+ cleanFramework("vue", vueDir)
9844
9879
  ]);
9845
9880
  };
9846
- var init_cleanup = () => {};
9881
+ var init_cleanup = __esm(() => {
9882
+ init_generatedDir();
9883
+ });
9847
9884
 
9848
9885
  // src/utils/commonAncestor.ts
9849
9886
  var exports_commonAncestor = {};
@@ -9864,7 +9901,7 @@ var init_commonAncestor = () => {};
9864
9901
 
9865
9902
  // src/utils/buildDirectoryLock.ts
9866
9903
  import { mkdirSync as mkdirSync6, unlinkSync, writeFileSync as writeFileSync7, readFileSync as readFileSync12 } from "fs";
9867
- import { dirname as dirname10, join as join14 } from "path";
9904
+ import { dirname as dirname10, join as join15 } from "path";
9868
9905
  var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
9869
9906
  if (exitHandlersRegistered)
9870
9907
  return;
@@ -9890,7 +9927,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
9890
9927
  releaseAllSync();
9891
9928
  throw err;
9892
9929
  });
9893
- }, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join14(dirname10(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
9930
+ }, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join15(dirname10(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
9894
9931
  `).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
9895
9932
  if (locks.size === 0) {
9896
9933
  delete process.env[HELD_LOCKS_ENV];
@@ -10105,7 +10142,7 @@ import { existsSync as existsSync15 } from "fs";
10105
10142
  import { mkdir as mkdir3, stat as stat2 } from "fs/promises";
10106
10143
  import {
10107
10144
  dirname as dirname11,
10108
- join as join15,
10145
+ join as join16,
10109
10146
  basename as basename5,
10110
10147
  extname as extname5,
10111
10148
  resolve as resolve17,
@@ -10164,14 +10201,14 @@ var resolveDevClientDir2 = () => {
10164
10201
  `${basePath}.svelte`,
10165
10202
  `${basePath}.svelte.ts`,
10166
10203
  `${basePath}.svelte.js`,
10167
- join15(basePath, "index.ts"),
10168
- join15(basePath, "index.js"),
10169
- join15(basePath, "index.mjs"),
10170
- join15(basePath, "index.cjs"),
10171
- join15(basePath, "index.json"),
10172
- join15(basePath, "index.svelte"),
10173
- join15(basePath, "index.svelte.ts"),
10174
- join15(basePath, "index.svelte.js")
10204
+ join16(basePath, "index.ts"),
10205
+ join16(basePath, "index.js"),
10206
+ join16(basePath, "index.mjs"),
10207
+ join16(basePath, "index.cjs"),
10208
+ join16(basePath, "index.json"),
10209
+ join16(basePath, "index.svelte"),
10210
+ join16(basePath, "index.svelte.ts"),
10211
+ join16(basePath, "index.svelte.js")
10175
10212
  ];
10176
10213
  const checks = await Promise.all(candidates.map(exists));
10177
10214
  return candidates.find((_2, index) => checks[index]) ?? null;
@@ -10209,10 +10246,10 @@ var resolveDevClientDir2 = () => {
10209
10246
  });
10210
10247
  }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
10211
10248
  const { compile, compileModule, preprocess } = await import("svelte/compiler");
10212
- const generatedDir = join15(svelteRoot, "generated");
10213
- const clientDir = join15(generatedDir, "client");
10214
- const indexDir = join15(generatedDir, "indexes");
10215
- const serverDir = join15(generatedDir, "server");
10249
+ const generatedDir = getFrameworkGeneratedDir("svelte");
10250
+ const clientDir = join16(generatedDir, "client");
10251
+ const indexDir = join16(generatedDir, "indexes");
10252
+ const serverDir = join16(generatedDir, "server");
10216
10253
  await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir3(dir, { recursive: true })));
10217
10254
  const dev = env2.NODE_ENV !== "production";
10218
10255
  const build2 = async (src) => {
@@ -10250,8 +10287,8 @@ var resolveDevClientDir2 = () => {
10250
10287
  const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
10251
10288
  const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
10252
10289
  const externalRewrites = new Map;
10253
- const ssrOutputDir = dirname11(join15(serverDir, relDir, `${baseName}.js`));
10254
- const clientOutputDir = dirname11(join15(clientDir, relDir, `${baseName}.js`));
10290
+ const ssrOutputDir = dirname11(join16(serverDir, relDir, `${baseName}.js`));
10291
+ const clientOutputDir = dirname11(join16(clientDir, relDir, `${baseName}.js`));
10255
10292
  for (let idx = 0;idx < importPaths.length; idx++) {
10256
10293
  const rawSpec = importPaths[idx];
10257
10294
  if (!rawSpec)
@@ -10316,8 +10353,8 @@ var resolveDevClientDir2 = () => {
10316
10353
  code += islandMetadataExports;
10317
10354
  return code;
10318
10355
  };
10319
- const ssrPath = join15(serverDir, relDir, `${baseName}.js`);
10320
- const clientPath = join15(clientDir, relDir, `${baseName}.js`);
10356
+ const ssrPath = join16(serverDir, relDir, `${baseName}.js`);
10357
+ const clientPath = join16(clientDir, relDir, `${baseName}.js`);
10321
10358
  await Promise.all([
10322
10359
  mkdir3(dirname11(ssrPath), { recursive: true }),
10323
10360
  mkdir3(dirname11(clientPath), { recursive: true })
@@ -10349,7 +10386,7 @@ var resolveDevClientDir2 = () => {
10349
10386
  await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
10350
10387
  const relClientDir = dirname11(relative7(clientDir, client2));
10351
10388
  const name = basename5(client2, extname5(client2));
10352
- const indexPath = join15(indexDir, relClientDir, `${name}.js`);
10389
+ const indexPath = join16(indexDir, relClientDir, `${name}.js`);
10353
10390
  const importRaw = relative7(dirname11(indexPath), client2).split(sep2).join("/");
10354
10391
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
10355
10392
  const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
@@ -10428,7 +10465,7 @@ if (typeof window !== "undefined") {
10428
10465
  svelteClientPaths: roots.map(({ client: client2 }) => client2),
10429
10466
  svelteIndexPaths: roots.map(({ client: client2 }) => {
10430
10467
  const rel = dirname11(relative7(clientDir, client2));
10431
- return join15(indexDir, rel, basename5(client2));
10468
+ return join16(indexDir, rel, basename5(client2));
10432
10469
  }),
10433
10470
  svelteServerPaths: roots.map(({ ssr }) => ssr)
10434
10471
  };
@@ -10436,13 +10473,14 @@ if (typeof window !== "undefined") {
10436
10473
  var init_compileSvelte = __esm(() => {
10437
10474
  init_constants();
10438
10475
  init_resolvePackageImport();
10476
+ init_generatedDir();
10439
10477
  init_sourceMetadata();
10440
10478
  init_stylePreprocessor();
10441
10479
  init_lowerIslandSyntax();
10442
10480
  init_lowerAwaitSlotSyntax();
10443
10481
  init_renderToReadableStream();
10444
10482
  devClientDir2 = resolveDevClientDir2();
10445
- hmrClientPath3 = join15(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
10483
+ hmrClientPath3 = join16(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
10446
10484
  persistentCache = new Map;
10447
10485
  sourceHashCache = new Map;
10448
10486
  transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
@@ -10514,7 +10552,7 @@ import {
10514
10552
  basename as basename6,
10515
10553
  dirname as dirname12,
10516
10554
  isAbsolute as isAbsolute3,
10517
- join as join16,
10555
+ join as join17,
10518
10556
  relative as relative8,
10519
10557
  resolve as resolve18
10520
10558
  } from "path";
@@ -10689,7 +10727,7 @@ var resolveDevClientDir3 = () => {
10689
10727
  ];
10690
10728
  let cssOutputPaths = [];
10691
10729
  if (isEntryPoint && allCss.length) {
10692
- const cssOutputFile = join16(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
10730
+ const cssOutputFile = join17(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
10693
10731
  await mkdir4(dirname12(cssOutputFile), { recursive: true });
10694
10732
  await write2(cssOutputFile, allCss.join(`
10695
10733
  `));
@@ -10720,8 +10758,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10720
10758
  };
10721
10759
  const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
10722
10760
  const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
10723
- const clientOutputPath = join16(outputDirs.client, `${relativeWithoutExtension}.js`);
10724
- const serverOutputPath = join16(outputDirs.server, `${relativeWithoutExtension}.js`);
10761
+ const clientOutputPath = join17(outputDirs.client, `${relativeWithoutExtension}.js`);
10762
+ const serverOutputPath = join17(outputDirs.server, `${relativeWithoutExtension}.js`);
10725
10763
  const relDir = dirname12(relativeFilePath);
10726
10764
  const relDepth = relDir === "." ? 0 : relDir.split("/").length;
10727
10765
  const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
@@ -10761,11 +10799,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10761
10799
  return result;
10762
10800
  }, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors) => {
10763
10801
  const compiler = await import("@vue/compiler-sfc");
10764
- const generatedDir = join16(vueRootDir, "generated");
10765
- const clientOutputDir = join16(generatedDir, "client");
10766
- const indexOutputDir = join16(generatedDir, "indexes");
10767
- const serverOutputDir = join16(generatedDir, "server");
10768
- const cssOutputDir = join16(generatedDir, "compiled");
10802
+ const generatedDir = getFrameworkGeneratedDir("vue");
10803
+ const clientOutputDir = join17(generatedDir, "client");
10804
+ const indexOutputDir = join17(generatedDir, "indexes");
10805
+ const serverOutputDir = join17(generatedDir, "server");
10806
+ const cssOutputDir = join17(generatedDir, "compiled");
10769
10807
  await Promise.all([
10770
10808
  mkdir4(clientOutputDir, { recursive: true }),
10771
10809
  mkdir4(indexOutputDir, { recursive: true }),
@@ -10782,8 +10820,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10782
10820
  }, buildCache, true, vueRootDir, compiler, stylePreprocessors);
10783
10821
  result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
10784
10822
  const entryBaseName = basename6(entryPath, ".vue");
10785
- const indexOutputFile = join16(indexOutputDir, `${entryBaseName}.js`);
10786
- const clientOutputFile = join16(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
10823
+ const indexOutputFile = join17(indexOutputDir, `${entryBaseName}.js`);
10824
+ const clientOutputFile = join17(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
10787
10825
  await mkdir4(dirname12(indexOutputFile), { recursive: true });
10788
10826
  const vueHmrImports = isDev2 ? [
10789
10827
  `window.__HMR_FRAMEWORK__ = "vue";`,
@@ -10936,8 +10974,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10936
10974
  const sourceCode = await file3(tsPath).text();
10937
10975
  const transpiledCode = transpiler3.transformSync(sourceCode);
10938
10976
  const relativeJsPath = relative8(vueRootDir, tsPath).replace(/\.ts$/, ".js");
10939
- const outClientPath = join16(clientOutputDir, relativeJsPath);
10940
- const outServerPath = join16(serverOutputDir, relativeJsPath);
10977
+ const outClientPath = join17(clientOutputDir, relativeJsPath);
10978
+ const outServerPath = join17(serverOutputDir, relativeJsPath);
10941
10979
  await mkdir4(dirname12(outClientPath), { recursive: true });
10942
10980
  await mkdir4(dirname12(outServerPath), { recursive: true });
10943
10981
  await write2(outClientPath, transpiledCode);
@@ -10953,12 +10991,13 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
10953
10991
  };
10954
10992
  var init_compileVue = __esm(() => {
10955
10993
  init_constants();
10994
+ init_generatedDir();
10956
10995
  init_resolvePackageImport();
10957
10996
  init_sourceMetadata();
10958
10997
  init_vueAutoRouterTransform();
10959
10998
  init_stylePreprocessor();
10960
10999
  devClientDir3 = resolveDevClientDir3();
10961
- hmrClientPath4 = join16(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
11000
+ hmrClientPath4 = join17(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
10962
11001
  transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
10963
11002
  scriptCache = new Map;
10964
11003
  scriptSetupCache = new Map;
@@ -11439,7 +11478,7 @@ __export(exports_compileAngular, {
11439
11478
  compileAngular: () => compileAngular
11440
11479
  });
11441
11480
  import { existsSync as existsSync17, readFileSync as readFileSync13, promises as fs } from "fs";
11442
- import { join as join17, basename as basename7, sep as sep3, dirname as dirname13, resolve as resolve19, relative as relative9 } from "path";
11481
+ import { join as join18, basename as basename7, sep as sep3, dirname as dirname13, resolve as resolve19, relative as relative9 } from "path";
11443
11482
  import ts2 from "typescript";
11444
11483
  var traceAngularPhase = async (name, fn2, metadata2) => {
11445
11484
  const tracePhase = globalThis.__absoluteBuildTracePhase;
@@ -11481,10 +11520,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
11481
11520
  `${candidate}.tsx`,
11482
11521
  `${candidate}.js`,
11483
11522
  `${candidate}.jsx`,
11484
- join17(candidate, "index.ts"),
11485
- join17(candidate, "index.tsx"),
11486
- join17(candidate, "index.js"),
11487
- join17(candidate, "index.jsx")
11523
+ join18(candidate, "index.ts"),
11524
+ join18(candidate, "index.tsx"),
11525
+ join18(candidate, "index.js"),
11526
+ join18(candidate, "index.jsx")
11488
11527
  ];
11489
11528
  return candidates.find((file4) => existsSync17(file4));
11490
11529
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
@@ -11673,10 +11712,10 @@ ${registrations}
11673
11712
  `${basePath}.tsx`,
11674
11713
  `${basePath}.mts`,
11675
11714
  `${basePath}.cts`,
11676
- join17(basePath, "index.ts"),
11677
- join17(basePath, "index.tsx"),
11678
- join17(basePath, "index.mts"),
11679
- join17(basePath, "index.cts")
11715
+ join18(basePath, "index.ts"),
11716
+ join18(basePath, "index.tsx"),
11717
+ join18(basePath, "index.mts"),
11718
+ join18(basePath, "index.cts")
11680
11719
  ];
11681
11720
  return candidates.map((candidate) => resolve19(candidate)).find((candidate) => existsSync17(candidate) && !candidate.endsWith(".d.ts")) ?? null;
11682
11721
  }, readFileForAotTransform = async (fileName, readFile5) => {
@@ -11702,15 +11741,15 @@ ${registrations}
11702
11741
  const paths = [];
11703
11742
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
11704
11743
  if (templateUrlMatch?.[1])
11705
- paths.push(join17(fileDir, templateUrlMatch[1]));
11744
+ paths.push(join18(fileDir, templateUrlMatch[1]));
11706
11745
  const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
11707
11746
  if (styleUrlMatch?.[1])
11708
- paths.push(join17(fileDir, styleUrlMatch[1]));
11747
+ paths.push(join18(fileDir, styleUrlMatch[1]));
11709
11748
  const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
11710
11749
  const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
11711
11750
  if (urlMatches) {
11712
11751
  for (const urlMatch of urlMatches) {
11713
- paths.push(join17(fileDir, urlMatch.replace(/['"]/g, "")));
11752
+ paths.push(join18(fileDir, urlMatch.replace(/['"]/g, "")));
11714
11753
  }
11715
11754
  }
11716
11755
  return paths.map((path) => resolve19(path));
@@ -11744,7 +11783,7 @@ ${registrations}
11744
11783
  safeStableStringify(stylePreprocessors ?? null)
11745
11784
  ].join("\x00");
11746
11785
  const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
11747
- return join17(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
11786
+ return join18(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
11748
11787
  }, precomputeAotResourceTransforms = async (inputPaths, readFile5, stylePreprocessors) => {
11749
11788
  const transformedSources = new Map;
11750
11789
  const visited = new Set;
@@ -11790,7 +11829,7 @@ ${registrations}
11790
11829
  return { stats, transformedSources };
11791
11830
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
11792
11831
  const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
11793
- const outputPath = resolve19(join17(outDir, relative9(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
11832
+ const outputPath = resolve19(join18(outDir, relative9(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
11794
11833
  return [
11795
11834
  outputPath,
11796
11835
  buildIslandMetadataExports(readFileSync13(inputPath, "utf-8"))
@@ -11837,7 +11876,7 @@ ${registrations}
11837
11876
  const originalGetSourceFile = host.getSourceFile;
11838
11877
  host.getSourceFile = (fileName, languageVersion, onError) => {
11839
11878
  if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
11840
- const resolvedPath = join17(tsLibDir, fileName);
11879
+ const resolvedPath = join18(tsLibDir, fileName);
11841
11880
  return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
11842
11881
  }
11843
11882
  return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
@@ -11892,7 +11931,7 @@ ${registrations}
11892
11931
  const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
11893
11932
  const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
11894
11933
  content,
11895
- target: join17(outDir, fileName)
11934
+ target: join18(outDir, fileName)
11896
11935
  }));
11897
11936
  const outputFiles = new Set(rawEntries.map(({ target }) => resolve19(target)));
11898
11937
  return rawEntries.map(({ content, target }) => {
@@ -12067,7 +12106,7 @@ ${fields}
12067
12106
  }, inlineTemplateAndLowerDefer = async (source, fileDir) => {
12068
12107
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
12069
12108
  if (templateUrlMatch?.[1]) {
12070
- const templatePath = join17(fileDir, templateUrlMatch[1]);
12109
+ const templatePath = join18(fileDir, templateUrlMatch[1]);
12071
12110
  if (!existsSync17(templatePath)) {
12072
12111
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
12073
12112
  }
@@ -12098,7 +12137,7 @@ ${fields}
12098
12137
  }, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
12099
12138
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
12100
12139
  if (templateUrlMatch?.[1]) {
12101
- const templatePath = join17(fileDir, templateUrlMatch[1]);
12140
+ const templatePath = join18(fileDir, templateUrlMatch[1]);
12102
12141
  if (!existsSync17(templatePath)) {
12103
12142
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
12104
12143
  }
@@ -12135,7 +12174,7 @@ ${fields}
12135
12174
  return source;
12136
12175
  const stylePromises = urlMatches.map((urlMatch) => {
12137
12176
  const styleUrl = urlMatch.replace(/['"]/g, "");
12138
- return readAndEscapeFile(join17(fileDir, styleUrl), stylePreprocessors);
12177
+ return readAndEscapeFile(join18(fileDir, styleUrl), stylePreprocessors);
12139
12178
  });
12140
12179
  const results = await Promise.all(stylePromises);
12141
12180
  const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
@@ -12146,7 +12185,7 @@ ${fields}
12146
12185
  const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
12147
12186
  if (!styleUrlMatch?.[1])
12148
12187
  return source;
12149
- const escaped = await readAndEscapeFile(join17(fileDir, styleUrlMatch[1]), stylePreprocessors);
12188
+ const escaped = await readAndEscapeFile(join18(fileDir, styleUrlMatch[1]), stylePreprocessors);
12150
12189
  if (!escaped)
12151
12190
  return source;
12152
12191
  return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
@@ -12181,10 +12220,10 @@ ${fields}
12181
12220
  `${candidate}.tsx`,
12182
12221
  `${candidate}.js`,
12183
12222
  `${candidate}.jsx`,
12184
- join17(candidate, "index.ts"),
12185
- join17(candidate, "index.tsx"),
12186
- join17(candidate, "index.js"),
12187
- join17(candidate, "index.jsx")
12223
+ join18(candidate, "index.ts"),
12224
+ join18(candidate, "index.tsx"),
12225
+ join18(candidate, "index.js"),
12226
+ join18(candidate, "index.jsx")
12188
12227
  ];
12189
12228
  return candidates.find((file4) => existsSync17(file4));
12190
12229
  };
@@ -12211,7 +12250,7 @@ ${fields}
12211
12250
  const inputDir = dirname13(sourcePath);
12212
12251
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
12213
12252
  const fileBase = basename7(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
12214
- return join17(outDir, relativeDir, fileBase);
12253
+ return join18(outDir, relativeDir, fileBase);
12215
12254
  };
12216
12255
  const withCacheBuster = (specifier) => {
12217
12256
  if (!cacheBuster)
@@ -12269,7 +12308,7 @@ ${fields}
12269
12308
  const inputDir = dirname13(actualPath);
12270
12309
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
12271
12310
  const fileBase = basename7(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
12272
- const targetDir = join17(outDir, relativeDir);
12311
+ const targetDir = join18(outDir, relativeDir);
12273
12312
  const targetPath = toOutputPath(actualPath);
12274
12313
  const localImports = [];
12275
12314
  const importRewrites = new Map;
@@ -12323,13 +12362,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12323
12362
  }
12324
12363
  return allOutputs;
12325
12364
  }, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
12326
- const compiledParent = join17(outRoot, "generated");
12365
+ const compiledParent = getFrameworkGeneratedDir("angular");
12327
12366
  if (entryPoints.length === 0) {
12328
12367
  const emptyPaths = [];
12329
12368
  return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
12330
12369
  }
12331
12370
  const compiledRoot = compiledParent;
12332
- const indexesDir = join17(compiledParent, "indexes");
12371
+ const indexesDir = join18(compiledParent, "indexes");
12333
12372
  await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
12334
12373
  const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve19(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
12335
12374
  const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
@@ -12343,9 +12382,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12343
12382
  const fileBase = basename7(resolvedEntry).replace(/\.[tj]s$/, "");
12344
12383
  const jsName = `${fileBase}.js`;
12345
12384
  const compiledFallbackPaths = [
12346
- join17(compiledRoot, relativeEntry),
12347
- join17(compiledRoot, "pages", jsName),
12348
- join17(compiledRoot, jsName)
12385
+ join18(compiledRoot, relativeEntry),
12386
+ join18(compiledRoot, "pages", jsName),
12387
+ join18(compiledRoot, jsName)
12349
12388
  ].map((file4) => resolve19(file4));
12350
12389
  const resolveRawServerFile = (candidatePaths) => {
12351
12390
  const normalizedCandidates = [
@@ -12390,7 +12429,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12390
12429
  const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
12391
12430
  const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
12392
12431
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
12393
- const clientFile = join17(indexesDir, jsName);
12432
+ const clientFile = join18(indexesDir, jsName);
12394
12433
  if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync17(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
12395
12434
  return {
12396
12435
  clientPath: clientFile,
@@ -12625,9 +12664,10 @@ var init_compileAngular = __esm(() => {
12625
12664
  init_sourceMetadata();
12626
12665
  init_lowerDeferSyntax();
12627
12666
  init_stylePreprocessor();
12667
+ init_generatedDir();
12628
12668
  devClientDir4 = resolveDevClientDir4();
12629
- hmrClientPath5 = join17(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
12630
- hmrRuntimePath = join17(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
12669
+ hmrClientPath5 = join18(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
12670
+ hmrRuntimePath = join18(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
12631
12671
  jitContentCache = new Map;
12632
12672
  wrapperOutputCache = new Map;
12633
12673
  });
@@ -13081,7 +13121,7 @@ __export(exports_compileEmber, {
13081
13121
  });
13082
13122
  import { existsSync as existsSync18 } from "fs";
13083
13123
  import { mkdir as mkdir5, rm as rm4 } from "fs/promises";
13084
- import { basename as basename8, dirname as dirname14, extname as extname6, join as join18, resolve as resolve20 } from "path";
13124
+ import { basename as basename8, dirname as dirname14, extname as extname6, join as join19, resolve as resolve20 } from "path";
13085
13125
  var {build: bunBuild2, Transpiler: Transpiler3, write: write3, file: file4 } = globalThis.Bun;
13086
13126
  var cachedPreprocessor = null, getPreprocessor = async () => {
13087
13127
  if (cachedPreprocessor)
@@ -13200,7 +13240,7 @@ export const importSync = (specifier) => {
13200
13240
  build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
13201
13241
  if (standalonePackages.has(args.path))
13202
13242
  return;
13203
- const internal = join18(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
13243
+ const internal = join19(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
13204
13244
  if (existsSync18(internal))
13205
13245
  return { path: internal };
13206
13246
  return;
@@ -13248,16 +13288,16 @@ export default PageComponent;
13248
13288
  }
13249
13289
  const transpiled = transpiler4.transformSync(preprocessed);
13250
13290
  const baseName = basename8(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
13251
- const tmpDir = join18(compiledRoot, "_tmp");
13252
- const serverDir = join18(compiledRoot, "server");
13253
- const clientDir = join18(compiledRoot, "client");
13291
+ const tmpDir = join19(compiledRoot, "_tmp");
13292
+ const serverDir = join19(compiledRoot, "server");
13293
+ const clientDir = join19(compiledRoot, "client");
13254
13294
  await Promise.all([
13255
13295
  mkdir5(tmpDir, { recursive: true }),
13256
13296
  mkdir5(serverDir, { recursive: true }),
13257
13297
  mkdir5(clientDir, { recursive: true })
13258
13298
  ]);
13259
- const tmpPagePath = resolve20(join18(tmpDir, `${baseName}.module.js`));
13260
- const tmpHarnessPath = resolve20(join18(tmpDir, `${baseName}.harness.js`));
13299
+ const tmpPagePath = resolve20(join19(tmpDir, `${baseName}.module.js`));
13300
+ const tmpHarnessPath = resolve20(join19(tmpDir, `${baseName}.harness.js`));
13261
13301
  await Promise.all([
13262
13302
  write3(tmpPagePath, transpiled),
13263
13303
  write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
@@ -13265,7 +13305,7 @@ export default PageComponent;
13265
13305
  const stagedSourceMap = new Map([
13266
13306
  [tmpPagePath, resolvedEntry]
13267
13307
  ]);
13268
- const serverPath = join18(serverDir, `${baseName}.js`);
13308
+ const serverPath = join19(serverDir, `${baseName}.js`);
13269
13309
  const buildResult = await bunBuild2({
13270
13310
  entrypoints: [tmpHarnessPath],
13271
13311
  format: "esm",
@@ -13282,7 +13322,7 @@ export default PageComponent;
13282
13322
  console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
13283
13323
  }
13284
13324
  await rm4(tmpDir, { force: true, recursive: true });
13285
- const clientPath = join18(clientDir, `${baseName}.js`);
13325
+ const clientPath = join19(clientDir, `${baseName}.js`);
13286
13326
  await write3(clientPath, transpiled);
13287
13327
  return { clientPath, serverPath };
13288
13328
  }, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
@@ -13292,7 +13332,7 @@ export default PageComponent;
13292
13332
  serverPaths: []
13293
13333
  };
13294
13334
  }
13295
- const compiledRoot = join18(emberDir, "generated");
13335
+ const compiledRoot = getFrameworkGeneratedDir("ember");
13296
13336
  const outputs = await Promise.all(entries.map((entry) => compileEmberFile(entry, compiledRoot, cwd)));
13297
13337
  return {
13298
13338
  clientPaths: outputs.map((o) => o.clientPath),
@@ -13310,8 +13350,9 @@ export default PageComponent;
13310
13350
  preprocessed = rewriteTemplateEvalToScope(result.code);
13311
13351
  }
13312
13352
  return transpiler4.transformSync(preprocessed);
13313
- }, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (emberDir) => join18(emberDir, "generated"), getEmberServerCompiledDir = (emberDir) => join18(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join18(getEmberCompiledRoot(emberDir), "client");
13353
+ }, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join19(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join19(getEmberCompiledRoot(emberDir), "client");
13314
13354
  var init_compileEmber = __esm(() => {
13355
+ init_generatedDir();
13315
13356
  transpiler4 = new Transpiler3({
13316
13357
  loader: "ts",
13317
13358
  target: "browser",
@@ -13331,7 +13372,7 @@ __export(exports_buildReactVendor, {
13331
13372
  buildReactVendor: () => buildReactVendor
13332
13373
  });
13333
13374
  import { existsSync as existsSync19, mkdirSync as mkdirSync7 } from "fs";
13334
- import { join as join19, resolve as resolve21 } from "path";
13375
+ import { join as join20, resolve as resolve21 } from "path";
13335
13376
  import { rm as rm5 } from "fs/promises";
13336
13377
  var {build: bunBuild3 } = globalThis.Bun;
13337
13378
  var resolveJsxDevRuntimeCompatPath = () => {
@@ -13385,14 +13426,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
13385
13426
  `)}
13386
13427
  `;
13387
13428
  }, buildReactVendor = async (buildDir) => {
13388
- const vendorDir = join19(buildDir, "react", "vendor");
13429
+ const vendorDir = join20(buildDir, "react", "vendor");
13389
13430
  mkdirSync7(vendorDir, { recursive: true });
13390
- const tmpDir = join19(buildDir, "_vendor_tmp");
13431
+ const tmpDir = join20(buildDir, "_vendor_tmp");
13391
13432
  mkdirSync7(tmpDir, { recursive: true });
13392
13433
  const specifiers = resolveVendorSpecifiers();
13393
13434
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
13394
13435
  const safeName = toSafeFileName(specifier);
13395
- const entryPath = join19(tmpDir, `${safeName}.ts`);
13436
+ const entryPath = join20(tmpDir, `${safeName}.ts`);
13396
13437
  const source = await generateEntrySource(specifier);
13397
13438
  await Bun.write(entryPath, source);
13398
13439
  return entryPath;
@@ -13457,7 +13498,7 @@ __export(exports_buildAngularVendor, {
13457
13498
  buildAngularServerVendor: () => buildAngularServerVendor
13458
13499
  });
13459
13500
  import { mkdirSync as mkdirSync8 } from "fs";
13460
- import { join as join20 } from "path";
13501
+ import { join as join21 } from "path";
13461
13502
  import { rm as rm6 } from "fs/promises";
13462
13503
  var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
13463
13504
  var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
@@ -13554,14 +13595,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
13554
13595
  await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
13555
13596
  return Array.from(angular).filter(isResolvable2);
13556
13597
  }, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
13557
- const vendorDir = join20(buildDir, "angular", "vendor");
13598
+ const vendorDir = join21(buildDir, "angular", "vendor");
13558
13599
  mkdirSync8(vendorDir, { recursive: true });
13559
- const tmpDir = join20(buildDir, "_angular_vendor_tmp");
13600
+ const tmpDir = join21(buildDir, "_angular_vendor_tmp");
13560
13601
  mkdirSync8(tmpDir, { recursive: true });
13561
13602
  const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
13562
13603
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
13563
13604
  const safeName = toSafeFileName2(specifier);
13564
- const entryPath = join20(tmpDir, `${safeName}.ts`);
13605
+ const entryPath = join21(tmpDir, `${safeName}.ts`);
13565
13606
  await Bun.write(entryPath, await generateVendorEntrySource(specifier));
13566
13607
  return entryPath;
13567
13608
  }));
@@ -13592,9 +13633,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
13592
13633
  const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
13593
13634
  return computeAngularVendorPaths(specifiers);
13594
13635
  }, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
13595
- const vendorDir = join20(buildDir, "angular", "vendor", "server");
13636
+ const vendorDir = join21(buildDir, "angular", "vendor", "server");
13596
13637
  mkdirSync8(vendorDir, { recursive: true });
13597
- const tmpDir = join20(buildDir, "_angular_server_vendor_tmp");
13638
+ const tmpDir = join21(buildDir, "_angular_server_vendor_tmp");
13598
13639
  mkdirSync8(tmpDir, { recursive: true });
13599
13640
  const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
13600
13641
  const allSpecs = new Set(browserSpecs);
@@ -13605,7 +13646,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
13605
13646
  const specifiers = Array.from(allSpecs);
13606
13647
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
13607
13648
  const safeName = toSafeFileName2(specifier);
13608
- const entryPath = join20(tmpDir, `${safeName}.ts`);
13649
+ const entryPath = join21(tmpDir, `${safeName}.ts`);
13609
13650
  await Bun.write(entryPath, await generateVendorEntrySource(specifier));
13610
13651
  return entryPath;
13611
13652
  }));
@@ -13627,9 +13668,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
13627
13668
  return specifiers;
13628
13669
  }, computeAngularServerVendorPaths = (buildDir, specifiers) => {
13629
13670
  const paths = {};
13630
- const vendorDir = join20(buildDir, "angular", "vendor", "server");
13671
+ const vendorDir = join21(buildDir, "angular", "vendor", "server");
13631
13672
  for (const specifier of specifiers) {
13632
- paths[specifier] = join20(vendorDir, `${toSafeFileName2(specifier)}.js`);
13673
+ paths[specifier] = join21(vendorDir, `${toSafeFileName2(specifier)}.js`);
13633
13674
  }
13634
13675
  return paths;
13635
13676
  }, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
@@ -13685,17 +13726,17 @@ __export(exports_buildVueVendor, {
13685
13726
  buildVueVendor: () => buildVueVendor
13686
13727
  });
13687
13728
  import { mkdirSync as mkdirSync9 } from "fs";
13688
- import { join as join21 } from "path";
13729
+ import { join as join22 } from "path";
13689
13730
  import { rm as rm7 } from "fs/promises";
13690
13731
  var {build: bunBuild5 } = globalThis.Bun;
13691
13732
  var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
13692
- const vendorDir = join21(buildDir, "vue", "vendor");
13733
+ const vendorDir = join22(buildDir, "vue", "vendor");
13693
13734
  mkdirSync9(vendorDir, { recursive: true });
13694
- const tmpDir = join21(buildDir, "_vue_vendor_tmp");
13735
+ const tmpDir = join22(buildDir, "_vue_vendor_tmp");
13695
13736
  mkdirSync9(tmpDir, { recursive: true });
13696
13737
  const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
13697
13738
  const safeName = toSafeFileName3(specifier);
13698
- const entryPath = join21(tmpDir, `${safeName}.ts`);
13739
+ const entryPath = join22(tmpDir, `${safeName}.ts`);
13699
13740
  await Bun.write(entryPath, `export * from '${specifier}';
13700
13741
  `);
13701
13742
  return entryPath;
@@ -13723,7 +13764,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
13723
13764
  const { readFileSync: readFileSync14, writeFileSync: writeFileSync8, readdirSync } = await import("fs");
13724
13765
  const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
13725
13766
  for (const file5 of files) {
13726
- const filePath = join21(vendorDir, file5);
13767
+ const filePath = join22(vendorDir, file5);
13727
13768
  const content = readFileSync14(filePath, "utf-8");
13728
13769
  if (!content.includes("__VUE_HMR_RUNTIME__"))
13729
13770
  continue;
@@ -13750,7 +13791,7 @@ __export(exports_buildSvelteVendor, {
13750
13791
  buildSvelteVendor: () => buildSvelteVendor
13751
13792
  });
13752
13793
  import { mkdirSync as mkdirSync10 } from "fs";
13753
- import { join as join22 } from "path";
13794
+ import { join as join23 } from "path";
13754
13795
  import { rm as rm8 } from "fs/promises";
13755
13796
  var {build: bunBuild6 } = globalThis.Bun;
13756
13797
  var svelteSpecifiers, isResolvable3 = (specifier) => {
@@ -13764,13 +13805,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
13764
13805
  const specifiers = resolveVendorSpecifiers2();
13765
13806
  if (specifiers.length === 0)
13766
13807
  return;
13767
- const vendorDir = join22(buildDir, "svelte", "vendor");
13808
+ const vendorDir = join23(buildDir, "svelte", "vendor");
13768
13809
  mkdirSync10(vendorDir, { recursive: true });
13769
- const tmpDir = join22(buildDir, "_svelte_vendor_tmp");
13810
+ const tmpDir = join23(buildDir, "_svelte_vendor_tmp");
13770
13811
  mkdirSync10(tmpDir, { recursive: true });
13771
13812
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
13772
13813
  const safeName = toSafeFileName4(specifier);
13773
- const entryPath = join22(tmpDir, `${safeName}.ts`);
13814
+ const entryPath = join23(tmpDir, `${safeName}.ts`);
13774
13815
  await Bun.write(entryPath, `export * from '${specifier}';
13775
13816
  `);
13776
13817
  return entryPath;
@@ -13820,7 +13861,7 @@ __export(exports_rewriteImportsPlugin, {
13820
13861
  buildWithImportRewrite: () => buildWithImportRewrite
13821
13862
  });
13822
13863
  import { readdir as readdir3 } from "fs/promises";
13823
- import { join as join23 } from "path";
13864
+ import { join as join24 } from "path";
13824
13865
  var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
13825
13866
  let result = content;
13826
13867
  for (const [specifier, webPath] of replacements) {
@@ -13949,7 +13990,7 @@ ${content}`;
13949
13990
  const entries = await readdir3(dir);
13950
13991
  for (const entry of entries) {
13951
13992
  if (entry.endsWith(".js"))
13952
- allFiles.push(join23(dir, entry));
13993
+ allFiles.push(join24(dir, entry));
13953
13994
  }
13954
13995
  } catch {}
13955
13996
  }
@@ -13998,7 +14039,7 @@ import {
13998
14039
  statSync,
13999
14040
  writeFileSync as writeFileSync8
14000
14041
  } from "fs";
14001
- import { basename as basename9, dirname as dirname15, extname as extname7, join as join24, relative as relative10, resolve as resolve22 } from "path";
14042
+ import { basename as basename9, dirname as dirname15, extname as extname7, join as join25, relative as relative10, resolve as resolve22 } from "path";
14002
14043
  import { cwd, env as env3, exit } from "process";
14003
14044
  var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
14004
14045
  var isDev2, isBuildTraceEnabled = () => {
@@ -14076,8 +14117,8 @@ var isDev2, isBuildTraceEnabled = () => {
14076
14117
  mkdirSync11(htmxDestDir, { recursive: true });
14077
14118
  const glob = new Glob7("htmx*.min.js");
14078
14119
  for (const relPath of glob.scanSync({ cwd: htmxDir })) {
14079
- const src = join24(htmxDir, relPath);
14080
- const dest = join24(htmxDestDir, "htmx.min.js");
14120
+ const src = join25(htmxDir, relPath);
14121
+ const dest = join25(htmxDestDir, "htmx.min.js");
14081
14122
  copyFileSync(src, dest);
14082
14123
  return;
14083
14124
  }
@@ -14152,7 +14193,7 @@ var isDev2, isBuildTraceEnabled = () => {
14152
14193
  vuePagesPath
14153
14194
  }) => {
14154
14195
  const { readdirSync: readDir } = await import("fs");
14155
- const devIndexDir = join24(buildPath, "_src_indexes");
14196
+ const devIndexDir = join25(buildPath, "_src_indexes");
14156
14197
  mkdirSync11(devIndexDir, { recursive: true });
14157
14198
  if (reactIndexesPath && reactPagesPath) {
14158
14199
  copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
@@ -14170,35 +14211,35 @@ var isDev2, isBuildTraceEnabled = () => {
14170
14211
  const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
14171
14212
  const pagesRel = relative10(process.cwd(), resolve22(reactPagesPath)).replace(/\\/g, "/");
14172
14213
  for (const file5 of indexFiles) {
14173
- let content = readFileSync14(join24(reactIndexesPath, file5), "utf-8");
14214
+ let content = readFileSync14(join25(reactIndexesPath, file5), "utf-8");
14174
14215
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
14175
- writeFileSync8(join24(devIndexDir, file5), content);
14216
+ writeFileSync8(join25(devIndexDir, file5), content);
14176
14217
  }
14177
14218
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
14178
- const svelteIndexDir = join24(svelteDir, "generated", "indexes");
14219
+ const svelteIndexDir = join25(getFrameworkGeneratedDir("svelte"), "indexes");
14179
14220
  const sveltePageEntries = svelteEntries.filter((file5) => resolve22(file5).startsWith(resolve22(sveltePagesPath)));
14180
14221
  for (const entry of sveltePageEntries) {
14181
14222
  const name = basename9(entry).replace(/\.svelte(\.(ts|js))?$/, "");
14182
- const indexFile = join24(svelteIndexDir, "pages", `${name}.js`);
14223
+ const indexFile = join25(svelteIndexDir, "pages", `${name}.js`);
14183
14224
  if (!existsSync20(indexFile))
14184
14225
  continue;
14185
14226
  let content = readFileSync14(indexFile, "utf-8");
14186
14227
  const srcRel = relative10(process.cwd(), resolve22(entry)).replace(/\\/g, "/");
14187
14228
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
14188
- writeFileSync8(join24(devIndexDir, `${name}.svelte.js`), content);
14229
+ writeFileSync8(join25(devIndexDir, `${name}.svelte.js`), content);
14189
14230
  }
14190
14231
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
14191
- const vueIndexDir = join24(vueDir, "generated", "indexes");
14232
+ const vueIndexDir = join25(getFrameworkGeneratedDir("vue"), "indexes");
14192
14233
  const vuePageEntries = vueEntries.filter((file5) => resolve22(file5).startsWith(resolve22(vuePagesPath)));
14193
14234
  for (const entry of vuePageEntries) {
14194
14235
  const name = basename9(entry, ".vue");
14195
- const indexFile = join24(vueIndexDir, `${name}.js`);
14236
+ const indexFile = join25(vueIndexDir, `${name}.js`);
14196
14237
  if (!existsSync20(indexFile))
14197
14238
  continue;
14198
14239
  let content = readFileSync14(indexFile, "utf-8");
14199
14240
  const srcRel = relative10(process.cwd(), resolve22(entry)).replace(/\\/g, "/");
14200
14241
  content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
14201
- writeFileSync8(join24(devIndexDir, `${name}.vue.js`), content);
14242
+ writeFileSync8(join25(devIndexDir, `${name}.vue.js`), content);
14202
14243
  }
14203
14244
  }, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
14204
14245
  const varIdx = content.indexOf(`var ${firstUseName} =`);
@@ -14420,10 +14461,10 @@ ${content.slice(firstUseIdx)}`;
14420
14461
  restoreTracePhase();
14421
14462
  return;
14422
14463
  }
14423
- const traceDir = join24(buildPath2, ".absolute-trace");
14464
+ const traceDir = join25(buildPath2, ".absolute-trace");
14424
14465
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
14425
14466
  mkdirSync11(traceDir, { recursive: true });
14426
- writeFileSync8(join24(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
14467
+ writeFileSync8(join25(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
14427
14468
  events: traceEvents,
14428
14469
  frameworks: traceFrameworkNames,
14429
14470
  generatedAt: new Date().toISOString(),
@@ -14454,15 +14495,15 @@ ${content.slice(firstUseIdx)}`;
14454
14495
  const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
14455
14496
  const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
14456
14497
  const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
14457
- const reactIndexesPath = reactDir && join24(reactDir, "generated", "indexes");
14458
- const reactPagesPath = reactDir && join24(reactDir, "pages");
14459
- const htmlPagesPath = htmlDir && join24(htmlDir, "pages");
14460
- const htmlScriptsPath = htmlDir && join24(htmlDir, "scripts");
14461
- const sveltePagesPath = svelteDir && join24(svelteDir, "pages");
14462
- const vuePagesPath = vueDir && join24(vueDir, "pages");
14463
- const htmxPagesPath = htmxDir && join24(htmxDir, "pages");
14464
- const angularPagesPath = angularDir && join24(angularDir, "pages");
14465
- const emberPagesPath = emberDir && join24(emberDir, "pages");
14498
+ const reactIndexesPath = reactDir && join25(getFrameworkGeneratedDir("react"), "indexes");
14499
+ const reactPagesPath = reactDir && join25(reactDir, "pages");
14500
+ const htmlPagesPath = htmlDir && join25(htmlDir, "pages");
14501
+ const htmlScriptsPath = htmlDir && join25(htmlDir, "scripts");
14502
+ const sveltePagesPath = svelteDir && join25(svelteDir, "pages");
14503
+ const vuePagesPath = vueDir && join25(vueDir, "pages");
14504
+ const htmxPagesPath = htmxDir && join25(htmxDir, "pages");
14505
+ const angularPagesPath = angularDir && join25(angularDir, "pages");
14506
+ const emberPagesPath = emberDir && join25(emberDir, "pages");
14466
14507
  const frontends = [
14467
14508
  reactDir,
14468
14509
  htmlDir,
@@ -14489,36 +14530,40 @@ ${content.slice(firstUseIdx)}`;
14489
14530
  mode: mode ?? (isDev2 ? "development" : "production"),
14490
14531
  tailwind: Boolean(tailwind)
14491
14532
  });
14533
+ const generatedRoot = getGeneratedRoot(projectRoot);
14492
14534
  const sourceClientRoots = [
14493
- reactDir,
14494
- svelteDir,
14495
14535
  htmlDir,
14496
- vueDir,
14497
- angularDir,
14536
+ htmxDir,
14498
14537
  islandBootstrapPath && dirname15(islandBootstrapPath)
14499
14538
  ].filter((dir) => Boolean(dir));
14500
- const clientRoot = isSingle ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
14539
+ const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
14540
+ if (usesGenerated)
14541
+ sourceClientRoots.push(generatedRoot);
14542
+ const clientRoot = sourceClientRoots.length === 1 ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
14501
14543
  const serverDirMap = [];
14502
14544
  if (svelteDir)
14503
14545
  serverDirMap.push({
14504
- dir: svelteDir,
14505
- subdir: join24("generated", "server")
14546
+ dir: getFrameworkGeneratedDir("svelte", projectRoot),
14547
+ subdir: "server"
14506
14548
  });
14507
14549
  if (vueDir)
14508
14550
  serverDirMap.push({
14509
- dir: vueDir,
14510
- subdir: join24("generated", "server")
14551
+ dir: getFrameworkGeneratedDir("vue", projectRoot),
14552
+ subdir: "server"
14511
14553
  });
14512
14554
  if (angularDir)
14513
- serverDirMap.push({ dir: angularDir, subdir: "generated" });
14555
+ serverDirMap.push({
14556
+ dir: getFrameworkGeneratedDir("angular", projectRoot),
14557
+ subdir: ""
14558
+ });
14514
14559
  let serverOutDir;
14515
14560
  let serverRoot;
14516
14561
  if (serverDirMap.length === 1) {
14517
14562
  const [firstEntry] = serverDirMap;
14518
14563
  if (!firstEntry)
14519
14564
  throw new Error("Expected at least one server directory entry");
14520
- serverRoot = join24(firstEntry.dir, firstEntry.subdir);
14521
- serverOutDir = join24(buildPath, basename9(firstEntry.dir));
14565
+ serverRoot = join25(firstEntry.dir, firstEntry.subdir);
14566
+ serverOutDir = join25(buildPath, basename9(firstEntry.dir));
14522
14567
  } else if (serverDirMap.length > 1) {
14523
14568
  serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
14524
14569
  serverOutDir = buildPath;
@@ -14546,7 +14591,7 @@ ${content.slice(firstUseIdx)}`;
14546
14591
  await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
14547
14592
  }
14548
14593
  if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
14549
- await tracePhase("assets/copy", () => cpSync(assetsPath, join24(buildPath, "assets"), {
14594
+ await tracePhase("assets/copy", () => cpSync(assetsPath, join25(buildPath, "assets"), {
14550
14595
  force: true,
14551
14596
  recursive: true
14552
14597
  }));
@@ -14600,7 +14645,7 @@ ${content.slice(firstUseIdx)}`;
14600
14645
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
14601
14646
  if (entry.startsWith(resolve22(reactIndexesPath))) {
14602
14647
  const pageName = basename9(entry, ".tsx");
14603
- return join24(reactPagesPath, `${pageName}.tsx`);
14648
+ return join25(reactPagesPath, `${pageName}.tsx`);
14604
14649
  }
14605
14650
  return null;
14606
14651
  }) : allReactEntries;
@@ -14704,7 +14749,7 @@ ${content.slice(firstUseIdx)}`;
14704
14749
  const compileReactConventions = async () => {
14705
14750
  if (reactConventionSources.length === 0)
14706
14751
  return emptyStringArray;
14707
- const destDir = join24(buildPath, "conventions", "react");
14752
+ const destDir = join25(buildPath, "conventions", "react");
14708
14753
  rmSync2(destDir, { force: true, recursive: true });
14709
14754
  mkdirSync11(destDir, { recursive: true });
14710
14755
  const destPaths = [];
@@ -14748,7 +14793,7 @@ ${content.slice(firstUseIdx)}`;
14748
14793
  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 }
14749
14794
  ]);
14750
14795
  const bundleConventionFiles = async (framework, compiledPaths) => {
14751
- const destDir = join24(buildPath, "conventions", framework);
14796
+ const destDir = join25(buildPath, "conventions", framework);
14752
14797
  rmSync2(destDir, { force: true, recursive: true });
14753
14798
  mkdirSync11(destDir, { recursive: true });
14754
14799
  const destPaths = [];
@@ -14821,7 +14866,7 @@ ${content.slice(firstUseIdx)}`;
14821
14866
  }
14822
14867
  })) : {
14823
14868
  entries: [],
14824
- generatedRoot: join24(buildPath, "_island_entries")
14869
+ generatedRoot: join25(buildPath, "_island_entries")
14825
14870
  };
14826
14871
  const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
14827
14872
  if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
@@ -14857,7 +14902,7 @@ ${content.slice(firstUseIdx)}`;
14857
14902
  return {};
14858
14903
  }
14859
14904
  if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
14860
- const refreshEntry = join24(reactIndexesPath, "_refresh.tsx");
14905
+ const refreshEntry = join25(reactIndexesPath, "_refresh.tsx");
14861
14906
  if (!reactClientEntryPoints.includes(refreshEntry))
14862
14907
  reactClientEntryPoints.push(refreshEntry);
14863
14908
  }
@@ -14956,19 +15001,19 @@ ${content.slice(firstUseIdx)}`;
14956
15001
  throw: false
14957
15002
  }, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
14958
15003
  if (reactDir && reactClientEntryPoints.length > 0) {
14959
- rmSync2(join24(buildPath, "react", "generated", "indexes"), {
15004
+ rmSync2(join25(buildPath, "react", "generated", "indexes"), {
14960
15005
  force: true,
14961
15006
  recursive: true
14962
15007
  });
14963
15008
  }
14964
15009
  if (angularDir && angularClientPaths.length > 0) {
14965
- rmSync2(join24(buildPath, "angular", "indexes"), {
15010
+ rmSync2(join25(buildPath, "angular", "indexes"), {
14966
15011
  force: true,
14967
15012
  recursive: true
14968
15013
  });
14969
15014
  }
14970
15015
  if (islandClientEntryPoints.length > 0) {
14971
- rmSync2(join24(buildPath, "islands"), {
15016
+ rmSync2(join25(buildPath, "islands"), {
14972
15017
  force: true,
14973
15018
  recursive: true
14974
15019
  });
@@ -15037,7 +15082,7 @@ ${content.slice(firstUseIdx)}`;
15037
15082
  globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
15038
15083
  entrypoints: globalCssEntries,
15039
15084
  naming: `[dir]/[name].[hash].[ext]`,
15040
- outdir: stylesDir ? join24(buildPath, basename9(stylesDir)) : buildPath,
15085
+ outdir: stylesDir ? join25(buildPath, basename9(stylesDir)) : buildPath,
15041
15086
  plugins: [stylePreprocessorPlugin2],
15042
15087
  root: stylesDir || clientRoot,
15043
15088
  target: "browser",
@@ -15046,7 +15091,7 @@ ${content.slice(firstUseIdx)}`;
15046
15091
  vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
15047
15092
  entrypoints: vueCssPaths,
15048
15093
  naming: `[name].[hash].[ext]`,
15049
- outdir: join24(buildPath, assetsPath ? basename9(assetsPath) : "assets", "css"),
15094
+ outdir: join25(buildPath, assetsPath ? basename9(assetsPath) : "assets", "css"),
15050
15095
  target: "browser",
15051
15096
  throw: false
15052
15097
  }, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
@@ -15197,7 +15242,7 @@ ${content.slice(firstUseIdx)}`;
15197
15242
  const processHtmlPages = async () => {
15198
15243
  if (!(htmlDir && htmlPagesPath))
15199
15244
  return;
15200
- const outputHtmlPages = isSingle ? join24(buildPath, "pages") : join24(buildPath, basename9(htmlDir), "pages");
15245
+ const outputHtmlPages = isSingle ? join25(buildPath, "pages") : join25(buildPath, basename9(htmlDir), "pages");
15201
15246
  mkdirSync11(outputHtmlPages, { recursive: true });
15202
15247
  cpSync(htmlPagesPath, outputHtmlPages, {
15203
15248
  force: true,
@@ -15219,14 +15264,14 @@ ${content.slice(firstUseIdx)}`;
15219
15264
  const processHtmxPages = async () => {
15220
15265
  if (!(htmxDir && htmxPagesPath))
15221
15266
  return;
15222
- const outputHtmxPages = isSingle ? join24(buildPath, "pages") : join24(buildPath, basename9(htmxDir), "pages");
15267
+ const outputHtmxPages = isSingle ? join25(buildPath, "pages") : join25(buildPath, basename9(htmxDir), "pages");
15223
15268
  mkdirSync11(outputHtmxPages, { recursive: true });
15224
15269
  cpSync(htmxPagesPath, outputHtmxPages, {
15225
15270
  force: true,
15226
15271
  recursive: true
15227
15272
  });
15228
15273
  if (shouldCopyHtmx) {
15229
- const htmxDestDir = isSingle ? buildPath : join24(buildPath, basename9(htmxDir));
15274
+ const htmxDestDir = isSingle ? buildPath : join25(buildPath, basename9(htmxDir));
15230
15275
  copyHtmxVendor(htmxDir, htmxDestDir);
15231
15276
  }
15232
15277
  if (shouldUpdateHtmxAssetPaths) {
@@ -15287,9 +15332,9 @@ ${content.slice(firstUseIdx)}`;
15287
15332
  writeBuildTrace(buildPath);
15288
15333
  return { conventions: conventionsMap, manifest };
15289
15334
  }
15290
- writeFileSync8(join24(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
15335
+ writeFileSync8(join25(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
15291
15336
  if (Object.keys(conventionsMap).length > 0) {
15292
- writeFileSync8(join24(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
15337
+ writeFileSync8(join25(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
15293
15338
  }
15294
15339
  writeBuildTrace(buildPath);
15295
15340
  if (tailwind && mode === "production") {
@@ -15324,6 +15369,7 @@ var init_build = __esm(() => {
15324
15369
  init_cleanStaleOutputs();
15325
15370
  init_cleanup();
15326
15371
  init_commonAncestor();
15372
+ init_generatedDir();
15327
15373
  init_buildDirectoryLock();
15328
15374
  init_logger();
15329
15375
  init_validateSafePath();
@@ -15387,7 +15433,7 @@ var init_build = __esm(() => {
15387
15433
 
15388
15434
  // src/build/buildEmberVendor.ts
15389
15435
  import { mkdirSync as mkdirSync12, existsSync as existsSync21 } from "fs";
15390
- import { join as join25 } from "path";
15436
+ import { join as join26 } from "path";
15391
15437
  import { rm as rm9 } from "fs/promises";
15392
15438
  var {build: bunBuild8 } = globalThis.Bun;
15393
15439
  var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
@@ -15439,7 +15485,7 @@ export const importSync = (specifier) => {
15439
15485
  if (standaloneSpecifiers.has(specifier)) {
15440
15486
  return { resolveTo: specifier, specifier };
15441
15487
  }
15442
- const emberInternalPath = join25(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
15488
+ const emberInternalPath = join26(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
15443
15489
  if (!existsSync21(emberInternalPath)) {
15444
15490
  throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
15445
15491
  }
@@ -15471,7 +15517,7 @@ export const importSync = (specifier) => {
15471
15517
  if (standalonePackages.has(args.path)) {
15472
15518
  return;
15473
15519
  }
15474
- const internal = join25(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
15520
+ const internal = join26(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
15475
15521
  if (existsSync21(internal)) {
15476
15522
  return { path: internal };
15477
15523
  }
@@ -15479,16 +15525,16 @@ export const importSync = (specifier) => {
15479
15525
  });
15480
15526
  }
15481
15527
  }), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
15482
- const vendorDir = join25(buildDir, "ember", "vendor");
15528
+ const vendorDir = join26(buildDir, "ember", "vendor");
15483
15529
  mkdirSync12(vendorDir, { recursive: true });
15484
- const tmpDir = join25(buildDir, "_ember_vendor_tmp");
15530
+ const tmpDir = join26(buildDir, "_ember_vendor_tmp");
15485
15531
  mkdirSync12(tmpDir, { recursive: true });
15486
- const macrosShimPath = join25(tmpDir, "embroider_macros_shim.js");
15532
+ const macrosShimPath = join26(tmpDir, "embroider_macros_shim.js");
15487
15533
  await Bun.write(macrosShimPath, generateMacrosShim());
15488
15534
  const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
15489
15535
  const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
15490
15536
  const safeName = toSafeFileName5(resolution.specifier);
15491
- const entryPath = join25(tmpDir, `${safeName}.js`);
15537
+ const entryPath = join26(tmpDir, `${safeName}.js`);
15492
15538
  const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
15493
15539
  ` : generateVendorEntrySource2(resolution);
15494
15540
  await Bun.write(entryPath, source);
@@ -16022,7 +16068,7 @@ var init_pathUtils = __esm(() => {
16022
16068
  // src/dev/fileWatcher.ts
16023
16069
  import { watch } from "fs";
16024
16070
  import { existsSync as existsSync24 } from "fs";
16025
- import { join as join26, resolve as resolve26 } from "path";
16071
+ import { join as join27, resolve as resolve26 } from "path";
16026
16072
  var safeRemoveFromGraph = (graph, fullPath) => {
16027
16073
  try {
16028
16074
  removeFileFromGraph(graph, fullPath);
@@ -16049,7 +16095,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
16049
16095
  if (shouldSkipFilename(filename, isStylesDir)) {
16050
16096
  return;
16051
16097
  }
16052
- const fullPath = join26(absolutePath, filename).replace(/\\/g, "/");
16098
+ const fullPath = join27(absolutePath, filename).replace(/\\/g, "/");
16053
16099
  if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
16054
16100
  return;
16055
16101
  }
@@ -16744,7 +16790,7 @@ __export(exports_moduleServer, {
16744
16790
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
16745
16791
  });
16746
16792
  import { existsSync as existsSync25, readFileSync as readFileSync18, statSync as statSync2 } from "fs";
16747
- import { basename as basename12, dirname as dirname16, extname as extname8, join as join27, resolve as resolve30, relative as relative11 } from "path";
16793
+ import { basename as basename12, dirname as dirname16, extname as extname8, join as join28, resolve as resolve30, relative as relative11 } from "path";
16748
16794
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
16749
16795
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
16750
16796
  const allExports = [];
@@ -16814,7 +16860,7 @@ ${stubs}
16814
16860
  const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
16815
16861
  if (!subpath) {
16816
16862
  const pkgDir = resolve30(projectRoot, "node_modules", packageName ?? "");
16817
- const pkgJsonPath = join27(pkgDir, "package.json");
16863
+ const pkgJsonPath = join28(pkgDir, "package.json");
16818
16864
  if (existsSync25(pkgJsonPath)) {
16819
16865
  const pkg = JSON.parse(readFileSync18(pkgJsonPath, "utf-8"));
16820
16866
  const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
@@ -18034,15 +18080,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
18034
18080
  });
18035
18081
  return Array.from(resolvedPages);
18036
18082
  }, computeClientRoot = async (resolvedPaths) => {
18083
+ const { getGeneratedRoot: getGeneratedRoot2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
18084
+ const projectRoot = process.cwd();
18037
18085
  const clientRoots = [
18038
- resolvedPaths.reactDir,
18039
- resolvedPaths.svelteDir,
18040
18086
  resolvedPaths.htmlDir,
18041
- resolvedPaths.vueDir,
18042
- resolvedPaths.angularDir
18087
+ resolvedPaths.htmxDir
18043
18088
  ].filter((dir) => Boolean(dir));
18089
+ const usesGenerated = Boolean(resolvedPaths.reactDir) || Boolean(resolvedPaths.svelteDir) || Boolean(resolvedPaths.vueDir) || Boolean(resolvedPaths.angularDir);
18090
+ if (usesGenerated)
18091
+ clientRoots.push(getGeneratedRoot2(projectRoot));
18044
18092
  const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
18045
- return clientRoots.length === 1 ? clientRoots[0] ?? process.cwd() : commonAncestor2(clientRoots, process.cwd());
18093
+ return clientRoots.length === 1 ? clientRoots[0] ?? projectRoot : commonAncestor2(clientRoots, projectRoot);
18046
18094
  }, updateServerManifestEntry = (state, artifact) => {
18047
18095
  const fileWithHash = basename13(artifact.path);
18048
18096
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
@@ -18287,7 +18335,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
18287
18335
  const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
18288
18336
  const serverEntries = [...svelteServerPaths];
18289
18337
  const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
18290
- const serverRoot = resolve33(svelteDir, "generated", "server");
18338
+ const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
18339
+ const serverRoot = resolve33(getFrameworkGeneratedDir2("svelte"), "server");
18291
18340
  const serverOutDir = resolve33(buildDir, basename13(svelteDir));
18292
18341
  const [serverResult, clientResult] = await Promise.all([
18293
18342
  serverEntries.length > 0 ? bunBuild9({
@@ -19299,7 +19348,7 @@ __export(exports_buildDepVendor, {
19299
19348
  buildDepVendor: () => buildDepVendor
19300
19349
  });
19301
19350
  import { mkdirSync as mkdirSync13 } from "fs";
19302
- import { join as join28 } from "path";
19351
+ import { join as join29 } from "path";
19303
19352
  import { rm as rm10 } from "fs/promises";
19304
19353
  var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
19305
19354
  var toSafeFileName6 = (specifier) => {
@@ -19410,7 +19459,7 @@ var toSafeFileName6 = (specifier) => {
19410
19459
  }), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
19411
19460
  const entries = await Promise.all(specifiers.map(async (specifier) => {
19412
19461
  const safeName = toSafeFileName6(specifier);
19413
- const entryPath = join28(tmpDir, `${safeName}.ts`);
19462
+ const entryPath = join29(tmpDir, `${safeName}.ts`);
19414
19463
  await Bun.write(entryPath, await generateVendorEntrySource(specifier));
19415
19464
  return { entryPath, specifier };
19416
19465
  }));
@@ -19471,9 +19520,9 @@ var toSafeFileName6 = (specifier) => {
19471
19520
  const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
19472
19521
  if (initialSpecs.length === 0 && frameworkRoots.length === 0)
19473
19522
  return {};
19474
- const vendorDir = join28(buildDir, "vendor");
19523
+ const vendorDir = join29(buildDir, "vendor");
19475
19524
  mkdirSync13(vendorDir, { recursive: true });
19476
- const tmpDir = join28(buildDir, "_dep_vendor_tmp");
19525
+ const tmpDir = join29(buildDir, "_dep_vendor_tmp");
19477
19526
  mkdirSync13(tmpDir, { recursive: true });
19478
19527
  const allSpecs = new Set(initialSpecs);
19479
19528
  const alreadyScanned = new Set;
@@ -20052,12 +20101,12 @@ __export(exports_devtoolsJson, {
20052
20101
  devtoolsJson: () => devtoolsJson
20053
20102
  });
20054
20103
  import { existsSync as existsSync27, mkdirSync as mkdirSync14, readFileSync as readFileSync19, writeFileSync as writeFileSync9 } from "fs";
20055
- import { dirname as dirname18, join as join29, resolve as resolve35 } from "path";
20104
+ import { dirname as dirname18, join as join30, resolve as resolve35 } from "path";
20056
20105
  import { Elysia as Elysia3 } from "elysia";
20057
20106
  var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
20058
20107
  Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
20059
20108
  return uuid;
20060
- }, 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) => resolve35(uuidCachePath ?? join29(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
20109
+ }, 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) => resolve35(uuidCachePath ?? join30(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
20061
20110
  if (!existsSync27(cachePath))
20062
20111
  return null;
20063
20112
  try {
@@ -20096,11 +20145,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
20096
20145
  if (process.env.WSL_DISTRO_NAME) {
20097
20146
  const distro = process.env.WSL_DISTRO_NAME;
20098
20147
  const withoutLeadingSlash = root.replace(/^\//, "");
20099
- return join29("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
20148
+ return join30("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
20100
20149
  }
20101
20150
  if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
20102
20151
  const withoutLeadingSlash = root.replace(/^\//, "");
20103
- return join29("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
20152
+ return join30("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
20104
20153
  }
20105
20154
  return root;
20106
20155
  };
@@ -20417,7 +20466,7 @@ __export(exports_prerender, {
20417
20466
  PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
20418
20467
  });
20419
20468
  import { mkdirSync as mkdirSync15, readFileSync as readFileSync20 } from "fs";
20420
- import { join as join30 } from "path";
20469
+ import { join as join31 } from "path";
20421
20470
  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) => {
20422
20471
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
20423
20472
  await Bun.write(metaPath, String(Date.now()));
@@ -20483,7 +20532,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
20483
20532
  return false;
20484
20533
  const html = await res.text();
20485
20534
  const fileName = routeToFilename(route);
20486
- const filePath = join30(prerenderDir, fileName);
20535
+ const filePath = join31(prerenderDir, fileName);
20487
20536
  await Bun.write(filePath, html);
20488
20537
  await writeTimestamp(filePath);
20489
20538
  return true;
@@ -20509,13 +20558,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
20509
20558
  }
20510
20559
  const html = await res.text();
20511
20560
  const fileName = routeToFilename(route);
20512
- const filePath = join30(prerenderDir, fileName);
20561
+ const filePath = join31(prerenderDir, fileName);
20513
20562
  await Bun.write(filePath, html);
20514
20563
  await writeTimestamp(filePath);
20515
20564
  result.routes.set(route, filePath);
20516
20565
  log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
20517
20566
  }, prerender = async (port, outDir, staticConfig, log2) => {
20518
- const prerenderDir = join30(outDir, "_prerendered");
20567
+ const prerenderDir = join31(outDir, "_prerendered");
20519
20568
  mkdirSync15(prerenderDir, { recursive: true });
20520
20569
  const baseUrl = `http://localhost:${port}`;
20521
20570
  let routes;
@@ -21112,7 +21161,7 @@ var handleHTMXPageRequest = async (pagePath) => {
21112
21161
  };
21113
21162
  // src/core/prepare.ts
21114
21163
  import { existsSync as existsSync29, readdirSync, readFileSync as readFileSync21 } from "fs";
21115
- import { basename as basename14, join as join31, relative as relative13, resolve as resolve37 } from "path";
21164
+ import { basename as basename14, join as join32, relative as relative13, resolve as resolve37 } from "path";
21116
21165
  import { Elysia as Elysia5 } from "elysia";
21117
21166
 
21118
21167
  // src/utils/loadConfig.ts
@@ -21693,7 +21742,7 @@ var loadPrerenderMap = (prerenderDir) => {
21693
21742
  continue;
21694
21743
  const name = basename14(entry, ".html");
21695
21744
  const route = name === "index" ? "/" : `/${name}`;
21696
- map.set(route, join31(prerenderDir, entry));
21745
+ map.set(route, join32(prerenderDir, entry));
21697
21746
  }
21698
21747
  return map;
21699
21748
  };
@@ -21742,7 +21791,7 @@ var prepare = async (configOrPath) => {
21742
21791
  setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
21743
21792
  recordStep("load production manifest and island metadata", stepStartedAt);
21744
21793
  stepStartedAt = performance.now();
21745
- const conventionsPath = join31(buildDir, "conventions.json");
21794
+ const conventionsPath = join32(buildDir, "conventions.json");
21746
21795
  if (existsSync29(conventionsPath)) {
21747
21796
  const conventions2 = JSON.parse(readFileSync21(conventionsPath, "utf-8"));
21748
21797
  setConventions(conventions2);
@@ -21758,7 +21807,7 @@ var prepare = async (configOrPath) => {
21758
21807
  });
21759
21808
  recordStep("create static plugin", stepStartedAt);
21760
21809
  stepStartedAt = performance.now();
21761
- const prerenderDir = join31(buildDir, "_prerendered");
21810
+ const prerenderDir = join32(buildDir, "_prerendered");
21762
21811
  const prerenderMap = loadPrerenderMap(prerenderDir);
21763
21812
  recordStep("load prerender map", stepStartedAt);
21764
21813
  if (prerenderMap.size > 0) {
@@ -21817,10 +21866,10 @@ var {env: env4 } = globalThis.Bun;
21817
21866
 
21818
21867
  // src/dev/devCert.ts
21819
21868
  import { existsSync as existsSync30, mkdirSync as mkdirSync16, readFileSync as readFileSync22, rmSync as rmSync3 } from "fs";
21820
- import { join as join32 } from "path";
21821
- var CERT_DIR = join32(process.cwd(), ".absolutejs");
21822
- var CERT_PATH = join32(CERT_DIR, "cert.pem");
21823
- var KEY_PATH = join32(CERT_DIR, "key.pem");
21869
+ import { join as join33 } from "path";
21870
+ var CERT_DIR = join33(process.cwd(), ".absolutejs");
21871
+ var CERT_PATH = join33(CERT_DIR, "cert.pem");
21872
+ var KEY_PATH = join33(CERT_DIR, "key.pem");
21824
21873
  var CERT_VALIDITY_DAYS = 365;
21825
21874
  var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
21826
21875
  var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
@@ -28438,5 +28487,5 @@ export {
28438
28487
  ANGULAR_INIT_TIMEOUT_MS
28439
28488
  };
28440
28489
 
28441
- //# debugId=570E7C55E9A2645364756E2164756E21
28490
+ //# debugId=D12AF094146BC5F864756E2164756E21
28442
28491
  //# sourceMappingURL=index.js.map