@absolutejs/absolute 0.18.3-beta.5 → 0.18.3-beta.7

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
@@ -479,8 +479,11 @@ var init_outputLogs = __esm(() => {
479
479
  });
480
480
 
481
481
  // src/build/scanEntryPoints.ts
482
+ import { existsSync as existsSync2 } from "fs";
482
483
  var {Glob: Glob2 } = globalThis.Bun;
483
484
  var scanEntryPoints = async (dir, pattern) => {
485
+ if (!existsSync2(dir))
486
+ return [];
484
487
  const entryPaths = [];
485
488
  const glob = new Glob2(pattern);
486
489
  for await (const file of glob.scan({ absolute: true, cwd: dir })) {
@@ -491,8 +494,11 @@ var scanEntryPoints = async (dir, pattern) => {
491
494
  var init_scanEntryPoints = () => {};
492
495
 
493
496
  // src/build/scanCssEntryPoints.ts
497
+ import { existsSync as existsSync3 } from "fs";
494
498
  var {Glob: Glob3 } = globalThis.Bun;
495
499
  var scanCssEntryPoints = async (dir, ignore) => {
500
+ if (!existsSync3(dir))
501
+ return [];
496
502
  const entryPaths = [];
497
503
  const glob = new Glob3("**/*.css");
498
504
  for await (const file of glob.scan({ absolute: true, cwd: dir })) {
@@ -506,12 +512,12 @@ var scanCssEntryPoints = async (dir, ignore) => {
506
512
  var init_scanCssEntryPoints = () => {};
507
513
 
508
514
  // src/cli/scripts/telemetry.ts
509
- import { existsSync as existsSync2, mkdirSync, readFileSync, writeFileSync } from "fs";
515
+ import { existsSync as existsSync4, mkdirSync, readFileSync, writeFileSync } from "fs";
510
516
  import { homedir } from "os";
511
517
  import { join as join2 } from "path";
512
518
  var configDir, configPath, getTelemetryConfig = () => {
513
519
  try {
514
- if (!existsSync2(configPath))
520
+ if (!existsSync4(configPath))
515
521
  return null;
516
522
  const raw = readFileSync(configPath, "utf-8");
517
523
  const config = JSON.parse(raw);
@@ -526,11 +532,11 @@ var init_telemetry = __esm(() => {
526
532
  });
527
533
 
528
534
  // src/cli/telemetryEvent.ts
529
- import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
535
+ import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
530
536
  import { arch, platform } from "os";
531
537
  import { dirname, join as join3, parse } from "path";
532
538
  var checkCandidate = (candidate) => {
533
- if (!existsSync3(candidate)) {
539
+ if (!existsSync5(candidate)) {
534
540
  return null;
535
541
  }
536
542
  const pkg = JSON.parse(readFileSync2(candidate, "utf-8"));
@@ -631,12 +637,12 @@ var init_updateAssetPaths = __esm(() => {
631
637
  });
632
638
 
633
639
  // src/dev/buildHMRClient.ts
634
- import { existsSync as existsSync4 } from "fs";
640
+ import { existsSync as existsSync6 } from "fs";
635
641
  import { resolve as resolve2 } from "path";
636
642
  var {build: bunBuild } = globalThis.Bun;
637
643
  var resolveHmrClientPath = () => {
638
644
  const fromSource = resolve2(import.meta.dir, "client/hmrClient.ts");
639
- if (existsSync4(fromSource))
645
+ if (existsSync6(fromSource))
640
646
  return fromSource;
641
647
  return resolve2(import.meta.dir, "dev/client/hmrClient.ts");
642
648
  }, hmrClientPath2, buildHMRClient = async () => {
@@ -711,7 +717,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
711
717
  };
712
718
 
713
719
  // src/build/angularLinkerPlugin.ts
714
- import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
720
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
715
721
  import { dirname as dirname2, join as join4, relative, resolve as resolve3 } from "path";
716
722
  import { createHash } from "crypto";
717
723
  var CACHE_DIR, angularLinkerPlugin;
@@ -736,7 +742,7 @@ var init_angularLinkerPlugin = __esm(() => {
736
742
  }
737
743
  const hash = createHash("md5").update(source).digest("hex");
738
744
  const cachePath = join4(CACHE_DIR, `${hash}.js`);
739
- if (existsSync5(cachePath)) {
745
+ if (existsSync7(cachePath)) {
740
746
  return {
741
747
  contents: readFileSync3(cachePath, "utf-8"),
742
748
  loader: "js"
@@ -753,7 +759,7 @@ var init_angularLinkerPlugin = __esm(() => {
753
759
  linkerPlugin = mod.createEs2015LinkerPlugin({
754
760
  fileSystem: {
755
761
  dirname: dirname2,
756
- exists: existsSync5,
762
+ exists: existsSync7,
757
763
  readFile: readFileSync3,
758
764
  relative,
759
765
  resolve: resolve3
@@ -1029,7 +1035,7 @@ var exports_compileSvelte = {};
1029
1035
  __export(exports_compileSvelte, {
1030
1036
  compileSvelte: () => compileSvelte
1031
1037
  });
1032
- import { existsSync as existsSync6 } from "fs";
1038
+ import { existsSync as existsSync8 } from "fs";
1033
1039
  import { mkdir as mkdir2, stat } from "fs/promises";
1034
1040
  import {
1035
1041
  dirname as dirname3,
@@ -1044,7 +1050,7 @@ import { env } from "process";
1044
1050
  var {write, file, Transpiler } = globalThis.Bun;
1045
1051
  var resolveDevClientDir2 = () => {
1046
1052
  const fromSource = resolve6(import.meta.dir, "../dev/client");
1047
- if (existsSync6(fromSource))
1053
+ if (existsSync8(fromSource))
1048
1054
  return fromSource;
1049
1055
  return resolve6(import.meta.dir, "./dev/client");
1050
1056
  }, devClientDir2, hmrClientPath3, transpiler, exists = async (path) => {
@@ -1195,13 +1201,13 @@ __export(exports_compileVue, {
1195
1201
  compileVue: () => compileVue,
1196
1202
  clearVueHmrCaches: () => clearVueHmrCaches
1197
1203
  });
1198
- import { existsSync as existsSync7 } from "fs";
1204
+ import { existsSync as existsSync9 } from "fs";
1199
1205
  import { mkdir as mkdir3 } from "fs/promises";
1200
1206
  import { basename as basename3, dirname as dirname4, join as join7, relative as relative4, resolve as resolve7 } from "path";
1201
1207
  var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
1202
1208
  var resolveDevClientDir3 = () => {
1203
1209
  const fromSource = resolve7(import.meta.dir, "../dev/client");
1204
- if (existsSync7(fromSource))
1210
+ if (existsSync9(fromSource))
1205
1211
  return fromSource;
1206
1212
  return resolve7(import.meta.dir, "./dev/client");
1207
1213
  }, devClientDir3, hmrClientPath4, transpiler2, scriptCache, scriptSetupCache, templateCache, styleCache, vueHmrMetadata, clearVueHmrCaches = () => {
@@ -170250,7 +170256,7 @@ __export(exports_compileAngular, {
170250
170256
  compileAngularFile: () => compileAngularFile,
170251
170257
  compileAngular: () => compileAngular
170252
170258
  });
170253
- import { existsSync as existsSync8, readFileSync as readFileSync4, promises as fs } from "fs";
170259
+ import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
170254
170260
  import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve8, relative as relative5 } from "path";
170255
170261
  import { createHash as createHash2 } from "crypto";
170256
170262
  var import_typescript, computeConfigHash = () => {
@@ -170262,7 +170268,7 @@ var import_typescript, computeConfigHash = () => {
170262
170268
  }
170263
170269
  }, resolveDevClientDir4 = () => {
170264
170270
  const fromSource = resolve8(import.meta.dir, "../dev/client");
170265
- if (existsSync8(fromSource))
170271
+ if (existsSync10(fromSource))
170266
170272
  return fromSource;
170267
170273
  return resolve8(import.meta.dir, "./dev/client");
170268
170274
  }, devClientDir4, hmrClientPath5, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
@@ -170404,7 +170410,7 @@ ${registrations}
170404
170410
  await Promise.all(entries.map(({ target, content }) => fs.writeFile(target, content, "utf-8")));
170405
170411
  return entries.map(({ target }) => target);
170406
170412
  }, jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), readAndEscapeFile = async (filePath) => {
170407
- if (!existsSync8(filePath))
170413
+ if (!existsSync10(filePath))
170408
170414
  return null;
170409
170415
  const content = await fs.readFile(filePath, "utf-8");
170410
170416
  return escapeTemplateContent(content);
@@ -170468,7 +170474,7 @@ ${registrations}
170468
170474
  let actualPath = resolved;
170469
170475
  if (!actualPath.endsWith(".ts"))
170470
170476
  actualPath += ".ts";
170471
- if (!existsSync8(actualPath))
170477
+ if (!existsSync10(actualPath))
170472
170478
  return;
170473
170479
  let sourceCode = await fs.readFile(actualPath, "utf-8");
170474
170480
  sourceCode = await inlineResources(sourceCode, dirname5(actualPath));
@@ -170486,7 +170492,7 @@ ${registrations}
170486
170492
  }
170487
170493
  const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
170488
170494
  const cacheKey = actualPath;
170489
- if (jitContentCache.get(cacheKey) === contentHash && existsSync8(targetPath)) {
170495
+ if (jitContentCache.get(cacheKey) === contentHash && existsSync10(targetPath)) {
170490
170496
  allOutputs.push(targetPath);
170491
170497
  } else {
170492
170498
  const result = import_typescript.default.transpileModule(sourceCode, {
@@ -171338,7 +171344,7 @@ var init_build = __esm(() => {
171338
171344
  });
171339
171345
 
171340
171346
  // src/dev/dependencyGraph.ts
171341
- import { existsSync as existsSync9, readFileSync as readFileSync6, readdirSync } from "fs";
171347
+ import { existsSync as existsSync11, readFileSync as readFileSync6, readdirSync } from "fs";
171342
171348
  import { resolve as resolve10 } from "path";
171343
171349
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
171344
171350
  const lower = filePath.toLowerCase();
@@ -171367,10 +171373,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
171367
171373
  ];
171368
171374
  for (const ext of extensions) {
171369
171375
  const withExt = normalized + ext;
171370
- if (existsSync9(withExt))
171376
+ if (existsSync11(withExt))
171371
171377
  return withExt;
171372
171378
  }
171373
- if (existsSync9(normalized))
171379
+ if (existsSync11(normalized))
171374
171380
  return normalized;
171375
171381
  return null;
171376
171382
  }, clearExistingDependents = (graph, normalizedPath) => {
@@ -171385,7 +171391,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
171385
171391
  }
171386
171392
  }, addFileToGraph = (graph, filePath) => {
171387
171393
  const normalizedPath = resolve10(filePath);
171388
- if (!existsSync9(normalizedPath))
171394
+ if (!existsSync11(normalizedPath))
171389
171395
  return;
171390
171396
  const dependencies = extractDependencies(normalizedPath);
171391
171397
  clearExistingDependents(graph, normalizedPath);
@@ -171435,7 +171441,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
171435
171441
  };
171436
171442
  for (const dir of directories) {
171437
171443
  const resolvedDir = resolve10(dir);
171438
- if (!existsSync9(resolvedDir))
171444
+ if (!existsSync11(resolvedDir))
171439
171445
  continue;
171440
171446
  scanDirectory(resolvedDir);
171441
171447
  }
@@ -171808,7 +171814,7 @@ var init_pathUtils = () => {};
171808
171814
 
171809
171815
  // src/dev/fileWatcher.ts
171810
171816
  import { watch } from "fs";
171811
- import { existsSync as existsSync10 } from "fs";
171817
+ import { existsSync as existsSync12 } from "fs";
171812
171818
  import { join as join12, resolve as resolve12 } from "path";
171813
171819
  var safeRemoveFromGraph = (graph, fullPath) => {
171814
171820
  try {
@@ -171840,12 +171846,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
171840
171846
  if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
171841
171847
  return;
171842
171848
  }
171843
- if (event === "rename" && !existsSync10(fullPath)) {
171849
+ if (event === "rename" && !existsSync12(fullPath)) {
171844
171850
  safeRemoveFromGraph(state.dependencyGraph, fullPath);
171845
171851
  onFileChange(fullPath);
171846
171852
  return;
171847
171853
  }
171848
- if (existsSync10(fullPath)) {
171854
+ if (existsSync12(fullPath)) {
171849
171855
  onFileChange(fullPath);
171850
171856
  safeAddToGraph(state.dependencyGraph, fullPath);
171851
171857
  }
@@ -171855,7 +171861,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
171855
171861
  const stylesDir = state.resolvedPaths?.stylesDir;
171856
171862
  paths.forEach((path) => {
171857
171863
  const absolutePath = resolve12(path).replace(/\\/g, "/");
171858
- if (!existsSync10(absolutePath)) {
171864
+ if (!existsSync12(absolutePath)) {
171859
171865
  return;
171860
171866
  }
171861
171867
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
@@ -171866,7 +171872,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
171866
171872
  const stylesDir = state.resolvedPaths?.stylesDir;
171867
171873
  watchPaths.forEach((path) => {
171868
171874
  const absolutePath = resolve12(path).replace(/\\/g, "/");
171869
- if (!existsSync10(absolutePath)) {
171875
+ if (!existsSync12(absolutePath)) {
171870
171876
  return;
171871
171877
  }
171872
171878
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
@@ -171895,7 +171901,7 @@ var mimeTypes, getMimeType = (filePath) => {
171895
171901
  }
171896
171902
  const identity = stripHash(fullPath);
171897
171903
  const livePath = liveByIdentity.get(identity);
171898
- if (livePath && livePath !== fullPath) {
171904
+ if (livePath !== fullPath) {
171899
171905
  return unlink(fullPath).catch(() => {});
171900
171906
  }
171901
171907
  return null;
@@ -171944,9 +171950,14 @@ var mimeTypes, getMimeType = (filePath) => {
171944
171950
  continue;
171945
171951
  newIdentities.set(stripHash(webPath), webPath);
171946
171952
  }
171953
+ const liveWebPaths = new Set(newIdentities.values());
171947
171954
  const staleKeys = [...store.keys()].filter((existingPath) => {
171955
+ if (existingPath.includes("/chunk-"))
171956
+ return false;
171948
171957
  const replacement = newIdentities.get(stripHash(existingPath));
171949
- return replacement !== undefined && replacement !== existingPath;
171958
+ if (replacement !== undefined)
171959
+ return replacement !== existingPath;
171960
+ return !liveWebPaths.has(existingPath);
171950
171961
  });
171951
171962
  staleKeys.forEach((key) => store.delete(key));
171952
171963
  for (const webPath of newIdentities.values()) {
@@ -172291,7 +172302,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
172291
172302
  var init_simpleHTMXHMR = () => {};
172292
172303
 
172293
172304
  // src/dev/rebuildTrigger.ts
172294
- import { existsSync as existsSync11 } from "fs";
172305
+ import { existsSync as existsSync13 } from "fs";
172295
172306
  import { rm as rm6 } from "fs/promises";
172296
172307
  import { basename as basename7, relative as relative6, resolve as resolve18 } from "path";
172297
172308
  var parseErrorLocationFromMessage = (msg) => {
@@ -172361,7 +172372,7 @@ var parseErrorLocationFromMessage = (msg) => {
172361
172372
  detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
172362
172373
  }
172363
172374
  return { ...parsed, framework: detectedFw };
172364
- }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync11(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
172375
+ }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync13(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
172365
172376
  state.fileHashes.delete(filePathInSet);
172366
172377
  try {
172367
172378
  const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
@@ -172379,7 +172390,7 @@ var parseErrorLocationFromMessage = (msg) => {
172379
172390
  if (!dependents || dependents.size === 0) {
172380
172391
  return;
172381
172392
  }
172382
- const dependentFiles = Array.from(dependents).filter((file3) => existsSync11(file3));
172393
+ const dependentFiles = Array.from(dependents).filter((file3) => existsSync13(file3));
172383
172394
  if (dependentFiles.length === 0) {
172384
172395
  return;
172385
172396
  }
@@ -172395,7 +172406,7 @@ var parseErrorLocationFromMessage = (msg) => {
172395
172406
  try {
172396
172407
  const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
172397
172408
  affectedFiles.forEach((affectedFile) => {
172398
- if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync11(affectedFile)) {
172409
+ if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync13(affectedFile)) {
172399
172410
  validFiles.push(affectedFile);
172400
172411
  processedFiles.add(affectedFile);
172401
172412
  }
@@ -172420,7 +172431,7 @@ var parseErrorLocationFromMessage = (msg) => {
172420
172431
  collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
172421
172432
  }, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
172422
172433
  filePathSet.forEach((filePathInSet) => {
172423
- if (!existsSync11(filePathInSet)) {
172434
+ if (!existsSync13(filePathInSet)) {
172424
172435
  collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
172425
172436
  return;
172426
172437
  }
@@ -172495,7 +172506,7 @@ var parseErrorLocationFromMessage = (msg) => {
172495
172506
  return componentFile;
172496
172507
  }
172497
172508
  const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
172498
- if (existsSync11(tsCounterpart)) {
172509
+ if (existsSync13(tsCounterpart)) {
172499
172510
  return tsCounterpart;
172500
172511
  }
172501
172512
  return componentFile;
@@ -172613,7 +172624,7 @@ var parseErrorLocationFromMessage = (msg) => {
172613
172624
  }, resolveReactEntryForPageFile = (normalized, pagesPathResolved, reactIndexesPath) => {
172614
172625
  const pageName = basename7(normalized, ".tsx");
172615
172626
  const indexPath = resolve18(reactIndexesPath, `${pageName}.tsx`);
172616
- if (!existsSync11(indexPath)) {
172627
+ if (!existsSync13(indexPath)) {
172617
172628
  return;
172618
172629
  }
172619
172630
  return indexPath;
@@ -172625,7 +172636,7 @@ var parseErrorLocationFromMessage = (msg) => {
172625
172636
  }
172626
172637
  const pageName = basename7(dep, ".tsx");
172627
172638
  const indexPath = resolve18(reactIndexesPath, `${pageName}.tsx`);
172628
- if (existsSync11(indexPath) && !reactEntries.includes(indexPath)) {
172639
+ if (existsSync13(indexPath) && !reactEntries.includes(indexPath)) {
172629
172640
  reactEntries.push(indexPath);
172630
172641
  }
172631
172642
  });
@@ -173757,5 +173768,5 @@ export {
173757
173768
  build
173758
173769
  };
173759
173770
 
173760
- //# debugId=BA684BA0E2DCA0FC64756E2164756E21
173771
+ //# debugId=17E876A773BB909664756E2164756E21
173761
173772
  //# sourceMappingURL=build.js.map