Skip to content

feat: support yarn cherry #8940

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beyondkmp
Copy link
Collaborator

@beyondkmp beyondkmp commented Mar 5, 2025

yarn info -A --json --cache

{"value":"demo-app@workspace:apps/demo-app","children":{"Version":"2.0.0","Cache":{"Checksum":null,"Path":"C:\\Users\\payne\\AppData\\Local\\Yarn\\Berry\\cache\\demo-app-workspace-43b39c1c85-10c0.zip"},"Dependencies":[{"descriptor":"demo-package@workspace:^1.0.0","locator":"demo-package@workspace:packages/demo-package"},{"descriptor":"electron-builder@npm:26.0.10","locator":"electron-builder@npm:26.0.10"},{"descriptor":"electron@npm:35.0.0","locator":"electron@npm:35.0.0"}]}}
{"value":"demo-package@workspace:packages/demo-package","children":{"Version":"1.0.0","Cache":{"Checksum":null,"Path":"C:\\Users\\payne\\AppData\\Local\\Yarn\\Berry\\cache\\demo-package-workspace-c37e28ca4e-10c0.zip"},"Dependencies":[{"descriptor":"electron-log@npm:^5.3.1","locator":"electron-log@npm:5.3.1"}]}}
{"value":"electron-builder@npm:26.0.10","children":{"Version":"26.0.10","Cache":{"Checksum":"10c0/7fadd1e4e550e586620180461627b463b8d72ab418063e224a34197f54ce1df1f5f578373a1776e10a75d88bee06c14ec8b77c8066de1dc70162d98ee647c573","Path":"C:\\Users\\payne\\AppData\\Local\\Yarn\\Berry\\cache\\electron-builder-npm-26.0.10-089a04c7b9-10c0.zip","Size":80909},"Exported Binaries":["electron-builder","install-app-deps"],"Dependencies":[{"descriptor":"builder-util-runtime@npm:9.3.1","locator":"builder-util-runtime@npm:9.3.1"},{"descriptor":"builder-util@npm:26.0.7","locator":"builder-util@npm:26.0.7"},{"descriptor":"chalk@npm:^4.1.2","locator":"chalk@npm:4.1.2"},{"descriptor":"dmg-builder@npm:26.0.10","locator":"dmg-builder@npm:26.0.10"},{"descriptor":"fs-extra@npm:^10.1.0","locator":"fs-extra@npm:10.1.0"},{"descriptor":"is-ci@npm:^3.0.0","locator":"is-ci@npm:3.0.1"},{"descriptor":"lazy-val@npm:^1.0.5","locator":"lazy-val@npm:1.0.5"},{"descriptor":"simple-update-notifier@npm:2.0.0","locator":"simple-update-notifier@npm:2.0.0"},{"descriptor":"yargs@npm:^17.6.2","locator":"yargs@npm:17.7.2"},{"descriptor":"app-builder-lib@virtual:b4dc07d1f49d80662d2d6b72c6c2278d6a1ef1a6c15d70712f4948f848758f81a355ee7acfb8dc416b2e812a68e5609bd8f98e9439ad8175374a47b2e69d0cd6#npm:26.0.10","locator":"app-builder-lib@virtual:b4dc07d1f49d80662d2d6b72c6c2278d6a1ef1a6c15d70712f4948f848758f81a355ee7acfb8dc416b2e812a68e5609bd8f98e9439ad8175374a47b2e69d0cd6#npm:26.0.10"}]}}
{"value":"electron-log@npm:5.3.1","children":{"Version":"5.3.1","Cache":{"Checksum":"10c0/051157400b36f4ad51c52ae30a6c37d0c1525dc582312dc4043723d0e52aa11a95c28ee1421a0067f11ad641624e1163850e24d1c8cec47ba31aaf905953100f","Path":"C:\\Users\\payne\\AppData\\Local\\Yarn\\Berry\\cache\\electron-log-npm-5.3.1-9c1b39c8c3-10c0.zip","Size":102650}}}
{"value":"electron@npm:35.0.0","children":{"Version":"35.0.0","Cache":{"Checksum":"10c0/2d02050ff2c7fc7bb6974c349d494f7dfe21f5a97faff2ea61a112832dd9d3e9c1fd18952e4bbcbbb14cc77e15b9e8e6cd63a46cb127a9af1614198fa7c5ee30","Path":"C:\\Users\\payne\\AppData\\Local\\Yarn\\Berry\\cache\\electron-npm-35.0.0-5072b8f368-10c0.zip","Size":1054783},"Exported Binaries":["electron"],"Dependencies":[{"descriptor":"@electron/get@npm:^2.0.0","locator":"@electron/get@npm:2.0.3"},{"descriptor":"@types/node@npm:^22.7.7","locator":"@types/node@npm:22.13.9"},{"descriptor":"extract-zip@npm:^2.0.1","locator":"extract-zip@npm:2.0.1"}]}}
{"value":"monorepo-demo@workspace:.","children":{"Version":"0.0.0","Cache":{"Checksum":null,"Path":"C:\\Users\\payne\\AppData\\Local\\Yarn\\Berry\\cache\\monorepo-demo-workspace-e02e0ff5cb-10c0.zip"}}}
Copy link

changeset-bot bot commented Mar 5, 2025

⚠️ No Changeset found

Latest commit: 419427b

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

@beyondkmp beyondkmp marked this pull request as draft March 5, 2025 12:44
super(rootDir)
}

public readonly pmCommand = new Lazy<string>(() => Promise.resolve(process.platform === "win32" ? "yarn.cmd" : "yarn"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Apart from this line, the rest of the file looks identical to npmNodeModulesCollector to me. Is that correct? I would highly recommend extends YarnNodeModulesCollector and then override the pmCommand and any other functions that you need to use (and potentially use super._____ to leverage upstream logic.

I think this would do the trick

public readonly pmCommand = new Lazy<string>(() => {
	if (await checkYarnBerry("yarn")) {
		return process.platform === "win32" ? "yarn.cmd" : "yarn"
	}
	return super.pmCommand
})
Copy link
Contributor

github-actions bot commented Apr 6, 2025

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants