Drop lerna - #4258
Conversation
| "packages/validator", | ||
| "packages/flare", | ||
| "packages/fork-choice", | ||
| "packages/beacon-node", |
There was a problem hiding this comment.
This hardcoded list is sorted topologically. Yarn v1 does not support topological inference out of the box, so this does the trick. Long term we can switch to newer versions of yarn that do this automatically.
| "test": "yarn test:unit && yarn test:e2e", | ||
| "test:unit": "nyc --cache-dir .nyc_output/.cache -e .ts mocha 'test/unit/**/*.test.ts'", | ||
| "check-readme": "typescript-docs-verifier" | ||
| "test:e2e": "echo 'n/a'" |
There was a problem hiding this comment.
yarn v1 workspace run util requires all packages to have the script declared
| "pretest": "yarn run check-types", | ||
| "test": "yarn test:unit && yarn test:e2e", | ||
| "test:unit": "nyc --cache-dir .nyc_output/.cache -e .ts mocha 'test/unit/**/*.test.ts'", | ||
| "check-readme": "typescript-docs-verifier" |
There was a problem hiding this comment.
CI only items like check-readme, coverage and build:typedocs and handled by other scripts only meant for CI
|
|
||
| for d in $WORKSPACE_DIR/* ; do | ||
| (cd "$d" && eval "$@") | ||
| done |
There was a problem hiding this comment.
lerna exec <cmd> implemented in 3 lines of bash
| // Set monorepo version to `1.1.0` | ||
| shell(`lerna version ${packageVersion} --no-git-tag-version --force-publish --yes`); | ||
| // Set monorepo version to `1.1.0`. Use tilde to apply only patch releases, not minor | ||
| shell(`node scripts/release/set_version.mjs ${packageVersion} tilde`); |
There was a problem hiding this comment.
tilde here means inter-monorepo deps with be ~0.40.0 such that only patch releases can be installed in that range. ^0.40.0 applies to minor releases too.
| exitIf(!tag, "<tag> not set"); | ||
|
|
||
| for (const dirpath of resolveMonorepoDirpaths()) { | ||
| shell(`npm publish --tag ${tag}`, {cwd: dirpath}); |
There was a problem hiding this comment.
npm publish is very simple, just tar files and upload. No surprises.
Performance Report鉁旓笍 no performance regression detected Full benchmark results
|
|
Discussion in discord:
|
|
Putting as draft until:
|
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 15 days if no further activity occurs. Thank you for your contributions. |
|
After discussions with the team, we will stick with Lerna for now |
Motivation
lerna has been used in this monorepo for +3y (added in #324). While useful we have had to battle this tool more than treat it like a helpful item:
It also deprecates scripts introduced here, not used currently AFAIK
Description
We use lerna for three actions:
yarn workspaces run <cmd>scripts/release/set_version.mjsscripts/release/publish.mjsPlease check the new scripts and you'll see they are really simple. I don't think they justify a tool so heavy and problematic like lerna. I don't guarantee this PR won't introduce bugs for each type of release, but fixing those should be trivial now that we control the tooling.
Please note that we have dropped 2_300 lines of dependencies from yarn.lock 馃帀