-
Notifications
You must be signed in to change notification settings - Fork 58
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
Package Distributions #642
Comments
I've reached a point where I can't decide if this is actually a new feature or if it's really just some enhancements to optional dependencies If we frame it as the latter, we would need to always include all optional deps and their own dependencies in the ideal tree instead of only those that are installable on the current system. We would also have to allow installing deps that do not match the current system to allow for builds and production environments to run on different platforms, sort of like cross compiling. Potentially we would want to add something to allow specifying "at least one of the following optional dependencies must be installed" as well. This scoping is a lot more narrow, but maybe it solves the general use cases well enough that that's a good thing. |
@nlf i don't think optional dep features would address the "full vs minimal" file set tho :-/ |
this is true, we would need a different solution for that. there's a difference between "platform specific dependencies" and "variations of the same package". i think the original proposal here was trying to address both of those needs and that it may be better to split them into two concerns. optional deps address the first, but that second concern would have to be addressed in a different way. |
One of the motivating use cases tho was indeed variations of the same package - it's just that for that, they're platform-specific. The way they hack around it right now is via platform-specific optional deps, but that doesn't seem like a clean approach to endorse. |
Epic
A common problem in the npm ecosystem is the need to distribute pre-compiled binary assets. To do this today involves either a
postinstall
script in the package that fetches the asset that corresponds to the current system, or publishing each binary asset as its own package in npm and using optional dependencies on all of them, or potentially a combination of those approaches.None of these alternatives is ideal. A
postinstall
script means that users cannot use the--ignore-scripts
flag or the script won't run. The use of a series of optional dependencies requires the consumer to attempt to require every one of them in sequence until they find one that's installed (or don't!). It also means that the package-lock.json will only include the optional dependency that was actually installed as part of this particular installation.Exit criteria
distributions
, a means of mapping system parameters to specific sub-packages.package-lock.json
in order to eliminate churn and correctly lock all distributions available rather than only the one that successfully installed on the current host.Tasks
require
them all?)Immediately actionable items
Feature ideas
libc
rfc above) possibly allowing all of the fields inprocess.versions
, known requests foros
,os-version
,cpu
,libc
,libc-version
,runtime
(node
/electron
/deno
/browser
)esm
vscommonjs
,slim
(omits docs),locales
, possibly arbitrary tag selectors?Supporting documentation
The text was updated successfully, but these errors were encountered: