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: upgrade to yarn 3 #1478

Closed
wants to merge 3 commits into from
Closed

chore: upgrade to yarn 3 #1478

wants to merge 3 commits into from

Conversation

unional
Copy link
Contributor

@unional unional commented Jun 11, 2022

A testing PR to see if there are any issue about it for this project

@johnnyreilly
Copy link
Member

Looks like this isn't working out?

@johnnyreilly
Copy link
Member

johnnyreilly commented Jun 11, 2022

That said, it looks like we're getting arbitrary failures now which I would guess to be new npm related

https://github.com/TypeStrong/ts-loader/actions/runs/2480505979

@johnnyreilly
Copy link
Member

Wonder if this --legacy-peer-deps will fix

#1479

@unional
Copy link
Contributor Author

unional commented Jun 11, 2022

You are right. It is actually that. It's about that npm link --legacy-peer-deps fix.

I read it wrong. I through it was the lockfile frozen issue. But the fail is actually during test, not during install

@johnnyreilly
Copy link
Member

I've updated with the --legacy-peer-deps fix. That said, I'm not sure if we want to move to yarn 3 - may switch back to npm instead. We originally moved to yarn as (then) npm didn't have meaningful lock files. Now it does we may want to switch to that instead given yarn 3 doesn't seem to be widely used

@unional
Copy link
Contributor Author

unional commented Jun 11, 2022

Sure. The yarn 2/3 usage rate is a difficult topic.
What happen is that the usage of yarn 2/3 is based off of yarn 1:

# install yarn 1 (note that the latest version is actually yarn 1. 1.22.19)
npm install -g yarn

# or by using corepack
corepack enable

# enable yarn 3
yarn set version stable

It actually downloads the bundled yarn 3 file to ./.yarn/releases/yarn-3.2.1.cjs.
So it doesn't go through the registry and the usage rate is not measured in the traditional way.
I don't know where to find that info.

I have also tried using pnpm in one of my projects.

In general, pnpm > yarn 3 > npm.
But evil is in the detail, as always, such as the strict peer deps, and some weird bug due to certain expectation of the node_modules structure (storybookjs/presets#242)

A testing PR to see if there are any issue about it for this project
change TS version range to `~` for pining minor version
@johnnyreilly
Copy link
Member

I also like pnpm - as much as anything else I'm keen on using stuff that's already installed on CI machines though. With pnpm I'd have to manually install. Not the end of the world - just another thing to do

@unional
Copy link
Contributor Author

unional commented Jun 11, 2022

With pnpm I'd have to manually install.

You don't have to. corepack takes care of it. The only thing need is packageManager: pnpm@<version> in the package.json

@unional
Copy link
Contributor Author

unional commented Jun 11, 2022

btw, some CI tools doesn't work with yarn 3. I'm sure synk doesn't work and I recall dependabot doesn't either. So that might be a deal breaker.

@johnnyreilly
Copy link
Member

johnnyreilly commented Jun 11, 2022

Yeah we'll either go with npm or pnpm - didn't realize corepack was built into node these days!

@johnnyreilly
Copy link
Member

Must also get round to looking at renovate in place of dependabot

@unional
Copy link
Contributor Author

unional commented Jun 11, 2022

Must also get round to looking at renovate in place of dependabot

I'm using that, and mergify :)

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.

None yet

2 participants