@sigit / si Mirror · read-only
Fork 0

Mirror of github.com/getsigit/si.

Mirrored from https://github.com/getsigit/si.git

Synced Nov 24, 09:30 UTC

1 #!/usr/bin/env node
2
3 const fs = require("fs");
4 const path = require("path");
5
6 const [outputPath, version] = process.argv.slice(2);
7
8 if (!outputPath || !version) {
9 throw new Error("Usage: render-main-package.cjs <output-path> <version>");
10 }
11
12 // The platform binary packages the launcher resolves at runtime. Kept in lockstep with the
13 // release-npm.yml build matrix.
14 const platformSuffixes = [
15 "darwin-arm64",
16 "darwin-x64",
17 "linux-arm64",
18 "linux-x64",
19 "windows-arm64",
20 "windows-x64",
21 ];
22
23 const optionalDependencies = {};
24 for (const suffix of platformSuffixes) {
25 optionalDependencies[`@getsigit/si-${suffix}`] = version;
26 }
27
28 const packageJson = {
29 name: "@getsigit/si",
30 version,
31 // Ownership proof for the MCP Registry: must match `name` in the repo's server.json.
32 mcpName: "si.sigit/cli",
33 keywords: ["sigit", "si", "cli", "git", "code-review", "mcp"],
34 bin: {
35 si: "lib/index.js",
36 },
37 files: ["lib", "README.md"],
38 description: "si, the sigit.si command line interface.",
39 license: "Apache-2.0",
40 homepage: "https://sigit.si",
41 repository: {
42 type: "git",
43 url: "git+https://github.com/getsigit/si.git",
44 },
45 scripts: {
46 typecheck: "tsc --noEmit",
47 build: "tsc",
48 dev: "npm run build && node lib/index.js",
49 },
50 devDependencies: {
51 "@types/node": "^18.15.11",
52 typescript: "^5.0.0",
53 },
54 optionalDependencies,
55 };
56
57 fs.writeFileSync(path.resolve(outputPath), `${JSON.stringify(packageJson, null, 2)}\n`);