fix(release): revert package identity to oh-my-opencode

Keep installer, config detection, schema generation, and publish workflows aligned with the long-lived oh-my-opencode package so this release does not split across two npm names.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-14 13:52:57 +09:00
parent 612b9c163d
commit f31f50abec
11 changed files with 32 additions and 4160 deletions

View File

@@ -7,7 +7,7 @@ import { resetConfigContext } from "./config-context"
import { detectCurrentConfig } from "./detect-current-config"
import { addPluginToOpenCodeConfig } from "./add-plugin-to-opencode-config"
describe("detectCurrentConfig - dual name detection", () => {
describe("detectCurrentConfig - single package detection", () => {
let testConfigDir = ""
let testConfigPath = ""
let testOmoConfigPath = ""
@@ -40,18 +40,6 @@ describe("detectCurrentConfig - dual name detection", () => {
expect(result.isInstalled).toBe(true)
})
it("detects oh-my-openagent in plugin array", () => {
// given
const config = { plugin: ["oh-my-openagent"] }
writeFileSync(testConfigPath, JSON.stringify(config, null, 2) + "\n", "utf-8")
// when
const result = detectCurrentConfig()
// then
expect(result.isInstalled).toBe(true)
})
it("detects oh-my-opencode with version pin", () => {
// given
const config = { plugin: ["oh-my-opencode@3.11.0"] }
@@ -64,18 +52,6 @@ describe("detectCurrentConfig - dual name detection", () => {
expect(result.isInstalled).toBe(true)
})
it("detects oh-my-openagent with version pin", () => {
// given
const config = { plugin: ["oh-my-openagent@3.12.0"] }
writeFileSync(testConfigPath, JSON.stringify(config, null, 2) + "\n", "utf-8")
// when
const result = detectCurrentConfig()
// then
expect(result.isInstalled).toBe(true)
})
it("returns false when plugin not present", () => {
// given
const config = { plugin: ["some-other-plugin"] }
@@ -90,7 +66,7 @@ describe("detectCurrentConfig - dual name detection", () => {
it("detects OpenCode Go from the existing omo config", () => {
// given
writeFileSync(testConfigPath, JSON.stringify({ plugin: ["oh-my-openagent"] }, null, 2) + "\n", "utf-8")
writeFileSync(testConfigPath, JSON.stringify({ plugin: ["oh-my-opencode"] }, null, 2) + "\n", "utf-8")
writeFileSync(
testOmoConfigPath,
JSON.stringify({ agents: { atlas: { model: "opencode-go/kimi-k2.5" } } }, null, 2) + "\n",
@@ -106,7 +82,7 @@ describe("detectCurrentConfig - dual name detection", () => {
})
})
describe("addPluginToOpenCodeConfig - dual name detection", () => {
describe("addPluginToOpenCodeConfig - single package writes", () => {
let testConfigDir = ""
let testConfigPath = ""
@@ -125,7 +101,7 @@ describe("addPluginToOpenCodeConfig - dual name detection", () => {
delete process.env.OPENCODE_CONFIG_DIR
})
it("finds and replaces old oh-my-opencode with new name", async () => {
it("keeps oh-my-opencode when it already exists", async () => {
// given
const config = { plugin: ["oh-my-opencode"] }
writeFileSync(testConfigPath, JSON.stringify(config, null, 2) + "\n", "utf-8")
@@ -136,26 +112,10 @@ describe("addPluginToOpenCodeConfig - dual name detection", () => {
// then
expect(result.success).toBe(true)
const savedConfig = JSON.parse(readFileSync(testConfigPath, "utf-8"))
expect(savedConfig.plugin).toContain("oh-my-openagent")
expect(savedConfig.plugin).not.toContain("oh-my-opencode")
expect(savedConfig.plugin).toContain("oh-my-opencode")
})
it("finds and replaces oh-my-openagent with new name", async () => {
// given
const config = { plugin: ["oh-my-openagent"] }
writeFileSync(testConfigPath, JSON.stringify(config, null, 2) + "\n", "utf-8")
// when
const result = await addPluginToOpenCodeConfig("3.11.0")
// then
expect(result.success).toBe(true)
const savedConfig = JSON.parse(readFileSync(testConfigPath, "utf-8"))
expect(savedConfig.plugin).toContain("oh-my-openagent")
expect(savedConfig.plugin).not.toContain("oh-my-opencode")
})
it("finds and replaces version-pinned oh-my-opencode@X.Y.Z", async () => {
it("replaces version-pinned oh-my-opencode@X.Y.Z", async () => {
// given
const config = { plugin: ["oh-my-opencode@3.10.0"] }
writeFileSync(testConfigPath, JSON.stringify(config, null, 2) + "\n", "utf-8")
@@ -166,27 +126,12 @@ describe("addPluginToOpenCodeConfig - dual name detection", () => {
// then
expect(result.success).toBe(true)
const savedConfig = JSON.parse(readFileSync(testConfigPath, "utf-8"))
expect(savedConfig.plugin).toContain("oh-my-openagent")
expect(savedConfig.plugin).toContain("oh-my-opencode")
expect(savedConfig.plugin).not.toContain("oh-my-opencode@3.10.0")
})
it("finds and replaces version-pinned oh-my-openagent@X.Y.Z", async () => {
// given
const config = { plugin: ["oh-my-openagent@3.10.0"] }
writeFileSync(testConfigPath, JSON.stringify(config, null, 2) + "\n", "utf-8")
// when
const result = await addPluginToOpenCodeConfig("3.11.0")
// then
expect(result.success).toBe(true)
const savedConfig = JSON.parse(readFileSync(testConfigPath, "utf-8"))
expect(savedConfig.plugin).toContain("oh-my-openagent")
expect(savedConfig.plugin).not.toContain("oh-my-openagent@3.10.0")
})
it("adds new plugin when none exists", async () => {
// given - no plugin array
// given
const config = {}
writeFileSync(testConfigPath, JSON.stringify(config, null, 2) + "\n", "utf-8")
@@ -196,11 +141,11 @@ describe("addPluginToOpenCodeConfig - dual name detection", () => {
// then
expect(result.success).toBe(true)
const savedConfig = JSON.parse(readFileSync(testConfigPath, "utf-8"))
expect(savedConfig.plugin).toContain("oh-my-openagent")
expect(savedConfig.plugin).toContain("oh-my-opencode")
})
it("adds plugin when plugin array is empty", async () => {
// given - empty plugin array
// given
const config = { plugin: [] }
writeFileSync(testConfigPath, JSON.stringify(config, null, 2) + "\n", "utf-8")
@@ -210,6 +155,6 @@ describe("addPluginToOpenCodeConfig - dual name detection", () => {
// then
expect(result.success).toBe(true)
const savedConfig = JSON.parse(readFileSync(testConfigPath, "utf-8"))
expect(savedConfig.plugin).toContain("oh-my-openagent")
expect(savedConfig.plugin).toContain("oh-my-opencode")
})
})