From 67263f2bd0d076c5dd36910eec2078d6df01ce0d Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Fri, 2 Nov 2018 16:51:21 +0200 Subject: [PATCH] docs(tutorial): explain how to upgrade dependencies Related: angular/angular-seed#439 --- docs/content/tutorial/index.ngdoc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/content/tutorial/index.ngdoc b/docs/content/tutorial/index.ngdoc index 3f8e417bd..329cb23c5 100644 --- a/docs/content/tutorial/index.ngdoc +++ b/docs/content/tutorial/index.ngdoc @@ -282,6 +282,33 @@ the application as a whole is executing correctly. It is very common to run E2E a new commit of changes to a remote repository. +### Updating dependencies + +In order to avoid surprises, all dependencies listed in `package.json` are pinned to specific +versions (this is what the [package-lock.json][package-lock] file is about). This ensures that the +same version of a dependency is installed every time. + +Since all dependencies are acquired via npm, you can use the same tool to easily update them as +well (although you probably don't need to for the purpose of this tutorial). Simply run the +preconfigured script: + +``` +npm run update-deps +``` + +This will update all packages to the latest version that satisfy their version ranges (as specified +in `package.json`) and also copy the necessary files into `app/lib/`. For example, if `package.json` +contains `"some-package": "1.2.x"`, it will be updated to the latest 1.2.x version (e.g. 1.2.99), +but not to 1.3.x (e.g. 1.3.0). + +If you want to update a dependency to a version newer than what the specificed range would permit, +you can change the version range in `package.json` and then run `npm run update-deps` as usual. + +
+ See [here][semver-ranges] for more info on the various version range formats. +
+ + ### Common Issues
@@ -336,5 +363,7 @@ Now that you have set up your local machine, let's get started with the tutorial [npm]: https://www.npmjs.com/ [nvm]: https://github.com/creationix/nvm [nvm-windows]: https://github.com/coreybutler/nvm-windows +[package-lock]: https://docs.npmjs.com/files/package-lock.json [protractor]: https://github.com/angular/protractor [selenium]: https://docs.seleniumhq.org/ +[semver-ranges]: https://docs.npmjs.com/misc/semver#ranges