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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rnapp-create

v1.0.2

Published

A modular CLI toolkit for React Native projects

Readme

rnapp-create

一个可模块化组合的 React Native 项目脚手架 CLI:初始化新项目、按需添加能力模块,并基于 app.json 同步原生配置(应用名、图标、版本等)。

功能

  • init <AppName>:基于官方 RN CLI 创建项目,并可交互选择要安装的模块
  • add <feature>:在已有 RN 项目中按需追加模块
  • sync:基于 app.json 同步原生信息与图标资源

环境要求

  • Node.js:>= 18
  • macOS:仅当你使用 --pod 时需要(会执行 CocoaPods 相关安装)

安装

  • 直接使用(推荐)
npx rnapp-create@latest init MyApp
  • 全局安装
npm i -g rnapp-create
rnapp-create init MyApp

使用

初始化新项目

npx rnapp-create@latest init MyApp

可选参数:

# 初始化后自动执行 npm install
npx rnapp-create@latest init MyApp --install

# macOS:初始化后执行 pod install
npx rnapp-create@latest init MyApp --pod

# CI/非交互模式:默认全选所有模块(也可通过 CI=true 触发)
npx rnapp-create@latest init MyApp --yes
npx rnapp-create@latest init MyApp -y

给已有项目添加模块

在 RN 项目根目录执行:

npx rnapp-create@latest add <feature>

已支持的 feature

  • alias:路径别名(@/
  • tailwind:NativeWind v4 + Reanimated
  • web:React Native Web + Vite
  • router:路由(react-native-router-dom,react-router-dom 风格 API)
  • i18n:多语言
  • store:状态管理(Hox)
  • system-ui:系统 UI 能力
  • assets:内置字体/图标资产,并生成同步脚本

多数模块只会修改配置文件与 package.json 依赖声明,依赖安装需你自行执行:

npm install --legacy-peer-deps

同步原生配置(sync)

在 RN 项目根目录执行:

npx rnapp-create@latest sync

sync 会读取项目根目录的 app.json 并同步:

  • Android:app_nameapplicationIdversionCodeversionNameusesCleartextTraffic、图标(含 adaptive icon)
  • iOS:CFBundleDisplayNamePRODUCT_BUNDLE_IDENTIFIERMARKETING_VERSIONCURRENT_PROJECT_VERSION、图标

app.json 关键字段(最少需要 displayName):

{
  "displayName": "My App",
  "version": "1.0.0",
  "buildNumber": "1",
  "icon": "./src/assets/app-icons/icon.png",
  "iconScale": 0.78,
  "ios": {
    "bundleIdentifier": "com.example.myapp",
    "buildNumber": "1",
    "icon": "./src/assets/app-icons/icon.png"
  },
  "android": {
    "applicationId": "com.example.myapp",
    "versionCode": 1,
    "usesCleartextTraffic": false,
    "icon": "./src/assets/app-icons/icon.png",
    "roundIcon": "./src/assets/app-icons/icon.png",
    "adaptiveIcon": {
      "foregroundImage": "./src/assets/app-icons/adaptive-icon.png",
      "backgroundColor": "#ffffff",
      "foregroundScale": 0.6,
      "backgroundScale": 1
    }
  }
}

如果你安装了 assets 模块,会在项目中注入脚本:

npm run sync

它等价于:

npx rnapp-create sync && react-native-asset

本仓库调试

在仓库根目录直接运行:

node scripts/cli.js
node scripts/cli.js init MyApp
node scripts/cli.js add router
node scripts/cli.js sync

发布(维护者)

发包前建议先确认实际会被发布的文件:

npm pack --dry-run

如果发现 DemoApp/ 等目录也被打进包里,建议在 package.json 增加 files 白名单或添加 .npmignore 进行排除。

发布流程示例:

npm login
npm version patch
npm publish --access public