-
Notifications
You must be signed in to change notification settings - Fork 604
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
[rush] Adds support for a separate rush-projects.json configuration file #4881
base: main
Are you sure you want to change the base?
[rush] Adds support for a separate rush-projects.json configuration file #4881
Conversation
"description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.", | ||
"type": "string" | ||
}, | ||
"projects": { |
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.
Instead of duplicating this in a second schema, update this and the rush.json
schema to allow anything in the projects
property and extract this to its own schema and validate the projects
object separately.
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.
Changed to use a "rush-project-config.schema.json"
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.
This schema does not seem to be actually importing or using rush-project-config.schema.json.
@iclanton @D4N14L do we actually have an example of a schema referencing another schema in our code base? In the past I think anything.schema.json was used in this way, but today nothing seems to import it.
My concern is whether VS Code will fetch the URL correctly.
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.
From what it looks like, when you do a ref to another json schema, doesn't that schema need to be uploaded to a server first? So I guess I would need to create the rush-project-config.schema.json, upload it, then add the reference in rush.schema.json?
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.
Some typo in the comments
Co-authored-by: Kenrick <[email protected]>
Co-authored-by: Kenrick <[email protected]>
common/changes/@microsoft/rush/will-seperate-rush-projects_2024-08-12-23-13.json
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,18 @@ | |||
{ |
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.
If the filename is rush-projects.json
then the schema filename must be rush-projects.schema.json
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.
I was thinking the same thing, but the rush-project.schema.json
file already exists and I feel like it might be confusing to just have rush-project.schema.json
and rush-projects.schema.json
files
…4-08-12-23-13.json Co-authored-by: Pete Gonzalez <[email protected]>
Summary
This MR adds the optional
rush-projects.json
file that allows the rush projects to be defined in a separate, dedicated file. This is useful in situations where repo permissions are managed at a file-level, allowing more developers to add or remove projects without admin repo level permissions.Details
This change will change the way rush looks for projects. It will first look for a
rush-projects.json
file, then if it does not exist it will look within therush.json
file, same as before. It prevents projects from being defined in both places, and also ensures that the projects are defined in one of the two locations.How it was tested
Tested locally on a rush repo.
Impacted documentation
https://rushjs.io/pages/configs/rush_json/