@nodeve/checks 0.4.2 → 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kai Curry
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,9 +1,6 @@
1
1
  # @nodeve/checks
2
2
 
3
- Org-wide commit-gate checks and helper-index generators, shared across nodeve
4
- repos. Each check ships as a published bin that reads an optional per-repo
5
- `nodeve.checks.js` and derives the repo root from git — so it behaves the same
6
- whatever directory the hook runner invokes it from. Wiring is via lefthook.
3
+ Org-wide commit-gate checks and helper-index generators, shared across nodeve repos. Each check ships as a published bin that reads an optional per-repo `nodeve.checks.js` and derives the repo root from git — so it behaves the same whatever directory the hook runner invokes it from. Wiring is via lefthook.
7
4
 
8
5
  ## Install
9
6
 
@@ -18,14 +15,11 @@ extends:
18
15
  - node_modules/@nodeve/checks/lefthook.checks.yml
19
16
  ```
20
17
 
21
- Then activate hooks once per clone with `lefthook install` (familiar/nodeve do
22
- this from their `prepare` script).
18
+ Then activate hooks once per clone with `lefthook install` (familiar/nodeve do this from their `prepare` script).
23
19
 
24
20
  ## Configure
25
21
 
26
- Copy `node_modules/@nodeve/checks/nodeve.checks.example.js` to your repo root as
27
- `nodeve.checks.js` and trim to taste. Every section is optional; omitted keys
28
- fall back to org defaults. See the example for the full shape.
22
+ Copy `node_modules/@nodeve/checks/nodeve.checks.defaults.js` to your repo root as `nodeve.checks.js` and keep ONLY the keys you change. That file is the org defaults verbatim — a valid `nodeve.checks.js` in the exact shape your config takes — so it doubles as the reference for every section and its default value. Omitted keys fall back to those defaults (deep-merged; arrays replace wholesale). It's importable too: `import DEFAULTS from '@nodeve/checks/defaults'`.
29
23
 
30
24
  ## Checks
31
25
 
@@ -35,53 +29,39 @@ fall back to org defaults. See the example for the full shape.
35
29
  | `nodeve-check-reshape` | callbacks that reproduce their input shape (no-op / pick / clone) | on (`apps/`, `packages/`) |
36
30
  | `nodeve-check-inline-dupes` | non-exported top-level names declared in 2+ files | on (`apps/`, `packages/`) |
37
31
  | `nodeve-check-helper-collisions` | local helpers that fuzzily match a dependency export | on (needs lib-names index) |
38
- | `nodeve-check-page-size` | files over a per-glob line budget | **opt-in** (no rules → no-op) |
32
+ | `nodeve-check-page-size` | files over a per-glob line budget | on (`*+page.svelte` >280; no-op where the glob matches nothing) |
39
33
  | `nodeve-check-file-size` | TS sources over a line budget (warn >225, fail >300) | on (`apps/`, `packages/`) |
40
34
  | `nodeve-check-catalog` | dependency versions not single-sourced from a workspace catalog | on (a workspace must declare a catalog) |
41
35
  | `nodeve-check-require-deps` | org-required deps missing from the workspace catalog | on (`remeda`; set `deps: []` to opt out) |
42
36
 
43
- `require-deps` keeps the org's blessed libraries single-sourced and visibly
44
- expected: it fails when the workspace catalog (default or a named group) doesn't
45
- define a required name. It checks the catalog, not each package's deps — so it
46
- doesn't force the dep on packages that don't use it, it just guarantees the
47
- version is there to adopt with `catalog:`. Defaults to requiring `remeda`; set
48
- `requireDeps: { deps: [] }` to opt out.
37
+ `require-deps` keeps the org's blessed libraries single-sourced and visibly expected: it fails when the workspace catalog (default or a named group) doesn't define a required name. It checks the catalog, not each package's deps — so it doesn't force the dep on packages that don't use it, it just guarantees the version is there to adopt with `catalog:`. Defaults to requiring `remeda`; set `requireDeps: { deps: [] }` to opt out.
49
38
 
50
- `catalog` works with both pnpm (catalog in `pnpm-workspace.yaml`) and Bun
51
- (catalog in `package.json#workspaces`) — it auto-detects whichever the repo uses.
52
- A workspace is **required** to declare a catalog: a repo with none fails the gate,
53
- since the point is keeping versions aligned. Every dependency (deps, devDeps, and
54
- peers alike) must reference `catalog:` rather than a literal pin. Opt a repo out
55
- deliberately with `catalog: { enforce: false }`.
39
+ `catalog` works with both pnpm (catalog in `pnpm-workspace.yaml`) and Bun (catalog in `package.json#workspaces`) — it auto-detects whichever the repo uses. A workspace is **required** to declare a catalog: a repo with none fails the gate, since the point is keeping versions aligned. Every dependency (deps, devDeps, and peers alike) must reference `catalog:` rather than a literal pin. Opt a repo out deliberately with `catalog: { enforce: false }`.
56
40
 
57
- All blocking checks accept `--warn` (report-only, exit 0); `doc-tokens` accepts
58
- `--report` to list the whole backlog without failing. Pass explicit paths to
59
- scope a run (lefthook passes `{staged_files}`).
41
+ All blocking checks accept `--warn` (report-only, exit 0); `doc-tokens` accepts `--report` to list the whole backlog without failing. Pass explicit paths to scope a run (lefthook passes `{staged_files}`).
42
+
43
+ ## Fixers
44
+
45
+ Unlike the gates above, fixers mutate staged files and let lefthook re-stage them (`stage_fixed: true`). They run before the `checks` group so the gates see the fixed content.
46
+
47
+ - `nodeve-format-markdown` — prettier-formats staged `*.md` in place, so docs land formatted without a manual `prettier --write`. Bundles its own prettier (nothing needed on PATH, portable across pnpm and bun) yet honors the repo's prettier config, `.prettierignore`, and plugins, which prettier resolves per file. Skips symlinked docs (e.g. `CLAUDE.md` → `README.md`), which prettier can't format and which get formatted via their real target's own staged entry.
60
48
 
61
49
  ### Running ad hoc
62
50
 
63
- These are **bins**, not package scripts, so `pnpm run` / `bun run` won't find
64
- them — those run `package.json#scripts`. Invoke a bin through `exec` instead,
65
- which resolves `node_modules/.bin` for you (no hardcoded path needed):
51
+ These are **bins**, not package scripts, so `pnpm run` / `bun run` won't find them — those run `package.json#scripts`. Invoke a bin through `exec` instead, which resolves `node_modules/.bin` for you (no hardcoded path needed):
66
52
 
67
53
  ```sh
68
54
  pnpm exec nodeve-check-doc-tokens 'README.md' # or: pnpm nodeve-check-doc-tokens ...
69
55
  bunx nodeve-check-doc-tokens 'README.md' # Bun repos
70
56
  ```
71
57
 
72
- Quote globs so your shell doesn't expand them before the bin sees them. Day to
73
- day you shouldn't need this — the bins run through lefthook on commit.
58
+ Quote globs so your shell doesn't expand them before the bin sees them. Day to day you shouldn't need this — the bins run through lefthook on commit.
74
59
 
75
60
  ## Generators
76
61
 
77
- - `nodeve-build-lib-names` — writes the committed lib-names index that
78
- `helper-collisions` matches against (regenerate after dependency bumps). The
79
- index is committed so the gate never needs the libs installed at check time.
80
- - `nodeve-build-helper-manifest` — **opt-in**; writes a greppable index of the
81
- public export surface of the configured packages. Grep it before adding a
82
- generic helper.
62
+ - `nodeve-build-lib-names` — writes the committed lib-names index that `helper-collisions` matches against (regenerate after dependency bumps). The index is committed so the gate never needs the libs installed at check time.
63
+ - `nodeve-build-helper-manifest` — **opt-in**; writes a greppable index of the public export surface of the configured packages. Grep it before adding a generic helper.
83
64
 
84
65
  ## Notes for Bun repos
85
66
 
86
- The bins are plain Node ESM and run under Node from `node_modules/.bin`. lefthook
87
- in a Bun workspace still finds them on PATH; no `bunx` prefix is needed.
67
+ The bins are plain Node ESM and run under Node from `node_modules/.bin`. lefthook in a Bun workspace still finds them on PATH; no `bunx` prefix is needed.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=format-markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-markdown.d.ts","sourceRoot":"","sources":["../../src/bin/format-markdown.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Commit fixer: prettier-format staged markdown in place, so docs land formatted
4
+ * without a manual `prettier --write`. Wired in the shared lefthook config with
5
+ * `stage_fixed: true`, which re-stages whatever this touches.
6
+ *
7
+ * WHY a bin instead of `bunx prettier --write` in the hook: the rest of the
8
+ * shared config shells `node_modules/.bin/nodeve-*` so it's portable across pnpm
9
+ * and bun and needs nothing on PATH. `bunx` needs Bun, and under pnpm's strict
10
+ * layout a transitive prettier isn't at the consumer's `node_modules/.bin`. So we
11
+ * bundle prettier as a dependency and resolve ITS cli here — available in every
12
+ * consumer regardless of their own deps.
13
+ *
14
+ * The bundled prettier still honors the consumer's `.prettierrc`/`.prettierignore`
15
+ * and plugins: prettier resolves both relative to each file, not to this bin.
16
+ *
17
+ * Skips symlinked docs (e.g. CLAUDE.md → README.md): prettier errors on a symlink
18
+ * path, and the real target is formatted via its own staged entry anyway.
19
+ */
20
+ import { spawnSync } from 'node:child_process';
21
+ import { createRequire } from 'node:module';
22
+ import { lstatSync } from 'node:fs';
23
+ const argPaths = process.argv.slice(2).filter((a) => !a.startsWith('--'));
24
+ const mdFiles = argPaths.filter((p) => {
25
+ try {
26
+ return !lstatSync(p).isSymbolicLink();
27
+ }
28
+ catch {
29
+ // Deleted/renamed out from under us — let prettier's own scope skip it.
30
+ return false;
31
+ }
32
+ });
33
+ if (mdFiles.length === 0)
34
+ process.exit(0);
35
+ const prettierCli = createRequire(import.meta.url).resolve('prettier/bin/prettier.cjs');
36
+ const res = spawnSync(process.execPath, [prettierCli, '--write', ...mdFiles], { stdio: 'inherit' });
37
+ process.exit(res.status ?? 1);
38
+ //# sourceMappingURL=format-markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-markdown.js","sourceRoot":"","sources":["../../src/bin/format-markdown.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1E,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;IACrC,IAAI,CAAC;QACJ,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACR,wEAAwE;QACxE,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,CAAC,CAAC;AAEH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;IAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAE1C,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;AACxF,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC"}
@@ -1,13 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Commit gate (opt-in): fail when a file matching one of `pageSize.rules`
3
+ * Commit gate: fail when a file matching one of `pageSize.rules`
4
4
  * exceeds that rule's `maxLines`.
5
5
  *
6
6
  * WHY: an oversized template/module is a signal the unit is doing work that
7
- * belongs in dedicated files. Originally a SvelteKit `+page.svelte` cap; now any
8
- * glob → line budget, e.g. `{ glob: '*+page.svelte', maxLines: 280 }`.
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.
9
11
  *
10
- * No-op unless a repo declares rules. Pass explicit paths (lefthook
12
+ * No-op when a repo's rules list is empty. Pass explicit paths (lefthook
11
13
  * `{staged_files}`) to scope; a path is checked under every rule whose glob it
12
14
  * would match via `git ls-files`.
13
15
  */
@@ -35,7 +37,7 @@ for (const rule of cfg.rules) {
35
37
  }
36
38
  if (offenders.length === 0)
37
39
  process.exit(0);
38
- console.error('\n✖ file(s) over line budget — split work into dedicated files:\n');
40
+ console.error('\n✖ file(s) over line budget — rip inline components out into their own files:\n');
39
41
  for (const o of offenders.sort((a, b) => b.lines - a.lines))
40
42
  console.error(` ${String(o.lines).padStart(5)}/${o.max}L ${o.path}`);
41
43
  console.error('');
@@ -1 +1 @@
1
- {"version":3,"file":"page-size.js","sourceRoot":"","sources":["../../src/bin/page-size.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAC;AAExD,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;IAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAG5C,MAAM,SAAS,GAAe,EAAE,CAAC;AACjC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;AAE/B,KA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C5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpC,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ;YAAE,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChF,CAAC;AACF,CAAC;AAED,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;IAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAE5C,OAAO,CAAC,KAAK,CACZ,kFAAkF,CAClF,CAAC;AACF,KAAK,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1D,OAAO,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACxE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import DEFAULTS from './defaults.js';
1
2
  export type Budget = {
2
3
  maxLines: number;
3
4
  maxTokens: number;
@@ -95,7 +96,7 @@ export type Config = {
95
96
  requireDeps: RequireDepsConfig;
96
97
  helperManifest: HelperManifestConfig;
97
98
  };
98
- export declare const DEFAULTS: Config;
99
+ export { DEFAULTS };
99
100
  /**
100
101
  * Load `nodeve.checks.*` from the repo root, deep-merging the user config over
101
102
  * DEFAULTS. Nested records (e.g. `docTokens.overrides`) merge key-by-key; arrays
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib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AC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,gFAAgF;IAChF,SAAS,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAAG;IAClC,yFAAyF;IACzF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,cAAc,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAMF,OAAO,EAAE,QAAQ,EAAE,CAAC;AAMpB;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS9D;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC1C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CACjB,CAOA"}
@@ -14,44 +14,12 @@ import { existsSync } from 'node:fs';
14
14
  import { join } from 'node:path';
15
15
  import { pathToFileURL } from 'node:url';
16
16
  import { mergeDeep } from 'remeda';
17
- export const DEFAULTS = {
18
- docTokens: {
19
- maxLines: 150,
20
- maxTokens: 3000,
21
- enforce: ['CLAUDE.md', 'README.md', '*/README.md', 'guide/*.md', 'docs/*.md'],
22
- overrides: {},
23
- },
24
- reshape: {
25
- globs: ['apps/*.ts', 'packages/*.ts'],
26
- allowlist: [],
27
- },
28
- inlineDupes: {
29
- globs: ['apps/*.ts', 'packages/*.ts'],
30
- allowlist: [],
31
- },
32
- helperCollisions: {
33
- globs: ['apps/*.ts', 'packages/*.ts'],
34
- libs: ['remeda'],
35
- libNamesPath: '.nodeve/lib-names.json',
36
- threshold: 0.8,
37
- allowlist: [],
38
- },
39
- // Opt-in: empty rules → no-op until a repo declares its own.
40
- pageSize: { rules: [] },
41
- // On by default: warn past 225 lines, block past 300 (override per repo).
42
- fileSize: {
43
- globs: ['apps/*.ts', 'packages/*.ts'],
44
- warnLines: 225,
45
- maxLines: 300,
46
- allowlist: [],
47
- },
48
- // On by default: a workspace must declare a catalog (set enforce:false to opt out).
49
- catalog: { enforce: true, allowlist: [] },
50
- // On by default: the workspace catalog must define remeda (set deps:[] to opt out).
51
- requireDeps: { deps: ['remeda'] },
52
- // Opt-in: no packages → no-op.
53
- helperManifest: { packages: [], output: '.nodeve/helper-manifest.txt' },
54
- };
17
+ import DEFAULTS from './defaults.js';
18
+ // The authoritative defaults live in `./defaults.ts`, which is itself a valid
19
+ // `nodeve.checks.js` (a bare `export default {...}`) so it doubles as the copyable
20
+ // reference shipped to consumers. Re-exported here to keep the `@nodeve/checks/config`
21
+ // public surface intact.
22
+ export { DEFAULTS };
55
23
  const CONFIG_FILES = ['nodeve.checks.js', 'nodeve.checks.mjs', 'nodeve.checks.config.js'];
56
24
  /**
57
25
  * Load `nodeve.checks.*` from the repo root, deep-merging the user config over
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,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* its root, default-exporting the config object. To customize, copy it (shipped
6
+ * as `node_modules/@nodeve/checks/nodeve.checks.defaults.js`) to your repo root
7
+ * as `nodeve.checks.js` and keep ONLY the keys you change — everything you omit
8
+ * falls back to the value here.
9
+ *
10
+ * Merge semantics (see `loadConfig`): your config is deep-merged OVER these
11
+ * defaults. Nested records merge key-by-key, but ARRAYS REPLACE wholesale — so
12
+ * if you set an array field (e.g. `docTokens.enforce`) you must restate every
13
+ * entry you want to keep, not just the ones you're adding.
14
+ */
15
+ declare const _default: {
16
+ docTokens: {
17
+ maxLines: number;
18
+ maxTokens: number;
19
+ enforce: string[];
20
+ overrides: {};
21
+ };
22
+ reshape: {
23
+ globs: string[];
24
+ allowlist: never[];
25
+ };
26
+ inlineDupes: {
27
+ globs: string[];
28
+ allowlist: never[];
29
+ };
30
+ helperCollisions: {
31
+ globs: string[];
32
+ libs: string[];
33
+ libNamesPath: string;
34
+ threshold: number;
35
+ allowlist: never[];
36
+ };
37
+ pageSize: {
38
+ rules: {
39
+ glob: string;
40
+ maxLines: number;
41
+ }[];
42
+ };
43
+ fileSize: {
44
+ globs: string[];
45
+ warnLines: number;
46
+ maxLines: number;
47
+ allowlist: never[];
48
+ };
49
+ catalog: {
50
+ enforce: true;
51
+ allowlist: never[];
52
+ };
53
+ requireDeps: {
54
+ deps: string[];
55
+ };
56
+ helperManifest: {
57
+ packages: never[];
58
+ output: string;
59
+ };
60
+ };
61
+ export default _default;
62
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/lib/defaults.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAyCmB"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The org defaults for @nodeve/checks — the single source of truth.
3
+ *
4
+ * This file IS a valid `nodeve.checks.js`: it's the exact shape a repo drops at
5
+ * its root, default-exporting the config object. To customize, copy it (shipped
6
+ * as `node_modules/@nodeve/checks/nodeve.checks.defaults.js`) to your repo root
7
+ * as `nodeve.checks.js` and keep ONLY the keys you change — everything you omit
8
+ * falls back to the value here.
9
+ *
10
+ * Merge semantics (see `loadConfig`): your config is deep-merged OVER these
11
+ * defaults. Nested records merge key-by-key, but ARRAYS REPLACE wholesale — so
12
+ * if you set an array field (e.g. `docTokens.enforce`) you must restate every
13
+ * entry you want to keep, not just the ones you're adding.
14
+ */
15
+ export default {
16
+ docTokens: {
17
+ maxLines: 150,
18
+ maxTokens: 3000,
19
+ // Git pathspecs the gate FAILS on: CLAUDE.md + READMEs + guide/ + docs/.
20
+ enforce: ['CLAUDE.md', 'README.md', '*/README.md', 'guide/*.md', 'docs/*.md'],
21
+ // Per-file budget bumps, keyed by repo-root-relative path.
22
+ overrides: {},
23
+ },
24
+ reshape: {
25
+ globs: ['apps/*.ts', 'packages/*.ts'],
26
+ allowlist: [],
27
+ },
28
+ inlineDupes: {
29
+ globs: ['apps/*.ts', 'packages/*.ts'],
30
+ allowlist: [],
31
+ },
32
+ helperCollisions: {
33
+ globs: ['apps/*.ts', 'packages/*.ts'],
34
+ libs: ['remeda'],
35
+ libNamesPath: '.nodeve/lib-names.json',
36
+ threshold: 0.8,
37
+ allowlist: [],
38
+ },
39
+ // On by default: SvelteKit pages over 280 lines should rip inline components
40
+ // out into their own files. The `*+page.svelte` glob is a no-op in repos with
41
+ // no SvelteKit pages, so this stays harmless org-wide. Override per repo.
42
+ pageSize: { rules: [{ glob: '*+page.svelte', maxLines: 280 }] },
43
+ // On by default: warn past 225 lines, block past 300 (override per repo).
44
+ fileSize: {
45
+ globs: ['apps/*.ts', 'packages/*.ts'],
46
+ warnLines: 225,
47
+ maxLines: 300,
48
+ allowlist: [],
49
+ },
50
+ // On by default: a workspace must declare a catalog (set enforce:false to opt out).
51
+ catalog: { enforce: true, allowlist: [] },
52
+ // On by default: the workspace catalog must define remeda (set deps:[] to opt out).
53
+ requireDeps: { deps: ['remeda'] },
54
+ // Opt-in: no packages → no-op.
55
+ helperManifest: { packages: [], output: '.nodeve/helper-manifest.txt' },
56
+ };
57
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/lib/defaults.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAe;IACd,SAAS,EAAE;QACV,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,IAAI;QACf,yEAAyE;QACzE,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,CAAC;QAC7E,2DAA2D;QAC3D,SAAS,EAAE,EAAE;KACb;IACD,OAAO,EAAE;QACR,KAAK,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC;QACrC,SAAS,EAAE,EAAE;KACb;IACD,WAAW,EAAE;QACZ,KAAK,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC;QACrC,SAAS,EAAE,EAAE;KACb;IACD,gBAAgB,EAAE;QACjB,KAAK,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC;QACrC,IAAI,EAAE,CAAC,QAAQ,CAAC;QAChB,YAAY,EAAE,wBAAwB;QACtC,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,EAAE;KACb;IACD,6EAA6E;IAC7E,8EAA8E;IAC9E,0EAA0E;IAC1E,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;IAC/D,0EAA0E;IAC1E,QAAQ,EAAE;QACT,KAAK,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC;QACrC,SAAS,EAAE,GAAG;QACd,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,EAAE;KACb;IACD,oFAAoF;IACpF,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;IACzC,oFAAoF;IACpF,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE;IACjC,+BAA+B;IAC/B,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,6BAA6B,EAAE;CACtD,CAAC"}
@@ -26,6 +26,17 @@
26
26
  # `node_modules/.bin/nodeve-check-doc-tokens --report`.
27
27
  pre-commit:
28
28
  jobs:
29
+ # Fixer, runs before the `checks` group so the gates see formatted, re-staged
30
+ # content. Prettier-formats staged markdown in place; `stage_fixed` re-adds
31
+ # whatever it touched. The bin bundles its own prettier (portable across pnpm
32
+ # and bun, needs nothing on PATH) and honors the repo's prettier config and
33
+ # `.prettierignore`. It skips symlinked docs itself, so no `file_types` filter
34
+ # is needed here.
35
+ - name: format-markdown
36
+ glob: "*.md"
37
+ run: node_modules/.bin/nodeve-format-markdown {staged_files}
38
+ stage_fixed: true
39
+
29
40
  - name: checks
30
41
  group:
31
42
  parallel: true
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The org defaults for @nodeve/checks — the single source of truth.
3
+ *
4
+ * This file IS a valid `nodeve.checks.js`: it's the exact shape a repo drops at
5
+ * its root, default-exporting the config object. To customize, copy it (shipped
6
+ * as `node_modules/@nodeve/checks/nodeve.checks.defaults.js`) to your repo root
7
+ * as `nodeve.checks.js` and keep ONLY the keys you change — everything you omit
8
+ * falls back to the value here.
9
+ *
10
+ * Merge semantics (see `loadConfig`): your config is deep-merged OVER these
11
+ * defaults. Nested records merge key-by-key, but ARRAYS REPLACE wholesale — so
12
+ * if you set an array field (e.g. `docTokens.enforce`) you must restate every
13
+ * entry you want to keep, not just the ones you're adding.
14
+ */
15
+ export default {
16
+ docTokens: {
17
+ maxLines: 150,
18
+ maxTokens: 3000,
19
+ // Git pathspecs the gate FAILS on: CLAUDE.md + READMEs + guide/ + docs/.
20
+ enforce: ['CLAUDE.md', 'README.md', '*/README.md', 'guide/*.md', 'docs/*.md'],
21
+ // Per-file budget bumps, keyed by repo-root-relative path.
22
+ overrides: {},
23
+ },
24
+ reshape: {
25
+ globs: ['apps/*.ts', 'packages/*.ts'],
26
+ allowlist: [],
27
+ },
28
+ inlineDupes: {
29
+ globs: ['apps/*.ts', 'packages/*.ts'],
30
+ allowlist: [],
31
+ },
32
+ helperCollisions: {
33
+ globs: ['apps/*.ts', 'packages/*.ts'],
34
+ libs: ['remeda'],
35
+ libNamesPath: '.nodeve/lib-names.json',
36
+ threshold: 0.8,
37
+ allowlist: [],
38
+ },
39
+ // On by default: SvelteKit pages over 280 lines should rip inline components
40
+ // out into their own files. The `*+page.svelte` glob is a no-op in repos with
41
+ // no SvelteKit pages, so this stays harmless org-wide. Override per repo.
42
+ pageSize: { rules: [{ glob: '*+page.svelte', maxLines: 280 }] },
43
+ // On by default: warn past 225 lines, block past 300 (override per repo).
44
+ fileSize: {
45
+ globs: ['apps/*.ts', 'packages/*.ts'],
46
+ warnLines: 225,
47
+ maxLines: 300,
48
+ allowlist: [],
49
+ },
50
+ // On by default: a workspace must declare a catalog (set enforce:false to opt out).
51
+ catalog: { enforce: true, allowlist: [] },
52
+ // On by default: the workspace catalog must define remeda (set deps:[] to opt out).
53
+ requireDeps: { deps: ['remeda'] },
54
+ // Opt-in: no packages → no-op.
55
+ helperManifest: { packages: [], output: '.nodeve/helper-manifest.txt' },
56
+ };
57
+ //# sourceMappingURL=defaults.js.map
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@nodeve/checks",
3
- "version": "0.4.2",
3
+ "version": "1.0.0",
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
+ "license": "MIT",
5
6
  "repository": {
6
7
  "type": "git",
7
8
  "url": "git+https://github.com/nodeve-com/nodeve.git",
@@ -14,13 +15,17 @@
14
15
  "files": [
15
16
  "dist",
16
17
  "lefthook.checks.yml",
17
- "nodeve.checks.example.js"
18
+ "nodeve.checks.defaults.js"
18
19
  ],
19
20
  "exports": {
20
21
  "./config": {
21
22
  "types": "./dist/lib/config.d.ts",
22
23
  "default": "./dist/lib/config.js"
23
24
  },
25
+ "./defaults": {
26
+ "types": "./dist/lib/defaults.d.ts",
27
+ "default": "./dist/lib/defaults.js"
28
+ },
24
29
  "./lefthook": "./lefthook.checks.yml"
25
30
  },
26
31
  "bin": {
@@ -32,11 +37,13 @@
32
37
  "nodeve-check-file-size": "./dist/bin/file-size.js",
33
38
  "nodeve-check-catalog": "./dist/bin/catalog.js",
34
39
  "nodeve-check-require-deps": "./dist/bin/require-deps.js",
40
+ "nodeve-format-markdown": "./dist/bin/format-markdown.js",
35
41
  "nodeve-build-lib-names": "./dist/bin/build-lib-names.js",
36
42
  "nodeve-build-helper-manifest": "./dist/bin/build-helper-manifest.js"
37
43
  },
38
44
  "dependencies": {
39
45
  "js-tiktoken": "^1.0.0",
46
+ "prettier": "^3.0.0",
40
47
  "remeda": "^2.0.0",
41
48
  "typescript": "^5.5.0",
42
49
  "yaml": "^2.5.0",
@@ -47,7 +54,7 @@
47
54
  "@nodeve/config": "0.1.0"
48
55
  },
49
56
  "scripts": {
50
- "build": "tsc -p tsconfig.json",
57
+ "build": "tsc -p tsconfig.json && cp dist/lib/defaults.js nodeve.checks.defaults.js",
51
58
  "clean": "rm -rf dist",
52
59
  "typecheck": "tsc -p tsconfig.json --noEmit"
53
60
  }
@@ -1,45 +0,0 @@
1
- // Copy to your repo root as `nodeve.checks.js` and keep ONLY what you change.
2
- // Every section is optional; omitted keys fall back to the org defaults baked
3
- // into @nodeve/checks (see the `Config` type / `DEFAULTS` in the package for the
4
- // authoritative values). The user config is deep-merged over those defaults:
5
- // nested records merge key-by-key, but ARRAYS REPLACE — so if you set an array
6
- // field (e.g. `docTokens.enforce`) you must restate the entries you want to keep,
7
- // not just the ones you're adding.
8
- //
9
- // The blocks below are illustrative overrides, not the defaults. Delete any you
10
- // don't need.
11
- export default {
12
- // Widen the enforced doc set (this array REPLACES the default list — the
13
- // default is CLAUDE.md + READMEs + guide/ + docs/, restated here plus adr/):
14
- docTokens: {
15
- enforce: ['CLAUDE.md', 'README.md', '*/README.md', 'guide/*.md', 'docs/*.md', 'adr/*.md'],
16
- // Per-file budget bumps, keyed by repo-root-relative path (merges with defaults):
17
- overrides: {
18
- 'CLAUDE.md': { maxTokens: 3500 },
19
- },
20
- },
21
-
22
- // Opt in to a per-glob page-size budget (default: no rules → no-op):
23
- pageSize: {
24
- rules: [{ glob: '*+page.svelte', maxLines: 280 }],
25
- },
26
-
27
- // TS line budget (default ON: warn >225, fail >300 across apps/ + packages/).
28
- // Override the thresholds, or allowlist files that are one responsibility but
29
- // legitimately long (the allowlist array REPLACES the default — restate all):
30
- fileSize: {
31
- maxLines: 350,
32
- allowlist: ['packages/foo/src/schema.ts'], // WHY: single zod schema
33
- },
34
-
35
- // Deliberately opt a repo out of the (default-on) catalog gate:
36
- catalog: { enforce: false },
37
-
38
- // Change the org-required catalog deps (default: ['remeda']; [] to opt out):
39
- requireDeps: { deps: ['remeda'] },
40
-
41
- // Opt in to the helper-manifest index by listing package dirs to scan:
42
- helperManifest: {
43
- packages: ['packages/utils'],
44
- },
45
- };