Repository navigation
Make the built-in plugins with settings sections forkable - #4190
Merged
Merged
Conversation
SawyerHood
force-pushed
the
bb/forkable-09-settings
branch
2 times, most recently
from
September 23, 2026 17:53
b564e3f to
bda3522
Compare
SawyerHood
force-pushed
the
bb/forkable-09-settings
branch
from
September 23, 2026 20:40
bda3522 to
aee575c
Compare
SawyerHood
marked this pull request as ready for review
September 23, 2026 21:07
keep-awake, concurrency-limit, memory, provider-usage, and account-pool imported shared-ui components by workspace package, so a copy could not install them: - They import components through the registry alias (`@/components/ui/*`, `@/lib/utils`), and their tsconfigs map it the way thread-list does. keep-awake, concurrency-limit, and account-pool also mapped `@get-bb/plugin-sdk` onto its bundled .d.ts files. Vitest applies tsconfig paths at runtime and loaded those stubs, so the mappings are gone; the SDK's package exports name the same files for tsc. - usage-format was shared-ui code that only provider-usage used. It moves into the plugin and leaves shared-ui's exports. - provider-usage's story imported the app's Ladle StoryCard and read two provider logos from sibling plugins. It lays out its own rows and inlines the logos now. Ladle stays the only thing that knows about the app: its Vite config resolves forkable plugins' `@/` imports the way the app's vitest config does. Each plugin declares what its tests load, including the SDK harness peers. account-pool declares tsx, which its HTTP/1.1 negotiation test uses to run the transport in a child process with NODE_EXTRA_CA_CERTS. account-pool's server tests read BB_ACCOUNT_POOL_PARENT_URL and BB_ACCOUNT_POOL_PARENT_TOKEN from the environment. Turbo strips them, but `npm test` in a copy inside a pool-routed bb thread saw a parent pool and failed 130 tests; the suite now unsets both. Each plugin gets a lint script and turbo typecheck and test entries with the registry flavors as inputs, and joins the forkable list. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SawyerHood
force-pushed
the
bb/forkable-09-settings
branch
from
September 23, 2026 22:10
aee575c to
4393503
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 23, 2026
## Human comments ## What was wrong Ninth PR in the forkable built-ins stack; it builds on #4190. Four nav-panel built-ins couldn't be copied out of the repository: workflows, github, docs (plugin id `simple-notes`), and theme-preview. Beyond the shared-ui imports and `vitest.shared.ts`: - **Undeclared test dependencies:** github didn't declare `jsdom`, so in a copy every jsdom test worker died with "Failed to start forks worker". - **Tests that reach outside the plugin:** - workflows had a test that scanned the whole repository. - theme-preview's `fixture-anatomy` tests read `apps/app/src` files, which are assertions about host source. - **SDK paths in tsconfig:** workflows and theme-preview mapped the SDK onto bundled `.d.ts` files. - **Lint:** theme-preview had 187 code comments and had never been formatted. ## What changed - **Theme Preview cleanup (first commit):** the comment autofix and oxfmt only, so the second commit stays readable. `server.js` is byte-identical after it. - **Forkable conversion (second commit):** - UI imports go through the registry alias with thread-list's tsconfig paths, and github's local `@/components` alias becomes relative imports. - Each plugin uses `defineConfig`, declares its test dependencies, and gets lint and turbo entries. The lint script surfaced two effect dependency lists in docs' editor that deliberately leave out values, now marked for the linter. - **Tests:** - workflows' removed-command test scans only the plugin. The repository-wide half moves to `packages/scripts/test/workflows-removed-command.test.ts`. - theme-preview's anatomy tests move to `apps/app/src/components/plugin/theme-preview-fixture-anatomy.test.ts`, next to the files they read. They still check that every mock view has a source contract, and `@bb/app#test` takes `plugins/theme-preview/taxonomy.ts` as an input so a change to the view list reruns them. - **Tooling:** - `apps/cli`'s official-bundle tests anchor the copied plugin's tsconfig paths. - `apps/app/.ladle` resolves the plugins' `@/` imports. ## How you verified - `pnpm exec turbo run typecheck test lint` for the four plugins (theme-preview's anatomy tests now run in `@bb/app`). - `pnpm check:plugin-forks`: all four pass in a copy. - `@bb/app` and `@bb/cli` typecheck, the moved anatomy test, and the CLI official-bundle tests; `@bb/scripts` and `@bb/plugin-api-map`. - **Removed-command scan:** appending `bb workflows catalog` to `packages/templates/src/templates/bb-guide-plugins.md` fails the new `@bb/scripts` test, while the plugin's own scan still passes. - **Turbo input:** without the new input, `turbo --dry=json` reported the same `@bb/app#test` hash after a change to `taxonomy.ts`; with it, the hash changes. - **Bundle identity:** - `app.js` differs only in module order, the registry icon (the same host component), and theme-preview JSX text that oxfmt split around `{" "}`, which renders the same text. - theme-preview's `app.css` loses four utilities that Tailwind picked up from deleted comments and anchor strings; no element uses them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Eighth PR in the forkable built-ins stack; it builds on #4189. Five built-ins that contribute Settings sections couldn't be copied out of the repository: keep-awake, concurrency-limit, memory, provider-usage, and account-pool.
Beyond the shared-ui imports and
vitest.shared.ts:@get-bb/plugin-sdkonto its bundled.d.tsfiles, which vitest loads as the SDK once it follows tsconfig paths.@bb/shared-ui/lib/usage-format, which only it used. Its story imported the app's Ladle story card and read logo files from other plugins.BB_ACCOUNT_POOL_PARENT_URL/_TOKENfrom the shell, which turbo strips but a copy'snpm testdoesn't. They also rantsxwithout declaring it.What changed
defineConfigwith tsconfig paths, and each plugin declares its test peers.usage-format.tsmoves into the plugin, and its shared-ui export is deleted.apps/app/.ladleapplies the forkable-plugin path mapping, so Ladle resolves the plugin's@/imports the way the app's vitest config does.tsx.How you verified
pnpm exec turbo run typecheck test lintfor the five plugins.pnpm check:plugin-forks: all five pass in a copy. This run had the pool env vars set, which is what surfaced the test-environment leak.@bb/appand@bb/servertypecheck;@bb/scripts,@bb/plugin-api-map, and@bb/shared-ui;prepare:bundledfor the five.app.js,app.css, andhost.js. provider-usage's and account-pool'sapp.jsdiffer from the base only in module paths and the registry icon (the same host component).🤖 Generated with Claude Code