Skip to content

Commit 54d5678

Browse files
angular-robotjosephperrott
authored andcommitted
build: lock file maintenance (#2752)
PR Close #2752
1 parent 46b5942 commit 54d5678

File tree

4 files changed

+498
-89
lines changed

4 files changed

+498
-89
lines changed

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

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61187,22 +61187,36 @@ function normalizeChoices3(choices) {
6118761187
};
6118861188
});
6118961189
}
61190+
function getSelectedChoice(input, choices) {
61191+
let selectedChoice;
61192+
const selectableChoices = choices.filter(isSelectableChoice);
61193+
if (numberRegex.test(input)) {
61194+
const answer = Number.parseInt(input, 10) - 1;
61195+
selectedChoice = selectableChoices[answer];
61196+
} else {
61197+
selectedChoice = selectableChoices.find((choice) => choice.key === input);
61198+
}
61199+
return selectedChoice ? [selectedChoice, choices.indexOf(selectedChoice)] : [void 0, void 0];
61200+
}
6119061201
var esm_default8 = createPrompt((config2, done) => {
61202+
const { loop = true } = config2;
6119161203
const choices = useMemo(() => normalizeChoices3(config2.choices), [config2.choices]);
6119261204
const [status, setStatus] = useState("idle");
6119361205
const [value, setValue] = useState("");
6119461206
const [errorMsg, setError] = useState();
6119561207
const theme = makeTheme(config2.theme);
6119661208
const prefix = usePrefix({ status, theme });
61209+
const bounds = useMemo(() => {
61210+
const first = choices.findIndex(isSelectableChoice);
61211+
const last = choices.findLastIndex(isSelectableChoice);
61212+
if (first === -1) {
61213+
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
61214+
}
61215+
return { first, last };
61216+
}, [choices]);
6119761217
useKeypress((key, rl) => {
6119861218
if (isEnterKey(key)) {
61199-
let selectedChoice;
61200-
if (numberRegex.test(value)) {
61201-
const answer = Number.parseInt(value, 10) - 1;
61202-
selectedChoice = choices.filter(isSelectableChoice)[answer];
61203-
} else {
61204-
selectedChoice = choices.find((choice) => isSelectableChoice(choice) && choice.key === value);
61205-
}
61219+
const [selectedChoice] = getSelectedChoice(value, choices);
6120661220
if (isSelectableChoice(selectedChoice)) {
6120761221
setValue(selectedChoice.short);
6120861222
setStatus("done");
@@ -61212,6 +61226,20 @@ var esm_default8 = createPrompt((config2, done) => {
6121261226
} else {
6121361227
setError(`"${import_yoctocolors_cjs5.default.red(value)}" isn't an available option`);
6121461228
}
61229+
} else if (key.name === "up" || key.name === "down") {
61230+
rl.clearLine(0);
61231+
const [selectedChoice, active] = getSelectedChoice(value, choices);
61232+
if (!selectedChoice) {
61233+
const firstChoice = key.name === "down" ? choices.find(isSelectableChoice) : choices.findLast(isSelectableChoice);
61234+
setValue(firstChoice.key);
61235+
} else if (loop || key.name === "up" && active !== bounds.first || key.name === "down" && active !== bounds.last) {
61236+
const offset = key.name === "up" ? -1 : 1;
61237+
let next = active;
61238+
do {
61239+
next = (next + offset + choices.length) % choices.length;
61240+
} while (!isSelectableChoice(choices[next]));
61241+
setValue(choices[next].key);
61242+
}
6121561243
} else {
6121661244
setValue(rl.line);
6121761245
setError(void 0);
@@ -61498,6 +61526,7 @@ function normalizeChoices5(choices) {
6149861526
});
6149961527
}
6150061528
var esm_default11 = createPrompt((config2, done) => {
61529+
var _a, _b;
6150161530
const { loop = true, pageSize = 7 } = config2;
6150261531
const firstRender = useRef(true);
6150361532
const theme = makeTheme(selectTheme, config2.theme);
@@ -61571,9 +61600,9 @@ var esm_default11 = createPrompt((config2, done) => {
6157161600
firstRender.current = false;
6157261601
if (items.length > pageSize) {
6157361602
helpTipBottom = `
61574-
${theme.style.help("(Use arrow keys to reveal more choices)")}`;
61603+
${theme.style.help(`(${((_a = config2.instructions) == null ? void 0 : _a.pager) ?? "Use arrow keys to reveal more choices"})`)}`;
6157561604
} else {
61576-
helpTipTop = theme.style.help("(Use arrow keys)");
61605+
helpTipTop = theme.style.help(`(${((_b = config2.instructions) == null ? void 0 : _b.navigation) ?? "Use arrow keys"})`);
6157761606
}
6157861607
}
6157961608
const page = usePagination({

.github/ng-renovate/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,11 +2538,11 @@ __metadata:
25382538
linkType: hard
25392539

25402540
"@types/node@npm:*, @types/node@npm:>=13.7.0":
2541-
version: 22.14.1
2542-
resolution: "@types/node@npm:22.14.1"
2541+
version: 22.15.3
2542+
resolution: "@types/node@npm:22.15.3"
25432543
dependencies:
25442544
undici-types: "npm:~6.21.0"
2545-
checksum: 10c0/d49c4d00403b1c2348cf0701b505fd636d80aabe18102105998dc62fdd36dcaf911e73c7a868c48c21c1022b825c67b475b65b1222d84b704d8244d152bb7f86
2545+
checksum: 10c0/2879f012d1aeba0bfdb5fed80d165f4f2cb3d1f2e1f98a24b18d4a211b4ace7d64bf2622784c78355982ffc1081ba79d0934efc2fb8353913e5871a63609661f
25462546
languageName: node
25472547
linkType: hard
25482548

bazel/pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)