@vesk/vesk-cli 0.2.81 → 0.2.83

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.
Files changed (2) hide show
  1. package/dist/cli.js +114 -96
  2. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -37650,6 +37650,24 @@ export const createHash = () => ({ update: () => {}, digest: () => '' });
37650
37650
  outfile,
37651
37651
  minify: false,
37652
37652
  sourcemap: false,
37653
+ // Edge targets have no node_modules so every package is bundled. Node
37654
+ // targets bundle everything too — self-contained functions avoid the
37655
+ // "Cannot find package" failures that externalization causes on hosts that
37656
+ // don't install dependencies for Build Output API functions.
37657
+ // Bundled CJS modules (e.g. pg's internals via slintorm) call
37658
+ // require('events') etc. esbuild rewrites those into its `__require`
37659
+ // shim, which throws 'Dynamic require of "events" is not supported' in
37660
+ // ESM output. Define a real `require` anchored at the bundle URL before
37661
+ // the shim initializes so Node loads builtins and node_modules for real.
37662
+ // `node:module` stays external (platform: 'node'), so Node resolves it
37663
+ // natively at runtime. Edge targets keep the empty-node builtin stubs and
37664
+ // must not get this banner (it would collide with their stubbed
37665
+ // `createRequire`).
37666
+ ...nodeBuiltins ? {
37667
+ banner: {
37668
+ js: 'import { createRequire } from "node:module";\nconst require = createRequire(import.meta.url);\n'
37669
+ }
37670
+ } : {},
37653
37671
  logOverride: { "direct-eval": "silent" },
37654
37672
  plugins
37655
37673
  });
@@ -42396,7 +42414,7 @@ __export(typecheck_exports, {
42396
42414
  formatTypecheckWarnings: () => formatTypecheckWarnings,
42397
42415
  typecheckProject: () => typecheckProject
42398
42416
  });
42399
- import { readFileSync as readFileSync42, readdirSync as readdirSync15, statSync as statSync23 } from "node:fs";
42417
+ import { readFileSync as readFileSync43, readdirSync as readdirSync15, statSync as statSync23 } from "node:fs";
42400
42418
  import { join as join29, dirname as dirname28, normalize, relative as relative10, resolve as resolve40, sep as sep7 } from "node:path";
42401
42419
  import * as ts8 from "typescript";
42402
42420
  function walkProjectFiles(projectRoot) {
@@ -42628,7 +42646,7 @@ function typecheckProject(projectRoot, opts = {}) {
42628
42646
  }
42629
42647
  }
42630
42648
  if (f.endsWith(".vsk")) {
42631
- const src2 = readFileSync42(f, "utf-8");
42649
+ const src2 = readFileSync43(f, "utf-8");
42632
42650
  try {
42633
42651
  parse4(src2);
42634
42652
  } catch (e) {
@@ -48767,7 +48785,7 @@ __export(codemods_exports, {
48767
48785
  applicableCodemods: () => applicableCodemods,
48768
48786
  compareCore: () => compareCore
48769
48787
  });
48770
- import { readFileSync as readFileSync43, existsSync as existsSync44 } from "node:fs";
48788
+ import { readFileSync as readFileSync44, existsSync as existsSync44 } from "node:fs";
48771
48789
  import { join as join30 } from "node:path";
48772
48790
  import { walk as walk8 } from "zimmerframe";
48773
48791
  function safeParse(source, filePath) {
@@ -48793,7 +48811,7 @@ function typesPackageExports(projectDir) {
48793
48811
  ].filter((p) => typeof p === "string" && existsSync44(p));
48794
48812
  for (const path of candidates) {
48795
48813
  try {
48796
- const src2 = readFileSync43(path, "utf-8");
48814
+ const src2 = readFileSync44(path, "utf-8");
48797
48815
  const names = /* @__PURE__ */ new Set();
48798
48816
  for (const line of src2.split("\n")) {
48799
48817
  const m = /^export\s+(?:declare\s+)?(?:abstract\s+)?(?:interface|class|type|enum|const|function|let|var|namespace)\s+([A-Za-z_$][\w$]*)/.exec(line);
@@ -48917,14 +48935,14 @@ __export(migrate_exports, {
48917
48935
  detectInstalledVersion: () => detectInstalledVersion,
48918
48936
  runMigrate: () => runMigrate
48919
48937
  });
48920
- import { readFileSync as readFileSync44, writeFileSync as writeFileSync22, existsSync as existsSync45, statSync as statSync24, readdirSync as readdirSync16 } from "node:fs";
48938
+ import { readFileSync as readFileSync45, writeFileSync as writeFileSync22, existsSync as existsSync45, statSync as statSync24, readdirSync as readdirSync16 } from "node:fs";
48921
48939
  import { join as join31, relative as relative11, extname as extname8 } from "node:path";
48922
48940
  function detectInstalledVersion(projectDir, cliVersion) {
48923
48941
  for (const pkg of ["@vesk/vesk-cli", "@vesk/adapter", "@vesk/compiler"]) {
48924
48942
  const p = join31(projectDir, "node_modules", pkg, "package.json");
48925
48943
  if (!existsSync45(p)) continue;
48926
48944
  try {
48927
- const version2 = JSON.parse(readFileSync44(p, "utf-8")).version;
48945
+ const version2 = JSON.parse(readFileSync45(p, "utf-8")).version;
48928
48946
  if (typeof version2 === "string" && version2) return { version: version2, source: pkg };
48929
48947
  } catch {
48930
48948
  }
@@ -48981,7 +48999,7 @@ function runMigrate(options) {
48981
48999
  if (!existsSync45(abs)) continue;
48982
49000
  let source;
48983
49001
  try {
48984
- source = readFileSync44(abs, "utf-8");
49002
+ source = readFileSync45(abs, "utf-8");
48985
49003
  } catch (e) {
48986
49004
  report.skipped.push(`${relPath}: unreadable (${e.message})`);
48987
49005
  continue;
@@ -49021,7 +49039,7 @@ var init_migrate = __esm({
49021
49039
  });
49022
49040
 
49023
49041
  // src/index.ts
49024
- import { readFileSync as readFileSync45, writeFileSync as writeFileSync23, mkdirSync as mkdirSync20, existsSync as existsSync46 } from "fs";
49042
+ import { readFileSync as readFileSync46, writeFileSync as writeFileSync23, mkdirSync as mkdirSync20, existsSync as existsSync46 } from "fs";
49025
49043
  import { resolve as resolve41, join as join32 } from "path";
49026
49044
  import { fileURLToPath as fileURLToPath9 } from "url";
49027
49045
  import { createRequire as createRequire8 } from "module";
@@ -49602,7 +49620,7 @@ function setRuntimeModule2(mod) {
49602
49620
  }
49603
49621
 
49604
49622
  // ../adapter/dist/index.js
49605
- import { mkdirSync as mkdirSync11, writeFileSync as writeFileSync12, existsSync as existsSync22, readFileSync as readFileSync23 } from "node:fs";
49623
+ import { mkdirSync as mkdirSync11, writeFileSync as writeFileSync12, existsSync as existsSync22, readFileSync as readFileSync24 } from "node:fs";
49606
49624
  import { resolve as resolve21, dirname as dirname17, relative as relative4, basename as basename3, join as join16 } from "node:path";
49607
49625
  import { fileURLToPath as fileURLToPath5 } from "node:url";
49608
49626
 
@@ -54084,7 +54102,7 @@ async function build2(appDir, options) {
54084
54102
  markPhase("config+dirs");
54085
54103
  const cssSourcePath = resolveUserCssPath(appDir);
54086
54104
  if (cssSourcePath !== null) {
54087
- const cssContent = readFileSync23(cssSourcePath, "utf-8");
54105
+ const cssContent = readFileSync24(cssSourcePath, "utf-8");
54088
54106
  const cssTarget = resolve21(outDir, "static", "global.css");
54089
54107
  const tailwindActive = isTailwindPlugin(pluginsPipelines);
54090
54108
  let finalCss = cssContent;
@@ -54177,7 +54195,7 @@ async function build2(appDir, options) {
54177
54195
  const mwChain2 = collectMiddlewareChain2(routeTree, node.fullPath, appDir);
54178
54196
  let mwCode = null;
54179
54197
  if (mwChain2.length > 0) {
54180
- const mwSources = mwChain2.map((m) => readFileSync23(m.sourcePath, "utf-8"));
54198
+ const mwSources = mwChain2.map((m) => readFileSync24(m.sourcePath, "utf-8"));
54181
54199
  mwCode = compileMiddlewareCode(mwSources);
54182
54200
  }
54183
54201
  const ssrAncestorLayouts = isStandalone ? [] : ancestorLayouts;
@@ -54185,14 +54203,14 @@ async function build2(appDir, options) {
54185
54203
  writeFileSync12(funcPath, funcCode, "utf-8");
54186
54204
  const pagePath = resolve21(appDir, node.sourceDir, "page.vsk");
54187
54205
  if (existsSync22(pagePath)) {
54188
- const src2 = readFileSync23(pagePath, "utf-8");
54206
+ const src2 = readFileSync24(pagePath, "utf-8");
54189
54207
  const actionIds = collectActionIds(src2);
54190
54208
  if (node.layout) {
54191
- const layoutSrc = readFileSync23(resolve21(appDir, node.sourceDir, "layout.vsk"), "utf-8");
54209
+ const layoutSrc = readFileSync24(resolve21(appDir, node.sourceDir, "layout.vsk"), "utf-8");
54192
54210
  actionIds.push(...collectActionIds(layoutSrc));
54193
54211
  }
54194
54212
  for (const a of ssrAncestorLayouts) {
54195
- const ancestorSrc = readFileSync23(resolve21(appDir, a.sourceDir, "layout.vsk"), "utf-8");
54213
+ const ancestorSrc = readFileSync24(resolve21(appDir, a.sourceDir, "layout.vsk"), "utf-8");
54196
54214
  actionIds.push(...collectActionIds(ancestorSrc));
54197
54215
  }
54198
54216
  for (const id of actionIds) {
@@ -54285,7 +54303,7 @@ async function build2(appDir, options) {
54285
54303
  const manifest = generateManifest(routeTree, ssrRoutes, apiRoutes, prerenderedRoutes, middlewareEnabled, actionMap, pluginHeadExtra, hasEvents);
54286
54304
  const buildId3 = emittedAssets.map((a) => a.hash).join("-");
54287
54305
  manifest.buildId = buildId3.slice(0, 32);
54288
- manifest.veskVersion = JSON.parse(readFileSync23(join16(PACKAGES_DIR_SELF(), "package.json"), "utf-8")).version;
54306
+ manifest.veskVersion = JSON.parse(readFileSync24(join16(PACKAGES_DIR_SELF(), "package.json"), "utf-8")).version;
54289
54307
  manifest.assets = {
54290
54308
  hashed,
54291
54309
  client: { file: clientFileName, url: clientUrl, hash: clientAsset.hash, bytes: clientAsset.bytes, integrity: clientAsset.integrity },
@@ -54339,7 +54357,7 @@ vesk build: done (${outDir})`);
54339
54357
  init_seo_audit();
54340
54358
 
54341
54359
  // src/dev-server.ts
54342
- 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";
54360
+ import { readFileSync as readFileSync42, watch, statSync as statSync22, existsSync as existsSync43, mkdirSync as mkdirSync19, readdirSync as readdirSync14, writeFileSync as writeFileSync21, renameSync as renameSync2 } from "node:fs";
54343
54361
  import { createHash as createHash3 } from "node:crypto";
54344
54362
  import { resolve as resolve39, extname as extname7, join as join28, dirname as dirname27, relative as relative9 } from "node:path";
54345
54363
  import { createServer as createServer2 } from "node:http";
@@ -57250,7 +57268,7 @@ init_parser();
57250
57268
  init_tokens();
57251
57269
  init_scan();
57252
57270
  init_strip_ts();
57253
- import { readdirSync as readdirSync8, statSync as statSync13, existsSync as existsSync23, readFileSync as readFileSync24 } from "fs";
57271
+ import { readdirSync as readdirSync8, statSync as statSync13, existsSync as existsSync23, readFileSync as readFileSync25 } from "fs";
57254
57272
  import { join as join17, relative as relative5, basename as basename4 } from "path";
57255
57273
  function collapseSlashes2(p) {
57256
57274
  let out = "";
@@ -57271,7 +57289,7 @@ function isStandaloneLayoutFile(layoutPath) {
57271
57289
  try {
57272
57290
  if (!existsSync23(layoutPath))
57273
57291
  return false;
57274
- const src2 = readFileSync24(layoutPath, "utf-8");
57292
+ const src2 = readFileSync25(layoutPath, "utf-8");
57275
57293
  if (!src2.includes("standalone"))
57276
57294
  return false;
57277
57295
  try {
@@ -58324,7 +58342,7 @@ async function runEventHandlers(handlers, name, ctx2) {
58324
58342
  }
58325
58343
 
58326
58344
  // ../compiler/dist/md-inline.js
58327
- import { readFileSync as readFileSync25, existsSync as existsSync27 } from "node:fs";
58345
+ import { readFileSync as readFileSync26, existsSync as existsSync27 } from "node:fs";
58328
58346
  import { dirname as dirname18, join as join20, resolve as resolve23 } from "node:path";
58329
58347
  var MD_EXT_MARKER2 = ".md";
58330
58348
  function looksLikeMarkdownPath2(value) {
@@ -58368,7 +58386,7 @@ function inlineMdContentAttrs2(source, importerDir, mdRoots = []) {
58368
58386
  if (abs !== null) {
58369
58387
  let contents;
58370
58388
  try {
58371
- contents = readFileSync25(abs, "utf-8");
58389
+ contents = readFileSync26(abs, "utf-8");
58372
58390
  } catch {
58373
58391
  out += source[i];
58374
58392
  i++;
@@ -58430,7 +58448,7 @@ function guessProjectRoots2(dir) {
58430
58448
  }
58431
58449
 
58432
58450
  // ../adapter/dist/client-bundle.js
58433
- 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";
58451
+ import { readFileSync as readFileSync27, existsSync as existsSync28, writeFileSync as writeFileSync13, unlinkSync as unlinkSync4, statSync as statSync15, rmSync as rmSync4, mkdtempSync as mkdtempSync2, mkdirSync as mkdirSync12 } from "node:fs";
58434
58452
  import { resolve as resolve24, join as join21, dirname as dirname19, relative as relative6, sep as sep3 } from "node:path";
58435
58453
  import { fileURLToPath as fileURLToPath6 } from "node:url";
58436
58454
  import { tmpdir as tmpdir3 } from "node:os";
@@ -58707,7 +58725,7 @@ function runtimeImportsOf2(filePath, seen = /* @__PURE__ */ new Set()) {
58707
58725
  seen.add(filePath);
58708
58726
  let text;
58709
58727
  try {
58710
- text = readFileSync26(filePath, "utf8");
58728
+ text = readFileSync27(filePath, "utf8");
58711
58729
  } catch {
58712
58730
  return [];
58713
58731
  }
@@ -59058,11 +59076,11 @@ async function generateClientBundle2(routeTree, appDir, componentMap, options) {
59058
59076
  return removeCompiledNodes2(code, isVskImport2);
59059
59077
  }
59060
59078
  function resolveVskImports(filePath, compile) {
59061
- const src2 = readFileSync26(filePath, "utf-8");
59079
+ const src2 = readFileSync27(filePath, "utf-8");
59062
59080
  const resolved = [];
59063
59081
  for (const importPath of collectVskImportPaths(vskImportLines(src2), filePath)) {
59064
59082
  try {
59065
- readFileSync26(importPath);
59083
+ readFileSync27(importPath);
59066
59084
  } catch {
59067
59085
  continue;
59068
59086
  }
@@ -59124,7 +59142,7 @@ async function generateClientBundle2(routeTree, appDir, componentMap, options) {
59124
59142
  compiledFiles++;
59125
59143
  __stats.compiled++;
59126
59144
  __stats.distinct.add(filePath);
59127
- let src2 = readFileSync26(filePath, "utf-8");
59145
+ let src2 = readFileSync27(filePath, "utf-8");
59128
59146
  if (/content=["'][^"']*\.md["']/i.test(src2)) {
59129
59147
  src2 = inlineMdContentAttrs(src2, dirname19(filePath), guessProjectRoots(appDir));
59130
59148
  }
@@ -59517,7 +59535,7 @@ A module-scope statement runs the moment the browser evaluates the chunk, so a s
59517
59535
  if (seen.has(filePath))
59518
59536
  return;
59519
59537
  seen.add(filePath);
59520
- const src2 = readFileSync26(filePath, "utf-8");
59538
+ const src2 = readFileSync27(filePath, "utf-8");
59521
59539
  resolveVskImports(filePath, (p, n) => compileFileMono2(p, n || ""));
59522
59540
  for (const cn of vskComponentNames(src2, filePath))
59523
59541
  componentOwners.claim(cn, filePath);
@@ -59612,7 +59630,7 @@ function buildRuntimeCode2(runtimeDir) {
59612
59630
  for (const f of runtimeFiles) {
59613
59631
  const p = join21(runtimeDir, f);
59614
59632
  if (existsSync28(p)) {
59615
- let src2 = readFileSync26(p, "utf-8");
59633
+ let src2 = readFileSync27(p, "utf-8");
59616
59634
  src2 = stripTypes2(src2);
59617
59635
  src2 = src2.replace(/^import\s+[\s\S]*?from\s+['"](?:\.\/.*?|@vesk\/runtime\/src\/.*?)['"];?\n?/gm, "");
59618
59636
  src2 = src2.replace(/^import\s+['"](?:\.\/.*?|@vesk\/runtime\/src\/.*?)['"];?\n?/gm, "");
@@ -59624,7 +59642,7 @@ ${src2}
59624
59642
  `;
59625
59643
  }
59626
59644
  }
59627
- const indexSrc = readFileSync26(join21(runtimeDir, "index-client.js"), "utf-8");
59645
+ const indexSrc = readFileSync27(join21(runtimeDir, "index-client.js"), "utf-8");
59628
59646
  const exportNames = stripTypes2(indexSrc).match(/export\s*\{\s*([^}]+)\s*\}\s*from/g)?.flatMap((m) => m.replace(/export\s*\{\s*|\s*\}\s*from/g, "").split(",").map((s) => s.trim())) || [];
59629
59647
  code += "// --- exports ---\n";
59630
59648
  for (const name of [...new Set(exportNames)]) {
@@ -59635,7 +59653,7 @@ ${src2}
59635
59653
  return code;
59636
59654
  }
59637
59655
  function runtimeExportNames2(runtimeDir) {
59638
- const indexSrc = readFileSync26(join21(runtimeDir, "index-client.js"), "utf-8");
59656
+ const indexSrc = readFileSync27(join21(runtimeDir, "index-client.js"), "utf-8");
59639
59657
  const names = /* @__PURE__ */ new Set();
59640
59658
  for (const m of indexSrc.matchAll(/export\s*\{([^}]+)\}\s*from/g)) {
59641
59659
  for (const raw2 of m[1].split(",")) {
@@ -59824,7 +59842,7 @@ if (typeof document !== 'undefined') __router.start();
59824
59842
 
59825
59843
  // ../adapter/dist/paths.js
59826
59844
  import { resolve as resolve25, sep as sep4 } from "node:path";
59827
- import { existsSync as existsSync29, statSync as statSync16, readFileSync as readFileSync27 } from "node:fs";
59845
+ import { existsSync as existsSync29, statSync as statSync16, readFileSync as readFileSync28 } from "node:fs";
59828
59846
  function resolveWithin2(baseDir, relPath) {
59829
59847
  const base = resolve25(baseDir);
59830
59848
  const target = resolve25(baseDir, relPath);
@@ -59848,7 +59866,7 @@ function installMdReadHook2(publicDirs) {
59848
59866
  if (!lower2.endsWith(".md") && !lower2.endsWith(".markdown"))
59849
59867
  continue;
59850
59868
  if (existsSync29(abs) && statSync16(abs).isFile())
59851
- return readFileSync27(abs, "utf8");
59869
+ return readFileSync28(abs, "utf8");
59852
59870
  } catch {
59853
59871
  }
59854
59872
  }
@@ -59915,12 +59933,12 @@ function urlAuthority3(url) {
59915
59933
  }
59916
59934
 
59917
59935
  // ../adapter/dist/dev-api.js
59918
- import { readFileSync as readFileSync30, statSync as statSync18, existsSync as existsSync32, readdirSync as readdirSync10 } from "node:fs";
59936
+ import { readFileSync as readFileSync31, statSync as statSync18, existsSync as existsSync32, readdirSync as readdirSync10 } from "node:fs";
59919
59937
  import { resolve as resolve28 } from "node:path";
59920
59938
 
59921
59939
  // ../adapter/dist/plugins.js
59922
59940
  init_paths();
59923
- import { readFileSync as readFileSync28, writeFileSync as writeFileSync14, existsSync as existsSync30, mkdirSync as mkdirSync13, statSync as statSync17 } from "node:fs";
59941
+ import { readFileSync as readFileSync29, writeFileSync as writeFileSync14, existsSync as existsSync30, mkdirSync as mkdirSync13, statSync as statSync17 } from "node:fs";
59924
59942
  import { resolve as resolve26, dirname as dirname20, join as join22, extname as extname6, basename as basename6 } from "node:path";
59925
59943
  import { createRequire as createRequire6 } from "node:module";
59926
59944
  import { spawn as spawn2 } from "node:child_process";
@@ -59944,7 +59962,7 @@ function readPluginState2(veskDir) {
59944
59962
  return defaultState2();
59945
59963
  let raw2;
59946
59964
  try {
59947
- raw2 = JSON.parse(readFileSync28(file, "utf-8"));
59965
+ raw2 = JSON.parse(readFileSync29(file, "utf-8"));
59948
59966
  } catch {
59949
59967
  return defaultState2();
59950
59968
  }
@@ -60036,7 +60054,7 @@ function localDir2(base, pkg) {
60036
60054
  function readJsonFile2(file) {
60037
60055
  try {
60038
60056
  if (existsSync30(file))
60039
- return JSON.parse(readFileSync28(file, "utf-8"));
60057
+ return JSON.parse(readFileSync29(file, "utf-8"));
60040
60058
  } catch {
60041
60059
  }
60042
60060
  return null;
@@ -60758,7 +60776,7 @@ function introspectPlugin2(appDir, name) {
60758
60776
  const pkgName = str2(pkgJson.name) ?? name;
60759
60777
  const exportsMap = flattenPackageExports2(pkgJson.exports);
60760
60778
  const dtsPath = resolveDtsPath2(probe, pkgJson);
60761
- const dtsExports = dtsPath ? parseDtsExports2(readFileSync28(dtsPath, "utf-8")) : [];
60779
+ const dtsExports = dtsPath ? parseDtsExports2(readFileSync29(dtsPath, "utf-8")) : [];
60762
60780
  return {
60763
60781
  ok: true,
60764
60782
  name: pkgName,
@@ -60896,7 +60914,7 @@ var __internals2 = {
60896
60914
  };
60897
60915
 
60898
60916
  // ../adapter/dist/dev-config.js
60899
- import { existsSync as existsSync31, readFileSync as readFileSync29, writeFileSync as writeFileSync15, mkdirSync as mkdirSync14, mkdtempSync as mkdtempSync3, rmSync as rmSync5 } from "node:fs";
60917
+ import { existsSync as existsSync31, readFileSync as readFileSync30, writeFileSync as writeFileSync15, mkdirSync as mkdirSync14, mkdtempSync as mkdtempSync3, rmSync as rmSync5 } from "node:fs";
60900
60918
  import { tmpdir as tmpdir4 } from "node:os";
60901
60919
  import { resolve as resolve27, dirname as dirname21, join as join23 } from "node:path";
60902
60920
  init_parser();
@@ -60955,7 +60973,7 @@ async function readConfig2(projectDir) {
60955
60973
  const { path, isTs } = findConfigFile2(projectDir);
60956
60974
  if (!path)
60957
60975
  return { path: null, exists: false, source: "", config: {} };
60958
- const source = readFileSync29(path, "utf-8");
60976
+ const source = readFileSync30(path, "utf-8");
60959
60977
  const config = await parseConfigSource(source, isTs, projectDir);
60960
60978
  return { path, exists: true, source, config };
60961
60979
  }
@@ -61797,7 +61815,7 @@ export default defineConfig({
61797
61815
  await writeConfigSource2(projectDir, source);
61798
61816
  return;
61799
61817
  }
61800
- source = readFileSync29(path, "utf-8");
61818
+ source = readFileSync30(path, "utf-8");
61801
61819
  const existingImport = findPluginImportAst(source, pkg);
61802
61820
  let importName;
61803
61821
  if (existingImport) {
@@ -61877,7 +61895,7 @@ async function removePluginFromConfig2(projectDir, pkg) {
61877
61895
  const { path } = findConfigFile2(projectDir);
61878
61896
  if (!path)
61879
61897
  return false;
61880
- let source = readFileSync29(path, "utf-8");
61898
+ let source = readFileSync30(path, "utf-8");
61881
61899
  const original = source;
61882
61900
  const existingImport = findPluginImportAst(source, pkg);
61883
61901
  let importName = existingImport ? existingImport.name : null;
@@ -61998,7 +62016,7 @@ function createDevApiRouter2(opts) {
61998
62016
  return badRequest2("no vesk.config file to edit");
61999
62017
  if (!isTs)
62000
62018
  return badRequest2("single-key toggle edits only apply to vesk.config.ts (use the source editor for .js)");
62001
- const patched = applyConfigToggle2(readFileSync30(path, "utf-8"), b.key, b.value);
62019
+ const patched = applyConfigToggle2(readFileSync31(path, "utf-8"), b.key, b.value);
62002
62020
  if (patched === null)
62003
62021
  return badRequest2("could not safely edit the config object; use the source editor");
62004
62022
  const cfg = await writeConfigSource2(projectDir, patched);
@@ -62044,7 +62062,7 @@ function createDevApiRouter2(opts) {
62044
62062
  return jsonStatus(200, { ok: true, path: target, directory: true, entries });
62045
62063
  }
62046
62064
  if (statSync18(resolved).isFile()) {
62047
- return jsonStatus(200, { ok: true, path: target, directory: false, content: readFileSync30(resolved, "utf-8") });
62065
+ return jsonStatus(200, { ok: true, path: target, directory: false, content: readFileSync31(resolved, "utf-8") });
62048
62066
  }
62049
62067
  return badRequest2("unsupported file type");
62050
62068
  } catch (e) {
@@ -62180,7 +62198,7 @@ function createDevApiRouter2(opts) {
62180
62198
  return {
62181
62199
  status: 200,
62182
62200
  headers: { "Content-Type": icon.mime, "Cache-Control": "private, max-age=60" },
62183
- body: readFileSync30(icon.file).toString("base64"),
62201
+ body: readFileSync31(icon.file).toString("base64"),
62184
62202
  encoding: "base64"
62185
62203
  };
62186
62204
  }
@@ -62237,7 +62255,7 @@ function produceDiagnostics(input) {
62237
62255
  }
62238
62256
 
62239
62257
  // ../agentic/dist/checkpoints.js
62240
- 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";
62258
+ import { existsSync as existsSync33, mkdirSync as mkdirSync15, readFileSync as readFileSync32, writeFileSync as writeFileSync16, statSync as statSync19, unlinkSync as unlinkSync5, rmSync as rmSync6, renameSync } from "node:fs";
62241
62259
  import { join as join24, resolve as resolve29, dirname as dirname22, sep as sep5 } from "node:path";
62242
62260
  import { randomUUID as nodeRandomUUID } from "node:crypto";
62243
62261
  function generateId() {
@@ -62389,7 +62407,7 @@ function readJson(filePath, fallback) {
62389
62407
  try {
62390
62408
  if (!existsSync33(filePath))
62391
62409
  return fallback;
62392
- const raw2 = readFileSync31(filePath, "utf-8");
62410
+ const raw2 = readFileSync32(filePath, "utf-8");
62393
62411
  if (raw2.trim() === "")
62394
62412
  return fallback;
62395
62413
  return JSON.parse(raw2);
@@ -62509,7 +62527,7 @@ function rollback(projectDir, id) {
62509
62527
  }
62510
62528
 
62511
62529
  // ../agentic/dist/config.js
62512
- import { readFileSync as readFileSync32, writeFileSync as writeFileSync17, existsSync as existsSync34, mkdirSync as mkdirSync16, chmodSync } from "node:fs";
62530
+ import { readFileSync as readFileSync33, writeFileSync as writeFileSync17, existsSync as existsSync34, mkdirSync as mkdirSync16, chmodSync } from "node:fs";
62513
62531
  import { resolve as resolve30, dirname as dirname23 } from "node:path";
62514
62532
  var DEFAULT_CONFIG = {
62515
62533
  provider: "openai",
@@ -62558,7 +62576,7 @@ function readDotenvValue(projectDir, key, def = null) {
62558
62576
  const p = dotenvPath(projectDir);
62559
62577
  if (!existsSync34(p))
62560
62578
  return def;
62561
- const content = readFileSync32(p, "utf-8");
62579
+ const content = readFileSync33(p, "utf-8");
62562
62580
  for (const rawLine of content.split("\n")) {
62563
62581
  const line = rawLine.trim();
62564
62582
  if (!line || line.startsWith("#"))
@@ -62586,7 +62604,7 @@ function writeDotenvValue(projectDir, key, value) {
62586
62604
  let out = "";
62587
62605
  let replaced = false;
62588
62606
  if (existsSync34(p)) {
62589
- const lines = readFileSync32(p, "utf-8").split("\n");
62607
+ const lines = readFileSync33(p, "utf-8").split("\n");
62590
62608
  for (const rawLine of lines) {
62591
62609
  const trimmed = rawLine.trim();
62592
62610
  const eq = trimmed.indexOf("=");
@@ -62616,7 +62634,7 @@ function loadAgenticConfig(projectDir) {
62616
62634
  let cfg = { ...DEFAULT_CONFIG };
62617
62635
  try {
62618
62636
  if (existsSync34(p))
62619
- cfg = { ...cfg, ...JSON.parse(readFileSync32(p, "utf-8")) };
62637
+ cfg = { ...cfg, ...JSON.parse(readFileSync33(p, "utf-8")) };
62620
62638
  } catch {
62621
62639
  }
62622
62640
  let hasKey = false;
@@ -62659,7 +62677,7 @@ function getProviderSpecificKey(projectDir, provider) {
62659
62677
  try {
62660
62678
  const pp2 = providerKeyPath(projectDir, prov);
62661
62679
  if (existsSync34(pp2)) {
62662
- const v = readFileSync32(pp2, "utf-8").trim();
62680
+ const v = readFileSync33(pp2, "utf-8").trim();
62663
62681
  if (v)
62664
62682
  return v;
62665
62683
  }
@@ -62707,7 +62725,7 @@ function getApiKey(projectDir, provider) {
62707
62725
  try {
62708
62726
  const pp2 = providerKeyPath(projectDir, prov);
62709
62727
  if (existsSync34(pp2)) {
62710
- const v = readFileSync32(pp2, "utf-8").trim();
62728
+ const v = readFileSync33(pp2, "utf-8").trim();
62711
62729
  if (v)
62712
62730
  return v;
62713
62731
  }
@@ -62730,7 +62748,7 @@ function getApiKey(projectDir, provider) {
62730
62748
  }
62731
62749
 
62732
62750
  // ../agentic/dist/dev-api.js
62733
- import { existsSync as existsSync35, readFileSync as readFileSync33 } from "node:fs";
62751
+ import { existsSync as existsSync35, readFileSync as readFileSync34 } from "node:fs";
62734
62752
  import { resolve as resolve31 } from "node:path";
62735
62753
 
62736
62754
  // ../agentic/dist/providers/openai.js
@@ -63103,7 +63121,7 @@ function getPerProviderKeyRaw(projectDir, provider) {
63103
63121
  try {
63104
63122
  const p = resolve31(projectDir, ".vesk", "agentic", "keys", `${sanitizeProviderName(prov)}.key`);
63105
63123
  if (existsSync35(p)) {
63106
- const v = readFileSync33(p, "utf-8").trim();
63124
+ const v = readFileSync34(p, "utf-8").trim();
63107
63125
  if (v)
63108
63126
  return v;
63109
63127
  }
@@ -63964,7 +63982,7 @@ var Agent = class {
63964
63982
  };
63965
63983
 
63966
63984
  // ../agentic/dist/tools/vesk.js
63967
- import { existsSync as existsSync36, readFileSync as readFileSync34, writeFileSync as writeFileSync18, mkdirSync as mkdirSync17, readdirSync as readdirSync11, statSync as statSync20 } from "node:fs";
63985
+ import { existsSync as existsSync36, readFileSync as readFileSync35, writeFileSync as writeFileSync18, mkdirSync as mkdirSync17, readdirSync as readdirSync11, statSync as statSync20 } from "node:fs";
63968
63986
  import { resolve as resolve32, join as join25, dirname as dirname24, sep as sep6 } from "node:path";
63969
63987
  function resolveWithin3(baseDir, relPath) {
63970
63988
  const base = resolve32(baseDir);
@@ -63983,7 +64001,7 @@ function readPluginState3(veskDir) {
63983
64001
  if (!existsSync36(file))
63984
64002
  return { version: 1, plugins: [] };
63985
64003
  try {
63986
- const raw2 = JSON.parse(readFileSync34(file, "utf-8"));
64004
+ const raw2 = JSON.parse(readFileSync35(file, "utf-8"));
63987
64005
  if (!raw2 || typeof raw2 !== "object")
63988
64006
  return { version: 1, plugins: [] };
63989
64007
  if (raw2.version !== 1)
@@ -64183,7 +64201,7 @@ function createVeskTools(deps) {
64183
64201
  if (cfgInfo.path && existsSync36(cfgInfo.path)) {
64184
64202
  configExists = true;
64185
64203
  try {
64186
- configSource = readFileSync34(cfgInfo.path, "utf-8").slice(0, 8e3);
64204
+ configSource = readFileSync35(cfgInfo.path, "utf-8").slice(0, 8e3);
64187
64205
  } catch {
64188
64206
  configSource = null;
64189
64207
  }
@@ -64192,7 +64210,7 @@ function createVeskTools(deps) {
64192
64210
  const pkgPath = resolve32(projectDir, "package.json");
64193
64211
  if (existsSync36(pkgPath)) {
64194
64212
  try {
64195
- packageJson = JSON.parse(readFileSync34(pkgPath, "utf-8"));
64213
+ packageJson = JSON.parse(readFileSync35(pkgPath, "utf-8"));
64196
64214
  } catch {
64197
64215
  packageJson = null;
64198
64216
  }
@@ -64280,7 +64298,7 @@ function createVeskTools(deps) {
64280
64298
  return jsonOk({ ok: true, path: rel, directory: true, entries: entries.slice(0, 200) });
64281
64299
  }
64282
64300
  if (st.isFile()) {
64283
- const content = readFileSync34(resolved, "utf-8");
64301
+ const content = readFileSync35(resolved, "utf-8");
64284
64302
  const capped = content.length > 2e4 ? content.slice(0, 2e4) + "\n/* truncated */" : content;
64285
64303
  return jsonOk({ ok: true, path: rel, directory: false, content: capped, size: content.length });
64286
64304
  }
@@ -64316,7 +64334,7 @@ function createVeskTools(deps) {
64316
64334
  if (!info.path || !existsSync36(info.path)) {
64317
64335
  return jsonOk({ ok: true, path: null, exists: false, source: "", config: {} });
64318
64336
  }
64319
- const source = readFileSync34(info.path, "utf-8");
64337
+ const source = readFileSync35(info.path, "utf-8");
64320
64338
  return jsonOk({ ok: true, path: info.path, exists: true, source, config: null });
64321
64339
  } catch (e) {
64322
64340
  return jsonError(e instanceof Error ? e.message : String(e));
@@ -64374,7 +64392,7 @@ function createVeskTools(deps) {
64374
64392
  const contained = resolveWithin3(projectDir, info.path.slice(projectDir.length + 1));
64375
64393
  if (!contained)
64376
64394
  return jsonError("path escapes project root");
64377
- const current3 = readFileSync34(info.path, "utf-8");
64395
+ const current3 = readFileSync35(info.path, "utf-8");
64378
64396
  const patched = applySimpleConfigToggle(current3, key, a.value);
64379
64397
  if (patched === null)
64380
64398
  return jsonError("could not safely edit the config object; use the source editor");
@@ -64697,7 +64715,7 @@ function createVeskTools(deps) {
64697
64715
  return jsonError("path escapes project root");
64698
64716
  if (!existsSync36(file))
64699
64717
  return jsonError(`checkpoint not found: ${checkpointId}`, { checkpointId });
64700
- const raw2 = readFileSync34(file, "utf-8");
64718
+ const raw2 = readFileSync35(file, "utf-8");
64701
64719
  let data2;
64702
64720
  try {
64703
64721
  data2 = JSON.parse(raw2);
@@ -64780,7 +64798,7 @@ function renderDefaultNotFoundPage2(opts = {}) {
64780
64798
  }
64781
64799
 
64782
64800
  // ../adapter/dist/ssr-function.js
64783
- import { readFileSync as readFileSync35, existsSync as existsSync37 } from "node:fs";
64801
+ import { readFileSync as readFileSync36, existsSync as existsSync37 } from "node:fs";
64784
64802
  import { resolve as resolve33, relative as relative7, join as join26 } from "node:path";
64785
64803
  init_default_pages();
64786
64804
  function resolveBoundaryFileForUrl2(pathname, appDir, file) {
@@ -64795,7 +64813,7 @@ function resolveBoundaryFileForUrl2(pathname, appDir, file) {
64795
64813
  }
64796
64814
 
64797
64815
  // ../adapter/dist/css.js
64798
- import { readFileSync as readFileSync36, existsSync as existsSync38 } from "node:fs";
64816
+ import { readFileSync as readFileSync37, existsSync as existsSync38 } from "node:fs";
64799
64817
  import { resolve as resolve34 } from "node:path";
64800
64818
  var GLOBAL_CSS_URL2 = "/_vesk/static/global.css";
64801
64819
  function resolveUserCssPath2(appDir) {
@@ -64822,7 +64840,7 @@ function resolveCssUrls2(opts) {
64822
64840
  // ../adapter/dist/hmr.js
64823
64841
  init_client_codegen();
64824
64842
  import { WebSocketServer } from "ws";
64825
- import { readFileSync as readFileSync37, existsSync as existsSync39, writeFileSync as writeFileSync19 } from "node:fs";
64843
+ import { readFileSync as readFileSync38, existsSync as existsSync39, writeFileSync as writeFileSync19 } from "node:fs";
64826
64844
  import { resolve as resolve35, dirname as dirname25 } from "node:path";
64827
64845
  import { fileURLToPath as fileURLToPath7 } from "node:url";
64828
64846
  init_default_pages();
@@ -65066,7 +65084,7 @@ function buildErrorPayload(error, filename, opts = {}) {
65066
65084
  for (const absPath of candidates) {
65067
65085
  try {
65068
65086
  if (existsSync39(absPath)) {
65069
- src2 = readFileSync37(absPath, "utf-8");
65087
+ src2 = readFileSync38(absPath, "utf-8");
65070
65088
  resolvedAbsPath = absPath;
65071
65089
  break;
65072
65090
  }
@@ -65114,7 +65132,7 @@ function buildErrorPayload(error, filename, opts = {}) {
65114
65132
  }
65115
65133
 
65116
65134
  // ../adapter/dist/ssr-error.js
65117
- import { existsSync as existsSync40, readFileSync as readFileSync38 } from "node:fs";
65135
+ import { existsSync as existsSync40, readFileSync as readFileSync39 } from "node:fs";
65118
65136
  import { relative as relative8, resolve as resolve36 } from "node:path";
65119
65137
 
65120
65138
  // ../adapter/dist/error-codeframe.js
@@ -65345,7 +65363,7 @@ function readIfFile(absPath) {
65345
65363
  try {
65346
65364
  if (!existsSync40(absPath))
65347
65365
  return null;
65348
- return readFileSync38(absPath, "utf-8");
65366
+ return readFileSync39(absPath, "utf-8");
65349
65367
  } catch {
65350
65368
  return null;
65351
65369
  }
@@ -65493,7 +65511,7 @@ function renderDevErrorPage(payload, opts) {
65493
65511
 
65494
65512
  // src/build-packages.ts
65495
65513
  import { spawnSync as spawnSync2 } from "node:child_process";
65496
- 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";
65514
+ import { cpSync as cpSync2, existsSync as existsSync41, mkdirSync as mkdirSync18, readFileSync as readFileSync40, readdirSync as readdirSync12, statSync as statSync21, writeFileSync as writeFileSync20 } from "node:fs";
65497
65515
  import { createRequire as createRequire7 } from "node:module";
65498
65516
  import { dirname as dirname26, join as join27, resolve as resolve37 } from "node:path";
65499
65517
  import { fileURLToPath as fileURLToPath8 } from "node:url";
@@ -65585,7 +65603,7 @@ function buildPackages(force = false) {
65585
65603
  mkdirSync18(dirname26(to), { recursive: true });
65586
65604
  cpSync2(join27(pkgDir, c.from), to, { recursive: true });
65587
65605
  }
65588
- const srcPkg = JSON.parse(readFileSync39(join27(pkgDir, "package.json"), "utf-8"));
65606
+ const srcPkg = JSON.parse(readFileSync40(join27(pkgDir, "package.json"), "utf-8"));
65589
65607
  if (pkg === "lucide-vesk") {
65590
65608
  const lucideDistPkg = {
65591
65609
  name: srcPkg.name,
@@ -65614,7 +65632,7 @@ if (process.argv[1] && resolve37(process.argv[1]) === fileURLToPath8(import.meta
65614
65632
  }
65615
65633
 
65616
65634
  // src/action-handler.ts
65617
- import { existsSync as existsSync42, readFileSync as readFileSync40, readdirSync as readdirSync13 } from "node:fs";
65635
+ import { existsSync as existsSync42, readFileSync as readFileSync41, readdirSync as readdirSync13 } from "node:fs";
65618
65636
  import { resolve as resolve38 } from "node:path";
65619
65637
 
65620
65638
  // ../compiler/dist/server-cookies.js
@@ -65744,7 +65762,7 @@ function candidateSources(appDirPath, routeTree) {
65744
65762
  function registerSource(sourcePath2) {
65745
65763
  if (!existsSync42(sourcePath2)) return;
65746
65764
  try {
65747
- compileFile(readFileSync40(sourcePath2, "utf-8"), { sourcePath: sourcePath2 });
65765
+ compileFile(readFileSync41(sourcePath2, "utf-8"), { sourcePath: sourcePath2 });
65748
65766
  } catch {
65749
65767
  }
65750
65768
  }
@@ -65783,14 +65801,14 @@ async function renderPageHtml(pagePathname, params, ctx2) {
65783
65801
  const pageFilePath = resolve38(ctx2.appDirPath, node.sourceDir, "page.vsk");
65784
65802
  const layoutFilePath = resolve38(ctx2.appDirPath, node.sourceDir, "layout.vsk");
65785
65803
  if (i === chain.length - 1 && node.page && existsSync42(pageFilePath)) {
65786
- const src3 = readFileSync40(pageFilePath, "utf-8");
65804
+ const src3 = readFileSync41(pageFilePath, "utf-8");
65787
65805
  const compName2 = resolveComponentName(src3) || node.page;
65788
65806
  const result = await renderPage(src3, compName2, { params }, /* @__PURE__ */ new Map(), { hydrate: true, sourcePath: pageFilePath });
65789
65807
  body = result.body;
65790
65808
  head = result.head || "";
65791
65809
  }
65792
65810
  if (node.layout && existsSync42(layoutFilePath)) {
65793
- const src3 = readFileSync40(layoutFilePath, "utf-8");
65811
+ const src3 = readFileSync41(layoutFilePath, "utf-8");
65794
65812
  const compName2 = resolveComponentName(src3) || node.layout;
65795
65813
  const result = await renderPage(src3, compName2, { children: body }, /* @__PURE__ */ new Map(), { hydrate: true, sourcePath: layoutFilePath });
65796
65814
  body = result.body;
@@ -65821,7 +65839,7 @@ ${prettifyHtml(body)}
65821
65839
  }
65822
65840
  const leaf2 = chain.find((n) => n.page);
65823
65841
  if (!leaf2) return null;
65824
- const src2 = readFileSync40(resolve38(ctx2.appDirPath, leaf2.sourceDir, "page.vsk"), "utf-8");
65842
+ const src2 = readFileSync41(resolve38(ctx2.appDirPath, leaf2.sourceDir, "page.vsk"), "utf-8");
65825
65843
  const compName = resolveComponentName(src2) || leaf2.page;
65826
65844
  const html = await renderFullPage(src2, compName, { params }, /* @__PURE__ */ new Map(), { hydrate: true, clientScriptUrl: "/_vesk/client.js", cssUrls: actionCssUrls(ctx2.appDirPath), security: ctx2.security, sourcePath: resolve38(ctx2.appDirPath, leaf2.sourceDir, "page.vsk"), plugins: ctx2.plugins });
65827
65845
  return applyHtmlPlugins(html.replace("</body>", ' <script type="module" src="/_vesk/hmr.js"></script>\n</body>'), ctx2.plugins, { sourcePath: ctx2.url.pathname });
@@ -65994,7 +66012,7 @@ function buildDevErrorPayload(input) {
65994
66012
  payload.column = colMatch ? parseInt(colMatch[1], 10) : 1;
65995
66013
  if (fileExists && payload.line > 0) {
65996
66014
  try {
65997
- const src2 = readFileSync41(fullPath, "utf-8");
66015
+ const src2 = readFileSync42(fullPath, "utf-8");
65998
66016
  const cf = buildCodeframe2(src2, payload.line, payload.column);
65999
66017
  if (cf) {
66000
66018
  cf.file = payload.file || filename;
@@ -66477,13 +66495,13 @@ async function startDevServer(port, projectDir, config, host) {
66477
66495
  let devCssSource = "";
66478
66496
  if (existsSync43(appCssPath)) {
66479
66497
  devCssSource = appCssPath;
66480
- rawCss = readFileSync41(appCssPath, "utf-8");
66498
+ rawCss = readFileSync42(appCssPath, "utf-8");
66481
66499
  } else if (existsSync43(cssPath)) {
66482
66500
  devCssSource = cssPath;
66483
- rawCss = readFileSync41(cssPath, "utf-8");
66501
+ rawCss = readFileSync42(cssPath, "utf-8");
66484
66502
  } else if (existsSync43(altCssPath)) {
66485
66503
  devCssSource = altCssPath;
66486
- rawCss = readFileSync41(altCssPath, "utf-8");
66504
+ rawCss = readFileSync42(altCssPath, "utf-8");
66487
66505
  }
66488
66506
  if (rawCss) {
66489
66507
  const activeAtStart = getActiveDevPlugins();
@@ -66561,7 +66579,7 @@ async function startDevServer(port, projectDir, config, host) {
66561
66579
  };
66562
66580
  walk9(appDirPath);
66563
66581
  try {
66564
- parts.push(`compiler:${readFileSync41(join28(process.cwd(), "node_modules", "@vesk", "compiler", "package.json"), "utf8")}`);
66582
+ parts.push(`compiler:${readFileSync42(join28(process.cwd(), "node_modules", "@vesk", "compiler", "package.json"), "utf8")}`);
66565
66583
  } catch {
66566
66584
  }
66567
66585
  return createHash3("sha256").update(parts.join("\n")).digest("hex").slice(0, 32);
@@ -66569,7 +66587,7 @@ async function startDevServer(port, projectDir, config, host) {
66569
66587
  function readDevBundleCache() {
66570
66588
  try {
66571
66589
  const file = join28(devCacheDir(), "client-bundle.json");
66572
- const parsed = JSON.parse(readFileSync41(file, "utf8"));
66590
+ const parsed = JSON.parse(readFileSync42(file, "utf8"));
66573
66591
  if (parsed.key !== devCacheKey() || typeof parsed.main !== "string" || !Array.isArray(parsed.chunks)) return null;
66574
66592
  return { main: parsed.main, chunks: parsed.chunks };
66575
66593
  } catch {
@@ -66975,7 +66993,7 @@ async function startDevServer(port, projectDir, config, host) {
66975
66993
  debounceTimer = setTimeout(async () => {
66976
66994
  const t0 = Date.now();
66977
66995
  try {
66978
- const current3 = fileExists ? readFileSync41(fullPath, "utf-8") : null;
66996
+ const current3 = fileExists ? readFileSync42(fullPath, "utf-8") : null;
66979
66997
  if (eventType !== "rename" && current3 !== null && lastSeenContent.get(fullPath) === current3) {
66980
66998
  LOG.info(`skipped unchanged (${filename})`);
66981
66999
  return;
@@ -67034,7 +67052,7 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
67034
67052
  if (compCode.trim()) fnSources = { _raw: compCode };
67035
67053
  } else if (fileExists && !bundleError) {
67036
67054
  try {
67037
- const src2 = readFileSync41(fullPath, "utf-8");
67055
+ const src2 = readFileSync42(fullPath, "utf-8");
67038
67056
  let compCode = buildHmrEvalSnippet2(
67039
67057
  compileClient2(src2, null, { forceClient: true, sourcePath: fullPath, mdRoots: [projectDir] })
67040
67058
  );
@@ -67118,7 +67136,7 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
67118
67136
  cssDebounceTimer = setTimeout(async () => {
67119
67137
  try {
67120
67138
  if (fileExists) {
67121
- rawCss = readFileSync41(fullPath, "utf-8");
67139
+ rawCss = readFileSync42(fullPath, "utf-8");
67122
67140
  }
67123
67141
  const cssChanged = await rebuildTailwindCss();
67124
67142
  if (cssChanged && typeof globalThis.__vesk_broadcastHmr === "function") {
@@ -67281,7 +67299,7 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
67281
67299
  }
67282
67300
  if (url.pathname === "/_vesk/hmr" || url.pathname === "/_vesk/hmr.js") {
67283
67301
  if (hmrClientPath) {
67284
- let hmrContent = readFileSync41(hmrClientPath, "utf-8");
67302
+ let hmrContent = readFileSync42(hmrClientPath, "utf-8");
67285
67303
  if (hmrClientPath.endsWith(".ts")) {
67286
67304
  hmrContent = stripCodeTypes2(hmrContent);
67287
67305
  }
@@ -67332,7 +67350,7 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
67332
67350
  if (staticPath && existsSync43(staticPath) && statSync22(staticPath).isFile()) {
67333
67351
  const ext = extname7(staticPath);
67334
67352
  res.writeHead(200, { "Content-Type": MIME2[ext] || "application/octet-stream" });
67335
- res.end(readFileSync41(staticPath));
67353
+ res.end(readFileSync42(staticPath));
67336
67354
  return;
67337
67355
  }
67338
67356
  }
@@ -67433,7 +67451,7 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
67433
67451
  const nfPath = resolveBoundaryFileForUrl2(url.pathname, appDirPath, "not-found.vsk");
67434
67452
  if (nfPath) {
67435
67453
  try {
67436
- const nfSrc = readFileSync41(nfPath, "utf-8");
67454
+ const nfSrc = readFileSync42(nfPath, "utf-8");
67437
67455
  const nfCompName = extractCompName2(nfSrc) || "NotFound";
67438
67456
  notFoundHtml = await renderFullPage(nfSrc, nfCompName, { params: {}, url: url.pathname }, /* @__PURE__ */ new Map(), { hydrate: true, cssUrls: activeCssUrls(), security, externalDataScript: storeDataScript, sourcePath: nfPath, cached: cachedSsrCompile(ssrCompileCache, nfSrc, nfPath), plugins: getActiveDevPlugins() });
67439
67457
  } catch {
@@ -67477,7 +67495,7 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
67477
67495
  const pageFilePath = resolve39(appDirPath, node.sourceDir, "page.vsk");
67478
67496
  const layoutFilePath = resolve39(appDirPath, node.sourceDir, "layout.vsk");
67479
67497
  if (i === chain.length - 1 && node.page && existsSync43(pageFilePath)) {
67480
- const src2 = readFileSync41(pageFilePath, "utf-8");
67498
+ const src2 = readFileSync42(pageFilePath, "utf-8");
67481
67499
  const compName = extractCompName2(src2) || node.page;
67482
67500
  const result = await renderPage(src2, compName, { params: matched.params }, /* @__PURE__ */ new Map(), { hydrate: true, sourcePath: pageFilePath, cached: cachedSsrCompile(ssrCompileCache, src2, pageFilePath) });
67483
67501
  body = result.body;
@@ -67485,7 +67503,7 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
67485
67503
  props = result.props;
67486
67504
  }
67487
67505
  if (node.layout && existsSync43(layoutFilePath)) {
67488
- const src2 = readFileSync41(layoutFilePath, "utf-8");
67506
+ const src2 = readFileSync42(layoutFilePath, "utf-8");
67489
67507
  const compName = extractCompName2(src2) || node.layout;
67490
67508
  const result = await renderPage(src2, compName, { children: body }, /* @__PURE__ */ new Map(), { hydrate: true, sourcePath: layoutFilePath, cached: cachedSsrCompile(ssrCompileCache, src2, layoutFilePath) });
67491
67509
  body = result.body;
@@ -67530,7 +67548,7 @@ ${prettifyHtml(body)}
67530
67548
  } else {
67531
67549
  const leaf2 = chain.find((n) => n.page);
67532
67550
  if (leaf2) {
67533
- const src2 = readFileSync41(resolve39(appDirPath, leaf2.sourceDir, "page.vsk"), "utf-8");
67551
+ const src2 = readFileSync42(resolve39(appDirPath, leaf2.sourceDir, "page.vsk"), "utf-8");
67534
67552
  const compName = extractCompName2(src2) || leaf2.page;
67535
67553
  html = await renderFullPage(src2, compName, { params: matched.params }, /* @__PURE__ */ new Map(), { hydrate: true, clientScriptUrl: "/_vesk/client.js", cssUrls: activeCssUrls(), security, externalDataScript: storeDataScript, sourcePath: resolve39(appDirPath, leaf2.sourceDir, "page.vsk"), cached: cachedSsrCompile(ssrCompileCache, src2, resolve39(appDirPath, leaf2.sourceDir, "page.vsk")), plugins: getActiveDevPlugins() });
67536
67554
  html = html.replace("</body>", ' <script type="module" src="/_vesk/hmr.js"></script>\n</body>');
@@ -67559,7 +67577,7 @@ ${prettifyHtml(body)}
67559
67577
  if (!hasLayout) {
67560
67578
  const leaf2 = chain.find((n) => n.page);
67561
67579
  if (leaf2) {
67562
- const src2 = readFileSync41(resolve39(appDirPath, leaf2.sourceDir, "page.vsk"), "utf-8");
67580
+ const src2 = readFileSync42(resolve39(appDirPath, leaf2.sourceDir, "page.vsk"), "utf-8");
67563
67581
  const compName = extractCompName2(src2) || leaf2.page;
67564
67582
  yield* renderPageStream(src2, compName, { params: matched.params }, /* @__PURE__ */ new Map(), { hydrate: true, clientScriptUrl: "/_vesk/client.js", cssUrls: activeCssUrls(), security, externalDataScript: storeDataScript, sourcePath: resolve39(appDirPath, leaf2.sourceDir, "page.vsk"), cached: cachedSsrCompile(ssrCompileCache, src2, resolve39(appDirPath, leaf2.sourceDir, "page.vsk")), plugins: getActiveDevPlugins() });
67565
67583
  } else {
@@ -67575,7 +67593,7 @@ ${prettifyHtml(body)}
67575
67593
  const pageFilePath = resolve39(appDirPath, node.sourceDir, "page.vsk");
67576
67594
  const layoutFilePath = resolve39(appDirPath, node.sourceDir, "layout.vsk");
67577
67595
  if (i === chain.length - 1 && node.page && existsSync43(pageFilePath)) {
67578
- const src2 = readFileSync41(pageFilePath, "utf-8");
67596
+ const src2 = readFileSync42(pageFilePath, "utf-8");
67579
67597
  const compName = extractCompName2(src2) || node.page;
67580
67598
  const result = await renderPage(src2, compName, { params: matched.params }, /* @__PURE__ */ new Map(), { hydrate: true, sourcePath: pageFilePath, cached: cachedSsrCompile(ssrCompileCache, src2, pageFilePath) });
67581
67599
  body = result.body;
@@ -67583,7 +67601,7 @@ ${prettifyHtml(body)}
67583
67601
  props = result.props;
67584
67602
  }
67585
67603
  if (node.layout && existsSync43(layoutFilePath)) {
67586
- const src2 = readFileSync41(layoutFilePath, "utf-8");
67604
+ const src2 = readFileSync42(layoutFilePath, "utf-8");
67587
67605
  const compName = extractCompName2(src2) || node.layout;
67588
67606
  const result = await renderPage(src2, compName, { children: body }, /* @__PURE__ */ new Map(), { hydrate: true, sourcePath: layoutFilePath, cached: cachedSsrCompile(ssrCompileCache, src2, layoutFilePath) });
67589
67607
  body = result.body;
@@ -67727,7 +67745,7 @@ ${prettifyHtml(body)}
67727
67745
  const nfPath = resolve39(appDirPath, node.sourceDir, "not-found.vsk");
67728
67746
  if (existsSync43(nfPath)) {
67729
67747
  try {
67730
- const nfSrc = readFileSync41(nfPath, "utf-8");
67748
+ const nfSrc = readFileSync42(nfPath, "utf-8");
67731
67749
  const nfCompName = extractCompName2(nfSrc) || node.notFound;
67732
67750
  const html = await renderFullPage(nfSrc, nfCompName, { params: match.params, url: url.pathname }, /* @__PURE__ */ new Map(), { hydrate: true, cssUrls: activeCssUrls(), security, externalDataScript: storeDataScript, sourcePath: nfPath, cached: cachedSsrCompile(ssrCompileCache, nfSrc, nfPath), plugins: getActiveDevPlugins() });
67733
67751
  notFoundHtml = injectDevScripts(html);
@@ -67773,7 +67791,7 @@ ${prettifyHtml(body)}
67773
67791
  const errPath = resolve39(appDirPath, node.sourceDir, "error.vsk");
67774
67792
  if (existsSync43(errPath)) {
67775
67793
  try {
67776
- const errSrc = readFileSync41(errPath, "utf-8");
67794
+ const errSrc = readFileSync42(errPath, "utf-8");
67777
67795
  const errCompName = extractCompName2(errSrc) || node.error;
67778
67796
  const errProps = {
67779
67797
  error: err.message,
@@ -68178,7 +68196,7 @@ function loadEnvFiles(projectDir) {
68178
68196
  ];
68179
68197
  for (const filePath of files) {
68180
68198
  if (!existsSync46(filePath)) continue;
68181
- const content = readFileSync45(filePath, "utf-8");
68199
+ const content = readFileSync46(filePath, "utf-8");
68182
68200
  for (const line of content.split("\n")) {
68183
68201
  const trimmed = line.trim();
68184
68202
  if (!trimmed || trimmed.startsWith("#")) continue;
@@ -68392,7 +68410,7 @@ if (cmd === "migrate") {
68392
68410
  const projectDir = process.cwd();
68393
68411
  const { runMigrate: runMigrate2 } = await Promise.resolve().then(() => (init_migrate(), migrate_exports));
68394
68412
  const { CODEMODS: CODEMODS2 } = await Promise.resolve().then(() => (init_codemods(), codemods_exports));
68395
- const { version: cliVersion } = JSON.parse(readFileSync45(join32(__dirname10, "..", "package.json"), "utf-8"));
68413
+ const { version: cliVersion } = JSON.parse(readFileSync46(join32(__dirname10, "..", "package.json"), "utf-8"));
68396
68414
  if (args.includes("--list")) {
68397
68415
  console.error("vesk migrate: available codemods");
68398
68416
  for (const c of CODEMODS2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vesk/vesk-cli",
3
- "version": "0.2.81",
3
+ "version": "0.2.83",
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.81",
12
- "@vesk/compiler": "^0.2.81",
13
- "@vesk/plugin-tailwind": "^0.2.81",
14
- "@vesk/runtime": "^0.2.81",
11
+ "@vesk/adapter": "^0.2.83",
12
+ "@vesk/compiler": "^0.2.83",
13
+ "@vesk/plugin-tailwind": "^0.2.83",
14
+ "@vesk/runtime": "^0.2.83",
15
15
  "esrap": "^2.3.0",
16
16
  "typescript": "^5.8.0",
17
17
  "ws": "^8.18.0",