@voltx/cli 0.3.4 → 0.3.6

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 (50) hide show
  1. package/README.md +54 -22
  2. package/dist/build.d.mts +4 -3
  3. package/dist/build.d.ts +4 -3
  4. package/dist/build.js +56 -27
  5. package/dist/build.mjs +1 -2
  6. package/dist/chunk-2LHDOMF2.mjs +680 -0
  7. package/dist/chunk-5DVBIJXU.mjs +84 -0
  8. package/dist/chunk-65PVXS4D.mjs +894 -0
  9. package/dist/chunk-7JVIEGSA.mjs +141 -0
  10. package/dist/chunk-A4NA4AJN.mjs +786 -0
  11. package/dist/chunk-AAAHANST.mjs +839 -0
  12. package/dist/chunk-AD3WMFZF.mjs +205 -0
  13. package/dist/chunk-CSSHLVYS.mjs +83 -0
  14. package/dist/chunk-CWOSNV5O.mjs +150 -0
  15. package/dist/chunk-EI6XBYKB.mjs +84 -0
  16. package/dist/chunk-FI2W4L4S.mjs +205 -0
  17. package/dist/chunk-G2INQCCJ.mjs +907 -0
  18. package/dist/chunk-H2DTIOEO.mjs +150 -0
  19. package/dist/chunk-IS2WTE3C.mjs +138 -0
  20. package/dist/chunk-JECCDBYI.mjs +730 -0
  21. package/dist/chunk-KX2MRJUO.mjs +795 -0
  22. package/dist/chunk-LTGMHAZS.mjs +147 -0
  23. package/dist/chunk-OPO6RUFP.mjs +698 -0
  24. package/dist/chunk-PWQSKYAM.mjs +682 -0
  25. package/dist/chunk-Q5XCFN7L.mjs +1026 -0
  26. package/dist/chunk-QSU6FZC7.mjs +497 -0
  27. package/dist/chunk-RYWRFHEC.mjs +83 -0
  28. package/dist/chunk-SU4Q3PTH.mjs +201 -0
  29. package/dist/chunk-TFVNHM7S.mjs +1028 -0
  30. package/dist/chunk-UXI3QSDN.mjs +121 -0
  31. package/dist/chunk-VD3CNPNP.mjs +123 -0
  32. package/dist/chunk-X6VOAPRJ.mjs +756 -0
  33. package/dist/cli.js +935 -308
  34. package/dist/cli.mjs +7 -6
  35. package/dist/create.d.mts +1 -0
  36. package/dist/create.d.ts +1 -0
  37. package/dist/create.js +726 -192
  38. package/dist/create.mjs +1 -2
  39. package/dist/dev.d.mts +6 -4
  40. package/dist/dev.d.ts +6 -4
  41. package/dist/dev.js +119 -46
  42. package/dist/dev.mjs +1 -2
  43. package/dist/generate.js +13 -13
  44. package/dist/generate.mjs +1 -2
  45. package/dist/index.js +922 -296
  46. package/dist/index.mjs +5 -6
  47. package/dist/start.js +7 -17
  48. package/dist/start.mjs +1 -2
  49. package/dist/welcome.mjs +0 -1
  50. package/package.json +11 -3
package/dist/index.mjs CHANGED
@@ -1,20 +1,19 @@
1
1
  import {
2
2
  runBuild
3
- } from "./chunk-ZB2F3WTS.mjs";
3
+ } from "./chunk-H2DTIOEO.mjs";
4
4
  import {
5
5
  createProject
6
- } from "./chunk-P5FSO2UH.mjs";
6
+ } from "./chunk-TFVNHM7S.mjs";
7
7
  import {
8
8
  runDev
9
- } from "./chunk-QND74HUW.mjs";
9
+ } from "./chunk-AD3WMFZF.mjs";
10
10
  import {
11
11
  runGenerate
12
- } from "./chunk-HAFJKS2O.mjs";
12
+ } from "./chunk-7JVIEGSA.mjs";
13
13
  import {
14
14
  runStart
15
- } from "./chunk-BXHQORLN.mjs";
15
+ } from "./chunk-EI6XBYKB.mjs";
16
16
  import "./chunk-IV352HZA.mjs";
17
- import "./chunk-Y6FXYEAI.mjs";
18
17
 
19
18
  // src/index.ts
20
19
  var CLI_VERSION = "0.3.5";
package/dist/start.js CHANGED
@@ -26,6 +26,7 @@ module.exports = __toCommonJS(start_exports);
26
26
  var import_node_child_process = require("child_process");
27
27
  var import_node_path = require("path");
28
28
  var import_node_fs = require("fs");
29
+ var import_core = require("@voltx/core");
29
30
  async function runStart(options = {}) {
30
31
  const cwd = process.cwd();
31
32
  const { port, outDir = "dist" } = options;
@@ -46,26 +47,15 @@ async function runStart(options = {}) {
46
47
  console.error(`[voltx] Entry file not found: ${outDir}/${entry}`);
47
48
  process.exit(1);
48
49
  }
50
+ (0, import_core.loadEnv)("production", cwd);
49
51
  const env = {
50
52
  ...process.env,
51
53
  NODE_ENV: "production"
52
54
  };
53
- const envFile = (0, import_node_path.resolve)(cwd, ".env");
54
- if ((0, import_node_fs.existsSync)(envFile)) {
55
- const envContent = (0, import_node_fs.readFileSync)(envFile, "utf-8");
56
- for (const line of envContent.split("\n")) {
57
- const trimmed = line.trim();
58
- if (!trimmed || trimmed.startsWith("#")) continue;
59
- const eqIdx = trimmed.indexOf("=");
60
- if (eqIdx === -1) continue;
61
- const key = trimmed.slice(0, eqIdx).trim();
62
- const value = trimmed.slice(eqIdx + 1).trim();
63
- env[key] = value;
64
- }
65
- }
66
55
  if (port) {
67
56
  env.PORT = String(port);
68
57
  }
58
+ const hasClientBuild = (0, import_node_fs.existsSync)((0, import_node_path.resolve)(distDir, "client"));
69
59
  console.log("");
70
60
  console.log(" \u26A1 VoltX Production Server");
71
61
  console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
@@ -73,7 +63,7 @@ async function runStart(options = {}) {
73
63
  if (port) {
74
64
  console.log(` Port: ${port}`);
75
65
  }
76
- console.log(` Mode: production`);
66
+ console.log(` Mode: ${hasClientBuild ? "full-stack" : "API-only"}`);
77
67
  console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
78
68
  console.log("");
79
69
  const child = (0, import_node_child_process.spawn)("node", [entryPath], {
@@ -97,13 +87,13 @@ async function runStart(options = {}) {
97
87
  }
98
88
  function findDistEntry(distDir) {
99
89
  const candidates = [
90
+ "server.mjs",
91
+ "server.js",
100
92
  "index.mjs",
101
93
  "index.js",
102
94
  "index.cjs",
103
95
  "main.mjs",
104
- "main.js",
105
- "src/index.mjs",
106
- "src/index.js"
96
+ "main.js"
107
97
  ];
108
98
  for (const candidate of candidates) {
109
99
  if ((0, import_node_fs.existsSync)((0, import_node_path.join)(distDir, candidate))) {
package/dist/start.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  runStart
3
- } from "./chunk-BXHQORLN.mjs";
4
- import "./chunk-Y6FXYEAI.mjs";
3
+ } from "./chunk-EI6XBYKB.mjs";
5
4
  export {
6
5
  runStart
7
6
  };
package/dist/welcome.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  printWelcomeBanner
3
3
  } from "./chunk-IV352HZA.mjs";
4
- import "./chunk-Y6FXYEAI.mjs";
5
4
  export {
6
5
  printWelcomeBanner
7
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltx/cli",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "VoltX CLI — dev server, build, start, generate, and scaffolding",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -21,11 +21,13 @@
21
21
  "clean": "rm -rf dist"
22
22
  },
23
23
  "dependencies": {
24
- "@voltx/core": "^0.3.0"
24
+ "@voltx/core": "^0.3.1"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "tsx": ">=4.0.0",
28
- "tsup": ">=8.0.0"
28
+ "tsup": ">=8.0.0",
29
+ "vite": ">=5.0.0",
30
+ "@hono/vite-dev-server": ">=0.7.0"
29
31
  },
30
32
  "peerDependenciesMeta": {
31
33
  "tsx": {
@@ -33,6 +35,12 @@
33
35
  },
34
36
  "tsup": {
35
37
  "optional": true
38
+ },
39
+ "vite": {
40
+ "optional": true
41
+ },
42
+ "@hono/vite-dev-server": {
43
+ "optional": true
36
44
  }
37
45
  },
38
46
  "devDependencies": {