@absolutejs/absolute 0.19.0-beta.690 → 0.19.0-beta.692

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2502,10 +2502,10 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
2502
2502
  });
2503
2503
 
2504
2504
  // src/build/stylePreprocessor.ts
2505
- import { readFileSync as readFileSync3 } from "fs";
2506
2505
  import { readFile } from "fs/promises";
2507
- import { dirname as dirname2, extname } from "path";
2508
- var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
2506
+ import { createRequire } from "module";
2507
+ import { dirname as dirname2, extname, join as join3 } from "path";
2508
+ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, requireFromCwd, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
2509
2509
  const normalized = filePathOrLanguage.toLowerCase();
2510
2510
  if (normalized === "scss" || normalized.endsWith(".scss"))
2511
2511
  return "scss";
@@ -2569,27 +2569,6 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2569
2569
  return readFile(filePath, "utf-8");
2570
2570
  }
2571
2571
  return compileStyleSource(filePath);
2572
- }, compileStyleFileIfNeededSync = (filePath) => {
2573
- const contents = readFileSync3(filePath, "utf-8");
2574
- const language = getStyleLanguage(filePath);
2575
- if (language === "scss" || language === "sass") {
2576
- let sass;
2577
- try {
2578
- sass = requireOptionalPeer("sass");
2579
- } catch {
2580
- throw missingDependencyError("sass", filePath);
2581
- }
2582
- return sass.compileString(contents, {
2583
- loadPaths: [dirname2(filePath), process.cwd()],
2584
- style: "expanded",
2585
- syntax: language === "sass" ? "indented" : "scss",
2586
- url: new URL(`file://${filePath}`)
2587
- }).css;
2588
- }
2589
- if (language === "less") {
2590
- throw new Error(`Unable to compile ${filePath}: Less styleUrl preprocessing is async-only. Import the Less file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
2591
- }
2592
- return contents;
2593
2572
  };
2594
2573
  var init_stylePreprocessor = __esm(() => {
2595
2574
  STYLE_EXTENSION_PATTERN = /\.(s[ac]ss|less)$/i;
@@ -2597,6 +2576,7 @@ var init_stylePreprocessor = __esm(() => {
2597
2576
  STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less)$/i;
2598
2577
  importOptionalPeer = new Function("specifier", "return import(specifier)");
2599
2578
  requireOptionalPeer = new Function("specifier", "return require(specifier)");
2579
+ requireFromCwd = createRequire(join3(process.cwd(), "package.json"));
2600
2580
  stylePreprocessorPlugin = {
2601
2581
  name: "absolute-style-preprocessor",
2602
2582
  setup(build) {
@@ -2635,13 +2615,13 @@ var init_stylePreprocessor = __esm(() => {
2635
2615
 
2636
2616
  // src/core/svelteServerModule.ts
2637
2617
  import { mkdir, readdir } from "fs/promises";
2638
- import { basename as basename2, dirname as dirname3, extname as extname2, join as join3, relative, resolve as resolve4 } from "path";
2618
+ import { basename as basename2, dirname as dirname3, extname as extname2, join as join4, relative, resolve as resolve4 } from "path";
2639
2619
  var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
2640
2620
  const importPath = relative(dirname3(from), target).replace(/\\/g, "/");
2641
2621
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
2642
2622
  }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
2643
2623
  for (const entry of entries) {
2644
- const entryPath = join3(dir, entry.name);
2624
+ const entryPath = join4(dir, entry.name);
2645
2625
  if (entry.isDirectory())
2646
2626
  stack.push(entryPath);
2647
2627
  if (entry.isFile() && entry.name === targetFileName) {
@@ -2671,11 +2651,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2671
2651
  if (cachedPath !== undefined) {
2672
2652
  return cachedPath;
2673
2653
  }
2674
- if (!sourcePath.includes(`${join3(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
2654
+ if (!sourcePath.includes(`${join4(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
2675
2655
  originalSourcePathCache.set(sourcePath, sourcePath);
2676
2656
  return sourcePath;
2677
2657
  }
2678
- const resolvedSourcePath = await findSourceFileByBasename(join3(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
2658
+ const resolvedSourcePath = await findSourceFileByBasename(join4(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
2679
2659
  const nextPath = resolvedSourcePath ?? sourcePath;
2680
2660
  originalSourcePathCache.set(sourcePath, nextPath);
2681
2661
  return nextPath;
@@ -2691,11 +2671,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2691
2671
  `${basePath}.mjs`,
2692
2672
  `${basePath}.cjs`,
2693
2673
  `${basePath}.json`,
2694
- join3(basePath, "index.ts"),
2695
- join3(basePath, "index.js"),
2696
- join3(basePath, "index.mjs"),
2697
- join3(basePath, "index.cjs"),
2698
- join3(basePath, "index.json")
2674
+ join4(basePath, "index.ts"),
2675
+ join4(basePath, "index.js"),
2676
+ join4(basePath, "index.mjs"),
2677
+ join4(basePath, "index.cjs"),
2678
+ join4(basePath, "index.json")
2699
2679
  ];
2700
2680
  const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
2701
2681
  const foundIndex = existResults.indexOf(true);
@@ -2703,7 +2683,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2703
2683
  }, getCachedModulePath = (sourcePath) => {
2704
2684
  const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
2705
2685
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
2706
- return join3(serverCacheRoot, `${normalizedSourcePath}.server.js`);
2686
+ return join4(serverCacheRoot, `${normalizedSourcePath}.server.js`);
2707
2687
  }, resolveSvelteImport = async (spec, from) => {
2708
2688
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
2709
2689
  const resolved = resolvePackageImport(spec);
@@ -2804,7 +2784,7 @@ var init_svelteServerModule = __esm(() => {
2804
2784
  init_lowerIslandSyntax();
2805
2785
  init_lowerAwaitSlotSyntax();
2806
2786
  init_stylePreprocessor();
2807
- serverCacheRoot = join3(process.cwd(), ".absolutejs", "islands", "svelte");
2787
+ serverCacheRoot = join4(process.cwd(), ".absolutejs", "islands", "svelte");
2808
2788
  compiledModuleCache = new Map;
2809
2789
  originalSourcePathCache = new Map;
2810
2790
  transpiler = new Bun.Transpiler({
@@ -2970,7 +2950,7 @@ import {
2970
2950
  rmSync,
2971
2951
  writeFileSync as writeFileSync2
2972
2952
  } from "fs";
2973
- import { dirname as dirname4, extname as extname3, join as join4, relative as relative2, resolve as resolve5 } from "path";
2953
+ import { dirname as dirname4, extname as extname3, join as join5, relative as relative2, resolve as resolve5 } from "path";
2974
2954
  import ts from "typescript";
2975
2955
  var frameworks, isRecord4 = (value) => typeof value === "object" && value !== null, resolveRegistryExport = (mod) => {
2976
2956
  if (isRecord4(mod.islandRegistry))
@@ -3126,11 +3106,11 @@ export default component;
3126
3106
  buildPath,
3127
3107
  clientPathMaps = {}
3128
3108
  }) => {
3129
- const generatedRoot = join4(buildPath, "_island_entries");
3109
+ const generatedRoot = join5(buildPath, "_island_entries");
3130
3110
  rmSync(generatedRoot, { force: true, recursive: true });
3131
3111
  const entries = [];
3132
3112
  for (const definition of buildInfo.definitions) {
3133
- const entryPath = join4(generatedRoot, "islands", definition.framework, `${definition.component}.ts`);
3113
+ const entryPath = join5(generatedRoot, "islands", definition.framework, `${definition.component}.ts`);
3134
3114
  const { buildReference } = definition;
3135
3115
  const source = buildReference ? resolveIslandSourcePath(buildInfo.resolvedRegistryPath, buildReference.source) : null;
3136
3116
  const compiledSourcePath = source && shouldUseCompiledClientPath(definition.framework, source) ? clientPathMaps[definition.framework]?.get(source) : undefined;
@@ -3237,7 +3217,7 @@ var init_staticStreaming = __esm(() => {
3237
3217
  });
3238
3218
 
3239
3219
  // src/build/staticIslandPages.ts
3240
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
3220
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
3241
3221
  var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/(?:absolute-island|island)>)", ATTRIBUTE_RE_SOURCE = `([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, islandFrameworks, islandHydrationModes, isRecord5 = (value) => typeof value === "object" && value !== null, isIslandFramework = (value) => islandFrameworks.some((framework) => framework === value), isIslandHydrationMode = (value) => islandHydrationModes.some((mode) => mode === value), parseHtmlAttributes = (attributeString) => {
3242
3222
  const attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, "g");
3243
3223
  const attributes = new Map;
@@ -3366,7 +3346,7 @@ var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:
3366
3346
  }
3367
3347
  return result + originalHtml.slice(nextIndex);
3368
3348
  }, transformStaticPage = async (pagePath, registry) => {
3369
- const originalHtml = readFileSync4(pagePath, "utf-8");
3349
+ const originalHtml = readFileSync3(pagePath, "utf-8");
3370
3350
  const transformedHtml = await transformStaticPageHtml(originalHtml, registry);
3371
3351
  if (transformedHtml !== originalHtml) {
3372
3352
  writeFileSync3(pagePath, transformedHtml);
@@ -3494,7 +3474,7 @@ var init_sourceMetadata = __esm(() => {
3494
3474
  });
3495
3475
 
3496
3476
  // src/islands/pageMetadata.ts
3497
- import { readFileSync as readFileSync5 } from "fs";
3477
+ import { readFileSync as readFileSync4 } from "fs";
3498
3478
  import { dirname as dirname5, resolve as resolve8 } from "path";
3499
3479
  var pagePatterns, getPageDirs = (config) => [
3500
3480
  { dir: config.angularDirectory, framework: "angular" },
@@ -3536,7 +3516,7 @@ var pagePatterns, getPageDirs = (config) => [
3536
3516
  return;
3537
3517
  const files = await scanEntryPoints(resolve8(entry.dir), pattern);
3538
3518
  for (const filePath of files) {
3539
- const source = readFileSync5(filePath, "utf-8");
3519
+ const source = readFileSync4(filePath, "utf-8");
3540
3520
  const islands = extractIslandUsagesFromSource(source);
3541
3521
  pageMetadata.set(resolve8(filePath), {
3542
3522
  islands: resolveIslandUsages(islands, islandSourceLookup),
@@ -3670,7 +3650,7 @@ __export(exports_generateReactIndexes, {
3670
3650
  });
3671
3651
  import { existsSync as existsSync5, mkdirSync as mkdirSync2 } from "fs";
3672
3652
  import { readdir as readdir2, rm, writeFile } from "fs/promises";
3673
- import { basename as basename3, join as join5, relative as relative3, resolve as resolve9, sep } from "path";
3653
+ import { basename as basename3, join as join6, relative as relative3, resolve as resolve9, sep } from "path";
3674
3654
  var {Glob: Glob2 } = globalThis.Bun;
3675
3655
  var indexContentCache, resolveDevClientDir = () => {
3676
3656
  const projectRoot = process.cwd();
@@ -3703,8 +3683,8 @@ var indexContentCache, resolveDevClientDir = () => {
3703
3683
  });
3704
3684
  if (staleIndexes.length > 0) {
3705
3685
  await Promise.all(staleIndexes.map((indexFile) => {
3706
- indexContentCache.delete(join5(reactIndexesDirectory, indexFile));
3707
- return rm(join5(reactIndexesDirectory, indexFile), {
3686
+ indexContentCache.delete(join6(reactIndexesDirectory, indexFile));
3687
+ return rm(join6(reactIndexesDirectory, indexFile), {
3708
3688
  force: true
3709
3689
  });
3710
3690
  }));
@@ -3973,7 +3953,7 @@ var indexContentCache, resolveDevClientDir = () => {
3973
3953
  ] : []
3974
3954
  ].join(`
3975
3955
  `);
3976
- const indexPath = join5(reactIndexesDirectory, `${componentName}.tsx`);
3956
+ const indexPath = join6(reactIndexesDirectory, `${componentName}.tsx`);
3977
3957
  const hasher = new Bun.CryptoHasher("md5");
3978
3958
  hasher.update(content);
3979
3959
  const contentHash = hasher.digest("hex");
@@ -3987,7 +3967,7 @@ var indexContentCache, resolveDevClientDir = () => {
3987
3967
  if (!isDev2) {
3988
3968
  return;
3989
3969
  }
3990
- const refreshPath = join5(reactIndexesDirectory, "_refresh.tsx");
3970
+ const refreshPath = join6(reactIndexesDirectory, "_refresh.tsx");
3991
3971
  if (!existsSync5(refreshPath)) {
3992
3972
  await writeFile(refreshPath, `import '${refreshSetupPath}';
3993
3973
  import 'react';
@@ -3998,9 +3978,9 @@ import 'react-dom/client';
3998
3978
  var init_generateReactIndexes = __esm(() => {
3999
3979
  indexContentCache = new Map;
4000
3980
  devClientDir = resolveDevClientDir();
4001
- errorOverlayPath = join5(devClientDir, "errorOverlay.ts").replace(/\\/g, "/");
4002
- hmrClientPath = join5(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
4003
- refreshSetupPath = join5(devClientDir, "reactRefreshSetup.ts").replace(/\\/g, "/");
3981
+ errorOverlayPath = join6(devClientDir, "errorOverlay.ts").replace(/\\/g, "/");
3982
+ hmrClientPath = join6(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
3983
+ refreshSetupPath = join6(devClientDir, "reactRefreshSetup.ts").replace(/\\/g, "/");
4004
3984
  });
4005
3985
 
4006
3986
  // src/build/wrapHTMLScript.ts
@@ -4136,8 +4116,8 @@ var init_scanCssEntryPoints = __esm(() => {
4136
4116
  });
4137
4117
 
4138
4118
  // src/utils/imageProcessing.ts
4139
- import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
4140
- import { join as join6, resolve as resolve10 } from "path";
4119
+ import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
4120
+ import { join as join7, resolve as resolve10 } from "path";
4141
4121
  var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
4142
4122
  for (const size of sizes) {
4143
4123
  if (size >= target)
@@ -4190,7 +4170,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
4190
4170
  const image2 = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
4191
4171
  return [...device, ...image2].sort((left, right) => left - right);
4192
4172
  }, getCacheDir = (buildDir) => {
4193
- const dir = join6(buildDir, ".cache", "images");
4173
+ const dir = join7(buildDir, ".cache", "images");
4194
4174
  if (!existsSync8(dir))
4195
4175
  mkdirSync3(dir, { recursive: true });
4196
4176
  return dir;
@@ -4247,13 +4227,13 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
4247
4227
  return toBuffer(buffer);
4248
4228
  }
4249
4229
  }, readFromCache = (cacheDir, cacheKey) => {
4250
- const metaPath = join6(cacheDir, `${cacheKey}.meta`);
4251
- const dataPath = join6(cacheDir, `${cacheKey}.data`);
4230
+ const metaPath = join7(cacheDir, `${cacheKey}.meta`);
4231
+ const dataPath = join7(cacheDir, `${cacheKey}.data`);
4252
4232
  if (!existsSync8(metaPath) || !existsSync8(dataPath))
4253
4233
  return null;
4254
4234
  try {
4255
- const meta = JSON.parse(readFileSync6(metaPath, "utf-8"));
4256
- const buffer = readFileSync6(dataPath);
4235
+ const meta = JSON.parse(readFileSync5(metaPath, "utf-8"));
4236
+ const buffer = readFileSync5(dataPath);
4257
4237
  return { buffer, meta };
4258
4238
  } catch {
4259
4239
  return null;
@@ -4275,8 +4255,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
4275
4255
  return null;
4276
4256
  }
4277
4257
  }, writeToCache = (cacheDir, cacheKey, buffer, meta) => {
4278
- const metaPath = join6(cacheDir, `${cacheKey}.meta`);
4279
- const dataPath = join6(cacheDir, `${cacheKey}.data`);
4258
+ const metaPath = join7(cacheDir, `${cacheKey}.meta`);
4259
+ const dataPath = join7(cacheDir, `${cacheKey}.data`);
4280
4260
  writeFileSync4(dataPath, buffer);
4281
4261
  writeFileSync4(metaPath, JSON.stringify(meta));
4282
4262
  };
@@ -4368,14 +4348,14 @@ var init_optimizeHtmlImages = __esm(() => {
4368
4348
  });
4369
4349
 
4370
4350
  // src/cli/scripts/telemetry.ts
4371
- import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
4351
+ import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
4372
4352
  import { homedir } from "os";
4373
- import { join as join7 } from "path";
4353
+ import { join as join8 } from "path";
4374
4354
  var configDir, configPath, getTelemetryConfig = () => {
4375
4355
  try {
4376
4356
  if (!existsSync9(configPath))
4377
4357
  return null;
4378
- const raw = readFileSync7(configPath, "utf-8");
4358
+ const raw = readFileSync6(configPath, "utf-8");
4379
4359
  const config = JSON.parse(raw);
4380
4360
  return config;
4381
4361
  } catch {
@@ -4383,19 +4363,19 @@ var configDir, configPath, getTelemetryConfig = () => {
4383
4363
  }
4384
4364
  };
4385
4365
  var init_telemetry = __esm(() => {
4386
- configDir = join7(homedir(), ".absolutejs");
4387
- configPath = join7(configDir, "telemetry.json");
4366
+ configDir = join8(homedir(), ".absolutejs");
4367
+ configPath = join8(configDir, "telemetry.json");
4388
4368
  });
4389
4369
 
4390
4370
  // src/cli/telemetryEvent.ts
4391
- import { existsSync as existsSync10, readFileSync as readFileSync8 } from "fs";
4371
+ import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
4392
4372
  import { arch, platform } from "os";
4393
- import { dirname as dirname6, join as join8, parse } from "path";
4373
+ import { dirname as dirname6, join as join9, parse } from "path";
4394
4374
  var checkCandidate = (candidate) => {
4395
4375
  if (!existsSync10(candidate)) {
4396
4376
  return null;
4397
4377
  }
4398
- const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
4378
+ const pkg = JSON.parse(readFileSync7(candidate, "utf-8"));
4399
4379
  if (pkg.name === "@absolutejs/absolute") {
4400
4380
  const ver = pkg.version;
4401
4381
  return ver;
@@ -4410,7 +4390,7 @@ var checkCandidate = (candidate) => {
4410
4390
  }, findPackageVersion = () => {
4411
4391
  let { dir } = import.meta;
4412
4392
  while (dir !== parse(dir).root) {
4413
- const candidate = join8(dir, "package.json");
4393
+ const candidate = join9(dir, "package.json");
4414
4394
  const version = checkCandidate(candidate);
4415
4395
  if (version) {
4416
4396
  return version;
@@ -4702,8 +4682,8 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
4702
4682
  };
4703
4683
 
4704
4684
  // src/build/angularLinkerPlugin.ts
4705
- import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "fs";
4706
- import { dirname as dirname7, join as join9, relative as relative4, resolve as resolve13 } from "path";
4685
+ import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync8, writeFileSync as writeFileSync6 } from "fs";
4686
+ import { dirname as dirname7, join as join10, relative as relative4, resolve as resolve13 } from "path";
4707
4687
  import { createHash } from "crypto";
4708
4688
  var CACHE_DIR, angularLinkerPlugin;
4709
4689
  var init_angularLinkerPlugin = __esm(() => {
@@ -4726,10 +4706,10 @@ var init_angularLinkerPlugin = __esm(() => {
4726
4706
  return;
4727
4707
  }
4728
4708
  const hash = createHash("md5").update(source).digest("hex");
4729
- const cachePath = join9(CACHE_DIR, `${hash}.js`);
4709
+ const cachePath = join10(CACHE_DIR, `${hash}.js`);
4730
4710
  if (existsSync12(cachePath)) {
4731
4711
  return {
4732
- contents: readFileSync9(cachePath, "utf-8"),
4712
+ contents: readFileSync8(cachePath, "utf-8"),
4733
4713
  loader: "js"
4734
4714
  };
4735
4715
  }
@@ -4745,7 +4725,7 @@ var init_angularLinkerPlugin = __esm(() => {
4745
4725
  fileSystem: {
4746
4726
  dirname: dirname7,
4747
4727
  exists: existsSync12,
4748
- readFile: readFileSync9,
4728
+ readFile: readFileSync8,
4749
4729
  relative: relative4,
4750
4730
  resolve: resolve13
4751
4731
  },
@@ -4803,7 +4783,7 @@ var init_cleanStaleOutputs = __esm(() => {
4803
4783
 
4804
4784
  // src/utils/cleanup.ts
4805
4785
  import { rm as rm3 } from "fs/promises";
4806
- import { join as join10 } from "path";
4786
+ import { join as join11 } from "path";
4807
4787
  var cleanup = async ({
4808
4788
  angularDir,
4809
4789
  reactDir,
@@ -4811,19 +4791,19 @@ var cleanup = async ({
4811
4791
  vueDir
4812
4792
  }) => {
4813
4793
  await Promise.all([
4814
- angularDir ? rm3(join10(angularDir, "generated"), {
4794
+ angularDir ? rm3(join11(angularDir, "generated"), {
4815
4795
  force: true,
4816
4796
  recursive: true
4817
4797
  }) : undefined,
4818
- reactDir ? rm3(join10(reactDir, "generated"), {
4798
+ reactDir ? rm3(join11(reactDir, "generated"), {
4819
4799
  force: true,
4820
4800
  recursive: true
4821
4801
  }) : undefined,
4822
- svelteDir ? rm3(join10(svelteDir, "generated"), {
4802
+ svelteDir ? rm3(join11(svelteDir, "generated"), {
4823
4803
  force: true,
4824
4804
  recursive: true
4825
4805
  }) : undefined,
4826
- vueDir ? rm3(join10(vueDir, "generated"), {
4806
+ vueDir ? rm3(join11(vueDir, "generated"), {
4827
4807
  force: true,
4828
4808
  recursive: true
4829
4809
  }) : undefined
@@ -4926,7 +4906,7 @@ import { existsSync as existsSync13 } from "fs";
4926
4906
  import { mkdir as mkdir2, stat } from "fs/promises";
4927
4907
  import {
4928
4908
  dirname as dirname8,
4929
- join as join11,
4909
+ join as join12,
4930
4910
  basename as basename5,
4931
4911
  extname as extname5,
4932
4912
  resolve as resolve16,
@@ -4985,14 +4965,14 @@ var resolveDevClientDir2 = () => {
4985
4965
  `${basePath}.svelte`,
4986
4966
  `${basePath}.svelte.ts`,
4987
4967
  `${basePath}.svelte.js`,
4988
- join11(basePath, "index.ts"),
4989
- join11(basePath, "index.js"),
4990
- join11(basePath, "index.mjs"),
4991
- join11(basePath, "index.cjs"),
4992
- join11(basePath, "index.json"),
4993
- join11(basePath, "index.svelte"),
4994
- join11(basePath, "index.svelte.ts"),
4995
- join11(basePath, "index.svelte.js")
4968
+ join12(basePath, "index.ts"),
4969
+ join12(basePath, "index.js"),
4970
+ join12(basePath, "index.mjs"),
4971
+ join12(basePath, "index.cjs"),
4972
+ join12(basePath, "index.json"),
4973
+ join12(basePath, "index.svelte"),
4974
+ join12(basePath, "index.svelte.ts"),
4975
+ join12(basePath, "index.svelte.js")
4996
4976
  ];
4997
4977
  const checks = await Promise.all(candidates.map(exists));
4998
4978
  return candidates.find((_, index) => checks[index]) ?? null;
@@ -5030,10 +5010,10 @@ var resolveDevClientDir2 = () => {
5030
5010
  });
5031
5011
  }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false) => {
5032
5012
  const { compile, compileModule, preprocess } = await import("svelte/compiler");
5033
- const generatedDir = join11(svelteRoot, "generated");
5034
- const clientDir = join11(generatedDir, "client");
5035
- const indexDir = join11(generatedDir, "indexes");
5036
- const serverDir = join11(generatedDir, "server");
5013
+ const generatedDir = join12(svelteRoot, "generated");
5014
+ const clientDir = join12(generatedDir, "client");
5015
+ const indexDir = join12(generatedDir, "indexes");
5016
+ const serverDir = join12(generatedDir, "server");
5037
5017
  await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir2(dir, { recursive: true })));
5038
5018
  const dev = env2.NODE_ENV !== "production";
5039
5019
  const build2 = async (src) => {
@@ -5071,8 +5051,8 @@ var resolveDevClientDir2 = () => {
5071
5051
  const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
5072
5052
  const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
5073
5053
  const externalRewrites = new Map;
5074
- const ssrOutputDir = dirname8(join11(serverDir, relDir, `${baseName}.js`));
5075
- const clientOutputDir = dirname8(join11(clientDir, relDir, `${baseName}.js`));
5054
+ const ssrOutputDir = dirname8(join12(serverDir, relDir, `${baseName}.js`));
5055
+ const clientOutputDir = dirname8(join12(clientDir, relDir, `${baseName}.js`));
5076
5056
  for (let idx = 0;idx < importPaths.length; idx++) {
5077
5057
  const rawSpec = importPaths[idx];
5078
5058
  if (!rawSpec)
@@ -5138,8 +5118,8 @@ var resolveDevClientDir2 = () => {
5138
5118
  code += islandMetadataExports;
5139
5119
  return code;
5140
5120
  };
5141
- const ssrPath = join11(serverDir, relDir, `${baseName}.js`);
5142
- const clientPath = join11(clientDir, relDir, `${baseName}.js`);
5121
+ const ssrPath = join12(serverDir, relDir, `${baseName}.js`);
5122
+ const clientPath = join12(clientDir, relDir, `${baseName}.js`);
5143
5123
  await Promise.all([
5144
5124
  mkdir2(dirname8(ssrPath), { recursive: true }),
5145
5125
  mkdir2(dirname8(clientPath), { recursive: true })
@@ -5171,7 +5151,7 @@ var resolveDevClientDir2 = () => {
5171
5151
  await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
5172
5152
  const relClientDir = dirname8(relative6(clientDir, client2));
5173
5153
  const name = basename5(client2, extname5(client2));
5174
- const indexPath = join11(indexDir, relClientDir, `${name}.js`);
5154
+ const indexPath = join12(indexDir, relClientDir, `${name}.js`);
5175
5155
  const importRaw = relative6(dirname8(indexPath), client2).split(sep2).join("/");
5176
5156
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
5177
5157
  const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
@@ -5250,7 +5230,7 @@ if (typeof window !== "undefined") {
5250
5230
  svelteClientPaths: roots.map(({ client: client2 }) => client2),
5251
5231
  svelteIndexPaths: roots.map(({ client: client2 }) => {
5252
5232
  const rel = dirname8(relative6(clientDir, client2));
5253
- return join11(indexDir, rel, basename5(client2));
5233
+ return join12(indexDir, rel, basename5(client2));
5254
5234
  }),
5255
5235
  svelteServerPaths: roots.map(({ ssr }) => ssr)
5256
5236
  };
@@ -5264,7 +5244,7 @@ var init_compileSvelte = __esm(() => {
5264
5244
  init_lowerAwaitSlotSyntax();
5265
5245
  init_renderToReadableStream();
5266
5246
  devClientDir2 = resolveDevClientDir2();
5267
- hmrClientPath3 = join11(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
5247
+ hmrClientPath3 = join12(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
5268
5248
  persistentCache = new Map;
5269
5249
  sourceHashCache = new Map;
5270
5250
  transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
@@ -5281,7 +5261,7 @@ __export(exports_compileVue, {
5281
5261
  });
5282
5262
  import { existsSync as existsSync14 } from "fs";
5283
5263
  import { mkdir as mkdir3 } from "fs/promises";
5284
- import { basename as basename6, dirname as dirname9, join as join12, relative as relative7, resolve as resolve17 } from "path";
5264
+ import { basename as basename6, dirname as dirname9, join as join13, relative as relative7, resolve as resolve17 } from "path";
5285
5265
  var {file: file3, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
5286
5266
  var resolveDevClientDir3 = () => {
5287
5267
  const projectRoot = process.cwd();
@@ -5437,7 +5417,7 @@ var resolveDevClientDir3 = () => {
5437
5417
  ];
5438
5418
  let cssOutputPaths = [];
5439
5419
  if (isEntryPoint && allCss.length) {
5440
- const cssOutputFile = join12(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
5420
+ const cssOutputFile = join13(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
5441
5421
  await mkdir3(dirname9(cssOutputFile), { recursive: true });
5442
5422
  await write2(cssOutputFile, allCss.join(`
5443
5423
  `));
@@ -5468,8 +5448,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
5468
5448
  };
5469
5449
  const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
5470
5450
  const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
5471
- const clientOutputPath = join12(outputDirs.client, `${relativeWithoutExtension}.js`);
5472
- const serverOutputPath = join12(outputDirs.server, `${relativeWithoutExtension}.js`);
5451
+ const clientOutputPath = join13(outputDirs.client, `${relativeWithoutExtension}.js`);
5452
+ const serverOutputPath = join13(outputDirs.server, `${relativeWithoutExtension}.js`);
5473
5453
  const relDir = dirname9(relativeFilePath);
5474
5454
  const relDepth = relDir === "." ? 0 : relDir.split("/").length;
5475
5455
  const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_, prefix, dots) => {
@@ -5509,11 +5489,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
5509
5489
  return result;
5510
5490
  }, compileVue = async (entryPoints, vueRootDir, isDev2 = false) => {
5511
5491
  const compiler = await import("@vue/compiler-sfc");
5512
- const generatedDir = join12(vueRootDir, "generated");
5513
- const clientOutputDir = join12(generatedDir, "client");
5514
- const indexOutputDir = join12(generatedDir, "indexes");
5515
- const serverOutputDir = join12(generatedDir, "server");
5516
- const cssOutputDir = join12(generatedDir, "compiled");
5492
+ const generatedDir = join13(vueRootDir, "generated");
5493
+ const clientOutputDir = join13(generatedDir, "client");
5494
+ const indexOutputDir = join13(generatedDir, "indexes");
5495
+ const serverOutputDir = join13(generatedDir, "server");
5496
+ const cssOutputDir = join13(generatedDir, "compiled");
5517
5497
  await Promise.all([
5518
5498
  mkdir3(clientOutputDir, { recursive: true }),
5519
5499
  mkdir3(indexOutputDir, { recursive: true }),
@@ -5530,8 +5510,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
5530
5510
  }, buildCache, true, vueRootDir, compiler);
5531
5511
  result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
5532
5512
  const entryBaseName = basename6(entryPath, ".vue");
5533
- const indexOutputFile = join12(indexOutputDir, `${entryBaseName}.js`);
5534
- const clientOutputFile = join12(clientOutputDir, relative7(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
5513
+ const indexOutputFile = join13(indexOutputDir, `${entryBaseName}.js`);
5514
+ const clientOutputFile = join13(clientOutputDir, relative7(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
5535
5515
  await mkdir3(dirname9(indexOutputFile), { recursive: true });
5536
5516
  const vueHmrImports = isDev2 ? [
5537
5517
  `window.__HMR_FRAMEWORK__ = "vue";`,
@@ -5660,8 +5640,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
5660
5640
  const sourceCode = await file3(tsPath).text();
5661
5641
  const transpiledCode = transpiler3.transformSync(sourceCode);
5662
5642
  const relativeJsPath = relative7(vueRootDir, tsPath).replace(/\.ts$/, ".js");
5663
- const outClientPath = join12(clientOutputDir, relativeJsPath);
5664
- const outServerPath = join12(serverOutputDir, relativeJsPath);
5643
+ const outClientPath = join13(clientOutputDir, relativeJsPath);
5644
+ const outServerPath = join13(serverOutputDir, relativeJsPath);
5665
5645
  await mkdir3(dirname9(outClientPath), { recursive: true });
5666
5646
  await mkdir3(dirname9(outServerPath), { recursive: true });
5667
5647
  await write2(outClientPath, transpiledCode);
@@ -5681,7 +5661,7 @@ var init_compileVue = __esm(() => {
5681
5661
  init_sourceMetadata();
5682
5662
  init_stylePreprocessor();
5683
5663
  devClientDir3 = resolveDevClientDir3();
5684
- hmrClientPath4 = join12(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
5664
+ hmrClientPath4 = join13(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
5685
5665
  transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
5686
5666
  scriptCache = new Map;
5687
5667
  scriptSetupCache = new Map;
@@ -6160,13 +6140,13 @@ __export(exports_compileAngular, {
6160
6140
  compileAngularFile: () => compileAngularFile,
6161
6141
  compileAngular: () => compileAngular
6162
6142
  });
6163
- import { existsSync as existsSync15, readFileSync as readFileSync10, promises as fs } from "fs";
6164
- import { join as join13, basename as basename7, sep as sep3, dirname as dirname10, resolve as resolve18, relative as relative8 } from "path";
6143
+ import { existsSync as existsSync15, readFileSync as readFileSync9, promises as fs } from "fs";
6144
+ import { join as join14, basename as basename7, sep as sep3, dirname as dirname10, resolve as resolve18, relative as relative8 } from "path";
6165
6145
  import ts2 from "typescript";
6166
6146
  import { createHash as createHash2 } from "crypto";
6167
6147
  var computeConfigHash = () => {
6168
6148
  try {
6169
- const content = readFileSync10("./tsconfig.json", "utf-8");
6149
+ const content = readFileSync9("./tsconfig.json", "utf-8");
6170
6150
  return createHash2("md5").update(content).digest("hex");
6171
6151
  } catch {
6172
6152
  return "";
@@ -6223,8 +6203,70 @@ ${registrations}
6223
6203
  if (fileName.startsWith(outDir))
6224
6204
  return fileName.substring(outDir.length + 1);
6225
6205
  return fileName;
6206
+ }, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
6207
+ const sourceFile = ts2.createSourceFile(fileName, source, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TS);
6208
+ const specifiers = [];
6209
+ const addSpecifier = (node) => {
6210
+ if (!node || !ts2.isStringLiteralLike(node))
6211
+ return;
6212
+ const specifier = node.text;
6213
+ if (isRelativeModuleSpecifier(specifier))
6214
+ specifiers.push(specifier);
6215
+ };
6216
+ const visit = (node) => {
6217
+ if (ts2.isImportDeclaration(node) || ts2.isExportDeclaration(node)) {
6218
+ addSpecifier(node.moduleSpecifier);
6219
+ } else if (ts2.isCallExpression(node) && node.expression.kind === ts2.SyntaxKind.ImportKeyword) {
6220
+ addSpecifier(node.arguments[0]);
6221
+ }
6222
+ ts2.forEachChild(node, visit);
6223
+ };
6224
+ visit(sourceFile);
6225
+ return specifiers;
6226
+ }, resolveLocalTsImport = (fromFile, specifier) => {
6227
+ if (!isRelativeModuleSpecifier(specifier))
6228
+ return null;
6229
+ const basePath = resolve18(dirname10(fromFile), specifier);
6230
+ const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
6231
+ `${basePath}.ts`,
6232
+ `${basePath}.tsx`,
6233
+ `${basePath}.mts`,
6234
+ `${basePath}.cts`,
6235
+ join14(basePath, "index.ts"),
6236
+ join14(basePath, "index.tsx"),
6237
+ join14(basePath, "index.mts"),
6238
+ join14(basePath, "index.cts")
6239
+ ];
6240
+ return candidates.map((candidate) => resolve18(candidate)).find((candidate) => existsSync15(candidate) && !candidate.endsWith(".d.ts")) ?? null;
6241
+ }, readFileForAotTransform = async (fileName, readFile4) => {
6242
+ const hostSource = readFile4?.(fileName);
6243
+ if (typeof hostSource === "string")
6244
+ return hostSource;
6245
+ return fs.readFile(fileName, "utf-8");
6246
+ }, precomputeAotResourceTransforms = async (inputPath, readFile4) => {
6247
+ const transformedSources = new Map;
6248
+ const visited = new Set;
6249
+ const transformFile = async (filePath) => {
6250
+ const resolvedPath = resolve18(filePath);
6251
+ if (visited.has(resolvedPath))
6252
+ return;
6253
+ visited.add(resolvedPath);
6254
+ if (!existsSync15(resolvedPath) || resolvedPath.endsWith(".d.ts"))
6255
+ return;
6256
+ const source = await readFileForAotTransform(resolvedPath, readFile4);
6257
+ const transformed = await inlineResources(source, dirname10(resolvedPath));
6258
+ transformedSources.set(resolvedPath, transformed.source);
6259
+ const imports = extractLocalImportSpecifiers(source, resolvedPath);
6260
+ await Promise.all(imports.map(async (specifier) => {
6261
+ const resolvedImport = resolveLocalTsImport(resolvedPath, specifier);
6262
+ if (resolvedImport)
6263
+ await transformFile(resolvedImport);
6264
+ }));
6265
+ };
6266
+ await transformFile(inputPath);
6267
+ return transformedSources;
6226
6268
  }, compileAngularFile = async (inputPath, outDir) => {
6227
- const islandMetadataExports = buildIslandMetadataExports(readFileSync10(inputPath, "utf-8"));
6269
+ const islandMetadataExports = buildIslandMetadataExports(readFileSync9(inputPath, "utf-8"));
6228
6270
  const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
6229
6271
  const configHash = computeConfigHash();
6230
6272
  const cached = globalThis.__angularCompilerCache;
@@ -6272,7 +6314,7 @@ ${registrations}
6272
6314
  const originalGetSourceFile = host.getSourceFile;
6273
6315
  host.getSourceFile = (fileName, languageVersion, onError) => {
6274
6316
  if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
6275
- const resolvedPath = join13(tsLibDir, fileName);
6317
+ const resolvedPath = join14(tsLibDir, fileName);
6276
6318
  return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
6277
6319
  }
6278
6320
  return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
@@ -6292,7 +6334,7 @@ ${registrations}
6292
6334
  emitted[relativePath] = text;
6293
6335
  };
6294
6336
  const originalReadFile = host.readFile;
6295
- const aotTransformCache = new Map;
6337
+ const aotTransformedSources = await precomputeAotResourceTransforms(inputPath, originalReadFile?.bind(host));
6296
6338
  host.readFile = (fileName) => {
6297
6339
  const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
6298
6340
  if (typeof source !== "string")
@@ -6301,12 +6343,7 @@ ${registrations}
6301
6343
  return source;
6302
6344
  }
6303
6345
  const resolvedPath = resolve18(fileName);
6304
- const cached2 = aotTransformCache.get(resolvedPath);
6305
- if (cached2 !== undefined)
6306
- return cached2;
6307
- const transformed = inlineResourcesSync(source, dirname10(resolvedPath)).source;
6308
- aotTransformCache.set(resolvedPath, transformed);
6309
- return transformed;
6346
+ return aotTransformedSources.get(resolvedPath) ?? source;
6310
6347
  };
6311
6348
  const originalGetSourceFileForCompile = host.getSourceFile;
6312
6349
  host.getSourceFile = (fileName, languageVersion, onError) => {
@@ -6330,7 +6367,7 @@ ${registrations}
6330
6367
  }
6331
6368
  throwOnCompilationErrors(diagnostics);
6332
6369
  const entries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => {
6333
- const target = join13(outDir, fileName);
6370
+ const target = join14(outDir, fileName);
6334
6371
  let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
6335
6372
  if (!path.match(/\.(js|ts|mjs|cjs)$/)) {
6336
6373
  return `from ${quote}${path}.js${quote}`;
@@ -6486,7 +6523,7 @@ ${fields}
6486
6523
  }, inlineTemplateAndLowerDefer = async (source, fileDir) => {
6487
6524
  const templateUrlMatch = source.match(/templateUrl\s*:\s*['"]([^'"]+)['"]/);
6488
6525
  if (templateUrlMatch?.[1]) {
6489
- const templatePath = join13(fileDir, templateUrlMatch[1]);
6526
+ const templatePath = join14(fileDir, templateUrlMatch[1]);
6490
6527
  if (!existsSync15(templatePath)) {
6491
6528
  return { deferSlots: [], source };
6492
6529
  }
@@ -6517,11 +6554,11 @@ ${fields}
6517
6554
  }, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
6518
6555
  const templateUrlMatch = source.match(/templateUrl\s*:\s*['"]([^'"]+)['"]/);
6519
6556
  if (templateUrlMatch?.[1]) {
6520
- const templatePath = join13(fileDir, templateUrlMatch[1]);
6557
+ const templatePath = join14(fileDir, templateUrlMatch[1]);
6521
6558
  if (!existsSync15(templatePath)) {
6522
6559
  return { deferSlots: [], source };
6523
6560
  }
6524
- const templateRaw2 = readFileSync10(templatePath, "utf-8");
6561
+ const templateRaw2 = readFileSync9(templatePath, "utf-8");
6525
6562
  const lowered2 = lowerAngularDeferSyntax(templateRaw2);
6526
6563
  const escaped2 = escapeTemplateContent(lowered2.template);
6527
6564
  const replacedSource2 = source.replace(/templateUrl\s*:\s*['"][^'"]+['"]/, `template: \`${escaped2}\``);
@@ -6545,42 +6582,6 @@ ${fields}
6545
6582
  deferSlots: lowered.slots,
6546
6583
  source: injectDeferSlotFields(replacedSource, lowered.slots, resolveAngularDeferImportSpecifier())
6547
6584
  };
6548
- }, readAndEscapeFileSync = (filePath) => {
6549
- if (!existsSync15(filePath))
6550
- return null;
6551
- const content = compileStyleFileIfNeededSync(filePath);
6552
- return escapeTemplateContent(content);
6553
- }, inlineStyleUrlsSync = (source, fileDir) => {
6554
- const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
6555
- if (!styleUrlsMatch?.[1])
6556
- return source;
6557
- const urlMatches = styleUrlsMatch[1].match(/['"]([^'"]+)['"]/g);
6558
- if (!urlMatches)
6559
- return source;
6560
- const inlinedStyles = urlMatches.map((urlMatch) => {
6561
- const styleUrl = urlMatch.replace(/['"]/g, "");
6562
- return readAndEscapeFileSync(join13(fileDir, styleUrl));
6563
- }).filter(Boolean).map((escaped) => `\`${escaped}\``);
6564
- if (inlinedStyles.length === 0)
6565
- return source;
6566
- return source.replace(/styleUrls\s*:\s*\[[^\]]+\]/, `styles: [${inlinedStyles.join(", ")}]`);
6567
- }, inlineSingleStyleUrlSync = (source, fileDir) => {
6568
- const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
6569
- if (!styleUrlMatch?.[1])
6570
- return source;
6571
- const escaped = readAndEscapeFileSync(join13(fileDir, styleUrlMatch[1]));
6572
- if (!escaped)
6573
- return source;
6574
- return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
6575
- }, inlineResourcesSync = (source, fileDir) => {
6576
- const inlinedTemplate = inlineTemplateAndLowerDeferSync(source, fileDir);
6577
- let result = inlinedTemplate.source;
6578
- result = inlineStyleUrlsSync(result, fileDir);
6579
- result = inlineSingleStyleUrlSync(result, fileDir);
6580
- return {
6581
- deferSlots: inlinedTemplate.deferSlots,
6582
- source: result
6583
- };
6584
6585
  }, inlineStyleUrls = async (source, fileDir) => {
6585
6586
  const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
6586
6587
  if (!styleUrlsMatch?.[1])
@@ -6590,7 +6591,7 @@ ${fields}
6590
6591
  return source;
6591
6592
  const stylePromises = urlMatches.map((urlMatch) => {
6592
6593
  const styleUrl = urlMatch.replace(/['"]/g, "");
6593
- return readAndEscapeFile(join13(fileDir, styleUrl));
6594
+ return readAndEscapeFile(join14(fileDir, styleUrl));
6594
6595
  });
6595
6596
  const results = await Promise.all(stylePromises);
6596
6597
  const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
@@ -6601,7 +6602,7 @@ ${fields}
6601
6602
  const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
6602
6603
  if (!styleUrlMatch?.[1])
6603
6604
  return source;
6604
- const escaped = await readAndEscapeFile(join13(fileDir, styleUrlMatch[1]));
6605
+ const escaped = await readAndEscapeFile(join14(fileDir, styleUrlMatch[1]));
6605
6606
  if (!escaped)
6606
6607
  return source;
6607
6608
  return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
@@ -6676,8 +6677,8 @@ ${fields}
6676
6677
  const inputDir = dirname10(actualPath);
6677
6678
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
6678
6679
  const fileBase = basename7(actualPath).replace(/\.ts$/, ".js");
6679
- const targetDir = join13(outDir, relativeDir);
6680
- const targetPath = join13(targetDir, fileBase);
6680
+ const targetDir = join14(outDir, relativeDir);
6681
+ const targetPath = join14(targetDir, fileBase);
6681
6682
  const localImports = [];
6682
6683
  const fromRegex = /(?:from|import)\s+['"](\.\.?\/[^'"]+)['"]/g;
6683
6684
  const dynamicImportRegex = /import\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g;
@@ -6710,13 +6711,13 @@ ${fields}
6710
6711
  await transpileFile(inputPath);
6711
6712
  return allOutputs;
6712
6713
  }, compileAngular = async (entryPoints, outRoot, hmr = false) => {
6713
- const compiledParent = join13(outRoot, "generated");
6714
+ const compiledParent = join14(outRoot, "generated");
6714
6715
  if (entryPoints.length === 0) {
6715
6716
  const emptyPaths = [];
6716
6717
  return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
6717
6718
  }
6718
6719
  const compiledRoot = compiledParent;
6719
- const indexesDir = join13(compiledParent, "indexes");
6720
+ const indexesDir = join14(compiledParent, "indexes");
6720
6721
  await fs.mkdir(indexesDir, { recursive: true });
6721
6722
  const compileTasks = entryPoints.map(async (entry) => {
6722
6723
  const resolvedEntry = resolve18(entry);
@@ -6726,9 +6727,9 @@ ${fields}
6726
6727
  const fileBase = basename7(resolvedEntry).replace(/\.[tj]s$/, "");
6727
6728
  const jsName = `${fileBase}.js`;
6728
6729
  const compiledFallbackPaths = [
6729
- join13(compiledRoot, relativeEntry),
6730
- join13(compiledRoot, "pages", jsName),
6731
- join13(compiledRoot, jsName)
6730
+ join14(compiledRoot, relativeEntry),
6731
+ join14(compiledRoot, "pages", jsName),
6732
+ join14(compiledRoot, jsName)
6732
6733
  ].map((file4) => resolve18(file4));
6733
6734
  const resolveRawServerFile = (candidatePaths) => {
6734
6735
  const normalizedCandidates = [
@@ -6762,7 +6763,7 @@ ${fields}
6762
6763
  const componentClassName = `${toPascal(fileBase)}Component`;
6763
6764
  const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
6764
6765
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
6765
- const clientFile = join13(indexesDir, jsName);
6766
+ const clientFile = join14(indexesDir, jsName);
6766
6767
  if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync15(clientFile)) {
6767
6768
  return {
6768
6769
  clientPath: clientFile,
@@ -6950,8 +6951,8 @@ var init_compileAngular = __esm(() => {
6950
6951
  init_lowerDeferSyntax();
6951
6952
  init_stylePreprocessor();
6952
6953
  devClientDir4 = resolveDevClientDir4();
6953
- hmrClientPath5 = join13(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
6954
- hmrRuntimePath = join13(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
6954
+ hmrClientPath5 = join14(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
6955
+ hmrRuntimePath = join14(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
6955
6956
  jitContentCache = new Map;
6956
6957
  wrapperOutputCache = new Map;
6957
6958
  });
@@ -6963,7 +6964,7 @@ __export(exports_buildReactVendor, {
6963
6964
  buildReactVendor: () => buildReactVendor
6964
6965
  });
6965
6966
  import { existsSync as existsSync16, mkdirSync as mkdirSync6 } from "fs";
6966
- import { join as join14, resolve as resolve19 } from "path";
6967
+ import { join as join15, resolve as resolve19 } from "path";
6967
6968
  import { rm as rm4 } from "fs/promises";
6968
6969
  var {build: bunBuild2 } = globalThis.Bun;
6969
6970
  var resolveJsxDevRuntimeCompatPath = () => {
@@ -7017,14 +7018,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
7017
7018
  `)}
7018
7019
  `;
7019
7020
  }, buildReactVendor = async (buildDir) => {
7020
- const vendorDir = join14(buildDir, "react", "vendor");
7021
+ const vendorDir = join15(buildDir, "react", "vendor");
7021
7022
  mkdirSync6(vendorDir, { recursive: true });
7022
- const tmpDir = join14(buildDir, "_vendor_tmp");
7023
+ const tmpDir = join15(buildDir, "_vendor_tmp");
7023
7024
  mkdirSync6(tmpDir, { recursive: true });
7024
7025
  const specifiers = resolveVendorSpecifiers();
7025
7026
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
7026
7027
  const safeName = toSafeFileName(specifier);
7027
- const entryPath = join14(tmpDir, `${safeName}.ts`);
7028
+ const entryPath = join15(tmpDir, `${safeName}.ts`);
7028
7029
  const source = await generateEntrySource(specifier);
7029
7030
  await Bun.write(entryPath, source);
7030
7031
  return entryPath;
@@ -7062,17 +7063,17 @@ __export(exports_buildAngularVendor, {
7062
7063
  buildAngularVendor: () => buildAngularVendor
7063
7064
  });
7064
7065
  import { mkdirSync as mkdirSync7 } from "fs";
7065
- import { join as join15 } from "path";
7066
+ import { join as join16 } from "path";
7066
7067
  import { rm as rm5 } from "fs/promises";
7067
7068
  var {build: bunBuild3 } = globalThis.Bun;
7068
7069
  var angularSpecifiers, toSafeFileName2 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), buildAngularVendor = async (buildDir) => {
7069
- const vendorDir = join15(buildDir, "angular", "vendor");
7070
+ const vendorDir = join16(buildDir, "angular", "vendor");
7070
7071
  mkdirSync7(vendorDir, { recursive: true });
7071
- const tmpDir = join15(buildDir, "_angular_vendor_tmp");
7072
+ const tmpDir = join16(buildDir, "_angular_vendor_tmp");
7072
7073
  mkdirSync7(tmpDir, { recursive: true });
7073
7074
  const entrypoints = await Promise.all(angularSpecifiers.map(async (specifier) => {
7074
7075
  const safeName = toSafeFileName2(specifier);
7075
- const entryPath = join15(tmpDir, `${safeName}.ts`);
7076
+ const entryPath = join16(tmpDir, `${safeName}.ts`);
7076
7077
  await Bun.write(entryPath, `export * from '${specifier}';
7077
7078
  `);
7078
7079
  return entryPath;
@@ -7117,17 +7118,17 @@ __export(exports_buildVueVendor, {
7117
7118
  buildVueVendor: () => buildVueVendor
7118
7119
  });
7119
7120
  import { mkdirSync as mkdirSync8 } from "fs";
7120
- import { join as join16 } from "path";
7121
+ import { join as join17 } from "path";
7121
7122
  import { rm as rm6 } from "fs/promises";
7122
7123
  var {build: bunBuild4 } = globalThis.Bun;
7123
7124
  var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
7124
- const vendorDir = join16(buildDir, "vue", "vendor");
7125
+ const vendorDir = join17(buildDir, "vue", "vendor");
7125
7126
  mkdirSync8(vendorDir, { recursive: true });
7126
- const tmpDir = join16(buildDir, "_vue_vendor_tmp");
7127
+ const tmpDir = join17(buildDir, "_vue_vendor_tmp");
7127
7128
  mkdirSync8(tmpDir, { recursive: true });
7128
7129
  const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
7129
7130
  const safeName = toSafeFileName3(specifier);
7130
- const entryPath = join16(tmpDir, `${safeName}.ts`);
7131
+ const entryPath = join17(tmpDir, `${safeName}.ts`);
7131
7132
  await Bun.write(entryPath, `export * from '${specifier}';
7132
7133
  `);
7133
7134
  return entryPath;
@@ -7152,11 +7153,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
7152
7153
  console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
7153
7154
  return;
7154
7155
  }
7155
- const { readFileSync: readFileSync11, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
7156
+ const { readFileSync: readFileSync10, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
7156
7157
  const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
7157
7158
  for (const file4 of files) {
7158
- const filePath = join16(vendorDir, file4);
7159
- const content = readFileSync11(filePath, "utf-8");
7159
+ const filePath = join17(vendorDir, file4);
7160
+ const content = readFileSync10(filePath, "utf-8");
7160
7161
  if (!content.includes("__VUE_HMR_RUNTIME__"))
7161
7162
  continue;
7162
7163
  const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
@@ -7182,7 +7183,7 @@ __export(exports_buildSvelteVendor, {
7182
7183
  buildSvelteVendor: () => buildSvelteVendor
7183
7184
  });
7184
7185
  import { mkdirSync as mkdirSync9 } from "fs";
7185
- import { join as join17 } from "path";
7186
+ import { join as join18 } from "path";
7186
7187
  import { rm as rm7 } from "fs/promises";
7187
7188
  var {build: bunBuild5 } = globalThis.Bun;
7188
7189
  var svelteSpecifiers, isResolvable2 = (specifier) => {
@@ -7196,13 +7197,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
7196
7197
  const specifiers = resolveVendorSpecifiers2();
7197
7198
  if (specifiers.length === 0)
7198
7199
  return;
7199
- const vendorDir = join17(buildDir, "svelte", "vendor");
7200
+ const vendorDir = join18(buildDir, "svelte", "vendor");
7200
7201
  mkdirSync9(vendorDir, { recursive: true });
7201
- const tmpDir = join17(buildDir, "_svelte_vendor_tmp");
7202
+ const tmpDir = join18(buildDir, "_svelte_vendor_tmp");
7202
7203
  mkdirSync9(tmpDir, { recursive: true });
7203
7204
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
7204
7205
  const safeName = toSafeFileName4(specifier);
7205
- const entryPath = join17(tmpDir, `${safeName}.ts`);
7206
+ const entryPath = join18(tmpDir, `${safeName}.ts`);
7206
7207
  await Bun.write(entryPath, `export * from '${specifier}';
7207
7208
  `);
7208
7209
  return entryPath;
@@ -7281,12 +7282,12 @@ import {
7281
7282
  cpSync,
7282
7283
  existsSync as existsSync17,
7283
7284
  mkdirSync as mkdirSync10,
7284
- readFileSync as readFileSync11,
7285
+ readFileSync as readFileSync10,
7285
7286
  rmSync as rmSync2,
7286
7287
  statSync,
7287
7288
  writeFileSync as writeFileSync7
7288
7289
  } from "fs";
7289
- import { basename as basename8, dirname as dirname11, join as join18, relative as relative9, resolve as resolve20 } from "path";
7290
+ import { basename as basename8, dirname as dirname11, join as join19, relative as relative9, resolve as resolve20 } from "path";
7290
7291
  import { cwd, env as env3, exit } from "process";
7291
7292
  var {build: bunBuild6, Glob: Glob6 } = globalThis.Bun;
7292
7293
  var isDev2, collectConventionSourceFiles = (entry) => {
@@ -7361,8 +7362,8 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7361
7362
  mkdirSync10(htmxDestDir, { recursive: true });
7362
7363
  const glob = new Glob6("htmx*.min.js");
7363
7364
  for (const relPath of glob.scanSync({ cwd: htmxDir })) {
7364
- const src = join18(htmxDir, relPath);
7365
- const dest = join18(htmxDestDir, "htmx.min.js");
7365
+ const src = join19(htmxDir, relPath);
7366
+ const dest = join19(htmxDestDir, "htmx.min.js");
7366
7367
  copyFileSync(src, dest);
7367
7368
  return;
7368
7369
  }
@@ -7402,7 +7403,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7402
7403
  addWorkerPathIfExists(file4, relPath, workerPaths);
7403
7404
  }
7404
7405
  }, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
7405
- const content = readFileSync11(file4, "utf-8");
7406
+ const content = readFileSync10(file4, "utf-8");
7406
7407
  for (const pattern of patterns) {
7407
7408
  collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
7408
7409
  }
@@ -7435,7 +7436,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7435
7436
  vuePagesPath
7436
7437
  }) => {
7437
7438
  const { readdirSync: readDir } = await import("fs");
7438
- const devIndexDir = join18(buildPath, "_src_indexes");
7439
+ const devIndexDir = join19(buildPath, "_src_indexes");
7439
7440
  mkdirSync10(devIndexDir, { recursive: true });
7440
7441
  if (reactIndexesPath && reactPagesPath) {
7441
7442
  copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
@@ -7453,35 +7454,35 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7453
7454
  const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
7454
7455
  const pagesRel = relative9(process.cwd(), resolve20(reactPagesPath)).replace(/\\/g, "/");
7455
7456
  for (const file4 of indexFiles) {
7456
- let content = readFileSync11(join18(reactIndexesPath, file4), "utf-8");
7457
+ let content = readFileSync10(join19(reactIndexesPath, file4), "utf-8");
7457
7458
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
7458
- writeFileSync7(join18(devIndexDir, file4), content);
7459
+ writeFileSync7(join19(devIndexDir, file4), content);
7459
7460
  }
7460
7461
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
7461
- const svelteIndexDir = join18(svelteDir, "generated", "indexes");
7462
+ const svelteIndexDir = join19(svelteDir, "generated", "indexes");
7462
7463
  const sveltePageEntries = svelteEntries.filter((file4) => resolve20(file4).startsWith(resolve20(sveltePagesPath)));
7463
7464
  for (const entry of sveltePageEntries) {
7464
7465
  const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
7465
- const indexFile = join18(svelteIndexDir, "pages", `${name}.js`);
7466
+ const indexFile = join19(svelteIndexDir, "pages", `${name}.js`);
7466
7467
  if (!existsSync17(indexFile))
7467
7468
  continue;
7468
- let content = readFileSync11(indexFile, "utf-8");
7469
+ let content = readFileSync10(indexFile, "utf-8");
7469
7470
  const srcRel = relative9(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
7470
7471
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
7471
- writeFileSync7(join18(devIndexDir, `${name}.svelte.js`), content);
7472
+ writeFileSync7(join19(devIndexDir, `${name}.svelte.js`), content);
7472
7473
  }
7473
7474
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
7474
- const vueIndexDir = join18(vueDir, "generated", "indexes");
7475
+ const vueIndexDir = join19(vueDir, "generated", "indexes");
7475
7476
  const vuePageEntries = vueEntries.filter((file4) => resolve20(file4).startsWith(resolve20(vuePagesPath)));
7476
7477
  for (const entry of vuePageEntries) {
7477
7478
  const name = basename8(entry, ".vue");
7478
- const indexFile = join18(vueIndexDir, `${name}.js`);
7479
+ const indexFile = join19(vueIndexDir, `${name}.js`);
7479
7480
  if (!existsSync17(indexFile))
7480
7481
  continue;
7481
- let content = readFileSync11(indexFile, "utf-8");
7482
+ let content = readFileSync10(indexFile, "utf-8");
7482
7483
  const srcRel = relative9(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
7483
7484
  content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
7484
- writeFileSync7(join18(devIndexDir, `${name}.vue.js`), content);
7485
+ writeFileSync7(join19(devIndexDir, `${name}.vue.js`), content);
7485
7486
  }
7486
7487
  }, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
7487
7488
  const varIdx = content.indexOf(`var ${firstUseName} =`);
@@ -7529,7 +7530,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7529
7530
  }
7530
7531
  return result;
7531
7532
  }, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
7532
- let content = readFileSync11(outputPath, "utf-8");
7533
+ let content = readFileSync10(outputPath, "utf-8");
7533
7534
  const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
7534
7535
  const useNames = [];
7535
7536
  let match;
@@ -7579,7 +7580,7 @@ ${content.slice(firstUseIdx)}`;
7579
7580
  }, rewriteUrlReferences = (outputPaths, urlFileMap) => {
7580
7581
  const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
7581
7582
  for (const outputPath of outputPaths) {
7582
- let content = readFileSync11(outputPath, "utf-8");
7583
+ let content = readFileSync10(outputPath, "utf-8");
7583
7584
  let changed = false;
7584
7585
  content = content.replace(urlPattern, (_match, relPath) => {
7585
7586
  const targetName = basename8(relPath);
@@ -7629,14 +7630,14 @@ ${content.slice(firstUseIdx)}`;
7629
7630
  const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
7630
7631
  const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
7631
7632
  const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
7632
- const reactIndexesPath = reactDir && join18(reactDir, "generated", "indexes");
7633
- const reactPagesPath = reactDir && join18(reactDir, "pages");
7634
- const htmlPagesPath = htmlDir && join18(htmlDir, "pages");
7635
- const htmlScriptsPath = htmlDir && join18(htmlDir, "scripts");
7636
- const sveltePagesPath = svelteDir && join18(svelteDir, "pages");
7637
- const vuePagesPath = vueDir && join18(vueDir, "pages");
7638
- const htmxPagesPath = htmxDir && join18(htmxDir, "pages");
7639
- const angularPagesPath = angularDir && join18(angularDir, "pages");
7633
+ const reactIndexesPath = reactDir && join19(reactDir, "generated", "indexes");
7634
+ const reactPagesPath = reactDir && join19(reactDir, "pages");
7635
+ const htmlPagesPath = htmlDir && join19(htmlDir, "pages");
7636
+ const htmlScriptsPath = htmlDir && join19(htmlDir, "scripts");
7637
+ const sveltePagesPath = svelteDir && join19(svelteDir, "pages");
7638
+ const vuePagesPath = vueDir && join19(vueDir, "pages");
7639
+ const htmxPagesPath = htmxDir && join19(htmxDir, "pages");
7640
+ const angularPagesPath = angularDir && join19(angularDir, "pages");
7640
7641
  const frontends = [
7641
7642
  reactDir,
7642
7643
  htmlDir,
@@ -7673,12 +7674,12 @@ ${content.slice(firstUseIdx)}`;
7673
7674
  if (svelteDir)
7674
7675
  serverDirMap.push({
7675
7676
  dir: svelteDir,
7676
- subdir: join18("generated", "server")
7677
+ subdir: join19("generated", "server")
7677
7678
  });
7678
7679
  if (vueDir)
7679
7680
  serverDirMap.push({
7680
7681
  dir: vueDir,
7681
- subdir: join18("generated", "server")
7682
+ subdir: join19("generated", "server")
7682
7683
  });
7683
7684
  if (angularDir)
7684
7685
  serverDirMap.push({ dir: angularDir, subdir: "generated" });
@@ -7688,8 +7689,8 @@ ${content.slice(firstUseIdx)}`;
7688
7689
  const [firstEntry] = serverDirMap;
7689
7690
  if (!firstEntry)
7690
7691
  throw new Error("Expected at least one server directory entry");
7691
- serverRoot = join18(firstEntry.dir, firstEntry.subdir);
7692
- serverOutDir = join18(buildPath, basename8(firstEntry.dir));
7692
+ serverRoot = join19(firstEntry.dir, firstEntry.subdir);
7693
+ serverOutDir = join19(buildPath, basename8(firstEntry.dir));
7693
7694
  } else if (serverDirMap.length > 1) {
7694
7695
  serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
7695
7696
  serverOutDir = buildPath;
@@ -7717,7 +7718,7 @@ ${content.slice(firstUseIdx)}`;
7717
7718
  await generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr);
7718
7719
  }
7719
7720
  if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/assets/")))) {
7720
- cpSync(assetsPath, join18(buildPath, "assets"), {
7721
+ cpSync(assetsPath, join19(buildPath, "assets"), {
7721
7722
  force: true,
7722
7723
  recursive: true
7723
7724
  });
@@ -7731,7 +7732,7 @@ ${content.slice(firstUseIdx)}`;
7731
7732
  } catch {
7732
7733
  binPath = "tailwindcss";
7733
7734
  }
7734
- const proc = Bun.spawn(["bun", binPath, "-i", input, "-o", join18(buildPath, output)], { stderr: "pipe", stdout: "pipe" });
7735
+ const proc = Bun.spawn(["bun", binPath, "-i", input, "-o", join19(buildPath, output)], { stderr: "pipe", stdout: "pipe" });
7735
7736
  await proc.exited;
7736
7737
  };
7737
7738
  const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isStylePath)) ? compileTailwind(tailwind.input, tailwind.output) : undefined;
@@ -7778,7 +7779,7 @@ ${content.slice(firstUseIdx)}`;
7778
7779
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
7779
7780
  if (entry.startsWith(resolve20(reactIndexesPath))) {
7780
7781
  const pageName = basename8(entry, ".tsx");
7781
- return join18(reactPagesPath, `${pageName}.tsx`);
7782
+ return join19(reactPagesPath, `${pageName}.tsx`);
7782
7783
  }
7783
7784
  return null;
7784
7785
  }) : allReactEntries;
@@ -7865,11 +7866,11 @@ ${content.slice(firstUseIdx)}`;
7865
7866
  vueConventionSources.length > 0 && vueDir ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false)) : { vueServerPaths: emptyStringArray }
7866
7867
  ]);
7867
7868
  const copyConventionFiles = (framework, sources, compiledPaths) => {
7868
- const destDir = join18(buildPath, "conventions", framework);
7869
+ const destDir = join19(buildPath, "conventions", framework);
7869
7870
  mkdirSync10(destDir, { recursive: true });
7870
7871
  const destPaths = [];
7871
7872
  for (const compiledPath of compiledPaths) {
7872
- const dest = join18(destDir, basename8(compiledPath));
7873
+ const dest = join19(destDir, basename8(compiledPath));
7873
7874
  copyFileSync(compiledPath, dest);
7874
7875
  destPaths.push(dest);
7875
7876
  }
@@ -7915,7 +7916,7 @@ ${content.slice(firstUseIdx)}`;
7915
7916
  }
7916
7917
  }) : {
7917
7918
  entries: [],
7918
- generatedRoot: join18(buildPath, "_island_entries")
7919
+ generatedRoot: join19(buildPath, "_island_entries")
7919
7920
  };
7920
7921
  const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
7921
7922
  if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
@@ -7950,7 +7951,7 @@ ${content.slice(firstUseIdx)}`;
7950
7951
  return {};
7951
7952
  }
7952
7953
  if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
7953
- const refreshEntry = join18(reactIndexesPath, "_refresh.tsx");
7954
+ const refreshEntry = join19(reactIndexesPath, "_refresh.tsx");
7954
7955
  if (!reactClientEntryPoints.includes(refreshEntry))
7955
7956
  reactClientEntryPoints.push(refreshEntry);
7956
7957
  }
@@ -8005,19 +8006,19 @@ ${content.slice(firstUseIdx)}`;
8005
8006
  throw: false
8006
8007
  } : undefined;
8007
8008
  if (reactDir && reactClientEntryPoints.length > 0) {
8008
- rmSync2(join18(buildPath, "react", "generated", "indexes"), {
8009
+ rmSync2(join19(buildPath, "react", "generated", "indexes"), {
8009
8010
  force: true,
8010
8011
  recursive: true
8011
8012
  });
8012
8013
  }
8013
8014
  if (angularDir && angularClientPaths.length > 0) {
8014
- rmSync2(join18(buildPath, "angular", "indexes"), {
8015
+ rmSync2(join19(buildPath, "angular", "indexes"), {
8015
8016
  force: true,
8016
8017
  recursive: true
8017
8018
  });
8018
8019
  }
8019
8020
  if (islandClientEntryPoints.length > 0) {
8020
- rmSync2(join18(buildPath, "islands"), {
8021
+ rmSync2(join19(buildPath, "islands"), {
8021
8022
  force: true,
8022
8023
  recursive: true
8023
8024
  });
@@ -8103,7 +8104,7 @@ ${content.slice(firstUseIdx)}`;
8103
8104
  globalCssEntries.length > 0 ? bunBuild6({
8104
8105
  entrypoints: globalCssEntries,
8105
8106
  naming: `[dir]/[name].[hash].[ext]`,
8106
- outdir: stylesDir ? join18(buildPath, basename8(stylesDir)) : buildPath,
8107
+ outdir: stylesDir ? join19(buildPath, basename8(stylesDir)) : buildPath,
8107
8108
  root: stylesDir || clientRoot,
8108
8109
  target: "browser",
8109
8110
  plugins: [stylePreprocessorPlugin],
@@ -8112,7 +8113,7 @@ ${content.slice(firstUseIdx)}`;
8112
8113
  vueCssPaths.length > 0 ? bunBuild6({
8113
8114
  entrypoints: vueCssPaths,
8114
8115
  naming: `[name].[hash].[ext]`,
8115
- outdir: join18(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
8116
+ outdir: join19(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
8116
8117
  target: "browser",
8117
8118
  throw: false
8118
8119
  }) : undefined
@@ -8234,7 +8235,7 @@ ${content.slice(firstUseIdx)}`;
8234
8235
  const injectHMRIntoHTMLFile = (filePath, framework) => {
8235
8236
  if (!hmrClientBundle)
8236
8237
  return;
8237
- let html = readFileSync11(filePath, "utf-8");
8238
+ let html = readFileSync10(filePath, "utf-8");
8238
8239
  if (html.includes("data-hmr-client"))
8239
8240
  return;
8240
8241
  const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
@@ -8245,7 +8246,7 @@ ${content.slice(firstUseIdx)}`;
8245
8246
  const processHtmlPages = async () => {
8246
8247
  if (!(htmlDir && htmlPagesPath))
8247
8248
  return;
8248
- const outputHtmlPages = isSingle ? join18(buildPath, "pages") : join18(buildPath, basename8(htmlDir), "pages");
8249
+ const outputHtmlPages = isSingle ? join19(buildPath, "pages") : join19(buildPath, basename8(htmlDir), "pages");
8249
8250
  mkdirSync10(outputHtmlPages, { recursive: true });
8250
8251
  cpSync(htmlPagesPath, outputHtmlPages, {
8251
8252
  force: true,
@@ -8267,14 +8268,14 @@ ${content.slice(firstUseIdx)}`;
8267
8268
  const processHtmxPages = async () => {
8268
8269
  if (!(htmxDir && htmxPagesPath))
8269
8270
  return;
8270
- const outputHtmxPages = isSingle ? join18(buildPath, "pages") : join18(buildPath, basename8(htmxDir), "pages");
8271
+ const outputHtmxPages = isSingle ? join19(buildPath, "pages") : join19(buildPath, basename8(htmxDir), "pages");
8271
8272
  mkdirSync10(outputHtmxPages, { recursive: true });
8272
8273
  cpSync(htmxPagesPath, outputHtmxPages, {
8273
8274
  force: true,
8274
8275
  recursive: true
8275
8276
  });
8276
8277
  if (shouldCopyHtmx) {
8277
- const htmxDestDir = isSingle ? buildPath : join18(buildPath, basename8(htmxDir));
8278
+ const htmxDestDir = isSingle ? buildPath : join19(buildPath, basename8(htmxDir));
8278
8279
  copyHtmxVendor(htmxDir, htmxDestDir);
8279
8280
  }
8280
8281
  if (shouldUpdateHtmxAssetPaths) {
@@ -8329,9 +8330,9 @@ ${content.slice(firstUseIdx)}`;
8329
8330
  });
8330
8331
  if (isIncremental)
8331
8332
  return { conventions: conventionsMap, manifest };
8332
- writeFileSync7(join18(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
8333
+ writeFileSync7(join19(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
8333
8334
  if (Object.keys(conventionsMap).length > 0) {
8334
- writeFileSync7(join18(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
8335
+ writeFileSync7(join19(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
8335
8336
  }
8336
8337
  return { conventions: conventionsMap, manifest };
8337
8338
  };
@@ -8395,7 +8396,7 @@ var init_build = __esm(() => {
8395
8396
  });
8396
8397
 
8397
8398
  // src/dev/dependencyGraph.ts
8398
- import { existsSync as existsSync18, readFileSync as readFileSync12 } from "fs";
8399
+ import { existsSync as existsSync18, readFileSync as readFileSync11 } from "fs";
8399
8400
  var {Glob: Glob7 } = globalThis.Bun;
8400
8401
  import { resolve as resolve21 } from "path";
8401
8402
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
@@ -8556,15 +8557,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
8556
8557
  const lowerPath = filePath.toLowerCase();
8557
8558
  const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
8558
8559
  if (loader === "html") {
8559
- const content = readFileSync12(filePath, "utf-8");
8560
+ const content = readFileSync11(filePath, "utf-8");
8560
8561
  return extractHtmlDependencies(filePath, content);
8561
8562
  }
8562
8563
  if (loader === "tsx" || loader === "js") {
8563
- const content = readFileSync12(filePath, "utf-8");
8564
+ const content = readFileSync11(filePath, "utf-8");
8564
8565
  return extractJsDependencies(filePath, content, loader);
8565
8566
  }
8566
8567
  if (isSvelteOrVue) {
8567
- const content = readFileSync12(filePath, "utf-8");
8568
+ const content = readFileSync11(filePath, "utf-8");
8568
8569
  return extractSvelteVueDependencies(filePath, content);
8569
8570
  }
8570
8571
  return [];
@@ -8853,7 +8854,7 @@ var init_pathUtils = __esm(() => {
8853
8854
  // src/dev/fileWatcher.ts
8854
8855
  import { watch } from "fs";
8855
8856
  import { existsSync as existsSync19 } from "fs";
8856
- import { join as join19, resolve as resolve23 } from "path";
8857
+ import { join as join20, resolve as resolve23 } from "path";
8857
8858
  var safeRemoveFromGraph = (graph, fullPath) => {
8858
8859
  try {
8859
8860
  removeFileFromGraph(graph, fullPath);
@@ -8880,7 +8881,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
8880
8881
  if (shouldSkipFilename(filename, isStylesDir)) {
8881
8882
  return;
8882
8883
  }
8883
- const fullPath = join19(absolutePath, filename).replace(/\\/g, "/");
8884
+ const fullPath = join20(absolutePath, filename).replace(/\\/g, "/");
8884
8885
  if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
8885
8886
  return;
8886
8887
  }
@@ -9031,10 +9032,10 @@ var init_assetStore = __esm(() => {
9031
9032
  });
9032
9033
 
9033
9034
  // src/dev/fileHashTracker.ts
9034
- import { readFileSync as readFileSync13 } from "fs";
9035
+ import { readFileSync as readFileSync12 } from "fs";
9035
9036
  var computeFileHash = (filePath) => {
9036
9037
  try {
9037
- const fileContent = readFileSync13(filePath);
9038
+ const fileContent = readFileSync12(filePath);
9038
9039
  return Number(Bun.hash(fileContent));
9039
9040
  } catch {
9040
9041
  return UNFOUND_INDEX;
@@ -9395,15 +9396,15 @@ var escapeHtml = (str) => String(str).replace(/&/g, "&amp;").replace(/</g, "&lt;
9395
9396
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
9396
9397
  import { mkdir as mkdir4, symlink } from "fs/promises";
9397
9398
  import { tmpdir } from "os";
9398
- import { basename as basename10, dirname as dirname12, join as join20, resolve as resolve27 } from "path";
9399
+ import { basename as basename10, dirname as dirname12, join as join21, resolve as resolve27 } from "path";
9399
9400
  var ssrDirty2 = false, lastSelector = "angular-page", isRecord8 = (value) => typeof value === "object" && value !== null, isAngularComponent = (value) => typeof value === "function", compilerImportPromise = null, ensureAngularCompiler = () => {
9400
9401
  if (!compilerImportPromise) {
9401
9402
  compilerImportPromise = import("@angular/compiler");
9402
9403
  }
9403
9404
  return compilerImportPromise;
9404
- }, readAngularPageModule = (value) => isRecord8(value) ? value : null, resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join20(tmpdir(), "absolutejs", "generated", "angular-ssr"), ensureAngularSsrNodeModules = async (outDir) => {
9405
+ }, readAngularPageModule = (value) => isRecord8(value) ? value : null, resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join21(tmpdir(), "absolutejs", "generated", "angular-ssr"), ensureAngularSsrNodeModules = async (outDir) => {
9405
9406
  const outRoot = resolve27(dirname12(dirname12(outDir)));
9406
- const nodeModulesLink = join20(outRoot, "node_modules");
9407
+ const nodeModulesLink = join21(outRoot, "node_modules");
9407
9408
  if (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {
9408
9409
  return;
9409
9410
  }
@@ -9858,7 +9859,7 @@ __export(exports_moduleServer, {
9858
9859
  createModuleServer: () => createModuleServer,
9859
9860
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
9860
9861
  });
9861
- import { existsSync as existsSync20, readFileSync as readFileSync14, statSync as statSync2 } from "fs";
9862
+ import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as statSync2 } from "fs";
9862
9863
  import { basename as basename12, dirname as dirname14, extname as extname6, resolve as resolve28, relative as relative10 } from "path";
9863
9864
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
9864
9865
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
@@ -9991,7 +9992,7 @@ ${stubs}
9991
9992
  `)}
9992
9993
  ${code}`;
9993
9994
  }, reactTranspilerOptions, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
9994
- const raw = readFileSync14(filePath, "utf-8");
9995
+ const raw = readFileSync13(filePath, "utf-8");
9995
9996
  const valueExports = tsxTranspiler.scan(raw).exports;
9996
9997
  let transpiled = reactTranspiler.transformSync(raw);
9997
9998
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
@@ -10007,7 +10008,7 @@ ${transpiled}`;
10007
10008
  transpiled += buildIslandMetadataExports(raw);
10008
10009
  return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
10009
10010
  }, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
10010
- const raw = readFileSync14(filePath, "utf-8");
10011
+ const raw = readFileSync13(filePath, "utf-8");
10011
10012
  const ext = extname6(filePath);
10012
10013
  const isTS = ext === ".ts" || ext === ".tsx";
10013
10014
  const isTSX = ext === ".tsx" || ext === ".jsx";
@@ -10163,7 +10164,7 @@ ${code}`;
10163
10164
  ` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
10164
10165
  return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
10165
10166
  }, transformSvelteFile = async (filePath, projectRoot, rewriter) => {
10166
- const raw = readFileSync14(filePath, "utf-8");
10167
+ const raw = readFileSync13(filePath, "utf-8");
10167
10168
  if (!svelteCompiler) {
10168
10169
  svelteCompiler = await import("svelte/compiler");
10169
10170
  }
@@ -10221,7 +10222,7 @@ export default __script__;`;
10221
10222
  return `${cssInjection}
10222
10223
  ${code}`;
10223
10224
  }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir) => {
10224
- const raw = readFileSync14(filePath, "utf-8");
10225
+ const raw = readFileSync13(filePath, "utf-8");
10225
10226
  if (!vueCompiler) {
10226
10227
  vueCompiler = await import("@vue/compiler-sfc");
10227
10228
  }
@@ -10270,7 +10271,7 @@ ${code}`;
10270
10271
  }
10271
10272
  });
10272
10273
  }, handleCssRequest = (filePath) => {
10273
- const raw = readFileSync14(filePath, "utf-8");
10274
+ const raw = readFileSync13(filePath, "utf-8");
10274
10275
  const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
10275
10276
  return [
10276
10277
  `const style = document.createElement('style');`,
@@ -12160,7 +12161,7 @@ __export(exports_buildDepVendor, {
12160
12161
  buildDepVendor: () => buildDepVendor
12161
12162
  });
12162
12163
  import { mkdirSync as mkdirSync11 } from "fs";
12163
- import { join as join21 } from "path";
12164
+ import { join as join22 } from "path";
12164
12165
  import { rm as rm8 } from "fs/promises";
12165
12166
  var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
12166
12167
  var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_"), isResolvable3 = (specifier) => {
@@ -12200,7 +12201,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
12200
12201
  return Array.from(specifiers).filter(isResolvable3);
12201
12202
  }, generateEntrySource2 = (specifier) => `export * from '${specifier}';
12202
12203
  `, rewriteVendorFiles = async (vendorDir) => {
12203
- const { readdirSync: readdirSync2, readFileSync: readFileSync15, writeFileSync: writeFileSync8 } = await import("fs");
12204
+ const { readdirSync: readdirSync2, readFileSync: readFileSync14, writeFileSync: writeFileSync8 } = await import("fs");
12204
12205
  const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
12205
12206
  const reactPaths = Object.entries(computeVendorPaths2());
12206
12207
  const rewriteContent = (content) => reactPaths.reduce((acc, [specifier, webPath]) => {
@@ -12210,8 +12211,8 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
12210
12211
  }, content);
12211
12212
  const files = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
12212
12213
  for (const file4 of files) {
12213
- const filePath = join21(vendorDir, file4);
12214
- const original = readFileSync15(filePath, "utf-8");
12214
+ const filePath = join22(vendorDir, file4);
12215
+ const original = readFileSync14(filePath, "utf-8");
12215
12216
  const rewritten = rewriteContent(original);
12216
12217
  if (rewritten !== original)
12217
12218
  writeFileSync8(filePath, rewritten);
@@ -12220,13 +12221,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
12220
12221
  const specifiers = await scanBareImports(directories);
12221
12222
  if (specifiers.length === 0)
12222
12223
  return {};
12223
- const vendorDir = join21(buildDir, "vendor");
12224
+ const vendorDir = join22(buildDir, "vendor");
12224
12225
  mkdirSync11(vendorDir, { recursive: true });
12225
- const tmpDir = join21(buildDir, "_dep_vendor_tmp");
12226
+ const tmpDir = join22(buildDir, "_dep_vendor_tmp");
12226
12227
  mkdirSync11(tmpDir, { recursive: true });
12227
12228
  const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
12228
12229
  const safeName = toSafeFileName5(specifier);
12229
- const entryPath = join21(tmpDir, `${safeName}.ts`);
12230
+ const entryPath = join22(tmpDir, `${safeName}.ts`);
12230
12231
  const source = await generateEntrySource2(specifier);
12231
12232
  await Bun.write(entryPath, source);
12232
12233
  return entryPath;
@@ -12723,17 +12724,17 @@ __export(exports_devtoolsJson, {
12723
12724
  normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
12724
12725
  devtoolsJson: () => devtoolsJson
12725
12726
  });
12726
- import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync15, writeFileSync as writeFileSync8 } from "fs";
12727
- import { dirname as dirname17, join as join22, resolve as resolve33 } from "path";
12727
+ import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync14, writeFileSync as writeFileSync8 } from "fs";
12728
+ import { dirname as dirname17, join as join23, resolve as resolve33 } from "path";
12728
12729
  import { Elysia as Elysia3 } from "elysia";
12729
12730
  var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
12730
12731
  Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
12731
12732
  return uuid;
12732
- }, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve33(uuidCachePath ?? join22(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
12733
+ }, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve33(uuidCachePath ?? join23(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
12733
12734
  if (!existsSync22(cachePath))
12734
12735
  return null;
12735
12736
  try {
12736
- const value = readFileSync15(cachePath, "utf-8").trim();
12737
+ const value = readFileSync14(cachePath, "utf-8").trim();
12737
12738
  return isUuidV4(value) ? value : null;
12738
12739
  } catch {
12739
12740
  return null;
@@ -12768,11 +12769,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
12768
12769
  if (process.env.WSL_DISTRO_NAME) {
12769
12770
  const distro = process.env.WSL_DISTRO_NAME;
12770
12771
  const withoutLeadingSlash = root.replace(/^\//, "");
12771
- return join22("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
12772
+ return join23("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
12772
12773
  }
12773
12774
  if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
12774
12775
  const withoutLeadingSlash = root.replace(/^\//, "");
12775
- return join22("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
12776
+ return join23("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
12776
12777
  }
12777
12778
  return root;
12778
12779
  };
@@ -13088,15 +13089,15 @@ __export(exports_prerender, {
13088
13089
  prerender: () => prerender,
13089
13090
  PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
13090
13091
  });
13091
- import { mkdirSync as mkdirSync13, readFileSync as readFileSync16 } from "fs";
13092
- import { join as join23 } from "path";
13092
+ import { mkdirSync as mkdirSync13, readFileSync as readFileSync15 } from "fs";
13093
+ import { join as join24 } from "path";
13093
13094
  var MAX_STARTUP_ATTEMPTS = 50, STARTUP_POLL_INTERVAL_MS = 100, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
13094
13095
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
13095
13096
  await Bun.write(metaPath, String(Date.now()));
13096
13097
  }, readTimestamp = (htmlPath) => {
13097
13098
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
13098
13099
  try {
13099
- const content = readFileSync16(metaPath, "utf-8");
13100
+ const content = readFileSync15(metaPath, "utf-8");
13100
13101
  return Number(content) || 0;
13101
13102
  } catch {
13102
13103
  return 0;
@@ -13145,7 +13146,7 @@ var MAX_STARTUP_ATTEMPTS = 50, STARTUP_POLL_INTERVAL_MS = 100, PRERENDER_BYPASS_
13145
13146
  return false;
13146
13147
  const html = await res.text();
13147
13148
  const fileName = routeToFilename(route);
13148
- const filePath = join23(prerenderDir, fileName);
13149
+ const filePath = join24(prerenderDir, fileName);
13149
13150
  await Bun.write(filePath, html);
13150
13151
  await writeTimestamp(filePath);
13151
13152
  return true;
@@ -13164,13 +13165,13 @@ var MAX_STARTUP_ATTEMPTS = 50, STARTUP_POLL_INTERVAL_MS = 100, PRERENDER_BYPASS_
13164
13165
  }
13165
13166
  const html = await res.text();
13166
13167
  const fileName = routeToFilename(route);
13167
- const filePath = join23(prerenderDir, fileName);
13168
+ const filePath = join24(prerenderDir, fileName);
13168
13169
  await Bun.write(filePath, html);
13169
13170
  await writeTimestamp(filePath);
13170
13171
  result.routes.set(route, filePath);
13171
13172
  log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
13172
13173
  }, prerender = async (port, outDir, staticConfig, log2) => {
13173
- const prerenderDir = join23(outDir, "_prerendered");
13174
+ const prerenderDir = join24(outDir, "_prerendered");
13174
13175
  mkdirSync13(prerenderDir, { recursive: true });
13175
13176
  const baseUrl = `http://localhost:${port}`;
13176
13177
  let routes;
@@ -13436,8 +13437,8 @@ var handleHTMXPageRequest = async (pagePath) => {
13436
13437
  });
13437
13438
  };
13438
13439
  // src/core/prepare.ts
13439
- import { existsSync as existsSync24, readdirSync as readdirSync2, readFileSync as readFileSync17 } from "fs";
13440
- import { basename as basename14, join as join24, relative as relative12, resolve as resolve35 } from "path";
13440
+ import { existsSync as existsSync24, readdirSync as readdirSync2, readFileSync as readFileSync16 } from "fs";
13441
+ import { basename as basename14, join as join25, relative as relative12, resolve as resolve35 } from "path";
13441
13442
  import { Elysia as Elysia5 } from "elysia";
13442
13443
 
13443
13444
  // src/utils/loadConfig.ts
@@ -13758,7 +13759,7 @@ var loadPrerenderMap = (prerenderDir) => {
13758
13759
  continue;
13759
13760
  const name = basename14(entry, ".html");
13760
13761
  const route = name === "index" ? "/" : `/${name}`;
13761
- map.set(route, join24(prerenderDir, entry));
13762
+ map.set(route, join25(prerenderDir, entry));
13762
13763
  }
13763
13764
  return map;
13764
13765
  };
@@ -13798,7 +13799,7 @@ var prepare = async (configOrPath) => {
13798
13799
  return result;
13799
13800
  }
13800
13801
  stepStartedAt = performance.now();
13801
- const manifest = JSON.parse(readFileSync17(`${buildDir}/manifest.json`, "utf-8"));
13802
+ const manifest = JSON.parse(readFileSync16(`${buildDir}/manifest.json`, "utf-8"));
13802
13803
  setCurrentIslandManifest(manifest);
13803
13804
  if (config.islands?.registry) {
13804
13805
  setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
@@ -13806,9 +13807,9 @@ var prepare = async (configOrPath) => {
13806
13807
  setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
13807
13808
  recordStep("load production manifest and island metadata", stepStartedAt);
13808
13809
  stepStartedAt = performance.now();
13809
- const conventionsPath = join24(buildDir, "conventions.json");
13810
+ const conventionsPath = join25(buildDir, "conventions.json");
13810
13811
  if (existsSync24(conventionsPath)) {
13811
- const conventions2 = JSON.parse(readFileSync17(conventionsPath, "utf-8"));
13812
+ const conventions2 = JSON.parse(readFileSync16(conventionsPath, "utf-8"));
13812
13813
  setConventions(conventions2);
13813
13814
  }
13814
13815
  recordStep("load production conventions", stepStartedAt);
@@ -13822,7 +13823,7 @@ var prepare = async (configOrPath) => {
13822
13823
  });
13823
13824
  recordStep("create static plugin", stepStartedAt);
13824
13825
  stepStartedAt = performance.now();
13825
- const prerenderDir = join24(buildDir, "_prerendered");
13826
+ const prerenderDir = join25(buildDir, "_prerendered");
13826
13827
  const prerenderMap = loadPrerenderMap(prerenderDir);
13827
13828
  recordStep("load prerender map", stepStartedAt);
13828
13829
  if (prerenderMap.size > 0) {
@@ -13877,18 +13878,18 @@ import { argv } from "process";
13877
13878
  var {env: env4 } = globalThis.Bun;
13878
13879
 
13879
13880
  // src/dev/devCert.ts
13880
- import { existsSync as existsSync25, mkdirSync as mkdirSync14, readFileSync as readFileSync18, rmSync as rmSync3 } from "fs";
13881
- import { join as join25 } from "path";
13882
- var CERT_DIR = join25(process.cwd(), ".absolutejs");
13883
- var CERT_PATH = join25(CERT_DIR, "cert.pem");
13884
- var KEY_PATH = join25(CERT_DIR, "key.pem");
13881
+ import { existsSync as existsSync25, mkdirSync as mkdirSync14, readFileSync as readFileSync17, rmSync as rmSync3 } from "fs";
13882
+ import { join as join26 } from "path";
13883
+ var CERT_DIR = join26(process.cwd(), ".absolutejs");
13884
+ var CERT_PATH = join26(CERT_DIR, "cert.pem");
13885
+ var KEY_PATH = join26(CERT_DIR, "key.pem");
13885
13886
  var CERT_VALIDITY_DAYS = 365;
13886
13887
  var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
13887
13888
  var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
13888
13889
  var certFilesExist = () => existsSync25(CERT_PATH) && existsSync25(KEY_PATH);
13889
13890
  var isCertExpired = () => {
13890
13891
  try {
13891
- const certPem = readFileSync18(CERT_PATH, "utf-8");
13892
+ const certPem = readFileSync17(CERT_PATH, "utf-8");
13892
13893
  const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
13893
13894
  stdin: new TextEncoder().encode(certPem)
13894
13895
  });
@@ -13984,8 +13985,8 @@ var loadDevCert = () => {
13984
13985
  return null;
13985
13986
  try {
13986
13987
  return {
13987
- cert: readFileSync18(paths.cert, "utf-8"),
13988
- key: readFileSync18(paths.key, "utf-8")
13988
+ cert: readFileSync17(paths.cert, "utf-8"),
13989
+ key: readFileSync17(paths.key, "utf-8")
13989
13990
  };
13990
13991
  } catch {
13991
13992
  return null;
@@ -14213,7 +14214,7 @@ var jsonLd2 = (schema) => {
14213
14214
  };
14214
14215
  // src/utils/defineEnv.ts
14215
14216
  var {env: bunEnv } = globalThis.Bun;
14216
- import { existsSync as existsSync26, readFileSync as readFileSync19 } from "fs";
14217
+ import { existsSync as existsSync26, readFileSync as readFileSync18 } from "fs";
14217
14218
  import { resolve as resolve36 } from "path";
14218
14219
 
14219
14220
  // node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
@@ -20255,13 +20256,13 @@ var checkEnvFileSecurity = (properties) => {
20255
20256
  const sensitiveKeys = Object.keys(properties).filter(isSensitive);
20256
20257
  if (sensitiveKeys.length === 0)
20257
20258
  return;
20258
- const envContent = readFileSync19(envPath, "utf-8");
20259
+ const envContent = readFileSync18(envPath, "utf-8");
20259
20260
  const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
20260
20261
  if (presentKeys.length === 0)
20261
20262
  return;
20262
20263
  const gitignorePath = resolve36(cwd2, ".gitignore");
20263
20264
  if (existsSync26(gitignorePath)) {
20264
- const gitignore = readFileSync19(gitignorePath, "utf-8");
20265
+ const gitignore = readFileSync18(gitignorePath, "utf-8");
20265
20266
  if (gitignore.split(`
20266
20267
  `).some((line) => line.trim() === ".env"))
20267
20268
  return;
@@ -20468,5 +20469,5 @@ export {
20468
20469
  ANGULAR_INIT_TIMEOUT_MS
20469
20470
  };
20470
20471
 
20471
- //# debugId=6C9DFD7661C7542C64756E2164756E21
20472
+ //# debugId=F5E990EFAC399D1764756E2164756E21
20472
20473
  //# sourceMappingURL=index.js.map