@absolutejs/absolute 0.19.0-beta.772 → 0.19.0-beta.773
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/index.js +94 -78
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +94 -78
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +350 -299
- package/dist/build.js.map +5 -5
- package/dist/cli/index.js +27 -3
- package/dist/client/index.js +27 -11
- package/dist/client/index.js.map +4 -4
- package/dist/index.js +408 -357
- package/dist/index.js.map +5 -5
- package/dist/islands/index.js +52 -36
- package/dist/islands/index.js.map +4 -4
- package/dist/react/browser.js +7 -7
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/browser/index.js +101 -101
- package/dist/react/components/index.js +104 -104
- package/dist/react/components/index.js.map +2 -2
- package/dist/react/index.js +63 -47
- package/dist/react/index.js.map +4 -4
- package/dist/react/server.js +2 -2
- package/dist/react/server.js.map +1 -1
- package/dist/src/angular/resolveAngularPackage.d.ts +6 -4
- package/dist/svelte/index.js +29 -13
- package/dist/svelte/index.js.map +4 -4
- package/dist/svelte/server.js +3 -3
- package/dist/svelte/server.js.map +1 -1
- package/dist/vue/index.js +53 -37
- package/dist/vue/index.js.map +4 -4
- package/dist/vue/server.js +2 -2
- package/dist/vue/server.js.map +1 -1
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -1718,9 +1718,9 @@ var init_streamingSlots = __esm(() => {
|
|
|
1718
1718
|
});
|
|
1719
1719
|
|
|
1720
1720
|
// src/angular/resolveAngularPackage.ts
|
|
1721
|
-
import { existsSync as existsSync2 } from "fs";
|
|
1722
|
-
import { resolve as resolve3 } from "path";
|
|
1723
|
-
var
|
|
1721
|
+
import { existsSync as existsSync2, readFileSync } from "fs";
|
|
1722
|
+
import { join as join3, resolve as resolve3 } from "path";
|
|
1723
|
+
var resolveAngularPackageDir = (specifier) => {
|
|
1724
1724
|
const fromCompiledRuntime = process.env.ABSOLUTE_BUILD_DIR ? resolve3(process.env.ABSOLUTE_BUILD_DIR, "node_modules", specifier) : null;
|
|
1725
1725
|
if (fromCompiledRuntime && existsSync2(fromCompiledRuntime)) {
|
|
1726
1726
|
return fromCompiledRuntime;
|
|
@@ -1729,13 +1729,27 @@ var resolveAngularPackage = (specifier) => {
|
|
|
1729
1729
|
if (existsSync2(fromProject)) {
|
|
1730
1730
|
return fromProject;
|
|
1731
1731
|
}
|
|
1732
|
+
return null;
|
|
1733
|
+
}, resolvePackageEntry = (packageDir) => {
|
|
1734
|
+
try {
|
|
1735
|
+
const pkg = JSON.parse(readFileSync(join3(packageDir, "package.json"), "utf-8"));
|
|
1736
|
+
const rootExport = pkg.exports?.["."];
|
|
1737
|
+
const entry = (typeof rootExport === "string" ? rootExport : rootExport?.default) ?? pkg.module ?? pkg.main ?? "index.js";
|
|
1738
|
+
return join3(packageDir, entry);
|
|
1739
|
+
} catch {
|
|
1740
|
+
return packageDir;
|
|
1741
|
+
}
|
|
1742
|
+
}, resolveAngularPackage = (specifier) => {
|
|
1743
|
+
const packageDir = resolveAngularPackageDir(specifier);
|
|
1744
|
+
if (packageDir)
|
|
1745
|
+
return resolvePackageEntry(packageDir);
|
|
1732
1746
|
return specifier;
|
|
1733
1747
|
};
|
|
1734
1748
|
var init_resolveAngularPackage = () => {};
|
|
1735
1749
|
|
|
1736
1750
|
// src/angular/injectorPatch.ts
|
|
1737
|
-
import { existsSync as existsSync3, readFileSync, writeFileSync as writeFileSync2 } from "fs";
|
|
1738
|
-
import { dirname as dirname2, join as
|
|
1751
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
1752
|
+
import { dirname as dirname2, join as join4 } from "path";
|
|
1739
1753
|
var applyInjectorPatch = (chunkPath, content) => {
|
|
1740
1754
|
if (content.includes('Symbol.for("angular.currentInjector")')) {
|
|
1741
1755
|
return;
|
|
@@ -1771,16 +1785,16 @@ var applyInjectorPatch = (chunkPath, content) => {
|
|
|
1771
1785
|
}
|
|
1772
1786
|
writeFileSync2(chunkPath, patched, "utf-8");
|
|
1773
1787
|
}, resolveAngularCoreDir = () => {
|
|
1774
|
-
const resolved =
|
|
1775
|
-
if (existsSync3(
|
|
1788
|
+
const resolved = resolveAngularPackageDir("@angular/core");
|
|
1789
|
+
if (resolved && existsSync3(join4(resolved, "package.json"))) {
|
|
1776
1790
|
return resolved;
|
|
1777
1791
|
}
|
|
1778
1792
|
return dirname2(__require.resolve("@angular/core/package.json"));
|
|
1779
1793
|
}, patchAngularInjectorSingleton = () => {
|
|
1780
1794
|
try {
|
|
1781
1795
|
const coreDir = resolveAngularCoreDir();
|
|
1782
|
-
const chunkPath =
|
|
1783
|
-
const content =
|
|
1796
|
+
const chunkPath = join4(coreDir, "fesm2022", "_not_found-chunk.mjs");
|
|
1797
|
+
const content = readFileSync2(chunkPath, "utf-8");
|
|
1784
1798
|
applyInjectorPatch(chunkPath, content);
|
|
1785
1799
|
} catch {}
|
|
1786
1800
|
};
|
|
@@ -1949,7 +1963,9 @@ var initDominoAdapter = (platformServer) => {
|
|
|
1949
1963
|
import(resolveAngularPackage("@angular/common")),
|
|
1950
1964
|
import(resolveAngularPackage("@angular/core"))
|
|
1951
1965
|
]);
|
|
1952
|
-
if (
|
|
1966
|
+
if (true) {
|
|
1967
|
+
core.enableProdMode();
|
|
1968
|
+
}
|
|
1953
1969
|
initDominoAdapter(platformServer);
|
|
1954
1970
|
return {
|
|
1955
1971
|
APP_BASE_HREF: common.APP_BASE_HREF,
|
|
@@ -2392,8 +2408,8 @@ var init_islandSsr = __esm(() => {
|
|
|
2392
2408
|
});
|
|
2393
2409
|
|
|
2394
2410
|
// src/build/resolvePackageImport.ts
|
|
2395
|
-
import { resolve as resolve4, join as
|
|
2396
|
-
import { existsSync as existsSync4, readFileSync as
|
|
2411
|
+
import { resolve as resolve4, join as join5 } from "path";
|
|
2412
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
|
|
2397
2413
|
var resolveExportPath = (entry, conditions) => {
|
|
2398
2414
|
if (typeof entry === "string")
|
|
2399
2415
|
return entry;
|
|
@@ -2415,14 +2431,14 @@ var resolveExportPath = (entry, conditions) => {
|
|
|
2415
2431
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
2416
2432
|
const exportKey = subpath ? `./${subpath}` : ".";
|
|
2417
2433
|
const currentPackageJsonPath = resolve4(process.cwd(), "package.json");
|
|
2418
|
-
const currentPackageJson = existsSync4(currentPackageJsonPath) ? JSON.parse(
|
|
2434
|
+
const currentPackageJson = existsSync4(currentPackageJsonPath) ? JSON.parse(readFileSync3(currentPackageJsonPath, "utf-8")) : null;
|
|
2419
2435
|
const currentPackageDir = currentPackageJson?.name === packageName ? process.cwd() : null;
|
|
2420
2436
|
const packageDir = currentPackageDir ?? resolve4(process.cwd(), "node_modules", packageName ?? "");
|
|
2421
|
-
const packageJsonPath =
|
|
2437
|
+
const packageJsonPath = join5(packageDir, "package.json");
|
|
2422
2438
|
if (!existsSync4(packageJsonPath))
|
|
2423
2439
|
return null;
|
|
2424
2440
|
try {
|
|
2425
|
-
const packageJson = currentPackageDir && currentPackageJson ? currentPackageJson : JSON.parse(
|
|
2441
|
+
const packageJson = currentPackageDir && currentPackageJson ? currentPackageJson : JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
|
|
2426
2442
|
const { exports } = packageJson;
|
|
2427
2443
|
if (!exports)
|
|
2428
2444
|
return null;
|
|
@@ -2586,10 +2602,10 @@ __export(exports_stylePreprocessor, {
|
|
|
2586
2602
|
compileStyleFileIfNeededSync: () => compileStyleFileIfNeededSync,
|
|
2587
2603
|
compileStyleFileIfNeeded: () => compileStyleFileIfNeeded
|
|
2588
2604
|
});
|
|
2589
|
-
import { existsSync as existsSync5, readFileSync as
|
|
2605
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
|
|
2590
2606
|
import { readFile } from "fs/promises";
|
|
2591
2607
|
import { createRequire } from "module";
|
|
2592
|
-
import { dirname as dirname3, extname as extname3, isAbsolute, join as
|
|
2608
|
+
import { dirname as dirname3, extname as extname3, isAbsolute, join as join6, relative as relative3, resolve as resolve5 } from "path";
|
|
2593
2609
|
import { fileURLToPath } from "url";
|
|
2594
2610
|
var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, requireFromCwd, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less|styl(?:us)?)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less|styl(?:us)?)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
|
|
2595
2611
|
const normalized = filePathOrLanguage.toLowerCase();
|
|
@@ -2626,7 +2642,7 @@ var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTE
|
|
|
2626
2642
|
return empty;
|
|
2627
2643
|
}
|
|
2628
2644
|
try {
|
|
2629
|
-
const parsed = JSON.parse(stripJsonComments(
|
|
2645
|
+
const parsed = JSON.parse(stripJsonComments(readFileSync4(tsconfigPath, "utf-8")));
|
|
2630
2646
|
const compilerOptions = parsed.compilerOptions ?? {};
|
|
2631
2647
|
const baseUrl = resolve5(cwd, compilerOptions.baseUrl ?? ".");
|
|
2632
2648
|
tsconfigAliasCache = {
|
|
@@ -2667,13 +2683,13 @@ var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTE
|
|
|
2667
2683
|
const ext = extname3(basePath);
|
|
2668
2684
|
const paths = ext ? [basePath] : getLanguageExtensions(language).flatMap((extension) => [
|
|
2669
2685
|
`${basePath}${extension}`,
|
|
2670
|
-
|
|
2686
|
+
join6(basePath, `index${extension}`)
|
|
2671
2687
|
]);
|
|
2672
2688
|
if (language === "scss" || language === "sass") {
|
|
2673
2689
|
return paths.flatMap((path) => {
|
|
2674
2690
|
const dir = dirname3(path);
|
|
2675
2691
|
const base = path.slice(dir.length + 1);
|
|
2676
|
-
return [path,
|
|
2692
|
+
return [path, join6(dir, `_${base}`)];
|
|
2677
2693
|
});
|
|
2678
2694
|
}
|
|
2679
2695
|
return paths;
|
|
@@ -2749,7 +2765,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
2749
2765
|
const config = normalizePostcssModule(loaded);
|
|
2750
2766
|
const value = typeof config === "function" ? await config({
|
|
2751
2767
|
cwd: process.cwd(),
|
|
2752
|
-
env: "
|
|
2768
|
+
env: "test"
|
|
2753
2769
|
}) : config;
|
|
2754
2770
|
return normalizePostcssModule(value) ?? {};
|
|
2755
2771
|
}, normalizePostcssPlugins = (plugins) => {
|
|
@@ -2814,7 +2830,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
2814
2830
|
if (fileLanguage !== "scss" && fileLanguage !== "sass" && fileLanguage !== null)
|
|
2815
2831
|
return null;
|
|
2816
2832
|
return {
|
|
2817
|
-
contents: preprocessLoadedStyle(
|
|
2833
|
+
contents: preprocessLoadedStyle(readFileSync4(filePath, "utf-8"), filePath, entryFile, loadPaths, language, config),
|
|
2818
2834
|
syntax: filePath.endsWith(".sass") ? "indented" : "scss"
|
|
2819
2835
|
};
|
|
2820
2836
|
}
|
|
@@ -2975,7 +2991,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
2975
2991
|
}
|
|
2976
2992
|
return compileStyleSource(filePath, undefined, undefined, config);
|
|
2977
2993
|
}, compileStyleFileIfNeededSync = (filePath, config) => {
|
|
2978
|
-
const rawContents =
|
|
2994
|
+
const rawContents = readFileSync4(filePath, "utf-8");
|
|
2979
2995
|
const language = getStyleLanguage(filePath);
|
|
2980
2996
|
if (config?.postcss) {
|
|
2981
2997
|
throw new Error(`Unable to compile ${filePath}: PostCSS preprocessing is async-only.`);
|
|
@@ -3016,19 +3032,19 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
3016
3032
|
STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less|styl(?:us)?)$/i;
|
|
3017
3033
|
importOptionalPeer = new Function("specifier", "return import(specifier)");
|
|
3018
3034
|
requireOptionalPeer = new Function("specifier", "return require(specifier)");
|
|
3019
|
-
requireFromCwd = createRequire(
|
|
3035
|
+
requireFromCwd = createRequire(join6(process.cwd(), "package.json"));
|
|
3020
3036
|
stylePreprocessorPlugin = createStylePreprocessorPlugin();
|
|
3021
3037
|
});
|
|
3022
3038
|
|
|
3023
3039
|
// src/core/svelteServerModule.ts
|
|
3024
3040
|
import { mkdir, readdir as readdir2 } from "fs/promises";
|
|
3025
|
-
import { basename as basename2, dirname as dirname4, extname as extname4, join as
|
|
3041
|
+
import { basename as basename2, dirname as dirname4, extname as extname4, join as join7, relative as relative4, resolve as resolve6 } from "path";
|
|
3026
3042
|
var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
3027
3043
|
const importPath = relative4(dirname4(from), target).replace(/\\/g, "/");
|
|
3028
3044
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
3029
3045
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
3030
3046
|
for (const entry of entries) {
|
|
3031
|
-
const entryPath =
|
|
3047
|
+
const entryPath = join7(dir, entry.name);
|
|
3032
3048
|
if (entry.isDirectory())
|
|
3033
3049
|
stack.push(entryPath);
|
|
3034
3050
|
if (entry.isFile() && entry.name === targetFileName) {
|
|
@@ -3058,11 +3074,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
3058
3074
|
if (cachedPath !== undefined) {
|
|
3059
3075
|
return cachedPath;
|
|
3060
3076
|
}
|
|
3061
|
-
if (!sourcePath.includes(`${
|
|
3077
|
+
if (!sourcePath.includes(`${join7(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
|
|
3062
3078
|
originalSourcePathCache.set(sourcePath, sourcePath);
|
|
3063
3079
|
return sourcePath;
|
|
3064
3080
|
}
|
|
3065
|
-
const resolvedSourcePath = await findSourceFileByBasename(
|
|
3081
|
+
const resolvedSourcePath = await findSourceFileByBasename(join7(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
|
|
3066
3082
|
const nextPath = resolvedSourcePath ?? sourcePath;
|
|
3067
3083
|
originalSourcePathCache.set(sourcePath, nextPath);
|
|
3068
3084
|
return nextPath;
|
|
@@ -3078,11 +3094,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
3078
3094
|
`${basePath}.mjs`,
|
|
3079
3095
|
`${basePath}.cjs`,
|
|
3080
3096
|
`${basePath}.json`,
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3097
|
+
join7(basePath, "index.ts"),
|
|
3098
|
+
join7(basePath, "index.js"),
|
|
3099
|
+
join7(basePath, "index.mjs"),
|
|
3100
|
+
join7(basePath, "index.cjs"),
|
|
3101
|
+
join7(basePath, "index.json")
|
|
3086
3102
|
];
|
|
3087
3103
|
const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
|
|
3088
3104
|
const foundIndex = existResults.indexOf(true);
|
|
@@ -3090,7 +3106,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
3090
3106
|
}, getCachedModulePath = (sourcePath) => {
|
|
3091
3107
|
const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
3092
3108
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
3093
|
-
return
|
|
3109
|
+
return join7(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
3094
3110
|
}, resolveSvelteImport = async (spec, from) => {
|
|
3095
3111
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
3096
3112
|
const resolved = resolvePackageImport(spec);
|
|
@@ -3191,7 +3207,7 @@ var init_svelteServerModule = __esm(() => {
|
|
|
3191
3207
|
init_lowerIslandSyntax();
|
|
3192
3208
|
init_lowerAwaitSlotSyntax();
|
|
3193
3209
|
init_stylePreprocessor();
|
|
3194
|
-
serverCacheRoot =
|
|
3210
|
+
serverCacheRoot = join7(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
3195
3211
|
compiledModuleCache = new Map;
|
|
3196
3212
|
originalSourcePathCache = new Map;
|
|
3197
3213
|
transpiler = new Bun.Transpiler({
|
|
@@ -3414,7 +3430,7 @@ var init_staticStreaming = __esm(() => {
|
|
|
3414
3430
|
});
|
|
3415
3431
|
|
|
3416
3432
|
// src/build/staticIslandPages.ts
|
|
3417
|
-
import { readFileSync as
|
|
3433
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
3418
3434
|
var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/(?:absolute-island|island)>)", ATTRIBUTE_RE_SOURCE = `([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, islandFrameworks, islandHydrationModes, isRecord5 = (value) => typeof value === "object" && value !== null, isIslandFramework = (value) => islandFrameworks.some((framework) => framework === value), isIslandHydrationMode = (value) => islandHydrationModes.some((mode) => mode === value), parseHtmlAttributes = (attributeString) => {
|
|
3419
3435
|
const attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, "g");
|
|
3420
3436
|
const attributes = new Map;
|
|
@@ -3543,7 +3559,7 @@ var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:
|
|
|
3543
3559
|
}
|
|
3544
3560
|
return result + originalHtml.slice(nextIndex);
|
|
3545
3561
|
}, transformStaticPage = async (pagePath, registry) => {
|
|
3546
|
-
const originalHtml =
|
|
3562
|
+
const originalHtml = readFileSync5(pagePath, "utf-8");
|
|
3547
3563
|
const transformedHtml = await transformStaticPageHtml(originalHtml, registry);
|
|
3548
3564
|
if (transformedHtml !== originalHtml) {
|
|
3549
3565
|
writeFileSync3(pagePath, transformedHtml);
|
|
@@ -8569,6 +8585,7 @@ __export(exports_tailwindCompiler, {
|
|
|
8569
8585
|
disposeTailwindCompiler: () => disposeTailwindCompiler
|
|
8570
8586
|
});
|
|
8571
8587
|
import { createHash } from "crypto";
|
|
8588
|
+
import { existsSync as existsSync9, readFileSync as readFileSync6 } from "fs";
|
|
8572
8589
|
import { readFile as readFile2, stat } from "fs/promises";
|
|
8573
8590
|
import { dirname as dirname5, isAbsolute as isAbsolute2, resolve as resolve7 } from "path";
|
|
8574
8591
|
var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async () => {
|
|
@@ -8588,8 +8605,42 @@ var compilerCache, cachedTailwindCompile = null, loadTailwindCompile = async ()
|
|
|
8588
8605
|
} catch {
|
|
8589
8606
|
deps.set(path, 0);
|
|
8590
8607
|
}
|
|
8608
|
+
}, resolveBareCssImport = (id, base) => {
|
|
8609
|
+
const slashIndex = id.indexOf("/");
|
|
8610
|
+
const pkgName = id.startsWith("@") ? id.split("/").slice(0, 2).join("/") : slashIndex === -1 ? id : id.slice(0, slashIndex);
|
|
8611
|
+
const subpath = id.slice(pkgName.length);
|
|
8612
|
+
if (subpath !== "") {
|
|
8613
|
+
return Bun.resolveSync(id, base);
|
|
8614
|
+
}
|
|
8615
|
+
let pkgJsonPath;
|
|
8616
|
+
try {
|
|
8617
|
+
pkgJsonPath = Bun.resolveSync(`${pkgName}/package.json`, base);
|
|
8618
|
+
} catch {
|
|
8619
|
+
return Bun.resolveSync(id, base);
|
|
8620
|
+
}
|
|
8621
|
+
const pkgDir = dirname5(pkgJsonPath);
|
|
8622
|
+
let pkg = {};
|
|
8623
|
+
try {
|
|
8624
|
+
pkg = JSON.parse(readFileSync6(pkgJsonPath, "utf-8"));
|
|
8625
|
+
} catch {
|
|
8626
|
+
return Bun.resolveSync(id, base);
|
|
8627
|
+
}
|
|
8628
|
+
const exportsField = pkg.exports;
|
|
8629
|
+
const styleFromExports = exportsField?.["."]?.style;
|
|
8630
|
+
const candidates = [
|
|
8631
|
+
styleFromExports,
|
|
8632
|
+
typeof pkg.style === "string" ? pkg.style : undefined,
|
|
8633
|
+
"index.css",
|
|
8634
|
+
"dist/index.css"
|
|
8635
|
+
].filter((entry) => typeof entry === "string");
|
|
8636
|
+
for (const candidate of candidates) {
|
|
8637
|
+
const candidatePath = resolve7(pkgDir, candidate);
|
|
8638
|
+
if (existsSync9(candidatePath))
|
|
8639
|
+
return candidatePath;
|
|
8640
|
+
}
|
|
8641
|
+
return Bun.resolveSync(id, base);
|
|
8591
8642
|
}, createLoadStylesheet = (deps) => async (id, base) => {
|
|
8592
|
-
const path = id.startsWith(".") || isAbsolute2(id) ? resolve7(base, id) :
|
|
8643
|
+
const path = id.startsWith(".") || isAbsolute2(id) ? resolve7(base, id) : resolveBareCssImport(id, base);
|
|
8593
8644
|
const content = await readFile2(path, "utf-8");
|
|
8594
8645
|
await recordDependency(deps, path);
|
|
8595
8646
|
return { base: dirname5(path), content, path };
|
|
@@ -8755,9 +8806,9 @@ var init_tailwindCompiler = __esm(() => {
|
|
|
8755
8806
|
|
|
8756
8807
|
// src/build/compileTailwind.ts
|
|
8757
8808
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
8758
|
-
import { dirname as dirname6, join as
|
|
8809
|
+
import { dirname as dirname6, join as join8 } from "path";
|
|
8759
8810
|
var TAILWIND_CANDIDATE_EXTENSION_PATTERN, isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath), compileTailwind = async (input, output, buildPath, styleTransformConfig) => {
|
|
8760
|
-
const outputPath =
|
|
8811
|
+
const outputPath = join8(buildPath, output);
|
|
8761
8812
|
await mkdir2(dirname6(outputPath), { recursive: true });
|
|
8762
8813
|
await incrementalTailwindBuild({ input, output }, buildPath, [], styleTransformConfig);
|
|
8763
8814
|
}, compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig);
|
|
@@ -8767,8 +8818,8 @@ var init_compileTailwind = __esm(() => {
|
|
|
8767
8818
|
});
|
|
8768
8819
|
|
|
8769
8820
|
// src/utils/imageProcessing.ts
|
|
8770
|
-
import { existsSync as
|
|
8771
|
-
import { join as
|
|
8821
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync3, readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
8822
|
+
import { join as join9, resolve as resolve8 } from "path";
|
|
8772
8823
|
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) => {
|
|
8773
8824
|
for (const size of sizes) {
|
|
8774
8825
|
if (size >= target)
|
|
@@ -8823,8 +8874,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
8823
8874
|
const image = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
8824
8875
|
return [...device, ...image].sort((left, right) => left - right);
|
|
8825
8876
|
}, getCacheDir = (buildDir) => {
|
|
8826
|
-
const dir =
|
|
8827
|
-
if (!
|
|
8877
|
+
const dir = join9(buildDir, ".cache", "images");
|
|
8878
|
+
if (!existsSync10(dir))
|
|
8828
8879
|
mkdirSync3(dir, { recursive: true });
|
|
8829
8880
|
return dir;
|
|
8830
8881
|
}, getCacheKey = (url, width, quality, format) => {
|
|
@@ -8880,13 +8931,13 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
8880
8931
|
return toBuffer(buffer);
|
|
8881
8932
|
}
|
|
8882
8933
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
8883
|
-
const metaPath =
|
|
8884
|
-
const dataPath =
|
|
8885
|
-
if (!
|
|
8934
|
+
const metaPath = join9(cacheDir, `${cacheKey}.meta`);
|
|
8935
|
+
const dataPath = join9(cacheDir, `${cacheKey}.data`);
|
|
8936
|
+
if (!existsSync10(metaPath) || !existsSync10(dataPath))
|
|
8886
8937
|
return null;
|
|
8887
8938
|
try {
|
|
8888
|
-
const meta = JSON.parse(
|
|
8889
|
-
const buffer =
|
|
8939
|
+
const meta = JSON.parse(readFileSync7(metaPath, "utf-8"));
|
|
8940
|
+
const buffer = readFileSync7(dataPath);
|
|
8890
8941
|
return { buffer, meta };
|
|
8891
8942
|
} catch {
|
|
8892
8943
|
return null;
|
|
@@ -8908,8 +8959,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
8908
8959
|
return null;
|
|
8909
8960
|
}
|
|
8910
8961
|
}, writeToCache = (cacheDir, cacheKey, buffer, meta) => {
|
|
8911
|
-
const metaPath =
|
|
8912
|
-
const dataPath =
|
|
8962
|
+
const metaPath = join9(cacheDir, `${cacheKey}.meta`);
|
|
8963
|
+
const dataPath = join9(cacheDir, `${cacheKey}.data`);
|
|
8913
8964
|
writeFileSync4(dataPath, buffer);
|
|
8914
8965
|
writeFileSync4(metaPath, JSON.stringify(meta));
|
|
8915
8966
|
};
|
|
@@ -8995,14 +9046,14 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
8995
9046
|
});
|
|
8996
9047
|
|
|
8997
9048
|
// src/cli/scripts/telemetry.ts
|
|
8998
|
-
import { existsSync as
|
|
9049
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync4, readFileSync as readFileSync8, writeFileSync as writeFileSync5 } from "fs";
|
|
8999
9050
|
import { homedir } from "os";
|
|
9000
|
-
import { join as
|
|
9051
|
+
import { join as join10 } from "path";
|
|
9001
9052
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
9002
9053
|
try {
|
|
9003
|
-
if (!
|
|
9054
|
+
if (!existsSync11(configPath))
|
|
9004
9055
|
return null;
|
|
9005
|
-
const raw =
|
|
9056
|
+
const raw = readFileSync8(configPath, "utf-8");
|
|
9006
9057
|
const config = JSON.parse(raw);
|
|
9007
9058
|
return config;
|
|
9008
9059
|
} catch {
|
|
@@ -9010,19 +9061,19 @@ var configDir, configPath, getTelemetryConfig = () => {
|
|
|
9010
9061
|
}
|
|
9011
9062
|
};
|
|
9012
9063
|
var init_telemetry = __esm(() => {
|
|
9013
|
-
configDir =
|
|
9014
|
-
configPath =
|
|
9064
|
+
configDir = join10(homedir(), ".absolutejs");
|
|
9065
|
+
configPath = join10(configDir, "telemetry.json");
|
|
9015
9066
|
});
|
|
9016
9067
|
|
|
9017
9068
|
// src/cli/telemetryEvent.ts
|
|
9018
|
-
import { existsSync as
|
|
9069
|
+
import { existsSync as existsSync12, readFileSync as readFileSync9 } from "fs";
|
|
9019
9070
|
import { arch, platform } from "os";
|
|
9020
|
-
import { dirname as dirname7, join as
|
|
9071
|
+
import { dirname as dirname7, join as join11, parse } from "path";
|
|
9021
9072
|
var checkCandidate = (candidate) => {
|
|
9022
|
-
if (!
|
|
9073
|
+
if (!existsSync12(candidate)) {
|
|
9023
9074
|
return null;
|
|
9024
9075
|
}
|
|
9025
|
-
const pkg = JSON.parse(
|
|
9076
|
+
const pkg = JSON.parse(readFileSync9(candidate, "utf-8"));
|
|
9026
9077
|
if (pkg.name === "@absolutejs/absolute") {
|
|
9027
9078
|
const ver = pkg.version;
|
|
9028
9079
|
return ver;
|
|
@@ -9037,7 +9088,7 @@ var checkCandidate = (candidate) => {
|
|
|
9037
9088
|
}, findPackageVersion = () => {
|
|
9038
9089
|
let { dir } = import.meta;
|
|
9039
9090
|
while (dir !== parse(dir).root) {
|
|
9040
|
-
const candidate =
|
|
9091
|
+
const candidate = join11(dir, "package.json");
|
|
9041
9092
|
const version = checkCandidate(candidate);
|
|
9042
9093
|
if (version) {
|
|
9043
9094
|
return version;
|
|
@@ -9127,17 +9178,17 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
9127
9178
|
});
|
|
9128
9179
|
|
|
9129
9180
|
// src/dev/buildHMRClient.ts
|
|
9130
|
-
import { existsSync as
|
|
9181
|
+
import { existsSync as existsSync13 } from "fs";
|
|
9131
9182
|
import { resolve as resolve9 } from "path";
|
|
9132
9183
|
var {build: bunBuild } = globalThis.Bun;
|
|
9133
9184
|
var resolveHmrClientPath = () => {
|
|
9134
9185
|
const projectRoot = process.cwd();
|
|
9135
9186
|
const fromSource = resolve9(import.meta.dir, "client/hmrClient.ts");
|
|
9136
|
-
if (
|
|
9187
|
+
if (existsSync13(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9137
9188
|
return fromSource;
|
|
9138
9189
|
}
|
|
9139
9190
|
const fromNodeModules = resolve9(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
9140
|
-
if (
|
|
9191
|
+
if (existsSync13(fromNodeModules))
|
|
9141
9192
|
return fromNodeModules;
|
|
9142
9193
|
return resolve9(import.meta.dir, "dev/client/hmrClient.ts");
|
|
9143
9194
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
@@ -9329,8 +9380,8 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
9329
9380
|
};
|
|
9330
9381
|
|
|
9331
9382
|
// src/build/angularLinkerPlugin.ts
|
|
9332
|
-
import { existsSync as
|
|
9333
|
-
import { dirname as dirname8, join as
|
|
9383
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync6 } from "fs";
|
|
9384
|
+
import { dirname as dirname8, join as join12, relative as relative5, resolve as resolve11 } from "path";
|
|
9334
9385
|
import { createHash as createHash2 } from "crypto";
|
|
9335
9386
|
var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
9336
9387
|
name: "angular-linker",
|
|
@@ -9338,7 +9389,7 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9338
9389
|
let needsLinking;
|
|
9339
9390
|
let babelTransform;
|
|
9340
9391
|
let linkerPlugin;
|
|
9341
|
-
const cacheDir =
|
|
9392
|
+
const cacheDir = join12(CACHE_ROOT, linkerJitMode ? "jit" : "aot");
|
|
9342
9393
|
bld.onLoad({ filter: /[\\/]@angular[\\/].*\.m?js$/ }, async (args) => {
|
|
9343
9394
|
const source = await Bun.file(args.path).text();
|
|
9344
9395
|
if (!needsLinking) {
|
|
@@ -9351,10 +9402,10 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9351
9402
|
return;
|
|
9352
9403
|
}
|
|
9353
9404
|
const hash = createHash2("md5").update(source).digest("hex");
|
|
9354
|
-
const cachePath =
|
|
9355
|
-
if (
|
|
9405
|
+
const cachePath = join12(cacheDir, `${hash}.js`);
|
|
9406
|
+
if (existsSync14(cachePath)) {
|
|
9356
9407
|
return {
|
|
9357
|
-
contents:
|
|
9408
|
+
contents: readFileSync10(cachePath, "utf-8"),
|
|
9358
9409
|
loader: "js"
|
|
9359
9410
|
};
|
|
9360
9411
|
}
|
|
@@ -9369,8 +9420,8 @@ var CACHE_ROOT, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
|
9369
9420
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
9370
9421
|
fileSystem: {
|
|
9371
9422
|
dirname: dirname8,
|
|
9372
|
-
exists:
|
|
9373
|
-
readFile:
|
|
9423
|
+
exists: existsSync14,
|
|
9424
|
+
readFile: readFileSync10,
|
|
9374
9425
|
relative: relative5,
|
|
9375
9426
|
resolve: resolve11
|
|
9376
9427
|
},
|
|
@@ -9431,7 +9482,7 @@ var init_cleanStaleOutputs = __esm(() => {
|
|
|
9431
9482
|
|
|
9432
9483
|
// src/utils/cleanup.ts
|
|
9433
9484
|
import { rm as rm3 } from "fs/promises";
|
|
9434
|
-
import { join as
|
|
9485
|
+
import { join as join13 } from "path";
|
|
9435
9486
|
var cleanup = async ({
|
|
9436
9487
|
angularDir,
|
|
9437
9488
|
reactDir,
|
|
@@ -9439,19 +9490,19 @@ var cleanup = async ({
|
|
|
9439
9490
|
vueDir
|
|
9440
9491
|
}) => {
|
|
9441
9492
|
await Promise.all([
|
|
9442
|
-
angularDir ? rm3(
|
|
9493
|
+
angularDir ? rm3(join13(angularDir, "generated"), {
|
|
9443
9494
|
force: true,
|
|
9444
9495
|
recursive: true
|
|
9445
9496
|
}) : undefined,
|
|
9446
|
-
reactDir ? rm3(
|
|
9497
|
+
reactDir ? rm3(join13(reactDir, "generated"), {
|
|
9447
9498
|
force: true,
|
|
9448
9499
|
recursive: true
|
|
9449
9500
|
}) : undefined,
|
|
9450
|
-
svelteDir ? rm3(
|
|
9501
|
+
svelteDir ? rm3(join13(svelteDir, "generated"), {
|
|
9451
9502
|
force: true,
|
|
9452
9503
|
recursive: true
|
|
9453
9504
|
}) : undefined,
|
|
9454
|
-
vueDir ? rm3(
|
|
9505
|
+
vueDir ? rm3(join13(vueDir, "generated"), {
|
|
9455
9506
|
force: true,
|
|
9456
9507
|
recursive: true
|
|
9457
9508
|
}) : undefined
|
|
@@ -9628,11 +9679,11 @@ __export(exports_compileSvelte, {
|
|
|
9628
9679
|
compileSvelte: () => compileSvelte,
|
|
9629
9680
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
9630
9681
|
});
|
|
9631
|
-
import { existsSync as
|
|
9682
|
+
import { existsSync as existsSync15 } from "fs";
|
|
9632
9683
|
import { mkdir as mkdir3, stat as stat2 } from "fs/promises";
|
|
9633
9684
|
import {
|
|
9634
9685
|
dirname as dirname9,
|
|
9635
|
-
join as
|
|
9686
|
+
join as join14,
|
|
9636
9687
|
basename as basename4,
|
|
9637
9688
|
extname as extname5,
|
|
9638
9689
|
resolve as resolve14,
|
|
@@ -9644,11 +9695,11 @@ var {write, file, Transpiler } = globalThis.Bun;
|
|
|
9644
9695
|
var resolveDevClientDir2 = () => {
|
|
9645
9696
|
const projectRoot = process.cwd();
|
|
9646
9697
|
const fromSource = resolve14(import.meta.dir, "../dev/client");
|
|
9647
|
-
if (
|
|
9698
|
+
if (existsSync15(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9648
9699
|
return fromSource;
|
|
9649
9700
|
}
|
|
9650
9701
|
const fromNodeModules = resolve14(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
9651
|
-
if (
|
|
9702
|
+
if (existsSync15(fromNodeModules))
|
|
9652
9703
|
return fromNodeModules;
|
|
9653
9704
|
return resolve14(import.meta.dir, "./dev/client");
|
|
9654
9705
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
@@ -9691,14 +9742,14 @@ var resolveDevClientDir2 = () => {
|
|
|
9691
9742
|
`${basePath}.svelte`,
|
|
9692
9743
|
`${basePath}.svelte.ts`,
|
|
9693
9744
|
`${basePath}.svelte.js`,
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9745
|
+
join14(basePath, "index.ts"),
|
|
9746
|
+
join14(basePath, "index.js"),
|
|
9747
|
+
join14(basePath, "index.mjs"),
|
|
9748
|
+
join14(basePath, "index.cjs"),
|
|
9749
|
+
join14(basePath, "index.json"),
|
|
9750
|
+
join14(basePath, "index.svelte"),
|
|
9751
|
+
join14(basePath, "index.svelte.ts"),
|
|
9752
|
+
join14(basePath, "index.svelte.js")
|
|
9702
9753
|
];
|
|
9703
9754
|
const checks = await Promise.all(candidates.map(exists));
|
|
9704
9755
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -9736,10 +9787,10 @@ var resolveDevClientDir2 = () => {
|
|
|
9736
9787
|
});
|
|
9737
9788
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
9738
9789
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
9739
|
-
const generatedDir =
|
|
9740
|
-
const clientDir =
|
|
9741
|
-
const indexDir =
|
|
9742
|
-
const serverDir =
|
|
9790
|
+
const generatedDir = join14(svelteRoot, "generated");
|
|
9791
|
+
const clientDir = join14(generatedDir, "client");
|
|
9792
|
+
const indexDir = join14(generatedDir, "indexes");
|
|
9793
|
+
const serverDir = join14(generatedDir, "server");
|
|
9743
9794
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir3(dir, { recursive: true })));
|
|
9744
9795
|
const dev = env.NODE_ENV !== "production";
|
|
9745
9796
|
const build = async (src) => {
|
|
@@ -9777,8 +9828,8 @@ var resolveDevClientDir2 = () => {
|
|
|
9777
9828
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
9778
9829
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
9779
9830
|
const externalRewrites = new Map;
|
|
9780
|
-
const ssrOutputDir = dirname9(
|
|
9781
|
-
const clientOutputDir = dirname9(
|
|
9831
|
+
const ssrOutputDir = dirname9(join14(serverDir, relDir, `${baseName}.js`));
|
|
9832
|
+
const clientOutputDir = dirname9(join14(clientDir, relDir, `${baseName}.js`));
|
|
9782
9833
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
9783
9834
|
const rawSpec = importPaths[idx];
|
|
9784
9835
|
if (!rawSpec)
|
|
@@ -9843,8 +9894,8 @@ var resolveDevClientDir2 = () => {
|
|
|
9843
9894
|
code += islandMetadataExports;
|
|
9844
9895
|
return code;
|
|
9845
9896
|
};
|
|
9846
|
-
const ssrPath =
|
|
9847
|
-
const clientPath =
|
|
9897
|
+
const ssrPath = join14(serverDir, relDir, `${baseName}.js`);
|
|
9898
|
+
const clientPath = join14(clientDir, relDir, `${baseName}.js`);
|
|
9848
9899
|
await Promise.all([
|
|
9849
9900
|
mkdir3(dirname9(ssrPath), { recursive: true }),
|
|
9850
9901
|
mkdir3(dirname9(clientPath), { recursive: true })
|
|
@@ -9876,7 +9927,7 @@ var resolveDevClientDir2 = () => {
|
|
|
9876
9927
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
9877
9928
|
const relClientDir = dirname9(relative7(clientDir, client));
|
|
9878
9929
|
const name = basename4(client, extname5(client));
|
|
9879
|
-
const indexPath =
|
|
9930
|
+
const indexPath = join14(indexDir, relClientDir, `${name}.js`);
|
|
9880
9931
|
const importRaw = relative7(dirname9(indexPath), client).split(sep2).join("/");
|
|
9881
9932
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
9882
9933
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
@@ -9955,7 +10006,7 @@ if (typeof window !== "undefined") {
|
|
|
9955
10006
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
9956
10007
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
9957
10008
|
const rel = dirname9(relative7(clientDir, client));
|
|
9958
|
-
return
|
|
10009
|
+
return join14(indexDir, rel, basename4(client));
|
|
9959
10010
|
}),
|
|
9960
10011
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
9961
10012
|
};
|
|
@@ -9969,7 +10020,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
9969
10020
|
init_lowerAwaitSlotSyntax();
|
|
9970
10021
|
init_renderToReadableStream();
|
|
9971
10022
|
devClientDir2 = resolveDevClientDir2();
|
|
9972
|
-
hmrClientPath3 =
|
|
10023
|
+
hmrClientPath3 = join14(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
9973
10024
|
persistentCache = new Map;
|
|
9974
10025
|
sourceHashCache = new Map;
|
|
9975
10026
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
@@ -9984,18 +10035,18 @@ __export(exports_compileVue, {
|
|
|
9984
10035
|
compileVue: () => compileVue,
|
|
9985
10036
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
9986
10037
|
});
|
|
9987
|
-
import { existsSync as
|
|
10038
|
+
import { existsSync as existsSync16 } from "fs";
|
|
9988
10039
|
import { mkdir as mkdir4 } from "fs/promises";
|
|
9989
|
-
import { basename as basename5, dirname as dirname10, join as
|
|
10040
|
+
import { basename as basename5, dirname as dirname10, join as join15, relative as relative8, resolve as resolve15 } from "path";
|
|
9990
10041
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
9991
10042
|
var resolveDevClientDir3 = () => {
|
|
9992
10043
|
const projectRoot = process.cwd();
|
|
9993
10044
|
const fromSource = resolve15(import.meta.dir, "../dev/client");
|
|
9994
|
-
if (
|
|
10045
|
+
if (existsSync16(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9995
10046
|
return fromSource;
|
|
9996
10047
|
}
|
|
9997
10048
|
const fromNodeModules = resolve15(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
9998
|
-
if (
|
|
10049
|
+
if (existsSync16(fromNodeModules))
|
|
9999
10050
|
return fromNodeModules;
|
|
10000
10051
|
return resolve15(import.meta.dir, "./dev/client");
|
|
10001
10052
|
}, devClientDir3, hmrClientPath4, transpiler3, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
@@ -10142,7 +10193,7 @@ var resolveDevClientDir3 = () => {
|
|
|
10142
10193
|
];
|
|
10143
10194
|
let cssOutputPaths = [];
|
|
10144
10195
|
if (isEntryPoint && allCss.length) {
|
|
10145
|
-
const cssOutputFile =
|
|
10196
|
+
const cssOutputFile = join15(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
10146
10197
|
await mkdir4(dirname10(cssOutputFile), { recursive: true });
|
|
10147
10198
|
await write2(cssOutputFile, allCss.join(`
|
|
10148
10199
|
`));
|
|
@@ -10173,8 +10224,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10173
10224
|
};
|
|
10174
10225
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
10175
10226
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
10176
|
-
const clientOutputPath =
|
|
10177
|
-
const serverOutputPath =
|
|
10227
|
+
const clientOutputPath = join15(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
10228
|
+
const serverOutputPath = join15(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
10178
10229
|
const relDir = dirname10(relativeFilePath);
|
|
10179
10230
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
10180
10231
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
@@ -10214,11 +10265,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10214
10265
|
return result;
|
|
10215
10266
|
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
|
|
10216
10267
|
const compiler = await import("@vue/compiler-sfc");
|
|
10217
|
-
const generatedDir =
|
|
10218
|
-
const clientOutputDir =
|
|
10219
|
-
const indexOutputDir =
|
|
10220
|
-
const serverOutputDir =
|
|
10221
|
-
const cssOutputDir =
|
|
10268
|
+
const generatedDir = join15(vueRootDir, "generated");
|
|
10269
|
+
const clientOutputDir = join15(generatedDir, "client");
|
|
10270
|
+
const indexOutputDir = join15(generatedDir, "indexes");
|
|
10271
|
+
const serverOutputDir = join15(generatedDir, "server");
|
|
10272
|
+
const cssOutputDir = join15(generatedDir, "compiled");
|
|
10222
10273
|
await Promise.all([
|
|
10223
10274
|
mkdir4(clientOutputDir, { recursive: true }),
|
|
10224
10275
|
mkdir4(indexOutputDir, { recursive: true }),
|
|
@@ -10235,8 +10286,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10235
10286
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
10236
10287
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
10237
10288
|
const entryBaseName = basename5(entryPath, ".vue");
|
|
10238
|
-
const indexOutputFile =
|
|
10239
|
-
const clientOutputFile =
|
|
10289
|
+
const indexOutputFile = join15(indexOutputDir, `${entryBaseName}.js`);
|
|
10290
|
+
const clientOutputFile = join15(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
10240
10291
|
await mkdir4(dirname10(indexOutputFile), { recursive: true });
|
|
10241
10292
|
const vueHmrImports = isDev ? [
|
|
10242
10293
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -10365,8 +10416,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10365
10416
|
const sourceCode = await file2(tsPath).text();
|
|
10366
10417
|
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
10367
10418
|
const relativeJsPath = relative8(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
10368
|
-
const outClientPath =
|
|
10369
|
-
const outServerPath =
|
|
10419
|
+
const outClientPath = join15(clientOutputDir, relativeJsPath);
|
|
10420
|
+
const outServerPath = join15(serverOutputDir, relativeJsPath);
|
|
10370
10421
|
await mkdir4(dirname10(outClientPath), { recursive: true });
|
|
10371
10422
|
await mkdir4(dirname10(outServerPath), { recursive: true });
|
|
10372
10423
|
await write2(outClientPath, transpiledCode);
|
|
@@ -10386,7 +10437,7 @@ var init_compileVue = __esm(() => {
|
|
|
10386
10437
|
init_sourceMetadata();
|
|
10387
10438
|
init_stylePreprocessor();
|
|
10388
10439
|
devClientDir3 = resolveDevClientDir3();
|
|
10389
|
-
hmrClientPath4 =
|
|
10440
|
+
hmrClientPath4 = join15(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
10390
10441
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
10391
10442
|
scriptCache = new Map;
|
|
10392
10443
|
scriptSetupCache = new Map;
|
|
@@ -10866,8 +10917,8 @@ __export(exports_compileAngular, {
|
|
|
10866
10917
|
compileAngularFile: () => compileAngularFile,
|
|
10867
10918
|
compileAngular: () => compileAngular
|
|
10868
10919
|
});
|
|
10869
|
-
import { existsSync as
|
|
10870
|
-
import { join as
|
|
10920
|
+
import { existsSync as existsSync17, readFileSync as readFileSync11, promises as fs } from "fs";
|
|
10921
|
+
import { join as join16, basename as basename6, sep as sep3, dirname as dirname11, resolve as resolve16, relative as relative9 } from "path";
|
|
10871
10922
|
import ts2 from "typescript";
|
|
10872
10923
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
10873
10924
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
@@ -10909,12 +10960,12 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
10909
10960
|
`${candidate}.tsx`,
|
|
10910
10961
|
`${candidate}.js`,
|
|
10911
10962
|
`${candidate}.jsx`,
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10963
|
+
join16(candidate, "index.ts"),
|
|
10964
|
+
join16(candidate, "index.tsx"),
|
|
10965
|
+
join16(candidate, "index.js"),
|
|
10966
|
+
join16(candidate, "index.jsx")
|
|
10916
10967
|
];
|
|
10917
|
-
return candidates.find((file3) =>
|
|
10968
|
+
return candidates.find((file3) => existsSync17(file3));
|
|
10918
10969
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
10919
10970
|
const baseDir = resolve16(rootDir);
|
|
10920
10971
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
@@ -10995,11 +11046,11 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
10995
11046
|
}, resolveDevClientDir4 = () => {
|
|
10996
11047
|
const projectRoot = process.cwd();
|
|
10997
11048
|
const fromSource = resolve16(import.meta.dir, "../dev/client");
|
|
10998
|
-
if (
|
|
11049
|
+
if (existsSync17(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
10999
11050
|
return fromSource;
|
|
11000
11051
|
}
|
|
11001
11052
|
const fromNodeModules = resolve16(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
11002
|
-
if (
|
|
11053
|
+
if (existsSync17(fromNodeModules))
|
|
11003
11054
|
return fromNodeModules;
|
|
11004
11055
|
return resolve16(import.meta.dir, "./dev/client");
|
|
11005
11056
|
}, devClientDir4, hmrClientPath5, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
|
|
@@ -11051,11 +11102,11 @@ ${registrations}
|
|
|
11051
11102
|
return specifier;
|
|
11052
11103
|
const importerDir = dirname11(importerOutputPath);
|
|
11053
11104
|
const fileCandidate = resolve16(importerDir, `${specifier}.js`);
|
|
11054
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
11105
|
+
if (outputFiles?.has(fileCandidate) || existsSync17(fileCandidate)) {
|
|
11055
11106
|
return `${specifier}.js`;
|
|
11056
11107
|
}
|
|
11057
11108
|
const indexCandidate = resolve16(importerDir, specifier, "index.js");
|
|
11058
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
11109
|
+
if (outputFiles?.has(indexCandidate) || existsSync17(indexCandidate)) {
|
|
11059
11110
|
return `${specifier}/index.js`;
|
|
11060
11111
|
}
|
|
11061
11112
|
return `${specifier}.js`;
|
|
@@ -11088,12 +11139,12 @@ ${registrations}
|
|
|
11088
11139
|
`${basePath}.tsx`,
|
|
11089
11140
|
`${basePath}.mts`,
|
|
11090
11141
|
`${basePath}.cts`,
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11142
|
+
join16(basePath, "index.ts"),
|
|
11143
|
+
join16(basePath, "index.tsx"),
|
|
11144
|
+
join16(basePath, "index.mts"),
|
|
11145
|
+
join16(basePath, "index.cts")
|
|
11095
11146
|
];
|
|
11096
|
-
return candidates.map((candidate) => resolve16(candidate)).find((candidate) =>
|
|
11147
|
+
return candidates.map((candidate) => resolve16(candidate)).find((candidate) => existsSync17(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
11097
11148
|
}, readFileForAotTransform = async (fileName, readFile5) => {
|
|
11098
11149
|
const hostSource = readFile5?.(fileName);
|
|
11099
11150
|
if (typeof hostSource === "string")
|
|
@@ -11117,15 +11168,15 @@ ${registrations}
|
|
|
11117
11168
|
const paths = [];
|
|
11118
11169
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11119
11170
|
if (templateUrlMatch?.[1])
|
|
11120
|
-
paths.push(
|
|
11171
|
+
paths.push(join16(fileDir, templateUrlMatch[1]));
|
|
11121
11172
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11122
11173
|
if (styleUrlMatch?.[1])
|
|
11123
|
-
paths.push(
|
|
11174
|
+
paths.push(join16(fileDir, styleUrlMatch[1]));
|
|
11124
11175
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
11125
11176
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
11126
11177
|
if (urlMatches) {
|
|
11127
11178
|
for (const urlMatch of urlMatches) {
|
|
11128
|
-
paths.push(
|
|
11179
|
+
paths.push(join16(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
11129
11180
|
}
|
|
11130
11181
|
}
|
|
11131
11182
|
return paths.map((path) => resolve16(path));
|
|
@@ -11159,7 +11210,7 @@ ${registrations}
|
|
|
11159
11210
|
safeStableStringify(stylePreprocessors ?? null)
|
|
11160
11211
|
].join("\x00");
|
|
11161
11212
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
11162
|
-
return
|
|
11213
|
+
return join16(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
11163
11214
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile5, stylePreprocessors) => {
|
|
11164
11215
|
const transformedSources = new Map;
|
|
11165
11216
|
const visited = new Set;
|
|
@@ -11174,7 +11225,7 @@ ${registrations}
|
|
|
11174
11225
|
if (visited.has(resolvedPath))
|
|
11175
11226
|
return;
|
|
11176
11227
|
visited.add(resolvedPath);
|
|
11177
|
-
if (!
|
|
11228
|
+
if (!existsSync17(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
11178
11229
|
return;
|
|
11179
11230
|
stats.filesVisited += 1;
|
|
11180
11231
|
const source = await readFileForAotTransform(resolvedPath, readFile5);
|
|
@@ -11205,10 +11256,10 @@ ${registrations}
|
|
|
11205
11256
|
return { stats, transformedSources };
|
|
11206
11257
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
11207
11258
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
11208
|
-
const outputPath = resolve16(
|
|
11259
|
+
const outputPath = resolve16(join16(outDir, relative9(process.cwd(), resolve16(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
11209
11260
|
return [
|
|
11210
11261
|
outputPath,
|
|
11211
|
-
buildIslandMetadataExports(
|
|
11262
|
+
buildIslandMetadataExports(readFileSync11(inputPath, "utf-8"))
|
|
11212
11263
|
];
|
|
11213
11264
|
})), { entries: inputPaths.length });
|
|
11214
11265
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
@@ -11251,7 +11302,7 @@ ${registrations}
|
|
|
11251
11302
|
const originalGetSourceFile = host.getSourceFile;
|
|
11252
11303
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
11253
11304
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
11254
|
-
const resolvedPath =
|
|
11305
|
+
const resolvedPath = join16(tsLibDir, fileName);
|
|
11255
11306
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
11256
11307
|
}
|
|
11257
11308
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -11306,7 +11357,7 @@ ${registrations}
|
|
|
11306
11357
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
11307
11358
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
11308
11359
|
content,
|
|
11309
|
-
target:
|
|
11360
|
+
target: join16(outDir, fileName)
|
|
11310
11361
|
}));
|
|
11311
11362
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve16(target)));
|
|
11312
11363
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -11345,7 +11396,7 @@ ${registrations}
|
|
|
11345
11396
|
return null;
|
|
11346
11397
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
11347
11398
|
const sourceEntry = resolve16(import.meta.dir, "../angular/components/index.ts");
|
|
11348
|
-
if (
|
|
11399
|
+
if (existsSync17(sourceEntry)) {
|
|
11349
11400
|
return sourceEntry.replace(/\\/g, "/");
|
|
11350
11401
|
}
|
|
11351
11402
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -11473,7 +11524,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
11473
11524
|
${fields}
|
|
11474
11525
|
`);
|
|
11475
11526
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
11476
|
-
if (!
|
|
11527
|
+
if (!existsSync17(filePath)) {
|
|
11477
11528
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
11478
11529
|
}
|
|
11479
11530
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -11481,8 +11532,8 @@ ${fields}
|
|
|
11481
11532
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
11482
11533
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11483
11534
|
if (templateUrlMatch?.[1]) {
|
|
11484
|
-
const templatePath =
|
|
11485
|
-
if (!
|
|
11535
|
+
const templatePath = join16(fileDir, templateUrlMatch[1]);
|
|
11536
|
+
if (!existsSync17(templatePath)) {
|
|
11486
11537
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
11487
11538
|
}
|
|
11488
11539
|
const templateRaw2 = await fs.readFile(templatePath, "utf-8");
|
|
@@ -11512,11 +11563,11 @@ ${fields}
|
|
|
11512
11563
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
11513
11564
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11514
11565
|
if (templateUrlMatch?.[1]) {
|
|
11515
|
-
const templatePath =
|
|
11516
|
-
if (!
|
|
11566
|
+
const templatePath = join16(fileDir, templateUrlMatch[1]);
|
|
11567
|
+
if (!existsSync17(templatePath)) {
|
|
11517
11568
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
11518
11569
|
}
|
|
11519
|
-
const templateRaw2 =
|
|
11570
|
+
const templateRaw2 = readFileSync11(templatePath, "utf-8");
|
|
11520
11571
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
11521
11572
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
11522
11573
|
const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -11549,7 +11600,7 @@ ${fields}
|
|
|
11549
11600
|
return source;
|
|
11550
11601
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
11551
11602
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
11552
|
-
return readAndEscapeFile(
|
|
11603
|
+
return readAndEscapeFile(join16(fileDir, styleUrl), stylePreprocessors);
|
|
11553
11604
|
});
|
|
11554
11605
|
const results = await Promise.all(stylePromises);
|
|
11555
11606
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -11560,7 +11611,7 @@ ${fields}
|
|
|
11560
11611
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11561
11612
|
if (!styleUrlMatch?.[1])
|
|
11562
11613
|
return source;
|
|
11563
|
-
const escaped = await readAndEscapeFile(
|
|
11614
|
+
const escaped = await readAndEscapeFile(join16(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
11564
11615
|
if (!escaped)
|
|
11565
11616
|
return source;
|
|
11566
11617
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -11595,12 +11646,12 @@ ${fields}
|
|
|
11595
11646
|
`${candidate}.tsx`,
|
|
11596
11647
|
`${candidate}.js`,
|
|
11597
11648
|
`${candidate}.jsx`,
|
|
11598
|
-
|
|
11599
|
-
|
|
11600
|
-
|
|
11601
|
-
|
|
11649
|
+
join16(candidate, "index.ts"),
|
|
11650
|
+
join16(candidate, "index.tsx"),
|
|
11651
|
+
join16(candidate, "index.js"),
|
|
11652
|
+
join16(candidate, "index.jsx")
|
|
11602
11653
|
];
|
|
11603
|
-
return candidates.find((file3) =>
|
|
11654
|
+
return candidates.find((file3) => existsSync17(file3));
|
|
11604
11655
|
};
|
|
11605
11656
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
11606
11657
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
@@ -11625,7 +11676,7 @@ ${fields}
|
|
|
11625
11676
|
const inputDir = dirname11(sourcePath);
|
|
11626
11677
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
11627
11678
|
const fileBase = basename6(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
11628
|
-
return
|
|
11679
|
+
return join16(outDir, relativeDir, fileBase);
|
|
11629
11680
|
};
|
|
11630
11681
|
const transpileAndRewrite = (sourceCode, relativeDir, actualPath, importRewrites) => {
|
|
11631
11682
|
let processedContent = angularTranspiler.transformSync(sourceCode);
|
|
@@ -11670,7 +11721,7 @@ ${fields}
|
|
|
11670
11721
|
let actualPath = resolved;
|
|
11671
11722
|
if (!actualPath.endsWith(".ts"))
|
|
11672
11723
|
actualPath += ".ts";
|
|
11673
|
-
if (!
|
|
11724
|
+
if (!existsSync17(actualPath))
|
|
11674
11725
|
return;
|
|
11675
11726
|
let sourceCode = await fs.readFile(actualPath, "utf-8");
|
|
11676
11727
|
const inlined = await inlineResources(sourceCode, dirname11(actualPath), stylePreprocessors);
|
|
@@ -11678,7 +11729,7 @@ ${fields}
|
|
|
11678
11729
|
const inputDir = dirname11(actualPath);
|
|
11679
11730
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
11680
11731
|
const fileBase = basename6(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
11681
|
-
const targetDir =
|
|
11732
|
+
const targetDir = join16(outDir, relativeDir);
|
|
11682
11733
|
const targetPath = toOutputPath(actualPath);
|
|
11683
11734
|
const localImports = [];
|
|
11684
11735
|
const importRewrites = new Map;
|
|
@@ -11706,7 +11757,7 @@ ${fields}
|
|
|
11706
11757
|
}).filter((path) => Boolean(path));
|
|
11707
11758
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
11708
11759
|
const cacheKey2 = actualPath;
|
|
11709
|
-
if (jitContentCache.get(cacheKey2) === contentHash &&
|
|
11760
|
+
if (jitContentCache.get(cacheKey2) === contentHash && existsSync17(targetPath)) {
|
|
11710
11761
|
allOutputs.push(targetPath);
|
|
11711
11762
|
} else {
|
|
11712
11763
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
@@ -11719,7 +11770,7 @@ ${fields}
|
|
|
11719
11770
|
};
|
|
11720
11771
|
await transpileFile(inputPath);
|
|
11721
11772
|
const entryOutputPath = toOutputPath(entryPath);
|
|
11722
|
-
if (
|
|
11773
|
+
if (existsSync17(entryOutputPath)) {
|
|
11723
11774
|
const entryOutput = await fs.readFile(entryOutputPath, "utf-8");
|
|
11724
11775
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
11725
11776
|
`);
|
|
@@ -11732,13 +11783,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
11732
11783
|
}
|
|
11733
11784
|
return allOutputs;
|
|
11734
11785
|
}, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
|
|
11735
|
-
const compiledParent =
|
|
11786
|
+
const compiledParent = join16(outRoot, "generated");
|
|
11736
11787
|
if (entryPoints.length === 0) {
|
|
11737
11788
|
const emptyPaths = [];
|
|
11738
11789
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
11739
11790
|
}
|
|
11740
11791
|
const compiledRoot = compiledParent;
|
|
11741
|
-
const indexesDir =
|
|
11792
|
+
const indexesDir = join16(compiledParent, "indexes");
|
|
11742
11793
|
await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
|
|
11743
11794
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve16(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
11744
11795
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
@@ -11752,21 +11803,21 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
11752
11803
|
const fileBase = basename6(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
11753
11804
|
const jsName = `${fileBase}.js`;
|
|
11754
11805
|
const compiledFallbackPaths = [
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11806
|
+
join16(compiledRoot, relativeEntry),
|
|
11807
|
+
join16(compiledRoot, "pages", jsName),
|
|
11808
|
+
join16(compiledRoot, jsName)
|
|
11758
11809
|
].map((file3) => resolve16(file3));
|
|
11759
11810
|
const resolveRawServerFile = (candidatePaths) => {
|
|
11760
11811
|
const normalizedCandidates = [
|
|
11761
11812
|
...candidatePaths.map((file3) => resolve16(file3)),
|
|
11762
11813
|
...compiledFallbackPaths
|
|
11763
11814
|
];
|
|
11764
|
-
let candidate = normalizedCandidates.find((file3) =>
|
|
11815
|
+
let candidate = normalizedCandidates.find((file3) => existsSync17(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
11765
11816
|
if (!candidate) {
|
|
11766
|
-
candidate = normalizedCandidates.find((file3) =>
|
|
11817
|
+
candidate = normalizedCandidates.find((file3) => existsSync17(file3) && file3.endsWith(`${sep3}${jsName}`));
|
|
11767
11818
|
}
|
|
11768
11819
|
if (!candidate) {
|
|
11769
|
-
candidate = normalizedCandidates.find((file3) =>
|
|
11820
|
+
candidate = normalizedCandidates.find((file3) => existsSync17(file3));
|
|
11770
11821
|
}
|
|
11771
11822
|
return candidate;
|
|
11772
11823
|
};
|
|
@@ -11774,11 +11825,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
11774
11825
|
if (!rawServerFile) {
|
|
11775
11826
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
11776
11827
|
}
|
|
11777
|
-
if (rawServerFile && !
|
|
11828
|
+
if (rawServerFile && !existsSync17(rawServerFile)) {
|
|
11778
11829
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
11779
11830
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
11780
11831
|
}
|
|
11781
|
-
if (!rawServerFile || !
|
|
11832
|
+
if (!rawServerFile || !existsSync17(rawServerFile)) {
|
|
11782
11833
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
11783
11834
|
...outputs,
|
|
11784
11835
|
...compiledFallbackPaths
|
|
@@ -11798,8 +11849,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
11798
11849
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
11799
11850
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
11800
11851
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
11801
|
-
const clientFile =
|
|
11802
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
11852
|
+
const clientFile = join16(indexesDir, jsName);
|
|
11853
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync17(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
11803
11854
|
return {
|
|
11804
11855
|
clientPath: clientFile,
|
|
11805
11856
|
indexUnchanged: true,
|
|
@@ -12046,8 +12097,8 @@ var init_compileAngular = __esm(() => {
|
|
|
12046
12097
|
init_lowerDeferSyntax();
|
|
12047
12098
|
init_stylePreprocessor();
|
|
12048
12099
|
devClientDir4 = resolveDevClientDir4();
|
|
12049
|
-
hmrClientPath5 =
|
|
12050
|
-
hmrRuntimePath =
|
|
12100
|
+
hmrClientPath5 = join16(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
12101
|
+
hmrRuntimePath = join16(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
|
|
12051
12102
|
jitContentCache = new Map;
|
|
12052
12103
|
wrapperOutputCache = new Map;
|
|
12053
12104
|
});
|
|
@@ -12058,8 +12109,8 @@ __export(exports_buildReactVendor, {
|
|
|
12058
12109
|
computeVendorPaths: () => computeVendorPaths,
|
|
12059
12110
|
buildReactVendor: () => buildReactVendor
|
|
12060
12111
|
});
|
|
12061
|
-
import { existsSync as
|
|
12062
|
-
import { join as
|
|
12112
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync6 } from "fs";
|
|
12113
|
+
import { join as join17, resolve as resolve17 } from "path";
|
|
12063
12114
|
import { rm as rm4 } from "fs/promises";
|
|
12064
12115
|
var {build: bunBuild2 } = globalThis.Bun;
|
|
12065
12116
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -12072,7 +12123,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
12072
12123
|
resolve17(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
12073
12124
|
];
|
|
12074
12125
|
for (const candidate of candidates) {
|
|
12075
|
-
if (
|
|
12126
|
+
if (existsSync18(candidate)) {
|
|
12076
12127
|
return candidate.replace(/\\/g, "/");
|
|
12077
12128
|
}
|
|
12078
12129
|
}
|
|
@@ -12113,14 +12164,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
12113
12164
|
`)}
|
|
12114
12165
|
`;
|
|
12115
12166
|
}, buildReactVendor = async (buildDir) => {
|
|
12116
|
-
const vendorDir =
|
|
12167
|
+
const vendorDir = join17(buildDir, "react", "vendor");
|
|
12117
12168
|
mkdirSync6(vendorDir, { recursive: true });
|
|
12118
|
-
const tmpDir =
|
|
12169
|
+
const tmpDir = join17(buildDir, "_vendor_tmp");
|
|
12119
12170
|
mkdirSync6(tmpDir, { recursive: true });
|
|
12120
12171
|
const specifiers = resolveVendorSpecifiers();
|
|
12121
12172
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12122
12173
|
const safeName = toSafeFileName(specifier);
|
|
12123
|
-
const entryPath =
|
|
12174
|
+
const entryPath = join17(tmpDir, `${safeName}.ts`);
|
|
12124
12175
|
const source = await generateEntrySource(specifier);
|
|
12125
12176
|
await Bun.write(entryPath, source);
|
|
12126
12177
|
return entryPath;
|
|
@@ -12165,7 +12216,7 @@ __export(exports_buildAngularVendor, {
|
|
|
12165
12216
|
buildAngularVendor: () => buildAngularVendor
|
|
12166
12217
|
});
|
|
12167
12218
|
import { mkdirSync as mkdirSync7 } from "fs";
|
|
12168
|
-
import { join as
|
|
12219
|
+
import { join as join18 } from "path";
|
|
12169
12220
|
import { rm as rm5 } from "fs/promises";
|
|
12170
12221
|
var {build: bunBuild3, Glob: Glob6 } = globalThis.Bun;
|
|
12171
12222
|
var REQUIRED_ANGULAR_SPECIFIERS, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
|
|
@@ -12202,7 +12253,7 @@ var REQUIRED_ANGULAR_SPECIFIERS, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS,
|
|
|
12202
12253
|
}
|
|
12203
12254
|
return { angular, transitiveRoots };
|
|
12204
12255
|
}, collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
12205
|
-
const { readFileSync:
|
|
12256
|
+
const { readFileSync: readFileSync12 } = await import("fs");
|
|
12206
12257
|
const transpiler4 = new Bun.Transpiler({ loader: "js" });
|
|
12207
12258
|
const visited = new Set;
|
|
12208
12259
|
const frontier = [];
|
|
@@ -12223,7 +12274,7 @@ var REQUIRED_ANGULAR_SPECIFIERS, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS,
|
|
|
12223
12274
|
}
|
|
12224
12275
|
let content;
|
|
12225
12276
|
try {
|
|
12226
|
-
content =
|
|
12277
|
+
content = readFileSync12(resolved, "utf-8");
|
|
12227
12278
|
} catch {
|
|
12228
12279
|
continue;
|
|
12229
12280
|
}
|
|
@@ -12258,14 +12309,14 @@ var REQUIRED_ANGULAR_SPECIFIERS, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS,
|
|
|
12258
12309
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
12259
12310
|
return Array.from(angular).filter(isResolvable2);
|
|
12260
12311
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
12261
|
-
const vendorDir =
|
|
12312
|
+
const vendorDir = join18(buildDir, "angular", "vendor");
|
|
12262
12313
|
mkdirSync7(vendorDir, { recursive: true });
|
|
12263
|
-
const tmpDir =
|
|
12314
|
+
const tmpDir = join18(buildDir, "_angular_vendor_tmp");
|
|
12264
12315
|
mkdirSync7(tmpDir, { recursive: true });
|
|
12265
12316
|
const specifiers = await resolveAngularSpecifiers(directories);
|
|
12266
12317
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12267
12318
|
const safeName = toSafeFileName2(specifier);
|
|
12268
|
-
const entryPath =
|
|
12319
|
+
const entryPath = join18(tmpDir, `${safeName}.ts`);
|
|
12269
12320
|
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
12270
12321
|
return entryPath;
|
|
12271
12322
|
}));
|
|
@@ -12326,17 +12377,17 @@ __export(exports_buildVueVendor, {
|
|
|
12326
12377
|
buildVueVendor: () => buildVueVendor
|
|
12327
12378
|
});
|
|
12328
12379
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
12329
|
-
import { join as
|
|
12380
|
+
import { join as join19 } from "path";
|
|
12330
12381
|
import { rm as rm6 } from "fs/promises";
|
|
12331
12382
|
var {build: bunBuild4 } = globalThis.Bun;
|
|
12332
12383
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
12333
|
-
const vendorDir =
|
|
12384
|
+
const vendorDir = join19(buildDir, "vue", "vendor");
|
|
12334
12385
|
mkdirSync8(vendorDir, { recursive: true });
|
|
12335
|
-
const tmpDir =
|
|
12386
|
+
const tmpDir = join19(buildDir, "_vue_vendor_tmp");
|
|
12336
12387
|
mkdirSync8(tmpDir, { recursive: true });
|
|
12337
12388
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
12338
12389
|
const safeName = toSafeFileName3(specifier);
|
|
12339
|
-
const entryPath =
|
|
12390
|
+
const entryPath = join19(tmpDir, `${safeName}.ts`);
|
|
12340
12391
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
12341
12392
|
`);
|
|
12342
12393
|
return entryPath;
|
|
@@ -12361,11 +12412,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
12361
12412
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
12362
12413
|
return;
|
|
12363
12414
|
}
|
|
12364
|
-
const { readFileSync:
|
|
12415
|
+
const { readFileSync: readFileSync12, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
|
|
12365
12416
|
const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
12366
12417
|
for (const file3 of files) {
|
|
12367
|
-
const filePath =
|
|
12368
|
-
const content =
|
|
12418
|
+
const filePath = join19(vendorDir, file3);
|
|
12419
|
+
const content = readFileSync12(filePath, "utf-8");
|
|
12369
12420
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
12370
12421
|
continue;
|
|
12371
12422
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -12391,7 +12442,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
12391
12442
|
buildSvelteVendor: () => buildSvelteVendor
|
|
12392
12443
|
});
|
|
12393
12444
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
12394
|
-
import { join as
|
|
12445
|
+
import { join as join20 } from "path";
|
|
12395
12446
|
import { rm as rm7 } from "fs/promises";
|
|
12396
12447
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
12397
12448
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
@@ -12405,13 +12456,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
12405
12456
|
const specifiers = resolveVendorSpecifiers2();
|
|
12406
12457
|
if (specifiers.length === 0)
|
|
12407
12458
|
return;
|
|
12408
|
-
const vendorDir =
|
|
12459
|
+
const vendorDir = join20(buildDir, "svelte", "vendor");
|
|
12409
12460
|
mkdirSync9(vendorDir, { recursive: true });
|
|
12410
|
-
const tmpDir =
|
|
12461
|
+
const tmpDir = join20(buildDir, "_svelte_vendor_tmp");
|
|
12411
12462
|
mkdirSync9(tmpDir, { recursive: true });
|
|
12412
12463
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12413
12464
|
const safeName = toSafeFileName4(specifier);
|
|
12414
|
-
const entryPath =
|
|
12465
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
12415
12466
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
12416
12467
|
`);
|
|
12417
12468
|
return entryPath;
|
|
@@ -12484,11 +12535,11 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
|
|
|
12484
12535
|
if (Object.keys(vendorPaths).length === 0)
|
|
12485
12536
|
return;
|
|
12486
12537
|
const { readdirSync } = await import("fs");
|
|
12487
|
-
const { join:
|
|
12538
|
+
const { join: join21 } = await import("path");
|
|
12488
12539
|
const allFiles = [];
|
|
12489
12540
|
for (const dir of vendorDirs) {
|
|
12490
12541
|
try {
|
|
12491
|
-
const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) =>
|
|
12542
|
+
const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) => join21(dir, f2));
|
|
12492
12543
|
allFiles.push(...files);
|
|
12493
12544
|
} catch {}
|
|
12494
12545
|
}
|
|
@@ -12557,14 +12608,14 @@ var init_rewriteImports = __esm(() => {
|
|
|
12557
12608
|
import {
|
|
12558
12609
|
copyFileSync,
|
|
12559
12610
|
cpSync,
|
|
12560
|
-
existsSync as
|
|
12611
|
+
existsSync as existsSync19,
|
|
12561
12612
|
mkdirSync as mkdirSync10,
|
|
12562
|
-
readFileSync as
|
|
12613
|
+
readFileSync as readFileSync12,
|
|
12563
12614
|
rmSync as rmSync2,
|
|
12564
12615
|
statSync,
|
|
12565
12616
|
writeFileSync as writeFileSync7
|
|
12566
12617
|
} from "fs";
|
|
12567
|
-
import { basename as basename7, dirname as dirname12, join as
|
|
12618
|
+
import { basename as basename7, dirname as dirname12, join as join21, relative as relative10, resolve as resolve18 } from "path";
|
|
12568
12619
|
import { cwd, env as env2, exit } from "process";
|
|
12569
12620
|
var {build: bunBuild6, Glob: Glob7 } = globalThis.Bun;
|
|
12570
12621
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -12642,8 +12693,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12642
12693
|
mkdirSync10(htmxDestDir, { recursive: true });
|
|
12643
12694
|
const glob = new Glob7("htmx*.min.js");
|
|
12644
12695
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
12645
|
-
const src =
|
|
12646
|
-
const dest =
|
|
12696
|
+
const src = join21(htmxDir, relPath);
|
|
12697
|
+
const dest = join21(htmxDestDir, "htmx.min.js");
|
|
12647
12698
|
copyFileSync(src, dest);
|
|
12648
12699
|
return;
|
|
12649
12700
|
}
|
|
@@ -12687,7 +12738,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12687
12738
|
addWorkerPathIfExists(file3, relPath, workerPaths);
|
|
12688
12739
|
}
|
|
12689
12740
|
}, collectWorkerPathsFromFile = (file3, patterns, workerPaths) => {
|
|
12690
|
-
const content =
|
|
12741
|
+
const content = readFileSync12(file3, "utf-8");
|
|
12691
12742
|
for (const pattern of patterns) {
|
|
12692
12743
|
collectWorkerPathsFromContent(content, pattern, file3, workerPaths);
|
|
12693
12744
|
}
|
|
@@ -12718,7 +12769,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12718
12769
|
vuePagesPath
|
|
12719
12770
|
}) => {
|
|
12720
12771
|
const { readdirSync: readDir } = await import("fs");
|
|
12721
|
-
const devIndexDir =
|
|
12772
|
+
const devIndexDir = join21(buildPath, "_src_indexes");
|
|
12722
12773
|
mkdirSync10(devIndexDir, { recursive: true });
|
|
12723
12774
|
if (reactIndexesPath && reactPagesPath) {
|
|
12724
12775
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -12730,41 +12781,41 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12730
12781
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
12731
12782
|
}
|
|
12732
12783
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
12733
|
-
if (!
|
|
12784
|
+
if (!existsSync19(reactIndexesPath)) {
|
|
12734
12785
|
return;
|
|
12735
12786
|
}
|
|
12736
12787
|
const indexFiles = readDir(reactIndexesPath).filter((file3) => file3.endsWith(".tsx"));
|
|
12737
12788
|
const pagesRel = relative10(process.cwd(), resolve18(reactPagesPath)).replace(/\\/g, "/");
|
|
12738
12789
|
for (const file3 of indexFiles) {
|
|
12739
|
-
let content =
|
|
12790
|
+
let content = readFileSync12(join21(reactIndexesPath, file3), "utf-8");
|
|
12740
12791
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
12741
|
-
writeFileSync7(
|
|
12792
|
+
writeFileSync7(join21(devIndexDir, file3), content);
|
|
12742
12793
|
}
|
|
12743
12794
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
12744
|
-
const svelteIndexDir =
|
|
12795
|
+
const svelteIndexDir = join21(svelteDir, "generated", "indexes");
|
|
12745
12796
|
const sveltePageEntries = svelteEntries.filter((file3) => resolve18(file3).startsWith(resolve18(sveltePagesPath)));
|
|
12746
12797
|
for (const entry of sveltePageEntries) {
|
|
12747
12798
|
const name = basename7(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12748
|
-
const indexFile =
|
|
12749
|
-
if (!
|
|
12799
|
+
const indexFile = join21(svelteIndexDir, "pages", `${name}.js`);
|
|
12800
|
+
if (!existsSync19(indexFile))
|
|
12750
12801
|
continue;
|
|
12751
|
-
let content =
|
|
12802
|
+
let content = readFileSync12(indexFile, "utf-8");
|
|
12752
12803
|
const srcRel = relative10(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
|
|
12753
12804
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
12754
|
-
writeFileSync7(
|
|
12805
|
+
writeFileSync7(join21(devIndexDir, `${name}.svelte.js`), content);
|
|
12755
12806
|
}
|
|
12756
12807
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
12757
|
-
const vueIndexDir =
|
|
12808
|
+
const vueIndexDir = join21(vueDir, "generated", "indexes");
|
|
12758
12809
|
const vuePageEntries = vueEntries.filter((file3) => resolve18(file3).startsWith(resolve18(vuePagesPath)));
|
|
12759
12810
|
for (const entry of vuePageEntries) {
|
|
12760
12811
|
const name = basename7(entry, ".vue");
|
|
12761
|
-
const indexFile =
|
|
12762
|
-
if (!
|
|
12812
|
+
const indexFile = join21(vueIndexDir, `${name}.js`);
|
|
12813
|
+
if (!existsSync19(indexFile))
|
|
12763
12814
|
continue;
|
|
12764
|
-
let content =
|
|
12815
|
+
let content = readFileSync12(indexFile, "utf-8");
|
|
12765
12816
|
const srcRel = relative10(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
|
|
12766
12817
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
12767
|
-
writeFileSync7(
|
|
12818
|
+
writeFileSync7(join21(devIndexDir, `${name}.vue.js`), content);
|
|
12768
12819
|
}
|
|
12769
12820
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
12770
12821
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -12812,7 +12863,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12812
12863
|
}
|
|
12813
12864
|
return result;
|
|
12814
12865
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
12815
|
-
let content =
|
|
12866
|
+
let content = readFileSync12(outputPath, "utf-8");
|
|
12816
12867
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
12817
12868
|
const useNames = [];
|
|
12818
12869
|
let match;
|
|
@@ -12862,7 +12913,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
12862
12913
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
12863
12914
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
12864
12915
|
for (const outputPath of outputPaths) {
|
|
12865
|
-
let content =
|
|
12916
|
+
let content = readFileSync12(outputPath, "utf-8");
|
|
12866
12917
|
let changed = false;
|
|
12867
12918
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
12868
12919
|
const targetName = basename7(relPath);
|
|
@@ -12981,10 +13032,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
12981
13032
|
restoreTracePhase();
|
|
12982
13033
|
return;
|
|
12983
13034
|
}
|
|
12984
|
-
const traceDir =
|
|
13035
|
+
const traceDir = join21(buildPath2, ".absolute-trace");
|
|
12985
13036
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
12986
13037
|
mkdirSync10(traceDir, { recursive: true });
|
|
12987
|
-
writeFileSync7(
|
|
13038
|
+
writeFileSync7(join21(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
12988
13039
|
events: traceEvents,
|
|
12989
13040
|
frameworks: traceFrameworkNames,
|
|
12990
13041
|
generatedAt: new Date().toISOString(),
|
|
@@ -13014,14 +13065,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13014
13065
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
13015
13066
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
13016
13067
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
13017
|
-
const reactIndexesPath = reactDir &&
|
|
13018
|
-
const reactPagesPath = reactDir &&
|
|
13019
|
-
const htmlPagesPath = htmlDir &&
|
|
13020
|
-
const htmlScriptsPath = htmlDir &&
|
|
13021
|
-
const sveltePagesPath = svelteDir &&
|
|
13022
|
-
const vuePagesPath = vueDir &&
|
|
13023
|
-
const htmxPagesPath = htmxDir &&
|
|
13024
|
-
const angularPagesPath = angularDir &&
|
|
13068
|
+
const reactIndexesPath = reactDir && join21(reactDir, "generated", "indexes");
|
|
13069
|
+
const reactPagesPath = reactDir && join21(reactDir, "pages");
|
|
13070
|
+
const htmlPagesPath = htmlDir && join21(htmlDir, "pages");
|
|
13071
|
+
const htmlScriptsPath = htmlDir && join21(htmlDir, "scripts");
|
|
13072
|
+
const sveltePagesPath = svelteDir && join21(svelteDir, "pages");
|
|
13073
|
+
const vuePagesPath = vueDir && join21(vueDir, "pages");
|
|
13074
|
+
const htmxPagesPath = htmxDir && join21(htmxDir, "pages");
|
|
13075
|
+
const angularPagesPath = angularDir && join21(angularDir, "pages");
|
|
13025
13076
|
const frontends = [
|
|
13026
13077
|
reactDir,
|
|
13027
13078
|
htmlDir,
|
|
@@ -13059,12 +13110,12 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13059
13110
|
if (svelteDir)
|
|
13060
13111
|
serverDirMap.push({
|
|
13061
13112
|
dir: svelteDir,
|
|
13062
|
-
subdir:
|
|
13113
|
+
subdir: join21("generated", "server")
|
|
13063
13114
|
});
|
|
13064
13115
|
if (vueDir)
|
|
13065
13116
|
serverDirMap.push({
|
|
13066
13117
|
dir: vueDir,
|
|
13067
|
-
subdir:
|
|
13118
|
+
subdir: join21("generated", "server")
|
|
13068
13119
|
});
|
|
13069
13120
|
if (angularDir)
|
|
13070
13121
|
serverDirMap.push({ dir: angularDir, subdir: "generated" });
|
|
@@ -13074,8 +13125,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13074
13125
|
const [firstEntry] = serverDirMap;
|
|
13075
13126
|
if (!firstEntry)
|
|
13076
13127
|
throw new Error("Expected at least one server directory entry");
|
|
13077
|
-
serverRoot =
|
|
13078
|
-
serverOutDir =
|
|
13128
|
+
serverRoot = join21(firstEntry.dir, firstEntry.subdir);
|
|
13129
|
+
serverOutDir = join21(buildPath, basename7(firstEntry.dir));
|
|
13079
13130
|
} else if (serverDirMap.length > 1) {
|
|
13080
13131
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
13081
13132
|
serverOutDir = buildPath;
|
|
@@ -13103,7 +13154,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13103
13154
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
13104
13155
|
}
|
|
13105
13156
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
13106
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
13157
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join21(buildPath, "assets"), {
|
|
13107
13158
|
force: true,
|
|
13108
13159
|
recursive: true
|
|
13109
13160
|
}));
|
|
@@ -13152,7 +13203,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13152
13203
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
13153
13204
|
if (entry.startsWith(resolve18(reactIndexesPath))) {
|
|
13154
13205
|
const pageName = basename7(entry, ".tsx");
|
|
13155
|
-
return
|
|
13206
|
+
return join21(reactPagesPath, `${pageName}.tsx`);
|
|
13156
13207
|
}
|
|
13157
13208
|
return null;
|
|
13158
13209
|
}) : allReactEntries;
|
|
@@ -13249,7 +13300,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13249
13300
|
const compileReactConventions = async () => {
|
|
13250
13301
|
if (reactConventionSources.length === 0)
|
|
13251
13302
|
return emptyStringArray;
|
|
13252
|
-
const destDir =
|
|
13303
|
+
const destDir = join21(buildPath, "conventions", "react");
|
|
13253
13304
|
rmSync2(destDir, { force: true, recursive: true });
|
|
13254
13305
|
mkdirSync10(destDir, { recursive: true });
|
|
13255
13306
|
const destPaths = [];
|
|
@@ -13293,7 +13344,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13293
13344
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
13294
13345
|
]);
|
|
13295
13346
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
13296
|
-
const destDir =
|
|
13347
|
+
const destDir = join21(buildPath, "conventions", framework);
|
|
13297
13348
|
rmSync2(destDir, { force: true, recursive: true });
|
|
13298
13349
|
mkdirSync10(destDir, { recursive: true });
|
|
13299
13350
|
const destPaths = [];
|
|
@@ -13366,7 +13417,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13366
13417
|
}
|
|
13367
13418
|
})) : {
|
|
13368
13419
|
entries: [],
|
|
13369
|
-
generatedRoot:
|
|
13420
|
+
generatedRoot: join21(buildPath, "_island_entries")
|
|
13370
13421
|
};
|
|
13371
13422
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
13372
13423
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -13402,7 +13453,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13402
13453
|
return {};
|
|
13403
13454
|
}
|
|
13404
13455
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
13405
|
-
const refreshEntry =
|
|
13456
|
+
const refreshEntry = join21(reactIndexesPath, "_refresh.tsx");
|
|
13406
13457
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
13407
13458
|
reactClientEntryPoints.push(refreshEntry);
|
|
13408
13459
|
}
|
|
@@ -13472,19 +13523,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13472
13523
|
throw: false
|
|
13473
13524
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
13474
13525
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
13475
|
-
rmSync2(
|
|
13526
|
+
rmSync2(join21(buildPath, "react", "generated", "indexes"), {
|
|
13476
13527
|
force: true,
|
|
13477
13528
|
recursive: true
|
|
13478
13529
|
});
|
|
13479
13530
|
}
|
|
13480
13531
|
if (angularDir && angularClientPaths.length > 0) {
|
|
13481
|
-
rmSync2(
|
|
13532
|
+
rmSync2(join21(buildPath, "angular", "indexes"), {
|
|
13482
13533
|
force: true,
|
|
13483
13534
|
recursive: true
|
|
13484
13535
|
});
|
|
13485
13536
|
}
|
|
13486
13537
|
if (islandClientEntryPoints.length > 0) {
|
|
13487
|
-
rmSync2(
|
|
13538
|
+
rmSync2(join21(buildPath, "islands"), {
|
|
13488
13539
|
force: true,
|
|
13489
13540
|
recursive: true
|
|
13490
13541
|
});
|
|
@@ -13550,7 +13601,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13550
13601
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild6(mergeBunBuildConfig({
|
|
13551
13602
|
entrypoints: globalCssEntries,
|
|
13552
13603
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
13553
|
-
outdir: stylesDir ?
|
|
13604
|
+
outdir: stylesDir ? join21(buildPath, basename7(stylesDir)) : buildPath,
|
|
13554
13605
|
plugins: [stylePreprocessorPlugin2],
|
|
13555
13606
|
root: stylesDir || clientRoot,
|
|
13556
13607
|
target: "browser",
|
|
@@ -13559,7 +13610,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13559
13610
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild6(mergeBunBuildConfig({
|
|
13560
13611
|
entrypoints: vueCssPaths,
|
|
13561
13612
|
naming: `[name].[hash].[ext]`,
|
|
13562
|
-
outdir:
|
|
13613
|
+
outdir: join21(buildPath, assetsPath ? basename7(assetsPath) : "assets", "css"),
|
|
13563
13614
|
target: "browser",
|
|
13564
13615
|
throw: false
|
|
13565
13616
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -13681,7 +13732,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13681
13732
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
13682
13733
|
if (!hmrClientBundle)
|
|
13683
13734
|
return;
|
|
13684
|
-
let html =
|
|
13735
|
+
let html = readFileSync12(filePath, "utf-8");
|
|
13685
13736
|
if (html.includes("data-hmr-client"))
|
|
13686
13737
|
return;
|
|
13687
13738
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -13692,7 +13743,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13692
13743
|
const processHtmlPages = async () => {
|
|
13693
13744
|
if (!(htmlDir && htmlPagesPath))
|
|
13694
13745
|
return;
|
|
13695
|
-
const outputHtmlPages = isSingle ?
|
|
13746
|
+
const outputHtmlPages = isSingle ? join21(buildPath, "pages") : join21(buildPath, basename7(htmlDir), "pages");
|
|
13696
13747
|
mkdirSync10(outputHtmlPages, { recursive: true });
|
|
13697
13748
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
13698
13749
|
force: true,
|
|
@@ -13714,14 +13765,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13714
13765
|
const processHtmxPages = async () => {
|
|
13715
13766
|
if (!(htmxDir && htmxPagesPath))
|
|
13716
13767
|
return;
|
|
13717
|
-
const outputHtmxPages = isSingle ?
|
|
13768
|
+
const outputHtmxPages = isSingle ? join21(buildPath, "pages") : join21(buildPath, basename7(htmxDir), "pages");
|
|
13718
13769
|
mkdirSync10(outputHtmxPages, { recursive: true });
|
|
13719
13770
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
13720
13771
|
force: true,
|
|
13721
13772
|
recursive: true
|
|
13722
13773
|
});
|
|
13723
13774
|
if (shouldCopyHtmx) {
|
|
13724
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
13775
|
+
const htmxDestDir = isSingle ? buildPath : join21(buildPath, basename7(htmxDir));
|
|
13725
13776
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
13726
13777
|
}
|
|
13727
13778
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -13782,9 +13833,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13782
13833
|
writeBuildTrace(buildPath);
|
|
13783
13834
|
return { conventions: conventionsMap, manifest };
|
|
13784
13835
|
}
|
|
13785
|
-
writeFileSync7(
|
|
13836
|
+
writeFileSync7(join21(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
13786
13837
|
if (Object.keys(conventionsMap).length > 0) {
|
|
13787
|
-
writeFileSync7(
|
|
13838
|
+
writeFileSync7(join21(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
13788
13839
|
}
|
|
13789
13840
|
writeBuildTrace(buildPath);
|
|
13790
13841
|
if (tailwind && mode === "production") {
|
|
@@ -13873,7 +13924,7 @@ var init_build = __esm(() => {
|
|
|
13873
13924
|
});
|
|
13874
13925
|
|
|
13875
13926
|
// src/dev/dependencyGraph.ts
|
|
13876
|
-
import { existsSync as
|
|
13927
|
+
import { existsSync as existsSync20, readFileSync as readFileSync13 } from "fs";
|
|
13877
13928
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
13878
13929
|
import { resolve as resolve19 } from "path";
|
|
13879
13930
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -13903,10 +13954,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
13903
13954
|
];
|
|
13904
13955
|
for (const ext of extensions) {
|
|
13905
13956
|
const withExt = normalized + ext;
|
|
13906
|
-
if (
|
|
13957
|
+
if (existsSync20(withExt))
|
|
13907
13958
|
return withExt;
|
|
13908
13959
|
}
|
|
13909
|
-
if (
|
|
13960
|
+
if (existsSync20(normalized))
|
|
13910
13961
|
return normalized;
|
|
13911
13962
|
return null;
|
|
13912
13963
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -13921,7 +13972,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
13921
13972
|
}
|
|
13922
13973
|
}, addFileToGraph = (graph, filePath) => {
|
|
13923
13974
|
const normalizedPath = resolve19(filePath);
|
|
13924
|
-
if (!
|
|
13975
|
+
if (!existsSync20(normalizedPath))
|
|
13925
13976
|
return;
|
|
13926
13977
|
const dependencies = extractDependencies(normalizedPath);
|
|
13927
13978
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -13937,7 +13988,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
13937
13988
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
13938
13989
|
const processedFiles = new Set;
|
|
13939
13990
|
const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
13940
|
-
const resolvedDirs = directories.map((dir) => resolve19(dir)).filter((dir) =>
|
|
13991
|
+
const resolvedDirs = directories.map((dir) => resolve19(dir)).filter((dir) => existsSync20(dir));
|
|
13941
13992
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
13942
13993
|
for (const file3 of allFiles) {
|
|
13943
13994
|
const fullPath = resolve19(file3);
|
|
@@ -14034,15 +14085,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14034
14085
|
const lowerPath = filePath.toLowerCase();
|
|
14035
14086
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
14036
14087
|
if (loader === "html") {
|
|
14037
|
-
const content =
|
|
14088
|
+
const content = readFileSync13(filePath, "utf-8");
|
|
14038
14089
|
return extractHtmlDependencies(filePath, content);
|
|
14039
14090
|
}
|
|
14040
14091
|
if (loader === "tsx" || loader === "js") {
|
|
14041
|
-
const content =
|
|
14092
|
+
const content = readFileSync13(filePath, "utf-8");
|
|
14042
14093
|
return extractJsDependencies(filePath, content, loader);
|
|
14043
14094
|
}
|
|
14044
14095
|
if (isSvelteOrVue) {
|
|
14045
|
-
const content =
|
|
14096
|
+
const content = readFileSync13(filePath, "utf-8");
|
|
14046
14097
|
return extractSvelteVueDependencies(filePath, content);
|
|
14047
14098
|
}
|
|
14048
14099
|
return [];
|
|
@@ -14330,8 +14381,8 @@ var init_pathUtils = __esm(() => {
|
|
|
14330
14381
|
|
|
14331
14382
|
// src/dev/fileWatcher.ts
|
|
14332
14383
|
import { watch } from "fs";
|
|
14333
|
-
import { existsSync as
|
|
14334
|
-
import { join as
|
|
14384
|
+
import { existsSync as existsSync21 } from "fs";
|
|
14385
|
+
import { join as join22, resolve as resolve21 } from "path";
|
|
14335
14386
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
14336
14387
|
try {
|
|
14337
14388
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -14358,16 +14409,16 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14358
14409
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
14359
14410
|
return;
|
|
14360
14411
|
}
|
|
14361
|
-
const fullPath =
|
|
14412
|
+
const fullPath = join22(absolutePath, filename).replace(/\\/g, "/");
|
|
14362
14413
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
14363
14414
|
return;
|
|
14364
14415
|
}
|
|
14365
|
-
if (event === "rename" && !
|
|
14416
|
+
if (event === "rename" && !existsSync21(fullPath)) {
|
|
14366
14417
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
14367
14418
|
onFileChange(fullPath);
|
|
14368
14419
|
return;
|
|
14369
14420
|
}
|
|
14370
|
-
if (
|
|
14421
|
+
if (existsSync21(fullPath)) {
|
|
14371
14422
|
onFileChange(fullPath);
|
|
14372
14423
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
14373
14424
|
}
|
|
@@ -14377,7 +14428,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14377
14428
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
14378
14429
|
paths.forEach((path) => {
|
|
14379
14430
|
const absolutePath = resolve21(path).replace(/\\/g, "/");
|
|
14380
|
-
if (!
|
|
14431
|
+
if (!existsSync21(absolutePath)) {
|
|
14381
14432
|
return;
|
|
14382
14433
|
}
|
|
14383
14434
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -14388,7 +14439,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14388
14439
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
14389
14440
|
watchPaths.forEach((path) => {
|
|
14390
14441
|
const absolutePath = resolve21(path).replace(/\\/g, "/");
|
|
14391
|
-
if (!
|
|
14442
|
+
if (!existsSync21(absolutePath)) {
|
|
14392
14443
|
return;
|
|
14393
14444
|
}
|
|
14394
14445
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -14506,7 +14557,7 @@ var init_assetStore = __esm(() => {
|
|
|
14506
14557
|
});
|
|
14507
14558
|
|
|
14508
14559
|
// src/islands/pageMetadata.ts
|
|
14509
|
-
import { readFileSync as
|
|
14560
|
+
import { readFileSync as readFileSync14 } from "fs";
|
|
14510
14561
|
import { dirname as dirname13, resolve as resolve23 } from "path";
|
|
14511
14562
|
var pagePatterns, getPageDirs = (config) => [
|
|
14512
14563
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
@@ -14548,7 +14599,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
14548
14599
|
return;
|
|
14549
14600
|
const files = await scanEntryPoints(resolve23(entry.dir), pattern);
|
|
14550
14601
|
for (const filePath of files) {
|
|
14551
|
-
const source =
|
|
14602
|
+
const source = readFileSync14(filePath, "utf-8");
|
|
14552
14603
|
const islands = extractIslandUsagesFromSource(source);
|
|
14553
14604
|
pageMetadata.set(resolve23(filePath), {
|
|
14554
14605
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
@@ -14578,10 +14629,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
14578
14629
|
});
|
|
14579
14630
|
|
|
14580
14631
|
// src/dev/fileHashTracker.ts
|
|
14581
|
-
import { readFileSync as
|
|
14632
|
+
import { readFileSync as readFileSync15 } from "fs";
|
|
14582
14633
|
var computeFileHash = (filePath) => {
|
|
14583
14634
|
try {
|
|
14584
|
-
const fileContent =
|
|
14635
|
+
const fileContent = readFileSync15(filePath);
|
|
14585
14636
|
return Number(Bun.hash(fileContent));
|
|
14586
14637
|
} catch {
|
|
14587
14638
|
return UNFOUND_INDEX;
|
|
@@ -14913,7 +14964,7 @@ __export(exports_moduleServer, {
|
|
|
14913
14964
|
createModuleServer: () => createModuleServer,
|
|
14914
14965
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
14915
14966
|
});
|
|
14916
|
-
import { existsSync as
|
|
14967
|
+
import { existsSync as existsSync22, readFileSync as readFileSync16, statSync as statSync2 } from "fs";
|
|
14917
14968
|
import { basename as basename9, dirname as dirname14, extname as extname6, resolve as resolve26, relative as relative11 } from "path";
|
|
14918
14969
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
14919
14970
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
@@ -14934,7 +14985,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
14934
14985
|
${stubs}
|
|
14935
14986
|
`;
|
|
14936
14987
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
14937
|
-
const found = extensions.find((ext) =>
|
|
14988
|
+
const found = extensions.find((ext) => existsSync22(resolve26(projectRoot, srcPath + ext)));
|
|
14938
14989
|
return found ? srcPath + found : srcPath;
|
|
14939
14990
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
14940
14991
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -15046,7 +15097,7 @@ ${stubs}
|
|
|
15046
15097
|
`)}
|
|
15047
15098
|
${code}`;
|
|
15048
15099
|
}, reactTranspilerOptions, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
15049
|
-
const raw =
|
|
15100
|
+
const raw = readFileSync16(filePath, "utf-8");
|
|
15050
15101
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
15051
15102
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
15052
15103
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -15062,7 +15113,7 @@ ${transpiled}`;
|
|
|
15062
15113
|
transpiled += buildIslandMetadataExports(raw);
|
|
15063
15114
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
15064
15115
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
15065
|
-
const raw =
|
|
15116
|
+
const raw = readFileSync16(filePath, "utf-8");
|
|
15066
15117
|
const ext = extname6(filePath);
|
|
15067
15118
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
15068
15119
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -15228,7 +15279,7 @@ ${code}`;
|
|
|
15228
15279
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
15229
15280
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
15230
15281
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
15231
|
-
const raw =
|
|
15282
|
+
const raw = readFileSync16(filePath, "utf-8");
|
|
15232
15283
|
if (!svelteCompiler) {
|
|
15233
15284
|
svelteCompiler = await import("svelte/compiler");
|
|
15234
15285
|
}
|
|
@@ -15288,7 +15339,7 @@ export default __script__;`;
|
|
|
15288
15339
|
return `${cssInjection}
|
|
15289
15340
|
${code}`;
|
|
15290
15341
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
15291
|
-
const raw =
|
|
15342
|
+
const raw = readFileSync16(filePath, "utf-8");
|
|
15292
15343
|
if (!vueCompiler) {
|
|
15293
15344
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
15294
15345
|
}
|
|
@@ -15324,11 +15375,11 @@ ${code}`;
|
|
|
15324
15375
|
`);
|
|
15325
15376
|
return result;
|
|
15326
15377
|
}, resolveSvelteModulePath = (path) => {
|
|
15327
|
-
if (
|
|
15378
|
+
if (existsSync22(path))
|
|
15328
15379
|
return path;
|
|
15329
|
-
if (
|
|
15380
|
+
if (existsSync22(`${path}.ts`))
|
|
15330
15381
|
return `${path}.ts`;
|
|
15331
|
-
if (
|
|
15382
|
+
if (existsSync22(`${path}.js`))
|
|
15332
15383
|
return `${path}.js`;
|
|
15333
15384
|
return path;
|
|
15334
15385
|
}, jsResponse = (body) => {
|
|
@@ -15341,7 +15392,7 @@ ${code}`;
|
|
|
15341
15392
|
}
|
|
15342
15393
|
});
|
|
15343
15394
|
}, handleCssRequest = (filePath) => {
|
|
15344
|
-
const raw =
|
|
15395
|
+
const raw = readFileSync16(filePath, "utf-8");
|
|
15345
15396
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
15346
15397
|
return [
|
|
15347
15398
|
`const style = document.createElement('style');`,
|
|
@@ -15474,7 +15525,7 @@ export default {};
|
|
|
15474
15525
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
15475
15526
|
if (ext)
|
|
15476
15527
|
return { ext, filePath };
|
|
15477
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
15528
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync22(filePath + candidate));
|
|
15478
15529
|
if (!found)
|
|
15479
15530
|
return { ext, filePath };
|
|
15480
15531
|
const resolved = filePath + found;
|
|
@@ -15679,7 +15730,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
15679
15730
|
var init_simpleHTMXHMR = () => {};
|
|
15680
15731
|
|
|
15681
15732
|
// src/dev/rebuildTrigger.ts
|
|
15682
|
-
import { existsSync as
|
|
15733
|
+
import { existsSync as existsSync23 } from "fs";
|
|
15683
15734
|
import { basename as basename10, dirname as dirname15, relative as relative12, resolve as resolve29 } from "path";
|
|
15684
15735
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
|
|
15685
15736
|
if (!config.tailwind)
|
|
@@ -15768,7 +15819,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
15768
15819
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
15769
15820
|
}
|
|
15770
15821
|
return { ...parsed, framework: detectedFw };
|
|
15771
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
15822
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync23(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
|
|
15772
15823
|
state.fileHashes.delete(filePathInSet);
|
|
15773
15824
|
try {
|
|
15774
15825
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
@@ -15786,7 +15837,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
15786
15837
|
if (!dependents || dependents.size === 0) {
|
|
15787
15838
|
return;
|
|
15788
15839
|
}
|
|
15789
|
-
const dependentFiles = Array.from(dependents).filter((file3) =>
|
|
15840
|
+
const dependentFiles = Array.from(dependents).filter((file3) => existsSync23(file3));
|
|
15790
15841
|
if (dependentFiles.length === 0) {
|
|
15791
15842
|
return;
|
|
15792
15843
|
}
|
|
@@ -15802,7 +15853,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
15802
15853
|
try {
|
|
15803
15854
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
15804
15855
|
affectedFiles.forEach((affectedFile) => {
|
|
15805
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
15856
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync23(affectedFile)) {
|
|
15806
15857
|
validFiles.push(affectedFile);
|
|
15807
15858
|
processedFiles.add(affectedFile);
|
|
15808
15859
|
}
|
|
@@ -15827,7 +15878,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
15827
15878
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
15828
15879
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
15829
15880
|
filePathSet.forEach((filePathInSet) => {
|
|
15830
|
-
if (!
|
|
15881
|
+
if (!existsSync23(filePathInSet)) {
|
|
15831
15882
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
15832
15883
|
return;
|
|
15833
15884
|
}
|
|
@@ -15946,7 +15997,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
15946
15997
|
return componentFile;
|
|
15947
15998
|
}
|
|
15948
15999
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
15949
|
-
if (
|
|
16000
|
+
if (existsSync23(tsCounterpart)) {
|
|
15950
16001
|
return tsCounterpart;
|
|
15951
16002
|
}
|
|
15952
16003
|
if (!graph)
|
|
@@ -16092,7 +16143,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16092
16143
|
}, resolveReactEntryForPageFile = (normalized, pagesPathResolved, reactIndexesPath) => {
|
|
16093
16144
|
const pageName = basename10(normalized, ".tsx");
|
|
16094
16145
|
const indexPath = resolve29(reactIndexesPath, `${pageName}.tsx`);
|
|
16095
|
-
if (!
|
|
16146
|
+
if (!existsSync23(indexPath)) {
|
|
16096
16147
|
return;
|
|
16097
16148
|
}
|
|
16098
16149
|
return indexPath;
|
|
@@ -16104,7 +16155,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16104
16155
|
}
|
|
16105
16156
|
const pageName = basename10(dep, ".tsx");
|
|
16106
16157
|
const indexPath = resolve29(reactIndexesPath, `${pageName}.tsx`);
|
|
16107
|
-
if (
|
|
16158
|
+
if (existsSync23(indexPath) && !reactEntries.includes(indexPath)) {
|
|
16108
16159
|
reactEntries.push(indexPath);
|
|
16109
16160
|
}
|
|
16110
16161
|
});
|
|
@@ -17300,7 +17351,7 @@ __export(exports_buildDepVendor, {
|
|
|
17300
17351
|
buildDepVendor: () => buildDepVendor
|
|
17301
17352
|
});
|
|
17302
17353
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
17303
|
-
import { join as
|
|
17354
|
+
import { join as join23 } from "path";
|
|
17304
17355
|
import { rm as rm8 } from "fs/promises";
|
|
17305
17356
|
var {build: bunBuild7, Glob: Glob9 } = globalThis.Bun;
|
|
17306
17357
|
var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_"), isResolvable4 = (specifier) => {
|
|
@@ -17351,7 +17402,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17351
17402
|
framework: Array.from(framework).filter(isResolvable4)
|
|
17352
17403
|
};
|
|
17353
17404
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
17354
|
-
const { readFileSync:
|
|
17405
|
+
const { readFileSync: readFileSync17 } = await import("fs");
|
|
17355
17406
|
const transpiler4 = new Bun.Transpiler({ loader: "js" });
|
|
17356
17407
|
const newSpecs = new Set;
|
|
17357
17408
|
for (const spec of specs) {
|
|
@@ -17366,7 +17417,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17366
17417
|
}
|
|
17367
17418
|
let content;
|
|
17368
17419
|
try {
|
|
17369
|
-
content =
|
|
17420
|
+
content = readFileSync17(resolved, "utf-8");
|
|
17370
17421
|
} catch {
|
|
17371
17422
|
continue;
|
|
17372
17423
|
}
|
|
@@ -17395,7 +17446,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17395
17446
|
}, buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
17396
17447
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
17397
17448
|
const safeName = toSafeFileName5(specifier);
|
|
17398
|
-
const entryPath =
|
|
17449
|
+
const entryPath = join23(tmpDir, `${safeName}.ts`);
|
|
17399
17450
|
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
17400
17451
|
return entryPath;
|
|
17401
17452
|
}));
|
|
@@ -17414,9 +17465,9 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17414
17465
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
17415
17466
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
17416
17467
|
return {};
|
|
17417
|
-
const vendorDir =
|
|
17468
|
+
const vendorDir = join23(buildDir, "vendor");
|
|
17418
17469
|
mkdirSync11(vendorDir, { recursive: true });
|
|
17419
|
-
const tmpDir =
|
|
17470
|
+
const tmpDir = join23(buildDir, "_dep_vendor_tmp");
|
|
17420
17471
|
mkdirSync11(tmpDir, { recursive: true });
|
|
17421
17472
|
const allSpecs = new Set(initialSpecs);
|
|
17422
17473
|
const alreadyScanned = new Set;
|
|
@@ -17840,5 +17891,5 @@ export {
|
|
|
17840
17891
|
build
|
|
17841
17892
|
};
|
|
17842
17893
|
|
|
17843
|
-
//# debugId=
|
|
17894
|
+
//# debugId=8A7697E18B82F72964756E2164756E21
|
|
17844
17895
|
//# sourceMappingURL=build.js.map
|