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