@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/index.js
CHANGED
|
@@ -870,7 +870,7 @@ var init_scanCssEntryPoints = () => {};
|
|
|
870
870
|
|
|
871
871
|
// src/utils/imageProcessing.ts
|
|
872
872
|
import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
|
|
873
|
-
import { join as join2 } from "path";
|
|
873
|
+
import { join as join2, resolve as resolve3 } from "path";
|
|
874
874
|
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) => {
|
|
875
875
|
for (const size of sizes) {
|
|
876
876
|
if (size >= target)
|
|
@@ -993,15 +993,14 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
993
993
|
return sharpModule;
|
|
994
994
|
sharpLoaded = true;
|
|
995
995
|
try {
|
|
996
|
-
const
|
|
997
|
-
const mod = await import(
|
|
996
|
+
const sharpPath = resolve3(process.cwd(), "node_modules/sharp");
|
|
997
|
+
const mod = await import(sharpPath);
|
|
998
998
|
sharpModule = mod.default ?? mod;
|
|
999
999
|
return sharpModule;
|
|
1000
|
-
} catch
|
|
1000
|
+
} catch {
|
|
1001
1001
|
if (sharpWarned)
|
|
1002
1002
|
return null;
|
|
1003
1003
|
sharpWarned = true;
|
|
1004
|
-
console.warn("[image] sharp load error:", err);
|
|
1005
1004
|
console.warn("[image] sharp not installed \u2014 serving unoptimized images. Install with: bun add sharp");
|
|
1006
1005
|
return null;
|
|
1007
1006
|
}
|
|
@@ -1238,18 +1237,18 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
1238
1237
|
|
|
1239
1238
|
// src/dev/buildHMRClient.ts
|
|
1240
1239
|
import { existsSync as existsSync7 } from "fs";
|
|
1241
|
-
import { resolve as
|
|
1240
|
+
import { resolve as resolve4 } from "path";
|
|
1242
1241
|
var {build: bunBuild } = globalThis.Bun;
|
|
1243
1242
|
var resolveHmrClientPath = () => {
|
|
1244
1243
|
const projectRoot = process.cwd();
|
|
1245
|
-
const fromSource =
|
|
1244
|
+
const fromSource = resolve4(import.meta.dir, "client/hmrClient.ts");
|
|
1246
1245
|
if (existsSync7(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1247
1246
|
return fromSource;
|
|
1248
1247
|
}
|
|
1249
|
-
const fromNodeModules =
|
|
1248
|
+
const fromNodeModules = resolve4(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
1250
1249
|
if (existsSync7(fromNodeModules))
|
|
1251
1250
|
return fromNodeModules;
|
|
1252
|
-
return
|
|
1251
|
+
return resolve4(import.meta.dir, "dev/client/hmrClient.ts");
|
|
1253
1252
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
1254
1253
|
const entryPoint = hmrClientPath2;
|
|
1255
1254
|
const result = await bunBuild({
|
|
@@ -1279,7 +1278,7 @@ var init_buildHMRClient = __esm(() => {
|
|
|
1279
1278
|
// src/build/nativeRewrite.ts
|
|
1280
1279
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
1281
1280
|
import { platform as platform2, arch as arch2 } from "os";
|
|
1282
|
-
import { resolve as
|
|
1281
|
+
import { resolve as resolve5 } from "path";
|
|
1283
1282
|
var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
1284
1283
|
if (nativeLib !== null)
|
|
1285
1284
|
return nativeLib;
|
|
@@ -1297,7 +1296,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
|
1297
1296
|
if (!libPath)
|
|
1298
1297
|
return null;
|
|
1299
1298
|
try {
|
|
1300
|
-
const fullPath =
|
|
1299
|
+
const fullPath = resolve5(import.meta.dir, "../../native/packages", libPath);
|
|
1301
1300
|
const lib = dlopen(fullPath, ffiDefinition);
|
|
1302
1301
|
nativeLib = lib.symbols;
|
|
1303
1302
|
return nativeLib;
|
|
@@ -1440,11 +1439,11 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
1440
1439
|
|
|
1441
1440
|
// src/build/angularLinkerPlugin.ts
|
|
1442
1441
|
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
1443
|
-
import { dirname as dirname2, join as join5, relative as relative2, resolve as
|
|
1442
|
+
import { dirname as dirname2, join as join5, relative as relative2, resolve as resolve6 } from "path";
|
|
1444
1443
|
import { createHash } from "crypto";
|
|
1445
1444
|
var CACHE_DIR, angularLinkerPlugin;
|
|
1446
1445
|
var init_angularLinkerPlugin = __esm(() => {
|
|
1447
|
-
CACHE_DIR =
|
|
1446
|
+
CACHE_DIR = resolve6(".absolutejs", "cache", "angular-linker");
|
|
1448
1447
|
angularLinkerPlugin = {
|
|
1449
1448
|
name: "angular-linker",
|
|
1450
1449
|
setup(bld) {
|
|
@@ -1484,7 +1483,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1484
1483
|
exists: existsSync8,
|
|
1485
1484
|
readFile: readFileSync4,
|
|
1486
1485
|
relative: relative2,
|
|
1487
|
-
resolve:
|
|
1486
|
+
resolve: resolve6
|
|
1488
1487
|
},
|
|
1489
1488
|
linkerJitMode: false,
|
|
1490
1489
|
logger: {
|
|
@@ -1518,14 +1517,14 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1518
1517
|
|
|
1519
1518
|
// src/utils/cleanStaleOutputs.ts
|
|
1520
1519
|
import { rm as rm2 } from "fs/promises";
|
|
1521
|
-
import { resolve as
|
|
1520
|
+
import { resolve as resolve7 } from "path";
|
|
1522
1521
|
var {Glob: Glob4 } = globalThis.Bun;
|
|
1523
1522
|
var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
1524
|
-
const currentPaths = new Set(currentOutputPaths.map((path) =>
|
|
1523
|
+
const currentPaths = new Set(currentOutputPaths.map((path) => resolve7(path)));
|
|
1525
1524
|
const glob = new Glob4("**/*");
|
|
1526
1525
|
const removals = [];
|
|
1527
1526
|
for (const relative3 of glob.scanSync({ cwd: buildPath })) {
|
|
1528
|
-
const absolute =
|
|
1527
|
+
const absolute = resolve7(buildPath, relative3);
|
|
1529
1528
|
if (currentPaths.has(absolute))
|
|
1530
1529
|
continue;
|
|
1531
1530
|
if (!HASHED_FILE_PATTERN.test(relative3))
|
|
@@ -1586,10 +1585,10 @@ var commonAncestor = (paths, fallback) => {
|
|
|
1586
1585
|
var init_commonAncestor = () => {};
|
|
1587
1586
|
|
|
1588
1587
|
// src/utils/validateSafePath.ts
|
|
1589
|
-
import { resolve as
|
|
1588
|
+
import { resolve as resolve8, relative as relative3 } from "path";
|
|
1590
1589
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
1591
|
-
const absoluteBase =
|
|
1592
|
-
const absoluteTarget =
|
|
1590
|
+
const absoluteBase = resolve8(baseDirectory);
|
|
1591
|
+
const absoluteTarget = resolve8(baseDirectory, targetPath);
|
|
1593
1592
|
const relativePath = normalizePath(relative3(absoluteBase, absoluteTarget));
|
|
1594
1593
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
1595
1594
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
@@ -1611,7 +1610,7 @@ import {
|
|
|
1611
1610
|
join as join7,
|
|
1612
1611
|
basename as basename2,
|
|
1613
1612
|
extname as extname2,
|
|
1614
|
-
resolve as
|
|
1613
|
+
resolve as resolve9,
|
|
1615
1614
|
relative as relative4,
|
|
1616
1615
|
sep as sep2
|
|
1617
1616
|
} from "path";
|
|
@@ -1619,14 +1618,14 @@ import { env } from "process";
|
|
|
1619
1618
|
var {write, file: file2, Transpiler } = globalThis.Bun;
|
|
1620
1619
|
var resolveDevClientDir2 = () => {
|
|
1621
1620
|
const projectRoot = process.cwd();
|
|
1622
|
-
const fromSource =
|
|
1621
|
+
const fromSource = resolve9(import.meta.dir, "../dev/client");
|
|
1623
1622
|
if (existsSync9(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1624
1623
|
return fromSource;
|
|
1625
1624
|
}
|
|
1626
|
-
const fromNodeModules =
|
|
1625
|
+
const fromNodeModules = resolve9(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
1627
1626
|
if (existsSync9(fromNodeModules))
|
|
1628
1627
|
return fromNodeModules;
|
|
1629
|
-
return
|
|
1628
|
+
return resolve9(import.meta.dir, "./dev/client");
|
|
1630
1629
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
1631
1630
|
persistentCache.clear();
|
|
1632
1631
|
sourceHashCache.clear();
|
|
@@ -1638,7 +1637,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1638
1637
|
return false;
|
|
1639
1638
|
}
|
|
1640
1639
|
}, resolveSvelte = async (spec, from) => {
|
|
1641
|
-
const basePath =
|
|
1640
|
+
const basePath = resolve9(dirname3(from), spec);
|
|
1642
1641
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
1643
1642
|
if (!explicit) {
|
|
1644
1643
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -1848,18 +1847,18 @@ __export(exports_compileVue, {
|
|
|
1848
1847
|
});
|
|
1849
1848
|
import { existsSync as existsSync10 } from "fs";
|
|
1850
1849
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
1851
|
-
import { basename as basename3, dirname as dirname4, join as join8, relative as relative5, resolve as
|
|
1850
|
+
import { basename as basename3, dirname as dirname4, join as join8, relative as relative5, resolve as resolve10 } from "path";
|
|
1852
1851
|
var {file: file3, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
1853
1852
|
var resolveDevClientDir3 = () => {
|
|
1854
1853
|
const projectRoot = process.cwd();
|
|
1855
|
-
const fromSource =
|
|
1854
|
+
const fromSource = resolve10(import.meta.dir, "../dev/client");
|
|
1856
1855
|
if (existsSync10(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1857
1856
|
return fromSource;
|
|
1858
1857
|
}
|
|
1859
|
-
const fromNodeModules =
|
|
1858
|
+
const fromNodeModules = resolve10(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
1860
1859
|
if (existsSync10(fromNodeModules))
|
|
1861
1860
|
return fromNodeModules;
|
|
1862
|
-
return
|
|
1861
|
+
return resolve10(import.meta.dir, "./dev/client");
|
|
1863
1862
|
}, devClientDir3, hmrClientPath4, transpiler2, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
1864
1863
|
scriptCache.clear();
|
|
1865
1864
|
scriptSetupCache.clear();
|
|
@@ -1948,7 +1947,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1948
1947
|
const importPaths = extractImports(scriptSource);
|
|
1949
1948
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
1950
1949
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue"));
|
|
1951
|
-
const childBuildResults = await Promise.all(childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
1950
|
+
const childBuildResults = await Promise.all(childComponentPaths.map((relativeChildPath) => compileVueFile(resolve10(dirname4(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler)));
|
|
1952
1951
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
1953
1952
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
1954
1953
|
id: componentId,
|
|
@@ -2033,7 +2032,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
2033
2032
|
hmrId,
|
|
2034
2033
|
serverPath: serverOutputPath,
|
|
2035
2034
|
tsHelperPaths: [
|
|
2036
|
-
...helperModulePaths.map((helper) =>
|
|
2035
|
+
...helperModulePaths.map((helper) => resolve10(dirname4(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
2037
2036
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
2038
2037
|
]
|
|
2039
2038
|
};
|
|
@@ -2056,7 +2055,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
2056
2055
|
const buildCache = new Map;
|
|
2057
2056
|
const allTsHelperPaths = new Set;
|
|
2058
2057
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
2059
|
-
const result = await compileVueFile(
|
|
2058
|
+
const result = await compileVueFile(resolve10(entryPath), {
|
|
2060
2059
|
client: clientOutputDir,
|
|
2061
2060
|
css: cssOutputDir,
|
|
2062
2061
|
server: serverOutputDir
|
|
@@ -100482,14 +100481,14 @@ ${lanes.join(`
|
|
|
100482
100481
|
}
|
|
100483
100482
|
}
|
|
100484
100483
|
function createImportCallExpressionAMD(arg, containsLexicalThis) {
|
|
100485
|
-
const
|
|
100484
|
+
const resolve11 = factory2.createUniqueName("resolve");
|
|
100486
100485
|
const reject = factory2.createUniqueName("reject");
|
|
100487
100486
|
const parameters = [
|
|
100488
|
-
factory2.createParameterDeclaration(undefined, undefined,
|
|
100487
|
+
factory2.createParameterDeclaration(undefined, undefined, resolve11),
|
|
100489
100488
|
factory2.createParameterDeclaration(undefined, undefined, reject)
|
|
100490
100489
|
];
|
|
100491
100490
|
const body = factory2.createBlock([
|
|
100492
|
-
factory2.createExpressionStatement(factory2.createCallExpression(factory2.createIdentifier("require"), undefined, [factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]),
|
|
100491
|
+
factory2.createExpressionStatement(factory2.createCallExpression(factory2.createIdentifier("require"), undefined, [factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]), resolve11, reject]))
|
|
100493
100492
|
]);
|
|
100494
100493
|
let func;
|
|
100495
100494
|
if (languageVersion >= 2) {
|
|
@@ -170664,8 +170663,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
170664
170663
|
installPackage(options) {
|
|
170665
170664
|
this.packageInstallId++;
|
|
170666
170665
|
const request = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
170667
|
-
const promise = new Promise((
|
|
170668
|
-
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map)).set(this.packageInstallId, { resolve:
|
|
170666
|
+
const promise = new Promise((resolve11, reject) => {
|
|
170667
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map)).set(this.packageInstallId, { resolve: resolve11, reject });
|
|
170669
170668
|
});
|
|
170670
170669
|
this.installer.send(request);
|
|
170671
170670
|
return promise;
|
|
@@ -170932,7 +170931,7 @@ __export(exports_compileAngular, {
|
|
|
170932
170931
|
compileAngular: () => compileAngular
|
|
170933
170932
|
});
|
|
170934
170933
|
import { existsSync as existsSync11, readFileSync as readFileSync5, promises as fs } from "fs";
|
|
170935
|
-
import { join as join9, basename as basename4, sep as sep3, dirname as dirname5, resolve as
|
|
170934
|
+
import { join as join9, basename as basename4, sep as sep3, dirname as dirname5, resolve as resolve11, relative as relative6 } from "path";
|
|
170936
170935
|
import { createHash as createHash2 } from "crypto";
|
|
170937
170936
|
var import_typescript, computeConfigHash = () => {
|
|
170938
170937
|
try {
|
|
@@ -170943,14 +170942,14 @@ var import_typescript, computeConfigHash = () => {
|
|
|
170943
170942
|
}
|
|
170944
170943
|
}, resolveDevClientDir4 = () => {
|
|
170945
170944
|
const projectRoot = process.cwd();
|
|
170946
|
-
const fromSource =
|
|
170945
|
+
const fromSource = resolve11(import.meta.dir, "../dev/client");
|
|
170947
170946
|
if (existsSync11(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
170948
170947
|
return fromSource;
|
|
170949
170948
|
}
|
|
170950
|
-
const fromNodeModules =
|
|
170949
|
+
const fromNodeModules = resolve11(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
170951
170950
|
if (existsSync11(fromNodeModules))
|
|
170952
170951
|
return fromNodeModules;
|
|
170953
|
-
return
|
|
170952
|
+
return resolve11(import.meta.dir, "./dev/client");
|
|
170954
170953
|
}, devClientDir4, hmrClientPath5, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
|
|
170955
170954
|
const componentClassRegex = /(?:export\s+)?class\s+(\w+Component)\s/g;
|
|
170956
170955
|
const componentNames = [];
|
|
@@ -171012,7 +171011,7 @@ ${registrations}
|
|
|
171012
171011
|
} else {
|
|
171013
171012
|
const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
|
|
171014
171013
|
const tsRootDir = dirname5(tsPath);
|
|
171015
|
-
tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir :
|
|
171014
|
+
tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve11(tsRootDir, "lib");
|
|
171016
171015
|
const config = readConfiguration("./tsconfig.json");
|
|
171017
171016
|
options = {
|
|
171018
171017
|
emitDecoratorMetadata: true,
|
|
@@ -171058,7 +171057,7 @@ ${registrations}
|
|
|
171058
171057
|
};
|
|
171059
171058
|
}
|
|
171060
171059
|
const emitted = {};
|
|
171061
|
-
const resolvedOutDir =
|
|
171060
|
+
const resolvedOutDir = resolve11(outDir);
|
|
171062
171061
|
host.writeFile = (fileName, text) => {
|
|
171063
171062
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
171064
171063
|
emitted[relativePath] = text;
|
|
@@ -171134,7 +171133,7 @@ ${registrations}
|
|
|
171134
171133
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir) => {
|
|
171135
171134
|
const allOutputs = [];
|
|
171136
171135
|
const visited = new Set;
|
|
171137
|
-
const baseDir =
|
|
171136
|
+
const baseDir = resolve11(rootDir ?? process.cwd());
|
|
171138
171137
|
const angularTranspiler = new Bun.Transpiler({
|
|
171139
171138
|
loader: "ts",
|
|
171140
171139
|
tsconfig: JSON.stringify({
|
|
@@ -171145,7 +171144,7 @@ ${registrations}
|
|
|
171145
171144
|
})
|
|
171146
171145
|
});
|
|
171147
171146
|
const transpileFile = async (filePath) => {
|
|
171148
|
-
const resolved =
|
|
171147
|
+
const resolved = resolve11(filePath);
|
|
171149
171148
|
if (visited.has(resolved))
|
|
171150
171149
|
return;
|
|
171151
171150
|
visited.add(resolved);
|
|
@@ -171197,7 +171196,7 @@ ${registrations}
|
|
|
171197
171196
|
}
|
|
171198
171197
|
const inputDirForResolve = dirname5(actualPath);
|
|
171199
171198
|
await Promise.all(localImports.map((imp) => {
|
|
171200
|
-
const importPath =
|
|
171199
|
+
const importPath = resolve11(inputDirForResolve, imp);
|
|
171201
171200
|
return transpileFile(importPath);
|
|
171202
171201
|
}));
|
|
171203
171202
|
};
|
|
@@ -171634,7 +171633,7 @@ import {
|
|
|
171634
171633
|
statSync,
|
|
171635
171634
|
writeFileSync as writeFileSync4
|
|
171636
171635
|
} from "fs";
|
|
171637
|
-
import { basename as basename5, join as join14, relative as relative7, resolve as
|
|
171636
|
+
import { basename as basename5, join as join14, relative as relative7, resolve as resolve12 } from "path";
|
|
171638
171637
|
import { cwd, env as env2, exit } from "process";
|
|
171639
171638
|
var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
|
|
171640
171639
|
var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
|
|
@@ -171672,8 +171671,8 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171672
171671
|
}
|
|
171673
171672
|
}, resolveAbsoluteVersion = async () => {
|
|
171674
171673
|
const candidates = [
|
|
171675
|
-
|
|
171676
|
-
|
|
171674
|
+
resolve12(import.meta.dir, "..", "..", "package.json"),
|
|
171675
|
+
resolve12(import.meta.dir, "..", "package.json")
|
|
171677
171676
|
];
|
|
171678
171677
|
for (const candidate of candidates) {
|
|
171679
171678
|
const pkg = await tryReadPackageJson(candidate);
|
|
@@ -171685,7 +171684,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171685
171684
|
return;
|
|
171686
171685
|
}
|
|
171687
171686
|
}, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
171688
|
-
const absPath =
|
|
171687
|
+
const absPath = resolve12(file4, "..", relPath);
|
|
171689
171688
|
try {
|
|
171690
171689
|
statSync(absPath);
|
|
171691
171690
|
workerPaths.add(absPath);
|
|
@@ -171746,7 +171745,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171746
171745
|
}
|
|
171747
171746
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
171748
171747
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
171749
|
-
const pagesRel = relative7(process.cwd(),
|
|
171748
|
+
const pagesRel = relative7(process.cwd(), resolve12(reactPagesPath)).replace(/\\/g, "/");
|
|
171750
171749
|
for (const file4 of indexFiles) {
|
|
171751
171750
|
let content = readFileSync6(join14(reactIndexesPath, file4), "utf-8");
|
|
171752
171751
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -171754,27 +171753,27 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171754
171753
|
}
|
|
171755
171754
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
171756
171755
|
const svelteIndexDir = join14(svelteDir, "generated", "indexes");
|
|
171757
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
171756
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve12(file4).startsWith(resolve12(sveltePagesPath)));
|
|
171758
171757
|
for (const entry of sveltePageEntries) {
|
|
171759
171758
|
const name = basename5(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
171760
171759
|
const indexFile = join14(svelteIndexDir, "pages", `${name}.js`);
|
|
171761
171760
|
if (!existsSync12(indexFile))
|
|
171762
171761
|
continue;
|
|
171763
171762
|
let content = readFileSync6(indexFile, "utf-8");
|
|
171764
|
-
const srcRel = relative7(process.cwd(),
|
|
171763
|
+
const srcRel = relative7(process.cwd(), resolve12(entry)).replace(/\\/g, "/");
|
|
171765
171764
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
171766
171765
|
writeFileSync4(join14(devIndexDir, `${name}.svelte.js`), content);
|
|
171767
171766
|
}
|
|
171768
171767
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
171769
171768
|
const vueIndexDir = join14(vueDir, "generated", "indexes");
|
|
171770
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
171769
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve12(file4).startsWith(resolve12(vuePagesPath)));
|
|
171771
171770
|
for (const entry of vuePageEntries) {
|
|
171772
171771
|
const name = basename5(entry, ".vue");
|
|
171773
171772
|
const indexFile = join14(vueIndexDir, `${name}.js`);
|
|
171774
171773
|
if (!existsSync12(indexFile))
|
|
171775
171774
|
continue;
|
|
171776
171775
|
let content = readFileSync6(indexFile, "utf-8");
|
|
171777
|
-
const srcRel = relative7(process.cwd(),
|
|
171776
|
+
const srcRel = relative7(process.cwd(), resolve12(entry)).replace(/\\/g, "/");
|
|
171778
171777
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
171779
171778
|
writeFileSync4(join14(devIndexDir, `${name}.vue.js`), content);
|
|
171780
171779
|
}
|
|
@@ -171787,7 +171786,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171787
171786
|
const last = allComments[allComments.length - 1];
|
|
171788
171787
|
if (!last?.[1])
|
|
171789
171788
|
return JSON.stringify(outputPath);
|
|
171790
|
-
const srcPath =
|
|
171789
|
+
const srcPath = resolve12(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
171791
171790
|
return JSON.stringify(srcPath);
|
|
171792
171791
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
171793
171792
|
let depth = 0;
|
|
@@ -171992,13 +171991,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
171992
171991
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
171993
171992
|
if (!isIncremental || !incrementalFiles)
|
|
171994
171993
|
return entryPoints;
|
|
171995
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f) =>
|
|
171994
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve12(f)));
|
|
171996
171995
|
const matchingEntries = [];
|
|
171997
171996
|
for (const entry of entryPoints) {
|
|
171998
171997
|
const sourceFile = mapToSource(entry);
|
|
171999
171998
|
if (!sourceFile)
|
|
172000
171999
|
continue;
|
|
172001
|
-
if (!normalizedIncremental.has(
|
|
172000
|
+
if (!normalizedIncremental.has(resolve12(sourceFile)))
|
|
172002
172001
|
continue;
|
|
172003
172002
|
matchingEntries.push(entry);
|
|
172004
172003
|
}
|
|
@@ -172045,7 +172044,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
172045
172044
|
]);
|
|
172046
172045
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/html/") && (f.endsWith(".html") || f.endsWith(".css")));
|
|
172047
172046
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
172048
|
-
if (entry.startsWith(
|
|
172047
|
+
if (entry.startsWith(resolve12(reactIndexesPath))) {
|
|
172049
172048
|
const pageName = basename5(entry, ".tsx");
|
|
172050
172049
|
return join14(reactPagesPath, `${pageName}.tsx`);
|
|
172051
172050
|
}
|
|
@@ -172509,7 +172508,7 @@ var init_build = __esm(() => {
|
|
|
172509
172508
|
// src/dev/dependencyGraph.ts
|
|
172510
172509
|
import { existsSync as existsSync13, readFileSync as readFileSync7 } from "fs";
|
|
172511
172510
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
172512
|
-
import { resolve as
|
|
172511
|
+
import { resolve as resolve13 } from "path";
|
|
172513
172512
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
172514
172513
|
const lower = filePath.toLowerCase();
|
|
172515
172514
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -172523,8 +172522,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172523
172522
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
172524
172523
|
return null;
|
|
172525
172524
|
}
|
|
172526
|
-
const fromDir =
|
|
172527
|
-
const normalized =
|
|
172525
|
+
const fromDir = resolve13(fromFile, "..");
|
|
172526
|
+
const normalized = resolve13(fromDir, importPath);
|
|
172528
172527
|
const extensions = [
|
|
172529
172528
|
".ts",
|
|
172530
172529
|
".tsx",
|
|
@@ -172554,7 +172553,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172554
172553
|
dependents.delete(normalizedPath);
|
|
172555
172554
|
}
|
|
172556
172555
|
}, addFileToGraph = (graph, filePath) => {
|
|
172557
|
-
const normalizedPath =
|
|
172556
|
+
const normalizedPath = resolve13(filePath);
|
|
172558
172557
|
if (!existsSync13(normalizedPath))
|
|
172559
172558
|
return;
|
|
172560
172559
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -172571,10 +172570,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172571
172570
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
172572
172571
|
const processedFiles = new Set;
|
|
172573
172572
|
const glob = new Glob6("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
172574
|
-
const resolvedDirs = directories.map((dir) =>
|
|
172573
|
+
const resolvedDirs = directories.map((dir) => resolve13(dir)).filter((dir) => existsSync13(dir));
|
|
172575
172574
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
172576
172575
|
for (const file4 of allFiles) {
|
|
172577
|
-
const fullPath =
|
|
172576
|
+
const fullPath = resolve13(file4);
|
|
172578
172577
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
172579
172578
|
continue;
|
|
172580
172579
|
if (processedFiles.has(fullPath))
|
|
@@ -172687,7 +172686,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172687
172686
|
return [];
|
|
172688
172687
|
}
|
|
172689
172688
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
172690
|
-
const normalizedPath =
|
|
172689
|
+
const normalizedPath = resolve13(changedFile);
|
|
172691
172690
|
const affected = new Set;
|
|
172692
172691
|
const toProcess = [normalizedPath];
|
|
172693
172692
|
const processNode = (current) => {
|
|
@@ -172727,7 +172726,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172727
172726
|
}
|
|
172728
172727
|
graph.dependents.delete(normalizedPath);
|
|
172729
172728
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
172730
|
-
const normalizedPath =
|
|
172729
|
+
const normalizedPath = resolve13(filePath);
|
|
172731
172730
|
removeDepsForFile(graph, normalizedPath);
|
|
172732
172731
|
removeDependentsForFile(graph, normalizedPath);
|
|
172733
172732
|
};
|
|
@@ -172770,12 +172769,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
172770
172769
|
};
|
|
172771
172770
|
|
|
172772
172771
|
// src/dev/configResolver.ts
|
|
172773
|
-
import { resolve as
|
|
172772
|
+
import { resolve as resolve14 } from "path";
|
|
172774
172773
|
var resolveBuildPaths = (config) => {
|
|
172775
172774
|
const cwd2 = process.cwd();
|
|
172776
172775
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
172777
|
-
const withDefault = (value, fallback) => normalize(
|
|
172778
|
-
const optional = (value) => value ? normalize(
|
|
172776
|
+
const withDefault = (value, fallback) => normalize(resolve14(cwd2, value ?? fallback));
|
|
172777
|
+
const optional = (value) => value ? normalize(resolve14(cwd2, value)) : undefined;
|
|
172779
172778
|
return {
|
|
172780
172779
|
angularDir: optional(config.angularDirectory),
|
|
172781
172780
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -172963,7 +172962,7 @@ var init_pathUtils = __esm(() => {
|
|
|
172963
172962
|
// src/dev/fileWatcher.ts
|
|
172964
172963
|
import { watch } from "fs";
|
|
172965
172964
|
import { existsSync as existsSync14 } from "fs";
|
|
172966
|
-
import { join as join15, resolve as
|
|
172965
|
+
import { join as join15, resolve as resolve15 } from "path";
|
|
172967
172966
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
172968
172967
|
try {
|
|
172969
172968
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -173008,7 +173007,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
173008
173007
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
173009
173008
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
173010
173009
|
paths.forEach((path) => {
|
|
173011
|
-
const absolutePath =
|
|
173010
|
+
const absolutePath = resolve15(path).replace(/\\/g, "/");
|
|
173012
173011
|
if (!existsSync14(absolutePath)) {
|
|
173013
173012
|
return;
|
|
173014
173013
|
}
|
|
@@ -173019,7 +173018,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
173019
173018
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
173020
173019
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
173021
173020
|
watchPaths.forEach((path) => {
|
|
173022
|
-
const absolutePath =
|
|
173021
|
+
const absolutePath = resolve15(path).replace(/\\/g, "/");
|
|
173023
173022
|
if (!existsSync14(absolutePath)) {
|
|
173024
173023
|
return;
|
|
173025
173024
|
}
|
|
@@ -173034,13 +173033,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
173034
173033
|
});
|
|
173035
173034
|
|
|
173036
173035
|
// src/dev/assetStore.ts
|
|
173037
|
-
import { resolve as
|
|
173036
|
+
import { resolve as resolve16 } from "path";
|
|
173038
173037
|
import { readdir as readdir2, unlink } from "fs/promises";
|
|
173039
173038
|
var mimeTypes, getMimeType = (filePath) => {
|
|
173040
173039
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
173041
173040
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
173042
173041
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
173043
|
-
const fullPath =
|
|
173042
|
+
const fullPath = resolve16(dir, entry.name);
|
|
173044
173043
|
if (entry.isDirectory()) {
|
|
173045
173044
|
return walkAndClean(fullPath);
|
|
173046
173045
|
}
|
|
@@ -173056,10 +173055,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
173056
173055
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
173057
173056
|
const liveByIdentity = new Map;
|
|
173058
173057
|
for (const webPath of store.keys()) {
|
|
173059
|
-
const diskPath =
|
|
173058
|
+
const diskPath = resolve16(buildDir, webPath.slice(1));
|
|
173060
173059
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
173061
173060
|
}
|
|
173062
|
-
const absBuildDir =
|
|
173061
|
+
const absBuildDir = resolve16(buildDir);
|
|
173063
173062
|
Object.values(manifest).forEach((val) => {
|
|
173064
173063
|
if (!HASHED_FILE_RE.test(val))
|
|
173065
173064
|
return;
|
|
@@ -173077,7 +173076,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
173077
173076
|
} catch {}
|
|
173078
173077
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
173079
173078
|
if (entry.isDirectory()) {
|
|
173080
|
-
return scanDir(
|
|
173079
|
+
return scanDir(resolve16(dir, entry.name), `${prefix}${entry.name}/`);
|
|
173081
173080
|
}
|
|
173082
173081
|
if (!entry.name.startsWith("chunk-")) {
|
|
173083
173082
|
return null;
|
|
@@ -173086,7 +173085,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
173086
173085
|
if (store.has(webPath)) {
|
|
173087
173086
|
return null;
|
|
173088
173087
|
}
|
|
173089
|
-
return Bun.file(
|
|
173088
|
+
return Bun.file(resolve16(dir, entry.name)).bytes().then((bytes) => {
|
|
173090
173089
|
store.set(webPath, bytes);
|
|
173091
173090
|
return;
|
|
173092
173091
|
}).catch(() => {});
|
|
@@ -173111,7 +173110,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
173111
173110
|
for (const webPath of newIdentities.values()) {
|
|
173112
173111
|
if (store.has(webPath))
|
|
173113
173112
|
continue;
|
|
173114
|
-
loadPromises.push(Bun.file(
|
|
173113
|
+
loadPromises.push(Bun.file(resolve16(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
173115
173114
|
store.set(webPath, bytes);
|
|
173116
173115
|
return;
|
|
173117
173116
|
}).catch(() => {}));
|
|
@@ -173162,9 +173161,9 @@ var init_fileHashTracker = __esm(() => {
|
|
|
173162
173161
|
});
|
|
173163
173162
|
|
|
173164
173163
|
// src/dev/reactComponentClassifier.ts
|
|
173165
|
-
import { resolve as
|
|
173164
|
+
import { resolve as resolve17 } from "path";
|
|
173166
173165
|
var classifyComponent = (filePath) => {
|
|
173167
|
-
const normalizedPath =
|
|
173166
|
+
const normalizedPath = resolve17(filePath);
|
|
173168
173167
|
if (normalizedPath.includes("/react/pages/")) {
|
|
173169
173168
|
return "server";
|
|
173170
173169
|
}
|
|
@@ -173176,7 +173175,7 @@ var classifyComponent = (filePath) => {
|
|
|
173176
173175
|
var init_reactComponentClassifier = () => {};
|
|
173177
173176
|
|
|
173178
173177
|
// src/dev/moduleMapper.ts
|
|
173179
|
-
import { basename as basename6, resolve as
|
|
173178
|
+
import { basename as basename6, resolve as resolve18 } from "path";
|
|
173180
173179
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
173181
173180
|
const modulePaths = {};
|
|
173182
173181
|
moduleKeys.forEach((key) => {
|
|
@@ -173186,7 +173185,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
173186
173185
|
});
|
|
173187
173186
|
return modulePaths;
|
|
173188
173187
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
173189
|
-
const normalizedFile =
|
|
173188
|
+
const normalizedFile = resolve18(sourceFile);
|
|
173190
173189
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
173191
173190
|
if (processedFiles.has(normalizedFile)) {
|
|
173192
173191
|
return null;
|
|
@@ -173222,7 +173221,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
173222
173221
|
});
|
|
173223
173222
|
return grouped;
|
|
173224
173223
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
173225
|
-
const normalizedFile =
|
|
173224
|
+
const normalizedFile = resolve18(sourceFile);
|
|
173226
173225
|
const fileName = basename6(normalizedFile);
|
|
173227
173226
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
173228
173227
|
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 resolve19, 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(resolve19(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 = resolve19(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 = resolve19(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(resolve19(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 = resolve19(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 = resolve19(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 ? resolve19(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 = resolve19(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 ? resolve19(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(resolve19(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(resolve19(projectRoot, match[1]));
|
|
203834
203833
|
}
|
|
203835
203834
|
return files;
|
|
203836
203835
|
}, invalidateModule = (filePath) => {
|
|
203837
|
-
const resolved =
|
|
203836
|
+
const resolved = resolve19(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 resolve20 } from "path";
|
|
203904
203903
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
203905
203904
|
let htmlContent;
|
|
203906
203905
|
try {
|
|
203907
|
-
const resolvedPath =
|
|
203906
|
+
const resolvedPath = resolve20(htmlFilePath);
|
|
203908
203907
|
const file4 = Bun.file(resolvedPath);
|
|
203909
203908
|
if (!await file4.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 resolve21 } from "path";
|
|
203934
203933
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
203935
203934
|
let htmlContent;
|
|
203936
203935
|
try {
|
|
203937
|
-
const resolvedPath =
|
|
203936
|
+
const resolvedPath = resolve21(htmxFilePath);
|
|
203938
203937
|
const file4 = Bun.file(resolvedPath);
|
|
203939
203938
|
if (!await file4.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 resolve22 } 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 = resolve22(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 = resolve22(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(resolve22(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(resolve22(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((file4) => file4.endsWith(".ts") &&
|
|
204209
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve22(file4).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((file4) => {
|
|
204219
|
-
if (file4.endsWith(".ts") &&
|
|
204218
|
+
if (file4.endsWith(".ts") && resolve22(file4).startsWith(angularPagesPath)) {
|
|
204220
204219
|
resolvedPages.add(file4);
|
|
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)] = resolve22(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((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
204308
204307
|
for (const file4 of angularFiles) {
|
|
204309
|
-
state.fileHashes.set(
|
|
204308
|
+
state.fileHashes.set(resolve22(file4), computeFileHash(file4));
|
|
204310
204309
|
}
|
|
204311
|
-
const angularPagesPath =
|
|
204310
|
+
const angularPagesPath = resolve22(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(resolve22(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 = resolve22(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 = resolve22(reactIndexesPath, `${pageName}.tsx`);
|
|
204345
204344
|
if (existsSync16(indexPath) && !reactEntries.includes(indexPath)) {
|
|
204346
204345
|
reactEntries.push(indexPath);
|
|
204347
204346
|
}
|
|
204348
204347
|
});
|
|
204349
204348
|
}, resolveReactEntryForFile = (state, file4, pagesPathResolved, reactIndexesPath, reactEntries) => {
|
|
204350
|
-
const normalized =
|
|
204349
|
+
const normalized = resolve22(file4);
|
|
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 = resolve22(reactPagesPath);
|
|
204362
204361
|
filesToRebuild.forEach((file4) => {
|
|
204363
204362
|
resolveReactEntryForFile(state, file4, 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 = resolve22(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(resolve22(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(resolve22(primaryFile));
|
|
204423
204422
|
return nearest ?? primaryFile;
|
|
204424
204423
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
204425
204424
|
for (const file4 of reactFiles) {
|
|
204426
|
-
state.fileHashes.set(
|
|
204425
|
+
state.fileHashes.set(resolve22(file4), computeFileHash(file4));
|
|
204427
204426
|
}
|
|
204428
204427
|
invalidateReactSsrCache();
|
|
204429
204428
|
const primaryFile = reactFiles.find((file4) => !file4.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 = resolve22(reactDir, "pages");
|
|
204468
|
+
const reactIndexesPath = resolve22(reactDir, "generated", "indexes");
|
|
204470
204469
|
const { buildDir } = state.resolvedPaths;
|
|
204471
204470
|
const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, 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(resolve22(reactDir, "generated"), { force: true, recursive: true });
|
|
204482
204481
|
const { manifest } = state;
|
|
204483
204482
|
const duration = Date.now() - startTime;
|
|
204484
204483
|
const reactPageFiles = reactFiles.filter((file4) => file4.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 file4 of svelteFiles) {
|
|
204533
|
-
state.fileHashes.set(
|
|
204532
|
+
state.fileHashes.set(resolve22(file4), computeFileHash(file4));
|
|
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 = resolve22(svelteDir, "generated", "server");
|
|
204559
|
+
const serverOutDir = resolve22(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(resolve22(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 file4 of [...vueFiles, ...nonVueFiles]) {
|
|
204648
|
-
state.fileHashes.set(
|
|
204647
|
+
state.fileHashes.set(resolve22(file4), computeFileHash(file4));
|
|
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 resolve22(state.resolvedPaths.buildDir, "pages");
|
|
204758
204757
|
}
|
|
204759
204758
|
const dirName = framework === "html" ? basename8(config.htmlDirectory ?? "html") : basename8(config.htmxDirectory ?? "htmx");
|
|
204760
|
-
return
|
|
204759
|
+
return resolve22(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 = resolve22(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(resolve22(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 = resolve22(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 = resolve22(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 resolve23 } 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 = resolve23(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(resolve23(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
|
+
resolve23(import.meta.dir, "..", "..", "package.json"),
|
|
205692
|
+
resolve23(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(resolve23(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 = resolve23(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 = resolve23(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 = resolve23(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 = resolve23(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 = resolve23(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(resolve23(Bun.main)).mtimeMs;
|
|
205809
205808
|
return result;
|
|
205810
205809
|
};
|
|
205811
205810
|
var init_devBuild = __esm(() => {
|
|
@@ -205948,7 +205947,7 @@ __export(exports_imageOptimizer, {
|
|
|
205948
205947
|
imageOptimizer: () => imageOptimizer
|
|
205949
205948
|
});
|
|
205950
205949
|
import { existsSync as existsSync17 } from "fs";
|
|
205951
|
-
import { resolve as
|
|
205950
|
+
import { resolve as resolve24 } from "path";
|
|
205952
205951
|
import { Elysia } from "elysia";
|
|
205953
205952
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
205954
205953
|
try {
|
|
@@ -205961,7 +205960,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
205961
205960
|
}
|
|
205962
205961
|
}, resolveLocalImage = (url, buildDir) => {
|
|
205963
205962
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
205964
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
205963
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve24(process.cwd()));
|
|
205965
205964
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
205966
205965
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
205967
205966
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -206616,7 +206615,7 @@ var handleHTMLPageRequest = (pagePath) => file(pagePath);
|
|
|
206616
206615
|
var handleHTMXPageRequest = (pagePath) => file(pagePath);
|
|
206617
206616
|
// src/core/prepare.ts
|
|
206618
206617
|
import { existsSync as existsSync18, readdirSync as readdirSync2, readFileSync as readFileSync11 } from "fs";
|
|
206619
|
-
import { basename as basename9, join as join19, relative as relative10, resolve as
|
|
206618
|
+
import { basename as basename9, join as join19, relative as relative10, resolve as resolve25 } from "path";
|
|
206620
206619
|
|
|
206621
206620
|
// src/utils/loadConfig.ts
|
|
206622
206621
|
import { resolve } from "path";
|
|
@@ -206657,7 +206656,7 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
206657
206656
|
for (const { dir, pattern } of prewarmDirs) {
|
|
206658
206657
|
const glob = new Glob8(pattern);
|
|
206659
206658
|
const matches = [
|
|
206660
|
-
...glob.scanSync({ absolute: true, cwd:
|
|
206659
|
+
...glob.scanSync({ absolute: true, cwd: resolve25(dir) })
|
|
206661
206660
|
];
|
|
206662
206661
|
files.push(...matches);
|
|
206663
206662
|
}
|
|
@@ -206693,7 +206692,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
206693
206692
|
const fileName = resolveDevIndexFileName(manifest[key], baseName);
|
|
206694
206693
|
if (!fileName)
|
|
206695
206694
|
continue;
|
|
206696
|
-
const srcPath =
|
|
206695
|
+
const srcPath = resolve25(devIndexDir, fileName);
|
|
206697
206696
|
if (!existsSync18(srcPath))
|
|
206698
206697
|
continue;
|
|
206699
206698
|
const rel = relative10(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
@@ -206737,7 +206736,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
206737
206736
|
};
|
|
206738
206737
|
}
|
|
206739
206738
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
206740
|
-
const devIndexDir =
|
|
206739
|
+
const devIndexDir = resolve25(buildDir, "_src_indexes");
|
|
206741
206740
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
206742
206741
|
const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
206743
206742
|
return {
|
|
@@ -206770,7 +206769,7 @@ var prepare = async (configOrPath) => {
|
|
|
206770
206769
|
const config = await loadConfig(configOrPath);
|
|
206771
206770
|
const nodeEnv = process.env["NODE_ENV"];
|
|
206772
206771
|
const isDev2 = nodeEnv === "development";
|
|
206773
|
-
const buildDir =
|
|
206772
|
+
const buildDir = resolve25(isDev2 ? config.buildDirectory ?? "build" : process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
206774
206773
|
if (isDev2)
|
|
206775
206774
|
return prepareDev(config, buildDir);
|
|
206776
206775
|
const manifest = JSON.parse(readFileSync11(`${buildDir}/manifest.json`, "utf-8"));
|
|
@@ -207110,5 +207109,5 @@ export {
|
|
|
207110
207109
|
ANGULAR_INIT_TIMEOUT_MS
|
|
207111
207110
|
};
|
|
207112
207111
|
|
|
207113
|
-
//# debugId=
|
|
207112
|
+
//# debugId=3A1517BF8B920B2364756E2164756E21
|
|
207114
207113
|
//# sourceMappingURL=index.js.map
|