From ec3c4d0988d50611df52e0cd86860bff6b3fd50b Mon Sep 17 00:00:00 2001 From: _nderscore <_@nderscore.com> Date: Thu, 7 Sep 2023 14:57:53 -0400 Subject: [PATCH 1/3] feat(eas-cli): expose expo export dev flag as an option in eas update --- packages/eas-cli/src/commands/update/index.ts | 12 ++++++++++-- packages/eas-cli/src/project/publish.ts | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/eas-cli/src/commands/update/index.ts b/packages/eas-cli/src/commands/update/index.ts index 37d36436d1..fe48a0d30d 100644 --- a/packages/eas-cli/src/commands/update/index.ts +++ b/packages/eas-cli/src/commands/update/index.ts @@ -56,6 +56,7 @@ import { getVcsClient } from '../../vcs'; type RawUpdateFlags = { auto: boolean; + dev: boolean; branch?: string; channel?: string; message?: string; @@ -74,6 +75,7 @@ type RawUpdateFlags = { type UpdateFlags = { auto: boolean; + dev: boolean; platform: ExpoCLIExportPlatformFlag; branchName?: string; channelName?: string; @@ -134,6 +136,10 @@ export default class UpdatePublish extends EasCommand { default: 'all', required: false, }), + dev: Flags.boolean({ + description: 'Publish an unminified dev bundle without stripping __DEV__ global', + default: false, + }), auto: Flags.boolean({ description: 'Use the current git branch and commit message for the EAS branch and update message', @@ -158,6 +164,7 @@ export default class UpdatePublish extends EasCommand { auto: autoFlag, platform: platformFlag, channelName: channelNameArg, + dev, updateMessage: updateMessageArg, inputDir, skipBundler, @@ -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'); @@ -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', @@ -553,6 +560,7 @@ export default class UpdatePublish extends EasCommand { auto, branchName, channelName, + dev, updateMessage, inputDir: flags['input-dir'], skipBundler: flags['skip-bundler'], diff --git a/packages/eas-cli/src/project/publish.ts b/packages/eas-cli/src/project/publish.ts index b1c92e2bb5..e67a3f4990 100644 --- a/packages/eas-cli/src/project/publish.ts +++ b/packages/eas-cli/src/project/publish.ts @@ -185,12 +185,14 @@ export async function buildBundlesAsync({ exp, platformFlag, clearCache, + dev = false, }: { projectDir: string; inputDir: string; exp: Pick; platformFlag: ExpoCLIExportPlatformFlag; clearCache?: boolean; + dev?: boolean; }): Promise { const packageJSON = JsonFile.read(path.resolve(projectDir, 'package.json')); if (!packageJSON) { @@ -208,6 +210,7 @@ export async function buildBundlesAsync({ '--dump-sourcemap', '--dump-assetmap', `--platform=${platformFlag}`, + ...(dev ? ['--dev'] : []), ...(clearCache ? ['--clear'] : []), ]); } @@ -227,6 +230,7 @@ export async function buildBundlesAsync({ '--dump-sourcemap', '--dump-assetmap', ...platformArgs, + ...(dev ? ['--dev'] : []), ...(clearCache ? ['--clear'] : []), ]); } @@ -248,6 +252,7 @@ export async function buildBundlesAsync({ '--dump-sourcemap', '--dump-assetmap', `--platform=${platformFlag}`, + ...(dev ? ['--dev'] : []), ...(clearCache ? ['--clear'] : []), ]); } From b4bbe0dee97585273f68dcb16cea367d344c754f Mon Sep 17 00:00:00 2001 From: _nderscore <_@nderscore.com> Date: Tue, 12 Sep 2023 05:26:03 +0000 Subject: [PATCH 2/3] update --dev argument description Co-authored-by: Quinlan Jung --- packages/eas-cli/src/commands/update/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eas-cli/src/commands/update/index.ts b/packages/eas-cli/src/commands/update/index.ts index fe48a0d30d..2bdfecd7d4 100644 --- a/packages/eas-cli/src/commands/update/index.ts +++ b/packages/eas-cli/src/commands/update/index.ts @@ -137,7 +137,7 @@ export default class UpdatePublish extends EasCommand { required: false, }), dev: Flags.boolean({ - description: 'Publish an unminified dev bundle without stripping __DEV__ global', + description: 'Publish a development bundle', default: false, }), auto: Flags.boolean({ From 4a49eb018ed68e6acadfdf240a0eecaf0ace5ad8 Mon Sep 17 00:00:00 2001 From: _nderscore <_@nderscore.com> Date: Wed, 13 Sep 2023 13:28:40 -0400 Subject: [PATCH 3/3] docs: update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc53212725..6b820ddab8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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