@vesk/vesk-cli 0.2.18 → 0.2.20

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 +213 -105
  2. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -16904,6 +16904,20 @@ var init_parser = __esm({
16904
16904
  import { walk } from "zimmerframe";
16905
16905
  import { print } from "esrap";
16906
16906
  import ts from "esrap/languages/ts";
16907
+ function isTypeOnlyImportExport(node) {
16908
+ if (!node) return false;
16909
+ if (node.type === "ImportDeclaration") return node.importKind === "type";
16910
+ if (node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration") {
16911
+ return node.exportKind === "type";
16912
+ }
16913
+ return false;
16914
+ }
16915
+ function isTypeOnlySpecifier(node) {
16916
+ if (!node) return false;
16917
+ if (node.importKind === "type") return true;
16918
+ if (node.exportKind === "type") return true;
16919
+ return false;
16920
+ }
16907
16921
  function hasTsSyntax(ast) {
16908
16922
  let found = false;
16909
16923
  walk(ast, null, {
@@ -16912,6 +16926,10 @@ function hasTsSyntax(ast) {
16912
16926
  found = true;
16913
16927
  return;
16914
16928
  }
16929
+ if (isTypeOnlyImportExport(node) || isTypeOnlySpecifier(node)) {
16930
+ found = true;
16931
+ return;
16932
+ }
16915
16933
  return context.next();
16916
16934
  }
16917
16935
  });
@@ -16920,8 +16938,12 @@ function hasTsSyntax(ast) {
16920
16938
  function isTypeOnlyStatement(node) {
16921
16939
  if (!node) return true;
16922
16940
  if (node.type === "ExportNamedDeclaration" || node.type === "ExportDefaultDeclaration") {
16941
+ if (node.exportKind === "type") return true;
16923
16942
  return !!node.declaration && isTypeOnlyStatement(node.declaration);
16924
16943
  }
16944
+ if (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration") {
16945
+ return isTypeOnlyImportExport(node);
16946
+ }
16925
16947
  return TYPE_ONLY_STATEMENTS.has(node.type);
16926
16948
  }
16927
16949
  function stripTsTypes(ast) {
@@ -16969,6 +16991,28 @@ function stripTsTypes(ast) {
16969
16991
  if (node.typeAnnotation) node.typeAnnotation = null;
16970
16992
  return context.next();
16971
16993
  },
16994
+ ImportDeclaration(node, context) {
16995
+ if (isTypeOnlyImportExport(node)) return null;
16996
+ if (Array.isArray(node.specifiers)) {
16997
+ const kept = node.specifiers.filter((s) => !isTypeOnlySpecifier(s));
16998
+ if (kept.length === 0) return null;
16999
+ node.specifiers = kept;
17000
+ }
17001
+ return context.next();
17002
+ },
17003
+ ExportNamedDeclaration(node, context) {
17004
+ if (isTypeOnlyImportExport(node)) return null;
17005
+ if (Array.isArray(node.specifiers)) {
17006
+ const kept = node.specifiers.filter((s) => !isTypeOnlySpecifier(s));
17007
+ if (kept.length === 0 && node.declaration == null) return null;
17008
+ node.specifiers = kept;
17009
+ }
17010
+ return context.next();
17011
+ },
17012
+ ExportAllDeclaration(node, context) {
17013
+ if (isTypeOnlyImportExport(node)) return null;
17014
+ return context.next();
17015
+ },
16972
17016
  TSInterfaceDeclaration(node) {
16973
17017
  return null;
16974
17018
  },
@@ -30676,7 +30720,7 @@ var init_platform = __esm({
30676
30720
 
30677
30721
  // ../adapter/src/platform-handler.ts
30678
30722
  import { existsSync as existsSync17 } from "node:fs";
30679
- import { resolve as resolve18, dirname as dirname10 } from "node:path";
30723
+ import { resolve as resolve18, dirname as dirname10, join as join10 } from "node:path";
30680
30724
  import { fileURLToPath as fileURLToPath4 } from "node:url";
30681
30725
  function routeName2(segments) {
30682
30726
  const parts = segments.filter(Boolean).map((s) => {
@@ -30692,13 +30736,21 @@ function apiRouteName2(fullPath) {
30692
30736
  function toId(s) {
30693
30737
  return s.replace(/[^a-zA-Z0-9_]/g, "_").replace(/^_/, "");
30694
30738
  }
30695
- function findCompilerSrc2() {
30696
- const monorepo = resolve18(__dirname5, "..", "..", "..", "packages", "compiler", "dist");
30697
- if (existsSync17(monorepo)) return monorepo;
30739
+ function findCompilerSrc2(appDir) {
30740
+ const candidates = [
30741
+ resolve18(__dirname5, "..", "..", "..", "packages", "compiler", "dist"),
30742
+ resolve18(appDir, "..", "node_modules", "@vesk/compiler"),
30743
+ resolve18(appDir, "node_modules", "@vesk/compiler")
30744
+ ];
30745
+ for (const base of candidates) {
30746
+ for (const dir of [base, join10(base, "dist")]) {
30747
+ if (existsSync17(join10(dir, "server-cookies.js"))) return dir;
30748
+ }
30749
+ }
30698
30750
  throw new Error('@vesk/compiler/dist not found \u2014 run "npm run build" first');
30699
30751
  }
30700
30752
  function generatePlatformHandlerSource(input) {
30701
- const { ssrRoutes, apiRoutes, prerenderedPaths, hasMiddleware } = input;
30753
+ const { ssrRoutes, apiRoutes, prerenderedPaths, hasMiddleware, appDir } = input;
30702
30754
  const hasEvents = !!input.hasEvents;
30703
30755
  let imports = "";
30704
30756
  const routeEntries = [];
@@ -30730,7 +30782,7 @@ function generatePlatformHandlerSource(input) {
30730
30782
  const eventsStartLine = hasEvents ? " await __eventsStart({ server: null });" : "";
30731
30783
  const eventsRequestLine = hasEvents ? " await __eventsRequest(mwCtx);" : "";
30732
30784
  const localsSeed = hasEvents ? "Object.assign({}, __serverStore)" : "{}";
30733
- const compilerSrc = findCompilerSrc2();
30785
+ const compilerSrc = findCompilerSrc2(appDir);
30734
30786
  const parseCookiesImport = hasMiddleware ? `import { parseCookies } from ${JSON.stringify(resolve18(compilerSrc, "server-cookies.js"))};` : "";
30735
30787
  return `
30736
30788
  ${imports}
@@ -30933,7 +30985,7 @@ import {
30933
30985
  rmSync as rmSync2,
30934
30986
  readFileSync as readFileSync17
30935
30987
  } from "node:fs";
30936
- import { resolve as resolve19, join as join10, extname as extname6, dirname as dirname11 } from "node:path";
30988
+ import { resolve as resolve19, join as join11, extname as extname6, dirname as dirname11 } from "node:path";
30937
30989
  function ensureCleanDir(dir) {
30938
30990
  rmSync2(dir, { recursive: true, force: true });
30939
30991
  mkdirSync6(dir, { recursive: true });
@@ -30942,8 +30994,8 @@ function copyDirContents(srcDir, destDir) {
30942
30994
  if (!existsSync18(srcDir)) return;
30943
30995
  mkdirSync6(destDir, { recursive: true });
30944
30996
  for (const entry of readdirSync6(srcDir)) {
30945
- const srcPath = join10(srcDir, entry);
30946
- const destPath = join10(destDir, entry);
30997
+ const srcPath = join11(srcDir, entry);
30998
+ const destPath = join11(destDir, entry);
30947
30999
  if (statSync11(srcPath).isDirectory()) {
30948
31000
  copyDirContents(srcPath, destPath);
30949
31001
  } else {
@@ -30989,7 +31041,7 @@ function listStaticDir(dir) {
30989
31041
  if (!existsSync18(dir)) return out;
30990
31042
  function walk6(d, prefix) {
30991
31043
  for (const entry of readdirSync6(d)) {
30992
- const full = join10(d, entry);
31044
+ const full = join11(d, entry);
30993
31045
  const rel = prefix ? `${prefix}/${entry}` : entry;
30994
31046
  if (statSync11(full).isDirectory()) {
30995
31047
  walk6(full, rel);
@@ -31051,7 +31103,8 @@ async function emitPlatformOutput(platform, ctx2) {
31051
31103
  apiRoutes: ctx2.apiRoutes,
31052
31104
  prerenderedPaths,
31053
31105
  hasMiddleware: ctx2.hasMiddleware,
31054
- hasEvents: ctx2.hasEvents
31106
+ hasEvents: ctx2.hasEvents,
31107
+ appDir: resolve20(ctx2.outDir, "..")
31055
31108
  });
31056
31109
  const shell = shellFor(platform);
31057
31110
  const projectRoot = resolve20(ctx2.outDir, "..");
@@ -35422,7 +35475,7 @@ __export(typecheck_exports, {
35422
35475
  typecheckProject: () => typecheckProject
35423
35476
  });
35424
35477
  import { readFileSync as readFileSync34, readdirSync as readdirSync14, statSync as statSync22 } from "node:fs";
35425
- import { join as join21, dirname as dirname22, normalize, relative as relative7, resolve as resolve37, sep as sep7 } from "node:path";
35478
+ import { join as join22, dirname as dirname22, normalize, relative as relative7, resolve as resolve37, sep as sep7 } from "node:path";
35426
35479
  import * as ts8 from "typescript";
35427
35480
  function walkProjectFiles(projectRoot) {
35428
35481
  const code = [];
@@ -35435,7 +35488,7 @@ function walkProjectFiles(projectRoot) {
35435
35488
  return;
35436
35489
  }
35437
35490
  for (const e of entries) {
35438
- const p = join21(dir, e);
35491
+ const p = join22(dir, e);
35439
35492
  let st;
35440
35493
  try {
35441
35494
  st = statSync22(p);
@@ -35490,8 +35543,8 @@ function checkStructureFile(appDir, file) {
35490
35543
  return null;
35491
35544
  }
35492
35545
  function createTypecheckHost(projectRoot, appDir, vskFiles) {
35493
- const ambientPath = join21(appDir, "__vesk_ambient.d.ts");
35494
- const overridePath = join21(appDir, "__vesk_runtime_override.d.ts");
35546
+ const ambientPath = join22(appDir, "__vesk_ambient.d.ts");
35547
+ const overridePath = join22(appDir, "__vesk_runtime_override.d.ts");
35495
35548
  const cached = /* @__PURE__ */ new Map();
35496
35549
  const scriptKindFor = (file) => file.endsWith(".vsk") ? ts8.ScriptKind.TSX : ts8.ScriptKind.TS;
35497
35550
  const host2 = {
@@ -35561,7 +35614,7 @@ function createTypecheckHost(projectRoot, appDir, vskFiles) {
35561
35614
  directoryExists: (dir) => ts8.sys.directoryExists(dir),
35562
35615
  getDirectories: (dir) => {
35563
35616
  try {
35564
- return readdirSync14(dir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => join21(dir, d.name));
35617
+ return readdirSync14(dir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => join22(dir, d.name));
35565
35618
  } catch {
35566
35619
  return [];
35567
35620
  }
@@ -35572,7 +35625,7 @@ function createTypecheckHost(projectRoot, appDir, vskFiles) {
35572
35625
  resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options2) {
35573
35626
  return moduleLiterals.map(({ text }) => {
35574
35627
  if (text.endsWith(".vsk")) {
35575
- const abs = normalize(join21(dirname22(containingFile), text));
35628
+ const abs = normalize(join22(dirname22(containingFile), text));
35576
35629
  return {
35577
35630
  resolvedModule: {
35578
35631
  resolvedFileName: abs + ".d.ts",
@@ -35583,7 +35636,7 @@ function createTypecheckHost(projectRoot, appDir, vskFiles) {
35583
35636
  };
35584
35637
  }
35585
35638
  if (text.endsWith(".css")) {
35586
- const abs = normalize(join21(dirname22(containingFile), text));
35639
+ const abs = normalize(join22(dirname22(containingFile), text));
35587
35640
  return {
35588
35641
  resolvedModule: {
35589
35642
  resolvedFileName: abs + ".d.ts",
@@ -35601,7 +35654,7 @@ function createTypecheckHost(projectRoot, appDir, vskFiles) {
35601
35654
  return host2;
35602
35655
  }
35603
35656
  function typecheckProject(projectRoot, opts = {}) {
35604
- const appDir = opts.appDir ?? join21(projectRoot, "app");
35657
+ const appDir = opts.appDir ?? join22(projectRoot, "app");
35605
35658
  const vskFiles = /* @__PURE__ */ new Map();
35606
35659
  const parseErrors = [];
35607
35660
  const warnings = [];
@@ -35640,8 +35693,8 @@ function typecheckProject(projectRoot, opts = {}) {
35640
35693
  }
35641
35694
  rootNames.push(f);
35642
35695
  }
35643
- const ambientPath = join21(appDir, "__vesk_ambient.d.ts");
35644
- const overridePath = join21(appDir, "__vesk_runtime_override.d.ts");
35696
+ const ambientPath = join22(appDir, "__vesk_ambient.d.ts");
35697
+ const overridePath = join22(appDir, "__vesk_runtime_override.d.ts");
35645
35698
  rootNames.push(ambientPath);
35646
35699
  rootNames.push(overridePath);
35647
35700
  const options2 = {
@@ -36206,7 +36259,7 @@ declare module '@vesk/runtime' {
36206
36259
 
36207
36260
  // src/index.ts
36208
36261
  import { readFileSync as readFileSync35, writeFileSync as writeFileSync19, mkdirSync as mkdirSync16, existsSync as existsSync38 } from "fs";
36209
- import { resolve as resolve38, join as join22, dirname as dirname23 } from "path";
36262
+ import { resolve as resolve38, join as join23, dirname as dirname23 } from "path";
36210
36263
  import { fileURLToPath as fileURLToPath9 } from "url";
36211
36264
 
36212
36265
  // ../compiler/dist/config.js
@@ -39671,7 +39724,7 @@ init_seo_audit();
39671
39724
 
39672
39725
  // src/dev-server.ts
39673
39726
  import { readFileSync as readFileSync33, watch, statSync as statSync21, existsSync as existsSync37, readdirSync as readdirSync13 } from "node:fs";
39674
- import { resolve as resolve36, extname as extname8, join as join20 } from "node:path";
39727
+ import { resolve as resolve36, extname as extname8, join as join21 } from "node:path";
39675
39728
  import { createServer as createServer2 } from "node:http";
39676
39729
  import { WebSocketServer as WebSocketServer2 } from "ws";
39677
39730
 
@@ -39698,6 +39751,25 @@ var TS_NODE_TYPES2 = /* @__PURE__ */ new Set([
39698
39751
  "TSImportEqualsDeclaration",
39699
39752
  "TSParameterProperty"
39700
39753
  ]);
39754
+ function isTypeOnlyImportExport2(node) {
39755
+ if (!node)
39756
+ return false;
39757
+ if (node.type === "ImportDeclaration")
39758
+ return node.importKind === "type";
39759
+ if (node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration") {
39760
+ return node.exportKind === "type";
39761
+ }
39762
+ return false;
39763
+ }
39764
+ function isTypeOnlySpecifier2(node) {
39765
+ if (!node)
39766
+ return false;
39767
+ if (node.importKind === "type")
39768
+ return true;
39769
+ if (node.exportKind === "type")
39770
+ return true;
39771
+ return false;
39772
+ }
39701
39773
  function hasTsSyntax2(ast) {
39702
39774
  let found = false;
39703
39775
  walk4(ast, null, {
@@ -39706,6 +39778,10 @@ function hasTsSyntax2(ast) {
39706
39778
  found = true;
39707
39779
  return;
39708
39780
  }
39781
+ if (isTypeOnlyImportExport2(node) || isTypeOnlySpecifier2(node)) {
39782
+ found = true;
39783
+ return;
39784
+ }
39709
39785
  return context.next();
39710
39786
  }
39711
39787
  });
@@ -39724,8 +39800,13 @@ function isTypeOnlyStatement2(node) {
39724
39800
  if (!node)
39725
39801
  return true;
39726
39802
  if (node.type === "ExportNamedDeclaration" || node.type === "ExportDefaultDeclaration") {
39803
+ if (node.exportKind === "type")
39804
+ return true;
39727
39805
  return !!node.declaration && isTypeOnlyStatement2(node.declaration);
39728
39806
  }
39807
+ if (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration") {
39808
+ return isTypeOnlyImportExport2(node);
39809
+ }
39729
39810
  return TYPE_ONLY_STATEMENTS2.has(node.type);
39730
39811
  }
39731
39812
  function stripTsTypes2(ast) {
@@ -39777,6 +39858,33 @@ function stripTsTypes2(ast) {
39777
39858
  node.typeAnnotation = null;
39778
39859
  return context.next();
39779
39860
  },
39861
+ ImportDeclaration(node, context) {
39862
+ if (isTypeOnlyImportExport2(node))
39863
+ return null;
39864
+ if (Array.isArray(node.specifiers)) {
39865
+ const kept = node.specifiers.filter((s) => !isTypeOnlySpecifier2(s));
39866
+ if (kept.length === 0)
39867
+ return null;
39868
+ node.specifiers = kept;
39869
+ }
39870
+ return context.next();
39871
+ },
39872
+ ExportNamedDeclaration(node, context) {
39873
+ if (isTypeOnlyImportExport2(node))
39874
+ return null;
39875
+ if (Array.isArray(node.specifiers)) {
39876
+ const kept = node.specifiers.filter((s) => !isTypeOnlySpecifier2(s));
39877
+ if (kept.length === 0 && node.declaration == null)
39878
+ return null;
39879
+ node.specifiers = kept;
39880
+ }
39881
+ return context.next();
39882
+ },
39883
+ ExportAllDeclaration(node, context) {
39884
+ if (isTypeOnlyImportExport2(node))
39885
+ return null;
39886
+ return context.next();
39887
+ },
39780
39888
  TSInterfaceDeclaration(node) {
39781
39889
  return null;
39782
39890
  },
@@ -41455,7 +41563,7 @@ init_tokens();
41455
41563
  init_scan();
41456
41564
  init_strip_ts();
41457
41565
  import { readdirSync as readdirSync7, statSync as statSync12, existsSync as existsSync20, readFileSync as readFileSync19 } from "fs";
41458
- import { join as join11, relative as relative5, basename as basename3 } from "path";
41566
+ import { join as join12, relative as relative5, basename as basename3 } from "path";
41459
41567
  function collapseSlashes2(p) {
41460
41568
  let out = "";
41461
41569
  let prevSlash = false;
@@ -41575,7 +41683,7 @@ function scanDirectory(rootDir, dir, parentPath, options2) {
41575
41683
  segmentCount: isGroup || dir === rootDir ? 0 : 1
41576
41684
  };
41577
41685
  for (const entry of entries) {
41578
- const entryPath = join11(dir, entry);
41686
+ const entryPath = join12(dir, entry);
41579
41687
  let entryStat;
41580
41688
  try {
41581
41689
  entryStat = statSync12(entryPath);
@@ -41627,19 +41735,19 @@ function collectSources(tree) {
41627
41735
  function walk6(nodes) {
41628
41736
  for (const node of nodes) {
41629
41737
  if (node.page)
41630
- map.set(node.page, join11(node.sourceDir, "page.vsk"));
41738
+ map.set(node.page, join12(node.sourceDir, "page.vsk"));
41631
41739
  if (node.layout)
41632
- map.set(node.layout, join11(node.sourceDir, "layout.vsk"));
41740
+ map.set(node.layout, join12(node.sourceDir, "layout.vsk"));
41633
41741
  if (node.loading)
41634
- map.set(node.loading, join11(node.sourceDir, "loading.vsk"));
41742
+ map.set(node.loading, join12(node.sourceDir, "loading.vsk"));
41635
41743
  if (node.error)
41636
- map.set(node.error, join11(node.sourceDir, "error.vsk"));
41744
+ map.set(node.error, join12(node.sourceDir, "error.vsk"));
41637
41745
  if (node.notFound)
41638
- map.set(node.notFound, join11(node.sourceDir, "not-found.vsk"));
41746
+ map.set(node.notFound, join12(node.sourceDir, "not-found.vsk"));
41639
41747
  if (node.offline)
41640
- map.set(node.offline, join11(node.sourceDir, "offline.vsk"));
41748
+ map.set(node.offline, join12(node.sourceDir, "offline.vsk"));
41641
41749
  if (node.network)
41642
- map.set(node.network, join11(node.sourceDir, "network.vsk"));
41750
+ map.set(node.network, join12(node.sourceDir, "network.vsk"));
41643
41751
  walk6(node.children);
41644
41752
  }
41645
41753
  }
@@ -41726,7 +41834,7 @@ function matchUrl(tree, pathname) {
41726
41834
 
41727
41835
  // ../compiler/dist/api-routes.js
41728
41836
  import { readdirSync as readdirSync8, statSync as statSync13, existsSync as existsSync21 } from "fs";
41729
- import { join as join12 } from "path";
41837
+ import { join as join13 } from "path";
41730
41838
  init_server_utils();
41731
41839
  function basename4(p) {
41732
41840
  const idx = p.lastIndexOf("/");
@@ -41763,7 +41871,7 @@ function scanApiDir(rootDir, dir, parentPath) {
41763
41871
  return nodes;
41764
41872
  if (isRouteGroup) {
41765
41873
  for (const entry of entries) {
41766
- const entryPath = join12(dir, entry);
41874
+ const entryPath = join13(dir, entry);
41767
41875
  let entryStat;
41768
41876
  try {
41769
41877
  entryStat = statSync13(entryPath);
@@ -41793,11 +41901,11 @@ function scanApiDir(rootDir, dir, parentPath) {
41793
41901
  fullPath: collapseSlashes(fullPath) || "/",
41794
41902
  isDynamic,
41795
41903
  isCatchAll,
41796
- filePath: hasRoute && routeFileName ? join12(dir, routeFileName) : null,
41904
+ filePath: hasRoute && routeFileName ? join13(dir, routeFileName) : null,
41797
41905
  children: []
41798
41906
  };
41799
41907
  for (const entry of entries) {
41800
- const entryPath = join12(dir, entry);
41908
+ const entryPath = join13(dir, entry);
41801
41909
  let entryStat;
41802
41910
  try {
41803
41911
  entryStat = statSync13(entryPath);
@@ -42324,11 +42432,11 @@ async function executeMiddlewareChain(chain, request, params, options2 = {}) {
42324
42432
 
42325
42433
  // ../compiler/dist/events.js
42326
42434
  import { existsSync as existsSync23 } from "fs";
42327
- import { join as join13 } from "path";
42435
+ import { join as join14 } from "path";
42328
42436
  var EVENTS_FILE_NAMES2 = ["_events.ts", "_events.js"];
42329
42437
  function collectEventsFile2(appDir) {
42330
42438
  for (const name of EVENTS_FILE_NAMES2) {
42331
- const candidate = join13(appDir, name);
42439
+ const candidate = join14(appDir, name);
42332
42440
  if (existsSync23(candidate))
42333
42441
  return candidate;
42334
42442
  }
@@ -42360,7 +42468,7 @@ async function runEventHandlers(handlers, name, ctx2) {
42360
42468
 
42361
42469
  // ../adapter/dist/client-bundle.js
42362
42470
  import { readFileSync as readFileSync20, existsSync as existsSync24, writeFileSync as writeFileSync11, unlinkSync as unlinkSync4, statSync as statSync14, rmSync as rmSync4, mkdtempSync as mkdtempSync2 } from "node:fs";
42363
- import { resolve as resolve23, join as join14, dirname as dirname14, relative as relative6, sep as sep3 } from "node:path";
42471
+ import { resolve as resolve23, join as join15, dirname as dirname14, relative as relative6, sep as sep3 } from "node:path";
42364
42472
  import { fileURLToPath as fileURLToPath6 } from "node:url";
42365
42473
 
42366
42474
  // ../adapter/dist/esbuild-fallback.js
@@ -42440,8 +42548,8 @@ function findRuntimeSrc3(appDir) {
42440
42548
  resolve23(appDir, "node_modules", "@vesk/runtime")
42441
42549
  ];
42442
42550
  for (const base of candidates) {
42443
- for (const dir of [base, join14(base, "dist")]) {
42444
- if (existsSync24(join14(dir, "index-client.js")))
42551
+ for (const dir of [base, join15(base, "dist")]) {
42552
+ if (existsSync24(join15(dir, "index-client.js")))
42445
42553
  return dir;
42446
42554
  }
42447
42555
  }
@@ -42955,8 +43063,8 @@ ${body}
42955
43063
  continue;
42956
43064
  let finalCode;
42957
43065
  if (hasChunkImports2(entry.code)) {
42958
- const tmpBase = mkdtempSync2(join14(resolve23(appDir, ".."), "tmp-vesk-chunk-"));
42959
- const tmpFile = join14(tmpBase, "entry.js");
43066
+ const tmpBase = mkdtempSync2(join15(resolve23(appDir, ".."), "tmp-vesk-chunk-"));
43067
+ const tmpFile = join15(tmpBase, "entry.js");
42960
43068
  const toBundle = `const __components = globalThis.__components || (globalThis.__components = {});
42961
43069
  const __hydrators = globalThis.__hydrators || (globalThis.__hydrators = {});
42962
43070
  ${entry.code}
@@ -43099,7 +43207,7 @@ function buildRuntimeCode2(runtimeDir) {
43099
43207
  ];
43100
43208
  let code = "";
43101
43209
  for (const f of runtimeFiles) {
43102
- const p = join14(runtimeDir, f);
43210
+ const p = join15(runtimeDir, f);
43103
43211
  if (existsSync24(p)) {
43104
43212
  let src2 = readFileSync20(p, "utf-8");
43105
43213
  src2 = stripTypes2(src2);
@@ -43113,7 +43221,7 @@ ${src2}
43113
43221
  `;
43114
43222
  }
43115
43223
  }
43116
- const indexSrc = readFileSync20(join14(runtimeDir, "index-client.js"), "utf-8");
43224
+ const indexSrc = readFileSync20(join15(runtimeDir, "index-client.js"), "utf-8");
43117
43225
  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())) || [];
43118
43226
  code += "// --- exports ---\n";
43119
43227
  for (const name of [...new Set(exportNames)]) {
@@ -43124,7 +43232,7 @@ ${src2}
43124
43232
  return code;
43125
43233
  }
43126
43234
  function runtimeExportNames2(runtimeDir) {
43127
- const indexSrc = readFileSync20(join14(runtimeDir, "index-client.js"), "utf-8");
43235
+ const indexSrc = readFileSync20(join15(runtimeDir, "index-client.js"), "utf-8");
43128
43236
  const names = /* @__PURE__ */ new Set();
43129
43237
  for (const m of indexSrc.matchAll(/export\s*\{([^}]+)\}\s*from/g)) {
43130
43238
  for (const raw2 of m[1].split(",")) {
@@ -43144,7 +43252,7 @@ async function buildTreeShakenRuntime2(runtimeDir, usedNames) {
43144
43252
  console.error(`vesk: runtime names not exported \u2014 ${missing.join(", ")}; falling back to full runtime`);
43145
43253
  return buildRuntimeCode2(runtimeDir);
43146
43254
  }
43147
- const entry = join14(runtimeDir, RUNTIME_ENTRY2);
43255
+ const entry = join15(runtimeDir, RUNTIME_ENTRY2);
43148
43256
  try {
43149
43257
  try {
43150
43258
  rmSync4(entry);
@@ -43379,7 +43487,7 @@ import { resolve as resolve27 } from "node:path";
43379
43487
  // ../adapter/dist/plugins.js
43380
43488
  init_paths();
43381
43489
  import { readFileSync as readFileSync22, writeFileSync as writeFileSync12, existsSync as existsSync26, mkdirSync as mkdirSync9, statSync as statSync16 } from "node:fs";
43382
- import { resolve as resolve25, dirname as dirname15, join as join15, extname as extname7, basename as basename5 } from "node:path";
43490
+ import { resolve as resolve25, dirname as dirname15, join as join16, extname as extname7, basename as basename5 } from "node:path";
43383
43491
  import { createRequire as createRequire4 } from "node:module";
43384
43492
  import { spawn as spawn2 } from "node:child_process";
43385
43493
  var PLUGIN_STATE_FILENAME2 = "plugins.json";
@@ -43439,7 +43547,7 @@ function resolvePackage2(appDir, pkg) {
43439
43547
  const seen = /* @__PURE__ */ new Set();
43440
43548
  while (cur && cur !== dirname15(cur) && !seen.has(cur)) {
43441
43549
  seen.add(cur);
43442
- const candidate = join15(cur, "package.json");
43550
+ const candidate = join16(cur, "package.json");
43443
43551
  if (existsSync26(candidate)) {
43444
43552
  pkgJsonPath = candidate;
43445
43553
  break;
@@ -43468,7 +43576,7 @@ function resolvePackage2(appDir, pkg) {
43468
43576
  }
43469
43577
  }
43470
43578
  if (localPath) {
43471
- const localJson = join15(localPath, "package.json");
43579
+ const localJson = join16(localPath, "package.json");
43472
43580
  let json = null;
43473
43581
  if (existsSync26(localJson)) {
43474
43582
  json = readJsonFile2(localJson);
@@ -44356,7 +44464,7 @@ var __internals2 = {
44356
44464
  // ../adapter/dist/dev-config.js
44357
44465
  import { existsSync as existsSync27, readFileSync as readFileSync23, writeFileSync as writeFileSync13, mkdirSync as mkdirSync10, mkdtempSync as mkdtempSync3, rmSync as rmSync5 } from "node:fs";
44358
44466
  import { tmpdir } from "node:os";
44359
- import { resolve as resolve26, dirname as dirname16, join as join16 } from "node:path";
44467
+ import { resolve as resolve26, dirname as dirname16, join as join17 } from "node:path";
44360
44468
  init_parser();
44361
44469
  function findConfigFile2(projectDir2) {
44362
44470
  const ts9 = resolve26(projectDir2, "vesk.config.ts");
@@ -44384,9 +44492,9 @@ async function parseConfigSource(source, isTs, projectDir2) {
44384
44492
  js = `const { defineConfig, definePlugin, preset } = globalThis.__vesk_inject;
44385
44493
  ` + js;
44386
44494
  }
44387
- const base = projectDir2 ? (mkdirSync10(join16(projectDir2, ".vesk"), { recursive: true }), join16(projectDir2, ".vesk")) : void 0;
44388
- const dir = base ? mkdtempSync3(join16(base, "cfg-")) : mkdtempSync3(join16(tmpdir(), "vesk-cfg-"));
44389
- const tmpFile = join16(dir, "config.mjs");
44495
+ const base = projectDir2 ? (mkdirSync10(join17(projectDir2, ".vesk"), { recursive: true }), join17(projectDir2, ".vesk")) : void 0;
44496
+ const dir = base ? mkdtempSync3(join17(base, "cfg-")) : mkdtempSync3(join17(tmpdir(), "vesk-cfg-"));
44497
+ const tmpFile = join17(dir, "config.mjs");
44390
44498
  try {
44391
44499
  writeFileSync13(tmpFile, js, "utf-8");
44392
44500
  globalThis.__vesk_inject = {
@@ -45696,7 +45804,7 @@ function produceDiagnostics(input) {
45696
45804
 
45697
45805
  // ../agentic/dist/checkpoints.js
45698
45806
  import { existsSync as existsSync29, mkdirSync as mkdirSync11, readFileSync as readFileSync25, writeFileSync as writeFileSync14, statSync as statSync18, unlinkSync as unlinkSync5, rmSync as rmSync6, renameSync } from "node:fs";
45699
- import { join as join17, resolve as resolve28, dirname as dirname17, sep as sep5 } from "node:path";
45807
+ import { join as join18, resolve as resolve28, dirname as dirname17, sep as sep5 } from "node:path";
45700
45808
  import { randomUUID as nodeRandomUUID } from "node:crypto";
45701
45809
  function generateId() {
45702
45810
  try {
@@ -45829,16 +45937,16 @@ var CheckpointManager = class {
45829
45937
  }
45830
45938
  };
45831
45939
  function getAgenticDir(projectDir2) {
45832
- return join17(resolve28(projectDir2), ".vesk", "agentic");
45940
+ return join18(resolve28(projectDir2), ".vesk", "agentic");
45833
45941
  }
45834
45942
  function getHistoryPath(projectDir2) {
45835
- return join17(getAgenticDir(projectDir2), "history.json");
45943
+ return join18(getAgenticDir(projectDir2), "history.json");
45836
45944
  }
45837
45945
  function getCheckpointDir(projectDir2, id) {
45838
- return join17(getAgenticDir(projectDir2), "checkpoints", id);
45946
+ return join18(getAgenticDir(projectDir2), "checkpoints", id);
45839
45947
  }
45840
45948
  function getCheckpointPath(projectDir2, id) {
45841
- return join17(getCheckpointDir(projectDir2, id), "checkpoint.json");
45949
+ return join18(getCheckpointDir(projectDir2, id), "checkpoint.json");
45842
45950
  }
45843
45951
  function ensureDir(dir) {
45844
45952
  mkdirSync11(dir, { recursive: true });
@@ -45918,7 +46026,7 @@ function createCheckpoint(projectDir2, message, changes = {}, buildResult) {
45918
46026
  };
45919
46027
  const agenticDir = getAgenticDir(projectDir2);
45920
46028
  ensureDir(agenticDir);
45921
- ensureDir(join17(agenticDir, "checkpoints"));
46029
+ ensureDir(join18(agenticDir, "checkpoints"));
45922
46030
  const cpDir = getCheckpointDir(projectDir2, id);
45923
46031
  ensureDir(cpDir);
45924
46032
  writeJsonAtomic(getCheckpointPath(projectDir2, id), checkpoint);
@@ -47423,7 +47531,7 @@ var Agent = class {
47423
47531
 
47424
47532
  // ../agentic/dist/tools/vesk.js
47425
47533
  import { existsSync as existsSync32, readFileSync as readFileSync28, writeFileSync as writeFileSync16, mkdirSync as mkdirSync13, readdirSync as readdirSync10, statSync as statSync19 } from "node:fs";
47426
- import { resolve as resolve31, join as join18, dirname as dirname19, sep as sep6 } from "node:path";
47534
+ import { resolve as resolve31, join as join19, dirname as dirname19, sep as sep6 } from "node:path";
47427
47535
  function resolveWithin3(baseDir, relPath) {
47428
47536
  const base = resolve31(baseDir);
47429
47537
  const target = resolve31(baseDir, relPath);
@@ -47485,7 +47593,7 @@ function findConfigFile3(projectDir2) {
47485
47593
  return { path: null, isTs: false };
47486
47594
  }
47487
47595
  function checkpointDir(veskDir) {
47488
- return join18(resolve31(veskDir), "checkpoints");
47596
+ return join19(resolve31(veskDir), "checkpoints");
47489
47597
  }
47490
47598
  function findMatchingBrace2(src2, openIdx) {
47491
47599
  let inStr = null;
@@ -48100,7 +48208,7 @@ function createVeskTools(deps) {
48100
48208
  const dir = checkpointDir(veskDir);
48101
48209
  mkdirSync13(dir, { recursive: true });
48102
48210
  const id = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
48103
- const file = join18(dir, `${id}.json`);
48211
+ const file = join19(dir, `${id}.json`);
48104
48212
  const check = resolveWithin3(dir, `${id}.json`);
48105
48213
  if (!check)
48106
48214
  return jsonError("path escapes project root");
@@ -48149,7 +48257,7 @@ function createVeskTools(deps) {
48149
48257
  } catch {
48150
48258
  }
48151
48259
  const dir = checkpointDir(veskDir);
48152
- const file = join18(dir, `${checkpointId}.json`);
48260
+ const file = join19(dir, `${checkpointId}.json`);
48153
48261
  const contained = resolveWithin3(dir, `${checkpointId}.json`);
48154
48262
  if (!contained)
48155
48263
  return jsonError("path escapes project root");
@@ -48488,7 +48596,7 @@ function buildCodeframe2(src2, line, column, context = 5) {
48488
48596
  import { spawnSync } from "node:child_process";
48489
48597
  import { cpSync, existsSync as existsSync35, mkdirSync as mkdirSync14, readFileSync as readFileSync31, readdirSync as readdirSync11, statSync as statSync20, writeFileSync as writeFileSync18 } from "node:fs";
48490
48598
  import { createRequire as createRequire5 } from "node:module";
48491
- import { dirname as dirname21, join as join19, resolve as resolve34 } from "node:path";
48599
+ import { dirname as dirname21, join as join20, resolve as resolve34 } from "node:path";
48492
48600
  import { fileURLToPath as fileURLToPath8 } from "node:url";
48493
48601
  var require2 = createRequire5(import.meta.url);
48494
48602
  var __dirname9 = dirname21(fileURLToPath8(import.meta.url));
@@ -48512,7 +48620,7 @@ var PACKAGES = {
48512
48620
  function newestSourceMtime(srcDir) {
48513
48621
  let newest = 0;
48514
48622
  for (const name of readdirSync11(srcDir)) {
48515
- const p = join19(srcDir, name);
48623
+ const p = join20(srcDir, name);
48516
48624
  const st = statSync20(p);
48517
48625
  if (st.isDirectory()) {
48518
48626
  newest = Math.max(newest, newestSourceMtime(p));
@@ -48523,11 +48631,11 @@ function newestSourceMtime(srcDir) {
48523
48631
  return newest;
48524
48632
  }
48525
48633
  function distStale(pkgDir, entry) {
48526
- const distIndex = join19(pkgDir, "dist", `${entry}.js`);
48634
+ const distIndex = join20(pkgDir, "dist", `${entry}.js`);
48527
48635
  if (!existsSync35(distIndex)) return true;
48528
- const distPkg = join19(pkgDir, "dist", "package.json");
48636
+ const distPkg = join20(pkgDir, "dist", "package.json");
48529
48637
  const distStamp = Math.max(statSync20(distIndex).mtimeMs, existsSync35(distPkg) ? statSync20(distPkg).mtimeMs : 0);
48530
- return newestSourceMtime(join19(pkgDir, "src")) > distStamp;
48638
+ return newestSourceMtime(join20(pkgDir, "src")) > distStamp;
48531
48639
  }
48532
48640
  function distPackageJson(pkgName, entry, serverEntry, version2) {
48533
48641
  const exports = {
@@ -48551,23 +48659,23 @@ function distPackageJson(pkgName, entry, serverEntry, version2) {
48551
48659
  function buildPackages(force = false) {
48552
48660
  for (const [pkg, cfg] of Object.entries(PACKAGES)) {
48553
48661
  const pkgDir = resolve34(root2, "packages", pkg);
48554
- if (!existsSync35(join19(pkgDir, "src"))) continue;
48662
+ if (!existsSync35(join20(pkgDir, "src"))) continue;
48555
48663
  if (!force && !distStale(pkgDir, cfg.entry)) continue;
48556
48664
  console.log(`[build] ${cfg.name} -> tsc`);
48557
48665
  const tscBin = require2.resolve("typescript/bin/tsc");
48558
- const result2 = spawnSync(process.execPath, [tscBin, "-p", join19(pkgDir, "tsconfig.build.json")], {
48666
+ const result2 = spawnSync(process.execPath, [tscBin, "-p", join20(pkgDir, "tsconfig.build.json")], {
48559
48667
  stdio: "inherit"
48560
48668
  });
48561
48669
  if (result2.status !== 0) {
48562
48670
  throw new Error(`tsc failed for ${cfg.name}`);
48563
48671
  }
48564
- const distDir = join19(pkgDir, "dist");
48672
+ const distDir = join20(pkgDir, "dist");
48565
48673
  for (const c of cfg.copy || []) {
48566
- const to = join19(distDir, c.to);
48674
+ const to = join20(distDir, c.to);
48567
48675
  mkdirSync14(dirname21(to), { recursive: true });
48568
- cpSync(join19(pkgDir, c.from), to, { recursive: true });
48676
+ cpSync(join20(pkgDir, c.from), to, { recursive: true });
48569
48677
  }
48570
- const srcPkg = JSON.parse(readFileSync31(join19(pkgDir, "package.json"), "utf-8"));
48678
+ const srcPkg = JSON.parse(readFileSync31(join20(pkgDir, "package.json"), "utf-8"));
48571
48679
  if (pkg === "lucide-vesk") {
48572
48680
  const lucideDistPkg = {
48573
48681
  name: srcPkg.name,
@@ -48581,9 +48689,9 @@ function buildPackages(force = false) {
48581
48689
  "./package.json": "./package.json"
48582
48690
  }
48583
48691
  };
48584
- writeFileSync18(join19(distDir, "package.json"), JSON.stringify(lucideDistPkg, null, 2) + "\n");
48692
+ writeFileSync18(join20(distDir, "package.json"), JSON.stringify(lucideDistPkg, null, 2) + "\n");
48585
48693
  } else {
48586
- writeFileSync18(join19(distDir, "package.json"), distPackageJson(cfg.name, cfg.entry, cfg.serverEntry, srcPkg.version || "1.0.0"));
48694
+ writeFileSync18(join20(distDir, "package.json"), distPackageJson(cfg.name, cfg.entry, cfg.serverEntry, srcPkg.version || "1.0.0"));
48587
48695
  }
48588
48696
  console.log(`[build] ${cfg.name} -> dist`);
48589
48697
  }
@@ -48992,9 +49100,9 @@ function resolveRuntimeDir(projectDir2) {
48992
49100
  resolve36(import.meta.dirname ?? ".", "..", "..", "runtime", "dist")
48993
49101
  ];
48994
49102
  for (const dir of candidates) {
48995
- if (existsSync37(join20(dir, "ripple-runtime.js"))) return dir;
48996
- const distDir = join20(dir, "dist");
48997
- if (existsSync37(join20(distDir, "ripple-runtime.js"))) return distDir;
49103
+ if (existsSync37(join21(dir, "ripple-runtime.js"))) return dir;
49104
+ const distDir = join21(dir, "dist");
49105
+ if (existsSync37(join21(distDir, "ripple-runtime.js"))) return distDir;
48998
49106
  }
48999
49107
  return null;
49000
49108
  }
@@ -49150,7 +49258,7 @@ function countFilesNamed(dir, name) {
49150
49258
  if (!existsSync37(dir)) return 0;
49151
49259
  let n = 0;
49152
49260
  for (const entry of readdirSync13(dir, { withFileTypes: true })) {
49153
- const p = join20(dir, entry.name);
49261
+ const p = join21(dir, entry.name);
49154
49262
  if (entry.isDirectory()) n += countFilesNamed(p, name);
49155
49263
  else if (entry.name === name) n++;
49156
49264
  }
@@ -49161,8 +49269,8 @@ async function startDevServer(port2, projectDir2, config, host2) {
49161
49269
  if (!process.env.NODE_ENV) process.env.NODE_ENV = "development";
49162
49270
  const secCfg = config.security || {};
49163
49271
  const maxBodyBytes2 = (typeof secCfg.maxBodyBytes === "number" ? secCfg.maxBodyBytes : void 0) || DEFAULT_MAX_BODY_BYTES;
49164
- const appDirPath = join20(projectDir2, "app");
49165
- const publicDir = join20(projectDir2, "public");
49272
+ const appDirPath = join21(projectDir2, "app");
49273
+ const publicDir = join21(projectDir2, "public");
49166
49274
  installMdReadHook2([publicDir]);
49167
49275
  try {
49168
49276
  ensurePackagesBuilt();
@@ -49175,7 +49283,7 @@ async function startDevServer(port2, projectDir2, config, host2) {
49175
49283
  process.exit(1);
49176
49284
  }
49177
49285
  const runtimeDir = runtimeDirUnchecked;
49178
- const veskStateDir = join20(projectDir2, ".vesk");
49286
+ const veskStateDir = join21(projectDir2, ".vesk");
49179
49287
  const configPluginsRaw = config.plugins || [];
49180
49288
  const configPluginNames = configPluginsRaw.map((p) => typeof p === "string" ? p : p?.name).filter((n) => !!n);
49181
49289
  const rawDevPlugins = config.plugins || [];
@@ -49274,9 +49382,9 @@ async function startDevServer(port2, projectDir2, config, host2) {
49274
49382
  }
49275
49383
  let devGlobalCssContent = "";
49276
49384
  let lastServedCssGlobal = "";
49277
- const srcDir = join20(projectDir2, "src");
49278
- const cssPath = join20(srcDir, "global.css");
49279
- const altCssPath = join20(srcDir, "app.css");
49385
+ const srcDir = join21(projectDir2, "src");
49386
+ const cssPath = join21(srcDir, "global.css");
49387
+ const altCssPath = join21(srcDir, "app.css");
49280
49388
  let rawCss = "";
49281
49389
  if (existsSync37(cssPath)) {
49282
49390
  rawCss = readFileSync33(cssPath, "utf-8");
@@ -49525,7 +49633,7 @@ async function startDevServer(port2, projectDir2, config, host2) {
49525
49633
  const isApiRoute = filename.endsWith(".ts") || filename.endsWith(".js") || filename.endsWith(".tsx");
49526
49634
  const isEvents = filename === "_events.ts" || filename === "_events.js";
49527
49635
  if (!isVsk && !isCss && !isApiRoute && !isEvents) return;
49528
- const fullPath = filename.startsWith("/") ? filename : join20(watchDir, filename);
49636
+ const fullPath = filename.startsWith("/") ? filename : join21(watchDir, filename);
49529
49637
  const fileExists = existsSync37(fullPath);
49530
49638
  if (isEvents) {
49531
49639
  if (debounceTimer) clearTimeout(debounceTimer);
@@ -49706,8 +49814,8 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
49706
49814
  ".json": "application/json",
49707
49815
  ".webmanifest": "application/manifest+json"
49708
49816
  };
49709
- const hmrJsPath = join20(runtimeDir, "hmr-client.js");
49710
- const hmrTsPath = join20(runtimeDir, "hmr-client.ts");
49817
+ const hmrJsPath = join21(runtimeDir, "hmr-client.js");
49818
+ const hmrTsPath = join21(runtimeDir, "hmr-client.ts");
49711
49819
  const hmrClientPath = existsSync37(hmrJsPath) ? hmrJsPath : existsSync37(hmrTsPath) ? hmrTsPath : null;
49712
49820
  function extractCompName2(src2) {
49713
49821
  return resolveComponentName(src2);
@@ -49867,7 +49975,7 @@ Object.defineProperty(__components, ${JSON.stringify(cname)}, { get: () => __com
49867
49975
  return;
49868
49976
  }
49869
49977
  const mwChain = collectMiddlewareChain(routeTree, url.pathname, appDirPath);
49870
- const apiDirPath = join20(appDirPath, "api");
49978
+ const apiDirPath = join21(appDirPath, "api");
49871
49979
  if (url.pathname.startsWith("/api") && existsSync37(apiDirPath)) {
49872
49980
  const apiRoutes = await scanApiRoutes(apiDirPath);
49873
49981
  const apiMatch = matchApiUrl(apiRoutes, req.url || url.pathname);
@@ -50278,7 +50386,7 @@ ${err.stack}</pre></body></html>`);
50278
50386
  LOG.ok(`dev server at http://localhost:${port2} (listening on ${bindHost})`);
50279
50387
  const routes = collectRoutePaths(routeTree);
50280
50388
  const pageCount = countPages(routeTree);
50281
- const apiCount = countFilesNamed(join20(appDirPath, "api"), "route.ts");
50389
+ const apiCount = countFilesNamed(join21(appDirPath, "api"), "route.ts");
50282
50390
  LOG.info(`${projectDir2}`);
50283
50391
  LOG.info(`${pageCount} page${pageCount === 1 ? "" : "s"}: ${routes.join(", ") || "(none)"}`);
50284
50392
  if (apiCount > 0) LOG.info(`${apiCount} api route${apiCount === 1 ? "" : "s"} (app/api)`);
@@ -50577,8 +50685,8 @@ if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
50577
50685
  }
50578
50686
  function loadEnvFiles(projectDir2) {
50579
50687
  const files = [
50580
- join22(projectDir2, ".env"),
50581
- join22(projectDir2, ".env.local")
50688
+ join23(projectDir2, ".env"),
50689
+ join23(projectDir2, ".env.local")
50582
50690
  ];
50583
50691
  for (const filePath of files) {
50584
50692
  if (!existsSync38(filePath)) continue;
@@ -50601,8 +50709,8 @@ function loadEnvFiles(projectDir2) {
50601
50709
  }
50602
50710
  async function loadConfig(projectDir2) {
50603
50711
  loadEnvFiles(projectDir2);
50604
- const jsPath = join22(projectDir2, "vesk.config.js");
50605
- const tsPath = join22(projectDir2, "vesk.config.ts");
50712
+ const jsPath = join23(projectDir2, "vesk.config.js");
50713
+ const tsPath = join23(projectDir2, "vesk.config.ts");
50606
50714
  let configPath3 = null;
50607
50715
  if (existsSync38(jsPath)) configPath3 = jsPath;
50608
50716
  else if (existsSync38(tsPath)) configPath3 = tsPath;
@@ -50615,7 +50723,7 @@ async function loadConfig(projectDir2) {
50615
50723
  js = js.replace(/import\s+\{[^}]*\}\s*from\s+['"]@vesk\/compiler['"]\s*;?\s*/g, "");
50616
50724
  js = `const { defineConfig, definePlugin, preset } = globalThis.__vesk_inject;
50617
50725
  ` + js;
50618
- const tmpFile = join22(projectDir2, ".vesk", "config.tmp.js");
50726
+ const tmpFile = join23(projectDir2, ".vesk", "config.tmp.js");
50619
50727
  mkdirSync16(dirname23(tmpFile), { recursive: true });
50620
50728
  writeFileSync19(tmpFile, js, "utf-8");
50621
50729
  globalThis.__vesk_inject = { defineConfig, definePlugin, preset };
@@ -50637,8 +50745,8 @@ async function loadConfig(projectDir2) {
50637
50745
  }
50638
50746
  if (cmd === "build") {
50639
50747
  const projectDir2 = process.cwd();
50640
- const appDirPath = join22(projectDir2, "app");
50641
- const publicDir = join22(projectDir2, "public");
50748
+ const appDirPath = join23(projectDir2, "app");
50749
+ const publicDir = join23(projectDir2, "public");
50642
50750
  if (!existsSync38(appDirPath)) {
50643
50751
  console.error(`vesk build: no app/ directory found in ${projectDir2}`);
50644
50752
  process.exit(1);
@@ -50709,7 +50817,7 @@ ${code}`;
50709
50817
  }
50710
50818
  if (cmd === "seo") {
50711
50819
  const projectDir2 = process.cwd();
50712
- const appDirPath = join22(projectDir2, "app");
50820
+ const appDirPath = join23(projectDir2, "app");
50713
50821
  if (!existsSync38(appDirPath)) {
50714
50822
  console.error(`vesk seo: no app/ directory found in ${projectDir2}`);
50715
50823
  process.exit(1);
@@ -50724,7 +50832,7 @@ if (cmd === "seo") {
50724
50832
  }
50725
50833
  if (cmd === "typecheck") {
50726
50834
  const projectDir2 = process.cwd();
50727
- const appDirPath = join22(projectDir2, "app");
50835
+ const appDirPath = join23(projectDir2, "app");
50728
50836
  if (!existsSync38(appDirPath)) {
50729
50837
  console.error(`vesk typecheck: no app/ directory found in ${projectDir2}`);
50730
50838
  process.exit(1);
@@ -50749,7 +50857,7 @@ if (cmd === "typecheck") {
50749
50857
  }
50750
50858
  if (cmd === "start") {
50751
50859
  const projectDir2 = process.cwd();
50752
- const outDir2 = join22(projectDir2, ".vesk");
50860
+ const outDir2 = join23(projectDir2, ".vesk");
50753
50861
  const port2 = parsePortArg(args);
50754
50862
  const host2 = parseHostArg(args);
50755
50863
  startProdServer(outDir2, { port: port2, host: host2 });
@@ -50758,8 +50866,8 @@ if (cmd === "start") {
50758
50866
  }
50759
50867
  if (cmd === "init") {
50760
50868
  const projectDir2 = process.cwd();
50761
- const srcDir = join22(projectDir2, "src");
50762
- const target = join22(srcDir, "global.css");
50869
+ const srcDir = join23(projectDir2, "src");
50870
+ const target = join23(srcDir, "global.css");
50763
50871
  if (existsSync38(target)) {
50764
50872
  console.error(`vesk init: ${target} already exists \u2014 skipping`);
50765
50873
  process.exit(0);
@@ -50778,7 +50886,7 @@ if (cmd === "init") {
50778
50886
  }
50779
50887
  if (cmd === "dev") {
50780
50888
  const projectDir2 = process.cwd();
50781
- const appDirPath = join22(projectDir2, "app");
50889
+ const appDirPath = join23(projectDir2, "app");
50782
50890
  const port2 = parsePortArg(args);
50783
50891
  const host2 = parseHostArg(args);
50784
50892
  if (!existsSync38(appDirPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vesk/vesk-cli",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
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.18",
12
- "@vesk/compiler": "^0.2.18",
13
- "@vesk/plugin-tailwind": "^0.2.18",
14
- "@vesk/runtime": "^0.2.18",
11
+ "@vesk/adapter": "^0.2.20",
12
+ "@vesk/compiler": "^0.2.20",
13
+ "@vesk/plugin-tailwind": "^0.2.20",
14
+ "@vesk/runtime": "^0.2.20",
15
15
  "esrap": "^2.3.0",
16
16
  "typescript": "^5.8.0",
17
17
  "ws": "^8.18.0",