Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly update the library parts

I started a fresh CLI project a few weeks ago which installed the CLI in v0.24.0 & the framework in v1.0.8.

Since they released some updates this week (CLI v0.26.0, Framework v1.1.0, ...) I'm wondering how to properly update the core components.

I have the following aurelia dependencies within my package.json:

{
  // ...
  "dependencies": {
    "aurelia-animator-css": "^1.0.0",
    "aurelia-api": "^3.1.1",
    "aurelia-authentication": "^3.2.0",
    "aurelia-bootstrapper": "^1.0.0",
    "aurelia-fetch-client": "^1.1.0",
    // ...
  },
  "devDependencies": {
    "aurelia-cli": "^0.24.0",
    "aurelia-testing": "^1.0.0-beta.2.0.0",
    "aurelia-tools": "^0.2.2",
    // ...
  },
  // ...
}

The following of those packages are outdated compared to latest releases on NPM:

  • aurelia-cli 0.24.0, latest 0.26.0
  • aurelia-animator-css 1.0.0, latest 1.0.1
  • aurelia-bootstrapper 1.0.0, latest 2.1.0
  • aurelia-fetch-client 1.1.0, latest 1.1.1
  • aurelia-testing ^1.0.0-beta.2.0.0, latest ^1.0.0-beta.3.0.0
  • aurelia-tools 0.2.2, latest 1.0.0

Since all of those packages use the caret version range, most of them won't update to the latest version automatically when running npm update.

Here are my questions

  1. Do I have to manually update the version of each mentioned package within my package.json when I'd like to bring the framework to the latest state? (Seems obvious)
    • I know that I could use something like tilde or x ranges within package.json but this is not exactly what I'm looking for since I'd like to explicitly allow new versions to be installed to ensure that other devs or the build server won't work with completely different versions...
  2. Is there some streamlined process of finding out the latest version numbers of each framework package I use or do I have to manually "crawl" the versions from npm.org as I did when writing this question?
  3. The aurelia-framework package is not mentioned anywhere within my package.json file and it's not automatically updating by running npm update. How do I actually update it?
like image 211
suamikim Avatar asked Mar 05 '17 11:03

suamikim


People also ask

What should I look for when adding a new library?

When adding a new library, check in published modules whether there are already modules that deliver it. Pay special attention whether they include a different version to the one you want to update, because in this case incompatibility issues could appear when installing that module together with your library.

How do I upgrade a library?

When upgrading a library (or including a new one), you need to check the newer version's license. If it is the same as the older version, there is no problem. Once the prerequisites are satisfied, the upgrade process consists on the following steps: A new library version can change its public API.

What are the different components and libraries in a schematic diagram?

Physical Component - physical component name. Logical Symbol - associated logical symbol. Library - source library from which it was placed. Count - number of instances currently placed across all enabled schematic documents. Next - click to access Page 2 of the dialog.

What is the update from library dialog used for?

The Update From Library dialog provides controls to pass changes to parameters, symbols and model references in the external database as well as graphical modifications made in referenced symbol and model libraries. The dialog is accessed by clicking Tools » Update From Libraries.


1 Answers

The documentation for the CLI says to add a NPM script that you can run to update then all to the latest version:

https://github.com/aurelia/framework/blob/master/doc/article/en-US/the-aurelia-cli.md#updating-multiple-libraries.

Which would mean adding something like this to your package.json scripts section:

    "au-update": "npm i aurelia-binding@latest aurelia-bootstrapper@latest aurelia-dependency-injection@latest aurelia-event-aggregator@latest aurelia-framework@latest aurelia-history@latest aurelia-history-browser@latest aurelia-loader@latest aurelia-loader-default@latest aurelia-logging@latest aurelia-logging-console@latest aurelia-metadata@latest aurelia-pal@latest aurelia-pal-browser@latest aurelia-path@latest aurelia-polyfills@latest aurelia-route-recognizer@latest aurelia-router@latest aurelia-task-queue@latest aurelia-templating@latest aurelia-templating-binding@latest aurelia-templating-resources@latest aurelia-templating-router@latest aurelia-testing@latest aurelia-dialog@latest -S",

The first time you upgrade it will add references in your package.json to them, so the dependencies section get's a lot bigger/ adds all those missing nested dependencies.

Another way is to use a NPM package that performs these checks for all your packages npm check updates also the non-Aurelia ones.

Which allows you to do:

ncu

to check which packages are outdated, and

ncu -u

to upgrade them all to the latest version ignoring the semver restrictions.

like image 57
Erik Lieben Avatar answered Jan 04 '23 02:01

Erik Lieben