diff options
author | isaacs <i@izs.me> | 2019-09-30 23:51:20 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2019-09-30 23:51:20 +0300 |
commit | 0ff0ea47a8840dd7d952bde7f7983a5016cda8ea (patch) | |
tree | 3004847782d48439ad7dd4d675779715b1751e2e /node_modules/npm-install-checks | |
parent | 726fba74a922254221b15ae474a15cd9abafeadf (diff) |
npm-install-checks@3.0.2
Diffstat (limited to 'node_modules/npm-install-checks')
-rw-r--r-- | node_modules/npm-install-checks/index.js | 5 | ||||
-rw-r--r-- | node_modules/npm-install-checks/package.json | 39 | ||||
-rw-r--r-- | node_modules/npm-install-checks/test/check-engine.js | 62 | ||||
-rw-r--r-- | node_modules/npm-install-checks/test/check-git.js | 37 | ||||
-rw-r--r-- | node_modules/npm-install-checks/test/check-platform.js | 104 |
5 files changed, 23 insertions, 224 deletions
diff --git a/node_modules/npm-install-checks/index.js b/node_modules/npm-install-checks/index.js index 9ea7b875e..a533c9d36 100644 --- a/node_modules/npm-install-checks/index.js +++ b/node_modules/npm-install-checks/index.js @@ -7,9 +7,10 @@ exports.checkEngine = checkEngine function checkEngine (target, npmVer, nodeVer, force, strict, cb) { var nodev = force ? null : nodeVer var eng = target.engines + var opt = { includePrerelease: true } if (!eng) return cb() - if (nodev && eng.node && !semver.satisfies(nodev, eng.node) || - eng.npm && !semver.satisfies(npmVer, eng.npm)) { + if (nodev && eng.node && !semver.satisfies(nodev, eng.node, opt) || + eng.npm && !semver.satisfies(npmVer, eng.npm, opt)) { var er = new Error(util.format('Unsupported engine for %s: wanted: %j (current: %j)', target._id, eng, {node: nodev, npm: npmVer})) er.code = 'ENOTSUP' diff --git a/node_modules/npm-install-checks/package.json b/node_modules/npm-install-checks/package.json index e186c6a5a..dc409c761 100644 --- a/node_modules/npm-install-checks/package.json +++ b/node_modules/npm-install-checks/package.json @@ -1,32 +1,28 @@ { - "_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", + "_from": "npm-install-checks@3.0.2", + "_id": "npm-install-checks@3.0.2", "_inBundle": false, - "_integrity": "sha1-1K7N/VGlPjcjt7L5Oy7ijjB7wNc=", + "_integrity": "sha512-E4kzkyZDIWoin6uT5howP8VDvkM+E8IQDcHAycaAxMbwkqhIg5eEYALnXOl3Hq9MrkdQB/2/g1xwBINXdKSRkg==", "_location": "/npm-install-checks", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-install-checks@3.0.0", + "raw": "npm-install-checks@3.0.2", "name": "npm-install-checks", "escapedName": "npm-install-checks", - "rawSpec": "3.0.0", + "rawSpec": "3.0.2", "saveSpec": null, - "fetchSpec": "3.0.0" + "fetchSpec": "3.0.2" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-3.0.0.tgz", - "_spec": "3.0.0", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-3.0.2.tgz", + "_shasum": "ab2e32ad27baa46720706908e5b14c1852de44d9", + "_spec": "npm-install-checks@3.0.2", + "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Robert Kowalski", "email": "rok@kowalski.gd" @@ -34,16 +30,21 @@ "bugs": { "url": "https://github.com/npm/npm-install-checks/issues" }, + "bundleDependencies": false, "dependencies": { "semver": "^2.3.0 || 3.x || 4 || 5" }, + "deprecated": false, "description": "checks that npm runs during the installation of a module", "devDependencies": { - "mkdirp": "~0.3.5", - "rimraf": "~2.2.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.3", "standard": "^5.4.1", - "tap": "^5.0.1" + "tap": "^12.4.0" }, + "files": [ + "index.js" + ], "homepage": "https://github.com/npm/npm-install-checks", "keywords": [ "npm,", @@ -59,5 +60,5 @@ "scripts": { "test": "standard && tap --coverage test/*.js" }, - "version": "3.0.0" + "version": "3.0.2" } diff --git a/node_modules/npm-install-checks/test/check-engine.js b/node_modules/npm-install-checks/test/check-engine.js deleted file mode 100644 index a8fa0390a..000000000 --- a/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/node_modules/npm-install-checks/test/check-git.js b/node_modules/npm-install-checks/test/check-git.js deleted file mode 100644 index 0fadd0631..000000000 --- a/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/node_modules/npm-install-checks/test/check-platform.js b/node_modules/npm-install-checks/test/check-platform.js deleted file mode 100644 index 23dbfba4a..000000000 --- a/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() - }) -}) |