Skip to content

Commit b9cb10f

Browse files
jayantkJayant Krishnamurthy
andauthored
add lerna to readme (#642)
Co-authored-by: Jayant Krishnamurthy <[email protected]>
1 parent 3106ade commit b9cb10f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ The checks are also performed in the CI to ensure the code follows consistent fo
5959

6060
Integration tests run in Tilt (via the `tilt ci` command). The Tilt CI workflow requires approval from a member of the Pyth team. If you are a member, click on "Details" next to the "Workflow / ci-pyth-crosschain" check in a pull request, and then on the "Resume" button on the workflow page.
6161

62+
### Typescript Monorepo
63+
64+
All of the typescript / javascript packages in this repository are part of a lerna monorepo.
65+
This setup allows each package to reference the current version of the others.
66+
You can install dependencies using `npm ci` from the repository root.
67+
You can build all of the packages using `npx lerna run build` and test with `npx lerna run test`.
68+
69+
Lerna has some common failure modes that you may encounter:
70+
71+
1. `npm ci` fails with a typescript compilation error about a missing package.
72+
This error likely means that the failing package has a `prepare` entry compiling the typescript in its `package.json`.
73+
Fix this error by moving that logic to the `prepublishOnly` entry.
74+
1. The software builds locally but fails in CI, or vice-versa.
75+
This error likely means that some local build caches need to be cleaned.
76+
The build error may not indicate that this is a caching issue, e.g., it may appear that the packages are being built in the wrong order.
77+
Delete `node_modules/`, `lib/` and `tsconfig.tsbuildinfo` from each package's subdirectory. then try again.
78+
6279
## Audit / Feature Status
6380

6481
**This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or

0 commit comments

Comments
 (0)