@vobs/cli 1.2.1 → 1.2.2

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 (61) hide show
  1. package/dist/banner.cjs +31 -7
  2. package/dist/banner.cjs.map +1 -1
  3. package/dist/banner.js +5 -3
  4. package/dist/banner.js.map +1 -1
  5. package/dist/cli.cjs +130 -98
  6. package/dist/cli.cjs.map +1 -1
  7. package/dist/cli.js +65 -40
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/add.cjs +63 -49
  10. package/dist/commands/add.cjs.map +1 -1
  11. package/dist/commands/add.js +14 -9
  12. package/dist/commands/add.js.map +1 -1
  13. package/dist/commands/build.cjs +50 -19
  14. package/dist/commands/build.cjs.map +1 -1
  15. package/dist/commands/build.js +9 -6
  16. package/dist/commands/build.js.map +1 -1
  17. package/dist/commands/dev.cjs +50 -19
  18. package/dist/commands/dev.cjs.map +1 -1
  19. package/dist/commands/dev.js +9 -6
  20. package/dist/commands/dev.js.map +1 -1
  21. package/dist/commands/generate.cjs +76 -63
  22. package/dist/commands/generate.cjs.map +1 -1
  23. package/dist/commands/generate.js +24 -18
  24. package/dist/commands/generate.js.map +1 -1
  25. package/dist/commands/index.cjs +136 -100
  26. package/dist/commands/index.cjs.map +1 -1
  27. package/dist/commands/index.js +66 -39
  28. package/dist/commands/index.js.map +1 -1
  29. package/dist/commands/init.cjs +89 -71
  30. package/dist/commands/init.cjs.map +1 -1
  31. package/dist/commands/init.js +28 -17
  32. package/dist/commands/init.js.map +1 -1
  33. package/dist/index.cjs +187 -132
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.js +94 -48
  36. package/dist/index.js.map +1 -1
  37. package/dist/repl.cjs +139 -111
  38. package/dist/repl.cjs.map +1 -1
  39. package/dist/repl.js +67 -46
  40. package/dist/repl.js.map +1 -1
  41. package/dist/start.cjs +151 -114
  42. package/dist/start.cjs.map +1 -1
  43. package/dist/start.js +76 -48
  44. package/dist/start.js.map +1 -1
  45. package/dist/types.cjs +18 -2
  46. package/dist/types.cjs.map +1 -1
  47. package/dist/types.js +0 -2
  48. package/dist/types.js.map +1 -1
  49. package/dist/utils/file.cjs +67 -34
  50. package/dist/utils/file.cjs.map +1 -1
  51. package/dist/utils/file.js +18 -12
  52. package/dist/utils/file.js.map +1 -1
  53. package/dist/utils/logger.cjs +56 -22
  54. package/dist/utils/logger.cjs.map +1 -1
  55. package/dist/utils/logger.js +11 -5
  56. package/dist/utils/logger.js.map +1 -1
  57. package/dist/utils/pm.cjs +41 -16
  58. package/dist/utils/pm.cjs.map +1 -1
  59. package/dist/utils/pm.js +10 -7
  60. package/dist/utils/pm.js.map +1 -1
  61. package/package.json +1 -1
package/dist/start.cjs CHANGED
@@ -1,97 +1,110 @@
1
- 'use strict';
2
-
3
- var cac = require('cac');
4
- var path = require('path');
5
- var child_process = require('child_process');
6
- var p = require('@clack/prompts');
7
- var pc2 = require('picocolors');
8
- var fs = require('fs');
9
- var url = require('url');
10
- var Handlebars = require('handlebars');
11
- var vite = require('vite');
12
- var promises = require('readline/promises');
13
- var process$1 = require('process');
1
+ var __VOBS_CJS_FILE_URL = require("url").pathToFileURL(__filename).href;
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
31
 
15
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
16
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
32
+ // packages/cli/src/start.ts
33
+ var start_exports = {};
34
+ __export(start_exports, {
35
+ start: () => start
36
+ });
37
+ module.exports = __toCommonJS(start_exports);
17
38
 
18
- function _interopNamespace(e) {
19
- if (e && e.__esModule) return e;
20
- var n = Object.create(null);
21
- if (e) {
22
- Object.keys(e).forEach(function (k) {
23
- if (k !== 'default') {
24
- var d = Object.getOwnPropertyDescriptor(e, k);
25
- Object.defineProperty(n, k, d.get ? d : {
26
- enumerable: true,
27
- get: function () { return e[k]; }
28
- });
29
- }
30
- });
31
- }
32
- n.default = e;
33
- return Object.freeze(n);
34
- }
39
+ // packages/cli/src/cli.ts
40
+ var import_cac = require("cac");
35
41
 
36
- var p__namespace = /*#__PURE__*/_interopNamespace(p);
37
- var pc2__default = /*#__PURE__*/_interopDefault(pc2);
38
- var Handlebars__default = /*#__PURE__*/_interopDefault(Handlebars);
42
+ // packages/cli/src/commands/init.ts
43
+ var import_node_path3 = require("path");
44
+ var import_node_child_process2 = require("child_process");
45
+ var p = __toESM(require("@clack/prompts"), 1);
39
46
 
40
- var __defProp = Object.defineProperty;
41
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
47
+ // packages/cli/src/utils/logger.ts
48
+ var import_picocolors = __toESM(require("picocolors"), 1);
42
49
  function timestamp() {
43
- return pc2__default.default.dim(`[${(/* @__PURE__ */ new Date()).toLocaleTimeString()}]`);
50
+ return import_picocolors.default.dim(`[${(/* @__PURE__ */ new Date()).toLocaleTimeString()}]`);
44
51
  }
45
52
  __name(timestamp, "timestamp");
46
53
  function info(msg) {
47
- console.log(`${timestamp()} ${pc2__default.default.cyan("\u2139")} ${msg}`);
54
+ console.log(`${timestamp()} ${import_picocolors.default.cyan("\u2139")} ${msg}`);
48
55
  }
49
56
  __name(info, "info");
50
57
  function success(msg) {
51
- console.log(`${timestamp()} ${pc2__default.default.green("\u2714")} ${msg}`);
58
+ console.log(`${timestamp()} ${import_picocolors.default.green("\u2714")} ${msg}`);
52
59
  }
53
60
  __name(success, "success");
54
61
  function warn(msg) {
55
- console.log(`${timestamp()} ${pc2__default.default.yellow("\u26A0")} ${msg}`);
62
+ console.log(`${timestamp()} ${import_picocolors.default.yellow("\u26A0")} ${msg}`);
56
63
  }
57
64
  __name(warn, "warn");
58
65
  function error(msg) {
59
- console.error(`${timestamp()} ${pc2__default.default.red("\u2716")} ${msg}`);
66
+ console.error(`${timestamp()} ${import_picocolors.default.red("\u2716")} ${msg}`);
60
67
  }
61
68
  __name(error, "error");
62
69
  function step(msg) {
63
70
  console.log(`
64
- ${pc2__default.default.bold(pc2__default.default.cyan(msg))}`);
71
+ ${import_picocolors.default.bold(import_picocolors.default.cyan(msg))}`);
65
72
  }
66
73
  __name(step, "step");
67
74
  var logger = { info, success, warn, error, step };
68
- var __dirname$1 = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('start.cjs', document.baseURI).href))));
69
- var TEMPLATES_ROOT = path.resolve(__dirname$1, "..", "templates");
75
+
76
+ // packages/cli/src/utils/file.ts
77
+ var import_node_fs = require("fs");
78
+ var import_node_path = require("path");
79
+ var import_node_url = require("url");
80
+ var import_handlebars = __toESM(require("handlebars"), 1);
81
+ var __dirname = (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(__VOBS_CJS_FILE_URL));
82
+ var TEMPLATES_ROOT = (0, import_node_path.resolve)(__dirname, "..", "templates");
70
83
  function getTemplatesDir() {
71
84
  return TEMPLATES_ROOT;
72
85
  }
73
86
  __name(getTemplatesDir, "getTemplatesDir");
74
87
  function renderTemplate(templatePath, context) {
75
- const source = fs.readFileSync(templatePath, "utf-8");
76
- const template = Handlebars__default.default.compile(source);
88
+ const source = (0, import_node_fs.readFileSync)(templatePath, "utf-8");
89
+ const template = import_handlebars.default.compile(source);
77
90
  return template(context);
78
91
  }
79
92
  __name(renderTemplate, "renderTemplate");
80
93
  function writeFile(dir, filename, content) {
81
- const filePath = path.resolve(dir, filename);
82
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
83
- fs.writeFileSync(filePath, content, "utf-8");
94
+ const filePath = (0, import_node_path.resolve)(dir, filename);
95
+ (0, import_node_fs.mkdirSync)((0, import_node_path.dirname)(filePath), { recursive: true });
96
+ (0, import_node_fs.writeFileSync)(filePath, content, "utf-8");
84
97
  }
85
98
  __name(writeFile, "writeFile");
86
99
  function ensureDir(dir) {
87
- if (!fs.existsSync(dir)) {
88
- fs.mkdirSync(dir, { recursive: true });
100
+ if (!(0, import_node_fs.existsSync)(dir)) {
101
+ (0, import_node_fs.mkdirSync)(dir, { recursive: true });
89
102
  }
90
103
  }
91
104
  __name(ensureDir, "ensureDir");
92
105
  async function copyDirRecursive(srcDir, destDir, context) {
93
- const { readdirSync } = await import('fs');
94
- const { join } = await import('path');
106
+ const { readdirSync } = await import("fs");
107
+ const { join } = await import("path");
95
108
  const entries = readdirSync(srcDir, { withFileTypes: true });
96
109
  for (const entry of entries) {
97
110
  const srcPath = join(srcDir, entry.name);
@@ -105,23 +118,28 @@ async function copyDirRecursive(srcDir, destDir, context) {
105
118
  const content = renderTemplate(srcPath, context);
106
119
  writeFile(destDir, destName, content);
107
120
  } else {
108
- const content = fs.readFileSync(srcPath, "utf-8");
121
+ const content = (0, import_node_fs.readFileSync)(srcPath, "utf-8");
109
122
  writeFile(destDir, destName, content);
110
123
  }
111
124
  }
112
125
  }
113
126
  __name(copyDirRecursive, "copyDirRecursive");
114
127
  async function scaffoldProject(targetDir, context) {
115
- const templateDir = path.resolve(TEMPLATES_ROOT, "basic");
128
+ const templateDir = (0, import_node_path.resolve)(TEMPLATES_ROOT, "basic");
116
129
  ensureDir(targetDir);
117
130
  await copyDirRecursive(templateDir, targetDir, context);
118
131
  }
119
132
  __name(scaffoldProject, "scaffoldProject");
133
+
134
+ // packages/cli/src/utils/pm.ts
135
+ var import_node_fs2 = require("fs");
136
+ var import_node_path2 = require("path");
137
+ var import_node_child_process = require("child_process");
120
138
  function detectPackageManager(targetDir) {
121
139
  if (targetDir) {
122
- if (fs.existsSync(path.resolve(targetDir, "pnpm-lock.yaml"))) return "pnpm";
123
- if (fs.existsSync(path.resolve(targetDir, "yarn.lock"))) return "yarn";
124
- if (fs.existsSync(path.resolve(targetDir, "package-lock.json"))) return "npm";
140
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.resolve)(targetDir, "pnpm-lock.yaml"))) return "pnpm";
141
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.resolve)(targetDir, "yarn.lock"))) return "yarn";
142
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.resolve)(targetDir, "package-lock.json"))) return "npm";
125
143
  }
126
144
  const userAgent = process.env.npm_config_user_agent || "";
127
145
  if (userAgent.startsWith("pnpm")) return "pnpm";
@@ -132,29 +150,29 @@ function detectPackageManager(targetDir) {
132
150
  __name(detectPackageManager, "detectPackageManager");
133
151
  function installDependencies(targetDir, pm) {
134
152
  const cmd = pm === "yarn" ? "yarn" : `${pm} install`;
135
- child_process.execSync(cmd, { cwd: targetDir, stdio: "inherit" });
153
+ (0, import_node_child_process.execSync)(cmd, { cwd: targetDir, stdio: "inherit" });
136
154
  }
137
155
  __name(installDependencies, "installDependencies");
138
156
  function addPackage(targetDir, pm, pkg, dev) {
139
157
  const installFlag = dev ? "-D" : "";
140
158
  const cmd = pm === "npm" ? `npm install ${installFlag} ${pkg}` : pm === "yarn" ? `yarn add ${installFlag} ${pkg}` : `pnpm add ${installFlag} ${pkg}`;
141
- child_process.execSync(cmd, { cwd: targetDir, stdio: "inherit" });
159
+ (0, import_node_child_process.execSync)(cmd, { cwd: targetDir, stdio: "inherit" });
142
160
  }
143
161
  __name(addPackage, "addPackage");
144
162
 
145
163
  // packages/cli/src/commands/init.ts
146
164
  async function initCommand(options) {
147
- const projectName = options.name || await p__namespace.text({
165
+ const projectName = options.name || await p.text({
148
166
  message: "Project name:",
149
167
  placeholder: "my-vobs-app",
150
168
  validate: /* @__PURE__ */ __name((v) => !v ? "Project name is required" : void 0, "validate")
151
169
  });
152
- if (p__namespace.isCancel(projectName)) {
153
- p__namespace.cancel("Cancelled");
170
+ if (p.isCancel(projectName)) {
171
+ p.cancel("Cancelled");
154
172
  return;
155
173
  }
156
- const targetDir = options.targetDir || path.resolve(process.cwd(), projectName);
157
- const packageManager = options.packageManager || await p__namespace.select({
174
+ const targetDir = options.targetDir || (0, import_node_path3.resolve)(process.cwd(), projectName);
175
+ const packageManager = options.packageManager || await p.select({
158
176
  message: "Package manager:",
159
177
  options: [
160
178
  { value: "pnpm", label: "pnpm" },
@@ -162,24 +180,24 @@ async function initCommand(options) {
162
180
  { value: "yarn", label: "yarn" }
163
181
  ]
164
182
  });
165
- if (p__namespace.isCancel(packageManager)) {
166
- p__namespace.cancel("Cancelled");
183
+ if (p.isCancel(packageManager)) {
184
+ p.cancel("Cancelled");
167
185
  return;
168
186
  }
169
- const useTypescript = options.typescript ?? await p__namespace.confirm({
187
+ const useTypescript = options.typescript ?? await p.confirm({
170
188
  message: "Use TypeScript?",
171
189
  initialValue: true
172
190
  });
173
- if (p__namespace.isCancel(useTypescript)) {
174
- p__namespace.cancel("Cancelled");
191
+ if (p.isCancel(useTypescript)) {
192
+ p.cancel("Cancelled");
175
193
  return;
176
194
  }
177
- const initGit = options.git ?? await p__namespace.confirm({
195
+ const initGit = options.git ?? await p.confirm({
178
196
  message: "Initialize a git repository?",
179
197
  initialValue: true
180
198
  });
181
- if (p__namespace.isCancel(initGit)) {
182
- p__namespace.cancel("Cancelled");
199
+ if (p.isCancel(initGit)) {
200
+ p.cancel("Cancelled");
183
201
  return;
184
202
  }
185
203
  logger.step(`Creating project ${projectName}...`);
@@ -196,7 +214,7 @@ async function initCommand(options) {
196
214
  if (initGit) {
197
215
  logger.step("Initializing git repository...");
198
216
  try {
199
- child_process.execSync("git init", { cwd: targetDir, stdio: "ignore" });
217
+ (0, import_node_child_process2.execSync)("git init", { cwd: targetDir, stdio: "ignore" });
200
218
  logger.success("Git repository initialized");
201
219
  } catch {
202
220
  logger.warn("Git not found, skipping git init");
@@ -208,9 +226,12 @@ async function initCommand(options) {
208
226
  `);
209
227
  }
210
228
  __name(initCommand, "initCommand");
229
+
230
+ // packages/cli/src/commands/dev.ts
231
+ var import_vite = require("vite");
211
232
  async function devCommand(options) {
212
233
  logger.info("Starting dev server...");
213
- const server = await vite.createServer({
234
+ const server = await (0, import_vite.createServer)({
214
235
  configFile: options.config,
215
236
  server: {
216
237
  port: options.port,
@@ -222,9 +243,12 @@ async function devCommand(options) {
222
243
  logger.success("Dev server is running");
223
244
  }
224
245
  __name(devCommand, "devCommand");
246
+
247
+ // packages/cli/src/commands/build.ts
248
+ var import_vite2 = require("vite");
225
249
  async function buildCommand(options) {
226
250
  logger.info("Building for production...");
227
- await vite.build({
251
+ await (0, import_vite2.build)({
228
252
  configFile: options.config,
229
253
  build: {
230
254
  outDir: options.outDir
@@ -234,56 +258,60 @@ async function buildCommand(options) {
234
258
  logger.success("Build complete");
235
259
  }
236
260
  __name(buildCommand, "buildCommand");
261
+
262
+ // packages/cli/src/commands/generate.ts
263
+ var import_node_path4 = require("path");
264
+ var p2 = __toESM(require("@clack/prompts"), 1);
237
265
  async function generateCommand(options) {
238
- const type = options.type || await p__namespace.select({
266
+ const type = options.type || await p2.select({
239
267
  message: "What to generate?",
240
268
  options: [
241
269
  { value: "component", label: "Component" },
242
270
  { value: "page", label: "Page" }
243
271
  ]
244
272
  });
245
- if (p__namespace.isCancel(type)) {
246
- p__namespace.cancel("Cancelled");
273
+ if (p2.isCancel(type)) {
274
+ p2.cancel("Cancelled");
247
275
  return;
248
276
  }
249
- const name = options.name || await p__namespace.text({
277
+ const name = options.name || await p2.text({
250
278
  message: "Name:",
251
279
  placeholder: type === "component" ? "Button" : "AboutPage",
252
280
  validate: /* @__PURE__ */ __name((v) => !v ? "Name is required" : void 0, "validate")
253
281
  });
254
- if (p__namespace.isCancel(name)) {
255
- p__namespace.cancel("Cancelled");
282
+ if (p2.isCancel(name)) {
283
+ p2.cancel("Cancelled");
256
284
  return;
257
285
  }
258
286
  const templatesDir = getTemplatesDir();
259
287
  if (type === "component") {
260
- const targetDir = options.targetDir || path.resolve(process.cwd(), "src/components");
288
+ const targetDir = options.targetDir || (0, import_node_path4.resolve)(process.cwd(), "src/components");
261
289
  ensureDir(targetDir);
262
290
  const context = {
263
291
  name: toPascalCase(name),
264
292
  kebabName: toKebabCase(name)
265
293
  };
266
294
  const content = renderTemplate(
267
- path.resolve(templatesDir, "component.hbs"),
295
+ (0, import_node_path4.resolve)(templatesDir, "component.hbs"),
268
296
  context
269
297
  );
270
298
  const filename = `${context.name}.tsx`;
271
299
  writeFile(targetDir, filename, content);
272
- logger.success(`Created ${type} at ${path.resolve(targetDir, filename)}`);
300
+ logger.success(`Created ${type} at ${(0, import_node_path4.resolve)(targetDir, filename)}`);
273
301
  } else {
274
- const targetDir = options.targetDir || path.resolve(process.cwd(), "src/pages");
302
+ const targetDir = options.targetDir || (0, import_node_path4.resolve)(process.cwd(), "src/pages");
275
303
  ensureDir(targetDir);
276
304
  const context = {
277
305
  name: toPascalCase(name),
278
306
  path: `/${toKebabCase(name)}`
279
307
  };
280
308
  const content = renderTemplate(
281
- path.resolve(templatesDir, "page.hbs"),
309
+ (0, import_node_path4.resolve)(templatesDir, "page.hbs"),
282
310
  context
283
311
  );
284
312
  const filename = `${context.name}.tsx`;
285
313
  writeFile(targetDir, filename, content);
286
- logger.success(`Created ${type} at ${path.resolve(targetDir, filename)}`);
314
+ logger.success(`Created ${type} at ${(0, import_node_path4.resolve)(targetDir, filename)}`);
287
315
  }
288
316
  }
289
317
  __name(generateCommand, "generateCommand");
@@ -295,22 +323,25 @@ function toKebabCase(str) {
295
323
  return str.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "").replace(/[^a-z0-9-]/g, "-").replace(/--+/g, "-").replace(/^-|-$/g, "");
296
324
  }
297
325
  __name(toKebabCase, "toKebabCase");
326
+
327
+ // packages/cli/src/commands/add.ts
328
+ var p3 = __toESM(require("@clack/prompts"), 1);
298
329
  async function addCommand(options) {
299
- const pkg = options.package || await p__namespace.text({
330
+ const pkg = options.package || await p3.text({
300
331
  message: "Package to add:",
301
332
  placeholder: "@vobs/ui",
302
333
  validate: /* @__PURE__ */ __name((v) => !v ? "Package name is required" : void 0, "validate")
303
334
  });
304
- if (p__namespace.isCancel(pkg)) {
305
- p__namespace.cancel("Cancelled");
335
+ if (p3.isCancel(pkg)) {
336
+ p3.cancel("Cancelled");
306
337
  return;
307
338
  }
308
- const isDev = options.dev ?? await p__namespace.confirm({
339
+ const isDev = options.dev ?? await p3.confirm({
309
340
  message: "Save as dev dependency?",
310
341
  initialValue: false
311
342
  });
312
- if (p__namespace.isCancel(isDev)) {
313
- p__namespace.cancel("Cancelled");
343
+ if (p3.isCancel(isDev)) {
344
+ p3.cancel("Cancelled");
314
345
  return;
315
346
  }
316
347
  const pm = detectPackageManager(process.cwd());
@@ -354,7 +385,7 @@ __name(showDevBanner, "showDevBanner");
354
385
 
355
386
  // packages/cli/src/cli.ts
356
387
  function createCLI() {
357
- const cli = cac.cac("vobs");
388
+ const cli = (0, import_cac.cac)("vobs");
358
389
  cli.command("init [name]", "Create a new vobs project").option("--dir <dir>", "Target directory").option("--pm <pm>", "Package manager (pnpm/npm/yarn)").option("--no-typescript", "Do not use TypeScript").option("--no-git", "Do not initialize git").action(async (name, options) => {
359
390
  await initCommand({
360
391
  name,
@@ -412,12 +443,17 @@ function createCLI() {
412
443
  return cli;
413
444
  }
414
445
  __name(createCLI, "createCLI");
446
+
447
+ // packages/cli/src/repl.ts
448
+ var import_promises = require("readline/promises");
449
+ var import_node_process = require("process");
450
+ var import_picocolors2 = __toESM(require("picocolors"), 1);
415
451
  async function startRepl() {
416
452
  showLogo();
417
- const rl = promises.createInterface({
418
- input: process$1.stdin,
419
- output: process$1.stdout,
420
- prompt: ` ${pc2__default.default.magenta("\u276F")} `,
453
+ const rl = (0, import_promises.createInterface)({
454
+ input: import_node_process.stdin,
455
+ output: import_node_process.stdout,
456
+ prompt: ` ${import_picocolors2.default.magenta("\u276F")} `,
421
457
  terminal: true
422
458
  });
423
459
  rl.prompt();
@@ -431,7 +467,7 @@ async function startRepl() {
431
467
  try {
432
468
  await dispatch(args);
433
469
  } catch (err) {
434
- console.error(` ${pc2__default.default.red("\u2716")} ${err instanceof Error ? err.message : String(err)}`);
470
+ console.error(` ${import_picocolors2.default.red("\u2716")} ${err instanceof Error ? err.message : String(err)}`);
435
471
  }
436
472
  rl.prompt();
437
473
  }
@@ -440,15 +476,15 @@ __name(startRepl, "startRepl");
440
476
  var TABLE = {
441
477
  help: {
442
478
  cmd: /* @__PURE__ */ __name(async () => {
443
- console.log(` ${pc2__default.default.bold("Available commands:")}`);
444
- console.log(` ${pc2__default.default.dim("exit|quit")} Leave the interactive CLI`);
445
- console.log(` ${pc2__default.default.dim("clear")} Clear the screen`);
446
- console.log(` ${pc2__default.default.dim("logo")} Re-print the banner`);
447
- console.log(` ${pc2__default.default.dim("version")} Show version`);
448
- console.log(` ${pc2__default.default.dim("init <name>")} Create a new vobs project`);
449
- console.log(` ${pc2__default.default.dim("generate <name>")} Generate a component/page`);
450
- console.log(` ${pc2__default.default.dim("add <package>")} Add a package`);
451
- console.log(` ${pc2__default.default.dim("dev|build")} Use \`vobs dev\` / \`vobs build\` in a terminal`);
479
+ console.log(` ${import_picocolors2.default.bold("Available commands:")}`);
480
+ console.log(` ${import_picocolors2.default.dim("exit|quit")} Leave the interactive CLI`);
481
+ console.log(` ${import_picocolors2.default.dim("clear")} Clear the screen`);
482
+ console.log(` ${import_picocolors2.default.dim("logo")} Re-print the banner`);
483
+ console.log(` ${import_picocolors2.default.dim("version")} Show version`);
484
+ console.log(` ${import_picocolors2.default.dim("init <name>")} Create a new vobs project`);
485
+ console.log(` ${import_picocolors2.default.dim("generate <name>")} Generate a component/page`);
486
+ console.log(` ${import_picocolors2.default.dim("add <package>")} Add a package`);
487
+ console.log(` ${import_picocolors2.default.dim("dev|build")} Use \`vobs dev\` / \`vobs build\` in a terminal`);
452
488
  }, "cmd"),
453
489
  help: ""
454
490
  },
@@ -510,7 +546,7 @@ async function dispatch(args) {
510
546
  await entry.cmd(rest);
511
547
  return;
512
548
  }
513
- console.log(` ${pc2__default.default.yellow("\u26A0")} Unknown command: ${pc2__default.default.bold(String(name))}. Type ${pc2__default.default.cyan("help")} to see options.`);
549
+ console.log(` ${import_picocolors2.default.yellow("\u26A0")} Unknown command: ${import_picocolors2.default.bold(String(name))}. Type ${import_picocolors2.default.cyan("help")} to see options.`);
514
550
  }
515
551
  __name(dispatch, "dispatch");
516
552
  function splitArgs(line) {
@@ -537,7 +573,8 @@ async function start(args) {
537
573
  createCLI().parse();
538
574
  }
539
575
  __name(start, "start");
540
-
541
- exports.start = start;
542
- //# sourceMappingURL=start.cjs.map
576
+ // Annotate the CommonJS export names for ESM import in node:
577
+ 0 && (module.exports = {
578
+ start
579
+ });
543
580
  //# sourceMappingURL=start.cjs.map