$ show flexn-io/renative
ReNative (rnv) is a cross-platform development CLI tool and framework that enables building applications for mobile (iOS, Android), web, TV (Tizen, webOS, Fire TV, Android TV, tvOS), desktop (macOS, Windows, Linux, Electron), wearables, and consoles from a single codebase. The system uses a monorepo architecture with modular packages: a core library (`@rnv/core`) providing configuration merging, plugin management, template injection, and task orchestration; platform-specific engines (`@rnv/engine-rn`, `@rnv/engine-rn-electron`, `@rnv/engine-rn-next`, etc.) that define build logic and native project templates; SDK packages (`@rnv/sdk-android`, `@rnv/sdk-apple`, `@rnv/sdk-tizen`, etc.) for platform-specific tooling like device management and code generation; and a CLI entry point (`rnv`) that dispatches commands to registered tasks. The primary data flow involves reading hierarchical configuration files (`renative.json`, `appConfigs/`), merging them with plugin definitions and engine defaults, injecting placeholders into platform templates (e.g., AndroidManifest.xml, Xcode project files, Webpack configs), and then invoking native build tools (Gradle, Xcode, Webpack, etc.) to produce deployable artifacts. External dependencies include React Native, Electron, Next.js, Webpack, and platform SDKs (Android SDK, Xcode, Tizen SDK, webOS SDK). The framework also includes a telemetry module, Docker integration, and a build hooks system for custom pre/post-publish scripts.
The LLM identified 3 files worth highlighting for reuse:
Provides engine-agnostic Babel, Metro, Webpack, and Next.js configuration adapters (`withRNVBabel`, `withRNVMetro`, `withRNVWebpack`, `withRNVNext`). Each adapter delegates to the currently active engine's adapter implementation, allowing the same API to work across React Native, Electron, Next.js, and web engines. This pattern is reusable for any multi-engine build tool that needs to inject framework-specific configs without hardcoding engine logic.
Contains `writeCleanFile` and `copyFileWithInjectSync` which perform file copying with placeholder replacement (`{{VAR}}`, `{{INJECT_*}}`) and support for multiple override patterns. The functions handle backup creation, checksum-based change detection, and recursive directory copying. This is a reusable utility for any project that needs to generate files from templates with dynamic injection, such as scaffolding tools or code generators.
Implements a self-contained interactive question module for installing project templates during `rnv new`. It uses inquirer prompts to ask the user whether to install a template, resolves template paths (npm package or local directory), and handles error states. The modular question pattern (each question in a separate file with a consistent interface) is reusable for building interactive CLI setup wizards in other tools.