Repository navigation
Make the tasks plugin forkable - #4192
Merged
Merged
Conversation
SawyerHood
force-pushed
the
bb/forkable-11-tasks
branch
3 times, most recently
from
September 23, 2026 20:40
7aa39f6 to
44626b2
Compare
SawyerHood
marked this pull request as ready for review
September 23, 2026 21:07
A copy of plugins/tasks could not install or run its tests: - It imported 17 @bb/shared-ui components and helpers. It now imports them through the registry alias (@/components/ui/button, @/lib/utils, @/components/ui/hooks/use-compact-viewport, ...), which its tsconfig maps onto shared-ui's source and the registry's host-backed icon. - lifecycle/queries.test.ts counted SQL statements through bb's own connection (packages/db/src/connection). It now uses the SDK harness's plugin database and wraps its prepare() the same way, so it still proves one indexed lookup per unrelated thread event, the per-mapping statement counts, and the index plan. - Its vitest config imported the repository's vitest.shared.ts. It now uses defineConfig with resolve.tsconfigPaths and keeps the tippy.js alias, setup file, timeout, and inlined bubble-menu dependency. The tests run with vitest's default isolation instead of the shared-worker projects. - The tsconfig included only a few entry points and two directories. Vite applies tsconfig paths only to files the tsconfig includes, so in a copy every view test failed to resolve @/components/ui/*. The tsconfig now includes every .ts and .tsx file, which also brings the tests under tsc; their loosely typed RPC handlers now take unknown inputs and read them through a plugin-local rpcInput helper. - The SDK harness's optional peers were not declared; the plugin now lists what its tests load. The icon now comes from the SDK's experimental_Icon, so task-activity.test.tsx mocks @get-bb/plugin-sdk/app partially instead of replacing it. The lint script surfaced two code comments, now removed, two useMemo inputs rebuilt every render (feed and folder lists), now memoized, and a deliberate subPath-only effect in the app shell, now marked for the linter. The scripts test that checks the lint rule ignores unlisted plugins used tasks as its example; it now uses a plugin name that is not in the repository. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SawyerHood
force-pushed
the
bb/forkable-11-tasks
branch
from
September 23, 2026 22:10
44626b2 to
b621ad2
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 23, 2026
## Human comments ## What was wrong Eleventh PR in the forkable built-ins stack; it builds on #4192. bb-guide renders the standard introduction bb gives agents with `renderTemplate` from `@bb/templates`, a workspace package a copy can't install. No other code renders that template (`standardAgentAppendInstructions`). The plugin also used `vitest.shared.ts` and didn't declare the SDK harness's peers. ## What changed - **Introduction:** the text moves into the plugin as `introduction.ts`. `packages/templates` drops the template file and its test, and the test moves into the plugin, where it checks the text the plugin contributes. - **Bundle size:** the built `server.js` shrinks from 316 KB to 3 KB, since it no longer bundles Handlebars and every bb template. - **Test config:** `defineConfig`, declared peers, a lint script, and a turbo test entry. ## How you verified - **Agent text unchanged:** the text agents receive is byte-identical. Importing the built `server.js` from before and after with a fake `bb` produced the same instructions, `configure()` result, and settings for introduction on and off (same sha256). - **Turbo:** `pnpm exec turbo run typecheck test lint --filter=bb-plugin-bb-guide --filter=@bb/templates`, and typecheck of `@bb/app`, `@bb/server`, `@bb/sdk`, `@bb/cli`, and `@bb/integration-tests`. - **Tests:** `@bb/cli` tests (including `bb-cli-skill-coverage`) and the integration smoke `lifecycle.test.ts`, which loads the built-in bb-guide and checks the instructions. - **Fork check:** `pnpm check:plugin-forks plugins/bb-guide` passes in a copy. 🤖 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
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:
@bb/shared-uiimports.packages/db).vitest.shared.ts.@/.What changed
prepare()wrapper, so it proves the same statement counts and index plan.defineConfigkeeps the tippy alias, setup file, timeout, and inlined dependency.unknowninput through a plugin-local helper.@bb/scriptstest 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
sharedWorkerProjectsdid 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/taskspasses in a copy.@bb/apptypecheck;@bb/scriptsand@bb/plugin-api-maptests.app.cssandserver.jsare byte-identical.app.jsdiffers only in where the icon shim sits, the registry icon (the same host component), and the two memoized lists.🤖 Generated with Claude Code