-
Notifications
You must be signed in to change notification settings - Fork 214
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
feat: provide json schema for nx.json #1186
Conversation
Nx Cloud ReportCI ran the following commands for commit 81be231. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
This comment has been minimized.
This comment has been minimized.
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.
The workspace and project.json were a little more involved because they're auto generated based on whatever workspace Nx Console is opened in. Since the schema for nx.json doesn't need to be dynamic, we don't have to do the whole schema generation.
Instead we can just place a json file within the project and link that within the package.json in the app directory.
Add a new object here:
nx-console/apps/vscode/src/package.json
Lines 770 to 783 in 53b09eb
"jsonValidation": [ | |
{ | |
"fileMatch": "workspace.json", | |
"url": "./workspace-schema.json" | |
}, | |
{ | |
"fileMatch": "angular.json", | |
"url": "./workspace-schema.json" | |
}, | |
{ | |
"fileMatch": "project.json", | |
"url": "./project-schema.json" | |
} | |
] |
with
{
"fileMatch": "nx.json",
"url": "./nx-schema.json"
},
Then create a file beside the package.json called nx-schema.json
and put the string you have in createJsonSchema
within that json file.
And that should be it 😄
Let me know if you have any questions.
Thank you for your advice! I reverted the generator and added |
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.
Thank you for creating the schema for this!
This PR adds a JSON schema to provide intellisense when configuring
nx.json
.Related Issue(s)
nrwl/nx#7993