@nodeve/checks 1.2.1 → 1.4.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/README.md +46 -18
- package/dist/bin/catalog.js +3 -93
- package/dist/bin/catalog.js.map +1 -1
- package/dist/bin/check.d.ts +3 -0
- package/dist/bin/check.d.ts.map +1 -0
- package/dist/bin/check.js +69 -0
- package/dist/bin/check.js.map +1 -0
- package/dist/bin/clones.js +3 -58
- package/dist/bin/clones.js.map +1 -1
- package/dist/bin/commit-msg.js +3 -81
- package/dist/bin/commit-msg.js.map +1 -1
- package/dist/bin/doc-tokens.js +3 -66
- package/dist/bin/doc-tokens.js.map +1 -1
- package/dist/bin/file-size.js +3 -64
- package/dist/bin/file-size.js.map +1 -1
- package/dist/bin/helper-collisions.js +3 -92
- package/dist/bin/helper-collisions.js.map +1 -1
- package/dist/bin/inline-dupes.js +3 -77
- package/dist/bin/inline-dupes.js.map +1 -1
- package/dist/bin/page-size.js +3 -43
- package/dist/bin/page-size.js.map +1 -1
- package/dist/bin/require-deps.js +3 -47
- package/dist/bin/require-deps.js.map +1 -1
- package/dist/bin/reshape.js +3 -139
- package/dist/bin/reshape.js.map +1 -1
- package/dist/checks/catalog.d.ts +3 -0
- package/dist/checks/catalog.d.ts.map +1 -0
- package/dist/checks/catalog.js +100 -0
- package/dist/checks/catalog.js.map +1 -0
- package/dist/checks/clones.d.ts +3 -0
- package/dist/checks/clones.d.ts.map +1 -0
- package/dist/checks/clones.js +107 -0
- package/dist/checks/clones.js.map +1 -0
- package/dist/checks/commit-msg.d.ts +3 -0
- package/dist/checks/commit-msg.d.ts.map +1 -0
- package/dist/checks/commit-msg.js +88 -0
- package/dist/checks/commit-msg.js.map +1 -0
- package/dist/checks/doc-tokens.d.ts +13 -0
- package/dist/checks/doc-tokens.d.ts.map +1 -0
- package/dist/checks/doc-tokens.js +40 -0
- package/dist/checks/doc-tokens.js.map +1 -0
- package/dist/checks/file-size.d.ts +14 -0
- package/dist/checks/file-size.d.ts.map +1 -0
- package/dist/checks/file-size.js +36 -0
- package/dist/checks/file-size.js.map +1 -0
- package/dist/checks/helper-collisions.d.ts +3 -0
- package/dist/checks/helper-collisions.d.ts.map +1 -0
- package/dist/checks/helper-collisions.js +105 -0
- package/dist/checks/helper-collisions.js.map +1 -0
- package/dist/checks/inline-dupes.d.ts +3 -0
- package/dist/checks/inline-dupes.d.ts.map +1 -0
- package/dist/checks/inline-dupes.js +87 -0
- package/dist/checks/inline-dupes.js.map +1 -0
- package/dist/checks/page-size.d.ts +15 -0
- package/dist/checks/page-size.d.ts.map +1 -0
- package/dist/checks/page-size.js +32 -0
- package/dist/checks/page-size.js.map +1 -0
- package/dist/checks/require-deps.d.ts +19 -0
- package/dist/checks/require-deps.d.ts.map +1 -0
- package/dist/checks/require-deps.js +48 -0
- package/dist/checks/require-deps.js.map +1 -0
- package/dist/checks/reshape.d.ts +3 -0
- package/dist/checks/reshape.d.ts.map +1 -0
- package/dist/checks/reshape.js +138 -0
- package/dist/checks/reshape.js.map +1 -0
- package/dist/lib/bin.d.ts +9 -2
- package/dist/lib/bin.d.ts.map +1 -1
- package/dist/lib/bin.js +9 -4
- package/dist/lib/bin.js.map +1 -1
- package/dist/lib/config.d.ts +9 -39
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +12 -5
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/defaults.d.ts +22 -11
- package/dist/lib/defaults.d.ts.map +1 -1
- package/dist/lib/defaults.js +18 -16
- package/dist/lib/defaults.js.map +1 -1
- package/dist/lib/length.d.ts +62 -0
- package/dist/lib/length.d.ts.map +1 -0
- package/dist/lib/length.js +121 -0
- package/dist/lib/length.js.map +1 -0
- package/dist/lib/registry.d.ts +6 -0
- package/dist/lib/registry.d.ts.map +1 -0
- package/dist/lib/registry.js +34 -0
- package/dist/lib/registry.js.map +1 -0
- package/dist/lib/report.d.ts +40 -0
- package/dist/lib/report.d.ts.map +1 -0
- package/dist/lib/report.js +28 -0
- package/dist/lib/report.js.map +1 -0
- package/dist/lib/runner.d.ts +43 -0
- package/dist/lib/runner.d.ts.map +1 -0
- package/dist/lib/runner.js +41 -0
- package/dist/lib/runner.js.map +1 -0
- package/lefthook.checks.yml +38 -27
- package/nodeve.checks.defaults.js +18 -16
- package/package.json +3 -2
|
@@ -1,94 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* (e.g. local `clamp255` ≈ remeda `clamp`). Matching is token-set based
|
|
6
|
-
* (`@nodeve/text` `identifierSimilarity`), so transpositions like
|
|
7
|
-
* `byGroup`/`groupBy` are caught where edit-distance fails.
|
|
8
|
-
*
|
|
9
|
-
* Routing a hit is a JUDGEMENT call — delete-and-import, wrap the lib, rename for
|
|
10
|
-
* specificity, or allowlist. BLOCKS by default: any non-allowlisted finding
|
|
11
|
-
* exits 1. `--warn` downgrades to report-only.
|
|
12
|
-
*
|
|
13
|
-
* Matches against the committed lib-names index (`helperCollisions.libNamesPath`,
|
|
14
|
-
* regen with `nodeve-build-lib-names`). The index is committed so the gate has no
|
|
15
|
-
* runtime dependency on the libs being installed.
|
|
16
|
-
*/
|
|
17
|
-
import { identifierSimilarityMatch } from '@nodeve/text/similarity';
|
|
18
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
19
|
-
import { join } from 'node:path';
|
|
20
|
-
import ts from 'typescript';
|
|
21
|
-
import { parseSource } from '../lib/ast.js';
|
|
22
|
-
import { loadGate, tsSources } from '../lib/bin.js';
|
|
23
|
-
const { root, cfg, paths, warn, verbose, allowlist } = await loadGate('helperCollisions');
|
|
24
|
-
function loadLibIndex() {
|
|
25
|
-
const path = join(root, cfg.libNamesPath);
|
|
26
|
-
// Missing index → no-op (clean), not a crash: a repo that hasn't run
|
|
27
|
-
// `nodeve-build-lib-names` yet shouldn't fail the commit on this advisory gate.
|
|
28
|
-
if (!existsSync(path))
|
|
29
|
-
return [];
|
|
30
|
-
const { names } = JSON.parse(readFileSync(path, 'utf8'));
|
|
31
|
-
return Object.entries(names).flatMap(([lib, list]) => list.map((name) => ({ lib, name })));
|
|
32
|
-
}
|
|
33
|
-
/** Top-level `function` / arrow-const declaration names in a source file. */
|
|
34
|
-
function declaredFunctionNames(absPath) {
|
|
35
|
-
const src = parseSource(absPath);
|
|
36
|
-
const out = [];
|
|
37
|
-
for (const stmt of src.statements) {
|
|
38
|
-
if (ts.isFunctionDeclaration(stmt) && stmt.name)
|
|
39
|
-
out.push(stmt.name.text);
|
|
40
|
-
else if (ts.isVariableStatement(stmt))
|
|
41
|
-
for (const d of stmt.declarationList.declarations)
|
|
42
|
-
if (ts.isIdentifier(d.name) &&
|
|
43
|
-
d.initializer &&
|
|
44
|
-
(ts.isArrowFunction(d.initializer) || ts.isFunctionExpression(d.initializer)))
|
|
45
|
-
out.push(d.name.text);
|
|
46
|
-
}
|
|
47
|
-
return out;
|
|
48
|
-
}
|
|
49
|
-
function bestMatch(name, libIndex) {
|
|
50
|
-
let best = null;
|
|
51
|
-
for (const lib of libIndex) {
|
|
52
|
-
const match = identifierSimilarityMatch(name, lib.name, {
|
|
53
|
-
keywords: cfg.libKeywords[lib.lib],
|
|
54
|
-
aliases: cfg.aliases[lib.name],
|
|
55
|
-
});
|
|
56
|
-
const matched = match.matchedAs === lib.name ? lib : { ...lib, matchedAs: match.matchedAs };
|
|
57
|
-
const score = match.score;
|
|
58
|
-
if (!best || score > best.score)
|
|
59
|
-
best = { lib: matched, score };
|
|
60
|
-
}
|
|
61
|
-
return best && best.score >= cfg.threshold ? best : null;
|
|
62
|
-
}
|
|
63
|
-
const libIndex = loadLibIndex();
|
|
64
|
-
const collisions = new Map();
|
|
65
|
-
for (const rel of tsSources(root, cfg.globs, paths)) {
|
|
66
|
-
const abs = join(root, rel);
|
|
67
|
-
for (const name of declaredFunctionNames(abs)) {
|
|
68
|
-
const m = bestMatch(name, libIndex);
|
|
69
|
-
if (!m)
|
|
70
|
-
continue;
|
|
71
|
-
const pairKey = `${name}→${m.lib.name}`;
|
|
72
|
-
if (allowlist.has(`${rel}::${pairKey}`))
|
|
73
|
-
continue;
|
|
74
|
-
const found = collisions.get(pairKey) ?? { name, lib: m.lib, score: m.score, files: new Set() };
|
|
75
|
-
found.files.add(rel);
|
|
76
|
-
collisions.set(pairKey, found);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const sorted = [...collisions.values()].sort((a, b) => b.score - a.score);
|
|
80
|
-
if (sorted.length === 0) {
|
|
81
|
-
if (verbose)
|
|
82
|
-
console.log(`helper-collisions: clean (${libIndex.length} lib fns checked)`);
|
|
83
|
-
process.exit(0);
|
|
84
|
-
}
|
|
85
|
-
console.log(`helper-collisions: ${sorted.length} local function(s) may reinvent a dependency export.\n` +
|
|
86
|
-
`Resolve per case — delete + import, wrap the lib, rename for specificity, or allowlist:\n`);
|
|
87
|
-
for (const f of sorted) {
|
|
88
|
-
const matchedAs = f.lib.matchedAs ? ` (matched ${f.lib.matchedAs})` : '';
|
|
89
|
-
console.log(` ${f.score.toFixed(2)} ${f.name} ≈ ${f.lib.lib}.${f.lib.name}${matchedAs}`);
|
|
90
|
-
for (const file of f.files)
|
|
91
|
-
console.log(` ${file}`);
|
|
92
|
-
}
|
|
93
|
-
process.exit(warn ? 0 : 1);
|
|
2
|
+
import { helperCollisions } from '../checks/helper-collisions.js';
|
|
3
|
+
import { runBin } from '../lib/runner.js';
|
|
4
|
+
await runBin(helperCollisions);
|
|
94
5
|
//# sourceMappingURL=helper-collisions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper-collisions.js","sourceRoot":"","sources":["../../src/bin/helper-collisions.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"helper-collisions.js","sourceRoot":"","sources":["../../src/bin/helper-collisions.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC"}
|
package/dist/bin/inline-dupes.js
CHANGED
|
@@ -1,79 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* package and be imported instead.
|
|
6
|
-
*
|
|
7
|
-
* BLOCKS by default: any non-allowlisted finding exits 1. Clear it by:
|
|
8
|
-
* - a uniform SET of names recurring together (a shared prologue, the same
|
|
9
|
-
* handful of locals) → extract them into one shared module and give the
|
|
10
|
-
* bundle a TS type/interface, then import it (see `lib/bin.ts#Gate`);
|
|
11
|
-
* - a single helper duplicated → move it to a shared package and import;
|
|
12
|
-
* - a confirmed false positive → add the name to `inlineDupes.allowlist`
|
|
13
|
-
* with a WHY comment.
|
|
14
|
-
* `--warn` downgrades to report-only.
|
|
15
|
-
*
|
|
16
|
-
* Scope: `inlineDupes.globs` (default `apps/`, `packages/`). Note this always
|
|
17
|
-
* scans the full configured scope, not just staged files — a dupe is a
|
|
18
|
-
* relationship between two files, so the second file landing must see the first.
|
|
19
|
-
*/
|
|
20
|
-
import { join } from 'node:path';
|
|
21
|
-
import ts from 'typescript';
|
|
22
|
-
import { parseSource } from '../lib/ast.js';
|
|
23
|
-
import { loadGate, tsSources } from '../lib/bin.js';
|
|
24
|
-
const { root, cfg, warn, verbose, allowlist } = await loadGate('inlineDupes');
|
|
25
|
-
/**
|
|
26
|
-
* Non-exported top-level names in a source file: private `const` and
|
|
27
|
-
* `function` declarations. Exported names (SvelteKit `load`, `actions`,
|
|
28
|
-
* HTTP verbs, etc.) are skipped — they're legitimately repeated per route.
|
|
29
|
-
*/
|
|
30
|
-
function topLevelNames(absPath) {
|
|
31
|
-
const src = parseSource(absPath);
|
|
32
|
-
const out = [];
|
|
33
|
-
for (const stmt of src.statements) {
|
|
34
|
-
const isExported = ts.canHaveModifiers(stmt) &&
|
|
35
|
-
(ts.getModifiers(stmt)?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword) ?? false);
|
|
36
|
-
if (isExported)
|
|
37
|
-
continue;
|
|
38
|
-
if (ts.isFunctionDeclaration(stmt) && stmt.name) {
|
|
39
|
-
out.push(stmt.name.text);
|
|
40
|
-
}
|
|
41
|
-
else if (ts.isVariableStatement(stmt)) {
|
|
42
|
-
for (const d of stmt.declarationList.declarations) {
|
|
43
|
-
if (ts.isIdentifier(d.name))
|
|
44
|
-
out.push(d.name.text);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return out;
|
|
49
|
-
}
|
|
50
|
-
const nameToFiles = new Map();
|
|
51
|
-
// paths `[]`: always scan full scope (see header) regardless of staged files.
|
|
52
|
-
for (const rel of tsSources(root, cfg.globs)) {
|
|
53
|
-
const abs = join(root, rel);
|
|
54
|
-
for (const name of topLevelNames(abs)) {
|
|
55
|
-
if (allowlist.has(name))
|
|
56
|
-
continue;
|
|
57
|
-
const files = nameToFiles.get(name) ?? new Set();
|
|
58
|
-
files.add(rel);
|
|
59
|
-
nameToFiles.set(name, files);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const dupes = [...nameToFiles.entries()]
|
|
63
|
-
.filter(([, files]) => files.size >= 2)
|
|
64
|
-
.sort((a, b) => b[1].size - a[1].size || a[0].localeCompare(b[0]));
|
|
65
|
-
if (dupes.length === 0) {
|
|
66
|
-
if (verbose)
|
|
67
|
-
console.log('inline-dupes: clean');
|
|
68
|
-
process.exit(0);
|
|
69
|
-
}
|
|
70
|
-
console.log(`inline-dupes: ${dupes.length} name(s) declared in multiple files.\n` +
|
|
71
|
-
`Extract to a shared package and import — if several names recur together,\n` +
|
|
72
|
-
`pull them into one module with a shared TS type — or allowlist with a WHY comment:\n`);
|
|
73
|
-
for (const [name, files] of dupes) {
|
|
74
|
-
console.log(` ${name} (${files.size} files)`);
|
|
75
|
-
for (const file of files)
|
|
76
|
-
console.log(` ${file}`);
|
|
77
|
-
}
|
|
78
|
-
process.exit(warn ? 0 : 1);
|
|
2
|
+
import { inlineDupes } from '../checks/inline-dupes.js';
|
|
3
|
+
import { runBin } from '../lib/runner.js';
|
|
4
|
+
await runBin(inlineDupes);
|
|
79
5
|
//# sourceMappingURL=inline-dupes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-dupes.js","sourceRoot":"","sources":["../../src/bin/inline-dupes.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"inline-dupes.js","sourceRoot":"","sources":["../../src/bin/inline-dupes.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
package/dist/bin/page-size.js
CHANGED
|
@@ -1,45 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* WHY: an oversized template/module is a signal the unit is doing work that
|
|
7
|
-
* belongs in dedicated files — most often a SvelteKit `+page.svelte` with
|
|
8
|
-
* components defined inline that should be ripped out into their own files.
|
|
9
|
-
* Defaults to `{ glob: '*+page.svelte', maxLines: 280 }`; any glob → line
|
|
10
|
-
* budget works.
|
|
11
|
-
*
|
|
12
|
-
* No-op when a repo's rules list is empty. Pass explicit paths (lefthook
|
|
13
|
-
* `{staged_files}`) to scope; a path is checked under every rule whose glob it
|
|
14
|
-
* would match via `git ls-files`.
|
|
15
|
-
*/
|
|
16
|
-
import { loadGate } from '../lib/bin.js';
|
|
17
|
-
import { gitFiles, lineCount } from '../lib/repo.js';
|
|
18
|
-
const { root, cfg, paths } = await loadGate('pageSize');
|
|
19
|
-
if (cfg.rules.length === 0)
|
|
20
|
-
process.exit(0);
|
|
21
|
-
const offenders = [];
|
|
22
|
-
const seen = new Set();
|
|
23
|
-
for (const rule of cfg.rules) {
|
|
24
|
-
// All tracked files matching this rule's glob, intersected with explicit
|
|
25
|
-
// paths (lefthook `{staged_files}`) when given.
|
|
26
|
-
const matched = gitFiles(root, [rule.glob]);
|
|
27
|
-
const targets = paths.length > 0 ? matched.filter((f) => paths.includes(f)) : matched;
|
|
28
|
-
for (const path of targets) {
|
|
29
|
-
const key = `${path}::${rule.maxLines}`;
|
|
30
|
-
if (seen.has(key))
|
|
31
|
-
continue;
|
|
32
|
-
seen.add(key);
|
|
33
|
-
const lines = lineCount(root, path);
|
|
34
|
-
if (lines > rule.maxLines)
|
|
35
|
-
offenders.push({ path, lines, max: rule.maxLines });
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (offenders.length === 0)
|
|
39
|
-
process.exit(0);
|
|
40
|
-
console.error('\n✖ file(s) over line budget — rip inline components out into their own files:\n');
|
|
41
|
-
for (const o of offenders.sort((a, b) => b.lines - a.lines))
|
|
42
|
-
console.error(` ${String(o.lines).padStart(5)}/${o.max}L ${o.path}`);
|
|
43
|
-
console.error('');
|
|
44
|
-
process.exit(1);
|
|
2
|
+
import { pageSize } from '../checks/page-size.js';
|
|
3
|
+
import { runBin } from '../lib/runner.js';
|
|
4
|
+
await runBin(pageSize);
|
|
45
5
|
//# sourceMappingURL=page-size.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-size.js","sourceRoot":"","sources":["../../src/bin/page-size.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"page-size.js","sourceRoot":"","sources":["../../src/bin/page-size.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC"}
|
package/dist/bin/require-deps.js
CHANGED
|
@@ -1,49 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* helpers — rather than force every package to take the dep, we require it in the
|
|
6
|
-
* catalog so the blessed version is single-sourced and any package can adopt it
|
|
7
|
-
* with `catalog:`. Cataloguing it is the signal that its use is expected (and it
|
|
8
|
-
* pairs with helper-collisions, which flags inline reinventions of its exports).
|
|
9
|
-
*
|
|
10
|
-
* A dependency counts as satisfied if it's a key in the default catalog or any
|
|
11
|
-
* named `catalogs.<group>`. Configure the list via `requireDeps.deps` in
|
|
12
|
-
* nodeve.checks.js (default `['remeda']`); set `deps: []` to opt out.
|
|
13
|
-
*
|
|
14
|
-
* Workspace discovery is shared with the catalog gate (pnpm-workspace.yaml or
|
|
15
|
-
* package.json#workspaces), so it gates pnpm and Bun repos alike.
|
|
16
|
-
*/
|
|
17
|
-
import { loadGate } from '../lib/bin.js';
|
|
18
|
-
import { readWorkspace } from '../lib/repo.js';
|
|
19
|
-
const { root, cfg, warn, verbose } = await loadGate('requireDeps');
|
|
20
|
-
if (cfg.deps.length === 0) {
|
|
21
|
-
if (verbose)
|
|
22
|
-
console.log('require-deps: no required deps configured — nothing to enforce');
|
|
23
|
-
process.exit(0);
|
|
24
|
-
}
|
|
25
|
-
const workspace = readWorkspace(root);
|
|
26
|
-
if (!workspace) {
|
|
27
|
-
if (verbose)
|
|
28
|
-
console.log('require-deps: no workspace manifest found — nothing to enforce');
|
|
29
|
-
process.exit(0);
|
|
30
|
-
}
|
|
31
|
-
// A dep is satisfied if any catalog (default or a named group) defines it.
|
|
32
|
-
const catalogued = new Set([
|
|
33
|
-
...Object.keys(workspace.catalog),
|
|
34
|
-
...Object.values(workspace.catalogs).flatMap((group) => Object.keys(group)),
|
|
35
|
-
]);
|
|
36
|
-
const missing = cfg.deps.filter((dep) => !catalogued.has(dep));
|
|
37
|
-
if (missing.length === 0) {
|
|
38
|
-
if (verbose)
|
|
39
|
-
console.log('require-deps: clean');
|
|
40
|
-
process.exit(0);
|
|
41
|
-
}
|
|
42
|
-
console.error('\n✖ the workspace catalog must define these org-required dependencies:\n');
|
|
43
|
-
for (const dep of missing)
|
|
44
|
-
console.error(` ${dep}`);
|
|
45
|
-
console.error(`\n Add them to the catalog (pnpm-workspace.yaml or package.json#workspaces), e.g.\n` +
|
|
46
|
-
` \`pnpm add -w ${missing.join(' ')}\`, so packages can adopt them with "catalog:".\n` +
|
|
47
|
-
' Set `requireDeps: { deps: [] }` in nodeve.checks.js to opt out.\n');
|
|
48
|
-
process.exit(warn ? 0 : 1);
|
|
2
|
+
import { requireDeps } from '../checks/require-deps.js';
|
|
3
|
+
import { runBin } from '../lib/runner.js';
|
|
4
|
+
await runBin(requireDeps);
|
|
49
5
|
//# sourceMappingURL=require-deps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-deps.js","sourceRoot":"","sources":["../../src/bin/require-deps.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"require-deps.js","sourceRoot":"","sources":["../../src/bin/require-deps.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
package/dist/bin/reshape.js
CHANGED
|
@@ -1,141 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* Flags ONLY when the output provably mirrors the input — zero false positives
|
|
7
|
-
* on legitimate renames (`c => ({ value: c.id })`) or additions (`x => ({...x, n})`):
|
|
8
|
-
*
|
|
9
|
-
* x => x identity (no-op map)
|
|
10
|
-
* x => ({ ...x }) spread-clone (reinvents structuredClone)
|
|
11
|
-
* x => ({ a: x.a, b: x.b }) projection (reinvents remeda.pick)
|
|
12
|
-
* ({ a, b }) => ({ a, b }) passthrough (destructure-rebuild = pick / no-op)
|
|
13
|
-
*
|
|
14
|
-
* Routing a hit is a JUDGEMENT call: delete the reshape and pass the value as-is,
|
|
15
|
-
* use a pick/clone helper if narrowing is genuinely the point, or allowlist a
|
|
16
|
-
* confirmed boundary (config `reshape.allowlist`, `relPath::kind::keys`). A rename
|
|
17
|
-
* that only dodges the match keeps the smell.
|
|
18
|
-
*
|
|
19
|
-
* BLOCKS by default: any non-allowlisted finding exits 1. `--warn` downgrades to
|
|
20
|
-
* report-only (exit 0). Pass explicit paths (lefthook `{staged_files}`) to scope.
|
|
21
|
-
*/
|
|
22
|
-
import { readFileSync } from 'node:fs';
|
|
23
|
-
import { join } from 'node:path';
|
|
24
|
-
import ts from 'typescript';
|
|
25
|
-
import { loadGate, tsSources } from '../lib/bin.js';
|
|
26
|
-
const { root, cfg, paths, warn, verbose, allowlist } = await loadGate('reshape');
|
|
27
|
-
/** Strip `!` and parens so `item.href!` reads as the bare property access. */
|
|
28
|
-
function unwrap(node) {
|
|
29
|
-
let n = node;
|
|
30
|
-
while (ts.isNonNullExpression(n) || ts.isParenthesizedExpression(n))
|
|
31
|
-
n = n.expression;
|
|
32
|
-
return n;
|
|
33
|
-
}
|
|
34
|
-
/** The single returned expression of a concise arrow or a `return`-only body. */
|
|
35
|
-
function returnExpr(fn) {
|
|
36
|
-
if (ts.isArrowFunction(fn) && !ts.isBlock(fn.body))
|
|
37
|
-
return unwrap(fn.body);
|
|
38
|
-
const body = fn.body;
|
|
39
|
-
if (!body || !ts.isBlock(body) || body.statements.length !== 1)
|
|
40
|
-
return null;
|
|
41
|
-
const [stmt] = body.statements;
|
|
42
|
-
return ts.isReturnStatement(stmt) && stmt.expression ? unwrap(stmt.expression) : null;
|
|
43
|
-
}
|
|
44
|
-
/** True when `fn` is the callback argument of a `.map(...)` / `.flatMap(...)`. */
|
|
45
|
-
function isMapCallback(fn) {
|
|
46
|
-
const call = fn.parent;
|
|
47
|
-
return (!!call &&
|
|
48
|
-
ts.isCallExpression(call) &&
|
|
49
|
-
call.arguments.includes(fn) &&
|
|
50
|
-
ts.isPropertyAccessExpression(call.expression) &&
|
|
51
|
-
(call.expression.name.text === 'map' || call.expression.name.text === 'flatMap'));
|
|
52
|
-
}
|
|
53
|
-
/** Classify a reshape callback, or null if it does real work. */
|
|
54
|
-
function classify(fn) {
|
|
55
|
-
if (fn.parameters.length !== 1)
|
|
56
|
-
return null; // (x, i) => ... uses the index — not a pure reshape
|
|
57
|
-
const param = fn.parameters[0].name;
|
|
58
|
-
const body = returnExpr(fn);
|
|
59
|
-
if (!body)
|
|
60
|
-
return null;
|
|
61
|
-
// x => x — a no-op ONLY inside a map; elsewhere it's a legit typed-identity
|
|
62
|
-
// helper or an API-required passthrough callback (`(content) => content`).
|
|
63
|
-
if (ts.isIdentifier(param) && ts.isIdentifier(body) && body.text === param.text)
|
|
64
|
-
return isMapCallback(fn) ? { kind: 'identity', keys: 'self' } : null;
|
|
65
|
-
if (!ts.isObjectLiteralExpression(body) || body.properties.length === 0)
|
|
66
|
-
return null;
|
|
67
|
-
const props = body.properties;
|
|
68
|
-
// x => ({ ...x }) — spread of the param, nothing else
|
|
69
|
-
if (ts.isIdentifier(param) &&
|
|
70
|
-
props.length === 1 &&
|
|
71
|
-
ts.isSpreadAssignment(props[0]) &&
|
|
72
|
-
ts.isIdentifier(props[0].expression) &&
|
|
73
|
-
props[0].expression.text === param.text)
|
|
74
|
-
return { kind: 'spread-clone', keys: '...' };
|
|
75
|
-
// x => ({ a: x.a, b: x.b }) — every prop is `name: param.name`, same name
|
|
76
|
-
if (ts.isIdentifier(param)) {
|
|
77
|
-
const keys = [];
|
|
78
|
-
for (const p of props) {
|
|
79
|
-
if (!ts.isPropertyAssignment(p) || !ts.isIdentifier(p.name))
|
|
80
|
-
return null;
|
|
81
|
-
const val = unwrap(p.initializer);
|
|
82
|
-
if (!ts.isPropertyAccessExpression(val) ||
|
|
83
|
-
!ts.isIdentifier(val.expression) ||
|
|
84
|
-
val.expression.text !== param.text ||
|
|
85
|
-
val.name.text !== p.name.text)
|
|
86
|
-
return null;
|
|
87
|
-
keys.push(p.name.text);
|
|
88
|
-
}
|
|
89
|
-
return { kind: 'projection', keys: keys.sort().join(', ') };
|
|
90
|
-
}
|
|
91
|
-
// ({ a, b }) => ({ a, b }) — destructure, rebuild the identical shorthand set
|
|
92
|
-
if (ts.isObjectBindingPattern(param)) {
|
|
93
|
-
const bound = new Set();
|
|
94
|
-
for (const el of param.elements) {
|
|
95
|
-
// rename / default / rest changes meaning — not a pure passthrough
|
|
96
|
-
if (el.dotDotDotToken || el.propertyName || el.initializer || !ts.isIdentifier(el.name))
|
|
97
|
-
return null;
|
|
98
|
-
bound.add(el.name.text);
|
|
99
|
-
}
|
|
100
|
-
const keys = [];
|
|
101
|
-
for (const p of props) {
|
|
102
|
-
if (!ts.isShorthandPropertyAssignment(p))
|
|
103
|
-
return null;
|
|
104
|
-
keys.push(p.name.text);
|
|
105
|
-
}
|
|
106
|
-
if (keys.length !== bound.size || !keys.every((k) => bound.has(k)))
|
|
107
|
-
return null;
|
|
108
|
-
return { kind: 'passthrough', keys: keys.sort().join(', ') };
|
|
109
|
-
}
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
const findings = [];
|
|
113
|
-
for (const rel of tsSources(root, cfg.globs, paths)) {
|
|
114
|
-
const abs = join(root, rel);
|
|
115
|
-
const src = ts.createSourceFile(abs, readFileSync(abs, 'utf8'), ts.ScriptTarget.Latest, true);
|
|
116
|
-
const visit = (node) => {
|
|
117
|
-
if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
|
|
118
|
-
const hit = classify(node);
|
|
119
|
-
if (hit && !allowlist.has(`${rel}::${hit.kind}::${hit.keys}`)) {
|
|
120
|
-
const { line } = src.getLineAndCharacterOfPosition(node.getStart());
|
|
121
|
-
findings.push({ rel, line: line + 1, kind: hit.kind, keys: hit.keys });
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
ts.forEachChild(node, visit);
|
|
125
|
-
};
|
|
126
|
-
visit(src);
|
|
127
|
-
}
|
|
128
|
-
// Silent on success — advisory checks shouldn't log on every clean commit.
|
|
129
|
-
if (findings.length === 0) {
|
|
130
|
-
if (verbose)
|
|
131
|
-
console.log('reshape: clean');
|
|
132
|
-
process.exit(0);
|
|
133
|
-
}
|
|
134
|
-
findings.sort((a, b) => a.rel.localeCompare(b.rel) || a.line - b.line);
|
|
135
|
-
console.log(`reshape: ${findings.length} reshape(s) reproduce the input shape (no-op / pick / clone).\n` +
|
|
136
|
-
`Pass the value as-is, or use a pick/clone helper if narrowing is the point — then allowlist:\n`);
|
|
137
|
-
const pad = Math.max(...findings.map((f) => f.kind.length));
|
|
138
|
-
for (const f of findings)
|
|
139
|
-
console.log(` ${f.kind.padEnd(pad)} { ${f.keys} } ${f.rel}:${f.line}`);
|
|
140
|
-
process.exit(warn ? 0 : 1);
|
|
2
|
+
import { reshape } from '../checks/reshape.js';
|
|
3
|
+
import { runBin } from '../lib/runner.js';
|
|
4
|
+
await runBin(reshape);
|
|
141
5
|
//# sourceMappingURL=reshape.js.map
|
package/dist/bin/reshape.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reshape.js","sourceRoot":"","sources":["../../src/bin/reshape.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"reshape.js","sourceRoot":"","sources":["../../src/bin/reshape.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/checks/catalog.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAU9C,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,SAAS,CA2EpC,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commit gate (opt-in): every dependency version must be single-sourced through
|
|
3
|
+
* a workspace catalog. No workspace package may pin a literal version — each
|
|
4
|
+
* dependency must reference the default `catalog` or a named `catalogs.<group>`
|
|
5
|
+
* with the `catalog:` protocol (a `workspace:*` reference to a sibling is fine
|
|
6
|
+
* too). Two breaches fail the commit:
|
|
7
|
+
*
|
|
8
|
+
* 1. A package pins a literal version (e.g. "yaml": "^2.9.0"). It must read
|
|
9
|
+
* "catalog:" (or "catalog:<group>") so the version lives once, centrally.
|
|
10
|
+
* 2. A package references a catalog group that doesn't exist, or — for the
|
|
11
|
+
* default catalog — a name the catalog doesn't define (a typo that wouldn't
|
|
12
|
+
* resolve).
|
|
13
|
+
*
|
|
14
|
+
* One purpose, two layouts: the catalog lives in `pnpm-workspace.yaml` (pnpm) or
|
|
15
|
+
* in the root `package.json#workspaces` (Bun). This auto-detects whichever the
|
|
16
|
+
* repo uses, so it gates familiar (bun), nodeve, and platform (pnpm) alike.
|
|
17
|
+
*
|
|
18
|
+
* On by default. A workspace is REQUIRED to declare a catalog — a workspace with
|
|
19
|
+
* no catalog at all fails, since the whole point is keeping versions aligned.
|
|
20
|
+
* Set `catalog.enforce: false` in nodeve.checks.js to deliberately opt a repo out.
|
|
21
|
+
*/
|
|
22
|
+
import { readFileSync } from 'node:fs';
|
|
23
|
+
import { join } from 'node:path';
|
|
24
|
+
import {} from '../lib/runner.js';
|
|
25
|
+
import { readWorkspace, workspaceManifests } from '../lib/repo.js';
|
|
26
|
+
const DEP_FIELDS = [
|
|
27
|
+
'dependencies',
|
|
28
|
+
'devDependencies',
|
|
29
|
+
'peerDependencies',
|
|
30
|
+
'optionalDependencies',
|
|
31
|
+
];
|
|
32
|
+
export const catalog = {
|
|
33
|
+
name: 'catalog',
|
|
34
|
+
section: 'catalog',
|
|
35
|
+
explain: `Every dependency version must be single-sourced from a workspace catalog.
|
|
36
|
+
Add the version to the catalog (pnpm-workspace.yaml or package.json#workspaces),
|
|
37
|
+
reference it with "catalog:", then reinstall.`,
|
|
38
|
+
run({ root, cfg, allowlist }) {
|
|
39
|
+
if (!cfg.enforce)
|
|
40
|
+
return { status: 'skip', summary: 'disabled (catalog.enforce: false)' };
|
|
41
|
+
const ws = readWorkspace(root);
|
|
42
|
+
if (!ws)
|
|
43
|
+
return { status: 'skip', summary: 'no workspace manifest found — nothing to enforce' };
|
|
44
|
+
// A workspace must declare a catalog — alignment is the point, so "no catalog"
|
|
45
|
+
// is itself a failure, not a free pass. Opt a repo out deliberately with
|
|
46
|
+
// `catalog.enforce: false` rather than by omitting the catalog.
|
|
47
|
+
if (Object.keys(ws.catalog).length === 0 && Object.keys(ws.catalogs).length === 0) {
|
|
48
|
+
return {
|
|
49
|
+
status: 'fail',
|
|
50
|
+
summary: 'this workspace declares no catalog',
|
|
51
|
+
rows: [
|
|
52
|
+
'Every workspace must single-source its dependency versions through a',
|
|
53
|
+
'catalog. Add a `catalog:` block to pnpm-workspace.yaml (or',
|
|
54
|
+
'`workspaces.catalog` in package.json for Bun), move your versions into',
|
|
55
|
+
'it, and reference them with "catalog:".',
|
|
56
|
+
'',
|
|
57
|
+
'To deliberately opt out, set `catalog: { enforce: false }` in nodeve.checks.js.',
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const manifests = workspaceManifests(root, ws);
|
|
62
|
+
const errors = [];
|
|
63
|
+
for (const manifest of manifests) {
|
|
64
|
+
const pkg = JSON.parse(readFileSync(join(root, manifest), 'utf8'));
|
|
65
|
+
for (const field of DEP_FIELDS) {
|
|
66
|
+
const deps = pkg[field] ?? {};
|
|
67
|
+
for (const [name, version] of Object.entries(deps)) {
|
|
68
|
+
if (allowlist.has(`${manifest}::${name}`))
|
|
69
|
+
continue;
|
|
70
|
+
// Local references, not version pins — single-sourcing doesn't apply.
|
|
71
|
+
if (/^(workspace|link|file):/.test(version))
|
|
72
|
+
continue;
|
|
73
|
+
if (!version.startsWith('catalog:')) {
|
|
74
|
+
// Rule 1: literal version pin — every dependency must go through a catalog.
|
|
75
|
+
errors.push(`${manifest}: "${name}": "${version}" — pin it in a root catalog and use "catalog:" (or "catalog:<group>")`);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
// Rule 2: the referenced catalog must actually define this dependency.
|
|
79
|
+
const group = version.slice('catalog:'.length); // "" → the default catalog
|
|
80
|
+
const table = group === '' ? ws.catalog : ws.catalogs[group];
|
|
81
|
+
if (!table) {
|
|
82
|
+
errors.push(`${manifest}: "${name}": "${version}" — no catalog group named "${group}" in the workspace`);
|
|
83
|
+
}
|
|
84
|
+
else if (!(name in table)) {
|
|
85
|
+
const where = group === '' ? 'the default catalog' : `catalog "${group}"`;
|
|
86
|
+
errors.push(`${manifest}: "${name}": "${version}" — ${where} does not define "${name}"`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (errors.length > 0)
|
|
92
|
+
return {
|
|
93
|
+
status: 'fail',
|
|
94
|
+
summary: 'every dependency version must be single-sourced from a workspace catalog',
|
|
95
|
+
rows: errors,
|
|
96
|
+
};
|
|
97
|
+
return { status: 'pass', summary: 'clean' };
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/checks/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAgB,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjF,MAAM,UAAU,GAAG;IAClB,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,sBAAsB;CACb,CAAC;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