Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuy Adorno <ruyadorno@hotmail.com>2020-10-16 22:56:25 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2020-10-16 23:40:07 +0300
commit9953ec41bda107cc02cb9e82921195fd10d73b22 (patch)
tree9dfbf9f1802ce025d795faed474309926fa02c41 /node_modules/libnpmpublish
parent1e405daebd47fa4cdc8fecd83058fbf19c3bd707 (diff)
libnpmpublish@3.0.2
Diffstat (limited to 'node_modules/libnpmpublish')
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/AUTHORS4
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/LICENSE30
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/README.md106
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/lib/extract_description.js14
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/lib/fixer.js418
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/lib/make_warning.js23
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/lib/normalize.js39
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/lib/safe_format.js9
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/lib/typos.json25
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/lib/warning_messages.json30
-rw-r--r--node_modules/libnpmpublish/node_modules/normalize-package-data/package.json32
-rw-r--r--node_modules/libnpmpublish/package.json8
12 files changed, 734 insertions, 4 deletions
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/AUTHORS b/node_modules/libnpmpublish/node_modules/normalize-package-data/AUTHORS
new file mode 100644
index 000000000..66282ba1d
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/AUTHORS
@@ -0,0 +1,4 @@
+# Names sorted by how much code was originally theirs.
+Isaac Z. Schlueter <i@izs.me>
+Meryn Stol <merynstol@gmail.com>
+Robert Kowalski <rok@kowalski.gd>
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/LICENSE b/node_modules/libnpmpublish/node_modules/normalize-package-data/LICENSE
new file mode 100644
index 000000000..6ed662cd5
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/LICENSE
@@ -0,0 +1,30 @@
+This package contains code originally written by Isaac Z. Schlueter.
+Used with permission.
+
+Copyright (c) Meryn Stol ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/README.md b/node_modules/libnpmpublish/node_modules/normalize-package-data/README.md
new file mode 100644
index 000000000..d2bd7bc7f
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/README.md
@@ -0,0 +1,106 @@
+# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data)
+
+normalize-package-data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.
+
+normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.
+
+## Installation
+
+```
+npm install normalize-package-data
+```
+
+## Usage
+
+Basic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.
+
+```javascript
+normalizeData = require('normalize-package-data')
+packageData = require("./package.json")
+normalizeData(packageData)
+// packageData is now normalized
+```
+
+#### Strict mode
+
+You may activate strict validation by passing true as the second argument.
+
+```javascript
+normalizeData = require('normalize-package-data')
+packageData = require("./package.json")
+normalizeData(packageData, true)
+// packageData is now normalized
+```
+
+If strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace.
+
+#### Warnings
+
+Optionally, you may pass a "warning" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data.
+
+```javascript
+normalizeData = require('normalize-package-data')
+packageData = require("./package.json")
+warnFn = function(msg) { console.error(msg) }
+normalizeData(packageData, warnFn)
+// packageData is now normalized. Any number of warnings may have been logged.
+```
+
+You may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third.
+
+When `private` field is set to `true`, warnings will be suppressed.
+
+### Potential exceptions
+
+If the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.
+
+## What normalization (currently) entails
+
+* The value of `name` field gets trimmed (unless in strict mode).
+* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).
+* If `name` and/or `version` fields are missing, they are set to empty strings.
+* If `files` field is not an array, it will be removed.
+* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.
+* If `man` field is a string, it will become an array with the original string as its sole member.
+* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\s+`.
+* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.
+* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.
+* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.
+* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.
+* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved.
+* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL.
+* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.
+* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`.
+* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to git+https://github.com/[owner-name]/[repo-name].git
+* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.
+* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.
+* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.
+* If `homepage` field is not a string, it will be removed.
+* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.
+* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]#readme . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.
+
+### Rules for name field
+
+If `name` field is given, the value of the name field must be a string. The string may not:
+
+* start with a period.
+* contain the following characters: `/@\s+%`
+* contain any characters that would need to be encoded for use in urls.
+* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).
+
+### Rules for version field
+
+If `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).
+
+### Rules for license field
+
+The `license` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/package/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license).
+
+## Credits
+
+This package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.
+
+## License
+
+normalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT).
+Copyright (c) 2013 Meryn Stol
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/extract_description.js b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/extract_description.js
new file mode 100644
index 000000000..83f10aa0a
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/extract_description.js
@@ -0,0 +1,14 @@
+module.exports = extractDescription
+
+// Extracts description from contents of a readme file in markdown format
+function extractDescription (d) {
+ if (!d) return;
+ if (d === "ERROR: No README data found!") return;
+ // the first block of text before the first heading
+ // that isn't the first line heading
+ d = d.trim().split('\n')
+ for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++);
+ var l = d.length
+ for (var e = s + 1; e < l && d[e].trim(); e ++);
+ return d.slice(s, e).join(' ').trim()
+}
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/fixer.js b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/fixer.js
new file mode 100644
index 000000000..27682e961
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/fixer.js
@@ -0,0 +1,418 @@
+var semver = require("semver")
+var validateLicense = require('validate-npm-package-license');
+var hostedGitInfo = require("hosted-git-info")
+var isBuiltinModule = require("resolve").isCore
+var depTypes = ["dependencies","devDependencies","optionalDependencies"]
+var extractDescription = require("./extract_description")
+var url = require("url")
+var typos = require("./typos.json")
+
+var fixer = module.exports = {
+ // default warning function
+ warn: function() {},
+
+ fixRepositoryField: function(data) {
+ if (data.repositories) {
+ this.warn("repositories");
+ data.repository = data.repositories[0]
+ }
+ if (!data.repository) return this.warn("missingRepository")
+ if (typeof data.repository === "string") {
+ data.repository = {
+ type: "git",
+ url: data.repository
+ }
+ }
+ var r = data.repository.url || ""
+ if (r) {
+ var hosted = hostedGitInfo.fromUrl(r)
+ if (hosted) {
+ r = data.repository.url
+ = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString()
+ }
+ }
+
+ if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) {
+ this.warn("brokenGitUrl", r)
+ }
+ }
+
+, fixTypos: function(data) {
+ Object.keys(typos.topLevel).forEach(function (d) {
+ if (data.hasOwnProperty(d)) {
+ this.warn("typo", d, typos.topLevel[d])
+ }
+ }, this)
+ }
+
+, fixScriptsField: function(data) {
+ if (!data.scripts) return
+ if (typeof data.scripts !== "object") {
+ this.warn("nonObjectScripts")
+ delete data.scripts
+ return
+ }
+ Object.keys(data.scripts).forEach(function (k) {
+ if (typeof data.scripts[k] !== "string") {
+ this.warn("nonStringScript")
+ delete data.scripts[k]
+ } else if (typos.script[k] && !data.scripts[typos.script[k]]) {
+ this.warn("typo", k, typos.script[k], "scripts")
+ }
+ }, this)
+ }
+
+, fixFilesField: function(data) {
+ var files = data.files
+ if (files && !Array.isArray(files)) {
+ this.warn("nonArrayFiles")
+ delete data.files
+ } else if (data.files) {
+ data.files = data.files.filter(function(file) {
+ if (!file || typeof file !== "string") {
+ this.warn("invalidFilename", file)
+ return false
+ } else {
+ return true
+ }
+ }, this)
+ }
+ }
+
+, fixBinField: function(data) {
+ if (!data.bin) return;
+ if (typeof data.bin === "string") {
+ var b = {}
+ var match
+ if (match = data.name.match(/^@[^/]+[/](.*)$/)) {
+ b[match[1]] = data.bin
+ } else {
+ b[data.name] = data.bin
+ }
+ data.bin = b
+ }
+ }
+
+, fixManField: function(data) {
+ if (!data.man) return;
+ if (typeof data.man === "string") {
+ data.man = [ data.man ]
+ }
+ }
+, fixBundleDependenciesField: function(data) {
+ var bdd = "bundledDependencies"
+ var bd = "bundleDependencies"
+ if (data[bdd] && !data[bd]) {
+ data[bd] = data[bdd]
+ delete data[bdd]
+ }
+ if (data[bd] && !Array.isArray(data[bd])) {
+ this.warn("nonArrayBundleDependencies")
+ delete data[bd]
+ } else if (data[bd]) {
+ data[bd] = data[bd].filter(function(bd) {
+ if (!bd || typeof bd !== 'string') {
+ this.warn("nonStringBundleDependency", bd)
+ return false
+ } else {
+ if (!data.dependencies) {
+ data.dependencies = {}
+ }
+ if (!data.dependencies.hasOwnProperty(bd)) {
+ this.warn("nonDependencyBundleDependency", bd)
+ data.dependencies[bd] = "*"
+ }
+ return true
+ }
+ }, this)
+ }
+ }
+
+, fixDependencies: function(data, strict) {
+ var loose = !strict
+ objectifyDeps(data, this.warn)
+ addOptionalDepsToDeps(data, this.warn)
+ this.fixBundleDependenciesField(data)
+
+ ;['dependencies','devDependencies'].forEach(function(deps) {
+ if (!(deps in data)) return
+ if (!data[deps] || typeof data[deps] !== "object") {
+ 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("nonStringDependency", d, JSON.stringify(r))
+ delete data[deps][d]
+ }
+ var hosted = hostedGitInfo.fromUrl(data[deps][d])
+ if (hosted) data[deps][d] = hosted.toString()
+ }, this)
+ }, this)
+ }
+
+, fixModulesField: function (data) {
+ if (data.modules) {
+ this.warn("deprecatedModules")
+ delete data.modules
+ }
+ }
+
+, fixKeywordsField: function (data) {
+ if (typeof data.keywords === "string") {
+ data.keywords = data.keywords.split(/,\s+/)
+ }
+ if (data.keywords && !Array.isArray(data.keywords)) {
+ delete data.keywords
+ this.warn("nonArrayKeywords")
+ } else if (data.keywords) {
+ data.keywords = data.keywords.filter(function(kw) {
+ if (typeof kw !== "string" || !kw) {
+ this.warn("nonStringKeyword");
+ return false
+ } else {
+ return true
+ }
+ }, this)
+ }
+ }
+
+, fixVersionField: function(data, strict) {
+ // allow "loose" semver 1.0 versions in non-strict mode
+ // enforce strict semver 2.0 compliance in strict mode
+ var loose = !strict
+ if (!data.version) {
+ data.version = ""
+ return true
+ }
+ if (!semver.valid(data.version, loose)) {
+ throw new Error('Invalid version: "'+ data.version + '"')
+ }
+ data.version = semver.clean(data.version, loose)
+ return true
+ }
+
+, fixPeople: function(data) {
+ modifyPeople(data, unParsePerson)
+ modifyPeople(data, parsePerson)
+ }
+
+, fixNameField: function(data, options) {
+ if (typeof options === "boolean") options = {strict: options}
+ else if (typeof options === "undefined") options = {}
+ var strict = options.strict
+ if (!data.name && !strict) {
+ data.name = ""
+ return
+ }
+ if (typeof data.name !== "string") {
+ throw new Error("name field must be a string.")
+ }
+ if (!strict)
+ data.name = data.name.trim()
+ ensureValidName(data.name, strict, options.allowLegacyCase)
+ if (isBuiltinModule(data.name))
+ this.warn("conflictingName", data.name)
+ }
+
+
+, fixDescriptionField: function (data) {
+ if (data.description && typeof data.description !== 'string') {
+ 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("missingDescription")
+ }
+
+, fixReadmeField: function (data) {
+ if (!data.readme) {
+ this.warn("missingReadme")
+ data.readme = "ERROR: No README data found!"
+ }
+ }
+
+, fixBugsField: function(data) {
+ if (!data.bugs && data.repository && data.repository.url) {
+ var hosted = hostedGitInfo.fromUrl(data.repository.url)
+ if(hosted && hosted.bugs()) {
+ data.bugs = {url: hosted.bugs()}
+ }
+ }
+ else if(data.bugs) {
+ var emailRe = /^.+@.*\..+$/
+ if(typeof data.bugs == "string") {
+ if(emailRe.test(data.bugs))
+ data.bugs = {email:data.bugs}
+ else if(url.parse(data.bugs).protocol)
+ data.bugs = {url: data.bugs}
+ else
+ this.warn("nonEmailUrlBugsString")
+ }
+ else {
+ bugsTypos(data.bugs, this.warn)
+ var oldBugs = data.bugs
+ data.bugs = {}
+ if(oldBugs.url) {
+ if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol)
+ data.bugs.url = oldBugs.url
+ else
+ this.warn("nonUrlBugsUrlField")
+ }
+ if(oldBugs.email) {
+ if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email))
+ data.bugs.email = oldBugs.email
+ else
+ this.warn("nonEmailBugsEmailField")
+ }
+ }
+ if(!data.bugs.email && !data.bugs.url) {
+ delete data.bugs
+ this.warn("emptyNormalizedBugs")
+ }
+ }
+ }
+
+, fixHomepageField: function(data) {
+ if (!data.homepage && data.repository && data.repository.url) {
+ var hosted = hostedGitInfo.fromUrl(data.repository.url)
+ if (hosted && hosted.docs()) data.homepage = hosted.docs()
+ }
+ if (!data.homepage) return
+
+ if(typeof data.homepage !== "string") {
+ this.warn("nonUrlHomepage")
+ return delete data.homepage
+ }
+ if(!url.parse(data.homepage).protocol) {
+ data.homepage = "http://" + data.homepage
+ }
+ }
+
+, fixLicenseField: function(data) {
+ if (!data.license) {
+ return this.warn("missingLicense")
+ } else{
+ if (
+ typeof(data.license) !== 'string' ||
+ data.license.length < 1 ||
+ data.license.trim() === ''
+ ) {
+ this.warn("invalidLicense")
+ } else {
+ if (!validateLicense(data.license).validForNewPackages)
+ this.warn("invalidLicense")
+ }
+ }
+ }
+}
+
+function isValidScopedPackageName(spec) {
+ if (spec.charAt(0) !== '@') return false
+
+ var rest = spec.slice(1).split('/')
+ if (rest.length !== 2) return false
+
+ return rest[0] && rest[1] &&
+ rest[0] === encodeURIComponent(rest[0]) &&
+ rest[1] === encodeURIComponent(rest[1])
+}
+
+function isCorrectlyEncodedName(spec) {
+ return !spec.match(/[\/@\s\+%:]/) &&
+ spec === encodeURIComponent(spec)
+}
+
+function ensureValidName (name, strict, allowLegacyCase) {
+ if (name.charAt(0) === "." ||
+ !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) ||
+ (strict && (!allowLegacyCase) && name !== name.toLowerCase()) ||
+ name.toLowerCase() === "node_modules" ||
+ name.toLowerCase() === "favicon.ico") {
+ throw new Error("Invalid name: " + JSON.stringify(name))
+ }
+}
+
+function modifyPeople (data, fn) {
+ if (data.author) data.author = fn(data.author)
+ ;["maintainers", "contributors"].forEach(function (set) {
+ if (!Array.isArray(data[set])) return;
+ data[set] = data[set].map(fn)
+ })
+ return data
+}
+
+function unParsePerson (person) {
+ if (typeof person === "string") return person
+ var name = person.name || ""
+ var u = person.url || person.web
+ var url = u ? (" ("+u+")") : ""
+ var e = person.email || person.mail
+ var email = e ? (" <"+e+">") : ""
+ return name+email+url
+}
+
+function parsePerson (person) {
+ if (typeof person !== "string") return person
+ var name = person.match(/^([^\(<]+)/)
+ var url = person.match(/\(([^\)]+)\)/)
+ var email = person.match(/<([^>]+)>/)
+ var obj = {}
+ if (name && name[0].trim()) obj.name = name[0].trim()
+ if (email) obj.email = email[1];
+ if (url) obj.url = url[1];
+ return obj
+}
+
+function addOptionalDepsToDeps (data, warn) {
+ var o = data.optionalDependencies
+ if (!o) return;
+ var d = data.dependencies || {}
+ Object.keys(o).forEach(function (k) {
+ d[k] = o[k]
+ })
+ data.dependencies = d
+}
+
+function depObjectify (deps, type, warn) {
+ if (!deps) return {}
+ if (typeof deps === "string") {
+ deps = deps.trim().split(/[\n\r\s\t ,]+/)
+ }
+ if (!Array.isArray(deps)) return deps
+ warn("deprecatedArrayDependencies", type)
+ var o = {}
+ deps.filter(function (d) {
+ return typeof d === "string"
+ }).forEach(function(d) {
+ d = d.trim().split(/(:?[@\s><=])/)
+ var dn = d.shift()
+ var dv = d.join("")
+ dv = dv.trim()
+ dv = dv.replace(/^@/, "")
+ o[dn] = dv
+ })
+ return o
+}
+
+function objectifyDeps (data, warn) {
+ depTypes.forEach(function (type) {
+ if (!data[type]) return;
+ data[type] = depObjectify(data[type], type, warn)
+ })
+}
+
+function bugsTypos(bugs, warn) {
+ if (!bugs) return
+ Object.keys(bugs).forEach(function (k) {
+ if (typos.bugs[k]) {
+ warn("typo", k, typos.bugs[k], "bugs")
+ bugs[typos.bugs[k]] = bugs[k]
+ delete bugs[k]
+ }
+ })
+}
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/make_warning.js b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/make_warning.js
new file mode 100644
index 000000000..4ac74ad7c
--- /dev/null
+++ b/node_modules/libnpmpublish/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)
+}
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/normalize.js b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/normalize.js
new file mode 100644
index 000000000..bd1bfef12
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/normalize.js
@@ -0,0 +1,39 @@
+module.exports = normalize
+
+var fixer = require("./fixer")
+normalize.fixer = fixer
+
+var makeWarning = require("./make_warning")
+
+var fieldsToFix = ['name','version','description','repository','modules','scripts'
+ ,'files','bin','man','bugs','keywords','readme','homepage','license']
+var otherThingsToFix = ['dependencies','people', 'typos']
+
+var thingsToFix = fieldsToFix.map(function(fieldName) {
+ return ucFirst(fieldName) + "Field"
+})
+// two ways to do this in CoffeeScript on only one line, sub-70 chars:
+// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field"
+// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix)
+thingsToFix = thingsToFix.concat(otherThingsToFix)
+
+function normalize (data, warn, strict) {
+ if(warn === true) warn = null, strict = true
+ if(!strict) strict = false
+ if(!warn || data.private) warn = function(msg) { /* noop */ }
+
+ if (data.scripts &&
+ data.scripts.install === "node-gyp rebuild" &&
+ !data.scripts.preinstall) {
+ data.gypfile = true
+ }
+ fixer.warn = function() { warn(makeWarning.apply(null, arguments)) }
+ thingsToFix.forEach(function(thingName) {
+ fixer["fix" + ucFirst(thingName)](data, strict)
+ })
+ data._id = data.name + "@" + data.version
+}
+
+function ucFirst (string) {
+ return string.charAt(0).toUpperCase() + string.slice(1);
+}
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/safe_format.js b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/safe_format.js
new file mode 100644
index 000000000..b07f1006d
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/safe_format.js
@@ -0,0 +1,9 @@
+var util = require('util')
+
+module.exports = function() {
+ var args = Array.prototype.slice.call(arguments, 0)
+ args.forEach(function(arg) {
+ if (!arg) throw new TypeError('Bad arguments.')
+ })
+ return util.format.apply(null, arguments)
+}
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/typos.json b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/typos.json
new file mode 100644
index 000000000..7f9dd283b
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/typos.json
@@ -0,0 +1,25 @@
+{
+ "topLevel": {
+ "dependancies": "dependencies"
+ ,"dependecies": "dependencies"
+ ,"depdenencies": "dependencies"
+ ,"devEependencies": "devDependencies"
+ ,"depends": "dependencies"
+ ,"dev-dependencies": "devDependencies"
+ ,"devDependences": "devDependencies"
+ ,"devDepenencies": "devDependencies"
+ ,"devdependencies": "devDependencies"
+ ,"repostitory": "repository"
+ ,"repo": "repository"
+ ,"prefereGlobal": "preferGlobal"
+ ,"hompage": "homepage"
+ ,"hampage": "homepage"
+ ,"autohr": "author"
+ ,"autor": "author"
+ ,"contributers": "contributors"
+ ,"publicationConfig": "publishConfig"
+ ,"script": "scripts"
+ },
+ "bugs": { "web": "url", "name": "url" },
+ "script": { "server": "start", "tests": "test" }
+}
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/warning_messages.json b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/warning_messages.json
new file mode 100644
index 000000000..4890f506e
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/lib/warning_messages.json
@@ -0,0 +1,30 @@
+{
+ "repositories": "'repositories' (plural) Not supported. Please pick one as the 'repository' field"
+ ,"missingRepository": "No repository field."
+ ,"brokenGitUrl": "Probably broken git url: %s"
+ ,"nonObjectScripts": "scripts must be an object"
+ ,"nonStringScript": "script values must be string commands"
+ ,"nonArrayFiles": "Invalid 'files' member"
+ ,"invalidFilename": "Invalid filename in 'files' list: %s"
+ ,"nonArrayBundleDependencies": "Invalid 'bundleDependencies' list. Must be array of package names"
+ ,"nonStringBundleDependency": "Invalid bundleDependencies member: %s"
+ ,"nonDependencyBundleDependency": "Non-dependency in bundleDependencies: %s"
+ ,"nonObjectDependencies": "%s field must be an object"
+ ,"nonStringDependency": "Invalid dependency: %s %s"
+ ,"deprecatedArrayDependencies": "specifying %s as array is deprecated"
+ ,"deprecatedModules": "modules field is deprecated"
+ ,"nonArrayKeywords": "keywords should be an array of strings"
+ ,"nonStringKeyword": "keywords should be an array of strings"
+ ,"conflictingName": "%s is also the name of a node core module."
+ ,"nonStringDescription": "'description' field should be a string"
+ ,"missingDescription": "No description"
+ ,"missingReadme": "No README data"
+ ,"missingLicense": "No license field."
+ ,"nonEmailUrlBugsString": "Bug string field must be url, email, or {email,url}"
+ ,"nonUrlBugsUrlField": "bugs.url field must be a string url. Deleted."
+ ,"nonEmailBugsEmailField": "bugs.email field must be a string email. Deleted."
+ ,"emptyNormalizedBugs": "Normalized value of bugs field is an empty object. Deleted."
+ ,"nonUrlHomepage": "homepage field must be a string url. Deleted."
+ ,"invalidLicense": "license should be a valid SPDX license expression"
+ ,"typo": "%s should probably be %s."
+}
diff --git a/node_modules/libnpmpublish/node_modules/normalize-package-data/package.json b/node_modules/libnpmpublish/node_modules/normalize-package-data/package.json
new file mode 100644
index 000000000..8df2f8fca
--- /dev/null
+++ b/node_modules/libnpmpublish/node_modules/normalize-package-data/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "normalize-package-data",
+ "version": "3.0.0",
+ "author": "Meryn Stol <merynstol@gmail.com>",
+ "description": "Normalizes data that can be found in package.json files.",
+ "license": "BSD-2-Clause",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/npm/normalize-package-data.git"
+ },
+ "main": "lib/normalize.js",
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "dependencies": {
+ "hosted-git-info": "^3.0.6",
+ "resolve": "^1.17.0",
+ "semver": "^7.3.2",
+ "validate-npm-package-license": "^3.0.1"
+ },
+ "devDependencies": {
+ "tap": "^14.10.8"
+ },
+ "files": [
+ "lib/*.js",
+ "lib/*.json",
+ "AUTHORS"
+ ],
+ "engines": {
+ "node": ">=10"
+ }
+}
diff --git a/node_modules/libnpmpublish/package.json b/node_modules/libnpmpublish/package.json
index 16236da75..91d918ef2 100644
--- a/node_modules/libnpmpublish/package.json
+++ b/node_modules/libnpmpublish/package.json
@@ -1,6 +1,6 @@
{
"name": "libnpmpublish",
- "version": "3.0.1",
+ "version": "3.0.2",
"description": "Programmatic API for the bits behind npm publish and unpublish",
"author": "npm Inc. <support@npmjs.com>",
"contributors": [
@@ -37,9 +37,9 @@
"dependencies": {
"libnpmpack": "^2.0.0",
"lodash.clonedeep": "^4.5.0",
- "normalize-package-data": "^2.5.0",
- "npm-package-arg": "^8.0.0",
- "npm-registry-fetch": "^8.0.0",
+ "normalize-package-data": "^3.0.0",
+ "npm-package-arg": "^8.1.0",
+ "npm-registry-fetch": "^8.1.5",
"semver": "^7.1.3",
"ssri": "^8.0.0"
},