-
Notifications
You must be signed in to change notification settings - Fork 199
Fix Lerna issues? Migrate to Yarn workspaces #1241
Conversation
I have no idea if the CI is going to work. |
dee36f2
to
aec3476
Compare
57000e3
to
44f168b
Compare
The only thing pending is fixing the starter kits integration test, but I don't want to step on @ylv-io here because I think he was working on that this week. Let's coordinate. |
Hey @frangio. Thanks for all the efforts to move SDK to workspaces 🚀
I am not familiar with yarn workspaces and how they manage local package dependencies. Do you have any idea what would the equivalent to the prior line in terms of yarn workspaces? Does |
Yet. There might be an issue with kits tests at SDK as well. They need some refactor as well anyway. I'll make a refactor/fix PR for kits. |
#1269 updated kits tests but I am pretty certain we still have to deal with |
Thanks! I'll review it in a bit. |
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.
Looks great @frangio! I particularly like how the CI script looks like now. And I see you used the opportunity to fix or clean up a bunch of other things as well.
Could you add a paragraph on the README to explain how to bootstrap the developer environment now? Assume a setup from scratch, no need to explain how to migrate from the old one.
- checkout | ||
- restore_cache: | ||
key: dependency-cache-v4-{{ checksum "yarn.lock" }} | ||
- attach_workspace: |
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.
Great usage of workspaces! The CI script is much cleaner now, and without any loss of performance 👏
This reverts commit 24781a4.
5d92cb1
to
964b78b
Compare
@spalladino I updated the existing HACKING.md file with the information about development environment setup. Let me know if you think that information should go in the README. |
@spalladino @frangio should the environment setup go in CONTRIBUTING.md, otherwise change CONTRIBUTING to use setup in HACKING? To run tests in
Then I can run the tests
I get two tests failing, I don't know if this is as expected or if I am missing a step.
I get three tests failing, I assume I am missing a step to run
Also may need to mention that this process replaces global installs (which feels obvious but I didn't know this until I deleted my local copy of the repo 😄)
|
It shouldn't be necessary to compile the contracts in It should also not be necessary to run Ganache. This is weird, because the tests are passing in CI, but some tests are also failing in my computer so there is something wrong here. There may also be some flakiness. Something crashed the first time I ran the CLI tests but didn't the second time. I'm gonna look into it.
Wow, that should not be happening. Are you sure it was Yarn? @spalladino can you reproduce this? |
Could not reproduce. @abcoathup maybe you had run |
Sorry, I did run
Then
|
Getting the following issues still: |
* regenerate all lockfiles using npm install * run yarn import * migrate to yarn workspaces * fix type errors * modify circleci config to use yarn * fix lib-complex example * fix Dependency test * set working_directory for integration tests * fix first-project and creating-instances * optimize circle ci setup job * fix integration tests * remove unused directory * fix error when stderr is null * configure create-react-app to skip dependency check * Revert "remove unused directory" This reverts commit 24781a4. * trigger ci * update HACKING.md for yarn (cherry picked from commit 6494075)
Attempts to fix #665.
There is some context in #665, but I would like to have a clearer picture of what are the issues that people have been having with our current Lerna setup. It's clear to me that there's general unhappiness about it in the team but I haven't had enough experience with it to know the concrete issues.
The things I've run into are: 1) running
npm ci
in a package subdirectory doesn't work, and 2) npm installing any new dependency breaks the Lerna "links".I've been experimenting with ways of fixing this but Lerna has basically zero documentation, specially around the
lerna link
functionality.I've tried
lerna link convert
, which automatically converts all repository-local dependencies intofile:
dependencies, and at the same time hoists all dev dependencies to the root. However, the automatic conversion had some bugs, and I also didn't see the reason to do the hoisting at the same time.I then tried manually converting to
file:
dependencies and I ran into some npm bugs where it simply fails to install (and I'm pretty sure this would have happened with Lerna's automatic conversion too). I have run into these bugs before in different projects. I just don't think npm handlesfile:
dependencies well.I then migrated to Yarn workspaces, and this seems to work more robustly. I've configured Lerna to work with Yarn workspaces. We can still use it for publishing, etc. This is what's included in this PR.
The downside is that this implies we have to migrate to Yarn rather than npm.