Skip to content

Publish the shared-ui components built-in plugins use as registry items - #4179

Merged
SawyerHood merged 1 commit into
bb/forkable-01-fork-checkfrom
bb/forkable-02-registry-items
Sep 23, 2026
Merged

SawyerHood merged 1 commit into
bb/forkable-01-fork-checkfrom
bb/forkable-02-registry-items

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Second PR in the forkable built-ins stack; it builds on #4178. Built-in plugins import nine shared-ui components that the component registry doesn't provide, so a fork can't write them into its copy:

  • activity-row-styles
  • branch-picker-primitives
  • coarse-pointer-visibility
  • delayed-loading
  • option-display
  • plugin-icon
  • resource-list
  • resource-pagination
  • workflow-progress

The app uses each of them too, so they belong in the registry rather than in plugin copies.

The generator had a second problem: it flattened every components/ui file to components/ui/<basename> and named the item after the bare basename. resource-list re-exports seven files under components/ui/resource/. Flattened, their relative imports broke, and they would have been published as items named row, toolbar, and atoms.

What changed

  • registry.json lists the nine components. Their import closures add resource-route-label and the seven resource-* files.
  • build-registry.mjs keeps a component's subdirectory in its target, so components/ui/resource/row.tsx stays at that path. The item name carries the directory: resource-row, resource-toolbar, and so on. No existing item changes.

How you verified

  • vendor-all-items.test.ts vendors every item into one plugin and runs bb plugin build. With the old flattened targets it fails (Could not resolve "./resource/atoms"); with this change it passes.
  • pnpm exec turbo run typecheck test --filter=@bb/plugin-registry, which includes build-registry.mjs --check.
  • The plugin-forks.test.mjs suite passes against the new items.

🤖 Generated with Claude Code

AGENT GENERATED

@SawyerHood
SawyerHood added this pull request to stack #4182 September 23, 2026 16:34
@SawyerHood
SawyerHood force-pushed the bb/forkable-02-registry-items branch from 84b94c2 to c2d91cd Compare September 23, 2026 16:36
@SawyerHood
SawyerHood force-pushed the bb/forkable-02-registry-items branch from c2d91cd to 859b6de Compare September 23, 2026 16:47
@SawyerHood
SawyerHood force-pushed the bb/forkable-02-registry-items branch 2 times, most recently from f11056c to e646268 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
Built-in plugins import nine shared-ui components that the component
registry does not provide, so a copy of any of them cannot write the
component into itself: activity-row-styles, branch-picker-primitives,
coarse-pointer-visibility, delayed-loading, option-display, plugin-icon,
resource-list, resource-pagination, and workflow-progress. The app uses
each of them too, so they become registry items rather than plugin
copies.

resource-list re-exports seven files under components/ui/resource/. The
registry generator flattened every components/ui file into
components/ui/<basename>, which broke their relative imports, and named
the items after the bare basename (`row`, `toolbar`). Files in a
subdirectory now keep their path, and their item names carry the
directory: resource-row, resource-toolbar, and so on. No existing item
changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@SawyerHood
SawyerHood force-pushed the bb/forkable-02-registry-items branch from e646268 to d10a8ec Compare September 23, 2026 22:10
@SawyerHood
SawyerHood merged commit c1a52e9 into main Sep 23, 2026
23 of 34 checks passed
@SawyerHood
SawyerHood deleted the bb/forkable-02-registry-items branch September 23, 2026 22:13
SawyerHood added a commit that referenced this pull request Sep 23, 2026
## Human comments

## What was wrong

Third PR in the forkable built-ins stack; it builds on #4179. Seven
built-ins import no workspace package, but a copy of each still failed
`pnpm check:plugin-forks`:

- custom-instructions
- drafts
- environment-personal-workspace
- pdf-preview
- plugin-api-tester
- provider-retry
- push-notifications

The failures:

- **Shared vitest config.** Their `vitest.config.ts` imported the
repository's `vitest.shared.ts`.
- **Missing test peers.** The fork installs with `--legacy-peer-deps`,
so the SDK test harness's optional peers never arrive:
- `createFakePluginHost` loads `better-sqlite3`, `cron-parser`, and
`hono`.
- `renderSlot` needs `@testing-library/dom`. Without it,
`@testing-library/react`'s types lose `waitFor`, `fireEvent`, and every
query on `RenderedSlot`.

## What changed

- **Test config:** each plugin's vitest config uses `defineConfig`, and
each declares the dev dependencies its tests load.
- **Lint scripts:** each plugin gets a `lint` script, so the forkable
import rule runs on it. That surfaced two things:
  - code comments in provider-retry, now removed;
- a deliberate field-level dependency list in pdf-preview's `useMemo`,
now marked for the linter instead of changed.
- **Removed test:** push-notifications' `public-sdk-only.test.ts` is
gone. The lint rule and the fork check enforce the same boundary, and
its assertion that `@bb/plugin-build` is a dev dependency fails in a
copy, which drops it.
- **SDK types:** push-notifications' tsconfig no longer maps
`@get-bb/plugin-sdk` onto the repository's bundled declarations, a path
a copy doesn't have. The package's `types` condition already names them.
- **Cleanup:** drafts drops an unused `@bb/shared-ui` dependency.
- **Turbo:** each plugin's `test` task depends on
`@get-bb/plugin-sdk#build`, because vitest now resolves the SDK's built
entries.
- **List:** all seven go into `scripts/forkable-plugins.json`.

Behavior for users is unchanged; the built-ins' names are unchanged.

## How you verified

- `pnpm exec turbo run typecheck test lint` for the seven plugins,
including push-notifications' typecheck without the path mapping.
- `pnpm check:plugin-forks`: all eight listed plugins install,
typecheck, test, and `bb plugin build` in a copy, including
environment-personal-workspace's host tests, which fail before #4178.

🤖 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