@absolutejs/absolute 0.20.0-beta.146 → 0.20.0-beta.148
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/CHANGELOG.md +40 -0
- package/changelog.json +70 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +197 -178
- package/dist/build.js.map +7 -6
- package/dist/cli/{buildDepVendor-g49s8rr1.js → buildDepVendor-29d8v9cx.js} +2 -1
- package/dist/cli/{dev-4qz8gk8x.js → dev-b9d4vnk0.js} +30 -23
- package/dist/cli/index.js +1 -1
- package/dist/index.js +447 -428
- package/dist/index.js.map +7 -6
- package/dist/src/cli/devSpawn.d.ts +8 -0
- package/dist/src/dev/runtimePaths.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13403,6 +13403,23 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
13403
13403
|
pageHandlerWrappers = new WeakMap;
|
|
13404
13404
|
});
|
|
13405
13405
|
|
|
13406
|
+
// src/dev/runtimePaths.ts
|
|
13407
|
+
import { existsSync as existsSync12 } from "fs";
|
|
13408
|
+
import { resolve as resolve18 } from "path";
|
|
13409
|
+
var resolveDevClientDirectory = () => {
|
|
13410
|
+
const candidates = [
|
|
13411
|
+
resolve18(import.meta.dir, "client"),
|
|
13412
|
+
resolve18(import.meta.dir, "dev/client"),
|
|
13413
|
+
resolve18(import.meta.dir, "../dev/client")
|
|
13414
|
+
];
|
|
13415
|
+
const directory = candidates.find((candidate) => existsSync12(resolve18(candidate, "hmrClient.ts")));
|
|
13416
|
+
if (!directory) {
|
|
13417
|
+
throw new Error("AbsoluteJS browser HMR sources are missing from the installed package.");
|
|
13418
|
+
}
|
|
13419
|
+
return directory;
|
|
13420
|
+
};
|
|
13421
|
+
var init_runtimePaths = () => {};
|
|
13422
|
+
|
|
13406
13423
|
// src/utils/normalizePath.ts
|
|
13407
13424
|
var normalizePath2 = (path) => path.replace(/\\/g, "/");
|
|
13408
13425
|
|
|
@@ -13489,7 +13506,7 @@ var init_generateManifest = __esm(() => {
|
|
|
13489
13506
|
});
|
|
13490
13507
|
|
|
13491
13508
|
// src/build/verifyAngularCoreUniqueness.ts
|
|
13492
|
-
import { resolve as
|
|
13509
|
+
import { resolve as resolve19 } from "path";
|
|
13493
13510
|
var ANGULAR_CORE_IMPORT_RE, ANGULAR_CORE_PACKAGE_RE, classifySpecifier = (specifier, artifactPath, serverOutDir) => {
|
|
13494
13511
|
if (!ANGULAR_CORE_PACKAGE_RE.test(specifier))
|
|
13495
13512
|
return null;
|
|
@@ -13499,9 +13516,9 @@ var ANGULAR_CORE_IMPORT_RE, ANGULAR_CORE_PACKAGE_RE, classifySpecifier = (specif
|
|
|
13499
13516
|
if (specifier.startsWith("/")) {
|
|
13500
13517
|
absolute = specifier;
|
|
13501
13518
|
} else if (specifier.startsWith(".")) {
|
|
13502
|
-
absolute =
|
|
13519
|
+
absolute = resolve19(artifactPath, "..", specifier);
|
|
13503
13520
|
} else {
|
|
13504
|
-
absolute = serverOutDir ?
|
|
13521
|
+
absolute = serverOutDir ? resolve19(serverOutDir, specifier) : resolve19(artifactPath, "..", specifier);
|
|
13505
13522
|
}
|
|
13506
13523
|
return {
|
|
13507
13524
|
kind: "resolved",
|
|
@@ -13564,22 +13581,22 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
|
|
|
13564
13581
|
});
|
|
13565
13582
|
|
|
13566
13583
|
// src/build/generateReactIndexes.ts
|
|
13567
|
-
import { existsSync as
|
|
13584
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync3 } from "fs";
|
|
13568
13585
|
import { readdir as readdir4, rm as rm3, writeFile as writeFile4 } from "fs/promises";
|
|
13569
|
-
import { basename as basename4, join as join21, relative as relative9, resolve as
|
|
13586
|
+
import { basename as basename4, join as join21, relative as relative9, resolve as resolve20, sep as sep3 } from "path";
|
|
13570
13587
|
var {Glob: Glob2 } = globalThis.Bun;
|
|
13571
13588
|
var indexContentCache, resolveDevClientDir = () => {
|
|
13572
13589
|
const projectRoot = process.cwd();
|
|
13573
|
-
const fromPackage =
|
|
13574
|
-
if (
|
|
13590
|
+
const fromPackage = resolve20(import.meta.dir, "../dev/client");
|
|
13591
|
+
if (existsSync13(fromPackage)) {
|
|
13575
13592
|
return fromPackage;
|
|
13576
13593
|
}
|
|
13577
|
-
const fromNodeModules =
|
|
13578
|
-
if (
|
|
13594
|
+
const fromNodeModules = resolve20(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13595
|
+
if (existsSync13(fromNodeModules))
|
|
13579
13596
|
return fromNodeModules;
|
|
13580
|
-
return
|
|
13597
|
+
return resolve20(import.meta.dir, "./dev/client");
|
|
13581
13598
|
}, devClientDir, errorOverlayPath, hmrClientPath, refreshSetupPath, reactRefreshRuntimePath, generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory, isDev = false) => {
|
|
13582
|
-
if (!
|
|
13599
|
+
if (!existsSync13(reactIndexesDirectory)) {
|
|
13583
13600
|
mkdirSync3(reactIndexesDirectory, { recursive: true });
|
|
13584
13601
|
}
|
|
13585
13602
|
const CONVENTION_RE = /^(?:(.+)\.)?(error|loading|not-found)\.[^.]+$/;
|
|
@@ -13605,7 +13622,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
13605
13622
|
});
|
|
13606
13623
|
}));
|
|
13607
13624
|
}
|
|
13608
|
-
const pagesRelPath = relative9(
|
|
13625
|
+
const pagesRelPath = relative9(resolve20(reactIndexesDirectory), resolve20(reactPagesDirectory)).split(sep3).join("/");
|
|
13609
13626
|
const promises = files.map(async (file) => {
|
|
13610
13627
|
const fileName = basename4(file);
|
|
13611
13628
|
const componentName = fileName.split(".")[0];
|
|
@@ -13917,7 +13934,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
13917
13934
|
`
|
|
13918
13935
|
// Pre-warm: import the page module from the module server`,
|
|
13919
13936
|
`// immediately so the browser caches all /@src/ URLs.`,
|
|
13920
|
-
`import('/@src/${relative9(process.cwd(),
|
|
13937
|
+
`import('/@src/${relative9(process.cwd(), resolve20(reactPagesDirectory, `${componentName}.tsx`)).replace(/\\/g, "/")}').catch(() => {});`
|
|
13921
13938
|
] : []
|
|
13922
13939
|
].join(`
|
|
13923
13940
|
`);
|
|
@@ -13925,7 +13942,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
13925
13942
|
const hasher = new Bun.CryptoHasher("md5");
|
|
13926
13943
|
hasher.update(content);
|
|
13927
13944
|
const contentHash = hasher.digest("hex");
|
|
13928
|
-
if (indexContentCache.get(indexPath) === contentHash &&
|
|
13945
|
+
if (indexContentCache.get(indexPath) === contentHash && existsSync13(indexPath)) {
|
|
13929
13946
|
return;
|
|
13930
13947
|
}
|
|
13931
13948
|
indexContentCache.set(indexPath, contentHash);
|
|
@@ -13936,7 +13953,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
13936
13953
|
return;
|
|
13937
13954
|
}
|
|
13938
13955
|
const refreshPath = join21(reactIndexesDirectory, "_refresh.tsx");
|
|
13939
|
-
if (!
|
|
13956
|
+
if (!existsSync13(refreshPath)) {
|
|
13940
13957
|
await writeFile4(refreshPath, `import '${refreshSetupPath}';
|
|
13941
13958
|
import 'react';
|
|
13942
13959
|
import 'react-dom/client';
|
|
@@ -14054,7 +14071,7 @@ var init_stampedFileCache = () => {};
|
|
|
14054
14071
|
// src/build/scanConventions.ts
|
|
14055
14072
|
import { basename as basename5 } from "path";
|
|
14056
14073
|
var {Glob: Glob3 } = globalThis.Bun;
|
|
14057
|
-
import { existsSync as
|
|
14074
|
+
import { existsSync as existsSync14 } from "fs";
|
|
14058
14075
|
var CONVENTION_RE, classifyFile = (file, pageFiles, defaults, pages) => {
|
|
14059
14076
|
const fileName = basename5(file);
|
|
14060
14077
|
const match = CONVENTION_RE.exec(fileName);
|
|
@@ -14079,7 +14096,7 @@ var CONVENTION_RE, classifyFile = (file, pageFiles, defaults, pages) => {
|
|
|
14079
14096
|
else if (kind === "loading")
|
|
14080
14097
|
pages[pageName].loading = file;
|
|
14081
14098
|
}, scanConventions = async (pagesDir, pattern) => {
|
|
14082
|
-
if (!
|
|
14099
|
+
if (!existsSync14(pagesDir)) {
|
|
14083
14100
|
const pageFiles = [];
|
|
14084
14101
|
return { conventions: undefined, pageFiles };
|
|
14085
14102
|
}
|
|
@@ -14103,7 +14120,7 @@ var init_scanConventions = __esm(() => {
|
|
|
14103
14120
|
|
|
14104
14121
|
// src/build/spaSideManifests.ts
|
|
14105
14122
|
import { writeFile as writeFile5 } from "fs/promises";
|
|
14106
|
-
import { basename as basename6, dirname as dirname13, relative as relative10, resolve as
|
|
14123
|
+
import { basename as basename6, dirname as dirname13, relative as relative10, resolve as resolve21 } from "path";
|
|
14107
14124
|
var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
14108
14125
|
const manifestEntries = {};
|
|
14109
14126
|
await Promise.all([...spaRoutesBySource.entries()].map(async ([source, routes]) => {
|
|
@@ -14113,7 +14130,7 @@ var writeSpaSideManifests = async (spaRoutesBySource, resolveServerJsPath) => {
|
|
|
14113
14130
|
return;
|
|
14114
14131
|
const sourceDir = dirname13(source);
|
|
14115
14132
|
const entries = routes.flatMap(({ path, importPath }) => {
|
|
14116
|
-
const childSourcePath =
|
|
14133
|
+
const childSourcePath = resolve21(sourceDir, importPath);
|
|
14117
14134
|
const childName = basename6(childSourcePath, ".vue");
|
|
14118
14135
|
const childJsPath = resolveServerJsPath(childName);
|
|
14119
14136
|
if (!childJsPath)
|
|
@@ -14138,7 +14155,7 @@ __export(exports_serverExternals, {
|
|
|
14138
14155
|
buildServerBundleExternals: () => buildServerBundleExternals,
|
|
14139
14156
|
createDevServerExternalsPlugin: () => createDevServerExternalsPlugin
|
|
14140
14157
|
});
|
|
14141
|
-
import { existsSync as
|
|
14158
|
+
import { existsSync as existsSync15, readdirSync, readFileSync as readFileSync17 } from "fs";
|
|
14142
14159
|
import { isBuiltin } from "module";
|
|
14143
14160
|
import { dirname as dirname14, extname as extname8, join as join22 } from "path";
|
|
14144
14161
|
var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVendorPaths) => {
|
|
@@ -14197,7 +14214,7 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
|
|
|
14197
14214
|
let dir = dirname14(filePath);
|
|
14198
14215
|
while (true) {
|
|
14199
14216
|
const manifestPath = join22(dir, "package.json");
|
|
14200
|
-
if (
|
|
14217
|
+
if (existsSync15(manifestPath) && hasPackageName(manifestPath))
|
|
14201
14218
|
return dir;
|
|
14202
14219
|
const parent = dirname14(dir);
|
|
14203
14220
|
if (parent === dir)
|
|
@@ -14462,7 +14479,7 @@ var init_scanRouteRegistrations = __esm(() => {
|
|
|
14462
14479
|
});
|
|
14463
14480
|
|
|
14464
14481
|
// src/angular/staticAnalyzeSpaRoutes.ts
|
|
14465
|
-
import { existsSync as
|
|
14482
|
+
import { existsSync as existsSync16, promises as fs } from "fs";
|
|
14466
14483
|
import { join as join24 } from "path";
|
|
14467
14484
|
import ts4 from "typescript";
|
|
14468
14485
|
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (sourceFile, localName, moduleSpecifier) => {
|
|
@@ -14669,7 +14686,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
14669
14686
|
}
|
|
14670
14687
|
await Promise.all(directories.map((directory) => walkTsFiles(directory, files)));
|
|
14671
14688
|
}, analyzeAngularSpaRoutes = async (angularDirectory) => {
|
|
14672
|
-
if (!
|
|
14689
|
+
if (!existsSync16(angularDirectory))
|
|
14673
14690
|
return [];
|
|
14674
14691
|
const tsFiles = [];
|
|
14675
14692
|
await walkTsFiles(angularDirectory, tsFiles);
|
|
@@ -14690,7 +14707,7 @@ var init_staticAnalyzeSpaRoutes = __esm(() => {
|
|
|
14690
14707
|
});
|
|
14691
14708
|
|
|
14692
14709
|
// src/react/staticAnalyzeSpaRoutes.ts
|
|
14693
|
-
import { existsSync as
|
|
14710
|
+
import { existsSync as existsSync17, promises as fs2 } from "fs";
|
|
14694
14711
|
import { join as join25 } from "path";
|
|
14695
14712
|
import ts5 from "typescript";
|
|
14696
14713
|
var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN2.test(seg) || seg === "**"), readStringLiteral2 = (expression) => {
|
|
@@ -14879,7 +14896,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
14879
14896
|
}
|
|
14880
14897
|
await Promise.all(directories.map((directory) => walkSourceFiles(directory, files)));
|
|
14881
14898
|
}, analyzeReactSpaRoutes = async (reactDirectory) => {
|
|
14882
|
-
if (!
|
|
14899
|
+
if (!existsSync17(reactDirectory))
|
|
14883
14900
|
return [];
|
|
14884
14901
|
const files = [];
|
|
14885
14902
|
await walkSourceFiles(reactDirectory, files);
|
|
@@ -14900,7 +14917,7 @@ var init_staticAnalyzeSpaRoutes2 = __esm(() => {
|
|
|
14900
14917
|
});
|
|
14901
14918
|
|
|
14902
14919
|
// src/svelte/staticAnalyzeSpaRoutes.ts
|
|
14903
|
-
import { existsSync as
|
|
14920
|
+
import { existsSync as existsSync18, promises as fs3 } from "fs";
|
|
14904
14921
|
import { join as join26 } from "path";
|
|
14905
14922
|
var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN3.test(seg) || seg === "**"), joinSegments3 = (parent, child) => {
|
|
14906
14923
|
if (!child)
|
|
@@ -14983,7 +15000,7 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
14983
15000
|
}
|
|
14984
15001
|
await Promise.all(directories.map((directory) => walkSvelteFiles(directory, files)));
|
|
14985
15002
|
}, analyzeSvelteSpaRoutes = async (svelteDirectory) => {
|
|
14986
|
-
if (!
|
|
15003
|
+
if (!existsSync18(svelteDirectory))
|
|
14987
15004
|
return [];
|
|
14988
15005
|
const files = [];
|
|
14989
15006
|
await walkSvelteFiles(svelteDirectory, files);
|
|
@@ -15006,7 +15023,7 @@ var init_staticAnalyzeSpaRoutes3 = __esm(() => {
|
|
|
15006
15023
|
});
|
|
15007
15024
|
|
|
15008
15025
|
// src/vue/staticAnalyzeSpaRoutes.ts
|
|
15009
|
-
import { existsSync as
|
|
15026
|
+
import { existsSync as existsSync19, promises as fs4 } from "fs";
|
|
15010
15027
|
import { join as join27 } from "path";
|
|
15011
15028
|
import ts6 from "typescript";
|
|
15012
15029
|
var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN4.test(seg) || seg === "**"), readStringLiteral3 = (expression) => {
|
|
@@ -15249,7 +15266,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
15249
15266
|
}
|
|
15250
15267
|
await Promise.all(directories.map((directory) => walkSourceFiles2(directory, files)));
|
|
15251
15268
|
}, analyzeVueSpaRoutes = async (vueDirectory) => {
|
|
15252
|
-
if (!
|
|
15269
|
+
if (!existsSync19(vueDirectory))
|
|
15253
15270
|
return [];
|
|
15254
15271
|
const files = [];
|
|
15255
15272
|
await walkSourceFiles2(vueDirectory, files);
|
|
@@ -15506,10 +15523,10 @@ var init_generateSitemap = __esm(() => {
|
|
|
15506
15523
|
});
|
|
15507
15524
|
|
|
15508
15525
|
// src/build/scanCssEntryPoints.ts
|
|
15509
|
-
import { existsSync as
|
|
15526
|
+
import { existsSync as existsSync20 } from "fs";
|
|
15510
15527
|
var {Glob: Glob4 } = globalThis.Bun;
|
|
15511
15528
|
var scanCssEntryPoints = async (dir, ignore) => {
|
|
15512
|
-
if (!
|
|
15529
|
+
if (!existsSync20(dir))
|
|
15513
15530
|
return [];
|
|
15514
15531
|
const entryPaths = [];
|
|
15515
15532
|
const glob = new Glob4("**/*.{css,scss,sass,less,styl,stylus}");
|
|
@@ -15526,8 +15543,8 @@ var init_scanCssEntryPoints = __esm(() => {
|
|
|
15526
15543
|
});
|
|
15527
15544
|
|
|
15528
15545
|
// src/utils/imageProcessing.ts
|
|
15529
|
-
import { existsSync as
|
|
15530
|
-
import { join as join28, resolve as
|
|
15546
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync4, readFileSync as readFileSync19, writeFileSync as writeFileSync5 } from "fs";
|
|
15547
|
+
import { join as join28, resolve as resolve22 } from "path";
|
|
15531
15548
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
15532
15549
|
for (const size of sizes) {
|
|
15533
15550
|
if (size >= target)
|
|
@@ -15584,8 +15601,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
15584
15601
|
const image = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
15585
15602
|
return [...device, ...image].sort((left, right) => left - right);
|
|
15586
15603
|
}, getCacheDir = (buildDir, cacheDirectory) => {
|
|
15587
|
-
const dir = cacheDirectory ?
|
|
15588
|
-
if (!
|
|
15604
|
+
const dir = cacheDirectory ? resolve22(cacheDirectory) : join28(buildDir, ".cache", "images");
|
|
15605
|
+
if (!existsSync21(dir))
|
|
15589
15606
|
mkdirSync4(dir, { recursive: true });
|
|
15590
15607
|
return dir;
|
|
15591
15608
|
}, getCacheKey = (url, width, quality, format) => {
|
|
@@ -15677,7 +15694,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
15677
15694
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
15678
15695
|
const metaPath = join28(cacheDir, `${cacheKey}.meta`);
|
|
15679
15696
|
const dataPath = join28(cacheDir, `${cacheKey}.data`);
|
|
15680
|
-
if (!
|
|
15697
|
+
if (!existsSync21(metaPath) || !existsSync21(dataPath))
|
|
15681
15698
|
return null;
|
|
15682
15699
|
try {
|
|
15683
15700
|
const meta = JSON.parse(readFileSync19(metaPath, "utf-8"));
|
|
@@ -15691,7 +15708,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
15691
15708
|
return sharpModule;
|
|
15692
15709
|
sharpLoaded = true;
|
|
15693
15710
|
try {
|
|
15694
|
-
const sharpPath =
|
|
15711
|
+
const sharpPath = resolve22(process.cwd(), "node_modules/sharp");
|
|
15695
15712
|
const mod = await import(sharpPath);
|
|
15696
15713
|
sharpModule = mod.default ?? mod;
|
|
15697
15714
|
return sharpModule;
|
|
@@ -15836,19 +15853,19 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
15836
15853
|
});
|
|
15837
15854
|
|
|
15838
15855
|
// src/dev/buildHMRClient.ts
|
|
15839
|
-
import { existsSync as
|
|
15840
|
-
import { resolve as
|
|
15856
|
+
import { existsSync as existsSync22 } from "fs";
|
|
15857
|
+
import { resolve as resolve23 } from "path";
|
|
15841
15858
|
var {build: bunBuild } = globalThis.Bun;
|
|
15842
15859
|
var resolveHmrClientPath = () => {
|
|
15843
15860
|
const projectRoot = process.cwd();
|
|
15844
|
-
const fromSource =
|
|
15845
|
-
if (
|
|
15861
|
+
const fromSource = resolve23(import.meta.dir, "client/hmrClient.ts");
|
|
15862
|
+
if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15846
15863
|
return fromSource;
|
|
15847
15864
|
}
|
|
15848
|
-
const fromNodeModules =
|
|
15849
|
-
if (
|
|
15865
|
+
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
15866
|
+
if (existsSync22(fromNodeModules))
|
|
15850
15867
|
return fromNodeModules;
|
|
15851
|
-
return
|
|
15868
|
+
return resolve23(import.meta.dir, "dev/client/hmrClient.ts");
|
|
15852
15869
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
15853
15870
|
const entryPoint = hmrClientPath2;
|
|
15854
15871
|
const result = await bunBuild({
|
|
@@ -15995,14 +16012,14 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
15995
16012
|
};
|
|
15996
16013
|
|
|
15997
16014
|
// src/dev/lazyPages.ts
|
|
15998
|
-
import { existsSync as
|
|
15999
|
-
import { basename as basename8, extname as extname9, isAbsolute as isAbsolute4, join as join29, resolve as
|
|
16015
|
+
import { existsSync as existsSync23 } from "fs";
|
|
16016
|
+
import { basename as basename8, extname as extname9, isAbsolute as isAbsolute4, join as join29, resolve as resolve24 } from "path";
|
|
16000
16017
|
var PAGE_EXTENSIONS, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag2 = (value) => value === "1" || value === "true", looksLikePath = (value) => value.includes("/") || value.includes("\\") || value.startsWith("."), probeDirForName = ({ dir, framework }, name) => {
|
|
16001
|
-
const extension = PAGE_EXTENSIONS[framework].find((ext) =>
|
|
16018
|
+
const extension = PAGE_EXTENSIONS[framework].find((ext) => existsSync23(join29(dir, `${name}${ext}`)));
|
|
16002
16019
|
return extension === undefined ? undefined : toDevPageEntry(framework, join29(dir, `${name}${extension}`));
|
|
16003
16020
|
}, resolveSourcePath = (keyOrPath) => {
|
|
16004
16021
|
const stripped = keyOrPath.startsWith(SRC_URL_PREFIX) ? decodeSrcPath(keyOrPath.slice(SRC_URL_PREFIX.length).split("?")[0] ?? "") : keyOrPath;
|
|
16005
|
-
return isAbsolute4(stripped) ? stripped :
|
|
16022
|
+
return isAbsolute4(stripped) ? stripped : resolve24(stripped);
|
|
16006
16023
|
}, firstDefined = (candidates, lookup) => {
|
|
16007
16024
|
for (const candidate of candidates) {
|
|
16008
16025
|
const value = lookup(candidate);
|
|
@@ -16038,7 +16055,7 @@ var PAGE_EXTENSIONS, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag2 = (v
|
|
|
16038
16055
|
const dirs = [];
|
|
16039
16056
|
const push = (dir, framework) => {
|
|
16040
16057
|
if (dir)
|
|
16041
|
-
dirs.push({ dir: join29(
|
|
16058
|
+
dirs.push({ dir: join29(resolve24(dir), "pages"), framework });
|
|
16042
16059
|
};
|
|
16043
16060
|
push(config.reactDirectory, "react");
|
|
16044
16061
|
push(config.svelteDirectory, "svelte");
|
|
@@ -16064,7 +16081,7 @@ var PAGE_EXTENSIONS, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag2 = (v
|
|
|
16064
16081
|
return registered;
|
|
16065
16082
|
return firstDefined(candidates, probe);
|
|
16066
16083
|
}, toDevPageEntry = (framework, source) => {
|
|
16067
|
-
const resolved =
|
|
16084
|
+
const resolved = resolve24(source);
|
|
16068
16085
|
const entry = {
|
|
16069
16086
|
framework,
|
|
16070
16087
|
name: toPascal(basename8(resolved, extname9(resolved))),
|
|
@@ -16106,8 +16123,8 @@ var init_lazyPages = __esm(() => {
|
|
|
16106
16123
|
});
|
|
16107
16124
|
|
|
16108
16125
|
// src/build/angularLinkerPlugin.ts
|
|
16109
|
-
import { existsSync as
|
|
16110
|
-
import { dirname as dirname15, join as join30, relative as relative11, resolve as
|
|
16126
|
+
import { existsSync as existsSync24, mkdirSync as mkdirSync5, readFileSync as readFileSync20, writeFileSync as writeFileSync6 } from "fs";
|
|
16127
|
+
import { dirname as dirname15, join as join30, relative as relative11, resolve as resolve25 } from "path";
|
|
16111
16128
|
import { createHash as createHash5 } from "crypto";
|
|
16112
16129
|
var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
16113
16130
|
name: "angular-linker",
|
|
@@ -16129,7 +16146,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
16129
16146
|
}
|
|
16130
16147
|
const hash = createHash5("md5").update(source).digest("hex");
|
|
16131
16148
|
const cachePath = join30(cacheDir, `${hash}.js`);
|
|
16132
|
-
if (
|
|
16149
|
+
if (existsSync24(cachePath)) {
|
|
16133
16150
|
return {
|
|
16134
16151
|
contents: readFileSync20(cachePath, "utf-8"),
|
|
16135
16152
|
loader: "js"
|
|
@@ -16146,10 +16163,10 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
16146
16163
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
16147
16164
|
fileSystem: {
|
|
16148
16165
|
dirname: dirname15,
|
|
16149
|
-
exists:
|
|
16166
|
+
exists: existsSync24,
|
|
16150
16167
|
readFile: readFileSync20,
|
|
16151
16168
|
relative: relative11,
|
|
16152
|
-
resolve:
|
|
16169
|
+
resolve: resolve25
|
|
16153
16170
|
},
|
|
16154
16171
|
linkerJitMode,
|
|
16155
16172
|
logger: {
|
|
@@ -16180,7 +16197,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
16180
16197
|
}
|
|
16181
16198
|
}), angularLinkerPlugin;
|
|
16182
16199
|
var init_angularLinkerPlugin = __esm(() => {
|
|
16183
|
-
CACHE_ROOT =
|
|
16200
|
+
CACHE_ROOT = resolve25(".absolutejs", "cache", "angular-linker");
|
|
16184
16201
|
ANGULAR_LINKER_CANDIDATE_RE = /[\\/]node_modules[\\/].*\.m?js$/;
|
|
16185
16202
|
angularLinkerPlugin = createAngularLinkerPlugin(false);
|
|
16186
16203
|
});
|
|
@@ -16261,13 +16278,13 @@ var init_bunStringRawUnicodePlugin = __esm(() => {
|
|
|
16261
16278
|
});
|
|
16262
16279
|
|
|
16263
16280
|
// src/build/externalAssetPlugin.ts
|
|
16264
|
-
import { copyFileSync, existsSync as
|
|
16265
|
-
import { basename as basename9, dirname as dirname16, join as join31, resolve as
|
|
16281
|
+
import { copyFileSync, existsSync as existsSync25, mkdirSync as mkdirSync6, statSync as statSync3 } from "fs";
|
|
16282
|
+
import { basename as basename9, dirname as dirname16, join as join31, resolve as resolve26 } from "path";
|
|
16266
16283
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
16267
16284
|
name: "absolute-external-asset",
|
|
16268
16285
|
setup(bld) {
|
|
16269
16286
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
16270
|
-
const skipRoots = userSourceRoots.map((root) =>
|
|
16287
|
+
const skipRoots = userSourceRoots.map((root) => resolve26(root));
|
|
16271
16288
|
const isUserSource = (path) => skipRoots.some((root) => path.startsWith(`${root}/`));
|
|
16272
16289
|
bld.onLoad({ filter: /\.[mc]?[jt]sx?$/ }, async (args) => {
|
|
16273
16290
|
if (isUserSource(args.path))
|
|
@@ -16282,13 +16299,13 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
16282
16299
|
const relPath = match[1];
|
|
16283
16300
|
if (!relPath)
|
|
16284
16301
|
continue;
|
|
16285
|
-
const assetPath =
|
|
16286
|
-
if (!
|
|
16302
|
+
const assetPath = resolve26(sourceDir, relPath);
|
|
16303
|
+
if (!existsSync25(assetPath))
|
|
16287
16304
|
continue;
|
|
16288
16305
|
if (!statSync3(assetPath).isFile())
|
|
16289
16306
|
continue;
|
|
16290
16307
|
const targetPath = join31(outDir, basename9(assetPath));
|
|
16291
|
-
if (
|
|
16308
|
+
if (existsSync25(targetPath))
|
|
16292
16309
|
continue;
|
|
16293
16310
|
mkdirSync6(dirname16(targetPath), { recursive: true });
|
|
16294
16311
|
copyFileSync(assetPath, targetPath);
|
|
@@ -16492,9 +16509,9 @@ var init_islandRegistryTransform = __esm(() => {
|
|
|
16492
16509
|
});
|
|
16493
16510
|
|
|
16494
16511
|
// src/build/vueModuleOutputPath.ts
|
|
16495
|
-
import { isAbsolute as isAbsolute5, join as join32, parse as parse2, relative as relative12, resolve as
|
|
16512
|
+
import { isAbsolute as isAbsolute5, join as join32, parse as parse2, relative as relative12, resolve as resolve27, sep as sep4 } from "path";
|
|
16496
16513
|
var vueModuleOutputPath = (outputDir, sourcePath) => {
|
|
16497
|
-
const absolutePath =
|
|
16514
|
+
const absolutePath = resolve27(sourcePath);
|
|
16498
16515
|
const { root } = parse2(absolutePath);
|
|
16499
16516
|
return join32(outputDir, "sources", encodeURIComponent(root), relative12(root, absolutePath).replace(/\.(vue|ts)$/, ".js"));
|
|
16500
16517
|
}, vueModuleSourcePath = (outputDir, outputPath) => {
|
|
@@ -16516,8 +16533,8 @@ var vueModuleOutputPath = (outputDir, sourcePath) => {
|
|
|
16516
16533
|
var init_vueModuleOutputPath = () => {};
|
|
16517
16534
|
|
|
16518
16535
|
// src/build/injectVueComposableTracking.ts
|
|
16519
|
-
import { existsSync as
|
|
16520
|
-
import { basename as basename11, isAbsolute as isAbsolute6, relative as relative13, resolve as
|
|
16536
|
+
import { existsSync as existsSync26, readFileSync as readFileSync21, writeFileSync as writeFileSync7 } from "fs";
|
|
16537
|
+
import { basename as basename11, isAbsolute as isAbsolute6, relative as relative13, resolve as resolve28 } from "path";
|
|
16521
16538
|
var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT_OPENER, SOURCE_EXTENSIONS2, CHUNK_REFERENCE, isSharedChunkFile = (fileName) => fileName.startsWith("chunk-") && fileName.endsWith(".js"), collectModuleComments = (content) => Array.from(content.matchAll(MODULE_COMMENT), (match) => ({
|
|
16522
16539
|
index: match.index,
|
|
16523
16540
|
path: match[1] ?? ""
|
|
@@ -16619,7 +16636,7 @@ var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT
|
|
|
16619
16636
|
return restore(`${wrapped.slice(0, insertAt)}${VUE_HMR_RUNTIME}
|
|
16620
16637
|
${wrapped.slice(insertAt)}`);
|
|
16621
16638
|
}, isSharedChunkPath = (path) => isSharedChunkFile(basename11(path)), resolveVueComposableModuleId = (commentPath, options) => {
|
|
16622
|
-
const absolutePath =
|
|
16639
|
+
const absolutePath = resolve28(options.projectRoot, commentPath);
|
|
16623
16640
|
const { vueDir, generatedVueDir } = options;
|
|
16624
16641
|
if (!vueDir || !generatedVueDir)
|
|
16625
16642
|
return absolutePath;
|
|
@@ -16627,11 +16644,11 @@ ${wrapped.slice(insertAt)}`);
|
|
|
16627
16644
|
if (withinGenerated === "" || withinGenerated.startsWith("..") || isAbsolute6(withinGenerated)) {
|
|
16628
16645
|
return absolutePath;
|
|
16629
16646
|
}
|
|
16630
|
-
const sourcePath = vueModuleSourcePath(
|
|
16647
|
+
const sourcePath = vueModuleSourcePath(resolve28(generatedVueDir, "client"), absolutePath);
|
|
16631
16648
|
if (!sourcePath)
|
|
16632
16649
|
return absolutePath;
|
|
16633
16650
|
const stem = sourcePath.replace(/\.[cm]?js$/, "");
|
|
16634
|
-
const existing = SOURCE_EXTENSIONS2.map((extension) => `${stem}${extension}`).find((candidate) =>
|
|
16651
|
+
const existing = SOURCE_EXTENSIONS2.map((extension) => `${stem}${extension}`).find((candidate) => existsSync26(candidate));
|
|
16635
16652
|
return existing ?? `${stem}.ts`;
|
|
16636
16653
|
};
|
|
16637
16654
|
var init_injectVueComposableTracking = __esm(() => {
|
|
@@ -16668,7 +16685,7 @@ var init_injectVueComposableTracking = __esm(() => {
|
|
|
16668
16685
|
|
|
16669
16686
|
// src/dev/angular/hmrInjectionPlugin.ts
|
|
16670
16687
|
import { readFile as readFile7 } from "fs/promises";
|
|
16671
|
-
import { relative as relative14, resolve as
|
|
16688
|
+
import { relative as relative14, resolve as resolve29 } from "path";
|
|
16672
16689
|
var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
|
|
16673
16690
|
const names = new Set;
|
|
16674
16691
|
IMPORT_RE.lastIndex = 0;
|
|
@@ -16847,7 +16864,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
16847
16864
|
}
|
|
16848
16865
|
`, applyAngularHmrInjection = (jsSource, componentJsAbsPath, params) => {
|
|
16849
16866
|
const { generatedAngularRoot, userAngularRoot, projectRoot } = params;
|
|
16850
|
-
const normalizedGenRoot =
|
|
16867
|
+
const normalizedGenRoot = resolve29(generatedAngularRoot).replace(/\\/g, "/");
|
|
16851
16868
|
const normalizedPath = componentJsAbsPath.replace(/\\/g, "/");
|
|
16852
16869
|
if (!normalizedPath.startsWith(`${normalizedGenRoot}/`))
|
|
16853
16870
|
return;
|
|
@@ -16865,7 +16882,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
16865
16882
|
if (classNames.length === 0)
|
|
16866
16883
|
return;
|
|
16867
16884
|
const relFromGenRoot = relative14(generatedAngularRoot, componentJsAbsPath).replace(/\\/g, "/");
|
|
16868
|
-
const userTsPath =
|
|
16885
|
+
const userTsPath = resolve29(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
|
|
16869
16886
|
const projectRel = relative14(projectRoot, userTsPath).replace(/\\/g, "/");
|
|
16870
16887
|
const tail = classNames.map((className) => {
|
|
16871
16888
|
const id = `${projectRel}@${className}`;
|
|
@@ -16900,14 +16917,14 @@ var init_hmrInjectionPlugin = __esm(() => {
|
|
|
16900
16917
|
|
|
16901
16918
|
// src/utils/cleanStaleOutputs.ts
|
|
16902
16919
|
import { rm as rm4 } from "fs/promises";
|
|
16903
|
-
import { resolve as
|
|
16920
|
+
import { resolve as resolve30 } from "path";
|
|
16904
16921
|
var {Glob: Glob5 } = globalThis.Bun;
|
|
16905
16922
|
var HASHED_FILE_PATTERN, ROOT_CHUNK_PATTERN, isContentAddressedOutput = (relativePath) => HASHED_FILE_PATTERN.test(relativePath) || ROOT_CHUNK_PATTERN.test(relativePath), cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
16906
|
-
const currentPaths = new Set(currentOutputPaths.map((path) =>
|
|
16923
|
+
const currentPaths = new Set(currentOutputPaths.map((path) => resolve30(path)));
|
|
16907
16924
|
const glob = new Glob5("**/*");
|
|
16908
16925
|
const removals = [];
|
|
16909
16926
|
for (const relative of glob.scanSync({ cwd: buildPath })) {
|
|
16910
|
-
const absolute =
|
|
16927
|
+
const absolute = resolve30(buildPath, relative);
|
|
16911
16928
|
if (currentPaths.has(absolute))
|
|
16912
16929
|
continue;
|
|
16913
16930
|
if (!isContentAddressedOutput(relative))
|
|
@@ -17159,10 +17176,10 @@ var init_buildDirectoryLock = __esm(() => {
|
|
|
17159
17176
|
});
|
|
17160
17177
|
|
|
17161
17178
|
// src/utils/validateSafePath.ts
|
|
17162
|
-
import { resolve as
|
|
17179
|
+
import { resolve as resolve31, relative as relative15 } from "path";
|
|
17163
17180
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
17164
|
-
const absoluteBase =
|
|
17165
|
-
const absoluteTarget =
|
|
17181
|
+
const absoluteBase = resolve31(baseDirectory);
|
|
17182
|
+
const absoluteTarget = resolve31(baseDirectory, targetPath);
|
|
17166
17183
|
const relativePath = normalizePath2(relative15(absoluteBase, absoluteTarget));
|
|
17167
17184
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
17168
17185
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
@@ -18030,8 +18047,8 @@ var init_typescript_translator = __esm(() => {
|
|
|
18030
18047
|
});
|
|
18031
18048
|
|
|
18032
18049
|
// src/dev/angular/fastHmrCompiler.ts
|
|
18033
|
-
import { existsSync as
|
|
18034
|
-
import { dirname as dirname19, extname as extname11, relative as relative16, resolve as
|
|
18050
|
+
import { existsSync as existsSync27, readFileSync as readFileSync23, statSync as statSync4 } from "fs";
|
|
18051
|
+
import { dirname as dirname19, extname as extname11, relative as relative16, resolve as resolve32 } from "path";
|
|
18035
18052
|
import ts12 from "typescript";
|
|
18036
18053
|
var fail = (reason, detail, location) => ({
|
|
18037
18054
|
detail,
|
|
@@ -18344,7 +18361,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18344
18361
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
18345
18362
|
return true;
|
|
18346
18363
|
}
|
|
18347
|
-
const base =
|
|
18364
|
+
const base = resolve32(componentDir, spec);
|
|
18348
18365
|
const candidates = [
|
|
18349
18366
|
`${base}.ts`,
|
|
18350
18367
|
`${base}.tsx`,
|
|
@@ -18352,7 +18369,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18352
18369
|
`${base}/index.tsx`
|
|
18353
18370
|
];
|
|
18354
18371
|
for (const candidate of candidates) {
|
|
18355
|
-
if (!
|
|
18372
|
+
if (!existsSync27(candidate))
|
|
18356
18373
|
continue;
|
|
18357
18374
|
let content;
|
|
18358
18375
|
try {
|
|
@@ -19117,7 +19134,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19117
19134
|
if (visited.has(startDtsPath))
|
|
19118
19135
|
return null;
|
|
19119
19136
|
visited.add(startDtsPath);
|
|
19120
|
-
if (!
|
|
19137
|
+
if (!existsSync27(startDtsPath))
|
|
19121
19138
|
return null;
|
|
19122
19139
|
let content;
|
|
19123
19140
|
try {
|
|
@@ -19160,7 +19177,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19160
19177
|
return null;
|
|
19161
19178
|
}, resolveDtsFromSpec = (spec, fromDir) => {
|
|
19162
19179
|
const stripped = spec.replace(/\.[mc]?js$/, "");
|
|
19163
|
-
const base =
|
|
19180
|
+
const base = resolve32(fromDir, stripped);
|
|
19164
19181
|
const candidates = [
|
|
19165
19182
|
`${base}.d.ts`,
|
|
19166
19183
|
`${base}.d.mts`,
|
|
@@ -19170,21 +19187,21 @@ var fail = (reason, detail, location) => ({
|
|
|
19170
19187
|
`${base}/index.d.cts`
|
|
19171
19188
|
];
|
|
19172
19189
|
for (const c of candidates) {
|
|
19173
|
-
if (
|
|
19190
|
+
if (existsSync27(c))
|
|
19174
19191
|
return c;
|
|
19175
19192
|
}
|
|
19176
19193
|
return null;
|
|
19177
19194
|
}, findPackageDtsForJs = (jsPath) => {
|
|
19178
19195
|
const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
|
|
19179
|
-
if (
|
|
19196
|
+
if (existsSync27(sibling))
|
|
19180
19197
|
return sibling;
|
|
19181
19198
|
const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
|
|
19182
|
-
if (
|
|
19199
|
+
if (existsSync27(mirror))
|
|
19183
19200
|
return mirror;
|
|
19184
19201
|
return null;
|
|
19185
19202
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
19186
19203
|
if (spec.startsWith(".") || spec.startsWith("/")) {
|
|
19187
|
-
const base =
|
|
19204
|
+
const base = resolve32(componentDir, spec);
|
|
19188
19205
|
const candidates = [
|
|
19189
19206
|
`${base}.ts`,
|
|
19190
19207
|
`${base}.tsx`,
|
|
@@ -19192,7 +19209,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19192
19209
|
`${base}/index.tsx`
|
|
19193
19210
|
];
|
|
19194
19211
|
for (const candidate of candidates) {
|
|
19195
|
-
if (!
|
|
19212
|
+
if (!existsSync27(candidate))
|
|
19196
19213
|
continue;
|
|
19197
19214
|
const info = getChildComponentInfoFromTsSource(candidate, className);
|
|
19198
19215
|
if (info)
|
|
@@ -19403,14 +19420,14 @@ var fail = (reason, detail, location) => ({
|
|
|
19403
19420
|
}
|
|
19404
19421
|
if (!matches)
|
|
19405
19422
|
continue;
|
|
19406
|
-
const resolved =
|
|
19423
|
+
const resolved = resolve32(componentDir, spec);
|
|
19407
19424
|
for (const ext of TS_EXTENSIONS) {
|
|
19408
19425
|
const candidate = resolved + ext;
|
|
19409
|
-
if (
|
|
19426
|
+
if (existsSync27(candidate))
|
|
19410
19427
|
return candidate;
|
|
19411
19428
|
}
|
|
19412
|
-
const indexCandidate =
|
|
19413
|
-
if (
|
|
19429
|
+
const indexCandidate = resolve32(resolved, "index.ts");
|
|
19430
|
+
if (existsSync27(indexCandidate))
|
|
19414
19431
|
return indexCandidate;
|
|
19415
19432
|
}
|
|
19416
19433
|
return null;
|
|
@@ -19647,8 +19664,8 @@ ${transpiled}
|
|
|
19647
19664
|
}
|
|
19648
19665
|
}${staticPatch}`;
|
|
19649
19666
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
19650
|
-
const abs =
|
|
19651
|
-
if (!
|
|
19667
|
+
const abs = resolve32(componentDir, url);
|
|
19668
|
+
if (!existsSync27(abs))
|
|
19652
19669
|
return null;
|
|
19653
19670
|
const ext = extname11(abs).toLowerCase();
|
|
19654
19671
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
@@ -19686,9 +19703,9 @@ ${block}
|
|
|
19686
19703
|
const cached = projectOptionsCache.get(projectRoot);
|
|
19687
19704
|
if (cached !== undefined)
|
|
19688
19705
|
return cached;
|
|
19689
|
-
const tsconfigPath =
|
|
19706
|
+
const tsconfigPath = resolve32(projectRoot, "tsconfig.json");
|
|
19690
19707
|
const opts = {};
|
|
19691
|
-
if (
|
|
19708
|
+
if (existsSync27(tsconfigPath)) {
|
|
19692
19709
|
try {
|
|
19693
19710
|
const text = readFileSync23(tsconfigPath, "utf8");
|
|
19694
19711
|
const parsed = ts12.parseConfigFileTextToJson(tsconfigPath, text);
|
|
@@ -19715,7 +19732,7 @@ ${block}
|
|
|
19715
19732
|
}, tryFastHmr = async (params) => {
|
|
19716
19733
|
const { componentFilePath, className } = params;
|
|
19717
19734
|
const projectRoot = params.projectRoot ?? process.cwd();
|
|
19718
|
-
if (!
|
|
19735
|
+
if (!existsSync27(componentFilePath)) {
|
|
19719
19736
|
return fail("file-not-found", componentFilePath);
|
|
19720
19737
|
}
|
|
19721
19738
|
let compiler;
|
|
@@ -19770,8 +19787,8 @@ ${block}
|
|
|
19770
19787
|
templateText = decoratorMeta.template;
|
|
19771
19788
|
templatePath = componentFilePath;
|
|
19772
19789
|
} else if (decoratorMeta.templateUrl) {
|
|
19773
|
-
const tplAbs =
|
|
19774
|
-
if (!
|
|
19790
|
+
const tplAbs = resolve32(componentDir, decoratorMeta.templateUrl);
|
|
19791
|
+
if (!existsSync27(tplAbs)) {
|
|
19775
19792
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
19776
19793
|
}
|
|
19777
19794
|
templateText = readFileSync23(tplAbs, "utf8");
|
|
@@ -20510,7 +20527,7 @@ var init_runAngularHandlerScan = __esm(() => {
|
|
|
20510
20527
|
});
|
|
20511
20528
|
|
|
20512
20529
|
// src/build/parseAngularConfigImports.ts
|
|
20513
|
-
import { existsSync as
|
|
20530
|
+
import { existsSync as existsSync28, readFileSync as readFileSync27 } from "fs";
|
|
20514
20531
|
import { dirname as dirname20, isAbsolute as isAbsolute7, join as join40 } from "path";
|
|
20515
20532
|
import ts16 from "typescript";
|
|
20516
20533
|
var findDefineConfigCall = (sf) => {
|
|
@@ -20567,7 +20584,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
20567
20584
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
20568
20585
|
if (envOverride) {
|
|
20569
20586
|
const resolved = isAbsolute7(envOverride) ? envOverride : join40(projectRoot, envOverride);
|
|
20570
|
-
if (
|
|
20587
|
+
if (existsSync28(resolved))
|
|
20571
20588
|
return resolved;
|
|
20572
20589
|
}
|
|
20573
20590
|
const candidates = [
|
|
@@ -20577,7 +20594,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
20577
20594
|
join40(projectRoot, "absolute.config.mjs")
|
|
20578
20595
|
];
|
|
20579
20596
|
for (const candidate of candidates) {
|
|
20580
|
-
if (
|
|
20597
|
+
if (existsSync28(candidate))
|
|
20581
20598
|
return candidate;
|
|
20582
20599
|
}
|
|
20583
20600
|
return null;
|
|
@@ -20668,14 +20685,14 @@ var init_renderToReadableStream = __esm(() => {
|
|
|
20668
20685
|
});
|
|
20669
20686
|
|
|
20670
20687
|
// src/build/compileSvelte.ts
|
|
20671
|
-
import { existsSync as
|
|
20688
|
+
import { existsSync as existsSync29 } from "fs";
|
|
20672
20689
|
import { mkdir as mkdir8, stat as stat3 } from "fs/promises";
|
|
20673
20690
|
import {
|
|
20674
20691
|
dirname as dirname21,
|
|
20675
20692
|
join as join41,
|
|
20676
20693
|
basename as basename13,
|
|
20677
20694
|
extname as extname12,
|
|
20678
|
-
resolve as
|
|
20695
|
+
resolve as resolve33,
|
|
20679
20696
|
relative as relative17,
|
|
20680
20697
|
sep as sep5
|
|
20681
20698
|
} from "path";
|
|
@@ -20683,14 +20700,14 @@ import { env as env2 } from "process";
|
|
|
20683
20700
|
var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
20684
20701
|
var resolveDevClientDir2 = () => {
|
|
20685
20702
|
const projectRoot = process.cwd();
|
|
20686
|
-
const fromSource =
|
|
20687
|
-
if (
|
|
20703
|
+
const fromSource = resolve33(import.meta.dir, "../dev/client");
|
|
20704
|
+
if (existsSync29(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
20688
20705
|
return fromSource;
|
|
20689
20706
|
}
|
|
20690
|
-
const fromNodeModules =
|
|
20691
|
-
if (
|
|
20707
|
+
const fromNodeModules = resolve33(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
20708
|
+
if (existsSync29(fromNodeModules))
|
|
20692
20709
|
return fromNodeModules;
|
|
20693
|
-
return
|
|
20710
|
+
return resolve33(import.meta.dir, "./dev/client");
|
|
20694
20711
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, transpiler3, removeUnusedRequireHelper = (code) => {
|
|
20695
20712
|
const helperStart = code.indexOf("var __require = /* @__PURE__ */");
|
|
20696
20713
|
if (helperStart === -1) {
|
|
@@ -20717,7 +20734,7 @@ var resolveDevClientDir2 = () => {
|
|
|
20717
20734
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
20718
20735
|
if (!spec.startsWith("."))
|
|
20719
20736
|
return null;
|
|
20720
|
-
const basePath =
|
|
20737
|
+
const basePath = resolve33(dirname21(from), spec);
|
|
20721
20738
|
const candidates = [
|
|
20722
20739
|
basePath,
|
|
20723
20740
|
`${basePath}.ts`,
|
|
@@ -20744,7 +20761,7 @@ var resolveDevClientDir2 = () => {
|
|
|
20744
20761
|
const resolved = resolvePackageImport(spec);
|
|
20745
20762
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
20746
20763
|
}
|
|
20747
|
-
const basePath =
|
|
20764
|
+
const basePath = resolve33(dirname21(from), spec);
|
|
20748
20765
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
20749
20766
|
if (!explicit) {
|
|
20750
20767
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -20788,7 +20805,7 @@ var resolveDevClientDir2 = () => {
|
|
|
20788
20805
|
const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
|
|
20789
20806
|
const prevHash = sourceHashCache.get(src);
|
|
20790
20807
|
const persistent = persistentCache.get(src);
|
|
20791
|
-
if (prevHash === contentHash && persistent &&
|
|
20808
|
+
if (prevHash === contentHash && persistent && existsSync29(persistent.ssr) && existsSync29(persistent.client)) {
|
|
20792
20809
|
cache.set(src, persistent);
|
|
20793
20810
|
return persistent;
|
|
20794
20811
|
}
|
|
@@ -21519,9 +21536,9 @@ var init_chainInlineSourcemaps = __esm(() => {
|
|
|
21519
21536
|
|
|
21520
21537
|
// src/build/vueCompileCache.ts
|
|
21521
21538
|
import { createHash as createHash6 } from "crypto";
|
|
21522
|
-
import { existsSync as
|
|
21539
|
+
import { existsSync as existsSync30, readFileSync as readFileSync29 } from "fs";
|
|
21523
21540
|
import { mkdir as mkdir9, rename as rename2, writeFile as writeFile9 } from "fs/promises";
|
|
21524
|
-
import { join as join42, resolve as
|
|
21541
|
+
import { join as join42, resolve as resolve34 } from "path";
|
|
21525
21542
|
var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs", CACHE_FORMAT_VERSION = 2, FILE_NAME_HASH_LENGTH = 32, vueCompileCacheEnabled = () => process.env.ABSOLUTE_COMPILE_CACHE !== "0", hashContent = (content) => createHash6("sha256").update(content).digest("hex"), hashParts = (parts) => {
|
|
21526
21543
|
const hash = createHash6("sha256");
|
|
21527
21544
|
for (const part of parts) {
|
|
@@ -21531,8 +21548,8 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
21531
21548
|
return hash.digest("hex");
|
|
21532
21549
|
}, readOwnPackageVersion = () => {
|
|
21533
21550
|
const candidates = [
|
|
21534
|
-
|
|
21535
|
-
|
|
21551
|
+
resolve34(import.meta.dir, "..", "..", "package.json"),
|
|
21552
|
+
resolve34(import.meta.dir, "..", "package.json")
|
|
21536
21553
|
];
|
|
21537
21554
|
for (const candidate of candidates) {
|
|
21538
21555
|
try {
|
|
@@ -21580,7 +21597,7 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
21580
21597
|
if (!vueCompileCacheEnabled())
|
|
21581
21598
|
return null;
|
|
21582
21599
|
const entryFile = entryFileFor(sourceFilePath, projectRoot);
|
|
21583
|
-
if (!
|
|
21600
|
+
if (!existsSync30(entryFile))
|
|
21584
21601
|
return null;
|
|
21585
21602
|
try {
|
|
21586
21603
|
const parsed = JSON.parse(readFileSync29(entryFile, "utf-8"));
|
|
@@ -21611,7 +21628,7 @@ __export(exports_emitTsHelpers, {
|
|
|
21611
21628
|
emitTsHelpers: () => emitTsHelpers
|
|
21612
21629
|
});
|
|
21613
21630
|
var {file: file3, Transpiler: Transpiler3, write: write3 } = globalThis.Bun;
|
|
21614
|
-
import { copyFileSync as copyFileSync2, existsSync as
|
|
21631
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync31, readdirSync as readdirSync6 } from "fs";
|
|
21615
21632
|
import { mkdir as mkdir10, rename as rename3, writeFile as writeFile10 } from "fs/promises";
|
|
21616
21633
|
import { dirname as dirname22, join as join43 } from "path";
|
|
21617
21634
|
var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24, transpiler4, cacheDir = () => join43(process.cwd(), ".absolutejs", "compile-cache", CACHE_DIR_NAME2), cacheKey2 = (sourcePath, sourceCode) => {
|
|
@@ -21683,7 +21700,7 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24
|
|
|
21683
21700
|
const directory = cacheDir();
|
|
21684
21701
|
const fileName = key ? `${key.path}-${key.content}.js` : null;
|
|
21685
21702
|
const cachedPath = fileName ? join43(directory, fileName) : null;
|
|
21686
|
-
if (cachedPath &&
|
|
21703
|
+
if (cachedPath && existsSync31(cachedPath)) {
|
|
21687
21704
|
await copyBoth(clientOutputPath, serverOutputPath, cachedPath);
|
|
21688
21705
|
return;
|
|
21689
21706
|
}
|
|
@@ -21706,8 +21723,8 @@ var init_emitTsHelpers = __esm(() => {
|
|
|
21706
21723
|
});
|
|
21707
21724
|
|
|
21708
21725
|
// src/build/compileVueSfc.ts
|
|
21709
|
-
import { existsSync as
|
|
21710
|
-
import { dirname as dirname23, relative as relative18, resolve as
|
|
21726
|
+
import { existsSync as existsSync32, readFileSync as readFileSync30, realpathSync as realpathSync2 } from "fs";
|
|
21727
|
+
import { dirname as dirname23, relative as relative18, resolve as resolve35 } from "path";
|
|
21711
21728
|
var {Transpiler: Transpiler4 } = globalThis.Bun;
|
|
21712
21729
|
var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
21713
21730
|
const resolved = realpathSync2(cssFilePath);
|
|
@@ -21716,7 +21733,7 @@ var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set)
|
|
|
21716
21733
|
visited.add(resolved);
|
|
21717
21734
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
21718
21735
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
21719
|
-
const importedPath =
|
|
21736
|
+
const importedPath = resolve35(dirname23(cssFilePath), relPath);
|
|
21720
21737
|
if (!isFile(importedPath))
|
|
21721
21738
|
return match;
|
|
21722
21739
|
const importedContent = readFileSync30(importedPath, "utf-8");
|
|
@@ -21729,16 +21746,16 @@ var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set)
|
|
|
21729
21746
|
return filePath.replace(/\.ts$/, ".js");
|
|
21730
21747
|
if (isStylePath(filePath)) {
|
|
21731
21748
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
21732
|
-
return
|
|
21749
|
+
return resolve35(sourceDir, filePath);
|
|
21733
21750
|
}
|
|
21734
21751
|
return filePath;
|
|
21735
21752
|
}
|
|
21736
21753
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
21737
|
-
const directTs =
|
|
21738
|
-
if (
|
|
21754
|
+
const directTs = resolve35(sourceDir, `${filePath}.ts`);
|
|
21755
|
+
if (existsSync32(directTs))
|
|
21739
21756
|
return `${filePath}.js`;
|
|
21740
|
-
const indexedTs =
|
|
21741
|
-
if (
|
|
21757
|
+
const indexedTs = resolve35(sourceDir, filePath, "index.ts");
|
|
21758
|
+
if (existsSync32(indexedTs))
|
|
21742
21759
|
return `${filePath}/index.js`;
|
|
21743
21760
|
}
|
|
21744
21761
|
return `${filePath}.js`;
|
|
@@ -21820,7 +21837,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
21820
21837
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
21821
21838
|
const typeDependencies = "deps" in compiledScript ? compiledScript.deps ?? [] : [];
|
|
21822
21839
|
for (const dep of typeDependencies) {
|
|
21823
|
-
if (dep in typeDepHashes || !
|
|
21840
|
+
if (dep in typeDepHashes || !existsSync32(dep))
|
|
21824
21841
|
continue;
|
|
21825
21842
|
typeDepHashes[dep] = hashContent(readFileSync30(dep, "utf-8"));
|
|
21826
21843
|
}
|
|
@@ -21977,7 +21994,7 @@ var init_workerJobs = __esm(() => {
|
|
|
21977
21994
|
});
|
|
21978
21995
|
|
|
21979
21996
|
// src/build/workerPool.ts
|
|
21980
|
-
import { existsSync as
|
|
21997
|
+
import { existsSync as existsSync33, readFileSync as readFileSync31 } from "fs";
|
|
21981
21998
|
import { availableParallelism, freemem } from "os";
|
|
21982
21999
|
import { dirname as dirname24, join as join44 } from "path";
|
|
21983
22000
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
@@ -21997,7 +22014,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
21997
22014
|
return Math.max(MIN_WORKERS, Math.min(byCpu, byMemory));
|
|
21998
22015
|
}, isOwnPackageRoot = (dir) => {
|
|
21999
22016
|
const packageFile = join44(dir, "package.json");
|
|
22000
|
-
if (!
|
|
22017
|
+
if (!existsSync33(packageFile))
|
|
22001
22018
|
return false;
|
|
22002
22019
|
try {
|
|
22003
22020
|
const pkg = JSON.parse(readFileSync31(packageFile, "utf-8"));
|
|
@@ -22024,7 +22041,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
22024
22041
|
const sourceEntry = join44(root, "src", "build", "buildWorker.ts");
|
|
22025
22042
|
const runningFromDist = fromDir.startsWith(join44(root, "dist"));
|
|
22026
22043
|
const ordered = runningFromDist ? [distEntry, sourceEntry] : [sourceEntry, distEntry];
|
|
22027
|
-
return ordered.find((candidate) =>
|
|
22044
|
+
return ordered.find((candidate) => existsSync33(candidate)) ?? null;
|
|
22028
22045
|
}, formatPercent = (ratio) => `${Math.round(ratio * PERCENT)}%`, createBuildWorkerPool = (options = {}) => {
|
|
22029
22046
|
const size = options.size ?? resolveBuildWorkerCount();
|
|
22030
22047
|
const entry = options.entry === undefined ? resolveBuildWorkerEntry() : options.entry;
|
|
@@ -22302,7 +22319,7 @@ var init_workerPool = __esm(() => {
|
|
|
22302
22319
|
});
|
|
22303
22320
|
|
|
22304
22321
|
// src/build/compileVue.ts
|
|
22305
|
-
import { existsSync as
|
|
22322
|
+
import { existsSync as existsSync34 } from "fs";
|
|
22306
22323
|
import { mkdir as mkdir11 } from "fs/promises";
|
|
22307
22324
|
import {
|
|
22308
22325
|
basename as basename14,
|
|
@@ -22310,19 +22327,19 @@ import {
|
|
|
22310
22327
|
isAbsolute as isAbsolute8,
|
|
22311
22328
|
join as join45,
|
|
22312
22329
|
relative as relative19,
|
|
22313
|
-
resolve as
|
|
22330
|
+
resolve as resolve36
|
|
22314
22331
|
} from "path";
|
|
22315
22332
|
var {file: file4, write: write4 } = globalThis.Bun;
|
|
22316
22333
|
var resolveDevClientDir3 = () => {
|
|
22317
22334
|
const projectRoot = process.cwd();
|
|
22318
|
-
const fromSource =
|
|
22319
|
-
if (
|
|
22335
|
+
const fromSource = resolve36(import.meta.dir, "../dev/client");
|
|
22336
|
+
if (existsSync34(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
22320
22337
|
return fromSource;
|
|
22321
22338
|
}
|
|
22322
|
-
const fromNodeModules =
|
|
22323
|
-
if (
|
|
22339
|
+
const fromNodeModules = resolve36(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
22340
|
+
if (existsSync34(fromNodeModules))
|
|
22324
22341
|
return fromNodeModules;
|
|
22325
|
-
return
|
|
22342
|
+
return resolve36(import.meta.dir, "./dev/client");
|
|
22326
22343
|
}, devClientDir3, hmrClientPath4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, detectVueChangeType = (filePath, descriptor) => {
|
|
22327
22344
|
const prevScript = scriptCache.get(filePath);
|
|
22328
22345
|
const prevScriptSetup = scriptSetupCache.get(filePath);
|
|
@@ -22363,12 +22380,12 @@ var resolveDevClientDir3 = () => {
|
|
|
22363
22380
|
return Array.from(new Set(found));
|
|
22364
22381
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
22365
22382
|
if (helper.endsWith(".ts"))
|
|
22366
|
-
return
|
|
22367
|
-
const direct =
|
|
22368
|
-
if (
|
|
22383
|
+
return resolve36(sourceDir, helper);
|
|
22384
|
+
const direct = resolve36(sourceDir, `${helper}.ts`);
|
|
22385
|
+
if (existsSync34(direct))
|
|
22369
22386
|
return direct;
|
|
22370
|
-
const indexed =
|
|
22371
|
-
if (
|
|
22387
|
+
const indexed = resolve36(sourceDir, helper, "index.ts");
|
|
22388
|
+
if (existsSync34(indexed))
|
|
22372
22389
|
return indexed;
|
|
22373
22390
|
return direct;
|
|
22374
22391
|
}, HELPER_JOB_MIN_BATCH = 24, runHelperEmit = async (files) => {
|
|
@@ -22498,7 +22515,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22498
22515
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
22499
22516
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
22500
22517
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
22501
|
-
if (prevHash === contentHash && persistent &&
|
|
22518
|
+
if (prevHash === contentHash && persistent && existsSync34(persistent.clientPath) && existsSync34(persistent.serverPath)) {
|
|
22502
22519
|
cacheMap.set(sourceFilePath, persistent);
|
|
22503
22520
|
return persistent;
|
|
22504
22521
|
}
|
|
@@ -22527,12 +22544,12 @@ var resolveDevClientDir3 = () => {
|
|
|
22527
22544
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
22528
22545
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
22529
22546
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
22530
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute8(path)) && isStylePath(path)).map((path) => isAbsolute8(path) ? path :
|
|
22547
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute8(path)) && isStylePath(path)).map((path) => isAbsolute8(path) ? path : resolve36(dirname25(sourceFilePath), path));
|
|
22531
22548
|
for (const stylePath of stylePathsImported) {
|
|
22532
22549
|
addStyleImporter(sourceFilePath, stylePath);
|
|
22533
22550
|
}
|
|
22534
22551
|
const childBuildResults = await Promise.all([
|
|
22535
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
22552
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve36(dirname25(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
|
|
22536
22553
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors))
|
|
22537
22554
|
]);
|
|
22538
22555
|
const cacheKeyStartedAt = performance.now();
|
|
@@ -22640,7 +22657,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22640
22657
|
const buildCache = new Map;
|
|
22641
22658
|
const allTsHelperPaths = new Set;
|
|
22642
22659
|
const expandSpaRouteChildren = async (entries) => {
|
|
22643
|
-
const expanded = new Set(entries.map((entry) =>
|
|
22660
|
+
const expanded = new Set(entries.map((entry) => resolve36(entry)));
|
|
22644
22661
|
const queue = [...expanded];
|
|
22645
22662
|
while (queue.length > 0) {
|
|
22646
22663
|
const entryPath = queue.pop();
|
|
@@ -22657,8 +22674,8 @@ var resolveDevClientDir3 = () => {
|
|
|
22657
22674
|
});
|
|
22658
22675
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
22659
22676
|
for (const { importPath } of routes) {
|
|
22660
|
-
const childPath =
|
|
22661
|
-
if (expanded.has(childPath) || !
|
|
22677
|
+
const childPath = resolve36(dirname25(entryPath), importPath);
|
|
22678
|
+
if (expanded.has(childPath) || !existsSync34(childPath)) {
|
|
22662
22679
|
continue;
|
|
22663
22680
|
}
|
|
22664
22681
|
expanded.add(childPath);
|
|
@@ -22672,7 +22689,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22672
22689
|
vueCompileProfile.stageExpandMs = performance.now() - stageStartedAt;
|
|
22673
22690
|
stageStartedAt = performance.now();
|
|
22674
22691
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
22675
|
-
const resolvedEntryPath =
|
|
22692
|
+
const resolvedEntryPath = resolve36(entryPath);
|
|
22676
22693
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
22677
22694
|
client: clientOutputDir,
|
|
22678
22695
|
css: cssOutputDir,
|
|
@@ -22865,7 +22882,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22865
22882
|
}));
|
|
22866
22883
|
vueCompileProfile.stagePagesMs = performance.now() - stageStartedAt;
|
|
22867
22884
|
stageStartedAt = performance.now();
|
|
22868
|
-
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname25(tsPath), dep)).filter((resolved) =>
|
|
22885
|
+
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname25(tsPath), dep)).filter((resolved) => existsSync34(resolved) && !allTsHelperPaths.has(resolved));
|
|
22869
22886
|
const readHelperWave = (paths) => Promise.all(paths.map((tsPath) => file4(tsPath).text().then((sourceCode) => helperDependencies(tsPath, sourceCode)).catch(() => [])));
|
|
22870
22887
|
const expandHelpers = async (frontier) => {
|
|
22871
22888
|
if (frontier.length === 0)
|
|
@@ -23435,8 +23452,8 @@ __export(exports_compileAngular, {
|
|
|
23435
23452
|
compileAngularFileJIT: () => compileAngularFileJIT,
|
|
23436
23453
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
23437
23454
|
});
|
|
23438
|
-
import { existsSync as
|
|
23439
|
-
import { join as join46, basename as basename15, sep as sep6, dirname as dirname26, resolve as
|
|
23455
|
+
import { existsSync as existsSync35, readFileSync as readFileSync32, promises as fs5 } from "fs";
|
|
23456
|
+
import { join as join46, basename as basename15, sep as sep6, dirname as dirname26, resolve as resolve37, relative as relative20 } from "path";
|
|
23440
23457
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
23441
23458
|
import ts18 from "typescript";
|
|
23442
23459
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
@@ -23452,10 +23469,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23452
23469
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
|
|
23453
23470
|
}, readTsconfigPathAliases = () => {
|
|
23454
23471
|
try {
|
|
23455
|
-
const configPath =
|
|
23472
|
+
const configPath = resolve37(process.cwd(), "tsconfig.json");
|
|
23456
23473
|
const config = ts18.readConfigFile(configPath, ts18.sys.readFile).config;
|
|
23457
23474
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
23458
|
-
const baseUrl =
|
|
23475
|
+
const baseUrl = resolve37(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
23459
23476
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
23460
23477
|
return { aliases, baseUrl };
|
|
23461
23478
|
} catch {
|
|
@@ -23475,7 +23492,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23475
23492
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
23476
23493
|
for (const replacement of alias.replacements) {
|
|
23477
23494
|
const candidate = replacement.replace("*", wildcardValue);
|
|
23478
|
-
const resolved = resolveSourceFile(
|
|
23495
|
+
const resolved = resolveSourceFile(resolve37(baseUrl, candidate));
|
|
23479
23496
|
if (resolved)
|
|
23480
23497
|
return resolved;
|
|
23481
23498
|
}
|
|
@@ -23492,15 +23509,15 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23492
23509
|
join46(candidate, "index.js"),
|
|
23493
23510
|
join46(candidate, "index.jsx")
|
|
23494
23511
|
];
|
|
23495
|
-
return candidates.find((file) =>
|
|
23512
|
+
return candidates.find((file) => existsSync35(file));
|
|
23496
23513
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
23497
|
-
const baseDir =
|
|
23514
|
+
const baseDir = resolve37(rootDir);
|
|
23498
23515
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
23499
23516
|
const transpiler = new Bun.Transpiler({ loader: "tsx" });
|
|
23500
23517
|
const scanCache = new Map;
|
|
23501
23518
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
23502
23519
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
23503
|
-
return resolveSourceFile(
|
|
23520
|
+
return resolveSourceFile(resolve37(fromDir, specifier));
|
|
23504
23521
|
}
|
|
23505
23522
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
23506
23523
|
if (aliased)
|
|
@@ -23509,7 +23526,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23509
23526
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
23510
23527
|
if (resolved.includes("/node_modules/"))
|
|
23511
23528
|
return;
|
|
23512
|
-
const absolute =
|
|
23529
|
+
const absolute = resolve37(resolved);
|
|
23513
23530
|
if (!absolute.startsWith(baseDir))
|
|
23514
23531
|
return;
|
|
23515
23532
|
return resolveSourceFile(absolute);
|
|
@@ -23525,7 +23542,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23525
23542
|
usesLegacyAnimations: false
|
|
23526
23543
|
});
|
|
23527
23544
|
}
|
|
23528
|
-
const resolved =
|
|
23545
|
+
const resolved = resolve37(actualPath);
|
|
23529
23546
|
const cached = scanCache.get(resolved);
|
|
23530
23547
|
if (cached)
|
|
23531
23548
|
return cached;
|
|
@@ -23554,7 +23571,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23554
23571
|
const actualPath = resolveSourceFile(filePath);
|
|
23555
23572
|
if (!actualPath)
|
|
23556
23573
|
return false;
|
|
23557
|
-
const resolved =
|
|
23574
|
+
const resolved = resolve37(actualPath);
|
|
23558
23575
|
if (visited.has(resolved))
|
|
23559
23576
|
return false;
|
|
23560
23577
|
visited.add(resolved);
|
|
@@ -23572,14 +23589,14 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23572
23589
|
return (entryPath) => visit(entryPath);
|
|
23573
23590
|
}, resolveDevClientDir4 = () => {
|
|
23574
23591
|
const projectRoot = process.cwd();
|
|
23575
|
-
const fromSource =
|
|
23576
|
-
if (
|
|
23592
|
+
const fromSource = resolve37(import.meta.dir, "../dev/client");
|
|
23593
|
+
if (existsSync35(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
23577
23594
|
return fromSource;
|
|
23578
23595
|
}
|
|
23579
|
-
const fromNodeModules =
|
|
23580
|
-
if (
|
|
23596
|
+
const fromNodeModules = resolve37(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
23597
|
+
if (existsSync35(fromNodeModules))
|
|
23581
23598
|
return fromNodeModules;
|
|
23582
|
-
return
|
|
23599
|
+
return resolve37(import.meta.dir, "./dev/client");
|
|
23583
23600
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
23584
23601
|
try {
|
|
23585
23602
|
return ts18.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -23622,12 +23639,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23622
23639
|
if (hasJsLikeExtension(path))
|
|
23623
23640
|
return `${path}${query}`;
|
|
23624
23641
|
const importerDir = dirname26(importerOutputPath);
|
|
23625
|
-
const fileCandidate =
|
|
23626
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
23642
|
+
const fileCandidate = resolve37(importerDir, `${path}.js`);
|
|
23643
|
+
if (outputFiles?.has(fileCandidate) || existsSync35(fileCandidate)) {
|
|
23627
23644
|
return `${path}.js${query}`;
|
|
23628
23645
|
}
|
|
23629
|
-
const indexCandidate =
|
|
23630
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
23646
|
+
const indexCandidate = resolve37(importerDir, path, "index.js");
|
|
23647
|
+
if (outputFiles?.has(indexCandidate) || existsSync35(indexCandidate)) {
|
|
23631
23648
|
return `${path}/index.js${query}`;
|
|
23632
23649
|
}
|
|
23633
23650
|
return `${path}.js${query}`;
|
|
@@ -23654,7 +23671,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23654
23671
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
23655
23672
|
if (!isRelativeModuleSpecifier(specifier))
|
|
23656
23673
|
return null;
|
|
23657
|
-
const basePath =
|
|
23674
|
+
const basePath = resolve37(dirname26(fromFile), specifier);
|
|
23658
23675
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
23659
23676
|
`${basePath}.ts`,
|
|
23660
23677
|
`${basePath}.tsx`,
|
|
@@ -23665,7 +23682,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23665
23682
|
join46(basePath, "index.mts"),
|
|
23666
23683
|
join46(basePath, "index.cts")
|
|
23667
23684
|
];
|
|
23668
|
-
return candidates.map((candidate) =>
|
|
23685
|
+
return candidates.map((candidate) => resolve37(candidate)).find((candidate) => existsSync35(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
23669
23686
|
}, readFileForAotTransform = async (fileName, readFile) => {
|
|
23670
23687
|
const hostSource = readFile?.(fileName);
|
|
23671
23688
|
if (typeof hostSource === "string")
|
|
@@ -23700,7 +23717,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23700
23717
|
paths.push(join46(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
23701
23718
|
}
|
|
23702
23719
|
}
|
|
23703
|
-
return paths.map((path) =>
|
|
23720
|
+
return paths.map((path) => resolve37(path));
|
|
23704
23721
|
}, readResourceCacheFile = async (cachePath) => {
|
|
23705
23722
|
try {
|
|
23706
23723
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -23742,11 +23759,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23742
23759
|
transformedFiles: 0
|
|
23743
23760
|
};
|
|
23744
23761
|
const transformFile = async (filePath) => {
|
|
23745
|
-
const resolvedPath =
|
|
23762
|
+
const resolvedPath = resolve37(filePath);
|
|
23746
23763
|
if (visited.has(resolvedPath))
|
|
23747
23764
|
return;
|
|
23748
23765
|
visited.add(resolvedPath);
|
|
23749
|
-
if (!
|
|
23766
|
+
if (!existsSync35(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
23750
23767
|
return;
|
|
23751
23768
|
stats.filesVisited += 1;
|
|
23752
23769
|
const source = await readFileForAotTransform(resolvedPath, readFile);
|
|
@@ -23777,7 +23794,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23777
23794
|
return { stats, transformedSources };
|
|
23778
23795
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
23779
23796
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
23780
|
-
const outputPath =
|
|
23797
|
+
const outputPath = resolve37(join46(outDir, relative20(process.cwd(), resolve37(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
23781
23798
|
return [
|
|
23782
23799
|
outputPath,
|
|
23783
23800
|
buildIslandMetadataExports(readFileSync32(inputPath, "utf-8"))
|
|
@@ -23788,7 +23805,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23788
23805
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
23789
23806
|
const tsPath = __require.resolve("typescript");
|
|
23790
23807
|
const tsRootDir = dirname26(tsPath);
|
|
23791
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
23808
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve37(tsRootDir, "lib");
|
|
23792
23809
|
});
|
|
23793
23810
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
23794
23811
|
const options = {
|
|
@@ -23830,7 +23847,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23830
23847
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
23831
23848
|
};
|
|
23832
23849
|
const emitted = {};
|
|
23833
|
-
const resolvedOutDir =
|
|
23850
|
+
const resolvedOutDir = resolve37(outDir);
|
|
23834
23851
|
host.writeFile = (fileName, text) => {
|
|
23835
23852
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
23836
23853
|
emitted[relativePath] = text;
|
|
@@ -23852,12 +23869,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23852
23869
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
23853
23870
|
return source;
|
|
23854
23871
|
}
|
|
23855
|
-
const resolvedPath =
|
|
23872
|
+
const resolvedPath = resolve37(fileName);
|
|
23856
23873
|
return transformedSources.get(resolvedPath) ?? source;
|
|
23857
23874
|
};
|
|
23858
23875
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
23859
23876
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
23860
|
-
const source = transformedSources.get(
|
|
23877
|
+
const source = transformedSources.get(resolve37(fileName));
|
|
23861
23878
|
if (source) {
|
|
23862
23879
|
return ts18.createSourceFile(fileName, source, languageVersion, true);
|
|
23863
23880
|
}
|
|
@@ -23881,7 +23898,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23881
23898
|
content,
|
|
23882
23899
|
target: join46(outDir, fileName)
|
|
23883
23900
|
}));
|
|
23884
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
23901
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve37(target)));
|
|
23885
23902
|
return rawEntries.map(({ content, target }) => {
|
|
23886
23903
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
23887
23904
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -23896,7 +23913,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23896
23913
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
23897
23914
|
});
|
|
23898
23915
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
23899
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
23916
|
+
processedContent += islandMetadataByOutputPath.get(resolve37(target)) ?? "";
|
|
23900
23917
|
return { content: processedContent, target };
|
|
23901
23918
|
});
|
|
23902
23919
|
});
|
|
@@ -23906,7 +23923,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23906
23923
|
})), { outputs: entries.length });
|
|
23907
23924
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
23908
23925
|
}, jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
23909
|
-
jitContentCache.delete(
|
|
23926
|
+
jitContentCache.delete(resolve37(filePath));
|
|
23910
23927
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
23911
23928
|
const re = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
23912
23929
|
let match;
|
|
@@ -23919,8 +23936,8 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23919
23936
|
}
|
|
23920
23937
|
return null;
|
|
23921
23938
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
23922
|
-
const sourceEntry =
|
|
23923
|
-
if (
|
|
23939
|
+
const sourceEntry = resolve37(import.meta.dir, "../angular/components/index.ts");
|
|
23940
|
+
if (existsSync35(sourceEntry)) {
|
|
23924
23941
|
return sourceEntry.replace(/\\/g, "/");
|
|
23925
23942
|
}
|
|
23926
23943
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -24048,7 +24065,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
24048
24065
|
${fields}
|
|
24049
24066
|
`);
|
|
24050
24067
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
24051
|
-
if (!
|
|
24068
|
+
if (!existsSync35(filePath)) {
|
|
24052
24069
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
24053
24070
|
}
|
|
24054
24071
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -24057,7 +24074,7 @@ ${fields}
|
|
|
24057
24074
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24058
24075
|
if (templateUrlMatch?.[1]) {
|
|
24059
24076
|
const templatePath = join46(fileDir, templateUrlMatch[1]);
|
|
24060
|
-
if (!
|
|
24077
|
+
if (!existsSync35(templatePath)) {
|
|
24061
24078
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
24062
24079
|
}
|
|
24063
24080
|
const templateRaw = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -24088,7 +24105,7 @@ ${fields}
|
|
|
24088
24105
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24089
24106
|
if (templateUrlMatch?.[1]) {
|
|
24090
24107
|
const templatePath = join46(fileDir, templateUrlMatch[1]);
|
|
24091
|
-
if (!
|
|
24108
|
+
if (!existsSync35(templatePath)) {
|
|
24092
24109
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
24093
24110
|
}
|
|
24094
24111
|
const templateRaw = readFileSync32(templatePath, "utf-8");
|
|
@@ -24209,10 +24226,10 @@ ${fields}
|
|
|
24209
24226
|
return "";
|
|
24210
24227
|
}
|
|
24211
24228
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
24212
|
-
const entryPath =
|
|
24229
|
+
const entryPath = resolve37(inputPath);
|
|
24213
24230
|
const allOutputs = [];
|
|
24214
24231
|
const visited = new Set;
|
|
24215
|
-
const baseDir =
|
|
24232
|
+
const baseDir = resolve37(rootDir ?? process.cwd());
|
|
24216
24233
|
let usesLegacyAnimations = false;
|
|
24217
24234
|
const angularTranspiler = new Bun.Transpiler({
|
|
24218
24235
|
loader: "ts",
|
|
@@ -24236,11 +24253,11 @@ ${fields}
|
|
|
24236
24253
|
join46(candidate, "index.js"),
|
|
24237
24254
|
join46(candidate, "index.jsx")
|
|
24238
24255
|
];
|
|
24239
|
-
return candidates.find((file) =>
|
|
24256
|
+
return candidates.find((file) => existsSync35(file));
|
|
24240
24257
|
};
|
|
24241
24258
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
24242
24259
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
24243
|
-
return resolveSourceFile(
|
|
24260
|
+
return resolveSourceFile(resolve37(fromDir, specifier));
|
|
24244
24261
|
}
|
|
24245
24262
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
24246
24263
|
if (aliased)
|
|
@@ -24249,7 +24266,7 @@ ${fields}
|
|
|
24249
24266
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
24250
24267
|
if (resolved.includes("/node_modules/"))
|
|
24251
24268
|
return;
|
|
24252
|
-
const absolute =
|
|
24269
|
+
const absolute = resolve37(resolved);
|
|
24253
24270
|
if (!absolute.startsWith(baseDir))
|
|
24254
24271
|
return;
|
|
24255
24272
|
return resolveSourceFile(absolute);
|
|
@@ -24301,17 +24318,17 @@ ${fields}
|
|
|
24301
24318
|
return `${prefix}${dots}`;
|
|
24302
24319
|
return `${prefix}../${dots}`;
|
|
24303
24320
|
});
|
|
24304
|
-
if (
|
|
24321
|
+
if (resolve37(actualPath) === entryPath) {
|
|
24305
24322
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
24306
24323
|
}
|
|
24307
24324
|
return processedContent;
|
|
24308
24325
|
};
|
|
24309
24326
|
const transpileFile = async (filePath) => {
|
|
24310
|
-
const resolved =
|
|
24327
|
+
const resolved = resolve37(filePath);
|
|
24311
24328
|
if (visited.has(resolved))
|
|
24312
24329
|
return;
|
|
24313
24330
|
visited.add(resolved);
|
|
24314
|
-
if (resolved.endsWith(".json") &&
|
|
24331
|
+
if (resolved.endsWith(".json") && existsSync35(resolved)) {
|
|
24315
24332
|
const inputDir = dirname26(resolved);
|
|
24316
24333
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
24317
24334
|
const targetDir = join46(outDir, relativeDir);
|
|
@@ -24324,7 +24341,7 @@ ${fields}
|
|
|
24324
24341
|
let actualPath = resolved;
|
|
24325
24342
|
if (!actualPath.endsWith(".ts"))
|
|
24326
24343
|
actualPath += ".ts";
|
|
24327
|
-
if (!
|
|
24344
|
+
if (!existsSync35(actualPath))
|
|
24328
24345
|
return;
|
|
24329
24346
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
24330
24347
|
const inlined = await inlineResources(sourceCode, dirname26(actualPath), stylePreprocessors);
|
|
@@ -24359,10 +24376,10 @@ ${fields}
|
|
|
24359
24376
|
importRewrites.set(specifier, relativeRewrite);
|
|
24360
24377
|
return resolved;
|
|
24361
24378
|
}).filter((path) => Boolean(path));
|
|
24362
|
-
const isEntry =
|
|
24379
|
+
const isEntry = resolve37(actualPath) === resolve37(entryPath);
|
|
24363
24380
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
24364
24381
|
const cacheKey = actualPath;
|
|
24365
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !
|
|
24382
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync35(targetPath);
|
|
24366
24383
|
if (shouldWriteFile) {
|
|
24367
24384
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
24368
24385
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
@@ -24375,7 +24392,7 @@ ${fields}
|
|
|
24375
24392
|
};
|
|
24376
24393
|
await transpileFile(inputPath);
|
|
24377
24394
|
const entryOutputPath = toOutputPath(entryPath);
|
|
24378
|
-
if (
|
|
24395
|
+
if (existsSync35(entryOutputPath)) {
|
|
24379
24396
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
24380
24397
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
24381
24398
|
`);
|
|
@@ -24396,12 +24413,12 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24396
24413
|
const compiledRoot = compiledParent;
|
|
24397
24414
|
const indexesDir = join46(compiledParent, "indexes");
|
|
24398
24415
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
24399
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
24416
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve37(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
24400
24417
|
if (!hmr) {
|
|
24401
24418
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
24402
24419
|
const cwd = process.cwd();
|
|
24403
|
-
const angularSrcDir =
|
|
24404
|
-
if (!
|
|
24420
|
+
const angularSrcDir = resolve37(outRoot);
|
|
24421
|
+
if (!existsSync35(angularSrcDir))
|
|
24405
24422
|
return;
|
|
24406
24423
|
const jsonGlob = new Glob6("**/*.json");
|
|
24407
24424
|
for (const rel of jsonGlob.scanSync({
|
|
@@ -24418,7 +24435,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24418
24435
|
}
|
|
24419
24436
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
24420
24437
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
24421
|
-
const resolvedEntry =
|
|
24438
|
+
const resolvedEntry = resolve37(entry);
|
|
24422
24439
|
const relativeEntry = relative20(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
24423
24440
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
24424
24441
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -24430,21 +24447,21 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24430
24447
|
join46(compiledRoot, relativeEntry),
|
|
24431
24448
|
join46(compiledRoot, "pages", jsName),
|
|
24432
24449
|
join46(compiledRoot, jsName)
|
|
24433
|
-
].map((file) =>
|
|
24450
|
+
].map((file) => resolve37(file));
|
|
24434
24451
|
const resolveRawServerFile = (candidatePaths) => {
|
|
24435
24452
|
const normalizedCandidates = [
|
|
24436
|
-
...candidatePaths.map((file) =>
|
|
24453
|
+
...candidatePaths.map((file) => resolve37(file)),
|
|
24437
24454
|
...compiledFallbackPaths
|
|
24438
24455
|
];
|
|
24439
|
-
let candidate = normalizedCandidates.find((file) =>
|
|
24456
|
+
let candidate = normalizedCandidates.find((file) => existsSync35(file) && file.endsWith(`${sep6}${relativeEntry}`));
|
|
24440
24457
|
if (!candidate) {
|
|
24441
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24458
|
+
candidate = normalizedCandidates.find((file) => existsSync35(file) && file.endsWith(`${sep6}pages${sep6}${jsName}`));
|
|
24442
24459
|
}
|
|
24443
24460
|
if (!candidate) {
|
|
24444
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24461
|
+
candidate = normalizedCandidates.find((file) => existsSync35(file) && file.endsWith(`${sep6}${jsName}`));
|
|
24445
24462
|
}
|
|
24446
24463
|
if (!candidate) {
|
|
24447
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24464
|
+
candidate = normalizedCandidates.find((file) => existsSync35(file));
|
|
24448
24465
|
}
|
|
24449
24466
|
return candidate;
|
|
24450
24467
|
};
|
|
@@ -24452,11 +24469,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24452
24469
|
if (!rawServerFile) {
|
|
24453
24470
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
24454
24471
|
}
|
|
24455
|
-
if (rawServerFile && !
|
|
24472
|
+
if (rawServerFile && !existsSync35(rawServerFile)) {
|
|
24456
24473
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
24457
24474
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
24458
24475
|
}
|
|
24459
|
-
if (!rawServerFile || !
|
|
24476
|
+
if (!rawServerFile || !existsSync35(rawServerFile)) {
|
|
24460
24477
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
24461
24478
|
...outputs,
|
|
24462
24479
|
...compiledFallbackPaths
|
|
@@ -24492,7 +24509,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24492
24509
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
24493
24510
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
24494
24511
|
const clientFile = join46(indexesDir, jsName);
|
|
24495
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
24512
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync35(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
24496
24513
|
return {
|
|
24497
24514
|
clientPath: clientFile,
|
|
24498
24515
|
indexUnchanged: true,
|
|
@@ -24523,8 +24540,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24523
24540
|
const fragments = [];
|
|
24524
24541
|
if (providersInjection.appProvidersSource) {
|
|
24525
24542
|
const compiledAppProvidersPath = (() => {
|
|
24526
|
-
const angularDirAbs =
|
|
24527
|
-
const appSourceAbs =
|
|
24543
|
+
const angularDirAbs = resolve37(outRoot);
|
|
24544
|
+
const appSourceAbs = resolve37(providersInjection.appProvidersSource);
|
|
24528
24545
|
const rel = relative20(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
24529
24546
|
return join46(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
24530
24547
|
})();
|
|
@@ -25228,9 +25245,9 @@ var require_node = __commonJS(function(exports, module) {
|
|
|
25228
25245
|
});
|
|
25229
25246
|
|
|
25230
25247
|
// src/build/compileEmber.ts
|
|
25231
|
-
import { existsSync as
|
|
25248
|
+
import { existsSync as existsSync36 } from "fs";
|
|
25232
25249
|
import { mkdir as mkdir12, rm as rm7 } from "fs/promises";
|
|
25233
|
-
import { basename as basename16, dirname as dirname27, extname as extname13, join as join47, resolve as
|
|
25250
|
+
import { basename as basename16, dirname as dirname27, extname as extname13, join as join47, resolve as resolve38 } from "path";
|
|
25234
25251
|
var {build: bunBuild2, Transpiler: Transpiler5, write: write5, file: file5 } = globalThis.Bun;
|
|
25235
25252
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
25236
25253
|
if (cachedPreprocessor)
|
|
@@ -25326,11 +25343,11 @@ export const importSync = (specifier) => {
|
|
|
25326
25343
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
25327
25344
|
if (!originalImporter)
|
|
25328
25345
|
return;
|
|
25329
|
-
const candidateBase =
|
|
25346
|
+
const candidateBase = resolve38(dirname27(originalImporter), args.path);
|
|
25330
25347
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
25331
25348
|
for (const ext of extensionsToTry) {
|
|
25332
25349
|
const candidate = candidateBase + ext;
|
|
25333
|
-
if (
|
|
25350
|
+
if (existsSync36(candidate))
|
|
25334
25351
|
return { path: candidate };
|
|
25335
25352
|
}
|
|
25336
25353
|
return;
|
|
@@ -25350,7 +25367,7 @@ export const importSync = (specifier) => {
|
|
|
25350
25367
|
if (standalonePackages.has(args.path))
|
|
25351
25368
|
return;
|
|
25352
25369
|
const internal = join47(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
25353
|
-
if (
|
|
25370
|
+
if (existsSync36(internal))
|
|
25354
25371
|
return { path: internal };
|
|
25355
25372
|
return;
|
|
25356
25373
|
});
|
|
@@ -25385,7 +25402,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
25385
25402
|
export { PageComponent };
|
|
25386
25403
|
export default PageComponent;
|
|
25387
25404
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
25388
|
-
const resolvedEntry =
|
|
25405
|
+
const resolvedEntry = resolve38(entry);
|
|
25389
25406
|
const source = await file5(resolvedEntry).text();
|
|
25390
25407
|
let preprocessed = source;
|
|
25391
25408
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -25405,8 +25422,8 @@ export default PageComponent;
|
|
|
25405
25422
|
mkdir12(serverDir, { recursive: true }),
|
|
25406
25423
|
mkdir12(clientDir, { recursive: true })
|
|
25407
25424
|
]);
|
|
25408
|
-
const tmpPagePath =
|
|
25409
|
-
const tmpHarnessPath =
|
|
25425
|
+
const tmpPagePath = resolve38(join47(tmpDir, `${baseName}.module.js`));
|
|
25426
|
+
const tmpHarnessPath = resolve38(join47(tmpDir, `${baseName}.harness.js`));
|
|
25410
25427
|
await Promise.all([
|
|
25411
25428
|
write5(tmpPagePath, transpiled),
|
|
25412
25429
|
write5(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -25470,25 +25487,25 @@ var importFromProject = (specifier, projectRoot = process.cwd()) => {
|
|
|
25470
25487
|
};
|
|
25471
25488
|
|
|
25472
25489
|
// src/build/buildReactVendor.ts
|
|
25473
|
-
import { existsSync as
|
|
25474
|
-
import { join as join48, resolve as
|
|
25490
|
+
import { existsSync as existsSync37, mkdirSync as mkdirSync8 } from "fs";
|
|
25491
|
+
import { join as join48, resolve as resolve39 } from "path";
|
|
25475
25492
|
import { rm as rm8 } from "fs/promises";
|
|
25476
25493
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
25477
25494
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
25478
25495
|
const candidates = [
|
|
25479
|
-
|
|
25480
|
-
|
|
25481
|
-
|
|
25482
|
-
|
|
25483
|
-
|
|
25484
|
-
|
|
25496
|
+
resolve39(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
25497
|
+
resolve39(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
25498
|
+
resolve39(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
25499
|
+
resolve39(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
25500
|
+
resolve39(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
25501
|
+
resolve39(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
25485
25502
|
];
|
|
25486
25503
|
for (const candidate of candidates) {
|
|
25487
|
-
if (
|
|
25504
|
+
if (existsSync37(candidate)) {
|
|
25488
25505
|
return candidate.replace(/\\/g, "/");
|
|
25489
25506
|
}
|
|
25490
25507
|
}
|
|
25491
|
-
return (candidates[0] ??
|
|
25508
|
+
return (candidates[0] ?? resolve39(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
25492
25509
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
25493
25510
|
const paths = {};
|
|
25494
25511
|
for (const specifier of reactSpecifiers) {
|
|
@@ -25933,7 +25950,7 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
25933
25950
|
import {
|
|
25934
25951
|
copyFileSync as copyFileSync3,
|
|
25935
25952
|
cpSync,
|
|
25936
|
-
existsSync as
|
|
25953
|
+
existsSync as existsSync38,
|
|
25937
25954
|
mkdirSync as mkdirSync12,
|
|
25938
25955
|
readdirSync as readdirSync7,
|
|
25939
25956
|
readFileSync as readFileSync33,
|
|
@@ -25942,7 +25959,7 @@ import {
|
|
|
25942
25959
|
statSync as statSync5,
|
|
25943
25960
|
writeFileSync as writeFileSync10
|
|
25944
25961
|
} from "fs";
|
|
25945
|
-
import { basename as basename17, dirname as dirname28, extname as extname14, join as join52, relative as relative21, resolve as
|
|
25962
|
+
import { basename as basename17, dirname as dirname28, extname as extname14, join as join52, relative as relative21, resolve as resolve40 } from "path";
|
|
25946
25963
|
import { cwd, env as env3, exit } from "process";
|
|
25947
25964
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
25948
25965
|
var isBuildTraceEnabled = () => {
|
|
@@ -26091,8 +26108,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26091
26108
|
if (globalThis.__absoluteVersion)
|
|
26092
26109
|
return;
|
|
26093
26110
|
const candidates = [
|
|
26094
|
-
|
|
26095
|
-
|
|
26111
|
+
resolve40(import.meta.dir, "..", "..", "package.json"),
|
|
26112
|
+
resolve40(import.meta.dir, "..", "package.json")
|
|
26096
26113
|
];
|
|
26097
26114
|
const resolveCandidate = async (remaining) => {
|
|
26098
26115
|
const [candidate, ...rest] = remaining;
|
|
@@ -26108,7 +26125,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26108
26125
|
};
|
|
26109
26126
|
await resolveCandidate(candidates);
|
|
26110
26127
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file, relPath, workerPaths) => {
|
|
26111
|
-
const absPath =
|
|
26128
|
+
const absPath = resolve40(file, "..", relPath);
|
|
26112
26129
|
try {
|
|
26113
26130
|
statSync5(absPath);
|
|
26114
26131
|
workerPaths.add(absPath);
|
|
@@ -26199,11 +26216,11 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26199
26216
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
26200
26217
|
}
|
|
26201
26218
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
26202
|
-
if (!
|
|
26219
|
+
if (!existsSync38(reactIndexesPath)) {
|
|
26203
26220
|
return;
|
|
26204
26221
|
}
|
|
26205
26222
|
const indexFiles = readDir(reactIndexesPath).filter((file) => file.endsWith(".tsx"));
|
|
26206
|
-
const pagesRel = relative21(process.cwd(),
|
|
26223
|
+
const pagesRel = relative21(process.cwd(), resolve40(reactPagesPath)).replace(/\\/g, "/");
|
|
26207
26224
|
for (const file of indexFiles) {
|
|
26208
26225
|
let content = readFileSync33(join52(reactIndexesPath, file), "utf-8");
|
|
26209
26226
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -26211,27 +26228,27 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26211
26228
|
}
|
|
26212
26229
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
26213
26230
|
const svelteIndexDir = join52(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
26214
|
-
const sveltePageEntries = svelteEntries.filter((file) =>
|
|
26231
|
+
const sveltePageEntries = svelteEntries.filter((file) => resolve40(file).startsWith(resolve40(sveltePagesPath)));
|
|
26215
26232
|
for (const entry of sveltePageEntries) {
|
|
26216
26233
|
const name = basename17(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
26217
26234
|
const indexFile = join52(svelteIndexDir, "pages", `${name}.js`);
|
|
26218
|
-
if (!
|
|
26235
|
+
if (!existsSync38(indexFile))
|
|
26219
26236
|
continue;
|
|
26220
26237
|
let content = readFileSync33(indexFile, "utf-8");
|
|
26221
|
-
const srcRel = relative21(process.cwd(),
|
|
26238
|
+
const srcRel = relative21(process.cwd(), resolve40(entry)).replace(/\\/g, "/");
|
|
26222
26239
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
26223
26240
|
writeFileSync10(join52(devIndexDir, `${name}.svelte.js`), content);
|
|
26224
26241
|
}
|
|
26225
26242
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
26226
26243
|
const vueIndexDir = join52(getFrameworkGeneratedDir("vue"), "indexes");
|
|
26227
|
-
const vuePageEntries = vueEntries.filter((file) =>
|
|
26244
|
+
const vuePageEntries = vueEntries.filter((file) => resolve40(file).startsWith(resolve40(vuePagesPath)));
|
|
26228
26245
|
for (const entry of vuePageEntries) {
|
|
26229
26246
|
const name = basename17(entry, ".vue");
|
|
26230
26247
|
const indexFile = join52(vueIndexDir, `${name}.js`);
|
|
26231
|
-
if (!
|
|
26248
|
+
if (!existsSync38(indexFile))
|
|
26232
26249
|
continue;
|
|
26233
26250
|
let content = readFileSync33(indexFile, "utf-8");
|
|
26234
|
-
const srcRel = relative21(process.cwd(),
|
|
26251
|
+
const srcRel = relative21(process.cwd(), resolve40(entry)).replace(/\\/g, "/");
|
|
26235
26252
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
26236
26253
|
writeFileSync10(join52(devIndexDir, `${name}.vue.js`), content);
|
|
26237
26254
|
}
|
|
@@ -26518,13 +26535,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26518
26535
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
26519
26536
|
if (!isIncremental || !incrementalFiles)
|
|
26520
26537
|
return entryPoints;
|
|
26521
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f) =>
|
|
26538
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve40(f)));
|
|
26522
26539
|
const matchingEntries = [];
|
|
26523
26540
|
for (const entry of entryPoints) {
|
|
26524
26541
|
const sourceFile = mapToSource(entry);
|
|
26525
26542
|
if (!sourceFile)
|
|
26526
26543
|
continue;
|
|
26527
|
-
if (!normalizedIncremental.has(
|
|
26544
|
+
if (!normalizedIncremental.has(resolve40(sourceFile)))
|
|
26528
26545
|
continue;
|
|
26529
26546
|
matchingEntries.push(entry);
|
|
26530
26547
|
}
|
|
@@ -26700,11 +26717,11 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26700
26717
|
return scoped;
|
|
26701
26718
|
return scoped.filter((entry) => {
|
|
26702
26719
|
const source = mapToSource(entry);
|
|
26703
|
-
return source !== null && deferPageEntries.except.has(
|
|
26720
|
+
return source !== null && deferPageEntries.except.has(resolve40(source));
|
|
26704
26721
|
});
|
|
26705
26722
|
};
|
|
26706
26723
|
const mapReactIndexToPage = (entry) => {
|
|
26707
|
-
if (reactIndexesPath && reactPagesPath && entry.startsWith(
|
|
26724
|
+
if (reactIndexesPath && reactPagesPath && entry.startsWith(resolve40(reactIndexesPath))) {
|
|
26708
26725
|
const pageName = basename17(entry, ".tsx");
|
|
26709
26726
|
return join52(reactPagesPath, `${pageName}.tsx`);
|
|
26710
26727
|
}
|
|
@@ -26746,7 +26763,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26746
26763
|
for (const entry of vueEntries) {
|
|
26747
26764
|
const name = basename17(entry, ".vue");
|
|
26748
26765
|
if (ssrOnlyPageNames.has(name)) {
|
|
26749
|
-
resolved.add(
|
|
26766
|
+
resolved.add(resolve40(entry));
|
|
26750
26767
|
}
|
|
26751
26768
|
}
|
|
26752
26769
|
return resolved;
|
|
@@ -26859,7 +26876,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26859
26876
|
const clientPath = islandSvelteClientPaths[idx];
|
|
26860
26877
|
if (!sourcePath || !clientPath)
|
|
26861
26878
|
continue;
|
|
26862
|
-
islandSvelteClientPathMap.set(
|
|
26879
|
+
islandSvelteClientPathMap.set(resolve40(sourcePath), clientPath);
|
|
26863
26880
|
}
|
|
26864
26881
|
const islandVueClientPathMap = new Map;
|
|
26865
26882
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -26867,7 +26884,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26867
26884
|
const clientPath = islandVueClientPaths[idx];
|
|
26868
26885
|
if (!sourcePath || !clientPath)
|
|
26869
26886
|
continue;
|
|
26870
|
-
islandVueClientPathMap.set(
|
|
26887
|
+
islandVueClientPathMap.set(resolve40(sourcePath), clientPath);
|
|
26871
26888
|
}
|
|
26872
26889
|
const islandAngularClientPathMap = new Map;
|
|
26873
26890
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -26875,7 +26892,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26875
26892
|
const clientPath = islandAngularClientPaths[idx];
|
|
26876
26893
|
if (!sourcePath || !clientPath)
|
|
26877
26894
|
continue;
|
|
26878
|
-
islandAngularClientPathMap.set(
|
|
26895
|
+
islandAngularClientPathMap.set(resolve40(sourcePath), clientPath);
|
|
26879
26896
|
}
|
|
26880
26897
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
26881
26898
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -27385,7 +27402,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27385
27402
|
await tracePhase("postprocess/client-rewrite", rewriteClientGroups, clientRewriteStats);
|
|
27386
27403
|
if (!hmr) {
|
|
27387
27404
|
const reactVendorDir = join52(buildPath, "react", "vendor");
|
|
27388
|
-
const vendorChunkPaths =
|
|
27405
|
+
const vendorChunkPaths = existsSync38(reactVendorDir) ? [
|
|
27389
27406
|
...new Glob8("**/*.js").scanSync({
|
|
27390
27407
|
absolute: true,
|
|
27391
27408
|
cwd: reactVendorDir
|
|
@@ -27710,7 +27727,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27710
27727
|
pageEntries,
|
|
27711
27728
|
tailwindChanged: tailwindResult?.cssChanged ?? false
|
|
27712
27729
|
};
|
|
27713
|
-
}, projectTsconfig = () =>
|
|
27730
|
+
}, projectTsconfig = () => existsSync38(resolve40("tsconfig.json")) ? { tsconfig: "./tsconfig.json" } : {}, build2 = async (config) => {
|
|
27714
27731
|
const projectRoot = cwd();
|
|
27715
27732
|
const buildPath = validateSafePath(config.buildDirectory ?? "build", projectRoot);
|
|
27716
27733
|
return withBuildDirectoryLock(buildPath, () => buildUnlocked(config));
|
|
@@ -27799,7 +27816,7 @@ var init_build = __esm(() => {
|
|
|
27799
27816
|
});
|
|
27800
27817
|
|
|
27801
27818
|
// src/build/buildEmberVendor.ts
|
|
27802
|
-
import { mkdirSync as mkdirSync13, existsSync as
|
|
27819
|
+
import { mkdirSync as mkdirSync13, existsSync as existsSync39 } from "fs";
|
|
27803
27820
|
import { join as join53 } from "path";
|
|
27804
27821
|
import { rm as rm12 } from "fs/promises";
|
|
27805
27822
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
@@ -27853,7 +27870,7 @@ export const importSync = (specifier) => {
|
|
|
27853
27870
|
return { resolveTo: specifier, specifier };
|
|
27854
27871
|
}
|
|
27855
27872
|
const emberInternalPath = join53(cwd, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
27856
|
-
if (!
|
|
27873
|
+
if (!existsSync39(emberInternalPath)) {
|
|
27857
27874
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
27858
27875
|
}
|
|
27859
27876
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -27887,7 +27904,7 @@ export const importSync = (specifier) => {
|
|
|
27887
27904
|
return;
|
|
27888
27905
|
}
|
|
27889
27906
|
const internal = join53(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
27890
|
-
if (
|
|
27907
|
+
if (existsSync39(internal)) {
|
|
27891
27908
|
return { path: internal };
|
|
27892
27909
|
}
|
|
27893
27910
|
return;
|
|
@@ -28097,9 +28114,9 @@ var stripStringsAndComments = (source) => {
|
|
|
28097
28114
|
};
|
|
28098
28115
|
|
|
28099
28116
|
// src/dev/dependencyGraph.ts
|
|
28100
|
-
import { existsSync as
|
|
28117
|
+
import { existsSync as existsSync40, readFileSync as readFileSync35, realpathSync as realpathSync4 } from "fs";
|
|
28101
28118
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
28102
|
-
import { resolve as
|
|
28119
|
+
import { resolve as resolve41 } from "path";
|
|
28103
28120
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
28104
28121
|
const lower = filePath.toLowerCase();
|
|
28105
28122
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -28110,7 +28127,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28110
28127
|
return "html";
|
|
28111
28128
|
return null;
|
|
28112
28129
|
}, resolveImportPath2 = (importPath, fromFile) => {
|
|
28113
|
-
const fromDir =
|
|
28130
|
+
const fromDir = resolve41(fromFile, "..");
|
|
28114
28131
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
28115
28132
|
if (!isWorkspacePackageSpecifier(importPath, fromDir))
|
|
28116
28133
|
return null;
|
|
@@ -28120,7 +28137,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28120
28137
|
return null;
|
|
28121
28138
|
}
|
|
28122
28139
|
}
|
|
28123
|
-
const normalized =
|
|
28140
|
+
const normalized = resolve41(fromDir, importPath);
|
|
28124
28141
|
const extensions = [
|
|
28125
28142
|
".ts",
|
|
28126
28143
|
".tsx",
|
|
@@ -28133,10 +28150,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28133
28150
|
];
|
|
28134
28151
|
for (const ext of extensions) {
|
|
28135
28152
|
const withExt = normalized + ext;
|
|
28136
|
-
if (
|
|
28153
|
+
if (existsSync40(withExt))
|
|
28137
28154
|
return withExt;
|
|
28138
28155
|
}
|
|
28139
|
-
if (
|
|
28156
|
+
if (existsSync40(normalized))
|
|
28140
28157
|
return normalized;
|
|
28141
28158
|
return null;
|
|
28142
28159
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -28150,8 +28167,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28150
28167
|
dependents.delete(normalizedPath);
|
|
28151
28168
|
}
|
|
28152
28169
|
}, addFileToGraph = (graph, filePath) => {
|
|
28153
|
-
const normalizedPath =
|
|
28154
|
-
if (!
|
|
28170
|
+
const normalizedPath = resolve41(filePath);
|
|
28171
|
+
if (!existsSync40(normalizedPath))
|
|
28155
28172
|
return;
|
|
28156
28173
|
const dependencies = extractDependencies(normalizedPath);
|
|
28157
28174
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -28177,10 +28194,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28177
28194
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
28178
28195
|
const processedFiles = new Set;
|
|
28179
28196
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
28180
|
-
const resolvedDirs = directories.map((dir) =>
|
|
28197
|
+
const resolvedDirs = directories.map((dir) => resolve41(dir)).filter((dir) => existsSync40(dir));
|
|
28181
28198
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
28182
28199
|
for (const file of allFiles) {
|
|
28183
|
-
const fullPath =
|
|
28200
|
+
const fullPath = resolve41(file);
|
|
28184
28201
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
28185
28202
|
continue;
|
|
28186
28203
|
if (processedFiles.has(fullPath))
|
|
@@ -28293,7 +28310,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28293
28310
|
return [];
|
|
28294
28311
|
}
|
|
28295
28312
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
28296
|
-
const normalizedPath =
|
|
28313
|
+
const normalizedPath = resolve41(changedFile);
|
|
28297
28314
|
const affected = new Set;
|
|
28298
28315
|
const toProcess = [normalizedPath];
|
|
28299
28316
|
const processNode = (current) => {
|
|
@@ -28324,7 +28341,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28324
28341
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
28325
28342
|
graph.dependents.delete(normalizedPath);
|
|
28326
28343
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
28327
|
-
const normalizedPath =
|
|
28344
|
+
const normalizedPath = resolve41(filePath);
|
|
28328
28345
|
removeDepsForFile(graph, normalizedPath);
|
|
28329
28346
|
removeDependentsForFile(graph, normalizedPath);
|
|
28330
28347
|
};
|
|
@@ -28368,12 +28385,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
28368
28385
|
};
|
|
28369
28386
|
|
|
28370
28387
|
// src/dev/configResolver.ts
|
|
28371
|
-
import { resolve as
|
|
28388
|
+
import { resolve as resolve42 } from "path";
|
|
28372
28389
|
var resolveBuildPaths = (config) => {
|
|
28373
28390
|
const cwd = process.cwd();
|
|
28374
28391
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
28375
|
-
const withDefault = (value, fallback) => normalize(
|
|
28376
|
-
const optional = (value) => value ? normalize(
|
|
28392
|
+
const withDefault = (value, fallback) => normalize(resolve42(cwd, value ?? fallback));
|
|
28393
|
+
const optional = (value) => value ? normalize(resolve42(cwd, value)) : undefined;
|
|
28377
28394
|
return {
|
|
28378
28395
|
angularDir: optional(config.angularDirectory),
|
|
28379
28396
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -28432,8 +28449,8 @@ var init_clientManager = __esm(() => {
|
|
|
28432
28449
|
});
|
|
28433
28450
|
|
|
28434
28451
|
// src/dev/pathUtils.ts
|
|
28435
|
-
import { existsSync as
|
|
28436
|
-
import { dirname as dirname29, resolve as
|
|
28452
|
+
import { existsSync as existsSync41, readdirSync as readdirSync8, readFileSync as readFileSync36 } from "fs";
|
|
28453
|
+
import { dirname as dirname29, resolve as resolve43 } from "path";
|
|
28437
28454
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
28438
28455
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
28439
28456
|
return "ignored";
|
|
@@ -28509,7 +28526,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28509
28526
|
return "unknown";
|
|
28510
28527
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
28511
28528
|
const out = new Set;
|
|
28512
|
-
const angularRoot =
|
|
28529
|
+
const angularRoot = resolve43(angularDir);
|
|
28513
28530
|
const angularRootNormalized = normalizePath2(angularRoot);
|
|
28514
28531
|
const walk = (dir) => {
|
|
28515
28532
|
let entries;
|
|
@@ -28522,7 +28539,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28522
28539
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
28523
28540
|
continue;
|
|
28524
28541
|
}
|
|
28525
|
-
const full =
|
|
28542
|
+
const full = resolve43(dir, entry.name);
|
|
28526
28543
|
if (entry.isDirectory()) {
|
|
28527
28544
|
walk(full);
|
|
28528
28545
|
continue;
|
|
@@ -28563,7 +28580,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28563
28580
|
}
|
|
28564
28581
|
const componentDir = dirname29(full);
|
|
28565
28582
|
for (const ref of refs) {
|
|
28566
|
-
const refAbs = normalizePath2(
|
|
28583
|
+
const refAbs = normalizePath2(resolve43(componentDir, ref));
|
|
28567
28584
|
const refDir = normalizePath2(dirname29(refAbs));
|
|
28568
28585
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
28569
28586
|
continue;
|
|
@@ -28580,7 +28597,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28580
28597
|
const push = (path) => {
|
|
28581
28598
|
if (!path)
|
|
28582
28599
|
return;
|
|
28583
|
-
const abs = normalizePath2(
|
|
28600
|
+
const abs = normalizePath2(resolve43(cwd, path));
|
|
28584
28601
|
if (!roots.includes(abs))
|
|
28585
28602
|
roots.push(abs);
|
|
28586
28603
|
};
|
|
@@ -28605,8 +28622,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28605
28622
|
push(cfg.assetsDir);
|
|
28606
28623
|
push(cfg.stylesDir);
|
|
28607
28624
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
28608
|
-
const abs = normalizePath2(
|
|
28609
|
-
if (
|
|
28625
|
+
const abs = normalizePath2(resolve43(cwd, candidate));
|
|
28626
|
+
if (existsSync41(abs) && !roots.includes(abs))
|
|
28610
28627
|
roots.push(abs);
|
|
28611
28628
|
}
|
|
28612
28629
|
try {
|
|
@@ -28616,7 +28633,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28616
28633
|
continue;
|
|
28617
28634
|
if (entry.name.startsWith("."))
|
|
28618
28635
|
continue;
|
|
28619
|
-
const abs = normalizePath2(
|
|
28636
|
+
const abs = normalizePath2(resolve43(cwd, entry.name));
|
|
28620
28637
|
if (roots.includes(abs))
|
|
28621
28638
|
continue;
|
|
28622
28639
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -28704,7 +28721,7 @@ var init_pathUtils = __esm(() => {
|
|
|
28704
28721
|
});
|
|
28705
28722
|
|
|
28706
28723
|
// src/dev/devPrescan.ts
|
|
28707
|
-
import { existsSync as
|
|
28724
|
+
import { existsSync as existsSync42, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
28708
28725
|
import { mkdir as mkdir13, readFile as readFile8, rename as rename4, writeFile as writeFile11 } from "fs/promises";
|
|
28709
28726
|
import { join as join55 } from "path";
|
|
28710
28727
|
var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2000, collectConfigVendorSourceDirs = (config) => Array.from(new Set([
|
|
@@ -28717,7 +28734,7 @@ var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2
|
|
|
28717
28734
|
].filter((dir) => Boolean(dir)))), devPrescanEnabled = () => process.env.ABSOLUTE_DEV_PRESCAN === "1", sleep = (delayMs) => new Promise((resolve) => {
|
|
28718
28735
|
setTimeout(resolve, delayMs);
|
|
28719
28736
|
}), isPayload = (value) => typeof value === "object" && value !== null && ("version" in value) && value.version === PAYLOAD_VERSION, tryReadPrescan = async (path) => {
|
|
28720
|
-
if (!
|
|
28737
|
+
if (!existsSync42(path))
|
|
28721
28738
|
return;
|
|
28722
28739
|
try {
|
|
28723
28740
|
const parsed = JSON.parse(await readFile8(path, "utf8"));
|
|
@@ -28773,8 +28790,8 @@ var init_serverEntryCopies = () => {};
|
|
|
28773
28790
|
|
|
28774
28791
|
// src/dev/fileWatcher.ts
|
|
28775
28792
|
import { watch } from "fs";
|
|
28776
|
-
import { existsSync as
|
|
28777
|
-
import { dirname as dirname30, join as join56, resolve as
|
|
28793
|
+
import { existsSync as existsSync43, readdirSync as readdirSync10, statSync as statSync6 } from "fs";
|
|
28794
|
+
import { dirname as dirname30, join as join56, resolve as resolve44 } from "path";
|
|
28778
28795
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
28779
28796
|
try {
|
|
28780
28797
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -28842,12 +28859,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28842
28859
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
28843
28860
|
return;
|
|
28844
28861
|
}
|
|
28845
|
-
if (event === "rename" && !
|
|
28862
|
+
if (event === "rename" && !existsSync43(fullPath)) {
|
|
28846
28863
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
28847
28864
|
onFileChange(fullPath);
|
|
28848
28865
|
return;
|
|
28849
28866
|
}
|
|
28850
|
-
if (
|
|
28867
|
+
if (existsSync43(fullPath)) {
|
|
28851
28868
|
onFileChange(fullPath);
|
|
28852
28869
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
28853
28870
|
}
|
|
@@ -28856,8 +28873,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28856
28873
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
28857
28874
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
28858
28875
|
paths.forEach((path) => {
|
|
28859
|
-
const absolutePath =
|
|
28860
|
-
if (!
|
|
28876
|
+
const absolutePath = resolve44(path).replace(/\\/g, "/");
|
|
28877
|
+
if (!existsSync43(absolutePath)) {
|
|
28861
28878
|
return;
|
|
28862
28879
|
}
|
|
28863
28880
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -28867,8 +28884,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28867
28884
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
28868
28885
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
28869
28886
|
watchPaths.forEach((path) => {
|
|
28870
|
-
const absolutePath =
|
|
28871
|
-
if (!
|
|
28887
|
+
const absolutePath = resolve44(path).replace(/\\/g, "/");
|
|
28888
|
+
if (!existsSync43(absolutePath)) {
|
|
28872
28889
|
return;
|
|
28873
28890
|
}
|
|
28874
28891
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -28887,13 +28904,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
28887
28904
|
});
|
|
28888
28905
|
|
|
28889
28906
|
// src/dev/assetStore.ts
|
|
28890
|
-
import { resolve as
|
|
28907
|
+
import { resolve as resolve45 } from "path";
|
|
28891
28908
|
import { readdir as readdir5, unlink } from "fs/promises";
|
|
28892
28909
|
var mimeTypes, getMimeType = (filePath) => {
|
|
28893
28910
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
28894
28911
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
28895
28912
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
28896
|
-
const fullPath =
|
|
28913
|
+
const fullPath = resolve45(dir, entry.name);
|
|
28897
28914
|
if (entry.isDirectory()) {
|
|
28898
28915
|
return walkAndClean(fullPath);
|
|
28899
28916
|
}
|
|
@@ -28909,10 +28926,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
28909
28926
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
28910
28927
|
const liveByIdentity = new Map;
|
|
28911
28928
|
for (const webPath of store.keys()) {
|
|
28912
|
-
const diskPath =
|
|
28929
|
+
const diskPath = resolve45(buildDir, webPath.slice(1));
|
|
28913
28930
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
28914
28931
|
}
|
|
28915
|
-
const absBuildDir =
|
|
28932
|
+
const absBuildDir = resolve45(buildDir);
|
|
28916
28933
|
Object.values(manifest).forEach((val) => {
|
|
28917
28934
|
if (!HASHED_FILE_RE.test(val))
|
|
28918
28935
|
return;
|
|
@@ -28932,13 +28949,13 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
28932
28949
|
}, evictMissingChunks = async (store, buildDir) => {
|
|
28933
28950
|
const chunkKeys = [...store.keys()].filter((webPath) => webPath.includes("/chunk-"));
|
|
28934
28951
|
await Promise.all(chunkKeys.map(async (webPath) => {
|
|
28935
|
-
const onDisk = await Bun.file(
|
|
28952
|
+
const onDisk = await Bun.file(resolve45(buildDir, webPath.slice(1))).exists().catch(() => false);
|
|
28936
28953
|
if (!onDisk)
|
|
28937
28954
|
store.delete(webPath);
|
|
28938
28955
|
}));
|
|
28939
28956
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
28940
28957
|
if (entry.isDirectory()) {
|
|
28941
|
-
return scanDir(
|
|
28958
|
+
return scanDir(resolve45(dir, entry.name), `${prefix}${entry.name}/`);
|
|
28942
28959
|
}
|
|
28943
28960
|
if (!entry.name.startsWith("chunk-")) {
|
|
28944
28961
|
return null;
|
|
@@ -28947,7 +28964,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
28947
28964
|
if (store.has(webPath)) {
|
|
28948
28965
|
return null;
|
|
28949
28966
|
}
|
|
28950
|
-
return Bun.file(
|
|
28967
|
+
return Bun.file(resolve45(dir, entry.name)).bytes().then((bytes) => {
|
|
28951
28968
|
store.set(webPath, bytes);
|
|
28952
28969
|
return;
|
|
28953
28970
|
}).catch(() => {});
|
|
@@ -28969,7 +28986,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
28969
28986
|
for (const webPath of newIdentities.values()) {
|
|
28970
28987
|
if (store.has(webPath))
|
|
28971
28988
|
continue;
|
|
28972
|
-
loadPromises.push(Bun.file(
|
|
28989
|
+
loadPromises.push(Bun.file(resolve45(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
28973
28990
|
store.set(webPath, bytes);
|
|
28974
28991
|
return;
|
|
28975
28992
|
}).catch(() => {}));
|
|
@@ -29126,9 +29143,9 @@ var init_transformCache = __esm(() => {
|
|
|
29126
29143
|
});
|
|
29127
29144
|
|
|
29128
29145
|
// src/dev/reactComponentClassifier.ts
|
|
29129
|
-
import { resolve as
|
|
29146
|
+
import { resolve as resolve46 } from "path";
|
|
29130
29147
|
var classifyComponent = (filePath) => {
|
|
29131
|
-
const normalizedPath =
|
|
29148
|
+
const normalizedPath = resolve46(filePath);
|
|
29132
29149
|
if (normalizedPath.includes("/react/pages/")) {
|
|
29133
29150
|
return "server";
|
|
29134
29151
|
}
|
|
@@ -29140,7 +29157,7 @@ var classifyComponent = (filePath) => {
|
|
|
29140
29157
|
var init_reactComponentClassifier = () => {};
|
|
29141
29158
|
|
|
29142
29159
|
// src/dev/moduleMapper.ts
|
|
29143
|
-
import { basename as basename18, resolve as
|
|
29160
|
+
import { basename as basename18, resolve as resolve47 } from "path";
|
|
29144
29161
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
29145
29162
|
const modulePaths = {};
|
|
29146
29163
|
moduleKeys.forEach((key) => {
|
|
@@ -29150,7 +29167,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
29150
29167
|
});
|
|
29151
29168
|
return modulePaths;
|
|
29152
29169
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
29153
|
-
const normalizedFile =
|
|
29170
|
+
const normalizedFile = resolve47(sourceFile);
|
|
29154
29171
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
29155
29172
|
if (processedFiles.has(normalizedFile)) {
|
|
29156
29173
|
return null;
|
|
@@ -29186,7 +29203,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
29186
29203
|
});
|
|
29187
29204
|
return grouped;
|
|
29188
29205
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
29189
|
-
const normalizedFile =
|
|
29206
|
+
const normalizedFile = resolve47(sourceFile);
|
|
29190
29207
|
const fileName = basename18(normalizedFile);
|
|
29191
29208
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
29192
29209
|
const pascalName = toPascal(baseName);
|
|
@@ -29242,7 +29259,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
29242
29259
|
|
|
29243
29260
|
// src/utils/spaRouteCss.ts
|
|
29244
29261
|
import { readFile as readFile9 } from "fs/promises";
|
|
29245
|
-
import { dirname as dirname31, isAbsolute as isAbsolute9, resolve as
|
|
29262
|
+
import { dirname as dirname31, isAbsolute as isAbsolute9, resolve as resolve48 } from "path";
|
|
29246
29263
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
29247
29264
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
29248
29265
|
if (cached !== undefined)
|
|
@@ -29280,7 +29297,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
29280
29297
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
29281
29298
|
if (!cssPath)
|
|
29282
29299
|
return "";
|
|
29283
|
-
const resolvedCssPath = isAbsolute9(cssPath) ? cssPath :
|
|
29300
|
+
const resolvedCssPath = isAbsolute9(cssPath) ? cssPath : resolve48(dirname31(sideManifestPath), cssPath);
|
|
29284
29301
|
const cached = childCssCache.get(resolvedCssPath);
|
|
29285
29302
|
if (cached !== undefined)
|
|
29286
29303
|
return cached;
|
|
@@ -29364,7 +29381,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
29364
29381
|
resolveOwningComponents: () => resolveOwningComponents
|
|
29365
29382
|
});
|
|
29366
29383
|
import { readdirSync as readdirSync11, readFileSync as readFileSync38, statSync as statSync8 } from "fs";
|
|
29367
|
-
import { dirname as dirname32, extname as extname15, join as join57, resolve as
|
|
29384
|
+
import { dirname as dirname32, extname as extname15, join as join57, resolve as resolve49 } from "path";
|
|
29368
29385
|
import ts19 from "typescript";
|
|
29369
29386
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
29370
29387
|
const out = [];
|
|
@@ -29477,7 +29494,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29477
29494
|
};
|
|
29478
29495
|
visit(sourceFile);
|
|
29479
29496
|
return out;
|
|
29480
|
-
}, safeNormalize = (path) =>
|
|
29497
|
+
}, safeNormalize = (path) => resolve49(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
29481
29498
|
const { changedFilePath, userAngularRoot } = params;
|
|
29482
29499
|
const changedAbs = safeNormalize(changedFilePath);
|
|
29483
29500
|
const out = [];
|
|
@@ -29546,7 +29563,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29546
29563
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
29547
29564
|
return null;
|
|
29548
29565
|
}
|
|
29549
|
-
const base =
|
|
29566
|
+
const base = resolve49(childDir, spec);
|
|
29550
29567
|
const candidates = [
|
|
29551
29568
|
`${base}.ts`,
|
|
29552
29569
|
`${base}.tsx`,
|
|
@@ -29584,7 +29601,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29584
29601
|
};
|
|
29585
29602
|
if (cls.kind === "component") {
|
|
29586
29603
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
29587
|
-
const abs = safeNormalize(
|
|
29604
|
+
const abs = safeNormalize(resolve49(componentDir, url));
|
|
29588
29605
|
const existing = resource.get(abs);
|
|
29589
29606
|
if (existing)
|
|
29590
29607
|
existing.push(entity);
|
|
@@ -29846,8 +29863,8 @@ __export(exports_moduleServer, {
|
|
|
29846
29863
|
warmPage: () => warmPage,
|
|
29847
29864
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
29848
29865
|
});
|
|
29849
|
-
import { existsSync as
|
|
29850
|
-
import { basename as basename19, dirname as dirname33, extname as extname16, join as join58, resolve as
|
|
29866
|
+
import { existsSync as existsSync44, readFileSync as readFileSync39, realpathSync as realpathSync6, statSync as statSync9 } from "fs";
|
|
29867
|
+
import { basename as basename19, dirname as dirname33, extname as extname16, join as join58, resolve as resolve50, relative as relative22 } from "path";
|
|
29851
29868
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
29852
29869
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
29853
29870
|
const allExports = [];
|
|
@@ -29867,10 +29884,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
29867
29884
|
${stubs}
|
|
29868
29885
|
`;
|
|
29869
29886
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
29870
|
-
const directHit = extensions.find((ext) =>
|
|
29887
|
+
const directHit = extensions.find((ext) => existsSync44(resolve50(projectRoot, srcPath + ext)));
|
|
29871
29888
|
if (directHit)
|
|
29872
29889
|
return srcPath + directHit;
|
|
29873
|
-
const indexHit = extensions.find((ext) =>
|
|
29890
|
+
const indexHit = extensions.find((ext) => existsSync44(resolve50(projectRoot, srcPath, `index${ext}`)));
|
|
29874
29891
|
if (indexHit)
|
|
29875
29892
|
return `${srcPath}/index${indexHit}`;
|
|
29876
29893
|
return srcPath;
|
|
@@ -29899,7 +29916,7 @@ ${stubs}
|
|
|
29899
29916
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
29900
29917
|
}, srcUrl = (relPath, projectRoot) => {
|
|
29901
29918
|
const base = `${SRC_PREFIX}${encodeSrcPath(relPath)}`;
|
|
29902
|
-
const absPath =
|
|
29919
|
+
const absPath = resolve50(projectRoot, relPath);
|
|
29903
29920
|
const cached = mtimeCache.get(absPath);
|
|
29904
29921
|
if (cached !== undefined)
|
|
29905
29922
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -29911,12 +29928,12 @@ ${stubs}
|
|
|
29911
29928
|
return base;
|
|
29912
29929
|
}
|
|
29913
29930
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
29914
|
-
const absPath =
|
|
29931
|
+
const absPath = resolve50(fileDir, relPath);
|
|
29915
29932
|
const rel = relative22(projectRoot, absPath);
|
|
29916
29933
|
const extension = extname16(rel);
|
|
29917
29934
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
29918
29935
|
if (extname16(srcPath) === ".svelte") {
|
|
29919
|
-
srcPath = relative22(projectRoot, resolveSvelteModulePath(
|
|
29936
|
+
srcPath = relative22(projectRoot, resolveSvelteModulePath(resolve50(projectRoot, srcPath)));
|
|
29920
29937
|
}
|
|
29921
29938
|
return srcUrl(srcPath, projectRoot);
|
|
29922
29939
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -29935,14 +29952,14 @@ ${stubs}
|
|
|
29935
29952
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
29936
29953
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
29937
29954
|
if (!subpath) {
|
|
29938
|
-
const pkgDir =
|
|
29955
|
+
const pkgDir = resolve50(projectRoot, "node_modules", packageName ?? "");
|
|
29939
29956
|
const pkgJsonPath = join58(pkgDir, "package.json");
|
|
29940
|
-
if (
|
|
29957
|
+
if (existsSync44(pkgJsonPath)) {
|
|
29941
29958
|
const pkg = JSON.parse(readFileSync39(pkgJsonPath, "utf-8"));
|
|
29942
29959
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
29943
29960
|
if (esmEntry) {
|
|
29944
|
-
const resolved =
|
|
29945
|
-
if (
|
|
29961
|
+
const resolved = resolve50(pkgDir, esmEntry);
|
|
29962
|
+
if (existsSync44(resolved))
|
|
29946
29963
|
return relative22(projectRoot, resolved);
|
|
29947
29964
|
}
|
|
29948
29965
|
}
|
|
@@ -29990,7 +30007,7 @@ ${stubs}
|
|
|
29990
30007
|
const rel = relative22(projectRoot, absPath).replace(/\\/g, "/");
|
|
29991
30008
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
29992
30009
|
}
|
|
29993
|
-
if (!
|
|
30010
|
+
if (!existsSync44(absPath))
|
|
29994
30011
|
return _match;
|
|
29995
30012
|
const rel = relative22(projectRoot, absPath).replace(/\\/g, "/");
|
|
29996
30013
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
@@ -29998,12 +30015,12 @@ ${stubs}
|
|
|
29998
30015
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
29999
30016
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
30000
30017
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
30001
|
-
const absPath =
|
|
30018
|
+
const absPath = resolve50(fileDir, relPath);
|
|
30002
30019
|
const rel = relative22(projectRoot, absPath);
|
|
30003
30020
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
30004
30021
|
});
|
|
30005
30022
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
30006
|
-
const absPath =
|
|
30023
|
+
const absPath = resolve50(fileDir, relPath);
|
|
30007
30024
|
const rel = relative22(projectRoot, absPath);
|
|
30008
30025
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
30009
30026
|
});
|
|
@@ -30325,7 +30342,7 @@ ${code}`;
|
|
|
30325
30342
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
30326
30343
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
30327
30344
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
30328
|
-
const hmrBase = vueDir ?
|
|
30345
|
+
const hmrBase = vueDir ? resolve50(vueDir) : projectRoot;
|
|
30329
30346
|
const hmrId = relative22(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
30330
30347
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
30331
30348
|
result += [
|
|
@@ -30340,11 +30357,11 @@ ${code}`;
|
|
|
30340
30357
|
`);
|
|
30341
30358
|
return result;
|
|
30342
30359
|
}, resolveSvelteModulePath = (path) => {
|
|
30343
|
-
if (
|
|
30360
|
+
if (existsSync44(path))
|
|
30344
30361
|
return path;
|
|
30345
|
-
if (
|
|
30362
|
+
if (existsSync44(`${path}.ts`))
|
|
30346
30363
|
return `${path}.ts`;
|
|
30347
|
-
if (
|
|
30364
|
+
if (existsSync44(`${path}.js`))
|
|
30348
30365
|
return `${path}.js`;
|
|
30349
30366
|
return path;
|
|
30350
30367
|
}, jsResponse = (body) => {
|
|
@@ -30486,13 +30503,13 @@ export default {};
|
|
|
30486
30503
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
30487
30504
|
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);`);
|
|
30488
30505
|
}, resolveSourcePath2 = (relPath, projectRoot) => {
|
|
30489
|
-
const filePath =
|
|
30506
|
+
const filePath = resolve50(projectRoot, decodeSrcPath(relPath));
|
|
30490
30507
|
const ext = extname16(filePath);
|
|
30491
30508
|
if (ext === ".svelte")
|
|
30492
30509
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
30493
30510
|
if (ext)
|
|
30494
30511
|
return { ext, filePath };
|
|
30495
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
30512
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync44(filePath + candidate));
|
|
30496
30513
|
if (!found)
|
|
30497
30514
|
return { ext, filePath };
|
|
30498
30515
|
const resolved = filePath + found;
|
|
@@ -30523,14 +30540,14 @@ export default {};
|
|
|
30523
30540
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
30524
30541
|
const candidates = [
|
|
30525
30542
|
absoluteCandidate,
|
|
30526
|
-
|
|
30543
|
+
resolve50(projectRoot, tail)
|
|
30527
30544
|
];
|
|
30528
30545
|
try {
|
|
30529
30546
|
await Promise.resolve().then(() => init_loadConfig());
|
|
30530
30547
|
const cfg = await loadConfig();
|
|
30531
|
-
const angularDir = cfg.angularDirectory &&
|
|
30548
|
+
const angularDir = cfg.angularDirectory && resolve50(projectRoot, cfg.angularDirectory);
|
|
30532
30549
|
if (angularDir)
|
|
30533
|
-
candidates.push(
|
|
30550
|
+
candidates.push(resolve50(angularDir, tail));
|
|
30534
30551
|
} catch {}
|
|
30535
30552
|
for (const candidate of candidates) {
|
|
30536
30553
|
if (await fileExists(candidate)) {
|
|
@@ -30561,7 +30578,7 @@ export default {};
|
|
|
30561
30578
|
if (!TRANSPILABLE.has(ext))
|
|
30562
30579
|
return;
|
|
30563
30580
|
const stat = statSync9(filePath);
|
|
30564
|
-
const resolvedVueDir = vueDir ?
|
|
30581
|
+
const resolvedVueDir = vueDir ? resolve50(vueDir) : undefined;
|
|
30565
30582
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
30566
30583
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
30567
30584
|
if (isAngularGeneratedJs) {
|
|
@@ -30617,7 +30634,7 @@ export default {};
|
|
|
30617
30634
|
const ownMessage = source && typeof source === "object" ? Reflect.get(source, "message") : undefined;
|
|
30618
30635
|
const message = typeof ownMessage === "string" ? ownMessage : String(source);
|
|
30619
30636
|
return { message, ...readPosition(first) };
|
|
30620
|
-
}, getTransformError = (filePath) => transformErrors.get(
|
|
30637
|
+
}, getTransformError = (filePath) => transformErrors.get(resolve50(filePath)), transformErrorResponse = (err) => {
|
|
30621
30638
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
30622
30639
|
return new Response(`console.error('[ModuleServer] Transform error:', ${JSON.stringify(errMsg)});`, {
|
|
30623
30640
|
headers: { "Content-Type": "application/javascript" },
|
|
@@ -30640,16 +30657,16 @@ export default {};
|
|
|
30640
30657
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
30641
30658
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
30642
30659
|
return handleBunWrapRequest();
|
|
30643
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
30660
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve50(projectRoot, decodeSrcPath(relPath)));
|
|
30644
30661
|
if (virtualCssResponse)
|
|
30645
30662
|
return virtualCssResponse;
|
|
30646
30663
|
const { filePath, ext } = resolveSourcePath2(relPath, projectRoot);
|
|
30647
30664
|
try {
|
|
30648
30665
|
const response = await transformAndCache(filePath, ext, projectRoot, rewriter, frameworkDirs?.vue, stylePreprocessors);
|
|
30649
|
-
transformErrors.delete(
|
|
30666
|
+
transformErrors.delete(resolve50(filePath));
|
|
30650
30667
|
return response;
|
|
30651
30668
|
} catch (err) {
|
|
30652
|
-
transformErrors.set(
|
|
30669
|
+
transformErrors.set(resolve50(filePath), describeTransformError(err));
|
|
30653
30670
|
return transformErrorResponse(err);
|
|
30654
30671
|
}
|
|
30655
30672
|
};
|
|
@@ -30659,11 +30676,11 @@ export default {};
|
|
|
30659
30676
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
30660
30677
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
30661
30678
|
if (match[1])
|
|
30662
|
-
files.push(
|
|
30679
|
+
files.push(resolve50(projectRoot, decodeSrcPath(match[1])));
|
|
30663
30680
|
}
|
|
30664
30681
|
return files;
|
|
30665
30682
|
}, SRC_URL_PREFIX2, invalidateModule = (filePath) => {
|
|
30666
|
-
const resolved =
|
|
30683
|
+
const resolved = resolve50(filePath);
|
|
30667
30684
|
transformErrors.delete(resolved);
|
|
30668
30685
|
invalidate(filePath);
|
|
30669
30686
|
if (resolved !== filePath)
|
|
@@ -30729,7 +30746,7 @@ export default {};
|
|
|
30729
30746
|
return false;
|
|
30730
30747
|
}
|
|
30731
30748
|
await Promise.resolve().then(() => init_prepare());
|
|
30732
|
-
patchManifestIndexes(cached.manifest,
|
|
30749
|
+
patchManifestIndexes(cached.manifest, resolve50(state.resolvedPaths.buildDir, "_src_indexes"), SRC_PREFIX);
|
|
30733
30750
|
logPageBuild(entry.source, entry.framework, Math.round(durationMs));
|
|
30734
30751
|
logStartupTimingBlock("AbsoluteJS on-demand page build", [
|
|
30735
30752
|
{ durationMs, label: entry.name }
|
|
@@ -30892,7 +30909,7 @@ var init_rewriteImports = __esm(() => {
|
|
|
30892
30909
|
});
|
|
30893
30910
|
|
|
30894
30911
|
// src/dev/angular/hmrCompiler.ts
|
|
30895
|
-
import { dirname as dirname34, relative as relative23, resolve as
|
|
30912
|
+
import { dirname as dirname34, relative as relative23, resolve as resolve51 } from "path";
|
|
30896
30913
|
import { performance as performance2 } from "perf_hooks";
|
|
30897
30914
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
30898
30915
|
const projectRel = relative23(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -30904,7 +30921,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
30904
30921
|
return null;
|
|
30905
30922
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
30906
30923
|
const className = decoded.slice(separatorIndex + 1);
|
|
30907
|
-
const componentFilePath =
|
|
30924
|
+
const componentFilePath = resolve51(process.cwd(), filePathRel);
|
|
30908
30925
|
const projectRelPath = relative23(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
30909
30926
|
const cacheKey = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
30910
30927
|
await Promise.resolve().then(() => init_fastHmrCompiler());
|
|
@@ -30992,11 +31009,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
30992
31009
|
__export(exports_simpleHTMLHMR, {
|
|
30993
31010
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
30994
31011
|
});
|
|
30995
|
-
import { resolve as
|
|
31012
|
+
import { resolve as resolve52 } from "path";
|
|
30996
31013
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
30997
31014
|
let htmlContent;
|
|
30998
31015
|
try {
|
|
30999
|
-
const resolvedPath =
|
|
31016
|
+
const resolvedPath = resolve52(htmlFilePath);
|
|
31000
31017
|
const file = Bun.file(resolvedPath);
|
|
31001
31018
|
if (!await file.exists()) {
|
|
31002
31019
|
return null;
|
|
@@ -31022,11 +31039,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
31022
31039
|
__export(exports_simpleHTMXHMR, {
|
|
31023
31040
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
31024
31041
|
});
|
|
31025
|
-
import { resolve as
|
|
31042
|
+
import { resolve as resolve53 } from "path";
|
|
31026
31043
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
31027
31044
|
let htmlContent;
|
|
31028
31045
|
try {
|
|
31029
|
-
const resolvedPath =
|
|
31046
|
+
const resolvedPath = resolve53(htmxFilePath);
|
|
31030
31047
|
const file = Bun.file(resolvedPath);
|
|
31031
31048
|
if (!await file.exists()) {
|
|
31032
31049
|
return null;
|
|
@@ -31049,7 +31066,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
31049
31066
|
|
|
31050
31067
|
// src/dev/backendGraph.ts
|
|
31051
31068
|
import { readFileSync as readFileSync40, realpathSync as realpathSync7, statSync as statSync10 } from "fs";
|
|
31052
|
-
import { dirname as dirname35, extname as extname17, resolve as
|
|
31069
|
+
import { dirname as dirname35, extname as extname17, resolve as resolve54 } from "path";
|
|
31053
31070
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
|
|
31054
31071
|
const loader = LOADERS[extname17(path)] ?? "ts";
|
|
31055
31072
|
const existing = transpilers.get(loader);
|
|
@@ -31064,7 +31081,7 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
31064
31081
|
} catch {
|
|
31065
31082
|
return path;
|
|
31066
31083
|
}
|
|
31067
|
-
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) &&
|
|
31084
|
+
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) && resolve54(path).startsWith(resolve54(root)), resolveImport = (specifier, fromFile) => {
|
|
31068
31085
|
try {
|
|
31069
31086
|
return realPath2(Bun.resolveSync(specifier, dirname35(fromFile)));
|
|
31070
31087
|
} catch {
|
|
@@ -31089,14 +31106,14 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
31089
31106
|
fileCache.set(path, { imports, mtimeMs });
|
|
31090
31107
|
return imports;
|
|
31091
31108
|
}, importersOf = (target, entry, loaded = loadedProjectModules(entry)) => {
|
|
31092
|
-
const goal = realPath2(
|
|
31109
|
+
const goal = realPath2(resolve54(target));
|
|
31093
31110
|
const importers = [];
|
|
31094
31111
|
for (const file of loaded)
|
|
31095
31112
|
if (readImports(file).includes(goal))
|
|
31096
31113
|
importers.push(file);
|
|
31097
31114
|
return importers;
|
|
31098
31115
|
}, loadedProjectModules = (entry, loaded = Object.keys(__require.cache), root = process.cwd()) => {
|
|
31099
|
-
const entryPath = realPath2(
|
|
31116
|
+
const entryPath = realPath2(resolve54(entry));
|
|
31100
31117
|
const modules = new Set([entryPath]);
|
|
31101
31118
|
for (const path of loaded) {
|
|
31102
31119
|
if (isAbsoluteServerEntryCopyPath(path))
|
|
@@ -31882,7 +31899,7 @@ var init_runtime = __esm(() => {
|
|
|
31882
31899
|
|
|
31883
31900
|
// src/dev/hot/plugin.ts
|
|
31884
31901
|
import { mkdirSync as mkdirSync14, readFileSync as readFileSync41, realpathSync as realpathSync8, writeFileSync as writeFileSync11 } from "fs";
|
|
31885
|
-
import { extname as extname19, join as join59, relative as relative24, resolve as
|
|
31902
|
+
import { extname as extname19, join as join59, relative as relative24, resolve as resolve55, sep as sep8 } from "path";
|
|
31886
31903
|
var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
31887
31904
|
try {
|
|
31888
31905
|
return realpathSync8(path);
|
|
@@ -31961,7 +31978,7 @@ var init_plugin = __esm(() => {
|
|
|
31961
31978
|
SOURCE = /\.(?:[cm]?[jt]sx?)$/;
|
|
31962
31979
|
TEST_FILE = /(?:\.(?:spec|test)\.[cm]?[jt]sx?$)|(?:[\\/]__tests__[\\/])/;
|
|
31963
31980
|
GENERATED = /(?:^|[\\/])(?:build|generated|compiled|indexes|\.absolutejs|node_modules|dist)(?:[\\/]|$)/;
|
|
31964
|
-
ABSOLUTE_ROOT =
|
|
31981
|
+
ABSOLUTE_ROOT = resolve55(import.meta.dir, "..", "..", "..");
|
|
31965
31982
|
shared = globalThis.__absoluteHotPlugin ??= {
|
|
31966
31983
|
analyses: new Map,
|
|
31967
31984
|
installed: undefined
|
|
@@ -32137,7 +32154,7 @@ var init_reload = __esm(() => {
|
|
|
32137
32154
|
});
|
|
32138
32155
|
|
|
32139
32156
|
// src/dev/rebuildTrigger.ts
|
|
32140
|
-
import { existsSync as
|
|
32157
|
+
import { existsSync as existsSync45, readdirSync as readdirSync12, rmSync as rmSync4, statSync as statSync11 } from "fs";
|
|
32141
32158
|
import {
|
|
32142
32159
|
basename as basename20,
|
|
32143
32160
|
dirname as dirname37,
|
|
@@ -32251,7 +32268,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32251
32268
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
32252
32269
|
}
|
|
32253
32270
|
return { ...parsed, framework: detectedFw };
|
|
32254
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
32271
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync45(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
32255
32272
|
const { config } = state;
|
|
32256
32273
|
const cwd = process.cwd();
|
|
32257
32274
|
const absDeleted = resolvePath(deletedFile).replace(/\\/g, "/");
|
|
@@ -32297,7 +32314,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32297
32314
|
if (!dependents || dependents.size === 0) {
|
|
32298
32315
|
return;
|
|
32299
32316
|
}
|
|
32300
|
-
const dependentFiles = Array.from(dependents).filter((file) =>
|
|
32317
|
+
const dependentFiles = Array.from(dependents).filter((file) => existsSync45(file));
|
|
32301
32318
|
if (dependentFiles.length === 0) {
|
|
32302
32319
|
return;
|
|
32303
32320
|
}
|
|
@@ -32313,7 +32330,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32313
32330
|
try {
|
|
32314
32331
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
32315
32332
|
affectedFiles.forEach((affectedFile) => {
|
|
32316
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
32333
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync45(affectedFile)) {
|
|
32317
32334
|
validFiles.push(affectedFile);
|
|
32318
32335
|
processedFiles.add(affectedFile);
|
|
32319
32336
|
}
|
|
@@ -32338,7 +32355,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32338
32355
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
32339
32356
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
32340
32357
|
filePathSet.forEach((filePathInSet) => {
|
|
32341
|
-
if (!
|
|
32358
|
+
if (!existsSync45(filePathInSet)) {
|
|
32342
32359
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
32343
32360
|
return;
|
|
32344
32361
|
}
|
|
@@ -32621,7 +32638,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32621
32638
|
return componentFile;
|
|
32622
32639
|
}
|
|
32623
32640
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
32624
|
-
if (
|
|
32641
|
+
if (existsSync45(tsCounterpart)) {
|
|
32625
32642
|
return tsCounterpart;
|
|
32626
32643
|
}
|
|
32627
32644
|
if (!graph)
|
|
@@ -33559,7 +33576,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33559
33576
|
}
|
|
33560
33577
|
return ctx;
|
|
33561
33578
|
}, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
|
|
33562
|
-
const existingSvelteFiles = svelteFiles.filter((file) =>
|
|
33579
|
+
const existingSvelteFiles = svelteFiles.filter((file) => existsSync45(file));
|
|
33563
33580
|
if (existingSvelteFiles.length === 0)
|
|
33564
33581
|
return;
|
|
33565
33582
|
const svelteDir = config.svelteDirectory ?? "";
|
|
@@ -34942,7 +34959,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
34942
34959
|
// src/build/buildDepVendor.ts
|
|
34943
34960
|
import { mkdirSync as mkdirSync15 } from "fs";
|
|
34944
34961
|
import { isBuiltin as isBuiltin2 } from "module";
|
|
34945
|
-
import { join as join61 } from "path";
|
|
34962
|
+
import { join as join61, relative as relative27 } from "path";
|
|
34946
34963
|
import { rm as rm13 } from "fs/promises";
|
|
34947
34964
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
34948
34965
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -34978,7 +34995,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
34978
34995
|
const glob = new Glob10("**/*.{ts,tsx,js,jsx}");
|
|
34979
34996
|
try {
|
|
34980
34997
|
const all = await Array.fromAsync(glob.scan({ absolute: true, cwd: dir }));
|
|
34981
|
-
return all.filter((file) => !isSkippedFile(file));
|
|
34998
|
+
return all.filter((file) => !isSkippedFile(`/${relative27(dir, file).replaceAll("\\", "/")}`));
|
|
34982
34999
|
} catch {
|
|
34983
35000
|
return empty;
|
|
34984
35001
|
}
|
|
@@ -35280,13 +35297,13 @@ var init_buildDepVendor = __esm(() => {
|
|
|
35280
35297
|
import { createHash as createHash7 } from "crypto";
|
|
35281
35298
|
import {
|
|
35282
35299
|
copyFileSync as copyFileSync4,
|
|
35283
|
-
existsSync as
|
|
35300
|
+
existsSync as existsSync46,
|
|
35284
35301
|
mkdirSync as mkdirSync16,
|
|
35285
35302
|
readdirSync as readdirSync13,
|
|
35286
35303
|
readFileSync as readFileSync43
|
|
35287
35304
|
} from "fs";
|
|
35288
35305
|
import { mkdir as mkdir14, readFile as readFile10, rename as rename5, rm as rm14, writeFile as writeFile12 } from "fs/promises";
|
|
35289
|
-
import { basename as basename21, join as join62, resolve as
|
|
35306
|
+
import { basename as basename21, join as join62, resolve as resolve56 } from "path";
|
|
35290
35307
|
var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
|
|
35291
35308
|
const hash = createHash7("sha256");
|
|
35292
35309
|
hash.update(String(CACHE_FORMAT_VERSION3));
|
|
@@ -35306,7 +35323,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35306
35323
|
}
|
|
35307
35324
|
for (const dir of inputs.vendorDirs) {
|
|
35308
35325
|
hash.update("\x00v");
|
|
35309
|
-
hash.update(basename21(
|
|
35326
|
+
hash.update(basename21(resolve56(dir, "..")));
|
|
35310
35327
|
}
|
|
35311
35328
|
return hash.digest("hex").slice(0, KEY_LENGTH);
|
|
35312
35329
|
}, readLockfileHash = (projectRoot = process.cwd()) => {
|
|
@@ -35314,7 +35331,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35314
35331
|
let found = false;
|
|
35315
35332
|
for (const name of LOCKFILES) {
|
|
35316
35333
|
const path = join62(projectRoot, name);
|
|
35317
|
-
if (!
|
|
35334
|
+
if (!existsSync46(path))
|
|
35318
35335
|
continue;
|
|
35319
35336
|
found = true;
|
|
35320
35337
|
hash.update(name);
|
|
@@ -35334,21 +35351,21 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35334
35351
|
}, copySlotsInto = (cacheDir, vendorDirs) => {
|
|
35335
35352
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35336
35353
|
const source = join62(cacheDir, slotName(index, dir));
|
|
35337
|
-
if (!
|
|
35354
|
+
if (!existsSync46(source)) {
|
|
35338
35355
|
throw new Error(`missing cached vendor dir ${source}`);
|
|
35339
35356
|
}
|
|
35340
35357
|
copyTree(source, dir);
|
|
35341
35358
|
}
|
|
35342
35359
|
}, copySlotsFrom = (stagingDir, vendorDirs) => {
|
|
35343
35360
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35344
|
-
if (!
|
|
35361
|
+
if (!existsSync46(dir))
|
|
35345
35362
|
continue;
|
|
35346
35363
|
copyTree(dir, join62(stagingDir, slotName(index, dir)));
|
|
35347
35364
|
}
|
|
35348
|
-
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) =>
|
|
35365
|
+
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve56(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename21(resolve56(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
|
|
35349
35366
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
35350
35367
|
const payloadPath = join62(cacheDir, "payload.json");
|
|
35351
|
-
if (!
|
|
35368
|
+
if (!existsSync46(payloadPath))
|
|
35352
35369
|
return null;
|
|
35353
35370
|
try {
|
|
35354
35371
|
const payload = JSON.parse(await readFile10(payloadPath, "utf8"));
|
|
@@ -35361,7 +35378,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35361
35378
|
}
|
|
35362
35379
|
}, saveVendorCache = async (key, vendorDirs, payload, projectRoot = process.cwd()) => {
|
|
35363
35380
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
35364
|
-
if (
|
|
35381
|
+
if (existsSync46(join62(cacheDir, "payload.json")))
|
|
35365
35382
|
return;
|
|
35366
35383
|
const stagingDir = `${cacheDir}.${process.pid}.tmp`;
|
|
35367
35384
|
try {
|
|
@@ -35390,9 +35407,9 @@ var init_vendorCache = __esm(() => {
|
|
|
35390
35407
|
|
|
35391
35408
|
// src/core/devBuild.ts
|
|
35392
35409
|
import { readdir as readdir6 } from "fs/promises";
|
|
35393
|
-
import { existsSync as
|
|
35394
|
-
import { resolve as
|
|
35395
|
-
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir
|
|
35410
|
+
import { existsSync as existsSync47, statSync as statSync12 } from "fs";
|
|
35411
|
+
import { resolve as resolve57 } from "path";
|
|
35412
|
+
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (config) => {
|
|
35396
35413
|
const configuredDirs = [
|
|
35397
35414
|
...collectConfigVendorSourceDirs(config),
|
|
35398
35415
|
devClientVendorSourceDir()
|
|
@@ -35415,7 +35432,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35415
35432
|
return Object.keys(config).length > 0 ? config : null;
|
|
35416
35433
|
}, reloadConfig = async () => {
|
|
35417
35434
|
try {
|
|
35418
|
-
const configPath =
|
|
35435
|
+
const configPath = resolve57(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
35419
35436
|
const source = await Bun.file(configPath).text();
|
|
35420
35437
|
return parseDirectoryConfig(source);
|
|
35421
35438
|
} catch {
|
|
@@ -35530,7 +35547,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35530
35547
|
});
|
|
35531
35548
|
}
|
|
35532
35549
|
}, handleCachedReload = async () => {
|
|
35533
|
-
const serverMtime = statSync12(
|
|
35550
|
+
const serverMtime = statSync12(resolve57(Bun.main)).mtimeMs;
|
|
35534
35551
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
35535
35552
|
globalThis.__hmrServerMtime = serverMtime;
|
|
35536
35553
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -35571,8 +35588,8 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35571
35588
|
return true;
|
|
35572
35589
|
}, resolveAbsoluteVersion2 = async () => {
|
|
35573
35590
|
const candidates = [
|
|
35574
|
-
|
|
35575
|
-
|
|
35591
|
+
resolve57(import.meta.dir, "..", "..", "package.json"),
|
|
35592
|
+
resolve57(import.meta.dir, "..", "package.json")
|
|
35576
35593
|
];
|
|
35577
35594
|
const [candidate, ...remaining] = candidates;
|
|
35578
35595
|
if (!candidate) {
|
|
@@ -35598,7 +35615,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35598
35615
|
const entries = await readdir6(vendorDir).catch(() => emptyStringArray);
|
|
35599
35616
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
35600
35617
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
35601
|
-
const bytes = await Bun.file(
|
|
35618
|
+
const bytes = await Bun.file(resolve57(vendorDir, entry)).bytes();
|
|
35602
35619
|
assetStore.set(webPath, bytes);
|
|
35603
35620
|
}));
|
|
35604
35621
|
}, devBuild = async (config) => {
|
|
@@ -35668,7 +35685,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35668
35685
|
const sourceFiles = await collectDepVendorSourceFiles(config);
|
|
35669
35686
|
const configVendorDirs = collectConfigVendorSourceDirs(config);
|
|
35670
35687
|
const prescannedVendorPaths = prescanVendorPaths(prescan, configVendorDirs);
|
|
35671
|
-
const remainingVendorDirs = prescannedVendorPaths ? sourceDirs.filter((dir) => !configVendorDirs.includes(dir) &&
|
|
35688
|
+
const remainingVendorDirs = prescannedVendorPaths ? sourceDirs.filter((dir) => !configVendorDirs.includes(dir) && existsSync47(dir)) : sourceDirs;
|
|
35672
35689
|
if (prescannedVendorPaths && remainingVendorDirs.length === 0 && sourceFiles.length === 0) {
|
|
35673
35690
|
globalThis.__depVendorPaths = prescannedVendorPaths;
|
|
35674
35691
|
} else {
|
|
@@ -35784,11 +35801,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35784
35801
|
}
|
|
35785
35802
|
stepStartedAt = performance.now();
|
|
35786
35803
|
setBootPhase("build vendor bundles");
|
|
35787
|
-
const reactVendorDir =
|
|
35788
|
-
const angularVendorDir =
|
|
35789
|
-
const svelteVendorDir =
|
|
35790
|
-
const vueVendorDir =
|
|
35791
|
-
const depVendorDir =
|
|
35804
|
+
const reactVendorDir = resolve57(state.resolvedPaths.buildDir, "react", "vendor");
|
|
35805
|
+
const angularVendorDir = resolve57(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
35806
|
+
const svelteVendorDir = resolve57(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
35807
|
+
const vueVendorDir = resolve57(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
35808
|
+
const depVendorDir = resolve57(state.resolvedPaths.buildDir, "vendor");
|
|
35792
35809
|
await Promise.resolve().then(() => init_buildDepVendor());
|
|
35793
35810
|
const activeVendorDirs = [
|
|
35794
35811
|
config.reactDirectory ? reactVendorDir : null,
|
|
@@ -35905,10 +35922,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35905
35922
|
manifest
|
|
35906
35923
|
};
|
|
35907
35924
|
globalThis.__hmrDevResult = result;
|
|
35908
|
-
globalThis.__hmrServerMtime = statSync12(
|
|
35925
|
+
globalThis.__hmrServerMtime = statSync12(resolve57(Bun.main)).mtimeMs;
|
|
35909
35926
|
return result;
|
|
35910
35927
|
};
|
|
35911
35928
|
var init_devBuild = __esm(() => {
|
|
35929
|
+
init_runtimePaths();
|
|
35912
35930
|
init_build();
|
|
35913
35931
|
init_buildReactVendor();
|
|
35914
35932
|
init_buildAngularVendor();
|
|
@@ -35936,6 +35954,7 @@ var init_devBuild = __esm(() => {
|
|
|
35936
35954
|
"htmxDirectory",
|
|
35937
35955
|
"angularDirectory"
|
|
35938
35956
|
];
|
|
35957
|
+
devClientVendorSourceDir = resolveDevClientDirectory;
|
|
35939
35958
|
});
|
|
35940
35959
|
|
|
35941
35960
|
// src/react/bridgeInternals.ts
|
|
@@ -36154,14 +36173,14 @@ var init_hmr = __esm(() => {
|
|
|
36154
36173
|
});
|
|
36155
36174
|
|
|
36156
36175
|
// src/plugins/devtoolsJson.ts
|
|
36157
|
-
import { existsSync as
|
|
36158
|
-
import { dirname as dirname38, join as join63, resolve as
|
|
36176
|
+
import { existsSync as existsSync48, mkdirSync as mkdirSync17, readFileSync as readFileSync44, writeFileSync as writeFileSync12 } from "fs";
|
|
36177
|
+
import { dirname as dirname38, join as join63, resolve as resolve58 } from "path";
|
|
36159
36178
|
import { Elysia as Elysia8 } from "elysia";
|
|
36160
36179
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
36161
36180
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
36162
36181
|
return uuid;
|
|
36163
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
36164
|
-
if (!
|
|
36182
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve58(uuidCachePath ?? join63(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
36183
|
+
if (!existsSync48(cachePath))
|
|
36165
36184
|
return null;
|
|
36166
36185
|
try {
|
|
36167
36186
|
const value = readFileSync44(cachePath, "utf-8").trim();
|
|
@@ -36186,7 +36205,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36186
36205
|
writeFileSync12(cachePath, uuid, "utf-8");
|
|
36187
36206
|
return setGlobalUuid(uuid);
|
|
36188
36207
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
36189
|
-
const rootPath =
|
|
36208
|
+
const rootPath = resolve58(options.projectRoot ?? process.cwd());
|
|
36190
36209
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
36191
36210
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
36192
36211
|
return new Elysia8({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -36210,13 +36229,13 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36210
36229
|
var init_devtoolsJson = () => {};
|
|
36211
36230
|
|
|
36212
36231
|
// src/plugins/imageOptimizer.ts
|
|
36213
|
-
import { existsSync as
|
|
36214
|
-
import { resolve as
|
|
36232
|
+
import { existsSync as existsSync49 } from "fs";
|
|
36233
|
+
import { resolve as resolve59 } from "path";
|
|
36215
36234
|
import { Elysia as Elysia9 } from "elysia";
|
|
36216
36235
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
36217
36236
|
try {
|
|
36218
36237
|
const resolved = validateSafePath(path, baseDir);
|
|
36219
|
-
if (
|
|
36238
|
+
if (existsSync49(resolved))
|
|
36220
36239
|
return resolved;
|
|
36221
36240
|
return null;
|
|
36222
36241
|
} catch {
|
|
@@ -36224,7 +36243,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
36224
36243
|
}
|
|
36225
36244
|
}, resolveLocalImage = (url, buildDir) => {
|
|
36226
36245
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
36227
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
36246
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve59(process.cwd()));
|
|
36228
36247
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
36229
36248
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
36230
36249
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -37317,8 +37336,8 @@ var init_prerender = () => {};
|
|
|
37317
37336
|
|
|
37318
37337
|
// src/core/prepare.ts
|
|
37319
37338
|
import { createHash as createHash11 } from "crypto";
|
|
37320
|
-
import { existsSync as
|
|
37321
|
-
import { basename as basename22, join as join67, relative as
|
|
37339
|
+
import { existsSync as existsSync50, readdirSync as readdirSync14, readFileSync as readFileSync46 } from "fs";
|
|
37340
|
+
import { basename as basename22, join as join67, relative as relative28, resolve as resolvePath4 } from "path";
|
|
37322
37341
|
import { Elysia as Elysia12, NotFound } from "elysia";
|
|
37323
37342
|
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
|
|
37324
37343
|
setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
@@ -37407,7 +37426,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37407
37426
|
return files;
|
|
37408
37427
|
}, PREWARM_MAX_PAUSE_MS = 60000, toWarmTasks = function* (files, warmCache, srcUrlPrefix) {
|
|
37409
37428
|
for (const file of files) {
|
|
37410
|
-
const rel =
|
|
37429
|
+
const rel = relative28(process.cwd(), file).replace(/\\/g, "/");
|
|
37411
37430
|
yield () => warmCache(`${srcUrlPrefix}${rel}`);
|
|
37412
37431
|
}
|
|
37413
37432
|
}, builtPageSources = () => {
|
|
@@ -37446,9 +37465,9 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37446
37465
|
if (!fileName)
|
|
37447
37466
|
continue;
|
|
37448
37467
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
37449
|
-
if (!
|
|
37468
|
+
if (!existsSync50(srcPath))
|
|
37450
37469
|
continue;
|
|
37451
|
-
manifest[key] = `${SRC_URL_PREFIX}${encodeSrcPath(
|
|
37470
|
+
manifest[key] = `${SRC_URL_PREFIX}${encodeSrcPath(relative28(process.cwd(), srcPath))}`;
|
|
37452
37471
|
}
|
|
37453
37472
|
}, ICON_HASH_LENGTH = 8, registerIconVersioning = (buildDir) => {
|
|
37454
37473
|
const cache = new Map;
|
|
@@ -37461,7 +37480,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37461
37480
|
const path = href.split("?")[0] ?? href;
|
|
37462
37481
|
const filePath = join67(buildDir, path);
|
|
37463
37482
|
let versioned = href;
|
|
37464
|
-
if (
|
|
37483
|
+
if (existsSync50(filePath)) {
|
|
37465
37484
|
const hash = createHash11("sha256").update(readFileSync46(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
37466
37485
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
37467
37486
|
}
|
|
@@ -37583,7 +37602,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37583
37602
|
};
|
|
37584
37603
|
}, loadPrerenderMap = (prerenderDir) => {
|
|
37585
37604
|
const map = new Map;
|
|
37586
|
-
if (!
|
|
37605
|
+
if (!existsSync50(prerenderDir))
|
|
37587
37606
|
return map;
|
|
37588
37607
|
let entries;
|
|
37589
37608
|
try {
|
|
@@ -37601,7 +37620,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37601
37620
|
return map;
|
|
37602
37621
|
}, loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
37603
37622
|
const root = join67(buildDir, ".absolutejs", "mobile-compatibility");
|
|
37604
|
-
if (!
|
|
37623
|
+
if (!existsSync50(join67(root, "current.json"))) {
|
|
37605
37624
|
return new Elysia12({ name: "absolutejs-mobile-compatibility-empty" });
|
|
37606
37625
|
}
|
|
37607
37626
|
const [
|
|
@@ -37666,12 +37685,12 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37666
37685
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
37667
37686
|
stepStartedAt = performance.now();
|
|
37668
37687
|
const conventionsPath = join67(buildDir, "conventions.json");
|
|
37669
|
-
if (
|
|
37688
|
+
if (existsSync50(conventionsPath)) {
|
|
37670
37689
|
const conventions = JSON.parse(readFileSync46(conventionsPath, "utf-8"));
|
|
37671
37690
|
setConventions(conventions);
|
|
37672
37691
|
}
|
|
37673
37692
|
const spaRoutesPath = join67(buildDir, "spa-routes.json");
|
|
37674
|
-
if (
|
|
37693
|
+
if (existsSync50(spaRoutesPath)) {
|
|
37675
37694
|
setSpaRouteManifest(JSON.parse(readFileSync46(spaRoutesPath, "utf-8")));
|
|
37676
37695
|
}
|
|
37677
37696
|
recordStep("load production conventions", stepStartedAt);
|
|
@@ -37688,7 +37707,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37688
37707
|
name: "absolutejs-generated-assets"
|
|
37689
37708
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
37690
37709
|
const requestedPath = resolvePath4(generatedAssetsRoot, params["*"]);
|
|
37691
|
-
if (
|
|
37710
|
+
if (relative28(generatedAssetsRoot, requestedPath).startsWith("..")) {
|
|
37692
37711
|
set.status = 404;
|
|
37693
37712
|
return "Not Found";
|
|
37694
37713
|
}
|
|
@@ -37835,14 +37854,14 @@ __export(exports_serverEntryWatcher, {
|
|
|
37835
37854
|
});
|
|
37836
37855
|
import {
|
|
37837
37856
|
copyFileSync as copyFileSync6,
|
|
37838
|
-
existsSync as
|
|
37857
|
+
existsSync as existsSync52,
|
|
37839
37858
|
readdirSync as readdirSync16,
|
|
37840
37859
|
readFileSync as readFileSync49,
|
|
37841
37860
|
statSync as statSync13,
|
|
37842
37861
|
watch as watch2
|
|
37843
37862
|
} from "fs";
|
|
37844
37863
|
import { createHash as createHash12 } from "crypto";
|
|
37845
|
-
import { dirname as dirname40, join as join70, resolve as
|
|
37864
|
+
import { dirname as dirname40, join as join70, resolve as resolve60 } from "path";
|
|
37846
37865
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETRY_DELAY_MS = 250, MAX_ENTRY_IMPORT_ATTEMPTS = 3, WATCH_FALLBACK_INTERVAL_MS = 250, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || isAbsoluteServerEntryCopyPath(filename) || ATOMIC_WRITE_TEMP_PATTERNS2.some((pattern) => pattern.test(filename)), fileHash = (path) => {
|
|
37847
37866
|
try {
|
|
37848
37867
|
return createHash12("sha256").update(readFileSync49(path)).digest("hex");
|
|
@@ -37866,14 +37885,14 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
37866
37885
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
37867
37886
|
return;
|
|
37868
37887
|
const originalEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
37869
|
-
if (!originalEntry || !
|
|
37888
|
+
if (!originalEntry || !existsSync52(originalEntry))
|
|
37870
37889
|
return;
|
|
37871
37890
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
37872
37891
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
37873
|
-
const entryPath =
|
|
37892
|
+
const entryPath = resolve60(originalEntry);
|
|
37874
37893
|
const entryDir = dirname40(entryPath);
|
|
37875
37894
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
37876
|
-
const configPath =
|
|
37895
|
+
const configPath = resolve60(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
37877
37896
|
const configDir = dirname40(configPath);
|
|
37878
37897
|
const configBase = configPath.slice(configDir.length + 1);
|
|
37879
37898
|
const recentlyHandled = new Map;
|
|
@@ -38504,7 +38523,7 @@ init_hotResources();
|
|
|
38504
38523
|
// src/dev/devCert.ts
|
|
38505
38524
|
import {
|
|
38506
38525
|
copyFileSync as copyFileSync5,
|
|
38507
|
-
existsSync as
|
|
38526
|
+
existsSync as existsSync51,
|
|
38508
38527
|
mkdirSync as mkdirSync19,
|
|
38509
38528
|
readFileSync as readFileSync47,
|
|
38510
38529
|
rmSync as rmSync5
|
|
@@ -38520,7 +38539,7 @@ var DEFAULT_CERTIFICATE_HOSTS = ["localhost", "127.0.0.1", "::1"];
|
|
|
38520
38539
|
var CERTIFICATE_HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))*$/u;
|
|
38521
38540
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
38522
38541
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
38523
|
-
var certFilesExist = () =>
|
|
38542
|
+
var certFilesExist = () => existsSync51(CERT_PATH) && existsSync51(KEY_PATH);
|
|
38524
38543
|
var normalizeDevCertificateHosts = (hosts = []) => {
|
|
38525
38544
|
const normalized = new Set(DEFAULT_CERTIFICATE_HOSTS);
|
|
38526
38545
|
for (const host of hosts) {
|
|
@@ -39194,8 +39213,8 @@ var serializeSpeculationRules = (rules) => {
|
|
|
39194
39213
|
};
|
|
39195
39214
|
// src/utils/defineEnv.ts
|
|
39196
39215
|
var {env: bunEnv } = globalThis.Bun;
|
|
39197
|
-
import { existsSync as
|
|
39198
|
-
import { resolve as
|
|
39216
|
+
import { existsSync as existsSync53, readFileSync as readFileSync50 } from "fs";
|
|
39217
|
+
import { resolve as resolve61 } from "path";
|
|
39199
39218
|
|
|
39200
39219
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
39201
39220
|
function IsAsyncIterator(value) {
|
|
@@ -43722,8 +43741,8 @@ ${lines.join(`
|
|
|
43722
43741
|
};
|
|
43723
43742
|
var checkEnvFileSecurity = (properties) => {
|
|
43724
43743
|
const cwd = process.cwd();
|
|
43725
|
-
const envPath =
|
|
43726
|
-
if (!
|
|
43744
|
+
const envPath = resolve61(cwd, ".env");
|
|
43745
|
+
if (!existsSync53(envPath))
|
|
43727
43746
|
return;
|
|
43728
43747
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
43729
43748
|
if (sensitiveKeys.length === 0)
|
|
@@ -43732,8 +43751,8 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
43732
43751
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
43733
43752
|
if (presentKeys.length === 0)
|
|
43734
43753
|
return;
|
|
43735
|
-
const gitignorePath =
|
|
43736
|
-
if (
|
|
43754
|
+
const gitignorePath = resolve61(cwd, ".gitignore");
|
|
43755
|
+
if (existsSync53(gitignorePath)) {
|
|
43737
43756
|
const gitignore = readFileSync50(gitignorePath, "utf-8");
|
|
43738
43757
|
if (gitignore.split(`
|
|
43739
43758
|
`).some((line) => line.trim() === ".env"))
|
|
@@ -43766,8 +43785,8 @@ var getEnv = (key) => {
|
|
|
43766
43785
|
return environmentVariable;
|
|
43767
43786
|
};
|
|
43768
43787
|
// src/utils/projectRoot.ts
|
|
43769
|
-
import { existsSync as
|
|
43770
|
-
import { dirname as dirname41, resolve as
|
|
43788
|
+
import { existsSync as existsSync54 } from "fs";
|
|
43789
|
+
import { dirname as dirname41, resolve as resolve62 } from "path";
|
|
43771
43790
|
var CONFIG_CANDIDATES = [
|
|
43772
43791
|
"absolute.config.ts",
|
|
43773
43792
|
"absolute.config.js",
|
|
@@ -43776,7 +43795,7 @@ var CONFIG_CANDIDATES = [
|
|
|
43776
43795
|
"absolute.config.mts",
|
|
43777
43796
|
"absolute.config.cts"
|
|
43778
43797
|
];
|
|
43779
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) =>
|
|
43798
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync54(resolve62(directory, name)));
|
|
43780
43799
|
var findProjectRoot = () => {
|
|
43781
43800
|
const start = process.cwd();
|
|
43782
43801
|
let packageRoot = null;
|
|
@@ -43785,7 +43804,7 @@ var findProjectRoot = () => {
|
|
|
43785
43804
|
if (hasAbsoluteConfig(directory)) {
|
|
43786
43805
|
return directory;
|
|
43787
43806
|
}
|
|
43788
|
-
if (packageRoot === null &&
|
|
43807
|
+
if (packageRoot === null && existsSync54(resolve62(directory, "package.json"))) {
|
|
43789
43808
|
packageRoot = directory;
|
|
43790
43809
|
}
|
|
43791
43810
|
const parent = dirname41(directory);
|
|
@@ -44055,5 +44074,5 @@ export {
|
|
|
44055
44074
|
wrapPageHandlerWithStreamingSlots
|
|
44056
44075
|
};
|
|
44057
44076
|
|
|
44058
|
-
//# debugId=
|
|
44077
|
+
//# debugId=25C9324BCB7CBD2464756E2164756E21
|
|
44059
44078
|
//# sourceMappingURL=index.js.map
|