This commit is contained in:
2026-02-01 19:03:16 +08:00
parent dc56548cdf
commit c5ee6d20e6
5 changed files with 118 additions and 20 deletions

24
bun.config.ts Normal file
View File

@@ -0,0 +1,24 @@
import { resolvePath } from '@kevisual/use-config';
import { execSync } from 'node:child_process';
const buildFn = async (opts: { entry?: string, naming?: string }) => {
const entry = opts.entry || 'agent/opencode.ts';
const naming = opts.naming || 'opencode';
const external: string[] = ["bun", "ws"];
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 ${entry} -o ${naming}.d.ts`;
execSync(cmd);
};
await buildFn({ naming: 'config-permission', entry: 'src/config-permission.ts' });