@absolutejs/absolute 0.19.0-beta.187 → 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 +4 -4
- package/dist/src/angular/components/index.js.map +3 -3
- package/dist/src/build.js +146 -146
- package/dist/src/build.js.map +3 -3
- package/dist/src/index.js +153 -153
- 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,8 +993,8 @@ 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
1000
|
} catch {
|
|
@@ -1237,18 +1237,18 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
1237
1237
|
|
|
1238
1238
|
// src/dev/buildHMRClient.ts
|
|
1239
1239
|
import { existsSync as existsSync7 } from "fs";
|
|
1240
|
-
import { resolve as
|
|
1240
|
+
import { resolve as resolve4 } from "path";
|
|
1241
1241
|
var {build: bunBuild } = globalThis.Bun;
|
|
1242
1242
|
var resolveHmrClientPath = () => {
|
|
1243
1243
|
const projectRoot = process.cwd();
|
|
1244
|
-
const fromSource =
|
|
1244
|
+
const fromSource = resolve4(import.meta.dir, "client/hmrClient.ts");
|
|
1245
1245
|
if (existsSync7(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1246
1246
|
return fromSource;
|
|
1247
1247
|
}
|
|
1248
|
-
const fromNodeModules =
|
|
1248
|
+
const fromNodeModules = resolve4(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
1249
1249
|
if (existsSync7(fromNodeModules))
|
|
1250
1250
|
return fromNodeModules;
|
|
1251
|
-
return
|
|
1251
|
+
return resolve4(import.meta.dir, "dev/client/hmrClient.ts");
|
|
1252
1252
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
1253
1253
|
const entryPoint = hmrClientPath2;
|
|
1254
1254
|
const result = await bunBuild({
|
|
@@ -1278,7 +1278,7 @@ var init_buildHMRClient = __esm(() => {
|
|
|
1278
1278
|
// src/build/nativeRewrite.ts
|
|
1279
1279
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
1280
1280
|
import { platform as platform2, arch as arch2 } from "os";
|
|
1281
|
-
import { resolve as
|
|
1281
|
+
import { resolve as resolve5 } from "path";
|
|
1282
1282
|
var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
1283
1283
|
if (nativeLib !== null)
|
|
1284
1284
|
return nativeLib;
|
|
@@ -1296,7 +1296,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
|
1296
1296
|
if (!libPath)
|
|
1297
1297
|
return null;
|
|
1298
1298
|
try {
|
|
1299
|
-
const fullPath =
|
|
1299
|
+
const fullPath = resolve5(import.meta.dir, "../../native/packages", libPath);
|
|
1300
1300
|
const lib = dlopen(fullPath, ffiDefinition);
|
|
1301
1301
|
nativeLib = lib.symbols;
|
|
1302
1302
|
return nativeLib;
|
|
@@ -1439,11 +1439,11 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
1439
1439
|
|
|
1440
1440
|
// src/build/angularLinkerPlugin.ts
|
|
1441
1441
|
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
1442
|
-
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";
|
|
1443
1443
|
import { createHash } from "crypto";
|
|
1444
1444
|
var CACHE_DIR, angularLinkerPlugin;
|
|
1445
1445
|
var init_angularLinkerPlugin = __esm(() => {
|
|
1446
|
-
CACHE_DIR =
|
|
1446
|
+
CACHE_DIR = resolve6(".absolutejs", "cache", "angular-linker");
|
|
1447
1447
|
angularLinkerPlugin = {
|
|
1448
1448
|
name: "angular-linker",
|
|
1449
1449
|
setup(bld) {
|
|
@@ -1483,7 +1483,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1483
1483
|
exists: existsSync8,
|
|
1484
1484
|
readFile: readFileSync4,
|
|
1485
1485
|
relative: relative2,
|
|
1486
|
-
resolve:
|
|
1486
|
+
resolve: resolve6
|
|
1487
1487
|
},
|
|
1488
1488
|
linkerJitMode: false,
|
|
1489
1489
|
logger: {
|
|
@@ -1517,14 +1517,14 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
1517
1517
|
|
|
1518
1518
|
// src/utils/cleanStaleOutputs.ts
|
|
1519
1519
|
import { rm as rm2 } from "fs/promises";
|
|
1520
|
-
import { resolve as
|
|
1520
|
+
import { resolve as resolve7 } from "path";
|
|
1521
1521
|
var {Glob: Glob4 } = globalThis.Bun;
|
|
1522
1522
|
var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
1523
|
-
const currentPaths = new Set(currentOutputPaths.map((path) =>
|
|
1523
|
+
const currentPaths = new Set(currentOutputPaths.map((path) => resolve7(path)));
|
|
1524
1524
|
const glob = new Glob4("**/*");
|
|
1525
1525
|
const removals = [];
|
|
1526
1526
|
for (const relative3 of glob.scanSync({ cwd: buildPath })) {
|
|
1527
|
-
const absolute =
|
|
1527
|
+
const absolute = resolve7(buildPath, relative3);
|
|
1528
1528
|
if (currentPaths.has(absolute))
|
|
1529
1529
|
continue;
|
|
1530
1530
|
if (!HASHED_FILE_PATTERN.test(relative3))
|
|
@@ -1585,10 +1585,10 @@ var commonAncestor = (paths, fallback) => {
|
|
|
1585
1585
|
var init_commonAncestor = () => {};
|
|
1586
1586
|
|
|
1587
1587
|
// src/utils/validateSafePath.ts
|
|
1588
|
-
import { resolve as
|
|
1588
|
+
import { resolve as resolve8, relative as relative3 } from "path";
|
|
1589
1589
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
1590
|
-
const absoluteBase =
|
|
1591
|
-
const absoluteTarget =
|
|
1590
|
+
const absoluteBase = resolve8(baseDirectory);
|
|
1591
|
+
const absoluteTarget = resolve8(baseDirectory, targetPath);
|
|
1592
1592
|
const relativePath = normalizePath(relative3(absoluteBase, absoluteTarget));
|
|
1593
1593
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
1594
1594
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
@@ -1610,7 +1610,7 @@ import {
|
|
|
1610
1610
|
join as join7,
|
|
1611
1611
|
basename as basename2,
|
|
1612
1612
|
extname as extname2,
|
|
1613
|
-
resolve as
|
|
1613
|
+
resolve as resolve9,
|
|
1614
1614
|
relative as relative4,
|
|
1615
1615
|
sep as sep2
|
|
1616
1616
|
} from "path";
|
|
@@ -1618,14 +1618,14 @@ import { env } from "process";
|
|
|
1618
1618
|
var {write, file: file2, Transpiler } = globalThis.Bun;
|
|
1619
1619
|
var resolveDevClientDir2 = () => {
|
|
1620
1620
|
const projectRoot = process.cwd();
|
|
1621
|
-
const fromSource =
|
|
1621
|
+
const fromSource = resolve9(import.meta.dir, "../dev/client");
|
|
1622
1622
|
if (existsSync9(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1623
1623
|
return fromSource;
|
|
1624
1624
|
}
|
|
1625
|
-
const fromNodeModules =
|
|
1625
|
+
const fromNodeModules = resolve9(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
1626
1626
|
if (existsSync9(fromNodeModules))
|
|
1627
1627
|
return fromNodeModules;
|
|
1628
|
-
return
|
|
1628
|
+
return resolve9(import.meta.dir, "./dev/client");
|
|
1629
1629
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
1630
1630
|
persistentCache.clear();
|
|
1631
1631
|
sourceHashCache.clear();
|
|
@@ -1637,7 +1637,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1637
1637
|
return false;
|
|
1638
1638
|
}
|
|
1639
1639
|
}, resolveSvelte = async (spec, from) => {
|
|
1640
|
-
const basePath =
|
|
1640
|
+
const basePath = resolve9(dirname3(from), spec);
|
|
1641
1641
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
1642
1642
|
if (!explicit) {
|
|
1643
1643
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -1847,18 +1847,18 @@ __export(exports_compileVue, {
|
|
|
1847
1847
|
});
|
|
1848
1848
|
import { existsSync as existsSync10 } from "fs";
|
|
1849
1849
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
1850
|
-
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";
|
|
1851
1851
|
var {file: file3, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
1852
1852
|
var resolveDevClientDir3 = () => {
|
|
1853
1853
|
const projectRoot = process.cwd();
|
|
1854
|
-
const fromSource =
|
|
1854
|
+
const fromSource = resolve10(import.meta.dir, "../dev/client");
|
|
1855
1855
|
if (existsSync10(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
1856
1856
|
return fromSource;
|
|
1857
1857
|
}
|
|
1858
|
-
const fromNodeModules =
|
|
1858
|
+
const fromNodeModules = resolve10(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
1859
1859
|
if (existsSync10(fromNodeModules))
|
|
1860
1860
|
return fromNodeModules;
|
|
1861
|
-
return
|
|
1861
|
+
return resolve10(import.meta.dir, "./dev/client");
|
|
1862
1862
|
}, devClientDir3, hmrClientPath4, transpiler2, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
1863
1863
|
scriptCache.clear();
|
|
1864
1864
|
scriptSetupCache.clear();
|
|
@@ -1947,7 +1947,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1947
1947
|
const importPaths = extractImports(scriptSource);
|
|
1948
1948
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
1949
1949
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue"));
|
|
1950
|
-
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)));
|
|
1951
1951
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
1952
1952
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
1953
1953
|
id: componentId,
|
|
@@ -2032,7 +2032,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
2032
2032
|
hmrId,
|
|
2033
2033
|
serverPath: serverOutputPath,
|
|
2034
2034
|
tsHelperPaths: [
|
|
2035
|
-
...helperModulePaths.map((helper) =>
|
|
2035
|
+
...helperModulePaths.map((helper) => resolve10(dirname4(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
2036
2036
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
2037
2037
|
]
|
|
2038
2038
|
};
|
|
@@ -2055,7 +2055,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
2055
2055
|
const buildCache = new Map;
|
|
2056
2056
|
const allTsHelperPaths = new Set;
|
|
2057
2057
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
2058
|
-
const result = await compileVueFile(
|
|
2058
|
+
const result = await compileVueFile(resolve10(entryPath), {
|
|
2059
2059
|
client: clientOutputDir,
|
|
2060
2060
|
css: cssOutputDir,
|
|
2061
2061
|
server: serverOutputDir
|
|
@@ -100481,14 +100481,14 @@ ${lanes.join(`
|
|
|
100481
100481
|
}
|
|
100482
100482
|
}
|
|
100483
100483
|
function createImportCallExpressionAMD(arg, containsLexicalThis) {
|
|
100484
|
-
const
|
|
100484
|
+
const resolve11 = factory2.createUniqueName("resolve");
|
|
100485
100485
|
const reject = factory2.createUniqueName("reject");
|
|
100486
100486
|
const parameters = [
|
|
100487
|
-
factory2.createParameterDeclaration(undefined, undefined,
|
|
100487
|
+
factory2.createParameterDeclaration(undefined, undefined, resolve11),
|
|
100488
100488
|
factory2.createParameterDeclaration(undefined, undefined, reject)
|
|
100489
100489
|
];
|
|
100490
100490
|
const body = factory2.createBlock([
|
|
100491
|
-
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]))
|
|
100492
100492
|
]);
|
|
100493
100493
|
let func;
|
|
100494
100494
|
if (languageVersion >= 2) {
|
|
@@ -170663,8 +170663,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
170663
170663
|
installPackage(options) {
|
|
170664
170664
|
this.packageInstallId++;
|
|
170665
170665
|
const request = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
170666
|
-
const promise = new Promise((
|
|
170667
|
-
(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 });
|
|
170668
170668
|
});
|
|
170669
170669
|
this.installer.send(request);
|
|
170670
170670
|
return promise;
|
|
@@ -170931,7 +170931,7 @@ __export(exports_compileAngular, {
|
|
|
170931
170931
|
compileAngular: () => compileAngular
|
|
170932
170932
|
});
|
|
170933
170933
|
import { existsSync as existsSync11, readFileSync as readFileSync5, promises as fs } from "fs";
|
|
170934
|
-
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";
|
|
170935
170935
|
import { createHash as createHash2 } from "crypto";
|
|
170936
170936
|
var import_typescript, computeConfigHash = () => {
|
|
170937
170937
|
try {
|
|
@@ -170942,14 +170942,14 @@ var import_typescript, computeConfigHash = () => {
|
|
|
170942
170942
|
}
|
|
170943
170943
|
}, resolveDevClientDir4 = () => {
|
|
170944
170944
|
const projectRoot = process.cwd();
|
|
170945
|
-
const fromSource =
|
|
170945
|
+
const fromSource = resolve11(import.meta.dir, "../dev/client");
|
|
170946
170946
|
if (existsSync11(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
170947
170947
|
return fromSource;
|
|
170948
170948
|
}
|
|
170949
|
-
const fromNodeModules =
|
|
170949
|
+
const fromNodeModules = resolve11(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
170950
170950
|
if (existsSync11(fromNodeModules))
|
|
170951
170951
|
return fromNodeModules;
|
|
170952
|
-
return
|
|
170952
|
+
return resolve11(import.meta.dir, "./dev/client");
|
|
170953
170953
|
}, devClientDir4, hmrClientPath5, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
|
|
170954
170954
|
const componentClassRegex = /(?:export\s+)?class\s+(\w+Component)\s/g;
|
|
170955
170955
|
const componentNames = [];
|
|
@@ -171011,7 +171011,7 @@ ${registrations}
|
|
|
171011
171011
|
} else {
|
|
171012
171012
|
const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
|
|
171013
171013
|
const tsRootDir = dirname5(tsPath);
|
|
171014
|
-
tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir :
|
|
171014
|
+
tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve11(tsRootDir, "lib");
|
|
171015
171015
|
const config = readConfiguration("./tsconfig.json");
|
|
171016
171016
|
options = {
|
|
171017
171017
|
emitDecoratorMetadata: true,
|
|
@@ -171057,7 +171057,7 @@ ${registrations}
|
|
|
171057
171057
|
};
|
|
171058
171058
|
}
|
|
171059
171059
|
const emitted = {};
|
|
171060
|
-
const resolvedOutDir =
|
|
171060
|
+
const resolvedOutDir = resolve11(outDir);
|
|
171061
171061
|
host.writeFile = (fileName, text) => {
|
|
171062
171062
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
171063
171063
|
emitted[relativePath] = text;
|
|
@@ -171133,7 +171133,7 @@ ${registrations}
|
|
|
171133
171133
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir) => {
|
|
171134
171134
|
const allOutputs = [];
|
|
171135
171135
|
const visited = new Set;
|
|
171136
|
-
const baseDir =
|
|
171136
|
+
const baseDir = resolve11(rootDir ?? process.cwd());
|
|
171137
171137
|
const angularTranspiler = new Bun.Transpiler({
|
|
171138
171138
|
loader: "ts",
|
|
171139
171139
|
tsconfig: JSON.stringify({
|
|
@@ -171144,7 +171144,7 @@ ${registrations}
|
|
|
171144
171144
|
})
|
|
171145
171145
|
});
|
|
171146
171146
|
const transpileFile = async (filePath) => {
|
|
171147
|
-
const resolved =
|
|
171147
|
+
const resolved = resolve11(filePath);
|
|
171148
171148
|
if (visited.has(resolved))
|
|
171149
171149
|
return;
|
|
171150
171150
|
visited.add(resolved);
|
|
@@ -171196,7 +171196,7 @@ ${registrations}
|
|
|
171196
171196
|
}
|
|
171197
171197
|
const inputDirForResolve = dirname5(actualPath);
|
|
171198
171198
|
await Promise.all(localImports.map((imp) => {
|
|
171199
|
-
const importPath =
|
|
171199
|
+
const importPath = resolve11(inputDirForResolve, imp);
|
|
171200
171200
|
return transpileFile(importPath);
|
|
171201
171201
|
}));
|
|
171202
171202
|
};
|
|
@@ -171633,7 +171633,7 @@ import {
|
|
|
171633
171633
|
statSync,
|
|
171634
171634
|
writeFileSync as writeFileSync4
|
|
171635
171635
|
} from "fs";
|
|
171636
|
-
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";
|
|
171637
171637
|
import { cwd, env as env2, exit } from "process";
|
|
171638
171638
|
var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
|
|
171639
171639
|
var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
|
|
@@ -171671,8 +171671,8 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171671
171671
|
}
|
|
171672
171672
|
}, resolveAbsoluteVersion = async () => {
|
|
171673
171673
|
const candidates = [
|
|
171674
|
-
|
|
171675
|
-
|
|
171674
|
+
resolve12(import.meta.dir, "..", "..", "package.json"),
|
|
171675
|
+
resolve12(import.meta.dir, "..", "package.json")
|
|
171676
171676
|
];
|
|
171677
171677
|
for (const candidate of candidates) {
|
|
171678
171678
|
const pkg = await tryReadPackageJson(candidate);
|
|
@@ -171684,7 +171684,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171684
171684
|
return;
|
|
171685
171685
|
}
|
|
171686
171686
|
}, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
171687
|
-
const absPath =
|
|
171687
|
+
const absPath = resolve12(file4, "..", relPath);
|
|
171688
171688
|
try {
|
|
171689
171689
|
statSync(absPath);
|
|
171690
171690
|
workerPaths.add(absPath);
|
|
@@ -171745,7 +171745,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171745
171745
|
}
|
|
171746
171746
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
171747
171747
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
171748
|
-
const pagesRel = relative7(process.cwd(),
|
|
171748
|
+
const pagesRel = relative7(process.cwd(), resolve12(reactPagesPath)).replace(/\\/g, "/");
|
|
171749
171749
|
for (const file4 of indexFiles) {
|
|
171750
171750
|
let content = readFileSync6(join14(reactIndexesPath, file4), "utf-8");
|
|
171751
171751
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -171753,27 +171753,27 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171753
171753
|
}
|
|
171754
171754
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
171755
171755
|
const svelteIndexDir = join14(svelteDir, "generated", "indexes");
|
|
171756
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
171756
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve12(file4).startsWith(resolve12(sveltePagesPath)));
|
|
171757
171757
|
for (const entry of sveltePageEntries) {
|
|
171758
171758
|
const name = basename5(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
171759
171759
|
const indexFile = join14(svelteIndexDir, "pages", `${name}.js`);
|
|
171760
171760
|
if (!existsSync12(indexFile))
|
|
171761
171761
|
continue;
|
|
171762
171762
|
let content = readFileSync6(indexFile, "utf-8");
|
|
171763
|
-
const srcRel = relative7(process.cwd(),
|
|
171763
|
+
const srcRel = relative7(process.cwd(), resolve12(entry)).replace(/\\/g, "/");
|
|
171764
171764
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
171765
171765
|
writeFileSync4(join14(devIndexDir, `${name}.svelte.js`), content);
|
|
171766
171766
|
}
|
|
171767
171767
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
171768
171768
|
const vueIndexDir = join14(vueDir, "generated", "indexes");
|
|
171769
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
171769
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve12(file4).startsWith(resolve12(vuePagesPath)));
|
|
171770
171770
|
for (const entry of vuePageEntries) {
|
|
171771
171771
|
const name = basename5(entry, ".vue");
|
|
171772
171772
|
const indexFile = join14(vueIndexDir, `${name}.js`);
|
|
171773
171773
|
if (!existsSync12(indexFile))
|
|
171774
171774
|
continue;
|
|
171775
171775
|
let content = readFileSync6(indexFile, "utf-8");
|
|
171776
|
-
const srcRel = relative7(process.cwd(),
|
|
171776
|
+
const srcRel = relative7(process.cwd(), resolve12(entry)).replace(/\\/g, "/");
|
|
171777
171777
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
171778
171778
|
writeFileSync4(join14(devIndexDir, `${name}.vue.js`), content);
|
|
171779
171779
|
}
|
|
@@ -171786,7 +171786,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171786
171786
|
const last = allComments[allComments.length - 1];
|
|
171787
171787
|
if (!last?.[1])
|
|
171788
171788
|
return JSON.stringify(outputPath);
|
|
171789
|
-
const srcPath =
|
|
171789
|
+
const srcPath = resolve12(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
171790
171790
|
return JSON.stringify(srcPath);
|
|
171791
171791
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
171792
171792
|
let depth = 0;
|
|
@@ -171991,13 +171991,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
171991
171991
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
171992
171992
|
if (!isIncremental || !incrementalFiles)
|
|
171993
171993
|
return entryPoints;
|
|
171994
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f) =>
|
|
171994
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve12(f)));
|
|
171995
171995
|
const matchingEntries = [];
|
|
171996
171996
|
for (const entry of entryPoints) {
|
|
171997
171997
|
const sourceFile = mapToSource(entry);
|
|
171998
171998
|
if (!sourceFile)
|
|
171999
171999
|
continue;
|
|
172000
|
-
if (!normalizedIncremental.has(
|
|
172000
|
+
if (!normalizedIncremental.has(resolve12(sourceFile)))
|
|
172001
172001
|
continue;
|
|
172002
172002
|
matchingEntries.push(entry);
|
|
172003
172003
|
}
|
|
@@ -172044,7 +172044,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
172044
172044
|
]);
|
|
172045
172045
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/html/") && (f.endsWith(".html") || f.endsWith(".css")));
|
|
172046
172046
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
172047
|
-
if (entry.startsWith(
|
|
172047
|
+
if (entry.startsWith(resolve12(reactIndexesPath))) {
|
|
172048
172048
|
const pageName = basename5(entry, ".tsx");
|
|
172049
172049
|
return join14(reactPagesPath, `${pageName}.tsx`);
|
|
172050
172050
|
}
|
|
@@ -172508,7 +172508,7 @@ var init_build = __esm(() => {
|
|
|
172508
172508
|
// src/dev/dependencyGraph.ts
|
|
172509
172509
|
import { existsSync as existsSync13, readFileSync as readFileSync7 } from "fs";
|
|
172510
172510
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
172511
|
-
import { resolve as
|
|
172511
|
+
import { resolve as resolve13 } from "path";
|
|
172512
172512
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
172513
172513
|
const lower = filePath.toLowerCase();
|
|
172514
172514
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -172522,8 +172522,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172522
172522
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
172523
172523
|
return null;
|
|
172524
172524
|
}
|
|
172525
|
-
const fromDir =
|
|
172526
|
-
const normalized =
|
|
172525
|
+
const fromDir = resolve13(fromFile, "..");
|
|
172526
|
+
const normalized = resolve13(fromDir, importPath);
|
|
172527
172527
|
const extensions = [
|
|
172528
172528
|
".ts",
|
|
172529
172529
|
".tsx",
|
|
@@ -172553,7 +172553,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172553
172553
|
dependents.delete(normalizedPath);
|
|
172554
172554
|
}
|
|
172555
172555
|
}, addFileToGraph = (graph, filePath) => {
|
|
172556
|
-
const normalizedPath =
|
|
172556
|
+
const normalizedPath = resolve13(filePath);
|
|
172557
172557
|
if (!existsSync13(normalizedPath))
|
|
172558
172558
|
return;
|
|
172559
172559
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -172570,10 +172570,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172570
172570
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
172571
172571
|
const processedFiles = new Set;
|
|
172572
172572
|
const glob = new Glob6("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
172573
|
-
const resolvedDirs = directories.map((dir) =>
|
|
172573
|
+
const resolvedDirs = directories.map((dir) => resolve13(dir)).filter((dir) => existsSync13(dir));
|
|
172574
172574
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
172575
172575
|
for (const file4 of allFiles) {
|
|
172576
|
-
const fullPath =
|
|
172576
|
+
const fullPath = resolve13(file4);
|
|
172577
172577
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
172578
172578
|
continue;
|
|
172579
172579
|
if (processedFiles.has(fullPath))
|
|
@@ -172686,7 +172686,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172686
172686
|
return [];
|
|
172687
172687
|
}
|
|
172688
172688
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
172689
|
-
const normalizedPath =
|
|
172689
|
+
const normalizedPath = resolve13(changedFile);
|
|
172690
172690
|
const affected = new Set;
|
|
172691
172691
|
const toProcess = [normalizedPath];
|
|
172692
172692
|
const processNode = (current) => {
|
|
@@ -172726,7 +172726,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
172726
172726
|
}
|
|
172727
172727
|
graph.dependents.delete(normalizedPath);
|
|
172728
172728
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
172729
|
-
const normalizedPath =
|
|
172729
|
+
const normalizedPath = resolve13(filePath);
|
|
172730
172730
|
removeDepsForFile(graph, normalizedPath);
|
|
172731
172731
|
removeDependentsForFile(graph, normalizedPath);
|
|
172732
172732
|
};
|
|
@@ -172769,12 +172769,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
172769
172769
|
};
|
|
172770
172770
|
|
|
172771
172771
|
// src/dev/configResolver.ts
|
|
172772
|
-
import { resolve as
|
|
172772
|
+
import { resolve as resolve14 } from "path";
|
|
172773
172773
|
var resolveBuildPaths = (config) => {
|
|
172774
172774
|
const cwd2 = process.cwd();
|
|
172775
172775
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
172776
|
-
const withDefault = (value, fallback) => normalize(
|
|
172777
|
-
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;
|
|
172778
172778
|
return {
|
|
172779
172779
|
angularDir: optional(config.angularDirectory),
|
|
172780
172780
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -172962,7 +172962,7 @@ var init_pathUtils = __esm(() => {
|
|
|
172962
172962
|
// src/dev/fileWatcher.ts
|
|
172963
172963
|
import { watch } from "fs";
|
|
172964
172964
|
import { existsSync as existsSync14 } from "fs";
|
|
172965
|
-
import { join as join15, resolve as
|
|
172965
|
+
import { join as join15, resolve as resolve15 } from "path";
|
|
172966
172966
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
172967
172967
|
try {
|
|
172968
172968
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -173007,7 +173007,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
173007
173007
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
173008
173008
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
173009
173009
|
paths.forEach((path) => {
|
|
173010
|
-
const absolutePath =
|
|
173010
|
+
const absolutePath = resolve15(path).replace(/\\/g, "/");
|
|
173011
173011
|
if (!existsSync14(absolutePath)) {
|
|
173012
173012
|
return;
|
|
173013
173013
|
}
|
|
@@ -173018,7 +173018,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
173018
173018
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
173019
173019
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
173020
173020
|
watchPaths.forEach((path) => {
|
|
173021
|
-
const absolutePath =
|
|
173021
|
+
const absolutePath = resolve15(path).replace(/\\/g, "/");
|
|
173022
173022
|
if (!existsSync14(absolutePath)) {
|
|
173023
173023
|
return;
|
|
173024
173024
|
}
|
|
@@ -173033,13 +173033,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
173033
173033
|
});
|
|
173034
173034
|
|
|
173035
173035
|
// src/dev/assetStore.ts
|
|
173036
|
-
import { resolve as
|
|
173036
|
+
import { resolve as resolve16 } from "path";
|
|
173037
173037
|
import { readdir as readdir2, unlink } from "fs/promises";
|
|
173038
173038
|
var mimeTypes, getMimeType = (filePath) => {
|
|
173039
173039
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
173040
173040
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
173041
173041
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
173042
|
-
const fullPath =
|
|
173042
|
+
const fullPath = resolve16(dir, entry.name);
|
|
173043
173043
|
if (entry.isDirectory()) {
|
|
173044
173044
|
return walkAndClean(fullPath);
|
|
173045
173045
|
}
|
|
@@ -173055,10 +173055,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
173055
173055
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
173056
173056
|
const liveByIdentity = new Map;
|
|
173057
173057
|
for (const webPath of store.keys()) {
|
|
173058
|
-
const diskPath =
|
|
173058
|
+
const diskPath = resolve16(buildDir, webPath.slice(1));
|
|
173059
173059
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
173060
173060
|
}
|
|
173061
|
-
const absBuildDir =
|
|
173061
|
+
const absBuildDir = resolve16(buildDir);
|
|
173062
173062
|
Object.values(manifest).forEach((val) => {
|
|
173063
173063
|
if (!HASHED_FILE_RE.test(val))
|
|
173064
173064
|
return;
|
|
@@ -173076,7 +173076,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
173076
173076
|
} catch {}
|
|
173077
173077
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
173078
173078
|
if (entry.isDirectory()) {
|
|
173079
|
-
return scanDir(
|
|
173079
|
+
return scanDir(resolve16(dir, entry.name), `${prefix}${entry.name}/`);
|
|
173080
173080
|
}
|
|
173081
173081
|
if (!entry.name.startsWith("chunk-")) {
|
|
173082
173082
|
return null;
|
|
@@ -173085,7 +173085,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
173085
173085
|
if (store.has(webPath)) {
|
|
173086
173086
|
return null;
|
|
173087
173087
|
}
|
|
173088
|
-
return Bun.file(
|
|
173088
|
+
return Bun.file(resolve16(dir, entry.name)).bytes().then((bytes) => {
|
|
173089
173089
|
store.set(webPath, bytes);
|
|
173090
173090
|
return;
|
|
173091
173091
|
}).catch(() => {});
|
|
@@ -173110,7 +173110,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
173110
173110
|
for (const webPath of newIdentities.values()) {
|
|
173111
173111
|
if (store.has(webPath))
|
|
173112
173112
|
continue;
|
|
173113
|
-
loadPromises.push(Bun.file(
|
|
173113
|
+
loadPromises.push(Bun.file(resolve16(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
173114
173114
|
store.set(webPath, bytes);
|
|
173115
173115
|
return;
|
|
173116
173116
|
}).catch(() => {}));
|
|
@@ -173161,9 +173161,9 @@ var init_fileHashTracker = __esm(() => {
|
|
|
173161
173161
|
});
|
|
173162
173162
|
|
|
173163
173163
|
// src/dev/reactComponentClassifier.ts
|
|
173164
|
-
import { resolve as
|
|
173164
|
+
import { resolve as resolve17 } from "path";
|
|
173165
173165
|
var classifyComponent = (filePath) => {
|
|
173166
|
-
const normalizedPath =
|
|
173166
|
+
const normalizedPath = resolve17(filePath);
|
|
173167
173167
|
if (normalizedPath.includes("/react/pages/")) {
|
|
173168
173168
|
return "server";
|
|
173169
173169
|
}
|
|
@@ -173175,7 +173175,7 @@ var classifyComponent = (filePath) => {
|
|
|
173175
173175
|
var init_reactComponentClassifier = () => {};
|
|
173176
173176
|
|
|
173177
173177
|
// src/dev/moduleMapper.ts
|
|
173178
|
-
import { basename as basename6, resolve as
|
|
173178
|
+
import { basename as basename6, resolve as resolve18 } from "path";
|
|
173179
173179
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
173180
173180
|
const modulePaths = {};
|
|
173181
173181
|
moduleKeys.forEach((key) => {
|
|
@@ -173185,7 +173185,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
173185
173185
|
});
|
|
173186
173186
|
return modulePaths;
|
|
173187
173187
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
173188
|
-
const normalizedFile =
|
|
173188
|
+
const normalizedFile = resolve18(sourceFile);
|
|
173189
173189
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
173190
173190
|
if (processedFiles.has(normalizedFile)) {
|
|
173191
173191
|
return null;
|
|
@@ -173221,7 +173221,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
173221
173221
|
});
|
|
173222
173222
|
return grouped;
|
|
173223
173223
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
173224
|
-
const normalizedFile =
|
|
173224
|
+
const normalizedFile = resolve18(sourceFile);
|
|
173225
173225
|
const fileName = basename6(normalizedFile);
|
|
173226
173226
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
173227
173227
|
const pascalName = toPascal(baseName);
|
|
@@ -203236,7 +203236,7 @@ __export(exports_moduleServer, {
|
|
|
203236
203236
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
203237
203237
|
});
|
|
203238
203238
|
import { existsSync as existsSync15, readFileSync as readFileSync10, statSync as statSync2 } from "fs";
|
|
203239
|
-
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";
|
|
203240
203240
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
203241
203241
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
203242
203242
|
const allExports = [];
|
|
@@ -203256,7 +203256,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
203256
203256
|
${stubs}
|
|
203257
203257
|
`;
|
|
203258
203258
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
203259
|
-
const found = extensions.find((ext) => existsSync15(
|
|
203259
|
+
const found = extensions.find((ext) => existsSync15(resolve19(projectRoot, srcPath + ext)));
|
|
203260
203260
|
return found ? srcPath + found : srcPath;
|
|
203261
203261
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
203262
203262
|
const entries = Object.entries(vendorPaths).sort(([a], [b]) => b.length - a.length);
|
|
@@ -203271,7 +203271,7 @@ ${stubs}
|
|
|
203271
203271
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
203272
203272
|
}, srcUrl = (relPath, projectRoot) => {
|
|
203273
203273
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
203274
|
-
const absPath =
|
|
203274
|
+
const absPath = resolve19(projectRoot, relPath);
|
|
203275
203275
|
const cached = mtimeCache.get(absPath);
|
|
203276
203276
|
if (cached !== undefined)
|
|
203277
203277
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -203283,11 +203283,11 @@ ${stubs}
|
|
|
203283
203283
|
return base;
|
|
203284
203284
|
}
|
|
203285
203285
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
203286
|
-
const absPath =
|
|
203286
|
+
const absPath = resolve19(fileDir, relPath);
|
|
203287
203287
|
const rel = relative8(projectRoot, absPath);
|
|
203288
203288
|
let srcPath = extname3(rel) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
203289
203289
|
if (extname3(srcPath) === ".svelte") {
|
|
203290
|
-
srcPath = relative8(projectRoot, resolveSvelteModulePath(
|
|
203290
|
+
srcPath = relative8(projectRoot, resolveSvelteModulePath(resolve19(projectRoot, srcPath)));
|
|
203291
203291
|
}
|
|
203292
203292
|
return srcUrl(srcPath, projectRoot);
|
|
203293
203293
|
}, rewriteImports2 = (code, filePath, projectRoot, rewriter) => {
|
|
@@ -203324,12 +203324,12 @@ ${stubs}
|
|
|
203324
203324
|
return _match;
|
|
203325
203325
|
});
|
|
203326
203326
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
203327
|
-
const absPath =
|
|
203327
|
+
const absPath = resolve19(fileDir, relPath);
|
|
203328
203328
|
const rel = relative8(projectRoot, absPath);
|
|
203329
203329
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
203330
203330
|
});
|
|
203331
203331
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
203332
|
-
const absPath =
|
|
203332
|
+
const absPath = resolve19(fileDir, relPath);
|
|
203333
203333
|
const rel = relative8(projectRoot, absPath);
|
|
203334
203334
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
203335
203335
|
});
|
|
@@ -203597,7 +203597,7 @@ ${code}`;
|
|
|
203597
203597
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
203598
203598
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
203599
203599
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
203600
|
-
const hmrBase = vueDir ?
|
|
203600
|
+
const hmrBase = vueDir ? resolve19(vueDir) : projectRoot;
|
|
203601
203601
|
const hmrId = relative8(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
203602
203602
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
203603
203603
|
result += [
|
|
@@ -203755,7 +203755,7 @@ export default {};
|
|
|
203755
203755
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
203756
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);`);
|
|
203757
203757
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
203758
|
-
const filePath =
|
|
203758
|
+
const filePath = resolve19(projectRoot, relPath);
|
|
203759
203759
|
const ext = extname3(filePath);
|
|
203760
203760
|
if (ext === ".svelte")
|
|
203761
203761
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -203782,7 +203782,7 @@ export default {};
|
|
|
203782
203782
|
if (!TRANSPILABLE.has(ext))
|
|
203783
203783
|
return;
|
|
203784
203784
|
const stat2 = statSync2(filePath);
|
|
203785
|
-
const resolvedVueDir = vueDir ?
|
|
203785
|
+
const resolvedVueDir = vueDir ? resolve19(vueDir) : undefined;
|
|
203786
203786
|
const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
203787
203787
|
setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
203788
203788
|
return jsResponse(content);
|
|
@@ -203813,7 +203813,7 @@ export default {};
|
|
|
203813
203813
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
203814
203814
|
return;
|
|
203815
203815
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
203816
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
203816
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve19(projectRoot, relPath));
|
|
203817
203817
|
if (virtualCssResponse)
|
|
203818
203818
|
return virtualCssResponse;
|
|
203819
203819
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -203829,11 +203829,11 @@ export default {};
|
|
|
203829
203829
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
203830
203830
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
203831
203831
|
if (match[1])
|
|
203832
|
-
files.push(
|
|
203832
|
+
files.push(resolve19(projectRoot, match[1]));
|
|
203833
203833
|
}
|
|
203834
203834
|
return files;
|
|
203835
203835
|
}, invalidateModule = (filePath) => {
|
|
203836
|
-
const resolved =
|
|
203836
|
+
const resolved = resolve19(filePath);
|
|
203837
203837
|
invalidate(filePath);
|
|
203838
203838
|
if (resolved !== filePath)
|
|
203839
203839
|
invalidate(resolved);
|
|
@@ -203899,11 +203899,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
203899
203899
|
__export(exports_simpleHTMLHMR, {
|
|
203900
203900
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
203901
203901
|
});
|
|
203902
|
-
import { resolve as
|
|
203902
|
+
import { resolve as resolve20 } from "path";
|
|
203903
203903
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
203904
203904
|
let htmlContent;
|
|
203905
203905
|
try {
|
|
203906
|
-
const resolvedPath =
|
|
203906
|
+
const resolvedPath = resolve20(htmlFilePath);
|
|
203907
203907
|
const file4 = Bun.file(resolvedPath);
|
|
203908
203908
|
if (!await file4.exists()) {
|
|
203909
203909
|
return null;
|
|
@@ -203929,11 +203929,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
203929
203929
|
__export(exports_simpleHTMXHMR, {
|
|
203930
203930
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
203931
203931
|
});
|
|
203932
|
-
import { resolve as
|
|
203932
|
+
import { resolve as resolve21 } from "path";
|
|
203933
203933
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
203934
203934
|
let htmlContent;
|
|
203935
203935
|
try {
|
|
203936
|
-
const resolvedPath =
|
|
203936
|
+
const resolvedPath = resolve21(htmxFilePath);
|
|
203937
203937
|
const file4 = Bun.file(resolvedPath);
|
|
203938
203938
|
if (!await file4.exists()) {
|
|
203939
203939
|
return null;
|
|
@@ -203957,7 +203957,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
203957
203957
|
// src/dev/rebuildTrigger.ts
|
|
203958
203958
|
import { existsSync as existsSync16 } from "fs";
|
|
203959
203959
|
import { rm as rm8 } from "fs/promises";
|
|
203960
|
-
import { basename as basename8, relative as relative9, resolve as
|
|
203960
|
+
import { basename as basename8, relative as relative9, resolve as resolve22 } from "path";
|
|
203961
203961
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
203962
203962
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
203963
203963
|
if (pathLineCol) {
|
|
@@ -204029,7 +204029,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204029
204029
|
state.fileHashes.delete(filePathInSet);
|
|
204030
204030
|
try {
|
|
204031
204031
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
204032
|
-
const deletedPathResolved =
|
|
204032
|
+
const deletedPathResolved = resolve22(filePathInSet);
|
|
204033
204033
|
affectedFiles.forEach((affectedFile) => {
|
|
204034
204034
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
204035
204035
|
validFiles.push(affectedFile);
|
|
@@ -204073,7 +204073,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204073
204073
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
204074
204074
|
return;
|
|
204075
204075
|
}
|
|
204076
|
-
const normalizedFilePath =
|
|
204076
|
+
const normalizedFilePath = resolve22(filePathInSet);
|
|
204077
204077
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
204078
204078
|
validFiles.push(normalizedFilePath);
|
|
204079
204079
|
processedFiles.add(normalizedFilePath);
|
|
@@ -204151,7 +204151,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204151
204151
|
}
|
|
204152
204152
|
if (framework === "unknown") {
|
|
204153
204153
|
const { invalidate: invalidate2 } = (init_transformCache(), __toCommonJS(exports_transformCache));
|
|
204154
|
-
invalidate2(
|
|
204154
|
+
invalidate2(resolve22(filePath));
|
|
204155
204155
|
const relPath = relative9(process.cwd(), filePath);
|
|
204156
204156
|
logHmrUpdate(relPath);
|
|
204157
204157
|
return;
|
|
@@ -204197,7 +204197,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204197
204197
|
}
|
|
204198
204198
|
if (!graph)
|
|
204199
204199
|
return componentFile;
|
|
204200
|
-
const dependents = graph.dependents.get(
|
|
204200
|
+
const dependents = graph.dependents.get(resolve22(componentFile));
|
|
204201
204201
|
if (!dependents)
|
|
204202
204202
|
return componentFile;
|
|
204203
204203
|
for (const dep of dependents) {
|
|
@@ -204206,7 +204206,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204206
204206
|
}
|
|
204207
204207
|
return componentFile;
|
|
204208
204208
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
204209
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
204209
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve22(file4).startsWith(angularPagesPath));
|
|
204210
204210
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
204211
204211
|
return pageEntries;
|
|
204212
204212
|
}
|
|
@@ -204215,7 +204215,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204215
204215
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
204216
204216
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
204217
204217
|
affected.forEach((file4) => {
|
|
204218
|
-
if (file4.endsWith(".ts") &&
|
|
204218
|
+
if (file4.endsWith(".ts") && resolve22(file4).startsWith(angularPagesPath)) {
|
|
204219
204219
|
resolvedPages.add(file4);
|
|
204220
204220
|
}
|
|
204221
204221
|
});
|
|
@@ -204296,7 +204296,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204296
204296
|
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true);
|
|
204297
204297
|
serverPaths.forEach((serverPath) => {
|
|
204298
204298
|
const fileBase = basename8(serverPath, ".js");
|
|
204299
|
-
state.manifest[toPascal(fileBase)] =
|
|
204299
|
+
state.manifest[toPascal(fileBase)] = resolve22(serverPath);
|
|
204300
204300
|
});
|
|
204301
204301
|
if (clientPaths.length > 0) {
|
|
204302
204302
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
|
|
@@ -204305,16 +204305,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204305
204305
|
const angularDir = config.angularDirectory ?? "";
|
|
204306
204306
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
204307
204307
|
for (const file4 of angularFiles) {
|
|
204308
|
-
state.fileHashes.set(
|
|
204308
|
+
state.fileHashes.set(resolve22(file4), computeFileHash(file4));
|
|
204309
204309
|
}
|
|
204310
|
-
const angularPagesPath =
|
|
204310
|
+
const angularPagesPath = resolve22(angularDir, "pages");
|
|
204311
204311
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
204312
204312
|
if (pageEntries.length > 0) {
|
|
204313
204313
|
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
204314
204314
|
invalidateAngularSsrCache();
|
|
204315
204315
|
}
|
|
204316
204316
|
if (pageEntries.length > 0) {
|
|
204317
|
-
await rm8(
|
|
204317
|
+
await rm8(resolve22(angularDir, "generated"), {
|
|
204318
204318
|
force: true,
|
|
204319
204319
|
recursive: true
|
|
204320
204320
|
});
|
|
@@ -204328,7 +204328,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204328
204328
|
return manifest;
|
|
204329
204329
|
}, resolveReactEntryForPageFile = (normalized, pagesPathResolved, reactIndexesPath) => {
|
|
204330
204330
|
const pageName = basename8(normalized, ".tsx");
|
|
204331
|
-
const indexPath =
|
|
204331
|
+
const indexPath = resolve22(reactIndexesPath, `${pageName}.tsx`);
|
|
204332
204332
|
if (!existsSync16(indexPath)) {
|
|
204333
204333
|
return;
|
|
204334
204334
|
}
|
|
@@ -204340,13 +204340,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204340
204340
|
return;
|
|
204341
204341
|
}
|
|
204342
204342
|
const pageName = basename8(dep, ".tsx");
|
|
204343
|
-
const indexPath =
|
|
204343
|
+
const indexPath = resolve22(reactIndexesPath, `${pageName}.tsx`);
|
|
204344
204344
|
if (existsSync16(indexPath) && !reactEntries.includes(indexPath)) {
|
|
204345
204345
|
reactEntries.push(indexPath);
|
|
204346
204346
|
}
|
|
204347
204347
|
});
|
|
204348
204348
|
}, resolveReactEntryForFile = (state, file4, pagesPathResolved, reactIndexesPath, reactEntries) => {
|
|
204349
|
-
const normalized =
|
|
204349
|
+
const normalized = resolve22(file4);
|
|
204350
204350
|
if (!normalized.startsWith(pagesPathResolved)) {
|
|
204351
204351
|
resolveReactEntriesFromDeps(state, normalized, pagesPathResolved, reactIndexesPath, reactEntries);
|
|
204352
204352
|
return;
|
|
@@ -204357,7 +204357,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204357
204357
|
}
|
|
204358
204358
|
}, collectReactEntries = (state, filesToRebuild, reactPagesPath, reactIndexesPath) => {
|
|
204359
204359
|
const reactEntries = [];
|
|
204360
|
-
const pagesPathResolved =
|
|
204360
|
+
const pagesPathResolved = resolve22(reactPagesPath);
|
|
204361
204361
|
filesToRebuild.forEach((file4) => {
|
|
204362
204362
|
resolveReactEntryForFile(state, file4, pagesPathResolved, reactIndexesPath, reactEntries);
|
|
204363
204363
|
});
|
|
@@ -204368,7 +204368,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204368
204368
|
const { getDevVendorPaths: getDevVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
204369
204369
|
const { rewriteReactImports: rewriteReactImports2 } = await Promise.resolve().then(() => (init_rewriteReactImports(), exports_rewriteReactImports));
|
|
204370
204370
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
204371
|
-
const refreshEntry =
|
|
204371
|
+
const refreshEntry = resolve22(reactIndexesPath, "_refresh.tsx");
|
|
204372
204372
|
if (!reactEntries.includes(refreshEntry)) {
|
|
204373
204373
|
reactEntries.push(refreshEntry);
|
|
204374
204374
|
}
|
|
@@ -204380,7 +204380,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204380
204380
|
setDevVendorPaths2(vendorPaths);
|
|
204381
204381
|
}
|
|
204382
204382
|
const { rmSync: rmSync2 } = await import("fs");
|
|
204383
|
-
rmSync2(
|
|
204383
|
+
rmSync2(resolve22(buildDir, "react", "indexes"), {
|
|
204384
204384
|
force: true,
|
|
204385
204385
|
recursive: true
|
|
204386
204386
|
});
|
|
@@ -204418,11 +204418,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204418
204418
|
if (isComponentFile2)
|
|
204419
204419
|
return primaryFile;
|
|
204420
204420
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
204421
|
-
const nearest = findNearestComponent2(
|
|
204421
|
+
const nearest = findNearestComponent2(resolve22(primaryFile));
|
|
204422
204422
|
return nearest ?? primaryFile;
|
|
204423
204423
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
204424
204424
|
for (const file4 of reactFiles) {
|
|
204425
|
-
state.fileHashes.set(
|
|
204425
|
+
state.fileHashes.set(resolve22(file4), computeFileHash(file4));
|
|
204426
204426
|
}
|
|
204427
204427
|
invalidateReactSsrCache();
|
|
204428
204428
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
@@ -204464,8 +204464,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204464
204464
|
return state.manifest;
|
|
204465
204465
|
}, handleReactFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
204466
204466
|
const reactDir = config.reactDirectory ?? "";
|
|
204467
|
-
const reactPagesPath =
|
|
204468
|
-
const reactIndexesPath =
|
|
204467
|
+
const reactPagesPath = resolve22(reactDir, "pages");
|
|
204468
|
+
const reactIndexesPath = resolve22(reactDir, "generated", "indexes");
|
|
204469
204469
|
const { buildDir } = state.resolvedPaths;
|
|
204470
204470
|
const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "react");
|
|
204471
204471
|
if (reactFiles.length > 0) {
|
|
@@ -204477,7 +204477,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204477
204477
|
if (reactEntries.length > 0) {
|
|
204478
204478
|
await bundleReactClient(state, reactEntries, reactIndexesPath, buildDir);
|
|
204479
204479
|
}
|
|
204480
|
-
await rm8(
|
|
204480
|
+
await rm8(resolve22(reactDir, "generated"), { force: true, recursive: true });
|
|
204481
204481
|
const { manifest } = state;
|
|
204482
204482
|
const duration = Date.now() - startTime;
|
|
204483
204483
|
const reactPageFiles = reactFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
|
|
@@ -204529,7 +204529,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204529
204529
|
});
|
|
204530
204530
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
204531
204531
|
for (const file4 of svelteFiles) {
|
|
204532
|
-
state.fileHashes.set(
|
|
204532
|
+
state.fileHashes.set(resolve22(file4), computeFileHash(file4));
|
|
204533
204533
|
}
|
|
204534
204534
|
invalidateSvelteSsrCache();
|
|
204535
204535
|
const serverDuration = Date.now() - startTime;
|
|
@@ -204555,8 +204555,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204555
204555
|
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true);
|
|
204556
204556
|
const serverEntries = [...svelteServerPaths];
|
|
204557
204557
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
204558
|
-
const serverRoot =
|
|
204559
|
-
const serverOutDir =
|
|
204558
|
+
const serverRoot = resolve22(svelteDir, "generated", "server");
|
|
204559
|
+
const serverOutDir = resolve22(buildDir, basename8(svelteDir));
|
|
204560
204560
|
const [serverResult, clientResult] = await Promise.all([
|
|
204561
204561
|
serverEntries.length > 0 ? bunBuild7({
|
|
204562
204562
|
entrypoints: serverEntries,
|
|
@@ -204581,7 +204581,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204581
204581
|
handleServerManifestUpdate(state, serverResult);
|
|
204582
204582
|
await handleClientManifestUpdate(state, clientResult, buildDir);
|
|
204583
204583
|
}
|
|
204584
|
-
await rm8(
|
|
204584
|
+
await rm8(resolve22(svelteDir, "generated"), {
|
|
204585
204585
|
force: true,
|
|
204586
204586
|
recursive: true
|
|
204587
204587
|
});
|
|
@@ -204644,7 +204644,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204644
204644
|
});
|
|
204645
204645
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
204646
204646
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
204647
|
-
state.fileHashes.set(
|
|
204647
|
+
state.fileHashes.set(resolve22(file4), computeFileHash(file4));
|
|
204648
204648
|
}
|
|
204649
204649
|
invalidateVueSsrCache();
|
|
204650
204650
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -204753,10 +204753,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204753
204753
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
204754
204754
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
204755
204755
|
if (isSingle) {
|
|
204756
|
-
return
|
|
204756
|
+
return resolve22(state.resolvedPaths.buildDir, "pages");
|
|
204757
204757
|
}
|
|
204758
204758
|
const dirName = framework === "html" ? basename8(config.htmlDirectory ?? "html") : basename8(config.htmxDirectory ?? "htmx");
|
|
204759
|
-
return
|
|
204759
|
+
return resolve22(state.resolvedPaths.buildDir, dirName, "pages");
|
|
204760
204760
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
204761
204761
|
try {
|
|
204762
204762
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -204792,7 +204792,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204792
204792
|
const outputHtmlPages = computeOutputPagesDir(state, config, "html");
|
|
204793
204793
|
for (const pageFile of htmlPageFiles) {
|
|
204794
204794
|
const htmlPageName = basename8(pageFile);
|
|
204795
|
-
const builtHtmlPagePath =
|
|
204795
|
+
const builtHtmlPagePath = resolve22(outputHtmlPages, htmlPageName);
|
|
204796
204796
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
204797
204797
|
}
|
|
204798
204798
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -204857,7 +204857,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204857
204857
|
const cssKey = `${pascalName}CSS`;
|
|
204858
204858
|
const cssUrl = manifest[cssKey] || null;
|
|
204859
204859
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
204860
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
204860
|
+
const hmrMeta = vueHmrMetadata2.get(resolve22(vuePagePath));
|
|
204861
204861
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
204862
204862
|
if (changeType === "style-only") {
|
|
204863
204863
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -205091,7 +205091,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
205091
205091
|
const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
|
|
205092
205092
|
for (const htmxPageFile of htmxPageFiles) {
|
|
205093
205093
|
const htmxPageName = basename8(htmxPageFile);
|
|
205094
|
-
const builtHtmxPagePath =
|
|
205094
|
+
const builtHtmxPagePath = resolve22(outputHtmxPages, htmxPageName);
|
|
205095
205095
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
205096
205096
|
}
|
|
205097
205097
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -205200,7 +205200,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
205200
205200
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
205201
205201
|
writeFs(destPath, html);
|
|
205202
205202
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
205203
|
-
const destPath =
|
|
205203
|
+
const destPath = resolve22(outputDir, basename8(sourceFile));
|
|
205204
205204
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
205205
205205
|
const source = await Bun.file(sourceFile).text();
|
|
205206
205206
|
await Bun.write(destPath, source);
|
|
@@ -205562,7 +205562,7 @@ __export(exports_devBuild, {
|
|
|
205562
205562
|
});
|
|
205563
205563
|
import { readdir as readdir3 } from "fs/promises";
|
|
205564
205564
|
import { statSync as statSync3 } from "fs";
|
|
205565
|
-
import { resolve as
|
|
205565
|
+
import { resolve as resolve23 } from "path";
|
|
205566
205566
|
var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
205567
205567
|
const config = {};
|
|
205568
205568
|
const dirPattern = /(\w+Directory)\s*:\s*['"]([^'"]+)['"]/g;
|
|
@@ -205575,7 +205575,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205575
205575
|
return Object.keys(config).length > 0 ? config : null;
|
|
205576
205576
|
}, reloadConfig = async () => {
|
|
205577
205577
|
try {
|
|
205578
|
-
const configPath2 =
|
|
205578
|
+
const configPath2 = resolve23(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
205579
205579
|
const source = await Bun.file(configPath2).text();
|
|
205580
205580
|
return parseDirectoryConfig(source);
|
|
205581
205581
|
} catch {
|
|
@@ -205654,7 +205654,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205654
205654
|
state.fileChangeQueue.clear();
|
|
205655
205655
|
}
|
|
205656
205656
|
}, handleCachedReload = async () => {
|
|
205657
|
-
const serverMtime = statSync3(
|
|
205657
|
+
const serverMtime = statSync3(resolve23(Bun.main)).mtimeMs;
|
|
205658
205658
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
205659
205659
|
globalThis.__hmrServerMtime = serverMtime;
|
|
205660
205660
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -205688,8 +205688,8 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205688
205688
|
return true;
|
|
205689
205689
|
}, resolveAbsoluteVersion2 = async () => {
|
|
205690
205690
|
const candidates = [
|
|
205691
|
-
|
|
205692
|
-
|
|
205691
|
+
resolve23(import.meta.dir, "..", "..", "package.json"),
|
|
205692
|
+
resolve23(import.meta.dir, "..", "package.json")
|
|
205693
205693
|
];
|
|
205694
205694
|
for (const candidate of candidates) {
|
|
205695
205695
|
const found = await tryReadPackageVersion(candidate);
|
|
@@ -205702,7 +205702,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205702
205702
|
const entries = await readdir3(vendorDir).catch(() => emptyStringArray);
|
|
205703
205703
|
await Promise.all(entries.map(async (entry) => {
|
|
205704
205704
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
205705
|
-
const bytes = await Bun.file(
|
|
205705
|
+
const bytes = await Bun.file(resolve23(vendorDir, entry)).bytes();
|
|
205706
205706
|
assetStore.set(webPath, bytes);
|
|
205707
205707
|
}));
|
|
205708
205708
|
}, devBuild = async (config) => {
|
|
@@ -205742,7 +205742,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205742
205742
|
await populateAssetStore(state.assetStore, manifest ?? {}, state.resolvedPaths.buildDir);
|
|
205743
205743
|
cleanStaleAssets(state.assetStore, manifest ?? {}, state.resolvedPaths.buildDir);
|
|
205744
205744
|
const buildReactVendorTask = config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
205745
|
-
const vendorDir =
|
|
205745
|
+
const vendorDir = resolve23(state.resolvedPaths.buildDir, "react", "vendor");
|
|
205746
205746
|
await loadVendorFiles(state.assetStore, vendorDir, "react");
|
|
205747
205747
|
if (!globalThis.__reactModuleRef) {
|
|
205748
205748
|
globalThis.__reactModuleRef = await import("react");
|
|
@@ -205750,17 +205750,17 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205750
205750
|
return true;
|
|
205751
205751
|
}) : undefined;
|
|
205752
205752
|
const buildAngularVendorTask = config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
205753
|
-
const vendorDir =
|
|
205753
|
+
const vendorDir = resolve23(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
205754
205754
|
await loadVendorFiles(state.assetStore, vendorDir, "angular");
|
|
205755
205755
|
return true;
|
|
205756
205756
|
}) : undefined;
|
|
205757
205757
|
const buildSvelteVendorTask = config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
205758
|
-
const vendorDir =
|
|
205758
|
+
const vendorDir = resolve23(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
205759
205759
|
await loadVendorFiles(state.assetStore, vendorDir, "svelte");
|
|
205760
205760
|
return true;
|
|
205761
205761
|
}) : undefined;
|
|
205762
205762
|
const buildVueVendorTask = config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
205763
|
-
const vendorDir =
|
|
205763
|
+
const vendorDir = resolve23(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
205764
205764
|
await loadVendorFiles(state.assetStore, vendorDir, "vue");
|
|
205765
205765
|
return true;
|
|
205766
205766
|
}) : undefined;
|
|
@@ -205774,7 +205774,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205774
205774
|
config.htmxDirectory
|
|
205775
205775
|
].filter((dir) => Boolean(dir));
|
|
205776
205776
|
const buildDepVendorTask = buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs).then(async (depPaths) => {
|
|
205777
|
-
const vendorDir =
|
|
205777
|
+
const vendorDir = resolve23(state.resolvedPaths.buildDir, "vendor");
|
|
205778
205778
|
await loadVendorFiles(state.assetStore, vendorDir, "vendor");
|
|
205779
205779
|
globalThis.__depVendorPaths = depPaths;
|
|
205780
205780
|
return true;
|
|
@@ -205804,7 +205804,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
205804
205804
|
manifest
|
|
205805
205805
|
};
|
|
205806
205806
|
globalThis.__hmrDevResult = result;
|
|
205807
|
-
globalThis.__hmrServerMtime = statSync3(
|
|
205807
|
+
globalThis.__hmrServerMtime = statSync3(resolve23(Bun.main)).mtimeMs;
|
|
205808
205808
|
return result;
|
|
205809
205809
|
};
|
|
205810
205810
|
var init_devBuild = __esm(() => {
|
|
@@ -205947,7 +205947,7 @@ __export(exports_imageOptimizer, {
|
|
|
205947
205947
|
imageOptimizer: () => imageOptimizer
|
|
205948
205948
|
});
|
|
205949
205949
|
import { existsSync as existsSync17 } from "fs";
|
|
205950
|
-
import { resolve as
|
|
205950
|
+
import { resolve as resolve24 } from "path";
|
|
205951
205951
|
import { Elysia } from "elysia";
|
|
205952
205952
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
205953
205953
|
try {
|
|
@@ -205960,7 +205960,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
205960
205960
|
}
|
|
205961
205961
|
}, resolveLocalImage = (url, buildDir) => {
|
|
205962
205962
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
205963
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
205963
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve24(process.cwd()));
|
|
205964
205964
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
205965
205965
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
205966
205966
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -206615,7 +206615,7 @@ var handleHTMLPageRequest = (pagePath) => file(pagePath);
|
|
|
206615
206615
|
var handleHTMXPageRequest = (pagePath) => file(pagePath);
|
|
206616
206616
|
// src/core/prepare.ts
|
|
206617
206617
|
import { existsSync as existsSync18, readdirSync as readdirSync2, readFileSync as readFileSync11 } from "fs";
|
|
206618
|
-
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";
|
|
206619
206619
|
|
|
206620
206620
|
// src/utils/loadConfig.ts
|
|
206621
206621
|
import { resolve } from "path";
|
|
@@ -206656,7 +206656,7 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
206656
206656
|
for (const { dir, pattern } of prewarmDirs) {
|
|
206657
206657
|
const glob = new Glob8(pattern);
|
|
206658
206658
|
const matches = [
|
|
206659
|
-
...glob.scanSync({ absolute: true, cwd:
|
|
206659
|
+
...glob.scanSync({ absolute: true, cwd: resolve25(dir) })
|
|
206660
206660
|
];
|
|
206661
206661
|
files.push(...matches);
|
|
206662
206662
|
}
|
|
@@ -206692,7 +206692,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
206692
206692
|
const fileName = resolveDevIndexFileName(manifest[key], baseName);
|
|
206693
206693
|
if (!fileName)
|
|
206694
206694
|
continue;
|
|
206695
|
-
const srcPath =
|
|
206695
|
+
const srcPath = resolve25(devIndexDir, fileName);
|
|
206696
206696
|
if (!existsSync18(srcPath))
|
|
206697
206697
|
continue;
|
|
206698
206698
|
const rel = relative10(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
@@ -206736,7 +206736,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
206736
206736
|
};
|
|
206737
206737
|
}
|
|
206738
206738
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
206739
|
-
const devIndexDir =
|
|
206739
|
+
const devIndexDir = resolve25(buildDir, "_src_indexes");
|
|
206740
206740
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
206741
206741
|
const { imageOptimizer: imageOptimizer2 } = await Promise.resolve().then(() => (init_imageOptimizer(), exports_imageOptimizer));
|
|
206742
206742
|
return {
|
|
@@ -206769,7 +206769,7 @@ var prepare = async (configOrPath) => {
|
|
|
206769
206769
|
const config = await loadConfig(configOrPath);
|
|
206770
206770
|
const nodeEnv = process.env["NODE_ENV"];
|
|
206771
206771
|
const isDev2 = nodeEnv === "development";
|
|
206772
|
-
const buildDir =
|
|
206772
|
+
const buildDir = resolve25(isDev2 ? config.buildDirectory ?? "build" : process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
206773
206773
|
if (isDev2)
|
|
206774
206774
|
return prepareDev(config, buildDir);
|
|
206775
206775
|
const manifest = JSON.parse(readFileSync11(`${buildDir}/manifest.json`, "utf-8"));
|
|
@@ -207109,5 +207109,5 @@ export {
|
|
|
207109
207109
|
ANGULAR_INIT_TIMEOUT_MS
|
|
207110
207110
|
};
|
|
207111
207111
|
|
|
207112
|
-
//# debugId=
|
|
207112
|
+
//# debugId=3A1517BF8B920B2364756E2164756E21
|
|
207113
207113
|
//# sourceMappingURL=index.js.map
|