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

@taole_rn/rn-common

v0.3.16

Published

陶乐RN公共组件库

Readme

rn_common

rn_common 是 RN 公共基础库,存放稳定复用能力:

  • 公共 UI 组件 (不经常修改的)
  • 通用类型与工具函数
  • 可沉淀的基础能力(如统计、APM、网络基础封装)

环境准备

nvm use
yarn install

建议 Node 版本与 .nvmrc 保持一致。 v24.12.0

开发流程

  1. src/ 下新增或修改组件/工具。
  2. src/index.ts 统一导出对外 API。
  3. 本地执行检查与构建:
yarn typecheck
yarn build

目录结构

rn_common/
  src/
    components/         # 组件
    utils/              # 工具
    index.ts
  dist/                 # 构建产物(发布目标)
  package.json
  tsconfig.json
  README.md

构建与发布策略

本仓库采用“只发布构建产物”的策略:

  • package.jsonmain/module/types/react-native 指向 dist/*
  • files 只包含 dist
  • prepublishOnly 自动执行 yarn build

构建命令:

yarn build

发布前检查

npm whoami
yarn typecheck
yarn build
npm pack --dry-run

npm pack --dry-run 重点确认 tarball 中只有 dist/*(以及 npm 默认元文件,如 package.jsonREADME.md)。

发布到 npmjs

首次发布 scoped 包需带 --access public

npm publish --access public

如果版本已存在,先升级版本再发布:

npm version patch
npm publish --access public

2FA / Token 常见错误(E403)

如果报错:

Two-factor authentication or granular access token with bypass 2fa enabled is required

说明当前发布身份不满足权限:

使用 Granular Access Token(推荐 CI)

  1. 在 npm 网站创建 granular token。
  2. 给该 scope/package 开启 publish 权限。
  3. 开启 bypass 2FA(用于发布)。
  4. 本地配置 token:
npm config set //registry.npmjs.org/:_authToken=YOUR_TOKEN
npm publish --access public

给业务仓接入(rn_shove 示例)

本地联调:

"@taole_rn/rn-common": "file:../rn_common"

发布版本接入:

"@taole_rn/rn-common": "^0.1.0"

在 rn_common 下已执行:

yarn typecheck(tsc --noEmit) yarn build(rimraf dist + tsc)

修改版本号

package.json 修改版本号 src/index.ts 修改 commonVersion