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

[TDW] move from npm to pnpm #2545

Merged
merged 35 commits into from
Jul 22, 2024
Merged

[TDW] move from npm to pnpm #2545

merged 35 commits into from
Jul 22, 2024

Conversation

segunadebayo
Copy link
Contributor

@segunadebayo segunadebayo commented Jul 16, 2024

Description

This PR marks the start of improvements in our overall development experience. This will happen in two steps (and two pull requests):

  • Migration to PNPM (current): This will reveal hoisted dependencies that weren't installed explicitly and could cause issues on the consumer side. It also helps rely less on turbo since pnpm has a task runner system (and it's fast)

  • Remove the need to run watch and read from source directly: This will greatly improve TS performance and the need to "Restart TS Server" when working across packages. Of course, this will come in a different PR.

My end goal is to make our lives a bit easier. It's probably not much, but it's worth it.

For this PR, I've done the following:

  • Moved workspace definition to pnpm-workspace.yaml
  • Change all @web3modal/* package to point to workspace:*
  • Renamed the commands across all packages to be shorter and compatible with the pnpm task runner
  • (Debatable) Used pnpm task runner everywhere, it's almost as fast as turbo but without the caching (since we always use cache: false in turbo). Happy to bring back turbo once everything works as expected.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections

Copy link

vercel bot commented Jul 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Jul 19, 2024 6:23pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Jul 19, 2024 6:23pm

@lukaisailovic
Copy link
Collaborator

Changes look good.
Should we add a check in dangerfile if someone accidentally commit npm/yarn lock?

@segunadebayo
Copy link
Contributor Author

@lukaisailovic I believe this is already covered here
CleanShot 2024-07-19 at 15 54 21@2x

"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@web3modal/common": "5.0.7",
"@web3modal/ui": "5.0.7",
"@web3modal/common": "workspace:*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally. Love this feature.

@@ -46,33 +46,33 @@ const chains = [
}
]

const ethersConfig = defaultConfig({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow really? Surprised how we are missed this in code review, thanks!

"typecheck": "turbo run typecheck",
"lint": "turbo run lint",
"typecheck": "pnpm --if-present -r typecheck",
"lint": "pnpm -r lint",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-r parameter not really clear for me. Do we have to use it? It looks like we need to be careful about, could you explain why we used it?

Copy link
Contributor Author

@segunadebayo segunadebayo Jul 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--recursive or -r flag is used to run a script in every workspace package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, the way they described is quite quite different just why:

When used inside a workspace, removes a dependency (or dependencies) from every workspace package.

Copy link
Contributor

@svenvoskamp svenvoskamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@segunadebayo segunadebayo merged commit 1351e11 into main Jul 22, 2024
9 checks passed
@segunadebayo segunadebayo deleted the chore/pnpm branch July 22, 2024 14:13
@tomiir tomiir mentioned this pull request Jul 24, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants