@dawitworku/projectcli 0.2.2 → 3.0.0

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/src/registry.js CHANGED
@@ -1,909 +1,3 @@
1
- /**
2
- * Registry of (language -> framework -> generator).
3
- * Each generator provides:
4
- * - id: stable id
5
- * - label: display name
6
- * - commands: array of steps (each step is a program + args)
7
- * - notes: optional help text shown before running
8
- */
9
-
10
- function getProjectName(ctx) {
11
- return typeof ctx === "string" ? ctx : ctx?.projectName;
12
- }
13
-
14
- function getPackageManager(ctx) {
15
- const pm = typeof ctx === "object" ? ctx?.packageManager : undefined;
16
- return pm || "npm";
17
- }
18
-
19
- const { pmExecCommand, pmInstallCommand } = require("./pm");
20
-
21
- function pmExec(pm, pkg, pkgArgs, opts = {}) {
22
- const cmd = pmExecCommand(pm, pkg, pkgArgs);
23
- return { type: "command", ...cmd, ...opts };
24
- }
25
-
26
- function pmInstall(pm, opts = {}) {
27
- const cmd = pmInstallCommand(pm);
28
- return { type: "command", ...cmd, ...opts };
29
- }
30
-
31
- const REGISTRY = {
32
- JavaScript: {
33
- "Vite (Vanilla)": {
34
- id: "js.vite.vanilla",
35
- label: "Vite (Vanilla)",
36
- check: ["npm"],
37
- commands: (ctx) => {
38
- const projectName = getProjectName(ctx);
39
- const pm = getPackageManager(ctx);
40
- return [
41
- pmExec(pm, "create-vite@latest", [
42
- projectName,
43
- "--template",
44
- "vanilla",
45
- ]),
46
- pmInstall(pm, { cwdFromProjectRoot: true }),
47
- ];
48
- },
49
- notes: "Vite (JS)",
50
- },
51
- "Vite (React)": {
52
- id: "js.vite.react",
53
- label: "Vite (React)",
54
- commands: (ctx) => {
55
- const projectName = getProjectName(ctx);
56
- const pm = getPackageManager(ctx);
57
- return [
58
- pmExec(pm, "create-vite@latest", [
59
- projectName,
60
- "--template",
61
- "react",
62
- ]),
63
- pmInstall(pm, { cwdFromProjectRoot: true }),
64
- ];
65
- },
66
- notes: "Vite + React (JS)",
67
- },
68
- "Vite (Vue)": {
69
- id: "js.vite.vue",
70
- label: "Vite (Vue)",
71
- commands: (ctx) => {
72
- const projectName = getProjectName(ctx);
73
- const pm = getPackageManager(ctx);
74
- return [
75
- pmExec(pm, "create-vite@latest", [projectName, "--template", "vue"]),
76
- pmInstall(pm, { cwdFromProjectRoot: true }),
77
- ];
78
- },
79
- notes: "Vite + Vue (JS)",
80
- },
81
- "Vite (Svelte)": {
82
- id: "js.vite.svelte",
83
- label: "Vite (Svelte)",
84
- commands: (ctx) => {
85
- const projectName = getProjectName(ctx);
86
- const pm = getPackageManager(ctx);
87
- return [
88
- pmExec(pm, "create-vite@latest", [
89
- projectName,
90
- "--template",
91
- "svelte",
92
- ]),
93
- pmInstall(pm, { cwdFromProjectRoot: true }),
94
- ];
95
- },
96
- notes: "Vite + Svelte (JS)",
97
- },
98
- "Vite (Preact)": {
99
- id: "js.vite.preact",
100
- label: "Vite (Preact)",
101
- commands: (ctx) => {
102
- const projectName = getProjectName(ctx);
103
- const pm = getPackageManager(ctx);
104
- return [
105
- pmExec(pm, "create-vite@latest", [
106
- projectName,
107
- "--template",
108
- "preact",
109
- ]),
110
- pmInstall(pm, { cwdFromProjectRoot: true }),
111
- ];
112
- },
113
- notes: "Vite + Preact (JS)",
114
- },
115
- "Vite (Lit)": {
116
- id: "js.vite.lit",
117
- label: "Vite (Lit)",
118
- commands: (ctx) => {
119
- const projectName = getProjectName(ctx);
120
- const pm = getPackageManager(ctx);
121
- return [
122
- pmExec(pm, "create-vite@latest", [projectName, "--template", "lit"]),
123
- pmInstall(pm, { cwdFromProjectRoot: true }),
124
- ];
125
- },
126
- notes: "Vite + Lit (JS)",
127
- },
128
- "Next.js": {
129
- id: "js.nextjs",
130
- label: "Next.js",
131
- commands: (ctx) => {
132
- const projectName = getProjectName(ctx);
133
- const pm = getPackageManager(ctx);
134
- return [pmExec(pm, "create-next-app@latest", [projectName])];
135
- },
136
- notes: "Next.js app (wizard)",
137
- },
138
- Astro: {
139
- id: "js.astro",
140
- label: "Astro",
141
- commands: (ctx) => {
142
- const projectName = getProjectName(ctx);
143
- const pm = getPackageManager(ctx);
144
- return [pmExec(pm, "create-astro@latest", [projectName])];
145
- },
146
- notes: "Astro site (wizard)",
147
- },
148
- SvelteKit: {
149
- id: "js.sveltekit",
150
- label: "SvelteKit",
151
- commands: (ctx) => {
152
- const projectName = getProjectName(ctx);
153
- const pm = getPackageManager(ctx);
154
- return [pmExec(pm, "create-svelte@latest", [projectName])];
155
- },
156
- notes: "SvelteKit app (wizard)",
157
- },
158
- Remix: {
159
- id: "js.remix",
160
- label: "Remix",
161
- commands: (ctx) => {
162
- const projectName = getProjectName(ctx);
163
- const pm = getPackageManager(ctx);
164
- return [pmExec(pm, "create-remix@latest", [projectName])];
165
- },
166
- notes: "Remix app (wizard)",
167
- },
168
- Nuxt: {
169
- id: "js.nuxt",
170
- label: "Nuxt",
171
- commands: (ctx) => {
172
- const projectName = getProjectName(ctx);
173
- const pm = getPackageManager(ctx);
174
- return [
175
- pmExec(pm, "nuxi@latest", ["init", projectName]),
176
- pmInstall(pm, { cwdFromProjectRoot: true }),
177
- ];
178
- },
179
- notes: "Nuxt via nuxi init",
180
- },
181
- "Express (Generator)": {
182
- id: "js.express",
183
- label: "Express",
184
- commands: (ctx) => {
185
- const projectName = getProjectName(ctx);
186
- const pm = getPackageManager(ctx);
187
- return [
188
- pmExec(pm, "express-generator", [projectName]),
189
- pmInstall(pm, { cwdFromProjectRoot: true }),
190
- ];
191
- },
192
- notes: "Scaffolds basic Express app",
193
- },
194
- "Fastify (CLI)": {
195
- id: "js.fastify",
196
- label: "Fastify",
197
- commands: (ctx) => {
198
- const projectName = getProjectName(ctx);
199
- const pm = getPackageManager(ctx);
200
- return [
201
- pmExec(pm, "fastify-cli", ["generate", projectName]),
202
- pmInstall(pm, { cwdFromProjectRoot: true }),
203
- ];
204
- },
205
- notes: "Scaffolds Fastify app",
206
- },
207
- "React Native (Expo)": {
208
- id: "js.expo",
209
- label: "React Native (Expo)",
210
- commands: (ctx) => {
211
- const projectName = getProjectName(ctx);
212
- const pm = getPackageManager(ctx);
213
- // create-expo-app
214
- return [pmExec(pm, "create-expo-app@latest", [projectName])];
215
- },
216
- notes: "Expo for React Native",
217
- },
218
- "Electron (Forge)": {
219
- id: "js.electron",
220
- label: "Electron (Forge)",
221
- commands: (ctx) => {
222
- const projectName = getProjectName(ctx);
223
- const pm = getPackageManager(ctx);
224
- return [pmExec(pm, "create-electron-app@latest", [projectName])];
225
- },
226
- notes: "Electron Forge template",
227
- },
228
- "Qwik City": {
229
- id: "js.qwik",
230
- label: "Qwik City",
231
- commands: (ctx) => {
232
- const projectName = getProjectName(ctx);
233
- const pm = getPackageManager(ctx);
234
- return [pmExec(pm, "create-qwik@latest", ["basic", projectName])];
235
- },
236
- notes: "Qwik framework",
237
- },
238
- "Node.js (basic)": {
239
- id: "js.node.basic",
240
- label: "Node.js (basic)",
241
- commands: (ctx) => {
242
- const projectName = getProjectName(ctx);
243
- return [
244
- { type: "mkdir", path: "." },
245
- {
246
- type: "writeFile",
247
- path: "package.json",
248
- content: JSON.stringify(
249
- {
250
- name: projectName,
251
- version: "0.1.0",
252
- private: true,
253
- type: "commonjs",
254
- scripts: { start: "node index.js" },
255
- },
256
- null,
257
- 2
258
- ).concat("\n"),
259
- },
260
- {
261
- type: "writeFile",
262
- path: "index.js",
263
- content: "console.log('hello');\n",
264
- },
265
- {
266
- type: "writeFile",
267
- path: ".gitignore",
268
- content: "node_modules\n.DS_Store\n.env\n",
269
- },
270
- ];
271
- },
272
- notes: "No external generator required",
273
- },
274
- },
275
-
276
- TypeScript: {
277
- "Vite (React + TS)": {
278
- id: "ts.vite.react",
279
- label: "Vite (React + TS)",
280
- commands: (ctx) => {
281
- const projectName = getProjectName(ctx);
282
- const pm = getPackageManager(ctx);
283
- return [
284
- pmExec(pm, "create-vite@latest", [
285
- projectName,
286
- "--template",
287
- "react-ts",
288
- ]),
289
- pmInstall(pm, { cwdFromProjectRoot: true }),
290
- ];
291
- },
292
- notes: "Vite + React + TS",
293
- },
294
- "Vite (Vanilla + TS)": {
295
- id: "ts.vite.vanilla",
296
- label: "Vite (Vanilla + TS)",
297
- commands: (ctx) => {
298
- const projectName = getProjectName(ctx);
299
- const pm = getPackageManager(ctx);
300
- return [
301
- pmExec(pm, "create-vite@latest", [
302
- projectName,
303
- "--template",
304
- "vanilla-ts",
305
- ]),
306
- pmInstall(pm, { cwdFromProjectRoot: true }),
307
- ];
308
- },
309
- notes: "Vite + TypeScript",
310
- },
311
- "Vite (Vue + TS)": {
312
- id: "ts.vite.vue",
313
- label: "Vite (Vue + TS)",
314
- commands: (ctx) => {
315
- const projectName = getProjectName(ctx);
316
- const pm = getPackageManager(ctx);
317
- return [
318
- pmExec(pm, "create-vite@latest", [
319
- projectName,
320
- "--template",
321
- "vue-ts",
322
- ]),
323
- pmInstall(pm, { cwdFromProjectRoot: true }),
324
- ];
325
- },
326
- notes: "Vite + Vue + TypeScript",
327
- },
328
- "TanStack Start": {
329
- id: "ts.tanstack.start",
330
- label: "TanStack Start",
331
- commands: (ctx) => {
332
- const projectName = getProjectName(ctx);
333
- const pm = getPackageManager(ctx);
334
- // TanStack docs: npm/pnpm create @tanstack/start@latest
335
- // Running the package via pm exec is equivalent.
336
- return [pmExec(pm, "@tanstack/start@latest", [projectName])];
337
- },
338
- notes: "Full-stack React framework (wizard)",
339
- },
340
- NestJS: {
341
- id: "ts.nestjs",
342
- label: "NestJS",
343
- commands: (ctx) => {
344
- const projectName = getProjectName(ctx);
345
- const pm = getPackageManager(ctx);
346
- // Nest CLI is interactive; it may ask about package manager.
347
- return [pmExec(pm, "@nestjs/cli", ["new", projectName])];
348
- },
349
- notes: "Nest CLI (wizard)",
350
- },
351
- "Node.js (basic TS)": {
352
- id: "ts.node.basic",
353
- label: "Node.js (basic TS)",
354
- commands: (ctx) => {
355
- const projectName = getProjectName(ctx);
356
- const pm = getPackageManager(ctx);
357
- return [
358
- { type: "mkdir", path: "src" },
359
- {
360
- type: "writeFile",
361
- path: "package.json",
362
- content: JSON.stringify(
363
- {
364
- name: projectName,
365
- version: "0.1.0",
366
- private: true,
367
- type: "module",
368
- scripts: {
369
- build: "tsc -p tsconfig.json",
370
- start: "node dist/index.js",
371
- },
372
- devDependencies: {
373
- typescript: "^5.0.0",
374
- },
375
- },
376
- null,
377
- 2
378
- ).concat("\n"),
379
- },
380
- {
381
- type: "writeFile",
382
- path: "tsconfig.json",
383
- content: JSON.stringify(
384
- {
385
- compilerOptions: {
386
- target: "ES2022",
387
- module: "ES2022",
388
- outDir: "dist",
389
- strict: true,
390
- },
391
- include: ["src"],
392
- },
393
- null,
394
- 2
395
- ).concat("\n"),
396
- },
397
- {
398
- type: "writeFile",
399
- path: "src/index.ts",
400
- content: "console.log('hello');\n",
401
- },
402
- pmInstall(pm, { cwdFromProjectRoot: true }),
403
- ];
404
- },
405
- notes: "Writes files + installs TypeScript",
406
- },
407
- },
408
-
409
- Python: {
410
- Django: {
411
- id: "py.django",
412
- label: "Django",
413
- check: ["django-admin"],
414
- commands: (ctx) => {
415
- const projectName = getProjectName(ctx);
416
- return [
417
- {
418
- program: "django-admin",
419
- args: ["startproject", projectName],
420
- },
421
- ];
422
- },
423
- notes: "Requires django-admin on PATH (pip install django).",
424
- },
425
- Flask: {
426
- id: "py.flask.basic",
427
- label: "Flask (basic)",
428
- check: ["python3"],
429
- commands: (_ctx) => [
430
- { type: "mkdir", path: "." },
431
- {
432
- type: "writeFile",
433
- path: "app.py",
434
- content:
435
- "from flask import Flask\\n\\napp = Flask(__name__)\\n\\n@app.get('/')\\ndef hello():\\n return {'status': 'ok'}\\n\\nif __name__ == '__main__':\\n app.run(debug=True)\\n",
436
- },
437
- {
438
- type: "writeFile",
439
- path: "requirements.txt",
440
- content: "flask\\n",
441
- },
442
- {
443
- type: "writeFile",
444
- path: ".gitignore",
445
- content: ".venv\\n__pycache__\\n*.pyc\\n.DS_Store\\n",
446
- },
447
- ],
448
- notes: "Writes app.py + requirements.txt (no pip install).",
449
- },
450
- FastAPI: {
451
- id: "py.fastapi.basic",
452
- label: "FastAPI (basic)",
453
- commands: (_ctx) => [
454
- { type: "mkdir", path: "." },
455
- {
456
- type: "writeFile",
457
- path: "main.py",
458
- content:
459
- "from fastapi import FastAPI\\n\\napp = FastAPI()\\n\\n@app.get('/')\\ndef root():\\n return {'status': 'ok'}\\n",
460
- },
461
- {
462
- type: "writeFile",
463
- path: "requirements.txt",
464
- content: "fastapi\\nuvicorn\\n",
465
- },
466
- {
467
- type: "writeFile",
468
- path: "README.md",
469
- content:
470
- "# FastAPI app\\n\\nRun:\\n\\n- python -m venv .venv\\n- . .venv/bin/activate\\n- pip install -r requirements.txt\\n- uvicorn main:app --reload\\n",
471
- },
472
- {
473
- type: "writeFile",
474
- path: ".gitignore",
475
- content: ".venv\\n__pycache__\\n*.pyc\\n.DS_Store\\n",
476
- },
477
- ],
478
- notes: "Writes files only (no pip install).",
479
- },
480
- Pyramid: {
481
- id: "py.pyramid",
482
- label: "Pyramid",
483
- commands: (ctx) => {
484
- const projectName = getProjectName(ctx);
485
- return [
486
- { type: "mkdir", path: "." },
487
- {
488
- type: "writeFile",
489
- path: "requirements.txt",
490
- content: "pyramid\\nwaitress\\n",
491
- },
492
- {
493
- type: "writeFile",
494
- path: "app.py",
495
- content:
496
- "from wsgiref.simple_server import make_server\\nfrom pyramid.config import Configurator\\nfrom pyramid.response import Response\\n\\ndef hello_world(request):\\n return Response('Hello World!')\\n\\nif __name__ == '__main__':\\n with Configurator() as config:\\n config.add_route('hello', '/')\\n config.add_view(hello_world, route_name='hello')\\n app = config.make_wsgi_app()\\n server = make_server('0.0.0.0', 6543, app)\\n server.serve_forever()\\n",
497
- },
498
- ];
499
- },
500
- notes: "Pyramid basic app",
501
- },
502
- },
503
-
504
- Rust: {
505
- "Cargo (bin)": {
506
- id: "rs.cargo.bin",
507
- label: "Cargo (bin)",
508
- check: ["cargo"],
509
- commands: (ctx) => {
510
- const projectName = getProjectName(ctx);
511
- return [
512
- {
513
- program: "cargo",
514
- args: ["new", projectName],
515
- },
516
- ];
517
- },
518
- notes: "Uses cargo new",
519
- },
520
- "Cargo (lib)": {
521
- id: "rs.cargo.lib",
522
- label: "Cargo (lib)",
523
- check: ["cargo"],
524
- commands: (ctx) => {
525
- const projectName = getProjectName(ctx);
526
- return [
527
- {
528
- program: "cargo",
529
- args: ["new", "--lib", projectName],
530
- },
531
- ];
532
- },
533
- notes: "Uses cargo new --lib",
534
- },
535
- "Tauri (App)": {
536
- id: "rs.tauri",
537
- label: "Tauri (App)",
538
- commands: (ctx) => {
539
- const projectName = getProjectName(ctx);
540
- const pm = getPackageManager(ctx); // usually npm for tauri frontend
541
- return [pmExec(pm, "create-tauri-app@latest", [projectName])];
542
- },
543
- notes: "Cross-platform desktop app",
544
- },
545
- "Leptos (CSR)": {
546
- id: "rs.leptos",
547
- label: "Leptos (CSR)",
548
- commands: (ctx) => {
549
- const projectName = getProjectName(ctx);
550
- return [
551
- {
552
- program: "cargo",
553
- args: ["init", "--name", projectName],
554
- cwdFromProjectRoot: true,
555
- },
556
- ];
557
- },
558
- notes: "Init basic Rust project (Leptos needs template usually)",
559
- },
560
- },
561
-
562
- Go: {
563
- "Go module (basic)": {
564
- id: "go.module.basic",
565
- label: "Go module (basic)",
566
- check: ["go"],
567
- commands: (ctx) => {
568
- const projectName = getProjectName(ctx);
569
- return [
570
- {
571
- program: "go",
572
- args: ["mod", "init", projectName],
573
- cwdFromProjectRoot: true,
574
- },
575
- ];
576
- },
577
- notes: "Creates folder then runs go mod init",
578
- },
579
- "Go module (hello)": {
580
- id: "go.module.hello",
581
- label: "Go module (hello)",
582
- commands: (ctx) => {
583
- const projectName = getProjectName(ctx);
584
- return [
585
- { type: "mkdir", path: "." },
586
- {
587
- program: "go",
588
- args: ["mod", "init", projectName],
589
- cwdFromProjectRoot: true,
590
- },
591
- {
592
- type: "writeFile",
593
- path: "main.go",
594
- content:
595
- 'package main\\n\\nimport "fmt"\\n\\nfunc main() {\\n fmt.Println("hello")\\n}\\n',
596
- },
597
- ];
598
- },
599
- notes: "Writes main.go + runs go mod init",
600
- },
601
- "Buffalo (Web)": {
602
- id: "go.buffalo",
603
- label: "Buffalo (Web)",
604
- commands: (ctx) => {
605
- const projectName = getProjectName(ctx);
606
- return [
607
- {
608
- program: "buffalo",
609
- args: ["new", projectName],
610
- },
611
- ];
612
- },
613
- notes: "Requires 'buffalo' CLI installed",
614
- },
615
- "Fiber (Skeleton)": {
616
- id: "go.fiber",
617
- label: "Fiber (Skeleton)",
618
- commands: (_ctx) => [
619
- { type: "mkdir", path: "." },
620
- {
621
- type: "writeFile",
622
- path: "main.go",
623
- content: `package main
624
-
625
- import "github.com/gofiber/fiber/v2"
626
-
627
- func main() {
628
- app := fiber.New()
629
-
630
- app.Get("/", func(c *fiber.Ctx) error {
631
- return c.SendString("Hello, World!")
632
- })
633
-
634
- app.Listen(":3000")
635
- }
636
- `,
637
- },
638
- {
639
- program: "go",
640
- args: ["mod", "init", "fiber-app"],
641
- cwdFromProjectRoot: true,
642
- },
643
- {
644
- program: "go",
645
- args: ["get", "github.com/gofiber/fiber/v2"],
646
- cwdFromProjectRoot: true,
647
- },
648
- ],
649
- notes: "Basic Fiber setup",
650
- },
651
- },
652
-
653
- "C++": {
654
- "CMake (Basic)": {
655
- id: "cpp.cmake",
656
- label: "CMake (Basic)",
657
- commands: (ctx) => {
658
- const projectName = getProjectName(ctx);
659
- return [
660
- { type: "mkdir", path: "src" },
661
- {
662
- type: "writeFile",
663
- path: "CMakeLists.txt",
664
- content: `cmake_minimum_required(VERSION 3.10)
665
- project(${projectName})
666
-
667
- set(CMAKE_CXX_STANDARD 17)
668
-
669
- add_executable(${projectName} src/main.cpp)
670
- `,
671
- },
672
- {
673
- type: "writeFile",
674
- path: "src/main.cpp",
675
- content: `#include <iostream>
676
-
677
- int main() {
678
- std::cout << "Hello, World!" << std::endl;
679
- return 0;
680
- }
681
- `,
682
- },
683
- ];
684
- },
685
- notes: "Standard CMake structure",
686
- },
687
- },
688
-
689
- "C#": {
690
- ".NET console": {
691
- id: "cs.dotnet.console",
692
- label: ".NET console",
693
- commands: (ctx) => {
694
- const projectName = getProjectName(ctx);
695
- return [
696
- {
697
- program: "dotnet",
698
- args: ["new", "console", "-n", projectName],
699
- },
700
- ];
701
- },
702
- notes: "Requires dotnet SDK",
703
- },
704
- ".NET webapi": {
705
- id: "cs.dotnet.webapi",
706
- label: ".NET webapi",
707
- commands: (ctx) => {
708
- const projectName = getProjectName(ctx);
709
- return [
710
- {
711
- program: "dotnet",
712
- args: ["new", "webapi", "-n", projectName],
713
- },
714
- ];
715
- },
716
- notes: "Requires dotnet SDK",
717
- },
718
- },
719
-
720
- Ruby: {
721
- Rails: {
722
- id: "rb.rails",
723
- label: "Rails",
724
- commands: (ctx) => {
725
- const projectName = getProjectName(ctx);
726
- return [
727
- {
728
- program: "rails",
729
- args: ["new", projectName],
730
- },
731
- ];
732
- },
733
- notes: "Requires rails gem installed",
734
- },
735
- "Bundler (gem)": {
736
- id: "rb.bundler",
737
- label: "Bundler (new gem)",
738
- commands: (ctx) => {
739
- const projectName = getProjectName(ctx);
740
- return [
741
- {
742
- program: "bundle",
743
- args: ["gem", projectName],
744
- },
745
- ];
746
- },
747
- notes: "Creates a new gem with bundler",
748
- },
749
- },
750
-
751
- PHP: {
752
- Laravel: {
753
- id: "php.laravel",
754
- label: "Laravel",
755
- commands: (ctx) => {
756
- const projectName = getProjectName(ctx);
757
- return [
758
- {
759
- program: "composer",
760
- args: ["create-project", "laravel/laravel", projectName],
761
- },
762
- ];
763
- },
764
- notes: "Uses composer create-project",
765
- },
766
- Symfony: {
767
- id: "php.symfony",
768
- label: "Symfony",
769
- commands: (ctx) => {
770
- const projectName = getProjectName(ctx);
771
- return [
772
- {
773
- program: "composer",
774
- args: ["create-project", "symfony/skeleton", projectName],
775
- },
776
- ];
777
- },
778
- notes: "Uses composer create-project",
779
- },
780
- },
781
-
782
- "Java/Kotlin": {
783
- "Spring Boot (Maven)": {
784
- id: "java.springboot.maven",
785
- label: "Spring Boot (Maven)",
786
- commands: (ctx) => {
787
- const projectName = getProjectName(ctx);
788
- return [
789
- {
790
- program: "mvn",
791
- args: [
792
- "archetype:generate",
793
- "-DgroupId=com.example",
794
- `-DartifactId=${projectName}`,
795
- "-DarchetypeArtifactId=maven-archetype-quickstart",
796
- "-DinteractiveMode=false",
797
- ],
798
- },
799
- ];
800
- },
801
- notes: "Basic Maven Quickstart",
802
- },
803
- "Gradle (Basic)": {
804
- id: "java.gradle.basic",
805
- label: "Gradle (Basic)",
806
- commands: (ctx) => {
807
- const projectName = getProjectName(ctx);
808
- return [
809
- { type: "mkdir", path: projectName },
810
- {
811
- program: "gradle",
812
- args: [
813
- "init",
814
- "--type",
815
- "basic",
816
- "--dsl",
817
- "kotlin",
818
- "--project-name",
819
- projectName,
820
- ],
821
- cwd: projectName,
822
- cwdFromProjectRoot: true,
823
- },
824
- ];
825
- },
826
- notes: "Gradle init",
827
- },
828
- Quarkus: {
829
- id: "java.quarkus",
830
- label: "Quarkus",
831
- commands: (ctx) => {
832
- const projectName = getProjectName(ctx);
833
- return [
834
- {
835
- program: "mvn",
836
- args: [
837
- "io.quarkus.platform:quarkus-maven-plugin:create",
838
- `-DprojectGroupId=org.acme`,
839
- `-DprojectArtifactId=${projectName}`,
840
- ],
841
- },
842
- ];
843
- },
844
- notes: "Quarkus app (Maven)",
845
- },
846
- },
847
-
848
- Others: {
849
- "HTML/CSS": {
850
- id: "other.html",
851
- label: "HTML/CSS (Vanilla)",
852
- commands: (ctx) => {
853
- return [
854
- { type: "mkdir", path: "." },
855
- {
856
- type: "writeFile",
857
- path: "index.html",
858
- content:
859
- '<!DOCTYPE html>\\n<html lang="en">\\n<head>\\n <meta charset="UTF-8">\\n <title>My App</title>\\n</head>\\n<body>\\n <h1>Hello World</h1>\\n</body>\\n</html>',
860
- },
861
- {
862
- type: "writeFile",
863
- path: "style.css",
864
- content: "body { font-family: sans-serif; }",
865
- },
866
- ];
867
- },
868
- notes: "Just static files",
869
- },
870
- },
871
-
872
- Dart: {
873
- "Console Application": {
874
- id: "dart.console",
875
- label: "Console Application",
876
- commands: (ctx) => {
877
- const projectName = getProjectName(ctx);
878
- return [
879
- {
880
- program: "dart",
881
- args: ["create", "-t", "console", projectName],
882
- },
883
- ];
884
- },
885
- notes: "Requires Dart SDK",
886
- },
887
- },
888
- };
889
-
890
- function getLanguages() {
891
- return Object.keys(REGISTRY);
892
- }
893
-
894
- function getFrameworks(language) {
895
- return Object.keys(REGISTRY[language] || {});
896
- }
897
-
898
- function getGenerator(language, framework) {
899
- const lang = REGISTRY[language];
900
- if (!lang) return null;
901
- return lang[framework] || null;
902
- }
903
-
904
- module.exports = {
905
- REGISTRY,
906
- getLanguages,
907
- getFrameworks,
908
- getGenerator,
909
- };
1
+ // Backwards-compatible entrypoint for existing imports/tests.
2
+ // V3 registry wrapper includes legacy registry plus optional plugin additions.
3
+ module.exports = require("./registry/index");