-
Notifications
You must be signed in to change notification settings - Fork 207
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
Support yarn v2 #517
Comments
What does Can I clone your repo and try it out? |
It returns My reproduction should work in any extension repository, but I created a fresh one that should showcase it perfectly: https://github.com/oliversalzburg/vsce-yarn2-support |
Likewise, yarn 2 omits the run command since it's not needed. Yarn 2 is not meant to be installed globally (yet) If there is yarn available in global, then it's probably v1. I don't know if vscode is running an embedded yarn or global yarn, but ordinarily yarn v1 checks if yarn 2 (or any yarn) is installed in the repository and runs it instead. In my case, running an npm script from the side panel results in this:
Which is incorrect, it should just be |
I had the same issue, here was my temporary fix, although it can be annoying,
|
just info, as of now |
Not the cleanest/best solution, but this is how I circumvented this issue:
This will make The only issue with this is that Of course, having |
With the freeze of yarn v1 this should perhaps be re-prioritized. |
See #439. I think yarn v2 is supported. |
This ticket is already two years old and we still do not have full support for yarn 2. For example
There is no I guess that for the moment I will need to replace |
In general, it seems like very poor practice to rely on a specific third party shell application to perform anything of meaning in a NodeJS project, especially when that third party application is a package manager. Which is why I have given up on vsce a long time ago. Please open a new issue to track the total absence of progress on this issue, if you need to. |
Contributions here are more than welcome! Yarn v2 just isn't that big of a deal for us and most of our users (only 8 upvotes here), so this issue never makes it to the front page. Also, and I'm sure you know, we're constantly busy with plenty of other work. |
@joaomoreno Thanks for clarifying as not everyone understands what is expected to be fixed by core team and what goes into welcoming fixes from outside. Some might get frustrated waiting for something to happen that nobody is working on. At least knowing that the core team does not see yarn v2 as a priority, could motivate some to propose fixes. I fixed one yarn bug last week and I may have to fix this one too. I did check the outcome of I was recently forced to switch to yarn because And yep, I am closely watching code team release notes each month, I am giving them as a good example on how to deliver fast and also inform users about what changed. Great work! |
If you need to keep track of your lack of interest to work on this subject, please create your own internal ticket. I don't want to be bothered by activity on this repository. |
@oliversalzburg You already mentioned that you are no longer interested in following it up and you could have just pressed the unsubscribe button. That is an open-source project and it is not nice to undo maintainers work, I even seen people being temporarily banned for not playing nice. Regarding broken |
@oliversalzburg, please unsubscribe. |
Hi @arendjr, thanks for sharing your plugin. I think that it's a good idea of having your plugin listed on the How can I help to make this? I guess that we would need to put the plugin in a dedicated package perhaps. |
Hi @joaomoreno, from your point of view, how would you envision this issue moving forward? I might be lacking context but I think that having @arendjr plugin installed on Maybe another way to handle it could be listing @arendjr's plugin as a prerequisite of edit: I'm happy to help, I just wanted to understand what would be the best approach to follow 😄 |
As [kaoto-ui](https://github.com/KaotoIO/kaoto-ui) migrated to yarn v3, it's time for vscode to do the same. Changes: * Upgrade yarn to v3 - berry * Remove installing global dependencies from CI workflows as those are deprecated in favor of the "yarn dlx" command * Add a local yarn plugin (.yarn/plugins/plugins-list.js) to bring the functionality from yarn v1 "yarn list --prod --json" since the "@vscode/vsce" depends on such functionality. more datails in [the following issue](microsoft/vscode-vsce#517) * Update the CONTRIBUTING.md file to reflect the new API for "yarn link" * Bump "@kie-tools-core/*" from "0.27.0" to "0.29.0" as it's required that the dependencies match from the root package and the linked package. * Add a resolution entry for "zundo" package to support both "[email protected]" and "kaoto-ui@main-branch" fixes: KaotoIO#270
As [kaoto-ui](https://github.com/KaotoIO/kaoto-ui) migrated to yarn v3, it's time for vscode to do the same. Changes: * Upgrade yarn to v3 - berry * Remove installing global dependencies from CI workflows as those are deprecated in favor of the "yarn dlx" command * Add a local yarn plugin (.yarn/plugins/plugins-list.js) to bring the functionality from yarn v1 "yarn list --prod --json" since the "@vscode/vsce" depends on such functionality. more datails in [the following issue](microsoft/vscode-vsce#517) * Update the CONTRIBUTING.md file to reflect the new API for "yarn link" * Bump "@kie-tools-core/*" from "0.27.0" to "0.29.0" as it's required that the dependencies match from the root package and the linked package. * Add a resolution entry for "zundo" package to support both "[email protected]" and "kaoto-ui@main-branch" fixes: KaotoIO#270
As [kaoto-ui](https://github.com/KaotoIO/kaoto-ui) migrated to yarn v3, it's time for vscode to do the same. Changes: * Upgrade yarn to v3 - berry * Remove installing global dependencies from CI workflows as those are deprecated in favor of the "yarn dlx" command * Add a local yarn plugin (.yarn/plugins/plugins-list.js) to bring the functionality from yarn v1 "yarn list --prod --json" since the "@vscode/vsce" depends on such functionality. more datails in [the following issue](microsoft/vscode-vsce#517) * Update the CONTRIBUTING.md file to reflect the new API for "yarn link" * Bump "@kie-tools-core/*" from "0.27.0" to "0.29.0" as it's required that the dependencies match from the root package and the linked package. * Add a resolution entry for "zundo" package to support both "[email protected]" and "kaoto-ui@main-branch" fixes: KaotoIO#270
As [kaoto-ui](https://github.com/KaotoIO/kaoto-ui) migrated to yarn v3, it's time for vscode to do the same. Changes: * Upgrade yarn to v3 - berry * Remove installing global dependencies from CI workflows as those are deprecated in favor of the "yarn dlx" command * Add a local yarn plugin (.yarn/plugins/plugins-list.js) to bring the functionality from yarn v1 "yarn list --prod --json" since the "@vscode/vsce" depends on such functionality. more datails in [the following issue](microsoft/vscode-vsce#517) * Update the CONTRIBUTING.md file to reflect the new API for "yarn link" * Bump "@kie-tools-core/*" from "0.27.0" to "0.29.0" as it's required that the dependencies match from the root package and the linked package. * Add a resolution entry for "zundo" package to support both "[email protected]" and "kaoto-ui@main-branch" fixes: #270
Thank you so much for working on this @lordrip :). Fyi, it seems that |
Hi @ivangabriele I haven't worked on this yet, I would like to make sure that this is still needed first. Thanks for the heads-up about the renaming, I gave it a try and it seems that the JSON output is not exactly right: Using: yarn info --recursive --json this is the output, notice how it will need a little bit of adjustment before using it: {
"value":"@4tw/cypress-drag-drop@npm:2.2.4",
"children":{
"Instances":1,
"Version":"2.2.4"
}
}{
"value":"@adobe/css-tools@npm:4.2.0",
"children":{
"Version":"4.2.0"
}
}{
"value":"@ampproject/remapping@npm:2.2.1",
"children":{
"Version":"2.2.1",
"Dependencies":[
{
"descriptor":"@jridgewell/gen-mapping@npm:^0.3.0",
"locator":"@jridgewell/gen-mapping@npm:0.3.3"
},
{
"descriptor":"@jridgewell/trace-mapping@npm:^0.3.9",
"locator":"@jridgewell/trace-mapping@npm:0.3.18"
}
]
}
} |
@lordrip Indeed I didn't check in detail how it's used yet. Normally I think that could be a one-shot fix by updating this function and detect Yarn 2/3 via the I can at least confirm I had the same issue today on a brand new extension using Yarn stable (v3.6.1). In the meantime I used @arendjr script. I can try to poke a PR if you wish ^^. |
Sure, I'm not the maintainer but I'm confident that it will help a lot. If you happen to submit a pull request I can lend you a hand if needed. If it helps, I adjusted a bit @arendjr 's plugin here to incorporate the |
Would it help if I moved my script into its own repository? |
Hi @arendjr, as I mentioned in a few comments above, I think that there's value in trying to publish your script in the Plenty of plugin examples exist, for instance, yarn-plugin-env-vars. That being said, I don't think that both efforts are mutually exclusive, at least how I see it, it would be quicker to have a public plugin, installed through the CLI, like: yarn add arendjr-plugin while we wait for a dedicated implementation in this repository, which probably would be the best approach in the long run 😃 EDIT: I took your cool script and adjusted it a little bit in order to support linked packages, the ones that you get when you do a: yarn link ~/my-package |
Alrighty, this should do the trick :) https://github.com/arendjr/yarn-plugin-list I have incorporated your support for Yarn resolutions as well, @lordrip |
Thanks again here! Fyi I will try to open a PR-fix today or tomorrow for this issue. |
cause of microsoft/vscode-vsce#517 Signed-off-by: Shubh <[email protected]>
I was blocked by this issue for a while, but in case it is helpful to others, my workaround was to use esbuild to bundle, then pass For emphasis:
As an additional aside, it looks like the compatibility issue looks like it was introduced in |
Closing this as out of scope. As part of our recurring maintenance milestone, we've decided to limit the amount of supported package managers to npm and yarn v1 only. That being said, I'm glad workarounds exist for anyone who is blocked. |
Have you considered using an off-the-shelf solution for resolving Node.js dependencies instead? It seems like the package manager-dependent code is just used for listing which I think resolving dependencies from the code would lead to better accuracy (since you cannot be so sure all the package maintainers are managing |
yarn v2+ not supported by vsce microsoft/vscode-vsce#517 draw inspiration from abcradabra (linked in above issue) nicoespeon/abracadabra@10e0c3d
<!-- How to write a good PR title: - Follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ## Self Checklist - [x] I wrote a PR title in **English** and added an appropriate **label** to the PR. - [x] I wrote the commit message in **English** and to follow [**the Conventional Commits specification**](https://www.conventionalcommits.org/en/v1.0.0/). - [x] I [added the **changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) about the changes that needed to be released. (or didn't have to) - [x] I wrote or updated **documentation** related to the changes. (or didn't have to) - [x] I wrote or updated **tests** related to the changes. (or didn't have to) - [x] I tested the changes in various browsers. (or didn't have to) - Windows: Chrome, Edge, (Optional) Firefox - macOS: Chrome, Edge, Safari, (Optional) Firefox ## Related Issue <!-- Please link to issue if one exists --> <!-- Fixes #0000 --> - #2485 ## Summary <!-- Please brief explanation of the changes made --> - `bezier-vscode` 배포를 release.yml 에 추가해서 changesets PR을 머지하면 자동으로 배포되도록 합니다. - 누락된 LICENSE 파일을 추가합니다. 이게 없으니 `vsce publish`실행시키면 `그대로 진행하시곘습니까? [y/N]` 을 물어보네요. ## Details <!-- Please elaborate description of the changes --> - `VSCE_PAT`: VSCode 퍼블리셔의 [토큰입니다](https://www.notion.so/channelio/42644061d7f542a9bf5684f2807128e4?pvs=4#c7f90fd0ef95446c84bf25f335cb97cc). 레포 시크릿에 추가헀습니다. - `--no-dependencies`: yarn 버전 이슈때문에 안넣어주면 에러가 뜹니다 (microsoft/vscode-vsce#517) - `continue-on-error`: changesets PR 에 VSCode 관련 변경 사항이 없을 경우에 현재 배포된 버전과 같은 버전으로 배포하게 되는데 이때 워닝이 아니라 에러를 뱉기 떄문에 true 로 했습니다. - https://github.com/channel-io/bezier-react/pull/2496/files 이 PR이 머지되면 0.3.0 으로 버전이 올라간채로 changesets PR이 만들어지기 때문에, 그 전에 0.2.0 배포하고나서 changesets PR을 머지해서 0.3.0을 배포하도록 해야할 것 같네요. ### Breaking change? (Yes/No) <!-- If Yes, please describe the impact and migration path for users --> - No ## References <!-- Please list any other resources or points the reviewer should be aware of --> - https://www.eliostruyf.com/publishing-vscode-extensions-github-actions/ - `vsce publish --help`
In a repository using yarn 2,
vsce package
will fail trying to enumerate dependencies:To reproduce, in an extension repository, use:
yarn set version berry yarn install vsce package
The text was updated successfully, but these errors were encountered: