@oclif/plugin-test-esbuild 0.4.19 → 0.4.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,259 @@
1
+ import {
2
+ __commonJS,
3
+ __require,
4
+ init_cjs_shims
5
+ } from "./chunk-RRP6KXWN.js";
6
+
7
+ // node_modules/isexe/dist/cjs/posix.js
8
+ var require_posix = __commonJS({
9
+ "node_modules/isexe/dist/cjs/posix.js"(exports) {
10
+ "use strict";
11
+ init_cjs_shims();
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.sync = exports.isexe = void 0;
14
+ var fs_1 = __require("fs");
15
+ var promises_1 = __require("fs/promises");
16
+ var isexe = async (path, options = {}) => {
17
+ const { ignoreErrors = false } = options;
18
+ try {
19
+ return checkStat(await (0, promises_1.stat)(path), options);
20
+ } catch (e) {
21
+ const er = e;
22
+ if (ignoreErrors || er.code === "EACCES")
23
+ return false;
24
+ throw er;
25
+ }
26
+ };
27
+ exports.isexe = isexe;
28
+ var sync = (path, options = {}) => {
29
+ const { ignoreErrors = false } = options;
30
+ try {
31
+ return checkStat((0, fs_1.statSync)(path), options);
32
+ } catch (e) {
33
+ const er = e;
34
+ if (ignoreErrors || er.code === "EACCES")
35
+ return false;
36
+ throw er;
37
+ }
38
+ };
39
+ exports.sync = sync;
40
+ var checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);
41
+ var checkMode = (stat, options) => {
42
+ const myUid = options.uid ?? process.getuid?.();
43
+ const myGroups = options.groups ?? process.getgroups?.() ?? [];
44
+ const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
45
+ if (myUid === void 0 || myGid === void 0) {
46
+ throw new Error("cannot get uid or gid");
47
+ }
48
+ const groups = /* @__PURE__ */ new Set([myGid, ...myGroups]);
49
+ const mod = stat.mode;
50
+ const uid = stat.uid;
51
+ const gid = stat.gid;
52
+ const u = parseInt("100", 8);
53
+ const g = parseInt("010", 8);
54
+ const o = parseInt("001", 8);
55
+ const ug = u | g;
56
+ return !!(mod & o || mod & g && groups.has(gid) || mod & u && uid === myUid || mod & ug && myUid === 0);
57
+ };
58
+ }
59
+ });
60
+
61
+ // node_modules/isexe/dist/cjs/win32.js
62
+ var require_win32 = __commonJS({
63
+ "node_modules/isexe/dist/cjs/win32.js"(exports) {
64
+ "use strict";
65
+ init_cjs_shims();
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.sync = exports.isexe = void 0;
68
+ var fs_1 = __require("fs");
69
+ var promises_1 = __require("fs/promises");
70
+ var isexe = async (path, options = {}) => {
71
+ const { ignoreErrors = false } = options;
72
+ try {
73
+ return checkStat(await (0, promises_1.stat)(path), path, options);
74
+ } catch (e) {
75
+ const er = e;
76
+ if (ignoreErrors || er.code === "EACCES")
77
+ return false;
78
+ throw er;
79
+ }
80
+ };
81
+ exports.isexe = isexe;
82
+ var sync = (path, options = {}) => {
83
+ const { ignoreErrors = false } = options;
84
+ try {
85
+ return checkStat((0, fs_1.statSync)(path), path, options);
86
+ } catch (e) {
87
+ const er = e;
88
+ if (ignoreErrors || er.code === "EACCES")
89
+ return false;
90
+ throw er;
91
+ }
92
+ };
93
+ exports.sync = sync;
94
+ var checkPathExt = (path, options) => {
95
+ const { pathExt = process.env.PATHEXT || "" } = options;
96
+ const peSplit = pathExt.split(";");
97
+ if (peSplit.indexOf("") !== -1) {
98
+ return true;
99
+ }
100
+ for (let i = 0; i < peSplit.length; i++) {
101
+ const p = peSplit[i].toLowerCase();
102
+ const ext = path.substring(path.length - p.length).toLowerCase();
103
+ if (p && ext === p) {
104
+ return true;
105
+ }
106
+ }
107
+ return false;
108
+ };
109
+ var checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options);
110
+ }
111
+ });
112
+
113
+ // node_modules/isexe/dist/cjs/options.js
114
+ var require_options = __commonJS({
115
+ "node_modules/isexe/dist/cjs/options.js"(exports) {
116
+ "use strict";
117
+ init_cjs_shims();
118
+ Object.defineProperty(exports, "__esModule", { value: true });
119
+ }
120
+ });
121
+
122
+ // node_modules/isexe/dist/cjs/index.js
123
+ var require_cjs = __commonJS({
124
+ "node_modules/isexe/dist/cjs/index.js"(exports) {
125
+ "use strict";
126
+ init_cjs_shims();
127
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
128
+ if (k2 === void 0) k2 = k;
129
+ var desc = Object.getOwnPropertyDescriptor(m, k);
130
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
131
+ desc = { enumerable: true, get: function() {
132
+ return m[k];
133
+ } };
134
+ }
135
+ Object.defineProperty(o, k2, desc);
136
+ } : function(o, m, k, k2) {
137
+ if (k2 === void 0) k2 = k;
138
+ o[k2] = m[k];
139
+ });
140
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
141
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
142
+ } : function(o, v) {
143
+ o["default"] = v;
144
+ });
145
+ var __importStar = exports && exports.__importStar || function(mod) {
146
+ if (mod && mod.__esModule) return mod;
147
+ var result = {};
148
+ if (mod != null) {
149
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
150
+ }
151
+ __setModuleDefault(result, mod);
152
+ return result;
153
+ };
154
+ var __exportStar = exports && exports.__exportStar || function(m, exports2) {
155
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
156
+ };
157
+ Object.defineProperty(exports, "__esModule", { value: true });
158
+ exports.sync = exports.isexe = exports.posix = exports.win32 = void 0;
159
+ var posix = __importStar(require_posix());
160
+ exports.posix = posix;
161
+ var win32 = __importStar(require_win32());
162
+ exports.win32 = win32;
163
+ __exportStar(require_options(), exports);
164
+ var platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
165
+ var impl = platform === "win32" ? win32 : posix;
166
+ exports.isexe = impl.isexe;
167
+ exports.sync = impl.sync;
168
+ }
169
+ });
170
+
171
+ // node_modules/which/lib/index.js
172
+ var require_lib = __commonJS({
173
+ "node_modules/which/lib/index.js"(exports, module) {
174
+ init_cjs_shims();
175
+ var { isexe, sync: isexeSync } = require_cjs();
176
+ var { join, delimiter, sep, posix } = __require("path");
177
+ var isWindows = process.platform === "win32";
178
+ var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1"));
179
+ var rRel = new RegExp(`^\\.${rSlash.source}`);
180
+ var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
181
+ var getPathInfo = (cmd, {
182
+ path: optPath = process.env.PATH,
183
+ pathExt: optPathExt = process.env.PATHEXT,
184
+ delimiter: optDelimiter = delimiter
185
+ }) => {
186
+ const pathEnv = cmd.match(rSlash) ? [""] : [
187
+ // windows always checks the cwd first
188
+ ...isWindows ? [process.cwd()] : [],
189
+ ...(optPath || /* istanbul ignore next: very unusual */
190
+ "").split(optDelimiter)
191
+ ];
192
+ if (isWindows) {
193
+ const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter);
194
+ const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);
195
+ if (cmd.includes(".") && pathExt[0] !== "") {
196
+ pathExt.unshift("");
197
+ }
198
+ return { pathEnv, pathExt, pathExtExe };
199
+ }
200
+ return { pathEnv, pathExt: [""] };
201
+ };
202
+ var getPathPart = (raw, cmd) => {
203
+ const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
204
+ const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
205
+ return prefix + join(pathPart, cmd);
206
+ };
207
+ var which = async (cmd, opt = {}) => {
208
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
209
+ const found = [];
210
+ for (const envPart of pathEnv) {
211
+ const p = getPathPart(envPart, cmd);
212
+ for (const ext of pathExt) {
213
+ const withExt = p + ext;
214
+ const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
215
+ if (is) {
216
+ if (!opt.all) {
217
+ return withExt;
218
+ }
219
+ found.push(withExt);
220
+ }
221
+ }
222
+ }
223
+ if (opt.all && found.length) {
224
+ return found;
225
+ }
226
+ if (opt.nothrow) {
227
+ return null;
228
+ }
229
+ throw getNotFoundError(cmd);
230
+ };
231
+ var whichSync = (cmd, opt = {}) => {
232
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
233
+ const found = [];
234
+ for (const pathEnvPart of pathEnv) {
235
+ const p = getPathPart(pathEnvPart, cmd);
236
+ for (const ext of pathExt) {
237
+ const withExt = p + ext;
238
+ const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
239
+ if (is) {
240
+ if (!opt.all) {
241
+ return withExt;
242
+ }
243
+ found.push(withExt);
244
+ }
245
+ }
246
+ }
247
+ if (opt.all && found.length) {
248
+ return found;
249
+ }
250
+ if (opt.nothrow) {
251
+ return null;
252
+ }
253
+ throw getNotFoundError(cmd);
254
+ };
255
+ module.exports = which;
256
+ which.sync = whichSync;
257
+ }
258
+ });
259
+ export default require_lib();