Repository navigation
fix(plugin-gateway,plugin-cache,plugin-sharder): add ./register subpath export - #122
Closed
pullfrog[bot] wants to merge 1 commit into
Closed
pullfrog[bot] wants to merge 1 commit into
pullfrog[bot] wants to merge 1 commit into
Conversation
…th export Add a no-op ./register entrypoint to plugin-gateway, plugin-cache, and plugin-sharder, matching the pattern already used by plugin-api, plugin-i18next, plugin-logger, and plugin-subcommands-advanced. @wolfstar/cli's Stars build transform injects `import "<name>/register"` for every @wolfstar/plugin-* dependency unconditionally, regardless of whether the package declares that subpath. Without it, consuming projects crash at runtime with ERR_PACKAGE_PATH_NOT_EXPORTED. Fixes #121
◈ PR LensNote pullfrog[bot] opened this pull request, so PR Lens left it undrawn. Comment
|
1 task done
6 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.
Summary
Item #1 from the plan on #121 — the blocking bug. Adds a no-op
./registersubpath export to@wolfstar/plugin-gateway,@wolfstar/plugin-cache, and@wolfstar/plugin-sharder, matching the pattern already established byplugin-api,plugin-i18next,plugin-logger, andplugin-subcommands-advanced.@wolfstar/cli's Stars build transform injectsimport "<name>/register"for every dependency matching/^@wolfstar\/plugin-[^/]+$/, unconditionally, regardless of whether the package actually declares that subpath. All three packages here match that name pattern but had noregister.ts/exports["./register"], so any consuming project crashed at runtime withERR_PACKAGE_PATH_NOT_EXPORTED.Changes
For each of
plugin-gateway,plugin-cache, andplugin-sharder:src/register.ts(new) — a doc comment explaining why it's a no-op today (none of these three packages have any@wolfstar/http-frameworkPluginlifecycle hook to register yet), plusimport "./index.js";to exercise the main module's side effects (currently none, but keeps the pattern consistent and future-proof).package.json—sideEffects: false→sideEffects: ["./dist/esm/register.js"], plus an"./register"entry inexports.tsdown.config.ts—entrygains"src/register.ts",attwEntrypointsgains"./register"..changeset/add-register-entrypoints.md—patchbump for all three packages.Not in this PR
Per the plan, this ships as its own PR; the rest of the plan's numbered items (member requests, session persistence,
container.clienttyping, README subpath drift, dropping the@discordjs/structuresdev dependency, peer-range CI guard, synchronous cache reads) are separate follow-ups — #121 should stay open until those land. The durable fix — making the Stars CLI transform only inject the import when./registeris actually declared — lives in@wolfstar/cli, a separate repo, and isn't something this repo's PR can carry; this PR is the immediate unblock.Verification
pnpm --filter @wolfstar/<pkg> buildfor all three packages: build succeeds,attw(are-the-types-wrong) andpublintboth pass clean on the new./registersubpath.npx tsc --noEmit -p packages/<pkg>/tsconfig.jsonpasses for all three.oxlint/oxfmt --checkpass clean on all touched files.plugin-api/plugin-loggerpattern — no defects found.Addresses #121 (item #1 of the plan).
Claude Sonnet| 𝕏