test: Add localized text type and associated tests#291
Open
dandwyer wants to merge 1 commit intoRaidTheory:mainfrom
Open
test: Add localized text type and associated tests#291dandwyer wants to merge 1 commit intoRaidTheory:mainfrom
dandwyer wants to merge 1 commit intoRaidTheory:mainfrom
Conversation
dandwyer
commented
Apr 14, 2026
Comment on lines
+32
to
+53
| const LocalizedTextRaw = LocalizedTextCanonical.extend({ | ||
| ko: z.string().optional(), | ||
| "ko-KR": z.string().optional(), | ||
| kr: z.string().optional() | ||
| }).describe("LocalizedTextRaw"); | ||
|
|
||
| export const LocalizedText = LocalizedTextRaw.transform((data) => { | ||
| const { ko, ["ko-KR"]: _koKR, kr, ...rest } = data; | ||
|
|
||
| return { | ||
| ...rest, | ||
| "ko-KR": _koKR ?? ko ?? kr | ||
| }; | ||
| }) | ||
| .pipe(LocalizedTextCanonical.strict()) | ||
| .describe("LocalizedText"); | ||
|
|
||
| // Private data exported for testing purposes only. Not intended for public use. | ||
| export const __internal__ = { | ||
| LocalizedTextCanonical, | ||
| LocalizedTextRaw | ||
| }; |
dandwyer
commented
Apr 14, 2026
Author
There was a problem hiding this comment.
Understood that there is a lot going on in this file, but it should reduce review fatigue to ensure consistency when reviewing PRs associated w/ translations, which appear to be a frequent axis of change.
dandwyer
added a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 15, 2026
github-actions Bot
pushed a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 15, 2026
dandwyer
added a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 15, 2026
dandwyer
added a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 15, 2026
github-actions Bot
pushed a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 16, 2026
dandwyer
added a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 22, 2026
dandwyer
added a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 22, 2026
github-actions Bot
pushed a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 28, 2026
github-actions Bot
pushed a commit
to dandwyer/arcraiders-data
that referenced
this pull request
Apr 29, 2026
github-actions Bot
pushed a commit
to dandwyer/arcraiders-data
that referenced
this pull request
May 1, 2026
github-actions Bot
pushed a commit
to dandwyer/arcraiders-data
that referenced
this pull request
May 4, 2026
github-actions Bot
pushed a commit
to dandwyer/arcraiders-data
that referenced
this pull request
May 7, 2026
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.
@baschny : I deconflated this out of #287, per your request. From your comment there, understood that this may be controversial, but also noting some of the complexity in the schemas is driven by coercing a consistent output data type from inconsistent input data. This means that much of code can be deleted when data in the JSONs is made to match the canonical type.