@absolutejs/absolute 0.19.0-beta.1084 → 0.19.0-beta.1085

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
@@ -23414,6 +23414,7 @@ __export(exports_chainInlineSourcemaps, {
23414
23414
  remapGeneratedLines: () => remapGeneratedLines,
23415
23415
  inlineLineMapComment: () => inlineLineMapComment,
23416
23416
  chainSourcemap: () => chainSourcemap,
23417
+ chainExternalSourcemap: () => chainExternalSourcemap,
23417
23418
  chainBundleInlineSourcemap: () => chainBundleInlineSourcemap,
23418
23419
  buildLineRemap: () => buildLineRemap
23419
23420
  });
@@ -23725,6 +23726,25 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
23725
23726
  const inline = `
23726
23727
  //# sourceMappingURL=data:application/json;base64,` + Buffer.from(JSON.stringify(chained)).toString("base64");
23727
23728
  writeFileSync8(bundleFilePath, stripped + inline);
23729
+ }, chainExternalSourcemap = (mapFilePath) => {
23730
+ let outerMap;
23731
+ try {
23732
+ outerMap = JSON.parse(readFileSync21(mapFilePath, "utf-8"));
23733
+ } catch {
23734
+ return;
23735
+ }
23736
+ if (!Array.isArray(outerMap.sources))
23737
+ return;
23738
+ const chained = chainSourcemap(outerMap, (src) => {
23739
+ const idx = outerMap.sources.indexOf(src);
23740
+ if (idx < 0)
23741
+ return null;
23742
+ const content = outerMap.sourcesContent?.[idx];
23743
+ if (!content)
23744
+ return null;
23745
+ return extractInlineMap(content);
23746
+ });
23747
+ writeFileSync8(mapFilePath, JSON.stringify(chained));
23728
23748
  };
23729
23749
  var init_chainInlineSourcemaps = __esm(() => {
23730
23750
  BASE64_TO_INT = new Int8Array(128).fill(-1);
@@ -30053,7 +30073,9 @@ import {
30053
30073
  cpSync,
30054
30074
  existsSync as existsSync30,
30055
30075
  mkdirSync as mkdirSync12,
30076
+ readdirSync as readdirSync5,
30056
30077
  readFileSync as readFileSync25,
30078
+ renameSync,
30057
30079
  rmSync as rmSync2,
30058
30080
  statSync as statSync3,
30059
30081
  writeFileSync as writeFileSync9
@@ -30391,6 +30413,14 @@ ${content.slice(firstUseIdx)}`;
30391
30413
  ...config2.default ?? {},
30392
30414
  ...config2[pass] ?? {}
30393
30415
  }, locked);
30416
+ }, resolveClientSourcemap = (sourcemaps, isDev3) => {
30417
+ if (isDev3)
30418
+ return sourcemaps === false ? "none" : "inline";
30419
+ if (sourcemaps === "external" || sourcemaps === true)
30420
+ return "external";
30421
+ if (sourcemaps === "inline")
30422
+ return "inline";
30423
+ return "none";
30394
30424
  }, dedupe = (values) => [...new Set(values)], mergeBunBuildConfig = (base, override) => {
30395
30425
  const sanitized = sanitizeBunBuildOverride(override);
30396
30426
  const merged = {
@@ -30429,7 +30459,8 @@ ${content.slice(firstUseIdx)}`;
30429
30459
  options,
30430
30460
  incrementalFiles,
30431
30461
  mode,
30432
- sitemap: sitemap2
30462
+ sitemap: sitemap2,
30463
+ sourcemaps
30433
30464
  }) => {
30434
30465
  const buildStart = performance.now();
30435
30466
  const projectRoot = cwd();
@@ -31232,6 +31263,7 @@ ${content.slice(firstUseIdx)}`;
31232
31263
  ...islandRegistryPlugins
31233
31264
  ],
31234
31265
  root: clientRoot,
31266
+ sourcemap: resolveClientSourcemap(sourcemaps, isDev2),
31235
31267
  splitting: true,
31236
31268
  target: "browser",
31237
31269
  throw: false
@@ -31306,6 +31338,7 @@ ${content.slice(firstUseIdx)}`;
31306
31338
  ...htmlScriptPlugin ? [htmlScriptPlugin] : []
31307
31339
  ],
31308
31340
  root: clientRoot,
31341
+ sourcemap: resolveClientSourcemap(sourcemaps, isDev2),
31309
31342
  splitting: !isDev2,
31310
31343
  target: "browser",
31311
31344
  throw: false,
@@ -31333,6 +31366,7 @@ ${content.slice(firstUseIdx)}`;
31333
31366
  ...angularDir ? [createAngularLinkerPlugin(hmr)] : []
31334
31367
  ],
31335
31368
  root: islandEntryResult.generatedRoot,
31369
+ sourcemap: resolveClientSourcemap(sourcemaps, isDev2),
31336
31370
  splitting: !isDev2,
31337
31371
  target: "browser",
31338
31372
  throw: false,
@@ -31364,6 +31398,23 @@ ${content.slice(firstUseIdx)}`;
31364
31398
  chainBundleInlineSourcemap2(out.path);
31365
31399
  }
31366
31400
  }
31401
+ if (!isDev2 && resolveClientSourcemap(sourcemaps, isDev2) === "external") {
31402
+ const { chainExternalSourcemap: chainExternalSourcemap2 } = await Promise.resolve().then(() => (init_chainInlineSourcemaps(), exports_chainInlineSourcemaps));
31403
+ const sourcemapDir = join40(projectRoot, "sourcemaps");
31404
+ mkdirSync12(sourcemapDir, { recursive: true });
31405
+ const mapFiles = readdirSync5(buildPath, { recursive: true }).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join40(buildPath, entry));
31406
+ for (const mapPath of mapFiles) {
31407
+ chainExternalSourcemap2(mapPath);
31408
+ renameSync(mapPath, join40(sourcemapDir, basename12(mapPath)));
31409
+ const jsPath = mapPath.slice(0, -4);
31410
+ try {
31411
+ const js = readFileSync25(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
31412
+ `);
31413
+ writeFileSync9(jsPath, js);
31414
+ } catch {}
31415
+ }
31416
+ console.info(`[absolute] sourcemaps: chained + privatized ${mapFiles.length} client maps \u2192 ${relative14(projectRoot, sourcemapDir)}/`);
31417
+ }
31367
31418
  if (serverResult && !serverResult.success && serverLogs.length > 0) {
31368
31419
  extractBuildError(serverLogs, "server", "Server", frameworkNames, isIncremental, throwOnError);
31369
31420
  }
@@ -32386,7 +32437,7 @@ var init_clientManager = __esm(() => {
32386
32437
  });
32387
32438
 
32388
32439
  // src/dev/pathUtils.ts
32389
- import { existsSync as existsSync33, readdirSync as readdirSync5, readFileSync as readFileSync27 } from "fs";
32440
+ import { existsSync as existsSync33, readdirSync as readdirSync6, readFileSync as readFileSync27 } from "fs";
32390
32441
  import { dirname as dirname21, resolve as resolve31 } from "path";
32391
32442
  var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
32392
32443
  if (shouldIgnorePath(filePath, resolved)) {
@@ -32468,7 +32519,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
32468
32519
  const walk = (dir) => {
32469
32520
  let entries;
32470
32521
  try {
32471
- entries = readdirSync5(dir, { withFileTypes: true });
32522
+ entries = readdirSync6(dir, { withFileTypes: true });
32472
32523
  } catch {
32473
32524
  return;
32474
32525
  }
@@ -32564,8 +32615,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
32564
32615
  roots.push(abs);
32565
32616
  }
32566
32617
  try {
32567
- const { readdirSync: readdirSync6 } = __require("fs");
32568
- const entries = readdirSync6(cwd2, { withFileTypes: true });
32618
+ const { readdirSync: readdirSync7 } = __require("fs");
32619
+ const entries = readdirSync7(cwd2, { withFileTypes: true });
32569
32620
  for (const entry of entries) {
32570
32621
  if (!entry.isDirectory())
32571
32622
  continue;
@@ -32645,7 +32696,7 @@ var init_pathUtils = __esm(() => {
32645
32696
 
32646
32697
  // src/dev/fileWatcher.ts
32647
32698
  import { watch } from "fs";
32648
- import { existsSync as existsSync34, readdirSync as readdirSync6, statSync as statSync4 } from "fs";
32699
+ import { existsSync as existsSync34, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
32649
32700
  import { dirname as dirname22, join as join42, resolve as resolve32 } from "path";
32650
32701
  var safeRemoveFromGraph = (graph, fullPath) => {
32651
32702
  try {
@@ -32671,7 +32722,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
32671
32722
  const atomicRecoveryScan = (eventDir) => {
32672
32723
  let entries;
32673
32724
  try {
32674
- entries = readdirSync6(eventDir);
32725
+ entries = readdirSync7(eventDir);
32675
32726
  } catch {
32676
32727
  return;
32677
32728
  }
@@ -33078,7 +33129,7 @@ __export(exports_resolveOwningComponents, {
33078
33129
  resolveDescendantsOfParent: () => resolveDescendantsOfParent,
33079
33130
  invalidateResourceIndex: () => invalidateResourceIndex
33080
33131
  });
33081
- import { readdirSync as readdirSync7, readFileSync as readFileSync29, statSync as statSync5 } from "fs";
33132
+ import { readdirSync as readdirSync8, readFileSync as readFileSync29, statSync as statSync5 } from "fs";
33082
33133
  import { dirname as dirname23, extname as extname9, join as join43, resolve as resolve36 } from "path";
33083
33134
  import ts16 from "typescript";
33084
33135
  var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
@@ -33086,7 +33137,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
33086
33137
  const visit = (dir) => {
33087
33138
  let entries;
33088
33139
  try {
33089
- entries = readdirSync7(dir, { withFileTypes: true });
33140
+ entries = readdirSync8(dir, { withFileTypes: true });
33090
33141
  } catch {
33091
33142
  return;
33092
33143
  }
@@ -35661,9 +35712,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
35661
35712
  const editedProvidersChain = providersImport && angularFiles.some((file5) => resolve41(file5) === resolve41(providersImport.absolutePath) || resolve41(file5).startsWith(`${resolve41(angularDir)}/`));
35662
35713
  const pageEntries = editedProvidersChain && initialPageEntries.length === 0 ? (() => {
35663
35714
  const allPages = [];
35664
- const { readdirSync: readdirSync8 } = __require("fs");
35715
+ const { readdirSync: readdirSync9 } = __require("fs");
35665
35716
  const walk = (dir) => {
35666
- for (const entry of readdirSync8(dir, {
35717
+ for (const entry of readdirSync9(dir, {
35667
35718
  withFileTypes: true
35668
35719
  })) {
35669
35720
  const full = resolve41(dir, entry.name);
@@ -38793,8 +38844,8 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
38793
38844
  const recoveryScan = (dir) => {
38794
38845
  let entries;
38795
38846
  try {
38796
- const { readdirSync: readdirSync10 } = __require("fs");
38797
- entries = readdirSync10(dir, { withFileTypes: true });
38847
+ const { readdirSync: readdirSync11 } = __require("fs");
38848
+ entries = readdirSync11(dir, { withFileTypes: true });
38798
38849
  } catch {
38799
38850
  return;
38800
38851
  }
@@ -39376,7 +39427,7 @@ var handleHTMXPageRequest = async (pagePath) => {
39376
39427
  });
39377
39428
  };
39378
39429
  // src/core/prepare.ts
39379
- import { existsSync as existsSync39, readdirSync as readdirSync8, readFileSync as readFileSync33 } from "fs";
39430
+ import { existsSync as existsSync39, readdirSync as readdirSync9, readFileSync as readFileSync33 } from "fs";
39380
39431
  import { basename as basename16, join as join49, relative as relative18, resolve as resolve45 } from "path";
39381
39432
  import { Elysia as Elysia8 } from "elysia";
39382
39433
 
@@ -40008,7 +40059,7 @@ var loadPrerenderMap = (prerenderDir) => {
40008
40059
  return map3;
40009
40060
  let entries;
40010
40061
  try {
40011
- entries = readdirSync8(prerenderDir);
40062
+ entries = readdirSync9(prerenderDir);
40012
40063
  } catch {
40013
40064
  return map3;
40014
40065
  }
@@ -40317,7 +40368,7 @@ var loadDevCert = () => {
40317
40368
  import {
40318
40369
  mkdirSync as mkdirSync18,
40319
40370
  readFileSync as readFileSync35,
40320
- readdirSync as readdirSync9,
40371
+ readdirSync as readdirSync10,
40321
40372
  unlinkSync as unlinkSync2,
40322
40373
  writeFileSync as writeFileSync11
40323
40374
  } from "fs";
@@ -47033,5 +47084,5 @@ export {
47033
47084
  ANGULAR_INIT_TIMEOUT_MS
47034
47085
  };
47035
47086
 
47036
- //# debugId=5C2761F3C51DB90064756E2164756E21
47087
+ //# debugId=4B0528D487AC4D9064756E2164756E21
47037
47088
  //# sourceMappingURL=index.js.map