MCPcopy Index your code
hub / github.com/NervJS/taro-native-shell

github.com/NervJS/taro-native-shell @v0.76.0-1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.76.0-1 ↗ · + Follow
11 symbols 18 edges 11 files 2 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Taro Native Shell

参考文档:Taro React Native 端开发流程 - 分离模式

Taro 原生 React Native 壳工程,和 React Native init 的工程的区别如下:

  1. 集成了 expo
  2. 集成了 Taro 依赖的所有原生库
  3. debug 方式变更: 在 JS 工程中 yarn dev:rn 启动 metro server
  4. release 方式变更: 在 JS 工程中 yarn buid:rn 打包 jsbundle 并通过配置 rn.output 输出到壳工程

该仓库如何生成

  1. 使用 react-native 初始化项目
npx react-native init taroDemo --version 0.73.0
  1. 使用 expo-cli 自动安装 expo
npx install-expo-modules@latest
  1. 修改部分代码以支持 Taro,此部分可以直接 cherry-pick
  2. [scripts] 修改 android, ios 脚本,增加 upgradePeerdeps 脚本
  3. [devDependencies] 增加 install-peerdepspod-install
  4. [ios] 添加相关 APP 权限说明
  5. [ios] 使用亮色主题
  6. [android] 添加国内 maven 源
  7. [android] 添加 gif 支持
  8. [android] 注释原 react native 打包
  9. [android] 使用亮色主题
  10. [docs] 复制该 README.md 文件
  11. [license] 复制 LICENSE 文件

  12. 更新 Taro 需要的依赖(如果还没正式发布,则使用对应的 alpha 或 beta 版本)

yarn
yarn upgradePeerdeps
  1. 添加打包脚本,此部分可以直接 cherry-pick
  2. [fastlane] 添加 Android、iOS fastlane 配置
  3. [actions] 添加 Android、iOS 打包脚本
  4. [ios] 添加默认图标
  5. [ios] 添加 ITSAppUsesNonExemptEncryption false
  6. [ios] 添加 main.jsbundle assets 引用

React Native 小版本更新

https://react-native-community.github.io/upgrade-helper/

Taro 版本更新

使用 Taro 最新版,或者修改 upgradePeerdeps 指定 Taro 版本,再执行:

yarn upgradePeerdeps

Core symbols most depended-on inside this repo

Section
called by 0
App.tsx
App
called by 0
App.tsx
getMainComponentName
called by 0
android/app/src/main/java/com/tarodemo/MainActivity.kt
createReactActivityDelegate
called by 0
android/app/src/main/java/com/tarodemo/MainActivity.kt
getPackages
called by 0
android/app/src/main/java/com/tarodemo/MainApplication.kt
getJSMainModuleName
called by 0
android/app/src/main/java/com/tarodemo/MainApplication.kt
getUseDeveloperSupport
called by 0
android/app/src/main/java/com/tarodemo/MainApplication.kt
onCreate
called by 0
android/app/src/main/java/com/tarodemo/MainApplication.kt

Shape

Method 7
Class 2
Function 2

Languages

Kotlin82%
TypeScript18%

Modules by API surface

android/app/src/main/java/com/tarodemo/MainApplication.kt6 symbols
android/app/src/main/java/com/tarodemo/MainActivity.kt3 symbols
App.tsx2 symbols

For agents

$ claude mcp add taro-native-shell \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact