@lenne.tech/cli 1.10.0 → 1.11.1

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.
@@ -0,0 +1,471 @@
1
+ # Vendor-Mode Workflow — Step-by-Step
2
+
3
+ Practical guide for converting a lenne.tech fullstack project from **npm mode** to **vendor mode**, updating it, and optionally rolling back.
4
+
5
+ **In short:** In vendor mode the framework code (`@lenne.tech/nest-server`, `@lenne.tech/nuxt-extensions`) is copied directly into the project (`src/core/` and `app/core/`) instead of being installed via npm.
6
+
7
+ > **Complete reference**: All commands and background information can be found in the [LT-ECOSYSTEM-GUIDE](./LT-ECOSYSTEM-GUIDE.md).
8
+
9
+ ---
10
+
11
+ ## Table of Contents
12
+
13
+ - [Prerequisites](#prerequisites)
14
+ - [Part 1: Convert npm → vendor](#part-1-convert-npm--vendor)
15
+ - [Part 2: Update in vendor mode](#part-2-update-in-vendor-mode)
16
+ - [Part 3: Roll back vendor → npm](#part-3-roll-back-vendor--npm)
17
+ - [Troubleshooting](#troubleshooting)
18
+
19
+ ---
20
+
21
+ ## Prerequisites
22
+
23
+ Before you start, make sure:
24
+
25
+ | Check | Command |
26
+ |-------|---------|
27
+ | lt CLI installed | `lt --version` |
28
+ | Claude Code with lt-dev plugin | `/lt-dev:plugin:check` |
29
+ | Project is a fullstack monorepo | Directories `projects/api/` and `projects/app/` exist |
30
+ | Working tree is clean | `git status` shows no uncommitted changes |
31
+ | You are on a feature branch | `git checkout -b feature/vendor-mode` |
32
+
33
+ ---
34
+
35
+ ## Part 1: Convert npm → vendor
36
+
37
+ ### Step 1: Check status
38
+
39
+ **Command:**
40
+ ```bash
41
+ lt status
42
+ ```
43
+
44
+ **What happens:** Shows the current framework mode for backend and frontend. You expect to see `npm (@lenne.tech/nest-server dependency)` and `npm (@lenne.tech/nuxt-extensions dependency)`.
45
+
46
+ ---
47
+
48
+ ### Step 2: Dry-run — show plan
49
+
50
+ **Command (from monorepo root):**
51
+ ```bash
52
+ lt fullstack convert-mode --to vendor --dry-run
53
+ ```
54
+
55
+ **What happens:** The CLI scans `projects/api/` and `projects/app/`, detects the current modes, and shows **what would happen** without making any changes. Verify the output:
56
+ - Both subprojects as `npm → vendor`
57
+ - Upstream versions are auto-detected from the respective `package.json` files
58
+
59
+ ---
60
+
61
+ ### Step 3: Run the conversion
62
+
63
+ **Command:**
64
+ ```bash
65
+ lt fullstack convert-mode --to vendor --noConfirm
66
+ ```
67
+
68
+ **What happens:**
69
+ 1. **Backend**: clones `@lenne.tech/nest-server` into `/tmp/`, copies `src/core/` + `src/index.ts` + `src/core.module.ts` + `src/test/` + `src/templates/` + `src/types/` + `LICENSE` into `projects/api/src/core/`, applies the flatten-fix (4 edge-case files), rewrites all consumer imports from `@lenne.tech/nest-server` to relative paths, merges upstream dependencies dynamically into `package.json`, converts `express` value-imports to type-imports (vendor compatibility), creates `src/core/VENDOR.md`, prepends a vendor-notice block to `CLAUDE.md`
70
+ 2. **Frontend**: clones `@lenne.tech/nuxt-extensions` into `/tmp/`, copies `src/module.ts` + `src/runtime/` into `projects/app/app/core/`, replaces `'@lenne.tech/nuxt-extensions'` in `nuxt.config.ts` with `'./app/core/module'`, rewrites the 4 explicit consumer imports, removes the npm dependency, creates `app/core/VENDOR.md`
71
+
72
+ The temp directories in `/tmp/` are cleaned up automatically.
73
+
74
+ ---
75
+
76
+ ### Step 4: Reinstall dependencies
77
+
78
+ **Command (from monorepo root):**
79
+ ```bash
80
+ pnpm install
81
+ ```
82
+
83
+ **What happens:** pnpm installs the newly merged dependencies (that transitively came from the framework) and removes `@lenne.tech/nest-server` and `@lenne.tech/nuxt-extensions` from `node_modules/`.
84
+
85
+ ---
86
+
87
+ ### Step 5: Validate backend
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
+ **What happens:**
99
+ - `tsc --noEmit`: TypeScript check over the entire backend code including the vendored `src/core/`. Expectation: no errors.
100
+ - `pnpm run lint`: oxlint over src/ + tests/. Expectation: 0 errors.
101
+ - `pnpm test`: vitest e2e suite. Expectation: all tests green (initial run may take ~10 min due to TypeScript transform of the vendored core).
102
+
103
+ ---
104
+
105
+ ### Step 6: Validate frontend
106
+
107
+ **Commands:**
108
+ ```bash
109
+ cd projects/app
110
+ pnpm run lint
111
+ pnpm run build
112
+ cd ..
113
+ ```
114
+
115
+ **What happens:**
116
+ - `lint`: oxlint over app/. Expectation: 0 errors.
117
+ - `build`: Nuxt build runs prepare → build → nitro output. Expectation: `✨ Build complete!`
118
+
119
+ ---
120
+
121
+ ### Step 7: Check status again
122
+
123
+ **Command:**
124
+ ```bash
125
+ lt status
126
+ ```
127
+
128
+ **Expected output:**
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
+ ### Step 8: Commit changes
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
+ **What happens:** The commit typically contains ~500 new files (vendored core) and modified consumer imports.
150
+
151
+ ---
152
+
153
+ ## Part 2: Update in vendor mode
154
+
155
+ After the conversion you still need to keep your project in sync with upstream changes. In vendor mode this happens **curated** via Claude Code agents.
156
+
157
+ ### Workflow A: Comprehensive update (recommended)
158
+
159
+ **Command (in Claude Code):**
160
+ ```
161
+ /lt-dev:fullstack:update-all
162
+ ```
163
+
164
+ **What happens:**
165
+ 1. **Phase 1**: Detects the modes of both subprojects (vendor in this case)
166
+ 2. **Phase 2**: Generates `UPDATE_PLAN.md` with version gaps and waits for your approval
167
+ 3. **Phase 3**: Backend sync via `nest-server-core-updater` agent (clone upstream, diff, human review, apply, reapply flatten-fix)
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 from upstream starters
171
+ 7. **Phase 7**: Cross-validation (build, lint, tests for both subprojects)
172
+ 8. **Phase 8**: Final report
173
+
174
+ ---
175
+
176
+ ### Workflow B: Update backend only
177
+
178
+ **Command:**
179
+ ```
180
+ /lt-dev:backend:update-nest-server-core
181
+ ```
182
+
183
+ **What happens:** Same as Phase 3 of Workflow A — syncs `src/core/` with upstream changes.
184
+
185
+ ---
186
+
187
+ ### Workflow C: Update frontend only
188
+
189
+ **Command:**
190
+ ```
191
+ /lt-dev:frontend:update-nuxt-extensions-core
192
+ ```
193
+
194
+ **What happens:** Same as Phase 4 of Workflow A — syncs `app/core/` with upstream changes.
195
+
196
+ ---
197
+
198
+ ### Workflow D: Sync to a specific version
199
+
200
+ **Command:**
201
+ ```
202
+ /lt-dev:backend:update-nest-server-core --target 11.25.0
203
+ ```
204
+
205
+ **What happens:** Instead of syncing to HEAD, a specific upstream version is pulled. Useful for stable major/minor releases.
206
+
207
+ ---
208
+
209
+ ### Freshness check
210
+
211
+ **Command (available in both subprojects):**
212
+ ```bash
213
+ cd projects/api # or projects/app
214
+ pnpm run check:vendor-freshness
215
+ ```
216
+
217
+ **What happens:** Reads the baseline version from `VENDOR.md` and compares it with the current version on npm. Non-blocking warning if a newer version exists. Automatically executed by `pnpm run check`.
218
+
219
+ ---
220
+
221
+ ### After the update: validation
222
+
223
+ **Command (from monorepo root):**
224
+ ```bash
225
+ pnpm run check
226
+ ```
227
+
228
+ **What happens:** Runs audit + format:check + lint + tests + build + server-start per subproject. Must pass green before you commit the update.
229
+
230
+ ---
231
+
232
+ ### Upstream contribution (optional)
233
+
234
+ If you have made local patches in the vendored core that are **generally useful** (bugfix, new feature, type correction), you can prepare them as upstream PRs:
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
+ **What happens:** The agent scans `git log` since the VENDOR.md baseline, filters out cosmetic commits, categorizes substantial commits as `upstream-candidate` or `project-specific`, cherry-picks the candidates onto a fresh upstream branch, generates a PR body draft, and shows you a summary. **The push is done manually by you after review.**
247
+
248
+ ---
249
+
250
+ ## Part 3: Roll back vendor → npm
251
+
252
+ In case vendor mode doesn't work for your project or you want to go back to the npm dependency.
253
+
254
+ ### Step 1: Check local patches
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
+ **What happens:** Shows the "Local changes" table from both `VENDOR.md` files. **If substantial patches are listed there, they will be lost during the rollback!**
263
+
264
+ ---
265
+
266
+ ### Step 2: Contribute patches upstream (if any)
267
+
268
+ **Recommendation**: Before rolling back, contribute the local patches:
269
+
270
+ ```
271
+ /lt-dev:backend:contribute-nest-server-core
272
+ /lt-dev:frontend:contribute-nuxt-extensions-core
273
+ ```
274
+
275
+ **What happens:** See "Upstream contribution" above. After merging the upstream PRs the rollback can happen without data loss.
276
+
277
+ ---
278
+
279
+ ### Step 3: Dry-run — show plan
280
+
281
+ **Command (from monorepo root):**
282
+ ```bash
283
+ lt fullstack convert-mode --to npm --dry-run
284
+ ```
285
+
286
+ **What happens:** Shows `vendor → npm` for both subprojects. The versions to install are read from the `VENDOR.md` baselines.
287
+
288
+ ---
289
+
290
+ ### Step 4: Run the rollback
291
+
292
+ **Command:**
293
+ ```bash
294
+ lt fullstack convert-mode --to npm --noConfirm
295
+ ```
296
+
297
+ **What happens:**
298
+ 1. **Backend**:
299
+ - Reads the baseline version from `src/core/VENDOR.md`
300
+ - Warns about local patches in the "Local changes" table
301
+ - Rewrites all consumer imports from relative paths back to `@lenne.tech/nest-server`
302
+ - Deletes `src/core/`
303
+ - Restores `@lenne.tech/nest-server` in `package.json` (with baseline version)
304
+ - Restores `migrate:*` scripts to `node_modules/.bin/`
305
+ - Removes vendor artifacts: `bin/migrate.js`, `migrations-utils/ts-compiler.js`, `migration-guides/`
306
+ - Removes the vendor marker from `CLAUDE.md`
307
+ 2. **Frontend**:
308
+ - Reads the baseline version from `app/core/VENDOR.md`
309
+ - Rewrites the 4 explicit consumer imports back to `@lenne.tech/nuxt-extensions`
310
+ - Deletes `app/core/`
311
+ - Restores `@lenne.tech/nuxt-extensions` in `package.json`
312
+ - Rewrites `nuxt.config.ts`: `'./app/core/module'` → `'@lenne.tech/nuxt-extensions'`
313
+ - Removes the `check:vendor-freshness` script
314
+ - Removes the vendor marker from `CLAUDE.md`
315
+
316
+ ---
317
+
318
+ ### Step 5: Reinstall dependencies
319
+
320
+ **Command:**
321
+ ```bash
322
+ pnpm install
323
+ ```
324
+
325
+ **What happens:** pnpm installs `@lenne.tech/nest-server` and `@lenne.tech/nuxt-extensions` freshly from the npm registry.
326
+
327
+ ---
328
+
329
+ ### Step 6: Validate
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
+ **What happens:** Makes sure everything still works after the rollback. `tsc` in the backend verifies that the `@lenne.tech/nest-server` types from `node_modules/` are now found. The frontend build verifies that Nuxt loads the module as an npm dependency.
338
+
339
+ ---
340
+
341
+ ### Step 7: Check status again
342
+
343
+ **Command:**
344
+ ```bash
345
+ lt status
346
+ ```
347
+
348
+ **Expected output:**
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
+ ### Step 8: Commit changes
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` fails with `new Error('msg', { cause })` error
374
+
375
+ **Cause:** TypeScript target is too old (ES2020 or lower).
376
+
377
+ **Fix:** In `projects/api/tsconfig.json` set the target to `"es2022"`:
378
+ ```json
379
+ {
380
+ "compilerOptions": {
381
+ "target": "es2022"
382
+ }
383
+ }
384
+ ```
385
+
386
+ ---
387
+
388
+ ### Problem: Vitest error `'express' does not provide an export named 'Response'`
389
+
390
+ **Cause:** In vendor mode the TypeScript source of the core is evaluated directly by vitest. Value-imports of TypeScript type-only exports break.
391
+
392
+ **Fix:** Should have been fixed automatically by the CLI. If not, update all affected files:
393
+ ```typescript
394
+ // Before
395
+ import { Request, Response } from 'express';
396
+
397
+ // After
398
+ import type { Request, Response } from 'express';
399
+ ```
400
+
401
+ ---
402
+
403
+ ### Problem: Conversion fails with "Destination path already exists"
404
+
405
+ **Cause:** The project already has project-specific `bin/` or `migration-guides/` directories that collide with upstream contents.
406
+
407
+ **Fix:** Back up the contents, delete the directories, run the conversion again, copy the contents back.
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
+ # After conversion:
415
+ mv /tmp/migration-guides-backup/MY-FILE.md projects/api/migration-guides/
416
+ ```
417
+
418
+ ---
419
+
420
+ ### Problem: Some consumer imports missing from the rewrite after conversion
421
+
422
+ **Symptom:** `lt fullstack convert-mode` shows a warning like `X file(s) still contain '@lenne.tech/nest-server' imports`.
423
+
424
+ **Fix:** Manually check the reported files and rewrite the imports to relative paths. The warning shows the exact paths.
425
+
426
+ ---
427
+
428
+ ### Problem: Tests fail under parallel load (flakiness)
429
+
430
+ **Cause:** TypeScript source loading in vendor mode is slower than pre-compiled `dist/` — this exposes existing timing-sensitive test races.
431
+
432
+ **Fix options:**
433
+ - Make individual flaky tests robust (retry pattern, polling instead of `setTimeout`)
434
+ - As a workaround, `retry: 3` is already active in `vitest-e2e.config.ts`
435
+ - Last resort: `poolOptions.forks.singleFork: true` (makes tests sequential — ~4× slower)
436
+
437
+ ---
438
+
439
+ ### Problem: Upstream sync finds conflicts
440
+
441
+ **Symptom:** `/lt-dev:backend:update-nest-server-core` shows conflicts between upstream changes and local patches.
442
+
443
+ **Fix:** The agent pauses and presents the conflicts. You can:
444
+ - `approve all` — take all upstream picks (local patches overwritten)
445
+ - `approve clean` — only conflict-free picks
446
+ - `reject <file>` — skip a specific file
447
+ - `show <file>` — render the hunk
448
+ - `done` — proceed with current selection
449
+
450
+ ---
451
+
452
+ ## Quick Reference
453
+
454
+ | Action | Command |
455
+ |--------|---------|
456
+ | Check status | `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
+ > **Further reading**: Architecture, concepts, and reference for all CLI and plugin functions in the [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`