microsoft / vscode-vsce

VS Code Extension Manager
https://code.visualstudio.com/
Other
807 stars 206 forks source link

Support linked node modules #203

Open chriscamicas opened 7 years ago

chriscamicas commented 7 years ago

When I use a linked package, and I run vsce package it fails with

Error: Command failed: npm list --production --parseable --depth=99999
npm ERR! invalid: <my_linked_package>

steps to reproduce in PowerShell:

git clone https://github.com/chriscamicas/vscode-abl.git
git clone https://github.com/chriscamicas/abl-tmlanguage.git
cd abl-tmlanguage
npm link
cd ..
cd vscode-abl
npm install
npm link abl-tmlanguage
npm run build

I'm running Windows 10 x64

joaomoreno commented 7 years ago

There is currently no support for linked packages.

KIlyaA commented 6 years ago

Not work with Lerna linked packages Error: Command failed: npm list --production --parseable --depth=99999

kaviththiranga commented 6 years ago

I am running into same issue with a npm linked module. Did anyone find an alternative?

chriscamicas commented 6 years ago

No solution so far, I have to link for development and unlink for the packaging to work

kaviththiranga commented 6 years ago

@chriscamicas can you please explain a little in depth? Once you unlink, it is not getting inside the vsix or does it?

chriscamicas commented 6 years ago

using my previous example, my workflow is:

git clone https://github.com/chriscamicas/vscode-abl.git
git clone https://github.com/chriscamicas/abl-tmlanguage.git
cd abl-tmlanguage
npm link
cd ..
cd vscode-abl
npm install
npm link abl-tmlanguage

develop in both project when dev is done I have to commit/push and publish to npm the second project abl-tmlanguage Then I have to install this dependency like any other one in the main project, after removing the link

npm unlink abl-tmlanguage
npm install abl-tmlanguage
npm run build
kaviththiranga commented 6 years ago

@chriscamicas thanks a lot for the explanation. In my case, we haven't published the module yet to npm :(.

chriscamicas commented 6 years ago

A better tutorial explaining how to use npm link https://medium.com/dailyjs/how-to-use-npm-link-7375b6219557

b4ckup commented 5 years ago

Any progress on this? I develop a vscode extension that depends on a package I develop. Right now I have to push to npm in order to build a local .vsix file. Is there any solution to this? Is there a reason not to use

npm list --production --parseable --depth=99999 --link=true

with the link=true parameter? What difference does it make to vsce where the node module comes from when packaging as long as it is in the node_modules folder?

TheZoker commented 5 years ago

Same issue here...

Why is the --link=true not included per default? Solved the issue

RMacfarlane commented 4 years ago

@joaomoreno Looks like the fix for this was reverted, I can still repro the problem when running out of sources

joaomoreno commented 4 years ago

:man_facepalming: Completely forgot that it was. Thanks for reopening.

kevinslin commented 4 years ago

any updates on this? i'm running into this issue as well when packaging my extension locally

SPGoding commented 4 years ago

According to the doc, --link=true makes it only list linked dependencies, I guess that's the reason why the test failed.

No idea on how to do it the right way.

Lonli-Lokli commented 3 years ago

So is there any way/readme to build vsix with local packages inside lerna repository?

prmichaelsen commented 5 months ago

Is there any way around this? I'm building an extension locally with no intent to publish any of the packages or the extension itself.