@lousy-agents/lint 5.17.1 → 5.17.3

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.
Files changed (4) hide show
  1. package/dist/316.js +408 -379
  2. package/dist/653.js +173 -371
  3. package/dist/index.js +178 -227
  4. package/package.json +1 -1
package/dist/653.js CHANGED
@@ -2,12 +2,11 @@ export const __rspack_esm_id = 653;
2
2
  export const __rspack_esm_ids = [653];
3
3
  export const __webpack_modules__ = {
4
4
  292(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
5
- __webpack_require__.r(__webpack_exports__);
6
5
  /* import */ var _rolldown_runtime_mjs__rspack_import_8 = __webpack_require__(421);
7
- /* import */ var node_module__rspack_import_0 = __webpack_require__(8995);
8
- /* import */ var node_fs__rspack_import_1 = __webpack_require__(3024);
9
- /* import */ var node_fs_promises__rspack_import_2 = __webpack_require__(1455);
10
- /* import */ var node_stream__rspack_import_3 = __webpack_require__(7075);
6
+ /* import */ var node_fs__rspack_import_0 = __webpack_require__(3024);
7
+ /* import */ var node_fs_promises__rspack_import_1 = __webpack_require__(1455);
8
+ /* import */ var node_stream__rspack_import_2 = __webpack_require__(7075);
9
+ /* import */ var node_stream_promises__rspack_import_3 = __webpack_require__(6466);
11
10
  /* import */ var node_child_process__rspack_import_4 = __webpack_require__(1421);
12
11
  /* import */ var node_path__rspack_import_5 = __webpack_require__(6760);
13
12
  /* import */ var node_process__rspack_import_6 = __webpack_require__(1708);
@@ -21,36 +20,36 @@ __webpack_require__.r(__webpack_exports__);
21
20
 
22
21
 
23
22
 
24
- const f = /^[A-Za-z]:\//;
25
- function p(e = ``) {
26
- return e && e.replace(/\\/g, `/`).replace(f, (e) => e.toUpperCase());
23
+ const h = /^[A-Za-z]:\//;
24
+ function g(e = ``) {
25
+ return e && e.replace(/\\/g, `/`).replace(h, (e) => e.toUpperCase());
27
26
  }
28
- const ee = /^[/\\]{2}/, te = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, m = /^[A-Za-z]:$/, h = /^\/([A-Za-z]:)?$/, g = function(e) {
27
+ const ne = /^[/\\]{2}/, _ = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, v = /^[A-Za-z]:$/, y = /^\/([A-Za-z]:)?$/, b = function(e) {
29
28
  if (e.length === 0) return `.`;
30
- e = p(e);
31
- let t = e.match(ee), n = x(e), r = e[e.length - 1] === `/`;
32
- return e = b(e, !n), e.length === 0 ? n ? `/` : r ? `./` : `.` : (r && (e += `/`), m.test(e) && (e += `/`), t ? n ? `//${e}` : `//./${e}` : n && !x(e) ? `/${e}` : e);
33
- }, _ = function(...e) {
29
+ e = g(e);
30
+ let t = e.match(ne), n = T(e), r = e[e.length - 1] === `/`;
31
+ return e = w(e, !n), e.length === 0 ? n ? `/` : r ? `./` : `.` : (r && (e += `/`), v.test(e) && (e += `/`), t ? n ? `//${e}` : `//./${e}` : n && !T(e) ? `/${e}` : e);
32
+ }, x = function(...e) {
34
33
  let t = ``;
35
34
  for (let n of e) if (n) if (t.length > 0) {
36
35
  let e = t[t.length - 1] === `/`, r = n[0] === `/`;
37
36
  e && r ? t += n.slice(1) : t += e || r ? n : `/${n}`;
38
37
  } else t += n;
39
- return g(t);
38
+ return b(t);
40
39
  };
41
- function v() {
40
+ function S() {
42
41
  return typeof process < `u` && typeof process.cwd == `function` ? process.cwd().replace(/\\/g, `/`) : `/`;
43
42
  }
44
- const y = function(...e) {
45
- e = e.map((e) => p(e));
43
+ const C = function(...e) {
44
+ e = e.map((e) => g(e));
46
45
  let t = ``, n = !1;
47
46
  for (let r = e.length - 1; r >= -1 && !n; r--) {
48
- let i = r >= 0 ? e[r] : v();
49
- !i || i.length === 0 || (t = `${i}/${t}`, n = x(i));
47
+ let i = r >= 0 ? e[r] : S();
48
+ !i || i.length === 0 || (t = `${i}/${t}`, n = T(i));
50
49
  }
51
- return t = b(t, !n), n && !x(t) ? `/${t}` : t.length > 0 ? t : `.`;
50
+ return t = w(t, !n), n && !T(t) ? `/${t}` : t.length > 0 ? t : `.`;
52
51
  };
53
- function b(e, t) {
52
+ function w(e, t) {
54
53
  let n = ``, r = 0, i = -1, a = 0, o = null;
55
54
  for (let s = 0; s <= e.length; ++s) {
56
55
  if (s < e.length) o = e[s];
@@ -75,10 +74,10 @@ function b(e, t) {
75
74
  }
76
75
  return n;
77
76
  }
78
- const x = function(e) {
79
- return te.test(e);
80
- }, S = function(e, t) {
81
- let n = y(e).replace(h, `$1`).split(`/`), r = y(t).replace(h, `$1`).split(`/`);
77
+ const T = function(e) {
78
+ return _.test(e);
79
+ }, re = function(e, t) {
80
+ let n = C(e).replace(y, `$1`).split(`/`), r = C(t).replace(y, `$1`).split(`/`);
82
81
  if (r[0][1] === `:` && n[0][1] === `:` && n[0] !== r[0]) return r.join(`/`);
83
82
  let i = [...n];
84
83
  for (let e of i) {
@@ -86,11 +85,11 @@ const x = function(e) {
86
85
  n.shift(), r.shift();
87
86
  }
88
87
  return [...n.map(() => `..`), ...r].join(`/`);
89
- }, C = function(e) {
90
- let t = p(e).replace(/\/$/, ``).split(`/`).slice(0, -1);
91
- return t.length === 1 && m.test(t[0]) && (t[0] += `/`), t.join(`/`) || (x(e) ? `/` : `.`);
92
- }, ne = function(e, t) {
93
- let n = p(e).split(`/`), r = ``;
88
+ }, E = function(e) {
89
+ let t = g(e).replace(/\/$/, ``).split(`/`).slice(0, -1);
90
+ return t.length === 1 && v.test(t[0]) && (t[0] += `/`), t.join(`/`) || (T(e) ? `/` : `.`);
91
+ }, D = function(e, t) {
92
+ let n = g(e).split(`/`), r = ``;
94
93
  for (let e = n.length - 1; e >= 0; e--) {
95
94
  let t = n[e];
96
95
  if (t) {
@@ -99,296 +98,107 @@ const x = function(e) {
99
98
  }
100
99
  }
101
100
  return t && r.endsWith(t) ? r.slice(0, -t.length) : r;
102
- };
103
- globalThis.process?.platform;
104
- var w = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), T = (0,node_module__rspack_import_0.createRequire)(import.meta.url);
105
- const re = /^path$/i, E = {
101
+ }, O = /^path$/i, k = {
106
102
  key: `PATH`,
107
103
  value: ``
108
104
  };
109
- function D(e) {
105
+ function A(e) {
110
106
  for (let t in e) {
111
- if (!Object.prototype.hasOwnProperty.call(e, t) || !re.test(t)) continue;
107
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !O.test(t)) continue;
112
108
  let n = e[t];
113
109
  return n ? {
114
110
  key: t,
115
111
  value: n
116
- } : E;
112
+ } : k;
117
113
  }
118
- return E;
114
+ return k;
119
115
  }
120
- function O(e, t) {
116
+ function j(e, t) {
121
117
  let n = t.value.split(node_path__rspack_import_5.delimiter), r = [], i = e, a;
122
118
  do
123
119
  r.push((0,node_path__rspack_import_5.resolve)(i, `node_modules`, `.bin`)), a = i, i = (0,node_path__rspack_import_5.dirname)(i);
124
120
  while (i !== a);
125
- let c = r.concat(n).join(node_path__rspack_import_5.delimiter);
121
+ r.push((0,node_path__rspack_import_5.dirname)(process.execPath));
122
+ let o = r.concat(n).join(node_path__rspack_import_5.delimiter);
126
123
  return {
127
124
  key: t.key,
128
- value: c
125
+ value: o
129
126
  };
130
127
  }
131
- function k(e, t) {
132
- let n = {
128
+ function M(e, t, n = !0) {
129
+ let r = {
133
130
  ...process.env,
134
131
  ...t
135
- }, r = O(e, D(n));
136
- return n[r.key] = r.value, n;
132
+ };
133
+ if (!n) return r;
134
+ let i = j(e, A(r));
135
+ return r[i.key] = i.value, r;
137
136
  }
138
- const A = (e) => {
139
- let t = e.length, n = new node_stream__rspack_import_3.PassThrough(), r = () => {
140
- --t === 0 && n.emit(`end`);
137
+ const N = (e) => {
138
+ let t = e.length, n = new node_stream__rspack_import_2.PassThrough(), r = () => {
139
+ --t === 0 && n.end();
141
140
  };
142
- for (let t of e) t.pipe(n, { end: !1 }), t.on(`end`, r);
141
+ for (let t of e) (0,node_stream_promises__rspack_import_3.pipeline)(t, n, { end: !1 }).then(r).catch(r);
143
142
  return n;
144
- };
145
- var j = w(((e, t) => {
146
- t.exports = a, a.sync = o;
147
- var n = T(`fs`);
148
- function r(e, t) {
149
- var n = t.pathExt === void 0 ? process.env.PATHEXT : t.pathExt;
150
- if (!n || (n = n.split(`;`), n.indexOf(``) !== -1)) return !0;
151
- for (var r = 0; r < n.length; r++) {
152
- var i = n[r].toLowerCase();
153
- if (i && e.substr(-i.length).toLowerCase() === i) return !0;
154
- }
155
- return !1;
156
- }
157
- function i(e, t, n) {
158
- return !e.isSymbolicLink() && !e.isFile() ? !1 : r(t, n);
159
- }
160
- function a(e, t, r) {
161
- n.stat(e, function(n, a) {
162
- r(n, n ? !1 : i(a, e, t));
163
- });
164
- }
165
- function o(e, t) {
166
- return i(n.statSync(e), e, t);
167
- }
168
- })), M = w(((e, t) => {
169
- t.exports = r, r.sync = i;
170
- var n = T(`fs`);
171
- function r(e, t, r) {
172
- n.stat(e, function(e, n) {
173
- r(e, e ? !1 : a(n, t));
174
- });
175
- }
176
- function i(e, t) {
177
- return a(n.statSync(e), t);
178
- }
179
- function a(e, t) {
180
- return e.isFile() && o(e, t);
181
- }
182
- function o(e, t) {
183
- var n = e.mode, r = e.uid, i = e.gid, a = t.uid === void 0 ? process.getuid && process.getuid() : t.uid, o = t.gid === void 0 ? process.getgid && process.getgid() : t.gid, s = 64, c = 8, l = 1, u = s | c;
184
- return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
185
- }
186
- })), N = w(((e, t) => {
187
- T(`fs`);
188
- var n = process.platform === `win32` || global.TESTING_WINDOWS ? j() : M();
189
- t.exports = r, r.sync = i;
190
- function r(e, t, i) {
191
- if (typeof t == `function` && (i = t, t = {}), !i) {
192
- if (typeof Promise != `function`) throw TypeError(`callback not provided`);
193
- return new Promise(function(n, i) {
194
- r(e, t || {}, function(e, t) {
195
- e ? i(e) : n(t);
196
- });
197
- });
198
- }
199
- n(e, t || {}, function(e, n) {
200
- e && (e.code === `EACCES` || t && t.ignoreErrors) && (e = null, n = !1), i(e, n);
201
- });
202
- }
203
- function i(e, t) {
204
- try {
205
- return n.sync(e, t || {});
206
- } catch (e) {
207
- if (t && t.ignoreErrors || e.code === `EACCES`) return !1;
208
- throw e;
209
- }
210
- }
211
- })), P = w(((e, t) => {
212
- let n = process.platform === `win32` || process.env.OSTYPE === `cygwin` || process.env.OSTYPE === `msys`, r = T(`path`), i = n ? `;` : `:`, a = N(), o = (e) => Object.assign(Error(`not found: ${e}`), { code: `ENOENT` }), s = (e, t) => {
213
- let r = t.colon || i, a = e.match(/\//) || n && e.match(/\\/) ? [``] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || ``).split(r)], o = n ? t.pathExt || process.env.PATHEXT || `.EXE;.CMD;.BAT;.COM` : ``, s = n ? o.split(r) : [``];
214
- return n && e.indexOf(`.`) !== -1 && s[0] !== `` && s.unshift(``), {
215
- pathEnv: a,
216
- pathExt: s,
217
- pathExtExe: o
218
- };
219
- }, c = (e, t, n) => {
220
- typeof t == `function` && (n = t, t = {}), t ||= {};
221
- let { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t), u = [], d = (n) => new Promise((a, s) => {
222
- if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
223
- let c = i[n], l = /^".*"$/.test(c) ? c.slice(1, -1) : c, d = r.join(l, e);
224
- a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
225
- }), f = (e, n, r) => new Promise((i, o) => {
226
- if (r === c.length) return i(d(n + 1));
227
- let s = c[r];
228
- a(e + s, { pathExt: l }, (a, o) => {
229
- if (!a && o) if (t.all) u.push(e + s);
230
- else return i(e + s);
231
- return i(f(e, n, r + 1));
232
- });
233
- });
234
- return n ? d(0).then((e) => n(null, e), n) : d(0);
235
- };
236
- t.exports = c, c.sync = (e, t) => {
237
- t ||= {};
238
- let { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t), l = [];
239
- for (let o = 0; o < n.length; o++) {
240
- let s = n[o], u = /^".*"$/.test(s) ? s.slice(1, -1) : s, d = r.join(u, e), f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
241
- for (let e = 0; e < i.length; e++) {
242
- let n = f + i[e];
243
- try {
244
- if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
245
- else return n;
246
- } catch {}
247
- }
248
- }
249
- if (t.all && l.length) return l;
250
- if (t.nothrow) return null;
251
- throw o(e);
252
- };
253
- })), F = w(((e, t) => {
254
- let n = (e = {}) => {
255
- let t = e.env || process.env;
256
- return (e.platform || process.platform) === `win32` ? Object.keys(t).reverse().find((e) => e.toUpperCase() === `PATH`) || `Path` : `PATH`;
143
+ }, P = /([()\][%!^"`<>&|;, *?])/g, F = /^#!\s*(.+)/, I = /\.(?:com|exe)$/i, L = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i, R = process.platform === `win32`, z = [
144
+ `.EXE`,
145
+ `.CMD`,
146
+ `.BAT`,
147
+ `.COM`
148
+ ];
149
+ function B(e, n = [], a = {}) {
150
+ if (a.shell === !0 || !R) return {
151
+ command: e,
152
+ args: n,
153
+ options: a
257
154
  };
258
- t.exports = n, t.exports.default = n;
259
- })), I = w(((e, t) => {
260
- let n = T(`path`), r = P(), i = F();
261
- function a(e, t) {
262
- let a = e.options.env || process.env, o = process.cwd(), s = e.options.cwd != null, c = s && process.chdir !== void 0 && !process.chdir.disabled;
263
- if (c) try {
264
- process.chdir(e.options.cwd);
265
- } catch {}
266
- let l;
155
+ let o = V(e, a), s = null;
156
+ if (o !== null) {
157
+ let e = Buffer.alloc(150), n = null;
267
158
  try {
268
- l = r.sync(e.command, {
269
- path: a[i({ env: a })],
270
- pathExt: t ? n.delimiter : void 0
271
- });
159
+ n = (0,node_fs__rspack_import_0.openSync)(o, `r`), (0,node_fs__rspack_import_0.readSync)(n, e, 0, 150, 0);
272
160
  } catch {} finally {
273
- c && process.chdir(o);
161
+ n !== null && (0,node_fs__rspack_import_0.closeSync)(n);
274
162
  }
275
- return l &&= n.resolve(s ? e.options.cwd : ``, l), l;
276
- }
277
- function o(e) {
278
- return a(e) || a(e, !0);
279
- }
280
- t.exports = o;
281
- })), L = w(((e, t) => {
282
- let n = /([()\][%!^"`<>&|;, *?])/g;
283
- function r(e) {
284
- return e = e.replace(n, `^$1`), e;
285
- }
286
- function i(e, t) {
287
- return e = `${e}`, e = e.replace(/(?=(\\+?)?)\1"/g, `$1$1\\"`), e = e.replace(/(?=(\\+?)?)\1$/, `$1$1`), e = `"${e}"`, e = e.replace(n, `^$1`), t && (e = e.replace(n, `^$1`)), e;
288
- }
289
- t.exports.command = r, t.exports.argument = i;
290
- })), R = w(((e, t) => {
291
- t.exports = /^#!(.*)/;
292
- })), z = w(((e, t) => {
293
- let n = R();
294
- t.exports = (e = ``) => {
295
- let t = e.match(n);
296
- if (!t) return null;
297
- let [r, i] = t[0].replace(/#! ?/, ``).split(` `), a = r.split(`/`).pop();
298
- return a === `env` ? i : i ? `${a} ${i}` : a;
299
- };
300
- })), B = w(((e, t) => {
301
- let n = T(`fs`), r = z();
302
- function i(e) {
303
- let t = Buffer.alloc(150), i;
304
- try {
305
- i = n.openSync(e, `r`), n.readSync(i, t, 0, 150, 0), n.closeSync(i);
306
- } catch {}
307
- return r(t.toString());
308
- }
309
- t.exports = i;
310
- })), V = w(((e, t) => {
311
- let n = T(`path`), r = I(), i = L(), a = B(), o = process.platform === `win32`, s = /\.(?:com|exe)$/i, c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
312
- function l(e) {
313
- e.file = r(e);
314
- let t = e.file && a(e.file);
315
- return t ? (e.args.unshift(e.file), e.command = t, r(e)) : e.file;
316
- }
317
- function u(e) {
318
- if (!o) return e;
319
- let t = l(e), r = !s.test(t);
320
- if (e.options.forceShell || r) {
321
- let r = c.test(t);
322
- e.command = n.normalize(e.command), e.command = i.command(e.command), e.args = e.args.map((e) => i.argument(e, r)), e.args = [
323
- `/d`,
324
- `/s`,
325
- `/c`,
326
- `"${[e.command].concat(e.args).join(` `)}"`
327
- ], e.command = process.env.comspec || `cmd.exe`, e.options.windowsVerbatimArguments = !0;
163
+ let a = e.toString().match(F);
164
+ if (a !== null) {
165
+ let e = a[1].trim(), t = e.indexOf(` `), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? `` : e.slice(t + 1), i = (0,node_path__rspack_import_5.basename)(n);
166
+ s = i === `env` ? r || null : i;
328
167
  }
329
- return e;
330
- }
331
- function d(e, t, n) {
332
- t && !Array.isArray(t) && (n = t, t = null), t = t ? t.slice(0) : [], n = Object.assign({}, n);
333
- let r = {
334
- command: e,
335
- args: t,
336
- options: n,
337
- file: void 0,
338
- original: {
339
- command: e,
340
- args: t
341
- }
342
- };
343
- return n.shell ? r : u(r);
344
168
  }
345
- t.exports = d;
346
- })), ie = w(((e, t) => {
347
- let n = process.platform === `win32`;
348
- function r(e, t) {
349
- return Object.assign(Error(`${t} ${e.command} ENOENT`), {
350
- code: `ENOENT`,
351
- errno: `ENOENT`,
352
- syscall: `${t} ${e.command}`,
353
- path: e.command,
354
- spawnargs: e.args
355
- });
356
- }
357
- function i(e, t) {
358
- if (!n) return;
359
- let r = e.emit;
360
- e.emit = function(n, i) {
361
- if (n === `exit`) {
362
- let n = a(i, t);
363
- if (n) return r.call(e, `error`, n);
364
- }
365
- return r.apply(e, arguments);
169
+ if (s !== null && o !== null && (n = [o, ...n], e = s, o = V(e, a)), o === null || !I.test(o)) {
170
+ let t = o !== null && L.test(o);
171
+ e = (0,node_path__rspack_import_5.normalize)(e), e = e.replace(P, `^$1`), n = n.map((e) => (e = e.replace(/(?=(\\+?)?)\1"/g, `$1$1\\"`), e = e.replace(/(?=(\\+?)?)\1$/, `$1$1`), e = `"${e}"`, e = e.replace(P, `^$1`), t && (e = e.replace(P, `^$1`)), e)), n = [
172
+ `/d`,
173
+ `/s`,
174
+ `/c`,
175
+ `"${[e, ...n].join(` `)}"`
176
+ ], e = a.env?.comspec ?? `cmd.exe`, a = {
177
+ ...a,
178
+ windowsVerbatimArguments: !0
366
179
  };
367
180
  }
368
- function a(e, t) {
369
- return n && e === 1 && !t.file ? r(t.original, `spawn`) : null;
370
- }
371
- function o(e, t) {
372
- return n && e === 1 && !t.file ? r(t.original, `spawnSync`) : null;
373
- }
374
- t.exports = {
375
- hookChildProcess: i,
376
- verifyENOENT: a,
377
- verifyENOENTSync: o,
378
- notFoundError: r
181
+ return {
182
+ command: e,
183
+ args: n,
184
+ options: a
379
185
  };
380
- })), H = w(((e, t) => {
381
- let n = T(`child_process`), r = V(), i = ie();
382
- function a(e, t, a) {
383
- let o = r(e, t, a), s = n.spawn(o.command, o.args, o.options);
384
- return i.hookChildProcess(s, o), s;
385
- }
386
- function o(e, t, a) {
387
- let o = r(e, t, a), s = n.spawnSync(o.command, o.args, o.options);
388
- return s.error = s.error || i.verifyENOENTSync(s.status, o), s;
186
+ }
187
+ function V(e, t) {
188
+ let n = (t.cwd ?? (0,node_process__rspack_import_6.cwd)()).toString(), r = t.env ?? process.env, i = A(r).value, o = e.includes(`/`) || e.includes(`\\`) ? [``] : [n, ...i.split(node_path__rspack_import_5.delimiter)], s = r.PATHEXT ? r.PATHEXT.split(node_path__rspack_import_5.delimiter) : z;
189
+ e.includes(`.`) && s[0] !== `` && s.unshift(``);
190
+ for (let t of o) {
191
+ let r = (0,node_path__rspack_import_5.resolve)(n, t.startsWith(`"`) && t.endsWith(`"`) && t.length > 1 ? t.slice(1, -1) : t, e);
192
+ for (let e of s) {
193
+ let t = r + e;
194
+ try {
195
+ if ((0,node_fs__rspack_import_0.statSync)(t).isFile()) return t;
196
+ } catch {}
197
+ }
389
198
  }
390
- t.exports = a, t.exports.spawn = a, t.exports.sync = o, t.exports._parse = r, t.exports._enoent = i;
391
- }))(), U = class extends Error {
199
+ return null;
200
+ }
201
+ var H = class extends Error {
392
202
  result;
393
203
  output;
394
204
  get exitCode() {
@@ -398,17 +208,11 @@ var j = w(((e, t) => {
398
208
  super(`Process exited with non-zero status (${e.exitCode})`), this.result = e, this.output = t;
399
209
  }
400
210
  };
401
- const W = {
211
+ const U = {
402
212
  timeout: void 0,
403
213
  persist: !1
404
- }, G = { windowsHide: !0 };
405
- function K(e, t) {
406
- return {
407
- command: (0,node_path__rspack_import_5.normalize)(e),
408
- args: t ?? []
409
- };
410
- }
411
- function q(e) {
214
+ }, W = { windowsHide: !0 };
215
+ function G(e) {
412
216
  let t = new AbortController();
413
217
  for (let n of e) {
414
218
  if (n.aborted) return t.abort(), n;
@@ -418,12 +222,14 @@ function q(e) {
418
222
  }
419
223
  return t.signal;
420
224
  }
421
- async function J(e) {
225
+ async function K(e) {
422
226
  let t = ``;
423
- for await (let n of e) t += n.toString();
227
+ try {
228
+ for await (let n of e) t += n.toString();
229
+ } catch {}
424
230
  return t;
425
231
  }
426
- var Y = class {
232
+ var q = class {
427
233
  _process;
428
234
  _aborted = !1;
429
235
  _options;
@@ -443,7 +249,7 @@ var Y = class {
443
249
  }
444
250
  constructor(e, t, n) {
445
251
  this._options = {
446
- ...W,
252
+ ...U,
447
253
  ...n
448
254
  }, this._command = e, this._args = t ?? [], this._processClosed = new Promise((e) => {
449
255
  this._resolveClose = e;
@@ -459,7 +265,7 @@ var Y = class {
459
265
  return this._process?.killed === !0;
460
266
  }
461
267
  pipe(e, t, n) {
462
- return ae(e, t, {
268
+ return Y(e, t, {
463
269
  ...n,
464
270
  stdin: this
465
271
  });
@@ -469,23 +275,25 @@ var Y = class {
469
275
  if (!e) return;
470
276
  let t = [];
471
277
  this._streamErr && t.push(this._streamErr), this._streamOut && t.push(this._streamOut);
472
- let n = A(t), r = node_readline__rspack_import_7.createInterface({ input: n });
278
+ let n = N(t), r = node_readline__rspack_import_7.createInterface({ input: n });
473
279
  for await (let e of r) yield e.toString();
474
280
  if (await this._processClosed, e.removeAllListeners(), this._thrownError) throw this._thrownError;
475
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new U(this);
281
+ if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new H(this);
476
282
  }
477
283
  async _waitForOutput() {
478
284
  let e = this._process;
479
285
  if (!e) throw Error(`No process was started`);
480
- let [t, n] = await Promise.all([this._streamOut ? J(this._streamOut) : ``, this._streamErr ? J(this._streamErr) : ``]);
481
- if (await this._processClosed, this._options?.stdin && await this._options.stdin, e.removeAllListeners(), this._thrownError) throw this._thrownError;
482
- let r = {
286
+ let [t, n] = await Promise.all([this._streamOut ? K(this._streamOut) : ``, this._streamErr ? K(this._streamErr) : ``]);
287
+ await this._processClosed;
288
+ let { stdin: r } = this._options;
289
+ if (r && typeof r != `string` && await r, e.removeAllListeners(), this._thrownError) throw this._thrownError;
290
+ let i = {
483
291
  stderr: n,
484
292
  stdout: t,
485
293
  exitCode: this.exitCode
486
294
  };
487
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new U(this, r);
488
- return r;
295
+ if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new H(this, i);
296
+ return i;
489
297
  }
490
298
  then(e, t) {
491
299
  return this._waitForOutput().then(e, t);
@@ -494,14 +302,14 @@ var Y = class {
494
302
  _streamErr;
495
303
  spawn() {
496
304
  let e = (0,node_process__rspack_import_6.cwd)(), t = this._options, n = {
497
- ...G,
305
+ ...W,
498
306
  ...t.nodeOptions
499
307
  }, r = [];
500
- this._resetState(), t.timeout !== void 0 && r.push(AbortSignal.timeout(t.timeout)), t.signal !== void 0 && r.push(t.signal), t.persist === !0 && (n.detached = !0), r.length > 0 && (n.signal = q(r)), n.env = k(e, n.env);
501
- let { command: i, args: o } = K(this._command, this._args), s = (0, H._parse)(i, o, n), c = (0,node_child_process__rspack_import_4.spawn)(s.command, s.args, s.options);
502
- if (c.stderr && (this._streamErr = c.stderr), c.stdout && (this._streamOut = c.stdout), this._process = c, c.once(`error`, this._onError), c.once(`close`, this._onClose), t.stdin !== void 0 && c.stdin && t.stdin.process) {
503
- let { stdout: e } = t.stdin.process;
504
- e && e.pipe(c.stdin);
308
+ this._resetState(), t.timeout !== void 0 && r.push(AbortSignal.timeout(t.timeout)), t.signal !== void 0 && r.push(t.signal), t.persist === !0 && (n.detached = !0), r.length > 0 && (n.signal = G(r)), n.env = M(e, n.env, t.nodePath);
309
+ let i = B(this._command, this._args, n), a = (0,node_child_process__rspack_import_4.spawn)(i.command, i.args, i.options);
310
+ if (a.stderr && (this._streamErr = a.stderr), a.stdout && (this._streamOut = a.stdout), this._process = a, a.once(`error`, this._onError), a.once(`close`, this._onClose), a.stdin) {
311
+ let { stdin: e } = t;
312
+ typeof e == `string` ? a.stdin.end(e) : e?.process?.stdout?.pipe(a.stdin);
505
313
  }
506
314
  }
507
315
  _resetState() {
@@ -520,39 +328,39 @@ var Y = class {
520
328
  this._resolveClose && this._resolveClose();
521
329
  };
522
330
  };
523
- const X = (e, t, n) => {
524
- let r = new Y(e, t, n);
331
+ const J = (e, t, n) => {
332
+ let r = new q(e, t, n);
525
333
  return r.spawn(), r;
526
- }, ae = X;
527
- var oe = (0,_rolldown_runtime_mjs__rspack_import_8.t)({
334
+ }, Y = J;
335
+ var X = (0,_rolldown_runtime_mjs__rspack_import_8/* .__exportAll */.I)({
528
336
  detectPackageManager: () => $,
529
- installDependencies: () => fe,
337
+ installDependencies: () => le,
530
338
  packageManagers: () => Q
531
339
  });
532
- async function se(e, t, n = {}) {
533
- let r = g(e).split(`/`);
340
+ async function ie(e, t, n = {}) {
341
+ let r = b(e).split(`/`);
534
342
  for (; r.length > 0;) {
535
343
  let e = await t(r.join(`/`) || `/`);
536
344
  if (e || !n.includeParentDirs) return e;
537
345
  r.pop();
538
346
  }
539
347
  }
540
- function ce(e) {
348
+ function ae(e) {
541
349
  let t;
542
350
  return () => (t === void 0 && (t = e().then((e) => (t = e, t))), t);
543
351
  }
544
- const Z = ce(async () => {
352
+ const oe = ae(async () => {
545
353
  if (globalThis.process?.versions?.webcontainer) return !1;
546
354
  try {
547
- let { exitCode: e } = await X(`corepack`, [`--version`]);
355
+ let { exitCode: e } = await J(`corepack`, [`--version`]);
548
356
  return e === 0;
549
357
  } catch {
550
358
  return !1;
551
359
  }
552
360
  });
553
- async function le(e, t, n = {}) {
554
- let r = e !== `npm` && e !== `bun` && e !== `deno` && n.corepack !== !1 && await Z() ? [`corepack`, [e, ...t]] : [e, t], { exitCode: i, stdout: a, stderr: o } = await X(r[0], r[1], { nodeOptions: {
555
- cwd: y(n.cwd || process.cwd()),
361
+ async function se(e, t, n = {}) {
362
+ let r = e !== `npm` && e !== `bun` && e !== `deno` && n.corepack !== !1 && await oe() ? [`corepack`, [e, ...t]] : [e, t], { exitCode: i, stdout: a, stderr: o } = await J(r[0], r[1], { nodeOptions: {
363
+ cwd: C(n.cwd || process.cwd()),
556
364
  env: n.env,
557
365
  stdio: n.silent ? `pipe` : `inherit`
558
366
  } });
@@ -563,7 +371,7 @@ async function le(e, t, n = {}) {
563
371
  ].join(`
564
372
  `) : ``}`);
565
373
  }
566
- async function ue(e = {}) {
374
+ async function ce(e = {}) {
567
375
  let t = e.cwd || process.cwd(), n = {
568
376
  ...process.env,
569
377
  ...e.env
@@ -581,7 +389,7 @@ async function ue(e = {}) {
581
389
  corepack: e.corepack ?? !0
582
390
  };
583
391
  }
584
- function de(e) {
392
+ function Z(e) {
585
393
  let [t, n] = (e || ``).split(`@`), [r, i] = n?.split(`+`) || [];
586
394
  if (t && t !== `-` && /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(t)) return {
587
395
  name: t,
@@ -627,13 +435,13 @@ const Q = [
627
435
  }
628
436
  ];
629
437
  async function $(e, t = {}) {
630
- let i = await se(y(e || `.`), async (e) => {
438
+ let r = await ie(C(e || `.`), async (e) => {
631
439
  if (!t.ignorePackageJSON) {
632
- let t = _(e, `package.json`);
633
- if ((0,node_fs__rspack_import_1.existsSync)(t)) {
634
- let e = JSON.parse(await (0,node_fs_promises__rspack_import_2.readFile)(t, `utf8`));
440
+ let t = x(e, `package.json`);
441
+ if ((0,node_fs__rspack_import_0.existsSync)(t)) {
442
+ let e = JSON.parse(await (0,node_fs_promises__rspack_import_1.readFile)(t, `utf8`));
635
443
  if (e?.packageManager) {
636
- let { name: t, version: n = `0.0.0`, buildMeta: r, warnings: i } = de(e.packageManager);
444
+ let { name: t, version: n = `0.0.0`, buildMeta: r, warnings: i } = Z(e.packageManager);
637
445
  if (t) {
638
446
  let e = n.split(`.`)[0], a = Q.find((n) => n.name === t && n.majorVersion === e) || Q.find((e) => e.name === t);
639
447
  return {
@@ -649,29 +457,29 @@ async function $(e, t = {}) {
649
457
  }
650
458
  }
651
459
  }
652
- if ((0,node_fs__rspack_import_1.existsSync)(_(e, `deno.json`))) return Q.find((e) => e.name === `deno`);
460
+ if ((0,node_fs__rspack_import_0.existsSync)(x(e, `deno.json`))) return Q.find((e) => e.name === `deno`);
653
461
  }
654
462
  if (!t.ignoreLockFile) {
655
- for (let t of Q) if ([t.lockFile, t.files].flat().filter(Boolean).some((t) => (0,node_fs__rspack_import_1.existsSync)(y(e, t)))) return { ...t };
463
+ for (let t of Q) if ([t.lockFile, t.files].flat().filter(Boolean).some((t) => (0,node_fs__rspack_import_0.existsSync)(C(e, t)))) return { ...t };
656
464
  }
657
465
  }, { includeParentDirs: t.includeParentDirs ?? !0 });
658
- if (!i && !t.ignoreArgv) {
466
+ if (!r && !t.ignoreArgv) {
659
467
  let e = process.argv[1];
660
468
  if (e) {
661
469
  for (let t of Q) if (RegExp(`[/\\\\]\\.?${t.command}`).test(e)) return t;
662
470
  }
663
471
  }
664
- return i;
472
+ return r;
665
473
  }
666
- async function fe(e = {}) {
667
- let t = await ue(e), n = e.frozenLockFile ? {
474
+ async function le(e = {}) {
475
+ let t = await ce(e), n = e.frozenLockFile ? {
668
476
  npm: [`ci`],
669
477
  yarn: [`install`, `--immutable`],
670
478
  bun: [`install`, `--frozen-lockfile`],
671
479
  pnpm: [`install`, `--frozen-lockfile`],
672
480
  deno: [`install`, `--frozen`]
673
481
  }[t.packageManager.name] : [`install`];
674
- return e.ignoreWorkspace && t.packageManager.name === `pnpm` && n.push(`--ignore-workspace`), t.dry || await le(t.packageManager.command, n, {
482
+ return e.ignoreWorkspace && t.packageManager.name === `pnpm` && n.push(`--ignore-workspace`), t.dry || await se(t.packageManager.command, n, {
675
483
  cwd: t.cwd,
676
484
  silent: t.silent,
677
485
  corepack: t.corepack
@@ -683,20 +491,16 @@ async function fe(e = {}) {
683
491
 
684
492
 
685
493
  __webpack_require__.d(__webpack_exports__, {
686
- t: () => (oe)
494
+ dist_exports: () => (X)
687
495
  }, {
688
- a: y,
689
- i: S,
690
- n: ne,
691
- r: C
496
+ P8: D,
497
+ hd: C,
498
+ pD: E
692
499
  });
693
500
 
694
501
 
695
502
  },
696
503
  421(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
697
- /* import */ var node_module__rspack_import_0 = __webpack_require__(8995);
698
-
699
- //#region \0rolldown/runtime.js
700
504
  var __defProp = Object.defineProperty;
701
505
  var __exportAll = (all, no_symbols) => {
702
506
  let target = {};
@@ -707,11 +511,10 @@ var __exportAll = (all, no_symbols) => {
707
511
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
708
512
  return target;
709
513
  };
710
- //#endregion
711
514
 
712
515
 
713
516
  __webpack_require__.d(__webpack_exports__, {
714
- t: () => (__exportAll)
517
+ I: () => (__exportAll)
715
518
  });
716
519
 
717
520
 
@@ -753,7 +556,6 @@ var external_node_path_ = __webpack_require__(6760);
753
556
 
754
557
 
755
558
 
756
- //#region src/_utils.ts
757
559
  async function download(url, filePath, options = {}) {
758
560
  const infoPath = filePath + ".json";
759
561
  const info = JSON.parse(await (0,promises_.readFile)(infoPath, "utf8").catch(() => "{}"));
@@ -796,9 +598,9 @@ async function sendFetch(url, options = {}) {
796
598
  return res;
797
599
  }
798
600
  function cacheDirectory() {
799
- const cacheDir = process.env.XDG_CACHE_HOME ? (0,nypm.a)(process.env.XDG_CACHE_HOME, "giget") : (0,nypm.a)((0,external_node_os_.homedir)(), ".cache/giget");
601
+ const cacheDir = process.env.XDG_CACHE_HOME ? (0,nypm/* .resolve */.hd)(process.env.XDG_CACHE_HOME, "giget") : (0,nypm/* .resolve */.hd)((0,external_node_os_.homedir)(), ".cache/giget");
800
602
  if (process.platform === "win32") {
801
- const windowsCacheDir = (0,nypm.a)((0,external_node_os_.tmpdir)(), "giget");
603
+ const windowsCacheDir = (0,nypm/* .resolve */.hd)((0,external_node_os_.tmpdir)(), "giget");
802
604
  if (!(0,external_node_fs_.existsSync)(windowsCacheDir) && (0,external_node_fs_.existsSync)(cacheDir)) try {
803
605
  (0,external_node_fs_.renameSync)(cacheDir, windowsCacheDir);
804
606
  } catch {}
@@ -829,8 +631,6 @@ function startShell(cwd) {
829
631
  stdio: "inherit"
830
632
  });
831
633
  }
832
- //#endregion
833
- //#region src/git.ts
834
634
  const git = (input, options) => {
835
635
  const parsed = parseGitCloneURI(input);
836
636
  return {
@@ -843,7 +643,7 @@ function parseGitCloneURI(input, opts = {}) {
843
643
  const cwd = opts.cwd ?? process.cwd();
844
644
  let uri = input.replace(/#.*$/, "");
845
645
  let pathSubdir;
846
- if (/^[./]/.test(input)) uri = (0,nypm.a)(cwd, uri);
646
+ if (/^[./]/.test(input)) uri = (0,nypm/* .resolve */.hd)(cwd, uri);
847
647
  else if (/^https?:\/\//.test(uri)) {
848
648
  const httpMatch = /^(https?:\/\/[^/]+)\/([\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(uri);
849
649
  if (httpMatch) {
@@ -954,7 +754,7 @@ async function _cloneAndTar(parsed, token) {
954
754
  }
955
755
  status.update("Packing...");
956
756
  const tarDir = parsed.subdir ? (0,external_node_path_.join)(tmpDir, parsed.subdir) : tmpDir;
957
- const { create } = await __webpack_require__.e(/* import() */ 316).then(__webpack_require__.bind(__webpack_require__, 5375)).then((n) => n.t);
757
+ const { create } = await __webpack_require__.e(/* import() */ 316).then(__webpack_require__.bind(__webpack_require__, 5375)).then((n) => n.index_min_exports);
958
758
  status.done();
959
759
  const stream = create({
960
760
  gzip: true,
@@ -1049,12 +849,10 @@ function _createStatus() {
1049
849
  }
1050
850
  };
1051
851
  }
1052
- //#endregion
1053
- //#region src/providers.ts
1054
852
  const http = async (input, options) => {
1055
853
  if (input.endsWith(".json")) return await _httpJSON(input, options);
1056
854
  const url = new URL(input);
1057
- let name = (0,nypm.n)(url.pathname);
855
+ let name = (0,nypm/* .basename */.P8)(url.pathname);
1058
856
  try {
1059
857
  const head = await sendFetch(url.href, {
1060
858
  method: "HEAD",
@@ -1147,8 +945,6 @@ const providers = {
1147
945
  bitbucket,
1148
946
  sourcehut
1149
947
  };
1150
- //#endregion
1151
- //#region src/registry.ts
1152
948
  const DEFAULT_REGISTRY = "https://raw.githubusercontent.com/unjs/giget/main/templates";
1153
949
  const registryProvider = (registryEndpoint = DEFAULT_REGISTRY, options = {}) => {
1154
950
  return (async (input) => {
@@ -1162,10 +958,16 @@ const registryProvider = (registryEndpoint = DEFAULT_REGISTRY, options = {}) =>
1162
958
  return info;
1163
959
  });
1164
960
  };
1165
- //#endregion
1166
- //#region src/giget.ts
1167
961
  const sourceProtoRe = /^([\w+-.]+):/;
962
+ function resolveIgnore(ignore) {
963
+ if (!ignore) return;
964
+ if (typeof ignore === "function") return ignore;
965
+ const matchesGlob = globalThis.process.getBuiltinModule?.("node:path")?.matchesGlob;
966
+ if (typeof matchesGlob !== "function") throw new TypeError("Ignore patterns require `path.matchesGlob` which is supported in Node.js v22.5.0, v20.17.0 or later.");
967
+ return (path) => ignore.some((pattern) => matchesGlob(path, pattern));
968
+ }
1168
969
  async function downloadTemplate(input, options = {}) {
970
+ const ignore = resolveIgnore(options.ignore);
1169
971
  options.registry = process.env.GIGET_REGISTRY ?? options.registry;
1170
972
  options.auth = process.env.GIGET_AUTH ?? options.auth;
1171
973
  const registry = options.registry === false ? void 0 : registryProvider(options.registry, { auth: options.auth });
@@ -1189,10 +991,10 @@ async function downloadTemplate(input, options = {}) {
1189
991
  if (!template) throw new Error(`Failed to resolve template from ${providerName}`);
1190
992
  template.name = (template.name || "template").replace(/[^\da-z-]/gi, "-");
1191
993
  template.defaultDir = (template.defaultDir || template.name).replace(/[^\da-z-]/gi, "-");
1192
- const tarPath = (0,nypm.a)((0,nypm.a)(cacheDirectory(), providerName, template.name), (template.version || template.name) + ".tar.gz");
994
+ const tarPath = (0,nypm/* .resolve */.hd)((0,nypm/* .resolve */.hd)(cacheDirectory(), providerName, template.name), (template.version || template.name) + ".tar.gz");
1193
995
  if (options.preferOffline && (0,external_node_fs_.existsSync)(tarPath)) options.offline = true;
1194
996
  if (!options.offline) {
1195
- await (0,promises_.mkdir)((0,nypm.r)(tarPath), { recursive: true });
997
+ await (0,promises_.mkdir)((0,nypm/* .dirname */.pD)(tarPath), { recursive: true });
1196
998
  const s = Date.now();
1197
999
  if (typeof template.tar === "function") {
1198
1000
  const tarFn = template.tar;
@@ -1215,7 +1017,7 @@ async function downloadTemplate(input, options = {}) {
1215
1017
  debug(`Downloaded to ${tarPath} in ${Date.now() - s}ms`);
1216
1018
  }
1217
1019
  if (!(0,external_node_fs_.existsSync)(tarPath)) throw new Error(`Tarball not found: ${tarPath} (offline: ${options.offline})`);
1218
- const extractPath = (0,nypm.a)((0,nypm.a)(options.cwd || "."), options.dir || template.defaultDir);
1020
+ const extractPath = (0,nypm/* .resolve */.hd)((0,nypm/* .resolve */.hd)(options.cwd || "."), options.dir || template.defaultDir);
1219
1021
  if (options.forceClean) await (0,promises_.rm)(extractPath, {
1220
1022
  recursive: true,
1221
1023
  force: true
@@ -1224,7 +1026,7 @@ async function downloadTemplate(input, options = {}) {
1224
1026
  await (0,promises_.mkdir)(extractPath, { recursive: true });
1225
1027
  const s = Date.now();
1226
1028
  const subdir = template.subdir?.replace(/^\//, "") || "";
1227
- const { extract } = await __webpack_require__.e(/* import() */ 316).then(__webpack_require__.bind(__webpack_require__, 5375)).then((n) => n.t);
1029
+ const { extract } = await __webpack_require__.e(/* import() */ 316).then(__webpack_require__.bind(__webpack_require__, 5375)).then((n) => n.index_min_exports);
1228
1030
  await extract({
1229
1031
  file: tarPath,
1230
1032
  cwd: extractPath,
@@ -1232,12 +1034,13 @@ async function downloadTemplate(input, options = {}) {
1232
1034
  entry.path = entry.path.split("/").splice(1).join("/");
1233
1035
  if (subdir) if (entry.path.startsWith(subdir + "/")) entry.path = entry.path.slice(subdir.length);
1234
1036
  else entry.path = "";
1037
+ if (ignore && entry.path && ignore(entry.path.replace(/^\//, ""))) entry.path = "";
1235
1038
  }
1236
1039
  });
1237
1040
  debug(`Extracted to ${extractPath} in ${Date.now() - s}ms`);
1238
1041
  if (options.install) {
1239
1042
  debug("Installing dependencies...");
1240
- const { installDependencies } = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 292)).then((n) => n.t);
1043
+ const { installDependencies } = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 292)).then((n) => n.dist_exports);
1241
1044
  await installDependencies({
1242
1045
  cwd: extractPath,
1243
1046
  silent: options.silent,
@@ -1250,7 +1053,6 @@ async function downloadTemplate(input, options = {}) {
1250
1053
  dir: extractPath
1251
1054
  };
1252
1055
  }
1253
- //#endregion
1254
1056
 
1255
1057
 
1256
1058
  ;// CONCATENATED MODULE: ../../node_modules/giget/dist/index.mjs