coderifts 1.8.1 → 1.8.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/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "coderifts",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
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",
7
7
  "bin": {
8
- "coderifts": "./dist/cli.js"
8
+ "coderifts": "dist/cli.js"
9
9
  },
10
10
  "main": "dist/cli.js",
11
11
  "files": [
12
12
  "dist/",
13
13
  "bin/",
14
14
  "scripts/",
15
- "README.md"
15
+ "README.md",
16
+ "corpus/"
16
17
  ],
17
18
  "keywords": [
18
19
  "openapi",
@@ -27,7 +28,7 @@
27
28
  ],
28
29
  "repository": {
29
30
  "type": "git",
30
- "url": "https://github.com/coderifts/app",
31
+ "url": "git+https://github.com/coderifts/app.git",
31
32
  "directory": "packages/cli"
32
33
  },
33
34
  "homepage": "https://coderifts.com",
@@ -36,7 +37,7 @@
36
37
  "node": ">=18.0.0"
37
38
  },
38
39
  "scripts": {
39
- "build": "esbuild bin/coderifts.js --bundle --platform=node --target=node18 --outfile=dist/cli.js",
40
+ "build": "node scripts/copy-corpus.js && esbuild bin/coderifts.js --bundle --platform=node --target=node18 --outfile=dist/cli.js",
40
41
  "prepublishOnly": "npm run build",
41
42
  "postinstall": "node scripts/postinstall.js",
42
43
  "test": "node --test test/*.test.js"
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * Build step: refresh packages/cli/corpus/ from the canonical trust-vector sources in
6
+ * test/accuracy-trust-vectors/ so the bundled corpus never goes stale at publish time.
7
+ * The corpus-guard test asserts the two stay byte-in-sync (fails CI if this wasn't run).
8
+ * No-op (with a warning) when the sources are absent (e.g. building from a partial checkout).
9
+ */
10
+ const fs = require('fs');
11
+ const path = require('path');
12
+
13
+ const SRC_DIR = path.resolve(__dirname, '..', '..', '..', 'test', 'accuracy-trust-vectors');
14
+ const DEST_DIR = path.resolve(__dirname, '..', 'corpus');
15
+ const FILES = ['vectors-mcp-fpfn.json', 'vectors-openapi-fpfn.json'];
16
+
17
+ fs.mkdirSync(DEST_DIR, { recursive: true });
18
+ for (const f of FILES) {
19
+ const src = path.join(SRC_DIR, f);
20
+ if (!fs.existsSync(src)) {
21
+ process.stderr.write(`copy-corpus: source missing (${src}); leaving bundled copy as-is.\n`);
22
+ continue;
23
+ }
24
+ fs.copyFileSync(src, path.join(DEST_DIR, f));
25
+ process.stdout.write(`copy-corpus: ${f} -> corpus/\n`);
26
+ }