Skip to content

feat(cli): add expo framework support to bundle command #73

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

saseungmin
Copy link

@saseungmin saseungmin commented Jun 11, 2025

📝 Overview

Adds Expo project support to the code-push CLI, enabling CodePush functionality for Expo projects alongside existing React Native projects.

✨ What's Added

  • framework option: Added -f, --framework parameter with choices expo (only expo)
  • Expo bundle command: Implemented runExpoBundleCommand function using expo export:embed
  • Unified CLI interface: Both bundle and release commands now support both project types
  • Backward compatibility: Maintains full compatibility with existing React Native projects (default behavior unchanged)

🔧 Changes Made

1. Enhanced CLI Commands

  • Bundle Command (cli/commands/bundleCommand/index.js)

    • Added --framework option with expo choices
    • Default remains react-native for backward compatibility
  • Release Command (cli/commands/releaseCommand/index.js)

    • Added --framework option support
    • Passes type parameter through the release pipeline

2. Core Bundle Logic (cli/commands/bundleCommand/bundleCodePush.js)

  • Added framework parameter to bundleCodePush function
  • Conditional bundling based on project type:
    • react-native(default): Uses existing runReactNativeBundleCommand
    • expo: Uses new runExpoBundleCommand

3. New Expo Bundle Function (cli/functions/runExpoBundleCommand.js)

  • Implements Expo-specific bundling using expo export:embed
  • Mirrors React Native bundle command parameters
  • Uses appropriate Expo CLI arguments for CodePush compatibility

4. Release Pipeline Updates (cli/commands/releaseCommand/release.js)

  • Updated release function to accept and pass through type parameter
  • Maintains existing functionality while supporting Expo projects

5. Documentation Updates (README.md)

  • Added Expo usage examples to release and bundle command sections
  • Added --framework parameter bundle, release cli description

🎯 Usage Examples

For React Native Projects (unchanged)

npx code-push bundle --platform android
npx code-push release --binary-version 1.0.0 --app-version 1.0.1 --platform ios 

For Expo Projects (new)

npx code-push bundle --platform android --framework expo
npx code-push release --binary-version 1.0.0 --app-version 1.0.1 --framework expo

✅ Testing

  • Tested Expo bundling with expo export:embed
  • Confirmed CLI parameter parsing works correctly

🔄 Breaking Changes

None - This is a fully backward compatible addition. All existing commands continue to work exactly as before.

📋 Related Work

@@ -4,13 +4,15 @@ const { OUTPUT_BUNDLE_DIR, ROOT_OUTPUT_DIR, ENTRY_FILE } = require('../../consta

program.command('bundle')
.description('Creates a CodePush bundle file (assumes Hermes is enabled).')
.addOption(new Option('-t, --type <type>', 'project type (react-native | expo)').choices(['react-native', 'expo']).default('react-native'))
Copy link
Member

Choose a reason for hiding this comment

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

How about changing the name of option to -f, --framework and running the expo bundle command only when -f expo option passed?

Because I thought framework represents Expo’s identity better than type.
(I also considered using a --expo flag, but it didn’t seem scalable for future frameworks. 😆 )

Copy link
Author

Choose a reason for hiding this comment

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

@floydkim
Awesome! Just switched type to framework as you suggested.
I've also updated the PR description and the README to reflect these changes.

@saseungmin saseungmin changed the title feat(cli): add expo project type support to bundle command feat(cli): add expo framework support to bundle command Jun 23, 2025
Copy link
Member

@floydkim floydkim left a comment

Choose a reason for hiding this comment

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

@saseungmin Thank you!

This diff may be released as v9.2.0 along with your expo-plugin.

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.

2 participants