Skip to content

Commit 28008c2

Browse files
authored
docs(contributing): guidance building single package (#2306)
1 parent 1c23ab7 commit 28008c2

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

CONTRIBUTING.md

+30-4
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,47 @@ yarn --version
8484

8585
If not, please refer to [yarn installation](https://yarnpkg.com/en/docs/install) to install `yarn`.
8686

87-
To install the dependencies and link the library, run the following command:
87+
To install the dependencies and link the library, run the following command under project root:
8888

8989
```
9090
yarn
9191
```
9292

93-
To run all of the tests in the repository, still from the root package, run the following command:
93+
To run all of the tests in the repository, still from the root package, run the following command
94+
under project root:
9495

9596
```
9697
yarn test:all
9798
```
9899

99-
The above command will use Lerna to run the `test` script in every package in the `packages` directory.
100+
The above command will use Lerna to run the `test` script in every package of the monorepo.
100101

101-
To run the tests for a specific package, you can run `yarn test` from within the specified package folder, assuming the above steps have been run.
102+
#### Test a changed package
103+
104+
To run the tests for a specific package, you can run `yarn test` within the
105+
specified package folder.
106+
107+
Alternatively, from the project root, you can run:
108+
109+
```
110+
lerna run test --scope [package name]
111+
```
112+
113+
If `lerna` is not available in your environment, you can install it globally with:
114+
115+
```
116+
npm install -g lerna
117+
```
118+
119+
If you have touched multiple packages and you want to make sure the package
120+
you want to test has picked up all your latest changes in dependencies, you
121+
can build them in one command:
122+
123+
```
124+
lerna run build --scope [package name] --include-dependencies
125+
```
126+
127+
You don't need to run this command if the dependency packages are not changed.
102128

103129
### Generating Service Clients
104130

0 commit comments

Comments
 (0)