-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Suggestion: rename "yarn clean" or produce warnings when it is used #2438
Comments
maybe |
Renaming a command should go through RFC, feel free to send one. |
The core team is quite happy with autoclean at this moment.
I suppose this is one of those cases where a lot of people have different
opinions and it would be hard to satisfy everyone.
autoclean will be accepted now.
Other alternatives like prune will require more discussion and
argumentation.
…On 17 May 2017 at 01:59, Andrew Kennedy ***@***.***> wrote:
yarn prune?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2438 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWAurkCA7voqurhomI8BJAL7C9rXaks5r6kaLgaJpZM4LiFWm>
.
|
|
Wow - thank goodness for this issue. My project has a I know that no one will ever probably read this since the issue is closed, but had to make a comment on my small victory of the day! |
|
I am sorry if this is already discussed somewhere. I could not find such a discussion.
"yarn clean" is a great feature but it might be a misnomer.
People might expect "yarn clean" to do a different thing (to clean build artifacts) than it actually does (cleans node modules of some files and sets the system to clean it automatically in the future). This is a very natural expectation because it is usually possible to do, e.g., "yarn watch", "yarn dist", and of course, "yarn clean" seems like a logical command (compare with gradle clean, mvn clean, gulp clean).
Next, when "yarn clean" is executed a user realizes that it is not the correct command but it does not seem to do anything drastic (probably just cleans some yarn caches) and forgets about it. (Of course, the right thing to do would be to look at https://yarnpkg.com/en/docs/cli/clean instead.) The result often is that the project is broken and the bug is hard to detect. There are a lot of such bugs in this project and more elsewhere (example: twbs/bootstrap-sass#1097).
IMHO, the name is confusing and the best way to stop confusion is to rename the command. Since the command is not usually used in builds, this would not even be a very breaking change. This would also allow to use "yarn clean" as a custom task for cleaning the artifacts. The possible new name candidates might be: "cleanModules", "stripModules", "strip", "shrinkModules", "shrink".
Alternatively, it might be good to produce nice warnings when the command is used and on subsequent installation of modules (listing cleaned/ignored files).
What do you think?
The text was updated successfully, but these errors were encountered: