fix(ocm-cli): bundle TUI with solid plugin and declare peer deps

This commit is contained in:
Chris Scott committed 2026-07-14 13:10:34 -04:00
1 parent ed02ddabba
commit 4519bcd2e9
2 files changed
+37 -5

No files matched your search

+18 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@opencode-manager/ocm-cli",
"version": "0.2.3",
"version": "0.2.4",
"description": "OpenCode Manager CLI: attach a local OpenCode TUI to a Manager-hosted repo.",
"license": "MIT",
"repository": {
@@ -14,7 +14,23 @@
],
"exports": {
"./tui": {
"import": "./dist/tui.tsx"
"import": "./dist/tui.js"
}
},
"peerDependencies": {
"@opentui/core": ">=0.1.97",
"@opentui/solid": ">=0.1.97",
"solid-js": ">=1.9.11"
},
"peerDependenciesMeta": {
"@opentui/core": {
"optional": true
},
"@opentui/solid": {
"optional": true
},
"solid-js": {
"optional": true
}
},
"bin": {
+19 -3
View File
@@ -1,5 +1,6 @@
import { chmodSync, copyFileSync, writeFileSync, rmSync, readFileSync } from 'fs'
import { chmodSync, writeFileSync, rmSync, readFileSync } from 'fs'
import { join } from 'path'
import solidPlugin from '@opentui/solid/bun-plugin'
const root = join(import.meta.dir, '..')
const dist = join(root, 'dist')
@@ -26,9 +27,24 @@ async function bundleEntry(label: string, entrypoint: string, outputName: string
}
await bundleEntry('ocm CLI', join('bin', 'ocm.ts'), 'ocm.js')
await bundleEntry('TUI plugin impl', join('src', 'tui-plugin.ts'), 'tui-plugin.js')
copyFileSync(join(root, 'src', 'tui.tsx'), join(dist, 'tui.tsx'))
console.log('Bundling TUI plugin...')
const tuiResult = await Bun.build({
entrypoints: [join(root, 'src', 'tui.tsx')],
outdir: dist,
target: 'node',
format: 'esm',
plugins: [solidPlugin],
external: ['@opentui/solid', '@opentui/core', 'solid-js'],
naming: { entry: 'tui.js' },
})
if (!tuiResult.success) {
for (const log of tuiResult.logs) {
console.error(log)
}
process.exit(1)
}
const ocmJsPath = join(dist, 'ocm.js')
const ocmJsContent = readFileSync(ocmJsPath, 'utf-8')