@vercube/cli 0.0.34 → 0.0.36
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 +25 -24
- package/dist/index.mjs +14 -11
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
2
|
+
<img src="https://raw.githubusercontent.com/vercube/vercube/refs/heads/main/.github/assets/cover.png" width="100%" alt="Vercube - Unleash your server development." />
|
|
3
3
|
<br>
|
|
4
4
|
<br>
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<a href="https://codecov.io/gh/vercube/vercube" target="_blank">
|
|
20
|
-
<img src="https://img.shields.io/codecov/c/github/vercube/vercube?style=for-the-badge&color=%23767eff" alt="Coverage"/>
|
|
21
|
-
</a>
|
|
22
|
-
<br/>
|
|
23
|
-
<br/>
|
|
6
|
+
# @vercube/cli
|
|
7
|
+
|
|
8
|
+
### Command-line tools for Vercube
|
|
9
|
+
|
|
10
|
+
[&labelColor=%23000&color=%232f2f2f>)](https://deepwiki.com/vercube/vercube)
|
|
11
|
+
&labelColor=%23000&color=%232e2e2e&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40vercube%2Fcli>)
|
|
12
|
+
&labelColor=%23000&color=%232f2f2f>)
|
|
13
|
+
&labelColor=%23000&color=%232f2f2f>)
|
|
14
|
+
|
|
15
|
+
**Dev server, production builds, all from the command line. `vercube dev` to start, `vercube build` when you're ready to ship.**
|
|
16
|
+
|
|
17
|
+
[Website](https://vercube.dev) • [Documentation](https://vercube.dev/docs/getting-started)
|
|
18
|
+
|
|
24
19
|
</div>
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
## ✨ Features
|
|
22
|
+
|
|
23
|
+
- **Dev server** - hot-reload out of the box
|
|
24
|
+
- **Production build** - optimized bundles ready for deployment
|
|
25
|
+
- **Config loading** - reads `vercube.config.ts` automatically
|
|
27
26
|
|
|
28
|
-
##
|
|
27
|
+
## 📦 Installation
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
```bash
|
|
30
|
+
pnpm add @vercube/cli
|
|
31
|
+
```
|
|
31
32
|
|
|
32
|
-
##
|
|
33
|
+
## 📜 License
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
[MIT](https://github.com/vercube/vercube/blob/main/LICENSE)
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { hasTTY } from "std-env";
|
|
|
11
11
|
import { x } from "tinyexec";
|
|
12
12
|
|
|
13
13
|
//#region package.json
|
|
14
|
-
var version = "0.0.
|
|
14
|
+
var version = "0.0.35";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/commands/build.ts
|
|
@@ -22,7 +22,8 @@ const buildCommand = defineCommand({
|
|
|
22
22
|
},
|
|
23
23
|
args: { entry: {
|
|
24
24
|
type: "string",
|
|
25
|
-
description: "Entry file"
|
|
25
|
+
description: "Entry file",
|
|
26
|
+
default: void 0
|
|
26
27
|
} },
|
|
27
28
|
run: async (ctx) => {
|
|
28
29
|
await build(await createVercube({ build: { entry: ctx?.args?.entry ?? void 0 } }));
|
|
@@ -65,13 +66,13 @@ const icon = [
|
|
|
65
66
|
" ",
|
|
66
67
|
" "
|
|
67
68
|
];
|
|
68
|
-
function interpolateColor(startColor
|
|
69
|
-
return `\u001B[38;2;${Math.round(startColor
|
|
69
|
+
function interpolateColor(startColor, endColor, factor) {
|
|
70
|
+
return `\u001B[38;2;${Math.round(startColor.r + factor * (endColor.r - startColor.r))};${Math.round(startColor.g + factor * (endColor.g - startColor.g))};${Math.round(startColor.b + factor * (endColor.b - startColor.b))}m`;
|
|
70
71
|
}
|
|
71
|
-
function applyGradient(icon
|
|
72
|
-
const totalLines = icon
|
|
73
|
-
return icon
|
|
74
|
-
return interpolateColor(startColor
|
|
72
|
+
function applyGradient(icon, startColor, endColor) {
|
|
73
|
+
const totalLines = icon.length;
|
|
74
|
+
return icon.map((line, index) => {
|
|
75
|
+
return interpolateColor(startColor, endColor, index / (totalLines - 1)) + line;
|
|
75
76
|
}).join("\n");
|
|
76
77
|
}
|
|
77
78
|
const vercubeIcon = applyGradient(icon, startColor, endColor);
|
|
@@ -123,14 +124,15 @@ const initCommand = defineCommand({
|
|
|
123
124
|
async run(ctx) {
|
|
124
125
|
if (hasTTY) process.stdout.write(`\n${vercubeIcon}\n\n`);
|
|
125
126
|
consola.info(`Welcome to ${colors.bold("Vercube")}!`);
|
|
126
|
-
|
|
127
|
+
let dir = ctx.args.dir;
|
|
128
|
+
if (ctx.args.dir === "") dir = await logger.prompt("Where would you like to create your project?", {
|
|
127
129
|
placeholder: "./vercube-app",
|
|
128
130
|
type: "text",
|
|
129
131
|
default: "vercube-app",
|
|
130
132
|
cancel: "reject"
|
|
131
133
|
}).catch(() => process.exit(1));
|
|
132
134
|
const cwd = resolve(process.cwd());
|
|
133
|
-
let templateDownloadPath = resolve(cwd,
|
|
135
|
+
let templateDownloadPath = resolve(cwd, dir);
|
|
134
136
|
logger.info(`Creating a new project in ${colors.cyan(relative(cwd, templateDownloadPath) || templateDownloadPath)}.`);
|
|
135
137
|
let shouldForce = Boolean(ctx.args.force);
|
|
136
138
|
if (!shouldForce && existsSync(templateDownloadPath)) switch (await logger.prompt(`The directory ${colors.cyan(templateDownloadPath)} already exists. What would you like to do?`, {
|
|
@@ -190,7 +192,8 @@ const initCommand = defineCommand({
|
|
|
190
192
|
}
|
|
191
193
|
logger.success("Installation completed.");
|
|
192
194
|
}
|
|
193
|
-
|
|
195
|
+
let gitInit = ctx.args.gitInit;
|
|
196
|
+
if (gitInit === void 0) gitInit = await logger.prompt("Initialize git repository?", {
|
|
194
197
|
type: "confirm",
|
|
195
198
|
cancel: "reject"
|
|
196
199
|
}).catch(() => process.exit(1));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"description": "CLI module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"vercube": "./dist/index.mjs"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"citty": "0.
|
|
28
|
+
"citty": "0.2.0",
|
|
29
29
|
"consola": "3.4.2",
|
|
30
|
-
"giget": "
|
|
31
|
-
"nypm": "0.6.
|
|
30
|
+
"giget": "3.1.1",
|
|
31
|
+
"nypm": "0.6.4",
|
|
32
32
|
"pathe": "2.0.3",
|
|
33
33
|
"std-env": "3.10.0",
|
|
34
34
|
"tinyexec": "1.0.2",
|
|
35
|
-
"@vercube/devkit": "0.0.
|
|
35
|
+
"@vercube/devkit": "0.0.36"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|