vite-plus 0.1.17-alpha.4 → 0.1.17

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.
@@ -15,6 +15,7 @@ import nodeTty from "node:tty";
15
15
  import fsPromises, { constants as constants$1 } from "node:fs/promises";
16
16
  import { PassThrough, Writable } from "node:stream";
17
17
  import { exec, spawn } from "node:child_process";
18
+ import { pipeline } from "node:stream/promises";
18
19
  import * as tty from "tty";
19
20
  import { format } from "util";
20
21
  import { EOL } from "os";
@@ -119,67 +120,65 @@ const createDebug = (name) => {
119
120
  };
120
121
  };
121
122
  //#endregion
122
- //#region ../../node_modules/.pnpm/tinyexec@1.0.4/node_modules/tinyexec/dist/main.mjs
123
- var l = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
124
- var u = /* @__PURE__ */ createRequire(import.meta.url);
125
- const d = /^path$/i;
126
- const f = {
123
+ //#region ../../node_modules/.pnpm/tinyexec@1.1.1/node_modules/tinyexec/dist/main.mjs
124
+ var d = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
125
+ var f = /* @__PURE__ */ createRequire(import.meta.url);
126
+ const p = /^path$/i;
127
+ const m = {
127
128
  key: "PATH",
128
129
  value: ""
129
130
  };
130
- function p(e) {
131
+ function h(e) {
131
132
  for (const t in e) {
132
- if (!Object.prototype.hasOwnProperty.call(e, t) || !d.test(t)) continue;
133
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !p.test(t)) continue;
133
134
  const n = e[t];
134
- if (!n) return f;
135
+ if (!n) return m;
135
136
  return {
136
137
  key: t,
137
138
  value: n
138
139
  };
139
140
  }
140
- return f;
141
+ return m;
141
142
  }
142
- function m(e, t) {
143
- const i = t.value.split(delimiter);
144
- const o = [];
143
+ function g(e, t) {
144
+ const n = t.value.split(delimiter);
145
+ const a = [];
145
146
  let s = e;
146
147
  let c;
147
148
  do {
148
- o.push(resolve(s, "node_modules", ".bin"));
149
+ a.push(resolve(s, "node_modules", ".bin"));
149
150
  c = s;
150
151
  s = dirname(s);
151
152
  } while (s !== c);
152
- const l = o.concat(i).join(delimiter);
153
+ a.push(dirname(process.execPath));
154
+ const l = a.concat(n).join(delimiter);
153
155
  return {
154
156
  key: t.key,
155
157
  value: l
156
158
  };
157
159
  }
158
- function h(e, t) {
160
+ function _(e, t) {
159
161
  const n = {
160
162
  ...process.env,
161
163
  ...t
162
164
  };
163
- const r = m(e, p(n));
165
+ const r = g(e, h(n));
164
166
  n[r.key] = r.value;
165
167
  return n;
166
168
  }
167
- const g = (e) => {
169
+ const v = (e) => {
168
170
  let t = e.length;
169
171
  const n = new PassThrough();
170
172
  const r = () => {
171
- if (--t === 0) n.emit("end");
173
+ if (--t === 0) n.end();
172
174
  };
173
- for (const t of e) {
174
- t.pipe(n, { end: false });
175
- t.on("end", r);
176
- }
175
+ for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
177
176
  return n;
178
177
  };
179
- var _ = /* @__PURE__ */ l(((e, t) => {
178
+ var y = /* @__PURE__ */ d(((e, t) => {
180
179
  t.exports = a;
181
180
  a.sync = o;
182
- var n = u("fs");
181
+ var n = f("fs");
183
182
  function r(e, t) {
184
183
  var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
185
184
  if (!n) return true;
@@ -204,10 +203,10 @@ var _ = /* @__PURE__ */ l(((e, t) => {
204
203
  return i(n.statSync(e), e, t);
205
204
  }
206
205
  }));
207
- var v = /* @__PURE__ */ l(((e, t) => {
206
+ var b = /* @__PURE__ */ d(((e, t) => {
208
207
  t.exports = r;
209
208
  r.sync = i;
210
- var n = u("fs");
209
+ var n = f("fs");
211
210
  function r(e, t, r) {
212
211
  n.stat(e, function(e, n) {
213
212
  r(e, e ? false : a(n, t));
@@ -232,11 +231,11 @@ var v = /* @__PURE__ */ l(((e, t) => {
232
231
  return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
233
232
  }
234
233
  }));
235
- var y = /* @__PURE__ */ l(((e, t) => {
236
- u("fs");
234
+ var x = /* @__PURE__ */ d(((e, t) => {
235
+ f("fs");
237
236
  var n;
238
- if (process.platform === "win32" || global.TESTING_WINDOWS) n = _();
239
- else n = v();
237
+ if (process.platform === "win32" || global.TESTING_WINDOWS) n = y();
238
+ else n = b();
240
239
  t.exports = r;
241
240
  r.sync = i;
242
241
  function r(e, t, i) {
@@ -272,11 +271,11 @@ var y = /* @__PURE__ */ l(((e, t) => {
272
271
  }
273
272
  }
274
273
  }));
275
- var b = /* @__PURE__ */ l(((e, t) => {
274
+ var S = /* @__PURE__ */ d(((e, t) => {
276
275
  const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
277
- const r = u("path");
276
+ const r = f("path");
278
277
  const i = n ? ";" : ":";
279
- const a = y();
278
+ const a = x();
280
279
  const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
281
280
  const s = (e, t) => {
282
281
  const r = t.colon || i;
@@ -342,7 +341,7 @@ var b = /* @__PURE__ */ l(((e, t) => {
342
341
  t.exports = c;
343
342
  c.sync = l;
344
343
  }));
345
- var x = /* @__PURE__ */ l(((e, t) => {
344
+ var C = /* @__PURE__ */ d(((e, t) => {
346
345
  const n = (e = {}) => {
347
346
  const t = e.env || process.env;
348
347
  if ((e.platform || process.platform) !== "win32") return "PATH";
@@ -351,10 +350,10 @@ var x = /* @__PURE__ */ l(((e, t) => {
351
350
  t.exports = n;
352
351
  t.exports.default = n;
353
352
  }));
354
- var S = /* @__PURE__ */ l(((e, t) => {
355
- const n = u("path");
356
- const r = b();
357
- const i = x();
353
+ var w = /* @__PURE__ */ d(((e, t) => {
354
+ const n = f("path");
355
+ const r = S();
356
+ const i = C();
358
357
  function a(e, t) {
359
358
  const a = e.options.env || process.env;
360
359
  const o = process.cwd();
@@ -380,7 +379,7 @@ var S = /* @__PURE__ */ l(((e, t) => {
380
379
  }
381
380
  t.exports = o;
382
381
  }));
383
- var C = /* @__PURE__ */ l(((e, t) => {
382
+ var T = /* @__PURE__ */ d(((e, t) => {
384
383
  const n = /([()\][%!^"`<>&|;, *?])/g;
385
384
  function r(e) {
386
385
  e = e.replace(n, "^$1");
@@ -398,11 +397,11 @@ var C = /* @__PURE__ */ l(((e, t) => {
398
397
  t.exports.command = r;
399
398
  t.exports.argument = i;
400
399
  }));
401
- var w = /* @__PURE__ */ l(((e, t) => {
400
+ var E = /* @__PURE__ */ d(((e, t) => {
402
401
  t.exports = /^#!(.*)/;
403
402
  }));
404
- var T = /* @__PURE__ */ l(((e, t) => {
405
- const n = w();
403
+ var D = /* @__PURE__ */ d(((e, t) => {
404
+ const n = E();
406
405
  t.exports = (e = "") => {
407
406
  const t = e.match(n);
408
407
  if (!t) return null;
@@ -412,9 +411,9 @@ var T = /* @__PURE__ */ l(((e, t) => {
412
411
  return i ? `${a} ${i}` : a;
413
412
  };
414
413
  }));
415
- var E = /* @__PURE__ */ l(((e, t) => {
416
- const n = u("fs");
417
- const r = T();
414
+ var O = /* @__PURE__ */ d(((e, t) => {
415
+ const n = f("fs");
416
+ const r = D();
418
417
  function i(e) {
419
418
  const t = 150;
420
419
  const i = Buffer.alloc(t);
@@ -428,11 +427,11 @@ var E = /* @__PURE__ */ l(((e, t) => {
428
427
  }
429
428
  t.exports = i;
430
429
  }));
431
- var D = /* @__PURE__ */ l(((e, t) => {
432
- const n = u("path");
433
- const r = S();
434
- const i = C();
435
- const a = E();
430
+ var k = /* @__PURE__ */ d(((e, t) => {
431
+ const n = f("path");
432
+ const r = w();
433
+ const i = T();
434
+ const a = O();
436
435
  const o = process.platform === "win32";
437
436
  const s = /\.(?:com|exe)$/i;
438
437
  const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
@@ -446,7 +445,7 @@ var D = /* @__PURE__ */ l(((e, t) => {
446
445
  }
447
446
  return e.file;
448
447
  }
449
- function d(e) {
448
+ function u(e) {
450
449
  if (!o) return e;
451
450
  const t = l(e);
452
451
  const r = !s.test(t);
@@ -466,7 +465,7 @@ var D = /* @__PURE__ */ l(((e, t) => {
466
465
  }
467
466
  return e;
468
467
  }
469
- function f(e, t, n) {
468
+ function d(e, t, n) {
470
469
  if (t && !Array.isArray(t)) {
471
470
  n = t;
472
471
  t = null;
@@ -483,11 +482,11 @@ var D = /* @__PURE__ */ l(((e, t) => {
483
482
  args: t
484
483
  }
485
484
  };
486
- return n.shell ? r : d(r);
485
+ return n.shell ? r : u(r);
487
486
  }
488
- t.exports = f;
487
+ t.exports = d;
489
488
  }));
490
- var O = /* @__PURE__ */ l(((e, t) => {
489
+ var A = /* @__PURE__ */ d(((e, t) => {
491
490
  const n = process.platform === "win32";
492
491
  function r(e, t) {
493
492
  return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
@@ -524,10 +523,10 @@ var O = /* @__PURE__ */ l(((e, t) => {
524
523
  notFoundError: r
525
524
  };
526
525
  }));
527
- var A = (/* @__PURE__ */ l(((e, t) => {
528
- const n = u("child_process");
529
- const r = D();
530
- const i = O();
526
+ var M = (/* @__PURE__ */ d(((e, t) => {
527
+ const n = f("child_process");
528
+ const r = k();
529
+ const i = A();
531
530
  function a(e, t, a) {
532
531
  const o = r(e, t, a);
533
532
  const s = n.spawn(o.command, o.args, o.options);
@@ -546,9 +545,7 @@ var A = (/* @__PURE__ */ l(((e, t) => {
546
545
  t.exports._parse = r;
547
546
  t.exports._enoent = i;
548
547
  })))();
549
- var j = class extends Error {
550
- result;
551
- output;
548
+ var N = class extends Error {
552
549
  get exitCode() {
553
550
  if (this.result.exitCode !== null) return this.result.exitCode;
554
551
  }
@@ -558,18 +555,18 @@ var j = class extends Error {
558
555
  this.output = t;
559
556
  }
560
557
  };
561
- const M = {
558
+ const F = {
562
559
  timeout: void 0,
563
560
  persist: false
564
561
  };
565
- const N = { windowsHide: true };
566
- function P$1(e, t) {
562
+ const L = { windowsHide: true };
563
+ function R(e, t) {
567
564
  return {
568
565
  command: normalize(e),
569
566
  args: t ?? []
570
567
  };
571
568
  }
572
- function F(e) {
569
+ function z(e) {
573
570
  const t = new AbortController();
574
571
  for (const n of e) {
575
572
  if (n.aborted) {
@@ -583,12 +580,14 @@ function F(e) {
583
580
  }
584
581
  return t.signal;
585
582
  }
586
- async function I(e) {
583
+ async function B(e) {
587
584
  let t = "";
588
- for await (const n of e) t += n.toString();
585
+ try {
586
+ for await (const n of e) t += n.toString();
587
+ } catch {}
589
588
  return t;
590
589
  }
591
- var L = class {
590
+ var V = class {
592
591
  _process;
593
592
  _aborted = false;
594
593
  _options;
@@ -608,7 +607,7 @@ var L = class {
608
607
  }
609
608
  constructor(e, t, n) {
610
609
  this._options = {
611
- ...M,
610
+ ...F,
612
611
  ...n
613
612
  };
614
613
  this._command = e;
@@ -627,7 +626,7 @@ var L = class {
627
626
  return this._process?.killed === true;
628
627
  }
629
628
  pipe(e, t, n) {
630
- return z(e, t, {
629
+ return W(e, t, {
631
630
  ...n,
632
631
  stdin: this
633
632
  });
@@ -638,29 +637,30 @@ var L = class {
638
637
  const t = [];
639
638
  if (this._streamErr) t.push(this._streamErr);
640
639
  if (this._streamOut) t.push(this._streamOut);
641
- const n = g(t);
640
+ const n = v(t);
642
641
  const r = P.createInterface({ input: n });
643
642
  for await (const e of r) yield e.toString();
644
643
  await this._processClosed;
645
644
  e.removeAllListeners();
646
645
  if (this._thrownError) throw this._thrownError;
647
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new j(this);
646
+ if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new N(this);
648
647
  }
649
648
  async _waitForOutput() {
650
649
  const e = this._process;
651
650
  if (!e) throw new Error("No process was started");
652
- const [t, n] = await Promise.all([this._streamOut ? I(this._streamOut) : "", this._streamErr ? I(this._streamErr) : ""]);
651
+ const [t, n] = await Promise.all([this._streamOut ? B(this._streamOut) : "", this._streamErr ? B(this._streamErr) : ""]);
653
652
  await this._processClosed;
654
- if (this._options?.stdin) await this._options.stdin;
653
+ const { stdin: r } = this._options;
654
+ if (r && typeof r !== "string") await r;
655
655
  e.removeAllListeners();
656
656
  if (this._thrownError) throw this._thrownError;
657
- const r = {
657
+ const i = {
658
658
  stderr: n,
659
659
  stdout: t,
660
660
  exitCode: this.exitCode
661
661
  };
662
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new j(this, r);
663
- return r;
662
+ if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new N(this, i);
663
+ return i;
664
664
  }
665
665
  then(e, t) {
666
666
  return this._waitForOutput().then(e, t);
@@ -671,7 +671,7 @@ var L = class {
671
671
  const e = cwd();
672
672
  const n = this._options;
673
673
  const r = {
674
- ...N,
674
+ ...L,
675
675
  ...n.nodeOptions
676
676
  };
677
677
  const i = [];
@@ -679,19 +679,20 @@ var L = class {
679
679
  if (n.timeout !== void 0) i.push(AbortSignal.timeout(n.timeout));
680
680
  if (n.signal !== void 0) i.push(n.signal);
681
681
  if (n.persist === true) r.detached = true;
682
- if (i.length > 0) r.signal = F(i);
683
- r.env = h(e, r.env);
684
- const { command: a, args: s } = P$1(this._command, this._args);
685
- const c = (0, A._parse)(a, s, r);
682
+ if (i.length > 0) r.signal = z(i);
683
+ r.env = _(e, r.env);
684
+ const { command: a, args: o } = R(this._command, this._args);
685
+ const c = (0, M._parse)(a, o, r);
686
686
  const l = spawn(c.command, c.args, c.options);
687
687
  if (l.stderr) this._streamErr = l.stderr;
688
688
  if (l.stdout) this._streamOut = l.stdout;
689
689
  this._process = l;
690
690
  l.once("error", this._onError);
691
691
  l.once("close", this._onClose);
692
- if (n.stdin !== void 0 && l.stdin && n.stdin.process) {
693
- const { stdout: e } = n.stdin.process;
694
- if (e) e.pipe(l.stdin);
692
+ if (l.stdin) {
693
+ const { stdin: e } = n;
694
+ if (typeof e === "string") l.stdin.end(e);
695
+ else e?.process?.stdout?.pipe(l.stdin);
695
696
  }
696
697
  }
697
698
  _resetState() {
@@ -712,12 +713,12 @@ var L = class {
712
713
  if (this._resolveClose) this._resolveClose();
713
714
  };
714
715
  };
715
- const R = (e, t, n) => {
716
- const r = new L(e, t, n);
716
+ const U = (e, t, n) => {
717
+ const r = new V(e, t, n);
717
718
  r.spawn();
718
719
  return r;
719
720
  };
720
- const z = R;
721
+ const W = U;
721
722
  //#endregion
722
723
  //#region ../../node_modules/.pnpm/lint-staged@16.4.0/node_modules/lint-staged/lib/execGit.js
723
724
  const debugLog$15 = createDebug("lint-staged:execGit");
@@ -732,7 +733,7 @@ const NO_SUBMODULE_RECURSE = ["-c", "submodule.recurse=false"];
732
733
  /** @type {(cmd: string[], options?: { cwd?: string }) => Promise<string>} */
733
734
  const execGit = async (cmd, options) => {
734
735
  debugLog$15("Running git command:", cmd);
735
- const result = z("git", [...NO_SUBMODULE_RECURSE, ...cmd], { nodeOptions: {
736
+ const result = W("git", [...NO_SUBMODULE_RECURSE, ...cmd], { nodeOptions: {
736
737
  cwd: options?.cwd,
737
738
  stdio: ["ignore"]
738
739
  } });
@@ -5342,7 +5343,7 @@ const getSpawnedTask = ({ abortController, color, command, continueOnError = fal
5342
5343
  debugLog$12("Tinyexec options:", tinyExecOptions);
5343
5344
  /** @param {ReturnType<typeof getInitialState>} ctx context */
5344
5345
  return async (ctx = getInitialState()) => {
5345
- const result = z(cmd, isFn ? args : args.concat(files), tinyExecOptions);
5346
+ const result = W(cmd, isFn ? args : args.concat(files), tinyExecOptions);
5346
5347
  const taskFailed = () => result.exitCode > 0 || result.process?.signalCode;
5347
5348
  /** @type {keyof typeof Signal | undefined} */
5348
5349
  let signal;
package/dist/versions.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export const versions = {
2
2
  "vite": "8.0.8",
3
3
  "rolldown": "1.0.0-rc.15",
4
- "tsdown": "0.21.7",
4
+ "tsdown": "0.21.8",
5
5
  "vitest": "4.1.4",
6
- "oxlint": "1.59.0",
7
- "oxfmt": "0.44.0",
6
+ "oxlint": "1.60.0",
7
+ "oxfmt": "0.45.0",
8
8
  "oxlint-tsgolint": "0.20.0"
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plus",
3
- "version": "0.1.17-alpha.4",
3
+ "version": "0.1.17",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -319,11 +319,11 @@
319
319
  },
320
320
  "dependencies": {
321
321
  "@oxc-project/types": "=0.124.0",
322
- "oxfmt": "=0.44.0",
323
- "oxlint": "=1.59.0",
322
+ "oxfmt": "=0.45.0",
323
+ "oxlint": "=1.60.0",
324
324
  "oxlint-tsgolint": "=0.20.0",
325
- "@voidzero-dev/vite-plus-test": "0.1.17-alpha.4",
326
- "@voidzero-dev/vite-plus-core": "0.1.17-alpha.4"
325
+ "@voidzero-dev/vite-plus-test": "0.1.17",
326
+ "@voidzero-dev/vite-plus-core": "0.1.17"
327
327
  },
328
328
  "devDependencies": {
329
329
  "@napi-rs/cli": "^3.6.1",
@@ -345,11 +345,11 @@
345
345
  "picocolors": "^1.1.1",
346
346
  "rolldown-plugin-dts": "^0.23.0",
347
347
  "semver": "^7.7.3",
348
- "tsdown": "^0.21.7",
348
+ "tsdown": "^0.21.8",
349
349
  "validate-npm-package-name": "^7.0.2",
350
350
  "yaml": "^2.8.1",
351
351
  "@voidzero-dev/vite-plus-prompts": "0.0.0",
352
- "vite": "npm:@voidzero-dev/vite-plus-core@0.1.17-alpha.4"
352
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.17"
353
353
  },
354
354
  "napi": {
355
355
  "binaryName": "vite-plus",
@@ -369,14 +369,14 @@
369
369
  "node": "^20.19.0 || >=22.12.0"
370
370
  },
371
371
  "optionalDependencies": {
372
- "@voidzero-dev/vite-plus-darwin-arm64": "0.1.17-alpha.4",
373
- "@voidzero-dev/vite-plus-darwin-x64": "0.1.17-alpha.4",
374
- "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.17-alpha.4",
375
- "@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.17-alpha.4",
376
- "@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.17-alpha.4",
377
- "@voidzero-dev/vite-plus-linux-x64-musl": "0.1.17-alpha.4",
378
- "@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.17-alpha.4",
379
- "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.17-alpha.4"
372
+ "@voidzero-dev/vite-plus-darwin-arm64": "0.1.17",
373
+ "@voidzero-dev/vite-plus-darwin-x64": "0.1.17",
374
+ "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.17",
375
+ "@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.17",
376
+ "@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.17",
377
+ "@voidzero-dev/vite-plus-linux-x64-musl": "0.1.17",
378
+ "@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.17",
379
+ "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.17"
380
380
  },
381
381
  "scripts": {
382
382
  "build": "oxnode -C dev ./build.ts",