summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/init-package-json
diff options
context:
space:
mode:
authorForrest L Norvell <ogd@aoaioxxysz.net>2015-01-08 14:37:26 -0800
committerBen Noordhuis <info@bnoordhuis.nl>2015-01-08 23:49:03 +0100
commite79ccee1685393e4ec73746bac93835cbcf3a809 (patch)
tree304a1ddd59495b50a20d1b25c62da2a4519228db /deps/npm/node_modules/init-package-json
parent156cd82ef4d2ff4fa291407de562c3a7c2386dc7 (diff)
downloadnode-new-e79ccee1685393e4ec73746bac93835cbcf3a809.tar.gz
npm: upgrade to v2.1.18
PR-URL: https://github.com/iojs/io.js/pull/266 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/npm/node_modules/init-package-json')
-rw-r--r--deps/npm/node_modules/init-package-json/default-input.js22
-rw-r--r--deps/npm/node_modules/init-package-json/node_modules/promzard/package.json3
-rw-r--r--deps/npm/node_modules/init-package-json/package.json10
-rw-r--r--deps/npm/node_modules/init-package-json/test/npm-defaults.js60
4 files changed, 82 insertions, 13 deletions
diff --git a/deps/npm/node_modules/init-package-json/default-input.js b/deps/npm/node_modules/init-package-json/default-input.js
index c86894b26a..068bb00a82 100644
--- a/deps/npm/node_modules/init-package-json/default-input.js
+++ b/deps/npm/node_modules/init-package-json/default-input.js
@@ -41,7 +41,10 @@ function readDeps (test) { return function (cb) {
var name = package.name || basename
exports.name = yes ? name : prompt('name', name)
-var version = package.version || config.get('init-version') || '1.0.0'
+var version = package.version ||
+ config.get('init.version') ||
+ config.get('init-version') ||
+ '1.0.0'
exports.version = yes ? version : prompt('version', version)
if (!package.description) {
@@ -177,14 +180,21 @@ if (!package.keywords) {
}
if (!package.author) {
- exports.author = config.get('init-author-name')
+ exports.author = config.get('init.author.name') ||
+ config.get('init-author-name')
? {
- "name" : config.get('init-author-name'),
- "email" : config.get('init-author-email'),
- "url" : config.get('init-author-url')
+ "name" : config.get('init.author.name') ||
+ config.get('init-author-name'),
+ "email" : config.get('init.author.email') ||
+ config.get('init-author-email'),
+ "url" : config.get('init.author.url') ||
+ config.get('init-author-url')
}
: prompt('author')
}
-var license = package.license || config.get('init-license') || 'ISC'
+var license = package.license ||
+ config.get('init.license') ||
+ config.get('init-license') ||
+ 'ISC'
exports.license = yes ? license : prompt('license', license)
diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
index f66857539f..c15c772241 100644
--- a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
+++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
@@ -44,6 +44,5 @@
"tarball": "http://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz"
}
diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json
index 54aa7cbdf3..de90de6207 100644
--- a/deps/npm/node_modules/init-package-json/package.json
+++ b/deps/npm/node_modules/init-package-json/package.json
@@ -1,6 +1,6 @@
{
"name": "init-package-json",
- "version": "1.1.1",
+ "version": "1.1.3",
"main": "init-package-json.js",
"scripts": {
"test": "tap test/*.js"
@@ -40,12 +40,12 @@
],
"readme": "# init-package-json\n\nA node module to get your node module started.\n\n## Usage\n\n```javascript\nvar init = require('init-package-json')\nvar path = require('path')\n\n// a path to a promzard module. In the event that this file is\n// not found, one will be provided for you.\nvar initFile = path.resolve(process.env.HOME, '.npm-init')\n\n// the dir where we're doin stuff.\nvar dir = process.cwd()\n\n// extra stuff that gets put into the PromZard module's context.\n// In npm, this is the resolved config object. Exposed as 'config'\n// Optional.\nvar configData = { some: 'extra stuff' }\n\n// Any existing stuff from the package.json file is also exposed in the\n// PromZard module as the `package` object. There will also be free\n// vars for:\n// * `filename` path to the package.json file\n// * `basename` the tip of the package dir\n// * `dirname` the parent of the package dir\n\ninit(dir, initFile, configData, function (er, data) {\n // the data's already been written to {dir}/package.json\n // now you can do stuff with it\n})\n```\n\nOr from the command line:\n\n```\n$ npm-init\n```\n\nSee [PromZard](https://github.com/isaacs/promzard) for details about\nwhat can go in the config file.\n",
"readmeFilename": "README.md",
- "gitHead": "a4df4e57f9b6a2bf906ad50612dbed7dcb2f2c2b",
+ "gitHead": "b766900b2d615ddc43c452e251b8c5543538e832",
"bugs": {
"url": "https://github.com/isaacs/init-package-json/issues"
},
"homepage": "https://github.com/isaacs/init-package-json",
- "_id": "init-package-json@1.1.1",
- "_shasum": "e09e9f1fb541e0fddc9175c5ce1736fd45ff4bf8",
- "_from": "init-package-json@>=1.1.1 <2.0.0"
+ "_id": "init-package-json@1.1.3",
+ "_shasum": "1d633c151a4909891afc8ee13cace8b336c0c9c2",
+ "_from": "init-package-json@>=1.1.3 <1.2.0"
}
diff --git a/deps/npm/node_modules/init-package-json/test/npm-defaults.js b/deps/npm/node_modules/init-package-json/test/npm-defaults.js
index 8229c84a00..f65f646316 100644
--- a/deps/npm/node_modules/init-package-json/test/npm-defaults.js
+++ b/deps/npm/node_modules/init-package-json/test/npm-defaults.js
@@ -32,6 +32,14 @@ test("npm configuration values pulled from environment", function (t) {
npm.load({}, function (err) {
t.ifError(err, "npm loaded successfully")
+ // clear out dotted names from test environment
+ npm.config.del("init.author.name")
+ npm.config.del("init.author.email")
+ npm.config.del("init.author.url")
+ // the following have npm defaults, and need to be explicitly overridden
+ npm.config.set("init.license", "")
+ npm.config.set("init.version", "")
+
process.chdir(resolve(__dirname))
init(__dirname, __dirname, npm.config, function (er, data) {
t.ifError(err, "init ran successfully")
@@ -42,6 +50,58 @@ test("npm configuration values pulled from environment", function (t) {
})
})
+test("npm configuration values pulled from dotted config", function (t) {
+ /*eslint camelcase:0 */
+ var config = {
+ yes : "yes",
+
+ "init.author.name" : "npmbot",
+ "init.author.email" : "n@p.m",
+ "init.author.url" : "http://npm.im",
+
+ "init.license" : EXPECTED.license,
+ "init.version" : EXPECTED.version
+ }
+
+ npm.load(config, function (err) {
+ t.ifError(err, "npm loaded successfully")
+
+ process.chdir(resolve(__dirname))
+ init(__dirname, __dirname, npm.config, function (er, data) {
+ t.ifError(err, "init ran successfully")
+
+ t.same(data, EXPECTED, "got the package data from the config")
+ t.end()
+ })
+ })
+})
+
+test("npm configuration values pulled from dashed config", function (t) {
+ /*eslint camelcase:0 */
+ var config = {
+ yes : "yes",
+
+ "init-author-name" : "npmbot",
+ "init-author-email" : "n@p.m",
+ "init-author-url" : "http://npm.im",
+
+ "init-license" : EXPECTED.license,
+ "init-version" : EXPECTED.version
+ }
+
+ npm.load(config, function (err) {
+ t.ifError(err, "npm loaded successfully")
+
+ process.chdir(resolve(__dirname))
+ init(__dirname, __dirname, npm.config, function (er, data) {
+ t.ifError(err, "init ran successfully")
+
+ t.same(data, EXPECTED, "got the package data from the config")
+ t.end()
+ })
+ })
+})
+
test("cleanup", function (t) {
rimraf.sync(resolve(__dirname, "package.json"))
t.pass("cleaned up")