-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Remove dependencies on yarn #11279
Remove dependencies on yarn #11279
Conversation
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.
Let's also add the equivalent package-lock.json file with the same versions in the current yarn.lock.
Related: #2771 |
@@ -380,21 +380,6 @@ function main(argv) { | |||
process.exit(1); | |||
} | |||
|
|||
// Make sure changes to package.json also update yarn.lock. |
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.
Instead of removing this check, maybe repurpose it to make sure that package.json
and package-lock.json
are updated in lock step? (Heh!)
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.
Fair enough, PTAL
contributing/getting-started-e2e.md
Outdated
|
||
``` | ||
yarn global add gulp | ||
sudo npm install -g gulp |
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.
Is sudo
required on all platforms? If not, don't include it here.
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.
Removed sudo
from the command and added a comment below to clarify
@@ -48,7 +48,7 @@ This Quick Start guide is the TL;DR version of the longer [end-to-end guide](get | |||
* Go to the branch: `git checkout <branch name>` | |||
|
|||
# Build AMP & run a local server | |||
* Make sure you have the latest packages (after you pull): `yarn` | |||
* Make sure you have the latest packages (after you pull): `npm install` |
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.
Another useful command is to run npm prune
to make sure unnecessary dependencies are removed.
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.
Added it below in the "Create commits to contain your changes" section
|
||
* Install Gulp by running `yarn global add gulp` | ||
* Install Gulp by running `sudo npm install -g gulp` |
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.
Same comment re: sudo
. Many of our developers are on Mac OS and probably don't need to use 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.
Same
contributing/getting-started-e2e.md
Outdated
* Install [yarn](https://yarnpkg.com/en/docs/install) | ||
* Install [npm](https://www.npmjs.com/get-npm) | ||
|
||
* In your local repository directory (e.g. `~/src/ampproject/amphtml`), install the packages that AMP uses by running `npm install` |
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.
Make this consistent with what's below re: sudo
. Also, for commands that will likely be copy-pasted by new developers, let's put them on a separate line, like it previously was.
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
@@ -62,6 +62,7 @@ This Quick Start guide is the TL;DR version of the longer [end-to-end guide](get | |||
# Create commits to contain your changes | |||
|
|||
* Edit files in your favorite editor | |||
* If you edited `package.json` run `npm prune && npm install` to generated an updated `package-lock.json` file |
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.
to generate*
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
|
||
* Install Gulp by running `yarn global add gulp` | ||
* Install Gulp by running `npm install -g gulp` (on some platforms this command might required elevated privileges using `sudo`) |
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.
might require*
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.
Damn these fingers and their muscle memory 😝
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.
LGTM after the typos pointed out by Erwin are fixed.
Per the group chat, let's also bump our min node version in package.json to 4.7 and document somewhere that NPM >= 5 is required (perhaps as part of the warning in pr-check.js). |
If you look at the Travis raw logs from your PR checks, you'll see:
This can be updated via the mechanism described in travis-ci/travis-ci#4653 |
With the latest changes in commit 4dd5998, I still see an old version of npm being used. https://travis-ci.org/ampproject/amphtml/jobs/275099764 I don't think adding an I'll let @choumx comment on whether that will address the versioning concern he raised. |
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 haven't checked that the versions in the new package-lock.json are the same as the versions in the deleted yarn.lock, but I assume this is ok. Right, @erwinmombay? 😄
package.json
Outdated
@@ -5,7 +5,8 @@ | |||
"description": "Fastish HTML", | |||
"main": "index.js", | |||
"engines": { | |||
"node": "^4.0.0" | |||
"node": "^4.7.0", | |||
"npm": "^5" |
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.
Nit: 5.0.0 to be consistent with semantic versioning.
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
contributing/getting-started-e2e.md
Outdated
|
||
* Install [npm](https://www.npmjs.com/get-npm) | ||
* Install [npm](https://www.npmjs.com/get-npm) version >= 5 |
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.
Nit: Since installing node also installs npm, this should probably be "upgrade npm to version >= 5".
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, PTAL
The last thing per our conversation with Raghu is to compare build timings for npm 5 vs yarn on Travis. Hopefully it's a negligible delta (or faster!). |
…nd *upgrade* npm, since npm comes with NodeJS
… semantic versioning
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.
Doesn't seem to have an effect on the running time of Travis
contributing/getting-started-e2e.md
Outdated
|
||
* Install [npm](https://www.npmjs.com/get-npm) | ||
* Install [npm](https://www.npmjs.com/get-npm) version >= 5 |
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, PTAL
package.json
Outdated
@@ -5,7 +5,8 @@ | |||
"description": "Fastish HTML", | |||
"main": "index.js", | |||
"engines": { | |||
"node": "^4.0.0" | |||
"node": "^4.7.0", | |||
"npm": "^5" |
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
|
||
* Install [yarn](https://yarnpkg.com/en/docs/install) | ||
* If the version of [npm](https://www.npmjs.com/)` that was installed with NodeJS is lower than version 5, upgrade it by running `npm install -g npm@latest` (on some platforms this command might require elevated privileges using `sudo`) |
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.
This line is badly formatted due to a stray backtick. (You can click the "view" button above this file in the "files changed" view to see what it will actually look like.)
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
|
||
* Install [yarn](https://yarnpkg.com/en/docs/install) | ||
* If the version of [npm](https://www.npmjs.com/)` that was installed with NodeJS is lower than version 5, upgrade it by running `npm install -g npm@latest` (on some platforms this command might require elevated privileges using `sudo`) |
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.
nit: Add a comma after "on some platforms"
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.
Changed the voice of this sentence:
- on some platforms this command might require elevated privileges using
sudo
- this command might require elevated privileges using
sudo
on some platforms
@@ -62,6 +62,7 @@ This Quick Start guide is the TL;DR version of the longer [end-to-end guide](get | |||
# Create commits to contain your changes | |||
|
|||
* Edit files in your favorite editor | |||
* If you edited `package.json` run `npm prune && npm install` to generate an updated `package-lock.json` file |
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.
nit: Add a comma after "If you edited package.json
"
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
👍 I was about to post that it's about 17 seconds slower including npm upgrade. Travis had yarn caching, let's investigate separately how to do that for npm. |
@choumx, we already cache @danielrozenberg, this can go in as a separate PR if you'd like :) |
Re: yarn vs npm caching - the Travis documentation you linked to says that the caching only applies if you set node version > 6, so the difference in timing might be unrelated. The |
Fixes #11278