Repository navigation
test(plugin-subcommands-advanced): load the build on a framework without runPreconditions - #284
Merged
Merged
Conversation
…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.
|
Note The title starts with
|
Contributor
There was a problem hiding this comment.
✅ 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.tsbuildsindexandregisterwithtsdown, then loads them in a child Node process. Module hooks serve@wolfstar/http-frameworkwithoutrunPreconditions. Makingwiring.tsimport and userunPreconditionsby name fails it withdoes 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
runPreconditionsmocked toundefined, a modular subcommand with a denyingpreconditionsoption 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.
claude-sonnet-5-5 | 𝕏
3 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🔗 Linked issue
Related to #268, follows up on a review comment on #282.
🧭 Context
#282 reads
runPreconditionsfrom 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.tscovers both sides:indexandregisterwithtsdown, since the CI unit job runs without a build, and imports them in a Node process. Module hooks serve@wolfstar/http-frameworkthere with every export exceptrunPreconditions, so a named import fails to link the same way it would on an older framework.runPreconditionsmocked away. The subcommand runs and itspreconditionsoption is ignored, as on a framework without the option.The build test fails with
does not provide an export named 'runPreconditions'whenwiring.tsimports the function by name.Key changes
tests/older-framework.test.ts, plus the loader and hook fixtures intests/fixtures/.Type of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.

Confidence 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