rushstack
rushstack copied to clipboard
[rush] Support configuring the name of Rush's "common" folder
Is this a feature or a bug?
- [x] Feature
- [ ] Bug
Please describe the actual behavior.
Rush stores all of its configuration within the common
directory, which is great to centralize it all, but in some repos that common directory falls in the middle of the folder list.
This has the disadvantage for some common workflows such as reviewing PRs where the api changes (stored in common/api
) are not the first item you'd like in the list of files. Also makes navigating the source a bit more difficult.
What is the expected behavior?
A configuration option in rush.json
to set the name of the folder to somewhere else in the repository. (i.e. .common
to ensure it stays at the top)
This is an interesting idea. Would it make more sense to move the common folder to /.rush
or something in the next major version of Rush? Sounds like that would be more convenient than the ability to configure its name to something arbitrary.
@octogonz - what do you think?
There is a similar comment/request about making it .rush
in #1511.
Sounds like that would be more convenient than the ability to configure its name to something arbitrary.
Rush's common
folder path actually used to be configurable via rush.json. We later removed that feature, because it was difficult to test, and because for people who work in multiple Rush repositories, it is really really advantageous for the folder structure to be as consistent and familiar as possible.
That said, I'd be open to changing the standard name that is used in all Rush repos, if it's a significant improvement. This could be a fairly disruptive change for existing repos, however.
👍 for making this configurable. We use Rush for managing a monorepo with many root folders, only some of which are JS projects. In a folder named "/common" we might want to put quite a few things that are not Rush/JS related, but the current hard-coding of the Rush folder prevents us from doing this in a tidy fashion.
That said, I'd be open to changing the standard name that is used in all Rush repos, if it's a significant improvement. This could be a fairly disruptive change for existing repos, however.
What about if it was configurable for a couple of specific names? I personally find the mandatory common/
naming to be at best mildly annoying and at worst quite actively confusing to people who don't understand that it's "just how rush does things"
If I could chose between a set of options I ~wouldn't mind~ would be very happy, EG something like:
-
common/
-
.rush/
-
rush/
I like the use of .rush/
or rush/
The name common
is sometimes used in existing projects that have shared modules, types, etc between them, to use common
means those projects migrating to rush will have to rework each of their project's documentation to differentiate between the two.
upvote for.rush/
instead of common
because we just started a new project and common
has already caused confusion in week 1, particularly thinking that the scrips under common are helper scripts for the project as opposed to auto-generated tool-related code. It's just a learning curve so it really is not a big deal, but definitely a nice to have.
Was looking for something like this, myself. It's strange that I have 3-4 "domains" in the root that I keep clean, and then .example
for everything else, and then common
. Most would assume it's a shared library used by all domains, but it's basically just rush config.
If it's supposed to stay consistent I'd lean towards .common
or .rush
as the convention.
Edit: looking for some OSS work and love this project so would be happy to find in commit history and add back in as an option.
Edit 2: There's also a PR for it already: https://github.com/microsoft/rushstack/pull/1510
Please rename common to .rush
🙏