Skip to content

Make the Plugin Guide plugin forkable - #4194

Merged
SawyerHood merged 1 commit into
bb/forkable-12-bb-guidefrom
bb/forkable-13-plugin-guide
Sep 23, 2026
Merged

SawyerHood merged 1 commit into
bb/forkable-12-bb-guidefrom
bb/forkable-13-plugin-guide

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Twelfth PR in the forkable built-ins stack; it builds on #4193. plugins/plugin-api-docs, the Plugin Guide, was a small shell around @bb/plugin-api-map, a workspace package whose only consumer was this plugin.

Through the map, the plugin also depended on @bb/shared-ui/icon, @bb/shared-ui/switch, and @bb/text-utils. The map imported 31 other plugins' package.json files by relative path, and some of its tests read app source.

What changed

  • The map moves into the plugin: its source, tests, and surface-entry scaffold live under src/, test/, and scripts/, and @bb/plugin-api-map is gone.
    • Icons, the switch, and cn come through the registry aliases.
    • escapeHtmlText is copied in.
  • First-party table: the 31 manifest imports become src/first-party-plugins.json, a table of id, name, and icon. The Guide still uses it for "Used by" links and fallback icons. app.js shrinks by 33 KB because it no longer inlines every first-party package.json.
  • Checks that read files outside the plugin stay in the repository:
    • The anatomy-manifest source anchors are checked by apps/app's docs-anatomy-manifest test, which now reads the manifest from the plugin.
    • The ThreadDetailView tab-order source check moves into that same test.
    • A new @bb/scripts test checks each first-party table row against the plugin's manifest.
  • References: AGENTS.md, the plugin-guide-maintenance skill, the verify-bb recipes, and turbo.json point at the new paths.

How you verified

  • Render comparison: before and after produced 532 map-level entries (14.9 MB) and 66 page-level entries, all identical. They cover SSR and jsdom renders of every slide and card on desktop and mobile, the nav panel at four sub-paths, the clipboard payload, and every server mention resolution.
  • Turbo: pnpm exec turbo run typecheck test lint --filter=bb-plugin-plugin-api-docs, with every moved file's test count unchanged; @bb/scripts (a mutated table row fails the new test); @bb/app typecheck and tests.
  • Fork check: pnpm check:plugin-forks plugins/plugin-api-docs passes in a copy.
  • Bundle: app.css gains 8 unused scoped rules from class names that appear only in test assertions.

🤖 Generated with Claude Code

AGENT GENERATED

@SawyerHood
SawyerHood added this pull request to stack #4182 September 23, 2026 17:22
@SawyerHood
SawyerHood force-pushed the bb/forkable-13-plugin-guide branch 2 times, most recently from 07ba57c to de2af7c Compare September 23, 2026 17:53
@SawyerHood
SawyerHood force-pushed the bb/forkable-13-plugin-guide branch from de2af7c to c745b89 Compare September 23, 2026 20:40
@SawyerHood
SawyerHood marked this pull request as ready for review September 23, 2026 21:07
@SawyerHood
SawyerHood removed this pull request from stack #4182 September 23, 2026 21:40
@SawyerHood
SawyerHood added this pull request to stack #4220 September 23, 2026 21:41
plugins/plugin-api-docs was a small shell around @bb/plugin-api-map, a
workspace package whose only consumer was this plugin. A copy of the
plugin could not install it. Through the map, the plugin also depended
on @bb/shared-ui/icon, @bb/shared-ui/switch, and @bb/text-utils, and
the map imported 31 other plugins' package.json files by relative
path. Its vitest config imported the repository's vitest.shared.ts.

The map's source, tests, and surface-entry scaffold now live in the
plugin under src/, test/, and scripts/, and the package is gone. Icons,
the switch, and cn come through the registry aliases, as they do in
thread-list. escapeHtmlText is copied into the plugin. The first-party
plugin manifests become src/first-party-plugins.json, a 31-row table
of id, display name, and built-in icon. The Guide still uses that table
for Used by links and for fallback icons of plugins that are neither
installed nor in the catalog. The app bundle no longer inlines every
first-party package.json, so it shrinks by 33 KB. test/setup.ts
installs the SDK test runtime, which @/components/ui/icon renders
through. The plugin now has a lint script, its tsconfig covers the
tests, and turbo gives its test task the SDK build and the registry
flavors.

Checks that read files outside the plugin stay in the repository:

- The source anchors in the anatomy manifest were already checked for
  every fixture by apps/app's docs-anatomy-manifest test. That test now
  reads the manifest from the plugin, and the plugin keeps only the
  fixture-label half of its duplicate.
- The check that ThreadDetailView creates the Info tab before the Diff
  tab moves into the same app test. The plugin keeps the check that its
  wireframe draws them in that order.
- A new @bb/scripts test checks each first-party table row against the
  plugin's manifest, so a renamed plugin still fails a test.

AGENTS.md, the plugin-guide-maintenance skill, and the verify-bb recipes
point at the new paths. The scaffold command runs with
--filter=bb-plugin-plugin-api-docs.

A render comparison against the base found no change. It covered every
slide and card, on desktop and mobile in jsdom, the nav panel, the
copied clipboard payload, and every server mention resolution. app.css
gains 8 unused scoped rules from class names that appear only in test
assertions.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@SawyerHood
SawyerHood force-pushed the bb/forkable-13-plugin-guide branch from c745b89 to 8025f78 Compare September 23, 2026 22:10
@SawyerHood
SawyerHood merged commit 11a02ca into main Sep 23, 2026
18 checks passed
@SawyerHood
SawyerHood deleted the bb/forkable-13-plugin-guide branch September 23, 2026 22:13
SawyerHood added a commit that referenced this pull request Sep 23, 2026
## Human comments

## What was wrong

Thirteenth PR in the forkable built-ins stack; it builds on #4194.
`plugins/environment-modal-sandbox` couldn't be copied out of the
repository:

- **Shared UI:** its app imported seven `@bb/shared-ui` modules.
- **Test config:** its vitest config used `vitest.shared.ts`.
- **SDK paths:** its tsconfig mapped `@get-bb/plugin-sdk` and its
testing entry onto the bundled `.d.ts` files. Once vitest follows
tsconfig paths, that loads the declaration files as the SDK at runtime.
- **Test peers:** the SDK test harness's `cron-parser`, `hono`, and
`better-sqlite3` types, and the react-dom types the registry's
responsive overlay needs, were undeclared.

The Worktree and Project checkout plugins stay as they are: they share
host helpers with the daemon through `bb-environment-provider-host`, and
isolating them would mean copying those helpers into each plugin.

## What changed

- **Imports:** button, coarse-pointer-sizing, dropdown-menu, icon,
input, option-display, and `lib/utils` come from the registry through
`@/`, with thread-list's tsconfig paths.
- **Config:** the two SDK path entries are gone; the package's `types`
condition already points tsc at the same files. The vitest config uses
`defineConfig`, and the plugin declares its test peers.
- **Lint and turbo:** the lint script ignores `node_modules` and `dist`
like the other listed plugins, and the turbo tasks take the registry
flavors as inputs and build the SDK before tests.
- **List:** the plugin joins `scripts/forkable-plugins.json`.

## How you verified

- `pnpm exec turbo run typecheck test lint
--filter=bb-plugin-environment-modal-sandbox`.
- `pnpm check:plugin-forks plugins/environment-modal-sandbox` passes in
a copy.
- Whole-repo `turbo run typecheck lint` at the top of the stack.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant