feat(create-expo-module): Add non-interactive mode and CI support#43317
Merged
feat(create-expo-module): Add non-interactive mode and CI support#43317
Conversation
Add non-interactive detection and defaults so the generator can run in CI or scripted environments. Derive package slug, module name and Android package from the target path when not interactive, and automatically continue when target dir is non-empty. Add CLI flags to pre-fill module metadata (--name, --description, --package, --author-name, --author-email, --author-url, --repo) and use those values to skip prompts. Introduce helper utilities (isInteractive, slugToModuleName, slugToAndroidPackage, getCliValueForPrompt, getSubstitutionDataFromOptions), import validate-npm-package-name and Git/GitHub helpers to resolve author/repo info, and thread CommandOptions through prompting/confirmation functions. Update types to include the new CLI options.
Add an end-to-end test suite and CI workflow for the create-expo-module package. Files added: e2e tests and helpers (packages/create-expo-module/e2e/__tests__/index-test.ts, __tests__/utils.ts), Jest config and tsconfig for the e2e suite, and a GitHub Actions workflow (.github/workflows/create-expo-module.yml) that runs the e2e tests on Node 20/22 for pushes, PRs, and on a daily schedule. Also update package.json to expose `test` and `test:e2e` scripts. The tests run the built CLI in a temporary directory, validate generated files and package.json contents, and clean up after themselves.
Contributor
|
Subscribed to pull request
Generated by CodeMention |
tsapeta
approved these changes
Feb 20, 2026
| .option('--package <package>', 'Android package name (e.g., expo.modules.mymodule).') | ||
| .option('--author-name <name>', 'Author name for package.json.') | ||
| .option('--author-email <email>', 'Author email for package.json.') | ||
| .option('--author-url <url>', "URL to the author's profile (e.g., GitHub profile).") |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
The E2E tests use ts-jest for TypeScript transformation, while the main test command uses babel-jest. This mismatch caused parse errors in CI when `yarn test` picked up the E2E test files. Add jest.config.js with testPathIgnorePatterns to exclude the e2e/ directory from the regular test run. E2E tests are run separately via `yarn test:e2e` which uses its own jest config. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
alanjhughes
pushed a commit
that referenced
this pull request
Feb 24, 2026
…3317) - Add full support for non-interactive mode in `create-expo-module` for CI/CD environments - Add CLI options to provide all module configuration values without prompts - Add E2E tests that run in CI - Automatically enabled when `CI=1` or `CI=true` - Automatically enabled when stdin is not a TTY - `--name <name>` - Native module name (e.g., MyModule) - `--description <description>` - Module description - `--package <package>` - Android package name (e.g., expo.modules.mymodule) - `--author-name <name>` - Author name for package.json - `--author-email <email>` - Author email for package.json - `--author-url <url>` - URL to the author's profile - `--repo <url>` - URL of the repository - Added `e2e/` directory with Jest tests - Tests CLI flags and module creation in CI mode - Added GitHub Actions workflow for CI - [x] `yarn test:e2e` passes locally - [x] Tests run in ~40 seconds (4 tests) - [x] Module creation works with `CI=1` ```bash CI=1 npx create-expo-module my-module --no-example npx create-expo-module my-module \ --no-example \ --name MyModule \ --description "My awesome module" \ --package com.mycompany.mymodule \ --author-name "John Doe" ``` 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create-expo-modulefor CI/CD environmentsChanges
Non-interactive mode detection
CI=1orCI=trueNew CLI options
--name <name>- Native module name (e.g., MyModule)--description <description>- Module description--package <package>- Android package name (e.g., expo.modules.mymodule)--author-name <name>- Author name for package.json--author-email <email>- Author email for package.json--author-url <url>- URL to the author's profile--repo <url>- URL of the repositoryE2E tests
e2e/directory with Jest testsTest plan
yarn test:e2epasses locallyCI=1Usage example
🤖 Generated with Claude Code