Giter Site home page Giter Site logo

awesomeproject's Introduction

ywl

开发环境配置

请参考: http://reactnative.cn/docs/0.51/getting-started.html

除此之外,还需安装 android ndk。android ndk 下载地址: https://developer.android.google.cn/ndk/downloads/ (目前先下载最新的版本,最新版在 android 6.0 以上验证可行。后续测试中如果发现不支持 android 6.0 以下,我再通知大家更换其他版本。)

下载完成后,需要新增 ndk 环境变量: 变量名:ANDROID_NDK_HOME 变量值:D:\android-ndk-r17b(请修改为你自己的安装路径)

在 ywl/android 路径下的 local.properties 文件中(如果没有,需新建),新增: sdk.dir=D:\AndroidSDK(请修改为你自己的安装路径,这一行如已存在,请无视) ndk.dir=D:\android-ndk-r17b(请修改为你自己的安装路径)

运行

  1. 首先 clone 本代码仓库
  2. 在 clone 好的目录中运行yarn
  3. 运行react-native run-android或是react-native run-ios

编辑器配置

建议使用Visual Studio Code并安装如下插件:

  • ESlint (用于统一代码风格)
  • Flow Language Support (用于支持 Flow 类型标注语法)
  • Prettier - Code formatter (用于自动修正代码风格)
  • React Native Tools (RN 开发辅助工具)
  • colorize (颜色标注)
  • Gitlens (git 工具)

同时在 USER SETTING 中添加以下配置:

"files.autoSave": "afterDelay",
"editor.formatOnSave": true,
"prettier.eslintIntegration": true,
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false,
"colorize.languages": [
    "javascript"
],
"colorize.files_extensions": [
    ".js"
],

目录结构说明

actions         redux actions
components      可复用的组件
constants       一些全局引用的常量
database        Realm数据库
docs            接口文档
i18n            多语言文件
images          全局可复用的图片(components和screens内可能也有images目录)
reducers        redux reducers
sagas           redux sagas
screens         全屏页面
store           redux store配置
types           Flowtypes标记
utils           工具模块
web-native      web端的一些适配代码

文件命名规则

  1. 如果文件默认导出的是 React 组件,则以大写字母开头,如Link.js.
  2. 除 1 以外的文件皆以小写字母开头.
  3. 如果某文件负责导出此文件所在目录的所有其他模块,则其名字和目录名相同。如components/components.js.

测试文件重置

awesomeproject's People

Contributors

elf9237 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.