development
claude/code-feature-parity-q003hm
claude/elegant-carson-l1menh
claude/sigit-acp-local-chat-cx6380
claude/sigit-cloud-agent-expansion-reox0a
claude/tool-permission-system
claude/zen-feynman-0u78dk
development
feature/agent-tools-multiedit-glob-todos-remember
feature/background-commands
feature/commit-coauthor-attribution
feature/headless-mode
feature/init-command
feature/load-local-model-explicitly
feature/session-persistence-compaction
feature/sigit-code-cloud
feature/subagent-tool
feature/tool-permission-system
feature/tui-repo-tabs
feature/tui-tabs
main
release/v1.3.1
| 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 | const npmRoot = path.resolve(__dirname, ".."); |
| 13 | |
| 14 | const vars = { |
| 15 | release_version: version, |
| 16 | }; |
| 17 | |
| 18 | /** |
| 19 | * Replace every `${key}` in the template with the corresponding value from vars. |
| 20 | */ |
| 21 | function interpolate(template, variables) { |
| 22 | return template.replace(/\$\{(\w+)\}/g, (match, key) => { |
| 23 | if (key in variables) return variables[key]; |
| 24 | return match; |
| 25 | }); |
| 26 | } |
| 27 | |
| 28 | // Read and interpolate package-main.json.tmpl |
| 29 | const template = fs.readFileSync( |
| 30 | path.join(npmRoot, "package-main.json.tmpl"), |
| 31 | "utf-8", |
| 32 | ); |
| 33 | |
| 34 | fs.writeFileSync(path.resolve(outputPath), interpolate(template, vars)); |