the-draupnir-project / Draupnir

A Matrix moderation bot
https://the-draupnir-project.github.io/draupnir-documentation/
82 stars 14 forks source link

Enable corepack & fix `pre-commit run --all-files` #462

Closed Mikaela closed 3 months ago

Mikaela commented 3 months ago

Briefly talked on Matrix, I think the project was previously using an old yarn version since there was a warning about the project being updated to new yarn version when I ran corepack use yarn.

I don't know if this brings breaking changes and I am curious on whether the tests or CI pass.

Mikaela commented 3 months ago

Additionally it's not necessary to call corepack constantly since corepack enable should make yarn point to it, but I am choosing the lazy way out of having to figure out how to get the CI to use corepack version instead of Yarn Classic which is installed by default.

It's inspired by https://github.com/nodejs/corepack/blob/v0.28.2/README.md#corepack-enable--name

Mikaela commented 3 months ago

Scimming through the CI logs it seems that it's unable to find Draupnir version, which I think is related to this

I think that needs actual coder to check it thogh.

Gnuxie commented 3 months ago

Yeah that's a known issue and unrelated to this PR, don't worry about it

Gnuxie commented 3 months ago

@Mikaela did you follow https://yarnpkg.com/migration/guide ?

Mikaela commented 3 months ago

More or less, although by accident

Gnuxie commented 3 months ago

oki

Gnuxie commented 3 months ago

Been playing around with yarn4 just to make sure everything is in order, unfortunately I haven't been able to get yarn link working with VSCode's debugger when linking MPS locally. And that seems to be because they no longer use a symlink in node_modules.

https://classic.yarnpkg.com/lang/en/docs/cli/link/ https://yarnpkg.com/cli/link https://yarnpkg.com/configuration/manifest#resolutions https://yarnpkg.com/protocol/portal

I'm investigating this but it might take awhile.

Mikaela commented 3 months ago

https://yarnpkg.com/getting-started/editor-sdks ?

Gnuxie commented 3 months ago

Ok, that looks promising. However, seems like projects that have been touched by yarn classic aren't automatically migrated to use "yarn plug'n'play" which is required for the editor integration. https://yarnpkg.com/migration/pnp. And that migration guide requires some major work.