From 8b5f9c0836946dbfa35a723e292440a82643fc3b Mon Sep 17 00:00:00 2001 From: Angular Robot Date: Sun, 6 Oct 2024 21:10:38 +0000 Subject: [PATCH] build: update dependency @inquirer/prompts to v7 --- .github/local-actions/branch-manager/main.js | 666 ++++++++++++++++--- .github/local-actions/changelog/main.js | 666 ++++++++++++++++--- github-actions/slash-commands/main.js | 666 ++++++++++++++++--- package.json | 2 +- yarn.lock | 174 ++++- 5 files changed, 1883 insertions(+), 291 deletions(-) diff --git a/.github/local-actions/branch-manager/main.js b/.github/local-actions/branch-manager/main.js index 6a453aaf6..0f4dcfd8d 100644 --- a/.github/local-actions/branch-manager/main.js +++ b/.github/local-actions/branch-manager/main.js @@ -21288,49 +21288,49 @@ var require_yoctocolors_cjs = __commonJS({ return result; }; }; - var colors5 = {}; - colors5.reset = format(0, 0); - colors5.bold = format(1, 22); - colors5.dim = format(2, 22); - colors5.italic = format(3, 23); - colors5.underline = format(4, 24); - colors5.overline = format(53, 55); - colors5.inverse = format(7, 27); - colors5.hidden = format(8, 28); - colors5.strikethrough = format(9, 29); - colors5.black = format(30, 39); - colors5.red = format(31, 39); - colors5.green = format(32, 39); - colors5.yellow = format(33, 39); - colors5.blue = format(34, 39); - colors5.magenta = format(35, 39); - colors5.cyan = format(36, 39); - colors5.white = format(37, 39); - colors5.gray = format(90, 39); - colors5.bgBlack = format(40, 49); - colors5.bgRed = format(41, 49); - colors5.bgGreen = format(42, 49); - colors5.bgYellow = format(43, 49); - colors5.bgBlue = format(44, 49); - colors5.bgMagenta = format(45, 49); - colors5.bgCyan = format(46, 49); - colors5.bgWhite = format(47, 49); - colors5.bgGray = format(100, 49); - colors5.redBright = format(91, 39); - colors5.greenBright = format(92, 39); - colors5.yellowBright = format(93, 39); - colors5.blueBright = format(94, 39); - colors5.magentaBright = format(95, 39); - colors5.cyanBright = format(96, 39); - colors5.whiteBright = format(97, 39); - colors5.bgRedBright = format(101, 49); - colors5.bgGreenBright = format(102, 49); - colors5.bgYellowBright = format(103, 49); - colors5.bgBlueBright = format(104, 49); - colors5.bgMagentaBright = format(105, 49); - colors5.bgCyanBright = format(106, 49); - colors5.bgWhiteBright = format(107, 49); - module.exports = colors5; + var colors8 = {}; + colors8.reset = format(0, 0); + colors8.bold = format(1, 22); + colors8.dim = format(2, 22); + colors8.italic = format(3, 23); + colors8.underline = format(4, 24); + colors8.overline = format(53, 55); + colors8.inverse = format(7, 27); + colors8.hidden = format(8, 28); + colors8.strikethrough = format(9, 29); + colors8.black = format(30, 39); + colors8.red = format(31, 39); + colors8.green = format(32, 39); + colors8.yellow = format(33, 39); + colors8.blue = format(34, 39); + colors8.magenta = format(35, 39); + colors8.cyan = format(36, 39); + colors8.white = format(37, 39); + colors8.gray = format(90, 39); + colors8.bgBlack = format(40, 49); + colors8.bgRed = format(41, 49); + colors8.bgGreen = format(42, 49); + colors8.bgYellow = format(43, 49); + colors8.bgBlue = format(44, 49); + colors8.bgMagenta = format(45, 49); + colors8.bgCyan = format(46, 49); + colors8.bgWhite = format(47, 49); + colors8.bgGray = format(100, 49); + colors8.redBright = format(91, 39); + colors8.greenBright = format(92, 39); + colors8.yellowBright = format(93, 39); + colors8.blueBright = format(94, 39); + colors8.magentaBright = format(95, 39); + colors8.cyanBright = format(96, 39); + colors8.whiteBright = format(97, 39); + colors8.bgRedBright = format(101, 49); + colors8.bgGreenBright = format(102, 49); + colors8.bgYellowBright = format(103, 49); + colors8.bgBlueBright = format(104, 49); + colors8.bgMagentaBright = format(105, 49); + colors8.bgCyanBright = format(106, 49); + colors8.bgWhiteBright = format(107, 49); + module.exports = colors8; } }); @@ -22820,14 +22820,14 @@ var require_lib2 = __commonJS({ var require_ansi_escapes = __commonJS({ ""(exports, module) { "use strict"; - var ansiEscapes4 = module.exports; - module.exports.default = ansiEscapes4; + var ansiEscapes5 = module.exports; + module.exports.default = ansiEscapes5; var ESC = "\x1B["; var OSC = "\x1B]"; var BEL = "\x07"; var SEP = ";"; var isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal"; - ansiEscapes4.cursorTo = (x, y) => { + ansiEscapes5.cursorTo = (x, y) => { if (typeof x !== "number") { throw new TypeError("The `x` argument is required"); } @@ -22836,7 +22836,7 @@ var require_ansi_escapes = __commonJS({ } return ESC + (y + 1) + ";" + (x + 1) + "H"; }; - ansiEscapes4.cursorMove = (x, y) => { + ansiEscapes5.cursorMove = (x, y) => { if (typeof x !== "number") { throw new TypeError("The `x` argument is required"); } @@ -22853,40 +22853,40 @@ var require_ansi_escapes = __commonJS({ } return ret; }; - ansiEscapes4.cursorUp = (count = 1) => ESC + count + "A"; - ansiEscapes4.cursorDown = (count = 1) => ESC + count + "B"; - ansiEscapes4.cursorForward = (count = 1) => ESC + count + "C"; - ansiEscapes4.cursorBackward = (count = 1) => ESC + count + "D"; - ansiEscapes4.cursorLeft = ESC + "G"; - ansiEscapes4.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s"; - ansiEscapes4.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u"; - ansiEscapes4.cursorGetPosition = ESC + "6n"; - ansiEscapes4.cursorNextLine = ESC + "E"; - ansiEscapes4.cursorPrevLine = ESC + "F"; - ansiEscapes4.cursorHide = ESC + "?25l"; - ansiEscapes4.cursorShow = ESC + "?25h"; - ansiEscapes4.eraseLines = (count) => { + ansiEscapes5.cursorUp = (count = 1) => ESC + count + "A"; + ansiEscapes5.cursorDown = (count = 1) => ESC + count + "B"; + ansiEscapes5.cursorForward = (count = 1) => ESC + count + "C"; + ansiEscapes5.cursorBackward = (count = 1) => ESC + count + "D"; + ansiEscapes5.cursorLeft = ESC + "G"; + ansiEscapes5.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s"; + ansiEscapes5.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u"; + ansiEscapes5.cursorGetPosition = ESC + "6n"; + ansiEscapes5.cursorNextLine = ESC + "E"; + ansiEscapes5.cursorPrevLine = ESC + "F"; + ansiEscapes5.cursorHide = ESC + "?25l"; + ansiEscapes5.cursorShow = ESC + "?25h"; + ansiEscapes5.eraseLines = (count) => { let clear = ""; for (let i = 0; i < count; i++) { - clear += ansiEscapes4.eraseLine + (i < count - 1 ? ansiEscapes4.cursorUp() : ""); + clear += ansiEscapes5.eraseLine + (i < count - 1 ? ansiEscapes5.cursorUp() : ""); } if (count) { - clear += ansiEscapes4.cursorLeft; + clear += ansiEscapes5.cursorLeft; } return clear; }; - ansiEscapes4.eraseEndLine = ESC + "K"; - ansiEscapes4.eraseStartLine = ESC + "1K"; - ansiEscapes4.eraseLine = ESC + "2K"; - ansiEscapes4.eraseDown = ESC + "J"; - ansiEscapes4.eraseUp = ESC + "1J"; - ansiEscapes4.eraseScreen = ESC + "2J"; - ansiEscapes4.scrollUp = ESC + "S"; - ansiEscapes4.scrollDown = ESC + "T"; - ansiEscapes4.clearScreen = "\x1Bc"; - ansiEscapes4.clearTerminal = process.platform === "win32" ? `${ansiEscapes4.eraseScreen}${ESC}0f` : `${ansiEscapes4.eraseScreen}${ESC}3J${ESC}H`; - ansiEscapes4.beep = BEL; - ansiEscapes4.link = (text, url) => { + ansiEscapes5.eraseEndLine = ESC + "K"; + ansiEscapes5.eraseStartLine = ESC + "1K"; + ansiEscapes5.eraseLine = ESC + "2K"; + ansiEscapes5.eraseDown = ESC + "J"; + ansiEscapes5.eraseUp = ESC + "1J"; + ansiEscapes5.eraseScreen = ESC + "2J"; + ansiEscapes5.scrollUp = ESC + "S"; + ansiEscapes5.scrollDown = ESC + "T"; + ansiEscapes5.clearScreen = "\x1Bc"; + ansiEscapes5.clearTerminal = process.platform === "win32" ? `${ansiEscapes5.eraseScreen}${ESC}0f` : `${ansiEscapes5.eraseScreen}${ESC}3J${ESC}H`; + ansiEscapes5.beep = BEL; + ansiEscapes5.link = (text, url) => { return [ OSC, "8", @@ -22902,7 +22902,7 @@ var require_ansi_escapes = __commonJS({ BEL ].join(""); }; - ansiEscapes4.image = (buffer, options = {}) => { + ansiEscapes5.image = (buffer, options = {}) => { let ret = `${OSC}1337;File=inline=1`; if (options.width) { ret += `;width=${options.width}`; @@ -22915,7 +22915,7 @@ var require_ansi_escapes = __commonJS({ } return ret + ":" + buffer.toString("base64") + BEL; }; - ansiEscapes4.iTerm = { + ansiEscapes5.iTerm = { setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`, annotation: (message, options = {}) => { let ret = `${OSC}1337;`; @@ -58135,7 +58135,7 @@ var esm_default2 = createPrompt((config, done) => { const bounds = useMemo(() => { const first = items.findIndex(isSelectable); const last = items.findLastIndex(isSelectable); - if (first < 0) { + if (first === -1) { throw new ValidationError("[checkbox prompt] No selectable choices. All choices are disabled."); } return { first, last }; @@ -58393,21 +58393,332 @@ var esm_default5 = createPrompt((config, done) => { ]; }); +// +function isStepOf(value, step, min) { + const valuePow = value * Math.pow(10, 6); + const stepPow = step * Math.pow(10, 6); + const minPow = min * Math.pow(10, 6); + return (valuePow - (Number.isFinite(min) ? minPow : 0)) % stepPow === 0; +} +function validateNumber(value, { min, max, step }) { + if (value == null || Number.isNaN(value)) { + return false; + } else if (value < min || value > max) { + return `Value must be between ${min} and ${max}`; + } else if (step !== "any" && !isStepOf(value, step, min)) { + return `Value must be a multiple of ${step}${Number.isFinite(min) ? ` starting from ${min}` : ""}`; + } + return true; +} +var esm_default6 = createPrompt((config, done) => { + var _a2; + const { validate = () => true, min = -Infinity, max = Infinity, step = 1, required = false } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const validDefault = validateNumber(config.default, { min, max, step }) === true ? (_a2 = config.default) == null ? void 0 : _a2.toString() : void 0; + const [defaultValue = "", setDefaultValue] = useState(validDefault); + const [errorMsg, setError] = useState(); + const prefix = usePrefix({ status, theme }); + useKeypress(async (key, rl) => { + if (status !== "idle") { + return; + } + if (isEnterKey(key)) { + const input = value || defaultValue; + const answer = input === "" ? void 0 : Number(input); + setStatus("loading"); + let isValid = true; + if (required || answer != null) { + isValid = validateNumber(answer, { min, max, step }); + } + if (isValid === true) { + isValid = await validate(answer); + } + if (isValid === true) { + setValue(String(answer ?? "")); + setStatus("done"); + done(answer); + } else { + rl.write(value); + setError(isValid || "You must provide a valid numeric value"); + setStatus("idle"); + } + } else if (isBackspaceKey(key) && !value) { + setDefaultValue(void 0); + } else if (key.name === "tab" && !value) { + setDefaultValue(void 0); + rl.clearLine(0); + rl.write(defaultValue); + setValue(defaultValue); + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config.message, status); + let formattedValue = value; + if (status === "done") { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== "done" && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error2 = ""; + if (errorMsg) { + error2 = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue].filter((v) => v !== void 0).join(" "), + error2 + ]; +}); + // var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1); +function normalizeChoices2(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) { + return choice; + } + const name = "name" in choice ? choice.name : String(choice.value); + const value = "value" in choice ? choice.value : name; + return { + value, + name, + key: choice.key.toLowerCase() + }; + }); +} +var helpChoice = { + key: "h", + name: "Help, list all options", + value: void 0 +}; +var esm_default7 = createPrompt((config, done) => { + const { default: defaultKey = "h" } = config; + const choices = useMemo(() => normalizeChoices2(config.choices), [config.choices]); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const [expanded, setExpanded] = useState(config.expanded ?? false); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ theme, status }); + useKeypress((event, rl) => { + if (isEnterKey(event)) { + const answer = (value || defaultKey).toLowerCase(); + if (answer === "h" && !expanded) { + setExpanded(true); + } else { + const selectedChoice = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === answer); + if (selectedChoice) { + setStatus("done"); + setValue(answer); + done(selectedChoice.value); + } else if (value === "") { + setError("Please input a value"); + } else { + setError(`"${import_yoctocolors_cjs4.default.red(value)}" isn't an available option`); + } + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config.message, status); + if (status === "done") { + const selectedChoice = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase()); + return `${prefix} ${message} ${theme.style.answer(selectedChoice.name)}`; + } + const allChoices = expanded ? choices : [...choices, helpChoice]; + let longChoices = ""; + let shortChoices = allChoices.map((choice) => { + if (Separator.isSeparator(choice)) + return ""; + if (choice.key === defaultKey) { + return choice.key.toUpperCase(); + } + return choice.key; + }).join(""); + shortChoices = ` ${theme.style.defaultAnswer(shortChoices)}`; + if (expanded) { + shortChoices = ""; + longChoices = allChoices.map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + const line = ` ${choice.key}) ${choice.name}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }).join("\n"); + } + let helpTip = ""; + const currentOption = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase()); + if (currentOption) { + helpTip = `${import_yoctocolors_cjs4.default.cyan(">>")} ${currentOption.name}`; + } + let error2 = ""; + if (errorMsg) { + error2 = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message}${shortChoices} ${value}`, + [longChoices, helpTip, error2].filter(Boolean).join("\n") + ]; +}); + +// +var import_yoctocolors_cjs5 = __toESM(require_yoctocolors_cjs(), 1); +var numberRegex = /\d+/; +function isSelectableChoice(choice) { + return choice != null && !Separator.isSeparator(choice); +} +function normalizeChoices3(choices) { + let index = 0; + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + index += 1; + if (typeof choice === "string") { + return { + value: choice, + name: choice, + short: choice, + key: String(index) + }; + } + const name = choice.name ?? String(choice.value); + return { + value: choice.value, + name, + short: choice.short ?? name, + key: choice.key ?? String(index) + }; + }); +} +var esm_default8 = createPrompt((config, done) => { + const choices = useMemo(() => normalizeChoices3(config.choices), [config.choices]); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ status, theme }); + useKeypress((key, rl) => { + if (isEnterKey(key)) { + let selectedChoice; + if (numberRegex.test(value)) { + const answer = Number.parseInt(value, 10) - 1; + selectedChoice = choices.filter(isSelectableChoice)[answer]; + } else { + selectedChoice = choices.find((choice) => isSelectableChoice(choice) && choice.key === value); + } + if (isSelectableChoice(selectedChoice)) { + setValue(selectedChoice.short ?? selectedChoice.name ?? String(selectedChoice.value)); + setStatus("done"); + done(selectedChoice.value); + } else if (value === "") { + setError("Please input a value"); + } else { + setError(`"${import_yoctocolors_cjs5.default.red(value)}" isn't an available option`); + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config.message, status); + if (status === "done") { + return `${prefix} ${message} ${theme.style.answer(value)}`; + } + const choicesStr = choices.map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + const line = ` ${choice.key}) ${choice.name}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }).join("\n"); + let error2 = ""; + if (errorMsg) { + error2 = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message} ${value}`, + [choicesStr, error2].filter(Boolean).join("\n") + ]; +}); + +// var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1); -var selectTheme = { +var esm_default9 = createPrompt((config, done) => { + const { validate = () => true } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState("idle"); + const [errorMsg, setError] = useState(); + const [value, setValue] = useState(""); + const prefix = usePrefix({ status, theme }); + useKeypress(async (key, rl) => { + if (status !== "idle") { + return; + } + if (isEnterKey(key)) { + const answer = value; + setStatus("loading"); + const isValid = await validate(answer); + if (isValid === true) { + setValue(answer); + setStatus("done"); + done(answer); + } else { + rl.write(value); + setError(isValid || "You must provide a valid value"); + setStatus("idle"); + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config.message, status); + let formattedValue = ""; + let helpTip; + if (config.mask) { + const maskChar = typeof config.mask === "string" ? config.mask : "*"; + formattedValue = maskChar.repeat(value.length); + } else if (status !== "done") { + helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes3.default.cursorHide}`; + } + if (status === "done") { + formattedValue = theme.style.answer(formattedValue); + } + let error2 = ""; + if (errorMsg) { + error2 = theme.style.error(errorMsg); + } + return [[prefix, message, config.mask ? formattedValue : helpTip].join(" "), error2]; +}); + +// +var import_yoctocolors_cjs6 = __toESM(require_yoctocolors_cjs(), 1); +var searchTheme = { icon: { cursor: esm_default.pointer }, style: { - disabled: (text) => import_yoctocolors_cjs4.default.dim(`- ${text}`), - description: (text) => import_yoctocolors_cjs4.default.cyan(text) + disabled: (text) => import_yoctocolors_cjs6.default.dim(`- ${text}`), + searchTerm: (text) => import_yoctocolors_cjs6.default.cyan(text), + description: (text) => import_yoctocolors_cjs6.default.cyan(text) }, helpMode: "auto" }; function isSelectable2(item) { return !Separator.isSeparator(item) && !item.disabled; } -function normalizeChoices2(choices) { +function normalizeChoices4(choices) { return choices.map((choice) => { if (Separator.isSeparator(choice)) return choice; @@ -58429,18 +58740,181 @@ function normalizeChoices2(choices) { }; }); } -var esm_default6 = createPrompt((config, done) => { +var esm_default10 = createPrompt((config, done) => { + const { pageSize = 7, validate = () => true } = config; + const theme = makeTheme(searchTheme, config.theme); + const firstRender = useRef(true); + const [status, setStatus] = useState("loading"); + const [searchTerm, setSearchTerm] = useState(""); + const [searchResults, setSearchResults] = useState([]); + const [searchError, setSearchError] = useState(); + const prefix = usePrefix({ status, theme }); + const bounds = useMemo(() => { + const first = searchResults.findIndex(isSelectable2); + const last = searchResults.findLastIndex(isSelectable2); + return { first, last }; + }, [searchResults]); + const [active = bounds.first, setActive] = useState(); + useEffect(() => { + const controller = new AbortController(); + setStatus("loading"); + setSearchError(void 0); + const fetchResults = async () => { + try { + const results = await config.source(searchTerm || void 0, { + signal: controller.signal + }); + if (!controller.signal.aborted) { + setActive(void 0); + setSearchError(void 0); + setSearchResults(normalizeChoices4(results)); + setStatus("idle"); + } + } catch (error3) { + if (!controller.signal.aborted && error3 instanceof Error) { + setSearchError(error3.message); + } + } + }; + void fetchResults(); + return () => { + controller.abort(); + }; + }, [searchTerm]); + const selectedChoice = searchResults[active]; + useKeypress(async (key, rl) => { + if (isEnterKey(key)) { + if (selectedChoice) { + setStatus("loading"); + const isValid = await validate(selectedChoice.value); + setStatus("idle"); + if (isValid === true) { + setStatus("done"); + done(selectedChoice.value); + } else if (selectedChoice.name === searchTerm) { + setSearchError(isValid || "You must provide a valid value"); + } else { + rl.write(selectedChoice.name); + setSearchTerm(selectedChoice.name); + } + } else { + rl.write(searchTerm); + } + } else if (key.name === "tab" && selectedChoice) { + rl.clearLine(0); + rl.write(selectedChoice.name); + setSearchTerm(selectedChoice.name); + } else if (status !== "loading" && (key.name === "up" || key.name === "down")) { + rl.clearLine(0); + if (key.name === "up" && active !== bounds.first || key.name === "down" && active !== bounds.last) { + const offset = key.name === "up" ? -1 : 1; + let next = active; + do { + next = (next + offset + searchResults.length) % searchResults.length; + } while (!isSelectable2(searchResults[next])); + setActive(next); + } + } else { + setSearchTerm(rl.line); + } + }); + const message = theme.style.message(config.message, status); + if (active > 0) { + firstRender.current = false; + } + let helpTip = ""; + if (searchResults.length > 1 && (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current)) { + helpTip = searchResults.length > pageSize ? ` +${theme.style.help("(Use arrow keys to reveal more choices)")}` : ` +${theme.style.help("(Use arrow keys)")}`; + } + const page = usePagination({ + items: searchResults, + active, + renderItem({ item, isActive }) { + if (Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + if (item.disabled) { + const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)"; + return theme.style.disabled(`${item.name} ${disabledLabel}`); + } + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ` `; + return color(`${cursor} ${item.name}`); + }, + pageSize, + loop: false + }); + let error2; + if (searchError) { + error2 = theme.style.error(searchError); + } else if (searchResults.length === 0 && searchTerm !== "" && status === "idle") { + error2 = theme.style.error("No results found"); + } + let searchStr; + if (status === "done" && selectedChoice) { + const answer = selectedChoice.short ?? selectedChoice.name; + return `${prefix} ${message} ${theme.style.answer(answer)}`; + } else { + searchStr = theme.style.searchTerm(searchTerm); + } + const choiceDescription = (selectedChoice == null ? void 0 : selectedChoice.description) ? ` +${theme.style.description(selectedChoice.description)}` : ``; + return [ + [prefix, message, searchStr].filter(Boolean).join(" "), + `${error2 ?? page}${helpTip}${choiceDescription}` + ]; +}); + +// +var import_yoctocolors_cjs7 = __toESM(require_yoctocolors_cjs(), 1); +var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1); +var selectTheme = { + icon: { cursor: esm_default.pointer }, + style: { + disabled: (text) => import_yoctocolors_cjs7.default.dim(`- ${text}`), + description: (text) => import_yoctocolors_cjs7.default.cyan(text) + }, + helpMode: "auto" +}; +function isSelectable3(item) { + return !Separator.isSeparator(item) && !item.disabled; +} +function normalizeChoices5(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + if (typeof choice === "string") { + return { + value: choice, + name: choice, + short: choice, + disabled: false + }; + } + const name = choice.name ?? String(choice.value); + return { + value: choice.value, + name, + description: choice.description, + short: choice.short ?? name, + disabled: choice.disabled ?? false + }; + }); +} +var esm_default11 = createPrompt((config, done) => { const { loop = true, pageSize = 7 } = config; const firstRender = useRef(true); const theme = makeTheme(selectTheme, config.theme); const [status, setStatus] = useState("idle"); const prefix = usePrefix({ status, theme }); const searchTimeoutRef = useRef(); - const items = useMemo(() => normalizeChoices2(config.choices), [config.choices]); + const items = useMemo(() => normalizeChoices5(config.choices), [config.choices]); const bounds = useMemo(() => { - const first = items.findIndex(isSelectable2); - const last = items.findLastIndex(isSelectable2); - if (first < 0) { + const first = items.findIndex(isSelectable3); + const last = items.findLastIndex(isSelectable3); + if (first === -1) { throw new ValidationError("[select prompt] No selectable choices. All choices are disabled."); } return { first, last }; @@ -58448,7 +58922,7 @@ var esm_default6 = createPrompt((config, done) => { const defaultItemIndex = useMemo(() => { if (!("default" in config)) return -1; - return items.findIndex((item) => isSelectable2(item) && item.value === config.default); + return items.findIndex((item) => isSelectable3(item) && item.value === config.default); }, [config.default, items]); const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex); const selectedChoice = items[active]; @@ -58464,14 +58938,14 @@ var esm_default6 = createPrompt((config, done) => { let next = active; do { next = (next + offset + items.length) % items.length; - } while (!isSelectable2(items[next])); + } while (!isSelectable3(items[next])); setActive(next); } } else if (isNumberKey(key)) { rl.clearLine(0); const position = Number(key.name) - 1; const item = items[position]; - if (item != null && isSelectable2(item)) { + if (item != null && isSelectable3(item)) { setActive(position); } } else if (isBackspaceKey(key)) { @@ -58479,11 +58953,11 @@ var esm_default6 = createPrompt((config, done) => { } else { const searchTerm = rl.line.toLowerCase(); const matchIndex = items.findIndex((item) => { - if (Separator.isSeparator(item) || !isSelectable2(item)) + if (Separator.isSeparator(item) || !isSelectable3(item)) return false; return item.name.toLowerCase().startsWith(searchTerm); }); - if (matchIndex >= 0) { + if (matchIndex !== -1) { setActive(matchIndex); } searchTimeoutRef.current = setTimeout(() => { @@ -58530,7 +59004,7 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`; const choiceDescription = selectedChoice.description ? ` ${theme.style.description(selectedChoice.description)}` : ``; return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")} -${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes3.default.cursorHide}`; +${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursorHide}`; }); // @@ -58539,7 +59013,7 @@ var Prompt = class { Prompt.confirm = esm_default4; Prompt.input = esm_default5; Prompt.checkbox = esm_default2; -Prompt.select = esm_default6; +Prompt.select = esm_default11; Prompt.editor = esm_default3; // @@ -64650,7 +65124,7 @@ AuthenticatedGitClient._token = null; AuthenticatedGitClient._authenticatedInstance = null; // -var import_core7 = __toESM(require_core()); +var import_core17 = __toESM(require_core()); // var RequestError2 = class extends Error { @@ -66942,7 +67416,7 @@ function createAppAuth(options) { var import_github4 = __toESM(require_github()); var ANGULAR_ROBOT = [43341, "angular-robot-key"]; async function getJwtAuthedAppClient([appId, inputKey]) { - const privateKey = (0, import_core7.getInput)(inputKey, { required: true }); + const privateKey = (0, import_core17.getInput)(inputKey, { required: true }); return new Octokit2({ authStrategy: createAppAuth, auth: { appId, privateKey } @@ -66969,7 +67443,7 @@ async function revokeActiveInstallationToken(githubOrToken) { } else { await githubOrToken.apps.revokeInstallationAccessToken(); } - (0, import_core7.info)("Revoked installation token used for Angular Robot."); + (0, import_core17.info)("Revoked installation token used for Angular Robot."); } // diff --git a/.github/local-actions/changelog/main.js b/.github/local-actions/changelog/main.js index 5025805cd..c8956a833 100644 --- a/.github/local-actions/changelog/main.js +++ b/.github/local-actions/changelog/main.js @@ -43054,49 +43054,49 @@ var require_yoctocolors_cjs = __commonJS({ return result; }; }; - var colors5 = {}; - colors5.reset = format(0, 0); - colors5.bold = format(1, 22); - colors5.dim = format(2, 22); - colors5.italic = format(3, 23); - colors5.underline = format(4, 24); - colors5.overline = format(53, 55); - colors5.inverse = format(7, 27); - colors5.hidden = format(8, 28); - colors5.strikethrough = format(9, 29); - colors5.black = format(30, 39); - colors5.red = format(31, 39); - colors5.green = format(32, 39); - colors5.yellow = format(33, 39); - colors5.blue = format(34, 39); - colors5.magenta = format(35, 39); - colors5.cyan = format(36, 39); - colors5.white = format(37, 39); - colors5.gray = format(90, 39); - colors5.bgBlack = format(40, 49); - colors5.bgRed = format(41, 49); - colors5.bgGreen = format(42, 49); - colors5.bgYellow = format(43, 49); - colors5.bgBlue = format(44, 49); - colors5.bgMagenta = format(45, 49); - colors5.bgCyan = format(46, 49); - colors5.bgWhite = format(47, 49); - colors5.bgGray = format(100, 49); - colors5.redBright = format(91, 39); - colors5.greenBright = format(92, 39); - colors5.yellowBright = format(93, 39); - colors5.blueBright = format(94, 39); - colors5.magentaBright = format(95, 39); - colors5.cyanBright = format(96, 39); - colors5.whiteBright = format(97, 39); - colors5.bgRedBright = format(101, 49); - colors5.bgGreenBright = format(102, 49); - colors5.bgYellowBright = format(103, 49); - colors5.bgBlueBright = format(104, 49); - colors5.bgMagentaBright = format(105, 49); - colors5.bgCyanBright = format(106, 49); - colors5.bgWhiteBright = format(107, 49); - module.exports = colors5; + var colors8 = {}; + colors8.reset = format(0, 0); + colors8.bold = format(1, 22); + colors8.dim = format(2, 22); + colors8.italic = format(3, 23); + colors8.underline = format(4, 24); + colors8.overline = format(53, 55); + colors8.inverse = format(7, 27); + colors8.hidden = format(8, 28); + colors8.strikethrough = format(9, 29); + colors8.black = format(30, 39); + colors8.red = format(31, 39); + colors8.green = format(32, 39); + colors8.yellow = format(33, 39); + colors8.blue = format(34, 39); + colors8.magenta = format(35, 39); + colors8.cyan = format(36, 39); + colors8.white = format(37, 39); + colors8.gray = format(90, 39); + colors8.bgBlack = format(40, 49); + colors8.bgRed = format(41, 49); + colors8.bgGreen = format(42, 49); + colors8.bgYellow = format(43, 49); + colors8.bgBlue = format(44, 49); + colors8.bgMagenta = format(45, 49); + colors8.bgCyan = format(46, 49); + colors8.bgWhite = format(47, 49); + colors8.bgGray = format(100, 49); + colors8.redBright = format(91, 39); + colors8.greenBright = format(92, 39); + colors8.yellowBright = format(93, 39); + colors8.blueBright = format(94, 39); + colors8.magentaBright = format(95, 39); + colors8.cyanBright = format(96, 39); + colors8.whiteBright = format(97, 39); + colors8.bgRedBright = format(101, 49); + colors8.bgGreenBright = format(102, 49); + colors8.bgYellowBright = format(103, 49); + colors8.bgBlueBright = format(104, 49); + colors8.bgMagentaBright = format(105, 49); + colors8.bgCyanBright = format(106, 49); + colors8.bgWhiteBright = format(107, 49); + module.exports = colors8; } }); @@ -44586,14 +44586,14 @@ var require_lib2 = __commonJS({ var require_ansi_escapes = __commonJS({ ""(exports, module) { "use strict"; - var ansiEscapes4 = module.exports; - module.exports.default = ansiEscapes4; + var ansiEscapes5 = module.exports; + module.exports.default = ansiEscapes5; var ESC = "\x1B["; var OSC = "\x1B]"; var BEL = "\x07"; var SEP = ";"; var isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal"; - ansiEscapes4.cursorTo = (x, y) => { + ansiEscapes5.cursorTo = (x, y) => { if (typeof x !== "number") { throw new TypeError("The `x` argument is required"); } @@ -44602,7 +44602,7 @@ var require_ansi_escapes = __commonJS({ } return ESC + (y + 1) + ";" + (x + 1) + "H"; }; - ansiEscapes4.cursorMove = (x, y) => { + ansiEscapes5.cursorMove = (x, y) => { if (typeof x !== "number") { throw new TypeError("The `x` argument is required"); } @@ -44619,40 +44619,40 @@ var require_ansi_escapes = __commonJS({ } return ret; }; - ansiEscapes4.cursorUp = (count = 1) => ESC + count + "A"; - ansiEscapes4.cursorDown = (count = 1) => ESC + count + "B"; - ansiEscapes4.cursorForward = (count = 1) => ESC + count + "C"; - ansiEscapes4.cursorBackward = (count = 1) => ESC + count + "D"; - ansiEscapes4.cursorLeft = ESC + "G"; - ansiEscapes4.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s"; - ansiEscapes4.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u"; - ansiEscapes4.cursorGetPosition = ESC + "6n"; - ansiEscapes4.cursorNextLine = ESC + "E"; - ansiEscapes4.cursorPrevLine = ESC + "F"; - ansiEscapes4.cursorHide = ESC + "?25l"; - ansiEscapes4.cursorShow = ESC + "?25h"; - ansiEscapes4.eraseLines = (count) => { + ansiEscapes5.cursorUp = (count = 1) => ESC + count + "A"; + ansiEscapes5.cursorDown = (count = 1) => ESC + count + "B"; + ansiEscapes5.cursorForward = (count = 1) => ESC + count + "C"; + ansiEscapes5.cursorBackward = (count = 1) => ESC + count + "D"; + ansiEscapes5.cursorLeft = ESC + "G"; + ansiEscapes5.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s"; + ansiEscapes5.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u"; + ansiEscapes5.cursorGetPosition = ESC + "6n"; + ansiEscapes5.cursorNextLine = ESC + "E"; + ansiEscapes5.cursorPrevLine = ESC + "F"; + ansiEscapes5.cursorHide = ESC + "?25l"; + ansiEscapes5.cursorShow = ESC + "?25h"; + ansiEscapes5.eraseLines = (count) => { let clear = ""; for (let i = 0; i < count; i++) { - clear += ansiEscapes4.eraseLine + (i < count - 1 ? ansiEscapes4.cursorUp() : ""); + clear += ansiEscapes5.eraseLine + (i < count - 1 ? ansiEscapes5.cursorUp() : ""); } if (count) { - clear += ansiEscapes4.cursorLeft; + clear += ansiEscapes5.cursorLeft; } return clear; }; - ansiEscapes4.eraseEndLine = ESC + "K"; - ansiEscapes4.eraseStartLine = ESC + "1K"; - ansiEscapes4.eraseLine = ESC + "2K"; - ansiEscapes4.eraseDown = ESC + "J"; - ansiEscapes4.eraseUp = ESC + "1J"; - ansiEscapes4.eraseScreen = ESC + "2J"; - ansiEscapes4.scrollUp = ESC + "S"; - ansiEscapes4.scrollDown = ESC + "T"; - ansiEscapes4.clearScreen = "\x1Bc"; - ansiEscapes4.clearTerminal = process.platform === "win32" ? `${ansiEscapes4.eraseScreen}${ESC}0f` : `${ansiEscapes4.eraseScreen}${ESC}3J${ESC}H`; - ansiEscapes4.beep = BEL; - ansiEscapes4.link = (text, url) => { + ansiEscapes5.eraseEndLine = ESC + "K"; + ansiEscapes5.eraseStartLine = ESC + "1K"; + ansiEscapes5.eraseLine = ESC + "2K"; + ansiEscapes5.eraseDown = ESC + "J"; + ansiEscapes5.eraseUp = ESC + "1J"; + ansiEscapes5.eraseScreen = ESC + "2J"; + ansiEscapes5.scrollUp = ESC + "S"; + ansiEscapes5.scrollDown = ESC + "T"; + ansiEscapes5.clearScreen = "\x1Bc"; + ansiEscapes5.clearTerminal = process.platform === "win32" ? `${ansiEscapes5.eraseScreen}${ESC}0f` : `${ansiEscapes5.eraseScreen}${ESC}3J${ESC}H`; + ansiEscapes5.beep = BEL; + ansiEscapes5.link = (text, url) => { return [ OSC, "8", @@ -44668,7 +44668,7 @@ var require_ansi_escapes = __commonJS({ BEL ].join(""); }; - ansiEscapes4.image = (buffer, options = {}) => { + ansiEscapes5.image = (buffer, options = {}) => { let ret = `${OSC}1337;File=inline=1`; if (options.width) { ret += `;width=${options.width}`; @@ -44681,7 +44681,7 @@ var require_ansi_escapes = __commonJS({ } return ret + ":" + buffer.toString("base64") + BEL; }; - ansiEscapes4.iTerm = { + ansiEscapes5.iTerm = { setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`, annotation: (message, options = {}) => { let ret = `${OSC}1337;`; @@ -57698,7 +57698,7 @@ var esm_default2 = createPrompt((config2, done) => { const bounds = useMemo(() => { const first = items.findIndex(isSelectable); const last = items.findLastIndex(isSelectable); - if (first < 0) { + if (first === -1) { throw new ValidationError("[checkbox prompt] No selectable choices. All choices are disabled."); } return { first, last }; @@ -57956,21 +57956,332 @@ var esm_default5 = createPrompt((config2, done) => { ]; }); +// +function isStepOf(value, step, min) { + const valuePow = value * Math.pow(10, 6); + const stepPow = step * Math.pow(10, 6); + const minPow = min * Math.pow(10, 6); + return (valuePow - (Number.isFinite(min) ? minPow : 0)) % stepPow === 0; +} +function validateNumber(value, { min, max, step }) { + if (value == null || Number.isNaN(value)) { + return false; + } else if (value < min || value > max) { + return `Value must be between ${min} and ${max}`; + } else if (step !== "any" && !isStepOf(value, step, min)) { + return `Value must be a multiple of ${step}${Number.isFinite(min) ? ` starting from ${min}` : ""}`; + } + return true; +} +var esm_default6 = createPrompt((config2, done) => { + var _a2; + const { validate = () => true, min = -Infinity, max = Infinity, step = 1, required = false } = config2; + const theme = makeTheme(config2.theme); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const validDefault = validateNumber(config2.default, { min, max, step }) === true ? (_a2 = config2.default) == null ? void 0 : _a2.toString() : void 0; + const [defaultValue = "", setDefaultValue] = useState(validDefault); + const [errorMsg, setError] = useState(); + const prefix = usePrefix({ status, theme }); + useKeypress(async (key, rl) => { + if (status !== "idle") { + return; + } + if (isEnterKey(key)) { + const input = value || defaultValue; + const answer = input === "" ? void 0 : Number(input); + setStatus("loading"); + let isValid = true; + if (required || answer != null) { + isValid = validateNumber(answer, { min, max, step }); + } + if (isValid === true) { + isValid = await validate(answer); + } + if (isValid === true) { + setValue(String(answer ?? "")); + setStatus("done"); + done(answer); + } else { + rl.write(value); + setError(isValid || "You must provide a valid numeric value"); + setStatus("idle"); + } + } else if (isBackspaceKey(key) && !value) { + setDefaultValue(void 0); + } else if (key.name === "tab" && !value) { + setDefaultValue(void 0); + rl.clearLine(0); + rl.write(defaultValue); + setValue(defaultValue); + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config2.message, status); + let formattedValue = value; + if (status === "done") { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== "done" && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error2 = ""; + if (errorMsg) { + error2 = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue].filter((v) => v !== void 0).join(" "), + error2 + ]; +}); + // var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1); +function normalizeChoices2(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) { + return choice; + } + const name = "name" in choice ? choice.name : String(choice.value); + const value = "value" in choice ? choice.value : name; + return { + value, + name, + key: choice.key.toLowerCase() + }; + }); +} +var helpChoice = { + key: "h", + name: "Help, list all options", + value: void 0 +}; +var esm_default7 = createPrompt((config2, done) => { + const { default: defaultKey = "h" } = config2; + const choices = useMemo(() => normalizeChoices2(config2.choices), [config2.choices]); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const [expanded, setExpanded] = useState(config2.expanded ?? false); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config2.theme); + const prefix = usePrefix({ theme, status }); + useKeypress((event, rl) => { + if (isEnterKey(event)) { + const answer = (value || defaultKey).toLowerCase(); + if (answer === "h" && !expanded) { + setExpanded(true); + } else { + const selectedChoice = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === answer); + if (selectedChoice) { + setStatus("done"); + setValue(answer); + done(selectedChoice.value); + } else if (value === "") { + setError("Please input a value"); + } else { + setError(`"${import_yoctocolors_cjs4.default.red(value)}" isn't an available option`); + } + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config2.message, status); + if (status === "done") { + const selectedChoice = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase()); + return `${prefix} ${message} ${theme.style.answer(selectedChoice.name)}`; + } + const allChoices = expanded ? choices : [...choices, helpChoice]; + let longChoices = ""; + let shortChoices = allChoices.map((choice) => { + if (Separator.isSeparator(choice)) + return ""; + if (choice.key === defaultKey) { + return choice.key.toUpperCase(); + } + return choice.key; + }).join(""); + shortChoices = ` ${theme.style.defaultAnswer(shortChoices)}`; + if (expanded) { + shortChoices = ""; + longChoices = allChoices.map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + const line = ` ${choice.key}) ${choice.name}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }).join("\n"); + } + let helpTip = ""; + const currentOption = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase()); + if (currentOption) { + helpTip = `${import_yoctocolors_cjs4.default.cyan(">>")} ${currentOption.name}`; + } + let error2 = ""; + if (errorMsg) { + error2 = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message}${shortChoices} ${value}`, + [longChoices, helpTip, error2].filter(Boolean).join("\n") + ]; +}); + +// +var import_yoctocolors_cjs5 = __toESM(require_yoctocolors_cjs(), 1); +var numberRegex = /\d+/; +function isSelectableChoice(choice) { + return choice != null && !Separator.isSeparator(choice); +} +function normalizeChoices3(choices) { + let index = 0; + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + index += 1; + if (typeof choice === "string") { + return { + value: choice, + name: choice, + short: choice, + key: String(index) + }; + } + const name = choice.name ?? String(choice.value); + return { + value: choice.value, + name, + short: choice.short ?? name, + key: choice.key ?? String(index) + }; + }); +} +var esm_default8 = createPrompt((config2, done) => { + const choices = useMemo(() => normalizeChoices3(config2.choices), [config2.choices]); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config2.theme); + const prefix = usePrefix({ status, theme }); + useKeypress((key, rl) => { + if (isEnterKey(key)) { + let selectedChoice; + if (numberRegex.test(value)) { + const answer = Number.parseInt(value, 10) - 1; + selectedChoice = choices.filter(isSelectableChoice)[answer]; + } else { + selectedChoice = choices.find((choice) => isSelectableChoice(choice) && choice.key === value); + } + if (isSelectableChoice(selectedChoice)) { + setValue(selectedChoice.short ?? selectedChoice.name ?? String(selectedChoice.value)); + setStatus("done"); + done(selectedChoice.value); + } else if (value === "") { + setError("Please input a value"); + } else { + setError(`"${import_yoctocolors_cjs5.default.red(value)}" isn't an available option`); + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config2.message, status); + if (status === "done") { + return `${prefix} ${message} ${theme.style.answer(value)}`; + } + const choicesStr = choices.map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + const line = ` ${choice.key}) ${choice.name}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }).join("\n"); + let error2 = ""; + if (errorMsg) { + error2 = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message} ${value}`, + [choicesStr, error2].filter(Boolean).join("\n") + ]; +}); + +// var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1); -var selectTheme = { +var esm_default9 = createPrompt((config2, done) => { + const { validate = () => true } = config2; + const theme = makeTheme(config2.theme); + const [status, setStatus] = useState("idle"); + const [errorMsg, setError] = useState(); + const [value, setValue] = useState(""); + const prefix = usePrefix({ status, theme }); + useKeypress(async (key, rl) => { + if (status !== "idle") { + return; + } + if (isEnterKey(key)) { + const answer = value; + setStatus("loading"); + const isValid = await validate(answer); + if (isValid === true) { + setValue(answer); + setStatus("done"); + done(answer); + } else { + rl.write(value); + setError(isValid || "You must provide a valid value"); + setStatus("idle"); + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config2.message, status); + let formattedValue = ""; + let helpTip; + if (config2.mask) { + const maskChar = typeof config2.mask === "string" ? config2.mask : "*"; + formattedValue = maskChar.repeat(value.length); + } else if (status !== "done") { + helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes3.default.cursorHide}`; + } + if (status === "done") { + formattedValue = theme.style.answer(formattedValue); + } + let error2 = ""; + if (errorMsg) { + error2 = theme.style.error(errorMsg); + } + return [[prefix, message, config2.mask ? formattedValue : helpTip].join(" "), error2]; +}); + +// +var import_yoctocolors_cjs6 = __toESM(require_yoctocolors_cjs(), 1); +var searchTheme = { icon: { cursor: esm_default.pointer }, style: { - disabled: (text) => import_yoctocolors_cjs4.default.dim(`- ${text}`), - description: (text) => import_yoctocolors_cjs4.default.cyan(text) + disabled: (text) => import_yoctocolors_cjs6.default.dim(`- ${text}`), + searchTerm: (text) => import_yoctocolors_cjs6.default.cyan(text), + description: (text) => import_yoctocolors_cjs6.default.cyan(text) }, helpMode: "auto" }; function isSelectable2(item) { return !Separator.isSeparator(item) && !item.disabled; } -function normalizeChoices2(choices) { +function normalizeChoices4(choices) { return choices.map((choice) => { if (Separator.isSeparator(choice)) return choice; @@ -57992,18 +58303,181 @@ function normalizeChoices2(choices) { }; }); } -var esm_default6 = createPrompt((config2, done) => { +var esm_default10 = createPrompt((config2, done) => { + const { pageSize = 7, validate = () => true } = config2; + const theme = makeTheme(searchTheme, config2.theme); + const firstRender = useRef(true); + const [status, setStatus] = useState("loading"); + const [searchTerm, setSearchTerm] = useState(""); + const [searchResults, setSearchResults] = useState([]); + const [searchError, setSearchError] = useState(); + const prefix = usePrefix({ status, theme }); + const bounds = useMemo(() => { + const first = searchResults.findIndex(isSelectable2); + const last = searchResults.findLastIndex(isSelectable2); + return { first, last }; + }, [searchResults]); + const [active = bounds.first, setActive] = useState(); + useEffect(() => { + const controller = new AbortController(); + setStatus("loading"); + setSearchError(void 0); + const fetchResults = async () => { + try { + const results = await config2.source(searchTerm || void 0, { + signal: controller.signal + }); + if (!controller.signal.aborted) { + setActive(void 0); + setSearchError(void 0); + setSearchResults(normalizeChoices4(results)); + setStatus("idle"); + } + } catch (error3) { + if (!controller.signal.aborted && error3 instanceof Error) { + setSearchError(error3.message); + } + } + }; + void fetchResults(); + return () => { + controller.abort(); + }; + }, [searchTerm]); + const selectedChoice = searchResults[active]; + useKeypress(async (key, rl) => { + if (isEnterKey(key)) { + if (selectedChoice) { + setStatus("loading"); + const isValid = await validate(selectedChoice.value); + setStatus("idle"); + if (isValid === true) { + setStatus("done"); + done(selectedChoice.value); + } else if (selectedChoice.name === searchTerm) { + setSearchError(isValid || "You must provide a valid value"); + } else { + rl.write(selectedChoice.name); + setSearchTerm(selectedChoice.name); + } + } else { + rl.write(searchTerm); + } + } else if (key.name === "tab" && selectedChoice) { + rl.clearLine(0); + rl.write(selectedChoice.name); + setSearchTerm(selectedChoice.name); + } else if (status !== "loading" && (key.name === "up" || key.name === "down")) { + rl.clearLine(0); + if (key.name === "up" && active !== bounds.first || key.name === "down" && active !== bounds.last) { + const offset = key.name === "up" ? -1 : 1; + let next = active; + do { + next = (next + offset + searchResults.length) % searchResults.length; + } while (!isSelectable2(searchResults[next])); + setActive(next); + } + } else { + setSearchTerm(rl.line); + } + }); + const message = theme.style.message(config2.message, status); + if (active > 0) { + firstRender.current = false; + } + let helpTip = ""; + if (searchResults.length > 1 && (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current)) { + helpTip = searchResults.length > pageSize ? ` +${theme.style.help("(Use arrow keys to reveal more choices)")}` : ` +${theme.style.help("(Use arrow keys)")}`; + } + const page = usePagination({ + items: searchResults, + active, + renderItem({ item, isActive }) { + if (Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + if (item.disabled) { + const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)"; + return theme.style.disabled(`${item.name} ${disabledLabel}`); + } + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ` `; + return color(`${cursor} ${item.name}`); + }, + pageSize, + loop: false + }); + let error2; + if (searchError) { + error2 = theme.style.error(searchError); + } else if (searchResults.length === 0 && searchTerm !== "" && status === "idle") { + error2 = theme.style.error("No results found"); + } + let searchStr; + if (status === "done" && selectedChoice) { + const answer = selectedChoice.short ?? selectedChoice.name; + return `${prefix} ${message} ${theme.style.answer(answer)}`; + } else { + searchStr = theme.style.searchTerm(searchTerm); + } + const choiceDescription = (selectedChoice == null ? void 0 : selectedChoice.description) ? ` +${theme.style.description(selectedChoice.description)}` : ``; + return [ + [prefix, message, searchStr].filter(Boolean).join(" "), + `${error2 ?? page}${helpTip}${choiceDescription}` + ]; +}); + +// +var import_yoctocolors_cjs7 = __toESM(require_yoctocolors_cjs(), 1); +var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1); +var selectTheme = { + icon: { cursor: esm_default.pointer }, + style: { + disabled: (text) => import_yoctocolors_cjs7.default.dim(`- ${text}`), + description: (text) => import_yoctocolors_cjs7.default.cyan(text) + }, + helpMode: "auto" +}; +function isSelectable3(item) { + return !Separator.isSeparator(item) && !item.disabled; +} +function normalizeChoices5(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + if (typeof choice === "string") { + return { + value: choice, + name: choice, + short: choice, + disabled: false + }; + } + const name = choice.name ?? String(choice.value); + return { + value: choice.value, + name, + description: choice.description, + short: choice.short ?? name, + disabled: choice.disabled ?? false + }; + }); +} +var esm_default11 = createPrompt((config2, done) => { const { loop = true, pageSize = 7 } = config2; const firstRender = useRef(true); const theme = makeTheme(selectTheme, config2.theme); const [status, setStatus] = useState("idle"); const prefix = usePrefix({ status, theme }); const searchTimeoutRef = useRef(); - const items = useMemo(() => normalizeChoices2(config2.choices), [config2.choices]); + const items = useMemo(() => normalizeChoices5(config2.choices), [config2.choices]); const bounds = useMemo(() => { - const first = items.findIndex(isSelectable2); - const last = items.findLastIndex(isSelectable2); - if (first < 0) { + const first = items.findIndex(isSelectable3); + const last = items.findLastIndex(isSelectable3); + if (first === -1) { throw new ValidationError("[select prompt] No selectable choices. All choices are disabled."); } return { first, last }; @@ -58011,7 +58485,7 @@ var esm_default6 = createPrompt((config2, done) => { const defaultItemIndex = useMemo(() => { if (!("default" in config2)) return -1; - return items.findIndex((item) => isSelectable2(item) && item.value === config2.default); + return items.findIndex((item) => isSelectable3(item) && item.value === config2.default); }, [config2.default, items]); const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex); const selectedChoice = items[active]; @@ -58027,14 +58501,14 @@ var esm_default6 = createPrompt((config2, done) => { let next = active; do { next = (next + offset + items.length) % items.length; - } while (!isSelectable2(items[next])); + } while (!isSelectable3(items[next])); setActive(next); } } else if (isNumberKey(key)) { rl.clearLine(0); const position = Number(key.name) - 1; const item = items[position]; - if (item != null && isSelectable2(item)) { + if (item != null && isSelectable3(item)) { setActive(position); } } else if (isBackspaceKey(key)) { @@ -58042,11 +58516,11 @@ var esm_default6 = createPrompt((config2, done) => { } else { const searchTerm = rl.line.toLowerCase(); const matchIndex = items.findIndex((item) => { - if (Separator.isSeparator(item) || !isSelectable2(item)) + if (Separator.isSeparator(item) || !isSelectable3(item)) return false; return item.name.toLowerCase().startsWith(searchTerm); }); - if (matchIndex >= 0) { + if (matchIndex !== -1) { setActive(matchIndex); } searchTimeoutRef.current = setTimeout(() => { @@ -58093,7 +58567,7 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`; const choiceDescription = selectedChoice.description ? ` ${theme.style.description(selectedChoice.description)}` : ``; return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")} -${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes3.default.cursorHide}`; +${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursorHide}`; }); // @@ -58102,7 +58576,7 @@ var Prompt = class { Prompt.confirm = esm_default4; Prompt.input = esm_default5; Prompt.checkbox = esm_default2; -Prompt.select = esm_default6; +Prompt.select = esm_default11; Prompt.editor = esm_default3; // @@ -63725,7 +64199,7 @@ AuthenticatedGitClient._token = null; AuthenticatedGitClient._authenticatedInstance = null; // -var import_core7 = __toESM(require_core()); +var import_core17 = __toESM(require_core()); // var RequestError2 = class extends Error { @@ -66017,7 +66491,7 @@ function createAppAuth(options) { var import_github3 = __toESM(require_github()); var ANGULAR_ROBOT = [43341, "angular-robot-key"]; async function getJwtAuthedAppClient([appId, inputKey]) { - const privateKey = (0, import_core7.getInput)(inputKey, { required: true }); + const privateKey = (0, import_core17.getInput)(inputKey, { required: true }); return new Octokit2({ authStrategy: createAppAuth, auth: { appId, privateKey } @@ -66044,7 +66518,7 @@ async function revokeActiveInstallationToken(githubOrToken) { } else { await githubOrToken.apps.revokeInstallationAccessToken(); } - (0, import_core7.info)("Revoked installation token used for Angular Robot."); + (0, import_core17.info)("Revoked installation token used for Angular Robot."); } // diff --git a/github-actions/slash-commands/main.js b/github-actions/slash-commands/main.js index 64f7773f6..b6fa08260 100644 --- a/github-actions/slash-commands/main.js +++ b/github-actions/slash-commands/main.js @@ -41466,49 +41466,49 @@ var require_yoctocolors_cjs = __commonJS({ return result; }; }; - var colors5 = {}; - colors5.reset = format(0, 0); - colors5.bold = format(1, 22); - colors5.dim = format(2, 22); - colors5.italic = format(3, 23); - colors5.underline = format(4, 24); - colors5.overline = format(53, 55); - colors5.inverse = format(7, 27); - colors5.hidden = format(8, 28); - colors5.strikethrough = format(9, 29); - colors5.black = format(30, 39); - colors5.red = format(31, 39); - colors5.green = format(32, 39); - colors5.yellow = format(33, 39); - colors5.blue = format(34, 39); - colors5.magenta = format(35, 39); - colors5.cyan = format(36, 39); - colors5.white = format(37, 39); - colors5.gray = format(90, 39); - colors5.bgBlack = format(40, 49); - colors5.bgRed = format(41, 49); - colors5.bgGreen = format(42, 49); - colors5.bgYellow = format(43, 49); - colors5.bgBlue = format(44, 49); - colors5.bgMagenta = format(45, 49); - colors5.bgCyan = format(46, 49); - colors5.bgWhite = format(47, 49); - colors5.bgGray = format(100, 49); - colors5.redBright = format(91, 39); - colors5.greenBright = format(92, 39); - colors5.yellowBright = format(93, 39); - colors5.blueBright = format(94, 39); - colors5.magentaBright = format(95, 39); - colors5.cyanBright = format(96, 39); - colors5.whiteBright = format(97, 39); - colors5.bgRedBright = format(101, 49); - colors5.bgGreenBright = format(102, 49); - colors5.bgYellowBright = format(103, 49); - colors5.bgBlueBright = format(104, 49); - colors5.bgMagentaBright = format(105, 49); - colors5.bgCyanBright = format(106, 49); - colors5.bgWhiteBright = format(107, 49); - module.exports = colors5; + var colors8 = {}; + colors8.reset = format(0, 0); + colors8.bold = format(1, 22); + colors8.dim = format(2, 22); + colors8.italic = format(3, 23); + colors8.underline = format(4, 24); + colors8.overline = format(53, 55); + colors8.inverse = format(7, 27); + colors8.hidden = format(8, 28); + colors8.strikethrough = format(9, 29); + colors8.black = format(30, 39); + colors8.red = format(31, 39); + colors8.green = format(32, 39); + colors8.yellow = format(33, 39); + colors8.blue = format(34, 39); + colors8.magenta = format(35, 39); + colors8.cyan = format(36, 39); + colors8.white = format(37, 39); + colors8.gray = format(90, 39); + colors8.bgBlack = format(40, 49); + colors8.bgRed = format(41, 49); + colors8.bgGreen = format(42, 49); + colors8.bgYellow = format(43, 49); + colors8.bgBlue = format(44, 49); + colors8.bgMagenta = format(45, 49); + colors8.bgCyan = format(46, 49); + colors8.bgWhite = format(47, 49); + colors8.bgGray = format(100, 49); + colors8.redBright = format(91, 39); + colors8.greenBright = format(92, 39); + colors8.yellowBright = format(93, 39); + colors8.blueBright = format(94, 39); + colors8.magentaBright = format(95, 39); + colors8.cyanBright = format(96, 39); + colors8.whiteBright = format(97, 39); + colors8.bgRedBright = format(101, 49); + colors8.bgGreenBright = format(102, 49); + colors8.bgYellowBright = format(103, 49); + colors8.bgBlueBright = format(104, 49); + colors8.bgMagentaBright = format(105, 49); + colors8.bgCyanBright = format(106, 49); + colors8.bgWhiteBright = format(107, 49); + module.exports = colors8; } }); @@ -42998,14 +42998,14 @@ var require_lib2 = __commonJS({ var require_ansi_escapes = __commonJS({ ""(exports, module) { "use strict"; - var ansiEscapes4 = module.exports; - module.exports.default = ansiEscapes4; + var ansiEscapes5 = module.exports; + module.exports.default = ansiEscapes5; var ESC = "\x1B["; var OSC = "\x1B]"; var BEL = "\x07"; var SEP = ";"; var isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal"; - ansiEscapes4.cursorTo = (x, y) => { + ansiEscapes5.cursorTo = (x, y) => { if (typeof x !== "number") { throw new TypeError("The `x` argument is required"); } @@ -43014,7 +43014,7 @@ var require_ansi_escapes = __commonJS({ } return ESC + (y + 1) + ";" + (x + 1) + "H"; }; - ansiEscapes4.cursorMove = (x, y) => { + ansiEscapes5.cursorMove = (x, y) => { if (typeof x !== "number") { throw new TypeError("The `x` argument is required"); } @@ -43031,40 +43031,40 @@ var require_ansi_escapes = __commonJS({ } return ret; }; - ansiEscapes4.cursorUp = (count = 1) => ESC + count + "A"; - ansiEscapes4.cursorDown = (count = 1) => ESC + count + "B"; - ansiEscapes4.cursorForward = (count = 1) => ESC + count + "C"; - ansiEscapes4.cursorBackward = (count = 1) => ESC + count + "D"; - ansiEscapes4.cursorLeft = ESC + "G"; - ansiEscapes4.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s"; - ansiEscapes4.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u"; - ansiEscapes4.cursorGetPosition = ESC + "6n"; - ansiEscapes4.cursorNextLine = ESC + "E"; - ansiEscapes4.cursorPrevLine = ESC + "F"; - ansiEscapes4.cursorHide = ESC + "?25l"; - ansiEscapes4.cursorShow = ESC + "?25h"; - ansiEscapes4.eraseLines = (count) => { + ansiEscapes5.cursorUp = (count = 1) => ESC + count + "A"; + ansiEscapes5.cursorDown = (count = 1) => ESC + count + "B"; + ansiEscapes5.cursorForward = (count = 1) => ESC + count + "C"; + ansiEscapes5.cursorBackward = (count = 1) => ESC + count + "D"; + ansiEscapes5.cursorLeft = ESC + "G"; + ansiEscapes5.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s"; + ansiEscapes5.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u"; + ansiEscapes5.cursorGetPosition = ESC + "6n"; + ansiEscapes5.cursorNextLine = ESC + "E"; + ansiEscapes5.cursorPrevLine = ESC + "F"; + ansiEscapes5.cursorHide = ESC + "?25l"; + ansiEscapes5.cursorShow = ESC + "?25h"; + ansiEscapes5.eraseLines = (count) => { let clear = ""; for (let i = 0; i < count; i++) { - clear += ansiEscapes4.eraseLine + (i < count - 1 ? ansiEscapes4.cursorUp() : ""); + clear += ansiEscapes5.eraseLine + (i < count - 1 ? ansiEscapes5.cursorUp() : ""); } if (count) { - clear += ansiEscapes4.cursorLeft; + clear += ansiEscapes5.cursorLeft; } return clear; }; - ansiEscapes4.eraseEndLine = ESC + "K"; - ansiEscapes4.eraseStartLine = ESC + "1K"; - ansiEscapes4.eraseLine = ESC + "2K"; - ansiEscapes4.eraseDown = ESC + "J"; - ansiEscapes4.eraseUp = ESC + "1J"; - ansiEscapes4.eraseScreen = ESC + "2J"; - ansiEscapes4.scrollUp = ESC + "S"; - ansiEscapes4.scrollDown = ESC + "T"; - ansiEscapes4.clearScreen = "\x1Bc"; - ansiEscapes4.clearTerminal = process.platform === "win32" ? `${ansiEscapes4.eraseScreen}${ESC}0f` : `${ansiEscapes4.eraseScreen}${ESC}3J${ESC}H`; - ansiEscapes4.beep = BEL; - ansiEscapes4.link = (text, url) => { + ansiEscapes5.eraseEndLine = ESC + "K"; + ansiEscapes5.eraseStartLine = ESC + "1K"; + ansiEscapes5.eraseLine = ESC + "2K"; + ansiEscapes5.eraseDown = ESC + "J"; + ansiEscapes5.eraseUp = ESC + "1J"; + ansiEscapes5.eraseScreen = ESC + "2J"; + ansiEscapes5.scrollUp = ESC + "S"; + ansiEscapes5.scrollDown = ESC + "T"; + ansiEscapes5.clearScreen = "\x1Bc"; + ansiEscapes5.clearTerminal = process.platform === "win32" ? `${ansiEscapes5.eraseScreen}${ESC}0f` : `${ansiEscapes5.eraseScreen}${ESC}3J${ESC}H`; + ansiEscapes5.beep = BEL; + ansiEscapes5.link = (text, url) => { return [ OSC, "8", @@ -43080,7 +43080,7 @@ var require_ansi_escapes = __commonJS({ BEL ].join(""); }; - ansiEscapes4.image = (buffer, options = {}) => { + ansiEscapes5.image = (buffer, options = {}) => { let ret = `${OSC}1337;File=inline=1`; if (options.width) { ret += `;width=${options.width}`; @@ -43093,7 +43093,7 @@ var require_ansi_escapes = __commonJS({ } return ret + ":" + buffer.toString("base64") + BEL; }; - ansiEscapes4.iTerm = { + ansiEscapes5.iTerm = { setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`, annotation: (message, options = {}) => { let ret = `${OSC}1337;`; @@ -58032,7 +58032,7 @@ var esm_default2 = createPrompt((config, done) => { const bounds = useMemo(() => { const first = items.findIndex(isSelectable); const last = items.findLastIndex(isSelectable); - if (first < 0) { + if (first === -1) { throw new ValidationError("[checkbox prompt] No selectable choices. All choices are disabled."); } return { first, last }; @@ -58290,21 +58290,332 @@ var esm_default5 = createPrompt((config, done) => { ]; }); +// +function isStepOf(value, step, min) { + const valuePow = value * Math.pow(10, 6); + const stepPow = step * Math.pow(10, 6); + const minPow = min * Math.pow(10, 6); + return (valuePow - (Number.isFinite(min) ? minPow : 0)) % stepPow === 0; +} +function validateNumber(value, { min, max, step }) { + if (value == null || Number.isNaN(value)) { + return false; + } else if (value < min || value > max) { + return `Value must be between ${min} and ${max}`; + } else if (step !== "any" && !isStepOf(value, step, min)) { + return `Value must be a multiple of ${step}${Number.isFinite(min) ? ` starting from ${min}` : ""}`; + } + return true; +} +var esm_default6 = createPrompt((config, done) => { + var _a2; + const { validate = () => true, min = -Infinity, max = Infinity, step = 1, required = false } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const validDefault = validateNumber(config.default, { min, max, step }) === true ? (_a2 = config.default) == null ? void 0 : _a2.toString() : void 0; + const [defaultValue = "", setDefaultValue] = useState(validDefault); + const [errorMsg, setError] = useState(); + const prefix = usePrefix({ status, theme }); + useKeypress(async (key, rl) => { + if (status !== "idle") { + return; + } + if (isEnterKey(key)) { + const input = value || defaultValue; + const answer = input === "" ? void 0 : Number(input); + setStatus("loading"); + let isValid = true; + if (required || answer != null) { + isValid = validateNumber(answer, { min, max, step }); + } + if (isValid === true) { + isValid = await validate(answer); + } + if (isValid === true) { + setValue(String(answer ?? "")); + setStatus("done"); + done(answer); + } else { + rl.write(value); + setError(isValid || "You must provide a valid numeric value"); + setStatus("idle"); + } + } else if (isBackspaceKey(key) && !value) { + setDefaultValue(void 0); + } else if (key.name === "tab" && !value) { + setDefaultValue(void 0); + rl.clearLine(0); + rl.write(defaultValue); + setValue(defaultValue); + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config.message, status); + let formattedValue = value; + if (status === "done") { + formattedValue = theme.style.answer(value); + } + let defaultStr; + if (defaultValue && status !== "done" && !value) { + defaultStr = theme.style.defaultAnswer(defaultValue); + } + let error = ""; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + [prefix, message, defaultStr, formattedValue].filter((v) => v !== void 0).join(" "), + error + ]; +}); + // var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1); +function normalizeChoices2(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) { + return choice; + } + const name = "name" in choice ? choice.name : String(choice.value); + const value = "value" in choice ? choice.value : name; + return { + value, + name, + key: choice.key.toLowerCase() + }; + }); +} +var helpChoice = { + key: "h", + name: "Help, list all options", + value: void 0 +}; +var esm_default7 = createPrompt((config, done) => { + const { default: defaultKey = "h" } = config; + const choices = useMemo(() => normalizeChoices2(config.choices), [config.choices]); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const [expanded, setExpanded] = useState(config.expanded ?? false); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ theme, status }); + useKeypress((event, rl) => { + if (isEnterKey(event)) { + const answer = (value || defaultKey).toLowerCase(); + if (answer === "h" && !expanded) { + setExpanded(true); + } else { + const selectedChoice = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === answer); + if (selectedChoice) { + setStatus("done"); + setValue(answer); + done(selectedChoice.value); + } else if (value === "") { + setError("Please input a value"); + } else { + setError(`"${import_yoctocolors_cjs4.default.red(value)}" isn't an available option`); + } + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config.message, status); + if (status === "done") { + const selectedChoice = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase()); + return `${prefix} ${message} ${theme.style.answer(selectedChoice.name)}`; + } + const allChoices = expanded ? choices : [...choices, helpChoice]; + let longChoices = ""; + let shortChoices = allChoices.map((choice) => { + if (Separator.isSeparator(choice)) + return ""; + if (choice.key === defaultKey) { + return choice.key.toUpperCase(); + } + return choice.key; + }).join(""); + shortChoices = ` ${theme.style.defaultAnswer(shortChoices)}`; + if (expanded) { + shortChoices = ""; + longChoices = allChoices.map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + const line = ` ${choice.key}) ${choice.name}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }).join("\n"); + } + let helpTip = ""; + const currentOption = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase()); + if (currentOption) { + helpTip = `${import_yoctocolors_cjs4.default.cyan(">>")} ${currentOption.name}`; + } + let error = ""; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message}${shortChoices} ${value}`, + [longChoices, helpTip, error].filter(Boolean).join("\n") + ]; +}); + +// +var import_yoctocolors_cjs5 = __toESM(require_yoctocolors_cjs(), 1); +var numberRegex = /\d+/; +function isSelectableChoice(choice) { + return choice != null && !Separator.isSeparator(choice); +} +function normalizeChoices3(choices) { + let index = 0; + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + index += 1; + if (typeof choice === "string") { + return { + value: choice, + name: choice, + short: choice, + key: String(index) + }; + } + const name = choice.name ?? String(choice.value); + return { + value: choice.value, + name, + short: choice.short ?? name, + key: choice.key ?? String(index) + }; + }); +} +var esm_default8 = createPrompt((config, done) => { + const choices = useMemo(() => normalizeChoices3(config.choices), [config.choices]); + const [status, setStatus] = useState("idle"); + const [value, setValue] = useState(""); + const [errorMsg, setError] = useState(); + const theme = makeTheme(config.theme); + const prefix = usePrefix({ status, theme }); + useKeypress((key, rl) => { + if (isEnterKey(key)) { + let selectedChoice; + if (numberRegex.test(value)) { + const answer = Number.parseInt(value, 10) - 1; + selectedChoice = choices.filter(isSelectableChoice)[answer]; + } else { + selectedChoice = choices.find((choice) => isSelectableChoice(choice) && choice.key === value); + } + if (isSelectableChoice(selectedChoice)) { + setValue(selectedChoice.short ?? selectedChoice.name ?? String(selectedChoice.value)); + setStatus("done"); + done(selectedChoice.value); + } else if (value === "") { + setError("Please input a value"); + } else { + setError(`"${import_yoctocolors_cjs5.default.red(value)}" isn't an available option`); + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config.message, status); + if (status === "done") { + return `${prefix} ${message} ${theme.style.answer(value)}`; + } + const choicesStr = choices.map((choice) => { + if (Separator.isSeparator(choice)) { + return ` ${choice.separator}`; + } + const line = ` ${choice.key}) ${choice.name}`; + if (choice.key === value.toLowerCase()) { + return theme.style.highlight(line); + } + return line; + }).join("\n"); + let error = ""; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [ + `${prefix} ${message} ${value}`, + [choicesStr, error].filter(Boolean).join("\n") + ]; +}); + +// var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1); -var selectTheme = { +var esm_default9 = createPrompt((config, done) => { + const { validate = () => true } = config; + const theme = makeTheme(config.theme); + const [status, setStatus] = useState("idle"); + const [errorMsg, setError] = useState(); + const [value, setValue] = useState(""); + const prefix = usePrefix({ status, theme }); + useKeypress(async (key, rl) => { + if (status !== "idle") { + return; + } + if (isEnterKey(key)) { + const answer = value; + setStatus("loading"); + const isValid = await validate(answer); + if (isValid === true) { + setValue(answer); + setStatus("done"); + done(answer); + } else { + rl.write(value); + setError(isValid || "You must provide a valid value"); + setStatus("idle"); + } + } else { + setValue(rl.line); + setError(void 0); + } + }); + const message = theme.style.message(config.message, status); + let formattedValue = ""; + let helpTip; + if (config.mask) { + const maskChar = typeof config.mask === "string" ? config.mask : "*"; + formattedValue = maskChar.repeat(value.length); + } else if (status !== "done") { + helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes3.default.cursorHide}`; + } + if (status === "done") { + formattedValue = theme.style.answer(formattedValue); + } + let error = ""; + if (errorMsg) { + error = theme.style.error(errorMsg); + } + return [[prefix, message, config.mask ? formattedValue : helpTip].join(" "), error]; +}); + +// +var import_yoctocolors_cjs6 = __toESM(require_yoctocolors_cjs(), 1); +var searchTheme = { icon: { cursor: esm_default.pointer }, style: { - disabled: (text) => import_yoctocolors_cjs4.default.dim(`- ${text}`), - description: (text) => import_yoctocolors_cjs4.default.cyan(text) + disabled: (text) => import_yoctocolors_cjs6.default.dim(`- ${text}`), + searchTerm: (text) => import_yoctocolors_cjs6.default.cyan(text), + description: (text) => import_yoctocolors_cjs6.default.cyan(text) }, helpMode: "auto" }; function isSelectable2(item) { return !Separator.isSeparator(item) && !item.disabled; } -function normalizeChoices2(choices) { +function normalizeChoices4(choices) { return choices.map((choice) => { if (Separator.isSeparator(choice)) return choice; @@ -58326,18 +58637,181 @@ function normalizeChoices2(choices) { }; }); } -var esm_default6 = createPrompt((config, done) => { +var esm_default10 = createPrompt((config, done) => { + const { pageSize = 7, validate = () => true } = config; + const theme = makeTheme(searchTheme, config.theme); + const firstRender = useRef(true); + const [status, setStatus] = useState("loading"); + const [searchTerm, setSearchTerm] = useState(""); + const [searchResults, setSearchResults] = useState([]); + const [searchError, setSearchError] = useState(); + const prefix = usePrefix({ status, theme }); + const bounds = useMemo(() => { + const first = searchResults.findIndex(isSelectable2); + const last = searchResults.findLastIndex(isSelectable2); + return { first, last }; + }, [searchResults]); + const [active = bounds.first, setActive] = useState(); + useEffect(() => { + const controller = new AbortController(); + setStatus("loading"); + setSearchError(void 0); + const fetchResults = async () => { + try { + const results = await config.source(searchTerm || void 0, { + signal: controller.signal + }); + if (!controller.signal.aborted) { + setActive(void 0); + setSearchError(void 0); + setSearchResults(normalizeChoices4(results)); + setStatus("idle"); + } + } catch (error2) { + if (!controller.signal.aborted && error2 instanceof Error) { + setSearchError(error2.message); + } + } + }; + void fetchResults(); + return () => { + controller.abort(); + }; + }, [searchTerm]); + const selectedChoice = searchResults[active]; + useKeypress(async (key, rl) => { + if (isEnterKey(key)) { + if (selectedChoice) { + setStatus("loading"); + const isValid = await validate(selectedChoice.value); + setStatus("idle"); + if (isValid === true) { + setStatus("done"); + done(selectedChoice.value); + } else if (selectedChoice.name === searchTerm) { + setSearchError(isValid || "You must provide a valid value"); + } else { + rl.write(selectedChoice.name); + setSearchTerm(selectedChoice.name); + } + } else { + rl.write(searchTerm); + } + } else if (key.name === "tab" && selectedChoice) { + rl.clearLine(0); + rl.write(selectedChoice.name); + setSearchTerm(selectedChoice.name); + } else if (status !== "loading" && (key.name === "up" || key.name === "down")) { + rl.clearLine(0); + if (key.name === "up" && active !== bounds.first || key.name === "down" && active !== bounds.last) { + const offset = key.name === "up" ? -1 : 1; + let next = active; + do { + next = (next + offset + searchResults.length) % searchResults.length; + } while (!isSelectable2(searchResults[next])); + setActive(next); + } + } else { + setSearchTerm(rl.line); + } + }); + const message = theme.style.message(config.message, status); + if (active > 0) { + firstRender.current = false; + } + let helpTip = ""; + if (searchResults.length > 1 && (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current)) { + helpTip = searchResults.length > pageSize ? ` +${theme.style.help("(Use arrow keys to reveal more choices)")}` : ` +${theme.style.help("(Use arrow keys)")}`; + } + const page = usePagination({ + items: searchResults, + active, + renderItem({ item, isActive }) { + if (Separator.isSeparator(item)) { + return ` ${item.separator}`; + } + if (item.disabled) { + const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)"; + return theme.style.disabled(`${item.name} ${disabledLabel}`); + } + const color = isActive ? theme.style.highlight : (x) => x; + const cursor = isActive ? theme.icon.cursor : ` `; + return color(`${cursor} ${item.name}`); + }, + pageSize, + loop: false + }); + let error; + if (searchError) { + error = theme.style.error(searchError); + } else if (searchResults.length === 0 && searchTerm !== "" && status === "idle") { + error = theme.style.error("No results found"); + } + let searchStr; + if (status === "done" && selectedChoice) { + const answer = selectedChoice.short ?? selectedChoice.name; + return `${prefix} ${message} ${theme.style.answer(answer)}`; + } else { + searchStr = theme.style.searchTerm(searchTerm); + } + const choiceDescription = (selectedChoice == null ? void 0 : selectedChoice.description) ? ` +${theme.style.description(selectedChoice.description)}` : ``; + return [ + [prefix, message, searchStr].filter(Boolean).join(" "), + `${error ?? page}${helpTip}${choiceDescription}` + ]; +}); + +// +var import_yoctocolors_cjs7 = __toESM(require_yoctocolors_cjs(), 1); +var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1); +var selectTheme = { + icon: { cursor: esm_default.pointer }, + style: { + disabled: (text) => import_yoctocolors_cjs7.default.dim(`- ${text}`), + description: (text) => import_yoctocolors_cjs7.default.cyan(text) + }, + helpMode: "auto" +}; +function isSelectable3(item) { + return !Separator.isSeparator(item) && !item.disabled; +} +function normalizeChoices5(choices) { + return choices.map((choice) => { + if (Separator.isSeparator(choice)) + return choice; + if (typeof choice === "string") { + return { + value: choice, + name: choice, + short: choice, + disabled: false + }; + } + const name = choice.name ?? String(choice.value); + return { + value: choice.value, + name, + description: choice.description, + short: choice.short ?? name, + disabled: choice.disabled ?? false + }; + }); +} +var esm_default11 = createPrompt((config, done) => { const { loop = true, pageSize = 7 } = config; const firstRender = useRef(true); const theme = makeTheme(selectTheme, config.theme); const [status, setStatus] = useState("idle"); const prefix = usePrefix({ status, theme }); const searchTimeoutRef = useRef(); - const items = useMemo(() => normalizeChoices2(config.choices), [config.choices]); + const items = useMemo(() => normalizeChoices5(config.choices), [config.choices]); const bounds = useMemo(() => { - const first = items.findIndex(isSelectable2); - const last = items.findLastIndex(isSelectable2); - if (first < 0) { + const first = items.findIndex(isSelectable3); + const last = items.findLastIndex(isSelectable3); + if (first === -1) { throw new ValidationError("[select prompt] No selectable choices. All choices are disabled."); } return { first, last }; @@ -58345,7 +58819,7 @@ var esm_default6 = createPrompt((config, done) => { const defaultItemIndex = useMemo(() => { if (!("default" in config)) return -1; - return items.findIndex((item) => isSelectable2(item) && item.value === config.default); + return items.findIndex((item) => isSelectable3(item) && item.value === config.default); }, [config.default, items]); const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex); const selectedChoice = items[active]; @@ -58361,14 +58835,14 @@ var esm_default6 = createPrompt((config, done) => { let next = active; do { next = (next + offset + items.length) % items.length; - } while (!isSelectable2(items[next])); + } while (!isSelectable3(items[next])); setActive(next); } } else if (isNumberKey(key)) { rl.clearLine(0); const position = Number(key.name) - 1; const item = items[position]; - if (item != null && isSelectable2(item)) { + if (item != null && isSelectable3(item)) { setActive(position); } } else if (isBackspaceKey(key)) { @@ -58376,11 +58850,11 @@ var esm_default6 = createPrompt((config, done) => { } else { const searchTerm = rl.line.toLowerCase(); const matchIndex = items.findIndex((item) => { - if (Separator.isSeparator(item) || !isSelectable2(item)) + if (Separator.isSeparator(item) || !isSelectable3(item)) return false; return item.name.toLowerCase().startsWith(searchTerm); }); - if (matchIndex >= 0) { + if (matchIndex !== -1) { setActive(matchIndex); } searchTimeoutRef.current = setTimeout(() => { @@ -58427,7 +58901,7 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`; const choiceDescription = selectedChoice.description ? ` ${theme.style.description(selectedChoice.description)}` : ``; return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")} -${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes3.default.cursorHide}`; +${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursorHide}`; }); // @@ -58436,7 +58910,7 @@ var Prompt = class { Prompt.confirm = esm_default4; Prompt.input = esm_default5; Prompt.checkbox = esm_default2; -Prompt.select = esm_default6; +Prompt.select = esm_default11; Prompt.editor = esm_default3; // @@ -58660,7 +59134,7 @@ async function rebase(installationClient, installationToken) { } // -var import_core7 = __toESM(require_core()); +var import_core17 = __toESM(require_core()); // var RequestError2 = class extends Error { @@ -60952,7 +61426,7 @@ function createAppAuth(options) { var import_github5 = __toESM(require_github()); var ANGULAR_ROBOT = [43341, "angular-robot-key"]; async function getJwtAuthedAppClient([appId, inputKey]) { - const privateKey = (0, import_core7.getInput)(inputKey, { required: true }); + const privateKey = (0, import_core17.getInput)(inputKey, { required: true }); return new Octokit2({ authStrategy: createAppAuth, auth: { appId, privateKey } @@ -60979,7 +61453,7 @@ async function revokeActiveInstallationToken(githubOrToken) { } else { await githubOrToken.apps.revokeInstallationAccessToken(); } - (0, import_core7.info)("Revoked installation token used for Angular Robot."); + (0, import_core17.info)("Revoked installation token used for Angular Robot."); } // diff --git a/package.json b/package.json index bd4e5c27d..06642426a 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@bazel/jasmine": "patch:@bazel/jasmine@npm:5.8.1#.yarn/patches/@bazel-jasmine-npm.patch", "@google-cloud/firestore": "^7.0.0", "@google-cloud/storage": "^7.0.0", - "@inquirer/prompts": "^6.0.0", + "@inquirer/prompts": "^7.0.0", "@inquirer/type": "^1.5.0", "@lezer/common": "^1.1.1", "@lezer/highlight": "^1.2.0", diff --git a/yarn.lock b/yarn.lock index 71824482d..b3f2d3ca3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -322,7 +322,7 @@ __metadata: "@bazel/typescript": "npm:5.8.1" "@google-cloud/firestore": "npm:^7.0.0" "@google-cloud/storage": "npm:^7.0.0" - "@inquirer/prompts": "npm:^6.0.0" + "@inquirer/prompts": "npm:^7.0.0" "@inquirer/type": "npm:^1.5.0" "@lezer/common": "npm:^1.1.1" "@lezer/highlight": "npm:^1.2.0" @@ -2736,6 +2736,19 @@ __metadata: languageName: node linkType: hard +"@inquirer/checkbox@npm:^4.0.0": + version: 4.0.0 + resolution: "@inquirer/checkbox@npm:4.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/figures": "npm:^1.0.7" + "@inquirer/type": "npm:^3.0.0" + ansi-escapes: "npm:^4.3.2" + yoctocolors-cjs: "npm:^2.1.2" + checksum: 10c0/af67ca9752cb398ce66746011cddc1458954dc3f3dbcf1ec9c188248095b1069cf638fe098101171fe06ce87d576b1e75a9d323f985f7cdf487fc99d62af2b4b + languageName: node + linkType: hard + "@inquirer/confirm@npm:4.0.1, @inquirer/confirm@npm:^4.0.1": version: 4.0.1 resolution: "@inquirer/confirm@npm:4.0.1" @@ -2746,6 +2759,33 @@ __metadata: languageName: node linkType: hard +"@inquirer/confirm@npm:^5.0.0": + version: 5.0.0 + resolution: "@inquirer/confirm@npm:5.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/type": "npm:^3.0.0" + checksum: 10c0/bb7d37e6b2a7b884e3e7fee16de7349a33ea5834b2683cade2471bb548089b1e8ccbe2ed94bbcabf8b430ee83b3ae7e14c742fec8ec5ff29cf91c509ba351b6a + languageName: node + linkType: hard + +"@inquirer/core@npm:^10.0.0": + version: 10.0.0 + resolution: "@inquirer/core@npm:10.0.0" + dependencies: + "@inquirer/figures": "npm:^1.0.7" + "@inquirer/type": "npm:^3.0.0" + ansi-escapes: "npm:^4.3.2" + cli-width: "npm:^4.1.0" + mute-stream: "npm:^2.0.0" + signal-exit: "npm:^4.1.0" + strip-ansi: "npm:^6.0.1" + wrap-ansi: "npm:^6.2.0" + yoctocolors-cjs: "npm:^2.1.2" + checksum: 10c0/628dc3c7e21c7fbc1238f4a3b6de0c99885a53c16e829bd8c7fb820e54f1406612e6c7d008bd0dc0f649aed9f4ce5589876aabd5404144c0761f3967d3f98702 + languageName: node + linkType: hard + "@inquirer/core@npm:^9.2.1": version: 9.2.1 resolution: "@inquirer/core@npm:9.2.1" @@ -2777,6 +2817,17 @@ __metadata: languageName: node linkType: hard +"@inquirer/editor@npm:^4.0.0": + version: 4.0.0 + resolution: "@inquirer/editor@npm:4.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/type": "npm:^3.0.0" + external-editor: "npm:^3.1.0" + checksum: 10c0/c1331cb14eb8f66bb1f7bb82e51865a04a11f3387368fbd24f83d22150cef2715f76025a40700ce5de96619e840d135d89ddd191736f4a1614719136a52cee03 + languageName: node + linkType: hard + "@inquirer/expand@npm:^3.0.1": version: 3.0.1 resolution: "@inquirer/expand@npm:3.0.1" @@ -2788,6 +2839,17 @@ __metadata: languageName: node linkType: hard +"@inquirer/expand@npm:^4.0.0": + version: 4.0.0 + resolution: "@inquirer/expand@npm:4.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/type": "npm:^3.0.0" + yoctocolors-cjs: "npm:^2.1.2" + checksum: 10c0/8d3a469286c3927262437ac42aa2f3b0c838bbe574f1cbcb9298fa9054afc165a1ea9b6a5bca8460d0110f23704f3ada64dab46b287d690594348c0dec9890ad + languageName: node + linkType: hard + "@inquirer/figures@npm:^1.0.6": version: 1.0.6 resolution: "@inquirer/figures@npm:1.0.6" @@ -2795,6 +2857,13 @@ __metadata: languageName: node linkType: hard +"@inquirer/figures@npm:^1.0.7": + version: 1.0.7 + resolution: "@inquirer/figures@npm:1.0.7" + checksum: 10c0/d7b4cfcd38dd43d1ac79da52c4478aa89145207004a471aa2083856f1d9b99adef45563f09d66c09d6457b09200fcf784527804b70ad3bd517cbc5e11142c2df + languageName: node + linkType: hard + "@inquirer/input@npm:^3.0.1": version: 3.0.1 resolution: "@inquirer/input@npm:3.0.1" @@ -2805,6 +2874,16 @@ __metadata: languageName: node linkType: hard +"@inquirer/input@npm:^4.0.0": + version: 4.0.0 + resolution: "@inquirer/input@npm:4.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/type": "npm:^3.0.0" + checksum: 10c0/25d3d1031fae17764896ae5a13ea4ed70226d28f633852e4f0b9e584972cb1d6fe2dc599fedea29653369143177de0cc207ed2d118bae2df9c1e20f83a910180 + languageName: node + linkType: hard + "@inquirer/number@npm:^2.0.1": version: 2.0.1 resolution: "@inquirer/number@npm:2.0.1" @@ -2815,6 +2894,16 @@ __metadata: languageName: node linkType: hard +"@inquirer/number@npm:^3.0.0": + version: 3.0.0 + resolution: "@inquirer/number@npm:3.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/type": "npm:^3.0.0" + checksum: 10c0/7f39d7d70147c7f25dda04497b4ab8cad95329b3608b1433ec3488fa1e7d8643aaa10d04c3f4e470c437ea6e303b095dda22ef865cf660229cf6249d9548bb36 + languageName: node + linkType: hard + "@inquirer/password@npm:^3.0.1": version: 3.0.1 resolution: "@inquirer/password@npm:3.0.1" @@ -2826,7 +2915,18 @@ __metadata: languageName: node linkType: hard -"@inquirer/prompts@npm:6.0.1, @inquirer/prompts@npm:^6.0.0": +"@inquirer/password@npm:^4.0.0": + version: 4.0.0 + resolution: "@inquirer/password@npm:4.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/type": "npm:^3.0.0" + ansi-escapes: "npm:^4.3.2" + checksum: 10c0/d0c252209b855b4b68c8689d758b3bb161745f894ca42a5157a25860fa1fabd145e380b70bd09428860765ab4782d469a26bfad15ccb0de63273eba8c8736006 + languageName: node + linkType: hard + +"@inquirer/prompts@npm:6.0.1": version: 6.0.1 resolution: "@inquirer/prompts@npm:6.0.1" dependencies: @@ -2844,6 +2944,24 @@ __metadata: languageName: node linkType: hard +"@inquirer/prompts@npm:^7.0.0": + version: 7.0.0 + resolution: "@inquirer/prompts@npm:7.0.0" + dependencies: + "@inquirer/checkbox": "npm:^4.0.0" + "@inquirer/confirm": "npm:^5.0.0" + "@inquirer/editor": "npm:^4.0.0" + "@inquirer/expand": "npm:^4.0.0" + "@inquirer/input": "npm:^4.0.0" + "@inquirer/number": "npm:^3.0.0" + "@inquirer/password": "npm:^4.0.0" + "@inquirer/rawlist": "npm:^4.0.0" + "@inquirer/search": "npm:^3.0.0" + "@inquirer/select": "npm:^4.0.0" + checksum: 10c0/f206e4bea209d861dd0498577ee486d8d5c5b7697c21f153198891b35593d6aca9199dda2d0ac2587254249832a943d123d45b2628e6e657c8b5955c175273d4 + languageName: node + linkType: hard + "@inquirer/rawlist@npm:^3.0.1": version: 3.0.1 resolution: "@inquirer/rawlist@npm:3.0.1" @@ -2855,6 +2973,17 @@ __metadata: languageName: node linkType: hard +"@inquirer/rawlist@npm:^4.0.0": + version: 4.0.0 + resolution: "@inquirer/rawlist@npm:4.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/type": "npm:^3.0.0" + yoctocolors-cjs: "npm:^2.1.2" + checksum: 10c0/1b13528d84917a642d0e5e8121a7ba5b2d5451c88c152aeefe9c5a9a29e2def207cbb0bd12c03a33391e3f89bf2889439f73030c1f996d1c0d74478ca6b4e1c8 + languageName: node + linkType: hard + "@inquirer/search@npm:^2.0.1": version: 2.0.1 resolution: "@inquirer/search@npm:2.0.1" @@ -2867,6 +2996,18 @@ __metadata: languageName: node linkType: hard +"@inquirer/search@npm:^3.0.0": + version: 3.0.0 + resolution: "@inquirer/search@npm:3.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/figures": "npm:^1.0.7" + "@inquirer/type": "npm:^3.0.0" + yoctocolors-cjs: "npm:^2.1.2" + checksum: 10c0/3eaa863df725f2487517cd6b8120353c24b36f2a7c4e6a84aac6654ca7d03591d1721679c51c7d312e11acda83d05ad42d725718502fac795f36d69e4354fd3a + languageName: node + linkType: hard + "@inquirer/select@npm:^3.0.1": version: 3.0.1 resolution: "@inquirer/select@npm:3.0.1" @@ -2880,6 +3021,19 @@ __metadata: languageName: node linkType: hard +"@inquirer/select@npm:^4.0.0": + version: 4.0.0 + resolution: "@inquirer/select@npm:4.0.0" + dependencies: + "@inquirer/core": "npm:^10.0.0" + "@inquirer/figures": "npm:^1.0.7" + "@inquirer/type": "npm:^3.0.0" + ansi-escapes: "npm:^4.3.2" + yoctocolors-cjs: "npm:^2.1.2" + checksum: 10c0/fca9e4e725e74a9c8f2c9860f210b55acb9cec644f8e471459674bb396690a3ae1c250675370b855c331ad2dd519a19ff03d9ead17acc985acc409769dc68079 + languageName: node + linkType: hard + "@inquirer/type@npm:^1.5.0, @inquirer/type@npm:^1.5.5": version: 1.5.5 resolution: "@inquirer/type@npm:1.5.5" @@ -2898,6 +3052,15 @@ __metadata: languageName: node linkType: hard +"@inquirer/type@npm:^3.0.0": + version: 3.0.0 + resolution: "@inquirer/type@npm:3.0.0" + peerDependencies: + "@types/node": ">=18" + checksum: 10c0/4c26595749782e3dfbfea0c7a19b1db603485e0fce4a9d4fe52be1c9c05fcb2cc3afbc849d03bddbde47896786df93d6f02657eeeae5dbc8cdc78cd8a4f80123 + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -11554,6 +11717,13 @@ __metadata: languageName: node linkType: hard +"mute-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "mute-stream@npm:2.0.0" + checksum: 10c0/2cf48a2087175c60c8dcdbc619908b49c07f7adcfc37d29236b0c5c612d6204f789104c98cc44d38acab7b3c96f4a3ec2cfdc4934d0738d876dbefa2a12c69f4 + languageName: node + linkType: hard + "mz@npm:^2.4.0": version: 2.7.0 resolution: "mz@npm:2.7.0"