Summary
bb plugin new scaffolds a plugin that cannot import @get-bb/plugin-sdk/testing — the backend test harness the bundled bb-plugin-authoring skill tells plugin authors to test with. The first createFakePluginHost test in a fresh scaffold fails to load with Cannot find package 'cron-parser', pointing at a file inside node_modules with nothing in the guide to explain it.
Versions and environment
- bb 0.40.0, desktop app. Also reproduced from source at
ad79bbb5ec909524f8f281e62d860c588a86f332.
- macOS 15 (Darwin 25.3.0), arm64.
- Node v20.13.1, npm 10.5.2.
Steps to reproduce
bb plugin new probe
cd bb-plugin-probe
npm install --include=dev
npm install --save-dev vitest
cat > server.test.ts <<'TS'
import { it } from "vitest";
import { createFakePluginHost } from "@get-bb/plugin-sdk/testing";
import plugin from "./server";
it("loads", async () => {
const { bb } = createFakePluginHost({ pluginId: "probe" });
await plugin(bb);
});
TS
npx vitest run
Expected vs actual
Actual:
FAIL server.test.ts [ server.test.ts ]
Error: Cannot find package 'cron-parser' imported from
.../bb-plugin-probe/node_modules/@get-bb/plugin-sdk/dist/testing/index.js
Expected: the test runs. The scaffold already ships the harness's other peers, so the intent is clearly that it works.
Evidence
The backend harness imports exactly four npm packages — better-sqlite3, cron-parser, hono, zod:
|
import { CronExpressionParser } from "cron-parser"; |
All four are optional peers of the SDK, so npm installs none of them:
The scaffold declares three of the four and misses cron-parser:
|
"better-sqlite3": "^12.0.0", |
|
hono: "^4.11.9", |
zod is covered because generated server.ts imports it, so it sits in dependencies.
What you ruled out
- Not a stale lockfile:
npm install --include=dev in a brand-new scaffold, twice, on two machines' worth of clean node_modules.
- Not the frontend harness:
@get-bb/plugin-sdk/testing/app needs React, Testing Library and jsdom, and the skill correctly tells the author to add those. Only the backend entry is affected.
- Not a duplicate — searched open and closed issues for
cron-parser, plugin scaffold, plugin new test.
Suggested priority and effort
Hits every plugin author who follows the guide's testing section, which is the guide's own recommended workflow. Workaround is one npm i -D cron-parser once you have decoded the error. Effort: one line plus a regression test.
AGENT GENERATED
Summary
bb plugin newscaffolds a plugin that cannot import@get-bb/plugin-sdk/testing— the backend test harness the bundledbb-plugin-authoringskill tells plugin authors to test with. The firstcreateFakePluginHosttest in a fresh scaffold fails to load withCannot find package 'cron-parser', pointing at a file insidenode_moduleswith nothing in the guide to explain it.Versions and environment
ad79bbb5ec909524f8f281e62d860c588a86f332.Steps to reproduce
Expected vs actual
Actual:
Expected: the test runs. The scaffold already ships the harness's other peers, so the intent is clearly that it works.
Evidence
The backend harness imports exactly four npm packages —
better-sqlite3,cron-parser,hono,zod:bb/packages/plugin-sdk/src/testing/fake-plugin-host.ts
Line 5 in ad79bbb
All four are optional peers of the SDK, so npm installs none of them:
bb/packages/plugin-sdk/package.json
Line 175 in ad79bbb
The scaffold declares three of the four and misses
cron-parser:bb/packages/templates/src/plugin-scaffold.ts
Lines 1912 to 1913 in ad79bbb
zodis covered because generatedserver.tsimports it, so it sits independencies.What you ruled out
npm install --include=devin a brand-new scaffold, twice, on two machines' worth of cleannode_modules.@get-bb/plugin-sdk/testing/appneeds React, Testing Library and jsdom, and the skill correctly tells the author to add those. Only the backend entry is affected.cron-parser,plugin scaffold,plugin new test.Suggested priority and effort
Hits every plugin author who follows the guide's testing section, which is the guide's own recommended workflow. Workaround is one
npm i -D cron-parseronce you have decoded the error. Effort: one line plus a regression test.