@absolutejs/absolute 0.20.0-beta.147 → 0.20.0-beta.149
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 +12 -0
- package/changelog.json +49 -25
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build/buildWorker.js +23 -14
- package/dist/build.js +420 -391
- package/dist/build.js.map +10 -8
- package/dist/cli/{buildDepVendor-g49s8rr1.js → buildDepVendor-29d8v9cx.js} +2 -1
- package/dist/cli/{dev-2s1wgybw.js → dev-b9d4vnk0.js} +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/index.js +582 -553
- package/dist/index.js.map +10 -8
- package/dist/src/build/inlineCssImports.d.ts +1 -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
|
}
|
|
@@ -21705,40 +21722,48 @@ var init_emitTsHelpers = __esm(() => {
|
|
|
21705
21722
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
21706
21723
|
});
|
|
21707
21724
|
|
|
21708
|
-
// src/build/
|
|
21709
|
-
import {
|
|
21710
|
-
import { dirname as dirname23,
|
|
21711
|
-
var
|
|
21712
|
-
var transpiler5, inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
21725
|
+
// src/build/inlineCssImports.ts
|
|
21726
|
+
import { readFileSync as readFileSync30, realpathSync as realpathSync2 } from "fs";
|
|
21727
|
+
import { dirname as dirname23, resolve as resolve35 } from "path";
|
|
21728
|
+
var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
21713
21729
|
const resolved = realpathSync2(cssFilePath);
|
|
21714
21730
|
if (visited.has(resolved))
|
|
21715
21731
|
return "";
|
|
21716
21732
|
visited.add(resolved);
|
|
21717
21733
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
21718
21734
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
21719
|
-
const importedPath =
|
|
21735
|
+
const importedPath = resolve35(dirname23(cssFilePath), relPath);
|
|
21720
21736
|
if (!isFile(importedPath))
|
|
21721
21737
|
return match;
|
|
21722
21738
|
const importedContent = readFileSync30(importedPath, "utf-8");
|
|
21723
21739
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
21724
21740
|
});
|
|
21725
|
-
}
|
|
21741
|
+
};
|
|
21742
|
+
var init_inlineCssImports = __esm(() => {
|
|
21743
|
+
init_isFile();
|
|
21744
|
+
});
|
|
21745
|
+
|
|
21746
|
+
// src/build/compileVueSfc.ts
|
|
21747
|
+
import { existsSync as existsSync32, readFileSync as readFileSync31, realpathSync as realpathSync3 } from "fs";
|
|
21748
|
+
import { dirname as dirname24, relative as relative18, resolve as resolve36 } from "path";
|
|
21749
|
+
var {Transpiler: Transpiler4 } = globalThis.Bun;
|
|
21750
|
+
var transpiler5, toJs = (filePath, sourceDir) => {
|
|
21726
21751
|
if (filePath.endsWith(".vue"))
|
|
21727
21752
|
return filePath.replace(/\.vue$/, ".js");
|
|
21728
21753
|
if (filePath.endsWith(".ts"))
|
|
21729
21754
|
return filePath.replace(/\.ts$/, ".js");
|
|
21730
21755
|
if (isStylePath(filePath)) {
|
|
21731
21756
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
21732
|
-
return
|
|
21757
|
+
return resolve36(sourceDir, filePath);
|
|
21733
21758
|
}
|
|
21734
21759
|
return filePath;
|
|
21735
21760
|
}
|
|
21736
21761
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
21737
|
-
const directTs =
|
|
21738
|
-
if (
|
|
21762
|
+
const directTs = resolve36(sourceDir, `${filePath}.ts`);
|
|
21763
|
+
if (existsSync32(directTs))
|
|
21739
21764
|
return `${filePath}.js`;
|
|
21740
|
-
const indexedTs =
|
|
21741
|
-
if (
|
|
21765
|
+
const indexedTs = resolve36(sourceDir, filePath, "index.ts");
|
|
21766
|
+
if (existsSync32(indexedTs))
|
|
21742
21767
|
return `${filePath}/index.js`;
|
|
21743
21768
|
}
|
|
21744
21769
|
return `${filePath}.js`;
|
|
@@ -21805,11 +21830,11 @@ const ${localName} = (source) => ${importedName}(
|
|
|
21805
21830
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
21806
21831
|
fs: {
|
|
21807
21832
|
fileExists: isFile,
|
|
21808
|
-
realpath:
|
|
21833
|
+
realpath: realpathSync3,
|
|
21809
21834
|
readFile: (file) => {
|
|
21810
21835
|
if (!isFile(file))
|
|
21811
21836
|
return;
|
|
21812
|
-
const content =
|
|
21837
|
+
const content = readFileSync31(file, "utf-8");
|
|
21813
21838
|
typeDepHashes[file] = hashContent(content);
|
|
21814
21839
|
return content;
|
|
21815
21840
|
}
|
|
@@ -21820,12 +21845,12 @@ const ${localName} = (source) => ${importedName}(
|
|
|
21820
21845
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
21821
21846
|
const typeDependencies = "deps" in compiledScript ? compiledScript.deps ?? [] : [];
|
|
21822
21847
|
for (const dep of typeDependencies) {
|
|
21823
|
-
if (dep in typeDepHashes || !
|
|
21848
|
+
if (dep in typeDepHashes || !existsSync32(dep))
|
|
21824
21849
|
continue;
|
|
21825
|
-
typeDepHashes[dep] = hashContent(
|
|
21850
|
+
typeDepHashes[dep] = hashContent(readFileSync31(dep, "utf-8"));
|
|
21826
21851
|
}
|
|
21827
21852
|
const strippedScript = stripExports2(compiledScript.content);
|
|
21828
|
-
const sourceDir =
|
|
21853
|
+
const sourceDir = dirname24(sourceFilePath);
|
|
21829
21854
|
const transpiledScript = rewriteRelativeImports(transpiler5.transformSync(strippedScript), sourceDir);
|
|
21830
21855
|
const generateRenderFunction = (ssr) => {
|
|
21831
21856
|
const rendered = compiler.compileTemplate({
|
|
@@ -21880,7 +21905,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
21880
21905
|
let result = code;
|
|
21881
21906
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
21882
21907
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
21883
|
-
let rel = relative18(
|
|
21908
|
+
let rel = relative18(dirname24(outputPath), targetPath).replace(/\\/g, "/");
|
|
21884
21909
|
if (!rel.startsWith("."))
|
|
21885
21910
|
rel = `./${rel}`;
|
|
21886
21911
|
result = result.replaceAll(bareImport, rel);
|
|
@@ -21915,6 +21940,7 @@ var init_compileVueSfc = __esm(() => {
|
|
|
21915
21940
|
init_isFile();
|
|
21916
21941
|
init_chainInlineSourcemaps();
|
|
21917
21942
|
init_stylePreprocessor();
|
|
21943
|
+
init_inlineCssImports();
|
|
21918
21944
|
init_vueCompileCache();
|
|
21919
21945
|
transpiler5 = new Transpiler4({ loader: "ts", target: "browser" });
|
|
21920
21946
|
});
|
|
@@ -21977,9 +22003,9 @@ var init_workerJobs = __esm(() => {
|
|
|
21977
22003
|
});
|
|
21978
22004
|
|
|
21979
22005
|
// src/build/workerPool.ts
|
|
21980
|
-
import { existsSync as
|
|
22006
|
+
import { existsSync as existsSync33, readFileSync as readFileSync32 } from "fs";
|
|
21981
22007
|
import { availableParallelism, freemem } from "os";
|
|
21982
|
-
import { dirname as
|
|
22008
|
+
import { dirname as dirname25, join as join44 } from "path";
|
|
21983
22009
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
21984
22010
|
var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_MEMORY_BUDGET_BYTES, DEFAULT_IDLE_TIMEOUT_MS = 2000, DEFAULT_MIN_BATCH = 4, PACKAGE_WALK_DEPTH = 6, PERCENT = 100, OWN_PACKAGE_NAME = "@absolutejs/absolute", parseWorkerOverride = (raw) => {
|
|
21985
22011
|
if (raw === undefined || raw.trim() === "")
|
|
@@ -21997,10 +22023,10 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
21997
22023
|
return Math.max(MIN_WORKERS, Math.min(byCpu, byMemory));
|
|
21998
22024
|
}, isOwnPackageRoot = (dir) => {
|
|
21999
22025
|
const packageFile = join44(dir, "package.json");
|
|
22000
|
-
if (!
|
|
22026
|
+
if (!existsSync33(packageFile))
|
|
22001
22027
|
return false;
|
|
22002
22028
|
try {
|
|
22003
|
-
const pkg = JSON.parse(
|
|
22029
|
+
const pkg = JSON.parse(readFileSync32(packageFile, "utf-8"));
|
|
22004
22030
|
return typeof pkg === "object" && pkg !== null && "name" in pkg && pkg.name === OWN_PACKAGE_NAME;
|
|
22005
22031
|
} catch {
|
|
22006
22032
|
return false;
|
|
@@ -22010,7 +22036,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
22010
22036
|
for (let depth = 0;depth < PACKAGE_WALK_DEPTH; depth++) {
|
|
22011
22037
|
if (isOwnPackageRoot(dir))
|
|
22012
22038
|
return dir;
|
|
22013
|
-
const parent =
|
|
22039
|
+
const parent = dirname25(dir);
|
|
22014
22040
|
if (parent === dir)
|
|
22015
22041
|
break;
|
|
22016
22042
|
dir = parent;
|
|
@@ -22024,7 +22050,7 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
22024
22050
|
const sourceEntry = join44(root, "src", "build", "buildWorker.ts");
|
|
22025
22051
|
const runningFromDist = fromDir.startsWith(join44(root, "dist"));
|
|
22026
22052
|
const ordered = runningFromDist ? [distEntry, sourceEntry] : [sourceEntry, distEntry];
|
|
22027
|
-
return ordered.find((candidate) =>
|
|
22053
|
+
return ordered.find((candidate) => existsSync33(candidate)) ?? null;
|
|
22028
22054
|
}, formatPercent = (ratio) => `${Math.round(ratio * PERCENT)}%`, createBuildWorkerPool = (options = {}) => {
|
|
22029
22055
|
const size = options.size ?? resolveBuildWorkerCount();
|
|
22030
22056
|
const entry = options.entry === undefined ? resolveBuildWorkerEntry() : options.entry;
|
|
@@ -22302,27 +22328,27 @@ var init_workerPool = __esm(() => {
|
|
|
22302
22328
|
});
|
|
22303
22329
|
|
|
22304
22330
|
// src/build/compileVue.ts
|
|
22305
|
-
import { existsSync as
|
|
22331
|
+
import { existsSync as existsSync34 } from "fs";
|
|
22306
22332
|
import { mkdir as mkdir11 } from "fs/promises";
|
|
22307
22333
|
import {
|
|
22308
22334
|
basename as basename14,
|
|
22309
|
-
dirname as
|
|
22335
|
+
dirname as dirname26,
|
|
22310
22336
|
isAbsolute as isAbsolute8,
|
|
22311
22337
|
join as join45,
|
|
22312
22338
|
relative as relative19,
|
|
22313
|
-
resolve as
|
|
22339
|
+
resolve as resolve37
|
|
22314
22340
|
} from "path";
|
|
22315
22341
|
var {file: file4, write: write4 } = globalThis.Bun;
|
|
22316
22342
|
var resolveDevClientDir3 = () => {
|
|
22317
22343
|
const projectRoot = process.cwd();
|
|
22318
|
-
const fromSource =
|
|
22319
|
-
if (
|
|
22344
|
+
const fromSource = resolve37(import.meta.dir, "../dev/client");
|
|
22345
|
+
if (existsSync34(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
22320
22346
|
return fromSource;
|
|
22321
22347
|
}
|
|
22322
|
-
const fromNodeModules =
|
|
22323
|
-
if (
|
|
22348
|
+
const fromNodeModules = resolve37(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
22349
|
+
if (existsSync34(fromNodeModules))
|
|
22324
22350
|
return fromNodeModules;
|
|
22325
|
-
return
|
|
22351
|
+
return resolve37(import.meta.dir, "./dev/client");
|
|
22326
22352
|
}, devClientDir3, hmrClientPath4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, detectVueChangeType = (filePath, descriptor) => {
|
|
22327
22353
|
const prevScript = scriptCache.get(filePath);
|
|
22328
22354
|
const prevScriptSetup = scriptSetupCache.get(filePath);
|
|
@@ -22363,12 +22389,12 @@ var resolveDevClientDir3 = () => {
|
|
|
22363
22389
|
return Array.from(new Set(found));
|
|
22364
22390
|
}, resolveHelperTsPath = (sourceDir, helper) => {
|
|
22365
22391
|
if (helper.endsWith(".ts"))
|
|
22366
|
-
return
|
|
22367
|
-
const direct =
|
|
22368
|
-
if (
|
|
22392
|
+
return resolve37(sourceDir, helper);
|
|
22393
|
+
const direct = resolve37(sourceDir, `${helper}.ts`);
|
|
22394
|
+
if (existsSync34(direct))
|
|
22369
22395
|
return direct;
|
|
22370
|
-
const indexed =
|
|
22371
|
-
if (
|
|
22396
|
+
const indexed = resolve37(sourceDir, helper, "index.ts");
|
|
22397
|
+
if (existsSync34(indexed))
|
|
22372
22398
|
return indexed;
|
|
22373
22399
|
return direct;
|
|
22374
22400
|
}, HELPER_JOB_MIN_BATCH = 24, runHelperEmit = async (files) => {
|
|
@@ -22394,7 +22420,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22394
22420
|
if (!inline)
|
|
22395
22421
|
pool.warm("vue-sfc");
|
|
22396
22422
|
const runSfc = (input) => pool.run("vue-sfc", input, {
|
|
22397
|
-
affinity:
|
|
22423
|
+
affinity: dirname26(input.sourceFilePath),
|
|
22398
22424
|
inline
|
|
22399
22425
|
});
|
|
22400
22426
|
return runSfc;
|
|
@@ -22456,9 +22482,9 @@ var resolveDevClientDir3 = () => {
|
|
|
22456
22482
|
serverPath
|
|
22457
22483
|
}) => {
|
|
22458
22484
|
await Promise.all([
|
|
22459
|
-
mkdir11(
|
|
22460
|
-
mkdir11(
|
|
22461
|
-
...css ? [mkdir11(
|
|
22485
|
+
mkdir11(dirname26(clientPath), { recursive: true }),
|
|
22486
|
+
mkdir11(dirname26(serverPath), { recursive: true }),
|
|
22487
|
+
...css ? [mkdir11(dirname26(css.path), { recursive: true })] : []
|
|
22462
22488
|
]);
|
|
22463
22489
|
await Promise.all([
|
|
22464
22490
|
write4(clientPath, clientCode),
|
|
@@ -22498,7 +22524,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22498
22524
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
22499
22525
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
22500
22526
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
22501
|
-
if (prevHash === contentHash && persistent &&
|
|
22527
|
+
if (prevHash === contentHash && persistent && existsSync34(persistent.clientPath) && existsSync34(persistent.serverPath)) {
|
|
22502
22528
|
cacheMap.set(sourceFilePath, persistent);
|
|
22503
22529
|
return persistent;
|
|
22504
22530
|
}
|
|
@@ -22527,12 +22553,12 @@ var resolveDevClientDir3 = () => {
|
|
|
22527
22553
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
22528
22554
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
22529
22555
|
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 :
|
|
22556
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute8(path)) && isStylePath(path)).map((path) => isAbsolute8(path) ? path : resolve37(dirname26(sourceFilePath), path));
|
|
22531
22557
|
for (const stylePath of stylePathsImported) {
|
|
22532
22558
|
addStyleImporter(sourceFilePath, stylePath);
|
|
22533
22559
|
}
|
|
22534
22560
|
const childBuildResults = await Promise.all([
|
|
22535
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
22561
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve37(dirname26(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors)),
|
|
22536
22562
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, runSfc, stylePreprocessors))
|
|
22537
22563
|
]);
|
|
22538
22564
|
const cacheKeyStartedAt = performance.now();
|
|
@@ -22601,7 +22627,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22601
22627
|
serverPath: serverOutputPath,
|
|
22602
22628
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
22603
22629
|
tsHelperPaths: [
|
|
22604
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
22630
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname26(sourceFilePath), helper)),
|
|
22605
22631
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
22606
22632
|
]
|
|
22607
22633
|
};
|
|
@@ -22640,7 +22666,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22640
22666
|
const buildCache = new Map;
|
|
22641
22667
|
const allTsHelperPaths = new Set;
|
|
22642
22668
|
const expandSpaRouteChildren = async (entries) => {
|
|
22643
|
-
const expanded = new Set(entries.map((entry) =>
|
|
22669
|
+
const expanded = new Set(entries.map((entry) => resolve37(entry)));
|
|
22644
22670
|
const queue = [...expanded];
|
|
22645
22671
|
while (queue.length > 0) {
|
|
22646
22672
|
const entryPath = queue.pop();
|
|
@@ -22657,8 +22683,8 @@ var resolveDevClientDir3 = () => {
|
|
|
22657
22683
|
});
|
|
22658
22684
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
22659
22685
|
for (const { importPath } of routes) {
|
|
22660
|
-
const childPath =
|
|
22661
|
-
if (expanded.has(childPath) || !
|
|
22686
|
+
const childPath = resolve37(dirname26(entryPath), importPath);
|
|
22687
|
+
if (expanded.has(childPath) || !existsSync34(childPath)) {
|
|
22662
22688
|
continue;
|
|
22663
22689
|
}
|
|
22664
22690
|
expanded.add(childPath);
|
|
@@ -22672,7 +22698,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22672
22698
|
vueCompileProfile.stageExpandMs = performance.now() - stageStartedAt;
|
|
22673
22699
|
stageStartedAt = performance.now();
|
|
22674
22700
|
const compiledPages = await Promise.all(expandedEntryPoints.map(async (entryPath) => {
|
|
22675
|
-
const resolvedEntryPath =
|
|
22701
|
+
const resolvedEntryPath = resolve37(entryPath);
|
|
22676
22702
|
const result = await compileVueFile(resolvedEntryPath, {
|
|
22677
22703
|
client: clientOutputDir,
|
|
22678
22704
|
css: cssOutputDir,
|
|
@@ -22692,14 +22718,14 @@ var resolveDevClientDir3 = () => {
|
|
|
22692
22718
|
const entryBaseName = basename14(entryPath, ".vue");
|
|
22693
22719
|
const indexOutputFile = join45(indexOutputDir, `${entryBaseName}.js`);
|
|
22694
22720
|
const clientOutputFile = result.clientPath;
|
|
22695
|
-
await mkdir11(
|
|
22721
|
+
await mkdir11(dirname26(indexOutputFile), { recursive: true });
|
|
22696
22722
|
const vueHmrImports = isDev ? [
|
|
22697
22723
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
22698
22724
|
`import "${hmrClientPath4}";`
|
|
22699
22725
|
] : [];
|
|
22700
22726
|
await write4(indexOutputFile, [
|
|
22701
22727
|
...vueHmrImports,
|
|
22702
|
-
`import Comp, * as PageModule from "${relative19(
|
|
22728
|
+
`import Comp, * as PageModule from "${relative19(dirname26(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
22703
22729
|
'import { createSSRApp, createApp } from "vue";',
|
|
22704
22730
|
'import { prepareBrowserTranslationHydration } from "@absolutejs/absolute/vue";',
|
|
22705
22731
|
"",
|
|
@@ -22865,7 +22891,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22865
22891
|
}));
|
|
22866
22892
|
vueCompileProfile.stagePagesMs = performance.now() - stageStartedAt;
|
|
22867
22893
|
stageStartedAt = performance.now();
|
|
22868
|
-
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(
|
|
22894
|
+
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname26(tsPath), dep)).filter((resolved) => existsSync34(resolved) && !allTsHelperPaths.has(resolved));
|
|
22869
22895
|
const readHelperWave = (paths) => Promise.all(paths.map((tsPath) => file4(tsPath).text().then((sourceCode) => helperDependencies(tsPath, sourceCode)).catch(() => [])));
|
|
22870
22896
|
const expandHelpers = async (frontier) => {
|
|
22871
22897
|
if (frontier.length === 0)
|
|
@@ -23435,8 +23461,8 @@ __export(exports_compileAngular, {
|
|
|
23435
23461
|
compileAngularFileJIT: () => compileAngularFileJIT,
|
|
23436
23462
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
23437
23463
|
});
|
|
23438
|
-
import { existsSync as
|
|
23439
|
-
import { join as join46, basename as basename15, sep as sep6, dirname as
|
|
23464
|
+
import { existsSync as existsSync35, readFileSync as readFileSync33, promises as fs5 } from "fs";
|
|
23465
|
+
import { join as join46, basename as basename15, sep as sep6, dirname as dirname27, resolve as resolve38, relative as relative20 } from "path";
|
|
23440
23466
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
23441
23467
|
import ts18 from "typescript";
|
|
23442
23468
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
@@ -23452,10 +23478,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23452
23478
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
|
|
23453
23479
|
}, readTsconfigPathAliases = () => {
|
|
23454
23480
|
try {
|
|
23455
|
-
const configPath =
|
|
23481
|
+
const configPath = resolve38(process.cwd(), "tsconfig.json");
|
|
23456
23482
|
const config = ts18.readConfigFile(configPath, ts18.sys.readFile).config;
|
|
23457
23483
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
23458
|
-
const baseUrl =
|
|
23484
|
+
const baseUrl = resolve38(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
23459
23485
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
23460
23486
|
return { aliases, baseUrl };
|
|
23461
23487
|
} catch {
|
|
@@ -23475,7 +23501,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23475
23501
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
23476
23502
|
for (const replacement of alias.replacements) {
|
|
23477
23503
|
const candidate = replacement.replace("*", wildcardValue);
|
|
23478
|
-
const resolved = resolveSourceFile(
|
|
23504
|
+
const resolved = resolveSourceFile(resolve38(baseUrl, candidate));
|
|
23479
23505
|
if (resolved)
|
|
23480
23506
|
return resolved;
|
|
23481
23507
|
}
|
|
@@ -23492,15 +23518,15 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23492
23518
|
join46(candidate, "index.js"),
|
|
23493
23519
|
join46(candidate, "index.jsx")
|
|
23494
23520
|
];
|
|
23495
|
-
return candidates.find((file) =>
|
|
23521
|
+
return candidates.find((file) => existsSync35(file));
|
|
23496
23522
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
23497
|
-
const baseDir =
|
|
23523
|
+
const baseDir = resolve38(rootDir);
|
|
23498
23524
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
23499
23525
|
const transpiler = new Bun.Transpiler({ loader: "tsx" });
|
|
23500
23526
|
const scanCache = new Map;
|
|
23501
23527
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
23502
23528
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
23503
|
-
return resolveSourceFile(
|
|
23529
|
+
return resolveSourceFile(resolve38(fromDir, specifier));
|
|
23504
23530
|
}
|
|
23505
23531
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
23506
23532
|
if (aliased)
|
|
@@ -23509,7 +23535,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23509
23535
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
23510
23536
|
if (resolved.includes("/node_modules/"))
|
|
23511
23537
|
return;
|
|
23512
|
-
const absolute =
|
|
23538
|
+
const absolute = resolve38(resolved);
|
|
23513
23539
|
if (!absolute.startsWith(baseDir))
|
|
23514
23540
|
return;
|
|
23515
23541
|
return resolveSourceFile(absolute);
|
|
@@ -23525,7 +23551,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23525
23551
|
usesLegacyAnimations: false
|
|
23526
23552
|
});
|
|
23527
23553
|
}
|
|
23528
|
-
const resolved =
|
|
23554
|
+
const resolved = resolve38(actualPath);
|
|
23529
23555
|
const cached = scanCache.get(resolved);
|
|
23530
23556
|
if (cached)
|
|
23531
23557
|
return cached;
|
|
@@ -23554,7 +23580,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23554
23580
|
const actualPath = resolveSourceFile(filePath);
|
|
23555
23581
|
if (!actualPath)
|
|
23556
23582
|
return false;
|
|
23557
|
-
const resolved =
|
|
23583
|
+
const resolved = resolve38(actualPath);
|
|
23558
23584
|
if (visited.has(resolved))
|
|
23559
23585
|
return false;
|
|
23560
23586
|
visited.add(resolved);
|
|
@@ -23562,7 +23588,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23562
23588
|
if (scan.usesLegacyAnimations)
|
|
23563
23589
|
return true;
|
|
23564
23590
|
for (const specifier of scan.imports) {
|
|
23565
|
-
const importedPath = resolveLocalImport(specifier,
|
|
23591
|
+
const importedPath = resolveLocalImport(specifier, dirname27(resolved));
|
|
23566
23592
|
if (importedPath && await visit(importedPath, visited)) {
|
|
23567
23593
|
return true;
|
|
23568
23594
|
}
|
|
@@ -23572,14 +23598,14 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23572
23598
|
return (entryPath) => visit(entryPath);
|
|
23573
23599
|
}, resolveDevClientDir4 = () => {
|
|
23574
23600
|
const projectRoot = process.cwd();
|
|
23575
|
-
const fromSource =
|
|
23576
|
-
if (
|
|
23601
|
+
const fromSource = resolve38(import.meta.dir, "../dev/client");
|
|
23602
|
+
if (existsSync35(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
23577
23603
|
return fromSource;
|
|
23578
23604
|
}
|
|
23579
|
-
const fromNodeModules =
|
|
23580
|
-
if (
|
|
23605
|
+
const fromNodeModules = resolve38(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
23606
|
+
if (existsSync35(fromNodeModules))
|
|
23581
23607
|
return fromNodeModules;
|
|
23582
|
-
return
|
|
23608
|
+
return resolve38(import.meta.dir, "./dev/client");
|
|
23583
23609
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
23584
23610
|
try {
|
|
23585
23611
|
return ts18.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
@@ -23621,13 +23647,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23621
23647
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
23622
23648
|
if (hasJsLikeExtension(path))
|
|
23623
23649
|
return `${path}${query}`;
|
|
23624
|
-
const importerDir =
|
|
23625
|
-
const fileCandidate =
|
|
23626
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
23650
|
+
const importerDir = dirname27(importerOutputPath);
|
|
23651
|
+
const fileCandidate = resolve38(importerDir, `${path}.js`);
|
|
23652
|
+
if (outputFiles?.has(fileCandidate) || existsSync35(fileCandidate)) {
|
|
23627
23653
|
return `${path}.js${query}`;
|
|
23628
23654
|
}
|
|
23629
|
-
const indexCandidate =
|
|
23630
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
23655
|
+
const indexCandidate = resolve38(importerDir, path, "index.js");
|
|
23656
|
+
if (outputFiles?.has(indexCandidate) || existsSync35(indexCandidate)) {
|
|
23631
23657
|
return `${path}/index.js${query}`;
|
|
23632
23658
|
}
|
|
23633
23659
|
return `${path}.js${query}`;
|
|
@@ -23654,7 +23680,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23654
23680
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
23655
23681
|
if (!isRelativeModuleSpecifier(specifier))
|
|
23656
23682
|
return null;
|
|
23657
|
-
const basePath =
|
|
23683
|
+
const basePath = resolve38(dirname27(fromFile), specifier);
|
|
23658
23684
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
23659
23685
|
`${basePath}.ts`,
|
|
23660
23686
|
`${basePath}.tsx`,
|
|
@@ -23665,7 +23691,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23665
23691
|
join46(basePath, "index.mts"),
|
|
23666
23692
|
join46(basePath, "index.cts")
|
|
23667
23693
|
];
|
|
23668
|
-
return candidates.map((candidate) =>
|
|
23694
|
+
return candidates.map((candidate) => resolve38(candidate)).find((candidate) => existsSync35(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
23669
23695
|
}, readFileForAotTransform = async (fileName, readFile) => {
|
|
23670
23696
|
const hostSource = readFile?.(fileName);
|
|
23671
23697
|
if (typeof hostSource === "string")
|
|
@@ -23700,7 +23726,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23700
23726
|
paths.push(join46(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
23701
23727
|
}
|
|
23702
23728
|
}
|
|
23703
|
-
return paths.map((path) =>
|
|
23729
|
+
return paths.map((path) => resolve38(path));
|
|
23704
23730
|
}, readResourceCacheFile = async (cachePath) => {
|
|
23705
23731
|
try {
|
|
23706
23732
|
const entry = JSON.parse(await fs5.readFile(cachePath, "utf-8"));
|
|
@@ -23712,13 +23738,13 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23712
23738
|
return null;
|
|
23713
23739
|
}
|
|
23714
23740
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
23715
|
-
await fs5.mkdir(
|
|
23741
|
+
await fs5.mkdir(dirname27(cachePath), { recursive: true });
|
|
23716
23742
|
await writeTextFileAtomically(cachePath, JSON.stringify({
|
|
23717
23743
|
source,
|
|
23718
23744
|
version: 1
|
|
23719
23745
|
}));
|
|
23720
23746
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
23721
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
23747
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname27(filePath));
|
|
23722
23748
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
23723
23749
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
23724
23750
|
return `${resourcePath}\x00${content}`;
|
|
@@ -23742,11 +23768,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23742
23768
|
transformedFiles: 0
|
|
23743
23769
|
};
|
|
23744
23770
|
const transformFile = async (filePath) => {
|
|
23745
|
-
const resolvedPath =
|
|
23771
|
+
const resolvedPath = resolve38(filePath);
|
|
23746
23772
|
if (visited.has(resolvedPath))
|
|
23747
23773
|
return;
|
|
23748
23774
|
visited.add(resolvedPath);
|
|
23749
|
-
if (!
|
|
23775
|
+
if (!existsSync35(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
23750
23776
|
return;
|
|
23751
23777
|
stats.filesVisited += 1;
|
|
23752
23778
|
const source = await readFileForAotTransform(resolvedPath, readFile);
|
|
@@ -23758,7 +23784,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23758
23784
|
transformedSource = cached.source;
|
|
23759
23785
|
} else {
|
|
23760
23786
|
stats.cacheMisses += 1;
|
|
23761
|
-
const transformed = await inlineResources(source,
|
|
23787
|
+
const transformed = await inlineResources(source, dirname27(resolvedPath), stylePreprocessors);
|
|
23762
23788
|
transformedSource = transformed.source;
|
|
23763
23789
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
23764
23790
|
}
|
|
@@ -23777,18 +23803,18 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23777
23803
|
return { stats, transformedSources };
|
|
23778
23804
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
23779
23805
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
23780
|
-
const outputPath =
|
|
23806
|
+
const outputPath = resolve38(join46(outDir, relative20(process.cwd(), resolve38(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
23781
23807
|
return [
|
|
23782
23808
|
outputPath,
|
|
23783
|
-
buildIslandMetadataExports(
|
|
23809
|
+
buildIslandMetadataExports(readFileSync33(inputPath, "utf-8"))
|
|
23784
23810
|
];
|
|
23785
23811
|
})), { entries: inputPaths.length });
|
|
23786
23812
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
23787
23813
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
23788
23814
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
23789
23815
|
const tsPath = __require.resolve("typescript");
|
|
23790
|
-
const tsRootDir =
|
|
23791
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
23816
|
+
const tsRootDir = dirname27(tsPath);
|
|
23817
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve38(tsRootDir, "lib");
|
|
23792
23818
|
});
|
|
23793
23819
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
23794
23820
|
const options = {
|
|
@@ -23830,7 +23856,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23830
23856
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
23831
23857
|
};
|
|
23832
23858
|
const emitted = {};
|
|
23833
|
-
const resolvedOutDir =
|
|
23859
|
+
const resolvedOutDir = resolve38(outDir);
|
|
23834
23860
|
host.writeFile = (fileName, text) => {
|
|
23835
23861
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
23836
23862
|
emitted[relativePath] = text;
|
|
@@ -23852,12 +23878,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23852
23878
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
23853
23879
|
return source;
|
|
23854
23880
|
}
|
|
23855
|
-
const resolvedPath =
|
|
23881
|
+
const resolvedPath = resolve38(fileName);
|
|
23856
23882
|
return transformedSources.get(resolvedPath) ?? source;
|
|
23857
23883
|
};
|
|
23858
23884
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
23859
23885
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
23860
|
-
const source = transformedSources.get(
|
|
23886
|
+
const source = transformedSources.get(resolve38(fileName));
|
|
23861
23887
|
if (source) {
|
|
23862
23888
|
return ts18.createSourceFile(fileName, source, languageVersion, true);
|
|
23863
23889
|
}
|
|
@@ -23881,7 +23907,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23881
23907
|
content,
|
|
23882
23908
|
target: join46(outDir, fileName)
|
|
23883
23909
|
}));
|
|
23884
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
23910
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve38(target)));
|
|
23885
23911
|
return rawEntries.map(({ content, target }) => {
|
|
23886
23912
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
23887
23913
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -23896,17 +23922,17 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23896
23922
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
23897
23923
|
});
|
|
23898
23924
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
23899
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
23925
|
+
processedContent += islandMetadataByOutputPath.get(resolve38(target)) ?? "";
|
|
23900
23926
|
return { content: processedContent, target };
|
|
23901
23927
|
});
|
|
23902
23928
|
});
|
|
23903
23929
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
23904
|
-
await fs5.mkdir(
|
|
23930
|
+
await fs5.mkdir(dirname27(target), { recursive: true });
|
|
23905
23931
|
await writeTextFileAtomically(target, content);
|
|
23906
23932
|
})), { outputs: entries.length });
|
|
23907
23933
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
23908
23934
|
}, jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
23909
|
-
jitContentCache.delete(
|
|
23935
|
+
jitContentCache.delete(resolve38(filePath));
|
|
23910
23936
|
}, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
23911
23937
|
const re = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
23912
23938
|
let match;
|
|
@@ -23919,8 +23945,8 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23919
23945
|
}
|
|
23920
23946
|
return null;
|
|
23921
23947
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
23922
|
-
const sourceEntry =
|
|
23923
|
-
if (
|
|
23948
|
+
const sourceEntry = resolve38(import.meta.dir, "../angular/components/index.ts");
|
|
23949
|
+
if (existsSync35(sourceEntry)) {
|
|
23924
23950
|
return sourceEntry.replace(/\\/g, "/");
|
|
23925
23951
|
}
|
|
23926
23952
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -24048,7 +24074,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
24048
24074
|
${fields}
|
|
24049
24075
|
`);
|
|
24050
24076
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
24051
|
-
if (!
|
|
24077
|
+
if (!existsSync35(filePath)) {
|
|
24052
24078
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
24053
24079
|
}
|
|
24054
24080
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -24057,7 +24083,7 @@ ${fields}
|
|
|
24057
24083
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24058
24084
|
if (templateUrlMatch?.[1]) {
|
|
24059
24085
|
const templatePath = join46(fileDir, templateUrlMatch[1]);
|
|
24060
|
-
if (!
|
|
24086
|
+
if (!existsSync35(templatePath)) {
|
|
24061
24087
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
24062
24088
|
}
|
|
24063
24089
|
const templateRaw = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -24088,10 +24114,10 @@ ${fields}
|
|
|
24088
24114
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24089
24115
|
if (templateUrlMatch?.[1]) {
|
|
24090
24116
|
const templatePath = join46(fileDir, templateUrlMatch[1]);
|
|
24091
|
-
if (!
|
|
24117
|
+
if (!existsSync35(templatePath)) {
|
|
24092
24118
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
24093
24119
|
}
|
|
24094
|
-
const templateRaw =
|
|
24120
|
+
const templateRaw = readFileSync33(templatePath, "utf-8");
|
|
24095
24121
|
const lowered = lowerAngularDeferSyntax(templateRaw);
|
|
24096
24122
|
const escaped = escapeTemplateContent(lowered.template);
|
|
24097
24123
|
const replacedSource = source.slice(0, templateUrlMatch.index) + `template: \`${escaped}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -24209,10 +24235,10 @@ ${fields}
|
|
|
24209
24235
|
return "";
|
|
24210
24236
|
}
|
|
24211
24237
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
24212
|
-
const entryPath =
|
|
24238
|
+
const entryPath = resolve38(inputPath);
|
|
24213
24239
|
const allOutputs = [];
|
|
24214
24240
|
const visited = new Set;
|
|
24215
|
-
const baseDir =
|
|
24241
|
+
const baseDir = resolve38(rootDir ?? process.cwd());
|
|
24216
24242
|
let usesLegacyAnimations = false;
|
|
24217
24243
|
const angularTranspiler = new Bun.Transpiler({
|
|
24218
24244
|
loader: "ts",
|
|
@@ -24236,11 +24262,11 @@ ${fields}
|
|
|
24236
24262
|
join46(candidate, "index.js"),
|
|
24237
24263
|
join46(candidate, "index.jsx")
|
|
24238
24264
|
];
|
|
24239
|
-
return candidates.find((file) =>
|
|
24265
|
+
return candidates.find((file) => existsSync35(file));
|
|
24240
24266
|
};
|
|
24241
24267
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
24242
24268
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
24243
|
-
return resolveSourceFile(
|
|
24269
|
+
return resolveSourceFile(resolve38(fromDir, specifier));
|
|
24244
24270
|
}
|
|
24245
24271
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
24246
24272
|
if (aliased)
|
|
@@ -24249,7 +24275,7 @@ ${fields}
|
|
|
24249
24275
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
24250
24276
|
if (resolved.includes("/node_modules/"))
|
|
24251
24277
|
return;
|
|
24252
|
-
const absolute =
|
|
24278
|
+
const absolute = resolve38(resolved);
|
|
24253
24279
|
if (!absolute.startsWith(baseDir))
|
|
24254
24280
|
return;
|
|
24255
24281
|
return resolveSourceFile(absolute);
|
|
@@ -24258,7 +24284,7 @@ ${fields}
|
|
|
24258
24284
|
}
|
|
24259
24285
|
};
|
|
24260
24286
|
const toOutputPath = (sourcePath) => {
|
|
24261
|
-
const inputDir =
|
|
24287
|
+
const inputDir = dirname27(sourcePath);
|
|
24262
24288
|
const fileBase = basename15(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
24263
24289
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep6}`)) {
|
|
24264
24290
|
return join46(inputDir, fileBase);
|
|
@@ -24301,18 +24327,18 @@ ${fields}
|
|
|
24301
24327
|
return `${prefix}${dots}`;
|
|
24302
24328
|
return `${prefix}../${dots}`;
|
|
24303
24329
|
});
|
|
24304
|
-
if (
|
|
24330
|
+
if (resolve38(actualPath) === entryPath) {
|
|
24305
24331
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
24306
24332
|
}
|
|
24307
24333
|
return processedContent;
|
|
24308
24334
|
};
|
|
24309
24335
|
const transpileFile = async (filePath) => {
|
|
24310
|
-
const resolved =
|
|
24336
|
+
const resolved = resolve38(filePath);
|
|
24311
24337
|
if (visited.has(resolved))
|
|
24312
24338
|
return;
|
|
24313
24339
|
visited.add(resolved);
|
|
24314
|
-
if (resolved.endsWith(".json") &&
|
|
24315
|
-
const inputDir =
|
|
24340
|
+
if (resolved.endsWith(".json") && existsSync35(resolved)) {
|
|
24341
|
+
const inputDir = dirname27(resolved);
|
|
24316
24342
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
24317
24343
|
const targetDir = join46(outDir, relativeDir);
|
|
24318
24344
|
const targetPath = join46(targetDir, basename15(resolved));
|
|
@@ -24324,15 +24350,15 @@ ${fields}
|
|
|
24324
24350
|
let actualPath = resolved;
|
|
24325
24351
|
if (!actualPath.endsWith(".ts"))
|
|
24326
24352
|
actualPath += ".ts";
|
|
24327
|
-
if (!
|
|
24353
|
+
if (!existsSync35(actualPath))
|
|
24328
24354
|
return;
|
|
24329
24355
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
24330
|
-
const inlined = await inlineResources(sourceCode,
|
|
24331
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
24332
|
-
const inputDir =
|
|
24356
|
+
const inlined = await inlineResources(sourceCode, dirname27(actualPath), stylePreprocessors);
|
|
24357
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname27(actualPath)).source;
|
|
24358
|
+
const inputDir = dirname27(actualPath);
|
|
24333
24359
|
const fileBase = basename15(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
24334
24360
|
const targetPath = toOutputPath(actualPath);
|
|
24335
|
-
const targetDir =
|
|
24361
|
+
const targetDir = dirname27(targetPath);
|
|
24336
24362
|
const relativeDir = relative20(outDir, targetDir).replace(/\\/g, "/");
|
|
24337
24363
|
const localImports = [];
|
|
24338
24364
|
const importRewrites = new Map;
|
|
@@ -24359,10 +24385,10 @@ ${fields}
|
|
|
24359
24385
|
importRewrites.set(specifier, relativeRewrite);
|
|
24360
24386
|
return resolved;
|
|
24361
24387
|
}).filter((path) => Boolean(path));
|
|
24362
|
-
const isEntry =
|
|
24388
|
+
const isEntry = resolve38(actualPath) === resolve38(entryPath);
|
|
24363
24389
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
24364
24390
|
const cacheKey = actualPath;
|
|
24365
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !
|
|
24391
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync35(targetPath);
|
|
24366
24392
|
if (shouldWriteFile) {
|
|
24367
24393
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
24368
24394
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
@@ -24375,7 +24401,7 @@ ${fields}
|
|
|
24375
24401
|
};
|
|
24376
24402
|
await transpileFile(inputPath);
|
|
24377
24403
|
const entryOutputPath = toOutputPath(entryPath);
|
|
24378
|
-
if (
|
|
24404
|
+
if (existsSync35(entryOutputPath)) {
|
|
24379
24405
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
24380
24406
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
24381
24407
|
`);
|
|
@@ -24396,12 +24422,12 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24396
24422
|
const compiledRoot = compiledParent;
|
|
24397
24423
|
const indexesDir = join46(compiledParent, "indexes");
|
|
24398
24424
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
24399
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
24425
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve38(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
24400
24426
|
if (!hmr) {
|
|
24401
24427
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
24402
24428
|
const cwd = process.cwd();
|
|
24403
|
-
const angularSrcDir =
|
|
24404
|
-
if (!
|
|
24429
|
+
const angularSrcDir = resolve38(outRoot);
|
|
24430
|
+
if (!existsSync35(angularSrcDir))
|
|
24405
24431
|
return;
|
|
24406
24432
|
const jsonGlob = new Glob6("**/*.json");
|
|
24407
24433
|
for (const rel of jsonGlob.scanSync({
|
|
@@ -24411,14 +24437,14 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24411
24437
|
const sourcePath = join46(angularSrcDir, rel);
|
|
24412
24438
|
const cwdRel = relative20(cwd, sourcePath);
|
|
24413
24439
|
const targetPath = join46(compiledRoot, cwdRel);
|
|
24414
|
-
await fs5.mkdir(
|
|
24440
|
+
await fs5.mkdir(dirname27(targetPath), { recursive: true });
|
|
24415
24441
|
await fs5.copyFile(sourcePath, targetPath);
|
|
24416
24442
|
}
|
|
24417
24443
|
});
|
|
24418
24444
|
}
|
|
24419
24445
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
24420
24446
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
24421
|
-
const resolvedEntry =
|
|
24447
|
+
const resolvedEntry = resolve38(entry);
|
|
24422
24448
|
const relativeEntry = relative20(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
24423
24449
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
24424
24450
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
@@ -24430,21 +24456,21 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24430
24456
|
join46(compiledRoot, relativeEntry),
|
|
24431
24457
|
join46(compiledRoot, "pages", jsName),
|
|
24432
24458
|
join46(compiledRoot, jsName)
|
|
24433
|
-
].map((file) =>
|
|
24459
|
+
].map((file) => resolve38(file));
|
|
24434
24460
|
const resolveRawServerFile = (candidatePaths) => {
|
|
24435
24461
|
const normalizedCandidates = [
|
|
24436
|
-
...candidatePaths.map((file) =>
|
|
24462
|
+
...candidatePaths.map((file) => resolve38(file)),
|
|
24437
24463
|
...compiledFallbackPaths
|
|
24438
24464
|
];
|
|
24439
|
-
let candidate = normalizedCandidates.find((file) =>
|
|
24465
|
+
let candidate = normalizedCandidates.find((file) => existsSync35(file) && file.endsWith(`${sep6}${relativeEntry}`));
|
|
24440
24466
|
if (!candidate) {
|
|
24441
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24467
|
+
candidate = normalizedCandidates.find((file) => existsSync35(file) && file.endsWith(`${sep6}pages${sep6}${jsName}`));
|
|
24442
24468
|
}
|
|
24443
24469
|
if (!candidate) {
|
|
24444
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24470
|
+
candidate = normalizedCandidates.find((file) => existsSync35(file) && file.endsWith(`${sep6}${jsName}`));
|
|
24445
24471
|
}
|
|
24446
24472
|
if (!candidate) {
|
|
24447
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24473
|
+
candidate = normalizedCandidates.find((file) => existsSync35(file));
|
|
24448
24474
|
}
|
|
24449
24475
|
return candidate;
|
|
24450
24476
|
};
|
|
@@ -24452,11 +24478,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24452
24478
|
if (!rawServerFile) {
|
|
24453
24479
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
24454
24480
|
}
|
|
24455
|
-
if (rawServerFile && !
|
|
24481
|
+
if (rawServerFile && !existsSync35(rawServerFile)) {
|
|
24456
24482
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
24457
24483
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
24458
24484
|
}
|
|
24459
|
-
if (!rawServerFile || !
|
|
24485
|
+
if (!rawServerFile || !existsSync35(rawServerFile)) {
|
|
24460
24486
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
24461
24487
|
...outputs,
|
|
24462
24488
|
...compiledFallbackPaths
|
|
@@ -24480,7 +24506,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24480
24506
|
let providersSourceContent = "";
|
|
24481
24507
|
if (providersInjection.appProvidersSource) {
|
|
24482
24508
|
try {
|
|
24483
|
-
providersSourceContent =
|
|
24509
|
+
providersSourceContent = readFileSync33(providersInjection.appProvidersSource, "utf-8");
|
|
24484
24510
|
} catch {}
|
|
24485
24511
|
}
|
|
24486
24512
|
return JSON.stringify({
|
|
@@ -24492,7 +24518,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24492
24518
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
24493
24519
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
24494
24520
|
const clientFile = join46(indexesDir, jsName);
|
|
24495
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
24521
|
+
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
24522
|
return {
|
|
24497
24523
|
clientPath: clientFile,
|
|
24498
24524
|
indexUnchanged: true,
|
|
@@ -24523,13 +24549,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24523
24549
|
const fragments = [];
|
|
24524
24550
|
if (providersInjection.appProvidersSource) {
|
|
24525
24551
|
const compiledAppProvidersPath = (() => {
|
|
24526
|
-
const angularDirAbs =
|
|
24527
|
-
const appSourceAbs =
|
|
24552
|
+
const angularDirAbs = resolve38(outRoot);
|
|
24553
|
+
const appSourceAbs = resolve38(providersInjection.appProvidersSource);
|
|
24528
24554
|
const rel = relative20(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
24529
24555
|
return join46(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
24530
24556
|
})();
|
|
24531
24557
|
const appProvidersSpec = (() => {
|
|
24532
|
-
const rel = relative20(
|
|
24558
|
+
const rel = relative20(dirname27(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
24533
24559
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
24534
24560
|
})();
|
|
24535
24561
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -25228,9 +25254,9 @@ var require_node = __commonJS(function(exports, module) {
|
|
|
25228
25254
|
});
|
|
25229
25255
|
|
|
25230
25256
|
// src/build/compileEmber.ts
|
|
25231
|
-
import { existsSync as
|
|
25257
|
+
import { existsSync as existsSync36 } from "fs";
|
|
25232
25258
|
import { mkdir as mkdir12, rm as rm7 } from "fs/promises";
|
|
25233
|
-
import { basename as basename16, dirname as
|
|
25259
|
+
import { basename as basename16, dirname as dirname28, extname as extname13, join as join47, resolve as resolve39 } from "path";
|
|
25234
25260
|
var {build: bunBuild2, Transpiler: Transpiler5, write: write5, file: file5 } = globalThis.Bun;
|
|
25235
25261
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
25236
25262
|
if (cachedPreprocessor)
|
|
@@ -25326,11 +25352,11 @@ export const importSync = (specifier) => {
|
|
|
25326
25352
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
25327
25353
|
if (!originalImporter)
|
|
25328
25354
|
return;
|
|
25329
|
-
const candidateBase =
|
|
25355
|
+
const candidateBase = resolve39(dirname28(originalImporter), args.path);
|
|
25330
25356
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
25331
25357
|
for (const ext of extensionsToTry) {
|
|
25332
25358
|
const candidate = candidateBase + ext;
|
|
25333
|
-
if (
|
|
25359
|
+
if (existsSync36(candidate))
|
|
25334
25360
|
return { path: candidate };
|
|
25335
25361
|
}
|
|
25336
25362
|
return;
|
|
@@ -25350,7 +25376,7 @@ export const importSync = (specifier) => {
|
|
|
25350
25376
|
if (standalonePackages.has(args.path))
|
|
25351
25377
|
return;
|
|
25352
25378
|
const internal = join47(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
25353
|
-
if (
|
|
25379
|
+
if (existsSync36(internal))
|
|
25354
25380
|
return { path: internal };
|
|
25355
25381
|
return;
|
|
25356
25382
|
});
|
|
@@ -25385,7 +25411,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
25385
25411
|
export { PageComponent };
|
|
25386
25412
|
export default PageComponent;
|
|
25387
25413
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
25388
|
-
const resolvedEntry =
|
|
25414
|
+
const resolvedEntry = resolve39(entry);
|
|
25389
25415
|
const source = await file5(resolvedEntry).text();
|
|
25390
25416
|
let preprocessed = source;
|
|
25391
25417
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -25405,8 +25431,8 @@ export default PageComponent;
|
|
|
25405
25431
|
mkdir12(serverDir, { recursive: true }),
|
|
25406
25432
|
mkdir12(clientDir, { recursive: true })
|
|
25407
25433
|
]);
|
|
25408
|
-
const tmpPagePath =
|
|
25409
|
-
const tmpHarnessPath =
|
|
25434
|
+
const tmpPagePath = resolve39(join47(tmpDir, `${baseName}.module.js`));
|
|
25435
|
+
const tmpHarnessPath = resolve39(join47(tmpDir, `${baseName}.harness.js`));
|
|
25410
25436
|
await Promise.all([
|
|
25411
25437
|
write5(tmpPagePath, transpiled),
|
|
25412
25438
|
write5(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -25470,25 +25496,25 @@ var importFromProject = (specifier, projectRoot = process.cwd()) => {
|
|
|
25470
25496
|
};
|
|
25471
25497
|
|
|
25472
25498
|
// src/build/buildReactVendor.ts
|
|
25473
|
-
import { existsSync as
|
|
25474
|
-
import { join as join48, resolve as
|
|
25499
|
+
import { existsSync as existsSync37, mkdirSync as mkdirSync8 } from "fs";
|
|
25500
|
+
import { join as join48, resolve as resolve40 } from "path";
|
|
25475
25501
|
import { rm as rm8 } from "fs/promises";
|
|
25476
25502
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
25477
25503
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
25478
25504
|
const candidates = [
|
|
25479
|
-
|
|
25480
|
-
|
|
25481
|
-
|
|
25482
|
-
|
|
25483
|
-
|
|
25484
|
-
|
|
25505
|
+
resolve40(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
25506
|
+
resolve40(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
25507
|
+
resolve40(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
25508
|
+
resolve40(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
25509
|
+
resolve40(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
25510
|
+
resolve40(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
25485
25511
|
];
|
|
25486
25512
|
for (const candidate of candidates) {
|
|
25487
|
-
if (
|
|
25513
|
+
if (existsSync37(candidate)) {
|
|
25488
25514
|
return candidate.replace(/\\/g, "/");
|
|
25489
25515
|
}
|
|
25490
25516
|
}
|
|
25491
|
-
return (candidates[0] ??
|
|
25517
|
+
return (candidates[0] ?? resolve40(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
25492
25518
|
}, jsxDevRuntimeCompatPath, jsxRuntimeCompatPath, reactSpecifiers, toSafeFileName = (specifier) => specifier.replace(/\//g, "_"), computeVendorPaths = () => {
|
|
25493
25519
|
const paths = {};
|
|
25494
25520
|
for (const specifier of reactSpecifiers) {
|
|
@@ -25933,16 +25959,16 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
25933
25959
|
import {
|
|
25934
25960
|
copyFileSync as copyFileSync3,
|
|
25935
25961
|
cpSync,
|
|
25936
|
-
existsSync as
|
|
25962
|
+
existsSync as existsSync38,
|
|
25937
25963
|
mkdirSync as mkdirSync12,
|
|
25938
25964
|
readdirSync as readdirSync7,
|
|
25939
|
-
readFileSync as
|
|
25965
|
+
readFileSync as readFileSync34,
|
|
25940
25966
|
renameSync,
|
|
25941
25967
|
rmSync as rmSync2,
|
|
25942
25968
|
statSync as statSync5,
|
|
25943
25969
|
writeFileSync as writeFileSync10
|
|
25944
25970
|
} from "fs";
|
|
25945
|
-
import { basename as basename17, dirname as
|
|
25971
|
+
import { basename as basename17, dirname as dirname29, extname as extname14, join as join52, relative as relative21, resolve as resolve41 } from "path";
|
|
25946
25972
|
import { cwd, env as env3, exit } from "process";
|
|
25947
25973
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
25948
25974
|
var isBuildTraceEnabled = () => {
|
|
@@ -26025,7 +26051,7 @@ var isBuildTraceEnabled = () => {
|
|
|
26025
26051
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
26026
26052
|
let content;
|
|
26027
26053
|
try {
|
|
26028
|
-
content =
|
|
26054
|
+
content = readFileSync34(path, "utf-8");
|
|
26029
26055
|
} catch {
|
|
26030
26056
|
return [];
|
|
26031
26057
|
}
|
|
@@ -26091,8 +26117,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26091
26117
|
if (globalThis.__absoluteVersion)
|
|
26092
26118
|
return;
|
|
26093
26119
|
const candidates = [
|
|
26094
|
-
|
|
26095
|
-
|
|
26120
|
+
resolve41(import.meta.dir, "..", "..", "package.json"),
|
|
26121
|
+
resolve41(import.meta.dir, "..", "package.json")
|
|
26096
26122
|
];
|
|
26097
26123
|
const resolveCandidate = async (remaining) => {
|
|
26098
26124
|
const [candidate, ...rest] = remaining;
|
|
@@ -26108,13 +26134,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26108
26134
|
};
|
|
26109
26135
|
await resolveCandidate(candidates);
|
|
26110
26136
|
}, SKIP_DIRS5, addWorkerPathIfExists = (file, relPath, workerPaths) => {
|
|
26111
|
-
const absPath =
|
|
26137
|
+
const absPath = resolve41(file, "..", relPath);
|
|
26112
26138
|
try {
|
|
26113
26139
|
statSync5(absPath);
|
|
26114
26140
|
workerPaths.add(absPath);
|
|
26115
26141
|
} catch {}
|
|
26116
26142
|
}, extractWorkerSpecifiers = (file, patterns) => {
|
|
26117
|
-
const content =
|
|
26143
|
+
const content = readFileSync34(file, "utf-8");
|
|
26118
26144
|
const specifiers = [];
|
|
26119
26145
|
for (const pattern of patterns) {
|
|
26120
26146
|
pattern.lastIndex = 0;
|
|
@@ -26199,39 +26225,39 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26199
26225
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
26200
26226
|
}
|
|
26201
26227
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
26202
|
-
if (!
|
|
26228
|
+
if (!existsSync38(reactIndexesPath)) {
|
|
26203
26229
|
return;
|
|
26204
26230
|
}
|
|
26205
26231
|
const indexFiles = readDir(reactIndexesPath).filter((file) => file.endsWith(".tsx"));
|
|
26206
|
-
const pagesRel = relative21(process.cwd(),
|
|
26232
|
+
const pagesRel = relative21(process.cwd(), resolve41(reactPagesPath)).replace(/\\/g, "/");
|
|
26207
26233
|
for (const file of indexFiles) {
|
|
26208
|
-
let content =
|
|
26234
|
+
let content = readFileSync34(join52(reactIndexesPath, file), "utf-8");
|
|
26209
26235
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
26210
26236
|
writeFileSync10(join52(devIndexDir, file), content);
|
|
26211
26237
|
}
|
|
26212
26238
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
26213
26239
|
const svelteIndexDir = join52(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
26214
|
-
const sveltePageEntries = svelteEntries.filter((file) =>
|
|
26240
|
+
const sveltePageEntries = svelteEntries.filter((file) => resolve41(file).startsWith(resolve41(sveltePagesPath)));
|
|
26215
26241
|
for (const entry of sveltePageEntries) {
|
|
26216
26242
|
const name = basename17(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
26217
26243
|
const indexFile = join52(svelteIndexDir, "pages", `${name}.js`);
|
|
26218
|
-
if (!
|
|
26244
|
+
if (!existsSync38(indexFile))
|
|
26219
26245
|
continue;
|
|
26220
|
-
let content =
|
|
26221
|
-
const srcRel = relative21(process.cwd(),
|
|
26246
|
+
let content = readFileSync34(indexFile, "utf-8");
|
|
26247
|
+
const srcRel = relative21(process.cwd(), resolve41(entry)).replace(/\\/g, "/");
|
|
26222
26248
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
26223
26249
|
writeFileSync10(join52(devIndexDir, `${name}.svelte.js`), content);
|
|
26224
26250
|
}
|
|
26225
26251
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
26226
26252
|
const vueIndexDir = join52(getFrameworkGeneratedDir("vue"), "indexes");
|
|
26227
|
-
const vuePageEntries = vueEntries.filter((file) =>
|
|
26253
|
+
const vuePageEntries = vueEntries.filter((file) => resolve41(file).startsWith(resolve41(vuePagesPath)));
|
|
26228
26254
|
for (const entry of vuePageEntries) {
|
|
26229
26255
|
const name = basename17(entry, ".vue");
|
|
26230
26256
|
const indexFile = join52(vueIndexDir, `${name}.js`);
|
|
26231
|
-
if (!
|
|
26257
|
+
if (!existsSync38(indexFile))
|
|
26232
26258
|
continue;
|
|
26233
|
-
let content =
|
|
26234
|
-
const srcRel = relative21(process.cwd(),
|
|
26259
|
+
let content = readFileSync34(indexFile, "utf-8");
|
|
26260
|
+
const srcRel = relative21(process.cwd(), resolve41(entry)).replace(/\\/g, "/");
|
|
26235
26261
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
26236
26262
|
writeFileSync10(join52(devIndexDir, `${name}.vue.js`), content);
|
|
26237
26263
|
}
|
|
@@ -26470,7 +26496,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26470
26496
|
const sourceClientRoots = [
|
|
26471
26497
|
htmlDir,
|
|
26472
26498
|
htmxDir,
|
|
26473
|
-
islandBootstrapPath &&
|
|
26499
|
+
islandBootstrapPath && dirname29(islandBootstrapPath)
|
|
26474
26500
|
].filter((dir) => Boolean(dir));
|
|
26475
26501
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
26476
26502
|
if (usesGenerated)
|
|
@@ -26518,13 +26544,13 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26518
26544
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
26519
26545
|
if (!isIncremental || !incrementalFiles)
|
|
26520
26546
|
return entryPoints;
|
|
26521
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f) =>
|
|
26547
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve41(f)));
|
|
26522
26548
|
const matchingEntries = [];
|
|
26523
26549
|
for (const entry of entryPoints) {
|
|
26524
26550
|
const sourceFile = mapToSource(entry);
|
|
26525
26551
|
if (!sourceFile)
|
|
26526
26552
|
continue;
|
|
26527
|
-
if (!normalizedIncremental.has(
|
|
26553
|
+
if (!normalizedIncremental.has(resolve41(sourceFile)))
|
|
26528
26554
|
continue;
|
|
26529
26555
|
matchingEntries.push(entry);
|
|
26530
26556
|
}
|
|
@@ -26700,11 +26726,11 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26700
26726
|
return scoped;
|
|
26701
26727
|
return scoped.filter((entry) => {
|
|
26702
26728
|
const source = mapToSource(entry);
|
|
26703
|
-
return source !== null && deferPageEntries.except.has(
|
|
26729
|
+
return source !== null && deferPageEntries.except.has(resolve41(source));
|
|
26704
26730
|
});
|
|
26705
26731
|
};
|
|
26706
26732
|
const mapReactIndexToPage = (entry) => {
|
|
26707
|
-
if (reactIndexesPath && reactPagesPath && entry.startsWith(
|
|
26733
|
+
if (reactIndexesPath && reactPagesPath && entry.startsWith(resolve41(reactIndexesPath))) {
|
|
26708
26734
|
const pageName = basename17(entry, ".tsx");
|
|
26709
26735
|
return join52(reactPagesPath, `${pageName}.tsx`);
|
|
26710
26736
|
}
|
|
@@ -26746,7 +26772,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26746
26772
|
for (const entry of vueEntries) {
|
|
26747
26773
|
const name = basename17(entry, ".vue");
|
|
26748
26774
|
if (ssrOnlyPageNames.has(name)) {
|
|
26749
|
-
resolved.add(
|
|
26775
|
+
resolved.add(resolve41(entry));
|
|
26750
26776
|
}
|
|
26751
26777
|
}
|
|
26752
26778
|
return resolved;
|
|
@@ -26859,7 +26885,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26859
26885
|
const clientPath = islandSvelteClientPaths[idx];
|
|
26860
26886
|
if (!sourcePath || !clientPath)
|
|
26861
26887
|
continue;
|
|
26862
|
-
islandSvelteClientPathMap.set(
|
|
26888
|
+
islandSvelteClientPathMap.set(resolve41(sourcePath), clientPath);
|
|
26863
26889
|
}
|
|
26864
26890
|
const islandVueClientPathMap = new Map;
|
|
26865
26891
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -26867,7 +26893,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26867
26893
|
const clientPath = islandVueClientPaths[idx];
|
|
26868
26894
|
if (!sourcePath || !clientPath)
|
|
26869
26895
|
continue;
|
|
26870
|
-
islandVueClientPathMap.set(
|
|
26896
|
+
islandVueClientPathMap.set(resolve41(sourcePath), clientPath);
|
|
26871
26897
|
}
|
|
26872
26898
|
const islandAngularClientPathMap = new Map;
|
|
26873
26899
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -26875,7 +26901,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26875
26901
|
const clientPath = islandAngularClientPaths[idx];
|
|
26876
26902
|
if (!sourcePath || !clientPath)
|
|
26877
26903
|
continue;
|
|
26878
|
-
islandAngularClientPathMap.set(
|
|
26904
|
+
islandAngularClientPathMap.set(resolve41(sourcePath), clientPath);
|
|
26879
26905
|
}
|
|
26880
26906
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
26881
26907
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -26902,7 +26928,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26902
26928
|
stylePreprocessorPlugin,
|
|
26903
26929
|
createBunStringRawUnicodePlugin()
|
|
26904
26930
|
],
|
|
26905
|
-
root:
|
|
26931
|
+
root: dirname29(source),
|
|
26906
26932
|
target: "bun",
|
|
26907
26933
|
throw: false,
|
|
26908
26934
|
...projectTsconfig()
|
|
@@ -26994,7 +27020,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26994
27020
|
...islandBootstrapPath ? [islandBootstrapPath] : []
|
|
26995
27021
|
];
|
|
26996
27022
|
const [onlyWorkerClientEntry] = urlReferencedFiles;
|
|
26997
|
-
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ?
|
|
27023
|
+
const workerClientRoot = urlReferencedFiles.length === 1 && onlyWorkerClientEntry ? dirname29(onlyWorkerClientEntry) : commonAncestor(urlReferencedFiles.map((file) => dirname29(file)), projectRoot);
|
|
26998
27024
|
const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
|
|
26999
27025
|
buildInfo: islandBuildInfo,
|
|
27000
27026
|
buildPath,
|
|
@@ -27322,7 +27348,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27322
27348
|
renameSync(mapPath, join52(sourcemapDir, basename17(mapPath)));
|
|
27323
27349
|
const jsPath = mapPath.slice(0, -4);
|
|
27324
27350
|
try {
|
|
27325
|
-
const javascript =
|
|
27351
|
+
const javascript = readFileSync34(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
27326
27352
|
`);
|
|
27327
27353
|
writeFileSync10(jsPath, javascript);
|
|
27328
27354
|
} catch {}
|
|
@@ -27385,7 +27411,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27385
27411
|
await tracePhase("postprocess/client-rewrite", rewriteClientGroups, clientRewriteStats);
|
|
27386
27412
|
if (!hmr) {
|
|
27387
27413
|
const reactVendorDir = join52(buildPath, "react", "vendor");
|
|
27388
|
-
const vendorChunkPaths =
|
|
27414
|
+
const vendorChunkPaths = existsSync38(reactVendorDir) ? [
|
|
27389
27415
|
...new Glob8("**/*.js").scanSync({
|
|
27390
27416
|
absolute: true,
|
|
27391
27417
|
cwd: reactVendorDir
|
|
@@ -27401,7 +27427,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27401
27427
|
if (serverOutputs.length > 0 && angularServerVendorPaths && Object.keys(angularServerVendorPaths).length > 0) {
|
|
27402
27428
|
await Promise.resolve().then(() => init_rewriteImportsPlugin());
|
|
27403
27429
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith(serverOutputs, (artifact) => {
|
|
27404
|
-
const fileDir =
|
|
27430
|
+
const fileDir = dirname29(artifact.path);
|
|
27405
27431
|
const relativePaths = {};
|
|
27406
27432
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths)) {
|
|
27407
27433
|
const rel = relative21(fileDir, absolute);
|
|
@@ -27529,7 +27555,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27529
27555
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
27530
27556
|
if (!hmrClientBundle)
|
|
27531
27557
|
return;
|
|
27532
|
-
let html =
|
|
27558
|
+
let html = readFileSync34(filePath, "utf-8");
|
|
27533
27559
|
if (html.includes("data-hmr-client"))
|
|
27534
27560
|
return;
|
|
27535
27561
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -27554,7 +27580,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27554
27580
|
if (hmr)
|
|
27555
27581
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
27556
27582
|
if (pwaArtifacts) {
|
|
27557
|
-
const source =
|
|
27583
|
+
const source = readFileSync34(htmlFile, "utf8");
|
|
27558
27584
|
writeFileSync10(htmlFile, injectPwaBootstrapHtml(source));
|
|
27559
27585
|
}
|
|
27560
27586
|
const fileName = basename17(htmlFile, ".html");
|
|
@@ -27585,7 +27611,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27585
27611
|
if (hmr)
|
|
27586
27612
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
27587
27613
|
if (pwaArtifacts) {
|
|
27588
|
-
const source =
|
|
27614
|
+
const source = readFileSync34(htmxFile, "utf8");
|
|
27589
27615
|
writeFileSync10(htmxFile, injectPwaBootstrapHtml(source));
|
|
27590
27616
|
}
|
|
27591
27617
|
const fileName = basename17(htmxFile, ".html");
|
|
@@ -27710,7 +27736,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27710
27736
|
pageEntries,
|
|
27711
27737
|
tailwindChanged: tailwindResult?.cssChanged ?? false
|
|
27712
27738
|
};
|
|
27713
|
-
}, projectTsconfig = () =>
|
|
27739
|
+
}, projectTsconfig = () => existsSync38(resolve41("tsconfig.json")) ? { tsconfig: "./tsconfig.json" } : {}, build2 = async (config) => {
|
|
27714
27740
|
const projectRoot = cwd();
|
|
27715
27741
|
const buildPath = validateSafePath(config.buildDirectory ?? "build", projectRoot);
|
|
27716
27742
|
return withBuildDirectoryLock(buildPath, () => buildUnlocked(config));
|
|
@@ -27799,7 +27825,7 @@ var init_build = __esm(() => {
|
|
|
27799
27825
|
});
|
|
27800
27826
|
|
|
27801
27827
|
// src/build/buildEmberVendor.ts
|
|
27802
|
-
import { mkdirSync as mkdirSync13, existsSync as
|
|
27828
|
+
import { mkdirSync as mkdirSync13, existsSync as existsSync39 } from "fs";
|
|
27803
27829
|
import { join as join53 } from "path";
|
|
27804
27830
|
import { rm as rm12 } from "fs/promises";
|
|
27805
27831
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
@@ -27853,7 +27879,7 @@ export const importSync = (specifier) => {
|
|
|
27853
27879
|
return { resolveTo: specifier, specifier };
|
|
27854
27880
|
}
|
|
27855
27881
|
const emberInternalPath = join53(cwd, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
27856
|
-
if (!
|
|
27882
|
+
if (!existsSync39(emberInternalPath)) {
|
|
27857
27883
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
27858
27884
|
}
|
|
27859
27885
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -27887,7 +27913,7 @@ export const importSync = (specifier) => {
|
|
|
27887
27913
|
return;
|
|
27888
27914
|
}
|
|
27889
27915
|
const internal = join53(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
27890
|
-
if (
|
|
27916
|
+
if (existsSync39(internal)) {
|
|
27891
27917
|
return { path: internal };
|
|
27892
27918
|
}
|
|
27893
27919
|
return;
|
|
@@ -27947,7 +27973,7 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
27947
27973
|
});
|
|
27948
27974
|
|
|
27949
27975
|
// src/build/workspacePackages.ts
|
|
27950
|
-
import { readFileSync as
|
|
27976
|
+
import { readFileSync as readFileSync35, realpathSync as realpathSync4 } from "fs";
|
|
27951
27977
|
import { join as join54, sep as sep7 } from "path";
|
|
27952
27978
|
var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, projectRoot = process.cwd()) => {
|
|
27953
27979
|
const key = `${projectRoot}\x00${specifier}`;
|
|
@@ -27956,7 +27982,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
27956
27982
|
return known;
|
|
27957
27983
|
let verdict = false;
|
|
27958
27984
|
try {
|
|
27959
|
-
const resolved =
|
|
27985
|
+
const resolved = realpathSync4(Bun.resolveSync(specifier, projectRoot));
|
|
27960
27986
|
verdict = !resolved.includes(NODE_MODULES_SEGMENT);
|
|
27961
27987
|
} catch {
|
|
27962
27988
|
verdict = false;
|
|
@@ -27966,7 +27992,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
27966
27992
|
}, workspacePackageDirs = (projectRoot = process.cwd()) => {
|
|
27967
27993
|
let manifest;
|
|
27968
27994
|
try {
|
|
27969
|
-
manifest = JSON.parse(
|
|
27995
|
+
manifest = JSON.parse(readFileSync35(join54(projectRoot, "package.json"), "utf-8"));
|
|
27970
27996
|
} catch {
|
|
27971
27997
|
return [];
|
|
27972
27998
|
}
|
|
@@ -27981,7 +28007,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
27981
28007
|
const dirs = new Set;
|
|
27982
28008
|
for (const name of names) {
|
|
27983
28009
|
try {
|
|
27984
|
-
const linked =
|
|
28010
|
+
const linked = realpathSync4(join54(projectRoot, "node_modules", name));
|
|
27985
28011
|
if (!`${linked}${sep7}`.includes(NODE_MODULES_SEGMENT))
|
|
27986
28012
|
dirs.add(linked);
|
|
27987
28013
|
} catch {}
|
|
@@ -28097,9 +28123,9 @@ var stripStringsAndComments = (source) => {
|
|
|
28097
28123
|
};
|
|
28098
28124
|
|
|
28099
28125
|
// src/dev/dependencyGraph.ts
|
|
28100
|
-
import { existsSync as
|
|
28126
|
+
import { existsSync as existsSync40, readFileSync as readFileSync36, realpathSync as realpathSync5 } from "fs";
|
|
28101
28127
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
28102
|
-
import { resolve as
|
|
28128
|
+
import { resolve as resolve42 } from "path";
|
|
28103
28129
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
28104
28130
|
const lower = filePath.toLowerCase();
|
|
28105
28131
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -28110,17 +28136,17 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28110
28136
|
return "html";
|
|
28111
28137
|
return null;
|
|
28112
28138
|
}, resolveImportPath2 = (importPath, fromFile) => {
|
|
28113
|
-
const fromDir =
|
|
28139
|
+
const fromDir = resolve42(fromFile, "..");
|
|
28114
28140
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
28115
28141
|
if (!isWorkspacePackageSpecifier(importPath, fromDir))
|
|
28116
28142
|
return null;
|
|
28117
28143
|
try {
|
|
28118
|
-
return
|
|
28144
|
+
return realpathSync5(Bun.resolveSync(importPath, fromDir));
|
|
28119
28145
|
} catch {
|
|
28120
28146
|
return null;
|
|
28121
28147
|
}
|
|
28122
28148
|
}
|
|
28123
|
-
const normalized =
|
|
28149
|
+
const normalized = resolve42(fromDir, importPath);
|
|
28124
28150
|
const extensions = [
|
|
28125
28151
|
".ts",
|
|
28126
28152
|
".tsx",
|
|
@@ -28133,10 +28159,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28133
28159
|
];
|
|
28134
28160
|
for (const ext of extensions) {
|
|
28135
28161
|
const withExt = normalized + ext;
|
|
28136
|
-
if (
|
|
28162
|
+
if (existsSync40(withExt))
|
|
28137
28163
|
return withExt;
|
|
28138
28164
|
}
|
|
28139
|
-
if (
|
|
28165
|
+
if (existsSync40(normalized))
|
|
28140
28166
|
return normalized;
|
|
28141
28167
|
return null;
|
|
28142
28168
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -28150,8 +28176,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28150
28176
|
dependents.delete(normalizedPath);
|
|
28151
28177
|
}
|
|
28152
28178
|
}, addFileToGraph = (graph, filePath) => {
|
|
28153
|
-
const normalizedPath =
|
|
28154
|
-
if (!
|
|
28179
|
+
const normalizedPath = resolve42(filePath);
|
|
28180
|
+
if (!existsSync40(normalizedPath))
|
|
28155
28181
|
return;
|
|
28156
28182
|
const dependencies = extractDependencies(normalizedPath);
|
|
28157
28183
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -28177,10 +28203,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28177
28203
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
28178
28204
|
const processedFiles = new Set;
|
|
28179
28205
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
28180
|
-
const resolvedDirs = directories.map((dir) =>
|
|
28206
|
+
const resolvedDirs = directories.map((dir) => resolve42(dir)).filter((dir) => existsSync40(dir));
|
|
28181
28207
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
28182
28208
|
for (const file of allFiles) {
|
|
28183
|
-
const fullPath =
|
|
28209
|
+
const fullPath = resolve42(file);
|
|
28184
28210
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
28185
28211
|
continue;
|
|
28186
28212
|
if (processedFiles.has(fullPath))
|
|
@@ -28274,15 +28300,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28274
28300
|
const lowerPath = filePath.toLowerCase();
|
|
28275
28301
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
28276
28302
|
if (loader === "html") {
|
|
28277
|
-
const content =
|
|
28303
|
+
const content = readFileSync36(filePath, "utf-8");
|
|
28278
28304
|
return extractHtmlDependencies(filePath, content);
|
|
28279
28305
|
}
|
|
28280
28306
|
if (loader === "tsx" || loader === "js") {
|
|
28281
|
-
const content =
|
|
28307
|
+
const content = readFileSync36(filePath, "utf-8");
|
|
28282
28308
|
return extractJsDependencies(filePath, content, loader);
|
|
28283
28309
|
}
|
|
28284
28310
|
if (isSvelteOrVue) {
|
|
28285
|
-
const content =
|
|
28311
|
+
const content = readFileSync36(filePath, "utf-8");
|
|
28286
28312
|
return extractSvelteVueDependencies(filePath, content);
|
|
28287
28313
|
}
|
|
28288
28314
|
return [];
|
|
@@ -28293,7 +28319,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28293
28319
|
return [];
|
|
28294
28320
|
}
|
|
28295
28321
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
28296
|
-
const normalizedPath =
|
|
28322
|
+
const normalizedPath = resolve42(changedFile);
|
|
28297
28323
|
const affected = new Set;
|
|
28298
28324
|
const toProcess = [normalizedPath];
|
|
28299
28325
|
const processNode = (current) => {
|
|
@@ -28324,7 +28350,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28324
28350
|
}, removeDependentsForFile = (graph, normalizedPath) => {
|
|
28325
28351
|
graph.dependents.delete(normalizedPath);
|
|
28326
28352
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
28327
|
-
const normalizedPath =
|
|
28353
|
+
const normalizedPath = resolve42(filePath);
|
|
28328
28354
|
removeDepsForFile(graph, normalizedPath);
|
|
28329
28355
|
removeDependentsForFile(graph, normalizedPath);
|
|
28330
28356
|
};
|
|
@@ -28368,12 +28394,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
28368
28394
|
};
|
|
28369
28395
|
|
|
28370
28396
|
// src/dev/configResolver.ts
|
|
28371
|
-
import { resolve as
|
|
28397
|
+
import { resolve as resolve43 } from "path";
|
|
28372
28398
|
var resolveBuildPaths = (config) => {
|
|
28373
28399
|
const cwd = process.cwd();
|
|
28374
28400
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
28375
|
-
const withDefault = (value, fallback) => normalize(
|
|
28376
|
-
const optional = (value) => value ? normalize(
|
|
28401
|
+
const withDefault = (value, fallback) => normalize(resolve43(cwd, value ?? fallback));
|
|
28402
|
+
const optional = (value) => value ? normalize(resolve43(cwd, value)) : undefined;
|
|
28377
28403
|
return {
|
|
28378
28404
|
angularDir: optional(config.angularDirectory),
|
|
28379
28405
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -28432,8 +28458,8 @@ var init_clientManager = __esm(() => {
|
|
|
28432
28458
|
});
|
|
28433
28459
|
|
|
28434
28460
|
// src/dev/pathUtils.ts
|
|
28435
|
-
import { existsSync as
|
|
28436
|
-
import { dirname as
|
|
28461
|
+
import { existsSync as existsSync41, readdirSync as readdirSync8, readFileSync as readFileSync37 } from "fs";
|
|
28462
|
+
import { dirname as dirname30, resolve as resolve44 } from "path";
|
|
28437
28463
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
28438
28464
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
28439
28465
|
return "ignored";
|
|
@@ -28509,7 +28535,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28509
28535
|
return "unknown";
|
|
28510
28536
|
}, collectAngularResourceDirs = (angularDir) => {
|
|
28511
28537
|
const out = new Set;
|
|
28512
|
-
const angularRoot =
|
|
28538
|
+
const angularRoot = resolve44(angularDir);
|
|
28513
28539
|
const angularRootNormalized = normalizePath2(angularRoot);
|
|
28514
28540
|
const walk = (dir) => {
|
|
28515
28541
|
let entries;
|
|
@@ -28522,7 +28548,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28522
28548
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
28523
28549
|
continue;
|
|
28524
28550
|
}
|
|
28525
|
-
const full =
|
|
28551
|
+
const full = resolve44(dir, entry.name);
|
|
28526
28552
|
if (entry.isDirectory()) {
|
|
28527
28553
|
walk(full);
|
|
28528
28554
|
continue;
|
|
@@ -28532,7 +28558,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28532
28558
|
}
|
|
28533
28559
|
let source;
|
|
28534
28560
|
try {
|
|
28535
|
-
source =
|
|
28561
|
+
source = readFileSync37(full, "utf8");
|
|
28536
28562
|
} catch {
|
|
28537
28563
|
continue;
|
|
28538
28564
|
}
|
|
@@ -28561,10 +28587,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28561
28587
|
refs.push(strMatch[1]);
|
|
28562
28588
|
}
|
|
28563
28589
|
}
|
|
28564
|
-
const componentDir =
|
|
28590
|
+
const componentDir = dirname30(full);
|
|
28565
28591
|
for (const ref of refs) {
|
|
28566
|
-
const refAbs = normalizePath2(
|
|
28567
|
-
const refDir = normalizePath2(
|
|
28592
|
+
const refAbs = normalizePath2(resolve44(componentDir, ref));
|
|
28593
|
+
const refDir = normalizePath2(dirname30(refAbs));
|
|
28568
28594
|
if (refDir === angularRootNormalized || refDir.startsWith(`${angularRootNormalized}/`)) {
|
|
28569
28595
|
continue;
|
|
28570
28596
|
}
|
|
@@ -28580,7 +28606,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28580
28606
|
const push = (path) => {
|
|
28581
28607
|
if (!path)
|
|
28582
28608
|
return;
|
|
28583
|
-
const abs = normalizePath2(
|
|
28609
|
+
const abs = normalizePath2(resolve44(cwd, path));
|
|
28584
28610
|
if (!roots.includes(abs))
|
|
28585
28611
|
roots.push(abs);
|
|
28586
28612
|
};
|
|
@@ -28605,8 +28631,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28605
28631
|
push(cfg.assetsDir);
|
|
28606
28632
|
push(cfg.stylesDir);
|
|
28607
28633
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
28608
|
-
const abs = normalizePath2(
|
|
28609
|
-
if (
|
|
28634
|
+
const abs = normalizePath2(resolve44(cwd, candidate));
|
|
28635
|
+
if (existsSync41(abs) && !roots.includes(abs))
|
|
28610
28636
|
roots.push(abs);
|
|
28611
28637
|
}
|
|
28612
28638
|
try {
|
|
@@ -28616,7 +28642,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28616
28642
|
continue;
|
|
28617
28643
|
if (entry.name.startsWith("."))
|
|
28618
28644
|
continue;
|
|
28619
|
-
const abs = normalizePath2(
|
|
28645
|
+
const abs = normalizePath2(resolve44(cwd, entry.name));
|
|
28620
28646
|
if (roots.includes(abs))
|
|
28621
28647
|
continue;
|
|
28622
28648
|
if (shouldIgnorePath(abs, resolved))
|
|
@@ -28704,7 +28730,7 @@ var init_pathUtils = __esm(() => {
|
|
|
28704
28730
|
});
|
|
28705
28731
|
|
|
28706
28732
|
// src/dev/devPrescan.ts
|
|
28707
|
-
import { existsSync as
|
|
28733
|
+
import { existsSync as existsSync42, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
28708
28734
|
import { mkdir as mkdir13, readFile as readFile8, rename as rename4, writeFile as writeFile11 } from "fs/promises";
|
|
28709
28735
|
import { join as join55 } from "path";
|
|
28710
28736
|
var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2000, collectConfigVendorSourceDirs = (config) => Array.from(new Set([
|
|
@@ -28717,7 +28743,7 @@ var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2
|
|
|
28717
28743
|
].filter((dir) => Boolean(dir)))), devPrescanEnabled = () => process.env.ABSOLUTE_DEV_PRESCAN === "1", sleep = (delayMs) => new Promise((resolve) => {
|
|
28718
28744
|
setTimeout(resolve, delayMs);
|
|
28719
28745
|
}), isPayload = (value) => typeof value === "object" && value !== null && ("version" in value) && value.version === PAYLOAD_VERSION, tryReadPrescan = async (path) => {
|
|
28720
|
-
if (!
|
|
28746
|
+
if (!existsSync42(path))
|
|
28721
28747
|
return;
|
|
28722
28748
|
try {
|
|
28723
28749
|
const parsed = JSON.parse(await readFile8(path, "utf8"));
|
|
@@ -28773,8 +28799,8 @@ var init_serverEntryCopies = () => {};
|
|
|
28773
28799
|
|
|
28774
28800
|
// src/dev/fileWatcher.ts
|
|
28775
28801
|
import { watch } from "fs";
|
|
28776
|
-
import { existsSync as
|
|
28777
|
-
import { dirname as
|
|
28802
|
+
import { existsSync as existsSync43, readdirSync as readdirSync10, statSync as statSync6 } from "fs";
|
|
28803
|
+
import { dirname as dirname31, join as join56, resolve as resolve45 } from "path";
|
|
28778
28804
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
28779
28805
|
try {
|
|
28780
28806
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -28829,7 +28855,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28829
28855
|
return;
|
|
28830
28856
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
28831
28857
|
if (event === "rename") {
|
|
28832
|
-
const eventDir =
|
|
28858
|
+
const eventDir = dirname31(join56(absolutePath, filename)).replace(/\\/g, "/");
|
|
28833
28859
|
atomicRecoveryScan(eventDir);
|
|
28834
28860
|
for (const delay of [25, 100]) {
|
|
28835
28861
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -28842,12 +28868,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28842
28868
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
28843
28869
|
return;
|
|
28844
28870
|
}
|
|
28845
|
-
if (event === "rename" && !
|
|
28871
|
+
if (event === "rename" && !existsSync43(fullPath)) {
|
|
28846
28872
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
28847
28873
|
onFileChange(fullPath);
|
|
28848
28874
|
return;
|
|
28849
28875
|
}
|
|
28850
|
-
if (
|
|
28876
|
+
if (existsSync43(fullPath)) {
|
|
28851
28877
|
onFileChange(fullPath);
|
|
28852
28878
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
28853
28879
|
}
|
|
@@ -28856,8 +28882,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28856
28882
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
28857
28883
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
28858
28884
|
paths.forEach((path) => {
|
|
28859
|
-
const absolutePath =
|
|
28860
|
-
if (!
|
|
28885
|
+
const absolutePath = resolve45(path).replace(/\\/g, "/");
|
|
28886
|
+
if (!existsSync43(absolutePath)) {
|
|
28861
28887
|
return;
|
|
28862
28888
|
}
|
|
28863
28889
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -28867,8 +28893,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28867
28893
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
28868
28894
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
28869
28895
|
watchPaths.forEach((path) => {
|
|
28870
|
-
const absolutePath =
|
|
28871
|
-
if (!
|
|
28896
|
+
const absolutePath = resolve45(path).replace(/\\/g, "/");
|
|
28897
|
+
if (!existsSync43(absolutePath)) {
|
|
28872
28898
|
return;
|
|
28873
28899
|
}
|
|
28874
28900
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -28887,13 +28913,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
28887
28913
|
});
|
|
28888
28914
|
|
|
28889
28915
|
// src/dev/assetStore.ts
|
|
28890
|
-
import { resolve as
|
|
28916
|
+
import { resolve as resolve46 } from "path";
|
|
28891
28917
|
import { readdir as readdir5, unlink } from "fs/promises";
|
|
28892
28918
|
var mimeTypes, getMimeType = (filePath) => {
|
|
28893
28919
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
28894
28920
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
28895
28921
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
28896
|
-
const fullPath =
|
|
28922
|
+
const fullPath = resolve46(dir, entry.name);
|
|
28897
28923
|
if (entry.isDirectory()) {
|
|
28898
28924
|
return walkAndClean(fullPath);
|
|
28899
28925
|
}
|
|
@@ -28909,10 +28935,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
28909
28935
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
28910
28936
|
const liveByIdentity = new Map;
|
|
28911
28937
|
for (const webPath of store.keys()) {
|
|
28912
|
-
const diskPath =
|
|
28938
|
+
const diskPath = resolve46(buildDir, webPath.slice(1));
|
|
28913
28939
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
28914
28940
|
}
|
|
28915
|
-
const absBuildDir =
|
|
28941
|
+
const absBuildDir = resolve46(buildDir);
|
|
28916
28942
|
Object.values(manifest).forEach((val) => {
|
|
28917
28943
|
if (!HASHED_FILE_RE.test(val))
|
|
28918
28944
|
return;
|
|
@@ -28932,13 +28958,13 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
28932
28958
|
}, evictMissingChunks = async (store, buildDir) => {
|
|
28933
28959
|
const chunkKeys = [...store.keys()].filter((webPath) => webPath.includes("/chunk-"));
|
|
28934
28960
|
await Promise.all(chunkKeys.map(async (webPath) => {
|
|
28935
|
-
const onDisk = await Bun.file(
|
|
28961
|
+
const onDisk = await Bun.file(resolve46(buildDir, webPath.slice(1))).exists().catch(() => false);
|
|
28936
28962
|
if (!onDisk)
|
|
28937
28963
|
store.delete(webPath);
|
|
28938
28964
|
}));
|
|
28939
28965
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
28940
28966
|
if (entry.isDirectory()) {
|
|
28941
|
-
return scanDir(
|
|
28967
|
+
return scanDir(resolve46(dir, entry.name), `${prefix}${entry.name}/`);
|
|
28942
28968
|
}
|
|
28943
28969
|
if (!entry.name.startsWith("chunk-")) {
|
|
28944
28970
|
return null;
|
|
@@ -28947,7 +28973,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
28947
28973
|
if (store.has(webPath)) {
|
|
28948
28974
|
return null;
|
|
28949
28975
|
}
|
|
28950
|
-
return Bun.file(
|
|
28976
|
+
return Bun.file(resolve46(dir, entry.name)).bytes().then((bytes) => {
|
|
28951
28977
|
store.set(webPath, bytes);
|
|
28952
28978
|
return;
|
|
28953
28979
|
}).catch(() => {});
|
|
@@ -28969,7 +28995,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
28969
28995
|
for (const webPath of newIdentities.values()) {
|
|
28970
28996
|
if (store.has(webPath))
|
|
28971
28997
|
continue;
|
|
28972
|
-
loadPromises.push(Bun.file(
|
|
28998
|
+
loadPromises.push(Bun.file(resolve46(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
28973
28999
|
store.set(webPath, bytes);
|
|
28974
29000
|
return;
|
|
28975
29001
|
}).catch(() => {}));
|
|
@@ -29015,10 +29041,10 @@ var init_assetStore = __esm(() => {
|
|
|
29015
29041
|
});
|
|
29016
29042
|
|
|
29017
29043
|
// src/dev/restartScope.ts
|
|
29018
|
-
import { realpathSync as
|
|
29044
|
+
import { realpathSync as realpathSync6 } from "fs";
|
|
29019
29045
|
var MODULE_FILE, DOCUMENT_FILE, realPath = (path) => {
|
|
29020
29046
|
try {
|
|
29021
|
-
return
|
|
29047
|
+
return realpathSync6(path);
|
|
29022
29048
|
} catch {
|
|
29023
29049
|
return path;
|
|
29024
29050
|
}
|
|
@@ -29035,10 +29061,10 @@ var init_restartScope = __esm(() => {
|
|
|
29035
29061
|
});
|
|
29036
29062
|
|
|
29037
29063
|
// src/dev/fileHashTracker.ts
|
|
29038
|
-
import { readFileSync as
|
|
29064
|
+
import { readFileSync as readFileSync38, statSync as statSync7 } from "fs";
|
|
29039
29065
|
var computeFileHash = (filePath) => {
|
|
29040
29066
|
try {
|
|
29041
|
-
const fileContent =
|
|
29067
|
+
const fileContent = readFileSync38(filePath);
|
|
29042
29068
|
return Number(Bun.hash(fileContent));
|
|
29043
29069
|
} catch {
|
|
29044
29070
|
return UNFOUND_INDEX;
|
|
@@ -29126,9 +29152,9 @@ var init_transformCache = __esm(() => {
|
|
|
29126
29152
|
});
|
|
29127
29153
|
|
|
29128
29154
|
// src/dev/reactComponentClassifier.ts
|
|
29129
|
-
import { resolve as
|
|
29155
|
+
import { resolve as resolve47 } from "path";
|
|
29130
29156
|
var classifyComponent = (filePath) => {
|
|
29131
|
-
const normalizedPath =
|
|
29157
|
+
const normalizedPath = resolve47(filePath);
|
|
29132
29158
|
if (normalizedPath.includes("/react/pages/")) {
|
|
29133
29159
|
return "server";
|
|
29134
29160
|
}
|
|
@@ -29140,7 +29166,7 @@ var classifyComponent = (filePath) => {
|
|
|
29140
29166
|
var init_reactComponentClassifier = () => {};
|
|
29141
29167
|
|
|
29142
29168
|
// src/dev/moduleMapper.ts
|
|
29143
|
-
import { basename as basename18, resolve as
|
|
29169
|
+
import { basename as basename18, resolve as resolve48 } from "path";
|
|
29144
29170
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
29145
29171
|
const modulePaths = {};
|
|
29146
29172
|
moduleKeys.forEach((key) => {
|
|
@@ -29150,7 +29176,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
29150
29176
|
});
|
|
29151
29177
|
return modulePaths;
|
|
29152
29178
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
29153
|
-
const normalizedFile =
|
|
29179
|
+
const normalizedFile = resolve48(sourceFile);
|
|
29154
29180
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
29155
29181
|
if (processedFiles.has(normalizedFile)) {
|
|
29156
29182
|
return null;
|
|
@@ -29186,7 +29212,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
29186
29212
|
});
|
|
29187
29213
|
return grouped;
|
|
29188
29214
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
29189
|
-
const normalizedFile =
|
|
29215
|
+
const normalizedFile = resolve48(sourceFile);
|
|
29190
29216
|
const fileName = basename18(normalizedFile);
|
|
29191
29217
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
29192
29218
|
const pascalName = toPascal(baseName);
|
|
@@ -29242,7 +29268,7 @@ var init_moduleMapper = __esm(() => {
|
|
|
29242
29268
|
|
|
29243
29269
|
// src/utils/spaRouteCss.ts
|
|
29244
29270
|
import { readFile as readFile9 } from "fs/promises";
|
|
29245
|
-
import { dirname as
|
|
29271
|
+
import { dirname as dirname32, isAbsolute as isAbsolute9, resolve as resolve49 } from "path";
|
|
29246
29272
|
var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
29247
29273
|
const cached = sideManifestCache.get(sideManifestPath);
|
|
29248
29274
|
if (cached !== undefined)
|
|
@@ -29280,7 +29306,7 @@ var sideManifestCache, readSideManifest = async (sideManifestPath) => {
|
|
|
29280
29306
|
}, readChildCss = async (cssPath, sideManifestPath) => {
|
|
29281
29307
|
if (!cssPath)
|
|
29282
29308
|
return "";
|
|
29283
|
-
const resolvedCssPath = isAbsolute9(cssPath) ? cssPath :
|
|
29309
|
+
const resolvedCssPath = isAbsolute9(cssPath) ? cssPath : resolve49(dirname32(sideManifestPath), cssPath);
|
|
29284
29310
|
const cached = childCssCache.get(resolvedCssPath);
|
|
29285
29311
|
if (cached !== undefined)
|
|
29286
29312
|
return cached;
|
|
@@ -29363,8 +29389,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
29363
29389
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
29364
29390
|
resolveOwningComponents: () => resolveOwningComponents
|
|
29365
29391
|
});
|
|
29366
|
-
import { readdirSync as readdirSync11, readFileSync as
|
|
29367
|
-
import { dirname as
|
|
29392
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync39, statSync as statSync8 } from "fs";
|
|
29393
|
+
import { dirname as dirname33, extname as extname15, join as join57, resolve as resolve50 } from "path";
|
|
29368
29394
|
import ts19 from "typescript";
|
|
29369
29395
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
29370
29396
|
const out = [];
|
|
@@ -29423,7 +29449,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29423
29449
|
}, parseDecoratedClasses = (filePath) => {
|
|
29424
29450
|
let source;
|
|
29425
29451
|
try {
|
|
29426
|
-
source =
|
|
29452
|
+
source = readFileSync39(filePath, "utf8");
|
|
29427
29453
|
} catch {
|
|
29428
29454
|
return [];
|
|
29429
29455
|
}
|
|
@@ -29477,7 +29503,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29477
29503
|
};
|
|
29478
29504
|
visit(sourceFile);
|
|
29479
29505
|
return out;
|
|
29480
|
-
}, safeNormalize = (path) =>
|
|
29506
|
+
}, safeNormalize = (path) => resolve50(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
29481
29507
|
const { changedFilePath, userAngularRoot } = params;
|
|
29482
29508
|
const changedAbs = safeNormalize(changedFilePath);
|
|
29483
29509
|
const out = [];
|
|
@@ -29513,12 +29539,12 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29513
29539
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
29514
29540
|
let source;
|
|
29515
29541
|
try {
|
|
29516
|
-
source =
|
|
29542
|
+
source = readFileSync39(childFilePath, "utf8");
|
|
29517
29543
|
} catch {
|
|
29518
29544
|
return null;
|
|
29519
29545
|
}
|
|
29520
29546
|
const sourceFile = ts19.createSourceFile(childFilePath, source, ts19.ScriptTarget.ES2022, true, ts19.ScriptKind.TS);
|
|
29521
|
-
const childDir =
|
|
29547
|
+
const childDir = dirname33(childFilePath);
|
|
29522
29548
|
for (const stmt of sourceFile.statements) {
|
|
29523
29549
|
if (!ts19.isImportDeclaration(stmt))
|
|
29524
29550
|
continue;
|
|
@@ -29546,7 +29572,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29546
29572
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
29547
29573
|
return null;
|
|
29548
29574
|
}
|
|
29549
|
-
const base =
|
|
29575
|
+
const base = resolve50(childDir, spec);
|
|
29550
29576
|
const candidates = [
|
|
29551
29577
|
`${base}.ts`,
|
|
29552
29578
|
`${base}.tsx`,
|
|
@@ -29575,7 +29601,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29575
29601
|
const parentFile = new Map;
|
|
29576
29602
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
29577
29603
|
const classes = parseDecoratedClasses(tsPath);
|
|
29578
|
-
const componentDir =
|
|
29604
|
+
const componentDir = dirname33(tsPath);
|
|
29579
29605
|
for (const cls of classes) {
|
|
29580
29606
|
const entity = {
|
|
29581
29607
|
className: cls.className,
|
|
@@ -29584,7 +29610,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29584
29610
|
};
|
|
29585
29611
|
if (cls.kind === "component") {
|
|
29586
29612
|
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
29587
|
-
const abs = safeNormalize(
|
|
29613
|
+
const abs = safeNormalize(resolve50(componentDir, url));
|
|
29588
29614
|
const existing = resource.get(abs);
|
|
29589
29615
|
if (existing)
|
|
29590
29616
|
existing.push(entity);
|
|
@@ -29846,8 +29872,8 @@ __export(exports_moduleServer, {
|
|
|
29846
29872
|
warmPage: () => warmPage,
|
|
29847
29873
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
29848
29874
|
});
|
|
29849
|
-
import { existsSync as
|
|
29850
|
-
import { basename as basename19, dirname as
|
|
29875
|
+
import { existsSync as existsSync44, readFileSync as readFileSync40, realpathSync as realpathSync7, statSync as statSync9 } from "fs";
|
|
29876
|
+
import { basename as basename19, dirname as dirname34, extname as extname16, join as join58, resolve as resolve51, relative as relative22 } from "path";
|
|
29851
29877
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
29852
29878
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
29853
29879
|
const allExports = [];
|
|
@@ -29867,10 +29893,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
29867
29893
|
${stubs}
|
|
29868
29894
|
`;
|
|
29869
29895
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
29870
|
-
const directHit = extensions.find((ext) =>
|
|
29896
|
+
const directHit = extensions.find((ext) => existsSync44(resolve51(projectRoot, srcPath + ext)));
|
|
29871
29897
|
if (directHit)
|
|
29872
29898
|
return srcPath + directHit;
|
|
29873
|
-
const indexHit = extensions.find((ext) =>
|
|
29899
|
+
const indexHit = extensions.find((ext) => existsSync44(resolve51(projectRoot, srcPath, `index${ext}`)));
|
|
29874
29900
|
if (indexHit)
|
|
29875
29901
|
return `${srcPath}/index${indexHit}`;
|
|
29876
29902
|
return srcPath;
|
|
@@ -29899,7 +29925,7 @@ ${stubs}
|
|
|
29899
29925
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
29900
29926
|
}, srcUrl = (relPath, projectRoot) => {
|
|
29901
29927
|
const base = `${SRC_PREFIX}${encodeSrcPath(relPath)}`;
|
|
29902
|
-
const absPath =
|
|
29928
|
+
const absPath = resolve51(projectRoot, relPath);
|
|
29903
29929
|
const cached = mtimeCache.get(absPath);
|
|
29904
29930
|
if (cached !== undefined)
|
|
29905
29931
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -29911,12 +29937,12 @@ ${stubs}
|
|
|
29911
29937
|
return base;
|
|
29912
29938
|
}
|
|
29913
29939
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
29914
|
-
const absPath =
|
|
29940
|
+
const absPath = resolve51(fileDir, relPath);
|
|
29915
29941
|
const rel = relative22(projectRoot, absPath);
|
|
29916
29942
|
const extension = extname16(rel);
|
|
29917
29943
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
29918
29944
|
if (extname16(srcPath) === ".svelte") {
|
|
29919
|
-
srcPath = relative22(projectRoot, resolveSvelteModulePath(
|
|
29945
|
+
srcPath = relative22(projectRoot, resolveSvelteModulePath(resolve51(projectRoot, srcPath)));
|
|
29920
29946
|
}
|
|
29921
29947
|
return srcUrl(srcPath, projectRoot);
|
|
29922
29948
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -29935,14 +29961,14 @@ ${stubs}
|
|
|
29935
29961
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
29936
29962
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
29937
29963
|
if (!subpath) {
|
|
29938
|
-
const pkgDir =
|
|
29964
|
+
const pkgDir = resolve51(projectRoot, "node_modules", packageName ?? "");
|
|
29939
29965
|
const pkgJsonPath = join58(pkgDir, "package.json");
|
|
29940
|
-
if (
|
|
29941
|
-
const pkg = JSON.parse(
|
|
29966
|
+
if (existsSync44(pkgJsonPath)) {
|
|
29967
|
+
const pkg = JSON.parse(readFileSync40(pkgJsonPath, "utf-8"));
|
|
29942
29968
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
29943
29969
|
if (esmEntry) {
|
|
29944
|
-
const resolved =
|
|
29945
|
-
if (
|
|
29970
|
+
const resolved = resolve51(pkgDir, esmEntry);
|
|
29971
|
+
if (existsSync44(resolved))
|
|
29946
29972
|
return relative22(projectRoot, resolved);
|
|
29947
29973
|
}
|
|
29948
29974
|
}
|
|
@@ -29981,7 +30007,7 @@ ${stubs}
|
|
|
29981
30007
|
};
|
|
29982
30008
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
29983
30009
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
29984
|
-
const fileDir =
|
|
30010
|
+
const fileDir = dirname34(filePath);
|
|
29985
30011
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
29986
30012
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}` : _match);
|
|
29987
30013
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => isRealImport(relPath) ? `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}` : _match);
|
|
@@ -29990,7 +30016,7 @@ ${stubs}
|
|
|
29990
30016
|
const rel = relative22(projectRoot, absPath).replace(/\\/g, "/");
|
|
29991
30017
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
29992
30018
|
}
|
|
29993
|
-
if (!
|
|
30019
|
+
if (!existsSync44(absPath))
|
|
29994
30020
|
return _match;
|
|
29995
30021
|
const rel = relative22(projectRoot, absPath).replace(/\\/g, "/");
|
|
29996
30022
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
@@ -29998,12 +30024,12 @@ ${stubs}
|
|
|
29998
30024
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
29999
30025
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
30000
30026
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
30001
|
-
const absPath =
|
|
30027
|
+
const absPath = resolve51(fileDir, relPath);
|
|
30002
30028
|
const rel = relative22(projectRoot, absPath);
|
|
30003
30029
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
30004
30030
|
});
|
|
30005
30031
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
30006
|
-
const absPath =
|
|
30032
|
+
const absPath = resolve51(fileDir, relPath);
|
|
30007
30033
|
const rel = relative22(projectRoot, absPath);
|
|
30008
30034
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
30009
30035
|
});
|
|
@@ -30049,7 +30075,7 @@ ${code}`;
|
|
|
30049
30075
|
reactFastRefreshWarningEmitted = true;
|
|
30050
30076
|
logWarn("React edits remount the page instead of keeping component state: " + "this Bun ignores `reactFastRefresh` on Bun.Transpiler " + "(https://github.com/oven-sh/bun/issues/32919). Run " + "`absolute bun-patch install` to use AbsoluteJS's patched Bun, " + "which has the fix; `absolute dev` then uses it automatically.");
|
|
30051
30077
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
30052
|
-
const raw =
|
|
30078
|
+
const raw = readFileSync40(filePath, "utf-8");
|
|
30053
30079
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
30054
30080
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
30055
30081
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -30065,7 +30091,7 @@ ${transpiled}`;
|
|
|
30065
30091
|
transpiled += buildIslandMetadataExports(raw);
|
|
30066
30092
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
30067
30093
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
30068
|
-
const raw =
|
|
30094
|
+
const raw = readFileSync40(filePath, "utf-8");
|
|
30069
30095
|
const ext = extname16(filePath);
|
|
30070
30096
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
30071
30097
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -30231,7 +30257,7 @@ ${code}`;
|
|
|
30231
30257
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
30232
30258
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
30233
30259
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
30234
|
-
const raw =
|
|
30260
|
+
const raw = readFileSync40(filePath, "utf-8");
|
|
30235
30261
|
if (!svelteCompiler) {
|
|
30236
30262
|
svelteCompiler = await import("svelte/compiler");
|
|
30237
30263
|
}
|
|
@@ -30280,7 +30306,7 @@ export default __script__;`;
|
|
|
30280
30306
|
filename: filePath,
|
|
30281
30307
|
id: `data-v-${componentId}`,
|
|
30282
30308
|
scoped: Boolean(style.scoped),
|
|
30283
|
-
source: style.lang ? await compileStyleSource(filePath, style.content, style.lang, stylePreprocessors) : style.content,
|
|
30309
|
+
source: inlineCssImports(style.lang ? await compileStyleSource(filePath, style.content, style.lang, stylePreprocessors) : style.content, filePath),
|
|
30284
30310
|
trim: true
|
|
30285
30311
|
}).code))).join(`
|
|
30286
30312
|
`);
|
|
@@ -30297,7 +30323,7 @@ export default __script__;`;
|
|
|
30297
30323
|
return `${cssInjection}
|
|
30298
30324
|
${code}`;
|
|
30299
30325
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
30300
|
-
const rawSource =
|
|
30326
|
+
const rawSource = readFileSync40(filePath, "utf-8");
|
|
30301
30327
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
30302
30328
|
if (!vueCompiler) {
|
|
30303
30329
|
vueCompiler = await loadVueCompiler();
|
|
@@ -30309,8 +30335,8 @@ ${code}`;
|
|
|
30309
30335
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
30310
30336
|
fs: {
|
|
30311
30337
|
fileExists: isFile,
|
|
30312
|
-
realpath:
|
|
30313
|
-
readFile: (file) => isFile(file) ?
|
|
30338
|
+
realpath: realpathSync7,
|
|
30339
|
+
readFile: (file) => isFile(file) ? readFileSync40(file, "utf-8") : undefined
|
|
30314
30340
|
},
|
|
30315
30341
|
id: componentId,
|
|
30316
30342
|
inlineTemplate: false
|
|
@@ -30325,7 +30351,7 @@ ${code}`;
|
|
|
30325
30351
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
30326
30352
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
30327
30353
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
30328
|
-
const hmrBase = vueDir ?
|
|
30354
|
+
const hmrBase = vueDir ? resolve51(vueDir) : projectRoot;
|
|
30329
30355
|
const hmrId = relative22(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
30330
30356
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
30331
30357
|
result += [
|
|
@@ -30340,11 +30366,11 @@ ${code}`;
|
|
|
30340
30366
|
`);
|
|
30341
30367
|
return result;
|
|
30342
30368
|
}, resolveSvelteModulePath = (path) => {
|
|
30343
|
-
if (
|
|
30369
|
+
if (existsSync44(path))
|
|
30344
30370
|
return path;
|
|
30345
|
-
if (
|
|
30371
|
+
if (existsSync44(`${path}.ts`))
|
|
30346
30372
|
return `${path}.ts`;
|
|
30347
|
-
if (
|
|
30373
|
+
if (existsSync44(`${path}.js`))
|
|
30348
30374
|
return `${path}.js`;
|
|
30349
30375
|
return path;
|
|
30350
30376
|
}, jsResponse = (body) => {
|
|
@@ -30357,7 +30383,7 @@ ${code}`;
|
|
|
30357
30383
|
}
|
|
30358
30384
|
});
|
|
30359
30385
|
}, handleCssRequest = (filePath) => {
|
|
30360
|
-
const raw =
|
|
30386
|
+
const raw = readFileSync40(filePath, "utf-8");
|
|
30361
30387
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
30362
30388
|
return [
|
|
30363
30389
|
`const style = document.createElement('style');`,
|
|
@@ -30486,13 +30512,13 @@ export default {};
|
|
|
30486
30512
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
30487
30513
|
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
30514
|
}, resolveSourcePath2 = (relPath, projectRoot) => {
|
|
30489
|
-
const filePath =
|
|
30515
|
+
const filePath = resolve51(projectRoot, decodeSrcPath(relPath));
|
|
30490
30516
|
const ext = extname16(filePath);
|
|
30491
30517
|
if (ext === ".svelte")
|
|
30492
30518
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
30493
30519
|
if (ext)
|
|
30494
30520
|
return { ext, filePath };
|
|
30495
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
30521
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync44(filePath + candidate));
|
|
30496
30522
|
if (!found)
|
|
30497
30523
|
return { ext, filePath };
|
|
30498
30524
|
const resolved = filePath + found;
|
|
@@ -30523,14 +30549,14 @@ export default {};
|
|
|
30523
30549
|
const absoluteCandidate = `/${tail.replace(/^\/+/, "")}`;
|
|
30524
30550
|
const candidates = [
|
|
30525
30551
|
absoluteCandidate,
|
|
30526
|
-
|
|
30552
|
+
resolve51(projectRoot, tail)
|
|
30527
30553
|
];
|
|
30528
30554
|
try {
|
|
30529
30555
|
await Promise.resolve().then(() => init_loadConfig());
|
|
30530
30556
|
const cfg = await loadConfig();
|
|
30531
|
-
const angularDir = cfg.angularDirectory &&
|
|
30557
|
+
const angularDir = cfg.angularDirectory && resolve51(projectRoot, cfg.angularDirectory);
|
|
30532
30558
|
if (angularDir)
|
|
30533
|
-
candidates.push(
|
|
30559
|
+
candidates.push(resolve51(angularDir, tail));
|
|
30534
30560
|
} catch {}
|
|
30535
30561
|
for (const candidate of candidates) {
|
|
30536
30562
|
if (await fileExists(candidate)) {
|
|
@@ -30561,7 +30587,7 @@ export default {};
|
|
|
30561
30587
|
if (!TRANSPILABLE.has(ext))
|
|
30562
30588
|
return;
|
|
30563
30589
|
const stat = statSync9(filePath);
|
|
30564
|
-
const resolvedVueDir = vueDir ?
|
|
30590
|
+
const resolvedVueDir = vueDir ? resolve51(vueDir) : undefined;
|
|
30565
30591
|
let content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
30566
30592
|
const isAngularGeneratedJs = ext === ".js" && filePath.replace(/\\/g, "/").includes("/.absolutejs/generated/angular/");
|
|
30567
30593
|
if (isAngularGeneratedJs) {
|
|
@@ -30617,7 +30643,7 @@ export default {};
|
|
|
30617
30643
|
const ownMessage = source && typeof source === "object" ? Reflect.get(source, "message") : undefined;
|
|
30618
30644
|
const message = typeof ownMessage === "string" ? ownMessage : String(source);
|
|
30619
30645
|
return { message, ...readPosition(first) };
|
|
30620
|
-
}, getTransformError = (filePath) => transformErrors.get(
|
|
30646
|
+
}, getTransformError = (filePath) => transformErrors.get(resolve51(filePath)), transformErrorResponse = (err) => {
|
|
30621
30647
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
30622
30648
|
return new Response(`console.error('[ModuleServer] Transform error:', ${JSON.stringify(errMsg)});`, {
|
|
30623
30649
|
headers: { "Content-Type": "application/javascript" },
|
|
@@ -30640,16 +30666,16 @@ export default {};
|
|
|
30640
30666
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
30641
30667
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
30642
30668
|
return handleBunWrapRequest();
|
|
30643
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
30669
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve51(projectRoot, decodeSrcPath(relPath)));
|
|
30644
30670
|
if (virtualCssResponse)
|
|
30645
30671
|
return virtualCssResponse;
|
|
30646
30672
|
const { filePath, ext } = resolveSourcePath2(relPath, projectRoot);
|
|
30647
30673
|
try {
|
|
30648
30674
|
const response = await transformAndCache(filePath, ext, projectRoot, rewriter, frameworkDirs?.vue, stylePreprocessors);
|
|
30649
|
-
transformErrors.delete(
|
|
30675
|
+
transformErrors.delete(resolve51(filePath));
|
|
30650
30676
|
return response;
|
|
30651
30677
|
} catch (err) {
|
|
30652
|
-
transformErrors.set(
|
|
30678
|
+
transformErrors.set(resolve51(filePath), describeTransformError(err));
|
|
30653
30679
|
return transformErrorResponse(err);
|
|
30654
30680
|
}
|
|
30655
30681
|
};
|
|
@@ -30659,11 +30685,11 @@ export default {};
|
|
|
30659
30685
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
30660
30686
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
30661
30687
|
if (match[1])
|
|
30662
|
-
files.push(
|
|
30688
|
+
files.push(resolve51(projectRoot, decodeSrcPath(match[1])));
|
|
30663
30689
|
}
|
|
30664
30690
|
return files;
|
|
30665
30691
|
}, SRC_URL_PREFIX2, invalidateModule = (filePath) => {
|
|
30666
|
-
const resolved =
|
|
30692
|
+
const resolved = resolve51(filePath);
|
|
30667
30693
|
transformErrors.delete(resolved);
|
|
30668
30694
|
invalidate(filePath);
|
|
30669
30695
|
if (resolved !== filePath)
|
|
@@ -30729,7 +30755,7 @@ export default {};
|
|
|
30729
30755
|
return false;
|
|
30730
30756
|
}
|
|
30731
30757
|
await Promise.resolve().then(() => init_prepare());
|
|
30732
|
-
patchManifestIndexes(cached.manifest,
|
|
30758
|
+
patchManifestIndexes(cached.manifest, resolve51(state.resolvedPaths.buildDir, "_src_indexes"), SRC_PREFIX);
|
|
30733
30759
|
logPageBuild(entry.source, entry.framework, Math.round(durationMs));
|
|
30734
30760
|
logStartupTimingBlock("AbsoluteJS on-demand page build", [
|
|
30735
30761
|
{ durationMs, label: entry.name }
|
|
@@ -30752,6 +30778,7 @@ export default {};
|
|
|
30752
30778
|
};
|
|
30753
30779
|
var init_moduleServer = __esm(() => {
|
|
30754
30780
|
init_constants();
|
|
30781
|
+
init_inlineCssImports();
|
|
30755
30782
|
init_resolvePackageImport();
|
|
30756
30783
|
init_vueAutoRouterTransform();
|
|
30757
30784
|
init_sourceMetadata();
|
|
@@ -30892,7 +30919,7 @@ var init_rewriteImports = __esm(() => {
|
|
|
30892
30919
|
});
|
|
30893
30920
|
|
|
30894
30921
|
// src/dev/angular/hmrCompiler.ts
|
|
30895
|
-
import { dirname as
|
|
30922
|
+
import { dirname as dirname35, relative as relative23, resolve as resolve52 } from "path";
|
|
30896
30923
|
import { performance as performance2 } from "perf_hooks";
|
|
30897
30924
|
var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
30898
30925
|
const projectRel = relative23(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
@@ -30904,7 +30931,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
30904
30931
|
return null;
|
|
30905
30932
|
const filePathRel = decoded.slice(0, separatorIndex);
|
|
30906
30933
|
const className = decoded.slice(separatorIndex + 1);
|
|
30907
|
-
const componentFilePath =
|
|
30934
|
+
const componentFilePath = resolve52(process.cwd(), filePathRel);
|
|
30908
30935
|
const projectRelPath = relative23(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
30909
30936
|
const cacheKey = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
30910
30937
|
await Promise.resolve().then(() => init_fastHmrCompiler());
|
|
@@ -30915,7 +30942,7 @@ var encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
|
30915
30942
|
await Promise.resolve().then(() => init_resolveOwningComponents());
|
|
30916
30943
|
const owners = resolveOwningComponents({
|
|
30917
30944
|
changedFilePath: componentFilePath,
|
|
30918
|
-
userAngularRoot:
|
|
30945
|
+
userAngularRoot: dirname35(componentFilePath)
|
|
30919
30946
|
});
|
|
30920
30947
|
const owner = owners.find((o) => o.className === className);
|
|
30921
30948
|
const kind = owner?.kind ?? "component";
|
|
@@ -30992,11 +31019,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
30992
31019
|
__export(exports_simpleHTMLHMR, {
|
|
30993
31020
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
30994
31021
|
});
|
|
30995
|
-
import { resolve as
|
|
31022
|
+
import { resolve as resolve53 } from "path";
|
|
30996
31023
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
30997
31024
|
let htmlContent;
|
|
30998
31025
|
try {
|
|
30999
|
-
const resolvedPath =
|
|
31026
|
+
const resolvedPath = resolve53(htmlFilePath);
|
|
31000
31027
|
const file = Bun.file(resolvedPath);
|
|
31001
31028
|
if (!await file.exists()) {
|
|
31002
31029
|
return null;
|
|
@@ -31022,11 +31049,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
31022
31049
|
__export(exports_simpleHTMXHMR, {
|
|
31023
31050
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
31024
31051
|
});
|
|
31025
|
-
import { resolve as
|
|
31052
|
+
import { resolve as resolve54 } from "path";
|
|
31026
31053
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
31027
31054
|
let htmlContent;
|
|
31028
31055
|
try {
|
|
31029
|
-
const resolvedPath =
|
|
31056
|
+
const resolvedPath = resolve54(htmxFilePath);
|
|
31030
31057
|
const file = Bun.file(resolvedPath);
|
|
31031
31058
|
if (!await file.exists()) {
|
|
31032
31059
|
return null;
|
|
@@ -31048,8 +31075,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
31048
31075
|
var init_simpleHTMXHMR = () => {};
|
|
31049
31076
|
|
|
31050
31077
|
// src/dev/backendGraph.ts
|
|
31051
|
-
import { readFileSync as
|
|
31052
|
-
import { dirname as
|
|
31078
|
+
import { readFileSync as readFileSync41, realpathSync as realpathSync8, statSync as statSync10 } from "fs";
|
|
31079
|
+
import { dirname as dirname36, extname as extname17, resolve as resolve55 } from "path";
|
|
31053
31080
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
|
|
31054
31081
|
const loader = LOADERS[extname17(path)] ?? "ts";
|
|
31055
31082
|
const existing = transpilers.get(loader);
|
|
@@ -31060,13 +31087,13 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
31060
31087
|
return created;
|
|
31061
31088
|
}, realPath2 = (path) => {
|
|
31062
31089
|
try {
|
|
31063
|
-
return
|
|
31090
|
+
return realpathSync8(path);
|
|
31064
31091
|
} catch {
|
|
31065
31092
|
return path;
|
|
31066
31093
|
}
|
|
31067
|
-
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) &&
|
|
31094
|
+
}, isProjectModule = (path, root = process.cwd()) => SOURCE_FILE.test(path) && !VENDORED.test(path) && resolve55(path).startsWith(resolve55(root)), resolveImport = (specifier, fromFile) => {
|
|
31068
31095
|
try {
|
|
31069
|
-
return realPath2(Bun.resolveSync(specifier,
|
|
31096
|
+
return realPath2(Bun.resolveSync(specifier, dirname36(fromFile)));
|
|
31070
31097
|
} catch {
|
|
31071
31098
|
return;
|
|
31072
31099
|
}
|
|
@@ -31083,20 +31110,20 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
31083
31110
|
return cached.imports;
|
|
31084
31111
|
let imports = [];
|
|
31085
31112
|
try {
|
|
31086
|
-
const source =
|
|
31113
|
+
const source = readFileSync41(path, "utf-8");
|
|
31087
31114
|
imports = transpilerFor(path).scanImports(source).map((entry) => resolveImport(entry.path, path)).filter((target) => target !== undefined);
|
|
31088
31115
|
} catch {}
|
|
31089
31116
|
fileCache.set(path, { imports, mtimeMs });
|
|
31090
31117
|
return imports;
|
|
31091
31118
|
}, importersOf = (target, entry, loaded = loadedProjectModules(entry)) => {
|
|
31092
|
-
const goal = realPath2(
|
|
31119
|
+
const goal = realPath2(resolve55(target));
|
|
31093
31120
|
const importers = [];
|
|
31094
31121
|
for (const file of loaded)
|
|
31095
31122
|
if (readImports(file).includes(goal))
|
|
31096
31123
|
importers.push(file);
|
|
31097
31124
|
return importers;
|
|
31098
31125
|
}, loadedProjectModules = (entry, loaded = Object.keys(__require.cache), root = process.cwd()) => {
|
|
31099
|
-
const entryPath = realPath2(
|
|
31126
|
+
const entryPath = realPath2(resolve55(entry));
|
|
31100
31127
|
const modules = new Set([entryPath]);
|
|
31101
31128
|
for (const path of loaded) {
|
|
31102
31129
|
if (isAbsoluteServerEntryCopyPath(path))
|
|
@@ -31125,7 +31152,7 @@ var init_backendGraph = __esm(() => {
|
|
|
31125
31152
|
});
|
|
31126
31153
|
|
|
31127
31154
|
// src/dev/hot/analyze.ts
|
|
31128
|
-
import { dirname as
|
|
31155
|
+
import { dirname as dirname37, extname as extname18 } from "path";
|
|
31129
31156
|
var ANALYZER_VERSION = 1, hashText = (text) => Bun.hash(text).toString(36), scriptKindFor = (tsc, path) => {
|
|
31130
31157
|
switch (extname18(path)) {
|
|
31131
31158
|
case ".tsx":
|
|
@@ -31807,7 +31834,7 @@ var ANALYZER_VERSION = 1, hashText = (text) => Bun.hash(text).toString(36), scri
|
|
|
31807
31834
|
return analysis;
|
|
31808
31835
|
}, resolveFrom = (fromFile, isManaged) => (specifier) => {
|
|
31809
31836
|
try {
|
|
31810
|
-
const resolved = Bun.resolveSync(specifier,
|
|
31837
|
+
const resolved = Bun.resolveSync(specifier, dirname37(fromFile));
|
|
31811
31838
|
return isManaged(resolved) ? resolved : undefined;
|
|
31812
31839
|
} catch {
|
|
31813
31840
|
return;
|
|
@@ -31881,11 +31908,11 @@ var init_runtime = __esm(() => {
|
|
|
31881
31908
|
});
|
|
31882
31909
|
|
|
31883
31910
|
// src/dev/hot/plugin.ts
|
|
31884
|
-
import { mkdirSync as mkdirSync14, readFileSync as
|
|
31885
|
-
import { extname as extname19, join as join59, relative as relative24, resolve as
|
|
31911
|
+
import { mkdirSync as mkdirSync14, readFileSync as readFileSync42, realpathSync as realpathSync9, writeFileSync as writeFileSync11 } from "fs";
|
|
31912
|
+
import { extname as extname19, join as join59, relative as relative24, resolve as resolve56, sep as sep8 } from "path";
|
|
31886
31913
|
var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
31887
31914
|
try {
|
|
31888
|
-
return
|
|
31915
|
+
return realpathSync9(path);
|
|
31889
31916
|
} catch {
|
|
31890
31917
|
return path;
|
|
31891
31918
|
}
|
|
@@ -31927,7 +31954,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
31927
31954
|
if (!state)
|
|
31928
31955
|
return;
|
|
31929
31956
|
try {
|
|
31930
|
-
const cached = JSON.parse(
|
|
31957
|
+
const cached = JSON.parse(readFileSync42(cachePath(state.cacheDir, key), "utf-8"));
|
|
31931
31958
|
return isAnalysis(cached) ? cached : undefined;
|
|
31932
31959
|
} catch {
|
|
31933
31960
|
return;
|
|
@@ -31961,7 +31988,7 @@ var init_plugin = __esm(() => {
|
|
|
31961
31988
|
SOURCE = /\.(?:[cm]?[jt]sx?)$/;
|
|
31962
31989
|
TEST_FILE = /(?:\.(?:spec|test)\.[cm]?[jt]sx?$)|(?:[\\/]__tests__[\\/])/;
|
|
31963
31990
|
GENERATED = /(?:^|[\\/])(?:build|generated|compiled|indexes|\.absolutejs|node_modules|dist)(?:[\\/]|$)/;
|
|
31964
|
-
ABSOLUTE_ROOT =
|
|
31991
|
+
ABSOLUTE_ROOT = resolve56(import.meta.dir, "..", "..", "..");
|
|
31965
31992
|
shared = globalThis.__absoluteHotPlugin ??= {
|
|
31966
31993
|
analyses: new Map,
|
|
31967
31994
|
installed: undefined
|
|
@@ -31970,11 +31997,11 @@ var init_plugin = __esm(() => {
|
|
|
31970
31997
|
});
|
|
31971
31998
|
|
|
31972
31999
|
// src/dev/hot/reload.ts
|
|
31973
|
-
import { readFileSync as
|
|
32000
|
+
import { readFileSync as readFileSync43, realpathSync as realpathSync10 } from "fs";
|
|
31974
32001
|
import { relative as relative25 } from "path";
|
|
31975
32002
|
var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
31976
32003
|
try {
|
|
31977
|
-
return
|
|
32004
|
+
return realpathSync10(path);
|
|
31978
32005
|
} catch {
|
|
31979
32006
|
return path;
|
|
31980
32007
|
}
|
|
@@ -32048,7 +32075,7 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
|
32048
32075
|
return { status: "entry" };
|
|
32049
32076
|
if (!moduleRecord(path) || !isHotManaged(path))
|
|
32050
32077
|
return { status: "unmanaged" };
|
|
32051
|
-
const source =
|
|
32078
|
+
const source = readFileSync43(path, "utf-8");
|
|
32052
32079
|
if (moduleRecord(path)?.source === source)
|
|
32053
32080
|
return { status: "unchanged" };
|
|
32054
32081
|
const analysis = await analyzeSource(path, source);
|
|
@@ -32137,10 +32164,10 @@ var init_reload = __esm(() => {
|
|
|
32137
32164
|
});
|
|
32138
32165
|
|
|
32139
32166
|
// src/dev/rebuildTrigger.ts
|
|
32140
|
-
import { existsSync as
|
|
32167
|
+
import { existsSync as existsSync45, readdirSync as readdirSync12, rmSync as rmSync4, statSync as statSync11 } from "fs";
|
|
32141
32168
|
import {
|
|
32142
32169
|
basename as basename20,
|
|
32143
|
-
dirname as
|
|
32170
|
+
dirname as dirname38,
|
|
32144
32171
|
isAbsolute as isAbsolute10,
|
|
32145
32172
|
join as join60,
|
|
32146
32173
|
relative as relative26,
|
|
@@ -32251,7 +32278,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32251
32278
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
32252
32279
|
}
|
|
32253
32280
|
return { ...parsed, framework: detectedFw };
|
|
32254
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
32281
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync45(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
32255
32282
|
const { config } = state;
|
|
32256
32283
|
const cwd = process.cwd();
|
|
32257
32284
|
const absDeleted = resolvePath(deletedFile).replace(/\\/g, "/");
|
|
@@ -32297,7 +32324,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32297
32324
|
if (!dependents || dependents.size === 0) {
|
|
32298
32325
|
return;
|
|
32299
32326
|
}
|
|
32300
|
-
const dependentFiles = Array.from(dependents).filter((file) =>
|
|
32327
|
+
const dependentFiles = Array.from(dependents).filter((file) => existsSync45(file));
|
|
32301
32328
|
if (dependentFiles.length === 0) {
|
|
32302
32329
|
return;
|
|
32303
32330
|
}
|
|
@@ -32313,7 +32340,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32313
32340
|
try {
|
|
32314
32341
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
32315
32342
|
affectedFiles.forEach((affectedFile) => {
|
|
32316
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
32343
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync45(affectedFile)) {
|
|
32317
32344
|
validFiles.push(affectedFile);
|
|
32318
32345
|
processedFiles.add(affectedFile);
|
|
32319
32346
|
}
|
|
@@ -32338,7 +32365,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32338
32365
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
32339
32366
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
32340
32367
|
filePathSet.forEach((filePathInSet) => {
|
|
32341
|
-
if (!
|
|
32368
|
+
if (!existsSync45(filePathInSet)) {
|
|
32342
32369
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
32343
32370
|
return;
|
|
32344
32371
|
}
|
|
@@ -32509,7 +32536,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32509
32536
|
const { buildDir } = state.resolvedPaths;
|
|
32510
32537
|
const destPath = resolvePath(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
32511
32538
|
const { mkdir, copyFile, readFile } = await import("fs/promises");
|
|
32512
|
-
await mkdir(
|
|
32539
|
+
await mkdir(dirname38(destPath), { recursive: true });
|
|
32513
32540
|
await copyFile(absSource, destPath);
|
|
32514
32541
|
const bytes = await readFile(destPath);
|
|
32515
32542
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
@@ -32621,7 +32648,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32621
32648
|
return componentFile;
|
|
32622
32649
|
}
|
|
32623
32650
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
32624
|
-
if (
|
|
32651
|
+
if (existsSync45(tsCounterpart)) {
|
|
32625
32652
|
return tsCounterpart;
|
|
32626
32653
|
}
|
|
32627
32654
|
if (!graph)
|
|
@@ -32705,7 +32732,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32705
32732
|
const keepStemsByDir = new Map;
|
|
32706
32733
|
const prefixByDir = new Map;
|
|
32707
32734
|
for (const artifact of freshOutputs) {
|
|
32708
|
-
const dir =
|
|
32735
|
+
const dir = dirname38(artifact.path);
|
|
32709
32736
|
const name = basename20(artifact.path);
|
|
32710
32737
|
const [prefix] = name.split(".");
|
|
32711
32738
|
if (!prefix)
|
|
@@ -33559,7 +33586,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33559
33586
|
}
|
|
33560
33587
|
return ctx;
|
|
33561
33588
|
}, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
|
|
33562
|
-
const existingSvelteFiles = svelteFiles.filter((file) =>
|
|
33589
|
+
const existingSvelteFiles = svelteFiles.filter((file) => existsSync45(file));
|
|
33563
33590
|
if (existingSvelteFiles.length === 0)
|
|
33564
33591
|
return;
|
|
33565
33592
|
const svelteDir = config.svelteDirectory ?? "";
|
|
@@ -34107,7 +34134,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34107
34134
|
if (!buildReference?.source) {
|
|
34108
34135
|
return;
|
|
34109
34136
|
}
|
|
34110
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(
|
|
34137
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolvePath(dirname38(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
34111
34138
|
islandFiles.add(resolvePath(sourcePath));
|
|
34112
34139
|
}, resolveIslandSourceFiles = async (config) => {
|
|
34113
34140
|
const registryPath = config.islands?.registry;
|
|
@@ -34942,7 +34969,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
34942
34969
|
// src/build/buildDepVendor.ts
|
|
34943
34970
|
import { mkdirSync as mkdirSync15 } from "fs";
|
|
34944
34971
|
import { isBuiltin as isBuiltin2 } from "module";
|
|
34945
|
-
import { join as join61 } from "path";
|
|
34972
|
+
import { join as join61, relative as relative27 } from "path";
|
|
34946
34973
|
import { rm as rm13 } from "fs/promises";
|
|
34947
34974
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
34948
34975
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -34978,7 +35005,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
34978
35005
|
const glob = new Glob10("**/*.{ts,tsx,js,jsx}");
|
|
34979
35006
|
try {
|
|
34980
35007
|
const all = await Array.fromAsync(glob.scan({ absolute: true, cwd: dir }));
|
|
34981
|
-
return all.filter((file) => !isSkippedFile(file));
|
|
35008
|
+
return all.filter((file) => !isSkippedFile(`/${relative27(dir, file).replaceAll("\\", "/")}`));
|
|
34982
35009
|
} catch {
|
|
34983
35010
|
return empty;
|
|
34984
35011
|
}
|
|
@@ -35280,13 +35307,13 @@ var init_buildDepVendor = __esm(() => {
|
|
|
35280
35307
|
import { createHash as createHash7 } from "crypto";
|
|
35281
35308
|
import {
|
|
35282
35309
|
copyFileSync as copyFileSync4,
|
|
35283
|
-
existsSync as
|
|
35310
|
+
existsSync as existsSync46,
|
|
35284
35311
|
mkdirSync as mkdirSync16,
|
|
35285
35312
|
readdirSync as readdirSync13,
|
|
35286
|
-
readFileSync as
|
|
35313
|
+
readFileSync as readFileSync44
|
|
35287
35314
|
} from "fs";
|
|
35288
35315
|
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
|
|
35316
|
+
import { basename as basename21, join as join62, resolve as resolve57 } from "path";
|
|
35290
35317
|
var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
|
|
35291
35318
|
const hash = createHash7("sha256");
|
|
35292
35319
|
hash.update(String(CACHE_FORMAT_VERSION3));
|
|
@@ -35306,7 +35333,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35306
35333
|
}
|
|
35307
35334
|
for (const dir of inputs.vendorDirs) {
|
|
35308
35335
|
hash.update("\x00v");
|
|
35309
|
-
hash.update(basename21(
|
|
35336
|
+
hash.update(basename21(resolve57(dir, "..")));
|
|
35310
35337
|
}
|
|
35311
35338
|
return hash.digest("hex").slice(0, KEY_LENGTH);
|
|
35312
35339
|
}, readLockfileHash = (projectRoot = process.cwd()) => {
|
|
@@ -35314,11 +35341,11 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35314
35341
|
let found = false;
|
|
35315
35342
|
for (const name of LOCKFILES) {
|
|
35316
35343
|
const path = join62(projectRoot, name);
|
|
35317
|
-
if (!
|
|
35344
|
+
if (!existsSync46(path))
|
|
35318
35345
|
continue;
|
|
35319
35346
|
found = true;
|
|
35320
35347
|
hash.update(name);
|
|
35321
|
-
hash.update(
|
|
35348
|
+
hash.update(readFileSync44(path));
|
|
35322
35349
|
}
|
|
35323
35350
|
return found ? hash.digest("hex") : null;
|
|
35324
35351
|
}, vendorCacheEnabled = () => process.env.ABSOLUTE_DEV_VENDOR_CACHE !== "0", copyTree = (fromDir, toDir) => {
|
|
@@ -35334,21 +35361,21 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35334
35361
|
}, copySlotsInto = (cacheDir, vendorDirs) => {
|
|
35335
35362
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35336
35363
|
const source = join62(cacheDir, slotName(index, dir));
|
|
35337
|
-
if (!
|
|
35364
|
+
if (!existsSync46(source)) {
|
|
35338
35365
|
throw new Error(`missing cached vendor dir ${source}`);
|
|
35339
35366
|
}
|
|
35340
35367
|
copyTree(source, dir);
|
|
35341
35368
|
}
|
|
35342
35369
|
}, copySlotsFrom = (stagingDir, vendorDirs) => {
|
|
35343
35370
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35344
|
-
if (!
|
|
35371
|
+
if (!existsSync46(dir))
|
|
35345
35372
|
continue;
|
|
35346
35373
|
copyTree(dir, join62(stagingDir, slotName(index, dir)));
|
|
35347
35374
|
}
|
|
35348
|
-
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) =>
|
|
35375
|
+
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve57(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename21(resolve57(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
|
|
35349
35376
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
35350
35377
|
const payloadPath = join62(cacheDir, "payload.json");
|
|
35351
|
-
if (!
|
|
35378
|
+
if (!existsSync46(payloadPath))
|
|
35352
35379
|
return null;
|
|
35353
35380
|
try {
|
|
35354
35381
|
const payload = JSON.parse(await readFile10(payloadPath, "utf8"));
|
|
@@ -35361,7 +35388,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35361
35388
|
}
|
|
35362
35389
|
}, saveVendorCache = async (key, vendorDirs, payload, projectRoot = process.cwd()) => {
|
|
35363
35390
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
35364
|
-
if (
|
|
35391
|
+
if (existsSync46(join62(cacheDir, "payload.json")))
|
|
35365
35392
|
return;
|
|
35366
35393
|
const stagingDir = `${cacheDir}.${process.pid}.tmp`;
|
|
35367
35394
|
try {
|
|
@@ -35390,9 +35417,9 @@ var init_vendorCache = __esm(() => {
|
|
|
35390
35417
|
|
|
35391
35418
|
// src/core/devBuild.ts
|
|
35392
35419
|
import { readdir as readdir6 } from "fs/promises";
|
|
35393
|
-
import { existsSync as
|
|
35394
|
-
import { resolve as
|
|
35395
|
-
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir
|
|
35420
|
+
import { existsSync as existsSync47, statSync as statSync12 } from "fs";
|
|
35421
|
+
import { resolve as resolve58 } from "path";
|
|
35422
|
+
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (config) => {
|
|
35396
35423
|
const configuredDirs = [
|
|
35397
35424
|
...collectConfigVendorSourceDirs(config),
|
|
35398
35425
|
devClientVendorSourceDir()
|
|
@@ -35415,7 +35442,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35415
35442
|
return Object.keys(config).length > 0 ? config : null;
|
|
35416
35443
|
}, reloadConfig = async () => {
|
|
35417
35444
|
try {
|
|
35418
|
-
const configPath =
|
|
35445
|
+
const configPath = resolve58(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
35419
35446
|
const source = await Bun.file(configPath).text();
|
|
35420
35447
|
return parseDirectoryConfig(source);
|
|
35421
35448
|
} catch {
|
|
@@ -35530,7 +35557,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35530
35557
|
});
|
|
35531
35558
|
}
|
|
35532
35559
|
}, handleCachedReload = async () => {
|
|
35533
|
-
const serverMtime = statSync12(
|
|
35560
|
+
const serverMtime = statSync12(resolve58(Bun.main)).mtimeMs;
|
|
35534
35561
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
35535
35562
|
globalThis.__hmrServerMtime = serverMtime;
|
|
35536
35563
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -35571,8 +35598,8 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35571
35598
|
return true;
|
|
35572
35599
|
}, resolveAbsoluteVersion2 = async () => {
|
|
35573
35600
|
const candidates = [
|
|
35574
|
-
|
|
35575
|
-
|
|
35601
|
+
resolve58(import.meta.dir, "..", "..", "package.json"),
|
|
35602
|
+
resolve58(import.meta.dir, "..", "package.json")
|
|
35576
35603
|
];
|
|
35577
35604
|
const [candidate, ...remaining] = candidates;
|
|
35578
35605
|
if (!candidate) {
|
|
@@ -35598,7 +35625,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35598
35625
|
const entries = await readdir6(vendorDir).catch(() => emptyStringArray);
|
|
35599
35626
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
35600
35627
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
35601
|
-
const bytes = await Bun.file(
|
|
35628
|
+
const bytes = await Bun.file(resolve58(vendorDir, entry)).bytes();
|
|
35602
35629
|
assetStore.set(webPath, bytes);
|
|
35603
35630
|
}));
|
|
35604
35631
|
}, devBuild = async (config) => {
|
|
@@ -35668,7 +35695,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35668
35695
|
const sourceFiles = await collectDepVendorSourceFiles(config);
|
|
35669
35696
|
const configVendorDirs = collectConfigVendorSourceDirs(config);
|
|
35670
35697
|
const prescannedVendorPaths = prescanVendorPaths(prescan, configVendorDirs);
|
|
35671
|
-
const remainingVendorDirs = prescannedVendorPaths ? sourceDirs.filter((dir) => !configVendorDirs.includes(dir) &&
|
|
35698
|
+
const remainingVendorDirs = prescannedVendorPaths ? sourceDirs.filter((dir) => !configVendorDirs.includes(dir) && existsSync47(dir)) : sourceDirs;
|
|
35672
35699
|
if (prescannedVendorPaths && remainingVendorDirs.length === 0 && sourceFiles.length === 0) {
|
|
35673
35700
|
globalThis.__depVendorPaths = prescannedVendorPaths;
|
|
35674
35701
|
} else {
|
|
@@ -35784,11 +35811,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35784
35811
|
}
|
|
35785
35812
|
stepStartedAt = performance.now();
|
|
35786
35813
|
setBootPhase("build vendor bundles");
|
|
35787
|
-
const reactVendorDir =
|
|
35788
|
-
const angularVendorDir =
|
|
35789
|
-
const svelteVendorDir =
|
|
35790
|
-
const vueVendorDir =
|
|
35791
|
-
const depVendorDir =
|
|
35814
|
+
const reactVendorDir = resolve58(state.resolvedPaths.buildDir, "react", "vendor");
|
|
35815
|
+
const angularVendorDir = resolve58(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
35816
|
+
const svelteVendorDir = resolve58(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
35817
|
+
const vueVendorDir = resolve58(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
35818
|
+
const depVendorDir = resolve58(state.resolvedPaths.buildDir, "vendor");
|
|
35792
35819
|
await Promise.resolve().then(() => init_buildDepVendor());
|
|
35793
35820
|
const activeVendorDirs = [
|
|
35794
35821
|
config.reactDirectory ? reactVendorDir : null,
|
|
@@ -35905,10 +35932,11 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir = () => resolve56(import.meta.d
|
|
|
35905
35932
|
manifest
|
|
35906
35933
|
};
|
|
35907
35934
|
globalThis.__hmrDevResult = result;
|
|
35908
|
-
globalThis.__hmrServerMtime = statSync12(
|
|
35935
|
+
globalThis.__hmrServerMtime = statSync12(resolve58(Bun.main)).mtimeMs;
|
|
35909
35936
|
return result;
|
|
35910
35937
|
};
|
|
35911
35938
|
var init_devBuild = __esm(() => {
|
|
35939
|
+
init_runtimePaths();
|
|
35912
35940
|
init_build();
|
|
35913
35941
|
init_buildReactVendor();
|
|
35914
35942
|
init_buildAngularVendor();
|
|
@@ -35936,6 +35964,7 @@ var init_devBuild = __esm(() => {
|
|
|
35936
35964
|
"htmxDirectory",
|
|
35937
35965
|
"angularDirectory"
|
|
35938
35966
|
];
|
|
35967
|
+
devClientVendorSourceDir = resolveDevClientDirectory;
|
|
35939
35968
|
});
|
|
35940
35969
|
|
|
35941
35970
|
// src/react/bridgeInternals.ts
|
|
@@ -36154,17 +36183,17 @@ var init_hmr = __esm(() => {
|
|
|
36154
36183
|
});
|
|
36155
36184
|
|
|
36156
36185
|
// src/plugins/devtoolsJson.ts
|
|
36157
|
-
import { existsSync as
|
|
36158
|
-
import { dirname as
|
|
36186
|
+
import { existsSync as existsSync48, mkdirSync as mkdirSync17, readFileSync as readFileSync45, writeFileSync as writeFileSync12 } from "fs";
|
|
36187
|
+
import { dirname as dirname39, join as join63, resolve as resolve59 } from "path";
|
|
36159
36188
|
import { Elysia as Elysia8 } from "elysia";
|
|
36160
36189
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
36161
36190
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
36162
36191
|
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 (!
|
|
36192
|
+
}, 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) => resolve59(uuidCachePath ?? join63(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
36193
|
+
if (!existsSync48(cachePath))
|
|
36165
36194
|
return null;
|
|
36166
36195
|
try {
|
|
36167
|
-
const value =
|
|
36196
|
+
const value = readFileSync45(cachePath, "utf-8").trim();
|
|
36168
36197
|
return isUuidV4(value) ? value : null;
|
|
36169
36198
|
} catch {
|
|
36170
36199
|
return null;
|
|
@@ -36182,11 +36211,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36182
36211
|
if (cachedUuid)
|
|
36183
36212
|
return setGlobalUuid(cachedUuid);
|
|
36184
36213
|
const uuid = crypto.randomUUID();
|
|
36185
|
-
mkdirSync17(
|
|
36214
|
+
mkdirSync17(dirname39(cachePath), { recursive: true });
|
|
36186
36215
|
writeFileSync12(cachePath, uuid, "utf-8");
|
|
36187
36216
|
return setGlobalUuid(uuid);
|
|
36188
36217
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
36189
|
-
const rootPath =
|
|
36218
|
+
const rootPath = resolve59(options.projectRoot ?? process.cwd());
|
|
36190
36219
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
36191
36220
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
36192
36221
|
return new Elysia8({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -36210,13 +36239,13 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36210
36239
|
var init_devtoolsJson = () => {};
|
|
36211
36240
|
|
|
36212
36241
|
// src/plugins/imageOptimizer.ts
|
|
36213
|
-
import { existsSync as
|
|
36214
|
-
import { resolve as
|
|
36242
|
+
import { existsSync as existsSync49 } from "fs";
|
|
36243
|
+
import { resolve as resolve60 } from "path";
|
|
36215
36244
|
import { Elysia as Elysia9 } from "elysia";
|
|
36216
36245
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
36217
36246
|
try {
|
|
36218
36247
|
const resolved = validateSafePath(path, baseDir);
|
|
36219
|
-
if (
|
|
36248
|
+
if (existsSync49(resolved))
|
|
36220
36249
|
return resolved;
|
|
36221
36250
|
return null;
|
|
36222
36251
|
} catch {
|
|
@@ -36224,7 +36253,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
36224
36253
|
}
|
|
36225
36254
|
}, resolveLocalImage = (url, buildDir) => {
|
|
36226
36255
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
36227
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
36256
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve60(process.cwd()));
|
|
36228
36257
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
36229
36258
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
36230
36259
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -36951,7 +36980,7 @@ import {
|
|
|
36951
36980
|
rm as rm16,
|
|
36952
36981
|
writeFile as writeFile14
|
|
36953
36982
|
} from "fs/promises";
|
|
36954
|
-
import { dirname as
|
|
36983
|
+
import { dirname as dirname40, join as join65, resolve as resolvePath3 } from "path";
|
|
36955
36984
|
import { pathToFileURL as pathToFileURL5 } from "url";
|
|
36956
36985
|
var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "current.json", BUNDLES_DIRECTORY = "bundles", ARTIFACT_FILE2 = "artifact.json", BUNDLE_ID_PATTERN, isRecord10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), errorHasCode2 = (error, code) => typeof error === "object" && error !== null && Reflect.get(error, "code") === code, bundleIdFor = (currentReleaseId, releases) => {
|
|
36957
36986
|
const identity = JSON.stringify({
|
|
@@ -36984,7 +37013,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36984
37013
|
}, writeRelease = async (root, release) => {
|
|
36985
37014
|
const directory = join65(root, release.artifact.releaseId);
|
|
36986
37015
|
const producerPath = join65(directory, release.artifact.producer.module);
|
|
36987
|
-
await mkdir16(
|
|
37016
|
+
await mkdir16(dirname40(producerPath), { recursive: true });
|
|
36988
37017
|
await Promise.all([
|
|
36989
37018
|
writeFile14(join65(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
|
|
36990
37019
|
`),
|
|
@@ -37273,7 +37302,7 @@ var init_compatibilityDispatcher = __esm(() => {
|
|
|
37273
37302
|
});
|
|
37274
37303
|
|
|
37275
37304
|
// src/core/prerender.ts
|
|
37276
|
-
import { mkdirSync as mkdirSync18, readFileSync as
|
|
37305
|
+
import { mkdirSync as mkdirSync18, readFileSync as readFileSync46 } from "fs";
|
|
37277
37306
|
import { join as join66 } from "path";
|
|
37278
37307
|
var DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
37279
37308
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
@@ -37281,7 +37310,7 @@ var DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Preren
|
|
|
37281
37310
|
}, readTimestamp = (htmlPath) => {
|
|
37282
37311
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
37283
37312
|
try {
|
|
37284
|
-
const content =
|
|
37313
|
+
const content = readFileSync46(metaPath, "utf-8");
|
|
37285
37314
|
return Number(content) || 0;
|
|
37286
37315
|
} catch {
|
|
37287
37316
|
return 0;
|
|
@@ -37317,8 +37346,8 @@ var init_prerender = () => {};
|
|
|
37317
37346
|
|
|
37318
37347
|
// src/core/prepare.ts
|
|
37319
37348
|
import { createHash as createHash11 } from "crypto";
|
|
37320
|
-
import { existsSync as
|
|
37321
|
-
import { basename as basename22, join as join67, relative as
|
|
37349
|
+
import { existsSync as existsSync50, readdirSync as readdirSync14, readFileSync as readFileSync47 } from "fs";
|
|
37350
|
+
import { basename as basename22, join as join67, relative as relative28, resolve as resolvePath4 } from "path";
|
|
37322
37351
|
import { Elysia as Elysia12, NotFound } from "elysia";
|
|
37323
37352
|
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
|
|
37324
37353
|
setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
@@ -37407,7 +37436,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37407
37436
|
return files;
|
|
37408
37437
|
}, PREWARM_MAX_PAUSE_MS = 60000, toWarmTasks = function* (files, warmCache, srcUrlPrefix) {
|
|
37409
37438
|
for (const file of files) {
|
|
37410
|
-
const rel =
|
|
37439
|
+
const rel = relative28(process.cwd(), file).replace(/\\/g, "/");
|
|
37411
37440
|
yield () => warmCache(`${srcUrlPrefix}${rel}`);
|
|
37412
37441
|
}
|
|
37413
37442
|
}, builtPageSources = () => {
|
|
@@ -37446,9 +37475,9 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37446
37475
|
if (!fileName)
|
|
37447
37476
|
continue;
|
|
37448
37477
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
37449
|
-
if (!
|
|
37478
|
+
if (!existsSync50(srcPath))
|
|
37450
37479
|
continue;
|
|
37451
|
-
manifest[key] = `${SRC_URL_PREFIX}${encodeSrcPath(
|
|
37480
|
+
manifest[key] = `${SRC_URL_PREFIX}${encodeSrcPath(relative28(process.cwd(), srcPath))}`;
|
|
37452
37481
|
}
|
|
37453
37482
|
}, ICON_HASH_LENGTH = 8, registerIconVersioning = (buildDir) => {
|
|
37454
37483
|
const cache = new Map;
|
|
@@ -37461,8 +37490,8 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37461
37490
|
const path = href.split("?")[0] ?? href;
|
|
37462
37491
|
const filePath = join67(buildDir, path);
|
|
37463
37492
|
let versioned = href;
|
|
37464
|
-
if (
|
|
37465
|
-
const hash = createHash11("sha256").update(
|
|
37493
|
+
if (existsSync50(filePath)) {
|
|
37494
|
+
const hash = createHash11("sha256").update(readFileSync47(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
37466
37495
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
37467
37496
|
}
|
|
37468
37497
|
cache.set(href, versioned);
|
|
@@ -37583,7 +37612,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37583
37612
|
};
|
|
37584
37613
|
}, loadPrerenderMap = (prerenderDir) => {
|
|
37585
37614
|
const map = new Map;
|
|
37586
|
-
if (!
|
|
37615
|
+
if (!existsSync50(prerenderDir))
|
|
37587
37616
|
return map;
|
|
37588
37617
|
let entries;
|
|
37589
37618
|
try {
|
|
@@ -37601,7 +37630,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37601
37630
|
return map;
|
|
37602
37631
|
}, loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
37603
37632
|
const root = join67(buildDir, ".absolutejs", "mobile-compatibility");
|
|
37604
|
-
if (!
|
|
37633
|
+
if (!existsSync50(join67(root, "current.json"))) {
|
|
37605
37634
|
return new Elysia12({ name: "absolutejs-mobile-compatibility-empty" });
|
|
37606
37635
|
}
|
|
37607
37636
|
const [
|
|
@@ -37657,7 +37686,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37657
37686
|
return result;
|
|
37658
37687
|
}
|
|
37659
37688
|
stepStartedAt = performance.now();
|
|
37660
|
-
const manifest = JSON.parse(
|
|
37689
|
+
const manifest = JSON.parse(readFileSync47(`${buildDir}/manifest.json`, "utf-8"));
|
|
37661
37690
|
setCurrentIslandManifest(manifest);
|
|
37662
37691
|
if (config.islands?.registry) {
|
|
37663
37692
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -37666,13 +37695,13 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37666
37695
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
37667
37696
|
stepStartedAt = performance.now();
|
|
37668
37697
|
const conventionsPath = join67(buildDir, "conventions.json");
|
|
37669
|
-
if (
|
|
37670
|
-
const conventions = JSON.parse(
|
|
37698
|
+
if (existsSync50(conventionsPath)) {
|
|
37699
|
+
const conventions = JSON.parse(readFileSync47(conventionsPath, "utf-8"));
|
|
37671
37700
|
setConventions(conventions);
|
|
37672
37701
|
}
|
|
37673
37702
|
const spaRoutesPath = join67(buildDir, "spa-routes.json");
|
|
37674
|
-
if (
|
|
37675
|
-
setSpaRouteManifest(JSON.parse(
|
|
37703
|
+
if (existsSync50(spaRoutesPath)) {
|
|
37704
|
+
setSpaRouteManifest(JSON.parse(readFileSync47(spaRoutesPath, "utf-8")));
|
|
37676
37705
|
}
|
|
37677
37706
|
recordStep("load production conventions", stepStartedAt);
|
|
37678
37707
|
stepStartedAt = performance.now();
|
|
@@ -37688,7 +37717,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37688
37717
|
name: "absolutejs-generated-assets"
|
|
37689
37718
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
37690
37719
|
const requestedPath = resolvePath4(generatedAssetsRoot, params["*"]);
|
|
37691
|
-
if (
|
|
37720
|
+
if (relative28(generatedAssetsRoot, requestedPath).startsWith("..")) {
|
|
37692
37721
|
set.status = 404;
|
|
37693
37722
|
return "Not Found";
|
|
37694
37723
|
}
|
|
@@ -37835,17 +37864,17 @@ __export(exports_serverEntryWatcher, {
|
|
|
37835
37864
|
});
|
|
37836
37865
|
import {
|
|
37837
37866
|
copyFileSync as copyFileSync6,
|
|
37838
|
-
existsSync as
|
|
37867
|
+
existsSync as existsSync52,
|
|
37839
37868
|
readdirSync as readdirSync16,
|
|
37840
|
-
readFileSync as
|
|
37869
|
+
readFileSync as readFileSync50,
|
|
37841
37870
|
statSync as statSync13,
|
|
37842
37871
|
watch as watch2
|
|
37843
37872
|
} from "fs";
|
|
37844
37873
|
import { createHash as createHash12 } from "crypto";
|
|
37845
|
-
import { dirname as
|
|
37874
|
+
import { dirname as dirname41, join as join70, resolve as resolve61 } from "path";
|
|
37846
37875
|
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
37876
|
try {
|
|
37848
|
-
return createHash12("sha256").update(
|
|
37877
|
+
return createHash12("sha256").update(readFileSync50(path)).digest("hex");
|
|
37849
37878
|
} catch {
|
|
37850
37879
|
return null;
|
|
37851
37880
|
}
|
|
@@ -37866,15 +37895,15 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
37866
37895
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
37867
37896
|
return;
|
|
37868
37897
|
const originalEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
37869
|
-
if (!originalEntry || !
|
|
37898
|
+
if (!originalEntry || !existsSync52(originalEntry))
|
|
37870
37899
|
return;
|
|
37871
37900
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
37872
37901
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
37873
|
-
const entryPath =
|
|
37874
|
-
const entryDir =
|
|
37902
|
+
const entryPath = resolve61(originalEntry);
|
|
37903
|
+
const entryDir = dirname41(entryPath);
|
|
37875
37904
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
37876
|
-
const configPath =
|
|
37877
|
-
const configDir =
|
|
37905
|
+
const configPath = resolve61(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
37906
|
+
const configDir = dirname41(configPath);
|
|
37878
37907
|
const configBase = configPath.slice(configDir.length + 1);
|
|
37879
37908
|
const recentlyHandled = new Map;
|
|
37880
37909
|
let entryReloadTimer = null;
|
|
@@ -38504,9 +38533,9 @@ init_hotResources();
|
|
|
38504
38533
|
// src/dev/devCert.ts
|
|
38505
38534
|
import {
|
|
38506
38535
|
copyFileSync as copyFileSync5,
|
|
38507
|
-
existsSync as
|
|
38536
|
+
existsSync as existsSync51,
|
|
38508
38537
|
mkdirSync as mkdirSync19,
|
|
38509
|
-
readFileSync as
|
|
38538
|
+
readFileSync as readFileSync48,
|
|
38510
38539
|
rmSync as rmSync5
|
|
38511
38540
|
} from "fs";
|
|
38512
38541
|
import { X509Certificate as X509Certificate4 } from "crypto";
|
|
@@ -38520,7 +38549,7 @@ var DEFAULT_CERTIFICATE_HOSTS = ["localhost", "127.0.0.1", "::1"];
|
|
|
38520
38549
|
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
38550
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
38522
38551
|
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 = () =>
|
|
38552
|
+
var certFilesExist = () => existsSync51(CERT_PATH) && existsSync51(KEY_PATH);
|
|
38524
38553
|
var normalizeDevCertificateHosts = (hosts = []) => {
|
|
38525
38554
|
const normalized = new Set(DEFAULT_CERTIFICATE_HOSTS);
|
|
38526
38555
|
for (const host of hosts) {
|
|
@@ -38536,7 +38565,7 @@ var normalizeDevCertificateHosts = (hosts = []) => {
|
|
|
38536
38565
|
};
|
|
38537
38566
|
var certificateIsUsable = (hosts) => {
|
|
38538
38567
|
try {
|
|
38539
|
-
const certPem =
|
|
38568
|
+
const certPem = readFileSync48(CERT_PATH, "utf-8");
|
|
38540
38569
|
const certificate = new X509Certificate4(certPem);
|
|
38541
38570
|
if (new Date(certificate.validTo).getTime() <= Date.now())
|
|
38542
38571
|
return false;
|
|
@@ -38628,8 +38657,8 @@ var loadDevCert = (hosts = []) => {
|
|
|
38628
38657
|
return null;
|
|
38629
38658
|
try {
|
|
38630
38659
|
return {
|
|
38631
|
-
cert:
|
|
38632
|
-
key:
|
|
38660
|
+
cert: readFileSync48(paths.cert, "utf-8"),
|
|
38661
|
+
key: readFileSync48(paths.key, "utf-8")
|
|
38633
38662
|
};
|
|
38634
38663
|
} catch {
|
|
38635
38664
|
return null;
|
|
@@ -38668,7 +38697,7 @@ var signalParentPortHandoff = (port) => {
|
|
|
38668
38697
|
// src/utils/instanceRegistry.ts
|
|
38669
38698
|
import {
|
|
38670
38699
|
mkdirSync as mkdirSync20,
|
|
38671
|
-
readFileSync as
|
|
38700
|
+
readFileSync as readFileSync49,
|
|
38672
38701
|
readdirSync as readdirSync15,
|
|
38673
38702
|
unlinkSync as unlinkSync2,
|
|
38674
38703
|
writeFileSync as writeFileSync13
|
|
@@ -38701,7 +38730,7 @@ var registerExitHandlerOnce = () => {
|
|
|
38701
38730
|
};
|
|
38702
38731
|
var readJsonFile = (path) => {
|
|
38703
38732
|
try {
|
|
38704
|
-
return JSON.parse(
|
|
38733
|
+
return JSON.parse(readFileSync49(path, "utf-8"));
|
|
38705
38734
|
} catch {
|
|
38706
38735
|
return null;
|
|
38707
38736
|
}
|
|
@@ -39194,8 +39223,8 @@ var serializeSpeculationRules = (rules) => {
|
|
|
39194
39223
|
};
|
|
39195
39224
|
// src/utils/defineEnv.ts
|
|
39196
39225
|
var {env: bunEnv } = globalThis.Bun;
|
|
39197
|
-
import { existsSync as
|
|
39198
|
-
import { resolve as
|
|
39226
|
+
import { existsSync as existsSync53, readFileSync as readFileSync51 } from "fs";
|
|
39227
|
+
import { resolve as resolve62 } from "path";
|
|
39199
39228
|
|
|
39200
39229
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
39201
39230
|
function IsAsyncIterator(value) {
|
|
@@ -43722,19 +43751,19 @@ ${lines.join(`
|
|
|
43722
43751
|
};
|
|
43723
43752
|
var checkEnvFileSecurity = (properties) => {
|
|
43724
43753
|
const cwd = process.cwd();
|
|
43725
|
-
const envPath =
|
|
43726
|
-
if (!
|
|
43754
|
+
const envPath = resolve62(cwd, ".env");
|
|
43755
|
+
if (!existsSync53(envPath))
|
|
43727
43756
|
return;
|
|
43728
43757
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
43729
43758
|
if (sensitiveKeys.length === 0)
|
|
43730
43759
|
return;
|
|
43731
|
-
const envContent =
|
|
43760
|
+
const envContent = readFileSync51(envPath, "utf-8");
|
|
43732
43761
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
43733
43762
|
if (presentKeys.length === 0)
|
|
43734
43763
|
return;
|
|
43735
|
-
const gitignorePath =
|
|
43736
|
-
if (
|
|
43737
|
-
const gitignore =
|
|
43764
|
+
const gitignorePath = resolve62(cwd, ".gitignore");
|
|
43765
|
+
if (existsSync53(gitignorePath)) {
|
|
43766
|
+
const gitignore = readFileSync51(gitignorePath, "utf-8");
|
|
43738
43767
|
if (gitignore.split(`
|
|
43739
43768
|
`).some((line) => line.trim() === ".env"))
|
|
43740
43769
|
return;
|
|
@@ -43766,8 +43795,8 @@ var getEnv = (key) => {
|
|
|
43766
43795
|
return environmentVariable;
|
|
43767
43796
|
};
|
|
43768
43797
|
// src/utils/projectRoot.ts
|
|
43769
|
-
import { existsSync as
|
|
43770
|
-
import { dirname as
|
|
43798
|
+
import { existsSync as existsSync54 } from "fs";
|
|
43799
|
+
import { dirname as dirname42, resolve as resolve63 } from "path";
|
|
43771
43800
|
var CONFIG_CANDIDATES = [
|
|
43772
43801
|
"absolute.config.ts",
|
|
43773
43802
|
"absolute.config.js",
|
|
@@ -43776,7 +43805,7 @@ var CONFIG_CANDIDATES = [
|
|
|
43776
43805
|
"absolute.config.mts",
|
|
43777
43806
|
"absolute.config.cts"
|
|
43778
43807
|
];
|
|
43779
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) =>
|
|
43808
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync54(resolve63(directory, name)));
|
|
43780
43809
|
var findProjectRoot = () => {
|
|
43781
43810
|
const start = process.cwd();
|
|
43782
43811
|
let packageRoot = null;
|
|
@@ -43785,10 +43814,10 @@ var findProjectRoot = () => {
|
|
|
43785
43814
|
if (hasAbsoluteConfig(directory)) {
|
|
43786
43815
|
return directory;
|
|
43787
43816
|
}
|
|
43788
|
-
if (packageRoot === null &&
|
|
43817
|
+
if (packageRoot === null && existsSync54(resolve63(directory, "package.json"))) {
|
|
43789
43818
|
packageRoot = directory;
|
|
43790
43819
|
}
|
|
43791
|
-
const parent =
|
|
43820
|
+
const parent = dirname42(directory);
|
|
43792
43821
|
if (parent === directory) {
|
|
43793
43822
|
return packageRoot ?? start;
|
|
43794
43823
|
}
|
|
@@ -44055,5 +44084,5 @@ export {
|
|
|
44055
44084
|
wrapPageHandlerWithStreamingSlots
|
|
44056
44085
|
};
|
|
44057
44086
|
|
|
44058
|
-
//# debugId=
|
|
44087
|
+
//# debugId=FCB0A64F35B3AA2D64756E2164756E21
|
|
44059
44088
|
//# sourceMappingURL=index.js.map
|