Repository navigation
Hold uploaded data files to the same consistency checks as yarn validate - #679
Merged
Merged
Conversation
Moves validate.mjs's consistency checks (declared styles, difficulties and flags all translated, defaults that exist, known styles/diffClasses on charts, draw groups, folders, unique chart ids) into a shared src/utils/game-data-consistency.ts. The script imports it directly via Node's type stripping and passes in its jacket-file check; the premade JSON upload form runs the rest after the schema passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
noahm
added a commit
that referenced
this pull request
Oct 26, 2026
Resolves conflicts with #678 and #679: - validate.mjs now delegates to the shared findConsistencyErrors, so the duplicate song id check moves into src/utils/game-data-consistency.ts. - loadCustomGamedataByUrl validates against the schema a bundle declares. Hosted v1 forbids `song.id`, so a bundle declaring a hosted schema is validated as published and upgraded afterwards; one held to the bundled v2 schema is upgraded first, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Follow-up to #678. A premade
.jsonfile uploaded through the custom-data dialog was only checked against the schema. It now also gets the consistency checksyarn validateruns on bundled data:entranslation, and difficulties also have an$abbronediffClassvaluesusesDrawGroupsis setHow
scripts/validate.mjsintosrc/utils/game-data-consistency.ts, with the same logic and messages, so the script and the app can't drift apart. The module has only type imports, so the script loads it directly through Node 24's type stripping..tsfile from the script makes Node print a "Reparsing as ES module" warning, becausepackage.jsonhas no"type".validate:types:datanow runs with--disable-warning=MODULE_TYPELESS_PACKAGE_JSON. Switching to.mtswould have needed webpack and import-path changes.loadCustomGamedataByUrldoesn't run these checks, so a bundle that's already published can't become unloadable.Not covered
The data.ddr.tools Worker still only validates against the schema, so a file published straight to the API without the app skips these checks.
Testing
yarn validate:types:datapasses on all stock data, and the regeneratedSongData.tsis unchanged.shine-2026.jsonwith three mistakes listed all four problems in the dialog, and Publish stayed disabled. The mistakes:challengetranslation (which counts for both the full and the$abbrone)🤖 Generated with Claude Code