Bun integration
Skill pantheon-org/tekhne/skills/repository-mgmt/nx/bun-integration
Agents Skills
npx -y skills add pantheon-org/tekhne --skill bun-integrationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Integrate Bun runtime into Nx monorepos with deterministic plugin setup, executor configuration, migration from Node.js toolchains, and cache-aware build/test workflows; use when adding the nx-bun plugin, converting projects, or standardizing Bun targets across Nx workspaces.
SKILL.md
4.8 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it
Nx Bun Integration
Navigation hub for integrating Bun into Nx workspaces.
When to Use
- You are adding Bun projects to an existing Nx workspace.
- You are converting Node.js projects to Bun executors.
- You need cache-aware build, run, and test targets with
@nx-bun/nx. - You need predictable migration guidance for package-manager and runtime changes.
When Not to Use
- The task is Bun runtime API usage without Nx integration concerns.
- The workspace is intentionally standardized on Node.js executors only.
Workflow
- Install
@nx-bun/nxand initialize the plugin. - Generate or convert projects to Bun executors.
- Configure cache inputs and outputs for build/test targets.
- Validate serve, build, and test on one project: run
nx build my-api && nx test my-api && nx serve my-apiand confirm all three exit with code 0 before proceeding. If validation fails: check executor configuration inproject.json, runnx resetto clear stale cache, and retry. Resolve all failures before rolling out. - Roll out to affected projects and enforce anti-pattern checks.
Quick Commands
Install and Initialize Plugin
bun add -D @nx-bun/nx
nx g @nx-bun/nx:init --unitTestRunner=bun
Expected: plugin is installed and generators/executors are available.
Generate Bun Application
nx g @nx-bun/nx:application api --directory=apps/backend --tags=runtime:bun,type:app
Expected: Bun-ready app with Nx project configuration.
Convert Existing Project
nx g @nx-bun/nx:convert-to-bun --project=my-api
Expected: project targets move to Bun executors while preserving Nx target structure.
Verify Build/Test/Run
nx build my-api
nx test my-api
nx serve my-api
Expected: build outputs generated, tests run under Bun test runner, serve target starts.
Run Affected in CI-style
bun nx affected -t lint,test,build --base=main --parallel=3
Expected: only changed projects execute with Nx scheduling.
Anti-Patterns
NEVER mix npm/yarn installs with Bun in the same migration scope
- WHY: mixed lockfiles and resolver behavior cause drift and non-reproducible installs.
- BAD:
npm installafterbun addin a Bun-migrated workspace. - GOOD: use Bun consistently for migrated projects and clean old lockfiles per migration policy.
NEVER run Jest and bun test on the same suite without boundary
- WHY: duplicate test ownership creates inconsistent results and CI noise.
- BAD: keep Jest target unchanged while adding
@nx-bun/nx:testto same files. - GOOD: split test ownership by project/path and decommission old target deliberately.
NEVER skip cache metadata on Bun build/test targets
- WHY: missing outputs/inputs reduces cache hit reliability and slows CI.
- BAD: executor configured with no
outputsand no tuned inputs. - GOOD: declare outputs and reference production/default named inputs as appropriate.
NEVER assume SQLite behavior is identical to Node DB wrappers
- WHY: transaction handling and connection patterns differ across libraries.
- BAD: copy Node pooling assumptions directly into Bun SQLite implementation.
- GOOD: use Bun SQLite patterns validated in reference examples.
NEVER rely on hot reload defaults for production validation
- WHY: hot/watch modes hide startup and lifecycle differences seen in production runs.
- BAD: validate only with
hot: truelocal serve. - GOOD: run non-hot production-oriented build and run validation before release.
Gotchas
Bun.spawnis async and returns a handle; choose stdout/stderr piping explicitly.- Migration can leave stale lockfiles; remove obsolete lockfiles as part of a controlled cutover.
- Nx daemon/cache can mask executor changes; use
nx resetafter plugin updates.
References
| Topic | Reference |
|---|---|
| Bun runtime APIs, SQLite, and WebSockets | references/bun-runtime-api.md |
| Nx executor and caching configuration | references/nx-executor-configuration.md |
| Node.js to Bun migration checklist | references/migration-from-node.md |
| Bun testing in Nx | references/testing-with-bun.md |
What ships with it: 10 files
16.9 KB alongside SKILL.md
.tessl-plugin/
- plugin.json412 B
evals/
- scenario-01.md3.0 KB
- scenario-02.md2.0 KB
- scenario-03.md3.1 KB
- scenario-04.md3.1 KB
references/
- bun-runtime-api.md1.4 KB
- migration-from-node.md1.0 KB
- nx-executor-configuration.md1.5 KB
- testing-with-bun.md934 B
- CHANGELOG.md374 B