diff --git a/lib/arborist/build-ideal-tree.js b/lib/arborist/build-ideal-tree.js index 0639a788c..46dd4b598 100644 --- a/lib/arborist/build-ideal-tree.js +++ b/lib/arborist/build-ideal-tree.js @@ -18,6 +18,7 @@ const Link = require('../link.js') const addRmPkgDeps = require('../add-rm-pkg-deps.js') const gatherDepSet = require('../gather-dep-set.js') const optionalSet = require('../optional-set.js') +const {checkEngine, checkPlatform} = require('npm-install-checks') // enum of return values for canPlaceDep. // No, this is a conflict, you may not put that package here @@ -87,6 +88,9 @@ const _followSymlinkPath = Symbol('followSymlinkPath') const _getRelpathSpec = Symbol('getRelpathSpec') const _retrieveSpecName = Symbol('retrieveSpecName') const _strictPeerDeps = Symbol('strictPeerDeps') +const _checkEngineAndPlatform = Symbol('checkEngineAndPlatform') +const _checkEngine = Symbol('checkEngine') +const _checkPlatform = Symbol('checkPlatform') // used for the ERESOLVE error to show the last peer conflict encountered const _peerConflict = Symbol('peerConflict') @@ -190,6 +194,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { await this[_buildDeps]() await this[_fixDepFlags]() await this[_pruneFailedOptional]() + await this[_checkEngineAndPlatform]() } finally { process.emit('timeEnd', 'idealTree') this.finishTracker('idealTree') @@ -198,10 +203,46 @@ module.exports = cls => class IdealTreeBuilder extends cls { return this.idealTree } + [_checkEngineAndPlatform] () { + // engine/platform checks throw, so start the promise chain off first + return Promise.resolve() + .then(() => { + for (const node of this.idealTree.inventory.values()) { + if (!node.optional) { + this[_checkEngine](node) + this[_checkPlatform](node) + } + } + }) + } + + [_checkPlatform] (node) { + checkPlatform(node.package, this[_force]) + } + + [_checkEngine] (node) { + const { engineStrict, npmVersion, nodeVersion } = this.options + const c = () => checkEngine(node.package, npmVersion, nodeVersion, this[_force]) + + if (engineStrict) + c() + else { + try { + c() + } catch (er) { + this.log.warn(er.code, er.message, { + package: er.pkgid, + required: er.required, + current: er.current, + }) + } + } + } + [_parseSettings] (options) { const update = options.update === true ? { all: true } : Array.isArray(options.update) ? { names: options.update } - : options.update || {} + : options.update || {} if (update.all || !Array.isArray(update.names)) update.names = [] diff --git a/lib/arborist/reify.js b/lib/arborist/reify.js index 523ee55f8..49b7f4d66 100644 --- a/lib/arborist/reify.js +++ b/lib/arborist/reify.js @@ -3,7 +3,6 @@ const npa = require('npm-package-arg') const pacote = require('pacote') const rpj = require('read-package-json-fast') -const {checkEngine, checkPlatform} = require('npm-install-checks') const { orderDeps, updateDepSpec } = require('../dep-spec.js') const AuditReport = require('../audit-report.js') @@ -42,13 +41,10 @@ const _diffTrees = Symbol.for('diffTrees') const _createSparseTree = Symbol.for('createSparseTree') const _loadShrinkwrapsAndUpdateTrees = Symbol.for('loadShrinkwrapsAndUpdateTrees') const _reifyNode = Symbol.for('reifyNode') -const _checkEngineAndPlatform = Symbol('checkEngineAndPlatform') const _extractOrLink = Symbol('extractOrLink') const _symlink = Symbol('symlink') const _warnDeprecated = Symbol('warnDeprecated') -const _recheckEngineAndPlatform = Symbol('recheckEngineAndPlatform') -const _checkEngine = Symbol('checkEngine') -const _checkPlatform = Symbol('checkPlatform') +const _loadAncientPackageDetails = Symbol('loadAncientPackageDetails') const _loadBundlesAndUpdateTrees = Symbol.for('loadBundlesAndUpdateTrees') const _submitQuickAudit = Symbol('submitQuickAudit') const _awaitQuickAudit = Symbol('awaitQuickAudit') @@ -380,10 +376,10 @@ module.exports = cls => class Reifier extends cls { process.emit('time', `reifyNode:${node.location}`) this.addTracker('reify', node.name, node.location) - const p = this[_checkEngineAndPlatform](node) + const p = Promise.resolve() .then(() => this[_extractOrLink](node)) .then(() => this[_warnDeprecated](node)) - .then(() => this[_recheckEngineAndPlatform](node)) + .then(() => this[_loadAncientPackageDetails](node)) return this[_handleOptionalFailure](node, p) .then(() => { @@ -437,10 +433,9 @@ module.exports = cls => class Reifier extends cls { this.log.warn('deprecated', `${_id}: ${deprecated}`) } - [_recheckEngineAndPlatform] (node) { - // If we're loading from a v1 lockfile, then need to do this again later - // after reading from the disk. Also grab the bin, because old lockfiles - // did not track that useful bit of info. + [_loadAncientPackageDetails] (node) { + // If we're loading from a v1 lockfile, load details from the package.json + // that weren't recorded in the old format. const {meta} = this.idealTree const ancient = meta.ancientLockfile const old = meta.loadedFromDisk && !(meta.originalLockfileVersion >= 2) @@ -454,42 +449,10 @@ module.exports = cls => class Reifier extends cls { node.package.cpu = pkg.cpu node.package.engines = pkg.engines meta.add(node) - return this[_checkEngineAndPlatform](node) }) } } - [_checkEngineAndPlatform] (node) { - // engine/platform checks throw, so start the promise chain off first - return Promise.resolve() - .then(() => this[_checkEngine](node)) - .then(() => this[_checkPlatform](node)) - } - - - [_checkPlatform] (node) { - checkPlatform(node.package, this[_force]) - } - - [_checkEngine] (node) { - const { engineStrict, npmVersion, nodeVersion } = this.options - const c = () => checkEngine(node.package, npmVersion, nodeVersion, this[_force]) - - if (engineStrict) - c() - else { - try { - c() - } catch (er) { - this.log.warn(er.code, er.message, { - package: er.pkgid, - required: er.required, - current: er.current, - }) - } - } - } - // if the node is optional, then the failure of the promise is nonfatal // just add it and its optional set to the trash list. [_handleOptionalFailure] (node, p) { diff --git a/test/arborist/build-ideal-tree.js b/test/arborist/build-ideal-tree.js index c90acdbcf..91cf7c23f 100644 --- a/test/arborist/build-ideal-tree.js +++ b/test/arborist/build-ideal-tree.js @@ -101,7 +101,55 @@ const printIdeal = (path, opt) => buildIdeal(path, opt).then(printTree) const OPT = { cache, registry } const buildIdeal = (path, opt) => - new Arborist({...OPT, path, ...(opt || {})}).buildIdealTree(opt) + new Arborist({ ...OPT, path, ...(opt || {}) }).buildIdealTree(opt) + +t.test('fail on mismatched engine when engineStrict is set', async t => { + const path = resolve(fixtures, 'engine-specification') + + t.rejects(buildIdeal(path, { + ...OPT, + nodeVersion: '12.18.4', + engineStrict: true, + }).then(() => { throw new Error('failed to fail') }), { code: 'EBADENGINE' }) +}) + +t.test('ignore mismatched engine for optional dependencies', async t => { + const path = resolve(fixtures, 'optional-engine-specification') + await buildIdeal(path, { + ...OPT, + nodeVersion: '12.18.4', + engineStrict: true, + }) +}) + +t.test('warn on mismatched engine when engineStrict is false', t => { + const path = resolve(fixtures, 'engine-specification') + const check = warningTracker() + return buildIdeal(path, { + ...OPT, + nodeVersion: '12.18.4', + engineStrict: false, + }).then(() => t.match(check(), [ + ['warn', 'EBADENGINE'], + ])) +}) + +t.test('fail on mismatched platform', async t => { + const path = resolve(fixtures, 'platform-specification') + t.rejects(buildIdeal(path, { + ...OPT, + nodeVersion: '4.0.0' + }).then(() => { throw new Error('failed to fail') }), { code: 'EBADPLATFORM' }) +}) + +t.test('ignore mismatched platform for optional dependencies', async t => { + const path = resolve(fixtures, 'optional-platform-specification') + await buildIdeal(path, { + ...OPT, + nodeVersion: '12.18.4', + engineStrict: true, + }) +}) t.test('no options', t => { const arb = new Arborist() diff --git a/test/arborist/reify.js b/test/arborist/reify.js index c774e5939..ab144323a 100644 --- a/test/arborist/reify.js +++ b/test/arborist/reify.js @@ -516,29 +516,6 @@ t.test('link metadep', t => { t.resolveMatchSnapshot(printReified(fixture(t, c))))) }) -t.test('fail on mismatched engine when engineStrict is set', t => - t.rejects(printReified(fixture(t, 'tap-and-flow'), { - nodeVersion: '1.2.3', - engineStrict: true, - }).then(() => { throw new Error('failed to fail') }), { code: 'EBADENGINE' })) - -t.test('warn on mismatched engine when engineStrict is false', t => { - const path = fixture(t, 'tap-and-flow') - const a = newArb({ - path, - engineStrict: false, - nodeVersion: '1.2.3', - // just to add coverage for the no-op function for bundleBinLinks - binLinks: false, - }) - const check = warningTracker() - const binPath = `${path}/node_modules/tap/node_modules/.bin` - return a.reify().then(() => t.match(check(), [ - ['warn', 'EBADENGINE'], - ])) - .then(() => t.throws(() => fs.readdir(binPath))) -}) - t.test('warn on reifying deprecated dependency', t => { const a = newArb({ path: fixture(t, 'deprecated-dep'), diff --git a/test/fixtures/engine-specification/package-lock.json b/test/fixtures/engine-specification/package-lock.json new file mode 100644 index 000000000..cb2ffa961 --- /dev/null +++ b/test/fixtures/engine-specification/package-lock.json @@ -0,0 +1,41 @@ +{ + "name": "engine-platform-test", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@bonkydog/test": "^1.4.0", + "lodash": "^4.17.20" + } + }, + "node_modules/@bonkydog/test": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@bonkydog/test/-/test-1.4.0.tgz", + "integrity": "sha512-lzX81yv8S4Y0n+VKBRvy4qx93NFA16kl+iSw8P1qkpLaevlJJH0CpYCMaLg1Z/nTUiiRPeUu5N/IEi1CYkPm3A==", + "engines": { + "node": "4.0.0" + } + }, + "node_modules/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + }, + "dependencies": { + "@bonkydog/test": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@bonkydog/test/-/test-1.4.0.tgz", + "integrity": "sha512-lzX81yv8S4Y0n+VKBRvy4qx93NFA16kl+iSw8P1qkpLaevlJJH0CpYCMaLg1Z/nTUiiRPeUu5N/IEi1CYkPm3A==" + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + } +} diff --git a/test/fixtures/engine-specification/package.json b/test/fixtures/engine-specification/package.json new file mode 100644 index 000000000..f9525ae2f --- /dev/null +++ b/test/fixtures/engine-specification/package.json @@ -0,0 +1,14 @@ +{ + "name": "engine-platform-test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "engine-specifying-test-package": "^1.0.0" + } +} diff --git a/test/fixtures/optional-engine-specification/package-lock.json b/test/fixtures/optional-engine-specification/package-lock.json new file mode 100644 index 000000000..cb2ffa961 --- /dev/null +++ b/test/fixtures/optional-engine-specification/package-lock.json @@ -0,0 +1,41 @@ +{ + "name": "engine-platform-test", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@bonkydog/test": "^1.4.0", + "lodash": "^4.17.20" + } + }, + "node_modules/@bonkydog/test": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@bonkydog/test/-/test-1.4.0.tgz", + "integrity": "sha512-lzX81yv8S4Y0n+VKBRvy4qx93NFA16kl+iSw8P1qkpLaevlJJH0CpYCMaLg1Z/nTUiiRPeUu5N/IEi1CYkPm3A==", + "engines": { + "node": "4.0.0" + } + }, + "node_modules/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + }, + "dependencies": { + "@bonkydog/test": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@bonkydog/test/-/test-1.4.0.tgz", + "integrity": "sha512-lzX81yv8S4Y0n+VKBRvy4qx93NFA16kl+iSw8P1qkpLaevlJJH0CpYCMaLg1Z/nTUiiRPeUu5N/IEi1CYkPm3A==" + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + } +} diff --git a/test/fixtures/optional-engine-specification/package.json b/test/fixtures/optional-engine-specification/package.json new file mode 100644 index 000000000..d669c2463 --- /dev/null +++ b/test/fixtures/optional-engine-specification/package.json @@ -0,0 +1,14 @@ +{ + "name": "engine-platform-test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "optionalDependencies": { + "engine-specifying-test-package": "^1.0.0" + } +} diff --git a/test/fixtures/optional-platform-specification/package-lock.json b/test/fixtures/optional-platform-specification/package-lock.json new file mode 100644 index 000000000..dc0d08ab9 --- /dev/null +++ b/test/fixtures/optional-platform-specification/package-lock.json @@ -0,0 +1,44 @@ +{ + "name": "platform-test", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@bonkydog/test": "^1.5.0", + "lodash": "^4.17.20" + } + }, + "node_modules/@bonkydog/test": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@bonkydog/test/-/test-1.5.0.tgz", + "integrity": "sha512-lzX81yv8S4Y0n+VKBRvy4qx93NFA16kl+iSw8P1qkpLaevlJJH0CpYCMaLg1Z/nTUiiRPeUu5N/IEi1CYkPm3A==", + "engines": { + "node": "4.0.0" + }, + "os": [ + "win32" + ] + }, + "node_modules/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + }, + "dependencies": { + "@bonkydog/test": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@bonkydog/test/-/test-1.5.0.tgz", + "integrity": "sha512-lzX81yv8S4Y0n+VKBRvy4qx93NFA16kl+iSw8P1qkpLaevlJJH0CpYCMaLg1Z/nTUiiRPeUu5N/IEi1CYkPm3A==" + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + } +} diff --git a/test/fixtures/optional-platform-specification/package.json b/test/fixtures/optional-platform-specification/package.json new file mode 100644 index 000000000..a7091d08c --- /dev/null +++ b/test/fixtures/optional-platform-specification/package.json @@ -0,0 +1,14 @@ +{ + "name": "platform-test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "optionalDependencies": { + "platform-specifying-test-package": "1.0.0" + } +} diff --git a/test/fixtures/platform-specification/package-lock.json b/test/fixtures/platform-specification/package-lock.json new file mode 100644 index 000000000..dc0d08ab9 --- /dev/null +++ b/test/fixtures/platform-specification/package-lock.json @@ -0,0 +1,44 @@ +{ + "name": "platform-test", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@bonkydog/test": "^1.5.0", + "lodash": "^4.17.20" + } + }, + "node_modules/@bonkydog/test": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@bonkydog/test/-/test-1.5.0.tgz", + "integrity": "sha512-lzX81yv8S4Y0n+VKBRvy4qx93NFA16kl+iSw8P1qkpLaevlJJH0CpYCMaLg1Z/nTUiiRPeUu5N/IEi1CYkPm3A==", + "engines": { + "node": "4.0.0" + }, + "os": [ + "win32" + ] + }, + "node_modules/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + }, + "dependencies": { + "@bonkydog/test": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@bonkydog/test/-/test-1.5.0.tgz", + "integrity": "sha512-lzX81yv8S4Y0n+VKBRvy4qx93NFA16kl+iSw8P1qkpLaevlJJH0CpYCMaLg1Z/nTUiiRPeUu5N/IEi1CYkPm3A==" + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + } + } +} diff --git a/test/fixtures/platform-specification/package.json b/test/fixtures/platform-specification/package.json new file mode 100644 index 000000000..6f39224f2 --- /dev/null +++ b/test/fixtures/platform-specification/package.json @@ -0,0 +1,14 @@ +{ + "name": "platform-test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "platform-specifying-test-package": "1.0.0" + } +} diff --git a/test/fixtures/registry-mocks/content/engine-specifying-test-package.json b/test/fixtures/registry-mocks/content/engine-specifying-test-package.json new file mode 100644 index 000000000..4ade054de --- /dev/null +++ b/test/fixtures/registry-mocks/content/engine-specifying-test-package.json @@ -0,0 +1 @@ +{"_id":"engine-specifying-test-package","name":"engine-specifying-test-package","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"engine-specifying-test-package","version":"1.0.0","description":"A package to test npm engine and platform checks","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Brian Jenkins","email":"bonkydog@github.com"},"license":"ISC","engines":{"node":"8.17.0"},"_id":"engine-specifying-test-package@1.0.0","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-JmEWb6ITItHkbeGYNpQ8IcvyFl32Nz7f3kDlYD2MukQQMLcWIzNeMd7NeSFxATKvuRnrlUT+8lKdWEjBlaPd4Q==","shasum":"3881c503b72ce0f117cd2d760433c3e4c330e1db","tarball":"https://registry.npmjs.org/engine-specifying-test-package/-/engine-specifying-test-package-1.0.0.tgz","fileCount":6,"unpackedSize":3971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbRtnCRA9TVsSAnZWagAADbwQAJfstETFtT0KupOH8yuz\n7F8ptwUuGx1AFdh9LZcplNdYb0mk8svAuD/cMqzO2yiBdhntJqLIrDbxTWj1\njrThL0lzqwquXsHhVZ3xUNvmsTxEszQDYqKOPwxt63wvkzgf/wMCerl8Man0\nrqy1v3hKyWOLMoXrBK6IXIBzIhoBT9cfk9WUvea/qcVCsxSIAva1yX3Fe2Bd\nVv2uIXdDBUx7Suimc+00TrS/DVQjhPcFzPdLwqIC50Ivwxs+2qBXfTiYnnx2\nUjH0ZTKNBlDlE0M6B9YGypN3ofozpsAyi+F8/3JDkcuZmCsbXI/aC7Qld0u9\nlwul+W/GnpEQmuASYPP97TG/9pOgpKSCWCZtHwD8blEIlGghvBKZA6cPRLfE\nnVGBfR3SIjk6GQv79WJf8s2qnt0TmcjITbGHCvDJ/wtomCr236IhN5x0uovc\nIgpt2RdgOTnkaRFLIZsEoHJ1R/cm1tyvHqGZ2GEuPxObt/eWfPRl0EJh8jnx\n2DKoCUb3TXNQfaYPd7JrkUuLvuZ9u7LqcyJVxrm8pvsUPIa5+ZNDhDazOmht\n54u78d/Zvj5DfmBuQWgmimDBf/ux5spn3tM916/3NCIVe9eazsDuivrlw/gN\ni+rvnYIywCP0kDJWRXZ2hklqn3/LKdTXj2EXXKeI+6TrPXhSecfEclTW+pjA\ntnHD\r\n=rnvs\r\n-----END PGP SIGNATURE-----\r\n"},"maintainers":[{"name":"bonkydog","email":"bonkydog@bonkydog.com"}],"_npmUser":{"name":"bonkydog","email":"bonkydog@bonkydog.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/engine-specifying-test-package_1.0.0_1600985959504_0.0761876537248305"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-24T22:19:19.504Z","1.0.0":"2020-09-24T22:19:19.643Z","modified":"2020-09-24T22:19:21.910Z"},"maintainers":[{"name":"bonkydog","email":"bonkydog@bonkydog.com"}],"description":"A package to test npm engine and platform checks","author":{"name":"Brian Jenkins","email":"bonkydog@github.com"},"license":"ISC","readme":"ERROR: No README data found!","readmeFilename":""} \ No newline at end of file diff --git a/test/fixtures/registry-mocks/content/platform-specifying-test-package.json b/test/fixtures/registry-mocks/content/platform-specifying-test-package.json new file mode 100644 index 000000000..1178d1df6 --- /dev/null +++ b/test/fixtures/registry-mocks/content/platform-specifying-test-package.json @@ -0,0 +1 @@ +{"_id":"platform-specifying-test-package","name":"platform-specifying-test-package","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"platform-specifying-test-package","version":"1.0.0","description":"A package to test npm platform checks","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Brian Jenkins","email":"bonkydog@github.com"},"license":"ISC","os":["non-existent-os"],"_id":"platform-specifying-test-package@1.0.0","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-3Np3+FCsBeOWdhTftiBnvjBmK2dkqu/bjwU0smtx+2j4wVAzZBaOh25YvdqZGB6Eo5WykUHRLtQRPJ6V1sNeRQ==","shasum":"e8ebf03cb5a17e1d9e77e9d19ab22ae16c7f3daf","tarball":"https://registry.npmjs.org/platform-specifying-test-package/-/platform-specifying-test-package-1.0.0.tgz","fileCount":5,"unpackedSize":3481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbRvlCRA9TVsSAnZWagAAIQMP/jgNB73uGp5pHvkumGq7\nyA6DC6pqL3vU7Pwctr7QzYi+1jHcWwHtNHHTYwrZZru04xLpiQk8BohAfmOt\nEXstFVfMR/C/Y1pAxi3ITPj79zTmgixUVaor9knGWov8gHyFgQsg+2Jf/90E\nv0fOnAKe4+tb1xZNtKiG+Jc2KBIBhVG3g+YjYc8xYz8FaS4Gj9GPwozhE/kl\nHOu+cAXI/CM2nu1U0Q9Jgxna3i/uzXs8exZVzErgHs6sQPKxBpRwItcl4bOi\nkvUJA+QKmiUNHJauJc/1/vK4O8TD35+kiFSrg82MHnrYuDSzfpRhnjWFKlSb\nfcdLICfV0PhR/6KX4ct+uepUAHHJXBpOe48X5zXjMtFcl1MkImzNzXLbuOZ+\nXo+8LCCc7K5AuBx4HDkAHU0hjdG7k6FLf+fjIdeDbFy/bjPHzb6ecyKf73hX\n+Fh1szs37uwsT2M500qgYgfsLl2GuguBEz2IrFaA7ZGmzXZSF34lsH1dXDgY\nl/CFekaEvA4QaIvGL8BM8CdWkFA2VN8xTuZ9+gC9vsLOSnmaM8Qp1iS+mfr9\nVC5FhANvIi8Ckx0iNJQZ0pC8hMdrT5ox8/oSA42l8XZn4PWQWUco3RA6ksig\n2tcUTuRUDeb40SZV3i1l2xS76YBT4ROeYGyXoiPHBECIo4ps0mGmSd1v3Jdk\nk1n3\r\n=gZQk\r\n-----END PGP SIGNATURE-----\r\n"},"maintainers":[{"name":"bonkydog","email":"bonkydog@bonkydog.com"}],"_npmUser":{"name":"bonkydog","email":"bonkydog@bonkydog.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/platform-specifying-test-package_1.0.0_1600986085059_0.5894379369292746"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-24T22:21:25.059Z","1.0.0":"2020-09-24T22:21:25.202Z","modified":"2020-09-24T22:21:27.433Z"},"maintainers":[{"name":"bonkydog","email":"bonkydog@bonkydog.com"}],"description":"A package to test npm platform checks","author":{"name":"Brian Jenkins","email":"bonkydog@github.com"},"license":"ISC","readme":"ERROR: No README data found!","readmeFilename":""}