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 CHANGED
@@ -1,4 +1,4 @@
1
- # šŸ”„ Expo Forge - Bulletproof Expo Architecture
1
+ # šŸ”„ Expo Forge — Bulletproof Expo Architecture
2
2
 
3
3
  [![Test & Lint](https://github.com/moasko/expo-forge/actions/workflows/test.yml/badge.svg)](https://github.com/moasko/expo-forge/actions/workflows/test.yml)
4
4
  [![NPM Version](https://img.shields.io/npm/v/expo-forge.svg?style=flat-square)](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
- ### 1. Install globally
14
+ ### Zero Install (Recommended)
15
+
16
+ No setup required. Just run and forge:
15
17
 
16
18
  ```bash
17
- npm install -g expo-forge
19
+ npx create-expo-forge-app my-awesome-app
18
20
  ```
19
21
 
20
- ### 2. Forge a new project
22
+ That's it. āœ… Your fully configured Expo project is ready.
21
23
 
22
- ```bash
23
- expo-forge init my-epic-app
24
- ```
24
+ ---
25
25
 
26
- ### 3. Generate powerful features
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** - Feature-based architecture (`src/features`, `src/api`, `src/hooks`).
40
- - **🌐 Robust API Client** - Pre-configured **Axios** with interceptors and error handling.
41
- - **šŸ”„ Async State** - **TanStack Query (v5)** with optimized default configuration.
42
- - **🧠 Local State** - **Zustand** stores for lightweight, predictable state management.
43
- - **šŸŽØ Premium Styling** - **NativeWind (Tailwind CSS)** configured with `global.css`.
44
- - **šŸ“± Mobile Navigation** - **Expo Router** (File-based) with Layouts and Type-safety.
45
- - **šŸ›”ļø Safe Area Ready** - Integrated `SafeAreaProvider` for notched displays.
46
- - **šŸŽÆ Environment Ready** - `.env.example` and TypeScript path aliases (`@/*`) set up.
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
- ## šŸ› ļø Feature Generation
70
+ ## šŸ—ļø Feature Generation
51
71
 
52
- The `generate feature` command creates a self-contained module:
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., BookingCard.tsx)
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 stores for this domain
80
+ ā”œā”€ā”€ store/ # Zustand store for this domain
61
81
  ā”œā”€ā”€ types/ # TypeScript interfaces & DTOs
62
- ā”œā”€ā”€ utils/ # Domain helpers
63
- ā”œā”€ā”€ BookingScreen.tsx # Main feature entry screen
64
- └── index.ts # Clean public API for the feature
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
- ## šŸ—ļø Technical stack
95
+ ## šŸ”§ Technical Stack
70
96
 
71
- - **Core**: [Expo](https://expo.dev/) + [React Native](https://reactnative.dev/)
72
- - **Data Fetching**: [TanStack Query](https://tanstack.com/query)
73
- - **State Management**: [Zustand](https://github.com/pmndrs/zustand)
74
- - **Styling**: [NativeWind](https://www.nativewind.dev/) (Tailwind CSS)
75
- - **HTTP Client**: [Axios](https://axios-http.com/)
76
- - **Icons**: [Lucide React Native](https://lucide.dev/)
77
- - **Navigation**: [Expo Router](https://docs.expo.dev/router/introduction/)
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
- ## šŸ“– Technical Guides
109
+ ## šŸ“– Documentation
82
110
 
83
- - **[šŸ—ļø Deep Architecture](ARCHITECTURE.md)** - Understanding the "Forge" way.
84
- - **[šŸŽØ Branding](BRANDING.md)** - Visual identity of the CLI.
85
- - **[šŸ Full Demo](DEMO.md)** - Step-by-step tutorial.
86
- - **[šŸ›£ļø Roadmap](ROADMAP.md)** - Future of Expo Forge.
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 details.
121
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
93
122
 
94
123
  ## šŸ“„ License
95
124
 
96
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
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.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",