# preload these modules before running bun. # # Order matters: # 1. env plugin auto-loads `.env` and decrypts dotenvx-style encrypted # values (stacksjs/stacks#1053) so the rest of the boot chain — config # loader, preloader, user routes — reads plaintext from process.env. # 2. main preloader wires auto-imports + framework plugins; safe to run # after the env layer because it can now read decrypted secrets too. preload = [ "./storage/framework/core/env/plugin.ts", "./storage/framework/defaults/resources/plugins/preloader.ts", ] [test] # Look for tests where the tests are. # # Without this, `bun test` walks the whole project looking for test files - # `pantry/` included, which is a package tree of hundreds of thousands of # files. It follows the symlinks it finds there, and once a few hundred are # open the process is out of file descriptors: the next `spawn` fails `EBADF`, # and every test that shells out to a binary fails with it, in code nobody # touched. Reproduced down to one directory of 800 symlinks anywhere under the # project root, imported by nothing. # # `bun run` was never affected - it resolves modules rather than scanning for # files - which is why an application works while its suite does not. # # This matches what `buddy test` already runs (`bun test ./tests/feature/** # ./tests/unit/**`). A package under `storage/framework/core/*` with tests of # its own carries its own bunfig and is unaffected. root = "tests" # Tests also get the env layer so encrypted .env values resolve during the # suite — match production boot semantics rather than papering over a # different decrypt path in test-only code. preload = [ "./storage/framework/core/env/plugin.ts", "./tests/setup.ts", ] coverage = false [run] # equivalent to `bun --bun` for all `bun run` commands bun = true [serve.static] plugins = [ "bun-plugin-stx" ] [install] registry = { url = "https://registry.npmjs.org/", token = "$BUN_AUTH_TOKEN" } linker = "hoisted"