mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
chore(opencode): move the OpenCode pin to 2.2.3 and ocm-cli to OpenTUI 0.8 (OM-169)
OpenCode 2.2.3 requires TUI plugins built for OpenTUI 0.8. Move the single OpenCode pin, the typed client and schema, the Docker default and the CI download to 2.2.3, so the supported range becomes >=2.2.3 <3.0.0, and regenerate the theme palettes from the v2.2.3 tag. Move ocm-cli to @opencode/plugin and @opencode/theme 2.2.3 and OpenTUI 0.8.0, raise the solid-js dev pin and peer floor to 1.9.16, and teach the package-compat test to read the floor of a range peer, keeping a patch-level 0.x floor and normalizing prefixed versions. Guard the CI workflow's download against the pin in the contract test, take the binary test fixture from the pin, and document the ocm 0.5.x requirement of a local OpenCode >= 2.2.3.
This commit is contained in:
1 parent
65066ab0dc
commit
a9220e8604
17 files changed
+491
-478
No files matched your search
@@ -50,8 +50,8 @@ function createFetchSpy() {
|
||||
describe('OpenCode v2 contract', () => {
|
||||
describe('version policy', () => {
|
||||
it('pins the client version, derives the floor from it and fixes the V2 server username', () => {
|
||||
expect(OPENCODE_PINNED_VERSION).toBe('2.2.1')
|
||||
expect(OPENCODE_SUPPORTED_VERSION_RANGE).toBe('>=2.2.1 <3.0.0')
|
||||
expect(OPENCODE_PINNED_VERSION).toBe('2.2.3')
|
||||
expect(OPENCODE_SUPPORTED_VERSION_RANGE).toBe('>=2.2.3 <3.0.0')
|
||||
expect(OPENCODE_SERVER_USERNAME).toBe('opencode')
|
||||
})
|
||||
|
||||
@@ -62,47 +62,49 @@ describe('OpenCode v2 contract', () => {
|
||||
expect(isSupportedOpenCodeVersion('2.1.0')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.1.1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.0')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.1')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.2.2')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.2.1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.2')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.2.4')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.3.0')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('v2.2.1')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion(' v2.2.1 ')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('v2.2.3')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion(' v2.2.3 ')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('3.0.0')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('3.1.0')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('not-a-version')).toBe(false)
|
||||
})
|
||||
|
||||
it('rejects prereleases of the pinned version', () => {
|
||||
expect(isSupportedOpenCodeVersion('2.2.1-alpha.1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.1-alpha')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.1-rc.1+build.5')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.1-0')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3-alpha.1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3-alpha')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3-rc.1+build.5')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3-0')).toBe(false)
|
||||
})
|
||||
|
||||
it('accepts prereleases of higher numeric cores within the pinned major', () => {
|
||||
expect(isSupportedOpenCodeVersion('2.3.0-beta.1')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.2.2-rc.2')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.2.4-rc.2')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('3.0.0-beta.1')).toBe(false)
|
||||
})
|
||||
|
||||
it('ignores build metadata for precedence', () => {
|
||||
expect(isSupportedOpenCodeVersion('2.2.1+build')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.2.1+2.0.0')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3+build')).toBe(true)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3+2.0.0')).toBe(true)
|
||||
})
|
||||
|
||||
it('rejects malformed and incomplete versions', () => {
|
||||
expect(isSupportedOpenCodeVersion('2garbage')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.0')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.1.1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('02.2.1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.1-alpha..1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3.1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('02.2.3')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('2.2.3-alpha..1')).toBe(false)
|
||||
expect(isSupportedOpenCodeVersion('')).toBe(false)
|
||||
})
|
||||
|
||||
it('describes the supported range for unsupported versions', () => {
|
||||
expect(describeUnsupportedOpenCodeVersion('3.0.0')).toBe(
|
||||
'OpenCode 3.0.0 is not supported; OpenCode Manager requires OpenCode >=2.2.1 <3.0.0',
|
||||
'OpenCode 3.0.0 is not supported; OpenCode Manager requires OpenCode >=2.2.3 <3.0.0',
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -155,6 +157,14 @@ describe('OpenCode v2 contract', () => {
|
||||
readFileSync(join(REPO_ROOT, 'shared', 'package.json'), 'utf8'),
|
||||
) as PackageManifest
|
||||
expect(manifest.dependencies['@opencode/client']).toBe(OPENCODE_PINNED_VERSION)
|
||||
expect(manifest.dependencies['@opencode/schema']).toBe(OPENCODE_PINNED_VERSION)
|
||||
})
|
||||
|
||||
it('keeps the CI workflow OpenCode download in sync with the pin', () => {
|
||||
const workflow = readFileSync(join(REPO_ROOT, '.github', 'workflows', 'ci.yml'), 'utf8')
|
||||
expect(workflow).toMatch(
|
||||
new RegExp(`download_opencode_to ${OPENCODE_PINNED_VERSION.replace(/\./g, '\\.')}(?=\\s)`),
|
||||
)
|
||||
})
|
||||
|
||||
it('makes the shell scripts derive the pin from the Dockerfile or the bundled version instead of hardcoding it', () => {
|
||||
|
||||
Reference in new issue
Block a user