You can now update your plugin workspaces to all the latest dependency versions with a few keystrokes:
nx migrate @nativescript/plugin-tools
npm install
nx migrate --run-migrations=migrations.json
Viola 🎉 Your plugin workspace including the demo apps are now up to date with all the latest versions.
Note: If you don't have the nx cli installed globally, just prefix with: npx nx ...
If you'd like to install it globally, just npm i -g nx
This will auto update your workspace with the following:
You can now delete the migrations.json
file in the root of your workspace as it's no longer needed or you can keep it around as a history of any migrations you've run against your workspace. Either way, doesn't really matter :)
When we first announced plugin workspaces back in September 2020, we stated the core reason was to improve plugin maintenance and updates. Using NxDevTools was somewhat of a no-brainer as it's immensely helpful in managing all sorts of source code. We firmly believed this would help plugin developers manage their plugins with more ease than was previously possible.
We use these plugin workspaces to manage our own suite of plugins, for example:
We updated the workspace in a matter of 2 minutes. This includes a total of currently 19 plugins now all able to build and compile with the latest versions.
This means by running one command: npm run publish-packages
and hitting ENTER, 19 plugins can be built with the latest versions and published to npm automatically.
You can create your own workspace with this official plugin workspace seed which is also covered in the video below...
If you are unfamiliar with this new way to manage NativeScript plugins, check out this super helpful video
If you used the plugin-seed mentioned above from couple months ago it had an explicit --emulator
flag in the demo app run options. You can now remove that by opening workspace.json
and globally doing a search/replace for exactly --emulator
and replace with empty/blank to just remove it. The latest plugin seed no longer has that explicit flag.
We wanted to add a migration for the latest versions first so we can now focus on completing the demo app creation tooling next with all the other frontend flavors (React, Svelte, Vue) so you can test your plugins against any flavor you wish with ease.
The next auto update (migration) will likely become available shortly before the NativeScript 8 release sometime in March.