diff options
author | Rebecca Turner <me@re-becca.org> | 2015-09-24 03:16:26 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-09-25 01:53:09 +0300 |
commit | a5448db9e856bbb89818cd3c960b043ebc66e048 (patch) | |
tree | 6db9dc44ba68f699a97917d71385684d6764eec8 /node_modules | |
parent | b595d724819f4ada52699c6f52ef3b8fba804abd (diff) |
read-package-tree@5.1.2
PR-URL: https://github.com/npm/npm/pull/9744
Diffstat (limited to 'node_modules')
8 files changed, 52 insertions, 36 deletions
diff --git a/node_modules/read-package-tree/.travis.yml b/node_modules/read-package-tree/.travis.yml new file mode 100644 index 000000000..e1bcee1ac --- /dev/null +++ b/node_modules/read-package-tree/.travis.yml @@ -0,0 +1,7 @@ +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 79a635628..4f70ab170 100644 --- a/node_modules/read-package-tree/package.json +++ b/node_modules/read-package-tree/package.json @@ -1,35 +1,35 @@ { "_args": [ [ - "read-package-tree@~5.1.0", + "read-package-tree@~5.1.1", "/Users/rebecca/code/npm" ] ], - "_from": "read-package-tree@>=5.1.0 <5.2.0", - "_id": "read-package-tree@5.1.0", + "_from": "read-package-tree@>=5.1.1 <5.2.0", + "_id": "read-package-tree@5.1.2", "_inCache": true, "_location": "/read-package-tree", - "_nodeVersion": "0.10.38", + "_nodeVersion": "0.12.7", "_npmUser": { "email": "me@re-becca.org", "name": "iarna" }, - "_npmVersion": "3.1.2", + "_npmVersion": "2.13.3", "_phantomChildren": {}, "_requested": { "name": "read-package-tree", - "raw": "read-package-tree@~5.1.0", - "rawSpec": "~5.1.0", + "raw": "read-package-tree@~5.1.1", + "rawSpec": "~5.1.1", "scope": null, - "spec": ">=5.1.0 <5.2.0", + "spec": ">=5.1.1 <5.2.0", "type": "range" }, "_requiredBy": [ "/" ], - "_shasum": "63cf2699d5cf8fb227703322e10a700f1208fc13", + "_shasum": "e3a488792f40cf470819f01a610e719d64f09094", "_shrinkwrap": null, - "_spec": "read-package-tree@~5.1.0", + "_spec": "read-package-tree@~5.1.1", "_where": "/Users/rebecca/code/npm", "author": { "email": "i@izs.me", @@ -55,11 +55,12 @@ "test": "test" }, "dist": { - "shasum": "63cf2699d5cf8fb227703322e10a700f1208fc13", - "tarball": "http://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.0.tgz" + "shasum": "e3a488792f40cf470819f01a610e719d64f09094", + "tarball": "http://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.2.tgz" }, - "gitHead": "9c8baac5c966f4976cfc4de6caafe58299d7a51e", + "gitHead": "2ed40c4654804f2a5ddb7b0b2c509080731eea6b", "homepage": "https://github.com/npm/read-package-tree", + "installable": true, "license": "ISC", "main": "rpt.js", "maintainers": [ @@ -81,5 +82,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "5.1.0" + "version": "5.1.2" } diff --git a/node_modules/read-package-tree/rpt.js b/node_modules/read-package-tree/rpt.js index 43da67c91..acd91bd8c 100644 --- a/node_modules/read-package-tree/rpt.js +++ b/node_modules/read-package-tree/rpt.js @@ -33,7 +33,6 @@ function Node (pkg, logical, physical, er, cache) { this.id = ID++ this.package = pkg || {} - if (!this.package.name) this.package.name = path.basename(logical) this.path = logical this.realpath = physical this.parent = null @@ -63,7 +62,6 @@ function Link (pkg, logical, physical, realpath, er, cache) { this.path = logical this.realpath = realpath this.package = pkg || {} - if (!this.package.name) this.package.name = path.basename(logical) this.parent = null this.target = new Node(this.package, logical, realpath, er, cache) this.isLink = true @@ -134,8 +132,8 @@ function loadChildren (node, cache, filterWith, cb) { function sortChildren (node) { node.children = node.children.sort(function (a, b) { - a = a.package.name.toLowerCase() - b = b.package.name.toLowerCase() + a = a.package.name ? a.package.name.toLowerCase() : a.path + b = b.package.name ? b.package.name.toLowerCase() : b.path return a > b ? 1 : -1 }) } diff --git a/node_modules/read-package-tree/test/basic.js b/node_modules/read-package-tree/test/basic.js index 0f9a33621..0dcb53891 100644 --- a/node_modules/read-package-tree/test/basic.js +++ b/node_modules/read-package-tree/test/basic.js @@ -4,7 +4,7 @@ var path = require('path') var fs = require('fs') var archy = require('archy') var fixtures = path.resolve(__dirname, 'fixtures') -var roots = [ 'root', 'other', 'selflink' ] +var roots = [ 'root', 'other', 'selflink', 'noname' ] var cwd = path.resolve(__dirname, '..') var symlinks = { @@ -42,7 +42,8 @@ test('setup symlinks', function (t) { roots.forEach(function (root) { var dir = path.resolve(fixtures, root) - var out = path.resolve(dir, 'archy.txt') + var expectedtxt = path.resolve(dir, 'archy.txt') + var expectedre = path.resolve(dir, 'archy.re') test(root, function (t) { rpt(dir, function (er, d) { @@ -54,8 +55,13 @@ roots.forEach(function (root) { // console . log (require ('util') . inspect (d, { // depth: Infinity // })) - var expect = fs.readFileSync(out, 'utf8').trim() - t.equal(actual, expect, root + ' tree') + 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() }) }) @@ -126,7 +132,9 @@ function archyize (d, seen) { path = d.target.path } - var label = d.package._id ? d.package._id + ' ' : '' + 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) { diff --git a/node_modules/read-package-tree/test/fixtures/noname/archy.txt b/node_modules/read-package-tree/test/fixtures/noname/archy.txt new file mode 100644 index 000000000..03d78dfc6 --- /dev/null +++ b/node_modules/read-package-tree/test/fixtures/noname/archy.txt @@ -0,0 +1,2 @@ +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 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/node_modules/read-package-tree/test/fixtures/noname/node_modules/foo/keep-alive diff --git a/node_modules/read-package-tree/test/fixtures/selflink/archy.re b/node_modules/read-package-tree/test/fixtures/selflink/archy.re new file mode 100644 index 000000000..22e18109b --- /dev/null +++ b/node_modules/read-package-tree/test/fixtures/selflink/archy.re @@ -0,0 +1,13 @@ +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/archy.txt b/node_modules/read-package-tree/test/fixtures/selflink/archy.txt deleted file mode 100644 index 307618ce1..000000000 --- a/node_modules/read-package-tree/test/fixtures/selflink/archy.txt +++ /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/node_modules/glob/node_modules/graceful-fs - │ ├── inherits@2.0.1 test/fixtures/selflink/node_modules/foo/node_modules/glob/node_modules/inherits - │ ├─┬ minimatch@1.0.0 test/fixtures/selflink/node_modules/foo/node_modules/glob/node_modules/minimatch - │ │ ├── lru-cache@2.5.0 test/fixtures/selflink/node_modules/foo/node_modules/glob/node_modules/minimatch/node_modules/lru-cache - │ │ └── sigmund@1.0.0 test/fixtures/selflink/node_modules/foo/node_modules/glob/node_modules/minimatch/node_modules/sigmund - │ └── once@1.3.0 test/fixtures/selflink/node_modules/foo/node_modules/glob/node_modules/once - └── selflink@1.2.3 test/fixtures/selflink (symlink) |