coderifts 1.8.4 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coderifts",
3
- "version": "1.8.4",
3
+ "version": "2.0.0",
4
4
  "description": "Detect breaking API changes from the command line. Works locally or with the CodeRifts cloud API.",
5
5
  "author": "CodeRifts <hello@coderifts.com>",
6
6
  "license": "MIT",
@@ -43,11 +43,12 @@
43
43
  "test": "node --test test/*.test.js"
44
44
  },
45
45
  "dependencies": {
46
+ "@coderifts/agent-guard": "^1.6.0",
46
47
  "chalk": "^4.1.2",
47
48
  "cli-table3": "^0.6.4",
48
49
  "commander": "^12.0.0",
49
50
  "inquirer": "^8.2.6",
50
- "js-yaml": "^4.2.0",
51
+ "js-yaml": "^4.3.1",
51
52
  "openapi-diff": "^0.24.1",
52
53
  "ora": "^5.4.1"
53
54
  },
@@ -55,7 +56,9 @@
55
56
  "z-schema": "^7.2.0",
56
57
  "json-schema-ref-parser": "npm:@apidevtools/json-schema-ref-parser@^11.7.3",
57
58
  "form-data": "^4.0.6",
58
- "axios": ">=1.18.0"
59
+ "axios": ">=1.18.0",
60
+ "fast-uri": ">=3.1.5",
61
+ "brace-expansion": "5.0.9"
59
62
  },
60
63
  "devDependencies": {
61
64
  "esbuild": "^0.28.1"
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bash
2
+ # Assert-guarded checks that publish-gate source is present and wired.
3
+ # Aborts loudly on drift. Does not copy vendored files.
4
+ set -euo pipefail
5
+ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
6
+ fail() { echo "ASSERT FAIL: $*" >&2; exit 1; }
7
+
8
+ # Preconditions
9
+ [[ -f "$ROOT/src/commands/publish-gate.js" ]] || fail "missing src/commands/publish-gate.js"
10
+ [[ -f "$ROOT/bin/coderifts.js" ]] || fail "missing bin/coderifts.js"
11
+ [[ -f "$ROOT/test/publish-gate.test.js" ]] || fail "missing test/publish-gate.test.js"
12
+ [[ -f "$ROOT/README.md" ]] || fail "missing README.md"
13
+
14
+ # Expected strings in source
15
+ grep -q "runPublishGate" "$ROOT/src/commands/publish-gate.js" || fail "runPublishGate not in publish-gate.js"
16
+ grep -q "EMPTY_BEFORE" "$ROOT/src/commands/publish-gate.js" || fail "EMPTY_BEFORE guard missing"
17
+ grep -q "execution_action" "$ROOT/src/commands/publish-gate.js" || fail "execution_action eval missing"
18
+ grep -q "NEW_ARTIFACT" "$ROOT/src/commands/publish-gate.js" || fail "NEW_ARTIFACT rejection note missing"
19
+ grep -q "publish-gate" "$ROOT/bin/coderifts.js" || fail "publish-gate command not registered"
20
+ grep -q "prepublishOnly" "$ROOT/README.md" || fail "README missing prepublishOnly wiring"
21
+ grep -q "coderifts publish-gate" "$ROOT/README.md" || fail "README missing publish-gate docs"
22
+
23
+ # Test coverage markers
24
+ grep -q "breaking change BLOCK" "$ROOT/test/publish-gate.test.js" || fail "test missing BLOCK case"
25
+ grep -q "GIT_ERROR" "$ROOT/test/publish-gate.test.js" || fail "test missing GIT_ERROR case"
26
+ grep -q "EMPTY_BEFORE" "$ROOT/test/publish-gate.test.js" || fail "test missing EMPTY_BEFORE case"
27
+ grep -q "clean pass" "$ROOT/test/publish-gate.test.js" || fail "test missing clean pass case"
28
+ grep -q "child.status" "$ROOT/test/publish-gate.test.js" || fail "test missing process-level child.status fixtures"
29
+ grep -q "spawnSync" "$ROOT/test/publish-gate.test.js" || fail "test missing spawnSync process fixtures"
30
+
31
+ # Command boundary must set process exit (library must not be the sole exit owner)
32
+ grep -q "process.exit" "$ROOT/bin/coderifts.js" || fail "bin missing process.exit at publish-gate boundary"
33
+ grep -q "result.exitCode" "$ROOT/bin/coderifts.js" || fail "bin missing result.exitCode mapping"
34
+ # Library must not process.exit (fail-closed is boundary-owned)
35
+ if grep -n "process\.exit" "$ROOT/src/commands/publish-gate.js" | grep -v 'never\|//\|process.exitCode' >/dev/null 2>&1; then
36
+ # Allow comments mentioning process.exit; fail on real calls
37
+ if grep -E "process\.exit\(" "$ROOT/src/commands/publish-gate.js" >/dev/null; then
38
+ fail "publish-gate.js must not call process.exit( — exit is command-boundary only"
39
+ fi
40
+ fi
41
+
42
+ echo "assert-publish-gate: OK"