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

react-native-tinker-cli

v1.7.0

Published

cli for noah-system, react native hot update server

Downloads

20

Readme

react-native-tinker-cli

React Native热更新系统的配套发版命令行,配合 tinker-system 使用

用户直接在本地的react native源代码目录中,通过本命令可以和 tinker-system后台交互,执行基本的登录、登出、发版等功能。

注意tinker命令,都 必须 在你的 RN源代码根目录执行!!

安装

$ npm i -g react-native-tinker-cli

环境配置

使用 tinker-system时,推荐的方式是,开发/测试使用的热更新版本,只部署在公司内网;生产环境,单独部署一份线上服务。这样会有一个问题,调用cli命令时,都会涉及到cli是和哪一个后台系统交互。因此,我们在 cli 里,加了个所谓的 环境(env) ,其实就是 1个环境,对应1个 .json 配置文件,放在 当前命令执行的目录 下,在调用 cli 时,明确指定是在和哪个 env 交互。

某个环境的配置文件名,规则如下:.tinker.${envName}.json

单个环境配置如下:

{
    "server": "http://tinker.somecompany.com"
}

登录

tinker login --env ${envName}

登出

tinker logout --env ${envName}

查看有写权限的APP列表

tinker apps --env ${envName}

发布新版本

tinker publish --env ${envName} --appKey ${appKey} --appVersion "${native对应版本}" --desc "本次发版描述"

注意: 发版后,请登录后台系统,查看本次发版任务是否成功。在任务成功的情况下,目前,默认全量包,不会 对外开放,防止由于误操作或代码bug等,引起线上问题。建议 线上 环境,先通过 abTest 配置项,灰度发布,确认没问题之后,再打开全量发布。

目前发版,是在本地RN源代码根目录,将源码打包之后,发送给Noah后台,因此,需要指定,本地源码目录里,那些文件、目录是需要忽略的,通过配置 .tinkerignore 文件,来指定具体规则,配置语法同 .gitignore,下面是一个.tinkerignore文件内容示例:

node_modules
dist
.idea
npm-debug.log
.git
.tinker.*.json
doc
README.md

下载最新全量包

iOSAndroid 下,传的参数不同。

  • iOS 下:tinker download --env ${envName} --appKey "${appKey}" --appVersion "${native对应版本}" --iosDest "全量包解压后目录"
  • Android 下:tinker download --env ${envName} --appKey "${appKey}" --appVersion "native对应版本" --androidAssets "assets目录,存放代码bundle" --androidRes "res目录,存放图片资源"

示例:

# iOS 下
tinker download --env local --appKey "63445762-3aed-4c44-836a-ad9b16e3aae7" --appVersion "5.7.2"  --iosDest "./ios_output"

# Android 下
tinker download --env local --appKey "63445762-3aed-4c44-836a-ad9b16e3aae7" --appVersion "5.7.2" --androidAssets "./temp_assets/" --androidRes "./temp_res/" 

上面的命令,都会让用户再次确认,要下载的APP信息和native版本,是否OK;如果要跳过确认步骤,可以在命令行中加上 --confirm 参数