Auto update your plugin workspace with a few keystrokes


You can now update your plugin workspaces to all the latest dependency versions with a few keystrokes:

  1. nx migrate @nativescript/plugin-tools

  2. npm install

  3. nx migrate --run-migrations=migrations.json

  4. 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:

  • @nativescript/core 7.2+,
  • @nativescript/ios 7.2+ for all demo apps
  • @nativescript/webpack 4.1+ including latest webpack.config.js for all demo apps
  • @nativescript/types 7.2+,
  • Angular 11.2+, etc.)
  • ...and other tooling updates like being powered by Nx 11.3+ latest.

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 :)

We updated ours in 2 minutes

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.

Plugin workspace seed

You can create your own workspace with this official plugin workspace seed which is also covered in the video below...

Watch a video overview

If you are unfamiliar with this new way to manage NativeScript plugins, check out this super helpful video

Common Questions?

  • How can I run my demo apps in the workspace against a connected device?

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.

See more here

What's next?

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.

Comments


Comments are disabled in preview mode.
NativeScript is licensed under the Apache 2.0 license
© 2020 All Rights Reserved.