Skip to content

Commit

Permalink
deps: @npmcli/[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Jun 29, 2022
1 parent 261f4c4 commit 3d043f3
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 18 deletions.
18 changes: 16 additions & 2 deletions node_modules/@npmcli/query/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,28 @@ const fixupAttr = astNode => {
if (attributeAstNode.value === ':attr') {
const appendParts = fixupAttr(attributeAstNode)
properties.push(arrayDelimiter, ...appendParts.lookupProperties)
matcher.attribute = appendParts.attributeMatcher.attribute
matcher.qualifiedAttribute = appendParts.attributeMatcher.qualifiedAttribute
matcher.operator = appendParts.attributeMatcher.operator
matcher.value = appendParts.attributeMatcher.value

// backwards compatibility
matcher.attribute = appendParts.attributeMatcher.attribute

if (appendParts.attributeMatcher.insensitive) {
matcher.insensitive = true
}
} else {
matcher.attribute = attributeAstNode.qualifiedAttribute
matcher.qualifiedAttribute = attributeAstNode.qualifiedAttribute
matcher.operator = attributeAstNode.operator || ''
matcher.value = attributeAstNode.value

// backwards compatibility
matcher.attribute = attributeAstNode.qualifiedAttribute

if (attributeAstNode.insensitive) {
matcher.insensitive = true
}

if (attributeAstNode.type !== 'attribute') {
throw Object.assign(
new Error('`:attr` pseudo-class expects an attribute matcher as the last value'),
Expand Down
3 changes: 2 additions & 1 deletion node_modules/@npmcli/query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/query",
"version": "1.0.1",
"version": "1.1.0",
"description": "npm query parser and tools",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -50,6 +50,7 @@
"tap": "^16.2.0"
},
"dependencies": {
"npm-package-arg": "^9.1.0",
"postcss-selector-parser": "^6.0.10",
"semver": "^7.3.7"
},
Expand Down
44 changes: 40 additions & 4 deletions node_modules/npm-package-arg/lib/npa.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const semver = require('semver')
const path = global.FAKE_WINDOWS ? require('path').win32 : require('path')
const validatePackageName = require('validate-npm-package-name')
const { homedir } = require('os')
const log = require('proc-log')

const isWindows = process.platform === 'win32' || global.FAKE_WINDOWS
const hasSlashes = isWindows ? /\\|[/]/ : /[/]/
Expand Down Expand Up @@ -120,6 +121,7 @@ function Result (opts) {
}
this.gitRange = opts.gitRange
this.gitCommittish = opts.gitCommittish
this.gitSubdir = opts.gitSubdir
this.hosted = opts.hosted
}

Expand Down Expand Up @@ -155,11 +157,45 @@ Result.prototype.toJSON = function () {
}

function setGitCommittish (res, committish) {
if (committish != null && committish.length >= 7 && committish.slice(0, 7) === 'semver:') {
res.gitRange = decodeURIComponent(committish.slice(7))
if (!committish) {
res.gitCommittish = null
} else {
res.gitCommittish = committish === '' ? null : committish
return res
}

// for each :: separated item:
for (const part of committish.split('::')) {
// if the item has no : the n it is a commit-ish
if (!part.includes(':')) {
if (res.gitRange) {
throw new Error('cannot override existing semver range with a committish')
}
if (res.gitCommittish) {
throw new Error('cannot override existing committish with a second committish')
}
res.gitCommittish = part
continue
}
// split on name:value
const [name, value] = part.split(':')
// if name is semver do semver lookup of ref or tag
if (name === 'semver') {
if (res.gitCommittish) {
throw new Error('cannot override existing committish with a semver range')
}
if (res.gitRange) {
throw new Error('cannot override existing semver range with a second semver range')
}
res.gitRange = decodeURIComponent(value)
continue
}
if (name === 'path') {
if (res.gitSubdir) {
throw new Error('cannot override existing path with a second path')
}
res.gitSubdir = `/${value}`
continue
}
log.warn('npm-package-arg', `ignoring unknown key "${name}"`)
}

return res
Expand Down
7 changes: 4 additions & 3 deletions node_modules/npm-package-arg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npm-package-arg",
"version": "9.0.2",
"version": "9.1.0",
"description": "Parse the things that can be arguments to `npm install`",
"main": "./lib/npa.js",
"directories": {
Expand All @@ -12,12 +12,13 @@
],
"dependencies": {
"hosted-git-info": "^5.0.0",
"proc-log": "^2.0.1",
"semver": "^7.3.5",
"validate-npm-package-name": "^4.0.0"
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.2.1",
"@npmcli/template-oss": "3.5.0",
"tap": "^16.0.1"
},
"scripts": {
Expand Down Expand Up @@ -52,6 +53,6 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.2.1"
"version": "3.5.0"
}
}
16 changes: 9 additions & 7 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1042,10 +1042,11 @@
}
},
"node_modules/@npmcli/query": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@npmcli/query/-/query-1.0.1.tgz",
"integrity": "sha512-EcRKJ+SxFeCOByE8PnZAVMXqaXm8D+jjIEJD8MbAkPc11MI8XWNKnSL4EzAmygMhvaXMc7OUBCCv9oziUvD09w==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@npmcli/query/-/query-1.1.0.tgz",
"integrity": "sha512-MQWugz9zqVS3w3ccaC3tN6oruM9W8sLPahdUu6No85Rn3EIppMYISdxnxDnYuQbVO1YVaa2kkWJ/jixCWZ59tg==",
"dependencies": {
"npm-package-arg": "^9.1.0",
"postcss-selector-parser": "^6.0.10",
"semver": "^7.3.7"
},
Expand Down Expand Up @@ -5149,12 +5150,13 @@
"license": "ISC"
},
"node_modules/npm-package-arg": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.2.tgz",
"integrity": "sha512-v/miORuX8cndiOheW8p2moNuPJ7QhcFh9WGlTorruG8hXSA23vMTEp5hTCmDxic0nD8KHhj/NQgFuySD3GYY3g==",
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.0.tgz",
"integrity": "sha512-4J0GL+u2Nh6OnhvUKXRr2ZMG4lR8qtLp+kv7UiV00Y+nGiSxtttCyIRHCt5L5BNkXQld/RceYItau3MDOoGiBw==",
"inBundle": true,
"dependencies": {
"hosted-git-info": "^5.0.0",
"proc-log": "^2.0.1",
"semver": "^7.3.5",
"validate-npm-package-name": "^4.0.0"
},
Expand Down Expand Up @@ -10039,7 +10041,7 @@
"@npmcli/name-from-folder": "^1.0.1",
"@npmcli/node-gyp": "^2.0.0",
"@npmcli/package-json": "^2.0.0",
"@npmcli/query": "^1.0.1",
"@npmcli/query": "^1.1.0",
"@npmcli/run-script": "^4.1.3",
"bin-links": "^3.0.0",
"cacache": "^16.0.6",
Expand Down
2 changes: 1 addition & 1 deletion workspaces/arborist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@npmcli/name-from-folder": "^1.0.1",
"@npmcli/node-gyp": "^2.0.0",
"@npmcli/package-json": "^2.0.0",
"@npmcli/query": "^1.0.1",
"@npmcli/query": "^1.1.0",
"@npmcli/run-script": "^4.1.3",
"bin-links": "^3.0.0",
"cacache": "^16.0.6",
Expand Down

0 comments on commit 3d043f3

Please sign in to comment.