Feature request: support yarn workspaces.
vsce --yarn (as of 1.52.0) does not package any of the modules from the root's node_modules/.
Hi @joaomoreno: any idea if this support will be added soon?
We have a multiple extensions with some common packages mono-repo structure. Each extension has dependencies on few of those common packages.
Currently we are using Lerna to manage the mono-repo, using webpack compile packages for each extension, and using vsce package individual extension and publish it.
It would be great if vsce support this natively
I've worked around this by:
nohoist to force all (transitive) deps of the VSCode ext to be present in its own node_modules directory. vsce package programmatically and injecting the previously computed list of dependencies using proxyquireSee here:
Another requirement is that it should support webpack as well as exceptions specified in the .vscodeignore file such as
node_modules/**
../../node_modules/**
!../../node_modules/vscode-jsonrpc/**
!../../node_modules/vscode-languageclient/**
!../../node_modules/vscode-languageserver-protocol/**
!../../node_modules/vscode-languageserver-types/**
!../../node_modules/vscode-nls/**
Note that if you bundle your extension, e.g using webpack you won't need the contents of the node_modules inside your vsix.
Is this still an issue? I'm using yarn workspaces and was able to successfully package a .vsix using vsce package --yarn and it collected the node_modules from the root just fine.
vsce 1.79.5yarn 1.22.4
Interestingly enough, running npx [email protected] ls --yarn in the same repo also lists node_modules in the root. I also checked the outputs of npx [email protected] list --prod (as well as some earlier versions back through [email protected]), and they also include the hoisted dependencies.
It could be that I'm running vsce from the root, rather than from within a workspace folder (since I'm planning on bundling the packages anyway in the future).
You can safely ignore my last two comments. After looking at the PR code in #458 I can see that your goal was to run vsce publish from within a specific workspace folder, not the workspace root.
I just put up #480 to auto-detect --yarn, but that may need to be modified slightly if your PR goes in so that it also looks for a yarn workspace root (so you could just do vsce publish from within the workspace folder rather than vsce publish --yarn).
Most helpful comment
We have a multiple extensions with some common packages mono-repo structure. Each extension has dependencies on few of those common packages.
Currently we are using Lerna to manage the mono-repo, using webpack compile packages for each extension, and using vsce package individual extension and publish it.
It would be great if vsce support this natively