statelyai / xstate

Actor-based state management & orchestration for complex app logic.
https://stately.ai/docs
MIT License
27.21k stars 1.26k forks source link

switch package manager to pnpm #4987

Closed with-heart closed 2 months ago

with-heart commented 4 months ago

This PR changes our package manager from yarn to pnpm.

changeset-bot[bot] commented 4 months ago

⚠️ 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

Andarist commented 4 months ago

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

with-heart commented 4 months ago

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 commented 4 months ago

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

Andarist commented 4 months ago

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

with-heart commented 4 months ago

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

with-heart commented 4 months ago

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

Andarist commented 4 months ago

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

with-heart commented 3 months ago

@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 commented 3 months ago

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

davidkpiano commented 3 months ago

@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? 🙏

with-heart commented 2 months ago

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

Andarist commented 2 months ago

@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?