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: standardise workspace dependencies #3467

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JamesLefrere
Copy link
Contributor

@JamesLefrere JamesLefrere commented Jan 20, 2025

Fixes #2962

  • Replace common workspace package devDependencies (where possible without major modifications) with the workspace root's devDependencies
  • Update some error message snapshots for workspace vitest version
  • Caveats:
    • execa wasn't updated to the workspace version in all cases, because there are some breaking changes going from 6/7 to 9
    • Some optional peer dependencies have version mismatches still. The React hooks tests just need an update from the discontinued react-hooks-testing-library.
    • There are two versions of forge-std in use still; unclear why these were chosen, so I didn't change them
    • No packages were added to the devDeps, but they are used a lot (e.g. solhint). It probably makes sense to add more, but this is a large PR already.

Copy link

changeset-bot bot commented Jan 20, 2025

⚠️ No Changeset found

Latest commit: 27ca5d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

"execa": "^7.0.0",
"glob": "^10.4.2",
"execa": "*",
"glob": "*",
Copy link
Member

Choose a reason for hiding this comment

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

when publishing, do these version wildcards get swapped for the workspace semver?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great point...from my testing, no they don't 😭

Seems like this a non-starter for mud in that case, we can't run this PR as-is.

Some possible paths:

  1. Version 10 of pnpm introduces Catalogs. I just tried this locally and it works as intended; define catalog versions in pnpm-workspace.yaml, specify catalog: in workspace packages, and then packing/publishing any workspace package will set its version directly in the resulting package.json. We could try an upgrade (separate PR) then change this to use catalogs.
  2. Use a tool like syncpack to manage workspace package versions.

Not sure what your plans are for v10 at the moment (release notes here). Sounds... maybe doable?

Copy link
Member

Choose a reason for hiding this comment

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

I recently got rid of our usage of catalogs as it made some other things harder to work with: #3405

I have already made a habit of trying to keep versions aligned across the repo. It's not perfect, but hasn't been a huge issue.

The issue you're trying to solve (#2962) is specifically for common dev deps, so we can still move those up to the workspace root (and no need to declare them in each individual package's dev deps).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, shame. Ok then, I'll just simply remove the wildcards from all dependencies in workspace packages, leave the wildcards for devDependencies, and that should do the trick.

Copy link
Member

Choose a reason for hiding this comment

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

IMO we should lift the common dev deps into the workspace root's dev deps, and remove them from each package, rather than a wildcard

@JamesLefrere JamesLefrere force-pushed the jameslefrere/standardise-dependencies branch from 87ba900 to 96a20c2 Compare January 23, 2025 15:20
- Replace common workspace package devDependencies (where possible without major modifications) with the workspace root's devDependencies
- Update some error message snapshots for workspace vitest version
@JamesLefrere JamesLefrere force-pushed the jameslefrere/standardise-dependencies branch from 96a20c2 to 27ca5d1 Compare January 23, 2025 15:21
@JamesLefrere
Copy link
Contributor Author

Before:

Packages: +2285
...
1.7G    node_modules

After:

Packages: +2157
...
1.5G    node_modules

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.

move common dev deps to workspace root
2 participants