welder
Manage projects with nested git dependencies easily.
What is it?
API
constructor(opts)
Create an instance of Welder to work on your project.
opts.concurrency
The number of concurrent operations Welder will perform.
Type: Integer
Default: # of CPUs
opts.moduleDir
Welder will make symlinks to dependencies inside each repository under this directory.
Type: String
Default: node_modules
opts.configurationFile
Welder will look for this configuration file when tracing the dependency graph. Must be JSON.
Type: String
Default: package.json
opts.dependencyKey
Welder will look at this key in your configuration file to find its dependencies.
Type: String
Default: welderDependencies
opts.installCommand
Welder will run this command in the folder of each dependency it clones.
Type: String
Default: npm install
opts.registry
A registry of repositories Welder should manage, or a function which returns a promise that resolves to the same.
Type: Array|Function
Default: []
Usage
Using async registry retreival:
const Welder = ;const fuse = concurrency: 4 moduleDir: 'node_modules' configurationFile: 'package.json' dependencyKey: 'welderDependencies' installCommand: 'npm install' { return this; };
Using sync registry definition:
const Welder = ;const fuse = concurrency: 4 moduleDir: 'node_modules' configurationFile: 'package.json' dependencyKey: 'welderDependencies' installCommand: 'npm install' registry: name: 'test-foo' user: 'welder' host: 'github.com' sshUser: 'git' isPrivate: false name: 'test-bar' user: 'welder' host: 'github.com' sshUser: 'git' isPrivate: false name: 'test-baz' user: 'welder' host: 'github.com' sshUser: 'git' isPrivate: false name: 'test-qux' user: 'welder' host: 'github.com' sshUser: 'git' isPrivate: false ;
events
Welder subclasses EventEmitter. The following is available on each instance:
.on('debug', Function)
Verbose logging typically meant to be ignored unless explicitly requested.
.on('write', Function)
Standard logging for status messages during execution.
.on('ok', Function)
Standard logging for success messages during execution.
.on('error', Function)
Standard logging for failure messages during execution.
init(dir, opts)
Use this to initialize a directory with all repositories your instance of Welder is managing.
Does the following:
- Loads registry, or uses one explicitly provided.
- Checks specified directory for existing repositories.
- Clones any repositories that are missing.
- Symlinks all repositories together.
- Runs
npm install
inside each new repository.
opts.repos
The repositories initialize. If none provided, the entire registry will be used.
Type: Array
Default: this.loadRegistry()
Example entry format:
name: 'test-foo' user: 'welder' host: 'github.com' sshUser: 'git' isPrivate: false
Usage:
const Welder = ;const chalk = ;const DEBUG = true; const fuse = { return this; };fuse;fuse;fuse;fuse;fuse; fuse;
graph(dir)
Returns a promise which resolves to a dependency graph of the provided directory.
status(dir)
Emits write events which display a hierarchical representation of the current dependency graph.
sync(dir)
find(name)
Write me!
loadRegistry()
Write me!
requestFileFromGithub(registryEntry, filename)
Write me!