@absolutejs/absolute 0.19.0-beta.948 → 0.19.0-beta.949

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  2. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  3. package/dist/angular/index.js +38 -21
  4. package/dist/angular/index.js.map +5 -6
  5. package/dist/angular/server.js +38 -21
  6. package/dist/angular/server.js.map +5 -6
  7. package/dist/build.js +812 -358
  8. package/dist/build.js.map +16 -16
  9. package/dist/cli/index.js +206 -50
  10. package/dist/client/index.js +2 -2
  11. package/dist/client/index.js.map +2 -2
  12. package/dist/index.js +1108 -449
  13. package/dist/index.js.map +18 -18
  14. package/dist/islands/index.js +2 -2
  15. package/dist/islands/index.js.map +2 -2
  16. package/dist/react/index.js +2 -27
  17. package/dist/react/index.js.map +4 -5
  18. package/dist/react/server.js +1 -26
  19. package/dist/react/server.js.map +4 -5
  20. package/dist/src/angular/pageHandler.d.ts +0 -1
  21. package/dist/src/build/compileAngular.d.ts +1 -0
  22. package/dist/src/build/compileTailwind.d.ts +4 -3
  23. package/dist/src/build/tailwindCompiler.d.ts +2 -2
  24. package/dist/src/core/devBuild.d.ts +17 -0
  25. package/dist/src/dev/serverEntryWatcher.d.ts +4 -0
  26. package/dist/src/react/pageHandler.d.ts +0 -1
  27. package/dist/src/svelte/pageHandler.d.ts +0 -1
  28. package/dist/src/vue/pageHandler.d.ts +0 -1
  29. package/dist/svelte/index.js +2 -25
  30. package/dist/svelte/index.js.map +4 -5
  31. package/dist/svelte/server.js +1 -24
  32. package/dist/svelte/server.js.map +4 -5
  33. package/dist/types/globals.d.ts +19 -0
  34. package/dist/vue/index.js +2 -25
  35. package/dist/vue/index.js.map +4 -5
  36. package/dist/vue/server.js +1 -24
  37. package/dist/vue/server.js.map +4 -5
  38. package/package.json +1 -1
  39. package/dist/src/core/ssrCache.d.ts +0 -3
package/dist/build.js CHANGED
@@ -2189,7 +2189,7 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
2189
2189
  value: propValue
2190
2190
  })).filter((entry) => entry.token).map((entry) => ({ provide: entry.token, useValue: entry.value }));
2191
2191
  return [...providers, ...propProviders];
2192
- }, clearSelectorCache = () => selectorCache.clear(), isInjectionToken = (value) => {
2192
+ }, isInjectionToken = (value) => {
2193
2193
  if (!value || typeof value !== "object") {
2194
2194
  return false;
2195
2195
  }
@@ -8934,13 +8934,17 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
8934
8934
  const path = id.startsWith(".") || isAbsolute2(id) ? resolve9(base, id) : Bun.resolveSync(id, base);
8935
8935
  const module = await import(path);
8936
8936
  return { base: dirname5(path), module, path };
8937
- }, buildCompilerEntry = async (cssPath) => {
8937
+ }, buildCompilerEntry = async (cssPath, extraSources = []) => {
8938
8938
  const compile = await loadTailwindCompile();
8939
8939
  const absPath = resolve9(cssPath);
8940
- const css = await readFile2(absPath, "utf-8");
8940
+ const userCss = await readFile2(absPath, "utf-8");
8941
8941
  const cssMtimeMs = (await stat(absPath)).mtimeMs;
8942
8942
  const cssDependencies = new Map;
8943
8943
  cssDependencies.set(absPath, cssMtimeMs);
8944
+ const sourceDirectives = extraSources.map((pattern) => `@source ${JSON.stringify(pattern)};`).join(`
8945
+ `);
8946
+ const css = sourceDirectives ? `${sourceDirectives}
8947
+ ${userCss}` : userCss;
8944
8948
  const compiler = await compile(css, {
8945
8949
  base: dirname5(absPath),
8946
8950
  loadModule,
@@ -9062,12 +9066,12 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
9062
9066
  });
9063
9067
  const results = await Promise.all(checks);
9064
9068
  return results.some(Boolean);
9065
- }, getCompilerEntry = async (cssPath) => {
9069
+ }, getCompilerEntry = async (cssPath, extraSources = []) => {
9066
9070
  const key = resolve9(cssPath);
9067
9071
  const cached = compilerCache.get(key);
9068
9072
  if (cached && !await isCompilerStale(cached))
9069
9073
  return cached;
9070
- const fresh = await buildCompilerEntry(cssPath);
9074
+ const fresh = await buildCompilerEntry(cssPath, extraSources);
9071
9075
  await populateCandidatesFromAllSources(fresh);
9072
9076
  compilerCache.set(key, fresh);
9073
9077
  return fresh;
@@ -9077,9 +9081,9 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
9077
9081
  return;
9078
9082
  }
9079
9083
  compilerCache.delete(resolve9(cssPath));
9080
- }, incrementalTailwindBuild = async (tailwind, buildPath, changedFiles, styleTransformConfig) => {
9084
+ }, incrementalTailwindBuild = async (tailwind, buildPath, changedFiles, styleTransformConfig, extraSources = []) => {
9081
9085
  const startedAt = performance.now();
9082
- const entry = await getCompilerEntry(tailwind.input);
9086
+ const entry = await getCompilerEntry(tailwind.input, extraSources);
9083
9087
  const inputAbs = entry.cssPath;
9084
9088
  const filesToRescan = [];
9085
9089
  for (const file of changedFiles) {
@@ -9102,8 +9106,8 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
9102
9106
  await Bun.write(outputPath, finalCss);
9103
9107
  entry.lastEmittedHash = hash;
9104
9108
  return { cssChanged: true, durationMs };
9105
- }, warmTailwindCompiler = async (tailwind) => {
9106
- await getCompilerEntry(tailwind.input);
9109
+ }, warmTailwindCompiler = async (tailwind, extraSources = []) => {
9110
+ await getCompilerEntry(tailwind.input, extraSources);
9107
9111
  };
9108
9112
  var init_tailwindCompiler = __esm(() => {
9109
9113
  init_stylePreprocessor();
@@ -9112,13 +9116,38 @@ var init_tailwindCompiler = __esm(() => {
9112
9116
  });
9113
9117
 
9114
9118
  // src/build/compileTailwind.ts
9119
+ var exports_compileTailwind = {};
9120
+ __export(exports_compileTailwind, {
9121
+ isTailwindCandidate: () => isTailwindCandidate,
9122
+ computeFrameworkTailwindSources: () => computeFrameworkTailwindSources,
9123
+ compileTailwindConfig: () => compileTailwindConfig,
9124
+ compileTailwind: () => compileTailwind
9125
+ });
9115
9126
  import { mkdir as mkdir3 } from "fs/promises";
9116
- import { dirname as dirname6, join as join8 } from "path";
9117
- var TAILWIND_CANDIDATE_EXTENSION_PATTERN, isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath), compileTailwind = async (input, output, buildPath, styleTransformConfig) => {
9127
+ import { dirname as dirname6, join as join8, resolve as resolve10 } from "path";
9128
+ var computeFrameworkTailwindSources = (config) => {
9129
+ const cwd = process.cwd();
9130
+ const dirs = [
9131
+ [config.angularDirectory, "**/*.{ts,tsx,html,htm}"],
9132
+ [config.svelteDirectory, "**/*.{ts,tsx,svelte,html,htm}"],
9133
+ [config.vueDirectory, "**/*.{ts,tsx,vue,html,htm}"],
9134
+ [config.reactDirectory, "**/*.{ts,tsx,js,jsx,html,htm}"],
9135
+ [config.htmlDirectory, "**/*.{html,htm}"],
9136
+ [config.htmxDirectory, "**/*.{html,htm,js,ts}"],
9137
+ [config.emberDirectory, "**/*.{ts,tsx,gts,gjs,hbs,html,htm}"]
9138
+ ];
9139
+ const out = [];
9140
+ for (const [dir, glob] of dirs) {
9141
+ if (!dir)
9142
+ continue;
9143
+ out.push(`${resolve10(cwd, dir)}/${glob}`);
9144
+ }
9145
+ return out;
9146
+ }, TAILWIND_CANDIDATE_EXTENSION_PATTERN, isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath), compileTailwind = async (input, output, buildPath, styleTransformConfig, extraSources = [], changedFiles = []) => {
9118
9147
  const outputPath = join8(buildPath, output);
9119
9148
  await mkdir3(dirname6(outputPath), { recursive: true });
9120
- await incrementalTailwindBuild({ input, output }, buildPath, [], styleTransformConfig);
9121
- }, compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig);
9149
+ await incrementalTailwindBuild({ input, output }, buildPath, changedFiles, styleTransformConfig, extraSources);
9150
+ }, compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig, extraSources = [], changedFiles = []) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig, extraSources, changedFiles);
9122
9151
  var init_compileTailwind = __esm(() => {
9123
9152
  init_tailwindCompiler();
9124
9153
  TAILWIND_CANDIDATE_EXTENSION_PATTERN = /\.(html?|m?[jt]sx?|cjs|vue|svelte|astro|mdx?|css|s[ac]ss|less|styl(?:us)?)$/i;
@@ -9126,7 +9155,7 @@ var init_compileTailwind = __esm(() => {
9126
9155
 
9127
9156
  // src/utils/imageProcessing.ts
9128
9157
  import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "fs";
9129
- import { join as join9, resolve as resolve10 } from "path";
9158
+ import { join as join9, resolve as resolve11 } from "path";
9130
9159
  var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
9131
9160
  for (const size of sizes) {
9132
9161
  if (size >= target)
@@ -9254,7 +9283,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
9254
9283
  return sharpModule;
9255
9284
  sharpLoaded = true;
9256
9285
  try {
9257
- const sharpPath = resolve10(process.cwd(), "node_modules/sharp");
9286
+ const sharpPath = resolve11(process.cwd(), "node_modules/sharp");
9258
9287
  const mod = await import(sharpPath);
9259
9288
  sharpModule = mod.default ?? mod;
9260
9289
  return sharpModule;
@@ -9443,6 +9472,9 @@ var replaceAssetRef = (match, prefix, dir, name, ext, suffix, manifest, filePath
9443
9472
  if (/data-external(?:\s*=\s*["'][^"']*["'])?/i.test(match)) {
9444
9473
  return match;
9445
9474
  }
9475
+ if (dir.startsWith("/") || /^[a-z][a-z0-9+.-]*:\/\//i.test(dir)) {
9476
+ return match;
9477
+ }
9446
9478
  const pascal = toPascal(name);
9447
9479
  let key;
9448
9480
  if (ext === ".css") {
@@ -9486,18 +9518,18 @@ var init_updateAssetPaths = __esm(() => {
9486
9518
 
9487
9519
  // src/dev/buildHMRClient.ts
9488
9520
  import { existsSync as existsSync12 } from "fs";
9489
- import { resolve as resolve11 } from "path";
9521
+ import { resolve as resolve12 } from "path";
9490
9522
  var {build: bunBuild } = globalThis.Bun;
9491
9523
  var resolveHmrClientPath = () => {
9492
9524
  const projectRoot = process.cwd();
9493
- const fromSource = resolve11(import.meta.dir, "client/hmrClient.ts");
9525
+ const fromSource = resolve12(import.meta.dir, "client/hmrClient.ts");
9494
9526
  if (existsSync12(fromSource) && fromSource.startsWith(projectRoot)) {
9495
9527
  return fromSource;
9496
9528
  }
9497
- const fromNodeModules = resolve11(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
9529
+ const fromNodeModules = resolve12(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
9498
9530
  if (existsSync12(fromNodeModules))
9499
9531
  return fromNodeModules;
9500
- return resolve11(import.meta.dir, "dev/client/hmrClient.ts");
9532
+ return resolve12(import.meta.dir, "dev/client/hmrClient.ts");
9501
9533
  }, hmrClientPath2, buildHMRClient = async () => {
9502
9534
  const entryPoint = hmrClientPath2;
9503
9535
  const result = await bunBuild({
@@ -9527,7 +9559,7 @@ var init_buildHMRClient = __esm(() => {
9527
9559
  // src/build/nativeRewrite.ts
9528
9560
  import { dlopen, FFIType, ptr } from "bun:ffi";
9529
9561
  import { platform as platform2, arch as arch2 } from "os";
9530
- import { resolve as resolve12 } from "path";
9562
+ import { resolve as resolve13 } from "path";
9531
9563
  var ffiDefinition, nativeLib = null, loadNative = () => {
9532
9564
  if (nativeLib !== null)
9533
9565
  return nativeLib;
@@ -9545,7 +9577,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
9545
9577
  if (!libPath)
9546
9578
  return null;
9547
9579
  try {
9548
- const fullPath = resolve12(import.meta.dir, "../../native/packages", libPath);
9580
+ const fullPath = resolve13(import.meta.dir, "../../native/packages", libPath);
9549
9581
  const lib = dlopen(fullPath, ffiDefinition);
9550
9582
  nativeLib = lib.symbols;
9551
9583
  return nativeLib;
@@ -9691,7 +9723,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
9691
9723
 
9692
9724
  // src/build/angularLinkerPlugin.ts
9693
9725
  import { existsSync as existsSync13, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "fs";
9694
- import { dirname as dirname8, join as join12, relative as relative6, resolve as resolve13 } from "path";
9726
+ import { dirname as dirname8, join as join12, relative as relative6, resolve as resolve14 } from "path";
9695
9727
  import { createHash as createHash3 } from "crypto";
9696
9728
  var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
9697
9729
  name: "angular-linker",
@@ -9733,7 +9765,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
9733
9765
  exists: existsSync13,
9734
9766
  readFile: readFileSync9,
9735
9767
  relative: relative6,
9736
- resolve: resolve13
9768
+ resolve: resolve14
9737
9769
  },
9738
9770
  linkerJitMode,
9739
9771
  logger: {
@@ -9764,7 +9796,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
9764
9796
  }
9765
9797
  }), angularLinkerPlugin;
9766
9798
  var init_angularLinkerPlugin = __esm(() => {
9767
- CACHE_ROOT = resolve13(".absolutejs", "cache", "angular-linker");
9799
+ CACHE_ROOT = resolve14(".absolutejs", "cache", "angular-linker");
9768
9800
  ANGULAR_LINKER_CANDIDATE_RE = /[\\/]node_modules[\\/].*\.m?js$/;
9769
9801
  angularLinkerPlugin = createAngularLinkerPlugin(false);
9770
9802
  });
@@ -9776,7 +9808,7 @@ __export(exports_hmrInjectionPlugin, {
9776
9808
  applyAngularHmrInjection: () => applyAngularHmrInjection
9777
9809
  });
9778
9810
  import { readFile as readFile5 } from "fs/promises";
9779
- import { relative as relative7, resolve as resolve14 } from "path";
9811
+ import { relative as relative7, resolve as resolve15 } from "path";
9780
9812
  var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
9781
9813
  const names = new Set;
9782
9814
  IMPORT_RE.lastIndex = 0;
@@ -9939,7 +9971,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
9939
9971
  }
9940
9972
  `, applyAngularHmrInjection = (jsSource, componentJsAbsPath, params) => {
9941
9973
  const { generatedAngularRoot, userAngularRoot, projectRoot } = params;
9942
- const normalizedGenRoot = resolve14(generatedAngularRoot).replace(/\\/g, "/");
9974
+ const normalizedGenRoot = resolve15(generatedAngularRoot).replace(/\\/g, "/");
9943
9975
  const normalizedPath = componentJsAbsPath.replace(/\\/g, "/");
9944
9976
  if (!normalizedPath.startsWith(normalizedGenRoot + "/"))
9945
9977
  return;
@@ -9957,7 +9989,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
9957
9989
  if (classNames.length === 0)
9958
9990
  return;
9959
9991
  const relFromGenRoot = relative7(generatedAngularRoot, componentJsAbsPath).replace(/\\/g, "/");
9960
- const userTsPath = resolve14(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
9992
+ const userTsPath = resolve15(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
9961
9993
  const projectRel = relative7(projectRoot, userTsPath).replace(/\\/g, "/");
9962
9994
  const tail = classNames.map((className) => {
9963
9995
  const id = `${projectRel}@${className}`;
@@ -9992,14 +10024,14 @@ var init_hmrInjectionPlugin = __esm(() => {
9992
10024
 
9993
10025
  // src/utils/cleanStaleOutputs.ts
9994
10026
  import { rm as rm2 } from "fs/promises";
9995
- import { resolve as resolve15 } from "path";
10027
+ import { resolve as resolve16 } from "path";
9996
10028
  var {Glob: Glob5 } = globalThis.Bun;
9997
10029
  var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
9998
- const currentPaths = new Set(currentOutputPaths.map((path) => resolve15(path)));
10030
+ const currentPaths = new Set(currentOutputPaths.map((path) => resolve16(path)));
9999
10031
  const glob = new Glob5("**/*");
10000
10032
  const removals = [];
10001
10033
  for (const relative8 of glob.scanSync({ cwd: buildPath })) {
10002
- const absolute = resolve15(buildPath, relative8);
10034
+ const absolute = resolve16(buildPath, relative8);
10003
10035
  if (currentPaths.has(absolute))
10004
10036
  continue;
10005
10037
  if (!HASHED_FILE_PATTERN.test(relative8))
@@ -10233,10 +10265,10 @@ var init_buildDirectoryLock = __esm(() => {
10233
10265
  });
10234
10266
 
10235
10267
  // src/utils/validateSafePath.ts
10236
- import { resolve as resolve16, relative as relative8 } from "path";
10268
+ import { resolve as resolve17, relative as relative8 } from "path";
10237
10269
  var validateSafePath = (targetPath, baseDirectory) => {
10238
- const absoluteBase = resolve16(baseDirectory);
10239
- const absoluteTarget = resolve16(baseDirectory, targetPath);
10270
+ const absoluteBase = resolve17(baseDirectory);
10271
+ const absoluteTarget = resolve17(baseDirectory, targetPath);
10240
10272
  const relativePath = normalizePath(relative8(absoluteBase, absoluteTarget));
10241
10273
  if (relativePath.startsWith("../") || relativePath === "..") {
10242
10274
  throw new Error(`Unsafe path: ${targetPath}`);
@@ -10391,7 +10423,7 @@ import {
10391
10423
  join as join16,
10392
10424
  basename as basename4,
10393
10425
  extname as extname5,
10394
- resolve as resolve17,
10426
+ resolve as resolve18,
10395
10427
  relative as relative9,
10396
10428
  sep as sep2
10397
10429
  } from "path";
@@ -10399,14 +10431,14 @@ import { env } from "process";
10399
10431
  var {write, file, Transpiler: Transpiler2 } = globalThis.Bun;
10400
10432
  var resolveDevClientDir2 = () => {
10401
10433
  const projectRoot = process.cwd();
10402
- const fromSource = resolve17(import.meta.dir, "../dev/client");
10434
+ const fromSource = resolve18(import.meta.dir, "../dev/client");
10403
10435
  if (existsSync14(fromSource) && fromSource.startsWith(projectRoot)) {
10404
10436
  return fromSource;
10405
10437
  }
10406
- const fromNodeModules = resolve17(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
10438
+ const fromNodeModules = resolve18(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
10407
10439
  if (existsSync14(fromNodeModules))
10408
10440
  return fromNodeModules;
10409
- return resolve17(import.meta.dir, "./dev/client");
10441
+ return resolve18(import.meta.dir, "./dev/client");
10410
10442
  }, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
10411
10443
  persistentCache.clear();
10412
10444
  sourceHashCache.clear();
@@ -10436,7 +10468,7 @@ var resolveDevClientDir2 = () => {
10436
10468
  }, resolveRelativeModule2 = async (spec, from) => {
10437
10469
  if (!spec.startsWith("."))
10438
10470
  return null;
10439
- const basePath = resolve17(dirname10(from), spec);
10471
+ const basePath = resolve18(dirname10(from), spec);
10440
10472
  const candidates = [
10441
10473
  basePath,
10442
10474
  `${basePath}.ts`,
@@ -10463,7 +10495,7 @@ var resolveDevClientDir2 = () => {
10463
10495
  const resolved = resolvePackageImport(spec);
10464
10496
  return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
10465
10497
  }
10466
- const basePath = resolve17(dirname10(from), spec);
10498
+ const basePath = resolve18(dirname10(from), spec);
10467
10499
  const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
10468
10500
  if (!explicit) {
10469
10501
  const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
@@ -10507,7 +10539,7 @@ var resolveDevClientDir2 = () => {
10507
10539
  const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
10508
10540
  const prevHash = sourceHashCache.get(src);
10509
10541
  const persistent = persistentCache.get(src);
10510
- if (prevHash === contentHash && persistent) {
10542
+ if (prevHash === contentHash && persistent && existsSync14(persistent.ssr) && existsSync14(persistent.client)) {
10511
10543
  cache.set(src, persistent);
10512
10544
  return persistent;
10513
10545
  }
@@ -10800,19 +10832,19 @@ import {
10800
10832
  isAbsolute as isAbsolute3,
10801
10833
  join as join17,
10802
10834
  relative as relative10,
10803
- resolve as resolve18
10835
+ resolve as resolve19
10804
10836
  } from "path";
10805
10837
  var {file: file2, write: write2, Transpiler: Transpiler3 } = globalThis.Bun;
10806
10838
  var resolveDevClientDir3 = () => {
10807
10839
  const projectRoot = process.cwd();
10808
- const fromSource = resolve18(import.meta.dir, "../dev/client");
10840
+ const fromSource = resolve19(import.meta.dir, "../dev/client");
10809
10841
  if (existsSync15(fromSource) && fromSource.startsWith(projectRoot)) {
10810
10842
  return fromSource;
10811
10843
  }
10812
- const fromNodeModules = resolve18(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
10844
+ const fromNodeModules = resolve19(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
10813
10845
  if (existsSync15(fromNodeModules))
10814
10846
  return fromNodeModules;
10815
- return resolve18(import.meta.dir, "./dev/client");
10847
+ return resolve19(import.meta.dir, "./dev/client");
10816
10848
  }, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
10817
10849
  scriptCache.clear();
10818
10850
  scriptSetupCache.clear();
@@ -10858,7 +10890,7 @@ var resolveDevClientDir3 = () => {
10858
10890
  return filePath.replace(/\.ts$/, ".js");
10859
10891
  if (isStylePath(filePath)) {
10860
10892
  if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
10861
- return resolve18(sourceDir, filePath);
10893
+ return resolve19(sourceDir, filePath);
10862
10894
  }
10863
10895
  return filePath;
10864
10896
  }
@@ -10894,7 +10926,7 @@ var resolveDevClientDir3 = () => {
10894
10926
  const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
10895
10927
  const prevHash = vueSourceHashCache.get(sourceFilePath);
10896
10928
  const persistent = persistentBuildCache.get(sourceFilePath);
10897
- if (prevHash === contentHash && persistent) {
10929
+ if (prevHash === contentHash && persistent && existsSync15(persistent.clientPath) && existsSync15(persistent.serverPath)) {
10898
10930
  cacheMap.set(sourceFilePath, persistent);
10899
10931
  return persistent;
10900
10932
  }
@@ -10922,12 +10954,12 @@ var resolveDevClientDir3 = () => {
10922
10954
  const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
10923
10955
  const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
10924
10956
  const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
10925
- const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve18(dirname11(sourceFilePath), path));
10957
+ const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve19(dirname11(sourceFilePath), path));
10926
10958
  for (const stylePath of stylePathsImported) {
10927
10959
  addStyleImporter(sourceFilePath, stylePath);
10928
10960
  }
10929
10961
  const childBuildResults = await Promise.all([
10930
- ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve18(dirname11(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
10962
+ ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve19(dirname11(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
10931
10963
  ...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
10932
10964
  ]);
10933
10965
  const hasScript = descriptor.script || descriptor.scriptSetup;
@@ -11038,7 +11070,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
11038
11070
  hmrId,
11039
11071
  serverPath: serverOutputPath,
11040
11072
  tsHelperPaths: [
11041
- ...helperModulePaths.map((helper) => resolve18(dirname11(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
11073
+ ...helperModulePaths.map((helper) => resolve19(dirname11(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
11042
11074
  ...childBuildResults.flatMap((child) => child.tsHelperPaths)
11043
11075
  ]
11044
11076
  };
@@ -11061,7 +11093,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
11061
11093
  const buildCache = new Map;
11062
11094
  const allTsHelperPaths = new Set;
11063
11095
  const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
11064
- const result = await compileVueFile(resolve18(entryPath), {
11096
+ const result = await compileVueFile(resolve19(entryPath), {
11065
11097
  client: clientOutputDir,
11066
11098
  css: cssOutputDir,
11067
11099
  server: serverOutputDir
@@ -11720,23 +11752,25 @@ var init_lowerDeferSyntax = __esm(() => {
11720
11752
  // src/build/compileAngular.ts
11721
11753
  var exports_compileAngular = {};
11722
11754
  __export(exports_compileAngular, {
11755
+ invalidateAngularJitCache: () => invalidateAngularJitCache,
11723
11756
  compileAngularFiles: () => compileAngularFiles,
11724
11757
  compileAngularFileJIT: () => compileAngularFileJIT,
11725
11758
  compileAngularFile: () => compileAngularFile,
11726
11759
  compileAngular: () => compileAngular
11727
11760
  });
11728
11761
  import { existsSync as existsSync16, readFileSync as readFileSync11, promises as fs } from "fs";
11729
- import { join as join18, basename as basename6, sep as sep3, dirname as dirname12, resolve as resolve19, relative as relative11 } from "path";
11762
+ import { join as join18, basename as basename6, sep as sep3, dirname as dirname12, resolve as resolve20, relative as relative11 } from "path";
11763
+ var {Glob: Glob6 } = globalThis.Bun;
11730
11764
  import ts2 from "typescript";
11731
11765
  var traceAngularPhase = async (name, fn2, metadata) => {
11732
11766
  const tracePhase = globalThis.__absoluteBuildTracePhase;
11733
11767
  return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
11734
11768
  }, readTsconfigPathAliases = () => {
11735
11769
  try {
11736
- const configPath2 = resolve19(process.cwd(), "tsconfig.json");
11770
+ const configPath2 = resolve20(process.cwd(), "tsconfig.json");
11737
11771
  const config = ts2.readConfigFile(configPath2, ts2.sys.readFile).config;
11738
11772
  const compilerOptions = config?.compilerOptions ?? {};
11739
- const baseUrl = resolve19(process.cwd(), compilerOptions.baseUrl ?? ".");
11773
+ const baseUrl = resolve20(process.cwd(), compilerOptions.baseUrl ?? ".");
11740
11774
  const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
11741
11775
  return { aliases, baseUrl };
11742
11776
  } catch {
@@ -11756,7 +11790,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11756
11790
  const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
11757
11791
  for (const replacement of alias.replacements) {
11758
11792
  const candidate = replacement.replace("*", wildcardValue);
11759
- const resolved = resolveSourceFile(resolve19(baseUrl, candidate));
11793
+ const resolved = resolveSourceFile(resolve20(baseUrl, candidate));
11760
11794
  if (resolved)
11761
11795
  return resolved;
11762
11796
  }
@@ -11775,13 +11809,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11775
11809
  ];
11776
11810
  return candidates.find((file3) => existsSync16(file3));
11777
11811
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
11778
- const baseDir = resolve19(rootDir);
11812
+ const baseDir = resolve20(rootDir);
11779
11813
  const tsconfigAliases = readTsconfigPathAliases();
11780
11814
  const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
11781
11815
  const scanCache = new Map;
11782
11816
  const resolveLocalImport = (specifier, fromDir) => {
11783
11817
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
11784
- return resolveSourceFile(resolve19(fromDir, specifier));
11818
+ return resolveSourceFile(resolve20(fromDir, specifier));
11785
11819
  }
11786
11820
  const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
11787
11821
  if (aliased)
@@ -11790,7 +11824,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11790
11824
  const resolved = Bun.resolveSync(specifier, fromDir);
11791
11825
  if (resolved.includes("/node_modules/"))
11792
11826
  return;
11793
- const absolute = resolve19(resolved);
11827
+ const absolute = resolve20(resolved);
11794
11828
  if (!absolute.startsWith(baseDir))
11795
11829
  return;
11796
11830
  return resolveSourceFile(absolute);
@@ -11806,7 +11840,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11806
11840
  usesLegacyAnimations: false
11807
11841
  });
11808
11842
  }
11809
- const resolved = resolve19(actualPath);
11843
+ const resolved = resolve20(actualPath);
11810
11844
  const cached = scanCache.get(resolved);
11811
11845
  if (cached)
11812
11846
  return cached;
@@ -11835,7 +11869,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11835
11869
  const actualPath = resolveSourceFile(filePath);
11836
11870
  if (!actualPath)
11837
11871
  return false;
11838
- const resolved = resolve19(actualPath);
11872
+ const resolved = resolve20(actualPath);
11839
11873
  if (visited.has(resolved))
11840
11874
  return false;
11841
11875
  visited.add(resolved);
@@ -11853,14 +11887,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11853
11887
  return (entryPath) => visit(entryPath);
11854
11888
  }, resolveDevClientDir4 = () => {
11855
11889
  const projectRoot = process.cwd();
11856
- const fromSource = resolve19(import.meta.dir, "../dev/client");
11890
+ const fromSource = resolve20(import.meta.dir, "../dev/client");
11857
11891
  if (existsSync16(fromSource) && fromSource.startsWith(projectRoot)) {
11858
11892
  return fromSource;
11859
11893
  }
11860
- const fromNodeModules = resolve19(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
11894
+ const fromNodeModules = resolve20(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
11861
11895
  if (existsSync16(fromNodeModules))
11862
11896
  return fromNodeModules;
11863
- return resolve19(import.meta.dir, "./dev/client");
11897
+ return resolve20(import.meta.dir, "./dev/client");
11864
11898
  }, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
11865
11899
  try {
11866
11900
  return ts2.flattenDiagnosticMessageText(diagnostic.messageText, `
@@ -11903,11 +11937,11 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11903
11937
  if (hasJsLikeExtension(path))
11904
11938
  return `${path}${query}`;
11905
11939
  const importerDir = dirname12(importerOutputPath);
11906
- const fileCandidate = resolve19(importerDir, `${path}.js`);
11940
+ const fileCandidate = resolve20(importerDir, `${path}.js`);
11907
11941
  if (outputFiles?.has(fileCandidate) || existsSync16(fileCandidate)) {
11908
11942
  return `${path}.js${query}`;
11909
11943
  }
11910
- const indexCandidate = resolve19(importerDir, path, "index.js");
11944
+ const indexCandidate = resolve20(importerDir, path, "index.js");
11911
11945
  if (outputFiles?.has(indexCandidate) || existsSync16(indexCandidate)) {
11912
11946
  return `${path}/index.js${query}`;
11913
11947
  }
@@ -11935,7 +11969,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11935
11969
  }, resolveLocalTsImport = (fromFile, specifier) => {
11936
11970
  if (!isRelativeModuleSpecifier(specifier))
11937
11971
  return null;
11938
- const basePath = resolve19(dirname12(fromFile), specifier);
11972
+ const basePath = resolve20(dirname12(fromFile), specifier);
11939
11973
  const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
11940
11974
  `${basePath}.ts`,
11941
11975
  `${basePath}.tsx`,
@@ -11946,7 +11980,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11946
11980
  join18(basePath, "index.mts"),
11947
11981
  join18(basePath, "index.cts")
11948
11982
  ];
11949
- return candidates.map((candidate) => resolve19(candidate)).find((candidate) => existsSync16(candidate) && !candidate.endsWith(".d.ts")) ?? null;
11983
+ return candidates.map((candidate) => resolve20(candidate)).find((candidate) => existsSync16(candidate) && !candidate.endsWith(".d.ts")) ?? null;
11950
11984
  }, readFileForAotTransform = async (fileName, readFile6) => {
11951
11985
  const hostSource = readFile6?.(fileName);
11952
11986
  if (typeof hostSource === "string")
@@ -11981,7 +12015,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
11981
12015
  paths.push(join18(fileDir, urlMatch.replace(/['"]/g, "")));
11982
12016
  }
11983
12017
  }
11984
- return paths.map((path) => resolve19(path));
12018
+ return paths.map((path) => resolve20(path));
11985
12019
  }, readResourceCacheFile = async (cachePath) => {
11986
12020
  try {
11987
12021
  const entry = JSON.parse(await fs.readFile(cachePath, "utf-8"));
@@ -12023,7 +12057,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12023
12057
  transformedFiles: 0
12024
12058
  };
12025
12059
  const transformFile = async (filePath) => {
12026
- const resolvedPath = resolve19(filePath);
12060
+ const resolvedPath = resolve20(filePath);
12027
12061
  if (visited.has(resolvedPath))
12028
12062
  return;
12029
12063
  visited.add(resolvedPath);
@@ -12058,7 +12092,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12058
12092
  return { stats, transformedSources };
12059
12093
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
12060
12094
  const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
12061
- const outputPath = resolve19(join18(outDir, relative11(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
12095
+ const outputPath = resolve20(join18(outDir, relative11(process.cwd(), resolve20(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
12062
12096
  return [
12063
12097
  outputPath,
12064
12098
  buildIslandMetadataExports(readFileSync11(inputPath, "utf-8"))
@@ -12069,7 +12103,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12069
12103
  const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
12070
12104
  const tsPath = __require.resolve("typescript");
12071
12105
  const tsRootDir = dirname12(tsPath);
12072
- return tsRootDir.endsWith("lib") ? tsRootDir : resolve19(tsRootDir, "lib");
12106
+ return tsRootDir.endsWith("lib") ? tsRootDir : resolve20(tsRootDir, "lib");
12073
12107
  });
12074
12108
  const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
12075
12109
  const options = {
@@ -12111,7 +12145,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12111
12145
  return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
12112
12146
  };
12113
12147
  const emitted = {};
12114
- const resolvedOutDir = resolve19(outDir);
12148
+ const resolvedOutDir = resolve20(outDir);
12115
12149
  host.writeFile = (fileName, text) => {
12116
12150
  const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
12117
12151
  emitted[relativePath] = text;
@@ -12133,12 +12167,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12133
12167
  if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
12134
12168
  return source;
12135
12169
  }
12136
- const resolvedPath = resolve19(fileName);
12170
+ const resolvedPath = resolve20(fileName);
12137
12171
  return transformedSources.get(resolvedPath) ?? source;
12138
12172
  };
12139
12173
  const originalGetSourceFileForCompile = host.getSourceFile;
12140
12174
  host.getSourceFile = (fileName, languageVersion, onError) => {
12141
- const source = transformedSources.get(resolve19(fileName));
12175
+ const source = transformedSources.get(resolve20(fileName));
12142
12176
  if (source) {
12143
12177
  return ts2.createSourceFile(fileName, source, languageVersion, true);
12144
12178
  }
@@ -12162,7 +12196,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12162
12196
  content,
12163
12197
  target: join18(outDir, fileName)
12164
12198
  }));
12165
- const outputFiles = new Set(rawEntries.map(({ target }) => resolve19(target)));
12199
+ const outputFiles = new Set(rawEntries.map(({ target }) => resolve20(target)));
12166
12200
  return rawEntries.map(({ content, target }) => {
12167
12201
  let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
12168
12202
  const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
@@ -12177,7 +12211,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12177
12211
  return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
12178
12212
  });
12179
12213
  processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
12180
- processedContent += islandMetadataByOutputPath.get(resolve19(target)) ?? "";
12214
+ processedContent += islandMetadataByOutputPath.get(resolve20(target)) ?? "";
12181
12215
  return { content: processedContent, target };
12182
12216
  });
12183
12217
  });
@@ -12186,7 +12220,9 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12186
12220
  await fs.writeFile(target, content, "utf-8");
12187
12221
  })), { outputs: entries.length });
12188
12222
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
12189
- }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
12223
+ }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
12224
+ jitContentCache.delete(resolve20(filePath));
12225
+ }, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
12190
12226
  const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
12191
12227
  let match;
12192
12228
  while ((match = re2.exec(source)) !== null) {
@@ -12198,7 +12234,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
12198
12234
  }
12199
12235
  return null;
12200
12236
  }, resolveAngularDeferImportSpecifier = () => {
12201
- const sourceEntry = resolve19(import.meta.dir, "../angular/components/index.ts");
12237
+ const sourceEntry = resolve20(import.meta.dir, "../angular/components/index.ts");
12202
12238
  if (existsSync16(sourceEntry)) {
12203
12239
  return sourceEntry.replace(/\\/g, "/");
12204
12240
  }
@@ -12428,10 +12464,10 @@ ${fields}
12428
12464
  source: result
12429
12465
  };
12430
12466
  }, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
12431
- const entryPath = resolve19(inputPath);
12467
+ const entryPath = resolve20(inputPath);
12432
12468
  const allOutputs = [];
12433
12469
  const visited = new Set;
12434
- const baseDir = resolve19(rootDir ?? process.cwd());
12470
+ const baseDir = resolve20(rootDir ?? process.cwd());
12435
12471
  let usesLegacyAnimations = false;
12436
12472
  const angularTranspiler = new Bun.Transpiler({
12437
12473
  loader: "ts",
@@ -12459,7 +12495,7 @@ ${fields}
12459
12495
  };
12460
12496
  const resolveLocalImport = (specifier, fromDir) => {
12461
12497
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
12462
- return resolveSourceFile2(resolve19(fromDir, specifier));
12498
+ return resolveSourceFile2(resolve20(fromDir, specifier));
12463
12499
  }
12464
12500
  const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
12465
12501
  if (aliased)
@@ -12468,7 +12504,7 @@ ${fields}
12468
12504
  const resolved = Bun.resolveSync(specifier, fromDir);
12469
12505
  if (resolved.includes("/node_modules/"))
12470
12506
  return;
12471
- const absolute = resolve19(resolved);
12507
+ const absolute = resolve20(resolved);
12472
12508
  if (!absolute.startsWith(baseDir))
12473
12509
  return;
12474
12510
  return resolveSourceFile2(absolute);
@@ -12517,13 +12553,13 @@ ${fields}
12517
12553
  return `${prefix}${dots}`;
12518
12554
  return `${prefix}../${dots}`;
12519
12555
  });
12520
- if (resolve19(actualPath) === entryPath) {
12556
+ if (resolve20(actualPath) === entryPath) {
12521
12557
  processedContent += buildIslandMetadataExports(sourceCode);
12522
12558
  }
12523
12559
  return processedContent;
12524
12560
  };
12525
12561
  const transpileFile = async (filePath) => {
12526
- const resolved = resolve19(filePath);
12562
+ const resolved = resolve20(filePath);
12527
12563
  if (visited.has(resolved))
12528
12564
  return;
12529
12565
  visited.add(resolved);
@@ -12575,7 +12611,7 @@ ${fields}
12575
12611
  importRewrites.set(specifier, relativeRewrite);
12576
12612
  return resolved2;
12577
12613
  }).filter((path) => Boolean(path));
12578
- const isEntry = resolve19(actualPath) === resolve19(entryPath);
12614
+ const isEntry = resolve20(actualPath) === resolve20(entryPath);
12579
12615
  const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
12580
12616
  const cacheKey2 = actualPath;
12581
12617
  const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync16(targetPath);
@@ -12611,10 +12647,29 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12611
12647
  const compiledRoot = compiledParent;
12612
12648
  const indexesDir = join18(compiledParent, "indexes");
12613
12649
  await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
12614
- const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve19(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
12650
+ const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve20(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
12651
+ if (!hmr) {
12652
+ await traceAngularPhase("aot/copy-json-resources", async () => {
12653
+ const cwd = process.cwd();
12654
+ const angularSrcDir = resolve20(outRoot);
12655
+ if (!existsSync16(angularSrcDir))
12656
+ return;
12657
+ const jsonGlob = new Glob6("**/*.json");
12658
+ for (const rel of jsonGlob.scanSync({
12659
+ absolute: false,
12660
+ cwd: angularSrcDir
12661
+ })) {
12662
+ const sourcePath = join18(angularSrcDir, rel);
12663
+ const cwdRel = relative11(cwd, sourcePath);
12664
+ const targetPath = join18(compiledRoot, cwdRel);
12665
+ await fs.mkdir(dirname12(targetPath), { recursive: true });
12666
+ await fs.copyFile(sourcePath, targetPath);
12667
+ }
12668
+ });
12669
+ }
12615
12670
  const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
12616
12671
  const compileTasks = entryPoints.map(async (entry) => {
12617
- const resolvedEntry = resolve19(entry);
12672
+ const resolvedEntry = resolve20(entry);
12618
12673
  const relativeEntry = relative11(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
12619
12674
  const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
12620
12675
  let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
@@ -12626,10 +12681,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12626
12681
  join18(compiledRoot, relativeEntry),
12627
12682
  join18(compiledRoot, "pages", jsName),
12628
12683
  join18(compiledRoot, jsName)
12629
- ].map((file3) => resolve19(file3));
12684
+ ].map((file3) => resolve20(file3));
12630
12685
  const resolveRawServerFile = (candidatePaths) => {
12631
12686
  const normalizedCandidates = [
12632
- ...candidatePaths.map((file3) => resolve19(file3)),
12687
+ ...candidatePaths.map((file3) => resolve20(file3)),
12633
12688
  ...compiledFallbackPaths
12634
12689
  ];
12635
12690
  let candidate = normalizedCandidates.find((file3) => existsSync16(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
@@ -12685,7 +12740,6 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12685
12740
  rewritten = `import '@angular/compiler';
12686
12741
  ${rewritten}`;
12687
12742
  }
12688
- rewritten = rewritten.replace(new RegExp(`templateUrl:\\s*['"]\\.\\/${fileBase}\\.html['"]`), `templateUrl: '../../pages/${fileBase}.html'`);
12689
12743
  if (detectedClassName && !rewritten.includes("export default")) {
12690
12744
  rewritten += `
12691
12745
  export default ${componentClassName};
@@ -13611,7 +13665,7 @@ __export(exports_fastHmrCompiler, {
13611
13665
  invalidateFingerprintCache: () => invalidateFingerprintCache
13612
13666
  });
13613
13667
  import { existsSync as existsSync17, readFileSync as readFileSync12, statSync } from "fs";
13614
- import { dirname as dirname13, extname as extname6, relative as relative12, resolve as resolve20 } from "path";
13668
+ import { dirname as dirname13, extname as extname6, relative as relative12, resolve as resolve21 } from "path";
13615
13669
  import ts6 from "typescript";
13616
13670
  var fail = (reason, detail, location) => ({
13617
13671
  ok: false,
@@ -13915,7 +13969,7 @@ var fail = (reason, detail, location) => ({
13915
13969
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
13916
13970
  return true;
13917
13971
  }
13918
- const base = resolve20(componentDir, spec);
13972
+ const base = resolve21(componentDir, spec);
13919
13973
  const candidates = [
13920
13974
  `${base}.ts`,
13921
13975
  `${base}.tsx`,
@@ -14717,7 +14771,7 @@ var fail = (reason, detail, location) => ({
14717
14771
  return null;
14718
14772
  }, resolveDtsFromSpec = (spec, fromDir) => {
14719
14773
  const stripped = spec.replace(/\.[mc]?js$/, "");
14720
- const base = resolve20(fromDir, stripped);
14774
+ const base = resolve21(fromDir, stripped);
14721
14775
  const candidates = [
14722
14776
  `${base}.d.ts`,
14723
14777
  `${base}.d.mts`,
@@ -14741,7 +14795,7 @@ var fail = (reason, detail, location) => ({
14741
14795
  return null;
14742
14796
  }, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
14743
14797
  if (spec.startsWith(".") || spec.startsWith("/")) {
14744
- const base = resolve20(componentDir, spec);
14798
+ const base = resolve21(componentDir, spec);
14745
14799
  const candidates = [
14746
14800
  `${base}.ts`,
14747
14801
  `${base}.tsx`,
@@ -14958,13 +15012,13 @@ var fail = (reason, detail, location) => ({
14958
15012
  }
14959
15013
  if (!matches)
14960
15014
  continue;
14961
- const resolved = resolve20(componentDir, spec);
15015
+ const resolved = resolve21(componentDir, spec);
14962
15016
  for (const ext of TS_EXTENSIONS) {
14963
15017
  const candidate = resolved + ext;
14964
15018
  if (existsSync17(candidate))
14965
15019
  return candidate;
14966
15020
  }
14967
- const indexCandidate = resolve20(resolved, "index.ts");
15021
+ const indexCandidate = resolve21(resolved, "index.ts");
14968
15022
  if (existsSync17(indexCandidate))
14969
15023
  return indexCandidate;
14970
15024
  }
@@ -15197,7 +15251,7 @@ ${transpiled}
15197
15251
  }
15198
15252
  }${staticPatch}`;
15199
15253
  }, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
15200
- const abs = resolve20(componentDir, url);
15254
+ const abs = resolve21(componentDir, url);
15201
15255
  if (!existsSync17(abs))
15202
15256
  return null;
15203
15257
  const ext = extname6(abs).toLowerCase();
@@ -15237,7 +15291,7 @@ ${block}
15237
15291
  const cached = projectOptionsCache.get(projectRoot);
15238
15292
  if (cached !== undefined)
15239
15293
  return cached;
15240
- const tsconfigPath = resolve20(projectRoot, "tsconfig.json");
15294
+ const tsconfigPath = resolve21(projectRoot, "tsconfig.json");
15241
15295
  const opts = {};
15242
15296
  if (existsSync17(tsconfigPath)) {
15243
15297
  try {
@@ -15321,7 +15375,7 @@ ${block}
15321
15375
  templateText = decoratorMeta.template;
15322
15376
  templatePath = componentFilePath;
15323
15377
  } else if (decoratorMeta.templateUrl) {
15324
- const tplAbs = resolve20(componentDir, decoratorMeta.templateUrl);
15378
+ const tplAbs = resolve21(componentDir, decoratorMeta.templateUrl);
15325
15379
  if (!existsSync17(tplAbs)) {
15326
15380
  return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
15327
15381
  }
@@ -16084,7 +16138,7 @@ __export(exports_compileEmber, {
16084
16138
  });
16085
16139
  import { existsSync as existsSync18 } from "fs";
16086
16140
  import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
16087
- import { basename as basename7, dirname as dirname14, extname as extname7, join as join19, resolve as resolve21 } from "path";
16141
+ import { basename as basename7, dirname as dirname14, extname as extname7, join as join19, resolve as resolve22 } from "path";
16088
16142
  var {build: bunBuild2, Transpiler: Transpiler4, write: write3, file: file3 } = globalThis.Bun;
16089
16143
  var cachedPreprocessor = null, getPreprocessor = async () => {
16090
16144
  if (cachedPreprocessor)
@@ -16180,7 +16234,7 @@ export const importSync = (specifier) => {
16180
16234
  const originalImporter = stagedSourceMap.get(args.importer);
16181
16235
  if (!originalImporter)
16182
16236
  return;
16183
- const candidateBase = resolve21(dirname14(originalImporter), args.path);
16237
+ const candidateBase = resolve22(dirname14(originalImporter), args.path);
16184
16238
  const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
16185
16239
  for (const ext of extensionsToTry) {
16186
16240
  const candidate = candidateBase + ext;
@@ -16239,7 +16293,7 @@ export const renderToHTML = (props = {}) => {
16239
16293
  export { PageComponent };
16240
16294
  export default PageComponent;
16241
16295
  `, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
16242
- const resolvedEntry = resolve21(entry);
16296
+ const resolvedEntry = resolve22(entry);
16243
16297
  const source = await file3(resolvedEntry).text();
16244
16298
  let preprocessed = source;
16245
16299
  if (isTemplateTagFile(resolvedEntry)) {
@@ -16259,8 +16313,8 @@ export default PageComponent;
16259
16313
  mkdir6(serverDir, { recursive: true }),
16260
16314
  mkdir6(clientDir, { recursive: true })
16261
16315
  ]);
16262
- const tmpPagePath = resolve21(join19(tmpDir, `${baseName}.module.js`));
16263
- const tmpHarnessPath = resolve21(join19(tmpDir, `${baseName}.harness.js`));
16316
+ const tmpPagePath = resolve22(join19(tmpDir, `${baseName}.module.js`));
16317
+ const tmpHarnessPath = resolve22(join19(tmpDir, `${baseName}.harness.js`));
16264
16318
  await Promise.all([
16265
16319
  write3(tmpPagePath, transpiled),
16266
16320
  write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
@@ -16302,7 +16356,7 @@ export default PageComponent;
16302
16356
  serverPaths: outputs.map((o3) => o3.serverPath)
16303
16357
  };
16304
16358
  }, compileEmberFileSource = async (entry) => {
16305
- const resolvedEntry = resolve21(entry);
16359
+ const resolvedEntry = resolve22(entry);
16306
16360
  const source = await file3(resolvedEntry).text();
16307
16361
  let preprocessed = source;
16308
16362
  if (isTemplateTagFile(resolvedEntry)) {
@@ -16335,24 +16389,24 @@ __export(exports_buildReactVendor, {
16335
16389
  buildReactVendor: () => buildReactVendor
16336
16390
  });
16337
16391
  import { existsSync as existsSync19, mkdirSync as mkdirSync7 } from "fs";
16338
- import { join as join20, resolve as resolve22 } from "path";
16392
+ import { join as join20, resolve as resolve23 } from "path";
16339
16393
  import { rm as rm5 } from "fs/promises";
16340
16394
  var {build: bunBuild3 } = globalThis.Bun;
16341
16395
  var resolveJsxDevRuntimeCompatPath = () => {
16342
16396
  const candidates = [
16343
- resolve22(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
16344
- resolve22(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
16345
- resolve22(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
16346
- resolve22(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
16347
- resolve22(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
16348
- resolve22(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
16397
+ resolve23(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
16398
+ resolve23(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
16399
+ resolve23(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
16400
+ resolve23(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
16401
+ resolve23(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
16402
+ resolve23(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
16349
16403
  ];
16350
16404
  for (const candidate of candidates) {
16351
16405
  if (existsSync19(candidate)) {
16352
16406
  return candidate.replace(/\\/g, "/");
16353
16407
  }
16354
16408
  }
16355
- return (candidates[0] ?? resolve22(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
16409
+ return (candidates[0] ?? resolve23(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
16356
16410
  }, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
16357
16411
  try {
16358
16412
  Bun.resolveSync(specifier, process.cwd());
@@ -16463,7 +16517,7 @@ __export(exports_buildAngularVendor, {
16463
16517
  import { mkdirSync as mkdirSync8 } from "fs";
16464
16518
  import { join as join21 } from "path";
16465
16519
  import { rm as rm6 } from "fs/promises";
16466
- var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
16520
+ var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
16467
16521
  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) => {
16468
16522
  try {
16469
16523
  Bun.resolveSync(specifier, process.cwd());
@@ -16475,7 +16529,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
16475
16529
  const angular = new Set;
16476
16530
  const transitiveRoots = new Set;
16477
16531
  const transpiler6 = new Bun.Transpiler({ loader: "tsx" });
16478
- const glob = new Glob6("**/*.{ts,tsx,js,jsx}");
16532
+ const glob = new Glob7("**/*.{ts,tsx,js,jsx}");
16479
16533
  for (const dir of directories) {
16480
16534
  try {
16481
16535
  for await (const file4 of glob.scan({ absolute: true, cwd: dir })) {
@@ -17002,9 +17056,9 @@ import {
17002
17056
  statSync as statSync2,
17003
17057
  writeFileSync as writeFileSync7
17004
17058
  } from "fs";
17005
- import { basename as basename8, dirname as dirname15, extname as extname8, join as join25, relative as relative13, resolve as resolve23 } from "path";
17059
+ import { basename as basename8, dirname as dirname15, extname as extname8, join as join25, relative as relative13, resolve as resolve24 } from "path";
17006
17060
  import { cwd, env as env2, exit } from "process";
17007
- var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
17061
+ var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
17008
17062
  var isDev, isBuildTraceEnabled = () => {
17009
17063
  const value = env2.ABSOLUTE_BUILD_TRACE?.toLowerCase();
17010
17064
  return value === "1" || value === "true" || value === "yes";
@@ -17078,7 +17132,7 @@ var isDev, isBuildTraceEnabled = () => {
17078
17132
  exit(1);
17079
17133
  }, copyHtmxVendor = (htmxDir, htmxDestDir) => {
17080
17134
  mkdirSync11(htmxDestDir, { recursive: true });
17081
- const glob = new Glob7("htmx*.min.js");
17135
+ const glob = new Glob8("htmx*.min.js");
17082
17136
  for (const relPath of glob.scanSync({ cwd: htmxDir })) {
17083
17137
  const src = join25(htmxDir, relPath);
17084
17138
  const dest = join25(htmxDestDir, "htmx.min.js");
@@ -17093,8 +17147,8 @@ var isDev, isBuildTraceEnabled = () => {
17093
17147
  }
17094
17148
  }, resolveAbsoluteVersion = async () => {
17095
17149
  const candidates = [
17096
- resolve23(import.meta.dir, "..", "..", "package.json"),
17097
- resolve23(import.meta.dir, "..", "package.json")
17150
+ resolve24(import.meta.dir, "..", "..", "package.json"),
17151
+ resolve24(import.meta.dir, "..", "package.json")
17098
17152
  ];
17099
17153
  const resolveCandidate = async (remaining) => {
17100
17154
  const [candidate, ...rest] = remaining;
@@ -17110,7 +17164,7 @@ var isDev, isBuildTraceEnabled = () => {
17110
17164
  };
17111
17165
  await resolveCandidate(candidates);
17112
17166
  }, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
17113
- const absPath = resolve23(file4, "..", relPath);
17167
+ const absPath = resolve24(file4, "..", relPath);
17114
17168
  try {
17115
17169
  statSync2(absPath);
17116
17170
  workerPaths.add(absPath);
@@ -17130,7 +17184,7 @@ var isDev, isBuildTraceEnabled = () => {
17130
17184
  collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
17131
17185
  }
17132
17186
  }, scanWorkerReferencesInDir = async (dir, patterns, workerPaths) => {
17133
- const glob = new Glob7("**/*.{ts,tsx,js,jsx,svelte,vue}");
17187
+ const glob = new Glob8("**/*.{ts,tsx,js,jsx,svelte,vue}");
17134
17188
  for await (const file4 of glob.scan({ absolute: true, cwd: dir })) {
17135
17189
  const relToDir = file4.slice(dir.length + 1);
17136
17190
  const [firstSegment] = relToDir.split("/");
@@ -17172,7 +17226,7 @@ var isDev, isBuildTraceEnabled = () => {
17172
17226
  return;
17173
17227
  }
17174
17228
  const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
17175
- const pagesRel = relative13(process.cwd(), resolve23(reactPagesPath)).replace(/\\/g, "/");
17229
+ const pagesRel = relative13(process.cwd(), resolve24(reactPagesPath)).replace(/\\/g, "/");
17176
17230
  for (const file4 of indexFiles) {
17177
17231
  let content = readFileSync13(join25(reactIndexesPath, file4), "utf-8");
17178
17232
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
@@ -17180,27 +17234,27 @@ var isDev, isBuildTraceEnabled = () => {
17180
17234
  }
17181
17235
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
17182
17236
  const svelteIndexDir = join25(getFrameworkGeneratedDir("svelte"), "indexes");
17183
- const sveltePageEntries = svelteEntries.filter((file4) => resolve23(file4).startsWith(resolve23(sveltePagesPath)));
17237
+ const sveltePageEntries = svelteEntries.filter((file4) => resolve24(file4).startsWith(resolve24(sveltePagesPath)));
17184
17238
  for (const entry of sveltePageEntries) {
17185
17239
  const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
17186
17240
  const indexFile = join25(svelteIndexDir, "pages", `${name}.js`);
17187
17241
  if (!existsSync20(indexFile))
17188
17242
  continue;
17189
17243
  let content = readFileSync13(indexFile, "utf-8");
17190
- const srcRel = relative13(process.cwd(), resolve23(entry)).replace(/\\/g, "/");
17244
+ const srcRel = relative13(process.cwd(), resolve24(entry)).replace(/\\/g, "/");
17191
17245
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
17192
17246
  writeFileSync7(join25(devIndexDir, `${name}.svelte.js`), content);
17193
17247
  }
17194
17248
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
17195
17249
  const vueIndexDir = join25(getFrameworkGeneratedDir("vue"), "indexes");
17196
- const vuePageEntries = vueEntries.filter((file4) => resolve23(file4).startsWith(resolve23(vuePagesPath)));
17250
+ const vuePageEntries = vueEntries.filter((file4) => resolve24(file4).startsWith(resolve24(vuePagesPath)));
17197
17251
  for (const entry of vuePageEntries) {
17198
17252
  const name = basename8(entry, ".vue");
17199
17253
  const indexFile = join25(vueIndexDir, `${name}.js`);
17200
17254
  if (!existsSync20(indexFile))
17201
17255
  continue;
17202
17256
  let content = readFileSync13(indexFile, "utf-8");
17203
- const srcRel = relative13(process.cwd(), resolve23(entry)).replace(/\\/g, "/");
17257
+ const srcRel = relative13(process.cwd(), resolve24(entry)).replace(/\\/g, "/");
17204
17258
  content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
17205
17259
  writeFileSync7(join25(devIndexDir, `${name}.vue.js`), content);
17206
17260
  }
@@ -17213,7 +17267,7 @@ var isDev, isBuildTraceEnabled = () => {
17213
17267
  const last = allComments[allComments.length - 1];
17214
17268
  if (!last?.[1])
17215
17269
  return JSON.stringify(outputPath);
17216
- const srcPath = resolve23(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
17270
+ const srcPath = resolve24(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
17217
17271
  return JSON.stringify(srcPath);
17218
17272
  }, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
17219
17273
  let depth = 0;
@@ -17538,13 +17592,13 @@ ${content.slice(firstUseIdx)}`;
17538
17592
  const filterToIncrementalEntries = (entryPoints, mapToSource) => {
17539
17593
  if (!isIncremental || !incrementalFiles)
17540
17594
  return entryPoints;
17541
- const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve23(f2)));
17595
+ const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve24(f2)));
17542
17596
  const matchingEntries = [];
17543
17597
  for (const entry of entryPoints) {
17544
17598
  const sourceFile = mapToSource(entry);
17545
17599
  if (!sourceFile)
17546
17600
  continue;
17547
- if (!normalizedIncremental.has(resolve23(sourceFile)))
17601
+ if (!normalizedIncremental.has(resolve24(sourceFile)))
17548
17602
  continue;
17549
17603
  matchingEntries.push(entry);
17550
17604
  }
@@ -17559,7 +17613,15 @@ ${content.slice(firstUseIdx)}`;
17559
17613
  recursive: true
17560
17614
  }));
17561
17615
  }
17562
- const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isTailwindCandidate)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig)) : undefined;
17616
+ const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isTailwindCandidate)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig, computeFrameworkTailwindSources({
17617
+ angularDirectory,
17618
+ emberDirectory,
17619
+ htmlDirectory,
17620
+ htmxDirectory,
17621
+ reactDirectory,
17622
+ svelteDirectory,
17623
+ vueDirectory
17624
+ }), normalizedIncrementalFiles ?? [])) : undefined;
17563
17625
  const emptyConventionResult = {
17564
17626
  conventions: undefined,
17565
17627
  pageFiles: []
@@ -17591,7 +17653,7 @@ ${content.slice(firstUseIdx)}`;
17591
17653
  reactPagesPath ? tracePhase("scan/react-conventions", () => scanConventions(reactPagesPath, "*.tsx")) : emptyConventionResult,
17592
17654
  sveltePagesPath ? tracePhase("scan/svelte-conventions", () => scanConventions(sveltePagesPath, "*.svelte")) : emptyConventionResult,
17593
17655
  vuePagesPath ? tracePhase("scan/vue-conventions", () => scanConventions(vuePagesPath, "*.vue")) : emptyConventionResult,
17594
- angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "*.ts")) : emptyConventionResult,
17656
+ angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "**/*.ts")) : emptyConventionResult,
17595
17657
  emberPagesPath ? tracePhase("scan/ember-conventions", () => scanConventions(emberPagesPath, "*.{gjs,gts,ts}")) : emptyConventionResult,
17596
17658
  tracePhase("scan/html-conventions", async () => Promise.all(htmlConventionDirs.map((dir) => scanConventions(dir, "*.html")))),
17597
17659
  stylesDir ? tracePhase("scan/css", () => scanCssEntryPoints(stylesDir, stylesIgnore)) : []
@@ -17701,7 +17763,7 @@ ${content.slice(firstUseIdx)}`;
17701
17763
  }
17702
17764
  const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
17703
17765
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
17704
- if (entry.startsWith(resolve23(reactIndexesPath))) {
17766
+ if (entry.startsWith(resolve24(reactIndexesPath))) {
17705
17767
  const pageName = basename8(entry, ".tsx");
17706
17768
  return join25(reactPagesPath, `${pageName}.tsx`);
17707
17769
  }
@@ -17808,7 +17870,7 @@ ${content.slice(firstUseIdx)}`;
17808
17870
  const clientPath = islandSvelteClientPaths[idx];
17809
17871
  if (!sourcePath || !clientPath)
17810
17872
  continue;
17811
- islandSvelteClientPathMap.set(resolve23(sourcePath), clientPath);
17873
+ islandSvelteClientPathMap.set(resolve24(sourcePath), clientPath);
17812
17874
  }
17813
17875
  const islandVueClientPathMap = new Map;
17814
17876
  for (let idx = 0;idx < islandVueSources.length; idx++) {
@@ -17816,7 +17878,7 @@ ${content.slice(firstUseIdx)}`;
17816
17878
  const clientPath = islandVueClientPaths[idx];
17817
17879
  if (!sourcePath || !clientPath)
17818
17880
  continue;
17819
- islandVueClientPathMap.set(resolve23(sourcePath), clientPath);
17881
+ islandVueClientPathMap.set(resolve24(sourcePath), clientPath);
17820
17882
  }
17821
17883
  const islandAngularClientPathMap = new Map;
17822
17884
  for (let idx = 0;idx < islandAngularSources.length; idx++) {
@@ -17824,7 +17886,7 @@ ${content.slice(firstUseIdx)}`;
17824
17886
  const clientPath = islandAngularClientPaths[idx];
17825
17887
  if (!sourcePath || !clientPath)
17826
17888
  continue;
17827
- islandAngularClientPathMap.set(resolve23(sourcePath), clientPath);
17889
+ islandAngularClientPathMap.set(resolve24(sourcePath), clientPath);
17828
17890
  }
17829
17891
  const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
17830
17892
  const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
@@ -18705,8 +18767,8 @@ __export(exports_dependencyGraph, {
18705
18767
  addFileToGraph: () => addFileToGraph
18706
18768
  });
18707
18769
  import { existsSync as existsSync22, readFileSync as readFileSync14 } from "fs";
18708
- var {Glob: Glob8 } = globalThis.Bun;
18709
- import { resolve as resolve24 } from "path";
18770
+ var {Glob: Glob9 } = globalThis.Bun;
18771
+ import { resolve as resolve25 } from "path";
18710
18772
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
18711
18773
  const lower = filePath.toLowerCase();
18712
18774
  if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
@@ -18720,8 +18782,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
18720
18782
  if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
18721
18783
  return null;
18722
18784
  }
18723
- const fromDir = resolve24(fromFile, "..");
18724
- const normalized = resolve24(fromDir, importPath);
18785
+ const fromDir = resolve25(fromFile, "..");
18786
+ const normalized = resolve25(fromDir, importPath);
18725
18787
  const extensions = [
18726
18788
  ".ts",
18727
18789
  ".tsx",
@@ -18751,7 +18813,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
18751
18813
  dependents.delete(normalizedPath);
18752
18814
  }
18753
18815
  }, addFileToGraph = (graph, filePath) => {
18754
- const normalizedPath = resolve24(filePath);
18816
+ const normalizedPath = resolve25(filePath);
18755
18817
  if (!existsSync22(normalizedPath))
18756
18818
  return;
18757
18819
  const dependencies = extractDependencies(normalizedPath);
@@ -18765,13 +18827,23 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
18765
18827
  graph.dependents.get(dep)?.add(normalizedPath);
18766
18828
  };
18767
18829
  dependencies.forEach(addDependent);
18830
+ for (const [otherFile, otherDeps] of graph.dependencies) {
18831
+ if (otherFile === normalizedPath)
18832
+ continue;
18833
+ if (otherDeps.has(normalizedPath)) {
18834
+ if (!graph.dependents.has(normalizedPath)) {
18835
+ graph.dependents.set(normalizedPath, new Set);
18836
+ }
18837
+ graph.dependents.get(normalizedPath)?.add(otherFile);
18838
+ }
18839
+ }
18768
18840
  }, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
18769
18841
  const processedFiles = new Set;
18770
- const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
18771
- const resolvedDirs = directories.map((dir) => resolve24(dir)).filter((dir) => existsSync22(dir));
18842
+ const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
18843
+ const resolvedDirs = directories.map((dir) => resolve25(dir)).filter((dir) => existsSync22(dir));
18772
18844
  const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
18773
18845
  for (const file4 of allFiles) {
18774
- const fullPath = resolve24(file4);
18846
+ const fullPath = resolve25(file4);
18775
18847
  if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
18776
18848
  continue;
18777
18849
  if (processedFiles.has(fullPath))
@@ -18884,7 +18956,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
18884
18956
  return [];
18885
18957
  }
18886
18958
  }, getAffectedFiles = (graph, changedFile) => {
18887
- const normalizedPath = resolve24(changedFile);
18959
+ const normalizedPath = resolve25(changedFile);
18888
18960
  const affected = new Set;
18889
18961
  const toProcess = [normalizedPath];
18890
18962
  const processNode = (current) => {
@@ -18913,18 +18985,9 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
18913
18985
  }
18914
18986
  graph.dependencies.delete(normalizedPath);
18915
18987
  }, removeDependentsForFile = (graph, normalizedPath) => {
18916
- const dependents = graph.dependents.get(normalizedPath);
18917
- if (!dependents)
18918
- return;
18919
- for (const dependent of dependents) {
18920
- const depList = graph.dependencies.get(dependent);
18921
- if (!depList)
18922
- continue;
18923
- depList.delete(normalizedPath);
18924
- }
18925
18988
  graph.dependents.delete(normalizedPath);
18926
18989
  }, removeFileFromGraph = (graph, filePath) => {
18927
- const normalizedPath = resolve24(filePath);
18990
+ const normalizedPath = resolve25(filePath);
18928
18991
  removeDepsForFile(graph, normalizedPath);
18929
18992
  removeDependentsForFile(graph, normalizedPath);
18930
18993
  };
@@ -18967,12 +19030,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
18967
19030
  };
18968
19031
 
18969
19032
  // src/dev/configResolver.ts
18970
- import { resolve as resolve25 } from "path";
19033
+ import { resolve as resolve26 } from "path";
18971
19034
  var resolveBuildPaths = (config) => {
18972
19035
  const cwd2 = process.cwd();
18973
19036
  const normalize = (path) => path.replace(/\\/g, "/");
18974
- const withDefault = (value, fallback) => normalize(resolve25(cwd2, value ?? fallback));
18975
- const optional = (value) => value ? normalize(resolve25(cwd2, value)) : undefined;
19037
+ const withDefault = (value, fallback) => normalize(resolve26(cwd2, value ?? fallback));
19038
+ const optional = (value) => value ? normalize(resolve26(cwd2, value)) : undefined;
18976
19039
  return {
18977
19040
  angularDir: optional(config.angularDirectory),
18978
19041
  assetsDir: optional(config.assetsDirectory),
@@ -19026,7 +19089,7 @@ var init_clientManager = __esm(() => {
19026
19089
 
19027
19090
  // src/dev/pathUtils.ts
19028
19091
  import { existsSync as existsSync23, readdirSync, readFileSync as readFileSync15 } from "fs";
19029
- import { dirname as dirname16, resolve as resolve26 } from "path";
19092
+ import { dirname as dirname16, resolve as resolve27 } from "path";
19030
19093
  var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19031
19094
  if (shouldIgnorePath(filePath, resolved)) {
19032
19095
  return "ignored";
@@ -19102,7 +19165,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19102
19165
  return "unknown";
19103
19166
  }, collectAngularResourceDirs = (angularDir) => {
19104
19167
  const out = new Set;
19105
- const angularRoot = resolve26(angularDir);
19168
+ const angularRoot = resolve27(angularDir);
19106
19169
  const angularRootNormalized = normalizePath(angularRoot);
19107
19170
  const walk = (dir) => {
19108
19171
  let entries;
@@ -19115,7 +19178,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19115
19178
  if (entry.name.startsWith(".") || entry.name === "node_modules") {
19116
19179
  continue;
19117
19180
  }
19118
- const full = resolve26(dir, entry.name);
19181
+ const full = resolve27(dir, entry.name);
19119
19182
  if (entry.isDirectory()) {
19120
19183
  walk(full);
19121
19184
  continue;
@@ -19156,7 +19219,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19156
19219
  }
19157
19220
  const componentDir = dirname16(full);
19158
19221
  for (const ref of refs) {
19159
- const refAbs = normalizePath(resolve26(componentDir, ref));
19222
+ const refAbs = normalizePath(resolve27(componentDir, ref));
19160
19223
  const refDir = normalizePath(dirname16(refAbs));
19161
19224
  if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
19162
19225
  continue;
@@ -19173,7 +19236,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19173
19236
  const push = (path) => {
19174
19237
  if (!path)
19175
19238
  return;
19176
- const abs = normalizePath(resolve26(cwd2, path));
19239
+ const abs = normalizePath(resolve27(cwd2, path));
19177
19240
  if (!roots.includes(abs))
19178
19241
  roots.push(abs);
19179
19242
  };
@@ -19198,7 +19261,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19198
19261
  push(cfg.assetsDir);
19199
19262
  push(cfg.stylesDir);
19200
19263
  for (const candidate of ["src", "db", "assets", "styles"]) {
19201
- const abs = normalizePath(resolve26(cwd2, candidate));
19264
+ const abs = normalizePath(resolve27(cwd2, candidate));
19202
19265
  if (existsSync23(abs) && !roots.includes(abs))
19203
19266
  roots.push(abs);
19204
19267
  }
@@ -19210,7 +19273,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19210
19273
  continue;
19211
19274
  if (entry.name.startsWith("."))
19212
19275
  continue;
19213
- const abs = normalizePath(resolve26(cwd2, entry.name));
19276
+ const abs = normalizePath(resolve27(cwd2, entry.name));
19214
19277
  if (roots.includes(abs))
19215
19278
  continue;
19216
19279
  if (shouldIgnorePath(abs, resolved))
@@ -19284,8 +19347,8 @@ var init_pathUtils = __esm(() => {
19284
19347
 
19285
19348
  // src/dev/fileWatcher.ts
19286
19349
  import { watch } from "fs";
19287
- import { existsSync as existsSync24 } from "fs";
19288
- import { join as join27, resolve as resolve27 } from "path";
19350
+ import { existsSync as existsSync24, readdirSync as readdirSync2, statSync as statSync3 } from "fs";
19351
+ import { dirname as dirname17, join as join27, resolve as resolve28 } from "path";
19289
19352
  var safeRemoveFromGraph = (graph, fullPath) => {
19290
19353
  try {
19291
19354
  removeFileFromGraph(graph, fullPath);
@@ -19304,12 +19367,48 @@ var safeRemoveFromGraph = (graph, fullPath) => {
19304
19367
  operation: "add"
19305
19368
  });
19306
19369
  }
19307
- }, shouldSkipFilename = (filename, isStylesDir) => !isStylesDir && (filename === "compiled" || filename === "generated" || filename === "build" || filename === "indexes" || filename === "server" || filename === "client" || filename.includes("/compiled/") || filename.includes("/generated/") || filename.includes("/build/") || filename.includes("/indexes/") || filename.includes("/server/") || filename.includes("/client/") || filename.startsWith("compiled/") || filename.startsWith("generated/") || filename.startsWith("build/") || filename.startsWith("indexes/") || filename.startsWith("server/") || filename.startsWith("client/")) || filename.endsWith("/") || filename.includes(".tmp.") || filename.endsWith(".tmp") || filename.endsWith("~") || filename.startsWith(".#"), setupWatcher = (absolutePath, isStylesDir, state, onFileChange) => {
19308
- const watcher = watch(absolutePath, { recursive: true }, (event, filename) => {
19309
- if (!filename) {
19370
+ }, ATOMIC_WRITE_TEMP_PATTERNS, shouldSkipFilename = (filename, isStylesDir) => !isStylesDir && (filename === "compiled" || filename === "generated" || filename === "build" || filename === "indexes" || filename === "server" || filename === "client" || filename.includes("/compiled/") || filename.includes("/generated/") || filename.includes("/build/") || filename.includes("/indexes/") || filename.includes("/server/") || filename.includes("/client/") || filename.startsWith("compiled/") || filename.startsWith("generated/") || filename.startsWith("build/") || filename.startsWith("indexes/") || filename.startsWith("server/") || filename.startsWith("client/")) || filename.endsWith("/") || filename.includes(".tmp.") || filename.endsWith(".tmp") || filename.endsWith("~") || filename.startsWith(".#") || ATOMIC_WRITE_TEMP_PATTERNS.some((re2) => re2.test(filename)), setupWatcher = (absolutePath, isStylesDir, state, onFileChange) => {
19371
+ const ATOMIC_RECOVERY_WINDOW_MS = 1000;
19372
+ const recentlySynthesized = new Map;
19373
+ const atomicRecoveryScan = (eventDir) => {
19374
+ let entries;
19375
+ try {
19376
+ entries = readdirSync2(eventDir);
19377
+ } catch {
19310
19378
  return;
19311
19379
  }
19380
+ const now = Date.now();
19381
+ for (const name of entries) {
19382
+ if (shouldSkipFilename(name, isStylesDir))
19383
+ continue;
19384
+ const child = join27(eventDir, name).replace(/\\/g, "/");
19385
+ let st2;
19386
+ try {
19387
+ st2 = statSync3(child);
19388
+ } catch {
19389
+ continue;
19390
+ }
19391
+ if (!st2.isFile())
19392
+ continue;
19393
+ const age = now - st2.ctimeMs;
19394
+ if (age < 0 || age > ATOMIC_RECOVERY_WINDOW_MS)
19395
+ continue;
19396
+ const last = recentlySynthesized.get(child) ?? 0;
19397
+ if (now - last < 100)
19398
+ continue;
19399
+ recentlySynthesized.set(child, now);
19400
+ onFileChange(child);
19401
+ safeAddToGraph(state.dependencyGraph, child);
19402
+ }
19403
+ };
19404
+ const watcher = watch(absolutePath, { recursive: true }, (event, filename) => {
19405
+ if (!filename)
19406
+ return;
19312
19407
  if (shouldSkipFilename(filename, isStylesDir)) {
19408
+ if (event === "rename") {
19409
+ const eventDir = dirname17(join27(absolutePath, filename)).replace(/\\/g, "/");
19410
+ atomicRecoveryScan(eventDir);
19411
+ }
19313
19412
  return;
19314
19413
  }
19315
19414
  const fullPath = join27(absolutePath, filename).replace(/\\/g, "/");
@@ -19330,7 +19429,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
19330
19429
  }, addFileWatchers = (state, paths, onFileChange) => {
19331
19430
  const stylesDir = state.resolvedPaths?.stylesDir;
19332
19431
  paths.forEach((path) => {
19333
- const absolutePath = resolve27(path).replace(/\\/g, "/");
19432
+ const absolutePath = resolve28(path).replace(/\\/g, "/");
19334
19433
  if (!existsSync24(absolutePath)) {
19335
19434
  return;
19336
19435
  }
@@ -19341,7 +19440,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
19341
19440
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
19342
19441
  const stylesDir = state.resolvedPaths?.stylesDir;
19343
19442
  watchPaths.forEach((path) => {
19344
- const absolutePath = resolve27(path).replace(/\\/g, "/");
19443
+ const absolutePath = resolve28(path).replace(/\\/g, "/");
19345
19444
  if (!existsSync24(absolutePath)) {
19346
19445
  return;
19347
19446
  }
@@ -19353,16 +19452,21 @@ var init_fileWatcher = __esm(() => {
19353
19452
  init_telemetryEvent();
19354
19453
  init_dependencyGraph();
19355
19454
  init_pathUtils();
19455
+ ATOMIC_WRITE_TEMP_PATTERNS = [
19456
+ /(^|\/)sed[A-Za-z0-9]{6,}$/,
19457
+ /(^|\/)4913$/,
19458
+ /(^|\/)\.absolutejs-hmr-/
19459
+ ];
19356
19460
  });
19357
19461
 
19358
19462
  // src/dev/assetStore.ts
19359
- import { resolve as resolve28 } from "path";
19463
+ import { resolve as resolve29 } from "path";
19360
19464
  import { readdir as readdir4, unlink } from "fs/promises";
19361
19465
  var mimeTypes, getMimeType = (filePath) => {
19362
19466
  const ext = filePath.slice(filePath.lastIndexOf("."));
19363
19467
  return mimeTypes[ext] ?? "application/octet-stream";
19364
19468
  }, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
19365
- const fullPath = resolve28(dir, entry.name);
19469
+ const fullPath = resolve29(dir, entry.name);
19366
19470
  if (entry.isDirectory()) {
19367
19471
  return walkAndClean(fullPath);
19368
19472
  }
@@ -19378,10 +19482,10 @@ var mimeTypes, getMimeType = (filePath) => {
19378
19482
  }, cleanStaleAssets = async (store, manifest, buildDir) => {
19379
19483
  const liveByIdentity = new Map;
19380
19484
  for (const webPath of store.keys()) {
19381
- const diskPath = resolve28(buildDir, webPath.slice(1));
19485
+ const diskPath = resolve29(buildDir, webPath.slice(1));
19382
19486
  liveByIdentity.set(stripHash(diskPath), diskPath);
19383
19487
  }
19384
- const absBuildDir = resolve28(buildDir);
19488
+ const absBuildDir = resolve29(buildDir);
19385
19489
  Object.values(manifest).forEach((val) => {
19386
19490
  if (!HASHED_FILE_RE.test(val))
19387
19491
  return;
@@ -19399,7 +19503,7 @@ var mimeTypes, getMimeType = (filePath) => {
19399
19503
  } catch {}
19400
19504
  }, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
19401
19505
  if (entry.isDirectory()) {
19402
- return scanDir(resolve28(dir, entry.name), `${prefix}${entry.name}/`);
19506
+ return scanDir(resolve29(dir, entry.name), `${prefix}${entry.name}/`);
19403
19507
  }
19404
19508
  if (!entry.name.startsWith("chunk-")) {
19405
19509
  return null;
@@ -19408,7 +19512,7 @@ var mimeTypes, getMimeType = (filePath) => {
19408
19512
  if (store.has(webPath)) {
19409
19513
  return null;
19410
19514
  }
19411
- return Bun.file(resolve28(dir, entry.name)).bytes().then((bytes) => {
19515
+ return Bun.file(resolve29(dir, entry.name)).bytes().then((bytes) => {
19412
19516
  store.set(webPath, bytes);
19413
19517
  return;
19414
19518
  }).catch(() => {});
@@ -19430,7 +19534,7 @@ var mimeTypes, getMimeType = (filePath) => {
19430
19534
  for (const webPath of newIdentities.values()) {
19431
19535
  if (store.has(webPath))
19432
19536
  continue;
19433
- loadPromises.push(Bun.file(resolve28(buildDir, webPath.slice(1))).bytes().then((bytes) => {
19537
+ loadPromises.push(Bun.file(resolve29(buildDir, webPath.slice(1))).bytes().then((bytes) => {
19434
19538
  store.set(webPath, bytes);
19435
19539
  return;
19436
19540
  }).catch(() => {}));
@@ -19461,7 +19565,7 @@ var init_assetStore = __esm(() => {
19461
19565
 
19462
19566
  // src/islands/pageMetadata.ts
19463
19567
  import { readFileSync as readFileSync16 } from "fs";
19464
- import { dirname as dirname17, resolve as resolve29 } from "path";
19568
+ import { dirname as dirname18, resolve as resolve30 } from "path";
19465
19569
  var pagePatterns, getPageDirs = (config) => [
19466
19570
  { dir: config.angularDirectory, framework: "angular" },
19467
19571
  { dir: config.emberDirectory, framework: "ember" },
@@ -19481,15 +19585,15 @@ var pagePatterns, getPageDirs = (config) => [
19481
19585
  const source = definition.buildReference?.source;
19482
19586
  if (!source)
19483
19587
  continue;
19484
- const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve29(dirname17(buildInfo.resolvedRegistryPath), source);
19485
- lookup.set(`${definition.framework}:${definition.component}`, resolve29(resolvedSource));
19588
+ const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve30(dirname18(buildInfo.resolvedRegistryPath), source);
19589
+ lookup.set(`${definition.framework}:${definition.component}`, resolve30(resolvedSource));
19486
19590
  }
19487
19591
  return lookup;
19488
19592
  }, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
19489
19593
  const candidate = usage.source;
19490
- return candidate ? resolve29(candidate) === target : false;
19594
+ return candidate ? resolve30(candidate) === target : false;
19491
19595
  }), getPagesUsingIslandSource = (sourcePath) => {
19492
- const target = resolve29(sourcePath);
19596
+ const target = resolve30(sourcePath);
19493
19597
  return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
19494
19598
  }, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
19495
19599
  const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
@@ -19501,13 +19605,13 @@ var pagePatterns, getPageDirs = (config) => [
19501
19605
  const pattern = pagePatterns[entry.framework];
19502
19606
  if (!pattern)
19503
19607
  return;
19504
- const files = await scanEntryPoints(resolve29(entry.dir), pattern);
19608
+ const files = await scanEntryPoints(resolve30(entry.dir), pattern);
19505
19609
  for (const filePath of files) {
19506
19610
  const source = readFileSync16(filePath, "utf-8");
19507
19611
  const islands = extractIslandUsagesFromSource(source);
19508
- pageMetadata.set(resolve29(filePath), {
19612
+ pageMetadata.set(resolve30(filePath), {
19509
19613
  islands: resolveIslandUsages(islands, islandSourceLookup),
19510
- pagePath: resolve29(filePath)
19614
+ pagePath: resolve30(filePath)
19511
19615
  });
19512
19616
  }
19513
19617
  }, loadPageIslandMetadata = async (config) => {
@@ -19630,9 +19734,9 @@ var init_transformCache = __esm(() => {
19630
19734
  });
19631
19735
 
19632
19736
  // src/dev/reactComponentClassifier.ts
19633
- import { resolve as resolve30 } from "path";
19737
+ import { resolve as resolve31 } from "path";
19634
19738
  var classifyComponent = (filePath) => {
19635
- const normalizedPath = resolve30(filePath);
19739
+ const normalizedPath = resolve31(filePath);
19636
19740
  if (normalizedPath.includes("/react/pages/")) {
19637
19741
  return "server";
19638
19742
  }
@@ -19644,7 +19748,7 @@ var classifyComponent = (filePath) => {
19644
19748
  var init_reactComponentClassifier = () => {};
19645
19749
 
19646
19750
  // src/dev/moduleMapper.ts
19647
- import { basename as basename9, resolve as resolve31 } from "path";
19751
+ import { basename as basename9, resolve as resolve32 } from "path";
19648
19752
  var buildModulePaths = (moduleKeys, manifest) => {
19649
19753
  const modulePaths = {};
19650
19754
  moduleKeys.forEach((key) => {
@@ -19654,7 +19758,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
19654
19758
  });
19655
19759
  return modulePaths;
19656
19760
  }, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
19657
- const normalizedFile = resolve31(sourceFile);
19761
+ const normalizedFile = resolve32(sourceFile);
19658
19762
  const normalizedPath = normalizedFile.replace(/\\/g, "/");
19659
19763
  if (processedFiles.has(normalizedFile)) {
19660
19764
  return null;
@@ -19690,7 +19794,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
19690
19794
  });
19691
19795
  return grouped;
19692
19796
  }, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
19693
- const normalizedFile = resolve31(sourceFile);
19797
+ const normalizedFile = resolve32(sourceFile);
19694
19798
  const fileName = basename9(normalizedFile);
19695
19799
  const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
19696
19800
  const pascalName = toPascal(baseName);
@@ -19751,15 +19855,15 @@ __export(exports_resolveOwningComponents, {
19751
19855
  resolveDescendantsOfParent: () => resolveDescendantsOfParent,
19752
19856
  invalidateResourceIndex: () => invalidateResourceIndex
19753
19857
  });
19754
- import { readdirSync as readdirSync2, readFileSync as readFileSync18, statSync as statSync3 } from "fs";
19755
- import { dirname as dirname18, extname as extname9, join as join28, resolve as resolve32 } from "path";
19858
+ import { readdirSync as readdirSync3, readFileSync as readFileSync18, statSync as statSync4 } from "fs";
19859
+ import { dirname as dirname19, extname as extname9, join as join28, resolve as resolve33 } from "path";
19756
19860
  import ts7 from "typescript";
19757
19861
  var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") || file4.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
19758
19862
  const out = [];
19759
19863
  const visit = (dir) => {
19760
19864
  let entries;
19761
19865
  try {
19762
- entries = readdirSync2(dir, { withFileTypes: true });
19866
+ entries = readdirSync3(dir, { withFileTypes: true });
19763
19867
  } catch {
19764
19868
  return;
19765
19869
  }
@@ -19865,7 +19969,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
19865
19969
  };
19866
19970
  visit(sourceFile);
19867
19971
  return out;
19868
- }, safeNormalize = (path) => resolve32(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
19972
+ }, safeNormalize = (path) => resolve33(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
19869
19973
  const { changedFilePath, userAngularRoot } = params;
19870
19974
  const changedAbs = safeNormalize(changedFilePath);
19871
19975
  const out = [];
@@ -19886,7 +19990,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
19886
19990
  }
19887
19991
  let rootStat;
19888
19992
  try {
19889
- rootStat = statSync3(userAngularRoot);
19993
+ rootStat = statSync4(userAngularRoot);
19890
19994
  } catch {
19891
19995
  return out;
19892
19996
  }
@@ -19906,7 +20010,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
19906
20010
  return null;
19907
20011
  }
19908
20012
  const sf = ts7.createSourceFile(childFilePath, source, ts7.ScriptTarget.ES2022, true, ts7.ScriptKind.TS);
19909
- const childDir = dirname18(childFilePath);
20013
+ const childDir = dirname19(childFilePath);
19910
20014
  for (const stmt of sf.statements) {
19911
20015
  if (!ts7.isImportDeclaration(stmt))
19912
20016
  continue;
@@ -19934,7 +20038,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
19934
20038
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
19935
20039
  return null;
19936
20040
  }
19937
- const base = resolve32(childDir, spec);
20041
+ const base = resolve33(childDir, spec);
19938
20042
  const candidates = [
19939
20043
  `${base}.ts`,
19940
20044
  `${base}.tsx`,
@@ -19944,7 +20048,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
19944
20048
  const angularRootNorm = safeNormalize(angularRoot);
19945
20049
  for (const candidate of candidates) {
19946
20050
  try {
19947
- if (statSync3(candidate).isFile()) {
20051
+ if (statSync4(candidate).isFile()) {
19948
20052
  const norm = safeNormalize(candidate);
19949
20053
  if (!norm.startsWith(angularRootNorm))
19950
20054
  return null;
@@ -19963,7 +20067,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
19963
20067
  const parentFile = new Map;
19964
20068
  for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
19965
20069
  const classes = parseDecoratedClasses(tsPath);
19966
- const componentDir = dirname18(tsPath);
20070
+ const componentDir = dirname19(tsPath);
19967
20071
  for (const cls of classes) {
19968
20072
  const entity = {
19969
20073
  className: cls.className,
@@ -19972,7 +20076,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
19972
20076
  };
19973
20077
  if (cls.kind === "component") {
19974
20078
  for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
19975
- const abs = safeNormalize(resolve32(componentDir, url));
20079
+ const abs = safeNormalize(resolve33(componentDir, url));
19976
20080
  const existing = resource.get(abs);
19977
20081
  if (existing)
19978
20082
  existing.push(entity);
@@ -19999,7 +20103,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file4) => file4.endsWith(".ts") ||
19999
20103
  const norm = safeNormalize(params.changedFilePath);
20000
20104
  let rootStat;
20001
20105
  try {
20002
- rootStat = statSync3(params.userAngularRoot);
20106
+ rootStat = statSync4(params.userAngularRoot);
20003
20107
  } catch {
20004
20108
  return [];
20005
20109
  }
@@ -20042,6 +20146,13 @@ var isValidHMRClientMessage = (data) => {
20042
20146
  };
20043
20147
 
20044
20148
  // src/dev/webSocket.ts
20149
+ var exports_webSocket = {};
20150
+ __export(exports_webSocket, {
20151
+ handleHMRMessage: () => handleHMRMessage,
20152
+ handleClientDisconnect: () => handleClientDisconnect,
20153
+ handleClientConnect: () => handleClientConnect,
20154
+ broadcastToClients: () => broadcastToClients
20155
+ });
20045
20156
  var trySendMessage = (client, messageStr) => {
20046
20157
  try {
20047
20158
  client.send(messageStr);
@@ -20142,14 +20253,6 @@ var init_webSocket = __esm(() => {
20142
20253
  init_logger();
20143
20254
  });
20144
20255
 
20145
- // src/core/ssrCache.ts
20146
- var dirtyFrameworks, isSsrCacheDirty = (framework) => dirtyFrameworks.has(framework), markSsrCacheDirty = (framework) => {
20147
- dirtyFrameworks.add(framework);
20148
- };
20149
- var init_ssrCache = __esm(() => {
20150
- dirtyFrameworks = new Set;
20151
- });
20152
-
20153
20256
  // src/utils/loadConfig.ts
20154
20257
  var exports_loadConfig = {};
20155
20258
  __export(exports_loadConfig, {
@@ -20158,7 +20261,7 @@ __export(exports_loadConfig, {
20158
20261
  isWorkspaceConfig: () => isWorkspaceConfig,
20159
20262
  getWorkspaceServices: () => getWorkspaceServices
20160
20263
  });
20161
- import { resolve as resolve33 } from "path";
20264
+ import { resolve as resolve34 } from "path";
20162
20265
  var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject2(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
20163
20266
  if (!isObject2(config)) {
20164
20267
  return false;
@@ -20209,7 +20312,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject2 = (value) => typeof value === "object" &&
20209
20312
  }
20210
20313
  return config;
20211
20314
  }, loadRawConfig = async (configPath2) => {
20212
- const resolved = resolve33(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
20315
+ const resolved = resolve34(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
20213
20316
  const mod = await import(resolved);
20214
20317
  const config = mod.default ?? mod.config;
20215
20318
  if (!config) {
@@ -20269,8 +20372,8 @@ __export(exports_moduleServer, {
20269
20372
  createModuleServer: () => createModuleServer,
20270
20373
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
20271
20374
  });
20272
- import { existsSync as existsSync25, readFileSync as readFileSync19, statSync as statSync4 } from "fs";
20273
- import { basename as basename10, dirname as dirname19, extname as extname10, join as join29, resolve as resolve34, relative as relative14 } from "path";
20375
+ import { existsSync as existsSync25, readFileSync as readFileSync19, statSync as statSync5 } from "fs";
20376
+ import { basename as basename10, dirname as dirname20, extname as extname10, join as join29, resolve as resolve35, relative as relative14 } from "path";
20274
20377
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
20275
20378
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
20276
20379
  const allExports = [];
@@ -20290,7 +20393,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
20290
20393
  ${stubs}
20291
20394
  `;
20292
20395
  }, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
20293
- const found = extensions.find((ext) => existsSync25(resolve34(projectRoot, srcPath + ext)));
20396
+ const found = extensions.find((ext) => existsSync25(resolve35(projectRoot, srcPath + ext)));
20294
20397
  return found ? srcPath + found : srcPath;
20295
20398
  }, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
20296
20399
  const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
@@ -20305,24 +20408,24 @@ ${stubs}
20305
20408
  return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
20306
20409
  }, srcUrl = (relPath, projectRoot) => {
20307
20410
  const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
20308
- const absPath = resolve34(projectRoot, relPath);
20411
+ const absPath = resolve35(projectRoot, relPath);
20309
20412
  const cached = mtimeCache.get(absPath);
20310
20413
  if (cached !== undefined)
20311
20414
  return `${base}?v=${buildVersion(cached, absPath)}`;
20312
20415
  try {
20313
- const mtime = Math.round(statSync4(absPath).mtimeMs);
20416
+ const mtime = Math.round(statSync5(absPath).mtimeMs);
20314
20417
  mtimeCache.set(absPath, mtime);
20315
20418
  return `${base}?v=${buildVersion(mtime, absPath)}`;
20316
20419
  } catch {
20317
20420
  return base;
20318
20421
  }
20319
20422
  }, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
20320
- const absPath = resolve34(fileDir, relPath);
20423
+ const absPath = resolve35(fileDir, relPath);
20321
20424
  const rel = relative14(projectRoot, absPath);
20322
20425
  const extension = extname10(rel);
20323
20426
  let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
20324
20427
  if (extname10(srcPath) === ".svelte") {
20325
- srcPath = relative14(projectRoot, resolveSvelteModulePath(resolve34(projectRoot, srcPath)));
20428
+ srcPath = relative14(projectRoot, resolveSvelteModulePath(resolve35(projectRoot, srcPath)));
20326
20429
  }
20327
20430
  return srcUrl(srcPath, projectRoot);
20328
20431
  }, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
@@ -20341,13 +20444,13 @@ ${stubs}
20341
20444
  const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
20342
20445
  const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
20343
20446
  if (!subpath) {
20344
- const pkgDir = resolve34(projectRoot, "node_modules", packageName ?? "");
20447
+ const pkgDir = resolve35(projectRoot, "node_modules", packageName ?? "");
20345
20448
  const pkgJsonPath = join29(pkgDir, "package.json");
20346
20449
  if (existsSync25(pkgJsonPath)) {
20347
20450
  const pkg = JSON.parse(readFileSync19(pkgJsonPath, "utf-8"));
20348
20451
  const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
20349
20452
  if (esmEntry) {
20350
- const resolved = resolve34(pkgDir, esmEntry);
20453
+ const resolved = resolve35(pkgDir, esmEntry);
20351
20454
  if (existsSync25(resolved))
20352
20455
  return relative14(projectRoot, resolved);
20353
20456
  }
@@ -20379,7 +20482,7 @@ ${stubs}
20379
20482
  };
20380
20483
  result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
20381
20484
  result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
20382
- const fileDir = dirname19(filePath);
20485
+ const fileDir = dirname20(filePath);
20383
20486
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
20384
20487
  result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
20385
20488
  result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
@@ -20394,12 +20497,12 @@ ${stubs}
20394
20497
  result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
20395
20498
  result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
20396
20499
  result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
20397
- const absPath = resolve34(fileDir, relPath);
20500
+ const absPath = resolve35(fileDir, relPath);
20398
20501
  const rel = relative14(projectRoot, absPath);
20399
20502
  return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
20400
20503
  });
20401
20504
  result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
20402
- const absPath = resolve34(fileDir, relPath);
20505
+ const absPath = resolve35(fileDir, relPath);
20403
20506
  const rel = relative14(projectRoot, absPath);
20404
20507
  return `'${srcUrl(rel, projectRoot)}'`;
20405
20508
  });
@@ -20712,7 +20815,7 @@ ${code}`;
20712
20815
  code = injectVueHmr(code, filePath, projectRoot, vueDir);
20713
20816
  return rewriteImports(code, filePath, projectRoot, rewriter);
20714
20817
  }, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
20715
- const hmrBase = vueDir ? resolve34(vueDir) : projectRoot;
20818
+ const hmrBase = vueDir ? resolve35(vueDir) : projectRoot;
20716
20819
  const hmrId = relative14(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
20717
20820
  let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
20718
20821
  result += [
@@ -20876,7 +20979,7 @@ export default {};
20876
20979
  const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
20877
20980
  return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
20878
20981
  }, resolveSourcePath = (relPath, projectRoot) => {
20879
- const filePath = resolve34(projectRoot, relPath);
20982
+ const filePath = resolve35(projectRoot, relPath);
20880
20983
  const ext = extname10(filePath);
20881
20984
  if (ext === ".svelte")
20882
20985
  return { ext, filePath: resolveSvelteModulePath(filePath) };
@@ -20913,14 +21016,14 @@ export default {};
20913
21016
  const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
20914
21017
  const candidates = [
20915
21018
  absoluteCandidate,
20916
- resolve34(projectRoot, tail)
21019
+ resolve35(projectRoot, tail)
20917
21020
  ];
20918
21021
  try {
20919
21022
  const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
20920
21023
  const cfg = await loadConfig2();
20921
- const angularDir = cfg.angularDirectory && resolve34(projectRoot, cfg.angularDirectory);
21024
+ const angularDir = cfg.angularDirectory && resolve35(projectRoot, cfg.angularDirectory);
20922
21025
  if (angularDir)
20923
- candidates.push(resolve34(angularDir, tail));
21026
+ candidates.push(resolve35(angularDir, tail));
20924
21027
  } catch {}
20925
21028
  for (const candidate of candidates) {
20926
21029
  if (await fileExists(candidate)) {
@@ -20950,8 +21053,8 @@ export default {};
20950
21053
  return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
20951
21054
  if (!TRANSPILABLE.has(ext))
20952
21055
  return;
20953
- const stat3 = statSync4(filePath);
20954
- const resolvedVueDir = vueDir ? resolve34(vueDir) : undefined;
21056
+ const stat3 = statSync5(filePath);
21057
+ const resolvedVueDir = vueDir ? resolve35(vueDir) : undefined;
20955
21058
  let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
20956
21059
  const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
20957
21060
  if (isAngularGeneratedJs) {
@@ -20978,12 +21081,12 @@ export default {};
20978
21081
  cachedAngularUserRoot = configuredAngularUserRoot ?? null;
20979
21082
  return cachedAngularUserRoot;
20980
21083
  }, configuredAngularUserRoot, transformAndCacheSvelte = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
20981
- const stat3 = statSync4(filePath);
21084
+ const stat3 = statSync5(filePath);
20982
21085
  const content = await transformSvelteFile(filePath, projectRoot, rewriter, stylePreprocessors);
20983
21086
  setTransformed(filePath, content, stat3.mtimeMs, extractImportedFiles(content, projectRoot));
20984
21087
  return jsResponse(content);
20985
21088
  }, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
20986
- const stat3 = statSync4(filePath);
21089
+ const stat3 = statSync5(filePath);
20987
21090
  const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
20988
21091
  setTransformed(filePath, content, stat3.mtimeMs, extractImportedFiles(content, projectRoot));
20989
21092
  return jsResponse(content);
@@ -21010,7 +21113,7 @@ export default {};
21010
21113
  const relPath = pathname.slice(SRC_PREFIX.length);
21011
21114
  if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
21012
21115
  return handleBunWrapRequest();
21013
- const virtualCssResponse = handleVirtualSvelteCss(resolve34(projectRoot, relPath));
21116
+ const virtualCssResponse = handleVirtualSvelteCss(resolve35(projectRoot, relPath));
21014
21117
  if (virtualCssResponse)
21015
21118
  return virtualCssResponse;
21016
21119
  const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
@@ -21026,11 +21129,11 @@ export default {};
21026
21129
  SRC_IMPORT_RE.lastIndex = 0;
21027
21130
  while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
21028
21131
  if (match[1])
21029
- files.push(resolve34(projectRoot, match[1]));
21132
+ files.push(resolve35(projectRoot, match[1]));
21030
21133
  }
21031
21134
  return files;
21032
21135
  }, invalidateModule = (filePath) => {
21033
- const resolved = resolve34(filePath);
21136
+ const resolved = resolve35(filePath);
21034
21137
  invalidate(filePath);
21035
21138
  if (resolved !== filePath)
21036
21139
  invalidate(resolved);
@@ -21175,7 +21278,7 @@ __export(exports_hmrCompiler, {
21175
21278
  getApplyMetadataModule: () => getApplyMetadataModule,
21176
21279
  encodeHmrComponentId: () => encodeHmrComponentId
21177
21280
  });
21178
- import { dirname as dirname20, relative as relative15, resolve as resolve35 } from "path";
21281
+ import { dirname as dirname21, relative as relative15, resolve as resolve36 } from "path";
21179
21282
  import { performance as performance2 } from "perf_hooks";
21180
21283
  var getApplyMetadataModule = async (encodedId) => {
21181
21284
  const decoded = decodeURIComponent(encodedId);
@@ -21184,7 +21287,7 @@ var getApplyMetadataModule = async (encodedId) => {
21184
21287
  return null;
21185
21288
  const filePathRel = decoded.slice(0, at2);
21186
21289
  const className = decoded.slice(at2 + 1);
21187
- const componentFilePath = resolve35(process.cwd(), filePathRel);
21290
+ const componentFilePath = resolve36(process.cwd(), filePathRel);
21188
21291
  const projectRelPath = relative15(process.cwd(), componentFilePath).replace(/\\/g, "/");
21189
21292
  const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
21190
21293
  const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
@@ -21195,7 +21298,7 @@ var getApplyMetadataModule = async (encodedId) => {
21195
21298
  const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
21196
21299
  const owners = resolveOwningComponents2({
21197
21300
  changedFilePath: componentFilePath,
21198
- userAngularRoot: dirname20(componentFilePath)
21301
+ userAngularRoot: dirname21(componentFilePath)
21199
21302
  });
21200
21303
  const owner = owners.find((o3) => o3.className === className);
21201
21304
  const kind = owner?.kind ?? "component";
@@ -21295,7 +21398,6 @@ var resolveRequestPathname = (request) => {
21295
21398
  moduleUrl.searchParams.set("t", String(emberCacheBuster));
21296
21399
  return moduleUrl.href;
21297
21400
  }, invalidateEmberSsrCache = () => {
21298
- markSsrCacheDirty("ember");
21299
21401
  emberCacheBuster = Date.now();
21300
21402
  }, buildHtmlShell = (headTag, bodyContent, indexPath, props) => {
21301
21403
  const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(props ?? {})};`;
@@ -21309,7 +21411,6 @@ var resolveRequestPathname = (request) => {
21309
21411
  const resolvedHeadTag = headTag ?? "<head></head>";
21310
21412
  try {
21311
21413
  installSimpleDomGlobals();
21312
- isSsrCacheDirty("ember");
21313
21414
  const bundle = await import(buildRuntimeModuleSpecifier(pagePath));
21314
21415
  if (typeof bundle.renderToHTML !== "function") {
21315
21416
  throw new Error(`Ember page bundle at ${pagePath} does not export renderToHTML(). Was it compiled by compileEmber()?`);
@@ -21327,9 +21428,7 @@ var resolveRequestPathname = (request) => {
21327
21428
  });
21328
21429
  }
21329
21430
  };
21330
- var init_pageHandler = __esm(() => {
21331
- init_ssrCache();
21332
- });
21431
+ var init_pageHandler = () => {};
21333
21432
 
21334
21433
  // src/ember/index.ts
21335
21434
  var exports_ember = {};
@@ -21346,11 +21445,11 @@ var exports_simpleHTMLHMR = {};
21346
21445
  __export(exports_simpleHTMLHMR, {
21347
21446
  handleHTMLUpdate: () => handleHTMLUpdate
21348
21447
  });
21349
- import { resolve as resolve36 } from "path";
21448
+ import { resolve as resolve37 } from "path";
21350
21449
  var handleHTMLUpdate = async (htmlFilePath) => {
21351
21450
  let htmlContent;
21352
21451
  try {
21353
- const resolvedPath = resolve36(htmlFilePath);
21452
+ const resolvedPath = resolve37(htmlFilePath);
21354
21453
  const file4 = Bun.file(resolvedPath);
21355
21454
  if (!await file4.exists()) {
21356
21455
  return null;
@@ -21376,11 +21475,11 @@ var exports_simpleHTMXHMR = {};
21376
21475
  __export(exports_simpleHTMXHMR, {
21377
21476
  handleHTMXUpdate: () => handleHTMXUpdate
21378
21477
  });
21379
- import { resolve as resolve37 } from "path";
21478
+ import { resolve as resolve38 } from "path";
21380
21479
  var handleHTMXUpdate = async (htmxFilePath) => {
21381
21480
  let htmlContent;
21382
21481
  try {
21383
- const resolvedPath = resolve37(htmxFilePath);
21482
+ const resolvedPath = resolve38(htmxFilePath);
21384
21483
  const file4 = Bun.file(resolvedPath);
21385
21484
  if (!await file4.exists()) {
21386
21485
  return null;
@@ -21402,19 +21501,20 @@ var handleHTMXUpdate = async (htmxFilePath) => {
21402
21501
  var init_simpleHTMXHMR = () => {};
21403
21502
 
21404
21503
  // src/dev/rebuildTrigger.ts
21405
- import { existsSync as existsSync26 } from "fs";
21406
- import { basename as basename11, dirname as dirname21, relative as relative16, resolve as resolve38, sep as sep4 } from "path";
21504
+ import { existsSync as existsSync26, rmSync as rmSync3 } from "fs";
21505
+ import { basename as basename11, dirname as dirname22, join as join30, relative as relative16, resolve as resolve39, sep as sep4 } from "path";
21407
21506
  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) => {
21408
21507
  if (!config.tailwind)
21409
21508
  return;
21410
21509
  if (!files.some(isTailwindCandidate))
21411
21510
  return;
21412
21511
  try {
21413
- const { cssChanged } = await incrementalTailwindBuild(config.tailwind, state.resolvedPaths.buildDir, files, getStyleTransformConfig(config));
21512
+ const { computeFrameworkTailwindSources: computeFrameworkTailwindSources2 } = await Promise.resolve().then(() => (init_compileTailwind(), exports_compileTailwind));
21513
+ const { cssChanged } = await incrementalTailwindBuild(config.tailwind, state.resolvedPaths.buildDir, files, getStyleTransformConfig(config), computeFrameworkTailwindSources2(config));
21414
21514
  if (!cssChanged)
21415
21515
  return;
21416
21516
  try {
21417
- const outputPath = resolve38(state.resolvedPaths.buildDir, config.tailwind.output);
21517
+ const outputPath = resolve39(state.resolvedPaths.buildDir, config.tailwind.output);
21418
21518
  const bytes = await Bun.file(outputPath).bytes();
21419
21519
  const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
21420
21520
  state.assetStore.set(webPath, bytes);
@@ -21497,11 +21597,39 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21497
21597
  detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
21498
21598
  }
21499
21599
  return { ...parsed, framework: detectedFw };
21500
- }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync26(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
21600
+ }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync26(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
21601
+ const config = state.config;
21602
+ const cwd2 = process.cwd();
21603
+ const absDeleted = resolve39(deletedFile).replace(/\\/g, "/");
21604
+ for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
21605
+ const dir = config[configKey];
21606
+ if (!dir)
21607
+ continue;
21608
+ const absDir = resolve39(cwd2, dir).replace(/\\/g, "/");
21609
+ if (!absDeleted.startsWith(`${absDir}/`))
21610
+ continue;
21611
+ const rel = absDeleted.slice(absDir.length + 1);
21612
+ const ext = rel.match(/\.(ts|tsx|jsx|svelte|vue|mjs|cjs)$/);
21613
+ if (!ext)
21614
+ return;
21615
+ const relJs = `${rel.slice(0, -ext[0].length)}.js`;
21616
+ const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
21617
+ for (const candidate of [
21618
+ join30(generatedDir, relJs),
21619
+ `${join30(generatedDir, relJs)}.map`
21620
+ ]) {
21621
+ try {
21622
+ rmSync3(candidate, { force: true });
21623
+ } catch {}
21624
+ }
21625
+ return;
21626
+ }
21627
+ }, collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
21501
21628
  state.fileHashes.delete(filePathInSet);
21629
+ removeStaleGenerated(state, filePathInSet);
21502
21630
  try {
21503
21631
  const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
21504
- const deletedPathResolved = resolve38(filePathInSet);
21632
+ const deletedPathResolved = resolve39(filePathInSet);
21505
21633
  affectedFiles.forEach((affectedFile) => {
21506
21634
  if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
21507
21635
  validFiles.push(affectedFile);
@@ -21545,7 +21673,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21545
21673
  if (storedHash !== undefined && storedHash === fileHash) {
21546
21674
  return;
21547
21675
  }
21548
- const normalizedFilePath = resolve38(filePathInSet);
21676
+ const normalizedFilePath = resolve39(filePathInSet);
21549
21677
  if (!processedFiles.has(normalizedFilePath)) {
21550
21678
  validFiles.push(normalizedFilePath);
21551
21679
  processedFiles.add(normalizedFilePath);
@@ -21683,7 +21811,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21683
21811
  const publicDir = state.resolvedPaths.publicDir;
21684
21812
  const assetsDir = state.resolvedPaths.assetsDir;
21685
21813
  const handleStaticMirror = async (sourceDir, urlPrefix) => {
21686
- const absSource = resolve38(filePath);
21814
+ const absSource = resolve39(filePath);
21687
21815
  const normalizedSource = absSource.replace(/\\/g, "/");
21688
21816
  const normalizedDir = sourceDir.replace(/\\/g, "/");
21689
21817
  if (!normalizedSource.startsWith(normalizedDir + "/"))
@@ -21691,10 +21819,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21691
21819
  try {
21692
21820
  const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
21693
21821
  const buildDir = state.resolvedPaths.buildDir;
21694
- const destPath = resolve38(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
21822
+ const destPath = resolve39(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
21695
21823
  const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
21696
- const { dirname: dirname22 } = await import("path");
21697
- await mkdir7(dirname22(destPath), { recursive: true });
21824
+ const { dirname: dirname23 } = await import("path");
21825
+ await mkdir7(dirname23(destPath), { recursive: true });
21698
21826
  await copyFile(absSource, destPath);
21699
21827
  const bytes = await readFile6(destPath);
21700
21828
  const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
@@ -21717,7 +21845,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21717
21845
  if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
21718
21846
  return;
21719
21847
  if (framework === "unknown") {
21720
- invalidate(resolve38(filePath));
21848
+ invalidate(resolve39(filePath));
21721
21849
  const relPath = relative16(process.cwd(), filePath);
21722
21850
  logHmrUpdate(relPath);
21723
21851
  const angularDir = state.resolvedPaths.angularDir;
@@ -21725,10 +21853,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21725
21853
  if (angularDir && state.dependencyGraph) {
21726
21854
  try {
21727
21855
  const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
21728
- addFileToGraph2(state.dependencyGraph, resolve38(filePath));
21729
- const affected = getAffectedFiles(state.dependencyGraph, resolve38(filePath));
21856
+ addFileToGraph2(state.dependencyGraph, resolve39(filePath));
21857
+ const affected = getAffectedFiles(state.dependencyGraph, resolve39(filePath));
21730
21858
  for (const dependent of affected) {
21731
- if (dependent === resolve38(filePath))
21859
+ if (dependent === resolve39(filePath))
21732
21860
  continue;
21733
21861
  const dependentFramework = detectFramework(dependent, state.resolvedPaths);
21734
21862
  if (dependentFramework !== "angular")
@@ -21745,13 +21873,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21745
21873
  } catch {}
21746
21874
  }
21747
21875
  if (!hasAngularDependent) {
21876
+ console.log(`[abs:restart] ${resolve39(filePath)}`);
21748
21877
  return;
21749
21878
  }
21750
21879
  try {
21751
21880
  const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
21752
21881
  const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
21753
21882
  const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
21754
- const sourceAbs = resolve38(filePath).replace(/\\/g, "/");
21883
+ const sourceAbs = resolve39(filePath).replace(/\\/g, "/");
21755
21884
  const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
21756
21885
  invalidateModuleServer(generatedTwin);
21757
21886
  } catch {}
@@ -21785,7 +21914,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21785
21914
  const userEditedFiles = new Set;
21786
21915
  state.fileChangeQueue.forEach((filePaths) => {
21787
21916
  for (const filePath2 of filePaths) {
21788
- userEditedFiles.add(resolve38(filePath2));
21917
+ userEditedFiles.add(resolve39(filePath2));
21789
21918
  }
21790
21919
  });
21791
21920
  state.lastUserEditedFiles = userEditedFiles;
@@ -21814,7 +21943,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21814
21943
  }
21815
21944
  if (!graph)
21816
21945
  return componentFile;
21817
- const dependents = graph.dependents.get(resolve38(componentFile));
21946
+ const dependents = graph.dependents.get(resolve39(componentFile));
21818
21947
  if (!dependents)
21819
21948
  return componentFile;
21820
21949
  for (const dep of dependents) {
@@ -21823,7 +21952,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21823
21952
  }
21824
21953
  return componentFile;
21825
21954
  }, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
21826
- const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve38(file4).startsWith(angularPagesPath));
21955
+ const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve39(file4).startsWith(angularPagesPath));
21827
21956
  if (pageEntries.length > 0 || !state.dependencyGraph) {
21828
21957
  return pageEntries;
21829
21958
  }
@@ -21832,7 +21961,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21832
21961
  const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
21833
21962
  const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
21834
21963
  affected.forEach((file4) => {
21835
- if (file4.endsWith(".ts") && resolve38(file4).startsWith(angularPagesPath)) {
21964
+ if (file4.endsWith(".ts") && resolve39(file4).startsWith(angularPagesPath)) {
21836
21965
  resolvedPages.add(file4);
21837
21966
  }
21838
21967
  });
@@ -21850,6 +21979,37 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21850
21979
  clientRoots.push(getGeneratedRoot2(projectRoot));
21851
21980
  const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
21852
21981
  return clientRoots.length === 1 ? clientRoots[0] ?? projectRoot : commonAncestor2(clientRoots, projectRoot);
21982
+ }, computeServerOutPaths = async (resolvedPaths, framework) => {
21983
+ const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
21984
+ const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
21985
+ const projectRoot = process.cwd();
21986
+ const serverDirs = [];
21987
+ if (resolvedPaths.svelteDir)
21988
+ serverDirs.push({
21989
+ dir: getFrameworkGeneratedDir2("svelte", projectRoot),
21990
+ subdir: "server"
21991
+ });
21992
+ if (resolvedPaths.vueDir)
21993
+ serverDirs.push({
21994
+ dir: getFrameworkGeneratedDir2("vue", projectRoot),
21995
+ subdir: "server"
21996
+ });
21997
+ if (resolvedPaths.angularDir)
21998
+ serverDirs.push({
21999
+ dir: getFrameworkGeneratedDir2("angular", projectRoot),
22000
+ subdir: ""
22001
+ });
22002
+ if (serverDirs.length <= 1) {
22003
+ const dir = getFrameworkGeneratedDir2(framework, projectRoot);
22004
+ return {
22005
+ serverOutDir: resolve39(resolvedPaths.buildDir, basename11(dir)),
22006
+ serverRoot: resolve39(dir, "server")
22007
+ };
22008
+ }
22009
+ return {
22010
+ serverOutDir: resolvedPaths.buildDir,
22011
+ serverRoot: commonAncestor2(serverDirs.map((entry) => entry.dir), projectRoot)
22012
+ };
21853
22013
  }, updateServerManifestEntry = (state, artifact) => {
21854
22014
  const fileWithHash = basename11(artifact.path);
21855
22015
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
@@ -21857,6 +22017,46 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21857
22017
  return;
21858
22018
  }
21859
22019
  state.manifest[toPascal(baseName)] = artifact.path;
22020
+ }, pruneStaleHashedSiblings = async (freshOutputs) => {
22021
+ if (!freshOutputs?.length)
22022
+ return;
22023
+ const { readdir: readdir5, unlink: unlink2 } = await import("fs/promises");
22024
+ const keepByDir = new Map;
22025
+ const prefixByDir = new Map;
22026
+ for (const artifact of freshOutputs) {
22027
+ const dir = dirname22(artifact.path);
22028
+ const name = basename11(artifact.path);
22029
+ const [prefix] = name.split(".");
22030
+ if (!prefix)
22031
+ continue;
22032
+ if (!keepByDir.has(dir))
22033
+ keepByDir.set(dir, new Set);
22034
+ if (!prefixByDir.has(dir))
22035
+ prefixByDir.set(dir, new Set);
22036
+ keepByDir.get(dir).add(name);
22037
+ prefixByDir.get(dir).add(prefix);
22038
+ }
22039
+ await Promise.all(Array.from(keepByDir.entries()).map(async ([dir, keep]) => {
22040
+ const prefixes = prefixByDir.get(dir);
22041
+ if (!prefixes)
22042
+ return;
22043
+ const entries = await readdir5(dir).catch(() => []);
22044
+ await Promise.all(entries.map(async (entryName) => {
22045
+ if (keep.has(entryName))
22046
+ return;
22047
+ if (!entryName.endsWith(".js"))
22048
+ return;
22049
+ const parts = entryName.split(".");
22050
+ if (parts.length !== 3)
22051
+ return;
22052
+ const [base] = parts;
22053
+ if (!base || !prefixes.has(base))
22054
+ return;
22055
+ try {
22056
+ await unlink2(`${dir}/${entryName}`);
22057
+ } catch {}
22058
+ }));
22059
+ }));
21860
22060
  }, bundleAngularClient = async (state, clientPaths, buildDir, userAngularRoot) => {
21861
22061
  const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
21862
22062
  const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
@@ -21954,8 +22154,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21954
22154
  if (detected !== "unknown")
21955
22155
  continue;
21956
22156
  try {
21957
- const affected = getAffectedFiles(state.dependencyGraph, resolve38(editedFile));
21958
- const hasAngularConsumer = affected.some((dep) => dep !== resolve38(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
22157
+ const affected = getAffectedFiles(state.dependencyGraph, resolve39(editedFile));
22158
+ const hasAngularConsumer = affected.some((dep) => dep !== resolve39(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
21959
22159
  if (hasAngularConsumer) {
21960
22160
  return {
21961
22161
  kind: "rebootstrap",
@@ -22002,7 +22202,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22002
22202
  }
22003
22203
  if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
22004
22204
  const normalized = editedFile.replace(/\\/g, "/");
22005
- const angularDirAbs = resolve38(angularDir).replace(/\\/g, "/");
22205
+ const angularDirAbs = resolve39(angularDir).replace(/\\/g, "/");
22006
22206
  if (normalized.startsWith(angularDirAbs + "/")) {
22007
22207
  return {
22008
22208
  kind: "rebootstrap",
@@ -22130,7 +22330,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22130
22330
  if (pageEntries.length === 0)
22131
22331
  return;
22132
22332
  await compileAndBundleAngular(state, pageEntries, angularDir);
22133
- markSsrCacheDirty("angular");
22134
22333
  };
22135
22334
  const drive = async () => {
22136
22335
  try {
@@ -22146,16 +22345,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22146
22345
  };
22147
22346
  const fire = () => {
22148
22347
  ctx.debounceTimer = null;
22149
- const resolve39 = ctx.debouncedResolve;
22348
+ const resolve40 = ctx.debouncedResolve;
22150
22349
  ctx.debouncedResolve = null;
22151
22350
  ctx.debouncedPromise = null;
22152
22351
  if (ctx.inFlight) {
22153
22352
  ctx.pending = true;
22154
- ctx.inFlight.finally(() => resolve39?.());
22353
+ ctx.inFlight.finally(() => resolve40?.());
22155
22354
  return;
22156
22355
  }
22157
22356
  ctx.inFlight = drive();
22158
- ctx.inFlight.finally(() => resolve39?.());
22357
+ ctx.inFlight.finally(() => resolve40?.());
22159
22358
  };
22160
22359
  return ({ immediate = false } = {}) => {
22161
22360
  if (!ctx.debouncedPromise) {
@@ -22182,16 +22381,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22182
22381
  const diskRefreshPromise = (async () => {
22183
22382
  if (!angularDir || editedFiles.size === 0)
22184
22383
  return;
22185
- const angularDirAbs = resolve38(angularDir);
22384
+ const angularDirAbs = resolve39(angularDir);
22186
22385
  const filesUnderAngular = Array.from(editedFiles).filter((file4) => {
22187
- const abs = resolve38(file4);
22386
+ const abs = resolve39(file4);
22188
22387
  return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
22189
22388
  });
22190
22389
  if (filesUnderAngular.length === 0)
22191
22390
  return;
22192
22391
  try {
22193
22392
  const [
22194
- { compileAngularFileJIT: compileAngularFileJIT2 },
22393
+ { compileAngularFileJIT: compileAngularFileJIT2, invalidateAngularJitCache: invalidateAngularJitCache2 },
22195
22394
  { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 },
22196
22395
  { resolveOwningComponents: resolveOwningComponents2 }
22197
22396
  ] = await Promise.all([
@@ -22206,7 +22405,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22206
22405
  if (!ext)
22207
22406
  continue;
22208
22407
  if (ext === ".ts" || ext === ".tsx") {
22209
- tsFilesToRefresh.add(resolve38(file4));
22408
+ tsFilesToRefresh.add(resolve39(file4));
22210
22409
  continue;
22211
22410
  }
22212
22411
  const owners = resolveOwningComponents2({
@@ -22214,19 +22413,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22214
22413
  userAngularRoot: angularDirAbs
22215
22414
  });
22216
22415
  for (const owner of owners) {
22217
- tsFilesToRefresh.add(resolve38(owner.componentFilePath));
22416
+ tsFilesToRefresh.add(resolve39(owner.componentFilePath));
22218
22417
  }
22219
22418
  }
22220
22419
  if (tsFilesToRefresh.size === 0)
22221
22420
  return;
22222
- await Promise.all(Array.from(tsFilesToRefresh).map((file4) => compileAngularFileJIT2(file4, compiledRoot, angularDirAbs, getStyleTransformConfig(state.config), String(Date.now())).catch((err) => {
22223
- logWarn(`[hmr] disk-refresh JIT failed for ${file4}: ${err instanceof Error ? err.message : String(err)}`);
22224
- })));
22421
+ await Promise.all(Array.from(tsFilesToRefresh).map((file4) => {
22422
+ invalidateAngularJitCache2(file4);
22423
+ return compileAngularFileJIT2(file4, compiledRoot, angularDirAbs, getStyleTransformConfig(state.config)).catch((err) => {
22424
+ logWarn(`[hmr] disk-refresh JIT failed for ${file4}: ${err instanceof Error ? err.message : String(err)}`);
22425
+ });
22426
+ }));
22225
22427
  try {
22226
22428
  const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
22227
22429
  for (const tsFile of tsFilesToRefresh) {
22228
22430
  const rel = relative16(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
22229
- const compiledFile = resolve38(compiledRoot, rel);
22431
+ const compiledFile = resolve39(compiledRoot, rel);
22230
22432
  invalidateModule2(compiledFile);
22231
22433
  }
22232
22434
  } catch {}
@@ -22242,12 +22444,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22242
22444
  try {
22243
22445
  const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
22244
22446
  const { readdir: readdir5 } = await import("fs/promises");
22245
- const { join: join30 } = await import("path");
22447
+ const { join: join31 } = await import("path");
22246
22448
  const walk = async (dir) => {
22247
22449
  const entries = await readdir5(dir, { withFileTypes: true });
22248
22450
  const files = [];
22249
22451
  for (const entry of entries) {
22250
- const full = join30(dir, entry.name);
22452
+ const full = join31(dir, entry.name);
22251
22453
  if (entry.isDirectory()) {
22252
22454
  files.push(...await walk(full));
22253
22455
  } else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
@@ -22277,18 +22479,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22277
22479
  serverPaths.forEach((serverPath, idx) => {
22278
22480
  const fileBase = basename11(serverPath, ".js");
22279
22481
  const ssrPath = ssrPaths[idx] ?? serverPath;
22280
- state.manifest[toPascal(fileBase)] = resolve38(ssrPath);
22482
+ state.manifest[toPascal(fileBase)] = resolve39(ssrPath);
22281
22483
  });
22282
22484
  if (clientPaths.length > 0) {
22283
22485
  await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
22284
22486
  }
22487
+ broadcastToClients(state, {
22488
+ data: { manifest: state.manifest },
22489
+ type: "angular-tier-zero-ssr-rebuild-complete"
22490
+ });
22285
22491
  }, handleAngularFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
22286
22492
  const angularDir = config.angularDirectory ?? "";
22287
22493
  const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
22288
22494
  for (const file4 of angularFiles) {
22289
- state.fileHashes.set(resolve38(file4), computeFileHash(file4));
22495
+ state.fileHashes.set(resolve39(file4), computeFileHash(file4));
22290
22496
  }
22291
- const angularPagesPath = resolve38(angularDir, "pages");
22497
+ const angularPagesPath = resolve39(angularDir, "pages");
22292
22498
  const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
22293
22499
  const tierStart = performance.now();
22294
22500
  const verdict = await decideAngularTier(state, angularDir);
@@ -22300,6 +22506,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22300
22506
  broadcastSurgical(state, verdict.queue);
22301
22507
  const b2 = verdict.breakdown;
22302
22508
  logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${b2.importsMs}/resolve ${b2.resolveMs}/compile ${b2.compileMs}; awaiting client apply)`);
22509
+ runBundle();
22303
22510
  } else if (verdict.tier === 1 && verdict.kind === "remount") {
22304
22511
  await runAngularHmrIncremental(state, angularDir, pageEntries);
22305
22512
  broadcastRemount(state, verdict.queue);
@@ -22327,13 +22534,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22327
22534
  if (isComponentFile2)
22328
22535
  return primaryFile;
22329
22536
  const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
22330
- const nearest = findNearestComponent2(resolve38(primaryFile));
22537
+ const nearest = findNearestComponent2(resolve39(primaryFile));
22331
22538
  return nearest ?? primaryFile;
22332
22539
  }, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
22333
22540
  for (const file4 of reactFiles) {
22334
- state.fileHashes.set(resolve38(file4), computeFileHash(file4));
22541
+ state.fileHashes.set(resolve39(file4), computeFileHash(file4));
22335
22542
  }
22336
- markSsrCacheDirty("react");
22337
22543
  const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
22338
22544
  if (!primaryFile) {
22339
22545
  onRebuildComplete({
@@ -22411,23 +22617,136 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22411
22617
  },
22412
22618
  type: "svelte-update"
22413
22619
  });
22414
- }, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
22620
+ }, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
22415
22621
  for (const file4 of svelteFiles) {
22416
- state.fileHashes.set(resolve38(file4), computeFileHash(file4));
22622
+ state.fileHashes.set(resolve39(file4), computeFileHash(file4));
22417
22623
  }
22418
- markSsrCacheDirty("svelte");
22419
22624
  const serverDuration = Date.now() - startTime;
22420
22625
  await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
22626
+ scheduleSvelteBundleRebuild(state, svelteFiles, config)();
22421
22627
  onRebuildComplete({
22422
22628
  hmrState: state,
22423
22629
  manifest: state.manifest
22424
22630
  });
22425
22631
  return state.manifest;
22632
+ }, SVELTE_BUNDLE_DEBOUNCE_MS = 2000, svelteBundleState, vueBundleState, getOrCreateBundleCtx = (store, state) => {
22633
+ let ctx = store.get(state);
22634
+ if (!ctx) {
22635
+ ctx = {
22636
+ debouncedPromise: null,
22637
+ debouncedResolve: null,
22638
+ debounceTimer: null,
22639
+ inFlight: null,
22640
+ pending: false,
22641
+ pendingFiles: new Set
22642
+ };
22643
+ store.set(state, ctx);
22644
+ }
22645
+ return ctx;
22646
+ }, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
22647
+ if (svelteFiles.length === 0)
22648
+ return;
22649
+ const svelteDir = config.svelteDirectory ?? "";
22650
+ if (!svelteDir)
22651
+ return;
22652
+ const { buildDir } = state.resolvedPaths;
22653
+ const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
22654
+ const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
22655
+ const clientRoot = await computeClientRoot(state.resolvedPaths);
22656
+ const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
22657
+ const serverEntries = [...svelteServerPaths];
22658
+ const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
22659
+ const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "svelte");
22660
+ const [serverResult, clientResult] = await Promise.all([
22661
+ serverEntries.length > 0 ? bunBuild9({
22662
+ entrypoints: serverEntries,
22663
+ external: [
22664
+ "react",
22665
+ "react/*",
22666
+ "react-dom",
22667
+ "react-dom/*",
22668
+ "svelte",
22669
+ "svelte/*"
22670
+ ],
22671
+ format: "esm",
22672
+ naming: "[dir]/[name].[hash].[ext]",
22673
+ outdir: serverOutDir,
22674
+ plugins: [
22675
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
22676
+ ],
22677
+ root: serverRoot,
22678
+ target: "bun",
22679
+ throw: false
22680
+ }) : undefined,
22681
+ clientEntries.length > 0 ? bunBuild9({
22682
+ entrypoints: clientEntries,
22683
+ format: "esm",
22684
+ naming: "[dir]/[name].[hash].[ext]",
22685
+ outdir: buildDir,
22686
+ plugins: [
22687
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
22688
+ ],
22689
+ root: clientRoot,
22690
+ target: "browser",
22691
+ throw: false
22692
+ }) : undefined
22693
+ ]);
22694
+ handleServerManifestUpdate(state, serverResult);
22695
+ await handleClientManifestUpdate(state, clientResult, buildDir);
22696
+ await pruneStaleHashedSiblings(serverResult?.outputs);
22697
+ broadcastToClients(state, {
22698
+ data: { manifest: state.manifest },
22699
+ type: "svelte-tier-zero-ssr-rebuild-complete"
22700
+ });
22701
+ }, scheduleSvelteBundleRebuild = (state, svelteFiles, config) => {
22702
+ const ctx = getOrCreateBundleCtx(svelteBundleState, state);
22703
+ for (const file4 of svelteFiles)
22704
+ ctx.pendingFiles.add(file4);
22705
+ const drive = async () => {
22706
+ try {
22707
+ while (true) {
22708
+ ctx.pending = false;
22709
+ const filesSnapshot = Array.from(ctx.pendingFiles);
22710
+ ctx.pendingFiles.clear();
22711
+ if (filesSnapshot.length === 0)
22712
+ break;
22713
+ await runSvelteBundleRebuild(state, filesSnapshot, config);
22714
+ if (!ctx.pending)
22715
+ break;
22716
+ }
22717
+ } finally {
22718
+ ctx.inFlight = null;
22719
+ }
22720
+ };
22721
+ const fire = () => {
22722
+ ctx.debounceTimer = null;
22723
+ const resolveFn = ctx.debouncedResolve;
22724
+ ctx.debouncedResolve = null;
22725
+ ctx.debouncedPromise = null;
22726
+ if (ctx.inFlight) {
22727
+ ctx.pending = true;
22728
+ ctx.inFlight.finally(() => resolveFn?.());
22729
+ return;
22730
+ }
22731
+ ctx.inFlight = drive();
22732
+ ctx.inFlight.finally(() => resolveFn?.());
22733
+ };
22734
+ return () => {
22735
+ if (!ctx.debouncedPromise) {
22736
+ ctx.debouncedPromise = new Promise((res) => {
22737
+ ctx.debouncedResolve = res;
22738
+ });
22739
+ }
22740
+ if (ctx.debounceTimer)
22741
+ clearTimeout(ctx.debounceTimer);
22742
+ ctx.debounceTimer = setTimeout(fire, SVELTE_BUNDLE_DEBOUNCE_MS);
22743
+ return ctx.debouncedPromise;
22744
+ };
22426
22745
  }, handleSvelteFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
22427
22746
  const svelteDir = config.svelteDirectory ?? "";
22428
22747
  const svelteFiles = filesToRebuild.filter((file4) => (file4.endsWith(".svelte") || file4.includes(".svelte.")) && detectFramework(file4, state.resolvedPaths) === "svelte");
22429
22748
  if (svelteFiles.length > 0) {
22430
- return handleSvelteModuleServerPath(state, svelteFiles, startTime, onRebuildComplete);
22749
+ return handleSvelteModuleServerPath(state, svelteFiles, config, startTime, onRebuildComplete);
22431
22750
  }
22432
22751
  const { buildDir } = state.resolvedPaths;
22433
22752
  if (svelteFiles.length > 0) {
@@ -22437,9 +22756,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22437
22756
  const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
22438
22757
  const serverEntries = [...svelteServerPaths];
22439
22758
  const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
22440
- const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
22441
- const serverRoot = resolve38(getFrameworkGeneratedDir2("svelte"), "server");
22442
- const serverOutDir = resolve38(buildDir, basename11(svelteDir));
22759
+ const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "svelte");
22443
22760
  const [serverResult, clientResult] = await Promise.all([
22444
22761
  serverEntries.length > 0 ? bunBuild9({
22445
22762
  entrypoints: serverEntries,
@@ -22534,26 +22851,131 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22534
22851
  },
22535
22852
  type: "vue-update"
22536
22853
  });
22537
- }, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
22854
+ }, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
22538
22855
  for (const file4 of [...vueFiles, ...nonVueFiles]) {
22539
- state.fileHashes.set(resolve38(file4), computeFileHash(file4));
22856
+ state.fileHashes.set(resolve39(file4), computeFileHash(file4));
22540
22857
  }
22541
- markSsrCacheDirty("vue");
22542
22858
  await invalidateNonVueModules(nonVueFiles);
22543
22859
  const serverDuration = Date.now() - startTime;
22544
22860
  const forceReload = nonVueFiles.length > 0;
22545
22861
  await runSequentially(vueFiles, (changedFile) => broadcastVueModuleUpdate(state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration));
22862
+ scheduleVueBundleRebuild(state, vueFiles, config)();
22546
22863
  onRebuildComplete({
22547
22864
  hmrState: state,
22548
22865
  manifest: state.manifest
22549
22866
  });
22550
22867
  return state.manifest;
22868
+ }, VUE_BUNDLE_DEBOUNCE_MS = 2000, runVueBundleRebuild = async (state, vueFiles, config) => {
22869
+ if (vueFiles.length === 0)
22870
+ return;
22871
+ const vueDir = config.vueDirectory ?? "";
22872
+ if (!vueDir)
22873
+ return;
22874
+ const { buildDir } = state.resolvedPaths;
22875
+ const { compileVue: compileVue2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
22876
+ const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
22877
+ const clientRoot = await computeClientRoot(state.resolvedPaths);
22878
+ const { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
22879
+ const serverEntries = [...vueServerPaths];
22880
+ const clientEntries = [...vueIndexPaths, ...vueClientPaths];
22881
+ const cssOutDir = join30(buildDir, state.resolvedPaths.assetsDir ? basename11(state.resolvedPaths.assetsDir) : "assets", "css");
22882
+ const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
22883
+ const [serverResult, clientResult, cssResult] = await Promise.all([
22884
+ serverEntries.length > 0 ? bunBuild9({
22885
+ entrypoints: serverEntries,
22886
+ external: ["vue", "vue/*", "@vue/*"],
22887
+ format: "esm",
22888
+ naming: "[dir]/[name].[hash].[ext]",
22889
+ outdir: serverOutDir,
22890
+ plugins: [
22891
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
22892
+ ],
22893
+ root: serverRoot,
22894
+ target: "bun",
22895
+ throw: false
22896
+ }) : undefined,
22897
+ clientEntries.length > 0 ? bunBuild9({
22898
+ entrypoints: clientEntries,
22899
+ format: "esm",
22900
+ naming: "[dir]/[name].[hash].[ext]",
22901
+ outdir: buildDir,
22902
+ plugins: [
22903
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
22904
+ ],
22905
+ root: clientRoot,
22906
+ target: "browser",
22907
+ throw: false
22908
+ }) : undefined,
22909
+ vueCssPaths.length > 0 ? bunBuild9({
22910
+ entrypoints: vueCssPaths,
22911
+ naming: "[name].[hash].[ext]",
22912
+ outdir: cssOutDir,
22913
+ plugins: [
22914
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
22915
+ ],
22916
+ target: "browser",
22917
+ throw: false
22918
+ }) : undefined
22919
+ ]);
22920
+ handleServerManifestUpdate(state, serverResult);
22921
+ await handleClientManifestUpdate(state, clientResult, buildDir);
22922
+ await handleClientManifestUpdate(state, cssResult, buildDir);
22923
+ await pruneStaleHashedSiblings(serverResult?.outputs);
22924
+ await pruneStaleHashedSiblings(cssResult?.outputs);
22925
+ broadcastToClients(state, {
22926
+ data: { manifest: state.manifest },
22927
+ type: "vue-tier-zero-ssr-rebuild-complete"
22928
+ });
22929
+ }, scheduleVueBundleRebuild = (state, vueFiles, config) => {
22930
+ const ctx = getOrCreateBundleCtx(vueBundleState, state);
22931
+ for (const file4 of vueFiles)
22932
+ ctx.pendingFiles.add(file4);
22933
+ const drive = async () => {
22934
+ try {
22935
+ while (true) {
22936
+ ctx.pending = false;
22937
+ const filesSnapshot = Array.from(ctx.pendingFiles);
22938
+ ctx.pendingFiles.clear();
22939
+ if (filesSnapshot.length === 0)
22940
+ break;
22941
+ await runVueBundleRebuild(state, filesSnapshot, config);
22942
+ if (!ctx.pending)
22943
+ break;
22944
+ }
22945
+ } finally {
22946
+ ctx.inFlight = null;
22947
+ }
22948
+ };
22949
+ const fire = () => {
22950
+ ctx.debounceTimer = null;
22951
+ const resolveFn = ctx.debouncedResolve;
22952
+ ctx.debouncedResolve = null;
22953
+ ctx.debouncedPromise = null;
22954
+ if (ctx.inFlight) {
22955
+ ctx.pending = true;
22956
+ ctx.inFlight.finally(() => resolveFn?.());
22957
+ return;
22958
+ }
22959
+ ctx.inFlight = drive();
22960
+ ctx.inFlight.finally(() => resolveFn?.());
22961
+ };
22962
+ return () => {
22963
+ if (!ctx.debouncedPromise) {
22964
+ ctx.debouncedPromise = new Promise((res) => {
22965
+ ctx.debouncedResolve = res;
22966
+ });
22967
+ }
22968
+ if (ctx.debounceTimer)
22969
+ clearTimeout(ctx.debounceTimer);
22970
+ ctx.debounceTimer = setTimeout(fire, VUE_BUNDLE_DEBOUNCE_MS);
22971
+ return ctx.debouncedPromise;
22972
+ };
22551
22973
  }, handleVueFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
22552
22974
  const vueFiles = filesToRebuild.filter((file4) => file4.endsWith(".vue") && detectFramework(file4, state.resolvedPaths) === "vue");
22553
22975
  const nonVueFiles = filesToRebuild.filter((file4) => !file4.endsWith(".vue") && detectFramework(file4, state.resolvedPaths) === "vue");
22554
22976
  collectAffectedVueFiles(state, nonVueFiles, vueFiles);
22555
22977
  if (vueFiles.length > 0) {
22556
- return handleVueModuleServerPath(state, vueFiles, nonVueFiles, startTime, onRebuildComplete);
22978
+ return handleVueModuleServerPath(state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete);
22557
22979
  }
22558
22980
  onRebuildComplete({ hmrState: state, manifest: state.manifest });
22559
22981
  return state.manifest;
@@ -22564,7 +22986,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22564
22986
  recursive: true,
22565
22987
  withFileTypes: true
22566
22988
  });
22567
- return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve38(emberPagesPath, entry.name));
22989
+ return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve39(emberPagesPath, entry.name));
22568
22990
  } catch {
22569
22991
  return [];
22570
22992
  }
@@ -22576,10 +22998,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22576
22998
  return state.manifest;
22577
22999
  }
22578
23000
  for (const file4 of emberFiles) {
22579
- state.fileHashes.set(resolve38(file4), computeFileHash(file4));
23001
+ state.fileHashes.set(resolve39(file4), computeFileHash(file4));
22580
23002
  }
22581
- const emberPagesPath = resolve38(emberDir, "pages");
22582
- const directPageEntries = emberFiles.filter((file4) => resolve38(file4).startsWith(emberPagesPath));
23003
+ const emberPagesPath = resolve39(emberDir, "pages");
23004
+ const directPageEntries = emberFiles.filter((file4) => resolve39(file4).startsWith(emberPagesPath));
22583
23005
  const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
22584
23006
  if (allPageEntries.length === 0) {
22585
23007
  onRebuildComplete({ hmrState: state, manifest: state.manifest });
@@ -22589,7 +23011,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22589
23011
  const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
22590
23012
  for (const serverPath of serverPaths) {
22591
23013
  const fileBase = basename11(serverPath, ".js");
22592
- state.manifest[toPascal(fileBase)] = resolve38(serverPath);
23014
+ state.manifest[toPascal(fileBase)] = resolve39(serverPath);
22593
23015
  }
22594
23016
  const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
22595
23017
  invalidateEmberSsrCache2();
@@ -22681,8 +23103,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22681
23103
  if (!buildReference?.source) {
22682
23104
  return;
22683
23105
  }
22684
- const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve38(dirname21(buildInfo.resolvedRegistryPath), buildReference.source);
22685
- islandFiles.add(resolve38(sourcePath));
23106
+ const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve39(dirname22(buildInfo.resolvedRegistryPath), buildReference.source);
23107
+ islandFiles.add(resolve39(sourcePath));
22686
23108
  }, resolveIslandSourceFiles = async (config) => {
22687
23109
  const registryPath = config.islands?.registry;
22688
23110
  if (!registryPath) {
@@ -22690,7 +23112,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22690
23112
  }
22691
23113
  const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
22692
23114
  const islandFiles = new Set([
22693
- resolve38(buildInfo.resolvedRegistryPath)
23115
+ resolve39(buildInfo.resolvedRegistryPath)
22694
23116
  ]);
22695
23117
  for (const definition of buildInfo.definitions) {
22696
23118
  resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
@@ -22701,7 +23123,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22701
23123
  if (islandFiles.size === 0) {
22702
23124
  return false;
22703
23125
  }
22704
- return filesToRebuild.some((file4) => islandFiles.has(resolve38(file4)));
23126
+ return filesToRebuild.some((file4) => islandFiles.has(resolve39(file4)));
22705
23127
  }, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
22706
23128
  const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
22707
23129
  if (!shouldReload) {
@@ -22736,10 +23158,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22736
23158
  }, computeOutputPagesDir = (state, config, framework) => {
22737
23159
  const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
22738
23160
  if (isSingle) {
22739
- return resolve38(state.resolvedPaths.buildDir, "pages");
23161
+ return resolve39(state.resolvedPaths.buildDir, "pages");
22740
23162
  }
22741
23163
  const dirName = framework === "html" ? basename11(config.htmlDirectory ?? "html") : basename11(config.htmxDirectory ?? "htmx");
22742
- return resolve38(state.resolvedPaths.buildDir, dirName, "pages");
23164
+ return resolve39(state.resolvedPaths.buildDir, dirName, "pages");
22743
23165
  }, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
22744
23166
  try {
22745
23167
  const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
@@ -22778,7 +23200,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22778
23200
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
22779
23201
  await runSequentially(pageFilesToUpdate, async (pageFile) => {
22780
23202
  const htmlPageName = basename11(pageFile);
22781
- const builtHtmlPagePath = resolve38(outputHtmlPages, htmlPageName);
23203
+ const builtHtmlPagePath = resolve39(outputHtmlPages, htmlPageName);
22782
23204
  await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
22783
23205
  });
22784
23206
  }, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
@@ -22843,7 +23265,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22843
23265
  const cssKey = `${pascalName}CSS`;
22844
23266
  const cssUrl = manifest[cssKey] || null;
22845
23267
  const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
22846
- const hmrMeta = vueHmrMetadata2.get(resolve38(vuePagePath));
23268
+ const hmrMeta = vueHmrMetadata2.get(resolve39(vuePagePath));
22847
23269
  const changeType = hmrMeta?.changeType ?? "full";
22848
23270
  if (changeType === "style-only") {
22849
23271
  broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
@@ -23028,7 +23450,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23028
23450
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
23029
23451
  await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
23030
23452
  const htmxPageName = basename11(htmxPageFile);
23031
- const builtHtmxPagePath = resolve38(outputHtmxPages, htmxPageName);
23453
+ const builtHtmxPagePath = resolve39(outputHtmxPages, htmxPageName);
23032
23454
  await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
23033
23455
  });
23034
23456
  }, collectUpdatedModulePaths = (allModuleUpdates) => {
@@ -23137,7 +23559,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23137
23559
  html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
23138
23560
  writeFs(destPath, html);
23139
23561
  }, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
23140
- const destPath = resolve38(outputDir, basename11(sourceFile));
23562
+ const destPath = resolve39(outputDir, basename11(sourceFile));
23141
23563
  const hmrScript = extractHmrScript(destPath, readFs);
23142
23564
  const source = await Bun.file(sourceFile).text();
23143
23565
  await Bun.write(destPath, source);
@@ -23278,6 +23700,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23278
23700
  type: "rebuild-complete"
23279
23701
  });
23280
23702
  if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
23703
+ try {
23704
+ const outputPath = resolve39(state.resolvedPaths.buildDir, config.tailwind.output);
23705
+ const bytes = await Bun.file(outputPath).bytes();
23706
+ const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
23707
+ state.assetStore.set(webPath, bytes);
23708
+ } catch {}
23281
23709
  broadcastToClients(state, {
23282
23710
  data: { framework: "tailwind", manifest },
23283
23711
  message: "Tailwind utilities recompiled",
@@ -23294,18 +23722,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23294
23722
  await handleFullBuildHMR(state, config, affectedFrameworks, filesToRebuild, manifest, duration);
23295
23723
  }
23296
23724
  broadcastFrameworkUpdates(state, affectedFrameworks, filesToRebuild, manifest, startTime);
23297
- if (affectedFrameworks.includes("angular")) {
23298
- markSsrCacheDirty("angular");
23299
- }
23300
- if (affectedFrameworks.includes("react")) {
23301
- markSsrCacheDirty("react");
23302
- }
23303
- if (affectedFrameworks.includes("svelte")) {
23304
- markSsrCacheDirty("svelte");
23305
- }
23306
- if (affectedFrameworks.includes("vue")) {
23307
- markSsrCacheDirty("vue");
23308
- }
23309
23725
  onRebuildComplete({ hmrState: state, manifest });
23310
23726
  return manifest;
23311
23727
  }, drainPendingQueue = (state, config, onRebuildComplete) => {
@@ -23388,6 +23804,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23388
23804
  }
23389
23805
  };
23390
23806
  var init_rebuildTrigger = __esm(() => {
23807
+ init_generatedDir();
23391
23808
  init_build();
23392
23809
  init_scanEntryPoints();
23393
23810
  init_islandEntries();
@@ -23407,8 +23824,14 @@ var init_rebuildTrigger = __esm(() => {
23407
23824
  init_stylePreprocessor();
23408
23825
  init_compileTailwind();
23409
23826
  init_tailwindCompiler();
23410
- init_ssrCache();
23411
23827
  moduleServerPromise = Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
23828
+ FRAMEWORK_DIR_KEYS_FOR_CLEANUP = [
23829
+ { configKey: "reactDirectory", framework: "react" },
23830
+ { configKey: "svelteDirectory", framework: "svelte" },
23831
+ { configKey: "vueDirectory", framework: "vue" },
23832
+ { configKey: "emberDirectory", framework: "ember" },
23833
+ { configKey: "angularDirectory", framework: "angular" }
23834
+ ];
23412
23835
  USER_FIXABLE_FAST_HMR_REASONS = new Set([
23413
23836
  "template-parse-error",
23414
23837
  "template-resource-not-found",
@@ -23416,6 +23839,8 @@ var init_rebuildTrigger = __esm(() => {
23416
23839
  ]);
23417
23840
  angularBundleState = new WeakMap;
23418
23841
  getReactModuleUrl = getModuleUrl;
23842
+ svelteBundleState = new WeakMap;
23843
+ vueBundleState = new WeakMap;
23419
23844
  EMBER_PAGE_EXTENSIONS = [".gts", ".gjs", ".ts", ".js"];
23420
23845
  HMR_SCRIPT_PATTERN = /<script>window\.__HMR_FRAMEWORK__[\s\S]*?<\/script>\s*<script data-hmr-client>[\s\S]*?<\/script>/;
23421
23846
  STYLE_FILE_EXT_RE = /\.(?:css|scss|sass|less|styl|stylus)$/i;
@@ -23448,9 +23873,9 @@ __export(exports_buildDepVendor, {
23448
23873
  buildDepVendor: () => buildDepVendor
23449
23874
  });
23450
23875
  import { mkdirSync as mkdirSync13 } from "fs";
23451
- import { join as join30 } from "path";
23876
+ import { join as join31 } from "path";
23452
23877
  import { rm as rm10 } from "fs/promises";
23453
- var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
23878
+ var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
23454
23879
  var toSafeFileName6 = (specifier) => {
23455
23880
  const prefix = specifier.startsWith("@") ? "_" : "";
23456
23881
  return prefix + specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_");
@@ -23476,7 +23901,7 @@ var toSafeFileName6 = (specifier) => {
23476
23901
  return { dep, framework };
23477
23902
  }, scanDirFiles = async (dir) => {
23478
23903
  const empty = [];
23479
- const glob = new Glob9("**/*.{ts,tsx,js,jsx}");
23904
+ const glob = new Glob10("**/*.{ts,tsx,js,jsx}");
23480
23905
  try {
23481
23906
  const all = await Array.fromAsync(glob.scan({ absolute: true, cwd: dir }));
23482
23907
  return all.filter((file4) => !isSkippedFile(file4));
@@ -23559,7 +23984,7 @@ var toSafeFileName6 = (specifier) => {
23559
23984
  }), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
23560
23985
  const entries = await Promise.all(specifiers.map(async (specifier) => {
23561
23986
  const safeName = toSafeFileName6(specifier);
23562
- const entryPath = join30(tmpDir, `${safeName}.ts`);
23987
+ const entryPath = join31(tmpDir, `${safeName}.ts`);
23563
23988
  await Bun.write(entryPath, await generateVendorEntrySource(specifier));
23564
23989
  return { entryPath, specifier };
23565
23990
  }));
@@ -23620,9 +24045,9 @@ var toSafeFileName6 = (specifier) => {
23620
24045
  const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
23621
24046
  if (initialSpecs.length === 0 && frameworkRoots.length === 0)
23622
24047
  return {};
23623
- const vendorDir = join30(buildDir, "vendor");
24048
+ const vendorDir = join31(buildDir, "vendor");
23624
24049
  mkdirSync13(vendorDir, { recursive: true });
23625
- const tmpDir = join30(buildDir, "_dep_vendor_tmp");
24050
+ const tmpDir = join31(buildDir, "_dep_vendor_tmp");
23626
24051
  mkdirSync13(tmpDir, { recursive: true });
23627
24052
  const allSpecs = new Set(initialSpecs);
23628
24053
  const alreadyScanned = new Set;
@@ -23701,11 +24126,12 @@ var init_buildDepVendor = __esm(() => {
23701
24126
  // src/core/devBuild.ts
23702
24127
  var exports_devBuild = {};
23703
24128
  __export(exports_devBuild, {
23704
- devBuild: () => devBuild
24129
+ devBuild: () => devBuild,
24130
+ applyConfigChanges: () => applyConfigChanges
23705
24131
  });
23706
24132
  import { readdir as readdir5 } from "fs/promises";
23707
- import { statSync as statSync5 } from "fs";
23708
- import { resolve as resolve39 } from "path";
24133
+ import { statSync as statSync6 } from "fs";
24134
+ import { resolve as resolve40 } from "path";
23709
24135
  var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23710
24136
  const configuredDirs = [
23711
24137
  config.reactDirectory,
@@ -23728,7 +24154,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23728
24154
  return Object.keys(config).length > 0 ? config : null;
23729
24155
  }, reloadConfig = async () => {
23730
24156
  try {
23731
- const configPath2 = resolve39(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
24157
+ const configPath2 = resolve40(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
23732
24158
  const source = await Bun.file(configPath2).text();
23733
24159
  return parseDirectoryConfig(source);
23734
24160
  } catch {
@@ -23737,12 +24163,28 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23737
24163
  }, detectConfigChanges = async (cached) => {
23738
24164
  const newConfig = await reloadConfig();
23739
24165
  if (!newConfig)
23740
- return;
24166
+ return { added: [], removed: [] };
23741
24167
  const state = cached.hmrState;
23742
24168
  const oldConfig = state.config;
23743
- const hasChanges = FRAMEWORK_DIR_KEYS.some((key) => newConfig[key] !== oldConfig[key]);
23744
- if (!hasChanges)
23745
- return;
24169
+ const added = [];
24170
+ const removed = [];
24171
+ for (const key of FRAMEWORK_DIR_KEYS) {
24172
+ const oldVal = oldConfig[key];
24173
+ const newVal = newConfig[key];
24174
+ if (oldVal === newVal)
24175
+ continue;
24176
+ if (!oldVal && newVal)
24177
+ added.push(key);
24178
+ else if (oldVal && !newVal)
24179
+ removed.push(key);
24180
+ else if (oldVal && newVal) {
24181
+ removed.push(key);
24182
+ added.push(key);
24183
+ }
24184
+ }
24185
+ if (added.length === 0 && removed.length === 0) {
24186
+ return { added: [], removed: [] };
24187
+ }
23746
24188
  const oldWatchPaths = new Set(getWatchPaths(oldConfig, state.resolvedPaths));
23747
24189
  for (const key of FRAMEWORK_DIR_KEYS) {
23748
24190
  state.config[key] = newConfig[key];
@@ -23774,6 +24216,12 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23774
24216
  });
23775
24217
  });
23776
24218
  }
24219
+ return { added, removed };
24220
+ }, applyConfigChanges = async () => {
24221
+ const cached = globalThis.__hmrDevResult;
24222
+ if (!cached)
24223
+ return null;
24224
+ return detectConfigChanges(cached);
23777
24225
  }, removeStaleKeys = (target, source) => {
23778
24226
  for (const key of Object.keys(target)) {
23779
24227
  if (!(key in source))
@@ -23813,7 +24261,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23813
24261
  state.fileChangeQueue.clear();
23814
24262
  }
23815
24263
  }, handleCachedReload = async () => {
23816
- const serverMtime = statSync5(resolve39(Bun.main)).mtimeMs;
24264
+ const serverMtime = statSync6(resolve40(Bun.main)).mtimeMs;
23817
24265
  const lastMtime = globalThis.__hmrServerMtime;
23818
24266
  globalThis.__hmrServerMtime = serverMtime;
23819
24267
  const cached = globalThis.__hmrDevResult;
@@ -23850,8 +24298,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23850
24298
  return true;
23851
24299
  }, resolveAbsoluteVersion2 = async () => {
23852
24300
  const candidates = [
23853
- resolve39(import.meta.dir, "..", "..", "package.json"),
23854
- resolve39(import.meta.dir, "..", "package.json")
24301
+ resolve40(import.meta.dir, "..", "..", "package.json"),
24302
+ resolve40(import.meta.dir, "..", "package.json")
23855
24303
  ];
23856
24304
  const [candidate, ...remaining] = candidates;
23857
24305
  if (!candidate) {
@@ -23877,7 +24325,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23877
24325
  const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
23878
24326
  await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
23879
24327
  const webPath = `/${framework}/vendor/${entry}`;
23880
- const bytes = await Bun.file(resolve39(vendorDir, entry)).bytes();
24328
+ const bytes = await Bun.file(resolve40(vendorDir, entry)).bytes();
23881
24329
  assetStore.set(webPath, bytes);
23882
24330
  }));
23883
24331
  }, devBuild = async (config) => {
@@ -23945,11 +24393,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23945
24393
  cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
23946
24394
  recordStep("populate asset store", stepStartedAt);
23947
24395
  stepStartedAt = performance.now();
23948
- const reactVendorDir = resolve39(state.resolvedPaths.buildDir, "react", "vendor");
23949
- const angularVendorDir = resolve39(state.resolvedPaths.buildDir, "angular", "vendor");
23950
- const svelteVendorDir = resolve39(state.resolvedPaths.buildDir, "svelte", "vendor");
23951
- const vueVendorDir = resolve39(state.resolvedPaths.buildDir, "vue", "vendor");
23952
- const depVendorDir = resolve39(state.resolvedPaths.buildDir, "vendor");
24396
+ const reactVendorDir = resolve40(state.resolvedPaths.buildDir, "react", "vendor");
24397
+ const angularVendorDir = resolve40(state.resolvedPaths.buildDir, "angular", "vendor");
24398
+ const svelteVendorDir = resolve40(state.resolvedPaths.buildDir, "svelte", "vendor");
24399
+ const vueVendorDir = resolve40(state.resolvedPaths.buildDir, "vue", "vendor");
24400
+ const depVendorDir = resolve40(state.resolvedPaths.buildDir, "vendor");
23953
24401
  const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
23954
24402
  const [, angularSpecs, , , , , depPaths] = await Promise.all([
23955
24403
  config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
@@ -24006,8 +24454,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
24006
24454
  recordStep("warm compilers", stepStartedAt);
24007
24455
  if (config.tailwind) {
24008
24456
  stepStartedAt = performance.now();
24009
- const { warmTailwindCompiler: warmTailwindCompiler2 } = await Promise.resolve().then(() => (init_tailwindCompiler(), exports_tailwindCompiler));
24010
- await warmTailwindCompiler2(config.tailwind);
24457
+ const [{ warmTailwindCompiler: warmTailwindCompiler2 }, { computeFrameworkTailwindSources: computeFrameworkTailwindSources2 }] = await Promise.all([
24458
+ Promise.resolve().then(() => (init_tailwindCompiler(), exports_tailwindCompiler)),
24459
+ Promise.resolve().then(() => (init_compileTailwind(), exports_compileTailwind))
24460
+ ]);
24461
+ await warmTailwindCompiler2(config.tailwind, computeFrameworkTailwindSources2(config));
24011
24462
  recordStep("warm tailwind compiler", stepStartedAt);
24012
24463
  }
24013
24464
  state.manifest = manifest;
@@ -24027,7 +24478,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
24027
24478
  manifest
24028
24479
  };
24029
24480
  globalThis.__hmrDevResult = result;
24030
- globalThis.__hmrServerMtime = statSync5(resolve39(Bun.main)).mtimeMs;
24481
+ globalThis.__hmrServerMtime = statSync6(resolve40(Bun.main)).mtimeMs;
24031
24482
  return result;
24032
24483
  };
24033
24484
  var init_devBuild = __esm(() => {
@@ -24056,6 +24507,9 @@ var init_devBuild = __esm(() => {
24056
24507
  ];
24057
24508
  });
24058
24509
 
24510
+ // types/websocket.ts
24511
+ var WS_READY_STATE_OPEN = 1;
24512
+
24059
24513
  // src/build.ts
24060
24514
  init_build();
24061
24515
  init_devBuild();
@@ -24064,5 +24518,5 @@ export {
24064
24518
  build
24065
24519
  };
24066
24520
 
24067
- //# debugId=3C052D33821FDEB764756E2164756E21
24521
+ //# debugId=E187E589A388125A64756E2164756E21
24068
24522
  //# sourceMappingURL=build.js.map