From 4212372695d8231e3ec6a4f06d59b7ac28d6b986 Mon Sep 17 00:00:00 2001 From: JRedeker Date: Tue, 21 Jul 2026 16:54:58 -0400 Subject: [PATCH] chore(dev-tooling): adopt canonical Bun+TS baseline for opencode-plugin Per ~/toolbox/docs/dev-tooling-baseline.md (D1-D7): - Add packageManager (npm@11.12.1) + engines.node (>=24.0.0) declarations - Migrate bun-types -> @types/bun + tsconfig types: ["bun"] - Add noEmit: true to tsconfig (was relying on script flag) - Add eslint-config-prettier to eslint.config.js (preserves existing custom rule) - Add ignores block to eslint flat config (dist/, node_modules/, coverage/) - Preserve existing .prettierrc custom settings (semi:false, singleQuote:false, etc.) Verified: npm run check passes (typecheck + lint + format:check + test 19/19) Refs: optimizeBunTsDevToolingV4 --- opencode-plugin/eslint.config.js | 17 ++++++++++---- opencode-plugin/package-lock.json | 38 +++++++++++++++++++++++++++---- opencode-plugin/package.json | 7 +++++- opencode-plugin/tsconfig.json | 3 ++- 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/opencode-plugin/eslint.config.js b/opencode-plugin/eslint.config.js index 2ebf125..c79484b 100644 --- a/opencode-plugin/eslint.config.js +++ b/opencode-plugin/eslint.config.js @@ -1,8 +1,17 @@ import eslint from "@eslint/js" import tseslint from "typescript-eslint" +import prettierConfig from "eslint-config-prettier" -export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, { - rules: { - "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended, + { + rules: { + "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], + }, }, -}) + prettierConfig, + { + ignores: ["dist/**", "node_modules/**", "coverage/**"], + } +) diff --git a/opencode-plugin/package-lock.json b/opencode-plugin/package-lock.json index ab6c13c..542bd10 100644 --- a/opencode-plugin/package-lock.json +++ b/opencode-plugin/package-lock.json @@ -14,15 +14,19 @@ }, "devDependencies": { "@eslint/js": "^9.17.0", + "@types/bun": "latest", "@types/node": "^22.10.2", "@vitest/coverage-v8": "^4.0.17", - "bun-types": "latest", "eslint": "^9.17.0", + "eslint-config-prettier": "^10.0.0", "prettier": "^3.4.2", "tsx": "^4.21.0", "typescript": "^5.0.0", "typescript-eslint": "^8.18.2", "vitest": "^4.0.17" + }, + "engines": { + "node": ">=24.0.0" } }, "node_modules/@babel/helper-string-parser": { @@ -1148,6 +1152,16 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/bun": { + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@types/bun/-/bun-1.3.14.tgz", + "integrity": "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bun-types": "1.3.14" + } + }, "node_modules/@types/chai": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", @@ -1692,9 +1706,9 @@ } }, "node_modules/bun-types": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.3.6.tgz", - "integrity": "sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ==", + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.3.14.tgz", + "integrity": "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1926,6 +1940,22 @@ } } }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-scope": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", diff --git a/opencode-plugin/package.json b/opencode-plugin/package.json index 1c9f43b..0155d07 100644 --- a/opencode-plugin/package.json +++ b/opencode-plugin/package.json @@ -4,6 +4,10 @@ "description": "OpenCode plugin for Vision MCP daemon - enables AI agents to discover and configure MCP servers", "type": "module", "main": "src/index.ts", + "packageManager": "npm@11.12.1", + "engines": { + "node": ">=24.0.0" + }, "keywords": [ "opencode", "plugin", @@ -30,10 +34,11 @@ }, "devDependencies": { "@eslint/js": "^9.17.0", + "@types/bun": "latest", "@types/node": "^22.10.2", "@vitest/coverage-v8": "^4.0.17", - "bun-types": "latest", "eslint": "^9.17.0", + "eslint-config-prettier": "^10.0.0", "prettier": "^3.4.2", "tsx": "^4.21.0", "typescript": "^5.0.0", diff --git a/opencode-plugin/tsconfig.json b/opencode-plugin/tsconfig.json index 98d5e3c..7cc767c 100644 --- a/opencode-plugin/tsconfig.json +++ b/opencode-plugin/tsconfig.json @@ -9,9 +9,10 @@ "forceConsistentCasingInFileNames": true, "declaration": true, "declarationMap": true, + "noEmit": true, "outDir": "./dist", "rootDir": ".", - "types": ["bun-types"] + "types": ["bun"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules", "dist"]