@absolutejs/absolute 0.18.3-beta.6 → 0.18.3-beta.8
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 +43 -37
- package/dist/build.js.map +4 -4
- package/dist/index.js +43 -37
- package/dist/index.js.map +4 -4
- package/package.json +1 -2
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
|
|
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 (!
|
|
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
|
|
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 (!
|
|
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
|
|
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 (
|
|
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
|
|
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 (
|
|
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:
|
|
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
|
|
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 (
|
|
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
|
|
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 (
|
|
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
|
|
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 (
|
|
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 (!
|
|
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 (!
|
|
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 &&
|
|
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
|
|
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 (
|
|
171401
|
+
if (existsSync11(withExt))
|
|
171396
171402
|
return withExt;
|
|
171397
171403
|
}
|
|
171398
|
-
if (
|
|
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 (!
|
|
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 (!
|
|
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
|
|
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" && !
|
|
171874
|
+
if (event === "rename" && !existsSync12(fullPath)) {
|
|
171869
171875
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
171870
171876
|
onFileChange(fullPath);
|
|
171871
171877
|
return;
|
|
171872
171878
|
}
|
|
171873
|
-
if (
|
|
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 (!
|
|
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 (!
|
|
171900
|
+
if (!existsSync12(absolutePath)) {
|
|
171895
171901
|
return;
|
|
171896
171902
|
}
|
|
171897
171903
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -172296,7 +172302,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
172296
172302
|
var init_simpleHTMXHMR = () => {};
|
|
172297
172303
|
|
|
172298
172304
|
// src/dev/rebuildTrigger.ts
|
|
172299
|
-
import { existsSync as
|
|
172305
|
+
import { existsSync as existsSync13 } from "fs";
|
|
172300
172306
|
import { rm as rm6 } from "fs/promises";
|
|
172301
172307
|
import { basename as basename7, relative as relative6, resolve as resolve19 } from "path";
|
|
172302
172308
|
var parseErrorLocationFromMessage = (msg) => {
|
|
@@ -172366,7 +172372,7 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
172366
172372
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
172367
172373
|
}
|
|
172368
172374
|
return { ...parsed, framework: detectedFw };
|
|
172369
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
172375
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync13(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
|
|
172370
172376
|
state.fileHashes.delete(filePathInSet);
|
|
172371
172377
|
try {
|
|
172372
172378
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
@@ -172384,7 +172390,7 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
172384
172390
|
if (!dependents || dependents.size === 0) {
|
|
172385
172391
|
return;
|
|
172386
172392
|
}
|
|
172387
|
-
const dependentFiles = Array.from(dependents).filter((file4) =>
|
|
172393
|
+
const dependentFiles = Array.from(dependents).filter((file4) => existsSync13(file4));
|
|
172388
172394
|
if (dependentFiles.length === 0) {
|
|
172389
172395
|
return;
|
|
172390
172396
|
}
|
|
@@ -172400,7 +172406,7 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
172400
172406
|
try {
|
|
172401
172407
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
172402
172408
|
affectedFiles.forEach((affectedFile) => {
|
|
172403
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
172409
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync13(affectedFile)) {
|
|
172404
172410
|
validFiles.push(affectedFile);
|
|
172405
172411
|
processedFiles.add(affectedFile);
|
|
172406
172412
|
}
|
|
@@ -172425,7 +172431,7 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
172425
172431
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
172426
172432
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
172427
172433
|
filePathSet.forEach((filePathInSet) => {
|
|
172428
|
-
if (!
|
|
172434
|
+
if (!existsSync13(filePathInSet)) {
|
|
172429
172435
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
172430
172436
|
return;
|
|
172431
172437
|
}
|
|
@@ -172500,7 +172506,7 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
172500
172506
|
return componentFile;
|
|
172501
172507
|
}
|
|
172502
172508
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
172503
|
-
if (
|
|
172509
|
+
if (existsSync13(tsCounterpart)) {
|
|
172504
172510
|
return tsCounterpart;
|
|
172505
172511
|
}
|
|
172506
172512
|
return componentFile;
|
|
@@ -172618,7 +172624,7 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
172618
172624
|
}, resolveReactEntryForPageFile = (normalized, pagesPathResolved, reactIndexesPath) => {
|
|
172619
172625
|
const pageName = basename7(normalized, ".tsx");
|
|
172620
172626
|
const indexPath = resolve19(reactIndexesPath, `${pageName}.tsx`);
|
|
172621
|
-
if (!
|
|
172627
|
+
if (!existsSync13(indexPath)) {
|
|
172622
172628
|
return;
|
|
172623
172629
|
}
|
|
172624
172630
|
return indexPath;
|
|
@@ -172630,7 +172636,7 @@ var parseErrorLocationFromMessage = (msg) => {
|
|
|
172630
172636
|
}
|
|
172631
172637
|
const pageName = basename7(dep, ".tsx");
|
|
172632
172638
|
const indexPath = resolve19(reactIndexesPath, `${pageName}.tsx`);
|
|
172633
|
-
if (
|
|
172639
|
+
if (existsSync13(indexPath) && !reactEntries.includes(indexPath)) {
|
|
172634
172640
|
reactEntries.push(indexPath);
|
|
172635
172641
|
}
|
|
172636
172642
|
});
|
|
@@ -174186,5 +174192,5 @@ export {
|
|
|
174186
174192
|
ANGULAR_INIT_TIMEOUT_MS
|
|
174187
174193
|
};
|
|
174188
174194
|
|
|
174189
|
-
//# debugId=
|
|
174195
|
+
//# debugId=07AFDBD9596E196B64756E2164756E21
|
|
174190
174196
|
//# sourceMappingURL=index.js.map
|