React Native Extended StyleSheet 使用教程
1. 项目的目录结构及介绍
react-native-extended-stylesheet/
├── src/
│ ├── index.js
│ └── ...
├── types/
│ └── index.d.ts
├── package.json
├── README.md
└── ...
- src/: 包含项目的主要源代码文件。
- index.js: 项目的入口文件。
- types/: 包含 TypeScript 类型定义文件。
- index.d.ts: TypeScript 类型定义文件。
- package.json: 项目的配置文件,包含依赖、脚本等信息。
- README.md: 项目的说明文档。
2. 项目的启动文件介绍
项目的启动文件位于 src/index.js
。这个文件是 React Native Extended StyleSheet 的入口点,负责导出主要的 API 和功能。
// src/index.js
import EStyleSheet from './EStyleSheet';
export default EStyleSheet;
3. 项目的配置文件介绍
项目的配置文件是 package.json
,它包含了项目的依赖、脚本、版本等信息。
{
"name": "react-native-extended-stylesheet",
"version": "0.12.0",
"description": "Extended StyleSheets for React Native",
"author": {
"name": "Vitaliy Potapov",
"email": "noginsk@rambler.ru"
},
"main": "src/index.js",
"types": "types/index.d.ts",
"scripts": {
"code": "npm run lint",
"lint": "eslint src",
"test": "jest --onlyChanged",
"tt": "jest --coverage",
"tr": "BABEL_ENV=runtyper jest --no-cache",
"test:types": "tsc",
"ci": "run-s code tt tr test:types",
"sync-yarn-lock": "rm yarn.lock && yarn import && git add -A yarn.lock && (git diff-index --quiet HEAD -- yarn.lock || git commit -m'sync yarn.lock' --no-verify)",
"coveralls": "coveralls <"
},
"dependencies": {
// 依赖列表
},
"devDependencies": {
// 开发依赖列表
}
}
- name: 项目名称。
- version: 项目版本。
- description: 项目描述。
- author: 项目作者信息。
- main: 项目入口文件。
- types: TypeScript 类型定义文件。
- scripts: 项目脚本命令。
- dependencies: 项目依赖。
- devDependencies: 开发依赖。