@codemoreira/esad 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,51 +1,46 @@
1
1
  # ESAD (Easy Super App Development) 🚀
2
2
 
3
- Zero-Config CLI and DevTools for React Native Module Federation.
3
+ Zero-Config CLI and DevTools for React Native Module Federation + Expo.
4
4
 
5
- ESAD is a unified toolkit designed to abstract all the complexity from Super App development using **Re.Pack (Webpack)** and **React Native**.
5
+ ESAD is a unified toolkit designed to abstract all the complexity from Super App development using **Re.Pack (Rspack)** and **Expo**.
6
6
 
7
7
  ---
8
8
 
9
- ## 🏗️ Commands
9
+ ## 🏗️ CLI Commands
10
10
 
11
11
  ### 1. Initialize a Workspace
12
- Creates a main project folder with a Host (Expo-ready) and a global configuration.
12
+ Clones the official Host Template and sets up a global workspace configuration.
13
13
  ```bash
14
14
  npx @codemoreira/esad init my-project
15
15
  ```
16
16
 
17
17
  ### 2. Create a Federated Module
18
- Scaffolds a new mini-app correctly named and configured to join the Super App.
18
+ Clones the official Module Template and correctly configures it to join the Super App.
19
19
  ```bash
20
20
  npx esad create-module module-rh
21
21
  ```
22
22
 
23
- ### 3. Create a Service Registry / CDN
24
- Sets up the backend registry used for dynamic routing and file hosting.
23
+ ### 3. Development Mode
24
+ Starts the local Rspack server and **automatically** prepares native folders (`android/ios`) with necessary Re.Pack patches (Gradle, Entry Points).
25
25
  ```bash
26
- npx esad create-cdn
26
+ npx esad host dev # To run the Host
27
+ npx esad dev --id module-rh --port 9000 # To run a Module
27
28
  ```
28
29
 
29
- ### 4. Development Mode (Real-time HMR)
30
- Starts the local packager and **automatically** notifies the Registry to bypass the CDN, so your Host App sees your local changes instantly.
30
+ ### 4. Deployment
31
+ Builds, zips, and uploads the module bundle to the configured CDN registry.
31
32
  ```bash
32
- npx esad dev --id module-rh --port 8081
33
- ```
34
-
35
- ### 5. Deployment
36
- Builds, zips, and uploads the module bundle to the configured CDN endpoint.
37
- ```bash
38
- npx esad deploy --id module-rh --version 1.0.0 --entry index.bundle
33
+ npx esad deploy --id module-rh --version 1.0.0
39
34
  ```
40
35
 
41
36
  ---
42
37
 
43
38
  ## 🛠️ Library Usage
44
39
 
45
- ### 🎨 Bundler Plugin (`esad/plugin`)
40
+ ### 🎨 Bundler Plugin (`@codemoreira/esad/plugin`)
46
41
  In your `rspack.config.mjs`, simplify everything:
47
42
  ```javascript
48
- import { withESAD } from 'esad/plugin';
43
+ import { withESAD } from '@codemoreira/esad/plugin';
49
44
 
50
45
  export default withESAD({
51
46
  type: 'module', // or 'host'
@@ -53,22 +48,30 @@ export default withESAD({
53
48
  });
54
49
  ```
55
50
 
56
- ### ⚡ Global State Hook (`esad/client`)
57
- Share state across different modules and the Host instantly and reatively:
51
+ ### ⚡ Global State Hook (`@codemoreira/esad/client`)
52
+ Share state across different modules and the Host instantly and reactively:
58
53
  ```javascript
59
- import { useESADState } from 'esad/client';
54
+ import { useESADState } from '@codemoreira/esad/client';
60
55
 
61
56
  const [token, setToken] = useESADState('auth_token');
62
57
  ```
63
58
 
64
59
  ---
65
60
 
66
- ## 🏠 Host App Features (by Default)
61
+ ## 🏠 Template Features (Host & Module)
67
62
 
68
- When you run `esad init`, the generated Host App comes pre-configured with:
63
+ ESAD now uses a **Template-Based Scaffolding** system. Creating a project via CLI clones:
64
+ - [esad-template-host](https://github.com/CodeMoreira/esad-template-host)
65
+ - [esad-template-module](https://github.com/CodeMoreira/esad-template-module)
66
+
67
+ **Features included by default:**
68
+ - **🚀 Rspack + Re.Pack**: Blazing fast builds with Module Federation v2.
69
+ - **🎨 NativeWind v4**: Utility-first styling with Tailwind CSS logic.
70
+ - **🔐 Auth System**: Complete `AuthProvider` with `expo-secure-store`.
71
+ - **🛤️ Protected Routes**: Automatic redirection logic.
72
+ - **📦 Module Loader**: Robust dynamic remote loading via ESAD Registry.
73
+
74
+ ---
69
75
 
70
- - **🎨 NativeWind v4**: Utility-first styling ready to use with Tailwind CSS logic.
71
- - **🔐 Auth System**: Complete `AuthProvider` with persistent token storage using `expo-secure-store`.
72
- - **🛤️ Protected Routes**: Automatic redirection between `login` and `(protected)` groups based on auth state.
73
- - **📦 Module Loader**: A robust `lib/moduleLoader.ts` to fetch and initialize federated modules dynamically.
74
- - **📱 Premium UI**: A clean, modern starting point for your Super App dashboard.
76
+ ## 🎨 Architecture & Workflow
77
+ For a detailed view of the system's architecture and development cycles, see [ESAD_ARCHITECTURE.md](./ESAD_ARCHITECTURE.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemoreira/esad",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Easy Super App Development - Zero-Config CLI and DevTools for React Native Module Federation",
5
5
  "main": "src/plugin/index.js",
6
6
  "types": "./src/plugin/index.d.ts",
@@ -39,7 +39,7 @@ function listAvailableModules(configObj) {
39
39
 
40
40
  const entries = fs.readdirSync(workspaceRoot, { withFileTypes: true });
41
41
  const modules = entries
42
- .filter(e => e.isDirectory() && e.name.startsWith(projectName))
42
+ .filter(e => e.isDirectory() && e.name.startsWith(projectName) && !e.name.endsWith('-host') && !e.name.endsWith('-cdn'))
43
43
  .map(e => {
44
44
  const name = e.name.replace(`${projectName}-`, '');
45
45
  return name;