Summary
The public API naming is inconsistent: defineCommand, defineConfig, defineGroup follow the define* pattern, but option() and createPlugin() do not. Rename all user-facing declarative APIs to use define* consistently.
Changes
| Old |
New |
option() |
defineOption() |
createPlugin() |
definePlugin() |
createTestPlugin() |
defineTestPlugin() |
Hard break — no deprecation aliases. Bunli is pre-1.0.
Files to modify
Definitions:
packages/core/src/types.ts — rename option() to defineOption()
packages/core/src/plugin/create.ts — rename createPlugin() to definePlugin(), createTestPlugin() to defineTestPlugin()
packages/core/src/plugin/index.ts — update re-exports
packages/core/src/index.ts — update exports
Consumers (~60+ files):
packages/cli/src/commands/ (8 files)
packages/plugin-*/src/ (all plugin packages)
packages/test/test/ and packages/core/test/
examples/ (12 files across 3 example projects)
packages/create-bunli/templates/ (6 template files)
apps/web/ (hardcoded source strings in constants/monaco-setup)
Special care:
packages/plugin-mcp/src/codegen.ts generates code that emits import { option } — must emit defineOption
apps/web/src/api/workbench/constants.ts and apps/web/src/lib/monaco-setup.ts contain hardcoded template strings
Implementation notes
- Purely mechanical rename — no behavior changes
- Do this first to reduce noise in subsequent diffs
- Run
bun build + bun test to verify no missed references
- Update
CLAUDE.md code map references
Summary
The public API naming is inconsistent:
defineCommand,defineConfig,defineGroupfollow thedefine*pattern, butoption()andcreatePlugin()do not. Rename all user-facing declarative APIs to usedefine*consistently.Changes
option()defineOption()createPlugin()definePlugin()createTestPlugin()defineTestPlugin()Hard break — no deprecation aliases. Bunli is pre-1.0.
Files to modify
Definitions:
packages/core/src/types.ts— renameoption()todefineOption()packages/core/src/plugin/create.ts— renamecreatePlugin()todefinePlugin(),createTestPlugin()todefineTestPlugin()packages/core/src/plugin/index.ts— update re-exportspackages/core/src/index.ts— update exportsConsumers (~60+ files):
packages/cli/src/commands/(8 files)packages/plugin-*/src/(all plugin packages)packages/test/test/andpackages/core/test/examples/(12 files across 3 example projects)packages/create-bunli/templates/(6 template files)apps/web/(hardcoded source strings in constants/monaco-setup)Special care:
packages/plugin-mcp/src/codegen.tsgenerates code that emitsimport { option }— must emitdefineOptionapps/web/src/api/workbench/constants.tsandapps/web/src/lib/monaco-setup.tscontain hardcoded template stringsImplementation notes
bun build+bun testto verify no missed referencesCLAUDE.mdcode map references