@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/index.js CHANGED
@@ -504,8 +504,11 @@ var init_outputLogs = __esm(() => {
504
504
  });
505
505
 
506
506
  // src/build/scanEntryPoints.ts
507
+ import { existsSync as existsSync2 } from "fs";
507
508
  var {Glob: Glob2 } = globalThis.Bun;
508
509
  var scanEntryPoints = async (dir, pattern) => {
510
+ if (!existsSync2(dir))
511
+ return [];
509
512
  const entryPaths = [];
510
513
  const glob = new Glob2(pattern);
511
514
  for await (const file2 of glob.scan({ absolute: true, cwd: dir })) {
@@ -516,8 +519,11 @@ var scanEntryPoints = async (dir, pattern) => {
516
519
  var init_scanEntryPoints = () => {};
517
520
 
518
521
  // src/build/scanCssEntryPoints.ts
522
+ import { existsSync as existsSync3 } from "fs";
519
523
  var {Glob: Glob3 } = globalThis.Bun;
520
524
  var scanCssEntryPoints = async (dir, ignore) => {
525
+ if (!existsSync3(dir))
526
+ return [];
521
527
  const entryPaths = [];
522
528
  const glob = new Glob3("**/*.css");
523
529
  for await (const file2 of glob.scan({ absolute: true, cwd: dir })) {
@@ -531,12 +537,12 @@ var scanCssEntryPoints = async (dir, ignore) => {
531
537
  var init_scanCssEntryPoints = () => {};
532
538
 
533
539
  // src/cli/scripts/telemetry.ts
534
- import { existsSync as existsSync2, mkdirSync, readFileSync, writeFileSync } from "fs";
540
+ import { existsSync as existsSync4, mkdirSync, readFileSync, writeFileSync } from "fs";
535
541
  import { homedir } from "os";
536
542
  import { join as join2 } from "path";
537
543
  var configDir, configPath, getTelemetryConfig = () => {
538
544
  try {
539
- if (!existsSync2(configPath))
545
+ if (!existsSync4(configPath))
540
546
  return null;
541
547
  const raw = readFileSync(configPath, "utf-8");
542
548
  const config = JSON.parse(raw);
@@ -551,11 +557,11 @@ var init_telemetry = __esm(() => {
551
557
  });
552
558
 
553
559
  // src/cli/telemetryEvent.ts
554
- import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
560
+ import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
555
561
  import { arch, platform } from "os";
556
562
  import { dirname, join as join3, parse } from "path";
557
563
  var checkCandidate = (candidate) => {
558
- if (!existsSync3(candidate)) {
564
+ if (!existsSync5(candidate)) {
559
565
  return null;
560
566
  }
561
567
  const pkg = JSON.parse(readFileSync2(candidate, "utf-8"));
@@ -656,12 +662,12 @@ var init_updateAssetPaths = __esm(() => {
656
662
  });
657
663
 
658
664
  // src/dev/buildHMRClient.ts
659
- import { existsSync as existsSync4 } from "fs";
665
+ import { existsSync as existsSync6 } from "fs";
660
666
  import { resolve as resolve3 } from "path";
661
667
  var {build: bunBuild } = globalThis.Bun;
662
668
  var resolveHmrClientPath = () => {
663
669
  const fromSource = resolve3(import.meta.dir, "client/hmrClient.ts");
664
- if (existsSync4(fromSource))
670
+ if (existsSync6(fromSource))
665
671
  return fromSource;
666
672
  return resolve3(import.meta.dir, "dev/client/hmrClient.ts");
667
673
  }, hmrClientPath2, buildHMRClient = async () => {
@@ -736,7 +742,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
736
742
  };
737
743
 
738
744
  // src/build/angularLinkerPlugin.ts
739
- import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
745
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
740
746
  import { dirname as dirname2, join as join4, relative, resolve as resolve4 } from "path";
741
747
  import { createHash } from "crypto";
742
748
  var CACHE_DIR, angularLinkerPlugin;
@@ -761,7 +767,7 @@ var init_angularLinkerPlugin = __esm(() => {
761
767
  }
762
768
  const hash = createHash("md5").update(source).digest("hex");
763
769
  const cachePath = join4(CACHE_DIR, `${hash}.js`);
764
- if (existsSync5(cachePath)) {
770
+ if (existsSync7(cachePath)) {
765
771
  return {
766
772
  contents: readFileSync3(cachePath, "utf-8"),
767
773
  loader: "js"
@@ -778,7 +784,7 @@ var init_angularLinkerPlugin = __esm(() => {
778
784
  linkerPlugin = mod.createEs2015LinkerPlugin({
779
785
  fileSystem: {
780
786
  dirname: dirname2,
781
- exists: existsSync5,
787
+ exists: existsSync7,
782
788
  readFile: readFileSync3,
783
789
  relative,
784
790
  resolve: resolve4
@@ -1054,7 +1060,7 @@ var exports_compileSvelte = {};
1054
1060
  __export(exports_compileSvelte, {
1055
1061
  compileSvelte: () => compileSvelte
1056
1062
  });
1057
- import { existsSync as existsSync6 } from "fs";
1063
+ import { existsSync as existsSync8 } from "fs";
1058
1064
  import { mkdir as mkdir2, stat } from "fs/promises";
1059
1065
  import {
1060
1066
  dirname as dirname3,
@@ -1069,7 +1075,7 @@ import { env } from "process";
1069
1075
  var {write, file: file2, Transpiler } = globalThis.Bun;
1070
1076
  var resolveDevClientDir2 = () => {
1071
1077
  const fromSource = resolve7(import.meta.dir, "../dev/client");
1072
- if (existsSync6(fromSource))
1078
+ if (existsSync8(fromSource))
1073
1079
  return fromSource;
1074
1080
  return resolve7(import.meta.dir, "./dev/client");
1075
1081
  }, devClientDir2, hmrClientPath3, transpiler, exists = async (path) => {
@@ -1220,13 +1226,13 @@ __export(exports_compileVue, {
1220
1226
  compileVue: () => compileVue,
1221
1227
  clearVueHmrCaches: () => clearVueHmrCaches
1222
1228
  });
1223
- import { existsSync as existsSync7 } from "fs";
1229
+ import { existsSync as existsSync9 } from "fs";
1224
1230
  import { mkdir as mkdir3 } from "fs/promises";
1225
1231
  import { basename as basename3, dirname as dirname4, join as join7, relative as relative4, resolve as resolve8 } from "path";
1226
1232
  var {file: file3, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
1227
1233
  var resolveDevClientDir3 = () => {
1228
1234
  const fromSource = resolve8(import.meta.dir, "../dev/client");
1229
- if (existsSync7(fromSource))
1235
+ if (existsSync9(fromSource))
1230
1236
  return fromSource;
1231
1237
  return resolve8(import.meta.dir, "./dev/client");
1232
1238
  }, devClientDir3, hmrClientPath4, transpiler2, scriptCache, scriptSetupCache, templateCache, styleCache, vueHmrMetadata, clearVueHmrCaches = () => {
@@ -170275,7 +170281,7 @@ __export(exports_compileAngular, {
170275
170281
  compileAngularFile: () => compileAngularFile,
170276
170282
  compileAngular: () => compileAngular
170277
170283
  });
170278
- import { existsSync as existsSync8, readFileSync as readFileSync4, promises as fs } from "fs";
170284
+ import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
170279
170285
  import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve9, relative as relative5 } from "path";
170280
170286
  import { createHash as createHash2 } from "crypto";
170281
170287
  var import_typescript, computeConfigHash = () => {
@@ -170287,7 +170293,7 @@ var import_typescript, computeConfigHash = () => {
170287
170293
  }
170288
170294
  }, resolveDevClientDir4 = () => {
170289
170295
  const fromSource = resolve9(import.meta.dir, "../dev/client");
170290
- if (existsSync8(fromSource))
170296
+ if (existsSync10(fromSource))
170291
170297
  return fromSource;
170292
170298
  return resolve9(import.meta.dir, "./dev/client");
170293
170299
  }, devClientDir4, hmrClientPath5, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
@@ -170429,7 +170435,7 @@ ${registrations}
170429
170435
  await Promise.all(entries.map(({ target, content }) => fs.writeFile(target, content, "utf-8")));
170430
170436
  return entries.map(({ target }) => target);
170431
170437
  }, jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), readAndEscapeFile = async (filePath) => {
170432
- if (!existsSync8(filePath))
170438
+ if (!existsSync10(filePath))
170433
170439
  return null;
170434
170440
  const content = await fs.readFile(filePath, "utf-8");
170435
170441
  return escapeTemplateContent(content);
@@ -170493,7 +170499,7 @@ ${registrations}
170493
170499
  let actualPath = resolved;
170494
170500
  if (!actualPath.endsWith(".ts"))
170495
170501
  actualPath += ".ts";
170496
- if (!existsSync8(actualPath))
170502
+ if (!existsSync10(actualPath))
170497
170503
  return;
170498
170504
  let sourceCode = await fs.readFile(actualPath, "utf-8");
170499
170505
  sourceCode = await inlineResources(sourceCode, dirname5(actualPath));
@@ -170511,7 +170517,7 @@ ${registrations}
170511
170517
  }
170512
170518
  const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
170513
170519
  const cacheKey = actualPath;
170514
- if (jitContentCache.get(cacheKey) === contentHash && existsSync8(targetPath)) {
170520
+ if (jitContentCache.get(cacheKey) === contentHash && existsSync10(targetPath)) {
170515
170521
  allOutputs.push(targetPath);
170516
170522
  } else {
170517
170523
  const result = import_typescript.default.transpileModule(sourceCode, {
@@ -171363,7 +171369,7 @@ var init_build = __esm(() => {
171363
171369
  });
171364
171370
 
171365
171371
  // src/dev/dependencyGraph.ts
171366
- import { existsSync as existsSync9, readFileSync as readFileSync6, readdirSync } from "fs";
171372
+ import { existsSync as existsSync11, readFileSync as readFileSync6, readdirSync } from "fs";
171367
171373
  import { resolve as resolve11 } from "path";
171368
171374
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
171369
171375
  const lower = filePath.toLowerCase();
@@ -171392,10 +171398,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
171392
171398
  ];
171393
171399
  for (const ext of extensions) {
171394
171400
  const withExt = normalized + ext;
171395
- if (existsSync9(withExt))
171401
+ if (existsSync11(withExt))
171396
171402
  return withExt;
171397
171403
  }
171398
- if (existsSync9(normalized))
171404
+ if (existsSync11(normalized))
171399
171405
  return normalized;
171400
171406
  return null;
171401
171407
  }, clearExistingDependents = (graph, normalizedPath) => {
@@ -171410,7 +171416,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
171410
171416
  }
171411
171417
  }, addFileToGraph = (graph, filePath) => {
171412
171418
  const normalizedPath = resolve11(filePath);
171413
- if (!existsSync9(normalizedPath))
171419
+ if (!existsSync11(normalizedPath))
171414
171420
  return;
171415
171421
  const dependencies = extractDependencies(normalizedPath);
171416
171422
  clearExistingDependents(graph, normalizedPath);
@@ -171460,7 +171466,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
171460
171466
  };
171461
171467
  for (const dir of directories) {
171462
171468
  const resolvedDir = resolve11(dir);
171463
- if (!existsSync9(resolvedDir))
171469
+ if (!existsSync11(resolvedDir))
171464
171470
  continue;
171465
171471
  scanDirectory(resolvedDir);
171466
171472
  }
@@ -171833,7 +171839,7 @@ var init_pathUtils = () => {};
171833
171839
 
171834
171840
  // src/dev/fileWatcher.ts
171835
171841
  import { watch } from "fs";
171836
- import { existsSync as existsSync10 } from "fs";
171842
+ import { existsSync as existsSync12 } from "fs";
171837
171843
  import { join as join12, resolve as resolve13 } from "path";
171838
171844
  var safeRemoveFromGraph = (graph, fullPath) => {
171839
171845
  try {
@@ -171865,12 +171871,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
171865
171871
  if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
171866
171872
  return;
171867
171873
  }
171868
- if (event === "rename" && !existsSync10(fullPath)) {
171874
+ if (event === "rename" && !existsSync12(fullPath)) {
171869
171875
  safeRemoveFromGraph(state.dependencyGraph, fullPath);
171870
171876
  onFileChange(fullPath);
171871
171877
  return;
171872
171878
  }
171873
- if (existsSync10(fullPath)) {
171879
+ if (existsSync12(fullPath)) {
171874
171880
  onFileChange(fullPath);
171875
171881
  safeAddToGraph(state.dependencyGraph, fullPath);
171876
171882
  }
@@ -171880,7 +171886,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
171880
171886
  const stylesDir = state.resolvedPaths?.stylesDir;
171881
171887
  paths.forEach((path) => {
171882
171888
  const absolutePath = resolve13(path).replace(/\\/g, "/");
171883
- if (!existsSync10(absolutePath)) {
171889
+ if (!existsSync12(absolutePath)) {
171884
171890
  return;
171885
171891
  }
171886
171892
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
@@ -171891,7 +171897,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
171891
171897
  const stylesDir = state.resolvedPaths?.stylesDir;
171892
171898
  watchPaths.forEach((path) => {
171893
171899
  const absolutePath = resolve13(path).replace(/\\/g, "/");
171894
- if (!existsSync10(absolutePath)) {
171900
+ if (!existsSync12(absolutePath)) {
171895
171901
  return;
171896
171902
  }
171897
171903
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
@@ -171920,7 +171926,7 @@ var mimeTypes, getMimeType = (filePath) => {
171920
171926
  }
171921
171927
  const identity = stripHash(fullPath);
171922
171928
  const livePath = liveByIdentity.get(identity);
171923
- if (livePath && livePath !== fullPath) {
171929
+ if (livePath !== fullPath) {
171924
171930
  return unlink(fullPath).catch(() => {});
171925
171931
  }
171926
171932
  return null;
@@ -171969,9 +171975,14 @@ var mimeTypes, getMimeType = (filePath) => {
171969
171975
  continue;
171970
171976
  newIdentities.set(stripHash(webPath), webPath);
171971
171977
  }
171978
+ const liveWebPaths = new Set(newIdentities.values());
171972
171979
  const staleKeys = [...store.keys()].filter((existingPath) => {
171980
+ if (existingPath.includes("/chunk-"))
171981
+ return false;
171973
171982
  const replacement = newIdentities.get(stripHash(existingPath));
171974
- return replacement !== undefined && replacement !== existingPath;
171983
+ if (replacement !== undefined)
171984
+ return replacement !== existingPath;
171985
+ return !liveWebPaths.has(existingPath);
171975
171986
  });
171976
171987
  staleKeys.forEach((key) => store.delete(key));
171977
171988
  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 resolve19 } 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((file4) => existsSync11(file4));
172393
+ const dependentFiles = Array.from(dependents).filter((file4) => existsSync13(file4));
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 = resolve19(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 = resolve19(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
  });
@@ -174181,5 +174192,5 @@ export {
174181
174192
  ANGULAR_INIT_TIMEOUT_MS
174182
174193
  };
174183
174194
 
174184
- //# debugId=9221EF0444E5070A64756E2164756E21
174195
+ //# debugId=07AFDBD9596E196B64756E2164756E21
174185
174196
  //# sourceMappingURL=index.js.map