feat(shared): add plugin-identity constants for oh-my-openagent rename
- Add plugin-identity.ts with 7 constants (PLUGIN_NAME, LEGACY_PLUGIN_NAME, etc.) - Add plugin-identity.test.ts with TDD tests - Update barrel export in index.ts - Add oh-my-openagent.schema.json for dual schema support - Update build-schema.ts to output both schemas Wave 1 of rename-openagent plan complete.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3,15 +3,30 @@ import { createOhMyOpenCodeJsonSchema } from "./build-schema-document"
|
||||
|
||||
const SCHEMA_OUTPUT_PATH = "assets/oh-my-opencode.schema.json"
|
||||
const DIST_SCHEMA_OUTPUT_PATH = "dist/oh-my-opencode.schema.json"
|
||||
const OPENAGENT_SCHEMA_OUTPUT_PATH = "assets/oh-my-openagent.schema.json"
|
||||
const OPENAGENT_DIST_SCHEMA_OUTPUT_PATH = "dist/oh-my-openagent.schema.json"
|
||||
|
||||
async function main() {
|
||||
console.log("Generating JSON Schema...")
|
||||
|
||||
const finalSchema = createOhMyOpenCodeJsonSchema()
|
||||
|
||||
// oh-my-opencode schema (backward compatibility)
|
||||
await Bun.write(SCHEMA_OUTPUT_PATH, JSON.stringify(finalSchema, null, 2))
|
||||
await Bun.write(DIST_SCHEMA_OUTPUT_PATH, JSON.stringify(finalSchema, null, 2))
|
||||
|
||||
// oh-my-openagent schema (new name)
|
||||
const openAgentSchema = {
|
||||
...finalSchema,
|
||||
$id: "https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/assets/oh-my-openagent.schema.json",
|
||||
title: "Oh My OpenAgent Configuration",
|
||||
description: "Configuration schema for oh-my-openagent plugin",
|
||||
}
|
||||
await Bun.write(OPENAGENT_SCHEMA_OUTPUT_PATH, JSON.stringify(openAgentSchema, null, 2))
|
||||
await Bun.write(OPENAGENT_DIST_SCHEMA_OUTPUT_PATH, JSON.stringify(openAgentSchema, null, 2))
|
||||
|
||||
console.log(`✓ JSON Schema generated: ${SCHEMA_OUTPUT_PATH}`)
|
||||
console.log(`✓ JSON Schema generated: ${OPENAGENT_SCHEMA_OUTPUT_PATH}`)
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
@@ -1,48 +1,89 @@
|
||||
import { describe, it, expect } from "bun:test"
|
||||
import { PLUGIN_NAME, CONFIG_BASENAME, LOG_FILENAME, CACHE_DIR_NAME } from "./plugin-identity"
|
||||
import {
|
||||
PLUGIN_NAME,
|
||||
LEGACY_PLUGIN_NAME,
|
||||
CONFIG_BASENAME,
|
||||
LEGACY_CONFIG_BASENAME,
|
||||
LOG_FILENAME,
|
||||
CACHE_DIR_NAME,
|
||||
LEGACY_CACHE_DIR_NAME,
|
||||
} from "./plugin-identity"
|
||||
|
||||
describe("plugin-identity constants", () => {
|
||||
describe("PLUGIN_NAME", () => {
|
||||
it("equals oh-my-openagent", () => {
|
||||
// given
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
expect(PLUGIN_NAME).toBe("oh-my-openagent")
|
||||
})
|
||||
})
|
||||
|
||||
describe("LEGACY_PLUGIN_NAME", () => {
|
||||
it("equals oh-my-opencode", () => {
|
||||
// given
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
expect(PLUGIN_NAME).toBe("oh-my-opencode")
|
||||
expect(LEGACY_PLUGIN_NAME).toBe("oh-my-opencode")
|
||||
})
|
||||
})
|
||||
|
||||
describe("CONFIG_BASENAME", () => {
|
||||
it("equals oh-my-openagent", () => {
|
||||
// given
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
expect(CONFIG_BASENAME).toBe("oh-my-openagent")
|
||||
})
|
||||
})
|
||||
|
||||
describe("LEGACY_CONFIG_BASENAME", () => {
|
||||
it("equals oh-my-opencode", () => {
|
||||
// given
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
expect(CONFIG_BASENAME).toBe("oh-my-opencode")
|
||||
expect(LEGACY_CONFIG_BASENAME).toBe("oh-my-opencode")
|
||||
})
|
||||
})
|
||||
|
||||
describe("LOG_FILENAME", () => {
|
||||
it("equals oh-my-opencode.log", () => {
|
||||
it("equals oh-my-openagent.log", () => {
|
||||
// given
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
expect(LOG_FILENAME).toBe("oh-my-opencode.log")
|
||||
expect(LOG_FILENAME).toBe("oh-my-openagent.log")
|
||||
})
|
||||
})
|
||||
|
||||
describe("CACHE_DIR_NAME", () => {
|
||||
it("equals oh-my-openagent", () => {
|
||||
// given
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
expect(CACHE_DIR_NAME).toBe("oh-my-openagent")
|
||||
})
|
||||
})
|
||||
|
||||
describe("LEGACY_CACHE_DIR_NAME", () => {
|
||||
it("equals oh-my-opencode", () => {
|
||||
// given
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
expect(CACHE_DIR_NAME).toBe("oh-my-opencode")
|
||||
expect(LEGACY_CACHE_DIR_NAME).toBe("oh-my-opencode")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
export const PLUGIN_NAME = "oh-my-opencode"
|
||||
export const LEGACY_PLUGIN_NAME = "oh-my-openagent"
|
||||
export const CONFIG_BASENAME = "oh-my-opencode"
|
||||
export const LOG_FILENAME = "oh-my-opencode.log"
|
||||
export const CACHE_DIR_NAME = "oh-my-opencode"
|
||||
export const PLUGIN_NAME = "oh-my-openagent"
|
||||
export const LEGACY_PLUGIN_NAME = "oh-my-opencode"
|
||||
export const CONFIG_BASENAME = "oh-my-openagent"
|
||||
export const LEGACY_CONFIG_BASENAME = "oh-my-opencode"
|
||||
export const LOG_FILENAME = "oh-my-openagent.log"
|
||||
export const CACHE_DIR_NAME = "oh-my-openagent"
|
||||
export const LEGACY_CACHE_DIR_NAME = "oh-my-opencode"
|
||||
|
||||
Reference in New Issue
Block a user