Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eas-cli): expose expo export dev flag as an option in eas update #2050

Merged
merged 3 commits into from
Sep 13, 2023
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🎉 New features

- Update: expose expo cli `--dev` flag as an argument. ([#2050](https://github.com/expo/eas-cli/pull/2050) by [@nderscore](https://github.com/nderscore))

### 🐛 Bug fixes

### 🧹 Chores
Expand Down
12 changes: 10 additions & 2 deletions packages/eas-cli/src/commands/update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { getVcsClient } from '../../vcs';

type RawUpdateFlags = {
auto: boolean;
dev: boolean;
branch?: string;
channel?: string;
message?: string;
Expand All @@ -74,6 +75,7 @@ type RawUpdateFlags = {

type UpdateFlags = {
auto: boolean;
dev: boolean;
platform: ExpoCLIExportPlatformFlag;
branchName?: string;
channelName?: string;
Expand Down Expand Up @@ -134,6 +136,10 @@ export default class UpdatePublish extends EasCommand {
default: 'all',
required: false,
}),
dev: Flags.boolean({
description: 'Publish a development bundle',
default: false,
}),
auto: Flags.boolean({
description:
'Use the current git branch and commit message for the EAS branch and update message',
Expand All @@ -158,6 +164,7 @@ export default class UpdatePublish extends EasCommand {
auto: autoFlag,
platform: platformFlag,
channelName: channelNameArg,
dev,
updateMessage: updateMessageArg,
inputDir,
skipBundler,
Expand Down Expand Up @@ -220,7 +227,7 @@ export default class UpdatePublish extends EasCommand {
if (!skipBundler) {
const bundleSpinner = ora().start('Exporting...');
try {
await buildBundlesAsync({ projectDir, inputDir, exp, platformFlag, clearCache });
await buildBundlesAsync({ projectDir, inputDir, dev, exp, platformFlag, clearCache });
bundleSpinner.succeed('Exported bundle(s)');
} catch (e) {
bundleSpinner.fail('Export failed');
Expand Down Expand Up @@ -524,7 +531,7 @@ export default class UpdatePublish extends EasCommand {
private sanitizeFlags(flags: RawUpdateFlags): UpdateFlags {
const nonInteractive = flags['non-interactive'] ?? false;

const { auto, branch: branchName, channel: channelName, message: updateMessage } = flags;
const { auto, branch: branchName, channel: channelName, dev, message: updateMessage } = flags;
if (nonInteractive && !auto && !(updateMessage && (branchName || channelName))) {
Errors.error(
'--branch and --message, or --channel and --message are required when updating in non-interactive mode unless --auto is specified',
Expand Down Expand Up @@ -553,6 +560,7 @@ export default class UpdatePublish extends EasCommand {
auto,
branchName,
channelName,
dev,
updateMessage,
inputDir: flags['input-dir'],
skipBundler: flags['skip-bundler'],
Expand Down
5 changes: 5 additions & 0 deletions packages/eas-cli/src/project/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@ export async function buildBundlesAsync({
exp,
platformFlag,
clearCache,
dev = false,
}: {
projectDir: string;
inputDir: string;
exp: Pick<ExpoConfig, 'sdkVersion' | 'web'>;
platformFlag: ExpoCLIExportPlatformFlag;
clearCache?: boolean;
dev?: boolean;
}): Promise<void> {
const packageJSON = JsonFile.read(path.resolve(projectDir, 'package.json'));
if (!packageJSON) {
Expand All @@ -208,6 +210,7 @@ export async function buildBundlesAsync({
'--dump-sourcemap',
'--dump-assetmap',
`--platform=${platformFlag}`,
...(dev ? ['--dev'] : []),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this flag exists on the legacy Expo CLI

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...(clearCache ? ['--clear'] : []),
]);
}
Expand All @@ -227,6 +230,7 @@ export async function buildBundlesAsync({
'--dump-sourcemap',
'--dump-assetmap',
...platformArgs,
...(dev ? ['--dev'] : []),
...(clearCache ? ['--clear'] : []),
]);
}
Expand All @@ -248,6 +252,7 @@ export async function buildBundlesAsync({
'--dump-sourcemap',
'--dump-assetmap',
`--platform=${platformFlag}`,
...(dev ? ['--dev'] : []),
...(clearCache ? ['--clear'] : []),
]);
}
Expand Down
Loading