Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lk/deps #5381

Merged
merged 12 commits into from Aug 25, 2022
Merged

lk/deps #5381

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,15 @@
The ISC License

Copyright (c) npm, Inc. and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,30 @@
{
"name": "npm-bundled",
"version": "1.1.2",
"description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/npm-bundled.git"
},
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "ISC",
"devDependencies": {
"mkdirp": "^0.5.1",
"mutate-fs": "^1.1.0",
"rimraf": "^2.6.1",
"tap": "^12.0.1"
},
"scripts": {
"test": "tap test/*.js -J --100",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
},
"files": [
"index.js"
],
"dependencies": {
"npm-normalize-package-bin": "^1.0.1"
}
}
32 changes: 31 additions & 1 deletion node_modules/@npmcli/query/lib/index.js
Expand Up @@ -118,10 +118,40 @@ const fixupNestedPseudo = astNode => {
transformAst(newRootNode)
}

// :semver(<version|range>, [selector], [function])
const fixupSemverSpecs = astNode => {
const children = astNode.nodes[0].nodes
// the first child node contains the version or range, most likely as a tag and a series of
// classes. we combine them into a single string here. this is the only required input.
const children = astNode.nodes.shift().nodes
const value = children.reduce((res, i) => `${res}${String(i)}`, '')

// next, if we have 2 nodes left then the user called us with a total of 3. that means the
// last one tells us what specific semver function the user is requesting, so we pull that out
let semverFunc
if (astNode.nodes.length === 2) {
const funcNode = astNode.nodes.pop().nodes[0]
if (funcNode.type === 'tag') {
semverFunc = funcNode.value
}
}

// now if there's a node left, that node is our selector. since that is the last remaining
// child node, we call fixupAttr on ourselves so that the attribute selectors get parsed
if (astNode.nodes.length === 1) {
fixupAttr(astNode)
} else {
// we weren't provided a selector, so we default to `[version]`. note, there's no default
// operator here. that's because we don't know yet if the user has provided us a version
// or range to assert against
astNode.attributeMatcher = {
insensitive: false,
attribute: 'version',
qualifiedAttribute: 'version',
}
astNode.lookupProperties = []
}

astNode.semverFunc = semverFunc
astNode.semverValue = value
astNode.nodes.length = 0
}
Expand Down
2 changes: 1 addition & 1 deletion node_modules/@npmcli/query/package.json
@@ -1,6 +1,6 @@
{
"name": "@npmcli/query",
"version": "1.1.1",
"version": "1.2.0",
"description": "npm query parser and tools",
"main": "lib/index.js",
"scripts": {
Expand Down
@@ -0,0 +1,15 @@
The ISC License

Copyright (c) npm, Inc.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,64 @@
// pass in a manifest with a 'bin' field here, and it'll turn it
// into a properly santized bin object
const { join, basename } = require('path')

const normalize = pkg =>
!pkg.bin ? removeBin(pkg)
: typeof pkg.bin === 'string' ? normalizeString(pkg)
: Array.isArray(pkg.bin) ? normalizeArray(pkg)
: typeof pkg.bin === 'object' ? normalizeObject(pkg)
: removeBin(pkg)

const normalizeString = pkg => {
if (!pkg.name) {
return removeBin(pkg)
}
pkg.bin = { [pkg.name]: pkg.bin }
return normalizeObject(pkg)
}

const normalizeArray = pkg => {
pkg.bin = pkg.bin.reduce((acc, k) => {
acc[basename(k)] = k
return acc
}, {})
return normalizeObject(pkg)
}

const removeBin = pkg => {
delete pkg.bin
return pkg
}

const normalizeObject = pkg => {
const orig = pkg.bin
const clean = {}
let hasBins = false
Object.keys(orig).forEach(binKey => {
const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1)

if (typeof orig[binKey] !== 'string' || !base) {
return
}

const binTarget = join('/', orig[binKey])
.replace(/\\/g, '/').slice(1)

if (!binTarget) {
return
}

clean[base] = binTarget
hasBins = true
})

if (hasBins) {
pkg.bin = clean
} else {
delete pkg.bin
}

return pkg
}

module.exports = normalize
@@ -0,0 +1,41 @@
{
"name": "npm-normalize-package-bin",
"version": "2.0.0",
"description": "Turn any flavor of allowable package.json bin into a normalized object",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/npm/npm-normalize-package-bin.git"
},
"author": "GitHub Inc.",
"license": "ISC",
"scripts": {
"test": "tap",
"snap": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --follow-tags",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"prepublishOnly": "git push origin --follow-tags",
"posttest": "npm run lint"
},
"devDependencies": {
"@npmcli/eslint-config": "^3.1.0",
"@npmcli/template-oss": "3.5.0",
"tap": "^16.3.0"
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.5.0"
}
}
4 changes: 2 additions & 2 deletions node_modules/bin-links/package.json
@@ -1,6 +1,6 @@
{
"name": "bin-links",
"version": "3.0.2",
"version": "3.0.3",
"description": "JavaScript package binary linker",
"main": "./lib/index.js",
"scripts": {
Expand Down Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"cmd-shim": "^5.0.0",
"mkdirp-infer-owner": "^2.0.0",
"npm-normalize-package-bin": "^1.0.0",
"npm-normalize-package-bin": "^2.0.0",
"read-cmd-shim": "^3.0.0",
"rimraf": "^3.0.0",
"write-file-atomic": "^4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions node_modules/cacache/package.json
@@ -1,6 +1,6 @@
{
"name": "cacache",
"version": "16.1.2",
"version": "16.1.3",
"cache-version": {
"content": "2",
"index": "5"
Expand Down Expand Up @@ -65,7 +65,7 @@
"rimraf": "^3.0.2",
"ssri": "^9.0.0",
"tar": "^6.1.11",
"unique-filename": "^1.1.1"
"unique-filename": "^2.0.0"
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
Expand Down
53 changes: 49 additions & 4 deletions node_modules/diff/dist/diff.js
@@ -1,3 +1,40 @@
/*!

diff v5.1.0

Software License Agreement (BSD License)

Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>

All rights reserved.

Redistribution and use of this software in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.

* 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.

* Neither the name of Kevin Decker nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
@license
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
Expand Down Expand Up @@ -38,6 +75,11 @@
oldLen = oldString.length;
var editLength = 1;
var maxEditLength = newLen + oldLen;

if (options.maxEditLength) {
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
}

var bestPath = [{
newPos: -1,
components: []
Expand Down Expand Up @@ -102,15 +144,13 @@
editLength++;
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
// sync and async mode which is never fun. Loops over execEditLength until a value
// is produced.
// is produced, or until the edit length exceeds options.maxEditLength (if given),
// in which case it will return undefined.


if (callback) {
(function exec() {
setTimeout(function () {
// This should not happen, but we want to be safe.

/* istanbul ignore next */
if (editLength > maxEditLength) {
return callback();
}
Expand Down Expand Up @@ -928,6 +968,11 @@
}

var diff = diffLines(oldStr, newStr, options);

if (!diff) {
return;
}

diff.push({
value: '',
lines: []
Expand Down
38 changes: 38 additions & 0 deletions node_modules/diff/dist/diff.min.js

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions node_modules/diff/lib/diff/base.js

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions node_modules/diff/lib/index.es6.js
Expand Up @@ -32,6 +32,11 @@ Diff.prototype = {
oldLen = oldString.length;
var editLength = 1;
var maxEditLength = newLen + oldLen;

if (options.maxEditLength) {
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
}

var bestPath = [{
newPos: -1,
components: []
Expand Down Expand Up @@ -96,15 +101,13 @@ Diff.prototype = {
editLength++;
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
// sync and async mode which is never fun. Loops over execEditLength until a value
// is produced.
// is produced, or until the edit length exceeds options.maxEditLength (if given),
// in which case it will return undefined.


if (callback) {
(function exec() {
setTimeout(function () {
// This should not happen, but we want to be safe.

/* istanbul ignore next */
if (editLength > maxEditLength) {
return callback();
}
Expand Down Expand Up @@ -922,6 +925,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
}

var diff = diffLines(oldStr, newStr, options);

if (!diff) {
return;
}

diff.push({
value: '',
lines: []
Expand Down