mirror of
https://github.com/penpot/penpot.git
synced 2026-09-24 21:06:14 +00:00
Remove the legacy @opencode-ai/plugin import and V1 server export so the local plugin loads under OpenCode V2 without project dependencies. Add a focused smoke test for the V2 export and tool registration, and update the related script memories. AI-assisted-by: space-bunny-free
33 lines
715 B
JavaScript
33 lines
715 B
JavaScript
import assert from "node:assert/strict"
|
|
import test from "node:test"
|
|
|
|
import plugin from "../plugins/penpot.js"
|
|
|
|
test("exports only the OpenCode V2 plugin contract", () => {
|
|
assert.equal(plugin.id, "penpot")
|
|
assert.equal("server" in plugin, false)
|
|
})
|
|
|
|
test("registers the Penpot tools during setup", async () => {
|
|
const tools = []
|
|
const context = {
|
|
location: { directory: "/tmp/opencode/penpot-plugin-test" },
|
|
tool: {
|
|
async transform(apply) {
|
|
apply({
|
|
add(tool) {
|
|
tools.push(tool)
|
|
},
|
|
})
|
|
},
|
|
},
|
|
}
|
|
|
|
await plugin.setup(context)
|
|
|
|
assert.deepEqual(
|
|
tools.map((tool) => tool.name).sort(),
|
|
["paren-repair", "penpot-psql"],
|
|
)
|
|
})
|