Skip to content

Commit 8263768

Browse files
committed
docs(bootstrap): document repo-convention exceptions in file header
Bugbot flagged 3 repo-convention violations on this file: - raw fetch() instead of httpJson - raw rmSync instead of safeDelete - inline e.message instead of errorMessage() All three are intentional. The script runs BEFORE pnpm install, so it cannot import @socketsecurity/lib (the very package it bootstraps). Document the exceptions explicitly in the file header so future readers (and bots) can see the constraint without re-deriving it from the code.
1 parent 0e55721 commit 8263768

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

scripts/bootstrap-from-registry.mts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@
1414
*
1515
* Pinned versions come from `pnpm-workspace.yaml`'s `catalog:` —
1616
* single source of truth.
17+
*
18+
* --- Repo-convention exceptions ---
19+
*
20+
* This script intentionally CANNOT depend on `@socketsecurity/lib`
21+
* because it is the script that bootstraps that very package. The
22+
* usual repo conventions therefore do not apply here:
23+
*
24+
* - `fetch()` is used directly instead of `httpJson` from
25+
* `@socketsecurity/lib/http-request`.
26+
* - `rmSync` is used directly instead of `safeDelete` from
27+
* `@socketsecurity/lib/fs`.
28+
* - Caught errors use the inline `e instanceof Error ? e.message
29+
* : String(e)` pattern instead of `errorMessage()` from
30+
* `@socketsecurity/lib/errors`.
31+
*
32+
* These exceptions are intentional, narrow, and self-contained. Do
33+
* not add other repo-convention violations here without documenting
34+
* the reason in this header. Once `@socketsecurity/lib` is on disk
35+
* (post-bootstrap), other scripts must use the helpers as normal.
1736
*/
1837

1938
import { spawnSync } from 'node:child_process'

0 commit comments

Comments
 (0)