diff --git a/.simple-release.js b/.simple-release.js index 7de9a124..2aa2e355 100644 --- a/.simple-release.js +++ b/.simple-release.js @@ -1,3 +1,30 @@ +import { readFileSync, writeFileSync } from "node:fs"; import { NpmProject } from "@simple-release/npm"; -export const project = new NpmProject(); +class ArchgateProject extends NpmProject { + async bump(options) { + const result = await super.bump(options); + + if (result) { + const pkgPath = "package.json"; + const pkg = JSON.parse(readFileSync(pkgPath, "utf8")); + const version = pkg.version; + let changed = false; + + for (const dep of Object.keys(pkg.optionalDependencies || {})) { + if (pkg.optionalDependencies[dep] !== version) { + pkg.optionalDependencies[dep] = version; + changed = true; + } + } + + if (changed) { + writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n"); + } + } + + return result; + } +} + +export const project = new ArchgateProject(); diff --git a/bun.lock b/bun.lock index 41d4d65c..4ad0a9cd 100644 --- a/bun.lock +++ b/bun.lock @@ -19,9 +19,9 @@ "zod": "4.3.6", }, "optionalDependencies": { - "archgate-darwin-arm64": ">=0.1.1", - "archgate-linux-x64": ">=0.1.1", - "archgate-win32-x64": ">=0.1.1", + "archgate-darwin-arm64": "0.11.0", + "archgate-linux-x64": "0.11.0", + "archgate-win32-x64": "0.11.0", }, "peerDependencies": { "typescript": "^5", @@ -147,6 +147,12 @@ "ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="], + "archgate-darwin-arm64": ["archgate-darwin-arm64@0.11.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-fKkDfgPfiucngfRbP1p1nfTT08aKHBVX4L9JqfFPotaYorS8uLUThcQY33pJ1mESgFAXcqC5rLCmIYxTgPl0gA=="], + + "archgate-linux-x64": ["archgate-linux-x64@0.11.0", "", { "os": "linux", "cpu": "x64" }, "sha512-JRvbWC4LySfj5EhcQFA7LlhDOpsvv7qU3GOuxQURwOm8+brjmI9Rk0BRrhowKDZcqk2QswC6xkvwZTJ53eGdvQ=="], + + "archgate-win32-x64": ["archgate-win32-x64@0.11.0", "", { "os": "win32", "cpu": "x64" }, "sha512-dQ3t74V8BRJVFHERwymHKZBp/2FkxKgMxkhs/T/r+G5wmnbZmFml6ojX+LI47Ohp97NeTfgf1CRjeyrlQrSYFA=="], + "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], "array-ify": ["array-ify@1.0.0", "", {}, "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng=="], diff --git a/package.json b/package.json index c07417ba..384e3003 100644 --- a/package.json +++ b/package.json @@ -76,8 +76,8 @@ "typescript": "^5" }, "optionalDependencies": { - "archgate-darwin-arm64": ">=0.1.1", - "archgate-linux-x64": ">=0.1.1", - "archgate-win32-x64": ">=0.1.1" + "archgate-darwin-arm64": "0.11.0", + "archgate-linux-x64": "0.11.0", + "archgate-win32-x64": "0.11.0" } }