@hublo/sentinel 1.3.0 → 1.4.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/bin/sentinel.d.ts +0 -1
- package/dist/bin/sentinel.js +22 -8
- package/dist/chunk-2XLX6PFR.js +132 -0
- package/dist/chunk-3TDUIKVQ.js +178 -0
- package/dist/{chunk-676GBPMS.js → chunk-4UIZJ3TR.js} +3399 -549
- package/dist/chunk-CPCUPK4J.js +70 -0
- package/dist/chunk-NX4GHIHF.js +25 -0
- package/dist/chunk-PWV3BMDA.js +15 -0
- package/dist/chunk-WLFE5RUU.js +264 -0
- package/dist/index.js +2 -1
- package/dist/roles/build/nest/toolchain.d.ts +4 -36
- package/dist/roles/build/nest/toolchain.js +10 -178
- package/dist/roles/build/nest/toolchain.js.map +1 -0
- package/dist/roles/build/toolchain.js.map +1 -0
- package/dist/roles/test/nest/toolchain.d.ts +29 -0
- package/dist/roles/test/nest/toolchain.js +289 -0
- package/dist/roles/test/nest/toolchain.js.map +1 -0
- package/dist/roles/test/react/toolchain.d.ts +62 -0
- package/dist/roles/test/react/toolchain.js +5 -0
- package/dist/roles/test/react/toolchain.js.map +1 -0
- package/dist/roles/test/setup/mock-extended.d.ts +46 -0
- package/dist/roles/test/setup/mock-extended.js +65 -0
- package/dist/roles/test/setup/mock-extended.js.map +1 -0
- package/dist/roles/test/setup/msw-lifecycle.d.ts +16 -0
- package/dist/roles/test/setup/msw-lifecycle.js +12 -0
- package/dist/roles/test/setup/msw-lifecycle.js.map +1 -0
- package/dist/roles/test/setup/msw-server.d.ts +3 -0
- package/dist/roles/test/setup/msw-server.js +10 -0
- package/dist/roles/test/setup/msw-server.js.map +1 -0
- package/dist/roles/test/setup/nest.d.ts +2 -0
- package/dist/roles/test/setup/nest.js +159 -0
- package/dist/roles/test/setup/nest.js.map +1 -0
- package/dist/roles/test/setup/workspace-entry.d.ts +2 -0
- package/dist/roles/test/setup/workspace-entry.js +8 -0
- package/dist/roles/test/setup/workspace-entry.js.map +1 -0
- package/dist/tsconfig-aliases-Ce6axdJ4.d.ts +36 -0
- package/docs/.gitkeep +0 -0
- package/docs/build-adoption.md +521 -0
- package/docs/format-adoption.md +321 -0
- package/docs/lint-adoption.md +290 -0
- package/docs/performance.md +49 -0
- package/docs/test-adoption.md +175 -0
- package/docs/typescript-adoption.md +184 -0
- package/docs/typescript-traces.md +798 -0
- package/docs/using-sentinel.md +180 -0
- package/docs/validating-a-change.md +101 -0
- package/package.json +32 -5
|
@@ -0,0 +1,798 @@
|
|
|
1
|
+
# sentinel CLI — command & scenario traces
|
|
2
|
+
|
|
3
|
+
Version `1.1.0-alpha.3` · live runs against the committed mock monorepo and fixtures (colour stripped, exit codes shown).
|
|
4
|
+
Generated by `scripts/gen-traces.sh`; do not edit by hand.
|
|
5
|
+
|
|
6
|
+
> A check composes **verb × type × location**. Verbs: `--run --inspect --report --status --init (--migrate: planned)`.
|
|
7
|
+
> Types: `--typescript` today; `--lint --format --build --test ...` planned. Location: a module dir → that module; the root → `--module`, `--ci`, or all.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Read verbs across the workspace
|
|
12
|
+
|
|
13
|
+
Four mock modules cover each preset: `react-app`, `bff-admin` (nest), `svelte-app`, `utils` (node).
|
|
14
|
+
|
|
15
|
+
**--report --typescript**
|
|
16
|
+
|
|
17
|
+
```console
|
|
18
|
+
$ sentinel --report --typescript
|
|
19
|
+
sentinel: --report is deprecated, use --run --json (it still works)
|
|
20
|
+
✓ svelte-app (svelte) typescript — errors=0 implicitAny=0
|
|
21
|
+
✓ bff-admin (nest) typescript — errors=0 implicitAny=deferred
|
|
22
|
+
✓ react-app (react) typescript — errors=0 implicitAny=deferred
|
|
23
|
+
✓ utils (node) typescript — errors=0 implicitAny=deferred
|
|
24
|
+
4 module(s) [all] in <n>ms
|
|
25
|
+
# exit: 0
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**--report --typescript --json** (stdout only, the JSON envelope)
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
$ sentinel --report --typescript --json 2>/dev/null
|
|
32
|
+
{
|
|
33
|
+
"schemaVersion": 2,
|
|
34
|
+
"executed": [
|
|
35
|
+
"typescript"
|
|
36
|
+
],
|
|
37
|
+
"skipped": [],
|
|
38
|
+
"results": [
|
|
39
|
+
{
|
|
40
|
+
"project": "svelte-app",
|
|
41
|
+
"target": "typescript",
|
|
42
|
+
"flavour": "svelte",
|
|
43
|
+
"ok": true,
|
|
44
|
+
"status": "ok",
|
|
45
|
+
"errors": 0,
|
|
46
|
+
"implicitAny": 0,
|
|
47
|
+
"diagnostics": [],
|
|
48
|
+
"diagnosticsTruncated": false
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"project": "bff-admin",
|
|
52
|
+
"target": "typescript",
|
|
53
|
+
"flavour": "nest",
|
|
54
|
+
"ok": true,
|
|
55
|
+
"status": "ok",
|
|
56
|
+
"errors": 0,
|
|
57
|
+
"implicitAny": "deferred",
|
|
58
|
+
"diagnostics": [],
|
|
59
|
+
"diagnosticsTruncated": false
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"project": "react-app",
|
|
63
|
+
"target": "typescript",
|
|
64
|
+
"flavour": "react",
|
|
65
|
+
"ok": true,
|
|
66
|
+
"status": "ok",
|
|
67
|
+
"errors": 0,
|
|
68
|
+
"implicitAny": "deferred",
|
|
69
|
+
"diagnostics": [],
|
|
70
|
+
"diagnosticsTruncated": false
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"project": "utils",
|
|
74
|
+
"target": "typescript",
|
|
75
|
+
"flavour": "node",
|
|
76
|
+
"ok": true,
|
|
77
|
+
"status": "ok",
|
|
78
|
+
"errors": 0,
|
|
79
|
+
"implicitAny": "deferred",
|
|
80
|
+
"diagnostics": [],
|
|
81
|
+
"diagnosticsTruncated": false
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**--inspect --typescript**
|
|
88
|
+
|
|
89
|
+
```console
|
|
90
|
+
$ sentinel --inspect --typescript
|
|
91
|
+
· svelte-app (svelte) typescript — not adopted
|
|
92
|
+
· bff-admin (nest) typescript — not adopted
|
|
93
|
+
· react-app (react) typescript — not adopted
|
|
94
|
+
· utils (node) typescript — not adopted
|
|
95
|
+
coverage: 0/4 adopted · 0/0 conformant
|
|
96
|
+
4 module(s) [all] in <n>ms
|
|
97
|
+
# exit: 0
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**--status --typescript**
|
|
101
|
+
|
|
102
|
+
```console
|
|
103
|
+
$ sentinel --status --typescript
|
|
104
|
+
sentinel: --status is deprecated, use --inspect (it still works)
|
|
105
|
+
· svelte-app (svelte) typescript — not adopted
|
|
106
|
+
· bff-admin (nest) typescript — not adopted
|
|
107
|
+
· react-app (react) typescript — not adopted
|
|
108
|
+
· utils (node) typescript — not adopted
|
|
109
|
+
coverage: 0/4 adopted · 0/0 conformant
|
|
110
|
+
4 module(s) [all] in <n>ms
|
|
111
|
+
# exit: 0
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**--status --typescript --json** (stdout only, the JSON envelope)
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
$ sentinel --status --typescript --json 2>/dev/null
|
|
118
|
+
{
|
|
119
|
+
"schemaVersion": 2,
|
|
120
|
+
"executed": [
|
|
121
|
+
"typescript"
|
|
122
|
+
],
|
|
123
|
+
"skipped": [],
|
|
124
|
+
"results": [
|
|
125
|
+
{
|
|
126
|
+
"project": "svelte-app",
|
|
127
|
+
"target": "typescript",
|
|
128
|
+
"flavour": "svelte",
|
|
129
|
+
"ok": true,
|
|
130
|
+
"status": "ok",
|
|
131
|
+
"adopted": false,
|
|
132
|
+
"preset": null,
|
|
133
|
+
"conformant": false,
|
|
134
|
+
"drift": []
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"project": "bff-admin",
|
|
138
|
+
"target": "typescript",
|
|
139
|
+
"flavour": "nest",
|
|
140
|
+
"ok": true,
|
|
141
|
+
"status": "ok",
|
|
142
|
+
"adopted": false,
|
|
143
|
+
"preset": null,
|
|
144
|
+
"conformant": false,
|
|
145
|
+
"drift": []
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"project": "react-app",
|
|
149
|
+
"target": "typescript",
|
|
150
|
+
"flavour": "react",
|
|
151
|
+
"ok": true,
|
|
152
|
+
"status": "ok",
|
|
153
|
+
"adopted": false,
|
|
154
|
+
"preset": null,
|
|
155
|
+
"conformant": false,
|
|
156
|
+
"drift": []
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"project": "utils",
|
|
160
|
+
"target": "typescript",
|
|
161
|
+
"flavour": "node",
|
|
162
|
+
"ok": true,
|
|
163
|
+
"status": "ok",
|
|
164
|
+
"adopted": false,
|
|
165
|
+
"preset": null,
|
|
166
|
+
"conformant": false,
|
|
167
|
+
"drift": []
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"coverage": {
|
|
171
|
+
"total": 4,
|
|
172
|
+
"adopted": 0,
|
|
173
|
+
"conformant": 0,
|
|
174
|
+
"drifted": 0
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**--run --typescript --module bff-admin (real tsc)**
|
|
180
|
+
|
|
181
|
+
```console
|
|
182
|
+
$ sentinel --run --typescript --module bff-admin
|
|
183
|
+
sentinel typescript: phase 1 (non-breaking) — deferred: noImplicitAny, noUnusedLocals, noUnusedParameters. Enabled centrally in a later wave; run `sentinel --inspect --typescript` for the list, or `sentinel --run --typescript -- --noImplicitAny` to measure what one would cost today.
|
|
184
|
+
✓ bff-admin (nest) typescript
|
|
185
|
+
1 module(s) [named-module] in <n>ms
|
|
186
|
+
# exit: 0
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## 2. Location: root vs one module vs inside a module
|
|
190
|
+
|
|
191
|
+
**from ROOT, one module**
|
|
192
|
+
|
|
193
|
+
```console
|
|
194
|
+
$ sentinel --report --typescript --module react-app
|
|
195
|
+
sentinel: --report is deprecated, use --run --json (it still works)
|
|
196
|
+
✓ react-app (react) typescript — errors=0 implicitAny=deferred
|
|
197
|
+
1 module(s) [named-module] in <n>ms
|
|
198
|
+
# exit: 0
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**from INSIDE a module dir**
|
|
202
|
+
|
|
203
|
+
```console
|
|
204
|
+
$ sentinel --report --typescript
|
|
205
|
+
sentinel: --report is deprecated, use --run --json (it still works)
|
|
206
|
+
✓ bff-admin (nest) typescript — errors=0 implicitAny=deferred
|
|
207
|
+
1 module(s) [cwd-module] in <n>ms
|
|
208
|
+
# exit: 0
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**no type = all types (only typescript wired)** (stdout only, the JSON envelope)
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
$ sentinel --report --json 2>/dev/null
|
|
215
|
+
{
|
|
216
|
+
"schemaVersion": 2,
|
|
217
|
+
"executed": [
|
|
218
|
+
"lint",
|
|
219
|
+
"typescript"
|
|
220
|
+
],
|
|
221
|
+
"skipped": [
|
|
222
|
+
"format",
|
|
223
|
+
"build",
|
|
224
|
+
"test",
|
|
225
|
+
"static-analysis",
|
|
226
|
+
"runtime-analysis",
|
|
227
|
+
"arch"
|
|
228
|
+
],
|
|
229
|
+
"results": [
|
|
230
|
+
{
|
|
231
|
+
"project": "svelte-app",
|
|
232
|
+
"target": "lint",
|
|
233
|
+
"flavour": "svelte",
|
|
234
|
+
"ok": true,
|
|
235
|
+
"status": "ok",
|
|
236
|
+
"adopted": false
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"project": "svelte-app",
|
|
240
|
+
"target": "typescript",
|
|
241
|
+
"flavour": "svelte",
|
|
242
|
+
"ok": true,
|
|
243
|
+
"status": "ok",
|
|
244
|
+
"errors": 0,
|
|
245
|
+
"implicitAny": 0,
|
|
246
|
+
"diagnostics": [],
|
|
247
|
+
"diagnosticsTruncated": false
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"project": "bff-admin",
|
|
251
|
+
"target": "lint",
|
|
252
|
+
"flavour": "nest",
|
|
253
|
+
"ok": true,
|
|
254
|
+
"status": "ok",
|
|
255
|
+
"adopted": false
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"project": "bff-admin",
|
|
259
|
+
"target": "typescript",
|
|
260
|
+
"flavour": "nest",
|
|
261
|
+
"ok": true,
|
|
262
|
+
"status": "ok",
|
|
263
|
+
"errors": 0,
|
|
264
|
+
"implicitAny": "deferred",
|
|
265
|
+
"diagnostics": [],
|
|
266
|
+
"diagnosticsTruncated": false
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"project": "react-app",
|
|
270
|
+
"target": "lint",
|
|
271
|
+
"flavour": "react",
|
|
272
|
+
"ok": true,
|
|
273
|
+
"status": "ok",
|
|
274
|
+
"adopted": false
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"project": "react-app",
|
|
278
|
+
"target": "typescript",
|
|
279
|
+
"flavour": "react",
|
|
280
|
+
"ok": true,
|
|
281
|
+
"status": "ok",
|
|
282
|
+
"errors": 0,
|
|
283
|
+
"implicitAny": "deferred",
|
|
284
|
+
"diagnostics": [],
|
|
285
|
+
"diagnosticsTruncated": false
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"project": "utils",
|
|
289
|
+
"target": "lint",
|
|
290
|
+
"flavour": "node",
|
|
291
|
+
"ok": true,
|
|
292
|
+
"status": "ok",
|
|
293
|
+
"adopted": false
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"project": "utils",
|
|
297
|
+
"target": "typescript",
|
|
298
|
+
"flavour": "node",
|
|
299
|
+
"ok": true,
|
|
300
|
+
"status": "ok",
|
|
301
|
+
"errors": 0,
|
|
302
|
+
"implicitAny": "deferred",
|
|
303
|
+
"diagnostics": [],
|
|
304
|
+
"diagnosticsTruncated": false
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## 3. Options
|
|
311
|
+
|
|
312
|
+
**--preset overrides detection**
|
|
313
|
+
|
|
314
|
+
```console
|
|
315
|
+
$ sentinel --inspect --typescript --module utils --preset react
|
|
316
|
+
✓ utils (react) typescript — configFile=tsconfig.json configState=extends-base preset=null adopted=false phase=1 deferred=3
|
|
317
|
+
deferred (phase 1, non-breaking):
|
|
318
|
+
• noImplicitAny — phase 2: the implicit-any migration (TS70xx)
|
|
319
|
+
• noUnusedLocals — phase 2: unused-local cleanup (TS6133)
|
|
320
|
+
• noUnusedParameters — phase 2: unused-parameter cleanup (TS6133)
|
|
321
|
+
1 module(s) [named-module] in <n>ms
|
|
322
|
+
# exit: 0
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**--all --json (executed vs skipped)** (stdout only, the JSON envelope)
|
|
326
|
+
|
|
327
|
+
```json
|
|
328
|
+
$ sentinel --report --all --json 2>/dev/null
|
|
329
|
+
{
|
|
330
|
+
"schemaVersion": 2,
|
|
331
|
+
"executed": [
|
|
332
|
+
"lint",
|
|
333
|
+
"typescript"
|
|
334
|
+
],
|
|
335
|
+
"skipped": [
|
|
336
|
+
"format",
|
|
337
|
+
"build",
|
|
338
|
+
"test",
|
|
339
|
+
"static-analysis",
|
|
340
|
+
"runtime-analysis",
|
|
341
|
+
"arch"
|
|
342
|
+
],
|
|
343
|
+
"results": [
|
|
344
|
+
{
|
|
345
|
+
"project": "svelte-app",
|
|
346
|
+
"target": "lint",
|
|
347
|
+
"flavour": "svelte",
|
|
348
|
+
"ok": true,
|
|
349
|
+
"status": "ok",
|
|
350
|
+
"adopted": false
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"project": "svelte-app",
|
|
354
|
+
"target": "typescript",
|
|
355
|
+
"flavour": "svelte",
|
|
356
|
+
"ok": true,
|
|
357
|
+
"status": "ok",
|
|
358
|
+
"errors": 0,
|
|
359
|
+
"implicitAny": 0,
|
|
360
|
+
"diagnostics": [],
|
|
361
|
+
"diagnosticsTruncated": false
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"project": "bff-admin",
|
|
365
|
+
"target": "lint",
|
|
366
|
+
"flavour": "nest",
|
|
367
|
+
"ok": true,
|
|
368
|
+
"status": "ok",
|
|
369
|
+
"adopted": false
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"project": "bff-admin",
|
|
373
|
+
"target": "typescript",
|
|
374
|
+
"flavour": "nest",
|
|
375
|
+
"ok": true,
|
|
376
|
+
"status": "ok",
|
|
377
|
+
"errors": 0,
|
|
378
|
+
"implicitAny": "deferred",
|
|
379
|
+
"diagnostics": [],
|
|
380
|
+
"diagnosticsTruncated": false
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"project": "react-app",
|
|
384
|
+
"target": "lint",
|
|
385
|
+
"flavour": "react",
|
|
386
|
+
"ok": true,
|
|
387
|
+
"status": "ok",
|
|
388
|
+
"adopted": false
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"project": "react-app",
|
|
392
|
+
"target": "typescript",
|
|
393
|
+
"flavour": "react",
|
|
394
|
+
"ok": true,
|
|
395
|
+
"status": "ok",
|
|
396
|
+
"errors": 0,
|
|
397
|
+
"implicitAny": "deferred",
|
|
398
|
+
"diagnostics": [],
|
|
399
|
+
"diagnosticsTruncated": false
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"project": "utils",
|
|
403
|
+
"target": "lint",
|
|
404
|
+
"flavour": "node",
|
|
405
|
+
"ok": true,
|
|
406
|
+
"status": "ok",
|
|
407
|
+
"adopted": false
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"project": "utils",
|
|
411
|
+
"target": "typescript",
|
|
412
|
+
"flavour": "node",
|
|
413
|
+
"ok": true,
|
|
414
|
+
"status": "ok",
|
|
415
|
+
"errors": 0,
|
|
416
|
+
"implicitAny": "deferred",
|
|
417
|
+
"diagnostics": [],
|
|
418
|
+
"diagnosticsTruncated": false
|
|
419
|
+
}
|
|
420
|
+
]
|
|
421
|
+
}
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
**--report --json on a module with 2 errors (structured diagnostics)** (stdout only, the JSON envelope)
|
|
425
|
+
|
|
426
|
+
```json
|
|
427
|
+
$ sentinel --report --typescript --module bff-admin --json 2>/dev/null
|
|
428
|
+
{
|
|
429
|
+
"schemaVersion": 2,
|
|
430
|
+
"executed": [
|
|
431
|
+
"typescript"
|
|
432
|
+
],
|
|
433
|
+
"skipped": [],
|
|
434
|
+
"results": [
|
|
435
|
+
{
|
|
436
|
+
"project": "bff-admin",
|
|
437
|
+
"target": "typescript",
|
|
438
|
+
"flavour": "nest",
|
|
439
|
+
"ok": false,
|
|
440
|
+
"status": "failed",
|
|
441
|
+
"errors": 2,
|
|
442
|
+
"implicitAny": "deferred",
|
|
443
|
+
"diagnostics": [
|
|
444
|
+
{
|
|
445
|
+
"file": "src/__probe__.ts",
|
|
446
|
+
"line": 1,
|
|
447
|
+
"col": 7,
|
|
448
|
+
"code": "TS2322",
|
|
449
|
+
"message": "Type 'string' is not assignable to type 'number'."
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"file": "src/__probe__.ts",
|
|
453
|
+
"line": 2,
|
|
454
|
+
"col": 7,
|
|
455
|
+
"code": "TS2322",
|
|
456
|
+
"message": "Type 'number' is not assignable to type 'string'."
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"diagnosticsTruncated": false
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**--max-diagnostics 1 (cap; full count kept, truncated flagged)** (stdout only, the JSON envelope)
|
|
466
|
+
|
|
467
|
+
```json
|
|
468
|
+
$ sentinel --report --typescript --module bff-admin --json --max-diagnostics 1 2>/dev/null
|
|
469
|
+
{
|
|
470
|
+
"schemaVersion": 2,
|
|
471
|
+
"executed": [
|
|
472
|
+
"typescript"
|
|
473
|
+
],
|
|
474
|
+
"skipped": [],
|
|
475
|
+
"results": [
|
|
476
|
+
{
|
|
477
|
+
"project": "bff-admin",
|
|
478
|
+
"target": "typescript",
|
|
479
|
+
"flavour": "nest",
|
|
480
|
+
"ok": false,
|
|
481
|
+
"status": "failed",
|
|
482
|
+
"errors": 2,
|
|
483
|
+
"implicitAny": "deferred",
|
|
484
|
+
"diagnostics": [
|
|
485
|
+
{
|
|
486
|
+
"file": "src/__probe__.ts",
|
|
487
|
+
"line": 1,
|
|
488
|
+
"col": 7,
|
|
489
|
+
"code": "TS2322",
|
|
490
|
+
"message": "Type 'string' is not assignable to type 'number'."
|
|
491
|
+
}
|
|
492
|
+
],
|
|
493
|
+
"diagnosticsTruncated": true
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
}
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
## 4. Configuration results: what `--init` writes
|
|
500
|
+
|
|
501
|
+
### 4a. Pattern B (React app, tsconfig.app.json extends the base, carries drift)
|
|
502
|
+
|
|
503
|
+
_before: tsconfig.app.json_
|
|
504
|
+
|
|
505
|
+
```json
|
|
506
|
+
{
|
|
507
|
+
"extends": "../../tsconfig.base.json",
|
|
508
|
+
"compilerOptions": { "strict": true, "jsx": "react-jsx", "paths": { "@/*": ["./src/*"] } }
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
**dry-run plan**
|
|
513
|
+
|
|
514
|
+
```console
|
|
515
|
+
$ sentinel --init --typescript --dry-run
|
|
516
|
+
dry run: no files written
|
|
517
|
+
stripped preset-owned compilerOptions: strict, jsx
|
|
518
|
+
run `pnpm install` to fetch @hublo/sentinel (added to the module devDependencies) so `extends` and the typecheck script resolve
|
|
519
|
+
|
|
520
|
+
update tsconfig.app.json
|
|
521
|
+
{
|
|
522
|
+
- "extends": "../../tsconfig.base.json",
|
|
523
|
+
- "compilerOptions": { "strict": true, "jsx": "react-jsx", "paths": { "@/*": ["./src/*"] } }
|
|
524
|
+
+ "extends": [
|
|
525
|
+
+ "../../tsconfig.base.json",
|
|
526
|
+
+ "@hublo/sentinel/tsconfig/react"
|
|
527
|
+
+ ],
|
|
528
|
+
+ "compilerOptions": {
|
|
529
|
+
+ "paths": {
|
|
530
|
+
+ "@/*": [
|
|
531
|
+
+ "./src/*"
|
|
532
|
+
+ ]
|
|
533
|
+
+ }
|
|
534
|
+
+ }
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
update package.json
|
|
538
|
+
- { "name": "app", "dependencies": { "react": "^19" } }
|
|
539
|
+
+ {
|
|
540
|
+
+ "name": "app",
|
|
541
|
+
+ "dependencies": {
|
|
542
|
+
+ "react": "^19"
|
|
543
|
+
+ },
|
|
544
|
+
+ "scripts": {
|
|
545
|
+
+ "typecheck": "sentinel --run --typescript"
|
|
546
|
+
+ },
|
|
547
|
+
+ "devDependencies": {
|
|
548
|
+
+ "@hublo/sentinel": "1.1.0-alpha.3"
|
|
549
|
+
+ }
|
|
550
|
+
+ }
|
|
551
|
+
# exit: 0
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
_after: base kept, preset appended, preset-owned keys stripped, paths kept_
|
|
555
|
+
|
|
556
|
+
```json
|
|
557
|
+
{
|
|
558
|
+
"extends": [
|
|
559
|
+
"../../tsconfig.base.json",
|
|
560
|
+
"@hublo/sentinel/tsconfig/react"
|
|
561
|
+
],
|
|
562
|
+
"compilerOptions": {
|
|
563
|
+
"paths": {
|
|
564
|
+
"@/*": [
|
|
565
|
+
"./src/*"
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### 4b. No tsconfig (detected node): creates one
|
|
573
|
+
|
|
574
|
+
_after: created tsconfig.json_
|
|
575
|
+
|
|
576
|
+
```json
|
|
577
|
+
{
|
|
578
|
+
"extends": "@hublo/sentinel/tsconfig/node",
|
|
579
|
+
"include": [
|
|
580
|
+
"src"
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
### 4c. project.json only, no package.json: scaffolds a package.json
|
|
586
|
+
|
|
587
|
+
_after: scaffolded package.json_
|
|
588
|
+
|
|
589
|
+
```json
|
|
590
|
+
{
|
|
591
|
+
"name": "projonly",
|
|
592
|
+
"private": true,
|
|
593
|
+
"scripts": {
|
|
594
|
+
"typecheck": "sentinel --run --typescript"
|
|
595
|
+
},
|
|
596
|
+
"devDependencies": {
|
|
597
|
+
"@hublo/sentinel": "1.1.0-alpha.3"
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
## 5. Edge cases (clear message + non-zero exit, never a crash or silent pass)
|
|
603
|
+
|
|
604
|
+
**no verb**
|
|
605
|
+
|
|
606
|
+
```console
|
|
607
|
+
$ sentinel
|
|
608
|
+
Missing a verb. Supported: --run, --inspect, --init, --migrate, --report, --status.
|
|
609
|
+
(run "sentinel --help" for usage)
|
|
610
|
+
# exit: 1
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
**two verbs**
|
|
614
|
+
|
|
615
|
+
```console
|
|
616
|
+
$ sentinel --run --report
|
|
617
|
+
Pick exactly one verb: got --run, --report.
|
|
618
|
+
(run "sentinel --help" for usage)
|
|
619
|
+
# exit: 1
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
**unknown flag**
|
|
623
|
+
|
|
624
|
+
```console
|
|
625
|
+
$ sentinel --run --lnt
|
|
626
|
+
error: unknown option '--lnt'
|
|
627
|
+
(Did you mean --lint?)
|
|
628
|
+
(run "sentinel --help" for usage)
|
|
629
|
+
# exit: 1
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
**explicit unsupported target**
|
|
633
|
+
|
|
634
|
+
```console
|
|
635
|
+
$ sentinel --run --typescript --lint --module bff-admin
|
|
636
|
+
sentinel lint(oxlint): no .oxlintrc.json in this module; run `sentinel --init --lint` to adopt.
|
|
637
|
+
sentinel typescript: phase 1 (non-breaking) — deferred: noImplicitAny, noUnusedLocals, noUnusedParameters. Enabled centrally in a later wave; run `sentinel --inspect --typescript` for the list, or `sentinel --run --typescript -- --noImplicitAny` to measure what one would cost today.
|
|
638
|
+
✓ bff-admin (nest) lint
|
|
639
|
+
✓ bff-admin (nest) typescript
|
|
640
|
+
1 module(s) [named-module] in <n>ms
|
|
641
|
+
# exit: 0
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
**--all with a target**
|
|
645
|
+
|
|
646
|
+
```console
|
|
647
|
+
$ sentinel --report --all --typescript
|
|
648
|
+
--all runs every target; drop the specific one(s): --typescript.
|
|
649
|
+
(run "sentinel --help" for usage)
|
|
650
|
+
# exit: 1
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
**--dry-run without --init**
|
|
654
|
+
|
|
655
|
+
```console
|
|
656
|
+
$ sentinel --run --typescript --dry-run --module bff-admin
|
|
657
|
+
--dry-run only applies to --init (the read verbs never write).
|
|
658
|
+
(run "sentinel --help" for usage)
|
|
659
|
+
# exit: 1
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
**unknown --preset**
|
|
663
|
+
|
|
664
|
+
```console
|
|
665
|
+
$ sentinel --init --typescript --preset reactt
|
|
666
|
+
sentinel: unknown --preset "reactt". Supported: react, nest, svelte, node.
|
|
667
|
+
(run "sentinel --help" for usage)
|
|
668
|
+
# exit: 1
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
**unknown --module**
|
|
672
|
+
|
|
673
|
+
```console
|
|
674
|
+
$ sentinel --report --typescript --module nope
|
|
675
|
+
|
|
676
|
+
sentinel: module "nope" not found in the workspace.
|
|
677
|
+
# exit: 1
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
**preset with no preset yet (writes nothing, so it FAILS rather than looking adopted)**
|
|
681
|
+
|
|
682
|
+
```console
|
|
683
|
+
$ sentinel --init --typescript --preset svelte
|
|
684
|
+
sentinel (typescript): sentinel does not ship a TypeScript preset named "svelte" yet (shipped: nest, node, react). Nothing was written; this module cannot adopt the TypeScript preset until that preset ships.
|
|
685
|
+
# exit: 1
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
**bad --max-diagnostics**
|
|
689
|
+
|
|
690
|
+
```console
|
|
691
|
+
$ sentinel --report --typescript --max-diagnostics 3.9 --module bff-admin
|
|
692
|
+
--max-diagnostics must be a non-negative integer (0 = no cap); got "3.9".
|
|
693
|
+
(run "sentinel --help" for usage)
|
|
694
|
+
# exit: 1
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
**--init implicit-all (no flood)**
|
|
698
|
+
|
|
699
|
+
```console
|
|
700
|
+
$ sentinel --init --dry-run
|
|
701
|
+
dry run: no files written
|
|
702
|
+
wrote .oxlintrc.json extending ./node_modules/@hublo/sentinel/oxlint/nest.json (@hublo/sentinel@1.1.0-alpha.3)
|
|
703
|
+
2 rule(s) not enforced by this preset (1 no-barrel-files, 1 core). Run --inspect --lint for each rule and why.
|
|
704
|
+
run `pnpm install`, then `pnpm run lint`
|
|
705
|
+
|
|
706
|
+
create .oxlintrc.json
|
|
707
|
+
+ {
|
|
708
|
+
+ "extends": [
|
|
709
|
+
+ "./node_modules/@hublo/sentinel/oxlint/nest.json"
|
|
710
|
+
+ ]
|
|
711
|
+
+ }
|
|
712
|
+
|
|
713
|
+
update package.json
|
|
714
|
+
- { "name": "bff-admin", "dependencies": { "@nestjs/core": "^10" } }
|
|
715
|
+
+ {
|
|
716
|
+
+ "name": "bff-admin",
|
|
717
|
+
+ "dependencies": {
|
|
718
|
+
+ "@nestjs/core": "^10"
|
|
719
|
+
+ },
|
|
720
|
+
+ "scripts": {
|
|
721
|
+
+ "lint": "sentinel --run --lint"
|
|
722
|
+
+ },
|
|
723
|
+
+ "devDependencies": {
|
|
724
|
+
+ "@hublo/sentinel": "1.1.0-alpha.3"
|
|
725
|
+
+ }
|
|
726
|
+
+ }
|
|
727
|
+
|
|
728
|
+
update project.json
|
|
729
|
+
- { "name": "bff-admin", "root": "apps/bff-admin", "projectType": "application", "sourceRoot": "apps/bff-admin/src" }
|
|
730
|
+
+ {
|
|
731
|
+
+ "name": "bff-admin",
|
|
732
|
+
+ "root": "apps/bff-admin",
|
|
733
|
+
+ "projectType": "application",
|
|
734
|
+
+ "sourceRoot": "apps/bff-admin/src",
|
|
735
|
+
+ "targets": {
|
|
736
|
+
+ "lint": {
|
|
737
|
+
+ "executor": "nx:run-commands",
|
|
738
|
+
+ "cache": true,
|
|
739
|
+
+ "inputs": [
|
|
740
|
+
+ "default",
|
|
741
|
+
+ "{projectRoot}/.oxlintrc.json"
|
|
742
|
+
+ ],
|
|
743
|
+
+ "options": {
|
|
744
|
+
+ "cwd": "{projectRoot}",
|
|
745
|
+
+ "command": "pnpm run lint"
|
|
746
|
+
+ }
|
|
747
|
+
+ }
|
|
748
|
+
+ }
|
|
749
|
+
+ }
|
|
750
|
+
dry run: no files written
|
|
751
|
+
run `pnpm install` to fetch @hublo/sentinel (added to the module devDependencies) so `extends` and the typecheck script resolve
|
|
752
|
+
|
|
753
|
+
update tsconfig.json
|
|
754
|
+
- { "extends": "../../tsconfig.base.json", "include": ["src"] }
|
|
755
|
+
+ { "extends": [
|
|
756
|
+
+ "../../tsconfig.base.json",
|
|
757
|
+
+ "@hublo/sentinel/tsconfig/nest"
|
|
758
|
+
+ ], "include": ["src"] }
|
|
759
|
+
|
|
760
|
+
update package.json
|
|
761
|
+
- { "name": "bff-admin", "dependencies": { "@nestjs/core": "^10" } }
|
|
762
|
+
+ {
|
|
763
|
+
+ "name": "bff-admin",
|
|
764
|
+
+ "dependencies": {
|
|
765
|
+
+ "@nestjs/core": "^10"
|
|
766
|
+
+ },
|
|
767
|
+
+ "scripts": {
|
|
768
|
+
+ "typecheck": "sentinel --run --typescript"
|
|
769
|
+
+ },
|
|
770
|
+
+ "devDependencies": {
|
|
771
|
+
+ "@hublo/sentinel": "1.1.0-alpha.3"
|
|
772
|
+
+ }
|
|
773
|
+
+ }
|
|
774
|
+
# exit: 0
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
**no module and no workspace root**
|
|
778
|
+
|
|
779
|
+
```console
|
|
780
|
+
$ sentinel --run --typescript
|
|
781
|
+
|
|
782
|
+
sentinel: Run sentinel from a module directory or the workspace root (found neither package.json/project.json nor nx.json here).
|
|
783
|
+
# exit: 1
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
**ambiguous preset (Sails + React)**
|
|
787
|
+
|
|
788
|
+
```console
|
|
789
|
+
$ sentinel --report --typescript
|
|
790
|
+
sentinel: --report is deprecated, use --run --json (it still works)
|
|
791
|
+
sentinel: mixed: preset is ambiguous, detected "react" (from react), also found sails. Pass --preset to be explicit.
|
|
792
|
+
✓ mixed (react) typescript — errors=0 implicitAny=deferred
|
|
793
|
+
1 module(s) [cwd-module] in <n>ms
|
|
794
|
+
# exit: 0
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
---
|
|
798
|
+
_Generated. Regenerate with `pnpm build && bash scripts/gen-traces.sh`._
|