@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/index.js CHANGED
@@ -2502,7 +2502,6 @@ 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
2506
  import { createRequire } from "module";
2508
2507
  import { dirname as dirname2, extname, join as join3 } from "path";
@@ -2515,13 +2514,7 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2515
2514
  if (normalized === "less" || normalized.endsWith(".less"))
2516
2515
  return "less";
2517
2516
  return null;
2518
- }, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), requireOptionalPeerSync = (specifier) => {
2519
- try {
2520
- return requireFromCwd(specifier);
2521
- } catch {
2522
- return requireOptionalPeer(specifier);
2523
- }
2524
- }, compileStyleSource = async (filePath, source, languageHint) => {
2517
+ }, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), compileStyleSource = async (filePath, source, languageHint) => {
2525
2518
  const language = getStyleLanguage(languageHint ?? filePath);
2526
2519
  const contents = source ?? await readFile(filePath, "utf-8");
2527
2520
  if (language === "scss" || language === "sass") {
@@ -2576,27 +2569,6 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2576
2569
  return readFile(filePath, "utf-8");
2577
2570
  }
2578
2571
  return compileStyleSource(filePath);
2579
- }, compileStyleFileIfNeededSync = (filePath) => {
2580
- const contents = readFileSync3(filePath, "utf-8");
2581
- const language = getStyleLanguage(filePath);
2582
- if (language === "scss" || language === "sass") {
2583
- let sass;
2584
- try {
2585
- sass = requireOptionalPeerSync("sass");
2586
- } catch {
2587
- throw missingDependencyError("sass", filePath);
2588
- }
2589
- return sass.compileString(contents, {
2590
- loadPaths: [dirname2(filePath), process.cwd()],
2591
- style: "expanded",
2592
- syntax: language === "sass" ? "indented" : "scss",
2593
- url: new URL(`file://${filePath}`)
2594
- }).css;
2595
- }
2596
- if (language === "less") {
2597
- 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.`);
2598
- }
2599
- return contents;
2600
2572
  };
2601
2573
  var init_stylePreprocessor = __esm(() => {
2602
2574
  STYLE_EXTENSION_PATTERN = /\.(s[ac]ss|less)$/i;
@@ -3245,7 +3217,7 @@ var init_staticStreaming = __esm(() => {
3245
3217
  });
3246
3218
 
3247
3219
  // src/build/staticIslandPages.ts
3248
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
3220
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
3249
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) => {
3250
3222
  const attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, "g");
3251
3223
  const attributes = new Map;
@@ -3374,7 +3346,7 @@ var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:
3374
3346
  }
3375
3347
  return result + originalHtml.slice(nextIndex);
3376
3348
  }, transformStaticPage = async (pagePath, registry) => {
3377
- const originalHtml = readFileSync4(pagePath, "utf-8");
3349
+ const originalHtml = readFileSync3(pagePath, "utf-8");
3378
3350
  const transformedHtml = await transformStaticPageHtml(originalHtml, registry);
3379
3351
  if (transformedHtml !== originalHtml) {
3380
3352
  writeFileSync3(pagePath, transformedHtml);
@@ -3502,7 +3474,7 @@ var init_sourceMetadata = __esm(() => {
3502
3474
  });
3503
3475
 
3504
3476
  // src/islands/pageMetadata.ts
3505
- import { readFileSync as readFileSync5 } from "fs";
3477
+ import { readFileSync as readFileSync4 } from "fs";
3506
3478
  import { dirname as dirname5, resolve as resolve8 } from "path";
3507
3479
  var pagePatterns, getPageDirs = (config) => [
3508
3480
  { dir: config.angularDirectory, framework: "angular" },
@@ -3544,7 +3516,7 @@ var pagePatterns, getPageDirs = (config) => [
3544
3516
  return;
3545
3517
  const files = await scanEntryPoints(resolve8(entry.dir), pattern);
3546
3518
  for (const filePath of files) {
3547
- const source = readFileSync5(filePath, "utf-8");
3519
+ const source = readFileSync4(filePath, "utf-8");
3548
3520
  const islands = extractIslandUsagesFromSource(source);
3549
3521
  pageMetadata.set(resolve8(filePath), {
3550
3522
  islands: resolveIslandUsages(islands, islandSourceLookup),
@@ -4144,7 +4116,7 @@ var init_scanCssEntryPoints = __esm(() => {
4144
4116
  });
4145
4117
 
4146
4118
  // src/utils/imageProcessing.ts
4147
- import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
4119
+ import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
4148
4120
  import { join as join7, resolve as resolve10 } from "path";
4149
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) => {
4150
4122
  for (const size of sizes) {
@@ -4260,8 +4232,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
4260
4232
  if (!existsSync8(metaPath) || !existsSync8(dataPath))
4261
4233
  return null;
4262
4234
  try {
4263
- const meta = JSON.parse(readFileSync6(metaPath, "utf-8"));
4264
- const buffer = readFileSync6(dataPath);
4235
+ const meta = JSON.parse(readFileSync5(metaPath, "utf-8"));
4236
+ const buffer = readFileSync5(dataPath);
4265
4237
  return { buffer, meta };
4266
4238
  } catch {
4267
4239
  return null;
@@ -4376,14 +4348,14 @@ var init_optimizeHtmlImages = __esm(() => {
4376
4348
  });
4377
4349
 
4378
4350
  // src/cli/scripts/telemetry.ts
4379
- 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";
4380
4352
  import { homedir } from "os";
4381
4353
  import { join as join8 } from "path";
4382
4354
  var configDir, configPath, getTelemetryConfig = () => {
4383
4355
  try {
4384
4356
  if (!existsSync9(configPath))
4385
4357
  return null;
4386
- const raw = readFileSync7(configPath, "utf-8");
4358
+ const raw = readFileSync6(configPath, "utf-8");
4387
4359
  const config = JSON.parse(raw);
4388
4360
  return config;
4389
4361
  } catch {
@@ -4396,14 +4368,14 @@ var init_telemetry = __esm(() => {
4396
4368
  });
4397
4369
 
4398
4370
  // src/cli/telemetryEvent.ts
4399
- import { existsSync as existsSync10, readFileSync as readFileSync8 } from "fs";
4371
+ import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
4400
4372
  import { arch, platform } from "os";
4401
4373
  import { dirname as dirname6, join as join9, parse } from "path";
4402
4374
  var checkCandidate = (candidate) => {
4403
4375
  if (!existsSync10(candidate)) {
4404
4376
  return null;
4405
4377
  }
4406
- const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
4378
+ const pkg = JSON.parse(readFileSync7(candidate, "utf-8"));
4407
4379
  if (pkg.name === "@absolutejs/absolute") {
4408
4380
  const ver = pkg.version;
4409
4381
  return ver;
@@ -4710,7 +4682,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
4710
4682
  };
4711
4683
 
4712
4684
  // src/build/angularLinkerPlugin.ts
4713
- import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "fs";
4685
+ import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync8, writeFileSync as writeFileSync6 } from "fs";
4714
4686
  import { dirname as dirname7, join as join10, relative as relative4, resolve as resolve13 } from "path";
4715
4687
  import { createHash } from "crypto";
4716
4688
  var CACHE_DIR, angularLinkerPlugin;
@@ -4737,7 +4709,7 @@ var init_angularLinkerPlugin = __esm(() => {
4737
4709
  const cachePath = join10(CACHE_DIR, `${hash}.js`);
4738
4710
  if (existsSync12(cachePath)) {
4739
4711
  return {
4740
- contents: readFileSync9(cachePath, "utf-8"),
4712
+ contents: readFileSync8(cachePath, "utf-8"),
4741
4713
  loader: "js"
4742
4714
  };
4743
4715
  }
@@ -4753,7 +4725,7 @@ var init_angularLinkerPlugin = __esm(() => {
4753
4725
  fileSystem: {
4754
4726
  dirname: dirname7,
4755
4727
  exists: existsSync12,
4756
- readFile: readFileSync9,
4728
+ readFile: readFileSync8,
4757
4729
  relative: relative4,
4758
4730
  resolve: resolve13
4759
4731
  },
@@ -6168,13 +6140,13 @@ __export(exports_compileAngular, {
6168
6140
  compileAngularFile: () => compileAngularFile,
6169
6141
  compileAngular: () => compileAngular
6170
6142
  });
6171
- import { existsSync as existsSync15, readFileSync as readFileSync10, promises as fs } from "fs";
6143
+ import { existsSync as existsSync15, readFileSync as readFileSync9, promises as fs } from "fs";
6172
6144
  import { join as join14, basename as basename7, sep as sep3, dirname as dirname10, resolve as resolve18, relative as relative8 } from "path";
6173
6145
  import ts2 from "typescript";
6174
6146
  import { createHash as createHash2 } from "crypto";
6175
6147
  var computeConfigHash = () => {
6176
6148
  try {
6177
- const content = readFileSync10("./tsconfig.json", "utf-8");
6149
+ const content = readFileSync9("./tsconfig.json", "utf-8");
6178
6150
  return createHash2("md5").update(content).digest("hex");
6179
6151
  } catch {
6180
6152
  return "";
@@ -6231,8 +6203,70 @@ ${registrations}
6231
6203
  if (fileName.startsWith(outDir))
6232
6204
  return fileName.substring(outDir.length + 1);
6233
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;
6234
6268
  }, compileAngularFile = async (inputPath, outDir) => {
6235
- const islandMetadataExports = buildIslandMetadataExports(readFileSync10(inputPath, "utf-8"));
6269
+ const islandMetadataExports = buildIslandMetadataExports(readFileSync9(inputPath, "utf-8"));
6236
6270
  const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
6237
6271
  const configHash = computeConfigHash();
6238
6272
  const cached = globalThis.__angularCompilerCache;
@@ -6300,7 +6334,7 @@ ${registrations}
6300
6334
  emitted[relativePath] = text;
6301
6335
  };
6302
6336
  const originalReadFile = host.readFile;
6303
- const aotTransformCache = new Map;
6337
+ const aotTransformedSources = await precomputeAotResourceTransforms(inputPath, originalReadFile?.bind(host));
6304
6338
  host.readFile = (fileName) => {
6305
6339
  const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
6306
6340
  if (typeof source !== "string")
@@ -6309,12 +6343,7 @@ ${registrations}
6309
6343
  return source;
6310
6344
  }
6311
6345
  const resolvedPath = resolve18(fileName);
6312
- const cached2 = aotTransformCache.get(resolvedPath);
6313
- if (cached2 !== undefined)
6314
- return cached2;
6315
- const transformed = inlineResourcesSync(source, dirname10(resolvedPath)).source;
6316
- aotTransformCache.set(resolvedPath, transformed);
6317
- return transformed;
6346
+ return aotTransformedSources.get(resolvedPath) ?? source;
6318
6347
  };
6319
6348
  const originalGetSourceFileForCompile = host.getSourceFile;
6320
6349
  host.getSourceFile = (fileName, languageVersion, onError) => {
@@ -6529,7 +6558,7 @@ ${fields}
6529
6558
  if (!existsSync15(templatePath)) {
6530
6559
  return { deferSlots: [], source };
6531
6560
  }
6532
- const templateRaw2 = readFileSync10(templatePath, "utf-8");
6561
+ const templateRaw2 = readFileSync9(templatePath, "utf-8");
6533
6562
  const lowered2 = lowerAngularDeferSyntax(templateRaw2);
6534
6563
  const escaped2 = escapeTemplateContent(lowered2.template);
6535
6564
  const replacedSource2 = source.replace(/templateUrl\s*:\s*['"][^'"]+['"]/, `template: \`${escaped2}\``);
@@ -6553,42 +6582,6 @@ ${fields}
6553
6582
  deferSlots: lowered.slots,
6554
6583
  source: injectDeferSlotFields(replacedSource, lowered.slots, resolveAngularDeferImportSpecifier())
6555
6584
  };
6556
- }, readAndEscapeFileSync = (filePath) => {
6557
- if (!existsSync15(filePath))
6558
- return null;
6559
- const content = compileStyleFileIfNeededSync(filePath);
6560
- return escapeTemplateContent(content);
6561
- }, inlineStyleUrlsSync = (source, fileDir) => {
6562
- const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
6563
- if (!styleUrlsMatch?.[1])
6564
- return source;
6565
- const urlMatches = styleUrlsMatch[1].match(/['"]([^'"]+)['"]/g);
6566
- if (!urlMatches)
6567
- return source;
6568
- const inlinedStyles = urlMatches.map((urlMatch) => {
6569
- const styleUrl = urlMatch.replace(/['"]/g, "");
6570
- return readAndEscapeFileSync(join14(fileDir, styleUrl));
6571
- }).filter(Boolean).map((escaped) => `\`${escaped}\``);
6572
- if (inlinedStyles.length === 0)
6573
- return source;
6574
- return source.replace(/styleUrls\s*:\s*\[[^\]]+\]/, `styles: [${inlinedStyles.join(", ")}]`);
6575
- }, inlineSingleStyleUrlSync = (source, fileDir) => {
6576
- const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
6577
- if (!styleUrlMatch?.[1])
6578
- return source;
6579
- const escaped = readAndEscapeFileSync(join14(fileDir, styleUrlMatch[1]));
6580
- if (!escaped)
6581
- return source;
6582
- return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
6583
- }, inlineResourcesSync = (source, fileDir) => {
6584
- const inlinedTemplate = inlineTemplateAndLowerDeferSync(source, fileDir);
6585
- let result = inlinedTemplate.source;
6586
- result = inlineStyleUrlsSync(result, fileDir);
6587
- result = inlineSingleStyleUrlSync(result, fileDir);
6588
- return {
6589
- deferSlots: inlinedTemplate.deferSlots,
6590
- source: result
6591
- };
6592
6585
  }, inlineStyleUrls = async (source, fileDir) => {
6593
6586
  const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
6594
6587
  if (!styleUrlsMatch?.[1])
@@ -7160,11 +7153,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
7160
7153
  console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
7161
7154
  return;
7162
7155
  }
7163
- const { readFileSync: readFileSync11, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
7156
+ const { readFileSync: readFileSync10, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
7164
7157
  const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
7165
7158
  for (const file4 of files) {
7166
7159
  const filePath = join17(vendorDir, file4);
7167
- const content = readFileSync11(filePath, "utf-8");
7160
+ const content = readFileSync10(filePath, "utf-8");
7168
7161
  if (!content.includes("__VUE_HMR_RUNTIME__"))
7169
7162
  continue;
7170
7163
  const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
@@ -7289,7 +7282,7 @@ import {
7289
7282
  cpSync,
7290
7283
  existsSync as existsSync17,
7291
7284
  mkdirSync as mkdirSync10,
7292
- readFileSync as readFileSync11,
7285
+ readFileSync as readFileSync10,
7293
7286
  rmSync as rmSync2,
7294
7287
  statSync,
7295
7288
  writeFileSync as writeFileSync7
@@ -7410,7 +7403,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7410
7403
  addWorkerPathIfExists(file4, relPath, workerPaths);
7411
7404
  }
7412
7405
  }, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
7413
- const content = readFileSync11(file4, "utf-8");
7406
+ const content = readFileSync10(file4, "utf-8");
7414
7407
  for (const pattern of patterns) {
7415
7408
  collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
7416
7409
  }
@@ -7461,7 +7454,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7461
7454
  const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
7462
7455
  const pagesRel = relative9(process.cwd(), resolve20(reactPagesPath)).replace(/\\/g, "/");
7463
7456
  for (const file4 of indexFiles) {
7464
- let content = readFileSync11(join19(reactIndexesPath, file4), "utf-8");
7457
+ let content = readFileSync10(join19(reactIndexesPath, file4), "utf-8");
7465
7458
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
7466
7459
  writeFileSync7(join19(devIndexDir, file4), content);
7467
7460
  }
@@ -7473,7 +7466,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7473
7466
  const indexFile = join19(svelteIndexDir, "pages", `${name}.js`);
7474
7467
  if (!existsSync17(indexFile))
7475
7468
  continue;
7476
- let content = readFileSync11(indexFile, "utf-8");
7469
+ let content = readFileSync10(indexFile, "utf-8");
7477
7470
  const srcRel = relative9(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
7478
7471
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
7479
7472
  writeFileSync7(join19(devIndexDir, `${name}.svelte.js`), content);
@@ -7486,7 +7479,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7486
7479
  const indexFile = join19(vueIndexDir, `${name}.js`);
7487
7480
  if (!existsSync17(indexFile))
7488
7481
  continue;
7489
- let content = readFileSync11(indexFile, "utf-8");
7482
+ let content = readFileSync10(indexFile, "utf-8");
7490
7483
  const srcRel = relative9(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
7491
7484
  content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
7492
7485
  writeFileSync7(join19(devIndexDir, `${name}.vue.js`), content);
@@ -7537,7 +7530,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
7537
7530
  }
7538
7531
  return result;
7539
7532
  }, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
7540
- let content = readFileSync11(outputPath, "utf-8");
7533
+ let content = readFileSync10(outputPath, "utf-8");
7541
7534
  const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
7542
7535
  const useNames = [];
7543
7536
  let match;
@@ -7587,7 +7580,7 @@ ${content.slice(firstUseIdx)}`;
7587
7580
  }, rewriteUrlReferences = (outputPaths, urlFileMap) => {
7588
7581
  const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
7589
7582
  for (const outputPath of outputPaths) {
7590
- let content = readFileSync11(outputPath, "utf-8");
7583
+ let content = readFileSync10(outputPath, "utf-8");
7591
7584
  let changed = false;
7592
7585
  content = content.replace(urlPattern, (_match, relPath) => {
7593
7586
  const targetName = basename8(relPath);
@@ -8242,7 +8235,7 @@ ${content.slice(firstUseIdx)}`;
8242
8235
  const injectHMRIntoHTMLFile = (filePath, framework) => {
8243
8236
  if (!hmrClientBundle)
8244
8237
  return;
8245
- let html = readFileSync11(filePath, "utf-8");
8238
+ let html = readFileSync10(filePath, "utf-8");
8246
8239
  if (html.includes("data-hmr-client"))
8247
8240
  return;
8248
8241
  const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
@@ -8403,7 +8396,7 @@ var init_build = __esm(() => {
8403
8396
  });
8404
8397
 
8405
8398
  // src/dev/dependencyGraph.ts
8406
- import { existsSync as existsSync18, readFileSync as readFileSync12 } from "fs";
8399
+ import { existsSync as existsSync18, readFileSync as readFileSync11 } from "fs";
8407
8400
  var {Glob: Glob7 } = globalThis.Bun;
8408
8401
  import { resolve as resolve21 } from "path";
8409
8402
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
@@ -8564,15 +8557,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
8564
8557
  const lowerPath = filePath.toLowerCase();
8565
8558
  const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
8566
8559
  if (loader === "html") {
8567
- const content = readFileSync12(filePath, "utf-8");
8560
+ const content = readFileSync11(filePath, "utf-8");
8568
8561
  return extractHtmlDependencies(filePath, content);
8569
8562
  }
8570
8563
  if (loader === "tsx" || loader === "js") {
8571
- const content = readFileSync12(filePath, "utf-8");
8564
+ const content = readFileSync11(filePath, "utf-8");
8572
8565
  return extractJsDependencies(filePath, content, loader);
8573
8566
  }
8574
8567
  if (isSvelteOrVue) {
8575
- const content = readFileSync12(filePath, "utf-8");
8568
+ const content = readFileSync11(filePath, "utf-8");
8576
8569
  return extractSvelteVueDependencies(filePath, content);
8577
8570
  }
8578
8571
  return [];
@@ -9039,10 +9032,10 @@ var init_assetStore = __esm(() => {
9039
9032
  });
9040
9033
 
9041
9034
  // src/dev/fileHashTracker.ts
9042
- import { readFileSync as readFileSync13 } from "fs";
9035
+ import { readFileSync as readFileSync12 } from "fs";
9043
9036
  var computeFileHash = (filePath) => {
9044
9037
  try {
9045
- const fileContent = readFileSync13(filePath);
9038
+ const fileContent = readFileSync12(filePath);
9046
9039
  return Number(Bun.hash(fileContent));
9047
9040
  } catch {
9048
9041
  return UNFOUND_INDEX;
@@ -9866,7 +9859,7 @@ __export(exports_moduleServer, {
9866
9859
  createModuleServer: () => createModuleServer,
9867
9860
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
9868
9861
  });
9869
- 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";
9870
9863
  import { basename as basename12, dirname as dirname14, extname as extname6, resolve as resolve28, relative as relative10 } from "path";
9871
9864
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
9872
9865
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
@@ -9999,7 +9992,7 @@ ${stubs}
9999
9992
  `)}
10000
9993
  ${code}`;
10001
9994
  }, reactTranspilerOptions, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
10002
- const raw = readFileSync14(filePath, "utf-8");
9995
+ const raw = readFileSync13(filePath, "utf-8");
10003
9996
  const valueExports = tsxTranspiler.scan(raw).exports;
10004
9997
  let transpiled = reactTranspiler.transformSync(raw);
10005
9998
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
@@ -10015,7 +10008,7 @@ ${transpiled}`;
10015
10008
  transpiled += buildIslandMetadataExports(raw);
10016
10009
  return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
10017
10010
  }, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
10018
- const raw = readFileSync14(filePath, "utf-8");
10011
+ const raw = readFileSync13(filePath, "utf-8");
10019
10012
  const ext = extname6(filePath);
10020
10013
  const isTS = ext === ".ts" || ext === ".tsx";
10021
10014
  const isTSX = ext === ".tsx" || ext === ".jsx";
@@ -10171,7 +10164,7 @@ ${code}`;
10171
10164
  ` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
10172
10165
  return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
10173
10166
  }, transformSvelteFile = async (filePath, projectRoot, rewriter) => {
10174
- const raw = readFileSync14(filePath, "utf-8");
10167
+ const raw = readFileSync13(filePath, "utf-8");
10175
10168
  if (!svelteCompiler) {
10176
10169
  svelteCompiler = await import("svelte/compiler");
10177
10170
  }
@@ -10229,7 +10222,7 @@ export default __script__;`;
10229
10222
  return `${cssInjection}
10230
10223
  ${code}`;
10231
10224
  }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir) => {
10232
- const raw = readFileSync14(filePath, "utf-8");
10225
+ const raw = readFileSync13(filePath, "utf-8");
10233
10226
  if (!vueCompiler) {
10234
10227
  vueCompiler = await import("@vue/compiler-sfc");
10235
10228
  }
@@ -10278,7 +10271,7 @@ ${code}`;
10278
10271
  }
10279
10272
  });
10280
10273
  }, handleCssRequest = (filePath) => {
10281
- const raw = readFileSync14(filePath, "utf-8");
10274
+ const raw = readFileSync13(filePath, "utf-8");
10282
10275
  const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
10283
10276
  return [
10284
10277
  `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 file4 of files) {
12221
12214
  const filePath = join22(vendorDir, file4);
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);
@@ -12731,7 +12724,7 @@ __export(exports_devtoolsJson, {
12731
12724
  normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
12732
12725
  devtoolsJson: () => devtoolsJson
12733
12726
  });
12734
- import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync15, writeFileSync as writeFileSync8 } from "fs";
12727
+ import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync14, writeFileSync as writeFileSync8 } from "fs";
12735
12728
  import { dirname as dirname17, join as join23, resolve as resolve33 } from "path";
12736
12729
  import { Elysia as Elysia3 } from "elysia";
12737
12730
  var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
@@ -12741,7 +12734,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
12741
12734
  if (!existsSync22(cachePath))
12742
12735
  return null;
12743
12736
  try {
12744
- const value = readFileSync15(cachePath, "utf-8").trim();
12737
+ const value = readFileSync14(cachePath, "utf-8").trim();
12745
12738
  return isUuidV4(value) ? value : null;
12746
12739
  } catch {
12747
12740
  return null;
@@ -13096,7 +13089,7 @@ __export(exports_prerender, {
13096
13089
  prerender: () => prerender,
13097
13090
  PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
13098
13091
  });
13099
- import { mkdirSync as mkdirSync13, readFileSync as readFileSync16 } from "fs";
13092
+ import { mkdirSync as mkdirSync13, readFileSync as readFileSync15 } from "fs";
13100
13093
  import { join as join24 } from "path";
13101
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) => {
13102
13095
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
@@ -13104,7 +13097,7 @@ var MAX_STARTUP_ATTEMPTS = 50, STARTUP_POLL_INTERVAL_MS = 100, PRERENDER_BYPASS_
13104
13097
  }, readTimestamp = (htmlPath) => {
13105
13098
  const metaPath = htmlPath.replace(/\.html$/, ".meta");
13106
13099
  try {
13107
- const content = readFileSync16(metaPath, "utf-8");
13100
+ const content = readFileSync15(metaPath, "utf-8");
13108
13101
  return Number(content) || 0;
13109
13102
  } catch {
13110
13103
  return 0;
@@ -13444,7 +13437,7 @@ var handleHTMXPageRequest = async (pagePath) => {
13444
13437
  });
13445
13438
  };
13446
13439
  // src/core/prepare.ts
13447
- import { existsSync as existsSync24, readdirSync as readdirSync2, readFileSync as readFileSync17 } from "fs";
13440
+ import { existsSync as existsSync24, readdirSync as readdirSync2, readFileSync as readFileSync16 } from "fs";
13448
13441
  import { basename as basename14, join as join25, relative as relative12, resolve as resolve35 } from "path";
13449
13442
  import { Elysia as Elysia5 } from "elysia";
13450
13443
 
@@ -13806,7 +13799,7 @@ var prepare = async (configOrPath) => {
13806
13799
  return result;
13807
13800
  }
13808
13801
  stepStartedAt = performance.now();
13809
- const manifest = JSON.parse(readFileSync17(`${buildDir}/manifest.json`, "utf-8"));
13802
+ const manifest = JSON.parse(readFileSync16(`${buildDir}/manifest.json`, "utf-8"));
13810
13803
  setCurrentIslandManifest(manifest);
13811
13804
  if (config.islands?.registry) {
13812
13805
  setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
@@ -13816,7 +13809,7 @@ var prepare = async (configOrPath) => {
13816
13809
  stepStartedAt = performance.now();
13817
13810
  const conventionsPath = join25(buildDir, "conventions.json");
13818
13811
  if (existsSync24(conventionsPath)) {
13819
- const conventions2 = JSON.parse(readFileSync17(conventionsPath, "utf-8"));
13812
+ const conventions2 = JSON.parse(readFileSync16(conventionsPath, "utf-8"));
13820
13813
  setConventions(conventions2);
13821
13814
  }
13822
13815
  recordStep("load production conventions", stepStartedAt);
@@ -13885,7 +13878,7 @@ import { argv } from "process";
13885
13878
  var {env: env4 } = globalThis.Bun;
13886
13879
 
13887
13880
  // src/dev/devCert.ts
13888
- import { existsSync as existsSync25, mkdirSync as mkdirSync14, readFileSync as readFileSync18, rmSync as rmSync3 } from "fs";
13881
+ import { existsSync as existsSync25, mkdirSync as mkdirSync14, readFileSync as readFileSync17, rmSync as rmSync3 } from "fs";
13889
13882
  import { join as join26 } from "path";
13890
13883
  var CERT_DIR = join26(process.cwd(), ".absolutejs");
13891
13884
  var CERT_PATH = join26(CERT_DIR, "cert.pem");
@@ -13896,7 +13889,7 @@ var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1
13896
13889
  var certFilesExist = () => existsSync25(CERT_PATH) && existsSync25(KEY_PATH);
13897
13890
  var isCertExpired = () => {
13898
13891
  try {
13899
- const certPem = readFileSync18(CERT_PATH, "utf-8");
13892
+ const certPem = readFileSync17(CERT_PATH, "utf-8");
13900
13893
  const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
13901
13894
  stdin: new TextEncoder().encode(certPem)
13902
13895
  });
@@ -13992,8 +13985,8 @@ var loadDevCert = () => {
13992
13985
  return null;
13993
13986
  try {
13994
13987
  return {
13995
- cert: readFileSync18(paths.cert, "utf-8"),
13996
- key: readFileSync18(paths.key, "utf-8")
13988
+ cert: readFileSync17(paths.cert, "utf-8"),
13989
+ key: readFileSync17(paths.key, "utf-8")
13997
13990
  };
13998
13991
  } catch {
13999
13992
  return null;
@@ -14221,7 +14214,7 @@ var jsonLd2 = (schema) => {
14221
14214
  };
14222
14215
  // src/utils/defineEnv.ts
14223
14216
  var {env: bunEnv } = globalThis.Bun;
14224
- import { existsSync as existsSync26, readFileSync as readFileSync19 } from "fs";
14217
+ import { existsSync as existsSync26, readFileSync as readFileSync18 } from "fs";
14225
14218
  import { resolve as resolve36 } from "path";
14226
14219
 
14227
14220
  // node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
@@ -20263,13 +20256,13 @@ var checkEnvFileSecurity = (properties) => {
20263
20256
  const sensitiveKeys = Object.keys(properties).filter(isSensitive);
20264
20257
  if (sensitiveKeys.length === 0)
20265
20258
  return;
20266
- const envContent = readFileSync19(envPath, "utf-8");
20259
+ const envContent = readFileSync18(envPath, "utf-8");
20267
20260
  const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
20268
20261
  if (presentKeys.length === 0)
20269
20262
  return;
20270
20263
  const gitignorePath = resolve36(cwd2, ".gitignore");
20271
20264
  if (existsSync26(gitignorePath)) {
20272
- const gitignore = readFileSync19(gitignorePath, "utf-8");
20265
+ const gitignore = readFileSync18(gitignorePath, "utf-8");
20273
20266
  if (gitignore.split(`
20274
20267
  `).some((line) => line.trim() === ".env"))
20275
20268
  return;
@@ -20476,5 +20469,5 @@ export {
20476
20469
  ANGULAR_INIT_TIMEOUT_MS
20477
20470
  };
20478
20471
 
20479
- //# debugId=C5012A232FC76DFE64756E2164756E21
20472
+ //# debugId=F5E990EFAC399D1764756E2164756E21
20480
20473
  //# sourceMappingURL=index.js.map