mweststrate / relative-deps

Installs local dependencies for optimal developer experience
MIT License
429 stars 32 forks source link

Not suitable for working with a relative dep that has yet to be published? #52

Open benoitgrelard opened 1 year ago

benoitgrelard commented 1 year ago

Hey @mweststrate, I am wondering if this system is not suitable for working with a relative dep that yet to be published? I am trying to work on a npm package locally, it hasn't been published yet. I have linked it to my a local project using relative-deps. It all seems to work fine, however, the package dependencies aren't installed in the project so it fails at runtime.

Am I doing something wrong or is it because it would normally install the dependencies from the actual dep, hence perhaps why this warning which I hit: https://github.com/mweststrate/relative-deps/blob/543fd8f3c02d18cbd3e4ae491b35372c16ee2bdb/index.js#L35

Thanks!

PierreKiwi commented 1 year ago

Hello @benoitgrelard,

I am facing the same issue. I am not planning to publish my local package so adding it to dependencies or devDependencies does not work.

Did you find a workaround ?

vpiskunov commented 1 year ago

If your package is hosted in a github repository, you can first run npm i githubUserOrOrg/repoName - and optionally add suffix to that path of #branch-name or #commit-id. After that, do npx relative-deps add ../some-relative-path

Further, if you don't have it in github either - simply do npm install ../some-relative-path at first, and then add by npx relative-deps add ../some-relative-path - this way it will already be there first using normal relative filepath install, but relative-deps will overwrite it correctly inside node_modules

benoitgrelard commented 7 months ago

Thanks @vpiskunov this method actually worked for us in the meantime.