Skip to content

feat(create-expo-module): Add non-interactive mode and CI support#43317

Merged
EvanBacon merged 4 commits intomainfrom
@evanbacon/create-expo-module/agent-friendly
Feb 20, 2026
Merged

feat(create-expo-module): Add non-interactive mode and CI support#43317
EvanBacon merged 4 commits intomainfrom
@evanbacon/create-expo-module/agent-friendly

Conversation

@EvanBacon
Copy link
Copy Markdown
Contributor

Summary

  • 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

Changes

Non-interactive mode detection

  • Automatically enabled when CI=1 or CI=true
  • Automatically enabled when stdin is not a TTY

New 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 repository

E2E tests

  • Added e2e/ directory with Jest tests
  • Tests CLI flags and module creation in CI mode
  • Added GitHub Actions workflow for CI

Test plan

  • yarn test:e2e passes locally
  • Tests run in ~40 seconds (4 tests)
  • Module creation works with CI=1

Usage example

# CI mode (auto-detected)
CI=1 npx create-expo-module my-module --no-example

# With custom values
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

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.
@github-actions
Copy link
Copy Markdown
Contributor

Subscribed to pull request

File Patterns Mentions
.github/workflows/** @tsapeta, @brentvatne, @Kudo
packages/create-expo-module/** @aleqsio

Generated by CodeMention

@expo-bot expo-bot added the bot: passed checks ExpoBot has nothing to complain about label 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.

EvanBacon and others added 2 commits February 20, 2026 09:10
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>
@EvanBacon EvanBacon merged commit 45f89e3 into main Feb 20, 2026
13 checks passed
@EvanBacon EvanBacon deleted the @evanbacon/create-expo-module/agent-friendly branch February 20, 2026 17:29
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants