Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This is the log of notable changes to EAS CLI and related packages.

- [eas-cli] Improve `eas workflow:create`: add a `--template` flag, generate a placeholder workflow when a file name is passed, use shorter default file names (`build.yml`, `update.yml`, `deploy.yml`), configure EAS Build and EAS Update automatically when the chosen template requires them, set default app identifiers without prompting for the development build and deploy templates, install `expo-dev-client` during development build setup, and tighten the generated comments and next steps. ([#3943](https://github.com/expo/eas-cli/pull/3943) by [@jonsamp](https://github.com/jonsamp))
- [eas-cli] `eas integrations:posthog:dashboard` now opens PostHog via a signed-in link, skipping the login prompt. ([#3975](https://github.com/expo/eas-cli/pull/3975) by [@gwdp](https://github.com/gwdp))
- [eas-cli] Add `--dev-domain` flag to `eas deploy` to choose the project's preview URL (`<name>.expo.app`) without prompting, allowing first-time deploys with `--non-interactive`. ([#4004](https://github.com/expo/eas-cli/pull/4004) by [@brentvatne](https://github.com/brentvatne))

### 🐛 Bug fixes

Expand Down
42 changes: 15 additions & 27 deletions packages/eas-cli/graphql.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion packages/eas-cli/src/commands/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { getOwnerAccountForProjectIdAsync } from '../../project/projectUtils';
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
import * as WorkerAssets from '../../worker/assets';
import {
assertValidDevDomainName,
assignWorkerDeploymentAliasAsync,
assignWorkerDeploymentProductionAsync,
getSignedDeploymentUrlAsync,
Expand All @@ -30,6 +31,7 @@ import {
uploadAsync,
} from '../../worker/upload';
import {
EXPO_BASE_DOMAIN,
formatWorkerDeploymentJson,
formatWorkerDeploymentTable,
getDeploymentUrlFromFullName,
Expand All @@ -50,6 +52,7 @@ interface DeployFlags {
aliasName?: string;
environment?: string;
deploymentIdentifier?: string;
devDomainName?: string;
exportDir: string;
dryRun: boolean;
sourceMaps: boolean;
Expand All @@ -62,6 +65,7 @@ interface RawDeployFlags {
prod: boolean;
alias?: string;
id?: string;
'dev-domain'?: string;
'export-dir': string;
'dry-run': boolean;
'source-maps': boolean;
Expand All @@ -82,7 +86,11 @@ interface DeployInProgressParams {
export default class WorkerDeploy extends EasCommand {
static override description = 'deploy your Expo Router web build and API Routes';
static override aliases = ['worker:deploy'];
static override usage = [chalk`deploy {dim [options]}`, `deploy --prod`];
static override usage = [
chalk`deploy {dim [options]}`,
`deploy --prod`,
`deploy --non-interactive --dev-domain my-app`,
];
static override state = 'preview';

static override flags = {
Expand All @@ -99,6 +107,10 @@ export default class WorkerDeploy extends EasCommand {
description: 'Custom unique identifier for the new deployment.',
helpValue: 'xyz123',
}),
'dev-domain': Flags.string({
description: `Custom preview URL subdomain to assign to the project on its first deployment, e.g. "my-app" for my-app.${EXPO_BASE_DOMAIN}.app. Required with --non-interactive if you want to customize the preview URL.`,
helpValue: 'name',
}),
'export-dir': Flags.string({
description: 'Directory where the Expo project was exported.',
helpValue: 'dir',
Expand Down Expand Up @@ -322,6 +334,7 @@ export default class WorkerDeploy extends EasCommand {
const uploadUrl = await getSignedDeploymentUrlAsync(graphqlClient, {
appId: projectId,
deploymentIdentifier: flags.deploymentIdentifier,
devDomainName: flags.devDomainName,
// NOTE(cedric): this function might ask the user for a dev-domain name,
// when that happens, no ora spinner should be running.
onSetupDevDomain: () => progress.stop(),
Expand Down Expand Up @@ -467,12 +480,19 @@ export default class WorkerDeploy extends EasCommand {

private sanitizeFlags(flags: RawDeployFlags): DeployFlags {
const { json, nonInteractive } = resolveNonInteractiveAndJsonFlags(flags);

const devDomainName = flags['dev-domain']?.trim().toLowerCase();
if (devDomainName !== undefined) {
assertValidDevDomainName(devDomainName);
}

return {
nonInteractive,
json,
isProduction: !!flags.prod,
aliasName: flags.alias?.trim().toLowerCase(),
deploymentIdentifier: flags.id?.trim(),
devDomainName,
exportDir: flags['export-dir'],
environment: flags['environment'],
dryRun: flags['dry-run'],
Expand Down
26 changes: 14 additions & 12 deletions packages/eas-cli/src/graphql/generated.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading