-
Notifications
You must be signed in to change notification settings - Fork 27.4k
docs(*): remove usage of global grunt-cli #16276
Conversation
Personally, I prefer to use |
How about we add a note that you don't have to install |
@Narretz Do you mean to undo the changes of this commit and only add the note ? |
My reading of this PR is that it is not using a global grunt install anymore. |
It does have the benefit that you don't have to prefix each command with
That's right. Another problem is that this is not the only place where these instructions are. There's also https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md, https://github.com/angular/angular.js/blob/master/README.md, even on the angularjs.org repo: https://github.com/angular/angularjs.org |
For better or worse, we are using
I would go the other way and document that you can drop the 👍 for updating all places which refer to |
Ye makes sense. Using scripts does hide the actual implementation from the usage of the commands (whether you're using grunt, gulp, webpack, pure node, ... you can still use the same cli command). As AngularJS is using both Grunt and Gulp (atleast, they are both installed), one could run grunt and gulp without the user/developer needs to know which one he is running by using scripts. Currently, I have no idea what Gulp is being used for (afaik I shouldn't need to know it and just rely on the scripts). But yes, the downside is you need to maintain the scripts. |
If we document |
This PR must / can be updated now. There's now things to change in the DEVELOPERS.md, too. |
Alright, I've moved the changes to the new files. I didn't add the message regarding global gunt yet, will do soon. I was wondering how the following ended up in there and I wanted to check if this is really necessary ?
I've had this problem on my mac for a while (prior to my npm permissions where set correctly).
Or am I missing something why the global installation is really required? Is it realy up to us to define how they have to fix their permission issues ? We might be good with linking to https://docs.npmjs.com/getting-started/fixing-npm-permissions, no ? |
I always go to the git blame to find why something was added. Leads to result in 50% of the cases. ;) |
DEVELOPERS.md
Outdated
sudo yarn global add grunt-cli | ||
sudo yarn global add bower | ||
``` | ||
**Note:** If you're using Linux, and `yarn install` fails with the message 'Please try running this command again as root/Administrator.', you may need to fix your [npm permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions). |
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.
Why npm when we are using yarn?
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.
That's a good question, it's a common issue that permissions are set wrong on osx and Linux for npm, but I'll check how that works for yarn!
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.
@Narretz I had a chat offline with @gkalpak and we think it's probably a good idea to just leave this part out and reconsider if there are issues with this. What do you think?
Encouraging sudo is definetly not what we want to be doing, and I'm not sure we want to maintain npm/yarn
permission issues in the angularjs repo either.
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.
Fine with me
I've added the mentioning of installing grunt globally: Grunt: We use Grunt as our build system. We're using it as a local dependencies but if you prefer to use the command-line tool globally, you can install it using yarn: yarn global add grunt-cli I'm still a bit unsure what the benefit is for adding this to the docs, as it realy is not recommended (it's even recommended to avoid it) to install it globally. If it's not recommended, why guide anyone to adding it globally ? |
Because then you can |
Let me add that part aswell.
Even tho thats true, the issues global NPM modules can cause are worse. I do agree that if that's not the case, installing it globally results in "shorter" commands. But promoting the global installation is odd as it's realy something to be avoided at all cost. |
Sadly, alot of libraries mention it coz it's easier to explain how the CLI works without explaining how NPM/Yarn resolves dependencies (localy vs global) and how scripts work (which is out of scope of the grunt docs anyway).
Ofcourse there are. Every none-project dependency should be globally ( Anyway, I've added the message 😄 |
DEVELOPERS.md
Outdated
@@ -34,13 +34,15 @@ machine: | |||
to be installed and included in your | |||
[PATH](http://docs.oracle.com/javase/tutorial/essential/environment/paths.html) variable. | |||
|
|||
* [Grunt](http://gruntjs.com): We use Grunt as our build system. Install the grunt command-line tool | |||
globally with: | |||
* [Grunt](http://gruntjs.com): We use Grunt as our build system. We're using it as a local dependencies but if you prefer to use the command-line tool |
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.
Sorry to bother you so long with this :D but I feel like we can be more concise and precise here. How about
We're using it as a local dependency, but you can also add the grunt command-line tool globally (with
yarn global add grunt-cli
), which allows you to leave out theyarn
prefix for all our grunt commands.
Then you can remove the code block and note below (which makes it sound like you can only use global or local grunt, but you can still use yarn grunt ... if you want, even with global grunt-cli).
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.
No need to feel sorry, I appreciate the feedback! I do think it reads better the way u propose, let me update it!
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 will merge when you've updated this part 👍
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.
Done 😄
Previously, the `DEVELOPERS.md` and `CONTRIBUTING.md` files refered to global `grunt-cli` by default. This commit ensures the local `grunt-cli` is used by default and mentiones the possibility to still use the global `grunt-cli`.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Docs update
What is the current behavior? (You can also link to an open issue here)
Currently, the contributing docs tell people to globally install grunt and build angularjs using the
grunt
cli command.What is the new behavior (if this is a feature change)?
This commit ensures grunt is not required globally by updating all the commands to use
yarn grunt
instead ofgrunt
.Does this PR introduce a breaking change?
No
Please check if the PR fulfills these requirements
Other information: