@absolutejs/absolute 0.19.0-beta.654 → 0.19.0-beta.656
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 +161 -148
- package/dist/build.js.map +3 -3
- package/dist/cli/index.js +4 -0
- package/dist/index.js +179 -166
- package/dist/index.js.map +3 -3
- package/package.json +304 -304
package/dist/index.js
CHANGED
|
@@ -175488,11 +175488,24 @@ __export(exports_buildReactVendor, {
|
|
|
175488
175488
|
computeVendorPaths: () => computeVendorPaths,
|
|
175489
175489
|
buildReactVendor: () => buildReactVendor
|
|
175490
175490
|
});
|
|
175491
|
-
import { mkdirSync as mkdirSync6 } from "fs";
|
|
175492
|
-
import { join as join14 } from "path";
|
|
175491
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync6 } from "fs";
|
|
175492
|
+
import { join as join14, resolve as resolve19 } from "path";
|
|
175493
175493
|
import { rm as rm4 } from "fs/promises";
|
|
175494
175494
|
var {build: bunBuild2 } = globalThis.Bun;
|
|
175495
|
-
var
|
|
175495
|
+
var resolveJsxDevRuntimeCompatPath = () => {
|
|
175496
|
+
const candidates = [
|
|
175497
|
+
resolve19(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
175498
|
+
resolve19(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
175499
|
+
resolve19(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
175500
|
+
resolve19(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
175501
|
+
];
|
|
175502
|
+
for (const candidate of candidates) {
|
|
175503
|
+
if (existsSync16(candidate)) {
|
|
175504
|
+
return candidate.replace(/\\/g, "/");
|
|
175505
|
+
}
|
|
175506
|
+
}
|
|
175507
|
+
return (candidates[0] ?? resolve19(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
175508
|
+
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
175496
175509
|
try {
|
|
175497
175510
|
Bun.resolveSync(specifier, process.cwd());
|
|
175498
175511
|
return true;
|
|
@@ -175556,7 +175569,7 @@ var jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
|
175556
175569
|
}
|
|
175557
175570
|
};
|
|
175558
175571
|
var init_buildReactVendor = __esm(() => {
|
|
175559
|
-
jsxDevRuntimeCompatPath =
|
|
175572
|
+
jsxDevRuntimeCompatPath = resolveJsxDevRuntimeCompatPath();
|
|
175560
175573
|
reactSpecifiers = [
|
|
175561
175574
|
"react",
|
|
175562
175575
|
"react-dom",
|
|
@@ -175790,14 +175803,14 @@ var init_rewriteImports = __esm(() => {
|
|
|
175790
175803
|
import {
|
|
175791
175804
|
copyFileSync,
|
|
175792
175805
|
cpSync,
|
|
175793
|
-
existsSync as
|
|
175806
|
+
existsSync as existsSync17,
|
|
175794
175807
|
mkdirSync as mkdirSync10,
|
|
175795
175808
|
readFileSync as readFileSync10,
|
|
175796
175809
|
rmSync as rmSync2,
|
|
175797
175810
|
statSync,
|
|
175798
175811
|
writeFileSync as writeFileSync7
|
|
175799
175812
|
} from "fs";
|
|
175800
|
-
import { basename as basename8, dirname as dirname10, join as join18, relative as relative9, resolve as
|
|
175813
|
+
import { basename as basename8, dirname as dirname10, join as join18, relative as relative9, resolve as resolve20 } from "path";
|
|
175801
175814
|
import { cwd, env as env3, exit } from "process";
|
|
175802
175815
|
var {build: bunBuild6, Glob: Glob6 } = globalThis.Bun;
|
|
175803
175816
|
var isDev2, collectConventionSourceFiles = (entry) => {
|
|
@@ -175885,8 +175898,8 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
175885
175898
|
}
|
|
175886
175899
|
}, resolveAbsoluteVersion = async () => {
|
|
175887
175900
|
const candidates = [
|
|
175888
|
-
|
|
175889
|
-
|
|
175901
|
+
resolve20(import.meta.dir, "..", "..", "package.json"),
|
|
175902
|
+
resolve20(import.meta.dir, "..", "package.json")
|
|
175890
175903
|
];
|
|
175891
175904
|
for (const candidate of candidates) {
|
|
175892
175905
|
const pkg = await tryReadPackageJson(candidate);
|
|
@@ -175898,7 +175911,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
175898
175911
|
return;
|
|
175899
175912
|
}
|
|
175900
175913
|
}, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
175901
|
-
const absPath =
|
|
175914
|
+
const absPath = resolve20(file4, "..", relPath);
|
|
175902
175915
|
try {
|
|
175903
175916
|
statSync(absPath);
|
|
175904
175917
|
workerPaths.add(absPath);
|
|
@@ -175958,11 +175971,11 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
175958
175971
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
175959
175972
|
}
|
|
175960
175973
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
175961
|
-
if (!
|
|
175974
|
+
if (!existsSync17(reactIndexesPath)) {
|
|
175962
175975
|
return;
|
|
175963
175976
|
}
|
|
175964
175977
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
175965
|
-
const pagesRel = relative9(process.cwd(),
|
|
175978
|
+
const pagesRel = relative9(process.cwd(), resolve20(reactPagesPath)).replace(/\\/g, "/");
|
|
175966
175979
|
for (const file4 of indexFiles) {
|
|
175967
175980
|
let content = readFileSync10(join18(reactIndexesPath, file4), "utf-8");
|
|
175968
175981
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -175970,27 +175983,27 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
175970
175983
|
}
|
|
175971
175984
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
175972
175985
|
const svelteIndexDir = join18(svelteDir, "generated", "indexes");
|
|
175973
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
175986
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve20(file4).startsWith(resolve20(sveltePagesPath)));
|
|
175974
175987
|
for (const entry of sveltePageEntries) {
|
|
175975
175988
|
const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
175976
175989
|
const indexFile = join18(svelteIndexDir, "pages", `${name}.js`);
|
|
175977
|
-
if (!
|
|
175990
|
+
if (!existsSync17(indexFile))
|
|
175978
175991
|
continue;
|
|
175979
175992
|
let content = readFileSync10(indexFile, "utf-8");
|
|
175980
|
-
const srcRel = relative9(process.cwd(),
|
|
175993
|
+
const srcRel = relative9(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
|
|
175981
175994
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
175982
175995
|
writeFileSync7(join18(devIndexDir, `${name}.svelte.js`), content);
|
|
175983
175996
|
}
|
|
175984
175997
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
175985
175998
|
const vueIndexDir = join18(vueDir, "generated", "indexes");
|
|
175986
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
175999
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve20(file4).startsWith(resolve20(vuePagesPath)));
|
|
175987
176000
|
for (const entry of vuePageEntries) {
|
|
175988
176001
|
const name = basename8(entry, ".vue");
|
|
175989
176002
|
const indexFile = join18(vueIndexDir, `${name}.js`);
|
|
175990
|
-
if (!
|
|
176003
|
+
if (!existsSync17(indexFile))
|
|
175991
176004
|
continue;
|
|
175992
176005
|
let content = readFileSync10(indexFile, "utf-8");
|
|
175993
|
-
const srcRel = relative9(process.cwd(),
|
|
176006
|
+
const srcRel = relative9(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
|
|
175994
176007
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
175995
176008
|
writeFileSync7(join18(devIndexDir, `${name}.vue.js`), content);
|
|
175996
176009
|
}
|
|
@@ -176003,7 +176016,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
176003
176016
|
const last = allComments[allComments.length - 1];
|
|
176004
176017
|
if (!last?.[1])
|
|
176005
176018
|
return JSON.stringify(outputPath);
|
|
176006
|
-
const srcPath =
|
|
176019
|
+
const srcPath = resolve20(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
176007
176020
|
return JSON.stringify(srcPath);
|
|
176008
176021
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
176009
176022
|
let depth = 0;
|
|
@@ -176212,13 +176225,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
176212
176225
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
176213
176226
|
if (!isIncremental || !incrementalFiles)
|
|
176214
176227
|
return entryPoints;
|
|
176215
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f) =>
|
|
176228
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve20(f)));
|
|
176216
176229
|
const matchingEntries = [];
|
|
176217
176230
|
for (const entry of entryPoints) {
|
|
176218
176231
|
const sourceFile = mapToSource(entry);
|
|
176219
176232
|
if (!sourceFile)
|
|
176220
176233
|
continue;
|
|
176221
|
-
if (!normalizedIncremental.has(
|
|
176234
|
+
if (!normalizedIncremental.has(resolve20(sourceFile)))
|
|
176222
176235
|
continue;
|
|
176223
176236
|
matchingEntries.push(entry);
|
|
176224
176237
|
}
|
|
@@ -176287,7 +176300,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
176287
176300
|
}
|
|
176288
176301
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/html/") && (f.endsWith(".html") || f.endsWith(".css")));
|
|
176289
176302
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
176290
|
-
if (entry.startsWith(
|
|
176303
|
+
if (entry.startsWith(resolve20(reactIndexesPath))) {
|
|
176291
176304
|
const pageName = basename8(entry, ".tsx");
|
|
176292
176305
|
return join18(reactPagesPath, `${pageName}.tsx`);
|
|
176293
176306
|
}
|
|
@@ -176350,7 +176363,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
176350
176363
|
const clientPath = islandSvelteClientPaths[idx];
|
|
176351
176364
|
if (!sourcePath || !clientPath)
|
|
176352
176365
|
continue;
|
|
176353
|
-
islandSvelteClientPathMap.set(
|
|
176366
|
+
islandSvelteClientPathMap.set(resolve20(sourcePath), clientPath);
|
|
176354
176367
|
}
|
|
176355
176368
|
const islandVueClientPathMap = new Map;
|
|
176356
176369
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -176358,7 +176371,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
176358
176371
|
const clientPath = islandVueClientPaths[idx];
|
|
176359
176372
|
if (!sourcePath || !clientPath)
|
|
176360
176373
|
continue;
|
|
176361
|
-
islandVueClientPathMap.set(
|
|
176374
|
+
islandVueClientPathMap.set(resolve20(sourcePath), clientPath);
|
|
176362
176375
|
}
|
|
176363
176376
|
const islandAngularClientPathMap = new Map;
|
|
176364
176377
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -176366,7 +176379,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
176366
176379
|
const clientPath = islandAngularClientPaths[idx];
|
|
176367
176380
|
if (!sourcePath || !clientPath)
|
|
176368
176381
|
continue;
|
|
176369
|
-
islandAngularClientPathMap.set(
|
|
176382
|
+
islandAngularClientPathMap.set(resolve20(sourcePath), clientPath);
|
|
176370
176383
|
}
|
|
176371
176384
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
176372
176385
|
const vueConventionSources = collectConventionSourceFiles(conventionsMap.vue);
|
|
@@ -176901,9 +176914,9 @@ var init_build = __esm(() => {
|
|
|
176901
176914
|
});
|
|
176902
176915
|
|
|
176903
176916
|
// src/dev/dependencyGraph.ts
|
|
176904
|
-
import { existsSync as
|
|
176917
|
+
import { existsSync as existsSync18, readFileSync as readFileSync11 } from "fs";
|
|
176905
176918
|
var {Glob: Glob7 } = globalThis.Bun;
|
|
176906
|
-
import { resolve as
|
|
176919
|
+
import { resolve as resolve21 } from "path";
|
|
176907
176920
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
176908
176921
|
const lower = filePath.toLowerCase();
|
|
176909
176922
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -176917,8 +176930,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
176917
176930
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
176918
176931
|
return null;
|
|
176919
176932
|
}
|
|
176920
|
-
const fromDir =
|
|
176921
|
-
const normalized =
|
|
176933
|
+
const fromDir = resolve21(fromFile, "..");
|
|
176934
|
+
const normalized = resolve21(fromDir, importPath);
|
|
176922
176935
|
const extensions = [
|
|
176923
176936
|
".ts",
|
|
176924
176937
|
".tsx",
|
|
@@ -176931,10 +176944,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
176931
176944
|
];
|
|
176932
176945
|
for (const ext of extensions) {
|
|
176933
176946
|
const withExt = normalized + ext;
|
|
176934
|
-
if (
|
|
176947
|
+
if (existsSync18(withExt))
|
|
176935
176948
|
return withExt;
|
|
176936
176949
|
}
|
|
176937
|
-
if (
|
|
176950
|
+
if (existsSync18(normalized))
|
|
176938
176951
|
return normalized;
|
|
176939
176952
|
return null;
|
|
176940
176953
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -176948,8 +176961,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
176948
176961
|
dependents.delete(normalizedPath);
|
|
176949
176962
|
}
|
|
176950
176963
|
}, addFileToGraph = (graph, filePath) => {
|
|
176951
|
-
const normalizedPath =
|
|
176952
|
-
if (!
|
|
176964
|
+
const normalizedPath = resolve21(filePath);
|
|
176965
|
+
if (!existsSync18(normalizedPath))
|
|
176953
176966
|
return;
|
|
176954
176967
|
const dependencies = extractDependencies(normalizedPath);
|
|
176955
176968
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -176965,10 +176978,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
176965
176978
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
176966
176979
|
const processedFiles = new Set;
|
|
176967
176980
|
const glob = new Glob7("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
176968
|
-
const resolvedDirs = directories.map((dir) =>
|
|
176981
|
+
const resolvedDirs = directories.map((dir) => resolve21(dir)).filter((dir) => existsSync18(dir));
|
|
176969
176982
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
176970
176983
|
for (const file4 of allFiles) {
|
|
176971
|
-
const fullPath =
|
|
176984
|
+
const fullPath = resolve21(file4);
|
|
176972
176985
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
176973
176986
|
continue;
|
|
176974
176987
|
if (processedFiles.has(fullPath))
|
|
@@ -177081,7 +177094,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
177081
177094
|
return [];
|
|
177082
177095
|
}
|
|
177083
177096
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
177084
|
-
const normalizedPath =
|
|
177097
|
+
const normalizedPath = resolve21(changedFile);
|
|
177085
177098
|
const affected = new Set;
|
|
177086
177099
|
const toProcess = [normalizedPath];
|
|
177087
177100
|
const processNode = (current) => {
|
|
@@ -177121,7 +177134,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
177121
177134
|
}
|
|
177122
177135
|
graph.dependents.delete(normalizedPath);
|
|
177123
177136
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
177124
|
-
const normalizedPath =
|
|
177137
|
+
const normalizedPath = resolve21(filePath);
|
|
177125
177138
|
removeDepsForFile(graph, normalizedPath);
|
|
177126
177139
|
removeDependentsForFile(graph, normalizedPath);
|
|
177127
177140
|
};
|
|
@@ -177164,12 +177177,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
177164
177177
|
};
|
|
177165
177178
|
|
|
177166
177179
|
// src/dev/configResolver.ts
|
|
177167
|
-
import { resolve as
|
|
177180
|
+
import { resolve as resolve22 } from "path";
|
|
177168
177181
|
var resolveBuildPaths = (config) => {
|
|
177169
177182
|
const cwd2 = process.cwd();
|
|
177170
177183
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
177171
|
-
const withDefault = (value, fallback) => normalize(
|
|
177172
|
-
const optional = (value) => value ? normalize(
|
|
177184
|
+
const withDefault = (value, fallback) => normalize(resolve22(cwd2, value ?? fallback));
|
|
177185
|
+
const optional = (value) => value ? normalize(resolve22(cwd2, value)) : undefined;
|
|
177173
177186
|
return {
|
|
177174
177187
|
angularDir: optional(config.angularDirectory),
|
|
177175
177188
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -177357,8 +177370,8 @@ var init_pathUtils = __esm(() => {
|
|
|
177357
177370
|
|
|
177358
177371
|
// src/dev/fileWatcher.ts
|
|
177359
177372
|
import { watch } from "fs";
|
|
177360
|
-
import { existsSync as
|
|
177361
|
-
import { join as join19, resolve as
|
|
177373
|
+
import { existsSync as existsSync19 } from "fs";
|
|
177374
|
+
import { join as join19, resolve as resolve23 } from "path";
|
|
177362
177375
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
177363
177376
|
try {
|
|
177364
177377
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -177389,12 +177402,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
177389
177402
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
177390
177403
|
return;
|
|
177391
177404
|
}
|
|
177392
|
-
if (event === "rename" && !
|
|
177405
|
+
if (event === "rename" && !existsSync19(fullPath)) {
|
|
177393
177406
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
177394
177407
|
onFileChange(fullPath);
|
|
177395
177408
|
return;
|
|
177396
177409
|
}
|
|
177397
|
-
if (
|
|
177410
|
+
if (existsSync19(fullPath)) {
|
|
177398
177411
|
onFileChange(fullPath);
|
|
177399
177412
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
177400
177413
|
}
|
|
@@ -177403,8 +177416,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
177403
177416
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
177404
177417
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
177405
177418
|
paths.forEach((path) => {
|
|
177406
|
-
const absolutePath =
|
|
177407
|
-
if (!
|
|
177419
|
+
const absolutePath = resolve23(path).replace(/\\/g, "/");
|
|
177420
|
+
if (!existsSync19(absolutePath)) {
|
|
177408
177421
|
return;
|
|
177409
177422
|
}
|
|
177410
177423
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -177414,8 +177427,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
177414
177427
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
177415
177428
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
177416
177429
|
watchPaths.forEach((path) => {
|
|
177417
|
-
const absolutePath =
|
|
177418
|
-
if (!
|
|
177430
|
+
const absolutePath = resolve23(path).replace(/\\/g, "/");
|
|
177431
|
+
if (!existsSync19(absolutePath)) {
|
|
177419
177432
|
return;
|
|
177420
177433
|
}
|
|
177421
177434
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -177429,13 +177442,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
177429
177442
|
});
|
|
177430
177443
|
|
|
177431
177444
|
// src/dev/assetStore.ts
|
|
177432
|
-
import { resolve as
|
|
177445
|
+
import { resolve as resolve24 } from "path";
|
|
177433
177446
|
import { readdir as readdir3, unlink } from "fs/promises";
|
|
177434
177447
|
var mimeTypes, getMimeType = (filePath) => {
|
|
177435
177448
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
177436
177449
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
177437
177450
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
177438
|
-
const fullPath =
|
|
177451
|
+
const fullPath = resolve24(dir, entry.name);
|
|
177439
177452
|
if (entry.isDirectory()) {
|
|
177440
177453
|
return walkAndClean(fullPath);
|
|
177441
177454
|
}
|
|
@@ -177451,10 +177464,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
177451
177464
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
177452
177465
|
const liveByIdentity = new Map;
|
|
177453
177466
|
for (const webPath of store.keys()) {
|
|
177454
|
-
const diskPath =
|
|
177467
|
+
const diskPath = resolve24(buildDir, webPath.slice(1));
|
|
177455
177468
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
177456
177469
|
}
|
|
177457
|
-
const absBuildDir =
|
|
177470
|
+
const absBuildDir = resolve24(buildDir);
|
|
177458
177471
|
Object.values(manifest).forEach((val) => {
|
|
177459
177472
|
if (!HASHED_FILE_RE.test(val))
|
|
177460
177473
|
return;
|
|
@@ -177472,7 +177485,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
177472
177485
|
} catch {}
|
|
177473
177486
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
177474
177487
|
if (entry.isDirectory()) {
|
|
177475
|
-
return scanDir(
|
|
177488
|
+
return scanDir(resolve24(dir, entry.name), `${prefix}${entry.name}/`);
|
|
177476
177489
|
}
|
|
177477
177490
|
if (!entry.name.startsWith("chunk-")) {
|
|
177478
177491
|
return null;
|
|
@@ -177481,7 +177494,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
177481
177494
|
if (store.has(webPath)) {
|
|
177482
177495
|
return null;
|
|
177483
177496
|
}
|
|
177484
|
-
return Bun.file(
|
|
177497
|
+
return Bun.file(resolve24(dir, entry.name)).bytes().then((bytes) => {
|
|
177485
177498
|
store.set(webPath, bytes);
|
|
177486
177499
|
return;
|
|
177487
177500
|
}).catch(() => {});
|
|
@@ -177506,7 +177519,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
177506
177519
|
for (const webPath of newIdentities.values()) {
|
|
177507
177520
|
if (store.has(webPath))
|
|
177508
177521
|
continue;
|
|
177509
|
-
loadPromises.push(Bun.file(
|
|
177522
|
+
loadPromises.push(Bun.file(resolve24(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
177510
177523
|
store.set(webPath, bytes);
|
|
177511
177524
|
return;
|
|
177512
177525
|
}).catch(() => {}));
|
|
@@ -177557,9 +177570,9 @@ var init_fileHashTracker = __esm(() => {
|
|
|
177557
177570
|
});
|
|
177558
177571
|
|
|
177559
177572
|
// src/dev/reactComponentClassifier.ts
|
|
177560
|
-
import { resolve as
|
|
177573
|
+
import { resolve as resolve25 } from "path";
|
|
177561
177574
|
var classifyComponent = (filePath) => {
|
|
177562
|
-
const normalizedPath =
|
|
177575
|
+
const normalizedPath = resolve25(filePath);
|
|
177563
177576
|
if (normalizedPath.includes("/react/pages/")) {
|
|
177564
177577
|
return "server";
|
|
177565
177578
|
}
|
|
@@ -177571,7 +177584,7 @@ var classifyComponent = (filePath) => {
|
|
|
177571
177584
|
var init_reactComponentClassifier = () => {};
|
|
177572
177585
|
|
|
177573
177586
|
// src/dev/moduleMapper.ts
|
|
177574
|
-
import { basename as basename9, resolve as
|
|
177587
|
+
import { basename as basename9, resolve as resolve26 } from "path";
|
|
177575
177588
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
177576
177589
|
const modulePaths = {};
|
|
177577
177590
|
moduleKeys.forEach((key) => {
|
|
@@ -177581,7 +177594,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
177581
177594
|
});
|
|
177582
177595
|
return modulePaths;
|
|
177583
177596
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
177584
|
-
const normalizedFile =
|
|
177597
|
+
const normalizedFile = resolve26(sourceFile);
|
|
177585
177598
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
177586
177599
|
if (processedFiles.has(normalizedFile)) {
|
|
177587
177600
|
return null;
|
|
@@ -177617,7 +177630,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
177617
177630
|
});
|
|
177618
177631
|
return grouped;
|
|
177619
177632
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
177620
|
-
const normalizedFile =
|
|
177633
|
+
const normalizedFile = resolve26(sourceFile);
|
|
177621
177634
|
const fileName = basename9(normalizedFile);
|
|
177622
177635
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
177623
177636
|
const pascalName = toPascal(baseName);
|
|
@@ -177899,19 +177912,19 @@ var escapeHtml = (str) => String(str).replace(/&/g, "&").replace(/</g, "<
|
|
|
177899
177912
|
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
177900
177913
|
import { mkdir as mkdir4, symlink } from "fs/promises";
|
|
177901
177914
|
import { tmpdir } from "os";
|
|
177902
|
-
import { basename as basename10, dirname as dirname11, join as join20, resolve as
|
|
177915
|
+
import { basename as basename10, dirname as dirname11, join as join20, resolve as resolve27 } from "path";
|
|
177903
177916
|
var ssrDirty2 = false, lastSelector = "angular-page", isRecord8 = (value) => typeof value === "object" && value !== null, isAngularComponent = (value) => typeof value === "function", compilerImportPromise = null, ensureAngularCompiler = () => {
|
|
177904
177917
|
if (!compilerImportPromise) {
|
|
177905
177918
|
compilerImportPromise = import("@angular/compiler");
|
|
177906
177919
|
}
|
|
177907
177920
|
return compilerImportPromise;
|
|
177908
177921
|
}, readAngularPageModule = (value) => isRecord8(value) ? value : null, resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join20(tmpdir(), "absolutejs", "generated", "angular-ssr"), ensureAngularSsrNodeModules = async (outDir) => {
|
|
177909
|
-
const outRoot =
|
|
177922
|
+
const outRoot = resolve27(dirname11(dirname11(outDir)));
|
|
177910
177923
|
const nodeModulesLink = join20(outRoot, "node_modules");
|
|
177911
177924
|
if (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {
|
|
177912
177925
|
return;
|
|
177913
177926
|
}
|
|
177914
|
-
if (nodeModulesLink ===
|
|
177927
|
+
if (nodeModulesLink === resolve27(process.cwd(), "node_modules")) {
|
|
177915
177928
|
return;
|
|
177916
177929
|
}
|
|
177917
177930
|
if (await Bun.file(nodeModulesLink).exists()) {
|
|
@@ -177919,7 +177932,7 @@ var ssrDirty2 = false, lastSelector = "angular-page", isRecord8 = (value) => typ
|
|
|
177919
177932
|
}
|
|
177920
177933
|
await mkdir4(outRoot, { recursive: true });
|
|
177921
177934
|
try {
|
|
177922
|
-
await symlink(
|
|
177935
|
+
await symlink(resolve27(process.cwd(), "node_modules"), nodeModulesLink, "dir");
|
|
177923
177936
|
} catch (error) {
|
|
177924
177937
|
if (!(error instanceof Error) || !("code" in error) || error.code !== "EEXIST") {
|
|
177925
177938
|
throw error;
|
|
@@ -178362,8 +178375,8 @@ __export(exports_moduleServer, {
|
|
|
178362
178375
|
createModuleServer: () => createModuleServer,
|
|
178363
178376
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
178364
178377
|
});
|
|
178365
|
-
import { existsSync as
|
|
178366
|
-
import { basename as basename12, dirname as dirname13, extname as extname5, resolve as
|
|
178378
|
+
import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as statSync2 } from "fs";
|
|
178379
|
+
import { basename as basename12, dirname as dirname13, extname as extname5, resolve as resolve28, relative as relative10 } from "path";
|
|
178367
178380
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
178368
178381
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
178369
178382
|
const allExports = [];
|
|
@@ -178383,7 +178396,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
178383
178396
|
${stubs}
|
|
178384
178397
|
`;
|
|
178385
178398
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
178386
|
-
const found = extensions.find((ext) =>
|
|
178399
|
+
const found = extensions.find((ext) => existsSync20(resolve28(projectRoot, srcPath + ext)));
|
|
178387
178400
|
return found ? srcPath + found : srcPath;
|
|
178388
178401
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
178389
178402
|
const entries = Object.entries(vendorPaths).sort(([a], [b]) => b.length - a.length);
|
|
@@ -178398,7 +178411,7 @@ ${stubs}
|
|
|
178398
178411
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
178399
178412
|
}, srcUrl = (relPath, projectRoot) => {
|
|
178400
178413
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
178401
|
-
const absPath =
|
|
178414
|
+
const absPath = resolve28(projectRoot, relPath);
|
|
178402
178415
|
const cached = mtimeCache.get(absPath);
|
|
178403
178416
|
if (cached !== undefined)
|
|
178404
178417
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -178410,12 +178423,12 @@ ${stubs}
|
|
|
178410
178423
|
return base;
|
|
178411
178424
|
}
|
|
178412
178425
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
178413
|
-
const absPath =
|
|
178426
|
+
const absPath = resolve28(fileDir, relPath);
|
|
178414
178427
|
const rel = relative10(projectRoot, absPath);
|
|
178415
178428
|
const extension = extname5(rel);
|
|
178416
178429
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
178417
178430
|
if (extname5(srcPath) === ".svelte") {
|
|
178418
|
-
srcPath = relative10(projectRoot, resolveSvelteModulePath(
|
|
178431
|
+
srcPath = relative10(projectRoot, resolveSvelteModulePath(resolve28(projectRoot, srcPath)));
|
|
178419
178432
|
}
|
|
178420
178433
|
return srcUrl(srcPath, projectRoot);
|
|
178421
178434
|
}, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -178461,12 +178474,12 @@ ${stubs}
|
|
|
178461
178474
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
178462
178475
|
});
|
|
178463
178476
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
178464
|
-
const absPath =
|
|
178477
|
+
const absPath = resolve28(fileDir, relPath);
|
|
178465
178478
|
const rel = relative10(projectRoot, absPath);
|
|
178466
178479
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
178467
178480
|
});
|
|
178468
178481
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
178469
|
-
const absPath =
|
|
178482
|
+
const absPath = resolve28(fileDir, relPath);
|
|
178470
178483
|
const rel = relative10(projectRoot, absPath);
|
|
178471
178484
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
178472
178485
|
});
|
|
@@ -178742,7 +178755,7 @@ ${code}`;
|
|
|
178742
178755
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
178743
178756
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
178744
178757
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
178745
|
-
const hmrBase = vueDir ?
|
|
178758
|
+
const hmrBase = vueDir ? resolve28(vueDir) : projectRoot;
|
|
178746
178759
|
const hmrId = relative10(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
178747
178760
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
178748
178761
|
result += [
|
|
@@ -178757,11 +178770,11 @@ ${code}`;
|
|
|
178757
178770
|
`);
|
|
178758
178771
|
return result;
|
|
178759
178772
|
}, resolveSvelteModulePath = (path) => {
|
|
178760
|
-
if (
|
|
178773
|
+
if (existsSync20(path))
|
|
178761
178774
|
return path;
|
|
178762
|
-
if (
|
|
178775
|
+
if (existsSync20(`${path}.ts`))
|
|
178763
178776
|
return `${path}.ts`;
|
|
178764
|
-
if (
|
|
178777
|
+
if (existsSync20(`${path}.js`))
|
|
178765
178778
|
return `${path}.js`;
|
|
178766
178779
|
return path;
|
|
178767
178780
|
}, jsResponse = (body) => {
|
|
@@ -178901,13 +178914,13 @@ export default {};
|
|
|
178901
178914
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
178902
178915
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
178903
178916
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
178904
|
-
const filePath =
|
|
178917
|
+
const filePath = resolve28(projectRoot, relPath);
|
|
178905
178918
|
const ext = extname5(filePath);
|
|
178906
178919
|
if (ext === ".svelte")
|
|
178907
178920
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
178908
178921
|
if (ext)
|
|
178909
178922
|
return { ext, filePath };
|
|
178910
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
178923
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync20(filePath + candidate));
|
|
178911
178924
|
if (!found)
|
|
178912
178925
|
return { ext, filePath };
|
|
178913
178926
|
const resolved = filePath + found;
|
|
@@ -178928,7 +178941,7 @@ export default {};
|
|
|
178928
178941
|
if (!TRANSPILABLE.has(ext))
|
|
178929
178942
|
return;
|
|
178930
178943
|
const stat2 = statSync2(filePath);
|
|
178931
|
-
const resolvedVueDir = vueDir ?
|
|
178944
|
+
const resolvedVueDir = vueDir ? resolve28(vueDir) : undefined;
|
|
178932
178945
|
const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
178933
178946
|
setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
178934
178947
|
return jsResponse(content);
|
|
@@ -178959,7 +178972,7 @@ export default {};
|
|
|
178959
178972
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
178960
178973
|
return;
|
|
178961
178974
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
178962
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
178975
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve28(projectRoot, relPath));
|
|
178963
178976
|
if (virtualCssResponse)
|
|
178964
178977
|
return virtualCssResponse;
|
|
178965
178978
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -178975,11 +178988,11 @@ export default {};
|
|
|
178975
178988
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
178976
178989
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
178977
178990
|
if (match[1])
|
|
178978
|
-
files.push(
|
|
178991
|
+
files.push(resolve28(projectRoot, match[1]));
|
|
178979
178992
|
}
|
|
178980
178993
|
return files;
|
|
178981
178994
|
}, invalidateModule = (filePath) => {
|
|
178982
|
-
const resolved =
|
|
178995
|
+
const resolved = resolve28(filePath);
|
|
178983
178996
|
invalidate(filePath);
|
|
178984
178997
|
if (resolved !== filePath)
|
|
178985
178998
|
invalidate(resolved);
|
|
@@ -179055,11 +179068,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
179055
179068
|
__export(exports_simpleHTMLHMR, {
|
|
179056
179069
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
179057
179070
|
});
|
|
179058
|
-
import { resolve as
|
|
179071
|
+
import { resolve as resolve29 } from "path";
|
|
179059
179072
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
179060
179073
|
let htmlContent;
|
|
179061
179074
|
try {
|
|
179062
|
-
const resolvedPath =
|
|
179075
|
+
const resolvedPath = resolve29(htmlFilePath);
|
|
179063
179076
|
const file4 = Bun.file(resolvedPath);
|
|
179064
179077
|
if (!await file4.exists()) {
|
|
179065
179078
|
return null;
|
|
@@ -179085,11 +179098,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
179085
179098
|
__export(exports_simpleHTMXHMR, {
|
|
179086
179099
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
179087
179100
|
});
|
|
179088
|
-
import { resolve as
|
|
179101
|
+
import { resolve as resolve30 } from "path";
|
|
179089
179102
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
179090
179103
|
let htmlContent;
|
|
179091
179104
|
try {
|
|
179092
|
-
const resolvedPath =
|
|
179105
|
+
const resolvedPath = resolve30(htmxFilePath);
|
|
179093
179106
|
const file4 = Bun.file(resolvedPath);
|
|
179094
179107
|
if (!await file4.exists()) {
|
|
179095
179108
|
return null;
|
|
@@ -179111,8 +179124,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
179111
179124
|
var init_simpleHTMXHMR = () => {};
|
|
179112
179125
|
|
|
179113
179126
|
// src/dev/rebuildTrigger.ts
|
|
179114
|
-
import { existsSync as
|
|
179115
|
-
import { basename as basename13, dirname as dirname14, relative as relative11, resolve as
|
|
179127
|
+
import { existsSync as existsSync21 } from "fs";
|
|
179128
|
+
import { basename as basename13, dirname as dirname14, relative as relative11, resolve as resolve31 } from "path";
|
|
179116
179129
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
179117
179130
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
179118
179131
|
if (pathLineCol) {
|
|
@@ -179180,11 +179193,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179180
179193
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
179181
179194
|
}
|
|
179182
179195
|
return { ...parsed, framework: detectedFw };
|
|
179183
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
179196
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync21(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
|
|
179184
179197
|
state.fileHashes.delete(filePathInSet);
|
|
179185
179198
|
try {
|
|
179186
179199
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
179187
|
-
const deletedPathResolved =
|
|
179200
|
+
const deletedPathResolved = resolve31(filePathInSet);
|
|
179188
179201
|
affectedFiles.forEach((affectedFile) => {
|
|
179189
179202
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
179190
179203
|
validFiles.push(affectedFile);
|
|
@@ -179198,7 +179211,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179198
179211
|
if (!dependents || dependents.size === 0) {
|
|
179199
179212
|
return;
|
|
179200
179213
|
}
|
|
179201
|
-
const dependentFiles = Array.from(dependents).filter((file4) =>
|
|
179214
|
+
const dependentFiles = Array.from(dependents).filter((file4) => existsSync21(file4));
|
|
179202
179215
|
if (dependentFiles.length === 0) {
|
|
179203
179216
|
return;
|
|
179204
179217
|
}
|
|
@@ -179214,7 +179227,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179214
179227
|
try {
|
|
179215
179228
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
179216
179229
|
affectedFiles.forEach((affectedFile) => {
|
|
179217
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
179230
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync21(affectedFile)) {
|
|
179218
179231
|
validFiles.push(affectedFile);
|
|
179219
179232
|
processedFiles.add(affectedFile);
|
|
179220
179233
|
}
|
|
@@ -179228,7 +179241,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179228
179241
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
179229
179242
|
return;
|
|
179230
179243
|
}
|
|
179231
|
-
const normalizedFilePath =
|
|
179244
|
+
const normalizedFilePath = resolve31(filePathInSet);
|
|
179232
179245
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
179233
179246
|
validFiles.push(normalizedFilePath);
|
|
179234
179247
|
processedFiles.add(normalizedFilePath);
|
|
@@ -179239,7 +179252,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179239
179252
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
179240
179253
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
179241
179254
|
filePathSet.forEach((filePathInSet) => {
|
|
179242
|
-
if (!
|
|
179255
|
+
if (!existsSync21(filePathInSet)) {
|
|
179243
179256
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
179244
179257
|
return;
|
|
179245
179258
|
}
|
|
@@ -179306,7 +179319,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179306
179319
|
}
|
|
179307
179320
|
if (framework === "unknown") {
|
|
179308
179321
|
const { invalidate: invalidate2 } = (init_transformCache(), __toCommonJS(exports_transformCache));
|
|
179309
|
-
invalidate2(
|
|
179322
|
+
invalidate2(resolve31(filePath));
|
|
179310
179323
|
const relPath = relative11(process.cwd(), filePath);
|
|
179311
179324
|
logHmrUpdate(relPath);
|
|
179312
179325
|
return;
|
|
@@ -179347,12 +179360,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179347
179360
|
return componentFile;
|
|
179348
179361
|
}
|
|
179349
179362
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
179350
|
-
if (
|
|
179363
|
+
if (existsSync21(tsCounterpart)) {
|
|
179351
179364
|
return tsCounterpart;
|
|
179352
179365
|
}
|
|
179353
179366
|
if (!graph)
|
|
179354
179367
|
return componentFile;
|
|
179355
|
-
const dependents = graph.dependents.get(
|
|
179368
|
+
const dependents = graph.dependents.get(resolve31(componentFile));
|
|
179356
179369
|
if (!dependents)
|
|
179357
179370
|
return componentFile;
|
|
179358
179371
|
for (const dep of dependents) {
|
|
@@ -179361,7 +179374,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179361
179374
|
}
|
|
179362
179375
|
return componentFile;
|
|
179363
179376
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
179364
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
179377
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve31(file4).startsWith(angularPagesPath));
|
|
179365
179378
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
179366
179379
|
return pageEntries;
|
|
179367
179380
|
}
|
|
@@ -179370,7 +179383,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179370
179383
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
179371
179384
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
179372
179385
|
affected.forEach((file4) => {
|
|
179373
|
-
if (file4.endsWith(".ts") &&
|
|
179386
|
+
if (file4.endsWith(".ts") && resolve31(file4).startsWith(angularPagesPath)) {
|
|
179374
179387
|
resolvedPages.add(file4);
|
|
179375
179388
|
}
|
|
179376
179389
|
});
|
|
@@ -179464,7 +179477,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179464
179477
|
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true);
|
|
179465
179478
|
serverPaths.forEach((serverPath) => {
|
|
179466
179479
|
const fileBase = basename13(serverPath, ".js");
|
|
179467
|
-
state.manifest[toPascal(fileBase)] =
|
|
179480
|
+
state.manifest[toPascal(fileBase)] = resolve31(serverPath);
|
|
179468
179481
|
});
|
|
179469
179482
|
if (clientPaths.length > 0) {
|
|
179470
179483
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
|
|
@@ -179473,9 +179486,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179473
179486
|
const angularDir = config.angularDirectory ?? "";
|
|
179474
179487
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
179475
179488
|
for (const file4 of angularFiles) {
|
|
179476
|
-
state.fileHashes.set(
|
|
179489
|
+
state.fileHashes.set(resolve31(file4), computeFileHash(file4));
|
|
179477
179490
|
}
|
|
179478
|
-
const angularPagesPath =
|
|
179491
|
+
const angularPagesPath = resolve31(angularDir, "pages");
|
|
179479
179492
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
179480
179493
|
if (pageEntries.length > 0) {
|
|
179481
179494
|
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
@@ -179490,8 +179503,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179490
179503
|
return manifest;
|
|
179491
179504
|
}, resolveReactEntryForPageFile = (normalized, pagesPathResolved, reactIndexesPath) => {
|
|
179492
179505
|
const pageName = basename13(normalized, ".tsx");
|
|
179493
|
-
const indexPath =
|
|
179494
|
-
if (!
|
|
179506
|
+
const indexPath = resolve31(reactIndexesPath, `${pageName}.tsx`);
|
|
179507
|
+
if (!existsSync21(indexPath)) {
|
|
179495
179508
|
return;
|
|
179496
179509
|
}
|
|
179497
179510
|
return indexPath;
|
|
@@ -179502,13 +179515,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179502
179515
|
return;
|
|
179503
179516
|
}
|
|
179504
179517
|
const pageName = basename13(dep, ".tsx");
|
|
179505
|
-
const indexPath =
|
|
179506
|
-
if (
|
|
179518
|
+
const indexPath = resolve31(reactIndexesPath, `${pageName}.tsx`);
|
|
179519
|
+
if (existsSync21(indexPath) && !reactEntries.includes(indexPath)) {
|
|
179507
179520
|
reactEntries.push(indexPath);
|
|
179508
179521
|
}
|
|
179509
179522
|
});
|
|
179510
179523
|
}, resolveReactEntryForFile = (state, file4, pagesPathResolved, reactIndexesPath, reactEntries) => {
|
|
179511
|
-
const normalized =
|
|
179524
|
+
const normalized = resolve31(file4);
|
|
179512
179525
|
if (!normalized.startsWith(pagesPathResolved)) {
|
|
179513
179526
|
resolveReactEntriesFromDeps(state, normalized, pagesPathResolved, reactIndexesPath, reactEntries);
|
|
179514
179527
|
return;
|
|
@@ -179519,7 +179532,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179519
179532
|
}
|
|
179520
179533
|
}, collectReactEntries = (state, filesToRebuild, reactPagesPath, reactIndexesPath) => {
|
|
179521
179534
|
const reactEntries = [];
|
|
179522
|
-
const pagesPathResolved =
|
|
179535
|
+
const pagesPathResolved = resolve31(reactPagesPath);
|
|
179523
179536
|
filesToRebuild.forEach((file4) => {
|
|
179524
179537
|
resolveReactEntryForFile(state, file4, pagesPathResolved, reactIndexesPath, reactEntries);
|
|
179525
179538
|
});
|
|
@@ -179531,7 +179544,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179531
179544
|
const { rewriteReactImports: rewriteReactImports2 } = await Promise.resolve().then(() => (init_rewriteReactImports(), exports_rewriteReactImports));
|
|
179532
179545
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
179533
179546
|
const depVendorPaths = globalThis.__depVendorPaths ?? {};
|
|
179534
|
-
const refreshEntry =
|
|
179547
|
+
const refreshEntry = resolve31(reactIndexesPath, "_refresh.tsx");
|
|
179535
179548
|
if (!reactEntries.includes(refreshEntry)) {
|
|
179536
179549
|
reactEntries.push(refreshEntry);
|
|
179537
179550
|
}
|
|
@@ -179543,7 +179556,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179543
179556
|
setDevVendorPaths2(vendorPaths);
|
|
179544
179557
|
}
|
|
179545
179558
|
const { rmSync: rmSync3 } = await import("fs");
|
|
179546
|
-
rmSync3(
|
|
179559
|
+
rmSync3(resolve31(buildDir, "react", "generated", "indexes"), {
|
|
179547
179560
|
force: true,
|
|
179548
179561
|
recursive: true
|
|
179549
179562
|
});
|
|
@@ -179593,11 +179606,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179593
179606
|
if (isComponentFile2)
|
|
179594
179607
|
return primaryFile;
|
|
179595
179608
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
179596
|
-
const nearest = findNearestComponent2(
|
|
179609
|
+
const nearest = findNearestComponent2(resolve31(primaryFile));
|
|
179597
179610
|
return nearest ?? primaryFile;
|
|
179598
179611
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
179599
179612
|
for (const file4 of reactFiles) {
|
|
179600
|
-
state.fileHashes.set(
|
|
179613
|
+
state.fileHashes.set(resolve31(file4), computeFileHash(file4));
|
|
179601
179614
|
}
|
|
179602
179615
|
invalidateReactSsrCache();
|
|
179603
179616
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
@@ -179639,8 +179652,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179639
179652
|
return state.manifest;
|
|
179640
179653
|
}, handleReactFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
179641
179654
|
const reactDir = config.reactDirectory ?? "";
|
|
179642
|
-
const reactPagesPath =
|
|
179643
|
-
const reactIndexesPath =
|
|
179655
|
+
const reactPagesPath = resolve31(reactDir, "pages");
|
|
179656
|
+
const reactIndexesPath = resolve31(reactDir, "generated", "indexes");
|
|
179644
179657
|
const { buildDir } = state.resolvedPaths;
|
|
179645
179658
|
const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "react");
|
|
179646
179659
|
if (reactFiles.length > 0) {
|
|
@@ -179703,7 +179716,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179703
179716
|
});
|
|
179704
179717
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
179705
179718
|
for (const file4 of svelteFiles) {
|
|
179706
|
-
state.fileHashes.set(
|
|
179719
|
+
state.fileHashes.set(resolve31(file4), computeFileHash(file4));
|
|
179707
179720
|
}
|
|
179708
179721
|
invalidateSvelteSsrCache();
|
|
179709
179722
|
const serverDuration = Date.now() - startTime;
|
|
@@ -179729,8 +179742,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179729
179742
|
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true);
|
|
179730
179743
|
const serverEntries = [...svelteServerPaths];
|
|
179731
179744
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
179732
|
-
const serverRoot =
|
|
179733
|
-
const serverOutDir =
|
|
179745
|
+
const serverRoot = resolve31(svelteDir, "generated", "server");
|
|
179746
|
+
const serverOutDir = resolve31(buildDir, basename13(svelteDir));
|
|
179734
179747
|
const [serverResult, clientResult] = await Promise.all([
|
|
179735
179748
|
serverEntries.length > 0 ? bunBuild7({
|
|
179736
179749
|
entrypoints: serverEntries,
|
|
@@ -179821,7 +179834,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179821
179834
|
});
|
|
179822
179835
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
179823
179836
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
179824
|
-
state.fileHashes.set(
|
|
179837
|
+
state.fileHashes.set(resolve31(file4), computeFileHash(file4));
|
|
179825
179838
|
}
|
|
179826
179839
|
invalidateVueSsrCache();
|
|
179827
179840
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -179916,8 +179929,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179916
179929
|
if (!buildReference?.source) {
|
|
179917
179930
|
return;
|
|
179918
179931
|
}
|
|
179919
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
179920
|
-
islandFiles.add(
|
|
179932
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve31(dirname14(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
179933
|
+
islandFiles.add(resolve31(sourcePath));
|
|
179921
179934
|
}, resolveIslandSourceFiles = async (config) => {
|
|
179922
179935
|
const registryPath = config.islands?.registry;
|
|
179923
179936
|
if (!registryPath) {
|
|
@@ -179925,7 +179938,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179925
179938
|
}
|
|
179926
179939
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
179927
179940
|
const islandFiles = new Set([
|
|
179928
|
-
|
|
179941
|
+
resolve31(buildInfo.resolvedRegistryPath)
|
|
179929
179942
|
]);
|
|
179930
179943
|
for (const definition of buildInfo.definitions) {
|
|
179931
179944
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -179936,7 +179949,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179936
179949
|
if (islandFiles.size === 0) {
|
|
179937
179950
|
return false;
|
|
179938
179951
|
}
|
|
179939
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
179952
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve31(file4)));
|
|
179940
179953
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
179941
179954
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
179942
179955
|
if (!shouldReload) {
|
|
@@ -179971,10 +179984,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
179971
179984
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
179972
179985
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
179973
179986
|
if (isSingle) {
|
|
179974
|
-
return
|
|
179987
|
+
return resolve31(state.resolvedPaths.buildDir, "pages");
|
|
179975
179988
|
}
|
|
179976
179989
|
const dirName = framework === "html" ? basename13(config.htmlDirectory ?? "html") : basename13(config.htmxDirectory ?? "htmx");
|
|
179977
|
-
return
|
|
179990
|
+
return resolve31(state.resolvedPaths.buildDir, dirName, "pages");
|
|
179978
179991
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
179979
179992
|
try {
|
|
179980
179993
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -180013,7 +180026,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
180013
180026
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
180014
180027
|
for (const pageFile of pageFilesToUpdate) {
|
|
180015
180028
|
const htmlPageName = basename13(pageFile);
|
|
180016
|
-
const builtHtmlPagePath =
|
|
180029
|
+
const builtHtmlPagePath = resolve31(outputHtmlPages, htmlPageName);
|
|
180017
180030
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
180018
180031
|
}
|
|
180019
180032
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -180078,7 +180091,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
180078
180091
|
const cssKey = `${pascalName}CSS`;
|
|
180079
180092
|
const cssUrl = manifest[cssKey] || null;
|
|
180080
180093
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
180081
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
180094
|
+
const hmrMeta = vueHmrMetadata2.get(resolve31(vuePagePath));
|
|
180082
180095
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
180083
180096
|
if (changeType === "style-only") {
|
|
180084
180097
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -180315,7 +180328,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
180315
180328
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
180316
180329
|
for (const htmxPageFile of pageFilesToUpdate) {
|
|
180317
180330
|
const htmxPageName = basename13(htmxPageFile);
|
|
180318
|
-
const builtHtmxPagePath =
|
|
180331
|
+
const builtHtmxPagePath = resolve31(outputHtmxPages, htmxPageName);
|
|
180319
180332
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
180320
180333
|
}
|
|
180321
180334
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -180424,7 +180437,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
180424
180437
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
180425
180438
|
writeFs(destPath, html);
|
|
180426
180439
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
180427
|
-
const destPath =
|
|
180440
|
+
const destPath = resolve31(outputDir, basename13(sourceFile));
|
|
180428
180441
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
180429
180442
|
const source = await Bun.file(sourceFile).text();
|
|
180430
180443
|
await Bun.write(destPath, source);
|
|
@@ -180799,7 +180812,7 @@ __export(exports_devBuild, {
|
|
|
180799
180812
|
});
|
|
180800
180813
|
import { readdir as readdir5 } from "fs/promises";
|
|
180801
180814
|
import { statSync as statSync3 } from "fs";
|
|
180802
|
-
import { dirname as dirname15, resolve as
|
|
180815
|
+
import { dirname as dirname15, resolve as resolve32 } from "path";
|
|
180803
180816
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
180804
180817
|
const configuredDirs = [
|
|
180805
180818
|
config.reactDirectory,
|
|
@@ -180822,7 +180835,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
180822
180835
|
return Object.keys(config).length > 0 ? config : null;
|
|
180823
180836
|
}, reloadConfig = async () => {
|
|
180824
180837
|
try {
|
|
180825
|
-
const configPath2 =
|
|
180838
|
+
const configPath2 = resolve32(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
180826
180839
|
const source = await Bun.file(configPath2).text();
|
|
180827
180840
|
return parseDirectoryConfig(source);
|
|
180828
180841
|
} catch {
|
|
@@ -180902,7 +180915,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
180902
180915
|
state.fileChangeQueue.clear();
|
|
180903
180916
|
}
|
|
180904
180917
|
}, handleCachedReload = async () => {
|
|
180905
|
-
const serverMtime = statSync3(
|
|
180918
|
+
const serverMtime = statSync3(resolve32(Bun.main)).mtimeMs;
|
|
180906
180919
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
180907
180920
|
globalThis.__hmrServerMtime = serverMtime;
|
|
180908
180921
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -180936,8 +180949,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
180936
180949
|
return true;
|
|
180937
180950
|
}, resolveAbsoluteVersion2 = async () => {
|
|
180938
180951
|
const candidates = [
|
|
180939
|
-
|
|
180940
|
-
|
|
180952
|
+
resolve32(import.meta.dir, "..", "..", "package.json"),
|
|
180953
|
+
resolve32(import.meta.dir, "..", "package.json")
|
|
180941
180954
|
];
|
|
180942
180955
|
for (const candidate of candidates) {
|
|
180943
180956
|
const found = await tryReadPackageVersion(candidate);
|
|
@@ -180950,7 +180963,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
180950
180963
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
180951
180964
|
await Promise.all(entries.map(async (entry) => {
|
|
180952
180965
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
180953
|
-
const bytes = await Bun.file(
|
|
180966
|
+
const bytes = await Bun.file(resolve32(vendorDir, entry)).bytes();
|
|
180954
180967
|
assetStore.set(webPath, bytes);
|
|
180955
180968
|
}));
|
|
180956
180969
|
}, devBuild = async (config) => {
|
|
@@ -180995,7 +181008,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
180995
181008
|
await populateAssetStore(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
180996
181009
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
180997
181010
|
const buildReactVendorTask = config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
180998
|
-
const vendorDir =
|
|
181011
|
+
const vendorDir = resolve32(state.resolvedPaths.buildDir, "react", "vendor");
|
|
180999
181012
|
await loadVendorFiles(state.assetStore, vendorDir, "react");
|
|
181000
181013
|
if (!globalThis.__reactModuleRef) {
|
|
181001
181014
|
globalThis.__reactModuleRef = await import("react");
|
|
@@ -181003,23 +181016,23 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
181003
181016
|
return true;
|
|
181004
181017
|
}) : undefined;
|
|
181005
181018
|
const buildAngularVendorTask = config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
181006
|
-
const vendorDir =
|
|
181019
|
+
const vendorDir = resolve32(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
181007
181020
|
await loadVendorFiles(state.assetStore, vendorDir, "angular");
|
|
181008
181021
|
return true;
|
|
181009
181022
|
}) : undefined;
|
|
181010
181023
|
const buildSvelteVendorTask = config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
181011
|
-
const vendorDir =
|
|
181024
|
+
const vendorDir = resolve32(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
181012
181025
|
await loadVendorFiles(state.assetStore, vendorDir, "svelte");
|
|
181013
181026
|
return true;
|
|
181014
181027
|
}) : undefined;
|
|
181015
181028
|
const buildVueVendorTask = config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
181016
|
-
const vendorDir =
|
|
181029
|
+
const vendorDir = resolve32(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
181017
181030
|
await loadVendorFiles(state.assetStore, vendorDir, "vue");
|
|
181018
181031
|
return true;
|
|
181019
181032
|
}) : undefined;
|
|
181020
181033
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
181021
181034
|
const buildDepVendorTask = buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs).then(async (depPaths) => {
|
|
181022
|
-
const vendorDir =
|
|
181035
|
+
const vendorDir = resolve32(state.resolvedPaths.buildDir, "vendor");
|
|
181023
181036
|
await loadVendorFiles(state.assetStore, vendorDir, "vendor");
|
|
181024
181037
|
globalThis.__depVendorPaths = depPaths;
|
|
181025
181038
|
return true;
|
|
@@ -181050,7 +181063,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
181050
181063
|
manifest
|
|
181051
181064
|
};
|
|
181052
181065
|
globalThis.__hmrDevResult = result;
|
|
181053
|
-
globalThis.__hmrServerMtime = statSync3(
|
|
181066
|
+
globalThis.__hmrServerMtime = statSync3(resolve32(Bun.main)).mtimeMs;
|
|
181054
181067
|
return result;
|
|
181055
181068
|
};
|
|
181056
181069
|
var init_devBuild = __esm(() => {
|
|
@@ -181198,14 +181211,14 @@ __export(exports_devtoolsJson, {
|
|
|
181198
181211
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
181199
181212
|
devtoolsJson: () => devtoolsJson
|
|
181200
181213
|
});
|
|
181201
|
-
import { existsSync as
|
|
181202
|
-
import { dirname as dirname16, join as join22, resolve as
|
|
181214
|
+
import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync14, writeFileSync as writeFileSync8 } from "fs";
|
|
181215
|
+
import { dirname as dirname16, join as join22, resolve as resolve33 } from "path";
|
|
181203
181216
|
import { Elysia as Elysia3 } from "elysia";
|
|
181204
181217
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
181205
181218
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
181206
181219
|
return uuid;
|
|
181207
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
181208
|
-
if (!
|
|
181220
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve33(uuidCachePath ?? join22(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
181221
|
+
if (!existsSync22(cachePath))
|
|
181209
181222
|
return null;
|
|
181210
181223
|
try {
|
|
181211
181224
|
const value = readFileSync14(cachePath, "utf-8").trim();
|
|
@@ -181230,7 +181243,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
181230
181243
|
writeFileSync8(cachePath, uuid, "utf-8");
|
|
181231
181244
|
return setGlobalUuid(uuid);
|
|
181232
181245
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
181233
|
-
const rootPath =
|
|
181246
|
+
const rootPath = resolve33(options.projectRoot ?? process.cwd());
|
|
181234
181247
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
181235
181248
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
181236
181249
|
return new Elysia3({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -181258,13 +181271,13 @@ var exports_imageOptimizer = {};
|
|
|
181258
181271
|
__export(exports_imageOptimizer, {
|
|
181259
181272
|
imageOptimizer: () => imageOptimizer
|
|
181260
181273
|
});
|
|
181261
|
-
import { existsSync as
|
|
181262
|
-
import { resolve as
|
|
181274
|
+
import { existsSync as existsSync23 } from "fs";
|
|
181275
|
+
import { resolve as resolve34 } from "path";
|
|
181263
181276
|
import { Elysia as Elysia4 } from "elysia";
|
|
181264
181277
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
181265
181278
|
try {
|
|
181266
181279
|
const resolved = validateSafePath(path, baseDir);
|
|
181267
|
-
if (
|
|
181280
|
+
if (existsSync23(resolved))
|
|
181268
181281
|
return resolved;
|
|
181269
181282
|
return null;
|
|
181270
181283
|
} catch {
|
|
@@ -181272,7 +181285,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
181272
181285
|
}
|
|
181273
181286
|
}, resolveLocalImage = (url, buildDir) => {
|
|
181274
181287
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
181275
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
181288
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve34(process.cwd()));
|
|
181276
181289
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
181277
181290
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
181278
181291
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -181911,8 +181924,8 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
181911
181924
|
});
|
|
181912
181925
|
};
|
|
181913
181926
|
// src/core/prepare.ts
|
|
181914
|
-
import { existsSync as
|
|
181915
|
-
import { basename as basename14, join as join24, relative as relative12, resolve as
|
|
181927
|
+
import { existsSync as existsSync24, readdirSync as readdirSync2, readFileSync as readFileSync16 } from "fs";
|
|
181928
|
+
import { basename as basename14, join as join24, relative as relative12, resolve as resolve35 } from "path";
|
|
181916
181929
|
import { Elysia as Elysia5 } from "elysia";
|
|
181917
181930
|
|
|
181918
181931
|
// src/utils/loadConfig.ts
|
|
@@ -181986,7 +181999,7 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
181986
181999
|
for (const { dir, pattern } of prewarmDirs) {
|
|
181987
182000
|
const glob = new Glob9(pattern);
|
|
181988
182001
|
const matches = [
|
|
181989
|
-
...glob.scanSync({ absolute: true, cwd:
|
|
182002
|
+
...glob.scanSync({ absolute: true, cwd: resolve35(dir) })
|
|
181990
182003
|
];
|
|
181991
182004
|
files.push(...matches);
|
|
181992
182005
|
}
|
|
@@ -182022,8 +182035,8 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
182022
182035
|
const fileName = resolveDevIndexFileName(manifest[key], baseName);
|
|
182023
182036
|
if (!fileName)
|
|
182024
182037
|
continue;
|
|
182025
|
-
const srcPath =
|
|
182026
|
-
if (!
|
|
182038
|
+
const srcPath = resolve35(devIndexDir, fileName);
|
|
182039
|
+
if (!existsSync24(srcPath))
|
|
182027
182040
|
continue;
|
|
182028
182041
|
const rel = relative12(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
182029
182042
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
@@ -182074,7 +182087,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
182074
182087
|
}
|
|
182075
182088
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
182076
182089
|
const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
|
|
182077
|
-
const devIndexDir =
|
|
182090
|
+
const devIndexDir = resolve35(buildDir, "_src_indexes");
|
|
182078
182091
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
182079
182092
|
if (result.conventions)
|
|
182080
182093
|
setConventions(result.conventions);
|
|
@@ -182102,7 +182115,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
182102
182115
|
};
|
|
182103
182116
|
var loadPrerenderMap = (prerenderDir) => {
|
|
182104
182117
|
const map = new Map;
|
|
182105
|
-
if (!
|
|
182118
|
+
if (!existsSync24(prerenderDir))
|
|
182106
182119
|
return map;
|
|
182107
182120
|
let entries;
|
|
182108
182121
|
try {
|
|
@@ -182137,7 +182150,7 @@ var prepare = async (configOrPath) => {
|
|
|
182137
182150
|
const config = await loadConfig(configOrPath);
|
|
182138
182151
|
const nodeEnv = process.env["NODE_ENV"];
|
|
182139
182152
|
const isDev3 = nodeEnv === "development";
|
|
182140
|
-
const buildDir =
|
|
182153
|
+
const buildDir = resolve35(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
182141
182154
|
if (isDev3)
|
|
182142
182155
|
return prepareDev(config, buildDir);
|
|
182143
182156
|
const manifest = JSON.parse(readFileSync16(`${buildDir}/manifest.json`, "utf-8"));
|
|
@@ -182147,7 +182160,7 @@ var prepare = async (configOrPath) => {
|
|
|
182147
182160
|
}
|
|
182148
182161
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
182149
182162
|
const conventionsPath = join24(buildDir, "conventions.json");
|
|
182150
|
-
if (
|
|
182163
|
+
if (existsSync24(conventionsPath)) {
|
|
182151
182164
|
const conventions2 = JSON.parse(readFileSync16(conventionsPath, "utf-8"));
|
|
182152
182165
|
setConventions(conventions2);
|
|
182153
182166
|
}
|
|
@@ -182201,7 +182214,7 @@ import { argv } from "process";
|
|
|
182201
182214
|
var {env: env4 } = globalThis.Bun;
|
|
182202
182215
|
|
|
182203
182216
|
// src/dev/devCert.ts
|
|
182204
|
-
import { existsSync as
|
|
182217
|
+
import { existsSync as existsSync25, mkdirSync as mkdirSync14, readFileSync as readFileSync17, rmSync as rmSync3 } from "fs";
|
|
182205
182218
|
import { join as join25 } from "path";
|
|
182206
182219
|
var CERT_DIR = join25(process.cwd(), ".absolutejs");
|
|
182207
182220
|
var CERT_PATH = join25(CERT_DIR, "cert.pem");
|
|
@@ -182209,7 +182222,7 @@ var KEY_PATH = join25(CERT_DIR, "key.pem");
|
|
|
182209
182222
|
var CERT_VALIDITY_DAYS = 365;
|
|
182210
182223
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
182211
182224
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
182212
|
-
var certFilesExist = () =>
|
|
182225
|
+
var certFilesExist = () => existsSync25(CERT_PATH) && existsSync25(KEY_PATH);
|
|
182213
182226
|
var isCertExpired = () => {
|
|
182214
182227
|
try {
|
|
182215
182228
|
const certPem = readFileSync17(CERT_PATH, "utf-8");
|
|
@@ -182530,8 +182543,8 @@ var jsonLd2 = (schema) => {
|
|
|
182530
182543
|
};
|
|
182531
182544
|
// src/utils/defineEnv.ts
|
|
182532
182545
|
var {env: bunEnv } = globalThis.Bun;
|
|
182533
|
-
import { existsSync as
|
|
182534
|
-
import { resolve as
|
|
182546
|
+
import { existsSync as existsSync26, readFileSync as readFileSync18 } from "fs";
|
|
182547
|
+
import { resolve as resolve36 } from "path";
|
|
182535
182548
|
|
|
182536
182549
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
182537
182550
|
var exports_value = {};
|
|
@@ -188566,8 +188579,8 @@ ${lines.join(`
|
|
|
188566
188579
|
};
|
|
188567
188580
|
var checkEnvFileSecurity = (properties) => {
|
|
188568
188581
|
const cwd2 = process.cwd();
|
|
188569
|
-
const envPath =
|
|
188570
|
-
if (!
|
|
188582
|
+
const envPath = resolve36(cwd2, ".env");
|
|
188583
|
+
if (!existsSync26(envPath))
|
|
188571
188584
|
return;
|
|
188572
188585
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
188573
188586
|
if (sensitiveKeys.length === 0)
|
|
@@ -188576,8 +188589,8 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
188576
188589
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
188577
188590
|
if (presentKeys.length === 0)
|
|
188578
188591
|
return;
|
|
188579
|
-
const gitignorePath =
|
|
188580
|
-
if (
|
|
188592
|
+
const gitignorePath = resolve36(cwd2, ".gitignore");
|
|
188593
|
+
if (existsSync26(gitignorePath)) {
|
|
188581
188594
|
const gitignore = readFileSync18(gitignorePath, "utf-8");
|
|
188582
188595
|
if (gitignore.split(`
|
|
188583
188596
|
`).some((line) => line.trim() === ".env"))
|
|
@@ -188785,5 +188798,5 @@ export {
|
|
|
188785
188798
|
ANGULAR_INIT_TIMEOUT_MS
|
|
188786
188799
|
};
|
|
188787
188800
|
|
|
188788
|
-
//# debugId=
|
|
188801
|
+
//# debugId=131F7F840CD5704064756E2164756E21
|
|
188789
188802
|
//# sourceMappingURL=index.js.map
|