@nodeve/checks 1.5.1 → 1.5.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clones.d.ts","sourceRoot":"","sources":["../../src/checks/clones.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clones.d.ts","sourceRoot":"","sources":["../../src/checks/clones.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAW9C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,QAAQ,CAoGlC,CAAC"}
|
package/dist/checks/clones.js
CHANGED
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
* buries the one thing that matters — *where* the duplicated blocks are. So we
|
|
9
9
|
* run it `--silent` with the `json` reporter and parse that, surfacing each
|
|
10
10
|
* clone's two locations by default (the bulky shared fragment only under
|
|
11
|
-
* `--explain`, so a multi-clone repo doesn't bury the gate). jscpd
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* `--explain`, so a multi-clone repo doesn't bury the gate). jscpd is a hard
|
|
12
|
+
* dependency: if its binary can't be resolved the install is broken, so this
|
|
13
|
+
* FAILS loudly rather than skipping — a silently-skipped copy-paste gate is worse
|
|
14
|
+
* than none, since the repo believes it's covered when it isn't.
|
|
14
15
|
*/
|
|
15
16
|
import { spawnSync } from 'node:child_process';
|
|
16
17
|
import { mkdtempSync, readFileSync, rmSync } from 'node:fs';
|
|
@@ -30,7 +31,15 @@ can't see. Extract the shared logic, or narrow scope with clones.ignore globs.
|
|
|
30
31
|
launcher = createRequire(import.meta.url).resolve('jscpd/run-jscpd.js');
|
|
31
32
|
}
|
|
32
33
|
catch {
|
|
33
|
-
return {
|
|
34
|
+
return {
|
|
35
|
+
status: 'fail',
|
|
36
|
+
summary: 'jscpd not resolvable — copy-paste gate is DOWN, not skipped',
|
|
37
|
+
rows: [
|
|
38
|
+
'jscpd is a hard dependency of @nodeve/checks but its binary could not be resolved.',
|
|
39
|
+
'The install is broken; the clones gate is blind. Fix, do not bypass:',
|
|
40
|
+
' reinstall deps (pnpm install / bun install) so jscpd/run-jscpd.js resolves.',
|
|
41
|
+
],
|
|
42
|
+
};
|
|
34
43
|
}
|
|
35
44
|
// jscpd's `json` reporter writes `<output>/jscpd-report.json`; `--silent`
|
|
36
45
|
// keeps its progress bar, stats table, and footer off our stdout. Missing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clones.js","sourceRoot":"","sources":["../../src/checks/clones.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"clones.js","sourceRoot":"","sources":["../../src/checks/clones.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAW9C,MAAM,CAAC,MAAM,MAAM,GAAoB;IACtC,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE;;2CAEiC;IAE1C,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE;QACzB,IAAI,QAAgB,CAAC;QACrB,IAAI,CAAC;YACJ,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACzE,CAAC;QAAC,MAAM,CAAC;YACR,OAAO;gBACN,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,6DA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mE;gBACnE,IAAI,OAAO,IAAI,CAAC,CAAC,QAAQ;oBAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3F,CAAC;YACD,OAAO;gBACN,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,GAAG,UAAU,CAAC,MAAM,iDAAiD;gBAC9E,IAAI;aACJ,CAAC;QACH,CAAC;gBAAS,CAAC;YACV,MAAM,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;IACF,CAAC;CACD,CAAC"}
|
package/lefthook.checks.yml
CHANGED
|
@@ -87,7 +87,8 @@ pre-commit:
|
|
|
87
87
|
# languages it scans are owned by `clones.formats` in nodeve.checks.js,
|
|
88
88
|
# so adding one there is all a repo needs. Cost: the scan fires on every
|
|
89
89
|
# commit — cheap (jscpd is fast, exits 0 with no clones, runs in this
|
|
90
|
-
# parallel group)
|
|
90
|
+
# parallel group). jscpd is a hard dep; if it can't be resolved the check
|
|
91
|
+
# FAILS loudly (a silently-skipped copy-paste gate is worse than none).
|
|
91
92
|
- name: clones
|
|
92
93
|
run: node_modules/.bin/nodeve-check clones
|
|
93
94
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodeve/checks",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Org-wide commit-gate checks (doc budgets, reshape/dup/helper smells, page size) and helper-index generators, driven by a per-repo config file and wired through lefthook.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|