Skip to content

Commit

Permalink
refactor(eas-cli): reword dev domain prompt to use "preview URL" (#2572)
Browse files Browse the repository at this point in the history
* refactor(eas-cli): reword dev domain prompt to use "preview URL"

* docs(eas-cli): add changelog entry

* docs(eas-cli): fix changelog entry
  • Loading branch information
byCedric authored Sep 17, 2024
1 parent 41fd76c commit d33ebe1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ This is the log of notable changes to EAS CLI and related packages.
- 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)))
- Reword the dev domain prompt to mention "preview URL". ([#2572](https://github.com/expo/eas-cli/pull/2572) by [@byCedric](https://github.com/byCedric)))

## [12.3.0](https://github.com/expo/eas-cli/releases/tag/v12.3.0) - 2024-09-09

Expand Down
14 changes: 7 additions & 7 deletions packages/eas-cli/src/worker/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ async function chooseDevDomainNameAsync({
const { name } = await promptAsync({
type: 'text',
name: 'name',
message: 'Choose a URL for your project:',
message: 'Choose a preview URL for your project:',
initial,
validate: (value: string) => {
if (!value) {
return 'You have to choose a URL for your project';
return 'You have to choose a preview URL for your project';
}
if (value.length < 3) {
return 'Project URLs must be at least 3 characters long';
return 'Preview URLs must be at least 3 characters long';
}
if (value.endsWith('-')) {
return 'Project URLs cannot end with a hyphen (-)';
return 'Preview URLs cannot end with a hyphen (-)';
}
return true;
},
Expand All @@ -139,7 +139,7 @@ async function chooseDevDomainNameAsync({
});

if (!name) {
throw new Error('No project URL provided, aborting deployment.');
throw new Error('No preview URL provided, aborting deployment.');
}

try {
Expand All @@ -149,15 +149,15 @@ async function chooseDevDomainNameAsync({
});

if (!success) {
throw new Error('Failed to assign project URL');
throw new Error('Failed to assign preview URL');
}
} catch (error: any) {
const isChosenNameTaken = (error as GraphqlError)?.graphQLErrors?.some(e =>
['DEV_DOMAIN_NAME_TAKEN'].includes(e?.extensions?.errorCode as string)
);

if (isChosenNameTaken) {
Log.error(`The project URL "${name}" is already taken, choose a different name.`);
Log.error(`The preview URL "${name}" is already taken, choose a different URL.`);
await chooseDevDomainNameAsync({ graphqlClient, appId, initial });
}

Expand Down

0 comments on commit d33ebe1

Please sign in to comment.