From 9c4ff98d683668c9f4ebf18ffdef8faccbc8bb95 Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Sat, 14 Sep 2024 15:08:46 +0100 Subject: [PATCH] refactor(eas-cli): remove the cursor space when prompting dev domain after input (#2568) * refactor(eas-cli): remove the cursor space when prompting dev domain after input * docs(eas-cli): add changelog entry --- CHANGELOG.md | 1 + packages/eas-cli/src/worker/deployment.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 367aba22ba..a667e24f1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ This is the log of notable changes to EAS CLI and related packages. - Polish the project URL prompt when setting up new projects. ([#2564](https://github.com/expo/eas-cli/pull/2564) by [@byCedric](https://github.com/byCedric))) - Always assume `static` exports in `eas deploy` and add modified time. ([#2565](https://github.com/expo/eas-cli/pull/2565) by [@byCedric](https://github.com/byCedric))) - Update the `eas worker --help` `--environment` description. ([#2567](https://github.com/expo/eas-cli/pull/2567) by [@byCedric](https://github.com/byCedric))) +- Remove the cursor space after selecting project dev domain. ([#2568](https://github.com/expo/eas-cli/pull/2568) by [@byCedric](https://github.com/byCedric))) ## [12.3.0](https://github.com/expo/eas-cli/releases/tag/v12.3.0) - 2024-09-09 diff --git a/packages/eas-cli/src/worker/deployment.ts b/packages/eas-cli/src/worker/deployment.ts index 2a7d5fd515..d954572269 100644 --- a/packages/eas-cli/src/worker/deployment.ts +++ b/packages/eas-cli/src/worker/deployment.ts @@ -66,6 +66,7 @@ type PromptInstance = { placeholder: boolean; rendered: string; initial: string; + done: boolean; get value(): string; set value(input: string); }; @@ -126,7 +127,10 @@ async function chooseDevDomainNameAsync({ onRender(this: PromptInstance, kleur) { this.cursorOffset = -rootDomain.length - 1; - if (this.placeholder) { + if (this.done) { + // Remove the space for the cursor when the prompt is done + this.rendered = this.value + kleur.dim(`${rootDomain}`); + } else if (this.placeholder) { this.rendered = kleur.dim(`${this.initial} ${rootDomain}`); } else { this.rendered = this.value + kleur.dim(` ${rootDomain}`);