Yes, npm link uses the global directory, but you should use
nvm to manage the node installation. That way the “global” directory is inside the developers home directory.
You don’t have to use npm to distribute your apps (npm has git support for example), but as of now development relies on
Ideally, applications and things like that should be kept in their own repositories. That way you just use the regular git workflow + npm link.
# First set up OS.js base
git clone https://github.com/os-js/OS.js.git -b v3
# Check out some application source
git clone https://repo/osjs-application.git
# Link the package
npm link osjs-application
npm run package:discover
You can use tools like https://github.com/lerna/lerna to automate this process for you in a team environment.
My development setup basically looks like this:
All of this said though, I’m going to add support in
@osjs/cli so you don’t have to use the
npm link feature (this is on the TODO already). The plan is to just add support for adding any path so
npm run package:discover runs over them all, not only