Files
software-mansion__argent/package.json
Ignacy Łątka dc0930d50c ci: prevent package-lock drift + add repo-hygiene checks (#362)
## Why

We hit a mismatch between a locally-generated `package-lock.json` and
the one on `main`. `npm ci` validates the lockfile loosely and accepts a
stale lock that a fresh `npm install` would rewrite, so the drift
slipped through. This adds CI to catch that, plus a few related
common-mistake guards.

## What

**`Lockfile` workflow** (Node 20) — runs `npm install
--package-lock-only --ignore-scripts` and fails if `package-lock.json`
changes. This is the gap `npm ci` leaves: it asserts the lock is exactly
what npm produces, not merely "consistent enough".

**`Repo Hygiene` workflow** — three fast static guards:
- **Merge-conflict markers** — fail on any `<<<<<<<` / `=======` /
`>>>>>>>` left in a tracked file.
- **Focused tests** — fail on `describe/it/test/bench.only` in
`*.test.ts(x)` / `*.spec.ts(x)`. Uses a POSIX-ERE word-boundary pattern
so it actually fires under `git grep -E` (a `\b` pattern silently
matches nothing there).
- **Workspace version sync** — fail when `packages/*` versions drift,
via `scripts/check-workspace-versions.mjs` (also `npm run
check:versions`).

To make versions consistent, `@argent/ui` is bumped `0.0.1 → 0.12.0` (it
is `private`, so no publish impact).

## Verification (Node 20 / npm 10.8.2, matching CI)

- Lockfile check: no false positive on `main`; idempotent; catches a
tampered lock.
- Merge-marker & `.only` greps: proven to catch real violations and
reject lookalikes (`await.only`, `audit.only`, `foo.it.only`); clean
across the repo.
- `check-workspace-versions.mjs`: reports all packages at `0.12.0`;
passes `eslint` and `typecheck:scripts`.
- All new/changed files pass `prettier --check`; both workflow YAMLs
parse.

## Note: npm version coupling

The check runs on Node 20 (npm 10.8.2), matching the committed lock's
format. npm 11 (Node 24) regenerates the same lock minus cosmetic
`"peer": true` markers — no resolution change, but a contributor who
regenerates on npm 11 would trip the strict diff. The repo pins no
toolchain today (CI mixes Node 20 and 24). Pinning npm/Node repo-wide
would fully close this; left out of scope here — happy to add it as a
follow-up.
2026-06-19 15:19:19 +02:00

34 lines
1.5 KiB
JSON

{
"name": "argent-workspace",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build": "tsc --build",
"start": "npm run build -w @argent/registry && npm run dev -w @argent/tool-server",
"start:tool-server": "npm run build -w @argent/registry && npm run dev -w @argent/tool-server",
"download:simulator-server": "bash scripts/download-simulator-server.sh",
"download:native-binaries": "bash scripts/download-native-binaries.sh",
"download:trace-processor": "bash scripts/download-trace-processor.sh",
"build:ios-binaries": "bash packages/native-devtools-ios/scripts/build.sh dev",
"build:android-binaries": "bash packages/native-devtools-android/scripts/build.sh",
"pack": "node scripts/pack-mcp.cjs",
"pack:mcp": "node scripts/pack-mcp.cjs",
"pack:mcp:local": "npm run download:simulator-server && npm run build:ios-binaries && npm run build:android-binaries && npm run download:trace-processor && npm run build && npm run build -w @swmansion/argent && npm pack -w @swmansion/argent --pack-destination .",
"dev": "node scripts/dev.cjs",
"format": "prettier --write .",
"lint": "eslint . --max-warnings 0",
"lint:fix": "eslint . --fix",
"typecheck:scripts": "tsc --noEmit -p tsconfig.scripts.json",
"check:versions": "node scripts/check-workspace-versions.mjs"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"eslint": "^10.5.0",
"globals": "^17.6.0",
"prettier": "^3.8.4",
"typescript-eslint": "^8.61.1"
}
}