[rush] Add an optional "description" field for projects in rush.json - #6096
Xi Huang (yumikohey) wants to merge 1 commit into
Conversation
Allow project entries in rush.json to specify an optional, human-readable "description" string, and expose it as the new (beta) RushConfigurationProject.description property. Rush does not interpret the value; it is available to people and tools reading the project inventory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Xi Huang (@yumikohey) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 similar comment
|
Xi Huang (@yumikohey) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Summary
rush.jsonis documented as a "centralized inventory of all projects and their important metadata", but a project entry has no place to record what the project is. Adding a free-form field today fails schema validation:This PR adds an optional
"description"string to project entries inrush.json, and exposes it through a new@betaRushConfigurationProject.descriptionproperty so that tools and plugins can use it (for example, to show a one-line summary of each project in project listings or repo navigation tooling).{ "packageName": "my-app", "projectFolder": "apps/my-app", "description": "The main web application for the example repo" }Details
rush.schema.json: add an optionaldescriptionstring toprojects[]items.additionalProperties: falseis unchanged, so misspelled fields are still reported.RushConfigurationProject: adddescription?: stringtoIRushConfigurationProjectJson, and a new@betareadonly description: string | undefinedproperty populated fromrush.json(undefinedwhen omitted). The API report is updated accordingly.rush-init/rush.json: document the new field as aHYPOTHETICALline in the demo project.Rush does not interpret the value; it has no effect on install, build, change, or publish behavior. The change is purely additive, so existing
rush.jsonfiles remain valid, and there is no meaningful performance impact.An alternative is the
"description"field in each project'spackage.json. Keeping a short summary inrush.jsoninstead makes the central project inventory self-describing, so people and tools can understand the repository layout from one file without opening everypackage.json. This is especially useful in large monorepos.How it was tested
descriptionto a project in therush-npm.jsontest fixture, and extendedRushConfiguration.test.tsto verifyRushConfigurationProject.descriptionfor projects with and without the field.rush build -t @microsoft/rush-lib(API report regenerated) andrush test -o @microsoft/rush-lib: all tests pass.rush-init/rush.jsontemplate against the old and new schemas: the old schema rejects#/projects/0with the error above, and the new schema accepts it.rush.jsonin which every project entry has adescription: it fails validation with the current schema and passes with this change, andRushConfiguration.loadFromConfigurationFile()returns each project's description.Impacted documentation
rush-init/rush.jsontemplate, which this PR updates)