@vercube/cli 0.0.22 → 0.0.24
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 +10 -6
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +27 -34
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
<br>
|
|
4
4
|
<br>
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
# Vercube
|
|
7
|
+
|
|
8
|
+
Next generation HTTP framework
|
|
9
|
+
|
|
10
10
|
<a href="https://www.npmjs.com/package/@vercube/cli">
|
|
11
11
|
<img src="https://img.shields.io/npm/v/%40vercube%2Fcli?style=for-the-badge&logo=npm&color=%23767eff" alt="npm"/>
|
|
12
12
|
</a>
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
<a href="https://github.com/vercube/vercube/blob/main/LICENSE" target="_blank">
|
|
17
17
|
<img src="https://img.shields.io/npm/l/%40vercube%2Fcli?style=for-the-badge&color=%23767eff" alt="License"/>
|
|
18
18
|
</a>
|
|
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>
|
|
19
22
|
<br/>
|
|
20
23
|
<br/>
|
|
21
24
|
</div>
|
|
@@ -23,8 +26,9 @@
|
|
|
23
26
|
An ultra-efficient JavaScript server framework that runs anywhere - Node.js, Bun, or Deno - with unmatched flexibility and complete configurability for developers who refuse to sacrifice speed or control.
|
|
24
27
|
|
|
25
28
|
## <a name="module">Command Line Interface</a>
|
|
26
|
-
The CLI module provides a powerful command-line interface for Vercube applications, making it easy to create, develop, and manage your projects. It offers intuitive commands for project scaffolding, development server management, and production builds.
|
|
27
29
|
|
|
30
|
+
The CLI module provides a powerful command-line interface for Vercube applications, making it easy to create, develop, and manage your projects. It offers intuitive commands for project scaffolding, development server management, and production builds.
|
|
28
31
|
|
|
29
32
|
## <a name="documentation">📖 Documentation</a>
|
|
30
|
-
|
|
33
|
+
|
|
34
|
+
Comprehensive documentation is available at [vercube.dev](https://vercube.dev). There you'll find detailed module descriptions, project information, guides, and everything else you need to know about Vercube.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {};
|
|
1
|
+
export { };
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { defineCommand, runMain } from "citty";
|
|
3
3
|
import { build, createDevServer, createVercube, watch } from "@vercube/devkit";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
4
5
|
import { consola } from "consola";
|
|
5
6
|
import { colors } from "consola/utils";
|
|
6
|
-
import { hasTTY } from "std-env";
|
|
7
|
-
import { relative, resolve } from "pathe";
|
|
8
|
-
import { existsSync } from "node:fs";
|
|
9
7
|
import { downloadTemplate, startShell } from "giget";
|
|
10
8
|
import { installDependencies } from "nypm";
|
|
9
|
+
import { relative, resolve } from "pathe";
|
|
10
|
+
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.23";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/commands/build.ts
|
|
@@ -22,11 +22,10 @@ const buildCommand = defineCommand({
|
|
|
22
22
|
},
|
|
23
23
|
args: { entry: {
|
|
24
24
|
type: "string",
|
|
25
|
-
description: "Entry file"
|
|
26
|
-
default: "./src/index.ts"
|
|
25
|
+
description: "Entry file"
|
|
27
26
|
} },
|
|
28
27
|
run: async (ctx) => {
|
|
29
|
-
const app = await createVercube({ build: { entry: ctx
|
|
28
|
+
const app = await createVercube({ build: { entry: ctx?.args?.entry ?? void 0 } });
|
|
30
29
|
await build(app);
|
|
31
30
|
}
|
|
32
31
|
});
|
|
@@ -77,8 +76,7 @@ function applyGradient(icon$1, startColor$1, endColor$1) {
|
|
|
77
76
|
const totalLines = icon$1.length;
|
|
78
77
|
return icon$1.map((line, index) => {
|
|
79
78
|
const factor = index / (totalLines - 1);
|
|
80
|
-
|
|
81
|
-
return color + line;
|
|
79
|
+
return interpolateColor(startColor$1, endColor$1, factor) + line;
|
|
82
80
|
}).join("\n");
|
|
83
81
|
}
|
|
84
82
|
const vercubeIcon = applyGradient(icon, startColor, endColor);
|
|
@@ -88,14 +86,13 @@ const vercubeIcon = applyGradient(icon, startColor, endColor);
|
|
|
88
86
|
const logger = consola.withTag(colors.whiteBright(colors.bold(colors.bgGreenBright(" vercube "))));
|
|
89
87
|
const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/vercube/starter/main/templates";
|
|
90
88
|
const DEFAULT_TEMPLATE_NAME = "vercube";
|
|
91
|
-
const
|
|
89
|
+
const packageManagerOptions = Object.keys({
|
|
92
90
|
npm: void 0,
|
|
93
91
|
pnpm: void 0,
|
|
94
92
|
yarn: void 0,
|
|
95
93
|
bun: void 0,
|
|
96
94
|
deno: void 0
|
|
97
|
-
};
|
|
98
|
-
const packageManagerOptions = Object.keys(pms);
|
|
95
|
+
});
|
|
99
96
|
const initCommand = defineCommand({
|
|
100
97
|
meta: {
|
|
101
98
|
name: "init",
|
|
@@ -141,28 +138,24 @@ const initCommand = defineCommand({
|
|
|
141
138
|
let templateDownloadPath = resolve(cwd, ctx.args.dir);
|
|
142
139
|
logger.info(`Creating a new project in ${colors.cyan(relative(cwd, templateDownloadPath) || templateDownloadPath)}.`);
|
|
143
140
|
let shouldForce = Boolean(ctx.args.force);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}).catch(() => process.exit(1)));
|
|
163
|
-
break;
|
|
164
|
-
default: process.exit(1);
|
|
165
|
-
}
|
|
141
|
+
if (!shouldForce && existsSync(templateDownloadPath)) switch (await logger.prompt(`The directory ${colors.cyan(templateDownloadPath)} already exists. What would you like to do?`, {
|
|
142
|
+
type: "select",
|
|
143
|
+
options: [
|
|
144
|
+
"Override its contents",
|
|
145
|
+
"Select different directory",
|
|
146
|
+
"Abort"
|
|
147
|
+
]
|
|
148
|
+
})) {
|
|
149
|
+
case "Override its contents":
|
|
150
|
+
shouldForce = true;
|
|
151
|
+
break;
|
|
152
|
+
case "Select different directory":
|
|
153
|
+
templateDownloadPath = resolve(cwd, await logger.prompt("Please specify a different directory:", {
|
|
154
|
+
type: "text",
|
|
155
|
+
cancel: "reject"
|
|
156
|
+
}).catch(() => process.exit(1)));
|
|
157
|
+
break;
|
|
158
|
+
default: process.exit(1);
|
|
166
159
|
}
|
|
167
160
|
let template;
|
|
168
161
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "CLI module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"citty": "0.1.6",
|
|
29
29
|
"consola": "3.4.2",
|
|
30
30
|
"giget": "2.0.0",
|
|
31
|
-
"nypm": "0.6.
|
|
31
|
+
"nypm": "0.6.2",
|
|
32
32
|
"pathe": "2.0.3",
|
|
33
33
|
"std-env": "3.9.0",
|
|
34
34
|
"tinyexec": "1.0.1",
|
|
35
|
-
"@vercube/devkit": "0.0.
|
|
35
|
+
"@vercube/devkit": "0.0.24"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|