@devappsnpm/vue-kit 1.0.0 → 1.0.3

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 CHANGED
@@ -19,8 +19,43 @@ npm install -D typescript vue pinia
19
19
  ```
20
20
 
21
21
  ## 3. Configuração
22
- Configure a instância do `VueKit`, tipicamente no seu `src/main.ts` ou num arquivo dedicado de configuração:
22
+ Você pode configurar a instância do `VueKit` de duas maneiras principais: diretamente no seu arquivo principal de inicialização ou separadamente em um arquivo dedicado.
23
+
24
+ ### Opção A: Diretamente no `main.ts`
25
+ Esta é a abordagem mais simples, integrando o VueKit diretamente junto à criação da sua aplicação Vue, do Pinia e do Vue Router:
26
+
27
+ ```ts
28
+ // src/main.ts
29
+ import './assets/app.css'
30
+
31
+ import { createApp } from 'vue'
32
+ import { createPinia } from 'pinia'
33
+ import { createVueKit } from '@devappsnpm/vue-kit'
34
+
35
+ import App from './App.vue'
36
+ import router from './router'
37
+
38
+ // Inicializa a configuração do VueKit
39
+ export const vueKit = createVueKit({
40
+ api: {
41
+ baseURL: import.meta.env.VITE_API_URL,
42
+ auth: { driver: 'jwt' } // ou 'cookie'
43
+ }
44
+ })
45
+
46
+ const app = createApp(App)
47
+
48
+ app.use(createPinia())
49
+ app.use(router)
50
+
51
+ app.mount('#app')
52
+ ```
53
+
54
+ ### Opção B: Em um arquivo dedicado
55
+ Se você preferir manter seu `main.ts` limpo ou precisar importar a instância do VueKit em lugares onde o `main.ts` causaria dependência circular, crie um arquivo dedicado (ex: `src/plugins/vueKit.ts` ou `src/config.ts`):
56
+
23
57
  ```ts
58
+ // src/plugins/vueKit.ts
24
59
  import { createVueKit } from '@devappsnpm/vue-kit'
25
60
 
26
61
  export const vueKit = createVueKit({
@@ -31,6 +66,8 @@ export const vueKit = createVueKit({
31
66
  })
32
67
  ```
33
68
 
69
+ E então, você pode simplesmente importar esse arquivo no seu `main.ts` ou nos seus components/stores conforme necessário.
70
+
34
71
  ## 4. Autenticação
35
72
  Você pode configurar o driver de autenticação da seguinte maneira:
36
73
  - **JWT**: `auth: { driver: 'jwt' }` (Utiliza `localStorage` por padrão para salvar os tokens).
@@ -0,0 +1,508 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/cli/index.ts
31
+ var cli_exports = {};
32
+ __export(cli_exports, {
33
+ run: () => run
34
+ });
35
+ module.exports = __toCommonJS(cli_exports);
36
+
37
+ // src/cli/utils/NameParser.ts
38
+ var NameParser = class _NameParser {
39
+ words;
40
+ constructor(input) {
41
+ _NameParser.assertSafe(input);
42
+ this.words = _NameParser.split(input);
43
+ if (this.words.length === 0) {
44
+ throw new Error(`Invalid module name: "${input}"`);
45
+ }
46
+ }
47
+ /** Original PascalCase — e.g. CustomerAccount */
48
+ get PascalCase() {
49
+ return this.words.map((w) => capitalize(w)).join("");
50
+ }
51
+ /** camelCase — e.g. customerAccount */
52
+ get camelCase() {
53
+ return this.words.map((w, i) => i === 0 ? w.toLowerCase() : capitalize(w)).join("");
54
+ }
55
+ /** kebab-case — e.g. customer-account */
56
+ get kebabCase() {
57
+ return this.words.map((w) => w.toLowerCase()).join("-");
58
+ }
59
+ /** snake_case — e.g. customer_account */
60
+ get snakeCase() {
61
+ return this.words.map((w) => w.toLowerCase()).join("_");
62
+ }
63
+ /** SCREAMING_SNAKE_CASE — e.g. CUSTOMER_ACCOUNT */
64
+ get screamingSnakeCase() {
65
+ return this.words.map((w) => w.toUpperCase()).join("_");
66
+ }
67
+ /** Naïve plural — appends "s". Sufficient for code generation. */
68
+ get plural() {
69
+ const last = this.words[this.words.length - 1];
70
+ if (!last) return this.PascalCase + "s";
71
+ const pluralLast = naivePlural(last);
72
+ return this.words.slice(0, -1).map((w) => capitalize(w)).concat(capitalize(pluralLast)).join("");
73
+ }
74
+ /** Plural in camelCase */
75
+ get pluralCamel() {
76
+ const p = new _NameParser(this.plural);
77
+ return p.camelCase;
78
+ }
79
+ /** Plural in kebab-case */
80
+ get pluralKebab() {
81
+ return naivePluralKebab(this.kebabCase);
82
+ }
83
+ // ─── private helpers ────────────────────────────────────────────────────────
84
+ static split(input) {
85
+ return input.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]/g, " ").split(/\s+/).filter(Boolean);
86
+ }
87
+ /**
88
+ * Guards against path traversal and shell injection in user-provided names.
89
+ */
90
+ static assertSafe(name) {
91
+ if (/[/.\\]/.test(name)) {
92
+ throw new Error(
93
+ `Module name "${name}" contains illegal characters (/, \\, .). Use PascalCase names like "CustomerAccount".`
94
+ );
95
+ }
96
+ if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name)) {
97
+ throw new Error(
98
+ `Module name "${name}" is invalid. Use only letters, digits, hyphens or underscores, starting with a letter.`
99
+ );
100
+ }
101
+ }
102
+ };
103
+ function capitalize(word) {
104
+ return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
105
+ }
106
+ function naivePlural(word) {
107
+ const w = word.toLowerCase();
108
+ if (w.endsWith("y") && !["a", "e", "i", "o", "u"].includes(w.charAt(w.length - 2) ?? "")) {
109
+ return w.slice(0, -1) + "ies";
110
+ }
111
+ if (w.endsWith("s") || w.endsWith("sh") || w.endsWith("ch") || w.endsWith("x") || w.endsWith("z")) {
112
+ return w + "es";
113
+ }
114
+ return w + "s";
115
+ }
116
+ function naivePluralKebab(kebab) {
117
+ const parts = kebab.split("-");
118
+ const last = parts[parts.length - 1];
119
+ if (!last) return kebab + "s";
120
+ parts[parts.length - 1] = naivePlural(last);
121
+ return parts.join("-");
122
+ }
123
+
124
+ // src/cli/utils/TemplateRenderer.ts
125
+ var TemplateRenderer = class {
126
+ static varsFromParser(parser, resourcePath) {
127
+ return {
128
+ ModuleName: parser.PascalCase,
129
+ moduleName: parser.camelCase,
130
+ moduleSlug: parser.kebabCase,
131
+ ModuleNamePlural: parser.plural,
132
+ moduleNamePlural: parser.pluralCamel,
133
+ moduleSlugPlural: parser.pluralKebab,
134
+ resourcePath: resourcePath ?? `/${parser.pluralKebab}`
135
+ };
136
+ }
137
+ static render(template, vars) {
138
+ return template.replace(/\{\{\s*([a-zA-Z_]+)\s*\}\}/g, (_, key) => {
139
+ const value = vars[key];
140
+ return value !== void 0 ? value : `{{ ${key} }}`;
141
+ });
142
+ }
143
+ };
144
+
145
+ // src/cli/utils/FileGenerator.ts
146
+ var import_node_fs = __toESM(require("fs"), 1);
147
+ var import_node_path = __toESM(require("path"), 1);
148
+ var import_node_url = require("url");
149
+ var import_meta = {};
150
+ var __filename = (0, import_node_url.fileURLToPath)(import_meta.url);
151
+ var __dirname = import_node_path.default.dirname(__filename);
152
+ var PACKAGE_ROOT = import_node_path.default.resolve(__dirname, "../..");
153
+ var FileGenerator = class {
154
+ constructor(cwd = process.cwd(), customStubsRoot) {
155
+ this.cwd = cwd;
156
+ this.customStubsRoot = customStubsRoot;
157
+ }
158
+ cwd;
159
+ customStubsRoot;
160
+ /**
161
+ * Resolves a stub file path, preferring project-local overrides.
162
+ * @param stubRelPath Relative path from the stubs root (e.g. "module/crud/modal/types/types.ts.stub")
163
+ */
164
+ resolveStub(stubRelPath) {
165
+ const customRoot = this.customStubsRoot ?? import_node_path.default.join(this.cwd, ".devapps", "stubs");
166
+ const customPath = import_node_path.default.join(customRoot, stubRelPath);
167
+ if (import_node_fs.default.existsSync(customPath)) {
168
+ return customPath;
169
+ }
170
+ const packagePath = import_node_path.default.join(PACKAGE_ROOT, "stubs", stubRelPath);
171
+ if (import_node_fs.default.existsSync(packagePath)) {
172
+ return packagePath;
173
+ }
174
+ throw new Error(
175
+ `Stub not found: "${stubRelPath}"
176
+ Looked in:
177
+ ${customPath}
178
+ ${packagePath}`
179
+ );
180
+ }
181
+ /** Read and return stub content as a string. */
182
+ readStub(stubRelPath) {
183
+ return import_node_fs.default.readFileSync(this.resolveStub(stubRelPath), "utf8");
184
+ }
185
+ /**
186
+ * Write content to targetPath. Creates parent directories if needed.
187
+ * Respects `force` flag before overwriting.
188
+ */
189
+ write(targetPath, content, options) {
190
+ const abs = import_node_path.default.isAbsolute(targetPath) ? targetPath : import_node_path.default.join(this.cwd, targetPath);
191
+ if (import_node_fs.default.existsSync(abs) && !options?.force) {
192
+ console.warn(` \u26A0 Skipped (already exists): ${abs}`);
193
+ return { path: abs, created: false, skipped: true };
194
+ }
195
+ import_node_fs.default.mkdirSync(import_node_path.default.dirname(abs), { recursive: true });
196
+ import_node_fs.default.writeFileSync(abs, content, "utf8");
197
+ console.log(` \u2714 Created: ${abs}`);
198
+ return { path: abs, created: true, skipped: false };
199
+ }
200
+ /**
201
+ * High-level helper: resolve stub → render → write.
202
+ */
203
+ generate(stubRelPath, targetPath, render, options) {
204
+ const raw = this.readStub(stubRelPath);
205
+ const content = render(raw);
206
+ return this.write(targetPath, content, options);
207
+ }
208
+ };
209
+
210
+ // src/cli/generators/ModuleGenerator.ts
211
+ var import_node_path2 = __toESM(require("path"), 1);
212
+ var ModuleGenerator = class {
213
+ parser;
214
+ fg;
215
+ vars;
216
+ options;
217
+ constructor(opts) {
218
+ this.parser = new NameParser(opts.name);
219
+ this.fg = new FileGenerator(opts.cwd, opts.customStubsPath);
220
+ this.vars = TemplateRenderer.varsFromParser(this.parser);
221
+ this.options = {
222
+ type: opts.type ?? "crud",
223
+ ui: opts.ui ?? "modal",
224
+ force: opts.force ?? false,
225
+ outputBase: opts.outputBase ?? import_node_path2.default.join(opts.cwd ?? process.cwd(), "src", "modules")
226
+ };
227
+ }
228
+ generate() {
229
+ const { type, ui, force, outputBase } = this.options;
230
+ const slug = this.parser.kebabCase;
231
+ const moduleDir = import_node_path2.default.join(outputBase, slug);
232
+ console.log(`
233
+ \u{1F680} Generating module: ${this.parser.PascalCase} (${type}${type === "crud" ? ` / ${ui}` : ""})
234
+ `);
235
+ switch (type) {
236
+ case "basic":
237
+ this.generateBasic(moduleDir, force);
238
+ break;
239
+ case "resource":
240
+ this.generateResource(moduleDir, force);
241
+ break;
242
+ case "crud":
243
+ if (ui === "page") {
244
+ this.generateCrudPage(moduleDir, force);
245
+ } else {
246
+ this.generateCrudModal(moduleDir, force);
247
+ }
248
+ break;
249
+ case "dashboard":
250
+ this.generateDashboard(moduleDir, force);
251
+ break;
252
+ }
253
+ console.log(`
254
+ \u2705 Module "${this.parser.PascalCase}" generated successfully!
255
+ `);
256
+ }
257
+ render(raw) {
258
+ return TemplateRenderer.render(raw, this.vars);
259
+ }
260
+ stub(relPath) {
261
+ return this.fg.readStub(relPath);
262
+ }
263
+ write(targetPath, content, force) {
264
+ this.fg.write(targetPath, content, { force });
265
+ }
266
+ // ─── basic ───────────────────────────────────────────────────────────────────
267
+ generateBasic(dir, force) {
268
+ const name = this.parser.PascalCase;
269
+ this.write(
270
+ import_node_path2.default.join(dir, "components", `${name}Component.vue`),
271
+ this.render(this.stub("module/basic/component.vue.stub")),
272
+ force
273
+ );
274
+ this.write(
275
+ import_node_path2.default.join(dir, "index.ts"),
276
+ this.render(this.stub("module/basic/index.ts.stub")),
277
+ force
278
+ );
279
+ }
280
+ // ─── resource ────────────────────────────────────────────────────────────────
281
+ generateResource(dir, force) {
282
+ const name = this.parser.PascalCase;
283
+ const slug = this.parser.kebabCase;
284
+ this.write(import_node_path2.default.join(dir, "services", `${slug}.service.ts`), this.render(this.stub("module/resource/service.ts.stub")), force);
285
+ this.write(import_node_path2.default.join(dir, "stores", `${slug}.store.ts`), this.render(this.stub("module/resource/store.ts.stub")), force);
286
+ this.write(import_node_path2.default.join(dir, "types", `${slug}.types.ts`), this.render(this.stub("module/resource/types.ts.stub")), force);
287
+ this.write(import_node_path2.default.join(dir, "components", `${name}List.vue`), this.render(this.stub("module/resource/List.vue.stub")), force);
288
+ this.write(import_node_path2.default.join(dir, "index.ts"), this.render(this.stub("module/resource/index.ts.stub")), force);
289
+ }
290
+ // ─── crud / modal ─────────────────────────────────────────────────────────────
291
+ generateCrudModal(dir, force) {
292
+ const name = this.parser.PascalCase;
293
+ const slug = this.parser.kebabCase;
294
+ this.write(import_node_path2.default.join(dir, "components", `${name}List.vue`), this.render(this.stub("module/crud/modal/components/List.vue.stub")), force);
295
+ this.write(import_node_path2.default.join(dir, "components", `${name}FormModal.vue`), this.render(this.stub("module/crud/modal/components/FormModal.vue.stub")), force);
296
+ this.write(import_node_path2.default.join(dir, "components", `${name}DeleteModal.vue`), this.render(this.stub("module/crud/modal/components/DeleteModal.vue.stub")), force);
297
+ this.write(import_node_path2.default.join(dir, "views", `${name}View.vue`), this.render(this.stub("module/crud/modal/views/View.vue.stub")), force);
298
+ this.write(import_node_path2.default.join(dir, "services", `${slug}.service.ts`), this.render(this.stub("module/crud/modal/services/service.ts.stub")), force);
299
+ this.write(import_node_path2.default.join(dir, "stores", `${slug}.store.ts`), this.render(this.stub("module/crud/modal/stores/store.ts.stub")), force);
300
+ this.write(import_node_path2.default.join(dir, "types", `${slug}.types.ts`), this.render(this.stub("module/crud/modal/types/types.ts.stub")), force);
301
+ this.write(import_node_path2.default.join(dir, "router.ts"), this.render(this.stub("module/crud/modal/router.ts.stub")), force);
302
+ this.write(import_node_path2.default.join(dir, "index.ts"), this.render(this.stub("module/crud/modal/index.ts.stub")), force);
303
+ }
304
+ // ─── crud / page ─────────────────────────────────────────────────────────────
305
+ generateCrudPage(dir, force) {
306
+ const name = this.parser.PascalCase;
307
+ const slug = this.parser.kebabCase;
308
+ this.write(import_node_path2.default.join(dir, "components", `${name}List.vue`), this.render(this.stub("module/crud/page/components/List.vue.stub")), force);
309
+ this.write(import_node_path2.default.join(dir, "components", `${name}Form.vue`), this.render(this.stub("module/crud/page/components/Form.vue.stub")), force);
310
+ this.write(import_node_path2.default.join(dir, "components", `${name}DeleteModal.vue`), this.render(this.stub("module/crud/page/components/DeleteModal.vue.stub")), force);
311
+ this.write(import_node_path2.default.join(dir, "pages", `${name}ListPage.vue`), this.render(this.stub("module/crud/page/pages/ListPage.vue.stub")), force);
312
+ this.write(import_node_path2.default.join(dir, "pages", `${name}CreatePage.vue`), this.render(this.stub("module/crud/page/pages/CreatePage.vue.stub")), force);
313
+ this.write(import_node_path2.default.join(dir, "pages", `${name}EditPage.vue`), this.render(this.stub("module/crud/page/pages/EditPage.vue.stub")), force);
314
+ this.write(import_node_path2.default.join(dir, "pages", `${name}ShowPage.vue`), this.render(this.stub("module/crud/page/pages/ShowPage.vue.stub")), force);
315
+ this.write(import_node_path2.default.join(dir, "services", `${slug}.service.ts`), this.render(this.stub("module/crud/page/services/service.ts.stub")), force);
316
+ this.write(import_node_path2.default.join(dir, "stores", `${slug}.store.ts`), this.render(this.stub("module/crud/page/stores/store.ts.stub")), force);
317
+ this.write(import_node_path2.default.join(dir, "types", `${slug}.types.ts`), this.render(this.stub("module/crud/page/types/types.ts.stub")), force);
318
+ this.write(import_node_path2.default.join(dir, "router.ts"), this.render(this.stub("module/crud/page/router.ts.stub")), force);
319
+ this.write(import_node_path2.default.join(dir, "index.ts"), this.render(this.stub("module/crud/page/index.ts.stub")), force);
320
+ }
321
+ // ─── dashboard ───────────────────────────────────────────────────────────────
322
+ generateDashboard(dir, force) {
323
+ const name = this.parser.PascalCase;
324
+ const slug = this.parser.kebabCase;
325
+ this.write(import_node_path2.default.join(dir, "views", `${name}Dashboard.vue`), this.render(this.stub("module/dashboard/Dashboard.vue.stub")), force);
326
+ this.write(import_node_path2.default.join(dir, "router.ts"), this.render(this.stub("module/dashboard/router.ts.stub")), force);
327
+ this.write(import_node_path2.default.join(dir, "index.ts"), this.render(this.stub("module/dashboard/index.ts.stub")), force);
328
+ }
329
+ };
330
+
331
+ // src/cli/commands/MakeModuleCommand.ts
332
+ function MakeModuleCommand(name, opts = {}) {
333
+ const config = {
334
+ name,
335
+ type: opts.type ?? "crud",
336
+ ui: opts.ui ?? "modal",
337
+ force: opts.force ?? false
338
+ };
339
+ if (opts.outputBase !== void 0) config.outputBase = opts.outputBase;
340
+ if (opts.cwd !== void 0) config.cwd = opts.cwd;
341
+ if (opts.customStubsPath !== void 0) config.customStubsPath = opts.customStubsPath;
342
+ const generator = new ModuleGenerator(config);
343
+ generator.generate();
344
+ }
345
+
346
+ // src/cli/generators/SingleFileGenerators.ts
347
+ var import_node_path3 = __toESM(require("path"), 1);
348
+ function makeGenerator(stubPath, getTarget) {
349
+ return (opts) => {
350
+ const parser = new NameParser(opts.name);
351
+ const fg = new FileGenerator(opts.cwd, opts.customStubsPath);
352
+ const vars = TemplateRenderer.varsFromParser(parser);
353
+ const base = opts.cwd ?? process.cwd();
354
+ const target = getTarget(parser, base);
355
+ const raw = fg.readStub(stubPath);
356
+ const content = TemplateRenderer.render(raw, vars);
357
+ const writeOptions = opts.force !== void 0 ? { force: opts.force } : {};
358
+ fg.write(target, content, writeOptions);
359
+ };
360
+ }
361
+ var ComponentGenerator = makeGenerator(
362
+ "components/component.vue.stub",
363
+ (p, base) => import_node_path3.default.join(base, "src", "components", `${p.PascalCase}.vue`)
364
+ );
365
+ var PageGenerator = makeGenerator(
366
+ "pages/page.vue.stub",
367
+ (p, base) => import_node_path3.default.join(base, "src", "pages", `${p.PascalCase}Page.vue`)
368
+ );
369
+ var ServiceGenerator = makeGenerator(
370
+ "services/service.ts.stub",
371
+ (p, base) => import_node_path3.default.join(base, "src", "services", `${p.kebabCase}.service.ts`)
372
+ );
373
+ var StoreGenerator = makeGenerator(
374
+ "stores/store.ts.stub",
375
+ (p, base) => import_node_path3.default.join(base, "src", "stores", `${p.kebabCase}.store.ts`)
376
+ );
377
+ var TypeGenerator = makeGenerator(
378
+ "types/types.ts.stub",
379
+ (p, base) => import_node_path3.default.join(base, "src", "types", `${p.kebabCase}.types.ts`)
380
+ );
381
+
382
+ // src/cli/commands/MakeOtherCommands.ts
383
+ function MakeComponentCommand(name, opts = { name }) {
384
+ ComponentGenerator({ ...opts, name });
385
+ }
386
+ function MakePageCommand(name, opts = { name }) {
387
+ PageGenerator({ ...opts, name });
388
+ }
389
+ function MakeServiceCommand(name, opts = { name }) {
390
+ ServiceGenerator({ ...opts, name });
391
+ }
392
+ function MakeStoreCommand(name, opts = { name }) {
393
+ StoreGenerator({ ...opts, name });
394
+ }
395
+ function MakeTypeCommand(name, opts = { name }) {
396
+ TypeGenerator({ ...opts, name });
397
+ }
398
+
399
+ // src/cli/index.ts
400
+ function parseArgs(argv) {
401
+ const [, , command, ...rest] = argv;
402
+ const args = [];
403
+ const flags = {};
404
+ for (const token of rest) {
405
+ if (token.startsWith("--")) {
406
+ const [key, value] = token.slice(2).split("=");
407
+ if (key) {
408
+ flags[key] = value !== void 0 ? value : true;
409
+ }
410
+ } else {
411
+ args.push(token);
412
+ }
413
+ }
414
+ return { command, args, flags };
415
+ }
416
+ function printHelp() {
417
+ console.log(`
418
+ @devapps/vue-kit CLI \u2014 v0.1.0
419
+
420
+ Usage:
421
+ npx devapps-vue <command> <name> [options]
422
+
423
+ Commands:
424
+ make:module <Name> --type=basic|resource|crud|dashboard --ui=modal|page
425
+ make:component <Name>
426
+ make:page <Name>
427
+ make:service <Name>
428
+ make:store <Name>
429
+ make:type <Name>
430
+
431
+ Options:
432
+ --type=<type> Module type (basic, resource, crud, dashboard). Default: crud
433
+ --ui=<ui> UI mode for crud modules (modal, page). Default: modal
434
+ --force Overwrite existing files
435
+ --help Show this help message
436
+
437
+ Examples:
438
+ npx devapps-vue make:module Customer --type=crud --ui=modal
439
+ npx devapps-vue make:module Customer --type=crud --ui=page
440
+ npx devapps-vue make:component CustomerCard
441
+ npx devapps-vue make:page CustomerDashboard
442
+ npx devapps-vue make:service Customer
443
+ npx devapps-vue make:store Customer
444
+ npx devapps-vue make:type Customer
445
+ `);
446
+ }
447
+ function run(argv = process.argv) {
448
+ const { command, args, flags } = parseArgs(argv);
449
+ if (!command || flags["help"]) {
450
+ printHelp();
451
+ return;
452
+ }
453
+ const name = args[0];
454
+ if (!name && command !== "--help") {
455
+ console.error(`
456
+ \u274C Missing name argument for command: ${command}
457
+ `);
458
+ printHelp();
459
+ process.exit(1);
460
+ }
461
+ const force = flags["force"] === true || flags["force"] === "true";
462
+ try {
463
+ switch (command) {
464
+ case "make:module":
465
+ MakeModuleCommand(name, {
466
+ type: flags["type"] ?? "crud",
467
+ ui: flags["ui"] ?? "modal",
468
+ force
469
+ });
470
+ break;
471
+ case "make:component":
472
+ MakeComponentCommand(name, { name, force });
473
+ break;
474
+ case "make:page":
475
+ MakePageCommand(name, { name, force });
476
+ break;
477
+ case "make:service":
478
+ MakeServiceCommand(name, { name, force });
479
+ break;
480
+ case "make:store":
481
+ MakeStoreCommand(name, { name, force });
482
+ break;
483
+ case "make:type":
484
+ MakeTypeCommand(name, { name, force });
485
+ break;
486
+ default:
487
+ console.error(`
488
+ \u274C Unknown command: "${command}"
489
+ `);
490
+ printHelp();
491
+ process.exit(1);
492
+ }
493
+ } catch (err) {
494
+ if (err instanceof Error) {
495
+ console.error(`
496
+ \u274C ${err.message}
497
+ `);
498
+ } else {
499
+ console.error("\n\u274C An unexpected error occurred.\n");
500
+ }
501
+ process.exit(1);
502
+ }
503
+ }
504
+ // Annotate the CommonJS export names for ESM import in node:
505
+ 0 && (module.exports = {
506
+ run
507
+ });
508
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/index.ts","../../src/cli/utils/NameParser.ts","../../src/cli/utils/TemplateRenderer.ts","../../src/cli/utils/FileGenerator.ts","../../src/cli/generators/ModuleGenerator.ts","../../src/cli/commands/MakeModuleCommand.ts","../../src/cli/generators/SingleFileGenerators.ts","../../src/cli/commands/MakeOtherCommands.ts"],"sourcesContent":["import { MakeModuleCommand } from \"./commands/MakeModuleCommand\";\nimport {\n MakeComponentCommand,\n MakePageCommand,\n MakeServiceCommand,\n MakeStoreCommand,\n MakeTypeCommand,\n} from \"./commands/MakeOtherCommands\";\nimport type { ModuleType, UiMode } from \"./generators/ModuleGenerator\";\n\n// ─── arg parsing ─────────────────────────────────────────────────────────────\n\nfunction parseArgs(argv: string[]): {\n command: string | undefined;\n args: string[];\n flags: Record<string, string | boolean>;\n} {\n const [, , command, ...rest] = argv;\n\n const args: string[] = [];\n const flags: Record<string, string | boolean> = {};\n\n for (const token of rest) {\n if (token.startsWith(\"--\")) {\n const [key, value] = token.slice(2).split(\"=\");\n if (key) {\n flags[key] = value !== undefined ? value : true;\n }\n } else {\n args.push(token);\n }\n }\n\n return { command, args, flags };\n}\n\n// ─── help ────────────────────────────────────────────────────────────────────\n\nfunction printHelp(): void {\n console.log(`\n@devapps/vue-kit CLI — v0.1.0\n\nUsage:\n npx devapps-vue <command> <name> [options]\n\nCommands:\n make:module <Name> --type=basic|resource|crud|dashboard --ui=modal|page\n make:component <Name>\n make:page <Name>\n make:service <Name>\n make:store <Name>\n make:type <Name>\n\nOptions:\n --type=<type> Module type (basic, resource, crud, dashboard). Default: crud\n --ui=<ui> UI mode for crud modules (modal, page). Default: modal\n --force Overwrite existing files\n --help Show this help message\n\nExamples:\n npx devapps-vue make:module Customer --type=crud --ui=modal\n npx devapps-vue make:module Customer --type=crud --ui=page\n npx devapps-vue make:component CustomerCard\n npx devapps-vue make:page CustomerDashboard\n npx devapps-vue make:service Customer\n npx devapps-vue make:store Customer\n npx devapps-vue make:type Customer\n`);\n}\n\n// ─── main ────────────────────────────────────────────────────────────────────\n\nexport function run(argv: string[] = process.argv): void {\n const { command, args, flags } = parseArgs(argv);\n\n if (!command || flags[\"help\"]) {\n printHelp();\n return;\n }\n\n const name = args[0];\n\n if (!name && command !== \"--help\") {\n console.error(`\\n❌ Missing name argument for command: ${command}\\n`);\n printHelp();\n process.exit(1);\n }\n\n const force = flags[\"force\"] === true || flags[\"force\"] === \"true\";\n\n try {\n switch (command) {\n case \"make:module\":\n MakeModuleCommand(name!, {\n type: (flags[\"type\"] as ModuleType) ?? \"crud\",\n ui: (flags[\"ui\"] as UiMode) ?? \"modal\",\n force,\n });\n break;\n\n case \"make:component\":\n MakeComponentCommand(name!, { name: name!, force });\n break;\n\n case \"make:page\":\n MakePageCommand(name!, { name: name!, force });\n break;\n\n case \"make:service\":\n MakeServiceCommand(name!, { name: name!, force });\n break;\n\n case \"make:store\":\n MakeStoreCommand(name!, { name: name!, force });\n break;\n\n case \"make:type\":\n MakeTypeCommand(name!, { name: name!, force });\n break;\n\n default:\n console.error(`\\n❌ Unknown command: \"${command}\"\\n`);\n printHelp();\n process.exit(1);\n }\n } catch (err) {\n if (err instanceof Error) {\n console.error(`\\n❌ ${err.message}\\n`);\n } else {\n console.error(\"\\n❌ An unexpected error occurred.\\n\");\n }\n process.exit(1);\n }\n}\n","/**\n * NameParser — centralises all name-casing transformations.\n *\n * Given a PascalCase input (e.g. \"CustomerAccount\") it derives:\n * - PascalCase → CustomerAccount\n * - camelCase → customerAccount\n * - kebab-case → customer-account\n * - snake_case → customer_account\n * - SCREAMING_SNAKE → CUSTOMER_ACCOUNT\n * - Plural (simple) → CustomerAccounts\n *\n * Security: sanitises names to prevent path traversal and shell injection.\n */\nexport class NameParser {\n private readonly words: string[];\n\n constructor(input: string) {\n NameParser.assertSafe(input);\n this.words = NameParser.split(input);\n\n if (this.words.length === 0) {\n throw new Error(`Invalid module name: \"${input}\"`);\n }\n }\n\n /** Original PascalCase — e.g. CustomerAccount */\n get PascalCase(): string {\n return this.words.map((w) => capitalize(w)).join(\"\");\n }\n\n /** camelCase — e.g. customerAccount */\n get camelCase(): string {\n return this.words\n .map((w, i) => (i === 0 ? w.toLowerCase() : capitalize(w)))\n .join(\"\");\n }\n\n /** kebab-case — e.g. customer-account */\n get kebabCase(): string {\n return this.words.map((w) => w.toLowerCase()).join(\"-\");\n }\n\n /** snake_case — e.g. customer_account */\n get snakeCase(): string {\n return this.words.map((w) => w.toLowerCase()).join(\"_\");\n }\n\n /** SCREAMING_SNAKE_CASE — e.g. CUSTOMER_ACCOUNT */\n get screamingSnakeCase(): string {\n return this.words.map((w) => w.toUpperCase()).join(\"_\");\n }\n\n /** Naïve plural — appends \"s\". Sufficient for code generation. */\n get plural(): string {\n const last = this.words[this.words.length - 1];\n if (!last) return this.PascalCase + \"s\";\n\n const pluralLast = naivePlural(last);\n return this.words\n .slice(0, -1)\n .map((w) => capitalize(w))\n .concat(capitalize(pluralLast))\n .join(\"\");\n }\n\n /** Plural in camelCase */\n get pluralCamel(): string {\n const p = new NameParser(this.plural);\n return p.camelCase;\n }\n\n /** Plural in kebab-case */\n get pluralKebab(): string {\n return naivePluralKebab(this.kebabCase);\n }\n\n // ─── private helpers ────────────────────────────────────────────────────────\n\n private static split(input: string): string[] {\n // Accept PascalCase, camelCase, kebab-case, snake_case\n return input\n .replace(/([a-z])([A-Z])/g, \"$1 $2\") // camel/pascal → spaces\n .replace(/[-_]/g, \" \") // kebab/snake → spaces\n .split(/\\s+/)\n .filter(Boolean);\n }\n\n /**\n * Guards against path traversal and shell injection in user-provided names.\n */\n static assertSafe(name: string): void {\n if (/[/.\\\\]/.test(name)) {\n throw new Error(\n `Module name \"${name}\" contains illegal characters (/, \\\\, .). ` +\n `Use PascalCase names like \"CustomerAccount\".`,\n );\n }\n\n if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name)) {\n throw new Error(\n `Module name \"${name}\" is invalid. ` +\n `Use only letters, digits, hyphens or underscores, starting with a letter.`,\n );\n }\n }\n}\n\n// ─── utility functions ────────────────────────────────────────────────────────\n\nfunction capitalize(word: string): string {\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n}\n\nfunction naivePlural(word: string): string {\n const w = word.toLowerCase();\n\n if (w.endsWith(\"y\") && ![\"a\", \"e\", \"i\", \"o\", \"u\"].includes(w.charAt(w.length - 2) ?? \"\")) {\n return w.slice(0, -1) + \"ies\";\n }\n\n if (w.endsWith(\"s\") || w.endsWith(\"sh\") || w.endsWith(\"ch\") || w.endsWith(\"x\") || w.endsWith(\"z\")) {\n return w + \"es\";\n }\n\n return w + \"s\";\n}\n\nfunction naivePluralKebab(kebab: string): string {\n const parts = kebab.split(\"-\");\n const last = parts[parts.length - 1];\n if (!last) return kebab + \"s\";\n parts[parts.length - 1] = naivePlural(last);\n return parts.join(\"-\");\n}\n","import type { NameParser } from \"./NameParser\";\n\nexport interface TemplateVars {\n ModuleName: string;\n moduleName: string;\n moduleSlug: string;\n ModuleNamePlural: string;\n moduleNamePlural: string;\n moduleSlugPlural: string;\n resourcePath: string;\n [key: string]: string;\n}\n\n/**\n * Replaces `{{ VarName }}` placeholders in a stub string.\n */\nexport class TemplateRenderer {\n static varsFromParser(parser: NameParser, resourcePath?: string): TemplateVars {\n return {\n ModuleName: parser.PascalCase,\n moduleName: parser.camelCase,\n moduleSlug: parser.kebabCase,\n ModuleNamePlural: parser.plural,\n moduleNamePlural: parser.pluralCamel,\n moduleSlugPlural: parser.pluralKebab,\n resourcePath: resourcePath ?? `/${parser.pluralKebab}`,\n };\n }\n\n static render(template: string, vars: TemplateVars): string {\n return template.replace(/\\{\\{\\s*([a-zA-Z_]+)\\s*\\}\\}/g, (_, key: string) => {\n const value = vars[key];\n return value !== undefined ? value : `{{ ${key} }}`;\n });\n }\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n/** Root of the @devapps/vue-kit package. */\n// When bundled via tsup, this file runs from `dist/cli/index.js` or `dist/cli/index.cjs`\n// So __dirname is `dist/cli` and we need to go up 2 levels.\nconst PACKAGE_ROOT = path.resolve(__dirname, \"../..\");\n\nexport interface WriteOptions {\n /** If true, overwrite existing files. Default: false. */\n force?: boolean;\n}\n\nexport interface WriteResult {\n path: string;\n created: boolean;\n skipped: boolean;\n}\n\n/**\n * Responsible for resolving stub paths and writing generated files.\n *\n * Stub resolution order (first found wins):\n * 1. `<cwd>/.devapps/stubs/<stubRelPath>`\n * 2. `<package>/stubs/<stubRelPath>`\n */\nexport class FileGenerator {\n constructor(\n /** Working directory of the consuming project. Defaults to process.cwd(). */\n private readonly cwd: string = process.cwd(),\n /** Optional custom stubs path override (from VueKitConfig.cli.stubsPath). */\n private readonly customStubsRoot?: string,\n ) {}\n\n /**\n * Resolves a stub file path, preferring project-local overrides.\n * @param stubRelPath Relative path from the stubs root (e.g. \"module/crud/modal/types/types.ts.stub\")\n */\n resolveStub(stubRelPath: string): string {\n const customRoot =\n this.customStubsRoot ?? path.join(this.cwd, \".devapps\", \"stubs\");\n\n const customPath = path.join(customRoot, stubRelPath);\n if (fs.existsSync(customPath)) {\n return customPath;\n }\n\n const packagePath = path.join(PACKAGE_ROOT, \"stubs\", stubRelPath);\n if (fs.existsSync(packagePath)) {\n return packagePath;\n }\n\n throw new Error(\n `Stub not found: \"${stubRelPath}\"\\n` +\n ` Looked in:\\n` +\n ` ${customPath}\\n` +\n ` ${packagePath}`,\n );\n }\n\n /** Read and return stub content as a string. */\n readStub(stubRelPath: string): string {\n return fs.readFileSync(this.resolveStub(stubRelPath), \"utf8\");\n }\n\n /**\n * Write content to targetPath. Creates parent directories if needed.\n * Respects `force` flag before overwriting.\n */\n write(targetPath: string, content: string, options?: WriteOptions): WriteResult {\n const abs = path.isAbsolute(targetPath)\n ? targetPath\n : path.join(this.cwd, targetPath);\n\n if (fs.existsSync(abs) && !options?.force) {\n console.warn(` ⚠ Skipped (already exists): ${abs}`);\n return { path: abs, created: false, skipped: true };\n }\n\n fs.mkdirSync(path.dirname(abs), { recursive: true });\n fs.writeFileSync(abs, content, \"utf8\");\n\n console.log(` ✔ Created: ${abs}`);\n return { path: abs, created: true, skipped: false };\n }\n\n /**\n * High-level helper: resolve stub → render → write.\n */\n generate(\n stubRelPath: string,\n targetPath: string,\n render: (raw: string) => string,\n options?: WriteOptions,\n ): WriteResult {\n const raw = this.readStub(stubRelPath);\n const content = render(raw);\n return this.write(targetPath, content, options);\n }\n}\n","import { NameParser } from \"../utils/NameParser\";\nimport { TemplateRenderer } from \"../utils/TemplateRenderer\";\nimport { FileGenerator } from \"../utils/FileGenerator\";\nimport path from \"node:path\";\n\nexport type ModuleType = \"basic\" | \"resource\" | \"crud\" | \"dashboard\";\nexport type UiMode = \"modal\" | \"page\";\n\nexport interface ModuleGeneratorOptions {\n name: string;\n type?: ModuleType;\n ui?: UiMode;\n force?: boolean;\n outputBase?: string;\n cwd?: string;\n customStubsPath?: string;\n}\n\n/**\n * Orchestrates the generation of all files that make up a module.\n */\nexport class ModuleGenerator {\n private readonly parser: NameParser;\n private readonly fg: FileGenerator;\n private readonly vars: ReturnType<typeof TemplateRenderer.varsFromParser>;\n private readonly options: Required<\n Pick<ModuleGeneratorOptions, \"type\" | \"ui\" | \"force\" | \"outputBase\">\n >;\n\n constructor(opts: ModuleGeneratorOptions) {\n this.parser = new NameParser(opts.name);\n this.fg = new FileGenerator(opts.cwd, opts.customStubsPath);\n this.vars = TemplateRenderer.varsFromParser(this.parser);\n\n this.options = {\n type: opts.type ?? \"crud\",\n ui: opts.ui ?? \"modal\",\n force: opts.force ?? false,\n outputBase: opts.outputBase ?? path.join(opts.cwd ?? process.cwd(), \"src\", \"modules\"),\n };\n }\n\n generate(): void {\n const { type, ui, force, outputBase } = this.options;\n const slug = this.parser.kebabCase;\n const moduleDir = path.join(outputBase, slug);\n\n console.log(`\\n🚀 Generating module: ${this.parser.PascalCase} (${type}${type === \"crud\" ? ` / ${ui}` : \"\"})\\n`);\n\n switch (type) {\n case \"basic\":\n this.generateBasic(moduleDir, force);\n break;\n case \"resource\":\n this.generateResource(moduleDir, force);\n break;\n case \"crud\":\n if (ui === \"page\") {\n this.generateCrudPage(moduleDir, force);\n } else {\n this.generateCrudModal(moduleDir, force);\n }\n break;\n case \"dashboard\":\n this.generateDashboard(moduleDir, force);\n break;\n }\n\n console.log(`\\n✅ Module \"${this.parser.PascalCase}\" generated successfully!\\n`);\n }\n\n private render(raw: string): string {\n return TemplateRenderer.render(raw, this.vars);\n }\n\n private stub(relPath: string): string {\n return this.fg.readStub(relPath);\n }\n\n private write(targetPath: string, content: string, force: boolean) {\n this.fg.write(targetPath, content, { force });\n }\n\n // ─── basic ───────────────────────────────────────────────────────────────────\n\n private generateBasic(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n\n this.write(\n path.join(dir, \"components\", `${name}Component.vue`),\n this.render(this.stub(\"module/basic/component.vue.stub\")),\n force,\n );\n this.write(\n path.join(dir, \"index.ts\"),\n this.render(this.stub(\"module/basic/index.ts.stub\")),\n force,\n );\n }\n\n // ─── resource ────────────────────────────────────────────────────────────────\n\n private generateResource(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n const slug = this.parser.kebabCase;\n\n this.write(path.join(dir, \"services\", `${slug}.service.ts`), this.render(this.stub(\"module/resource/service.ts.stub\")), force);\n this.write(path.join(dir, \"stores\", `${slug}.store.ts`), this.render(this.stub(\"module/resource/store.ts.stub\")), force);\n this.write(path.join(dir, \"types\", `${slug}.types.ts`), this.render(this.stub(\"module/resource/types.ts.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}List.vue`), this.render(this.stub(\"module/resource/List.vue.stub\")), force);\n this.write(path.join(dir, \"index.ts\"), this.render(this.stub(\"module/resource/index.ts.stub\")), force);\n }\n\n // ─── crud / modal ─────────────────────────────────────────────────────────────\n\n private generateCrudModal(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n const slug = this.parser.kebabCase;\n\n this.write(path.join(dir, \"components\", `${name}List.vue`), this.render(this.stub(\"module/crud/modal/components/List.vue.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}FormModal.vue`), this.render(this.stub(\"module/crud/modal/components/FormModal.vue.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}DeleteModal.vue`), this.render(this.stub(\"module/crud/modal/components/DeleteModal.vue.stub\")), force);\n this.write(path.join(dir, \"views\", `${name}View.vue`), this.render(this.stub(\"module/crud/modal/views/View.vue.stub\")), force);\n this.write(path.join(dir, \"services\", `${slug}.service.ts`), this.render(this.stub(\"module/crud/modal/services/service.ts.stub\")), force);\n this.write(path.join(dir, \"stores\", `${slug}.store.ts`), this.render(this.stub(\"module/crud/modal/stores/store.ts.stub\")), force);\n this.write(path.join(dir, \"types\", `${slug}.types.ts`), this.render(this.stub(\"module/crud/modal/types/types.ts.stub\")), force);\n this.write(path.join(dir, \"router.ts\"), this.render(this.stub(\"module/crud/modal/router.ts.stub\")), force);\n this.write(path.join(dir, \"index.ts\"), this.render(this.stub(\"module/crud/modal/index.ts.stub\")), force);\n }\n\n // ─── crud / page ─────────────────────────────────────────────────────────────\n\n private generateCrudPage(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n const slug = this.parser.kebabCase;\n\n this.write(path.join(dir, \"components\", `${name}List.vue`), this.render(this.stub(\"module/crud/page/components/List.vue.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}Form.vue`), this.render(this.stub(\"module/crud/page/components/Form.vue.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}DeleteModal.vue`), this.render(this.stub(\"module/crud/page/components/DeleteModal.vue.stub\")), force);\n this.write(path.join(dir, \"pages\", `${name}ListPage.vue`), this.render(this.stub(\"module/crud/page/pages/ListPage.vue.stub\")), force);\n this.write(path.join(dir, \"pages\", `${name}CreatePage.vue`), this.render(this.stub(\"module/crud/page/pages/CreatePage.vue.stub\")), force);\n this.write(path.join(dir, \"pages\", `${name}EditPage.vue`), this.render(this.stub(\"module/crud/page/pages/EditPage.vue.stub\")), force);\n this.write(path.join(dir, \"pages\", `${name}ShowPage.vue`), this.render(this.stub(\"module/crud/page/pages/ShowPage.vue.stub\")), force);\n this.write(path.join(dir, \"services\", `${slug}.service.ts`), this.render(this.stub(\"module/crud/page/services/service.ts.stub\")), force);\n this.write(path.join(dir, \"stores\", `${slug}.store.ts`), this.render(this.stub(\"module/crud/page/stores/store.ts.stub\")), force);\n this.write(path.join(dir, \"types\", `${slug}.types.ts`), this.render(this.stub(\"module/crud/page/types/types.ts.stub\")), force);\n this.write(path.join(dir, \"router.ts\"), this.render(this.stub(\"module/crud/page/router.ts.stub\")), force);\n this.write(path.join(dir, \"index.ts\"), this.render(this.stub(\"module/crud/page/index.ts.stub\")), force);\n }\n\n // ─── dashboard ───────────────────────────────────────────────────────────────\n\n private generateDashboard(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n const slug = this.parser.kebabCase;\n\n this.write(path.join(dir, \"views\", `${name}Dashboard.vue`), this.render(this.stub(\"module/dashboard/Dashboard.vue.stub\")), force);\n this.write(path.join(dir, \"router.ts\"), this.render(this.stub(\"module/dashboard/router.ts.stub\")), force);\n this.write(path.join(dir, \"index.ts\"), this.render(this.stub(\"module/dashboard/index.ts.stub\")), force);\n }\n}\n","import { ModuleGenerator, type ModuleType, type UiMode, type ModuleGeneratorOptions } from \"../generators/ModuleGenerator\";\n\nexport interface MakeModuleOptions {\n type?: ModuleType;\n ui?: UiMode;\n force?: boolean;\n cwd?: string;\n outputBase?: string;\n customStubsPath?: string;\n}\n\nexport function MakeModuleCommand(name: string, opts: MakeModuleOptions = {}): void {\n const config: ModuleGeneratorOptions = {\n name,\n type: opts.type ?? \"crud\",\n ui: opts.ui ?? \"modal\",\n force: opts.force ?? false,\n };\n \n if (opts.outputBase !== undefined) config.outputBase = opts.outputBase;\n if (opts.cwd !== undefined) config.cwd = opts.cwd;\n if (opts.customStubsPath !== undefined) config.customStubsPath = opts.customStubsPath;\n\n const generator = new ModuleGenerator(config);\n\n generator.generate();\n}\n","import { NameParser } from \"../utils/NameParser\";\nimport { TemplateRenderer } from \"../utils/TemplateRenderer\";\nimport { FileGenerator } from \"../utils/FileGenerator\";\nimport path from \"node:path\";\n\nexport interface SingleFileGeneratorOptions {\n name: string;\n force?: boolean;\n cwd?: string;\n customStubsPath?: string;\n}\n\nfunction makeGenerator(stubPath: string, getTarget: (name: NameParser, base: string) => string) {\n return (opts: SingleFileGeneratorOptions) => {\n const parser = new NameParser(opts.name);\n const fg = new FileGenerator(opts.cwd, opts.customStubsPath);\n const vars = TemplateRenderer.varsFromParser(parser);\n const base = opts.cwd ?? process.cwd();\n const target = getTarget(parser, base);\n const raw = fg.readStub(stubPath);\n const content = TemplateRenderer.render(raw, vars);\n const writeOptions = opts.force !== undefined ? { force: opts.force } : {};\n fg.write(target, content, writeOptions);\n };\n}\n\nexport const ComponentGenerator = makeGenerator(\n \"components/component.vue.stub\",\n (p, base) => path.join(base, \"src\", \"components\", `${p.PascalCase}.vue`),\n);\n\nexport const PageGenerator = makeGenerator(\n \"pages/page.vue.stub\",\n (p, base) => path.join(base, \"src\", \"pages\", `${p.PascalCase}Page.vue`),\n);\n\nexport const ServiceGenerator = makeGenerator(\n \"services/service.ts.stub\",\n (p, base) => path.join(base, \"src\", \"services\", `${p.kebabCase}.service.ts`),\n);\n\nexport const StoreGenerator = makeGenerator(\n \"stores/store.ts.stub\",\n (p, base) => path.join(base, \"src\", \"stores\", `${p.kebabCase}.store.ts`),\n);\n\nexport const TypeGenerator = makeGenerator(\n \"types/types.ts.stub\",\n (p, base) => path.join(base, \"src\", \"types\", `${p.kebabCase}.types.ts`),\n);\n","import {\n ComponentGenerator,\n PageGenerator,\n ServiceGenerator,\n StoreGenerator,\n TypeGenerator,\n type SingleFileGeneratorOptions,\n} from \"../generators/SingleFileGenerators\";\n\nexport function MakeComponentCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n ComponentGenerator({ ...opts, name });\n}\n\nexport function MakePageCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n PageGenerator({ ...opts, name });\n}\n\nexport function MakeServiceCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n ServiceGenerator({ ...opts, name });\n}\n\nexport function MakeStoreCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n StoreGenerator({ ...opts, name });\n}\n\nexport function MakeTypeCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n TypeGenerator({ ...opts, name });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaO,IAAM,aAAN,MAAM,YAAW;AAAA,EACL;AAAA,EAEjB,YAAY,OAAe;AACzB,gBAAW,WAAW,KAAK;AAC3B,SAAK,QAAQ,YAAW,MAAM,KAAK;AAEnC,QAAI,KAAK,MAAM,WAAW,GAAG;AAC3B,YAAM,IAAI,MAAM,yBAAyB,KAAK,GAAG;AAAA,IACnD;AAAA,EACF;AAAA;AAAA,EAGA,IAAI,aAAqB;AACvB,WAAO,KAAK,MAAM,IAAI,CAAC,MAAM,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE;AAAA,EACrD;AAAA;AAAA,EAGA,IAAI,YAAoB;AACtB,WAAO,KAAK,MACT,IAAI,CAAC,GAAG,MAAO,MAAM,IAAI,EAAE,YAAY,IAAI,WAAW,CAAC,CAAE,EACzD,KAAK,EAAE;AAAA,EACZ;AAAA;AAAA,EAGA,IAAI,YAAoB;AACtB,WAAO,KAAK,MAAM,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,KAAK,GAAG;AAAA,EACxD;AAAA;AAAA,EAGA,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AO;AAAA,CAAK;AACnD,kBAAU;AACV,gBAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACF,SAAS,KAAK;AACZ,QAAI,eAAe,OAAO;AACxB,cAAQ,MAAM;AAAA,SAAO,IAAI,OAAO;AAAA,CAAI;AAAA,IACtC,OAAO;AACL,cAAQ,MAAM,0CAAqC;AAAA,IACrD;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":["path","fs","import_node_path","path","import_node_path","path"]}
@@ -0,0 +1,470 @@
1
+ // src/cli/utils/NameParser.ts
2
+ var NameParser = class _NameParser {
3
+ words;
4
+ constructor(input) {
5
+ _NameParser.assertSafe(input);
6
+ this.words = _NameParser.split(input);
7
+ if (this.words.length === 0) {
8
+ throw new Error(`Invalid module name: "${input}"`);
9
+ }
10
+ }
11
+ /** Original PascalCase — e.g. CustomerAccount */
12
+ get PascalCase() {
13
+ return this.words.map((w) => capitalize(w)).join("");
14
+ }
15
+ /** camelCase — e.g. customerAccount */
16
+ get camelCase() {
17
+ return this.words.map((w, i) => i === 0 ? w.toLowerCase() : capitalize(w)).join("");
18
+ }
19
+ /** kebab-case — e.g. customer-account */
20
+ get kebabCase() {
21
+ return this.words.map((w) => w.toLowerCase()).join("-");
22
+ }
23
+ /** snake_case — e.g. customer_account */
24
+ get snakeCase() {
25
+ return this.words.map((w) => w.toLowerCase()).join("_");
26
+ }
27
+ /** SCREAMING_SNAKE_CASE — e.g. CUSTOMER_ACCOUNT */
28
+ get screamingSnakeCase() {
29
+ return this.words.map((w) => w.toUpperCase()).join("_");
30
+ }
31
+ /** Naïve plural — appends "s". Sufficient for code generation. */
32
+ get plural() {
33
+ const last = this.words[this.words.length - 1];
34
+ if (!last) return this.PascalCase + "s";
35
+ const pluralLast = naivePlural(last);
36
+ return this.words.slice(0, -1).map((w) => capitalize(w)).concat(capitalize(pluralLast)).join("");
37
+ }
38
+ /** Plural in camelCase */
39
+ get pluralCamel() {
40
+ const p = new _NameParser(this.plural);
41
+ return p.camelCase;
42
+ }
43
+ /** Plural in kebab-case */
44
+ get pluralKebab() {
45
+ return naivePluralKebab(this.kebabCase);
46
+ }
47
+ // ─── private helpers ────────────────────────────────────────────────────────
48
+ static split(input) {
49
+ return input.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]/g, " ").split(/\s+/).filter(Boolean);
50
+ }
51
+ /**
52
+ * Guards against path traversal and shell injection in user-provided names.
53
+ */
54
+ static assertSafe(name) {
55
+ if (/[/.\\]/.test(name)) {
56
+ throw new Error(
57
+ `Module name "${name}" contains illegal characters (/, \\, .). Use PascalCase names like "CustomerAccount".`
58
+ );
59
+ }
60
+ if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name)) {
61
+ throw new Error(
62
+ `Module name "${name}" is invalid. Use only letters, digits, hyphens or underscores, starting with a letter.`
63
+ );
64
+ }
65
+ }
66
+ };
67
+ function capitalize(word) {
68
+ return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
69
+ }
70
+ function naivePlural(word) {
71
+ const w = word.toLowerCase();
72
+ if (w.endsWith("y") && !["a", "e", "i", "o", "u"].includes(w.charAt(w.length - 2) ?? "")) {
73
+ return w.slice(0, -1) + "ies";
74
+ }
75
+ if (w.endsWith("s") || w.endsWith("sh") || w.endsWith("ch") || w.endsWith("x") || w.endsWith("z")) {
76
+ return w + "es";
77
+ }
78
+ return w + "s";
79
+ }
80
+ function naivePluralKebab(kebab) {
81
+ const parts = kebab.split("-");
82
+ const last = parts[parts.length - 1];
83
+ if (!last) return kebab + "s";
84
+ parts[parts.length - 1] = naivePlural(last);
85
+ return parts.join("-");
86
+ }
87
+
88
+ // src/cli/utils/TemplateRenderer.ts
89
+ var TemplateRenderer = class {
90
+ static varsFromParser(parser, resourcePath) {
91
+ return {
92
+ ModuleName: parser.PascalCase,
93
+ moduleName: parser.camelCase,
94
+ moduleSlug: parser.kebabCase,
95
+ ModuleNamePlural: parser.plural,
96
+ moduleNamePlural: parser.pluralCamel,
97
+ moduleSlugPlural: parser.pluralKebab,
98
+ resourcePath: resourcePath ?? `/${parser.pluralKebab}`
99
+ };
100
+ }
101
+ static render(template, vars) {
102
+ return template.replace(/\{\{\s*([a-zA-Z_]+)\s*\}\}/g, (_, key) => {
103
+ const value = vars[key];
104
+ return value !== void 0 ? value : `{{ ${key} }}`;
105
+ });
106
+ }
107
+ };
108
+
109
+ // src/cli/utils/FileGenerator.ts
110
+ import fs from "fs";
111
+ import path from "path";
112
+ import { fileURLToPath } from "url";
113
+ var __filename = fileURLToPath(import.meta.url);
114
+ var __dirname = path.dirname(__filename);
115
+ var PACKAGE_ROOT = path.resolve(__dirname, "../..");
116
+ var FileGenerator = class {
117
+ constructor(cwd = process.cwd(), customStubsRoot) {
118
+ this.cwd = cwd;
119
+ this.customStubsRoot = customStubsRoot;
120
+ }
121
+ cwd;
122
+ customStubsRoot;
123
+ /**
124
+ * Resolves a stub file path, preferring project-local overrides.
125
+ * @param stubRelPath Relative path from the stubs root (e.g. "module/crud/modal/types/types.ts.stub")
126
+ */
127
+ resolveStub(stubRelPath) {
128
+ const customRoot = this.customStubsRoot ?? path.join(this.cwd, ".devapps", "stubs");
129
+ const customPath = path.join(customRoot, stubRelPath);
130
+ if (fs.existsSync(customPath)) {
131
+ return customPath;
132
+ }
133
+ const packagePath = path.join(PACKAGE_ROOT, "stubs", stubRelPath);
134
+ if (fs.existsSync(packagePath)) {
135
+ return packagePath;
136
+ }
137
+ throw new Error(
138
+ `Stub not found: "${stubRelPath}"
139
+ Looked in:
140
+ ${customPath}
141
+ ${packagePath}`
142
+ );
143
+ }
144
+ /** Read and return stub content as a string. */
145
+ readStub(stubRelPath) {
146
+ return fs.readFileSync(this.resolveStub(stubRelPath), "utf8");
147
+ }
148
+ /**
149
+ * Write content to targetPath. Creates parent directories if needed.
150
+ * Respects `force` flag before overwriting.
151
+ */
152
+ write(targetPath, content, options) {
153
+ const abs = path.isAbsolute(targetPath) ? targetPath : path.join(this.cwd, targetPath);
154
+ if (fs.existsSync(abs) && !options?.force) {
155
+ console.warn(` \u26A0 Skipped (already exists): ${abs}`);
156
+ return { path: abs, created: false, skipped: true };
157
+ }
158
+ fs.mkdirSync(path.dirname(abs), { recursive: true });
159
+ fs.writeFileSync(abs, content, "utf8");
160
+ console.log(` \u2714 Created: ${abs}`);
161
+ return { path: abs, created: true, skipped: false };
162
+ }
163
+ /**
164
+ * High-level helper: resolve stub → render → write.
165
+ */
166
+ generate(stubRelPath, targetPath, render, options) {
167
+ const raw = this.readStub(stubRelPath);
168
+ const content = render(raw);
169
+ return this.write(targetPath, content, options);
170
+ }
171
+ };
172
+
173
+ // src/cli/generators/ModuleGenerator.ts
174
+ import path2 from "path";
175
+ var ModuleGenerator = class {
176
+ parser;
177
+ fg;
178
+ vars;
179
+ options;
180
+ constructor(opts) {
181
+ this.parser = new NameParser(opts.name);
182
+ this.fg = new FileGenerator(opts.cwd, opts.customStubsPath);
183
+ this.vars = TemplateRenderer.varsFromParser(this.parser);
184
+ this.options = {
185
+ type: opts.type ?? "crud",
186
+ ui: opts.ui ?? "modal",
187
+ force: opts.force ?? false,
188
+ outputBase: opts.outputBase ?? path2.join(opts.cwd ?? process.cwd(), "src", "modules")
189
+ };
190
+ }
191
+ generate() {
192
+ const { type, ui, force, outputBase } = this.options;
193
+ const slug = this.parser.kebabCase;
194
+ const moduleDir = path2.join(outputBase, slug);
195
+ console.log(`
196
+ \u{1F680} Generating module: ${this.parser.PascalCase} (${type}${type === "crud" ? ` / ${ui}` : ""})
197
+ `);
198
+ switch (type) {
199
+ case "basic":
200
+ this.generateBasic(moduleDir, force);
201
+ break;
202
+ case "resource":
203
+ this.generateResource(moduleDir, force);
204
+ break;
205
+ case "crud":
206
+ if (ui === "page") {
207
+ this.generateCrudPage(moduleDir, force);
208
+ } else {
209
+ this.generateCrudModal(moduleDir, force);
210
+ }
211
+ break;
212
+ case "dashboard":
213
+ this.generateDashboard(moduleDir, force);
214
+ break;
215
+ }
216
+ console.log(`
217
+ \u2705 Module "${this.parser.PascalCase}" generated successfully!
218
+ `);
219
+ }
220
+ render(raw) {
221
+ return TemplateRenderer.render(raw, this.vars);
222
+ }
223
+ stub(relPath) {
224
+ return this.fg.readStub(relPath);
225
+ }
226
+ write(targetPath, content, force) {
227
+ this.fg.write(targetPath, content, { force });
228
+ }
229
+ // ─── basic ───────────────────────────────────────────────────────────────────
230
+ generateBasic(dir, force) {
231
+ const name = this.parser.PascalCase;
232
+ this.write(
233
+ path2.join(dir, "components", `${name}Component.vue`),
234
+ this.render(this.stub("module/basic/component.vue.stub")),
235
+ force
236
+ );
237
+ this.write(
238
+ path2.join(dir, "index.ts"),
239
+ this.render(this.stub("module/basic/index.ts.stub")),
240
+ force
241
+ );
242
+ }
243
+ // ─── resource ────────────────────────────────────────────────────────────────
244
+ generateResource(dir, force) {
245
+ const name = this.parser.PascalCase;
246
+ const slug = this.parser.kebabCase;
247
+ this.write(path2.join(dir, "services", `${slug}.service.ts`), this.render(this.stub("module/resource/service.ts.stub")), force);
248
+ this.write(path2.join(dir, "stores", `${slug}.store.ts`), this.render(this.stub("module/resource/store.ts.stub")), force);
249
+ this.write(path2.join(dir, "types", `${slug}.types.ts`), this.render(this.stub("module/resource/types.ts.stub")), force);
250
+ this.write(path2.join(dir, "components", `${name}List.vue`), this.render(this.stub("module/resource/List.vue.stub")), force);
251
+ this.write(path2.join(dir, "index.ts"), this.render(this.stub("module/resource/index.ts.stub")), force);
252
+ }
253
+ // ─── crud / modal ─────────────────────────────────────────────────────────────
254
+ generateCrudModal(dir, force) {
255
+ const name = this.parser.PascalCase;
256
+ const slug = this.parser.kebabCase;
257
+ this.write(path2.join(dir, "components", `${name}List.vue`), this.render(this.stub("module/crud/modal/components/List.vue.stub")), force);
258
+ this.write(path2.join(dir, "components", `${name}FormModal.vue`), this.render(this.stub("module/crud/modal/components/FormModal.vue.stub")), force);
259
+ this.write(path2.join(dir, "components", `${name}DeleteModal.vue`), this.render(this.stub("module/crud/modal/components/DeleteModal.vue.stub")), force);
260
+ this.write(path2.join(dir, "views", `${name}View.vue`), this.render(this.stub("module/crud/modal/views/View.vue.stub")), force);
261
+ this.write(path2.join(dir, "services", `${slug}.service.ts`), this.render(this.stub("module/crud/modal/services/service.ts.stub")), force);
262
+ this.write(path2.join(dir, "stores", `${slug}.store.ts`), this.render(this.stub("module/crud/modal/stores/store.ts.stub")), force);
263
+ this.write(path2.join(dir, "types", `${slug}.types.ts`), this.render(this.stub("module/crud/modal/types/types.ts.stub")), force);
264
+ this.write(path2.join(dir, "router.ts"), this.render(this.stub("module/crud/modal/router.ts.stub")), force);
265
+ this.write(path2.join(dir, "index.ts"), this.render(this.stub("module/crud/modal/index.ts.stub")), force);
266
+ }
267
+ // ─── crud / page ─────────────────────────────────────────────────────────────
268
+ generateCrudPage(dir, force) {
269
+ const name = this.parser.PascalCase;
270
+ const slug = this.parser.kebabCase;
271
+ this.write(path2.join(dir, "components", `${name}List.vue`), this.render(this.stub("module/crud/page/components/List.vue.stub")), force);
272
+ this.write(path2.join(dir, "components", `${name}Form.vue`), this.render(this.stub("module/crud/page/components/Form.vue.stub")), force);
273
+ this.write(path2.join(dir, "components", `${name}DeleteModal.vue`), this.render(this.stub("module/crud/page/components/DeleteModal.vue.stub")), force);
274
+ this.write(path2.join(dir, "pages", `${name}ListPage.vue`), this.render(this.stub("module/crud/page/pages/ListPage.vue.stub")), force);
275
+ this.write(path2.join(dir, "pages", `${name}CreatePage.vue`), this.render(this.stub("module/crud/page/pages/CreatePage.vue.stub")), force);
276
+ this.write(path2.join(dir, "pages", `${name}EditPage.vue`), this.render(this.stub("module/crud/page/pages/EditPage.vue.stub")), force);
277
+ this.write(path2.join(dir, "pages", `${name}ShowPage.vue`), this.render(this.stub("module/crud/page/pages/ShowPage.vue.stub")), force);
278
+ this.write(path2.join(dir, "services", `${slug}.service.ts`), this.render(this.stub("module/crud/page/services/service.ts.stub")), force);
279
+ this.write(path2.join(dir, "stores", `${slug}.store.ts`), this.render(this.stub("module/crud/page/stores/store.ts.stub")), force);
280
+ this.write(path2.join(dir, "types", `${slug}.types.ts`), this.render(this.stub("module/crud/page/types/types.ts.stub")), force);
281
+ this.write(path2.join(dir, "router.ts"), this.render(this.stub("module/crud/page/router.ts.stub")), force);
282
+ this.write(path2.join(dir, "index.ts"), this.render(this.stub("module/crud/page/index.ts.stub")), force);
283
+ }
284
+ // ─── dashboard ───────────────────────────────────────────────────────────────
285
+ generateDashboard(dir, force) {
286
+ const name = this.parser.PascalCase;
287
+ const slug = this.parser.kebabCase;
288
+ this.write(path2.join(dir, "views", `${name}Dashboard.vue`), this.render(this.stub("module/dashboard/Dashboard.vue.stub")), force);
289
+ this.write(path2.join(dir, "router.ts"), this.render(this.stub("module/dashboard/router.ts.stub")), force);
290
+ this.write(path2.join(dir, "index.ts"), this.render(this.stub("module/dashboard/index.ts.stub")), force);
291
+ }
292
+ };
293
+
294
+ // src/cli/commands/MakeModuleCommand.ts
295
+ function MakeModuleCommand(name, opts = {}) {
296
+ const config = {
297
+ name,
298
+ type: opts.type ?? "crud",
299
+ ui: opts.ui ?? "modal",
300
+ force: opts.force ?? false
301
+ };
302
+ if (opts.outputBase !== void 0) config.outputBase = opts.outputBase;
303
+ if (opts.cwd !== void 0) config.cwd = opts.cwd;
304
+ if (opts.customStubsPath !== void 0) config.customStubsPath = opts.customStubsPath;
305
+ const generator = new ModuleGenerator(config);
306
+ generator.generate();
307
+ }
308
+
309
+ // src/cli/generators/SingleFileGenerators.ts
310
+ import path3 from "path";
311
+ function makeGenerator(stubPath, getTarget) {
312
+ return (opts) => {
313
+ const parser = new NameParser(opts.name);
314
+ const fg = new FileGenerator(opts.cwd, opts.customStubsPath);
315
+ const vars = TemplateRenderer.varsFromParser(parser);
316
+ const base = opts.cwd ?? process.cwd();
317
+ const target = getTarget(parser, base);
318
+ const raw = fg.readStub(stubPath);
319
+ const content = TemplateRenderer.render(raw, vars);
320
+ const writeOptions = opts.force !== void 0 ? { force: opts.force } : {};
321
+ fg.write(target, content, writeOptions);
322
+ };
323
+ }
324
+ var ComponentGenerator = makeGenerator(
325
+ "components/component.vue.stub",
326
+ (p, base) => path3.join(base, "src", "components", `${p.PascalCase}.vue`)
327
+ );
328
+ var PageGenerator = makeGenerator(
329
+ "pages/page.vue.stub",
330
+ (p, base) => path3.join(base, "src", "pages", `${p.PascalCase}Page.vue`)
331
+ );
332
+ var ServiceGenerator = makeGenerator(
333
+ "services/service.ts.stub",
334
+ (p, base) => path3.join(base, "src", "services", `${p.kebabCase}.service.ts`)
335
+ );
336
+ var StoreGenerator = makeGenerator(
337
+ "stores/store.ts.stub",
338
+ (p, base) => path3.join(base, "src", "stores", `${p.kebabCase}.store.ts`)
339
+ );
340
+ var TypeGenerator = makeGenerator(
341
+ "types/types.ts.stub",
342
+ (p, base) => path3.join(base, "src", "types", `${p.kebabCase}.types.ts`)
343
+ );
344
+
345
+ // src/cli/commands/MakeOtherCommands.ts
346
+ function MakeComponentCommand(name, opts = { name }) {
347
+ ComponentGenerator({ ...opts, name });
348
+ }
349
+ function MakePageCommand(name, opts = { name }) {
350
+ PageGenerator({ ...opts, name });
351
+ }
352
+ function MakeServiceCommand(name, opts = { name }) {
353
+ ServiceGenerator({ ...opts, name });
354
+ }
355
+ function MakeStoreCommand(name, opts = { name }) {
356
+ StoreGenerator({ ...opts, name });
357
+ }
358
+ function MakeTypeCommand(name, opts = { name }) {
359
+ TypeGenerator({ ...opts, name });
360
+ }
361
+
362
+ // src/cli/index.ts
363
+ function parseArgs(argv) {
364
+ const [, , command, ...rest] = argv;
365
+ const args = [];
366
+ const flags = {};
367
+ for (const token of rest) {
368
+ if (token.startsWith("--")) {
369
+ const [key, value] = token.slice(2).split("=");
370
+ if (key) {
371
+ flags[key] = value !== void 0 ? value : true;
372
+ }
373
+ } else {
374
+ args.push(token);
375
+ }
376
+ }
377
+ return { command, args, flags };
378
+ }
379
+ function printHelp() {
380
+ console.log(`
381
+ @devapps/vue-kit CLI \u2014 v0.1.0
382
+
383
+ Usage:
384
+ npx devapps-vue <command> <name> [options]
385
+
386
+ Commands:
387
+ make:module <Name> --type=basic|resource|crud|dashboard --ui=modal|page
388
+ make:component <Name>
389
+ make:page <Name>
390
+ make:service <Name>
391
+ make:store <Name>
392
+ make:type <Name>
393
+
394
+ Options:
395
+ --type=<type> Module type (basic, resource, crud, dashboard). Default: crud
396
+ --ui=<ui> UI mode for crud modules (modal, page). Default: modal
397
+ --force Overwrite existing files
398
+ --help Show this help message
399
+
400
+ Examples:
401
+ npx devapps-vue make:module Customer --type=crud --ui=modal
402
+ npx devapps-vue make:module Customer --type=crud --ui=page
403
+ npx devapps-vue make:component CustomerCard
404
+ npx devapps-vue make:page CustomerDashboard
405
+ npx devapps-vue make:service Customer
406
+ npx devapps-vue make:store Customer
407
+ npx devapps-vue make:type Customer
408
+ `);
409
+ }
410
+ function run(argv = process.argv) {
411
+ const { command, args, flags } = parseArgs(argv);
412
+ if (!command || flags["help"]) {
413
+ printHelp();
414
+ return;
415
+ }
416
+ const name = args[0];
417
+ if (!name && command !== "--help") {
418
+ console.error(`
419
+ \u274C Missing name argument for command: ${command}
420
+ `);
421
+ printHelp();
422
+ process.exit(1);
423
+ }
424
+ const force = flags["force"] === true || flags["force"] === "true";
425
+ try {
426
+ switch (command) {
427
+ case "make:module":
428
+ MakeModuleCommand(name, {
429
+ type: flags["type"] ?? "crud",
430
+ ui: flags["ui"] ?? "modal",
431
+ force
432
+ });
433
+ break;
434
+ case "make:component":
435
+ MakeComponentCommand(name, { name, force });
436
+ break;
437
+ case "make:page":
438
+ MakePageCommand(name, { name, force });
439
+ break;
440
+ case "make:service":
441
+ MakeServiceCommand(name, { name, force });
442
+ break;
443
+ case "make:store":
444
+ MakeStoreCommand(name, { name, force });
445
+ break;
446
+ case "make:type":
447
+ MakeTypeCommand(name, { name, force });
448
+ break;
449
+ default:
450
+ console.error(`
451
+ \u274C Unknown command: "${command}"
452
+ `);
453
+ printHelp();
454
+ process.exit(1);
455
+ }
456
+ } catch (err) {
457
+ if (err instanceof Error) {
458
+ console.error(`
459
+ \u274C ${err.message}
460
+ `);
461
+ } else {
462
+ console.error("\n\u274C An unexpected error occurred.\n");
463
+ }
464
+ process.exit(1);
465
+ }
466
+ }
467
+ export {
468
+ run
469
+ };
470
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/utils/NameParser.ts","../../src/cli/utils/TemplateRenderer.ts","../../src/cli/utils/FileGenerator.ts","../../src/cli/generators/ModuleGenerator.ts","../../src/cli/commands/MakeModuleCommand.ts","../../src/cli/generators/SingleFileGenerators.ts","../../src/cli/commands/MakeOtherCommands.ts","../../src/cli/index.ts"],"sourcesContent":["/**\n * NameParser — centralises all name-casing transformations.\n *\n * Given a PascalCase input (e.g. \"CustomerAccount\") it derives:\n * - PascalCase → CustomerAccount\n * - camelCase → customerAccount\n * - kebab-case → customer-account\n * - snake_case → customer_account\n * - SCREAMING_SNAKE → CUSTOMER_ACCOUNT\n * - Plural (simple) → CustomerAccounts\n *\n * Security: sanitises names to prevent path traversal and shell injection.\n */\nexport class NameParser {\n private readonly words: string[];\n\n constructor(input: string) {\n NameParser.assertSafe(input);\n this.words = NameParser.split(input);\n\n if (this.words.length === 0) {\n throw new Error(`Invalid module name: \"${input}\"`);\n }\n }\n\n /** Original PascalCase — e.g. CustomerAccount */\n get PascalCase(): string {\n return this.words.map((w) => capitalize(w)).join(\"\");\n }\n\n /** camelCase — e.g. customerAccount */\n get camelCase(): string {\n return this.words\n .map((w, i) => (i === 0 ? w.toLowerCase() : capitalize(w)))\n .join(\"\");\n }\n\n /** kebab-case — e.g. customer-account */\n get kebabCase(): string {\n return this.words.map((w) => w.toLowerCase()).join(\"-\");\n }\n\n /** snake_case — e.g. customer_account */\n get snakeCase(): string {\n return this.words.map((w) => w.toLowerCase()).join(\"_\");\n }\n\n /** SCREAMING_SNAKE_CASE — e.g. CUSTOMER_ACCOUNT */\n get screamingSnakeCase(): string {\n return this.words.map((w) => w.toUpperCase()).join(\"_\");\n }\n\n /** Naïve plural — appends \"s\". Sufficient for code generation. */\n get plural(): string {\n const last = this.words[this.words.length - 1];\n if (!last) return this.PascalCase + \"s\";\n\n const pluralLast = naivePlural(last);\n return this.words\n .slice(0, -1)\n .map((w) => capitalize(w))\n .concat(capitalize(pluralLast))\n .join(\"\");\n }\n\n /** Plural in camelCase */\n get pluralCamel(): string {\n const p = new NameParser(this.plural);\n return p.camelCase;\n }\n\n /** Plural in kebab-case */\n get pluralKebab(): string {\n return naivePluralKebab(this.kebabCase);\n }\n\n // ─── private helpers ────────────────────────────────────────────────────────\n\n private static split(input: string): string[] {\n // Accept PascalCase, camelCase, kebab-case, snake_case\n return input\n .replace(/([a-z])([A-Z])/g, \"$1 $2\") // camel/pascal → spaces\n .replace(/[-_]/g, \" \") // kebab/snake → spaces\n .split(/\\s+/)\n .filter(Boolean);\n }\n\n /**\n * Guards against path traversal and shell injection in user-provided names.\n */\n static assertSafe(name: string): void {\n if (/[/.\\\\]/.test(name)) {\n throw new Error(\n `Module name \"${name}\" contains illegal characters (/, \\\\, .). ` +\n `Use PascalCase names like \"CustomerAccount\".`,\n );\n }\n\n if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name)) {\n throw new Error(\n `Module name \"${name}\" is invalid. ` +\n `Use only letters, digits, hyphens or underscores, starting with a letter.`,\n );\n }\n }\n}\n\n// ─── utility functions ────────────────────────────────────────────────────────\n\nfunction capitalize(word: string): string {\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n}\n\nfunction naivePlural(word: string): string {\n const w = word.toLowerCase();\n\n if (w.endsWith(\"y\") && ![\"a\", \"e\", \"i\", \"o\", \"u\"].includes(w.charAt(w.length - 2) ?? \"\")) {\n return w.slice(0, -1) + \"ies\";\n }\n\n if (w.endsWith(\"s\") || w.endsWith(\"sh\") || w.endsWith(\"ch\") || w.endsWith(\"x\") || w.endsWith(\"z\")) {\n return w + \"es\";\n }\n\n return w + \"s\";\n}\n\nfunction naivePluralKebab(kebab: string): string {\n const parts = kebab.split(\"-\");\n const last = parts[parts.length - 1];\n if (!last) return kebab + \"s\";\n parts[parts.length - 1] = naivePlural(last);\n return parts.join(\"-\");\n}\n","import type { NameParser } from \"./NameParser\";\n\nexport interface TemplateVars {\n ModuleName: string;\n moduleName: string;\n moduleSlug: string;\n ModuleNamePlural: string;\n moduleNamePlural: string;\n moduleSlugPlural: string;\n resourcePath: string;\n [key: string]: string;\n}\n\n/**\n * Replaces `{{ VarName }}` placeholders in a stub string.\n */\nexport class TemplateRenderer {\n static varsFromParser(parser: NameParser, resourcePath?: string): TemplateVars {\n return {\n ModuleName: parser.PascalCase,\n moduleName: parser.camelCase,\n moduleSlug: parser.kebabCase,\n ModuleNamePlural: parser.plural,\n moduleNamePlural: parser.pluralCamel,\n moduleSlugPlural: parser.pluralKebab,\n resourcePath: resourcePath ?? `/${parser.pluralKebab}`,\n };\n }\n\n static render(template: string, vars: TemplateVars): string {\n return template.replace(/\\{\\{\\s*([a-zA-Z_]+)\\s*\\}\\}/g, (_, key: string) => {\n const value = vars[key];\n return value !== undefined ? value : `{{ ${key} }}`;\n });\n }\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n/** Root of the @devapps/vue-kit package. */\n// When bundled via tsup, this file runs from `dist/cli/index.js` or `dist/cli/index.cjs`\n// So __dirname is `dist/cli` and we need to go up 2 levels.\nconst PACKAGE_ROOT = path.resolve(__dirname, \"../..\");\n\nexport interface WriteOptions {\n /** If true, overwrite existing files. Default: false. */\n force?: boolean;\n}\n\nexport interface WriteResult {\n path: string;\n created: boolean;\n skipped: boolean;\n}\n\n/**\n * Responsible for resolving stub paths and writing generated files.\n *\n * Stub resolution order (first found wins):\n * 1. `<cwd>/.devapps/stubs/<stubRelPath>`\n * 2. `<package>/stubs/<stubRelPath>`\n */\nexport class FileGenerator {\n constructor(\n /** Working directory of the consuming project. Defaults to process.cwd(). */\n private readonly cwd: string = process.cwd(),\n /** Optional custom stubs path override (from VueKitConfig.cli.stubsPath). */\n private readonly customStubsRoot?: string,\n ) {}\n\n /**\n * Resolves a stub file path, preferring project-local overrides.\n * @param stubRelPath Relative path from the stubs root (e.g. \"module/crud/modal/types/types.ts.stub\")\n */\n resolveStub(stubRelPath: string): string {\n const customRoot =\n this.customStubsRoot ?? path.join(this.cwd, \".devapps\", \"stubs\");\n\n const customPath = path.join(customRoot, stubRelPath);\n if (fs.existsSync(customPath)) {\n return customPath;\n }\n\n const packagePath = path.join(PACKAGE_ROOT, \"stubs\", stubRelPath);\n if (fs.existsSync(packagePath)) {\n return packagePath;\n }\n\n throw new Error(\n `Stub not found: \"${stubRelPath}\"\\n` +\n ` Looked in:\\n` +\n ` ${customPath}\\n` +\n ` ${packagePath}`,\n );\n }\n\n /** Read and return stub content as a string. */\n readStub(stubRelPath: string): string {\n return fs.readFileSync(this.resolveStub(stubRelPath), \"utf8\");\n }\n\n /**\n * Write content to targetPath. Creates parent directories if needed.\n * Respects `force` flag before overwriting.\n */\n write(targetPath: string, content: string, options?: WriteOptions): WriteResult {\n const abs = path.isAbsolute(targetPath)\n ? targetPath\n : path.join(this.cwd, targetPath);\n\n if (fs.existsSync(abs) && !options?.force) {\n console.warn(` ⚠ Skipped (already exists): ${abs}`);\n return { path: abs, created: false, skipped: true };\n }\n\n fs.mkdirSync(path.dirname(abs), { recursive: true });\n fs.writeFileSync(abs, content, \"utf8\");\n\n console.log(` ✔ Created: ${abs}`);\n return { path: abs, created: true, skipped: false };\n }\n\n /**\n * High-level helper: resolve stub → render → write.\n */\n generate(\n stubRelPath: string,\n targetPath: string,\n render: (raw: string) => string,\n options?: WriteOptions,\n ): WriteResult {\n const raw = this.readStub(stubRelPath);\n const content = render(raw);\n return this.write(targetPath, content, options);\n }\n}\n","import { NameParser } from \"../utils/NameParser\";\nimport { TemplateRenderer } from \"../utils/TemplateRenderer\";\nimport { FileGenerator } from \"../utils/FileGenerator\";\nimport path from \"node:path\";\n\nexport type ModuleType = \"basic\" | \"resource\" | \"crud\" | \"dashboard\";\nexport type UiMode = \"modal\" | \"page\";\n\nexport interface ModuleGeneratorOptions {\n name: string;\n type?: ModuleType;\n ui?: UiMode;\n force?: boolean;\n outputBase?: string;\n cwd?: string;\n customStubsPath?: string;\n}\n\n/**\n * Orchestrates the generation of all files that make up a module.\n */\nexport class ModuleGenerator {\n private readonly parser: NameParser;\n private readonly fg: FileGenerator;\n private readonly vars: ReturnType<typeof TemplateRenderer.varsFromParser>;\n private readonly options: Required<\n Pick<ModuleGeneratorOptions, \"type\" | \"ui\" | \"force\" | \"outputBase\">\n >;\n\n constructor(opts: ModuleGeneratorOptions) {\n this.parser = new NameParser(opts.name);\n this.fg = new FileGenerator(opts.cwd, opts.customStubsPath);\n this.vars = TemplateRenderer.varsFromParser(this.parser);\n\n this.options = {\n type: opts.type ?? \"crud\",\n ui: opts.ui ?? \"modal\",\n force: opts.force ?? false,\n outputBase: opts.outputBase ?? path.join(opts.cwd ?? process.cwd(), \"src\", \"modules\"),\n };\n }\n\n generate(): void {\n const { type, ui, force, outputBase } = this.options;\n const slug = this.parser.kebabCase;\n const moduleDir = path.join(outputBase, slug);\n\n console.log(`\\n🚀 Generating module: ${this.parser.PascalCase} (${type}${type === \"crud\" ? ` / ${ui}` : \"\"})\\n`);\n\n switch (type) {\n case \"basic\":\n this.generateBasic(moduleDir, force);\n break;\n case \"resource\":\n this.generateResource(moduleDir, force);\n break;\n case \"crud\":\n if (ui === \"page\") {\n this.generateCrudPage(moduleDir, force);\n } else {\n this.generateCrudModal(moduleDir, force);\n }\n break;\n case \"dashboard\":\n this.generateDashboard(moduleDir, force);\n break;\n }\n\n console.log(`\\n✅ Module \"${this.parser.PascalCase}\" generated successfully!\\n`);\n }\n\n private render(raw: string): string {\n return TemplateRenderer.render(raw, this.vars);\n }\n\n private stub(relPath: string): string {\n return this.fg.readStub(relPath);\n }\n\n private write(targetPath: string, content: string, force: boolean) {\n this.fg.write(targetPath, content, { force });\n }\n\n // ─── basic ───────────────────────────────────────────────────────────────────\n\n private generateBasic(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n\n this.write(\n path.join(dir, \"components\", `${name}Component.vue`),\n this.render(this.stub(\"module/basic/component.vue.stub\")),\n force,\n );\n this.write(\n path.join(dir, \"index.ts\"),\n this.render(this.stub(\"module/basic/index.ts.stub\")),\n force,\n );\n }\n\n // ─── resource ────────────────────────────────────────────────────────────────\n\n private generateResource(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n const slug = this.parser.kebabCase;\n\n this.write(path.join(dir, \"services\", `${slug}.service.ts`), this.render(this.stub(\"module/resource/service.ts.stub\")), force);\n this.write(path.join(dir, \"stores\", `${slug}.store.ts`), this.render(this.stub(\"module/resource/store.ts.stub\")), force);\n this.write(path.join(dir, \"types\", `${slug}.types.ts`), this.render(this.stub(\"module/resource/types.ts.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}List.vue`), this.render(this.stub(\"module/resource/List.vue.stub\")), force);\n this.write(path.join(dir, \"index.ts\"), this.render(this.stub(\"module/resource/index.ts.stub\")), force);\n }\n\n // ─── crud / modal ─────────────────────────────────────────────────────────────\n\n private generateCrudModal(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n const slug = this.parser.kebabCase;\n\n this.write(path.join(dir, \"components\", `${name}List.vue`), this.render(this.stub(\"module/crud/modal/components/List.vue.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}FormModal.vue`), this.render(this.stub(\"module/crud/modal/components/FormModal.vue.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}DeleteModal.vue`), this.render(this.stub(\"module/crud/modal/components/DeleteModal.vue.stub\")), force);\n this.write(path.join(dir, \"views\", `${name}View.vue`), this.render(this.stub(\"module/crud/modal/views/View.vue.stub\")), force);\n this.write(path.join(dir, \"services\", `${slug}.service.ts`), this.render(this.stub(\"module/crud/modal/services/service.ts.stub\")), force);\n this.write(path.join(dir, \"stores\", `${slug}.store.ts`), this.render(this.stub(\"module/crud/modal/stores/store.ts.stub\")), force);\n this.write(path.join(dir, \"types\", `${slug}.types.ts`), this.render(this.stub(\"module/crud/modal/types/types.ts.stub\")), force);\n this.write(path.join(dir, \"router.ts\"), this.render(this.stub(\"module/crud/modal/router.ts.stub\")), force);\n this.write(path.join(dir, \"index.ts\"), this.render(this.stub(\"module/crud/modal/index.ts.stub\")), force);\n }\n\n // ─── crud / page ─────────────────────────────────────────────────────────────\n\n private generateCrudPage(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n const slug = this.parser.kebabCase;\n\n this.write(path.join(dir, \"components\", `${name}List.vue`), this.render(this.stub(\"module/crud/page/components/List.vue.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}Form.vue`), this.render(this.stub(\"module/crud/page/components/Form.vue.stub\")), force);\n this.write(path.join(dir, \"components\", `${name}DeleteModal.vue`), this.render(this.stub(\"module/crud/page/components/DeleteModal.vue.stub\")), force);\n this.write(path.join(dir, \"pages\", `${name}ListPage.vue`), this.render(this.stub(\"module/crud/page/pages/ListPage.vue.stub\")), force);\n this.write(path.join(dir, \"pages\", `${name}CreatePage.vue`), this.render(this.stub(\"module/crud/page/pages/CreatePage.vue.stub\")), force);\n this.write(path.join(dir, \"pages\", `${name}EditPage.vue`), this.render(this.stub(\"module/crud/page/pages/EditPage.vue.stub\")), force);\n this.write(path.join(dir, \"pages\", `${name}ShowPage.vue`), this.render(this.stub(\"module/crud/page/pages/ShowPage.vue.stub\")), force);\n this.write(path.join(dir, \"services\", `${slug}.service.ts`), this.render(this.stub(\"module/crud/page/services/service.ts.stub\")), force);\n this.write(path.join(dir, \"stores\", `${slug}.store.ts`), this.render(this.stub(\"module/crud/page/stores/store.ts.stub\")), force);\n this.write(path.join(dir, \"types\", `${slug}.types.ts`), this.render(this.stub(\"module/crud/page/types/types.ts.stub\")), force);\n this.write(path.join(dir, \"router.ts\"), this.render(this.stub(\"module/crud/page/router.ts.stub\")), force);\n this.write(path.join(dir, \"index.ts\"), this.render(this.stub(\"module/crud/page/index.ts.stub\")), force);\n }\n\n // ─── dashboard ───────────────────────────────────────────────────────────────\n\n private generateDashboard(dir: string, force: boolean): void {\n const name = this.parser.PascalCase;\n const slug = this.parser.kebabCase;\n\n this.write(path.join(dir, \"views\", `${name}Dashboard.vue`), this.render(this.stub(\"module/dashboard/Dashboard.vue.stub\")), force);\n this.write(path.join(dir, \"router.ts\"), this.render(this.stub(\"module/dashboard/router.ts.stub\")), force);\n this.write(path.join(dir, \"index.ts\"), this.render(this.stub(\"module/dashboard/index.ts.stub\")), force);\n }\n}\n","import { ModuleGenerator, type ModuleType, type UiMode, type ModuleGeneratorOptions } from \"../generators/ModuleGenerator\";\n\nexport interface MakeModuleOptions {\n type?: ModuleType;\n ui?: UiMode;\n force?: boolean;\n cwd?: string;\n outputBase?: string;\n customStubsPath?: string;\n}\n\nexport function MakeModuleCommand(name: string, opts: MakeModuleOptions = {}): void {\n const config: ModuleGeneratorOptions = {\n name,\n type: opts.type ?? \"crud\",\n ui: opts.ui ?? \"modal\",\n force: opts.force ?? false,\n };\n \n if (opts.outputBase !== undefined) config.outputBase = opts.outputBase;\n if (opts.cwd !== undefined) config.cwd = opts.cwd;\n if (opts.customStubsPath !== undefined) config.customStubsPath = opts.customStubsPath;\n\n const generator = new ModuleGenerator(config);\n\n generator.generate();\n}\n","import { NameParser } from \"../utils/NameParser\";\nimport { TemplateRenderer } from \"../utils/TemplateRenderer\";\nimport { FileGenerator } from \"../utils/FileGenerator\";\nimport path from \"node:path\";\n\nexport interface SingleFileGeneratorOptions {\n name: string;\n force?: boolean;\n cwd?: string;\n customStubsPath?: string;\n}\n\nfunction makeGenerator(stubPath: string, getTarget: (name: NameParser, base: string) => string) {\n return (opts: SingleFileGeneratorOptions) => {\n const parser = new NameParser(opts.name);\n const fg = new FileGenerator(opts.cwd, opts.customStubsPath);\n const vars = TemplateRenderer.varsFromParser(parser);\n const base = opts.cwd ?? process.cwd();\n const target = getTarget(parser, base);\n const raw = fg.readStub(stubPath);\n const content = TemplateRenderer.render(raw, vars);\n const writeOptions = opts.force !== undefined ? { force: opts.force } : {};\n fg.write(target, content, writeOptions);\n };\n}\n\nexport const ComponentGenerator = makeGenerator(\n \"components/component.vue.stub\",\n (p, base) => path.join(base, \"src\", \"components\", `${p.PascalCase}.vue`),\n);\n\nexport const PageGenerator = makeGenerator(\n \"pages/page.vue.stub\",\n (p, base) => path.join(base, \"src\", \"pages\", `${p.PascalCase}Page.vue`),\n);\n\nexport const ServiceGenerator = makeGenerator(\n \"services/service.ts.stub\",\n (p, base) => path.join(base, \"src\", \"services\", `${p.kebabCase}.service.ts`),\n);\n\nexport const StoreGenerator = makeGenerator(\n \"stores/store.ts.stub\",\n (p, base) => path.join(base, \"src\", \"stores\", `${p.kebabCase}.store.ts`),\n);\n\nexport const TypeGenerator = makeGenerator(\n \"types/types.ts.stub\",\n (p, base) => path.join(base, \"src\", \"types\", `${p.kebabCase}.types.ts`),\n);\n","import {\n ComponentGenerator,\n PageGenerator,\n ServiceGenerator,\n StoreGenerator,\n TypeGenerator,\n type SingleFileGeneratorOptions,\n} from \"../generators/SingleFileGenerators\";\n\nexport function MakeComponentCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n ComponentGenerator({ ...opts, name });\n}\n\nexport function MakePageCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n PageGenerator({ ...opts, name });\n}\n\nexport function MakeServiceCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n ServiceGenerator({ ...opts, name });\n}\n\nexport function MakeStoreCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n StoreGenerator({ ...opts, name });\n}\n\nexport function MakeTypeCommand(name: string, opts: SingleFileGeneratorOptions = { name }): void {\n TypeGenerator({ ...opts, name });\n}\n","import { MakeModuleCommand } from \"./commands/MakeModuleCommand\";\nimport {\n MakeComponentCommand,\n MakePageCommand,\n MakeServiceCommand,\n MakeStoreCommand,\n MakeTypeCommand,\n} from \"./commands/MakeOtherCommands\";\nimport type { ModuleType, UiMode } from \"./generators/ModuleGenerator\";\n\n// ─── arg parsing ─────────────────────────────────────────────────────────────\n\nfunction parseArgs(argv: string[]): {\n command: string | undefined;\n args: string[];\n flags: Record<string, string | boolean>;\n} {\n const [, , command, ...rest] = argv;\n\n const args: string[] = [];\n const flags: Record<string, string | boolean> = {};\n\n for (const token of rest) {\n if (token.startsWith(\"--\")) {\n const [key, value] = token.slice(2).split(\"=\");\n if (key) {\n flags[key] = value !== undefined ? value : true;\n }\n } else {\n args.push(token);\n }\n }\n\n return { command, args, flags };\n}\n\n// ─── help ────────────────────────────────────────────────────────────────────\n\nfunction printHelp(): void {\n console.log(`\n@devapps/vue-kit CLI — v0.1.0\n\nUsage:\n npx devapps-vue <command> <name> [options]\n\nCommands:\n make:module <Name> --type=basic|resource|crud|dashboard --ui=modal|page\n make:component <Name>\n make:page <Name>\n make:service <Name>\n make:store <Name>\n make:type <Name>\n\nOptions:\n --type=<type> Module type (basic, resource, crud, dashboard). Default: crud\n --ui=<ui> UI mode for crud modules (modal, page). Default: modal\n --force Overwrite existing files\n --help Show this help message\n\nExamples:\n npx devapps-vue make:module Customer --type=crud --ui=modal\n npx devapps-vue make:module Customer --type=crud --ui=page\n npx devapps-vue make:component CustomerCard\n npx devapps-vue make:page CustomerDashboard\n npx devapps-vue make:service Customer\n npx devapps-vue make:store Customer\n npx devapps-vue make:type Customer\n`);\n}\n\n// ─── main ────────────────────────────────────────────────────────────────────\n\nexport function run(argv: string[] = process.argv): void {\n const { command, args, flags } = parseArgs(argv);\n\n if (!command || flags[\"help\"]) {\n printHelp();\n return;\n }\n\n const name = args[0];\n\n if (!name && command !== \"--help\") {\n console.error(`\\n❌ Missing name argument for command: ${command}\\n`);\n printHelp();\n process.exit(1);\n }\n\n const force = flags[\"force\"] === true || flags[\"force\"] === \"true\";\n\n try {\n switch (command) {\n case \"make:module\":\n MakeModuleCommand(name!, {\n type: (flags[\"type\"] as ModuleType) ?? \"crud\",\n ui: (flags[\"ui\"] as UiMode) ?? \"modal\",\n force,\n });\n break;\n\n case \"make:component\":\n MakeComponentCommand(name!, { name: name!, force });\n break;\n\n case \"make:page\":\n MakePageCommand(name!, { name: name!, force });\n break;\n\n case \"make:service\":\n MakeServiceCommand(name!, { name: name!, force });\n break;\n\n case \"make:store\":\n MakeStoreCommand(name!, { name: name!, force });\n break;\n\n case \"make:type\":\n MakeTypeCommand(name!, { name: name!, force });\n break;\n\n default:\n console.error(`\\n❌ Unknown command: \"${command}\"\\n`);\n printHelp();\n process.exit(1);\n }\n } catch (err) {\n if (err instanceof Error) {\n console.error(`\\n❌ ${err.message}\\n`);\n } else {\n console.error(\"\\n❌ An unexpected error occurred.\\n\");\n }\n process.exit(1);\n }\n}\n"],"mappings":";AAaO,IAAM,aAAN,MAAM,YAAW;AAAA,EACL;AAAA,EAEjB,YAAY,OAAe;AACzB,gBAAW,WAAW,KAAK;AAC3B,SAAK,QAAQ,YAAW,MAAM,KAAK;AAEnC,QAAI,KAAK,MAAM,WAAW,GAAG;AAC3B,YAAM,IAAI,MAAM,yBAAyB,KAAK,GAAG;AAAA,IACnD;AAAA,EACF;AAAA;AAAA,EAGA,IAAI,aAAqB;AACvB,WAAO,KAAK,MAAM,IAAI,CAAC,MAAM,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE;AAAA,EACrD;AAAA;AAAA,EAGA,IAAI,YAAoB;AACtB,WAAO,KAAK,MACT,IAAI,CAAC,GAAG,MAAO,MAAM,IAAI,EAAE,YAAY,IAAI,WAAW,CAAC,CAAE,EACzD,KAAK,EAAE;AAAA,EACZ;AAAA;AAAA,EAGA,IAAI,YAAoB;AACtB,WAAO,KAAK,MAAM,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,KAAK,GAAG;AAAA,EACxD;AAAA;AAAA,EAGA,IAAI,YAAoB;AACtB,WAAO,KAAK,MAAM,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,KAAK,GAAG;AAAA,EACxD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YAAY,UAAU;AACjC,YAAQ,MAAM;AAAA,4CAA0C,OAAO;AAAA,CAAI;AACnE,cAAU;AACV,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,QAAM,QAAQ,MAAM,OAAO,MAAM,QAAQ,MAAM,OAAO,MAAM;AAE5D,MAAI;AACF,YAAQ,SAAS;AAAA,MACf,KAAK;AACH,0BAAkB,MAAO;AAAA,UACvB,MAAO,MAAM,MAAM,KAAoB;AAAA,UACvC,IAAK,MAAM,IAAI,KAAgB;AAAA,UAC/B;AAAA,QACF,CAAC;AACD;AAAA,MAEF,KAAK;AACH,6BAAqB,MAAO,EAAE,MAAa,MAAM,CAAC;AAClD;AAAA,MAEF,KAAK;AACH,wBAAgB,MAAO,EAAE,MAAa,MAAM,CAAC;AAC7C;AAAA,MAEF,KAAK;AACH,2BAAmB,MAAO,EAAE,MAAa,MAAM,CAAC;AAChD;AAAA,MAEF,KAAK;AACH,yBAAiB,MAAO,EAAE,MAAa,MAAM,CAAC;AAC9C;AAAA,MAEF,KAAK;AACH,wBAAgB,MAAO,EAAE,MAAa,MAAM,CAAC;AAC7C;AAAA,MAEF;AACE,gBAAQ,MAAM;AAAA,2BAAyB,OAAO;AAAA,CAAK;AACnD,kBAAU;AACV,gBAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACF,SAAS,KAAK;AACZ,QAAI,eAAe,OAAO;AACxB,cAAQ,MAAM;AAAA,SAAO,IAAI,OAAO;AAAA,CAAI;AAAA,IACtC,OAAO;AACL,cAAQ,MAAM,0CAAqC;AAAA,IACrD;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":["path","path"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devappsnpm/vue-kit",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Vue 3 toolkit for Laravel API applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",