xstate icon indicating copy to clipboard operation
xstate copied to clipboard

switch package manager to pnpm

Open with-heart opened this issue 1 year ago • 11 comments

This PR changes our package manager from yarn to pnpm.

  • replaced yarn with pnpm in CONTRIBUTING.md
  • mv scripts/ensure-{yarn,pnpm}.js and updated test with pnpm/9
  • removed patch-package in place of pnpm patch
    • also removed patch for @vue/[email protected] as we're on a much newer version that doesn't have the declared globals we had been patching
  • changed devDependencies.xstate versions to workspace:^
    • upgraded @manypkg/cli to latest in order to support workspace: protocol
  • GitHub Actions
    • added "Install pnpm" step to ci-setup
    • replaced yarn with pnpm in actions/workflows (except docs workflow)

with-heart avatar Jul 17 '24 15:07 with-heart

⚠️ No Changeset found

Latest commit: 6e9f284c7c1b7fb78e4a3b5bd994a2bd0b6528a8

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

changeset-bot[bot] avatar Jul 17 '24 15:07 changeset-bot[bot]

changed devDependencies.xstate versions to workspace:^

don't do this if not needed - this might interfere with how Changesets are set up right now, you'd have to rework publishing scripts to enable this

Andarist avatar Jul 17 '24 15:07 Andarist

don't do this if not needed - this might interfere with how Changesets are set up right now, you'd have to rework publishing scripts to enable this

Oof. Okay I'll see what I can do

with-heart avatar Jul 17 '24 15:07 with-heart

@Andarist do you mean scripts/bump-peer-dep-ranges.js or something else? I'm not sure where devDependencies using workspace: would affect things

with-heart avatar Jul 17 '24 15:07 with-heart

changeset publish might have issues with workspace ranges. Although perhaps they don’t affect pnpm repos - that would have to be tested. It definitely doesnt work with Yarn Berry

Andarist avatar Jul 17 '24 16:07 Andarist

I'll set up a repo and test it later just to see what happens

with-heart avatar Jul 17 '24 16:07 with-heart

I resolved the typecheck errors for all of the packages except @xstate/vue. I don't know Vue so gonna need some help with that bit

with-heart avatar Jul 17 '24 18:07 with-heart

I fixed the Vue issue. I think something weird is happening with Vue types - their shallowRef function introduces some weirdness with deferred conditional types. I prepared a slimmed-down xstate-less repro of the problem: TS playground

Andarist avatar Jul 18 '24 09:07 Andarist

@Andarist I found references to the workflow: protocol in changesets/changesets in both CHANGELOG.md files and the codebase.

I also created a test project locally and verified that changeset version has no issues correctly handling versioning when using the protocol, including bumping the version of packages that depend on workspace packages when that dependency's version is bumped.

I think we should be good to go assuming everything else checks out

with-heart avatar Jul 30 '24 21:07 with-heart

@davidkpiano what pnpm version are you on? The lockfile format changed in v8 I think so you might be on an older version

with-heart avatar Jul 31 '24 03:07 with-heart

@davidkpiano what pnpm version are you on? The lockfile format changed in v8 I think so you might be on an older version

I might have been on an older version.

Can you fix the conflicts? 🙏

davidkpiano avatar Jul 31 '24 20:07 davidkpiano

Is there anything else I need to do to move forward with this?

with-heart avatar Aug 30 '24 17:08 with-heart

@with-heart this broke VS Code debugging 😢

it now tries to run node_modules/.bin/jest as javascript file but it's a bash thing created by pnpm, do u know if we can do anything about it?

Andarist avatar Sep 18 '24 11:09 Andarist