Repository navigation
Make the nav panel plugins forkable - #4191
Merged
Merged
Conversation
SawyerHood
force-pushed
the
bb/forkable-10-nav-panels
branch
from
September 23, 2026 17:50
f3ef877 to
80ca7f6
Compare
SawyerHood
force-pushed
the
bb/forkable-10-nav-panels
branch
from
September 23, 2026 17:53
80ca7f6 to
116c02b
Compare
SawyerHood
force-pushed
the
bb/forkable-10-nav-panels
branch
from
September 23, 2026 20:40
116c02b to
11ba4c9
Compare
SawyerHood
marked this pull request as ready for review
September 23, 2026 21:07
Theme Preview was the only plugin in its group with code comments and
unformatted source. Making it forkable gives it a lint script, which runs
the repository's bb/no-comments rule, so this commit removes the
comments with that rule's autofix and formats the files it touched with
oxfmt, before the forkability change, which then reads as its own diff.
Nothing else changes. The built server bundle is byte-identical. The
app bundle differs only where oxfmt moved spaces at JSX line breaks into
{" "} children, which render the same text, and its CSS drops a `static`
utility that Tailwind had generated from a word in a removed test
comment; no element uses it.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
workflows, github, docs, and theme-preview could not be copied out of the monorepo and built on their own: - They imported @bb/shared-ui by package name. Their components now come through the registry alias (@/components/ui/*, @/lib/*), which their tsconfigs map onto packages/shared-ui/src and the registry's host-backed icon, as thread-list does. github's own @/components alias becomes relative imports. workflows and theme-preview drop their tsconfig paths onto the SDK's bundled types: the package's types condition resolves the same files, and vitest, which now follows tsconfig paths, would otherwise load the declaration files at runtime. - Their vitest configs imported the repository's vitest.shared.ts. Each now uses defineConfig directly. - Their tests loaded packages they did not declare. In a copy, github's jsdom test files failed with "Failed to start forks worker" because jsdom came from the workspace. Each plugin now declares the SDK test harness peers its tests load. - workflows' documentation test scanned the whole repository for a removed command. It now scans the plugin, and a @bb/scripts test keeps scanning the rest of the repository. theme-preview's fixture-anatomy test read apps/app source files that a copy does not have. Those assertions move to an apps/app test, which loads the plugin's view list so every mock view stays covered; the app's test task takes the plugin's taxonomy as an input. Each plugin gets a lint script so the forkable import rule runs on it. That surfaced two effect dependency lists in docs' editor that deliberately leave out values, now marked for the linter. Ladle's Vite config applies the forkable plugin paths, so the workflows stories keep resolving the registry alias. The CLI's official-bundle tests build github and docs from a copy in a temporary directory, so they now anchor the copy's tsconfig paths at the repository. Their turbo tasks take the registry flavors as inputs, and their test tasks depend on the SDK build, because vitest resolves the SDK's built entries. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SawyerHood
force-pushed
the
bb/forkable-10-nav-panels
branch
from
September 23, 2026 22:10
11ba4c9 to
62352a2
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 23, 2026
## Human comments ## What was wrong Tenth PR in the forkable built-ins stack; it builds on #4191. bb Tasks is the biggest shared-ui-only built-in: about 110 files and 34k lines. A copy couldn't install or run its tests: - 17 `@bb/shared-ui` imports. - A test that counted SQL statements through bb's own database connection (`packages/db`). - `vitest.shared.ts`. - A tsconfig that included only a few entry points. Vite applies tsconfig paths only to included files, so every view test in a copy failed to resolve `@/`. ## What changed - UI imports go through the registry alias. - The SQL-count test runs on the SDK harness's plugin database with the same `prepare()` wrapper, so it proves the same statement counts and index plan. - `defineConfig` keeps the tippy alias, setup file, timeout, and inlined dependency. - The tsconfig includes every file, which brings the tests under tsc; their RPC handlers read `unknown` input through a plugin-local helper. - Test peers are declared. - Lint: two comments removed, two lists memoized, and one deliberate effect marked for the linter. - The `@bb/scripts` test that checks the lint rule ignores unlisted plugins used tasks as its example; it now uses a name that isn't in the repository. Dropping `sharedWorkerProjects` did not slow the suite. Under load it ran in 7.9–9.0s, down from 10.3–11.8s at the base, because the SDK now resolves to its built entries and the icon no longer pulls in shared-ui's glyph map. ## How you verified - `pnpm exec turbo run typecheck test lint --filter=bb-plugin-tasks`. - `pnpm check:plugin-forks plugins/tasks` passes in a copy. - `@bb/app` typecheck; `@bb/scripts` and `@bb/plugin-api-map` tests. - **Bundle identity:** `app.css` and `server.js` are byte-identical. `app.js` differs only in where the icon shim sits, the registry icon (the same host component), and the two memoized lists. 🤖 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
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:jsdom, so in a copy every jsdom test worker died with "Failed to start forks worker".fixture-anatomytests readapps/app/srcfiles, which are assertions about host source..d.tsfiles.What changed
server.jsis byte-identical after it.@/componentsalias becomes relative imports.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.packages/scripts/test/workflows-removed-command.test.ts.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#testtakesplugins/theme-preview/taxonomy.tsas an input so a change to the view list reruns them.apps/cli's official-bundle tests anchor the copied plugin's tsconfig paths.apps/app/.ladleresolves the plugins'@/imports.How you verified
pnpm exec turbo run typecheck test lintfor the four plugins (theme-preview's anatomy tests now run in@bb/app).pnpm check:plugin-forks: all four pass in a copy.@bb/appand@bb/clitypecheck, the moved anatomy test, and the CLI official-bundle tests;@bb/scriptsand@bb/plugin-api-map.bb workflows catalogtopackages/templates/src/templates/bb-guide-plugins.mdfails the new@bb/scriptstest, while the plugin's own scan still passes.turbo --dry=jsonreported the same@bb/app#testhash after a change totaxonomy.ts; with it, the hash changes.app.jsdiffers 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.app.cssloses four utilities that Tailwind picked up from deleted comments and anchor strings; no element uses them.🤖 Generated with Claude Code