@lenne.tech/cli 1.11.0 → 1.12.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/build/commands/claude/shortcuts.js +5 -0
- package/build/commands/fullstack/init.js +21 -0
- package/build/commands/fullstack/update.js +1 -4
- package/build/commands/git/reset.js +2 -2
- package/build/commands/git/update.js +3 -3
- package/build/commands/server/add-property.js +1 -3
- package/build/commands/server/module.js +1 -1
- package/build/config/vendor-runtime-deps.json +1 -5
- package/build/extensions/api-mode.js +123 -5
- package/build/extensions/frontend-helper.js +59 -32
- package/build/extensions/git.js +4 -5
- package/build/extensions/server.js +80 -42
- package/build/lib/frontend-framework-detection.js +1 -2
- package/build/lib/hoist-workspace-pnpm-config.js +97 -0
- package/build/lib/markdown-table.js +33 -0
- package/docs/LT-ECOSYSTEM-GUIDE.md +378 -379
- package/docs/VENDOR-MODE-WORKFLOW.md +223 -150
- package/docs/commands.md +1 -1
- package/package.json +17 -9
|
@@ -1,90 +1,163 @@
|
|
|
1
1
|
# Vendor-Mode Workflow — Step-by-Step
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Practical guide for converting a lenne.tech fullstack project from **npm mode** to **vendor mode**, updating it, and optionally rolling back.
|
|
4
4
|
|
|
5
|
-
**
|
|
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
6
|
|
|
7
|
-
> **
|
|
7
|
+
> **Complete reference**: All commands and background information can be found in the [LT-ECOSYSTEM-GUIDE](./LT-ECOSYSTEM-GUIDE.md).
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Table of Contents
|
|
12
12
|
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
16
|
-
- [
|
|
13
|
+
- [Prerequisites](#prerequisites)
|
|
14
|
+
- [Vendor Modification Policy](#vendor-modification-policy)
|
|
15
|
+
- [Part 1: Convert npm → vendor](#part-1-convert-npm--vendor)
|
|
16
|
+
- [Part 2: Update in vendor mode](#part-2-update-in-vendor-mode)
|
|
17
|
+
- [Part 3: Roll back vendor → npm](#part-3-roll-back-vendor--npm)
|
|
17
18
|
- [Troubleshooting](#troubleshooting)
|
|
18
19
|
|
|
19
20
|
---
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
+
## Prerequisites
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
Before you start, make sure:
|
|
24
25
|
|
|
25
26
|
| Check | Command |
|
|
26
27
|
|-------|---------|
|
|
27
|
-
| lt CLI
|
|
28
|
-
| Claude Code
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
28
|
+
| lt CLI installed | `lt --version` |
|
|
29
|
+
| Claude Code with lt-dev plugin | `/lt-dev:plugin:check` |
|
|
30
|
+
| Project is a fullstack monorepo | Directories `projects/api/` and `projects/app/` exist |
|
|
31
|
+
| Working tree is clean | `git status` shows no uncommitted changes |
|
|
32
|
+
| You are on a feature branch | `git checkout -b feature/vendor-mode` |
|
|
32
33
|
|
|
33
34
|
---
|
|
34
35
|
|
|
35
|
-
##
|
|
36
|
+
## Vendor Modification Policy
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
**Read this before you convert.** It shapes how you work in vendor mode.
|
|
39
|
+
|
|
40
|
+
Vendoring copies the framework source into your project tree:
|
|
41
|
+
|
|
42
|
+
- Backend: `projects/api/src/core/` (from `@lenne.tech/nest-server`)
|
|
43
|
+
- Frontend: `projects/app/app/core/` (from `@lenne.tech/nuxt-extensions`)
|
|
44
|
+
|
|
45
|
+
**This is a comprehension aid, not a fork.** The copy exists so Claude
|
|
46
|
+
Code (and humans) can read framework internals directly — it is **not**
|
|
47
|
+
an invitation to embed project-specific behavior in the framework tree.
|
|
48
|
+
|
|
49
|
+
### When may I edit `core/`?
|
|
50
|
+
|
|
51
|
+
Only when the change is **generally useful to every consumer** of the
|
|
52
|
+
framework:
|
|
53
|
+
|
|
54
|
+
| ✅ Valid reason to edit `core/` | ❌ Belongs in project code instead |
|
|
55
|
+
|--------------------------------|------------------------------------|
|
|
56
|
+
| Bugfix that every consumer hits | Customer-specific business rules |
|
|
57
|
+
| Broad framework enhancement | Project tenant IDs, enums, branding |
|
|
58
|
+
| Security vulnerability fix | Proprietary integration adapters |
|
|
59
|
+
| TypeScript / build compatibility | Project-specific authorization logic |
|
|
60
|
+
|
|
61
|
+
**Project-specific behavior belongs outside `core/`:**
|
|
62
|
+
|
|
63
|
+
- Backend: extend/inherit from core classes, use `ICoreModuleOverrides`
|
|
64
|
+
on `CoreModule.forRoot()`
|
|
65
|
+
- Frontend: use `app/composables/`, `app/components/`,
|
|
66
|
+
`app/middleware/`, or plugin overrides
|
|
67
|
+
|
|
68
|
+
### Every generic change MUST flow back upstream
|
|
69
|
+
|
|
70
|
+
If you fixed or improved something in `core/` that every consumer could
|
|
71
|
+
benefit from, you MUST submit it as a pull request to the corresponding
|
|
72
|
+
upstream repository:
|
|
73
|
+
|
|
74
|
+
| Layer | Command | Upstream |
|
|
75
|
+
|-------|---------|----------|
|
|
76
|
+
| Backend | `/lt-dev:backend:contribute-nest-server-core` | https://github.com/lenneTech/nest-server |
|
|
77
|
+
| Frontend | `/lt-dev:frontend:contribute-nuxt-extensions-core` | https://github.com/lenneTech/nuxt-extensions |
|
|
78
|
+
|
|
79
|
+
The contributor command analyzes your local changes, filters cosmetic
|
|
80
|
+
noise, categorizes commits as upstream-candidate vs. project-specific,
|
|
81
|
+
cherry-picks candidates onto a branch in a fresh upstream clone, and
|
|
82
|
+
drafts a PR body for your review. It **never auto-pushes** — you
|
|
83
|
+
explicitly open the PR via normal GitHub flow.
|
|
84
|
+
|
|
85
|
+
**Why this matters:** Without upstream flow-back, useful fixes rot in
|
|
86
|
+
one project's vendor tree and conflict on every sync. Once merged
|
|
87
|
+
upstream, the next `/lt-dev:*:update-*-core` sync picks the change up
|
|
88
|
+
as upstream-delivered and the local patch disappears — clean state for
|
|
89
|
+
everyone.
|
|
90
|
+
|
|
91
|
+
### Where the policy is documented
|
|
92
|
+
|
|
93
|
+
The same policy is enforced / surfaced in multiple places so you
|
|
94
|
+
encounter it at every relevant touchpoint:
|
|
95
|
+
|
|
96
|
+
- `projects/api/src/core/VENDOR.md` and `projects/app/app/core/VENDOR.md`
|
|
97
|
+
(inside every vendor project, auto-generated by the lt CLI)
|
|
98
|
+
- Skills `nest-server-core-vendoring` and `nuxt-extensions-core-vendoring`
|
|
99
|
+
(lt-dev plugin)
|
|
100
|
+
- Reviewer agents `backend-reviewer` and `frontend-reviewer`
|
|
101
|
+
(flag non-compliant changes in code reviews)
|
|
102
|
+
- The contributor commands themselves
|
|
103
|
+
|
|
104
|
+
When in doubt, **ask before editing `core/`**.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Part 1: Convert npm → vendor
|
|
109
|
+
|
|
110
|
+
### Step 1: Check status
|
|
38
111
|
|
|
39
112
|
**Command:**
|
|
40
113
|
```bash
|
|
41
114
|
lt status
|
|
42
115
|
```
|
|
43
116
|
|
|
44
|
-
**
|
|
117
|
+
**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
118
|
|
|
46
119
|
---
|
|
47
120
|
|
|
48
|
-
###
|
|
121
|
+
### Step 2: Dry-run — show plan
|
|
49
122
|
|
|
50
|
-
**Command (
|
|
123
|
+
**Command (from monorepo root):**
|
|
51
124
|
```bash
|
|
52
125
|
lt fullstack convert-mode --to vendor --dry-run
|
|
53
126
|
```
|
|
54
127
|
|
|
55
|
-
**
|
|
56
|
-
-
|
|
57
|
-
- Upstream
|
|
128
|
+
**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:
|
|
129
|
+
- Both subprojects as `npm → vendor`
|
|
130
|
+
- Upstream versions are auto-detected from the respective `package.json` files
|
|
58
131
|
|
|
59
132
|
---
|
|
60
133
|
|
|
61
|
-
###
|
|
134
|
+
### Step 3: Run the conversion
|
|
62
135
|
|
|
63
136
|
**Command:**
|
|
64
137
|
```bash
|
|
65
138
|
lt fullstack convert-mode --to vendor --noConfirm
|
|
66
139
|
```
|
|
67
140
|
|
|
68
|
-
**
|
|
69
|
-
1. **Backend**:
|
|
70
|
-
2. **Frontend**:
|
|
141
|
+
**What happens:**
|
|
142
|
+
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`
|
|
143
|
+
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
144
|
|
|
72
|
-
|
|
145
|
+
The temp directories in `/tmp/` are cleaned up automatically.
|
|
73
146
|
|
|
74
147
|
---
|
|
75
148
|
|
|
76
|
-
###
|
|
149
|
+
### Step 4: Reinstall dependencies
|
|
77
150
|
|
|
78
|
-
**Command (
|
|
151
|
+
**Command (from monorepo root):**
|
|
79
152
|
```bash
|
|
80
153
|
pnpm install
|
|
81
154
|
```
|
|
82
155
|
|
|
83
|
-
**
|
|
156
|
+
**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
157
|
|
|
85
158
|
---
|
|
86
159
|
|
|
87
|
-
###
|
|
160
|
+
### Step 5: Validate backend
|
|
88
161
|
|
|
89
162
|
**Commands:**
|
|
90
163
|
```bash
|
|
@@ -95,14 +168,14 @@ pnpm test
|
|
|
95
168
|
cd ..
|
|
96
169
|
```
|
|
97
170
|
|
|
98
|
-
**
|
|
99
|
-
- `tsc --noEmit`: TypeScript
|
|
100
|
-
- `pnpm run lint`: oxlint
|
|
101
|
-
- `pnpm test`: vitest e2e
|
|
171
|
+
**What happens:**
|
|
172
|
+
- `tsc --noEmit`: TypeScript check over the entire backend code including the vendored `src/core/`. Expectation: no errors.
|
|
173
|
+
- `pnpm run lint`: oxlint over src/ + tests/. Expectation: 0 errors.
|
|
174
|
+
- `pnpm test`: vitest e2e suite. Expectation: all tests green (initial run may take ~10 min due to TypeScript transform of the vendored core).
|
|
102
175
|
|
|
103
176
|
---
|
|
104
177
|
|
|
105
|
-
###
|
|
178
|
+
### Step 6: Validate frontend
|
|
106
179
|
|
|
107
180
|
**Commands:**
|
|
108
181
|
```bash
|
|
@@ -112,20 +185,20 @@ pnpm run build
|
|
|
112
185
|
cd ..
|
|
113
186
|
```
|
|
114
187
|
|
|
115
|
-
**
|
|
116
|
-
- `lint`: oxlint
|
|
117
|
-
- `build`:
|
|
188
|
+
**What happens:**
|
|
189
|
+
- `lint`: oxlint over app/. Expectation: 0 errors.
|
|
190
|
+
- `build`: Nuxt build runs prepare → build → nitro output. Expectation: `✨ Build complete!`
|
|
118
191
|
|
|
119
192
|
---
|
|
120
193
|
|
|
121
|
-
###
|
|
194
|
+
### Step 7: Check status again
|
|
122
195
|
|
|
123
196
|
**Command:**
|
|
124
197
|
```bash
|
|
125
198
|
lt status
|
|
126
199
|
```
|
|
127
200
|
|
|
128
|
-
**
|
|
201
|
+
**Expected output:**
|
|
129
202
|
```
|
|
130
203
|
Monorepo Subprojects:
|
|
131
204
|
Backend: projects/api → vendor (src/core/, VENDOR.md)
|
|
@@ -134,7 +207,7 @@ Monorepo Subprojects:
|
|
|
134
207
|
|
|
135
208
|
---
|
|
136
209
|
|
|
137
|
-
###
|
|
210
|
+
### Step 8: Commit changes
|
|
138
211
|
|
|
139
212
|
**Commands:**
|
|
140
213
|
```bash
|
|
@@ -146,112 +219,112 @@ git commit -m "chore: convert fullstack to vendor mode
|
|
|
146
219
|
- Both VENDOR.md files track baseline + sync history"
|
|
147
220
|
```
|
|
148
221
|
|
|
149
|
-
**
|
|
222
|
+
**What happens:** The commit typically contains ~500 new files (vendored core) and modified consumer imports.
|
|
150
223
|
|
|
151
224
|
---
|
|
152
225
|
|
|
153
|
-
##
|
|
226
|
+
## Part 2: Update in vendor mode
|
|
154
227
|
|
|
155
|
-
|
|
228
|
+
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
229
|
|
|
157
|
-
### Workflow A:
|
|
230
|
+
### Workflow A: Comprehensive update (recommended)
|
|
158
231
|
|
|
159
232
|
**Command (in Claude Code):**
|
|
160
233
|
```
|
|
161
234
|
/lt-dev:fullstack:update-all
|
|
162
235
|
```
|
|
163
236
|
|
|
164
|
-
**
|
|
165
|
-
1. **Phase 1**:
|
|
166
|
-
2. **Phase 2**:
|
|
167
|
-
3. **Phase 3**: Backend
|
|
168
|
-
4. **Phase 4**: Frontend
|
|
169
|
-
5. **Phase 5**: Package
|
|
170
|
-
6. **Phase 6**: `CLAUDE.md
|
|
171
|
-
7. **Phase 7**: Cross-
|
|
172
|
-
8. **Phase 8**: Final
|
|
237
|
+
**What happens:**
|
|
238
|
+
1. **Phase 1**: Detects the modes of both subprojects (vendor in this case)
|
|
239
|
+
2. **Phase 2**: Generates `UPDATE_PLAN.md` with version gaps and waits for your approval
|
|
240
|
+
3. **Phase 3**: Backend sync via `nest-server-core-updater` agent (clone upstream, diff, human review, apply, reapply flatten-fix)
|
|
241
|
+
4. **Phase 4**: Frontend sync via `nuxt-extensions-core-updater` agent (clone upstream, diff, human review, apply)
|
|
242
|
+
5. **Phase 5**: Package maintenance via `npm-package-maintainer` (FULL MODE)
|
|
243
|
+
6. **Phase 6**: `CLAUDE.md` sync from upstream starters
|
|
244
|
+
7. **Phase 7**: Cross-validation (build, lint, tests for both subprojects)
|
|
245
|
+
8. **Phase 8**: Final report
|
|
173
246
|
|
|
174
247
|
---
|
|
175
248
|
|
|
176
|
-
### Workflow B:
|
|
249
|
+
### Workflow B: Update backend only
|
|
177
250
|
|
|
178
251
|
**Command:**
|
|
179
252
|
```
|
|
180
253
|
/lt-dev:backend:update-nest-server-core
|
|
181
254
|
```
|
|
182
255
|
|
|
183
|
-
**
|
|
256
|
+
**What happens:** Same as Phase 3 of Workflow A — syncs `src/core/` with upstream changes.
|
|
184
257
|
|
|
185
258
|
---
|
|
186
259
|
|
|
187
|
-
### Workflow C:
|
|
260
|
+
### Workflow C: Update frontend only
|
|
188
261
|
|
|
189
262
|
**Command:**
|
|
190
263
|
```
|
|
191
264
|
/lt-dev:frontend:update-nuxt-extensions-core
|
|
192
265
|
```
|
|
193
266
|
|
|
194
|
-
**
|
|
267
|
+
**What happens:** Same as Phase 4 of Workflow A — syncs `app/core/` with upstream changes.
|
|
195
268
|
|
|
196
269
|
---
|
|
197
270
|
|
|
198
|
-
### Workflow D: Sync
|
|
271
|
+
### Workflow D: Sync to a specific version
|
|
199
272
|
|
|
200
273
|
**Command:**
|
|
201
274
|
```
|
|
202
275
|
/lt-dev:backend:update-nest-server-core --target 11.25.0
|
|
203
276
|
```
|
|
204
277
|
|
|
205
|
-
**
|
|
278
|
+
**What happens:** Instead of syncing to HEAD, a specific upstream version is pulled. Useful for stable major/minor releases.
|
|
206
279
|
|
|
207
280
|
---
|
|
208
281
|
|
|
209
|
-
### Freshness
|
|
282
|
+
### Freshness check
|
|
210
283
|
|
|
211
|
-
**Command (in
|
|
284
|
+
**Command (available in both subprojects):**
|
|
212
285
|
```bash
|
|
213
|
-
cd projects/api #
|
|
286
|
+
cd projects/api # or projects/app
|
|
214
287
|
pnpm run check:vendor-freshness
|
|
215
288
|
```
|
|
216
289
|
|
|
217
|
-
**
|
|
290
|
+
**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
291
|
|
|
219
292
|
---
|
|
220
293
|
|
|
221
|
-
###
|
|
294
|
+
### After the update: validation
|
|
222
295
|
|
|
223
|
-
**Command (
|
|
296
|
+
**Command (from monorepo root):**
|
|
224
297
|
```bash
|
|
225
298
|
pnpm run check
|
|
226
299
|
```
|
|
227
300
|
|
|
228
|
-
**
|
|
301
|
+
**What happens:** Runs audit + format:check + lint + tests + build + server-start per subproject. Must pass green before you commit the update.
|
|
229
302
|
|
|
230
303
|
---
|
|
231
304
|
|
|
232
|
-
### Upstream
|
|
305
|
+
### Upstream contribution (optional)
|
|
233
306
|
|
|
234
|
-
|
|
307
|
+
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
308
|
|
|
236
|
-
**Backend
|
|
309
|
+
**Backend patches:**
|
|
237
310
|
```
|
|
238
311
|
/lt-dev:backend:contribute-nest-server-core
|
|
239
312
|
```
|
|
240
313
|
|
|
241
|
-
**Frontend
|
|
314
|
+
**Frontend patches:**
|
|
242
315
|
```
|
|
243
316
|
/lt-dev:frontend:contribute-nuxt-extensions-core
|
|
244
317
|
```
|
|
245
318
|
|
|
246
|
-
**
|
|
319
|
+
**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
320
|
|
|
248
321
|
---
|
|
249
322
|
|
|
250
|
-
##
|
|
323
|
+
## Part 3: Roll back vendor → npm
|
|
251
324
|
|
|
252
|
-
|
|
325
|
+
In case vendor mode doesn't work for your project or you want to go back to the npm dependency.
|
|
253
326
|
|
|
254
|
-
###
|
|
327
|
+
### Step 1: Check local patches
|
|
255
328
|
|
|
256
329
|
**Command:**
|
|
257
330
|
```bash
|
|
@@ -259,74 +332,74 @@ cat projects/api/src/core/VENDOR.md | grep -A 20 "## Local changes"
|
|
|
259
332
|
cat projects/app/app/core/VENDOR.md | grep -A 20 "## Local changes"
|
|
260
333
|
```
|
|
261
334
|
|
|
262
|
-
**
|
|
335
|
+
**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
336
|
|
|
264
337
|
---
|
|
265
338
|
|
|
266
|
-
###
|
|
339
|
+
### Step 2: Contribute patches upstream (if any)
|
|
267
340
|
|
|
268
|
-
**
|
|
341
|
+
**Recommendation**: Before rolling back, contribute the local patches:
|
|
269
342
|
|
|
270
343
|
```
|
|
271
344
|
/lt-dev:backend:contribute-nest-server-core
|
|
272
345
|
/lt-dev:frontend:contribute-nuxt-extensions-core
|
|
273
346
|
```
|
|
274
347
|
|
|
275
|
-
**
|
|
348
|
+
**What happens:** See "Upstream contribution" above. After merging the upstream PRs the rollback can happen without data loss.
|
|
276
349
|
|
|
277
350
|
---
|
|
278
351
|
|
|
279
|
-
###
|
|
352
|
+
### Step 3: Dry-run — show plan
|
|
280
353
|
|
|
281
|
-
**Command (
|
|
354
|
+
**Command (from monorepo root):**
|
|
282
355
|
```bash
|
|
283
356
|
lt fullstack convert-mode --to npm --dry-run
|
|
284
357
|
```
|
|
285
358
|
|
|
286
|
-
**
|
|
359
|
+
**What happens:** Shows `vendor → npm` for both subprojects. The versions to install are read from the `VENDOR.md` baselines.
|
|
287
360
|
|
|
288
361
|
---
|
|
289
362
|
|
|
290
|
-
###
|
|
363
|
+
### Step 4: Run the rollback
|
|
291
364
|
|
|
292
365
|
**Command:**
|
|
293
366
|
```bash
|
|
294
367
|
lt fullstack convert-mode --to npm --noConfirm
|
|
295
368
|
```
|
|
296
369
|
|
|
297
|
-
**
|
|
370
|
+
**What happens:**
|
|
298
371
|
1. **Backend**:
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
372
|
+
- Reads the baseline version from `src/core/VENDOR.md`
|
|
373
|
+
- Warns about local patches in the "Local changes" table
|
|
374
|
+
- Rewrites all consumer imports from relative paths back to `@lenne.tech/nest-server`
|
|
375
|
+
- Deletes `src/core/`
|
|
376
|
+
- Restores `@lenne.tech/nest-server` in `package.json` (with baseline version)
|
|
377
|
+
- Restores `migrate:*` scripts to `node_modules/.bin/`
|
|
378
|
+
- Removes vendor artifacts: `bin/migrate.js`, `migrations-utils/ts-compiler.js`, `migration-guides/`
|
|
379
|
+
- Removes the vendor marker from `CLAUDE.md`
|
|
307
380
|
2. **Frontend**:
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
381
|
+
- Reads the baseline version from `app/core/VENDOR.md`
|
|
382
|
+
- Rewrites the 4 explicit consumer imports back to `@lenne.tech/nuxt-extensions`
|
|
383
|
+
- Deletes `app/core/`
|
|
384
|
+
- Restores `@lenne.tech/nuxt-extensions` in `package.json`
|
|
385
|
+
- Rewrites `nuxt.config.ts`: `'./app/core/module'` → `'@lenne.tech/nuxt-extensions'`
|
|
386
|
+
- Removes the `check:vendor-freshness` script
|
|
387
|
+
- Removes the vendor marker from `CLAUDE.md`
|
|
315
388
|
|
|
316
389
|
---
|
|
317
390
|
|
|
318
|
-
###
|
|
391
|
+
### Step 5: Reinstall dependencies
|
|
319
392
|
|
|
320
393
|
**Command:**
|
|
321
394
|
```bash
|
|
322
395
|
pnpm install
|
|
323
396
|
```
|
|
324
397
|
|
|
325
|
-
**
|
|
398
|
+
**What happens:** pnpm installs `@lenne.tech/nest-server` and `@lenne.tech/nuxt-extensions` freshly from the npm registry.
|
|
326
399
|
|
|
327
400
|
---
|
|
328
401
|
|
|
329
|
-
###
|
|
402
|
+
### Step 6: Validate
|
|
330
403
|
|
|
331
404
|
**Commands:**
|
|
332
405
|
```bash
|
|
@@ -334,18 +407,18 @@ cd projects/api && pnpm exec tsc --noEmit && pnpm run lint && pnpm test && cd ..
|
|
|
334
407
|
cd projects/app && pnpm run lint && pnpm run build && cd ..
|
|
335
408
|
```
|
|
336
409
|
|
|
337
|
-
**
|
|
410
|
+
**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
411
|
|
|
339
412
|
---
|
|
340
413
|
|
|
341
|
-
###
|
|
414
|
+
### Step 7: Check status again
|
|
342
415
|
|
|
343
416
|
**Command:**
|
|
344
417
|
```bash
|
|
345
418
|
lt status
|
|
346
419
|
```
|
|
347
420
|
|
|
348
|
-
**
|
|
421
|
+
**Expected output:**
|
|
349
422
|
```
|
|
350
423
|
Monorepo Subprojects:
|
|
351
424
|
Backend: projects/api → npm (@lenne.tech/nest-server dependency)
|
|
@@ -354,7 +427,7 @@ Monorepo Subprojects:
|
|
|
354
427
|
|
|
355
428
|
---
|
|
356
429
|
|
|
357
|
-
###
|
|
430
|
+
### Step 8: Commit changes
|
|
358
431
|
|
|
359
432
|
**Commands:**
|
|
360
433
|
```bash
|
|
@@ -370,11 +443,11 @@ git commit -m "chore: revert fullstack to npm mode
|
|
|
370
443
|
|
|
371
444
|
## Troubleshooting
|
|
372
445
|
|
|
373
|
-
### Problem: `tsc`
|
|
446
|
+
### Problem: `tsc` fails with `new Error('msg', { cause })` error
|
|
374
447
|
|
|
375
|
-
**
|
|
448
|
+
**Cause:** TypeScript target is too old (ES2020 or lower).
|
|
376
449
|
|
|
377
|
-
**Fix:** In `projects/api/tsconfig.json`
|
|
450
|
+
**Fix:** In `projects/api/tsconfig.json` set the target to `"es2022"`:
|
|
378
451
|
```json
|
|
379
452
|
{
|
|
380
453
|
"compilerOptions": {
|
|
@@ -385,87 +458,87 @@ git commit -m "chore: revert fullstack to npm mode
|
|
|
385
458
|
|
|
386
459
|
---
|
|
387
460
|
|
|
388
|
-
### Problem: Vitest
|
|
461
|
+
### Problem: Vitest error `'express' does not provide an export named 'Response'`
|
|
389
462
|
|
|
390
|
-
**
|
|
463
|
+
**Cause:** In vendor mode the TypeScript source of the core is evaluated directly by vitest. Value-imports of TypeScript type-only exports break.
|
|
391
464
|
|
|
392
|
-
**Fix:**
|
|
465
|
+
**Fix:** Should have been fixed automatically by the CLI. If not, update all affected files:
|
|
393
466
|
```typescript
|
|
394
|
-
//
|
|
467
|
+
// Before
|
|
395
468
|
import { Request, Response } from 'express';
|
|
396
469
|
|
|
397
|
-
//
|
|
470
|
+
// After
|
|
398
471
|
import type { Request, Response } from 'express';
|
|
399
472
|
```
|
|
400
473
|
|
|
401
474
|
---
|
|
402
475
|
|
|
403
|
-
### Problem:
|
|
476
|
+
### Problem: Conversion fails with "Destination path already exists"
|
|
404
477
|
|
|
405
|
-
**
|
|
478
|
+
**Cause:** The project already has project-specific `bin/` or `migration-guides/` directories that collide with upstream contents.
|
|
406
479
|
|
|
407
|
-
**Fix:**
|
|
480
|
+
**Fix:** Back up the contents, delete the directories, run the conversion again, copy the contents back.
|
|
408
481
|
|
|
409
482
|
```bash
|
|
410
483
|
cp projects/api/bin/migrate.js /tmp/migrate-backup.js
|
|
411
484
|
cp -r projects/api/migration-guides /tmp/migration-guides-backup
|
|
412
485
|
rm -rf projects/api/bin projects/api/migration-guides
|
|
413
486
|
lt fullstack convert-mode --to vendor --noConfirm
|
|
414
|
-
#
|
|
487
|
+
# After conversion:
|
|
415
488
|
mv /tmp/migration-guides-backup/MY-FILE.md projects/api/migration-guides/
|
|
416
489
|
```
|
|
417
490
|
|
|
418
491
|
---
|
|
419
492
|
|
|
420
|
-
### Problem:
|
|
493
|
+
### Problem: Some consumer imports missing from the rewrite after conversion
|
|
421
494
|
|
|
422
|
-
**Symptom:** `lt fullstack convert-mode`
|
|
495
|
+
**Symptom:** `lt fullstack convert-mode` shows a warning like `X file(s) still contain '@lenne.tech/nest-server' imports`.
|
|
423
496
|
|
|
424
|
-
**Fix:**
|
|
497
|
+
**Fix:** Manually check the reported files and rewrite the imports to relative paths. The warning shows the exact paths.
|
|
425
498
|
|
|
426
499
|
---
|
|
427
500
|
|
|
428
|
-
### Problem: Tests
|
|
501
|
+
### Problem: Tests fail under parallel load (flakiness)
|
|
429
502
|
|
|
430
|
-
**
|
|
503
|
+
**Cause:** TypeScript source loading in vendor mode is slower than pre-compiled `dist/` — this exposes existing timing-sensitive test races.
|
|
431
504
|
|
|
432
|
-
**Fix
|
|
433
|
-
-
|
|
434
|
-
-
|
|
435
|
-
-
|
|
505
|
+
**Fix options:**
|
|
506
|
+
- Make individual flaky tests robust (retry pattern, polling instead of `setTimeout`)
|
|
507
|
+
- As a workaround, `retry: 3` is already active in `vitest-e2e.config.ts`
|
|
508
|
+
- Last resort: `poolOptions.forks.singleFork: true` (makes tests sequential — ~4× slower)
|
|
436
509
|
|
|
437
510
|
---
|
|
438
511
|
|
|
439
|
-
### Problem: Upstream
|
|
512
|
+
### Problem: Upstream sync finds conflicts
|
|
440
513
|
|
|
441
|
-
**Symptom:** `/lt-dev:backend:update-nest-server-core`
|
|
514
|
+
**Symptom:** `/lt-dev:backend:update-nest-server-core` shows conflicts between upstream changes and local patches.
|
|
442
515
|
|
|
443
|
-
**Fix:**
|
|
444
|
-
- `approve all` —
|
|
445
|
-
- `approve clean` —
|
|
446
|
-
- `reject <file>` —
|
|
447
|
-
- `show <file>` —
|
|
448
|
-
- `done` —
|
|
516
|
+
**Fix:** The agent pauses and presents the conflicts. You can:
|
|
517
|
+
- `approve all` — take all upstream picks (local patches overwritten)
|
|
518
|
+
- `approve clean` — only conflict-free picks
|
|
519
|
+
- `reject <file>` — skip a specific file
|
|
520
|
+
- `show <file>` — render the hunk
|
|
521
|
+
- `done` — proceed with current selection
|
|
449
522
|
|
|
450
523
|
---
|
|
451
524
|
|
|
452
|
-
##
|
|
525
|
+
## Quick Reference
|
|
453
526
|
|
|
454
|
-
|
|
|
527
|
+
| Action | Command |
|
|
455
528
|
|--------|---------|
|
|
456
|
-
|
|
|
457
|
-
| Dry-
|
|
529
|
+
| Check status | `lt status` |
|
|
530
|
+
| Dry-run npm→vendor | `lt fullstack convert-mode --to vendor --dry-run` |
|
|
458
531
|
| npm→vendor | `lt fullstack convert-mode --to vendor --noConfirm` |
|
|
459
|
-
| Vendor
|
|
460
|
-
| Backend-only
|
|
461
|
-
| Frontend-only
|
|
462
|
-
| Freshness
|
|
463
|
-
| Full
|
|
464
|
-
| Upstream
|
|
465
|
-
| Upstream
|
|
466
|
-
| Dry-
|
|
532
|
+
| Vendor update | `/lt-dev:fullstack:update-all` |
|
|
533
|
+
| Backend-only update | `/lt-dev:backend:update-nest-server-core` |
|
|
534
|
+
| Frontend-only update | `/lt-dev:frontend:update-nuxt-extensions-core` |
|
|
535
|
+
| Freshness check | `pnpm run check:vendor-freshness` |
|
|
536
|
+
| Full check | `pnpm run check` |
|
|
537
|
+
| Upstream PR (backend) | `/lt-dev:backend:contribute-nest-server-core` |
|
|
538
|
+
| Upstream PR (frontend) | `/lt-dev:frontend:contribute-nuxt-extensions-core` |
|
|
539
|
+
| Dry-run vendor→npm | `lt fullstack convert-mode --to npm --dry-run` |
|
|
467
540
|
| vendor→npm | `lt fullstack convert-mode --to npm --noConfirm` |
|
|
468
541
|
|
|
469
542
|
---
|
|
470
543
|
|
|
471
|
-
> **
|
|
544
|
+
> **Further reading**: Architecture, concepts, and reference for all CLI and plugin functions in the [LT-ECOSYSTEM-GUIDE](./LT-ECOSYSTEM-GUIDE.md).
|