Replies: 2 comments 6 replies
-
The app could expose a binary through the "bin" field, and then instead of |
Beta Was this translation helpful? Give feedback.
-
Hey @gh-andre I've read your original post as well as the thread and I don't think I'm entirely understanding what is not accommodated by You can run A package is able to define what binaries it exports in the prepublish and prepare are often used when doing system agnostic transformations such as transpilation (babel / TS / rollup / webpack) where the postinstall scripts tend to be used for system specific stuff such as install / compiling platform specific binaries. With all of this put together you can If for example you are using a tool like nvm to manage your Node.js installation your "global" install will scope not only to a specific user but to a specific installation of node.js. With all of these things together it seems like we already do everything you are asking for. Please let me know if I missed something. |
Beta Was this translation helpful? Give feedback.
-
npm
is great for maintaining package dependencies, but there's no clean way to install a top-level app - it is assumed that it is installed in some unspecified way beforenpm install
runs. It would be nice if it was possible to install top-level apps the same way one would do with other package managers, likednf
,apt
, etc, which distinguish standalone apps and dependencies and work equally well for both.In other words, I would typically run something like this when building a package:
The first step can be anything - clone, deploy a source archive, run a separate installer or use a different package manager. Problem is, such steps are outside of the
npm
realm and may be error-prone to whether the right tag is used when cloning, whether the person running it forgets one of the steps, and so on. If I could publish the app package built with the first three steps and users could install it as a top-level app (i.e. nopackage.json
in the target directory when installing it), that would keep the entire process withinnpm
.Effectively, it is as if I ran these steps - no need for the build step because the package would already contain all artifacts in
bin
,doc
, etc.Having an app-level package would make DevOps simpler by just being able to manage builds as packages in an Artifactory- or Azure DevOps-like virtual package repositories and have QA simply point their environments to those virtual repositories to install the app being tested without having to deal with source repositories and build steps.
Beta Was this translation helpful? Give feedback.
All reactions