Skip to content

[Refactor] Use declarative map in calculateLocalChecksums - #8613

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

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

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

calculateLocalChecksums builds its result by declaring an empty array, iterating the theme file system with forEach, and pushing one object per entry. The accumulator and the push obscure what the function actually does, which is a straightforward one-to-one transformation of file system entries into checksum records.

WHAT is this pull request doing?

Rewrites calculateLocalChecksums in packages/theme/src/cli/utilities/theme-uploader.ts to map directly over the file system entries instead of accumulating into a local array.

Behavior is unchanged. Array.from(map.entries()).map(...) visits entries in the same insertion order as Map.prototype.forEach, and the size expression is carried over verbatim. The comment explaining the text-versus-binary size calculation stays attached to that line.

How to manually test your changes?

pnpm shopify theme push

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

Replace the forEach-and-push accumulation with a direct map over the
theme file system entries. Behavior is unchanged: Map iteration order is
preserved and the size computation is identical.

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