mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix(opencode): address review feedback on the 2.2.5 pin
Document ocm 0.6.x as requiring OpenCode 2.2.5, matching its @opencode/theme peer, and make the package compatibility test check bounded peer ranges instead of treating them as one version. Linked servers on another 2.x release keep the neutral version notice, while a different major version is shown as unsupported again through a shared version badge. The Docker build now fails when the bundled OpenCode is below the supported minimum, and the entrypoint falls back to the bundled version as the floor when OPENCODE_MIN_VERSION is unset instead of discarding every persisted binary.
This commit is contained in:
1 parent
807c7cb896
commit
bf7c6cdbac
10 files changed
+65
-24
No files matched your search
@@ -45,15 +45,24 @@ function deriveMinorLineRange(version: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that an installed version satisfies a plugin peer declaration,
|
||||
* accepting both an exact peer pin and an open `>=` floor.
|
||||
* Asserts that an installed version satisfies a plugin peer declaration: an exact
|
||||
* pin, or space-separated `>=`, `<=` and `<` bounds such as `>=0.8.0 <0.9.0`.
|
||||
*/
|
||||
function expectVersionSatisfiesPeer(version: string, peer: string): void {
|
||||
if (peer.startsWith('>=')) {
|
||||
expect(compareSemver(version, peer.slice(2).trim())).toBeGreaterThanOrEqual(0)
|
||||
const comparators = peer.trim().split(/\s+/)
|
||||
if (!comparators.every((comparator) => comparator.startsWith('>=') || comparator.startsWith('<'))) {
|
||||
expect(version).toBe(peer)
|
||||
return
|
||||
}
|
||||
expect(version).toBe(peer)
|
||||
for (const comparator of comparators) {
|
||||
if (comparator.startsWith('>=')) {
|
||||
expect(compareSemver(version, comparator.slice(2))).toBeGreaterThanOrEqual(0)
|
||||
} else if (comparator.startsWith('<=')) {
|
||||
expect(compareSemver(version, comparator.slice(2))).toBeLessThanOrEqual(0)
|
||||
} else {
|
||||
expect(compareSemver(version, comparator.slice(1))).toBeLessThan(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ocmManifest = readManifest(join(__dirname, '..', 'package.json'))
|
||||
|
||||
Reference in new issue
Block a user