@absolutejs/absolute 0.19.0-beta.691 → 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/build.js CHANGED
@@ -2448,7 +2448,6 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
2448
2448
  });
2449
2449
 
2450
2450
  // src/build/stylePreprocessor.ts
2451
- import { readFileSync as readFileSync3 } from "fs";
2452
2451
  import { readFile } from "fs/promises";
2453
2452
  import { createRequire } from "module";
2454
2453
  import { dirname as dirname3, extname as extname3, join as join5 } from "path";
@@ -2461,13 +2460,7 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2461
2460
  if (normalized === "less" || normalized.endsWith(".less"))
2462
2461
  return "less";
2463
2462
  return null;
2464
- }, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), requireOptionalPeerSync = (specifier) => {
2465
- try {
2466
- return requireFromCwd(specifier);
2467
- } catch {
2468
- return requireOptionalPeer(specifier);
2469
- }
2470
- }, compileStyleSource = async (filePath, source, languageHint) => {
2463
+ }, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), compileStyleSource = async (filePath, source, languageHint) => {
2471
2464
  const language = getStyleLanguage(languageHint ?? filePath);
2472
2465
  const contents = source ?? await readFile(filePath, "utf-8");
2473
2466
  if (language === "scss" || language === "sass") {
@@ -2522,27 +2515,6 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2522
2515
  return readFile(filePath, "utf-8");
2523
2516
  }
2524
2517
  return compileStyleSource(filePath);
2525
- }, compileStyleFileIfNeededSync = (filePath) => {
2526
- const contents = readFileSync3(filePath, "utf-8");
2527
- const language = getStyleLanguage(filePath);
2528
- if (language === "scss" || language === "sass") {
2529
- let sass;
2530
- try {
2531
- sass = requireOptionalPeerSync("sass");
2532
- } catch {
2533
- throw missingDependencyError("sass", filePath);
2534
- }
2535
- return sass.compileString(contents, {
2536
- loadPaths: [dirname3(filePath), process.cwd()],
2537
- style: "expanded",
2538
- syntax: language === "sass" ? "indented" : "scss",
2539
- url: new URL(`file://${filePath}`)
2540
- }).css;
2541
- }
2542
- if (language === "less") {
2543
- 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.`);
2544
- }
2545
- return contents;
2546
2518
  };
2547
2519
  var init_stylePreprocessor = __esm(() => {
2548
2520
  STYLE_EXTENSION_PATTERN = /\.(s[ac]ss|less)$/i;
@@ -2975,7 +2947,7 @@ var init_staticStreaming = __esm(() => {
2975
2947
  });
2976
2948
 
2977
2949
  // src/build/staticIslandPages.ts
2978
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
2950
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
2979
2951
  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) => {
2980
2952
  const attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, "g");
2981
2953
  const attributes = new Map;
@@ -3104,7 +3076,7 @@ var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:
3104
3076
  }
3105
3077
  return result + originalHtml.slice(nextIndex);
3106
3078
  }, transformStaticPage = async (pagePath, registry) => {
3107
- const originalHtml = readFileSync4(pagePath, "utf-8");
3079
+ const originalHtml = readFileSync3(pagePath, "utf-8");
3108
3080
  const transformedHtml = await transformStaticPageHtml(originalHtml, registry);
3109
3081
  if (transformedHtml !== originalHtml) {
3110
3082
  writeFileSync3(pagePath, transformedHtml);
@@ -3242,7 +3214,7 @@ var init_scanCssEntryPoints = __esm(() => {
3242
3214
  });
3243
3215
 
3244
3216
  // src/utils/imageProcessing.ts
3245
- import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
3217
+ import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync4 } from "fs";
3246
3218
  import { join as join7, resolve as resolve7 } from "path";
3247
3219
  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) => {
3248
3220
  for (const size of sizes) {
@@ -3358,8 +3330,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
3358
3330
  if (!existsSync8(metaPath) || !existsSync8(dataPath))
3359
3331
  return null;
3360
3332
  try {
3361
- const meta = JSON.parse(readFileSync5(metaPath, "utf-8"));
3362
- const buffer = readFileSync5(dataPath);
3333
+ const meta = JSON.parse(readFileSync4(metaPath, "utf-8"));
3334
+ const buffer = readFileSync4(dataPath);
3363
3335
  return { buffer, meta };
3364
3336
  } catch {
3365
3337
  return null;
@@ -3474,14 +3446,14 @@ var init_optimizeHtmlImages = __esm(() => {
3474
3446
  });
3475
3447
 
3476
3448
  // src/cli/scripts/telemetry.ts
3477
- import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
3449
+ import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "fs";
3478
3450
  import { homedir } from "os";
3479
3451
  import { join as join8 } from "path";
3480
3452
  var configDir, configPath, getTelemetryConfig = () => {
3481
3453
  try {
3482
3454
  if (!existsSync9(configPath))
3483
3455
  return null;
3484
- const raw = readFileSync6(configPath, "utf-8");
3456
+ const raw = readFileSync5(configPath, "utf-8");
3485
3457
  const config = JSON.parse(raw);
3486
3458
  return config;
3487
3459
  } catch {
@@ -3494,14 +3466,14 @@ var init_telemetry = __esm(() => {
3494
3466
  });
3495
3467
 
3496
3468
  // src/cli/telemetryEvent.ts
3497
- import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
3469
+ import { existsSync as existsSync10, readFileSync as readFileSync6 } from "fs";
3498
3470
  import { arch, platform } from "os";
3499
3471
  import { dirname as dirname5, join as join9, parse } from "path";
3500
3472
  var checkCandidate = (candidate) => {
3501
3473
  if (!existsSync10(candidate)) {
3502
3474
  return null;
3503
3475
  }
3504
- const pkg = JSON.parse(readFileSync7(candidate, "utf-8"));
3476
+ const pkg = JSON.parse(readFileSync6(candidate, "utf-8"));
3505
3477
  if (pkg.name === "@absolutejs/absolute") {
3506
3478
  const ver = pkg.version;
3507
3479
  return ver;
@@ -3808,7 +3780,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
3808
3780
  };
3809
3781
 
3810
3782
  // src/build/angularLinkerPlugin.ts
3811
- import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync8, writeFileSync as writeFileSync6 } from "fs";
3783
+ import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync6 } from "fs";
3812
3784
  import { dirname as dirname6, join as join10, relative as relative4, resolve as resolve10 } from "path";
3813
3785
  import { createHash } from "crypto";
3814
3786
  var CACHE_DIR, angularLinkerPlugin;
@@ -3835,7 +3807,7 @@ var init_angularLinkerPlugin = __esm(() => {
3835
3807
  const cachePath = join10(CACHE_DIR, `${hash}.js`);
3836
3808
  if (existsSync12(cachePath)) {
3837
3809
  return {
3838
- contents: readFileSync8(cachePath, "utf-8"),
3810
+ contents: readFileSync7(cachePath, "utf-8"),
3839
3811
  loader: "js"
3840
3812
  };
3841
3813
  }
@@ -3851,7 +3823,7 @@ var init_angularLinkerPlugin = __esm(() => {
3851
3823
  fileSystem: {
3852
3824
  dirname: dirname6,
3853
3825
  exists: existsSync12,
3854
- readFile: readFileSync8,
3826
+ readFile: readFileSync7,
3855
3827
  relative: relative4,
3856
3828
  resolve: resolve10
3857
3829
  },
@@ -5343,13 +5315,13 @@ __export(exports_compileAngular, {
5343
5315
  compileAngularFile: () => compileAngularFile,
5344
5316
  compileAngular: () => compileAngular
5345
5317
  });
5346
- import { existsSync as existsSync15, readFileSync as readFileSync9, promises as fs } from "fs";
5318
+ import { existsSync as existsSync15, readFileSync as readFileSync8, promises as fs } from "fs";
5347
5319
  import { join as join14, basename as basename6, sep as sep3, dirname as dirname9, resolve as resolve15, relative as relative8 } from "path";
5348
5320
  import ts2 from "typescript";
5349
5321
  import { createHash as createHash2 } from "crypto";
5350
5322
  var computeConfigHash = () => {
5351
5323
  try {
5352
- const content = readFileSync9("./tsconfig.json", "utf-8");
5324
+ const content = readFileSync8("./tsconfig.json", "utf-8");
5353
5325
  return createHash2("md5").update(content).digest("hex");
5354
5326
  } catch {
5355
5327
  return "";
@@ -5406,8 +5378,70 @@ ${registrations}
5406
5378
  if (fileName.startsWith(outDir))
5407
5379
  return fileName.substring(outDir.length + 1);
5408
5380
  return fileName;
5381
+ }, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
5382
+ const sourceFile = ts2.createSourceFile(fileName, source, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TS);
5383
+ const specifiers = [];
5384
+ const addSpecifier = (node) => {
5385
+ if (!node || !ts2.isStringLiteralLike(node))
5386
+ return;
5387
+ const specifier = node.text;
5388
+ if (isRelativeModuleSpecifier(specifier))
5389
+ specifiers.push(specifier);
5390
+ };
5391
+ const visit = (node) => {
5392
+ if (ts2.isImportDeclaration(node) || ts2.isExportDeclaration(node)) {
5393
+ addSpecifier(node.moduleSpecifier);
5394
+ } else if (ts2.isCallExpression(node) && node.expression.kind === ts2.SyntaxKind.ImportKeyword) {
5395
+ addSpecifier(node.arguments[0]);
5396
+ }
5397
+ ts2.forEachChild(node, visit);
5398
+ };
5399
+ visit(sourceFile);
5400
+ return specifiers;
5401
+ }, resolveLocalTsImport = (fromFile, specifier) => {
5402
+ if (!isRelativeModuleSpecifier(specifier))
5403
+ return null;
5404
+ const basePath = resolve15(dirname9(fromFile), specifier);
5405
+ const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
5406
+ `${basePath}.ts`,
5407
+ `${basePath}.tsx`,
5408
+ `${basePath}.mts`,
5409
+ `${basePath}.cts`,
5410
+ join14(basePath, "index.ts"),
5411
+ join14(basePath, "index.tsx"),
5412
+ join14(basePath, "index.mts"),
5413
+ join14(basePath, "index.cts")
5414
+ ];
5415
+ return candidates.map((candidate) => resolve15(candidate)).find((candidate) => existsSync15(candidate) && !candidate.endsWith(".d.ts")) ?? null;
5416
+ }, readFileForAotTransform = async (fileName, readFile4) => {
5417
+ const hostSource = readFile4?.(fileName);
5418
+ if (typeof hostSource === "string")
5419
+ return hostSource;
5420
+ return fs.readFile(fileName, "utf-8");
5421
+ }, precomputeAotResourceTransforms = async (inputPath, readFile4) => {
5422
+ const transformedSources = new Map;
5423
+ const visited = new Set;
5424
+ const transformFile = async (filePath) => {
5425
+ const resolvedPath = resolve15(filePath);
5426
+ if (visited.has(resolvedPath))
5427
+ return;
5428
+ visited.add(resolvedPath);
5429
+ if (!existsSync15(resolvedPath) || resolvedPath.endsWith(".d.ts"))
5430
+ return;
5431
+ const source = await readFileForAotTransform(resolvedPath, readFile4);
5432
+ const transformed = await inlineResources(source, dirname9(resolvedPath));
5433
+ transformedSources.set(resolvedPath, transformed.source);
5434
+ const imports = extractLocalImportSpecifiers(source, resolvedPath);
5435
+ await Promise.all(imports.map(async (specifier) => {
5436
+ const resolvedImport = resolveLocalTsImport(resolvedPath, specifier);
5437
+ if (resolvedImport)
5438
+ await transformFile(resolvedImport);
5439
+ }));
5440
+ };
5441
+ await transformFile(inputPath);
5442
+ return transformedSources;
5409
5443
  }, compileAngularFile = async (inputPath, outDir) => {
5410
- const islandMetadataExports = buildIslandMetadataExports(readFileSync9(inputPath, "utf-8"));
5444
+ const islandMetadataExports = buildIslandMetadataExports(readFileSync8(inputPath, "utf-8"));
5411
5445
  const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
5412
5446
  const configHash = computeConfigHash();
5413
5447
  const cached = globalThis.__angularCompilerCache;
@@ -5475,7 +5509,7 @@ ${registrations}
5475
5509
  emitted[relativePath] = text;
5476
5510
  };
5477
5511
  const originalReadFile = host.readFile;
5478
- const aotTransformCache = new Map;
5512
+ const aotTransformedSources = await precomputeAotResourceTransforms(inputPath, originalReadFile?.bind(host));
5479
5513
  host.readFile = (fileName) => {
5480
5514
  const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
5481
5515
  if (typeof source !== "string")
@@ -5484,12 +5518,7 @@ ${registrations}
5484
5518
  return source;
5485
5519
  }
5486
5520
  const resolvedPath = resolve15(fileName);
5487
- const cached2 = aotTransformCache.get(resolvedPath);
5488
- if (cached2 !== undefined)
5489
- return cached2;
5490
- const transformed = inlineResourcesSync(source, dirname9(resolvedPath)).source;
5491
- aotTransformCache.set(resolvedPath, transformed);
5492
- return transformed;
5521
+ return aotTransformedSources.get(resolvedPath) ?? source;
5493
5522
  };
5494
5523
  const originalGetSourceFileForCompile = host.getSourceFile;
5495
5524
  host.getSourceFile = (fileName, languageVersion, onError) => {
@@ -5704,7 +5733,7 @@ ${fields}
5704
5733
  if (!existsSync15(templatePath)) {
5705
5734
  return { deferSlots: [], source };
5706
5735
  }
5707
- const templateRaw2 = readFileSync9(templatePath, "utf-8");
5736
+ const templateRaw2 = readFileSync8(templatePath, "utf-8");
5708
5737
  const lowered2 = lowerAngularDeferSyntax(templateRaw2);
5709
5738
  const escaped2 = escapeTemplateContent(lowered2.template);
5710
5739
  const replacedSource2 = source.replace(/templateUrl\s*:\s*['"][^'"]+['"]/, `template: \`${escaped2}\``);
@@ -5728,42 +5757,6 @@ ${fields}
5728
5757
  deferSlots: lowered.slots,
5729
5758
  source: injectDeferSlotFields(replacedSource, lowered.slots, resolveAngularDeferImportSpecifier())
5730
5759
  };
5731
- }, readAndEscapeFileSync = (filePath) => {
5732
- if (!existsSync15(filePath))
5733
- return null;
5734
- const content = compileStyleFileIfNeededSync(filePath);
5735
- return escapeTemplateContent(content);
5736
- }, inlineStyleUrlsSync = (source, fileDir) => {
5737
- const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
5738
- if (!styleUrlsMatch?.[1])
5739
- return source;
5740
- const urlMatches = styleUrlsMatch[1].match(/['"]([^'"]+)['"]/g);
5741
- if (!urlMatches)
5742
- return source;
5743
- const inlinedStyles = urlMatches.map((urlMatch) => {
5744
- const styleUrl = urlMatch.replace(/['"]/g, "");
5745
- return readAndEscapeFileSync(join14(fileDir, styleUrl));
5746
- }).filter(Boolean).map((escaped) => `\`${escaped}\``);
5747
- if (inlinedStyles.length === 0)
5748
- return source;
5749
- return source.replace(/styleUrls\s*:\s*\[[^\]]+\]/, `styles: [${inlinedStyles.join(", ")}]`);
5750
- }, inlineSingleStyleUrlSync = (source, fileDir) => {
5751
- const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
5752
- if (!styleUrlMatch?.[1])
5753
- return source;
5754
- const escaped = readAndEscapeFileSync(join14(fileDir, styleUrlMatch[1]));
5755
- if (!escaped)
5756
- return source;
5757
- return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
5758
- }, inlineResourcesSync = (source, fileDir) => {
5759
- const inlinedTemplate = inlineTemplateAndLowerDeferSync(source, fileDir);
5760
- let result = inlinedTemplate.source;
5761
- result = inlineStyleUrlsSync(result, fileDir);
5762
- result = inlineSingleStyleUrlSync(result, fileDir);
5763
- return {
5764
- deferSlots: inlinedTemplate.deferSlots,
5765
- source: result
5766
- };
5767
5760
  }, inlineStyleUrls = async (source, fileDir) => {
5768
5761
  const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
5769
5762
  if (!styleUrlsMatch?.[1])
@@ -6335,11 +6328,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
6335
6328
  console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
6336
6329
  return;
6337
6330
  }
6338
- const { readFileSync: readFileSync10, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
6331
+ const { readFileSync: readFileSync9, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
6339
6332
  const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
6340
6333
  for (const file3 of files) {
6341
6334
  const filePath = join17(vendorDir, file3);
6342
- const content = readFileSync10(filePath, "utf-8");
6335
+ const content = readFileSync9(filePath, "utf-8");
6343
6336
  if (!content.includes("__VUE_HMR_RUNTIME__"))
6344
6337
  continue;
6345
6338
  const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
@@ -6464,7 +6457,7 @@ import {
6464
6457
  cpSync,
6465
6458
  existsSync as existsSync17,
6466
6459
  mkdirSync as mkdirSync10,
6467
- readFileSync as readFileSync10,
6460
+ readFileSync as readFileSync9,
6468
6461
  rmSync as rmSync2,
6469
6462
  statSync,
6470
6463
  writeFileSync as writeFileSync7
@@ -6585,7 +6578,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
6585
6578
  addWorkerPathIfExists(file3, relPath, workerPaths);
6586
6579
  }
6587
6580
  }, collectWorkerPathsFromFile = (file3, patterns, workerPaths) => {
6588
- const content = readFileSync10(file3, "utf-8");
6581
+ const content = readFileSync9(file3, "utf-8");
6589
6582
  for (const pattern of patterns) {
6590
6583
  collectWorkerPathsFromContent(content, pattern, file3, workerPaths);
6591
6584
  }
@@ -6636,7 +6629,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
6636
6629
  const indexFiles = readDir(reactIndexesPath).filter((file3) => file3.endsWith(".tsx"));
6637
6630
  const pagesRel = relative9(process.cwd(), resolve17(reactPagesPath)).replace(/\\/g, "/");
6638
6631
  for (const file3 of indexFiles) {
6639
- let content = readFileSync10(join19(reactIndexesPath, file3), "utf-8");
6632
+ let content = readFileSync9(join19(reactIndexesPath, file3), "utf-8");
6640
6633
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
6641
6634
  writeFileSync7(join19(devIndexDir, file3), content);
6642
6635
  }
@@ -6648,7 +6641,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
6648
6641
  const indexFile = join19(svelteIndexDir, "pages", `${name}.js`);
6649
6642
  if (!existsSync17(indexFile))
6650
6643
  continue;
6651
- let content = readFileSync10(indexFile, "utf-8");
6644
+ let content = readFileSync9(indexFile, "utf-8");
6652
6645
  const srcRel = relative9(process.cwd(), resolve17(entry)).replace(/\\/g, "/");
6653
6646
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
6654
6647
  writeFileSync7(join19(devIndexDir, `${name}.svelte.js`), content);
@@ -6661,7 +6654,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
6661
6654
  const indexFile = join19(vueIndexDir, `${name}.js`);
6662
6655
  if (!existsSync17(indexFile))
6663
6656
  continue;
6664
- let content = readFileSync10(indexFile, "utf-8");
6657
+ let content = readFileSync9(indexFile, "utf-8");
6665
6658
  const srcRel = relative9(process.cwd(), resolve17(entry)).replace(/\\/g, "/");
6666
6659
  content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
6667
6660
  writeFileSync7(join19(devIndexDir, `${name}.vue.js`), content);
@@ -6712,7 +6705,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
6712
6705
  }
6713
6706
  return result;
6714
6707
  }, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
6715
- let content = readFileSync10(outputPath, "utf-8");
6708
+ let content = readFileSync9(outputPath, "utf-8");
6716
6709
  const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
6717
6710
  const useNames = [];
6718
6711
  let match;
@@ -6762,7 +6755,7 @@ ${content.slice(firstUseIdx)}`;
6762
6755
  }, rewriteUrlReferences = (outputPaths, urlFileMap) => {
6763
6756
  const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
6764
6757
  for (const outputPath of outputPaths) {
6765
- let content = readFileSync10(outputPath, "utf-8");
6758
+ let content = readFileSync9(outputPath, "utf-8");
6766
6759
  let changed = false;
6767
6760
  content = content.replace(urlPattern, (_match, relPath) => {
6768
6761
  const targetName = basename7(relPath);
@@ -7417,7 +7410,7 @@ ${content.slice(firstUseIdx)}`;
7417
7410
  const injectHMRIntoHTMLFile = (filePath, framework) => {
7418
7411
  if (!hmrClientBundle)
7419
7412
  return;
7420
- let html = readFileSync10(filePath, "utf-8");
7413
+ let html = readFileSync9(filePath, "utf-8");
7421
7414
  if (html.includes("data-hmr-client"))
7422
7415
  return;
7423
7416
  const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
@@ -7578,7 +7571,7 @@ var init_build = __esm(() => {
7578
7571
  });
7579
7572
 
7580
7573
  // src/dev/dependencyGraph.ts
7581
- import { existsSync as existsSync18, readFileSync as readFileSync11 } from "fs";
7574
+ import { existsSync as existsSync18, readFileSync as readFileSync10 } from "fs";
7582
7575
  var {Glob: Glob7 } = globalThis.Bun;
7583
7576
  import { resolve as resolve18 } from "path";
7584
7577
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
@@ -7739,15 +7732,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
7739
7732
  const lowerPath = filePath.toLowerCase();
7740
7733
  const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
7741
7734
  if (loader === "html") {
7742
- const content = readFileSync11(filePath, "utf-8");
7735
+ const content = readFileSync10(filePath, "utf-8");
7743
7736
  return extractHtmlDependencies(filePath, content);
7744
7737
  }
7745
7738
  if (loader === "tsx" || loader === "js") {
7746
- const content = readFileSync11(filePath, "utf-8");
7739
+ const content = readFileSync10(filePath, "utf-8");
7747
7740
  return extractJsDependencies(filePath, content, loader);
7748
7741
  }
7749
7742
  if (isSvelteOrVue) {
7750
- const content = readFileSync11(filePath, "utf-8");
7743
+ const content = readFileSync10(filePath, "utf-8");
7751
7744
  return extractSvelteVueDependencies(filePath, content);
7752
7745
  }
7753
7746
  return [];
@@ -8214,7 +8207,7 @@ var init_assetStore = __esm(() => {
8214
8207
  });
8215
8208
 
8216
8209
  // src/islands/pageMetadata.ts
8217
- import { readFileSync as readFileSync12 } from "fs";
8210
+ import { readFileSync as readFileSync11 } from "fs";
8218
8211
  import { dirname as dirname11, resolve as resolve22 } from "path";
8219
8212
  var pagePatterns, getPageDirs = (config) => [
8220
8213
  { dir: config.angularDirectory, framework: "angular" },
@@ -8256,7 +8249,7 @@ var pagePatterns, getPageDirs = (config) => [
8256
8249
  return;
8257
8250
  const files = await scanEntryPoints(resolve22(entry.dir), pattern);
8258
8251
  for (const filePath of files) {
8259
- const source = readFileSync12(filePath, "utf-8");
8252
+ const source = readFileSync11(filePath, "utf-8");
8260
8253
  const islands = extractIslandUsagesFromSource(source);
8261
8254
  pageMetadata.set(resolve22(filePath), {
8262
8255
  islands: resolveIslandUsages(islands, islandSourceLookup),
@@ -8286,10 +8279,10 @@ var init_pageMetadata = __esm(() => {
8286
8279
  });
8287
8280
 
8288
8281
  // src/dev/fileHashTracker.ts
8289
- import { readFileSync as readFileSync13 } from "fs";
8282
+ import { readFileSync as readFileSync12 } from "fs";
8290
8283
  var computeFileHash = (filePath) => {
8291
8284
  try {
8292
- const fileContent = readFileSync13(filePath);
8285
+ const fileContent = readFileSync12(filePath);
8293
8286
  return Number(Bun.hash(fileContent));
8294
8287
  } catch {
8295
8288
  return UNFOUND_INDEX;
@@ -9846,7 +9839,7 @@ __export(exports_moduleServer, {
9846
9839
  createModuleServer: () => createModuleServer,
9847
9840
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
9848
9841
  });
9849
- import { existsSync as existsSync20, readFileSync as readFileSync14, statSync as statSync2 } from "fs";
9842
+ import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as statSync2 } from "fs";
9850
9843
  import { basename as basename12, dirname as dirname14, extname as extname6, resolve as resolve26, relative as relative10 } from "path";
9851
9844
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
9852
9845
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
@@ -9979,7 +9972,7 @@ ${stubs}
9979
9972
  `)}
9980
9973
  ${code}`;
9981
9974
  }, reactTranspilerOptions, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
9982
- const raw = readFileSync14(filePath, "utf-8");
9975
+ const raw = readFileSync13(filePath, "utf-8");
9983
9976
  const valueExports = tsxTranspiler.scan(raw).exports;
9984
9977
  let transpiled = reactTranspiler.transformSync(raw);
9985
9978
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
@@ -9995,7 +9988,7 @@ ${transpiled}`;
9995
9988
  transpiled += buildIslandMetadataExports(raw);
9996
9989
  return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
9997
9990
  }, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
9998
- const raw = readFileSync14(filePath, "utf-8");
9991
+ const raw = readFileSync13(filePath, "utf-8");
9999
9992
  const ext = extname6(filePath);
10000
9993
  const isTS = ext === ".ts" || ext === ".tsx";
10001
9994
  const isTSX = ext === ".tsx" || ext === ".jsx";
@@ -10151,7 +10144,7 @@ ${code}`;
10151
10144
  ` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
10152
10145
  return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
10153
10146
  }, transformSvelteFile = async (filePath, projectRoot, rewriter) => {
10154
- const raw = readFileSync14(filePath, "utf-8");
10147
+ const raw = readFileSync13(filePath, "utf-8");
10155
10148
  if (!svelteCompiler) {
10156
10149
  svelteCompiler = await import("svelte/compiler");
10157
10150
  }
@@ -10209,7 +10202,7 @@ export default __script__;`;
10209
10202
  return `${cssInjection}
10210
10203
  ${code}`;
10211
10204
  }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir) => {
10212
- const raw = readFileSync14(filePath, "utf-8");
10205
+ const raw = readFileSync13(filePath, "utf-8");
10213
10206
  if (!vueCompiler) {
10214
10207
  vueCompiler = await import("@vue/compiler-sfc");
10215
10208
  }
@@ -10258,7 +10251,7 @@ ${code}`;
10258
10251
  }
10259
10252
  });
10260
10253
  }, handleCssRequest = (filePath) => {
10261
- const raw = readFileSync14(filePath, "utf-8");
10254
+ const raw = readFileSync13(filePath, "utf-8");
10262
10255
  const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
10263
10256
  return [
10264
10257
  `const style = document.createElement('style');`,
@@ -12208,7 +12201,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
12208
12201
  return Array.from(specifiers).filter(isResolvable3);
12209
12202
  }, generateEntrySource2 = (specifier) => `export * from '${specifier}';
12210
12203
  `, rewriteVendorFiles = async (vendorDir) => {
12211
- const { readdirSync: readdirSync2, readFileSync: readFileSync15, writeFileSync: writeFileSync8 } = await import("fs");
12204
+ const { readdirSync: readdirSync2, readFileSync: readFileSync14, writeFileSync: writeFileSync8 } = await import("fs");
12212
12205
  const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
12213
12206
  const reactPaths = Object.entries(computeVendorPaths2());
12214
12207
  const rewriteContent = (content) => reactPaths.reduce((acc, [specifier, webPath]) => {
@@ -12219,7 +12212,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
12219
12212
  const files = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
12220
12213
  for (const file3 of files) {
12221
12214
  const filePath = join22(vendorDir, file3);
12222
- const original = readFileSync15(filePath, "utf-8");
12215
+ const original = readFileSync14(filePath, "utf-8");
12223
12216
  const rewritten = rewriteContent(original);
12224
12217
  if (rewritten !== original)
12225
12218
  writeFileSync8(filePath, rewritten);
@@ -12618,5 +12611,5 @@ export {
12618
12611
  build
12619
12612
  };
12620
12613
 
12621
- //# debugId=C1C8D716AF311CB564756E2164756E21
12614
+ //# debugId=EC4B4C99B57596EF64756E2164756E21
12622
12615
  //# sourceMappingURL=build.js.map