feature/acp-session-list-cursor
claude/github-issue-40-0au5ua
claude/linked-issue-acp-tui-u4vvpa
claude/minor-release-cut-vkugow
claude/sigit-acp-local-chat-cx6380
claude/sigit-cloud-agent-expansion-reox0a
claude/tool-permission-system
claude/zen-feynman-0u78dk
development
feature/acp-cancel-request
feature/acp-session-list-cursor
feature/acp-v1-conformance
feature/agent-tools-multiedit-glob-todos-remember
feature/cargo-workspace
feature/hooks
feature/load-local-model-explicitly
feature/sigit-agent-profile
feature/sigit-code-cloud
feature/xcode-mcp-server
fix/acp-replay-loaded-session-history
fix/acp-replay-reasoning-and-attachments
fix/dsml-doubled-bar-markers
main
release/v1.5.10
release/v1.5.6
release/v1.6.1
| 1 | #!/usr/bin/env node |
| 2 | |
| 3 | const fs = require("fs"); |
| 4 | const path = require("path"); |
| 5 | |
| 6 | const [ |
| 7 | packageName, |
| 8 | version, |
| 9 | operatingSystem, |
| 10 | architecture, |
| 11 | // `@smbcloud` is the pre-1.5.5 scope, still published alongside `@getsigit` |
| 12 | // so installs made before the rename keep updating. |
| 13 | scope = "@getsigit", |
| 14 | ] = process.argv.slice(2); |
| 15 | |
| 16 | if (!packageName || !version || !operatingSystem || !architecture) { |
| 17 | throw new Error( |
| 18 | "Usage: render-platform-package.cjs <package-name> <version> <os> <arch> [scope]", |
| 19 | ); |
| 20 | } |
| 21 | |
| 22 | const npmRoot = path.resolve(__dirname, ".."); |
| 23 | const packageDirectory = path.resolve(npmRoot, packageName); |
| 24 | |
| 25 | fs.mkdirSync(packageDirectory, { recursive: true }); |
| 26 | |
| 27 | // Variable map for template interpolation |
| 28 | const vars = { |
| 29 | node_scope: scope, |
| 30 | node_pkg: packageName, |
| 31 | node_version: version, |
| 32 | node_os: operatingSystem, |
| 33 | node_arch: architecture, |
| 34 | }; |
| 35 | |
| 36 | /** |
| 37 | * Replace every `${key}` in the template with the corresponding value from vars. |
| 38 | */ |
| 39 | function interpolate(template, variables) { |
| 40 | return template.replace(/\$\{(\w+)\}/g, (match, key) => { |
| 41 | if (key in variables) return variables[key]; |
| 42 | return match; |
| 43 | }); |
| 44 | } |
| 45 | |
| 46 | // Read and interpolate package.json.tmpl |
| 47 | const packageTemplate = fs.readFileSync( |
| 48 | path.join(npmRoot, "package.json.tmpl"), |
| 49 | "utf-8", |
| 50 | ); |
| 51 | fs.writeFileSync( |
| 52 | path.join(packageDirectory, "package.json"), |
| 53 | interpolate(packageTemplate, vars), |
| 54 | ); |
| 55 | |
| 56 | // Read and interpolate README.md.tmpl |
| 57 | const readmeTemplate = fs.readFileSync( |
| 58 | path.join(npmRoot, "README.md.tmpl"), |
| 59 | "utf-8", |
| 60 | ); |
| 61 | fs.writeFileSync( |
| 62 | path.join(packageDirectory, "README.md"), |
| 63 | interpolate(readmeTemplate, vars), |
| 64 | ); |