Skip to content

[Refactor] Build theme role filter with Object.fromEntries - #8904

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor-maintenance-38659679433
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
refactor-maintenance-38659679433

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

The role filter passed to Filter in shopify theme list was built with a reduce whose accumulator was mutated on each iteration. It is a plain key-to-value mapping, so the accumulator adds noise without adding anything.

WHAT is this pull request doing?

Builds the per-role flags in packages/theme/src/cli/services/list.ts with Object.fromEntries over ALLOWED_ROLES and names the result selectedRoles, so the spread into Filter reads as "one boolean per allowed role". The FilterProps import was only needed to type the accumulator and is now dropped. Behavior is unchanged.

How to manually test your changes?

shopify theme list
shopify theme list --role live
shopify theme list --role development --json

Each should list the same themes as before the change.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

0 participants