mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-18 12:49:24 +00:00
Change development scripts
Switch to npm-workspaces monorepo task management.
This commit is contained in:
+30
-48
@@ -14,94 +14,76 @@ Fork, then clone the repo:
|
||||
git clone https://github.com/your-username/react-native-web.git
|
||||
```
|
||||
|
||||
Install dependencies (requires [yarn](https://yarnpkg.com/en/docs/install)):
|
||||
Install dependencies (requires Node.js >= 14.0):
|
||||
|
||||
```
|
||||
yarn
|
||||
npm install
|
||||
```
|
||||
|
||||
## Automated tests
|
||||
## Build
|
||||
|
||||
To run the linter:
|
||||
Build a specific package:
|
||||
|
||||
```
|
||||
yarn lint
|
||||
npm run build -w <package-name>
|
||||
```
|
||||
|
||||
To run flow:
|
||||
For example, this will build `react-native-web`:
|
||||
|
||||
```
|
||||
yarn flow
|
||||
npm run build -w react-native-web
|
||||
```
|
||||
|
||||
To run the unit tests:
|
||||
Build all packages that can be built:
|
||||
|
||||
```
|
||||
yarn jest
|
||||
npm run build
|
||||
```
|
||||
|
||||
…in watch mode:
|
||||
## Develop
|
||||
|
||||
Develop a specific package:
|
||||
|
||||
```
|
||||
yarn jest --watch
|
||||
npm run dev -w <package-name>
|
||||
```
|
||||
|
||||
To run all these automated tests:
|
||||
For example, this command will watch and rebuild the `react-native-web` package:
|
||||
|
||||
```
|
||||
yarn test
|
||||
npm run dev -w react-native-web
|
||||
```
|
||||
|
||||
## Compile and build
|
||||
|
||||
To compile the `react-native-web` source code:
|
||||
And this command will watch and rebuild the `react-native-web-examples` package:
|
||||
|
||||
```
|
||||
yarn compile
|
||||
npm run dev -w react-native-web-examples
|
||||
```
|
||||
|
||||
…in watch mode:
|
||||
## Test
|
||||
|
||||
Run the monorepo linter:
|
||||
|
||||
```
|
||||
yarn compile --watch
|
||||
npm run lint
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
To run the documentation website:
|
||||
Run the monorepo type checker:
|
||||
|
||||
```
|
||||
yarn docs
|
||||
npm run flow
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
To run the examples app:
|
||||
Run the monorepo unit tests:
|
||||
|
||||
```
|
||||
yarn examples
|
||||
npm run unit
|
||||
```
|
||||
|
||||
When you're also making changes to the 'react-native-web' source files, run this command in another process:
|
||||
Run all the automated tests:
|
||||
|
||||
```
|
||||
yarn compile --watch
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
To run the benchmarks locally:
|
||||
|
||||
```
|
||||
yarn benchmarks
|
||||
open ./packages/benchmarks/dist/index.html
|
||||
```
|
||||
|
||||
To develop against these benchmarks:
|
||||
|
||||
```
|
||||
yarn compile --watch
|
||||
yarn benchmarks --watch
|
||||
npm run test
|
||||
```
|
||||
|
||||
### New Features
|
||||
@@ -115,7 +97,7 @@ Please open an issue with a proposal for a new feature or refactoring before sta
|
||||
1. Fork the repository and create your branch from `master`.
|
||||
2. If you've added code that should be tested, add tests!
|
||||
3. If you've changed APIs, update the documentation.
|
||||
4. Ensure the tests pass (`yarn test`).
|
||||
4. Ensure the tests pass (`npm run test`).
|
||||
|
||||
You should see a pre-commit hook run before each commit. If it does not, you may need to reset you Git hookspath:
|
||||
|
||||
@@ -136,11 +118,11 @@ Thank you for contributing!
|
||||
To commit, publish, and push a final version:
|
||||
|
||||
```
|
||||
yarn release <version>
|
||||
npm run release -- <version>
|
||||
```
|
||||
|
||||
Release candidates or versions that you'd like to publish to npm, but do not want to produce a commit and push it to GitHub:
|
||||
|
||||
```
|
||||
yarn release <version> --skip-git
|
||||
npm run release -- <version> --skip-git
|
||||
```
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: necolas/compressed-size-action@master
|
||||
with:
|
||||
build-script: "compile"
|
||||
build-script: "build -w react-native-web"
|
||||
exclude: "./packages/react-native-web/dist/cjs/{index.js,**/*.js}"
|
||||
pattern: "./packages/react-native-web/dist/{index.js,**/*.js}"
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
@@ -13,9 +13,8 @@ jobs:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: npm install
|
||||
# Install next-tagged versions
|
||||
- run: yarn upgrade react@next react-dom@next -W --dev
|
||||
- run: npm update react@next react-dom@next
|
||||
# Only run the unit tests
|
||||
- run: yarn jest
|
||||
- run: npm run unit
|
||||
|
||||
@@ -15,9 +15,8 @@ jobs:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: yarn fmt:report
|
||||
- run: npm install
|
||||
- run: npm run format
|
||||
|
||||
type-check:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -26,9 +25,8 @@ jobs:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: yarn flow
|
||||
- run: npm install
|
||||
- run: npm run flow
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -37,9 +35,8 @@ jobs:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: yarn lint:report
|
||||
- run: npm install
|
||||
- run: npm run lint
|
||||
|
||||
unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -48,6 +45,5 @@ jobs:
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- run: npm install -g yarn
|
||||
- run: yarn install
|
||||
- run: yarn jest
|
||||
- run: npm install
|
||||
- run: npm run unit
|
||||
|
||||
Reference in New Issue
Block a user