diff --git a/package.json b/package.json index 221d428ec..1e4e60150 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,24 @@ "devDependencies": { "@boneskull/typedoc-plugin-mermaid": "^0.2.0", "@modelcontextprotocol/sdk": "1.25.2", + "@oven/bun-darwin-aarch64": "^1.2.21", + "@oven/bun-darwin-x64": "^1.2.21", + "@oven/bun-darwin-x64-baseline": "^1.2.21", + "@oven/bun-linux-aarch64": "^1.2.21", + "@oven/bun-linux-aarch64-musl": "^1.2.21", + "@oven/bun-linux-x64": "^1.2.21", + "@oven/bun-linux-x64-baseline": "^1.2.21", + "@oven/bun-linux-x64-musl": "^1.2.21", + "@oven/bun-linux-x64-musl-baseline": "^1.2.21", + "@oven/bun-windows-x64": "^1.2.21", + "@oven/bun-windows-x64-baseline": "^1.2.21", "@playwright/test": "1.57.0", + "@rollup/rollup-darwin-arm64": "^4.53.3", + "@rollup/rollup-darwin-x64": "^4.53.3", + "@rollup/rollup-linux-arm64-gnu": "^4.53.3", + "@rollup/rollup-linux-x64-gnu": "^4.53.3", + "@rollup/rollup-win32-arm64-msvc": "^4.53.3", + "@rollup/rollup-win32-x64-msvc": "^4.53.3", "@types/bun": "^1.3.2", "@types/react": "^19.2.2", "@types/react-dom": "^19.2.2", @@ -117,25 +134,6 @@ "optional": true } }, - "optionalDependencies": { - "@oven/bun-darwin-aarch64": "^1.2.21", - "@oven/bun-darwin-x64": "^1.2.21", - "@oven/bun-darwin-x64-baseline": "^1.2.21", - "@oven/bun-linux-aarch64": "^1.2.21", - "@oven/bun-linux-aarch64-musl": "^1.2.21", - "@oven/bun-linux-x64": "^1.2.21", - "@oven/bun-linux-x64-baseline": "^1.2.21", - "@oven/bun-linux-x64-musl": "^1.2.21", - "@oven/bun-linux-x64-musl-baseline": "^1.2.21", - "@oven/bun-windows-x64": "^1.2.21", - "@oven/bun-windows-x64-baseline": "^1.2.21", - "@rollup/rollup-darwin-arm64": "^4.53.3", - "@rollup/rollup-darwin-x64": "^4.53.3", - "@rollup/rollup-linux-arm64-gnu": "^4.53.3", - "@rollup/rollup-linux-x64-gnu": "^4.53.3", - "@rollup/rollup-win32-arm64-msvc": "^4.53.3", - "@rollup/rollup-win32-x64-msvc": "^4.53.3" - }, "overrides": { "seroval": "1.4.1", "seroval-plugins": "1.4.2", diff --git a/scripts/setup-bun.mjs b/scripts/setup-bun.mjs index 3314cacca..5ea211cff 100644 --- a/scripts/setup-bun.mjs +++ b/scripts/setup-bun.mjs @@ -1,7 +1,4 @@ #!/usr/bin/env node -// Immediate log to verify script execution -console.log("[setup-bun] Script loaded"); - /** * Postinstall script to set up bun from platform-specific optional dependencies. * Handles Windows ARM64 by downloading x64-baseline via emulation. @@ -16,7 +13,7 @@ import { writeFileSync, statSync, } from "fs"; -import { join, dirname } from "path"; +import { join, dirname, resolve } from "path"; import { spawnSync } from "child_process"; import { fileURLToPath } from "url"; import { get } from "https"; @@ -24,6 +21,15 @@ import { createGunzip } from "zlib"; const __dirname = dirname(fileURLToPath(import.meta.url)); const projectRoot = join(__dirname, ".."); + +// Skip when installed as a dependency (INIT_CWD is the user's project directory, +// not the package root). Bun is a dev-only build tool not needed by SDK consumers. +if (process.env.INIT_CWD && resolve(process.env.INIT_CWD) !== resolve(projectRoot)) { + process.exit(0); +} + +// Immediate log to verify script execution +console.log("[setup-bun] Script loaded"); const nodeModules = join(projectRoot, "node_modules"); const binDir = join(nodeModules, ".bin");