react-native-template-zhoupu

0.0.12 • Public • Published

react-native-template-zhoupu

舟谱数据react-native模板脚手架

使用

命令行执行

npx react-native init xxx --template react-native-template-zhoupu

修改CodePush配置

  1. 前往appcenter,分别创建iOS、android两个app,并获取code push deployment key
  2. 修改android/app/main/res/values/strings.xml中的CodePushDeploymentKey字段
  3. 修改iOS下Info.plist文件中CodePushDeploymentKey字段

修改BugSnag配置

  1. 前往Bugsnage创建一个新的react-native app,并获取apiKey
  2. 修改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

自定义模板脚手架

  1. 执行执行npx react-native init xxx;
  2. 添加自定义文件;
  3. 新建文件夹,cd到该文件夹执行npm init;
  4. 修改package name字段,命名为react-native-template-xxx;
  5. 将创建的工程拷贝到该文件,重命名为template,移除node-modules;
  6. 新建template.config,配置参考本工程;
  7. 修改version,执行npm publish;

参考:

Package Sidebar

Install

npm i react-native-template-zhoupu

Weekly Downloads

1

Version

0.0.12

License

MIT

Unpacked Size

651 kB

Total Files

89

Last publish

Collaborators

  • john.zhoupu