feature/cargo-workspace
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 [outputPath, version, templateName = "package-main.json.tmpl"] = |
| 7 | process.argv.slice(2); |
| 8 | |
| 9 | if (!outputPath || !version) { |
| 10 | throw new Error( |
| 11 | "Usage: render-main-package.cjs <output-path> <version> [template-name]", |
| 12 | ); |
| 13 | } |
| 14 | |
| 15 | const npmRoot = path.resolve(__dirname, ".."); |
| 16 | |
| 17 | const vars = { |
| 18 | release_version: version, |
| 19 | }; |
| 20 | |
| 21 | /** |
| 22 | * Replace every `${key}` in the template with the corresponding value from vars. |
| 23 | */ |
| 24 | function interpolate(template, variables) { |
| 25 | return template.replace(/\$\{(\w+)\}/g, (match, key) => { |
| 26 | if (key in variables) return variables[key]; |
| 27 | return match; |
| 28 | }); |
| 29 | } |
| 30 | |
| 31 | // Read and interpolate the requested template: package-main.json.tmpl for |
| 32 | // @getsigit/sigit, package-compat.json.tmpl for the @smbcloud/sigit copy. |
| 33 | const template = fs.readFileSync(path.join(npmRoot, templateName), "utf-8"); |
| 34 | |
| 35 | fs.writeFileSync(path.resolve(outputPath), interpolate(template, vars)); |