From b15b11fa02b16dda664cb5cc14baaa34b4ee9954 Mon Sep 17 00:00:00 2001 From: xiongxiao Date: Tue, 27 Jan 2026 04:12:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=8C=E6=9B=B4=E6=96=B0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8Cnpm=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- .npmrc | 3 +++ .opencode/plugins/cnb.ts | 2 +- agent/{opencode-plugin.ts => opencode.ts} | 0 bun.config.ts | 19 +++++++++++++++++++ package.json | 9 ++++++++- 6 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .npmrc rename agent/{opencode-plugin.ts => opencode.ts} (100%) diff --git a/.gitignore b/.gitignore index bd681d0..494bdae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .env .env.local node_modules -.pnpm-store \ No newline at end of file +.pnpm-store + +dist \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..6948c8c --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +//npm.xiongxiao.me/:_authToken=${ME_NPM_TOKEN} +//npm.cnb.cool/kevisual/registry/-/packages/:_authToken=${CNB_API_KEY} +//registry.npmjs.org/:_authToken=${NPM_TOKEN} diff --git a/.opencode/plugins/cnb.ts b/.opencode/plugins/cnb.ts index a062919..ccd207b 100644 --- a/.opencode/plugins/cnb.ts +++ b/.opencode/plugins/cnb.ts @@ -1 +1 @@ -export * from "../../agent/opencode-plugin"; \ No newline at end of file +export * from "../../agent/opencode"; \ No newline at end of file diff --git a/agent/opencode-plugin.ts b/agent/opencode.ts similarity index 100% rename from agent/opencode-plugin.ts rename to agent/opencode.ts diff --git a/bun.config.ts b/bun.config.ts index e69de29..14802cc 100644 --- a/bun.config.ts +++ b/bun.config.ts @@ -0,0 +1,19 @@ +import { resolvePath } from '@kevisual/use-config'; +import { execSync } from 'node:child_process'; + +const entry = 'agent/opencode.ts'; +const naming = 'opencode'; +const external: string[] = ["bun"]; +await Bun.build({ + target: 'node', + format: 'esm', + entrypoints: [resolvePath(entry, { meta: import.meta })], + outdir: resolvePath('./dist', { meta: import.meta }), + naming: { + entry: `${naming}.js`, + }, + external, +}); + +const cmd = 'dts -i agent/opencode.ts -o opencode.d.ts'; +execSync(cmd); \ No newline at end of file diff --git a/package.json b/package.json index 485bd4a..416e3a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/cnb", - "version": "0.0.1", + "version": "0.0.3", "description": "", "main": "index.js", "scripts": { @@ -8,6 +8,7 @@ }, "keywords": [], "files": [ + "dist", "src", "mod.ts", "agent" @@ -35,5 +36,11 @@ "es-toolkit": "^1.44.0", "nanoid": "^5.1.6", "zod": "^4.3.6" + }, + "exports": { + ".": "./mod.ts", + "./opencode": "./dist/opencode.js", + "./src/*": "./src/*", + "./agent/*": "./agent/*" } } \ No newline at end of file