diff options
author | isaacs <i@izs.me> | 2014-05-01 11:09:00 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-05-01 11:09:00 -0700 |
commit | f76c3938d0660378017bf276a72ea60e9adfe62c (patch) | |
tree | c2eedc352746051ce71d5ea91922d9a2139babef /deps/npm/node_modules/read-package-json | |
parent | 1038959dbf70800545df319715e5d89dbd8ad8af (diff) | |
download | node-new-f76c3938d0660378017bf276a72ea60e9adfe62c.tar.gz |
npm: upgrade to v1.4.8
* Check SHA before using files from cache
* adduser: allow change of the saved password
* Make `npm install` respect `config.unicode`
* Fix lifecycle to pass `Infinity` for config env value
* Don't return 0 exit code on invalid command
* cache: Handle 404s and other HTTP errors as errors
* bump tap dep, make tests stderr a bit quieter
* Resolve ~ in path configs to env.HOME
* Include npm version in default user-agent conf
* npm init: Use ISC as default license, use save-prefix for deps
* Many test and doc fixes
Diffstat (limited to 'deps/npm/node_modules/read-package-json')
6 files changed, 63 insertions, 48 deletions
diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.travis.yml b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.travis.yml index 2ca91f2895..6e5919de39 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.travis.yml +++ b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.travis.yml @@ -1,4 +1,3 @@ language: node_js node_js: - "0.10" - - "0.8"
\ No newline at end of file diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js index 3414c09329..2bcc2290d4 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js +++ b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js @@ -6,8 +6,6 @@ var url = require("url") var typos = require("./typos") var coreModuleNames = require("./core_module_names") var githubUserRepo = require("github-url-from-username-repo") -var warningMessages = require('./warning_messages.json') -var format = require('util').format var fixer = module.exports = { // default warning function @@ -15,10 +13,10 @@ var fixer = module.exports = { fixRepositoryField: function(data) { if (data.repositories) { - this.warn(warningMessages.repositories); + this.warn("repositories"); data.repository = data.repositories[0] } - if (!data.repository) return this.warn(warningMessages.missingRepository) + if (!data.repository) return this.warn("missingRepository") if (typeof data.repository === "string") { data.repository = { type: "git", @@ -37,14 +35,14 @@ var fixer = module.exports = { } if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) { - this.warn(format(warningMessages.brokenGitUrl, r)) + this.warn("brokenGitUrl", r) } } , fixTypos: function(data) { Object.keys(typos.topLevel).forEach(function (d) { if (data.hasOwnProperty(d)) { - this.warn(makeTypoWarning(d, typos.topLevel[d])) + this.warn("typo", d, typos.topLevel[d]) } }, this) } @@ -52,15 +50,15 @@ var fixer = module.exports = { , fixScriptsField: function(data) { if (!data.scripts) return if (typeof data.scripts !== "object") { - this.warn(warningMessages.nonObjectScripts) + this.warn("nonObjectScripts") delete data.scripts } Object.keys(data.scripts).forEach(function (k) { if (typeof data.scripts[k] !== "string") { - this.warn(warningMessages.nonStringScript) + this.warn("nonStringScript") delete data.scripts[k] } else if (typos.script[k]) { - this.warn(makeTypoWarning(k, typos.script[k], "scripts")) + this.warn("typo", k, typos.script[k], "scripts") } }, this) } @@ -68,12 +66,12 @@ var fixer = module.exports = { , fixFilesField: function(data) { var files = data.files if (files && !Array.isArray(files)) { - this.warn(warningMessages.nonArrayFiles) + this.warn("nonArrayFiles") delete data.files } else if (data.files) { data.files = data.files.filter(function(file) { if (!file || typeof file !== "string") { - this.warn(format(warningMessages.invalidFilename, file)) + this.warn("invalidFilename", file) return false } else { return true @@ -105,12 +103,12 @@ var fixer = module.exports = { delete data[bdd] } if (data[bd] && !Array.isArray(data[bd])) { - this.warn(warningMessages.nonArrayBundleDependencies) + this.warn("nonArrayBundleDependencies") delete data[bd] } else if (data[bd]) { data[bd] = data[bd].filter(function(bd) { if (!bd || typeof bd !== 'string') { - this.warn(format(warningMessages.nonStringBundleDependency, bd)) + this.warn("nonStringBundleDependency", bd) return false } else { return true @@ -128,14 +126,14 @@ var fixer = module.exports = { ;['dependencies','devDependencies'].forEach(function(deps) { if (!(deps in data)) return if (!data[deps] || typeof data[deps] !== "object") { - this.warn(format(warningMessages.nonObjectDependencies, deps)) + this.warn("nonObjectDependencies", deps) delete data[deps] return } Object.keys(data[deps]).forEach(function (d) { var r = data[deps][d] if (typeof r !== 'string') { - this.warn(format(warningMessages.nonStringDependency, d, JSON.stringify(r))) + this.warn("nonStringDependency", d, JSON.stringify(r)) delete data[deps][d] } // "/" is not allowed as packagename for publishing, but for git-urls @@ -149,7 +147,7 @@ var fixer = module.exports = { , fixModulesField: function (data) { if (data.modules) { - this.warn(warningMessages.deprecatedModules) + this.warn("deprecatedModules") delete data.modules } } @@ -160,11 +158,11 @@ var fixer = module.exports = { } if (data.keywords && !Array.isArray(data.keywords)) { delete data.keywords - this.warn(warningMessages.nonArrayKeywords) + this.warn("nonArrayKeywords") } else if (data.keywords) { data.keywords = data.keywords.filter(function(kw) { if (typeof kw !== "string" || !kw) { - this.warn(warningMessages.nonStringKeyword); + this.warn("nonStringKeyword"); return false } else { return true @@ -205,24 +203,24 @@ var fixer = module.exports = { data.name = data.name.trim() ensureValidName(data.name, strict) if (coreModuleNames.indexOf(data.name) !== -1) - this.warn(format(warningMessages.conflictingName, data.name)) + this.warn("conflictingName", data.name) } , fixDescriptionField: function (data) { if (data.description && typeof data.description !== 'string') { - this.warn(warningMessages.nonStringDescription) + this.warn("nonStringDescription") delete data.description } if (data.readme && !data.description) data.description = extractDescription(data.readme) if(data.description === undefined) delete data.description; - if (!data.description) this.warn(warningMessages.missingDescription) + if (!data.description) this.warn("missingDescription") } , fixReadmeField: function (data) { if (!data.readme) { - this.warn(warningMessages.missingReadme) + this.warn("missingReadme") data.readme = "ERROR: No README data found!" } } @@ -245,7 +243,7 @@ var fixer = module.exports = { else if(url.parse(data.bugs).protocol) data.bugs = {url: data.bugs} else - this.warn(warningMessages.nonEmailUrlBugsString) + this.warn("nonEmailUrlBugsString") } else { bugsTypos(data.bugs, this.warn) @@ -255,18 +253,18 @@ var fixer = module.exports = { if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol) data.bugs.url = oldBugs.url else - this.warn(warningMessages.nonUrlBugsUrlField) + this.warn("nonUrlBugsUrlField") } if(oldBugs.email) { if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email)) data.bugs.email = oldBugs.email else - this.warn(warningMessages.nonEmailBugsEmailField) + this.warn("nonEmailBugsEmailField") } } if(!data.bugs.email && !data.bugs.url) { delete data.bugs - this.warn(warningMessages.emptyNormalizedBugs) + this.warn("emptyNormalizedBugs") } } } @@ -282,11 +280,11 @@ var fixer = module.exports = { return true if(typeof data.homepage !== "string") { - this.warn(warningMessages.nonUrlHomepage) + this.warn("nonUrlHomepage") return delete data.homepage } if(!url.parse(data.homepage).protocol) { - this.warn(warningMessages.missingProtocolHomepage) + this.warn("missingProtocolHomepage") data.homepage = "http://" + data.homepage } } @@ -350,7 +348,7 @@ function depObjectify (deps, type, warn) { deps = deps.trim().split(/[\n\r\s\t ,]+/) } if (!Array.isArray(deps)) return deps - warn(format(warningMessages.deprecatedArrayDependencies, type)) + warn("deprecatedArrayDependencies", type) var o = {} deps.filter(function (d) { return typeof d === "string" @@ -376,17 +374,9 @@ function bugsTypos(bugs, warn) { if (!bugs) return Object.keys(bugs).forEach(function (k) { if (typos.bugs[k]) { - warn(makeTypoWarning(k, typos.bugs[k], "bugs")) + warn("typo", k, typos.bugs[k], "bugs") bugs[typos.bugs[k]] = bugs[k] delete bugs[k] } }) -} - -function makeTypoWarning (providedName, probableName, field) { - if (field) { - providedName = field + "['" + providedName + "']" - probableName = field + "['" + probableName + "']" - } - return format(warningMessages.typo, providedName, probableName) }
\ No newline at end of file diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/make_warning.js b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/make_warning.js new file mode 100644 index 0000000000..0f3aad5f55 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/make_warning.js @@ -0,0 +1,23 @@ +var util = require("util") +var messages = require("./warning_messages.json") + +module.exports = function() { + var args = Array.prototype.slice.call(arguments, 0) + var warningName = args.shift() + if (warningName == "typo") { + return makeTypoWarning.apply(null,args) + } + else { + var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'" + args.unshift(msgTemplate) + return util.format.apply(null, args) + } +} + +function makeTypoWarning (providedName, probableName, field) { + if (field) { + providedName = field + "['" + providedName + "']" + probableName = field + "['" + probableName + "']" + } + return util.format(messages.typo, providedName, probableName) +}
\ No newline at end of file diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js index a44b0246a0..7e6beefdae 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js +++ b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js @@ -1,6 +1,7 @@ module.exports = normalize var fixer = require("./fixer") +var makeWarning = require("./make_warning") var fieldsToFix = ['name','version','description','repository','modules','scripts' ,'files','bin','man','bugs','keywords','readme','homepage'] @@ -24,7 +25,7 @@ function normalize (data, warn, strict) { !data.scripts.preinstall) { data.gypfile = true } - fixer.warn = warn + fixer.warn = function() { warn(makeWarning.apply(null, arguments)) } thingsToFix.forEach(function(thingName) { fixer["fix" + ucFirst(thingName)](data, strict) }) diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json index cee9079884..449cfb7df2 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json @@ -1,6 +1,6 @@ { "name": "normalize-package-data", - "version": "0.2.12", + "version": "0.2.13", "author": { "name": "Meryn Stol", "email": "merynstol@gmail.com" @@ -15,9 +15,9 @@ "test": "tap test/*.js" }, "dependencies": { - "semver": "2", "github-url-from-git": "~1.1.1", - "github-url-from-username-repo": "0.0.2" + "github-url-from-username-repo": "^0.1.0", + "semver": "2" }, "devDependencies": { "tap": "~0.2.5", @@ -44,6 +44,7 @@ "url": "https://github.com/meryn/normalize-package-data/issues" }, "homepage": "https://github.com/meryn/normalize-package-data", - "_id": "normalize-package-data@0.2.12", - "_from": "normalize-package-data@~0.2.9" + "_id": "normalize-package-data@0.2.13", + "_shasum": "50f9fd9e77b1c8411cd231db2962e73963de774d", + "_from": "normalize-package-data@^0.2.13" } diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index a2eb414c02..fdfe963f6f 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -1,6 +1,6 @@ { "name": "read-package-json", - "version": "1.1.8", + "version": "1.1.9", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -18,7 +18,7 @@ "dependencies": { "glob": "~3.2.1", "lru-cache": "2", - "normalize-package-data": "~0.2.9", + "normalize-package-data": "^0.2.13", "graceful-fs": "2" }, "devDependencies": { @@ -34,6 +34,7 @@ "url": "https://github.com/isaacs/read-package-json/issues" }, "homepage": "https://github.com/isaacs/read-package-json", - "_id": "read-package-json@1.1.8", + "_id": "read-package-json@1.1.9", + "_shasum": "9c319185e5f8461661c01f8d4e5e80b468aa18ee", "_from": "read-package-json@latest" } |