@apidiffguard/cli 0.3.1 → 0.3.2

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/README.md CHANGED
@@ -2,17 +2,11 @@
2
2
 
3
3
  Command-line JSON / API response diff for CI and local checks. Uses the same engine as APIDiffGuard Cloud (`@apidiffguard/diff`).
4
4
 
5
- ## Install (from this repo)
5
+ ## Install
6
6
 
7
7
  ```bash
8
- cd packages/diff-engine && npm run build && cd -
9
- cd packages/cli && npm install
10
- ```
11
-
12
- Or from the repo root after workspaces are linked:
13
-
14
- ```bash
15
- npx apidiff check --baseline old.json --current new.json --fail-on breaking
8
+ npm install -g @apidiffguard/cli
9
+ npx @apidiffguard/cli --help
16
10
  ```
17
11
 
18
12
  ## Usage
package/bin/apidiff.js CHANGED
@@ -1,9 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync, existsSync } from "node:fs";
3
- import { resolve } from "node:path";
3
+ import { dirname, join, resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
4
5
  import { compareJson, summarizeChanges } from "@apidiffguard/diff";
5
6
 
6
- const VERSION = "0.3.0";
7
+ const VERSION = JSON.parse(
8
+ readFileSync(join(dirname(fileURLToPath(import.meta.url)), "../package.json"), "utf8")
9
+ ).version;
7
10
 
8
11
  function printHelp() {
9
12
  console.log(`apidiff ${VERSION} — APIDiffGuard CLI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apidiffguard/cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "CLI for APIDiffGuard — diff API JSON responses and fail CI on breaking changes.",
5
5
  "type": "module",
6
6
  "bin": {