Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update node-gyp to 0.5

  • Loading branch information...
commit 7fa19049310eed9d766f10fb6e6edd9101676515 1 parent 8689ba8
@isaacs isaacs authored
Showing with 190 additions and 747 deletions.
  1. +14 −0 lib/init.js
  2. +8 −5 node_modules/node-gyp/README.md
  3. +32 −76 node_modules/node-gyp/bin/node-gyp.js
  4. +4 −0 node_modules/node-gyp/legacy/common.gypi
  5. +13 −11 node_modules/node-gyp/lib/build.js
  6. +2 −1  node_modules/node-gyp/lib/clean.js
  7. +21 −16 node_modules/node-gyp/lib/configure.js
  8. +43 −36 node_modules/node-gyp/lib/install.js
  9. +5 −3 node_modules/node-gyp/lib/list.js
  10. +29 −35 node_modules/node-gyp/lib/node-gyp.js
  11. +3 −1 node_modules/node-gyp/lib/rebuild.js
  12. +6 −4 node_modules/node-gyp/lib/remove.js
  13. +0 −29 node_modules/node-gyp/lib/util/mkdirp.js
  14. +0 −1  node_modules/node-gyp/node_modules/ansi/.npmignore
  15. +0 −89 node_modules/node-gyp/node_modules/ansi/README.md
  16. +0 −46 node_modules/node-gyp/node_modules/ansi/examples/imgcat.js
  17. BIN  node_modules/node-gyp/node_modules/ansi/examples/yoshi.png
  18. +0 −291 node_modules/node-gyp/node_modules/ansi/lib/ansi.js
  19. BIN  node_modules/node-gyp/node_modules/ansi/nodejs.png
  20. +0 −42 node_modules/node-gyp/node_modules/ansi/package.json
  21. +0 −51 node_modules/node-gyp/node_modules/ansi/server.js
  22. +9 −9 node_modules/node-gyp/package.json
  23. +1 −1  package.json
View
14 lib/init.js
@@ -28,6 +28,8 @@ function init (args, cb) {
data = {}
}
+ if (data.author) data.author = parseAuthor(data.author)
+
data.author = data.author ||
{ name: npm.config.get("init.author.name")
, email: npm.config.get("init.author.email")
@@ -237,6 +239,18 @@ function cleanupPath (m, folder) {
return m
}
+function parseAuthor (person) {
+ if (typeof person !== "string") return person
+ var name = person.match(/^([^\(<]+)/)
+ var url = person.match(/\(([^\)]+)\)/)
+ var email = person.match(/<([^>]+)>/)
+ var obj = {}
+ if (name && name[0].trim()) obj.name = name[0].trim()
+ if (email) obj.email = email[1];
+ if (url) obj.url = url[1];
+ return obj
+}
+
function unparseAuthor (a) {
if (!a) return ""
if (typeof a === "string") return a
View
13 node_modules/node-gyp/README.md
@@ -74,13 +74,15 @@ __Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or
`-d`) switch when running the either `configure` or `build` command.
-The "gyp" file
---------------
+The "binding.gyp" file
+----------------------
Previously when node had `node-waf` you had to write a `wscript` file. The
replacement for that is the `binding.gyp` file, which describes the configuration
-to build your module in a JSON-like format. A barebones `gyp` file appropriate for
-building a node addon looks like:
+to build your module in a JSON-like format. This file gets placed in the root of
+your package, alongside the `package.json` file.
+
+A barebones `gyp` file appropriate for building a node addon looks like:
``` json
{
@@ -93,11 +95,12 @@ building a node addon looks like:
}
```
-Some additional resources:
+Some additional resources for writing `gyp` files:
* ["Hello World" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)
* [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)
* [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)
+ * ['"binding.gyp" files out in the wild' wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)
Commands
View
108 node_modules/node-gyp/bin/node-gyp.js
@@ -11,9 +11,7 @@ process.title = 'node-gyp'
*/
var gyp = require('../')
- , inspect = require('util').inspect
- , ansi = require('ansi')
- , cursor = ansi(process.stderr)
+var log = require('npmlog')
/**
* Process and execute the selected commands.
@@ -26,52 +24,10 @@ if (prog.todo.length === 0) {
return prog.usageAndExit()
}
+log.info('it worked if it ends with', 'ok')
+log.info('using', 'node-gyp@%s', prog.version)
+log.info('using', 'node@%s', process.versions.node)
-/**
- * Set up logging handlers.
- */
-
-prog.on('info', function () {
- cursor.fg.green().write('info ')
- .fg.grey().write(arguments[0] + ' ')
- .reset()
- for (var i=1, l=arguments.length; i<l; i++) {
- cursor.write(arguments[i] + ' ')
- }
- cursor.write('\n')
-})
-
-prog.on('warn', function () {
- cursor.fg.yellow().bg.red().write('warn')
- .fg.reset().bg.reset().write(' ')
- .fg.grey().write(arguments[0])
- .write(' ')
- .reset()
- for (var i=1, l=arguments.length; i<l; i++) {
- cursor.write(arguments[i] + ' ')
- }
- cursor.write('\n')
-})
-
-if (prog.opts.verbose) {
- prog.on('verbose', function () {
- cursor.fg.cyan().write('verb ')
- .fg.grey().write(arguments[0] + ' ')
- .reset()
- for (var i=1, l=arguments.length; i<l; i++) {
- cursor.write(inspect(arguments[i]) + ' ')
- }
- cursor.write('\n')
- })
-}
-
-prog.on('spawn', function (command, args, proc) {
- cursor.fg.magenta().write('spawn ')
- .fg.grey().write(command + ' ')
- .reset().write(inspect(args) + '\n')
-})
-
-prog.info('it worked if it ends with', 'ok')
/**
* Change dir if -C/--directory was passed.
@@ -83,13 +39,17 @@ if (dir) {
try {
var stat = fs.statSync(dir)
if (stat.isDirectory()) {
- prog.info('chdir:', dir)
+ log.info('chdir', dir)
process.chdir(dir)
} else {
- prog.warn(dir + ' is not a directory')
+ log.warn('chdir', dir + ' is not a directory')
}
} catch (e) {
- prog.warn('directory:', e.message)
+ if (e.code === 'ENOENT') {
+ log.warn('chdir', dir + ' is not a directory')
+ } else {
+ log.warn('chdir', 'error during chdir() "%s"', e.message)
+ }
}
}
@@ -101,16 +61,20 @@ function run () {
if (prog.todo.length === 0) {
// done!
completed = true
- prog.info('done', 'ok')
+ log.info('done', 'ok')
return
}
var command = prog.todo.shift()
+
+ // is this an alias?
+ if (command in prog.aliases) {
+ command = prog.aliases[command]
+ }
+
prog.commands[command](prog.argv.slice(), function (err) {
if (err) {
- cursor.fg.red().write('ERR! ')
- .fg.reset().write(err.stack + '\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('not ok\n')
+ log.error(command + ' error', err.stack)
+ log.error('not ok')
return process.exit(1)
}
if (command == 'list') {
@@ -120,39 +84,31 @@ function run () {
console.log(version)
})
} else {
- prog.info('No node development files installed. Use `node-gyp install` to install a version.')
+ console.log('No node development files installed. Use `node-gyp install` to install a version.')
}
} else if (arguments.length >= 2) {
console.log.apply(console, [].slice.call(arguments, 1))
}
+
+ // now run the next command in the queue
process.nextTick(run)
})
}
process.on('exit', function (code) {
if (!completed && !code) {
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('Completion callback never invoked!\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('This is a bug in `node-gyp`. Please open an Issue:\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write(' https://github.com/TooTallNate/node-gyp/issues\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('not ok\n')
+ log.error('Completion callback never invoked!')
+ log.error('This is a bug in `node-gyp`, please file an Issue:')
+ log.error('', ' https://github.com/TooTallNate/node-gyp/issues')
+ log.error('not ok')
process.exit(6)
}
})
process.on('uncaughtException', function (err) {
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('UNCAUGHT EXCEPTION:\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write(err.stack + '\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('This is a bug in `node-gyp`. Please open an Issue:\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write(' https://github.com/TooTallNate/node-gyp/issues\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('not ok\n')
- process.exit(1)
+ log.error('UNCAUGHT EXCEPTION', err.stack)
+ log.error('This is a bug in `node-gyp`, please file an Issue:')
+ log.error('', ' https://github.com/TooTallNate/node-gyp/issues')
+ log.error('not ok')
+ process.exit(7)
})
View
4 node_modules/node-gyp/legacy/common.gypi
@@ -145,6 +145,10 @@
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
+ [ 'target_arch=="x64"', {
+ 'cflags': [ '-m64' ],
+ 'ldflags': [ '-m64' ],
+ }],
[ 'OS=="linux"', {
'ldflags': [ '-rdynamic' ],
}],
View
24 node_modules/node-gyp/lib/build.js
@@ -8,8 +8,9 @@ module.exports = exports = build
var fs = require('graceful-fs')
, path = require('path')
, glob = require('glob')
+ , log = require('npmlog')
, which = require('which')
- , mkdirp = require('./util/mkdirp')
+ , mkdirp = require('mkdirp')
, win = process.platform == 'win32'
, openbsd = process.platform == 'openbsd'
@@ -17,7 +18,6 @@ exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the mod
function build (gyp, argv, callback) {
- gyp.verbose('build args', argv)
var makeCommand = openbsd ? 'gmake' : 'make'
var command = win ? 'msbuild' : makeCommand
, buildDir = path.resolve('build')
@@ -59,9 +59,9 @@ function build (gyp, argv, callback) {
buildType = 'Release'
}
- gyp.verbose('build type:', buildType)
- gyp.verbose('architecture:', arch)
- gyp.verbose('node dev dir:', nodeDir)
+ log.verbose('build type:', buildType)
+ log.verbose('architecture:', arch)
+ log.verbose('node dev dir:', nodeDir)
if (win) {
findSolutionFile()
@@ -82,7 +82,7 @@ function build (gyp, argv, callback) {
return callback(new Error('Could not find *.sln file. Did you run "configure"?'))
}
guessedSolution = files[0]
- gyp.verbose('found first Solution file', guessedSolution)
+ log.verbose('found first Solution file', guessedSolution)
doWhich()
})
}
@@ -104,7 +104,7 @@ function build (gyp, argv, callback) {
}
return
}
- gyp.verbose('`which` succeeded for `' + command + '`', execPath)
+ log.verbose('`which` succeeded for `' + command + '`', execPath)
copyNodeLib()
})
}
@@ -114,7 +114,7 @@ function build (gyp, argv, callback) {
*/
function guessMsbuild () {
- gyp.verbose('could not find "msbuild.exe". guessing location')
+ log.verbose('could not find "msbuild.exe". guessing location')
// This is basically just hard-coded. If this causes problems
// then we'll think of something more clever.
var windir = process.env.WINDIR || process.env.SYSTEMROOT || 'C:\\WINDOWS'
@@ -149,9 +149,10 @@ function build (gyp, argv, callback) {
mkdirp(buildDir, function (err, isNew) {
if (err) return callback(err)
- gyp.verbose('"' + buildType + '" dir needed to be created?', isNew)
+ log.verbose('"' + buildType + '" dir needed to be created?', isNew)
var rs = fs.createReadStream(archNodeLibPath)
, ws = fs.createWriteStream(buildNodeLibPath)
+ log.verbose('copying "node.lib" for ' + arch, buildNodeLibPath)
rs.pipe(ws)
rs.on('error', callback)
ws.on('error', callback)
@@ -166,10 +167,11 @@ function build (gyp, argv, callback) {
function doBuild () {
// Enable Verbose build
- if (!win && gyp.opts.verbose) {
+ var verbose = log.levels[log.level] <= log.levels.verbose
+ if (!win && verbose) {
argv.push('V=1')
}
- if (win && !gyp.opts.verbose) {
+ if (win && !verbose) {
argv.push('/clp:Verbosity=minimal')
}
View
3  node_modules/node-gyp/lib/clean.js
@@ -8,6 +8,7 @@ exports.usage = 'Removes any generated build files and the "out" dir'
*/
var rm = require('rimraf')
+var log = require('npmlog')
function clean (gyp, argv, callback) {
@@ -15,7 +16,7 @@ function clean (gyp, argv, callback) {
// Remove the 'build' dir
var buildDir = 'build'
- gyp.verbose('removing "build" directory')
+ log.verbose('clean', 'removing "%s" directory', buildDir)
rm(buildDir, callback)
}
View
37 node_modules/node-gyp/lib/configure.js
@@ -8,9 +8,10 @@ module.exports = exports = configure
var fs = require('graceful-fs')
, path = require('path')
, glob = require('glob')
+ , log = require('npmlog')
, which = require('which')
, semver = require('semver')
- , mkdirp = require('./util/mkdirp')
+ , mkdirp = require('mkdirp')
, win = process.platform == 'win32'
exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module'
@@ -26,7 +27,7 @@ function configure (gyp, argv, callback) {
// Make sure that Python is in the $PATH
function checkPython () {
- gyp.verbose('checking for Python executable "' + python + '" in the PATH')
+ log.verbose('check python', 'checking for Python executable "%s" in the PATH', python)
which(python, function (err, execPath) {
if (err) {
if (win) {
@@ -36,7 +37,7 @@ function configure (gyp, argv, callback) {
}
return
}
- gyp.verbose('`which` succeeded for `' + python + '`', execPath)
+ log.verbose('`which` succeeded for `' + python + '`', execPath)
// TODO: ensure compatible Python version
getNodeDir()
})
@@ -45,13 +46,13 @@ function configure (gyp, argv, callback) {
// Called on Windows when "python" isn't available in the current $PATH.
// We're gonna glob C:\python2*
function guessPython () {
- gyp.verbose('could not find "' + python + '". guessing location')
+ log.verbose('could not find "' + python + '". guessing location')
var rootDir = process.env.HOMEDRIVE || process.env.SystemDrive || 'C:\\'
if (rootDir[rootDir.length - 1] !== '\\') {
rootDir += '\\'
}
var pythonPath = path.resolve(rootDir, 'Python27', 'python.exe')
- gyp.verbose('ensuring that file exists:', pythonPath)
+ log.verbose('ensuring that file exists:', pythonPath)
fs.stat(pythonPath, function (err, stat) {
if (err) {
if (err.code == 'ENOENT') {
@@ -87,7 +88,7 @@ function configure (gyp, argv, callback) {
nodeDir = nodeDir.replace(/^~/, process.env.HOME)
}
- gyp.verbose('compiling against specified --nodedir dev files', nodeDir)
+ log.verbose('get node dir', 'compiling against specified --nodedir dev files: %s', nodeDir)
createBuildDir()
} else {
@@ -98,11 +99,11 @@ function configure (gyp, argv, callback) {
if (gyp.opts.target) {
// if --target was given, then determine a target version to compile for
versionStr = gyp.opts.target
- gyp.verbose('compiling against --target node version', versionStr)
+ log.verbose('get node dir', 'compiling against --target node version: %s', versionStr)
} else {
// if no --target was specified then use the current host node version
versionStr = process.version
- gyp.verbose('no --target version specified, falling back to host node version', versionStr)
+ log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', versionStr)
}
// make sure we have a valid version
@@ -115,7 +116,7 @@ function configure (gyp, argv, callback) {
gyp.opts.ensure = true
gyp.commands.install([ versionStr ], function (err, version) {
if (err) return callback(err)
- gyp.verbose('target node version installed:', version)
+ log.verbose('get node dir', 'target node version installed:', version)
nodeDir = path.resolve(gyp.devDir, version)
createBuildDir()
})
@@ -123,19 +124,21 @@ function configure (gyp, argv, callback) {
}
function createBuildDir () {
- gyp.verbose('attempting to create "build" dir', buildDir)
+ log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir)
mkdirp(buildDir, function (err, isNew) {
if (err) return callback(err)
- gyp.verbose('"build" dir needed to be created?', isNew)
+ log.verbose('build dir', '"build" dir needed to be created?', isNew)
createConfigFile()
})
}
function createConfigFile (err) {
if (err) return callback(err)
- gyp.verbose('creating build/config.gypi file')
- configPath = path.resolve(buildDir, 'config.gypi')
+ var configFilename = 'config.gypi'
+ configPath = path.resolve(buildDir, configFilename)
+
+ log.verbose(configFilename, 'creating config file')
var config = process.config || {}
, defaults = config.target_defaults
@@ -194,10 +197,12 @@ function configure (gyp, argv, callback) {
return v
}
+ log.silly(configFilename, config)
+
// now write out the config.gypi file to the build/ dir
var prefix = '# Do not edit. File was generated by node-gyp\'s "configure" step'
, json = JSON.stringify(config, boolsToString, 2)
- gyp.verbose('writing out config file', configPath)
+ log.verbose(configFilename, 'writing out config file: %s', configPath)
fs.writeFile(configPath, [prefix, json, ''].join('\n'), runGypAddon)
}
@@ -209,11 +214,11 @@ function configure (gyp, argv, callback) {
if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) {
if (win) {
- gyp.verbose('gyp format was not specified; forcing "msvs"')
+ log.verbose('gyp_addon', 'gyp format was not specified; forcing "msvs"')
// force the 'make' target for non-Windows
argv.push('-f', 'msvs')
} else {
- gyp.verbose('gyp format was not specified; forcing "make"')
+ log.verbose('gyp_addon', 'gyp format was not specified; forcing "make"')
// force the 'make' target for non-Windows
argv.push('-f', 'make')
}
View
79 node_modules/node-gyp/lib/install.js
@@ -12,11 +12,12 @@ var fs = require('graceful-fs')
, rm = require('rimraf')
, path = require('path')
, zlib = require('zlib')
+ , log = require('npmlog')
, semver = require('semver')
, fstream = require('fstream')
, request = require('request')
, minimatch = require('minimatch')
- , mkdir = require('./util/mkdirp')
+ , mkdir = require('mkdirp')
, distUrl = 'http://nodejs.org/dist'
, win = process.platform == 'win32'
@@ -27,7 +28,7 @@ function install (gyp, argv, callback) {
if (cb.done) return
cb.done = true
if (err) {
- gyp.verbose('got an error, rolling back install')
+ log.warn('install', 'got an error, rolling back install')
// roll-back the install if anything went wrong
gyp.commands.remove([ version ], function (err2) {
callback(err)
@@ -40,7 +41,7 @@ function install (gyp, argv, callback) {
// Determine which node dev files version we are installing
var versionStr = argv[0] || gyp.opts.target || process.version
- gyp.verbose('input version string', versionStr)
+ log.verbose('install', 'input version string', versionStr)
// parse the version to normalize and ensure it's valid
var version = semver.parse(versionStr)
@@ -50,7 +51,7 @@ function install (gyp, argv, callback) {
// "legacy" versions are 0.7 and 0.6
var isLegacy = semver.lt(versionStr, '0.8.0')
- gyp.verbose('installing legacy version?', isLegacy)
+ log.verbose('installing legacy version?', isLegacy)
if (semver.lt(versionStr, '0.6.0')) {
return callback(new Error('Minimum target version is `0.6.0` or greater. Got: ' + versionStr))
@@ -60,12 +61,12 @@ function install (gyp, argv, callback) {
if (version[5] === '-pre') {
version[3] = +version[3] - 1
version[5] = null
- gyp.verbose('-pre version detected, adjusting patch version')
+ log.verbose('-pre version detected, adjusting patch version')
}
// flatten version into String
version = version.slice(1, 4).join('.')
- gyp.verbose('installing version', version)
+ log.verbose('install', 'installing version: %s', version)
// the directory where the dev files will be installed
var devDir = path.resolve(gyp.devDir, version)
@@ -73,31 +74,31 @@ function install (gyp, argv, callback) {
// If '--ensure' was passed, then don't *always* install the version;
// check if it is already installed, and only install when needed
if (gyp.opts.ensure) {
- gyp.verbose('--ensure was passed, so won\'t reinstall if already installed')
+ log.verbose('install', '--ensure was passed, so won\'t reinstall if already installed')
fs.stat(devDir, function (err, stat) {
if (err) {
if (err.code == 'ENOENT') {
- gyp.verbose('version not already installed, continuing with install', version)
+ log.verbose('install', 'version not already installed, continuing with install', version)
go()
} else {
cb(err)
}
return
}
- gyp.verbose('version is already installed, need to check "installVersion"')
+ log.verbose('install', 'version is already installed, need to check "installVersion"')
var installVersionFile = path.resolve(devDir, 'installVersion')
fs.readFile(installVersionFile, 'ascii', function (err, ver) {
if (err && err.code != 'ENOENT') {
return cb(err)
}
var installVersion = parseInt(ver, 10) || 0
- gyp.verbose('got "installVersion":', installVersion)
- gyp.verbose('needs "installVersion":', gyp.package.installVersion)
+ log.verbose('got "installVersion"', installVersion)
+ log.verbose('needs "installVersion"', gyp.package.installVersion)
if (installVersion < gyp.package.installVersion) {
- gyp.verbose('version is no good; reinstalling')
+ log.verbose('install', 'version is no good; reinstalling')
go()
} else {
- gyp.verbose('version is good')
+ log.verbose('install', 'version is good')
cb()
}
})
@@ -107,7 +108,8 @@ function install (gyp, argv, callback) {
}
function download (url, onError) {
- gyp.info('downloading:', url)
+ log.http('GET', url)
+
var requestOpts = {
uri: url
, onResponse: true
@@ -119,22 +121,26 @@ function install (gyp, argv, callback) {
|| process.env.HTTP_PROXY
|| process.env.npm_config_proxy
if (proxyUrl) {
- gyp.verbose('using proxy:', proxyUrl)
+ log.verbose('proxy', proxyUrl)
requestOpts.proxy = proxyUrl
}
- return request(requestOpts, onError)
+ var req = request(requestOpts, onError)
+ req.on('response', function (res) {
+ log.http(res.statusCode, url)
+ })
+ return req
}
function go () {
+ log.verbose('ensuring nodedir is created', devDir)
+
// first create the dir for the node dev files
mkdir(devDir, function (err, created) {
if (err) return cb(err)
if (created) {
- gyp.verbose('created:', devDir)
- } else {
- gyp.verbose('directory already existed:', devDir)
+ log.verbose('created nodedir', created)
}
// now download the node tarball
@@ -148,18 +154,19 @@ function install (gyp, argv, callback) {
// only .h header files and the gyp files get extracted
function isValid () {
var name = this.path.substring(devDir.length + 1)
- , _valid = valid(name)
+ var isValid = valid(name)
if (name === '' && this.type === 'Directory') {
// the first directory entry is ok
return true
}
- if (_valid) {
- gyp.verbose('extracted file from tarball', name)
+ if (isValid) {
+ log.verbose('extracted file from tarball', name)
extractCount++
} else {
// invalid
+ log.silly('ignoring from tarball', name)
}
- return _valid
+ return isValid
}
gunzip.on('error', cb)
@@ -185,7 +192,7 @@ function install (gyp, argv, callback) {
if (extractCount === 0) {
return cb(new Error('There was a fatal problem while downloading/extracting the tarball'))
}
- gyp.verbose('done parsing tarball')
+ log.verbose('tarball', 'done parsing tarball')
var async = 0
if (isLegacy) {
@@ -219,17 +226,17 @@ function install (gyp, argv, callback) {
function copyLegacy (done) {
// legacy versions of node (< 0.8) require the legacy files to be copied
// over since they contain many bugfixes from the current node build system
- gyp.verbose('copying "legacy" gyp configuration files for version', version)
+ log.verbose('legacy', 'copying "legacy" gyp configuration files for version', version)
var legacyDir = path.resolve(__dirname, '..', 'legacy')
- gyp.verbose('using "legacy" dir', legacyDir)
- gyp.verbose('copying to "dev" dir', devDir)
+ log.verbose('legacy', 'using "legacy" dir', legacyDir)
+ log.verbose('legacy', 'copying to "dev" dir', devDir)
var reader = fstream.Reader({ path: legacyDir, type: 'Directory' })
- , writer = fstream.Writer({ path: devDir, type: 'Directory' })
+ var writer = fstream.Writer({ path: devDir, type: 'Directory' })
reader.on('entry', function onEntry (entry) {
- gyp.verbose('reading entry', entry.path)
+ log.verbose('legacy', 'reading entry:', entry.path)
entry.on('entry', onEntry)
})
@@ -243,7 +250,7 @@ function install (gyp, argv, callback) {
}
function downloadNodeLib (done) {
- gyp.verbose('on Windows; need to download `node.lib`...')
+ log.verbose('on Windows; need to download `node.lib`...')
var dir32 = path.resolve(devDir, 'ia32')
, dir64 = path.resolve(devDir, 'x64')
, nodeLibPath32 = path.resolve(dir32, 'node.lib')
@@ -251,15 +258,15 @@ function install (gyp, argv, callback) {
, nodeLibUrl32 = distUrl + '/v' + version + '/node.lib'
, nodeLibUrl64 = distUrl + '/v' + version + '/x64/node.lib'
- gyp.verbose('32-bit node.lib dir', dir32)
- gyp.verbose('64-bit node.lib dir', dir64)
- gyp.verbose('`node.lib` 32-bit url', nodeLibUrl32)
- gyp.verbose('`node.lib` 64-bit url', nodeLibUrl64)
+ log.verbose('32-bit node.lib dir', dir32)
+ log.verbose('64-bit node.lib dir', dir64)
+ log.verbose('`node.lib` 32-bit url', nodeLibUrl32)
+ log.verbose('`node.lib` 64-bit url', nodeLibUrl64)
var async = 2
mkdir(dir32, function (err) {
if (err) return done(err)
- gyp.verbose('streaming 32-bit node.lib to:', nodeLibPath32)
+ log.verbose('streaming 32-bit node.lib to:', nodeLibPath32)
var req = download(nodeLibUrl32)
req.on('error', done)
@@ -278,7 +285,7 @@ function install (gyp, argv, callback) {
})
mkdir(dir64, function (err) {
if (err) return done(err)
- gyp.verbose('streaming 64-bit node.lib to:', nodeLibPath64)
+ log.verbose('streaming 64-bit node.lib to:', nodeLibPath64)
var req = download(nodeLibUrl64)
req.on('error', done)
View
8 node_modules/node-gyp/lib/list.js
@@ -9,13 +9,15 @@ exports.usage = 'Prints a listing of the currently installed node development fi
var fs = require('graceful-fs')
, path = require('path')
+ , log = require('npmlog')
function list (gyp, args, callback) {
- gyp.verbose('using node-gyp dir', gyp.devDir)
+ var devDir = gyp.devDir
+ log.verbose('list', 'using node-gyp dir:', devDir)
- // readdir the node-gyp dir
- fs.readdir(gyp.devDir, onreaddir)
+ // readdir() the node-gyp dir
+ fs.readdir(devDir, onreaddir)
function onreaddir (err, versions) {
if (err && err.code != 'ENOENT') {
View
64 node_modules/node-gyp/lib/node-gyp.js
@@ -8,6 +8,7 @@ module.exports = exports = gyp
var fs = require('graceful-fs')
, path = require('path')
, nopt = require('nopt')
+ , log = require('npmlog')
, child_process = require('child_process')
, EE = require('events').EventEmitter
, inherits = require('util').inherits
@@ -27,6 +28,8 @@ var fs = require('graceful-fs')
, 'rm': 'remove'
}
+log.heading = 'gyp'
+
/**
* The `gyp` function.
*/
@@ -36,10 +39,10 @@ function gyp () {
}
function Gyp () {
- var me = this
+ var self = this
// set the dir where node-gyp dev files get installed
- // TODO: make this configurable?
+ // TODO: make this *more* configurable?
// see: https://github.com/TooTallNate/node-gyp/issues/21
var homeDir = process.env.HOME || process.env.USERPROFILE
this.devDir = path.resolve(homeDir, '.node-gyp')
@@ -47,15 +50,11 @@ function Gyp () {
this.commands = {}
commands.forEach(function (command) {
- me.commands[command] = function (argv, callback) {
- me.verbose('command', command, argv)
- return require('./' + command)(me, argv, callback)
+ self.commands[command] = function (argv, callback) {
+ log.verbose('command', command, argv)
+ return require('./' + command)(self, argv, callback)
}
})
-
- Object.keys(aliases).forEach(function (alias) {
- me.commands[alias] = me.commands[aliases[alias]]
- })
}
inherits(Gyp, EE)
exports.Gyp = Gyp
@@ -78,10 +77,10 @@ proto.configDefs = {
, directory: String // bin
, msvs_version: String // 'configure'
, ensure: Boolean // 'install'
- , verbose: Boolean // everywhere
, solution: String // 'build' (windows only)
, proxy: String // 'install'
, nodedir: String // 'configure'
+ , loglevel: String // everywhere
}
/**
@@ -91,10 +90,18 @@ proto.configDefs = {
proto.shorthands = {
release: '--no-debug'
, C: '--directory'
- , d: '--debug'
+ , debug: '--debug'
+ , silly: '--loglevel=silly'
+ , verbose: '--loglevel=verbose'
}
/**
+ * expose the command aliases for the bin file to use.
+ */
+
+proto.aliases = aliases
+
+/**
* Parses the given argv array and sets the 'opts',
* 'argv' and 'command' properties.
*/
@@ -105,7 +112,7 @@ proto.parseArgv = function parseOpts (argv) {
var commands = []
this.argv.slice().forEach(function (arg) {
- if (arg in this.commands) {
+ if (arg in this.commands || arg in this.aliases) {
this.argv.splice(this.argv.indexOf(arg), 1)
commands.push(arg)
}
@@ -119,10 +126,7 @@ proto.parseArgv = function parseOpts (argv) {
if (name.indexOf(npm_config_prefix) !== 0) return
var val = process.env[name]
if (name === npm_config_prefix + 'loglevel') {
- // "loglevel" is a special case; check for "verbose"
- if (val === 'verbose') {
- this.opts.verbose = true
- }
+ log.level = val
} else {
// take the config name and check if it's one that node-gyp cares about
name = name.substring(npm_config_prefix.length)
@@ -131,6 +135,11 @@ proto.parseArgv = function parseOpts (argv) {
}
}
}, this)
+
+ if (this.opts.loglevel) {
+ log.level = this.opts.loglevel
+ }
+ log.resume()
}
/**
@@ -143,31 +152,15 @@ proto.spawn = function spawn (command, args, opts) {
opts.customFds = [ 0, 1, 2 ]
}
var cp = child_process.spawn(command, args, opts)
- this.emit('spawn', command, args, cp)
+ log.info('spawn', command)
+ log.info('spawn args', args)
return cp
}
/**
- * Logging mechanisms.
+ * Prints the usage instructions and then exits.
*/
-proto.info = function info () {
- var args = Array.prototype.slice.call(arguments)
- args.unshift('info')
- this.emit.apply(this, args)
-}
-proto.warn = function warn () {
- var args = Array.prototype.slice.call(arguments)
- args.unshift('warn')
- this.emit.apply(this, args)
-}
-
-proto.verbose = function verbose () {
- var args = Array.prototype.slice.call(arguments)
- args.unshift('verbose')
- this.emit.apply(this, args)
-}
-
proto.usageAndExit = function usageAndExit () {
var usage = [
''
@@ -182,6 +175,7 @@ proto.usageAndExit = function usageAndExit () {
, ' $ node-gyp <command> --help'
, ''
, 'node-gyp@' + this.version + ' ' + path.resolve(__dirname, '..')
+ , 'node@' + process.versions.node
].join('\n')
console.log(usage)
View
4 node_modules/node-gyp/lib/rebuild.js
@@ -3,13 +3,15 @@ module.exports = exports = rebuild
exports.usage = 'Runs "clean", "configure" and "build" all at once'
+var log = require('npmlog')
+
function rebuild (gyp, argv, callback) {
// first "clean"
gyp.commands.clean([], function (err) {
if (err) {
// don't bail
- gyp.info(err.stack);
+ log.info('rebuild clean failed', err.stack);
}
gyp.commands.configure([], function (err) {
View
10 node_modules/node-gyp/lib/remove.js
@@ -10,14 +10,17 @@ exports.usage = 'Removes the node development files for the specified version'
var fs = require('fs')
, rm = require('rimraf')
, path = require('path')
+ , log = require('npmlog')
, semver = require('semver')
function remove (gyp, argv, callback) {
- gyp.verbose('using node-gyp dir', gyp.devDir)
+ var devDir = gyp.devDir
+ log.verbose('remove', 'using node-gyp dir:', devDir)
// get the user-specified version to remove
var v = argv[0] || gyp.opts.target
+ log.verbose('remove', 'removing target version:', v)
if (!v) {
return callback(new Error('You must specify a version number to remove. Ex: "' + process.version + '"'))
@@ -34,14 +37,13 @@ function remove (gyp, argv, callback) {
version = version.slice(1, 4).join('.')
var versionPath = path.resolve(gyp.devDir, version)
- gyp.verbose('removing development files for version', version)
+ log.verbose('remove', 'removing development files for version:', version)
// first check if its even installed
fs.stat(versionPath, function (err, stat) {
if (err) {
if (err.code == 'ENOENT') {
- gyp.info('version was already not installed', version)
- callback()
+ callback(null, 'version was already uninstalled: ' + version)
} else {
callback(err)
}
View
29 node_modules/node-gyp/lib/util/mkdirp.js
@@ -1,29 +0,0 @@
-
-/**
- * Tiny wrapper around substack's mkdirp module, to add a return value
- * to it. `true` if any directories were created in the process, `false`
- * if the target directory already existed. The `err` is still the first
- * argument in case anything actually wrong happens.
- */
-
-var fs = require('fs')
- , mkdirp_ = require('mkdirp')
-
-module.exports = function mkdirp (path, cb) {
- // first stat() to see if the target exists
- fs.stat(path, function (err) {
- if (err) {
- if (err.code == 'ENOENT') {
- // doesn't exist, mkdirp it
- mkdirp_(path, function (err) {
- if (err) return cb(err)
- cb(err, true)
- })
- } else {
- cb(err)
- }
- return
- }
- cb(err, false)
- })
-}
View
1  node_modules/node-gyp/node_modules/ansi/.npmignore
@@ -1 +0,0 @@
-node_modules
View
89 node_modules/node-gyp/node_modules/ansi/README.md
@@ -1,89 +0,0 @@
-ansi.js
-=========
-### Advanced ANSI formatting tool for Node.js
-
-![](http://f.cl.ly/items/0D3w3d1W443f2z3X361G/Screen%20Shot%202012-01-26%20at%202.18.31%20AM.png)
-
-`ansi.js` is a module for Node.js that provides an easy-to-use API for
-writing ANSI escape codes to `Stream` instances. ANSI escape codes are used to do
-fancy things in a terminal window, like render text in colors, delete characters,
-lines, the entire window, or hide and show the cursor, and lots more!
-
-The code for the example in the screenshot above can be found in the `examples`
-directory.
-
-#### Features:
-
- * 256 color support for the terminal!
- * Works with *any* writable `Stream` instance.
- * Allows you to move the cursor anywhere on the terminal window.
- * Allows you to delete existing contents from the terminal window.
- * Allows you to hide and show the cursor.
- * Converts CSS color codes and RGB values into ANSI escape codes.
- * Low-level; you are in control of when escape codes are used, it's not abstracted.
- * Optional automatic cleanup of stream by before closing (still TODO).
-
-
-Installation
-------------
-
-Install with `npm`:
-
-``` bash
-$ npm install ansi
-```
-
-
-Example
--------
-
-``` js
-var ansi = require('ansi')
- , cursor = ansi(process.stdout)
-
-// You can chain your calls forever:
-cursor.red() // Set font color to red
- .bg.blue() // Set background color to blue
- .write('Hello World!') // Write 'Hello World!' to stdout
- .reset() // When a bg color is set, call reset() before
- // writing the trailing \n, to avoid Terminal glitches
- .write('\n') // And a final \n to wrap things up
-
-// Rendering modes are persistent:
-cursor.green().bold()
-
-// You can use the regular logging functions, text will be green
-console.log('This is green, bold text')
-
-// To reset just the foreground color:
-cursor.fg.reset()
-
-console.log('This will still be bold')
-```
-
-
-License
--------
-
-(The MIT License)
-
-Copyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
46 node_modules/node-gyp/node_modules/ansi/examples/imgcat.js
@@ -1,46 +0,0 @@
-#!/usr/bin/env node
-
-var ansi = require('../')
- , cursor = ansi(process.stdout)
- , tty = require('tty')
- , Canvas = require('canvas')
- , imageFile = process.argv[2] || __dirname + '/yoshi.png'
- , image = require('fs').readFileSync(imageFile)
- , pixel = ' '
- , alphaThreshold = 0
-
-var img = new Canvas.Image();
-img.src = image;
-
-function draw () {
- var width = process.stdout.getWindowSize()[0] / pixel.length | 0
- , scaleW = img.width > width ? width / img.width : 1
- , w = Math.floor(img.width * scaleW)
- , h = Math.floor(img.height * scaleW);
-
- var canvas = new Canvas(w, h)
- , ctx = canvas.getContext('2d');
-
- ctx.drawImage(img, 0, 0, w, h);
-
- var data = ctx.getImageData(0, 0, w, h).data;
-
- for (var i=0, l=data.length; i<l; i+=4) {
- var r = data[i]
- , g = data[i+1]
- , b = data[i+2]
- , alpha = data[i+3];
- if (alpha > alphaThreshold) {
- cursor.bg.rgb(r, g, b);
- } else {
- cursor.bg.reset();
- }
- process.stdout.write(pixel);
- if ((i/4|0) % w === (w-1)) {
- cursor.bg.reset();
- process.stdout.write('\n');
- }
- }
-}
-
-draw();
View
BIN  node_modules/node-gyp/node_modules/ansi/examples/yoshi.png
Deleted file not rendered
View
291 node_modules/node-gyp/node_modules/ansi/lib/ansi.js
@@ -1,291 +0,0 @@
-
-/**
- * Reference: http://en.wikipedia.org/wiki/ANSI_escape_code
- */
-
-/**
- * Module dependencies.
- */
-
-var prefix = '\033[' // For all escape codes
- , suffix = 'm'; // Only for color codes
-
-/**
- * The ANSI escape sequences.
- */
-
-var codes = {
- up: 'A'
- , down: 'B'
- , forward: 'C'
- , back: 'D'
- , nextLine: 'E'
- , previousLine: 'F'
- , horizontalAbsolute: 'G'
- , eraseData: 'J'
- , eraseLine: 'K'
- , scrollUp: 'S'
- , scrollDown: 'T'
- , savePosition: 's'
- , restorePosition: 'u'
- , hide: '?25l'
- , show: '?25h'
-};
-
-/**
- * Rendering ANSI codes.
- */
-
-var styles = {
- bold: 1
- , italic: 3
- , underline: 4
- , inverse: 7
-};
-
-/**
- * The negating ANSI code for the rendering modes.
- */
-
-var reset = {
- bold: 22
- , italic: 23
- , underline: 24
- , inverse: 27
- , foreground: 39
- , background: 49
-};
-
-/**
- * The standard, styleable ANSI colors.
- */
-
-var colors = {
- white: 37
- , grey: 90
- , black: 30
- , blue: 34
- , cyan: 36
- , green: 32
- , magenta: 35
- , red: 31
- , yellow: 33
-};
-
-
-/**
- * Creates a Cursor instance based off the given `writable stream` instance.
- */
-
-function ansi (stream, options) {
- return new Cursor(stream, options);
-}
-module.exports = exports = ansi;
-
-/**
- * The `Cursor` class.
- */
-
-function Cursor (stream, options) {
- this.stream = stream;
- this.fg = this.foreground = new Foreground(this);
- this.bg = this.background = new Background(this);
-}
-exports.Cursor = Cursor;
-
-/**
- * The `Foreground` class.
- */
-
-function Foreground (cursor) {
- this.cursor = cursor;
-}
-exports.Foreground = Foreground;
-
-/**
- * The `Background` class.
- */
-
-function Background (cursor) {
- this.cursor = cursor;
-}
-exports.Background = Background;
-
-/**
- * Helper function that calls `write()` on the underlying Stream.
- */
-
-Cursor.prototype.write = function () {
- this.stream.write.apply(this.stream, arguments);
- return this;
-}
-
-/**
- * Set up the positional ANSI codes.
- */
-
-Object.keys(codes).forEach(function (name) {
- var code = String(codes[name]);
- Cursor.prototype[name] = function () {
- var c = code;
- if (arguments.length > 0) {
- c = Math.round(arguments[0]) + code;
- }
- this.write(prefix + c);
- return this;
- }
-});
-
-/**
- * Set up the functions for the rendering ANSI codes.
- */
-
-Object.keys(styles).forEach(function (style) {
- var name = style[0].toUpperCase() + style.substring(1);
-
- Cursor.prototype[style] = function () {
- this.write(prefix + styles[style] + suffix);
- return this;
- }
-
- Cursor.prototype['reset'+name] = function () {
- this.write(prefix + reset[style] + suffix);
- return this;
- }
-});
-
-/**
- * Setup the functions for the standard colors.
- */
-
-Object.keys(colors).forEach(function (color) {
- Foreground.prototype[color] = function () {
- this.cursor.write(prefix + colors[color] + suffix);
- return this.cursor;
- }
-
- var bgCode = colors[color] + 10;
- Background.prototype[color] = function () {
- this.cursor.write(prefix + bgCode + suffix);
- return this.cursor;
- }
-
- Cursor.prototype[color] = function () {
- return this.foreground[color]();
- }
-});
-
-/**
- * Makes a beep sound!
- */
-
-Cursor.prototype.beep = function () {
- this.write('\007');
- return this;
-}
-
-/**
- * Moves cursor to specific position
- */
-
-Cursor.prototype.goto = function (x, y) {
- x = ~~x;
- y = ~~y;
- this.write(prefix + y + ';' + x + 'H');
- return this;
-}
-
-/**
- * Reset the foreground color.
- */
-
-Foreground.prototype.reset = function () {
- this.cursor.write(prefix + reset.foreground + suffix);
- return this.cursor;
-}
-
-/**
- * Reset the background color.
- */
-
-Background.prototype.reset = function () {
- this.cursor.write(prefix + reset.background + suffix);
- return this.cursor;
-}
-
-/**
- * Resets all ANSI formatting on the stream.
- */
-
-Cursor.prototype.reset = function () {
- this.write(prefix + '0' + suffix);
- return this;
-}
-
-/**
- * Sets the foreground color with the given RGB values.
- * The closest match out of the 216 colors is picked.
- */
-
-Foreground.prototype.rgb = function (r, g, b) {
- this.cursor.write(prefix + '38;5;' + rgb(r, g, b) + suffix);
- return this.cursor;
-}
-
-/**
- * Sets the background color with the given RGB values.
- * The closest match out of the 216 colors is picked.
- */
-
-Background.prototype.rgb = function (r, g, b) {
- this.cursor.write(prefix + '48;5;' + rgb(r, g, b) + suffix);
- return this.cursor;
-}
-
-/**
- * Same as `cursor.fg.rgb()`.
- */
-
-Cursor.prototype.rgb = function (r, g, b) {
- return this.foreground.rgb(r, g, b);
-}
-
-/**
- * Accepts CSS color codes for use with ANSI escape codes.
- * For example: `#FF000` would be bright red.
- */
-
-Foreground.prototype.hex = Background.prototype.hex = function (color) {
- var rgb = hex(color);
- return this.rgb(rgb[0], rgb[1], rgb[2]);
-}
-
-/**
- * Same as `cursor.fg.hex()`.
- */
-
-Cursor.prototype.hex = function (color) {
- return this.foreground.hex(color);
-}
-
-function rgb (r, g, b) {
- var red = r / 255 * 5
- , green = g / 255 * 5
- , blue = b / 255 * 5;
- return rgb5(red, green, blue);
-}
-
-function rgb5 (r, g, b) {
- var red = Math.round(r)
- , green = Math.round(g)
- , blue = Math.round(b);
- return 16 + (red*36) + (green*6) + blue;
-}
-
-function hex (color) {
- var c = color[0] === '#' ? color.substring(1) : color
- , r = c.substring(0, 2)
- , g = c.substring(2, 4)
- , b = c.substring(4, 6);
- return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)];
-}
View
BIN  node_modules/node-gyp/node_modules/ansi/nodejs.png
Deleted file not rendered
View
42 node_modules/node-gyp/node_modules/ansi/package.json
@@ -1,42 +0,0 @@
-{
- "name": "ansi",
- "description": "Advanced ANSI formatting tool for Node.js",
- "keywords": [
- "ansi",
- "formatting",
- "cursor",
- "color",
- "terminal",
- "rgb",
- "256",
- "stream"
- ],
- "version": "0.0.4",
- "author": {
- "name": "Nathan Rajlich",
- "email": "nathan@tootallnate.net",
- "url": "http://tootallnate.net"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/TooTallNate/ansi.js.git"
- },
- "main": "./lib/ansi.js",
- "scripts": {
- "test": "mocha --reporter spec",
- "start": "node server.js"
- },
- "devDependencies": {
- "mocha": "*",
- "canvas": "*"
- },
- "engines": {
- "node": ">= 0.4.0 && < 0.9.0"
- },
- "readme": "ansi.js\n=========\n### Advanced ANSI formatting tool for Node.js\n\n![](http://f.cl.ly/items/0D3w3d1W443f2z3X361G/Screen%20Shot%202012-01-26%20at%202.18.31%20AM.png)\n\n`ansi.js` is a module for Node.js that provides an easy-to-use API for\nwriting ANSI escape codes to `Stream` instances. ANSI escape codes are used to do\nfancy things in a terminal window, like render text in colors, delete characters,\nlines, the entire window, or hide and show the cursor, and lots more!\n\nThe code for the example in the screenshot above can be found in the `examples`\ndirectory.\n\n#### Features:\n\n * 256 color support for the terminal!\n * Works with *any* writable `Stream` instance.\n * Allows you to move the cursor anywhere on the terminal window.\n * Allows you to delete existing contents from the terminal window.\n * Allows you to hide and show the cursor.\n * Converts CSS color codes and RGB values into ANSI escape codes.\n * Low-level; you are in control of when escape codes are used, it's not abstracted.\n * Optional automatic cleanup of stream by before closing (still TODO).\n\n\nInstallation\n------------\n\nInstall with `npm`:\n\n``` bash\n$ npm install ansi\n```\n\n\nExample\n-------\n\n``` js\nvar ansi = require('ansi')\n , cursor = ansi(process.stdout)\n\n// You can chain your calls forever:\ncursor.red() // Set font color to red\n .bg.blue() // Set background color to blue\n .write('Hello World!') // Write 'Hello World!' to stdout\n .reset() // When a bg color is set, call reset() before\n // writing the trailing \\n, to avoid Terminal glitches\n .write('\\n') // And a final \\n to wrap things up\n\n// Rendering modes are persistent:\ncursor.green().bold()\n\n// You can use the regular logging functions, text will be green\nconsole.log('This is green, bold text')\n\n// To reset just the foreground color:\ncursor.fg.reset()\n\nconsole.log('This will still be bold')\n```\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
- "_id": "ansi@0.0.4",
- "dist": {
- "shasum": "1bbdab47714665c8484fb62da53f4553c6baec73"
- },
- "_from": "ansi@0.0.x"
-}
View
51 node_modules/node-gyp/node_modules/ansi/server.js
@@ -1,51 +0,0 @@
-var http = require('http')
- , ansi = require('./')
- , Canvas = require('canvas')
- , Image = Canvas.Image
- , imageFile = process.argv[2] || __dirname + '/examples/yoshi.png'
- , image = require('fs').readFileSync(imageFile)
-
-var img = new Image()
-img.src = image
-
-var server = http.createServer(function (req, res) {
- draw(res);
-})
-
-server.listen(8080, function () {
- console.error('HTTP server listening on:', this.address())
-})
-
-function draw (stream) {
- var cursor = ansi(stream)
- , pixel = ' '
- , width = img.width
- , scaleW = img.width > width ? width / img.width : 1
- , w = Math.floor(img.width * scaleW)
- , h = Math.floor(img.height * scaleW);
-
- var canvas = new Canvas(w, h)
- , ctx = canvas.getContext('2d');
-
- ctx.drawImage(img, 0, 0, w, h);
-
- var data = ctx.getImageData(0, 0, w, h).data;
-
- for (var i=0, l=data.length; i<l; i+=4) {
- var r = data[i]
- , g = data[i+1]
- , b = data[i+2]
- , alpha = data[i+3];
- if (alpha > 0) {
- cursor.bg.rgb(r, g, b);
- } else {
- cursor.bg.reset();
- }
- stream.write(pixel);
- if ((i/4|0) % w === (w-1)) {
- cursor.bg.reset();
- stream.write('\n');
- }
- }
- stream.end();
-}
View
18 node_modules/node-gyp/package.json
@@ -10,8 +10,8 @@
"bindings",
"gyp"
],
- "version": "0.4.5",
- "installVersion": 8,
+ "version": "0.5.0",
+ "installVersion": 9,
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
@@ -27,14 +27,14 @@
},
"main": "./lib/node-gyp.js",
"dependencies": {
- "ansi": "0.0.x",
"glob": "3",
"graceful-fs": "1",
"fstream": "~0.1.13",
- "minimatch": "0.2.x",
+ "minimatch": "0.2",
"mkdirp": "0.3",
"nopt": "1",
- "request": "2.9.x",
+ "npmlog": "0",
+ "request": "2.9",
"rimraf": "2",
"semver": "1",
"tar": "~0.1.12",
@@ -43,10 +43,10 @@
"engines": {
"node": ">= 0.6.0"
},
- "readme": "node-gyp\n=========\n### Node.js native addon build tool\n\n`node-gyp` is a cross-platform command-line tool written in Node.js for compiling\nnative addon modules for Node.js, which takes away the pain of dealing with the\nvarious differences in build platforms. It is the replacement to the `node-waf`\nprogram which is removed for node `v0.8`. If you have a native addon for node that\nstill has a `wscript` file, then you should definitely add a `binding.gyp` file\nto support the latest versions of node.\n\nMultiple target versions of node are supported (i.e. `0.6`, `0.7`,..., `1.0`,\netc.), regardless of what version of node is actually installed on your system\n(`node-gyp` downloads the necessary development files for the target version).\n\n#### Features:\n\n * Easy to use, consistent interface\n * Same commands to build your module on every platform\n * Supports multiple target versions of Node\n\n\nInstallation\n------------\n\nYou can install with `npm`:\n\n``` bash\n$ npm install -g node-gyp\n```\n\nYou will also need to install:\n\n * On Unix:\n * `python`\n * `make`\n * A proper C/C++ compiler toolchain, like GCC\n * On Windows:\n * [Python][windows-python] ([`v2.7.2`][windows-python-v2.7.2] recommended, `v3.x.x` not yet supported)\n * Microsoft Visual C++ ([Express][msvc] version works well)\n * For 64-bit builds of node and native modules you will _also_ need the [Windows 7 64-bit SDK][win7sdk]\n\nHow to Use\n----------\n\nTo compile your native addon, first go to its root directory:\n\n``` bash\n$ cd my_node_addon\n```\n\nThe next step is to generate the appropriate project build files for the current\nplatform. Use `configure` for that:\n\n``` bash\n$ node-gyp configure\n```\n\n__Note__: The `configure` step looks for the `binding.gyp` file in the current\ndirectory to processs. See below for instructions on creating the `binding.gyp` file.\n\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file\n(on Windows) in the `build/` directory. Next invoke the `build` command:\n\n``` bash\n$ node-gyp build\n```\n\nNow you have your compiled `.node` bindings file! The compiled bindings end up\nin `build/Debug/` or `build/Release/`, depending on the build mode. At this point\nyou can require the `.node` file with Node and run your tests!\n\n__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or\n`-d`) switch when running the either `configure` or `build` command.\n\n\nThe \"gyp\" file\n--------------\n\nPreviously when node had `node-waf` you had to write a `wscript` file. The\nreplacement for that is the `binding.gyp` file, which describes the configuration\nto build your module in a JSON-like format. A barebones `gyp` file appropriate for\nbuilding a node addon looks like:\n\n``` json\n{\n \"targets\": [\n {\n \"target_name\": \"binding\",\n \"sources\": [ \"src/binding.cc\" ]\n }\n ]\n}\n```\n\nSome additional resources:\n\n * [\"Hello World\" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)\n * [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)\n * [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)\n\n\nCommands\n--------\n\n`node-gyp` responds to the following commands:\n\n * `build` - Invokes `make`/`msbuild.exe` and builds the native addon\n * `clean` - Removes any generated project files and the `out` dir\n * `configure` - Generates project build files for the current platform\n * `rebuild` - Runs \"clean\", \"configure\" and \"build\" all at once\n * `install` - Installs node development files for the given version.\n * `list` - Lists the currently installed node development file versions\n * `remove` - Removes a node development files for a given version\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[windows-python]: http://www.python.org/getit/windows\n[windows-python-v2.7.2]: http://www.python.org/download/releases/2.7.2#download\n[msvc]: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express\n[win7sdk]: http://www.microsoft.com/download/en/details.aspx?displayLang=en&id=8279\n",
- "_id": "node-gyp@0.4.5",
+ "readme": "node-gyp\n=========\n### Node.js native addon build tool\n\n`node-gyp` is a cross-platform command-line tool written in Node.js for compiling\nnative addon modules for Node.js, which takes away the pain of dealing with the\nvarious differences in build platforms. It is the replacement to the `node-waf`\nprogram which is removed for node `v0.8`. If you have a native addon for node that\nstill has a `wscript` file, then you should definitely add a `binding.gyp` file\nto support the latest versions of node.\n\nMultiple target versions of node are supported (i.e. `0.6`, `0.7`,..., `1.0`,\netc.), regardless of what version of node is actually installed on your system\n(`node-gyp` downloads the necessary development files for the target version).\n\n#### Features:\n\n * Easy to use, consistent interface\n * Same commands to build your module on every platform\n * Supports multiple target versions of Node\n\n\nInstallation\n------------\n\nYou can install with `npm`:\n\n``` bash\n$ npm install -g node-gyp\n```\n\nYou will also need to install:\n\n * On Unix:\n * `python`\n * `make`\n * A proper C/C++ compiler toolchain, like GCC\n * On Windows:\n * [Python][windows-python] ([`v2.7.2`][windows-python-v2.7.2] recommended, `v3.x.x` not yet supported)\n * Microsoft Visual C++ ([Express][msvc] version works well)\n * For 64-bit builds of node and native modules you will _also_ need the [Windows 7 64-bit SDK][win7sdk]\n\nHow to Use\n----------\n\nTo compile your native addon, first go to its root directory:\n\n``` bash\n$ cd my_node_addon\n```\n\nThe next step is to generate the appropriate project build files for the current\nplatform. Use `configure` for that:\n\n``` bash\n$ node-gyp configure\n```\n\n__Note__: The `configure` step looks for the `binding.gyp` file in the current\ndirectory to processs. See below for instructions on creating the `binding.gyp` file.\n\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file\n(on Windows) in the `build/` directory. Next invoke the `build` command:\n\n``` bash\n$ node-gyp build\n```\n\nNow you have your compiled `.node` bindings file! The compiled bindings end up\nin `build/Debug/` or `build/Release/`, depending on the build mode. At this point\nyou can require the `.node` file with Node and run your tests!\n\n__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or\n`-d`) switch when running the either `configure` or `build` command.\n\n\nThe \"binding.gyp\" file\n----------------------\n\nPreviously when node had `node-waf` you had to write a `wscript` file. The\nreplacement for that is the `binding.gyp` file, which describes the configuration\nto build your module in a JSON-like format. This file gets placed in the root of\nyour package, alongside the `package.json` file.\n\nA barebones `gyp` file appropriate for building a node addon looks like:\n\n``` json\n{\n \"targets\": [\n {\n \"target_name\": \"binding\",\n \"sources\": [ \"src/binding.cc\" ]\n }\n ]\n}\n```\n\nSome additional resources for writing `gyp` files:\n\n * [\"Hello World\" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)\n * [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)\n * [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)\n * ['\"binding.gyp\" files out in the wild' wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)\n\n\nCommands\n--------\n\n`node-gyp` responds to the following commands:\n\n * `build` - Invokes `make`/`msbuild.exe` and builds the native addon\n * `clean` - Removes any generated project files and the `out` dir\n * `configure` - Generates project build files for the current platform\n * `rebuild` - Runs \"clean\", \"configure\" and \"build\" all at once\n * `install` - Installs node development files for the given version.\n * `list` - Lists the currently installed node development file versions\n * `remove` - Removes a node development files for a given version\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[windows-python]: http://www.python.org/getit/windows\n[windows-python-v2.7.2]: http://www.python.org/download/releases/2.7.2#download\n[msvc]: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express\n[win7sdk]: http://www.microsoft.com/download/en/details.aspx?displayLang=en&id=8279\n",
+ "_id": "node-gyp@0.5.0",
"dist": {
- "shasum": "9ddb9c4218322fd3d6b9771b27c236c4e5965e3b"
+ "shasum": "88ad842c9f3ccd29a8d2a393107896c99fe32d63"
},
- "_from": "node-gyp@~0.4.5"
+ "_from": "node-gyp@~0.5"
}
View
2  package.json
@@ -53,7 +53,7 @@
"mkdirp": "~0.3.3",
"read": "0",
"lru-cache": "~1.1.0",
- "node-gyp": "~0.4.5",
+ "node-gyp": "~0.5",
"fstream-npm": "0.1",
"uid-number": "0",
"archy": "0",
Please sign in to comment.
Something went wrong with that request. Please try again.