Skip to content

[eas-cli] Add --dev-domain flag to eas deploy#4004

Open
brentvatne wants to merge 2 commits into
mainfrom
deploy-dev-domain-flag
Open

[eas-cli] Add --dev-domain flag to eas deploy#4004
brentvatne wants to merge 2 commits into
mainfrom
deploy-dev-domain-flag

Conversation

@brentvatne

Copy link
Copy Markdown
Member

Why

On a project's first eas deploy, the CLI interactively prompts for the preview URL subdomain (dev domain name). There is currently no way to provide it non-interactively, and when the server-suggested name is taken, non-interactive mode recurses forever in assignDevDomainNameAsync (it retries with the same taken name).

How

  • New --dev-domain <name> flag on eas deploy: assigns the preview URL on first deployment without prompting.
    • Validated eagerly before any network call, sharing the interactive prompt's rules plus rejecting names the prompt would have silently auto-reformatted (formatDevDomainName(name) !== name).
    • If the requested name is taken → clear error.
    • If the project already has a different dev domain → clear error instead of silently ignoring the flag (the CLI has no path to change an existing dev domain).
  • Fixed the non-interactive taken-name infinite recursion: both the flag path and the suggested-name path now throw actionable errors mentioning --dev-domain.
  • New DeploymentsQuery.getDevDomainNameByAppIdAsync + regenerated GraphQL types (includes small unrelated schema-drift comments codegen picked up).

Test Plan

  • yarn test src/worker/__tests__/deployment.test.ts — 19 new tests: validation rules, flag assignment without prompting, taken-name errors (flag + non-interactive suggested), existing-domain mismatch/match, full first-deploy retry flow.
  • yarn typecheck, yarn lint, yarn fmt:check — clean.
  • Smoke-tested via bin/dev: deploy --help shows the flag; --dev-domain 'My App!!' / 'ab' / 'ends-with-' fail fast with specific messages.

Manual:

  • Fresh project: eas deploy --non-interactive --dev-domain my-fresh-name → assigns my-fresh-name.expo.app, no prompt.
  • Taken name → "already taken, choose a different URL with the --dev-domain flag".
  • Project with existing different domain → "preview URL is already set to … and cannot be changed".

🤖 Generated with Claude Code

Allows assigning the EAS Hosting preview URL subdomain on a project's
first deployment without the interactive prompt, so first-time deploys
can run with --non-interactive and a custom URL.

- Validates the name eagerly (shared rules with the interactive prompt,
  plus rejecting anything the prompt would have auto-reformatted)
- Errors clearly when the requested name is taken, instead of the
  previous behavior in non-interactive mode where a taken suggested name
  caused infinite recursion in assignDevDomainNameAsync
- Errors when the project already has a different dev domain rather than
  silently ignoring the flag
@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder
packages/eas-cli/src/worker/** @kitten, @kadikraman
packages/eas-cli/src/commands/deploy/** @kitten, @kadikraman

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.78788% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.75%. Comparing base (4b1f785) to head (fa5e5a1).

Files with missing lines Patch % Lines
packages/eas-cli/src/commands/deploy/index.ts 25.00% 3 Missing ⚠️
packages/eas-cli/src/worker/queries.ts 0.00% 3 Missing ⚠️
packages/eas-cli/src/worker/deployment.ts 96.16% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4004      +/-   ##
==========================================
+ Coverage   59.67%   59.75%   +0.08%     
==========================================
  Files         941      941              
  Lines       41319    41339      +20     
  Branches     8675     8684       +9     
==========================================
+ Hits        24654    24696      +42     
+ Misses      16571    16549      -22     
  Partials       94       94              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant