-
Notifications
You must be signed in to change notification settings - Fork 2k
Add schema.json
to have a better IDE intellisense
#634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/vercel/turbo-site/F3tW9nj4vsT5hEGsXLUK2re33ZvD |
https://turbo-site-git-fork-arthurfiorette-main.vercel.sh/schema.json Another thing that can be done is also mention the hability to get from |
@jaredpalmer anything more? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move everything into docs
folder since this is essentially part of documentation at the moment because it is not directly derived from actual source code
This commit continues the amazing work done in #634 and #726. Instead of generating the JSON schema from a separate TypeScript file, this commit introduces a new CLI (to avoid bloating the main one) that will output a JSON schema from the struct definition itself, including the actual code comments. This will allow to better integration and to avoid differences between the two codebases.
This PR adds an
schema.d.ts
file with all (documented ones) properties in theturbo.json
file. This way, and combining with the newnpm run jsonschema
script, it's possible to generate an Json schema file.I configured to the generated file be placed at
docs/public/schema.json
, so it can be requested from the urlhttps://turborepo.org/schema.json
. You can test how powerfull it is with in IDE autocompletion, intellisense and inline documentation.Try it out in your IDE by adding
"$schema": "./docs/public/schema.json"
It also updated all (that i saw :P) documentation examples to include the
$schema
property, this way, it will go by default for allCtrl C/V
users out there.But i still need to point out some things:
jsonschema
(Is that even a good name?) script is going to be ran a lot, may we addts-json-schema-generator
to thedevDependencies
group?turbo.json
file, i saw anenv
property, but it is not documented, should i add it or it just shouldn't be there?schema.d.ts
file, it is not perfect and it probably has some typos.That's it for now. Thanks for this amazing package!