Skip to content
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

chore: migrate away from lerna #236

Closed
QuinnLee opened this issue May 2, 2022 · 5 comments · Fixed by #238
Closed

chore: migrate away from lerna #236

QuinnLee opened this issue May 2, 2022 · 5 comments · Fixed by #238
Assignees

Comments

@QuinnLee
Copy link
Contributor

QuinnLee commented May 2, 2022

lerna/lerna#2703 :(

We should get an alternative

@QuinnLee QuinnLee added the big label May 2, 2022
@luizstacio
Copy link
Member

I think would be possible to move to a simpler solution using yarn|npm workspaces?

@biantris
Copy link
Contributor

biantris commented May 2, 2022

Here are some of the most used tools for monorepo, I think turborepo is a good way https://monorepo.tools/#monorepo-tools
https://github.com/vercel/turborepo

@pedronauck
Copy link
Contributor

I have been using Turborepo and PNPM for a few months and the experience with them is awesome, mainly because of the cache system that both have that speeds up package installations and build so much faster than others.

@pedronauck pedronauck self-assigned this May 3, 2022
@pedronauck
Copy link
Contributor

pedronauck commented May 3, 2022

Hey guys, I started to play with this issue today trying to resolve some of these tasks:

  • Add Turborepo as monorepo manager
  • Change to PNPM instead of NPM
  • Use imports directly without the need to build --watch packages internally
  • Use tsup for build using esm | cjs | iife formats
  • Change Github actions to use PNPM
  • Tests Github Actions
  • Use Auto or Rush for publishing instead of Lerna

👉🏻 And after some changes I struggle with other issues (that's already solved too):

  • Create an index.ts entry point for wordlists and merkle-shared packages in order to follow monorepo "pattern"
  • Use set-project-references for fix typescript references (the old package is not compatible with PNPM)
  • Exclude some files on tsconfig.base.json

👌🏻 Until now things are doing very well, all tests are passing...

Image


Now we have some new benefits because of the new toolchain:

✅ A very good cache system on the build pipeline (thanks to Turborepo)
✅ So much faster package installations (thanks to PNPM)
✅ Consume packages internally without watch builds
✅ Better package.json definitions with specific builds for CommonJS and ESM modules (thanks to tsup)


🙄 The only thing I'm lit stuck is build command on example-project. I don't know why, but it's with an error when trying to find the typechain-target-fuels, I'll try tomorrow to find why, but some help is very welcome.

> fuels-ts@0.0.1 build:example /Users/pedronauck/Projects/fuel/fuels-ts
> pnpm --filter '@fuel-ts/example-contract' build


> @fuel-ts/example-contract@0.6.0 build /Users/pedronauck/Projects/fuel/fuels-ts/packages/example-contract
> exec ./scripts/build.sh

Error occured:  Couldn't find fuels. Tried loading: @typechain/fuels, typechain-target-fuels, /Users/pedronauck/Projects/fuel/fuels-ts/packages/example-contract/fuels.
Perhaps you forgot to install @typechain/fuels?
Run with --show-stack-traces to see the full stacktrace
/Users/pedronauck/Projects/fuel/fuels-ts/packages/example-contract:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @fuel-ts/example-contract@0.6.0 build: `exec ./scripts/build.sh`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.

Another thing is that now I have a big PR and maybe this can be an issue too. I'll try to split this into smaller ones!

@adlerjohn
Copy link
Contributor

I'll try to split this into smaller ones!

Please do ❤️! Big PRs are impossible to review properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants