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
@pnpmfile npm org #1079
Comments
I think this is a bad idea. A package manager requiring installing packages to run is not going to work. Copy and paste feels like the only approach that could work. Another solution would be to use webpack to compile any helpers to a minified file that you can copy-paste in your app. But I think I would prefer to just keep the pnpmfile simple. Having access to the |
@zkochan Do you think it would be possible to have a hook to install dependencies before Without this, it doesn't seem like its easy to extend Or, we could use Or we could run twice |
Unfortunately a Without preinstall:
With
Checking for existence of
Still very clunky. But the best I can think of at the moment for reusing pnpmfile hooks. Say I have 5 apps that use CRNA, manually updating the pnpmfile in all 5 projects would be annoying. But also setting up |
It is possible to configure But {
"name": "pnpmfile",
"version": "1.0.0"
...
} and then in {
...
"pnpmfile": "^1.0.0",
...
} |
@zkochan Awesome. Didn't think of that! But why do recursive installs need to rely on ordering? Shouldn't they all be done concurrently? |
A dependency can influence the installation of the dependent package if it is used in a lifecycle script. I believe lerna installs this way as well |
Hopefully. I will test this tomorrow. If so, its the perfect solution. |
oh, the right command will probably be |
I think it might even be a good idea to have this functionality built into pnpm, primarily because you don't want to have to rely on a preinstall script to install dependencies for a dependency manager to work. We could have a central github repo with a json file that pnpm could optionally query. Then when you install it could check if there are custom resolutions available for packages, and ask you if you want to merge them in to your existing resolutions. Maybe we could have a separate file called Could also support a It would be good too, to make a list of the major and most popular packages/frameworks people use and make sure we support them. E.g. |
@vjpr I am not opposed to the basic idea described in OP. But, there should definitely be strong emphasis on the real packages having these issues corrected. In the event that one of the real packages fixes their issue - i would hope that the matching We should not lose sight of the fact that these packages actually have legitimate issues that need to be fixed - regardless of the package manager. We wont improve the outcome of this challenge by letting rogue duplicate packages live for long. Not to mention, it becomes a maitainance nightmare for publishing upstream updates. While I understand why pnpm introduced |
@vjpr After thinking it through a bit more, and a continuation of my previous comment - I actually think we should just maintain a "broken package list". This puts the burden where it belongs. |
Maybe a funny name and shame website of broken packages to raise awareness of this issue. |
@vjpr Agreed. I think that is a better way to resolve this. Basically we need to tell the truth as it is - "you are using node incorrectly" |
I think it is enough to have something like a json with the overrides |
Now Yarn 2 has the same issues as pnpm in strict mode. They create a database of "replacement, seems like similar to what this issue suggests: https://github.com/yarnpkg/berry/blob/master/packages/plugin-compat/sources/extensions.ts |
@zkochan Is there any existing work on this? |
I did not work on this. |
We will use Yarn's compat database #4676 |
Wanted to gather thoughts on this idea.
I created an org called
@pnpmfile
.The plan is to publish packages there to use as
readPackage
hooks to fix broken packages.E.g:
I also plan on having a package called
pnpmfile-check
which will inform you if there are incompatible packages in your tree.Or:
The text was updated successfully, but these errors were encountered: