vite-plus 0.1.23 → 0.2.0
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.
- package/LICENSE +30 -0
- package/README.md +8 -6
- package/bin/oxfmt +5 -2
- package/bin/oxlint +12 -2
- package/binding/index.cjs +84 -67
- package/binding/index.d.cts +155 -4
- package/dist/{agent-aSGY0osq.js → agent-BD31CsvU.js} +969 -89
- package/dist/bin.js +29 -33
- package/dist/{compat-DXZgnEyq.js → compat-Cql3K40m.js} +1 -1
- package/dist/config/bin.js +30 -14
- package/dist/constants-CrfJQIUX.js +66 -0
- package/dist/create/bin.d.ts +7 -1
- package/dist/create/bin.js +578 -266
- package/dist/define-config-2tfJoXr1.d.ts +305 -0
- package/dist/define-config-BGSjF6Xp.cjs +488 -0
- package/dist/define-config-DJUehepE.js +445 -0
- package/dist/define-config.cjs +8 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +2 -2
- package/dist/dist-DRJUd9bL.js +3 -0
- package/dist/{dist-BgQuvbtq.js → dist-Oxo16Y0q.js} +4 -4
- package/dist/index.cjs +9 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{main-DpJl3LoU.js → json-Dn87fvjk.js} +137 -1
- package/dist/migration/bin.js +301 -84
- package/dist/{oxlint-plugin-config-B89iKTKN.js → oxlint-plugin-config-q8a5PFch.js} +1 -1
- package/dist/oxlint-plugin.js +11 -3
- package/dist/pack-bin.js +44 -15
- package/dist/{package-PmBUZ-ve.js → package-BHirM1_v.js} +3 -138
- package/dist/{report-DgSBQUdz.js → report-BHSkWqRR.js} +2 -0
- package/dist/{resolve-vite-config-TTvhycU1.js → resolve-vite-config-CmdsfQzS.js} +13 -4
- package/dist/staged/bin.js +150 -417
- package/dist/test/_at-vitest-browser/context.d.ts +2 -0
- package/dist/test/_at-vitest-browser.d.ts +2 -0
- package/dist/test/browser/context.d.ts +2 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.d.ts +1 -0
- package/dist/test/browser/providers/playwright/context.js +1 -0
- package/dist/test/browser/providers/playwright.d.ts +124 -2
- package/dist/test/browser/providers/playwright.js +1 -1
- package/dist/test/browser/providers/preview/context.d.ts +1 -0
- package/dist/test/browser/providers/preview/context.js +1 -0
- package/dist/test/browser/providers/preview.d.ts +32 -2
- package/dist/test/browser/providers/preview.js +1 -1
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -0
- package/dist/test/browser/providers/webdriverio/context.js +1 -0
- package/dist/test/browser/providers/webdriverio.d.ts +77 -2
- package/dist/test/browser/providers/webdriverio.js +1 -1
- package/dist/test/browser-compat.d.ts +2 -0
- package/dist/test/browser-compat.js +1 -1
- package/dist/test/browser-playwright/context.d.ts +1 -0
- package/dist/test/browser-playwright/context.js +1 -0
- package/dist/test/browser-playwright.d.ts +124 -2
- package/dist/test/browser-playwright.js +1 -1
- package/dist/test/browser-preview/context.d.ts +1 -0
- package/dist/test/browser-preview/context.js +1 -0
- package/dist/test/browser-preview.d.ts +32 -2
- package/dist/test/browser-preview.js +1 -1
- package/dist/test/browser-webdriverio/context.d.ts +1 -0
- package/dist/test/browser-webdriverio/context.js +1 -0
- package/dist/test/browser-webdriverio.d.ts +77 -2
- package/dist/test/browser-webdriverio.js +1 -1
- package/dist/test/browser.d.ts +2 -2
- package/dist/test/browser.js +1 -1
- package/dist/test/client.js +1 -1
- package/dist/test/config.cjs +1 -1
- package/dist/test/config.d.ts +2 -2
- package/dist/test/config.js +1 -1
- package/dist/test/context.d.ts +942 -2
- package/dist/test/context.js +1 -1
- package/dist/test/coverage.d.ts +2 -2
- package/dist/test/coverage.js +1 -1
- package/dist/test/environments.d.ts +2 -2
- package/dist/test/environments.js +1 -1
- package/dist/test/globals.d.ts +2 -2
- package/dist/test/import-meta.d.ts +2 -2
- package/dist/test/importMeta.d.ts +2 -2
- package/dist/test/index.cjs +1 -1
- package/dist/test/index.d.cts +2 -2
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +1 -1
- package/dist/test/internal/browser.d.ts +2 -2
- package/dist/test/internal/browser.js +1 -1
- package/dist/test/jsdom.d.ts +2 -2
- package/dist/test/locators.d.ts +294 -0
- package/dist/test/locators.js +1 -1
- package/dist/test/matchers.d.ts +29 -0
- package/dist/test/matchers.js +1 -1
- package/dist/test/node.d.ts +2 -2
- package/dist/test/node.js +1 -1
- package/dist/test/optional-runtime-types.js.d.ts +2 -2
- package/dist/test/optional-types.js.d.ts +2 -2
- package/dist/test/plugins/browser-client.js +1 -1
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.js +1 -1
- package/dist/test/plugins/browser-playwright.js +1 -1
- package/dist/test/plugins/browser-preview.js +1 -1
- package/dist/test/plugins/browser-webdriverio.js +1 -1
- package/dist/test/plugins/browser.js +1 -1
- package/dist/test/plugins/expect.js +1 -1
- package/dist/test/plugins/mocker-automock.js +1 -1
- package/dist/test/plugins/mocker-browser.js +1 -1
- package/dist/test/plugins/mocker-node.js +1 -1
- package/dist/test/plugins/mocker-redirect.js +1 -1
- package/dist/test/plugins/mocker-register.js +1 -1
- package/dist/test/plugins/mocker-transforms.js +1 -1
- package/dist/test/plugins/mocker.js +1 -1
- package/dist/test/plugins/pretty-format.js +1 -1
- package/dist/test/plugins/runner-types.js +1 -1
- package/dist/test/plugins/runner-utils.js +1 -1
- package/dist/test/plugins/runner.js +1 -1
- package/dist/test/plugins/snapshot-environment.js +1 -1
- package/dist/test/plugins/snapshot-manager.js +1 -1
- package/dist/test/plugins/snapshot.js +1 -1
- package/dist/test/plugins/spy.js +1 -1
- package/dist/test/plugins/utils-constants.js +1 -1
- package/dist/test/plugins/utils-diff.js +1 -1
- package/dist/test/plugins/utils-display.js +1 -1
- package/dist/test/plugins/utils-error.js +1 -1
- package/dist/test/plugins/utils-helpers.js +1 -1
- package/dist/test/plugins/utils-offset.js +1 -1
- package/dist/test/plugins/utils-resolver.js +1 -1
- package/dist/test/plugins/utils-serialize.js +1 -1
- package/dist/test/plugins/utils-source-map-node.js +1 -1
- package/dist/test/plugins/utils-source-map.js +1 -1
- package/dist/test/plugins/utils-timers.js +1 -1
- package/dist/test/plugins/utils.js +1 -1
- package/dist/test/reporters.d.ts +2 -2
- package/dist/test/reporters.js +1 -1
- package/dist/test/runners.d.ts +2 -2
- package/dist/test/runners.js +1 -1
- package/dist/test/runtime.d.ts +2 -2
- package/dist/test/runtime.js +1 -1
- package/dist/test/snapshot.d.ts +2 -2
- package/dist/test/snapshot.js +1 -1
- package/dist/test/suite.d.ts +2 -2
- package/dist/test/suite.js +1 -1
- package/dist/test/utils.js +1 -1
- package/dist/test/worker.d.ts +2 -2
- package/dist/test/worker.js +1 -1
- package/dist/{tsconfig-DlUVXT3J.js → tsconfig-CJ_StdFc.js} +605 -263
- package/dist/tsgolint-path-B-yOos8p.js +32 -0
- package/dist/tsgolint-path.d.ts +8 -0
- package/dist/tsgolint-path.js +2 -0
- package/dist/version.js +3 -3
- package/dist/versions.d.ts +1 -1
- package/dist/versions.js +7 -7
- package/dist/{workspace-DElv730L.js → workspace-Cjoc1c_A.js} +20 -18
- package/docs/_data/team.ts +5 -4
- package/docs/config/create.md +36 -1
- package/docs/config/index.md +7 -5
- package/docs/guide/commit-hooks.md +9 -0
- package/docs/guide/create.md +106 -2
- package/docs/guide/env.md +33 -5
- package/docs/guide/index.md +9 -3
- package/docs/guide/install.md +46 -10
- package/docs/guide/migrate.md +13 -3
- package/docs/guide/troubleshooting.md +3 -29
- package/docs/guide/upgrade.md +36 -6
- package/docs/package.json +3 -3
- package/docs/pnpm-lock.yaml +298 -395
- package/package.json +104 -56
- package/templates/generator/bin/index.ts +6 -3
- package/templates/generator/package.json +2 -3
- package/templates/generator/src/template.ts +0 -2
- package/templates/monorepo/package.json +1 -1
- package/dist/constants-DCBWlNrn.js +0 -33
- package/dist/define-config-BR1Y88zz.cjs +0 -84
- package/dist/define-config-BRC7qPNE.js +0 -21
- package/dist/define-config-COdn-tsn.d.ts +0 -177
- package/dist/dist-Bapm49IR.js +0 -3
- package/dist/test/plugins/utils-highlight.js +0 -1
- /package/dist/{chunk-DnnnRqeS.js → rolldown-runtime-DnnnRqeS.js} +0 -0
package/dist/staged/bin.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { r as __toESM, t as __commonJSMin } from "../
|
|
1
|
+
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-DnnnRqeS.js";
|
|
2
2
|
import { a as printHeader, n as errorMsg, r as log } from "../terminal-uTv0ZaMr.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a as resolveViteConfig } from "../resolve-vite-config-CmdsfQzS.js";
|
|
4
4
|
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
5
5
|
import { t as renderCliDoc } from "../help-YP84FSEz.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
|
-
import path, { delimiter, dirname, resolve } from "node:path";
|
|
8
|
-
import { constants } from "node:fs";
|
|
7
|
+
import path, { basename, delimiter, dirname, normalize, resolve } from "node:path";
|
|
8
|
+
import { closeSync, constants, openSync, readSync, statSync } from "node:fs";
|
|
9
9
|
import { formatWithOptions, inspect, promisify } from "node:util";
|
|
10
10
|
import { cwd } from "node:process";
|
|
11
|
-
import
|
|
11
|
+
import G from "node:readline";
|
|
12
12
|
import nodeTty from "node:tty";
|
|
13
13
|
import { pathToFileURL } from "node:url";
|
|
14
14
|
import { EOL } from "node:os";
|
|
@@ -118,36 +118,34 @@ const createDebug = (name) => {
|
|
|
118
118
|
};
|
|
119
119
|
};
|
|
120
120
|
//#endregion
|
|
121
|
-
//#region ../../node_modules/.pnpm/tinyexec@1.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const f = /^path$/i;
|
|
125
|
-
const p = {
|
|
121
|
+
//#region ../../node_modules/.pnpm/tinyexec@1.2.4/node_modules/tinyexec/dist/main.mjs
|
|
122
|
+
const h = /^path$/i;
|
|
123
|
+
const g = {
|
|
126
124
|
key: "PATH",
|
|
127
125
|
value: ""
|
|
128
126
|
};
|
|
129
|
-
function
|
|
127
|
+
function _(e) {
|
|
130
128
|
for (const t in e) {
|
|
131
|
-
if (!Object.prototype.hasOwnProperty.call(e, t) || !
|
|
129
|
+
if (!Object.prototype.hasOwnProperty.call(e, t) || !h.test(t)) continue;
|
|
132
130
|
const n = e[t];
|
|
133
|
-
if (!n) return
|
|
131
|
+
if (!n) return g;
|
|
134
132
|
return {
|
|
135
133
|
key: t,
|
|
136
134
|
value: n
|
|
137
135
|
};
|
|
138
136
|
}
|
|
139
|
-
return
|
|
137
|
+
return g;
|
|
140
138
|
}
|
|
141
|
-
function
|
|
139
|
+
function v(e, t) {
|
|
142
140
|
const n = t.value.split(delimiter);
|
|
143
141
|
const r = [];
|
|
144
|
-
let
|
|
142
|
+
let o = e;
|
|
145
143
|
let c;
|
|
146
144
|
do {
|
|
147
|
-
r.push(resolve(
|
|
148
|
-
c =
|
|
149
|
-
|
|
150
|
-
} while (
|
|
145
|
+
r.push(resolve(o, "node_modules", ".bin"));
|
|
146
|
+
c = o;
|
|
147
|
+
o = dirname(o);
|
|
148
|
+
} while (o !== c);
|
|
151
149
|
r.push(dirname(process.execPath));
|
|
152
150
|
const l = r.concat(n).join(delimiter);
|
|
153
151
|
return {
|
|
@@ -155,16 +153,17 @@ function h(e, t) {
|
|
|
155
153
|
value: l
|
|
156
154
|
};
|
|
157
155
|
}
|
|
158
|
-
function
|
|
159
|
-
const
|
|
156
|
+
function y(e, t, n = true) {
|
|
157
|
+
const r = {
|
|
160
158
|
...process.env,
|
|
161
159
|
...t
|
|
162
160
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
if (!n) return r;
|
|
162
|
+
const i = v(e, _(r));
|
|
163
|
+
r[i.key] = i.value;
|
|
164
|
+
return r;
|
|
166
165
|
}
|
|
167
|
-
const
|
|
166
|
+
const b = (e) => {
|
|
168
167
|
let t = e.length;
|
|
169
168
|
const n = new PassThrough();
|
|
170
169
|
const r = () => {
|
|
@@ -173,377 +172,111 @@ const _ = (e) => {
|
|
|
173
172
|
for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
|
|
174
173
|
return n;
|
|
175
174
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
function o(e, t) {
|
|
201
|
-
return i(n.statSync(e), e, t);
|
|
202
|
-
}
|
|
203
|
-
}));
|
|
204
|
-
var y = /* @__PURE__ */ u(((e, t) => {
|
|
205
|
-
t.exports = r;
|
|
206
|
-
r.sync = i;
|
|
207
|
-
var n = d("fs");
|
|
208
|
-
function r(e, t, r) {
|
|
209
|
-
n.stat(e, function(e, n) {
|
|
210
|
-
r(e, e ? false : a(n, t));
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
function i(e, t) {
|
|
214
|
-
return a(n.statSync(e), t);
|
|
215
|
-
}
|
|
216
|
-
function a(e, t) {
|
|
217
|
-
return e.isFile() && o(e, t);
|
|
218
|
-
}
|
|
219
|
-
function o(e, t) {
|
|
220
|
-
var n = e.mode;
|
|
221
|
-
var r = e.uid;
|
|
222
|
-
var i = e.gid;
|
|
223
|
-
var a = t.uid !== void 0 ? t.uid : process.getuid && process.getuid();
|
|
224
|
-
var o = t.gid !== void 0 ? t.gid : process.getgid && process.getgid();
|
|
225
|
-
var s = parseInt("100", 8);
|
|
226
|
-
var c = parseInt("010", 8);
|
|
227
|
-
var l = parseInt("001", 8);
|
|
228
|
-
var u = s | c;
|
|
229
|
-
return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
|
|
230
|
-
}
|
|
231
|
-
}));
|
|
232
|
-
var b = /* @__PURE__ */ u(((e, t) => {
|
|
233
|
-
d("fs");
|
|
234
|
-
var n;
|
|
235
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) n = v();
|
|
236
|
-
else n = y();
|
|
237
|
-
t.exports = r;
|
|
238
|
-
r.sync = i;
|
|
239
|
-
function r(e, t, i) {
|
|
240
|
-
if (typeof t === "function") {
|
|
241
|
-
i = t;
|
|
242
|
-
t = {};
|
|
243
|
-
}
|
|
244
|
-
if (!i) {
|
|
245
|
-
if (typeof Promise !== "function") throw new TypeError("callback not provided");
|
|
246
|
-
return new Promise(function(n, i) {
|
|
247
|
-
r(e, t || {}, function(e, t) {
|
|
248
|
-
if (e) i(e);
|
|
249
|
-
else n(t);
|
|
250
|
-
});
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
n(e, t || {}, function(e, n) {
|
|
254
|
-
if (e) {
|
|
255
|
-
if (e.code === "EACCES" || t && t.ignoreErrors) {
|
|
256
|
-
e = null;
|
|
257
|
-
n = false;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
i(e, n);
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
function i(e, t) {
|
|
264
|
-
try {
|
|
265
|
-
return n.sync(e, t || {});
|
|
266
|
-
} catch (e) {
|
|
267
|
-
if (t && t.ignoreErrors || e.code === "EACCES") return false;
|
|
268
|
-
else throw e;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}));
|
|
272
|
-
var x = /* @__PURE__ */ u(((e, t) => {
|
|
273
|
-
const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
274
|
-
const r = d("path");
|
|
275
|
-
const i = n ? ";" : ":";
|
|
276
|
-
const a = b();
|
|
277
|
-
const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
|
|
278
|
-
const s = (e, t) => {
|
|
279
|
-
const r = t.colon || i;
|
|
280
|
-
const a = e.match(/\//) || n && e.match(/\\/) ? [""] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || "").split(r)];
|
|
281
|
-
const o = n ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
282
|
-
const s = n ? o.split(r) : [""];
|
|
283
|
-
if (n) {
|
|
284
|
-
if (e.indexOf(".") !== -1 && s[0] !== "") s.unshift("");
|
|
285
|
-
}
|
|
286
|
-
return {
|
|
287
|
-
pathEnv: a,
|
|
288
|
-
pathExt: s,
|
|
289
|
-
pathExtExe: o
|
|
290
|
-
};
|
|
291
|
-
};
|
|
292
|
-
const c = (e, t, n) => {
|
|
293
|
-
if (typeof t === "function") {
|
|
294
|
-
n = t;
|
|
295
|
-
t = {};
|
|
296
|
-
}
|
|
297
|
-
if (!t) t = {};
|
|
298
|
-
const { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t);
|
|
299
|
-
const u = [];
|
|
300
|
-
const d = (n) => new Promise((a, s) => {
|
|
301
|
-
if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
|
|
302
|
-
const c = i[n];
|
|
303
|
-
const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
|
|
304
|
-
const d = r.join(l, e);
|
|
305
|
-
a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
|
|
306
|
-
});
|
|
307
|
-
const f = (e, n, r) => new Promise((i, o) => {
|
|
308
|
-
if (r === c.length) return i(d(n + 1));
|
|
309
|
-
const s = c[r];
|
|
310
|
-
a(e + s, { pathExt: l }, (a, o) => {
|
|
311
|
-
if (!a && o) if (t.all) u.push(e + s);
|
|
312
|
-
else return i(e + s);
|
|
313
|
-
return i(f(e, n, r + 1));
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
return n ? d(0).then((e) => n(null, e), n) : d(0);
|
|
317
|
-
};
|
|
318
|
-
const l = (e, t) => {
|
|
319
|
-
t = t || {};
|
|
320
|
-
const { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t);
|
|
321
|
-
const l = [];
|
|
322
|
-
for (let o = 0; o < n.length; o++) {
|
|
323
|
-
const s = n[o];
|
|
324
|
-
const u = /^".*"$/.test(s) ? s.slice(1, -1) : s;
|
|
325
|
-
const d = r.join(u, e);
|
|
326
|
-
const f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
|
|
327
|
-
for (let e = 0; e < i.length; e++) {
|
|
328
|
-
const n = f + i[e];
|
|
329
|
-
try {
|
|
330
|
-
if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
|
|
331
|
-
else return n;
|
|
332
|
-
} catch (e) {}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
if (t.all && l.length) return l;
|
|
336
|
-
if (t.nothrow) return null;
|
|
337
|
-
throw o(e);
|
|
338
|
-
};
|
|
339
|
-
t.exports = c;
|
|
340
|
-
c.sync = l;
|
|
341
|
-
}));
|
|
342
|
-
var S = /* @__PURE__ */ u(((e, t) => {
|
|
343
|
-
const n = (e = {}) => {
|
|
344
|
-
const t = e.env || process.env;
|
|
345
|
-
if ((e.platform || process.platform) !== "win32") return "PATH";
|
|
346
|
-
return Object.keys(t).reverse().find((e) => e.toUpperCase() === "PATH") || "Path";
|
|
347
|
-
};
|
|
348
|
-
t.exports = n;
|
|
349
|
-
t.exports.default = n;
|
|
350
|
-
}));
|
|
351
|
-
var C = /* @__PURE__ */ u(((e, t) => {
|
|
352
|
-
const n = d("path");
|
|
353
|
-
const r = x();
|
|
354
|
-
const i = S();
|
|
355
|
-
function a(e, t) {
|
|
356
|
-
const a = e.options.env || process.env;
|
|
357
|
-
const o = process.cwd();
|
|
358
|
-
const s = e.options.cwd != null;
|
|
359
|
-
const c = s && process.chdir !== void 0 && !process.chdir.disabled;
|
|
360
|
-
if (c) try {
|
|
361
|
-
process.chdir(e.options.cwd);
|
|
362
|
-
} catch (e) {}
|
|
363
|
-
let l;
|
|
364
|
-
try {
|
|
365
|
-
l = r.sync(e.command, {
|
|
366
|
-
path: a[i({ env: a })],
|
|
367
|
-
pathExt: t ? n.delimiter : void 0
|
|
368
|
-
});
|
|
369
|
-
} catch (e) {} finally {
|
|
370
|
-
if (c) process.chdir(o);
|
|
371
|
-
}
|
|
372
|
-
if (l) l = n.resolve(s ? e.options.cwd : "", l);
|
|
373
|
-
return l;
|
|
374
|
-
}
|
|
375
|
-
function o(e) {
|
|
376
|
-
return a(e) || a(e, true);
|
|
377
|
-
}
|
|
378
|
-
t.exports = o;
|
|
379
|
-
}));
|
|
380
|
-
var w = /* @__PURE__ */ u(((e, t) => {
|
|
381
|
-
const n = /([()\][%!^"`<>&|;, *?])/g;
|
|
382
|
-
function r(e) {
|
|
383
|
-
e = e.replace(n, "^$1");
|
|
384
|
-
return e;
|
|
385
|
-
}
|
|
386
|
-
function i(e, t) {
|
|
387
|
-
e = `${e}`;
|
|
388
|
-
e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
389
|
-
e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
390
|
-
e = `"${e}"`;
|
|
391
|
-
e = e.replace(n, "^$1");
|
|
392
|
-
if (t) e = e.replace(n, "^$1");
|
|
393
|
-
return e;
|
|
394
|
-
}
|
|
395
|
-
t.exports.command = r;
|
|
396
|
-
t.exports.argument = i;
|
|
397
|
-
}));
|
|
398
|
-
var T = /* @__PURE__ */ u(((e, t) => {
|
|
399
|
-
t.exports = /^#!(.*)/;
|
|
400
|
-
}));
|
|
401
|
-
var E$1 = /* @__PURE__ */ u(((e, t) => {
|
|
402
|
-
const n = T();
|
|
403
|
-
t.exports = (e = "") => {
|
|
404
|
-
const t = e.match(n);
|
|
405
|
-
if (!t) return null;
|
|
406
|
-
const [r, i] = t[0].replace(/#! ?/, "").split(" ");
|
|
407
|
-
const a = r.split("/").pop();
|
|
408
|
-
if (a === "env") return i;
|
|
409
|
-
return i ? `${a} ${i}` : a;
|
|
175
|
+
const x = /([()\][%!^"`<>&|;, *?])/g;
|
|
176
|
+
const S = /^#!\s*(.+)/;
|
|
177
|
+
const C = /\.(?:com|exe)$/i;
|
|
178
|
+
const w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
|
|
179
|
+
const T = process.platform === "win32";
|
|
180
|
+
const E = [
|
|
181
|
+
".EXE",
|
|
182
|
+
".CMD",
|
|
183
|
+
".BAT",
|
|
184
|
+
".COM"
|
|
185
|
+
];
|
|
186
|
+
/**
|
|
187
|
+
* Normalizes the command and arguments to work cross-platform.
|
|
188
|
+
* On Windows, this basically handles things like shebangs, calling
|
|
189
|
+
* `node_modules/.bin` commands, and escaping meta characters.
|
|
190
|
+
* On other platforms, it just returns the command and arguments as-is.
|
|
191
|
+
*/
|
|
192
|
+
function D(e, t = [], n = {}) {
|
|
193
|
+
if (n.shell === true || !T) return {
|
|
194
|
+
command: e,
|
|
195
|
+
args: t,
|
|
196
|
+
options: n
|
|
410
197
|
};
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
const i = Buffer.alloc(t);
|
|
418
|
-
let a;
|
|
198
|
+
let i = O(e, n);
|
|
199
|
+
let a = null;
|
|
200
|
+
if (i !== null) {
|
|
201
|
+
const e = 150;
|
|
202
|
+
const t = Buffer.alloc(e);
|
|
203
|
+
let n = null;
|
|
419
204
|
try {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
return r(i.toString());
|
|
425
|
-
}
|
|
426
|
-
t.exports = i;
|
|
427
|
-
}));
|
|
428
|
-
var O = /* @__PURE__ */ u(((e, t) => {
|
|
429
|
-
const n = d("path");
|
|
430
|
-
const r = C();
|
|
431
|
-
const i = w();
|
|
432
|
-
const a = D();
|
|
433
|
-
const o = process.platform === "win32";
|
|
434
|
-
const s = /\.(?:com|exe)$/i;
|
|
435
|
-
const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
436
|
-
function l(e) {
|
|
437
|
-
e.file = r(e);
|
|
438
|
-
const t = e.file && a(e.file);
|
|
439
|
-
if (t) {
|
|
440
|
-
e.args.unshift(e.file);
|
|
441
|
-
e.command = t;
|
|
442
|
-
return r(e);
|
|
205
|
+
n = openSync(i, "r");
|
|
206
|
+
readSync(n, t, 0, e, 0);
|
|
207
|
+
} catch {} finally {
|
|
208
|
+
if (n !== null) closeSync(n);
|
|
443
209
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
e.command = n.normalize(e.command);
|
|
453
|
-
e.command = i.command(e.command);
|
|
454
|
-
e.args = e.args.map((e) => i.argument(e, r));
|
|
455
|
-
e.args = [
|
|
456
|
-
"/d",
|
|
457
|
-
"/s",
|
|
458
|
-
"/c",
|
|
459
|
-
`"${[e.command].concat(e.args).join(" ")}"`
|
|
460
|
-
];
|
|
461
|
-
e.command = process.env.comspec || "cmd.exe";
|
|
462
|
-
e.options.windowsVerbatimArguments = true;
|
|
210
|
+
const o = t.toString().match(S);
|
|
211
|
+
if (o !== null) {
|
|
212
|
+
const e = o[1].trim();
|
|
213
|
+
const t = e.indexOf(" ");
|
|
214
|
+
const n = t !== -1 ? e.slice(0, t) : e;
|
|
215
|
+
const i = t !== -1 ? e.slice(t + 1) : "";
|
|
216
|
+
const s = basename(n);
|
|
217
|
+
a = s === "env" ? i || null : s;
|
|
463
218
|
}
|
|
464
|
-
return e;
|
|
465
219
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
};
|
|
483
|
-
return n.shell ? r : u(r);
|
|
484
|
-
}
|
|
485
|
-
t.exports = f;
|
|
486
|
-
}));
|
|
487
|
-
var k = /* @__PURE__ */ u(((e, t) => {
|
|
488
|
-
const n = process.platform === "win32";
|
|
489
|
-
function r(e, t) {
|
|
490
|
-
return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
|
|
491
|
-
code: "ENOENT",
|
|
492
|
-
errno: "ENOENT",
|
|
493
|
-
syscall: `${t} ${e.command}`,
|
|
494
|
-
path: e.command,
|
|
495
|
-
spawnargs: e.args
|
|
220
|
+
if (a !== null && i !== null) {
|
|
221
|
+
t = [i, ...t];
|
|
222
|
+
e = a;
|
|
223
|
+
i = O(e, n);
|
|
224
|
+
}
|
|
225
|
+
if (i === null || !C.test(i)) {
|
|
226
|
+
const r = i !== null && w.test(i);
|
|
227
|
+
e = normalize(e);
|
|
228
|
+
e = e.replace(x, "^$1");
|
|
229
|
+
t = t.map((e) => {
|
|
230
|
+
e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
231
|
+
e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
232
|
+
e = `"${e}"`;
|
|
233
|
+
e = e.replace(x, "^$1");
|
|
234
|
+
if (r) e = e.replace(x, "^$1");
|
|
235
|
+
return e;
|
|
496
236
|
});
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
237
|
+
t = [
|
|
238
|
+
"/d",
|
|
239
|
+
"/s",
|
|
240
|
+
"/c",
|
|
241
|
+
`"${[e, ...t].join(" ")}"`
|
|
242
|
+
];
|
|
243
|
+
e = n.env?.comspec ?? "cmd.exe";
|
|
244
|
+
n = {
|
|
245
|
+
...n,
|
|
246
|
+
windowsVerbatimArguments: true
|
|
507
247
|
};
|
|
508
248
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
function o(e, t) {
|
|
514
|
-
if (n && e === 1 && !t.file) return r(t.original, "spawnSync");
|
|
515
|
-
return null;
|
|
516
|
-
}
|
|
517
|
-
t.exports = {
|
|
518
|
-
hookChildProcess: i,
|
|
519
|
-
verifyENOENT: a,
|
|
520
|
-
verifyENOENTSync: o,
|
|
521
|
-
notFoundError: r
|
|
249
|
+
return {
|
|
250
|
+
command: e,
|
|
251
|
+
args: t,
|
|
252
|
+
options: n
|
|
522
253
|
};
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
}
|
|
546
|
-
var
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Resolves the command to an absolute path if possible.
|
|
257
|
+
* Handles things like traversing PATH and adding extensions from PATHEXT
|
|
258
|
+
*/
|
|
259
|
+
function O(e, t) {
|
|
260
|
+
const r = (t.cwd ?? cwd()).toString();
|
|
261
|
+
const a = t.env ?? process.env;
|
|
262
|
+
const o = _(a).value;
|
|
263
|
+
const c = e.includes("/") || e.includes("\\") ? [""] : [r, ...o.split(delimiter)];
|
|
264
|
+
const l = a.PATHEXT ? a.PATHEXT.split(delimiter) : E;
|
|
265
|
+
if (e.includes(".") && l[0] !== "") l.unshift("");
|
|
266
|
+
for (const t of c) {
|
|
267
|
+
const n = resolve(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
|
|
268
|
+
for (const e of l) {
|
|
269
|
+
const t = n + e;
|
|
270
|
+
try {
|
|
271
|
+
if (statSync(t).isFile()) return t;
|
|
272
|
+
} catch {}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
var k = class extends Error {
|
|
278
|
+
result;
|
|
279
|
+
output;
|
|
547
280
|
get exitCode() {
|
|
548
281
|
if (this.result.exitCode !== null) return this.result.exitCode;
|
|
549
282
|
}
|
|
@@ -553,12 +286,12 @@ var M = class extends Error {
|
|
|
553
286
|
this.output = t;
|
|
554
287
|
}
|
|
555
288
|
};
|
|
556
|
-
const
|
|
289
|
+
const j = {
|
|
557
290
|
timeout: void 0,
|
|
558
291
|
persist: false
|
|
559
292
|
};
|
|
560
|
-
const
|
|
561
|
-
function
|
|
293
|
+
const N = { windowsHide: true };
|
|
294
|
+
function P(e) {
|
|
562
295
|
const t = new AbortController();
|
|
563
296
|
for (const n of e) {
|
|
564
297
|
if (n.aborted) {
|
|
@@ -572,14 +305,14 @@ function L(e) {
|
|
|
572
305
|
}
|
|
573
306
|
return t.signal;
|
|
574
307
|
}
|
|
575
|
-
async function
|
|
308
|
+
async function F(e) {
|
|
576
309
|
let t = "";
|
|
577
310
|
try {
|
|
578
311
|
for await (const n of e) t += n.toString();
|
|
579
312
|
} catch {}
|
|
580
313
|
return t;
|
|
581
314
|
}
|
|
582
|
-
var
|
|
315
|
+
var I = class {
|
|
583
316
|
_process;
|
|
584
317
|
_aborted = false;
|
|
585
318
|
_options;
|
|
@@ -599,7 +332,7 @@ var z = class {
|
|
|
599
332
|
}
|
|
600
333
|
constructor(e, t, n) {
|
|
601
334
|
this._options = {
|
|
602
|
-
...
|
|
335
|
+
...j,
|
|
603
336
|
...n
|
|
604
337
|
};
|
|
605
338
|
this._command = e;
|
|
@@ -618,7 +351,7 @@ var z = class {
|
|
|
618
351
|
return this._process?.killed === true;
|
|
619
352
|
}
|
|
620
353
|
pipe(e, t, n) {
|
|
621
|
-
return
|
|
354
|
+
return z(e, t, {
|
|
622
355
|
...n,
|
|
623
356
|
stdin: this
|
|
624
357
|
});
|
|
@@ -629,18 +362,18 @@ var z = class {
|
|
|
629
362
|
const t = [];
|
|
630
363
|
if (this._streamErr) t.push(this._streamErr);
|
|
631
364
|
if (this._streamOut) t.push(this._streamOut);
|
|
632
|
-
const n =
|
|
633
|
-
const r =
|
|
365
|
+
const n = b(t);
|
|
366
|
+
const r = G.createInterface({ input: n });
|
|
634
367
|
for await (const e of r) yield e.toString();
|
|
635
368
|
await this._processClosed;
|
|
636
369
|
e.removeAllListeners();
|
|
637
370
|
if (this._thrownError) throw this._thrownError;
|
|
638
|
-
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
371
|
+
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this);
|
|
639
372
|
}
|
|
640
373
|
async _waitForOutput() {
|
|
641
374
|
const e = this._process;
|
|
642
375
|
if (!e) throw new Error("No process was started");
|
|
643
|
-
const [t, n] = await Promise.all([this._streamOut ?
|
|
376
|
+
const [t, n] = await Promise.all([this._streamOut ? F(this._streamOut) : "", this._streamErr ? F(this._streamErr) : ""]);
|
|
644
377
|
await this._processClosed;
|
|
645
378
|
const { stdin: r } = this._options;
|
|
646
379
|
if (r && typeof r !== "string") await r;
|
|
@@ -651,7 +384,7 @@ var z = class {
|
|
|
651
384
|
stdout: t,
|
|
652
385
|
exitCode: this.exitCode
|
|
653
386
|
};
|
|
654
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
387
|
+
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this, i);
|
|
655
388
|
return i;
|
|
656
389
|
}
|
|
657
390
|
then(e, t) {
|
|
@@ -660,20 +393,20 @@ var z = class {
|
|
|
660
393
|
_streamOut;
|
|
661
394
|
_streamErr;
|
|
662
395
|
spawn() {
|
|
663
|
-
const
|
|
664
|
-
const
|
|
396
|
+
const t = cwd();
|
|
397
|
+
const r = this._options;
|
|
665
398
|
const i = {
|
|
666
|
-
...
|
|
667
|
-
...
|
|
399
|
+
...N,
|
|
400
|
+
...r.nodeOptions
|
|
668
401
|
};
|
|
669
402
|
const a = [];
|
|
670
403
|
this._resetState();
|
|
671
|
-
if (
|
|
672
|
-
if (
|
|
673
|
-
if (
|
|
674
|
-
if (a.length > 0) i.signal =
|
|
675
|
-
i.env =
|
|
676
|
-
const o = (
|
|
404
|
+
if (r.timeout !== void 0) a.push(AbortSignal.timeout(r.timeout));
|
|
405
|
+
if (r.signal !== void 0) a.push(r.signal);
|
|
406
|
+
if (r.persist === true) i.detached = true;
|
|
407
|
+
if (a.length > 0) i.signal = P(a);
|
|
408
|
+
i.env = y(t, i.env, r.nodePath);
|
|
409
|
+
const o = D(this._command, this._args, i);
|
|
677
410
|
const s = spawn(o.command, o.args, o.options);
|
|
678
411
|
if (s.stderr) this._streamErr = s.stderr;
|
|
679
412
|
if (s.stdout) this._streamOut = s.stdout;
|
|
@@ -681,7 +414,7 @@ var z = class {
|
|
|
681
414
|
s.once("error", this._onError);
|
|
682
415
|
s.once("close", this._onClose);
|
|
683
416
|
if (s.stdin) {
|
|
684
|
-
const { stdin: e } =
|
|
417
|
+
const { stdin: e } = r;
|
|
685
418
|
if (typeof e === "string") s.stdin.end(e);
|
|
686
419
|
else e?.process?.stdout?.pipe(s.stdin);
|
|
687
420
|
}
|
|
@@ -704,12 +437,12 @@ var z = class {
|
|
|
704
437
|
if (this._resolveClose) this._resolveClose();
|
|
705
438
|
};
|
|
706
439
|
};
|
|
707
|
-
const
|
|
708
|
-
const r = new
|
|
440
|
+
const R = (e, t, n) => {
|
|
441
|
+
const r = new I(e, t, n);
|
|
709
442
|
r.spawn();
|
|
710
443
|
return r;
|
|
711
444
|
};
|
|
712
|
-
const
|
|
445
|
+
const z = R;
|
|
713
446
|
//#endregion
|
|
714
447
|
//#region ../../node_modules/.pnpm/lint-staged@16.4.0/node_modules/lint-staged/lib/execGit.js
|
|
715
448
|
const debugLog$15 = createDebug("lint-staged:execGit");
|
|
@@ -724,7 +457,7 @@ const NO_SUBMODULE_RECURSE = ["-c", "submodule.recurse=false"];
|
|
|
724
457
|
/** @type {(cmd: string[], options?: { cwd?: string }) => Promise<string>} */
|
|
725
458
|
const execGit = async (cmd, options) => {
|
|
726
459
|
debugLog$15("Running git command:", cmd);
|
|
727
|
-
const result =
|
|
460
|
+
const result = z("git", [...NO_SUBMODULE_RECURSE, ...cmd], { nodeOptions: {
|
|
728
461
|
cwd: options?.cwd,
|
|
729
462
|
stdio: ["ignore"]
|
|
730
463
|
} });
|
|
@@ -5340,7 +5073,7 @@ const getSpawnedTask = ({ abortController, color, command, continueOnError = fal
|
|
|
5340
5073
|
debugLog$12("Tinyexec options:", tinyExecOptions);
|
|
5341
5074
|
/** @param {ReturnType<typeof getInitialState>} ctx context */
|
|
5342
5075
|
return async (ctx = getInitialState()) => {
|
|
5343
|
-
const result =
|
|
5076
|
+
const result = z(cmd, isFn ? args : args.concat(files), tinyExecOptions);
|
|
5344
5077
|
const taskFailed = () => result.exitCode > 0 || result.process?.signalCode;
|
|
5345
5078
|
/** @type {keyof typeof Signal | undefined} */
|
|
5346
5079
|
let signal;
|
|
@@ -6179,7 +5912,7 @@ const jsonParse = async (filename) => {
|
|
|
6179
5912
|
const yamlParse = async (filename) => {
|
|
6180
5913
|
const isPackageFile = PACKAGE_YAML_FILES.includes(path.basename(filename));
|
|
6181
5914
|
try {
|
|
6182
|
-
const [YAML, content] = await Promise.all([import("../dist-
|
|
5915
|
+
const [YAML, content] = await Promise.all([import("../dist-DRJUd9bL.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)), readFile(filename)]);
|
|
6183
5916
|
const yaml = YAML.parse(content);
|
|
6184
5917
|
return isPackageFile ? yaml[CONFIG_NAME] : yaml;
|
|
6185
5918
|
} catch (error) {
|