From 671cad1b18239d540da246d6f78de45d9f784396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 24 Jan 2019 11:24:58 -0800 Subject: [PATCH 01/26] npm-registry-fetch@3.9.0 Make sure publishing with legacy username:password _auth works again --- node_modules/npm-registry-fetch/CHANGELOG.md | 10 ++++++++++ node_modules/npm-registry-fetch/auth.js | 6 ++++++ node_modules/npm-registry-fetch/package.json | 16 +++++++++++----- package-lock.json | 6 +++--- package.json | 2 +- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/node_modules/npm-registry-fetch/CHANGELOG.md b/node_modules/npm-registry-fetch/CHANGELOG.md index 71232eff75c0e..56d849a773037 100644 --- a/node_modules/npm-registry-fetch/CHANGELOG.md +++ b/node_modules/npm-registry-fetch/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +# [3.9.0](https://github.com/npm/registry-fetch/compare/v3.8.0...v3.9.0) (2019-01-24) + + +### Features + +* **auth:** support username:password encoded legacy _auth ([a91f90c](https://github.com/npm/registry-fetch/commit/a91f90c)) + + + # [3.8.0](https://github.com/npm/registry-fetch/compare/v3.7.0...v3.8.0) (2018-08-23) diff --git a/node_modules/npm-registry-fetch/auth.js b/node_modules/npm-registry-fetch/auth.js index fa696b97ddee5..d583982d0a8b2 100644 --- a/node_modules/npm-registry-fetch/auth.js +++ b/node_modules/npm-registry-fetch/auth.js @@ -25,6 +25,12 @@ function getAuth (registry, opts) { if (AUTH.password) { AUTH.password = Buffer.from(AUTH.password, 'base64').toString('utf8') } + if (AUTH._auth && !(AUTH.username && AUTH.password)) { + let auth = Buffer.from(AUTH._auth, 'base64').toString() + auth = auth.split(':') + AUTH.username = auth.shift() + AUTH.password = auth.join(':') + } AUTH.alwaysAuth = AUTH.alwaysAuth === 'false' ? false : !!AUTH.alwaysAuth return AUTH } diff --git a/node_modules/npm-registry-fetch/package.json b/node_modules/npm-registry-fetch/package.json index 81a00978e2e4e..0ffa9a8b9e823 100644 --- a/node_modules/npm-registry-fetch/package.json +++ b/node_modules/npm-registry-fetch/package.json @@ -1,8 +1,8 @@ { "_from": "npm-registry-fetch@latest", - "_id": "npm-registry-fetch@3.8.0", + "_id": "npm-registry-fetch@3.9.0", "_inBundle": false, - "_integrity": "sha512-hrw8UMD+Nob3Kl3h8Z/YjmKamb1gf7D1ZZch2otrIXM3uFLB5vjEY6DhMlq80z/zZet6eETLbOXcuQudCB3Zpw==", + "_integrity": "sha512-srwmt8YhNajAoSAaDWndmZgx89lJwIZ1GWxOuckH4Coek4uHv5S+o/l9FLQe/awA+JwTnj4FJHldxhlXdZEBmw==", "_location": "/npm-registry-fetch", "_phantomChildren": {}, "_requested": { @@ -18,12 +18,18 @@ "_requiredBy": [ "#USER", "/", + "/libnpm", "/libnpmaccess", "/libnpmhook", + "/libnpmorg", + "/libnpmpublish", + "/libnpmsearch", + "/libnpmteam", + "/npm-profile", "/pacote" ], - "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-3.8.0.tgz", - "_shasum": "aa7d9a7c92aff94f48dba0984bdef4bd131c88cc", + "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-3.9.0.tgz", + "_shasum": "44d841780e2833f06accb34488f8c7450d1a6856", "_spec": "npm-registry-fetch@latest", "_where": "/Users/zkat/Documents/code/work/npm", "author": { @@ -92,5 +98,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "3.8.0" + "version": "3.9.0" } diff --git a/package-lock.json b/package-lock.json index a2f2fd4a3c079..f3b0c3b605b71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3296,9 +3296,9 @@ } }, "npm-registry-fetch": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-3.8.0.tgz", - "integrity": "sha512-hrw8UMD+Nob3Kl3h8Z/YjmKamb1gf7D1ZZch2otrIXM3uFLB5vjEY6DhMlq80z/zZet6eETLbOXcuQudCB3Zpw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-3.9.0.tgz", + "integrity": "sha512-srwmt8YhNajAoSAaDWndmZgx89lJwIZ1GWxOuckH4Coek4uHv5S+o/l9FLQe/awA+JwTnj4FJHldxhlXdZEBmw==", "requires": { "JSONStream": "^1.3.4", "bluebird": "^3.5.1", diff --git a/package.json b/package.json index 0b795b363e15c..31d5ebcbe6b92 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "npm-package-arg": "^6.1.0", "npm-packlist": "^1.2.0", "npm-pick-manifest": "^2.2.3", - "npm-registry-fetch": "^3.8.0", + "npm-registry-fetch": "^3.9.0", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", "once": "~1.4.0", From 89b23a5f7b0ccdcdda1d7d4d3eafb6903156d186 Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Wed, 30 Jan 2019 08:21:00 +0900 Subject: [PATCH 02/26] doc: use const in lib/fetch-package-metadata.md (#120) PR-URL: https://github.com/npm/cli/pull/120 Credit: @watilde Reviewed-By: @aeschright --- lib/fetch-package-metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fetch-package-metadata.md b/lib/fetch-package-metadata.md index 6fe4beac6eeed..7b4562341b1cb 100644 --- a/lib/fetch-package-metadata.md +++ b/lib/fetch-package-metadata.md @@ -1,7 +1,7 @@ fetch-package-metadata ---------------------- - var fetchPackageMetadata = require("npm/lib/fetch-package-metadata") + const fetchPackageMetadata = require("npm/lib/fetch-package-metadata") fetchPackageMetadata(spec, contextdir, callback) This will get package metadata (and if possible, ONLY package metadata) for From 4970d553c0ea66128931d118469fd31c87cc7986 Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Wed, 30 Jan 2019 08:25:38 +0900 Subject: [PATCH 03/26] misc: replace ronn with marked-man (#126) PR-URL: https://github.com/npm/cli/pull/126 Credit: @watilde Reviewed-By: @aeschright --- .npmignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index 1b32b033e23a7..12efef27852da 100644 --- a/.npmignore +++ b/.npmignore @@ -4,7 +4,7 @@ npm-debug.log /.github /test node_modules/marked -node_modules/ronn +node_modules/marked-man node_modules/tap node_modules/.bin node_modules/npm-registry-mock From d9b6090dc26cd0fded18b4f80248cff3e51bb185 Mon Sep 17 00:00:00 2001 From: Eli Doran Date: Tue, 29 Jan 2019 18:29:55 -0500 Subject: [PATCH 04/26] Reduce work to test if executable ends with a 'g'. (#138) PR-URL: https://github.com/npm/cli/pull/138 Credit: @elidoran Reviewed-By: @aeschright --- bin/npm-cli.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/npm-cli.js b/bin/npm-cli.js index 6f76b23828531..705aa472e7e55 100755 --- a/bin/npm-cli.js +++ b/bin/npm-cli.js @@ -25,7 +25,6 @@ unsupported.checkForUnsupportedNode() - var path = require('path') var npm = require('../lib/npm.js') var npmconf = require('../lib/config/core.js') var errorHandler = require('../lib/utils/error-handler.js') @@ -37,7 +36,7 @@ // if npm is called as "npmg" or "npm_g", then // run in global mode. - if (path.basename(process.argv[1]).slice(-1) === 'g') { + if (process.argv[1][process.argv[1].length - 1] === 'g') { process.argv.splice(1, 1, 'npm', '-g') } From cdb0592939d6256c80f7ec5a2b6251131a512a2a Mon Sep 17 00:00:00 2001 From: Lars Willighagen Date: Wed, 30 Jan 2019 00:31:32 +0100 Subject: [PATCH 05/26] test(maketest): Fix common.npm callback arguments (#144) PR-URL: https://github.com/npm/cli/pull/144 Credit: @larsgw Reviewed-By: @aeschright --- scripts/maketest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/maketest b/scripts/maketest index bf0c2c5f655db..4ef1e9266fb04 100755 --- a/scripts/maketest +++ b/scripts/maketest @@ -69,7 +69,7 @@ test('setup', t => { }) test('example', t => { - return common.npm(['install'], conf).then((code, stdout, stderr) => { + return common.npm(['install'], conf).then(([code, stdout, stderr]) => { t.is(code, 0, 'command ran ok') t.comment(stdout.trim()) t.comment(stderr.trim()) From 91314e77be09a50a275f59ccda314f7cfe269069 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 30 Jan 2019 00:46:16 +0100 Subject: [PATCH 06/26] install/dedupe: fix hoisting of packages with peerDeps (#147) PR-URL: https://github.com/npm/cli/pull/147 Fixes: https://npm.community/t/packages-with-peerdependencies-are-incorrectly-hoisted/4794 Credit: @sokra Reviewed-By: @aeschright --- lib/dedupe.js | 5 +- lib/install/deps.js | 29 ++++- test/tap/hoist-peer-dependencies.js | 130 ++++++++++++++++++++++ test/tap/unit-deps-earliestInstallable.js | 55 ++++++++- 4 files changed, 209 insertions(+), 10 deletions(-) create mode 100644 test/tap/hoist-peer-dependencies.js diff --git a/lib/dedupe.js b/lib/dedupe.js index 325faeaabcd43..fae409fea572d 100644 --- a/lib/dedupe.js +++ b/lib/dedupe.js @@ -142,8 +142,9 @@ function hoistChildren_ (tree, diff, seen, next) { [andComputeMetadata(tree)] ], done) } - var hoistTo = earliestInstallable(tree, tree.parent, child.package, log) - if (hoistTo) { + // find a location where it's installable + var hoistTo = earliestInstallable(tree, tree, child.package, log, child) + if (hoistTo && hoistTo !== tree) { move(child, hoistTo, diff) chain([ [andComputeMetadata(hoistTo)], diff --git a/lib/install/deps.js b/lib/install/deps.js index c36265093b090..1cf4de15dc3f1 100644 --- a/lib/install/deps.js +++ b/lib/install/deps.js @@ -650,7 +650,7 @@ function resolveWithNewModule (pkg, tree, log, next) { return isInstallable(pkg, (err) => { let installable = !err addBundled(pkg, (bundleErr) => { - var parent = earliestInstallable(tree, tree, pkg, log) || tree + var parent = earliestInstallable(tree, tree, pkg, log, null) || tree var isLink = pkg._requested.type === 'directory' var child = createChild({ package: pkg, @@ -755,11 +755,11 @@ function preserveSymlinks () { // Find the highest level in the tree that we can install this module in. // If the module isn't installed above us yet, that'd be the very top. // If it is, then it's the level below where its installed. -var earliestInstallable = exports.earliestInstallable = function (requiredBy, tree, pkg, log) { - validate('OOOO', arguments) +var earliestInstallable = exports.earliestInstallable = function (requiredBy, tree, pkg, log, ignoreChild) { + validate('OOOOZ|OOOOO', arguments) function undeletedModuleMatches (child) { - return !child.removed && moduleName(child) === pkg.name + return child !== ignoreChild && !child.removed && moduleName(child) === pkg.name } const undeletedMatches = tree.children.filter(undeletedModuleMatches) if (undeletedMatches.length) { @@ -778,7 +778,7 @@ var earliestInstallable = exports.earliestInstallable = function (requiredBy, tr // If any of the children of this tree have conflicting // binaries then we need to decline to install this package here. var binaryMatches = pkg.bin && tree.children.some(function (child) { - if (child.removed || !child.package.bin) return false + if (child === ignoreChild || child.removed || !child.package.bin) return false return Object.keys(child.package.bin).some(function (bin) { return pkg.bin[bin] }) @@ -804,6 +804,23 @@ var earliestInstallable = exports.earliestInstallable = function (requiredBy, tr if (tree.phantomChildren && tree.phantomChildren[pkg.name]) return null + // if any of the peer dependencies is a dependency of the current + // tree locations, we place the package here. This is a safe location + // where we don't violate the peer dependencies contract. + // It may not be the perfect location in some cases, but we don't know + // if dependencies are hoisted to another location yet, as they + // may not be loaded into the tree yet. + // We can ignore dev deps here as they are only installed on top-level + // and we can't hoist further than that anyway. + var peerDeps = pkg.peerDependencies + if (peerDeps) { + if (Object.keys(peerDeps).some(function (name) { + return deps[name] + })) { + return tree + } + } + if (tree.isTop) return tree if (tree.isGlobal) return tree @@ -812,5 +829,5 @@ var earliestInstallable = exports.earliestInstallable = function (requiredBy, tr if (!preserveSymlinks() && /^[.][.][\\/]/.test(path.relative(tree.parent.realpath, tree.realpath))) return tree - return (earliestInstallable(requiredBy, tree.parent, pkg, log) || tree) + return (earliestInstallable(requiredBy, tree.parent, pkg, log, ignoreChild) || tree) } diff --git a/test/tap/hoist-peer-dependencies.js b/test/tap/hoist-peer-dependencies.js new file mode 100644 index 0000000000000..75d7d3e778ada --- /dev/null +++ b/test/tap/hoist-peer-dependencies.js @@ -0,0 +1,130 @@ +'use strict' +const path = require('path') +const fs = require('fs') +const test = require('tap').test +const Tacks = require('tacks') +const File = Tacks.File +const Dir = Tacks.Dir +const common = require('../common-tap.js') + +const basedir = path.join(__dirname, path.basename(__filename, '.js')) +const testdir = path.join(basedir, 'testdir') +const cachedir = path.join(basedir, 'cache') +const globaldir = path.join(basedir, 'global') +const tmpdir = path.join(basedir, 'tmp') + +const conf = { + cwd: testdir, + env: common.newEnv().extend({ + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'warn' + }) +} + +const fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: Dir({ + package: Dir({ + 'package.json': File({ + name: 'package', + version: '1.0.0', + dependencies: { + 'base-dep': '../packages/base-dep-1.0.0.tgz', + 'plugin-dep': '../packages/plugin-dep-1.0.0.tgz' + } + }) + }), + 'package.json': File({ + version: '1.0.0', + dependencies: { + package: 'file:./package', + 'base-dep': './packages/base-dep-2.0.0.tgz' + } + }), + // file: dependencies do not work as they are symlinked and behave + // differently. Instead installation from tgz files is used. + packages: Dir({ + 'base-dep-1.0.0.tgz': File(Buffer.from( + '1f8b080000000000000a2b484cce4e4c4fd52f80d07a59c5f9790c540606' + + '06066666660ad8c4c1c0d45c81c1d8d4ccc0d0d0ccccc0448101c8303505' + + 'd1d4760836505a5c925804740aa5e640bca200a78708a8e6525050ca4bcc' + + '4d55b252504a4a2c4ed54d492d50d2018996a5161567e6e781240cf50cf4' + + '0c94b86ab906dab9a360148c8251300aa80400a44d97d100080000', + 'hex' + )), + 'base-dep-2.0.0.tgz': File(Buffer.from( + '1f8b080000000000000a2b484cce4e4c4fd52f80d07a59c5f9790c540606' + + '06066666660ad8c4c1c0d45c81c1d8d4ccc0d0d0ccccc0448101c8303505' + + 'd1d4760836505a5c925804740aa5e640bca200a78708a8e6525050ca4bcc' + + '4d55b252504a4a2c4ed54d492d50d2018996a5161567e6e781248cf40cf4' + + '0c94b86ab906dab9a360148c8251300aa80400aebbeeba00080000', + 'hex' + )), + 'plugin-dep-1.0.0.tgz': File(Buffer.from( + '1f8b080000000000000aed8f3d0e83300c8599394594b904476d3274e622' + + '295888fe8488408756dcbd0e513bb115a9aa946f79ce7bb1653b535f4c8b' + + 'a58b2acebeb7d9c60080d69aadf90119b2bdd220a98203cba8504a916ebd' + + 'c81a931fcd40ab7c3b27dec23efa273c73c6b83537e447c6dd756a3b5b34' + + 'e8f82ef8771c7cd7db10490102a2eb10870a1dda066ddda1a7384ca1e464' + + '3c2eddd42044f97e164bb318db07a77f733ee7bfbe3a914824122f4e04e9' + + '2e00080000', + 'hex' + )) + }) + }) +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', t => { + setup() + return common.fakeRegistry.listen() +}) + +test('example', t => { + return common.npm(['install'], conf).then(([code, stdout, stderr]) => { + t.is(code, 0, 'command ran ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.ok(fs.existsSync(path.join(testdir, 'node_modules')), 'did install') + var packageLock = JSON.parse(fs.readFileSync(path.join(testdir, 'package-lock.json'), 'utf8')) + t.similar(packageLock, { + dependencies: { + 'base-dep': { + version: 'file:packages/base-dep-2.0.0.tgz' + }, + 'package': { + version: 'file:package', + dependencies: { + 'base-dep': { + version: 'file:packages/base-dep-1.0.0.tgz' + }, + // plugin-dep must not placed on top-level + 'plugin-dep': { + version: 'file:packages/plugin-dep-1.0.0.tgz' + } + } + } + } + }, 'locks dependencies as unhoisted') + t.similar(Object.keys(packageLock.dependencies), ['base-dep', 'package'], 'has correct packages on top-level') + }) +}) + +test('cleanup', t => { + common.fakeRegistry.close() + cleanup() + t.done() +}) diff --git a/test/tap/unit-deps-earliestInstallable.js b/test/tap/unit-deps-earliestInstallable.js index 47d1ab4119b1e..136e6478c586a 100644 --- a/test/tap/unit-deps-earliestInstallable.js +++ b/test/tap/unit-deps-earliestInstallable.js @@ -67,7 +67,7 @@ test('earliestInstallable should consider devDependencies', function (t) { dep2a.parent = dep1 dep2.parent = pkg - var earliest = earliestInstallable(dep1, dep1, dep2a.package, log) + var earliest = earliestInstallable(dep1, dep1, dep2a.package, log, null) t.isDeeply(earliest, dep1, 'should hoist package when an incompatible devDependency is present') t.end() }) @@ -108,7 +108,58 @@ test('earliestInstallable should reuse shared prod/dev deps when they are identi dep1.parent = pkg dep2.parent = pkg - var earliest = earliestInstallable(dep1, dep1, dep2.package, log) + var earliest = earliestInstallable(dep1, dep1, dep2.package, log, null) t.isDeeply(earliest, pkg, 'should reuse identical shared dev/prod deps when installing both') t.end() }) + +test('earliestInstallable should consider peerDependencies', function (t) { + var dep1 = { + children: [], + package: { + name: 'dep1', + dependencies: { + dep2: '1.0.0', + dep3: '1.0.0' + } + }, + path: '/dep1', + realpath: '/dep1' + } + + var dep2 = { + package: { + name: 'dep2', + version: '1.0.0', + peerDependencies: { + dep3: '1.0.0' + }, + _requested: npa('dep2@^1.0.0') + }, + parent: dep1, + path: '/dep1/node_modules/dep2', + realpath: '/dep1/node_modules/dep2' + } + + var pkg = { + isTop: true, + children: [dep1], + package: { + name: 'pkg', + dependencies: { dep1: '1.0.0' } + }, + path: '/', + realpath: '/' + } + + dep1.parent = pkg + + var earliest = earliestInstallable(dep1, dep1, dep2.package, log, null) + t.isDeeply(earliest, dep1, 'should not be able to hoist the package to top-level') + + dep1.children.push(dep2) + + var earliestWithIgnore = earliestInstallable(dep1, dep1, dep2.package, log, dep2) + t.isDeeply(earliestWithIgnore, dep1, 'should not be able to hoist the package to top-level') + t.end() +}) From 25573e9b9d5d26261c68d453f06db5b3b1cd6789 Mon Sep 17 00:00:00 2001 From: Lars Willighagen Date: Wed, 30 Jan 2019 00:48:58 +0100 Subject: [PATCH 07/26] ls: show installed but unmet peer deps (#145) PR-URL: https://github.com/npm/cli/pull/145 Fixes: https://npm.community/t/4770 Credit: @larsgw Reviewed-By: @aeschright --- lib/ls.js | 2 +- test/tap/ls-peer.js | 123 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 test/tap/ls-peer.js diff --git a/lib/ls.js b/lib/ls.js index bb5e433f78fde..8653fc718ae4a 100644 --- a/lib/ls.js +++ b/lib/ls.js @@ -305,7 +305,7 @@ function filterFound (root, args) { if (!markDeps) continue Object.keys(markDeps).forEach(function (depName) { var dep = markDeps[depName] - if (dep.peerMissing) return + if (dep.peerMissing && !dep._from) return dep._parent = markPkg for (var ii = 0; ii < args.length; ii++) { var argName = args[ii][0] diff --git a/test/tap/ls-peer.js b/test/tap/ls-peer.js new file mode 100644 index 0000000000000..826380932a147 --- /dev/null +++ b/test/tap/ls-peer.js @@ -0,0 +1,123 @@ +'use strict' +const path = require('path') +const test = require('tap').test +const Tacks = require('tacks') +const File = Tacks.File +const Dir = Tacks.Dir +const common = require('../common-tap.js') + +const basedir = path.join(__dirname, path.basename(__filename, '.js')) +const testdir = path.join(basedir, 'testdir') +const cachedir = path.join(basedir, 'cache') +const globaldir = path.join(basedir, 'global') +const tmpdir = path.join(basedir, 'tmp') + +const conf = { + cwd: testdir, + env: common.newEnv().extend({ + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'warn' + }) +} + +const fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: Dir({ + 'package.json': File({ + name: 'fixture', + version: '1.0.0', + dependencies: { + dep: 'file:dep-1.0.0.tgz', + 'peer-dep': 'file:peer-dep-2.0.0.tgz' + } + }), + // Source dir + // dep: Dir({ + // 'package.json': File({ + // name: 'dep', + // version: '1.0.0', + // peerDependencies: { + // 'peer-dep': 'file:peer-dep-1.0.0.tgz' + // } + // }) + // }), + 'dep-1.0.0.tgz': File(Buffer.from( + '1f8b0800000000000003ed8f3d0ec2300c853be71451661a1cd166e8cc45' + + 'a2d654e1278d92c200eadd491a60ea462584946fb1f5fc9e655bd59e548f' + + '5b9b2a3ffac1142b0300b2aae8921e1152d062574b10424a08bed0d4d10f' + + '6b1fb2c4d58fca8553bedd937ea19ffa273c08a5cca80bb286b20e2ddb44' + + 'e186ceebc1444d70e090548be8f668d174685a8d3e8c63fc3529633a040e' + + 'fa8ccd5b28e7381ffb3b0bce894ce4d70f6732994c66e60975aec5690008' + + '0000', + 'hex' + )), + // Source dir + // 'peer-dep': Dir({ + // 'package.json': File({ + // name: 'peer-dep', + // version: '2.0.0' + // }) + // }), + 'peer-dep-1.0.0.tgz': File(Buffer.from( + '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + + '06066626260ad8c4c1c0d45c81c1d8d4ccc0d0d0cccc00a80ec830353500' + + 'd2d4760836505a5c925804740aa5e640bca200a78708a8e6525050ca4bcc' + + '4d55b252502a484d2dd24d492d50d2018996a5161567e6e781240cf50cf4' + + '0c94b86ab906dab9a360148c8251300aa80400c1c67f6300080000', + 'hex' + )), + 'peer-dep-2.0.0.tgz': File(Buffer.from( + '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + + '06066626260ad8c4c1c0d45c81c1d8d4ccc0d0d0cccc00a80ec830353500' + + 'd2d4760836505a5c925804740aa5e640bca200a78708a8e6525050ca4bcc' + + '4d55b252502a484d2dd24d492d50d2018996a5161567e6e781248cf40cf4' + + '0c94b86ab906dab9a360148c8251300aa80400cb30060800080000', + 'hex' + )) + }) +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', t => { + setup() + return common.fakeRegistry.listen().then(() => common.npm(['install'], conf)) +}) + +test('list warns about unmet peer dependency', t => { + return common.npm(['ls'], conf).then(([code, stdout, stderr]) => { + t.is(code, 1, 'command ran not ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.match(stdout, 'UNMET PEER DEPENDENCY peer-dep@2.0.0') + t.match(stderr, 'npm ERR! peer dep missing: peer-dep@file:peer-dep-1.0.0.tgz, required by dep@1.0.0') + }) +}) + +test('list shows installed but unmet peer dependency', t => { + return common.npm(['ls', 'peer-dep'], conf).then(([code, stdout, stderr]) => { + t.is(code, 1, 'command ran not ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.match(stdout, 'UNMET PEER DEPENDENCY peer-dep@2.0.0') + t.match(stderr, 'npm ERR! peer dep missing: peer-dep@file:peer-dep-1.0.0.tgz, required by dep@1.0.0') + }) +}) + +test('cleanup', t => { + common.fakeRegistry.close() + cleanup() + t.done() +}) From 3663cdef205fa9ba2c2830e5ef7ceeb31c30298c Mon Sep 17 00:00:00 2001 From: Grey Baker Date: Tue, 29 Jan 2019 23:52:59 +0000 Subject: [PATCH 08/26] doc: update package.json docs to include repository.directory details (#140) PR-URL: https://github.com/npm/cli/pull/140 Credit: @greysteil Reviewed-By: @aeschright --- doc/files/package.json.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/files/package.json.md b/doc/files/package.json.md index dd6492af08430..95e77d34c5f9f 100644 --- a/doc/files/package.json.md +++ b/doc/files/package.json.md @@ -393,6 +393,15 @@ shortcut syntax you use for `npm install`: "repository": "gitlab:user/repo" +If the `package.json` for your package is not in the root directory (for example +if it is part of a monorepo), you can specify the directory in which it lives: + + "repository": { + "type" : "git", + "url" : "https://github.com/facebook/react.git", + "directory": "packages/react-dom" + } + ## scripts The "scripts" property is a dictionary containing script commands that are run From ce2c4bd1a2ce7ac1727a4ca9a350b743a2e27b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 29 Jan 2019 16:02:36 -0800 Subject: [PATCH 09/26] token: use figgy-config to make sure extra opts are there (#149) PR-URL: https://github.com/npm/cli/pull/149 Credit: @zkat Reviewed-By: @aeschright --- lib/token.js | 46 +++++++++++++++++++++------- test/tap/unit-token-validate-cidr.js | 3 +- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/lib/token.js b/lib/token.js index cccbba2f9ad75..326f98ec7ef87 100644 --- a/lib/token.js +++ b/lib/token.js @@ -1,6 +1,9 @@ 'use strict' + const profile = require('libnpm/profile') const npm = require('./npm.js') +const figgyPudding = require('figgy-pudding') +const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') const Table = require('cli-table3') const Bluebird = require('bluebird') @@ -76,22 +79,43 @@ function generateTokenIds (tokens, minLength) { return byId } +const TokenConfig = figgyPudding({ + registry: {}, + otp: {}, + cidr: {}, + 'read-only': {}, + json: {}, + parseable: {} +}) + function config () { - const conf = { - json: npm.config.get('json'), - parseable: npm.config.get('parseable'), - registry: npm.config.get('registry'), - otp: npm.config.get('otp') - } + let conf = TokenConfig(npmConfig()) const creds = npm.config.getCredentialsByURI(conf.registry) if (creds.token) { - conf.auth = {token: creds.token} + conf = conf.concat({ + auth: { token: creds.token } + }) } else if (creds.username) { - conf.auth = {basic: {username: creds.username, password: creds.password}} + conf = conf.concat({ + auth: { + basic: { + username: creds.username, + password: creds.password + } + } + }) } else if (creds.auth) { const auth = Buffer.from(creds.auth, 'base64').toString().split(':', 2) - conf.auth = {basic: {username: auth[0], password: auth[1]}} + conf = conf.concat({ + auth: { + basic: { + username: auth[0], + password: auth[1] + } + } + }) } else { + conf = conf.concat({ auth: {} }) conf.auth = {} } if (conf.otp) conf.auth.otp = conf.otp @@ -183,8 +207,8 @@ function rm (args) { function create (args) { const conf = config() - const cidr = npm.config.get('cidr') - const readonly = npm.config.get('read-only') + const cidr = conf.cidr + const readonly = conf['read-only'] const validCIDR = validateCIDRList(cidr) return readUserInfo.password().then((password) => { diff --git a/test/tap/unit-token-validate-cidr.js b/test/tap/unit-token-validate-cidr.js index db963c31f386d..cda91b8f1e0da 100644 --- a/test/tap/unit-token-validate-cidr.js +++ b/test/tap/unit-token-validate-cidr.js @@ -1,7 +1,6 @@ 'use strict' const test = require('tap').test -const requireInject = require('require-inject') -const validateCIDRList = requireInject('../../lib/token.js', {'../../lib/npm.js': {}})._validateCIDRList +const validateCIDRList = require('../../lib/token.js')._validateCIDRList test('validateCIDRList', (t) => { t.plan(10) From 95ca1aef4077c8e68d9f4dce37f6ba49b591c4ca Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 30 Jan 2019 12:13:47 -0800 Subject: [PATCH 10/26] pacote@9.4.1 --- node_modules/.gitignore | 1 - node_modules/pacote/CHANGELOG.md | 10 +++++++++ node_modules/pacote/lib/fetchers/directory.js | 5 +++-- node_modules/pacote/lib/finalize-manifest.js | 3 ++- node_modules/pacote/lib/util/read-json.js | 15 +++++++++++++ node_modules/pacote/package.json | 22 +++++++++---------- package-lock.json | 6 ++--- package.json | 2 +- 8 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 node_modules/pacote/lib/util/read-json.js diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 06e52612ce876..ac8c182e8fdc7 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -1,5 +1,4 @@ ## Automatically generated dev dependency ignores -/@types /@types/caseless /@types/form-data /@types/node diff --git a/node_modules/pacote/CHANGELOG.md b/node_modules/pacote/CHANGELOG.md index 50a0dbde402cb..a7784d9bb1193 100644 --- a/node_modules/pacote/CHANGELOG.md +++ b/node_modules/pacote/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [9.4.1](https://github.com/zkat/pacote/compare/v9.4.0...v9.4.1) (2019-01-24) + + +### Bug Fixes + +* **directory, finalize-manifest:** strip byte order marker from JSON ([723ad63](https://github.com/zkat/pacote/commit/723ad63)) + + + # [9.4.0](https://github.com/zkat/pacote/compare/v9.3.0...v9.4.0) (2019-01-14) diff --git a/node_modules/pacote/lib/fetchers/directory.js b/node_modules/pacote/lib/fetchers/directory.js index 83f3d7d558cb1..3d4ec24c83f27 100644 --- a/node_modules/pacote/lib/fetchers/directory.js +++ b/node_modules/pacote/lib/fetchers/directory.js @@ -5,6 +5,7 @@ const BB = require('bluebird') const Fetcher = require('../fetch') const glob = BB.promisify(require('glob')) const packDir = require('../util/pack-dir') +const readJson = require('../util/read-json') const path = require('path') const pipe = BB.promisify(require('mississippi').pipe) const through = require('mississippi').through @@ -34,11 +35,11 @@ Fetcher.impl(fetchDirectory, { const pkgPath = path.join(spec.fetchSpec, 'package.json') const srPath = path.join(spec.fetchSpec, 'npm-shrinkwrap.json') return BB.join( - readFileAsync(pkgPath).then(JSON.parse).catch({ code: 'ENOENT' }, err => { + readFileAsync(pkgPath).then(readJson).catch({ code: 'ENOENT' }, err => { err.code = 'ENOPACKAGEJSON' throw err }), - readFileAsync(srPath).then(JSON.parse).catch({ code: 'ENOENT' }, () => null), + readFileAsync(srPath).then(readJson).catch({ code: 'ENOENT' }, () => null), (pkg, sr) => { pkg._shrinkwrap = sr pkg._hasShrinkwrap = !!sr diff --git a/node_modules/pacote/lib/finalize-manifest.js b/node_modules/pacote/lib/finalize-manifest.js index 80b379898fe4c..f047517945192 100644 --- a/node_modules/pacote/lib/finalize-manifest.js +++ b/node_modules/pacote/lib/finalize-manifest.js @@ -13,6 +13,7 @@ const path = require('path') const pipe = BB.promisify(require('mississippi').pipe) const ssri = require('ssri') const tar = require('tar') +const readJson = require('./util/read-json') // `finalizeManifest` takes as input the various kinds of manifests that // manifest handlers ('lib/fetchers/*.js#manifest()') return, and makes sure @@ -212,7 +213,7 @@ function jsonFromStream (filename, dataStream) { entry.on('error', cb) finished(entry).then(() => { try { - cb(null, JSON.parse(data)) + cb(null, readJson(data)) } catch (err) { cb(err) } diff --git a/node_modules/pacote/lib/util/read-json.js b/node_modules/pacote/lib/util/read-json.js new file mode 100644 index 0000000000000..32fffbc53746b --- /dev/null +++ b/node_modules/pacote/lib/util/read-json.js @@ -0,0 +1,15 @@ +'use strict' + +module.exports = function (content) { + // Code also yanked from read-package-json. + function stripBOM (content) { + content = content.toString() + // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + // because the buffer-to-string conversion in `fs.readFileSync()` + // translates it to FEFF, the UTF-16 BOM. + if (content.charCodeAt(0) === 0xFEFF) return content.slice(1) + return content + } + + return JSON.parse(stripBOM(content)) +} diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index 32e8a07b094e1..96ae38bd682a6 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,8 +1,8 @@ { - "_from": "pacote@9.4.0", - "_id": "pacote@9.4.0", + "_from": "pacote@9.4.1", + "_id": "pacote@9.4.1", "_inBundle": false, - "_integrity": "sha512-WQ1KL/phGMkedYEQx9ODsjj7xvwLSpdFJJdEXrLyw5SILMxcTNt5DTxT2Z93fXuLFYJBlZJdnwdalrQdB/rX5w==", + "_integrity": "sha512-YKSRsQqmeHxgra0KCdWA2FtVxDPUlBiCdmew+mSe44pzlx5t1ViRMWiQg18T+DREA+vSqYfKzynaToFR4hcKHw==", "_location": "/pacote", "_phantomChildren": { "safe-buffer": "5.1.2" @@ -10,12 +10,12 @@ "_requested": { "type": "version", "registry": true, - "raw": "pacote@9.4.0", + "raw": "pacote@9.4.1", "name": "pacote", "escapedName": "pacote", - "rawSpec": "9.4.0", + "rawSpec": "9.4.1", "saveSpec": null, - "fetchSpec": "9.4.0" + "fetchSpec": "9.4.1" }, "_requiredBy": [ "#USER", @@ -23,10 +23,10 @@ "/libcipm", "/libnpm" ], - "_resolved": "https://registry.npmjs.org/pacote/-/pacote-9.4.0.tgz", - "_shasum": "af979abdeb175cd347c3e33be3241af1ed254807", - "_spec": "pacote@9.4.0", - "_where": "/Users/aeschright/code/cli", + "_resolved": "https://registry.npmjs.org/pacote/-/pacote-9.4.1.tgz", + "_shasum": "f0af2a52d241bce523d39280ac810c671db62279", + "_spec": "pacote@9.4.1", + "_where": "/Users/aeschright/code/npm-release", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -116,5 +116,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "9.4.0" + "version": "9.4.1" } diff --git a/package-lock.json b/package-lock.json index f3b0c3b605b71..91cf495c35d7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6145,9 +6145,9 @@ } }, "pacote": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.4.0.tgz", - "integrity": "sha512-WQ1KL/phGMkedYEQx9ODsjj7xvwLSpdFJJdEXrLyw5SILMxcTNt5DTxT2Z93fXuLFYJBlZJdnwdalrQdB/rX5w==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.4.1.tgz", + "integrity": "sha512-YKSRsQqmeHxgra0KCdWA2FtVxDPUlBiCdmew+mSe44pzlx5t1ViRMWiQg18T+DREA+vSqYfKzynaToFR4hcKHw==", "requires": { "bluebird": "^3.5.3", "cacache": "^11.3.2", diff --git a/package.json b/package.json index 31d5ebcbe6b92..30635ff3c8f8e 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "once": "~1.4.0", "opener": "^1.5.1", "osenv": "^0.1.5", - "pacote": "^9.4.0", + "pacote": "^9.4.1", "path-is-inside": "~1.0.2", "promise-inflight": "~1.0.1", "qrcode-terminal": "^0.12.0", From dacc47dfadc8a8b8e3ef20434dff42f255856a06 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 30 Jan 2019 13:22:27 -0800 Subject: [PATCH 11/26] chore: add changelog for v6.8.0 --- CHANGELOG.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 794ae1060441e..3811a970b0cfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,66 @@ +## v6.8.0 (2019-01-31): + +This release includes an implementation of [RFC #10](https://github.com/npm/rfcs/blob/latest/accepted/0010-monorepo-subdirectory-declaration.md), documenting an optional field that can be used to specify +the directory path for a package within a monorepo. + +### NEW FEATURES + +* [`3663cdef2`](https://github.com/npm/cli/commit/3663cdef205fa9ba2c2830e5ef7ceeb31c30298c) + [#140](https://github.com/npm/cli/pull/140) + Update package.json docs to include repository.directory details. + ([@greysteil](https://github.com/greysteil)) + +### BUGFIXES + +* [`550bf703a`](https://github.com/npm/cli/commit/550bf703ae3e31ba6a300658ae95b6937f67b68f) + Add @types to ignore list to fix git clean -fd. + ([@zkat](https://github.com/zkat)) +* [`cdb059293`](https://github.com/npm/cli/commit/cdb0592939d6256c80f7ec5a2b6251131a512a2a) + [#144](https://github.com/npm/cli/pull/144) + Fix common.npm callback arguments. + ([@larsgw](https://github.com/larsgw)) +* [`91314e77b`](https://github.com/npm/cli/commit/91314e77be09a50a275f59ccda314f7cfe269069) + [npm.community#4794](https://npm.community/t/packages-with-peerdependencies-are-incorrectly-hoisted/4794) + Fix hoisting of packages with peerDeps. + ([@sokra](https://github.com/sokra)) +* [`25573e9b9`](https://github.com/npm/cli/commit/25573e9b9d5d26261c68d453f06db5b3b1cd6789) + [npm.community#4770](https://npm.community/t/https://npm.community/t/4770) + Show installed but unmet peer deps. + ([@larsgw](https://github.com/larsgw)) +* [`ce2c4bd1a`](https://github.com/npm/cli/commit/ce2c4bd1a2ce7ac1727a4ca9a350b743a2e27b2a) + [#149](https://github.com/npm/cli/pull/149) + Use figgy-config to make sure extra opts are there. + ([@zkat](https://github.com/zkat)) + +### DEPENDENCY BUMPS + +* [`d72141080`](https://github.com/npm/cli/commit/d72141080ec8fcf35bcc5650245efbe649de053e) + `npm-registry-couchapp@2.7.1` + ([@zkat](https://github.com/zkat)) +* [`671cad1b1`](https://github.com/npm/cli/commit/671cad1b18239d540da246d6f78de45d9f784396) + `npm-registry-fetch@3.9.0`: + Make sure publishing with legacy username:password `_auth` works again. + ([@zkat](https://github.com/zkat)) +* [`95ca1aef4`](https://github.com/npm/cli/commit/95ca1aef4077c8e68d9f4dce37f6ba49b591c4ca) + `pacote@9.4.1` + ([@aeschright](https://github.com/aeschright)) + +### MISC + +* [`89b23a5f7`](https://github.com/npm/cli/commit/89b23a5f7b0ccdcdda1d7d4d3eafb6903156d186) + [#120](https://github.com/npm/cli/pull/120) + Use `const` in lib/fetch-package-metadata.md. + ([@watilde](https://github.com/watilde)) +* [`4970d553c`](https://github.com/npm/cli/commit/4970d553c0ea66128931d118469fd31c87cc7986) + [#126](https://github.com/npm/cli/pull/126) + Replace ronn with marked-man in `.npmignore`. + ([@watilde](https://github.com/watilde)) +* [`d9b6090dc`](https://github.com/npm/cli/commit/d9b6090dc26cd0fded18b4f80248cff3e51bb185) + [#138](https://github.com/npm/cli/pull/138) + Reduce work to test if executable ends with a 'g'. + ([@elidoran](https://github.com/elidoran)) + ([@larsgw](https://github.com/larsgw)) + ## v6.7.0 (2019-01-23): Hey y'all! This is a quick hotfix release that includes some important fixes to From f28a94c53f6bffa82c849dc269dd93c5dba0bb92 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Thu, 31 Jan 2019 11:59:02 -0800 Subject: [PATCH 12/26] update AUTHORS --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index a011b51d6a036..705b7c5c80339 100644 --- a/AUTHORS +++ b/AUTHORS @@ -619,3 +619,6 @@ Beni von Cheni Frédéric Harper Johannes Würbach ƇʘƁ̆ąƇ́ +Eli Doran +Tobias Koppers +Grey Baker From 309260d03d0408f712b5fcd35f01baee210c9787 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Thu, 31 Jan 2019 11:59:09 -0800 Subject: [PATCH 13/26] 6.8.0-next.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 91cf495c35d7d..a2201108d4c2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "npm", - "version": "6.7.0", + "version": "6.8.0-next.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30635ff3c8f8e..0244769929dae 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "6.7.0", + "version": "6.8.0-next.0", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ From 3c22d1a35878f73c0af8ea5968b962a85a1a9b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Mon, 4 Feb 2019 11:05:43 -0800 Subject: [PATCH 14/26] access: ls-collaborators is ok with non-scoped (#151) PR-URL: https://github.com/npm/cli/pull/151 Fixes: https://npm.community/t/npm-6-6-0-breaks-access-to-ls-collaborators/5101 Credit: @zkat Reviewed-By: @aeschright --- lib/access.js | 2 +- test/tap/access.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/access.js b/lib/access.js index 4bb93fda1d0ee..6657f4b0717a1 100644 --- a/lib/access.js +++ b/lib/access.js @@ -154,7 +154,7 @@ access['ls-packages'] = access.lsPackages = ([owner], opts) => { } access['ls-collaborators'] = access.lsCollaborators = ([pkg, usr], opts) => { - return getPackage(pkg).then(pkgName => + return getPackage(pkg, false).then(pkgName => libaccess.lsCollaborators(pkgName, usr, opts) ).then(collabs => { // TODO - print these out nicely (breaking change) diff --git a/test/tap/access.js b/test/tap/access.js index 6a21ccc8fb3ef..d400b4d33b134 100644 --- a/test/tap/access.js +++ b/test/tap/access.js @@ -469,6 +469,34 @@ test('npm access ls-collaborators on package', function (t) { ) }) +test('npm access ls-collaborators on unscoped', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + server.get( + '/-/package/pkg/collaborators?format=cli' + ).reply(200, serverCollaborators) + common.npm( + [ + 'access', + 'ls-collaborators', + 'pkg', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-collaborators') + t.same(JSON.parse(stdout), clientCollaborators) + t.end() + } + ) +}) + test('npm access ls-collaborators on current w/user filter', function (t) { var serverCollaborators = { 'myorg:myteam': 'write', From 322fef40376e71cd100159dc914e7ca89faae327 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 6 Feb 2019 11:02:42 -0800 Subject: [PATCH 15/26] normalize-package-data@2.5.0 --- node_modules/.gitignore | 2 +- node_modules/is-builtin-module/index.js | 10 - node_modules/is-builtin-module/package.json | 75 --- node_modules/is-builtin-module/readme.md | 33 - node_modules/normalize-package-data/README.md | 2 +- .../normalize-package-data/lib/fixer.js | 5 +- .../node_modules/resolve/.editorconfig | 20 + .../node_modules/resolve/.eslintignore | 1 + .../node_modules/resolve/.travis.yml | 269 ++++++++ .../node_modules/resolve/CHANGELOG.md | 629 ++++++++++++++++++ .../node_modules/resolve/LICENSE | 18 + .../node_modules/resolve/appveyor.yml | 47 ++ .../node_modules/resolve/changelog.hbs | 36 + .../node_modules/resolve/example/async.js | 5 + .../node_modules/resolve/example/sync.js | 3 + .../node_modules/resolve/index.js | 8 + .../node_modules/resolve/lib/async.js | 229 +++++++ .../node_modules/resolve/lib/caller.js | 8 + .../node_modules/resolve/lib/core.js | 53 ++ .../node_modules/resolve/lib/core.json | 73 ++ .../resolve/lib/node-modules-paths.js | 42 ++ .../resolve/lib/normalize-options.js | 10 + .../node_modules/resolve/lib/sync.js | 154 +++++ .../node_modules/resolve/package.json | 71 ++ .../node_modules/resolve/readme.markdown | 179 +++++ .../node_modules/resolve/test/core.js | 82 +++ .../node_modules/resolve/test/dotdot.js | 29 + .../resolve/test/dotdot/abc/index.js | 2 + .../node_modules/resolve/test/dotdot/index.js | 1 + .../resolve/test/faulty_basedir.js | 29 + .../node_modules/resolve/test/filter.js | 34 + .../node_modules/resolve/test/filter_sync.js | 26 + .../node_modules/resolve/test/mock.js | 143 ++++ .../node_modules/resolve/test/mock_sync.js | 67 ++ .../node_modules/resolve/test/module_dir.js | 56 ++ .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 121 ++++ .../node_modules/resolve/test/node_path.js | 70 ++ .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + .../node_modules/resolve/test/nonstring.js | 9 + .../node_modules/resolve/test/pathfilter.js | 75 +++ .../resolve/test/pathfilter/deep_ref/main.js | 0 .../node_modules/resolve/test/precedence.js | 23 + .../resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + .../resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + .../node_modules/resolve/test/resolver.js | 429 ++++++++++++ .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 3 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + .../resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + .../node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + .../resolve/test/resolver/mug.coffee | 0 .../node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/without_basedir/main.js | 5 + .../resolve/test/resolver_sync.js | 340 ++++++++++ .../node_modules/resolve/test/subdirs.js | 13 + .../node_modules/resolve/test/symlinks.js | 56 ++ .../normalize-package-data/package.json | 42 +- node_modules/path-parse/.travis.yml | 9 + .../license => path-parse/LICENSE} | 10 +- node_modules/path-parse/README.md | 42 ++ node_modules/path-parse/index.js | 93 +++ node_modules/path-parse/package.json | 65 ++ node_modules/path-parse/test.js | 77 +++ package-lock.json | 32 +- package.json | 2 +- 98 files changed, 3938 insertions(+), 164 deletions(-) delete mode 100644 node_modules/is-builtin-module/index.js delete mode 100644 node_modules/is-builtin-module/package.json delete mode 100644 node_modules/is-builtin-module/readme.md create mode 100644 node_modules/normalize-package-data/node_modules/resolve/.editorconfig create mode 100644 node_modules/normalize-package-data/node_modules/resolve/.eslintignore create mode 100644 node_modules/normalize-package-data/node_modules/resolve/.travis.yml create mode 100644 node_modules/normalize-package-data/node_modules/resolve/CHANGELOG.md create mode 100644 node_modules/normalize-package-data/node_modules/resolve/LICENSE create mode 100644 node_modules/normalize-package-data/node_modules/resolve/appveyor.yml create mode 100644 node_modules/normalize-package-data/node_modules/resolve/changelog.hbs create mode 100644 node_modules/normalize-package-data/node_modules/resolve/example/async.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/example/sync.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/lib/async.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/lib/caller.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/lib/core.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/lib/core.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/lib/normalize-options.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/lib/sync.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/readme.markdown create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/core.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/dotdot.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/filter.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/mock.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/module_dir.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/node_path.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/nonstring.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/precedence.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/subdirs.js create mode 100644 node_modules/normalize-package-data/node_modules/resolve/test/symlinks.js create mode 100644 node_modules/path-parse/.travis.yml rename node_modules/{is-builtin-module/license => path-parse/LICENSE} (85%) create mode 100644 node_modules/path-parse/README.md create mode 100644 node_modules/path-parse/index.js create mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/path-parse/test.js diff --git a/node_modules/.gitignore b/node_modules/.gitignore index ac8c182e8fdc7..8cff09c21384f 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -15,6 +15,7 @@ /bind-obj-methods /browser-process-hrtime /browser-request +/builtin-modules /caller /caller-path /callsites @@ -126,7 +127,6 @@ /own-or-env /parse-json /parseurl -/path-parse /path-type /pinkie /pinkie-promise diff --git a/node_modules/is-builtin-module/index.js b/node_modules/is-builtin-module/index.js deleted file mode 100644 index b6cfa616ae85c..0000000000000 --- a/node_modules/is-builtin-module/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var builtinModules = require('builtin-modules'); - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return builtinModules.indexOf(str) !== -1; -}; diff --git a/node_modules/is-builtin-module/package.json b/node_modules/is-builtin-module/package.json deleted file mode 100644 index d1cd899d9ad65..0000000000000 --- a/node_modules/is-builtin-module/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "is-builtin-module@^1.0.0", - "_id": "is-builtin-module@1.0.0", - "_inBundle": false, - "_integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "_location": "/is-builtin-module", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-builtin-module@^1.0.0", - "name": "is-builtin-module", - "escapedName": "is-builtin-module", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/normalize-package-data" - ], - "_resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "_shasum": "540572d34f7ac3119f8f76c30cbc1b1e037affbe", - "_spec": "is-builtin-module@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/normalize-package-data", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-builtin-module/issues" - }, - "bundleDependencies": false, - "dependencies": { - "builtin-modules": "^1.0.0" - }, - "deprecated": false, - "description": "Check if a string matches the name of a Node.js builtin module", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-builtin-module#readme", - "keywords": [ - "builtin", - "built-in", - "builtins", - "node", - "modules", - "core", - "bundled", - "list", - "array", - "names", - "is", - "detect", - "check", - "match" - ], - "license": "MIT", - "name": "is-builtin-module", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-builtin-module.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/is-builtin-module/readme.md b/node_modules/is-builtin-module/readme.md deleted file mode 100644 index 798dcf4371799..0000000000000 --- a/node_modules/is-builtin-module/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# is-builtin-module [![Build Status](https://travis-ci.org/sindresorhus/is-builtin-module.svg?branch=master)](https://travis-ci.org/sindresorhus/is-builtin-module) - -> Check if a string matches the name of a Node.js builtin module - - -## Install - -``` -$ npm install --save is-builtin-module -``` - - -## Usage - -```js -var isBuiltinModule = require('is-builtin-module'); - -isBuiltinModule('fs'); -//=> true - -isBuiltinModule('unicorn'); -//=> false :( -``` - - -## Related - -- [builtin-modules](https://github.com/sindresorhus/builtin-modules) - List of the Node.js builtin modules - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/normalize-package-data/README.md b/node_modules/normalize-package-data/README.md index 3772777973905..d2bd7bc7ff606 100644 --- a/node_modules/normalize-package-data/README.md +++ b/node_modules/normalize-package-data/README.md @@ -94,7 +94,7 @@ If `version` field is given, the value of the version field must be a valid *sem ### Rules for license field -The `license` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/packages/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license). +The `license` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/package/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license). ## Credits diff --git a/node_modules/normalize-package-data/lib/fixer.js b/node_modules/normalize-package-data/lib/fixer.js index f070119674d2d..27682e9611afd 100644 --- a/node_modules/normalize-package-data/lib/fixer.js +++ b/node_modules/normalize-package-data/lib/fixer.js @@ -1,7 +1,7 @@ var semver = require("semver") var validateLicense = require('validate-npm-package-license'); var hostedGitInfo = require("hosted-git-info") -var isBuiltinModule = require("is-builtin-module") +var isBuiltinModule = require("resolve").isCore var depTypes = ["dependencies","devDependencies","optionalDependencies"] var extractDescription = require("./extract_description") var url = require("url") @@ -299,7 +299,8 @@ var fixer = module.exports = { } else{ if ( typeof(data.license) !== 'string' || - data.license.length < 1 + data.license.length < 1 || + data.license.trim() === '' ) { this.warn("invalidLicense") } else { diff --git a/node_modules/normalize-package-data/node_modules/resolve/.editorconfig b/node_modules/normalize-package-data/node_modules/resolve/.editorconfig new file mode 100644 index 0000000000000..bc228f8269443 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/normalize-package-data/node_modules/resolve/.eslintignore b/node_modules/normalize-package-data/node_modules/resolve/.eslintignore new file mode 100644 index 0000000000000..3c3629e647f5d --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/normalize-package-data/node_modules/resolve/.travis.yml b/node_modules/normalize-package-data/node_modules/resolve/.travis.yml new file mode 100644 index 0000000000000..768129d572eeb --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/.travis.yml @@ -0,0 +1,269 @@ +language: node_js +os: + - linux +node_js: + - "11.6" + - "10.15" + - "9.11" + - "8.15" + - "7.10" + - "6.16" + - "5.12" + - "4.9" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" + - "0.6" +before_install: + - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' + - 'nvm install-latest-npm' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "lts/*" + env: PRETEST=true + - node_js: "lts/*" + env: POSTTEST=true + - node_js: "11.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "11.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.14" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.14" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.15" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.14" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" diff --git a/node_modules/normalize-package-data/node_modules/resolve/CHANGELOG.md b/node_modules/normalize-package-data/node_modules/resolve/CHANGELOG.md new file mode 100644 index 0000000000000..832ee0272043e --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/CHANGELOG.md @@ -0,0 +1,629 @@ +### Changelog + +All notable changes to this project will be documented in this file. Dates are displayed in UTC. + +#### [Unreleased](https://github.com/browserify/resolve/compare/v1.9.0...HEAD) + +- [Fix] `sync`/`async`: when package.json `main` is not a string, throw an error ([`#178`][]) +- [Tests] up to `v11.6`, `v10.15`, `v8.15`, `v6.16` (([`083e78c`][]) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` (([`29a4994`][]) +- [Tests] add an additional test (([`2c67936`][]) + +[`083e78c`]: https://github.com/browserify/resolve/commit/083e78c1ae5c1708b7d41c9ad7c608caffeddcbf +[`29a4994`]: https://github.com/browserify/resolve/commit/29a499418d54b5befe9deef1bc7c38a9174cfbd8 +[`2c67936`]: https://github.com/browserify/resolve/commit/2c679363e852f7a0d570593527ea7038f0cd2c19 + +#### [v1.9.0](https://github.com/browserify/resolve/compare/v1.8.1...v1.9.0) - 17 December 2018 + +- [Fix] `sync`/`async`: fix `preserveSymlinks` option ([`#177`][]) +- [Fix] `sync`/`async`: when package.json `main` is not a string, throw an error ([`#178`][]) +- [Refactor] `node-modules-paths`: Change `paths` function option to receive a thunk for node modules resolution paths (([`d652f01`][]) +- [Tests] up to `node` `v11.4`, `v10.14`, `v8.14`, `v6.15` (([`2b4f3a8`][]) +- [New] `async`/`sync`/`node-modules-paths`: Adds support for “paths” being a function (([`7112873`][]) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-keys`, `safe-publish-latest`, `tape` (([`5542700`][]) +- [New] Implements a "normalize-options" pseudo-hook (([`f3961df`][]) +- [Tests] better failure messages (([`f839d20`][]) +- [Deps] update `path-parse` (([`1018c0e`][]) + +[`d652f01`]: https://github.com/browserify/resolve/commit/d652f018b2561f4863ffcd0f3ecdb0dfe65ee223 +[`2b4f3a8`]: https://github.com/browserify/resolve/commit/2b4f3a898a3943e45cdff539b542c4ebee2b608a +[`7112873`]: https://github.com/browserify/resolve/commit/711287339aad544788a4b8b5335221cea645572c +[`5542700`]: https://github.com/browserify/resolve/commit/554270035e1997ae34865500c629888249baa304 +[`f3961df`]: https://github.com/browserify/resolve/commit/f3961dfcb7b2993d935c255e65309e7028a88b8d +[`f839d20`]: https://github.com/browserify/resolve/commit/f839d20ab16ef814214d80183452d02379cbbf15 +[`1018c0e`]: https://github.com/browserify/resolve/commit/1018c0e49851bfb62176d8adbc94125ae85cd158 + +#### [v1.8.1](https://github.com/browserify/resolve/compare/v1.8.0...v1.8.1) - 17 June 2018 + +- [Docs] clean up readme code (([`f5394d8`][]) +- [Fix] resolution when `filename` option is passed (([`9c370c9`][]) +- [Tests] up to `node` `v10.4` (([`3a64219`][]) +- [Tests] improve output of symlink tests that fail on Mac (([`6f771b2`][]) + +[`f5394d8`]: https://github.com/browserify/resolve/commit/f5394d801350ff32be08dfc5ca37bcb677b4c08b +[`9c370c9`]: https://github.com/browserify/resolve/commit/9c370c9848eaecb36fb8e0b004930e2dd49e1e71 +[`3a64219`]: https://github.com/browserify/resolve/commit/3a64219a7385d5d51f3d4ff7b3de0ce749d6cf09 +[`6f771b2`]: https://github.com/browserify/resolve/commit/6f771b215b4f40b0ba0009ef564bde85212e79eb + +#### [v1.8.0](https://github.com/browserify/resolve/compare/v1.7.1...v1.8.0) - 15 June 2018 + +- [New] include filename in error message ([`#162`][]) +- [Tests] up to `node` `v10.1`, `v9.11`, `v8.11`, `v6.14`, `4.9` (([`ad16af2`][]) +- Fix eslint problems and update count of tests (([`def5931`][]) +- [New] add fs/promises to the list of core modules (([`756419a`][]) +- [New] core: add `trace_events`, `v8/tools/arguments` (([`bae0338`][]) +- [Fix] core: `_tls_legacy` is removed in node 10 (([`4225ac5`][]) + +[`#162`]: https://github.com/browserify/resolve/pull/162 +[`ad16af2`]: https://github.com/browserify/resolve/commit/ad16af2f4f6eb1dc964f5b119f6d94bd64b2607a +[`def5931`]: https://github.com/browserify/resolve/commit/def59317704d787adcddc9695b923e65c6bf5232 +[`756419a`]: https://github.com/browserify/resolve/commit/756419a94432fd753a62f5a58b797776efb543f9 +[`bae0338`]: https://github.com/browserify/resolve/commit/bae033824c82153ccb4f32abdd0e70ca677968bc +[`4225ac5`]: https://github.com/browserify/resolve/commit/4225ac5f4b90d26db664ed32f5b08416fea69b86 + +#### [v1.7.1](https://github.com/browserify/resolve/compare/v1.7.0...v1.7.1) - 12 April 2018 + +- [Fix] revert proper but unintended breaking change in sync packageFilter ([`#157`][]) + +#### [v1.7.0](https://github.com/browserify/resolve/compare/v1.6.0...v1.7.0) - 7 April 2018 + +- [Fix] Make loadAsFileSync() work the same as async loadAsFile() ([`#146`][]) +- [Tests] add more pathfilter tests (([`c3621a3`][]) +- [Tests] add some tests for browser field (([`13fb572`][]) +- [Refactor] cache default isFile functions at module level (([`fa6e6f5`][]) +- [Docs] fix default “isFile” implementations (([`0f29c93`][]) +- [Tests] add some tests for a non-directory basedir (([`0c18e40`][]) +- [Refactor] use "basedir" instead of "y", because meaningful variable names (([`876b0b0`][]) +- [Docs] fix options formatting (([`23df5f5`][]) +- Minor cleanup (([`c449d48`][]) +- [Fix] support `opts.package` in non-relative lookups (([`c8a2052`][]) +- [Tests] work around npm SSL issue (([`04cb0bb`][]) +- [Tests] add node 8 and 9 to appveyor (([`7cbd17a`][]) +- [Tests] work around npm SSL issue (([`4b10996`][]) + +[`#146`]: https://github.com/browserify/resolve/pull/146 +[`c3621a3`]: https://github.com/browserify/resolve/commit/c3621a35675b275b2b241dd367459ed7afe1c22a +[`13fb572`]: https://github.com/browserify/resolve/commit/13fb572337623622d06450696af6c15b68be26c3 +[`fa6e6f5`]: https://github.com/browserify/resolve/commit/fa6e6f5a2d34377f6973701733177a280adf0511 +[`0f29c93`]: https://github.com/browserify/resolve/commit/0f29c93f0c74fc4e52ec6ed6678ce0fec6347e2d +[`0c18e40`]: https://github.com/browserify/resolve/commit/0c18e40e4929ba2c9426a77079c153c43e50a025 +[`876b0b0`]: https://github.com/browserify/resolve/commit/876b0b08da9fe44d81681d0c815900485536be9e +[`23df5f5`]: https://github.com/browserify/resolve/commit/23df5f526823e27e33b01333016b7f58b4f63b6f +[`c449d48`]: https://github.com/browserify/resolve/commit/c449d4809cf8461a3d54e458780902b95119a969 +[`c8a2052`]: https://github.com/browserify/resolve/commit/c8a20524c7d08671c22903e70b952575b0502f7b +[`04cb0bb`]: https://github.com/browserify/resolve/commit/04cb0bb94628e560bfa4163e73637d3803591714 +[`7cbd17a`]: https://github.com/browserify/resolve/commit/7cbd17ae270f9ec24ef05779c3a5e9da3e75c598 +[`4b10996`]: https://github.com/browserify/resolve/commit/4b1099668477e28117c34f9db3509ff096a49190 + +#### [v1.6.0](https://github.com/browserify/resolve/compare/v1.5.0...v1.6.0) - 20 March 2018 + +- [New] add `async_hooks` core module, added in node 8 ([`#144`][]) +- [New] add many missing core modules. (([`88c0778`][]) +- Made loadAsFileSync() work the same as async loadAsFile(). (([`dc23387`][]) +- [Tests] up to `v9.8`, `v8.10`, `v6.13` (([`315d729`][]) +- [Tests] up to `node` `v9.3`, `v8.8`, `v6.12`; pin included builds to LTS (([`5091aa2`][]) +- [Tests] add a failing test (([`90b1192`][]) +- [Dev Deps] update `eslint`, `tape` (([`2acf953`][]) +- [Tests] restore node 0.6 (([`2764758`][]) +- [Dev Deps] update `eslint` (([`699a54e`][]) +- [Dev Deps] update `eslint` (([`2674fad`][]) + +[`88c0778`]: https://github.com/browserify/resolve/commit/88c0778be359caaeb4ca74b24a7b5f7903bc39e8 +[`dc23387`]: https://github.com/browserify/resolve/commit/dc23387adb93f497d67def7ee99fae48e5958fb3 +[`315d729`]: https://github.com/browserify/resolve/commit/315d729afe7074ffae5d6ca6509a73d747985d45 +[`5091aa2`]: https://github.com/browserify/resolve/commit/5091aa2c076b67ff762937401e81da66ef7988ca +[`90b1192`]: https://github.com/browserify/resolve/commit/90b11921181c2783209e9aa31f1e20d98c11ed17 +[`2acf953`]: https://github.com/browserify/resolve/commit/2acf953ce2a94b38528372b5f8848ac95a2aabe5 +[`2764758`]: https://github.com/browserify/resolve/commit/2764758aae576aef98f41af5d46f76ada3523012 +[`699a54e`]: https://github.com/browserify/resolve/commit/699a54e91222dc8b3e1f0af8e9859c734d99d50a +[`2674fad`]: https://github.com/browserify/resolve/commit/2674fadcfcf2b253fdcf5e9d8564fd2b23b0b57c + +#### [v1.5.0](https://github.com/browserify/resolve/compare/v1.4.0...v1.5.0) - 24 October 2017 + +- [New] node v8.8+ supports `http2` ([`#139`][]) +- [Fix] fix broken core tests; change core.json to be an object instead of an array; fix results (([`b826f30`][]) +- [Tests] up to `v8.4`; node 0.6 is failing due to travis-ci changes; allow it to fail for now. (([`e9d3a24`][]) +- [Tests] up to `node` `8.7`; use `nvm install-latest-npm` so new npm doesn’t break old node (([`d0de222`][]) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` (([`76f28a3`][]) +- [Tests] on `node` `v8.8` (([`e0c5d51`][]) +- [Docs] update repo URL (([`3412f98`][]) +- [New] add `perf_hooks`, added in node v8.5 (([`e66117d`][]) +- [Dev Deps] update `eslint` (([`5bfb072`][]) + +[`b826f30`]: https://github.com/browserify/resolve/commit/b826f3007dc8903b95e39984f93c68bb5e4c85b9 +[`e9d3a24`]: https://github.com/browserify/resolve/commit/e9d3a24ae0a4d8e3eefc6431c918c23f7c8fc6d3 +[`d0de222`]: https://github.com/browserify/resolve/commit/d0de222e4b55b67224ddec0421ee66ce8cb5ee8d +[`76f28a3`]: https://github.com/browserify/resolve/commit/76f28a3d275a63b0511449d28900ab5749f27fa5 +[`e0c5d51`]: https://github.com/browserify/resolve/commit/e0c5d518abfaadc4107ca8f3f8c30caf46490444 +[`3412f98`]: https://github.com/browserify/resolve/commit/3412f984a03a345b9a5ef1f0642a0308d676a2c2 +[`e66117d`]: https://github.com/browserify/resolve/commit/e66117df49d9f967b46fde633770307c9d5a7066 +[`5bfb072`]: https://github.com/browserify/resolve/commit/5bfb072f152c77c8247f4c06c1efa9246bbdddb0 + +#### [v1.4.0](https://github.com/browserify/resolve/compare/v1.3.3...v1.4.0) - 26 July 2017 + +- [New]: add `preserveSymlinks` option ([`#130`][]) +- [Fix] `sync`: fix when package.json main = ‘.’ or main = ‘./‘ ([`#125`][]) +- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`; npm 4.6+ breaks on node < 4 (([`41a3604`][]) +- [Tests] fix 0.6 and linting (([`703517b`][]) +- Only apps should have lockfiles (([`11fb3d8`][]) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` (([`bc2f7bf`][]) + +[`41a3604`]: https://github.com/browserify/resolve/commit/41a3604f6408dbe9693febf895251db924c87a8f +[`703517b`]: https://github.com/browserify/resolve/commit/703517b78e7e0f8093a79c0a7a413a708ac82d06 +[`11fb3d8`]: https://github.com/browserify/resolve/commit/11fb3d85bb107a24476bd8d764ba25b3c60c184a +[`bc2f7bf`]: https://github.com/browserify/resolve/commit/bc2f7bf29d172fa54d66cf909fb47a858f7765aa + +#### [v1.3.3](https://github.com/browserify/resolve/compare/v1.3.2...v1.3.3) - 20 April 2017 + +- [Fix] error code MODULE_NOT_FOUND instead of ENOTDIR ([`#121`][]) +- [Tests] [eslint] add `npm run lint` (([`3677928`][]) +- [Tests] up to `node` `v7.7`, `v6.10`, `v4.8`; comment out OSX builds since they block linux builds. (([`1d3883c`][]) +- [Fix] correctly resolve dir paths when file with the same name exists (([`a983d38`][]) +- [Tests] up to `node` `v7.9` (([`0da055c`][]) +- [Tests] improve failure scenarios. (([`1de578f`][]) +- [Fix] `sync`: ensure that the path is a string, explicitly. (([`b7ba83d`][]) +- [Dev Deps] update `eslint` (([`452fdf9`][]) +- [Tests] node 0.6 can’t support an npm that understands scoped packages (([`26369cf`][]) + +[`3677928`]: https://github.com/browserify/resolve/commit/36779282881ec4abce32b2c9b7f7b10bcd09d953 +[`1d3883c`]: https://github.com/browserify/resolve/commit/1d3883c40d55242d7dfeafa43fa782dc6f4ab4a6 +[`a983d38`]: https://github.com/browserify/resolve/commit/a983d38c47ea26e57e0824f22929985ecb24faca +[`0da055c`]: https://github.com/browserify/resolve/commit/0da055cc75bebd7e0044cd4184e7c5386a7bd7de +[`1de578f`]: https://github.com/browserify/resolve/commit/1de578f2879f83ba94789041420fd3d3b929127e +[`b7ba83d`]: https://github.com/browserify/resolve/commit/b7ba83d43519c3c77af823ef1badd7f452d8b8e3 +[`452fdf9`]: https://github.com/browserify/resolve/commit/452fdf981330f96d7fef88805b24e40ea24a89e1 +[`26369cf`]: https://github.com/browserify/resolve/commit/26369cfe6ce4eae7404f3c003c88618f098d6814 + +#### [v1.3.2](https://github.com/browserify/resolve/compare/v1.2.1...v1.3.2) - 26 February 2017 + +- Fix prepublish script. (([`1aa1d9d`][]) + +[`1aa1d9d`]: https://github.com/browserify/resolve/commit/1aa1d9d9adc60691431efbde8d915c143cd54916 + +#### [v1.3.1](https://github.com/browserify/resolve/compare/v1.3.0...v1.3.1) - 24 February 2017 + +- Revert "[New] add searched extensions to error messages" (([`68a081d`][]) + +[`68a081d`]: https://github.com/browserify/resolve/commit/68a081d1c7ff6e0fb58aeff4b6ac06aada7812c4 + +#### [v1.3.0](https://github.com/browserify/resolve/compare/v1.2.0...v1.3.0) - 24 February 2017 + +#### [v1.2.1](https://github.com/browserify/resolve/compare/v1.3.1...v1.2.1) - 26 February 2017 + +- [Fix] for browserify compat, do not assume `process.versions.node` exists. ([`#120`][]) +- [Fix] for browserify compat, do not assume `process.versions.node` exists. ([`#120`][]) + +#### [v1.2.0](https://github.com/browserify/resolve/compare/v1.1.7...v1.2.0) - 13 December 2016 + +- [Fix] `resolve.sync` should re-throw non `ENOENT errors. ([`#79`][]) +- [New] add missing core modules, and determine them dynamically by node version. ([`#100`][][`#110`][][`#111`][][`#112`][]) +- [Tests] test on every minor version of node. ([`#109`][][`#75`][][`#74`][][`#70`][]) +- code style: tabs → spaces (([`0ab33b2`][]) +- [Dev Deps] add `safe-publish-latest` (([`83c25dd`][]) +- [Fix] Create error outside process.nextTick (([`3fa5f02`][]) +- readme: update API docs link for require.resolve() (([`7e98547`][]) +- [Dev Deps] update `tape` (([`764f3a2`][]) +- gitignore node_modules (([`3e8a8da`][]) + +[`0ab33b2`]: https://github.com/browserify/resolve/commit/0ab33b29b814e030021ff2df391e60a1c52dcc46 +[`83c25dd`]: https://github.com/browserify/resolve/commit/83c25dde8aa5a663bc3863d946fdc62fab5fd080 +[`3fa5f02`]: https://github.com/browserify/resolve/commit/3fa5f02f2ace0683fbd42196619c4e2bbd9eef60 +[`7e98547`]: https://github.com/browserify/resolve/commit/7e98547319f1dada4f26d7a24f3b92a08f85c56b +[`764f3a2`]: https://github.com/browserify/resolve/commit/764f3a231c26c370c4e6b94f0bb10166c20551b7 +[`3e8a8da`]: https://github.com/browserify/resolve/commit/3e8a8da3c9d545e00e15f5bed24623eb134b2221 + +#### [v1.1.7](https://github.com/browserify/resolve/compare/v1.1.6...v1.1.7) - 24 January 2016 + +- (typo) Change againt to against ([`#83`][]) +- Fix node_modules paths on Windows (([`35b2b64`][]) + +[`#83`]: https://github.com/browserify/resolve/pull/83 +[`35b2b64`]: https://github.com/browserify/resolve/commit/35b2b642d91e9b81e7cc26b6fd19912e18901d55 + +#### [v1.1.6](https://github.com/browserify/resolve/compare/v1.1.5...v1.1.6) - 15 March 2015 + +- Use path.dirname to walk up looking for a package.json ([`#76`][]) +- add back pkg assertions to pick up the root package (([`4c25e45`][]) + +[`4c25e45`]: https://github.com/browserify/resolve/commit/4c25e45625fea7980463fc107fc843aab7e0d993 + +#### [v1.1.5](https://github.com/browserify/resolve/compare/v1.1.4...v1.1.5) - 21 February 2015 + +- another test, not quite the failing case (([`612cac2`][]) +- fix for the failing case (([`503c746`][]) + +[`612cac2`]: https://github.com/browserify/resolve/commit/612cac2beac41fb13b7b12a9dfdb4207391260c1 +[`503c746`]: https://github.com/browserify/resolve/commit/503c746a6e64d50f2c9b18b4476ffcfed49947f2 + +#### [v1.1.4](https://github.com/browserify/resolve/compare/v1.1.3...v1.1.4) - 20 February 2015 + +- finally seems to fully handle browser field from outside foo/bar resolution (([`5b737d5`][]) +- flatter nodeModules function (([`5ebb39a`][]) + +[`5b737d5`]: https://github.com/browserify/resolve/commit/5b737d58b38ce891ef3f06d600d0562dbbc8539c +[`5ebb39a`]: https://github.com/browserify/resolve/commit/5ebb39a19b62c052ff6201600c3d2fffb3f5fdcb + +#### [v1.1.3](https://github.com/browserify/resolve/compare/v1.1.2...v1.1.3) - 17 February 2015 + +- re-implemented pathfilter feature nearly passes the test (([`60ff554`][]) +- another precedence test (([`98d22e0`][]) +- move pathfilter test to its own file (([`90826f5`][]) +- path logic fix that seems to handle all the cases across this package and browserify (([`70146a5`][]) +- tape everywhere (([`47bbfcd`][]) +- move pathfilter files into their own dir (([`7f0a3f1`][]) +- failing precedence test (([`73e958e`][]) +- nearly nearly working (([`e7bffbf`][]) +- packageFilter should have been giving the pkgfile as an argument, fixed (([`70b71e7`][]) +- this fixes the directory precedence problem (([`caca9f9`][]) +- disable faulty basedir test except on windows for now (([`3be4b79`][]) +- passes pathfilter test (([`644f814`][]) +- fix node_path test, was clearly wrong for some reason (([`9aa36e7`][]) + +[`60ff554`]: https://github.com/browserify/resolve/commit/60ff5545ec3cd15367c89c08cf3f139fa9c23796 +[`98d22e0`]: https://github.com/browserify/resolve/commit/98d22e0e21dd57fe1ab8d9573c1f63903c2b7321 +[`90826f5`]: https://github.com/browserify/resolve/commit/90826f575fe37cb3852de17e764b62e3754484b2 +[`70146a5`]: https://github.com/browserify/resolve/commit/70146a5ebc4d96438383ada02785d4e722c6f5d9 +[`47bbfcd`]: https://github.com/browserify/resolve/commit/47bbfcd9d9c8a68ce97fa37e0563930cee67093d +[`7f0a3f1`]: https://github.com/browserify/resolve/commit/7f0a3f1545f4b53f1bdd099b67561f9516693325 +[`73e958e`]: https://github.com/browserify/resolve/commit/73e958e905eed000787f0596f81c212ca2cdb3b3 +[`e7bffbf`]: https://github.com/browserify/resolve/commit/e7bffbf1b39b6239732c0e7fb01eeb9dad605d15 +[`70b71e7`]: https://github.com/browserify/resolve/commit/70b71e7980b3235018a0f5ac0bd52b8393548beb +[`caca9f9`]: https://github.com/browserify/resolve/commit/caca9f9c3576c85d8972d25012ea5d12aeaa50f4 +[`3be4b79`]: https://github.com/browserify/resolve/commit/3be4b796f1a9aadfb293b36c0c7f781ca9169f09 +[`644f814`]: https://github.com/browserify/resolve/commit/644f81478c892874f9829aa6cca36ca72474db00 +[`9aa36e7`]: https://github.com/browserify/resolve/commit/9aa36e77eca50e177498984fdef5d564903d3964 + +#### [v1.1.2](https://github.com/browserify/resolve/compare/v1.1.0...v1.1.2) - 16 February 2015 + +- Adding pathFilter docs ([`#67`][]) +- adding pathFilter docs (([`44480ff`][]) + +[`#67`]: https://github.com/browserify/resolve/pull/67 +[`44480ff`]: https://github.com/browserify/resolve/commit/44480ff041f791f32b80d212302180be210901a1 + +#### [v1.1.0](https://github.com/browserify/resolve/compare/v1.0.0...v1.1.0) - 27 January 2015 + +- Update docs re: input and cb args. ([`#65`][]) +- Update main README--change word order for clarity ([`#55`][]) +- attempts to find package.json data for deep references https://github.com/substack/node-resolve/issues/62 (([`caff2ba`][]) +- formatting (([`b8d09e3`][]) +- Add failing test for parent filename in error msg. (([`96d38c6`][]) +- split before computing the pivot to prevent abcnode_modulesxyz from matching (([`10380e1`][]) +- Utilize opts.filename when available to ID parent. (([`f6edcd9`][]) + +[`#65`]: https://github.com/browserify/resolve/pull/65 +[`#55`]: https://github.com/browserify/resolve/pull/55 +[`caff2ba`]: https://github.com/browserify/resolve/commit/caff2ba60dc5d85eaded388dc6025afd05ba183b +[`b8d09e3`]: https://github.com/browserify/resolve/commit/b8d09e3a2d679f6b61515d49eca3f6d8d0d2ac7f +[`96d38c6`]: https://github.com/browserify/resolve/commit/96d38c6aaa575d12781c28b34243b4939359a335 +[`10380e1`]: https://github.com/browserify/resolve/commit/10380e16d3cf03f25941c3f1545ef73ed11bc1e1 +[`f6edcd9`]: https://github.com/browserify/resolve/commit/f6edcd95ad5d27bfbdee0fa51951aa3d45d77cba + +### [v1.0.0](https://github.com/browserify/resolve/compare/v0.7.4...v1.0.0) - 11 August 2014 + +- reformat package.json (([`695bbc1`][]) + +[`695bbc1`]: https://github.com/browserify/resolve/commit/695bbc1d9eeb35339b4a01e141c6f6e1dff3a6e3 + +#### [v0.7.4](https://github.com/browserify/resolve/compare/v0.7.3...v0.7.4) - 25 July 2014 + +- merged (([`5cae82f`][]) + +[`5cae82f`]: https://github.com/browserify/resolve/commit/5cae82fb22cb64d5b72f703c787dc0fd418ed412 + +#### [v0.7.3](https://github.com/browserify/resolve/compare/v0.7.2...v0.7.3) - 25 July 2014 + +- cb(err) for non-string args (([`965c70b`][]) + +[`965c70b`]: https://github.com/browserify/resolve/commit/965c70b27ff796fc0ac3dba186d95b61d82446df + +#### [v0.7.2](https://github.com/browserify/resolve/compare/v0.7.1...v0.7.2) - 25 July 2014 + +- failing dotdot test (([`3ee0f0e`][]) +- fixes for dotdot tests (([`a67f230`][]) +- failing sync dotdot test (([`55515e7`][]) + +[`3ee0f0e`]: https://github.com/browserify/resolve/commit/3ee0f0eb97971d246a4a3f183374f60938f1ca8a +[`a67f230`]: https://github.com/browserify/resolve/commit/a67f230133050568ca14a04c0d36aaf6bf14fa89 +[`55515e7`]: https://github.com/browserify/resolve/commit/55515e7f816571fb9d71fdd6d0f012185b2eeefb + +#### [v0.7.1](https://github.com/browserify/resolve/compare/v0.7.0...v0.7.1) - 9 June 2014 + +- [Fix] `node-modules-paths`: `opts` should be optional, and `opts.paths` should not be concatenated when omitted. ([`#96`][]) +- [Refactor] consistent spacing and quotes; run some basic linting manually. (([`f63faaf`][]) +- [Tests] use `path.join` more often to normalize paths across OS’s. (([`8280c53`][]) +- [Tests] use `path` methods to make tests pass on both linux and Windows. (([`af9a885`][]) +- [Tests] make matrix more efficient (([`7f0ce87`][]) +- [Tests] fix indentation, manual linting. (([`6984dcb`][]) +- [Tests] [Refactor] refactor `node-modules-paths` and add tests. (([`58b99a3`][]) +- [Tests] add `appveyor` (([`caffe35`][]) +- [new] Add err.code = 'MODULE_NOT_FOUND' (([`c622aef`][]) +- [New] add searched extensions to error messages (([`1260d9d`][]) +- node-modules-paths: absolutize the `start` path (([`9d6b7af`][]) +- [Refactor] `async`: remove unnecessary slashes, since `path.join` adds them. (([`dd50615`][]) +- [Tests] ensure node_path test is independent of the `tap` module’s “main” (([`ddca9ed`][]) + +[`f63faaf`]: https://github.com/browserify/resolve/commit/f63faaf9df5dbd8da388c674de0b14e3286e5e91 +[`8280c53`]: https://github.com/browserify/resolve/commit/8280c53eae6b612f586e133052ed2b2a56ae6649 +[`af9a885`]: https://github.com/browserify/resolve/commit/af9a8858a618ab64dd4bb311ef1be37822ade2b7 +[`7f0ce87`]: https://github.com/browserify/resolve/commit/7f0ce871b6d2b5cb2082b04cd72ddd4055cb7a05 +[`6984dcb`]: https://github.com/browserify/resolve/commit/6984dcb1407fec6af46f744ad2c63f502645bdd6 +[`58b99a3`]: https://github.com/browserify/resolve/commit/58b99a36f882d7ee65df725224f204abd27379db +[`caffe35`]: https://github.com/browserify/resolve/commit/caffe358566bb3c2f9b4cbd8c0f910debfb6df3b +[`c622aef`]: https://github.com/browserify/resolve/commit/c622aefeb286e479d536601e30bb828e69f86ec3 +[`1260d9d`]: https://github.com/browserify/resolve/commit/1260d9d1e2f55efb514540db9aa1b3d679f9db10 +[`9d6b7af`]: https://github.com/browserify/resolve/commit/9d6b7af28c054676d6ea8a5037353ed750ea13bb +[`dd50615`]: https://github.com/browserify/resolve/commit/dd506158089f7d071d2a9f61cd4385365d177219 +[`ddca9ed`]: https://github.com/browserify/resolve/commit/ddca9ed7e1d980d5ec561450875cb09463effd5a + +#### [v0.7.0](https://github.com/browserify/resolve/compare/v0.6.3...v0.7.0) - 17 May 2014 + +- array opts.moduleDirectory tests (([`0f6d088`][]) +- opts.moduleDirectory string tests (([`a15ffd6`][]) +- Support more than one directory in opts.moduleDirectory. (([`4183463`][]) +- formatting (([`b89f089`][]) +- Remove variable leftover from 325584a685 (([`12fa78c`][]) + +[`0f6d088`]: https://github.com/browserify/resolve/commit/0f6d08801db6bc2044df8767226421172a2d9461 +[`a15ffd6`]: https://github.com/browserify/resolve/commit/a15ffd6c20772831c41146189c117ab0a0650e0b +[`4183463`]: https://github.com/browserify/resolve/commit/41834633e84d76d86297968ba34c375f26fe4f08 +[`b89f089`]: https://github.com/browserify/resolve/commit/b89f08902e8551e07d66e81a3dc33840e24266c5 +[`12fa78c`]: https://github.com/browserify/resolve/commit/12fa78ce43c4363e1c9600b635d18cd295c6949f + +#### [v0.6.3](https://github.com/browserify/resolve/compare/v0.6.2...v0.6.3) - 16 April 2014 + +- Fixed the case when main is specified as "." or "./" causing the resolve to infinite loop as documented at https://github.com/substack/node-browserify/issues/732. (([`b11f273`][]) + +[`b11f273`]: https://github.com/browserify/resolve/commit/b11f2739ad8c9730e1076271eff54850755e2ee1 + +#### [v0.6.2](https://github.com/browserify/resolve/compare/v0.6.1...v0.6.2) - 21 March 2014 + +- passing tests for paths (([`4f56bb6`][]) +- faulty basedir does not always produce error properly in windows, because when the dirs are sliced down the final path has improper prefix, causing it to load relative to cwd (([`110168a`][]) + +[`4f56bb6`]: https://github.com/browserify/resolve/commit/4f56bb67fa45d35adfa6a0022cc77afbf8117234 +[`110168a`]: https://github.com/browserify/resolve/commit/110168adae1dfbedcb9a12086cacf0ce68cc67f6 + +#### [v0.6.1](https://github.com/browserify/resolve/compare/v0.6.0...v0.6.1) - 27 November 2013 + +- merged the context error patches (([`8408e6e`][]) + +[`8408e6e`]: https://github.com/browserify/resolve/commit/8408e6e8902b4bec8c859d606f53366e42058378 + +#### [v0.6.0](https://github.com/browserify/resolve/compare/v0.5.1...v0.6.0) - 26 November 2013 + +- fixes #25: resolve modules with the same name as node stdlib modules ([`#25`][]) + +#### [v0.5.1](https://github.com/browserify/resolve/compare/v0.5.0...v0.5.1) - 22 September 2013 + +- Separate duplicated nodeModulesPaths function (([`325584a`][]) +- Fix prefix for windows azure (([`b5ba043`][]) + +[`325584a`]: https://github.com/browserify/resolve/commit/325584a685db8f42aae3d4876ffbe64069233601 +[`b5ba043`]: https://github.com/browserify/resolve/commit/b5ba0430b012d93367a4f87c304f1d4c8c22941c + +#### [v0.5.0](https://github.com/browserify/resolve/compare/v0.4.3...v0.5.0) - 2 September 2013 + +- opts.modules => opts.moduleDirectory, documented (([`c46593d`][]) +- modules folder name is configurable (([`d65a422`][]) + +[`c46593d`]: https://github.com/browserify/resolve/commit/c46593de74b256196d7ea12c85422698652cff10 +[`d65a422`]: https://github.com/browserify/resolve/commit/d65a42238101ea284ddafb788debdad0e5a59504 + +#### [v0.4.3](https://github.com/browserify/resolve/compare/v0.4.2...v0.4.3) - 7 August 2013 + +- Fix default basedir calculation (([`cd7169b`][]) +- use getCaller() in both async and sync versions (([`20f8945`][]) + +[`cd7169b`]: https://github.com/browserify/resolve/commit/cd7169b204b9f474b6a924adf47564f33a469f07 +[`20f8945`]: https://github.com/browserify/resolve/commit/20f89456f7fc1d8e51b95ec1ab38b1ac154d9fc4 + +#### [v0.4.2](https://github.com/browserify/resolve/compare/v0.4.1...v0.4.2) - 3 August 2013 + +- Failing test case for pkg.main pointing to a directory. (([`b57a75a`][]) +- Fix for failing test case where pkg.main points to directory. (([`8c4078c`][]) + +[`b57a75a`]: https://github.com/browserify/resolve/commit/b57a75aefc394ead20d54ed107741f1f7151b90f +[`8c4078c`]: https://github.com/browserify/resolve/commit/8c4078c9dd45c6a92f1f409d70aaccc95be3bfc6 + +#### [v0.4.1](https://github.com/browserify/resolve/compare/v0.4.0...v0.4.1) - 30 July 2013 + +- adding tests to reproduce the problem (([`ad3a477`][]) +- async resolve now falls back to 'index.js' if main field in package.json is incorrect (([`62a5726`][]) + +[`ad3a477`]: https://github.com/browserify/resolve/commit/ad3a4772ddd7187ff38cb56e00635b37a491e1fa +[`62a5726`]: https://github.com/browserify/resolve/commit/62a572635f21bf1c28360ea5c2238be62736429b + +#### [v0.4.0](https://github.com/browserify/resolve/compare/v0.3.1...v0.4.0) - 9 June 2013 + +- Implement async support for returning package a module was resolved from. (([`b7b2806`][]) +- Document package option. (([`7f84028`][]) + +[`b7b2806`]: https://github.com/browserify/resolve/commit/b7b28069acb7c749a2053dbb0c8d606515954694 +[`7f84028`]: https://github.com/browserify/resolve/commit/7f8402881b725938cfaf1d4835ec2fb6cee4862d + +#### [v0.3.1](https://github.com/browserify/resolve/compare/v0.3.0...v0.3.1) - 29 March 2013 + +- use isFIFO() instead to more narrowly target <() usage (([`790cdf5`][]) +- check !isDirectory() instead of isFile() so that <(echo "beep") inline bash fds work (([`c396065`][]) + +[`790cdf5`]: https://github.com/browserify/resolve/commit/790cdf5ab7c92bb146e8ace05ba0b26c5f51ffb3 +[`c396065`]: https://github.com/browserify/resolve/commit/c3960650f1a1417e52238011e08a6da2b0d9fee4 + +#### [v0.3.0](https://github.com/browserify/resolve/compare/v0.2.8...v0.3.0) - 19 February 2013 + +- failing translated async test with parameterized readFile on account of 3-arg form (([`7033bbb`][]) +- factor out .sync into lib/sync.js (([`ba7038a`][]) +- updated the docs for async (([`34a958e`][]) +- first async test passes (([`e427ca8`][]) +- sync parity with async tests (([`d1191a9`][]) +- stub out async (([`f4b02e3`][]) +- factor out core into lib/ (([`a800954`][]) +- synchronous example (([`3534992`][]) +- adapted async test (([`c9111d2`][]) +- async example (([`e1a9809`][]) +- fix for async parameterized readFile (([`2d4e80e`][]) +- drop 0.4, add 0.8 in travis (([`8a1ba59`][]) + +[`7033bbb`]: https://github.com/browserify/resolve/commit/7033bbb6e21ecfd13476ca8de247580aa2f97e7c +[`ba7038a`]: https://github.com/browserify/resolve/commit/ba7038a56d78212329b64287dfaf895b1a85cf2c +[`34a958e`]: https://github.com/browserify/resolve/commit/34a958e84b7fc4cdccd7b71f9a116027a6f3a123 +[`e427ca8`]: https://github.com/browserify/resolve/commit/e427ca85b7e3b1d01b05f94783b76516b8594a03 +[`d1191a9`]: https://github.com/browserify/resolve/commit/d1191a9958581a040f4f18b3aecdd50714bffc7a +[`f4b02e3`]: https://github.com/browserify/resolve/commit/f4b02e3bbf0c3b09f83cfb2b22b12b0f55afdf92 +[`a800954`]: https://github.com/browserify/resolve/commit/a80095482ef2d16425e6e12759c9735d89f7f50b +[`3534992`]: https://github.com/browserify/resolve/commit/3534992946294811d20aaf9857ee453078cbe828 +[`c9111d2`]: https://github.com/browserify/resolve/commit/c9111d293ab35fb611d9c65ea2f88ae8cf853f8e +[`e1a9809`]: https://github.com/browserify/resolve/commit/e1a98093094cded0a251ef36f4f2eb0adb280acb +[`2d4e80e`]: https://github.com/browserify/resolve/commit/2d4e80e139d01176bf70132bc80caed946cd6682 +[`8a1ba59`]: https://github.com/browserify/resolve/commit/8a1ba593ab924995a45099e164cc7b769c44e9a0 + +#### [v0.2.8](https://github.com/browserify/resolve/compare/v0.2.7...v0.2.8) - 18 February 2013 + +- add the domain module to .core (([`2979cde`][]) + +[`2979cde`]: https://github.com/browserify/resolve/commit/2979cdea615fe724de62d88cb221c1d1824d0f10 + +#### [v0.2.7](https://github.com/browserify/resolve/compare/v0.2.6...v0.2.7) - 18 February 2013 + +#### [v0.2.6](https://github.com/browserify/resolve/compare/v0.2.5...v0.2.6) - 18 February 2013 + +#### [v0.2.5](https://github.com/browserify/resolve/compare/v0.2.4...v0.2.5) - 18 February 2013 + +#### [v0.2.4](https://github.com/browserify/resolve/compare/v0.2.3...v0.2.4) - 18 February 2013 + +- resolve '../baz' correct (([`46fe923`][]) + +[`46fe923`]: https://github.com/browserify/resolve/commit/46fe923c20feeceac783e67cfa84d07222bc17fa + +#### [v0.2.3](https://github.com/browserify/resolve/compare/v0.2.2...v0.2.3) - 12 August 2012 + +- license file (([`a964396`][]) +- existsSync (([`d1c1012`][]) +- pass dir to packageFilter (([`3bea5b6`][]) +- pkg.main may be a directory (([`3521c2f`][]) +- Prioritize parent tree in nodeModulesPathsSync before fallback options.paths/ NODE_PATH equivalent, in accordance with http://nodejs.org/docs/latest/api/all.html#all_loading_from_the_global_folders (([`27fa227`][]) + +[`a964396`]: https://github.com/browserify/resolve/commit/a9643965438eb4fcb068a5876b317f516199879a +[`d1c1012`]: https://github.com/browserify/resolve/commit/d1c1012f14c50212ea49a9a1255c902f5ad6cb37 +[`3bea5b6`]: https://github.com/browserify/resolve/commit/3bea5b6475b39e7f4974d29c6fa1e8eb8b1589af +[`3521c2f`]: https://github.com/browserify/resolve/commit/3521c2f2b93234e5a50dc47598554a76589d6d8c +[`27fa227`]: https://github.com/browserify/resolve/commit/27fa22707e87738ddde61cb4ad90508cfe0d7755 + +#### [v0.2.2](https://github.com/browserify/resolve/compare/v0.2.1...v0.2.2) - 30 April 2012 + +- fix indentation (([`98fc4a5`][]) +- Updated to work with windows, tested on Windows 7 64-bit and OS X 10.6 (([`a6646cc`][]) +- bump for windows fixes (([`d67d595`][]) + +[`98fc4a5`]: https://github.com/browserify/resolve/commit/98fc4a50b68456d497a862b9c4e4e0a79570c770 +[`a6646cc`]: https://github.com/browserify/resolve/commit/a6646ccceb1a6c411d5b9dfdc97106c80d8a0a09 +[`d67d595`]: https://github.com/browserify/resolve/commit/d67d5959e1be31eb67d5b62e7050bff318572373 + +#### [v0.2.1](https://github.com/browserify/resolve/compare/v0.2.0...v0.2.1) - 12 April 2012 + +- now using tap (([`b625169`][]) +- using travis (([`30cc7b3`][]) +- split on multiple slashes (([`ebeafab`][]) +- fix splitting of paths to support windows as well (([`5e7e24b`][]) + +[`b625169`]: https://github.com/browserify/resolve/commit/b62516922eaaafe533806cd385017109ea057baa +[`30cc7b3`]: https://github.com/browserify/resolve/commit/30cc7b3af9299a0e08f34c314015a1395ef16ea3 +[`ebeafab`]: https://github.com/browserify/resolve/commit/ebeafab4a43c6ac4df7a8a7ee578629f81b7b9e7 +[`5e7e24b`]: https://github.com/browserify/resolve/commit/5e7e24bf11c48f14385886d7dd3661f786cc109b + +#### [v0.2.0](https://github.com/browserify/resolve/compare/v0.1.3...v0.2.0) - 25 February 2012 + +- updated the core list for 0.6.11 (([`12d4c16`][]) + +[`12d4c16`]: https://github.com/browserify/resolve/commit/12d4c164ef99bd35c13b0f566feaa70bc3560082 + +#### [v0.1.3](https://github.com/browserify/resolve/compare/v0.1.2...v0.1.3) - 14 December 2011 + +- bump (([`2dffd07`][]) +- Added readline to core modules (([`4ab55a2`][]) + +[`2dffd07`]: https://github.com/browserify/resolve/commit/2dffd072ce65b4aae4974e934ca5b58ec741f598 +[`4ab55a2`]: https://github.com/browserify/resolve/commit/4ab55a2d4eb95be2399fe94fd5d33879271b5a9f + +#### [v0.1.2](https://github.com/browserify/resolve/compare/v0.1.1...v0.1.2) - 31 October 2011 + +- Add opts.paths to list of node_modules directories (([`7bb6ef4`][]) +- bump (([`5e3fcc6`][]) + +[`7bb6ef4`]: https://github.com/browserify/resolve/commit/7bb6ef4a1805523169f30b6ea38776796a714c3a +[`5e3fcc6`]: https://github.com/browserify/resolve/commit/5e3fcc63cfec322779be5435820d3236e6d13dba + +#### [v0.1.1](https://github.com/browserify/resolve/compare/v0.1.0...v0.1.1) - 18 October 2011 + +- bump for windows paths (([`3fb86d0`][]) +- Added support for Windows-style paths. (([`638951e`][]) + +[`3fb86d0`]: https://github.com/browserify/resolve/commit/3fb86d07c77b09a7d6fa6d2a8b89432a070a6aa0 +[`638951e`]: https://github.com/browserify/resolve/commit/638951ed92fa4435d9752df30c3bcb9eb49573cd + +#### [v0.1.0](https://github.com/browserify/resolve/compare/v0.0.4...v0.1.0) - 3 October 2011 + +- passing mock test (([`030f0d3`][]) +- passing mock test with package.json (([`d2b19c8`][]) +- isFile and readFileSync as parameters (([`d30c22d`][]) +- doc updates and a minor bump for custom isFile and readFileSync params (([`b0af4c3`][]) + +[`030f0d3`]: https://github.com/browserify/resolve/commit/030f0d391e02558574bc673077fb1b4057f8358d +[`d2b19c8`]: https://github.com/browserify/resolve/commit/d2b19c893b7f8c63154c5b5ff2c419ffdc8baa0c +[`d30c22d`]: https://github.com/browserify/resolve/commit/d30c22d1e13b000016f2592d6d6f3489a2d29988 +[`b0af4c3`]: https://github.com/browserify/resolve/commit/b0af4c3ac1a51acf9995cb4e078bf5619f257952 + +#### [v0.0.4](https://github.com/browserify/resolve/compare/v0.0.3...v0.0.4) - 21 June 2011 + +- bump for packageFilter and a note in the docs (([`9fbb632`][]) +- new packageFilter option (([`c92c883`][]) + +[`9fbb632`]: https://github.com/browserify/resolve/commit/9fbb632a5c0c38641ed7c10399306a56651e0789 +[`c92c883`]: https://github.com/browserify/resolve/commit/c92c883bed3e50dd8ed9a2e1d4b9fefc9f3ced64 + +#### [v0.0.3](https://github.com/browserify/resolve/compare/v0.0.2...v0.0.3) - 20 June 2011 + +- custom extensions now work (([`502b6e9`][]) +- failing test for extensions (([`ce56f56`][]) +- bump and a note in the docs for extensions (([`2ad8287`][]) +- passing normalize test (([`055c7ce`][]) + +[`502b6e9`]: https://github.com/browserify/resolve/commit/502b6e9c8b9f258e5c943954467016e9c048fa0f +[`ce56f56`]: https://github.com/browserify/resolve/commit/ce56f56b4e1a5c1df495a7bf061fb0242103b4d8 +[`2ad8287`]: https://github.com/browserify/resolve/commit/2ad8287bc8b34929c2074a739410d08955ccdea7 +[`055c7ce`]: https://github.com/browserify/resolve/commit/055c7cea391ff0ce9cd8c585e8244f553b62f6e7 + +#### [v0.0.2](https://github.com/browserify/resolve/compare/v0.0.1...v0.0.2) - 19 June 2011 + +- failing biz test for going up and down the path directory (([`cf4f5a5`][]) +- don't stop on the first node_modules since that's going away in node anyhow, all tests pass again (([`9049abf`][]) + +[`cf4f5a5`]: https://github.com/browserify/resolve/commit/cf4f5a58d092124c517c55dd180559f5a444eb06 +[`9049abf`]: https://github.com/browserify/resolve/commit/9049abfb60cac49bb547b8ca02cc2617d406ff1a + +#### v0.0.1 + +- implementation seems to work but no tests yet (([`5218f01`][]) +- a package.json all up in this (([`4084043`][]) +- new resolve.{core,isCore} with tests and documentation, bump to 0.0.1 (([`a9ef081`][]) +- failing foo test (([`463b108`][]) +- readme before any code (([`7885443`][]) +- opts.path => opts.basedir, more descriptive I think (([`78010b1`][]) +- failing bar test (([`c40c5c1`][]) +- passing baz test to check package.json resolution (([`410635e`][]) +- a path.resolve() fixed the relative loads (([`dfef4b6`][]) +- passing the bar test after taking out the dirname() around y (([`eda2247`][]) +- trailing comma in the package.json (([`2032753`][]) + +[`5218f01`]: https://github.com/browserify/resolve/commit/5218f0106e78edce4cfb905d0ea4492ed3fd38af +[`4084043`]: https://github.com/browserify/resolve/commit/40840435a621120db78126c1792df7fdd0570703 +[`a9ef081`]: https://github.com/browserify/resolve/commit/a9ef081a4897e9882bf6bc6b31457c53b8d0fc0d +[`463b108`]: https://github.com/browserify/resolve/commit/463b108dd6e750196cba150348bd68397522c908 +[`7885443`]: https://github.com/browserify/resolve/commit/7885443d8a3dba7223b1bfca2d62cafc08a46436 +[`78010b1`]: https://github.com/browserify/resolve/commit/78010b1f91251447d1e74c6ac9cd0baebc6ddf60 +[`c40c5c1`]: https://github.com/browserify/resolve/commit/c40c5c14038acbe8bec91cf979d12382c2e6ddfe +[`410635e`]: https://github.com/browserify/resolve/commit/410635ef6226c030f74c4475e73724a01a102896 +[`dfef4b6`]: https://github.com/browserify/resolve/commit/dfef4b6185d02259c119a10c8a938e1ab148b140 +[`eda2247`]: https://github.com/browserify/resolve/commit/eda22479bd47c5d0b2e8a88851d9ffabbea2329c +[`2032753`]: https://github.com/browserify/resolve/commit/20327532053284676a269ec2441a87f16456fbf3 diff --git a/node_modules/normalize-package-data/node_modules/resolve/LICENSE b/node_modules/normalize-package-data/node_modules/resolve/LICENSE new file mode 100644 index 0000000000000..ee27ba4b4412b --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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 above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. diff --git a/node_modules/normalize-package-data/node_modules/resolve/appveyor.yml b/node_modules/normalize-package-data/node_modules/resolve/appveyor.yml new file mode 100644 index 0000000000000..cc73cc18f084b --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/appveyor.yml @@ -0,0 +1,47 @@ +version: 1.0.{build} +skip_branch_with_pr: true +build: off + +environment: + matrix: + - nodejs_version: "9" + - nodejs_version: "8" + - nodejs_version: "7" + - nodejs_version: "6" + - nodejs_version: "5" + - nodejs_version: "4" + - nodejs_version: "3" + - nodejs_version: "2" + - nodejs_version: "1" + - nodejs_version: "0.12" + - nodejs_version: "0.10" + - nodejs_version: "0.8" + - nodejs_version: "0.6" +matrix: + # fast_finish: true + allow_failures: + - nodejs_version: "0.8" + - nodejs_version: "0.6" + +platform: + - x86 + - x64 + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version $env:platform + - IF %nodejs_version% EQU 0.6 npm config set strict-ssl false && npm -g install npm@1.3 + - IF %nodejs_version% EQU 0.8 npm config set strict-ssl false && npm -g install npm@1.4.28 && npm install -g npm@4.5 + - set PATH=%APPDATA%\npm;%PATH% + #- IF %nodejs_version% NEQ 0.6 AND %nodejs_version% NEQ 0.8 npm -g install npm + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm run tests-only diff --git a/node_modules/normalize-package-data/node_modules/resolve/changelog.hbs b/node_modules/normalize-package-data/node_modules/resolve/changelog.hbs new file mode 100644 index 0000000000000..addd7816b3fdb --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/changelog.hbs @@ -0,0 +1,36 @@ +### Changelog + +All notable changes to this project will be documented in this file. Dates are displayed in UTC. +{{#each releases}} + + {{#if href}} + ###{{#unless major}}#{{/unless}} [{{title}}]({{href}}){{#if tag}} - {{niceDate}}{{/if}} + {{else}} + #### {{title}} + {{/if}} + + {{#if summary}} + Summary: + {{summary}} + {{/if}} + + {{#each fixes}} + - {{{commit.subject}}} ({{#each fixes}}{{#if href}}[`#{{id}}`][]{{/if}}{{/each}}) + {{/each}} + {{#each merges}} + - {{{message}}}{{#if href}} ([`#{{id}}`][]){{/if}} + {{/each}} + {{#each commits}} + - {{#if breaking}}**Breaking change:** {{/if}}{{{subject}}}{{#if href}} (([`{{shorthash}}`][]){{/if}} + {{/each}} + + {{#each fixes}} +{{#if href}}[`#{{id}}`]: {{href}}{{/if}} + {{/each}} + {{#each merges}} +{{#if href}}[`#{{id}}`]: {{href}}{{/if}} + {{/each}} + {{#each commits}} +{{#if href}}[`{{shorthash}}`]: {{href}}{{/if}} + {{/each}} +{{/each}} diff --git a/node_modules/normalize-package-data/node_modules/resolve/example/async.js b/node_modules/normalize-package-data/node_modules/resolve/example/async.js new file mode 100644 index 0000000000000..20e65dc281dba --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/example/async.js @@ -0,0 +1,5 @@ +var resolve = require('../'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/example/sync.js b/node_modules/normalize-package-data/node_modules/resolve/example/sync.js new file mode 100644 index 0000000000000..54b2cc1004223 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/example/sync.js @@ -0,0 +1,3 @@ +var resolve = require('../'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); diff --git a/node_modules/normalize-package-data/node_modules/resolve/index.js b/node_modules/normalize-package-data/node_modules/resolve/index.js new file mode 100644 index 0000000000000..eb6ba89e6c210 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/index.js @@ -0,0 +1,8 @@ +var core = require('./lib/core'); +var async = require('./lib/async'); +async.core = core; +async.isCore = function isCore(x) { return core[x]; }; +async.sync = require('./lib/sync'); + +exports = async; +module.exports = async; diff --git a/node_modules/normalize-package-data/node_modules/resolve/lib/async.js b/node_modules/normalize-package-data/node_modules/resolve/lib/async.js new file mode 100644 index 0000000000000..54211cc66e2d2 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/lib/async.js @@ -0,0 +1,229 @@ +var core = require('./core'); +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var normalizeOptions = require('./normalize-options.js'); + +var defaultIsFile = function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +module.exports = function resolve(x, options, callback) { + var cb = callback; + var opts = options; + if (typeof options === 'function') { + cb = opts; + opts = {}; + } + if (typeof x !== 'string') { + var err = new TypeError('Path must be a string.'); + return process.nextTick(function () { + cb(err); + }); + } + + opts = normalizeOptions(x, opts); + + var isFile = opts.isFile || defaultIsFile; + var readFile = opts.readFile || fs.readFile; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = path.resolve(basedir); + + if (opts.preserveSymlinks === false) { + fs.realpath(absoluteStart, function (realPathErr, realStart) { + if (realPathErr && realPathErr.code !== 'ENOENT') cb(err); + else init(realPathErr ? absoluteStart : realStart); + }); + } else { + init(absoluteStart); + } + + var res; + function init(basedir) { + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + res = path.resolve(basedir, x); + if (x === '..' || x.slice(-1) === '/') res += '/'; + if ((/\/$/).test(x) && res === basedir) { + loadAsDirectory(res, opts.package, onfile); + } else loadAsFile(res, opts.package, onfile); + } else loadNodeModules(x, basedir, function (err, n, pkg) { + if (err) cb(err); + else if (n) cb(null, n, pkg); + else if (core[x]) return cb(null, x); + else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function onfile(err, m, pkg) { + if (err) cb(err); + else if (m) cb(null, m, pkg); + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err); + else if (d) cb(null, d, pkg); + else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function loadAsFile(x, thePackage, callback) { + var loadAsFilePackage = thePackage; + var cb = callback; + if (typeof loadAsFilePackage === 'function') { + cb = loadAsFilePackage; + loadAsFilePackage = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, loadAsFilePackage); + + function load(exts, x, loadPackage) { + if (exts.length === 0) return cb(null, undefined, loadPackage); + var file = x + exts[0]; + + var pkg = loadPackage; + if (pkg) onpkg(null, pkg); + else loadpkg(path.dirname(file), onpkg); + + function onpkg(err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err); + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex(err, ex) { + if (err) return cb(err); + if (ex) return cb(null, file, pkg); + load(exts.slice(1), x, pkg); + } + } + } + + function loadpkg(dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return cb(null); + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); + + var pkgfile = path.join(dir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg(path.dirname(dir), cb); + + readFile(pkgfile, function (err, body) { + if (err) cb(err); + try { var pkg = JSON.parse(body); } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + } + + function loadAsDirectory(x, loadAsDirectoryPackage, callback) { + var cb = callback; + var fpkg = loadAsDirectoryPackage; + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + var pkgfile = path.join(x, 'package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); + + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + if (pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + return cb(mainError); + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, 'index'), pkg, cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + } + + function processDirs(cb, dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + var file = path.join(dir, x); + loadAsFile(file, opts.package, onfile); + + function onfile(err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(path.join(dir, x), opts.package, ondir); + } + + function ondir(err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + processDirs(cb, dirs.slice(1)); + } + } + function loadNodeModules(x, start, cb) { + processDirs(cb, nodeModulesPaths(start, opts, x)); + } +}; diff --git a/node_modules/normalize-package-data/node_modules/resolve/lib/caller.js b/node_modules/normalize-package-data/node_modules/resolve/lib/caller.js new file mode 100644 index 0000000000000..b14a2804ae828 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/lib/caller.js @@ -0,0 +1,8 @@ +module.exports = function () { + // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + var origPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack; }; + var stack = (new Error()).stack; + Error.prepareStackTrace = origPrepareStackTrace; + return stack[2].getFileName(); +}; diff --git a/node_modules/normalize-package-data/node_modules/resolve/lib/core.js b/node_modules/normalize-package-data/node_modules/resolve/lib/core.js new file mode 100644 index 0000000000000..0877650ccad4e --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/lib/core.js @@ -0,0 +1,53 @@ +var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; + +function specifierIncluded(specifier) { + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); + + for (var i = 0; i < 3; ++i) { + var cur = Number(current[i] || 0); + var ver = Number(versionParts[i] || 0); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } else if (op === '>=') { + return cur >= ver; + } else { + return false; + } + } + return op === '>='; +} + +function matchesRange(range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { return false; } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(specifiers[i])) { return false; } + } + return true; +} + +function versionIncluded(specifierValue) { + if (typeof specifierValue === 'boolean') { return specifierValue; } + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(specifierValue[i])) { return true; } + } + return false; + } + return matchesRange(specifierValue); +} + +var data = require('./core.json'); + +var core = {}; +for (var mod in data) { // eslint-disable-line no-restricted-syntax + if (Object.prototype.hasOwnProperty.call(data, mod)) { + core[mod] = versionIncluded(data[mod]); + } +} +module.exports = core; diff --git a/node_modules/normalize-package-data/node_modules/resolve/lib/core.json b/node_modules/normalize-package-data/node_modules/resolve/lib/core.json new file mode 100644 index 0000000000000..1575db31b0eb2 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/lib/core.json @@ -0,0 +1,73 @@ +{ + "assert": true, + "async_hooks": ">= 8", + "buffer_ieee754": "< 0.9.7", + "buffer": true, + "child_process": true, + "cluster": true, + "console": true, + "constants": true, + "crypto": true, + "_debugger": "< 8", + "dgram": true, + "dns": true, + "domain": true, + "events": true, + "freelist": "< 6", + "fs": true, + "fs/promises": ">= 10 && < 10.1", + "_http_agent": ">= 0.11.1", + "_http_client": ">= 0.11.1", + "_http_common": ">= 0.11.1", + "_http_incoming": ">= 0.11.1", + "_http_outgoing": ">= 0.11.1", + "_http_server": ">= 0.11.1", + "http": true, + "http2": ">= 8.8", + "https": true, + "inspector": ">= 8.0.0", + "_linklist": "< 8", + "module": true, + "net": true, + "node-inspect/lib/_inspect": ">= 7.6.0", + "node-inspect/lib/internal/inspect_client": ">= 7.6.0", + "node-inspect/lib/internal/inspect_repl": ">= 7.6.0", + "os": true, + "path": true, + "perf_hooks": ">= 8.5", + "process": ">= 1", + "punycode": true, + "querystring": true, + "readline": true, + "repl": true, + "smalloc": ">= 0.11.5 && < 3", + "_stream_duplex": ">= 0.9.4", + "_stream_transform": ">= 0.9.4", + "_stream_wrap": ">= 1.4.1", + "_stream_passthrough": ">= 0.9.4", + "_stream_readable": ">= 0.9.4", + "_stream_writable": ">= 0.9.4", + "stream": true, + "string_decoder": true, + "sys": true, + "timers": true, + "_tls_common": ">= 0.11.13", + "_tls_legacy": ">= 0.11.3 && < 10", + "_tls_wrap": ">= 0.11.3", + "tls": true, + "trace_events": ">= 10", + "tty": true, + "url": true, + "util": true, + "v8/tools/arguments": ">= 10", + "v8/tools/codemap": [">= 4.4.0 && < 5", ">= 5.2.0"], + "v8/tools/consarray": [">= 4.4.0 && < 5", ">= 5.2.0"], + "v8/tools/csvparser": [">= 4.4.0 && < 5", ">= 5.2.0"], + "v8/tools/logreader": [">= 4.4.0 && < 5", ">= 5.2.0"], + "v8/tools/profile_view": [">= 4.4.0 && < 5", ">= 5.2.0"], + "v8/tools/splaytree": [">= 4.4.0 && < 5", ">= 5.2.0"], + "v8": ">= 1", + "vm": true, + "worker_threads": ">= 11.7", + "zlib": true +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/lib/node-modules-paths.js b/node_modules/normalize-package-data/node_modules/resolve/lib/node-modules-paths.js new file mode 100644 index 0000000000000..df50f48baf430 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/lib/node-modules-paths.js @@ -0,0 +1,42 @@ +var path = require('path'); +var parse = path.parse || require('path-parse'); + +var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { + var prefix = '/'; + if ((/^([A-Za-z]:)/).test(absoluteStart)) { + prefix = ''; + } else if ((/^\\\\/).test(absoluteStart)) { + prefix = '\\\\'; + } + + var paths = [absoluteStart]; + var parsed = parse(absoluteStart); + while (parsed.dir !== paths[paths.length - 1]) { + paths.push(parsed.dir); + parsed = parse(parsed.dir); + } + + return paths.reduce(function (dirs, aPath) { + return dirs.concat(modules.map(function (moduleDir) { + return path.join(prefix, aPath, moduleDir); + })); + }, []); +}; + +module.exports = function nodeModulesPaths(start, opts, request) { + var modules = opts && opts.moduleDirectory + ? [].concat(opts.moduleDirectory) + : ['node_modules']; + + if (opts && typeof opts.paths === 'function') { + return opts.paths( + request, + start, + function () { return getNodeModulesDirs(start, modules); }, + opts + ); + } + + var dirs = getNodeModulesDirs(start, modules); + return opts && opts.paths ? dirs.concat(opts.paths) : dirs; +}; diff --git a/node_modules/normalize-package-data/node_modules/resolve/lib/normalize-options.js b/node_modules/normalize-package-data/node_modules/resolve/lib/normalize-options.js new file mode 100644 index 0000000000000..4b56904eaea72 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/lib/normalize-options.js @@ -0,0 +1,10 @@ +module.exports = function (x, opts) { + /** + * This file is purposefully a passthrough. It's expected that third-party + * environments will override it at runtime in order to inject special logic + * into `resolve` (by manipulating the options). One such example is the PnP + * code path in Yarn. + */ + + return opts || {}; +}; diff --git a/node_modules/normalize-package-data/node_modules/resolve/lib/sync.js b/node_modules/normalize-package-data/node_modules/resolve/lib/sync.js new file mode 100644 index 0000000000000..33ad5da2f69ac --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/lib/sync.js @@ -0,0 +1,154 @@ +var core = require('./core'); +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var normalizeOptions = require('./normalize-options.js'); + +var defaultIsFile = function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); +}; + +module.exports = function (x, options) { + if (typeof x !== 'string') { + throw new TypeError('Path must be a string.'); + } + var opts = normalizeOptions(x, options); + + var isFile = opts.isFile || defaultIsFile; + var readFileSync = opts.readFileSync || fs.readFileSync; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = path.resolve(basedir); + + if (opts.preserveSymlinks === false) { + try { + absoluteStart = fs.realpathSync(absoluteStart); + } catch (realPathErr) { + if (realPathErr.code !== 'ENOENT') { + throw realPathErr; + } + } + } + + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + var res = path.resolve(absoluteStart, x); + if (x === '..' || x.slice(-1) === '/') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return m; + } else { + var n = loadNodeModulesSync(x, absoluteStart); + if (n) return n; + } + + if (core[x]) return x; + + var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + + function loadAsFileSync(x) { + var pkg = loadpkg(path.dirname(x)); + + if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { + var rfile = path.relative(pkg.dir, x); + var r = opts.pathFilter(pkg.pkg, x, rfile); + if (r) { + x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign + } + } + + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadpkg(dir) { + if (dir === '' || dir === '/') return; + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return; + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; + + var pkgfile = path.join(dir, 'package.json'); + + if (!isFile(pkgfile)) { + return loadpkg(path.dirname(dir)); + } + + var body = readFileSync(pkgfile); + + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, dir); + } + + return { pkg: pkg, dir: dir }; + } + + function loadAsDirectorySync(x) { + var pkgfile = path.join(x, '/package.json'); + if (isFile(pkgfile)) { + try { + var body = readFileSync(pkgfile, 'UTF8'); + var pkg = JSON.parse(body); + } catch (e) {} + + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, x); + } + + if (pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + throw mainError; + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + try { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } catch (e) {} + } + } + + return loadAsFileSync(path.join(x, '/index')); + } + + function loadNodeModulesSync(x, start) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var m = loadAsFileSync(path.join(dir, '/', x)); + if (m) return m; + var n = loadAsDirectorySync(path.join(dir, '/', x)); + if (n) return n; + } + } +}; diff --git a/node_modules/normalize-package-data/node_modules/resolve/package.json b/node_modules/normalize-package-data/node_modules/resolve/package.json new file mode 100644 index 0000000000000..a736a535f1989 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/package.json @@ -0,0 +1,71 @@ +{ + "_from": "resolve@^1.10.0", + "_id": "resolve@1.10.0", + "_inBundle": false, + "_integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "_location": "/normalize-package-data/resolve", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "resolve@^1.10.0", + "name": "resolve", + "escapedName": "resolve", + "rawSpec": "^1.10.0", + "saveSpec": null, + "fetchSpec": "^1.10.0" + }, + "_requiredBy": [ + "/normalize-package-data" + ], + "_resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "_shasum": "3bdaaeaf45cc07f375656dfd2e54ed0810b101ba", + "_spec": "resolve@^1.10.0", + "_where": "/Users/aeschright/code/npm-release/node_modules/normalize-package-data", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/browserify/resolve/issues" + }, + "bundleDependencies": false, + "dependencies": { + "path-parse": "^1.0.6" + }, + "deprecated": false, + "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", + "devDependencies": { + "@ljharb/eslint-config": "^13.1.1", + "eslint": "^5.12.0", + "object-keys": "^1.0.12", + "safe-publish-latest": "^1.1.2", + "tap": "0.4.13", + "tape": "^4.9.2" + }, + "homepage": "https://github.com/browserify/resolve#readme", + "keywords": [ + "resolve", + "require", + "node", + "module" + ], + "license": "MIT", + "main": "index.js", + "name": "resolve", + "repository": { + "type": "git", + "url": "git://github.com/browserify/resolve.git" + }, + "scripts": { + "lint": "eslint .", + "posttest": "npm run test:multirepo", + "prepublish": "safe-publish-latest", + "pretest": "npm run lint", + "test": "npm run --silent tests-only", + "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test", + "tests-only": "tape test/*.js" + }, + "version": "1.10.0" +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/readme.markdown b/node_modules/normalize-package-data/node_modules/resolve/readme.markdown new file mode 100644 index 0000000000000..95be0f97a0f85 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/readme.markdown @@ -0,0 +1,179 @@ +# resolve + +implements the [node `require.resolve()` +algorithm](https://nodejs.org/api/modules.html#modules_all_together) +such that you can `require.resolve()` on behalf of a file asynchronously and +synchronously + +[![build status](https://secure.travis-ci.org/browserify/node-resolve.png)](http://travis-ci.org/browserify/node-resolve) + +# example + +asynchronously resolve: + +```js +var resolve = require('resolve'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); +``` + +``` +$ node example/async.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +synchronously resolve: + +```js +var resolve = require('resolve'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); +``` + +``` +$ node example/sync.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +# methods + +```js +var resolve = require('resolve'); +``` + +## resolve(id, opts={}, cb) + +Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.package - `package.json` data applicable to the module being loaded + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files asynchronously + +* opts.isFile - function to asynchronously test whether a file exists + +* `opts.packageFilter(pkg, pkgfile)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * pkgfile - path to package.json + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFile: fs.readFile, + isFile: function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.sync(id, opts) + +Synchronously resolve the module path string `id`, returning the result and +throwing an error when `id` can't be resolved. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files synchronously + +* opts.isFile - function to synchronously test whether a file exists + +* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * dir - directory for package.json (Note: the second argument will change to "pkgfile" in v2) + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFileSync: fs.readFileSync, + isFile: function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.isCore(pkg) + +Return whether a package is in core. + +# install + +With [npm](https://npmjs.org) do: + +```sh +npm install resolve +``` + +# license + +MIT diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/core.js b/node_modules/normalize-package-data/node_modules/resolve/test/core.js new file mode 100644 index 0000000000000..33d9f329499c6 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/core.js @@ -0,0 +1,82 @@ +var test = require('tape'); +var keys = require('object-keys'); +var resolve = require('../'); + +test('core modules', function (t) { + t.test('isCore()', function (st) { + st.ok(resolve.isCore('fs')); + st.ok(resolve.isCore('net')); + st.ok(resolve.isCore('http')); + + st.ok(!resolve.isCore('seq')); + st.ok(!resolve.isCore('../')); + st.end(); + }); + + t.test('core list', function (st) { + var cores = keys(resolve.core); + st.plan(cores.length); + + for (var i = 0; i < cores.length; ++i) { + var mod = cores[i]; + if (resolve.core[mod]) { + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + mod + ' supported; requiring does not throw' + ); + } else { + st.throws( + function () { require(mod); }, // eslint-disable-line no-loop-func + mod + ' not supported; requiring throws' + ); + } + } + + st.end(); + }); + + t.test('core via repl module', { skip: !resolve.core.repl }, function (st) { + var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + st.end(); + }); + + t.test('core via builtinModules list', { skip: !resolve.core.module }, function (st) { + var libs = require('module').builtinModules; + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + var blacklist = [ + '_debug_agent', + 'v8/tools/tickprocessor-driver', + 'v8/tools/SourceMap', + 'v8/tools/tickprocessor', + 'v8/tools/profile' + ]; + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + if (blacklist.indexOf(mod) === -1) { + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + } + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/dotdot.js b/node_modules/normalize-package-data/node_modules/resolve/test/dotdot.js new file mode 100644 index 0000000000000..30806659be2ef --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/dotdot.js @@ -0,0 +1,29 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('dotdot', function (t) { + t.plan(4); + var dir = path.join(__dirname, '/dotdot/abc'); + + resolve('..', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'dotdot/index.js')); + }); + + resolve('.', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + }); +}); + +test('dotdot sync', function (t) { + t.plan(2); + var dir = path.join(__dirname, '/dotdot/abc'); + + var a = resolve.sync('..', { basedir: dir }); + t.equal(a, path.join(__dirname, 'dotdot/index.js')); + + var b = resolve.sync('.', { basedir: dir }); + t.equal(b, path.join(dir, 'index.js')); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/abc/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/abc/index.js new file mode 100644 index 0000000000000..67f2534ebf90d --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/abc/index.js @@ -0,0 +1,2 @@ +var x = require('..'); +console.log(x); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/index.js new file mode 100644 index 0000000000000..643f9fcc6a6a7 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/index.js @@ -0,0 +1 @@ +module.exports = 'whatever'; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/faulty_basedir.js b/node_modules/normalize-package-data/node_modules/resolve/test/faulty_basedir.js new file mode 100644 index 0000000000000..5f2141a67267b --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/faulty_basedir.js @@ -0,0 +1,29 @@ +var test = require('tape'); +var path = require('path'); +var resolve = require('../'); + +test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) { + t.plan(1); + + var resolverDir = 'C:\\a\\b\\c\\d'; + + resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) { + t.equal(!!err, true); + }); +}); + +test('non-existent basedir should not throw when preserveSymlinks is false', function (t) { + t.plan(2); + + var opts = { + basedir: path.join(path.sep, 'unreal', 'path', 'that', 'does', 'not', 'exist'), + preserveSymlinks: false + }; + + var module = './dotdot/abc'; + + resolve(module, opts, function (err, res) { + t.equal(err.code, 'MODULE_NOT_FOUND'); + t.equal(res, undefined); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/filter.js b/node_modules/normalize-package-data/node_modules/resolve/test/filter.js new file mode 100644 index 0000000000000..dfc622a874e16 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/filter.js @@ -0,0 +1,34 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + resolve('./baz', { + basedir: dir, + packageFilter: function (pkg, pkgfile) { + pkg.main = 'doom'; + packageFilterArgs = [pkg, pkgfile]; + return pkg; + } + }, function (err, res, pkg) { + if (err) t.fail(err); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(pkg, packageData, 'first packageFilter argument is "pkg"'); + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + var packageFile = packageFilterArgs[1]; + t.equal( + packageFile, + path.join(dir, 'baz/package.json'), + 'second packageFilter argument is "pkgfile"' + ); + + t.end(); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/filter_sync.js b/node_modules/normalize-package-data/node_modules/resolve/test/filter_sync.js new file mode 100644 index 0000000000000..064052e160ff1 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/filter_sync.js @@ -0,0 +1,26 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + var res = resolve.sync('./baz', { + basedir: dir, + packageFilter: function (pkg, dir) { + pkg.main = 'doom'; + packageFilterArgs = [pkg, dir]; + return pkg; + } + }); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + var packageFile = packageFilterArgs[1]; + t.equal(packageFile, path.join(dir, 'baz'), 'second packageFilter argument is "dir"'); + + t.end(); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/mock.js b/node_modules/normalize-package-data/node_modules/resolve/test/mock.js new file mode 100644 index 0000000000000..a88059d453919 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/mock.js @@ -0,0 +1,143 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock from package', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, file)); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[file]); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('mock package from package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/mock_sync.js b/node_modules/normalize-package-data/node_modules/resolve/test/mock_sync.js new file mode 100644 index 0000000000000..43af10289fd22 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/mock_sync.js @@ -0,0 +1,67 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, file); + }, + readFileSync: function (file) { + return files[file]; + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.throws(function () { + resolve.sync('baz', opts('/foo/bar')); + }); + + t.throws(function () { + resolve.sync('../baz', opts('/foo/bar')); + }); +}); + +test('mock package', function (t) { + t.plan(1); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, file); + }, + readFileSync: function (file) { + return files[file]; + } + }; + } + + t.equal( + resolve.sync('bar', opts('/foo')), + path.resolve('/foo/node_modules/bar/baz.js') + ); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/module_dir.js b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir.js new file mode 100644 index 0000000000000..b50e5bb1751d6 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir.js @@ -0,0 +1,56 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('moduleDirectory strings', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'module_dir'); + var xopts = { + basedir: dir, + moduleDirectory: 'xmodules' + }; + resolve('aaa', xopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); + }); + + var yopts = { + basedir: dir, + moduleDirectory: 'ymodules' + }; + resolve('aaa', yopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); + }); +}); + +test('moduleDirectory array', function (t) { + t.plan(6); + var dir = path.join(__dirname, 'module_dir'); + var aopts = { + basedir: dir, + moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] + }; + resolve('aaa', aopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); + }); + + var bopts = { + basedir: dir, + moduleDirectory: ['zmodules', 'ymodules', 'xmodules'] + }; + resolve('aaa', bopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); + }); + + var copts = { + basedir: dir, + moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] + }; + resolve('bbb', copts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, '/zmodules/bbb/main.js')); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/xmodules/aaa/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/xmodules/aaa/index.js new file mode 100644 index 0000000000000..dd7cf7b2d022d --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/xmodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x * 100; }; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/ymodules/aaa/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/ymodules/aaa/index.js new file mode 100644 index 0000000000000..ef2d4d4bf76e6 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/ymodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x + 100; }; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/main.js b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/main.js new file mode 100644 index 0000000000000..e8ba629936a7a --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/main.js @@ -0,0 +1 @@ +module.exports = function (n) { return n * 111; }; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/package.json new file mode 100644 index 0000000000000..c13b8cf6acfd3 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/package.json @@ -0,0 +1,3 @@ +{ + "main": "main.js" +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/node-modules-paths.js b/node_modules/normalize-package-data/node_modules/resolve/test/node-modules-paths.js new file mode 100644 index 0000000000000..1500fb19998bc --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/node-modules-paths.js @@ -0,0 +1,121 @@ +var test = require('tape'); +var path = require('path'); +var parse = path.parse || require('path-parse'); +var keys = require('object-keys'); + +var nodeModulesPaths = require('../lib/node-modules-paths'); + +var verifyDirs = function verifyDirs(t, start, dirs, moduleDirectories, paths) { + var moduleDirs = [].concat(moduleDirectories || 'node_modules'); + if (paths) { + for (var k = 0; k < paths.length; ++k) { + moduleDirs.push(path.basename(paths[k])); + } + } + + var foundModuleDirs = {}; + var uniqueDirs = {}; + var parsedDirs = {}; + for (var i = 0; i < dirs.length; ++i) { + var parsed = parse(dirs[i]); + if (!foundModuleDirs[parsed.base]) { foundModuleDirs[parsed.base] = 0; } + foundModuleDirs[parsed.base] += 1; + parsedDirs[parsed.dir] = true; + uniqueDirs[dirs[i]] = true; + } + t.equal(keys(parsedDirs).length >= start.split(path.sep).length, true, 'there are >= dirs than "start" has'); + var foundModuleDirNames = keys(foundModuleDirs); + t.deepEqual(foundModuleDirNames, moduleDirs, 'all desired module dirs were found'); + t.equal(keys(uniqueDirs).length, dirs.length, 'all dirs provided were unique'); + + var counts = {}; + for (var j = 0; j < foundModuleDirNames.length; ++j) { + counts[foundModuleDirs[j]] = true; + } + t.equal(keys(counts).length, 1, 'all found module directories had the same count'); +}; + +test('node-modules-paths', function (t) { + t.test('no options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('empty options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, {}); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('with paths=array option', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var dirs = nodeModulesPaths(start, { paths: paths }); + + verifyDirs(t, start, dirs, null, paths); + + t.end(); + }); + + t.test('with paths=function option', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return getNodeModulesDirs().concat(path.join(absoluteStart, 'not node modules', request)); + }; + + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }, 'pkg'); + + verifyDirs(t, start, dirs, null, [path.join(start, 'not node modules', 'pkg')]); + + t.end(); + }); + + t.test('with paths=function skipping node modules resolution', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return []; + }; + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }); + t.deepEqual(dirs, [], 'no node_modules was computed'); + t.end(); + }); + + t.test('with moduleDirectory option', function (t) { + var start = path.join(__dirname, 'resolver'); + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory); + + t.end(); + }); + + t.test('with 1 moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory, paths); + + t.end(); + }); + + t.test('with 1+ moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectories = ['not node modules', 'other modules']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + verifyDirs(t, start, dirs, moduleDirectories, paths); + + t.end(); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/node_path.js b/node_modules/normalize-package-data/node_modules/resolve/test/node_path.js new file mode 100644 index 0000000000000..d06aa4eafe5b5 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/node_path.js @@ -0,0 +1,70 @@ +var fs = require('fs'); +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('$NODE_PATH', function (t) { + t.plan(8); + + var isDir = function (dir, cb) { + if (dir === '/node_path' || dir === 'node_path/x') { + return cb(null, true); + } + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }; + + resolve('aaa', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js'), 'aaa resolves'); + }); + + resolve('bbb', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js'), 'bbb resolves'); + }); + + resolve('ccc', { + paths: [ + path.join(__dirname, '/node_path/x'), + path.join(__dirname, '/node_path/y') + ], + basedir: __dirname, + isDirectory: isDir + }, function (err, res) { + t.error(err); + t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js'), 'ccc resolves'); + }); + + // ensure that relative paths still resolve against the regular `node_modules` correctly + resolve('tap', { + paths: [ + 'node_path' + ], + basedir: path.join(__dirname, 'node_path/x'), + isDirectory: isDir + }, function (err, res) { + var root = require('tap/package.json').main; + t.error(err); + t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves'); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/aaa/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/aaa/index.js new file mode 100644 index 0000000000000..ad70d0bb03f6f --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'A'; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/ccc/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/ccc/index.js new file mode 100644 index 0000000000000..a64132e4c7e52 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'C'; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/bbb/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/bbb/index.js new file mode 100644 index 0000000000000..4d0f32e243681 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/bbb/index.js @@ -0,0 +1 @@ +module.exports = 'B'; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/ccc/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/ccc/index.js new file mode 100644 index 0000000000000..793315e846687 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CY'; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/nonstring.js b/node_modules/normalize-package-data/node_modules/resolve/test/nonstring.js new file mode 100644 index 0000000000000..ef63c40f9393d --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/nonstring.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var resolve = require('../'); + +test('nonstring', function (t) { + t.plan(1); + resolve(555, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter.js b/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter.js new file mode 100644 index 0000000000000..16519aeae51c4 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter.js @@ -0,0 +1,75 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +var resolverDir = path.join(__dirname, '/pathfilter/deep_ref'); + +var pathFilterFactory = function (t) { + return function (pkg, x, remainder) { + t.equal(pkg.version, '1.2.3'); + t.equal(x, path.join(resolverDir, 'node_modules/deep/ref')); + t.equal(remainder, 'ref'); + return 'alt'; + }; +}; + +test('#62: deep module references and the pathFilter', function (t) { + t.test('deep/ref.js', function (st) { + st.plan(3); + + resolve('deep/ref', { basedir: resolverDir }, function (err, res, pkg) { + if (err) st.fail(err); + + st.equal(pkg.version, '1.2.3'); + st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); + }); + + var res = resolve.sync('deep/ref', { basedir: resolverDir }); + st.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); + }); + + t.test('deep/deeper/ref', function (st) { + st.plan(4); + + resolve( + 'deep/deeper/ref', + { basedir: resolverDir }, + function (err, res, pkg) { + if (err) t.fail(err); + st.notEqual(pkg, undefined); + st.equal(pkg.version, '1.2.3'); + st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); + } + ); + + var res = resolve.sync( + 'deep/deeper/ref', + { basedir: resolverDir } + ); + st.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); + }); + + t.test('deep/ref alt', function (st) { + st.plan(8); + + var pathFilter = pathFilterFactory(st); + + var res = resolve.sync( + 'deep/ref', + { basedir: resolverDir, pathFilter: pathFilter } + ); + st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); + + resolve( + 'deep/ref', + { basedir: resolverDir, pathFilter: pathFilter }, + function (err, res, pkg) { + if (err) st.fail(err); + st.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); + st.end(); + } + ); + }); + + t.end(); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter/deep_ref/main.js b/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter/deep_ref/main.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/precedence.js b/node_modules/normalize-package-data/node_modules/resolve/test/precedence.js new file mode 100644 index 0000000000000..2febb598fbc06 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/precedence.js @@ -0,0 +1,23 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('precedence', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'precedence/aaa'); + + resolve('./', { basedir: dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg.name, 'resolve'); + }); +}); + +test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string + t.plan(1); + var dir = path.join(__dirname, 'precedence/bbb'); + + resolve('./', { basedir: dir }, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa.js b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa.js new file mode 100644 index 0000000000000..b83a3e7ad98d1 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa.js @@ -0,0 +1 @@ +module.exports = 'wtf'; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/index.js new file mode 100644 index 0000000000000..e0f8f6abf72f7 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'okok'; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/main.js b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/main.js new file mode 100644 index 0000000000000..93542a965e0ea --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/main.js @@ -0,0 +1 @@ +console.log(require('./')); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb.js b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb.js new file mode 100644 index 0000000000000..2298f47fdd16d --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb.js @@ -0,0 +1 @@ +module.exports = '>_<'; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb/main.js b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb/main.js new file mode 100644 index 0000000000000..716b81d4bd463 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb/main.js @@ -0,0 +1 @@ +console.log(require('./')); // should throw diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver.js new file mode 100644 index 0000000000000..f7fcd292bdff9 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver.js @@ -0,0 +1,429 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('async foo', function (t) { + t.plan(12); + var dir = path.join(__dirname, 'resolver'); + + resolve('./foo', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.name, 'resolve'); + }); + + resolve('./foo.js', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.name, 'resolve'); + }); + + resolve('./foo', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg && pkg.main, 'resolver'); + }); + + resolve('./foo.js', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + t.equal(pkg.main, 'resolver'); + }); + + resolve('./foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo.js')); + }); + + resolve('foo', { basedir: dir }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + // Test that filename is reported as the "from" value when passed. + resolve('foo', { basedir: dir, filename: path.join(dir, 'baz.js') }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.join(dir, 'baz.js') + "'"); + }); +}); + +test('bar', function (t) { + t.plan(6); + var dir = path.join(__dirname, 'resolver'); + + resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir: dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir: dir + '/bar', 'package': { main: 'bar' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'bar/node_modules/foo/index.js')); + t.equal(pkg.main, 'bar'); + }); +}); + +test('baz', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + + resolve('./baz', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'baz/quux.js')); + t.equal(pkg.main, 'quux.js'); + }); + + resolve('./baz', { basedir: dir, 'package': { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'baz/quux.js')); + t.equal(pkg.main, 'quux.js'); + }); +}); + +test('biz', function (t) { + t.plan(24); + var dir = path.join(__dirname, 'resolver/biz/node_modules'); + + resolve('./grux', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg, undefined); + }); + + resolve('./grux', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg.main, 'biz'); + }); + + resolve('./garply', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('./garply', { basedir: dir, 'package': { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('tiv', { basedir: dir + '/grux' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir: dir + '/grux', 'package': { main: 'grux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg.main, 'grux'); + }); + + resolve('tiv', { basedir: dir + '/garply' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir: dir + '/garply', 'package': { main: './lib' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'tiv/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('grux', { basedir: dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg, undefined); + }); + + resolve('grux', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'grux/index.js')); + t.equal(pkg.main, 'tiv'); + }); + + resolve('garply', { basedir: dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); + + resolve('garply', { basedir: dir + '/tiv', 'package': { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'garply/lib/index.js')); + t.equal(pkg.main, './lib'); + }); +}); + +test('quux', function (t) { + t.plan(2); + var dir = path.join(__dirname, 'resolver/quux'); + + resolve('./foo', { basedir: dir, 'package': { main: 'quux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'foo/index.js')); + t.equal(pkg.main, 'quux'); + }); +}); + +test('normalize', function (t) { + t.plan(2); + var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); + + resolve('../grux', { basedir: dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg, undefined); + }); +}); + +test('cup', function (t) { + t.plan(5); + var dir = path.join(__dirname, 'resolver'); + + resolve('./cup', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'cup.coffee')); + }); + + resolve('./cup.coffee', { basedir: dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'cup.coffee')); + }); + + resolve('./cup', { basedir: dir, extensions: ['.js'] }, function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + // Test that filename is reported as the "from" value when passed. + resolve('./cup', { basedir: dir, extensions: ['.js'], filename: path.join(dir, 'cupboard.js') }, function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.join(dir, 'cupboard.js') + "'"); + }); +}); + +test('mug', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'resolver'); + + resolve('./mug', { basedir: dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'mug.js')); + }); + + resolve('./mug', { basedir: dir, extensions: ['.coffee', '.js'] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(dir, '/mug.coffee')); + }); + + resolve('./mug', { basedir: dir, extensions: ['.js', '.coffee'] }, function (err, res) { + t.equal(res, path.join(dir, '/mug.js')); + }); +}); + +test('other path', function (t) { + t.plan(6); + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'bar'); + var otherDir = path.join(resolverDir, 'other_path'); + + resolve('root', { basedir: dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'other_path/root.js')); + }); + + resolve('lib/other-lib', { basedir: dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'other_path/lib/other-lib.js')); + }); + + resolve('root', { basedir: dir }, function (err, res) { + t.equal(err.message, "Cannot find module 'root' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('zzz', { basedir: dir, paths: [otherDir] }, function (err, res) { + t.equal(err.message, "Cannot find module 'zzz' from '" + path.resolve(dir) + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('incorrect main', function (t) { + t.plan(1); + + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); + + resolve('./incorrect_main', { basedir: resolverDir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'index.js')); + }); +}); + +test('without basedir', function (t) { + t.plan(1); + + var dir = path.join(__dirname, 'resolver/without_basedir'); + var tester = require(path.join(dir, 'main.js')); + + tester(t, function (err, res, pkg) { + if (err) { + t.fail(err); + } else { + t.equal(res, path.join(dir, 'node_modules/mymodule.js')); + } + }); +}); + +test('#25: node modules with the same name as node stdlib modules', function (t) { + t.plan(1); + + var resolverDir = path.join(__dirname, 'resolver/punycode'); + + resolve('punycode', { basedir: resolverDir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'node_modules/punycode/index.js')); + }); +}); + +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + t.plan(2); + + var dir = path.join(__dirname, 'resolver'); + + resolve('./foo', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo.js')); + }); + + resolve('./foo/', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); + }); +}); + +test('async: #121 - treating an existing file as a dir when no basedir', function (t) { + var testFile = path.basename(__filename); + + t.test('sanity check', function (st) { + st.plan(1); + resolve('./' + testFile, function (err, res, pkg) { + if (err) t.fail(err); + st.equal(res, __filename, 'sanity check'); + }); + }); + + t.test('with a fake directory', function (st) { + st.plan(4); + + resolve('./' + testFile + '/blah', function (err, res, pkg) { + st.ok(err, 'there is an error'); + st.notOk(res, 'no result'); + + st.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + st.equal( + err && err.message, + 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', + 'can not find nonexistent module' + ); + st.end(); + }); + }); + + t.end(); +}); + +test('async dot main', function (t) { + var start = new Date(); + t.plan(3); + resolve('./resolver/dot_main', function (err, ret) { + t.notOk(err); + t.equal(ret, path.join(__dirname, 'resolver/dot_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); + }); +}); + +test('async dot slash main', function (t) { + var start = new Date(); + t.plan(3); + resolve('./resolver/dot_slash_main', function (err, ret) { + t.notOk(err); + t.equal(ret, path.join(__dirname, 'resolver/dot_slash_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); + }); +}); + +test('not a directory', function (t) { + t.plan(6); + var path = './foo'; + resolve(path, { basedir: __filename }, function (err, res, pkg) { + t.ok(err, 'a non-directory errors'); + t.equal(arguments.length, 1); + t.equal(res, undefined); + t.equal(pkg, undefined); + + t.equal(err && err.message, 'Cannot find module \'' + path + '\' from \'' + __filename + '\''); + t.equal(err && err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('non-string "main" field in package.json', function (t) { + t.plan(5); + + var dir = path.join(__dirname, 'resolver'); + resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + t.equal(res, undefined, 'res is undefined'); + t.equal(pkg, undefined, 'pkg is undefined'); + }); +}); + +test('non-string "main" field in package.json', function (t) { + t.plan(5); + + var dir = path.join(__dirname, 'resolver'); + resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + t.equal(res, undefined, 'res is undefined'); + t.equal(pkg, undefined, 'pkg is undefined'); + }); +}); + +test('browser field in package.json', function (t) { + t.plan(3); + + var dir = path.join(__dirname, 'resolver'); + resolve( + './browser_field', + { + basedir: dir, + packageFilter: function packageFilter(pkg) { + if (pkg.browser) { + pkg.main = pkg.browser; + delete pkg.browser; + } + return pkg; + } + }, + function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'browser_field', 'b.js')); + t.equal(pkg && pkg.main, 'b'); + t.equal(pkg && pkg.browser, undefined); + } + ); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/doom.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/doom.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/package.json new file mode 100644 index 0000000000000..c41e4dbf73d99 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/package.json @@ -0,0 +1,3 @@ +{ + "main": "quux.js" +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/quux.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/quux.js new file mode 100644 index 0000000000000..bd816eaba4ca3 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/quux.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/a.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/a.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/b.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/b.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/package.json new file mode 100644 index 0000000000000..bf406f0830f8a --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/package.json @@ -0,0 +1,5 @@ +{ + "name": "browser_field", + "main": "a", + "browser": "b" +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/cup.coffee b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/cup.coffee new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/cup.coffee @@ -0,0 +1 @@ + diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/index.js new file mode 100644 index 0000000000000..bd816eaba4ca3 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/package.json new file mode 100644 index 0000000000000..d7f4fc8079f60 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "." +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/index.js new file mode 100644 index 0000000000000..bd816eaba4ca3 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/package.json new file mode 100644 index 0000000000000..f51287b9d1e73 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "./" +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/foo.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/foo.js new file mode 100644 index 0000000000000..bd816eaba4ca3 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/foo.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/index.js new file mode 100644 index 0000000000000..bc1fb0a6f4ede --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/index.js @@ -0,0 +1,2 @@ +// this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate +module.exports = 1; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/package.json new file mode 100644 index 0000000000000..b7188041763f8 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/package.json @@ -0,0 +1,3 @@ +{ + "main": "wrong.js" +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/invalid_main/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/invalid_main/package.json new file mode 100644 index 0000000000000..0cf8279950c38 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/invalid_main/package.json @@ -0,0 +1,7 @@ +{ + "name": "invalid main", + "main": [ + "why is this a thing", + "srsly omg wtf" + ] +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.coffee b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.coffee new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/lerna.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/lerna.json new file mode 100644 index 0000000000000..d6707ca0cd64d --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/lerna.json @@ -0,0 +1,6 @@ +{ + "packages": [ + "packages/*" + ], + "version": "0.0.0" +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/package.json new file mode 100644 index 0000000000000..8508f9d2c4a2d --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/package.json @@ -0,0 +1,20 @@ +{ + "name": "monorepo-symlink-test", + "private": true, + "version": "0.0.0", + "description": "", + "main": "index.js", + "scripts": { + "postinstall": "lerna bootstrap", + "test": "node packages/package-a" + }, + "author": "", + "license": "MIT", + "dependencies": { + "jquery": "^3.3.1", + "resolve": "../../../" + }, + "devDependencies": { + "lerna": "^3.4.3" + } +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js new file mode 100644 index 0000000000000..8875a32df0ffc --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var assert = require('assert'); +var path = require('path'); +var resolve = require('resolve'); + +var basedir = __dirname + '/node_modules/@my-scope/package-b'; + +var expected = path.join(__dirname, '../../node_modules/jquery/dist/jquery.js'); + +/* + * preserveSymlinks === false + * will search NPM package from + * - packages/package-b/node_modules + * - packages/node_modules + * - node_modules + */ +assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: false }), expected); +assert.equal(resolve.sync('../../node_modules/jquery', { basedir: basedir, preserveSymlinks: false }), expected); + +/* + * preserveSymlinks === true + * will search NPM package from + * - packages/package-a/node_modules/@my-scope/packages/package-b/node_modules + * - packages/package-a/node_modules/@my-scope/packages/node_modules + * - packages/package-a/node_modules/@my-scope/node_modules + * - packages/package-a/node_modules/node_modules + * - packages/package-a/node_modules + * - packages/node_modules + * - node_modules + */ +assert.equal(resolve.sync('jquery', { basedir: basedir, preserveSymlinks: true }), expected); +assert.equal(resolve.sync('../../../../../node_modules/jquery', { basedir: basedir, preserveSymlinks: true }), expected); + +console.log(' * all monorepo paths successfully resolved through symlinks'); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json new file mode 100644 index 0000000000000..204de51e05878 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json @@ -0,0 +1,14 @@ +{ + "name": "@my-scope/package-a", + "version": "0.0.0", + "private": true, + "description": "", + "license": "MIT", + "main": "index.js", + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "dependencies": { + "@my-scope/package-b": "^0.0.0" + } +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json new file mode 100644 index 0000000000000..f57c3b5f5e454 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json @@ -0,0 +1,14 @@ +{ + "name": "@my-scope/package-b", + "private": true, + "version": "0.0.0", + "description": "", + "license": "MIT", + "main": "index.js", + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "dependencies": { + "@my-scope/package-a": "^0.0.0" + } +} diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/lib/other-lib.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/lib/other-lib.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/root.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/root.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/quux/foo/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/quux/foo/index.js new file mode 100644 index 0000000000000..bd816eaba4ca3 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/quux/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo.js new file mode 100644 index 0000000000000..888cae37af95c --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo.js @@ -0,0 +1 @@ +module.exports = 42; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo/index.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo/index.js new file mode 100644 index 0000000000000..bd816eaba4ca3 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver/without_basedir/main.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/without_basedir/main.js new file mode 100644 index 0000000000000..5b31975be69da --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver/without_basedir/main.js @@ -0,0 +1,5 @@ +var resolve = require('../../../'); + +module.exports = function (t, cb) { + resolve('mymodule', null, cb); +}; diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/resolver_sync.js b/node_modules/normalize-package-data/node_modules/resolve/test/resolver_sync.js new file mode 100644 index 0000000000000..f33143903c140 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/resolver_sync.js @@ -0,0 +1,340 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('foo', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./foo', { basedir: dir }), + path.join(dir, 'foo.js') + ); + + t.equal( + resolve.sync('./foo.js', { basedir: dir }), + path.join(dir, 'foo.js') + ); + + t.equal( + resolve.sync('./foo.js', { basedir: dir, filename: path.join(dir, 'bar.js') }), + path.join(dir, 'foo.js') + ); + + t.throws(function () { + resolve.sync('foo', { basedir: dir }); + }); + + // Test that filename is reported as the "from" value when passed. + t.throws( + function () { + resolve.sync('foo', { basedir: dir, filename: path.join(dir, 'bar.js') }); + }, + { + name: 'Error', + message: "Cannot find module 'foo' from '" + path.join(dir, 'bar.js') + "'" + } + ); + + t.end(); +}); + +test('bar', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('foo', { basedir: path.join(dir, 'bar') }), + path.join(dir, 'bar/node_modules/foo/index.js') + ); + t.end(); +}); + +test('baz', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./baz', { basedir: dir }), + path.join(dir, 'baz/quux.js') + ); + t.end(); +}); + +test('biz', function (t) { + var dir = path.join(__dirname, 'resolver/biz/node_modules'); + t.equal( + resolve.sync('./grux', { basedir: dir }), + path.join(dir, 'grux/index.js') + ); + + t.equal( + resolve.sync('tiv', { basedir: path.join(dir, 'grux') }), + path.join(dir, 'tiv/index.js') + ); + + t.equal( + resolve.sync('grux', { basedir: path.join(dir, 'tiv') }), + path.join(dir, 'grux/index.js') + ); + t.end(); +}); + +test('normalize', function (t) { + var dir = path.join(__dirname, 'resolver/biz/node_modules/grux'); + t.equal( + resolve.sync('../grux', { basedir: dir }), + path.join(dir, 'index.js') + ); + t.end(); +}); + +test('cup', function (t) { + var dir = path.join(__dirname, 'resolver'); + t.equal( + resolve.sync('./cup', { + basedir: dir, + extensions: ['.js', '.coffee'] + }), + path.join(dir, 'cup.coffee') + ); + + t.equal( + resolve.sync('./cup.coffee', { basedir: dir }), + path.join(dir, 'cup.coffee') + ); + + t.throws(function () { + resolve.sync('./cup', { + basedir: dir, + extensions: ['.js'] + }); + }); + + t.end(); +}); + +test('mug', function (t) { + var dir = path.join(__dirname, 'resolver'); + t.equal( + resolve.sync('./mug', { basedir: dir }), + path.join(dir, 'mug.js') + ); + + t.equal( + resolve.sync('./mug', { + basedir: dir, + extensions: ['.coffee', '.js'] + }), + path.join(dir, 'mug.coffee') + ); + + t.equal( + resolve.sync('./mug', { + basedir: dir, + extensions: ['.js', '.coffee'] + }), + path.join(dir, 'mug.js') + ); + + t.end(); +}); + +test('other path', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'bar'); + var otherDir = path.join(resolverDir, 'other_path'); + + t.equal( + resolve.sync('root', { + basedir: dir, + paths: [otherDir] + }), + path.join(resolverDir, 'other_path/root.js') + ); + + t.equal( + resolve.sync('lib/other-lib', { + basedir: dir, + paths: [otherDir] + }), + path.join(resolverDir, 'other_path/lib/other-lib.js') + ); + + t.throws(function () { + resolve.sync('root', { basedir: dir }); + }); + + t.throws(function () { + resolve.sync('zzz', { + basedir: dir, + paths: [otherDir] + }); + }); + + t.end(); +}); + +test('incorrect main', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); + + t.equal( + resolve.sync('./incorrect_main', { basedir: resolverDir }), + path.join(dir, 'index.js') + ); + + t.end(); +}); + +test('#25: node modules with the same name as node stdlib modules', function (t) { + var resolverDir = path.join(__dirname, 'resolver/punycode'); + + t.equal( + resolve.sync('punycode', { basedir: resolverDir }), + path.join(resolverDir, 'node_modules/punycode/index.js') + ); + + t.end(); +}); + +var stubStatSync = function stubStatSync(fn) { + var fs = require('fs'); + var statSync = fs.statSync; + try { + fs.statSync = function () { + throw new EvalError('Unknown Error'); + }; + return fn(); + } finally { + fs.statSync = statSync; + } +}; + +test('#79 - re-throw non ENOENT errors from stat', function (t) { + var dir = path.join(__dirname, 'resolver'); + + stubStatSync(function () { + t.throws(function () { + resolve.sync('foo', { basedir: dir }); + }, /Unknown Error/); + }); + + t.end(); +}); + +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./foo', { basedir: path.join(dir, 'same_names') }), + path.join(dir, 'same_names/foo.js') + ); + t.equal( + resolve.sync('./foo/', { basedir: path.join(dir, 'same_names') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.end(); +}); + +test('sync: #121 - treating an existing file as a dir when no basedir', function (t) { + var testFile = path.basename(__filename); + + t.test('sanity check', function (st) { + st.equal( + resolve.sync('./' + testFile), + __filename, + 'sanity check' + ); + st.end(); + }); + + t.test('with a fake directory', function (st) { + function run() { return resolve.sync('./' + testFile + '/blah'); } + + st.throws(run, 'throws an error'); + + try { + run(); + } catch (e) { + st.equal(e.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + st.equal( + e.message, + 'Cannot find module \'./' + testFile + '/blah\' from \'' + __dirname + '\'', + 'can not find nonexistent module' + ); + } + + st.end(); + }); + + t.end(); +}); + +test('sync dot main', function (t) { + var start = new Date(); + t.equal(resolve.sync('./resolver/dot_main'), path.join(__dirname, 'resolver/dot_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('sync dot slash main', function (t) { + var start = new Date(); + t.equal(resolve.sync('./resolver/dot_slash_main'), path.join(__dirname, 'resolver/dot_slash_main/index.js')); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('not a directory', function (t) { + var path = './foo'; + try { + resolve.sync(path, { basedir: __filename }); + t.fail(); + } catch (err) { + t.ok(err, 'a non-directory errors'); + t.equal(err && err.message, 'Cannot find module \'' + path + "' from '" + __filename + "'"); + t.equal(err && err.code, 'MODULE_NOT_FOUND'); + } + t.end(); +}); + +test('non-string "main" field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + try { + var result = resolve.sync('./invalid_main', { basedir: dir }); + t.equal(result, undefined, 'result should not exist'); + t.fail('should not get here'); + } catch (err) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + } + t.end(); +}); + +test('non-string "main" field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + try { + var result = resolve.sync('./invalid_main', { basedir: dir }); + t.equal(result, undefined, 'result should not exist'); + t.fail('should not get here'); + } catch (err) { + t.ok(err, 'errors on non-string main'); + t.equal(err.message, 'package “invalid main” `main` must be a string'); + t.equal(err.code, 'INVALID_PACKAGE_MAIN'); + } + t.end(); +}); + +test('browser field in package.json', function (t) { + var dir = path.join(__dirname, 'resolver'); + var res = resolve.sync('./browser_field', { + basedir: dir, + packageFilter: function packageFilter(pkg) { + if (pkg.browser) { + pkg.main = pkg.browser; + delete pkg.browser; + } + return pkg; + } + }); + t.equal(res, path.join(dir, 'browser_field', 'b.js')); + t.end(); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/subdirs.js b/node_modules/normalize-package-data/node_modules/resolve/test/subdirs.js new file mode 100644 index 0000000000000..b7b8450a9ef23 --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/subdirs.js @@ -0,0 +1,13 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('subdirs', function (t) { + t.plan(2); + + var dir = path.join(__dirname, '/subdirs'); + resolve('a/b/c/x.json', { basedir: dir }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(dir, 'node_modules/a/b/c/x.json')); + }); +}); diff --git a/node_modules/normalize-package-data/node_modules/resolve/test/symlinks.js b/node_modules/normalize-package-data/node_modules/resolve/test/symlinks.js new file mode 100644 index 0000000000000..ea95a1e1a20fb --- /dev/null +++ b/node_modules/normalize-package-data/node_modules/resolve/test/symlinks.js @@ -0,0 +1,56 @@ +var path = require('path'); +var fs = require('fs'); +var test = require('tape'); +var resolve = require('../'); + +var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink'); +try { + fs.unlinkSync(symlinkDir); +} catch (err) {} +try { + fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction'); +} + +test('symlink', function (t) { + t.plan(2); + + resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) { + t.error(err); + t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.plan(4); + + resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) { + t.ok(err, 'there is an error'); + t.notOk(res, 'no result'); + + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + t.equal( + err && err.message, + 'Cannot find module \'foo\' from \'' + symlinkDir + '\'', + 'can not find nonexistent module' + ); + }); +}); + +test('sync symlink', function (t) { + var start = new Date(); + t.doesNotThrow(function () { + t.equal(resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.throws(function () { + resolve.sync('foo', { basedir: symlinkDir }); + }, /Cannot find module 'foo'/); + t.end(); +}); diff --git a/node_modules/normalize-package-data/package.json b/node_modules/normalize-package-data/package.json index 37151c79c9f83..a408d8c0ab602 100644 --- a/node_modules/normalize-package-data/package.json +++ b/node_modules/normalize-package-data/package.json @@ -1,36 +1,34 @@ { - "_args": [ - [ - "normalize-package-data@2.4.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "normalize-package-data@2.4.0", - "_id": "normalize-package-data@2.4.0", + "_from": "normalize-package-data@2.5.0", + "_id": "normalize-package-data@2.5.0", "_inBundle": false, - "_integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "_integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "_location": "/normalize-package-data", - "_phantomChildren": {}, + "_phantomChildren": { + "path-parse": "1.0.6" + }, "_requested": { "type": "version", "registry": true, - "raw": "normalize-package-data@2.4.0", + "raw": "normalize-package-data@2.5.0", "name": "normalize-package-data", "escapedName": "normalize-package-data", - "rawSpec": "2.4.0", + "rawSpec": "2.5.0", "saveSpec": null, - "fetchSpec": "2.4.0" + "fetchSpec": "2.5.0" }, "_requiredBy": [ + "#USER", "/", - "/npm-registry-client", + "/libnpmpublish", "/pacote", "/read-package-json", "/read-pkg" ], - "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "_spec": "2.4.0", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "_shasum": "e66db1838b200c1dfc233225d12cb36520e234a8", + "_spec": "normalize-package-data@2.5.0", + "_where": "/Users/aeschright/code/npm-release", "author": { "name": "Meryn Stol", "email": "merynstol@gmail.com" @@ -38,6 +36,7 @@ "bugs": { "url": "https://github.com/npm/normalize-package-data/issues" }, + "bundleDependencies": false, "contributors": [ { "name": "Isaac Z. Schlueter", @@ -54,14 +53,15 @@ ], "dependencies": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" }, + "deprecated": false, "description": "Normalizes data that can be found in package.json files.", "devDependencies": { - "async": "^1.5.0", - "tap": "^2.2.0", + "async": "^2.6.1", + "tap": "^12.4.0", "underscore": "^1.8.3" }, "files": [ @@ -80,5 +80,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "2.4.0" + "version": "2.5.0" } diff --git a/node_modules/path-parse/.travis.yml b/node_modules/path-parse/.travis.yml new file mode 100644 index 0000000000000..dae31da968ba1 --- /dev/null +++ b/node_modules/path-parse/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "0.12" + - "0.11" + - "0.10" + - "0.10.12" + - "0.8" + - "0.6" + - "iojs" diff --git a/node_modules/is-builtin-module/license b/node_modules/path-parse/LICENSE similarity index 85% rename from node_modules/is-builtin-module/license rename to node_modules/path-parse/LICENSE index 654d0bfe94343..810f3dbea83b5 100644 --- a/node_modules/is-builtin-module/license +++ b/node_modules/path-parse/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) 2015 Javier Blanco Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,13 +9,13 @@ 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 above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/path-parse/README.md b/node_modules/path-parse/README.md new file mode 100644 index 0000000000000..05097f86aef36 --- /dev/null +++ b/node_modules/path-parse/README.md @@ -0,0 +1,42 @@ +# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) + +> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). + +## Install + +``` +$ npm install --save path-parse +``` + +## Usage + +```js +var pathParse = require('path-parse'); + +pathParse('/home/user/dir/file.txt'); +//=> { +// root : "/", +// dir : "/home/user/dir", +// base : "file.txt", +// ext : ".txt", +// name : "file" +// } +``` + +## API + +See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. + +### pathParse(path) + +### pathParse.posix(path) + +The Posix specific version. + +### pathParse.win32(path) + +The Windows specific version. + +## License + +MIT © [Javier Blanco](http://jbgutierrez.info) diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js new file mode 100644 index 0000000000000..3b7601fe494ee --- /dev/null +++ b/node_modules/path-parse/index.js @@ -0,0 +1,93 @@ +'use strict'; + +var isWindows = process.platform === 'win32'; + +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + +var win32 = {}; + +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} + +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; + + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; + +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json new file mode 100644 index 0000000000000..56d19c753c875 --- /dev/null +++ b/node_modules/path-parse/package.json @@ -0,0 +1,65 @@ +{ + "_args": [ + [ + "path-parse@1.0.6", + "/Users/aeschright/code/npm-release" + ] + ], + "_development": true, + "_from": "path-parse@1.0.6", + "_id": "path-parse@1.0.6", + "_inBundle": false, + "_integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "_location": "/path-parse", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "path-parse@1.0.6", + "name": "path-parse", + "escapedName": "path-parse", + "rawSpec": "1.0.6", + "saveSpec": null, + "fetchSpec": "1.0.6" + }, + "_requiredBy": [ + "/resolve" + ], + "_resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "_spec": "1.0.6", + "_where": "/Users/aeschright/code/npm-release", + "author": { + "name": "Javier Blanco", + "email": "http://jbgutierrez.info" + }, + "bugs": { + "url": "https://github.com/jbgutierrez/path-parse/issues" + }, + "description": "Node.js path.parse() ponyfill", + "homepage": "https://github.com/jbgutierrez/path-parse#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "parse", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim" + ], + "license": "MIT", + "main": "index.js", + "name": "path-parse", + "repository": { + "type": "git", + "url": "git+https://github.com/jbgutierrez/path-parse.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.6" +} diff --git a/node_modules/path-parse/test.js b/node_modules/path-parse/test.js new file mode 100644 index 0000000000000..0b30c12393639 --- /dev/null +++ b/node_modules/path-parse/test.js @@ -0,0 +1,77 @@ +var assert = require('assert'); +var pathParse = require('./index'); + +var winParseTests = [ + [{ root: 'C:\\', dir: 'C:\\path\\dir', base: 'index.html', ext: '.html', name: 'index' }, 'C:\\path\\dir\\index.html'], + [{ root: 'C:\\', dir: 'C:\\another_path\\DIR\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'C:\\another_path\\DIR\\1\\2\\33\\index'], + [{ root: '', dir: 'another_path\\DIR with spaces\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'another_path\\DIR with spaces\\1\\2\\33\\index'], + [{ root: '\\', dir: '\\foo', base: 'C:', ext: '', name: 'C:' }, '\\foo\\C:'], + [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], + [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, '.\\file'], + + // unc + [{ root: '\\\\server\\share\\', dir: '\\\\server\\share\\', base: 'file_path', ext: '', name: 'file_path' }, '\\\\server\\share\\file_path'], + [{ root: '\\\\server two\\shared folder\\', dir: '\\\\server two\\shared folder\\', base: 'file path.zip', ext: '.zip', name: 'file path' }, '\\\\server two\\shared folder\\file path.zip'], + [{ root: '\\\\teela\\admin$\\', dir: '\\\\teela\\admin$\\', base: 'system32', ext: '', name: 'system32' }, '\\\\teela\\admin$\\system32'], + [{ root: '\\\\?\\UNC\\', dir: '\\\\?\\UNC\\server', base: 'share', ext: '', name: 'share' }, '\\\\?\\UNC\\server\\share'] +]; + +var winSpecialCaseFormatTests = [ + [{dir: 'some\\dir'}, 'some\\dir\\'], + [{base: 'index.html'}, 'index.html'], + [{}, ''] +]; + +var unixParseTests = [ + [{ root: '/', dir: '/home/user/dir', base: 'file.txt', ext: '.txt', name: 'file' }, '/home/user/dir/file.txt'], + [{ root: '/', dir: '/home/user/a dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a dir/another File.zip'], + [{ root: '/', dir: '/home/user/a dir/', base: 'another&File.', ext: '.', name: 'another&File' }, '/home/user/a dir//another&File.'], + [{ root: '/', dir: '/home/user/a$$$dir/', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a$$$dir//another File.zip'], + [{ root: '', dir: 'user/dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, 'user/dir/another File.zip'], + [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], + [{ root: '', dir: '', base: '.\\file', ext: '', name: '.\\file' }, '.\\file'], + [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, './file'], + [{ root: '', dir: '', base: 'C:\\foo', ext: '', name: 'C:\\foo' }, 'C:\\foo'] +]; + +var unixSpecialCaseFormatTests = [ + [{dir: 'some/dir'}, 'some/dir/'], + [{base: 'index.html'}, 'index.html'], + [{}, ''] +]; + +var errors = [ + {input: null, message: /Parameter 'pathString' must be a string, not/}, + {input: {}, message: /Parameter 'pathString' must be a string, not object/}, + {input: true, message: /Parameter 'pathString' must be a string, not boolean/}, + {input: 1, message: /Parameter 'pathString' must be a string, not number/}, + {input: undefined, message: /Parameter 'pathString' must be a string, not undefined/}, +]; + +checkParseFormat(pathParse.win32, winParseTests); +checkParseFormat(pathParse.posix, unixParseTests); +checkErrors(pathParse.win32); +checkErrors(pathParse.posix); + +function checkErrors(parse) { + errors.forEach(function(errorCase) { + try { + parse(errorCase.input); + } catch(err) { + assert.ok(err instanceof TypeError); + assert.ok( + errorCase.message.test(err.message), + 'expected ' + errorCase.message + ' to match ' + err.message + ); + return; + } + + assert.fail('should have thrown'); + }); +} + +function checkParseFormat(parse, testCases) { + testCases.forEach(function(testCase) { + assert.deepEqual(parse(testCase[1]), testCase[0]); + }); +} diff --git a/package-lock.json b/package-lock.json index a2201108d4c2c..86d41472273be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -385,7 +385,8 @@ "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true }, "builtins": { "version": "1.0.3", @@ -2260,14 +2261,6 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "requires": { - "builtin-modules": "^1.0.0" - } - }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", @@ -3179,14 +3172,24 @@ } }, "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "requires": { + "path-parse": "^1.0.6" + } + } } }, "npm-audit-report": { @@ -6274,8 +6277,7 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "path-type": { "version": "2.0.0", diff --git a/package.json b/package.json index 0244769929dae..ea4c35001665f 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "move-concurrently": "^1.0.1", "node-gyp": "^3.8.0", "nopt": "~4.0.1", - "normalize-package-data": "~2.4.0", + "normalize-package-data": "^2.5.0", "npm-audit-report": "^1.3.2", "npm-cache-filename": "~1.0.2", "npm-install-checks": "~3.0.0", From 32d34c0da4f393a74697297667eb9226155ecc6b Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 6 Feb 2019 13:14:23 -0800 Subject: [PATCH 16/26] npm-packlist@1.3.0 --- node_modules/npm-bundled/index.js | 14 ++++++++++++- node_modules/npm-bundled/package.json | 12 +++++------ node_modules/npm-packlist/index.js | 28 ++++++++++++++++++++------ node_modules/npm-packlist/package.json | 22 ++++++++++---------- package-lock.json | 12 +++++------ package.json | 2 +- 6 files changed, 59 insertions(+), 31 deletions(-) diff --git a/node_modules/npm-bundled/index.js b/node_modules/npm-bundled/index.js index c0c5f60cc0edf..bde0acd164b7d 100644 --- a/node_modules/npm-bundled/index.js +++ b/node_modules/npm-bundled/index.js @@ -43,6 +43,18 @@ class BundleWalker extends EE { this.bundle = null } + addListener (ev, fn) { + return this.on(ev, fn) + } + + on (ev, fn) { + const ret = super.on(ev, fn) + if (ev === 'done' && this.didDone) { + this.emit('done', this.result) + } + return ret + } + done () { if (!this.didDone) { this.didDone = true @@ -57,7 +69,7 @@ class BundleWalker extends EE { } start () { - const pj = this.path + '/package.json' + const pj = path.resolve(this.path, 'package.json') if (this.packageJsonCache.has(pj)) this.onPackage(this.packageJsonCache.get(pj)) else diff --git a/node_modules/npm-bundled/package.json b/node_modules/npm-bundled/package.json index 4c46838ce476a..4829737400453 100644 --- a/node_modules/npm-bundled/package.json +++ b/node_modules/npm-bundled/package.json @@ -1,8 +1,8 @@ { "_from": "npm-bundled@^1.0.1", - "_id": "npm-bundled@1.0.5", + "_id": "npm-bundled@1.0.6", "_inBundle": false, - "_integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", + "_integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "_location": "/npm-bundled", "_phantomChildren": {}, "_requested": { @@ -18,10 +18,10 @@ "_requiredBy": [ "/npm-packlist" ], - "_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "_shasum": "3c1732b7ba936b3a10325aef616467c0ccbcc979", + "_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "_shasum": "e7ba9aadcef962bb61248f91721cd932b3fe6bdd", "_spec": "npm-bundled@^1.0.1", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/npm-packlist", + "_where": "/Users/aeschright/code/npm-release/node_modules/npm-packlist", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -56,5 +56,5 @@ "preversion": "npm test", "test": "tap test/*.js -J --100" }, - "version": "1.0.5" + "version": "1.0.6" } diff --git a/node_modules/npm-packlist/index.js b/node_modules/npm-packlist/index.js index 110a344cb04d9..5cbe011fb66e8 100644 --- a/node_modules/npm-packlist/index.js +++ b/node_modules/npm-packlist/index.js @@ -38,7 +38,13 @@ const defaultRules = [ '._*', '*.orig', 'package-lock.json', + 'yarn.lock', 'archived-packages/**', + 'core', + '*.core', + '*.vgcore', + 'vgcore.*', + 'core.+([0-9])', ] // a decorator that applies our custom rules to an ignore walker @@ -136,13 +142,21 @@ const npmWalker = Class => class Walker extends Class { onPackageJson (ig, pkg, then) { this.packageJsonCache.set(ig, pkg) - // if there's a browser or main, make sure we don't ignore it + // if there's a bin, browser or main, make sure we don't ignore it const rules = [ pkg.browser ? '!' + pkg.browser : '', pkg.main ? '!' + pkg.main : '', - '!@(readme|copying|license|licence|notice|changes|changelog|history){,.*}' - ].filter(f => f).join('\n') + '\n' - super.onReadIgnoreFile(packageNecessaryRules, rules, _=>_) + '!@(readme|copying|license|licence|notice|changes|changelog|history){,.*[^~$]}' + ] + if (pkg.bin) + if (typeof pkg.bin === "object") + for (const key in pkg.bin) + rules.push('!' + pkg.bin[key]) + else + rules.push('!' + pkg.bin) + + const data = rules.filter(f => f).join('\n') + '\n' + super.onReadIgnoreFile(packageNecessaryRules, data, _=>_) if (Array.isArray(pkg.files)) super.onReadIgnoreFile('package.json', '*\n' + pkg.files.map( @@ -163,7 +177,8 @@ const npmWalker = Class => class Walker extends Class { onReadIgnoreFile (file, data, then) { if (file === 'package.json') try { - this.onPackageJson(file, JSON.parse(data), then) + const ig = path.resolve(this.path, file) + this.onPackageJson(ig, JSON.parse(data), then) } catch (er) { // ignore package.json files that are not json then() @@ -193,12 +208,13 @@ class WalkerSync extends npmWalker(IgnoreWalkerSync) { const walk = (options, callback) => { options = options || {} const p = new Promise((resolve, reject) => { - const bw = new BundleWalker(options).start() + const bw = new BundleWalker(options) bw.on('done', bundled => { options.bundled = bundled options.packageJsonCache = bw.packageJsonCache new Walker(options).on('done', resolve).on('error', reject).start() }) + bw.start() }) return callback ? p.then(res => callback(null, res), callback) : p } diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index d37a7bd1bb4f6..20b37c55b5e8c 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,29 +1,29 @@ { - "_from": "npm-packlist@1.2.0", - "_id": "npm-packlist@1.2.0", + "_from": "npm-packlist@1.3.0", + "_id": "npm-packlist@1.3.0", "_inBundle": false, - "_integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", + "_integrity": "sha512-qPBc6CnxEzpOcc4bjoIBJbYdy0D/LFFPUdxvfwor4/w3vxeE0h6TiOVurCEPpQ6trjN77u/ShyfeJGsbAfB3dA==", "_location": "/npm-packlist", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-packlist@1.2.0", + "raw": "npm-packlist@1.3.0", "name": "npm-packlist", "escapedName": "npm-packlist", - "rawSpec": "1.2.0", + "rawSpec": "1.3.0", "saveSpec": null, - "fetchSpec": "1.2.0" + "fetchSpec": "1.3.0" }, "_requiredBy": [ "#USER", "/", "/pacote" ], - "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", - "_shasum": "55a60e793e272f00862c7089274439a4cc31fc7f", - "_spec": "npm-packlist@1.2.0", - "_where": "/Users/aeschright/code/cli", + "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.3.0.tgz", + "_shasum": "7f01e8e44408341379ca98cfd756e7b29bd2626c", + "_spec": "npm-packlist@1.3.0", + "_where": "/Users/aeschright/code/npm-release", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -64,5 +64,5 @@ "preversion": "npm test", "test": "tap test/*.js --100 -J" }, - "version": "1.2.0" + "version": "1.3.0" } diff --git a/package-lock.json b/package-lock.json index 86d41472273be..ad6af6d07e53b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3202,9 +3202,9 @@ } }, "npm-bundled": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" }, "npm-cache-filename": { "version": "1.0.2", @@ -3251,9 +3251,9 @@ } }, "npm-packlist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", - "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.3.0.tgz", + "integrity": "sha512-qPBc6CnxEzpOcc4bjoIBJbYdy0D/LFFPUdxvfwor4/w3vxeE0h6TiOVurCEPpQ6trjN77u/ShyfeJGsbAfB3dA==", "requires": { "ignore-walk": "^3.0.1", "npm-bundled": "^1.0.1" diff --git a/package.json b/package.json index ea4c35001665f..ff329704debf2 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "npm-install-checks": "~3.0.0", "npm-lifecycle": "^2.1.0", "npm-package-arg": "^6.1.0", - "npm-packlist": "^1.2.0", + "npm-packlist": "^1.3.0", "npm-pick-manifest": "^2.2.3", "npm-registry-fetch": "^3.9.0", "npm-user-validate": "~1.0.0", From f54bf9e3597cda2ebb4783899fbd17d47b7a0ee1 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 6 Feb 2019 13:26:43 -0800 Subject: [PATCH 17/26] chore: update changelog for 6.8.0 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3811a970b0cfa..aa574fa38e886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,10 @@ the directory path for a package within a monorepo. [#149](https://github.com/npm/cli/pull/149) Use figgy-config to make sure extra opts are there. ([@zkat](https://github.com/zkat)) +* [`3c22d1a35`](https://github.com/npm/cli/commit/3c22d1a35878f73c0af8ea5968b962a85a1a9b84) + [npm.community#5101](https://npm.community/t/npm-6-6-0-breaks-access-to-ls-collaborators/5101) + Fix `ls-collaborators` access error for non-scoped case. + ([@zkat](https://github.com/zkat)) ### DEPENDENCY BUMPS @@ -44,6 +48,12 @@ the directory path for a package within a monorepo. * [`95ca1aef4`](https://github.com/npm/cli/commit/95ca1aef4077c8e68d9f4dce37f6ba49b591c4ca) `pacote@9.4.1` ([@aeschright](https://github.com/aeschright)) +* [`322fef403`](https://github.com/npm/cli/commit/322fef40376e71cd100159dc914e7ca89faae327) + `normalize-package-data@2.5.0` + ([@aeschright](https://github.com/aeschright)) +* [`32d34c0da`](https://github.com/npm/cli/commit/32d34c0da4f393a74697297667eb9226155ecc6b) + `npm-packlist@1.3.0` + ([@aeschright](https://github.com/aeschright)) ### MISC From 7c62cdef7af45795dbbc17dbf2fb6c42447475c7 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 6 Feb 2019 13:44:39 -0800 Subject: [PATCH 18/26] 6.8.0-next.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ad6af6d07e53b..6dff6c7b9d6e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "npm", - "version": "6.8.0-next.0", + "version": "6.8.0-next.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ff329704debf2..0142e4f0da239 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "6.8.0-next.0", + "version": "6.8.0-next.1", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ From d5137091dd695a2980f7ade85fdc56b2421ff677 Mon Sep 17 00:00:00 2001 From: JT Turner Date: Thu, 7 Feb 2019 10:42:39 -0800 Subject: [PATCH 19/26] Fix issue with sub folder local references (#86) PR-URL: https://github.com/npm/cli/pull/86 Fixes: https://npm.community/t/npm-install-for-package-with-local-dependency-fails/754 Credit: @iarna Credit: @jhecking Reviewed-By: @aeschright --- lib/install/inflate-shrinkwrap.js | 2 +- lib/shrinkwrap.js | 7 ++- test/tap/install-at-sub-path-locally.js | 69 +++++++++++++++++++++++++ test/tap/shrinkwrap-local-dependency.js | 3 +- test/tap/spec-local-specifiers.js | 4 +- 5 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 test/tap/install-at-sub-path-locally.js diff --git a/lib/install/inflate-shrinkwrap.js b/lib/install/inflate-shrinkwrap.js index bf1ab7065724c..395cc11191309 100644 --- a/lib/install/inflate-shrinkwrap.js +++ b/lib/install/inflate-shrinkwrap.js @@ -177,7 +177,7 @@ function makeFakeChild (name, topPath, tree, sw, requested) { realpath: requested.type === 'directory' ? requested.fetchSpec : childPath(tree.realpath, pkg), location: (tree.location === '/' ? '' : tree.location + '/') + pkg.name, isLink: requested.type === 'directory', - isInLink: tree.isLink, + isInLink: tree.isLink || tree.isInLink, swRequires: sw.requires }) tree.children.push(child) diff --git a/lib/shrinkwrap.js b/lib/shrinkwrap.js index dbb12b5bd4fba..b1f60ac7a9eea 100644 --- a/lib/shrinkwrap.js +++ b/lib/shrinkwrap.js @@ -110,11 +110,13 @@ function shrinkwrapDeps (deps, top, tree, seen) { var childIsOnlyDev = isOnlyDev(child) var pkginfo = deps[moduleName(child)] = {} var requested = getRequested(child) || child.package._requested || {} + var linked = child.isLink || child.isInLink + var linkedFromHere = linked && path.relative(top.realpath, child.realpath)[0] !== '.' pkginfo.version = childVersion(top, child, requested) if (requested.type === 'git' && child.package._from) { pkginfo.from = child.package._from } - if (child.fromBundle || child.isInLink) { + if (child.fromBundle && !linked) { pkginfo.bundled = true } else { if (isRegistry(requested)) { @@ -139,7 +141,8 @@ function shrinkwrapDeps (deps, top, tree, seen) { pkginfo.requires[moduleName(required)] = childRequested(top, required, requested) }) } - if (child.children.length) { + // iterate into children on non-links and links contained within the top level package + if (child.children.length && (!child.isLink || linkedFromHere)) { pkginfo.dependencies = {} shrinkwrapDeps(pkginfo.dependencies, top, child, seen) } diff --git a/test/tap/install-at-sub-path-locally.js b/test/tap/install-at-sub-path-locally.js new file mode 100644 index 0000000000000..e16b75179ebaf --- /dev/null +++ b/test/tap/install-at-sub-path-locally.js @@ -0,0 +1,69 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-at-sub-path-locally') + +var EXEC_OPTS = { cwd: pkg, stdio: [0, 1, 2] } + +var json = { + name: 'install-at-sub-path-locally-mock', + version: '0.0.0' +} + +var target = '../package@1.2.3' + +test('setup', function (t) { + cleanup() + t.end() +}) + +test('\'npm install ../package@1.2.3\' should install local pkg from sub path', function (t) { + setup() + common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { + if (err) throw err + var p = path.resolve(pkg, 'node_modules/install-at-sub-path-locally-mock/package.json') + t.equal(code, 0, 'npm install exited with code') + t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) + t.end() + }) +}) + +test('\'running npm install ../package@1.2.3\' should not break on sub path re-install', function (t) { + common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { + if (err) throw err + var p = path.resolve(pkg, 'node_modules/install-at-sub-path-locally-mock/package.json') + t.equal(code, 0, 'npm install exited with code') + t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + rimraf.sync(path.resolve(pkg, target)) +} + +function setup () { + cleanup() + var root = path.resolve(pkg, target) + mkdirp.sync(root) + fs.writeFileSync( + path.join(root, 'package.json'), + JSON.stringify(json, null, 2) + ) + mkdirp.sync(path.resolve(pkg, 'node_modules')) + process.chdir(pkg) +} diff --git a/test/tap/shrinkwrap-local-dependency.js b/test/tap/shrinkwrap-local-dependency.js index 58974ad72431a..d1c33b99a5a0b 100644 --- a/test/tap/shrinkwrap-local-dependency.js +++ b/test/tap/shrinkwrap-local-dependency.js @@ -20,8 +20,7 @@ var shrinkwrap = { version: 'file:' + unixFormatPath(path.join('mods', 'mod2')), dependencies: { mod1: { - version: 'file:' + unixFormatPath(path.join('mods', 'mod1')), - bundled: true + version: 'file:' + unixFormatPath(path.join('mods', 'mod1')) } } } diff --git a/test/tap/spec-local-specifiers.js b/test/tap/spec-local-specifiers.js index d149b7ea0ea3a..3601eee5f3c5f 100644 --- a/test/tap/spec-local-specifiers.js +++ b/test/tap/spec-local-specifiers.js @@ -585,9 +585,7 @@ test('save behavior', function (t) { var deps = pjson.dependencies || {} t.is(deps['sb-transitive'], 'file:../sb-transitive', 'package.json') var sdep = shrinkwrap.dependencies['sb-transitive'] || {} - var tdep = sdep.dependencies.sbta - t.like(tdep, {bundled: true, version: 'file:../sb-transitive/sbta'}, 'npm-shrinkwrap.json transitive dep') - t.like(sdep, {bundled: null, version: 'file:../sb-transitive'}, 'npm-shrinkwrap.json direct dep') + t.like(sdep, {bundled: null, dependencies: null, version: 'file:../sb-transitive'}, 'npm-shrinkwrap.json direct dep') t.done() }) }) From 7b87710836a99e39d75e20a3df9f76b88f1aabd2 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Thu, 7 Feb 2019 11:25:01 -0800 Subject: [PATCH 20/26] chore: update changelog for 6.8.0 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa574fa38e886..f6d6b3c1bae8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v6.8.0 (2019-01-31): +## v6.8.0 (2019-02-07): This release includes an implementation of [RFC #10](https://github.com/npm/rfcs/blob/latest/accepted/0010-monorepo-subdirectory-declaration.md), documenting an optional field that can be used to specify the directory path for a package within a monorepo. @@ -35,6 +35,11 @@ the directory path for a package within a monorepo. [npm.community#5101](https://npm.community/t/npm-6-6-0-breaks-access-to-ls-collaborators/5101) Fix `ls-collaborators` access error for non-scoped case. ([@zkat](https://github.com/zkat)) +* [`d5137091d`](https://github.com/npm/cli/commit/d5137091dd695a2980f7ade85fdc56b2421ff677) + [npm.community#754](https://npm.community/t/npm-install-for-package-with-local-dependency-fails/754) + Fix issue with sub-folder local references. + ([@iarna](https://github.com/iarna)) + ([@jhecking](https://github.com/jhecking)) ### DEPENDENCY BUMPS From b436cb0774472c723e7956a88e271a5d50c52f89 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Thu, 7 Feb 2019 11:35:29 -0800 Subject: [PATCH 21/26] update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 705b7c5c80339..48bed04a8a239 100644 --- a/AUTHORS +++ b/AUTHORS @@ -622,3 +622,4 @@ Johannes Würbach Eli Doran Tobias Koppers Grey Baker +JT Turner From 26b768dbced4de5b88d99cc51096864da97cf4f1 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Thu, 7 Feb 2019 11:35:29 -0800 Subject: [PATCH 22/26] 6.8.0-next.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6dff6c7b9d6e6..fea697889df25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "npm", - "version": "6.8.0-next.1", + "version": "6.8.0-next.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0142e4f0da239..39410b89672ff 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "6.8.0-next.1", + "version": "6.8.0-next.2", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ From 0c970362d76477199aa61cc5380eb92faaa69c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 12 Feb 2019 14:03:42 -0800 Subject: [PATCH 23/26] Revert "install/dedupe: fix hoisting of packages with peerDeps (#147)" (#152) PR-URL: https://github.com/npm/cli/pull/152 Fixes: https://npm.community/t/npm-6-8-0-next-0-regression-in-maximally-flat-install/5118 Credit: @zkat Reviewed-By: @aeschright --- lib/dedupe.js | 5 +- lib/install/deps.js | 29 +---- test/tap/hoist-peer-dependencies.js | 130 ---------------------- test/tap/unit-deps-earliestInstallable.js | 55 +-------- 4 files changed, 10 insertions(+), 209 deletions(-) delete mode 100644 test/tap/hoist-peer-dependencies.js diff --git a/lib/dedupe.js b/lib/dedupe.js index fae409fea572d..325faeaabcd43 100644 --- a/lib/dedupe.js +++ b/lib/dedupe.js @@ -142,9 +142,8 @@ function hoistChildren_ (tree, diff, seen, next) { [andComputeMetadata(tree)] ], done) } - // find a location where it's installable - var hoistTo = earliestInstallable(tree, tree, child.package, log, child) - if (hoistTo && hoistTo !== tree) { + var hoistTo = earliestInstallable(tree, tree.parent, child.package, log) + if (hoistTo) { move(child, hoistTo, diff) chain([ [andComputeMetadata(hoistTo)], diff --git a/lib/install/deps.js b/lib/install/deps.js index 1cf4de15dc3f1..c36265093b090 100644 --- a/lib/install/deps.js +++ b/lib/install/deps.js @@ -650,7 +650,7 @@ function resolveWithNewModule (pkg, tree, log, next) { return isInstallable(pkg, (err) => { let installable = !err addBundled(pkg, (bundleErr) => { - var parent = earliestInstallable(tree, tree, pkg, log, null) || tree + var parent = earliestInstallable(tree, tree, pkg, log) || tree var isLink = pkg._requested.type === 'directory' var child = createChild({ package: pkg, @@ -755,11 +755,11 @@ function preserveSymlinks () { // Find the highest level in the tree that we can install this module in. // If the module isn't installed above us yet, that'd be the very top. // If it is, then it's the level below where its installed. -var earliestInstallable = exports.earliestInstallable = function (requiredBy, tree, pkg, log, ignoreChild) { - validate('OOOOZ|OOOOO', arguments) +var earliestInstallable = exports.earliestInstallable = function (requiredBy, tree, pkg, log) { + validate('OOOO', arguments) function undeletedModuleMatches (child) { - return child !== ignoreChild && !child.removed && moduleName(child) === pkg.name + return !child.removed && moduleName(child) === pkg.name } const undeletedMatches = tree.children.filter(undeletedModuleMatches) if (undeletedMatches.length) { @@ -778,7 +778,7 @@ var earliestInstallable = exports.earliestInstallable = function (requiredBy, tr // If any of the children of this tree have conflicting // binaries then we need to decline to install this package here. var binaryMatches = pkg.bin && tree.children.some(function (child) { - if (child === ignoreChild || child.removed || !child.package.bin) return false + if (child.removed || !child.package.bin) return false return Object.keys(child.package.bin).some(function (bin) { return pkg.bin[bin] }) @@ -804,23 +804,6 @@ var earliestInstallable = exports.earliestInstallable = function (requiredBy, tr if (tree.phantomChildren && tree.phantomChildren[pkg.name]) return null - // if any of the peer dependencies is a dependency of the current - // tree locations, we place the package here. This is a safe location - // where we don't violate the peer dependencies contract. - // It may not be the perfect location in some cases, but we don't know - // if dependencies are hoisted to another location yet, as they - // may not be loaded into the tree yet. - // We can ignore dev deps here as they are only installed on top-level - // and we can't hoist further than that anyway. - var peerDeps = pkg.peerDependencies - if (peerDeps) { - if (Object.keys(peerDeps).some(function (name) { - return deps[name] - })) { - return tree - } - } - if (tree.isTop) return tree if (tree.isGlobal) return tree @@ -829,5 +812,5 @@ var earliestInstallable = exports.earliestInstallable = function (requiredBy, tr if (!preserveSymlinks() && /^[.][.][\\/]/.test(path.relative(tree.parent.realpath, tree.realpath))) return tree - return (earliestInstallable(requiredBy, tree.parent, pkg, log, ignoreChild) || tree) + return (earliestInstallable(requiredBy, tree.parent, pkg, log) || tree) } diff --git a/test/tap/hoist-peer-dependencies.js b/test/tap/hoist-peer-dependencies.js deleted file mode 100644 index 75d7d3e778ada..0000000000000 --- a/test/tap/hoist-peer-dependencies.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict' -const path = require('path') -const fs = require('fs') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = path.join(__dirname, path.basename(__filename, '.js')) -const testdir = path.join(basedir, 'testdir') -const cachedir = path.join(basedir, 'cache') -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - package: Dir({ - 'package.json': File({ - name: 'package', - version: '1.0.0', - dependencies: { - 'base-dep': '../packages/base-dep-1.0.0.tgz', - 'plugin-dep': '../packages/plugin-dep-1.0.0.tgz' - } - }) - }), - 'package.json': File({ - version: '1.0.0', - dependencies: { - package: 'file:./package', - 'base-dep': './packages/base-dep-2.0.0.tgz' - } - }), - // file: dependencies do not work as they are symlinked and behave - // differently. Instead installation from tgz files is used. - packages: Dir({ - 'base-dep-1.0.0.tgz': File(Buffer.from( - '1f8b080000000000000a2b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066666660ad8c4c1c0d45c81c1d8d4ccc0d0d0ccccc0448101c8303505' + - 'd1d4760836505a5c925804740aa5e640bca200a78708a8e6525050ca4bcc' + - '4d55b252504a4a2c4ed54d492d50d2018996a5161567e6e781240cf50cf4' + - '0c94b86ab906dab9a360148c8251300aa80400a44d97d100080000', - 'hex' - )), - 'base-dep-2.0.0.tgz': File(Buffer.from( - '1f8b080000000000000a2b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066666660ad8c4c1c0d45c81c1d8d4ccc0d0d0ccccc0448101c8303505' + - 'd1d4760836505a5c925804740aa5e640bca200a78708a8e6525050ca4bcc' + - '4d55b252504a4a2c4ed54d492d50d2018996a5161567e6e781248cf40cf4' + - '0c94b86ab906dab9a360148c8251300aa80400aebbeeba00080000', - 'hex' - )), - 'plugin-dep-1.0.0.tgz': File(Buffer.from( - '1f8b080000000000000aed8f3d0e83300c8599394594b904476d3274e622' + - '295888fe8488408756dcbd0e513bb115a9aa946f79ce7bb1653b535f4c8b' + - 'a58b2acebeb7d9c60080d69aadf90119b2bdd220a98203cba8504a916ebd' + - 'c81a931fcd40ab7c3b27dec23efa273c73c6b83537e447c6dd756a3b5b34' + - 'e8f82ef8771c7cd7db10490102a2eb10870a1dda066ddda1a7384ca1e464' + - '3c2eddd42044f97e164bb318db07a77f733ee7bfbe3a914824122f4e04e9' + - '2e00080000', - 'hex' - )) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', t => { - setup() - return common.fakeRegistry.listen() -}) - -test('example', t => { - return common.npm(['install'], conf).then(([code, stdout, stderr]) => { - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.ok(fs.existsSync(path.join(testdir, 'node_modules')), 'did install') - var packageLock = JSON.parse(fs.readFileSync(path.join(testdir, 'package-lock.json'), 'utf8')) - t.similar(packageLock, { - dependencies: { - 'base-dep': { - version: 'file:packages/base-dep-2.0.0.tgz' - }, - 'package': { - version: 'file:package', - dependencies: { - 'base-dep': { - version: 'file:packages/base-dep-1.0.0.tgz' - }, - // plugin-dep must not placed on top-level - 'plugin-dep': { - version: 'file:packages/plugin-dep-1.0.0.tgz' - } - } - } - } - }, 'locks dependencies as unhoisted') - t.similar(Object.keys(packageLock.dependencies), ['base-dep', 'package'], 'has correct packages on top-level') - }) -}) - -test('cleanup', t => { - common.fakeRegistry.close() - cleanup() - t.done() -}) diff --git a/test/tap/unit-deps-earliestInstallable.js b/test/tap/unit-deps-earliestInstallable.js index 136e6478c586a..47d1ab4119b1e 100644 --- a/test/tap/unit-deps-earliestInstallable.js +++ b/test/tap/unit-deps-earliestInstallable.js @@ -67,7 +67,7 @@ test('earliestInstallable should consider devDependencies', function (t) { dep2a.parent = dep1 dep2.parent = pkg - var earliest = earliestInstallable(dep1, dep1, dep2a.package, log, null) + var earliest = earliestInstallable(dep1, dep1, dep2a.package, log) t.isDeeply(earliest, dep1, 'should hoist package when an incompatible devDependency is present') t.end() }) @@ -108,58 +108,7 @@ test('earliestInstallable should reuse shared prod/dev deps when they are identi dep1.parent = pkg dep2.parent = pkg - var earliest = earliestInstallable(dep1, dep1, dep2.package, log, null) + var earliest = earliestInstallable(dep1, dep1, dep2.package, log) t.isDeeply(earliest, pkg, 'should reuse identical shared dev/prod deps when installing both') t.end() }) - -test('earliestInstallable should consider peerDependencies', function (t) { - var dep1 = { - children: [], - package: { - name: 'dep1', - dependencies: { - dep2: '1.0.0', - dep3: '1.0.0' - } - }, - path: '/dep1', - realpath: '/dep1' - } - - var dep2 = { - package: { - name: 'dep2', - version: '1.0.0', - peerDependencies: { - dep3: '1.0.0' - }, - _requested: npa('dep2@^1.0.0') - }, - parent: dep1, - path: '/dep1/node_modules/dep2', - realpath: '/dep1/node_modules/dep2' - } - - var pkg = { - isTop: true, - children: [dep1], - package: { - name: 'pkg', - dependencies: { dep1: '1.0.0' } - }, - path: '/', - realpath: '/' - } - - dep1.parent = pkg - - var earliest = earliestInstallable(dep1, dep1, dep2.package, log, null) - t.isDeeply(earliest, dep1, 'should not be able to hoist the package to top-level') - - dep1.children.push(dep2) - - var earliestWithIgnore = earliestInstallable(dep1, dep1, dep2.package, log, dep2) - t.isDeeply(earliestWithIgnore, dep1, 'should not be able to hoist the package to top-level') - t.end() -}) From 338571cf0bd3a1e2ea800464d57581932ff0fb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 12 Feb 2019 15:16:31 -0800 Subject: [PATCH 24/26] read-package-tree@5.2.2 --- node_modules/read-package-tree/README.md | 2 ++ node_modules/read-package-tree/package.json | 37 ++++++++++----------- node_modules/read-package-tree/rpt.js | 11 +++--- package-lock.json | 6 ++-- package.json | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/node_modules/read-package-tree/README.md b/node_modules/read-package-tree/README.md index d2248f82b55a9..c8edffd2bcc2e 100644 --- a/node_modules/read-package-tree/README.md +++ b/node_modules/read-package-tree/README.md @@ -1,5 +1,7 @@ # read-package-tree +[![Build Status](https://travis-ci.org/npm/read-package-tree.svg?branch=master)](https://travis-ci.org/npm/read-package-tree) + Read the contents of node_modules. ## USAGE diff --git a/node_modules/read-package-tree/package.json b/node_modules/read-package-tree/package.json index bb7295dadac68..948f096620033 100644 --- a/node_modules/read-package-tree/package.json +++ b/node_modules/read-package-tree/package.json @@ -1,32 +1,29 @@ { - "_args": [ - [ - "read-package-tree@5.2.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "read-package-tree@5.2.1", - "_id": "read-package-tree@5.2.1", + "_from": "read-package-tree@latest", + "_id": "read-package-tree@5.2.2", "_inBundle": false, - "_integrity": "sha512-2CNoRoh95LxY47LvqrehIAfUVda2JbuFE/HaGYs42bNrGG+ojbw1h3zOcPcQ+1GQ3+rkzNndZn85u1XyZ3UsIA==", + "_integrity": "sha512-rW3XWUUkhdKmN2JKB4FL563YAgtINifso5KShykufR03nJ5loGFlkUMe1g/yxmqX073SoYYTsgXu7XdDinKZuA==", "_location": "/read-package-tree", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "tag", "registry": true, - "raw": "read-package-tree@5.2.1", + "raw": "read-package-tree@latest", "name": "read-package-tree", "escapedName": "read-package-tree", - "rawSpec": "5.2.1", + "rawSpec": "latest", "saveSpec": null, - "fetchSpec": "5.2.1" + "fetchSpec": "latest" }, "_requiredBy": [ - "/" + "#USER", + "/", + "/licensee" ], - "_resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.2.1.tgz", - "_spec": "5.2.1", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.2.2.tgz", + "_shasum": "4b6a0ef2d943c1ea36a578214c9a7f6b7424f7a8", + "_spec": "read-package-tree@latest", + "_where": "/Users/zkat/Documents/code/work/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -35,6 +32,7 @@ "bugs": { "url": "https://github.com/npm/read-package-tree/issues" }, + "bundleDependencies": false, "dependencies": { "debuglog": "^1.0.1", "dezalgo": "^1.0.0", @@ -42,12 +40,13 @@ "read-package-json": "^2.0.0", "readdir-scoped-modules": "^1.0.0" }, + "deprecated": false, "description": "Read the contents of node_modules.", "devDependencies": { "archy": "^1.0.0", "mkdirp": "^0.5.1", "tacks": "^1.2.1", - "tap": "^6.3.0" + "tap": "^12.5.2" }, "directories": { "test": "test" @@ -66,5 +65,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "5.2.1" + "version": "5.2.2" } diff --git a/node_modules/read-package-tree/rpt.js b/node_modules/read-package-tree/rpt.js index c577ea1801186..fd43be9c22c0c 100644 --- a/node_modules/read-package-tree/rpt.js +++ b/node_modules/read-package-tree/rpt.js @@ -47,9 +47,9 @@ function Node (pkg, logical, physical, er, cache, fromLink) { debug(node.constructor.name, dpath(physical), pkg && pkg._id) - const parent = path.dirname(logical) + const parent = path.basename(path.dirname(logical)) if (parent[0] === '@') { - node.name = path.basename(parent) + '/' + path.basename(logical) + node.name = parent + '/' + path.basename(logical) } else { node.name = path.basename(logical) } @@ -83,12 +83,11 @@ function Link (pkg, logical, physical, realpath, er, cache) { debug(this.constructor.name, dpath(physical), pkg && pkg._id) - const dir = path.dirname(logical) - const parent = path.dirname(dir) + const parent = path.basename(path.dirname(logical)) if (parent[0] === '@') { - this.name = path.basename(parent) + '/' + path.basename(dir) + this.name = parent + '/' + path.basename(logical) } else { - this.name = path.basename(dir) + this.name = path.basename(logical) } this.id = ID++ this.path = logical diff --git a/package-lock.json b/package-lock.json index fea697889df25..4609b25780dd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6623,9 +6623,9 @@ } }, "read-package-tree": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.2.1.tgz", - "integrity": "sha512-2CNoRoh95LxY47LvqrehIAfUVda2JbuFE/HaGYs42bNrGG+ojbw1h3zOcPcQ+1GQ3+rkzNndZn85u1XyZ3UsIA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.2.2.tgz", + "integrity": "sha512-rW3XWUUkhdKmN2JKB4FL563YAgtINifso5KShykufR03nJ5loGFlkUMe1g/yxmqX073SoYYTsgXu7XdDinKZuA==", "requires": { "debuglog": "^1.0.1", "dezalgo": "^1.0.0", diff --git a/package.json b/package.json index 39410b89672ff..b5656fe1a7268 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "read-cmd-shim": "~1.0.1", "read-installed": "~4.0.3", "read-package-json": "^2.0.13", - "read-package-tree": "^5.2.1", + "read-package-tree": "^5.2.2", "readable-stream": "^3.1.1", "request": "^2.88.0", "retry": "^0.12.0", From c7da272f445eff84d4e526f1c1d6f39295215ee9 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 13 Feb 2019 14:52:59 -0800 Subject: [PATCH 25/26] chore: update changelog for final 6.8.0 release --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6d6b3c1bae8a..17f8a0157c3d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,10 +19,6 @@ the directory path for a package within a monorepo. [#144](https://github.com/npm/cli/pull/144) Fix common.npm callback arguments. ([@larsgw](https://github.com/larsgw)) -* [`91314e77b`](https://github.com/npm/cli/commit/91314e77be09a50a275f59ccda314f7cfe269069) - [npm.community#4794](https://npm.community/t/packages-with-peerdependencies-are-incorrectly-hoisted/4794) - Fix hoisting of packages with peerDeps. - ([@sokra](https://github.com/sokra)) * [`25573e9b9`](https://github.com/npm/cli/commit/25573e9b9d5d26261c68d453f06db5b3b1cd6789) [npm.community#4770](https://npm.community/t/https://npm.community/t/4770) Show installed but unmet peer deps. @@ -59,6 +55,9 @@ the directory path for a package within a monorepo. * [`32d34c0da`](https://github.com/npm/cli/commit/32d34c0da4f393a74697297667eb9226155ecc6b) `npm-packlist@1.3.0` ([@aeschright](https://github.com/aeschright)) +* [`338571cf0`](https://github.com/npm/cli/commit/338571cf0bd3a1e2ea800464d57581932ff0fb11) + `read-package-tree@5.2.2` + ([@zkat](https://github.com/zkat)) ### MISC From 67142b358f639dd4a688c7977bd5397ba39bc5e8 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Wed, 13 Feb 2019 15:14:36 -0800 Subject: [PATCH 26/26] 6.8.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4609b25780dd1..a0b5a4ac96b9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "npm", - "version": "6.8.0-next.2", + "version": "6.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b5656fe1a7268..b745500dcec69 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "6.8.0-next.2", + "version": "6.8.0", "name": "npm", "description": "a package manager for JavaScript", "keywords": [