Skip to content

Commit 81137fc

Browse files
committed
deps: update @npmcli/[email protected]
1 parent 2076368 commit 81137fc

File tree

33 files changed

+1458
-56
lines changed

33 files changed

+1458
-56
lines changed

Diff for: node_modules/.gitignore

+11-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
!/@npmcli/agent
1919
!/@npmcli/fs
2020
!/@npmcli/git
21+
!/@npmcli/git/node_modules/
22+
/@npmcli/git/node_modules/*
23+
!/@npmcli/git/node_modules/@npmcli/
24+
/@npmcli/git/node_modules/@npmcli/*
25+
!/@npmcli/git/node_modules/@npmcli/promise-spawn
2126
!/@npmcli/installed-package-contents
2227
!/@npmcli/map-workspaces
2328
!/@npmcli/map-workspaces/node_modules/
@@ -34,7 +39,6 @@
3439
!/@npmcli/package-json/node_modules/@npmcli/
3540
/@npmcli/package-json/node_modules/@npmcli/*
3641
!/@npmcli/package-json/node_modules/@npmcli/git
37-
!/@npmcli/package-json/node_modules/@npmcli/promise-spawn
3842
!/@npmcli/package-json/node_modules/hosted-git-info
3943
!/@npmcli/package-json/node_modules/ini
4044
!/@npmcli/package-json/node_modules/isexe
@@ -48,6 +52,10 @@
4852
!/@npmcli/package-json/node_modules/validate-npm-package-name
4953
!/@npmcli/package-json/node_modules/which
5054
!/@npmcli/promise-spawn
55+
!/@npmcli/promise-spawn/node_modules/
56+
/@npmcli/promise-spawn/node_modules/*
57+
!/@npmcli/promise-spawn/node_modules/isexe
58+
!/@npmcli/promise-spawn/node_modules/which
5159
!/@npmcli/query
5260
!/@npmcli/redact
5361
!/@npmcli/run-script
@@ -56,6 +64,7 @@
5664
!/@npmcli/run-script/node_modules/@npmcli/
5765
/@npmcli/run-script/node_modules/@npmcli/*
5866
!/@npmcli/run-script/node_modules/@npmcli/package-json
67+
!/@npmcli/run-script/node_modules/@npmcli/promise-spawn
5968
!/@pkgjs/
6069
/@pkgjs/*
6170
!/@pkgjs/parseargs
@@ -194,6 +203,7 @@
194203
!/pacote/node_modules/@npmcli/
195204
/pacote/node_modules/@npmcli/*
196205
!/pacote/node_modules/@npmcli/package-json
206+
!/pacote/node_modules/@npmcli/promise-spawn
197207
!/parse-conflict-json
198208
!/path-key
199209
!/path-scurry
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "@npmcli/promise-spawn",
3+
"version": "7.0.2",
4+
"files": [
5+
"bin/",
6+
"lib/"
7+
],
8+
"main": "./lib/index.js",
9+
"description": "spawn processes the way the npm cli likes to do",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/npm/promise-spawn.git"
13+
},
14+
"author": "GitHub Inc.",
15+
"license": "ISC",
16+
"scripts": {
17+
"test": "tap",
18+
"snap": "tap",
19+
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
20+
"lintfix": "npm run lint -- --fix",
21+
"posttest": "npm run lint",
22+
"postsnap": "npm run lintfix --",
23+
"postlint": "template-oss-check",
24+
"template-oss-apply": "template-oss-apply --force"
25+
},
26+
"tap": {
27+
"check-coverage": true,
28+
"nyc-arg": [
29+
"--exclude",
30+
"tap-snapshots/**"
31+
]
32+
},
33+
"devDependencies": {
34+
"@npmcli/eslint-config": "^4.0.0",
35+
"@npmcli/template-oss": "4.22.0",
36+
"spawk": "^1.7.1",
37+
"tap": "^16.0.1"
38+
},
39+
"engines": {
40+
"node": "^16.14.0 || >=18.0.0"
41+
},
42+
"templateOSS": {
43+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
44+
"version": "4.22.0",
45+
"publish": true
46+
},
47+
"dependencies": {
48+
"which": "^4.0.0"
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
The ISC License
2+
3+
Copyright (c) 2016-2022 Isaac Z. Schlueter and Contributors
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"use strict";
2+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3+
if (k2 === undefined) k2 = k;
4+
var desc = Object.getOwnPropertyDescriptor(m, k);
5+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6+
desc = { enumerable: true, get: function() { return m[k]; } };
7+
}
8+
Object.defineProperty(o, k2, desc);
9+
}) : (function(o, m, k, k2) {
10+
if (k2 === undefined) k2 = k;
11+
o[k2] = m[k];
12+
}));
13+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14+
Object.defineProperty(o, "default", { enumerable: true, value: v });
15+
}) : function(o, v) {
16+
o["default"] = v;
17+
});
18+
var __importStar = (this && this.__importStar) || function (mod) {
19+
if (mod && mod.__esModule) return mod;
20+
var result = {};
21+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22+
__setModuleDefault(result, mod);
23+
return result;
24+
};
25+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
26+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27+
};
28+
Object.defineProperty(exports, "__esModule", { value: true });
29+
exports.sync = exports.isexe = exports.posix = exports.win32 = void 0;
30+
const posix = __importStar(require("./posix.js"));
31+
exports.posix = posix;
32+
const win32 = __importStar(require("./win32.js"));
33+
exports.win32 = win32;
34+
__exportStar(require("./options.js"), exports);
35+
const platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
36+
const impl = platform === 'win32' ? win32 : posix;
37+
/**
38+
* Determine whether a path is executable on the current platform.
39+
*/
40+
exports.isexe = impl.isexe;
41+
/**
42+
* Synchronously determine whether a path is executable on the
43+
* current platform.
44+
*/
45+
exports.sync = impl.sync;
46+
//# sourceMappingURL=index.js.map
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
//# sourceMappingURL=options.js.map
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "commonjs"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
"use strict";
2+
/**
3+
* This is the Posix implementation of isexe, which uses the file
4+
* mode and uid/gid values.
5+
*
6+
* @module
7+
*/
8+
Object.defineProperty(exports, "__esModule", { value: true });
9+
exports.sync = exports.isexe = void 0;
10+
const fs_1 = require("fs");
11+
const promises_1 = require("fs/promises");
12+
/**
13+
* Determine whether a path is executable according to the mode and
14+
* current (or specified) user and group IDs.
15+
*/
16+
const isexe = async (path, options = {}) => {
17+
const { ignoreErrors = false } = options;
18+
try {
19+
return checkStat(await (0, promises_1.stat)(path), options);
20+
}
21+
catch (e) {
22+
const er = e;
23+
if (ignoreErrors || er.code === 'EACCES')
24+
return false;
25+
throw er;
26+
}
27+
};
28+
exports.isexe = isexe;
29+
/**
30+
* Synchronously determine whether a path is executable according to
31+
* the mode and current (or specified) user and group IDs.
32+
*/
33+
const sync = (path, options = {}) => {
34+
const { ignoreErrors = false } = options;
35+
try {
36+
return checkStat((0, fs_1.statSync)(path), options);
37+
}
38+
catch (e) {
39+
const er = e;
40+
if (ignoreErrors || er.code === 'EACCES')
41+
return false;
42+
throw er;
43+
}
44+
};
45+
exports.sync = sync;
46+
const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);
47+
const checkMode = (stat, options) => {
48+
const myUid = options.uid ?? process.getuid?.();
49+
const myGroups = options.groups ?? process.getgroups?.() ?? [];
50+
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
51+
if (myUid === undefined || myGid === undefined) {
52+
throw new Error('cannot get uid or gid');
53+
}
54+
const groups = new Set([myGid, ...myGroups]);
55+
const mod = stat.mode;
56+
const uid = stat.uid;
57+
const gid = stat.gid;
58+
const u = parseInt('100', 8);
59+
const g = parseInt('010', 8);
60+
const o = parseInt('001', 8);
61+
const ug = u | g;
62+
return !!(mod & o ||
63+
(mod & g && groups.has(gid)) ||
64+
(mod & u && uid === myUid) ||
65+
(mod & ug && myUid === 0));
66+
};
67+
//# sourceMappingURL=posix.js.map
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
"use strict";
2+
/**
3+
* This is the Windows implementation of isexe, which uses the file
4+
* extension and PATHEXT setting.
5+
*
6+
* @module
7+
*/
8+
Object.defineProperty(exports, "__esModule", { value: true });
9+
exports.sync = exports.isexe = void 0;
10+
const fs_1 = require("fs");
11+
const promises_1 = require("fs/promises");
12+
/**
13+
* Determine whether a path is executable based on the file extension
14+
* and PATHEXT environment variable (or specified pathExt option)
15+
*/
16+
const isexe = async (path, options = {}) => {
17+
const { ignoreErrors = false } = options;
18+
try {
19+
return checkStat(await (0, promises_1.stat)(path), path, options);
20+
}
21+
catch (e) {
22+
const er = e;
23+
if (ignoreErrors || er.code === 'EACCES')
24+
return false;
25+
throw er;
26+
}
27+
};
28+
exports.isexe = isexe;
29+
/**
30+
* Synchronously determine whether a path is executable based on the file
31+
* extension and PATHEXT environment variable (or specified pathExt option)
32+
*/
33+
const sync = (path, options = {}) => {
34+
const { ignoreErrors = false } = options;
35+
try {
36+
return checkStat((0, fs_1.statSync)(path), path, options);
37+
}
38+
catch (e) {
39+
const er = e;
40+
if (ignoreErrors || er.code === 'EACCES')
41+
return false;
42+
throw er;
43+
}
44+
};
45+
exports.sync = sync;
46+
const checkPathExt = (path, options) => {
47+
const { pathExt = process.env.PATHEXT || '' } = options;
48+
const peSplit = pathExt.split(';');
49+
if (peSplit.indexOf('') !== -1) {
50+
return true;
51+
}
52+
for (let i = 0; i < peSplit.length; i++) {
53+
const p = peSplit[i].toLowerCase();
54+
const ext = path.substring(path.length - p.length).toLowerCase();
55+
if (p && ext === p) {
56+
return true;
57+
}
58+
}
59+
return false;
60+
};
61+
const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options);
62+
//# sourceMappingURL=win32.js.map
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as posix from './posix.js';
2+
import * as win32 from './win32.js';
3+
export * from './options.js';
4+
export { win32, posix };
5+
const platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
6+
const impl = platform === 'win32' ? win32 : posix;
7+
/**
8+
* Determine whether a path is executable on the current platform.
9+
*/
10+
export const isexe = impl.isexe;
11+
/**
12+
* Synchronously determine whether a path is executable on the
13+
* current platform.
14+
*/
15+
export const sync = impl.sync;
16+
//# sourceMappingURL=index.js.map
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export {};
2+
//# sourceMappingURL=options.js.map
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* This is the Posix implementation of isexe, which uses the file
3+
* mode and uid/gid values.
4+
*
5+
* @module
6+
*/
7+
import { statSync } from 'fs';
8+
import { stat } from 'fs/promises';
9+
/**
10+
* Determine whether a path is executable according to the mode and
11+
* current (or specified) user and group IDs.
12+
*/
13+
export const isexe = async (path, options = {}) => {
14+
const { ignoreErrors = false } = options;
15+
try {
16+
return checkStat(await stat(path), options);
17+
}
18+
catch (e) {
19+
const er = e;
20+
if (ignoreErrors || er.code === 'EACCES')
21+
return false;
22+
throw er;
23+
}
24+
};
25+
/**
26+
* Synchronously determine whether a path is executable according to
27+
* the mode and current (or specified) user and group IDs.
28+
*/
29+
export const sync = (path, options = {}) => {
30+
const { ignoreErrors = false } = options;
31+
try {
32+
return checkStat(statSync(path), options);
33+
}
34+
catch (e) {
35+
const er = e;
36+
if (ignoreErrors || er.code === 'EACCES')
37+
return false;
38+
throw er;
39+
}
40+
};
41+
const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);
42+
const checkMode = (stat, options) => {
43+
const myUid = options.uid ?? process.getuid?.();
44+
const myGroups = options.groups ?? process.getgroups?.() ?? [];
45+
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
46+
if (myUid === undefined || myGid === undefined) {
47+
throw new Error('cannot get uid or gid');
48+
}
49+
const groups = new Set([myGid, ...myGroups]);
50+
const mod = stat.mode;
51+
const uid = stat.uid;
52+
const gid = stat.gid;
53+
const u = parseInt('100', 8);
54+
const g = parseInt('010', 8);
55+
const o = parseInt('001', 8);
56+
const ug = u | g;
57+
return !!(mod & o ||
58+
(mod & g && groups.has(gid)) ||
59+
(mod & u && uid === myUid) ||
60+
(mod & ug && myUid === 0));
61+
};
62+
//# sourceMappingURL=posix.js.map

0 commit comments

Comments
 (0)