@codemoreira/esad
v1.2.5
Published
Easy Super App Development - Zero-Config CLI and DevTools for React Native Module Federation
Readme
ESAD (Easy Super App Development) 🚀
Zero-Config CLI and DevTools for React Native Module Federation.
ESAD is a unified toolkit designed to abstract all the complexity from Super App development using Re.Pack (Webpack) and React Native.
🏗️ Commands
1. Initialize a Workspace
Creates a main project folder with a Host (Expo-ready) and a global configuration.
npx @codemoreira/esad init my-project2. Create a Federated Module
Scaffolds a new mini-app correctly named and configured to join the Super App.
npx esad create-module module-rh3. Create a Service Registry / CDN
Sets up the backend registry used for dynamic routing and file hosting.
npx esad create-cdn4. Development Mode (Real-time HMR)
Starts the local packager and automatically notifies the Registry to bypass the CDN, so your Host App sees your local changes instantly.
npx esad dev --id module-rh --port 80815. Deployment
Builds, zips, and uploads the module bundle to the configured CDN endpoint.
npx esad deploy --id module-rh --version 1.0.0 --entry index.bundle🛠️ Library Usage
🎨 Bundler Plugin (esad/plugin)
In your rspack.config.mjs, simplify everything:
import { withESAD } from 'esad/plugin';
export default withESAD({
type: 'module', // or 'host'
id: 'my-mini-app'
});⚡ Global State Hook (esad/client)
Share state across different modules and the Host instantly and reatively:
import { useESADState } from 'esad/client';
const [token, setToken] = useESADState('auth_token');🏠 Host App Features (by Default)
When you run esad init, the generated Host App comes pre-configured with:
- 🎨 NativeWind v4: Utility-first styling ready to use with Tailwind CSS logic.
- 🔐 Auth System: Complete
AuthProviderwith persistent token storage usingexpo-secure-store. - 🛤️ Protected Routes: Automatic redirection between
loginand(protected)groups based on auth state. - 📦 Module Loader: A robust
lib/moduleLoader.tsto fetch and initialize federated modules dynamically. - 📱 Premium UI: A clean, modern starting point for your Super App dashboard.
