From c5ee6d20e6fd9afed2a16d9ab7895083cc9a5237 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sun, 1 Feb 2026 19:03:16 +0800 Subject: [PATCH] fix --- bun.config.ts | 24 ++++++++++++ package.json | 14 ++++--- pnpm-lock.yaml | 85 ++++++++++++++++++++++++++++++++++++++++ src/config-permission.ts | 2 +- tsup.config.ts | 13 ------ 5 files changed, 118 insertions(+), 20 deletions(-) create mode 100644 bun.config.ts create mode 100644 pnpm-lock.yaml delete mode 100644 tsup.config.ts diff --git a/bun.config.ts b/bun.config.ts new file mode 100644 index 0000000..4453472 --- /dev/null +++ b/bun.config.ts @@ -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' }); \ No newline at end of file diff --git a/package.json b/package.json index bb02251..ba6c448 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,14 @@ { "name": "@kevisual/permission", - "version": "0.0.3", + "version": "0.0.4", "description": "", "main": "dist/config-permission.js", "scripts": { - "build": "tsup", - "dev": "tsup --watch", - "dev:lib": "tsup --watch" + "build": "bun run bun.config.ts" }, "files": [ - "dist" + "dist", + "src" ], "keywords": [], "author": "abearxiong ", @@ -22,6 +21,9 @@ "access": "public" }, "devDependencies": { - "tsup": "^8.4.0" + "@kevisual/types": "^0.0.12", + "@kevisual/use-config": "^1.0.28", + "@types/bun": "^1.3.8", + "@types/node": "^25.1.0" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..156181e --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,85 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@kevisual/types': + specifier: ^0.0.12 + version: 0.0.12 + '@kevisual/use-config': + specifier: ^1.0.28 + version: 1.0.28(dotenv@17.2.3) + '@types/bun': + specifier: ^1.3.8 + version: 1.3.8 + '@types/node': + specifier: ^25.1.0 + version: 25.1.0 + +packages: + + '@kevisual/load@0.0.6': + resolution: {integrity: sha512-+3YTFehRcZ1haGel5DKYMUwmi5i6f2psyaPZlfkKU/cOXgkpwoG9/BEqPCnPjicKqqnksEpixVRkyHJ+5bjLVA==} + + '@kevisual/types@0.0.12': + resolution: {integrity: sha512-zJXH2dosir3jVrQ6QG4i0+iLQeT9gJ3H+cKXs8ReWboxBSYzUZO78XssVeVrFPsJ33iaAqo4q3DWbSS1dWGn7Q==} + + '@kevisual/use-config@1.0.28': + resolution: {integrity: sha512-ngF+LDbjxpXWrZNmnShIKF/jPpAa+ezV+DcgoZIIzHlRnIjE+rr9sLkN/B7WJbiH9C/j1tQXOILY8ujBqILrow==} + peerDependencies: + dotenv: ^17 + + '@types/bun@1.3.8': + resolution: {integrity: sha512-3LvWJ2q5GerAXYxO2mffLTqOzEu5qnhEAlh48Vnu8WQfnmSwbgagjGZV6BoHKJztENYEDn6QmVd949W4uESRJA==} + + '@types/node@25.1.0': + resolution: {integrity: sha512-t7frlewr6+cbx+9Ohpl0NOTKXZNV9xHRmNOvql47BFJKcEG1CxtxlPEEe+gR9uhVWM4DwhnvTF110mIL4yP9RA==} + + bun-types@1.3.8: + resolution: {integrity: sha512-fL99nxdOWvV4LqjmC+8Q9kW3M4QTtTR1eePs94v5ctGqU8OeceWrSUaRw3JYb7tU3FkMIAjkueehrHPPPGKi5Q==} + + dotenv@17.2.3: + resolution: {integrity: sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==} + engines: {node: '>=12'} + + eventemitter3@5.0.4: + resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==} + + undici-types@7.16.0: + resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + +snapshots: + + '@kevisual/load@0.0.6': + dependencies: + eventemitter3: 5.0.4 + + '@kevisual/types@0.0.12': {} + + '@kevisual/use-config@1.0.28(dotenv@17.2.3)': + dependencies: + '@kevisual/load': 0.0.6 + dotenv: 17.2.3 + + '@types/bun@1.3.8': + dependencies: + bun-types: 1.3.8 + + '@types/node@25.1.0': + dependencies: + undici-types: 7.16.0 + + bun-types@1.3.8: + dependencies: + '@types/node': 25.1.0 + + dotenv@17.2.3: {} + + eventemitter3@5.0.4: {} + + undici-types@7.16.0: {} diff --git a/src/config-permission.ts b/src/config-permission.ts index d88bd6a..89ff3b1 100644 --- a/src/config-permission.ts +++ b/src/config-permission.ts @@ -134,7 +134,7 @@ export class ConfigPermission { */ checkPassword(password: string) { if (this.permission.password) { - const ok = this.permission.password !== password; + const ok = this.permission.password === password; return ok ? 'success' : 'error'; } return 'none'; diff --git a/tsup.config.ts b/tsup.config.ts deleted file mode 100644 index 5562c9a..0000000 --- a/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: ['src/config-permission.ts'], - - splitting: false, - sourcemap: false, - clean: true, - format: 'esm', - dts: true, - outDir: 'dist', - tsconfig: 'tsconfig.json', -});