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

make-react-native-package

v0.62.18

Published

CLI tool for bootstrapping react-native packages with Kotlin & Swift & Typescript

Downloads

31

Readme

make-react-native-package

npm version CircleCI js-standard-style Dependency Status devDependencies Status npm

CLI tool for bootstrapping react-native packages with Kotlin & Swift & Typescript

About

  • CLI tool:
    • single command to scaffold a monorepo with package itself and ready-to-run example app
    • can create any amount of dummy native components and modules inside same package
    • has multiple component templates
    • versioning doesn't follow 'semver', major and minor numbers match the ones from specific version of react‑native whose project template is used by MRNP
  • Bootstrapped package:
    • supports iOS & Android & react-native ">= 0.60.0"
    • contains (absolutely optional) basic CI setup: CircleCI -> lint & build -> npm
    • has setup instructions for package end-users in generated README.md files
    • includes a Dockerfile for creating a release example .apk in 'neutral' environment

Getting started

$ npx make-react-native-package -p react-native-cool-component --githubUsername cool-github-user

Usage guide

$ npx make-react-native-package --help

Workflow

Installation

Usually no additional steps required after bootstrapping a package. However, if you have skipped dependency installation with --skipInstall option you can setup everything later by running npm run init:package from package root folder.

Development

Generated folder contains the package itself in the root and the sample app inside ./example folder. Example app imports package dependency locally as a file:.. symlink, so all changes inside the root folder will be available for a running app and editors/IDEs immediately.

To watch on Typescript sources changes you have to run npm run watch commands from both root and ./example folders. Most of 'development' commands are located in ./example/package.json scripts section, and watch script from ./package.json probably is the only common 'development' command in the root folder.

To open a project in Xcode go to ./example/ios folder and open .xcworkspace file, package Swift sources should be found inside Pods > Development Pods > {{packageName}} group in project navigator.

To open a project from Android Studio 'welcome to' window press Import project and open ./example/android folder, after gradle sync task completes package Kotlin sources should be found inside {{packageName}} > java group in project tool window.

To build native code and run sample app on device/simulator just use standard react-native 'run' commands or 'run' buttons from Xcode/Android Studio.

Publishing

There are two options: publishing from local machine or publishing from CircleCI.

To publish from a local machine just run npm version <your_package_next_version> && npm publish from package root folder. It will run linters and build Typescript sources in preversion hook and push changes and git tags to a remote repo in postversion hook. Then if everything succeed, the package will be published to npm.

If you have an account on CircleCI you can use it for publishing a package when git tags are being pushed to a remote repo. Note that before enabling your package in CircleCI dashboard you should either ask their support for macOS plan (it is free for open-source projects) or remove test-ios job related code from .circleci/config.yml file. Also you have to set NPM_TOKEN environment variable in CircleCI dashboard project settings - this token can be created directly on npmjs.com or imported from your other CircleCI project. When everything is ready run npm version <your_package_next_version> -m "%s [skip ci]" to initiate just publish job on CircleCI without triggering surplus test-ios & test-android jobs because of master branch changes. It won't only lint sources and build Typescript, but also will check that native code compiles (this can take some time). After both test-ios and test-android jobs succeed the publish job will be triggered.

Created with MRNP

Packages that were bootstrapped with MRNP most likely will contain Bootstrapped with make-react-native-package string marker in their README.md files, so they could be easily found with Github search.

Credits