fix(next-config): make cleanup-interceptors actually work from consumer projects#2621
Merged
Merged
Conversation
Mirrors the API already exposed by CustomerUpdateForm. Lets consumers group dynamic customer attributes into named fieldsets via AttributesFormAutoLayout instead of falling back to the untranslated "Other" bucket when extending the customer schema with extra attributes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ack label The fallback fieldset that catches attributes not claimed by a registered fieldset was rendered as a hardcoded English "Other" string, bypassing project translation catalogs. Wrap in <Trans> so consumers can localize. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nal row is empty When a store doesn't register dob/gender on the registration form, nameFieldset produced `grid-template-areas: "firstname lastname" ""`, which is invalid CSS (empty row, zero columns). Browsers silently fell back to the default single-column layout, so firstname/lastname stacked on separate rows at md+ even though the helper meant to put them side-by-side. Filter empty rows out before joining. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…er projects findDotOriginalFiles walked up the tree looking for a @graphcommerce/* parent package. For a consumer project there is no such parent, so parentPath ended up null and the glob expanded to literally "null/**/*.original.tsx" — the command silently found zero files no matter what was on disk. Fall back to cwd and cwd/node_modules/ @graphcommerce when there is no @graphcommerce parent, so interceptors written into node_modules are actually picked up. Also drop the unused `removedCount` and increment `restoredCount` in its place — the final "X files restored from .original" message was always printing 0 because the wrong counter was being incremented. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 295fe77 The changes in this PR will be included in the next version bump. This PR includes changesets to release 86 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ptors fix - generateInterceptors snapshots: refreshed to match the existing `as typeof X & React.FC<Y>` typing pattern the template emitter has been producing on canary (pre-existing snapshot drift, unrelated to this PR's logic change). - dist/index.js: regenerated via `yarn packages` so the published build output matches the cleanupInterceptors / findDotOriginalFiles source changes in this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Two small bugs in
graphcommerce cleanup-interceptors:findDotOriginalFilesnever found anything from a consumer project. The function walked up the tree looking for a@graphcommerce/*parent package; from a consumer project (where there is no such parent)parentPathended upnulland the glob expanded to literallynull/**/*.original.tsx— silently finding zero files no matter how many interceptors were on disk. Now falls back tocwdandcwd/node_modules/@graphcommercewhen there's no@graphcommerceparent, so interceptors written into the consumer'snode_modulesget picked up.X files restored from .originalalways printed0.restoredCountwas declared but never incremented; the now-removedremovedCountwas the one being incremented. Counter and message are now consistent.Why
Consumer projects use
yarn graphcommerce cleanup-interceptors(often chained beforepatch-packageviayarn create-patch) to getnode_modules/@graphcommerce/*back to canary state before generating a patch. With the oldfindDotOriginalFilesthe script was a no-op in that flow — patches ended up including all the locally-written interceptor wrappers and.originalfiles, polluting the diff with framework-generated state.Test plan
node_modules/@graphcommerce/*contains.original.tsxfiles),yarn graphcommerce cleanup-interceptorsreports the actual count and restores them@graphcommerce/*package, behaviour is unchanged (uses theparentPathwalk)🤖 Generated with Claude Code