postinstall scripts should've been removed long time ago, it's the cancer of NPM packages. There's so many deeply nested, uncontrolled postinstalls that run randomly when you pull something it's insane, I don't know how someone at some point ever though that was a good idea.
Absolutely not, there are plenty of use-cases for them. https://www.npmjs.com/package/patch-package comes to mind off the top of my head. Hopefully current hysteria will not result in some bs decisions like this.
Upcoming breaking changes for npm v12
131–140 of 221 posts
Re: Upcoming breaking changes for npm v12
#132It is not obvious from the post but it seems like the allow list for the scripts supports whitelisting packages instead of a global setting. This should make it easier to maintain org-wise rules to allow scripts only for specific packages. Is there a linter that could be used for scenarios like this to prevent unsafe default on package manager config?
Re: Upcoming breaking changes for npm v12
#133They chose...poorly
Re: Upcoming breaking changes for npm v12
#134Earlier quoted context omitted.
Absolutely not, there are plenty of use-cases for them. https://www.npmjs.com/package/patch-package comes to mind off the top of my head. Hopefully current hysteria will not result in some bs decisions like this.
The entire use-case of that package is a security nightmare.
Re: Upcoming breaking changes for npm v12
#135Earlier quoted context omitted.
The entire use-case of that package is a security nightmare.
Then don't use it. Just don't presume to tell me if I can or can't.
Re: Upcoming breaking changes for npm v12
#136Earlier quoted context omitted.
Ok? Not sure what a package manager can do about the fact that eventually you want to run the things you install.
Have any kind of provenance. eg like Debian has for 30 years. Key signing in person etc
Re: Upcoming breaking changes for npm v12
#137Earlier quoted context omitted.
I’m sure we’d all welcome your alternative and or superior proposals. Without that, this just comes across like unconstructive commentary. This moves the needle a little your proposals or the lack thereof don’t move it at all. So I’ll take this over nothing.
We already have alternative and superior proposals, it's called Deno. It's node + npm compatible and its permission system locks everything down by default. If you know ahead of time, you can turn on which permissions something is supposed to have in the config file. Or you can just not use a config file at all. Anytime it needs a permission: it asks you what it wants. You can say yes or no, and those are saved in th…
Re: Upcoming breaking changes for npm v12
#138Earlier quoted context omitted.
native modules. nodejs can have native modules (written in C++, Rust, etc...). Projects usually ship prebuilt natives binaries (for each arch/OS/Nodejs ABI combination) hosted on GitHub Releases and download them automatically at installation time; fallback to build from source if not found. that's where scripts are used the reason for not bundling all native binaries is becasue the no. of combinations are huge and i…
Having a non-script method of downloading the right native binary would be a good next step.
Re: Upcoming breaking changes for npm v12
#139I wonder if there are still reasons to use yarn? Has yarn also implemented safeguards to protect against supply chain attacks? Until now, I only knew about pnpm. It’s great that npm has followed up.
https://yarnpkg.com/features/pnp
Very similar to using .jar's in Java instead of directory trees of .class files.
It's somewhat hacky though, and editor/tool support varies.
- since there are far fewer small files, it can be faster especially on Windows if you're forced to work on it for some reason
- the archives can be stored into the git repository (through git-lfs or friends), removing dependency on the internet and the package registry
Re: Upcoming breaking changes for npm v12
#140Earlier quoted context omitted.
Java‘s Maven never had them, never felt a need for them. What is their purpose in JS land?
native modules. nodejs can have native modules (written in C++, Rust, etc...). Projects usually ship prebuilt natives binaries (for each arch/OS/Nodejs ABI combination) hosted on GitHub Releases and download them automatically at installation time; fallback to build from source if not found. that's where scripts are used the reason for not bundling all native binaries is becasue the no. of combinations are huge and i…