-
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
Replace npm with yarn #11332
Replace npm with yarn #11332
Changes from 4 commits
5718689
2a76595
9bfbe1a
3423b3f
6109007
61cd1e8
88046fa
6883ff2
5ccd5c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,17 +18,18 @@ limitations under the License. | |
|
||
## Requirements | ||
- git | ||
- node + npm | ||
- node 4.8+ | ||
- gulp (installed globally) | ||
- java 8 | ||
- yarn 1.0.2+ (see https://yarnpkg.com/) | ||
|
||
## Steps | ||
```bash | ||
git clone https://github.com/ampproject/amphtml.git | ||
cd amphtml | ||
# Checkout a tag | ||
git checkout 123456789 | ||
npm install | ||
yarn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "yarn" == "yarn install", regardless of yarn.lock or not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, thanks for checking! |
||
gulp clean | ||
# We only need to build the css files, no need to generate `max` files | ||
gulp build --css-only | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,20 +151,20 @@ Now run `git remote -v` again and notice that you have set up your upstream alia | |
|
||
Now that you have all of the files copied locally you can actually build the code and run a local server to try things out. | ||
|
||
amphtml uses Node.js, the npm package manager and the Gulp build system to build amphtml and start up a local server that lets you try out your changes. Installing these and getting amphtml built is straightforward: | ||
amphtml uses Node.js, the Yarn package manager and the Gulp build system to build amphtml and start up a local server that lets you try out your changes. Installing these and getting amphtml built is straightforward: | ||
|
||
* Install [NodeJS](https://nodejs.org/) version >= 4.7 (which includes npm) | ||
* Install [NodeJS](https://nodejs.org/) version >= 4.8 (which includes npm) | ||
|
||
* If the version of [npm](https://www.npmjs.com/) that was installed along with NodeJS is lower than 5 (check with `npm -v`), upgrade it by running | ||
* Install [Yarn](https://yarnpkg.com/) version >= 1.0.2, follow the instructions on the website or install it with npm: | ||
``` | ||
npm install -g npm@latest | ||
npm install -g yarn@latest | ||
``` | ||
|
||
The preceding command might require elevated privileges using `sudo` on some platforms. | ||
|
||
* In your local repository directory (e.g. `~/src/ampproject/amphtml`), install the packages that AMP uses by running | ||
``` | ||
npm install | ||
yarn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question here, re: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ACK |
||
``` | ||
|
||
You should see a progress indicator and some messages scrolling by. You may see some warnings about optional dependencies that are generally safe to ignore. | ||
|
@@ -177,10 +177,10 @@ amphtml uses Node.js, the npm package manager and the Gulp build system to build | |
|
||
* The AMP Project uses Gulp as our build system. Gulp uses a configuration file ([gulpfile.js](https://github.com/ampproject/amphtml/blob/master/gulpfile.js)) to build amphtml (including the amphtml javascript) and to start up the Node.js server with the proper settings. You don't really have to understand exactly what it is doing at this point--you just have to install it and use it. | ||
|
||
You can install Gulp using npm: | ||
You can install Gulp using Yarn: | ||
|
||
``` | ||
npm install -g gulp | ||
yarn global add gulp | ||
``` | ||
|
||
The preceding command might require elevated privileges using `sudo` on some platforms. | ||
|
@@ -278,7 +278,7 @@ The common workflow for making changes to files in Git is: | |
|
||
* edit some files using your favorite editor | ||
|
||
* if you edited `package.json`, run `npm prune && npm install` to generate an updated `package-lock.json` file | ||
* if you edited `package.json`, run `yarn install` to generate an updated `yarn.lock` file | ||
|
||
* tell Git that you care about these changes by _staging_ them using the `git add` command | ||
|
||
|
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: Move this up the list, just below
node
, to reflect the order in which they are likely to be installed.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