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

feat(yarn): add support for Yarn 4 #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AlCalzone
Copy link

I did some of the recommended migrations from the Yarn 4 release notes, plus a few code changes I had to figure out.

I tested only the changed plugin, so unfortunately I can't guarantee that the others are working as-is.

.pnp.js Outdated Show resolved Hide resolved
Comment on lines -1 to -9
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
spec: "@yarnpkg/plugin-constraints"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
Copy link
Author

Choose a reason for hiding this comment

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

All these plugins are now part of yarn itself.

Comment on lines +24 to +28
all = Option.Boolean('-A,--all', false);

recursive = Option.Boolean('-R,--recursive', false);

worktree = Option.Boolean('-W,--worktree', false);
Copy link
Author

Choose a reason for hiding this comment

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

At least one of these is now required for yarn workspaces foreach

Comment on lines -119 to +115
const manifestDir = ppath.join(cwd, toFilename('manifests'));
const packDir = ppath.join(cwd, toFilename('packs'));
const manifestDir = ppath.join(cwd, 'manifests');
const packDir = ppath.join(cwd, 'packs');
Copy link
Author

Choose a reason for hiding this comment

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

toFilename was removed but not mentioned in the changelog. The recommendation is to cast to Filename instead where needed.

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