Open
Conversation
6df3734 to
cd249fc
Compare
Signed-off-by: Safwan Parkar <self@safwanyp.com>
Signed-off-by: Safwan Parkar <self@safwanyp.com>
Signed-off-by: Safwan Parkar <self@safwanyp.com>
Signed-off-by: Safwan Parkar <self@safwanyp.com>
Signed-off-by: Safwan Parkar <self@safwanyp.com>
Signed-off-by: Safwan Parkar <self@safwanyp.com>
cd249fc to
6e5fd1d
Compare
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.
Fixes #98
AI Usage
Used GPT-5.4 and 5.3-Codex during dev. Not sure why but it did not sign off on the commits which is why I'm mentioning it here. I also Kimi 2.5 and Opus 4.6 for interrogating over my thoughts - they were not used for wiritng code.
Testing
The docs in the repo seem out of date. I do not have enough context to confidently update them even with AI assistance, which is why I ran my tests selectively with
Quick Summary
This PR adds a JSON Schema generator to
massimo-clie.Scope:
.d.tsoutput--type json-schemaAs outlined in the linked issue, the intention is to generate types. Clients are not in scope of this PR.
What has been added
The implementation lives in
packages/massimo-cli/lib/json-schema. I decided to keep it completely isolated to keep the blast radius as close to this new feature as possible. The only time I change something outside of this, is when adding a new flag to the CLI.At a high level, the generator is split into four phases:
.d.tsin deterministic order.This split in the processing is the main design choice in this PR.
CLI wiring is also included in the changes:
The current CLI handles:
Why this structure
The main issue in my early iterations was that the output depended on traversal order of the schema. That is what pushed the implementation towards the aforementioned "four phases". Eventually my goal got super clear - same schema in, same declaration out. In line with this goal the implementation prefers determinism over super-specific outputs.
Conscious decisions
string | numberinline is a different concern from deciding whether a named declaration should existI've tried to make the commits easy to digest and review. Some bias may have crept in to how each commit is structured, but I hope it's not too messy.
Validation
The branch is in a reviewable state:
Follow-Up Work
The next sensible extensions are:
allOfThis is the first time I am contributing what I think is a relatively chunky "first vertical slice" in a tool. Feedback is always something i'm looking for and I truuuuly appreciate the time you (the reviewer) will take.
Happy reviewing (hopefully)! 🪿