@volute_cvc/cvc 0.0.0 → 0.7.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/package.json CHANGED
@@ -1,7 +1,23 @@
1
1
  {
2
2
  "name": "@volute_cvc/cvc",
3
- "version": "0.0.0",
4
- "description": "Placeholder for the CVC command-line launcher; the first real release is 0.7.1",
3
+ "version": "0.7.1",
4
+ "description": "Command-line launcher for Volute CVC (Cognitive Version Control): provides the cvc, cvc-mcp and cvc-lsp commands",
5
+ "bin": {
6
+ "cvc-mcp": "bin/cvc-mcp.js",
7
+ "cvc": "bin/cvc.js",
8
+ "cvc-lsp": "bin/cvc-lsp.js"
9
+ },
10
+ "files": [
11
+ "bin/*.js",
12
+ "scripts/stage-third-party-notices.mjs",
13
+ "README.md",
14
+ "THIRD-PARTY-NOTICES.md"
15
+ ],
16
+ "scripts": {
17
+ "prepack": "node scripts/stage-third-party-notices.mjs stage",
18
+ "postpack": "node scripts/stage-third-party-notices.mjs cleanup",
19
+ "test": "node --test test/*.test.js"
20
+ },
5
21
  "repository": {
6
22
  "type": "git",
7
23
  "url": "git+https://github.com/meirka8/volute.git"
@@ -12,10 +28,6 @@
12
28
  },
13
29
  "author": "Volute",
14
30
  "license": "Apache-2.0",
15
- "files": [
16
- "README.md",
17
- "LICENSE"
18
- ],
19
31
  "publishConfig": {
20
32
  "access": "public"
21
33
  }
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { constants, copyFileSync, existsSync, lstatSync, readFileSync, rmSync } from 'node:fs';
3
+ import { createHash } from 'node:crypto';
4
+ import { dirname, resolve } from 'node:path';
5
+
6
+ const packageRoot = resolve(dirname(new URL(import.meta.url).pathname), '..');
7
+ const source = resolve(packageRoot, '..', '..', 'THIRD-PARTY-NOTICES.md');
8
+ const destination = resolve(packageRoot, 'THIRD-PARTY-NOTICES.md');
9
+ const digest = file => createHash('sha256').update(readFileSync(file)).digest('hex');
10
+ const regular = (file, label) => {
11
+ if (!existsSync(file)) throw new Error(`${label} is missing`);
12
+ const stat = lstatSync(file);
13
+ if (stat.isSymbolicLink() || !stat.isFile()) throw new Error(`${label} must be a regular file`);
14
+ };
15
+
16
+ if (process.argv[2] === 'stage') {
17
+ regular(source, 'root THIRD-PARTY-NOTICES.md');
18
+ if (existsSync(destination)) throw new Error('refusing to overwrite staged THIRD-PARTY-NOTICES.md; run cleanup first');
19
+ copyFileSync(source, destination, constants.COPYFILE_EXCL);
20
+ regular(destination, 'staged THIRD-PARTY-NOTICES.md');
21
+ if (digest(source) !== digest(destination)) throw new Error('staged notice digest mismatch');
22
+ } else if (process.argv[2] === 'cleanup') {
23
+ if (existsSync(destination)) { regular(destination, 'staged THIRD-PARTY-NOTICES.md'); rmSync(destination); }
24
+ } else {
25
+ throw new Error('Usage: stage-third-party-notices.mjs <stage|cleanup>');
26
+ }