vite-plus 0.1.12-alpha.2 → 0.1.12
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/dist/global/create.js +10 -10
- package/dist/global/migrate.js +3 -2
- package/dist/global/staged.js +112 -131
- package/package.json +12 -12
- package/templates/generator/tsconfig.json +2 -1
package/dist/global/create.js
CHANGED
|
@@ -126,6 +126,7 @@ function prependToPathToEnvs(extraPath, envs) {
|
|
|
126
126
|
}
|
|
127
127
|
//#endregion
|
|
128
128
|
//#region src/create/templates/types.ts
|
|
129
|
+
const LibraryTemplateRepo = "github:sxzz/tsdown-templates/vite-plus";
|
|
129
130
|
const BuiltinTemplate = {
|
|
130
131
|
generator: "vite:generator",
|
|
131
132
|
monorepo: "vite:monorepo",
|
|
@@ -3481,13 +3482,16 @@ async function executeBuiltinTemplate(workspaceInfo, templateInfo, options) {
|
|
|
3481
3482
|
if (templateInfo.command === BuiltinTemplate.application) {
|
|
3482
3483
|
templateInfo.command = "create-vite@latest";
|
|
3483
3484
|
if (!templateInfo.interactive) templateInfo.args.push("--no-interactive");
|
|
3485
|
+
templateInfo.args.unshift(templateInfo.targetDir);
|
|
3484
3486
|
} else if (templateInfo.command === BuiltinTemplate.library) {
|
|
3485
|
-
templateInfo.
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3487
|
+
const libraryTemplateInfo = discoverTemplate(LibraryTemplateRepo, [templateInfo.targetDir], workspaceInfo);
|
|
3488
|
+
const result = await runRemoteTemplateCommand(workspaceInfo, workspaceInfo.rootDir, libraryTemplateInfo, false, options?.silent ?? false);
|
|
3489
|
+
setPackageName(path.join(workspaceInfo.rootDir, templateInfo.targetDir), templateInfo.packageName);
|
|
3490
|
+
return {
|
|
3491
|
+
...result,
|
|
3492
|
+
projectDir: templateInfo.targetDir
|
|
3493
|
+
};
|
|
3489
3494
|
}
|
|
3490
|
-
templateInfo.args.unshift(templateInfo.targetDir);
|
|
3491
3495
|
const result = await runRemoteTemplateCommand(workspaceInfo, workspaceInfo.rootDir, templateInfo, false, options?.silent ?? false);
|
|
3492
3496
|
setPackageName(path.join(workspaceInfo.rootDir, templateInfo.targetDir), templateInfo.packageName);
|
|
3493
3497
|
return {
|
|
@@ -3579,11 +3583,7 @@ async function executeMonorepoTemplate(workspaceInfo, templateInfo, interactive,
|
|
|
3579
3583
|
rewriteMonorepoProject(appProjectPath, workspaceInfo.packageManager, void 0, options?.silent ?? false);
|
|
3580
3584
|
if (!options?.silent) log.step("Creating default library in packages/utils...");
|
|
3581
3585
|
const libraryDir = "packages/utils";
|
|
3582
|
-
const libraryResult = await runRemoteTemplateCommand(workspaceInfo, fullPath, discoverTemplate(
|
|
3583
|
-
libraryDir,
|
|
3584
|
-
"--template",
|
|
3585
|
-
"default"
|
|
3586
|
-
], workspaceInfo), false, options?.silent ?? false);
|
|
3586
|
+
const libraryResult = await runRemoteTemplateCommand(workspaceInfo, fullPath, discoverTemplate(LibraryTemplateRepo, [libraryDir], workspaceInfo), false, options?.silent ?? false);
|
|
3587
3587
|
if (libraryResult.exitCode !== 0) {
|
|
3588
3588
|
log.error(`Failed to create default library, exit code: ${libraryResult.exitCode}`);
|
|
3589
3589
|
return libraryResult;
|
package/dist/global/migrate.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM } from "./chunk-CgnkrU7a.js";
|
|
2
|
-
import { E as confirm, F as Ct, M as select, N as spinner, O as log, _ as upgradeYarn, c as writeAgentInstructions, d as downloadPackageManager$1, g as selectPackageManager, h as runViteInstall, j as outro, l as cancelAndExit, p as promptGitHooks, s as selectAgentTargetPaths, t as detectAgentConflicts, u as defaultInteractive, v as displayRelative, w as PackageManager } from "./agent-l4VXJklB.js";
|
|
2
|
+
import { E as confirm, F as Ct, M as select, N as spinner, O as log, _ as upgradeYarn, c as writeAgentInstructions, d as downloadPackageManager$1, g as selectPackageManager, h as runViteInstall, j as outro, l as cancelAndExit, p as promptGitHooks, r as detectExistingAgentTargetPaths, s as selectAgentTargetPaths, t as detectAgentConflicts, u as defaultInteractive, v as displayRelative, w as PackageManager } from "./agent-l4VXJklB.js";
|
|
3
3
|
import { t as lib_default } from "./lib-DxappLRQ.js";
|
|
4
4
|
import { _ as rewriteMonorepo, b as createMigrationReport, c as checkViteVersion, d as detectPrettierProject, f as installGitHooks, g as preflightGitHooksSetup, h as migratePrettierToOxfmt, i as detectEditorConflicts, l as checkVitestVersion, m as migrateEslintToOxlint, o as selectEditor, p as mergeViteConfigFiles, s as writeEditorConfigs, t as detectWorkspace$1, u as detectEslintProject, x as require_semver, y as rewriteStandaloneProject } from "./workspace-CshY0VeI.js";
|
|
5
5
|
import "./browser-CBapUTD0.js";
|
|
@@ -208,7 +208,8 @@ async function collectMigrationPlan(rootDir, detectedPackageManager, options, pa
|
|
|
208
208
|
shouldSetupHooks = false;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
const
|
|
211
|
+
const existingAgentTargetPaths = options.agent !== void 0 || !options.interactive ? void 0 : detectExistingAgentTargetPaths(rootDir);
|
|
212
|
+
const selectedAgentTargetPaths = existingAgentTargetPaths !== void 0 ? existingAgentTargetPaths : await selectAgentTargetPaths({
|
|
212
213
|
interactive: options.interactive,
|
|
213
214
|
agent: options.agent,
|
|
214
215
|
onCancel: () => cancelAndExit()
|
package/dist/global/staged.js
CHANGED
|
@@ -13,7 +13,6 @@ import fsPromises, { constants as constants$1 } from "node:fs/promises";
|
|
|
13
13
|
import { pathToFileURL } from "node:url";
|
|
14
14
|
import { PassThrough, Writable } from "node:stream";
|
|
15
15
|
import { exec, spawn } from "node:child_process";
|
|
16
|
-
import { createRequire as createRequire$1 } from "module";
|
|
17
16
|
import * as tty from "tty";
|
|
18
17
|
import { format } from "util";
|
|
19
18
|
import { EOL } from "os";
|
|
@@ -118,70 +117,52 @@ const createDebug = (name) => {
|
|
|
118
117
|
};
|
|
119
118
|
};
|
|
120
119
|
//#endregion
|
|
121
|
-
//#region ../../node_modules/.pnpm/tinyexec@1.0.
|
|
122
|
-
var l =
|
|
123
|
-
var u =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var p = Object.getPrototypeOf;
|
|
127
|
-
var m = Object.prototype.hasOwnProperty;
|
|
128
|
-
var h = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
|
|
129
|
-
var g = (e, t, n, r) => {
|
|
130
|
-
if (t && typeof t === "object" || typeof t === "function") for (var i = f(t), a = 0, o = i.length, s; a < o; a++) {
|
|
131
|
-
s = i[a];
|
|
132
|
-
if (!m.call(e, s) && s !== n) u(e, s, {
|
|
133
|
-
get: ((e) => t[e]).bind(null, s),
|
|
134
|
-
enumerable: !(r = d(t, s)) || r.enumerable
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return e;
|
|
138
|
-
};
|
|
139
|
-
var _ = (e, t, n) => (n = e != null ? l(p(e)) : {}, g(t || !e || !e.__esModule ? u(n, "default", {
|
|
140
|
-
value: e,
|
|
141
|
-
enumerable: true
|
|
142
|
-
}) : n, e));
|
|
143
|
-
var v = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
144
|
-
const y = /^path$/i;
|
|
145
|
-
const b = {
|
|
120
|
+
//#region ../../node_modules/.pnpm/tinyexec@1.0.4/node_modules/tinyexec/dist/main.mjs
|
|
121
|
+
var l = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
|
|
122
|
+
var u = /* @__PURE__ */ createRequire(import.meta.url);
|
|
123
|
+
const d = /^path$/i;
|
|
124
|
+
const f = {
|
|
146
125
|
key: "PATH",
|
|
147
126
|
value: ""
|
|
148
127
|
};
|
|
149
|
-
function
|
|
128
|
+
function p(e) {
|
|
150
129
|
for (const t in e) {
|
|
151
|
-
if (!Object.prototype.hasOwnProperty.call(e, t) || !
|
|
130
|
+
if (!Object.prototype.hasOwnProperty.call(e, t) || !d.test(t)) continue;
|
|
152
131
|
const n = e[t];
|
|
153
|
-
if (!n) return
|
|
132
|
+
if (!n) return f;
|
|
154
133
|
return {
|
|
155
134
|
key: t,
|
|
156
135
|
value: n
|
|
157
136
|
};
|
|
158
137
|
}
|
|
159
|
-
return
|
|
138
|
+
return f;
|
|
160
139
|
}
|
|
161
|
-
function
|
|
140
|
+
function m(e, t) {
|
|
162
141
|
const i = t.value.split(delimiter);
|
|
163
|
-
|
|
164
|
-
let s;
|
|
142
|
+
const o = [];
|
|
143
|
+
let s = e;
|
|
144
|
+
let c;
|
|
165
145
|
do {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
} while (
|
|
146
|
+
o.push(resolve(s, "node_modules", ".bin"));
|
|
147
|
+
c = s;
|
|
148
|
+
s = dirname(s);
|
|
149
|
+
} while (s !== c);
|
|
150
|
+
const l = o.concat(i).join(delimiter);
|
|
170
151
|
return {
|
|
171
152
|
key: t.key,
|
|
172
|
-
value:
|
|
153
|
+
value: l
|
|
173
154
|
};
|
|
174
155
|
}
|
|
175
|
-
function
|
|
156
|
+
function h(e, t) {
|
|
176
157
|
const n = {
|
|
177
158
|
...process.env,
|
|
178
159
|
...t
|
|
179
160
|
};
|
|
180
|
-
const r =
|
|
161
|
+
const r = m(e, p(n));
|
|
181
162
|
n[r.key] = r.value;
|
|
182
163
|
return n;
|
|
183
164
|
}
|
|
184
|
-
const
|
|
165
|
+
const g = (e) => {
|
|
185
166
|
let t = e.length;
|
|
186
167
|
const n = new PassThrough();
|
|
187
168
|
const r = () => {
|
|
@@ -193,10 +174,10 @@ const w = (e) => {
|
|
|
193
174
|
}
|
|
194
175
|
return n;
|
|
195
176
|
};
|
|
196
|
-
var
|
|
177
|
+
var _ = /* @__PURE__ */ l(((e, t) => {
|
|
197
178
|
t.exports = a;
|
|
198
179
|
a.sync = o;
|
|
199
|
-
var n =
|
|
180
|
+
var n = u("fs");
|
|
200
181
|
function r(e, t) {
|
|
201
182
|
var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
|
|
202
183
|
if (!n) return true;
|
|
@@ -220,11 +201,11 @@ var T = h((exports, t) => {
|
|
|
220
201
|
function o(e, t) {
|
|
221
202
|
return i(n.statSync(e), e, t);
|
|
222
203
|
}
|
|
223
|
-
});
|
|
224
|
-
var
|
|
204
|
+
}));
|
|
205
|
+
var v = /* @__PURE__ */ l(((e, t) => {
|
|
225
206
|
t.exports = r;
|
|
226
207
|
r.sync = i;
|
|
227
|
-
var n =
|
|
208
|
+
var n = u("fs");
|
|
228
209
|
function r(e, t, r) {
|
|
229
210
|
n.stat(e, function(e, n) {
|
|
230
211
|
r(e, e ? false : a(n, t));
|
|
@@ -248,52 +229,52 @@ var E = h((exports, t) => {
|
|
|
248
229
|
var u = s | c;
|
|
249
230
|
return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
|
|
250
231
|
}
|
|
251
|
-
});
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
var
|
|
255
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS)
|
|
256
|
-
else
|
|
257
|
-
t.exports =
|
|
258
|
-
|
|
259
|
-
function
|
|
232
|
+
}));
|
|
233
|
+
var y = /* @__PURE__ */ l(((e, t) => {
|
|
234
|
+
u("fs");
|
|
235
|
+
var n;
|
|
236
|
+
if (process.platform === "win32" || global.TESTING_WINDOWS) n = _();
|
|
237
|
+
else n = v();
|
|
238
|
+
t.exports = r;
|
|
239
|
+
r.sync = i;
|
|
240
|
+
function r(e, t, i) {
|
|
260
241
|
if (typeof t === "function") {
|
|
261
|
-
|
|
242
|
+
i = t;
|
|
262
243
|
t = {};
|
|
263
244
|
}
|
|
264
|
-
if (!
|
|
245
|
+
if (!i) {
|
|
265
246
|
if (typeof Promise !== "function") throw new TypeError("callback not provided");
|
|
266
|
-
return new Promise(function(n,
|
|
267
|
-
|
|
268
|
-
if (e)
|
|
247
|
+
return new Promise(function(n, i) {
|
|
248
|
+
r(e, t || {}, function(e, t) {
|
|
249
|
+
if (e) i(e);
|
|
269
250
|
else n(t);
|
|
270
251
|
});
|
|
271
252
|
});
|
|
272
253
|
}
|
|
273
|
-
|
|
254
|
+
n(e, t || {}, function(e, n) {
|
|
274
255
|
if (e) {
|
|
275
256
|
if (e.code === "EACCES" || t && t.ignoreErrors) {
|
|
276
257
|
e = null;
|
|
277
|
-
|
|
258
|
+
n = false;
|
|
278
259
|
}
|
|
279
260
|
}
|
|
280
|
-
|
|
261
|
+
i(e, n);
|
|
281
262
|
});
|
|
282
263
|
}
|
|
283
|
-
function
|
|
264
|
+
function i(e, t) {
|
|
284
265
|
try {
|
|
285
|
-
return
|
|
266
|
+
return n.sync(e, t || {});
|
|
286
267
|
} catch (e) {
|
|
287
268
|
if (t && t.ignoreErrors || e.code === "EACCES") return false;
|
|
288
269
|
else throw e;
|
|
289
270
|
}
|
|
290
271
|
}
|
|
291
|
-
});
|
|
292
|
-
var
|
|
272
|
+
}));
|
|
273
|
+
var b = /* @__PURE__ */ l(((e, t) => {
|
|
293
274
|
const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
294
|
-
const r =
|
|
275
|
+
const r = u("path");
|
|
295
276
|
const i = n ? ";" : ":";
|
|
296
|
-
const a =
|
|
277
|
+
const a = y();
|
|
297
278
|
const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
|
|
298
279
|
const s = (e, t) => {
|
|
299
280
|
const r = t.colon || i;
|
|
@@ -358,8 +339,8 @@ var O = h((exports, t) => {
|
|
|
358
339
|
};
|
|
359
340
|
t.exports = c;
|
|
360
341
|
c.sync = l;
|
|
361
|
-
});
|
|
362
|
-
var
|
|
342
|
+
}));
|
|
343
|
+
var x = /* @__PURE__ */ l(((e, t) => {
|
|
363
344
|
const n = (e = {}) => {
|
|
364
345
|
const t = e.env || process.env;
|
|
365
346
|
if ((e.platform || process.platform) !== "win32") return "PATH";
|
|
@@ -367,11 +348,11 @@ var k = h((exports, t) => {
|
|
|
367
348
|
};
|
|
368
349
|
t.exports = n;
|
|
369
350
|
t.exports.default = n;
|
|
370
|
-
});
|
|
371
|
-
var
|
|
372
|
-
const n =
|
|
373
|
-
const r =
|
|
374
|
-
const i =
|
|
351
|
+
}));
|
|
352
|
+
var S = /* @__PURE__ */ l(((e, t) => {
|
|
353
|
+
const n = u("path");
|
|
354
|
+
const r = b();
|
|
355
|
+
const i = x();
|
|
375
356
|
function a(e, t) {
|
|
376
357
|
const a = e.options.env || process.env;
|
|
377
358
|
const o = process.cwd();
|
|
@@ -396,8 +377,8 @@ var A = h((exports, t) => {
|
|
|
396
377
|
return a(e) || a(e, true);
|
|
397
378
|
}
|
|
398
379
|
t.exports = o;
|
|
399
|
-
});
|
|
400
|
-
var
|
|
380
|
+
}));
|
|
381
|
+
var C = /* @__PURE__ */ l(((e, t) => {
|
|
401
382
|
const n = /([()\][%!^"`<>&|;, *?])/g;
|
|
402
383
|
function r(e) {
|
|
403
384
|
e = e.replace(n, "^$1");
|
|
@@ -405,8 +386,8 @@ var j = h((exports, t) => {
|
|
|
405
386
|
}
|
|
406
387
|
function i(e, t) {
|
|
407
388
|
e = `${e}`;
|
|
408
|
-
e = e.replace(/(
|
|
409
|
-
e = e.replace(/(
|
|
389
|
+
e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
390
|
+
e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
410
391
|
e = `"${e}"`;
|
|
411
392
|
e = e.replace(n, "^$1");
|
|
412
393
|
if (t) e = e.replace(n, "^$1");
|
|
@@ -414,12 +395,12 @@ var j = h((exports, t) => {
|
|
|
414
395
|
}
|
|
415
396
|
t.exports.command = r;
|
|
416
397
|
t.exports.argument = i;
|
|
417
|
-
});
|
|
418
|
-
var
|
|
398
|
+
}));
|
|
399
|
+
var w = /* @__PURE__ */ l(((e, t) => {
|
|
419
400
|
t.exports = /^#!(.*)/;
|
|
420
|
-
});
|
|
421
|
-
var
|
|
422
|
-
const n =
|
|
401
|
+
}));
|
|
402
|
+
var T = /* @__PURE__ */ l(((e, t) => {
|
|
403
|
+
const n = w();
|
|
423
404
|
t.exports = (e = "") => {
|
|
424
405
|
const t = e.match(n);
|
|
425
406
|
if (!t) return null;
|
|
@@ -428,10 +409,10 @@ var N = h((exports, t) => {
|
|
|
428
409
|
if (a === "env") return i;
|
|
429
410
|
return i ? `${a} ${i}` : a;
|
|
430
411
|
};
|
|
431
|
-
});
|
|
432
|
-
var
|
|
433
|
-
const n =
|
|
434
|
-
const r =
|
|
412
|
+
}));
|
|
413
|
+
var E = /* @__PURE__ */ l(((e, t) => {
|
|
414
|
+
const n = u("fs");
|
|
415
|
+
const r = T();
|
|
435
416
|
function i(e) {
|
|
436
417
|
const t = 150;
|
|
437
418
|
const i = Buffer.alloc(t);
|
|
@@ -444,12 +425,12 @@ var P = h((exports, t) => {
|
|
|
444
425
|
return r(i.toString());
|
|
445
426
|
}
|
|
446
427
|
t.exports = i;
|
|
447
|
-
});
|
|
448
|
-
var
|
|
449
|
-
const n =
|
|
450
|
-
const r =
|
|
451
|
-
const i =
|
|
452
|
-
const a =
|
|
428
|
+
}));
|
|
429
|
+
var D = /* @__PURE__ */ l(((e, t) => {
|
|
430
|
+
const n = u("path");
|
|
431
|
+
const r = S();
|
|
432
|
+
const i = C();
|
|
433
|
+
const a = E();
|
|
453
434
|
const o = process.platform === "win32";
|
|
454
435
|
const s = /\.(?:com|exe)$/i;
|
|
455
436
|
const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
@@ -463,7 +444,7 @@ var F = h((exports, t) => {
|
|
|
463
444
|
}
|
|
464
445
|
return e.file;
|
|
465
446
|
}
|
|
466
|
-
function
|
|
447
|
+
function d(e) {
|
|
467
448
|
if (!o) return e;
|
|
468
449
|
const t = l(e);
|
|
469
450
|
const r = !s.test(t);
|
|
@@ -483,7 +464,7 @@ var F = h((exports, t) => {
|
|
|
483
464
|
}
|
|
484
465
|
return e;
|
|
485
466
|
}
|
|
486
|
-
function
|
|
467
|
+
function f(e, t, n) {
|
|
487
468
|
if (t && !Array.isArray(t)) {
|
|
488
469
|
n = t;
|
|
489
470
|
t = null;
|
|
@@ -500,11 +481,11 @@ var F = h((exports, t) => {
|
|
|
500
481
|
args: t
|
|
501
482
|
}
|
|
502
483
|
};
|
|
503
|
-
return n.shell ? r :
|
|
484
|
+
return n.shell ? r : d(r);
|
|
504
485
|
}
|
|
505
|
-
t.exports =
|
|
506
|
-
});
|
|
507
|
-
var
|
|
486
|
+
t.exports = f;
|
|
487
|
+
}));
|
|
488
|
+
var O = /* @__PURE__ */ l(((e, t) => {
|
|
508
489
|
const n = process.platform === "win32";
|
|
509
490
|
function r(e, t) {
|
|
510
491
|
return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
|
|
@@ -520,7 +501,7 @@ var I = h((exports, t) => {
|
|
|
520
501
|
const r = e.emit;
|
|
521
502
|
e.emit = function(n, i) {
|
|
522
503
|
if (n === "exit") {
|
|
523
|
-
const n = a(i, t
|
|
504
|
+
const n = a(i, t);
|
|
524
505
|
if (n) return r.call(e, "error", n);
|
|
525
506
|
}
|
|
526
507
|
return r.apply(e, arguments);
|
|
@@ -540,11 +521,11 @@ var I = h((exports, t) => {
|
|
|
540
521
|
verifyENOENTSync: o,
|
|
541
522
|
notFoundError: r
|
|
542
523
|
};
|
|
543
|
-
});
|
|
544
|
-
var
|
|
545
|
-
const n =
|
|
546
|
-
const r =
|
|
547
|
-
const i =
|
|
524
|
+
}));
|
|
525
|
+
var A = (/* @__PURE__ */ l(((e, t) => {
|
|
526
|
+
const n = u("child_process");
|
|
527
|
+
const r = D();
|
|
528
|
+
const i = O();
|
|
548
529
|
function a(e, t, a) {
|
|
549
530
|
const o = r(e, t, a);
|
|
550
531
|
const s = n.spawn(o.command, o.args, o.options);
|
|
@@ -562,8 +543,8 @@ var R = _(h((exports, t) => {
|
|
|
562
543
|
t.exports.sync = o;
|
|
563
544
|
t.exports._parse = r;
|
|
564
545
|
t.exports._enoent = i;
|
|
565
|
-
})()
|
|
566
|
-
var
|
|
546
|
+
})))();
|
|
547
|
+
var j = class extends Error {
|
|
567
548
|
result;
|
|
568
549
|
output;
|
|
569
550
|
get exitCode() {
|
|
@@ -575,18 +556,18 @@ var z = class extends Error {
|
|
|
575
556
|
this.output = t;
|
|
576
557
|
}
|
|
577
558
|
};
|
|
578
|
-
const
|
|
559
|
+
const M = {
|
|
579
560
|
timeout: void 0,
|
|
580
561
|
persist: false
|
|
581
562
|
};
|
|
582
|
-
const
|
|
583
|
-
function
|
|
563
|
+
const N = { windowsHide: true };
|
|
564
|
+
function P(e, t) {
|
|
584
565
|
return {
|
|
585
566
|
command: normalize(e),
|
|
586
567
|
args: t ?? []
|
|
587
568
|
};
|
|
588
569
|
}
|
|
589
|
-
function
|
|
570
|
+
function F(e) {
|
|
590
571
|
const t = new AbortController();
|
|
591
572
|
for (const n of e) {
|
|
592
573
|
if (n.aborted) {
|
|
@@ -600,12 +581,12 @@ function U(e) {
|
|
|
600
581
|
}
|
|
601
582
|
return t.signal;
|
|
602
583
|
}
|
|
603
|
-
async function
|
|
584
|
+
async function I(e) {
|
|
604
585
|
let t = "";
|
|
605
586
|
for await (const n of e) t += n.toString();
|
|
606
587
|
return t;
|
|
607
588
|
}
|
|
608
|
-
var
|
|
589
|
+
var L = class {
|
|
609
590
|
_process;
|
|
610
591
|
_aborted = false;
|
|
611
592
|
_options;
|
|
@@ -625,7 +606,7 @@ var G = class {
|
|
|
625
606
|
}
|
|
626
607
|
constructor(e, t, n) {
|
|
627
608
|
this._options = {
|
|
628
|
-
...
|
|
609
|
+
...M,
|
|
629
610
|
...n
|
|
630
611
|
};
|
|
631
612
|
this._command = e;
|
|
@@ -644,7 +625,7 @@ var G = class {
|
|
|
644
625
|
return this._process?.killed === true;
|
|
645
626
|
}
|
|
646
627
|
pipe(e, t, n) {
|
|
647
|
-
return
|
|
628
|
+
return z(e, t, {
|
|
648
629
|
...n,
|
|
649
630
|
stdin: this
|
|
650
631
|
});
|
|
@@ -655,18 +636,18 @@ var G = class {
|
|
|
655
636
|
const t = [];
|
|
656
637
|
if (this._streamErr) t.push(this._streamErr);
|
|
657
638
|
if (this._streamOut) t.push(this._streamOut);
|
|
658
|
-
const n =
|
|
639
|
+
const n = g(t);
|
|
659
640
|
const r = ot.createInterface({ input: n });
|
|
660
641
|
for await (const e of r) yield e.toString();
|
|
661
642
|
await this._processClosed;
|
|
662
643
|
e.removeAllListeners();
|
|
663
644
|
if (this._thrownError) throw this._thrownError;
|
|
664
|
-
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
645
|
+
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new j(this);
|
|
665
646
|
}
|
|
666
647
|
async _waitForOutput() {
|
|
667
648
|
const e = this._process;
|
|
668
649
|
if (!e) throw new Error("No process was started");
|
|
669
|
-
const [t, n] = await Promise.all([this._streamOut ?
|
|
650
|
+
const [t, n] = await Promise.all([this._streamOut ? I(this._streamOut) : "", this._streamErr ? I(this._streamErr) : ""]);
|
|
670
651
|
await this._processClosed;
|
|
671
652
|
if (this._options?.stdin) await this._options.stdin;
|
|
672
653
|
e.removeAllListeners();
|
|
@@ -676,7 +657,7 @@ var G = class {
|
|
|
676
657
|
stdout: t,
|
|
677
658
|
exitCode: this.exitCode
|
|
678
659
|
};
|
|
679
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
660
|
+
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new j(this, r);
|
|
680
661
|
return r;
|
|
681
662
|
}
|
|
682
663
|
then(e, t) {
|
|
@@ -688,7 +669,7 @@ var G = class {
|
|
|
688
669
|
const e = cwd();
|
|
689
670
|
const n = this._options;
|
|
690
671
|
const r = {
|
|
691
|
-
...
|
|
672
|
+
...N,
|
|
692
673
|
...n.nodeOptions
|
|
693
674
|
};
|
|
694
675
|
const i = [];
|
|
@@ -696,10 +677,10 @@ var G = class {
|
|
|
696
677
|
if (n.timeout !== void 0) i.push(AbortSignal.timeout(n.timeout));
|
|
697
678
|
if (n.signal !== void 0) i.push(n.signal);
|
|
698
679
|
if (n.persist === true) r.detached = true;
|
|
699
|
-
if (i.length > 0) r.signal =
|
|
700
|
-
r.env =
|
|
701
|
-
const { command: a, args: s } =
|
|
702
|
-
const c = (0,
|
|
680
|
+
if (i.length > 0) r.signal = F(i);
|
|
681
|
+
r.env = h(e, r.env);
|
|
682
|
+
const { command: a, args: s } = P(this._command, this._args);
|
|
683
|
+
const c = (0, A._parse)(a, s, r);
|
|
703
684
|
const l = spawn(c.command, c.args, c.options);
|
|
704
685
|
if (l.stderr) this._streamErr = l.stderr;
|
|
705
686
|
if (l.stdout) this._streamOut = l.stdout;
|
|
@@ -729,12 +710,12 @@ var G = class {
|
|
|
729
710
|
if (this._resolveClose) this._resolveClose();
|
|
730
711
|
};
|
|
731
712
|
};
|
|
732
|
-
const
|
|
733
|
-
const r = new
|
|
713
|
+
const R = (e, t, n) => {
|
|
714
|
+
const r = new L(e, t, n);
|
|
734
715
|
r.spawn();
|
|
735
716
|
return r;
|
|
736
717
|
};
|
|
737
|
-
const
|
|
718
|
+
const z = R;
|
|
738
719
|
//#endregion
|
|
739
720
|
//#region ../../node_modules/.pnpm/lint-staged@16.3.2/node_modules/lint-staged/lib/execGit.js
|
|
740
721
|
const debugLog$15 = createDebug("lint-staged:execGit");
|
|
@@ -747,7 +728,7 @@ const NO_SUBMODULE_RECURSE = ["-c", "submodule.recurse=false"];
|
|
|
747
728
|
/** @type {(cmd: string[], options?: { cwd?: string }) => Promise<string>} */
|
|
748
729
|
const execGit = async (cmd, options) => {
|
|
749
730
|
debugLog$15("Running git command:", cmd);
|
|
750
|
-
const result =
|
|
731
|
+
const result = z("git", [...NO_SUBMODULE_RECURSE, ...cmd], { nodeOptions: {
|
|
751
732
|
cwd: options?.cwd,
|
|
752
733
|
stdio: ["ignore"]
|
|
753
734
|
} });
|
|
@@ -6593,7 +6574,7 @@ const getSpawnedTask = ({ abortController, color, command, continueOnError = fal
|
|
|
6593
6574
|
debugLog$12("Tinyexec options:", tinyExecOptions);
|
|
6594
6575
|
/** @param {ReturnType<typeof getInitialState>} ctx context */
|
|
6595
6576
|
return async (ctx = getInitialState()) => {
|
|
6596
|
-
const result =
|
|
6577
|
+
const result = z(cmd, isFn ? args : args.concat(files), tinyExecOptions);
|
|
6597
6578
|
const taskFailed = () => result.exitCode > 0 || result.process?.signalCode;
|
|
6598
6579
|
/** @type {keyof typeof Signal | undefined} */
|
|
6599
6580
|
let signal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plus",
|
|
3
|
-
"version": "0.1.12
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -312,10 +312,10 @@
|
|
|
312
312
|
"cross-spawn": "^7.0.5",
|
|
313
313
|
"oxfmt": "=0.40.0",
|
|
314
314
|
"oxlint": "=1.55.0",
|
|
315
|
-
"oxlint-tsgolint": "=0.
|
|
315
|
+
"oxlint-tsgolint": "=0.17.0",
|
|
316
316
|
"picocolors": "^1.1.1",
|
|
317
|
-
"@voidzero-dev/vite-plus-
|
|
318
|
-
"@voidzero-dev/vite-plus-
|
|
317
|
+
"@voidzero-dev/vite-plus-test": "0.1.12",
|
|
318
|
+
"@voidzero-dev/vite-plus-core": "0.1.12"
|
|
319
319
|
},
|
|
320
320
|
"devDependencies": {
|
|
321
321
|
"@napi-rs/cli": "^3.4.1",
|
|
@@ -333,12 +333,12 @@
|
|
|
333
333
|
"mri": "^1.2.0",
|
|
334
334
|
"rolldown-plugin-dts": "^0.22.0",
|
|
335
335
|
"semver": "^7.7.3",
|
|
336
|
-
"tsdown": "^0.21.
|
|
336
|
+
"tsdown": "^0.21.3",
|
|
337
337
|
"validate-npm-package-name": "^7.0.2",
|
|
338
338
|
"yaml": "^2.8.1",
|
|
339
339
|
"@voidzero-dev/vite-plus-prompts": "0.0.0",
|
|
340
340
|
"rolldown": "1.0.0-rc.9",
|
|
341
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.12
|
|
341
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.12"
|
|
342
342
|
},
|
|
343
343
|
"napi": {
|
|
344
344
|
"binaryName": "vite-plus",
|
|
@@ -356,12 +356,12 @@
|
|
|
356
356
|
"node": "^20.19.0 || >=22.12.0"
|
|
357
357
|
},
|
|
358
358
|
"optionalDependencies": {
|
|
359
|
-
"@voidzero-dev/vite-plus-darwin-arm64": "0.1.12
|
|
360
|
-
"@voidzero-dev/vite-plus-darwin-x64": "0.1.12
|
|
361
|
-
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.12
|
|
362
|
-
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.12
|
|
363
|
-
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.12
|
|
364
|
-
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.12
|
|
359
|
+
"@voidzero-dev/vite-plus-darwin-arm64": "0.1.12",
|
|
360
|
+
"@voidzero-dev/vite-plus-darwin-x64": "0.1.12",
|
|
361
|
+
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.12",
|
|
362
|
+
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.12",
|
|
363
|
+
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.12",
|
|
364
|
+
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.12"
|
|
365
365
|
},
|
|
366
366
|
"scripts": {
|
|
367
367
|
"build": "oxnode -C dev ./build.ts",
|