@@ -1,5 +1,5 @@
{
"version": "1.3.11",
"version": "1.3.12",
"name": "npm",
"publishConfig": {
"proprietary-attribs": false
@@ -47,16 +47,16 @@
"tar": "~0.1.18",
"fstream": "~0.1.23",
"block-stream": "0.0.7",
"mkdirp": "~0.3.3",
"mkdirp": "~0.3.5",
"read": "~1.0.4",
"lru-cache": "~2.3.1",
"node-gyp": "~0.10.10",
"fstream-npm": "~0.1.3",
"fstream-npm": "~0.1.6",
"uid-number": "0",
"archy": "0",
"chownr": "0",
"npmlog": "0.0.4",
"ansi": "~0.1.2",
"npmlog": "0.0.6",
"ansi": "~0.2.1",
"npm-registry-client": "~0.2.28",
"read-package-json": "~1.1.3",
"read-installed": "~0.2.2",
@@ -65,16 +65,17 @@
"osenv": "0",
"lockfile": "~0.4.0",
"retry": "~0.6.0",
"once": "~1.1.1",
"npmconf": "~0.1.2",
"once": "~1.3.0",
"npmconf": "~0.1.5",
"opener": "~1.3.0",
"chmodr": "~0.1.0",
"cmd-shim": "~1.0.1",
"cmd-shim": "~1.1.1",
"sha": "~1.2.1",
"editor": "0.0.4",
"editor": "0.0.5",
"child-process-close": "~0.1.1",
"npm-user-validate": "0.0.3",
"github-url-from-git": "1.1.1"
"github-url-from-git": "1.1.1",
"github-url-from-username-repo": "0.0.2"
},
"bundleDependencies": [
"semver",
@@ -118,12 +119,13 @@
"child-process-close",
"editor",
"npm-user-validate",
"github-url-from-git"
"github-url-from-git",
"github-url-from-username-repo"
],
"devDependencies": {
"ronn": "~0.3.6",
"tap": "~0.4.0",
"npm-registry-mock": "~0.3.0"
"npm-registry-mock": "~0.5.3"
},
"engines": {
"node": ">=0.6",
@@ -132,7 +134,7 @@
"scripts": {
"test": "node ./test/run.js && tap test/tap/*.js",
"tap": "tap test/tap/*.js",
"prepublish": "node bin/npm-cli.js prune ; rm -rf test/*/*/node_modules ; make -j4 doc",
"prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j4 doc",
"dumpconf": "env | grep npm | sort | uniq",
"echo": "node bin/npm-cli.js"
},
@@ -1,8 +1,8 @@
{
"npm-test-peer-deps-file": {
"version": "1.2.3",
"from": "https://raw.github.com/gist/3971128/3f6aa37b4fa1186c2f47da9b77dcc4ec496e3483/index.js",
"resolved": "https://raw.github.com/gist/3971128/3f6aa37b4fa1186c2f47da9b77dcc4ec496e3483/index.js",
"from": "https://gist.github.com/domenic/3971128/raw/7472b26a013ceb174c2d726314e9fa97465729bb/index.js",
"resolved": "https://gist.github.com/domenic/3971128/raw/7472b26a013ceb174c2d726314e9fa97465729bb/index.js",
"dependencies": {
"opener": {
"version": "1.3.0",
@@ -3,7 +3,7 @@
"name": "npm-test-peer-deps",
"version": "0.0.0",
"dependencies": {
"npm-test-peer-deps-file": "https://raw.github.com/gist/3971128/3f6aa37b4fa1186c2f47da9b77dcc4ec496e3483/index.js"
"npm-test-peer-deps-file": "https://gist.github.com/domenic/3971128/raw/7472b26a013ceb174c2d726314e9fa97465729bb/index.js"
},
"scripts": {
"test": "node test.js"
@@ -3,7 +3,7 @@
"name": "npm-test-shrinkwrap",
"version": "0.0.0",
"dependencies": {
"npm-test-single-file": "https://raw.github.com/gist/1837112/index.js",
"npm-test-single-file": "https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js",
"glob": "git://github.com/isaacs/node-glob.git#npm-test",
"minimatch": "~0.1.0"
},

This file was deleted.

This file was deleted.

@@ -0,0 +1,12 @@
var test = require('tap').test
var spawn = require('child_process').spawn
var node = process.execPath
var npm = require.resolve('../../')
var args = [ npm, 'ls', 'ceci n’est pas une package' ]
test('ls exits non-zero when nothing found', function (t) {
var child = spawn(node, args)
child.on('exit', function (code) {
t.notEqual(code, 0)
t.end()
})
})
@@ -0,0 +1,23 @@
var test = require("tap").test
var npm = require("../../")

var mr = require("npm-registry-mock")

// config
var port = 1331
var address = "http://localhost:" + port
var pkg = __dirname + '/outdated-include-devdependencies'


test("includes devDependencies in outdated", function (t) {
process.chdir(pkg)
mr(port, function (s) {
npm.load({registry: address}, function () {
npm.outdated(function (er, d) {
t.equal("1.5.1", d[0][3])
s.close()
t.end()
})
})
})
})
@@ -0,0 +1,8 @@
{
"author": "Rocko Artischocko",
"name": "ignore-shrinkwrap",
"version": "0.0.0",
"devDependencies": {
"underscore": ">=1.3.1"
}
}
@@ -0,0 +1,38 @@
var test = require("tap").test
var npm = require("../../")
var mkdirp = require("mkdirp")
var rimraf = require("rimraf")


var mr = require("npm-registry-mock")

// config
var port = 1331
var address = "http://localhost:" + port
var pkg = __dirname + "/outdated-new-versions"
mkdirp.sync(pkg + "/cache")


test("dicovers new versions in outdated", function (t) {
process.chdir(pkg)
t.plan(2)
mr(port, function (s) {
npm.load({cache: pkg + "/cache", registry: address}, function () {
npm.outdated(function (er, d) {
for (var i = 0; i < d.length; i++) {
if (d[i][1] === "underscore")
t.equal("1.5.1", d[i][4])
if (d[i][1] === "request")
t.equal("2.27.0", d[i][4])
}
s.close()
t.end()
})
})
})
})

test("cleanup", function (t) {
rimraf.sync(pkg + "/cache")
t.end()
})
@@ -0,0 +1,11 @@
{
"name": "new-versions-with-outdated",
"author": "Rockbert",
"version": "0.0.0",
"dependencies": {
"underscore": "~1.3.1"
},
"devDependencies": {
"request": "~0.9.0"
}
}
@@ -0,0 +1,90 @@
// verify that prepublish runs on pack and publish
var test = require('tap').test
var npm = require('../../')
var fs = require('fs')
var pkg = __dirname + '/prepublish_package'
var tmp = pkg + '/tmp'
var cache = pkg + '/cache'
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var path = require('path')
var os = require('os')

test('setup', function (t) {
var n = 0
mkdirp(pkg, then())
mkdirp(cache, then())
mkdirp(tmp, then())
function then (er) {
n ++
return function (er) {
if (er)
throw er
if (--n === 0)
next()
}
}

function next () {
fs.writeFile(pkg + '/package.json', JSON.stringify({
name: 'npm-test-prepublish',
version: '1.2.5',
scripts: { prepublish: 'echo ok' }
}), 'ascii', function (er) {
if (er)
throw er
t.pass('setup done')
t.end()
})
}
})

test('test', function (t) {
var spawn = require('child_process').spawn
var node = process.execPath
var npm = path.resolve(__dirname, '../../cli.js')
var env = {
npm_config_cache: cache,
npm_config_tmp: tmp,
npm_config_prefix: pkg,
npm_config_global: 'false'
}
for (var i in process.env) {
if (!/^npm_config_/.test(i))
env[i] = process.env[i]
}
var child = spawn(node, [npm, 'pack'], {
cwd: pkg,
env: env
})
child.stdout.setEncoding('utf8')
child.stderr.on('data', function(chunk) {
throw new Error('got stderr data: ' + JSON.stringify('' + chunk))
})
child.stdout.on('data', ondata)
child.on('close', onend)
var c = ''
function ondata (chunk) {
c += chunk
}
function onend () {
c = c.trim()
t.equal( c
, '> npm-test-prepublish@1.2.5 prepublish .' + os.EOL
+ '> echo ok' + os.EOL
+ os.EOL
+ 'ok' + os.EOL
+ 'npm-test-prepublish-1.2.5.tgz')
t.end()
}
})

test('cleanup', function (t) {
rimraf(pkg, function(er) {
if (er)
throw er
t.pass('cleaned up')
t.end()
})
})

@@ -1,5 +1,6 @@
var test = require('tap').test
var fs = require('fs')
var osenv = require('osenv')
var pkg = process.env.npm_config_tmp || '/tmp'
pkg += '/npm-test-publish-config'

@@ -41,7 +42,8 @@ test(function (t) {
npm_config_cache_lock_wait: 1000,
HOME: process.env.HOME,
Path: process.env.PATH,
PATH: process.env.PATH
PATH: process.env.PATH,
USERPROFILE: osenv.home()
}
})
})
@@ -0,0 +1,24 @@
var test = require("tap").test
, npm = require("../../")

test("returns a list of removed items", function (t) {
t.plan(1)

setup(function () {
npm.install(".", function (err) {
if (err) return t.fail(err)
npm.uninstall("once", "ini", "lala", function (err, d) {
if (err) return t.fail(err)
t.same(d.sort(), ["once", "ini"].sort())
t.end()
})
})
})
})

function setup (cb) {
process.chdir(__dirname + "/uninstall-package")
npm.load(function () {
cb()
})
}
@@ -0,0 +1,9 @@
{
"name": "beep",
"version": "0.0.0",
"main": "index.js",
"dependencies": {
"once": "*",
"ini": "*"
}
}