@azsxdc12356/react-native-template-multi-country
v1.0.3
Published
React Native template for multi-country deployment with anti-association architecture
Maintainers
Readme
@azsxdc12356/react-native-template-multi-country
React Native 模板脚手架,用于构建多国家独立部署的 Android App。
通过 Android product flavors + 独立 JS 入口,每个国家拥有独立的 applicationId、App 名称、图标和 JS bundle,起到防关联的效果。
核心特性
- 防关联 — 每个国家的 applicationId以及内部的类可以完全无关
- 构建时区分 — Gradle 单数据源驱动 product flavors 和 JS bundle 入口
- import 边界防护 — ESLint 自定义规则 + pre-commit hook
- 一键添加/移除国家 — 脚手架脚本自动生成完整骨架
安装
npx react-native init MyApp --template @azsxdc12356/react-native-template-multi-country快速开始
cd MyApp
yarn install
yarn init-country # 交互式初始化:设置 Android 包名 + 添加首个国家
yarn start
npx react-native run-android --variant <country>Debug添加国家
yarn add-country或手动:
node scripts/add-country.js <country-code> <application-id> <activity-class-name> [app-name] [api-base-url] [default-locale] [--package com.xxx.xxx]License
MIT
