Repository navigation
Upload a premade game data JSON file as custom data - #678
Merged
Merged
Conversation
Adds a third source to the custom-data dialog alongside SMX edits and ITG packs: pick (or drop anywhere on the page) a single .json file that conforms to the Game Data schema, and it's published as-is to data.ddr.tools like the other custom sets, so synced peers resolve the same bytes. The file is validated client-side first so a bad file shows readable schema errors; only the display name can be changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A file whose `$schema` points at data.ddr.tools/schema/*.json is now checked against that schema, fetched live, instead of the v1 copy this build bundles. That lets premade files written for v2 (required song.id) through the upload form, and lets their published bundles load back. Anything else keeps the bundled schema; the publish Worker still validates on upload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
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.
Adds a third option to the Create Custom Data dialog, next to SMX edits and ITG packs: Upload a premade data file. You can pick a
.jsonfile there or drop one anywhere on the page..jsonfile (by MIME type or extension), the dialog opens straight into the new form. Anything else is still treated as an ITG pack. ThependingPackDropatom is nowpendingDrop, which holds either a pack or a JSON file. The file is read out during the drop event, because the dropped item stops working once the event ends.validateGameData()helper ingame-data.atoms.ts, used by both this form andloadCustomGamedataByUrl.$schemapoints athttps://data.ddr.tools/schema/*.jsonis checked against that schema, fetched live. That way files written for a schema newer than this build, like v2's requiredsong.id, are still accepted. Files with no$schema, a relative path (as stock data uses) or any other host are checked against the bundled v1 copy.loadCustomGamedataByUrlfollows the same rule, so a published v2 bundle loads back. The Worker still validates on upload.yarn validateruns on bundled data: every declared style, difficulty and flag has a translation (and difficulties an$abbr), defaults exist, charts use known styles anddiffClassvalues, folders and draw groups are present, and chart ids are unique. The checks now live insrc/utils/game-data-consistency.ts, shared withscripts/validate.mjs, which imports it through Node's type stripping (validate:types:datasilences Node's typeless-package warning). The jacket-exists check stays script-only. The loader doesn't run these checks, so bundles that are already published can't become unloadable.publishBundlewithsource: { kind: "json", fileName }. Then a config is created and opened, same as the other imports. The only change made to the file is the display name (i18n.en.name), which is pre-filled from the file's own name and falls back to the filename. The Worker needs no changes: it treatssourceas opaque and validates the file again itself..jsonfiles.Caveats
smx/…paths will keep working. Other relative paths point at the app's bundled/jackets/, so they'll break once those move to the CDN in M3.Testing
rgt-dataWorker: droppedshine-2026.json, renamed it and published. The upload went through, the new config opened with that data selected, and the toast appeared.yarn validate:types:datastill passes on all stock data.shine-2026.json(with ids, withoutsaHash/saIndex) that declares$schema: https://data.ddr.tools/schema/v2.jsonwas validated against the live v2 schema, published (201) and loaded back. The same file without a$schemais still rejected against v1.🤖 Generated with Claude Code