Skip to content

refactor: unwrap ConfigPlugin namespace to flat exports + self-reexport#22876

Merged
kitlangton merged 1 commit intodevfrom
kit/self-reexport-config-plugin
Apr 16, 2026
Merged

refactor: unwrap ConfigPlugin namespace to flat exports + self-reexport#22876
kitlangton merged 1 commit intodevfrom
kit/self-reexport-config-plugin

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Unwrap the ConfigPlugin namespace in src/config/plugin.ts to flat top-level exports.
  • Add a self-reexport (export * as ConfigPlugin from "./plugin") so existing import { ConfigPlugin } from "@/config/plugin" consumers keep the same ConfigPlugin.Spec, ConfigPlugin.pluginSpecifier, etc. ergonomics.

Why

  • export namespace compiles to an IIFE that blocks bundler tree-shaking and is not supported by Node's native TypeScript stripping.
  • The self-reexport keeps normal ESM shape, so the same ConfigPlugin.foo API stays, but the module is now tree-shakable.

Verification

  • bunx --bun tsgo --noEmit from packages/opencode (only pre-existing unrelated @npmcli/arborist warning).
  • bun run --conditions=browser ./src/index.ts generate — passes (catches circular import regressions).
  • bun run test test/config/config.test.ts — 73 pass.
  • bun run test test/config/tui.test.ts — 23 pass, 3 pre-existing skips.

@kitlangton kitlangton force-pushed the kit/self-reexport-config-plugin branch from e24e992 to bce4ee9 Compare April 16, 2026 20:58
@kitlangton kitlangton merged commit 32548bc into dev Apr 16, 2026
7 of 8 checks passed
@kitlangton kitlangton deleted the kit/self-reexport-config-plugin branch April 16, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant