Updating Loopback 4 - loopbackjs

I am using Loopback 4 to create a REST-ful API. I'm a mobile developer by trade so typescript et al is all pretty new to me, so please be kind ;)
I created the app using CLI v1.21.4, and saw a message to say that an update is available. I therefore updated my global installation of the CLI. But then when I try and run one of the commands such as lb4 model I see the message:
The project was originally generated by #loopback/cli#1.21.4.
The following dependencies are incompatible with #loopback/cli#1.23.1:
typescript: ~3.5.3 (cli ~3.6.3)
#loopback/authentication: ^2.2.2 (cli ^3.1.1)
I would of course like to take advantage of these newer modules, but I am unsure how to update my app scaffolding and dependencies. Could anyone offer some advice please?

Please check out https://github.com/strongloop/loopback-next/issues/3608:
During lb4 app, we add the cli version to .yo.rc.json, such as:
{
"#loopback/cli": {
"version": "1.21.4"
}
}
lb4 -v lists compatible modules that are released with the cli.
lb4 commands check if the project has incompatible versions with the current cli and prompts users to force or exit.

I would of course like to take advantage of these newer modules, but I am unsure how to update my app scaffolding and dependencies.
The process for updating dependencies is not specific to LoopBack. If you are using npm, then simply run npm update.
Please note that TypeScript often introduces backwards-incompatible changes in semver-minor releases, 3.6 brought few of them. Be prepared to manually fix few compilation errors after the upgrade.
I think that npm update is not going to jump from v2 to v3 for #loopback/authentication, you have to request that upgrade explicitly:
$ npm install #loopback/authentication#latest

There is now a supported update procedure, which is documented here:
https://loopback.io/doc/en/lb4/Update-generator.html
It seems to be simply:
# Ensure you have the latest version of the CLI tool
npm install -g #loopback/cli
# Then ask the tool to check which packages should be upgraded
lb4 update

Related

Is it possible to use lambda layers with zappa?

I want to deploy my wagtail (which is a CMS based on django) project onto an AWS lambda function. The best option seems to be using zappa.
Wagtail needs opencv installed to support all the features.
As you might know, just running pip install opencv-python is not enough because opencv needs some os level packages to be installed. So before running pip install opencv-python one has to install some packages on the Amazon Linux in which the lambda environment is running. (yum install ...)
The only solution that came to my mind is using lambda layers to properly install opencv.
But I'm not sure whether it's possible to use lambda layers with projects deployed by zappa.
Any kind of help and sharing experiences would be really appreciated!
There is an open pull request that is ready to merge, but needs additional user testing.
The older project has a pull request that claims layer support has been merged
Feel free to try it out and let the maintainers know so documentation can be updated.

Stuck when creating credentials - Yargs through package.json is deprecated

I´m using Windows 10 and following the "Getting started" tutorial, but after creation of user I can´t create the credential for him.
the command line:
eg credentials create -c bob -t key-auth -q
the result:
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
then I must press Control+C to stop the process.
unfortunately yes, we have a problem with yargs on Windows which is actually tracked in our GitHub repository: https://github.com/ExpressGateway/express-gateway/issues/889
My idea would be to replace yargs with oclif or something modern, but I haven't been able to work on it yet.
Also, I do not have a Windows machine so it is kind of difficult to test it out properly.

EmberJS: How to update Ember CLI based apps

Angular has https://update.angular.io/ that guides with the proper way to update (along with dependencies et al.). Likewise, is there a way to know how to update an Ember app properly?
Obviously, changing the version of the ember package in bower.json and doing an bower install && npm install doesn't seem to be the ideal way.
Detailed update information are included in release notes provided for ember-cli on GitHub: https://github.com/ember-cli/ember-cli/releases/
For projects that aren't using a very old version, the workflow is mostly this one:
Update globally installed ember-cli to latest stable release
Update globally installed ember-cli-update to latest stable release
Clean up your project by deleting tmp, dist and node_modules folders.
Run ember-cli-update to update project to match current blueprint.
Run ember-cli-update --run-codemods to update project to match current best practices.
Before ember-cli-update has become the official tool for updating projects, running ember init again after updating projects ember-cli dependency manually was the officially recommended workflow. ember-cli#3.2.0 was the last release for which this workflow was recommended. But ember-cli-update should support all versions for which a tag exists in ember-new-output repo, which should be true for all stable releases of ember-cli.
You could of course update your dependencies individually and not follow the recommended configuration provided by ember-cli. But be aware that uncommon combination may not work as stable as you are used to.
If your app still uses Ember App Kit, which has been deprecated in 2014, you could find a migration guide in their readme. But you should consider carefully if rewriting wouldn't be quicker than updating such an outdated app.
You can find a complete step-by-step guide for upgrading an ember here,
https://cli.emberjs.com/release/basic-use/upgrading/

How to replace phpoffice/phpexcel with phpoffice/phpspreadsheet

Main error when doing composer install:
Package phpoffice/phpexcel is abandoned, you should avoid using it.
Use phpoffice/phpspreadsheet instead.
I am using "maatwebsite/excel": "~2.1.0"
And Laravel 5.5
I wanna avoid migrating excel to 3.0. I already tried migrating it but it doesn't fit in.
You can try out the following guide, or the mentioned "Automated tool"
Migration from PHPExcel
In the meantime, you can specify the complete version number of Excel to continue running updates.
Discalimer: I wrote a tool that handles automated migration from CLI called Rector, so people don't have to upgrade PHP code manually anymore. It's free, open-source, on GitHub.
Official "Automated tool" only fixes class names. There are 24 more cases, that needs to be changed. We need to upgrade huge PHP project and manual changes would take too much time and could stuck us for weeks.
Instead I made an upgrade set with all 25 cases, that changed code for us:
composer require rector/rector --dev
vendor/bin/rector process src --set phpexcel-to-phpspreadsheet
Do you want to know more? Check How to Migrate From PHPExcel to PHPSpreadsheet with Rector in 30 minutes post

Is there an easier way to debug ember addons

I have been just starting out with ember addon and one of the difficulty I am facing is to debug it. I have a separate repo for my addon(lets name it my-addon for now), and everytime I make any change, I have to
1) commit it
2) push the changes
3) go to consuming app and then re install the app from git(atleast re-run npm install git:address so I get the latest changes)
4) run ember g my-addon (because I am in older cli)
5) do build
6) and check if things are working
This process is kinda tedious, I was wondering if I can place the addon(all of it) within the consuming app itself, atleast in the dev phase so I can just build my ember app and test the addon in the consuming app itself, and once I feel good about, push it to my local git repo.
Any thoughts or approach on how you folks do it - or may be I am just missing out something and doing it wrong!
Thanks,
Dee
If you use ember-cli you can link your local addon in the consuming app. You can find all details in the user guide
Note that watchman doesn't observe local addon symlinked (there are couple of issues opened both on ember-cli and watchman). I've resolved removing watchman falling back to NodeWatcher (I'm on mac)
I am pretty sure the solution provided by #GUL must work too, but what worked for me was:
1) in the consuming dev app, I created a folder called addons and placed all my addon code there
2) in consuming dev app, in package.json I added :
"ember-addon": {
"paths": [
"addons/ember-chart"
]
}
and that worked for me!
The top answer is best here. I just wanted to offer an alternative that is useful in certain situations. npm pack at root of in development addon. Then cd back to parent project. npm install ../ember-composable-helpers-2.2.0.tgz. And then check if things are working.
npm pack will create a tarball as if published on npm.