diff options
author | isaacs <i@izs.me> | 2013-06-21 01:03:22 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-06-21 01:03:22 +0400 |
commit | 486250a3c9e3e826de3a7a9db814266a20ab6572 (patch) | |
tree | 59be9d7cd9940612a6466666d25d17de514d4cc9 | |
parent | c992ffe60f58edae4c2cc96bc3797d5e40fbc408 (diff) | |
parent | b8db927278023c68ec1fa82895390d2491dfc554 (diff) |
Merge branch 'semver2'
91 files changed, 2852 insertions, 2544 deletions
diff --git a/lib/cache.js b/lib/cache.js index 9f8819e68..db8efd865 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -600,8 +600,8 @@ function addNamed (name, x, data, cb_) { lock(k, function (er, fd) { if (er) return cb(er) - var fn = ( null !== semver.valid(x) ? addNameVersion - : null !== semver.validRange(x) ? addNameRange + var fn = ( semver.valid(x, true) ? addNameVersion + : semver.validRange(x, true) ? addNameRange : addNameTag ) fn(name, x, data, cb) @@ -655,8 +655,8 @@ function engineFilter (data) { var eng = data.versions[v].engines if (!eng) return if (!strict && !data.versions[v].engineStrict) return - if (eng.node && !semver.satisfies(nodev, eng.node) - || eng.npm && !semver.satisfies(npmv, eng.npm)) { + if (eng.node && !semver.satisfies(nodev, eng.node, true) + || eng.npm && !semver.satisfies(npmv, eng.npm, true)) { delete data.versions[v] } }) @@ -665,7 +665,7 @@ function engineFilter (data) { function addNameRange (name, range, data, cb) { if (typeof cb !== "function") cb = data, data = null - range = semver.validRange(range) + range = semver.validRange(range, true) if (range === null) return cb(new Error( "Invalid version range: "+range)) @@ -688,12 +688,15 @@ function addNameRange (name, range, data, cb) { // if the tagged version satisfies, then use that. var tagged = data["dist-tags"][npm.config.get("tag")] - if (tagged && data.versions[tagged] && semver.satisfies(tagged, range)) { + if (tagged + && data.versions[tagged] + && semver.satisfies(tagged, range, true)) { return addNamed(name, tagged, data.versions[tagged], cb) } // find the max satisfying version. - var ms = semver.maxSatisfying(Object.keys(data.versions || {}), range) + var versions = Object.keys(data.versions || {}) + var ms = semver.maxSatisfying(versions, range, true) if (!ms) { return cb(installTargetsError(range, data)) } @@ -720,11 +723,11 @@ function installTargetsError (requested, data) { + requested + "\n" + targets) } -function addNameVersion (name, ver, data, cb) { +function addNameVersion (name, v, data, cb) { if (typeof cb !== "function") cb = data, data = null - ver = semver.valid(ver) - if (ver === null) return cb(new Error("Invalid version: "+ver)) + ver = semver.valid(v, true) + if (!ver) return cb(new Error("Invalid version: "+v)) var response @@ -1107,7 +1110,9 @@ function addLocalDirectory (p, name, shasum, cb) { // tar it to the proper place, and add the cache tar if (p.indexOf(npm.cache) === 0) return cb(new Error( "Adding a cache directory to the cache will make the world implode.")) - readJson(path.join(p, "package.json"), function (er, data) { + var strict = p.indexOf(npm.tmp) !== 0 + && p.indexOf(npm.cache) !== 0 + readJson(path.join(p, "package.json"), strict, function (er, data) { er = needName(er, data) er = needVersion(er, data) if (er) return cb(er) @@ -1119,12 +1124,10 @@ function addLocalDirectory (p, name, shasum, cb) { , data.version, "package.tgz" ) , placeDirect = path.basename(p) === "package" , tgz = placeDirect ? placed : tmptgz - , doFancyCrap = p.indexOf(npm.tmp) !== 0 - && p.indexOf(npm.cache) !== 0 getCacheStat(function (er, cs) { mkdir(path.dirname(tgz), function (er, made) { if (er) return cb(er) - tar.pack(tgz, p, data, doFancyCrap, function (er) { + tar.pack(tgz, p, data, strict, function (er) { if (er) { log.error( "addLocalDirectory", "Could not pack %j to %j" , p, tgz ) diff --git a/lib/dedupe.js b/lib/dedupe.js index bd0056e99..648397b7a 100644 --- a/lib/dedupe.js +++ b/lib/dedupe.js @@ -258,9 +258,9 @@ function findVersions (npm, summary, cb) { function bestMatch (versions, ranges) { return versions.filter(function (v) { return !ranges.some(function (r) { - return !semver.satisfies(v, r) + return !semver.satisfies(v, r, true) }) - }).sort(semver.compare).pop() + }).sort(semver.compareLoose).pop() } diff --git a/lib/deprecate.js b/lib/deprecate.js index 1ba4305cd..7d0b41ac7 100644 --- a/lib/deprecate.js +++ b/lib/deprecate.js @@ -37,7 +37,7 @@ function deprecate (args, cb) { if (er) return cb(er) // filter all the versions that match Object.keys(data.versions).filter(function (v) { - return semver.satisfies(v, ver) + return semver.satisfies(v, ver, true) }).forEach(function (v) { data.versions[v].deprecated = msg }) diff --git a/lib/install.js b/lib/install.js index 50ba5ebc5..dd40775fa 100644 --- a/lib/install.js +++ b/lib/install.js @@ -160,8 +160,11 @@ function install (args, cb_) { // initial "family" is the name:version of the root, if it's got // a package.json file. - readJson(path.resolve(where, "package.json"), function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + var jsonFile = path.resolve(where, "package.json") + readJson(jsonFile, true, function (er, data) { + if (er + && er.code !== "ENOENT" + && er.code !== "ENOTDIR") return cb(er) if (er) data = null var context = { family: {} , ancestors: {} @@ -178,7 +181,7 @@ function install (args, cb_) { } function findPeerInvalid (where, cb) { - readInstalled(where, function (er, data) { + readInstalled(where, log.warn, function (er, data) { if (er) return cb(er) cb(null, findPeerInvalid_(data.dependencies, [])) @@ -337,8 +340,8 @@ function save (where, installed, tree, pretty, cb) { if (u && u.protocol) w[1] = t.from return w }).reduce(function (set, k) { - var rangeDescriptor = semver.valid(k[1]) && - semver.gte(k[1], "0.1.0") + var rangeDescriptor = semver.valid(k[1], true) && + semver.gte(k[1], "0.1.0", true) ? "~" : "" set[k[0]] = rangeDescriptor + k[1] return set @@ -494,7 +497,7 @@ function installManyTop (what, where, context, cb_) { if (context.explicit) return next() - readJson(path.join(where, "package.json"), function (er, data) { + readJson(path.join(where, "package.json"), true, function (er, data) { if (er) return next(er) lifecycle(data, "preinstall", where, next) }) @@ -619,7 +622,7 @@ function targetResolver (where, context, deps) { // otherwise, make sure that it's a semver match with what we want. var bd = parent.bundleDependencies if (bd && bd.indexOf(d.name) !== -1 || - semver.satisfies(d.version, deps[d.name] || "*")) { + semver.satisfies(d.version, deps[d.name] || "*", true)) { return cb(null, d.name) } @@ -1066,7 +1069,10 @@ function prepareForInstallMany (packageData, depsKey, bundled, wrap, family) { // prefer to not install things that are satisfied by // something in the "family" list, unless we're installing // from a shrinkwrap. - return wrap || !semver.satisfies(family[d], packageData[depsKey][d]) + if (wrap) return wrap + if (semver.validRange(family[d], true)) + return !semver.satisfies(family[d], packageData[depsKey][d], true) + return true }).map(function (d) { var t = packageData[depsKey][d] , parsed = url.parse(t.replace(/^git\+/, "git")) @@ -33,7 +33,8 @@ function ls (args, silent, cb) { return [ name, ver ] }) - readInstalled(dir, npm.config.get("depth"), function (er, data) { + var depth = npm.config.get("depth") + readInstalled(dir, depth, log.warn, function (er, data) { var bfs = bfsify(data, args) , lite = getLite(bfs) @@ -196,7 +197,7 @@ function filterFound (root, args) { var found = false for (var i = 0; !found && i < args.length; i ++) { if (d === args[i][0]) { - found = semver.satisfies(dep.version, args[i][1]) + found = semver.satisfies(dep.version, args[i][1], true) } } // included explicitly diff --git a/lib/npm.js b/lib/npm.js index 6cd7888d0..dffe35625 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -53,15 +53,16 @@ function mkdir (p, cb) { npm.commands = {} try { + var pv = process.version.replace(/^v/, '') // startup, ok to do this synchronously var j = JSON.parse(fs.readFileSync( path.join(__dirname, "../package.json"))+"") npm.version = j.version npm.nodeVersionRequired = j.engines.node - if (!semver.satisfies(process.version, j.engines.node)) { + if (!semver.satisfies(pv, j.engines.node)) { log.warn("unsupported version", ["" ,"npm requires node version: "+j.engines.node - ,"And you have: "+process.version + ,"And you have: "+pv ,"which is not satisfactory." ,"" ,"Bad things will likely happen. You have been warned." diff --git a/lib/outdated.js b/lib/outdated.js index 038f18bfa..b205922ef 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -24,7 +24,6 @@ var path = require("path") , cache = require("./cache.js") , asyncMap = require("slide").asyncMap , npm = require("./npm.js") - , semver = require("semver") function outdated (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false diff --git a/lib/rebuild.js b/lib/rebuild.js index 35bb454d7..7cea3efff 100644 --- a/lib/rebuild.js +++ b/lib/rebuild.js @@ -52,7 +52,7 @@ function filter (data, args, set, seen) { , n = nv.shift() , v = nv.join("@") if (n !== data.name) continue - if (!semver.satisfies(data.version, v)) continue + if (!semver.satisfies(data.version, v, true)) continue pass = true break } diff --git a/lib/search.js b/lib/search.js index edbdc70b1..c758f869a 100644 --- a/lib/search.js +++ b/lib/search.js @@ -3,7 +3,6 @@ module.exports = exports = search var npm = require("./npm.js") , registry = npm.registry - , semver = require("semver") search.usage = "npm search [some search terms ...]" diff --git a/lib/uninstall.js b/lib/uninstall.js index bebc2300b..072d46bcf 100644 --- a/lib/uninstall.js +++ b/lib/uninstall.js @@ -13,7 +13,6 @@ var fs = require("graceful-fs") , readJson = require("read-package-json") , path = require("path") , npm = require("./npm.js") - , semver = require("semver") , asyncMap = require("slide").asyncMap function uninstall (args, cb) { diff --git a/lib/version.js b/lib/version.js index 73cd163f4..386001eb2 100644 --- a/lib/version.js +++ b/lib/version.js @@ -11,7 +11,7 @@ var exec = require("child_process").execFile , which = require("which") , npm = require("./npm.js") -version.usage = "npm version [<newversion> | major | minor | patch | build]\n" +version.usage = "npm version [<newversion> | major | minor | patch]\n" + "\n(run in package dir)\n" + "'npm -v' or 'npm --version' to print npm version " + "("+npm.version+")\n" diff --git a/lib/view.js b/lib/view.js index b88f98a09..babd072f7 100644 --- a/lib/view.js +++ b/lib/view.js @@ -13,7 +13,7 @@ view.completion = function (opts, cb) { if (er) return cb(er) var dv = d.versions[d["dist-tags"][tag]] , fields = [] - d.versions = Object.keys(d.versions).sort(semver.compare) + d.versions = Object.keys(d.versions).sort(semver.compareLoose) fields = getFields(d).concat(getFields(dv)) cb(null, fields) }) @@ -64,7 +64,7 @@ function view (args, silent, cb) { var results = [] , error = null , versions = data.versions - data.versions = Object.keys(data.versions).sort(semver.compare) + data.versions = Object.keys(data.versions).sort(semver.compareLoose) if (!args.length) args = [""] // remove readme unless we asked for it @@ -73,7 +73,7 @@ function view (args, silent, cb) { } Object.keys(versions).forEach(function (v) { - if (semver.satisfies(v, version)) args.forEach(function (args) { + if (semver.satisfies(v, version, true)) args.forEach(function (args) { // remove readme unless we asked for it if (-1 === args.indexOf("readme")) { delete versions[v].readme diff --git a/node_modules/init-package-json/package.json b/node_modules/init-package-json/package.json index a89ec7ec2..a97b5053f 100644 --- a/node_modules/init-package-json/package.json +++ b/node_modules/init-package-json/package.json @@ -1,6 +1,6 @@ { "name": "init-package-json", - "version": "0.0.9", + "version": "0.0.10", "main": "init-package-json.js", "scripts": { "test": "tap test/*.js" @@ -19,8 +19,8 @@ "dependencies": { "promzard": "~0.2.0", "read": "~1.0.1", - "read-package-json": "0", - "semver": "1.x" + "read-package-json": "1", + "semver": "2.x" }, "devDependencies": { "tap": "~0.2.5", @@ -41,6 +41,6 @@ "bugs": { "url": "https://github.com/isaacs/init-package-json/issues" }, - "_id": "init-package-json@0.0.9", + "_id": "init-package-json@0.0.10", "_from": "init-package-json@latest" } diff --git a/node_modules/node-gyp/README.md b/node_modules/node-gyp/README.md index cfc982052..ffe429c32 100644 --- a/node_modules/node-gyp/README.md +++ b/node_modules/node-gyp/README.md @@ -9,7 +9,7 @@ program which is removed for node `v0.8`. If you have a native addon for node th still has a `wscript` file, then you should definitely add a `binding.gyp` file to support the latest versions of node. -Multiple target versions of node are supported (i.e. `0.6`, `0.7`,..., `1.0`, +Multiple target versions of node are supported (i.e. `0.8`, `0.9`, `0.10`, ..., `1.0`, etc.), regardless of what version of node is actually installed on your system (`node-gyp` downloads the necessary development files for the target version). diff --git a/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py b/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py index ef5b46046..ed5e27fa6 100644 --- a/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +++ b/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py @@ -11,13 +11,16 @@ import gyp.common import os.path import re import shlex +import subprocess +import sys +from gyp.common import GypError class XcodeSettings(object): """A class that understands the gyp 'xcode_settings' object.""" - # Computed lazily by _GetSdkBaseDir(). Shared by all XcodeSettings, so cached + # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached # at class-level for efficiency. - _sdk_base_dir = None + _sdk_path_cache = {} def __init__(self, spec): self.spec = spec @@ -219,34 +222,34 @@ class XcodeSettings(object): else: return self._GetStandaloneBinaryPath() - def _GetSdkBaseDir(self): - """Returns the root of the 'Developer' directory. On Xcode 4.2 and prior, - this is usually just /Developer. Xcode 4.3 moved that folder into the Xcode - bundle.""" - if not XcodeSettings._sdk_base_dir: - import subprocess - job = subprocess.Popen(['xcode-select', '-print-path'], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - out, err = job.communicate() - if job.returncode != 0: - print out - raise Exception('Error %d running xcode-select' % job.returncode) - # The Developer folder moved in Xcode 4.3. - xcode43_sdk_path = os.path.join( - out.rstrip(), 'Platforms/MacOSX.platform/Developer/SDKs') - if os.path.isdir(xcode43_sdk_path): - XcodeSettings._sdk_base_dir = xcode43_sdk_path - else: - XcodeSettings._sdk_base_dir = os.path.join(out.rstrip(), 'SDKs') - return XcodeSettings._sdk_base_dir + def _GetSdkVersionInfoItem(self, sdk, infoitem): + job = subprocess.Popen(['xcodebuild', '-version', '-sdk', sdk, infoitem], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + out = job.communicate()[0] + if job.returncode != 0: + sys.stderr.write(out + '\n') + raise GypError('Error %d running xcodebuild' % job.returncode) + return out.rstrip('\n') def _SdkPath(self): - sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx10.5') - if sdk_root.startswith('macosx'): - return os.path.join(self._GetSdkBaseDir(), - 'MacOSX' + sdk_root[len('macosx'):] + '.sdk') - return sdk_root + sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx') + if sdk_root not in XcodeSettings._sdk_path_cache: + XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem( + sdk_root, 'Path') + return XcodeSettings._sdk_path_cache[sdk_root] + + def _AppendPlatformVersionMinFlags(self, lst): + self._Appendf(lst, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s') + if 'IPHONEOS_DEPLOYMENT_TARGET' in self._Settings(): + # TODO: Implement this better? + sdk_path_basename = os.path.basename(self._SdkPath()) + if sdk_path_basename.lower().startswith('iphonesimulator'): + self._Appendf(lst, 'IPHONEOS_DEPLOYMENT_TARGET', + '-mios-simulator-version-min=%s') + else: + self._Appendf(lst, 'IPHONEOS_DEPLOYMENT_TARGET', + '-miphoneos-version-min=%s') def GetCflags(self, configname): """Returns flags that need to be added to .c, .cc, .m, and .mm @@ -261,6 +264,9 @@ class XcodeSettings(object): if 'SDKROOT' in self._Settings(): cflags.append('-isysroot %s' % sdk_root) + if self._Test('CLANG_WARN_CONSTANT_CONVERSION', 'YES', default='NO'): + cflags.append('-Wconstant-conversion') + if self._Test('GCC_CHAR_IS_UNSIGNED_CHAR', 'YES', default='NO'): cflags.append('-funsigned-char') @@ -301,7 +307,7 @@ class XcodeSettings(object): if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'): cflags.append('-Wnewline-eof') - self._Appendf(cflags, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s') + self._AppendPlatformVersionMinFlags(cflags) # TODO: if self._Test('COPY_PHASE_STRIP', 'YES', default='NO'): @@ -354,6 +360,18 @@ class XcodeSettings(object): """Returns flags that need to be added to .cc, and .mm compilations.""" self.configname = configname cflags_cc = [] + + clang_cxx_language_standard = self._Settings().get( + 'CLANG_CXX_LANGUAGE_STANDARD') + if clang_cxx_language_standard == 'c++0x': + cflags_cc.append('-std=c++11') + elif clang_cxx_language_standard == 'gnu++0x': + cflags_cc.append('-std=gnu++11') + elif clang_cxx_language_standard: + cflags_cc.append('-std=%s' % clang_cxx_language_standard) + + self._Appendf(cflags_cc, 'CLANG_CXX_LIBRARY', '-stdlib=%s') + if self._Test('GCC_ENABLE_CPP_RTTI', 'NO', default='YES'): cflags_cc.append('-fno-rtti') if self._Test('GCC_ENABLE_CPP_EXCEPTIONS', 'NO', default='YES'): @@ -524,8 +542,9 @@ class XcodeSettings(object): ldflags, 'DYLIB_COMPATIBILITY_VERSION', '-compatibility_version %s') self._Appendf( ldflags, 'DYLIB_CURRENT_VERSION', '-current_version %s') - self._Appendf( - ldflags, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s') + + self._AppendPlatformVersionMinFlags(ldflags) + if 'SDKROOT' in self._Settings(): ldflags.append('-isysroot ' + self._SdkPath()) @@ -1042,7 +1061,7 @@ def _TopologicallySortedEnvVarKeys(env): order.reverse() return order except gyp.common.CycleError, e: - raise Exception( + raise GypError( 'Xcode environment variables are cyclically dependent: ' + str(e.nodes)) diff --git a/node_modules/node-gyp/lib/install.js b/node_modules/node-gyp/lib/install.js index d6b7c4201..6a49afc1e 100644 --- a/node_modules/node-gyp/lib/install.js +++ b/node_modules/node-gyp/lib/install.js @@ -60,7 +60,7 @@ function install (gyp, argv, callback) { } // 0.x.y-pre versions are not published yet and cannot be installed. Bail. - if (version[5] && version[5].match(/\-pre$/)) { + if (version.prerelease[0] === 'pre') { log.verbose('detected "pre" node version', versionStr) if (gyp.opts.nodedir) { log.verbose('--nodedir flag was passed; skipping install', gyp.opts.nodedir) @@ -72,7 +72,7 @@ function install (gyp, argv, callback) { } // flatten version into String - version = version.slice(1, 4).join('.') + version = version.version log.verbose('install', 'installing version: %s', version) // the directory where the dev files will be installed diff --git a/node_modules/node-gyp/package.json b/node_modules/node-gyp/package.json index ab2aac324..44666d4fd 100644 --- a/node_modules/node-gyp/package.json +++ b/node_modules/node-gyp/package.json @@ -10,7 +10,7 @@ "bindings", "gyp" ], - "version": "0.10.0", + "version": "0.10.1", "installVersion": 9, "author": { "name": "Nathan Rajlich", @@ -37,22 +37,22 @@ "osenv": "0", "request": "2", "rimraf": "2", - "semver": "1", + "semver": "~2.0.7", "tar": "0", "which": "1" }, "engines": { "node": ">= 0.8.0" }, - "readme": "node-gyp\n=========\n### Node.js native addon build tool\n\n`node-gyp` is a cross-platform command-line tool written in Node.js for compiling\nnative addon modules for Node.js, which takes away the pain of dealing with the\nvarious differences in build platforms. It is the replacement to the `node-waf`\nprogram which is removed for node `v0.8`. If you have a native addon for node that\nstill has a `wscript` file, then you should definitely add a `binding.gyp` file\nto support the latest versions of node.\n\nMultiple target versions of node are supported (i.e. `0.6`, `0.7`,..., `1.0`,\netc.), regardless of what version of node is actually installed on your system\n(`node-gyp` downloads the necessary development files for the target version).\n\n#### Features:\n\n * Easy to use, consistent interface\n * Same commands to build your module on every platform\n * Supports multiple target versions of Node\n\n\nInstallation\n------------\n\nYou can install with `npm`:\n\n``` bash\n$ npm install -g node-gyp\n```\n\nYou will also need to install:\n\n * On Unix:\n * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)\n * `make`\n * A proper C/C++ compiler toolchain, like GCC\n * On Windows:\n * [Python][windows-python] ([`v2.7.3`][windows-python-v2.7.3] recommended, `v3.x.x` is __*not*__ supported)\n * Windows XP/Vista/7:\n * Microsoft Visual Studio C++ 2010 ([Express][msvc2010] version works well)\n * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk]\n * If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.\n * If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]\n * Windows 7/8:\n * Microsoft Visual Studio C++ 2012 for Windows Desktop ([Express][msvc2012] version works well)\n\nNote that OS X is just a flavour of Unix and so needs `python`, `make`, and C/C++.\nAn easy way to obtain these is to install XCode from Apple,\nand then use it to install the command line tools (under Preferences -> Downloads).\n\nHow to Use\n----------\n\nTo compile your native addon, first go to its root directory:\n\n``` bash\n$ cd my_node_addon\n```\n\nThe next step is to generate the appropriate project build files for the current\nplatform. Use `configure` for that:\n\n``` bash\n$ node-gyp configure\n```\n\n__Note__: The `configure` step looks for the `binding.gyp` file in the current\ndirectory to processs. See below for instructions on creating the `binding.gyp` file.\n\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file\n(on Windows) in the `build/` directory. Next invoke the `build` command:\n\n``` bash\n$ node-gyp build\n```\n\nNow you have your compiled `.node` bindings file! The compiled bindings end up\nin `build/Debug/` or `build/Release/`, depending on the build mode. At this point\nyou can require the `.node` file with Node and run your tests!\n\n__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or\n`-d`) switch when running the either `configure` or `build` command.\n\n\nThe \"binding.gyp\" file\n----------------------\n\nPreviously when node had `node-waf` you had to write a `wscript` file. The\nreplacement for that is the `binding.gyp` file, which describes the configuration\nto build your module in a JSON-like format. This file gets placed in the root of\nyour package, alongside the `package.json` file.\n\nA barebones `gyp` file appropriate for building a node addon looks like:\n\n``` python\n{\n \"targets\": [\n {\n \"target_name\": \"binding\",\n \"sources\": [ \"src/binding.cc\" ]\n }\n ]\n}\n```\n\nSome additional resources for writing `gyp` files:\n\n * [\"Hello World\" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)\n * [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)\n * [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)\n * [*\"binding.gyp\" files out in the wild* wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)\n\n\nCommands\n--------\n\n`node-gyp` responds to the following commands:\n\n| **Command** | **Description**\n|:--------------|:---------------------------------------------------------------\n| `build` | Invokes `make`/`msbuild.exe` and builds the native addon\n| `clean` | Removes any the `build` dir if it exists\n| `configure` | Generates project build files for the current platform\n| `rebuild` | Runs \"clean\", \"configure\" and \"build\" all in a row\n| `install` | Installs node development header files for the given version\n| `list` | Lists the currently installed node development file versions\n| `remove` | Removes the node development header files for the given version\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[windows-python]: http://www.python.org/getit/windows\n[windows-python-v2.7.3]: http://www.python.org/download/releases/2.7.3#download\n[msvc2010]: http://go.microsoft.com/?linkid=9709949\n[msvc2012]: http://go.microsoft.com/?linkid=9816758\n[win7sdk]: http://www.microsoft.com/en-us/download/details.aspx?id=8279\n[compiler update for the Windows SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=4422\n", + "readme": "node-gyp\n=========\n### Node.js native addon build tool\n\n`node-gyp` is a cross-platform command-line tool written in Node.js for compiling\nnative addon modules for Node.js, which takes away the pain of dealing with the\nvarious differences in build platforms. It is the replacement to the `node-waf`\nprogram which is removed for node `v0.8`. If you have a native addon for node that\nstill has a `wscript` file, then you should definitely add a `binding.gyp` file\nto support the latest versions of node.\n\nMultiple target versions of node are supported (i.e. `0.8`, `0.9`, `0.10`, ..., `1.0`,\netc.), regardless of what version of node is actually installed on your system\n(`node-gyp` downloads the necessary development files for the target version).\n\n#### Features:\n\n * Easy to use, consistent interface\n * Same commands to build your module on every platform\n * Supports multiple target versions of Node\n\n\nInstallation\n------------\n\nYou can install with `npm`:\n\n``` bash\n$ npm install -g node-gyp\n```\n\nYou will also need to install:\n\n * On Unix:\n * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)\n * `make`\n * A proper C/C++ compiler toolchain, like GCC\n * On Windows:\n * [Python][windows-python] ([`v2.7.3`][windows-python-v2.7.3] recommended, `v3.x.x` is __*not*__ supported)\n * Windows XP/Vista/7:\n * Microsoft Visual Studio C++ 2010 ([Express][msvc2010] version works well)\n * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk]\n * If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.\n * If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]\n * Windows 7/8:\n * Microsoft Visual Studio C++ 2012 for Windows Desktop ([Express][msvc2012] version works well)\n\nNote that OS X is just a flavour of Unix and so needs `python`, `make`, and C/C++.\nAn easy way to obtain these is to install XCode from Apple,\nand then use it to install the command line tools (under Preferences -> Downloads).\n\nHow to Use\n----------\n\nTo compile your native addon, first go to its root directory:\n\n``` bash\n$ cd my_node_addon\n```\n\nThe next step is to generate the appropriate project build files for the current\nplatform. Use `configure` for that:\n\n``` bash\n$ node-gyp configure\n```\n\n__Note__: The `configure` step looks for the `binding.gyp` file in the current\ndirectory to processs. See below for instructions on creating the `binding.gyp` file.\n\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file\n(on Windows) in the `build/` directory. Next invoke the `build` command:\n\n``` bash\n$ node-gyp build\n```\n\nNow you have your compiled `.node` bindings file! The compiled bindings end up\nin `build/Debug/` or `build/Release/`, depending on the build mode. At this point\nyou can require the `.node` file with Node and run your tests!\n\n__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or\n`-d`) switch when running the either `configure` or `build` command.\n\n\nThe \"binding.gyp\" file\n----------------------\n\nPreviously when node had `node-waf` you had to write a `wscript` file. The\nreplacement for that is the `binding.gyp` file, which describes the configuration\nto build your module in a JSON-like format. This file gets placed in the root of\nyour package, alongside the `package.json` file.\n\nA barebones `gyp` file appropriate for building a node addon looks like:\n\n``` python\n{\n \"targets\": [\n {\n \"target_name\": \"binding\",\n \"sources\": [ \"src/binding.cc\" ]\n }\n ]\n}\n```\n\nSome additional resources for writing `gyp` files:\n\n * [\"Hello World\" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)\n * [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)\n * [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)\n * [*\"binding.gyp\" files out in the wild* wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)\n\n\nCommands\n--------\n\n`node-gyp` responds to the following commands:\n\n| **Command** | **Description**\n|:--------------|:---------------------------------------------------------------\n| `build` | Invokes `make`/`msbuild.exe` and builds the native addon\n| `clean` | Removes any the `build` dir if it exists\n| `configure` | Generates project build files for the current platform\n| `rebuild` | Runs \"clean\", \"configure\" and \"build\" all in a row\n| `install` | Installs node development header files for the given version\n| `list` | Lists the currently installed node development file versions\n| `remove` | Removes the node development header files for the given version\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[windows-python]: http://www.python.org/getit/windows\n[windows-python-v2.7.3]: http://www.python.org/download/releases/2.7.3#download\n[msvc2010]: http://go.microsoft.com/?linkid=9709949\n[msvc2012]: http://go.microsoft.com/?linkid=9816758\n[win7sdk]: http://www.microsoft.com/en-us/download/details.aspx?id=8279\n[compiler update for the Windows SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=4422\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/TooTallNate/node-gyp/issues" }, - "_id": "node-gyp@0.10.0", + "_id": "node-gyp@0.10.1", "dist": { - "shasum": "23748ceb4b7681493a4a353ce605cc22ecd6ee67" + "shasum": "025cb98fb719afff2fb86be99ccce4a8129f8879" }, "_from": "node-gyp@latest", - "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-0.10.0.tgz" + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-0.10.1.tgz" } diff --git a/node_modules/normalize-package-data/.npmignore b/node_modules/normalize-package-data/.npmignore deleted file mode 100644 index 096746c14..000000000 --- a/node_modules/normalize-package-data/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/
\ No newline at end of file diff --git a/node_modules/normalize-package-data/.travis.yml b/node_modules/normalize-package-data/.travis.yml deleted file mode 100644 index 2ca91f289..000000000 --- a/node_modules/normalize-package-data/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.8"
\ No newline at end of file diff --git a/node_modules/normalize-package-data/AUTHORS b/node_modules/normalize-package-data/AUTHORS deleted file mode 100644 index c64debf74..000000000 --- a/node_modules/normalize-package-data/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# Names sorted by how much code was originally theirs. -Isaac Z. Schlueter <i@izs.me> -Meryn Stol <merynstol@gmail.com>
\ No newline at end of file diff --git a/node_modules/normalize-package-data/LICENSE b/node_modules/normalize-package-data/LICENSE deleted file mode 100644 index 9cea2e3c9..000000000 --- a/node_modules/normalize-package-data/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -This package contains code originally written by Isaac Z. Schlueter. -Used with permission. - -Copyright (c) Meryn Stol ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/normalize-package-data/README.md b/node_modules/normalize-package-data/README.md deleted file mode 100644 index 71fa95065..000000000 --- a/node_modules/normalize-package-data/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# normalize-package-data [![Build Status](https://travis-ci.org/meryn/normalize-package-data.png?branch=master)](https://travis-ci.org/meryn/normalize-package-data) - -normalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. - -normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools. - -## Installation - -``` -npm install normalize-package-data -``` - -## Usage - -Basic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`. - -```javascript -normalizeData = require('normalize-package-data') -packageData = fs.readfileSync("package.json") -normalizeData(packageData) -// packageData is now normalized -``` - -Optionally, you may pass a "warning" function. It gets called whenever the normalizeData function encounters something that doesn't look right. It indicates less than perfect input data. - -```javascript -normalizeData = require('normalize-package-data') -packageData = fs.readfileSync("package.json") -warnFn = function(msg) { console.error(msg) } -normalizeData(packageData, warnFn) -// packageData is now normalized. Any number of warnings may have been logged. -``` - -If you don't provide a warning function, `normalizeData` functions silently. - -### Potential exceptions - -If the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback. - -## What normalization (currently) entails - -* The value of `name` field gets trimmed. -* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver). -* If `name` and/or `version` fields are missing, they are set to empty strings. -* If `files` field is not an array, it will be removed. -* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value. -* If `man` field is a string, it will become an array with the original string as its sole member. -* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\s+`. -* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties. -* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`. -* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs. -* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched. -* If `description` field does not exists, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`. -* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`. -* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value. -* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. -* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed. -* If `homepage` field is not a string, it will be removed. -* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`. - -### Rules for name field - -If `name` field is given, the value of the name field must be a string. The string may not: - -* start with a period. -* contain the following characters: `/@\s+%` -* contain and characters that would need to be encoded for use in urls. -* resemble the word `node_modules` or `favicon.ico` (case doesn't matter). - -### Rules for version field - -If `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver). - -## Credits - -This package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson. - -## License - -normalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). -Copyright (c) 2013 Meryn Stol
\ No newline at end of file diff --git a/node_modules/normalize-package-data/lib/extract_description.js b/node_modules/normalize-package-data/lib/extract_description.js deleted file mode 100644 index dbeef218b..000000000 --- a/node_modules/normalize-package-data/lib/extract_description.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = extractDescription - -// Extracts description from contents of a readme file in markdown format -function extractDescription (d) { - if (!d) return; - // the first block of text before the first heading - // that isn't the first line heading - d = d.trim().split('\n') - for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++); - var l = d.length - for (var e = s + 1; e < l && d[e].trim(); e ++); - return d.slice(s, e).join(' ').trim() -} diff --git a/node_modules/normalize-package-data/lib/fixer.js b/node_modules/normalize-package-data/lib/fixer.js deleted file mode 100644 index b4bd5276c..000000000 --- a/node_modules/normalize-package-data/lib/fixer.js +++ /dev/null @@ -1,253 +0,0 @@ -var semver = require("semver") -var parseGitHubURL = require("github-url-from-git") -var depTypes = ["dependencies","devDependencies","optionalDependencies"] -var extractDescription = require("./extract_description") -var url = require("url") - -var fixer = module.exports = { - fixRepositoryField: function(data) { - if (data.repositories) { - this.warn("'repositories' (plural) Not supported.\n" + - "Please pick one as the 'repository' field"); - data.repository = data.repositories[0] - } - if (!data.repository) return; - if (typeof data.repository === "string") { - data.repository = { - type: "git", - url: data.repository - } - } - var r = data.repository.url || "" - if (r) { - var ghurl = parseGitHubURL(r) - if (ghurl) { - r = ghurl.replace(/^https?:\/\//, 'git://') - } - } - - if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) { - this.warn("Probably broken git url: " + r) - } - } - -, fixFilesField: function(data) { - var files = data.files - if (files && !Array.isArray(files)) { - this.warn("Invalid 'files' member") - delete data.files - } - } - -, fixBinField: function(data) { - if (!data.bin) return; - if (typeof data.bin === "string") { - var b = {} - b[data.name] = data.bin - data.bin = b - } - } - -, fixManField: function(data) { - if (!data.man) return; - if (typeof data.man === "string") { - data.man = [ data.man ] - } - } -, fixBundleDependenciesField: function(data) { - var bdd = "bundledDependencies" - var bd = "bundleDependencies" - if (data[bdd] && !data[bd]) { - data[bd] = data[bdd] - delete data[bdd] - } - } - -, fixDependencies: function(data) { - objectifyDeps(data, this.warn) - addOptionalDepsToDeps(data, this.warn) - this.fixBundleDependenciesField(data) - } - -, fixKeywordsField: function (data, warn) { - if (typeof data.keywords === "string") { - data.keywords = data.keywords.split(/,\s+/) - } - } - -, fixVersionField: function(data) { - if (!data.version) { - data.version = "" - return true - } - if (!semver.valid(data.version)) { - throw new Error("invalid version: "+ data.version) - } - data.version = semver.clean(data.version) - return true - } - -, fixPeople: function(data) { - modifyPeople(data, unParsePerson) - modifyPeople(data, parsePerson) - } - -, fixNameField: function(data) { - if (!data.name) { - data.name = "" - return true - } - if (typeof data.name !== "string") { - throw new Error("name field must be a string.") - } - data.name = data.name.trim() - ensureValidName(data.name) - } - - -, fixDescriptionField: function (data) { - if (data.description && typeof data.description !== 'string') { - this.warn("'description' field should be a string") - delete data.description - } - if (data.readme && !data.description) - data.description = extractDescription(data.readme) - } - -, fixReadmeField: function (data) { - if (!data.readme) data.readme = "ERROR: No README data found!" - } - -, fixBugsField: function(data) { - if (!data.bugs && data.repository && data.repository.url) { - var gh = parseGitHubURL(data.repository.url) - if(gh) { - if(gh.match(/^https:\/\/github.com\//)) - data.bugs = {url: gh + "/issues"} - else // gist url - data.bugs = {url: gh} - } - } - else if(data.bugs) { - var emailRe = /^.+@.*\..+$/ - if(typeof data.bugs == "string") { - if(emailRe.test(data.bugs)) - data.bugs = {email:data.bugs} - else if(url.parse(data.bugs).protocol) - data.bugs = {url: data.bugs} - else - this.warn("Bug string field must be url, email, or {email,url}") - } - else { - var oldBugs = data.bugs - data.bugs = {} - if(oldBugs.url) { - if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol) - data.bugs.url = oldBugs.url - else - this.warn("bugs.url field must be a string url. Deleted.") - } - if(oldBugs.email) { - if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email)) - data.bugs.email = oldBugs.email - else - this.warn("bugs.email field must be a string email. Deleted.") - } - } - if(!data.bugs.email && !data.bugs.url) { - delete data.bugs - this.warn("Normalized value of bugs field is an empty object. Deleted.") - } - } - } - -, fixHomepageField: function(data) { - if(!data.homepage) return true; - if(typeof data.homepage !== "string") { - this.warn("homepage field must be a string url. Deleted.") - return delete data.homepage - } - if(!url.parse(data.homepage).protocol) { - this.warn("homepage field must start with a protocol.") - data.homepage = "http://" + data.homepage - } - } -} - -function ensureValidName (name) { - if (name.charAt(0) === "." || - name.match(/[\/@\s\+%:]/) || - name !== encodeURIComponent(name) || - name.toLowerCase() === "node_modules" || - name.toLowerCase() === "favicon.ico") { - throw new Error("Invalid name: " + JSON.stringify(name)) - } -} - -function modifyPeople (data, fn) { - if (data.author) data.author = fn(data.author) - ;["maintainers", "contributors"].forEach(function (set) { - if (!Array.isArray(data[set])) return; - data[set] = data[set].map(fn) - }) - return data -} - -function unParsePerson (person) { - if (typeof person === "string") return person - var name = person.name || "" - var u = person.url || person.web - var url = u ? (" ("+u+")") : "" - var e = person.email || person.mail - var email = e ? (" <"+e+">") : "" - return name+email+url -} - -function parsePerson (person) { - if (typeof person !== "string") return person - var name = person.match(/^([^\(<]+)/) - var url = person.match(/\(([^\)]+)\)/) - var email = person.match(/<([^>]+)>/) - var obj = {} - if (name && name[0].trim()) obj.name = name[0].trim() - if (email) obj.email = email[1]; - if (url) obj.url = url[1]; - return obj -} - -function addOptionalDepsToDeps (data, warn) { - var o = data.optionalDependencies - if (!o) return; - var d = data.dependencies || {} - Object.keys(o).forEach(function (k) { - d[k] = o[k] - }) - data.dependencies = d -} - -function depObjectify (deps) { - if (!deps) return {} - if (typeof deps === "string") { - deps = deps.trim().split(/[\n\r\s\t ,]+/) - } - if (!Array.isArray(deps)) return deps - var o = {} - deps.filter(function (d) { - return typeof d === "string" - }).forEach(function(d) { - d = d.trim().split(/(:?[@\s><=])/) - var dn = d.shift() - var dv = d.join("") - dv = dv.trim() - dv = dv.replace(/^@/, "") - o[dn] = dv - }) - return o -} - -function objectifyDeps (data, warn) { - depTypes.forEach(function (type) { - if (!data[type]) return; - data[type] = depObjectify(data[type]) - }) -} diff --git a/node_modules/normalize-package-data/lib/is_valid.js b/node_modules/normalize-package-data/lib/is_valid.js deleted file mode 100644 index 509fab491..000000000 --- a/node_modules/normalize-package-data/lib/is_valid.js +++ /dev/null @@ -1,58 +0,0 @@ -// a warning for deprecated or likely-incorrect fields - -module.exports = isValid - -var typos = require("./typos") - -function isValid (data, warnFunc) { - var hasWarned = false - function warn(msg) { - hasWarned = true - if(warnFunc) warnFunc(msg) - } - if (data.modules) warn("'modules' is deprecated") - Object.keys(typos.topLevel).forEach(function (d) { - if (data.hasOwnProperty(d)) { - warn(makeTypoWarning(d, typos.topLevel[d])) - } - }) - checkBugsField(data.bugs, warn) - checkScriptsField(data.scripts, warn) - if (!data.repository) warn("No repository field.") - if (!data.readme) warn("No readme data.") - if (data.description && typeof data.description !== 'string') { - warn("'description' field should be a string") - } - if (data[data.bundledDependencies] && - !Array.isArray(data.bundleDependencies)) { - warn("bundleDependencies must be an array") - } - return !hasWarned -} - -function checkBugsField (bugs, warn) { - if (!bugs || typeof bugs !== "object") return - Object.keys(bugs).forEach(function (k) { - if (typos.bugs[k]) { - bugs[typos.bugs[k]] = bugs[k] - delete bugs[k] - } - }) -} - -function checkScriptsField (scripts, warn) { - if (!scripts || typeof scripts !== "object") return - Object.keys(scripts).forEach(function (k) { - if (typos.script[k]) { - warn(makeTypoWarning(k, typos.script[k], "scripts")) - } - }) -} - -function makeTypoWarning (providedName, probableName, field) { - if (field) { - providedName = field + "['" + providedName + "']" - probableName = field + "['" + probableName + "']" - } - return providedName + " should probably be " + probableName + "." -} diff --git a/node_modules/normalize-package-data/lib/normalize.js b/node_modules/normalize-package-data/lib/normalize.js deleted file mode 100644 index 336334a47..000000000 --- a/node_modules/normalize-package-data/lib/normalize.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = normalize - -var isValid = require("./is_valid") -var fixer = require("./fixer") - -var fieldsToFix = ['name','version','description','repository' - ,'files','bin','man','bugs','keywords','readme','homepage'] -var otherThingsToFix = ['dependencies','people'] - -var thingsToFix = fieldsToFix.map(function(fieldName) { - return ucFirst(fieldName) + "Field" -}) -// two ways to do this in CoffeeScript on only one line, sub-70 chars: -// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field" -// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) -thingsToFix = thingsToFix.concat(otherThingsToFix) - -function normalize (data, warn) { - if(!warn) warn = function(msg) { /* noop */ } - isValid(data, warn) // don't care if it's valid, we'll make it valid - if (data.scripts && - data.scripts.install === "node-gyp rebuild" && - !data.scripts.preinstall) { - data.gypfile = true - } - fixer.warn = warn - thingsToFix.forEach(function(thingName) { - fixer["fix" + ucFirst(thingName)](data) - }) - data._id = data.name + "@" + data.version - if (data.modules) delete data.modules // modules field is deprecated -} - -function ucFirst (string) { - return string.charAt(0).toUpperCase() + string.slice(1); -} diff --git a/node_modules/normalize-package-data/lib/typos.json b/node_modules/normalize-package-data/lib/typos.json deleted file mode 100644 index dd2ec6614..000000000 --- a/node_modules/normalize-package-data/lib/typos.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "topLevel": { - "dependancies": "dependencies" - ,"dependecies": "dependencies" - ,"depdenencies": "dependencies" - ,"devEependencies": "devDependencies" - ,"depends": "dependencies" - ,"dev-dependencies": "devDependencies" - ,"devDependences": "devDependencies" - ,"devDepenencies": "devDependencies" - ,"devdependencies": "devDependencies" - ,"repostitory": "repository" - ,"prefereGlobal": "preferGlobal" - ,"hompage": "homepage" - ,"hampage": "homepage" - ,"autohr": "author" - ,"autor": "author" - ,"contributers": "contributors" - ,"publicationConfig": "publishConfig" - }, - "bugs": { "web": "url", "name": "url" }, - "script": { "server": "start", "tests": "test" } -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/node_modules/github-url-from-git/.npmignore b/node_modules/normalize-package-data/node_modules/github-url-from-git/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/normalize-package-data/node_modules/github-url-from-git/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/normalize-package-data/node_modules/github-url-from-git/History.md b/node_modules/normalize-package-data/node_modules/github-url-from-git/History.md deleted file mode 100644 index fcb296bc6..000000000 --- a/node_modules/normalize-package-data/node_modules/github-url-from-git/History.md +++ /dev/null @@ -1,10 +0,0 @@ - -1.1.1 / 2013-04-23 -================== - - * package.json: Move test stuff to devDeps - -1.1.0 / 2013-04-19 -================== - - * Add support for gist urls diff --git a/node_modules/normalize-package-data/node_modules/github-url-from-git/Makefile b/node_modules/normalize-package-data/node_modules/github-url-from-git/Makefile deleted file mode 100644 index 37f330e81..000000000 --- a/node_modules/normalize-package-data/node_modules/github-url-from-git/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @./node_modules/.bin/mocha test.js --reporter spec --require should - -.PHONY: test diff --git a/node_modules/normalize-package-data/node_modules/github-url-from-git/Readme.md b/node_modules/normalize-package-data/node_modules/github-url-from-git/Readme.md deleted file mode 100644 index d027e8ec6..000000000 --- a/node_modules/normalize-package-data/node_modules/github-url-from-git/Readme.md +++ /dev/null @@ -1,41 +0,0 @@ - -# github-url-from-git - -```js -describe('parse(url)', function(){ - it('should support git://*', function(){ - var url = 'git://github.com/jamesor/mongoose-versioner'; - parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); - }) - - it('should support git://*.git', function(){ - var url = 'git://github.com/treygriffith/cellar.git'; - parse(url).should.equal('https://github.com/treygriffith/cellar'); - }) - - it('should support https://*', function(){ - var url = 'https://github.com/Empeeric/i18n-node'; - parse(url).should.equal('https://github.com/Empeeric/i18n-node'); - }) - - it('should support https://*.git', function(){ - var url = 'https://jpillora@github.com/banchee/tranquil.git'; - parse(url).should.equal('https://github.com/banchee/tranquil'); - }) - - it('should return undefined on failure', function(){ - var url = 'git://github.com/justgord/.git'; - assert(null == parse(url)); - }) - - it('should parse git@gist urls', function() { - var url = 'git@gist.github.com:3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - it('should parse https://gist urls', function() { - var url = 'https://gist.github.com/3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) -}) -``` diff --git a/node_modules/normalize-package-data/node_modules/github-url-from-git/index.js b/node_modules/normalize-package-data/node_modules/github-url-from-git/index.js deleted file mode 100644 index 9ccc215f0..000000000 --- a/node_modules/normalize-package-data/node_modules/github-url-from-git/index.js +++ /dev/null @@ -1,12 +0,0 @@ -var re = /^(?:https?:\/\/|git:\/\/)?(?:[^@]+@)?(gist.github.com|github.com)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/ - -module.exports = function(url){ - try { - var m = re.exec(url.replace(/\.git$/, '')); - var host = m[1]; - var path = m[2]; - return 'https://' + host + '/' + path; - } catch (err) { - // ignore - } -}; diff --git a/node_modules/normalize-package-data/node_modules/github-url-from-git/package.json b/node_modules/normalize-package-data/node_modules/github-url-from-git/package.json deleted file mode 100644 index 923045414..000000000 --- a/node_modules/normalize-package-data/node_modules/github-url-from-git/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "github-url-from-git", - "version": "1.1.1", - "description": "Parse a github git url and return the github repo url", - "main": "index.js", - "scripts": { - "test": "mocha test.js --reporter spec --require should" - }, - "repository": "", - "keywords": [ - "github", - "git", - "url", - "parser" - ], - "author": "", - "license": "MIT", - "devDependencies": { - "better-assert": "~1.0.0", - "mocha": "~1.9.0", - "should": "~1.2.2" - }, - "readme": "\n# github-url-from-git\n\n```js\ndescribe('parse(url)', function(){\n it('should support git://*', function(){\n var url = 'git://github.com/jamesor/mongoose-versioner';\n parse(url).should.equal('https://github.com/jamesor/mongoose-versioner');\n })\n\n it('should support git://*.git', function(){\n var url = 'git://github.com/treygriffith/cellar.git';\n parse(url).should.equal('https://github.com/treygriffith/cellar');\n })\n\n it('should support https://*', function(){\n var url = 'https://github.com/Empeeric/i18n-node';\n parse(url).should.equal('https://github.com/Empeeric/i18n-node');\n })\n\n it('should support https://*.git', function(){\n var url = 'https://jpillora@github.com/banchee/tranquil.git';\n parse(url).should.equal('https://github.com/banchee/tranquil');\n })\n\n it('should return undefined on failure', function(){\n var url = 'git://github.com/justgord/.git';\n assert(null == parse(url));\n })\n\n it('should parse git@gist urls', function() {\n var url = 'git@gist.github.com:3135914.git';\n parse(url).should.equal('https://gist.github.com/3135914')\n })\n\n it('should parse https://gist urls', function() {\n var url = 'https://gist.github.com/3135914.git';\n parse(url).should.equal('https://gist.github.com/3135914')\n })\n})\n```\n", - "readmeFilename": "Readme.md", - "_id": "github-url-from-git@1.1.1", - "_from": "github-url-from-git@~1.1.1" -} diff --git a/node_modules/normalize-package-data/node_modules/github-url-from-git/test.js b/node_modules/normalize-package-data/node_modules/github-url-from-git/test.js deleted file mode 100644 index e472302a0..000000000 --- a/node_modules/normalize-package-data/node_modules/github-url-from-git/test.js +++ /dev/null @@ -1,40 +0,0 @@ - -var parse = require('./'); -var assert = require('better-assert'); - -describe('parse(url)', function(){ - it('should support git://*', function(){ - var url = 'git://github.com/jamesor/mongoose-versioner'; - parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); - }) - - it('should support git://*.git', function(){ - var url = 'git://github.com/treygriffith/cellar.git'; - parse(url).should.equal('https://github.com/treygriffith/cellar'); - }) - - it('should support https://*', function(){ - var url = 'https://github.com/Empeeric/i18n-node'; - parse(url).should.equal('https://github.com/Empeeric/i18n-node'); - }) - - it('should support https://*.git', function(){ - var url = 'https://jpillora@github.com/banchee/tranquil.git'; - parse(url).should.equal('https://github.com/banchee/tranquil'); - }) - - it('should return undefined on failure', function(){ - var url = 'git://github.com/justgord/.git'; - assert(null == parse(url)); - }) - - it('should parse git@gist urls', function() { - var url = 'git@gist.github.com:3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - it('should parse https://gist urls', function() { - var url = 'https://gist.github.com/3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) -}) diff --git a/node_modules/normalize-package-data/package.json b/node_modules/normalize-package-data/package.json deleted file mode 100644 index 2fdd036ae..000000000 --- a/node_modules/normalize-package-data/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "normalize-package-data", - "version": "0.1.7", - "author": { - "name": "Meryn Stol", - "email": "merynstol@gmail.com" - }, - "description": "Normalizes data that can be found in package.json files.", - "repository": { - "type": "git", - "url": "git://github.com/meryn/normalize-package-data.git" - }, - "main": "lib/normalize.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": { - "semver": "1.x", - "github-url-from-git": "~1.1.1" - }, - "devDependencies": { - "tap": "~0.2.5", - "underscore": "~1.4.4", - "async": "~0.2.7" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Meryn Stol", - "email": "merynstol@gmail.com" - } - ], - "readme": "# normalize-package-data [![Build Status](https://travis-ci.org/meryn/normalize-package-data.png?branch=master)](https://travis-ci.org/meryn/normalize-package-data)\n\nnormalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.\n\nnormalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.\n\n## Installation\n\n```\nnpm install normalize-package-data\n```\n\n## Usage\n\nBasic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nnormalizeData(packageData)\n// packageData is now normalized\n```\n\nOptionally, you may pass a \"warning\" function. It gets called whenever the normalizeData function encounters something that doesn't look right. It indicates less than perfect input data.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, warnFn)\n// packageData is now normalized. Any number of warnings may have been logged.\n```\n\nIf you don't provide a warning function, `normalizeData` functions silently.\n\n### Potential exceptions\n\nIf the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.\n\n## What normalization (currently) entails\n\n* The value of `name` field gets trimmed.\n* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n* If `name` and/or `version` fields are missing, they are set to empty strings.\n* If `files` field is not an array, it will be removed.\n* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.\n* If `man` field is a string, it will become an array with the original string as its sole member.\n* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\\s+`.\n* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.\n* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.\n* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.\n* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.\n* If `description` field does not exists, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.\n* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `\"git\"`.\n* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.\n* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.\n* If `homepage` field is not a string, it will be removed.\n* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.\n\n### Rules for name field\n\nIf `name` field is given, the value of the name field must be a string. The string may not:\n\n* start with a period.\n* contain the following characters: `/@\\s+%`\n* contain and characters that would need to be encoded for use in urls.\n* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).\n\n### Rules for version field\n\nIf `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n\n## Credits\n\nThis package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.\n\n## License\n\nnormalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). \nCopyright (c) 2013 Meryn Stol ", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/meryn/normalize-package-data/issues" - }, - "_id": "normalize-package-data@0.1.7", - "dist": { - "shasum": "8d3240084501de180f3cef9ea7708f9279d87445" - }, - "_from": "normalize-package-data@0.1.7", - "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-0.1.7.tgz" -} diff --git a/node_modules/normalize-package-data/test/basic.js b/node_modules/normalize-package-data/test/basic.js deleted file mode 100644 index 12c403ec7..000000000 --- a/node_modules/normalize-package-data/test/basic.js +++ /dev/null @@ -1,34 +0,0 @@ -var tap = require("tap") -var normalize = require("../lib/normalize") -var path = require("path") -var fs = require("fs") - -tap.test("basic test", function (t) { - var p = path.resolve(__dirname, "./fixtures/read-package-json.json") - fs.readFile (p, function (err, contents) { - if (err) throw err; - var originalData = JSON.parse(contents.toString()) - var data = JSON.parse(contents.toString()) - normalize(data) - t.ok(data) - verifyFields(t, data, originalData) - t.end() - }) -}) - -function verifyFields (t, normalized, original) { - t.equal(normalized.version, original.version, "Version field stays same") - t.equal(normalized._id, normalized.name + "@" + normalized.version, "It gets good id.") - t.equal(normalized.name, original.name, "Name stays the same.") - t.type(normalized.author, "object", "author field becomes object") - t.deepEqual(normalized.scripts, original.scripts, "scripts field (object) stays same") - t.equal(normalized.main, original.main) - // optional deps are folded in. - t.deepEqual(normalized.optionalDependencies, - original.optionalDependencies) - t.has(normalized.dependencies, original.optionalDependencies, "opt depedencies are copied into dependencies") - t.has(normalized.dependencies, original.dependencies, "regular depedencies stay in place") - t.deepEqual(normalized.devDependencies, original.devDependencies) - t.type(normalized.bugs, "object", "bugs should become object") - t.equal(normalized.bugs.url, "https://github.com/isaacs/read-package-json/issues") -} diff --git a/node_modules/normalize-package-data/test/consistency.js b/node_modules/normalize-package-data/test/consistency.js deleted file mode 100644 index 8ae6b2730..000000000 --- a/node_modules/normalize-package-data/test/consistency.js +++ /dev/null @@ -1,36 +0,0 @@ -var tap = require("tap") -var normalize = require("../lib/normalize") -var path = require("path") -var fs = require("fs") -var _ = require("underscore") -var async = require("async") - -var data, clonedData -var warn - -tap.test("consistent normalization", function(t) { - path.resolve(__dirname, "./fixtures/read-package-json.json") - fs.readdir (__dirname + "/fixtures", function (err, entries) { - // entries = ['coffee-script.json'] // uncomment to limit to a specific file - verifyConsistency = function(entryName, next) { - warn = function(msg) { - // t.equal("",msg) // uncomment to have some kind of logging of warnings - } - filename = __dirname + "/fixtures/" + entryName - fs.readFile(filename, function(err, contents) { - if (err) return next(err) - data = JSON.parse(contents.toString()) - normalize(data, warn) - clonedData = _.clone(data) - normalize(data, warn) - t.deepEqual(clonedData, data, - "Normalization of " + entryName + "is consistent.") - next(null) - }) // fs.readFile - } // verifyConsistency - async.forEach(entries, verifyConsistency, function(err) { - if (err) throw err - t.end() - }) - }) // fs.readdir -}) // tap.test
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/async.json b/node_modules/normalize-package-data/test/fixtures/async.json deleted file mode 100644 index 5e652a6c6..000000000 --- a/node_modules/normalize-package-data/test/fixtures/async.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./lib/async", - "author": "Caolan McMahon", - "version": "0.2.6", - "repository" : { - "type" : "git", - "url" : "http://github.com/caolan/async.git" - }, - "bugs" : { - "url" : "http://github.com/caolan/async/issues" - }, - "licenses" : [ - { - "type" : "MIT", - "url" : "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "jam": { - "main": "lib/async.js", - "include": [ - "lib/async.js", - "README.md", - "LICENSE" - ] - }, - "scripts": { - "test": "nodeunit test/test-async.js" - } -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/bcrypt.json b/node_modules/normalize-package-data/test/fixtures/bcrypt.json deleted file mode 100644 index 56e6d81b3..000000000 --- a/node_modules/normalize-package-data/test/fixtures/bcrypt.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "bcrypt", - "description": "A bcrypt library for NodeJS.", - "keywords": [ - "bcrypt", - "password", - "auth", - "authentication", - "encryption", - "crypt", - "crypto" - ], - "main": "./bcrypt", - "version": "0.7.5", - "author": "Nick Campbell (http://github.com/ncb000gt)", - "engines": { - "node": ">= 0.6.0" - }, - "repository": { - "type": "git", - "url": "http://github.com/ncb000gt/node.bcrypt.js.git" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "bugs": { - "url": "http://github.com/ncb000gt/node.bcrypt.js/issues" - }, - "scripts": { - "test": "node-gyp configure build && nodeunit test" - }, - "dependencies": { - "bindings": "1.0.0" - }, - "devDependencies": { - "nodeunit": ">=0.6.4" - }, - "contributors": [ - "Antonio Salazar Cardozo <savedfastcool@gmail.com> (https://github.com/Shadowfiend)", - "Van Nguyen <the.gol.effect@gmail.com> (https://github.com/thegoleffect)", - "David Trejo <david@dtrejo.com> (https://github.com/dtrejo)", - "Ben Glow <glen.low@pixelglow.com> (https://github.com/pixelglow)", - "NewITFarmer.com <> (https://github.com/newitfarmer)", - "Alfred Westerveld <alfredwesterveld@gmail.com> (https://github.com/alfredwesterveld)", - "Vincent Côté-Roy <vincentcr@gmail.com> (https://github.com/vincentcr)", - "Lloyd Hilaiel <lloyd@hilaiel.com> (https://github.com/lloyd)", - "Roman Shtylman <shtylman@gmail.com> (https://github.com/shtylman)", - "Vadim Graboys <dimva13@gmail.com> (https://github.com/vadimg)", - "Ben Noorduis <> (https://github.com/bnoordhuis)", - "Nate Rajlich <nathan@tootallnate.net> (https://github.com/tootallnate)", - "Sean McArthur <sean.monstar@gmail.com> (https://github.com/seanmonstar)", - "Fanie Oosthuysen <fanie.oosthuysen@gmail.com> (https://github.com/weareu)" - ] -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/coffee-script.json b/node_modules/normalize-package-data/test/fixtures/coffee-script.json deleted file mode 100644 index a0b60a9d3..000000000 --- a/node_modules/normalize-package-data/test/fixtures/coffee-script.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "coffee-script", - "description": "Unfancy JavaScript", - "keywords": ["javascript", "language", "coffeescript", "compiler"], - "author": "Jeremy Ashkenas", - "version": "1.6.2", - "licenses": [{ - "type": "MIT", - "url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE" - }], - "engines": { - "node": ">=0.8.0" - }, - "directories" : { - "lib" : "./lib/coffee-script" - }, - "main" : "./lib/coffee-script/coffee-script", - "bin": { - "coffee": "./bin/coffee", - "cake": "./bin/cake" - }, - "scripts": { - "test": "node ./bin/cake test" - }, - "homepage": "http://coffeescript.org", - "bugs": "https://github.com/jashkenas/coffee-script/issues", - "repository": { - "type": "git", - "url": "git://github.com/jashkenas/coffee-script.git" - }, - "devDependencies": { - "uglify-js": "~2.2", - "jison": ">=0.2.0" - } -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/http-server.json b/node_modules/normalize-package-data/test/fixtures/http-server.json deleted file mode 100644 index 90c28863a..000000000 --- a/node_modules/normalize-package-data/test/fixtures/http-server.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "http-server", - "preferGlobal": true, - "version": "0.3.0", - "author": "Nodejitsu <support@nodejitsu.com>", - "description": "a simple zero-configuration command-line http server", - "contributors": [ - { - "name": "Marak Squires", - "email": "marak@nodejitsu.com" - } - ], - "bin": { - "http-server": "./bin/http-server" - }, - "scripts": { - "start": "node ./bin/http-server", - "test": "vows --spec --isolate", - "predeploy": "echo This will be run before deploying the app", - "postdeploy": "echo This will be run after deploying the app" - }, - "main": "./lib/http-server", - "repository": { - "type": "git", - "url": "https://github.com/nodejitsu/http-server.git" - }, - "keywords": [ - "cli", - "http", - "server" - ], - "dependencies" : { - "colors" : "*", - "flatiron" : "0.1.x", - "optimist" : "0.2.x", - "union" : "0.1.x", - "ecstatic" : "0.1.x", - "plates" : "https://github.com/flatiron/plates/tarball/master" - }, - "analyze": false, - "devDependencies": { - "vows" : "0.5.x", - "request" : "2.1.x" - }, - "bundledDependencies": [ - "union", - "ecstatic" - ], - "license": "MIT", - "engines": { - "node": ">=0.6" - } -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/movefile.json b/node_modules/normalize-package-data/test/fixtures/movefile.json deleted file mode 100644 index 593387570..000000000 --- a/node_modules/normalize-package-data/test/fixtures/movefile.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "movefile", - "description": "rename implementation working over devices", - "version": "0.2.0", - "author": "yazgazan <yazgazan@gmail.com>", - "main": "./build/Release/movefile", - "keywords": ["move", "file", "rename"], - "repository": "git://github.com/yazgazan/movefile.git", - "directories": { - "lib": "./build/Release/" - }, - "scripts": { - "install": "./node_modules/node-gyp/bin/node-gyp.js configure && ./node_modules/node-gyp/bin/node-gyp.js build" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "node-gyp": "~0.9.1" - } -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/node-module_exist.json b/node_modules/normalize-package-data/test/fixtures/node-module_exist.json deleted file mode 100644 index acc053825..000000000 --- a/node_modules/normalize-package-data/test/fixtures/node-module_exist.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "node-module_exist", - "description": "Find if a NodeJS module is available to require or not", - "version": "0.0.1", - "main": "module_exist.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git@gist.github.com:3135914.git" - }, - "homepage": "https://github.com/FGRibreau", - "author": { - "name": "Francois-Guillaume Ribreau", - "url": "http://fgribreau.com.com/" - }, - "devDependencies": { - "nodeunit": "~0.7.4" - }, - "keywords": [ - "core", - "modules" - ], - "license": "MIT" -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/npm.json b/node_modules/normalize-package-data/test/fixtures/npm.json deleted file mode 100644 index 2262b3139..000000000 --- a/node_modules/normalize-package-data/test/fixtures/npm.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "version": "1.2.17", - "name": "npm", - "publishConfig": { - "proprietary-attribs": false - }, - "description": "A package manager for node", - "keywords": [ - "package manager", - "modules", - "install", - "package.json" - ], - "preferGlobal": true, - "config": { - "publishtest": false - }, - "homepage": "https://npmjs.org/doc/", - "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)", - "repository": { - "type": "git", - "url": "https://github.com/isaacs/npm" - }, - "bugs": { - "email": "npm-@googlegroups.com", - "url": "http://github.com/isaacs/npm/issues" - }, - "directories": { - "doc": "./doc", - "man": "./man", - "lib": "./lib", - "bin": "./bin" - }, - "main": "./lib/npm.js", - "bin": "./bin/npm-cli.js", - "dependencies": { - "semver": "~1.1.2", - "ini": "~1.1.0", - "slide": "1", - "abbrev": "~1.0.4", - "graceful-fs": "~1.2.0", - "minimatch": "~0.2.11", - "nopt": "~2.1.1", - "rimraf": "2", - "request": "~2.9", - "which": "1", - "tar": "~0.1.17", - "fstream": "~0.1.22", - "block-stream": "*", - "inherits": "1", - "mkdirp": "~0.3.3", - "read": "~1.0.4", - "lru-cache": "~2.3.0", - "node-gyp": "~0.9.3", - "fstream-npm": "~0.1.3", - "uid-number": "0", - "archy": "0", - "chownr": "0", - "npmlog": "0", - "ansi": "~0.1.2", - "npm-registry-client": "~0.2.18", - "read-package-json": "~0.3.0", - "read-installed": "0", - "glob": "~3.1.21", - "init-package-json": "0.0.6", - "osenv": "0", - "lockfile": "~0.3.0", - "retry": "~0.6.0", - "once": "~1.1.1", - "npmconf": "0", - "opener": "~1.3.0", - "chmodr": "~0.1.0", - "cmd-shim": "~1.1.0" - }, - "bundleDependencies": [ - "semver", - "ini", - "slide", - "abbrev", - "graceful-fs", - "minimatch", - "nopt", - "rimraf", - "request", - "which", - "tar", - "fstream", - "block-stream", - "inherits", - "mkdirp", - "read", - "lru-cache", - "node-gyp", - "fstream-npm", - "uid-number", - "archy", - "chownr", - "npmlog", - "ansi", - "npm-registry-client", - "read-package-json", - "read-installed", - "glob", - "init-package-json", - "osenv", - "lockfile", - "retry", - "once", - "npmconf", - "opener", - "chmodr", - "cmd-shim" - ], - "devDependencies": { - "ronn": "~0.3.6", - "tap": "~0.4.0" - }, - "engines": { - "node": ">=0.6", - "npm": "1" - }, - "scripts": { - "test": "node ./test/run.js && tap test/tap/*.js", - "tap": "tap test/tap/*.js", - "prepublish": "node bin/npm-cli.js prune ; rm -rf test/*/*/node_modules ; make -j4 doc", - "dumpconf": "env | grep npm | sort | uniq", - "echo": "node bin/npm-cli.js" - }, - "licenses": [ - { - "type": "MIT +no-false-attribs", - "url": "https://github.com/isaacs/npm/raw/master/LICENSE" - } - ] -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/read-package-json.json b/node_modules/normalize-package-data/test/fixtures/read-package-json.json deleted file mode 100644 index f4a2b96f4..000000000 --- a/node_modules/normalize-package-data/test/fixtures/read-package-json.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "read-package-json", - "version": "0.1.1", - "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", - "description": "The thing npm uses to read package.json files with semantics and defaults and validation", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/read-package-json.git" - }, - "main": "read-json.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": { - "glob": "~3.1.9", - "lru-cache": "~1.1.0", - "semver": "~1.0.14", - "slide": "~1.1.3" - }, - "devDependencies": { - "tap": "~0.2.5" - }, - "optionalDependencies": { - "npmlog": "0", - "graceful-fs": "~1.1.8" - } -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/request.json b/node_modules/normalize-package-data/test/fixtures/request.json deleted file mode 100644 index 24189a551..000000000 --- a/node_modules/normalize-package-data/test/fixtures/request.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "request", - "description": "Simplified HTTP request client.", - "tags": [ - "http", - "simple", - "util", - "utility" - ], - "version": "2.16.7", - "author": "Mikeal Rogers <mikeal.rogers@gmail.com>", - "repository": { - "type": "git", - "url": "http://github.com/mikeal/request.git" - }, - "bugs": { - "url": "http://github.com/mikeal/request/issues" - }, - "engines": [ - "node >= 0.8.0" - ], - "main": "index.js", - "dependencies": { - "form-data": "~0.0.3", - "mime": "~1.2.7", - "hawk": "~0.10.2", - "node-uuid": "~1.4.0", - "cookie-jar": "~0.2.0", - "aws-sign": "~0.2.0", - "oauth-sign": "~0.2.0", - "forever-agent": "~0.2.0", - "tunnel-agent": "~0.2.0", - "json-stringify-safe": "~3.0.0", - "qs": "~0.5.4" - }, - "scripts": { - "test": "node tests/run.js" - } -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/fixtures/underscore.json b/node_modules/normalize-package-data/test/fixtures/underscore.json deleted file mode 100644 index bfc8b3d26..000000000 --- a/node_modules/normalize-package-data/test/fixtures/underscore.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name" : "underscore", - "description" : "JavaScript's functional programming helper library.", - "homepage" : "http://underscorejs.org", - "keywords" : ["util", "functional", "server", "client", "browser"], - "author" : "Jeremy Ashkenas <jeremy@documentcloud.org>", - "repository" : {"type": "git", "url": "git://github.com/documentcloud/underscore.git"}, - "main" : "underscore.js", - "version" : "1.4.4", - "devDependencies": { - "phantomjs": "1.9.0-1" - }, - "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" - }, - "license" : "MIT" -}
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/github-urls.js b/node_modules/normalize-package-data/test/github-urls.js deleted file mode 100644 index fd68d76e2..000000000 --- a/node_modules/normalize-package-data/test/github-urls.js +++ /dev/null @@ -1,46 +0,0 @@ -var tap = require("tap") -var normalize = require("../lib/normalize") -var path = require("path") -var fs = require("fs") -var _ = require("underscore") -var async = require("async") - -var data, clonedData -var warn - -tap.test("consistent normalization", function(t) { - entries = [ - 'read-package-json.json', - 'http-server.json', - "movefile.json", - "node-module_exist.json" - ] - verifyConsistency = function(entryName, next) { - warn = function(msg) { - // t.equal("",msg) // uncomment to have some kind of logging of warnings - } - filename = __dirname + "/fixtures/" + entryName - fs.readFile(filename, function(err, contents) { - if (err) return next(err) - data = JSON.parse(contents.toString()) - normalize(data, warn) - if(data.name == "node-module_exist") { - t.same(data.bugs.url, "https://gist.github.com/3135914") - } - if(data.name == "read-package-json") { - t.same(data.bugs.url, "https://github.com/isaacs/read-package-json/issues") - } - if(data.name == "http-server") { - t.same(data.bugs.url, "https://github.com/nodejitsu/http-server/issues") - } - if(data.name == "movefile") { - t.same(data.bugs.url, "https://github.com/yazgazan/movefile/issues") - } - next(null) - }) // fs.readFile - } // verifyConsistency - async.forEach(entries, verifyConsistency, function(err) { - if (err) throw err - t.end() - }) -}) // tap.test
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/normalize.js b/node_modules/normalize-package-data/test/normalize.js deleted file mode 100644 index 88dc84a6d..000000000 --- a/node_modules/normalize-package-data/test/normalize.js +++ /dev/null @@ -1,129 +0,0 @@ -var tap = require("tap") -var fs = require("fs") -var path = require("path") - -var globals = Object.keys(global) - -var normalize = require("../lib/normalize") - -var rpjPath = path.resolve(__dirname,"./fixtures/read-package-json.json") -tap.test("normalize some package data", function(t) { - var packageData = require(rpjPath) - var warnings = [] - normalize(packageData, function(warning) { - warnings.push(warning) - }) - // there's no readme data in this particular object - t.equal( warnings.length, 1, "There's exactly one warning.") - fs.readFile(rpjPath, function(err, data) { - if(err) throw err - // Various changes have been made - t.notEqual(packageData, JSON.parse(data), "Output is different from input.") - t.end() - }) -}) - -tap.test("runs without passing warning function", function(t) { - var packageData = require(rpjPath) - fs.readFile(rpjPath, function(err, data) { - if(err) throw err - normalize(JSON.parse(data)) - t.ok(true, "If you read this, this means I'm still alive.") - t.end() - }) -}) - -tap.test("empty object", function(t) { - var packageData = {} - var expect = - { name: '', - version: '', - readme: 'ERROR: No README data found!', - _id: '@' } - - var warnings = [] - function warn(m) { - warnings.push(m) - } - normalize(packageData, warn) - t.same(packageData, expect) - t.same(warnings, ["No repository field.","No readme data."]) - t.end() -}) - -tap.test("urls required", function(t) { - var warnings = [] - function warn(w) { - warnings.push(w) - } - normalize({ - bugs: { - url: "/1", - email: "not an email address" - } - }, warn) - var a - normalize(a={ - readme: "read yourself how about", - homepage: 123, - bugs: "what is this i don't even", - repository: "Hello." - }, warn) - - console.error(a) - - var expect = - [ 'No repository field.', - 'No readme data.', - 'bugs.url field must be a string url. Deleted.', - 'bugs.email field must be a string email. Deleted.', - 'Normalized value of bugs field is an empty object. Deleted.', - 'Bug string field must be url, email, or {email,url}', - 'Normalized value of bugs field is an empty object. Deleted.', - 'homepage field must be a string url. Deleted.' ] - t.same(warnings, expect) - t.end() -}) - -tap.test("homepage field must start with a protocol.", function(t) { - var warnings = [] - function warn(w) { - warnings.push(w) - } - var a - normalize(a={ - homepage: 'example.org' - }, warn) - - console.error(a) - - var expect = - [ 'No repository field.', - 'No readme data.', - 'homepage field must start with a protocol.' ] - t.same(warnings, expect) - t.same(a.homepage, 'http://example.org') - t.end() -}) - -tap.test("gist bugs url", function(t) { - var d = { - repository: "git@gist.github.com:123456.git" - } - normalize(d) - t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' }) - t.same(d.bugs, { url: 'https://gist.github.com/123456' }) - t.end(); -}); - -tap.test('no new globals', function(t) { - t.same(Object.keys(global), globals) - t.end() -}) - -tap.test("singularize repositories", function(t) { - d = {repositories:["git@gist.github.com:123456.git"]} - normalize(d) - t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' }) - t.end() -});
\ No newline at end of file diff --git a/node_modules/normalize-package-data/test/typo.js b/node_modules/normalize-package-data/test/typo.js deleted file mode 100644 index d7d3af0e2..000000000 --- a/node_modules/normalize-package-data/test/typo.js +++ /dev/null @@ -1,67 +0,0 @@ -var test = require('tap').test -var normalize = require('../') -var typos = require('../lib/typos.json') - -test('typos', function(t) { - var warnings = [] - function warn(m) { - warnings.push(m) - } - - var expect = - [ 'dependancies should probably be dependencies.', - 'dependecies should probably be dependencies.', - 'depdenencies should probably be dependencies.', - 'devEependencies should probably be devDependencies.', - 'depends should probably be dependencies.', - 'dev-dependencies should probably be devDependencies.', - 'devDependences should probably be devDependencies.', - 'devDepenencies should probably be devDependencies.', - 'devdependencies should probably be devDependencies.', - 'repostitory should probably be repository.', - 'prefereGlobal should probably be preferGlobal.', - 'hompage should probably be homepage.', - 'hampage should probably be homepage.', - 'autohr should probably be author.', - 'autor should probably be author.', - 'contributers should probably be contributors.', - 'publicationConfig should probably be publishConfig.', - 'No repository field.', - 'No repository field.', - 'No readme data.', - 'bugs.url field must be a string url. Deleted.', - 'Normalized value of bugs field is an empty object. Deleted.', - 'No repository field.', - 'No readme data.' ] - - normalize({"dependancies": "dependencies" - ,"dependecies": "dependencies" - ,"depdenencies": "dependencies" - ,"devEependencies": "devDependencies" - ,"depends": "dependencies" - ,"dev-dependencies": "devDependencies" - ,"devDependences": "devDependencies" - ,"devDepenencies": "devDependencies" - ,"devdependencies": "devDependencies" - ,"repostitory": "repository" - ,"prefereGlobal": "preferGlobal" - ,"hompage": "homepage" - ,"hampage": "homepage" - ,"autohr": "author" - ,"autor": "author" - ,"contributers": "contributors" - ,"publicationConfig": "publishConfig" - ,readme:"asdf" - ,name:"name" - ,version:"1.2.5"}, warn) - - normalize({name:"name" - ,version:"1.2.5" - ,bugs:{web:"url",name:"url"}}, warn) - - normalize({name:"name" - ,version:"1.2.5" - ,script:{server:"start",tests:"test"}}, warn) - t.same(warnings, expect) - t.end(); -}) diff --git a/node_modules/npm-registry-client/lib/unpublish.js b/node_modules/npm-registry-client/lib/unpublish.js index c844c27fe..9aaac1b70 100644 --- a/node_modules/npm-registry-client/lib/unpublish.js +++ b/node_modules/npm-registry-client/lib/unpublish.js @@ -51,7 +51,7 @@ function unpublish (name, ver, cb) { if (latestVer === ver) { data["dist-tags"].latest = - Object.getOwnPropertyNames(versions).sort(semver.compare).pop() + Object.getOwnPropertyNames(versions).sort(semver.compareLoose).pop() } var rev = data._rev diff --git a/node_modules/npm-registry-client/node_modules/couch-login/package.json b/node_modules/npm-registry-client/node_modules/couch-login/package.json index 922ba0d82..b65ced071 100644 --- a/node_modules/npm-registry-client/node_modules/couch-login/package.json +++ b/node_modules/npm-registry-client/node_modules/couch-login/package.json @@ -27,5 +27,5 @@ "url": "https://github.com/isaacs/couch-login/issues" }, "_id": "couch-login@0.1.17", - "_from": "couch-login@" + "_from": "couch-login@~0.1.15" } diff --git a/node_modules/npm-registry-client/package.json b/node_modules/npm-registry-client/package.json index 8a62919c5..57941a57b 100644 --- a/node_modules/npm-registry-client/package.json +++ b/node_modules/npm-registry-client/package.json @@ -6,7 +6,7 @@ }, "name": "npm-registry-client", "description": "Client for the npm registry", - "version": "0.2.24", + "version": "0.2.25", "repository": { "url": "git://github.com/isaacs/npm-registry-client" }, @@ -17,7 +17,7 @@ "dependencies": { "request": "2 >=2.20.0", "graceful-fs": "~1.2.0", - "semver": "~1.1.0", + "semver": "~2.0.5", "slide": "~1.1.3", "chownr": "0", "mkdirp": "~0.3.3", @@ -38,6 +38,6 @@ "bugs": { "url": "https://github.com/isaacs/npm-registry-client/issues" }, - "_id": "npm-registry-client@0.2.24", - "_from": "npm-registry-client@~0.2.22" + "_id": "npm-registry-client@0.2.25", + "_from": "npm-registry-client@latest" } diff --git a/node_modules/npmconf/config-defs.js b/node_modules/npmconf/config-defs.js index 5410400f1..e53f2475c 100644 --- a/node_modules/npmconf/config-defs.js +++ b/node_modules/npmconf/config-defs.js @@ -74,8 +74,8 @@ nopt.invalidHandler = function (k, val, type, data) { } } -if (!stableFamily || (+stableFamily[2] % 2)) stableFamily = null -else stableFamily = stableFamily[1] + "." + stableFamily[2] +if (!stableFamily || (+stableFamily.minor % 2)) stableFamily = null +else stableFamily = stableFamily.major + "." + stableFamily.minor var defaults diff --git a/node_modules/npmconf/package.json b/node_modules/npmconf/package.json index 5634c8f8a..23ddd58e9 100644 --- a/node_modules/npmconf/package.json +++ b/node_modules/npmconf/package.json @@ -1,6 +1,6 @@ { "name": "npmconf", - "version": "0.1.0", + "version": "0.1.1", "description": "The config thing npm uses", "main": "npmconf.js", "directories": { @@ -13,7 +13,7 @@ "mkdirp": "~0.3.3", "osenv": "0.0.3", "nopt": "2", - "semver": "~1.1.0", + "semver": "2", "ini": "~1.1.0" }, "devDependencies": {}, @@ -42,6 +42,6 @@ "bugs": { "url": "https://github.com/isaacs/npmconf/issues" }, - "_id": "npmconf@0.1.0", + "_id": "npmconf@0.1.1", "_from": "npmconf@latest" } diff --git a/node_modules/npmlog/LICENSE b/node_modules/npmlog/LICENSE index 74489e2e2..0c44ae716 100644 --- a/node_modules/npmlog/LICENSE +++ b/node_modules/npmlog/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) Isaac Z. Schlueter +Copyright (c) Isaac Z. Schlueter ("Author") All rights reserved. The BSD License @@ -6,20 +6,22 @@ The BSD License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/npmlog/log.js b/node_modules/npmlog/log.js index 320788e7a..752b81eb0 100644 --- a/node_modules/npmlog/log.js +++ b/node_modules/npmlog/log.js @@ -81,7 +81,7 @@ log.log = function (lvl, prefix, message) { } this.emitLog(m) -} +}.bind(log) log.emitLog = function (m) { if (this._paused) { @@ -135,7 +135,7 @@ log.addLevel = function (lvl, n, style, disp) { a[i + 1] = arguments[i] } return this.log.apply(this, a) - } + }.bind(this) this.disp[lvl] = disp } diff --git a/node_modules/npmlog/package.json b/node_modules/npmlog/package.json index d9a33c451..e4e6cf1fa 100644 --- a/node_modules/npmlog/package.json +++ b/node_modules/npmlog/package.json @@ -6,7 +6,7 @@ }, "name": "npmlog", "description": "logger for npm", - "version": "0.0.2", + "version": "0.0.3", "repository": { "type": "git", "url": "git://github.com/isaacs/npmlog.git" @@ -22,21 +22,11 @@ "tap": "" }, "license": "BSD", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" + "readme": "# npmlog\n\nThe logger util that npm uses.\n\nThis logger is very basic. It does the logging for npm. It supports\ncustom levels and colored output.\n\nBy default, logs are written to stderr. If you want to send log messages\nto outputs other than streams, then you can change the `log.stream`\nmember, or you can just listen to the events that it emits, and do\nwhatever you want with them.\n\n# Basic Usage\n\n```\nvar log = require('npmlog')\n\n// additional stuff ---------------------------+\n// message ----------+ |\n// prefix ----+ | |\n// level -+ | | |\n// v v v v\n log.info('fyi', 'I have a kitty cat: %j', myKittyCat)\n```\n\n## log.level\n\n* {String}\n\nThe level to display logs at. Any logs at or above this level will be\ndisplayed. The special level `silent` will prevent anything from being\ndisplayed ever.\n\n## log.record\n\n* {Array}\n\nAn array of all the log messages that have been entered.\n\n## log.maxRecordSize\n\n* {Number}\n\nThe maximum number of records to keep. If log.record gets bigger than\n10% over this value, then it is sliced down to 90% of this value.\n\nThe reason for the 10% window is so that it doesn't have to resize a\nlarge array on every log entry.\n\n## log.prefixStyle\n\n* {Object}\n\nA style object that specifies how prefixes are styled. (See below)\n\n## log.headingStyle\n\n* {Object}\n\nA style object that specifies how the heading is styled. (See below)\n\n## log.heading\n\n* {String} Default: \"\"\n\nIf set, a heading that is printed at the start of every line.\n\n## log.stream\n\n* {Stream} Default: `process.stderr`\n\nThe stream where output is written.\n\n## log.enableColor()\n\nForce colors to be used on all messages, regardless of the output\nstream.\n\n## log.disableColor()\n\nDisable colors on all messages.\n\n## log.pause()\n\nStop emitting messages to the stream, but do not drop them.\n\n## log.resume()\n\nEmit all buffered messages that were written while paused.\n\n## log.log(level, prefix, message, ...)\n\n* `level` {String} The level to emit the message at\n* `prefix` {String} A string prefix. Set to \"\" to skip.\n* `message...` Arguments to `util.format`\n\nEmit a log message at the specified level.\n\n## log\\[level](prefix, message, ...)\n\nFor example,\n\n* log.silly(prefix, message, ...)\n* log.verbose(prefix, message, ...)\n* log.info(prefix, message, ...)\n* log.http(prefix, message, ...)\n* log.warn(prefix, message, ...)\n* log.error(prefix, message, ...)\n\nLike `log.log(level, prefix, message, ...)`. In this way, each level is\ngiven a shorthand, so you can do `log.info(prefix, message)`.\n\n## log.addLevel(level, n, style, disp)\n\n* `level` {String} Level indicator\n* `n` {Number} The numeric level\n* `style` {Object} Object with fg, bg, inverse, etc.\n* `disp` {String} Optional replacement for `level` in the output.\n\nSets up a new level with a shorthand function and so forth.\n\nNote that if the number is `Infinity`, then setting the level to that\nwill cause all log messages to be suppressed. If the number is\n`-Infinity`, then the only way to show it is to enable all log messages.\n\n# Events\n\nEvents are all emitted with the message object.\n\n* `log` Emitted for all messages\n* `log.<level>` Emitted for all messages with the `<level>` level.\n* `<prefix>` Messages with prefixes also emit their prefix as an event.\n\n# Style Objects\n\nStyle objects can have the following fields:\n\n* `fg` {String} Color for the foreground text\n* `bg` {String} Color for the background\n* `bold`, `inverse`, `underline` {Boolean} Set the associated property\n* `bell` {Boolean} Make a noise (This is pretty annoying, probably.)\n\n# Message Objects\n\nEvery log event is emitted with a message object, and the `log.record`\nlist contains all of them that have been created. They have the\nfollowing fields:\n\n* `id` {Number}\n* `level` {String}\n* `prefix` {String}\n* `message` {String} Result of `util.format()`\n* `messageRaw` {Array} Arguments to `util.format()`\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/npmlog/issues" }, - "_id": "npmlog@0.0.2", - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.24", - "_nodeVersion": "v0.7.10-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "f0cf4b2c519950c00e91ba8e2868b62bf86254f6" - }, - "_from": "npmlog@0" + "_id": "npmlog@0.0.3", + "_from": "npmlog@latest" } diff --git a/node_modules/read-installed/README.md b/node_modules/read-installed/README.md index 59e882fb0..616371ef9 100644 --- a/node_modules/read-installed/README.md +++ b/node_modules/read-installed/README.md @@ -10,7 +10,7 @@ npm uses this. ```javascript var readInstalled = require("read-installed") // depth is optional, defaults to Infinity -readInstalled(folder, depth, function (er, data) { +readInstalled(folder, depth, logFunction, function (er, data) { ... }) ``` diff --git a/node_modules/read-installed/package.json b/node_modules/read-installed/package.json index c20eada02..c76887427 100644 --- a/node_modules/read-installed/package.json +++ b/node_modules/read-installed/package.json @@ -1,7 +1,7 @@ { "name": "read-installed", "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "version": "0.1.1", + "version": "0.2.2", "repository": { "type": "git", "url": "git://github.com/isaacs/read-installed" @@ -11,23 +11,24 @@ "test": "node test/basic.js" }, "dependencies": { - "semver": "1.x", + "semver": "2", "slide": "~1.1.3", - "read-package-json": "0", - "graceful-fs": "~1.2.0", - "npmlog": "0" + "read-package-json": "1", + "graceful-fs": "~1.2.0" }, "optionalDependencies": { - "graceful-fs": "~1.2.0", - "npmlog": "0" + "graceful-fs": "~1.2.0" }, "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me/" }, - "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// depth is optional, defaults to Infinity\nreadInstalled(folder, depth, function (er, data) {\n ...\n})\n```\n", + "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// depth is optional, defaults to Infinity\nreadInstalled(folder, depth, logFunction, function (er, data) {\n ...\n})\n```\n", "readmeFilename": "README.md", - "_id": "read-installed@0.1.1", - "_from": "read-installed@0" + "bugs": { + "url": "https://github.com/isaacs/read-installed/issues" + }, + "_id": "read-installed@0.2.2", + "_from": "read-installed@latest" } diff --git a/node_modules/read-installed/read-installed.js b/node_modules/read-installed/read-installed.js index 4babfc862..f7e73be26 100644 --- a/node_modules/read-installed/read-installed.js +++ b/node_modules/read-installed/read-installed.js @@ -93,13 +93,6 @@ try { var fs = require("fs") } -try { - var log = require("npmlog") -} catch (_) { - var log = { verbose: noop, info: noop, warn: noop, error: noop } - function noop () {} -} - var path = require("path") var asyncMap = require("slide").asyncMap var semver = require("semver") @@ -108,13 +101,21 @@ var url = require("url") module.exports = readInstalled -function readInstalled (folder, depth, cb) { - if (typeof cb !== "function") cb = depth, depth = Infinity +function readInstalled (folder, depth_, log_, cb_) { + var depth = Infinity, log = function () {}, cb + for (var i = 1; i < arguments.length - 1; i++) { + if (typeof arguments[i] === 'number') + depth = arguments[i] + else if (typeof arguments[i] === 'function') + log = arguments[i] + } + cb = arguments[i] + readInstalled_(folder, null, null, null, 0, depth, function (er, obj) { if (er) return cb(er) // now obj has all the installed things, where they're installed // figure out the inheritance links, now that the object is built. - resolveInheritance(obj) + resolveInheritance(obj, log) cb(null, obj) }) } @@ -178,8 +179,8 @@ function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) { // "foo":"http://blah" is always presumed valid if (reqver - && semver.validRange(reqver) - && !semver.satisfies(obj.version, reqver)) { + && semver.validRange(reqver, true) + && !semver.satisfies(obj.version, reqver, true)) { obj.invalid = true } @@ -236,7 +237,7 @@ function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) { // starting from a root object, call findUnmet on each layer of children var riSeen = [] -function resolveInheritance (obj) { +function resolveInheritance (obj, log) { if (typeof obj !== "object") return if (riSeen.indexOf(obj) !== -1) return riSeen.push(obj) @@ -244,18 +245,18 @@ function resolveInheritance (obj) { obj.dependencies = {} } Object.keys(obj.dependencies).forEach(function (dep) { - findUnmet(obj.dependencies[dep]) + findUnmet(obj.dependencies[dep], log) }) Object.keys(obj.dependencies).forEach(function (dep) { - resolveInheritance(obj.dependencies[dep]) + resolveInheritance(obj.dependencies[dep], log) }) - findUnmet(obj) + findUnmet(obj, log) } // find unmet deps by walking up the tree object. // No I/O var fuSeen = [] -function findUnmet (obj) { +function findUnmet (obj, log) { if (fuSeen.indexOf(obj) !== -1) return fuSeen.push(obj) //console.error("find unmet", obj.name, obj.parent && obj.parent.name) @@ -280,12 +281,12 @@ function findUnmet (obj) { if ( typeof deps[d] === "string" // url deps presumed innocent. && !url.parse(deps[d]).protocol - && !semver.satisfies(found.version, deps[d])) { + && !semver.satisfies(found.version, deps[d], true)) { // the bad thing will happen - log.warn("unmet dependency", obj.path + " requires "+d+"@'"+deps[d] - +"' but will load\n" - +found.path+",\nwhich is version "+found.version - ) + log("unmet dependency", obj.path + " requires "+d+"@'"+deps[d] + +"' but will load\n" + +found.path+",\nwhich is version "+found.version + ) found.invalid = true } else { found.extraneous = false @@ -314,12 +315,11 @@ function findUnmet (obj) { dependency.extraneous = false - if (!semver.satisfies(dependency.version, peerDeps[d])) { + if (!semver.satisfies(dependency.version, peerDeps[d], true)) { dependency.peerInvalid = true } }) - log.verbose("readInstalled", "returning", obj._id) return obj } diff --git a/node_modules/read-installed/test/basic.js b/node_modules/read-installed/test/basic.js index 0f833203f..2b0c03983 100644 --- a/node_modules/read-installed/test/basic.js +++ b/node_modules/read-installed/test/basic.js @@ -3,7 +3,7 @@ var util = require("util") console.error("testing") var called = 0 -readInstalled(process.cwd(), function (er, map) { +readInstalled(process.cwd(), console.error, function (er, map) { console.error(called ++) if (er) return console.error(er.stack || er.message) cleanup(map) diff --git a/node_modules/read-package-json/README.md b/node_modules/read-package-json/README.md index 97fb19f13..36b72a26d 100644 --- a/node_modules/read-package-json/README.md +++ b/node_modules/read-package-json/README.md @@ -17,7 +17,8 @@ npm will see when it looks at your package. ```javascript var readJson = require('read-package-json') -readJson('/path/to/package.json', function (er, data) { +// readJson(filename, [logFunction=noop], [strict=false], cb) +readJson('/path/to/package.json', console.error, false, function (er, data) { if (er) { console.error("There was an error reading the file") return @@ -27,10 +28,13 @@ readJson('/path/to/package.json', function (er, data) { } ``` -## readJson(file, cb) +## readJson(file, [logFn = noop], [strict = false], cb) * `file` {String} The path to the package.json file -* `cb` {Function} +* `logFn` {Function} Function to handle logging. Defaults to a noop. +* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and + other strict requirements. +* `cb` {Function} Gets called with `(er, data)`, as is The Node Way. Reads the JSON file and does the things. diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/README.md b/node_modules/read-package-json/node_modules/normalize-package-data/README.md index 5712bd9ee..71fa95065 100644 --- a/node_modules/read-package-json/node_modules/normalize-package-data/README.md +++ b/node_modules/read-package-json/node_modules/normalize-package-data/README.md @@ -56,6 +56,7 @@ If the supplied data has an invalid name or version vield, `normalizeData` will * If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. * If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed. * If `homepage` field is not a string, it will be removed. +* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`. ### Rules for name field diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js b/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js index b42b30eee..d322a31b4 100644 --- a/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js +++ b/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js @@ -3,15 +3,19 @@ var parseGitHubURL = require("github-url-from-git") var depTypes = ["dependencies","devDependencies","optionalDependencies"] var extractDescription = require("./extract_description") var url = require("url") +var typos = require("./typos") var fixer = module.exports = { + // default warning function + warn: function() {}, + fixRepositoryField: function(data) { if (data.repositories) { this.warn("'repositories' (plural) Not supported.\n" + "Please pick one as the 'repository' field"); data.repository = data.repositories[0] } - if (!data.repository) return; + if (!data.repository) return this.warn('No repository field.') if (typeof data.repository === "string") { data.repository = { type: "git", @@ -31,11 +35,44 @@ var fixer = module.exports = { } } +, fixTypos: function(data) { + Object.keys(typos.topLevel).forEach(function (d) { + if (data.hasOwnProperty(d)) { + this.warn(makeTypoWarning(d, typos.topLevel[d])) + } + }, this) + } + +, fixScriptsField: function(data) { + if (!data.scripts) return + if (typeof data.scripts !== "object") { + this.warn("scripts must be an object") + delete data.scripts + } + Object.keys(data.scripts).forEach(function (k) { + if (typeof data.scripts[k] !== "string") { + this.warn("script values must be string commands") + delete data.scripts[k] + } else if (typos.script[k]) { + this.warn(makeTypoWarning(k, typos.script[k], "scripts")) + } + }, this) + } + , fixFilesField: function(data) { var files = data.files if (files && !Array.isArray(files)) { this.warn("Invalid 'files' member") delete data.files + } else if (data.files) { + data.files = data.files.filter(function(file) { + if (!file || typeof file !== "string") { + this.warn("Invalid filename in 'files' list: " + file) + return false + } else { + return true + } + }, this) } } @@ -61,29 +98,83 @@ var fixer = module.exports = { data[bd] = data[bdd] delete data[bdd] } + if (data[bd] && !Array.isArray(data[bd])) { + this.warn("Invalid 'bundleDependencies' list. " + + "Must be array of package names") + delete data[bd] + } else if (data[bd]) { + data[bd] = data[bd].filter(function(bd) { + if (!bd || typeof bd !== 'string') { + this.warn("Invalid bundleDependencies member: " + bd) + return false + } else { + return true + } + }, this) + } } -, fixDependencies: function(data) { +, fixDependencies: function(data, strict) { + var loose = !strict objectifyDeps(data, this.warn) addOptionalDepsToDeps(data, this.warn) this.fixBundleDependenciesField(data) + + ;['dependencies','devDependencies'].forEach(function(deps) { + if (!(deps in data)) return + if (!data[deps] || typeof data[deps] !== "object") { + this.warn(deps + " field must be an object") + delete data[deps] + return + } + Object.keys(data[deps]).forEach(function (d) { + var r = data[deps][d] + if (typeof r !== 'string') { + this.warn('Invalid dependency: ' + d + ' ' + JSON.stringify(r)) + delete data[deps][d] + } + }, this) + }, this) } -, fixKeywordsField: function (data, warn) { +, fixModulesField: function (data) { + if (data.modules) { + this.warn("modules field is deprecated") + delete data.modules + } + } + +, fixKeywordsField: function (data) { if (typeof data.keywords === "string") { data.keywords = data.keywords.split(/,\s+/) } + if (data.keywords && !Array.isArray(data.keywords)) { + delete data.keywords + this.warn("keywords should be an array of strings") + } else if (data.keywords) { + data.keywords = data.keywords.filter(function(kw) { + if (typeof kw !== "string" || !kw) { + this.warn("keywords should be an array of strings"); + return false + } else { + return true + } + }, this) + } } -, fixVersionField: function(data) { +, fixVersionField: function(data, strict) { + // allow "loose" semver 1.0 versions in non-strict mode + // enforce strict semver 2.0 compliance in strict mode + var loose = !strict if (!data.version) { data.version = "" return true } - if (!semver.valid(data.version)) { - throw new Error("invalid version: "+ data.version) + if (!semver.valid(data.version, loose)) { + throw new Error('Invalid version: "'+ data.version + '"') } - data.version = semver.clean(data.version) + data.version = semver.clean(data.version, loose) return true } @@ -92,16 +183,17 @@ var fixer = module.exports = { modifyPeople(data, parsePerson) } -, fixNameField: function(data) { - if (!data.name) { +, fixNameField: function(data, strict) { + if (!data.name && !strict) { data.name = "" - return true + return } if (typeof data.name !== "string") { throw new Error("name field must be a string.") } - data.name = data.name.trim() - ensureValidName(data.name) + if (!strict) + data.name = data.name.trim() + ensureValidName(data.name, strict) } @@ -112,10 +204,14 @@ var fixer = module.exports = { } if (data.readme && !data.description) data.description = extractDescription(data.readme) + if (!data.description) this.warn('No description') } , fixReadmeField: function (data) { - if (!data.readme) data.readme = "ERROR: No README data found!" + if (!data.readme) { + this.warn("No README data") + data.readme = "ERROR: No README data found!" + } } , fixBugsField: function(data) { @@ -139,6 +235,7 @@ var fixer = module.exports = { this.warn("Bug string field must be url, email, or {email,url}") } else { + bugsTypos(data.bugs, this.warn) var oldBugs = data.bugs data.bugs = {} if(oldBugs.url) { @@ -163,17 +260,22 @@ var fixer = module.exports = { , fixHomepageField: function(data) { if(!data.homepage) return true; - if(typeof data.homepage !== "string" || !url.parse(data.homepage).protocol) { + if(typeof data.homepage !== "string") { this.warn("homepage field must be a string url. Deleted.") - delete data.homepage + return delete data.homepage + } + if(!url.parse(data.homepage).protocol) { + this.warn("homepage field must start with a protocol.") + data.homepage = "http://" + data.homepage } } } -function ensureValidName (name) { +function ensureValidName (name, strict) { if (name.charAt(0) === "." || name.match(/[\/@\s\+%:]/) || name !== encodeURIComponent(name) || + (strict && name !== name.toLowerCase()) || name.toLowerCase() === "node_modules" || name.toLowerCase() === "favicon.ico") { throw new Error("Invalid name: " + JSON.stringify(name)) @@ -247,3 +349,22 @@ function objectifyDeps (data, warn) { data[type] = depObjectify(data[type]) }) } + +function bugsTypos(bugs, warn) { + if (!bugs) return + Object.keys(bugs).forEach(function (k) { + if (typos.bugs[k]) { + warn(makeTypoWarning(k, typos.bugs[k], "bugs")) + bugs[typos.bugs[k]] = bugs[k] + delete bugs[k] + } + }) +} + +function makeTypoWarning (providedName, probableName, field) { + if (field) { + providedName = field + "['" + providedName + "']" + probableName = field + "['" + probableName + "']" + } + return providedName + " should probably be " + probableName + "." +} diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/lib/is_valid.js b/node_modules/read-package-json/node_modules/normalize-package-data/lib/is_valid.js deleted file mode 100644 index 509fab491..000000000 --- a/node_modules/read-package-json/node_modules/normalize-package-data/lib/is_valid.js +++ /dev/null @@ -1,58 +0,0 @@ -// a warning for deprecated or likely-incorrect fields - -module.exports = isValid - -var typos = require("./typos") - -function isValid (data, warnFunc) { - var hasWarned = false - function warn(msg) { - hasWarned = true - if(warnFunc) warnFunc(msg) - } - if (data.modules) warn("'modules' is deprecated") - Object.keys(typos.topLevel).forEach(function (d) { - if (data.hasOwnProperty(d)) { - warn(makeTypoWarning(d, typos.topLevel[d])) - } - }) - checkBugsField(data.bugs, warn) - checkScriptsField(data.scripts, warn) - if (!data.repository) warn("No repository field.") - if (!data.readme) warn("No readme data.") - if (data.description && typeof data.description !== 'string') { - warn("'description' field should be a string") - } - if (data[data.bundledDependencies] && - !Array.isArray(data.bundleDependencies)) { - warn("bundleDependencies must be an array") - } - return !hasWarned -} - -function checkBugsField (bugs, warn) { - if (!bugs || typeof bugs !== "object") return - Object.keys(bugs).forEach(function (k) { - if (typos.bugs[k]) { - bugs[typos.bugs[k]] = bugs[k] - delete bugs[k] - } - }) -} - -function checkScriptsField (scripts, warn) { - if (!scripts || typeof scripts !== "object") return - Object.keys(scripts).forEach(function (k) { - if (typos.script[k]) { - warn(makeTypoWarning(k, typos.script[k], "scripts")) - } - }) -} - -function makeTypoWarning (providedName, probableName, field) { - if (field) { - providedName = field + "['" + providedName + "']" - probableName = field + "['" + probableName + "']" - } - return providedName + " should probably be " + probableName + "." -} diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js b/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js index 336334a47..5ff5b6395 100644 --- a/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js +++ b/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js @@ -1,11 +1,10 @@ module.exports = normalize -var isValid = require("./is_valid") var fixer = require("./fixer") -var fieldsToFix = ['name','version','description','repository' +var fieldsToFix = ['name','version','description','repository','modules','scripts' ,'files','bin','man','bugs','keywords','readme','homepage'] -var otherThingsToFix = ['dependencies','people'] +var otherThingsToFix = ['dependencies','people', 'typos'] var thingsToFix = fieldsToFix.map(function(fieldName) { return ucFirst(fieldName) + "Field" @@ -15,9 +14,11 @@ var thingsToFix = fieldsToFix.map(function(fieldName) { // thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) thingsToFix = thingsToFix.concat(otherThingsToFix) -function normalize (data, warn) { +function normalize (data, warn, strict) { + if(warn === true) warn = null, strict = true + if(!strict) strict = false if(!warn) warn = function(msg) { /* noop */ } - isValid(data, warn) // don't care if it's valid, we'll make it valid + if (data.scripts && data.scripts.install === "node-gyp rebuild" && !data.scripts.preinstall) { @@ -25,10 +26,9 @@ function normalize (data, warn) { } fixer.warn = warn thingsToFix.forEach(function(thingName) { - fixer["fix" + ucFirst(thingName)](data) + fixer["fix" + ucFirst(thingName)](data, strict) }) data._id = data.name + "@" + data.version - if (data.modules) delete data.modules // modules field is deprecated } function ucFirst (string) { diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json b/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json index dd2ec6614..6dc59e6a9 100644 --- a/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json +++ b/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json @@ -17,7 +17,8 @@ ,"autor": "author" ,"contributers": "contributors" ,"publicationConfig": "publishConfig" + ,"script": "scripts" }, "bugs": { "web": "url", "name": "url" }, "script": { "server": "start", "tests": "test" } -}
\ No newline at end of file +} diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/package.json b/node_modules/read-package-json/node_modules/normalize-package-data/package.json index 0479feac5..cf8acaaf9 100644 --- a/node_modules/read-package-json/node_modules/normalize-package-data/package.json +++ b/node_modules/read-package-json/node_modules/normalize-package-data/package.json @@ -1,6 +1,6 @@ { "name": "normalize-package-data", - "version": "0.1.6", + "version": "0.2.0", "author": { "name": "Meryn Stol", "email": "merynstol@gmail.com" @@ -15,7 +15,7 @@ "test": "tap test/*.js" }, "dependencies": { - "semver": "1.x", + "semver": "2", "github-url-from-git": "~1.1.1" }, "devDependencies": { @@ -33,11 +33,11 @@ "email": "merynstol@gmail.com" } ], - "readme": "# normalize-package-data [![Build Status](https://travis-ci.org/meryn/normalize-package-data.png?branch=master)](https://travis-ci.org/meryn/normalize-package-data)\n\nnormalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.\n\nnormalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.\n\n## Installation\n\n```\nnpm install normalize-package-data\n```\n\n## Usage\n\nBasic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nnormalizeData(packageData)\n// packageData is now normalized\n```\n\nOptionally, you may pass a \"warning\" function. It gets called whenever the normalizeData function encounters something that doesn't look right. It indicates less than perfect input data.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, warnFn)\n// packageData is now normalized. Any number of warnings may have been logged.\n```\n\nIf you don't provide a warning function, `normalizeData` functions silently.\n\n### Potential exceptions\n\nIf the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.\n\n## What normalization (currently) entails\n\n* The value of `name` field gets trimmed.\n* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n* If `name` and/or `version` fields are missing, they are set to empty strings.\n* If `files` field is not an array, it will be removed.\n* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.\n* If `man` field is a string, it will become an array with the original string as its sole member.\n* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\\s+`.\n* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.\n* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.\n* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.\n* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.\n* If `description` field does not exists, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.\n* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `\"git\"`.\n* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.\n* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.\n* If `homepage` field is not a string, it will be removed.\n\n### Rules for name field\n\nIf `name` field is given, the value of the name field must be a string. The string may not:\n\n* start with a period.\n* contain the following characters: `/@\\s+%`\n* contain and characters that would need to be encoded for use in urls.\n* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).\n\n### Rules for version field\n\nIf `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n\n## Credits\n\nThis package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.\n\n## License\n\nnormalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). \nCopyright (c) 2013 Meryn Stol ", + "readme": "# normalize-package-data [![Build Status](https://travis-ci.org/meryn/normalize-package-data.png?branch=master)](https://travis-ci.org/meryn/normalize-package-data)\n\nnormalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.\n\nnormalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.\n\n## Installation\n\n```\nnpm install normalize-package-data\n```\n\n## Usage\n\nBasic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nnormalizeData(packageData)\n// packageData is now normalized\n```\n\nOptionally, you may pass a \"warning\" function. It gets called whenever the normalizeData function encounters something that doesn't look right. It indicates less than perfect input data.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, warnFn)\n// packageData is now normalized. Any number of warnings may have been logged.\n```\n\nIf you don't provide a warning function, `normalizeData` functions silently.\n\n### Potential exceptions\n\nIf the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.\n\n## What normalization (currently) entails\n\n* The value of `name` field gets trimmed.\n* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n* If `name` and/or `version` fields are missing, they are set to empty strings.\n* If `files` field is not an array, it will be removed.\n* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.\n* If `man` field is a string, it will become an array with the original string as its sole member.\n* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\\s+`.\n* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.\n* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.\n* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.\n* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.\n* If `description` field does not exists, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.\n* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `\"git\"`.\n* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.\n* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.\n* If `homepage` field is not a string, it will be removed.\n* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.\n\n### Rules for name field\n\nIf `name` field is given, the value of the name field must be a string. The string may not:\n\n* start with a period.\n* contain the following characters: `/@\\s+%`\n* contain and characters that would need to be encoded for use in urls.\n* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).\n\n### Rules for version field\n\nIf `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n\n## Credits\n\nThis package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.\n\n## License\n\nnormalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). \nCopyright (c) 2013 Meryn Stol ", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/meryn/normalize-package-data/issues" }, - "_id": "normalize-package-data@0.1.6", - "_from": "normalize-package-data@~0.1.2" + "_id": "normalize-package-data@0.2.0", + "_from": "normalize-package-data@~0.2" } diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js b/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js index b015a6a49..099faf3f7 100644 --- a/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js +++ b/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js @@ -47,7 +47,11 @@ tap.test("empty object", function(t) { } normalize(packageData, warn) t.same(packageData, expect) - t.same(warnings, ["No repository field.","No readme data."]) + t.same(warnings, [ + "No description", + "No repository field.", + "No README data" + ]) t.end() }) @@ -65,7 +69,7 @@ tap.test("urls required", function(t) { var a normalize(a={ readme: "read yourself how about", - homepage: "stragle planarf", + homepage: 123, bugs: "what is this i don't even", repository: "Hello." }, warn) @@ -73,18 +77,41 @@ tap.test("urls required", function(t) { console.error(a) var expect = - [ 'No repository field.', - 'No readme data.', - 'bugs.url field must be a string url. Deleted.', - 'bugs.email field must be a string email. Deleted.', - 'Normalized value of bugs field is an empty object. Deleted.', - 'Bug string field must be url, email, or {email,url}', - 'Normalized value of bugs field is an empty object. Deleted.', - 'homepage field must be a string url. Deleted.' ] + [ "No description", + "No repository field.", + "bugs.url field must be a string url. Deleted.", + "bugs.email field must be a string email. Deleted.", + "Normalized value of bugs field is an empty object. Deleted.", + "No README data", + "Bug string field must be url, email, or {email,url}", + "Normalized value of bugs field is an empty object. Deleted.", + "homepage field must be a string url. Deleted." ] t.same(warnings, expect) t.end() }) +tap.test("homepage field must start with a protocol.", function(t) { + var warnings = [] + function warn(w) { + warnings.push(w) + } + var a + normalize(a={ + homepage: 'example.org' + }, warn) + + console.error(a) + + var expect = + [ "No description", + "No repository field.", + "No README data", + "homepage field must start with a protocol." ] + t.same(warnings, expect) + t.same(a.homepage, 'http://example.org') + t.end() +}) + tap.test("gist bugs url", function(t) { var d = { repository: "git@gist.github.com:123456.git" @@ -95,14 +122,14 @@ tap.test("gist bugs url", function(t) { t.end(); }); -tap.test('no new globals', function(t) { - t.same(Object.keys(global), globals) - t.end() -}) - tap.test("singularize repositories", function(t) { - d = {repositories:["git@gist.github.com:123456.git"]} + var d = {repositories:["git@gist.github.com:123456.git"]} normalize(d) t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' }) t.end() -});
\ No newline at end of file +}); + +tap.test('no new globals', function(t) { + t.same(Object.keys(global), globals) + t.end() +}) diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/test/strict.js b/node_modules/read-package-json/node_modules/normalize-package-data/test/strict.js new file mode 100644 index 000000000..40e09dcf2 --- /dev/null +++ b/node_modules/read-package-json/node_modules/normalize-package-data/test/strict.js @@ -0,0 +1,54 @@ +var test = require("tap").test + +var normalize = require("../") + +test("strict", function(t) { + var threw + + try { + threw = false + normalize({name: "X"}, true) + } catch (er) { + threw = true + t.equal(er.message, 'Invalid name: "X"') + } finally { + t.equal(threw, true) + } + + try { + threw = false + normalize({name:" x "}, true) + } catch (er) { + threw = true + t.equal(er.message, 'Invalid name: " x "') + } finally { + t.equal(threw, true) + } + + try { + threw = false + normalize({name:"x",version:"01.02.03"}, true) + } catch (er) { + threw = true + t.equal(er.message, 'Invalid version: "01.02.03"') + } finally { + t.equal(threw, true) + } + + // these should not throw + var slob = {name:" X ",version:"01.02.03",dependencies:{ + y:">01.02.03", + z:"! 99 $$ASFJ(Aawenf90awenf as;naw.3j3qnraw || an elephant" + }} + normalize(slob, false) + t.same(slob, + { name: 'X', + version: '1.2.3', + dependencies: + { y: '>01.02.03', + z: '! 99 $$ASFJ(Aawenf90awenf as;naw.3j3qnraw || an elephant' }, + readme: 'ERROR: No README data found!', + _id: 'X@1.2.3' }) + + t.end() +}) diff --git a/node_modules/read-package-json/node_modules/normalize-package-data/test/typo.js b/node_modules/read-package-json/node_modules/normalize-package-data/test/typo.js index d7d3af0e2..72932e949 100644 --- a/node_modules/read-package-json/node_modules/normalize-package-data/test/typo.js +++ b/node_modules/read-package-json/node_modules/normalize-package-data/test/typo.js @@ -9,7 +9,8 @@ test('typos', function(t) { } var expect = - [ 'dependancies should probably be dependencies.', + [ 'No repository field.', + 'dependancies should probably be dependencies.', 'dependecies should probably be dependencies.', 'depdenencies should probably be dependencies.', 'devEependencies should probably be devDependencies.', @@ -25,14 +26,7 @@ test('typos', function(t) { 'autohr should probably be author.', 'autor should probably be author.', 'contributers should probably be contributors.', - 'publicationConfig should probably be publishConfig.', - 'No repository field.', - 'No repository field.', - 'No readme data.', - 'bugs.url field must be a string url. Deleted.', - 'Normalized value of bugs field is an empty object. Deleted.', - 'No repository field.', - 'No readme data.' ] + 'publicationConfig should probably be publishConfig.' ] normalize({"dependancies": "dependencies" ,"dependecies": "dependencies" @@ -55,13 +49,50 @@ test('typos', function(t) { ,name:"name" ,version:"1.2.5"}, warn) + t.same(warnings, expect) + + warnings.length = 0 + var expect = + [ 'No description', + 'No repository field.', + 'bugs[\'web\'] should probably be bugs[\'url\'].', + 'bugs[\'name\'] should probably be bugs[\'url\'].', + 'bugs.url field must be a string url. Deleted.', + 'Normalized value of bugs field is an empty object. Deleted.', + "No README data" ] + normalize({name:"name" ,version:"1.2.5" ,bugs:{web:"url",name:"url"}}, warn) + t.same(warnings, expect) + + warnings.length = 0 + var expect = + [ 'No description', + 'No repository field.', + "No README data", + 'script should probably be scripts.' ] + normalize({name:"name" ,version:"1.2.5" ,script:{server:"start",tests:"test"}}, warn) + + t.same(warnings, expect) + + warnings.length = 0 + expect = + [ 'No description', + 'No repository field.', + 'scripts[\'server\'] should probably be scripts[\'start\'].', + 'scripts[\'tests\'] should probably be scripts[\'test\'].', + "No README data" ] + + normalize({name:"name" + ,version:"1.2.5" + ,scripts:{server:"start",tests:"test"}}, warn) + t.same(warnings, expect) + t.end(); }) diff --git a/node_modules/read-package-json/package.json b/node_modules/read-package-json/package.json index 6a2796e0b..45fb140e3 100644 --- a/node_modules/read-package-json/package.json +++ b/node_modules/read-package-json/package.json @@ -1,6 +1,6 @@ { "name": "read-package-json", - "version": "0.4.1", + "version": "1.1.0", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -18,22 +18,20 @@ "dependencies": { "glob": "~3.2.1", "lru-cache": "2", - "normalize-package-data": "~0.1.2", - "npmlog": "0", + "normalize-package-data": "~0.2", "graceful-fs": "~1.2" }, "devDependencies": { "tap": "~0.2.5" }, "optionalDependencies": { - "npmlog": "0", "graceful-fs": "~1.2" }, - "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\nreadJson('/path/to/package.json', function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n}\n```\n\n## readJson(file, cb)\n\n* `file` {String} The path to the package.json file\n* `cb` {Function}\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of `<name> : <filename>` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n", + "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\n// readJson(filename, [logFunction=noop], [strict=false], cb)\nreadJson('/path/to/package.json', console.error, false, function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n}\n```\n\n## readJson(file, [logFn = noop], [strict = false], cb)\n\n* `file` {String} The path to the package.json file\n* `logFn` {Function} Function to handle logging. Defaults to a noop.\n* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and\n other strict requirements.\n* `cb` {Function} Gets called with `(er, data)`, as is The Node Way.\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of `<name> : <filename>` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/read-package-json/issues" }, - "_id": "read-package-json@0.4.1", - "_from": "read-package-json@~0.4.1" + "_id": "read-package-json@1.1.0", + "_from": "read-package-json@1" } diff --git a/node_modules/read-package-json/read-json.js b/node_modules/read-package-json/read-json.js index acb128680..d9a4610d9 100644 --- a/node_modules/read-package-json/read-json.js +++ b/node_modules/read-package-json/read-json.js @@ -1,17 +1,6 @@ // vim: set softtabstop=16 shiftwidth=16: try { - readJson.log = require("npmlog") -} catch (er) { - readJson.log = { - info: function () {}, - verbose: function () {}, - warn: function () {} - } -} - - -try { var fs = require("graceful-fs") } catch (er) { var fs = require("fs") @@ -40,25 +29,33 @@ readJson.extraSet = [ var typoWarned = {} -function readJson (file, cb) { +function readJson (file, log_, strict_, cb_) { + var log, strict, cb + for (var i = 1; i < arguments.length - 1; i++) { + if (typeof arguments[i] === 'boolean') + strict = arguments[i] + else if (typeof arguments[i] === 'function') + log = arguments[i] + } + if (!log) log = function () {}; + cb = arguments[ arguments.length - 1 ] + var c = readJson.cache.get(file) if (c) { - readJson.log.verbose("from cache", file) cb = cb.bind(null, null, c) return process.nextTick(cb); } - readJson.log.verbose("read json", file) cb = (function (orig) { return function (er, data) { if (data) readJson.cache.set(file, data); return orig(er, data) } })(cb) - readJson_(file, cb) + readJson_(file, log, strict, cb) } -function readJson_ (file, cb) { +function readJson_ (file, log, strict, cb) { fs.readFile(file, "utf8", function (er, d) { - parseJson(file, er, d, cb) + parseJson(file, er, d, log, strict, cb) }) } @@ -74,9 +71,9 @@ function stripBOM(content) { } -function parseJson (file, er, d, cb) { +function parseJson (file, er, d, log, strict, cb) { if (er && er.code === "ENOENT") { - indexjs(file, er, cb) + indexjs(file, er, log, strict, cb) return } if (er) return cb(er); @@ -86,11 +83,11 @@ function parseJson (file, er, d, cb) { d = parseIndex(d) if (!d) return cb(parseError(er, file)); } - extras(file, d, cb) + extras(file, d, log, strict, cb) } -function indexjs (file, er, cb) { +function indexjs (file, er, log, strict, cb) { if (path.basename(file) === "index.js") { return cb(er); } @@ -99,13 +96,21 @@ function indexjs (file, er, cb) { if (er2) return cb(er); d = parseIndex(d) if (!d) return cb(er); - extras(file, d, cb) + extras(file, d, log, strict, cb) }) } readJson.extras = extras -function extras (file, data, cb) { +function extras (file, data, log_, strict_, cb_) { + var log, strict, cb + for (var i = 2; i < arguments.length - 1; i++) { + if (typeof arguments[i] === 'boolean') + strict = arguments[i] + else if (typeof arguments[i] === 'function') + log = arguments[i] + } + cb = arguments[i] var set = readJson.extraSet var n = set.length var errState = null @@ -115,7 +120,8 @@ function extras (file, data, cb) { function then(er) { if (errState) return; if (er) return cb(errState = er); - if (--n === 0) final(file, data, cb); + if (--n > 0) return; + final(file, data, log, strict, cb); } } @@ -294,14 +300,14 @@ function githead_ (file, data, dir, head, cb) { }) } -function final (file, data, cb) { +function final (file, data, log, strict, cb) { var pId = makePackageId(data) function warn(msg) { if (typoWarned[pId]) return; - readJson.log.warn("package.json", pId, msg) + if (log) log("package.json", pId, msg); } try { - normalizeData(data, warn) + normalizeData(data, warn, strict) } catch (error) { return cb(error) diff --git a/node_modules/semver/.npmignore b/node_modules/semver/.npmignore new file mode 100644 index 000000000..7300fbc79 --- /dev/null +++ b/node_modules/semver/.npmignore @@ -0,0 +1 @@ +# nada diff --git a/node_modules/semver/LICENSE b/node_modules/semver/LICENSE index 05a401094..0c44ae716 100644 --- a/node_modules/semver/LICENSE +++ b/node_modules/semver/LICENSE @@ -1,23 +1,27 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +Copyright (c) Isaac Z. Schlueter ("Author") All rights reserved. -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +The BSD License -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/semver/Makefile b/node_modules/semver/Makefile new file mode 100644 index 000000000..e171f70e2 --- /dev/null +++ b/node_modules/semver/Makefile @@ -0,0 +1,24 @@ +files = semver.browser.js \ + semver.min.js \ + semver.browser.js.gz \ + semver.min.js.gz + +all: $(files) + +clean: + rm $(files) + +semver.browser.js: head.js semver.js foot.js + ( cat head.js; \ + cat semver.js | \ + egrep -v '^ *\/\* nomin \*\/' | \ + perl -pi -e 's/debug\([^\)]+\)//g'; \ + cat foot.js ) > semver.browser.js + +semver.min.js: semver.browser.js + uglifyjs -m <semver.browser.js >semver.min.js + +%.gz: % + gzip --stdout -9 <$< >$@ + +.PHONY: all clean diff --git a/node_modules/semver/README.md b/node_modules/semver/README.md index 219300968..a315fe888 100644 --- a/node_modules/semver/README.md +++ b/node_modules/semver/README.md @@ -33,59 +33,50 @@ As a command-line utility: ## Versions -A version is the following things, in this order: - -* a number (Major) -* a period -* a number (minor) -* a period -* a number (patch) -* OPTIONAL: a hyphen, followed by a number (build) -* OPTIONAL: a collection of pretty much any non-whitespace characters - (tag) +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. -## Comparisons - -The ordering of versions is done using the following algorithm, given -two versions and asked to find the greater of the two: - -* If the majors are numerically different, then take the one - with a bigger major number. `2.3.4 > 1.3.4` -* If the minors are numerically different, then take the one - with the bigger minor number. `2.3.4 > 2.2.4` -* If the patches are numerically different, then take the one with the - bigger patch number. `2.3.4 > 2.3.3` -* If only one of them has a build number, then take the one with the - build number. `2.3.4-0 > 2.3.4` -* If they both have build numbers, and the build numbers are numerically - different, then take the one with the bigger build number. - `2.3.4-10 > 2.3.4-9` -* If only one of them has a tag, then take the one without the tag. - `2.3.4 > 2.3.4-beta` -* If they both have tags, then take the one with the lexicographically - larger tag. `2.3.4-beta > 2.3.4-alpha` -* At this point, they're equal. - ## Ranges The following range styles are supported: +* `1.2.3` A specific version. When nothing else will do. Note that + build metadata is still ignored, so `1.2.3+build2012` will satisfy + this range. * `>1.2.3` Greater than a specific version. -* `<1.2.3` Less than +* `<1.2.3` Less than a specific version. If there is no prerelease + tag on the version range, then no prerelease version will be allowed + either, even though these are technically "less than". +* `>=1.2.3` Greater than or equal to. Note that prerelease versions + are NOT equal to their "normal" equivalents, so `1.2.3-beta` will + not satisfy this range, but `2.3.0-beta` will. +* `<=1.2.3` Less than or equal to. In this case, prerelease versions + ARE allowed, so `1.2.3-beta` would satisfy. * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` -* `~1.2.3` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.3.0` -* `~1` := `>=1.0.0 <2.0.0` -* `1.2.x` := `>=1.2.0 <1.3.0` -* `1.x` := `>=1.0.0 <2.0.0` +* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` "Reasonably close to 1.2.3". When + using tilde operators, prerelease versions are supported as well, + but a prerelease of the next significant digit will NOT be + satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. +* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" +* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" +* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" +* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" + Ranges can be joined with either a space (which implies "and") or a `||` (which implies "or"). ## 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, minor, patch, or build), or null if it's not valid. diff --git a/node_modules/semver/foot.js b/node_modules/semver/foot.js new file mode 100644 index 000000000..8f83c20f8 --- /dev/null +++ b/node_modules/semver/foot.js @@ -0,0 +1,6 @@ + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/node_modules/semver/head.js b/node_modules/semver/head.js new file mode 100644 index 000000000..653686517 --- /dev/null +++ b/node_modules/semver/head.js @@ -0,0 +1,2 @@ +;(function(exports) { + diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json index abbfb210b..5ae76a2d5 100644 --- a/node_modules/semver/package.json +++ b/node_modules/semver/package.json @@ -1,18 +1,19 @@ { "name": "semver", - "version": "1.1.4", + "version": "2.0.7", "description": "The semantic version parser used by npm.", "main": "semver.js", + "browser": "semver.browser.js", + "min": "semver.min.js", "scripts": { - "test": "tap test.js" + "test": "tap test/*.js", + "prepublish": "make" }, "devDependencies": { - "tap": "0.x >=0.0.4" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/semver/raw/master/LICENSE" + "tap": "0.x >=0.0.4", + "uglify-js": "~2.3.6" }, + "license": "BSD", "repository": { "type": "git", "url": "git://github.com/isaacs/node-semver.git" @@ -20,8 +21,11 @@ "bin": { "semver": "./bin/semver" }, - "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver -v <version> [-r <range>]\n Test if version(s) satisfy the supplied range(s),\n and sort them.\n\n Multiple versions or ranges may be supplied.\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA version is the following things, in this order:\n\n* a number (Major)\n* a period\n* a number (minor)\n* a period\n* a number (patch)\n* OPTIONAL: a hyphen, followed by a number (build)\n* OPTIONAL: a collection of pretty much any non-whitespace characters\n (tag)\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Comparisons\n\nThe ordering of versions is done using the following algorithm, given\ntwo versions and asked to find the greater of the two:\n\n* If the majors are numerically different, then take the one\n with a bigger major number. `2.3.4 > 1.3.4`\n* If the minors are numerically different, then take the one\n with the bigger minor number. `2.3.4 > 2.2.4`\n* If the patches are numerically different, then take the one with the\n bigger patch number. `2.3.4 > 2.3.3`\n* If only one of them has a build number, then take the one with the\n build number. `2.3.4-0 > 2.3.4`\n* If they both have build numbers, and the build numbers are numerically\n different, then take the one with the bigger build number.\n `2.3.4-10 > 2.3.4-9`\n* If only one of them has a tag, then take the one without the tag.\n `2.3.4 > 2.3.4-beta`\n* If they both have tags, then take the one with the lexicographically\n larger tag. `2.3.4-beta > 2.3.4-alpha`\n* At this point, they're equal.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3 <1.3.0`\n* `~1.2` := `>=1.2.0 <1.3.0`\n* `~1` := `>=1.0.0 <2.0.0`\n* `1.2.x` := `>=1.2.0 <1.3.0`\n* `1.x` := `>=1.0.0 <2.0.0`\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\n* valid(v): Return the parsed version, or null if it's not valid.\n* inc(v, release): Return the version incremented by the release type\n (major, minor, patch, or build), or null if it's not valid.\n\n### Comparison\n\n* gt(v1, v2): `v1 > v2`\n* gte(v1, v2): `v1 >= v2`\n* lt(v1, v2): `v1 < v2`\n* lte(v1, v2): `v1 <= v2`\n* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* neq(v1, v2): `v1 != v2` The opposite of eq.\n* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if\n v2 is greater. Sorts in ascending order if passed to Array.sort().\n* rcompare(v1, v2): The reverse of compare. Sorts an array of versions\n in descending order when passed to Array.sort().\n\n\n### Ranges\n\n* validRange(range): Return the valid range or null if it's not valid\n* satisfies(version, range): Return true if the version satisfies the\n range.\n* maxSatisfying(versions, range): Return the highest version in the list\n that satisfies the range, or null if none of them do.\n", + "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver -v <version> [-r <range>]\n Test if version(s) satisfy the supplied range(s),\n and sort them.\n\n Multiple versions or ranges may be supplied.\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA \"version\" is described by the v2.0.0 specification found at\n<http://semver.org/>.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `1.2.3` A specific version. When nothing else will do. Note that\n build metadata is still ignored, so `1.2.3+build2012` will satisfy\n this range.\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than a specific version. If there is no prerelease\n tag on the version range, then no prerelease version will be allowed\n either, even though these are technically \"less than\".\n* `>=1.2.3` Greater than or equal to. Note that prerelease versions\n are NOT equal to their \"normal\" equivalents, so `1.2.3-beta` will\n not satisfy this range, but `2.3.0-beta` will.\n* `<=1.2.3` Less than or equal to. In this case, prerelease versions\n ARE allowed, so `1.2.3-beta` would satisfy.\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` \"Reasonably close to 1.2.3\". When\n using tilde operators, prerelease versions are supported as well,\n but a prerelease of the next significant digit will NOT be\n satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.\n* `~1.2` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `1.2.x` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `~1` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n* `1.x` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\nAll methods and classes take a final `loose` boolean argument that, if\ntrue, will be more forgiving about not-quite-valid semver strings.\nThe resulting output will always be 100% strict, of course.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* valid(v): Return the parsed version, or null if it's not valid.\n* inc(v, release): Return the version incremented by the release type\n (major, minor, patch, or build), or null if it's not valid.\n\n### Comparison\n\n* gt(v1, v2): `v1 > v2`\n* gte(v1, v2): `v1 >= v2`\n* lt(v1, v2): `v1 < v2`\n* lte(v1, v2): `v1 <= v2`\n* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* neq(v1, v2): `v1 != v2` The opposite of eq.\n* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if\n v2 is greater. Sorts in ascending order if passed to Array.sort().\n* rcompare(v1, v2): The reverse of compare. Sorts an array of versions\n in descending order when passed to Array.sort().\n\n\n### Ranges\n\n* validRange(range): Return the valid range or null if it's not valid\n* satisfies(version, range): Return true if the version satisfies the\n range.\n* maxSatisfying(versions, range): Return the highest version in the list\n that satisfies the range, or null if none of them do.\n", "readmeFilename": "README.md", - "_id": "semver@1.1.4", - "_from": "semver@1.1.4" + "bugs": { + "url": "https://github.com/isaacs/node-semver/issues" + }, + "_id": "semver@2.0.7", + "_from": "semver@latest" } diff --git a/node_modules/semver/semver.browser.js b/node_modules/semver/semver.browser.js new file mode 100644 index 000000000..f5229487c --- /dev/null +++ b/node_modules/semver/semver.browser.js @@ -0,0 +1,850 @@ +;(function(exports) { + +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:(' + src[PRERELEASE] + ')' + + ')?)?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:(' + src[PRERELEASELOOSE] + ')' + + ')?)?)?'; + +// >=2.x, for example, means >=2.0.0-0 +// <1.x would be the same as "<1.0.0-0", though. +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = src[LONETILDE] + '\s+'; +var tildeTrimReplace = '$1'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); + +var comparatorTrimReplace = '$1$2 '; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + ; + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version, loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + ; + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return '<SemVer "' + this + '">'; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + ; + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.lenth && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + ; + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +SemVer.prototype.inc = function(release) { + switch (release) { + case 'major': + this.major++; + this.minor = -1; + case 'minor': + this.minor++; + this.patch = -1; + case 'patch': + this.patch++; + this.prerelease = []; + break; + case 'prerelease': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose) { + try { + return new SemVer(version, loose).inc(release).version; + } catch (er) { + return null; + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': ret = a === b; break; + case '!==': ret = a !== b; break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + ; + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else { + this.semver = new SemVer(m[2], this.loose); + + // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) + // >=1.2.3 DOES NOT allow 1.2.3-beta + // <=1.2.3 DOES allow 1.2.3-beta + // However, <1.2.3 does NOT allow 1.2.3-beta, + // even though `1.2.3-beta < 1.2.3` + // The assumption is that the 1.2.3 version has something you + // *don't* want, so we push the prerelease down to the minimum. + if (this.operator === '<' && !this.semver.prerelease.length) { + this.semver.prerelease = ['0']; + this.semver.format(); + } + } +}; + +Comparator.prototype.inspect = function() { + return '<SemVer Comparator "' + this + '">'; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + ; + return (this.semver === ANY) ? true : + cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return '<SemVer Range "' + this.range + '">'; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + ; + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + ; + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + ; + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + ; + comp = replaceTildes(comp, loose); + ; + comp = replaceXRanges(comp, loose); + ; + comp = replaceStars(comp, loose); + ; + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else if (pr) { + ; + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0-0'; + } else + // ~1.2.3 == >=1.2.3-0 <1.3.0-0 + ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + M + '.' + (+m + 1) + '.0-0'; + + ; + return ret; + }); +} + +function replaceXRanges(comp, loose) { + ; + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + ; + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (gtlt && anyX) { + // replace X with 0, and then append the -0 min-prerelease + if (xM) + M = 0; + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0-0 + // >1.2 => >=1.3.0-0 + // >1.2.3 => >= 1.2.4-0 + gtlt = '>='; + if (xM) { + // no change + } else if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } + + + ret = gtlt + M + '.' + m + '.' + p + '-0'; + } else if (xM) { + // allow any + ret = '*'; + } else if (xm) { + // append '-0' onto the version, otherwise + // '1.x.x' matches '2.0.0-beta', since the tag + // *lowers* the version value + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + } + + ; + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + ; + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0-0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0-0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0-0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(compare)[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/node_modules/semver/semver.browser.js.gz b/node_modules/semver/semver.browser.js.gz Binary files differnew file mode 100644 index 000000000..01c4caeed --- /dev/null +++ b/node_modules/semver/semver.browser.js.gz diff --git a/node_modules/semver/semver.js b/node_modules/semver/semver.js index cebfe6fd1..aa1b518f1 100644 --- a/node_modules/semver/semver.js +++ b/node_modules/semver/semver.js @@ -1,158 +1,657 @@ -;(function (exports) { // nothing in here is node-specific. - -// See http://semver.org/ -// This implementation is a *hair* less strict in that it allows -// v1.2.3 things, and also tags that don't begin with a char. - -var semver = "\\s*[v=]*\\s*([0-9]+)" // major - + "\\.([0-9]+)" // minor - + "\\.([0-9]+)" // patch - + "(-[0-9]+-?)?" // build - + "([a-zA-Z-+][a-zA-Z0-9-\.:]*)?" // tag - , exprComparator = "^((<|>)?=?)\s*("+semver+")$|^$" - , xRangePlain = "[v=]*([0-9]+|x|X|\\*)" - + "(?:\\.([0-9]+|x|X|\\*)" - + "(?:\\.([0-9]+|x|X|\\*)" - + "([a-zA-Z-][a-zA-Z0-9-\.:]*)?)?)?" - , xRange = "((?:<|>)=?)?\\s*" + xRangePlain - , exprLoneSpermy = "(?:~>?)" - , exprSpermy = exprLoneSpermy + xRange - , expressions = exports.expressions = - { parse : new RegExp("^\\s*"+semver+"\\s*$") - , parsePackage : new RegExp("^\\s*([^\/]+)[-@](" +semver+")\\s*$") - , parseRange : new RegExp( - "^\\s*(" + semver + ")\\s+-\\s+(" + semver + ")\\s*$") - , validComparator : new RegExp("^"+exprComparator+"$") - , parseXRange : new RegExp("^"+xRange+"$") - , parseSpermy : new RegExp("^"+exprSpermy+"$") - } +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. +/* nomin */ var debug; +/* nomin */ if (typeof process === 'object' && + /* nomin */ process.env && + /* nomin */ process.env.NODE_DEBUG && + /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) + /* nomin */ debug = function() { + /* nomin */ var args = Array.prototype.slice.call(arguments, 0); + /* nomin */ args.unshift('SEMVER'); + /* nomin */ console.log.apply(console, args); + /* nomin */ }; +/* nomin */ else + /* nomin */ debug = function() {}; + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:(' + src[PRERELEASE] + ')' + + ')?)?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:(' + src[PRERELEASELOOSE] + ')' + + ')?)?)?'; + +// >=2.x, for example, means >=2.0.0-0 +// <1.x would be the same as "<1.0.0-0", though. +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = src[LONETILDE] + '\s+'; +var tildeTrimReplace = '$1'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); + +var comparatorTrimReplace = '$1$2 '; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} -Object.getOwnPropertyNames(expressions).forEach(function (i) { - exports[i] = function (str) { - return ("" + (str || "")).match(expressions[i]) +exports.clean = clean; +function clean(version, loose) { + var s = parse(version, loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; } -}) - -exports.rangeReplace = ">=$1 <=$7" -exports.clean = clean -exports.compare = compare -exports.rcompare = rcompare -exports.satisfies = satisfies -exports.gt = gt -exports.gte = gte -exports.lt = lt -exports.lte = lte -exports.eq = eq -exports.neq = neq -exports.cmp = cmp -exports.inc = inc - -exports.valid = valid -exports.validPackage = validPackage -exports.validRange = validRange -exports.maxSatisfying = maxSatisfying - -exports.replaceStars = replaceStars -exports.toComparators = toComparators - -function stringify (version) { - var v = version - return [v[1]||'', v[2]||'', v[3]||''].join(".") + (v[4]||'') + (v[5]||'') -} - -function clean (version) { - version = exports.parse(version) - if (!version) return version - return stringify(version) -} - -function valid (version) { - if (typeof version !== "string") return null - return exports.parse(version) && version.trim().replace(/^[v=]+/, '') -} - -function validPackage (version) { - if (typeof version !== "string") return null - return version.match(expressions.parsePackage) && version.trim() -} - -// range can be one of: -// "1.0.3 - 2.0.0" range, inclusive, like ">=1.0.3 <=2.0.0" -// ">1.0.2" like 1.0.3 - 9999.9999.9999 -// ">=1.0.2" like 1.0.2 - 9999.9999.9999 -// "<2.0.0" like 0.0.0 - 1.9999.9999 -// ">1.0.2 <2.0.0" like 1.0.3 - 1.9999.9999 -var starExpression = /(<|>)?=?\s*\*/g - , starReplace = "" - , compTrimExpression = new RegExp("((<|>)?=|<|>)\\s*(" - +semver+"|"+xRangePlain+")", "g") - , compTrimReplace = "$1$3" - -function toComparators (range) { - var ret = (range || "").trim() - .replace(expressions.parseRange, exports.rangeReplace) - .replace(compTrimExpression, compTrimReplace) - .split(/\s+/) - .join(" ") - .split("||") - .map(function (orchunk) { - return orchunk - .replace(new RegExp("(" + exprLoneSpermy + ")\\s+"), "$1") - .split(" ") - .map(replaceXRanges) - .map(replaceSpermies) - .map(replaceStars) - .join(" ").trim() - }) - .map(function (orchunk) { - return orchunk - .trim() - .split(/\s+/) - .filter(function (c) { return c.match(expressions.validComparator) }) - }) - .filter(function (c) { return c.length }) - return ret -} - -function replaceStars (stars) { - return stars.trim().replace(starExpression, starReplace) -} - -// "2.x","2.x.x" --> ">=2.0.0- <2.1.0-" -// "2.3.x" --> ">=2.3.0- <2.4.0-" -function replaceXRanges (ranges) { - return ranges.split(/\s+/) - .map(replaceXRange) - .join(" ") -} - -function replaceXRange (version) { - return version.trim().replace(expressions.parseXRange, - function (v, gtlt, M, m, p, t) { - var anyX = !M || M.toLowerCase() === "x" || M === "*" - || !m || m.toLowerCase() === "x" || m === "*" - || !p || p.toLowerCase() === "x" || p === "*" - , ret = v - if (gtlt && anyX) { - // just replace x'es with zeroes - ;(!M || M === "*" || M.toLowerCase() === "x") && (M = 0) - ;(!m || m === "*" || m.toLowerCase() === "x") && (m = 0) - ;(!p || p === "*" || p.toLowerCase() === "x") && (p = 0) - ret = gtlt + M+"."+m+"."+p+"-" - } else if (!M || M === "*" || M.toLowerCase() === "x") { - ret = "*" // allow any - } else if (!m || m === "*" || m.toLowerCase() === "x") { - // append "-" onto the version, otherwise - // "1.x.x" matches "2.0.0beta", since the tag - // *lowers* the version value - ret = ">="+M+".0.0- <"+(+M+1)+".0.0-" - } else if (!p || p === "*" || p.toLowerCase() === "x") { - ret = ">="+M+"."+m+".0- <"+M+"."+(+m+1)+".0-" + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + debug('SemVer', version, loose); + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return '<SemVer "' + this + '">'; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + debug('SemVer.compare', this.version, this.loose, other); + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.lenth && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +SemVer.prototype.inc = function(release) { + switch (release) { + case 'major': + this.major++; + this.minor = -1; + case 'minor': + this.minor++; + this.patch = -1; + case 'patch': + this.patch++; + this.prerelease = []; + break; + case 'prerelease': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose) { + try { + return new SemVer(version, loose).inc(release).version; + } catch (er) { + return null; + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': ret = a === b; break; + case '!==': ret = a !== b; break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + debug('comparator', comp, loose); + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else { + this.semver = new SemVer(m[2], this.loose); + + // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) + // >=1.2.3 DOES NOT allow 1.2.3-beta + // <=1.2.3 DOES allow 1.2.3-beta + // However, <1.2.3 does NOT allow 1.2.3-beta, + // even though `1.2.3-beta < 1.2.3` + // The assumption is that the 1.2.3 version has something you + // *don't* want, so we push the prerelease down to the minimum. + if (this.operator === '<' && !this.semver.prerelease.length) { + this.semver.prerelease = ['0']; + this.semver.format(); } - return ret - }) + } +}; + +Comparator.prototype.inspect = function() { + return '<SemVer Comparator "' + this + '">'; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + debug('Comparator.test', version, this.loose); + return (this.semver === ANY) ? true : + cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return '<SemVer Range "' + this.range + '">'; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + debug('range', range, loose); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range); + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + debug('comp', comp); + comp = replaceTildes(comp, loose); + debug('tildes', comp); + comp = replaceXRanges(comp, loose); + debug('xrange', comp); + comp = replaceStars(comp, loose); + debug('stars', comp); + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; } // ~, ~> --> * (any, kinda silly) @@ -161,146 +660,195 @@ function replaceXRange (version) { // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceSpermies (version) { - return version.trim().replace(expressions.parseSpermy, - function (v, gtlt, M, m, p, t) { - if (gtlt) throw new Error( - "Using '"+gtlt+"' with ~ makes no sense. Don't do it.") - - if (!M || M.toLowerCase() === "x") { - return "" - } - // ~1 == >=1.0.0- <2.0.0- - if (!m || m.toLowerCase() === "x") { - return ">="+M+".0.0- <"+(+M+1)+".0.0-" - } - // ~1.2 == >=1.2.0- <1.3.0- - if (!p || p.toLowerCase() === "x") { - return ">="+M+"."+m+".0- <"+M+"."+(+m+1)+".0-" - } - // ~1.2.3 == >=1.2.3- <1.3.0- - t = t || "-" - return ">="+M+"."+m+"."+p+t+" <"+M+"."+(+m+1)+".0-" - }) -} - -function validRange (range) { - range = replaceStars(range) - var c = toComparators(range) - return (c.length === 0) - ? null - : c.map(function (c) { return c.join(" ") }).join("||") -} - -// returns the highest satisfying version in the list, or undefined -function maxSatisfying (versions, range) { - return versions - .filter(function (v) { return satisfies(v, range) }) - .sort(compare) - .pop() -} -function satisfies (version, range) { - version = valid(version) - if (!version) return false - range = toComparators(range) - for (var i = 0, l = range.length ; i < l ; i ++) { - var ok = false - for (var j = 0, ll = range[i].length ; j < ll ; j ++) { - var r = range[i][j] - , gtlt = r.charAt(0) === ">" ? gt - : r.charAt(0) === "<" ? lt - : false - , eq = r.charAt(!!gtlt) === "=" - , sub = (!!eq) + (!!gtlt) - if (!gtlt) eq = true - r = r.substr(sub) - r = (r === "") ? r : valid(r) - ok = (r === "") || (eq && r === version) || (gtlt && gtlt(version, r)) - if (!ok) break +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else if (pr) { + debug('replaceTilde pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0-0'; + } else + // ~1.2.3 == >=1.2.3-0 <1.3.0-0 + ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + M + '.' + (+m + 1) + '.0-0'; + + debug('tilde return', ret); + return ret; + }); +} + +function replaceXRanges(comp, loose) { + debug('replaceXRanges', comp, loose); + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (gtlt && anyX) { + // replace X with 0, and then append the -0 min-prerelease + if (xM) + M = 0; + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0-0 + // >1.2 => >=1.3.0-0 + // >1.2.3 => >= 1.2.4-0 + gtlt = '>='; + if (xM) { + // no change + } else if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } + + + ret = gtlt + M + '.' + m + '.' + p + '-0'; + } else if (xM) { + // allow any + ret = '*'; + } else if (xm) { + // append '-0' onto the version, otherwise + // '1.x.x' matches '2.0.0-beta', since the tag + // *lowers* the version value + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; } - if (ok) return true - } - return false -} - -// return v1 > v2 ? 1 : -1 -function compare (v1, v2) { - var g = gt(v1, v2) - return g === null ? 0 : g ? 1 : -1 -} - -function rcompare (v1, v2) { - return compare(v2, v1) -} - -function lt (v1, v2) { return gt(v2, v1) } -function gte (v1, v2) { return !lt(v1, v2) } -function lte (v1, v2) { return !gt(v1, v2) } -function eq (v1, v2) { return gt(v1, v2) === null } -function neq (v1, v2) { return gt(v1, v2) !== null } -function cmp (v1, c, v2) { - switch (c) { - case ">": return gt(v1, v2) - case "<": return lt(v1, v2) - case ">=": return gte(v1, v2) - case "<=": return lte(v1, v2) - case "==": return eq(v1, v2) - case "!=": return neq(v1, v2) - case "===": return v1 === v2 - case "!==": return v1 !== v2 - default: throw new Error("Y U NO USE VALID COMPARATOR!? "+c) - } + + debug('xRange return', ret); + + return ret; + }); } -// return v1 > v2 -function num (v) { - return v === undefined ? -1 : parseInt((v||"0").replace(/[^0-9]+/g, ''), 10) +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + debug('replaceStars', comp, loose); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); } -function gt (v1, v2) { - v1 = exports.parse(v1) - v2 = exports.parse(v2) - if (!v1 || !v2) return false - for (var i = 1; i < 5; i ++) { - v1[i] = num(v1[i]) - v2[i] = num(v2[i]) - if (v1[i] > v2[i]) return true - else if (v1[i] !== v2[i]) return false +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0-0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0-0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0-0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; } - // no tag is > than any tag, or use lexicographical order. - var tag1 = v1[5] || "" - , tag2 = v2[5] || "" - - // kludge: null means they were equal. falsey, and detectable. - // embarrassingly overclever, though, I know. - return tag1 === tag2 ? null - : !tag1 ? true - : !tag2 ? false - : tag1 > tag2 -} - -function inc (version, release) { - version = exports.parse(version) - if (!version) return null - - var parsedIndexLookup = - { 'major': 1 - , 'minor': 2 - , 'patch': 3 - , 'build': 4 } - var incIndex = parsedIndexLookup[release] - if (incIndex === undefined) return null - - var current = num(version[incIndex]) - version[incIndex] = current === -1 ? 1 : current + 1 - - for (var i = incIndex + 1; i < 5; i ++) { - if (num(version[i]) !== -1) version[i] = "0" + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; } + return range.test(version); +} - if (version[4]) version[4] = "-" + version[4] - version[5] = "" +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(compare)[0] || null; +} - return stringify(version) +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } } -})(typeof exports === "object" ? exports : semver = {}) + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); diff --git a/node_modules/semver/semver.min.js b/node_modules/semver/semver.min.js new file mode 100644 index 000000000..3692c20ea --- /dev/null +++ b/node_modules/semver/semver.min.js @@ -0,0 +1 @@ +!function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=O;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var o=n++;t[o]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var a=n++;t[a]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var u=n++;t[u]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var f=n++;t[f]="(?:"+t[i]+"|"+t[o]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[o]+")";var l=n++;t[l]="(?:-("+t[f]+"(?:\\."+t[f]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[a]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var d="[v=\\s]*"+t[u]+t[p]+"?"+t[v]+"?";var w=n++;t[w]="^"+d+"$";var y=n++;t[y]="((?:<|>)?=?)";var $=n++;t[$]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var b=n++;t[b]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:("+t[l]+")"+")?)?)?";var S=n++;t[S]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[p]+")"+")?)?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[b]+"$";var k=n++;t[k]="^"+t[y]+"\\s*"+t[S]+"$";var x=n++;t[x]="(?:~>?)";var R=n++;t[R]=t[x]+"s+";var V="$1";var I=n++;t[I]="^"+t[x]+t[b]+"$";var C=n++;t[C]="^"+t[x]+t[S]+"$";var A=n++;t[A]="^"+t[y]+"\\s*("+d+")$|^$";var T=n++;t[T]="^"+t[y]+"\\s*("+g+")$|^$";var z=n++;t[z]=t[y]+"\\s*("+d+"|"+t[b]+")";r[z]=new RegExp(t[z],"g");var M="$1$2 ";var P=n++;t[P]="^\\s*("+t[b]+")"+"\\s+-\\s+"+"("+t[b]+")"+"\\s*$";var Z=n++;t[Z]="^\\s*("+t[S]+")"+"\\s+-\\s+"+"("+t[S]+")"+"\\s*$";var q=n++;t[q]="(<|>)?=?\\s*\\*";for(var L=0;L<n;L++){if(!r[L])r[L]=new RegExp(t[L])}e.parse=X;function X(e,t){var n=t?r[w]:r[m];return n.test(e)?new O(e,t):null}e.valid=_;function _(e,r){var t=X(e,r);return t?t.version:null}e.clean=N;function N(e,r){var t=X(e,r);return t?t.version:null}e.SemVer=O;function O(e,t){if(e instanceof O){if(e.loose===t)return e;else e=e.version}if(!(this instanceof O))return new O(e,t);this.loose=t;var n=e.trim().match(t?r[w]:r[m]);if(!n)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e});this.build=n[5]?n[5].split("."):[];this.format()}O.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length)this.version+="-"+this.prerelease.join(".");return this.version};O.prototype.inspect=function(){return'<SemVer "'+this+'">'};O.prototype.toString=function(){return this.version};O.prototype.compare=function(e){if(!(e instanceof O))e=new O(e,this.loose);return this.compareMain(e)||this.comparePre(e)};O.prototype.compareMain=function(e){if(!(e instanceof O))e=new O(e,this.loose);return F(this.major,e.major)||F(this.minor,e.minor)||F(this.patch,e.patch)};O.prototype.comparePre=function(e){if(!(e instanceof O))e=new O(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.lenth&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return F(t,n)}while(++r)};O.prototype.inc=function(e){switch(e){case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=-1;case"patch":this.patch++;this.prerelease=[];break;case"prerelease":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=B;function B(e,r,t){try{return new O(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=F;var D=/^[0-9]+$/;function F(e,r){var t=D.test(e);var n=D.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:e<r?-1:e>r?1:0}e.rcompareIdentifiers=G;function G(e,r){return F(r,e)}e.compare=H;function H(e,r,t){return new O(e,t).compare(r)}e.compareLoose=J;function J(e,r){return H(e,r,true)}e.rcompare=K;function K(e,r,t){return H(r,e,t)}e.sort=Q;function Q(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=U;function U(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=W;function W(e,r,t){return H(e,r,t)>0}e.lt=Y;function Y(e,r,t){return H(e,r,t)<0}e.eq=er;function er(e,r,t){return H(e,r,t)===0}e.neq=rr;function rr(e,r,t){return H(e,r,t)!==0}e.gte=tr;function tr(e,r,t){return H(e,r,t)>=0}e.lte=nr;function nr(e,r,t){return H(e,r,t)<=0}e.cmp=ir;function ir(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=er(e,t,n);break;case"!=":i=rr(e,t,n);break;case">":i=W(e,t,n);break;case">=":i=tr(e,t,n);break;case"<":i=Y(e,t,n);break;case"<=":i=nr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=sr;function sr(e,r){if(e instanceof sr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof sr))return new sr(e,r);this.loose=r;this.parse(e);if(this.semver===or)this.value="";else this.value=this.operator+this.semver.version}var or={};sr.prototype.parse=function(e){var t=this.loose?r[A]:r[T];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(!n[2])this.semver=or;else{this.semver=new O(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};sr.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'};sr.prototype.toString=function(){return this.value};sr.prototype.test=function(e){return this.semver===or?true:ir(e,this.operator,this.semver,this.loose)};e.Range=ar;function ar(e,r){if(e instanceof ar&&e.loose===r)return e;if(!(this instanceof ar))return new ar(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}ar.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'};ar.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};ar.prototype.toString=function(){return this.range};ar.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[Z]:r[P];e=e.replace(n,gr);e=e.replace(r[z],M);e=e.replace(r[R],V);e=e.split(/\s+/).join(" ");var i=t?r[A]:r[T];var s=e.split(" ").map(function(e){return fr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new sr(e,t)});return s};e.toComparators=ur;function ur(e,r){return new ar(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function fr(e,r){e=lr(e,r);e=hr(e,r);e=mr(e,r);return e}function cr(e){return!e||e.toLowerCase()==="x"||e==="*"}function lr(e,r){return e.trim().split(/\s+/).map(function(e){return pr(e,r)}).join(" ")}function pr(e,t){var n=t?r[C]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(cr(r))s="";else if(cr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(cr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function hr(e,r){return e.split(/\s+/).map(function(e){return vr(e,r)}).join(" ")}function vr(e,t){e=e.trim();var n=t?r[k]:r[E];return e.replace(n,function(e,r,t,n,i,s){var o=cr(t);var a=o||cr(n);var u=a||cr(i);var f=u;if(r==="="&&f)r="";if(r&&f){if(o)t=0;if(a)n=0;if(u)i=0;if(r===">"){r=">=";if(o){}else if(a){t=+t+1;n=0;i=0}else if(u){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(o){e="*"}else if(a){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(u){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function mr(e,t){return e.trim().replace(r[q],"")}function gr(e,r,t,n,i,s,o,a,u,f,c,l,p){if(cr(t))r="";else if(cr(n))r=">="+t+".0.0-0";else if(cr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(cr(u))a="";else if(cr(f))a="<"+(+u+1)+".0.0-0";else if(cr(c))a="<"+u+"."+(+f+1)+".0-0";else if(l)a="<="+u+"."+f+"."+c+"-"+l;else a="<="+a;return(r+" "+a).trim()}ar.prototype.test=function(e){if(!e)return false;for(var r=0;r<this.set.length;r++){if(dr(this.set[r],e))return true}return false};function dr(e,r){for(var t=0;t<e.length;t++){if(!e[t].test(r))return false}return true}e.satisfies=wr;function wr(e,r,t){try{r=new ar(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=yr;function yr(e,r,t){return e.filter(function(e){return wr(e,r,t)}).sort(H)[0]||null}e.validRange=$r;function $r(e,r){try{return new ar(e,r).range||"*"}catch(t){return null}}if(typeof define==="function"&&define.amd)define(e)}(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={});
\ No newline at end of file diff --git a/node_modules/semver/semver.min.js.gz b/node_modules/semver/semver.min.js.gz Binary files differnew file mode 100644 index 000000000..455d1df78 --- /dev/null +++ b/node_modules/semver/semver.min.js.gz diff --git a/node_modules/semver/test.js b/node_modules/semver/test.js deleted file mode 100644 index 475b77bb5..000000000 --- a/node_modules/semver/test.js +++ /dev/null @@ -1,436 +0,0 @@ -var tap = require("tap") - , test = tap.test - , semver = require("./semver.js") - , eq = semver.eq - , gt = semver.gt - , lt = semver.lt - , neq = semver.neq - , cmp = semver.cmp - , gte = semver.gte - , lte = semver.lte - , satisfies = semver.satisfies - , validRange = semver.validRange - , inc = semver.inc - , replaceStars = semver.replaceStars - , toComparators = semver.toComparators - -tap.plan(8) - -test("\ncomparison tests", function (t) { -// [version1, version2] -// version1 should be greater than version2 -; [ ["0.0.0", "0.0.0foo"] - , ["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.0foo"] - , ["v0.0.1", "0.0.0"] - , ["v1.0.0", "0.9.9"] - , ["v0.10.0", "0.9.0"] - , ["v0.99.0", "0.10.0"] - , ["v2.0.0", "1.2.3"] - , ["0.0.0", "v0.0.0foo"] - , ["0.0.1", "v0.0.0"] - , ["1.0.0", "v0.9.9"] - , ["0.10.0", "v0.9.0"] - , ["0.99.0", "v0.10.0"] - , ["2.0.0", "v1.2.3"] - , ["1.2.3", "1.2.3-asdf"] - , ["1.2.3-4", "1.2.3"] - , ["1.2.3-4-foo", "1.2.3"] - , ["1.2.3-5", "1.2.3-5-foo"] - , ["1.2.3-5", "1.2.3-4"] - , ["1.2.3-5-foo", "1.2.3-5-Foo"] - , ["3.0.0", "2.7.2+"] - ].forEach(function (v) { - var v0 = v[0] - , v1 = v[1] - t.ok(gt(v0, v1), "gt('"+v0+"', '"+v1+"')") - t.ok(lt(v1, v0), "lt('"+v1+"', '"+v0+"')") - t.ok(!gt(v1, v0), "!gt('"+v1+"', '"+v0+"')") - t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')") - t.ok(eq(v0, v0), "eq('"+v0+"', '"+v0+"')") - t.ok(eq(v1, v1), "eq('"+v1+"', '"+v1+"')") - t.ok(neq(v0, v1), "neq('"+v0+"', '"+v1+"')") - t.ok(cmp(v1, "==", v1), "cmp('"+v1+"' == '"+v1+"')") - t.ok(cmp(v0, ">=", v1), "cmp('"+v0+"' >= '"+v1+"')") - t.ok(cmp(v1, "<=", v0), "cmp('"+v1+"' <= '"+v0+"')") - t.ok(cmp(v0, "!=", v1), "cmp('"+v0+"' != '"+v1+"')") - }) - t.end() -}) - -test("\nequality tests", function (t) { -// [version1, version2] -// version1 should be equivalent to version2 -; [ ["1.2.3", "v1.2.3"] - , ["1.2.3", "=1.2.3"] - , ["1.2.3", "v 1.2.3"] - , ["1.2.3", "= 1.2.3"] - , ["1.2.3", " v1.2.3"] - , ["1.2.3", " =1.2.3"] - , ["1.2.3", " v 1.2.3"] - , ["1.2.3", " = 1.2.3"] - , ["1.2.3-0", "v1.2.3-0"] - , ["1.2.3-0", "=1.2.3-0"] - , ["1.2.3-0", "v 1.2.3-0"] - , ["1.2.3-0", "= 1.2.3-0"] - , ["1.2.3-0", " v1.2.3-0"] - , ["1.2.3-0", " =1.2.3-0"] - , ["1.2.3-0", " v 1.2.3-0"] - , ["1.2.3-0", " = 1.2.3-0"] - , ["1.2.3-01", "v1.2.3-1"] - , ["1.2.3-01", "=1.2.3-1"] - , ["1.2.3-01", "v 1.2.3-1"] - , ["1.2.3-01", "= 1.2.3-1"] - , ["1.2.3-01", " v1.2.3-1"] - , ["1.2.3-01", " =1.2.3-1"] - , ["1.2.3-01", " v 1.2.3-1"] - , ["1.2.3-01", " = 1.2.3-1"] - , ["1.2.3beta", "v1.2.3beta"] - , ["1.2.3beta", "=1.2.3beta"] - , ["1.2.3beta", "v 1.2.3beta"] - , ["1.2.3beta", "= 1.2.3beta"] - , ["1.2.3beta", " v1.2.3beta"] - , ["1.2.3beta", " =1.2.3beta"] - , ["1.2.3beta", " v 1.2.3beta"] - , ["1.2.3beta", " = 1.2.3beta"] - ].forEach(function (v) { - var v0 = v[0] - , v1 = v[1] - t.ok(eq(v0, v1), "eq('"+v0+"', '"+v1+"')") - t.ok(!neq(v0, v1), "!neq('"+v0+"', '"+v1+"')") - t.ok(cmp(v0, "==", v1), "cmp("+v0+"=="+v1+")") - t.ok(!cmp(v0, "!=", v1), "!cmp("+v0+"!="+v1+")") - t.ok(!cmp(v0, "===", v1), "!cmp("+v0+"==="+v1+")") - t.ok(cmp(v0, "!==", v1), "cmp("+v0+"!=="+v1+")") - t.ok(!gt(v0, v1), "!gt('"+v0+"', '"+v1+"')") - t.ok(gte(v0, v1), "gte('"+v0+"', '"+v1+"')") - t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')") - t.ok(lte(v0, v1), "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.0.0", "1.0.0"] - , [">=*", "0.2.4"] - , ["", "1.0.0"] - , ["*", "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.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"] - , ["1", "1.0.0beta"] - , ["~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"] - , ["~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'] - ].forEach(function (v) { - t.ok(satisfies(v[1], v[0]), v[0]+" satisfied by "+v[1]) - }) - 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.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"] - , [">=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"] - , ["~v0.5.4-beta", "0.5.4-alpha"] - , ["<1", "1.0.0beta"] - , ["< 1", "1.0.0beta"] - , ["=0.7.x", "0.8.2"] - , [">=0.7.x", "0.6.2"] - , ["<=0.7.x", "0.7.2"] - ].forEach(function (v) { - t.ok(!satisfies(v[1], v[0]), v[0]+" not satisfied by "+v[1]) - }) - t.end() -}) - -test("\nincrement versions test", function (t) { -// [version, inc, result] -// 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.3", "build", "1.2.3-1" ] - , [ "1.2.3-4", "build", "1.2.3-5" ] - , [ "1.2.3tag", "major", "2.0.0" ] - , [ "1.2.3-tag", "major", "2.0.0" ] - , [ "1.2.3tag", "build", "1.2.3-1" ] - , [ "1.2.3-tag", "build", "1.2.3-1" ] - , [ "1.2.3-4-tag", "build", "1.2.3-5" ] - , [ "1.2.3-4tag", "build", "1.2.3-5" ] - , [ "1.2.3", "fake", null ] - , [ "fake", "major", null ] - ].forEach(function (v) { - t.equal(inc(v[0], v[1]), v[2], "inc("+v[0]+", "+v[1]+") === "+v[2]) - }) - - t.end() -}) - -test("\nreplace stars test", function (t) { -// replace stars with "" -; [ [ "", "" ] - , [ "*", "" ] - , [ "> *", "" ] - , [ "<*", "" ] - , [ " >= *", "" ] - , [ "* || 1.2.3", " || 1.2.3" ] - ].forEach(function (v) { - t.equal(replaceStars(v[0]), v[1], "replaceStars("+v[0]+") === "+v[1]) - }) - - 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.*.*", null] - , ["1.2.*", null] - , ["1.2.* || 2.*", null] - , ["1.2.* || 2.*", null] - , ["*", ""] - , ["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", "<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-"] - ].forEach(function (v) { - t.equal(validRange(v[0]), v[1], "validRange("+v[0]+") === "+v[1]) - }) - - 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"]] ] - , [">=*", [[">=0.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-"]] ] - ].forEach(function (v) { - t.equivalent(toComparators(v[0]), v[1], "toComparators("+v[0]+") === "+JSON.stringify(v[1])) - }) - - t.end() -}) diff --git a/node_modules/semver/test/amd.js b/node_modules/semver/test/amd.js new file mode 100644 index 000000000..a6041341b --- /dev/null +++ b/node_modules/semver/test/amd.js @@ -0,0 +1,15 @@ +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(); +}); diff --git a/node_modules/semver/test/index.js b/node_modules/semver/test/index.js new file mode 100644 index 000000000..2ac51deba --- /dev/null +++ b/node_modules/semver/test/index.js @@ -0,0 +1,516 @@ +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 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'] + ].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.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0'], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo', 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'], + ['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'], + ['~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.3', '1.2.3-beta'], + ['>1.2', '1.3.0-beta'], + ['>=1.2', '1.2.8'] + ].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.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'], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], + ['=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'], + // invalid ranges never satisfied! + ['blerg', '1.2.3'] + ].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] + // 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], + ['fake', 'major', null], + ['1.2.3', 'prerelease', '1.2.3-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'] + ].forEach(function(v) { + var pre = v[0]; + var what = v[1]; + var wanted = v[2]; + var loose = v[3]; + var found = inc(pre, what, loose); + t.equal(found, wanted, 'inc(' + pre + ', ' + what + ') === ' + 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'], + ['>=*', '>=0.0.0-0'], + ['', '*'], + ['*', '*'], + ['*', '*'], + ['>=1.0.0', '>=1.0.0'], + ['>1.0.0', '>1.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['1', '>=1.0.0-0 <2.0.0-0'], + ['<=2.0.0', '<=2.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['<2.0.0', '<2.0.0-0'], + ['<2.0.0', '<2.0.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-0'], + ['< 2.0.0', '<2.0.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'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], + ['||', '||'], + ['2.x.x', '>=2.0.0-0 <3.0.0-0'], + ['1.2.x', '>=1.2.0-0 <1.3.0-0'], + ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['x', '*'], + ['2.*.*', '>=2.0.0-0 <3.0.0-0'], + ['1.2.*', '>=1.2.0-0 <1.3.0-0'], + ['1.2.* || 2.*', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['*', '*'], + ['2', '>=2.0.0-0 <3.0.0-0'], + ['2.3', '>=2.3.0-0 <2.4.0-0'], + ['~2.4', '>=2.4.0-0 <2.5.0-0'], + ['~2.4', '>=2.4.0-0 <2.5.0-0'], + ['~>3.2.1', '>=3.2.1-0 <3.3.0-0'], + ['~1', '>=1.0.0-0 <2.0.0-0'], + ['~>1', '>=1.0.0-0 <2.0.0-0'], + ['~> 1', '>=1.0.0-0 <2.0.0-0'], + ['~1.0', '>=1.0.0-0 <1.1.0-0'], + ['~ 1.0', '>=1.0.0-0 <1.1.0-0'], + ['<1', '<1.0.0-0'], + ['< 1', '<1.0.0-0'], + ['>=1', '>=1.0.0-0'], + ['>= 1', '>=1.0.0-0'], + ['<1.2', '<1.2.0-0'], + ['< 1.2', '<1.2.0-0'], + ['1', '>=1.0.0-0 <2.0.0-0'], + ['>01.02.03', '>1.2.3', true], + ['>01.02.03', null], + ['~1.2.3beta', '>=1.2.3-beta <1.3.0-0', true], + ['~1.2.3beta', null] + ].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']]], + ['>=*', [['>=0.0.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-0', '<2.0.0-0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<2.0.0', [['<2.0.0-0']]], + ['<2.0.0', [['<2.0.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-0']]], + ['<\t2.0.0', [['<2.0.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']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], + ['||', [[''], ['']]], + ['2.x.x', [['>=2.0.0-0', '<3.0.0-0']]], + ['1.2.x', [['>=1.2.0-0', '<1.3.0-0']]], + ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['x', [['']]], + ['2.*.*', [['>=2.0.0-0', '<3.0.0-0']]], + ['1.2.*', [['>=1.2.0-0', '<1.3.0-0']]], + ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['*', [['']]], + ['2', [['>=2.0.0-0', '<3.0.0-0']]], + ['2.3', [['>=2.3.0-0', '<2.4.0-0']]], + ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], + ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], + ['~>3.2.1', [['>=3.2.1-0', '<3.3.0-0']]], + ['~1', [['>=1.0.0-0', '<2.0.0-0']]], + ['~>1', [['>=1.0.0-0', '<2.0.0-0']]], + ['~> 1', [['>=1.0.0-0', '<2.0.0-0']]], + ['~1.0', [['>=1.0.0-0', '<1.1.0-0']]], + ['~ 1.0', [['>=1.0.0-0', '<1.1.0-0']]], + ['~ 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], + ['~> 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], + ['<1', [['<1.0.0-0']]], + ['< 1', [['<1.0.0-0']]], + ['>=1', [['>=1.0.0-0']]], + ['>= 1', [['>=1.0.0-0']]], + ['<1.2', [['<1.2.0-0']]], + ['< 1.2', [['<1.2.0-0']]], + ['1', [['>=1.0.0-0', '<2.0.0-0']]], + ['1 2', [['>=1.0.0-0', '<2.0.0-0', '>=2.0.0-0', '<3.0.0-0']]], + ['1.2 - 3.4.5', [['>=1.2.0-0', '<=3.4.5']]], + ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.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('\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-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(); +}); diff --git a/node_modules/semver/test/no-module.js b/node_modules/semver/test/no-module.js new file mode 100644 index 000000000..96d1cd1fc --- /dev/null +++ b/node_modules/semver/test/no-module.js @@ -0,0 +1,19 @@ +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'), 'utf8'); + var src = fs.readFileSync(require.resolve('../'), 'utf8'); + var foot = fs.readFileSync(require.resolve('../foot.js'), '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(); +}); + diff --git a/package.json b/package.json index bea589077..ee54f5814 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "main": "./lib/npm.js", "bin": "./bin/npm-cli.js", "dependencies": { - "semver": "~1.1.2", + "semver": "~2.0.7", "ini": "~1.1.0", "slide": "~1.1.4", "abbrev": "~1.0.4", @@ -51,23 +51,23 @@ "mkdirp": "~0.3.3", "read": "~1.0.4", "lru-cache": "~2.3.0", - "node-gyp": "~0.10.0", + "node-gyp": "~0.10.1", "fstream-npm": "~0.1.3", "uid-number": "0", "archy": "0", "chownr": "0", - "npmlog": "0", + "npmlog": "0.0.3", "ansi": "~0.1.2", - "npm-registry-client": "~0.2.22", - "read-package-json": "~0.4.1", - "read-installed": "0", + "npm-registry-client": "~0.2.25", + "read-package-json": "~1.1.0", + "read-installed": "~0.2.2", "glob": "~3.2.1", - "init-package-json": "0.0.9", + "init-package-json": "0.0.10", "osenv": "0", "lockfile": "~0.3.2", "retry": "~0.6.0", "once": "~1.1.1", - "npmconf": "~0.1.0", + "npmconf": "~0.1.1", "opener": "~1.3.0", "chmodr": "~0.1.0", "cmd-shim": "~1.1.0", |