# fego-rn

> 基于 React Native 的移动开发库

Latest version **0.1.6** (published 2019-03-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install fego-rn
pnpm add fego-rn
yarn add fego-rn
bun add fego-rn
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2019-03-28 |
| First published | 2017-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 598.7 KB |
| Known vulnerabilities | 0 (+27 in 2 direct dependencies) |
| Install scripts | no |
| Author | esky |
| Maintainers | askday, zhaosong |
| Keywords | fego, react, react native, component, components, ui |

## Links

- npm: https://www.npmjs.com/package/fego-rn
- Repository: https://github.com/fegos/fego-rn
- Homepage: https://github.com/fegos/fego-rn#readme
- Issues: http://github.com/fegos/fego-rn/issues
- npm.io page: https://npm.io/package/fego-rn

## Dependencies (6)

- [axios](https://npm.io/package/axios.md) ^0.17.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [socket.io](https://npm.io/package/socket.io.md) ^1.7.3
- [react-static-container](https://npm.io/package/react-static-container.md) ^1.0.1
- [react-native-collapsible](https://npm.io/package/react-native-collapsible.md) ^0.9.0
- [babel-plugin-module-resolver](https://npm.io/package/babel-plugin-module-resolver.md) ^3.0.0

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@mesalvo/react-ui](https://npm.io/package/@mesalvo/react-ui.md) — 1.7K weekly downloads

## Recent versions

- 0.1.6 (latest) — 2019-03-28
- 0.1.5 — 2019-03-28
- 0.1.4 — 2019-03-04
- 0.1.3 — 2018-06-13
- 0.1.2 — 2018-06-05
- 0.1.1 — 2018-05-07
- 0.1.0 — 2018-04-18
- 0.0.6 — 2018-03-20
- 0.0.5 — 2018-03-15
- 0.0.4 — 2017-12-26
- 0.0.3 — 2017-12-26
- 0.0.2 — 2017-12-26
- 0.0.1 — 2017-12-20

## README

# fego-rn
- React Native 组件库

### 项目介绍
- 基于 React Native 的移动开发库
- 提供 ios 和 android 两端的平台支持
- 仅限 UI 组件和 Util 组件, 不涉及原生组件

### 支持平台
- ios
- android

### 设计原则
- 组件命名以使用驼峰形式且首字母大写，例如：`ActivityIndicator`
- 若无特殊情况组件不区分 ios 和 android 平台，统一为 `SomeComponent/index.js`, 不带 ios 或 android 后缀
- API 设计规范[详见](components/README.md)
- 组件样式[详见](components/ui/STYLE.md)


### 目录结构

```
  .
  ├── __tests__                       # 组件单元测试目录
  │   ├── enzyme.setup.js             # enzyme 启动配置文件
  ├── components                      # 组件源码
  │   ├── common                      # 通用类
  │   ├── util                        # util 组件
  │   ├── ui                          # ui 组件
  │   ├── index.js                    # 入口文件
  │   ├── patch.js                    # 补丁文件
  │   ├── README.md                   # 关于组件的说明
  │   └── STYLE.md                    # 关于样式的说明
  ├── demo                            # demo 示例
  │   ├── android                     # android 工程
  │   ├── app                         # demo 源码
  │   └── ios                         # ios 工程
  ├── site                            # 组件文档站点的目录
  │   ├── build                       # bisheng 编译输出文件夹
  │   ├── theme                       # bisheng 主题文件夹
  │   └── bisheng.onfig.js            # bisheng 配置文件
  ├── .babel                          # babel 配置
  ├── jest.config.js                  # jest 测试配置文件
  └── package.json                    # 项目描述文件
```

### 开发

1.安装依赖

  ```bash
  $ npm run init
  ```

2.运行 demo包服务

  ```bash
  $ npm run start

  ```

3.运行 模拟器

> xcode 或 Android Studio 中点击 `RUN` 运行项目即可
`或者使用下面的命令`

  ```bash
  # ios 端
  $ npm run ios

  # Android 端
  $ npm run android
  ```

4.启动假数据服务

  ```bash
  $ npm run mock
  ```

5.进行单元测试

  ```bash
  $ npm run test

  # 更新 snapshot
  $ npm run test -- -u
  ```

6.启动站点服务

  ```bash
  $ npm run site
  ```

### 使用

1.安装

  ```bash
  $ npm install fego-rn --save
  ```

2.应用

  ```js
  // MyPage.js
  import { Button } from 'fego-rn'

  class MyPage extends React.Component {
    render(){
      return(
        <View>
          {/* your code */}
          <Button type='primary' title='我是一个button' />
        </View>
      )
    }
  }
  ```

#### *注意*
- 组件，如 `Popup`, `Toast` 等都是依赖 `AppContainer` 设计的，因此在使用 fego-rn 时请使用 `AppContainer` 对应用进行包装
  ```js
  import { AppContainer } from 'fego-rn'
  AppRegistry.registerComponent('App', () => AppContainer.setApp(App) )
  ```

### 常见问题

#### 启动服务后报错 `Error watching file for changes: EMFILE`

Mac升级后watchman不可用了，需要重装watchman。
+ 第一种解决方案：
  - 卸载: brew uninstall --force watchman
  - 删除文件: rm -rf /usr/local/var/run/watchman/
  - 重装: brew install watchman
+ 第二种解决方案: 来自官方：https://facebook.github.io/watchman/docs/install.html


### 欢迎贡献
有任何疑问或问题欢迎在[github issues](https://github.com/fegos/fego-rn/issues)里提问

---
_Source: https://npm.io/package/fego-rn · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
