@absolutejs/absolute 0.19.0-beta.188 → 0.19.0-beta.189
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/src/angular/components/index.js +5 -6
- package/dist/src/angular/components/index.js.map +3 -3
- package/dist/src/build.js +147 -148
- package/dist/src/build.js.map +3 -3
- package/dist/src/index.js +154 -155
- package/dist/src/index.js.map +3 -3
- package/package.json +1 -1
package/dist/src/build.js
CHANGED
|
@@ -748,7 +748,7 @@ var init_scanCssEntryPoints = () => {};
|
|
|
748
748
|
|
|
749
749
|
// src/utils/imageProcessing.ts
|
|
750
750
|
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
|
|
751
|
-
import { join as join2 } from "path";
|
|
751
|
+
import { join as join2, resolve as resolve2 } from "path";
|
|
752
752
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
753
753
|
for (const size of sizes) {
|
|
754
754
|
if (size >= target)
|
|
@@ -871,15 +871,14 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
871
871
|
return sharpModule;
|
|
872
872
|
sharpLoaded = true;
|
|
873
873
|
try {
|
|
874
|
-
const
|
|
875
|
-
const mod = await import(
|
|
874
|
+
const sharpPath = resolve2(process.cwd(), "node_modules/sharp");
|
|
875
|
+
const mod = await import(sharpPath);
|
|
876
876
|
sharpModule = mod.default ?? mod;
|
|
877
877
|
return sharpModule;
|
|
878
|
-
} catch
|
|
878
|
+
} catch {
|
|
879
879
|
if (sharpWarned)
|
|
880
880
|
return null;
|
|
881
881
|
sharpWarned = true;
|
|
882
|
-
console.warn("[image] sharp load error:", err);
|
|
883
882
|
console.warn("[image] sharp not installed \u2014 serving unoptimized images. Install with: bun add sharp");
|
|
884
883
|
return null;
|
|
885
884
|
}
|
|
@@ -1116,18 +1115,18 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
1116
1115
|
|
|
1117
1116
|
// src/dev/buildHMRClient.ts
|
|
1118
1117
|
import { existsSync as existsSync7 } from "fs";
|
|
1119
|
-
import { resolve as
|
|
1118
|
+
import { resolve as resolve3 } from "path";
|
|
1120
1119
|
var {build: bunBuild } = globalThis.Bun;
|
|
1121
1120
|
var resolveHmrClientPath = () => {
|
|
1122
1121
|
const projectRoot = process.cwd();
|
|
1123
|
-
const fromSource =
|
|
1122
|
+
const fromSource = resolve3(import.meta.dir, "client/hmrClient.ts");
|
|
1124
1123
|
if (existsSync7(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1125
1124
|
return fromSource;
|
|
1126
1125
|
}
|
|
1127
|
-
const fromNodeModules =
|
|
1126
|
+
const fromNodeModules = resolve3(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
1128
1127
|
if (existsSync7(fromNodeModules))
|
|
1129
1128
|
return fromNodeModules;
|
|
1130
|
-
return
|
|
1129
|
+
return resolve3(import.meta.dir, "dev/client/hmrClient.ts");
|
|
1131
1130
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
1132
1131
|
const entryPoint = hmrClientPath2;
|
|
1133
1132
|
const result = await bunBuild({
|
|
@@ -1157,7 +1156,7 @@ var init_buildHMRClient = __esm(() => {
|
|
|
1157
1156
|
// src/build/nativeRewrite.ts
|
|
1158
1157
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
1159
1158
|
import { platform as platform2, arch as arch2 } from "os";
|
|
1160
|
-
import { resolve as
|
|
1159
|
+
import { resolve as resolve4 } from "path";
|
|
1161
1160
|
var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
1162
1161
|
if (nativeLib !== null)
|
|
1163
1162
|
return nativeLib;
|
|
@@ -1175,7 +1174,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
|
1175
1174
|
if (!libPath)
|
|
1176
1175
|
return null;
|
|
1177
1176
|
try {
|
|
1178
|
-
const fullPath =
|
|
1177
|
+
const fullPath = resolve4(import.meta.dir, "../../native/packages", libPath);
|
|
1179
1178
|
const lib = dlopen(fullPath, ffiDefinition);
|
|
1180
1179
|
nativeLib = lib.symbols;
|
|
1181
1180
|
return nativeLib;
|
|
@@ -1318,11 +1317,11 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
1318
1317
|
|
|
1319
1318
|
// src/build/angularLinkerPlugin.ts
|
|
1320
1319
|
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
1321
|
-
import { dirname as dirname2, join as join5, relative as relative2, resolve as
|
|
1320
|
+
import { dirname as dirname2, join as join5, relative as relative2, resolve as resolve5 } from "path";
|
|
1322
1321
|
import { createHash } from "crypto";
|
|
1323
1322
|
var CACHE_DIR, angularLinkerPlugin;
|
|
1324
1323
|
var init_angularLinkerPlugin = __esm(() => {
|
|
1325
|
-
CACHE_DIR =
|
|
1324
|
+
CACHE_DIR = resolve5(".absolutejs", "cache", "angular-linker");
|
|
1326
1325
|
angularLinkerPlugin = {
|
|
1327
1326
|
name: "angular-linker",
|
|
1328
1327
|
setup(bld) {
|
|
@@ -1362,7 +1361,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1362
1361
|
exists: existsSync8,
|
|
1363
1362
|
readFile: readFileSync4,
|
|
1364
1363
|
relative: relative2,
|
|
1365
|
-
resolve:
|
|
1364
|
+
resolve: resolve5
|
|
1366
1365
|
},
|
|
1367
1366
|
linkerJitMode: false,
|
|
1368
1367
|
logger: {
|
|
@@ -1396,14 +1395,14 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1396
1395
|
|
|
1397
1396
|
// src/utils/cleanStaleOutputs.ts
|
|
1398
1397
|
import { rm as rm2 } from "fs/promises";
|
|
1399
|
-
import { resolve as
|
|
1398
|
+
import { resolve as resolve6 } from "path";
|
|
1400
1399
|
var {Glob: Glob4 } = globalThis.Bun;
|
|
1401
1400
|
var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
1402
|
-
const currentPaths = new Set(currentOutputPaths.map((path) =>
|
|
1401
|
+
const currentPaths = new Set(currentOutputPaths.map((path) => resolve6(path)));
|
|
1403
1402
|
const glob = new Glob4("**/*");
|
|
1404
1403
|
const removals = [];
|
|
1405
1404
|
for (const relative3 of glob.scanSync({ cwd: buildPath })) {
|
|
1406
|
-
const absolute =
|
|
1405
|
+
const absolute = resolve6(buildPath, relative3);
|
|
1407
1406
|
if (currentPaths.has(absolute))
|
|
1408
1407
|
continue;
|
|
1409
1408
|
if (!HASHED_FILE_PATTERN.test(relative3))
|
|
@@ -1464,10 +1463,10 @@ var commonAncestor = (paths, fallback) => {
|
|
|
1464
1463
|
var init_commonAncestor = () => {};
|
|
1465
1464
|
|
|
1466
1465
|
// src/utils/validateSafePath.ts
|
|
1467
|
-
import { resolve as
|
|
1466
|
+
import { resolve as resolve7, relative as relative3 } from "path";
|
|
1468
1467
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
1469
|
-
const absoluteBase =
|
|
1470
|
-
const absoluteTarget =
|
|
1468
|
+
const absoluteBase = resolve7(baseDirectory);
|
|
1469
|
+
const absoluteTarget = resolve7(baseDirectory, targetPath);
|
|
1471
1470
|
const relativePath = normalizePath(relative3(absoluteBase, absoluteTarget));
|
|
1472
1471
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
1473
1472
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
@@ -1489,7 +1488,7 @@ import {
|
|
|
1489
1488
|
join as join7,
|
|
1490
1489
|
basename as basename2,
|
|
1491
1490
|
extname as extname2,
|
|
1492
|
-
resolve as
|
|
1491
|
+
resolve as resolve8,
|
|
1493
1492
|
relative as relative4,
|
|
1494
1493
|
sep as sep2
|
|
1495
1494
|
} from "path";
|
|
@@ -1497,14 +1496,14 @@ import { env } from "process";
|
|
|
1497
1496
|
var {write, file, Transpiler } = globalThis.Bun;
|
|
1498
1497
|
var resolveDevClientDir2 = () => {
|
|
1499
1498
|
const projectRoot = process.cwd();
|
|
1500
|
-
const fromSource =
|
|
1499
|
+
const fromSource = resolve8(import.meta.dir, "../dev/client");
|
|
1501
1500
|
if (existsSync9(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1502
1501
|
return fromSource;
|
|
1503
1502
|
}
|
|
1504
|
-
const fromNodeModules =
|
|
1503
|
+
const fromNodeModules = resolve8(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
1505
1504
|
if (existsSync9(fromNodeModules))
|
|
1506
1505
|
return fromNodeModules;
|
|
1507
|
-
return
|
|
1506
|
+
return resolve8(import.meta.dir, "./dev/client");
|
|
1508
1507
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
1509
1508
|
persistentCache.clear();
|
|
1510
1509
|
sourceHashCache.clear();
|
|
@@ -1516,7 +1515,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1516
1515
|
return false;
|
|
1517
1516
|
}
|
|
1518
1517
|
}, resolveSvelte = async (spec, from) => {
|
|
1519
|
-
const basePath =
|
|
1518
|
+
const basePath = resolve8(dirname3(from), spec);
|
|
1520
1519
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
1521
1520
|
if (!explicit) {
|
|
1522
1521
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -1726,18 +1725,18 @@ __export(exports_compileVue, {
|
|
|
1726
1725
|
});
|
|
1727
1726
|
import { existsSync as existsSync10 } from "fs";
|
|
1728
1727
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
1729
|
-
import { basename as basename3, dirname as dirname4, join as join8, relative as relative5, resolve as
|
|
1728
|
+
import { basename as basename3, dirname as dirname4, join as join8, relative as relative5, resolve as resolve9 } from "path";
|
|
1730
1729
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
1731
1730
|
var resolveDevClientDir3 = () => {
|
|
1732
1731
|
const projectRoot = process.cwd();
|
|
1733
|
-
const fromSource =
|
|
1732
|
+
const fromSource = resolve9(import.meta.dir, "../dev/client");
|
|
1734
1733
|
if (existsSync10(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1735
1734
|
return fromSource;
|
|
1736
1735
|
}
|
|
1737
|
-
const fromNodeModules =
|
|
1736
|
+
const fromNodeModules = resolve9(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
1738
1737
|
if (existsSync10(fromNodeModules))
|
|
1739
1738
|
return fromNodeModules;
|
|
1740
|
-
return
|
|
1739
|
+
return resolve9(import.meta.dir, "./dev/client");
|
|
1741
1740
|
}, devClientDir3, hmrClientPath4, transpiler2, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
1742
1741
|
scriptCache.clear();
|
|
1743
1742
|
scriptSetupCache.clear();
|
|
@@ -1826,7 +1825,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1826
1825
|
const importPaths = extractImports(scriptSource);
|
|
1827
1826
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
1828
1827
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue"));
|
|
1829
|
-
const childBuildResults = await Promise.all(childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
1828
|
+
const childBuildResults = await Promise.all(childComponentPaths.map((relativeChildPath) => compileVueFile(resolve9(dirname4(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler)));
|
|
1830
1829
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
1831
1830
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
1832
1831
|
id: componentId,
|
|
@@ -1911,7 +1910,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1911
1910
|
hmrId,
|
|
1912
1911
|
serverPath: serverOutputPath,
|
|
1913
1912
|
tsHelperPaths: [
|
|
1914
|
-
...helperModulePaths.map((helper) =>
|
|
1913
|
+
...helperModulePaths.map((helper) => resolve9(dirname4(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
1915
1914
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
1916
1915
|
]
|
|
1917
1916
|
};
|
|
@@ -1934,7 +1933,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1934
1933
|
const buildCache = new Map;
|
|
1935
1934
|
const allTsHelperPaths = new Set;
|
|
1936
1935
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
1937
|
-
const result = await compileVueFile(
|
|
1936
|
+
const result = await compileVueFile(resolve9(entryPath), {
|
|
1938
1937
|
client: clientOutputDir,
|
|
1939
1938
|
css: cssOutputDir,
|
|
1940
1939
|
server: serverOutputDir
|
|
@@ -100360,14 +100359,14 @@ ${lanes.join(`
|
|
|
100360
100359
|
}
|
|
100361
100360
|
}
|
|
100362
100361
|
function createImportCallExpressionAMD(arg, containsLexicalThis) {
|
|
100363
|
-
const
|
|
100362
|
+
const resolve10 = factory2.createUniqueName("resolve");
|
|
100364
100363
|
const reject = factory2.createUniqueName("reject");
|
|
100365
100364
|
const parameters = [
|
|
100366
|
-
factory2.createParameterDeclaration(undefined, undefined,
|
|
100365
|
+
factory2.createParameterDeclaration(undefined, undefined, resolve10),
|
|
100367
100366
|
factory2.createParameterDeclaration(undefined, undefined, reject)
|
|
100368
100367
|
];
|
|
100369
100368
|
const body = factory2.createBlock([
|
|
100370
|
-
factory2.createExpressionStatement(factory2.createCallExpression(factory2.createIdentifier("require"), undefined, [factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]),
|
|
100369
|
+
factory2.createExpressionStatement(factory2.createCallExpression(factory2.createIdentifier("require"), undefined, [factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]), resolve10, reject]))
|
|
100371
100370
|
]);
|
|
100372
100371
|
let func;
|
|
100373
100372
|
if (languageVersion >= 2) {
|
|
@@ -170542,8 +170541,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
170542
170541
|
installPackage(options) {
|
|
170543
170542
|
this.packageInstallId++;
|
|
170544
170543
|
const request = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
170545
|
-
const promise = new Promise((
|
|
170546
|
-
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map)).set(this.packageInstallId, { resolve:
|
|
170544
|
+
const promise = new Promise((resolve10, reject) => {
|
|
170545
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map)).set(this.packageInstallId, { resolve: resolve10, reject });
|
|
170547
170546
|
});
|
|
170548
170547
|
this.installer.send(request);
|
|
170549
170548
|
return promise;
|
|
@@ -170810,7 +170809,7 @@ __export(exports_compileAngular, {
|
|
|
170810
170809
|
compileAngular: () => compileAngular
|
|
170811
170810
|
});
|
|
170812
170811
|
import { existsSync as existsSync11, readFileSync as readFileSync5, promises as fs } from "fs";
|
|
170813
|
-
import { join as join9, basename as basename4, sep as sep3, dirname as dirname5, resolve as
|
|
170812
|
+
import { join as join9, basename as basename4, sep as sep3, dirname as dirname5, resolve as resolve10, relative as relative6 } from "path";
|
|
170814
170813
|
import { createHash as createHash2 } from "crypto";
|
|
170815
170814
|
var import_typescript, computeConfigHash = () => {
|
|
170816
170815
|
try {
|
|
@@ -170821,14 +170820,14 @@ var import_typescript, computeConfigHash = () => {
|
|
|
170821
170820
|
}
|
|
170822
170821
|
}, resolveDevClientDir4 = () => {
|
|
170823
170822
|
const projectRoot = process.cwd();
|
|
170824
|
-
const fromSource =
|
|
170823
|
+
const fromSource = resolve10(import.meta.dir, "../dev/client");
|
|
170825
170824
|
if (existsSync11(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
170826
170825
|
return fromSource;
|
|
170827
170826
|
}
|
|
170828
|
-
const fromNodeModules =
|
|
170827
|
+
const fromNodeModules = resolve10(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
170829
170828
|
if (existsSync11(fromNodeModules))
|
|
170830
170829
|
return fromNodeModules;
|
|
170831
|
-
return
|
|
170830
|
+
return resolve10(import.meta.dir, "./dev/client");
|
|
170832
170831
|
}, devClientDir4, hmrClientPath5, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
|
|
170833
170832
|
const componentClassRegex = /(?:export\s+)?class\s+(\w+Component)\s/g;
|
|
170834
170833
|
const componentNames = [];
|
|
@@ -170890,7 +170889,7 @@ ${registrations}
|
|
|
170890
170889
|
} else {
|
|
170891
170890
|
const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
|
|
170892
170891
|
const tsRootDir = dirname5(tsPath);
|
|
170893
|
-
tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir :
|
|
170892
|
+
tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve10(tsRootDir, "lib");
|
|
170894
170893
|
const config = readConfiguration("./tsconfig.json");
|
|
170895
170894
|
options = {
|
|
170896
170895
|
emitDecoratorMetadata: true,
|
|
@@ -170936,7 +170935,7 @@ ${registrations}
|
|
|
170936
170935
|
};
|
|
170937
170936
|
}
|
|
170938
170937
|
const emitted = {};
|
|
170939
|
-
const resolvedOutDir =
|
|
170938
|
+
const resolvedOutDir = resolve10(outDir);
|
|
170940
170939
|
host.writeFile = (fileName, text) => {
|
|
170941
170940
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
170942
170941
|
emitted[relativePath] = text;
|
|
@@ -171012,7 +171011,7 @@ ${registrations}
|
|
|
171012
171011
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir) => {
|
|
171013
171012
|
const allOutputs = [];
|
|
171014
171013
|
const visited = new Set;
|
|
171015
|
-
const baseDir =
|
|
171014
|
+
const baseDir = resolve10(rootDir ?? process.cwd());
|
|
171016
171015
|
const angularTranspiler = new Bun.Transpiler({
|
|
171017
171016
|
loader: "ts",
|
|
171018
171017
|
tsconfig: JSON.stringify({
|
|
@@ -171023,7 +171022,7 @@ ${registrations}
|
|
|
171023
171022
|
})
|
|
171024
171023
|
});
|
|
171025
171024
|
const transpileFile = async (filePath) => {
|
|
171026
|
-
const resolved =
|
|
171025
|
+
const resolved = resolve10(filePath);
|
|
171027
171026
|
if (visited.has(resolved))
|
|
171028
171027
|
return;
|
|
171029
171028
|
visited.add(resolved);
|
|
@@ -171075,7 +171074,7 @@ ${registrations}
|
|
|
171075
171074
|
}
|
|
171076
171075
|
const inputDirForResolve = dirname5(actualPath);
|
|
171077
171076
|
await Promise.all(localImports.map((imp) => {
|
|
171078
|
-
const importPath =
|
|
171077
|
+
const importPath = resolve10(inputDirForResolve, imp);
|
|
171079
171078
|
return transpileFile(importPath);
|
|
171080
171079
|
}));
|
|
171081
171080
|
};
|
|
@@ -171512,7 +171511,7 @@ import {
|
|
|
171512
171511
|
statSync,
|
|
171513
171512
|
writeFileSync as writeFileSync4
|
|
171514
171513
|
} from "fs";
|
|
171515
|
-
import { basename as basename5, join as join14, relative as relative7, resolve as
|
|
171514
|
+
import { basename as basename5, join as join14, relative as relative7, resolve as resolve11 } from "path";
|
|
171516
171515
|
import { cwd, env as env2, exit } from "process";
|
|
171517
171516
|
var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
|
|
171518
171517
|
var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
|
|
@@ -171550,8 +171549,8 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171550
171549
|
}
|
|
171551
171550
|
}, resolveAbsoluteVersion = async () => {
|
|
171552
171551
|
const candidates = [
|
|
171553
|
-
|
|
171554
|
-
|
|
171552
|
+
resolve11(import.meta.dir, "..", "..", "package.json"),
|
|
171553
|
+
resolve11(import.meta.dir, "..", "package.json")
|
|
171555
171554
|
];
|
|
171556
171555
|
for (const candidate of candidates) {
|
|
171557
171556
|
const pkg = await tryReadPackageJson(candidate);
|
|
@@ -171563,7 +171562,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171563
171562
|
return;
|
|
171564
171563
|
}
|
|
171565
171564
|
}, SKIP_DIRS, addWorkerPathIfExists = (file3, relPath, workerPaths) => {
|
|
171566
|
-
const absPath =
|
|
171565
|
+
const absPath = resolve11(file3, "..", relPath);
|
|
171567
171566
|
try {
|
|
171568
171567
|
statSync(absPath);
|
|
171569
171568
|
workerPaths.add(absPath);
|
|
@@ -171624,7 +171623,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171624
171623
|
}
|
|
171625
171624
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
171626
171625
|
const indexFiles = readDir(reactIndexesPath).filter((file3) => file3.endsWith(".tsx"));
|
|
171627
|
-
const pagesRel = relative7(process.cwd(),
|
|
171626
|
+
const pagesRel = relative7(process.cwd(), resolve11(reactPagesPath)).replace(/\\/g, "/");
|
|
171628
171627
|
for (const file3 of indexFiles) {
|
|
171629
171628
|
let content = readFileSync6(join14(reactIndexesPath, file3), "utf-8");
|
|
171630
171629
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -171632,27 +171631,27 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171632
171631
|
}
|
|
171633
171632
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
171634
171633
|
const svelteIndexDir = join14(svelteDir, "generated", "indexes");
|
|
171635
|
-
const sveltePageEntries = svelteEntries.filter((file3) =>
|
|
171634
|
+
const sveltePageEntries = svelteEntries.filter((file3) => resolve11(file3).startsWith(resolve11(sveltePagesPath)));
|
|
171636
171635
|
for (const entry of sveltePageEntries) {
|
|
171637
171636
|
const name = basename5(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
171638
171637
|
const indexFile = join14(svelteIndexDir, "pages", `${name}.js`);
|
|
171639
171638
|
if (!existsSync12(indexFile))
|
|
171640
171639
|
continue;
|
|
171641
171640
|
let content = readFileSync6(indexFile, "utf-8");
|
|
171642
|
-
const srcRel = relative7(process.cwd(),
|
|
171641
|
+
const srcRel = relative7(process.cwd(), resolve11(entry)).replace(/\\/g, "/");
|
|
171643
171642
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
171644
171643
|
writeFileSync4(join14(devIndexDir, `${name}.svelte.js`), content);
|
|
171645
171644
|
}
|
|
171646
171645
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
171647
171646
|
const vueIndexDir = join14(vueDir, "generated", "indexes");
|
|
171648
|
-
const vuePageEntries = vueEntries.filter((file3) =>
|
|
171647
|
+
const vuePageEntries = vueEntries.filter((file3) => resolve11(file3).startsWith(resolve11(vuePagesPath)));
|
|
171649
171648
|
for (const entry of vuePageEntries) {
|
|
171650
171649
|
const name = basename5(entry, ".vue");
|
|
171651
171650
|
const indexFile = join14(vueIndexDir, `${name}.js`);
|
|
171652
171651
|
if (!existsSync12(indexFile))
|
|
171653
171652
|
continue;
|
|
171654
171653
|
let content = readFileSync6(indexFile, "utf-8");
|
|
171655
|
-
const srcRel = relative7(process.cwd(),
|
|
171654
|
+
const srcRel = relative7(process.cwd(), resolve11(entry)).replace(/\\/g, "/");
|
|
171656
171655
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
171657
171656
|
writeFileSync4(join14(devIndexDir, `${name}.vue.js`), content);
|
|
171658
171657
|
}
|
|
@@ -171665,7 +171664,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171665
171664
|
const last = allComments[allComments.length - 1];
|
|
171666
171665
|
if (!last?.[1])
|
|
171667
171666
|
return JSON.stringify(outputPath);
|
|
171668
|
-
const srcPath =
|
|
171667
|
+
const srcPath = resolve11(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
171669
171668
|
return JSON.stringify(srcPath);
|
|
171670
171669
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
171671
171670
|
let depth = 0;
|
|
@@ -171870,13 +171869,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
171870
171869
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
171871
171870
|
if (!isIncremental || !incrementalFiles)
|
|
171872
171871
|
return entryPoints;
|
|
171873
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f) =>
|
|
171872
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve11(f)));
|
|
171874
171873
|
const matchingEntries = [];
|
|
171875
171874
|
for (const entry of entryPoints) {
|
|
171876
171875
|
const sourceFile = mapToSource(entry);
|
|
171877
171876
|
if (!sourceFile)
|
|
171878
171877
|
continue;
|
|
171879
|
-
if (!normalizedIncremental.has(
|
|
171878
|
+
if (!normalizedIncremental.has(resolve11(sourceFile)))
|
|
171880
171879
|
continue;
|
|
171881
171880
|
matchingEntries.push(entry);
|
|
171882
171881
|
}
|
|
@@ -171923,7 +171922,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
171923
171922
|
]);
|
|
171924
171923
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/html/") && (f.endsWith(".html") || f.endsWith(".css")));
|
|
171925
171924
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
171926
|
-
if (entry.startsWith(
|
|
171925
|
+
if (entry.startsWith(resolve11(reactIndexesPath))) {
|
|
171927
171926
|
const pageName = basename5(entry, ".tsx");
|
|
171928
171927
|
return join14(reactPagesPath, `${pageName}.tsx`);
|
|
171929
171928
|
}
|
|
@@ -172387,7 +172386,7 @@ var init_build = __esm(() => {
|
|
|
172387
172386
|
// src/dev/dependencyGraph.ts
|
|
172388
172387
|
import { existsSync as existsSync13, readFileSync as readFileSync7 } from "fs";
|
|
172389
172388
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
172390
|
-
import { resolve as
|
|
172389
|
+
import { resolve as resolve12 } from "path";
|
|
172391
172390
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
172392
172391
|
const lower = filePath.toLowerCase();
|
|
172393
172392
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -172401,8 +172400,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172401
172400
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
172402
172401
|
return null;
|
|
172403
172402
|
}
|
|
172404
|
-
const fromDir =
|
|
172405
|
-
const normalized =
|
|
172403
|
+
const fromDir = resolve12(fromFile, "..");
|
|
172404
|
+
const normalized = resolve12(fromDir, importPath);
|
|
172406
172405
|
const extensions = [
|
|
172407
172406
|
".ts",
|
|
172408
172407
|
".tsx",
|
|
@@ -172432,7 +172431,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172432
172431
|
dependents.delete(normalizedPath);
|
|
172433
172432
|
}
|
|
172434
172433
|
}, addFileToGraph = (graph, filePath) => {
|
|
172435
|
-
const normalizedPath =
|
|
172434
|
+
const normalizedPath = resolve12(filePath);
|
|
172436
172435
|
if (!existsSync13(normalizedPath))
|
|
172437
172436
|
return;
|
|
172438
172437
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -172449,10 +172448,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172449
172448
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
172450
172449
|
const processedFiles = new Set;
|
|
172451
172450
|
const glob = new Glob6("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
172452
|
-
const resolvedDirs = directories.map((dir) =>
|
|
172451
|
+
const resolvedDirs = directories.map((dir) => resolve12(dir)).filter((dir) => existsSync13(dir));
|
|
172453
172452
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
172454
172453
|
for (const file3 of allFiles) {
|
|
172455
|
-
const fullPath =
|
|
172454
|
+
const fullPath = resolve12(file3);
|
|
172456
172455
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
172457
172456
|
continue;
|
|
172458
172457
|
if (processedFiles.has(fullPath))
|
|
@@ -172565,7 +172564,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172565
172564
|
return [];
|
|
172566
172565
|
}
|
|
172567
172566
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
172568
|
-
const normalizedPath =
|
|
172567
|
+
const normalizedPath = resolve12(changedFile);
|
|
172569
172568
|
const affected = new Set;
|
|
172570
172569
|
const toProcess = [normalizedPath];
|
|
172571
172570
|
const processNode = (current) => {
|
|
@@ -172605,7 +172604,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172605
172604
|
}
|
|
172606
172605
|
graph.dependents.delete(normalizedPath);
|
|
172607
172606
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
172608
|
-
const normalizedPath =
|
|
172607
|
+
const normalizedPath = resolve12(filePath);
|
|
172609
172608
|
removeDepsForFile(graph, normalizedPath);
|
|
172610
172609
|
removeDependentsForFile(graph, normalizedPath);
|
|
172611
172610
|
};
|
|
@@ -172648,12 +172647,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
172648
172647
|
};
|
|
172649
172648
|
|
|
172650
172649
|
// src/dev/configResolver.ts
|
|
172651
|
-
import { resolve as
|
|
172650
|
+
import { resolve as resolve13 } from "path";
|
|
172652
172651
|
var resolveBuildPaths = (config) => {
|
|
172653
172652
|
const cwd2 = process.cwd();
|
|
172654
172653
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
172655
|
-
const withDefault = (value, fallback) => normalize(
|
|
172656
|
-
const optional = (value) => value ? normalize(
|
|
172654
|
+
const withDefault = (value, fallback) => normalize(resolve13(cwd2, value ?? fallback));
|
|
172655
|
+
const optional = (value) => value ? normalize(resolve13(cwd2, value)) : undefined;
|
|
172657
172656
|
return {
|
|
172658
172657
|
angularDir: optional(config.angularDirectory),
|
|
172659
172658
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -172841,7 +172840,7 @@ var init_pathUtils = __esm(() => {
|
|
|
172841
172840
|
// src/dev/fileWatcher.ts
|
|
172842
172841
|
import { watch } from "fs";
|
|
172843
172842
|
import { existsSync as existsSync14 } from "fs";
|
|
172844
|
-
import { join as join15, resolve as
|
|
172843
|
+
import { join as join15, resolve as resolve14 } from "path";
|
|
172845
172844
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
172846
172845
|
try {
|
|
172847
172846
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -172886,7 +172885,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
172886
172885
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
172887
172886
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
172888
172887
|
paths.forEach((path) => {
|
|
172889
|
-
const absolutePath =
|
|
172888
|
+
const absolutePath = resolve14(path).replace(/\\/g, "/");
|
|
172890
172889
|
if (!existsSync14(absolutePath)) {
|
|
172891
172890
|
return;
|
|
172892
172891
|
}
|
|
@@ -172897,7 +172896,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
172897
172896
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
172898
172897
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
172899
172898
|
watchPaths.forEach((path) => {
|
|
172900
|
-
const absolutePath =
|
|
172899
|
+
const absolutePath = resolve14(path).replace(/\\/g, "/");
|
|
172901
172900
|
if (!existsSync14(absolutePath)) {
|
|
172902
172901
|
return;
|
|
172903
172902
|
}
|
|
@@ -172912,13 +172911,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
172912
172911
|
});
|
|
172913
172912
|
|
|
172914
172913
|
// src/dev/assetStore.ts
|
|
172915
|
-
import { resolve as
|
|
172914
|
+
import { resolve as resolve15 } from "path";
|
|
172916
172915
|
import { readdir as readdir2, unlink } from "fs/promises";
|
|
172917
172916
|
var mimeTypes, getMimeType = (filePath) => {
|
|
172918
172917
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
172919
172918
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
172920
172919
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
172921
|
-
const fullPath =
|
|
172920
|
+
const fullPath = resolve15(dir, entry.name);
|
|
172922
172921
|
if (entry.isDirectory()) {
|
|
172923
172922
|
return walkAndClean(fullPath);
|
|
172924
172923
|
}
|
|
@@ -172934,10 +172933,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
172934
172933
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
172935
172934
|
const liveByIdentity = new Map;
|
|
172936
172935
|
for (const webPath of store.keys()) {
|
|
172937
|
-
const diskPath =
|
|
172936
|
+
const diskPath = resolve15(buildDir, webPath.slice(1));
|
|
172938
172937
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
172939
172938
|
}
|
|
172940
|
-
const absBuildDir =
|
|
172939
|
+
const absBuildDir = resolve15(buildDir);
|
|
172941
172940
|
Object.values(manifest).forEach((val) => {
|
|
172942
172941
|
if (!HASHED_FILE_RE.test(val))
|
|
172943
172942
|
return;
|
|
@@ -172955,7 +172954,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
172955
172954
|
} catch {}
|
|
172956
172955
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
172957
172956
|
if (entry.isDirectory()) {
|
|
172958
|
-
return scanDir(
|
|
172957
|
+
return scanDir(resolve15(dir, entry.name), `${prefix}${entry.name}/`);
|
|
172959
172958
|
}
|
|
172960
172959
|
if (!entry.name.startsWith("chunk-")) {
|
|
172961
172960
|
return null;
|
|
@@ -172964,7 +172963,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
172964
172963
|
if (store.has(webPath)) {
|
|
172965
172964
|
return null;
|
|
172966
172965
|
}
|
|
172967
|
-
return Bun.file(
|
|
172966
|
+
return Bun.file(resolve15(dir, entry.name)).bytes().then((bytes) => {
|
|
172968
172967
|
store.set(webPath, bytes);
|
|
172969
172968
|
return;
|
|
172970
172969
|
}).catch(() => {});
|
|
@@ -172989,7 +172988,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
172989
172988
|
for (const webPath of newIdentities.values()) {
|
|
172990
172989
|
if (store.has(webPath))
|
|
172991
172990
|
continue;
|
|
172992
|
-
loadPromises.push(Bun.file(
|
|
172991
|
+
loadPromises.push(Bun.file(resolve15(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
172993
172992
|
store.set(webPath, bytes);
|
|
172994
172993
|
return;
|
|
172995
172994
|
}).catch(() => {}));
|
|
@@ -173040,9 +173039,9 @@ var init_fileHashTracker = __esm(() => {
|
|
|
173040
173039
|
});
|
|
173041
173040
|
|
|
173042
173041
|
// src/dev/reactComponentClassifier.ts
|
|
173043
|
-
import { resolve as
|
|
173042
|
+
import { resolve as resolve16 } from "path";
|
|
173044
173043
|
var classifyComponent = (filePath) => {
|
|
173045
|
-
const normalizedPath =
|
|
173044
|
+
const normalizedPath = resolve16(filePath);
|
|
173046
173045
|
if (normalizedPath.includes("/react/pages/")) {
|
|
173047
173046
|
return "server";
|
|
173048
173047
|
}
|
|
@@ -173054,7 +173053,7 @@ var classifyComponent = (filePath) => {
|
|
|
173054
173053
|
var init_reactComponentClassifier = () => {};
|
|
173055
173054
|
|
|
173056
173055
|
// src/dev/moduleMapper.ts
|
|
173057
|
-
import { basename as basename6, resolve as
|
|
173056
|
+
import { basename as basename6, resolve as resolve17 } from "path";
|
|
173058
173057
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
173059
173058
|
const modulePaths = {};
|
|
173060
173059
|
moduleKeys.forEach((key) => {
|
|
@@ -173064,7 +173063,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
173064
173063
|
});
|
|
173065
173064
|
return modulePaths;
|
|
173066
173065
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
173067
|
-
const normalizedFile =
|
|
173066
|
+
const normalizedFile = resolve17(sourceFile);
|
|
173068
173067
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
173069
173068
|
if (processedFiles.has(normalizedFile)) {
|
|
173070
173069
|
return null;
|
|
@@ -173100,7 +173099,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
173100
173099
|
});
|
|
173101
173100
|
return grouped;
|
|
173102
173101
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
173103
|
-
const normalizedFile =
|
|
173102
|
+
const normalizedFile = resolve17(sourceFile);
|
|
173104
173103
|
const fileName = basename6(normalizedFile);
|
|
173105
173104
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
173106
173105
|
const pascalName = toPascal(baseName);
|
|
@@ -203237,7 +203236,7 @@ __export(exports_moduleServer, {
|
|
|
203237
203236
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
203238
203237
|
});
|
|
203239
203238
|
import { existsSync as existsSync15, readFileSync as readFileSync10, statSync as statSync2 } from "fs";
|
|
203240
|
-
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as
|
|
203239
|
+
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve18, relative as relative8 } from "path";
|
|
203241
203240
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
203242
203241
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
203243
203242
|
const allExports = [];
|
|
@@ -203257,7 +203256,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
203257
203256
|
${stubs}
|
|
203258
203257
|
`;
|
|
203259
203258
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
203260
|
-
const found = extensions.find((ext) => existsSync15(
|
|
203259
|
+
const found = extensions.find((ext) => existsSync15(resolve18(projectRoot, srcPath + ext)));
|
|
203261
203260
|
return found ? srcPath + found : srcPath;
|
|
203262
203261
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
203263
203262
|
const entries = Object.entries(vendorPaths).sort(([a], [b]) => b.length - a.length);
|
|
@@ -203272,7 +203271,7 @@ ${stubs}
|
|
|
203272
203271
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
203273
203272
|
}, srcUrl = (relPath, projectRoot) => {
|
|
203274
203273
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
203275
|
-
const absPath =
|
|
203274
|
+
const absPath = resolve18(projectRoot, relPath);
|
|
203276
203275
|
const cached = mtimeCache.get(absPath);
|
|
203277
203276
|
if (cached !== undefined)
|
|
203278
203277
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -203284,11 +203283,11 @@ ${stubs}
|
|
|
203284
203283
|
return base;
|
|
203285
203284
|
}
|
|
203286
203285
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
203287
|
-
const absPath =
|
|
203286
|
+
const absPath = resolve18(fileDir, relPath);
|
|
203288
203287
|
const rel = relative8(projectRoot, absPath);
|
|
203289
203288
|
let srcPath = extname3(rel) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
203290
203289
|
if (extname3(srcPath) === ".svelte") {
|
|
203291
|
-
srcPath = relative8(projectRoot, resolveSvelteModulePath(
|
|
203290
|
+
srcPath = relative8(projectRoot, resolveSvelteModulePath(resolve18(projectRoot, srcPath)));
|
|
203292
203291
|
}
|
|
203293
203292
|
return srcUrl(srcPath, projectRoot);
|
|
203294
203293
|
}, rewriteImports2 = (code, filePath, projectRoot, rewriter) => {
|
|
@@ -203325,12 +203324,12 @@ ${stubs}
|
|
|
203325
203324
|
return _match;
|
|
203326
203325
|
});
|
|
203327
203326
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
203328
|
-
const absPath =
|
|
203327
|
+
const absPath = resolve18(fileDir, relPath);
|
|
203329
203328
|
const rel = relative8(projectRoot, absPath);
|
|
203330
203329
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
203331
203330
|
});
|
|
203332
203331
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
203333
|
-
const absPath =
|
|
203332
|
+
const absPath = resolve18(fileDir, relPath);
|
|
203334
203333
|
const rel = relative8(projectRoot, absPath);
|
|
203335
203334
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
203336
203335
|
});
|
|
@@ -203598,7 +203597,7 @@ ${code}`;
|
|
|
203598
203597
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
203599
203598
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
203600
203599
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
203601
|
-
const hmrBase = vueDir ?
|
|
203600
|
+
const hmrBase = vueDir ? resolve18(vueDir) : projectRoot;
|
|
203602
203601
|
const hmrId = relative8(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
203603
203602
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
203604
203603
|
result += [
|
|
@@ -203756,7 +203755,7 @@ export default {};
|
|
|
203756
203755
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
203757
203756
|
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);`);
|
|
203758
203757
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
203759
|
-
const filePath =
|
|
203758
|
+
const filePath = resolve18(projectRoot, relPath);
|
|
203760
203759
|
const ext = extname3(filePath);
|
|
203761
203760
|
if (ext === ".svelte")
|
|
203762
203761
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -203783,7 +203782,7 @@ export default {};
|
|
|
203783
203782
|
if (!TRANSPILABLE.has(ext))
|
|
203784
203783
|
return;
|
|
203785
203784
|
const stat2 = statSync2(filePath);
|
|
203786
|
-
const resolvedVueDir = vueDir ?
|
|
203785
|
+
const resolvedVueDir = vueDir ? resolve18(vueDir) : undefined;
|
|
203787
203786
|
const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
203788
203787
|
setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
203789
203788
|
return jsResponse(content);
|
|
@@ -203814,7 +203813,7 @@ export default {};
|
|
|
203814
203813
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
203815
203814
|
return;
|
|
203816
203815
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
203817
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
203816
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve18(projectRoot, relPath));
|
|
203818
203817
|
if (virtualCssResponse)
|
|
203819
203818
|
return virtualCssResponse;
|
|
203820
203819
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -203830,11 +203829,11 @@ export default {};
|
|
|
203830
203829
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
203831
203830
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
203832
203831
|
if (match[1])
|
|
203833
|
-
files.push(
|
|
203832
|
+
files.push(resolve18(projectRoot, match[1]));
|
|
203834
203833
|
}
|
|
203835
203834
|
return files;
|
|
203836
203835
|
}, invalidateModule = (filePath) => {
|
|
203837
|
-
const resolved =
|
|
203836
|
+
const resolved = resolve18(filePath);
|
|
203838
203837
|
invalidate(filePath);
|
|
203839
203838
|
if (resolved !== filePath)
|
|
203840
203839
|
invalidate(resolved);
|
|
@@ -203900,11 +203899,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
203900
203899
|
__export(exports_simpleHTMLHMR, {
|
|
203901
203900
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
203902
203901
|
});
|
|
203903
|
-
import { resolve as
|
|
203902
|
+
import { resolve as resolve19 } from "path";
|
|
203904
203903
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
203905
203904
|
let htmlContent;
|
|
203906
203905
|
try {
|
|
203907
|
-
const resolvedPath =
|
|
203906
|
+
const resolvedPath = resolve19(htmlFilePath);
|
|
203908
203907
|
const file3 = Bun.file(resolvedPath);
|
|
203909
203908
|
if (!await file3.exists()) {
|
|
203910
203909
|
return null;
|
|
@@ -203930,11 +203929,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
203930
203929
|
__export(exports_simpleHTMXHMR, {
|
|
203931
203930
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
203932
203931
|
});
|
|
203933
|
-
import { resolve as
|
|
203932
|
+
import { resolve as resolve20 } from "path";
|
|
203934
203933
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
203935
203934
|
let htmlContent;
|
|
203936
203935
|
try {
|
|
203937
|
-
const resolvedPath =
|
|
203936
|
+
const resolvedPath = resolve20(htmxFilePath);
|
|
203938
203937
|
const file3 = Bun.file(resolvedPath);
|
|
203939
203938
|
if (!await file3.exists()) {
|
|
203940
203939
|
return null;
|
|
@@ -203958,7 +203957,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
203958
203957
|
// src/dev/rebuildTrigger.ts
|
|
203959
203958
|
import { existsSync as existsSync16 } from "fs";
|
|
203960
203959
|
import { rm as rm8 } from "fs/promises";
|
|
203961
|
-
import { basename as basename8, relative as relative9, resolve as
|
|
203960
|
+
import { basename as basename8, relative as relative9, resolve as resolve21 } from "path";
|
|
203962
203961
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
203963
203962
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
203964
203963
|
if (pathLineCol) {
|
|
@@ -204030,7 +204029,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204030
204029
|
state.fileHashes.delete(filePathInSet);
|
|
204031
204030
|
try {
|
|
204032
204031
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
204033
|
-
const deletedPathResolved =
|
|
204032
|
+
const deletedPathResolved = resolve21(filePathInSet);
|
|
204034
204033
|
affectedFiles.forEach((affectedFile) => {
|
|
204035
204034
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
204036
204035
|
validFiles.push(affectedFile);
|
|
@@ -204074,7 +204073,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204074
204073
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
204075
204074
|
return;
|
|
204076
204075
|
}
|
|
204077
|
-
const normalizedFilePath =
|
|
204076
|
+
const normalizedFilePath = resolve21(filePathInSet);
|
|
204078
204077
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
204079
204078
|
validFiles.push(normalizedFilePath);
|
|
204080
204079
|
processedFiles.add(normalizedFilePath);
|
|
@@ -204152,7 +204151,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204152
204151
|
}
|
|
204153
204152
|
if (framework === "unknown") {
|
|
204154
204153
|
const { invalidate: invalidate2 } = (init_transformCache(), __toCommonJS(exports_transformCache));
|
|
204155
|
-
invalidate2(
|
|
204154
|
+
invalidate2(resolve21(filePath));
|
|
204156
204155
|
const relPath = relative9(process.cwd(), filePath);
|
|
204157
204156
|
logHmrUpdate(relPath);
|
|
204158
204157
|
return;
|
|
@@ -204198,7 +204197,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204198
204197
|
}
|
|
204199
204198
|
if (!graph)
|
|
204200
204199
|
return componentFile;
|
|
204201
|
-
const dependents = graph.dependents.get(
|
|
204200
|
+
const dependents = graph.dependents.get(resolve21(componentFile));
|
|
204202
204201
|
if (!dependents)
|
|
204203
204202
|
return componentFile;
|
|
204204
204203
|
for (const dep of dependents) {
|
|
@@ -204207,7 +204206,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204207
204206
|
}
|
|
204208
204207
|
return componentFile;
|
|
204209
204208
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
204210
|
-
const pageEntries = angularFiles.filter((file3) => file3.endsWith(".ts") &&
|
|
204209
|
+
const pageEntries = angularFiles.filter((file3) => file3.endsWith(".ts") && resolve21(file3).startsWith(angularPagesPath));
|
|
204211
204210
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
204212
204211
|
return pageEntries;
|
|
204213
204212
|
}
|
|
@@ -204216,7 +204215,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204216
204215
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
204217
204216
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
204218
204217
|
affected.forEach((file3) => {
|
|
204219
|
-
if (file3.endsWith(".ts") &&
|
|
204218
|
+
if (file3.endsWith(".ts") && resolve21(file3).startsWith(angularPagesPath)) {
|
|
204220
204219
|
resolvedPages.add(file3);
|
|
204221
204220
|
}
|
|
204222
204221
|
});
|
|
@@ -204297,7 +204296,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204297
204296
|
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true);
|
|
204298
204297
|
serverPaths.forEach((serverPath) => {
|
|
204299
204298
|
const fileBase = basename8(serverPath, ".js");
|
|
204300
|
-
state.manifest[toPascal(fileBase)] =
|
|
204299
|
+
state.manifest[toPascal(fileBase)] = resolve21(serverPath);
|
|
204301
204300
|
});
|
|
204302
204301
|
if (clientPaths.length > 0) {
|
|
204303
204302
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
|
|
@@ -204306,16 +204305,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204306
204305
|
const angularDir = config.angularDirectory ?? "";
|
|
204307
204306
|
const angularFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "angular");
|
|
204308
204307
|
for (const file3 of angularFiles) {
|
|
204309
|
-
state.fileHashes.set(
|
|
204308
|
+
state.fileHashes.set(resolve21(file3), computeFileHash(file3));
|
|
204310
204309
|
}
|
|
204311
|
-
const angularPagesPath =
|
|
204310
|
+
const angularPagesPath = resolve21(angularDir, "pages");
|
|
204312
204311
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
204313
204312
|
if (pageEntries.length > 0) {
|
|
204314
204313
|
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
204315
204314
|
invalidateAngularSsrCache();
|
|
204316
204315
|
}
|
|
204317
204316
|
if (pageEntries.length > 0) {
|
|
204318
|
-
await rm8(
|
|
204317
|
+
await rm8(resolve21(angularDir, "generated"), {
|
|
204319
204318
|
force: true,
|
|
204320
204319
|
recursive: true
|
|
204321
204320
|
});
|
|
@@ -204329,7 +204328,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204329
204328
|
return manifest;
|
|
204330
204329
|
}, resolveReactEntryForPageFile = (normalized, pagesPathResolved, reactIndexesPath) => {
|
|
204331
204330
|
const pageName = basename8(normalized, ".tsx");
|
|
204332
|
-
const indexPath =
|
|
204331
|
+
const indexPath = resolve21(reactIndexesPath, `${pageName}.tsx`);
|
|
204333
204332
|
if (!existsSync16(indexPath)) {
|
|
204334
204333
|
return;
|
|
204335
204334
|
}
|
|
@@ -204341,13 +204340,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204341
204340
|
return;
|
|
204342
204341
|
}
|
|
204343
204342
|
const pageName = basename8(dep, ".tsx");
|
|
204344
|
-
const indexPath =
|
|
204343
|
+
const indexPath = resolve21(reactIndexesPath, `${pageName}.tsx`);
|
|
204345
204344
|
if (existsSync16(indexPath) && !reactEntries.includes(indexPath)) {
|
|
204346
204345
|
reactEntries.push(indexPath);
|
|
204347
204346
|
}
|
|
204348
204347
|
});
|
|
204349
204348
|
}, resolveReactEntryForFile = (state, file3, pagesPathResolved, reactIndexesPath, reactEntries) => {
|
|
204350
|
-
const normalized =
|
|
204349
|
+
const normalized = resolve21(file3);
|
|
204351
204350
|
if (!normalized.startsWith(pagesPathResolved)) {
|
|
204352
204351
|
resolveReactEntriesFromDeps(state, normalized, pagesPathResolved, reactIndexesPath, reactEntries);
|
|
204353
204352
|
return;
|
|
@@ -204358,7 +204357,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204358
204357
|
}
|
|
204359
204358
|
}, collectReactEntries = (state, filesToRebuild, reactPagesPath, reactIndexesPath) => {
|
|
204360
204359
|
const reactEntries = [];
|
|
204361
|
-
const pagesPathResolved =
|
|
204360
|
+
const pagesPathResolved = resolve21(reactPagesPath);
|
|
204362
204361
|
filesToRebuild.forEach((file3) => {
|
|
204363
204362
|
resolveReactEntryForFile(state, file3, pagesPathResolved, reactIndexesPath, reactEntries);
|
|
204364
204363
|
});
|
|
@@ -204369,7 +204368,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204369
204368
|
const { getDevVendorPaths: getDevVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
204370
204369
|
const { rewriteReactImports: rewriteReactImports2 } = await Promise.resolve().then(() => (init_rewriteReactImports(), exports_rewriteReactImports));
|
|
204371
204370
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
204372
|
-
const refreshEntry =
|
|
204371
|
+
const refreshEntry = resolve21(reactIndexesPath, "_refresh.tsx");
|
|
204373
204372
|
if (!reactEntries.includes(refreshEntry)) {
|
|
204374
204373
|
reactEntries.push(refreshEntry);
|
|
204375
204374
|
}
|
|
@@ -204381,7 +204380,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204381
204380
|
setDevVendorPaths2(vendorPaths);
|
|
204382
204381
|
}
|
|
204383
204382
|
const { rmSync: rmSync2 } = await import("fs");
|
|
204384
|
-
rmSync2(
|
|
204383
|
+
rmSync2(resolve21(buildDir, "react", "indexes"), {
|
|
204385
204384
|
force: true,
|
|
204386
204385
|
recursive: true
|
|
204387
204386
|
});
|
|
@@ -204419,11 +204418,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204419
204418
|
if (isComponentFile2)
|
|
204420
204419
|
return primaryFile;
|
|
204421
204420
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
204422
|
-
const nearest = findNearestComponent2(
|
|
204421
|
+
const nearest = findNearestComponent2(resolve21(primaryFile));
|
|
204423
204422
|
return nearest ?? primaryFile;
|
|
204424
204423
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
204425
204424
|
for (const file3 of reactFiles) {
|
|
204426
|
-
state.fileHashes.set(
|
|
204425
|
+
state.fileHashes.set(resolve21(file3), computeFileHash(file3));
|
|
204427
204426
|
}
|
|
204428
204427
|
invalidateReactSsrCache();
|
|
204429
204428
|
const primaryFile = reactFiles.find((file3) => !file3.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
@@ -204465,8 +204464,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204465
204464
|
return state.manifest;
|
|
204466
204465
|
}, handleReactFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
204467
204466
|
const reactDir = config.reactDirectory ?? "";
|
|
204468
|
-
const reactPagesPath =
|
|
204469
|
-
const reactIndexesPath =
|
|
204467
|
+
const reactPagesPath = resolve21(reactDir, "pages");
|
|
204468
|
+
const reactIndexesPath = resolve21(reactDir, "generated", "indexes");
|
|
204470
204469
|
const { buildDir } = state.resolvedPaths;
|
|
204471
204470
|
const reactFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "react");
|
|
204472
204471
|
if (reactFiles.length > 0) {
|
|
@@ -204478,7 +204477,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204478
204477
|
if (reactEntries.length > 0) {
|
|
204479
204478
|
await bundleReactClient(state, reactEntries, reactIndexesPath, buildDir);
|
|
204480
204479
|
}
|
|
204481
|
-
await rm8(
|
|
204480
|
+
await rm8(resolve21(reactDir, "generated"), { force: true, recursive: true });
|
|
204482
204481
|
const { manifest } = state;
|
|
204483
204482
|
const duration = Date.now() - startTime;
|
|
204484
204483
|
const reactPageFiles = reactFiles.filter((file3) => file3.replace(/\\/g, "/").includes("/pages/"));
|
|
@@ -204530,7 +204529,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204530
204529
|
});
|
|
204531
204530
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
204532
204531
|
for (const file3 of svelteFiles) {
|
|
204533
|
-
state.fileHashes.set(
|
|
204532
|
+
state.fileHashes.set(resolve21(file3), computeFileHash(file3));
|
|
204534
204533
|
}
|
|
204535
204534
|
invalidateSvelteSsrCache();
|
|
204536
204535
|
const serverDuration = Date.now() - startTime;
|
|
@@ -204556,8 +204555,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204556
204555
|
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true);
|
|
204557
204556
|
const serverEntries = [...svelteServerPaths];
|
|
204558
204557
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
204559
|
-
const serverRoot =
|
|
204560
|
-
const serverOutDir =
|
|
204558
|
+
const serverRoot = resolve21(svelteDir, "generated", "server");
|
|
204559
|
+
const serverOutDir = resolve21(buildDir, basename8(svelteDir));
|
|
204561
204560
|
const [serverResult, clientResult] = await Promise.all([
|
|
204562
204561
|
serverEntries.length > 0 ? bunBuild7({
|
|
204563
204562
|
entrypoints: serverEntries,
|
|
@@ -204582,7 +204581,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204582
204581
|
handleServerManifestUpdate(state, serverResult);
|
|
204583
204582
|
await handleClientManifestUpdate(state, clientResult, buildDir);
|
|
204584
204583
|
}
|
|
204585
|
-
await rm8(
|
|
204584
|
+
await rm8(resolve21(svelteDir, "generated"), {
|
|
204586
204585
|
force: true,
|
|
204587
204586
|
recursive: true
|
|
204588
204587
|
});
|
|
@@ -204645,7 +204644,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204645
204644
|
});
|
|
204646
204645
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
204647
204646
|
for (const file3 of [...vueFiles, ...nonVueFiles]) {
|
|
204648
|
-
state.fileHashes.set(
|
|
204647
|
+
state.fileHashes.set(resolve21(file3), computeFileHash(file3));
|
|
204649
204648
|
}
|
|
204650
204649
|
invalidateVueSsrCache();
|
|
204651
204650
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -204754,10 +204753,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204754
204753
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
204755
204754
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
204756
204755
|
if (isSingle) {
|
|
204757
|
-
return
|
|
204756
|
+
return resolve21(state.resolvedPaths.buildDir, "pages");
|
|
204758
204757
|
}
|
|
204759
204758
|
const dirName = framework === "html" ? basename8(config.htmlDirectory ?? "html") : basename8(config.htmxDirectory ?? "htmx");
|
|
204760
|
-
return
|
|
204759
|
+
return resolve21(state.resolvedPaths.buildDir, dirName, "pages");
|
|
204761
204760
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
204762
204761
|
try {
|
|
204763
204762
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -204793,7 +204792,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204793
204792
|
const outputHtmlPages = computeOutputPagesDir(state, config, "html");
|
|
204794
204793
|
for (const pageFile of htmlPageFiles) {
|
|
204795
204794
|
const htmlPageName = basename8(pageFile);
|
|
204796
|
-
const builtHtmlPagePath =
|
|
204795
|
+
const builtHtmlPagePath = resolve21(outputHtmlPages, htmlPageName);
|
|
204797
204796
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
204798
204797
|
}
|
|
204799
204798
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -204858,7 +204857,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204858
204857
|
const cssKey = `${pascalName}CSS`;
|
|
204859
204858
|
const cssUrl = manifest[cssKey] || null;
|
|
204860
204859
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
204861
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
204860
|
+
const hmrMeta = vueHmrMetadata2.get(resolve21(vuePagePath));
|
|
204862
204861
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
204863
204862
|
if (changeType === "style-only") {
|
|
204864
204863
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -205092,7 +205091,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
205092
205091
|
const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
|
|
205093
205092
|
for (const htmxPageFile of htmxPageFiles) {
|
|
205094
205093
|
const htmxPageName = basename8(htmxPageFile);
|
|
205095
|
-
const builtHtmxPagePath =
|
|
205094
|
+
const builtHtmxPagePath = resolve21(outputHtmxPages, htmxPageName);
|
|
205096
205095
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
205097
205096
|
}
|
|
205098
205097
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -205201,7 +205200,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
205201
205200
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
205202
205201
|
writeFs(destPath, html);
|
|
205203
205202
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
205204
|
-
const destPath =
|
|
205203
|
+
const destPath = resolve21(outputDir, basename8(sourceFile));
|
|
205205
205204
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
205206
205205
|
const source = await Bun.file(sourceFile).text();
|
|
205207
205206
|
await Bun.write(destPath, source);
|
|
@@ -205563,7 +205562,7 @@ __export(exports_devBuild, {
|
|
|
205563
205562
|
});
|
|
205564
205563
|
import { readdir as readdir3 } from "fs/promises";
|
|
205565
205564
|
import { statSync as statSync3 } from "fs";
|
|
205566
|
-
import { resolve as
|
|
205565
|
+
import { resolve as resolve22 } from "path";
|
|
205567
205566
|
var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
205568
205567
|
const config = {};
|
|
205569
205568
|
const dirPattern = /(\w+Directory)\s*:\s*['"]([^'"]+)['"]/g;
|
|
@@ -205576,7 +205575,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205576
205575
|
return Object.keys(config).length > 0 ? config : null;
|
|
205577
205576
|
}, reloadConfig = async () => {
|
|
205578
205577
|
try {
|
|
205579
|
-
const configPath2 =
|
|
205578
|
+
const configPath2 = resolve22(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
205580
205579
|
const source = await Bun.file(configPath2).text();
|
|
205581
205580
|
return parseDirectoryConfig(source);
|
|
205582
205581
|
} catch {
|
|
@@ -205655,7 +205654,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205655
205654
|
state.fileChangeQueue.clear();
|
|
205656
205655
|
}
|
|
205657
205656
|
}, handleCachedReload = async () => {
|
|
205658
|
-
const serverMtime = statSync3(
|
|
205657
|
+
const serverMtime = statSync3(resolve22(Bun.main)).mtimeMs;
|
|
205659
205658
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
205660
205659
|
globalThis.__hmrServerMtime = serverMtime;
|
|
205661
205660
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -205689,8 +205688,8 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205689
205688
|
return true;
|
|
205690
205689
|
}, resolveAbsoluteVersion2 = async () => {
|
|
205691
205690
|
const candidates = [
|
|
205692
|
-
|
|
205693
|
-
|
|
205691
|
+
resolve22(import.meta.dir, "..", "..", "package.json"),
|
|
205692
|
+
resolve22(import.meta.dir, "..", "package.json")
|
|
205694
205693
|
];
|
|
205695
205694
|
for (const candidate of candidates) {
|
|
205696
205695
|
const found = await tryReadPackageVersion(candidate);
|
|
@@ -205703,7 +205702,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205703
205702
|
const entries = await readdir3(vendorDir).catch(() => emptyStringArray);
|
|
205704
205703
|
await Promise.all(entries.map(async (entry) => {
|
|
205705
205704
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
205706
|
-
const bytes = await Bun.file(
|
|
205705
|
+
const bytes = await Bun.file(resolve22(vendorDir, entry)).bytes();
|
|
205707
205706
|
assetStore.set(webPath, bytes);
|
|
205708
205707
|
}));
|
|
205709
205708
|
}, devBuild = async (config) => {
|
|
@@ -205743,7 +205742,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205743
205742
|
await populateAssetStore(state.assetStore, manifest ?? {}, state.resolvedPaths.buildDir);
|
|
205744
205743
|
cleanStaleAssets(state.assetStore, manifest ?? {}, state.resolvedPaths.buildDir);
|
|
205745
205744
|
const buildReactVendorTask = config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
205746
|
-
const vendorDir =
|
|
205745
|
+
const vendorDir = resolve22(state.resolvedPaths.buildDir, "react", "vendor");
|
|
205747
205746
|
await loadVendorFiles(state.assetStore, vendorDir, "react");
|
|
205748
205747
|
if (!globalThis.__reactModuleRef) {
|
|
205749
205748
|
globalThis.__reactModuleRef = await import("react");
|
|
@@ -205751,17 +205750,17 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205751
205750
|
return true;
|
|
205752
205751
|
}) : undefined;
|
|
205753
205752
|
const buildAngularVendorTask = config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
205754
|
-
const vendorDir =
|
|
205753
|
+
const vendorDir = resolve22(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
205755
205754
|
await loadVendorFiles(state.assetStore, vendorDir, "angular");
|
|
205756
205755
|
return true;
|
|
205757
205756
|
}) : undefined;
|
|
205758
205757
|
const buildSvelteVendorTask = config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
205759
|
-
const vendorDir =
|
|
205758
|
+
const vendorDir = resolve22(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
205760
205759
|
await loadVendorFiles(state.assetStore, vendorDir, "svelte");
|
|
205761
205760
|
return true;
|
|
205762
205761
|
}) : undefined;
|
|
205763
205762
|
const buildVueVendorTask = config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
205764
|
-
const vendorDir =
|
|
205763
|
+
const vendorDir = resolve22(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
205765
205764
|
await loadVendorFiles(state.assetStore, vendorDir, "vue");
|
|
205766
205765
|
return true;
|
|
205767
205766
|
}) : undefined;
|
|
@@ -205775,7 +205774,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205775
205774
|
config.htmxDirectory
|
|
205776
205775
|
].filter((dir) => Boolean(dir));
|
|
205777
205776
|
const buildDepVendorTask = buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs).then(async (depPaths) => {
|
|
205778
|
-
const vendorDir =
|
|
205777
|
+
const vendorDir = resolve22(state.resolvedPaths.buildDir, "vendor");
|
|
205779
205778
|
await loadVendorFiles(state.assetStore, vendorDir, "vendor");
|
|
205780
205779
|
globalThis.__depVendorPaths = depPaths;
|
|
205781
205780
|
return true;
|
|
@@ -205805,7 +205804,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205805
205804
|
manifest
|
|
205806
205805
|
};
|
|
205807
205806
|
globalThis.__hmrDevResult = result;
|
|
205808
|
-
globalThis.__hmrServerMtime = statSync3(
|
|
205807
|
+
globalThis.__hmrServerMtime = statSync3(resolve22(Bun.main)).mtimeMs;
|
|
205809
205808
|
return result;
|
|
205810
205809
|
};
|
|
205811
205810
|
var init_devBuild = __esm(() => {
|
|
@@ -205840,5 +205839,5 @@ export {
|
|
|
205840
205839
|
build
|
|
205841
205840
|
};
|
|
205842
205841
|
|
|
205843
|
-
//# debugId=
|
|
205842
|
+
//# debugId=4AB2B5C69E73308464756E2164756E21
|
|
205844
205843
|
//# sourceMappingURL=build.js.map
|