make as similar to npm as possible
We need to have a discussion on how to make this as similar to npm as possible, and if possible, just put os utilities on npm. there are some there already, but I mean stuff like git and gcc, of course.
So, maybe this comes down to the problem of managing multiple versions of unix utilities.
hmm, subshells are probably the simplest here, @substack once used a system that worked like this, but I can't remember the name.
what do you think?
@dominictarr This is what I'm trying to achieve. My pet peeve is to make npm packages with binaries installable with apm.
So we'll be using both subshells and linking into prefix (~ by default, /usr/local if user is root and /root/.apmrc doesn't point otherwise).
So, you could apm install [email protected] [email protected] and run apm select [email protected] and it'll link it as default version into our prefix directory. Then you can run apm use [email protected] and you'll be dropped to a subshell with [email protected].
What do you think?
that is perfect. what is the database used for?
hmm, one problem I have encountered publishing bash scripts on npm is that since npm links -g bin installs, you can't do deps inside bash scripts, unless you install the deps globally too. I'd much rather have the deps installed in a way that only that bash script could see, but not globally.
Hmm...
Maybe you could just shim in all the bin's for the deps? and the shim could just be
#! /usr/bash
PATH=[HARDCODED_DEPS]:$PATH
. [PATH_TO_ORIGINAL_BIN]
?
There are bound to be edge cases though...
Dominic,
database is used for storing various versions of packages.
me
| - 1.0.0
| - packet.json
| - bin/me
| - ...
| - 1.0.1
| - packet.json
| - bin/me
| - ...
nginx
| - 1.0.0
....
I don't want to special-case binaries with Bash scripts since we need to link in all those different locations (bin, lib, ...)
that's fair - I am just thinking through the problem. is your focus more on compiled modules? can you give an example of something you'd install and how it would be represented on the file system?
it would also be nice if it was peer to peer instead of centralized.
@hij1nx that is a separate problem, the first thing here is just installing in a way that gives nested modules, we should be able to make it p2p with cyphernet.