How developer-sumit/react-native-lab works
React Native Lab is an interactive CLI that gathers project choices, optionally installs Android prerequisites, invokes the React Native Community CLI, then customizes the generated project. Customization includes selectable blank/navigation templates, NativeWind, environment-variable options, optional hooks and console-log removal; the workflow can also initialize Git and add CI. The graph emphasizes the observed orchestration and calls. Template families and some optional capabilities are represented from the README/tree; their internal wiring was not fully sampled.
Main entry points: template.ts Template Installer · index.ts CLI Entry · react-native-lab.ts Project Orchestrator · prompts.ts Setup Prompts
Components 20
CLI Workflow
- CLI Entry
index.ts - Setup Prompts
src/prompts.ts - Retry Logic
src/helpers/retry.ts
Project Generation
- Project Orchestrator
src/react-native-lab.ts - Package Manager
src/helpers/get-pkg-manager.ts - RN Versions
src/helpers/fetch-rn-versions.ts
Templates & DX
- Template Installer
src/template.ts - Project Templates
src/templates/project - File Copier
src/helpers/copy.ts - Custom Hooks
src/templates/snippets/hooks.ts - NativeWind Option
src/templates/project - Environment Config
src/template.ts - Console Removal
src/template.ts
Environment Setup
- Prerequisite Installer
src/install-scripts.ts - Command Detection
src/helpers/check-cmd.ts
Project Integrations
- Git Initialization
src/helpers/git.ts - CI Workflow Setup
src/helpers/ci.ts
Other components
- CLI User
- React Native CLI
- Android Toolchain
Connections 19
- CLI User → CLI Entry: runs
- CLI Entry → Setup Prompts: collects choices
index.ts - Setup Prompts → RN Versions: fetches versions
src/prompts.ts - Setup Prompts → Command Detection: checks tools
src/prompts.ts - CLI Entry → Retry Logic: retries installs
index.ts - CLI Entry → Prerequisite Installer: requests installs
index.ts - Prerequisite Installer → Command Detection: checks commands
src/install-scripts.ts - Prerequisite Installer → Android Toolchain: installs tools
src/install-scripts.ts - CLI Entry → Project Orchestrator: starts setup
index.ts - Project Orchestrator → React Native CLI: runs init
src/react-native-lab.ts - Project Orchestrator → Template Installer: installs template
src/react-native-lab.ts - Template Installer → Project Templates: copies selected files
src/template.ts - Template Installer → File Copier: copies files
src/template.ts - Template Installer → Custom Hooks: includes selected hooks
src/template.ts - Project Orchestrator → Git Initialization: initializes repository
src/react-native-lab.ts - Project Orchestrator → CI Workflow Setup: sets up CI
src/react-native-lab.ts - Template Installer → NativeWind Option: supports NativeWind
- Template Installer → Environment Config: configures env
src/template.ts - Template Installer → Console Removal: configures removal
src/template.ts