* support process.release
* support all io.js versions
* support node v4+ including new download locations
* enable delay-load hook by default by default
* download header-only tarballs instead of full source

See https://github.com/nodejs/node-gyp/pull/711 for full details

PR-URL: https://github.com/nodejs/node/pull/2700
Reviewed-By: Forrest L Norvell <forrest@npmjs.com>
This commit is contained in:
Rod Vagg 2015-09-05 15:37:48 +10:00
Родитель 278a9267ec
Коммит b8341e8a4e
61 изменённых файлов: 946 добавлений и 5086 удалений

1
deps/npm/node_modules/.bin/node-gyp сгенерированный поставляемый Symbolic link
Просмотреть файл

@ -0,0 +1 @@
../node-gyp/bin/node-gyp.js

2
deps/npm/node_modules/node-gyp/.npmignore сгенерированный поставляемый
Просмотреть файл

@ -1 +1,3 @@
gyp/test
node_modules
test/.node-gyp

7
deps/npm/node_modules/node-gyp/0001-gyp-always-install-into-PRODUCT_DIR.patch сгенерированный поставляемый
Просмотреть файл

@ -28,7 +28,8 @@ index b88a433..9b3e4e3 100644
+ # # convenient access with LD_LIBRARY_PATH.
+ # return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias)
return '$(builddir)/' + self.alias
--
--
2.3.2 (Apple Git-55)

7
deps/npm/node_modules/node-gyp/0002-gyp-apply-https-codereview.chromium.org-11361103.patch сгенерированный поставляемый
Просмотреть файл

@ -18,7 +18,7 @@ index d8e0872..c59aea1 100644
+ if 'TargetExt' not in msbuild_attributes and 'product_extension' in spec:
+ ext = spec.get('product_extension')
+ msbuild_attributes['TargetExt'] = '.' + ext
if spec.get('msvs_external_builder'):
external_out_dir = spec.get('msvs_external_builder_out_dir', '.')
@@ -2773,6 +2776,9 @@ def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file):
@ -28,8 +28,9 @@ index d8e0872..c59aea1 100644
+ if 'TargetExt' in attributes:
+ _AddConditionalProperty(properties, condition, 'TargetExt',
+ attributes['TargetExt'])
if attributes.get('TargetPath'):
_AddConditionalProperty(properties, condition, 'TargetPath',
--
--
2.3.2 (Apple Git-55)

Просмотреть файл

@ -13,12 +13,12 @@ index 9b3e4e3..b3f8a2b 100644
--- a/gyp/pylib/gyp/generator/make.py
+++ b/gyp/pylib/gyp/generator/make.py
@@ -372,7 +372,7 @@ cmd_touch = touch $@
quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
-cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@")
+cmd_copy = rm -rf "$@" && cp -af "$<" "$@"
%(link_commands)s
"""
diff --git a/gyp/pylib/gyp/generator/ninja.py b/gyp/pylib/gyp/generator/ninja.py
@ -32,7 +32,8 @@ index 7461814..c2951a4 100644
- command='ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)')
+ command='rm -rf $out && cp -af $in $out')
master_ninja.newline()
all_targets = set()
--
--
2.3.2 (Apple Git-55)

2
deps/npm/node_modules/node-gyp/README.md сгенерированный поставляемый
Просмотреть файл

@ -139,7 +139,7 @@ Some additional resources for addons and writing `gyp` files:
* ["Hello World" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)
* [gyp user documentation](https://chromium.googlesource.com/external/gyp/+/master/docs/UserDocumentation.md)
* [gyp input format reference](https://chromium.googlesource.com/external/gyp/+/master/docs/InputFormatReference.md)
* [*"binding.gyp" files out in the wild* wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)
* [*"binding.gyp" files out in the wild* wiki page](https://github.com/nodejs/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)
Commands

5
deps/npm/node_modules/node-gyp/addon.gypi сгенерированный поставляемый
Просмотреть файл

@ -1,10 +1,11 @@
{
'target_defaults': {
'type': 'loadable_module',
'win_delay_load_hook': 'false',
'win_delay_load_hook': 'true',
'product_prefix': '',
'include_dirs': [
'<(node_root_dir)/include/node',
'<(node_root_dir)/src',
'<(node_root_dir)/deps/uv/include',
'<(node_root_dir)/deps/v8/include'
@ -78,7 +79,7 @@
'-luuid.lib',
'-lodbc32.lib',
'-lDelayImp.lib',
'-l"<(node_root_dir)/$(ConfigurationName)/node.lib"'
'-l"<(node_root_dir)/$(ConfigurationName)/<(node_lib_file)"'
],
'msvs_disabled_warnings': [
# warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'

2
deps/npm/node_modules/node-gyp/bin/node-gyp.js сгенерированный поставляемый
Просмотреть файл

@ -125,7 +125,7 @@ function issueMessage () {
errorMessage()
log.error('', [ 'This is a bug in `node-gyp`.'
, 'Try to update node-gyp and file an Issue if it does not help:'
, ' <https://github.com/TooTallNate/node-gyp/issues>'
, ' <https://github.com/nodejs/node-gyp/issues>'
].join('\n'))
}

2
deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py сгенерированный поставляемый
Просмотреть файл

@ -115,7 +115,7 @@ def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False,
xml_string = XmlToString(content, encoding, pretty)
if win32 and os.linesep != '\r\n':
xml_string = xml_string.replace('\n', '\r\n')
try:
xml_string = xml_string.encode(encoding)
except Exception:

11
deps/npm/node_modules/node-gyp/lib/build.js сгенерированный поставляемый
Просмотреть файл

@ -13,13 +13,14 @@ var fs = require('graceful-fs')
, which = require('which')
, mkdirp = require('mkdirp')
, exec = require('child_process').exec
, processRelease = require('./process-release')
, win = process.platform == 'win32'
exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module'
function build (gyp, argv, callback) {
var makeCommand = gyp.opts.make || process.env.MAKE
var release = processRelease(argv, gyp, process.version, process.release)
, makeCommand = gyp.opts.make || process.env.MAKE
|| (process.platform.indexOf('bsd') != -1 && process.platform.indexOf('kfreebsd') == -1 ? 'gmake' : 'make')
, command = win ? 'msbuild' : makeCommand
, buildDir = path.resolve('build')
@ -181,15 +182,15 @@ function build (gyp, argv, callback) {
if (!win || !copyDevLib) return doBuild()
var buildDir = path.resolve(nodeDir, buildType)
, archNodeLibPath = path.resolve(nodeDir, arch, 'node.lib')
, buildNodeLibPath = path.resolve(buildDir, 'node.lib')
, archNodeLibPath = path.resolve(nodeDir, arch, release.name + '.lib')
, buildNodeLibPath = path.resolve(buildDir, release.name + '.lib')
mkdirp(buildDir, function (err, isNew) {
if (err) return callback(err)
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)
log.verbose('copying "' + release.name + '.lib" for ' + arch, buildNodeLibPath)
rs.pipe(ws)
rs.on('error', callback)
ws.on('error', callback)

94
deps/npm/node_modules/node-gyp/lib/configure.js сгенерированный поставляемый
Просмотреть файл

@ -15,6 +15,7 @@ var fs = require('graceful-fs')
, cp = require('child_process')
, PathArray = require('path-array')
, extend = require('util')._extend
, processRelease = require('./process-release')
, spawn = cp.spawn
, execFile = cp.execFile
, win = process.platform == 'win32'
@ -28,6 +29,7 @@ function configure (gyp, argv, callback) {
, configNames = [ 'config.gypi', 'common.gypi' ]
, configs = []
, nodeDir
, release = processRelease(argv, gyp, process.version, process.release)
checkPython()
@ -135,35 +137,25 @@ function configure (gyp, argv, callback) {
} else {
// if no --nodedir specified, ensure node dependencies are installed
var version
var versionStr
if (gyp.opts.target) {
if ('v' + release.version !== process.version) {
// if --target was given, then determine a target version to compile for
versionStr = gyp.opts.target
log.verbose('get node dir', 'compiling against --target node version: %s', versionStr)
log.verbose('get node dir', 'compiling against --target node version: %s', release.version)
} else {
// if no --target was specified then use the current host node version
versionStr = process.version
log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', versionStr)
log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version)
}
// make sure we have a valid version
try {
version = semver.parse(versionStr)
} catch (e) {
return callback(e)
}
if (!version) {
return callback(new Error('Invalid version number: ' + versionStr))
if (!release.semver) {
// could not parse the version string with semver
return callback(new Error('Invalid version number: ' + release.version))
}
// ensure that the target node version's dev files are installed
gyp.opts.ensure = true
gyp.commands.install([ versionStr ], function (err, version) {
gyp.commands.install([ release.version ], function (err, version) {
if (err) return callback(err)
log.verbose('get node dir', 'target node version installed:', version)
nodeDir = path.resolve(gyp.devDir, version)
log.verbose('get node dir', 'target node version installed:', release.versionDir)
nodeDir = path.resolve(gyp.devDir, release.versionDir)
createBuildDir()
})
}
@ -310,42 +302,48 @@ function configure (gyp, argv, callback) {
// this logic ported from the old `gyp_addon` python file
var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py')
var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi')
var common_gypi = path.resolve(nodeDir, 'common.gypi')
var output_dir = 'build'
if (win) {
// Windows expects an absolute path
output_dir = buildDir
}
var nodeGypDir = path.resolve(__dirname, '..')
var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi')
fs.stat(common_gypi, function (err, stat) {
if (err)
common_gypi = path.resolve(nodeDir, 'common.gypi')
argv.push('-I', addon_gypi)
argv.push('-I', common_gypi)
argv.push('-Dlibrary=shared_library')
argv.push('-Dvisibility=default')
argv.push('-Dnode_root_dir=' + nodeDir)
argv.push('-Dnode_gyp_dir=' + nodeGypDir)
argv.push('-Dmodule_root_dir=' + process.cwd())
argv.push('--depth=.')
argv.push('--no-parallel')
var output_dir = 'build'
if (win) {
// Windows expects an absolute path
output_dir = buildDir
}
var nodeGypDir = path.resolve(__dirname, '..')
// tell gyp to write the Makefile/Solution files into output_dir
argv.push('--generator-output', output_dir)
argv.push('-I', addon_gypi)
argv.push('-I', common_gypi)
argv.push('-Dlibrary=shared_library')
argv.push('-Dvisibility=default')
argv.push('-Dnode_root_dir=' + nodeDir)
argv.push('-Dnode_gyp_dir=' + nodeGypDir)
argv.push('-Dnode_lib_file=' + release.name + '.lib')
argv.push('-Dmodule_root_dir=' + process.cwd())
argv.push('--depth=.')
argv.push('--no-parallel')
// tell make to write its output into the same dir
argv.push('-Goutput_dir=.')
// tell gyp to write the Makefile/Solution files into output_dir
argv.push('--generator-output', output_dir)
// enforce use of the "binding.gyp" file
argv.unshift('binding.gyp')
// tell make to write its output into the same dir
argv.push('-Goutput_dir=.')
// execute `gyp` from the current target nodedir
argv.unshift(gyp_script)
// enforce use of the "binding.gyp" file
argv.unshift('binding.gyp')
// make sure python uses files that came with this particular node package
var pypath = new PathArray(process.env, 'PYTHONPATH')
pypath.unshift(path.join(__dirname, '..', 'gyp', 'pylib'))
// execute `gyp` from the current target nodedir
argv.unshift(gyp_script)
var cp = gyp.spawn(python, argv)
cp.on('exit', onCpExit)
// make sure python uses files that came with this particular node package
var pypath = new PathArray(process.env, 'PYTHONPATH')
pypath.unshift(path.join(__dirname, '..', 'gyp', 'pylib'))
var cp = gyp.spawn(python, argv)
cp.on('exit', onCpExit)
})
}
/**

105
deps/npm/node_modules/node-gyp/lib/install.js сгенерированный поставляемый
Просмотреть файл

@ -20,10 +20,13 @@ var fs = require('graceful-fs')
, request = require('request')
, minimatch = require('minimatch')
, mkdir = require('mkdirp')
, processRelease = require('./process-release')
, win = process.platform == 'win32'
function install (gyp, argv, callback) {
var release = processRelease(argv, gyp, process.version, process.release)
// ensure no double-callbacks happen
function cb (err) {
if (cb.done) return
@ -31,34 +34,29 @@ function install (gyp, argv, callback) {
if (err) {
log.warn('install', 'got an error, rolling back install')
// roll-back the install if anything went wrong
gyp.commands.remove([ version ], function (err2) {
gyp.commands.remove([ release.versionDir ], function (err2) {
callback(err)
})
} else {
callback(null, version)
callback(null, release.version)
}
}
var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'https://nodejs.org/dist'
// Determine which node dev files version we are installing
var versionStr = argv[0] || gyp.opts.target || process.version
log.verbose('install', 'input version string %j', versionStr)
log.verbose('install', 'input version string %j', release.version)
// parse the version to normalize and ensure it's valid
var version = semver.parse(versionStr)
if (!version) {
return callback(new Error('Invalid version number: ' + versionStr))
if (!release.semver) {
// could not parse the version string with semver
return callback(new Error('Invalid version number: ' + release.version))
}
if (semver.lt(versionStr, '0.8.0')) {
return callback(new Error('Minimum target version is `0.8.0` or greater. Got: ' + versionStr))
if (semver.lt(release.version, '0.8.0')) {
return callback(new Error('Minimum target version is `0.8.0` or greater. Got: ' + release.version))
}
// 0.x.y-pre versions are not published yet and cannot be installed. Bail.
if (version.prerelease[0] === 'pre') {
log.verbose('detected "pre" node version', versionStr)
if (release.semver.prerelease[0] === 'pre') {
log.verbose('detected "pre" node version', release.version)
if (gyp.opts.nodedir) {
log.verbose('--nodedir flag was passed; skipping install', gyp.opts.nodedir)
callback()
@ -69,14 +67,10 @@ function install (gyp, argv, callback) {
}
// flatten version into String
version = version.version
log.verbose('install', 'installing version: %s', version)
// distributions starting with 0.10.0 contain sha256 checksums
var checksumAlgo = semver.gte(version, '0.10.0') ? 'sha256' : 'sha1'
log.verbose('install', 'installing version: %s', release.versionDir)
// the directory where the dev files will be installed
var devDir = path.resolve(gyp.devDir, version)
var devDir = path.resolve(gyp.devDir, release.versionDir)
// If '--ensure' was passed, then don't *always* install the version;
// check if it is already installed, and only install when needed
@ -85,7 +79,7 @@ function install (gyp, argv, callback) {
fs.stat(devDir, function (err, stat) {
if (err) {
if (err.code == 'ENOENT') {
log.verbose('install', 'version not already installed, continuing with install', version)
log.verbose('install', 'version not already installed, continuing with install', release.version)
go()
} else if (err.code == 'EACCES') {
eaccesFallback()
@ -142,7 +136,7 @@ function install (gyp, argv, callback) {
}
try {
// The "request" constructor can throw sometimes apparently :(
// See: https://github.com/TooTallNate/node-gyp/issues/114
// See: https://github.com/nodejs/node-gyp/issues/114
req = request(requestOpts)
} catch (e) {
cb(e)
@ -156,7 +150,7 @@ function install (gyp, argv, callback) {
}
function getContentSha(res, callback) {
var shasum = crypto.createHash(checksumAlgo)
var shasum = crypto.createHash('sha256')
res.on('data', function (chunk) {
shasum.update(chunk)
}).on('end', function () {
@ -184,9 +178,8 @@ function install (gyp, argv, callback) {
}
// now download the node tarball
var tarPath = gyp.opts['tarball']
var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/node-v' + version + '.tar.gz'
, badDownload = false
var tarPath = gyp.opts.tarball
var badDownload = false
, extractCount = 0
, gunzip = zlib.createGunzip()
, extracter = tar.Extract({ path: devDir, strip: 1, filter: isValid })
@ -220,12 +213,12 @@ function install (gyp, argv, callback) {
// download the tarball, gunzip and extract!
if (tarPath) {
var input = fs.createReadStream(tarballUrl)
var input = fs.createReadStream(tarPath)
input.pipe(gunzip).pipe(extracter)
return
}
var req = download(tarballUrl)
var req = download(release.tarballUrl)
if (!req) return
// something went wrong downloading the tarball?
@ -248,12 +241,12 @@ function install (gyp, argv, callback) {
req.on('response', function (res) {
if (res.statusCode !== 200) {
badDownload = true
cb(new Error(res.statusCode + ' response downloading ' + tarballUrl))
cb(new Error(res.statusCode + ' response downloading ' + release.tarballUrl))
return
}
// content checksum
getContentSha(res, function (_, checksum) {
var filename = path.basename(tarballUrl).trim()
var filename = path.basename(release.tarballUrl).trim()
contentShasums[filename] = checksum
log.verbose('content checksum', filename, checksum)
})
@ -314,13 +307,11 @@ function install (gyp, argv, callback) {
}
function downloadShasums(done) {
var shasumsFile = (checksumAlgo === 'sha256') ? 'SHASUMS256.txt' : 'SHASUMS.txt'
log.verbose('check download content checksum, need to download `' + shasumsFile + '`...')
var shasumsPath = path.resolve(devDir, shasumsFile)
, shasumsUrl = distUrl + '/v' + version + '/' + shasumsFile
log.verbose('check download content checksum, need to download `SHASUMS256.txt`...')
var shasumsPath = path.resolve(devDir, 'SHASUMS256.txt')
log.verbose('checksum url', shasumsUrl)
var req = download(shasumsUrl)
log.verbose('checksum url', release.shasumsUrl)
var req = download(release.shasumsUrl)
if (!req) return
req.on('error', done)
req.on('response', function (res) {
@ -351,39 +342,37 @@ function install (gyp, argv, callback) {
}
function downloadNodeLib (done) {
log.verbose('on Windows; need to download `node.lib`...')
log.verbose('on Windows; need to download `' + release.name + '.lib`...')
var dir32 = path.resolve(devDir, 'ia32')
, dir64 = path.resolve(devDir, 'x64')
, nodeLibPath32 = path.resolve(dir32, 'node.lib')
, nodeLibPath64 = path.resolve(dir64, 'node.lib')
, nodeLibUrl32 = distUrl + '/v' + version + '/node.lib'
, nodeLibUrl64 = distUrl + '/v' + version + '/x64/node.lib'
, libPath32 = path.resolve(dir32, release.name + '.lib')
, libPath64 = path.resolve(dir64, release.name + '.lib')
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)
log.verbose('32-bit ' + release.name + '.lib dir', dir32)
log.verbose('64-bit ' + release.name + '.lib dir', dir64)
log.verbose('`' + release.name + '.lib` 32-bit url', release.libUrl32)
log.verbose('`' + release.name + '.lib` 64-bit url', release.libUrl64)
var async = 2
mkdir(dir32, function (err) {
if (err) return done(err)
log.verbose('streaming 32-bit node.lib to:', nodeLibPath32)
log.verbose('streaming 32-bit ' + release.name + '.lib to:', libPath32)
var req = download(nodeLibUrl32)
var req = download(release.libUrl32)
if (!req) return
req.on('error', done)
req.on('response', function (res) {
if (res.statusCode !== 200) {
done(new Error(res.statusCode + ' status code downloading 32-bit node.lib'))
done(new Error(res.statusCode + ' status code downloading 32-bit ' + release.name + '.lib'))
return
}
getContentSha(res, function (_, checksum) {
contentShasums['node.lib'] = checksum
log.verbose('content checksum', 'node.lib', checksum)
contentShasums[release.libPath32] = checksum
log.verbose('content checksum', release.libPath32, checksum)
})
var ws = fs.createWriteStream(nodeLibPath32)
var ws = fs.createWriteStream(libPath32)
ws.on('error', cb)
req.pipe(ws)
})
@ -393,23 +382,23 @@ function install (gyp, argv, callback) {
})
mkdir(dir64, function (err) {
if (err) return done(err)
log.verbose('streaming 64-bit node.lib to:', nodeLibPath64)
log.verbose('streaming 64-bit ' + release.name + '.lib to:', libPath64)
var req = download(nodeLibUrl64)
var req = download(release.libUrl64)
if (!req) return
req.on('error', done)
req.on('response', function (res) {
if (res.statusCode !== 200) {
done(new Error(res.statusCode + ' status code downloading 64-bit node.lib'))
done(new Error(res.statusCode + ' status code downloading 64-bit ' + release.name + '.lib'))
return
}
getContentSha(res, function (_, checksum) {
contentShasums['x64/node.lib'] = checksum
log.verbose('content checksum', 'x64/node.lib', checksum)
contentShasums[release.libPath64] = checksum
log.verbose('content checksum', release.libPath64, checksum)
})
var ws = fs.createWriteStream(nodeLibPath64)
var ws = fs.createWriteStream(libPath64)
ws.on('error', cb)
req.pipe(ws)
})

2
deps/npm/node_modules/node-gyp/lib/node-gyp.js сгенерированный поставляемый
Просмотреть файл

@ -48,7 +48,7 @@ function Gyp () {
// set the dir where node-gyp dev files get installed
// TODO: make this *more* configurable?
// see: https://github.com/TooTallNate/node-gyp/issues/21
// see: https://github.com/nodejs/node-gyp/issues/21
var homeDir = process.env.HOME || process.env.USERPROFILE
if (!homeDir) {
throw new Error(

129
deps/npm/node_modules/node-gyp/lib/process-release.js сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,129 @@
var semver = require('semver')
, url = require('url')
, path = require('path')
, bitsre = /\/win-(x86|x64)\//
, bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should
// have been "x86"
// Captures all the logic required to determine download URLs, local directory and
// file names. Inputs come from command-line switches (--target, --dist-url),
// `process.version` and `process.release` where it exists.
function processRelease (argv, gyp, defaultVersion, defaultRelease) {
var version = argv[0] || gyp.opts.target || defaultVersion
, isDefaultVersion = version === defaultVersion
, versionSemver = semver.parse(version)
, overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl
, isIojs
, name
, distBaseUrl
, baseUrl
, libUrl32
, libUrl64
if (!versionSemver) {
// not a valid semver string, nothing we can do
return { version: version }
}
// flatten version into String
version = versionSemver.version
// can't use process.release if we're using --target=x.y.z
if (!isDefaultVersion)
defaultRelease = null
if (defaultRelease) {
// v3 onward, has process.release
name = defaultRelease.name.replace(/io\.js/, 'iojs') // remove the '.' for directory naming purposes
isIojs = name === 'iojs'
} else {
// old node or alternative --target=
// semver.satisfies() doesn't like prerelease tags so test major directly
isIojs = versionSemver.major >= 1 & versionSemver.major < 4
name = isIojs ? 'iojs' : 'node'
}
// check for the nvm.sh standard mirror env variables
if (!overrideDistUrl) {
if (isIojs && process.env.NVM_IOJS_ORG_MIRROR)
overrideDistUrl = process.env.NVM_IOJS_ORG_MIRROR
else if (process.env.NVM_NODEJS_ORG_MIRROR)
overrideDistUrl = process.env.NVM_NODEJS_ORG_MIRROR
}
if (overrideDistUrl)
distBaseUrl = overrideDistUrl.replace(/\/+$/, '')
else
distBaseUrl = isIojs ? 'https://iojs.org/download/release' : 'https://nodejs.org/dist'
distBaseUrl += '/v' + version + '/'
// new style, based on process.release so we have a lot of the data we need
if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) {
baseUrl = url.resolve(defaultRelease.headersUrl, './')
libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major)
libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major)
return {
version: version,
semver: versionSemver,
name: name,
baseUrl: baseUrl,
tarballUrl: defaultRelease.headersUrl,
shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'),
versionDir: (name !== 'node' ? name + '-' : '') + version,
libUrl32: libUrl32,
libUrl64: libUrl64,
libPath32: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)),
libPath64: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path))
}
}
// older versions without process.release are captured here and we have to make
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
// current process.release
baseUrl = distBaseUrl
libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major)
libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major)
// making the bold assumption that anything with a version number >3.0.0 will
// have a *-headers.tar.gz file in its dist location, even some frankenstein
// custom version
tarballUrl = url.resolve(baseUrl, name + '-v' + version + (versionSemver.major >= 3 ? '-headers' : '') + '.tar.gz')
return {
version: version,
semver: versionSemver,
name: name,
baseUrl: baseUrl,
tarballUrl: tarballUrl,
shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'),
versionDir: (name !== 'node' ? name + '-' : '') + version,
libUrl32: libUrl32,
libUrl64: libUrl64,
libPath32: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)),
libPath64: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path))
}
}
function normalizePath (p) {
return path.normalize(p).replace(/\\/g, '/')
}
function resolveLibUrl (name, defaultUrl, arch, versionMajor) {
var base = url.resolve(defaultUrl, './')
, hasLibUrl = bitsre.test(defaultUrl) || (versionMajor === 3 && bitsreV3.test(defaultUrl))
if (!hasLibUrl) {
// let's assume it's a baseUrl then
if (versionMajor >= 1)
return url.resolve(base, 'win-' + arch +'/' + name + '.lib')
// prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/
return url.resolve(base, (arch === 'x64' ? 'x64/' : '') + name + '.lib')
}
// else we have a proper url to a .lib, just make sure it's the right arch
return defaultUrl.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/')
}
module.exports = processRelease

18
deps/npm/node_modules/node-gyp/lib/remove.js сгенерированный поставляемый
Просмотреть файл

@ -19,23 +19,19 @@ function remove (gyp, argv, callback) {
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)
var version = argv[0] || gyp.opts.target
log.verbose('remove', 'removing target version:', version)
if (!v) {
if (!version) {
return callback(new Error('You must specify a version number to remove. Ex: "' + process.version + '"'))
}
// parse the version to normalize and make sure it's valid
var version = semver.parse(v)
if (!version) {
return callback(new Error('Invalid version number: ' + v))
var versionSemver = semver.parse(version)
if (versionSemver) {
// flatten the version Array into a String
version = versionSemver.version
}
// flatten the version Array into a String
version = version.version
var versionPath = path.resolve(gyp.devDir, version)
log.verbose('remove', 'removing development files for version:', version)

64
deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js сгенерированный поставляемый
Просмотреть файл

@ -1,4 +1,4 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.minimatch = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports = minimatch
minimatch.Minimatch = Minimatch
@ -273,6 +273,7 @@ function parse (pattern, isSub) {
var escaping = false
// ? => one single character
var patternListStack = []
var negativeLists = []
var plType
var stateChar
var inClass = false
@ -373,9 +374,13 @@ function parse (pattern, isSub) {
}
plType = stateChar
patternListStack.push({ type: plType, start: i - 1, reStart: re.length })
patternListStack.push({
type: plType,
start: i - 1,
reStart: re.length
})
// negation is (?:(?!js)[^/]*)
re += stateChar === '!' ? '(?:(?!' : '(?:'
re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
this.debug('plType %j %j', stateChar, re)
stateChar = false
continue
@ -389,12 +394,15 @@ function parse (pattern, isSub) {
clearStateChar()
hasMagic = true
re += ')'
plType = patternListStack.pop().type
var pl = patternListStack.pop()
plType = pl.type
// negation is (?:(?!js)[^/]*)
// The others are (?:<pattern>)<type>
switch (plType) {
case '!':
re += '[^/]*?)'
negativeLists.push(pl)
re += ')[^/]*?)'
pl.reEnd = re.length
break
case '?':
case '+':
@ -508,7 +516,7 @@ function parse (pattern, isSub) {
// and escape any | chars that were passed through as-is for the regexp.
// Go through and escape them, taking care not to double-escape any
// | chars that were already escaped.
for (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
var tail = re.slice(pl.reStart + 3)
// maybe some even number of \, then maybe 1 \, followed by a |
tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {
@ -551,12 +559,49 @@ function parse (pattern, isSub) {
case '(': addPatternStart = true
}
// Hack to work around lack of negative lookbehind in JS
// A pattern like: *.!(x).!(y|z) needs to ensure that a name
// like 'a.xyz.yz' doesn't match. So, the first negative
// lookahead, has to look ALL the way ahead, to the end of
// the pattern.
for (var n = negativeLists.length - 1; n > -1; n--) {
var nl = negativeLists[n]
var nlBefore = re.slice(0, nl.reStart)
var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
var nlAfter = re.slice(nl.reEnd)
nlLast += nlAfter
// Handle nested stuff like *(*.js|!(*.json)), where open parens
// mean that we should *not* include the ) in the bit that is considered
// "after" the negated section.
var openParensBefore = nlBefore.split('(').length - 1
var cleanAfter = nlAfter
for (i = 0; i < openParensBefore; i++) {
cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
}
nlAfter = cleanAfter
var dollar = ''
if (nlAfter === '' && isSub !== SUBPARSE) {
dollar = '$'
}
var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
re = newRe
}
// if the re is not "" at this point, then we need to make sure
// it doesn't match against an empty path part.
// Otherwise a/* will match a/, which it should not.
if (re !== '' && hasMagic) re = '(?=.)' + re
if (re !== '' && hasMagic) {
re = '(?=.)' + re
}
if (addPatternStart) re = patternStart + re
if (addPatternStart) {
re = patternStart + re
}
// parsing just a piece of a larger pattern.
if (isSub === SUBPARSE) {
@ -1110,4 +1155,5 @@ module.exports = function (xs, fn) {
return res;
};
},{}]},{},[1]);
},{}]},{},[1])(1)
});

59
deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js сгенерированный поставляемый
Просмотреть файл

@ -272,6 +272,7 @@ function parse (pattern, isSub) {
var escaping = false
// ? => one single character
var patternListStack = []
var negativeLists = []
var plType
var stateChar
var inClass = false
@ -372,9 +373,13 @@ function parse (pattern, isSub) {
}
plType = stateChar
patternListStack.push({ type: plType, start: i - 1, reStart: re.length })
patternListStack.push({
type: plType,
start: i - 1,
reStart: re.length
})
// negation is (?:(?!js)[^/]*)
re += stateChar === '!' ? '(?:(?!' : '(?:'
re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
this.debug('plType %j %j', stateChar, re)
stateChar = false
continue
@ -388,12 +393,15 @@ function parse (pattern, isSub) {
clearStateChar()
hasMagic = true
re += ')'
plType = patternListStack.pop().type
var pl = patternListStack.pop()
plType = pl.type
// negation is (?:(?!js)[^/]*)
// The others are (?:<pattern>)<type>
switch (plType) {
case '!':
re += '[^/]*?)'
negativeLists.push(pl)
re += ')[^/]*?)'
pl.reEnd = re.length
break
case '?':
case '+':
@ -507,7 +515,7 @@ function parse (pattern, isSub) {
// and escape any | chars that were passed through as-is for the regexp.
// Go through and escape them, taking care not to double-escape any
// | chars that were already escaped.
for (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
var tail = re.slice(pl.reStart + 3)
// maybe some even number of \, then maybe 1 \, followed by a |
tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {
@ -550,12 +558,49 @@ function parse (pattern, isSub) {
case '(': addPatternStart = true
}
// Hack to work around lack of negative lookbehind in JS
// A pattern like: *.!(x).!(y|z) needs to ensure that a name
// like 'a.xyz.yz' doesn't match. So, the first negative
// lookahead, has to look ALL the way ahead, to the end of
// the pattern.
for (var n = negativeLists.length - 1; n > -1; n--) {
var nl = negativeLists[n]
var nlBefore = re.slice(0, nl.reStart)
var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
var nlAfter = re.slice(nl.reEnd)
nlLast += nlAfter
// Handle nested stuff like *(*.js|!(*.json)), where open parens
// mean that we should *not* include the ) in the bit that is considered
// "after" the negated section.
var openParensBefore = nlBefore.split('(').length - 1
var cleanAfter = nlAfter
for (i = 0; i < openParensBefore; i++) {
cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
}
nlAfter = cleanAfter
var dollar = ''
if (nlAfter === '' && isSub !== SUBPARSE) {
dollar = '$'
}
var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
re = newRe
}
// if the re is not "" at this point, then we need to make sure
// it doesn't match against an empty path part.
// Otherwise a/* will match a/, which it should not.
if (re !== '' && hasMagic) re = '(?=.)' + re
if (re !== '' && hasMagic) {
re = '(?=.)' + re
}
if (addPatternStart) re = patternStart + re
if (addPatternStart) {
re = patternStart + re
}
// parsing just a piece of a larger pattern.
if (isSub === SUBPARSE) {

24
deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json сгенерированный поставляемый
Просмотреть файл

@ -6,16 +6,16 @@
},
"name": "minimatch",
"description": "a glob matcher in javascript",
"version": "2.0.8",
"version": "2.0.10",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/minimatch.git"
},
"main": "minimatch.js",
"scripts": {
"pretest": "standard minimatch.js test/*.js",
"posttest": "standard minimatch.js test/*.js",
"test": "tap test/*.js",
"prepublish": "browserify -o browser.js -e minimatch.js --bare"
"prepublish": "browserify -o browser.js -e minimatch.js -s minimatch --bare"
},
"engines": {
"node": "*"
@ -26,30 +26,30 @@
"devDependencies": {
"browserify": "^9.0.3",
"standard": "^3.7.2",
"tap": ""
"tap": "^1.2.0"
},
"license": "ISC",
"files": [
"minimatch.js",
"browser.js"
],
"gitHead": "0bc7d9c4b2bc816502184862b45bd090de3406a3",
"gitHead": "6afb85f0c324b321f76a38df81891e562693e257",
"bugs": {
"url": "https://github.com/isaacs/minimatch/issues"
},
"homepage": "https://github.com/isaacs/minimatch#readme",
"_id": "minimatch@2.0.8",
"_shasum": "0bc20f6bf3570a698ef0ddff902063c6cabda6bf",
"_id": "minimatch@2.0.10",
"_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7",
"_from": "minimatch@>=2.0.1 <3.0.0",
"_npmVersion": "2.10.0",
"_nodeVersion": "2.0.1",
"_npmVersion": "3.1.0",
"_nodeVersion": "2.2.1",
"_npmUser": {
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
"dist": {
"shasum": "0bc20f6bf3570a698ef0ddff902063c6cabda6bf",
"tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz"
"shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7",
"tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz"
},
"maintainers": [
{
@ -58,6 +58,6 @@
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz",
"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz",
"readme": "ERROR: No README data found!"
}

1
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/.npmignore сгенерированный поставляемый
Просмотреть файл

@ -1 +0,0 @@
node_modules/

15
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/LICENSE сгенерированный поставляемый
Просмотреть файл

@ -1,15 +0,0 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

36
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/README.md сгенерированный поставляемый
Просмотреть файл

@ -1,36 +0,0 @@
# graceful-fs
graceful-fs functions as a drop-in replacement for the fs module,
making various improvements.
The improvements are meant to normalize behavior across different
platforms and environments, and to make filesystem access more
resilient to errors.
## Improvements over [fs module](http://api.nodejs.org/fs.html)
graceful-fs:
* Queues up `open` and `readdir` calls, and retries them once
something closes if there is an EMFILE error from too many file
descriptors.
* fixes `lchmod` for Node versions prior to 0.6.2.
* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
`lchown` if the user isn't root.
* makes `lchmod` and `lchown` become noops, if not available.
* retries reading a file if `read` results in EAGAIN error.
On Windows, it retries renaming a file for up to one second if `EACCESS`
or `EPERM` error occurs, likely because antivirus software has locked
the directory.
## USAGE
```javascript
// use just like fs
var fs = require('graceful-fs')
// now go and do stuff with it...
fs.readFileSync('some-file-or-whatever')
```

11
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/fs.js сгенерированный поставляемый
Просмотреть файл

@ -1,11 +0,0 @@
// eeeeeevvvvviiiiiiillllll
// more evil than monkey-patching the native builtin?
// Not sure.
var mod = require("module")
var pre = '(function (exports, require, module, __filename, __dirname) { '
var post = '});'
var src = pre + process.binding('natives').fs + post
var vm = require('vm')
var fn = vm.runInThisContext(src)
fn(exports, require, module, __filename, __dirname)

158
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/graceful-fs.js сгенерированный поставляемый
Просмотреть файл

@ -1,158 +0,0 @@
// Monkey-patching the fs module.
// It's ugly, but there is simply no other way to do this.
var fs = module.exports = require('./fs.js')
var assert = require('assert')
// fix up some busted stuff, mostly on windows and old nodes
require('./polyfills.js')
var util = require('util')
function noop () {}
var debug = noop
if (util.debuglog)
debug = util.debuglog('gfs')
else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || ''))
debug = function() {
var m = util.format.apply(util, arguments)
m = 'GFS: ' + m.split(/\n/).join('\nGFS: ')
console.error(m)
}
if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) {
process.on('exit', function() {
debug('fds', fds)
debug(queue)
assert.equal(queue.length, 0)
})
}
var originalOpen = fs.open
fs.open = open
function open(path, flags, mode, cb) {
if (typeof mode === "function") cb = mode, mode = null
if (typeof cb !== "function") cb = noop
new OpenReq(path, flags, mode, cb)
}
function OpenReq(path, flags, mode, cb) {
this.path = path
this.flags = flags
this.mode = mode
this.cb = cb
Req.call(this)
}
util.inherits(OpenReq, Req)
OpenReq.prototype.process = function() {
originalOpen.call(fs, this.path, this.flags, this.mode, this.done)
}
var fds = {}
OpenReq.prototype.done = function(er, fd) {
debug('open done', er, fd)
if (fd)
fds['fd' + fd] = this.path
Req.prototype.done.call(this, er, fd)
}
var originalReaddir = fs.readdir
fs.readdir = readdir
function readdir(path, cb) {
if (typeof cb !== "function") cb = noop
new ReaddirReq(path, cb)
}
function ReaddirReq(path, cb) {
this.path = path
this.cb = cb
Req.call(this)
}
util.inherits(ReaddirReq, Req)
ReaddirReq.prototype.process = function() {
originalReaddir.call(fs, this.path, this.done)
}
ReaddirReq.prototype.done = function(er, files) {
if (files && files.sort)
files = files.sort()
Req.prototype.done.call(this, er, files)
onclose()
}
var originalClose = fs.close
fs.close = close
function close (fd, cb) {
debug('close', fd)
if (typeof cb !== "function") cb = noop
delete fds['fd' + fd]
originalClose.call(fs, fd, function(er) {
onclose()
cb(er)
})
}
var originalCloseSync = fs.closeSync
fs.closeSync = closeSync
function closeSync (fd) {
try {
return originalCloseSync(fd)
} finally {
onclose()
}
}
// Req class
function Req () {
// start processing
this.done = this.done.bind(this)
this.failures = 0
this.process()
}
Req.prototype.done = function (er, result) {
var tryAgain = false
if (er) {
var code = er.code
var tryAgain = code === "EMFILE" || code === "ENFILE"
if (process.platform === "win32")
tryAgain = tryAgain || code === "OK"
}
if (tryAgain) {
this.failures ++
enqueue(this)
} else {
var cb = this.cb
cb(er, result)
}
}
var queue = []
function enqueue(req) {
queue.push(req)
debug('enqueue %d %s', queue.length, req.constructor.name, req)
}
function onclose() {
var req = queue.shift()
if (req) {
debug('process', req.constructor.name, req)
req.process()
}
}

72
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/package.json сгенерированный поставляемый
Просмотреть файл

@ -1,72 +0,0 @@
{
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
"url": "http://blog.izs.me"
},
"name": "graceful-fs",
"description": "A drop-in replacement for fs, making various improvements.",
"version": "3.0.8",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-graceful-fs.git"
},
"main": "graceful-fs.js",
"engines": {
"node": ">=0.4.0"
},
"directories": {
"test": "test"
},
"scripts": {
"test": "tap test/*.js"
},
"keywords": [
"fs",
"module",
"reading",
"retry",
"retries",
"queue",
"error",
"errors",
"handling",
"EMFILE",
"EAGAIN",
"EINVAL",
"EPERM",
"EACCESS"
],
"license": "ISC",
"devDependencies": {
"mkdirp": "^0.5.0",
"rimraf": "^2.2.8",
"tap": "^1.2.0"
},
"gitHead": "45c57aa5e323c35a985a525de6f0c9a6ef59e1f8",
"bugs": {
"url": "https://github.com/isaacs/node-graceful-fs/issues"
},
"homepage": "https://github.com/isaacs/node-graceful-fs#readme",
"_id": "graceful-fs@3.0.8",
"_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22",
"_from": "graceful-fs@>=3.0.0 <4.0.0",
"_npmVersion": "2.10.1",
"_nodeVersion": "2.0.1",
"_npmUser": {
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
"dist": {
"shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22",
"tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
}
],
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz",
"readme": "ERROR: No README data found!"
}

254
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/polyfills.js сгенерированный поставляемый
Просмотреть файл

@ -1,254 +0,0 @@
var fs = require('./fs.js')
var constants = require('constants')
var origCwd = process.cwd
var cwd = null
process.cwd = function() {
if (!cwd)
cwd = origCwd.call(process)
return cwd
}
var chdir = process.chdir
process.chdir = function(d) {
cwd = null
chdir.call(process, d)
}
// (re-)implement some things that are known busted or missing.
// lchmod, broken prior to 0.6.2
// back-port the fix here.
if (constants.hasOwnProperty('O_SYMLINK') &&
process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
fs.lchmod = function (path, mode, callback) {
callback = callback || noop
fs.open( path
, constants.O_WRONLY | constants.O_SYMLINK
, mode
, function (err, fd) {
if (err) {
callback(err)
return
}
// prefer to return the chmod error, if one occurs,
// but still try to close, and report closing errors if they occur.
fs.fchmod(fd, mode, function (err) {
fs.close(fd, function(err2) {
callback(err || err2)
})
})
})
}
fs.lchmodSync = function (path, mode) {
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
// prefer to return the chmod error, if one occurs,
// but still try to close, and report closing errors if they occur.
var err, err2
try {
var ret = fs.fchmodSync(fd, mode)
} catch (er) {
err = er
}
try {
fs.closeSync(fd)
} catch (er) {
err2 = er
}
if (err || err2) throw (err || err2)
return ret
}
}
// lutimes implementation, or no-op
if (!fs.lutimes) {
if (constants.hasOwnProperty("O_SYMLINK")) {
fs.lutimes = function (path, at, mt, cb) {
fs.open(path, constants.O_SYMLINK, function (er, fd) {
cb = cb || noop
if (er) return cb(er)
fs.futimes(fd, at, mt, function (er) {
fs.close(fd, function (er2) {
return cb(er || er2)
})
})
})
}
fs.lutimesSync = function (path, at, mt) {
var fd = fs.openSync(path, constants.O_SYMLINK)
, err
, err2
, ret
try {
var ret = fs.futimesSync(fd, at, mt)
} catch (er) {
err = er
}
try {
fs.closeSync(fd)
} catch (er) {
err2 = er
}
if (err || err2) throw (err || err2)
return ret
}
} else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) {
// maybe utimensat will be bound soonish?
fs.lutimes = function (path, at, mt, cb) {
fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb)
}
fs.lutimesSync = function (path, at, mt) {
return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW)
}
} else {
fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) }
fs.lutimesSync = function () {}
}
}
// https://github.com/isaacs/node-graceful-fs/issues/4
// Chown should not fail on einval or eperm if non-root.
// It should not fail on enosys ever, as this just indicates
// that a fs doesn't support the intended operation.
fs.chown = chownFix(fs.chown)
fs.fchown = chownFix(fs.fchown)
fs.lchown = chownFix(fs.lchown)
fs.chmod = chownFix(fs.chmod)
fs.fchmod = chownFix(fs.fchmod)
fs.lchmod = chownFix(fs.lchmod)
fs.chownSync = chownFixSync(fs.chownSync)
fs.fchownSync = chownFixSync(fs.fchownSync)
fs.lchownSync = chownFixSync(fs.lchownSync)
fs.chmodSync = chownFix(fs.chmodSync)
fs.fchmodSync = chownFix(fs.fchmodSync)
fs.lchmodSync = chownFix(fs.lchmodSync)
function chownFix (orig) {
if (!orig) return orig
return function (target, uid, gid, cb) {
return orig.call(fs, target, uid, gid, function (er, res) {
if (chownErOk(er)) er = null
cb(er, res)
})
}
}
function chownFixSync (orig) {
if (!orig) return orig
return function (target, uid, gid) {
try {
return orig.call(fs, target, uid, gid)
} catch (er) {
if (!chownErOk(er)) throw er
}
}
}
// ENOSYS means that the fs doesn't support the op. Just ignore
// that, because it doesn't matter.
//
// if there's no getuid, or if getuid() is something other
// than 0, and the error is EINVAL or EPERM, then just ignore
// it.
//
// This specific case is a silent failure in cp, install, tar,
// and most other unix tools that manage permissions.
//
// When running as root, or if other types of errors are
// encountered, then it's strict.
function chownErOk (er) {
if (!er)
return true
if (er.code === "ENOSYS")
return true
var nonroot = !process.getuid || process.getuid() !== 0
if (nonroot) {
if (er.code === "EINVAL" || er.code === "EPERM")
return true
}
return false
}
// if lchmod/lchown do not exist, then make them no-ops
if (!fs.lchmod) {
fs.lchmod = function (path, mode, cb) {
process.nextTick(cb)
}
fs.lchmodSync = function () {}
}
if (!fs.lchown) {
fs.lchown = function (path, uid, gid, cb) {
process.nextTick(cb)
}
fs.lchownSync = function () {}
}
// on Windows, A/V software can lock the directory, causing this
// to fail with an EACCES or EPERM if the directory contains newly
// created files. Try again on failure, for up to 1 second.
if (process.platform === "win32") {
var rename_ = fs.rename
fs.rename = function rename (from, to, cb) {
var start = Date.now()
rename_(from, to, function CB (er) {
if (er
&& (er.code === "EACCES" || er.code === "EPERM")
&& Date.now() - start < 1000) {
return rename_(from, to, CB)
}
if(cb) cb(er)
})
}
}
// if read() returns EAGAIN, then just try it again.
var read = fs.read
fs.read = function (fd, buffer, offset, length, position, callback_) {
var callback
if (callback_ && typeof callback_ === 'function') {
var eagCounter = 0
callback = function (er, _, __) {
if (er && er.code === 'EAGAIN' && eagCounter < 10) {
eagCounter ++
return read.call(fs, fd, buffer, offset, length, position, callback)
}
callback_.apply(this, arguments)
}
}
return read.call(fs, fd, buffer, offset, length, position, callback)
}
var readSync = fs.readSync
fs.readSync = function (fd, buffer, offset, length, position) {
var eagCounter = 0
while (true) {
try {
return readSync.call(fs, fd, buffer, offset, length, position)
} catch (er) {
if (er.code === 'EAGAIN' && eagCounter < 10) {
eagCounter ++
continue
}
throw er
}
}
}

69
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/test/max-open.js сгенерированный поставляемый
Просмотреть файл

@ -1,69 +0,0 @@
var test = require('tap').test
var fs = require('../')
test('open lots of stuff', function (t) {
// Get around EBADF from libuv by making sure that stderr is opened
// Otherwise Darwin will refuse to give us a FD for stderr!
process.stderr.write('')
// How many parallel open()'s to do
var n = 1024
var opens = 0
var fds = []
var going = true
var closing = false
var doneCalled = 0
for (var i = 0; i < n; i++) {
go()
}
function go() {
opens++
fs.open(__filename, 'r', function (er, fd) {
if (er) throw er
fds.push(fd)
if (going) go()
})
}
// should hit ulimit pretty fast
setTimeout(function () {
going = false
t.equal(opens - fds.length, n)
done()
}, 100)
function done () {
if (closing) return
doneCalled++
if (fds.length === 0) {
console.error('done called %d times', doneCalled)
// First because of the timeout
// Then to close the fd's opened afterwards
// Then this time, to complete.
// Might take multiple passes, depending on CPU speed
// and ulimit, but at least 3 in every case.
t.ok(doneCalled >= 2)
return t.end()
}
closing = true
setTimeout(function () {
// console.error('do closing again')
closing = false
done()
}, 100)
// console.error('closing time')
var closes = fds.slice(0)
fds.length = 0
closes.forEach(function (fd) {
fs.close(fd, function (er) {
if (er) throw er
})
})
}
})

39
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/test/open.js сгенерированный поставляемый
Просмотреть файл

@ -1,39 +0,0 @@
var test = require('tap').test
var fs = require('../graceful-fs.js')
test('graceful fs is monkeypatched fs', function (t) {
t.equal(fs, require('../fs.js'))
t.end()
})
test('open an existing file works', function (t) {
var fd = fs.openSync(__filename, 'r')
fs.closeSync(fd)
fs.open(__filename, 'r', function (er, fd) {
if (er) throw er
fs.close(fd, function (er) {
if (er) throw er
t.pass('works')
t.end()
})
})
})
test('open a non-existing file throws', function (t) {
var er
try {
var fd = fs.openSync('this file does not exist', 'r')
} catch (x) {
er = x
}
t.ok(er, 'should throw')
t.notOk(fd, 'should not get an fd')
t.equal(er.code, 'ENOENT')
fs.open('neither does this file', 'r', function (er, fd) {
t.ok(er, 'should throw')
t.notOk(fd, 'should not get an fd')
t.equal(er.code, 'ENOENT')
t.end()
})
})

20
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/test/readdir-sort.js сгенерированный поставляемый
Просмотреть файл

@ -1,20 +0,0 @@
var test = require("tap").test
var fs = require("../fs.js")
var readdir = fs.readdir
fs.readdir = function(path, cb) {
process.nextTick(function() {
cb(null, ["b", "z", "a"])
})
}
var g = require("../")
test("readdir reorder", function (t) {
g.readdir("whatevers", function (er, files) {
if (er)
throw er
t.same(files, [ "a", "b", "z" ])
t.end()
})
})

47
deps/npm/node_modules/node-gyp/node_modules/graceful-fs/test/write-then-read.js сгенерированный поставляемый
Просмотреть файл

@ -1,47 +0,0 @@
var fs = require('../');
var rimraf = require('rimraf');
var mkdirp = require('mkdirp');
var test = require('tap').test;
var p = require('path').resolve(__dirname, 'files');
process.chdir(__dirname)
// Make sure to reserve the stderr fd
process.stderr.write('');
var num = 4097;
var paths = new Array(num);
test('make files', function (t) {
rimraf.sync(p);
mkdirp.sync(p);
for (var i = 0; i < num; ++i) {
paths[i] = 'files/file-' + i;
fs.writeFileSync(paths[i], 'content');
}
t.end();
})
test('read files', function (t) {
// now read them
var done = 0;
for (var i = 0; i < num; ++i) {
fs.readFile(paths[i], function(err, data) {
if (err)
throw err;
++done;
if (done === num) {
t.pass('success');
t.end()
}
});
}
});
test('cleanup', function (t) {
rimraf.sync(p);
t.end();
});

4
deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.jshintrc сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,4 @@
{
"asi": true,
"laxcomma": true
}

3
deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/.jshintrc сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,3 @@
{
"laxbreak": true
}

Просмотреть файл

@ -53,5 +53,6 @@
"tarball": "http://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz"
"_resolved": "https://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz",
"readme": "ERROR: No README data found!"
}

3
deps/npm/node_modules/node-gyp/node_modules/path-array/package.json сгенерированный поставляемый
Просмотреть файл

@ -51,5 +51,6 @@
"tarball": "http://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz"
"_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz",
"readme": "ERROR: No README data found!"
}

4
deps/npm/node_modules/node-gyp/node_modules/semver/.npmignore сгенерированный поставляемый
Просмотреть файл

@ -1,4 +0,0 @@
node_modules/
coverage/
.nyc_output/
nyc_output/

5
deps/npm/node_modules/node-gyp/node_modules/semver/.travis.yml сгенерированный поставляемый
Просмотреть файл

@ -1,5 +0,0 @@
language: node_js
node_js:
- '0.10'
- '0.12'
- 'iojs'

15
deps/npm/node_modules/node-gyp/node_modules/semver/LICENSE сгенерированный поставляемый
Просмотреть файл

@ -1,15 +0,0 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

24
deps/npm/node_modules/node-gyp/node_modules/semver/Makefile сгенерированный поставляемый
Просмотреть файл

@ -1,24 +0,0 @@
files = semver.browser.js \
semver.min.js \
semver.browser.js.gz \
semver.min.js.gz
all: $(files)
clean:
rm -f $(files)
semver.browser.js: head.js.txt semver.js foot.js.txt
( cat head.js.txt; \
cat semver.js | \
egrep -v '^ *\/\* nomin \*\/' | \
perl -pi -e 's/debug\([^\)]+\)//g'; \
cat foot.js.txt ) > semver.browser.js
semver.min.js: semver.browser.js
uglifyjs -m <semver.browser.js >semver.min.js
%.gz: %
gzip --stdout -9 <$< >$@
.PHONY: all clean

303
deps/npm/node_modules/node-gyp/node_modules/semver/README.md сгенерированный поставляемый
Просмотреть файл

@ -1,303 +0,0 @@
semver(1) -- The semantic versioner for npm
===========================================
## Usage
$ npm install semver
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean(' =v1.2.3 ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
As a command-line utility:
$ semver -h
Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv]
Test if version(s) satisfy the supplied range(s), and sort them.
Multiple versions or ranges may be supplied, unless increment
option is specified. In that case, only a single version may
be used, and it is incremented by the specified level
Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.
If no versions are valid, or ranges are not satisfied,
then exits failure.
Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
## Versions
A "version" is described by the `v2.0.0` specification found at
<http://semver.org/>.
A leading `"="` or `"v"` character is stripped off and ignored.
## Ranges
A `version range` is a set of `comparators` which specify versions
that satisfy the range.
A `comparator` is composed of an `operator` and a `version`. The set
of primitive `operators` is:
* `<` Less than
* `<=` Less than or equal to
* `>` Greater than
* `>=` Greater than or equal to
* `=` Equal. If no operator is specified, then equality is assumed,
so this operator is optional, but MAY be included.
For example, the comparator `>=1.2.7` would match the versions
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
or `1.1.0`.
Comparators can be joined by whitespace to form a `comparator set`,
which is satisfied by the **intersection** of all of the comparators
it includes.
A range is composed of one or more comparator sets, joined by `||`. A
version matches a range if and only if every comparator in at least
one of the `||`-separated comparator sets is satisfied by the version.
For example, the range `>=1.2.7 <1.3.0` would match the versions
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
or `1.1.0`.
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
### Prerelease Tags
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
it will only be allowed to satisfy comparator sets if at least one
comparator with the same `[major, minor, patch]` tuple also has a
prerelease tag.
For example, the range `>1.2.3-alpha.3` would be allowed to match the
version `1.2.3-alpha.7`, but it would *not* be satisfied by
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
range only accepts prerelease tags on the `1.2.3` version. The
version `3.4.5` *would* satisfy the range, because it does not have a
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
The purpose for this behavior is twofold. First, prerelease versions
frequently are updated very quickly, and contain many breaking changes
that are (by the author's design) not yet fit for public consumption.
Therefore, by default, they are excluded from range matching
semantics.
Second, a user who has opted into using a prerelease version has
clearly indicated the intent to use *that specific* set of
alpha/beta/rc versions. By including a prerelease tag in the range,
the user is indicating that they are aware of the risk. However, it
is still not appropriate to assume that they have opted into taking a
similar risk on the *next* set of prerelease versions.
#### Prerelease Identifiers
The method `.inc` takes an additional `identifier` string argument that
will append the value of the string as a prerelease identifier:
```javascript
> semver.inc('1.2.3', 'pre', 'beta')
'1.2.4-beta.0'
```
command-line example:
```shell
$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
```
Which then can be used to increment further:
```shell
$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
```
### Advanced Range Syntax
Advanced range syntax desugars to primitive comparators in
deterministic ways.
Advanced ranges may be combined in the same way as primitive
comparators using white space or `||`.
#### Hyphen Ranges `X.Y.Z - A.B.C`
Specifies an inclusive set.
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
If a partial version is provided as the first version in the inclusive
range, then the missing pieces are replaced with zeroes.
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
If a partial version is provided as the second version in the
inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.
* `*` := `>=0.0.0` (Any version satisfies)
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
A partial version range is treated as an X-Range, so the special
character is in fact optional.
* `""` (empty string) := `*` := `>=0.0.0`
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
Allows patch-level changes if a minor version is specified on the
comparator. Allows minor-level changes if not.
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
Allows changes that do not modify the left-most non-zero digit in the
`[major, minor, patch]` tuple. In other words, this allows patch and
minor updates for versions `1.0.0` and above, patch updates for
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
Many authors treat a `0.x` version as if the `x` were the major
"breaking-change" indicator.
Caret ranges are ideal when an author may make breaking changes
between `0.2.4` and `0.3.0` releases, which is a common practice.
However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.
* `^1.2.3` := `>=1.2.3 <2.0.0`
* `^0.2.3` := `>=0.2.3 <0.3.0`
* `^0.0.3` := `>=0.0.3 <0.0.4`
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
`0.0.3` version *only* will be allowed, if they are greater than or
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.
* `^1.2.x` := `>=1.2.0 <2.0.0`
* `^0.0.x` := `>=0.0.0 <0.1.0`
* `^0.0` := `>=0.0.0 <0.1.0`
A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.
* `^1.x` := `>=1.0.0 <2.0.0`
* `^0.x` := `>=0.0.0 <1.0.0`
## Functions
All methods and classes take a final `loose` boolean argument that, if
true, will be more forgiving about not-quite-valid semver strings.
The resulting output will always be 100% strict, of course.
Strict-mode Comparators and Ranges will be strict about the SemVer
strings that they parse.
* `valid(v)`: Return the parsed version, or null if it's not valid.
* `inc(v, release)`: Return the version incremented by the release
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
`prepatch`, or `prerelease`), or null if it's not valid
* `premajor` in one call will bump the version up to the next major
version and down to a prerelease of that major version.
`preminor`, and `prepatch` work the same way.
* If called from a non-prerelease version, the `prerelease` will work the
same as `prepatch`. It increments the patch version, then makes a
prerelease. If the input version is already a prerelease it simply
increments it.
* `major(v)`: Return the major version number.
* `minor(v)`: Return the minor version number.
* `patch(v)`: Return the patch version number.
### Comparison
* `gt(v1, v2)`: `v1 > v2`
* `gte(v1, v2)`: `v1 >= v2`
* `lt(v1, v2)`: `v1 < v2`
* `lte(v1, v2)`: `v1 <= v2`
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
even if they're not the exact same string. You already know how to
compare strings.
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
the corresponding function above. `"==="` and `"!=="` do simple
string comparison, but are included for completeness. Throws if an
invalid comparison string is provided.
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
in descending order when passed to `Array.sort()`.
* `diff(v1, v2)`: Returns difference between two versions by the release type
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
or null if the versions are the same.
### Ranges
* `validRange(range)`: Return the valid range or null if it's not valid
* `satisfies(version, range)`: Return true if the version satisfies the
range.
* `maxSatisfying(versions, range)`: Return the highest version in the list
that satisfies the range, or `null` if none of them do.
* `gtr(version, range)`: Return `true` if version is greater than all the
versions possible in the range.
* `ltr(version, range)`: Return `true` if version is less than all the
versions possible in the range.
* `outside(version, range, hilo)`: Return true if the version is outside
the bounds of the range in either the high or low direction. The
`hilo` argument must be either the string `'>'` or `'<'`. (This is
the function called by `gtr` and `ltr`.)
Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range! For
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
until `2.0.0`, so the version `1.2.10` would not be greater than the
range (because `2.0.1` satisfies, which is higher), nor less than the
range (since `1.2.8` satisfies, which is lower), and it also does not
satisfy the range.
If you want to know if a version satisfies or does not satisfy a
range, use the `satisfies(version, range)` function.

133
deps/npm/node_modules/node-gyp/node_modules/semver/bin/semver сгенерированный поставляемый
Просмотреть файл

@ -1,133 +0,0 @@
#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.
var argv = process.argv.slice(2)
, versions = []
, range = []
, gt = []
, lt = []
, eq = []
, inc = null
, version = require("../package.json").version
, loose = false
, identifier = undefined
, semver = require("../semver")
, reverse = false
main()
function main () {
if (!argv.length) return help()
while (argv.length) {
var a = argv.shift()
var i = a.indexOf('=')
if (i !== -1) {
a = a.slice(0, i)
argv.unshift(a.slice(i + 1))
}
switch (a) {
case "-rv": case "-rev": case "--rev": case "--reverse":
reverse = true
break
case "-l": case "--loose":
loose = true
break
case "-v": case "--version":
versions.push(argv.shift())
break
case "-i": case "--inc": case "--increment":
switch (argv[0]) {
case "major": case "minor": case "patch": case "prerelease":
case "premajor": case "preminor": case "prepatch":
inc = argv.shift()
break
default:
inc = "patch"
break
}
break
case "--preid":
identifier = argv.shift()
break
case "-r": case "--range":
range.push(argv.shift())
break
case "-h": case "--help": case "-?":
return help()
default:
versions.push(a)
break
}
}
versions = versions.filter(function (v) {
return semver.valid(v, loose)
})
if (!versions.length) return fail()
if (inc && (versions.length !== 1 || range.length))
return failInc()
for (var i = 0, l = range.length; i < l ; i ++) {
versions = versions.filter(function (v) {
return semver.satisfies(v, range[i], loose)
})
if (!versions.length) return fail()
}
return success(versions)
}
function failInc () {
console.error("--inc can only be used on a single version with no range")
fail()
}
function fail () { process.exit(1) }
function success () {
var compare = reverse ? "rcompare" : "compare"
versions.sort(function (a, b) {
return semver[compare](a, b, loose)
}).map(function (v) {
return semver.clean(v, loose)
}).map(function (v) {
return inc ? semver.inc(v, inc, loose, identifier) : v
}).forEach(function (v,i,_) { console.log(v) })
}
function help () {
console.log(["SemVer " + version
,""
,"A JavaScript implementation of the http://semver.org/ specification"
,"Copyright Isaac Z. Schlueter"
,""
,"Usage: semver [options] <version> [<version> [...]]"
,"Prints valid versions sorted by SemVer precedence"
,""
,"Options:"
,"-r --range <range>"
," Print versions that match the specified range."
,""
,"-i --increment [<level>]"
," Increment a version by the specified level. Level can"
," be one of: major, minor, patch, premajor, preminor,"
," prepatch, or prerelease. Default level is 'patch'."
," Only one version may be specified."
,""
,"--preid <identifier>"
," Identifier to be used to prefix premajor, preminor,"
," prepatch or prerelease version increments."
,""
,"-l --loose"
," Interpret versions and ranges loosely"
,""
,"Program exits successfully if any valid version satisfies"
,"all supplied ranges, and prints all satisfying versions."
,""
,"If no satisfying versions are found, then exits failure."
,""
,"Versions are printed in ascending order, so supplying"
,"multiple versions to the utility will just sort them."
].join("\n"))
}

6
deps/npm/node_modules/node-gyp/node_modules/semver/foot.js.txt сгенерированный поставляемый
Просмотреть файл

@ -1,6 +0,0 @@
})(
typeof exports === 'object' ? exports :
typeof define === 'function' && define.amd ? {} :
semver = {}
);

1
deps/npm/node_modules/node-gyp/node_modules/semver/head.js.txt сгенерированный поставляемый
Просмотреть файл

@ -1 +0,0 @@
;(function(exports) {

55
deps/npm/node_modules/node-gyp/node_modules/semver/package.json сгенерированный поставляемый
Просмотреть файл

@ -1,55 +0,0 @@
{
"name": "semver",
"version": "4.3.6",
"description": "The semantic version parser used by npm.",
"main": "semver.js",
"browser": "semver.browser.js",
"min": "semver.min.js",
"scripts": {
"test": "tap test/*.js",
"prepublish": "make"
},
"devDependencies": {
"tap": "^1.2.0",
"uglify-js": "~2.3.6"
},
"license": "ISC",
"repository": {
"type": "git",
"url": "git://github.com/npm/node-semver.git"
},
"bin": {
"semver": "./bin/semver"
},
"gitHead": "63c48296ca5da3ba6a88c743bb8c92effc789811",
"bugs": {
"url": "https://github.com/npm/node-semver/issues"
},
"homepage": "https://github.com/npm/node-semver#readme",
"_id": "semver@4.3.6",
"_shasum": "300bc6e0e86374f7ba61068b5b1ecd57fc6532da",
"_from": "semver@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0||>=4.0.0 <5.0.0",
"_npmVersion": "2.10.1",
"_nodeVersion": "2.0.1",
"_npmUser": {
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
"dist": {
"shasum": "300bc6e0e86374f7ba61068b5b1ecd57fc6532da",
"tarball": "http://registry.npmjs.org/semver/-/semver-4.3.6.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
{
"name": "othiym23",
"email": "ogd@aoaioxxysz.net"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz",
"readme": "ERROR: No README data found!"
}

1201
deps/npm/node_modules/node-gyp/node_modules/semver/semver.browser.js сгенерированный поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Двоичные данные
deps/npm/node_modules/node-gyp/node_modules/semver/semver.browser.js.gz сгенерированный поставляемый

Двоичный файл не отображается.

1205
deps/npm/node_modules/node-gyp/node_modules/semver/semver.js сгенерированный поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

1
deps/npm/node_modules/node-gyp/node_modules/semver/semver.min.js сгенерированный поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Двоичные данные
deps/npm/node_modules/node-gyp/node_modules/semver/semver.min.js.gz сгенерированный поставляемый

Двоичный файл не отображается.

15
deps/npm/node_modules/node-gyp/node_modules/semver/test/amd.js сгенерированный поставляемый
Просмотреть файл

@ -1,15 +0,0 @@
var tap = require('tap');
var test = tap.test;
test('amd', function(t) {
global.define = define;
define.amd = true;
var defined = null;
function define(stuff) {
defined = stuff;
}
var fromRequire = require('../');
t.ok(defined, 'amd function called');
t.equal(fromRequire, defined, 'amd stuff same as require stuff');
t.end();
});

31
deps/npm/node_modules/node-gyp/node_modules/semver/test/big-numbers.js сгенерированный поставляемый
Просмотреть файл

@ -1,31 +0,0 @@
var test = require('tap').test
var semver = require('../')
test('long version is too long', function (t) {
var v = '1.2.' + new Array(256).join('1')
t.throws(function () {
new semver.SemVer(v)
})
t.equal(semver.valid(v, false), null)
t.equal(semver.valid(v, true), null)
t.equal(semver.inc(v, 'patch'), null)
t.end()
})
test('big number is like too long version', function (t) {
var v = '1.2.' + new Array(100).join('1')
t.throws(function () {
new semver.SemVer(v)
})
t.equal(semver.valid(v, false), null)
t.equal(semver.valid(v, true), null)
t.equal(semver.inc(v, 'patch'), null)
t.end()
})
test('parsing null does not throw', function (t) {
t.equal(semver.parse(null), null)
t.equal(semver.parse({}), null)
t.equal(semver.parse(new semver.SemVer('1.2.3')).version, '1.2.3')
t.end()
})

29
deps/npm/node_modules/node-gyp/node_modules/semver/test/clean.js сгенерированный поставляемый
Просмотреть файл

@ -1,29 +0,0 @@
var tap = require('tap');
var test = tap.test;
var semver = require('../semver.js');
var clean = semver.clean;
test('\nclean tests', function(t) {
// [range, version]
// Version should be detectable despite extra characters
[
['1.2.3', '1.2.3'],
[' 1.2.3 ', '1.2.3'],
[' 1.2.3-4 ', '1.2.3-4'],
[' 1.2.3-pre ', '1.2.3-pre'],
[' =v1.2.3 ', '1.2.3'],
['v1.2.3', '1.2.3'],
[' v1.2.3 ', '1.2.3'],
['\t1.2.3', '1.2.3'],
['>1.2.3', null],
['~1.2.3', null],
['<=1.2.3', null],
['1.2.x', null]
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1];
var msg = 'clean(' + range + ') = ' + version;
t.equal(clean(range), version, msg);
});
t.end();
});

173
deps/npm/node_modules/node-gyp/node_modules/semver/test/gtr.js сгенерированный поставляемый
Просмотреть файл

@ -1,173 +0,0 @@
var tap = require('tap');
var test = tap.test;
var semver = require('../semver.js');
var gtr = semver.gtr;
test('\ngtr tests', function(t) {
// [range, version, loose]
// Version should be greater than range
[
['~1.2.2', '1.3.0'],
['~0.6.1-1', '0.7.1-1'],
['1.0.0 - 2.0.0', '2.0.1'],
['1.0.0', '1.0.1-beta1'],
['1.0.0', '2.0.0'],
['<=2.0.0', '2.1.1'],
['<=2.0.0', '3.2.9'],
['<2.0.0', '2.0.0'],
['0.1.20 || 1.2.4', '1.2.5'],
['2.x.x', '3.0.0'],
['1.2.x', '1.3.0'],
['1.2.x || 2.x', '3.0.0'],
['2.*.*', '5.0.1'],
['1.2.*', '1.3.3'],
['1.2.* || 2.*', '4.0.0'],
['2', '3.0.0'],
['2.3', '2.4.2'],
['~2.4', '2.5.0'], // >=2.4.0 <2.5.0
['~2.4', '2.5.5'],
['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0
['~1', '2.2.3'], // >=1.0.0 <2.0.0
['~>1', '2.2.4'],
['~> 1', '3.2.3'],
['~1.0', '1.1.2'], // >=1.0.0 <1.1.0
['~ 1.0', '1.1.0'],
['<1.2', '1.2.0'],
['< 1.2', '1.2.1'],
['1', '2.0.0beta', true],
['~v0.5.4-pre', '0.6.0'],
['~v0.5.4-pre', '0.6.1-pre'],
['=0.7.x', '0.8.0'],
['=0.7.x', '0.8.0-asdf'],
['<0.7.x', '0.7.0'],
['~1.2.2', '1.3.0'],
['1.0.0 - 2.0.0', '2.2.3'],
['1.0.0', '1.0.1'],
['<=2.0.0', '3.0.0'],
['<=2.0.0', '2.9999.9999'],
['<=2.0.0', '2.2.9'],
['<2.0.0', '2.9999.9999'],
['<2.0.0', '2.2.9'],
['2.x.x', '3.1.3'],
['1.2.x', '1.3.3'],
['1.2.x || 2.x', '3.1.3'],
['2.*.*', '3.1.3'],
['1.2.*', '1.3.3'],
['1.2.* || 2.*', '3.1.3'],
['2', '3.1.2'],
['2.3', '2.4.1'],
['~2.4', '2.5.0'], // >=2.4.0 <2.5.0
['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0
['~1', '2.2.3'], // >=1.0.0 <2.0.0
['~>1', '2.2.3'],
['~1.0', '1.1.0'], // >=1.0.0 <1.1.0
['<1', '1.0.0'],
['1', '2.0.0beta', true],
['<1', '1.0.0beta', true],
['< 1', '1.0.0beta', true],
['=0.7.x', '0.8.2'],
['<0.7.x', '0.7.2']
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1];
var loose = tuple[2] || false;
var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')';
t.ok(gtr(version, range, loose), msg);
});
t.end();
});
test('\nnegative gtr tests', function(t) {
// [range, version, loose]
// Version should NOT be greater than range
[
['~0.6.1-1', '0.6.1-1'],
['1.0.0 - 2.0.0', '1.2.3'],
['1.0.0 - 2.0.0', '0.9.9'],
['1.0.0', '1.0.0'],
['>=*', '0.2.4'],
['', '1.0.0', true],
['*', '1.2.3'],
['*', 'v1.2.3-foo'],
['>=1.0.0', '1.0.0'],
['>=1.0.0', '1.0.1'],
['>=1.0.0', '1.1.0'],
['>1.0.0', '1.0.1'],
['>1.0.0', '1.1.0'],
['<=2.0.0', '2.0.0'],
['<=2.0.0', '1.9999.9999'],
['<=2.0.0', '0.2.9'],
['<2.0.0', '1.9999.9999'],
['<2.0.0', '0.2.9'],
['>= 1.0.0', '1.0.0'],
['>= 1.0.0', '1.0.1'],
['>= 1.0.0', '1.1.0'],
['> 1.0.0', '1.0.1'],
['> 1.0.0', '1.1.0'],
['<= 2.0.0', '2.0.0'],
['<= 2.0.0', '1.9999.9999'],
['<= 2.0.0', '0.2.9'],
['< 2.0.0', '1.9999.9999'],
['<\t2.0.0', '0.2.9'],
['>=0.1.97', 'v0.1.97'],
['>=0.1.97', '0.1.97'],
['0.1.20 || 1.2.4', '1.2.4'],
['0.1.20 || >1.2.4', '1.2.4'],
['0.1.20 || 1.2.4', '1.2.3'],
['0.1.20 || 1.2.4', '0.1.20'],
['>=0.2.3 || <0.0.1', '0.0.0'],
['>=0.2.3 || <0.0.1', '0.2.3'],
['>=0.2.3 || <0.0.1', '0.2.4'],
['||', '1.3.4'],
['2.x.x', '2.1.3'],
['1.2.x', '1.2.3'],
['1.2.x || 2.x', '2.1.3'],
['1.2.x || 2.x', '1.2.3'],
['x', '1.2.3'],
['2.*.*', '2.1.3'],
['1.2.*', '1.2.3'],
['1.2.* || 2.*', '2.1.3'],
['1.2.* || 2.*', '1.2.3'],
['1.2.* || 2.*', '1.2.3'],
['*', '1.2.3'],
['2', '2.1.2'],
['2.3', '2.3.1'],
['~2.4', '2.4.0'], // >=2.4.0 <2.5.0
['~2.4', '2.4.5'],
['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0
['~1', '1.2.3'], // >=1.0.0 <2.0.0
['~>1', '1.2.3'],
['~> 1', '1.2.3'],
['~1.0', '1.0.2'], // >=1.0.0 <1.1.0
['~ 1.0', '1.0.2'],
['>=1', '1.0.0'],
['>= 1', '1.0.0'],
['<1.2', '1.1.1'],
['< 1.2', '1.1.1'],
['1', '1.0.0beta', true],
['~v0.5.4-pre', '0.5.5'],
['~v0.5.4-pre', '0.5.4'],
['=0.7.x', '0.7.2'],
['>=0.7.x', '0.7.2'],
['=0.7.x', '0.7.0-asdf'],
['>=0.7.x', '0.7.0-asdf'],
['<=0.7.x', '0.6.2'],
['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'],
['>=0.2.3 <=0.2.4', '0.2.4'],
['1.0.0 - 2.0.0', '2.0.0'],
['^1', '0.0.0-0'],
['^3.0.0', '2.0.0'],
['^1.0.0 || ~2.0.1', '2.0.0'],
['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'],
['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true],
['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true],
['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0']
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1];
var loose = tuple[2] || false;
var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')';
t.notOk(gtr(version, range, loose), msg);
});
t.end();
});

685
deps/npm/node_modules/node-gyp/node_modules/semver/test/index.js сгенерированный поставляемый
Просмотреть файл

@ -1,685 +0,0 @@
'use strict';
var tap = require('tap');
var test = tap.test;
var semver = require('../semver.js');
var eq = semver.eq;
var gt = semver.gt;
var lt = semver.lt;
var neq = semver.neq;
var cmp = semver.cmp;
var gte = semver.gte;
var lte = semver.lte;
var satisfies = semver.satisfies;
var validRange = semver.validRange;
var inc = semver.inc;
var diff = semver.diff;
var replaceStars = semver.replaceStars;
var toComparators = semver.toComparators;
var SemVer = semver.SemVer;
var Range = semver.Range;
test('\ncomparison tests', function(t) {
// [version1, version2]
// version1 should be greater than version2
[['0.0.0', '0.0.0-foo'],
['0.0.1', '0.0.0'],
['1.0.0', '0.9.9'],
['0.10.0', '0.9.0'],
['0.99.0', '0.10.0'],
['2.0.0', '1.2.3'],
['v0.0.0', '0.0.0-foo', true],
['v0.0.1', '0.0.0', true],
['v1.0.0', '0.9.9', true],
['v0.10.0', '0.9.0', true],
['v0.99.0', '0.10.0', true],
['v2.0.0', '1.2.3', true],
['0.0.0', 'v0.0.0-foo', true],
['0.0.1', 'v0.0.0', true],
['1.0.0', 'v0.9.9', true],
['0.10.0', 'v0.9.0', true],
['0.99.0', 'v0.10.0', true],
['2.0.0', 'v1.2.3', true],
['1.2.3', '1.2.3-asdf'],
['1.2.3', '1.2.3-4'],
['1.2.3', '1.2.3-4-foo'],
['1.2.3-5-foo', '1.2.3-5'],
['1.2.3-5', '1.2.3-4'],
['1.2.3-5-foo', '1.2.3-5-Foo'],
['3.0.0', '2.7.2+asdf'],
['1.2.3-a.10', '1.2.3-a.5'],
['1.2.3-a.b', '1.2.3-a.5'],
['1.2.3-a.b', '1.2.3-a'],
['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'],
['1.2.3-r2', '1.2.3-r100'],
['1.2.3-r100', '1.2.3-R2']
].forEach(function(v) {
var v0 = v[0];
var v1 = v[1];
var loose = v[2];
t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')");
t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')");
t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')");
t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')");
t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')");
t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')");
t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')");
t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')");
t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')");
t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')");
t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')");
});
t.end();
});
test('\nequality tests', function(t) {
// [version1, version2]
// version1 should be equivalent to version2
[['1.2.3', 'v1.2.3', true],
['1.2.3', '=1.2.3', true],
['1.2.3', 'v 1.2.3', true],
['1.2.3', '= 1.2.3', true],
['1.2.3', ' v1.2.3', true],
['1.2.3', ' =1.2.3', true],
['1.2.3', ' v 1.2.3', true],
['1.2.3', ' = 1.2.3', true],
['1.2.3-0', 'v1.2.3-0', true],
['1.2.3-0', '=1.2.3-0', true],
['1.2.3-0', 'v 1.2.3-0', true],
['1.2.3-0', '= 1.2.3-0', true],
['1.2.3-0', ' v1.2.3-0', true],
['1.2.3-0', ' =1.2.3-0', true],
['1.2.3-0', ' v 1.2.3-0', true],
['1.2.3-0', ' = 1.2.3-0', true],
['1.2.3-1', 'v1.2.3-1', true],
['1.2.3-1', '=1.2.3-1', true],
['1.2.3-1', 'v 1.2.3-1', true],
['1.2.3-1', '= 1.2.3-1', true],
['1.2.3-1', ' v1.2.3-1', true],
['1.2.3-1', ' =1.2.3-1', true],
['1.2.3-1', ' v 1.2.3-1', true],
['1.2.3-1', ' = 1.2.3-1', true],
['1.2.3-beta', 'v1.2.3-beta', true],
['1.2.3-beta', '=1.2.3-beta', true],
['1.2.3-beta', 'v 1.2.3-beta', true],
['1.2.3-beta', '= 1.2.3-beta', true],
['1.2.3-beta', ' v1.2.3-beta', true],
['1.2.3-beta', ' =1.2.3-beta', true],
['1.2.3-beta', ' v 1.2.3-beta', true],
['1.2.3-beta', ' = 1.2.3-beta', true],
['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true],
['1.2.3+build', ' = 1.2.3+otherbuild', true],
['1.2.3-beta+build', '1.2.3-beta+otherbuild'],
['1.2.3+build', '1.2.3+otherbuild'],
[' v1.2.3+build', '1.2.3+otherbuild']
].forEach(function(v) {
var v0 = v[0];
var v1 = v[1];
var loose = v[2];
t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')");
t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')");
t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')');
t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')');
t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')');
t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')');
t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')");
t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')");
t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')");
t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')");
});
t.end();
});
test('\nrange tests', function(t) {
// [range, version]
// version should be included by range
[['1.0.0 - 2.0.0', '1.2.3'],
['^1.2.3+build', '1.2.3'],
['^1.2.3+build', '1.3.0'],
['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'],
['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true],
['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true],
['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true],
['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'],
['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'],
['1.2.3+asdf - 2.4.3+asdf', '1.2.3'],
['1.0.0', '1.0.0'],
['>=*', '0.2.4'],
['', '1.0.0'],
['*', '1.2.3'],
['*', 'v1.2.3', true],
['>=1.0.0', '1.0.0'],
['>=1.0.0', '1.0.1'],
['>=1.0.0', '1.1.0'],
['>1.0.0', '1.0.1'],
['>1.0.0', '1.1.0'],
['<=2.0.0', '2.0.0'],
['<=2.0.0', '1.9999.9999'],
['<=2.0.0', '0.2.9'],
['<2.0.0', '1.9999.9999'],
['<2.0.0', '0.2.9'],
['>= 1.0.0', '1.0.0'],
['>= 1.0.0', '1.0.1'],
['>= 1.0.0', '1.1.0'],
['> 1.0.0', '1.0.1'],
['> 1.0.0', '1.1.0'],
['<= 2.0.0', '2.0.0'],
['<= 2.0.0', '1.9999.9999'],
['<= 2.0.0', '0.2.9'],
['< 2.0.0', '1.9999.9999'],
['<\t2.0.0', '0.2.9'],
['>=0.1.97', 'v0.1.97', true],
['>=0.1.97', '0.1.97'],
['0.1.20 || 1.2.4', '1.2.4'],
['>=0.2.3 || <0.0.1', '0.0.0'],
['>=0.2.3 || <0.0.1', '0.2.3'],
['>=0.2.3 || <0.0.1', '0.2.4'],
['||', '1.3.4'],
['2.x.x', '2.1.3'],
['1.2.x', '1.2.3'],
['1.2.x || 2.x', '2.1.3'],
['1.2.x || 2.x', '1.2.3'],
['x', '1.2.3'],
['2.*.*', '2.1.3'],
['1.2.*', '1.2.3'],
['1.2.* || 2.*', '2.1.3'],
['1.2.* || 2.*', '1.2.3'],
['*', '1.2.3'],
['2', '2.1.2'],
['2.3', '2.3.1'],
['~2.4', '2.4.0'], // >=2.4.0 <2.5.0
['~2.4', '2.4.5'],
['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0,
['~1', '1.2.3'], // >=1.0.0 <2.0.0
['~>1', '1.2.3'],
['~> 1', '1.2.3'],
['~1.0', '1.0.2'], // >=1.0.0 <1.1.0,
['~ 1.0', '1.0.2'],
['~ 1.0.3', '1.0.12'],
['>=1', '1.0.0'],
['>= 1', '1.0.0'],
['<1.2', '1.1.1'],
['< 1.2', '1.1.1'],
['~v0.5.4-pre', '0.5.5'],
['~v0.5.4-pre', '0.5.4'],
['=0.7.x', '0.7.2'],
['<=0.7.x', '0.7.2'],
['>=0.7.x', '0.7.2'],
['<=0.7.x', '0.6.2'],
['~1.2.1 >=1.2.3', '1.2.3'],
['~1.2.1 =1.2.3', '1.2.3'],
['~1.2.1 1.2.3', '1.2.3'],
['~1.2.1 >=1.2.3 1.2.3', '1.2.3'],
['~1.2.1 1.2.3 >=1.2.3', '1.2.3'],
['~1.2.1 1.2.3', '1.2.3'],
['>=1.2.1 1.2.3', '1.2.3'],
['1.2.3 >=1.2.1', '1.2.3'],
['>=1.2.3 >=1.2.1', '1.2.3'],
['>=1.2.1 >=1.2.3', '1.2.3'],
['>=1.2', '1.2.8'],
['^1.2.3', '1.8.1'],
['^0.1.2', '0.1.2'],
['^0.1', '0.1.2'],
['^1.2', '1.4.2'],
['^1.2 ^1', '1.4.2'],
['^1.2.3-alpha', '1.2.3-pre'],
['^1.2.0-alpha', '1.2.0-pre'],
['^0.0.1-alpha', '0.0.1-beta']
].forEach(function(v) {
var range = v[0];
var ver = v[1];
var loose = v[2];
t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver);
});
t.end();
});
test('\nnegative range tests', function(t) {
// [range, version]
// version should not be included by range
[['1.0.0 - 2.0.0', '2.2.3'],
['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'],
['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'],
['^1.2.3+build', '2.0.0'],
['^1.2.3+build', '1.2.0'],
['^1.2.3', '1.2.3-pre'],
['^1.2', '1.2.0-pre'],
['>1.2', '1.3.0-beta'],
['<=1.2.3', '1.2.3-beta'],
['^1.2.3', '1.2.3-beta'],
['=0.7.x', '0.7.0-asdf'],
['>=0.7.x', '0.7.0-asdf'],
['1', '1.0.0beta', true],
['<1', '1.0.0beta', true],
['< 1', '1.0.0beta', true],
['1.0.0', '1.0.1'],
['>=1.0.0', '0.0.0'],
['>=1.0.0', '0.0.1'],
['>=1.0.0', '0.1.0'],
['>1.0.0', '0.0.1'],
['>1.0.0', '0.1.0'],
['<=2.0.0', '3.0.0'],
['<=2.0.0', '2.9999.9999'],
['<=2.0.0', '2.2.9'],
['<2.0.0', '2.9999.9999'],
['<2.0.0', '2.2.9'],
['>=0.1.97', 'v0.1.93', true],
['>=0.1.97', '0.1.93'],
['0.1.20 || 1.2.4', '1.2.3'],
['>=0.2.3 || <0.0.1', '0.0.3'],
['>=0.2.3 || <0.0.1', '0.2.2'],
['2.x.x', '1.1.3'],
['2.x.x', '3.1.3'],
['1.2.x', '1.3.3'],
['1.2.x || 2.x', '3.1.3'],
['1.2.x || 2.x', '1.1.3'],
['2.*.*', '1.1.3'],
['2.*.*', '3.1.3'],
['1.2.*', '1.3.3'],
['1.2.* || 2.*', '3.1.3'],
['1.2.* || 2.*', '1.1.3'],
['2', '1.1.2'],
['2.3', '2.4.1'],
['~2.4', '2.5.0'], // >=2.4.0 <2.5.0
['~2.4', '2.3.9'],
['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0
['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0
['~1', '0.2.3'], // >=1.0.0 <2.0.0
['~>1', '2.2.3'],
['~1.0', '1.1.0'], // >=1.0.0 <1.1.0
['<1', '1.0.0'],
['>=1.2', '1.1.1'],
['1', '2.0.0beta', true],
['~v0.5.4-beta', '0.5.4-alpha'],
['=0.7.x', '0.8.2'],
['>=0.7.x', '0.6.2'],
['<0.7.x', '0.7.2'],
['<1.2.3', '1.2.3-beta'],
['=1.2.3', '1.2.3-beta'],
['>1.2', '1.2.8'],
['^1.2.3', '2.0.0-alpha'],
['^1.2.3', '1.2.2'],
['^1.2', '1.1.9'],
['*', 'v1.2.3-foo', true],
// invalid ranges never satisfied!
['blerg', '1.2.3'],
['git+https://user:password0123@github.com/foo', '123.0.0', true],
['^1.2.3', '2.0.0-pre']
].forEach(function(v) {
var range = v[0];
var ver = v[1];
var loose = v[2];
var found = satisfies(ver, range, loose);
t.ok(!found, ver + ' not satisfied by ' + range);
});
t.end();
});
test('\nincrement versions test', function(t) {
// [version, inc, result, identifier]
// inc(version, inc) -> result
[['1.2.3', 'major', '2.0.0'],
['1.2.3', 'minor', '1.3.0'],
['1.2.3', 'patch', '1.2.4'],
['1.2.3tag', 'major', '2.0.0', true],
['1.2.3-tag', 'major', '2.0.0'],
['1.2.3', 'fake', null],
['1.2.0-0', 'patch', '1.2.0'],
['fake', 'major', null],
['1.2.3-4', 'major', '2.0.0'],
['1.2.3-4', 'minor', '1.3.0'],
['1.2.3-4', 'patch', '1.2.3'],
['1.2.3-alpha.0.beta', 'major', '2.0.0'],
['1.2.3-alpha.0.beta', 'minor', '1.3.0'],
['1.2.3-alpha.0.beta', 'patch', '1.2.3'],
['1.2.4', 'prerelease', '1.2.5-0'],
['1.2.3-0', 'prerelease', '1.2.3-1'],
['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'],
['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'],
['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'],
['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'],
['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'],
['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'],
['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'],
['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'],
['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'],
['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'],
['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'],
['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'],
['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'],
['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'],
['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'],
['1.2.0', 'prepatch', '1.2.1-0'],
['1.2.0-1', 'prepatch', '1.2.1-0'],
['1.2.0', 'preminor', '1.3.0-0'],
['1.2.3-1', 'preminor', '1.3.0-0'],
['1.2.0', 'premajor', '2.0.0-0'],
['1.2.3-1', 'premajor', '2.0.0-0'],
['1.2.0-1', 'minor', '1.2.0'],
['1.0.0-1', 'major', '1.0.0'],
['1.2.3', 'major', '2.0.0', false, 'dev'],
['1.2.3', 'minor', '1.3.0', false, 'dev'],
['1.2.3', 'patch', '1.2.4', false, 'dev'],
['1.2.3tag', 'major', '2.0.0', true, 'dev'],
['1.2.3-tag', 'major', '2.0.0', false, 'dev'],
['1.2.3', 'fake', null, false, 'dev'],
['1.2.0-0', 'patch', '1.2.0', false, 'dev'],
['fake', 'major', null, false, 'dev'],
['1.2.3-4', 'major', '2.0.0', false, 'dev'],
['1.2.3-4', 'minor', '1.3.0', false, 'dev'],
['1.2.3-4', 'patch', '1.2.3', false, 'dev'],
['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'],
['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'],
['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'],
['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'],
['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'],
['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'],
['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'],
['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'],
['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'],
['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'],
['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'],
['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'],
['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'],
['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'],
['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'],
['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'],
['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'],
['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'],
['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'],
['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'],
['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'],
['1.2.0', 'prepatch', '1.2.1-dev.0', 'dev'],
['1.2.0-1', 'prepatch', '1.2.1-dev.0', 'dev'],
['1.2.0', 'preminor', '1.3.0-dev.0', 'dev'],
['1.2.3-1', 'preminor', '1.3.0-dev.0', 'dev'],
['1.2.0', 'premajor', '2.0.0-dev.0', 'dev'],
['1.2.3-1', 'premajor', '2.0.0-dev.0', 'dev'],
['1.2.0-1', 'minor', '1.2.0', 'dev'],
['1.0.0-1', 'major', '1.0.0', 'dev'],
['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev']
].forEach(function(v) {
var pre = v[0];
var what = v[1];
var wanted = v[2];
var loose = v[3];
var id = v[4];
var found = inc(pre, what, loose, id);
var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')';
t.equal(found, wanted, cmd + ' === ' + wanted);
});
t.end();
});
test('\ndiff versions test', function(t) {
// [version1, version2, result]
// diff(version1, version2) -> result
[['1.2.3', '0.2.3', 'major'],
['1.4.5', '0.2.3', 'major'],
['1.2.3', '2.0.0-pre', 'premajor'],
['1.2.3', '1.3.3', 'minor'],
['1.0.1', '1.1.0-pre', 'preminor'],
['1.2.3', '1.2.4', 'patch'],
['1.2.3', '1.2.4-pre', 'prepatch'],
['0.0.1', '0.0.1-pre', 'prerelease'],
['0.0.1', '0.0.1-pre-2', 'prerelease'],
['1.1.0', '1.1.0-pre', 'prerelease'],
['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'],
['1.0.0', '1.0.0', null]
].forEach(function(v) {
var version1 = v[0];
var version2 = v[1];
var wanted = v[2];
var found = diff(version1, version2);
var cmd = 'diff(' + version1 + ', ' + version2 + ')';
t.equal(found, wanted, cmd + ' === ' + wanted);
});
t.end();
});
test('\nvalid range test', function(t) {
// [range, result]
// validRange(range) -> result
// translate ranges into their canonical form
[['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'],
['1.0.0', '1.0.0'],
['>=*', '*'],
['', '*'],
['*', '*'],
['*', '*'],
['>=1.0.0', '>=1.0.0'],
['>1.0.0', '>1.0.0'],
['<=2.0.0', '<=2.0.0'],
['1', '>=1.0.0 <2.0.0'],
['<=2.0.0', '<=2.0.0'],
['<=2.0.0', '<=2.0.0'],
['<2.0.0', '<2.0.0'],
['<2.0.0', '<2.0.0'],
['>= 1.0.0', '>=1.0.0'],
['>= 1.0.0', '>=1.0.0'],
['>= 1.0.0', '>=1.0.0'],
['> 1.0.0', '>1.0.0'],
['> 1.0.0', '>1.0.0'],
['<= 2.0.0', '<=2.0.0'],
['<= 2.0.0', '<=2.0.0'],
['<= 2.0.0', '<=2.0.0'],
['< 2.0.0', '<2.0.0'],
['< 2.0.0', '<2.0.0'],
['>=0.1.97', '>=0.1.97'],
['>=0.1.97', '>=0.1.97'],
['0.1.20 || 1.2.4', '0.1.20||1.2.4'],
['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'],
['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'],
['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'],
['||', '||'],
['2.x.x', '>=2.0.0 <3.0.0'],
['1.2.x', '>=1.2.0 <1.3.0'],
['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'],
['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'],
['x', '*'],
['2.*.*', '>=2.0.0 <3.0.0'],
['1.2.*', '>=1.2.0 <1.3.0'],
['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'],
['*', '*'],
['2', '>=2.0.0 <3.0.0'],
['2.3', '>=2.3.0 <2.4.0'],
['~2.4', '>=2.4.0 <2.5.0'],
['~2.4', '>=2.4.0 <2.5.0'],
['~>3.2.1', '>=3.2.1 <3.3.0'],
['~1', '>=1.0.0 <2.0.0'],
['~>1', '>=1.0.0 <2.0.0'],
['~> 1', '>=1.0.0 <2.0.0'],
['~1.0', '>=1.0.0 <1.1.0'],
['~ 1.0', '>=1.0.0 <1.1.0'],
['^0', '>=0.0.0 <1.0.0'],
['^ 1', '>=1.0.0 <2.0.0'],
['^0.1', '>=0.1.0 <0.2.0'],
['^1.0', '>=1.0.0 <2.0.0'],
['^1.2', '>=1.2.0 <2.0.0'],
['^0.0.1', '>=0.0.1 <0.0.2'],
['^0.0.1-beta', '>=0.0.1-beta <0.0.2'],
['^0.1.2', '>=0.1.2 <0.2.0'],
['^1.2.3', '>=1.2.3 <2.0.0'],
['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'],
['<1', '<1.0.0'],
['< 1', '<1.0.0'],
['>=1', '>=1.0.0'],
['>= 1', '>=1.0.0'],
['<1.2', '<1.2.0'],
['< 1.2', '<1.2.0'],
['1', '>=1.0.0 <2.0.0'],
['>01.02.03', '>1.2.3', true],
['>01.02.03', null],
['~1.2.3beta', '>=1.2.3-beta <1.3.0', true],
['~1.2.3beta', null],
['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0']
].forEach(function(v) {
var pre = v[0];
var wanted = v[1];
var loose = v[2];
var found = validRange(pre, loose);
t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted);
});
t.end();
});
test('\ncomparators test', function(t) {
// [range, comparators]
// turn range into a set of individual comparators
[['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]],
['1.0.0', [['1.0.0']]],
['>=*', [['']]],
['', [['']]],
['*', [['']]],
['*', [['']]],
['>=1.0.0', [['>=1.0.0']]],
['>=1.0.0', [['>=1.0.0']]],
['>=1.0.0', [['>=1.0.0']]],
['>1.0.0', [['>1.0.0']]],
['>1.0.0', [['>1.0.0']]],
['<=2.0.0', [['<=2.0.0']]],
['1', [['>=1.0.0', '<2.0.0']]],
['<=2.0.0', [['<=2.0.0']]],
['<=2.0.0', [['<=2.0.0']]],
['<2.0.0', [['<2.0.0']]],
['<2.0.0', [['<2.0.0']]],
['>= 1.0.0', [['>=1.0.0']]],
['>= 1.0.0', [['>=1.0.0']]],
['>= 1.0.0', [['>=1.0.0']]],
['> 1.0.0', [['>1.0.0']]],
['> 1.0.0', [['>1.0.0']]],
['<= 2.0.0', [['<=2.0.0']]],
['<= 2.0.0', [['<=2.0.0']]],
['<= 2.0.0', [['<=2.0.0']]],
['< 2.0.0', [['<2.0.0']]],
['<\t2.0.0', [['<2.0.0']]],
['>=0.1.97', [['>=0.1.97']]],
['>=0.1.97', [['>=0.1.97']]],
['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]],
['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]],
['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]],
['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]],
['||', [[''], ['']]],
['2.x.x', [['>=2.0.0', '<3.0.0']]],
['1.2.x', [['>=1.2.0', '<1.3.0']]],
['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]],
['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]],
['x', [['']]],
['2.*.*', [['>=2.0.0', '<3.0.0']]],
['1.2.*', [['>=1.2.0', '<1.3.0']]],
['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]],
['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]],
['*', [['']]],
['2', [['>=2.0.0', '<3.0.0']]],
['2.3', [['>=2.3.0', '<2.4.0']]],
['~2.4', [['>=2.4.0', '<2.5.0']]],
['~2.4', [['>=2.4.0', '<2.5.0']]],
['~>3.2.1', [['>=3.2.1', '<3.3.0']]],
['~1', [['>=1.0.0', '<2.0.0']]],
['~>1', [['>=1.0.0', '<2.0.0']]],
['~> 1', [['>=1.0.0', '<2.0.0']]],
['~1.0', [['>=1.0.0', '<1.1.0']]],
['~ 1.0', [['>=1.0.0', '<1.1.0']]],
['~ 1.0.3', [['>=1.0.3', '<1.1.0']]],
['~> 1.0.3', [['>=1.0.3', '<1.1.0']]],
['<1', [['<1.0.0']]],
['< 1', [['<1.0.0']]],
['>=1', [['>=1.0.0']]],
['>= 1', [['>=1.0.0']]],
['<1.2', [['<1.2.0']]],
['< 1.2', [['<1.2.0']]],
['1', [['>=1.0.0', '<2.0.0']]],
['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]],
['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]],
['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]],
['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]],
['>*', [['<0.0.0']]],
['<*', [['<0.0.0']]]
].forEach(function(v) {
var pre = v[0];
var wanted = v[1];
var found = toComparators(v[0]);
var jw = JSON.stringify(wanted);
t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw);
});
t.end();
});
test('\ninvalid version numbers', function(t) {
['1.2.3.4',
'NOT VALID',
1.2,
null,
'Infinity.NaN.Infinity'
].forEach(function(v) {
t.throws(function() {
new SemVer(v);
}, {name:'TypeError', message:'Invalid Version: ' + v});
});
t.end();
});
test('\nstrict vs loose version numbers', function(t) {
[['=1.2.3', '1.2.3'],
['01.02.03', '1.2.3'],
['1.2.3-beta.01', '1.2.3-beta.1'],
[' =1.2.3', '1.2.3'],
['1.2.3foo', '1.2.3-foo']
].forEach(function(v) {
var loose = v[0];
var strict = v[1];
t.throws(function() {
new SemVer(loose);
});
var lv = new SemVer(loose, true);
t.equal(lv.version, strict);
t.ok(eq(loose, strict, true));
t.throws(function() {
eq(loose, strict);
});
t.throws(function() {
new SemVer(strict).compare(loose);
});
});
t.end();
});
test('\nstrict vs loose ranges', function(t) {
[['>=01.02.03', '>=1.2.3'],
['~1.02.03beta', '>=1.2.3-beta <1.3.0']
].forEach(function(v) {
var loose = v[0];
var comps = v[1];
t.throws(function() {
new Range(loose);
});
t.equal(new Range(loose, true).range, comps);
});
t.end();
});
test('\nmax satisfying', function(t) {
[[['1.2.3', '1.2.4'], '1.2', '1.2.4'],
[['1.2.4', '1.2.3'], '1.2', '1.2.4'],
[['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'],
[['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true]
].forEach(function(v) {
var versions = v[0];
var range = v[1];
var expect = v[2];
var loose = v[3];
var actual = semver.maxSatisfying(versions, range, loose);
t.equal(actual, expect);
});
t.end();
});

181
deps/npm/node_modules/node-gyp/node_modules/semver/test/ltr.js сгенерированный поставляемый
Просмотреть файл

@ -1,181 +0,0 @@
var tap = require('tap');
var test = tap.test;
var semver = require('../semver.js');
var ltr = semver.ltr;
test('\nltr tests', function(t) {
// [range, version, loose]
// Version should be less than range
[
['~1.2.2', '1.2.1'],
['~0.6.1-1', '0.6.1-0'],
['1.0.0 - 2.0.0', '0.0.1'],
['1.0.0-beta.2', '1.0.0-beta.1'],
['1.0.0', '0.0.0'],
['>=2.0.0', '1.1.1'],
['>=2.0.0', '1.2.9'],
['>2.0.0', '2.0.0'],
['0.1.20 || 1.2.4', '0.1.5'],
['2.x.x', '1.0.0'],
['1.2.x', '1.1.0'],
['1.2.x || 2.x', '1.0.0'],
['2.*.*', '1.0.1'],
['1.2.*', '1.1.3'],
['1.2.* || 2.*', '1.1.9999'],
['2', '1.0.0'],
['2.3', '2.2.2'],
['~2.4', '2.3.0'], // >=2.4.0 <2.5.0
['~2.4', '2.3.5'],
['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0
['~1', '0.2.3'], // >=1.0.0 <2.0.0
['~>1', '0.2.4'],
['~> 1', '0.2.3'],
['~1.0', '0.1.2'], // >=1.0.0 <1.1.0
['~ 1.0', '0.1.0'],
['>1.2', '1.2.0'],
['> 1.2', '1.2.1'],
['1', '0.0.0beta', true],
['~v0.5.4-pre', '0.5.4-alpha'],
['~v0.5.4-pre', '0.5.4-alpha'],
['=0.7.x', '0.6.0'],
['=0.7.x', '0.6.0-asdf'],
['>=0.7.x', '0.6.0'],
['~1.2.2', '1.2.1'],
['1.0.0 - 2.0.0', '0.2.3'],
['1.0.0', '0.0.1'],
['>=2.0.0', '1.0.0'],
['>=2.0.0', '1.9999.9999'],
['>=2.0.0', '1.2.9'],
['>2.0.0', '2.0.0'],
['>2.0.0', '1.2.9'],
['2.x.x', '1.1.3'],
['1.2.x', '1.1.3'],
['1.2.x || 2.x', '1.1.3'],
['2.*.*', '1.1.3'],
['1.2.*', '1.1.3'],
['1.2.* || 2.*', '1.1.3'],
['2', '1.9999.9999'],
['2.3', '2.2.1'],
['~2.4', '2.3.0'], // >=2.4.0 <2.5.0
['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0
['~1', '0.2.3'], // >=1.0.0 <2.0.0
['~>1', '0.2.3'],
['~1.0', '0.0.0'], // >=1.0.0 <1.1.0
['>1', '1.0.0'],
['2', '1.0.0beta', true],
['>1', '1.0.0beta', true],
['> 1', '1.0.0beta', true],
['=0.7.x', '0.6.2'],
['=0.7.x', '0.7.0-asdf'],
['^1', '1.0.0-0'],
['>=0.7.x', '0.7.0-asdf'],
['1', '1.0.0beta', true],
['>=0.7.x', '0.6.2'],
['>1.2.3', '1.3.0-alpha']
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1];
var loose = tuple[2] || false;
var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')';
t.ok(ltr(version, range, loose), msg);
});
t.end();
});
test('\nnegative ltr tests', function(t) {
// [range, version, loose]
// Version should NOT be less than range
[
['~ 1.0', '1.1.0'],
['~0.6.1-1', '0.6.1-1'],
['1.0.0 - 2.0.0', '1.2.3'],
['1.0.0 - 2.0.0', '2.9.9'],
['1.0.0', '1.0.0'],
['>=*', '0.2.4'],
['', '1.0.0', true],
['*', '1.2.3'],
['>=1.0.0', '1.0.0'],
['>=1.0.0', '1.0.1'],
['>=1.0.0', '1.1.0'],
['>1.0.0', '1.0.1'],
['>1.0.0', '1.1.0'],
['<=2.0.0', '2.0.0'],
['<=2.0.0', '1.9999.9999'],
['<=2.0.0', '0.2.9'],
['<2.0.0', '1.9999.9999'],
['<2.0.0', '0.2.9'],
['>= 1.0.0', '1.0.0'],
['>= 1.0.0', '1.0.1'],
['>= 1.0.0', '1.1.0'],
['> 1.0.0', '1.0.1'],
['> 1.0.0', '1.1.0'],
['<= 2.0.0', '2.0.0'],
['<= 2.0.0', '1.9999.9999'],
['<= 2.0.0', '0.2.9'],
['< 2.0.0', '1.9999.9999'],
['<\t2.0.0', '0.2.9'],
['>=0.1.97', 'v0.1.97'],
['>=0.1.97', '0.1.97'],
['0.1.20 || 1.2.4', '1.2.4'],
['0.1.20 || >1.2.4', '1.2.4'],
['0.1.20 || 1.2.4', '1.2.3'],
['0.1.20 || 1.2.4', '0.1.20'],
['>=0.2.3 || <0.0.1', '0.0.0'],
['>=0.2.3 || <0.0.1', '0.2.3'],
['>=0.2.3 || <0.0.1', '0.2.4'],
['||', '1.3.4'],
['2.x.x', '2.1.3'],
['1.2.x', '1.2.3'],
['1.2.x || 2.x', '2.1.3'],
['1.2.x || 2.x', '1.2.3'],
['x', '1.2.3'],
['2.*.*', '2.1.3'],
['1.2.*', '1.2.3'],
['1.2.* || 2.*', '2.1.3'],
['1.2.* || 2.*', '1.2.3'],
['1.2.* || 2.*', '1.2.3'],
['*', '1.2.3'],
['2', '2.1.2'],
['2.3', '2.3.1'],
['~2.4', '2.4.0'], // >=2.4.0 <2.5.0
['~2.4', '2.4.5'],
['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0
['~1', '1.2.3'], // >=1.0.0 <2.0.0
['~>1', '1.2.3'],
['~> 1', '1.2.3'],
['~1.0', '1.0.2'], // >=1.0.0 <1.1.0
['~ 1.0', '1.0.2'],
['>=1', '1.0.0'],
['>= 1', '1.0.0'],
['<1.2', '1.1.1'],
['< 1.2', '1.1.1'],
['~v0.5.4-pre', '0.5.5'],
['~v0.5.4-pre', '0.5.4'],
['=0.7.x', '0.7.2'],
['>=0.7.x', '0.7.2'],
['<=0.7.x', '0.6.2'],
['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'],
['>=0.2.3 <=0.2.4', '0.2.4'],
['1.0.0 - 2.0.0', '2.0.0'],
['^3.0.0', '4.0.0'],
['^1.0.0 || ~2.0.1', '2.0.0'],
['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'],
['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true],
['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true],
['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'],
['^1.0.0alpha', '1.0.0beta', true],
['~1.0.0alpha', '1.0.0beta', true],
['^1.0.0-alpha', '1.0.0beta', true],
['~1.0.0-alpha', '1.0.0beta', true],
['^1.0.0-alpha', '1.0.0-beta'],
['~1.0.0-alpha', '1.0.0-beta'],
['=0.1.0', '1.0.0']
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1];
var loose = tuple[2] || false;
var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')';
t.notOk(ltr(version, range, loose), msg);
});
t.end();
});

72
deps/npm/node_modules/node-gyp/node_modules/semver/test/major-minor-patch.js сгенерированный поставляемый
Просмотреть файл

@ -1,72 +0,0 @@
var tap = require('tap');
var test = tap.test;
var semver = require('../semver.js');
test('\nmajor tests', function(t) {
// [range, version]
// Version should be detectable despite extra characters
[
['1.2.3', 1],
[' 1.2.3 ', 1],
[' 2.2.3-4 ', 2],
[' 3.2.3-pre ', 3],
['v5.2.3', 5],
[' v8.2.3 ', 8],
['\t13.2.3', 13],
['=21.2.3', 21, true],
['v=34.2.3', 34, true]
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1];
var loose = tuple[2] || false;
var msg = 'major(' + range + ') = ' + version;
t.equal(semver.major(range, loose), version, msg);
});
t.end();
});
test('\nminor tests', function(t) {
// [range, version]
// Version should be detectable despite extra characters
[
['1.1.3', 1],
[' 1.1.3 ', 1],
[' 1.2.3-4 ', 2],
[' 1.3.3-pre ', 3],
['v1.5.3', 5],
[' v1.8.3 ', 8],
['\t1.13.3', 13],
['=1.21.3', 21, true],
['v=1.34.3', 34, true]
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1];
var loose = tuple[2] || false;
var msg = 'minor(' + range + ') = ' + version;
t.equal(semver.minor(range, loose), version, msg);
});
t.end();
});
test('\npatch tests', function(t) {
// [range, version]
// Version should be detectable despite extra characters
[
['1.2.1', 1],
[' 1.2.1 ', 1],
[' 1.2.2-4 ', 2],
[' 1.2.3-pre ', 3],
['v1.2.5', 5],
[' v1.2.8 ', 8],
['\t1.2.13', 13],
['=1.2.21', 21, true],
['v=1.2.34', 34, true]
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1];
var loose = tuple[2] || false;
var msg = 'patch(' + range + ') = ' + version;
t.equal(semver.patch(range, loose), version, msg);
});
t.end();
});

18
deps/npm/node_modules/node-gyp/node_modules/semver/test/no-module.js сгенерированный поставляемый
Просмотреть файл

@ -1,18 +0,0 @@
var tap = require('tap');
var test = tap.test;
test('no module system', function(t) {
var fs = require('fs');
var vm = require('vm');
var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8');
var src = fs.readFileSync(require.resolve('../'), 'utf8');
var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8');
vm.runInThisContext(head + src + foot, 'semver.js');
// just some basic poking to see if it did some stuff
t.type(global.semver, 'object');
t.type(global.semver.SemVer, 'function');
t.type(global.semver.Range, 'function');
t.ok(global.semver.satisfies('1.2.3', '1.2'));
t.end();
});

3
deps/npm/node_modules/node-gyp/node_modules/tar/package.json сгенерированный поставляемый
Просмотреть файл

@ -56,5 +56,6 @@
"tarball": "http://registry.npmjs.org/tar/-/tar-1.0.3.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.3.tgz"
"_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.3.tgz",
"readme": "ERROR: No README data found!"
}

55
deps/npm/node_modules/node-gyp/package.json сгенерированный поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

143
deps/npm/node_modules/node-gyp/test/docker.sh сгенерированный поставляемый Executable file
Просмотреть файл

@ -0,0 +1,143 @@
#!/bin/bash
#set -e
test_node_versions="0.8.28 0.10.40 0.12.7"
test_iojs_versions="1.8.4 2.4.0 3.3.0"
__dirname="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
dot_node_gyp=${__dirname}/.node-gyp/
# borrows from https://github.com/rvagg/dnt/
# Simple setup function for a container:
# setup_container(image id, base image, commands to run to set up)
setup_container() {
local container_id="$1"
local base_container="$2"
local run_cmd="$3"
# Does this image exist? If yes, ignore
docker inspect "$container_id" &> /dev/null
if [[ $? -eq 0 ]]; then
echo "Found existing container [$container_id]"
else
# No such image, so make it
echo "Did not find container [$container_id], creating..."
docker run -i $base_container /bin/bash -c "$run_cmd"
sleep 2
docker commit $(docker ps -l -q) $container_id
fi
}
# Run tests inside each of the versioned containers, copy cwd into npm's copy of node-gyp
# so it'll be invoked by npm when a compile is needed
# run_tests(version, test-commands)
run_tests() {
local version="$1"
local run_cmd="$2"
run_cmd="rsync -aAXx --delete --exclude .git --exclude build /node-gyp-src/ /usr/lib/node_modules/npm/node_modules/node-gyp/;
/bin/su -s /bin/bash node-gyp -c 'cd && ${run_cmd}'"
rm -rf $dot_node_gyp
docker run \
--rm -i \
-v ~/.npm/:/node-gyp/.npm/ \
-v ${dot_node_gyp}:/node-gyp/.node-gyp/ \
-v $(pwd):/node-gyp-src/:ro \
node-gyp-test/${version} /bin/bash -c "${run_cmd}"
}
# A base image with build tools and a user account
setup_container "node-gyp-test/base" "ubuntu:14.04" "
apt-get update &&
apt-get install -y build-essential python git rsync curl &&
adduser --gecos node-gyp --home /node-gyp/ --disabled-login node-gyp &&
echo "node-gyp:node-gyp" | chpasswd
"
# An image on top of the base containing clones of repos we want to use for testing
setup_container "node-gyp-test/clones" "node-gyp-test/base" "
cd /node-gyp/ && git clone https://github.com/justmoon/node-bignum.git &&
cd /node-gyp/ && git clone https://github.com/bnoordhuis/node-buffertools.git &&
chown -R node-gyp.node-gyp /node-gyp/
"
# An image for each of the node versions we want to test with that version installed and the latest npm
for v in $test_node_versions; do
setup_container "node-gyp-test/${v}" "node-gyp-test/clones" "
curl -sL https://nodejs.org/dist/v${v}/node-v${v}-linux-x64.tar.gz | tar -zxv --strip-components=1 -C /usr/ &&
npm install npm@latest -g &&
node -v && npm -v
"
done
# An image for each of the io.js versions we want to test with that version installed and the latest npm
for v in $test_iojs_versions; do
setup_container "node-gyp-test/${v}" "node-gyp-test/clones" "
curl -sL https://iojs.org/dist/v${v}/iojs-v${v}-linux-x64.tar.gz | tar -zxv --strip-components=1 -C /usr/ &&
npm install npm@latest -g &&
node -v && npm -v
"
done
# Run the tests for all of the test images we've created,
# we should see node-gyp doing its download, configure and run thing
# _NOTE: bignum doesn't compile on 0.8 currently so it'll fail for that version only_
for v in $test_node_versions $test_iojs_versions; do
run_tests $v "
cd node-buffertools && npm install --loglevel=info && npm test && cd
"
# removed for now, too noisy: cd node-bignum && npm install --loglevel=info && npm test
done
# Test use of --target=x.y.z to compile against alternate versions
test_download_node_version() {
local run_with_ver="$1"
local expected_dir="$2"
local expected_ver="$3"
run_tests $run_with_ver "cd node-buffertools && npm install --loglevel=info --target=${expected_ver}"
local node_ver=$(cat "${dot_node_gyp}${expected_dir}/node_version.h" | grep '#define NODE_\w*_VERSION [0-9]*$')
node_ver=$(echo $node_ver | sed 's/#define NODE_[A-Z]*_VERSION //g' | sed 's/ /./g')
if [ "X$(echo $node_ver)" != "X${expected_ver}" ]; then
echo "Did not download v${expected_ver} using --target, instead got: $(echo $node_ver)"
exit 1
fi
echo "Verified correct download of [v${node_ver}]"
}
test_download_node_version "0.12.7" "0.10.30/src" "0.10.30"
test_download_node_version "3.3.0" "iojs-1.8.4/src" "1.8.4"
# should download the headers file
test_download_node_version "3.3.0" "iojs-3.2.0/include/node" "3.2.0"
# TODO: test --dist-url by starting up a localhost server and serving up tarballs
# testing --dist-url, using simple-proxy.js to make localhost work as a distribution
# point for tarballs
# we can test whether it uses the proxy because after 2 connections the proxy will
# die and therefore should not be running at the end of the test, `nc` can tell us this
run_tests "3.3.0" "
(node /node-gyp-src/test/simple-proxy.js 8080 /foobar/ https://iojs.org/dist/ &) &&
cd node-buffertools &&
/node-gyp-src/bin/node-gyp.js --loglevel=info --dist-url=http://localhost:8080/foobar/ rebuild &&
nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\"
"
run_tests "3.3.0" "
(node /node-gyp-src/test/simple-proxy.js 8080 /doobar/ https://iojs.org/dist/ &) &&
cd node-buffertools &&
NVM_IOJS_ORG_MIRROR=http://localhost:8080/doobar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild &&
nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\"
"
run_tests "0.12.7" "
(node /node-gyp-src/test/simple-proxy.js 8080 /boombar/ https://nodejs.org/dist/ &) &&
cd node-buffertools &&
NVM_NODEJS_ORG_MIRROR=http://localhost:8080/boombar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild &&
nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\"
"
rm -rf $dot_node_gyp

24
deps/npm/node_modules/node-gyp/test/simple-proxy.js сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,24 @@
var http = require('http')
, https = require('https')
, server = http.createServer(handler)
, port = +process.argv[2]
, prefix = process.argv[3]
, upstream = process.argv[4]
, calls = 0
server.listen(port)
function handler (req, res) {
if (req.url.indexOf(prefix) != 0)
throw new Error('request url [' + req.url + '] does not start with [' + prefix + ']')
var upstreamUrl = upstream + req.url.substring(prefix.length)
console.log(req.url + ' -> ' + upstreamUrl)
https.get(upstreamUrl, function (ures) {
ures.on('end', function () {
if (++calls == 2)
server.close()
})
ures.pipe(res)
})
}

370
deps/npm/node_modules/node-gyp/test/test-process-release.js сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,370 @@
var test = require('tape')
var processRelease = require('../lib/process-release')
test('test process release - process.version = 0.8.20', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v0.8.20', null)
t.equal(release.semver.version, '0.8.20')
delete release.semver
t.deepEqual(release, {
version: '0.8.20',
name: 'node',
baseUrl: 'https://nodejs.org/dist/v0.8.20/',
tarballUrl: 'https://nodejs.org/dist/v0.8.20/node-v0.8.20.tar.gz',
shasumsUrl: 'https://nodejs.org/dist/v0.8.20/SHASUMS256.txt',
versionDir: '0.8.20',
libUrl32: 'https://nodejs.org/dist/v0.8.20/node.lib',
libUrl64: 'https://nodejs.org/dist/v0.8.20/x64/node.lib',
libPath32: 'node.lib',
libPath64: 'x64/node.lib'
})
})
test('test process release - process.version = 0.10.21', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v0.10.21', null)
t.equal(release.semver.version, '0.10.21')
delete release.semver
t.deepEqual(release, {
version: '0.10.21',
name: 'node',
baseUrl: 'https://nodejs.org/dist/v0.10.21/',
tarballUrl: 'https://nodejs.org/dist/v0.10.21/node-v0.10.21.tar.gz',
shasumsUrl: 'https://nodejs.org/dist/v0.10.21/SHASUMS256.txt',
versionDir: '0.10.21',
libUrl32: 'https://nodejs.org/dist/v0.10.21/node.lib',
libUrl64: 'https://nodejs.org/dist/v0.10.21/x64/node.lib',
libPath32: 'node.lib',
libPath64: 'x64/node.lib'
})
})
test('test process release - process.version = 0.12.22', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v0.12.22', null)
t.equal(release.semver.version, '0.12.22')
delete release.semver
t.deepEqual(release, {
version: '0.12.22',
name: 'node',
baseUrl: 'https://nodejs.org/dist/v0.12.22/',
tarballUrl: 'https://nodejs.org/dist/v0.12.22/node-v0.12.22.tar.gz',
shasumsUrl: 'https://nodejs.org/dist/v0.12.22/SHASUMS256.txt',
versionDir: '0.12.22',
libUrl32: 'https://nodejs.org/dist/v0.12.22/node.lib',
libUrl64: 'https://nodejs.org/dist/v0.12.22/x64/node.lib',
libPath32: 'node.lib',
libPath64: 'x64/node.lib'
})
})
test('test process release - process.release ~ node@4.1.23', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v4.1.23', {
name: 'node',
headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz'
})
t.equal(release.semver.version, '4.1.23')
delete release.semver
t.deepEqual(release, {
version: '4.1.23',
name: 'node',
baseUrl: 'https://nodejs.org/dist/v4.1.23/',
tarballUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz',
shasumsUrl: 'https://nodejs.org/dist/v4.1.23/SHASUMS256.txt',
versionDir: '4.1.23',
libUrl32: 'https://nodejs.org/dist/v4.1.23/win-x86/node.lib',
libUrl64: 'https://nodejs.org/dist/v4.1.23/win-x64/node.lib',
libPath32: 'win-x86/node.lib',
libPath64: 'win-x64/node.lib'
})
})
test('test process release - process.release ~ node@4.1.23 / corp build', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v4.1.23', {
name: 'node',
headersUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz'
})
t.equal(release.semver.version, '4.1.23')
delete release.semver
t.deepEqual(release, {
version: '4.1.23',
name: 'node',
baseUrl: 'https://some.custom.location/',
tarballUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz',
shasumsUrl: 'https://some.custom.location/SHASUMS256.txt',
versionDir: '4.1.23',
libUrl32: 'https://some.custom.location/win-x86/node.lib',
libUrl64: 'https://some.custom.location/win-x64/node.lib',
libPath32: 'win-x86/node.lib',
libPath64: 'win-x64/node.lib'
})
})
test('test process release - process.version = 1.8.4', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v1.8.4', null)
t.equal(release.semver.version, '1.8.4')
delete release.semver
t.deepEqual(release, {
version: '1.8.4',
name: 'iojs',
baseUrl: 'https://iojs.org/download/release/v1.8.4/',
tarballUrl: 'https://iojs.org/download/release/v1.8.4/iojs-v1.8.4.tar.gz',
shasumsUrl: 'https://iojs.org/download/release/v1.8.4/SHASUMS256.txt',
versionDir: 'iojs-1.8.4',
libUrl32: 'https://iojs.org/download/release/v1.8.4/win-x86/iojs.lib',
libUrl64: 'https://iojs.org/download/release/v1.8.4/win-x64/iojs.lib',
libPath32: 'win-x86/iojs.lib',
libPath64: 'win-x64/iojs.lib'
})
})
test('test process release - process.release ~ iojs@3.2.24', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v3.2.24', {
name: 'io.js',
headersUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz'
})
t.equal(release.semver.version, '3.2.24')
delete release.semver
t.deepEqual(release, {
version: '3.2.24',
name: 'iojs',
baseUrl: 'https://iojs.org/download/release/v3.2.24/',
tarballUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz',
shasumsUrl: 'https://iojs.org/download/release/v3.2.24/SHASUMS256.txt',
versionDir: 'iojs-3.2.24',
libUrl32: 'https://iojs.org/download/release/v3.2.24/win-x86/iojs.lib',
libUrl64: 'https://iojs.org/download/release/v3.2.24/win-x64/iojs.lib',
libPath32: 'win-x86/iojs.lib',
libPath64: 'win-x64/iojs.lib'
})
})
test('test process release - process.release ~ iojs@3.2.11 +libUrl32', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v3.2.11', {
name: 'io.js',
headersUrl: 'https://iojs.org/download/release/v3.2.11/iojs-v3.2.11-headers.tar.gz',
libUrl: 'https://iojs.org/download/release/v3.2.11/win-x86/iojs.lib' // custom
})
t.equal(release.semver.version, '3.2.11')
delete release.semver
t.deepEqual(release, {
version: '3.2.11',
name: 'iojs',
baseUrl: 'https://iojs.org/download/release/v3.2.11/',
tarballUrl: 'https://iojs.org/download/release/v3.2.11/iojs-v3.2.11-headers.tar.gz',
shasumsUrl: 'https://iojs.org/download/release/v3.2.11/SHASUMS256.txt',
versionDir: 'iojs-3.2.11',
libUrl32: 'https://iojs.org/download/release/v3.2.11/win-x86/iojs.lib',
libUrl64: 'https://iojs.org/download/release/v3.2.11/win-x64/iojs.lib',
libPath32: 'win-x86/iojs.lib',
libPath64: 'win-x64/iojs.lib'
})
})
test('test process release - process.release ~ iojs@3.2.101 +libUrl64', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v3.2.101', {
name: 'io.js',
headersUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz',
libUrl: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib' // custom
})
t.equal(release.semver.version, '3.2.101')
delete release.semver
t.deepEqual(release, {
version: '3.2.101',
name: 'iojs',
baseUrl: 'https://iojs.org/download/release/v3.2.101/',
tarballUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz',
shasumsUrl: 'https://iojs.org/download/release/v3.2.101/SHASUMS256.txt',
versionDir: 'iojs-3.2.101',
libUrl32: 'https://iojs.org/download/release/v3.2.101/win-x86/iojs.lib',
libUrl64: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib',
libPath32: 'win-x86/iojs.lib',
libPath64: 'win-x64/iojs.lib'
})
})
test('test process release - process.release ~ iojs@3.3.0 - borked win-ia32', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v3.2.101', {
name: 'io.js',
headersUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz',
libUrl: 'https://iojs.org/download/release/v3.2.101/win-ia32/iojs.lib' // custom
})
t.equal(release.semver.version, '3.2.101')
delete release.semver
t.deepEqual(release, {
version: '3.2.101',
name: 'iojs',
baseUrl: 'https://iojs.org/download/release/v3.2.101/',
tarballUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz',
shasumsUrl: 'https://iojs.org/download/release/v3.2.101/SHASUMS256.txt',
versionDir: 'iojs-3.2.101',
libUrl32: 'https://iojs.org/download/release/v3.2.101/win-x86/iojs.lib',
libUrl64: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib',
libPath32: 'win-x86/iojs.lib',
libPath64: 'win-x64/iojs.lib'
})
})
test('test process release - process.release ~ node@4.1.23 --target=0.10.40', function (t) {
t.plan(2)
var release = processRelease([], { opts: { target: '0.10.40' } }, 'v4.1.23', {
name: 'node',
headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz'
})
t.equal(release.semver.version, '0.10.40')
delete release.semver
t.deepEqual(release, {
version: '0.10.40',
name: 'node',
baseUrl: 'https://nodejs.org/dist/v0.10.40/',
tarballUrl: 'https://nodejs.org/dist/v0.10.40/node-v0.10.40.tar.gz',
shasumsUrl: 'https://nodejs.org/dist/v0.10.40/SHASUMS256.txt',
versionDir: '0.10.40',
libUrl32: 'https://nodejs.org/dist/v0.10.40/node.lib',
libUrl64: 'https://nodejs.org/dist/v0.10.40/x64/node.lib',
libPath32: 'node.lib',
libPath64: 'x64/node.lib'
})
})
test('test process release - process.release ~ node@4.1.23 --target=1.8.4', function (t) {
t.plan(2)
var release = processRelease([], { opts: { target: '1.8.4' } }, 'v4.1.23', {
name: 'node',
headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz'
})
t.equal(release.semver.version, '1.8.4')
delete release.semver
t.deepEqual(release, {
version: '1.8.4',
name: 'iojs',
baseUrl: 'https://iojs.org/download/release/v1.8.4/',
tarballUrl: 'https://iojs.org/download/release/v1.8.4/iojs-v1.8.4.tar.gz',
shasumsUrl: 'https://iojs.org/download/release/v1.8.4/SHASUMS256.txt',
versionDir: 'iojs-1.8.4',
libUrl32: 'https://iojs.org/download/release/v1.8.4/win-x86/iojs.lib',
libUrl64: 'https://iojs.org/download/release/v1.8.4/win-x64/iojs.lib',
libPath32: 'win-x86/iojs.lib',
libPath64: 'win-x64/iojs.lib'
})
})
test('test process release - process.release ~ node@4.1.23 --dist-url=https://foo.bar/baz', function (t) {
t.plan(2)
var release = processRelease([], { opts: { 'dist-url': 'https://foo.bar/baz' } }, 'v4.1.23', {
name: 'node',
headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz'
})
t.equal(release.semver.version, '4.1.23')
delete release.semver
t.deepEqual(release, {
version: '4.1.23',
name: 'node',
baseUrl: 'https://foo.bar/baz/v4.1.23/',
tarballUrl: 'https://foo.bar/baz/v4.1.23/node-v4.1.23-headers.tar.gz',
shasumsUrl: 'https://foo.bar/baz/v4.1.23/SHASUMS256.txt',
versionDir: '4.1.23',
libUrl32: 'https://foo.bar/baz/v4.1.23/win-x86/node.lib',
libUrl64: 'https://foo.bar/baz/v4.1.23/win-x64/node.lib',
libPath32: 'win-x86/node.lib',
libPath64: 'win-x64/node.lib'
})
})
test('test process release - process.release ~ frankenstein@4.1.23', function (t) {
t.plan(2)
var release = processRelease([], { opts: {} }, 'v4.1.23', {
name: 'frankenstein',
headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz'
})
t.equal(release.semver.version, '4.1.23')
delete release.semver
t.deepEqual(release, {
version: '4.1.23',
name: 'frankenstein',
baseUrl: 'https://frankensteinjs.org/dist/v4.1.23/',
tarballUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz',
shasumsUrl: 'https://frankensteinjs.org/dist/v4.1.23/SHASUMS256.txt',
versionDir: 'frankenstein-4.1.23',
libUrl32: 'https://frankensteinjs.org/dist/v4.1.23/win-x86/frankenstein.lib',
libUrl64: 'https://frankensteinjs.org/dist/v4.1.23/win-x64/frankenstein.lib',
libPath32: 'win-x86/frankenstein.lib',
libPath64: 'win-x64/frankenstein.lib'
})
})
test('test process release - process.release ~ frankenstein@4.1.23 --dist-url=http://foo.bar/baz/', function (t) {
t.plan(2)
var release = processRelease([], { opts: { 'dist-url': 'http://foo.bar/baz/' } }, 'v4.1.23', {
name: 'frankenstein',
headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23.tar.gz'
})
t.equal(release.semver.version, '4.1.23')
delete release.semver
t.deepEqual(release, {
version: '4.1.23',
name: 'frankenstein',
baseUrl: 'http://foo.bar/baz/v4.1.23/',
tarballUrl: 'http://foo.bar/baz/v4.1.23/frankenstein-v4.1.23-headers.tar.gz',
shasumsUrl: 'http://foo.bar/baz/v4.1.23/SHASUMS256.txt',
versionDir: 'frankenstein-4.1.23',
libUrl32: 'http://foo.bar/baz/v4.1.23/win-x86/frankenstein.lib',
libUrl64: 'http://foo.bar/baz/v4.1.23/win-x64/frankenstein.lib',
libPath32: 'win-x86/frankenstein.lib',
libPath64: 'win-x64/frankenstein.lib'
})
})

2
deps/npm/package.json поставляемый
Просмотреть файл

@ -62,7 +62,7 @@
"lru-cache": "~2.6.5",
"minimatch": "~2.0.10",
"mkdirp": "~0.5.1",
"node-gyp": "~2.0.2",
"node-gyp": "~3.0.0",
"nopt": "~3.0.3",
"normalize-git-url": "~3.0.1",
"normalize-package-data": "~2.3.2",