feat: add quota tracking

This commit is contained in:
2026-09-12 09:51:04 +02:00
parent 4ea9b4a695
commit 411cdd13ff
13 changed files with 1269 additions and 16 deletions
+6 -1
View File
@@ -96,7 +96,7 @@ async function install(mode: "native" | "checksum" | "legacy", configured = fals
version: "1.0.0",
type: "module",
main: "./dist/index.js",
exports: "./dist/index.js",
exports: { ".": "./dist/index.js", "./tui": "./dist/tui.js" },
scripts: { postinstall: "bun ./postinstall.js" },
}),
),
@@ -111,6 +111,10 @@ async function install(mode: "native" | "checksum" | "legacy", configured = fals
? 'export default { id: "stanp-opencode", async server() { return {}; } };\n'
: 'export default { id: "stanp-opencode", setup() { return "native-ready"; } };\n'),
),
writeFile(
join(fixture, "dist", "tui.js"),
'export default { id: "stanp-opencode.quota-tui", setup() { return "tui-ready"; } };\n',
),
]);
const env = {
...Bun.env,
@@ -220,6 +224,7 @@ test("installs an importable native plugin and default config under XDG without
expect(await Bun.file(join(config, "plugins", "stanp-opencode", "package.json")).exists()).toBe(
true,
);
expect(await Bun.file(join(config, "plugins", "stanp-opencode", "tui.js")).exists()).toBe(true);
expect(
await readFile(join(config, "stanp-opencode", "install.previous", "index.js"), "utf8"),
).toBe(previousPlugin);