rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[rush] Support configuring the name of Rush's "common" folder

Open calebmshafer opened this issue 4 years ago • 9 comments

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)

calebmshafer avatar May 01 '20 13:05 calebmshafer

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.

iclanton avatar May 04 '20 17:05 iclanton

@octogonz - what do you think?

iclanton avatar May 04 '20 17:05 iclanton

There is a similar comment/request about making it .rush in #1511.

calebmshafer avatar May 04 '20 22:05 calebmshafer

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.

octogonz avatar May 05 '20 00:05 octogonz

👍 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.

fagerbua avatar Oct 08 '20 08:10 fagerbua

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/

pseudo-su avatar Apr 06 '21 08:04 pseudo-su

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.

tkodev avatar Jul 27 '21 23:07 tkodev

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.

Vir3s avatar Oct 05 '21 05:10 Vir3s

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

and0p avatar Jun 29 '22 04:06 and0p

Please rename common to .rush 🙏

dustinlacewell avatar Oct 29 '22 01:10 dustinlacewell