-
Notifications
You must be signed in to change notification settings - Fork 16
F/fix locale segment #933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
F/fix locale segment #933
Conversation
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
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
ErnestM1234
approved these changes
Jan 7, 2026
Merged
brian-lou
pushed a commit
that referenced
this pull request
Jan 7, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Patch Changes - [#933](#933) [`a9aae8c`](a9aae8c) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Fixing handling of [locale] placeholder in blob patterns ## [email protected] ### Patch Changes - Updated dependencies \[[`a9aae8c`](a9aae8c)]: - [email protected] <!-- greptile_comment --> <h3>Greptile Summary</h3> Automated Changesets release PR that publishes `[email protected]` and `[email protected]` to npm. - **gtx-cli v2.5.43**: Patch release containing the fix for `[locale]` placeholder handling in glob patterns (from PR #933) - **locadex v1.0.71**: Dependency update release tracking the new gtx-cli version - Standard release automation: changeset consumed, changelogs updated, versions bumped <details open><summary><h3>Confidence Score: 5/5</h3></summary> - Standard automated release PR with no code changes - safe to merge - This is an automated Changesets release PR containing only version bumps and changelog updates. All actual code changes were reviewed and merged in PR #933. No manual modifications or code logic to review. - No files require special attention </details> <details><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | .changeset/six-plants-relax.md | Standard changeset file deletion - consumed by Changesets release action to generate changelog entries | | packages/cli/CHANGELOG.md | Auto-generated changelog entry for gtx-cli v2.5.43, documenting the locale placeholder fix from PR #933 | | packages/cli/package.json | Version bump from 2.5.42 to 2.5.43 for gtx-cli package | | packages/locadex/CHANGELOG.md | Auto-generated changelog entry for locadex v1.0.71, noting dependency update to [email protected] | | packages/locadex/package.json | Version bump from 1.0.70 to 1.0.71 for locadex package (dependency update release) | </details> </details> <details><summary><h3>Sequence Diagram</h3></summary> ```mermaid sequenceDiagram participant Dev as Developer participant GH as GitHub participant CS as Changesets Action participant NPM as npm Registry Dev->>GH: Merge PR #933 (locale fix) with changeset GH->>CS: Trigger Changesets release action CS->>CS: Detect pending changeset CS->>GH: Open release PR #935 Note over CS,GH: - Delete changeset file<br/>- Update CHANGELOGs<br/>- Bump versions Dev->>GH: Review and merge PR #935 GH->>CS: Trigger publish workflow CS->>NPM: Publish [email protected] CS->>NPM: Publish [email protected] ``` </details> <!-- greptile_other_comments_section --> <!-- /greptile_comment --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Greptile Summary
This PR fixes handling of
[locale]placeholders in glob patterns when used with globstar patterns like**/[locale].mdx. The previous implementation failed when the globstar matched intermediate directories because it compared path segments one-to-one, causing a mismatch in segment counts.The fix introduces a new
buildPlaceholderPathFromPatternfunction that:micromatchto generate a regex from the patterndflag) to locate where locale values appear in matched paths[locale]placeholders at the correct positionsChanges include:
[locale]in filename after globstar patternbuildPlaceholderPathFromPattern,toPosixPath, andescapeRegex(unused)Confidence Score: 4/5
escapeRegexfunction that should be removed.escapeRegexfunctionImportant Files Changed
escapeRegexfunctionSequence Diagram
sequenceDiagram participant Client as expandGlobPatterns participant FG as fast-glob participant Build as buildPlaceholderPathFromPattern participant MM as micromatch participant RE as RegExp (with indices) Client->>Client: Replace [locale] with actual locale in pattern Client->>FG: sync(absolutePattern, options) FG-->>Client: Return matched file paths loop For each matched path Client->>Build: buildPlaceholderPathFromPattern(patternPath, absolutePath, "[locale]") Build->>Build: Convert paths to POSIX format Build->>MM: makeRe(posixPattern, {literalBrackets: true}) MM-->>Build: Return base regex Build->>Build: Replace \\[locale\\] with ([^/]+) capture group Build->>RE: Create RegExp with 'd' flag for indices Build->>RE: exec(posixPath) RE-->>Build: Return match with indices array alt Match found with indices Build->>Build: Iterate indices in reverse order Build->>Build: Replace captured locale with [locale] tag Build->>Build: Normalize path back to OS format Build-->>Client: Return placeholder path else No match or no indices Build-->>Client: Return original absolute path end Client->>Client: Add to placeholderPaths array end Client-->>Client: Return {resolvedPaths, placeholderPaths}