Skip to content

Commit 8ae9323

Browse files
gpandersemily-shen
andauthored
Include cursor in text prompts (#10492)
Co-authored-by: emily-shen <[email protected]>
1 parent 443d1f1 commit 8ae9323

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.changeset/orange-signs-lose.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/cli": patch
3+
---
4+
5+
Include cursor in text prompts

packages/cli/interactive.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,14 @@ const getTextRenderers = (config: TextPromptConfig) => {
301301
const helpText = config.helpText ?? "";
302302
const format = config.format ?? ((val: Arg) => String(val));
303303
const defaultValue = config.defaultValue?.toString() ?? "";
304-
const activeRenderer = ({ value }: { value: Arg }) => [
305-
`${blCorner} ${bold(question)} ${dim(helpText)}`,
306-
`${space(2)}${format(value || dim(defaultValue))}`,
307-
``, // extra line for readability
308-
];
304+
const activeRenderer = (props: RenderProps) => {
305+
const { valueWithCursor } = props as TextPrompt;
306+
return [
307+
`${blCorner} ${bold(question)} ${dim(helpText)}`,
308+
`${space(2)}${format(valueWithCursor || dim(defaultValue))}`,
309+
``, // extra line for readability
310+
];
311+
};
309312

310313
return {
311314
initial: () => [

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"scripts": {
2020
"check:lint": "eslint . --max-warnings=0",
2121
"check:type": "tsc",
22+
"deploy": "echo 'no deploy'",
2223
"test:ci": "vitest run"
2324
},
2425
"devDependencies": {

tools/deployments/__tests__/validate-changesets.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe("findPackageNames()", () => {
2222
expect(findPackageNames()).toEqual(
2323
new Set([
2424
"@cloudflare/chrome-devtools-patches",
25+
"@cloudflare/cli",
2526
"@cloudflare/kv-asset-handler",
2627
"@cloudflare/pages-shared",
2728
"@cloudflare/quick-edit",

0 commit comments

Comments
 (0)