diff options
Diffstat (limited to 'deps/node/deps/npm/node_modules/npm-install-checks')
8 files changed, 0 insertions, 474 deletions
diff --git a/deps/node/deps/npm/node_modules/npm-install-checks/CHANGELOG.md b/deps/node/deps/npm/node_modules/npm-install-checks/CHANGELOG.md deleted file mode 100644 index f16f72d2..00000000 --- a/deps/node/deps/npm/node_modules/npm-install-checks/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -### v3.0.0 2016-01-12 - -* Change error messages to be more informative. -* checkEngine, when not in strict mode, now calls back with the error - object as the second argument instead of warning. -* checkCycle no longer logs when cycle errors are found. - -### v2.0.0 2015-01-20 - -* Remove checking of engineStrict in the package.json diff --git a/deps/node/deps/npm/node_modules/npm-install-checks/LICENSE b/deps/node/deps/npm/node_modules/npm-install-checks/LICENSE deleted file mode 100644 index 3bed8320..00000000 --- a/deps/node/deps/npm/node_modules/npm-install-checks/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Robert Kowalski and Isaac Z. Schlueter ("Authors") -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 AUTHORS 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 AUTHORS 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/deps/node/deps/npm/node_modules/npm-install-checks/README.md b/deps/node/deps/npm/node_modules/npm-install-checks/README.md deleted file mode 100644 index 19ae5a4a..00000000 --- a/deps/node/deps/npm/node_modules/npm-install-checks/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# npm-install-checks - -A package that contains checks that npm runs during the installation. - -## API - -### .checkEngine(target, npmVer, nodeVer, force, strict, cb) -Check if node/npm version is supported by the package. If not -strict and it isn't supported, `cb` is called with the error -object as its second argument. - -Error type: `ENOTSUP` - -### .checkPlatform(target, force, cb) -Check if OS/Arch is supported by the package. - -Error type: `EBADPLATFORM` - -### .checkCycle(target, ancestors, cb) -Check for cyclic dependencies. - -Error type: `ECYCLE` - -### .checkGit(folder, cb) -Check if a folder is a .git folder. - -Error type: `EISGIT` diff --git a/deps/node/deps/npm/node_modules/npm-install-checks/index.js b/deps/node/deps/npm/node_modules/npm-install-checks/index.js deleted file mode 100644 index 9ea7b875..00000000 --- a/deps/node/deps/npm/node_modules/npm-install-checks/index.js +++ /dev/null @@ -1,144 +0,0 @@ -var fs = require('fs') -var path = require('path') -var util = require('util') -var semver = require('semver') - -exports.checkEngine = checkEngine -function checkEngine (target, npmVer, nodeVer, force, strict, cb) { - var nodev = force ? null : nodeVer - var eng = target.engines - if (!eng) return cb() - if (nodev && eng.node && !semver.satisfies(nodev, eng.node) || - eng.npm && !semver.satisfies(npmVer, eng.npm)) { - var er = new Error(util.format('Unsupported engine for %s: wanted: %j (current: %j)', - target._id, eng, {node: nodev, npm: npmVer})) - er.code = 'ENOTSUP' - er.required = eng - er.pkgid = target._id - if (strict) { - return cb(er) - } else { - return cb(null, er) - } - } - return cb() -} - -exports.checkPlatform = checkPlatform -function checkPlatform (target, force, cb) { - var platform = process.platform - var arch = process.arch - var osOk = true - var cpuOk = true - - if (force) { - return cb() - } - - if (target.os) { - osOk = checkList(platform, target.os) - } - if (target.cpu) { - cpuOk = checkList(arch, target.cpu) - } - if (!osOk || !cpuOk) { - var er = new Error(util.format('Unsupported platform for %s: wanted %j (current: %j)', - target._id, target, {os: platform, cpu: arch})) - er.code = 'EBADPLATFORM' - er.os = target.os || ['any'] - er.cpu = target.cpu || ['any'] - er.pkgid = target._id - return cb(er) - } - return cb() -} - -function checkList (value, list) { - var tmp - var match = false - var blc = 0 - if (typeof list === 'string') { - list = [list] - } - if (list.length === 1 && list[0] === 'any') { - return true - } - for (var i = 0; i < list.length; ++i) { - tmp = list[i] - if (tmp[0] === '!') { - tmp = tmp.slice(1) - if (tmp === value) { - return false - } - ++blc - } else { - match = match || tmp === value - } - } - return match || blc === list.length -} - -exports.checkCycle = checkCycle -function checkCycle (target, ancestors, cb) { - // there are some very rare and pathological edge-cases where - // a cycle can cause npm to try to install a never-ending tree - // of stuff. - // Simplest: - // - // A -> B -> A' -> B' -> A -> B -> A' -> B' -> A -> ... - // - // Solution: Simply flat-out refuse to install any name@version - // that is already in the prototype tree of the ancestors object. - // A more correct, but more complex, solution would be to symlink - // the deeper thing into the new location. - // Will do that if anyone whines about this irl. - // - // Note: `npm install foo` inside of the `foo` package will abort - // earlier if `--force` is not set. However, if it IS set, then - // we need to still fail here, but just skip the first level. Of - // course, it'll still fail eventually if it's a true cycle, and - // leave things in an undefined state, but that's what is to be - // expected when `--force` is used. That is why getPrototypeOf - // is used *twice* here: to skip the first level of repetition. - - var p = Object.getPrototypeOf(Object.getPrototypeOf(ancestors)) - var name = target.name - var version = target.version - while (p && p !== Object.prototype && p[name] !== version) { - p = Object.getPrototypeOf(p) - } - if (p[name] !== version) return cb() - - var er = new Error(target._id + ': Unresolvable cycle detected') - var tree = [target._id, JSON.parse(JSON.stringify(ancestors))] - var t = Object.getPrototypeOf(ancestors) - while (t && t !== Object.prototype) { - if (t === p) t.THIS_IS_P = true - tree.push(JSON.parse(JSON.stringify(t))) - t = Object.getPrototypeOf(t) - } - er.pkgid = target._id - er.code = 'ECYCLE' - return cb(er) -} - -exports.checkGit = checkGit -function checkGit (folder, cb) { - // if it's a git repo then don't touch it! - fs.lstat(folder, function (er, s) { - if (er || !s.isDirectory()) return cb() - else checkGit_(folder, cb) - }) -} - -function checkGit_ (folder, cb) { - fs.stat(path.resolve(folder, '.git'), function (er, s) { - if (!er && s.isDirectory()) { - var e = new Error(folder + ': Appears to be a git repo or submodule.') - e.path = folder - e.code = 'EISGIT' - return cb(e) - } - cb() - }) -} diff --git a/deps/node/deps/npm/node_modules/npm-install-checks/package.json b/deps/node/deps/npm/node_modules/npm-install-checks/package.json deleted file mode 100644 index e186c6a5..00000000 --- a/deps/node/deps/npm/node_modules/npm-install-checks/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_args": [ - [ - "npm-install-checks@3.0.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "npm-install-checks@3.0.0", - "_id": "npm-install-checks@3.0.0", - "_inBundle": false, - "_integrity": "sha1-1K7N/VGlPjcjt7L5Oy7ijjB7wNc=", - "_location": "/npm-install-checks", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-install-checks@3.0.0", - "name": "npm-install-checks", - "escapedName": "npm-install-checks", - "rawSpec": "3.0.0", - "saveSpec": null, - "fetchSpec": "3.0.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-3.0.0.tgz", - "_spec": "3.0.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Robert Kowalski", - "email": "rok@kowalski.gd" - }, - "bugs": { - "url": "https://github.com/npm/npm-install-checks/issues" - }, - "dependencies": { - "semver": "^2.3.0 || 3.x || 4 || 5" - }, - "description": "checks that npm runs during the installation of a module", - "devDependencies": { - "mkdirp": "~0.3.5", - "rimraf": "~2.2.5", - "standard": "^5.4.1", - "tap": "^5.0.1" - }, - "homepage": "https://github.com/npm/npm-install-checks", - "keywords": [ - "npm,", - "install" - ], - "license": "BSD-2-Clause", - "main": "index.js", - "name": "npm-install-checks", - "repository": { - "type": "git", - "url": "git://github.com/npm/npm-install-checks.git" - }, - "scripts": { - "test": "standard && tap --coverage test/*.js" - }, - "version": "3.0.0" -} diff --git a/deps/node/deps/npm/node_modules/npm-install-checks/test/check-engine.js b/deps/node/deps/npm/node_modules/npm-install-checks/test/check-engine.js deleted file mode 100644 index a8fa0390..00000000 --- a/deps/node/deps/npm/node_modules/npm-install-checks/test/check-engine.js +++ /dev/null @@ -1,62 +0,0 @@ -var test = require('tap').test -var c = require('../index.js').checkEngine - -test('no engine defined', function (t) { - c({ engines: {} }, '1.1.2', '0.2.1', false, true, function (err) { - t.notOk(err, 'no error present') - t.end() - }) -}) - -test('node version too old', function (t) { - var target = { engines: { node: '0.10.24' } } - c(target, '1.1.2', '0.10.18', false, true, function (err) { - t.ok(err, 'returns an error') - t.equals(err.required.node, '0.10.24') - t.end() - }) -}) - -test('npm version too old', function (t) { - var target = { engines: { npm: '^1.4.6' } } - c(target, '1.3.2', '0.2.1', false, true, function (err) { - t.ok(err, 'returns an error') - t.equals(err.required.npm, '^1.4.6') - t.end() - }) -}) - -test('strict=false w/engineStrict json does not return an error', function (t) { - var target = { engines: { npm: '1.3.6' }, engineStrict: true } - c(target, '1.4.2', '0.2.1', false, false, function (err, warn) { - t.notOk(err, 'returns no error') - t.ok(warn, 'returns warning object') - t.equals(warn.required.npm, '1.3.6') - t.end() - }) -}) - -test('force node version too old', function (t) { - var target = { _id: 'test@1.0.0', engines: { node: '0.1.0' } } - c(target, '1.3.2', '0.2.1', true, true, function (err, warn) { - t.is(err, undefined, 'returns no error') - t.notOk(warn, 'returns no warning') - t.end() - }) -}) - -test('force npm version too old', function (t) { - var target = { _id: 'test@1.0.0', engines: { npm: '^1.4.6' } } - c(target, '1.3.2', '0.2.1', true, true, function (err, warn) { - t.ok(err, "can't force an npm version mismatch") - t.end() - }) -}) - -test('no engine', function (t) { - c({}, '1.3.2', '0.2.1', false, true, function (err, warn) { - t.notOk(err, 'returns no error') - t.notOk(warn, 'returns no warning') - t.end() - }) -}) diff --git a/deps/node/deps/npm/node_modules/npm-install-checks/test/check-git.js b/deps/node/deps/npm/node_modules/npm-install-checks/test/check-git.js deleted file mode 100644 index 0fadd063..00000000 --- a/deps/node/deps/npm/node_modules/npm-install-checks/test/check-git.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tap').test -var c = require('../index.js').checkGit -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var path = require('path') -var gitFixturePath = path.resolve(__dirname, 'out') - -test('is .git repo', function (t) { - mkdirp(gitFixturePath + '/.git', function () { - c(gitFixturePath, function (err) { - t.ok(err, 'error present') - t.equal(err.code, 'EISGIT') - t.end() - }) - }) -}) - -test('is not a .git repo', function (t) { - c(__dirname, function (err) { - t.notOk(err, 'error not present') - t.end() - }) -}) - -test('non-thing', function (t) { - c('/path/to/no/where', function (err) { - t.notOk(err, 'non-existent path is not a .git repo') - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf(gitFixturePath, function () { - t.pass('cleanup') - t.end() - }) -}) diff --git a/deps/node/deps/npm/node_modules/npm-install-checks/test/check-platform.js b/deps/node/deps/npm/node_modules/npm-install-checks/test/check-platform.js deleted file mode 100644 index 23dbfba4..00000000 --- a/deps/node/deps/npm/node_modules/npm-install-checks/test/check-platform.js +++ /dev/null @@ -1,104 +0,0 @@ -var test = require('tap').test -var c = require('../index.js').checkPlatform - -test('target cpu wrong', function (t) { - var target = {} - target.cpu = 'enten-cpu' - target.os = 'any' - c(target, false, function (err) { - t.ok(err, 'error present') - t.equal(err.code, 'EBADPLATFORM') - t.end() - }) -}) - -test('os wrong', function (t) { - var target = {} - target.cpu = 'any' - target.os = 'enten-os' - c(target, false, function (err) { - t.ok(err, 'error present') - t.equal(err.code, 'EBADPLATFORM') - t.end() - }) -}) - -test('nothing wrong', function (t) { - var target = {} - target.cpu = 'any' - target.os = 'any' - c(target, false, function (err) { - t.notOk(err, 'no error present') - t.end() - }) -}) - -test('force', function (t) { - var target = {} - target.cpu = 'enten-cpu' - target.os = 'any' - c(target, true, function (err) { - t.notOk(err, 'no error present') - t.end() - }) -}) - -test('no opinions', function (t) { - var target = {} - c(target, false, function (err) { - t.notOk(err, 'no error present') - t.end() - }) -}) - -test('only target cpu wrong', function (t) { - var target = {} - target.cpu = 'enten-cpu' - c(target, false, function (err) { - t.ok(err, 'error present') - t.equal(err.code, 'EBADPLATFORM') - t.end() - }) -}) - -test('only os wrong', function (t) { - var target = {} - target.os = 'enten-os' - c(target, false, function (err) { - t.ok(err, 'error present') - t.equal(err.code, 'EBADPLATFORM') - t.end() - }) -}) - -test('everything wrong w/arrays', function (t) { - var target = {} - target.cpu = ['enten-cpu'] - target.os = ['enten-os'] - c(target, false, function (err) { - t.ok(err, 'error present') - t.equal(err.code, 'EBADPLATFORM') - t.end() - }) -}) - -test('os wrong (negation)', function (t) { - var target = {} - target.cpu = 'any' - target.os = '!' + process.platform - c(target, false, function (err) { - t.ok(err, 'error present') - t.equal(err.code, 'EBADPLATFORM') - t.end() - }) -}) - -test('nothing wrong (negation)', function (t) { - var target = {} - target.cpu = '!enten-cpu' - target.os = '!enten-os' - c(target, false, function (err) { - t.notOk(err, 'no error present') - t.end() - }) -}) |