Replies: 3 comments 1 reply
-
That's a very good question. Given that almost everything can be done with proper scripts, I guess that most of xpm functionality can be replicated via scripts. For simple use cases this might be an acceptable solution. However, for more complex use cases, the scripts are expected to be also quite complex, and including them in package.json might not be practical. For reusability reasons too, these scripts must be grouped in a separate package. Also these scripts should be cross-platform, so probably something like shelljs must be used. Personally I evaluated this path in the beginning, and found it not practical. Please note that xpm can do a lot more than installing packages, for example managing multiple build configurations, use properties with substitutions, multi-line actions, etc. Currently I use xpm to orchestrate multi-architecture multi-platform unit tests, with an insanely large selection of tools. For an example, see a real life package.json.
xpm is a npm package, so you can add it as a devDependency to be installed automatically, and invoke it in npm scripts, so that the end user does not need to know about it. |
Beta Was this translation helpful? Give feedback.
-
My experience with npm modules which have to compile native code is very bad. In an early version of xpm I used some decompression code, but installing xpm was very problematic in some configuration and I had to give up and switch to JS modules. Personally I cannot recommend using native code modules in public projects. |
Beta Was this translation helpful? Give feedback.
-
This might be the path of the least resistance, I will experiment to see how it plays out.
This is precisely what needs to change. Especially since replacing Still, there has been a huge improvement, since the early projects ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am exploring a potentially new use case for
xpack- as a build system for native Node.js modules.Let me summarize the problem:
npmmodules. These typically provide access to large existing complex C++ libraries that cannot be easily rewritten in JS - for example I maintain GDAL and ImageMagick. Since now we have WASM,emnapiand SWIG JSE (of which I am the author), these modules start to also work in the browser and this trend is expected to accelerate.node-gypby thenpm installscript. These modules are typically used by JS developers who expect them to simply work afternpm installand who lack any C++ skills. Often, they won't have all the necessary tools installed. Often, they will have half-working versions that they never used.node-gypis a hopelessly outdated system based ongypwhich is no longer maintained and it is very difficult to integrate with other build systems. It was not a problem while the average Node.js addon contained some self-contained C++ code but with libraries such as ImageMagick and GDAL - which have a huge number of dependencies - a new build system is needed.If found
xpmby searching if there is someone who is maintaining a launch-and-forgetmeson-build+ninjanpmpackage. I found much more than that - but alas - using it in its current state will imposexpmon the end-user - who is a web developer and does not have anything to do with C++. So naturally, I am wondering if there is any reason whyxpmmust be a separate package manager? Isn't it possible to provide most of its functionality vianpm install/npm preparescripts?Beta Was this translation helpful? Give feedback.
All reactions