Repository navigation
Make template traversal deterministic across platforms - #274
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Ensures template traversal/generation order is deterministic across all supported platforms.
The original implementation used
localeCompare, which can yield different ordering on systems with different locales or language settings. The change replaces it with a locale‑independent comparator (</>checks) and adds a comment explaining the rationale. This guarantees that equivalent templates produce a stable processing order, while the output contents remain unchanged.Related Issue
Closes #138
Scope
src/generator/template-generation.tsto sort directory entries with a deterministic comparator.Testing
Ran the full test suite (
npm test/vitest) after the change; all tests passed.Verified that the build, lint, and type‑checking steps succeed.
Tests added/updated where applicable
Existing relevant tests pass
Lint/type/build checks pass where available
Security Impact
Security notes: The change only affects internal file‑system traversal order and does not introduce new dependencies, child processes, or modify any configuration that could affect security.
Release Impact
No published/user-visible behavior change
Patch
Minor
Breaking/pre‑1.0 contract change
Changeset included where required
Changeset not required; reason explained above (pure deterministic sorting tweak, no functional API change)
Release notes: None required – the modification is invisible to end users.
Documentation
Checklist
docs/contributing/wave-architecture.mdfor Stellar Wave work