Skip to content

fix(plugin-gateway): export the documented ./rest and ./ws subpaths - #129

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
claude/issue-121-subpath-exports
Sep 26, 2026
Merged

kodiakhq[bot] merged 2 commits into
mainfrom
claude/issue-121-subpath-exports

Conversation

@RedStar071

Copy link
Copy Markdown
Member

🔗 Linked issue

Part of #121 (item 4: README documents subpaths that are not exported).

🧭 Context

The README's "Subpath exports" section lists @wolfstar/plugin-gateway/rest (for @discordjs/rest) and @wolfstar/plugin-gateway/ws (for @discordjs/ws). package.json#exports didn't define either, so importing them failed with ERR_PACKAGE_PATH_NOT_EXPORTED.

📚 Description

This adds the two documented subpaths, keeping the README as it is. Each re-exports its package, the way @discordjs/next does; both packages are already runtime dependencies of the gateway. Each subpath is built as its own entrypoint and checked by attw.

  • export * loses nothing, because neither package has a default export.
  • Both packages export version, but each one lives in its own entrypoint, so the names don't clash.

Key changes

  • src/rest.ts / src/ws.ts: export * from "@discordjs/rest" / "@discordjs/ws".
  • package.json#exports: ./rest and ./ws, in the same shape as "." and ./register.
  • tsdown.config.ts: new entry files and attwEntrypoints: [".", "./register", "./rest", "./ws"].
  • tests/subpaths.test.ts: checks the exports entries, and that every export of @discordjs/rest / @discordjs/ws is re-exported as the same reference (same key set, each value toBe).
  • Changeset: @wolfstar/plugin-gateway patch.

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 (43 files, 463 tests after merging main)
  • I have updated the documentation accordingly (the README already documents these subpaths)
  • I added a changeset with pnpm changeset

Also checked: pnpm lint, pnpm typecheck, and the gateway build (attw and publint clean on ., ./register, ./rest, ./ws). After building, await import('@wolfstar/plugin-gateway/rest' | '/ws' | '/register') resolves from inside the package; /rest has 20 exports and /ws has 23.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RBWEHLtNzWNykJMPqeqqbB


Generated by Claude Code

The README lists `@wolfstar/plugin-gateway/rest` and `@wolfstar/plugin-gateway/ws`, re-exporting
`@discordjs/rest` and `@discordjs/ws` like `@discordjs/next` does, but `package.json#exports`
only had `.`, so importing either failed with `ERR_PACKAGE_PATH_NOT_EXPORTED`.

Both are now built as their own entrypoints and checked by attw. A test asserts the exports
entries and that every export of the original packages is re-exported as the same reference.

Refs #121

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RBWEHLtNzWNykJMPqeqqbB
# Conflicts:
#	packages/plugin-gateway/package.json
#	packages/plugin-gateway/tsdown.config.ts
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

◈ PR Lens

🟢 +0 new · 🟠 ~2 changed · 🔴 -0 removed · 0 flows · 20 files · commit a5af641


Architecture

Architecture diagram for wolfstar-project/plugins at a5af641

2 components touched across 5 lanes.

Play the interactive walkthrough


Data flow

No data-flow sequence changed in this PR.


View

  • Architecture lens
  • Data flow lens
  • Expand every detail

Tip

Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."

🪧 More tips
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Untick Architecture lens or Data flow lens under View to hide a diagram, or tick Expand every detail to open every section. The comment redraws in a few seconds
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • Push a commit and the drawing stays, with a note that it is out of date. Tick Redraw in the note to draw the new head
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion

Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

@wolfstarbot wolfstarbot added the packages:plugin-gateway Changes in plugin-gateway label Sep 26, 2026

@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

Reviewed the full diff adding the ./rest and ./ws subpaths to @wolfstar/plugin-gateway.

  • src/rest.ts / src/ws.ts: new two-line entrypoints re-exporting @discordjs/rest / @discordjs/ws in full (export *).
  • package.json#exports: adds ./rest and ./ws in the same { import: { types, default } } shape as the existing . and ./register entries.
  • tsdown.config.ts: adds both new files to entry and attwEntrypoints so they get built and type-checked.
  • tests/subpaths.test.ts: asserts the exports map shape per subpath, and that every export of the upstream package is re-exported as the identical reference.
  • Changeset: patch bump for @wolfstar/plugin-gateway, in the same style as the prior register-entrypoints.md changeset.

I confirmed independently that neither @discordjs/rest nor @discordjs/ws has a default export (checked their built .d.ts), so export * genuinely loses nothing, and that both are already runtime dependencies of the package — no new dependency introduced. RFC #121 item 4 scopes this fix to plugin-gateway only, so leaving plugin-cache/plugin-sharder untouched is correct rather than an oversight. The new subpaths precisely mirror the package's existing ./register convention (exports shape, tsdown config, changeset style, comment style). Mechanical, well-tested, no concerns.

Pullfrog  | View workflow run | Using Claude Sonnet | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages:plugin-gateway Changes in plugin-gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants