@lenne.tech/cli 1.9.6 → 1.11.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.
Files changed (38) hide show
  1. package/README.md +88 -3
  2. package/build/commands/config/validate.js +2 -0
  3. package/build/commands/frontend/convert-mode.js +198 -0
  4. package/build/commands/fullstack/convert-mode.js +368 -0
  5. package/build/commands/fullstack/init.js +150 -4
  6. package/build/commands/fullstack/update.js +177 -0
  7. package/build/commands/server/add-property.js +29 -2
  8. package/build/commands/server/convert-mode.js +197 -0
  9. package/build/commands/server/create.js +41 -3
  10. package/build/commands/server/module.js +58 -25
  11. package/build/commands/server/object.js +26 -5
  12. package/build/commands/server/permissions.js +20 -6
  13. package/build/commands/server/test.js +7 -1
  14. package/build/commands/status.js +94 -3
  15. package/build/config/vendor-frontend-runtime-deps.json +4 -0
  16. package/build/config/vendor-runtime-deps.json +9 -0
  17. package/build/extensions/api-mode.js +19 -3
  18. package/build/extensions/frontend-helper.js +652 -0
  19. package/build/extensions/server.js +1475 -3
  20. package/build/lib/framework-detection.js +167 -0
  21. package/build/lib/frontend-framework-detection.js +129 -0
  22. package/build/templates/nest-server-module/inputs/template-create.input.ts.ejs +1 -1
  23. package/build/templates/nest-server-module/inputs/template.input.ts.ejs +1 -1
  24. package/build/templates/nest-server-module/outputs/template-fac-result.output.ts.ejs +1 -1
  25. package/build/templates/nest-server-module/template.controller.ts.ejs +1 -1
  26. package/build/templates/nest-server-module/template.model.ts.ejs +1 -1
  27. package/build/templates/nest-server-module/template.module.ts.ejs +1 -1
  28. package/build/templates/nest-server-module/template.resolver.ts.ejs +1 -1
  29. package/build/templates/nest-server-module/template.service.ts.ejs +1 -1
  30. package/build/templates/nest-server-object/template-create.input.ts.ejs +1 -1
  31. package/build/templates/nest-server-object/template.input.ts.ejs +1 -1
  32. package/build/templates/nest-server-object/template.object.ts.ejs +1 -1
  33. package/build/templates/nest-server-tests/tests.e2e-spec.ts.ejs +1 -1
  34. package/docs/LT-ECOSYSTEM-GUIDE.md +973 -0
  35. package/docs/VENDOR-MODE-WORKFLOW.md +471 -0
  36. package/docs/commands.md +196 -0
  37. package/docs/lt.config.md +9 -7
  38. package/package.json +17 -8
@@ -0,0 +1,471 @@
1
+ # Vendor-Mode Workflow — Step-by-Step
2
+
3
+ Praktische Anleitung für die Überführung eines lenne.tech Fullstack-Projekts vom **npm-Mode** in den **Vendor-Mode**, das Update und die optionale Rückführung.
4
+
5
+ **Kurz:** Im Vendor-Mode wird der Framework-Code (`@lenne.tech/nest-server`, `@lenne.tech/nuxt-extensions`) direkt ins Projekt kopiert (`src/core/` bzw. `app/core/`), statt via npm installiert.
6
+
7
+ > **Ausführliche Referenz**: Alle Commands und Hintergründe findest du im [LT-ECOSYSTEM-GUIDE](./LT-ECOSYSTEM-GUIDE.md).
8
+
9
+ ---
10
+
11
+ ## Inhaltsverzeichnis
12
+
13
+ - [Voraussetzungen](#voraussetzungen)
14
+ - [Teil 1: npm → Vendor überführen](#teil-1-npm--vendor-überführen)
15
+ - [Teil 2: Vendor-Mode updaten](#teil-2-vendor-mode-updaten)
16
+ - [Teil 3: Vendor → npm zurückführen](#teil-3-vendor--npm-zurückführen)
17
+ - [Troubleshooting](#troubleshooting)
18
+
19
+ ---
20
+
21
+ ## Voraussetzungen
22
+
23
+ Bevor du startest, stelle sicher:
24
+
25
+ | Check | Command |
26
+ |-------|---------|
27
+ | lt CLI installiert | `lt --version` |
28
+ | Claude Code mit lt-dev Plugin | `/lt-dev:plugin:check` |
29
+ | Projekt ist ein Fullstack-Monorepo | Verzeichnisse `projects/api/` und `projects/app/` existieren |
30
+ | Arbeitsverzeichnis ist clean | `git status` zeigt keine uncommitted changes |
31
+ | Du bist auf einem Feature-Branch | `git checkout -b feature/vendor-mode` |
32
+
33
+ ---
34
+
35
+ ## Teil 1: npm → Vendor überführen
36
+
37
+ ### Schritt 1: Status prüfen
38
+
39
+ **Command:**
40
+ ```bash
41
+ lt status
42
+ ```
43
+
44
+ **Was passiert:** Zeigt den aktuellen Framework-Modus für Backend und Frontend. Du erwartest jetzt `npm (@lenne.tech/nest-server dependency)` und `npm (@lenne.tech/nuxt-extensions dependency)`.
45
+
46
+ ---
47
+
48
+ ### Schritt 2: Dry-Run — Plan anzeigen
49
+
50
+ **Command (vom Monorepo-Root):**
51
+ ```bash
52
+ lt fullstack convert-mode --to vendor --dry-run
53
+ ```
54
+
55
+ **Was passiert:** Die CLI scannt `projects/api/` und `projects/app/`, erkennt die aktuellen Modi, und zeigt **was passieren würde**, ohne irgendetwas zu ändern. Prüfe die Ausgabe:
56
+ - Beide Subprojekte als `npm → vendor`
57
+ - Upstream-Versionen werden auto-detected aus den jeweiligen `package.json`
58
+
59
+ ---
60
+
61
+ ### Schritt 3: Konvertierung ausführen
62
+
63
+ **Command:**
64
+ ```bash
65
+ lt fullstack convert-mode --to vendor --noConfirm
66
+ ```
67
+
68
+ **Was passiert:**
69
+ 1. **Backend**: klont `@lenne.tech/nest-server` in `/tmp/`, kopiert `src/core/` + `src/index.ts` + `src/core.module.ts` + `src/test/` + `src/templates/` + `src/types/` + `LICENSE` nach `projects/api/src/core/`, wendet Flatten-Fix an (4 edge-case Dateien), schreibt alle Consumer-Imports von `@lenne.tech/nest-server` auf relative Pfade um, merged die upstream Dependencies dynamisch in `package.json`, konvertiert `express` Value-Imports zu Type-Imports (vendor-Kompatibilität), erzeugt `src/core/VENDOR.md`, prepended ein Vendor-Notice-Block in `CLAUDE.md`
70
+ 2. **Frontend**: klont `@lenne.tech/nuxt-extensions` in `/tmp/`, kopiert `src/module.ts` + `src/runtime/` nach `projects/app/app/core/`, ersetzt `'@lenne.tech/nuxt-extensions'` in `nuxt.config.ts` durch `'./app/core/module'`, schreibt die 4 expliziten Consumer-Imports um, entfernt den npm-Dependency, erzeugt `app/core/VENDOR.md`
71
+
72
+ Die Temp-Verzeichnisse in `/tmp/` werden automatisch bereinigt.
73
+
74
+ ---
75
+
76
+ ### Schritt 4: Abhängigkeiten neu installieren
77
+
78
+ **Command (vom Monorepo-Root):**
79
+ ```bash
80
+ pnpm install
81
+ ```
82
+
83
+ **Was passiert:** pnpm installiert die neu-gemergten Dependencies (die upstream vom Framework stammten) und entfernt `@lenne.tech/nest-server` bzw. `@lenne.tech/nuxt-extensions` aus `node_modules/`.
84
+
85
+ ---
86
+
87
+ ### Schritt 5: Backend validieren
88
+
89
+ **Commands:**
90
+ ```bash
91
+ cd projects/api
92
+ pnpm exec tsc --noEmit
93
+ pnpm run lint
94
+ pnpm test
95
+ cd ..
96
+ ```
97
+
98
+ **Was passiert:**
99
+ - `tsc --noEmit`: TypeScript-Check über den gesamten Backend-Code inkl. vendored `src/core/`. Erwartung: keine Fehler.
100
+ - `pnpm run lint`: oxlint über src/ + tests/. Erwartung: 0 errors.
101
+ - `pnpm test`: vitest e2e-Suite. Erwartung: alle Tests grün (initial können ~10 Min dauern wegen TypeScript-Transform der vendored Core).
102
+
103
+ ---
104
+
105
+ ### Schritt 6: Frontend validieren
106
+
107
+ **Commands:**
108
+ ```bash
109
+ cd projects/app
110
+ pnpm run lint
111
+ pnpm run build
112
+ cd ..
113
+ ```
114
+
115
+ **Was passiert:**
116
+ - `lint`: oxlint über app/. Erwartung: 0 errors.
117
+ - `build`: nuxt-Build durchläuft prepare → build → nitro output. Erwartung: `✨ Build complete!`
118
+
119
+ ---
120
+
121
+ ### Schritt 7: Status erneut prüfen
122
+
123
+ **Command:**
124
+ ```bash
125
+ lt status
126
+ ```
127
+
128
+ **Erwartete Ausgabe:**
129
+ ```
130
+ Monorepo Subprojects:
131
+ Backend: projects/api → vendor (src/core/, VENDOR.md)
132
+ Frontend: projects/app → vendor (app/core/, VENDOR.md)
133
+ ```
134
+
135
+ ---
136
+
137
+ ### Schritt 8: Änderungen committen
138
+
139
+ **Commands:**
140
+ ```bash
141
+ git add -A
142
+ git commit -m "chore: convert fullstack to vendor mode
143
+
144
+ - Backend: @lenne.tech/nest-server vendored into src/core/
145
+ - Frontend: @lenne.tech/nuxt-extensions vendored into app/core/
146
+ - Both VENDOR.md files track baseline + sync history"
147
+ ```
148
+
149
+ **Was passiert:** Der Commit enthält typischerweise ~500 neue Dateien (vendored core) und modifizierte Consumer-Imports.
150
+
151
+ ---
152
+
153
+ ## Teil 2: Vendor-Mode updaten
154
+
155
+ Nach der Überführung musst du dein Projekt weiterhin mit Upstream-Änderungen synchron halten. Im Vendor-Mode geschieht das **kuratiert** über Claude-Code-Agents.
156
+
157
+ ### Workflow A: Umfassendes Update (empfohlen)
158
+
159
+ **Command (in Claude Code):**
160
+ ```
161
+ /lt-dev:fullstack:update-all
162
+ ```
163
+
164
+ **Was passiert:**
165
+ 1. **Phase 1**: Erkennt Modi beider Subprojekte (vendor in diesem Fall)
166
+ 2. **Phase 2**: Generiert `UPDATE_PLAN.md` mit Version-Gaps und erwartet deine Zustimmung
167
+ 3. **Phase 3**: Backend-Sync via `nest-server-core-updater` Agent (clone upstream, diff, human-review, apply, flatten-fix reapply)
168
+ 4. **Phase 4**: Frontend-Sync via `nuxt-extensions-core-updater` Agent (clone upstream, diff, human-review, apply)
169
+ 5. **Phase 5**: Package-Maintenance via `npm-package-maintainer` (FULL MODE)
170
+ 6. **Phase 6**: `CLAUDE.md`-Sync aus den Upstream-Startern
171
+ 7. **Phase 7**: Cross-Validation (Build, Lint, Tests für beide Subprojekte)
172
+ 8. **Phase 8**: Final Report
173
+
174
+ ---
175
+
176
+ ### Workflow B: Nur Backend updaten
177
+
178
+ **Command:**
179
+ ```
180
+ /lt-dev:backend:update-nest-server-core
181
+ ```
182
+
183
+ **Was passiert:** Wie Phase 3 von Workflow A — synct `src/core/` mit Upstream-Änderungen.
184
+
185
+ ---
186
+
187
+ ### Workflow C: Nur Frontend updaten
188
+
189
+ **Command:**
190
+ ```
191
+ /lt-dev:frontend:update-nuxt-extensions-core
192
+ ```
193
+
194
+ **Was passiert:** Wie Phase 4 von Workflow A — synct `app/core/` mit Upstream-Änderungen.
195
+
196
+ ---
197
+
198
+ ### Workflow D: Sync auf spezifische Version
199
+
200
+ **Command:**
201
+ ```
202
+ /lt-dev:backend:update-nest-server-core --target 11.25.0
203
+ ```
204
+
205
+ **Was passiert:** Statt auf HEAD zu synchen, wird eine spezifische Upstream-Version gezogen. Gut für stabile Major/Minor-Releases.
206
+
207
+ ---
208
+
209
+ ### Freshness-Check
210
+
211
+ **Command (in beiden Subprojekten verfügbar):**
212
+ ```bash
213
+ cd projects/api # oder projects/app
214
+ pnpm run check:vendor-freshness
215
+ ```
216
+
217
+ **Was passiert:** Liest Baseline-Version aus `VENDOR.md` und vergleicht mit der aktuellen Version auf npm. Non-blocking Warning wenn eine neuere Version existiert. Wird automatisch von `pnpm run check` ausgeführt.
218
+
219
+ ---
220
+
221
+ ### Nach dem Update: Validation
222
+
223
+ **Command (vom Monorepo-Root):**
224
+ ```bash
225
+ pnpm run check
226
+ ```
227
+
228
+ **Was passiert:** Führt pro Subprojekt audit + format:check + lint + tests + build + server-start aus. Muss grün durchlaufen, bevor du den Update-Commit machst.
229
+
230
+ ---
231
+
232
+ ### Upstream-Contribution (optional)
233
+
234
+ Wenn du lokale Patches im vendored core gemacht hast, die **generell nützlich** sind (Bugfix, neue Feature, Type-Korrektur), kannst du sie als Upstream-PR vorbereiten:
235
+
236
+ **Backend-Patches:**
237
+ ```
238
+ /lt-dev:backend:contribute-nest-server-core
239
+ ```
240
+
241
+ **Frontend-Patches:**
242
+ ```
243
+ /lt-dev:frontend:contribute-nuxt-extensions-core
244
+ ```
245
+
246
+ **Was passiert:** Der Agent durchsucht `git log` seit der VENDOR.md-Baseline, filtert kosmetische Commits raus, kategorisiert substantielle Commits als `upstream-candidate` oder `project-specific`, cherry-picked die Kandidaten auf einen frischen Upstream-Branch, generiert einen PR-Body-Entwurf und zeigt dir die Summary. **Push erfolgt manuell von dir nach Review.**
247
+
248
+ ---
249
+
250
+ ## Teil 3: Vendor → npm zurückführen
251
+
252
+ Falls der Vendor-Mode für dein Projekt nicht funktioniert oder du wieder zur npm-Dependency zurück willst.
253
+
254
+ ### Schritt 1: Lokale Patches prüfen
255
+
256
+ **Command:**
257
+ ```bash
258
+ cat projects/api/src/core/VENDOR.md | grep -A 20 "## Local changes"
259
+ cat projects/app/app/core/VENDOR.md | grep -A 20 "## Local changes"
260
+ ```
261
+
262
+ **Was passiert:** Zeigt die Local-Changes-Tabelle aus beiden `VENDOR.md`-Dateien. **Wenn dort substantielle Patches gelistet sind, gehen diese bei der Rückführung verloren!**
263
+
264
+ ---
265
+
266
+ ### Schritt 2: Patches upstream beitragen (falls vorhanden)
267
+
268
+ **Empfehlung**: Bevor du zurückführst, beitrage die lokalen Patches:
269
+
270
+ ```
271
+ /lt-dev:backend:contribute-nest-server-core
272
+ /lt-dev:frontend:contribute-nuxt-extensions-core
273
+ ```
274
+
275
+ **Was passiert:** Siehe "Upstream-Contribution" oben. Nach Merge der Upstream-PRs kann die Rückführung ohne Datenverlust erfolgen.
276
+
277
+ ---
278
+
279
+ ### Schritt 3: Dry-Run — Plan anzeigen
280
+
281
+ **Command (vom Monorepo-Root):**
282
+ ```bash
283
+ lt fullstack convert-mode --to npm --dry-run
284
+ ```
285
+
286
+ **Was passiert:** Zeigt `vendor → npm` für beide Subprojekte. Die zu installierenden Versionen werden aus den `VENDOR.md`-Baselines gelesen.
287
+
288
+ ---
289
+
290
+ ### Schritt 4: Rückführung ausführen
291
+
292
+ **Command:**
293
+ ```bash
294
+ lt fullstack convert-mode --to npm --noConfirm
295
+ ```
296
+
297
+ **Was passiert:**
298
+ 1. **Backend**:
299
+ - Liest Baseline-Version aus `src/core/VENDOR.md`
300
+ - Warnt bei lokalen Patches in der "Local changes"-Tabelle
301
+ - Schreibt alle Consumer-Imports von relativen Pfaden zurück auf `@lenne.tech/nest-server`
302
+ - Löscht `src/core/`
303
+ - Stellt `@lenne.tech/nest-server` in `package.json` wieder her (mit Baseline-Version)
304
+ - Stellt `migrate:*` Scripts auf `node_modules/.bin/` zurück
305
+ - Entfernt Vendor-Artefakte: `bin/migrate.js`, `migrations-utils/ts-compiler.js`, `migration-guides/`
306
+ - Entfernt Vendor-Marker aus `CLAUDE.md`
307
+ 2. **Frontend**:
308
+ - Liest Baseline-Version aus `app/core/VENDOR.md`
309
+ - Schreibt die 4 expliziten Consumer-Imports zurück auf `@lenne.tech/nuxt-extensions`
310
+ - Löscht `app/core/`
311
+ - Stellt `@lenne.tech/nuxt-extensions` in `package.json` wieder her
312
+ - Schreibt `nuxt.config.ts` zurück: `'./app/core/module'` → `'@lenne.tech/nuxt-extensions'`
313
+ - Entfernt `check:vendor-freshness` Script
314
+ - Entfernt Vendor-Marker aus `CLAUDE.md`
315
+
316
+ ---
317
+
318
+ ### Schritt 5: Abhängigkeiten neu installieren
319
+
320
+ **Command:**
321
+ ```bash
322
+ pnpm install
323
+ ```
324
+
325
+ **Was passiert:** pnpm installiert `@lenne.tech/nest-server` und `@lenne.tech/nuxt-extensions` frisch aus dem npm-Registry.
326
+
327
+ ---
328
+
329
+ ### Schritt 6: Validieren
330
+
331
+ **Commands:**
332
+ ```bash
333
+ cd projects/api && pnpm exec tsc --noEmit && pnpm run lint && pnpm test && cd ..
334
+ cd projects/app && pnpm run lint && pnpm run build && cd ..
335
+ ```
336
+
337
+ **Was passiert:** Stellt sicher, dass alles nach der Rückführung immer noch funktioniert. `tsc` im Backend prüft ob die `@lenne.tech/nest-server` Types aus `node_modules/` jetzt gefunden werden. Frontend-Build prüft, dass Nuxt das Modul als npm-Dep lädt.
338
+
339
+ ---
340
+
341
+ ### Schritt 7: Status erneut prüfen
342
+
343
+ **Command:**
344
+ ```bash
345
+ lt status
346
+ ```
347
+
348
+ **Erwartete Ausgabe:**
349
+ ```
350
+ Monorepo Subprojects:
351
+ Backend: projects/api → npm (@lenne.tech/nest-server dependency)
352
+ Frontend: projects/app → npm (@lenne.tech/nuxt-extensions dependency)
353
+ ```
354
+
355
+ ---
356
+
357
+ ### Schritt 8: Änderungen committen
358
+
359
+ **Commands:**
360
+ ```bash
361
+ git add -A
362
+ git commit -m "chore: revert fullstack to npm mode
363
+
364
+ - Backend: back to @lenne.tech/nest-server X.Y.Z npm dependency
365
+ - Frontend: back to @lenne.tech/nuxt-extensions A.B.C npm dependency
366
+ - Vendored cores (src/core/, app/core/) removed"
367
+ ```
368
+
369
+ ---
370
+
371
+ ## Troubleshooting
372
+
373
+ ### Problem: `tsc` failed mit `new Error('msg', { cause })` Fehler
374
+
375
+ **Ursache:** TypeScript-Target ist zu alt (ES2020 oder niedriger).
376
+
377
+ **Fix:** In `projects/api/tsconfig.json` das Target auf `"es2022"` setzen:
378
+ ```json
379
+ {
380
+ "compilerOptions": {
381
+ "target": "es2022"
382
+ }
383
+ }
384
+ ```
385
+
386
+ ---
387
+
388
+ ### Problem: Vitest-Fehler `'express' does not provide an export named 'Response'`
389
+
390
+ **Ursache:** Im Vendor-Mode wird die TypeScript-Source der Core direkt von Vitest evaluiert. Value-Imports von TypeScript-type-only Exports brechen.
391
+
392
+ **Fix:** Sollte automatisch vom CLI gefixed worden sein. Falls nicht, in allen betroffenen Dateien:
393
+ ```typescript
394
+ // Vorher
395
+ import { Request, Response } from 'express';
396
+
397
+ // Nachher
398
+ import type { Request, Response } from 'express';
399
+ ```
400
+
401
+ ---
402
+
403
+ ### Problem: Konvertierung scheitert mit "Destination path already exists"
404
+
405
+ **Ursache:** Das Projekt hat bereits projektspezifische `bin/` oder `migration-guides/` Verzeichnisse, die mit Upstream-Inhalten kollidieren.
406
+
407
+ **Fix:** Inhalte sichern, Verzeichnisse löschen, Konvertierung erneut ausführen, Inhalte zurückkopieren.
408
+
409
+ ```bash
410
+ cp projects/api/bin/migrate.js /tmp/migrate-backup.js
411
+ cp -r projects/api/migration-guides /tmp/migration-guides-backup
412
+ rm -rf projects/api/bin projects/api/migration-guides
413
+ lt fullstack convert-mode --to vendor --noConfirm
414
+ # Nach Konvertierung:
415
+ mv /tmp/migration-guides-backup/MY-FILE.md projects/api/migration-guides/
416
+ ```
417
+
418
+ ---
419
+
420
+ ### Problem: Nach Konvertierung fehlen einige Consumer-Imports in der Rewrite
421
+
422
+ **Symptom:** `lt fullstack convert-mode` zeigt Warning wie `X file(s) still contain '@lenne.tech/nest-server' imports`.
423
+
424
+ **Fix:** Die gemeldeten Dateien manuell prüfen und Imports auf relative Pfade umschreiben. Die Warning zeigt die genauen Pfade an.
425
+
426
+ ---
427
+
428
+ ### Problem: Tests schlagen unter paralleler Last fehl (Flakiness)
429
+
430
+ **Ursache:** TypeScript-Source-Loading im Vendor-Mode ist langsamer als pre-compiled `dist/` — das deckt bestehende Timing-abhängige Test-Races auf.
431
+
432
+ **Fix-Optionen:**
433
+ - Einzelne flaky Tests robust machen (Retry-Pattern, Polling statt `setTimeout`)
434
+ - Als Workaround `retry: 3` in `vitest-e2e.config.ts` ist bereits aktiv
435
+ - Letzte Option: `poolOptions.forks.singleFork: true` (macht tests sequenziell — ~4× langsamer)
436
+
437
+ ---
438
+
439
+ ### Problem: Upstream-Sync findet Konflikte
440
+
441
+ **Symptom:** `/lt-dev:backend:update-nest-server-core` zeigt Konflikte zwischen Upstream-Änderung und lokalem Patch.
442
+
443
+ **Fix:** Der Agent pausiert und präsentiert die Konflikte. Du kannst:
444
+ - `approve all` — alle Upstream-Picks übernehmen (lokale Patches überschrieben)
445
+ - `approve clean` — nur konfliktfreie Picks
446
+ - `reject <file>` — spezifische Datei skippen
447
+ - `show <file>` — Hunk anzeigen
448
+ - `done` — mit aktueller Auswahl fortfahren
449
+
450
+ ---
451
+
452
+ ## Schnell-Referenz
453
+
454
+ | Aktion | Command |
455
+ |--------|---------|
456
+ | Status prüfen | `lt status` |
457
+ | Dry-Run npm→vendor | `lt fullstack convert-mode --to vendor --dry-run` |
458
+ | npm→vendor | `lt fullstack convert-mode --to vendor --noConfirm` |
459
+ | Vendor-Update | `/lt-dev:fullstack:update-all` |
460
+ | Backend-only Update | `/lt-dev:backend:update-nest-server-core` |
461
+ | Frontend-only Update | `/lt-dev:frontend:update-nuxt-extensions-core` |
462
+ | Freshness-Check | `pnpm run check:vendor-freshness` |
463
+ | Full Check | `pnpm run check` |
464
+ | Upstream-PR (Backend) | `/lt-dev:backend:contribute-nest-server-core` |
465
+ | Upstream-PR (Frontend) | `/lt-dev:frontend:contribute-nuxt-extensions-core` |
466
+ | Dry-Run vendor→npm | `lt fullstack convert-mode --to npm --dry-run` |
467
+ | vendor→npm | `lt fullstack convert-mode --to npm --noConfirm` |
468
+
469
+ ---
470
+
471
+ > **Weiterführend**: Architektur, Konzepte und Referenz aller CLI-/Plugin-Funktionen im [LT-ECOSYSTEM-GUIDE](./LT-ECOSYSTEM-GUIDE.md).
package/docs/commands.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This document provides a comprehensive reference for all `lt` CLI commands. For configuration file options, see [lt.config.md](./lt.config.md).
4
4
 
5
+ ## Related Documentation
6
+
7
+ - **[LT-ECOSYSTEM-GUIDE](./LT-ECOSYSTEM-GUIDE.md)** — Complete reference for `lt` CLI **and** the `lt-dev` Claude-Code Plugin including architecture, vendor-mode workflows, agents, and skills
8
+ - **[VENDOR-MODE-WORKFLOW](./VENDOR-MODE-WORKFLOW.md)** — Step-by-step guide for converting a project from npm mode to vendor mode, updating it, and optional rollback
9
+ - **[lt.config.md](./lt.config.md)** — Configuration file reference
10
+
5
11
  ## Table of Contents
6
12
 
7
13
  - [CLI Commands](#cli-commands)
@@ -202,6 +208,67 @@ lt server test
202
208
 
203
209
  ---
204
210
 
211
+ ### `lt server convert-mode`
212
+
213
+ Convert an existing API (NestJS) project between npm mode and vendor mode for `@lenne.tech/nest-server`.
214
+
215
+ **Usage:**
216
+ ```bash
217
+ lt server convert-mode --to <vendor|npm> [options]
218
+ ```
219
+
220
+ **Options:**
221
+ | Option | Description |
222
+ |--------|-------------|
223
+ | `--to <mode>` | Target mode: `vendor` or `npm` (required) |
224
+ | `--upstream-branch <ref>` | Upstream branch/tag to vendor from (only with `--to vendor`) |
225
+ | `--version <version>` | nest-server version to install (only with `--to npm`, default: from VENDOR.md baseline) |
226
+ | `--dry-run` | Show the resolved plan without making any changes |
227
+ | `--noConfirm` | Skip confirmation prompt |
228
+
229
+ **Behavior:**
230
+
231
+ - **npm → vendor:**
232
+ - Clones `@lenne.tech/nest-server` from GitHub at the specified tag (default: currently installed version)
233
+ - Copies `src/core/`, `src/index.ts`, `src/core.module.ts`, `src/test/`, `src/templates/`, `src/types/`, and `LICENSE` to `<api-root>/src/core/`
234
+ - Applies flatten-fix on `index.ts`, `core.module.ts`, `test.helper.ts`, `core-persistence-model.interface.ts`
235
+ - Rewrites all consumer imports from `'@lenne.tech/nest-server'` to relative paths
236
+ - Merges upstream dependencies dynamically into `package.json`
237
+ - Rewrites `migrate:*` scripts to use local `bin/migrate.js` with `ts-compiler.js` bootstrap
238
+ - Adds `check:vendor-freshness` script
239
+ - Creates `src/core/VENDOR.md` with baseline version + commit SHA
240
+ - Prepends a vendor-mode notice block to `CLAUDE.md`
241
+
242
+ - **vendor → npm:**
243
+ - Extracts baseline version from `src/core/VENDOR.md` (warns if local patches exist)
244
+ - Rewrites consumer imports back to `@lenne.tech/nest-server`
245
+ - Deletes `src/core/`
246
+ - Restores `@lenne.tech/nest-server` dependency in `package.json`
247
+ - Restores `migrate:*` scripts to `node_modules/.bin/` paths
248
+ - Removes vendor artifacts (`bin/`, `migrations-utils/ts-compiler.js`, `migration-guides/`) and `CLAUDE.md` marker
249
+
250
+ **Examples:**
251
+ ```bash
252
+ # Convert existing npm project to vendor mode at a specific version
253
+ cd projects/api
254
+ lt server convert-mode --to vendor --upstream-branch 11.24.3 --noConfirm
255
+
256
+ # Preview what the conversion would do
257
+ lt server convert-mode --to vendor --dry-run
258
+
259
+ # Convert vendored project back to npm with a specific version
260
+ lt server convert-mode --to npm --version 11.24.3 --noConfirm
261
+ ```
262
+
263
+ **Note:** nest-server tags have **no** `v` prefix — use e.g. `11.24.3`, not `v11.24.3`.
264
+
265
+ For mode-aware update workflows after conversion, use:
266
+ - `/lt-dev:backend:update-nest-server-core` (vendor mode)
267
+ - `/lt-dev:backend:update-nest-server` (npm mode)
268
+ - `/lt-dev:fullstack:update-all` (coordinated backend + frontend)
269
+
270
+ ---
271
+
205
272
  ## Git Commands
206
273
 
207
274
  All git commands support the `--noConfirm` flag and can be configured via `defaults.noConfirm` or `commands.git.noConfirm`.
@@ -462,6 +529,10 @@ lt fullstack init [options]
462
529
  | `--frontend-branch <branch>` | Branch of frontend starter to use (ng-base-starter or nuxt-base-starter) |
463
530
  | `--frontend-copy <path>` | Copy frontend from local template directory |
464
531
  | `--frontend-link <path>` | Symlink frontend to local template (fastest, changes affect original) |
532
+ | `--framework-mode <mode>` | Backend framework consumption mode: `npm` (classic) or `vendor` (pilot, core copied to `src/core/`) |
533
+ | `--framework-upstream-branch <ref>` | Upstream `nest-server` branch/tag to vendor from (only with `--framework-mode vendor`) |
534
+ | `--frontend-framework-mode <mode>` | Frontend framework consumption mode: `npm` or `vendor` (nuxt-extensions copied to `app/core/`) |
535
+ | `--dry-run` | Print the resolved plan without making any changes |
465
536
  | `--git` | Push initial commit to remote repository (git is always initialized) |
466
537
  | `--git-link <url>` | Git remote repository URL (required when `--git` is true) |
467
538
  | `--noConfirm` | Skip confirmation prompts |
@@ -485,6 +556,74 @@ Additionally, the API's `CLAUDE.md` is patched to reflect the selected API mode
485
556
 
486
557
  ---
487
558
 
559
+ ### `lt fullstack convert-mode`
560
+
561
+ Convert **both** backend (`projects/api/`) and frontend (`projects/app/`) of a fullstack monorepo between npm mode and vendor mode in a single command. Auto-detects the subprojects, shows the plan for each side, and orchestrates the backend + frontend conversions sequentially.
562
+
563
+ **Usage:**
564
+ ```bash
565
+ lt fullstack convert-mode --to <vendor|npm> [options]
566
+ ```
567
+
568
+ **Options:**
569
+ | Option | Description |
570
+ |--------|-------------|
571
+ | `--to <mode>` | Target mode: `vendor` or `npm` (required) |
572
+ | `--framework-upstream-branch <ref>` | Backend upstream branch/tag (only with `--to vendor`, e.g. `11.24.3`) |
573
+ | `--frontend-framework-upstream-branch <ref>` | Frontend upstream branch/tag (only with `--to vendor`, e.g. `1.5.3`) |
574
+ | `--framework-version <version>` | Backend nest-server version (only with `--to npm`, default: from `VENDOR.md` baseline) |
575
+ | `--frontend-framework-version <version>` | Frontend nuxt-extensions version (only with `--to npm`, default: from `VENDOR.md` baseline) |
576
+ | `--skip-backend` | Skip backend conversion (frontend only) |
577
+ | `--skip-frontend` | Skip frontend conversion (backend only) |
578
+ | `--dry-run` | Show the resolved plan without making any changes |
579
+ | `--noConfirm` | Skip confirmation prompt |
580
+
581
+ **Subproject Detection:**
582
+
583
+ The command searches for subprojects in this order:
584
+ - Backend: `projects/api/` → `packages/api/`
585
+ - Frontend: `projects/app/` → `packages/app/`
586
+
587
+ Subprojects that are already in the target mode or not found are gracefully skipped.
588
+
589
+ **Behavior:**
590
+
591
+ For each subproject that needs conversion:
592
+ - **Backend**: delegates to the same pipeline as `lt server convert-mode`
593
+ - **Frontend**: delegates to the same pipeline as `lt frontend convert-mode`
594
+ - **Failure isolation**: If backend fails, frontend still runs (unless `--dry-run`). Final summary lists per-subproject status.
595
+
596
+ **Examples:**
597
+ ```bash
598
+ # Convert both subprojects to vendor mode at current versions (auto-detected)
599
+ cd my-monorepo
600
+ lt fullstack convert-mode --to vendor --noConfirm
601
+
602
+ # Convert to vendor with explicit versions
603
+ lt fullstack convert-mode --to vendor \
604
+ --framework-upstream-branch 11.24.3 \
605
+ --frontend-framework-upstream-branch 1.5.3 \
606
+ --noConfirm
607
+
608
+ # Preview the plan without changes
609
+ lt fullstack convert-mode --to vendor --dry-run
610
+
611
+ # Convert back to npm (preserves local patches by warning before execution)
612
+ lt fullstack convert-mode --to npm --noConfirm
613
+
614
+ # Only convert backend (frontend stays as-is)
615
+ lt fullstack convert-mode --to vendor --skip-frontend --noConfirm
616
+ ```
617
+
618
+ **Note:** nest-server tags use **no** `v` prefix (e.g. `11.24.3`). nuxt-extensions tags also use **no** `v` prefix (e.g. `1.5.3`).
619
+
620
+ For mode-aware update workflows after conversion, use:
621
+ - `/lt-dev:fullstack:update-all` (comprehensive, mode-aware)
622
+ - `/lt-dev:backend:update-nest-server-core` (backend vendor mode)
623
+ - `/lt-dev:frontend:update-nuxt-extensions-core` (frontend vendor mode)
624
+
625
+ ---
626
+
488
627
  ## Deployment Commands
489
628
 
490
629
  ### `lt deployment create`
@@ -593,6 +732,63 @@ lt frontend nuxt --copy /path/to/nuxt-base-starter/nuxt-base-template
593
732
 
594
733
  ---
595
734
 
735
+ ### `lt frontend convert-mode`
736
+
737
+ Convert an existing frontend (Nuxt) project between npm mode and vendor mode for `@lenne.tech/nuxt-extensions`.
738
+
739
+ **Usage:**
740
+ ```bash
741
+ lt frontend convert-mode --to <vendor|npm> [options]
742
+ ```
743
+
744
+ **Options:**
745
+ | Option | Description |
746
+ |--------|-------------|
747
+ | `--to <mode>` | Target mode: `vendor` or `npm` (required) |
748
+ | `--upstream-branch <ref>` | Upstream branch/tag to vendor from (only with `--to vendor`) |
749
+ | `--version <version>` | nuxt-extensions version to install (only with `--to npm`, default: from VENDOR.md baseline) |
750
+ | `--dry-run` | Show the resolved plan without making any changes |
751
+ | `--noConfirm` | Skip confirmation prompt |
752
+
753
+ **Behavior:**
754
+
755
+ - **npm → vendor:**
756
+ - Clones `@lenne.tech/nuxt-extensions` from GitHub at the specified tag (default: currently installed version)
757
+ - Copies `src/module.ts`, `src/index.ts`, `src/runtime/`, and `LICENSE` to `<app-root>/app/core/`
758
+ - Rewrites `nuxt.config.ts` module entry from `'@lenne.tech/nuxt-extensions'` to `'./app/core/module'`
759
+ - Rewrites explicit consumer imports in `app/**/*.{ts,vue}` and `tests/**/*.ts` to relative paths
760
+ - Removes `@lenne.tech/nuxt-extensions` from `package.json` dependencies
761
+ - Merges upstream runtime dependencies (e.g. `@nuxt/kit`)
762
+ - Adds `check:vendor-freshness` script
763
+ - Creates `app/core/VENDOR.md` with baseline version + commit SHA
764
+ - Prepends a vendor-mode notice block to `CLAUDE.md`
765
+
766
+ - **vendor → npm:**
767
+ - Extracts baseline version from `app/core/VENDOR.md` (warns if local patches exist)
768
+ - Rewrites consumer imports back to `@lenne.tech/nuxt-extensions`
769
+ - Deletes `app/core/`
770
+ - Restores `@lenne.tech/nuxt-extensions` dependency in `package.json`
771
+ - Rewrites `nuxt.config.ts` module entry back
772
+ - Removes vendor scripts and `CLAUDE.md` marker
773
+
774
+ **Examples:**
775
+ ```bash
776
+ # Convert existing npm project to vendor mode at a specific version
777
+ cd projects/app
778
+ lt frontend convert-mode --to vendor --upstream-branch 1.5.3 --noConfirm
779
+
780
+ # Convert vendored project back to npm with a specific version
781
+ lt frontend convert-mode --to npm --version 1.5.3 --noConfirm
782
+ ```
783
+
784
+ **Note:** nuxt-extensions tags have **no** `v` prefix — use e.g. `1.5.3`, not `v1.5.3`.
785
+
786
+ For mode-aware update workflows after conversion, use:
787
+ - `/lt-dev:frontend:update-nuxt-extensions-core` (vendor mode)
788
+ - `/lt-dev:fullstack:update-all` (coordinated backend + frontend)
789
+
790
+ ---
791
+
596
792
  ## Config Commands
597
793
 
598
794
  ### `lt config init`