Skip to content

refactor(plugin-gateway): move resolvable types to types.ts and helpers to util - #156

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
refactor/gateway-types-util
Sep 28, 2026
Merged

kodiakhq[bot] merged 2 commits into
mainfrom
refactor/gateway-types-util

Conversation

@RedStar071

Copy link
Copy Markdown
Member

🔗 Linked issue

Follow-up to #154.

📚 Description

#154 put the resolvable types, Colors and resolveColor in one util/resolvables.ts. This splits them the way discord.js does: the types move to src/types.ts (its typings/index.d.ts), Colors to util/Colors.ts and resolveColor to util/Util.ts, matching src/util in 14.27.0.

Everything is still exported from the package root, so nothing changes for consumers and the changeset is empty.

Open question: Util.js in discord.js also has parseEmoji and resolvePartialEmoji. We have two copies of that logic (ReactionEmoji.resolvePartial and a private helper in MessagePayload.ts) that behave slightly differently. I left them alone here. They could move into util/Util.ts in a separate PR.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. My AI open-source policy.

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.

Mirrors discord.js's layout: the Resolvable types live in src/types.ts,
Colors in util/Colors.ts and resolveColor in util/Util.ts.
@wolfstarbot wolfstarbot added the packages:plugin-gateway Changes in plugin-gateway label Sep 28, 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

Pure mechanical follow-up to #154, splitting util/resolvables.ts to mirror discord.js's src/typings layout. No behavioral change; the changeset is correctly empty.

  • src/types.ts (new, tracked by git as a rename of util/resolvables.ts): holds every *Resolvable type alias/interface plus ColorResolvable/HexColorString; import paths adjusted from ../ to ./ since the file moved up one directory.
  • src/util/Colors.ts (new): the Colors const object, unchanged.
  • src/util/Util.ts (new): resolveColor, unchanged, importing Colors and the ColorResolvable type from their new locations.
  • src/index.ts: export * from "./util/resolvables.js" replaced with export * from "./util/Colors.js", export * from "./util/Util.js", and export type * from "./types.js" — the public export surface (runtime Colors/resolveColor, everything else type-only) is preserved.
  • tests/util.test.ts: renamed from tests/resolvables.test.ts, imports updated to match.

Verified: repo-wide grep for resolvables turns up zero remaining references, tsc --noEmit -p packages/plugin-gateway/tsconfig.json is clean (after building @wolfstar/plugin-cache so its declarations resolve), and vitest run tests/util.test.ts passes 8/8.

Pullfrog  | View workflow run | Using Claude Sonnet | 𝕏

@kodiakhq
kodiakhq Bot merged commit 0194292 into main Sep 28, 2026
17 of 18 checks passed
@kodiakhq
kodiakhq Bot deleted the refactor/gateway-types-util branch September 28, 2026 17:08
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.

2 participants