Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
{
"version": "1.3.17",
"version": "1.3.21",
"name": "npm",
"publishConfig": {
"proprietary-attribs": false
@@ -39,10 +39,10 @@
"slide": "~1.1.5",
"abbrev": "~1.0.4",
"graceful-fs": "~2.0.0",
"minimatch": "~0.2.12",
"minimatch": "~0.2.14",
"nopt": "~2.1.2",
"rimraf": "~2.2.5",
"request": "~2.29.0",
"request": "~2.30.0",
"which": "1",
"tar": "~0.1.19",
"fstream": "~0.1.25",
@@ -57,7 +57,7 @@
"chownr": "0",
"npmlog": "0.0.6",
"ansi": "~0.2.1",
"npm-registry-client": "~0.2.30",
"npm-registry-client": "~0.3.2",
"read-package-json": "~1.1.4",
"read-installed": "~0.2.2",
"glob": "~3.2.6",
@@ -78,7 +78,8 @@
"github-url-from-username-repo": "0.0.2",
"text-table": "~0.2.0",
"ansicolors": "~0.3.2",
"ansistyles": "~0.1.3"
"ansistyles": "~0.1.3",
"path-is-inside": "~1.0.0"
},
"bundleDependencies": [
"semver",
@@ -127,7 +128,8 @@
"normalize-package-data",
"text-table",
"ansicolors",
"ansistyles"
"ansistyles",
"path-is-inside"
],
"devDependencies": {
"ronn": "~0.3.6",
@@ -141,7 +143,7 @@
"scripts": {
"test": "node ./test/run.js && tap test/tap/*.js",
"tap": "tap test/tap/*.js",
"prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j4 doc",
"prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j32 doc",
"dumpconf": "env | grep npm | sort | uniq",
"echo": "node bin/npm-cli.js"
},
@@ -1,5 +1,5 @@
{ "name":"npm-test-blerg"
, "version" : "0.0.1"
, "version" : "0.0.2"
, "scripts" : { "test" : "node test.js" }
, "publishConfig": {"tag": "foo"}
}
@@ -0,0 +1,122 @@
// this is a weird meta test. It verifies that all the instances of
// `npm.config.get(...)` are:
// a) Simple strings, and not variables
// b) Documented
// c) Defined in the `npmconf` package.

var test = require("tap").test
var fs = require("fs")
var path = require("path")
var root = path.resolve(__dirname, "..", "..")
var lib = path.resolve(root, "lib")
var nm = path.resolve(root, "node_modules")
var doc = path.resolve(root, "doc/misc/npm-config.md")
var FILES = []
var CONFS = {}
var DOC = {}

var exceptions = [
path.resolve(lib, "config.js"),
path.resolve(lib, "utils", "lifecycle.js")
]

test("get files", function (t) {
walk(nm)
walk(lib)
t.pass("got files")
t.end()

function walk(lib) {
var files = fs.readdirSync(lib).map(function (f) {
return path.resolve(lib, f)
})
files.forEach(function (f) {
if (fs.statSync(f).isDirectory())
walk(f)
else if (f.match(/\.js$/))
FILES.push(f)
})
}
})

test("get lines", function (t) {
FILES.forEach(function (f) {
console.error(f)
var lines = fs.readFileSync(f, 'utf8').split('\n')
lines.forEach(function (l, i) {
var matches = l.split(/conf(?:ig)?\.get\(/g)
matches.shift()
matches.forEach(function (m) {
m = m.split(')').shift()
var literal = m.match(/^['"].+['"]$/)
if (literal) {
m = m.slice(1, -1)
if (!m.match(/^\_/) && m !== 'argv')
CONFS[m] = {
file: f,
line: i
}
} else if (exceptions.indexOf(f) === -1) {
t.fail("non-string-literal config used in " + f + ":" + i)
}
})
})
})
t.pass("got lines")
t.end()
})

test("get docs", function (t) {
var d = fs.readFileSync(doc, "utf8").split("\n")
// walk down until the "## Config Settings" section
for (var i = 0; i < d.length && d[i] !== "## Config Settings"; i++);
i++
// now gather up all the ^###\s lines until the next ^##\s
var doclines = []
for (; i < d.length && !d[i].match(/^## /); i++) {
if (d[i].match(/^### /))
DOC[ d[i].replace(/^### /, '').trim() ] = true
}
t.pass("read the docs")
console.error(DOC)
t.end()
})

test("check configs", function (t) {
var defs = require("npmconf/config-defs.js")
var types = Object.keys(defs.types)
var defaults = Object.keys(defs.defaults)

for (var c in CONFS) {
if (CONFS[c].file.indexOf(lib) === 0) {
t.ok(DOC[c], "should be documented " + c + " "
+ CONFS[c].file + ":" + CONFS[c].line)
t.ok(types.indexOf(c) !== -1, "should be defined in npmconf " + c)
t.ok(defaults.indexOf(c) !== -1, "should have default in npmconf " + c)
}
}

for (var c in DOC) {
if (c !== "versions" && c !== "version") {
t.ok(CONFS[c], "config in doc should be used somewhere " + c)
t.ok(types.indexOf(c) !== -1, "should be defined in npmconf " + c)
t.ok(defaults.indexOf(c) !== -1, "should have default in npmconf " + c)
}
}

types.forEach(function(c) {
if (!c.match(/^\_/) && c !== 'argv' && !c.match(/^versions?$/)) {
t.ok(DOC[c], 'defined type should be documented ' + c)
t.ok(CONFS[c], 'defined type should be used ' + c)
}
})

defaults.forEach(function(c) {
if (!c.match(/^\_/) && c !== 'argv' && !c.match(/^versions?$/)) {
t.ok(DOC[c], 'defaulted type should be documented ' + c)
t.ok(CONFS[c], 'defaulted type should be used ' + c)
}
})

t.end()
})
@@ -0,0 +1,71 @@
var test = require("tap").test
var npm = require.resolve("../../bin/npm-cli.js")

var spawn = require("child_process").spawn
var node = process.execPath

// ignore-scripts/package.json has scripts that always exit with non-zero error
// codes. The "install" script is omitted so that npm tries to run node-gyp,
// which should also fail.
var pkg = __dirname + "/ignore-scripts"

test("ignore-scripts: install using the option", function(t) {
createChild([npm, "install", "--ignore-scripts"]).on("close", function(code) {
t.equal(code, 0)
t.end()
})
})

test("ignore-scripts: install NOT using the option", function(t) {
createChild([npm, "install"]).on("close", function(code) {
t.notEqual(code, 0)
t.end()
})
})

var scripts = [
"prepublish", "publish", "postpublish",
"preinstall", "install", "postinstall",
"preuninstall", "uninstall", "postuninstall",
"preupdate", "update", "postupdate",
"pretest", "test", "posttest",
"prestop", "stop", "poststop",
"prestart", "start", "poststart",
"prerestart", "restart", "postrestart"
]

scripts.forEach(function(script) {
test("ignore-scripts: run-script"+script+" using the option", function(t) {
createChild([npm, "--ignore-scripts", "run-script", script])
.on("close", function(code) {
t.equal(code, 0)
t.end()
})
})
})

scripts.forEach(function(script) {
test("ignore-scripts: run-script "+script+" NOT using the option", function(t) {
createChild([npm, "run-script", script]).on("close", function(code) {
t.notEqual(code, 0)
t.end()
})
})
})

function createChild (args) {
var env = {
HOME: process.env.HOME,
Path: process.env.PATH,
PATH: process.env.PATH
}

if (process.platform === "win32")
env.npm_config_cache = "%APPDATA%\\npm-cache"

return spawn(node, args, {
cwd: pkg,
stdio: "inherit",
env: env
})
}
@@ -0,0 +1 @@
bad_binding_file
@@ -0,0 +1,30 @@
{
"author": "Milton the Aussie",
"name": "ignore-scripts",
"version": "0.0.0",
"scripts": {
"prepublish": "exit 123",
"publish": "exit 123",
"postpublish": "exit 123",
"preinstall": "exit 123",
"postinstall": "exit 123",
"preuninstall": "exit 123",
"uninstall": "exit 123",
"postuninstall": "exit 123",
"preupdate": "exit 123",
"update": "exit 123",
"postupdate": "exit 123",
"pretest": "exit 123",
"test": "exit 123",
"posttest": "exit 123",
"prestop": "exit 123",
"stop": "exit 123",
"poststop": "exit 123",
"prestart": "exit 123",
"start": "exit 123",
"poststart": "exit 123",
"prerestart": "exit 123",
"restart": "exit 123",
"postrestart": "exit 123"
}
}
@@ -1,9 +1,10 @@
var common = require('../common-tap')
, path = require('path')
, test = require('tap').test
, rimraf = require('rimraf')
, npm = require('../../')
, mr = require('npm-registry-mock')
, pkg = __dirname + '/outdated-depth'
, pkg = path.resolve(__dirname, 'outdated-depth')

function cleanup () {
rimraf.sync(pkg + '/node_modules')
@@ -47,4 +48,4 @@ test('outdated depth zero', function (t) {
test("cleanup", function (t) {
cleanup()
t.end()
})
})
@@ -0,0 +1,72 @@
var test = require("tap").test
var rimraf = require("rimraf")

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

var spawn = require("child_process").spawn
var npm = require.resolve("../../bin/npm-cli.js")
var node = process.execPath
var pkg = "./url-dependencies"

var mockRoutes = {
"get": {
"/underscore/-/underscore-1.3.1.tgz": [200]
}
}

test("url-dependencies: download first time", function(t) {
rimraf.sync(__dirname + "/url-dependencies/node_modules")

performInstall(function(output){
if(!tarballWasFetched(output)){
t.fail("Tarball was not fetched")
}else{
t.pass("Tarball was fetched")
}
t.end()
})
})

test("url-dependencies: do not download subsequent times", function(t) {
rimraf.sync(__dirname + "/url-dependencies/node_modules")

performInstall(function(){
performInstall(function(output){
if(tarballWasFetched(output)){
t.fail("Tarball was fetched second time around")
}else{
t.pass("Tarball was not fetched")
}
t.end()
})
})
})

function tarballWasFetched(output){
return output.indexOf("http GET http://localhost:1337/underscore/-/underscore-1.3.1.tgz") > -1
}

function performInstall (cb) {
mr({port: 1337, mocks: mockRoutes}, function(s){
var output = ""
, child = spawn(node, [npm, "install"], {
cwd: pkg,
env: {
npm_config_registry: "http://localhost:1337",
npm_config_cache_lock_stale: 1000,
npm_config_cache_lock_wait: 1000,
HOME: process.env.HOME,
Path: process.env.PATH,
PATH: process.env.PATH
}
})

child.stderr.on("data", function(data){
output += data.toString()
})
child.on("close", function () {
s.close()
cb(output)
})
})
}
@@ -0,0 +1,8 @@
{
"author": "Steve Mason",
"name": "url-dependencies",
"version": "0.0.0",
"dependencies": {
"underscore": "http://localhost:1337/underscore/-/underscore-1.3.1.tgz"
}
}
@@ -31,7 +31,7 @@ test("npm version <semver> without git tag", function (t) {
return _cb(null, Boolean(~out.indexOf(tag)))
})
}

var child = spawn(git, ['init'])
child.stdout.pipe(process.stdout)
child.on('exit', function() {
@@ -53,6 +53,9 @@ test("npm version <semver> without git tag", function (t) {
})

test('cleanup', function(t) {
// windows fix for locked files
process.chdir(osenv.tmpdir())

rimraf.sync(pkg)
t.end()
})
@@ -67,4 +70,4 @@ function setup() {
description: "Test for git-tag-version flag"
}), 'utf8')
process.chdir(pkg)
}
}
@@ -0,0 +1,68 @@
date: Thu Dec 19 09:02:48 PST 2013
version: 0.10.24
category: release
title: Node v0.10.24 (Stable)
slug: node-v0-10-24-stable

2013.12.18, Version 0.10.24 (Stable)

* uv: Upgrade to v0.10.21

* npm: upgrade to 1.3.21

* v8: backport fix for CVE-2013-{6639|6640}

* build: unix install node and dep library headers (Timothy J Fontaine)

* cluster, v8: fix --logfile=%p.log (Ben Noordhuis)

* module: only cache package main (Wyatt Preul)


Source Code: http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz

Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.24/node-v0.10.24.pkg

Windows Installer: http://nodejs.org/dist/v0.10.24/node-v0.10.24-x86.msi

Windows x64 Installer: http://nodejs.org/dist/v0.10.24/x64/node-v0.10.24-x64.msi

Windows x64 Files: http://nodejs.org/dist/v0.10.24/x64/

Linux 32-bit Binary: http://nodejs.org/dist/v0.10.24/node-v0.10.24-linux-x86.tar.gz

Linux 64-bit Binary: http://nodejs.org/dist/v0.10.24/node-v0.10.24-linux-x64.tar.gz

Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.24/node-v0.10.24-sunos-x86.tar.gz

Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.24/node-v0.10.24-sunos-x64.tar.gz

Other release files: http://nodejs.org/dist/v0.10.24/

Website: http://nodejs.org/docs/v0.10.24/

Documentation: http://nodejs.org/docs/v0.10.24/api/

Shasums:
```
4a233e4e51ec24de3b2c3196b9128781665b4edc node-v0.10.24-darwin-x64.tar.gz
1b018a372d919462e8ebef29a0de4816a83e38ff node-v0.10.24-darwin-x86.tar.gz
423018f6a60b18d0dddf3007c325e0cc8cf55099 node-v0.10.24-linux-x64.tar.gz
fb99761ce4cef4a43743c1ed630b185545152264 node-v0.10.24-linux-x86.tar.gz
9719b2b636d8f5caf5495e967cbe167fd16eb160 node-v0.10.24-sunos-x64.tar.gz
84d7645d88dad9050f72c01d5f783cc018a8dc2b node-v0.10.24-sunos-x86.tar.gz
4b3cd142e691033308bfab237b6bf79a1a7f5c10 node-v0.10.24-x86.msi
74aba302d8b34e1fc93b3e0babc3f5d9bd8c09f3 node-v0.10.24.pkg
d162d01eb173cb5a0e7e46c9d706421c4c771039 node-v0.10.24.tar.gz
782c0b437f1d4205d7ba012e02157fb984d656b0 node.exe
c3bf16e3e2e268340a96fca869a1e3ce3ead46b5 node.exp
b81ceddb831981b200f04403718b2adcd24fd5ed node.lib
1c009c51c273512eb76ef3a1e36d5d1ccf1e4094 node.pdb
8c90873802c40ecadb304002401ba857ad728f9c pkgsrc/nodejs-ia32-0.10.24.tgz
94eda460e90dd59886ee2543bb55c8baea6daf1c pkgsrc/nodejs-x64-0.10.24.tgz
9b36fd16d8a6eb95c375ced0e1929b88b3dbb3e6 x64/node-v0.10.24-x64.msi
43c51bf9ff7c6aa421c4c89a4b14e0ab1cb0527a x64/node.exe
74d67c1cad72c0231fdc3498a0ca90c09e49abfb x64/node.exp
724463c1a1bd3ad386e1089f53c7fa0ca16c38b6 x64/node.lib
58a6bcec861c0a8d20e90db348d3a4fbd49e88cc x64/node.pdb
```
@@ -118,6 +118,14 @@ def npm_files(action):
else:
assert(0) # unhandled action type

def subdir_files(path, dest, action):
ret = {}
for dirpath, dirnames, filenames in os.walk(path):
files = [dirpath + '/' + f for f in filenames if f.endswith('.h')]
ret[dest + dirpath.replace(path, '')] = files
for subdir, files in ret.items():
action(files, subdir + '/')

def files(action):
action(['out/Release/node'], 'bin/node')

@@ -136,6 +144,34 @@ def files(action):

if 'true' == variables.get('node_install_npm'): npm_files(action)

action([
'config.gypi',
'src/node.h',
'src/node_buffer.h',
'src/node_internals.h',
'src/node_object_wrap.h',
'src/node_version.h',
], 'include/node/')

if 'false' == variables.get('node_shared_cares'):
subdir_files('deps/cares/include', 'include/node/', action)

if 'false' == variables.get('node_shared_libuv'):
subdir_files('deps/uv/include', 'include/node/', action)

if 'false' == variables.get('node_shared_openssl'):
action(['deps/openssl/config/opensslconf.h'], 'include/node/openssl/')
subdir_files('deps/openssl/include/openssl', 'include/node/openssl/', action)

if 'false' == variables.get('node_shared_v8'):
subdir_files('deps/v8/include', 'include/node/', action)

if 'false' == variables.get('node_shared_zlib'):
action([
'deps/zlib/zconf.h',
'deps/zlib/zlib.h',
], 'include/node/')

def run(args):
global node_prefix, install_path, target_defaults, variables