@codemoreira/esad 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +79 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # ESAD (Easy Super App Development) 🚀
2
+
3
+ Zero-Config CLI and DevTools for React Native Module Federation.
4
+
5
+ ESAD is a unified toolkit designed to abstract all the complexity from Super App development using **Re.Pack (Webpack)** and **React Native**.
6
+
7
+ ---
8
+
9
+ ## 🏗️ Commands
10
+
11
+ ### 1. Initialize a Workspace
12
+ Creates a main project folder with a Host (Expo-ready) and a global configuration.
13
+ ```bash
14
+ npx esad init nome-do-projeto
15
+ ```
16
+
17
+ ### 2. Create a Federated Module
18
+ Scaffolds a new mini-app correctly named and configured to join the Super App.
19
+ ```bash
20
+ esad create-module modulo-rh
21
+ ```
22
+
23
+ ### 3. Create a Service Registry / CDN
24
+ Sets up the backend registry used for dynamic routing and file hosting.
25
+ ```bash
26
+ esad create-cdn
27
+ ```
28
+
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.
31
+ ```bash
32
+ esad dev --id modulo-rh --port 8081
33
+ ```
34
+
35
+ ### 5. Deployment
36
+ Builds, zips, and uploads the module bundle to the configured CDN endpoint.
37
+ ```bash
38
+ esad deploy --id modulo-rh --version 1.0.0 --entry index.bundle
39
+ ```
40
+
41
+ ---
42
+
43
+ ## 🛠️ Library Usage
44
+
45
+ ### 🎨 Bundler Plugin (`esad/plugin`)
46
+ In your `rspack.config.mjs`, simplify everything:
47
+ ```javascript
48
+ import { withESAD } from 'esad/plugin';
49
+
50
+ export default withESAD({
51
+ type: 'module', // or 'host'
52
+ id: 'meu-mini-app'
53
+ });
54
+ ```
55
+
56
+ ### ⚡ Global State Hook (`esad/client`)
57
+ Share state across different modules and the Host instantly and reatively:
58
+ ```javascript
59
+ import { useESADState } from 'esad/client';
60
+
61
+ const [token, setToken] = useESADState('auth_token');
62
+ ```
63
+
64
+ ---
65
+
66
+ ## 📦 Publishing Updates
67
+
68
+ Whenever you make changes to the **ESAD** source code (CLI or Lib), follow these steps to push a new version to NPM:
69
+
70
+ 1. **Bump the version**:
71
+ Open `package.json` and increase the version number (e.g., `1.0.0` to `1.0.1`).
72
+ *Tip: Use `npm version patch` in the terminal to do this automatically.*
73
+
74
+ 2. **Publish**:
75
+ ```bash
76
+ npm publish
77
+ ```
78
+
79
+ Clients already using ESAD can then run `npm update esad` to get your latest improvements!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemoreira/esad",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
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
  "exports": {
@@ -27,4 +27,4 @@
27
27
  "fs-extra": "^11.2.0"
28
28
  },
29
29
  "devDependencies": {}
30
- }
30
+ }