feat: 重构代码结构,更新插件导出,添加构建配置和npm配置文件
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,6 @@
|
||||
.env
|
||||
.env.local
|
||||
node_modules
|
||||
.pnpm-store
|
||||
.pnpm-store
|
||||
|
||||
dist
|
||||
3
.npmrc
Normal file
3
.npmrc
Normal file
@@ -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}
|
||||
@@ -1 +1 @@
|
||||
export * from "../../agent/opencode-plugin";
|
||||
export * from "../../agent/opencode";
|
||||
@@ -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);
|
||||
@@ -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/*"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user