@voltx/cli 0.2.0 → 0.3.1

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 (45) hide show
  1. package/README.md +65 -0
  2. package/dist/build.d.mts +19 -0
  3. package/dist/build.d.ts +19 -0
  4. package/dist/build.js +145 -0
  5. package/dist/build.mjs +7 -0
  6. package/dist/chunk-AONHLE42.mjs +141 -0
  7. package/dist/chunk-BIE3F5AW.mjs +261 -0
  8. package/dist/chunk-BLBAHJXR.mjs +239 -0
  9. package/dist/chunk-IGBR4TFT.mjs +351 -0
  10. package/dist/chunk-IV352HZA.mjs +107 -0
  11. package/dist/chunk-KFHPTRKZ.mjs +405 -0
  12. package/dist/chunk-L3247M3A.mjs +81 -0
  13. package/dist/chunk-RN7BUALR.mjs +120 -0
  14. package/dist/chunk-SGL7RBD5.mjs +355 -0
  15. package/dist/chunk-TUZ3MHD4.mjs +355 -0
  16. package/dist/chunk-Y6FXYEAI.mjs +10 -0
  17. package/dist/chunk-ZA7EJWJI.mjs +221 -0
  18. package/dist/chunk-ZB2F3WTS.mjs +121 -0
  19. package/dist/chunk-ZLIPYI22.mjs +350 -0
  20. package/dist/cli.js +945 -59
  21. package/dist/cli.mjs +123 -23
  22. package/dist/create.d.mts +1 -0
  23. package/dist/create.d.ts +1 -0
  24. package/dist/create.js +308 -36
  25. package/dist/create.mjs +3 -2
  26. package/dist/dev.d.mts +19 -0
  27. package/dist/dev.d.ts +19 -0
  28. package/dist/dev.js +144 -0
  29. package/dist/dev.mjs +7 -0
  30. package/dist/generate.d.mts +13 -0
  31. package/dist/generate.d.ts +13 -0
  32. package/dist/generate.js +165 -0
  33. package/dist/generate.mjs +7 -0
  34. package/dist/index.d.mts +5 -1
  35. package/dist/index.d.ts +5 -1
  36. package/dist/index.js +770 -39
  37. package/dist/index.mjs +21 -4
  38. package/dist/start.d.mts +16 -0
  39. package/dist/start.d.ts +16 -0
  40. package/dist/start.js +105 -0
  41. package/dist/start.mjs +7 -0
  42. package/dist/welcome.js +1 -1
  43. package/dist/welcome.mjs +2 -1
  44. package/package.json +24 -22
  45. package/LICENSE +0 -21
package/dist/index.mjs CHANGED
@@ -1,11 +1,28 @@
1
+ import {
2
+ runBuild
3
+ } from "./chunk-ZB2F3WTS.mjs";
1
4
  import {
2
5
  createProject
3
- } from "./chunk-YID3JCVU.mjs";
4
- import "./chunk-RH5Q7I3S.mjs";
6
+ } from "./chunk-KFHPTRKZ.mjs";
7
+ import {
8
+ runDev
9
+ } from "./chunk-RN7BUALR.mjs";
10
+ import {
11
+ runGenerate
12
+ } from "./chunk-AONHLE42.mjs";
13
+ import {
14
+ runStart
15
+ } from "./chunk-L3247M3A.mjs";
16
+ import "./chunk-IV352HZA.mjs";
17
+ import "./chunk-Y6FXYEAI.mjs";
5
18
 
6
19
  // src/index.ts
7
- var CLI_VERSION = "0.1.0";
20
+ var CLI_VERSION = "0.2.0";
8
21
  export {
9
22
  CLI_VERSION,
10
- createProject
23
+ createProject,
24
+ runBuild,
25
+ runDev,
26
+ runGenerate,
27
+ runStart
11
28
  };
@@ -0,0 +1,16 @@
1
+ interface StartOptions {
2
+ /** Port override */
3
+ port?: number;
4
+ /** Output directory where build artifacts live (default: dist) */
5
+ outDir?: string;
6
+ /** Entry file within outDir (default: auto-detect index.js or index.mjs) */
7
+ entry?: string;
8
+ }
9
+ /**
10
+ * Start the VoltX production server.
11
+ *
12
+ * Runs the built JS bundle from the dist/ directory using Node.js.
13
+ */
14
+ declare function runStart(options?: StartOptions): Promise<void>;
15
+
16
+ export { type StartOptions, runStart };
@@ -0,0 +1,16 @@
1
+ interface StartOptions {
2
+ /** Port override */
3
+ port?: number;
4
+ /** Output directory where build artifacts live (default: dist) */
5
+ outDir?: string;
6
+ /** Entry file within outDir (default: auto-detect index.js or index.mjs) */
7
+ entry?: string;
8
+ }
9
+ /**
10
+ * Start the VoltX production server.
11
+ *
12
+ * Runs the built JS bundle from the dist/ directory using Node.js.
13
+ */
14
+ declare function runStart(options?: StartOptions): Promise<void>;
15
+
16
+ export { type StartOptions, runStart };
package/dist/start.js ADDED
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/start.ts
21
+ var start_exports = {};
22
+ __export(start_exports, {
23
+ runStart: () => runStart
24
+ });
25
+ module.exports = __toCommonJS(start_exports);
26
+ var import_node_child_process = require("child_process");
27
+ var import_node_path = require("path");
28
+ var import_node_fs = require("fs");
29
+ async function runStart(options = {}) {
30
+ const cwd = process.cwd();
31
+ const { port, outDir = "dist" } = options;
32
+ const distDir = (0, import_node_path.resolve)(cwd, outDir);
33
+ if (!(0, import_node_fs.existsSync)(distDir)) {
34
+ console.error(`[voltx] Build output not found at ${outDir}/`);
35
+ console.error("[voltx] Run `voltx build` first to create a production build.");
36
+ process.exit(1);
37
+ }
38
+ const entry = options.entry ?? findDistEntry(distDir);
39
+ if (!entry) {
40
+ console.error(`[voltx] No entry file found in ${outDir}/`);
41
+ console.error("[voltx] Expected index.js, index.mjs, or main.js");
42
+ process.exit(1);
43
+ }
44
+ const entryPath = (0, import_node_path.resolve)(distDir, entry);
45
+ if (!(0, import_node_fs.existsSync)(entryPath)) {
46
+ console.error(`[voltx] Entry file not found: ${outDir}/${entry}`);
47
+ process.exit(1);
48
+ }
49
+ const env = {
50
+ ...process.env,
51
+ NODE_ENV: "production"
52
+ };
53
+ if (port) {
54
+ env.PORT = String(port);
55
+ }
56
+ console.log("");
57
+ console.log(" \u26A1 VoltX Production Server");
58
+ 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");
59
+ console.log(` Entry: ${outDir}/${entry}`);
60
+ if (port) {
61
+ console.log(` Port: ${port}`);
62
+ }
63
+ console.log(` Mode: production`);
64
+ 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");
65
+ console.log("");
66
+ const child = (0, import_node_child_process.spawn)("node", [entryPath], {
67
+ cwd,
68
+ env,
69
+ stdio: "inherit"
70
+ });
71
+ const signals = ["SIGINT", "SIGTERM"];
72
+ for (const signal of signals) {
73
+ process.on(signal, () => {
74
+ child.kill(signal);
75
+ });
76
+ }
77
+ child.on("error", (err) => {
78
+ console.error("[voltx] Failed to start production server:", err.message);
79
+ process.exit(1);
80
+ });
81
+ child.on("exit", (code) => {
82
+ process.exit(code ?? 0);
83
+ });
84
+ }
85
+ function findDistEntry(distDir) {
86
+ const candidates = [
87
+ "index.mjs",
88
+ "index.js",
89
+ "index.cjs",
90
+ "main.mjs",
91
+ "main.js",
92
+ "src/index.mjs",
93
+ "src/index.js"
94
+ ];
95
+ for (const candidate of candidates) {
96
+ if ((0, import_node_fs.existsSync)((0, import_node_path.join)(distDir, candidate))) {
97
+ return candidate;
98
+ }
99
+ }
100
+ return null;
101
+ }
102
+ // Annotate the CommonJS export names for ESM import in node:
103
+ 0 && (module.exports = {
104
+ runStart
105
+ });
package/dist/start.mjs ADDED
@@ -0,0 +1,7 @@
1
+ import {
2
+ runStart
3
+ } from "./chunk-L3247M3A.mjs";
4
+ import "./chunk-Y6FXYEAI.mjs";
5
+ export {
6
+ runStart
7
+ };
package/dist/welcome.js CHANGED
@@ -103,7 +103,7 @@ function printWelcomeBanner(projectName) {
103
103
  console.log(` ${rgb(100, 180, 255, "Next steps:")}`);
104
104
  console.log(` ${rgb(200, 200, 220, ` cd ${projectName}`)}`);
105
105
  console.log(` ${rgb(200, 200, 220, " pnpm install")}`);
106
- console.log(` ${rgb(200, 200, 220, " pnpm dev")}`);
106
+ console.log(` ${rgb(200, 200, 220, " pnpm dev # or: npx voltx dev")}`);
107
107
  console.log("");
108
108
  console.log(dimRule());
109
109
  console.log("");
package/dist/welcome.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  printWelcomeBanner
3
- } from "./chunk-RH5Q7I3S.mjs";
3
+ } from "./chunk-IV352HZA.mjs";
4
+ import "./chunk-Y6FXYEAI.mjs";
4
5
  export {
5
6
  printWelcomeBanner
6
7
  };
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@voltx/cli",
3
- "version": "0.2.0",
4
- "description": "VoltX CLI — create-voltx-app scaffolding and dev server",
3
+ "version": "0.3.1",
4
+ "description": "VoltX CLI — dev server, build, start, generate, and scaffolding",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "sideEffects": false,
8
8
  "bin": {
9
- "voltx": "./dist/cli.js",
10
- "create-voltx-app": "./dist/create.js"
9
+ "voltx": "./dist/cli.js"
11
10
  },
12
11
  "exports": {
13
12
  ".": {
@@ -16,16 +15,31 @@
16
15
  "require": "./dist/index.js"
17
16
  }
18
17
  },
18
+ "scripts": {
19
+ "build": "tsup src/index.ts src/cli.ts src/create.ts src/welcome.ts src/dev.ts src/build.ts src/start.ts src/generate.ts --format cjs,esm --dts",
20
+ "dev": "tsup src/index.ts src/cli.ts src/create.ts src/welcome.ts src/dev.ts src/build.ts src/start.ts src/generate.ts --format cjs,esm --dts --watch",
21
+ "clean": "rm -rf dist"
22
+ },
19
23
  "dependencies": {
20
- "@voltx/core": "0.2.0"
24
+ "@voltx/core": "^0.3.0"
25
+ },
26
+ "peerDependencies": {
27
+ "tsx": ">=4.0.0",
28
+ "tsup": ">=8.0.0"
29
+ },
30
+ "peerDependenciesMeta": {
31
+ "tsx": {
32
+ "optional": true
33
+ },
34
+ "tsup": {
35
+ "optional": true
36
+ }
21
37
  },
22
38
  "devDependencies": {
23
39
  "tsup": "^8.0.0",
24
40
  "typescript": "^5.7.0"
25
41
  },
26
- "files": [
27
- "dist"
28
- ],
42
+ "files": ["dist"],
29
43
  "license": "MIT",
30
44
  "repository": {
31
45
  "type": "git",
@@ -34,17 +48,5 @@
34
48
  },
35
49
  "homepage": "https://voltx.co.in",
36
50
  "bugs": "https://github.com/codewithshail/voltx/issues",
37
- "keywords": [
38
- "voltx",
39
- "cli",
40
- "create-voltx-app",
41
- "scaffolding",
42
- "ai",
43
- "framework"
44
- ],
45
- "scripts": {
46
- "build": "tsup src/index.ts src/cli.ts src/create.ts src/welcome.ts --format cjs,esm --dts",
47
- "dev": "tsup src/index.ts src/cli.ts src/create.ts src/welcome.ts --format cjs,esm --dts --watch",
48
- "clean": "rm -rf dist"
49
- }
50
- }
51
+ "keywords": ["voltx", "cli", "dev", "build", "start", "generate", "ai", "framework"]
52
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Promptly AI Team
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.