npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rn-tms

v1.4.2

Published

React Native Turbo Module Scaffold - utility for creating templates for turbo modules and factory components for React Native

Downloads

7

Readme

RN-TurboModuleScaffold

Utility for creating templates for turbo modules and factory components for React Native

Features

  • React Native 0.68 +
  • Generation of templates for turbo modules and factory components with one command
  • Java and Kotlin support for Android development
  • Obc-C support for IOS development
  • C++ crossplatform modules support (Turbo modules only)
  • Generating of backward compatible modules and components

Instalation

npm i rn-tms --save-dev

or

yarn add rn-tms --dev

Usage

Basics

In app directory run this command and answer a few questions

RTN stands for "React Native", and is a recommended prefix for React Native modules.

yarn rn-tms make RTN_MODULE_NAME

After its execution, a directory with files for native platforms and a js part will be generated in work directory.

Initially, the basic implementations of the turbo module or factory component are generated, which you can find in the react native documentation (calculator module with defined and implemented function OR simple native centred text component). At this point, you can start developing your native turbo module or factory component by modifying the files generated with rn-tms. For use module or component localy, follow this guide.

Recomended workflow

To improve the quality of module development, it is recommended to use the appropriate IDE platforms (Xcode, Android Studio).

After generating the module template, create a new React Native application in the project directory using the command:

npx react-native init example

When the application is successfully created, add the module to the example app dependencies

cd example && yarn add ../

Then edit the NativeProps interface for Fabric Components or Spec for Turbo Modules, adding the declarations of the functions and properties that you want to pass to native code.

After editing the properties, you must run React Native Codegen manually to generate interfaces to implement properties and methods on the native side.

Here are the commands that you need to execute to start Codegen.

Now you can open the required IDE, open the example project (./example/android/app for example), wait for the content to be indexed, select your module in the external libraries list or the Pods list and start implementing the module logic in native code.

Synchronization

To synchronize the contents of node_modules with the project directory, use the following command:

  • Android:
yarn rn-tms sync RTN_MODULE_NAME --android
  • IOS:
yarn rn-tms sync RTN_MODULE_NAME --ios

If you deviate from the proposed workflow, you can additionally specify the path to the directory where the module was added to the dependencies by running the command:

yarn rn-tms sync RTN_MODULE_NAME --android --path=/Users/<username>/<application_dir>