micro-contracts 0.17.20 → 0.18.1
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/docs/cli-reference.md
CHANGED
|
@@ -196,7 +196,7 @@ Ensures generated code matches spec and hasn't been tampered.
|
|
|
196
196
|
|
|
197
197
|
| Check | Type | Description | Local Command | CI Job |
|
|
198
198
|
|-------|------|-------------|---------------|--------|
|
|
199
|
-
| Drift | built-in | `
|
|
199
|
+
| Drift | built-in | `packages/**` must match the commit (staged, unstaged and untracked all count) | `micro-contracts check --only drift` | `drift` |
|
|
200
200
|
| Manifest | built-in | SHA-256 hash verification | `micro-contracts check --only manifest` | `manifest` |
|
|
201
201
|
| Package typecheck | custom | Generated packages compile (`tsc`) | `micro-contracts check --only package-typecheck` | `package-typecheck` |
|
|
202
202
|
| Project rules | custom | Project-specific Spectral rules on **generated** spec | `micro-contracts check --only spec-project` | `spec-project` |
|
|
@@ -206,8 +206,11 @@ Ensures generated code matches spec and hasn't been tampered.
|
|
|
206
206
|
|
|
207
207
|
**Drift check** — After running `generate`, `packages/**` must match committed state:
|
|
208
208
|
```bash
|
|
209
|
-
git diff --exit-code packages/
|
|
209
|
+
git diff --exit-code HEAD -- packages/ && git ls-files --others --exclude-standard packages/
|
|
210
210
|
```
|
|
211
|
+
Comparing against `HEAD` rather than the index matters: a pre-commit run stages
|
|
212
|
+
its changes first, and comparing the worktree to the index would report a
|
|
213
|
+
hand-edited generated file as clean.
|
|
211
214
|
|
|
212
215
|
**Manifest verification** — `packages/.generated-manifest.json` stores:
|
|
213
216
|
- SHA-256 hashes of all generated files
|
package/package.json
CHANGED