@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 +3 -9
- package/bin/apidiff.js +5 -2
- package/package.json +1 -1
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
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
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 =
|
|
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
|