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
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/.yarn/cache
bundles/
/.yarn/install-state.gz
node_modules
25,649 changes: 0 additions & 25,649 deletions .pnp.js
AlCalzone marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

6 changes: 1 addition & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"typescript.enablePromptUseWorkspaceTsdk": true,
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
}
}
}
22 changes: 0 additions & 22 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

This file was deleted.

38 changes: 0 additions & 38 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

8 changes: 0 additions & 8 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

This file was deleted.

29 changes: 0 additions & 29 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

55 changes: 0 additions & 55 deletions .yarn/releases/yarn-2.4.0.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.3.0.cjs

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions .yarn/sdks/eslint/bin/eslint.js

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/eslint/lib/api.js

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/sdks/eslint/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions .yarn/sdks/integrations.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/prettier/index.js

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/sdks/prettier/package.json

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/typescript/bin/tsc

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/typescript/bin/tsserver

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/typescript/lib/tsc.js

This file was deleted.

63 changes: 0 additions & 63 deletions .yarn/sdks/typescript/lib/tsserver.js

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/typescript/lib/typescript.js

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/sdks/typescript/package.json

This file was deleted.

16 changes: 6 additions & 10 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
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"
Comment on lines -1 to -9
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.

compressionLevel: mixed

yarnPath: .yarn/releases/yarn-2.4.0.cjs
enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.3.0.cjs
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "https://github.com/Dcard/yarn-plugins.git"
},
"dependencies": {
"@yarnpkg/pnpify": "^2.4.0"
"@yarnpkg/pnpify": "^4.1.0"
},
"devDependencies": {
"@commitlint/cli": "^12.1.1",
Expand Down Expand Up @@ -56,5 +56,5 @@
"ts-jest": "26.3.0",
"typescript": "^4.0.2"
},
"packageManager": "yarn@2.4.0"
"packageManager": "yarn@4.3.0"
}
17 changes: 9 additions & 8 deletions packages/changed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
"build": "builder build plugin"
},
"dependencies": {
"clipanion": "^2.4.4"
"clipanion": "^3.2.1"
},
"devDependencies": {
"@yarnpkg/builder": "^2.1.3",
"@yarnpkg/cli": "^2.4.1",
"@yarnpkg/core": "^2.4.0",
"@yarnpkg/fslib": "^2.4.0",
"@yarnpkg/plugin-essentials": "^2.4.0",
"@yarnpkg/shell": "^2.4.1",
"typescript": "^4.0.2"
"@yarnpkg/builder": "^4.1.1",
"@yarnpkg/cli": "^4.3.0",
"@yarnpkg/core": "^4.1.0",
"@yarnpkg/fslib": "^3.1.0",
"@yarnpkg/plugin-essentials": "^4.2.0",
"@yarnpkg/plugin-git": "^3.0.0",
"@yarnpkg/shell": "^4.0.2",
"typescript": "^5.4.5"
}
}
16 changes: 6 additions & 10 deletions packages/changed/src/commands/filter.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { BaseCommand } from '@yarnpkg/cli';
import { Command } from 'clipanion';
import { Option } from 'clipanion';
import { execUtils, Project, Workspace, structUtils } from '@yarnpkg/core';
import listChangedWorkspaces from '../utils/listChangedWorkspaces';

export abstract class FilterCommand extends BaseCommand {
@Command.String('--git-range')
public gitRange?: string;
public gitRange?: string = Option.String('--git-range');

@Command.Boolean('--cached')
public cached = false;
public cached = Option.Boolean('--cached', false);

@Command.Array('--include')
public include?: string[];
public include?: string[] = Option.Array('--include');

@Command.Array('--exclude')
public exclude?: string[];
public exclude?: string[] = Option.Array('--exclude');

protected async listWorkspaces(
project: Project,
Expand All @@ -38,7 +34,7 @@ export abstract class FilterCommand extends BaseCommand {
const exclude = this.exclude || [];

return workspaces.filter((ws) => {
const name = structUtils.stringifyIdent(ws.locator);
const name = structUtils.stringifyIdent(ws.anchoredLocator);

if (name) {
if (include.length && !include.includes(name)) {
Expand Down
Loading