@absolutejs/absolute 0.19.0-beta.318 → 0.19.0-beta.319
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/build.js +183 -111
- package/dist/build.js.map +3 -3
- package/dist/cli/index.js +74 -2
- package/dist/index.js +204 -132
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31025,8 +31025,14 @@ var exports_generateIslandBindings = {};
|
|
|
31025
31025
|
__export(exports_generateIslandBindings, {
|
|
31026
31026
|
generateIslandBindings: () => generateIslandBindings
|
|
31027
31027
|
});
|
|
31028
|
-
import {
|
|
31029
|
-
|
|
31028
|
+
import {
|
|
31029
|
+
existsSync as existsSync4,
|
|
31030
|
+
mkdirSync as mkdirSync2,
|
|
31031
|
+
readFileSync as readFileSync4,
|
|
31032
|
+
rmSync as rmSync2,
|
|
31033
|
+
writeFileSync as writeFileSync4
|
|
31034
|
+
} from "fs";
|
|
31035
|
+
import { dirname as dirname5, relative as relative3, resolve as resolve8 } from "path";
|
|
31030
31036
|
var ensureDir = (filePath) => {
|
|
31031
31037
|
mkdirSync2(dirname5(filePath), { recursive: true });
|
|
31032
31038
|
}, writeIfChanged2 = (filePath, content) => {
|
|
@@ -31036,11 +31042,77 @@ var ensureDir = (filePath) => {
|
|
|
31036
31042
|
if (existsSync4(filePath)) {
|
|
31037
31043
|
rmSync2(filePath, { force: true });
|
|
31038
31044
|
}
|
|
31045
|
+
}, writeHTMLCustomData = (projectRoot) => {
|
|
31046
|
+
const customDataPath = resolve8(projectRoot, ".absolutejs", "html-custom-data.json");
|
|
31047
|
+
const vscodeSettingsPath = resolve8(projectRoot, ".vscode", "settings.json");
|
|
31048
|
+
const customDataRelativePath = relative3(dirname5(vscodeSettingsPath), customDataPath).replace(/\\/g, "/");
|
|
31049
|
+
const customData = {
|
|
31050
|
+
version: 1.1,
|
|
31051
|
+
tags: [
|
|
31052
|
+
{
|
|
31053
|
+
name: "absolute-island",
|
|
31054
|
+
description: "Platform-native AbsoluteJS island element for HTML and HTMX host pages. AbsoluteJS server rendering lowers this element into SSR island markup and the client bootstrap hydrates it according to the `hydrate` mode.",
|
|
31055
|
+
attributes: [
|
|
31056
|
+
{
|
|
31057
|
+
name: "framework",
|
|
31058
|
+
description: "Target framework runtime for this island component.",
|
|
31059
|
+
values: [
|
|
31060
|
+
{ name: "react" },
|
|
31061
|
+
{ name: "svelte" },
|
|
31062
|
+
{ name: "vue" },
|
|
31063
|
+
{ name: "angular" }
|
|
31064
|
+
]
|
|
31065
|
+
},
|
|
31066
|
+
{
|
|
31067
|
+
name: "component",
|
|
31068
|
+
description: "Registry component name to render for this island."
|
|
31069
|
+
},
|
|
31070
|
+
{
|
|
31071
|
+
name: "hydrate",
|
|
31072
|
+
description: "Client hydration timing. `load` hydrates immediately, `idle` waits for idle time, `visible` waits for intersection, and `none` renders static HTML only.",
|
|
31073
|
+
values: [
|
|
31074
|
+
{ name: "load" },
|
|
31075
|
+
{ name: "idle" },
|
|
31076
|
+
{ name: "visible" },
|
|
31077
|
+
{ name: "none" }
|
|
31078
|
+
]
|
|
31079
|
+
},
|
|
31080
|
+
{
|
|
31081
|
+
name: "props",
|
|
31082
|
+
description: "JSON-serialized props payload passed to the target island component. In HTML, prefer single quotes around the attribute so the JSON can keep its double quotes."
|
|
31083
|
+
}
|
|
31084
|
+
]
|
|
31085
|
+
}
|
|
31086
|
+
]
|
|
31087
|
+
};
|
|
31088
|
+
writeIfChanged2(customDataPath, `${JSON.stringify(customData, null, 2)}
|
|
31089
|
+
`);
|
|
31090
|
+
let settings = {};
|
|
31091
|
+
if (existsSync4(vscodeSettingsPath)) {
|
|
31092
|
+
try {
|
|
31093
|
+
const parsed = JSON.parse(readFileSync4(vscodeSettingsPath, "utf-8"));
|
|
31094
|
+
if (parsed && typeof parsed === "object") {
|
|
31095
|
+
settings = parsed;
|
|
31096
|
+
}
|
|
31097
|
+
} catch {
|
|
31098
|
+
return;
|
|
31099
|
+
}
|
|
31100
|
+
}
|
|
31101
|
+
const currentCustomData = Array.isArray(settings["html.customData"]) ? settings["html.customData"].filter((value) => typeof value === "string") : [];
|
|
31102
|
+
if (!currentCustomData.includes(customDataRelativePath)) {
|
|
31103
|
+
settings["html.customData"] = [
|
|
31104
|
+
...currentCustomData,
|
|
31105
|
+
customDataRelativePath
|
|
31106
|
+
];
|
|
31107
|
+
writeIfChanged2(vscodeSettingsPath, `${JSON.stringify(settings, null, 2)}
|
|
31108
|
+
`);
|
|
31109
|
+
}
|
|
31039
31110
|
}, generateIslandBindings = (projectRoot, config) => {
|
|
31040
31111
|
const registryPath = config.islands?.registry;
|
|
31041
31112
|
if (!registryPath) {
|
|
31042
31113
|
return;
|
|
31043
31114
|
}
|
|
31115
|
+
writeHTMLCustomData(projectRoot);
|
|
31044
31116
|
const resolvedRegistryPath = resolve8(projectRoot, registryPath);
|
|
31045
31117
|
removeIfExists(resolve8(dirname5(resolvedRegistryPath), "absolute-islands.d.ts"));
|
|
31046
31118
|
if (config.reactDirectory) {
|
|
@@ -31151,12 +31223,12 @@ var init_startupBanner = __esm(() => {
|
|
|
31151
31223
|
// src/utils/logger.ts
|
|
31152
31224
|
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
31153
31225
|
const cwd = process.cwd();
|
|
31154
|
-
let
|
|
31155
|
-
|
|
31156
|
-
if (!
|
|
31157
|
-
|
|
31226
|
+
let relative4 = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
31227
|
+
relative4 = relative4.replace(/\\/g, "/");
|
|
31228
|
+
if (!relative4.startsWith("/")) {
|
|
31229
|
+
relative4 = `/${relative4}`;
|
|
31158
31230
|
}
|
|
31159
|
-
return
|
|
31231
|
+
return relative4;
|
|
31160
31232
|
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
31161
31233
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
31162
31234
|
const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
|
|
@@ -31248,9 +31320,9 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
31248
31320
|
}, generateManifest = (outputs, buildPath) => outputs.reduce((manifest, artifact) => {
|
|
31249
31321
|
const normalizedArtifactPath = normalizePath(artifact.path);
|
|
31250
31322
|
const normalizedBuildPath = normalizePath(buildPath);
|
|
31251
|
-
let
|
|
31252
|
-
|
|
31253
|
-
const segments =
|
|
31323
|
+
let relative4 = normalizedArtifactPath.startsWith(normalizedBuildPath) ? normalizedArtifactPath.slice(normalizedBuildPath.length) : normalizedArtifactPath;
|
|
31324
|
+
relative4 = relative4.replace(/^\/+/, "");
|
|
31325
|
+
const segments = relative4.split("/");
|
|
31254
31326
|
const fileWithHash = segments.pop();
|
|
31255
31327
|
if (!fileWithHash)
|
|
31256
31328
|
return manifest;
|
|
@@ -31262,16 +31334,16 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
31262
31334
|
const islandIndex = segments.findIndex((seg) => seg === "islands");
|
|
31263
31335
|
if (ext === ".css") {
|
|
31264
31336
|
const cssKey = getCssKey(pascalName, segments);
|
|
31265
|
-
if (manifest[cssKey] && manifest[cssKey] !== `/${
|
|
31266
|
-
logWarn(`Duplicate manifest key "${cssKey}" \u2014 "${manifest[cssKey]}" will be overwritten by "/${
|
|
31267
|
-
manifest[cssKey] = `/${
|
|
31337
|
+
if (manifest[cssKey] && manifest[cssKey] !== `/${relative4}`)
|
|
31338
|
+
logWarn(`Duplicate manifest key "${cssKey}" \u2014 "${manifest[cssKey]}" will be overwritten by "/${relative4}". Use unique page names across frameworks.`);
|
|
31339
|
+
manifest[cssKey] = `/${relative4}`;
|
|
31268
31340
|
return manifest;
|
|
31269
31341
|
}
|
|
31270
31342
|
if (islandIndex > UNFOUND_INDEX) {
|
|
31271
31343
|
const frameworkSegment = segments[islandIndex + 1];
|
|
31272
31344
|
if (frameworkSegment === "react" || frameworkSegment === "svelte" || frameworkSegment === "vue" || frameworkSegment === "angular") {
|
|
31273
31345
|
const manifestKey2 = getIslandManifestKey(frameworkSegment, pascalName);
|
|
31274
|
-
manifest[manifestKey2] = `/${
|
|
31346
|
+
manifest[manifestKey2] = `/${relative4}`;
|
|
31275
31347
|
return manifest;
|
|
31276
31348
|
}
|
|
31277
31349
|
}
|
|
@@ -31283,10 +31355,10 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
31283
31355
|
const isAngular = segments.some((seg) => seg === "angular");
|
|
31284
31356
|
const isClientComponent = segments.includes("client");
|
|
31285
31357
|
const manifestKey = getManifestKey(folder, pascalName, isClientComponent, isReact, isVue, isSvelte, isAngular);
|
|
31286
|
-
if (manifest[manifestKey] && manifest[manifestKey] !== `/${
|
|
31287
|
-
logWarn(`Duplicate manifest key "${manifestKey}" \u2014 "${manifest[manifestKey]}" will be overwritten by "/${
|
|
31358
|
+
if (manifest[manifestKey] && manifest[manifestKey] !== `/${relative4}`) {
|
|
31359
|
+
logWarn(`Duplicate manifest key "${manifestKey}" \u2014 "${manifest[manifestKey]}" will be overwritten by "/${relative4}". Use unique page names across frameworks.`);
|
|
31288
31360
|
}
|
|
31289
|
-
manifest[manifestKey] = `/${
|
|
31361
|
+
manifest[manifestKey] = `/${relative4}`;
|
|
31290
31362
|
return manifest;
|
|
31291
31363
|
}, {});
|
|
31292
31364
|
var init_generateManifest = __esm(() => {
|
|
@@ -31301,7 +31373,7 @@ __export(exports_generateReactIndexes, {
|
|
|
31301
31373
|
});
|
|
31302
31374
|
import { existsSync as existsSync5, mkdirSync as mkdirSync3 } from "fs";
|
|
31303
31375
|
import { readdir, rm, writeFile } from "fs/promises";
|
|
31304
|
-
import { basename as basename2, join as join4, relative as
|
|
31376
|
+
import { basename as basename2, join as join4, relative as relative4, resolve as resolve9, sep } from "path";
|
|
31305
31377
|
var {Glob: Glob2 } = globalThis.Bun;
|
|
31306
31378
|
var indexContentCache, resolveDevClientDir = () => {
|
|
31307
31379
|
const projectRoot = process.cwd();
|
|
@@ -31340,7 +31412,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
31340
31412
|
});
|
|
31341
31413
|
}));
|
|
31342
31414
|
}
|
|
31343
|
-
const pagesRelPath =
|
|
31415
|
+
const pagesRelPath = relative4(resolve9(reactIndexesDirectory), resolve9(reactPagesDirectory)).split(sep).join("/");
|
|
31344
31416
|
const promises = files.map(async (file2) => {
|
|
31345
31417
|
const fileName = basename2(file2);
|
|
31346
31418
|
const [componentName] = fileName.split(".");
|
|
@@ -31611,7 +31683,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
31611
31683
|
`
|
|
31612
31684
|
// Pre-warm: import the page module from the module server`,
|
|
31613
31685
|
`// immediately so the browser caches all /@src/ URLs.`,
|
|
31614
|
-
`import('/@src/${
|
|
31686
|
+
`import('/@src/${relative4(process.cwd(), resolve9(reactPagesDirectory, `${componentName}.tsx`)).replace(/\\/g, "/")}').catch(() => {});`
|
|
31615
31687
|
] : []
|
|
31616
31688
|
].join(`
|
|
31617
31689
|
`);
|
|
@@ -31837,7 +31909,7 @@ var scanCssEntryPoints = async (dir, ignore) => {
|
|
|
31837
31909
|
var init_scanCssEntryPoints = () => {};
|
|
31838
31910
|
|
|
31839
31911
|
// src/utils/imageProcessing.ts
|
|
31840
|
-
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as
|
|
31912
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "fs";
|
|
31841
31913
|
import { join as join5, resolve as resolve11 } from "path";
|
|
31842
31914
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
31843
31915
|
for (const size of sizes) {
|
|
@@ -31953,8 +32025,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
31953
32025
|
if (!existsSync8(metaPath) || !existsSync8(dataPath))
|
|
31954
32026
|
return null;
|
|
31955
32027
|
try {
|
|
31956
|
-
const meta = JSON.parse(
|
|
31957
|
-
const buffer =
|
|
32028
|
+
const meta = JSON.parse(readFileSync5(metaPath, "utf-8"));
|
|
32029
|
+
const buffer = readFileSync5(dataPath);
|
|
31958
32030
|
return { buffer, meta };
|
|
31959
32031
|
} catch {
|
|
31960
32032
|
return null;
|
|
@@ -32069,14 +32141,14 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
32069
32141
|
});
|
|
32070
32142
|
|
|
32071
32143
|
// src/cli/scripts/telemetry.ts
|
|
32072
|
-
import { existsSync as existsSync9, mkdirSync as mkdirSync5, readFileSync as
|
|
32144
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync5, readFileSync as readFileSync6, writeFileSync as writeFileSync6 } from "fs";
|
|
32073
32145
|
import { homedir } from "os";
|
|
32074
32146
|
import { join as join6 } from "path";
|
|
32075
32147
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
32076
32148
|
try {
|
|
32077
32149
|
if (!existsSync9(configPath))
|
|
32078
32150
|
return null;
|
|
32079
|
-
const raw =
|
|
32151
|
+
const raw = readFileSync6(configPath, "utf-8");
|
|
32080
32152
|
const config = JSON.parse(raw);
|
|
32081
32153
|
return config;
|
|
32082
32154
|
} catch {
|
|
@@ -32089,14 +32161,14 @@ var init_telemetry = __esm(() => {
|
|
|
32089
32161
|
});
|
|
32090
32162
|
|
|
32091
32163
|
// src/cli/telemetryEvent.ts
|
|
32092
|
-
import { existsSync as existsSync10, readFileSync as
|
|
32164
|
+
import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
|
|
32093
32165
|
import { arch, platform } from "os";
|
|
32094
32166
|
import { dirname as dirname6, join as join7, parse as parse2 } from "path";
|
|
32095
32167
|
var checkCandidate = (candidate) => {
|
|
32096
32168
|
if (!existsSync10(candidate)) {
|
|
32097
32169
|
return null;
|
|
32098
32170
|
}
|
|
32099
|
-
const pkg = JSON.parse(
|
|
32171
|
+
const pkg = JSON.parse(readFileSync7(candidate, "utf-8"));
|
|
32100
32172
|
if (pkg.name === "@absolutejs/absolute") {
|
|
32101
32173
|
const ver = pkg.version;
|
|
32102
32174
|
return ver;
|
|
@@ -32400,8 +32472,8 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
32400
32472
|
};
|
|
32401
32473
|
|
|
32402
32474
|
// src/build/angularLinkerPlugin.ts
|
|
32403
|
-
import { existsSync as existsSync12, mkdirSync as mkdirSync6, readFileSync as
|
|
32404
|
-
import { dirname as dirname7, join as join8, relative as
|
|
32475
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync6, readFileSync as readFileSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
32476
|
+
import { dirname as dirname7, join as join8, relative as relative5, resolve as resolve14 } from "path";
|
|
32405
32477
|
import { createHash } from "crypto";
|
|
32406
32478
|
var CACHE_DIR, angularLinkerPlugin;
|
|
32407
32479
|
var init_angularLinkerPlugin = __esm(() => {
|
|
@@ -32427,7 +32499,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
32427
32499
|
const cachePath = join8(CACHE_DIR, `${hash}.js`);
|
|
32428
32500
|
if (existsSync12(cachePath)) {
|
|
32429
32501
|
return {
|
|
32430
|
-
contents:
|
|
32502
|
+
contents: readFileSync8(cachePath, "utf-8"),
|
|
32431
32503
|
loader: "js"
|
|
32432
32504
|
};
|
|
32433
32505
|
}
|
|
@@ -32443,8 +32515,8 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
32443
32515
|
fileSystem: {
|
|
32444
32516
|
dirname: dirname7,
|
|
32445
32517
|
exists: existsSync12,
|
|
32446
|
-
readFile:
|
|
32447
|
-
relative:
|
|
32518
|
+
readFile: readFileSync8,
|
|
32519
|
+
relative: relative5,
|
|
32448
32520
|
resolve: resolve14
|
|
32449
32521
|
},
|
|
32450
32522
|
linkerJitMode: false,
|
|
@@ -32485,11 +32557,11 @@ var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPath
|
|
|
32485
32557
|
const currentPaths = new Set(currentOutputPaths.map((path) => resolve15(path)));
|
|
32486
32558
|
const glob = new Glob5("**/*");
|
|
32487
32559
|
const removals = [];
|
|
32488
|
-
for (const
|
|
32489
|
-
const absolute = resolve15(buildPath,
|
|
32560
|
+
for (const relative6 of glob.scanSync({ cwd: buildPath })) {
|
|
32561
|
+
const absolute = resolve15(buildPath, relative6);
|
|
32490
32562
|
if (currentPaths.has(absolute))
|
|
32491
32563
|
continue;
|
|
32492
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
32564
|
+
if (!HASHED_FILE_PATTERN.test(relative6))
|
|
32493
32565
|
continue;
|
|
32494
32566
|
removals.push(rm2(absolute, { force: true }));
|
|
32495
32567
|
}
|
|
@@ -32547,11 +32619,11 @@ var commonAncestor = (paths, fallback) => {
|
|
|
32547
32619
|
var init_commonAncestor = () => {};
|
|
32548
32620
|
|
|
32549
32621
|
// src/utils/validateSafePath.ts
|
|
32550
|
-
import { resolve as resolve16, relative as
|
|
32622
|
+
import { resolve as resolve16, relative as relative6 } from "path";
|
|
32551
32623
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
32552
32624
|
const absoluteBase = resolve16(baseDirectory);
|
|
32553
32625
|
const absoluteTarget = resolve16(baseDirectory, targetPath);
|
|
32554
|
-
const relativePath = normalizePath(
|
|
32626
|
+
const relativePath = normalizePath(relative6(absoluteBase, absoluteTarget));
|
|
32555
32627
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
32556
32628
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
32557
32629
|
}
|
|
@@ -32561,7 +32633,7 @@ var init_validateSafePath = () => {};
|
|
|
32561
32633
|
|
|
32562
32634
|
// src/build/resolvePackageImport.ts
|
|
32563
32635
|
import { resolve as resolve17, join as join10 } from "path";
|
|
32564
|
-
import { existsSync as existsSync13, readFileSync as
|
|
32636
|
+
import { existsSync as existsSync13, readFileSync as readFileSync9 } from "fs";
|
|
32565
32637
|
var resolveExportPath = (entry, conditions) => {
|
|
32566
32638
|
if (typeof entry === "string")
|
|
32567
32639
|
return entry;
|
|
@@ -32587,7 +32659,7 @@ var resolveExportPath = (entry, conditions) => {
|
|
|
32587
32659
|
if (!existsSync13(packageJsonPath))
|
|
32588
32660
|
return null;
|
|
32589
32661
|
try {
|
|
32590
|
-
const packageJson = JSON.parse(
|
|
32662
|
+
const packageJson = JSON.parse(readFileSync9(packageJsonPath, "utf-8"));
|
|
32591
32663
|
const { exports } = packageJson;
|
|
32592
32664
|
if (!exports)
|
|
32593
32665
|
return null;
|
|
@@ -32619,7 +32691,7 @@ import {
|
|
|
32619
32691
|
basename as basename4,
|
|
32620
32692
|
extname as extname4,
|
|
32621
32693
|
resolve as resolve18,
|
|
32622
|
-
relative as
|
|
32694
|
+
relative as relative7,
|
|
32623
32695
|
sep as sep2
|
|
32624
32696
|
} from "path";
|
|
32625
32697
|
import { env as env2 } from "process";
|
|
@@ -32723,8 +32795,8 @@ var resolveDevClientDir2 = () => {
|
|
|
32723
32795
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, {})).code;
|
|
32724
32796
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedServer) : preprocessedServer;
|
|
32725
32797
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedClient) : preprocessedClient;
|
|
32726
|
-
const rawRel = dirname8(
|
|
32727
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
32798
|
+
const rawRel = dirname8(relative7(svelteRoot, src)).replace(/\\/g, "/");
|
|
32799
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative7(process.cwd(), dirname8(src)).replace(/\\/g, "/")}` : rawRel;
|
|
32728
32800
|
const baseName = basename4(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
32729
32801
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
32730
32802
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -32741,15 +32813,15 @@ var resolveDevClientDir2 = () => {
|
|
|
32741
32813
|
const resolved = resolvedImports[idx];
|
|
32742
32814
|
const resolvedModule = resolvedModuleImports[idx];
|
|
32743
32815
|
if (resolved) {
|
|
32744
|
-
const childRel =
|
|
32816
|
+
const childRel = relative7(svelteRoot, resolved).replace(/\\/g, "/");
|
|
32745
32817
|
if (!childRel.startsWith(".."))
|
|
32746
32818
|
continue;
|
|
32747
32819
|
const childBuilt = cache.get(resolved);
|
|
32748
32820
|
if (!childBuilt)
|
|
32749
32821
|
continue;
|
|
32750
32822
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
32751
|
-
const toServer2 =
|
|
32752
|
-
const toClient2 =
|
|
32823
|
+
const toServer2 = relative7(ssrOutputDir, childBuilt.ssr).replace(/\\/g, "/");
|
|
32824
|
+
const toClient2 = relative7(clientOutputDir, childBuilt.client).replace(/\\/g, "/");
|
|
32753
32825
|
externalRewrites.set(origSpec, {
|
|
32754
32826
|
client: toClient2.startsWith(".") ? toClient2 : `./${toClient2}`,
|
|
32755
32827
|
server: toServer2.startsWith(".") ? toServer2 : `./${toServer2}`
|
|
@@ -32758,8 +32830,8 @@ var resolveDevClientDir2 = () => {
|
|
|
32758
32830
|
}
|
|
32759
32831
|
if (!resolvedModule)
|
|
32760
32832
|
continue;
|
|
32761
|
-
const toServer =
|
|
32762
|
-
const toClient =
|
|
32833
|
+
const toServer = relative7(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
32834
|
+
const toClient = relative7(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
32763
32835
|
externalRewrites.set(rawSpec, {
|
|
32764
32836
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
32765
32837
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -32794,7 +32866,7 @@ var resolveDevClientDir2 = () => {
|
|
|
32794
32866
|
}).js.code;
|
|
32795
32867
|
let code = compiled.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
32796
32868
|
if (mode === "client" && isDev2) {
|
|
32797
|
-
const moduleKey = `/@src/${
|
|
32869
|
+
const moduleKey = `/@src/${relative7(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
32798
32870
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
32799
32871
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
32800
32872
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -32830,10 +32902,10 @@ var resolveDevClientDir2 = () => {
|
|
|
32830
32902
|
};
|
|
32831
32903
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
32832
32904
|
await Promise.all(roots.map(async ({ client: client2 }) => {
|
|
32833
|
-
const relClientDir = dirname8(
|
|
32905
|
+
const relClientDir = dirname8(relative7(clientDir, client2));
|
|
32834
32906
|
const name = basename4(client2, extname4(client2));
|
|
32835
32907
|
const indexPath = join11(indexDir, relClientDir, `${name}.js`);
|
|
32836
|
-
const importRaw =
|
|
32908
|
+
const importRaw = relative7(dirname8(indexPath), client2).split(sep2).join("/");
|
|
32837
32909
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
32838
32910
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
32839
32911
|
import "${hmrClientPath3}";
|
|
@@ -32890,7 +32962,7 @@ if (typeof window !== "undefined") {
|
|
|
32890
32962
|
return {
|
|
32891
32963
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
32892
32964
|
svelteIndexPaths: roots.map(({ client: client2 }) => {
|
|
32893
|
-
const rel = dirname8(
|
|
32965
|
+
const rel = dirname8(relative7(clientDir, client2));
|
|
32894
32966
|
return join11(indexDir, rel, basename4(client2));
|
|
32895
32967
|
}),
|
|
32896
32968
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -32919,7 +32991,7 @@ __export(exports_compileVue, {
|
|
|
32919
32991
|
});
|
|
32920
32992
|
import { existsSync as existsSync15 } from "fs";
|
|
32921
32993
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
32922
|
-
import { basename as basename5, dirname as dirname9, join as join12, relative as
|
|
32994
|
+
import { basename as basename5, dirname as dirname9, join as join12, relative as relative8, resolve as resolve19 } from "path";
|
|
32923
32995
|
var {file: file3, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
32924
32996
|
var resolveDevClientDir3 = () => {
|
|
32925
32997
|
const projectRoot = process.cwd();
|
|
@@ -32969,7 +33041,7 @@ var resolveDevClientDir3 = () => {
|
|
|
32969
33041
|
return "template-only";
|
|
32970
33042
|
}
|
|
32971
33043
|
return "full";
|
|
32972
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
33044
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative8(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath) => {
|
|
32973
33045
|
if (filePath.endsWith(".vue"))
|
|
32974
33046
|
return filePath.replace(/\.vue$/, ".js");
|
|
32975
33047
|
if (filePath.endsWith(".ts"))
|
|
@@ -32996,7 +33068,7 @@ var resolveDevClientDir3 = () => {
|
|
|
32996
33068
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
32997
33069
|
if (cachedResult)
|
|
32998
33070
|
return cachedResult;
|
|
32999
|
-
const relativeFilePath =
|
|
33071
|
+
const relativeFilePath = relative8(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
33000
33072
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
33001
33073
|
const fileBaseName = basename5(sourceFilePath, ".vue");
|
|
33002
33074
|
const componentId = toKebab(fileBaseName);
|
|
@@ -33120,7 +33192,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
33120
33192
|
let result2 = code;
|
|
33121
33193
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
33122
33194
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
33123
|
-
let rel =
|
|
33195
|
+
let rel = relative8(dirname9(outputPath), targetPath).replace(/\\/g, "/");
|
|
33124
33196
|
if (!rel.startsWith("."))
|
|
33125
33197
|
rel = `./${rel}`;
|
|
33126
33198
|
result2 = result2.replaceAll(bareImport, rel);
|
|
@@ -33169,7 +33241,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
33169
33241
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
33170
33242
|
const entryBaseName = basename5(entryPath, ".vue");
|
|
33171
33243
|
const indexOutputFile = join12(indexOutputDir, `${entryBaseName}.js`);
|
|
33172
|
-
const clientOutputFile = join12(clientOutputDir,
|
|
33244
|
+
const clientOutputFile = join12(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
33173
33245
|
await mkdir3(dirname9(indexOutputFile), { recursive: true });
|
|
33174
33246
|
const vueHmrImports = isDev2 ? [
|
|
33175
33247
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -33177,7 +33249,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
33177
33249
|
] : [];
|
|
33178
33250
|
await write2(indexOutputFile, [
|
|
33179
33251
|
...vueHmrImports,
|
|
33180
|
-
`import Comp from "${
|
|
33252
|
+
`import Comp from "${relative8(dirname9(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
33181
33253
|
'import { createSSRApp, createApp } from "vue";',
|
|
33182
33254
|
"",
|
|
33183
33255
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -33278,7 +33350,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
33278
33350
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
33279
33351
|
const sourceCode = await file3(tsPath).text();
|
|
33280
33352
|
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
33281
|
-
const relativeJsPath =
|
|
33353
|
+
const relativeJsPath = relative8(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
33282
33354
|
const outClientPath = join12(clientOutputDir, relativeJsPath);
|
|
33283
33355
|
const outServerPath = join12(serverOutputDir, relativeJsPath);
|
|
33284
33356
|
await mkdir3(dirname9(outClientPath), { recursive: true });
|
|
@@ -42171,11 +42243,11 @@ ${lanes.join(`
|
|
|
42171
42243
|
return toComponents;
|
|
42172
42244
|
}
|
|
42173
42245
|
const components = toComponents.slice(start);
|
|
42174
|
-
const
|
|
42246
|
+
const relative9 = [];
|
|
42175
42247
|
for (;start < fromComponents.length; start++) {
|
|
42176
|
-
|
|
42248
|
+
relative9.push("..");
|
|
42177
42249
|
}
|
|
42178
|
-
return ["", ...
|
|
42250
|
+
return ["", ...relative9, ...components];
|
|
42179
42251
|
}
|
|
42180
42252
|
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
|
|
42181
42253
|
Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
|
|
@@ -79471,9 +79543,9 @@ ${lanes.join(`
|
|
|
79471
79543
|
if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
|
|
79472
79544
|
return;
|
|
79473
79545
|
}
|
|
79474
|
-
const
|
|
79546
|
+
const relative9 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
|
|
79475
79547
|
for (const symlinkDirectory of symlinkDirectories) {
|
|
79476
|
-
const option = resolvePath(symlinkDirectory,
|
|
79548
|
+
const option = resolvePath(symlinkDirectory, relative9);
|
|
79477
79549
|
const result2 = cb(option, target === referenceRedirect);
|
|
79478
79550
|
shouldFilterIgnoredPaths = true;
|
|
79479
79551
|
if (result2)
|
|
@@ -202038,12 +202110,12 @@ __export(exports_compileAngular, {
|
|
|
202038
202110
|
compileAngularFile: () => compileAngularFile,
|
|
202039
202111
|
compileAngular: () => compileAngular
|
|
202040
202112
|
});
|
|
202041
|
-
import { existsSync as existsSync16, readFileSync as
|
|
202042
|
-
import { join as join13, basename as basename6, sep as sep3, dirname as dirname10, resolve as resolve20, relative as
|
|
202113
|
+
import { existsSync as existsSync16, readFileSync as readFileSync10, promises as fs } from "fs";
|
|
202114
|
+
import { join as join13, basename as basename6, sep as sep3, dirname as dirname10, resolve as resolve20, relative as relative9 } from "path";
|
|
202043
202115
|
import { createHash as createHash2 } from "crypto";
|
|
202044
202116
|
var import_typescript, computeConfigHash = () => {
|
|
202045
202117
|
try {
|
|
202046
|
-
const content =
|
|
202118
|
+
const content = readFileSync10("./tsconfig.json", "utf-8");
|
|
202047
202119
|
return createHash2("md5").update(content).digest("hex");
|
|
202048
202120
|
} catch {
|
|
202049
202121
|
return "";
|
|
@@ -202101,7 +202173,7 @@ ${registrations}
|
|
|
202101
202173
|
return fileName.substring(outDir.length + 1);
|
|
202102
202174
|
return fileName;
|
|
202103
202175
|
}, compileAngularFile = async (inputPath, outDir) => {
|
|
202104
|
-
const islandMetadataExports = buildIslandMetadataExports(
|
|
202176
|
+
const islandMetadataExports = buildIslandMetadataExports(readFileSync10(inputPath, "utf-8"));
|
|
202105
202177
|
const {
|
|
202106
202178
|
readConfiguration,
|
|
202107
202179
|
performCompilation,
|
|
@@ -202371,7 +202443,7 @@ export default ${componentClassName};
|
|
|
202371
202443
|
await fs.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
|
|
202372
202444
|
}
|
|
202373
202445
|
await fs.writeFile(rawServerFile, rewritten, "utf-8");
|
|
202374
|
-
const relativePath =
|
|
202446
|
+
const relativePath = relative9(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
202375
202447
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
202376
202448
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
202377
202449
|
import "${hmrRuntimePath}";
|
|
@@ -202652,11 +202724,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
202652
202724
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
202653
202725
|
return;
|
|
202654
202726
|
}
|
|
202655
|
-
const { readFileSync:
|
|
202727
|
+
const { readFileSync: readFileSync11, writeFileSync: writeFileSync8, readdirSync } = await import("fs");
|
|
202656
202728
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
202657
202729
|
for (const file4 of files) {
|
|
202658
202730
|
const filePath = join16(vendorDir, file4);
|
|
202659
|
-
const content =
|
|
202731
|
+
const content = readFileSync11(filePath, "utf-8");
|
|
202660
202732
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
202661
202733
|
continue;
|
|
202662
202734
|
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
@@ -202780,12 +202852,12 @@ import {
|
|
|
202780
202852
|
cpSync,
|
|
202781
202853
|
existsSync as existsSync17,
|
|
202782
202854
|
mkdirSync as mkdirSync11,
|
|
202783
|
-
readFileSync as
|
|
202855
|
+
readFileSync as readFileSync11,
|
|
202784
202856
|
rmSync as rmSync3,
|
|
202785
202857
|
statSync,
|
|
202786
202858
|
writeFileSync as writeFileSync8
|
|
202787
202859
|
} from "fs";
|
|
202788
|
-
import { basename as basename7, dirname as dirname11, join as join18, relative as
|
|
202860
|
+
import { basename as basename7, dirname as dirname11, join as join18, relative as relative10, resolve as resolve21 } from "path";
|
|
202789
202861
|
import { cwd, env as env3, exit } from "process";
|
|
202790
202862
|
var {build: bunBuild6, Glob: Glob6 } = globalThis.Bun;
|
|
202791
202863
|
var isDev2, collectConventionSourceFiles = (entry) => {
|
|
@@ -202901,7 +202973,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
202901
202973
|
addWorkerPathIfExists(file4, relPath, workerPaths);
|
|
202902
202974
|
}
|
|
202903
202975
|
}, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
|
|
202904
|
-
const content =
|
|
202976
|
+
const content = readFileSync11(file4, "utf-8");
|
|
202905
202977
|
for (const pattern of patterns) {
|
|
202906
202978
|
collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
|
|
202907
202979
|
}
|
|
@@ -202947,9 +203019,9 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
202947
203019
|
}
|
|
202948
203020
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
202949
203021
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
202950
|
-
const pagesRel =
|
|
203022
|
+
const pagesRel = relative10(process.cwd(), resolve21(reactPagesPath)).replace(/\\/g, "/");
|
|
202951
203023
|
for (const file4 of indexFiles) {
|
|
202952
|
-
let content =
|
|
203024
|
+
let content = readFileSync11(join18(reactIndexesPath, file4), "utf-8");
|
|
202953
203025
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
202954
203026
|
writeFileSync8(join18(devIndexDir, file4), content);
|
|
202955
203027
|
}
|
|
@@ -202961,8 +203033,8 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
202961
203033
|
const indexFile = join18(svelteIndexDir, "pages", `${name}.js`);
|
|
202962
203034
|
if (!existsSync17(indexFile))
|
|
202963
203035
|
continue;
|
|
202964
|
-
let content =
|
|
202965
|
-
const srcRel =
|
|
203036
|
+
let content = readFileSync11(indexFile, "utf-8");
|
|
203037
|
+
const srcRel = relative10(process.cwd(), resolve21(entry)).replace(/\\/g, "/");
|
|
202966
203038
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
202967
203039
|
writeFileSync8(join18(devIndexDir, `${name}.svelte.js`), content);
|
|
202968
203040
|
}
|
|
@@ -202974,8 +203046,8 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
202974
203046
|
const indexFile = join18(vueIndexDir, `${name}.js`);
|
|
202975
203047
|
if (!existsSync17(indexFile))
|
|
202976
203048
|
continue;
|
|
202977
|
-
let content =
|
|
202978
|
-
const srcRel =
|
|
203049
|
+
let content = readFileSync11(indexFile, "utf-8");
|
|
203050
|
+
const srcRel = relative10(process.cwd(), resolve21(entry)).replace(/\\/g, "/");
|
|
202979
203051
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
202980
203052
|
writeFileSync8(join18(devIndexDir, `${name}.vue.js`), content);
|
|
202981
203053
|
}
|
|
@@ -203025,7 +203097,7 @@ var isDev2, collectConventionSourceFiles = (entry) => {
|
|
|
203025
203097
|
}
|
|
203026
203098
|
return result;
|
|
203027
203099
|
}, VUE_HMR_RUNTIME, injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
203028
|
-
let content =
|
|
203100
|
+
let content = readFileSync11(outputPath, "utf-8");
|
|
203029
203101
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
203030
203102
|
const useNames = [];
|
|
203031
203103
|
let match;
|
|
@@ -203050,7 +203122,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
203050
203122
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
203051
203123
|
const urlFileMap = new Map;
|
|
203052
203124
|
for (const srcPath of urlReferencedFiles) {
|
|
203053
|
-
const rel =
|
|
203125
|
+
const rel = relative10(projectRoot, srcPath).replace(/\\/g, "/");
|
|
203054
203126
|
const name = basename7(srcPath);
|
|
203055
203127
|
const mtime = Math.round(statSync(srcPath).mtimeMs);
|
|
203056
203128
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -203065,7 +203137,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
203065
203137
|
const output = nonReactClientOutputs.find((artifact) => basename7(artifact.path).startsWith(`${srcBase}.`));
|
|
203066
203138
|
if (!output)
|
|
203067
203139
|
continue;
|
|
203068
|
-
urlFileMap.set(basename7(srcPath), `/${
|
|
203140
|
+
urlFileMap.set(basename7(srcPath), `/${relative10(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
203069
203141
|
}
|
|
203070
203142
|
return urlFileMap;
|
|
203071
203143
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -203075,7 +203147,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
203075
203147
|
}, rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
203076
203148
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
203077
203149
|
for (const outputPath of outputPaths) {
|
|
203078
|
-
let content =
|
|
203150
|
+
let content = readFileSync11(outputPath, "utf-8");
|
|
203079
203151
|
let changed = false;
|
|
203080
203152
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
203081
203153
|
const targetName = basename7(relPath);
|
|
@@ -203732,7 +203804,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
203732
203804
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
203733
203805
|
if (!hmrClientBundle)
|
|
203734
203806
|
return;
|
|
203735
|
-
let html =
|
|
203807
|
+
let html = readFileSync11(filePath, "utf-8");
|
|
203736
203808
|
if (html.includes("data-hmr-client"))
|
|
203737
203809
|
return;
|
|
203738
203810
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
@@ -203894,7 +203966,7 @@ var init_build = __esm(() => {
|
|
|
203894
203966
|
});
|
|
203895
203967
|
|
|
203896
203968
|
// src/dev/dependencyGraph.ts
|
|
203897
|
-
import { existsSync as existsSync18, readFileSync as
|
|
203969
|
+
import { existsSync as existsSync18, readFileSync as readFileSync12 } from "fs";
|
|
203898
203970
|
var {Glob: Glob7 } = globalThis.Bun;
|
|
203899
203971
|
import { resolve as resolve22 } from "path";
|
|
203900
203972
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -204055,15 +204127,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
204055
204127
|
const lowerPath = filePath.toLowerCase();
|
|
204056
204128
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
204057
204129
|
if (loader === "html") {
|
|
204058
|
-
const content =
|
|
204130
|
+
const content = readFileSync12(filePath, "utf-8");
|
|
204059
204131
|
return extractHtmlDependencies(filePath, content);
|
|
204060
204132
|
}
|
|
204061
204133
|
if (loader === "tsx" || loader === "js") {
|
|
204062
|
-
const content =
|
|
204134
|
+
const content = readFileSync12(filePath, "utf-8");
|
|
204063
204135
|
return extractJsDependencies(filePath, content, loader);
|
|
204064
204136
|
}
|
|
204065
204137
|
if (isSvelteOrVue) {
|
|
204066
|
-
const content =
|
|
204138
|
+
const content = readFileSync12(filePath, "utf-8");
|
|
204067
204139
|
return extractSvelteVueDependencies(filePath, content);
|
|
204068
204140
|
}
|
|
204069
204141
|
return [];
|
|
@@ -204529,10 +204601,10 @@ var init_assetStore = __esm(() => {
|
|
|
204529
204601
|
});
|
|
204530
204602
|
|
|
204531
204603
|
// src/dev/fileHashTracker.ts
|
|
204532
|
-
import { readFileSync as
|
|
204604
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
204533
204605
|
var computeFileHash = (filePath) => {
|
|
204534
204606
|
try {
|
|
204535
|
-
const fileContent =
|
|
204607
|
+
const fileContent = readFileSync13(filePath);
|
|
204536
204608
|
return Number(Bun.hash(fileContent));
|
|
204537
204609
|
} catch {
|
|
204538
204610
|
return UNFOUND_INDEX;
|
|
@@ -205290,8 +205362,8 @@ __export(exports_moduleServer, {
|
|
|
205290
205362
|
createModuleServer: () => createModuleServer,
|
|
205291
205363
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
205292
205364
|
});
|
|
205293
|
-
import { existsSync as existsSync20, readFileSync as
|
|
205294
|
-
import { basename as basename10, dirname as dirname13, extname as extname5, resolve as resolve28, relative as
|
|
205365
|
+
import { existsSync as existsSync20, readFileSync as readFileSync14, statSync as statSync2 } from "fs";
|
|
205366
|
+
import { basename as basename10, dirname as dirname13, extname as extname5, resolve as resolve28, relative as relative11 } from "path";
|
|
205295
205367
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
205296
205368
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
205297
205369
|
const allExports = [];
|
|
@@ -205339,23 +205411,23 @@ ${stubs}
|
|
|
205339
205411
|
}
|
|
205340
205412
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
205341
205413
|
const absPath = resolve28(fileDir, relPath);
|
|
205342
|
-
const rel =
|
|
205414
|
+
const rel = relative11(projectRoot, absPath);
|
|
205343
205415
|
const extension = extname5(rel);
|
|
205344
205416
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
205345
205417
|
if (extname5(srcPath) === ".svelte") {
|
|
205346
|
-
srcPath =
|
|
205418
|
+
srcPath = relative11(projectRoot, resolveSvelteModulePath(resolve28(projectRoot, srcPath)));
|
|
205347
205419
|
}
|
|
205348
205420
|
return srcUrl(srcPath, projectRoot);
|
|
205349
205421
|
}, resolveAbsoluteSpecifier = (specifier, projectRoot, importer, frameworkDirs) => {
|
|
205350
205422
|
if (importer && frameworkDirs) {
|
|
205351
205423
|
const compatModule = resolveIslandCompatModule(specifier, importer, frameworkDirs);
|
|
205352
205424
|
if (compatModule) {
|
|
205353
|
-
return
|
|
205425
|
+
return relative11(projectRoot, compatModule);
|
|
205354
205426
|
}
|
|
205355
205427
|
}
|
|
205356
205428
|
try {
|
|
205357
205429
|
const target = resolvePackageImport(specifier, ["browser", "import"]) ?? Bun.resolveSync(specifier, projectRoot);
|
|
205358
|
-
return
|
|
205430
|
+
return relative11(projectRoot, target);
|
|
205359
205431
|
} catch {
|
|
205360
205432
|
return;
|
|
205361
205433
|
}
|
|
@@ -205388,10 +205460,10 @@ ${stubs}
|
|
|
205388
205460
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
205389
205461
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
|
|
205390
205462
|
if (absPath.startsWith(projectRoot)) {
|
|
205391
|
-
const rel2 =
|
|
205463
|
+
const rel2 = relative11(projectRoot, absPath).replace(/\\/g, "/");
|
|
205392
205464
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
205393
205465
|
}
|
|
205394
|
-
const rel =
|
|
205466
|
+
const rel = relative11(projectRoot, absPath).replace(/\\/g, "/");
|
|
205395
205467
|
if (!rel.startsWith("..")) {
|
|
205396
205468
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
205397
205469
|
}
|
|
@@ -205399,12 +205471,12 @@ ${stubs}
|
|
|
205399
205471
|
});
|
|
205400
205472
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
205401
205473
|
const absPath = resolve28(fileDir, relPath);
|
|
205402
|
-
const rel =
|
|
205474
|
+
const rel = relative11(projectRoot, absPath);
|
|
205403
205475
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
205404
205476
|
});
|
|
205405
205477
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
205406
205478
|
const absPath = resolve28(fileDir, relPath);
|
|
205407
|
-
const rel =
|
|
205479
|
+
const rel = relative11(projectRoot, absPath);
|
|
205408
205480
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
205409
205481
|
});
|
|
205410
205482
|
return result;
|
|
@@ -205432,7 +205504,7 @@ ${stubs}
|
|
|
205432
205504
|
`)}
|
|
205433
205505
|
${code}`;
|
|
205434
205506
|
}, reactTranspilerOptions, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter, frameworkDirs) => {
|
|
205435
|
-
const raw =
|
|
205507
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205436
205508
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
205437
205509
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
205438
205510
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -205443,12 +205515,12 @@ ${code}`;
|
|
|
205443
205515
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
205444
205516
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
205445
205517
|
${transpiled}`;
|
|
205446
|
-
const relPath =
|
|
205518
|
+
const relPath = relative11(projectRoot, filePath).replace(/\\/g, "/");
|
|
205447
205519
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
205448
205520
|
transpiled += buildIslandMetadataExports(raw);
|
|
205449
205521
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter, frameworkDirs);
|
|
205450
205522
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir, frameworkDirs) => {
|
|
205451
|
-
const raw =
|
|
205523
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205452
205524
|
const ext = extname5(filePath);
|
|
205453
205525
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
205454
205526
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -205594,17 +205666,17 @@ ${code}`;
|
|
|
205594
205666
|
if (compiled.css?.code) {
|
|
205595
205667
|
const cssPath = `${filePath}.css`;
|
|
205596
205668
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
205597
|
-
const cssUrl = srcUrl(
|
|
205669
|
+
const cssUrl = srcUrl(relative11(projectRoot, cssPath), projectRoot);
|
|
205598
205670
|
code = `import "${cssUrl}";
|
|
205599
205671
|
${code}`;
|
|
205600
205672
|
}
|
|
205601
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
205673
|
+
const moduleUrl = `${SRC_PREFIX}${relative11(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
205602
205674
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
205603
205675
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
205604
205676
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
205605
205677
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
205606
205678
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, frameworkDirs) => {
|
|
205607
|
-
const raw =
|
|
205679
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205608
205680
|
if (!svelteCompiler) {
|
|
205609
205681
|
svelteCompiler = await import("svelte/compiler");
|
|
205610
205682
|
}
|
|
@@ -205660,7 +205732,7 @@ export default __script__;`;
|
|
|
205660
205732
|
return `${cssInjection}
|
|
205661
205733
|
${code}`;
|
|
205662
205734
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, frameworkDirs) => {
|
|
205663
|
-
const raw =
|
|
205735
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205664
205736
|
if (!vueCompiler) {
|
|
205665
205737
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
205666
205738
|
}
|
|
@@ -205678,7 +205750,7 @@ ${code}`;
|
|
|
205678
205750
|
return rewriteImports2(code, filePath, projectRoot, rewriter, frameworkDirs);
|
|
205679
205751
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
205680
205752
|
const hmrBase = vueDir ? resolve28(vueDir) : projectRoot;
|
|
205681
|
-
const hmrId =
|
|
205753
|
+
const hmrId = relative11(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
205682
205754
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
205683
205755
|
result += [
|
|
205684
205756
|
"",
|
|
@@ -205709,7 +205781,7 @@ ${code}`;
|
|
|
205709
205781
|
}
|
|
205710
205782
|
});
|
|
205711
205783
|
}, handleCssRequest = (filePath) => {
|
|
205712
|
-
const raw =
|
|
205784
|
+
const raw = readFileSync14(filePath, "utf-8");
|
|
205713
205785
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
205714
205786
|
return [
|
|
205715
205787
|
`const style = document.createElement('style');`,
|
|
@@ -206047,7 +206119,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
206047
206119
|
// src/dev/rebuildTrigger.ts
|
|
206048
206120
|
import { existsSync as existsSync21 } from "fs";
|
|
206049
206121
|
import { rm as rm8 } from "fs/promises";
|
|
206050
|
-
import { basename as basename11, dirname as dirname14, relative as
|
|
206122
|
+
import { basename as basename11, dirname as dirname14, relative as relative12, resolve as resolve31 } from "path";
|
|
206051
206123
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
206052
206124
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
206053
206125
|
if (pathLineCol) {
|
|
@@ -206242,7 +206314,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
206242
206314
|
if (framework === "unknown") {
|
|
206243
206315
|
const { invalidate: invalidate2 } = (init_transformCache(), __toCommonJS(exports_transformCache));
|
|
206244
206316
|
invalidate2(resolve31(filePath));
|
|
206245
|
-
const relPath =
|
|
206317
|
+
const relPath = relative12(process.cwd(), filePath);
|
|
206246
206318
|
logHmrUpdate(relPath);
|
|
206247
206319
|
return;
|
|
206248
206320
|
}
|
|
@@ -206515,7 +206587,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
206515
206587
|
}, getModuleUrl = async (pageFile) => {
|
|
206516
206588
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
206517
206589
|
invalidateModule2(pageFile);
|
|
206518
|
-
const rel =
|
|
206590
|
+
const rel = relative12(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
206519
206591
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
206520
206592
|
warmCache2(url);
|
|
206521
206593
|
return url;
|
|
@@ -206547,7 +206619,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
206547
206619
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
206548
206620
|
if (pageModuleUrl) {
|
|
206549
206621
|
const serverDuration = Date.now() - startTime;
|
|
206550
|
-
state.lastHmrPath =
|
|
206622
|
+
state.lastHmrPath = relative12(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
206551
206623
|
state.lastHmrFramework = "react";
|
|
206552
206624
|
broadcastToClients(state, {
|
|
206553
206625
|
data: {
|
|
@@ -206999,7 +207071,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
206999
207071
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
207000
207072
|
const pascalName = toPascal(baseName);
|
|
207001
207073
|
const vueRoot = config.vueDirectory;
|
|
207002
|
-
const hmrId = vueRoot ?
|
|
207074
|
+
const hmrId = vueRoot ? relative12(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
207003
207075
|
const cssKey = `${pascalName}CSS`;
|
|
207004
207076
|
const cssUrl = manifest[cssKey] || null;
|
|
207005
207077
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -207625,7 +207697,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
207625
207697
|
return Array.from(specifiers).filter(isResolvable3);
|
|
207626
207698
|
}, generateEntrySource2 = (specifier) => `export * from '${specifier}';
|
|
207627
207699
|
`, rewriteVendorFiles = async (vendorDir) => {
|
|
207628
|
-
const { readdirSync: readdirSync2, readFileSync:
|
|
207700
|
+
const { readdirSync: readdirSync2, readFileSync: readFileSync15, writeFileSync: writeFileSync9 } = await import("fs");
|
|
207629
207701
|
const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
|
|
207630
207702
|
const reactPaths = Object.entries(computeVendorPaths2());
|
|
207631
207703
|
const rewriteContent = (content) => reactPaths.reduce((acc, [specifier, webPath]) => {
|
|
@@ -207636,7 +207708,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
207636
207708
|
const files = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
|
|
207637
207709
|
for (const file4 of files) {
|
|
207638
207710
|
const filePath = join20(vendorDir, file4);
|
|
207639
|
-
const original =
|
|
207711
|
+
const original = readFileSync15(filePath, "utf-8");
|
|
207640
207712
|
const rewritten = rewriteContent(original);
|
|
207641
207713
|
if (rewritten !== original)
|
|
207642
207714
|
writeFileSync9(filePath, rewritten);
|
|
@@ -208414,7 +208486,7 @@ __export(exports_prerender, {
|
|
|
208414
208486
|
prerender: () => prerender,
|
|
208415
208487
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
208416
208488
|
});
|
|
208417
|
-
import { mkdirSync as mkdirSync13, readFileSync as
|
|
208489
|
+
import { mkdirSync as mkdirSync13, readFileSync as readFileSync15 } from "fs";
|
|
208418
208490
|
import { join as join21 } from "path";
|
|
208419
208491
|
var MAX_STARTUP_ATTEMPTS = 50, STARTUP_POLL_INTERVAL_MS = 100, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
208420
208492
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
@@ -208422,7 +208494,7 @@ var MAX_STARTUP_ATTEMPTS = 50, STARTUP_POLL_INTERVAL_MS = 100, PRERENDER_BYPASS_
|
|
|
208422
208494
|
}, readTimestamp = (htmlPath) => {
|
|
208423
208495
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
208424
208496
|
try {
|
|
208425
|
-
const content =
|
|
208497
|
+
const content = readFileSync15(metaPath, "utf-8");
|
|
208426
208498
|
return Number(content) || 0;
|
|
208427
208499
|
} catch {
|
|
208428
208500
|
return 0;
|
|
@@ -208550,12 +208622,12 @@ __export(exports_devCert, {
|
|
|
208550
208622
|
hasCert: () => hasCert,
|
|
208551
208623
|
ensureDevCert: () => ensureDevCert
|
|
208552
208624
|
});
|
|
208553
|
-
import { existsSync as existsSync24, mkdirSync as mkdirSync14, readFileSync as
|
|
208625
|
+
import { existsSync as existsSync24, mkdirSync as mkdirSync14, readFileSync as readFileSync17, rmSync as rmSync4 } from "fs";
|
|
208554
208626
|
import { platform as platform3 } from "os";
|
|
208555
208627
|
import { join as join23 } from "path";
|
|
208556
208628
|
var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`), devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`), certFilesExist = () => existsSync24(CERT_PATH) && existsSync24(KEY_PATH), isCertExpired = () => {
|
|
208557
208629
|
try {
|
|
208558
|
-
const certPem =
|
|
208630
|
+
const certPem = readFileSync17(CERT_PATH, "utf-8");
|
|
208559
208631
|
const proc = Bun.spawnSync(["openssl", "x509", "-enddate", "-noout"], {
|
|
208560
208632
|
stdin: new TextEncoder().encode(certPem)
|
|
208561
208633
|
});
|
|
@@ -208644,8 +208716,8 @@ var CERT_DIR, CERT_PATH, KEY_PATH, CERT_VALIDITY_DAYS = 365, devLog = (msg) => c
|
|
|
208644
208716
|
return null;
|
|
208645
208717
|
try {
|
|
208646
208718
|
return {
|
|
208647
|
-
cert:
|
|
208648
|
-
key:
|
|
208719
|
+
cert: readFileSync17(paths.cert, "utf-8"),
|
|
208720
|
+
key: readFileSync17(paths.key, "utf-8")
|
|
208649
208721
|
};
|
|
208650
208722
|
} catch {
|
|
208651
208723
|
return null;
|
|
@@ -208799,8 +208871,8 @@ var handleStaticPageRequest = async (pagePath) => {
|
|
|
208799
208871
|
var handleHTMLPageRequest = (pagePath) => handleStaticPageRequest(pagePath);
|
|
208800
208872
|
var handleHTMXPageRequest = (pagePath) => handleStaticPageRequest(pagePath);
|
|
208801
208873
|
// src/core/prepare.ts
|
|
208802
|
-
import { existsSync as existsSync23, readdirSync as readdirSync2, readFileSync as
|
|
208803
|
-
import { basename as basename12, join as join22, relative as
|
|
208874
|
+
import { existsSync as existsSync23, readdirSync as readdirSync2, readFileSync as readFileSync16 } from "fs";
|
|
208875
|
+
import { basename as basename12, join as join22, relative as relative13, resolve as resolve34 } from "path";
|
|
208804
208876
|
|
|
208805
208877
|
// src/utils/loadConfig.ts
|
|
208806
208878
|
import { resolve as resolve5 } from "path";
|
|
@@ -208880,7 +208952,7 @@ var warmPrewarmDirs = async (prewarmDirs, warmCache2, SRC_URL_PREFIX2) => {
|
|
|
208880
208952
|
for (const file4 of files) {
|
|
208881
208953
|
if (file4.includes("/node_modules/"))
|
|
208882
208954
|
continue;
|
|
208883
|
-
const rel =
|
|
208955
|
+
const rel = relative13(process.cwd(), file4).replace(/\\/g, "/");
|
|
208884
208956
|
warmCache2(`${SRC_URL_PREFIX2}${rel}`);
|
|
208885
208957
|
}
|
|
208886
208958
|
};
|
|
@@ -208908,7 +208980,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
208908
208980
|
const srcPath = resolve34(devIndexDir, fileName);
|
|
208909
208981
|
if (!existsSync23(srcPath))
|
|
208910
208982
|
continue;
|
|
208911
|
-
const rel =
|
|
208983
|
+
const rel = relative13(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
208912
208984
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
208913
208985
|
}
|
|
208914
208986
|
};
|
|
@@ -209014,7 +209086,7 @@ var prepare = async (configOrPath) => {
|
|
|
209014
209086
|
const buildDir = resolve34(isDev3 ? config.buildDirectory ?? "build" : process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
209015
209087
|
if (isDev3)
|
|
209016
209088
|
return prepareDev(config, buildDir);
|
|
209017
|
-
const manifest = JSON.parse(
|
|
209089
|
+
const manifest = JSON.parse(readFileSync16(`${buildDir}/manifest.json`, "utf-8"));
|
|
209018
209090
|
setCurrentIslandManifest(manifest);
|
|
209019
209091
|
if (config.islands?.registry) {
|
|
209020
209092
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -209022,7 +209094,7 @@ var prepare = async (configOrPath) => {
|
|
|
209022
209094
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
209023
209095
|
const conventionsPath = join22(buildDir, "conventions.json");
|
|
209024
209096
|
if (existsSync23(conventionsPath)) {
|
|
209025
|
-
const conventions2 = JSON.parse(
|
|
209097
|
+
const conventions2 = JSON.parse(readFileSync16(conventionsPath, "utf-8"));
|
|
209026
209098
|
setConventions(conventions2);
|
|
209027
209099
|
}
|
|
209028
209100
|
const { staticPlugin } = await import("@elysiajs/static");
|
|
@@ -209282,7 +209354,7 @@ var jsonLd2 = (schema) => {
|
|
|
209282
209354
|
};
|
|
209283
209355
|
// src/utils/defineEnv.ts
|
|
209284
209356
|
var {env: bunEnv } = globalThis.Bun;
|
|
209285
|
-
import { existsSync as existsSync25, readFileSync as
|
|
209357
|
+
import { existsSync as existsSync25, readFileSync as readFileSync18 } from "fs";
|
|
209286
209358
|
import { resolve as resolve35 } from "path";
|
|
209287
209359
|
|
|
209288
209360
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
@@ -215324,13 +215396,13 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
215324
215396
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
215325
215397
|
if (sensitiveKeys.length === 0)
|
|
215326
215398
|
return;
|
|
215327
|
-
const envContent =
|
|
215399
|
+
const envContent = readFileSync18(envPath, "utf-8");
|
|
215328
215400
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
215329
215401
|
if (presentKeys.length === 0)
|
|
215330
215402
|
return;
|
|
215331
215403
|
const gitignorePath = resolve35(cwd2, ".gitignore");
|
|
215332
215404
|
if (existsSync25(gitignorePath)) {
|
|
215333
|
-
const gitignore =
|
|
215405
|
+
const gitignore = readFileSync18(gitignorePath, "utf-8");
|
|
215334
215406
|
if (gitignore.split(`
|
|
215335
215407
|
`).some((line) => line.trim() === ".env"))
|
|
215336
215408
|
return;
|
|
@@ -215450,5 +215522,5 @@ export {
|
|
|
215450
215522
|
ANGULAR_INIT_TIMEOUT_MS
|
|
215451
215523
|
};
|
|
215452
215524
|
|
|
215453
|
-
//# debugId=
|
|
215525
|
+
//# debugId=AAE980E3D30DAA4E64756E2164756E21
|
|
215454
215526
|
//# sourceMappingURL=index.js.map
|