A new field in dependenciesMeta - linkBin#118
Conversation
|
A few questions I may have (not that I think they must necessarily be actioned upon, just that we should at least consider them): Is the use-case significant enough?On the top of my head I don't see a lot of packages that may encounter the problem described in the post. I think Is the
|
|
I think the best solution would be if webpack/webpack-cli would solve this on their end. They could update webpack-cli to not export any bins. Then webpack could have a bin like the following: #!/usr/bin/env node
try {
require('webpack-cli');
} catch (err) {
require('webpack');
} |
|
This is indeed how the ecosystem typically solves this; it’s not really expected to be a supported use case to have conflicting bins and be able to control which one you get. Regarding your last alternative design, anything implicit is dangerous; i could add my own -cli package into the dep tree; and requiring the package name prefix and binary name be the same to get that precedence wouldn’t actually match frequent ecosystem usage (often package names aren’t that close to binary names). The only thing i can think of that might make sense to properly address this problem is actively failing the install when there’s a binary name conflict. |
related: pnpm/pnpm#1488