tralves / plugins

Official @nativescript plugins.

Home Page:https://docs.nativescript.org/plugins/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@nativescript/* plugins

npm run setup
npm start

How to use?

This workspace manages the suite of plugins listed above.

Prerequisites

  • Node 18+ is recommended
  • yarn v1 is required

Note about "focus modes"

npm start > focus.{any-plugin} ENTER will focus the workspace to a single plugin for working on it in isolation.

Generally we try to keep "UI" plugins away from "SDK" related plugins since UI plugins often bring in aspects which may need more resource setup. For example, since the swift-ui plugin is currently managed here, we have testing code for it here: https://github.com/NativeScript/plugins/blob/main/tools/assets/App_Resources/iOS/src/BasicViewProvider.swift ... however when focusing on any other plugins, you would need to rename those .swift > .off so they aren't included in the demo to work with other plugins. Since the supporting .swift files include SwiftUIProvider which comes from only the swift-ui plugin. To help contributors in the future, we will likely split some of these plugins out across other workspaces to pair it down. For now that tip can be applied where needed to work on any plugin.

In general, when in doubt with what to do, just npm start.

npm run setup
npm start

// Ensure all plugins build properly first
> type "build-all" (and hit ENTER)

If you don't build all the plugins, you will at least need to build localize to run the demos because it contains hooks that need to be built first.

If building only localize, type: npm start > localize (this will narrow down menu to @nativescript.localize.build) and then hit 'enter'. You can now run the demo apps.

In general, when in doubt with what to do, just npm start.

How to add a new package to workspace?

npm run add

At the prompt, enter the name of the new package.

  • This adds a plugin harness in packages with the necessary boilerplate to just start developing
  • Updates all demo app flavors to support demoing the new package
  • Adds shared code in tools/demo where you can write demo code once and share across all demo flavors
  • Updates build tooling to support the new package
  • Updates the npm start interactive display
  • Updates the README here to list the new package

How to add Angular compatibility to a package

npm run add-angular

At the prompt, enter the name of the package to add an angular folder to it with the necessary boilerplate to provide Angular support to the package.

How to focus on just 1 package to develop in isolation

npm start
  • Choose the focus commands for the package you wish to focus on and hit enter.
  • All the demo app's will be updated to isolate that 1 package and for supported IDE's (currently VS Code), the source code will also become isolated in the workspace.

Note: good to always clean the demo you plan to run after focusing. (You can clean any demo from npm start as well)

How to publish packages?

npm run publish-packages
  • You will be prompted for the package names to publish. Leaving blank and hitting enter will publish them all.
  • You will then be prompted for the version to use. Leaving blank will auto bump the patch version (it also handles prerelease types like alpha, beta, rc, etc. - It even auto tags the corresponding prelease type on npm).
  • You will then be given a brief sanity check 🧠😊

Made with ❤️

About

Official @nativescript plugins.

https://docs.nativescript.org/plugins/index.html

License:Apache License 2.0


Languages

Language:JavaScript 78.7%Language:TypeScript 16.8%Language:Swift 1.5%Language:Objective-C 1.0%Language:Java 0.9%Language:Kotlin 0.6%Language:HTML 0.5%Language:Shell 0.0%Language:SCSS 0.0%Language:Ruby 0.0%