feat: split plugins and cleanup #19

Merged
StanPonomarev merged 4 commits from feat/split_plugins into main 2026-10-04 19:01:27 +02:00
3 changed files with 7 additions and 2 deletions
Showing only changes of commit 74f2fa8f46 - Show all commits
+3
View File
@@ -0,0 +1,3 @@
# CI-safe tests and scripts
Do not assume local directories, files, tools, or generated artifacts exist in a clean CI environment. In particular, `/tmp/opencode` is an agent-environment convenience, not a CI guarantee. Tests should create temporary directories with `node:os` `tmpdir()` and `mkdtemp(join(tmpdir(), prefix))`, explicitly create required parent directories and fixtures, and clean up the files they create.
+2 -1
View File
@@ -10,6 +10,7 @@ import {
symlink, symlink,
writeFile, writeFile,
} from "node:fs/promises"; } from "node:fs/promises";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path"; import { dirname, join } from "node:path";
import { createHash } from "node:crypto"; import { createHash } from "node:crypto";
import { install } from "../scripts/install.js"; import { install } from "../scripts/install.js";
@@ -56,7 +57,7 @@ async function run(
return { exitCode, stdout, stderr }; return { exitCode, stdout, stderr };
} }
async function fixture() { async function fixture() {
const directory = await mkdtemp("/tmp/opencode/plugin-install-"); const directory = await mkdtemp(join(tmpdir(), "plugin-install-"));
directories.push(directory); directories.push(directory);
const source = join(directory, "package with spaces"); const source = join(directory, "package with spaces");
const config = join(directory, "config with spaces"); const config = join(directory, "config with spaces");
+2 -1
View File
@@ -1,12 +1,13 @@
import { expect, test } from "bun:test"; import { expect, test } from "bun:test";
import { mkdir, mkdtemp, rm } from "node:fs/promises"; import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path"; import { join } from "node:path";
import { Host } from "@opencode/plugin/host"; import { Host } from "@opencode/plugin/host";
import { build } from "../scripts/build.js"; import { build } from "../scripts/build.js";
import { install } from "../scripts/install.js"; import { install } from "../scripts/install.js";
test("packed package has independent native plugins and quota-only TUI discovery", async () => { test("packed package has independent native plugins and quota-only TUI discovery", async () => {
const directory = await mkdtemp("/tmp/opencode/plugin-package-"); const directory = await mkdtemp(join(tmpdir(), "plugin-package-"));
try { try {
await build(); await build();
const archive = join(directory, "stanp-opencode.tgz"); const archive = join(directory, "stanp-opencode.tgz");