@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/index.js CHANGED
@@ -140,6 +140,9 @@ var isValidHMRClientMessage = (data) => {
140
140
  }
141
141
  };
142
142
 
143
+ // types/websocket.ts
144
+ var WS_READY_STATE_OPEN = 1;
145
+
143
146
  // src/build/stylePreprocessor.ts
144
147
  var exports_stylePreprocessor = {};
145
148
  __export(exports_stylePreprocessor, {
@@ -5698,13 +5701,17 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
5698
5701
  const path = id.startsWith(".") || isAbsolute2(id) ? resolve3(base, id) : Bun.resolveSync(id, base);
5699
5702
  const module = await import(path);
5700
5703
  return { base: dirname3(path), module, path };
5701
- }, buildCompilerEntry = async (cssPath) => {
5704
+ }, buildCompilerEntry = async (cssPath, extraSources = []) => {
5702
5705
  const compile = await loadTailwindCompile();
5703
5706
  const absPath = resolve3(cssPath);
5704
- const css = await readFile2(absPath, "utf-8");
5707
+ const userCss = await readFile2(absPath, "utf-8");
5705
5708
  const cssMtimeMs = (await stat(absPath)).mtimeMs;
5706
5709
  const cssDependencies = new Map;
5707
5710
  cssDependencies.set(absPath, cssMtimeMs);
5711
+ const sourceDirectives = extraSources.map((pattern) => `@source ${JSON.stringify(pattern)};`).join(`
5712
+ `);
5713
+ const css = sourceDirectives ? `${sourceDirectives}
5714
+ ${userCss}` : userCss;
5708
5715
  const compiler = await compile(css, {
5709
5716
  base: dirname3(absPath),
5710
5717
  loadModule,
@@ -5826,12 +5833,12 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
5826
5833
  });
5827
5834
  const results = await Promise.all(checks);
5828
5835
  return results.some(Boolean);
5829
- }, getCompilerEntry = async (cssPath) => {
5836
+ }, getCompilerEntry = async (cssPath, extraSources = []) => {
5830
5837
  const key = resolve3(cssPath);
5831
5838
  const cached = compilerCache.get(key);
5832
5839
  if (cached && !await isCompilerStale(cached))
5833
5840
  return cached;
5834
- const fresh = await buildCompilerEntry(cssPath);
5841
+ const fresh = await buildCompilerEntry(cssPath, extraSources);
5835
5842
  await populateCandidatesFromAllSources(fresh);
5836
5843
  compilerCache.set(key, fresh);
5837
5844
  return fresh;
@@ -5841,9 +5848,9 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
5841
5848
  return;
5842
5849
  }
5843
5850
  compilerCache.delete(resolve3(cssPath));
5844
- }, incrementalTailwindBuild = async (tailwind, buildPath, changedFiles, styleTransformConfig) => {
5851
+ }, incrementalTailwindBuild = async (tailwind, buildPath, changedFiles, styleTransformConfig, extraSources = []) => {
5845
5852
  const startedAt = performance.now();
5846
- const entry = await getCompilerEntry(tailwind.input);
5853
+ const entry = await getCompilerEntry(tailwind.input, extraSources);
5847
5854
  const inputAbs = entry.cssPath;
5848
5855
  const filesToRescan = [];
5849
5856
  for (const file of changedFiles) {
@@ -5866,8 +5873,8 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
5866
5873
  await Bun.write(outputPath, finalCss);
5867
5874
  entry.lastEmittedHash = hash;
5868
5875
  return { cssChanged: true, durationMs };
5869
- }, warmTailwindCompiler = async (tailwind) => {
5870
- await getCompilerEntry(tailwind.input);
5876
+ }, warmTailwindCompiler = async (tailwind, extraSources = []) => {
5877
+ await getCompilerEntry(tailwind.input, extraSources);
5871
5878
  };
5872
5879
  var init_tailwindCompiler = __esm(() => {
5873
5880
  init_stylePreprocessor();
@@ -5876,13 +5883,38 @@ var init_tailwindCompiler = __esm(() => {
5876
5883
  });
5877
5884
 
5878
5885
  // src/build/compileTailwind.ts
5886
+ var exports_compileTailwind = {};
5887
+ __export(exports_compileTailwind, {
5888
+ isTailwindCandidate: () => isTailwindCandidate,
5889
+ computeFrameworkTailwindSources: () => computeFrameworkTailwindSources,
5890
+ compileTailwindConfig: () => compileTailwindConfig,
5891
+ compileTailwind: () => compileTailwind
5892
+ });
5879
5893
  import { mkdir } from "fs/promises";
5880
- import { dirname as dirname4, join as join4 } from "path";
5881
- var TAILWIND_CANDIDATE_EXTENSION_PATTERN, isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath), compileTailwind = async (input, output, buildPath, styleTransformConfig) => {
5894
+ import { dirname as dirname4, join as join4, resolve as resolve4 } from "path";
5895
+ var computeFrameworkTailwindSources = (config) => {
5896
+ const cwd = process.cwd();
5897
+ const dirs = [
5898
+ [config.angularDirectory, "**/*.{ts,tsx,html,htm}"],
5899
+ [config.svelteDirectory, "**/*.{ts,tsx,svelte,html,htm}"],
5900
+ [config.vueDirectory, "**/*.{ts,tsx,vue,html,htm}"],
5901
+ [config.reactDirectory, "**/*.{ts,tsx,js,jsx,html,htm}"],
5902
+ [config.htmlDirectory, "**/*.{html,htm}"],
5903
+ [config.htmxDirectory, "**/*.{html,htm,js,ts}"],
5904
+ [config.emberDirectory, "**/*.{ts,tsx,gts,gjs,hbs,html,htm}"]
5905
+ ];
5906
+ const out = [];
5907
+ for (const [dir, glob] of dirs) {
5908
+ if (!dir)
5909
+ continue;
5910
+ out.push(`${resolve4(cwd, dir)}/${glob}`);
5911
+ }
5912
+ return out;
5913
+ }, TAILWIND_CANDIDATE_EXTENSION_PATTERN, isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath), compileTailwind = async (input, output, buildPath, styleTransformConfig, extraSources = [], changedFiles = []) => {
5882
5914
  const outputPath = join4(buildPath, output);
5883
5915
  await mkdir(dirname4(outputPath), { recursive: true });
5884
- await incrementalTailwindBuild({ input, output }, buildPath, [], styleTransformConfig);
5885
- }, compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig);
5916
+ await incrementalTailwindBuild({ input, output }, buildPath, changedFiles, styleTransformConfig, extraSources);
5917
+ }, compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig, extraSources = [], changedFiles = []) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig, extraSources, changedFiles);
5886
5918
  var init_compileTailwind = __esm(() => {
5887
5919
  init_tailwindCompiler();
5888
5920
  TAILWIND_CANDIDATE_EXTENSION_PATTERN = /\.(html?|m?[jt]sx?|cjs|vue|svelte|astro|mdx?|css|s[ac]ss|less|styl(?:us)?)$/i;
@@ -6967,7 +6999,7 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
6967
6999
  value: propValue
6968
7000
  })).filter((entry) => entry.token).map((entry) => ({ provide: entry.token, useValue: entry.value }));
6969
7001
  return [...providers, ...propProviders];
6970
- }, clearSelectorCache = () => selectorCache.clear(), isInjectionToken = (value) => {
7002
+ }, isInjectionToken = (value) => {
6971
7003
  if (!value || typeof value !== "object") {
6972
7004
  return false;
6973
7005
  }
@@ -7213,7 +7245,7 @@ var init_islandSsr = __esm(() => {
7213
7245
  });
7214
7246
 
7215
7247
  // src/build/resolvePackageImport.ts
7216
- import { resolve as resolve4, join as join5 } from "path";
7248
+ import { resolve as resolve5, join as join5 } from "path";
7217
7249
  import { existsSync as existsSync5, readFileSync as readFileSync5 } from "fs";
7218
7250
  var resolveExportPath = (entry, conditions) => {
7219
7251
  if (typeof entry === "string")
@@ -7235,10 +7267,10 @@ var resolveExportPath = (entry, conditions) => {
7235
7267
  const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
7236
7268
  const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
7237
7269
  const exportKey = subpath ? `./${subpath}` : ".";
7238
- const currentPackageJsonPath = resolve4(process.cwd(), "package.json");
7270
+ const currentPackageJsonPath = resolve5(process.cwd(), "package.json");
7239
7271
  const currentPackageJson = existsSync5(currentPackageJsonPath) ? JSON.parse(readFileSync5(currentPackageJsonPath, "utf-8")) : null;
7240
7272
  const currentPackageDir = currentPackageJson?.name === packageName ? process.cwd() : null;
7241
- const packageDir = currentPackageDir ?? resolve4(process.cwd(), "node_modules", packageName ?? "");
7273
+ const packageDir = currentPackageDir ?? resolve5(process.cwd(), "node_modules", packageName ?? "");
7242
7274
  const packageJsonPath = join5(packageDir, "package.json");
7243
7275
  if (!existsSync5(packageJsonPath))
7244
7276
  return null;
@@ -7254,12 +7286,12 @@ var resolveExportPath = (entry, conditions) => {
7254
7286
  if (!importPath)
7255
7287
  return null;
7256
7288
  if (currentPackageDir && importPath.startsWith("./dist/")) {
7257
- const sourceCandidate = resolve4(packageDir, importPath.replace(/^\.\/dist\//, "./src/"));
7289
+ const sourceCandidate = resolve5(packageDir, importPath.replace(/^\.\/dist\//, "./src/"));
7258
7290
  if (existsSync5(sourceCandidate)) {
7259
7291
  return sourceCandidate;
7260
7292
  }
7261
7293
  }
7262
- const resolved = resolve4(packageDir, importPath);
7294
+ const resolved = resolve5(packageDir, importPath);
7263
7295
  return existsSync5(resolved) ? resolved : null;
7264
7296
  } catch {
7265
7297
  return null;
@@ -7393,7 +7425,7 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
7393
7425
 
7394
7426
  // src/core/svelteServerModule.ts
7395
7427
  import { mkdir as mkdir2, readdir } from "fs/promises";
7396
- import { basename, dirname as dirname5, extname as extname2, join as join6, relative as relative2, resolve as resolve5 } from "path";
7428
+ import { basename, dirname as dirname5, extname as extname2, join as join6, relative as relative2, resolve as resolve6 } from "path";
7397
7429
  var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
7398
7430
  const importPath = relative2(dirname5(from), target).replace(/\\/g, "/");
7399
7431
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
@@ -7441,7 +7473,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
7441
7473
  if (!spec.startsWith(".")) {
7442
7474
  return null;
7443
7475
  }
7444
- const basePath = resolve5(dirname5(from), spec);
7476
+ const basePath = resolve6(dirname5(from), spec);
7445
7477
  const candidates = [
7446
7478
  basePath,
7447
7479
  `${basePath}.ts`,
@@ -7473,7 +7505,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
7473
7505
  if (!spec.startsWith(".")) {
7474
7506
  return null;
7475
7507
  }
7476
- const explicitPath = resolve5(dirname5(from), spec);
7508
+ const explicitPath = resolve6(dirname5(from), spec);
7477
7509
  if (extname2(explicitPath) === ".svelte") {
7478
7510
  return explicitPath;
7479
7511
  }
@@ -7573,7 +7605,7 @@ var init_svelteServerModule = __esm(() => {
7573
7605
 
7574
7606
  // src/core/vueServerModule.ts
7575
7607
  import { mkdir as mkdir3 } from "fs/promises";
7576
- import { dirname as dirname6, join as join7, relative as relative3, resolve as resolve6 } from "path";
7608
+ import { dirname as dirname6, join as join7, relative as relative3, resolve as resolve7 } from "path";
7577
7609
  var {Transpiler } = globalThis.Bun;
7578
7610
  var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot2, compiledModuleCache2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
7579
7611
  const importPath = relative3(dirname6(from), target).replace(/\\/g, "/");
@@ -7636,7 +7668,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot2, compiledModuleCache2, tran
7636
7668
  }).code : "const ssrRender = () => {};";
7637
7669
  const childImportPaths = extractRelativeVueImports(compiledScript.content);
7638
7670
  const compiledChildren = await Promise.all(childImportPaths.map(async (relativeImport) => ({
7639
- compiledPath: await compileVueServerModule(resolve6(dirname6(sourcePath), relativeImport)),
7671
+ compiledPath: await compileVueServerModule(resolve7(dirname6(sourcePath), relativeImport)),
7640
7672
  spec: relativeImport
7641
7673
  })));
7642
7674
  const strippedScript = stripExports(compiledScript.content);
@@ -7823,7 +7855,7 @@ var init_renderIslandMarkup = __esm(() => {
7823
7855
 
7824
7856
  // src/build/islandEntries.ts
7825
7857
  import { mkdirSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
7826
- import { dirname as dirname7, extname as extname3, join as join8, relative as relative4, resolve as resolve7 } from "path";
7858
+ import { dirname as dirname7, extname as extname3, join as join8, relative as relative4, resolve as resolve8 } from "path";
7827
7859
  import ts from "typescript";
7828
7860
  var frameworks, isRecord4 = (value) => typeof value === "object" && value !== null, resolveRegistryExport = (mod) => {
7829
7861
  if (isRecord4(mod.islandRegistry))
@@ -7838,7 +7870,7 @@ var frameworks, isRecord4 = (value) => typeof value === "object" && value !== nu
7838
7870
  if (sourcePath.startsWith("file://")) {
7839
7871
  return new URL(sourcePath).pathname;
7840
7872
  }
7841
- return resolve7(dirname7(registryPath), sourcePath);
7873
+ return resolve8(dirname7(registryPath), sourcePath);
7842
7874
  }, getObjectPropertyName = (name) => {
7843
7875
  if (ts.isIdentifier(name) || ts.isStringLiteral(name)) {
7844
7876
  return name.text;
@@ -8078,7 +8110,7 @@ export default component;
8078
8110
  generatedRoot
8079
8111
  };
8080
8112
  }, loadIslandRegistryBuildInfo = async (registryPath) => {
8081
- const resolvedRegistryPath = resolve7(registryPath);
8113
+ const resolvedRegistryPath = resolve8(registryPath);
8082
8114
  const registrySource = Bun.file(resolvedRegistryPath);
8083
8115
  const registrySourceText = await registrySource.text();
8084
8116
  const parsedInfo = parseIslandRegistryBuildInfo(registrySourceText, resolvedRegistryPath);
@@ -8345,7 +8377,7 @@ __export(exports_loadConfig, {
8345
8377
  isWorkspaceConfig: () => isWorkspaceConfig,
8346
8378
  getWorkspaceServices: () => getWorkspaceServices
8347
8379
  });
8348
- import { resolve as resolve8 } from "path";
8380
+ import { resolve as resolve9 } from "path";
8349
8381
  var RESERVED_TOP_LEVEL_KEYS, isObject = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
8350
8382
  if (!isObject(config)) {
8351
8383
  return false;
@@ -8396,7 +8428,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject = (value) => typeof value === "object" &&
8396
8428
  }
8397
8429
  return config;
8398
8430
  }, loadRawConfig = async (configPath) => {
8399
- const resolved = resolve8(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
8431
+ const resolved = resolve9(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
8400
8432
  const mod = await import(resolved);
8401
8433
  const config = mod.default ?? mod.config;
8402
8434
  if (!config) {
@@ -8539,7 +8571,7 @@ var init_sourceMetadata = __esm(() => {
8539
8571
 
8540
8572
  // src/islands/pageMetadata.ts
8541
8573
  import { readFileSync as readFileSync7 } from "fs";
8542
- import { dirname as dirname8, resolve as resolve10 } from "path";
8574
+ import { dirname as dirname8, resolve as resolve11 } from "path";
8543
8575
  var pagePatterns, getPageDirs = (config) => [
8544
8576
  { dir: config.angularDirectory, framework: "angular" },
8545
8577
  { dir: config.emberDirectory, framework: "ember" },
@@ -8559,15 +8591,15 @@ var pagePatterns, getPageDirs = (config) => [
8559
8591
  const source = definition.buildReference?.source;
8560
8592
  if (!source)
8561
8593
  continue;
8562
- const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve10(dirname8(buildInfo.resolvedRegistryPath), source);
8563
- lookup.set(`${definition.framework}:${definition.component}`, resolve10(resolvedSource));
8594
+ const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve11(dirname8(buildInfo.resolvedRegistryPath), source);
8595
+ lookup.set(`${definition.framework}:${definition.component}`, resolve11(resolvedSource));
8564
8596
  }
8565
8597
  return lookup;
8566
8598
  }, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata2, target) => metadata2.islands.some((usage) => {
8567
8599
  const candidate = usage.source;
8568
- return candidate ? resolve10(candidate) === target : false;
8600
+ return candidate ? resolve11(candidate) === target : false;
8569
8601
  }), getPagesUsingIslandSource = (sourcePath) => {
8570
- const target = resolve10(sourcePath);
8602
+ const target = resolve11(sourcePath);
8571
8603
  return [...getCurrentPageIslandMetadata().values()].filter((metadata2) => metadataUsesSource(metadata2, target)).map((metadata2) => metadata2.pagePath);
8572
8604
  }, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
8573
8605
  const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
@@ -8579,13 +8611,13 @@ var pagePatterns, getPageDirs = (config) => [
8579
8611
  const pattern = pagePatterns[entry.framework];
8580
8612
  if (!pattern)
8581
8613
  return;
8582
- const files = await scanEntryPoints(resolve10(entry.dir), pattern);
8614
+ const files = await scanEntryPoints(resolve11(entry.dir), pattern);
8583
8615
  for (const filePath of files) {
8584
8616
  const source = readFileSync7(filePath, "utf-8");
8585
8617
  const islands = extractIslandUsagesFromSource(source);
8586
- pageMetadata.set(resolve10(filePath), {
8618
+ pageMetadata.set(resolve11(filePath), {
8587
8619
  islands: resolveIslandUsages(islands, islandSourceLookup),
8588
- pagePath: resolve10(filePath)
8620
+ pagePath: resolve11(filePath)
8589
8621
  });
8590
8622
  }
8591
8623
  }, loadPageIslandMetadata = async (config) => {
@@ -8945,7 +8977,7 @@ var init_generateManifest = __esm(() => {
8945
8977
  });
8946
8978
 
8947
8979
  // src/build/verifyAngularCoreUniqueness.ts
8948
- import { resolve as resolve11 } from "path";
8980
+ import { resolve as resolve12 } from "path";
8949
8981
  var ANGULAR_CORE_IMPORT_RE, ANGULAR_CORE_PACKAGE_RE, classifySpecifier = (specifier, artifactPath, serverOutDir) => {
8950
8982
  if (!ANGULAR_CORE_PACKAGE_RE.test(specifier))
8951
8983
  return null;
@@ -8955,9 +8987,9 @@ var ANGULAR_CORE_IMPORT_RE, ANGULAR_CORE_PACKAGE_RE, classifySpecifier = (specif
8955
8987
  if (specifier.startsWith("/")) {
8956
8988
  absolute = specifier;
8957
8989
  } else if (specifier.startsWith(".")) {
8958
- absolute = resolve11(artifactPath, "..", specifier);
8990
+ absolute = resolve12(artifactPath, "..", specifier);
8959
8991
  } else {
8960
- absolute = serverOutDir ? resolve11(serverOutDir, specifier) : resolve11(artifactPath, "..", specifier);
8992
+ absolute = serverOutDir ? resolve12(serverOutDir, specifier) : resolve12(artifactPath, "..", specifier);
8961
8993
  }
8962
8994
  return {
8963
8995
  kind: "resolved",
@@ -9022,18 +9054,18 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
9022
9054
  // src/build/generateReactIndexes.ts
9023
9055
  import { existsSync as existsSync7, mkdirSync as mkdirSync2 } from "fs";
9024
9056
  import { readdir as readdir2, rm, writeFile } from "fs/promises";
9025
- import { basename as basename3, join as join9, relative as relative5, resolve as resolve12, sep } from "path";
9057
+ import { basename as basename3, join as join9, relative as relative5, resolve as resolve13, sep } from "path";
9026
9058
  var {Glob: Glob2 } = globalThis.Bun;
9027
9059
  var indexContentCache, resolveDevClientDir = () => {
9028
9060
  const projectRoot = process.cwd();
9029
- const fromSource = resolve12(import.meta.dir, "../dev/client");
9061
+ const fromSource = resolve13(import.meta.dir, "../dev/client");
9030
9062
  if (existsSync7(fromSource) && fromSource.startsWith(projectRoot)) {
9031
9063
  return fromSource;
9032
9064
  }
9033
- const fromNodeModules = resolve12(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
9065
+ const fromNodeModules = resolve13(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
9034
9066
  if (existsSync7(fromNodeModules))
9035
9067
  return fromNodeModules;
9036
- return resolve12(import.meta.dir, "./dev/client");
9068
+ return resolve13(import.meta.dir, "./dev/client");
9037
9069
  }, devClientDir, errorOverlayPath, hmrClientPath, refreshSetupPath, generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory, isDev2 = false) => {
9038
9070
  if (!existsSync7(reactIndexesDirectory)) {
9039
9071
  mkdirSync2(reactIndexesDirectory, { recursive: true });
@@ -9061,7 +9093,7 @@ var indexContentCache, resolveDevClientDir = () => {
9061
9093
  });
9062
9094
  }));
9063
9095
  }
9064
- const pagesRelPath = relative5(resolve12(reactIndexesDirectory), resolve12(reactPagesDirectory)).split(sep).join("/");
9096
+ const pagesRelPath = relative5(resolve13(reactIndexesDirectory), resolve13(reactPagesDirectory)).split(sep).join("/");
9065
9097
  const promises = files.map(async (file2) => {
9066
9098
  const fileName = basename3(file2);
9067
9099
  const componentName = fileName.split(".")[0];
@@ -9335,7 +9367,7 @@ var indexContentCache, resolveDevClientDir = () => {
9335
9367
  `
9336
9368
  // Pre-warm: import the page module from the module server`,
9337
9369
  `// immediately so the browser caches all /@src/ URLs.`,
9338
- `import('/@src/${relative5(process.cwd(), resolve12(reactPagesDirectory, `${componentName}.tsx`)).replace(/\\/g, "/")}').catch(() => {});`
9370
+ `import('/@src/${relative5(process.cwd(), resolve13(reactPagesDirectory, `${componentName}.tsx`)).replace(/\\/g, "/")}').catch(() => {});`
9339
9371
  ] : []
9340
9372
  ].join(`
9341
9373
  `);
@@ -9503,7 +9535,7 @@ var init_scanCssEntryPoints = __esm(() => {
9503
9535
 
9504
9536
  // src/utils/imageProcessing.ts
9505
9537
  import { existsSync as existsSync10, mkdirSync as mkdirSync3, readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "fs";
9506
- import { join as join10, resolve as resolve13 } from "path";
9538
+ import { join as join10, resolve as resolve14 } from "path";
9507
9539
  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) => {
9508
9540
  for (const size of sizes) {
9509
9541
  if (size >= target)
@@ -9631,7 +9663,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
9631
9663
  return sharpModule;
9632
9664
  sharpLoaded = true;
9633
9665
  try {
9634
- const sharpPath = resolve13(process.cwd(), "node_modules/sharp");
9666
+ const sharpPath = resolve14(process.cwd(), "node_modules/sharp");
9635
9667
  const mod = await import(sharpPath);
9636
9668
  sharpModule = mod.default ?? mod;
9637
9669
  return sharpModule;
@@ -9820,6 +9852,9 @@ var replaceAssetRef = (match, prefix, dir, name, ext, suffix, manifest, filePath
9820
9852
  if (/data-external(?:\s*=\s*["'][^"']*["'])?/i.test(match)) {
9821
9853
  return match;
9822
9854
  }
9855
+ if (dir.startsWith("/") || /^[a-z][a-z0-9+.-]*:\/\//i.test(dir)) {
9856
+ return match;
9857
+ }
9823
9858
  const pascal = toPascal(name);
9824
9859
  let key;
9825
9860
  if (ext === ".css") {
@@ -9863,18 +9898,18 @@ var init_updateAssetPaths = __esm(() => {
9863
9898
 
9864
9899
  // src/dev/buildHMRClient.ts
9865
9900
  import { existsSync as existsSync13 } from "fs";
9866
- import { resolve as resolve14 } from "path";
9901
+ import { resolve as resolve15 } from "path";
9867
9902
  var {build: bunBuild } = globalThis.Bun;
9868
9903
  var resolveHmrClientPath = () => {
9869
9904
  const projectRoot = process.cwd();
9870
- const fromSource = resolve14(import.meta.dir, "client/hmrClient.ts");
9905
+ const fromSource = resolve15(import.meta.dir, "client/hmrClient.ts");
9871
9906
  if (existsSync13(fromSource) && fromSource.startsWith(projectRoot)) {
9872
9907
  return fromSource;
9873
9908
  }
9874
- const fromNodeModules = resolve14(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
9909
+ const fromNodeModules = resolve15(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
9875
9910
  if (existsSync13(fromNodeModules))
9876
9911
  return fromNodeModules;
9877
- return resolve14(import.meta.dir, "dev/client/hmrClient.ts");
9912
+ return resolve15(import.meta.dir, "dev/client/hmrClient.ts");
9878
9913
  }, hmrClientPath2, buildHMRClient = async () => {
9879
9914
  const entryPoint = hmrClientPath2;
9880
9915
  const result = await bunBuild({
@@ -9904,7 +9939,7 @@ var init_buildHMRClient = __esm(() => {
9904
9939
  // src/build/nativeRewrite.ts
9905
9940
  import { dlopen, FFIType, ptr } from "bun:ffi";
9906
9941
  import { platform as platform2, arch as arch2 } from "os";
9907
- import { resolve as resolve15 } from "path";
9942
+ import { resolve as resolve16 } from "path";
9908
9943
  var ffiDefinition, nativeLib = null, loadNative = () => {
9909
9944
  if (nativeLib !== null)
9910
9945
  return nativeLib;
@@ -9922,7 +9957,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
9922
9957
  if (!libPath)
9923
9958
  return null;
9924
9959
  try {
9925
- const fullPath = resolve15(import.meta.dir, "../../native/packages", libPath);
9960
+ const fullPath = resolve16(import.meta.dir, "../../native/packages", libPath);
9926
9961
  const lib = dlopen(fullPath, ffiDefinition);
9927
9962
  nativeLib = lib.symbols;
9928
9963
  return nativeLib;
@@ -10068,7 +10103,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
10068
10103
 
10069
10104
  // src/build/angularLinkerPlugin.ts
10070
10105
  import { existsSync as existsSync14, mkdirSync as mkdirSync5, readFileSync as readFileSync11, writeFileSync as writeFileSync6 } from "fs";
10071
- import { dirname as dirname10, join as join13, relative as relative6, resolve as resolve16 } from "path";
10106
+ import { dirname as dirname10, join as join13, relative as relative6, resolve as resolve17 } from "path";
10072
10107
  import { createHash as createHash3 } from "crypto";
10073
10108
  var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
10074
10109
  name: "angular-linker",
@@ -10110,7 +10145,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
10110
10145
  exists: existsSync14,
10111
10146
  readFile: readFileSync11,
10112
10147
  relative: relative6,
10113
- resolve: resolve16
10148
+ resolve: resolve17
10114
10149
  },
10115
10150
  linkerJitMode,
10116
10151
  logger: {
@@ -10141,7 +10176,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
10141
10176
  }
10142
10177
  }), angularLinkerPlugin;
10143
10178
  var init_angularLinkerPlugin = __esm(() => {
10144
- CACHE_ROOT = resolve16(".absolutejs", "cache", "angular-linker");
10179
+ CACHE_ROOT = resolve17(".absolutejs", "cache", "angular-linker");
10145
10180
  ANGULAR_LINKER_CANDIDATE_RE = /[\\/]node_modules[\\/].*\.m?js$/;
10146
10181
  angularLinkerPlugin = createAngularLinkerPlugin(false);
10147
10182
  });
@@ -10153,7 +10188,7 @@ __export(exports_hmrInjectionPlugin, {
10153
10188
  applyAngularHmrInjection: () => applyAngularHmrInjection
10154
10189
  });
10155
10190
  import { readFile as readFile5 } from "fs/promises";
10156
- import { relative as relative7, resolve as resolve17 } from "path";
10191
+ import { relative as relative7, resolve as resolve18 } from "path";
10157
10192
  var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
10158
10193
  const names = new Set;
10159
10194
  IMPORT_RE.lastIndex = 0;
@@ -10316,7 +10351,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
10316
10351
  }
10317
10352
  `, applyAngularHmrInjection = (jsSource, componentJsAbsPath, params) => {
10318
10353
  const { generatedAngularRoot, userAngularRoot, projectRoot } = params;
10319
- const normalizedGenRoot = resolve17(generatedAngularRoot).replace(/\\/g, "/");
10354
+ const normalizedGenRoot = resolve18(generatedAngularRoot).replace(/\\/g, "/");
10320
10355
  const normalizedPath = componentJsAbsPath.replace(/\\/g, "/");
10321
10356
  if (!normalizedPath.startsWith(normalizedGenRoot + "/"))
10322
10357
  return;
@@ -10334,7 +10369,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
10334
10369
  if (classNames.length === 0)
10335
10370
  return;
10336
10371
  const relFromGenRoot = relative7(generatedAngularRoot, componentJsAbsPath).replace(/\\/g, "/");
10337
- const userTsPath = resolve17(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
10372
+ const userTsPath = resolve18(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
10338
10373
  const projectRel = relative7(projectRoot, userTsPath).replace(/\\/g, "/");
10339
10374
  const tail = classNames.map((className) => {
10340
10375
  const id = `${projectRel}@${className}`;
@@ -10369,14 +10404,14 @@ var init_hmrInjectionPlugin = __esm(() => {
10369
10404
 
10370
10405
  // src/utils/cleanStaleOutputs.ts
10371
10406
  import { rm as rm2 } from "fs/promises";
10372
- import { resolve as resolve18 } from "path";
10407
+ import { resolve as resolve19 } from "path";
10373
10408
  var {Glob: Glob5 } = globalThis.Bun;
10374
10409
  var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
10375
- const currentPaths = new Set(currentOutputPaths.map((path) => resolve18(path)));
10410
+ const currentPaths = new Set(currentOutputPaths.map((path) => resolve19(path)));
10376
10411
  const glob = new Glob5("**/*");
10377
10412
  const removals = [];
10378
10413
  for (const relative8 of glob.scanSync({ cwd: buildPath })) {
10379
- const absolute = resolve18(buildPath, relative8);
10414
+ const absolute = resolve19(buildPath, relative8);
10380
10415
  if (currentPaths.has(absolute))
10381
10416
  continue;
10382
10417
  if (!HASHED_FILE_PATTERN.test(relative8))
@@ -10610,10 +10645,10 @@ var init_buildDirectoryLock = __esm(() => {
10610
10645
  });
10611
10646
 
10612
10647
  // src/utils/validateSafePath.ts
10613
- import { resolve as resolve19, relative as relative8 } from "path";
10648
+ import { resolve as resolve20, relative as relative8 } from "path";
10614
10649
  var validateSafePath = (targetPath, baseDirectory) => {
10615
- const absoluteBase = resolve19(baseDirectory);
10616
- const absoluteTarget = resolve19(baseDirectory, targetPath);
10650
+ const absoluteBase = resolve20(baseDirectory);
10651
+ const absoluteTarget = resolve20(baseDirectory, targetPath);
10617
10652
  const relativePath = normalizePath(relative8(absoluteBase, absoluteTarget));
10618
10653
  if (relativePath.startsWith("../") || relativePath === "..") {
10619
10654
  throw new Error(`Unsafe path: ${targetPath}`);
@@ -10691,7 +10726,7 @@ import {
10691
10726
  join as join17,
10692
10727
  basename as basename5,
10693
10728
  extname as extname5,
10694
- resolve as resolve20,
10729
+ resolve as resolve21,
10695
10730
  relative as relative9,
10696
10731
  sep as sep2
10697
10732
  } from "path";
@@ -10699,14 +10734,14 @@ import { env as env2 } from "process";
10699
10734
  var {write, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
10700
10735
  var resolveDevClientDir2 = () => {
10701
10736
  const projectRoot = process.cwd();
10702
- const fromSource = resolve20(import.meta.dir, "../dev/client");
10737
+ const fromSource = resolve21(import.meta.dir, "../dev/client");
10703
10738
  if (existsSync15(fromSource) && fromSource.startsWith(projectRoot)) {
10704
10739
  return fromSource;
10705
10740
  }
10706
- const fromNodeModules = resolve20(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
10741
+ const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
10707
10742
  if (existsSync15(fromNodeModules))
10708
10743
  return fromNodeModules;
10709
- return resolve20(import.meta.dir, "./dev/client");
10744
+ return resolve21(import.meta.dir, "./dev/client");
10710
10745
  }, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
10711
10746
  persistentCache.clear();
10712
10747
  sourceHashCache.clear();
@@ -10736,7 +10771,7 @@ var resolveDevClientDir2 = () => {
10736
10771
  }, resolveRelativeModule2 = async (spec, from) => {
10737
10772
  if (!spec.startsWith("."))
10738
10773
  return null;
10739
- const basePath = resolve20(dirname12(from), spec);
10774
+ const basePath = resolve21(dirname12(from), spec);
10740
10775
  const candidates = [
10741
10776
  basePath,
10742
10777
  `${basePath}.ts`,
@@ -10763,7 +10798,7 @@ var resolveDevClientDir2 = () => {
10763
10798
  const resolved = resolvePackageImport(spec);
10764
10799
  return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
10765
10800
  }
10766
- const basePath = resolve20(dirname12(from), spec);
10801
+ const basePath = resolve21(dirname12(from), spec);
10767
10802
  const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
10768
10803
  if (!explicit) {
10769
10804
  const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
@@ -10807,7 +10842,7 @@ var resolveDevClientDir2 = () => {
10807
10842
  const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
10808
10843
  const prevHash = sourceHashCache.get(src);
10809
10844
  const persistent = persistentCache.get(src);
10810
- if (prevHash === contentHash && persistent) {
10845
+ if (prevHash === contentHash && persistent && existsSync15(persistent.ssr) && existsSync15(persistent.client)) {
10811
10846
  cache.set(src, persistent);
10812
10847
  return persistent;
10813
10848
  }
@@ -11100,19 +11135,19 @@ import {
11100
11135
  isAbsolute as isAbsolute3,
11101
11136
  join as join18,
11102
11137
  relative as relative10,
11103
- resolve as resolve21
11138
+ resolve as resolve22
11104
11139
  } from "path";
11105
11140
  var {file: file3, write: write2, Transpiler: Transpiler3 } = globalThis.Bun;
11106
11141
  var resolveDevClientDir3 = () => {
11107
11142
  const projectRoot = process.cwd();
11108
- const fromSource = resolve21(import.meta.dir, "../dev/client");
11143
+ const fromSource = resolve22(import.meta.dir, "../dev/client");
11109
11144
  if (existsSync16(fromSource) && fromSource.startsWith(projectRoot)) {
11110
11145
  return fromSource;
11111
11146
  }
11112
- const fromNodeModules = resolve21(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
11147
+ const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
11113
11148
  if (existsSync16(fromNodeModules))
11114
11149
  return fromNodeModules;
11115
- return resolve21(import.meta.dir, "./dev/client");
11150
+ return resolve22(import.meta.dir, "./dev/client");
11116
11151
  }, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
11117
11152
  scriptCache.clear();
11118
11153
  scriptSetupCache.clear();
@@ -11158,7 +11193,7 @@ var resolveDevClientDir3 = () => {
11158
11193
  return filePath.replace(/\.ts$/, ".js");
11159
11194
  if (isStylePath(filePath)) {
11160
11195
  if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
11161
- return resolve21(sourceDir, filePath);
11196
+ return resolve22(sourceDir, filePath);
11162
11197
  }
11163
11198
  return filePath;
11164
11199
  }
@@ -11194,7 +11229,7 @@ var resolveDevClientDir3 = () => {
11194
11229
  const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
11195
11230
  const prevHash = vueSourceHashCache.get(sourceFilePath);
11196
11231
  const persistent = persistentBuildCache.get(sourceFilePath);
11197
- if (prevHash === contentHash && persistent) {
11232
+ if (prevHash === contentHash && persistent && existsSync16(persistent.clientPath) && existsSync16(persistent.serverPath)) {
11198
11233
  cacheMap.set(sourceFilePath, persistent);
11199
11234
  return persistent;
11200
11235
  }
@@ -11222,12 +11257,12 @@ var resolveDevClientDir3 = () => {
11222
11257
  const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
11223
11258
  const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
11224
11259
  const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
11225
- const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve21(dirname13(sourceFilePath), path));
11260
+ const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve22(dirname13(sourceFilePath), path));
11226
11261
  for (const stylePath of stylePathsImported) {
11227
11262
  addStyleImporter(sourceFilePath, stylePath);
11228
11263
  }
11229
11264
  const childBuildResults = await Promise.all([
11230
- ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve21(dirname13(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
11265
+ ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve22(dirname13(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
11231
11266
  ...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
11232
11267
  ]);
11233
11268
  const hasScript = descriptor.script || descriptor.scriptSetup;
@@ -11338,7 +11373,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
11338
11373
  hmrId,
11339
11374
  serverPath: serverOutputPath,
11340
11375
  tsHelperPaths: [
11341
- ...helperModulePaths.map((helper) => resolve21(dirname13(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
11376
+ ...helperModulePaths.map((helper) => resolve22(dirname13(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
11342
11377
  ...childBuildResults.flatMap((child) => child.tsHelperPaths)
11343
11378
  ]
11344
11379
  };
@@ -11361,7 +11396,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
11361
11396
  const buildCache = new Map;
11362
11397
  const allTsHelperPaths = new Set;
11363
11398
  const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
11364
- const result = await compileVueFile(resolve21(entryPath), {
11399
+ const result = await compileVueFile(resolve22(entryPath), {
11365
11400
  client: clientOutputDir,
11366
11401
  css: cssOutputDir,
11367
11402
  server: serverOutputDir
@@ -12020,23 +12055,25 @@ var init_lowerDeferSyntax = __esm(() => {
12020
12055
  // src/build/compileAngular.ts
12021
12056
  var exports_compileAngular = {};
12022
12057
  __export(exports_compileAngular, {
12058
+ invalidateAngularJitCache: () => invalidateAngularJitCache,
12023
12059
  compileAngularFiles: () => compileAngularFiles,
12024
12060
  compileAngularFileJIT: () => compileAngularFileJIT,
12025
12061
  compileAngularFile: () => compileAngularFile,
12026
12062
  compileAngular: () => compileAngular
12027
12063
  });
12028
12064
  import { existsSync as existsSync17, readFileSync as readFileSync13, promises as fs } from "fs";
12029
- import { join as join19, basename as basename7, sep as sep3, dirname as dirname14, resolve as resolve22, relative as relative11 } from "path";
12065
+ import { join as join19, basename as basename7, sep as sep3, dirname as dirname14, resolve as resolve23, relative as relative11 } from "path";
12066
+ var {Glob: Glob6 } = globalThis.Bun;
12030
12067
  import ts2 from "typescript";
12031
12068
  var traceAngularPhase = async (name, fn2, metadata2) => {
12032
12069
  const tracePhase = globalThis.__absoluteBuildTracePhase;
12033
12070
  return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata2) : await fn2();
12034
12071
  }, readTsconfigPathAliases = () => {
12035
12072
  try {
12036
- const configPath2 = resolve22(process.cwd(), "tsconfig.json");
12073
+ const configPath2 = resolve23(process.cwd(), "tsconfig.json");
12037
12074
  const config = ts2.readConfigFile(configPath2, ts2.sys.readFile).config;
12038
12075
  const compilerOptions = config?.compilerOptions ?? {};
12039
- const baseUrl = resolve22(process.cwd(), compilerOptions.baseUrl ?? ".");
12076
+ const baseUrl = resolve23(process.cwd(), compilerOptions.baseUrl ?? ".");
12040
12077
  const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
12041
12078
  return { aliases, baseUrl };
12042
12079
  } catch {
@@ -12056,7 +12093,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12056
12093
  const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
12057
12094
  for (const replacement of alias.replacements) {
12058
12095
  const candidate = replacement.replace("*", wildcardValue);
12059
- const resolved = resolveSourceFile(resolve22(baseUrl, candidate));
12096
+ const resolved = resolveSourceFile(resolve23(baseUrl, candidate));
12060
12097
  if (resolved)
12061
12098
  return resolved;
12062
12099
  }
@@ -12075,13 +12112,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12075
12112
  ];
12076
12113
  return candidates.find((file4) => existsSync17(file4));
12077
12114
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
12078
- const baseDir = resolve22(rootDir);
12115
+ const baseDir = resolve23(rootDir);
12079
12116
  const tsconfigAliases = readTsconfigPathAliases();
12080
12117
  const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
12081
12118
  const scanCache = new Map;
12082
12119
  const resolveLocalImport = (specifier, fromDir) => {
12083
12120
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
12084
- return resolveSourceFile(resolve22(fromDir, specifier));
12121
+ return resolveSourceFile(resolve23(fromDir, specifier));
12085
12122
  }
12086
12123
  const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
12087
12124
  if (aliased)
@@ -12090,7 +12127,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12090
12127
  const resolved = Bun.resolveSync(specifier, fromDir);
12091
12128
  if (resolved.includes("/node_modules/"))
12092
12129
  return;
12093
- const absolute = resolve22(resolved);
12130
+ const absolute = resolve23(resolved);
12094
12131
  if (!absolute.startsWith(baseDir))
12095
12132
  return;
12096
12133
  return resolveSourceFile(absolute);
@@ -12106,7 +12143,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12106
12143
  usesLegacyAnimations: false
12107
12144
  });
12108
12145
  }
12109
- const resolved = resolve22(actualPath);
12146
+ const resolved = resolve23(actualPath);
12110
12147
  const cached = scanCache.get(resolved);
12111
12148
  if (cached)
12112
12149
  return cached;
@@ -12135,7 +12172,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12135
12172
  const actualPath = resolveSourceFile(filePath);
12136
12173
  if (!actualPath)
12137
12174
  return false;
12138
- const resolved = resolve22(actualPath);
12175
+ const resolved = resolve23(actualPath);
12139
12176
  if (visited.has(resolved))
12140
12177
  return false;
12141
12178
  visited.add(resolved);
@@ -12153,14 +12190,14 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12153
12190
  return (entryPath) => visit(entryPath);
12154
12191
  }, resolveDevClientDir4 = () => {
12155
12192
  const projectRoot = process.cwd();
12156
- const fromSource = resolve22(import.meta.dir, "../dev/client");
12193
+ const fromSource = resolve23(import.meta.dir, "../dev/client");
12157
12194
  if (existsSync17(fromSource) && fromSource.startsWith(projectRoot)) {
12158
12195
  return fromSource;
12159
12196
  }
12160
- const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
12197
+ const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
12161
12198
  if (existsSync17(fromNodeModules))
12162
12199
  return fromNodeModules;
12163
- return resolve22(import.meta.dir, "./dev/client");
12200
+ return resolve23(import.meta.dir, "./dev/client");
12164
12201
  }, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
12165
12202
  try {
12166
12203
  return ts2.flattenDiagnosticMessageText(diagnostic.messageText, `
@@ -12203,11 +12240,11 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12203
12240
  if (hasJsLikeExtension(path))
12204
12241
  return `${path}${query}`;
12205
12242
  const importerDir = dirname14(importerOutputPath);
12206
- const fileCandidate = resolve22(importerDir, `${path}.js`);
12243
+ const fileCandidate = resolve23(importerDir, `${path}.js`);
12207
12244
  if (outputFiles?.has(fileCandidate) || existsSync17(fileCandidate)) {
12208
12245
  return `${path}.js${query}`;
12209
12246
  }
12210
- const indexCandidate = resolve22(importerDir, path, "index.js");
12247
+ const indexCandidate = resolve23(importerDir, path, "index.js");
12211
12248
  if (outputFiles?.has(indexCandidate) || existsSync17(indexCandidate)) {
12212
12249
  return `${path}/index.js${query}`;
12213
12250
  }
@@ -12235,7 +12272,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12235
12272
  }, resolveLocalTsImport = (fromFile, specifier) => {
12236
12273
  if (!isRelativeModuleSpecifier(specifier))
12237
12274
  return null;
12238
- const basePath = resolve22(dirname14(fromFile), specifier);
12275
+ const basePath = resolve23(dirname14(fromFile), specifier);
12239
12276
  const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
12240
12277
  `${basePath}.ts`,
12241
12278
  `${basePath}.tsx`,
@@ -12246,7 +12283,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12246
12283
  join19(basePath, "index.mts"),
12247
12284
  join19(basePath, "index.cts")
12248
12285
  ];
12249
- return candidates.map((candidate) => resolve22(candidate)).find((candidate) => existsSync17(candidate) && !candidate.endsWith(".d.ts")) ?? null;
12286
+ return candidates.map((candidate) => resolve23(candidate)).find((candidate) => existsSync17(candidate) && !candidate.endsWith(".d.ts")) ?? null;
12250
12287
  }, readFileForAotTransform = async (fileName, readFile6) => {
12251
12288
  const hostSource = readFile6?.(fileName);
12252
12289
  if (typeof hostSource === "string")
@@ -12281,7 +12318,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12281
12318
  paths.push(join19(fileDir, urlMatch.replace(/['"]/g, "")));
12282
12319
  }
12283
12320
  }
12284
- return paths.map((path) => resolve22(path));
12321
+ return paths.map((path) => resolve23(path));
12285
12322
  }, readResourceCacheFile = async (cachePath) => {
12286
12323
  try {
12287
12324
  const entry = JSON.parse(await fs.readFile(cachePath, "utf-8"));
@@ -12323,7 +12360,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12323
12360
  transformedFiles: 0
12324
12361
  };
12325
12362
  const transformFile = async (filePath) => {
12326
- const resolvedPath = resolve22(filePath);
12363
+ const resolvedPath = resolve23(filePath);
12327
12364
  if (visited.has(resolvedPath))
12328
12365
  return;
12329
12366
  visited.add(resolvedPath);
@@ -12358,7 +12395,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12358
12395
  return { stats, transformedSources };
12359
12396
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
12360
12397
  const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
12361
- const outputPath = resolve22(join19(outDir, relative11(process.cwd(), resolve22(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
12398
+ const outputPath = resolve23(join19(outDir, relative11(process.cwd(), resolve23(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
12362
12399
  return [
12363
12400
  outputPath,
12364
12401
  buildIslandMetadataExports(readFileSync13(inputPath, "utf-8"))
@@ -12369,7 +12406,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12369
12406
  const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
12370
12407
  const tsPath = __require.resolve("typescript");
12371
12408
  const tsRootDir = dirname14(tsPath);
12372
- return tsRootDir.endsWith("lib") ? tsRootDir : resolve22(tsRootDir, "lib");
12409
+ return tsRootDir.endsWith("lib") ? tsRootDir : resolve23(tsRootDir, "lib");
12373
12410
  });
12374
12411
  const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
12375
12412
  const options = {
@@ -12411,7 +12448,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12411
12448
  return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
12412
12449
  };
12413
12450
  const emitted = {};
12414
- const resolvedOutDir = resolve22(outDir);
12451
+ const resolvedOutDir = resolve23(outDir);
12415
12452
  host.writeFile = (fileName, text) => {
12416
12453
  const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
12417
12454
  emitted[relativePath] = text;
@@ -12433,12 +12470,12 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12433
12470
  if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
12434
12471
  return source;
12435
12472
  }
12436
- const resolvedPath = resolve22(fileName);
12473
+ const resolvedPath = resolve23(fileName);
12437
12474
  return transformedSources.get(resolvedPath) ?? source;
12438
12475
  };
12439
12476
  const originalGetSourceFileForCompile = host.getSourceFile;
12440
12477
  host.getSourceFile = (fileName, languageVersion, onError) => {
12441
- const source = transformedSources.get(resolve22(fileName));
12478
+ const source = transformedSources.get(resolve23(fileName));
12442
12479
  if (source) {
12443
12480
  return ts2.createSourceFile(fileName, source, languageVersion, true);
12444
12481
  }
@@ -12462,7 +12499,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12462
12499
  content,
12463
12500
  target: join19(outDir, fileName)
12464
12501
  }));
12465
- const outputFiles = new Set(rawEntries.map(({ target }) => resolve22(target)));
12502
+ const outputFiles = new Set(rawEntries.map(({ target }) => resolve23(target)));
12466
12503
  return rawEntries.map(({ content, target }) => {
12467
12504
  let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
12468
12505
  const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
@@ -12477,7 +12514,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12477
12514
  return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
12478
12515
  });
12479
12516
  processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
12480
- processedContent += islandMetadataByOutputPath.get(resolve22(target)) ?? "";
12517
+ processedContent += islandMetadataByOutputPath.get(resolve23(target)) ?? "";
12481
12518
  return { content: processedContent, target };
12482
12519
  });
12483
12520
  });
@@ -12486,7 +12523,9 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12486
12523
  await fs.writeFile(target, content, "utf-8");
12487
12524
  })), { outputs: entries.length });
12488
12525
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
12489
- }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
12526
+ }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
12527
+ jitContentCache.delete(resolve23(filePath));
12528
+ }, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
12490
12529
  const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
12491
12530
  let match;
12492
12531
  while ((match = re2.exec(source)) !== null) {
@@ -12498,7 +12537,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
12498
12537
  }
12499
12538
  return null;
12500
12539
  }, resolveAngularDeferImportSpecifier = () => {
12501
- const sourceEntry = resolve22(import.meta.dir, "../angular/components/index.ts");
12540
+ const sourceEntry = resolve23(import.meta.dir, "../angular/components/index.ts");
12502
12541
  if (existsSync17(sourceEntry)) {
12503
12542
  return sourceEntry.replace(/\\/g, "/");
12504
12543
  }
@@ -12728,10 +12767,10 @@ ${fields}
12728
12767
  source: result
12729
12768
  };
12730
12769
  }, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
12731
- const entryPath = resolve22(inputPath);
12770
+ const entryPath = resolve23(inputPath);
12732
12771
  const allOutputs = [];
12733
12772
  const visited = new Set;
12734
- const baseDir = resolve22(rootDir ?? process.cwd());
12773
+ const baseDir = resolve23(rootDir ?? process.cwd());
12735
12774
  let usesLegacyAnimations = false;
12736
12775
  const angularTranspiler = new Bun.Transpiler({
12737
12776
  loader: "ts",
@@ -12759,7 +12798,7 @@ ${fields}
12759
12798
  };
12760
12799
  const resolveLocalImport = (specifier, fromDir) => {
12761
12800
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
12762
- return resolveSourceFile2(resolve22(fromDir, specifier));
12801
+ return resolveSourceFile2(resolve23(fromDir, specifier));
12763
12802
  }
12764
12803
  const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
12765
12804
  if (aliased)
@@ -12768,7 +12807,7 @@ ${fields}
12768
12807
  const resolved = Bun.resolveSync(specifier, fromDir);
12769
12808
  if (resolved.includes("/node_modules/"))
12770
12809
  return;
12771
- const absolute = resolve22(resolved);
12810
+ const absolute = resolve23(resolved);
12772
12811
  if (!absolute.startsWith(baseDir))
12773
12812
  return;
12774
12813
  return resolveSourceFile2(absolute);
@@ -12817,13 +12856,13 @@ ${fields}
12817
12856
  return `${prefix}${dots}`;
12818
12857
  return `${prefix}../${dots}`;
12819
12858
  });
12820
- if (resolve22(actualPath) === entryPath) {
12859
+ if (resolve23(actualPath) === entryPath) {
12821
12860
  processedContent += buildIslandMetadataExports(sourceCode);
12822
12861
  }
12823
12862
  return processedContent;
12824
12863
  };
12825
12864
  const transpileFile = async (filePath) => {
12826
- const resolved = resolve22(filePath);
12865
+ const resolved = resolve23(filePath);
12827
12866
  if (visited.has(resolved))
12828
12867
  return;
12829
12868
  visited.add(resolved);
@@ -12875,7 +12914,7 @@ ${fields}
12875
12914
  importRewrites.set(specifier, relativeRewrite);
12876
12915
  return resolved2;
12877
12916
  }).filter((path) => Boolean(path));
12878
- const isEntry = resolve22(actualPath) === resolve22(entryPath);
12917
+ const isEntry = resolve23(actualPath) === resolve23(entryPath);
12879
12918
  const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
12880
12919
  const cacheKey2 = actualPath;
12881
12920
  const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync17(targetPath);
@@ -12911,10 +12950,29 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12911
12950
  const compiledRoot = compiledParent;
12912
12951
  const indexesDir = join19(compiledParent, "indexes");
12913
12952
  await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
12914
- const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve22(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
12953
+ const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve23(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
12954
+ if (!hmr) {
12955
+ await traceAngularPhase("aot/copy-json-resources", async () => {
12956
+ const cwd = process.cwd();
12957
+ const angularSrcDir = resolve23(outRoot);
12958
+ if (!existsSync17(angularSrcDir))
12959
+ return;
12960
+ const jsonGlob = new Glob6("**/*.json");
12961
+ for (const rel of jsonGlob.scanSync({
12962
+ absolute: false,
12963
+ cwd: angularSrcDir
12964
+ })) {
12965
+ const sourcePath = join19(angularSrcDir, rel);
12966
+ const cwdRel = relative11(cwd, sourcePath);
12967
+ const targetPath = join19(compiledRoot, cwdRel);
12968
+ await fs.mkdir(dirname14(targetPath), { recursive: true });
12969
+ await fs.copyFile(sourcePath, targetPath);
12970
+ }
12971
+ });
12972
+ }
12915
12973
  const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
12916
12974
  const compileTasks = entryPoints.map(async (entry) => {
12917
- const resolvedEntry = resolve22(entry);
12975
+ const resolvedEntry = resolve23(entry);
12918
12976
  const relativeEntry = relative11(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
12919
12977
  const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
12920
12978
  let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
@@ -12926,10 +12984,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12926
12984
  join19(compiledRoot, relativeEntry),
12927
12985
  join19(compiledRoot, "pages", jsName),
12928
12986
  join19(compiledRoot, jsName)
12929
- ].map((file4) => resolve22(file4));
12987
+ ].map((file4) => resolve23(file4));
12930
12988
  const resolveRawServerFile = (candidatePaths) => {
12931
12989
  const normalizedCandidates = [
12932
- ...candidatePaths.map((file4) => resolve22(file4)),
12990
+ ...candidatePaths.map((file4) => resolve23(file4)),
12933
12991
  ...compiledFallbackPaths
12934
12992
  ];
12935
12993
  let candidate = normalizedCandidates.find((file4) => existsSync17(file4) && file4.endsWith(`${sep3}pages${sep3}${jsName}`));
@@ -12985,7 +13043,6 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
12985
13043
  rewritten = `import '@angular/compiler';
12986
13044
  ${rewritten}`;
12987
13045
  }
12988
- rewritten = rewritten.replace(new RegExp(`templateUrl:\\s*['"]\\.\\/${fileBase}\\.html['"]`), `templateUrl: '../../pages/${fileBase}.html'`);
12989
13046
  if (detectedClassName && !rewritten.includes("export default")) {
12990
13047
  rewritten += `
12991
13048
  export default ${componentClassName};
@@ -13911,7 +13968,7 @@ __export(exports_fastHmrCompiler, {
13911
13968
  invalidateFingerprintCache: () => invalidateFingerprintCache
13912
13969
  });
13913
13970
  import { existsSync as existsSync18, readFileSync as readFileSync14, statSync } from "fs";
13914
- import { dirname as dirname15, extname as extname6, relative as relative12, resolve as resolve23 } from "path";
13971
+ import { dirname as dirname15, extname as extname6, relative as relative12, resolve as resolve24 } from "path";
13915
13972
  import ts6 from "typescript";
13916
13973
  var fail = (reason, detail, location) => ({
13917
13974
  ok: false,
@@ -14215,7 +14272,7 @@ var fail = (reason, detail, location) => ({
14215
14272
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
14216
14273
  return true;
14217
14274
  }
14218
- const base = resolve23(componentDir, spec);
14275
+ const base = resolve24(componentDir, spec);
14219
14276
  const candidates = [
14220
14277
  `${base}.ts`,
14221
14278
  `${base}.tsx`,
@@ -15017,7 +15074,7 @@ var fail = (reason, detail, location) => ({
15017
15074
  return null;
15018
15075
  }, resolveDtsFromSpec = (spec, fromDir) => {
15019
15076
  const stripped = spec.replace(/\.[mc]?js$/, "");
15020
- const base = resolve23(fromDir, stripped);
15077
+ const base = resolve24(fromDir, stripped);
15021
15078
  const candidates = [
15022
15079
  `${base}.d.ts`,
15023
15080
  `${base}.d.mts`,
@@ -15041,7 +15098,7 @@ var fail = (reason, detail, location) => ({
15041
15098
  return null;
15042
15099
  }, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
15043
15100
  if (spec.startsWith(".") || spec.startsWith("/")) {
15044
- const base = resolve23(componentDir, spec);
15101
+ const base = resolve24(componentDir, spec);
15045
15102
  const candidates = [
15046
15103
  `${base}.ts`,
15047
15104
  `${base}.tsx`,
@@ -15258,13 +15315,13 @@ var fail = (reason, detail, location) => ({
15258
15315
  }
15259
15316
  if (!matches)
15260
15317
  continue;
15261
- const resolved = resolve23(componentDir, spec);
15318
+ const resolved = resolve24(componentDir, spec);
15262
15319
  for (const ext of TS_EXTENSIONS) {
15263
15320
  const candidate = resolved + ext;
15264
15321
  if (existsSync18(candidate))
15265
15322
  return candidate;
15266
15323
  }
15267
- const indexCandidate = resolve23(resolved, "index.ts");
15324
+ const indexCandidate = resolve24(resolved, "index.ts");
15268
15325
  if (existsSync18(indexCandidate))
15269
15326
  return indexCandidate;
15270
15327
  }
@@ -15497,7 +15554,7 @@ ${transpiled}
15497
15554
  }
15498
15555
  }${staticPatch}`;
15499
15556
  }, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
15500
- const abs = resolve23(componentDir, url);
15557
+ const abs = resolve24(componentDir, url);
15501
15558
  if (!existsSync18(abs))
15502
15559
  return null;
15503
15560
  const ext = extname6(abs).toLowerCase();
@@ -15537,7 +15594,7 @@ ${block}
15537
15594
  const cached = projectOptionsCache.get(projectRoot);
15538
15595
  if (cached !== undefined)
15539
15596
  return cached;
15540
- const tsconfigPath = resolve23(projectRoot, "tsconfig.json");
15597
+ const tsconfigPath = resolve24(projectRoot, "tsconfig.json");
15541
15598
  const opts = {};
15542
15599
  if (existsSync18(tsconfigPath)) {
15543
15600
  try {
@@ -15621,7 +15678,7 @@ ${block}
15621
15678
  templateText = decoratorMeta.template;
15622
15679
  templatePath = componentFilePath;
15623
15680
  } else if (decoratorMeta.templateUrl) {
15624
- const tplAbs = resolve23(componentDir, decoratorMeta.templateUrl);
15681
+ const tplAbs = resolve24(componentDir, decoratorMeta.templateUrl);
15625
15682
  if (!existsSync18(tplAbs)) {
15626
15683
  return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
15627
15684
  }
@@ -16384,7 +16441,7 @@ __export(exports_compileEmber, {
16384
16441
  });
16385
16442
  import { existsSync as existsSync19 } from "fs";
16386
16443
  import { mkdir as mkdir6, rm as rm4 } from "fs/promises";
16387
- import { basename as basename8, dirname as dirname16, extname as extname7, join as join20, resolve as resolve24 } from "path";
16444
+ import { basename as basename8, dirname as dirname16, extname as extname7, join as join20, resolve as resolve25 } from "path";
16388
16445
  var {build: bunBuild2, Transpiler: Transpiler4, write: write3, file: file4 } = globalThis.Bun;
16389
16446
  var cachedPreprocessor = null, getPreprocessor = async () => {
16390
16447
  if (cachedPreprocessor)
@@ -16480,7 +16537,7 @@ export const importSync = (specifier) => {
16480
16537
  const originalImporter = stagedSourceMap.get(args.importer);
16481
16538
  if (!originalImporter)
16482
16539
  return;
16483
- const candidateBase = resolve24(dirname16(originalImporter), args.path);
16540
+ const candidateBase = resolve25(dirname16(originalImporter), args.path);
16484
16541
  const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
16485
16542
  for (const ext of extensionsToTry) {
16486
16543
  const candidate = candidateBase + ext;
@@ -16539,7 +16596,7 @@ export const renderToHTML = (props = {}) => {
16539
16596
  export { PageComponent };
16540
16597
  export default PageComponent;
16541
16598
  `, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
16542
- const resolvedEntry = resolve24(entry);
16599
+ const resolvedEntry = resolve25(entry);
16543
16600
  const source = await file4(resolvedEntry).text();
16544
16601
  let preprocessed = source;
16545
16602
  if (isTemplateTagFile(resolvedEntry)) {
@@ -16559,8 +16616,8 @@ export default PageComponent;
16559
16616
  mkdir6(serverDir, { recursive: true }),
16560
16617
  mkdir6(clientDir, { recursive: true })
16561
16618
  ]);
16562
- const tmpPagePath = resolve24(join20(tmpDir, `${baseName}.module.js`));
16563
- const tmpHarnessPath = resolve24(join20(tmpDir, `${baseName}.harness.js`));
16619
+ const tmpPagePath = resolve25(join20(tmpDir, `${baseName}.module.js`));
16620
+ const tmpHarnessPath = resolve25(join20(tmpDir, `${baseName}.harness.js`));
16564
16621
  await Promise.all([
16565
16622
  write3(tmpPagePath, transpiled),
16566
16623
  write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
@@ -16602,7 +16659,7 @@ export default PageComponent;
16602
16659
  serverPaths: outputs.map((o3) => o3.serverPath)
16603
16660
  };
16604
16661
  }, compileEmberFileSource = async (entry) => {
16605
- const resolvedEntry = resolve24(entry);
16662
+ const resolvedEntry = resolve25(entry);
16606
16663
  const source = await file4(resolvedEntry).text();
16607
16664
  let preprocessed = source;
16608
16665
  if (isTemplateTagFile(resolvedEntry)) {
@@ -16635,24 +16692,24 @@ __export(exports_buildReactVendor, {
16635
16692
  buildReactVendor: () => buildReactVendor
16636
16693
  });
16637
16694
  import { existsSync as existsSync20, mkdirSync as mkdirSync7 } from "fs";
16638
- import { join as join21, resolve as resolve25 } from "path";
16695
+ import { join as join21, resolve as resolve26 } from "path";
16639
16696
  import { rm as rm5 } from "fs/promises";
16640
16697
  var {build: bunBuild3 } = globalThis.Bun;
16641
16698
  var resolveJsxDevRuntimeCompatPath = () => {
16642
16699
  const candidates = [
16643
- resolve25(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
16644
- resolve25(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
16645
- resolve25(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
16646
- resolve25(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
16647
- resolve25(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
16648
- resolve25(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
16700
+ resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
16701
+ resolve26(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
16702
+ resolve26(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
16703
+ resolve26(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
16704
+ resolve26(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
16705
+ resolve26(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
16649
16706
  ];
16650
16707
  for (const candidate of candidates) {
16651
16708
  if (existsSync20(candidate)) {
16652
16709
  return candidate.replace(/\\/g, "/");
16653
16710
  }
16654
16711
  }
16655
- return (candidates[0] ?? resolve25(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
16712
+ return (candidates[0] ?? resolve26(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
16656
16713
  }, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
16657
16714
  try {
16658
16715
  Bun.resolveSync(specifier, process.cwd());
@@ -16763,7 +16820,7 @@ __export(exports_buildAngularVendor, {
16763
16820
  import { mkdirSync as mkdirSync8 } from "fs";
16764
16821
  import { join as join22 } from "path";
16765
16822
  import { rm as rm6 } from "fs/promises";
16766
- var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
16823
+ var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
16767
16824
  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) => {
16768
16825
  try {
16769
16826
  Bun.resolveSync(specifier, process.cwd());
@@ -16775,7 +16832,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
16775
16832
  const angular = new Set;
16776
16833
  const transitiveRoots = new Set;
16777
16834
  const transpiler6 = new Bun.Transpiler({ loader: "tsx" });
16778
- const glob = new Glob6("**/*.{ts,tsx,js,jsx}");
16835
+ const glob = new Glob7("**/*.{ts,tsx,js,jsx}");
16779
16836
  for (const dir of directories) {
16780
16837
  try {
16781
16838
  for await (const file5 of glob.scan({ absolute: true, cwd: dir })) {
@@ -17302,9 +17359,9 @@ import {
17302
17359
  statSync as statSync2,
17303
17360
  writeFileSync as writeFileSync8
17304
17361
  } from "fs";
17305
- import { basename as basename9, dirname as dirname17, extname as extname8, join as join26, relative as relative13, resolve as resolve26 } from "path";
17362
+ import { basename as basename9, dirname as dirname17, extname as extname8, join as join26, relative as relative13, resolve as resolve27 } from "path";
17306
17363
  import { cwd, env as env3, exit } from "process";
17307
- var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
17364
+ var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
17308
17365
  var isDev2, isBuildTraceEnabled = () => {
17309
17366
  const value = env3.ABSOLUTE_BUILD_TRACE?.toLowerCase();
17310
17367
  return value === "1" || value === "true" || value === "yes";
@@ -17378,7 +17435,7 @@ var isDev2, isBuildTraceEnabled = () => {
17378
17435
  exit(1);
17379
17436
  }, copyHtmxVendor = (htmxDir, htmxDestDir) => {
17380
17437
  mkdirSync11(htmxDestDir, { recursive: true });
17381
- const glob = new Glob7("htmx*.min.js");
17438
+ const glob = new Glob8("htmx*.min.js");
17382
17439
  for (const relPath of glob.scanSync({ cwd: htmxDir })) {
17383
17440
  const src = join26(htmxDir, relPath);
17384
17441
  const dest = join26(htmxDestDir, "htmx.min.js");
@@ -17393,8 +17450,8 @@ var isDev2, isBuildTraceEnabled = () => {
17393
17450
  }
17394
17451
  }, resolveAbsoluteVersion = async () => {
17395
17452
  const candidates = [
17396
- resolve26(import.meta.dir, "..", "..", "package.json"),
17397
- resolve26(import.meta.dir, "..", "package.json")
17453
+ resolve27(import.meta.dir, "..", "..", "package.json"),
17454
+ resolve27(import.meta.dir, "..", "package.json")
17398
17455
  ];
17399
17456
  const resolveCandidate = async (remaining) => {
17400
17457
  const [candidate, ...rest] = remaining;
@@ -17410,7 +17467,7 @@ var isDev2, isBuildTraceEnabled = () => {
17410
17467
  };
17411
17468
  await resolveCandidate(candidates);
17412
17469
  }, SKIP_DIRS, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
17413
- const absPath = resolve26(file5, "..", relPath);
17470
+ const absPath = resolve27(file5, "..", relPath);
17414
17471
  try {
17415
17472
  statSync2(absPath);
17416
17473
  workerPaths.add(absPath);
@@ -17430,7 +17487,7 @@ var isDev2, isBuildTraceEnabled = () => {
17430
17487
  collectWorkerPathsFromContent(content, pattern, file5, workerPaths);
17431
17488
  }
17432
17489
  }, scanWorkerReferencesInDir = async (dir, patterns, workerPaths) => {
17433
- const glob = new Glob7("**/*.{ts,tsx,js,jsx,svelte,vue}");
17490
+ const glob = new Glob8("**/*.{ts,tsx,js,jsx,svelte,vue}");
17434
17491
  for await (const file5 of glob.scan({ absolute: true, cwd: dir })) {
17435
17492
  const relToDir = file5.slice(dir.length + 1);
17436
17493
  const [firstSegment] = relToDir.split("/");
@@ -17472,7 +17529,7 @@ var isDev2, isBuildTraceEnabled = () => {
17472
17529
  return;
17473
17530
  }
17474
17531
  const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
17475
- const pagesRel = relative13(process.cwd(), resolve26(reactPagesPath)).replace(/\\/g, "/");
17532
+ const pagesRel = relative13(process.cwd(), resolve27(reactPagesPath)).replace(/\\/g, "/");
17476
17533
  for (const file5 of indexFiles) {
17477
17534
  let content = readFileSync15(join26(reactIndexesPath, file5), "utf-8");
17478
17535
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
@@ -17480,27 +17537,27 @@ var isDev2, isBuildTraceEnabled = () => {
17480
17537
  }
17481
17538
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
17482
17539
  const svelteIndexDir = join26(getFrameworkGeneratedDir("svelte"), "indexes");
17483
- const sveltePageEntries = svelteEntries.filter((file5) => resolve26(file5).startsWith(resolve26(sveltePagesPath)));
17540
+ const sveltePageEntries = svelteEntries.filter((file5) => resolve27(file5).startsWith(resolve27(sveltePagesPath)));
17484
17541
  for (const entry of sveltePageEntries) {
17485
17542
  const name = basename9(entry).replace(/\.svelte(\.(ts|js))?$/, "");
17486
17543
  const indexFile = join26(svelteIndexDir, "pages", `${name}.js`);
17487
17544
  if (!existsSync21(indexFile))
17488
17545
  continue;
17489
17546
  let content = readFileSync15(indexFile, "utf-8");
17490
- const srcRel = relative13(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
17547
+ const srcRel = relative13(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
17491
17548
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
17492
17549
  writeFileSync8(join26(devIndexDir, `${name}.svelte.js`), content);
17493
17550
  }
17494
17551
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
17495
17552
  const vueIndexDir = join26(getFrameworkGeneratedDir("vue"), "indexes");
17496
- const vuePageEntries = vueEntries.filter((file5) => resolve26(file5).startsWith(resolve26(vuePagesPath)));
17553
+ const vuePageEntries = vueEntries.filter((file5) => resolve27(file5).startsWith(resolve27(vuePagesPath)));
17497
17554
  for (const entry of vuePageEntries) {
17498
17555
  const name = basename9(entry, ".vue");
17499
17556
  const indexFile = join26(vueIndexDir, `${name}.js`);
17500
17557
  if (!existsSync21(indexFile))
17501
17558
  continue;
17502
17559
  let content = readFileSync15(indexFile, "utf-8");
17503
- const srcRel = relative13(process.cwd(), resolve26(entry)).replace(/\\/g, "/");
17560
+ const srcRel = relative13(process.cwd(), resolve27(entry)).replace(/\\/g, "/");
17504
17561
  content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
17505
17562
  writeFileSync8(join26(devIndexDir, `${name}.vue.js`), content);
17506
17563
  }
@@ -17513,7 +17570,7 @@ var isDev2, isBuildTraceEnabled = () => {
17513
17570
  const last = allComments[allComments.length - 1];
17514
17571
  if (!last?.[1])
17515
17572
  return JSON.stringify(outputPath);
17516
- const srcPath = resolve26(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
17573
+ const srcPath = resolve27(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
17517
17574
  return JSON.stringify(srcPath);
17518
17575
  }, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
17519
17576
  let depth = 0;
@@ -17838,13 +17895,13 @@ ${content.slice(firstUseIdx)}`;
17838
17895
  const filterToIncrementalEntries = (entryPoints, mapToSource) => {
17839
17896
  if (!isIncremental || !incrementalFiles)
17840
17897
  return entryPoints;
17841
- const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve26(f2)));
17898
+ const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve27(f2)));
17842
17899
  const matchingEntries = [];
17843
17900
  for (const entry of entryPoints) {
17844
17901
  const sourceFile = mapToSource(entry);
17845
17902
  if (!sourceFile)
17846
17903
  continue;
17847
- if (!normalizedIncremental.has(resolve26(sourceFile)))
17904
+ if (!normalizedIncremental.has(resolve27(sourceFile)))
17848
17905
  continue;
17849
17906
  matchingEntries.push(entry);
17850
17907
  }
@@ -17859,7 +17916,15 @@ ${content.slice(firstUseIdx)}`;
17859
17916
  recursive: true
17860
17917
  }));
17861
17918
  }
17862
- const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isTailwindCandidate)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig)) : undefined;
17919
+ const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isTailwindCandidate)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig, computeFrameworkTailwindSources({
17920
+ angularDirectory,
17921
+ emberDirectory,
17922
+ htmlDirectory,
17923
+ htmxDirectory,
17924
+ reactDirectory,
17925
+ svelteDirectory,
17926
+ vueDirectory
17927
+ }), normalizedIncrementalFiles ?? [])) : undefined;
17863
17928
  const emptyConventionResult = {
17864
17929
  conventions: undefined,
17865
17930
  pageFiles: []
@@ -17891,7 +17956,7 @@ ${content.slice(firstUseIdx)}`;
17891
17956
  reactPagesPath ? tracePhase("scan/react-conventions", () => scanConventions(reactPagesPath, "*.tsx")) : emptyConventionResult,
17892
17957
  sveltePagesPath ? tracePhase("scan/svelte-conventions", () => scanConventions(sveltePagesPath, "*.svelte")) : emptyConventionResult,
17893
17958
  vuePagesPath ? tracePhase("scan/vue-conventions", () => scanConventions(vuePagesPath, "*.vue")) : emptyConventionResult,
17894
- angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "*.ts")) : emptyConventionResult,
17959
+ angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "**/*.ts")) : emptyConventionResult,
17895
17960
  emberPagesPath ? tracePhase("scan/ember-conventions", () => scanConventions(emberPagesPath, "*.{gjs,gts,ts}")) : emptyConventionResult,
17896
17961
  tracePhase("scan/html-conventions", async () => Promise.all(htmlConventionDirs.map((dir) => scanConventions(dir, "*.html")))),
17897
17962
  stylesDir ? tracePhase("scan/css", () => scanCssEntryPoints(stylesDir, stylesIgnore)) : []
@@ -18001,7 +18066,7 @@ ${content.slice(firstUseIdx)}`;
18001
18066
  }
18002
18067
  const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
18003
18068
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
18004
- if (entry.startsWith(resolve26(reactIndexesPath))) {
18069
+ if (entry.startsWith(resolve27(reactIndexesPath))) {
18005
18070
  const pageName = basename9(entry, ".tsx");
18006
18071
  return join26(reactPagesPath, `${pageName}.tsx`);
18007
18072
  }
@@ -18108,7 +18173,7 @@ ${content.slice(firstUseIdx)}`;
18108
18173
  const clientPath = islandSvelteClientPaths[idx];
18109
18174
  if (!sourcePath || !clientPath)
18110
18175
  continue;
18111
- islandSvelteClientPathMap.set(resolve26(sourcePath), clientPath);
18176
+ islandSvelteClientPathMap.set(resolve27(sourcePath), clientPath);
18112
18177
  }
18113
18178
  const islandVueClientPathMap = new Map;
18114
18179
  for (let idx = 0;idx < islandVueSources.length; idx++) {
@@ -18116,7 +18181,7 @@ ${content.slice(firstUseIdx)}`;
18116
18181
  const clientPath = islandVueClientPaths[idx];
18117
18182
  if (!sourcePath || !clientPath)
18118
18183
  continue;
18119
- islandVueClientPathMap.set(resolve26(sourcePath), clientPath);
18184
+ islandVueClientPathMap.set(resolve27(sourcePath), clientPath);
18120
18185
  }
18121
18186
  const islandAngularClientPathMap = new Map;
18122
18187
  for (let idx = 0;idx < islandAngularSources.length; idx++) {
@@ -18124,7 +18189,7 @@ ${content.slice(firstUseIdx)}`;
18124
18189
  const clientPath = islandAngularClientPaths[idx];
18125
18190
  if (!sourcePath || !clientPath)
18126
18191
  continue;
18127
- islandAngularClientPathMap.set(resolve26(sourcePath), clientPath);
18192
+ islandAngularClientPathMap.set(resolve27(sourcePath), clientPath);
18128
18193
  }
18129
18194
  const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
18130
18195
  const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
@@ -19005,8 +19070,8 @@ __export(exports_dependencyGraph, {
19005
19070
  addFileToGraph: () => addFileToGraph
19006
19071
  });
19007
19072
  import { existsSync as existsSync23, readFileSync as readFileSync16 } from "fs";
19008
- var {Glob: Glob8 } = globalThis.Bun;
19009
- import { resolve as resolve27 } from "path";
19073
+ var {Glob: Glob9 } = globalThis.Bun;
19074
+ import { resolve as resolve28 } from "path";
19010
19075
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
19011
19076
  const lower = filePath.toLowerCase();
19012
19077
  if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
@@ -19020,8 +19085,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
19020
19085
  if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
19021
19086
  return null;
19022
19087
  }
19023
- const fromDir = resolve27(fromFile, "..");
19024
- const normalized = resolve27(fromDir, importPath);
19088
+ const fromDir = resolve28(fromFile, "..");
19089
+ const normalized = resolve28(fromDir, importPath);
19025
19090
  const extensions = [
19026
19091
  ".ts",
19027
19092
  ".tsx",
@@ -19051,7 +19116,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
19051
19116
  dependents.delete(normalizedPath);
19052
19117
  }
19053
19118
  }, addFileToGraph = (graph, filePath) => {
19054
- const normalizedPath = resolve27(filePath);
19119
+ const normalizedPath = resolve28(filePath);
19055
19120
  if (!existsSync23(normalizedPath))
19056
19121
  return;
19057
19122
  const dependencies = extractDependencies(normalizedPath);
@@ -19065,13 +19130,23 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
19065
19130
  graph.dependents.get(dep)?.add(normalizedPath);
19066
19131
  };
19067
19132
  dependencies.forEach(addDependent);
19133
+ for (const [otherFile, otherDeps] of graph.dependencies) {
19134
+ if (otherFile === normalizedPath)
19135
+ continue;
19136
+ if (otherDeps.has(normalizedPath)) {
19137
+ if (!graph.dependents.has(normalizedPath)) {
19138
+ graph.dependents.set(normalizedPath, new Set);
19139
+ }
19140
+ graph.dependents.get(normalizedPath)?.add(otherFile);
19141
+ }
19142
+ }
19068
19143
  }, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
19069
19144
  const processedFiles = new Set;
19070
- const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
19071
- const resolvedDirs = directories.map((dir) => resolve27(dir)).filter((dir) => existsSync23(dir));
19145
+ const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
19146
+ const resolvedDirs = directories.map((dir) => resolve28(dir)).filter((dir) => existsSync23(dir));
19072
19147
  const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
19073
19148
  for (const file5 of allFiles) {
19074
- const fullPath = resolve27(file5);
19149
+ const fullPath = resolve28(file5);
19075
19150
  if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
19076
19151
  continue;
19077
19152
  if (processedFiles.has(fullPath))
@@ -19184,7 +19259,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
19184
19259
  return [];
19185
19260
  }
19186
19261
  }, getAffectedFiles = (graph, changedFile) => {
19187
- const normalizedPath = resolve27(changedFile);
19262
+ const normalizedPath = resolve28(changedFile);
19188
19263
  const affected = new Set;
19189
19264
  const toProcess = [normalizedPath];
19190
19265
  const processNode = (current) => {
@@ -19213,18 +19288,9 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
19213
19288
  }
19214
19289
  graph.dependencies.delete(normalizedPath);
19215
19290
  }, removeDependentsForFile = (graph, normalizedPath) => {
19216
- const dependents = graph.dependents.get(normalizedPath);
19217
- if (!dependents)
19218
- return;
19219
- for (const dependent of dependents) {
19220
- const depList = graph.dependencies.get(dependent);
19221
- if (!depList)
19222
- continue;
19223
- depList.delete(normalizedPath);
19224
- }
19225
19291
  graph.dependents.delete(normalizedPath);
19226
19292
  }, removeFileFromGraph = (graph, filePath) => {
19227
- const normalizedPath = resolve27(filePath);
19293
+ const normalizedPath = resolve28(filePath);
19228
19294
  removeDepsForFile(graph, normalizedPath);
19229
19295
  removeDependentsForFile(graph, normalizedPath);
19230
19296
  };
@@ -19267,12 +19333,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
19267
19333
  };
19268
19334
 
19269
19335
  // src/dev/configResolver.ts
19270
- import { resolve as resolve28 } from "path";
19336
+ import { resolve as resolve29 } from "path";
19271
19337
  var resolveBuildPaths = (config) => {
19272
19338
  const cwd2 = process.cwd();
19273
19339
  const normalize = (path) => path.replace(/\\/g, "/");
19274
- const withDefault = (value, fallback) => normalize(resolve28(cwd2, value ?? fallback));
19275
- const optional = (value) => value ? normalize(resolve28(cwd2, value)) : undefined;
19340
+ const withDefault = (value, fallback) => normalize(resolve29(cwd2, value ?? fallback));
19341
+ const optional = (value) => value ? normalize(resolve29(cwd2, value)) : undefined;
19276
19342
  return {
19277
19343
  angularDir: optional(config.angularDirectory),
19278
19344
  assetsDir: optional(config.assetsDirectory),
@@ -19326,7 +19392,7 @@ var init_clientManager = __esm(() => {
19326
19392
 
19327
19393
  // src/dev/pathUtils.ts
19328
19394
  import { existsSync as existsSync24, readdirSync, readFileSync as readFileSync17 } from "fs";
19329
- import { dirname as dirname18, resolve as resolve29 } from "path";
19395
+ import { dirname as dirname18, resolve as resolve30 } from "path";
19330
19396
  var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19331
19397
  if (shouldIgnorePath(filePath, resolved)) {
19332
19398
  return "ignored";
@@ -19402,7 +19468,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19402
19468
  return "unknown";
19403
19469
  }, collectAngularResourceDirs = (angularDir) => {
19404
19470
  const out = new Set;
19405
- const angularRoot = resolve29(angularDir);
19471
+ const angularRoot = resolve30(angularDir);
19406
19472
  const angularRootNormalized = normalizePath(angularRoot);
19407
19473
  const walk = (dir) => {
19408
19474
  let entries;
@@ -19415,7 +19481,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19415
19481
  if (entry.name.startsWith(".") || entry.name === "node_modules") {
19416
19482
  continue;
19417
19483
  }
19418
- const full = resolve29(dir, entry.name);
19484
+ const full = resolve30(dir, entry.name);
19419
19485
  if (entry.isDirectory()) {
19420
19486
  walk(full);
19421
19487
  continue;
@@ -19456,7 +19522,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19456
19522
  }
19457
19523
  const componentDir = dirname18(full);
19458
19524
  for (const ref of refs) {
19459
- const refAbs = normalizePath(resolve29(componentDir, ref));
19525
+ const refAbs = normalizePath(resolve30(componentDir, ref));
19460
19526
  const refDir = normalizePath(dirname18(refAbs));
19461
19527
  if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
19462
19528
  continue;
@@ -19473,7 +19539,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19473
19539
  const push = (path) => {
19474
19540
  if (!path)
19475
19541
  return;
19476
- const abs = normalizePath(resolve29(cwd2, path));
19542
+ const abs = normalizePath(resolve30(cwd2, path));
19477
19543
  if (!roots.includes(abs))
19478
19544
  roots.push(abs);
19479
19545
  };
@@ -19498,7 +19564,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19498
19564
  push(cfg.assetsDir);
19499
19565
  push(cfg.stylesDir);
19500
19566
  for (const candidate of ["src", "db", "assets", "styles"]) {
19501
- const abs = normalizePath(resolve29(cwd2, candidate));
19567
+ const abs = normalizePath(resolve30(cwd2, candidate));
19502
19568
  if (existsSync24(abs) && !roots.includes(abs))
19503
19569
  roots.push(abs);
19504
19570
  }
@@ -19510,7 +19576,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
19510
19576
  continue;
19511
19577
  if (entry.name.startsWith("."))
19512
19578
  continue;
19513
- const abs = normalizePath(resolve29(cwd2, entry.name));
19579
+ const abs = normalizePath(resolve30(cwd2, entry.name));
19514
19580
  if (roots.includes(abs))
19515
19581
  continue;
19516
19582
  if (shouldIgnorePath(abs, resolved))
@@ -19584,8 +19650,8 @@ var init_pathUtils = __esm(() => {
19584
19650
 
19585
19651
  // src/dev/fileWatcher.ts
19586
19652
  import { watch } from "fs";
19587
- import { existsSync as existsSync25 } from "fs";
19588
- import { join as join28, resolve as resolve30 } from "path";
19653
+ import { existsSync as existsSync25, readdirSync as readdirSync2, statSync as statSync3 } from "fs";
19654
+ import { dirname as dirname19, join as join28, resolve as resolve31 } from "path";
19589
19655
  var safeRemoveFromGraph = (graph, fullPath) => {
19590
19656
  try {
19591
19657
  removeFileFromGraph(graph, fullPath);
@@ -19604,12 +19670,48 @@ var safeRemoveFromGraph = (graph, fullPath) => {
19604
19670
  operation: "add"
19605
19671
  });
19606
19672
  }
19607
- }, 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) => {
19608
- const watcher = watch(absolutePath, { recursive: true }, (event, filename) => {
19609
- if (!filename) {
19673
+ }, 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) => {
19674
+ const ATOMIC_RECOVERY_WINDOW_MS = 1000;
19675
+ const recentlySynthesized = new Map;
19676
+ const atomicRecoveryScan = (eventDir) => {
19677
+ let entries;
19678
+ try {
19679
+ entries = readdirSync2(eventDir);
19680
+ } catch {
19610
19681
  return;
19611
19682
  }
19683
+ const now = Date.now();
19684
+ for (const name of entries) {
19685
+ if (shouldSkipFilename(name, isStylesDir))
19686
+ continue;
19687
+ const child = join28(eventDir, name).replace(/\\/g, "/");
19688
+ let st2;
19689
+ try {
19690
+ st2 = statSync3(child);
19691
+ } catch {
19692
+ continue;
19693
+ }
19694
+ if (!st2.isFile())
19695
+ continue;
19696
+ const age = now - st2.ctimeMs;
19697
+ if (age < 0 || age > ATOMIC_RECOVERY_WINDOW_MS)
19698
+ continue;
19699
+ const last = recentlySynthesized.get(child) ?? 0;
19700
+ if (now - last < 100)
19701
+ continue;
19702
+ recentlySynthesized.set(child, now);
19703
+ onFileChange(child);
19704
+ safeAddToGraph(state.dependencyGraph, child);
19705
+ }
19706
+ };
19707
+ const watcher = watch(absolutePath, { recursive: true }, (event, filename) => {
19708
+ if (!filename)
19709
+ return;
19612
19710
  if (shouldSkipFilename(filename, isStylesDir)) {
19711
+ if (event === "rename") {
19712
+ const eventDir = dirname19(join28(absolutePath, filename)).replace(/\\/g, "/");
19713
+ atomicRecoveryScan(eventDir);
19714
+ }
19613
19715
  return;
19614
19716
  }
19615
19717
  const fullPath = join28(absolutePath, filename).replace(/\\/g, "/");
@@ -19630,7 +19732,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
19630
19732
  }, addFileWatchers = (state, paths, onFileChange) => {
19631
19733
  const stylesDir = state.resolvedPaths?.stylesDir;
19632
19734
  paths.forEach((path) => {
19633
- const absolutePath = resolve30(path).replace(/\\/g, "/");
19735
+ const absolutePath = resolve31(path).replace(/\\/g, "/");
19634
19736
  if (!existsSync25(absolutePath)) {
19635
19737
  return;
19636
19738
  }
@@ -19641,7 +19743,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
19641
19743
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
19642
19744
  const stylesDir = state.resolvedPaths?.stylesDir;
19643
19745
  watchPaths.forEach((path) => {
19644
- const absolutePath = resolve30(path).replace(/\\/g, "/");
19746
+ const absolutePath = resolve31(path).replace(/\\/g, "/");
19645
19747
  if (!existsSync25(absolutePath)) {
19646
19748
  return;
19647
19749
  }
@@ -19653,16 +19755,21 @@ var init_fileWatcher = __esm(() => {
19653
19755
  init_telemetryEvent();
19654
19756
  init_dependencyGraph();
19655
19757
  init_pathUtils();
19758
+ ATOMIC_WRITE_TEMP_PATTERNS = [
19759
+ /(^|\/)sed[A-Za-z0-9]{6,}$/,
19760
+ /(^|\/)4913$/,
19761
+ /(^|\/)\.absolutejs-hmr-/
19762
+ ];
19656
19763
  });
19657
19764
 
19658
19765
  // src/dev/assetStore.ts
19659
- import { resolve as resolve31 } from "path";
19766
+ import { resolve as resolve32 } from "path";
19660
19767
  import { readdir as readdir4, unlink } from "fs/promises";
19661
19768
  var mimeTypes, getMimeType = (filePath) => {
19662
19769
  const ext = filePath.slice(filePath.lastIndexOf("."));
19663
19770
  return mimeTypes[ext] ?? "application/octet-stream";
19664
19771
  }, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
19665
- const fullPath = resolve31(dir, entry.name);
19772
+ const fullPath = resolve32(dir, entry.name);
19666
19773
  if (entry.isDirectory()) {
19667
19774
  return walkAndClean(fullPath);
19668
19775
  }
@@ -19678,10 +19785,10 @@ var mimeTypes, getMimeType = (filePath) => {
19678
19785
  }, cleanStaleAssets = async (store, manifest, buildDir) => {
19679
19786
  const liveByIdentity = new Map;
19680
19787
  for (const webPath of store.keys()) {
19681
- const diskPath = resolve31(buildDir, webPath.slice(1));
19788
+ const diskPath = resolve32(buildDir, webPath.slice(1));
19682
19789
  liveByIdentity.set(stripHash(diskPath), diskPath);
19683
19790
  }
19684
- const absBuildDir = resolve31(buildDir);
19791
+ const absBuildDir = resolve32(buildDir);
19685
19792
  Object.values(manifest).forEach((val) => {
19686
19793
  if (!HASHED_FILE_RE.test(val))
19687
19794
  return;
@@ -19699,7 +19806,7 @@ var mimeTypes, getMimeType = (filePath) => {
19699
19806
  } catch {}
19700
19807
  }, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
19701
19808
  if (entry.isDirectory()) {
19702
- return scanDir(resolve31(dir, entry.name), `${prefix}${entry.name}/`);
19809
+ return scanDir(resolve32(dir, entry.name), `${prefix}${entry.name}/`);
19703
19810
  }
19704
19811
  if (!entry.name.startsWith("chunk-")) {
19705
19812
  return null;
@@ -19708,7 +19815,7 @@ var mimeTypes, getMimeType = (filePath) => {
19708
19815
  if (store.has(webPath)) {
19709
19816
  return null;
19710
19817
  }
19711
- return Bun.file(resolve31(dir, entry.name)).bytes().then((bytes) => {
19818
+ return Bun.file(resolve32(dir, entry.name)).bytes().then((bytes) => {
19712
19819
  store.set(webPath, bytes);
19713
19820
  return;
19714
19821
  }).catch(() => {});
@@ -19730,7 +19837,7 @@ var mimeTypes, getMimeType = (filePath) => {
19730
19837
  for (const webPath of newIdentities.values()) {
19731
19838
  if (store.has(webPath))
19732
19839
  continue;
19733
- loadPromises.push(Bun.file(resolve31(buildDir, webPath.slice(1))).bytes().then((bytes) => {
19840
+ loadPromises.push(Bun.file(resolve32(buildDir, webPath.slice(1))).bytes().then((bytes) => {
19734
19841
  store.set(webPath, bytes);
19735
19842
  return;
19736
19843
  }).catch(() => {}));
@@ -19856,9 +19963,9 @@ var init_transformCache = __esm(() => {
19856
19963
  });
19857
19964
 
19858
19965
  // src/dev/reactComponentClassifier.ts
19859
- import { resolve as resolve32 } from "path";
19966
+ import { resolve as resolve33 } from "path";
19860
19967
  var classifyComponent = (filePath) => {
19861
- const normalizedPath = resolve32(filePath);
19968
+ const normalizedPath = resolve33(filePath);
19862
19969
  if (normalizedPath.includes("/react/pages/")) {
19863
19970
  return "server";
19864
19971
  }
@@ -19870,7 +19977,7 @@ var classifyComponent = (filePath) => {
19870
19977
  var init_reactComponentClassifier = () => {};
19871
19978
 
19872
19979
  // src/dev/moduleMapper.ts
19873
- import { basename as basename10, resolve as resolve33 } from "path";
19980
+ import { basename as basename10, resolve as resolve34 } from "path";
19874
19981
  var buildModulePaths = (moduleKeys, manifest) => {
19875
19982
  const modulePaths = {};
19876
19983
  moduleKeys.forEach((key) => {
@@ -19880,7 +19987,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
19880
19987
  });
19881
19988
  return modulePaths;
19882
19989
  }, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
19883
- const normalizedFile = resolve33(sourceFile);
19990
+ const normalizedFile = resolve34(sourceFile);
19884
19991
  const normalizedPath = normalizedFile.replace(/\\/g, "/");
19885
19992
  if (processedFiles.has(normalizedFile)) {
19886
19993
  return null;
@@ -19916,7 +20023,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
19916
20023
  });
19917
20024
  return grouped;
19918
20025
  }, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
19919
- const normalizedFile = resolve33(sourceFile);
20026
+ const normalizedFile = resolve34(sourceFile);
19920
20027
  const fileName = basename10(normalizedFile);
19921
20028
  const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
19922
20029
  const pascalName = toPascal(baseName);
@@ -19977,15 +20084,15 @@ __export(exports_resolveOwningComponents, {
19977
20084
  resolveDescendantsOfParent: () => resolveDescendantsOfParent,
19978
20085
  invalidateResourceIndex: () => invalidateResourceIndex
19979
20086
  });
19980
- import { readdirSync as readdirSync2, readFileSync as readFileSync19, statSync as statSync3 } from "fs";
19981
- import { dirname as dirname19, extname as extname9, join as join29, resolve as resolve34 } from "path";
20087
+ import { readdirSync as readdirSync3, readFileSync as readFileSync19, statSync as statSync4 } from "fs";
20088
+ import { dirname as dirname20, extname as extname9, join as join29, resolve as resolve35 } from "path";
19982
20089
  import ts7 from "typescript";
19983
20090
  var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
19984
20091
  const out = [];
19985
20092
  const visit = (dir) => {
19986
20093
  let entries;
19987
20094
  try {
19988
- entries = readdirSync2(dir, { withFileTypes: true });
20095
+ entries = readdirSync3(dir, { withFileTypes: true });
19989
20096
  } catch {
19990
20097
  return;
19991
20098
  }
@@ -20091,7 +20198,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
20091
20198
  };
20092
20199
  visit(sourceFile);
20093
20200
  return out;
20094
- }, safeNormalize = (path) => resolve34(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
20201
+ }, safeNormalize = (path) => resolve35(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
20095
20202
  const { changedFilePath, userAngularRoot } = params;
20096
20203
  const changedAbs = safeNormalize(changedFilePath);
20097
20204
  const out = [];
@@ -20112,7 +20219,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
20112
20219
  }
20113
20220
  let rootStat;
20114
20221
  try {
20115
- rootStat = statSync3(userAngularRoot);
20222
+ rootStat = statSync4(userAngularRoot);
20116
20223
  } catch {
20117
20224
  return out;
20118
20225
  }
@@ -20132,7 +20239,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
20132
20239
  return null;
20133
20240
  }
20134
20241
  const sf = ts7.createSourceFile(childFilePath, source, ts7.ScriptTarget.ES2022, true, ts7.ScriptKind.TS);
20135
- const childDir = dirname19(childFilePath);
20242
+ const childDir = dirname20(childFilePath);
20136
20243
  for (const stmt of sf.statements) {
20137
20244
  if (!ts7.isImportDeclaration(stmt))
20138
20245
  continue;
@@ -20160,7 +20267,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
20160
20267
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
20161
20268
  return null;
20162
20269
  }
20163
- const base = resolve34(childDir, spec);
20270
+ const base = resolve35(childDir, spec);
20164
20271
  const candidates = [
20165
20272
  `${base}.ts`,
20166
20273
  `${base}.tsx`,
@@ -20170,7 +20277,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
20170
20277
  const angularRootNorm = safeNormalize(angularRoot);
20171
20278
  for (const candidate of candidates) {
20172
20279
  try {
20173
- if (statSync3(candidate).isFile()) {
20280
+ if (statSync4(candidate).isFile()) {
20174
20281
  const norm = safeNormalize(candidate);
20175
20282
  if (!norm.startsWith(angularRootNorm))
20176
20283
  return null;
@@ -20189,7 +20296,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
20189
20296
  const parentFile = new Map;
20190
20297
  for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
20191
20298
  const classes = parseDecoratedClasses(tsPath);
20192
- const componentDir = dirname19(tsPath);
20299
+ const componentDir = dirname20(tsPath);
20193
20300
  for (const cls of classes) {
20194
20301
  const entity = {
20195
20302
  className: cls.className,
@@ -20198,7 +20305,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
20198
20305
  };
20199
20306
  if (cls.kind === "component") {
20200
20307
  for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
20201
- const abs = safeNormalize(resolve34(componentDir, url));
20308
+ const abs = safeNormalize(resolve35(componentDir, url));
20202
20309
  const existing = resource.get(abs);
20203
20310
  if (existing)
20204
20311
  existing.push(entity);
@@ -20225,7 +20332,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
20225
20332
  const norm = safeNormalize(params.changedFilePath);
20226
20333
  let rootStat;
20227
20334
  try {
20228
- rootStat = statSync3(params.userAngularRoot);
20335
+ rootStat = statSync4(params.userAngularRoot);
20229
20336
  } catch {
20230
20337
  return [];
20231
20338
  }
@@ -20247,6 +20354,13 @@ var init_resolveOwningComponents = __esm(() => {
20247
20354
  });
20248
20355
 
20249
20356
  // src/dev/webSocket.ts
20357
+ var exports_webSocket = {};
20358
+ __export(exports_webSocket, {
20359
+ handleHMRMessage: () => handleHMRMessage,
20360
+ handleClientDisconnect: () => handleClientDisconnect,
20361
+ handleClientConnect: () => handleClientConnect,
20362
+ broadcastToClients: () => broadcastToClients
20363
+ });
20250
20364
  var trySendMessage = (client2, messageStr) => {
20251
20365
  try {
20252
20366
  client2.send(messageStr);
@@ -20347,14 +20461,6 @@ var init_webSocket = __esm(() => {
20347
20461
  init_logger();
20348
20462
  });
20349
20463
 
20350
- // src/core/ssrCache.ts
20351
- var dirtyFrameworks, isSsrCacheDirty = (framework) => dirtyFrameworks.has(framework), markSsrCacheDirty = (framework) => {
20352
- dirtyFrameworks.add(framework);
20353
- };
20354
- var init_ssrCache = __esm(() => {
20355
- dirtyFrameworks = new Set;
20356
- });
20357
-
20358
20464
  // src/dev/moduleServer.ts
20359
20465
  var exports_moduleServer = {};
20360
20466
  __export(exports_moduleServer, {
@@ -20366,8 +20472,8 @@ __export(exports_moduleServer, {
20366
20472
  createModuleServer: () => createModuleServer,
20367
20473
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
20368
20474
  });
20369
- import { existsSync as existsSync26, readFileSync as readFileSync20, statSync as statSync4 } from "fs";
20370
- import { basename as basename11, dirname as dirname20, extname as extname10, join as join30, resolve as resolve35, relative as relative14 } from "path";
20475
+ import { existsSync as existsSync26, readFileSync as readFileSync20, statSync as statSync5 } from "fs";
20476
+ import { basename as basename11, dirname as dirname21, extname as extname10, join as join30, resolve as resolve36, relative as relative14 } from "path";
20371
20477
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
20372
20478
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
20373
20479
  const allExports = [];
@@ -20387,7 +20493,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
20387
20493
  ${stubs}
20388
20494
  `;
20389
20495
  }, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
20390
- const found = extensions.find((ext) => existsSync26(resolve35(projectRoot, srcPath + ext)));
20496
+ const found = extensions.find((ext) => existsSync26(resolve36(projectRoot, srcPath + ext)));
20391
20497
  return found ? srcPath + found : srcPath;
20392
20498
  }, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
20393
20499
  const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
@@ -20402,24 +20508,24 @@ ${stubs}
20402
20508
  return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
20403
20509
  }, srcUrl = (relPath, projectRoot) => {
20404
20510
  const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
20405
- const absPath = resolve35(projectRoot, relPath);
20511
+ const absPath = resolve36(projectRoot, relPath);
20406
20512
  const cached = mtimeCache.get(absPath);
20407
20513
  if (cached !== undefined)
20408
20514
  return `${base}?v=${buildVersion(cached, absPath)}`;
20409
20515
  try {
20410
- const mtime = Math.round(statSync4(absPath).mtimeMs);
20516
+ const mtime = Math.round(statSync5(absPath).mtimeMs);
20411
20517
  mtimeCache.set(absPath, mtime);
20412
20518
  return `${base}?v=${buildVersion(mtime, absPath)}`;
20413
20519
  } catch {
20414
20520
  return base;
20415
20521
  }
20416
20522
  }, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
20417
- const absPath = resolve35(fileDir, relPath);
20523
+ const absPath = resolve36(fileDir, relPath);
20418
20524
  const rel = relative14(projectRoot, absPath);
20419
20525
  const extension = extname10(rel);
20420
20526
  let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
20421
20527
  if (extname10(srcPath) === ".svelte") {
20422
- srcPath = relative14(projectRoot, resolveSvelteModulePath(resolve35(projectRoot, srcPath)));
20528
+ srcPath = relative14(projectRoot, resolveSvelteModulePath(resolve36(projectRoot, srcPath)));
20423
20529
  }
20424
20530
  return srcUrl(srcPath, projectRoot);
20425
20531
  }, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
@@ -20438,13 +20544,13 @@ ${stubs}
20438
20544
  const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
20439
20545
  const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
20440
20546
  if (!subpath) {
20441
- const pkgDir = resolve35(projectRoot, "node_modules", packageName ?? "");
20547
+ const pkgDir = resolve36(projectRoot, "node_modules", packageName ?? "");
20442
20548
  const pkgJsonPath = join30(pkgDir, "package.json");
20443
20549
  if (existsSync26(pkgJsonPath)) {
20444
20550
  const pkg = JSON.parse(readFileSync20(pkgJsonPath, "utf-8"));
20445
20551
  const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
20446
20552
  if (esmEntry) {
20447
- const resolved = resolve35(pkgDir, esmEntry);
20553
+ const resolved = resolve36(pkgDir, esmEntry);
20448
20554
  if (existsSync26(resolved))
20449
20555
  return relative14(projectRoot, resolved);
20450
20556
  }
@@ -20476,7 +20582,7 @@ ${stubs}
20476
20582
  };
20477
20583
  result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
20478
20584
  result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
20479
- const fileDir = dirname20(filePath);
20585
+ const fileDir = dirname21(filePath);
20480
20586
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
20481
20587
  result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
20482
20588
  result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
@@ -20491,12 +20597,12 @@ ${stubs}
20491
20597
  result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
20492
20598
  result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
20493
20599
  result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
20494
- const absPath = resolve35(fileDir, relPath);
20600
+ const absPath = resolve36(fileDir, relPath);
20495
20601
  const rel = relative14(projectRoot, absPath);
20496
20602
  return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
20497
20603
  });
20498
20604
  result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
20499
- const absPath = resolve35(fileDir, relPath);
20605
+ const absPath = resolve36(fileDir, relPath);
20500
20606
  const rel = relative14(projectRoot, absPath);
20501
20607
  return `'${srcUrl(rel, projectRoot)}'`;
20502
20608
  });
@@ -20809,7 +20915,7 @@ ${code}`;
20809
20915
  code = injectVueHmr(code, filePath, projectRoot, vueDir);
20810
20916
  return rewriteImports(code, filePath, projectRoot, rewriter);
20811
20917
  }, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
20812
- const hmrBase = vueDir ? resolve35(vueDir) : projectRoot;
20918
+ const hmrBase = vueDir ? resolve36(vueDir) : projectRoot;
20813
20919
  const hmrId = relative14(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
20814
20920
  let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
20815
20921
  result += [
@@ -20973,7 +21079,7 @@ export default {};
20973
21079
  const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
20974
21080
  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);`);
20975
21081
  }, resolveSourcePath = (relPath, projectRoot) => {
20976
- const filePath = resolve35(projectRoot, relPath);
21082
+ const filePath = resolve36(projectRoot, relPath);
20977
21083
  const ext = extname10(filePath);
20978
21084
  if (ext === ".svelte")
20979
21085
  return { ext, filePath: resolveSvelteModulePath(filePath) };
@@ -21010,14 +21116,14 @@ export default {};
21010
21116
  const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
21011
21117
  const candidates = [
21012
21118
  absoluteCandidate,
21013
- resolve35(projectRoot, tail)
21119
+ resolve36(projectRoot, tail)
21014
21120
  ];
21015
21121
  try {
21016
21122
  const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
21017
21123
  const cfg = await loadConfig2();
21018
- const angularDir = cfg.angularDirectory && resolve35(projectRoot, cfg.angularDirectory);
21124
+ const angularDir = cfg.angularDirectory && resolve36(projectRoot, cfg.angularDirectory);
21019
21125
  if (angularDir)
21020
- candidates.push(resolve35(angularDir, tail));
21126
+ candidates.push(resolve36(angularDir, tail));
21021
21127
  } catch {}
21022
21128
  for (const candidate of candidates) {
21023
21129
  if (await fileExists(candidate)) {
@@ -21047,8 +21153,8 @@ export default {};
21047
21153
  return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
21048
21154
  if (!TRANSPILABLE.has(ext))
21049
21155
  return;
21050
- const stat3 = statSync4(filePath);
21051
- const resolvedVueDir = vueDir ? resolve35(vueDir) : undefined;
21156
+ const stat3 = statSync5(filePath);
21157
+ const resolvedVueDir = vueDir ? resolve36(vueDir) : undefined;
21052
21158
  let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
21053
21159
  const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
21054
21160
  if (isAngularGeneratedJs) {
@@ -21075,12 +21181,12 @@ export default {};
21075
21181
  cachedAngularUserRoot = configuredAngularUserRoot ?? null;
21076
21182
  return cachedAngularUserRoot;
21077
21183
  }, configuredAngularUserRoot, transformAndCacheSvelte = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
21078
- const stat3 = statSync4(filePath);
21184
+ const stat3 = statSync5(filePath);
21079
21185
  const content = await transformSvelteFile(filePath, projectRoot, rewriter, stylePreprocessors);
21080
21186
  setTransformed(filePath, content, stat3.mtimeMs, extractImportedFiles(content, projectRoot));
21081
21187
  return jsResponse(content);
21082
21188
  }, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
21083
- const stat3 = statSync4(filePath);
21189
+ const stat3 = statSync5(filePath);
21084
21190
  const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
21085
21191
  setTransformed(filePath, content, stat3.mtimeMs, extractImportedFiles(content, projectRoot));
21086
21192
  return jsResponse(content);
@@ -21107,7 +21213,7 @@ export default {};
21107
21213
  const relPath = pathname.slice(SRC_PREFIX.length);
21108
21214
  if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
21109
21215
  return handleBunWrapRequest();
21110
- const virtualCssResponse = handleVirtualSvelteCss(resolve35(projectRoot, relPath));
21216
+ const virtualCssResponse = handleVirtualSvelteCss(resolve36(projectRoot, relPath));
21111
21217
  if (virtualCssResponse)
21112
21218
  return virtualCssResponse;
21113
21219
  const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
@@ -21123,11 +21229,11 @@ export default {};
21123
21229
  SRC_IMPORT_RE.lastIndex = 0;
21124
21230
  while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
21125
21231
  if (match[1])
21126
- files.push(resolve35(projectRoot, match[1]));
21232
+ files.push(resolve36(projectRoot, match[1]));
21127
21233
  }
21128
21234
  return files;
21129
21235
  }, invalidateModule = (filePath) => {
21130
- const resolved = resolve35(filePath);
21236
+ const resolved = resolve36(filePath);
21131
21237
  invalidate(filePath);
21132
21238
  if (resolved !== filePath)
21133
21239
  invalidate(resolved);
@@ -21272,7 +21378,7 @@ __export(exports_hmrCompiler, {
21272
21378
  getApplyMetadataModule: () => getApplyMetadataModule,
21273
21379
  encodeHmrComponentId: () => encodeHmrComponentId
21274
21380
  });
21275
- import { dirname as dirname21, relative as relative15, resolve as resolve36 } from "path";
21381
+ import { dirname as dirname22, relative as relative15, resolve as resolve37 } from "path";
21276
21382
  import { performance as performance2 } from "perf_hooks";
21277
21383
  var getApplyMetadataModule = async (encodedId) => {
21278
21384
  const decoded = decodeURIComponent(encodedId);
@@ -21281,7 +21387,7 @@ var getApplyMetadataModule = async (encodedId) => {
21281
21387
  return null;
21282
21388
  const filePathRel = decoded.slice(0, at2);
21283
21389
  const className = decoded.slice(at2 + 1);
21284
- const componentFilePath = resolve36(process.cwd(), filePathRel);
21390
+ const componentFilePath = resolve37(process.cwd(), filePathRel);
21285
21391
  const projectRelPath = relative15(process.cwd(), componentFilePath).replace(/\\/g, "/");
21286
21392
  const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
21287
21393
  const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
@@ -21292,7 +21398,7 @@ var getApplyMetadataModule = async (encodedId) => {
21292
21398
  const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
21293
21399
  const owners = resolveOwningComponents2({
21294
21400
  changedFilePath: componentFilePath,
21295
- userAngularRoot: dirname21(componentFilePath)
21401
+ userAngularRoot: dirname22(componentFilePath)
21296
21402
  });
21297
21403
  const owner = owners.find((o3) => o3.className === className);
21298
21404
  const kind = owner?.kind ?? "component";
@@ -21392,7 +21498,6 @@ var resolveRequestPathname = (request) => {
21392
21498
  moduleUrl.searchParams.set("t", String(emberCacheBuster));
21393
21499
  return moduleUrl.href;
21394
21500
  }, invalidateEmberSsrCache = () => {
21395
- markSsrCacheDirty("ember");
21396
21501
  emberCacheBuster = Date.now();
21397
21502
  }, buildHtmlShell = (headTag, bodyContent, indexPath, props) => {
21398
21503
  const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(props ?? {})};`;
@@ -21406,7 +21511,6 @@ var resolveRequestPathname = (request) => {
21406
21511
  const resolvedHeadTag = headTag ?? "<head></head>";
21407
21512
  try {
21408
21513
  installSimpleDomGlobals();
21409
- isSsrCacheDirty("ember");
21410
21514
  const bundle = await import(buildRuntimeModuleSpecifier(pagePath));
21411
21515
  if (typeof bundle.renderToHTML !== "function") {
21412
21516
  throw new Error(`Ember page bundle at ${pagePath} does not export renderToHTML(). Was it compiled by compileEmber()?`);
@@ -21424,9 +21528,7 @@ var resolveRequestPathname = (request) => {
21424
21528
  });
21425
21529
  }
21426
21530
  };
21427
- var init_pageHandler = __esm(() => {
21428
- init_ssrCache();
21429
- });
21531
+ var init_pageHandler = () => {};
21430
21532
 
21431
21533
  // src/ember/index.ts
21432
21534
  var exports_ember = {};
@@ -21443,11 +21545,11 @@ var exports_simpleHTMLHMR = {};
21443
21545
  __export(exports_simpleHTMLHMR, {
21444
21546
  handleHTMLUpdate: () => handleHTMLUpdate
21445
21547
  });
21446
- import { resolve as resolve37 } from "path";
21548
+ import { resolve as resolve38 } from "path";
21447
21549
  var handleHTMLUpdate = async (htmlFilePath) => {
21448
21550
  let htmlContent;
21449
21551
  try {
21450
- const resolvedPath = resolve37(htmlFilePath);
21552
+ const resolvedPath = resolve38(htmlFilePath);
21451
21553
  const file5 = Bun.file(resolvedPath);
21452
21554
  if (!await file5.exists()) {
21453
21555
  return null;
@@ -21473,11 +21575,11 @@ var exports_simpleHTMXHMR = {};
21473
21575
  __export(exports_simpleHTMXHMR, {
21474
21576
  handleHTMXUpdate: () => handleHTMXUpdate
21475
21577
  });
21476
- import { resolve as resolve38 } from "path";
21578
+ import { resolve as resolve39 } from "path";
21477
21579
  var handleHTMXUpdate = async (htmxFilePath) => {
21478
21580
  let htmlContent;
21479
21581
  try {
21480
- const resolvedPath = resolve38(htmxFilePath);
21582
+ const resolvedPath = resolve39(htmxFilePath);
21481
21583
  const file5 = Bun.file(resolvedPath);
21482
21584
  if (!await file5.exists()) {
21483
21585
  return null;
@@ -21499,19 +21601,20 @@ var handleHTMXUpdate = async (htmxFilePath) => {
21499
21601
  var init_simpleHTMXHMR = () => {};
21500
21602
 
21501
21603
  // src/dev/rebuildTrigger.ts
21502
- import { existsSync as existsSync27 } from "fs";
21503
- import { basename as basename12, dirname as dirname22, relative as relative16, resolve as resolve39, sep as sep4 } from "path";
21604
+ import { existsSync as existsSync27, rmSync as rmSync3 } from "fs";
21605
+ import { basename as basename12, dirname as dirname23, join as join31, relative as relative16, resolve as resolve40, sep as sep4 } from "path";
21504
21606
  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) => {
21505
21607
  if (!config.tailwind)
21506
21608
  return;
21507
21609
  if (!files.some(isTailwindCandidate))
21508
21610
  return;
21509
21611
  try {
21510
- const { cssChanged } = await incrementalTailwindBuild(config.tailwind, state.resolvedPaths.buildDir, files, getStyleTransformConfig(config));
21612
+ const { computeFrameworkTailwindSources: computeFrameworkTailwindSources2 } = await Promise.resolve().then(() => (init_compileTailwind(), exports_compileTailwind));
21613
+ const { cssChanged } = await incrementalTailwindBuild(config.tailwind, state.resolvedPaths.buildDir, files, getStyleTransformConfig(config), computeFrameworkTailwindSources2(config));
21511
21614
  if (!cssChanged)
21512
21615
  return;
21513
21616
  try {
21514
- const outputPath = resolve39(state.resolvedPaths.buildDir, config.tailwind.output);
21617
+ const outputPath = resolve40(state.resolvedPaths.buildDir, config.tailwind.output);
21515
21618
  const bytes = await Bun.file(outputPath).bytes();
21516
21619
  const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
21517
21620
  state.assetStore.set(webPath, bytes);
@@ -21594,11 +21697,39 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21594
21697
  detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
21595
21698
  }
21596
21699
  return { ...parsed, framework: detectedFw };
21597
- }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync27(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
21700
+ }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync27(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
21701
+ const config = state.config;
21702
+ const cwd2 = process.cwd();
21703
+ const absDeleted = resolve40(deletedFile).replace(/\\/g, "/");
21704
+ for (const { configKey, framework } of FRAMEWORK_DIR_KEYS_FOR_CLEANUP) {
21705
+ const dir = config[configKey];
21706
+ if (!dir)
21707
+ continue;
21708
+ const absDir = resolve40(cwd2, dir).replace(/\\/g, "/");
21709
+ if (!absDeleted.startsWith(`${absDir}/`))
21710
+ continue;
21711
+ const rel = absDeleted.slice(absDir.length + 1);
21712
+ const ext = rel.match(/\.(ts|tsx|jsx|svelte|vue|mjs|cjs)$/);
21713
+ if (!ext)
21714
+ return;
21715
+ const relJs = `${rel.slice(0, -ext[0].length)}.js`;
21716
+ const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
21717
+ for (const candidate of [
21718
+ join31(generatedDir, relJs),
21719
+ `${join31(generatedDir, relJs)}.map`
21720
+ ]) {
21721
+ try {
21722
+ rmSync3(candidate, { force: true });
21723
+ } catch {}
21724
+ }
21725
+ return;
21726
+ }
21727
+ }, collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
21598
21728
  state.fileHashes.delete(filePathInSet);
21729
+ removeStaleGenerated(state, filePathInSet);
21599
21730
  try {
21600
21731
  const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
21601
- const deletedPathResolved = resolve39(filePathInSet);
21732
+ const deletedPathResolved = resolve40(filePathInSet);
21602
21733
  affectedFiles.forEach((affectedFile) => {
21603
21734
  if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
21604
21735
  validFiles.push(affectedFile);
@@ -21642,7 +21773,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21642
21773
  if (storedHash !== undefined && storedHash === fileHash) {
21643
21774
  return;
21644
21775
  }
21645
- const normalizedFilePath = resolve39(filePathInSet);
21776
+ const normalizedFilePath = resolve40(filePathInSet);
21646
21777
  if (!processedFiles.has(normalizedFilePath)) {
21647
21778
  validFiles.push(normalizedFilePath);
21648
21779
  processedFiles.add(normalizedFilePath);
@@ -21780,7 +21911,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21780
21911
  const publicDir = state.resolvedPaths.publicDir;
21781
21912
  const assetsDir = state.resolvedPaths.assetsDir;
21782
21913
  const handleStaticMirror = async (sourceDir, urlPrefix) => {
21783
- const absSource = resolve39(filePath);
21914
+ const absSource = resolve40(filePath);
21784
21915
  const normalizedSource = absSource.replace(/\\/g, "/");
21785
21916
  const normalizedDir = sourceDir.replace(/\\/g, "/");
21786
21917
  if (!normalizedSource.startsWith(normalizedDir + "/"))
@@ -21788,10 +21919,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21788
21919
  try {
21789
21920
  const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
21790
21921
  const buildDir = state.resolvedPaths.buildDir;
21791
- const destPath = resolve39(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
21922
+ const destPath = resolve40(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
21792
21923
  const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
21793
- const { dirname: dirname23 } = await import("path");
21794
- await mkdir7(dirname23(destPath), { recursive: true });
21924
+ const { dirname: dirname24 } = await import("path");
21925
+ await mkdir7(dirname24(destPath), { recursive: true });
21795
21926
  await copyFile(absSource, destPath);
21796
21927
  const bytes = await readFile6(destPath);
21797
21928
  const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
@@ -21814,7 +21945,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21814
21945
  if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
21815
21946
  return;
21816
21947
  if (framework === "unknown") {
21817
- invalidate(resolve39(filePath));
21948
+ invalidate(resolve40(filePath));
21818
21949
  const relPath = relative16(process.cwd(), filePath);
21819
21950
  logHmrUpdate(relPath);
21820
21951
  const angularDir = state.resolvedPaths.angularDir;
@@ -21822,10 +21953,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21822
21953
  if (angularDir && state.dependencyGraph) {
21823
21954
  try {
21824
21955
  const { addFileToGraph: addFileToGraph2 } = await Promise.resolve().then(() => (init_dependencyGraph(), exports_dependencyGraph));
21825
- addFileToGraph2(state.dependencyGraph, resolve39(filePath));
21826
- const affected = getAffectedFiles(state.dependencyGraph, resolve39(filePath));
21956
+ addFileToGraph2(state.dependencyGraph, resolve40(filePath));
21957
+ const affected = getAffectedFiles(state.dependencyGraph, resolve40(filePath));
21827
21958
  for (const dependent of affected) {
21828
- if (dependent === resolve39(filePath))
21959
+ if (dependent === resolve40(filePath))
21829
21960
  continue;
21830
21961
  const dependentFramework = detectFramework(dependent, state.resolvedPaths);
21831
21962
  if (dependentFramework !== "angular")
@@ -21842,13 +21973,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21842
21973
  } catch {}
21843
21974
  }
21844
21975
  if (!hasAngularDependent) {
21976
+ console.log(`[abs:restart] ${resolve40(filePath)}`);
21845
21977
  return;
21846
21978
  }
21847
21979
  try {
21848
21980
  const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
21849
21981
  const { invalidateModule: invalidateModuleServer } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
21850
21982
  const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
21851
- const sourceAbs = resolve39(filePath).replace(/\\/g, "/");
21983
+ const sourceAbs = resolve40(filePath).replace(/\\/g, "/");
21852
21984
  const generatedTwin = `${generatedAngularRoot.replace(/\\/g, "/")}${sourceAbs.replace(/\.ts$/, ".js")}`;
21853
21985
  invalidateModuleServer(generatedTwin);
21854
21986
  } catch {}
@@ -21882,7 +22014,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21882
22014
  const userEditedFiles = new Set;
21883
22015
  state.fileChangeQueue.forEach((filePaths) => {
21884
22016
  for (const filePath2 of filePaths) {
21885
- userEditedFiles.add(resolve39(filePath2));
22017
+ userEditedFiles.add(resolve40(filePath2));
21886
22018
  }
21887
22019
  });
21888
22020
  state.lastUserEditedFiles = userEditedFiles;
@@ -21911,7 +22043,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21911
22043
  }
21912
22044
  if (!graph)
21913
22045
  return componentFile;
21914
- const dependents = graph.dependents.get(resolve39(componentFile));
22046
+ const dependents = graph.dependents.get(resolve40(componentFile));
21915
22047
  if (!dependents)
21916
22048
  return componentFile;
21917
22049
  for (const dep of dependents) {
@@ -21920,7 +22052,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21920
22052
  }
21921
22053
  return componentFile;
21922
22054
  }, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
21923
- const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") && resolve39(file5).startsWith(angularPagesPath));
22055
+ const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") && resolve40(file5).startsWith(angularPagesPath));
21924
22056
  if (pageEntries.length > 0 || !state.dependencyGraph) {
21925
22057
  return pageEntries;
21926
22058
  }
@@ -21929,7 +22061,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21929
22061
  const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
21930
22062
  const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
21931
22063
  affected.forEach((file5) => {
21932
- if (file5.endsWith(".ts") && resolve39(file5).startsWith(angularPagesPath)) {
22064
+ if (file5.endsWith(".ts") && resolve40(file5).startsWith(angularPagesPath)) {
21933
22065
  resolvedPages.add(file5);
21934
22066
  }
21935
22067
  });
@@ -21947,6 +22079,37 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21947
22079
  clientRoots.push(getGeneratedRoot2(projectRoot));
21948
22080
  const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
21949
22081
  return clientRoots.length === 1 ? clientRoots[0] ?? projectRoot : commonAncestor2(clientRoots, projectRoot);
22082
+ }, computeServerOutPaths = async (resolvedPaths, framework) => {
22083
+ const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
22084
+ const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
22085
+ const projectRoot = process.cwd();
22086
+ const serverDirs = [];
22087
+ if (resolvedPaths.svelteDir)
22088
+ serverDirs.push({
22089
+ dir: getFrameworkGeneratedDir2("svelte", projectRoot),
22090
+ subdir: "server"
22091
+ });
22092
+ if (resolvedPaths.vueDir)
22093
+ serverDirs.push({
22094
+ dir: getFrameworkGeneratedDir2("vue", projectRoot),
22095
+ subdir: "server"
22096
+ });
22097
+ if (resolvedPaths.angularDir)
22098
+ serverDirs.push({
22099
+ dir: getFrameworkGeneratedDir2("angular", projectRoot),
22100
+ subdir: ""
22101
+ });
22102
+ if (serverDirs.length <= 1) {
22103
+ const dir = getFrameworkGeneratedDir2(framework, projectRoot);
22104
+ return {
22105
+ serverOutDir: resolve40(resolvedPaths.buildDir, basename12(dir)),
22106
+ serverRoot: resolve40(dir, "server")
22107
+ };
22108
+ }
22109
+ return {
22110
+ serverOutDir: resolvedPaths.buildDir,
22111
+ serverRoot: commonAncestor2(serverDirs.map((entry) => entry.dir), projectRoot)
22112
+ };
21950
22113
  }, updateServerManifestEntry = (state, artifact) => {
21951
22114
  const fileWithHash = basename12(artifact.path);
21952
22115
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
@@ -21954,6 +22117,46 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
21954
22117
  return;
21955
22118
  }
21956
22119
  state.manifest[toPascal(baseName)] = artifact.path;
22120
+ }, pruneStaleHashedSiblings = async (freshOutputs) => {
22121
+ if (!freshOutputs?.length)
22122
+ return;
22123
+ const { readdir: readdir5, unlink: unlink2 } = await import("fs/promises");
22124
+ const keepByDir = new Map;
22125
+ const prefixByDir = new Map;
22126
+ for (const artifact of freshOutputs) {
22127
+ const dir = dirname23(artifact.path);
22128
+ const name = basename12(artifact.path);
22129
+ const [prefix] = name.split(".");
22130
+ if (!prefix)
22131
+ continue;
22132
+ if (!keepByDir.has(dir))
22133
+ keepByDir.set(dir, new Set);
22134
+ if (!prefixByDir.has(dir))
22135
+ prefixByDir.set(dir, new Set);
22136
+ keepByDir.get(dir).add(name);
22137
+ prefixByDir.get(dir).add(prefix);
22138
+ }
22139
+ await Promise.all(Array.from(keepByDir.entries()).map(async ([dir, keep]) => {
22140
+ const prefixes = prefixByDir.get(dir);
22141
+ if (!prefixes)
22142
+ return;
22143
+ const entries = await readdir5(dir).catch(() => []);
22144
+ await Promise.all(entries.map(async (entryName) => {
22145
+ if (keep.has(entryName))
22146
+ return;
22147
+ if (!entryName.endsWith(".js"))
22148
+ return;
22149
+ const parts = entryName.split(".");
22150
+ if (parts.length !== 3)
22151
+ return;
22152
+ const [base] = parts;
22153
+ if (!base || !prefixes.has(base))
22154
+ return;
22155
+ try {
22156
+ await unlink2(`${dir}/${entryName}`);
22157
+ } catch {}
22158
+ }));
22159
+ }));
21957
22160
  }, bundleAngularClient = async (state, clientPaths, buildDir, userAngularRoot) => {
21958
22161
  const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
21959
22162
  const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
@@ -22051,8 +22254,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22051
22254
  if (detected !== "unknown")
22052
22255
  continue;
22053
22256
  try {
22054
- const affected = getAffectedFiles(state.dependencyGraph, resolve39(editedFile));
22055
- const hasAngularConsumer = affected.some((dep) => dep !== resolve39(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
22257
+ const affected = getAffectedFiles(state.dependencyGraph, resolve40(editedFile));
22258
+ const hasAngularConsumer = affected.some((dep) => dep !== resolve40(editedFile) && detectFramework(dep, state.resolvedPaths) === "angular");
22056
22259
  if (hasAngularConsumer) {
22057
22260
  return {
22058
22261
  kind: "rebootstrap",
@@ -22099,7 +22302,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22099
22302
  }
22100
22303
  if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
22101
22304
  const normalized = editedFile.replace(/\\/g, "/");
22102
- const angularDirAbs = resolve39(angularDir).replace(/\\/g, "/");
22305
+ const angularDirAbs = resolve40(angularDir).replace(/\\/g, "/");
22103
22306
  if (normalized.startsWith(angularDirAbs + "/")) {
22104
22307
  return {
22105
22308
  kind: "rebootstrap",
@@ -22227,7 +22430,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22227
22430
  if (pageEntries.length === 0)
22228
22431
  return;
22229
22432
  await compileAndBundleAngular(state, pageEntries, angularDir);
22230
- markSsrCacheDirty("angular");
22231
22433
  };
22232
22434
  const drive = async () => {
22233
22435
  try {
@@ -22243,16 +22445,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22243
22445
  };
22244
22446
  const fire = () => {
22245
22447
  ctx.debounceTimer = null;
22246
- const resolve40 = ctx.debouncedResolve;
22448
+ const resolve41 = ctx.debouncedResolve;
22247
22449
  ctx.debouncedResolve = null;
22248
22450
  ctx.debouncedPromise = null;
22249
22451
  if (ctx.inFlight) {
22250
22452
  ctx.pending = true;
22251
- ctx.inFlight.finally(() => resolve40?.());
22453
+ ctx.inFlight.finally(() => resolve41?.());
22252
22454
  return;
22253
22455
  }
22254
22456
  ctx.inFlight = drive();
22255
- ctx.inFlight.finally(() => resolve40?.());
22457
+ ctx.inFlight.finally(() => resolve41?.());
22256
22458
  };
22257
22459
  return ({ immediate = false } = {}) => {
22258
22460
  if (!ctx.debouncedPromise) {
@@ -22279,16 +22481,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22279
22481
  const diskRefreshPromise = (async () => {
22280
22482
  if (!angularDir || editedFiles.size === 0)
22281
22483
  return;
22282
- const angularDirAbs = resolve39(angularDir);
22484
+ const angularDirAbs = resolve40(angularDir);
22283
22485
  const filesUnderAngular = Array.from(editedFiles).filter((file5) => {
22284
- const abs = resolve39(file5);
22486
+ const abs = resolve40(file5);
22285
22487
  return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep4);
22286
22488
  });
22287
22489
  if (filesUnderAngular.length === 0)
22288
22490
  return;
22289
22491
  try {
22290
22492
  const [
22291
- { compileAngularFileJIT: compileAngularFileJIT2 },
22493
+ { compileAngularFileJIT: compileAngularFileJIT2, invalidateAngularJitCache: invalidateAngularJitCache2 },
22292
22494
  { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 },
22293
22495
  { resolveOwningComponents: resolveOwningComponents2 }
22294
22496
  ] = await Promise.all([
@@ -22303,7 +22505,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22303
22505
  if (!ext)
22304
22506
  continue;
22305
22507
  if (ext === ".ts" || ext === ".tsx") {
22306
- tsFilesToRefresh.add(resolve39(file5));
22508
+ tsFilesToRefresh.add(resolve40(file5));
22307
22509
  continue;
22308
22510
  }
22309
22511
  const owners = resolveOwningComponents2({
@@ -22311,19 +22513,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22311
22513
  userAngularRoot: angularDirAbs
22312
22514
  });
22313
22515
  for (const owner of owners) {
22314
- tsFilesToRefresh.add(resolve39(owner.componentFilePath));
22516
+ tsFilesToRefresh.add(resolve40(owner.componentFilePath));
22315
22517
  }
22316
22518
  }
22317
22519
  if (tsFilesToRefresh.size === 0)
22318
22520
  return;
22319
- await Promise.all(Array.from(tsFilesToRefresh).map((file5) => compileAngularFileJIT2(file5, compiledRoot, angularDirAbs, getStyleTransformConfig(state.config), String(Date.now())).catch((err) => {
22320
- logWarn(`[hmr] disk-refresh JIT failed for ${file5}: ${err instanceof Error ? err.message : String(err)}`);
22321
- })));
22521
+ await Promise.all(Array.from(tsFilesToRefresh).map((file5) => {
22522
+ invalidateAngularJitCache2(file5);
22523
+ return compileAngularFileJIT2(file5, compiledRoot, angularDirAbs, getStyleTransformConfig(state.config)).catch((err) => {
22524
+ logWarn(`[hmr] disk-refresh JIT failed for ${file5}: ${err instanceof Error ? err.message : String(err)}`);
22525
+ });
22526
+ }));
22322
22527
  try {
22323
22528
  const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
22324
22529
  for (const tsFile of tsFilesToRefresh) {
22325
22530
  const rel = relative16(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
22326
- const compiledFile = resolve39(compiledRoot, rel);
22531
+ const compiledFile = resolve40(compiledRoot, rel);
22327
22532
  invalidateModule2(compiledFile);
22328
22533
  }
22329
22534
  } catch {}
@@ -22339,12 +22544,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22339
22544
  try {
22340
22545
  const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
22341
22546
  const { readdir: readdir5 } = await import("fs/promises");
22342
- const { join: join31 } = await import("path");
22547
+ const { join: join32 } = await import("path");
22343
22548
  const walk = async (dir) => {
22344
22549
  const entries = await readdir5(dir, { withFileTypes: true });
22345
22550
  const files = [];
22346
22551
  for (const entry of entries) {
22347
- const full = join31(dir, entry.name);
22552
+ const full = join32(dir, entry.name);
22348
22553
  if (entry.isDirectory()) {
22349
22554
  files.push(...await walk(full));
22350
22555
  } else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
@@ -22374,18 +22579,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22374
22579
  serverPaths.forEach((serverPath, idx) => {
22375
22580
  const fileBase = basename12(serverPath, ".js");
22376
22581
  const ssrPath = ssrPaths[idx] ?? serverPath;
22377
- state.manifest[toPascal(fileBase)] = resolve39(ssrPath);
22582
+ state.manifest[toPascal(fileBase)] = resolve40(ssrPath);
22378
22583
  });
22379
22584
  if (clientPaths.length > 0) {
22380
22585
  await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
22381
22586
  }
22587
+ broadcastToClients(state, {
22588
+ data: { manifest: state.manifest },
22589
+ type: "angular-tier-zero-ssr-rebuild-complete"
22590
+ });
22382
22591
  }, handleAngularFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
22383
22592
  const angularDir = config.angularDirectory ?? "";
22384
22593
  const angularFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "angular");
22385
22594
  for (const file5 of angularFiles) {
22386
- state.fileHashes.set(resolve39(file5), computeFileHash(file5));
22595
+ state.fileHashes.set(resolve40(file5), computeFileHash(file5));
22387
22596
  }
22388
- const angularPagesPath = resolve39(angularDir, "pages");
22597
+ const angularPagesPath = resolve40(angularDir, "pages");
22389
22598
  const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
22390
22599
  const tierStart = performance.now();
22391
22600
  const verdict = await decideAngularTier(state, angularDir);
@@ -22397,6 +22606,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22397
22606
  broadcastSurgical(state, verdict.queue);
22398
22607
  const b2 = verdict.breakdown;
22399
22608
  logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${b2.importsMs}/resolve ${b2.resolveMs}/compile ${b2.compileMs}; awaiting client apply)`);
22609
+ runBundle();
22400
22610
  } else if (verdict.tier === 1 && verdict.kind === "remount") {
22401
22611
  await runAngularHmrIncremental(state, angularDir, pageEntries);
22402
22612
  broadcastRemount(state, verdict.queue);
@@ -22424,13 +22634,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22424
22634
  if (isComponentFile2)
22425
22635
  return primaryFile;
22426
22636
  const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
22427
- const nearest = findNearestComponent2(resolve39(primaryFile));
22637
+ const nearest = findNearestComponent2(resolve40(primaryFile));
22428
22638
  return nearest ?? primaryFile;
22429
22639
  }, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
22430
22640
  for (const file5 of reactFiles) {
22431
- state.fileHashes.set(resolve39(file5), computeFileHash(file5));
22641
+ state.fileHashes.set(resolve40(file5), computeFileHash(file5));
22432
22642
  }
22433
- markSsrCacheDirty("react");
22434
22643
  const primaryFile = reactFiles.find((file5) => !file5.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
22435
22644
  if (!primaryFile) {
22436
22645
  onRebuildComplete({
@@ -22508,23 +22717,136 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22508
22717
  },
22509
22718
  type: "svelte-update"
22510
22719
  });
22511
- }, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
22720
+ }, handleSvelteModuleServerPath = async (state, svelteFiles, config, startTime, onRebuildComplete) => {
22512
22721
  for (const file5 of svelteFiles) {
22513
- state.fileHashes.set(resolve39(file5), computeFileHash(file5));
22722
+ state.fileHashes.set(resolve40(file5), computeFileHash(file5));
22514
22723
  }
22515
- markSsrCacheDirty("svelte");
22516
22724
  const serverDuration = Date.now() - startTime;
22517
22725
  await runSequentially(svelteFiles, (changedFile) => broadcastSvelteModuleUpdate(state, changedFile, svelteFiles, serverDuration));
22726
+ scheduleSvelteBundleRebuild(state, svelteFiles, config)();
22518
22727
  onRebuildComplete({
22519
22728
  hmrState: state,
22520
22729
  manifest: state.manifest
22521
22730
  });
22522
22731
  return state.manifest;
22732
+ }, SVELTE_BUNDLE_DEBOUNCE_MS = 2000, svelteBundleState, vueBundleState, getOrCreateBundleCtx = (store, state) => {
22733
+ let ctx = store.get(state);
22734
+ if (!ctx) {
22735
+ ctx = {
22736
+ debouncedPromise: null,
22737
+ debouncedResolve: null,
22738
+ debounceTimer: null,
22739
+ inFlight: null,
22740
+ pending: false,
22741
+ pendingFiles: new Set
22742
+ };
22743
+ store.set(state, ctx);
22744
+ }
22745
+ return ctx;
22746
+ }, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
22747
+ if (svelteFiles.length === 0)
22748
+ return;
22749
+ const svelteDir = config.svelteDirectory ?? "";
22750
+ if (!svelteDir)
22751
+ return;
22752
+ const { buildDir } = state.resolvedPaths;
22753
+ const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
22754
+ const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
22755
+ const clientRoot = await computeClientRoot(state.resolvedPaths);
22756
+ const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
22757
+ const serverEntries = [...svelteServerPaths];
22758
+ const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
22759
+ const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "svelte");
22760
+ const [serverResult, clientResult] = await Promise.all([
22761
+ serverEntries.length > 0 ? bunBuild9({
22762
+ entrypoints: serverEntries,
22763
+ external: [
22764
+ "react",
22765
+ "react/*",
22766
+ "react-dom",
22767
+ "react-dom/*",
22768
+ "svelte",
22769
+ "svelte/*"
22770
+ ],
22771
+ format: "esm",
22772
+ naming: "[dir]/[name].[hash].[ext]",
22773
+ outdir: serverOutDir,
22774
+ plugins: [
22775
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
22776
+ ],
22777
+ root: serverRoot,
22778
+ target: "bun",
22779
+ throw: false
22780
+ }) : undefined,
22781
+ clientEntries.length > 0 ? bunBuild9({
22782
+ entrypoints: clientEntries,
22783
+ format: "esm",
22784
+ naming: "[dir]/[name].[hash].[ext]",
22785
+ outdir: buildDir,
22786
+ plugins: [
22787
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
22788
+ ],
22789
+ root: clientRoot,
22790
+ target: "browser",
22791
+ throw: false
22792
+ }) : undefined
22793
+ ]);
22794
+ handleServerManifestUpdate(state, serverResult);
22795
+ await handleClientManifestUpdate(state, clientResult, buildDir);
22796
+ await pruneStaleHashedSiblings(serverResult?.outputs);
22797
+ broadcastToClients(state, {
22798
+ data: { manifest: state.manifest },
22799
+ type: "svelte-tier-zero-ssr-rebuild-complete"
22800
+ });
22801
+ }, scheduleSvelteBundleRebuild = (state, svelteFiles, config) => {
22802
+ const ctx = getOrCreateBundleCtx(svelteBundleState, state);
22803
+ for (const file5 of svelteFiles)
22804
+ ctx.pendingFiles.add(file5);
22805
+ const drive = async () => {
22806
+ try {
22807
+ while (true) {
22808
+ ctx.pending = false;
22809
+ const filesSnapshot = Array.from(ctx.pendingFiles);
22810
+ ctx.pendingFiles.clear();
22811
+ if (filesSnapshot.length === 0)
22812
+ break;
22813
+ await runSvelteBundleRebuild(state, filesSnapshot, config);
22814
+ if (!ctx.pending)
22815
+ break;
22816
+ }
22817
+ } finally {
22818
+ ctx.inFlight = null;
22819
+ }
22820
+ };
22821
+ const fire = () => {
22822
+ ctx.debounceTimer = null;
22823
+ const resolveFn = ctx.debouncedResolve;
22824
+ ctx.debouncedResolve = null;
22825
+ ctx.debouncedPromise = null;
22826
+ if (ctx.inFlight) {
22827
+ ctx.pending = true;
22828
+ ctx.inFlight.finally(() => resolveFn?.());
22829
+ return;
22830
+ }
22831
+ ctx.inFlight = drive();
22832
+ ctx.inFlight.finally(() => resolveFn?.());
22833
+ };
22834
+ return () => {
22835
+ if (!ctx.debouncedPromise) {
22836
+ ctx.debouncedPromise = new Promise((res) => {
22837
+ ctx.debouncedResolve = res;
22838
+ });
22839
+ }
22840
+ if (ctx.debounceTimer)
22841
+ clearTimeout(ctx.debounceTimer);
22842
+ ctx.debounceTimer = setTimeout(fire, SVELTE_BUNDLE_DEBOUNCE_MS);
22843
+ return ctx.debouncedPromise;
22844
+ };
22523
22845
  }, handleSvelteFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
22524
22846
  const svelteDir = config.svelteDirectory ?? "";
22525
22847
  const svelteFiles = filesToRebuild.filter((file5) => (file5.endsWith(".svelte") || file5.includes(".svelte.")) && detectFramework(file5, state.resolvedPaths) === "svelte");
22526
22848
  if (svelteFiles.length > 0) {
22527
- return handleSvelteModuleServerPath(state, svelteFiles, startTime, onRebuildComplete);
22849
+ return handleSvelteModuleServerPath(state, svelteFiles, config, startTime, onRebuildComplete);
22528
22850
  }
22529
22851
  const { buildDir } = state.resolvedPaths;
22530
22852
  if (svelteFiles.length > 0) {
@@ -22534,9 +22856,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22534
22856
  const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
22535
22857
  const serverEntries = [...svelteServerPaths];
22536
22858
  const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
22537
- const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
22538
- const serverRoot = resolve39(getFrameworkGeneratedDir2("svelte"), "server");
22539
- const serverOutDir = resolve39(buildDir, basename12(svelteDir));
22859
+ const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "svelte");
22540
22860
  const [serverResult, clientResult] = await Promise.all([
22541
22861
  serverEntries.length > 0 ? bunBuild9({
22542
22862
  entrypoints: serverEntries,
@@ -22631,26 +22951,131 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22631
22951
  },
22632
22952
  type: "vue-update"
22633
22953
  });
22634
- }, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
22954
+ }, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete) => {
22635
22955
  for (const file5 of [...vueFiles, ...nonVueFiles]) {
22636
- state.fileHashes.set(resolve39(file5), computeFileHash(file5));
22956
+ state.fileHashes.set(resolve40(file5), computeFileHash(file5));
22637
22957
  }
22638
- markSsrCacheDirty("vue");
22639
22958
  await invalidateNonVueModules(nonVueFiles);
22640
22959
  const serverDuration = Date.now() - startTime;
22641
22960
  const forceReload = nonVueFiles.length > 0;
22642
22961
  await runSequentially(vueFiles, (changedFile) => broadcastVueModuleUpdate(state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration));
22962
+ scheduleVueBundleRebuild(state, vueFiles, config)();
22643
22963
  onRebuildComplete({
22644
22964
  hmrState: state,
22645
22965
  manifest: state.manifest
22646
22966
  });
22647
22967
  return state.manifest;
22968
+ }, VUE_BUNDLE_DEBOUNCE_MS = 2000, runVueBundleRebuild = async (state, vueFiles, config) => {
22969
+ if (vueFiles.length === 0)
22970
+ return;
22971
+ const vueDir = config.vueDirectory ?? "";
22972
+ if (!vueDir)
22973
+ return;
22974
+ const { buildDir } = state.resolvedPaths;
22975
+ const { compileVue: compileVue2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
22976
+ const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
22977
+ const clientRoot = await computeClientRoot(state.resolvedPaths);
22978
+ const { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
22979
+ const serverEntries = [...vueServerPaths];
22980
+ const clientEntries = [...vueIndexPaths, ...vueClientPaths];
22981
+ const cssOutDir = join31(buildDir, state.resolvedPaths.assetsDir ? basename12(state.resolvedPaths.assetsDir) : "assets", "css");
22982
+ const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
22983
+ const [serverResult, clientResult, cssResult] = await Promise.all([
22984
+ serverEntries.length > 0 ? bunBuild9({
22985
+ entrypoints: serverEntries,
22986
+ external: ["vue", "vue/*", "@vue/*"],
22987
+ format: "esm",
22988
+ naming: "[dir]/[name].[hash].[ext]",
22989
+ outdir: serverOutDir,
22990
+ plugins: [
22991
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
22992
+ ],
22993
+ root: serverRoot,
22994
+ target: "bun",
22995
+ throw: false
22996
+ }) : undefined,
22997
+ clientEntries.length > 0 ? bunBuild9({
22998
+ entrypoints: clientEntries,
22999
+ format: "esm",
23000
+ naming: "[dir]/[name].[hash].[ext]",
23001
+ outdir: buildDir,
23002
+ plugins: [
23003
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
23004
+ ],
23005
+ root: clientRoot,
23006
+ target: "browser",
23007
+ throw: false
23008
+ }) : undefined,
23009
+ vueCssPaths.length > 0 ? bunBuild9({
23010
+ entrypoints: vueCssPaths,
23011
+ naming: "[name].[hash].[ext]",
23012
+ outdir: cssOutDir,
23013
+ plugins: [
23014
+ createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
23015
+ ],
23016
+ target: "browser",
23017
+ throw: false
23018
+ }) : undefined
23019
+ ]);
23020
+ handleServerManifestUpdate(state, serverResult);
23021
+ await handleClientManifestUpdate(state, clientResult, buildDir);
23022
+ await handleClientManifestUpdate(state, cssResult, buildDir);
23023
+ await pruneStaleHashedSiblings(serverResult?.outputs);
23024
+ await pruneStaleHashedSiblings(cssResult?.outputs);
23025
+ broadcastToClients(state, {
23026
+ data: { manifest: state.manifest },
23027
+ type: "vue-tier-zero-ssr-rebuild-complete"
23028
+ });
23029
+ }, scheduleVueBundleRebuild = (state, vueFiles, config) => {
23030
+ const ctx = getOrCreateBundleCtx(vueBundleState, state);
23031
+ for (const file5 of vueFiles)
23032
+ ctx.pendingFiles.add(file5);
23033
+ const drive = async () => {
23034
+ try {
23035
+ while (true) {
23036
+ ctx.pending = false;
23037
+ const filesSnapshot = Array.from(ctx.pendingFiles);
23038
+ ctx.pendingFiles.clear();
23039
+ if (filesSnapshot.length === 0)
23040
+ break;
23041
+ await runVueBundleRebuild(state, filesSnapshot, config);
23042
+ if (!ctx.pending)
23043
+ break;
23044
+ }
23045
+ } finally {
23046
+ ctx.inFlight = null;
23047
+ }
23048
+ };
23049
+ const fire = () => {
23050
+ ctx.debounceTimer = null;
23051
+ const resolveFn = ctx.debouncedResolve;
23052
+ ctx.debouncedResolve = null;
23053
+ ctx.debouncedPromise = null;
23054
+ if (ctx.inFlight) {
23055
+ ctx.pending = true;
23056
+ ctx.inFlight.finally(() => resolveFn?.());
23057
+ return;
23058
+ }
23059
+ ctx.inFlight = drive();
23060
+ ctx.inFlight.finally(() => resolveFn?.());
23061
+ };
23062
+ return () => {
23063
+ if (!ctx.debouncedPromise) {
23064
+ ctx.debouncedPromise = new Promise((res) => {
23065
+ ctx.debouncedResolve = res;
23066
+ });
23067
+ }
23068
+ if (ctx.debounceTimer)
23069
+ clearTimeout(ctx.debounceTimer);
23070
+ ctx.debounceTimer = setTimeout(fire, VUE_BUNDLE_DEBOUNCE_MS);
23071
+ return ctx.debouncedPromise;
23072
+ };
22648
23073
  }, handleVueFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
22649
23074
  const vueFiles = filesToRebuild.filter((file5) => file5.endsWith(".vue") && detectFramework(file5, state.resolvedPaths) === "vue");
22650
23075
  const nonVueFiles = filesToRebuild.filter((file5) => !file5.endsWith(".vue") && detectFramework(file5, state.resolvedPaths) === "vue");
22651
23076
  collectAffectedVueFiles(state, nonVueFiles, vueFiles);
22652
23077
  if (vueFiles.length > 0) {
22653
- return handleVueModuleServerPath(state, vueFiles, nonVueFiles, startTime, onRebuildComplete);
23078
+ return handleVueModuleServerPath(state, vueFiles, nonVueFiles, config, startTime, onRebuildComplete);
22654
23079
  }
22655
23080
  onRebuildComplete({ hmrState: state, manifest: state.manifest });
22656
23081
  return state.manifest;
@@ -22661,7 +23086,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22661
23086
  recursive: true,
22662
23087
  withFileTypes: true
22663
23088
  });
22664
- return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve39(emberPagesPath, entry.name));
23089
+ return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve40(emberPagesPath, entry.name));
22665
23090
  } catch {
22666
23091
  return [];
22667
23092
  }
@@ -22673,10 +23098,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22673
23098
  return state.manifest;
22674
23099
  }
22675
23100
  for (const file5 of emberFiles) {
22676
- state.fileHashes.set(resolve39(file5), computeFileHash(file5));
23101
+ state.fileHashes.set(resolve40(file5), computeFileHash(file5));
22677
23102
  }
22678
- const emberPagesPath = resolve39(emberDir, "pages");
22679
- const directPageEntries = emberFiles.filter((file5) => resolve39(file5).startsWith(emberPagesPath));
23103
+ const emberPagesPath = resolve40(emberDir, "pages");
23104
+ const directPageEntries = emberFiles.filter((file5) => resolve40(file5).startsWith(emberPagesPath));
22680
23105
  const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
22681
23106
  if (allPageEntries.length === 0) {
22682
23107
  onRebuildComplete({ hmrState: state, manifest: state.manifest });
@@ -22686,7 +23111,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22686
23111
  const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
22687
23112
  for (const serverPath of serverPaths) {
22688
23113
  const fileBase = basename12(serverPath, ".js");
22689
- state.manifest[toPascal(fileBase)] = resolve39(serverPath);
23114
+ state.manifest[toPascal(fileBase)] = resolve40(serverPath);
22690
23115
  }
22691
23116
  const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
22692
23117
  invalidateEmberSsrCache2();
@@ -22778,8 +23203,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22778
23203
  if (!buildReference?.source) {
22779
23204
  return;
22780
23205
  }
22781
- const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve39(dirname22(buildInfo.resolvedRegistryPath), buildReference.source);
22782
- islandFiles.add(resolve39(sourcePath));
23206
+ const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve40(dirname23(buildInfo.resolvedRegistryPath), buildReference.source);
23207
+ islandFiles.add(resolve40(sourcePath));
22783
23208
  }, resolveIslandSourceFiles = async (config) => {
22784
23209
  const registryPath = config.islands?.registry;
22785
23210
  if (!registryPath) {
@@ -22787,7 +23212,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22787
23212
  }
22788
23213
  const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
22789
23214
  const islandFiles = new Set([
22790
- resolve39(buildInfo.resolvedRegistryPath)
23215
+ resolve40(buildInfo.resolvedRegistryPath)
22791
23216
  ]);
22792
23217
  for (const definition of buildInfo.definitions) {
22793
23218
  resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
@@ -22798,7 +23223,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22798
23223
  if (islandFiles.size === 0) {
22799
23224
  return false;
22800
23225
  }
22801
- return filesToRebuild.some((file5) => islandFiles.has(resolve39(file5)));
23226
+ return filesToRebuild.some((file5) => islandFiles.has(resolve40(file5)));
22802
23227
  }, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
22803
23228
  const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
22804
23229
  if (!shouldReload) {
@@ -22833,10 +23258,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22833
23258
  }, computeOutputPagesDir = (state, config, framework) => {
22834
23259
  const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
22835
23260
  if (isSingle) {
22836
- return resolve39(state.resolvedPaths.buildDir, "pages");
23261
+ return resolve40(state.resolvedPaths.buildDir, "pages");
22837
23262
  }
22838
23263
  const dirName = framework === "html" ? basename12(config.htmlDirectory ?? "html") : basename12(config.htmxDirectory ?? "htmx");
22839
- return resolve39(state.resolvedPaths.buildDir, dirName, "pages");
23264
+ return resolve40(state.resolvedPaths.buildDir, dirName, "pages");
22840
23265
  }, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
22841
23266
  try {
22842
23267
  const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
@@ -22875,7 +23300,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22875
23300
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
22876
23301
  await runSequentially(pageFilesToUpdate, async (pageFile) => {
22877
23302
  const htmlPageName = basename12(pageFile);
22878
- const builtHtmlPagePath = resolve39(outputHtmlPages, htmlPageName);
23303
+ const builtHtmlPagePath = resolve40(outputHtmlPages, htmlPageName);
22879
23304
  await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
22880
23305
  });
22881
23306
  }, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
@@ -22940,7 +23365,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
22940
23365
  const cssKey = `${pascalName}CSS`;
22941
23366
  const cssUrl = manifest[cssKey] || null;
22942
23367
  const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
22943
- const hmrMeta = vueHmrMetadata2.get(resolve39(vuePagePath));
23368
+ const hmrMeta = vueHmrMetadata2.get(resolve40(vuePagePath));
22944
23369
  const changeType = hmrMeta?.changeType ?? "full";
22945
23370
  if (changeType === "style-only") {
22946
23371
  broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
@@ -23125,7 +23550,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23125
23550
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
23126
23551
  await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
23127
23552
  const htmxPageName = basename12(htmxPageFile);
23128
- const builtHtmxPagePath = resolve39(outputHtmxPages, htmxPageName);
23553
+ const builtHtmxPagePath = resolve40(outputHtmxPages, htmxPageName);
23129
23554
  await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
23130
23555
  });
23131
23556
  }, collectUpdatedModulePaths = (allModuleUpdates) => {
@@ -23234,7 +23659,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23234
23659
  html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
23235
23660
  writeFs(destPath, html);
23236
23661
  }, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
23237
- const destPath = resolve39(outputDir, basename12(sourceFile));
23662
+ const destPath = resolve40(outputDir, basename12(sourceFile));
23238
23663
  const hmrScript = extractHmrScript(destPath, readFs);
23239
23664
  const source = await Bun.file(sourceFile).text();
23240
23665
  await Bun.write(destPath, source);
@@ -23375,6 +23800,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23375
23800
  type: "rebuild-complete"
23376
23801
  });
23377
23802
  if (config.tailwind && filesToRebuild && filesToRebuild.some(isTailwindCandidate)) {
23803
+ try {
23804
+ const outputPath = resolve40(state.resolvedPaths.buildDir, config.tailwind.output);
23805
+ const bytes = await Bun.file(outputPath).bytes();
23806
+ const webPath = `/${config.tailwind.output.replace(/^\/+/, "")}`;
23807
+ state.assetStore.set(webPath, bytes);
23808
+ } catch {}
23378
23809
  broadcastToClients(state, {
23379
23810
  data: { framework: "tailwind", manifest },
23380
23811
  message: "Tailwind utilities recompiled",
@@ -23391,18 +23822,6 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23391
23822
  await handleFullBuildHMR(state, config, affectedFrameworks, filesToRebuild, manifest, duration);
23392
23823
  }
23393
23824
  broadcastFrameworkUpdates(state, affectedFrameworks, filesToRebuild, manifest, startTime);
23394
- if (affectedFrameworks.includes("angular")) {
23395
- markSsrCacheDirty("angular");
23396
- }
23397
- if (affectedFrameworks.includes("react")) {
23398
- markSsrCacheDirty("react");
23399
- }
23400
- if (affectedFrameworks.includes("svelte")) {
23401
- markSsrCacheDirty("svelte");
23402
- }
23403
- if (affectedFrameworks.includes("vue")) {
23404
- markSsrCacheDirty("vue");
23405
- }
23406
23825
  onRebuildComplete({ hmrState: state, manifest });
23407
23826
  return manifest;
23408
23827
  }, drainPendingQueue = (state, config, onRebuildComplete) => {
@@ -23485,6 +23904,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
23485
23904
  }
23486
23905
  };
23487
23906
  var init_rebuildTrigger = __esm(() => {
23907
+ init_generatedDir();
23488
23908
  init_build();
23489
23909
  init_scanEntryPoints();
23490
23910
  init_islandEntries();
@@ -23504,8 +23924,14 @@ var init_rebuildTrigger = __esm(() => {
23504
23924
  init_stylePreprocessor();
23505
23925
  init_compileTailwind();
23506
23926
  init_tailwindCompiler();
23507
- init_ssrCache();
23508
23927
  moduleServerPromise = Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
23928
+ FRAMEWORK_DIR_KEYS_FOR_CLEANUP = [
23929
+ { configKey: "reactDirectory", framework: "react" },
23930
+ { configKey: "svelteDirectory", framework: "svelte" },
23931
+ { configKey: "vueDirectory", framework: "vue" },
23932
+ { configKey: "emberDirectory", framework: "ember" },
23933
+ { configKey: "angularDirectory", framework: "angular" }
23934
+ ];
23509
23935
  USER_FIXABLE_FAST_HMR_REASONS = new Set([
23510
23936
  "template-parse-error",
23511
23937
  "template-resource-not-found",
@@ -23513,6 +23939,8 @@ var init_rebuildTrigger = __esm(() => {
23513
23939
  ]);
23514
23940
  angularBundleState = new WeakMap;
23515
23941
  getReactModuleUrl = getModuleUrl;
23942
+ svelteBundleState = new WeakMap;
23943
+ vueBundleState = new WeakMap;
23516
23944
  EMBER_PAGE_EXTENSIONS = [".gts", ".gjs", ".ts", ".js"];
23517
23945
  HMR_SCRIPT_PATTERN = /<script>window\.__HMR_FRAMEWORK__[\s\S]*?<\/script>\s*<script data-hmr-client>[\s\S]*?<\/script>/;
23518
23946
  STYLE_FILE_EXT_RE = /\.(?:css|scss|sass|less|styl|stylus)$/i;
@@ -23525,9 +23953,9 @@ __export(exports_buildDepVendor, {
23525
23953
  buildDepVendor: () => buildDepVendor
23526
23954
  });
23527
23955
  import { mkdirSync as mkdirSync13 } from "fs";
23528
- import { join as join31 } from "path";
23956
+ import { join as join32 } from "path";
23529
23957
  import { rm as rm10 } from "fs/promises";
23530
- var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
23958
+ var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
23531
23959
  var toSafeFileName6 = (specifier) => {
23532
23960
  const prefix = specifier.startsWith("@") ? "_" : "";
23533
23961
  return prefix + specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_");
@@ -23553,7 +23981,7 @@ var toSafeFileName6 = (specifier) => {
23553
23981
  return { dep, framework };
23554
23982
  }, scanDirFiles = async (dir) => {
23555
23983
  const empty = [];
23556
- const glob = new Glob9("**/*.{ts,tsx,js,jsx}");
23984
+ const glob = new Glob10("**/*.{ts,tsx,js,jsx}");
23557
23985
  try {
23558
23986
  const all = await Array.fromAsync(glob.scan({ absolute: true, cwd: dir }));
23559
23987
  return all.filter((file5) => !isSkippedFile(file5));
@@ -23636,7 +24064,7 @@ var toSafeFileName6 = (specifier) => {
23636
24064
  }), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
23637
24065
  const entries = await Promise.all(specifiers.map(async (specifier) => {
23638
24066
  const safeName = toSafeFileName6(specifier);
23639
- const entryPath = join31(tmpDir, `${safeName}.ts`);
24067
+ const entryPath = join32(tmpDir, `${safeName}.ts`);
23640
24068
  await Bun.write(entryPath, await generateVendorEntrySource(specifier));
23641
24069
  return { entryPath, specifier };
23642
24070
  }));
@@ -23697,9 +24125,9 @@ var toSafeFileName6 = (specifier) => {
23697
24125
  const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
23698
24126
  if (initialSpecs.length === 0 && frameworkRoots.length === 0)
23699
24127
  return {};
23700
- const vendorDir = join31(buildDir, "vendor");
24128
+ const vendorDir = join32(buildDir, "vendor");
23701
24129
  mkdirSync13(vendorDir, { recursive: true });
23702
- const tmpDir = join31(buildDir, "_dep_vendor_tmp");
24130
+ const tmpDir = join32(buildDir, "_dep_vendor_tmp");
23703
24131
  mkdirSync13(tmpDir, { recursive: true });
23704
24132
  const allSpecs = new Set(initialSpecs);
23705
24133
  const alreadyScanned = new Set;
@@ -23778,11 +24206,12 @@ var init_buildDepVendor = __esm(() => {
23778
24206
  // src/core/devBuild.ts
23779
24207
  var exports_devBuild = {};
23780
24208
  __export(exports_devBuild, {
23781
- devBuild: () => devBuild
24209
+ devBuild: () => devBuild,
24210
+ applyConfigChanges: () => applyConfigChanges
23782
24211
  });
23783
24212
  import { readdir as readdir5 } from "fs/promises";
23784
- import { statSync as statSync5 } from "fs";
23785
- import { resolve as resolve40 } from "path";
24213
+ import { statSync as statSync6 } from "fs";
24214
+ import { resolve as resolve41 } from "path";
23786
24215
  var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23787
24216
  const configuredDirs = [
23788
24217
  config.reactDirectory,
@@ -23805,7 +24234,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23805
24234
  return Object.keys(config).length > 0 ? config : null;
23806
24235
  }, reloadConfig = async () => {
23807
24236
  try {
23808
- const configPath2 = resolve40(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
24237
+ const configPath2 = resolve41(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
23809
24238
  const source = await Bun.file(configPath2).text();
23810
24239
  return parseDirectoryConfig(source);
23811
24240
  } catch {
@@ -23814,12 +24243,28 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23814
24243
  }, detectConfigChanges = async (cached) => {
23815
24244
  const newConfig = await reloadConfig();
23816
24245
  if (!newConfig)
23817
- return;
24246
+ return { added: [], removed: [] };
23818
24247
  const state = cached.hmrState;
23819
24248
  const oldConfig = state.config;
23820
- const hasChanges = FRAMEWORK_DIR_KEYS.some((key) => newConfig[key] !== oldConfig[key]);
23821
- if (!hasChanges)
23822
- return;
24249
+ const added = [];
24250
+ const removed = [];
24251
+ for (const key of FRAMEWORK_DIR_KEYS) {
24252
+ const oldVal = oldConfig[key];
24253
+ const newVal = newConfig[key];
24254
+ if (oldVal === newVal)
24255
+ continue;
24256
+ if (!oldVal && newVal)
24257
+ added.push(key);
24258
+ else if (oldVal && !newVal)
24259
+ removed.push(key);
24260
+ else if (oldVal && newVal) {
24261
+ removed.push(key);
24262
+ added.push(key);
24263
+ }
24264
+ }
24265
+ if (added.length === 0 && removed.length === 0) {
24266
+ return { added: [], removed: [] };
24267
+ }
23823
24268
  const oldWatchPaths = new Set(getWatchPaths(oldConfig, state.resolvedPaths));
23824
24269
  for (const key of FRAMEWORK_DIR_KEYS) {
23825
24270
  state.config[key] = newConfig[key];
@@ -23851,6 +24296,12 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23851
24296
  });
23852
24297
  });
23853
24298
  }
24299
+ return { added, removed };
24300
+ }, applyConfigChanges = async () => {
24301
+ const cached = globalThis.__hmrDevResult;
24302
+ if (!cached)
24303
+ return null;
24304
+ return detectConfigChanges(cached);
23854
24305
  }, removeStaleKeys = (target, source) => {
23855
24306
  for (const key of Object.keys(target)) {
23856
24307
  if (!(key in source))
@@ -23890,7 +24341,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23890
24341
  state.fileChangeQueue.clear();
23891
24342
  }
23892
24343
  }, handleCachedReload = async () => {
23893
- const serverMtime = statSync5(resolve40(Bun.main)).mtimeMs;
24344
+ const serverMtime = statSync6(resolve41(Bun.main)).mtimeMs;
23894
24345
  const lastMtime = globalThis.__hmrServerMtime;
23895
24346
  globalThis.__hmrServerMtime = serverMtime;
23896
24347
  const cached = globalThis.__hmrDevResult;
@@ -23927,8 +24378,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23927
24378
  return true;
23928
24379
  }, resolveAbsoluteVersion2 = async () => {
23929
24380
  const candidates = [
23930
- resolve40(import.meta.dir, "..", "..", "package.json"),
23931
- resolve40(import.meta.dir, "..", "package.json")
24381
+ resolve41(import.meta.dir, "..", "..", "package.json"),
24382
+ resolve41(import.meta.dir, "..", "package.json")
23932
24383
  ];
23933
24384
  const [candidate, ...remaining] = candidates;
23934
24385
  if (!candidate) {
@@ -23954,7 +24405,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
23954
24405
  const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
23955
24406
  await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
23956
24407
  const webPath = `/${framework}/vendor/${entry}`;
23957
- const bytes = await Bun.file(resolve40(vendorDir, entry)).bytes();
24408
+ const bytes = await Bun.file(resolve41(vendorDir, entry)).bytes();
23958
24409
  assetStore.set(webPath, bytes);
23959
24410
  }));
23960
24411
  }, devBuild = async (config) => {
@@ -24022,11 +24473,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
24022
24473
  cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
24023
24474
  recordStep("populate asset store", stepStartedAt);
24024
24475
  stepStartedAt = performance.now();
24025
- const reactVendorDir = resolve40(state.resolvedPaths.buildDir, "react", "vendor");
24026
- const angularVendorDir = resolve40(state.resolvedPaths.buildDir, "angular", "vendor");
24027
- const svelteVendorDir = resolve40(state.resolvedPaths.buildDir, "svelte", "vendor");
24028
- const vueVendorDir = resolve40(state.resolvedPaths.buildDir, "vue", "vendor");
24029
- const depVendorDir = resolve40(state.resolvedPaths.buildDir, "vendor");
24476
+ const reactVendorDir = resolve41(state.resolvedPaths.buildDir, "react", "vendor");
24477
+ const angularVendorDir = resolve41(state.resolvedPaths.buildDir, "angular", "vendor");
24478
+ const svelteVendorDir = resolve41(state.resolvedPaths.buildDir, "svelte", "vendor");
24479
+ const vueVendorDir = resolve41(state.resolvedPaths.buildDir, "vue", "vendor");
24480
+ const depVendorDir = resolve41(state.resolvedPaths.buildDir, "vendor");
24030
24481
  const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
24031
24482
  const [, angularSpecs, , , , , depPaths] = await Promise.all([
24032
24483
  config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
@@ -24083,8 +24534,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
24083
24534
  recordStep("warm compilers", stepStartedAt);
24084
24535
  if (config.tailwind) {
24085
24536
  stepStartedAt = performance.now();
24086
- const { warmTailwindCompiler: warmTailwindCompiler2 } = await Promise.resolve().then(() => (init_tailwindCompiler(), exports_tailwindCompiler));
24087
- await warmTailwindCompiler2(config.tailwind);
24537
+ const [{ warmTailwindCompiler: warmTailwindCompiler2 }, { computeFrameworkTailwindSources: computeFrameworkTailwindSources2 }] = await Promise.all([
24538
+ Promise.resolve().then(() => (init_tailwindCompiler(), exports_tailwindCompiler)),
24539
+ Promise.resolve().then(() => (init_compileTailwind(), exports_compileTailwind))
24540
+ ]);
24541
+ await warmTailwindCompiler2(config.tailwind, computeFrameworkTailwindSources2(config));
24088
24542
  recordStep("warm tailwind compiler", stepStartedAt);
24089
24543
  }
24090
24544
  state.manifest = manifest;
@@ -24104,7 +24558,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
24104
24558
  manifest
24105
24559
  };
24106
24560
  globalThis.__hmrDevResult = result;
24107
- globalThis.__hmrServerMtime = statSync5(resolve40(Bun.main)).mtimeMs;
24561
+ globalThis.__hmrServerMtime = statSync6(resolve41(Bun.main)).mtimeMs;
24108
24562
  return result;
24109
24563
  };
24110
24564
  var init_devBuild = __esm(() => {
@@ -24249,8 +24703,8 @@ var STORE_KEY = "__elysiaStore", getGlobalValue = (key) => Reflect.get(globalThi
24249
24703
  return null;
24250
24704
  if (!pathname.startsWith("/"))
24251
24705
  return null;
24252
- const { resolve: resolve41, normalize } = await import("path");
24253
- const candidate = resolve41(buildDir, pathname.slice(1));
24706
+ const { resolve: resolve42, normalize } = await import("path");
24707
+ const candidate = resolve42(buildDir, pathname.slice(1));
24254
24708
  const normalizedBuild = normalize(buildDir);
24255
24709
  if (!candidate.startsWith(normalizedBuild))
24256
24710
  return null;
@@ -24334,12 +24788,12 @@ __export(exports_devtoolsJson, {
24334
24788
  devtoolsJson: () => devtoolsJson
24335
24789
  });
24336
24790
  import { existsSync as existsSync28, mkdirSync as mkdirSync14, readFileSync as readFileSync21, writeFileSync as writeFileSync9 } from "fs";
24337
- import { dirname as dirname23, join as join32, resolve as resolve41 } from "path";
24791
+ import { dirname as dirname24, join as join33, resolve as resolve42 } from "path";
24338
24792
  import { Elysia as Elysia3 } from "elysia";
24339
24793
  var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
24340
24794
  Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
24341
24795
  return uuid;
24342
- }, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve41(uuidCachePath ?? join32(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
24796
+ }, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve42(uuidCachePath ?? join33(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
24343
24797
  if (!existsSync28(cachePath))
24344
24798
  return null;
24345
24799
  try {
@@ -24361,11 +24815,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
24361
24815
  if (cachedUuid)
24362
24816
  return setGlobalUuid(cachedUuid);
24363
24817
  const uuid = crypto.randomUUID();
24364
- mkdirSync14(dirname23(cachePath), { recursive: true });
24818
+ mkdirSync14(dirname24(cachePath), { recursive: true });
24365
24819
  writeFileSync9(cachePath, uuid, "utf-8");
24366
24820
  return setGlobalUuid(uuid);
24367
24821
  }, devtoolsJson = (buildDir, options = {}) => {
24368
- const rootPath = resolve41(options.projectRoot ?? process.cwd());
24822
+ const rootPath = resolve42(options.projectRoot ?? process.cwd());
24369
24823
  const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
24370
24824
  const uuid = getOrCreateUuid(buildDir, options);
24371
24825
  return new Elysia3({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
@@ -24378,11 +24832,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
24378
24832
  if (process.env.WSL_DISTRO_NAME) {
24379
24833
  const distro = process.env.WSL_DISTRO_NAME;
24380
24834
  const withoutLeadingSlash = root.replace(/^\//, "");
24381
- return join32("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
24835
+ return join33("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
24382
24836
  }
24383
24837
  if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
24384
24838
  const withoutLeadingSlash = root.replace(/^\//, "");
24385
- return join32("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
24839
+ return join33("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
24386
24840
  }
24387
24841
  return root;
24388
24842
  };
@@ -24394,7 +24848,7 @@ __export(exports_imageOptimizer, {
24394
24848
  imageOptimizer: () => imageOptimizer
24395
24849
  });
24396
24850
  import { existsSync as existsSync29 } from "fs";
24397
- import { resolve as resolve42 } from "path";
24851
+ import { resolve as resolve43 } from "path";
24398
24852
  import { Elysia as Elysia4 } from "elysia";
24399
24853
  var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
24400
24854
  try {
@@ -24407,7 +24861,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
24407
24861
  }
24408
24862
  }, resolveLocalImage = (url, buildDir) => {
24409
24863
  const cleanPath = url.startsWith("/") ? url.slice(1) : url;
24410
- return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve42(process.cwd()));
24864
+ return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve43(process.cwd()));
24411
24865
  }, parseQueryParams = (query, allowedSizes, defaultQuality) => {
24412
24866
  const url = typeof query["url"] === "string" ? query["url"] : undefined;
24413
24867
  const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
@@ -24699,7 +25153,7 @@ __export(exports_prerender, {
24699
25153
  PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
24700
25154
  });
24701
25155
  import { mkdirSync as mkdirSync15, readFileSync as readFileSync22 } from "fs";
24702
- import { join as join33 } from "path";
25156
+ import { join as join34 } from "path";
24703
25157
  var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
24704
25158
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
24705
25159
  await Bun.write(metaPath, String(Date.now()));
@@ -24765,7 +25219,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
24765
25219
  return false;
24766
25220
  const html = await res.text();
24767
25221
  const fileName = routeToFilename(route);
24768
- const filePath = join33(prerenderDir, fileName);
25222
+ const filePath = join34(prerenderDir, fileName);
24769
25223
  await Bun.write(filePath, html);
24770
25224
  await writeTimestamp(filePath);
24771
25225
  return true;
@@ -24791,13 +25245,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
24791
25245
  }
24792
25246
  const html = await res.text();
24793
25247
  const fileName = routeToFilename(route);
24794
- const filePath = join33(prerenderDir, fileName);
25248
+ const filePath = join34(prerenderDir, fileName);
24795
25249
  await Bun.write(filePath, html);
24796
25250
  await writeTimestamp(filePath);
24797
25251
  result.routes.set(route, filePath);
24798
25252
  log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
24799
25253
  }, prerender = async (port, outDir, staticConfig, log2) => {
24800
- const prerenderDir = join33(outDir, "_prerendered");
25254
+ const prerenderDir = join34(outDir, "_prerendered");
24801
25255
  mkdirSync15(prerenderDir, { recursive: true });
24802
25256
  const baseUrl = `http://localhost:${port}`;
24803
25257
  let routes;
@@ -24891,6 +25345,175 @@ ${serverOutput}` : "Server failed to start for pre-rendering";
24891
25345
  };
24892
25346
  var init_prerender = () => {};
24893
25347
 
25348
+ // src/dev/serverEntryWatcher.ts
25349
+ var exports_serverEntryWatcher = {};
25350
+ __export(exports_serverEntryWatcher, {
25351
+ startServerEntryWatcher: () => startServerEntryWatcher
25352
+ });
25353
+ import { copyFileSync as copyFileSync2, existsSync as existsSync32, statSync as statSync7, unlinkSync as unlinkSync2, watch as watch2 } from "fs";
25354
+ import { dirname as dirname25, join as join37, resolve as resolve45 } from "path";
25355
+ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || filename.startsWith(".absolutejs-hmr-") || ATOMIC_WRITE_TEMP_PATTERNS2.some((re2) => re2.test(filename)), startServerEntryWatcher = () => {
25356
+ if (globalThis.__absoluteEntryWatcherStarted)
25357
+ return;
25358
+ const main = Bun.main;
25359
+ if (!main || !existsSync32(main))
25360
+ return;
25361
+ globalThis.__absoluteEntryWatcherStarted = true;
25362
+ const entryPath = resolve45(main);
25363
+ const entryDir = dirname25(entryPath);
25364
+ const entryBase = entryPath.slice(entryDir.length + 1);
25365
+ const configPath2 = resolve45(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
25366
+ const configDir2 = dirname25(configPath2);
25367
+ const configBase = configPath2.slice(configDir2.length + 1);
25368
+ const recentlyHandled = new Map;
25369
+ let entryReloadTimer = null;
25370
+ let configReloadTimer = null;
25371
+ const triggerEntryReload = async (cause) => {
25372
+ const now = Date.now();
25373
+ const last = recentlyHandled.get(`entry:${cause}`) ?? 0;
25374
+ if (now - last < 100)
25375
+ return;
25376
+ recentlyHandled.set(`entry:${cause}`, now);
25377
+ const tmpName = `.absolutejs-hmr-${now}-${Math.random().toString(36).slice(2, 8)}.ts`;
25378
+ const tmpPath = join37(entryDir, tmpName);
25379
+ try {
25380
+ console.log(`[hmr] reloading server entry (${cause})`);
25381
+ copyFileSync2(entryPath, tmpPath);
25382
+ await import(tmpPath);
25383
+ const hmrState2 = globalThis.__hmrDevResult?.hmrState;
25384
+ if (hmrState2) {
25385
+ const { broadcastToClients: broadcastToClients2 } = await Promise.resolve().then(() => (init_webSocket(), exports_webSocket));
25386
+ broadcastToClients2(hmrState2, {
25387
+ data: { entryPath, cause },
25388
+ type: "server-entry-reloaded"
25389
+ });
25390
+ }
25391
+ } catch (err) {
25392
+ console.error(`[hmr] entry re-evaluation failed: ${err instanceof Error ? err.message : String(err)}`);
25393
+ console.log(`[abs:restart] ${entryPath}`);
25394
+ } finally {
25395
+ try {
25396
+ unlinkSync2(tmpPath);
25397
+ } catch {}
25398
+ }
25399
+ };
25400
+ const triggerConfigChange = async (cause) => {
25401
+ const now = Date.now();
25402
+ const last = recentlyHandled.get(`config:${cause}`) ?? 0;
25403
+ if (now - last < 100)
25404
+ return;
25405
+ recentlyHandled.set(`config:${cause}`, now);
25406
+ try {
25407
+ const diff = await applyConfigChanges();
25408
+ if (!diff) {
25409
+ return;
25410
+ }
25411
+ if (diff.removed.length === 0 && diff.added.length === 0) {
25412
+ console.log("[hmr] absolute.config.ts changed (non-framework keys) \u2014 restarting");
25413
+ console.log(`[abs:restart] ${configPath2}`);
25414
+ return;
25415
+ }
25416
+ if (diff.removed.length > 0) {
25417
+ console.log(`[hmr] absolute.config.ts removed framework(s) ${diff.removed.join(", ")} \u2014 restarting`);
25418
+ console.log(`[abs:restart] ${configPath2}`);
25419
+ return;
25420
+ }
25421
+ console.log(`[hmr] absolute.config.ts added framework(s) ${diff.added.join(", ")} \u2014 restarting (initial build needed)`);
25422
+ console.log(`[abs:restart] ${configPath2}`);
25423
+ } catch (err) {
25424
+ console.error(`[hmr] config change handling failed: ${err instanceof Error ? err.message : String(err)}`);
25425
+ console.log(`[abs:restart] ${configPath2}`);
25426
+ }
25427
+ };
25428
+ const scheduleEntryReload = (cause) => {
25429
+ if (entryReloadTimer)
25430
+ return;
25431
+ entryReloadTimer = setTimeout(() => {
25432
+ entryReloadTimer = null;
25433
+ triggerEntryReload(cause);
25434
+ }, RELOAD_DEBOUNCE_MS);
25435
+ };
25436
+ const scheduleConfigChange = (cause) => {
25437
+ if (configReloadTimer)
25438
+ return;
25439
+ configReloadTimer = setTimeout(() => {
25440
+ configReloadTimer = null;
25441
+ triggerConfigChange(cause);
25442
+ }, RELOAD_DEBOUNCE_MS);
25443
+ };
25444
+ const recoveryScan = (dir) => {
25445
+ let entries;
25446
+ try {
25447
+ const { readdirSync: readdirSync5 } = __require("fs");
25448
+ entries = readdirSync5(dir, { withFileTypes: true });
25449
+ } catch {
25450
+ return;
25451
+ }
25452
+ const now = Date.now();
25453
+ for (const entry of entries) {
25454
+ if (!entry.isFile())
25455
+ continue;
25456
+ const isEntry = dir === entryDir && entry.name === entryBase;
25457
+ const isConfig = dir === configDir2 && entry.name === configBase;
25458
+ if (!isEntry && !isConfig)
25459
+ continue;
25460
+ let st2;
25461
+ try {
25462
+ st2 = statSync7(join37(dir, entry.name));
25463
+ } catch {
25464
+ continue;
25465
+ }
25466
+ if (now - st2.ctimeMs > ATOMIC_RECOVERY_WINDOW_MS)
25467
+ continue;
25468
+ if (isEntry)
25469
+ scheduleEntryReload(entry.name);
25470
+ if (isConfig)
25471
+ scheduleConfigChange(entry.name);
25472
+ }
25473
+ };
25474
+ const handleEvent = (dir, _event, filename) => {
25475
+ if (!filename)
25476
+ return;
25477
+ if (isAtomicWriteTemp(filename)) {
25478
+ recoveryScan(dir);
25479
+ return;
25480
+ }
25481
+ if (dir === entryDir && filename === entryBase) {
25482
+ scheduleEntryReload(filename);
25483
+ return;
25484
+ }
25485
+ if (dir === configDir2 && filename === configBase) {
25486
+ scheduleConfigChange(filename);
25487
+ return;
25488
+ }
25489
+ };
25490
+ const entryWatcher = watch2(entryDir, { recursive: false }, (event, file5) => handleEvent(entryDir, event, file5));
25491
+ let configWatcher = null;
25492
+ if (configDir2 !== entryDir) {
25493
+ configWatcher = watch2(configDir2, { recursive: false }, (event, file5) => handleEvent(configDir2, event, file5));
25494
+ }
25495
+ const closeAll = () => {
25496
+ try {
25497
+ entryWatcher.close();
25498
+ } catch {}
25499
+ if (configWatcher) {
25500
+ try {
25501
+ configWatcher.close();
25502
+ } catch {}
25503
+ }
25504
+ };
25505
+ process.once("exit", closeAll);
25506
+ process.once("SIGINT", closeAll);
25507
+ process.once("SIGTERM", closeAll);
25508
+ };
25509
+ var init_serverEntryWatcher = __esm(() => {
25510
+ init_devBuild();
25511
+ ATOMIC_WRITE_TEMP_PATTERNS2 = [
25512
+ /^sed[A-Za-z0-9]{6,}$/,
25513
+ /^4913$/
25514
+ ];
25515
+ });
25516
+
24894
25517
  // src/core/streamingSlotRegistrar.ts
24895
25518
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
24896
25519
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
@@ -25073,8 +25696,6 @@ var hmrState = {
25073
25696
  pingInterval: null,
25074
25697
  reconnectTimeout: null
25075
25698
  };
25076
- // types/websocket.ts
25077
- var WS_READY_STATE_OPEN = 1;
25078
25699
  // src/build/index.ts
25079
25700
  init_compileTailwind();
25080
25701
  init_tailwindCompiler();
@@ -25396,13 +26017,13 @@ var handleHTMXPageRequest = async (pagePath) => {
25396
26017
  };
25397
26018
  // src/core/prepare.ts
25398
26019
  init_loadConfig();
25399
- import { existsSync as existsSync30, readdirSync as readdirSync3, readFileSync as readFileSync23 } from "fs";
25400
- import { basename as basename13, join as join34, relative as relative17, resolve as resolve43 } from "path";
26020
+ import { existsSync as existsSync30, readdirSync as readdirSync4, readFileSync as readFileSync23 } from "fs";
26021
+ import { basename as basename13, join as join35, relative as relative17, resolve as resolve44 } from "path";
25401
26022
  import { Elysia as Elysia5 } from "elysia";
25402
26023
 
25403
26024
  // src/core/loadIslandRegistry.ts
25404
26025
  init_islandEntries();
25405
- import { resolve as resolve9 } from "path";
26026
+ import { resolve as resolve10 } from "path";
25406
26027
  var isRecord6 = (value) => typeof value === "object" && value !== null;
25407
26028
  var resolveRegistryExport2 = (mod) => {
25408
26029
  if (isRecord6(mod.islandRegistry))
@@ -25414,7 +26035,7 @@ var resolveRegistryExport2 = (mod) => {
25414
26035
  var isRegistryModuleExport = (value) => isRecord6(value);
25415
26036
  var isIslandRegistryInput = (value) => isRecord6(value);
25416
26037
  var loadIslandRegistry = async (registryPath) => {
25417
- const resolvedRegistryPath = resolve9(registryPath);
26038
+ const resolvedRegistryPath = resolve10(registryPath);
25418
26039
  const buildInfo = await loadIslandRegistryBuildInfo(resolvedRegistryPath);
25419
26040
  if (buildInfo.definitions.length > 0) {
25420
26041
  return buildInfo.registry;
@@ -25754,12 +26375,12 @@ var buildPrewarmDirs = (config) => {
25754
26375
  return dirs;
25755
26376
  };
25756
26377
  var collectPrewarmFiles = async (prewarmDirs) => {
25757
- const { Glob: Glob10 } = await Promise.resolve(globalThis.Bun);
26378
+ const { Glob: Glob11 } = await Promise.resolve(globalThis.Bun);
25758
26379
  const files = [];
25759
26380
  for (const { dir, pattern } of prewarmDirs) {
25760
- const glob = new Glob10(pattern);
26381
+ const glob = new Glob11(pattern);
25761
26382
  const matches = [
25762
- ...glob.scanSync({ absolute: true, cwd: resolve43(dir) })
26383
+ ...glob.scanSync({ absolute: true, cwd: resolve44(dir) })
25763
26384
  ];
25764
26385
  files.push(...matches);
25765
26386
  }
@@ -25795,7 +26416,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
25795
26416
  const fileName = resolveDevIndexFileName(manifest[key], baseName);
25796
26417
  if (!fileName)
25797
26418
  continue;
25798
- const srcPath = resolve43(devIndexDir, fileName);
26419
+ const srcPath = resolve44(devIndexDir, fileName);
25799
26420
  if (!existsSync30(srcPath))
25800
26421
  continue;
25801
26422
  const rel = relative17(process.cwd(), srcPath).replace(/\\/g, "/");
@@ -25868,7 +26489,7 @@ var prepareDev = async (config, buildDir) => {
25868
26489
  stepStartedAt = performance.now();
25869
26490
  const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
25870
26491
  const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
25871
- const devIndexDir = resolve43(buildDir, "_src_indexes");
26492
+ const devIndexDir = resolve44(buildDir, "_src_indexes");
25872
26493
  patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
25873
26494
  recordStep("configure dev plugins", stepStartedAt);
25874
26495
  stepStartedAt = performance.now();
@@ -25908,7 +26529,7 @@ var loadPrerenderMap = (prerenderDir) => {
25908
26529
  return map;
25909
26530
  let entries;
25910
26531
  try {
25911
- entries = readdirSync3(prerenderDir);
26532
+ entries = readdirSync4(prerenderDir);
25912
26533
  } catch {
25913
26534
  return map;
25914
26535
  }
@@ -25917,7 +26538,7 @@ var loadPrerenderMap = (prerenderDir) => {
25917
26538
  continue;
25918
26539
  const name = basename13(entry, ".html");
25919
26540
  const route = name === "index" ? "/" : `/${name}`;
25920
- map.set(route, join34(prerenderDir, entry));
26541
+ map.set(route, join35(prerenderDir, entry));
25921
26542
  }
25922
26543
  return map;
25923
26544
  };
@@ -25949,7 +26570,7 @@ var prepare = async (configOrPath) => {
25949
26570
  recordStep("load config", stepStartedAt);
25950
26571
  const nodeEnv = process.env["NODE_ENV"];
25951
26572
  const isDev3 = nodeEnv === "development";
25952
- const buildDir = resolve43(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
26573
+ const buildDir = resolve44(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
25953
26574
  if (isDev3) {
25954
26575
  stepStartedAt = performance.now();
25955
26576
  const result = await prepareDev(config, buildDir);
@@ -25966,7 +26587,7 @@ var prepare = async (configOrPath) => {
25966
26587
  setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
25967
26588
  recordStep("load production manifest and island metadata", stepStartedAt);
25968
26589
  stepStartedAt = performance.now();
25969
- const conventionsPath = join34(buildDir, "conventions.json");
26590
+ const conventionsPath = join35(buildDir, "conventions.json");
25970
26591
  if (existsSync30(conventionsPath)) {
25971
26592
  const conventions2 = JSON.parse(readFileSync23(conventionsPath, "utf-8"));
25972
26593
  setConventions(conventions2);
@@ -25982,7 +26603,7 @@ var prepare = async (configOrPath) => {
25982
26603
  });
25983
26604
  recordStep("create static plugin", stepStartedAt);
25984
26605
  stepStartedAt = performance.now();
25985
- const prerenderDir = join34(buildDir, "_prerendered");
26606
+ const prerenderDir = join35(buildDir, "_prerendered");
25986
26607
  const prerenderMap = loadPrerenderMap(prerenderDir);
25987
26608
  recordStep("load prerender map", stepStartedAt);
25988
26609
  if (prerenderMap.size > 0) {
@@ -26040,11 +26661,11 @@ import { argv } from "process";
26040
26661
  var {env: env4 } = globalThis.Bun;
26041
26662
 
26042
26663
  // src/dev/devCert.ts
26043
- import { existsSync as existsSync31, mkdirSync as mkdirSync16, readFileSync as readFileSync24, rmSync as rmSync3 } from "fs";
26044
- import { join as join35 } from "path";
26045
- var CERT_DIR = join35(process.cwd(), ".absolutejs");
26046
- var CERT_PATH = join35(CERT_DIR, "cert.pem");
26047
- var KEY_PATH = join35(CERT_DIR, "key.pem");
26664
+ import { existsSync as existsSync31, mkdirSync as mkdirSync16, readFileSync as readFileSync24, rmSync as rmSync4 } from "fs";
26665
+ import { join as join36 } from "path";
26666
+ var CERT_DIR = join36(process.cwd(), ".absolutejs");
26667
+ var CERT_PATH = join36(CERT_DIR, "cert.pem");
26668
+ var KEY_PATH = join36(CERT_DIR, "key.pem");
26048
26669
  var CERT_VALIDITY_DAYS = 365;
26049
26670
  var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
26050
26671
  var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
@@ -26199,37 +26820,75 @@ var loadTls = () => {
26199
26820
  };
26200
26821
  var tls = loadTls();
26201
26822
  var protocol = tls ? "https" : "http";
26202
- var networking = (app) => env4.ABSOLUTE_COMPILED_RUNTIME === "1" ? app : app.listen({
26203
- hostname: host,
26204
- port,
26205
- ...tls ? {
26206
- tls: {
26207
- cert: tls.cert,
26208
- key: tls.key
26209
- }
26210
- } : {}
26211
- }, () => {
26212
- if (visibility === "internal" || managedByWorkspace) {
26213
- return;
26214
- }
26215
- const isHotReload = Boolean(globalThis.__hmrServerStartup);
26216
- globalThis.__hmrServerStartup = true;
26217
- if (isHotReload) {
26218
- return;
26823
+ var networking = (app) => {
26824
+ if (env4.ABSOLUTE_COMPILED_RUNTIME === "1")
26825
+ return app;
26826
+ const liveServer = globalThis.__absoluteBunServer;
26827
+ if (liveServer && typeof liveServer.reload === "function") {
26828
+ const prevStore = globalThis.__absolutePreviousAppStore;
26829
+ if (prevStore && app.store && typeof app.store === "object") {
26830
+ const newStore = app.store;
26831
+ const oldStore = prevStore;
26832
+ for (const key of Object.keys(newStore)) {
26833
+ if (key in oldStore) {
26834
+ newStore[key] = oldStore[key];
26835
+ }
26836
+ }
26837
+ }
26838
+ globalThis.__absolutePreviousAppStore = app.store;
26839
+ try {
26840
+ app.compile();
26841
+ } catch {}
26842
+ liveServer.reload({
26843
+ fetch: (request) => app.fetch(request),
26844
+ routes: {}
26845
+ });
26846
+ return app;
26219
26847
  }
26220
- const buildDuration = globalThis.__hmrBuildDuration ?? Number(env4.ABSOLUTE_BUILD_DURATION || 0);
26221
- const readyDuration = process.uptime() * MILLISECONDS_IN_A_SECOND;
26222
- const version = globalThis.__absoluteVersion || env4.ABSOLUTE_VERSION || "";
26223
- startupBanner({
26224
- buildDuration,
26225
- host,
26226
- networkUrl: hostFlag ? `${protocol}://${localIP}:${port}/` : undefined,
26848
+ const listened = app.listen({
26849
+ hostname: host,
26227
26850
  port,
26228
- protocol,
26229
- readyDuration,
26230
- version
26851
+ ...tls ? {
26852
+ tls: {
26853
+ cert: tls.cert,
26854
+ key: tls.key
26855
+ }
26856
+ } : {}
26857
+ }, () => {
26858
+ if (visibility === "internal" || managedByWorkspace) {
26859
+ return;
26860
+ }
26861
+ const isHotReload = Boolean(globalThis.__hmrServerStartup);
26862
+ globalThis.__hmrServerStartup = true;
26863
+ if (isHotReload) {
26864
+ return;
26865
+ }
26866
+ const buildDuration = globalThis.__hmrBuildDuration ?? Number(env4.ABSOLUTE_BUILD_DURATION || 0);
26867
+ const readyDuration = process.uptime() * MILLISECONDS_IN_A_SECOND;
26868
+ const version = globalThis.__absoluteVersion || env4.ABSOLUTE_VERSION || "";
26869
+ startupBanner({
26870
+ buildDuration,
26871
+ host,
26872
+ networkUrl: hostFlag ? `${protocol}://${localIP}:${port}/` : undefined,
26873
+ port,
26874
+ protocol,
26875
+ readyDuration,
26876
+ version
26877
+ });
26231
26878
  });
26232
- });
26879
+ if (app.server) {
26880
+ globalThis.__absoluteBunServer = app.server;
26881
+ globalThis.__absolutePreviousAppStore = app.store;
26882
+ if (env4.NODE_ENV === "development") {
26883
+ Promise.resolve().then(() => (init_serverEntryWatcher(), exports_serverEntryWatcher)).then(({ startServerEntryWatcher: startServerEntryWatcher2 }) => {
26884
+ startServerEntryWatcher2();
26885
+ }).catch((err) => {
26886
+ console.error(`[hmr] entry watcher setup failed: ${err instanceof Error ? err.message : String(err)}`);
26887
+ });
26888
+ }
26889
+ }
26890
+ return listened;
26891
+ };
26233
26892
  // src/plugins/pageRouter.ts
26234
26893
  var pageRouterPlugin = () => {
26235
26894
  console.log("Page Router Plugin Not Implemented Yet");
@@ -26379,8 +27038,8 @@ var jsonLd2 = (schema) => {
26379
27038
  };
26380
27039
  // src/utils/defineEnv.ts
26381
27040
  var {env: bunEnv } = globalThis.Bun;
26382
- import { existsSync as existsSync32, readFileSync as readFileSync25 } from "fs";
26383
- import { resolve as resolve44 } from "path";
27041
+ import { existsSync as existsSync33, readFileSync as readFileSync25 } from "fs";
27042
+ import { resolve as resolve46 } from "path";
26384
27043
 
26385
27044
  // node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
26386
27045
  var exports_value = {};
@@ -32415,8 +33074,8 @@ ${lines.join(`
32415
33074
  };
32416
33075
  var checkEnvFileSecurity = (properties) => {
32417
33076
  const cwd2 = process.cwd();
32418
- const envPath = resolve44(cwd2, ".env");
32419
- if (!existsSync32(envPath))
33077
+ const envPath = resolve46(cwd2, ".env");
33078
+ if (!existsSync33(envPath))
32420
33079
  return;
32421
33080
  const sensitiveKeys = Object.keys(properties).filter(isSensitive);
32422
33081
  if (sensitiveKeys.length === 0)
@@ -32425,8 +33084,8 @@ var checkEnvFileSecurity = (properties) => {
32425
33084
  const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
32426
33085
  if (presentKeys.length === 0)
32427
33086
  return;
32428
- const gitignorePath = resolve44(cwd2, ".gitignore");
32429
- if (existsSync32(gitignorePath)) {
33087
+ const gitignorePath = resolve46(cwd2, ".gitignore");
33088
+ if (existsSync33(gitignorePath)) {
32430
33089
  const gitignore = readFileSync25(gitignorePath, "utf-8");
32431
33090
  if (gitignore.split(`
32432
33091
  `).some((line) => line.trim() === ".env"))
@@ -32667,5 +33326,5 @@ export {
32667
33326
  ANGULAR_INIT_TIMEOUT_MS
32668
33327
  };
32669
33328
 
32670
- //# debugId=FCFA0DD89CA7835164756E2164756E21
33329
+ //# debugId=A0C3830E747857F064756E2164756E21
32671
33330
  //# sourceMappingURL=index.js.map