Skip to content

Make the Monaco file editor plugin forkable - #4184

Merged
SawyerHood merged 1 commit into
bb/forkable-05-navigationfrom
bb/forkable-06-monaco-editor
Sep 23, 2026
Merged

SawyerHood merged 1 commit into
bb/forkable-05-navigationfrom
bb/forkable-06-monaco-editor

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Sixth PR in the forkable built-ins stack; it builds on #4183. plugins/monaco-editor, the file opener that edits files in Monaco, couldn't be copied out of the repository:

  • It imported cn from @bb/shared-ui/lib/utils.
  • Its vitest config used vitest.shared.ts.
  • Its tests loaded SDK test-harness peers it didn't declare.

pdf-preview, the other file opener, went in #4180.

What changed

  • Registry import: @/lib/utils, the registry's utils item. thread-list's tsconfig paths, and defineConfig with tsconfig paths in vitest. app.test.tsx and server.test.ts join the tsconfig include, so tsc checks them.
  • Declared peers: better-sqlite3, cron-parser, and hono for createFakePluginHost; @testing-library/dom for renderSlot.
  • Lint: the new lint script surfaced code comments in the Monaco build script and bundle entries, now removed. The README keeps the one reason they gave that it didn't already cover: the icon webfont is inlined so the bundle stays three files.

bb plugin build still leaves Monaco out of app.js; a copy installed from a path builds dist/monaco on first open with its own esbuild, the same way a source checkout does.

How you verified

  • pnpm exec turbo run typecheck test lint --filter=bb-plugin-monaco-editor, plus @bb/plugin-api-map and @bb/scripts tests.
  • Fork check: pnpm check:plugin-forks plugins/monaco-editor passes in a copy. In the kept copy, the assets RPC built all three Monaco files byte-identical to the built-in's.
  • Bundle identity:
    • server.js and app.css are byte-identical.
    • prepare:bundled stages Monaco assets (editor.js, editor.css, editor.worker.js) with the same sha256 as before.

🤖 Generated with Claude Code

AGENT GENERATED

@SawyerHood
SawyerHood added this pull request to stack #4182 September 23, 2026 16:40
@SawyerHood
SawyerHood force-pushed the bb/forkable-06-monaco-editor branch from a41620b to 9128393 Compare September 23, 2026 16:47
@SawyerHood
SawyerHood force-pushed the bb/forkable-06-monaco-editor branch 2 times, most recently from c04b540 to 529782e 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
monaco-editor imported cn from @bb/shared-ui/lib/utils, a workspace
package a copy cannot install. It now imports @/lib/utils, the registry's
utils item, through the same tsconfig paths as thread-list, and its
vitest config uses defineConfig with tsconfigPaths instead of the
repository's vitest.shared.ts. app.test.tsx and server.test.ts join the
tsconfig include so tsc checks them. The fork installs without npm's
peer resolution, so the plugin declares the SDK test harness's peers its
tests load: better-sqlite3, cron-parser, and hono for
createFakePluginHost, and @testing-library/dom for renderSlot.

The lint script surfaced code comments in the Monaco build script and
bundle entries, now removed. The README keeps the one reason they gave
that it did not already cover: the icon webfont is inlined so the bundle
stays three files. bb plugin build still leaves Monaco out of app.js; a
copy installed from a path builds dist/monaco on first open with its own
esbuild, the same way a source checkout does.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@SawyerHood
SawyerHood force-pushed the bb/forkable-06-monaco-editor branch from 529782e to 118b46d Compare September 23, 2026 22:10
@SawyerHood
SawyerHood merged commit c9f4395 into main Sep 23, 2026
18 checks passed
@SawyerHood
SawyerHood deleted the bb/forkable-06-monaco-editor branch September 23, 2026 22:13
SawyerHood added a commit that referenced this pull request Sep 23, 2026
## Human comments

## What was wrong

Seventh PR in the forkable built-ins stack; it builds on #4184. Five
chat-surface built-ins couldn't be copied out of the repository:

- side-chat
- inline-vis
- agent-annotations
- scheduled-send
- browser-automation

They imported `@bb/shared-ui` by package name and used
`vitest.shared.ts`. Their tests loaded SDK harness peers they didn't
declare.

## What changed

- **Imports and config:** UI through the registry alias, with
thread-list's tsconfig paths. Test configs use `defineConfig` with
tsconfig paths. Each plugin declares its test peers, and gets a lint
script and turbo entries that depend on the SDK build.
- **browser-automation:**
- Its tsconfig no longer maps the SDK onto its bundled `.d.ts` files,
which vitest would load as the SDK at runtime. The package's `types`
condition already points tsc there.
- Its process test and smoke scripts no longer pass
`--conditions=source`, which pointed at SDK source the published package
doesn't ship.
- **Lint:**
  - scheduled-send's code comments are removed.
- In agent-annotations, a test component that called a hook anonymously
now has a name.
- agent-annotations' submit subscription deliberately depends on
`composer.experimental_onSubmitted` rather than on `composer`, which
changes on every keystroke. The linter directive marks that.

## How you verified

- `pnpm exec turbo run typecheck test lint` for the five plugins.
- `pnpm check:plugin-forks`: all five pass in a copy.
- `@bb/app` typecheck, and `@bb/plugin-api-map` and `@bb/scripts` tests.
- **Bundle identity:** `app.js` differs from the base only in module
order, names, and the plugin's own icon. The icon now comes from the
registry flavor (`experimental_Icon`), which the host binds to the same
shared-ui `Icon`. scheduled-send's `app.js` is byte-identical.
browser-automation's host bundle now includes the SDK's
`experimental_defineHostEntry` instead of plugin-build's fallback stub;
both are the same code.

🤖 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