diff --git a/.gitmodules b/.gitmodules index b2e515e2853..cd1a43bd28d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,6 @@ [submodule "node_modules/abbrev"] path = node_modules/abbrev url = git://github.com/isaacs/abbrev-js.git -[submodule "node_modules/optparse"] - path = node_modules/optparse - url = git://github.com/isaacs/node-optparse.git +[submodule "node_modules/nopt"] + path = node_modules/nopt + url = git://github.com/isaacs/nopt.git diff --git a/bin/npm.js b/bin/npm.js index 71467a2b672..b508757346c 100755 --- a/bin/npm.js +++ b/bin/npm.js @@ -15,11 +15,11 @@ var fs = require("../lib/utils/graceful-fs") , configDefs = require("../lib/utils/config-defs") , shorthands = configDefs.shorthands , types = configDefs.types - , optparse = require("optparse") + , nopt = require("nopt") log.verbose(process.argv, "cli") -var conf = optparse(types, shorthands) +var conf = nopt(types, shorthands) npm.argv = conf.argv.remain if (npm.deref(npm.argv[0])) npm.command = npm.argv.shift() else conf.usage = true diff --git a/doc/config.md b/doc/config.md index d6c0a02a343..8b0d43872e2 100644 --- a/doc/config.md +++ b/doc/config.md @@ -130,6 +130,23 @@ then the user could change the behavior by doing: ## Config Settings +### bindist + +* Default: Unstable node versions, `null`, otherwise + `"--"` +* Type: String or `null` + +Experimental: on stable versions of node, binary distributions will be +created with this tag. If a user then installs that package, and their +`bindist` tag is found in the list of binary distributions, they will +get that prebuilt version. + +Pre-build node packages have their preinstall, install, and postinstall +scripts stripped (since they are run prior to publishing), and do not +have their `build` directories automatically ignored. + +It's yet to be seen if this is a good idea. + ### browser * Default: OS X: `"open"`, others: `"google-chrome"` diff --git a/lib/cache.js b/lib/cache.js index f3196b0ad01..0a1f9848187 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -102,6 +102,7 @@ function read (name, ver, cb) { if (data) deprCheck(data) return cb(er, data) } + if (npm.config.get("force") || process.platform === "cygwin") { log.verbose(true, "force found, skipping cache") return addNamed(name, ver, c) @@ -110,6 +111,7 @@ function read (name, ver, cb) { if (name+"@"+ver in cacheSeen) { return cb(null, cacheSeen[name+"@"+ver]) } + readJson(jsonFile, function (er, data) { if (er) return addNamed(name, ver, c) deprCheck(data) @@ -281,20 +283,38 @@ function addNameVersion (name, ver, cb) { registry.get(name, ver, function (er, data, json, response) { if (er) return cb(er) deprCheck(data) - if (!data.dist || !data.dist.tarball) return cb(new Error( - "No dist.tarball in package data")) + var dist = data.dist + + if (!dist) return cb(new Error("No dist in "+data._id+" package")) + + var bd = npm.config.get("bindist") + , b = dist.bin && bd && dist.bin[bd] + log.verbose([bd, dist], "bin dist") + if (b && b.tarball && b.shasum) { + log.info(data._id, "prebuilt") + log.verbose(b, "prebuilt "+data._id) + dist = b + } + + if (!dist.tarball) return cb(new Error( + "No dist.tarball in " + data._id + " package")) + if (response.statusCode !== 304 || npm.config.get("force") || process.platform === "cygwin") { return fetchit() } + // we got cached data, so let's see if we have a tarball. fs.stat(path.join(npm.cache, name, ver, "package.tgz"), function (er, s) { if (!er) return cb(null, data) else return fetchit() }) + function fetchit () { - return addRemoteTarball( data.dist.tarball.replace(/^https/,'http') - , data.dist.shasum, name+"-"+ver, cb) + return addRemoteTarball( dist.tarball.replace(/^https/,'http') + , dist.shasum + , name+"-"+ver + , cb ) } }) } @@ -438,8 +458,16 @@ function addTmpTarball (tgz, name, cb) { } function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) { + if (typeof cb !== "function") cb = gid, gid = null + if (typeof cb !== "function") cb = uid, uid = null + if (typeof cb !== "function") cb = fMode, fMode = null + if (typeof cb !== "function") cb = dMode, dMode = null + read(pkg, ver, function (er, data) { - if (er) return log.er(cb, "Could not read data for "+pkg+"@"+ver)(er) + if (er) { + log.error("Could not read data for "+pkg+"@"+ver) + return cb(er) + } tar.unpack( path.join(npm.cache, pkg, ver, "package.tgz") , unpackTarget , dMode, fMode diff --git a/lib/completion.js b/lib/completion.js index f56a9b15bbd..dbcdc55ff7c 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -7,7 +7,7 @@ var output = require("./utils/output") , configDefs = require("./utils/config-defs") , configTypes = configDefs.types , shorthands = configDefs.shorthands - , optparse = require("optparse") + , nopt = require("nopt") , configNames = Object.keys(configTypes).filter(function (e) { return e.charAt(0) !== "_" }) @@ -116,7 +116,7 @@ function completion (args, cb) { // don't have to worry about the last arg being implicitly // boolean'ed, since the last block will catch that. var parsed = opts.conf = - optparse(configTypes, shorthands, partialWords.slice(0, -1), 0) + nopt(configTypes, shorthands, partialWords.slice(0, -1), 0) // check if there's a command already. console.error(parsed) var cmd = parsed.argv.remain[1] diff --git a/lib/publish.js b/lib/publish.js index e590bbb0c7e..86aebd0a9ea 100644 --- a/lib/publish.js +++ b/lib/publish.js @@ -4,6 +4,11 @@ module.exports = publish var npm = require("../npm") , registry = require("./utils/npm-registry-client") , log = require("./utils/log") + , tar = require("./utils/tar") + , sha = require("./utils/sha") + , path = require("path") + , readJson = require("./utils/read-json") + , fs = require("fs") publish.usage = "npm publish " + "\nnpm publish " @@ -28,16 +33,84 @@ function publish (args, isRetry, cb) { if (data.private) return cb(new Error ("This package has been marked as private\n" +"Remove the 'private' field from the package.json to publish it.")) - registry.publish(data, function (er) { - if (er && er.errno === npm.EPUBLISHCONFLICT - && npm.config.get("force") && !isRetry) { - log.warn("Forced publish over "+data._id, "publish") - return npm.commands.unpublish([data._id], function (er) { - // ignore errors. Use the force. Reach out with your feelings. - publish(args, true, cb) - }) + + // pre-build + var bd = data.scripts + && ( data.scripts.preinstall + || data.scripts.install + || data.scripts.postinstall ) + && npm.config.get("bindist") + preBuild(data, bd, function (er, tb) { + if (er) return cb(er) + return regPublish(data, tb, isRetry, args, cb) + }) + }) +} + +function preBuild (data, bd, cb) { + if (!bd) return cb() + // unpack to cache/n/v/build + // build there + // pack to cache/package-.tgz + var cf = path.resolve(npm.cache, data.name, data.version) + var pb = path.resolve(cf, "build") + , tb = path.resolve(cf, "package-"+bd+".tgz") + + log.verbose("about to cache unpack") + npm.commands.cache.unpack(data.name, data.version, pb, function (er) { + log.verbose("back from cache unpack") + if (er) return cb(er) + npm.commands.build([pb], function (er) { + log.info(data._id, "prebuild done") + // build failure just means that we can't prebuild + if (er) { + log.warn(er.message, "prebuild failed "+bd) + return cb() } - cb(er) + // now strip the preinstall/install scripts + // they've already been run. + var pbj = path.resolve(pb, "package.json") + readJson(pbj, function (er, pbo) { + if (er) return cb(er) + if (pbo.scripts) { + delete pbo.scripts.preinstall + delete pbo.scripts.install + delete pbo.scripts.postinstall + } + pbo.prebuilt = bd + pbo.files = pbo.files || [] + pbo.files.push("build") + fs.writeFile(pbj, JSON.stringify(pbo, null, 2), function (er) { + if (er) return cb(er) + tar.pack(tb, pb, pbo, false, function (er) { + if (er) return cb(er) + // try to validate the shasum, too + sha.get(tb, function (er, shasum) { + if (er) return cb(er) + // binary distribution requires shasum checking. + if (!shasum) return cb() + data.dist.bin = data.dist.bin || {} + data.dist.bin[bd] = data.dist.bin[bd] || {} + data.dist.bin[bd].shasum = shasum + return cb(null, tb) + }) + }) + }) + }) }) }) } + +function regPublish (data, prebuilt, isRetry, args, cb) { + registry.publish(data, prebuilt, function (er) { + if (er && er.errno === npm.EPUBLISHCONFLICT + && npm.config.get("force") && !isRetry) { + log.warn("Forced publish over "+data._id, "publish") + return npm.commands.unpublish([data._id], function (er) { + // ignore errors. Use the force. Reach out with your feelings. + publish(args, true, cb) + }) + } + cb(er) + }) +} diff --git a/lib/utils/config-defs.js b/lib/utils/config-defs.js index 407ce41b76d..2eaca4872ab 100644 --- a/lib/utils/config-defs.js +++ b/lib/utils/config-defs.js @@ -5,9 +5,17 @@ var path = require("path") , stdio = process.binding("stdio") , url = require("url") , Stream = require("stream").Stream + , semver = require("semver") + , stableFamily = semver.parse(process.version) + , os = require("os") + +if (!stableFamily || (+stableFamily[2] % 2)) stableFamily = null +else stableFamily = stableFamily[1] + "." + stableFamily[2] exports.defaults = { argv : [] + , bindist : stableFamily + && (stableFamily + "-" + process.platform + "-" + os.release()) // are there others? , browser : process.platform === "darwin" ? "open" : "google-chrome" , cache : path.resolve( process.env.HOME @@ -61,6 +69,7 @@ exports.defaults = exports.types = { argv : NaN + , bindist : [String, null] , browser : String , cache : path , color : ["always", Boolean] diff --git a/lib/utils/npm-registry-client/publish.js b/lib/utils/npm-registry-client/publish.js index 4f2249e9f7c..9a4b88a583e 100644 --- a/lib/utils/npm-registry-client/publish.js +++ b/lib/utils/npm-registry-client/publish.js @@ -1,5 +1,4 @@ - module.exports = publish var request = require("./request") @@ -13,7 +12,8 @@ var request = require("./request") , npm = require("../../../npm") , url = require("url") -function publish (data, cb) { +function publish (data, prebuilt, cb) { + if (typeof prebuilt === "function") cb = prebuilt, prebuilt = null // add the dist-url to the data, pointing at the tarball. // if the {name} isn't there, then create it. // if the {version} is already there, then fail. @@ -34,63 +34,117 @@ function publish (data, cb) { } ] } + + var tbName = data.name + "-" + data.version + ".tgz" + , bd = npm.config.get("bindist") + , pbName = data.name + "-" + data.version + "-" + bd + ".tgz" + , tbURI = data.name + "/-/" + tbName + , pbURI = data.name + "/-/" + pbName + data._id = data.name+"@"+data.version - var attURI = encodeURIComponent(data.name) - + "/-/" - + encodeURIComponent(data.name) - + "-" - + encodeURIComponent(data.version) - + ".tgz" data.dist = data.dist || {} - data.dist.tarball = url.resolve(registry, attURI) - .replace(/^https:\/\//, 'http://') + data.dist.tarball = url.resolve(registry, tbURI) + .replace(/^https:\/\//, "http://") + + if (prebuilt && bd) { + data.dist.bin[bd] = data.dist.bin[bd] || {} + data.dist.bin[bd].tarball = url.resolve(registry, pbURI) + .replace(/^https:\/\//, "http://") + } + + + // first try to just PUT the whole fullData, and this will fail if it's // already there, because it'll be lacking a _rev, so couch'll bounce it. - PUT(encodeURIComponent(data.name), fullData, function (er, parsed, json, response) { + PUT(encodeURIComponent(data.name), fullData, + function (er, parsed, json, response) { // get the rev and then upload the attachment // a 409 is expected here, if this is a new version of an existing package. if (er && !(response && response.statusCode === 409) && !( parsed - && parsed.reason === "must supply latest _rev to update existing package" - ) - ) { - return log.er(cb, "Failed PUT response "+(response && response.statusCode))(er) + && parsed.reason === + "must supply latest _rev to update existing package" )) { + return log.er(cb, "Failed PUT response " + +(response && response.statusCode))(er) } - var dataURI = encodeURIComponent(data.name)+"/"+encodeURIComponent(data.version) + var dataURI = encodeURIComponent(data.name) + + "/" + encodeURIComponent(data.version) var tag = data.tag || npm.config.get("tag") if (npm.config.get("pre")) dataURI += "/-pre/true" else if (tag) dataURI += "/-tag/" + tag else dataURI += "/-tag/latest" - PUT(dataURI, data, function (er) { - if (er) { - if (er.message.indexOf("conflict Document update conflict.") === 0) { - var e = new Error("publish fail") - e.errno = npm.EPUBLISHCONFLICT - e.pkgid = data._id - return cb(e) - } - return log.er(cb, "Error sending version data")(er) + // let's see what verions are already published. + // could be that we just need to update the bin dist values. + GET(data.name, function (er, fullData) { + if (er) return cb(er) + + var exists = fullData.versions && fullData.versions[data.version] + if (exists) { + log(exists._id, "Already published") + var ebin = exists.dist.bin || {} + , nbin = data.dist.bin || {} + , needs = Object.keys(nbin).filter(function (bd) { + return !ebin.hasOwnProperty(bd) + }) + log.verbose(needs, "uploading bin dists") + if (!needs.length) return cb(conflictError(data._id)) + // attach the needed bindists, upload the new metadata + exists.dist.bin = ebin + needs.forEach(function (bd) { exists.dist.bin[bd] = nbin[bd] }) + return PUT(dataURI + "/-rev/" + fullData._rev, exists, function (er) { + if (er) return cb(er) + attach(data.name, prebuilt, pbName, cb) + }) } - GET(encodeURIComponent(data.name), function (er, d) { - if (er) return cb(er) - var rev = d && ("-rev/"+d._rev) - , tarball = path.join(npm.cache, data.name, data.version, "package.tgz") - log.verbose(tarball, "tarball") - attURI += "/" + rev - upload(attURI, tarball, function (er) { - log("uploaded", "publish") - if (er) log.error("Couldn't send tarball", "publish fail") - rollbackFailure(data, cb)(er) + + PUT(dataURI, data, function (er) { + if (er) { + if (er.message.indexOf("conflict Document update conflict.") === 0) { + return cb(conflictError(data._id)) + } + return log.er(cb, "Error sending version data")(er) + } + + var c = path.resolve(npm.cache, data.name, data.version) + , tb = path.resolve(c, "package.tgz") + + cb = rollbackFailure(data, cb) + + log.verbose([data.name, tb, tbName], "attach 2") + attach(data.name, tb, tbName, function (er) { + log.verbose([er, data.name, prebuilt, pbName], "attach 3") + if (er || !prebuilt) return cb(er) + attach(data.name, prebuilt, pbName, cb) }) }) }) }) } +function conflictError (pkgid) { + var e = new Error("publish fail") + e.errno = npm.EPUBLISHCONFLICT + e.pkgid = pkgid + return e +} + +function attach (doc, file, filename, cb) { + doc = encodeURIComponent(doc) + GET(doc, function (er, d) { + if (er) return cb(er) + if (!d) return cb(new Error( + "Attempting to upload to invalid doc "+doc)) + var rev = "-rev/"+d._rev + , attURI = doc + "/-/" + encodeURIComponent(filename) + "/" + rev + log.verbose([attURI, file], "uploading") + upload(attURI, file, cb) + }) +} + function rollbackFailure (data, cb) { return function (er) { if (!er) return cb() npm.ROLLBACK = true @@ -99,7 +153,8 @@ function rollbackFailure (data, cb) { return function (er) { npm.commands.unpublish([data.name+"@"+data.version], function (er_) { if (er_) { log.error(er_, "rollback failed") - log.error("Invalid data in registry! Please report this.", "rollback failed") + log.error( "Invalid data in registry! Please report this." + , "rollback failed" ) } else log("rolled back", "publish failed") cb(er) }) diff --git a/lib/utils/npm-registry-client/request.js b/lib/utils/npm-registry-client/request.js index 4112a6d526a..01cecc58508 100644 --- a/lib/utils/npm-registry-client/request.js +++ b/lib/utils/npm-registry-client/request.js @@ -15,6 +15,7 @@ var npm = require("../../../npm") , rm = require("../rm-rf") , asyncMap = require("../async-map") , proxyify = require("../proxyify") + , warnedAuth = false function request (method, where, what, etag, nofollow, cb_) { log.verbose(where||"/", method) @@ -65,7 +66,7 @@ function request (method, where, what, etag, nofollow, cb_) { , hostname = remote.hostname , auth = authRequired && npm.config.get("_auth") - log.verbose(remote, "url parsed "+where) + log.verbose(remote, "url parsed") if (port !== (secure ? 443 : 80)) hostname += ":" + port if (authRequired && !auth) { @@ -73,7 +74,8 @@ function request (method, where, what, etag, nofollow, cb_) { "Cannot insert data into the registry without authorization\n" + "See: npm-adduser(1)")) } - if (auth && !secure) { + if (auth && !secure && !warnedAuth) { + warnedAuth = true log.warn("Sending authorization over insecure channel.") } var headers = { "accept" : "application/json" } @@ -246,7 +248,9 @@ function PUT (where, what, etag, nofollow, cb) { } function upload (where, filename, etag, nofollow, cb) { + if (typeof nofollow === "function") cb = nofollow, nofollow = false if (typeof etag === "function") cb = etag, etag = null + new File(filename, function (er, f) { if (er) return log.er(cb, "Couldn't open "+filename)(er) PUT(where, f, etag, nofollow, function (er) { @@ -260,6 +264,7 @@ function File (name, cb) { var f = this f.name = name if (f.loaded) return cb(null, f) + log.info(f.name, "stat") fs.stat(f.name, function (er, stat) { if (er) return log.er(cb, "doesn't exist "+f.name)(er) log.silly(stat, "stat "+name) diff --git a/lib/utils/npm-registry-client/unpublish.js b/lib/utils/npm-registry-client/unpublish.js index 9a0363db708..837459fb0ab 100644 --- a/lib/utils/npm-registry-client/unpublish.js +++ b/lib/utils/npm-registry-client/unpublish.js @@ -11,11 +11,14 @@ var request = require("./request") , log = require("../log") , get = require("./get") , semver = require("semver") + , url = require("url") + , chain = require("../chain") function unpublish (name, ver, cb) { if (!cb) cb = ver, ver = null if (!cb) throw new Error( "Not enough arguments for registry unpublish") + get(name, null, -1, true, function (er, data) { if (er) return log(name+" not published", "unpublish", cb) // remove all if no version specified @@ -23,46 +26,73 @@ function unpublish (name, ver, cb) { log("No version specified, removing all", "unpublish") return request("DELETE", name+'/-rev/'+data._rev, cb) } + var versions = data.versions || {} , versionPublic = versions.hasOwnProperty(ver) + if (!versionPublic) log(name+"@"+ver+" not published", "unpublish") + else { + var dist = versions[ver].dist + log.verbose(dist, "removing attachments") + } + delete versions[ver] // if it was the only version, then delete the whole package. if (!Object.keys(versions).length) { log("No versions remain, removing entire package", "unpublish") - return request("DELETE", name+'/-rev/'+data._rev, cb) + return request("DELETE", name+"/-rev/"+data._rev, cb) } + if (!versionPublic) return cb() + var latestVer = data["dist-tags"].latest for (var tag in data["dist-tags"]) { if (data["dist-tags"][tag] === ver) delete data["dist-tags"][tag] } + if (latestVer === ver) { data["dist-tags"].latest = Object.getOwnPropertyNames(versions).sort(semver.compare).pop() } + var rev = data._rev delete data._revisions delete data._attachments // log(data._rev, "rev") request.PUT(name+"/-rev/"+rev, data, - log.er(detacher(data, ver, cb), "Failed to update the data")) + log.er(detacher(data, dist, cb), "Failed to update the data")) }) } -function detacher (data, version, cb) { return function (er) { + +function detacher (data, dist, cb) { return function (er) { if (er) return cb(er) get(data.name, function (er, data) { if (er) return cb(er) - // delete the attachment - var attpref = encodeURIComponent(data.name) - + "/-/" - + encodeURIComponent(data.name) - , attsuff = encodeURIComponent(version) - + ".tgz" - + "/-rev/" - + encodeURIComponent(data._rev) - , attURI = attpref + "-" + attsuff - request("DELETE", attURI, cb) + var tb = url.parse(dist.tarball) + + detach(data, tb.pathname, data._rev, function (er) { + if (er || !dist.bin) return cb(er) + chain(Object.keys(dist.bin).map(function (bt) { + return function (cb) { + var d = dist.bin[bt] + detach(data, url.parse(d.tarball).pathname, null, cb) + } + }).concat(cb)) + }) }) }} + +function detach (data, path, rev, cb) { + if (rev) { + path += "/-rev/" + rev + log(path, "detach") + return request("DELETE", path, cb) + } + get(data.name, function (er, data) { + rev = data._rev + if (!rev) return cb(new Error( + "No _rev found in "+data._id)) + detach(data, path, rev, cb) + }) +} diff --git a/lib/utils/read-json.js b/lib/utils/read-json.js index 2696e0dcd50..493aa034567 100644 --- a/lib/utils/read-json.js +++ b/lib/utils/read-json.js @@ -187,7 +187,8 @@ function processObject (opts, cb) { return function (er, json) { }) } - if (opts.wscript) { + if (opts.wscript && !json.prebuilt) { + log.verbose([json.prebuilt, opts], "has wscript") var scripts = json.scripts = json.scripts || {} if (!scripts.install && !scripts.preinstall) { // don't fail if it was unexpected, just try. diff --git a/lib/utils/sha.js b/lib/utils/sha.js index 59b739f1227..3c98a905964 100644 --- a/lib/utils/sha.js +++ b/lib/utils/sha.js @@ -31,7 +31,6 @@ function get (file, cb) { log.warn("crypto binding not found. Cannot verify shasum.", "shasum") return cb() } - log(file, "calculating sha1") var h = crypto.createHash("sha1") , s = fs.createReadStream(file) , errState = null @@ -46,7 +45,7 @@ function get (file, cb) { }).on("end", function () { if (errState) return var actual = h.digest("hex").toLowerCase().trim() - log(actual, "shasum") + log(actual+"\n"+file, "shasum") cb(null, actual) }) } diff --git a/man1/config.1 b/man1/config.1 index ac266ca319c..741c0697112 100644 --- a/man1/config.1 +++ b/man1/config.1 @@ -235,6 +235,29 @@ npm config set foo:port 80 . .SH "Config Settings" . +.SS "bindist" +. +.IP "\(bu" 4 +Default: Unstable node versions, \fBnull\fR, otherwise \fB"\-\-"\fR +. +.IP "\(bu" 4 +Type: String or \fBnull\fR +. +.IP "" 0 +. +.P +Experimental: on stable versions of node, binary distributions will be +created with this tag\. If a user then installs that package, and their \fBbindist\fR tag is found in the list of binary distributions, they will +get that prebuilt version\. +. +.P +Pre\-build node packages have their preinstall, install, and postinstall +scripts stripped (since they are run prior to publishing), and do not +have their \fBbuild\fR directories automatically ignored\. +. +.P +It\'s yet to be seen if this is a good idea\. +. .SS "browser" . .IP "\(bu" 4 diff --git a/man1/get.1 b/man1/get.1 index ac266ca319c..741c0697112 100644 --- a/man1/get.1 +++ b/man1/get.1 @@ -235,6 +235,29 @@ npm config set foo:port 80 . .SH "Config Settings" . +.SS "bindist" +. +.IP "\(bu" 4 +Default: Unstable node versions, \fBnull\fR, otherwise \fB"\-\-"\fR +. +.IP "\(bu" 4 +Type: String or \fBnull\fR +. +.IP "" 0 +. +.P +Experimental: on stable versions of node, binary distributions will be +created with this tag\. If a user then installs that package, and their \fBbindist\fR tag is found in the list of binary distributions, they will +get that prebuilt version\. +. +.P +Pre\-build node packages have their preinstall, install, and postinstall +scripts stripped (since they are run prior to publishing), and do not +have their \fBbuild\fR directories automatically ignored\. +. +.P +It\'s yet to be seen if this is a good idea\. +. .SS "browser" . .IP "\(bu" 4 diff --git a/man1/set.1 b/man1/set.1 index ac266ca319c..741c0697112 100644 --- a/man1/set.1 +++ b/man1/set.1 @@ -235,6 +235,29 @@ npm config set foo:port 80 . .SH "Config Settings" . +.SS "bindist" +. +.IP "\(bu" 4 +Default: Unstable node versions, \fBnull\fR, otherwise \fB"\-\-"\fR +. +.IP "\(bu" 4 +Type: String or \fBnull\fR +. +.IP "" 0 +. +.P +Experimental: on stable versions of node, binary distributions will be +created with this tag\. If a user then installs that package, and their \fBbindist\fR tag is found in the list of binary distributions, they will +get that prebuilt version\. +. +.P +Pre\-build node packages have their preinstall, install, and postinstall +scripts stripped (since they are run prior to publishing), and do not +have their \fBbuild\fR directories automatically ignored\. +. +.P +It\'s yet to be seen if this is a good idea\. +. .SS "browser" . .IP "\(bu" 4 diff --git a/node_modules/nopt b/node_modules/nopt new file mode 160000 index 00000000000..49c1a2c986f --- /dev/null +++ b/node_modules/nopt @@ -0,0 +1 @@ +Subproject commit 49c1a2c986fdceb020e0ff70e59886a5073b229b diff --git a/node_modules/optparse b/node_modules/optparse deleted file mode 160000 index c20aeedc553..00000000000 --- a/node_modules/optparse +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c20aeedc5536f5bd71283b4b719a3417f3273f4b diff --git a/package.json b/package.json index 7377aa4638a..431f56daa54 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ } , "main" : "npm" , "bin" : "./bin/npm.js" -, "dependencies" : { "semver" : "1", "abbrev" : "1", "optparse" : "1" } -, "bundleDependencies" : [ "semver", "abbrev", "optparse" ] +, "dependencies" : { "semver" : "1", "abbrev" : "1", "nopt" : "1" } +, "bundleDependencies" : [ "semver", "abbrev", "nopt" ] , "devDependencies" : { "ronn" : "" } , "engines" : { "node" : "0.4 || 0.5", "npm" : "1" } , "scripts" : { "test" : "make test"