舟谱数据react-native模板脚手架
npx react-native init xxx --template react-native-template-zhoupu
- 前往appcenter,分别创建iOS、android两个app,并获取code push deployment key
- 修改
android/app/main/res/values/strings.xml
中的CodePushDeploymentKey
字段 - 修改iOS下
Info.plist
文件中CodePushDeploymentKey字段
- 前往Bugsnage创建一个新的react-native app,并获取apiKey
- 修改
src/utils/bugsnag.ts
文件中configuration.apiKey
字段
.
├── App.js
├── app.json
├── babel.config.js babel配置文件
├── doc 文档文件夹,补充说明文档
│ └── example.md
├── index.js
├── metro.config.js
├── package-lock.json
├── package.json
├── android
├── ios
├── src 源码文件夹
│ ├── assets 静态文件
│ ├── components 公共组件,无关业务
│ │ └── Alert.tsx
│ ├── constants 全局常量
│ │ └── route.ts
│ ├── core 核心数据、业务
│ │ └── index.ts
│ ├── pages 页面文件夹
│ │ ├── login 模块名称
│ │ │ ├── components 私有组件
│ │ │ │ └── Form.tsx
│ │ │ ├── Login.tsx 页面
│ │ │ └── stores
│ │ │ │ └── store.ts 私有store
│ │ │ └── services
│ │ │ └── service.ts 业务处理
│ │ └── profile
│ │ ├── components
│ │ │ └── Info.tsx
│ │ └── Profile.tsx
│ ├── services 通用业务处理文件夹
│ │ └── goods.ts
│ ├── stores 全局
│ │ └── user.ts 全局共享store
│ └── utils 工具类
│ └── request.ts
├── __tests__
│ └── App-test.js
└── yarn.lock
- doc文档文件
- src源码文件
- TypeScript
- mobx
- axios
- @react-navigation
- @zhoupu/money
- react-native-code-push
- bugsnag-react-native
- 执行
执行npx react-native init xxx
; - 添加自定义文件;
- 新建文件夹,cd到该文件夹执行npm init;
- 修改package name字段,命名为
react-native-template-xxx
; - 将创建的工程拷贝到该文件,重命名为template,移除node-modules;
- 新建template.config,配置参考本工程;
- 修改version,执行npm publish;
参考: