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

Deps for [email protected] #6859

Merged
merged 7 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,6 @@ packages higher up the chain.
- pacote, libnpmhook, libnpmorg, libnpmsearch, libnpmteam, npm-profile
- npm-registry-fetch, @npmcli/package-json, libnpmversion
- @npmcli/git, make-fetch-happen, @npmcli/config, init-package-json
- npm-pick-manifest, @npmcli/installed-package-contents, @npmcli/run-script, cacache, read-package-json, @npmcli/map-workspaces, promzard
- @npmcli/docs, npm-package-arg, npm-install-checks, npm-bundled, read-package-json-fast, @npmcli/fs, unique-filename, npm-packlist, normalize-package-data, @npmcli/mock-globals, bin-links, nopt, npmlog, parse-conflict-json, read
- @npmcli/eslint-config, @npmcli/template-oss, ignore-walk, semver, hosted-git-info, proc-log, validate-npm-package-name, @npmcli/promise-spawn, npm-normalize-package-bin, @npmcli/node-gyp, json-parse-even-better-errors, fs-minipass, ssri, unique-slug, @npmcli/agent, minipass-fetch, @npmcli/name-from-folder, @npmcli/query, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, minify-registry-metadata, ini, @npmcli/disparity-colors, mute-stream, npm-audit-report, npm-user-validate
- @npmcli/installed-package-contents, @npmcli/map-workspaces, cacache, npm-pick-manifest, @npmcli/run-script, read-package-json, promzard
- @npmcli/docs, @npmcli/fs, npm-bundled, read-package-json-fast, unique-filename, npm-install-checks, npm-package-arg, npm-packlist, normalize-package-data, bin-links, nopt, npmlog, parse-conflict-json, @npmcli/mock-globals, read
- @npmcli/eslint-config, @npmcli/template-oss, ignore-walk, semver, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, fs-minipass, ssri, unique-slug, @npmcli/promise-spawn, hosted-git-info, proc-log, validate-npm-package-name, @npmcli/node-gyp, @npmcli/agent, minipass-fetch, @npmcli/query, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, minify-registry-metadata, ini, @npmcli/disparity-colors, mute-stream, npm-audit-report, npm-user-validate
4 changes: 2 additions & 2 deletions mock-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
]
},
"devDependencies": {
"@npmcli/arborist": "^6.1.1",
"@npmcli/arborist": "^7.1.0",
"@npmcli/eslint-config": "^4.0.1",
"@npmcli/template-oss": "4.19.0",
"json-stringify-safe": "^5.0.1",
"nock": "^13.3.3",
"npm-package-arg": "^11.0.0",
"npm-package-arg": "^11.0.1",
"pacote": "^17.0.4",
"tap": "^16.3.8"
}
Expand Down
60 changes: 42 additions & 18 deletions node_modules/@npmcli/query/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,57 @@ const fixupNestedPseudo = astNode => {
transformAst(newRootNode)
}

// :semver(<version|range>, [selector], [function])
// :semver(<version|range|selector>, [version|range|selector], [function])
// note: the first or second parameter must be a static version or range
const fixupSemverSpecs = astNode => {
// 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) {
// if we have three nodes, the last is the semver function to use, pull that out first
if (astNode.nodes.length === 3) {
const funcNode = astNode.nodes.pop().nodes[0]
if (funcNode.type === 'tag') {
semverFunc = funcNode.value
astNode.semverFunc = funcNode.value
} else if (funcNode.type === 'string') {
// a string is always in some type of quotes, we don't want those so slice them off
astNode.semverFunc = funcNode.value.slice(1, -1)
} else {
// anything that isn't a tag or a string isn't a function name
throw Object.assign(
new Error('`:semver` pseudo-class expects a function name as last value'),
{ code: 'ESEMVERFUNC' }
)
}
}

// now if we have 1 node, it's a static value
// istanbul ignore else
if (astNode.nodes.length === 1) {
const semverNode = astNode.nodes.pop()
astNode.semverValue = semverNode.nodes.reduce((res, next) => `${res}${String(next)}`, '')
} else if (astNode.nodes.length === 2) {
// and if we have two nodes, one of them is a static value and we need to determine which it is
for (let i = 0; i < astNode.nodes.length; ++i) {
const type = astNode.nodes[i].nodes[0].type
// the type of the first child may be combinator for ranges, such as >14
if (type === 'tag' || type === 'combinator') {
const semverNode = astNode.nodes.splice(i, 1)[0]
astNode.semverValue = semverNode.nodes.reduce((res, next) => `${res}${String(next)}`, '')
astNode.semverPosition = i
break
}
}

if (typeof astNode.semverValue === 'undefined') {
throw Object.assign(
new Error('`:semver` pseudo-class expects a static value in the first or second position'),
{ code: 'ESEMVERVALUE' }
)
}
}

// 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 we got here, the last remaining child should be attribute selector
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
// if we don't have a selector, we default to `[version]`
astNode.attributeMatcher = {
insensitive: false,
attribute: 'version',
Expand All @@ -118,8 +144,6 @@ const fixupSemverSpecs = astNode => {
astNode.lookupProperties = []
}

astNode.semverFunc = semverFunc
astNode.semverValue = value
astNode.nodes.length = 0
}

Expand Down
9 changes: 5 additions & 4 deletions node_modules/@npmcli/query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/query",
"version": "3.0.0",
"version": "3.0.1",
"description": "npm query parser and tools",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -39,11 +39,12 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.5.1"
"version": "4.18.0",
"publish": true
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "4.5.1",
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.18.0",
"tap": "^16.2.0"
},
"dependencies": {
Expand Down
4 changes: 0 additions & 4 deletions node_modules/glob/dist/cjs/package.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ class Glob {
return set;
}, [[], []]);
this.patterns = matchSet.map((set, i) => {
return new pattern_js_1.Pattern(set, globParts[i], 0, this.platform);
const g = globParts[i];
/* c8 ignore start */
if (!g)
throw new Error('invalid pattern object');
/* c8 ignore stop */
return new pattern_js_1.Pattern(set, g, 0, this.platform);
});
}
async walk() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class Ignore {
for (let i = 0; i < mm.set.length; i++) {
const parsed = mm.set[i];
const globParts = mm.globParts[i];
/* c8 ignore start */
if (!parsed || !globParts) {
throw new Error('invalid pattern object');
}
/* c8 ignore stop */
const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform);
const m = new minimatch_1.Minimatch(p.globString(), mmopts);
const children = globParts[globParts.length - 1] === '**';
Expand Down Expand Up @@ -94,7 +99,7 @@ class Ignore {
}
for (const m of this.absoluteChildren) {
if (m.match(fullpath))
true;
return true;
}
return false;
}
Expand Down
1 change: 1 addition & 0 deletions node_modules/glob/dist/commonjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"commonjs"}
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ class Processor {
while (typeof (p = pattern.pattern()) === 'string' &&
(rest = pattern.rest())) {
const c = t.resolve(p);
// we can be reasonably sure that .. is a readable dir
if (c.isUnknown() && p !== '..')
break;
t = c;
pattern = rest;
changed = true;
Expand All @@ -156,14 +153,10 @@ class Processor {
// more strings for an unknown entry,
// or a pattern starting with magic, mounted on t.
if (typeof p === 'string') {
// must be final entry
if (!rest) {
const ifDir = p === '..' || p === '' || p === '.';
this.matches.add(t.resolve(p), absolute, ifDir);
}
else {
this.subwalks.add(t, pattern);
}
// must not be final entry, otherwise we would have
// concatenated it earlier.
const ifDir = p === '..' || p === '' || p === '.';
this.matches.add(t.resolve(p), absolute, ifDir);
continue;
}
else if (p === minimatch_1.GLOBSTAR) {
Expand Down
3 changes: 3 additions & 0 deletions node_modules/glob/dist/esm/bin.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node
export {};
//# sourceMappingURL=bin.d.mts.map
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const foreground_child_1 = require("foreground-child");
const fs_1 = require("fs");
const jackspeak_1 = require("jackspeak");
const package_json_1 = require("../package.json");
const index_js_1 = require("./index.js");
const j = (0, jackspeak_1.jack)({
import { foregroundChild } from 'foreground-child';
import { existsSync } from 'fs';
import { readFile } from 'fs/promises';
import { jack } from 'jackspeak';
import { join } from 'path';
import { fileURLToPath } from 'url';
import { globStream } from './index.js';
/* c8 ignore start */
const { version } = JSON.parse(await readFile(fileURLToPath(new URL('../../package.json', import.meta.url)), 'utf8').catch(() => readFile(fileURLToPath(new URL('../../package.json', import.meta.url)), 'utf8')));
/* c8 ignore stop */
const j = jack({
usage: 'glob [options] [<pattern> [<pattern> ...]]',
})
.description(`
Glob v${package_json_1.version}
Glob v${version}

Expand the positional glob expression arguments into any matching file
system paths found.
Expand Down Expand Up @@ -228,9 +231,11 @@ try {
positionals.push(values.default);
const patterns = values.all
? positionals
: positionals.filter(p => !(0, fs_1.existsSync)(p));
const matches = values.all ? [] : positionals.filter(p => (0, fs_1.existsSync)(p));
const stream = (0, index_js_1.globStream)(patterns, {
: positionals.filter(p => !existsSync(p));
const matches = values.all
? []
: positionals.filter(p => existsSync(p)).map(p => join(p));
const stream = globStream(patterns, {
absolute: values.absolute,
cwd: values.cwd,
dot: values.dot,
Expand Down Expand Up @@ -259,12 +264,12 @@ try {
}
else {
stream.on('data', f => matches.push(f));
stream.on('end', () => (0, foreground_child_1.foregroundChild)(cmd, matches, { shell: true }));
stream.on('end', () => foregroundChild(cmd, matches, { shell: true }));
}
}
catch (e) {
console.error(j.usage());
console.error(e instanceof Error ? e.message : String(e));
process.exit(1);
}
//# sourceMappingURL=bin.js.map
//# sourceMappingURL=bin.mjs.map
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ export class Glob {
return set;
}, [[], []]);
this.patterns = matchSet.map((set, i) => {
return new Pattern(set, globParts[i], 0, this.platform);
const g = globParts[i];
/* c8 ignore start */
if (!g)
throw new Error('invalid pattern object');
/* c8 ignore stop */
return new Pattern(set, g, 0, this.platform);
});
}
async walk() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export class Ignore {
for (let i = 0; i < mm.set.length; i++) {
const parsed = mm.set[i];
const globParts = mm.globParts[i];
/* c8 ignore start */
if (!parsed || !globParts) {
throw new Error('invalid pattern object');
}
/* c8 ignore stop */
const p = new Pattern(parsed, globParts, 0, platform);
const m = new Minimatch(p.globString(), mmopts);
const children = globParts[globParts.length - 1] === '**';
Expand Down Expand Up @@ -91,7 +96,7 @@ export class Ignore {
}
for (const m of this.absoluteChildren) {
if (m.match(fullpath))
true;
return true;
}
return false;
}
Expand Down
1 change: 1 addition & 0 deletions node_modules/glob/dist/esm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"module"}
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ export class Processor {
while (typeof (p = pattern.pattern()) === 'string' &&
(rest = pattern.rest())) {
const c = t.resolve(p);
// we can be reasonably sure that .. is a readable dir
if (c.isUnknown() && p !== '..')
break;
t = c;
pattern = rest;
changed = true;
Expand All @@ -150,14 +147,10 @@ export class Processor {
// more strings for an unknown entry,
// or a pattern starting with magic, mounted on t.
if (typeof p === 'string') {
// must be final entry
if (!rest) {
const ifDir = p === '..' || p === '' || p === '.';
this.matches.add(t.resolve(p), absolute, ifDir);
}
else {
this.subwalks.add(t, pattern);
}
// must not be final entry, otherwise we would have
// concatenated it earlier.
const ifDir = p === '..' || p === '' || p === '.';
this.matches.add(t.resolve(p), absolute, ifDir);
continue;
}
else if (p === GLOBSTAR) {
Expand Down
4 changes: 0 additions & 4 deletions node_modules/glob/dist/mjs/package.json

This file was deleted.

Loading
Loading