Skip to content

refactor: shared plugin command runner in @chkit/core#175

Open
KeKs0r wants to merge 1 commit into
mainfrom
complexity-improvements
Open

refactor: shared plugin command runner in @chkit/core#175
KeKs0r wants to merge 1 commit into
mainfrom
complexity-improvements

Conversation

@KeKs0r

@KeKs0r KeKs0r commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Add createPluginRunner and withFactoryDefaults to @chkit/core — the error-to-exit-code run wrapper and registration-options layering that the backfill, codegen, and pull plugins each carried as private copies.
  • Rewire all 9 plugin commands (7 backfill, 1 codegen, 1 pull) to the shared runner; per-command scaffold shrinks from ~10 lines to ~4 and the error envelope (exit 2 for config errors, 1 otherwise, json/text failure output) now exists exactly once.
  • No behavior change. Removes the ~350-line cross-plugin structural clone flagged by fallow; repo duplication drops from 5.09% to 2.37%.
  • Changeset: patch bumps for @chkit/core and the three plugins, since the plugins now require the matching core version.

Test plan

  • bun verify (typecheck, lint, test, build — 37/37 tasks) including live-ClickHouse e2e for backfill, pull, and the CLI plugin-dispatch/usage-error suites
  • fallow dupes re-run confirms the cross-plugin clone family is gone

Add createPluginRunner and withFactoryDefaults to @chkit/core and use
them in the backfill, codegen, and pull plugins, replacing the
wrapPluginRun wiring repeated on all 9 commands and the byte-identical
withFactoryDefaults/isRecord copies in each plugin. No behavior change.

Removes the ~350-line cross-plugin structural clone flagged by fallow;
duplication drops from 5.09% to 2.37%.
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