mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
chore: configure jest to resolve source files for packages
This commit is contained in:
committed by
Satyajit Sahoo
parent
935c588000
commit
fb9d1837a1
@@ -37,12 +37,18 @@ jobs:
|
||||
- attach_workspace:
|
||||
at: ~/project
|
||||
- run: |
|
||||
yarn lerna run prepare
|
||||
yarn test --coverage
|
||||
cat ./coverage/lcov.info | ./node_modules/.bin/codecov
|
||||
- store_artifacts:
|
||||
path: coverage
|
||||
destination: coverage
|
||||
build-packages:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ~/project
|
||||
- run: |
|
||||
yarn lerna run prepare
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
@@ -55,3 +61,6 @@ workflows:
|
||||
- unit-test:
|
||||
requires:
|
||||
- install-dependencies
|
||||
- build-packages:
|
||||
requires:
|
||||
- install-dependencies
|
||||
|
||||
14
README.md
14
README.md
@@ -490,10 +490,10 @@ Unfortunately it's not possible to verify that the type of children elements are
|
||||
|
||||
## Contributing
|
||||
|
||||
The project uses a monorepo structure for the packages managed by [yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) and [lerna](https://lerna.js.org). To get started with the project, run `lerna bootstrap` to install the required dependencies for each package:
|
||||
The project uses a monorepo structure for the packages managed by [yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) and [lerna](https://lerna.js.org). To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
|
||||
|
||||
```sh
|
||||
lerna bootstrap
|
||||
yarn
|
||||
```
|
||||
|
||||
While developing, you can run the [example app](/example/) with [Expo](https://expo.io/) to test your changes:
|
||||
@@ -515,13 +515,7 @@ To fix formatting errors, run the following:
|
||||
yarn lint --fix
|
||||
```
|
||||
|
||||
Remember to add tests for your change if possible. To run tests, first build all the files:
|
||||
|
||||
```sh
|
||||
lerna run prepare
|
||||
```
|
||||
|
||||
Then run the tests:
|
||||
Remember to add tests for your change if possible. Run the tests by:
|
||||
|
||||
```sh
|
||||
yarn test
|
||||
@@ -532,7 +526,7 @@ yarn test
|
||||
To publish a new version, first we need to export a `GH_TOKEN` environment variable as mentioned [here](https://github.com/lerna/lerna/tree/master/commands/version#--create-release-type). Then run:
|
||||
|
||||
```sh
|
||||
lerna publish
|
||||
yarn lerna publish
|
||||
```
|
||||
|
||||
This will automatically bump the version and publish the packages. It'll also publish the changelogs on GitHub for each package.
|
||||
|
||||
@@ -59,7 +59,10 @@
|
||||
},
|
||||
"setupFiles": [
|
||||
"<rootDir>/jest/setup.js"
|
||||
]
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"@react-navigation/([^/]+)": "<rootDir>/packages/$1/src"
|
||||
}
|
||||
},
|
||||
"name": "react-navigation"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
If you want to run the example from the repo,
|
||||
|
||||
- Clone the repository and run `lerna bootstrap` in the root
|
||||
- Clone the repository and run `yarn` in the project root
|
||||
- Run `yarn example start` to start the packager
|
||||
- Follow the instructions to open it with the [Expo app](https://expo.io/)
|
||||
|
||||
Reference in New Issue
Block a user