cli
cli copied to clipboard
Recommended approach for upgrading CLI based app?
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.
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
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.
You could look at how ember-cli solved this issue as a reference
This blog post might be a good starting point
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.
https://github.com/aurelia/cli/issues/526 has some ideas to improve things as well
any update on how to safely upgrade an existing project from older CLI?
Not yet, this is still the way to go
@s-hoff Are you working on a PR for this?
@jwx No. I had some ideas but no time to implement or try them out.
now 2018 no updates? look at this https://github.com/SpoonX/aurelia-update however this fails on my setup
or maybe just follow this steps , can someone be kind to review if this steps works?
-
delete /node_modules and package-lock.json (if you have any)
-
run npm update. this will update package.json to the latest version with installed dependencies
@geomorillo there is some documentation here: https://aurelia.io/docs/cli/updating
@JeroenVinke its not about updating the cli but the libraries inside the project, so already tested the steps i mentioned and it works