-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
monorepo: replace lerna with npm workspaces #1395
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
c84fca9
to
d141ad9
Compare
3103ef2
to
289f878
Compare
Great, that sounds really promising on first sight! 😄 Several questions here:
|
Let's please wait until the next EthereumJS call until we merge this in. |
(doesn't mean that this can't be reviewed yet of course) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once I installed the correct version of NPM and completely blew away the repo and started from scratch, everything seems to work fine and I like not having lerna around anymore. :-)
A couple of general comments/questions before approving:
- I think we need to somehow specify in
MONOREPO.md
that you need to be on NPM version 7 to make contributions to the project.npm i
threw errors when I tried to run it without being on npm7 but there weren't any obvious error messages telling me what was wrong. - What do you think about adding back the global lint/test scripts in the monorepo package.json? I ran both and (admittedly test is still running) they seem to work so might be nice to have those global scripts available.
- I noticed that the
packages/client/dist/bin/cli.js
file isn't being ignored after runningnpm run build --workspaces
from the root. Is this a necessary file for CI purposes? I guess it's probably not a big deal but it could be a pain to deal with if we have that file sneaking into every new commit to the client package.
Thanks guys for taking an initial look! I'm excited for these improvements.
Yes usually a Node version has a specific npm version bundled with it (see this table). It's easy to upgrade to use npm v7 though regardless of the node version you are on, simply
I don't think so, only developers of the monorepo.
Yes you still can run it in a package folder, this is just a convenience when on root level to specify which package(s) the cmd should run.
wohoo
Yes this is actually what I was trying to do with the
I can add them back, it's a bit redundant though, because you can just run the script you want e.g.
I was having a bit of trouble with this one, without that file present |
ok, I wrote a nice little
or:
will push up a commit along with some other updates this afternoon. |
…esolved chmod error with preinstall script workaround)
@@ -34,17 +34,20 @@ jobs: | |||
uses: actions/cache@v2 | |||
id: cache | |||
with: | |||
key: Block-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |||
key: cache-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the latest version of actions/setup-node does this automatically for you. I haven't tried that yet, but looks promising.
https://github.com/actions/setup-node#caching-packages-dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, nice, thanks! that does look a lot simpler. let me give it a try.
LGTM! |
@@ -1,6 +1,12 @@ | |||
{ | |||
"name": "root", | |||
"private": true, | |||
"workspaces": [ | |||
"packages/*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is the ethereumjs-testing
submodule implicitly included here, might this have any side effects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a great point, it does seem to be ignoring it so far as a workspace.
when running commands at root with --workspaces
the command is not executed in ethereumjs-testing
.
Also gave this a brief review, looks really great! 😄 🎉 Will be brave and directly merge. |
This PR updates the monorepo from using
lerna
tonpm workspaces
, simplifying dev ux by removing the need for bootstrapping.Typescript project references are used for linking packages during build time.
Run scripts in specific packages at root with e.g.
npm run docs:build --workspace=@ethereumjs/vm
or in all packages with--workspaces
.