@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/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
|
|
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 (!
|
|
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
|
|
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 (!
|
|
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
|
|
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 (
|
|
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
|
|
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 (
|
|
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:
|
|
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
|
|
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 (
|
|
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
|
|
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 (
|
|
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
|
|
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 (
|
|
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 (!
|
|
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 (!
|
|
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 &&
|
|
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
|
|
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 (
|
|
171376
|
+
if (existsSync11(withExt))
|
|
171371
171377
|
return withExt;
|
|
171372
171378
|
}
|
|
171373
|
-
if (
|
|
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 (!
|
|
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 (!
|
|
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
|
|
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" && !
|
|
171849
|
+
if (event === "rename" && !existsSync12(fullPath)) {
|
|
171844
171850
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
171845
171851
|
onFileChange(fullPath);
|
|
171846
171852
|
return;
|
|
171847
171853
|
}
|
|
171848
|
-
if (
|
|
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 (!
|
|
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 (!
|
|
171875
|
+
if (!existsSync12(absolutePath)) {
|
|
171870
171876
|
return;
|
|
171871
171877
|
}
|
|
171872
171878
|
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 resolve18 } 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((file3) =>
|
|
172393
|
+
const dependentFiles = Array.from(dependents).filter((file3) => existsSync13(file3));
|
|
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 = resolve18(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 = resolve18(reactIndexesPath, `${pageName}.tsx`);
|
|
172633
|
-
if (
|
|
172639
|
+
if (existsSync13(indexPath) && !reactEntries.includes(indexPath)) {
|
|
172634
172640
|
reactEntries.push(indexPath);
|
|
172635
172641
|
}
|
|
172636
172642
|
});
|
|
@@ -173762,5 +173768,5 @@ export {
|
|
|
173762
173768
|
build
|
|
173763
173769
|
};
|
|
173764
173770
|
|
|
173765
|
-
//# debugId=
|
|
173771
|
+
//# debugId=17E876A773BB909664756E2164756E21
|
|
173766
173772
|
//# sourceMappingURL=build.js.map
|