@vercube/cli 0.0.23 → 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/dist/index.d.mts CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ export { };
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.22";
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.args.entry } });
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
- const color = interpolateColor(startColor$1, endColor$1, factor);
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 pms = {
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
- const shouldVerify = !shouldForce && existsSync(templateDownloadPath);
145
- if (shouldVerify) {
146
- const selectedAction = await logger.prompt(`The directory ${colors.cyan(templateDownloadPath)} already exists. What would you like to do?`, {
147
- type: "select",
148
- options: [
149
- "Override its contents",
150
- "Select different directory",
151
- "Abort"
152
- ]
153
- });
154
- switch (selectedAction) {
155
- case "Override its contents":
156
- shouldForce = true;
157
- break;
158
- case "Select different directory":
159
- templateDownloadPath = resolve(cwd, await logger.prompt("Please specify a different directory:", {
160
- type: "text",
161
- cancel: "reject"
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.23",
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.1",
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.23"
35
+ "@vercube/devkit": "0.0.24"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"