@hublo/sentinel 1.1.7 → 1.2.0-alpha.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.
- package/README.md +5 -4
- package/dist/bin/sentinel.js +20 -4
- package/dist/{chunk-W73ISYMG.js → chunk-FLJ2QNFF.js} +1227 -430
- package/dist/chunk-XVDOQ3G3.js +39 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/roles/build/react-app.d.ts +112 -0
- package/dist/roles/build/react-app.js +126 -0
- package/lint/nest.json +358 -0
- package/lint/node.json +52 -0
- package/lint/react-lib.json +376 -0
- package/lint/react.json +474 -0
- package/lint/svelte.json +209 -0
- package/lint/tools.json +197 -0
- package/oxlint/nest.json +2 -355
- package/oxlint/node.json +3 -50
- package/oxlint/react-lib.json +2 -373
- package/oxlint/react.json +2 -471
- package/oxlint/svelte.json +3 -207
- package/oxlint/tools.json +3 -195
- package/package.json +21 -2
package/README.md
CHANGED
|
@@ -43,8 +43,8 @@ A large monorepo accumulates:
|
|
|
43
43
|
|
|
44
44
|
sentinel writes **standard config files** into a project (each just `extends` a sentinel preset) and runs the checks. Your editor and the tools read those **normal files natively**, they never call sentinel at runtime, so nothing is coupled to it or brittle.
|
|
45
45
|
|
|
46
|
-
> **Shipped today:** the **TypeScript**, **lint** and **
|
|
47
|
-
> snippets below illustrate the end state and land with their own ticket.
|
|
46
|
+
> **Shipped today:** the **TypeScript**, **lint**, **format**, **build** and **dev** tools. The
|
|
47
|
+
> `--test` snippets below illustrate the end state and land with their own ticket.
|
|
48
48
|
|
|
49
49
|
**Step 1 — put a module on sentinel** (once per module, by a dev; the files are committed). Run from the app dir; `--init` does it all, nothing is hand-edited:
|
|
50
50
|
|
|
@@ -151,6 +151,7 @@ pnpm dlx @hublo/sentinel@<exact-version> --inspect --typescript --module <name>
|
|
|
151
151
|
- [`docs/using-sentinel.md`](docs/using-sentinel.md) — every verb for every role, scoping a run to some files, what a fully adopted module looks like, and how versions move between modules.
|
|
152
152
|
- [`docs/lint-adoption.md`](docs/lint-adoption.md) — migrating a module from ESLint to Oxlint: the two steps, what `--init` writes and removes, the two react tiers, and the failures worth recognising.
|
|
153
153
|
- [`docs/format-adoption.md`](docs/format-adoption.md) — migrating a module from Prettier to oxfmt: why this config is materialized rather than a stub, how a module keeps its own formatting, and what did not survive the move.
|
|
154
|
+
- [`docs/build-adoption.md`](docs/build-adoption.md) — moving a React app's Vite toolchain into sentinel: what the config becomes, what sentinel owns versus what stays the app's, why overriding merges instead of spreading, and why an existing config is not rewritten.
|
|
154
155
|
- [`docs/typescript-adoption.md`](docs/typescript-adoption.md) — the adoption cheat sheet: the two adoption steps, the command model (verb x type x location), options, reading a report, and troubleshooting.
|
|
155
156
|
- [`docs/typescript-traces.md`](docs/typescript-traces.md) — a **generated, versioned** reference of live command + output traces (every verb, option, config result and edge case) against the mock monorepo. Regenerate after CLI changes with `pnpm docs:traces`.
|
|
156
157
|
|
|
@@ -376,9 +377,9 @@ VERBS --run execute the target's tool (--json for metrics + diagnosti
|
|
|
376
377
|
--report deprecated → --run --json
|
|
377
378
|
--status deprecated → --inspect
|
|
378
379
|
|
|
379
|
-
TYPES --lint --format --typescript --build --test
|
|
380
|
+
TYPES --lint --format --typescript --build --dev --test
|
|
380
381
|
--static-analysis --runtime-analysis --arch
|
|
381
|
-
(omit a type →
|
|
382
|
+
(omit a type → every type that TERMINATES; --dev never sweeps)
|
|
382
383
|
|
|
383
384
|
LOCATION in a MODULE dir → that module (do NOT pass --module)
|
|
384
385
|
at the workspace ROOT → --module <name> (one) · --ci (affected) · else all
|
package/dist/bin/sentinel.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
PRESET_NAMES,
|
|
4
|
+
PresetUnsupportedError,
|
|
5
|
+
SWEEPABLE_TARGETS,
|
|
4
6
|
TARGETS,
|
|
5
7
|
VERBS,
|
|
6
8
|
WORKSPACE_ROOT_MARKER,
|
|
7
9
|
availableTargets,
|
|
10
|
+
declaredPresetFor,
|
|
8
11
|
describeFramework,
|
|
9
12
|
dispatch,
|
|
10
13
|
ensureWorkspacePrep,
|
|
@@ -17,7 +20,8 @@ import {
|
|
|
17
20
|
registerAdapters,
|
|
18
21
|
resolve,
|
|
19
22
|
resolveBin
|
|
20
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-FLJ2QNFF.js";
|
|
24
|
+
import "../chunk-XVDOQ3G3.js";
|
|
21
25
|
|
|
22
26
|
// bin/sentinel.ts
|
|
23
27
|
import { program } from "commander";
|
|
@@ -145,6 +149,17 @@ async function runInit(ctx) {
|
|
|
145
149
|
});
|
|
146
150
|
worst = Math.max(worst, code);
|
|
147
151
|
} catch (error) {
|
|
152
|
+
if (error instanceof PresetUnsupportedError) {
|
|
153
|
+
if (ctx.targetsExplicit) {
|
|
154
|
+
process.stderr.write(
|
|
155
|
+
`
|
|
156
|
+
sentinel (${type}): this module's preset is "${error.preset}", and --${type} has no adapter for it. Pass --preset if it was detected wrongly (hoisted dependencies make detection fall back to "node").
|
|
157
|
+
`
|
|
158
|
+
);
|
|
159
|
+
worst = Math.max(worst, 1);
|
|
160
|
+
}
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
148
163
|
process.stderr.write(`
|
|
149
164
|
sentinel (${type}): ${asMessage(error)}
|
|
150
165
|
`);
|
|
@@ -197,8 +212,9 @@ async function analyse(params) {
|
|
|
197
212
|
}
|
|
198
213
|
for (const target of params.targets) {
|
|
199
214
|
let adapter;
|
|
215
|
+
const resolutionPreset = params.preset ?? declaredPresetFor(target, module.root) ?? preset2;
|
|
200
216
|
try {
|
|
201
|
-
adapter = resolve(target,
|
|
217
|
+
adapter = resolve(target, resolutionPreset, params.runner);
|
|
202
218
|
} catch (error) {
|
|
203
219
|
if (params.targetsExplicit) {
|
|
204
220
|
const reason = error instanceof Error ? error.message : String(error);
|
|
@@ -417,7 +433,7 @@ function statusCoverage(items) {
|
|
|
417
433
|
};
|
|
418
434
|
}
|
|
419
435
|
function presetShort(preset2) {
|
|
420
|
-
return typeof preset2 === "string" ? preset2.replace(
|
|
436
|
+
return typeof preset2 === "string" ? preset2.replace(/@hublo\/sentinel\/(typescript|tsconfig)\//, "") : "?";
|
|
421
437
|
}
|
|
422
438
|
function renderStatusRow(item, p) {
|
|
423
439
|
if (item.status === "unsupported") return renderUnsupportedRow(item, p);
|
|
@@ -650,7 +666,7 @@ if (opts.all && namedTargets.length > 0) {
|
|
|
650
666
|
`--all runs every target; drop the specific one(s): ${namedTargets.map((t) => `--${t}`).join(", ")}.`
|
|
651
667
|
);
|
|
652
668
|
}
|
|
653
|
-
var targets = opts.all || namedTargets.length === 0 ? [...
|
|
669
|
+
var targets = opts.all || namedTargets.length === 0 ? [...SWEEPABLE_TARGETS] : namedTargets;
|
|
654
670
|
var targetsExplicit = !(opts.all || namedTargets.length === 0);
|
|
655
671
|
var maxDiagnostics = Number(opts.maxDiagnostics);
|
|
656
672
|
if (!Number.isInteger(maxDiagnostics) || maxDiagnostics < 0) {
|