Skip to content

Rename option()defineOption() and createPlugin()definePlugin() #48

Description

@aryasaatvik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions