diff options
Diffstat (limited to 'node_modules/read-package-tree')
18 files changed, 37 insertions, 317 deletions
diff --git a/node_modules/read-package-tree/.travis.yml b/node_modules/read-package-tree/.travis.yml deleted file mode 100644 index e1bcee1ac..000000000 --- a/node_modules/read-package-tree/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -before_script: npm install -g npm@latest -node_js: - - '0.8' - - '0.10' - - '0.12' - - 'iojs' diff --git a/node_modules/read-package-tree/package.json b/node_modules/read-package-tree/package.json index d1acb0ef0..5a376b39f 100644 --- a/node_modules/read-package-tree/package.json +++ b/node_modules/read-package-tree/package.json @@ -2,51 +2,54 @@ "_args": [ [ { - "name": "read-package-tree", - "raw": "read-package-tree@~5.1.3", - "rawSpec": "~5.1.3", + "raw": "read-package-tree@~5.1.4", "scope": null, - "spec": ">=5.1.3 <5.2.0", + "escapedName": "read-package-tree", + "name": "read-package-tree", + "rawSpec": "~5.1.4", + "spec": ">=5.1.4 <5.2.0", "type": "range" }, "/Users/rebecca/code/npm" ] ], - "_from": "read-package-tree@>=5.1.3 <5.2.0", - "_id": "read-package-tree@5.1.4", + "_from": "read-package-tree@>=5.1.4 <5.2.0", + "_id": "read-package-tree@5.1.5", "_inCache": true, "_installable": true, "_location": "/read-package-tree", "_nodeVersion": "4.4.0", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/read-package-tree-5.1.4.tgz_1463682709793_0.6651253618765622" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/read-package-tree-5.1.5.tgz_1466725442057_0.8425232821609825" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, - "_npmVersion": "3.9.2", + "_npmVersion": "3.10.2", "_phantomChildren": {}, "_requested": { - "name": "read-package-tree", - "raw": "read-package-tree@~5.1.3", - "rawSpec": "~5.1.3", + "raw": "read-package-tree@~5.1.4", "scope": null, - "spec": ">=5.1.3 <5.2.0", + "escapedName": "read-package-tree", + "name": "read-package-tree", + "rawSpec": "~5.1.4", + "spec": ">=5.1.4 <5.2.0", "type": "range" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.4.tgz", - "_shasum": "bb6e465f913d4259a9534c87b1d5c508fe8eb078", + "_resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.5.tgz", + "_shasum": "ace7e6381c7684f970aaa98fc7c5d2b666addab6", "_shrinkwrap": null, - "_spec": "read-package-tree@~5.1.3", + "_spec": "read-package-tree@~5.1.4", "_where": "/Users/rebecca/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -69,21 +72,24 @@ "test": "test" }, "dist": { - "shasum": "bb6e465f913d4259a9534c87b1d5c508fe8eb078", - "tarball": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.4.tgz" + "shasum": "ace7e6381c7684f970aaa98fc7c5d2b666addab6", + "tarball": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.5.tgz" }, - "gitHead": "eb24d2508da745233af93769596ff1d963f801be", + "files": [ + "rpt.js" + ], + "gitHead": "5fcf957b01d3ce5ad3ffde51a5fd6d8178e23354", "homepage": "https://github.com/npm/read-package-tree", "license": "ISC", "main": "rpt.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" } ], "name": "read-package-tree", @@ -96,5 +102,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "5.1.4" + "version": "5.1.5" } diff --git a/node_modules/read-package-tree/rpt.js b/node_modules/read-package-tree/rpt.js index 522989763..8a6a89b08 100644 --- a/node_modules/read-package-tree/rpt.js +++ b/node_modules/read-package-tree/rpt.js @@ -98,7 +98,10 @@ function loadNode (logical, physical, cache, cb) { var realpath function thenReadPackageJson (er, real) { - if (er) return cb(er) + if (er) { + var node = new Node(null, logical, physical, er, cache) + return cb(null, node) + } debug('realpath l=%j p=%j real=%j', dpath(logical), dpath(physical), dpath(real)) var pj = path.join(real, 'package.json') realpath = real diff --git a/node_modules/read-package-tree/test/basic.js b/node_modules/read-package-tree/test/basic.js deleted file mode 100644 index 0dcb53891..000000000 --- a/node_modules/read-package-tree/test/basic.js +++ /dev/null @@ -1,155 +0,0 @@ -var test = require('tap').test -var rpt = require('../rpt.js') -var path = require('path') -var fs = require('fs') -var archy = require('archy') -var fixtures = path.resolve(__dirname, 'fixtures') -var roots = [ 'root', 'other', 'selflink', 'noname' ] -var cwd = path.resolve(__dirname, '..') - -var symlinks = { - 'selflink/node_modules/@scope/z/node_modules/glob': - '../../../foo/node_modules/glob', - 'other/node_modules/glob': - '../../root/node_modules/@scope/x/node_modules/glob', - 'linkedroot': - 'root', - 'deep/root': - '../root', - 'deeproot': - 'deep' -} - -function cleanup () { - Object.keys(symlinks).forEach(function (s) { - var p = path.resolve(cwd, 'test/fixtures', s) - try { - fs.unlinkSync(p) - } catch (er) {} - }) -} - -test('setup symlinks', function (t) { - cleanup() - - Object.keys(symlinks).forEach(function (s) { - var p = path.resolve(cwd, 'test/fixtures', s) - fs.symlinkSync(symlinks [ s ], p, 'dir') - }) - - t.end() -}) - -roots.forEach(function (root) { - var dir = path.resolve(fixtures, root) - var expectedtxt = path.resolve(dir, 'archy.txt') - var expectedre = path.resolve(dir, 'archy.re') - - test(root, function (t) { - rpt(dir, function (er, d) { - if (er && er.code !== 'ENOENT') throw er - - var actual = archy(archyize(d)).trim() - // console . log ('----', dir) - console.log(actual) - // console . log (require ('util') . inspect (d, { - // depth: Infinity - // })) - try { - var expect = fs.readFileSync(expectedtxt, 'utf8').trim() - t.equal(actual, expect, root + ' tree') - } catch (e) { - var expect = new RegExp(fs.readFileSync(expectedre, 'utf8').trim()) - t.like(actual, expect, root + ' tree') - } - t.end() - }) - }) -}) - -test('linkedroot', function (t) { - var dir = path.resolve(fixtures, 'linkedroot') - var out = dir + '-archy.txt' - rpt(dir, function (er, d) { - if (er && er.code !== 'ENOENT') throw er - - var actual = archy(archyize(d)).trim() - console.log(actual) - var expect = fs.readFileSync(out, 'utf8').trim() - t.equal(actual, expect, 'linkedroot tree') - t.end() - }) -}) - -test('deeproot', function (t) { - var dir = path.resolve(fixtures, 'deeproot/root') - var out = path.resolve(fixtures, 'deep') + '-archy.txt' - rpt(dir, function (er, d) { - if (er && er.code !== 'ENOENT') throw er - - var actual = archy(archyize(d)).trim() - console.log(actual) - var expect = fs.readFileSync(out, 'utf8').trim() - t.equal(actual, expect, 'deeproot tree') - t.end() - }) -}) - -test('broken json', function (t) { - rpt(path.resolve(fixtures, 'bad'), function (er, d) { - t.ok(d.error, 'Got an error object') - t.equal(d.error && d.error.code, 'EJSONPARSE') - t.ok(d, 'Got a tree') - t.end() - }) -}) - -test('missing json does not obscure deeper errors', function (t) { - rpt(path.resolve(fixtures, 'empty'), function (er, d) { - var error = d.error - t.ok(error, 'Error reading json of top level') - t.equal(error && error.code, 'ENOENT') - var childError = d.children.length===1 && d.children[0].error - t.ok(childError, 'Error parsing JSON of child node') - t.equal(childError && childError.code, 'EJSONPARSE') - t.end() - }) -}) -test('missing folder', function (t) { - rpt(path.resolve(fixtures, 'does-not-exist'), function (er, d) { - t.ok(er, 'Got an error object') - t.equal(er && er.code, 'ENOENT') - t.ok(!d, 'No tree on top level error') - t.end() - }) -}) - - -function archyize (d, seen) { - seen = seen || {} - var path = d.path - if (d.target) { - path = d.target.path - } - - var label = d.package._id ? d.package._id + ' ' : - d.package.name ? d.package.name + (d.package.version ? '@' + d.package.version : '') + ' ' : - '' - label += path.substr(cwd.length + 1) - - if (d . target) { - return { label: label + ' (symlink)', nodes: [] } - } - - return { - label: label, - nodes: d.children.map(function (kid) { - return archyize(kid, seen) - }) - } -} - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/node_modules/read-package-tree/test/fixtures/bad/package.json b/node_modules/read-package-tree/test/fixtures/bad/package.json deleted file mode 100644 index 21d815ec3..000000000 --- a/node_modules/read-package-tree/test/fixtures/bad/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "NOPE" diff --git a/node_modules/read-package-tree/test/fixtures/deep-archy.txt b/node_modules/read-package-tree/test/fixtures/deep-archy.txt deleted file mode 100644 index 630eab1a4..000000000 --- a/node_modules/read-package-tree/test/fixtures/deep-archy.txt +++ /dev/null @@ -1,11 +0,0 @@ -root@1.2.3 test/fixtures/deeproot/root -├─┬ @scope/x@1.2.3 test/fixtures/deeproot/root/node_modules/@scope/x -│ └─┬ glob@4.0.5 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob -│ ├── graceful-fs@3.0.2 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs -│ ├── inherits@2.0.1 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/inherits -│ ├─┬ minimatch@1.0.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch -│ │ ├── lru-cache@2.5.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache -│ │ └── sigmund@1.0.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund -│ └── once@1.3.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/once -├── @scope/y@1.2.3 test/fixtures/deeproot/root/node_modules/@scope/y -└── foo@1.2.3 test/fixtures/deeproot/root/node_modules/foo
\ No newline at end of file diff --git a/node_modules/read-package-tree/test/fixtures/deep/.keep b/node_modules/read-package-tree/test/fixtures/deep/.keep deleted file mode 100644 index e69de29bb..000000000 --- a/node_modules/read-package-tree/test/fixtures/deep/.keep +++ /dev/null diff --git a/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json b/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json deleted file mode 100644 index 98232c64f..000000000 --- a/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt b/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt deleted file mode 100644 index e34a46031..000000000 --- a/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt +++ /dev/null @@ -1,11 +0,0 @@ -root@1.2.3 test/fixtures/linkedroot -├─┬ @scope/x@1.2.3 test/fixtures/linkedroot/node_modules/@scope/x -│ └─┬ glob@4.0.5 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob -│ ├── graceful-fs@3.0.2 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs -│ ├── inherits@2.0.1 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/inherits -│ ├─┬ minimatch@1.0.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch -│ │ ├── lru-cache@2.5.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache -│ │ └── sigmund@1.0.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund -│ └── once@1.3.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/once -├── @scope/y@1.2.3 test/fixtures/linkedroot/node_modules/@scope/y -└── foo@1.2.3 test/fixtures/linkedroot/node_modules/foo
\ No newline at end of file diff --git a/node_modules/read-package-tree/test/fixtures/noname/archy.txt b/node_modules/read-package-tree/test/fixtures/noname/archy.txt deleted file mode 100644 index 03d78dfc6..000000000 --- a/node_modules/read-package-tree/test/fixtures/noname/archy.txt +++ /dev/null @@ -1,2 +0,0 @@ -test/fixtures/noname -└── test/fixtures/noname/node_modules/foo diff --git a/node_modules/read-package-tree/test/fixtures/noname/node_modules/foo/keep-alive b/node_modules/read-package-tree/test/fixtures/noname/node_modules/foo/keep-alive deleted file mode 100644 index e69de29bb..000000000 --- a/node_modules/read-package-tree/test/fixtures/noname/node_modules/foo/keep-alive +++ /dev/null diff --git a/node_modules/read-package-tree/test/fixtures/other/archy.txt b/node_modules/read-package-tree/test/fixtures/other/archy.txt deleted file mode 100644 index 23666226c..000000000 --- a/node_modules/read-package-tree/test/fixtures/other/archy.txt +++ /dev/null @@ -1,2 +0,0 @@ -test/fixtures/other -└── glob@4.0.5 test/fixtures/other/node_modules/glob (symlink)
\ No newline at end of file diff --git a/node_modules/read-package-tree/test/fixtures/other/node_modules/.bin b/node_modules/read-package-tree/test/fixtures/other/node_modules/.bin deleted file mode 100644 index e69de29bb..000000000 --- a/node_modules/read-package-tree/test/fixtures/other/node_modules/.bin +++ /dev/null diff --git a/node_modules/read-package-tree/test/fixtures/root/archy.txt b/node_modules/read-package-tree/test/fixtures/root/archy.txt deleted file mode 100644 index 1aacd3f0b..000000000 --- a/node_modules/read-package-tree/test/fixtures/root/archy.txt +++ /dev/null @@ -1,11 +0,0 @@ -root@1.2.3 test/fixtures/root -├─┬ @scope/x@1.2.3 test/fixtures/root/node_modules/@scope/x -│ └─┬ glob@4.0.5 test/fixtures/root/node_modules/@scope/x/node_modules/glob -│ ├── graceful-fs@3.0.2 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs -│ ├── inherits@2.0.1 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/inherits -│ ├─┬ minimatch@1.0.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch -│ │ ├── lru-cache@2.5.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache -│ │ └── sigmund@1.0.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund -│ └── once@1.3.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/once -├── @scope/y@1.2.3 test/fixtures/root/node_modules/@scope/y -└── foo@1.2.3 test/fixtures/root/node_modules/foo
\ No newline at end of file diff --git a/node_modules/read-package-tree/test/fixtures/root/package.json b/node_modules/read-package-tree/test/fixtures/root/package.json deleted file mode 100644 index 010347cee..000000000 --- a/node_modules/read-package-tree/test/fixtures/root/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{"name":"root", - "version":"1.2.3"}
\ No newline at end of file diff --git a/node_modules/read-package-tree/test/fixtures/selflink/archy.re b/node_modules/read-package-tree/test/fixtures/selflink/archy.re deleted file mode 100644 index 22e18109b..000000000 --- a/node_modules/read-package-tree/test/fixtures/selflink/archy.re +++ /dev/null @@ -1,13 +0,0 @@ -selflink@1[.]2[.]3 test/fixtures/selflink -├── @scope/y@1[.]2[.]3 test/fixtures/selflink/node_modules/@scope/y -├─┬ @scope/z@1[.]2[.]3 test/fixtures/selflink/node_modules/@scope/z -│ └── glob@4[.]0[.]5 test/fixtures/selflink/node_modules/foo/node_modules/glob [(]symlink[)] -└─┬ foo@1[.]2[.]3 test/fixtures/selflink/node_modules/foo - ├─┬ glob@4[.]0[.]5 test/fixtures/selflink/node_modules/foo/node_modules/glob - │ ├── graceful-fs@3[.]0[.]2 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/graceful-fs - │ ├── inherits@2[.]0[.]1 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/inherits - │ ├─┬ minimatch@1[.]0[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch - │ │ ├── lru-cache@2[.]5[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch/node_modules/lru-cache - │ │ └── sigmund@1[.]0[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch/node_modules/sigmund - │ └── once@1[.]3[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/once - └── selflink@1[.]2[.]3 test/fixtures/selflink [(]symlink[)] diff --git a/node_modules/read-package-tree/test/fixtures/selflink/package.json b/node_modules/read-package-tree/test/fixtures/selflink/package.json deleted file mode 100644 index 5bbf35e55..000000000 --- a/node_modules/read-package-tree/test/fixtures/selflink/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{"name":"selflink", - "version":"1.2.3"} diff --git a/node_modules/read-package-tree/test/symlinked-node-modules.js b/node_modules/read-package-tree/test/symlinked-node-modules.js deleted file mode 100644 index 31149240b..000000000 --- a/node_modules/read-package-tree/test/symlinked-node-modules.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var rpt = require('../rpt.js') -var Tacks = require('tacks') -var File = Tacks.File -var Symlink = Tacks.Symlink -var Dir = Tacks.Dir - -var workdir = path.join(__dirname, path.basename(__filename, '.js')) -var fixture = new Tacks(Dir({ - bar: Dir({ - 'package.json': File({ - name: 'bar', - version: '1.0.0' - }) - }), - 'linked-node-modules': Dir({ - bar: Symlink('../bar'), - foo: Dir({ - 'package.json': File({ - name: 'foo', - version: '1.0.0' - }) - }) - }), - example: Dir({ - node_modules: Symlink('../linked-node-modules/'), - 'package.json': File({ - name: 'example', - version: '1.0.0', - }) - }) -})) - -function setup () { - cleanup() - fixture.create(workdir) -} - -function cleanup () { - fixture.remove(workdir) -} - -test('setup', function (t) { - setup() - t.done() -}) -test('symlinked-node-modules', function (t) { - rpt(path.join(workdir, 'example'), function (err, tree) { - t.ifError(err) - t.is(tree.children.length, 2) - var childrenShouldBe = { - 'foo': {isLink: false}, - 'bar': {isLink: true} - } - tree.children.forEach(function (child) { - var name = child.package.name - t.is(child.isLink, childrenShouldBe[name].isLink, - 'is' + (childrenShouldBe[name].isLink ? '' : 'Not') + 'Link ' + - path.relative(workdir, child.path) + " + " + - path.relative(workdir, child.realpath)) - }) - t.done() - }) -}) -test('cleanup', function (t) { - cleanup() - t.done() -})
\ No newline at end of file |