From 1dedcdf2bc7f6adaa3977d12d68de1ba0a87150c Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sat, 26 Nov 2016 21:59:42 +0000 Subject: [PATCH] docs(*): switch from npm to yarn --- CONTRIBUTING.md | 10 +++-- TRIAGING.md | 2 +- docs/config/index.js | 2 +- docs/config/services/getVersion.js | 2 +- .../templates/ngdoc/api/module.template.html | 4 +- docs/content/guide/component-router.ngdoc | 11 +++--- docs/content/guide/unit-testing.ngdoc | 4 +- docs/content/misc/contribute.ngdoc | 38 ++++++++++--------- src/ngComponentRouter/Router.js | 4 +- src/ngMock/angular-mocks.js | 1 + 10 files changed, 44 insertions(+), 34 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9fd91be7..83def1e87 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -209,7 +209,9 @@ We have very precise rules over how our git commit messages can be formatted. T readable messages** that are easy to follow when looking through the **project history**. But also, we use the git commit messages to **generate the AngularJS change log**. -The commit message formatting can be added using a typical git workflow or through the use of a CLI wizard ([Commitizen](https://github.com/commitizen/cz-cli)). To use the wizard, run `npm run commit` in your terminal after staging your changes in git. +The commit message formatting can be added using a typical git workflow or through the use of a CLI +wizard ([Commitizen](https://github.com/commitizen/cz-cli)). To use the wizard, run `yarn run commit` +in your terminal after staging your changes in git. ### Commit Message Format Each commit message consists of a **header**, a **body** and a **footer**. The header has a special @@ -229,7 +231,8 @@ Any line of the commit message cannot be longer 100 characters! This allows the to read on GitHub as well as in various git tools. ### Revert -If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit .`, where the hash is the SHA of the commit being reverted. +If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. +In the body it should say: `This reverts commit .`, where the hash is the SHA of the commit being reverted. ### Type Must be one of the following: @@ -266,7 +269,8 @@ The body should include the motivation for the change and contrast this with pre The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes][closing-issues]. -**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this. +**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. +The rest of the commit message is then used for this. A detailed explanation can be found in this [document][commit-message-format]. diff --git a/TRIAGING.md b/TRIAGING.md index c347e0b9f..99621915b 100644 --- a/TRIAGING.md +++ b/TRIAGING.md @@ -95,7 +95,7 @@ You can mention him in the relevant thread like this: `@btford`. > Thanks for submitting this issue! > Unfortunately, we don't think this functionality belongs in core. -> The good news is that you could easily implement this as a third-party module and publish it on Bower and/or npm. +> The good news is that you could easily implement this as a third-party module and publish it on Bower and/or to the npm repository. ## Assigning Work diff --git a/docs/config/index.js b/docs/config/index.js index 03d02d702..ab5e45a3f 100644 --- a/docs/config/index.js +++ b/docs/config/index.js @@ -6,7 +6,7 @@ var packagePath = __dirname; var Package = require('dgeni').Package; // Create and export a new Dgeni package called angularjs. This package depends upon -// the ngdoc, nunjucks, and examples packages defined in the dgeni-packages npm module. +// the ngdoc, nunjucks, and examples packages defined in the dgeni-packages node module. module.exports = new Package('angularjs', [ require('dgeni-packages/ngdoc'), require('dgeni-packages/nunjucks'), diff --git a/docs/config/services/getVersion.js b/docs/config/services/getVersion.js index 473a6fd93..3471d716d 100644 --- a/docs/config/services/getVersion.js +++ b/docs/config/services/getVersion.js @@ -4,7 +4,7 @@ var path = require('canonical-path'); /** * dgService getVersion * @description - * Find the current version of the bower component (or npm module) + * Find the current version of the bower component (or node module) */ module.exports = function getVersion(readFilesProcessor) { var basePath = readFilesProcessor.basePath; diff --git a/docs/config/templates/ngdoc/api/module.template.html b/docs/config/templates/ngdoc/api/module.template.html index f126f1d2f..2d4903c6f 100644 --- a/docs/config/templates/ngdoc/api/module.template.html +++ b/docs/config/templates/ngdoc/api/module.template.html @@ -21,7 +21,9 @@
  • NPM e.g. - {% code %}npm install {$ doc.packageName $}@X.Y.Z{% endcode %} + {% code %}npm install --save {$ doc.packageName $}@X.Y.Z{% endcode %} + or + {% code %}yarn add {$ doc.packageName $}@X.Y.Z{% endcode %}
  • Bower e.g. diff --git a/docs/content/guide/component-router.ngdoc b/docs/content/guide/component-router.ngdoc index b11a7fecb..8319c81a4 100644 --- a/docs/content/guide/component-router.ngdoc +++ b/docs/content/guide/component-router.ngdoc @@ -149,7 +149,7 @@ You can see the complete application running below.

    Component Router

    - + @@ -467,13 +467,12 @@ to display list and detail views of Heroes and Crises. ## Install the libraries -It is easier to use npm to install the **Component Router** module. For this guide we will also install -AngularJS itself via npm: +It is easier to use [yarn](https://yarnpkg.com) to install the **Component Router** module. +For this guide we will also install AngularJS itself via yarn: ```bash -npm init -npm install angular@1.5.x --save -npm install @angular/router@0.2.0 --save +yarn init +yarn add angular@1.5.x @angular/router@0.2.0 ``` diff --git a/docs/content/guide/unit-testing.ngdoc b/docs/content/guide/unit-testing.ngdoc index d5825c394..82815f5e9 100644 --- a/docs/content/guide/unit-testing.ngdoc +++ b/docs/content/guide/unit-testing.ngdoc @@ -59,7 +59,7 @@ Karma to run against a number of browsers, which is useful for being confident t works on all browsers you need to support. Karma is executed on the command line and will display the results of your tests on the command line once they have run in the browser. -Karma is a NodeJS application, and should be installed through npm. Full installation instructions +Karma is a NodeJS application, and should be installed through npm/yarn. Full installation instructions are available on [the Karma website](http://karma-runner.github.io/0.12/intro/installation.html). ### Jasmine @@ -461,7 +461,7 @@ describe("Deep Thought", function() { })); it("has calculated the answer correctly", inject(function(DeepThought) { - // Because of sharedInjector, we have access to the instance of the DeepThought service + // Because of sharedInjector, we have access to the instance of the DeepThought service // that was provided to the beforeAll() hook. Therefore we can test the generated answer expect(DeepThought.answer).toBe(42); })); diff --git a/docs/content/misc/contribute.ngdoc b/docs/content/misc/contribute.ngdoc index f970bb2a5..092e3118c 100644 --- a/docs/content/misc/contribute.ngdoc +++ b/docs/content/misc/contribute.ngdoc @@ -5,7 +5,7 @@ # Building and Testing AngularJS This document describes how to set up your development environment to build and test AngularJS, and -explains the basic mechanics of using `git`, `node`, `npm`, `grunt`, and `bower`. +explains the basic mechanics of using `git`, `node`, `yarn`, `grunt`, and `bower`. See the [contributing guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md) for how to contribute your own code to AngularJS. @@ -24,20 +24,27 @@ Before you can build AngularJS, you must install and configure the following dep machine: * [Git](http://git-scm.com/): The [Github Guide to -Installing Git](https://help.github.com/articles/set-up-git) is a good source of information. + Installing Git](https://help.github.com/articles/set-up-git) is a good source of information. -* [Node.js v4.x](http://nodejs.org): We use Node to generate the documentation, run a -development web server, run tests, and generate distributable files. Depending on your system, you can install Node either from source or as a -pre-packaged bundle. (Currently our build does not work properly on Node v5 or greater - please use v4.x.) +* [Node.js v6.x (LTS)](http://nodejs.org): We use Node to generate the documentation, run a + development web server, run tests, and generate distributable files. Depending on your system, + you can install Node either from source or as a pre-packaged bundle. + + We recommend using [nvm](https://github.com/creationix/nvm) to manage and install Node.js, + which makes it easy to change the version of Node.js per project. + +* [Yarn](https://yarnpkg.com): We use Yarn to install our Node.js module dependencies (rather than using npm). + There are detailed installation instructions available at https://yarnpkg.com/en/docs/install. * [Java](http://www.java.com): We minify JavaScript using our -[Closure Tools](https://developers.google.com/closure/) jar. Make sure you have Java (version 7 or higher) installed -and included in your [PATH](http://docs.oracle.com/javase/tutorial/essential/environment/paths.html) variable. + [Closure Tools](https://developers.google.com/closure/) jar. Make sure you have Java (version 7 or higher) + 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: ```shell - npm install -g grunt-cli + yarn global add grunt-cli ``` ## Forking Angular on Github @@ -62,12 +69,9 @@ cd angular.js git remote add upstream "https://github.com/angular/angular.js.git" # Install node.js dependencies: -npm install +yarn install -# Install bower components: -bower install - -# Build AngularJS: +# Build AngularJS (which will install `bower` dependencies automatically): grunt package ``` @@ -78,11 +82,11 @@ Administrator). This is because `grunt package` creates some symbolic links.
    -**Note:** If you're using Linux, and npm install fails with the message -'Please try running this command again as root/Administrator.', you may need to globally install grunt and 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 globally install `grunt` and `bower`:
      -
    • sudo npm install -g grunt-cli
    • -
    • sudo npm install -g bower
    • +
    • sudo yarn global add grunt-cli
    • +
    • sudo yarn global add bower
    diff --git a/src/ngComponentRouter/Router.js b/src/ngComponentRouter/Router.js index 4d3e5752b..fdece9c5b 100644 --- a/src/ngComponentRouter/Router.js +++ b/src/ngComponentRouter/Router.js @@ -10,11 +10,11 @@ * * @installation * - * Currently, the **Component Router** module must be installed via `npm`, it is not yet available + * Currently, the **Component Router** module must be installed via `npm`/`yarn`, it is not yet available * on Bower or the Google CDN. * * ```bash - * npm install @angular/router@0.2.0 --save + * yarn add @angular/router@0.2.0 * ``` * * Include `angular_1_router.js` in your HTML: diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index 52f9171e0..5c0dde5a3 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -2347,6 +2347,7 @@ angular.mock.$ComponentControllerProvider = ['$compileProvider', * * [Google CDN](https://developers.google.com/speed/libraries/devguide#angularjs) e.g. * `"//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-mocks.js"` * * [NPM](https://www.npmjs.com/) e.g. `npm install angular-mocks@X.Y.Z` + * * [Yarn](https://yarnpkg.com) e.g. `yarn add angular-mocks@X.Y.Z` * * [Bower](http://bower.io) e.g. `bower install angular-mocks#X.Y.Z` * * [code.angularjs.org](https://code.angularjs.org/) (discouraged for production use) e.g. * `"//code.angularjs.org/X.Y.Z/angular-mocks.js"`