Bundle JSON schema#412
Merged
Merged
Conversation
Move JSON schemas from www/public/schemas/ into a dedicated schemas package with modular source files and a bundling step. The build script uses @hyperjump/json-schema to bundle split schema files (with $ref) into self-contained output files. - Add schemas/src/ with modular format and resolver schemas - Add bundle.ts build script and schemas.config.json - Add schemas to pnpm workspace and root build pipeline - Add build:schemas step to CI workflow - Remove previously committed bundled schemas from www/public/ (now generated via build and gitignored)
# Conflicts: # pnpm-lock.yaml
✅ Deploy Preview for designtokensorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced Jun 3, 2026
drwpow
approved these changes
Jun 9, 2026
drwpow
left a comment
Contributor
There was a problem hiding this comment.
This is great, thank you for taking the time to do this! This had dropped off my list, apologies. Appreciate you taking the time.
I like your choices in regard to a new schemas package—that keeps it clean and debuggable. And library seems like a great choice for bundling.
I don’t have any feedback at this stage, let’s just ship this and adjust if anything comes up. This seems like a great foundation to build off of.
| registerSchema, | ||
| type SchemaObject, | ||
| } from '@hyperjump/json-schema/draft-07'; | ||
| import { bundle } from '@hyperjump/json-schema/bundle'; |
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.
Changes
This PR moves JSON schemas from
www/public/schemas/into a dedicatedschemaspackage with modular source files and a bundling step. The build script uses@hyperjump/json-schemato bundle split schema files (with$ref) into self-contained output files.As brought up by @drwpow in this PR discussion schema store expects bundled schemas if the schema is stored somewhere else. I kept the source as separate schemas + a bundling step because I think the schema would be easier to maintain this way, especially once the specification grows more.
Having the schema be a separate package (rather than be part of the
wwwpackage) could have other positive effects. It would be easier to use the schema to test other packages. For example the schema could be used as part of a test in thetechnical-reportspackage to test whether the code snippets inside it are valid design token json. (I would contribute this as a separate PR).As discussed in this PR the bundled schema would not work in VScode right now. But the PR for the
vscode-json-languageservicethat is fixing this issue seems to be close to being merged. We could delay this PR until that one lands in thevscode-json-languageservice.In a followup PR I would add tests for the schemas package. These tests would run the schemas against fixtures using both
ajvandvscode-json-languageservicethat way we can be sure in the future that the JSON schema works properly with VScode.After this PR is merged we could proceed with contributing this schema to schemastore.
How to Review