-
Notifications
You must be signed in to change notification settings - Fork 204
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. |
I also ran into this issue, but resolved it by creating a Yarn plugin that implements the See: https://gist.github.com/arendjr/415747652a8c79f12b005ce3cfb2f808 If there is interest in contributing this to Yarn itself, please let me know. |
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 "kaoto-ui@1.0.0" 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 "kaoto-ui@1.0.0" 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 "kaoto-ui@1.0.0" 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 "kaoto-ui@1.0.0" 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 <shubhisroking@proton.me>
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
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: