diff --git a/.circleci/config.yml b/.circleci/config.yml index 1f7a6f55..8af40544 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/README.md b/README.md index 30f7b5d9..ecbf3ca6 100644 --- a/README.md +++ b/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. diff --git a/package.json b/package.json index b90528e3..391cec24 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,10 @@ }, "setupFiles": [ "/jest/setup.js" - ] + ], + "moduleNameMapper": { + "@react-navigation/([^/]+)": "/packages/$1/src" + } }, "name": "react-navigation" } diff --git a/packages/example/README.md b/packages/example/README.md index 6c0d2f57..4a0e744a 100644 --- a/packages/example/README.md +++ b/packages/example/README.md @@ -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/)