@voltx/cli 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -22
- package/dist/build.d.mts +4 -3
- package/dist/build.d.ts +4 -3
- package/dist/build.js +56 -27
- package/dist/build.mjs +1 -2
- package/dist/chunk-2LHDOMF2.mjs +680 -0
- package/dist/chunk-5DVBIJXU.mjs +84 -0
- package/dist/chunk-65PVXS4D.mjs +894 -0
- package/dist/chunk-7JVIEGSA.mjs +141 -0
- package/dist/chunk-A4NA4AJN.mjs +786 -0
- package/dist/chunk-AAAHANST.mjs +839 -0
- package/dist/chunk-AD3WMFZF.mjs +205 -0
- package/dist/chunk-CSSHLVYS.mjs +83 -0
- package/dist/chunk-CWOSNV5O.mjs +150 -0
- package/dist/chunk-EI6XBYKB.mjs +84 -0
- package/dist/chunk-FI2W4L4S.mjs +205 -0
- package/dist/chunk-G2INQCCJ.mjs +907 -0
- package/dist/chunk-H2DTIOEO.mjs +150 -0
- package/dist/chunk-IS2WTE3C.mjs +138 -0
- package/dist/chunk-JECCDBYI.mjs +730 -0
- package/dist/chunk-KX2MRJUO.mjs +795 -0
- package/dist/chunk-LTGMHAZS.mjs +147 -0
- package/dist/chunk-OPO6RUFP.mjs +698 -0
- package/dist/chunk-PWQSKYAM.mjs +682 -0
- package/dist/chunk-Q5XCFN7L.mjs +1026 -0
- package/dist/chunk-QSU6FZC7.mjs +497 -0
- package/dist/chunk-RYWRFHEC.mjs +83 -0
- package/dist/chunk-SU4Q3PTH.mjs +201 -0
- package/dist/chunk-UXI3QSDN.mjs +121 -0
- package/dist/chunk-VD3CNPNP.mjs +123 -0
- package/dist/chunk-X6VOAPRJ.mjs +756 -0
- package/dist/cli.js +932 -307
- package/dist/cli.mjs +7 -6
- package/dist/create.d.mts +1 -0
- package/dist/create.d.ts +1 -0
- package/dist/create.js +723 -191
- package/dist/create.mjs +1 -2
- package/dist/dev.d.mts +6 -4
- package/dist/dev.d.ts +6 -4
- package/dist/dev.js +119 -46
- package/dist/dev.mjs +1 -2
- package/dist/generate.js +13 -13
- package/dist/generate.mjs +1 -2
- package/dist/index.js +919 -295
- package/dist/index.mjs +5 -6
- package/dist/start.js +7 -17
- package/dist/start.mjs +1 -2
- package/dist/welcome.mjs +0 -1
- package/package.json +11 -3
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H2DTIOEO.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createProject
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q5XCFN7L.mjs";
|
|
7
7
|
import {
|
|
8
8
|
runDev
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AD3WMFZF.mjs";
|
|
10
10
|
import {
|
|
11
11
|
runGenerate
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7JVIEGSA.mjs";
|
|
13
13
|
import {
|
|
14
14
|
runStart
|
|
15
|
-
} from "./chunk-
|
|
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:
|
|
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
package/dist/welcome.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltx/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
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": "
|
|
24
|
+
"@voltx/core": "workspace:*"
|
|
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": {
|