cli icon indicating copy to clipboard operation
cli copied to clipboard

Recommended approach for upgrading CLI based app?

Open Vheissu opened this issue 8 years ago • 14 comments

I'm submitting a feature request

  • aurelia-cli version: 0.14.0

Please tell us about your environment:

  • Operating System: OSX 10.x|Linux (distro)|Windows [7|8|8.1|10]

  • Node Version: 6.2.0

  • NPM Version: 3.8.9

  • Browser: all

  • Language: all

Current behavior: There is no documented method for upgrading an existing CLI based app when you upgrade the aurelia-cli app via npm install aurelia-cli -g

Expected/desired behavior: I would expect there would be some kind of way I can update my current CLI based app if I update the CLI and an issue has been fixed, like the .NET Core issue with resolution of the bundle scripts in 0.14

What is the motivation / use case for changing the behavior? There is no way to upgrade a project based on the CLI when an update has been released.

Vheissu avatar Jul 14 '16 09:07 Vheissu

FWIW, i have heavily customized my "tasks", so updating these files (build, transpile, run, etc...) to the latest aurelia-cli versions should be an explicit step. Ii also may want to update the files i haven't customized.

So i think their should be three options to an au update. a) overwrite all files, b) overwrite all unchanged/not customized files, c) (default) do not update anything if some file is not vanilla

masterpoi avatar Jul 14 '16 10:07 masterpoi

To update today:

  • Update your global CLI install.
  • Create a new project using the CLI
  • Compare your aurelia.json file to the one generated for the new project and update as appropriate.
  • Compare your tasks to the ones generated for the new project and update as appropriate.

You may also want to compare generators and environments.

We can consider some update command for the future, but that's probably not going to happen in the next couple of months, unless a community member contributes it.

EisenbergEffect avatar Jul 14 '16 11:07 EisenbergEffect

You could look at how ember-cli solved this issue as a reference

zoamel avatar Jul 15 '16 05:07 zoamel

This blog post might be a good starting point

mttmccb avatar Dec 02 '16 20:12 mttmccb

Here are some ideas on an au update: First, we could diff against the files from the version that is updated from. That way, the cli can tell wheather or not there were customizations in a task that changed with the new cli version. When the cli updates unmodified tasks, its most likely safe. Also, always offer a diff before making changes. Then there is the aurelia.json. When there are new possibilities or changes in this file, the cli could just link to the information of what changed. Then it is up to the dev to implement these changes. Later, I can imagine a script shipped with the updated version that can automate this task (although this only makes sense if there are still big enough changes coming here, such as with the 0.21.0 release).

If this sounds like a good direction, I would like to work on a PR for this.

s-hoff avatar Jan 05 '17 22:01 s-hoff

https://github.com/aurelia/cli/issues/526 has some ideas to improve things as well

JeroenVinke avatar Mar 12 '17 21:03 JeroenVinke

any update on how to safely upgrade an existing project from older CLI?

avrahamcool avatar Jun 08 '17 18:06 avrahamcool

Not yet, this is still the way to go

JeroenVinke avatar Jun 09 '17 06:06 JeroenVinke

@s-hoff Are you working on a PR for this?

jwx avatar Jun 14 '17 09:06 jwx

@jwx No. I had some ideas but no time to implement or try them out.

s-hoff avatar Jun 14 '17 10:06 s-hoff

now 2018 no updates? look at this https://github.com/SpoonX/aurelia-update however this fails on my setup

geomorillo avatar Jun 17 '18 19:06 geomorillo

or maybe just follow this steps , can someone be kind to review if this steps works?

  1. delete /node_modules and package-lock.json (if you have any)

  2. run npm update. this will update package.json to the latest version with installed dependencies

geomorillo avatar Jun 17 '18 20:06 geomorillo

@geomorillo there is some documentation here: https://aurelia.io/docs/cli/updating

JeroenVinke avatar Jul 02 '18 09:07 JeroenVinke

@JeroenVinke its not about updating the cli but the libraries inside the project, so already tested the steps i mentioned and it works

geomorillo avatar Jul 03 '18 01:07 geomorillo