Skip to content

Commit b288987

Browse files
angular-robotjosephperrott
authored andcommitted
build: lock file maintenance (#2231)
PR Close #2231
1 parent 9e9d326 commit b288987

File tree

6 files changed

+564
-948
lines changed

6 files changed

+564
-948
lines changed

.github/local-actions/branch-manager/main.js

Lines changed: 36 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -41264,7 +41264,7 @@ function useKeypress(userHandler) {
4126441264
const handler2 = withUpdates((_input, event) => {
4126541265
if (ignore)
4126641266
return;
41267-
signal.current(event, rl);
41267+
void signal.current(event, rl);
4126841268
});
4126941269
rl.input.on("keypress", handler2);
4127041270
return () => {
@@ -41611,6 +41611,9 @@ var import_strip_ansi = __toESM(require_strip_ansi(), 1);
4161141611
var import_ansi_escapes = __toESM(require_ansi_escapes(), 1);
4161241612
var height = (content) => content.split("\n").length;
4161341613
var lastLine = (content) => content.split("\n").pop() ?? "";
41614+
function cursorDown(n) {
41615+
return n > 0 ? import_ansi_escapes.default.cursorDown(n) : "";
41616+
}
4161441617
var ScreenManager = class {
4161541618
rl;
4161641619
height = 0;
@@ -41621,6 +41624,11 @@ var ScreenManager = class {
4162141624
this.rl = rl;
4162241625
this.cursorPos = rl.getCursorPos();
4162341626
}
41627+
write(content) {
41628+
this.rl.output.unmute();
41629+
this.rl.output.write(content);
41630+
this.rl.output.mute();
41631+
}
4162441632
render(content, bottomContent = "") {
4162541633
const promptLine = lastLine(content);
4162641634
const rawPromptLine = (0, import_strip_ansi.default)(promptLine);
@@ -41642,44 +41650,23 @@ var ScreenManager = class {
4164241650
if (bottomContentHeight > 0)
4164341651
output += import_ansi_escapes.default.cursorUp(bottomContentHeight);
4164441652
output += import_ansi_escapes.default.cursorTo(this.cursorPos.cols);
41645-
this.clean();
41646-
this.rl.output.unmute();
41653+
this.write(cursorDown(this.extraLinesUnderPrompt) + import_ansi_escapes.default.eraseLines(this.height) + output);
4164741654
this.extraLinesUnderPrompt = bottomContentHeight;
4164841655
this.height = height(output);
41649-
this.rl.output.write(output);
41650-
this.rl.output.mute();
4165141656
}
4165241657
checkCursorPos() {
4165341658
const cursorPos = this.rl.getCursorPos();
4165441659
if (cursorPos.cols !== this.cursorPos.cols) {
41655-
this.rl.output.unmute();
41656-
this.rl.output.write(import_ansi_escapes.default.cursorTo(cursorPos.cols));
41657-
this.rl.output.mute();
41660+
this.write(import_ansi_escapes.default.cursorTo(cursorPos.cols));
4165841661
this.cursorPos = cursorPos;
4165941662
}
4166041663
}
41661-
clean() {
41662-
this.rl.output.unmute();
41663-
this.rl.output.write([
41664-
this.extraLinesUnderPrompt > 0 ? import_ansi_escapes.default.cursorDown(this.extraLinesUnderPrompt) : "",
41665-
import_ansi_escapes.default.eraseLines(this.height)
41666-
].join(""));
41667-
this.extraLinesUnderPrompt = 0;
41668-
this.rl.output.mute();
41669-
}
41670-
clearContent() {
41671-
this.rl.output.unmute();
41672-
this.rl.output.write([
41673-
this.extraLinesUnderPrompt > 0 ? import_ansi_escapes.default.cursorDown(this.extraLinesUnderPrompt) : "",
41674-
"\n"
41675-
].join(""));
41676-
this.rl.output.mute();
41677-
}
41678-
done() {
41664+
done({ clearContent }) {
4167941665
this.rl.setPrompt("");
41680-
this.rl.output.unmute();
41681-
this.rl.output.write(import_ansi_escapes.default.cursorShow);
41682-
this.rl.output.end();
41666+
let output = cursorDown(this.extraLinesUnderPrompt);
41667+
output += clearContent ? import_ansi_escapes.default.eraseLines(this.height) : "\n";
41668+
output += import_ansi_escapes.default.cursorShow;
41669+
this.write(output);
4168341670
this.rl.close();
4168441671
}
4168541672
};
@@ -41716,12 +41703,7 @@ function createPrompt(view) {
4171641703
});
4171741704
function onExit2() {
4171841705
hooksCleanup();
41719-
if (context2 == null ? void 0 : context2.clearPromptOnDone) {
41720-
screen.clean();
41721-
} else {
41722-
screen.clearContent();
41723-
}
41724-
screen.done();
41706+
screen.done({ clearContent: Boolean(context2 == null ? void 0 : context2.clearPromptOnDone) });
4172541707
removeExitListener();
4172641708
rl.input.removeListener("keypress", checkCursorPos);
4172741709
rl.removeListener("close", hooksCleanup);
@@ -42154,7 +42136,7 @@ var esm_default2 = createPrompt((config, done) => {
4215442136
if (Separator.isSeparator(item)) {
4215542137
return ` ${item.separator}`;
4215642138
}
42157-
const line = item.name || item.value;
42139+
const line = String(item.name || item.value);
4215842140
if (item.disabled) {
4215942141
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
4216042142
return theme.style.disabledChoice(`${line} ${disabledLabel}`);
@@ -42205,7 +42187,7 @@ ${page}${helpTipBottom}${error2}${import_ansi_escapes2.default.cursorHide}`;
4220542187
var import_external_editor = __toESM(require_main2(), 1);
4220642188
import { AsyncResource as AsyncResource4 } from "node:async_hooks";
4220742189
var esm_default3 = createPrompt((config, done) => {
42208-
const { waitForUseInput = true, validate = () => true } = config;
42190+
const { waitForUseInput = true, postfix = ".txt", validate = () => true } = config;
4220942191
const theme = makeTheme(config.theme);
4221042192
const [status, setStatus] = useState("pending");
4221142193
const [value, setValue] = useState(config.default || "");
@@ -42214,30 +42196,25 @@ var esm_default3 = createPrompt((config, done) => {
4221442196
const prefix = usePrefix({ isLoading, theme });
4221542197
function startEditor(rl) {
4221642198
rl.pause();
42217-
(0, import_external_editor.editAsync)(
42218-
value,
42219-
AsyncResource4.bind(async (error3, answer) => {
42220-
rl.resume();
42221-
if (error3) {
42222-
setError(error3.toString());
42199+
const editCallback = AsyncResource4.bind(async (error3, answer) => {
42200+
rl.resume();
42201+
if (error3) {
42202+
setError(error3.toString());
42203+
} else {
42204+
setStatus("loading");
42205+
const isValid = await validate(answer);
42206+
if (isValid === true) {
42207+
setError(void 0);
42208+
setStatus("done");
42209+
done(answer);
4222342210
} else {
42224-
setStatus("loading");
42225-
const isValid = await validate(answer);
42226-
if (isValid === true) {
42227-
setError(void 0);
42228-
setStatus("done");
42229-
done(answer);
42230-
} else {
42231-
setValue(answer);
42232-
setError(isValid || "You must provide a valid value");
42233-
setStatus("pending");
42234-
}
42211+
setValue(answer);
42212+
setError(isValid || "You must provide a valid value");
42213+
setStatus("pending");
4223542214
}
42236-
}),
42237-
{
42238-
postfix: config.postfix || ".txt"
4223942215
}
42240-
);
42216+
});
42217+
(0, import_external_editor.editAsync)(value, (error3, answer) => void editCallback(error3, answer), { postfix });
4224142218
}
4224242219
useEffect((rl) => {
4224342220
if (!waitForUseInput) {
@@ -42456,7 +42433,7 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
4245642433
if (Separator.isSeparator(item)) {
4245742434
return ` ${item.separator}`;
4245842435
}
42459-
const line = item.name || item.value;
42436+
const line = String(item.name || item.value);
4246042437
if (item.disabled) {
4246142438
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
4246242439
return theme.style.disabled(`${line} ${disabledLabel}`);

.github/local-actions/changelog/main.js

Lines changed: 36 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -40827,7 +40827,7 @@ function useKeypress(userHandler) {
4082740827
const handler2 = withUpdates((_input, event) => {
4082840828
if (ignore)
4082940829
return;
40830-
signal.current(event, rl);
40830+
void signal.current(event, rl);
4083140831
});
4083240832
rl.input.on("keypress", handler2);
4083340833
return () => {
@@ -41174,6 +41174,9 @@ var import_strip_ansi = __toESM(require_strip_ansi(), 1);
4117441174
var import_ansi_escapes = __toESM(require_ansi_escapes(), 1);
4117541175
var height = (content) => content.split("\n").length;
4117641176
var lastLine = (content) => content.split("\n").pop() ?? "";
41177+
function cursorDown(n) {
41178+
return n > 0 ? import_ansi_escapes.default.cursorDown(n) : "";
41179+
}
4117741180
var ScreenManager = class {
4117841181
rl;
4117941182
height = 0;
@@ -41184,6 +41187,11 @@ var ScreenManager = class {
4118441187
this.rl = rl;
4118541188
this.cursorPos = rl.getCursorPos();
4118641189
}
41190+
write(content) {
41191+
this.rl.output.unmute();
41192+
this.rl.output.write(content);
41193+
this.rl.output.mute();
41194+
}
4118741195
render(content, bottomContent = "") {
4118841196
const promptLine = lastLine(content);
4118941197
const rawPromptLine = (0, import_strip_ansi.default)(promptLine);
@@ -41205,44 +41213,23 @@ var ScreenManager = class {
4120541213
if (bottomContentHeight > 0)
4120641214
output += import_ansi_escapes.default.cursorUp(bottomContentHeight);
4120741215
output += import_ansi_escapes.default.cursorTo(this.cursorPos.cols);
41208-
this.clean();
41209-
this.rl.output.unmute();
41216+
this.write(cursorDown(this.extraLinesUnderPrompt) + import_ansi_escapes.default.eraseLines(this.height) + output);
4121041217
this.extraLinesUnderPrompt = bottomContentHeight;
4121141218
this.height = height(output);
41212-
this.rl.output.write(output);
41213-
this.rl.output.mute();
4121441219
}
4121541220
checkCursorPos() {
4121641221
const cursorPos = this.rl.getCursorPos();
4121741222
if (cursorPos.cols !== this.cursorPos.cols) {
41218-
this.rl.output.unmute();
41219-
this.rl.output.write(import_ansi_escapes.default.cursorTo(cursorPos.cols));
41220-
this.rl.output.mute();
41223+
this.write(import_ansi_escapes.default.cursorTo(cursorPos.cols));
4122141224
this.cursorPos = cursorPos;
4122241225
}
4122341226
}
41224-
clean() {
41225-
this.rl.output.unmute();
41226-
this.rl.output.write([
41227-
this.extraLinesUnderPrompt > 0 ? import_ansi_escapes.default.cursorDown(this.extraLinesUnderPrompt) : "",
41228-
import_ansi_escapes.default.eraseLines(this.height)
41229-
].join(""));
41230-
this.extraLinesUnderPrompt = 0;
41231-
this.rl.output.mute();
41232-
}
41233-
clearContent() {
41234-
this.rl.output.unmute();
41235-
this.rl.output.write([
41236-
this.extraLinesUnderPrompt > 0 ? import_ansi_escapes.default.cursorDown(this.extraLinesUnderPrompt) : "",
41237-
"\n"
41238-
].join(""));
41239-
this.rl.output.mute();
41240-
}
41241-
done() {
41227+
done({ clearContent }) {
4124241228
this.rl.setPrompt("");
41243-
this.rl.output.unmute();
41244-
this.rl.output.write(import_ansi_escapes.default.cursorShow);
41245-
this.rl.output.end();
41229+
let output = cursorDown(this.extraLinesUnderPrompt);
41230+
output += clearContent ? import_ansi_escapes.default.eraseLines(this.height) : "\n";
41231+
output += import_ansi_escapes.default.cursorShow;
41232+
this.write(output);
4124641233
this.rl.close();
4124741234
}
4124841235
};
@@ -41279,12 +41266,7 @@ function createPrompt(view) {
4127941266
});
4128041267
function onExit2() {
4128141268
hooksCleanup();
41282-
if (context3 == null ? void 0 : context3.clearPromptOnDone) {
41283-
screen.clean();
41284-
} else {
41285-
screen.clearContent();
41286-
}
41287-
screen.done();
41269+
screen.done({ clearContent: Boolean(context3 == null ? void 0 : context3.clearPromptOnDone) });
4128841270
removeExitListener();
4128941271
rl.input.removeListener("keypress", checkCursorPos);
4129041272
rl.removeListener("close", hooksCleanup);
@@ -41717,7 +41699,7 @@ var esm_default2 = createPrompt((config2, done) => {
4171741699
if (Separator.isSeparator(item)) {
4171841700
return ` ${item.separator}`;
4171941701
}
41720-
const line = item.name || item.value;
41702+
const line = String(item.name || item.value);
4172141703
if (item.disabled) {
4172241704
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
4172341705
return theme.style.disabledChoice(`${line} ${disabledLabel}`);
@@ -41768,7 +41750,7 @@ ${page}${helpTipBottom}${error2}${import_ansi_escapes2.default.cursorHide}`;
4176841750
var import_external_editor = __toESM(require_main2(), 1);
4176941751
import { AsyncResource as AsyncResource4 } from "node:async_hooks";
4177041752
var esm_default3 = createPrompt((config2, done) => {
41771-
const { waitForUseInput = true, validate = () => true } = config2;
41753+
const { waitForUseInput = true, postfix = ".txt", validate = () => true } = config2;
4177241754
const theme = makeTheme(config2.theme);
4177341755
const [status, setStatus] = useState("pending");
4177441756
const [value, setValue] = useState(config2.default || "");
@@ -41777,30 +41759,25 @@ var esm_default3 = createPrompt((config2, done) => {
4177741759
const prefix = usePrefix({ isLoading, theme });
4177841760
function startEditor(rl) {
4177941761
rl.pause();
41780-
(0, import_external_editor.editAsync)(
41781-
value,
41782-
AsyncResource4.bind(async (error3, answer) => {
41783-
rl.resume();
41784-
if (error3) {
41785-
setError(error3.toString());
41762+
const editCallback = AsyncResource4.bind(async (error3, answer) => {
41763+
rl.resume();
41764+
if (error3) {
41765+
setError(error3.toString());
41766+
} else {
41767+
setStatus("loading");
41768+
const isValid = await validate(answer);
41769+
if (isValid === true) {
41770+
setError(void 0);
41771+
setStatus("done");
41772+
done(answer);
4178641773
} else {
41787-
setStatus("loading");
41788-
const isValid = await validate(answer);
41789-
if (isValid === true) {
41790-
setError(void 0);
41791-
setStatus("done");
41792-
done(answer);
41793-
} else {
41794-
setValue(answer);
41795-
setError(isValid || "You must provide a valid value");
41796-
setStatus("pending");
41797-
}
41774+
setValue(answer);
41775+
setError(isValid || "You must provide a valid value");
41776+
setStatus("pending");
4179841777
}
41799-
}),
41800-
{
41801-
postfix: config2.postfix || ".txt"
4180241778
}
41803-
);
41779+
});
41780+
(0, import_external_editor.editAsync)(value, (error3, answer) => void editCallback(error3, answer), { postfix });
4180441781
}
4180541782
useEffect((rl) => {
4180641783
if (!waitForUseInput) {
@@ -42019,7 +41996,7 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
4201941996
if (Separator.isSeparator(item)) {
4202041997
return ` ${item.separator}`;
4202141998
}
42022-
const line = item.name || item.value;
41999+
const line = String(item.name || item.value);
4202342000
if (item.disabled) {
4202442001
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
4202542002
return theme.style.disabled(`${line} ${disabledLabel}`);

0 commit comments

Comments
 (0)