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

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,9 +2502,10 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
2502
2502
  });
2503
2503
 
2504
2504
  // src/build/stylePreprocessor.ts
2505
+ import { readFileSync as readFileSync3 } from "fs";
2505
2506
  import { readFile } from "fs/promises";
2506
2507
  import { dirname as dirname2, extname } from "path";
2507
- var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, 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) => {
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) => {
2508
2509
  const normalized = filePathOrLanguage.toLowerCase();
2509
2510
  if (normalized === "scss" || normalized.endsWith(".scss"))
2510
2511
  return "scss";
@@ -2568,12 +2569,34 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2568
2569
  return readFile(filePath, "utf-8");
2569
2570
  }
2570
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;
2571
2593
  };
2572
2594
  var init_stylePreprocessor = __esm(() => {
2573
2595
  STYLE_EXTENSION_PATTERN = /\.(s[ac]ss|less)$/i;
2574
2596
  STYLE_MODULE_EXTENSION_PATTERN = /\.module\.(s[ac]ss|less)$/i;
2575
2597
  STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less)$/i;
2576
2598
  importOptionalPeer = new Function("specifier", "return import(specifier)");
2599
+ requireOptionalPeer = new Function("specifier", "return require(specifier)");
2577
2600
  stylePreprocessorPlugin = {
2578
2601
  name: "absolute-style-preprocessor",
2579
2602
  setup(build) {
@@ -3214,7 +3237,7 @@ var init_staticStreaming = __esm(() => {
3214
3237
  });
3215
3238
 
3216
3239
  // src/build/staticIslandPages.ts
3217
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
3240
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
3218
3241
  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) => {
3219
3242
  const attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, "g");
3220
3243
  const attributes = new Map;
@@ -3343,7 +3366,7 @@ var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:
3343
3366
  }
3344
3367
  return result + originalHtml.slice(nextIndex);
3345
3368
  }, transformStaticPage = async (pagePath, registry) => {
3346
- const originalHtml = readFileSync3(pagePath, "utf-8");
3369
+ const originalHtml = readFileSync4(pagePath, "utf-8");
3347
3370
  const transformedHtml = await transformStaticPageHtml(originalHtml, registry);
3348
3371
  if (transformedHtml !== originalHtml) {
3349
3372
  writeFileSync3(pagePath, transformedHtml);
@@ -3471,7 +3494,7 @@ var init_sourceMetadata = __esm(() => {
3471
3494
  });
3472
3495
 
3473
3496
  // src/islands/pageMetadata.ts
3474
- import { readFileSync as readFileSync4 } from "fs";
3497
+ import { readFileSync as readFileSync5 } from "fs";
3475
3498
  import { dirname as dirname5, resolve as resolve8 } from "path";
3476
3499
  var pagePatterns, getPageDirs = (config) => [
3477
3500
  { dir: config.angularDirectory, framework: "angular" },
@@ -3513,7 +3536,7 @@ var pagePatterns, getPageDirs = (config) => [
3513
3536
  return;
3514
3537
  const files = await scanEntryPoints(resolve8(entry.dir), pattern);
3515
3538
  for (const filePath of files) {
3516
- const source = readFileSync4(filePath, "utf-8");
3539
+ const source = readFileSync5(filePath, "utf-8");
3517
3540
  const islands = extractIslandUsagesFromSource(source);
3518
3541
  pageMetadata.set(resolve8(filePath), {
3519
3542
  islands: resolveIslandUsages(islands, islandSourceLookup),
@@ -4113,7 +4136,7 @@ var init_scanCssEntryPoints = __esm(() => {
4113
4136
  });
4114
4137
 
4115
4138
  // src/utils/imageProcessing.ts
4116
- import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
4139
+ import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
4117
4140
  import { join as join6, resolve as resolve10 } from "path";
4118
4141
  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) => {
4119
4142
  for (const size of sizes) {
@@ -4229,8 +4252,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
4229
4252
  if (!existsSync8(metaPath) || !existsSync8(dataPath))
4230
4253
  return null;
4231
4254
  try {
4232
- const meta = JSON.parse(readFileSync5(metaPath, "utf-8"));
4233
- const buffer = readFileSync5(dataPath);
4255
+ const meta = JSON.parse(readFileSync6(metaPath, "utf-8"));
4256
+ const buffer = readFileSync6(dataPath);
4234
4257
  return { buffer, meta };
4235
4258
  } catch {
4236
4259
  return null;
@@ -4345,14 +4368,14 @@ var init_optimizeHtmlImages = __esm(() => {
4345
4368
  });
4346
4369
 
4347
4370
  // src/cli/scripts/telemetry.ts
4348
- import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
4371
+ import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
4349
4372
  import { homedir } from "os";
4350
4373
  import { join as join7 } from "path";
4351
4374
  var configDir, configPath, getTelemetryConfig = () => {
4352
4375
  try {
4353
4376
  if (!existsSync9(configPath))
4354
4377
  return null;
4355
- const raw = readFileSync6(configPath, "utf-8");
4378
+ const raw = readFileSync7(configPath, "utf-8");
4356
4379
  const config = JSON.parse(raw);
4357
4380
  return config;
4358
4381
  } catch {
@@ -4365,14 +4388,14 @@ var init_telemetry = __esm(() => {
4365
4388
  });
4366
4389
 
4367
4390
  // src/cli/telemetryEvent.ts
4368
- import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
4391
+ import { existsSync as existsSync10, readFileSync as readFileSync8 } from "fs";
4369
4392
  import { arch, platform } from "os";
4370
4393
  import { dirname as dirname6, join as join8, parse } from "path";
4371
4394
  var checkCandidate = (candidate) => {
4372
4395
  if (!existsSync10(candidate)) {
4373
4396
  return null;
4374
4397
  }
4375
- const pkg = JSON.parse(readFileSync7(candidate, "utf-8"));
4398
+ const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
4376
4399
  if (pkg.name === "@absolutejs/absolute") {
4377
4400
  const ver = pkg.version;
4378
4401
  return ver;
@@ -4679,7 +4702,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
4679
4702
  };
4680
4703
 
4681
4704
  // src/build/angularLinkerPlugin.ts
4682
- import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync8, writeFileSync as writeFileSync6 } from "fs";
4705
+ import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "fs";
4683
4706
  import { dirname as dirname7, join as join9, relative as relative4, resolve as resolve13 } from "path";
4684
4707
  import { createHash } from "crypto";
4685
4708
  var CACHE_DIR, angularLinkerPlugin;
@@ -4706,7 +4729,7 @@ var init_angularLinkerPlugin = __esm(() => {
4706
4729
  const cachePath = join9(CACHE_DIR, `${hash}.js`);
4707
4730
  if (existsSync12(cachePath)) {
4708
4731
  return {
4709
- contents: readFileSync8(cachePath, "utf-8"),
4732
+ contents: readFileSync9(cachePath, "utf-8"),
4710
4733
  loader: "js"
4711
4734
  };
4712
4735
  }
@@ -4722,7 +4745,7 @@ var init_angularLinkerPlugin = __esm(() => {
4722
4745
  fileSystem: {
4723
4746
  dirname: dirname7,
4724
4747
  exists: existsSync12,
4725
- readFile: readFileSync8,
4748
+ readFile: readFileSync9,
4726
4749
  relative: relative4,
4727
4750
  resolve: resolve13
4728
4751
  },
@@ -6137,13 +6160,13 @@ __export(exports_compileAngular, {
6137
6160
  compileAngularFile: () => compileAngularFile,
6138
6161
  compileAngular: () => compileAngular
6139
6162
  });
6140
- import { existsSync as existsSync15, readFileSync as readFileSync9, promises as fs } from "fs";
6163
+ import { existsSync as existsSync15, readFileSync as readFileSync10, promises as fs } from "fs";
6141
6164
  import { join as join13, basename as basename7, sep as sep3, dirname as dirname10, resolve as resolve18, relative as relative8 } from "path";
6142
6165
  import ts2 from "typescript";
6143
6166
  import { createHash as createHash2 } from "crypto";
6144
6167
  var computeConfigHash = () => {
6145
6168
  try {
6146
- const content = readFileSync9("./tsconfig.json", "utf-8");
6169
+ const content = readFileSync10("./tsconfig.json", "utf-8");
6147
6170
  return createHash2("md5").update(content).digest("hex");
6148
6171
  } catch {
6149
6172
  return "";
@@ -6201,7 +6224,7 @@ ${registrations}
6201
6224
  return fileName.substring(outDir.length + 1);
6202
6225
  return fileName;
6203
6226
  }, compileAngularFile = async (inputPath, outDir) => {
6204
- const islandMetadataExports = buildIslandMetadataExports(readFileSync9(inputPath, "utf-8"));
6227
+ const islandMetadataExports = buildIslandMetadataExports(readFileSync10(inputPath, "utf-8"));
6205
6228
  const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
6206
6229
  const configHash = computeConfigHash();
6207
6230
  const cached = globalThis.__angularCompilerCache;
@@ -6281,7 +6304,7 @@ ${registrations}
6281
6304
  const cached2 = aotTransformCache.get(resolvedPath);
6282
6305
  if (cached2 !== undefined)
6283
6306
  return cached2;
6284
- const transformed = inlineTemplateAndLowerDeferSync(source, dirname10(resolvedPath)).source;
6307
+ const transformed = inlineResourcesSync(source, dirname10(resolvedPath)).source;
6285
6308
  aotTransformCache.set(resolvedPath, transformed);
6286
6309
  return transformed;
6287
6310
  };
@@ -6498,7 +6521,7 @@ ${fields}
6498
6521
  if (!existsSync15(templatePath)) {
6499
6522
  return { deferSlots: [], source };
6500
6523
  }
6501
- const templateRaw2 = readFileSync9(templatePath, "utf-8");
6524
+ const templateRaw2 = readFileSync10(templatePath, "utf-8");
6502
6525
  const lowered2 = lowerAngularDeferSyntax(templateRaw2);
6503
6526
  const escaped2 = escapeTemplateContent(lowered2.template);
6504
6527
  const replacedSource2 = source.replace(/templateUrl\s*:\s*['"][^'"]+['"]/, `template: \`${escaped2}\``);
@@ -6522,6 +6545,42 @@ ${fields}
6522
6545
  deferSlots: lowered.slots,
6523
6546
  source: injectDeferSlotFields(replacedSource, lowered.slots, resolveAngularDeferImportSpecifier())
6524
6547
  };
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
+ };
6525
6584
  }, inlineStyleUrls = async (source, fileDir) => {
6526
6585
  const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
6527
6586
  if (!styleUrlsMatch?.[1])
@@ -7093,11 +7152,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
7093
7152
  console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
7094
7153
  return;
7095
7154
  }
7096
- const { readFileSync: readFileSync10, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
7155
+ const { readFileSync: readFileSync11, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
7097
7156
  const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
7098
7157
  for (const file4 of files) {
7099
7158
  const filePath = join16(vendorDir, file4);
7100
- const content = readFileSync10(filePath, "utf-8");
7159
+ const content = readFileSync11(filePath, "utf-8");
7101
7160
  if (!content.includes("__VUE_HMR_RUNTIME__"))
7102
7161
  continue;
7103
7162
  const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
@@ -7222,7 +7281,7 @@ import {
7222
7281
  cpSync,
7223
7282
  existsSync as existsSync17,
7224
7283
  mkdirSync as mkdirSync10,
7225
- readFileSync as readFileSync10,
7284
+ readFileSync as readFileSync11,
7226
7285
  rmSync as rmSync2,
7227
7286
  statSync,
7228
7287
  writeFileSync as writeFileSync7
@@ -7343,7 +7402,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7343
7402
  addWorkerPathIfExists(file4, relPath, workerPaths);
7344
7403
  }
7345
7404
  }, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
7346
- const content = readFileSync10(file4, "utf-8");
7405
+ const content = readFileSync11(file4, "utf-8");
7347
7406
  for (const pattern of patterns) {
7348
7407
  collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
7349
7408
  }
@@ -7394,7 +7453,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7394
7453
  const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
7395
7454
  const pagesRel = relative9(process.cwd(), resolve20(reactPagesPath)).replace(/\\/g, "/");
7396
7455
  for (const file4 of indexFiles) {
7397
- let content = readFileSync10(join18(reactIndexesPath, file4), "utf-8");
7456
+ let content = readFileSync11(join18(reactIndexesPath, file4), "utf-8");
7398
7457
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
7399
7458
  writeFileSync7(join18(devIndexDir, file4), content);
7400
7459
  }
@@ -7406,7 +7465,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7406
7465
  const indexFile = join18(svelteIndexDir, "pages", `${name}.js`);
7407
7466
  if (!existsSync17(indexFile))
7408
7467
  continue;
7409
- let content = readFileSync10(indexFile, "utf-8");
7468
+ let content = readFileSync11(indexFile, "utf-8");
7410
7469
  const srcRel = relative9(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
7411
7470
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
7412
7471
  writeFileSync7(join18(devIndexDir, `${name}.svelte.js`), content);
@@ -7419,7 +7478,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7419
7478
  const indexFile = join18(vueIndexDir, `${name}.js`);
7420
7479
  if (!existsSync17(indexFile))
7421
7480
  continue;
7422
- let content = readFileSync10(indexFile, "utf-8");
7481
+ let content = readFileSync11(indexFile, "utf-8");
7423
7482
  const srcRel = relative9(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
7424
7483
  content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
7425
7484
  writeFileSync7(join18(devIndexDir, `${name}.vue.js`), content);
@@ -7470,7 +7529,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7470
7529
  }
7471
7530
  return result;
7472
7531
  }, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
7473
- let content = readFileSync10(outputPath, "utf-8");
7532
+ let content = readFileSync11(outputPath, "utf-8");
7474
7533
  const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
7475
7534
  const useNames = [];
7476
7535
  let match;
@@ -7520,7 +7579,7 @@ ${content.slice(firstUseIdx)}`;
7520
7579
  }, rewriteUrlReferences = (outputPaths, urlFileMap) => {
7521
7580
  const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
7522
7581
  for (const outputPath of outputPaths) {
7523
- let content = readFileSync10(outputPath, "utf-8");
7582
+ let content = readFileSync11(outputPath, "utf-8");
7524
7583
  let changed = false;
7525
7584
  content = content.replace(urlPattern, (_match, relPath) => {
7526
7585
  const targetName = basename8(relPath);
@@ -8175,7 +8234,7 @@ ${content.slice(firstUseIdx)}`;
8175
8234
  const injectHMRIntoHTMLFile = (filePath, framework) => {
8176
8235
  if (!hmrClientBundle)
8177
8236
  return;
8178
- let html = readFileSync10(filePath, "utf-8");
8237
+ let html = readFileSync11(filePath, "utf-8");
8179
8238
  if (html.includes("data-hmr-client"))
8180
8239
  return;
8181
8240
  const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
@@ -8336,7 +8395,7 @@ var init_build = __esm(() => {
8336
8395
  });
8337
8396
 
8338
8397
  // src/dev/dependencyGraph.ts
8339
- import { existsSync as existsSync18, readFileSync as readFileSync11 } from "fs";
8398
+ import { existsSync as existsSync18, readFileSync as readFileSync12 } from "fs";
8340
8399
  var {Glob: Glob7 } = globalThis.Bun;
8341
8400
  import { resolve as resolve21 } from "path";
8342
8401
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
@@ -8497,15 +8556,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
8497
8556
  const lowerPath = filePath.toLowerCase();
8498
8557
  const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
8499
8558
  if (loader === "html") {
8500
- const content = readFileSync11(filePath, "utf-8");
8559
+ const content = readFileSync12(filePath, "utf-8");
8501
8560
  return extractHtmlDependencies(filePath, content);
8502
8561
  }
8503
8562
  if (loader === "tsx" || loader === "js") {
8504
- const content = readFileSync11(filePath, "utf-8");
8563
+ const content = readFileSync12(filePath, "utf-8");
8505
8564
  return extractJsDependencies(filePath, content, loader);
8506
8565
  }
8507
8566
  if (isSvelteOrVue) {
8508
- const content = readFileSync11(filePath, "utf-8");
8567
+ const content = readFileSync12(filePath, "utf-8");
8509
8568
  return extractSvelteVueDependencies(filePath, content);
8510
8569
  }
8511
8570
  return [];
@@ -8972,10 +9031,10 @@ var init_assetStore = __esm(() => {
8972
9031
  });
8973
9032
 
8974
9033
  // src/dev/fileHashTracker.ts
8975
- import { readFileSync as readFileSync12 } from "fs";
9034
+ import { readFileSync as readFileSync13 } from "fs";
8976
9035
  var computeFileHash = (filePath) => {
8977
9036
  try {
8978
- const fileContent = readFileSync12(filePath);
9037
+ const fileContent = readFileSync13(filePath);
8979
9038
  return Number(Bun.hash(fileContent));
8980
9039
  } catch {
8981
9040
  return UNFOUND_INDEX;
@@ -9799,7 +9858,7 @@ __export(exports_moduleServer, {
9799
9858
  createModuleServer: () => createModuleServer,
9800
9859
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
9801
9860
  });
9802
- import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as statSync2 } from "fs";
9861
+ import { existsSync as existsSync20, readFileSync as readFileSync14, statSync as statSync2 } from "fs";
9803
9862
  import { basename as basename12, dirname as dirname14, extname as extname6, resolve as resolve28, relative as relative10 } from "path";
9804
9863
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
9805
9864
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
@@ -9932,7 +9991,7 @@ ${stubs}
9932
9991
  `)}
9933
9992
  ${code}`;
9934
9993
  }, reactTranspilerOptions, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
9935
- const raw = readFileSync13(filePath, "utf-8");
9994
+ const raw = readFileSync14(filePath, "utf-8");
9936
9995
  const valueExports = tsxTranspiler.scan(raw).exports;
9937
9996
  let transpiled = reactTranspiler.transformSync(raw);
9938
9997
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
@@ -9948,7 +10007,7 @@ ${transpiled}`;
9948
10007
  transpiled += buildIslandMetadataExports(raw);
9949
10008
  return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
9950
10009
  }, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
9951
- const raw = readFileSync13(filePath, "utf-8");
10010
+ const raw = readFileSync14(filePath, "utf-8");
9952
10011
  const ext = extname6(filePath);
9953
10012
  const isTS = ext === ".ts" || ext === ".tsx";
9954
10013
  const isTSX = ext === ".tsx" || ext === ".jsx";
@@ -10104,7 +10163,7 @@ ${code}`;
10104
10163
  ` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
10105
10164
  return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
10106
10165
  }, transformSvelteFile = async (filePath, projectRoot, rewriter) => {
10107
- const raw = readFileSync13(filePath, "utf-8");
10166
+ const raw = readFileSync14(filePath, "utf-8");
10108
10167
  if (!svelteCompiler) {
10109
10168
  svelteCompiler = await import("svelte/compiler");
10110
10169
  }
@@ -10162,7 +10221,7 @@ export default __script__;`;
10162
10221
  return `${cssInjection}
10163
10222
  ${code}`;
10164
10223
  }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir) => {
10165
- const raw = readFileSync13(filePath, "utf-8");
10224
+ const raw = readFileSync14(filePath, "utf-8");
10166
10225
  if (!vueCompiler) {
10167
10226
  vueCompiler = await import("@vue/compiler-sfc");
10168
10227
  }
@@ -10211,7 +10270,7 @@ ${code}`;
10211
10270
  }
10212
10271
  });
10213
10272
  }, handleCssRequest = (filePath) => {
10214
- const raw = readFileSync13(filePath, "utf-8");
10273
+ const raw = readFileSync14(filePath, "utf-8");
10215
10274
  const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
10216
10275
  return [
10217
10276
  `const style = document.createElement('style');`,
@@ -12141,7 +12200,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
12141
12200
  return Array.from(specifiers).filter(isResolvable3);
12142
12201
  }, generateEntrySource2 = (specifier) => `export * from '${specifier}';
12143
12202
  `, rewriteVendorFiles = async (vendorDir) => {
12144
- const { readdirSync: readdirSync2, readFileSync: readFileSync14, writeFileSync: writeFileSync8 } = await import("fs");
12203
+ const { readdirSync: readdirSync2, readFileSync: readFileSync15, writeFileSync: writeFileSync8 } = await import("fs");
12145
12204
  const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
12146
12205
  const reactPaths = Object.entries(computeVendorPaths2());
12147
12206
  const rewriteContent = (content) => reactPaths.reduce((acc, [specifier, webPath]) => {
@@ -12152,7 +12211,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
12152
12211
  const files = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
12153
12212
  for (const file4 of files) {
12154
12213
  const filePath = join21(vendorDir, file4);
12155
- const original = readFileSync14(filePath, "utf-8");
12214
+ const original = readFileSync15(filePath, "utf-8");
12156
12215
  const rewritten = rewriteContent(original);
12157
12216
  if (rewritten !== original)
12158
12217
  writeFileSync8(filePath, rewritten);
@@ -12664,7 +12723,7 @@ __export(exports_devtoolsJson, {
12664
12723
  normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
12665
12724
  devtoolsJson: () => devtoolsJson
12666
12725
  });
12667
- import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync14, writeFileSync as writeFileSync8 } from "fs";
12726
+ import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync15, writeFileSync as writeFileSync8 } from "fs";
12668
12727
  import { dirname as dirname17, join as join22, resolve as resolve33 } from "path";
12669
12728
  import { Elysia as Elysia3 } from "elysia";
12670
12729
  var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
@@ -12674,7 +12733,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
12674
12733
  if (!existsSync22(cachePath))
12675
12734
  return null;
12676
12735
  try {
12677
- const value = readFileSync14(cachePath, "utf-8").trim();
12736
+ const value = readFileSync15(cachePath, "utf-8").trim();
12678
12737
  return isUuidV4(value) ? value : null;
12679
12738
  } catch {
12680
12739
  return null;
@@ -13029,7 +13088,7 @@ __export(exports_prerender, {
13029
13088
  prerender: () => prerender,
13030
13089
  PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
13031
13090
  });
13032
- import { mkdirSync as mkdirSync13, readFileSync as readFileSync15 } from "fs";
13091
+ import { mkdirSync as mkdirSync13, readFileSync as readFileSync16 } from "fs";
13033
13092
  import { join as join23 } from "path";
13034
13093
  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) => {
13035
13094
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
@@ -13037,7 +13096,7 @@ var MAX_STARTUP_ATTEMPTS = 50, STARTUP_POLL_INTERVAL_MS = 100, PRERENDER_BYPASS_
13037
13096
  }, readTimestamp = (htmlPath) => {
13038
13097
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
13039
13098
  try {
13040
- const content = readFileSync15(metaPath, "utf-8");
13099
+ const content = readFileSync16(metaPath, "utf-8");
13041
13100
  return Number(content) || 0;
13042
13101
  } catch {
13043
13102
  return 0;
@@ -13377,7 +13436,7 @@ var handleHTMXPageRequest = async (pagePath) => {
13377
13436
  });
13378
13437
  };
13379
13438
  // src/core/prepare.ts
13380
- import { existsSync as existsSync24, readdirSync as readdirSync2, readFileSync as readFileSync16 } from "fs";
13439
+ import { existsSync as existsSync24, readdirSync as readdirSync2, readFileSync as readFileSync17 } from "fs";
13381
13440
  import { basename as basename14, join as join24, relative as relative12, resolve as resolve35 } from "path";
13382
13441
  import { Elysia as Elysia5 } from "elysia";
13383
13442
 
@@ -13739,7 +13798,7 @@ var prepare = async (configOrPath) => {
13739
13798
  return result;
13740
13799
  }
13741
13800
  stepStartedAt = performance.now();
13742
- const manifest = JSON.parse(readFileSync16(`${buildDir}/manifest.json`, "utf-8"));
13801
+ const manifest = JSON.parse(readFileSync17(`${buildDir}/manifest.json`, "utf-8"));
13743
13802
  setCurrentIslandManifest(manifest);
13744
13803
  if (config.islands?.registry) {
13745
13804
  setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
@@ -13749,7 +13808,7 @@ var prepare = async (configOrPath) => {
13749
13808
  stepStartedAt = performance.now();
13750
13809
  const conventionsPath = join24(buildDir, "conventions.json");
13751
13810
  if (existsSync24(conventionsPath)) {
13752
- const conventions2 = JSON.parse(readFileSync16(conventionsPath, "utf-8"));
13811
+ const conventions2 = JSON.parse(readFileSync17(conventionsPath, "utf-8"));
13753
13812
  setConventions(conventions2);
13754
13813
  }
13755
13814
  recordStep("load production conventions", stepStartedAt);
@@ -13818,7 +13877,7 @@ import { argv } from "process";
13818
13877
  var {env: env4 } = globalThis.Bun;
13819
13878
 
13820
13879
  // src/dev/devCert.ts
13821
- import { existsSync as existsSync25, mkdirSync as mkdirSync14, readFileSync as readFileSync17, rmSync as rmSync3 } from "fs";
13880
+ import { existsSync as existsSync25, mkdirSync as mkdirSync14, readFileSync as readFileSync18, rmSync as rmSync3 } from "fs";
13822
13881
  import { join as join25 } from "path";
13823
13882
  var CERT_DIR = join25(process.cwd(), ".absolutejs");
13824
13883
  var CERT_PATH = join25(CERT_DIR, "cert.pem");
@@ -13829,7 +13888,7 @@ var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1
13829
13888
  var certFilesExist = () => existsSync25(CERT_PATH) && existsSync25(KEY_PATH);
13830
13889
  var isCertExpired = () => {
13831
13890
  try {
13832
- const certPem = readFileSync17(CERT_PATH, "utf-8");
13891
+ const certPem = readFileSync18(CERT_PATH, "utf-8");
13833
13892
  const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
13834
13893
  stdin: new TextEncoder().encode(certPem)
13835
13894
  });
@@ -13925,8 +13984,8 @@ var loadDevCert = () => {
13925
13984
  return null;
13926
13985
  try {
13927
13986
  return {
13928
- cert: readFileSync17(paths.cert, "utf-8"),
13929
- key: readFileSync17(paths.key, "utf-8")
13987
+ cert: readFileSync18(paths.cert, "utf-8"),
13988
+ key: readFileSync18(paths.key, "utf-8")
13930
13989
  };
13931
13990
  } catch {
13932
13991
  return null;
@@ -14154,7 +14213,7 @@ var jsonLd2 = (schema) => {
14154
14213
  };
14155
14214
  // src/utils/defineEnv.ts
14156
14215
  var {env: bunEnv } = globalThis.Bun;
14157
- import { existsSync as existsSync26, readFileSync as readFileSync18 } from "fs";
14216
+ import { existsSync as existsSync26, readFileSync as readFileSync19 } from "fs";
14158
14217
  import { resolve as resolve36 } from "path";
14159
14218
 
14160
14219
  // node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
@@ -20196,13 +20255,13 @@ var checkEnvFileSecurity = (properties) => {
20196
20255
  const sensitiveKeys = Object.keys(properties).filter(isSensitive);
20197
20256
  if (sensitiveKeys.length === 0)
20198
20257
  return;
20199
- const envContent = readFileSync18(envPath, "utf-8");
20258
+ const envContent = readFileSync19(envPath, "utf-8");
20200
20259
  const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
20201
20260
  if (presentKeys.length === 0)
20202
20261
  return;
20203
20262
  const gitignorePath = resolve36(cwd2, ".gitignore");
20204
20263
  if (existsSync26(gitignorePath)) {
20205
- const gitignore = readFileSync18(gitignorePath, "utf-8");
20264
+ const gitignore = readFileSync19(gitignorePath, "utf-8");
20206
20265
  if (gitignore.split(`
20207
20266
  `).some((line) => line.trim() === ".env"))
20208
20267
  return;
@@ -20409,5 +20468,5 @@ export {
20409
20468
  ANGULAR_INIT_TIMEOUT_MS
20410
20469
  };
20411
20470
 
20412
- //# debugId=4DDBB3DDB2CC814764756E2164756E21
20471
+ //# debugId=6C9DFD7661C7542C64756E2164756E21
20413
20472
  //# sourceMappingURL=index.js.map