@vesk/vesk-cli 0.2.76 → 0.2.77
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/cli.js +166 -141
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -35728,40 +35728,40 @@ var init_paths = __esm({
|
|
|
35728
35728
|
|
|
35729
35729
|
// ../adapter/src/platform-output.ts
|
|
35730
35730
|
import {
|
|
35731
|
-
mkdirSync as
|
|
35731
|
+
mkdirSync as mkdirSync7,
|
|
35732
35732
|
copyFileSync as copyFileSync2,
|
|
35733
35733
|
readdirSync as readdirSync4,
|
|
35734
35734
|
statSync as statSync7,
|
|
35735
35735
|
existsSync as existsSync15,
|
|
35736
|
-
writeFileSync as
|
|
35736
|
+
writeFileSync as writeFileSync8,
|
|
35737
35737
|
rmSync as rmSync2,
|
|
35738
35738
|
readFileSync as readFileSync17
|
|
35739
35739
|
} from "node:fs";
|
|
35740
35740
|
import { resolve as resolve13, join as join11, extname as extname3, dirname as dirname11 } from "node:path";
|
|
35741
35741
|
function ensureCleanDir(dir) {
|
|
35742
35742
|
rmSync2(dir, { recursive: true, force: true });
|
|
35743
|
-
|
|
35743
|
+
mkdirSync7(dir, { recursive: true });
|
|
35744
35744
|
}
|
|
35745
35745
|
function copyDirContents(srcDir, destDir) {
|
|
35746
35746
|
if (!existsSync15(srcDir)) return;
|
|
35747
|
-
|
|
35747
|
+
mkdirSync7(destDir, { recursive: true });
|
|
35748
35748
|
for (const entry of readdirSync4(srcDir)) {
|
|
35749
35749
|
const srcPath = join11(srcDir, entry);
|
|
35750
35750
|
const destPath = join11(destDir, entry);
|
|
35751
35751
|
if (statSync7(srcPath).isDirectory()) {
|
|
35752
35752
|
copyDirContents(srcPath, destPath);
|
|
35753
35753
|
} else {
|
|
35754
|
-
|
|
35754
|
+
mkdirSync7(dirname11(destPath), { recursive: true });
|
|
35755
35755
|
copyFileSync2(srcPath, destPath);
|
|
35756
35756
|
}
|
|
35757
35757
|
}
|
|
35758
35758
|
}
|
|
35759
35759
|
function writeFile(path, content) {
|
|
35760
|
-
|
|
35761
|
-
|
|
35760
|
+
mkdirSync7(dirname11(path), { recursive: true });
|
|
35761
|
+
writeFileSync8(path, content, "utf-8");
|
|
35762
35762
|
}
|
|
35763
35763
|
function writePlatformStatic(buildStaticDir, platformStaticDir) {
|
|
35764
|
-
|
|
35764
|
+
mkdirSync7(platformStaticDir, { recursive: true });
|
|
35765
35765
|
const publicDir = resolve13(buildStaticDir, "public");
|
|
35766
35766
|
if (existsSync15(publicDir)) {
|
|
35767
35767
|
copyDirContents(publicDir, platformStaticDir);
|
|
@@ -35771,7 +35771,7 @@ function writePlatformStatic(buildStaticDir, platformStaticDir) {
|
|
|
35771
35771
|
const runtimeAlias = resolve13(platformStaticDir, "_vesk", "runtime.js");
|
|
35772
35772
|
const clientPath = resolve13(buildStaticDir, "client.js");
|
|
35773
35773
|
if (existsSync15(clientPath)) {
|
|
35774
|
-
|
|
35774
|
+
mkdirSync7(dirname11(runtimeAlias), { recursive: true });
|
|
35775
35775
|
copyFileSync2(clientPath, runtimeAlias);
|
|
35776
35776
|
}
|
|
35777
35777
|
}
|
|
@@ -35861,9 +35861,9 @@ __export(plugins_exports, {
|
|
|
35861
35861
|
});
|
|
35862
35862
|
import {
|
|
35863
35863
|
readFileSync as readFileSync19,
|
|
35864
|
-
writeFileSync as
|
|
35864
|
+
writeFileSync as writeFileSync9,
|
|
35865
35865
|
existsSync as existsSync17,
|
|
35866
|
-
mkdirSync as
|
|
35866
|
+
mkdirSync as mkdirSync8,
|
|
35867
35867
|
statSync as statSync9
|
|
35868
35868
|
} from "node:fs";
|
|
35869
35869
|
import { resolve as resolve15, dirname as dirname13, join as join12, extname as extname4, basename as basename2 } from "node:path";
|
|
@@ -35901,8 +35901,8 @@ function readPluginState(veskDir) {
|
|
|
35901
35901
|
function writePluginState(veskDir, state) {
|
|
35902
35902
|
const file = stateFilePath(veskDir);
|
|
35903
35903
|
const dir = dirname13(file);
|
|
35904
|
-
if (!existsSync17(dir))
|
|
35905
|
-
|
|
35904
|
+
if (!existsSync17(dir)) mkdirSync8(dir, { recursive: true });
|
|
35905
|
+
writeFileSync9(file, JSON.stringify(state, null, 2) + "\n", "utf-8");
|
|
35906
35906
|
}
|
|
35907
35907
|
function resolvePackage(appDir, pkg) {
|
|
35908
35908
|
const require3 = createRequire4(resolve15(appDir, "package.json"));
|
|
@@ -36780,15 +36780,15 @@ __export(static_exports, {
|
|
|
36780
36780
|
generateSitemap: () => generateSitemap,
|
|
36781
36781
|
generateSsgRoutes: () => generateSsgRoutes
|
|
36782
36782
|
});
|
|
36783
|
-
import { mkdirSync as
|
|
36783
|
+
import { mkdirSync as mkdirSync9, copyFileSync as copyFileSync3, readdirSync as readdirSync5, statSync as statSync10, existsSync as existsSync18, writeFileSync as writeFileSync10, readFileSync as readFileSync20 } from "node:fs";
|
|
36784
36784
|
import { resolve as resolve16, join as join13 } from "node:path";
|
|
36785
36785
|
function copyStaticAssets2(publicDir, outDir) {
|
|
36786
36786
|
const targetDir = resolve16(outDir, "static", "public");
|
|
36787
|
-
|
|
36787
|
+
mkdirSync9(targetDir, { recursive: true });
|
|
36788
36788
|
if (!existsSync18(publicDir))
|
|
36789
36789
|
return;
|
|
36790
36790
|
function copyDir(src2, dest) {
|
|
36791
|
-
|
|
36791
|
+
mkdirSync9(dest, { recursive: true });
|
|
36792
36792
|
const entries = readdirSync5(src2);
|
|
36793
36793
|
for (const entry of entries) {
|
|
36794
36794
|
const srcPath = join13(src2, entry);
|
|
@@ -36806,7 +36806,7 @@ function copyStaticAssets2(publicDir, outDir) {
|
|
|
36806
36806
|
async function generateSsgRoutes(routeTree, appDir, outDir, plugins, headExtra, cssUrls) {
|
|
36807
36807
|
const { ssg: ssg2 } = await Promise.resolve().then(() => (init_server_render(), server_render_exports));
|
|
36808
36808
|
const prerenderDir = resolve16(outDir, "prerendered");
|
|
36809
|
-
|
|
36809
|
+
mkdirSync9(prerenderDir, { recursive: true });
|
|
36810
36810
|
const ssgOptions = { plugins, headExtra, cssUrls };
|
|
36811
36811
|
const results = [];
|
|
36812
36812
|
async function evaluateExport(src2, exportName) {
|
|
@@ -36843,8 +36843,8 @@ async function generateSsgRoutes(routeTree, appDir, outDir, plugins, headExtra,
|
|
|
36843
36843
|
console.error(`vesk: SSG path escaped output dir \u2014 skipping ${pagePath} (path: ${urlPath})`);
|
|
36844
36844
|
continue;
|
|
36845
36845
|
}
|
|
36846
|
-
|
|
36847
|
-
|
|
36846
|
+
mkdirSync9(resolve16(htmlPath, ".."), { recursive: true });
|
|
36847
|
+
writeFileSync10(htmlPath, result.html);
|
|
36848
36848
|
results.push({ path: urlPath, html: htmlPath, static: result.static, params });
|
|
36849
36849
|
} catch (e) {
|
|
36850
36850
|
const message = e instanceof Error ? e.message : String(e);
|
|
@@ -36856,8 +36856,8 @@ async function generateSsgRoutes(routeTree, appDir, outDir, plugins, headExtra,
|
|
|
36856
36856
|
try {
|
|
36857
36857
|
const result = await ssg2(src2, null, void 0, ssgOptions);
|
|
36858
36858
|
const htmlPath = resolve16(prerenderDir, node.fullPath === "/" ? "index.html" : `${node.fullPath.slice(1)}.html`);
|
|
36859
|
-
|
|
36860
|
-
|
|
36859
|
+
mkdirSync9(resolve16(htmlPath, ".."), { recursive: true });
|
|
36860
|
+
writeFileSync10(htmlPath, result.html);
|
|
36861
36861
|
results.push({ path: node.fullPath, html: htmlPath, static: result.static });
|
|
36862
36862
|
} catch (e) {
|
|
36863
36863
|
const message = e instanceof Error ? e.message : String(e);
|
|
@@ -36927,7 +36927,7 @@ __export(image_pipeline_exports, {
|
|
|
36927
36927
|
collectImageRefs: () => collectImageRefs,
|
|
36928
36928
|
optimizeImages: () => optimizeImages
|
|
36929
36929
|
});
|
|
36930
|
-
import { mkdirSync as
|
|
36930
|
+
import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync11, readFileSync as readFileSync21, existsSync as existsSync19, readdirSync as readdirSync6, statSync as statSync11 } from "node:fs";
|
|
36931
36931
|
import { spawnSync } from "node:child_process";
|
|
36932
36932
|
import { resolve as resolve17, extname as extname5, dirname as dirname14, join as join14 } from "node:path";
|
|
36933
36933
|
import { createRequire as createRequire5 } from "node:module";
|
|
@@ -36957,7 +36957,7 @@ function writeProbeMemo(usable) {
|
|
|
36957
36957
|
if (path === null)
|
|
36958
36958
|
return;
|
|
36959
36959
|
try {
|
|
36960
|
-
|
|
36960
|
+
writeFileSync11(path, JSON.stringify({ usable, at: Date.now() }), "utf-8");
|
|
36961
36961
|
} catch {
|
|
36962
36962
|
}
|
|
36963
36963
|
}
|
|
@@ -36995,8 +36995,8 @@ async function processImage(srcPath, outDir, baseName) {
|
|
|
36995
36995
|
const written = [];
|
|
36996
36996
|
for (const w of OUTPUT_WIDTHS) {
|
|
36997
36997
|
const outputPath = resolve17(outDir, `${baseName}-${w}w${ext}`);
|
|
36998
|
-
|
|
36999
|
-
|
|
36998
|
+
mkdirSync10(dirname14(outputPath), { recursive: true });
|
|
36999
|
+
writeFileSync11(outputPath, original);
|
|
37000
37000
|
written.push(outputPath);
|
|
37001
37001
|
}
|
|
37002
37002
|
return written;
|
|
@@ -37008,14 +37008,14 @@ async function processImage(srcPath, outDir, baseName) {
|
|
|
37008
37008
|
const base = `${baseName}-${w}w`;
|
|
37009
37009
|
if (w >= originalWidth) {
|
|
37010
37010
|
const copyPath = resolve17(outDir, `${base}${extname5(srcPath)}`);
|
|
37011
|
-
|
|
37012
|
-
|
|
37011
|
+
mkdirSync10(dirname14(copyPath), { recursive: true });
|
|
37012
|
+
writeFileSync11(copyPath, readFileSync21(srcPath));
|
|
37013
37013
|
generated.push(copyPath);
|
|
37014
37014
|
continue;
|
|
37015
37015
|
}
|
|
37016
37016
|
const resized = image.clone().resize({ width: w, withoutEnlargement: true });
|
|
37017
37017
|
const jpgPath = resolve17(outDir, `${base}${extname5(srcPath)}`);
|
|
37018
|
-
|
|
37018
|
+
mkdirSync10(dirname14(jpgPath), { recursive: true });
|
|
37019
37019
|
await resized.toFile(jpgPath);
|
|
37020
37020
|
generated.push(jpgPath);
|
|
37021
37021
|
for (const fmt of FORMATS) {
|
|
@@ -37056,7 +37056,7 @@ function collectImageRefs(appDir) {
|
|
|
37056
37056
|
return refs;
|
|
37057
37057
|
}
|
|
37058
37058
|
async function optimizeImages(appDir, outDir) {
|
|
37059
|
-
|
|
37059
|
+
mkdirSync10(resolve17(outDir, "static", "public"), { recursive: true });
|
|
37060
37060
|
const refs = collectImageRefs(appDir);
|
|
37061
37061
|
if (refs.length === 0) {
|
|
37062
37062
|
console.error("vesk images: no <Image> refs found");
|
|
@@ -37090,7 +37090,7 @@ async function optimizeImages(appDir, outDir) {
|
|
|
37090
37090
|
}
|
|
37091
37091
|
const baseName = ref2.src.replace(/^\//, "").replace(extname5(ref2.src), "");
|
|
37092
37092
|
const imageOutDir = resolve17(outDir, "static", "public");
|
|
37093
|
-
|
|
37093
|
+
mkdirSync10(imageOutDir, { recursive: true });
|
|
37094
37094
|
const files = await processImage(srcPath, imageOutDir, baseName);
|
|
37095
37095
|
results.push({ src: ref2.src, baseName, files, widths: OUTPUT_WIDTHS });
|
|
37096
37096
|
console.error(`vesk images: ${ref2.src} \u2192 ${files.length} variants`);
|
|
@@ -37667,7 +37667,7 @@ var platform_deploy_exports = {};
|
|
|
37667
37667
|
__export(platform_deploy_exports, {
|
|
37668
37668
|
emitPlatformOutput: () => emitPlatformOutput
|
|
37669
37669
|
});
|
|
37670
|
-
import { writeFileSync as
|
|
37670
|
+
import { writeFileSync as writeFileSync12, mkdirSync as mkdirSync11, rmSync as rmSync3, cpSync } from "node:fs";
|
|
37671
37671
|
import { resolve as resolve20 } from "node:path";
|
|
37672
37672
|
async function emitPlatformOutput(platform, ctx2) {
|
|
37673
37673
|
if (platform === "node") return null;
|
|
@@ -37702,14 +37702,14 @@ ${inlineStaticSource(staticDir)}`;
|
|
|
37702
37702
|
source += `
|
|
37703
37703
|
${shell.bootstrap}
|
|
37704
37704
|
`;
|
|
37705
|
-
|
|
37705
|
+
writeFileSync12(entry, source, "utf-8");
|
|
37706
37706
|
let handlerRel;
|
|
37707
37707
|
if (shell.functionFile) {
|
|
37708
37708
|
const funcDir = resolve20(outRoot, shell.functionFile.dir);
|
|
37709
|
-
|
|
37709
|
+
mkdirSync11(funcDir, { recursive: true });
|
|
37710
37710
|
if (shell.functionConfig) {
|
|
37711
|
-
|
|
37712
|
-
|
|
37711
|
+
writeFileSync12(resolve20(funcDir, ".vc-config.json"), JSON.stringify(shell.functionConfig, null, 2), "utf-8");
|
|
37712
|
+
writeFileSync12(resolve20(funcDir, "package.json"), JSON.stringify({ type: "module" }, null, 2) + "\n", "utf-8");
|
|
37713
37713
|
}
|
|
37714
37714
|
handlerRel = `${shell.functionFile.dir}/${shell.functionFile.file}`;
|
|
37715
37715
|
await bundlePlatformHandler({ entry, outfile: resolve20(funcDir, shell.functionFile.file), nodeBuiltins: shell.nodeBuiltins });
|
|
@@ -37718,12 +37718,12 @@ ${shell.bootstrap}
|
|
|
37718
37718
|
await bundlePlatformHandler({ entry, outfile: resolve20(outRoot, handlerRel), nodeBuiltins: shell.nodeBuiltins });
|
|
37719
37719
|
}
|
|
37720
37720
|
for (const file of shell.extraFiles || []) {
|
|
37721
|
-
|
|
37721
|
+
writeFileSync12(resolve20(outRoot, file.path), file.content, "utf-8");
|
|
37722
37722
|
}
|
|
37723
37723
|
if (platform === "vercel") {
|
|
37724
|
-
|
|
37724
|
+
writeFileSync12(resolve20(outRoot, "config.json"), vercelConfigJson(prerenderedPaths), "utf-8");
|
|
37725
37725
|
}
|
|
37726
|
-
|
|
37726
|
+
writeFileSync12(resolve20(outRoot, "manifest.json"), JSON.stringify({
|
|
37727
37727
|
platform,
|
|
37728
37728
|
runtime: shell.nodeBuiltins ? "node" : "edge",
|
|
37729
37729
|
static: shell.staticMode,
|
|
@@ -48913,7 +48913,7 @@ __export(migrate_exports, {
|
|
|
48913
48913
|
detectInstalledVersion: () => detectInstalledVersion,
|
|
48914
48914
|
runMigrate: () => runMigrate
|
|
48915
48915
|
});
|
|
48916
|
-
import { readFileSync as readFileSync44, writeFileSync as
|
|
48916
|
+
import { readFileSync as readFileSync44, writeFileSync as writeFileSync24, existsSync as existsSync45, statSync as statSync24, readdirSync as readdirSync16 } from "node:fs";
|
|
48917
48917
|
import { join as join31, relative as relative11, extname as extname8 } from "node:path";
|
|
48918
48918
|
function detectInstalledVersion(projectDir, cliVersion) {
|
|
48919
48919
|
for (const pkg of ["@vesk/vesk-cli", "@vesk/adapter", "@vesk/compiler"]) {
|
|
@@ -49002,7 +49002,7 @@ function runMigrate(options) {
|
|
|
49002
49002
|
}
|
|
49003
49003
|
if (!changed) continue;
|
|
49004
49004
|
report.filesChanged.push(relPath);
|
|
49005
|
-
if (!options.dryRun)
|
|
49005
|
+
if (!options.dryRun) writeFileSync24(abs, current3, "utf-8");
|
|
49006
49006
|
}
|
|
49007
49007
|
return report;
|
|
49008
49008
|
}
|
|
@@ -49017,7 +49017,7 @@ var init_migrate = __esm({
|
|
|
49017
49017
|
});
|
|
49018
49018
|
|
|
49019
49019
|
// src/index.ts
|
|
49020
|
-
import { readFileSync as readFileSync45, writeFileSync as
|
|
49020
|
+
import { readFileSync as readFileSync45, writeFileSync as writeFileSync25, mkdirSync as mkdirSync22, existsSync as existsSync46 } from "fs";
|
|
49021
49021
|
import { resolve as resolve41, join as join32 } from "path";
|
|
49022
49022
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
49023
49023
|
import { createRequire as createRequire8 } from "module";
|
|
@@ -49598,7 +49598,7 @@ function setRuntimeModule2(mod) {
|
|
|
49598
49598
|
}
|
|
49599
49599
|
|
|
49600
49600
|
// ../adapter/dist/index.js
|
|
49601
|
-
import { mkdirSync as
|
|
49601
|
+
import { mkdirSync as mkdirSync12, writeFileSync as writeFileSync13, existsSync as existsSync22, readFileSync as readFileSync23 } from "node:fs";
|
|
49602
49602
|
import { resolve as resolve21, dirname as dirname17, relative as relative4, basename as basename3, join as join16 } from "node:path";
|
|
49603
49603
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
49604
49604
|
|
|
@@ -49830,7 +49830,7 @@ async function bundleRuntime(appDir, outDir) {
|
|
|
49830
49830
|
}
|
|
49831
49831
|
|
|
49832
49832
|
// ../adapter/src/ssr-function.ts
|
|
49833
|
-
import { readFileSync as readFileSync7, existsSync as existsSync8 } from "node:fs";
|
|
49833
|
+
import { readFileSync as readFileSync7, existsSync as existsSync8, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
49834
49834
|
import { resolve as resolve7, relative, join as join5 } from "node:path";
|
|
49835
49835
|
|
|
49836
49836
|
// ../compiler/src/server-codegen.ts
|
|
@@ -50034,9 +50034,6 @@ function precompilePlan(entryPath) {
|
|
|
50034
50034
|
const src2 = readFileSync7(entryPath, "utf-8");
|
|
50035
50035
|
return JSON.stringify(precompileFile(src2, entryPath));
|
|
50036
50036
|
}
|
|
50037
|
-
function hydrateInvoke(planExpr) {
|
|
50038
|
-
return `(() => { try { return hydratePrecompile(${planExpr}); } catch { return null; } })()`;
|
|
50039
|
-
}
|
|
50040
50037
|
function buildParamExtraction(node, urlParts) {
|
|
50041
50038
|
const parts = [];
|
|
50042
50039
|
let partIdx = Math.max(0, urlParts.length - 1);
|
|
@@ -50121,6 +50118,28 @@ function generateSsrFunction(routeNode, appDir, outDir, componentMap, options) {
|
|
|
50121
50118
|
const middlewareCode = options?.middlewareCode || null;
|
|
50122
50119
|
const headExtra = options?.headExtra || null;
|
|
50123
50120
|
const pagePath = resolve7(appDir, routeNode.sourceDir, "page.vsk");
|
|
50121
|
+
const plansDir = resolve7(outDir, "static", "ssr-plans");
|
|
50122
|
+
mkdirSync2(plansDir, { recursive: true });
|
|
50123
|
+
function writePlan(planKey, planJSON) {
|
|
50124
|
+
const fileName = `plan-${planKey}.mjs`;
|
|
50125
|
+
const planFile = resolve7(plansDir, fileName);
|
|
50126
|
+
writeFileSync3(planFile, `export const plan = ${planJSON};
|
|
50127
|
+
`, "utf-8");
|
|
50128
|
+
return relative(resolve7(outDir, "server", "functions"), planFile);
|
|
50129
|
+
}
|
|
50130
|
+
function planGetterCode(varName, planUrl) {
|
|
50131
|
+
return `const ${varName} = (() => {
|
|
50132
|
+
let cache = null;
|
|
50133
|
+
return async () => {
|
|
50134
|
+
if (cache) return cache;
|
|
50135
|
+
try {
|
|
50136
|
+
const mod = await import(${JSON.stringify(planUrl)});
|
|
50137
|
+
cache = hydratePrecompile(mod.plan);
|
|
50138
|
+
} catch { cache = null; }
|
|
50139
|
+
return cache;
|
|
50140
|
+
};
|
|
50141
|
+
})();`;
|
|
50142
|
+
}
|
|
50124
50143
|
const parts = routeNode.fullPath.split("/").filter(Boolean);
|
|
50125
50144
|
const name = routeName(parts);
|
|
50126
50145
|
const funcDir = resolve7(outDir, "server", "functions");
|
|
@@ -50136,15 +50155,15 @@ function generateSsrFunction(routeNode, appDir, outDir, componentMap, options) {
|
|
|
50136
50155
|
...routeNode.layout ? [{ sourceDir: routeNode.sourceDir, layoutCompName: routeNode.layout }] : []
|
|
50137
50156
|
];
|
|
50138
50157
|
const layoutDecls = [];
|
|
50139
|
-
for (
|
|
50158
|
+
for (let li = 0; li < layoutStack.length; li++) {
|
|
50159
|
+
const entry = layoutStack[li];
|
|
50140
50160
|
const entryPath = resolve7(appDir, entry.sourceDir, "layout.vsk");
|
|
50141
50161
|
const entrySrc = readFileSync7(entryPath, "utf-8");
|
|
50142
50162
|
const entryComp = extractCompName(entrySrc) || "Layout";
|
|
50143
50163
|
const plan = precompilePlan(entryPath);
|
|
50144
50164
|
layoutDecls.push({
|
|
50145
50165
|
comp: JSON.stringify(entryComp),
|
|
50146
|
-
plan
|
|
50147
|
-
compiled: hydrateInvoke(plan)
|
|
50166
|
+
planUrl: writePlan("layout-" + name + "-" + li, plan)
|
|
50148
50167
|
});
|
|
50149
50168
|
}
|
|
50150
50169
|
const pagePlan = precompilePlan(pagePath);
|
|
@@ -50153,32 +50172,34 @@ function generateSsrFunction(routeNode, appDir, outDir, componentMap, options) {
|
|
|
50153
50172
|
const errorSrc = errorPath ? readFileSync7(errorPath, "utf-8") : null;
|
|
50154
50173
|
const errorComp = errorPath ? extractCompName(errorSrc) || "Error" : null;
|
|
50155
50174
|
const errorVars = errorPath ? `const _errorComp = ${JSON.stringify(errorComp)};
|
|
50156
|
-
|
|
50157
|
-
` : "const _errorComp = null;\
|
|
50175
|
+
${planGetterCode("_errorCompiled", writePlan("error-" + name, precompilePlan(errorPath)))}
|
|
50176
|
+
` : "const _errorComp = null;\nasync function _errorCompiled() { return null; }\n";
|
|
50158
50177
|
const notFoundPath = resolveNotFoundFile(routeNode.sourceDir, appDir);
|
|
50159
50178
|
const notFoundSrc = notFoundPath ? readFileSync7(notFoundPath, "utf-8") : null;
|
|
50160
50179
|
const notFoundComp = notFoundPath ? extractCompName(notFoundSrc) || "NotFound" : null;
|
|
50161
50180
|
const notFoundVars = notFoundPath ? `const _notFoundComp = ${JSON.stringify(notFoundComp)};
|
|
50162
|
-
|
|
50163
|
-
` : "const _notFoundComp = null;\
|
|
50181
|
+
${planGetterCode("_notFoundCompiled", writePlan("notfound-" + name, precompilePlan(notFoundPath)))}
|
|
50182
|
+
` : "const _notFoundComp = null;\nasync function _notFoundCompiled() { return null; }\n";
|
|
50183
|
+
const pagePlanUrl = writePlan("page-" + name, pagePlan);
|
|
50164
50184
|
let src2 = "";
|
|
50165
50185
|
if (layoutDecls.length > 0) {
|
|
50186
|
+
const pageGetter = planGetterCode("_pageCompiled", pagePlanUrl);
|
|
50187
|
+
const layoutGetters = layoutDecls.map(
|
|
50188
|
+
(d, i) => planGetterCode("_layoutCompiled_" + i, d.planUrl)
|
|
50189
|
+
);
|
|
50166
50190
|
src2 = `const _pageComp = ${JSON.stringify(pageComp)};
|
|
50167
50191
|
`;
|
|
50168
|
-
src2 +=
|
|
50169
|
-
|
|
50192
|
+
src2 += pageGetter + "\n";
|
|
50193
|
+
src2 += layoutGetters.join("\n") + "\n";
|
|
50170
50194
|
src2 += `const _layoutCompList = [${layoutDecls.map((d) => d.comp).join(", ")}];
|
|
50171
50195
|
`;
|
|
50172
|
-
src2 += `const _layoutCompiledList = [
|
|
50173
|
-
${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
50174
|
-
];
|
|
50196
|
+
src2 += `const _layoutCompiledList = [${layoutDecls.map((_, i) => "_layoutCompiled_" + i).join(", ")}];
|
|
50175
50197
|
`;
|
|
50176
50198
|
src2 += errorVars + notFoundVars;
|
|
50177
50199
|
} else {
|
|
50178
50200
|
src2 = `const _comp = ${JSON.stringify(pageComp)};
|
|
50179
50201
|
`;
|
|
50180
|
-
src2 +=
|
|
50181
|
-
`;
|
|
50202
|
+
src2 += planGetterCode("_compiled", pagePlanUrl) + "\n";
|
|
50182
50203
|
src2 += errorVars + notFoundVars;
|
|
50183
50204
|
}
|
|
50184
50205
|
const urlParts = routeNode.fullPath.split("/").filter(Boolean);
|
|
@@ -50193,12 +50214,16 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50193
50214
|
let registryCode = "";
|
|
50194
50215
|
const compRegEntries = [];
|
|
50195
50216
|
const compMap = componentMap || /* @__PURE__ */ new Map();
|
|
50217
|
+
let compCounter = 0;
|
|
50196
50218
|
for (const [compName, compPath] of compMap) {
|
|
50197
50219
|
const plan = precompilePlan(compPath);
|
|
50220
|
+
const compPlanUrl = writePlan("comp-" + name + "-" + compCounter, plan);
|
|
50221
|
+
const compGetter = "_compiled_" + compCounter;
|
|
50222
|
+
compCounter++;
|
|
50198
50223
|
compRegEntries.push(` (() => {
|
|
50199
|
-
|
|
50224
|
+
${planGetterCode(compGetter, compPlanUrl)}
|
|
50200
50225
|
__componentRegistry.set(${JSON.stringify(compName)}, async (props, __registry, __vesk) => {
|
|
50201
|
-
const result = await renderPage('', ${JSON.stringify(compName)}, props, __registry, { hydrate: true, cached:
|
|
50226
|
+
const result = await renderPage('', ${JSON.stringify(compName)}, props, __registry, { hydrate: true, cached: await ${compGetter}() });
|
|
50202
50227
|
return result.body;
|
|
50203
50228
|
});
|
|
50204
50229
|
})();`);
|
|
@@ -50214,7 +50239,7 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50214
50239
|
"async function __renderErrorBody(props) {",
|
|
50215
50240
|
' if (!_errorComp) throw props.error || new Error("Internal Server Error");',
|
|
50216
50241
|
" try {",
|
|
50217
|
-
" const result = await renderPage('', _errorComp, props, __componentRegistry, { hydrate: true, cached: _errorCompiled });",
|
|
50242
|
+
" const result = await renderPage('', _errorComp, props, __componentRegistry, { hydrate: true, cached: await _errorCompiled() });",
|
|
50218
50243
|
" return result.body;",
|
|
50219
50244
|
" } catch {",
|
|
50220
50245
|
` return ${JSON.stringify(renderDefaultErrorFragment())};`,
|
|
@@ -50227,7 +50252,7 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50227
50252
|
"async function __renderNotFoundBody(props) {",
|
|
50228
50253
|
" if (!_notFoundComp) return null;",
|
|
50229
50254
|
" try {",
|
|
50230
|
-
" const result = await renderPage('', _notFoundComp, props, __componentRegistry, { hydrate: true, cached: _notFoundCompiled });",
|
|
50255
|
+
" const result = await renderPage('', _notFoundComp, props, __componentRegistry, { hydrate: true, cached: await _notFoundCompiled() });",
|
|
50231
50256
|
" return result.body;",
|
|
50232
50257
|
" } catch {",
|
|
50233
50258
|
" return null;",
|
|
@@ -50241,11 +50266,11 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50241
50266
|
" let _b = body;",
|
|
50242
50267
|
' let _h = head || "";',
|
|
50243
50268
|
" for (let _i = _layoutCompList.length - 1; _i > 0; _i--) {",
|
|
50244
|
-
" const _inner = await renderPage('', _layoutCompList[_i], { params, children: _b }, __componentRegistry, { hydrate: true, cached: _layoutCompiledList[_i] });",
|
|
50269
|
+
" const _inner = await renderPage('', _layoutCompList[_i], { params, children: _b }, __componentRegistry, { hydrate: true, cached: await _layoutCompiledList[_i]() });",
|
|
50245
50270
|
" _b = _inner.body;",
|
|
50246
50271
|
" if (_inner.head) _h = _inner.head + _h;",
|
|
50247
50272
|
" }",
|
|
50248
|
-
" return renderFullPage('', _layoutCompList[0], { params, children: _b }, __componentRegistry, { hydrate: true, cached: _layoutCompiledList[0]" + bakedOptions + clientScriptOption + dataScriptOption + ", pageHead: _h });",
|
|
50273
|
+
" return renderFullPage('', _layoutCompList[0], { params, children: _b }, __componentRegistry, { hydrate: true, cached: await _layoutCompiledList[0]()" + bakedOptions + clientScriptOption + dataScriptOption + ", pageHead: _h });",
|
|
50249
50274
|
"}",
|
|
50250
50275
|
"",
|
|
50251
50276
|
"async function __renderHtml(params, requestUrl) {",
|
|
@@ -50256,7 +50281,7 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50256
50281
|
" let notFound = false;",
|
|
50257
50282
|
" const __expose = process.env.NODE_ENV !== 'production';",
|
|
50258
50283
|
" try {",
|
|
50259
|
-
" page = await renderPage('', _pageComp, { params }, __componentRegistry, { hydrate: true, cached: _pageCompiled });",
|
|
50284
|
+
" page = await renderPage('', _pageComp, { params }, __componentRegistry, { hydrate: true, cached: await _pageCompiled() });",
|
|
50260
50285
|
" } catch (err) {",
|
|
50261
50286
|
" if (err && err.name === 'Redirect') throw err;",
|
|
50262
50287
|
" if (err && err.name === 'NotFoundError') {",
|
|
@@ -50293,7 +50318,7 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50293
50318
|
" const message = err && typeof err === 'object' && 'message' in err ? String(err.message) : String(err);",
|
|
50294
50319
|
" const stack = err && typeof err === 'object' && 'stack' in err ? String(err.stack) : '';",
|
|
50295
50320
|
" const props = { params, statusCode: 500, error: __expose ? message : 'Internal Server Error', stack: __expose ? stack : '', url: requestUrl || '' };",
|
|
50296
|
-
" return renderFullPage('', _errorComp, props, __componentRegistry, { hydrate: true, cached: _errorCompiled" + bakedOptions + clientScriptOption + dataScriptOption + " });",
|
|
50321
|
+
" return renderFullPage('', _errorComp, props, __componentRegistry, { hydrate: true, cached: await _errorCompiled()" + bakedOptions + clientScriptOption + dataScriptOption + " });",
|
|
50297
50322
|
"}",
|
|
50298
50323
|
"",
|
|
50299
50324
|
"async function __renderHtml(params, requestUrl) {",
|
|
@@ -50308,7 +50333,7 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50308
50333
|
// though it runs outside the ALS scope.
|
|
50309
50334
|
" const __streamToken = globalThis.__vsk_ssr_token || '';",
|
|
50310
50335
|
" try {",
|
|
50311
|
-
" stream = renderPageStream('', _comp, { params }, __componentRegistry, { hydrate: true, cached: _compiled" + bakedOptions + clientScriptOption + dataScriptOption + " });",
|
|
50336
|
+
" stream = renderPageStream('', _comp, { params }, __componentRegistry, { hydrate: true, cached: await _compiled()" + bakedOptions + clientScriptOption + dataScriptOption + " });",
|
|
50312
50337
|
" } catch (err) {",
|
|
50313
50338
|
" if (err && (err.name === 'NotFoundError' || err.name === 'Redirect')) throw err;",
|
|
50314
50339
|
" const html = await __renderErrorFullPage(params, requestUrl, err);",
|
|
@@ -50382,7 +50407,7 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50382
50407
|
" try {",
|
|
50383
50408
|
" let dataPage;",
|
|
50384
50409
|
" try {",
|
|
50385
|
-
" dataPage = await renderPage('', _pageComp, { params }, __componentRegistry, { hydrate: true, cached: _pageCompiled });",
|
|
50410
|
+
" dataPage = await renderPage('', _pageComp, { params }, __componentRegistry, { hydrate: true, cached: await _pageCompiled() });",
|
|
50386
50411
|
" } catch (err) {",
|
|
50387
50412
|
" if (err && (err.name === 'NotFoundError' || err.name === 'Redirect')) throw err;",
|
|
50388
50413
|
" const message = err && typeof err === 'object' && 'message' in err ? String(err.message) : String(err);",
|
|
@@ -50390,7 +50415,7 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50390
50415
|
" }",
|
|
50391
50416
|
" let _dataHead = dataPage.head || '';",
|
|
50392
50417
|
" for (let _i = _layoutCompList.length - 1; _i >= 0; _i--) {",
|
|
50393
|
-
" const _dl = await renderPage('', _layoutCompList[_i], { params, children: '' }, __componentRegistry, { hydrate: true, cached: _layoutCompiledList[_i] });",
|
|
50418
|
+
" const _dl = await renderPage('', _layoutCompList[_i], { params, children: '' }, __componentRegistry, { hydrate: true, cached: await _layoutCompiledList[_i]() });",
|
|
50394
50419
|
" _dataHead = (_dl.head || '') + _dataHead;",
|
|
50395
50420
|
" }",
|
|
50396
50421
|
" return new Response(JSON.stringify({ path: url.pathname, params, props: dataPage.props || { params }, head: _dataHead }), {",
|
|
@@ -50408,7 +50433,7 @@ ${layoutDecls.map((d) => " " + d.compiled + ",").join("\n")}
|
|
|
50408
50433
|
" try {",
|
|
50409
50434
|
" let dataPage;",
|
|
50410
50435
|
" try {",
|
|
50411
|
-
" dataPage = await renderPage('', _comp, { params }, __componentRegistry, { hydrate: true, cached: _compiled });",
|
|
50436
|
+
" dataPage = await renderPage('', _comp, { params }, __componentRegistry, { hydrate: true, cached: await _compiled() });",
|
|
50412
50437
|
" } catch (err) {",
|
|
50413
50438
|
" if (err && (err.name === 'NotFoundError' || err.name === 'Redirect')) throw err;",
|
|
50414
50439
|
" const message = err && typeof err === 'object' && 'message' in err ? String(err.message) : String(err);",
|
|
@@ -51064,7 +51089,7 @@ ${extracted.body}
|
|
|
51064
51089
|
|
|
51065
51090
|
// ../adapter/src/events.ts
|
|
51066
51091
|
init_esbuild_fallback();
|
|
51067
|
-
import { writeFileSync as
|
|
51092
|
+
import { writeFileSync as writeFileSync4, unlinkSync as unlinkSync2, mkdirSync as mkdirSync3 } from "node:fs";
|
|
51068
51093
|
import { resolve as resolve9 } from "node:path";
|
|
51069
51094
|
|
|
51070
51095
|
// ../compiler/src/events.ts
|
|
@@ -51149,9 +51174,9 @@ async function compileEvents(appDir, outDir) {
|
|
|
51149
51174
|
const sourcePath2 = collectEventsFile(appDir);
|
|
51150
51175
|
if (!sourcePath2) return false;
|
|
51151
51176
|
const serverDir = resolve9(outDir, "server");
|
|
51152
|
-
|
|
51177
|
+
mkdirSync3(serverDir, { recursive: true });
|
|
51153
51178
|
const entryFile = resolve9(serverDir, `.events-entry-${buildId2++}.mjs`);
|
|
51154
|
-
|
|
51179
|
+
writeFileSync4(entryFile, buildEventsEntry(sourcePath2), "utf-8");
|
|
51155
51180
|
try {
|
|
51156
51181
|
const result = await build({
|
|
51157
51182
|
entryPoints: [entryFile],
|
|
@@ -51181,7 +51206,7 @@ async function compileEvents(appDir, outDir) {
|
|
|
51181
51206
|
|
|
51182
51207
|
// ../adapter/src/client-bundle.ts
|
|
51183
51208
|
init_esbuild_fallback();
|
|
51184
|
-
import { readFileSync as readFileSync13, existsSync as existsSync11, writeFileSync as
|
|
51209
|
+
import { readFileSync as readFileSync13, existsSync as existsSync11, writeFileSync as writeFileSync5, unlinkSync as unlinkSync3, statSync as statSync4, rmSync, mkdtempSync, mkdirSync as mkdirSync4 } from "node:fs";
|
|
51185
51210
|
import { resolve as resolve10, join as join8, dirname as dirname9, relative as relative2, sep } from "node:path";
|
|
51186
51211
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
51187
51212
|
import { tmpdir } from "node:os";
|
|
@@ -52223,7 +52248,7 @@ ${body}
|
|
|
52223
52248
|
members.push(` ${JSON.stringify(source)}: m${i},`);
|
|
52224
52249
|
});
|
|
52225
52250
|
lines.push(`globalThis.__veskShared = { ${members.join("\n")} };`);
|
|
52226
|
-
|
|
52251
|
+
writeFileSync5(sharedEntry, lines.join("\n"));
|
|
52227
52252
|
const appTsconfig = findTsconfigPath(appDir);
|
|
52228
52253
|
const runtimeShim = join8(tmpBase, "runtime-shim.js");
|
|
52229
52254
|
const runtimeLines = [
|
|
@@ -52238,7 +52263,7 @@ ${body}
|
|
|
52238
52263
|
for (const name of [...sharedRuntimeNames].sort()) {
|
|
52239
52264
|
runtimeLines.push(`export const ${name} = __r(${JSON.stringify(name)});`);
|
|
52240
52265
|
}
|
|
52241
|
-
|
|
52266
|
+
writeFileSync5(runtimeShim, runtimeLines.join("\n") + "\n");
|
|
52242
52267
|
const result = await build({
|
|
52243
52268
|
entryPoints: [sharedEntry],
|
|
52244
52269
|
bundle: true,
|
|
@@ -52271,7 +52296,7 @@ ${body}
|
|
|
52271
52296
|
for (const name of [...named].sort()) {
|
|
52272
52297
|
shimLines.push(`export const ${name} = m[${JSON.stringify(name)}];`);
|
|
52273
52298
|
}
|
|
52274
|
-
|
|
52299
|
+
writeFileSync5(shim, shimLines.join("\n") + "\n");
|
|
52275
52300
|
chunkAlias[source] = shim;
|
|
52276
52301
|
});
|
|
52277
52302
|
} catch (e) {
|
|
@@ -52299,7 +52324,7 @@ ${body}
|
|
|
52299
52324
|
const __hydrators = globalThis.__hydrators || (globalThis.__hydrators = {});
|
|
52300
52325
|
${entry.code}
|
|
52301
52326
|
`;
|
|
52302
|
-
|
|
52327
|
+
writeFileSync5(tmpFile, toBundle);
|
|
52303
52328
|
const serverOnlyHits = [];
|
|
52304
52329
|
const driverHits = [];
|
|
52305
52330
|
const eagerHits = [];
|
|
@@ -52554,14 +52579,14 @@ async function bundleRuntimeNames(runtimeDir, names, strict = false) {
|
|
|
52554
52579
|
const unique = [...new Set(names)];
|
|
52555
52580
|
try {
|
|
52556
52581
|
try {
|
|
52557
|
-
|
|
52582
|
+
mkdirSync4(dirname9(entry), { recursive: true });
|
|
52558
52583
|
} catch {
|
|
52559
52584
|
}
|
|
52560
52585
|
try {
|
|
52561
52586
|
rmSync(entry);
|
|
52562
52587
|
} catch {
|
|
52563
52588
|
}
|
|
52564
|
-
|
|
52589
|
+
writeFileSync5(entry, `export { ${unique.join(", ")} } from ${JSON.stringify(indexClient)};
|
|
52565
52590
|
`);
|
|
52566
52591
|
const result = await build({
|
|
52567
52592
|
entryPoints: [esbuildPath(entry)],
|
|
@@ -52765,14 +52790,14 @@ function generateManifest(routes, ssrRoutes, apiRoutes, staticRoutes, middleware
|
|
|
52765
52790
|
|
|
52766
52791
|
// ../adapter/src/static.ts
|
|
52767
52792
|
init_paths();
|
|
52768
|
-
import { mkdirSync as
|
|
52793
|
+
import { mkdirSync as mkdirSync5, copyFileSync, readdirSync as readdirSync3, statSync as statSync6, existsSync as existsSync13, writeFileSync as writeFileSync6, readFileSync as readFileSync15 } from "node:fs";
|
|
52769
52794
|
import { resolve as resolve12, join as join9 } from "node:path";
|
|
52770
52795
|
function copyStaticAssets(publicDir, outDir) {
|
|
52771
52796
|
const targetDir = resolve12(outDir, "static", "public");
|
|
52772
|
-
|
|
52797
|
+
mkdirSync5(targetDir, { recursive: true });
|
|
52773
52798
|
if (!existsSync13(publicDir)) return;
|
|
52774
52799
|
function copyDir(src2, dest) {
|
|
52775
|
-
|
|
52800
|
+
mkdirSync5(dest, { recursive: true });
|
|
52776
52801
|
const entries = readdirSync3(src2);
|
|
52777
52802
|
for (const entry of entries) {
|
|
52778
52803
|
const srcPath = join9(src2, entry);
|
|
@@ -52829,7 +52854,7 @@ async function reportServerError(err, options) {
|
|
|
52829
52854
|
init_paths();
|
|
52830
52855
|
|
|
52831
52856
|
// ../adapter/src/load-config.ts
|
|
52832
|
-
import { existsSync as existsSync14, readFileSync as readFileSync16, writeFileSync as
|
|
52857
|
+
import { existsSync as existsSync14, readFileSync as readFileSync16, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6 } from "node:fs";
|
|
52833
52858
|
import { join as join10, dirname as dirname10 } from "node:path";
|
|
52834
52859
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
52835
52860
|
import { createRequire as createRequire3 } from "node:module";
|
|
@@ -52874,8 +52899,8 @@ async function loadVeskConfig2(projectDir) {
|
|
|
52874
52899
|
js = `const {${injectKeys.join(",")}} = globalThis.__vesk_inject;
|
|
52875
52900
|
` + js;
|
|
52876
52901
|
const tmpFile = join10(projectDir, ".vesk", "config.loader.tmp.mjs");
|
|
52877
|
-
|
|
52878
|
-
|
|
52902
|
+
mkdirSync6(dirname10(tmpFile), { recursive: true });
|
|
52903
|
+
writeFileSync7(tmpFile, js, "utf-8");
|
|
52879
52904
|
globalThis.__vesk_inject = inject;
|
|
52880
52905
|
try {
|
|
52881
52906
|
const mod = await import(`${pathToFileURL2(tmpFile).href}?t=${Date.now()}`);
|
|
@@ -54060,7 +54085,7 @@ async function build2(appDir, options) {
|
|
|
54060
54085
|
resolve21(outDir, "prerendered")
|
|
54061
54086
|
];
|
|
54062
54087
|
for (const d of dirs)
|
|
54063
|
-
|
|
54088
|
+
mkdirSync12(d, { recursive: true });
|
|
54064
54089
|
markPhase("config+dirs");
|
|
54065
54090
|
const cssSourcePath = resolveUserCssPath(appDir);
|
|
54066
54091
|
if (cssSourcePath !== null) {
|
|
@@ -54078,7 +54103,7 @@ async function build2(appDir, options) {
|
|
|
54078
54103
|
}
|
|
54079
54104
|
}
|
|
54080
54105
|
}
|
|
54081
|
-
|
|
54106
|
+
writeFileSync13(cssTarget, finalCss, "utf-8");
|
|
54082
54107
|
if (tailwindActive) {
|
|
54083
54108
|
console.error(`vesk build: css \u2192 static/global.css (${finalCss.length} bytes)`);
|
|
54084
54109
|
} else {
|
|
@@ -54130,7 +54155,7 @@ async function build2(appDir, options) {
|
|
|
54130
54155
|
const hashed = !options?.hmr;
|
|
54131
54156
|
const clientAsset = describeAsset("client.js", main);
|
|
54132
54157
|
const clientFileName = hashed ? clientAsset.fileName : "client.js";
|
|
54133
|
-
|
|
54158
|
+
writeFileSync13(resolve21(staticDir, clientFileName), main, "utf-8");
|
|
54134
54159
|
const clientUrl = `/_vesk/static/${clientFileName}`;
|
|
54135
54160
|
const mode = chunks.length > 0 ? "code-split" : "monolithic";
|
|
54136
54161
|
console.error(`vesk build: client \u2192 static/${clientFileName} (${main.length} bytes, ${mode}${hashed ? `, ${clientAsset.hash}` : ""})`);
|
|
@@ -54138,7 +54163,7 @@ async function build2(appDir, options) {
|
|
|
54138
54163
|
for (const chunk of chunks) {
|
|
54139
54164
|
const asset = describeAsset(chunk.name, chunk.code);
|
|
54140
54165
|
emittedAssets.push(asset);
|
|
54141
|
-
|
|
54166
|
+
writeFileSync13(resolve21(staticDir, hashed ? asset.fileName : chunk.name), chunk.code, "utf-8");
|
|
54142
54167
|
console.error(`vesk build: chunk \u2192 static/${hashed ? asset.fileName : chunk.name} (${chunk.code.length} bytes${hashed ? `, ${asset.hash}` : ""})`);
|
|
54143
54168
|
}
|
|
54144
54169
|
const clientIntegrity = hashed ? clientAsset.integrity : void 0;
|
|
@@ -54162,7 +54187,7 @@ async function build2(appDir, options) {
|
|
|
54162
54187
|
}
|
|
54163
54188
|
const ssrAncestorLayouts = isStandalone ? [] : ancestorLayouts;
|
|
54164
54189
|
const { funcPath, funcCode, name } = generateSsrFunction(node, appDir, outDir, componentMap, { ancestorLayouts: ssrAncestorLayouts, middlewareCode: mwCode, headExtra: pluginHeadExtra, clientScriptUrl: clientUrl, clientScriptIntegrity: clientIntegrity });
|
|
54165
|
-
|
|
54190
|
+
writeFileSync13(funcPath, funcCode, "utf-8");
|
|
54166
54191
|
const pagePath = resolve21(appDir, node.sourceDir, "page.vsk");
|
|
54167
54192
|
if (existsSync22(pagePath)) {
|
|
54168
54193
|
const src2 = readFileSync23(pagePath, "utf-8");
|
|
@@ -54200,7 +54225,7 @@ async function build2(appDir, options) {
|
|
|
54200
54225
|
for (const node of nodes) {
|
|
54201
54226
|
if (node.filePath) {
|
|
54202
54227
|
const { funcPath, funcCode, name } = generateApiFunction(node, apiDir, outDir);
|
|
54203
|
-
|
|
54228
|
+
writeFileSync13(funcPath, funcCode, "utf-8");
|
|
54204
54229
|
apiRoutes.push(node);
|
|
54205
54230
|
console.error(`vesk build: api \u2192 server/api/${name}.js (${node.fullPath})`);
|
|
54206
54231
|
}
|
|
@@ -54213,7 +54238,7 @@ async function build2(appDir, options) {
|
|
|
54213
54238
|
if (mwChain.length > 0) {
|
|
54214
54239
|
const mwCode = compileMiddleware(mwChain, appDir);
|
|
54215
54240
|
if (mwCode) {
|
|
54216
|
-
|
|
54241
|
+
writeFileSync13(resolve21(outDir, "server", "middleware.js"), mwCode, "utf-8");
|
|
54217
54242
|
middlewareEnabled = true;
|
|
54218
54243
|
console.error(`vesk build: mw \u2192 server/middleware.js (${mwChain.length} middlewares)`);
|
|
54219
54244
|
}
|
|
@@ -54251,13 +54276,13 @@ async function build2(appDir, options) {
|
|
|
54251
54276
|
const sitemapOverride = resolve21(publicDirResolved, "sitemap.xml");
|
|
54252
54277
|
if (!existsSync22(sitemapOverride)) {
|
|
54253
54278
|
const sitemap = generateSitemap2(routeTree, ssrRoutes, prerenderedRoutes, { siteUrl });
|
|
54254
|
-
|
|
54279
|
+
writeFileSync13(sitemapOverride, sitemap, "utf-8");
|
|
54255
54280
|
console.error(`vesk build: seo \u2192 static/public/sitemap.xml (${sitemap.length} bytes)`);
|
|
54256
54281
|
}
|
|
54257
54282
|
const robotsOverride = resolve21(publicDirResolved, "robots.txt");
|
|
54258
54283
|
if (!existsSync22(robotsOverride)) {
|
|
54259
54284
|
const robots = generateRobotsTxt2(siteUrl);
|
|
54260
|
-
|
|
54285
|
+
writeFileSync13(robotsOverride, robots, "utf-8");
|
|
54261
54286
|
console.error(`vesk build: seo \u2192 static/public/robots.txt (${robots.length} bytes)`);
|
|
54262
54287
|
}
|
|
54263
54288
|
}
|
|
@@ -54271,7 +54296,7 @@ async function build2(appDir, options) {
|
|
|
54271
54296
|
client: { file: clientFileName, url: clientUrl, hash: clientAsset.hash, bytes: clientAsset.bytes, integrity: clientAsset.integrity },
|
|
54272
54297
|
chunks: emittedAssets.slice(1).map((a) => ({ file: a.fileName, hash: a.hash, bytes: a.bytes, integrity: a.integrity }))
|
|
54273
54298
|
};
|
|
54274
|
-
|
|
54299
|
+
writeFileSync13(resolve21(outDir, "config.json"), JSON.stringify(manifest, null, 2) + "\n", "utf-8");
|
|
54275
54300
|
console.error("vesk build: config \u2192 config.json");
|
|
54276
54301
|
{
|
|
54277
54302
|
const { detectPlatform: detectPlatform2 } = await Promise.resolve().then(() => (init_platform(), platform_exports));
|
|
@@ -54319,7 +54344,7 @@ vesk build: done (${outDir})`);
|
|
|
54319
54344
|
init_seo_audit();
|
|
54320
54345
|
|
|
54321
54346
|
// src/dev-server.ts
|
|
54322
|
-
import { readFileSync as readFileSync41, watch, statSync as statSync22, existsSync as existsSync43, mkdirSync as
|
|
54347
|
+
import { readFileSync as readFileSync41, watch, statSync as statSync22, existsSync as existsSync43, mkdirSync as mkdirSync21, readdirSync as readdirSync14, writeFileSync as writeFileSync23, renameSync as renameSync2 } from "node:fs";
|
|
54323
54348
|
import { createHash as createHash3 } from "node:crypto";
|
|
54324
54349
|
import { resolve as resolve39, extname as extname7, join as join28, dirname as dirname27, relative as relative9 } from "node:path";
|
|
54325
54350
|
import { createServer as createServer2 } from "node:http";
|
|
@@ -58410,7 +58435,7 @@ function guessProjectRoots2(dir) {
|
|
|
58410
58435
|
}
|
|
58411
58436
|
|
|
58412
58437
|
// ../adapter/dist/client-bundle.js
|
|
58413
|
-
import { readFileSync as readFileSync26, existsSync as existsSync28, writeFileSync as
|
|
58438
|
+
import { readFileSync as readFileSync26, existsSync as existsSync28, writeFileSync as writeFileSync14, unlinkSync as unlinkSync4, statSync as statSync15, rmSync as rmSync4, mkdtempSync as mkdtempSync2, mkdirSync as mkdirSync13 } from "node:fs";
|
|
58414
58439
|
import { resolve as resolve24, join as join21, dirname as dirname19, relative as relative6, sep as sep3 } from "node:path";
|
|
58415
58440
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
58416
58441
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
@@ -59309,7 +59334,7 @@ ${body}
|
|
|
59309
59334
|
members.push(` ${JSON.stringify(source)}: m${i},`);
|
|
59310
59335
|
});
|
|
59311
59336
|
lines.push(`globalThis.__veskShared = { ${members.join("\n")} };`);
|
|
59312
|
-
|
|
59337
|
+
writeFileSync14(sharedEntry, lines.join("\n"));
|
|
59313
59338
|
const appTsconfig = findTsconfigPath(appDir);
|
|
59314
59339
|
const runtimeShim = join21(tmpBase, "runtime-shim.js");
|
|
59315
59340
|
const runtimeLines = [
|
|
@@ -59325,7 +59350,7 @@ ${body}
|
|
|
59325
59350
|
for (const name of [...sharedRuntimeNames].sort()) {
|
|
59326
59351
|
runtimeLines.push(`export const ${name} = __r(${JSON.stringify(name)});`);
|
|
59327
59352
|
}
|
|
59328
|
-
|
|
59353
|
+
writeFileSync14(runtimeShim, runtimeLines.join("\n") + "\n");
|
|
59329
59354
|
const result = await build3({
|
|
59330
59355
|
entryPoints: [sharedEntry],
|
|
59331
59356
|
bundle: true,
|
|
@@ -59359,7 +59384,7 @@ ${body}
|
|
|
59359
59384
|
for (const name of [...named].sort()) {
|
|
59360
59385
|
shimLines.push(`export const ${name} = m[${JSON.stringify(name)}];`);
|
|
59361
59386
|
}
|
|
59362
|
-
|
|
59387
|
+
writeFileSync14(shim, shimLines.join("\n") + "\n");
|
|
59363
59388
|
chunkAlias[source] = shim;
|
|
59364
59389
|
});
|
|
59365
59390
|
} catch (e) {
|
|
@@ -59389,7 +59414,7 @@ ${body}
|
|
|
59389
59414
|
const __hydrators = globalThis.__hydrators || (globalThis.__hydrators = {});
|
|
59390
59415
|
${entry.code}
|
|
59391
59416
|
`;
|
|
59392
|
-
|
|
59417
|
+
writeFileSync14(tmpFile, toBundle);
|
|
59393
59418
|
const serverOnlyHits = [];
|
|
59394
59419
|
const driverHits = [];
|
|
59395
59420
|
const eagerHits = [];
|
|
@@ -59660,14 +59685,14 @@ async function bundleRuntimeNames2(runtimeDir, names, strict = false) {
|
|
|
59660
59685
|
const unique = [...new Set(names)];
|
|
59661
59686
|
try {
|
|
59662
59687
|
try {
|
|
59663
|
-
|
|
59688
|
+
mkdirSync13(dirname19(entry), { recursive: true });
|
|
59664
59689
|
} catch {
|
|
59665
59690
|
}
|
|
59666
59691
|
try {
|
|
59667
59692
|
rmSync4(entry);
|
|
59668
59693
|
} catch {
|
|
59669
59694
|
}
|
|
59670
|
-
|
|
59695
|
+
writeFileSync14(entry, `export { ${unique.join(", ")} } from ${JSON.stringify(indexClient)};
|
|
59671
59696
|
`);
|
|
59672
59697
|
const result = await build3({
|
|
59673
59698
|
entryPoints: [esbuildPath2(entry)],
|
|
@@ -59900,7 +59925,7 @@ import { resolve as resolve28 } from "node:path";
|
|
|
59900
59925
|
|
|
59901
59926
|
// ../adapter/dist/plugins.js
|
|
59902
59927
|
init_paths();
|
|
59903
|
-
import { readFileSync as readFileSync28, writeFileSync as
|
|
59928
|
+
import { readFileSync as readFileSync28, writeFileSync as writeFileSync15, existsSync as existsSync30, mkdirSync as mkdirSync14, statSync as statSync17 } from "node:fs";
|
|
59904
59929
|
import { resolve as resolve26, dirname as dirname20, join as join22, extname as extname6, basename as basename6 } from "node:path";
|
|
59905
59930
|
import { createRequire as createRequire6 } from "node:module";
|
|
59906
59931
|
import { spawn as spawn2 } from "node:child_process";
|
|
@@ -59944,8 +59969,8 @@ function writePluginState2(veskDir, state) {
|
|
|
59944
59969
|
const file = stateFilePath2(veskDir);
|
|
59945
59970
|
const dir = dirname20(file);
|
|
59946
59971
|
if (!existsSync30(dir))
|
|
59947
|
-
|
|
59948
|
-
|
|
59972
|
+
mkdirSync14(dir, { recursive: true });
|
|
59973
|
+
writeFileSync15(file, JSON.stringify(state, null, 2) + "\n", "utf-8");
|
|
59949
59974
|
}
|
|
59950
59975
|
function resolvePackage2(appDir, pkg) {
|
|
59951
59976
|
const require3 = createRequire6(resolve26(appDir, "package.json"));
|
|
@@ -60876,7 +60901,7 @@ var __internals2 = {
|
|
|
60876
60901
|
};
|
|
60877
60902
|
|
|
60878
60903
|
// ../adapter/dist/dev-config.js
|
|
60879
|
-
import { existsSync as existsSync31, readFileSync as readFileSync29, writeFileSync as
|
|
60904
|
+
import { existsSync as existsSync31, readFileSync as readFileSync29, writeFileSync as writeFileSync16, mkdirSync as mkdirSync15, mkdtempSync as mkdtempSync3, rmSync as rmSync5 } from "node:fs";
|
|
60880
60905
|
import { tmpdir as tmpdir4 } from "node:os";
|
|
60881
60906
|
import { resolve as resolve27, dirname as dirname21, join as join23 } from "node:path";
|
|
60882
60907
|
init_parser();
|
|
@@ -60906,11 +60931,11 @@ async function parseConfigSource(source, isTs, projectDir) {
|
|
|
60906
60931
|
js = `const { defineConfig, definePlugin, preset } = globalThis.__vesk_inject;
|
|
60907
60932
|
` + js;
|
|
60908
60933
|
}
|
|
60909
|
-
const base = projectDir ? (
|
|
60934
|
+
const base = projectDir ? (mkdirSync15(join23(projectDir, ".vesk"), { recursive: true }), join23(projectDir, ".vesk")) : void 0;
|
|
60910
60935
|
const dir = base ? mkdtempSync3(join23(base, "cfg-")) : mkdtempSync3(join23(tmpdir4(), "vesk-cfg-"));
|
|
60911
60936
|
const tmpFile = join23(dir, "config.mjs");
|
|
60912
60937
|
try {
|
|
60913
|
-
|
|
60938
|
+
writeFileSync16(tmpFile, js, "utf-8");
|
|
60914
60939
|
globalThis.__vesk_inject = {
|
|
60915
60940
|
defineConfig,
|
|
60916
60941
|
// Pass-through like the real definePlugin (which validates + returns
|
|
@@ -60943,8 +60968,8 @@ async function writeConfigSource2(projectDir, source) {
|
|
|
60943
60968
|
const { path, isTs } = findConfigFile2(projectDir);
|
|
60944
60969
|
const target = path || resolve27(projectDir, "vesk.config.ts");
|
|
60945
60970
|
await parseConfigSource(source, isTs, projectDir);
|
|
60946
|
-
|
|
60947
|
-
|
|
60971
|
+
mkdirSync15(dirname21(target), { recursive: true });
|
|
60972
|
+
writeFileSync16(target, source, "utf-8");
|
|
60948
60973
|
const config = await parseConfigSource(source, isTs, projectDir);
|
|
60949
60974
|
return { path: target, exists: true, source, config };
|
|
60950
60975
|
}
|
|
@@ -62217,7 +62242,7 @@ function produceDiagnostics(input) {
|
|
|
62217
62242
|
}
|
|
62218
62243
|
|
|
62219
62244
|
// ../agentic/dist/checkpoints.js
|
|
62220
|
-
import { existsSync as existsSync33, mkdirSync as
|
|
62245
|
+
import { existsSync as existsSync33, mkdirSync as mkdirSync16, readFileSync as readFileSync31, writeFileSync as writeFileSync17, statSync as statSync19, unlinkSync as unlinkSync5, rmSync as rmSync6, renameSync } from "node:fs";
|
|
62221
62246
|
import { join as join24, resolve as resolve29, dirname as dirname22, sep as sep5 } from "node:path";
|
|
62222
62247
|
import { randomUUID as nodeRandomUUID } from "node:crypto";
|
|
62223
62248
|
function generateId() {
|
|
@@ -62363,7 +62388,7 @@ function getCheckpointPath(projectDir, id) {
|
|
|
62363
62388
|
return join24(getCheckpointDir(projectDir, id), "checkpoint.json");
|
|
62364
62389
|
}
|
|
62365
62390
|
function ensureDir(dir) {
|
|
62366
|
-
|
|
62391
|
+
mkdirSync16(dir, { recursive: true });
|
|
62367
62392
|
}
|
|
62368
62393
|
function readJson(filePath, fallback) {
|
|
62369
62394
|
try {
|
|
@@ -62380,12 +62405,12 @@ function readJson(filePath, fallback) {
|
|
|
62380
62405
|
function writeJsonAtomic(filePath, data2) {
|
|
62381
62406
|
ensureDir(dirname22(filePath));
|
|
62382
62407
|
const tmp = `${filePath}.tmp`;
|
|
62383
|
-
|
|
62408
|
+
writeFileSync17(tmp, JSON.stringify(data2, null, 2), "utf-8");
|
|
62384
62409
|
try {
|
|
62385
62410
|
renameSync(tmp, filePath);
|
|
62386
62411
|
} catch {
|
|
62387
62412
|
try {
|
|
62388
|
-
|
|
62413
|
+
writeFileSync17(filePath, JSON.stringify(data2, null, 2), "utf-8");
|
|
62389
62414
|
try {
|
|
62390
62415
|
unlinkSync5(tmp);
|
|
62391
62416
|
} catch {
|
|
@@ -62480,7 +62505,7 @@ function rollback(projectDir, id) {
|
|
|
62480
62505
|
} else {
|
|
62481
62506
|
try {
|
|
62482
62507
|
ensureDir(dirname22(abs));
|
|
62483
|
-
|
|
62508
|
+
writeFileSync17(abs, f.before, "utf-8");
|
|
62484
62509
|
} catch {
|
|
62485
62510
|
}
|
|
62486
62511
|
}
|
|
@@ -62489,7 +62514,7 @@ function rollback(projectDir, id) {
|
|
|
62489
62514
|
}
|
|
62490
62515
|
|
|
62491
62516
|
// ../agentic/dist/config.js
|
|
62492
|
-
import { readFileSync as readFileSync32, writeFileSync as
|
|
62517
|
+
import { readFileSync as readFileSync32, writeFileSync as writeFileSync18, existsSync as existsSync34, mkdirSync as mkdirSync17, chmodSync } from "node:fs";
|
|
62493
62518
|
import { resolve as resolve30, dirname as dirname23 } from "node:path";
|
|
62494
62519
|
var DEFAULT_CONFIG = {
|
|
62495
62520
|
provider: "openai",
|
|
@@ -62580,7 +62605,7 @@ function writeDotenvValue(projectDir, key, value) {
|
|
|
62580
62605
|
}
|
|
62581
62606
|
if (!replaced)
|
|
62582
62607
|
out += newLine + "\n";
|
|
62583
|
-
|
|
62608
|
+
writeFileSync18(p, out, { mode: 384 });
|
|
62584
62609
|
try {
|
|
62585
62610
|
chmodSync(p, 384);
|
|
62586
62611
|
} catch {
|
|
@@ -62619,8 +62644,8 @@ function saveAgenticConfig(projectDir, patch) {
|
|
|
62619
62644
|
if (next.baseUrl)
|
|
62620
62645
|
toWrite.baseUrl = next.baseUrl;
|
|
62621
62646
|
try {
|
|
62622
|
-
|
|
62623
|
-
|
|
62647
|
+
mkdirSync17(dirname23(p), { recursive: true });
|
|
62648
|
+
writeFileSync18(p, JSON.stringify(toWrite, null, 2), "utf-8");
|
|
62624
62649
|
} catch {
|
|
62625
62650
|
}
|
|
62626
62651
|
return next;
|
|
@@ -63944,7 +63969,7 @@ var Agent = class {
|
|
|
63944
63969
|
};
|
|
63945
63970
|
|
|
63946
63971
|
// ../agentic/dist/tools/vesk.js
|
|
63947
|
-
import { existsSync as existsSync36, readFileSync as readFileSync34, writeFileSync as
|
|
63972
|
+
import { existsSync as existsSync36, readFileSync as readFileSync34, writeFileSync as writeFileSync19, mkdirSync as mkdirSync18, readdirSync as readdirSync11, statSync as statSync20 } from "node:fs";
|
|
63948
63973
|
import { resolve as resolve32, join as join25, dirname as dirname24, sep as sep6 } from "node:path";
|
|
63949
63974
|
function resolveWithin3(baseDir, relPath) {
|
|
63950
63975
|
const base = resolve32(baseDir);
|
|
@@ -63978,8 +64003,8 @@ function readPluginState3(veskDir) {
|
|
|
63978
64003
|
}
|
|
63979
64004
|
function writePluginState3(veskDir, state) {
|
|
63980
64005
|
const file = stateFilePath3(veskDir);
|
|
63981
|
-
|
|
63982
|
-
|
|
64006
|
+
mkdirSync18(dirname24(file), { recursive: true });
|
|
64007
|
+
writeFileSync19(file, JSON.stringify(state, null, 2) + "\n", "utf-8");
|
|
63983
64008
|
}
|
|
63984
64009
|
function eqIgnoreCase3(a, b) {
|
|
63985
64010
|
return String(a || "").toLowerCase() === String(b || "").toLowerCase();
|
|
@@ -64338,8 +64363,8 @@ function createVeskTools(deps) {
|
|
|
64338
64363
|
if (!contained)
|
|
64339
64364
|
return jsonError("path escapes project root");
|
|
64340
64365
|
}
|
|
64341
|
-
|
|
64342
|
-
|
|
64366
|
+
mkdirSync18(dirname24(target), { recursive: true });
|
|
64367
|
+
writeFileSync19(target, source, "utf-8");
|
|
64343
64368
|
return jsonOk({ ok: true, path: target, source });
|
|
64344
64369
|
}
|
|
64345
64370
|
if (typeof a.key === "string" && a.key) {
|
|
@@ -64360,7 +64385,7 @@ function createVeskTools(deps) {
|
|
|
64360
64385
|
return jsonError("could not safely edit the config object; use the source editor");
|
|
64361
64386
|
if (patched === current3)
|
|
64362
64387
|
return jsonOk({ ok: true, path: info.path, source: patched, unchanged: true });
|
|
64363
|
-
|
|
64388
|
+
writeFileSync19(info.path, patched, "utf-8");
|
|
64364
64389
|
return jsonOk({ ok: true, path: info.path, source: patched });
|
|
64365
64390
|
}
|
|
64366
64391
|
return jsonError("expected { source } or { key, value }");
|
|
@@ -64620,7 +64645,7 @@ function createVeskTools(deps) {
|
|
|
64620
64645
|
} catch {
|
|
64621
64646
|
}
|
|
64622
64647
|
const dir = checkpointDir(veskDir);
|
|
64623
|
-
|
|
64648
|
+
mkdirSync18(dir, { recursive: true });
|
|
64624
64649
|
const id = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
64625
64650
|
const file = join25(dir, `${id}.json`);
|
|
64626
64651
|
const check = resolveWithin3(dir, `${id}.json`);
|
|
@@ -64634,7 +64659,7 @@ function createVeskTools(deps) {
|
|
|
64634
64659
|
appDir,
|
|
64635
64660
|
veskDir
|
|
64636
64661
|
};
|
|
64637
|
-
|
|
64662
|
+
writeFileSync19(file, JSON.stringify(payload, null, 2) + "\n", "utf-8");
|
|
64638
64663
|
return jsonOk({ ok: true, checkpointId: id, message: payload.message, timestamp: payload.timestamp });
|
|
64639
64664
|
} catch (e) {
|
|
64640
64665
|
return jsonError(e instanceof Error ? e.message : String(e));
|
|
@@ -64760,7 +64785,7 @@ function renderDefaultNotFoundPage2(opts = {}) {
|
|
|
64760
64785
|
}
|
|
64761
64786
|
|
|
64762
64787
|
// ../adapter/dist/ssr-function.js
|
|
64763
|
-
import { readFileSync as readFileSync35, existsSync as existsSync37 } from "node:fs";
|
|
64788
|
+
import { readFileSync as readFileSync35, existsSync as existsSync37, mkdirSync as mkdirSync19, writeFileSync as writeFileSync20 } from "node:fs";
|
|
64764
64789
|
import { resolve as resolve33, relative as relative7, join as join26 } from "node:path";
|
|
64765
64790
|
init_default_pages();
|
|
64766
64791
|
function resolveBoundaryFileForUrl2(pathname, appDir, file) {
|
|
@@ -64802,7 +64827,7 @@ function resolveCssUrls2(opts) {
|
|
|
64802
64827
|
// ../adapter/dist/hmr.js
|
|
64803
64828
|
init_client_codegen();
|
|
64804
64829
|
import { WebSocketServer } from "ws";
|
|
64805
|
-
import { readFileSync as readFileSync37, existsSync as existsSync39, writeFileSync as
|
|
64830
|
+
import { readFileSync as readFileSync37, existsSync as existsSync39, writeFileSync as writeFileSync21 } from "node:fs";
|
|
64806
64831
|
import { resolve as resolve35, dirname as dirname25 } from "node:path";
|
|
64807
64832
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
64808
64833
|
init_default_pages();
|
|
@@ -65473,7 +65498,7 @@ function renderDevErrorPage(payload, opts) {
|
|
|
65473
65498
|
|
|
65474
65499
|
// src/build-packages.ts
|
|
65475
65500
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
65476
|
-
import { cpSync as cpSync2, existsSync as existsSync41, mkdirSync as
|
|
65501
|
+
import { cpSync as cpSync2, existsSync as existsSync41, mkdirSync as mkdirSync20, readFileSync as readFileSync39, readdirSync as readdirSync12, statSync as statSync21, writeFileSync as writeFileSync22 } from "node:fs";
|
|
65477
65502
|
import { createRequire as createRequire7 } from "node:module";
|
|
65478
65503
|
import { dirname as dirname26, join as join27, resolve as resolve37 } from "node:path";
|
|
65479
65504
|
import { fileURLToPath as fileURLToPath8 } from "node:url";
|
|
@@ -65562,7 +65587,7 @@ function buildPackages(force = false) {
|
|
|
65562
65587
|
const distDir = join27(pkgDir, "dist");
|
|
65563
65588
|
for (const c of cfg.copy || []) {
|
|
65564
65589
|
const to = join27(distDir, c.to);
|
|
65565
|
-
|
|
65590
|
+
mkdirSync20(dirname26(to), { recursive: true });
|
|
65566
65591
|
cpSync2(join27(pkgDir, c.from), to, { recursive: true });
|
|
65567
65592
|
}
|
|
65568
65593
|
const srcPkg = JSON.parse(readFileSync39(join27(pkgDir, "package.json"), "utf-8"));
|
|
@@ -65579,9 +65604,9 @@ function buildPackages(force = false) {
|
|
|
65579
65604
|
"./package.json": "./package.json"
|
|
65580
65605
|
}
|
|
65581
65606
|
};
|
|
65582
|
-
|
|
65607
|
+
writeFileSync22(join27(distDir, "package.json"), JSON.stringify(lucideDistPkg, null, 2) + "\n");
|
|
65583
65608
|
} else {
|
|
65584
|
-
|
|
65609
|
+
writeFileSync22(join27(distDir, "package.json"), distPackageJson(cfg.name, cfg.entry, cfg.serverEntry, srcPkg.version || "1.0.0"));
|
|
65585
65610
|
}
|
|
65586
65611
|
console.log(`[build] ${cfg.name} -> dist`);
|
|
65587
65612
|
}
|
|
@@ -66574,10 +66599,10 @@ async function startDevServer(port, projectDir, config, host) {
|
|
|
66574
66599
|
function writeDevBundleCache(main, chunks) {
|
|
66575
66600
|
try {
|
|
66576
66601
|
const dir = devCacheDir();
|
|
66577
|
-
|
|
66602
|
+
mkdirSync21(dir, { recursive: true });
|
|
66578
66603
|
const file = join28(dir, "client-bundle.json");
|
|
66579
66604
|
const tmp = join28(dir, `client-bundle.${process.pid}.tmp`);
|
|
66580
|
-
|
|
66605
|
+
writeFileSync23(tmp, JSON.stringify({ key: devCacheKey(), main, chunks }), "utf8");
|
|
66581
66606
|
renameSync2(tmp, file);
|
|
66582
66607
|
} catch {
|
|
66583
66608
|
}
|
|
@@ -68356,8 +68381,8 @@ if (cmd === "init") {
|
|
|
68356
68381
|
console.error(`vesk init: ${target} already exists \u2014 skipping`);
|
|
68357
68382
|
process.exit(0);
|
|
68358
68383
|
}
|
|
68359
|
-
|
|
68360
|
-
|
|
68384
|
+
mkdirSync22(appDirPath, { recursive: true });
|
|
68385
|
+
writeFileSync25(target, [
|
|
68361
68386
|
`@import 'tailwindcss';`,
|
|
68362
68387
|
``,
|
|
68363
68388
|
`@layer base {`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesk/vesk-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.77",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vesk — compiler-first framework for the post-VDOM web. vesk dev, vesk build.",
|
|
6
6
|
"bin": {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"main": "./dist/cli.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@vesk/adapter": "^0.2.
|
|
12
|
-
"@vesk/compiler": "^0.2.
|
|
13
|
-
"@vesk/plugin-tailwind": "^0.2.
|
|
14
|
-
"@vesk/runtime": "^0.2.
|
|
11
|
+
"@vesk/adapter": "^0.2.77",
|
|
12
|
+
"@vesk/compiler": "^0.2.77",
|
|
13
|
+
"@vesk/plugin-tailwind": "^0.2.77",
|
|
14
|
+
"@vesk/runtime": "^0.2.77",
|
|
15
15
|
"esrap": "^2.3.0",
|
|
16
16
|
"typescript": "^5.8.0",
|
|
17
17
|
"ws": "^8.18.0",
|