@vercube/cli 0.0.34 → 0.0.35

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 (3) hide show
  1. package/README.md +25 -24
  2. package/dist/index.mjs +14 -11
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -1,34 +1,35 @@
1
1
  <div align="center">
2
- <a href="https://vercube.dev/"><img src="https://github.com/OskarLebuda/vue-lazy-hydration/raw/main/.github/assets/logo.png?raw=true" alt="Vite logo" width="200"></a>
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
- # Vercube
7
-
8
- Next generation HTTP framework
9
-
10
- <a href="https://www.npmjs.com/package/@vercube/cli">
11
- <img src="https://img.shields.io/npm/v/%40vercube%2Fcli?style=for-the-badge&logo=npm&color=%23767eff" alt="npm"/>
12
- </a>
13
- <a href="https://www.npmjs.com/package/@vercube/cli">
14
- <img src="https://img.shields.io/npm/dm/%40vercube%2Fcli?style=for-the-badge&logo=npm&color=%23767eff" alt="npm"/>
15
- </a>
16
- <a href="https://github.com/vercube/vercube/blob/main/LICENSE" target="_blank">
17
- <img src="https://img.shields.io/npm/l/%40vercube%2Fcli?style=for-the-badge&color=%23767eff" alt="License"/>
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>
22
- <br/>
23
- <br/>
6
+ # @vercube/cli
7
+
8
+ ### Command-line tools for Vercube
9
+
10
+ [![Ask DeepWiki](<https://img.shields.io/badge/ask-deepwiki-%20blue?style=for-the-badge&logo=bookstack&logoColor=rgba(255%2C%20255%2C%20255%2C%200.6)&labelColor=%23000&color=%232f2f2f>)](https://deepwiki.com/vercube/vercube)
11
+ ![NPM Version](<https://img.shields.io/npm/v/%40vercube%2Fcli?style=for-the-badge&logo=npm&logoColor=rgba(255%2C%20255%2C%20255%2C%200.6)&labelColor=%23000&color=%232e2e2e&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40vercube%2Fcli>)
12
+ ![GitHub License](<https://img.shields.io/github/license/vercube/vercube?style=for-the-badge&logo=gitbook&logoColor=rgba(255%2C%20255%2C%20255%2C%200.6)&labelColor=%23000&color=%232f2f2f>)
13
+ ![Codecov](<https://img.shields.io/codecov/c/github/vercube/vercube?style=for-the-badge&logo=vitest&logoColor=rgba(255%2C%20255%2C%20255%2C%200.6)&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
- 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.
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
- ## <a name="module">Command Line Interface</a>
27
+ ## 📦 Installation
29
28
 
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.
29
+ ```bash
30
+ pnpm add @vercube/cli
31
+ ```
31
32
 
32
- ## <a name="documentation">📖 Documentation</a>
33
+ ## 📜 License
33
34
 
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.
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.33";
14
+ var version = "0.0.34";
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$1, endColor$1, factor) {
69
- return `\u001B[38;2;${Math.round(startColor$1.r + factor * (endColor$1.r - startColor$1.r))};${Math.round(startColor$1.g + factor * (endColor$1.g - startColor$1.g))};${Math.round(startColor$1.b + factor * (endColor$1.b - startColor$1.b))}m`;
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$1, startColor$1, endColor$1) {
72
- const totalLines = icon$1.length;
73
- return icon$1.map((line, index) => {
74
- return interpolateColor(startColor$1, endColor$1, index / (totalLines - 1)) + line;
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
- if (ctx.args.dir === "") ctx.args.dir = await logger.prompt("Where would you like to create your project?", {
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, ctx.args.dir);
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
- if (ctx.args.gitInit === void 0) ctx.args.gitInit = await logger.prompt("Initialize git repository?", {
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.34",
3
+ "version": "0.0.35",
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.1.6",
28
+ "citty": "0.2.0",
29
29
  "consola": "3.4.2",
30
- "giget": "2.0.0",
31
- "nypm": "0.6.2",
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.34"
35
+ "@vercube/devkit": "0.0.35"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"