@voidzero-dev/vite-plus-prompts 1.1.0 → 1.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/dist/index.d.mts +2 -2
- package/dist/index.mjs +14 -14
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -326,8 +326,8 @@ export declare const outro: (message?: string, opts?: CommonOptions) => void;
|
|
|
326
326
|
* piped output never see these markers as content (they only update the
|
|
327
327
|
* window title, which the runner's PTY captures).
|
|
328
328
|
*
|
|
329
|
-
* Protocol (shared with vite-task's `
|
|
330
|
-
* `OSC 2 ; pty-terminal-test:<32-hex-id>:<base64url(name)> ST`. The runner
|
|
329
|
+
* Protocol (shared with vite-task's `vt_pty_terminal_test_client` crate):
|
|
330
|
+
* `OSC 2 ; vt-pty-terminal-test:<32-hex-id>:<base64url(name)> ST`. The runner
|
|
331
331
|
* decodes the title with `decode_milestone_title`, ignoring ordinary title
|
|
332
332
|
* updates. A fresh random id per emission keeps repeated milestones with the
|
|
333
333
|
* same name observable as distinct title changes through Windows ConPTY.
|
package/dist/index.mjs
CHANGED
|
@@ -925,13 +925,13 @@ const box = (message = "", title = "", opts) => {
|
|
|
925
925
|
* piped output never see these markers as content (they only update the
|
|
926
926
|
* window title, which the runner's PTY captures).
|
|
927
927
|
*
|
|
928
|
-
* Protocol (shared with vite-task's `
|
|
929
|
-
* `OSC 2 ; pty-terminal-test:<32-hex-id>:<base64url(name)> ST`. The runner
|
|
928
|
+
* Protocol (shared with vite-task's `vt_pty_terminal_test_client` crate):
|
|
929
|
+
* `OSC 2 ; vt-pty-terminal-test:<32-hex-id>:<base64url(name)> ST`. The runner
|
|
930
930
|
* decodes the title with `decode_milestone_title`, ignoring ordinary title
|
|
931
931
|
* updates. A fresh random id per emission keeps repeated milestones with the
|
|
932
932
|
* same name observable as distinct title changes through Windows ConPTY.
|
|
933
933
|
*/
|
|
934
|
-
const MILESTONE_TITLE_MARKER = "pty-terminal-test:";
|
|
934
|
+
const MILESTONE_TITLE_MARKER = "vt-pty-terminal-test:";
|
|
935
935
|
const OSC2_OPEN = "\x1B]2;";
|
|
936
936
|
const ST = "\x1B\\";
|
|
937
937
|
const MILESTONES_ENABLED = process.env.VP_EMIT_MILESTONES === "1";
|
|
@@ -1096,9 +1096,9 @@ const log = {
|
|
|
1096
1096
|
const parts = [];
|
|
1097
1097
|
const hasGuide = getGuide({ withGuide });
|
|
1098
1098
|
const spacingString = !hasGuide ? "" : secondarySymbol;
|
|
1099
|
-
const prefix = symbol ? `${symbol}
|
|
1099
|
+
const prefix = symbol ? `${symbol} ` : hasGuide ? `${secondarySymbol} ` : "";
|
|
1100
1100
|
const marker = symbol ?? secondarySymbol;
|
|
1101
|
-
const secondaryPrefix = hasGuide ? `${secondarySymbol}
|
|
1101
|
+
const secondaryPrefix = hasGuide ? `${secondarySymbol} ` : symbol ? " " : "";
|
|
1102
1102
|
for (let i = 0; i < spacing; i++) parts.push(spacingString);
|
|
1103
1103
|
const messageParts = Array.isArray(message) ? message : message.split("\n");
|
|
1104
1104
|
if (messageParts.length > 0) {
|
|
@@ -1447,11 +1447,11 @@ const spinner = ({ indicator = "dots", onCancel, output = process.stdout, cancel
|
|
|
1447
1447
|
clearPrevMessage();
|
|
1448
1448
|
const frame = styleFn(frames[frameIndex] ?? (unicode ? "◒" : "o"));
|
|
1449
1449
|
let outputMessage;
|
|
1450
|
-
if (isCI$1) outputMessage = `${frame}
|
|
1451
|
-
else if (indicator === "timer") outputMessage = `${frame}
|
|
1450
|
+
if (isCI$1) outputMessage = `${frame} ${_message}...`;
|
|
1451
|
+
else if (indicator === "timer") outputMessage = `${frame} ${_message} ${formatTimer(getElapsedMs())}`;
|
|
1452
1452
|
else {
|
|
1453
1453
|
const loadingDots = ".".repeat(Math.floor(indicatorTimer)).slice(0, 3);
|
|
1454
|
-
outputMessage = `${frame}
|
|
1454
|
+
outputMessage = `${frame} ${_message}${loadingDots}`;
|
|
1455
1455
|
}
|
|
1456
1456
|
const wrapped = wrapAnsi(outputMessage, columns, {
|
|
1457
1457
|
hard: true,
|
|
@@ -1683,11 +1683,11 @@ const selectKey = (opts) => {
|
|
|
1683
1683
|
};
|
|
1684
1684
|
//#endregion
|
|
1685
1685
|
//#region src/stream.ts
|
|
1686
|
-
const prefix = "
|
|
1686
|
+
const prefix = " ";
|
|
1687
1687
|
const stream = {
|
|
1688
1688
|
message: async (iterable, { symbol = "" } = {}) => {
|
|
1689
|
-
process.stdout.write(symbol ? `${symbol}
|
|
1690
|
-
const initialWidth = symbol ?
|
|
1689
|
+
process.stdout.write(symbol ? `${symbol} ` : "");
|
|
1690
|
+
const initialWidth = symbol ? 2 : 0;
|
|
1691
1691
|
let lineWidth = initialWidth;
|
|
1692
1692
|
for await (let chunk of iterable) {
|
|
1693
1693
|
chunk = chunk.replace(/\n/g, `\n${prefix}`);
|
|
@@ -1751,11 +1751,11 @@ const taskLog = (opts) => {
|
|
|
1751
1751
|
const secondarySymbol = color.gray(S_BAR);
|
|
1752
1752
|
const spacing = opts.spacing ?? 0;
|
|
1753
1753
|
const hasGuide = getGuide(opts);
|
|
1754
|
-
const barSize = hasGuide ?
|
|
1754
|
+
const barSize = hasGuide ? 2 : 0;
|
|
1755
1755
|
const retainLog = opts.retainLog === true;
|
|
1756
1756
|
const isTTY$1 = !isCI() && isTTY(output);
|
|
1757
1757
|
if (hasGuide) output.write(`${secondarySymbol}\n`);
|
|
1758
|
-
output.write(`${completeColor(S_STEP_SUBMIT)}
|
|
1758
|
+
output.write(`${completeColor(S_STEP_SUBMIT)} ${opts.title}\n`);
|
|
1759
1759
|
for (let i = 0; i < spacing; i++) output.write(`${hasGuide ? secondarySymbol : ""}\n`);
|
|
1760
1760
|
const buffers = [{
|
|
1761
1761
|
value: "",
|
|
@@ -1773,7 +1773,7 @@ const taskLog = (opts) => {
|
|
|
1773
1773
|
if (result === void 0 && buffer.header !== void 0 && buffer.header !== "") text += `\n${buffer.header}`;
|
|
1774
1774
|
const bufferHeight = text.split("\n").reduce((count, line) => {
|
|
1775
1775
|
if (line === "") return count + 1;
|
|
1776
|
-
return count + Math.ceil((fastStringWidth$1(line) + (result ?
|
|
1776
|
+
return count + Math.ceil((fastStringWidth$1(line) + (result ? 2 : barSize)) / columns);
|
|
1777
1777
|
}, 0);
|
|
1778
1778
|
lines += bufferHeight;
|
|
1779
1779
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidzero-dev/vite-plus-prompts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"fast-string-width": "^1.1.0",
|
|
33
33
|
"fast-wrap-ansi": "^0.2.0",
|
|
34
34
|
"is-unicode-supported": "^1.3.0",
|
|
35
|
-
"tsdown": "^0.23.
|
|
35
|
+
"tsdown": "^0.23.1"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsdown"
|