Skip to content

test(plugin-subcommands-advanced): load the build on a framework without runPreconditions - #284

Merged
kodiakhq[bot] merged 1 commit into
mainfrom
test/subcommands-older-framework
Nov 13, 2026
Merged

kodiakhq[bot] merged 1 commit into
mainfrom
test/subcommands-older-framework

Conversation

@RedStar071

@RedStar071 RedStar071 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

Related to #268, follows up on a review comment on #282.

🧭 Context

#282 reads runPreconditions from the framework namespace at call time, so the plugin still loads on the framework majors of its peer range that predate 6.3.0 (^3.1.0 || ^5.0.0). The tests ran the sources against framework 6.5.1, where the export exists, so a build change that turned the lookup into a named import would have broken older bots without failing CI.

📚 Description

The new older-framework.test.ts covers both sides:

  • It builds index and register with tsdown, since the CI unit job runs without a build, and imports them in a Node process. Module hooks serve @wolfstar/http-framework there with every export except runPreconditions, so a named import fails to link the same way it would on an older framework.
  • It runs a modular subcommand with runPreconditions mocked away. The subcommand runs and its preconditions option is ignored, as on a framework without the option.

The build test fails with does not provide an export named 'runPreconditions' when wiring.ts imports the function by name.

Key changes

  • tests/older-framework.test.ts, plus the loader and hook fixtures in tests/fixtures/.
  • An empty changeset: this only adds tests.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Workflow / CI change

Pre-flight Checklist

  • I have read the Contributing Guidelines (if applicable)
  • My code follows the code style of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • I added a changeset with pnpm changeset (or pnpm changeset add --empty if no release is needed). See .changeset/README.md.

🤖 AI disclosure: Claude Code was used on this PR. Code written with claude-opus-5-5; PR description written with claude-opus-5-5. AI policy.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were established.

Reviews (1) · Last reviewed commit: "test(plugin-subcommands-advanced): load ..." · Reviewed by Greptile

…out runPreconditions

The delegate reads runPreconditions from the framework namespace so the
plugin still loads on frameworks older than 6.3.0, but the tests only
ran the sources against 6.5.1. Build the entries and import them in a
Node process whose module hooks serve the framework without that
export, and run a modular subcommand with the export missing.
@coldtea-pr-lens

Copy link
Copy Markdown

Note

The title starts with test(plugin-subcommands-advanced):, so PR Lens left this pull request undrawn. Comment @pr-lens draw to draw it

github.comment.notice: false in .github/pr-lens.yml turns this note off

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes: the whole PR, a single test-only commit, checked by running the new test, running pnpm lint, and mutating wiring.ts.

  • Build load test: older-framework.test.ts builds index and register with tsdown, then loads them in a child Node process. Module hooks serve @wolfstar/http-framework without runPreconditions. Making wiring.ts import and use runPreconditions by name fails it with does not provide an export named 'runPreconditions', as the description says. An import that is never used is tree-shaken and would not trip it, which is fine for the regression it guards.
  • Runtime test: with runPreconditions mocked to undefined, a modular subcommand with a denying preconditions option still runs and replies.
  • Fixtures and changeset: the loader and hook fixtures in tests/fixtures/, and an empty changeset, which is correct for a tests-only change.

The tsdown setup matches the existing plugin-opentelemetry/tests/preload.test.ts precedent. Both tests pass locally and pnpm lint reports no errors.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kodiakhq
kodiakhq Bot merged commit 13e92e8 into main Nov 13, 2026
17 checks passed
@kodiakhq
kodiakhq Bot deleted the test/subcommands-older-framework branch November 13, 2026 16:12
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