Remove dependencies on yarn#11279
Conversation
dreamofabear
left a comment
There was a problem hiding this comment.
Let's also add the equivalent package-lock.json file with the same versions in the current yarn.lock.
|
Related: #2771 |
| process.exit(1); | ||
| } | ||
|
|
||
| // Make sure changes to package.json also update yarn.lock. |
There was a problem hiding this comment.
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.
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.
Is sudo required on all platforms? If not, don't include it here.
There was a problem hiding this comment.
Removed sudo from the command and added a comment below to clarify
|
|
||
| # 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.
Another useful command is to run npm prune to make sure unnecessary dependencies are removed.
There was a problem hiding this comment.
Added it below in the "Create commits to contain your changes" section
| * Install [npm](https://www.npmjs.com/get-npm)` | ||
|
|
||
| * Install Gulp by running `yarn global add gulp` | ||
| * Install Gulp by running `sudo npm install -g gulp` |
There was a problem hiding this comment.
Same comment re: sudo. Many of our developers are on Mac OS and probably don't need to use it.
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.
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.
| # 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 |
| * Install [npm](https://www.npmjs.com/get-npm)` | ||
|
|
||
| * 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.
Damn these fingers and their muscle memory 😝
rsimha
left a comment
There was a problem hiding this comment.
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. |
dreamofabear
left a comment
There was a problem hiding this comment.
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
| "engines": { | ||
| "node": "^4.0.0" | ||
| "node": "^4.7.0", | ||
| "npm": "^5" |
There was a problem hiding this comment.
Nit: 5.0.0 to be consistent with semantic versioning.
contributing/getting-started-e2e.md
Outdated
| * Install [NodeJS](https://nodejs.org/) version >= 4.7 (which includes npm) | ||
|
|
||
| * 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.
Nit: Since installing node also installs npm, this should probably be "upgrade npm to version >= 5".
|
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
danielrozenberg
left a comment
There was a problem hiding this comment.
Doesn't seem to have an effect on the running time of Travis
contributing/getting-started-e2e.md
Outdated
| * Install [NodeJS](https://nodejs.org/) version >= 4.7 (which includes npm) | ||
|
|
||
| * Install [npm](https://www.npmjs.com/get-npm) | ||
| * Install [npm](https://www.npmjs.com/get-npm) version >= 5 |
package.json
Outdated
| "engines": { | ||
| "node": "^4.0.0" | ||
| "node": "^4.7.0", | ||
| "npm": "^5" |
| * Install [NodeJS](https://nodejs.org/) version >= 4.7 | ||
|
|
||
| * 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.
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.)
| * Install [NodeJS](https://nodejs.org/) version >= 4.7 | ||
|
|
||
| * 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.
nit: Add a comma after "on some platforms"
There was a problem hiding this comment.
Changed the voice of this sentence:
- on some platforms this command might require elevated privileges using
sudo
- this command might require elevated privileges using
sudoon some platforms
| # 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.
nit: Add a comma after "If you edited package.json"
|
👍 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