@absolutejs/absolute 0.15.0 → 0.15.1
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/dev/client/cssUtils.ts +288 -0
- package/dist/dev/client/domDiff.ts +261 -0
- package/dist/dev/client/domState.ts +271 -0
- package/dist/dev/client/errorOverlay.ts +145 -0
- package/dist/dev/client/frameworkDetect.ts +63 -0
- package/dist/dev/client/handlers/html.ts +415 -0
- package/dist/dev/client/handlers/htmx.ts +248 -0
- package/dist/dev/client/handlers/react.ts +80 -0
- package/dist/dev/client/handlers/rebuild.ts +147 -0
- package/dist/dev/client/handlers/svelte.ts +129 -0
- package/dist/dev/client/handlers/vue.ts +254 -0
- package/dist/dev/client/headPatch.ts +213 -0
- package/dist/dev/client/hmrClient.ts +204 -0
- package/dist/dev/client/moduleVersions.ts +57 -0
- package/dist/dev/client/reactRefreshSetup.ts +21 -0
- package/dist/index.js +44 -23
- package/dist/index.js.map +5 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __export(exports_compileVue, {
|
|
|
42
42
|
compileVue: () => compileVue,
|
|
43
43
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
44
44
|
});
|
|
45
|
+
import { existsSync as existsSync2 } from "fs";
|
|
45
46
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
46
47
|
import { basename as basename2, dirname as dirname2, join as join2, relative as relative2, resolve as resolve2 } from "path";
|
|
47
48
|
import {
|
|
@@ -51,7 +52,7 @@ import {
|
|
|
51
52
|
compileStyle
|
|
52
53
|
} from "@vue/compiler-sfc";
|
|
53
54
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
54
|
-
var hmrClientPath2, transpiler2, scriptCache, scriptSetupCache, templateCache, styleCache, vueHmrMetadata, detectVueChangeType = (filePath, descriptor) => {
|
|
55
|
+
var devClientDir2, hmrClientPath2, transpiler2, scriptCache, scriptSetupCache, templateCache, styleCache, vueHmrMetadata, detectVueChangeType = (filePath, descriptor) => {
|
|
55
56
|
const prevScript = scriptCache.get(filePath);
|
|
56
57
|
const prevScriptSetup = scriptSetupCache.get(filePath);
|
|
57
58
|
const prevTemplate = templateCache.get(filePath);
|
|
@@ -347,7 +348,13 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
347
348
|
};
|
|
348
349
|
};
|
|
349
350
|
var init_compileVue = __esm(() => {
|
|
350
|
-
|
|
351
|
+
devClientDir2 = (() => {
|
|
352
|
+
const fromSource = resolve2(import.meta.dir, "../dev/client");
|
|
353
|
+
if (existsSync2(fromSource))
|
|
354
|
+
return fromSource;
|
|
355
|
+
return resolve2(import.meta.dir, "./dev/client");
|
|
356
|
+
})();
|
|
357
|
+
hmrClientPath2 = join2(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
351
358
|
transpiler2 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
352
359
|
scriptCache = new Map;
|
|
353
360
|
scriptSetupCache = new Map;
|
|
@@ -361,12 +368,12 @@ var exports_simpleHTMLHMR = {};
|
|
|
361
368
|
__export(exports_simpleHTMLHMR, {
|
|
362
369
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
363
370
|
});
|
|
364
|
-
import { readFileSync as readFileSync4, existsSync as
|
|
371
|
+
import { readFileSync as readFileSync4, existsSync as existsSync6 } from "fs";
|
|
365
372
|
import { resolve as resolve13 } from "path";
|
|
366
373
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
367
374
|
try {
|
|
368
375
|
const resolvedPath = resolve13(htmlFilePath);
|
|
369
|
-
if (!
|
|
376
|
+
if (!existsSync6(resolvedPath)) {
|
|
370
377
|
return null;
|
|
371
378
|
}
|
|
372
379
|
const htmlContent = readFileSync4(resolvedPath, "utf-8");
|
|
@@ -648,12 +655,12 @@ var exports_simpleHTMXHMR = {};
|
|
|
648
655
|
__export(exports_simpleHTMXHMR, {
|
|
649
656
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
650
657
|
});
|
|
651
|
-
import { readFileSync as readFileSync5, existsSync as
|
|
658
|
+
import { readFileSync as readFileSync5, existsSync as existsSync7 } from "fs";
|
|
652
659
|
import { resolve as resolve16 } from "path";
|
|
653
660
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
654
661
|
try {
|
|
655
662
|
const resolvedPath = resolve16(htmxFilePath);
|
|
656
|
-
if (!
|
|
663
|
+
if (!existsSync7(resolvedPath)) {
|
|
657
664
|
return null;
|
|
658
665
|
}
|
|
659
666
|
const htmlContent = readFileSync5(resolvedPath, "utf-8");
|
|
@@ -722,6 +729,7 @@ import { cwd, env as env2, exit } from "process";
|
|
|
722
729
|
var {$, build: bunBuild2, Glob: Glob3 } = globalThis.Bun;
|
|
723
730
|
|
|
724
731
|
// src/build/compileSvelte.ts
|
|
732
|
+
import { existsSync } from "fs";
|
|
725
733
|
import { mkdir, stat } from "fs/promises";
|
|
726
734
|
import {
|
|
727
735
|
dirname,
|
|
@@ -735,7 +743,13 @@ import {
|
|
|
735
743
|
import { env } from "process";
|
|
736
744
|
var {write, file, Transpiler } = globalThis.Bun;
|
|
737
745
|
import { compile, compileModule, preprocess } from "svelte/compiler";
|
|
738
|
-
var
|
|
746
|
+
var devClientDir = (() => {
|
|
747
|
+
const fromSource = resolve(import.meta.dir, "../dev/client");
|
|
748
|
+
if (existsSync(fromSource))
|
|
749
|
+
return fromSource;
|
|
750
|
+
return resolve(import.meta.dir, "./dev/client");
|
|
751
|
+
})();
|
|
752
|
+
var hmrClientPath = join(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
|
|
739
753
|
var transpiler = new Transpiler({ loader: "ts", target: "browser" });
|
|
740
754
|
var exists = async (path) => {
|
|
741
755
|
try {
|
|
@@ -935,11 +949,18 @@ var generateManifest = (outputs, buildPath) => outputs.reduce((manifest, artifac
|
|
|
935
949
|
}, {});
|
|
936
950
|
|
|
937
951
|
// src/build/generateReactIndexes.ts
|
|
952
|
+
import { existsSync as existsSync3 } from "fs";
|
|
938
953
|
import { mkdir as mkdir3, rm, writeFile } from "fs/promises";
|
|
939
954
|
import { basename as basename3, join as join3, resolve as resolve3 } from "path";
|
|
940
955
|
var {Glob } = globalThis.Bun;
|
|
941
|
-
var
|
|
942
|
-
|
|
956
|
+
var devClientDir3 = (() => {
|
|
957
|
+
const fromSource = resolve3(import.meta.dir, "../dev/client");
|
|
958
|
+
if (existsSync3(fromSource))
|
|
959
|
+
return fromSource;
|
|
960
|
+
return resolve3(import.meta.dir, "./dev/client");
|
|
961
|
+
})();
|
|
962
|
+
var hmrClientPath3 = join3(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
963
|
+
var refreshSetupPath = join3(devClientDir3, "reactRefreshSetup.ts").replace(/\\/g, "/");
|
|
943
964
|
var generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory, isDev = false) => {
|
|
944
965
|
await rm(reactIndexesDirectory, { force: true, recursive: true });
|
|
945
966
|
await mkdir3(reactIndexesDirectory);
|
|
@@ -1823,7 +1844,7 @@ import { statSync } from "fs";
|
|
|
1823
1844
|
import { resolve as resolve18 } from "path";
|
|
1824
1845
|
|
|
1825
1846
|
// src/dev/dependencyGraph.ts
|
|
1826
|
-
import { readFileSync as readFileSync2, readdirSync, existsSync } from "fs";
|
|
1847
|
+
import { readFileSync as readFileSync2, readdirSync, existsSync as existsSync4 } from "fs";
|
|
1827
1848
|
import { resolve as resolve7 } from "path";
|
|
1828
1849
|
var createDependencyGraph = () => ({
|
|
1829
1850
|
dependencies: new Map,
|
|
@@ -1831,7 +1852,7 @@ var createDependencyGraph = () => ({
|
|
|
1831
1852
|
});
|
|
1832
1853
|
var extractDependencies = (filePath) => {
|
|
1833
1854
|
try {
|
|
1834
|
-
if (!
|
|
1855
|
+
if (!existsSync4(filePath)) {
|
|
1835
1856
|
return [];
|
|
1836
1857
|
}
|
|
1837
1858
|
const content = readFileSync2(filePath, "utf-8");
|
|
@@ -1923,7 +1944,7 @@ var resolveImportPath = (importPath, fromFile) => {
|
|
|
1923
1944
|
};
|
|
1924
1945
|
var addFileToGraph = (graph, filePath) => {
|
|
1925
1946
|
const normalizedPath = resolve7(filePath);
|
|
1926
|
-
if (!
|
|
1947
|
+
if (!existsSync4(normalizedPath)) {
|
|
1927
1948
|
return;
|
|
1928
1949
|
}
|
|
1929
1950
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -2023,7 +2044,7 @@ var buildInitialDependencyGraph = (graph, directories) => {
|
|
|
2023
2044
|
};
|
|
2024
2045
|
for (const dir of directories) {
|
|
2025
2046
|
const resolvedDir = resolve7(dir);
|
|
2026
|
-
if (
|
|
2047
|
+
if (existsSync4(resolvedDir)) {
|
|
2027
2048
|
scanDirectory(resolvedDir);
|
|
2028
2049
|
}
|
|
2029
2050
|
}
|
|
@@ -2105,7 +2126,7 @@ var incrementSourceFileVersions = (state, filePaths) => {
|
|
|
2105
2126
|
|
|
2106
2127
|
// src/dev/fileWatcher.ts
|
|
2107
2128
|
import { watch } from "fs";
|
|
2108
|
-
import { existsSync as
|
|
2129
|
+
import { existsSync as existsSync5 } from "fs";
|
|
2109
2130
|
import { join as join6, resolve as resolve9 } from "path";
|
|
2110
2131
|
|
|
2111
2132
|
// src/dev/pathUtils.ts
|
|
@@ -2222,7 +2243,7 @@ var startFileWatching = (state, config, onFileChange) => {
|
|
|
2222
2243
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
2223
2244
|
for (const path of watchPaths) {
|
|
2224
2245
|
const absolutePath = resolve9(path).replace(/\\/g, "/");
|
|
2225
|
-
if (!
|
|
2246
|
+
if (!existsSync5(absolutePath)) {
|
|
2226
2247
|
continue;
|
|
2227
2248
|
}
|
|
2228
2249
|
const watcher = watch(absolutePath, { recursive: true }, (event, filename) => {
|
|
@@ -2235,14 +2256,14 @@ var startFileWatching = (state, config, onFileChange) => {
|
|
|
2235
2256
|
if (shouldIgnorePath(fullPath)) {
|
|
2236
2257
|
return;
|
|
2237
2258
|
}
|
|
2238
|
-
if (event === "rename" && !
|
|
2259
|
+
if (event === "rename" && !existsSync5(fullPath)) {
|
|
2239
2260
|
try {
|
|
2240
2261
|
removeFileFromGraph(state.dependencyGraph, fullPath);
|
|
2241
2262
|
} catch {}
|
|
2242
2263
|
onFileChange(fullPath);
|
|
2243
2264
|
return;
|
|
2244
2265
|
}
|
|
2245
|
-
if (
|
|
2266
|
+
if (existsSync5(fullPath)) {
|
|
2246
2267
|
onFileChange(fullPath);
|
|
2247
2268
|
try {
|
|
2248
2269
|
addFileToGraph(state.dependencyGraph, fullPath);
|
|
@@ -2352,7 +2373,7 @@ var cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
|
2352
2373
|
var lookupAsset = (store, path) => store.get(path);
|
|
2353
2374
|
|
|
2354
2375
|
// src/dev/rebuildTrigger.ts
|
|
2355
|
-
import { existsSync as
|
|
2376
|
+
import { existsSync as existsSync8 } from "fs";
|
|
2356
2377
|
import { basename as basename8, resolve as resolve17 } from "path";
|
|
2357
2378
|
|
|
2358
2379
|
// src/dev/fileHashTracker.ts
|
|
@@ -2663,13 +2684,13 @@ var queueFileChange = (state, filePath, config, onRebuildComplete) => {
|
|
|
2663
2684
|
const validFiles = [];
|
|
2664
2685
|
const processedFiles = new Set;
|
|
2665
2686
|
for (const filePathInSet of filePathSet) {
|
|
2666
|
-
if (!
|
|
2687
|
+
if (!existsSync8(filePathInSet)) {
|
|
2667
2688
|
state.fileHashes.delete(filePathInSet);
|
|
2668
2689
|
try {
|
|
2669
2690
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
2670
2691
|
const deletedPathResolved = resolve17(filePathInSet);
|
|
2671
2692
|
for (const affectedFile of affectedFiles) {
|
|
2672
|
-
if (affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
2693
|
+
if (affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync8(affectedFile)) {
|
|
2673
2694
|
validFiles.push(affectedFile);
|
|
2674
2695
|
processedFiles.add(affectedFile);
|
|
2675
2696
|
}
|
|
@@ -2690,7 +2711,7 @@ var queueFileChange = (state, filePath, config, onRebuildComplete) => {
|
|
|
2690
2711
|
try {
|
|
2691
2712
|
const dependents = state.dependencyGraph.dependents.get(normalizedFilePath);
|
|
2692
2713
|
if (dependents && dependents.size > 0) {
|
|
2693
|
-
const dependentFiles = Array.from(dependents).filter((f) =>
|
|
2714
|
+
const dependentFiles = Array.from(dependents).filter((f) => existsSync8(f));
|
|
2694
2715
|
if (dependentFiles.length > 0) {
|
|
2695
2716
|
incrementSourceFileVersions(state, dependentFiles);
|
|
2696
2717
|
}
|
|
@@ -2699,7 +2720,7 @@ var queueFileChange = (state, filePath, config, onRebuildComplete) => {
|
|
|
2699
2720
|
try {
|
|
2700
2721
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
2701
2722
|
for (const affectedFile of affectedFiles) {
|
|
2702
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
2723
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync8(affectedFile)) {
|
|
2703
2724
|
validFiles.push(affectedFile);
|
|
2704
2725
|
processedFiles.add(affectedFile);
|
|
2705
2726
|
}
|
|
@@ -3446,5 +3467,5 @@ export {
|
|
|
3446
3467
|
BUN_BUILD_WARNING_SUPPRESSION
|
|
3447
3468
|
};
|
|
3448
3469
|
|
|
3449
|
-
//# debugId=
|
|
3470
|
+
//# debugId=74202B6229702A7564756E2164756E21
|
|
3450
3471
|
//# sourceMappingURL=index.js.map
|