expo-forge 2.1.1 ā 2.1.2
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 +68 -39
- package/bin/expo-forge.js +35 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# š„ Expo Forge
|
|
1
|
+
# š„ Expo Forge ā Bulletproof Expo Architecture
|
|
2
2
|
|
|
3
3
|
[](https://github.com/moasko/expo-forge/actions/workflows/test.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/expo-forge)
|
|
@@ -11,89 +11,118 @@ Initialize complete projects and features with TanStack Query, Zustand, Axios, a
|
|
|
11
11
|
|
|
12
12
|
## ā” Quick Start
|
|
13
13
|
|
|
14
|
-
###
|
|
14
|
+
### Zero Install (Recommended)
|
|
15
|
+
|
|
16
|
+
No setup required. Just run and forge:
|
|
15
17
|
|
|
16
18
|
```bash
|
|
17
|
-
|
|
19
|
+
npx create-expo-forge-app my-awesome-app
|
|
18
20
|
```
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
That's it. ā
Your fully configured Expo project is ready.
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
expo-forge init my-epic-app
|
|
24
|
-
```
|
|
24
|
+
---
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Global CLI Install
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
+
# Install once
|
|
30
|
+
npm install -g expo-forge
|
|
31
|
+
|
|
32
|
+
# Forge a new project
|
|
33
|
+
expo-forge init my-epic-app
|
|
34
|
+
|
|
35
|
+
# Add features
|
|
29
36
|
cd my-epic-app
|
|
30
37
|
expo-forge generate feature booking
|
|
38
|
+
expo-forge generate feature payment
|
|
31
39
|
```
|
|
32
40
|
|
|
33
41
|
---
|
|
34
42
|
|
|
43
|
+
## š ļø CLI Commands
|
|
44
|
+
|
|
45
|
+
| Command | Description |
|
|
46
|
+
| ------------------------------------ | ----------------------------------------------- |
|
|
47
|
+
| `npx create-expo-forge-app <name>` | **Fastest** way to forge a new project |
|
|
48
|
+
| `expo-forge init <name>` | Initialize a new project (after global install) |
|
|
49
|
+
| `expo-forge generate feature <name>` | Scaffold a complete feature module |
|
|
50
|
+
| `expo-forge --version` | Show the current version |
|
|
51
|
+
| `expo-forge --help` | Show available commands |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
35
55
|
## šļø What's Inside the Forge?
|
|
36
56
|
|
|
37
57
|
When you initialize a project, Expo Forge sets up a **production-ready** environment:
|
|
38
58
|
|
|
39
|
-
- **šļø Bulletproof Structure**
|
|
40
|
-
- **š
|
|
41
|
-
- **š
|
|
42
|
-
- **š§
|
|
43
|
-
- **šØ
|
|
44
|
-
- **š±
|
|
45
|
-
- **š”ļø Safe Area Ready**
|
|
46
|
-
- **šÆ Environment Ready**
|
|
59
|
+
- **šļø Bulletproof Structure** ā Feature-based architecture (`src/features`, `src/api`, `src/hooks`).
|
|
60
|
+
- **š Pre-configured Axios** ā API client with interceptors, auth headers, and error handling.
|
|
61
|
+
- **š TanStack Query v5** ā Async state with caching, background refetch, and optimistic updates.
|
|
62
|
+
- **š§ Zustand Stores** ā Lightweight, predictable global state management.
|
|
63
|
+
- **šØ NativeWind (Tailwind CSS)** ā Utility-first styling with `global.css` pre-configured.
|
|
64
|
+
- **š± Expo Router** ā File-based navigation with layouts and type safety.
|
|
65
|
+
- **š”ļø Safe Area Ready** ā `SafeAreaProvider` integrated for notched/modern devices.
|
|
66
|
+
- **šÆ Environment Ready** ā `.env.example` & TypeScript path aliases (`@/*`) configured.
|
|
47
67
|
|
|
48
68
|
---
|
|
49
69
|
|
|
50
|
-
##
|
|
70
|
+
## šļø Feature Generation
|
|
51
71
|
|
|
52
|
-
The `generate feature` command
|
|
72
|
+
The `generate feature` command scaffolds a self-contained module:
|
|
53
73
|
|
|
54
74
|
```text
|
|
55
75
|
src/features/booking/
|
|
56
|
-
āāā api/ # TanStack Query custom hooks
|
|
57
|
-
āāā components/ # UI components (e.g
|
|
76
|
+
āāā api/ # TanStack Query custom hooks (CRUD)
|
|
77
|
+
āāā components/ # UI components (e.g. BookingCard.tsx)
|
|
58
78
|
āāā hooks/ # Feature-specific business logic
|
|
59
79
|
āāā services/ # Pure API calls via Axios
|
|
60
|
-
āāā store/ # Zustand
|
|
80
|
+
āāā store/ # Zustand store for this domain
|
|
61
81
|
āāā types/ # TypeScript interfaces & DTOs
|
|
62
|
-
āāā utils/ # Domain helpers
|
|
63
|
-
āāā BookingScreen.tsx # Main
|
|
64
|
-
āāā index.ts # Clean public API
|
|
82
|
+
āāā utils/ # Domain-specific helpers
|
|
83
|
+
āāā BookingScreen.tsx # Main entry screen for this feature
|
|
84
|
+
āāā index.ts # Clean public API
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Import instantly:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { BookingScreen, useBookings } from "@/features/booking";
|
|
65
91
|
```
|
|
66
92
|
|
|
67
93
|
---
|
|
68
94
|
|
|
69
|
-
##
|
|
95
|
+
## š§ Technical Stack
|
|
70
96
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
97
|
+
| Layer | Technology |
|
|
98
|
+
| -------------------- | -------------------------------------------------------------------- |
|
|
99
|
+
| **Runtime** | [Expo](https://expo.dev/) + [React Native](https://reactnative.dev/) |
|
|
100
|
+
| **Navigation** | [Expo Router](https://docs.expo.dev/router/introduction/) |
|
|
101
|
+
| **Data Fetching** | [TanStack Query v5](https://tanstack.com/query) |
|
|
102
|
+
| **State Management** | [Zustand](https://github.com/pmndrs/zustand) |
|
|
103
|
+
| **HTTP Client** | [Axios](https://axios-http.com/) |
|
|
104
|
+
| **Styling** | [NativeWind](https://www.nativewind.dev/) (Tailwind CSS) |
|
|
105
|
+
| **Language** | TypeScript (strict) |
|
|
78
106
|
|
|
79
107
|
---
|
|
80
108
|
|
|
81
|
-
## š
|
|
109
|
+
## š Documentation
|
|
82
110
|
|
|
83
|
-
- **[
|
|
84
|
-
- **[
|
|
85
|
-
- **[
|
|
86
|
-
- **[š£ļø Roadmap](ROADMAP.md)**
|
|
111
|
+
- **[ā” Demo & Quickstart](DEMO.md)** ā Step-by-step walkthrough.
|
|
112
|
+
- **[šļø Architecture Guide](ARCHITECTURE.md)** ā Under-the-hood deep dive.
|
|
113
|
+
- **[š ļø Contribution Guide](CONTRIBUTING.md)** ā Extend and customize the Forge.
|
|
114
|
+
- **[š£ļø Roadmap](ROADMAP.md)** ā The future of Expo Forge.
|
|
115
|
+
- **[š¦ Publish Guide](PUBLISH.md)** ā NPM publication workflow.
|
|
87
116
|
|
|
88
117
|
---
|
|
89
118
|
|
|
90
119
|
## š¤ Contributing
|
|
91
120
|
|
|
92
|
-
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for
|
|
121
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
93
122
|
|
|
94
123
|
## š License
|
|
95
124
|
|
|
96
|
-
|
|
125
|
+
MIT License ā see the [LICENSE](LICENSE) file for details.
|
|
97
126
|
|
|
98
127
|
---
|
|
99
128
|
|
package/bin/expo-forge.js
CHANGED
|
@@ -10,6 +10,40 @@ const logger = require("../lib/logger");
|
|
|
10
10
|
|
|
11
11
|
const pkg = require("../package.json");
|
|
12
12
|
|
|
13
|
+
// āāā create-expo-forge-app mode āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
14
|
+
// When invoked as `npx create-expo-forge-app <appName>`, the first argument
|
|
15
|
+
// is the project name directly ā no subcommand needed.
|
|
16
|
+
// Detect this by checking the binary name used to invoke this script.
|
|
17
|
+
const invokedAs = path.basename(process.argv[1]); // e.g. "create-expo-forge-app"
|
|
18
|
+
const isCreateMode = invokedAs === "create-expo-forge-app";
|
|
19
|
+
|
|
20
|
+
if (isCreateMode) {
|
|
21
|
+
const projectName = process.argv[2];
|
|
22
|
+
|
|
23
|
+
if (!projectName || projectName.startsWith("-")) {
|
|
24
|
+
console.error("\n ⦠Usage: npx create-expo-forge-app <project-name>\n");
|
|
25
|
+
console.error(" Example: npx create-expo-forge-app my-awesome-app\n");
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
(async () => {
|
|
30
|
+
try {
|
|
31
|
+
logger.rocket(`Forging your new Expo project: ${projectName}...`);
|
|
32
|
+
await initExpo.initializeProject(projectName);
|
|
33
|
+
logger.success(`\nā
Project "${projectName}" is ready to forge!\n`);
|
|
34
|
+
logger.info(`Next steps:`);
|
|
35
|
+
logger.info(` 1. cd ${projectName}`);
|
|
36
|
+
logger.info(` 2. npx expo start`);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
logger.error(`Failed to initialize project: ${error.message}`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
})();
|
|
42
|
+
|
|
43
|
+
return; // stop here ā no need for the full CLI parser
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// āāā Full CLI mode (expo-forge) āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
13
47
|
program
|
|
14
48
|
.name("expo-forge")
|
|
15
49
|
.description("Forge modern Expo apps with bulletproof architecture")
|
|
@@ -63,6 +97,7 @@ program.addHelpText(
|
|
|
63
97
|
Examples:
|
|
64
98
|
$ expo-forge init my-app
|
|
65
99
|
$ expo-forge generate feature booking
|
|
100
|
+
$ npx create-expo-forge-app my-app
|
|
66
101
|
|
|
67
102
|
For more information, visit: https://github.com/moasko/expo-forge
|
|
68
103
|
`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-forge",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Forge modern Expo apps with bulletproof architecture - TanStack Query, Zustand, Axios, NativeWind",
|
|
5
5
|
"author": "moasko <moasko.dev@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"commander": "^11.1.0"
|
|
42
42
|
},
|
|
43
43
|
"bin": {
|
|
44
|
-
"expo-forge": "bin/expo-forge.js"
|
|
44
|
+
"expo-forge": "bin/expo-forge.js",
|
|
45
|
+
"create-expo-forge-app": "bin/expo-forge.js"
|
|
45
46
|
},
|
|
46
47
|
"engines": {
|
|
47
48
|
"node": ">=16.0.0",
|