@highbeek/create-rnstarterkit 1.0.2-beta.10 → 1.0.2-beta.11

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 (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +254 -0
  3. package/dist/bin/create-rnstarterkit.js +6 -0
  4. package/dist/src/generators/appGenerator.js +1241 -107
  5. package/dist/templates/cli-base/App.tsx +199 -21
  6. package/dist/templates/cli-base/assets/images/icon.png +0 -0
  7. package/dist/templates/cli-base/assets/images/partial-react-logo.png +0 -0
  8. package/dist/templates/cli-base/assets/images/react-logo.png +0 -0
  9. package/dist/templates/cli-base/jest.config.js +4 -0
  10. package/dist/templates/cli-base/package.json +5 -3
  11. package/dist/templates/cli-base/tsconfig.json +1 -0
  12. package/dist/templates/expo-base/app/_layout.tsx +6 -3
  13. package/dist/templates/expo-base/app/index.tsx +164 -5
  14. package/dist/templates/expo-base/package.json +5 -2
  15. package/dist/templates/optional/auth-context/components/layout/ScreenLayout.tsx +46 -0
  16. package/dist/templates/optional/auth-context/navigation/ProtectedStack.tsx +33 -5
  17. package/dist/templates/optional/auth-context/screens/HomeScreen.tsx +4 -3
  18. package/dist/templates/optional/auth-context/screens/LoginScreen.tsx +4 -3
  19. package/dist/templates/optional/auth-context/screens/ProfileScreen.tsx +4 -3
  20. package/dist/templates/optional/auth-context/screens/RegisterScreen.tsx +4 -3
  21. package/dist/templates/optional/auth-context/screens/SettingsScreen.tsx +4 -3
  22. package/dist/templates/optional/auth-context/screens/WelcomeScreen.tsx +174 -0
  23. package/dist/templates/optional/auth-redux/components/layout/ScreenLayout.tsx +46 -0
  24. package/dist/templates/optional/auth-redux/navigation/ProtectedStack.tsx +39 -2
  25. package/dist/templates/optional/auth-redux/screens/HomeScreen.tsx +4 -3
  26. package/dist/templates/optional/auth-redux/screens/LoginScreen.tsx +4 -3
  27. package/dist/templates/optional/auth-redux/screens/ProfileScreen.tsx +7 -10
  28. package/dist/templates/optional/auth-redux/screens/RegisterScreen.tsx +4 -3
  29. package/dist/templates/optional/auth-redux/screens/SettingsScreen.tsx +6 -9
  30. package/dist/templates/optional/auth-redux/screens/WelcomeScreen.tsx +174 -0
  31. package/dist/templates/optional/auth-zustand/components/layout/ScreenLayout.tsx +46 -0
  32. package/dist/templates/optional/auth-zustand/navigation/ProtectedStack.tsx +34 -6
  33. package/dist/templates/optional/auth-zustand/screens/HomeScreen.tsx +4 -3
  34. package/dist/templates/optional/auth-zustand/screens/LoginScreen.tsx +4 -3
  35. package/dist/templates/optional/auth-zustand/screens/ProfileScreen.tsx +4 -3
  36. package/dist/templates/optional/auth-zustand/screens/RegisterScreen.tsx +4 -3
  37. package/dist/templates/optional/auth-zustand/screens/SettingsScreen.tsx +4 -3
  38. package/dist/templates/optional/auth-zustand/screens/WelcomeScreen.tsx +174 -0
  39. package/dist/templates/optional/ci/.github/workflows/ci.yml +32 -0
  40. package/dist/templates/optional/error-boundary/components/ErrorBoundary.tsx +83 -0
  41. package/dist/templates/optional/formik/components/formik/FormikInput.tsx +45 -0
  42. package/dist/templates/optional/formik/components/formik/LoginForm.tsx +60 -0
  43. package/dist/templates/optional/formik/schemas/auth.schema.ts +17 -0
  44. package/dist/templates/optional/mmkv/utils/storage.ts +17 -0
  45. package/dist/templates/optional/react-hook-form/components/rhf/LoginForm.tsx +63 -0
  46. package/dist/templates/optional/react-hook-form/components/rhf/RHFInput.tsx +50 -0
  47. package/dist/templates/optional/react-hook-form/schemas/auth.schema.ts +29 -0
  48. package/dist/templates/optional/react-query/hooks/useAppMutation.ts +16 -0
  49. package/dist/templates/optional/react-query/hooks/useAppQuery.ts +12 -0
  50. package/dist/templates/optional/react-query/services/queryClient.ts +14 -0
  51. package/dist/templates/optional/redux/store/hooks.ts +6 -0
  52. package/dist/templates/optional/redux/store/store.ts +11 -0
  53. package/dist/templates/optional/swr/hooks/useSWRFetch.ts +14 -0
  54. package/dist/templates/optional/swr/providers/SWRProvider.tsx +21 -0
  55. package/dist/templates/optional/tsconfig.json +17 -0
  56. package/dist/templates/optional/zustand/store/appStore.ts +13 -0
  57. package/package.json +1 -1
  58. package/dist/templates/expo-base/components/ui/collapsible.tsx +0 -45
  59. package/dist/templates/expo-base/components/ui/icon-symbol.ios.tsx +0 -32
  60. package/dist/templates/expo-base/components/ui/icon-symbol.tsx +0 -41
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ibukun Agboola
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -0,0 +1,254 @@
1
+ # RNStarterKit
2
+
3
+ **A CLI tool that scaffolds production-ready React Native apps with clean architecture and sensible defaults.**
4
+
5
+ Not a replacement for Expo or React Native CLI — it sits on top of them and structures your project the right way from day one.
6
+
7
+ ```bash
8
+ npx @highbeek/create-rnstarterkit myApp
9
+ ```
10
+
11
+ ---
12
+
13
+ ## Why This Exists
14
+
15
+ Every serious React Native project eventually ends up with the same architecture decisions:
16
+
17
+ - Where do API calls live?
18
+ - How is auth state managed and persisted?
19
+ - What's the folder structure when the app scales?
20
+ - How are environment variables typed?
21
+ - Where does validation logic go?
22
+
23
+ This tool answers those questions upfront. You get a clean, feature-based structure with your chosen stack — ready to build on, not fight against.
24
+
25
+ ---
26
+
27
+ ## What It Generates
28
+
29
+ The CLI walks you through a set of prompts and generates a complete project:
30
+
31
+ ```
32
+ src/
33
+ app/ # App entry, shell, providers
34
+ features/
35
+ auth/ # Login, Register screens + auth flow (optional)
36
+ screens/ # Additional screens
37
+ navigation/ # React Navigation or Expo Router setup
38
+ api/ # Axios/Fetch client + interceptors (optional)
39
+ services/ # React Query client setup (optional)
40
+ store/ # Redux / Zustand store (optional)
41
+ config/ # Typed environment config
42
+ hooks/ # Shared custom hooks
43
+ utils/ # Shared utilities
44
+ components/ # Shared UI components
45
+ constants/ # App-wide constants
46
+ types/ # TypeScript types and interfaces
47
+ assets/
48
+ images/
49
+ fonts/
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ npx @highbeek/create-rnstarterkit myApp
58
+ ```
59
+
60
+ Or install globally:
61
+
62
+ ```bash
63
+ npm install -g @highbeek/create-rnstarterkit
64
+ create-rnstarterkit myApp
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Interactive Setup
70
+
71
+ The CLI prompts you to configure your stack:
72
+
73
+ ```
74
+ ? Project name: myApp
75
+ ? Platform: Expo / React Native CLI
76
+ ? TypeScript: Yes / No
77
+ ? Absolute imports (@/*): Yes / No
78
+ ? State management: None / Context API / Redux Toolkit / Zustand
79
+ ? Data fetching: None / React Query / SWR
80
+ ? Form validation: None / Formik / React Hook Form + Yup
81
+ ? Storage: AsyncStorage / MMKV / None
82
+ ? Include auth scaffold: Yes / No
83
+ ? Include API client: Yes / No (Fetch / Axios)
84
+ ? Include CI setup: Yes / No
85
+ ```
86
+
87
+ ---
88
+
89
+ ## What's Included
90
+
91
+ ### Platform Templates
92
+
93
+ | Feature | Expo | React Native CLI |
94
+ |---|---|---|
95
+ | File-based routing | expo-router | — |
96
+ | React Navigation | — | Native Stack v7 |
97
+ | TypeScript | Default | Default |
98
+ | Babel absolute imports | Optional | Optional |
99
+ | ESLint + Prettier | Configured | Configured |
100
+ | Jest | Configured | Configured |
101
+ | Native iOS/Android | Managed | Full native project |
102
+
103
+ ### Auth Scaffold (Optional)
104
+
105
+ Three implementations — pick one:
106
+
107
+ **Context API** — Recommended for most apps. Lightweight, no extra dependencies.
108
+
109
+ **Redux Toolkit** — If you're using Redux for global state. Comes with auth slice + persistence.
110
+
111
+ **Zustand** — Minimal API, no boilerplate. Zustand store with AsyncStorage hydration.
112
+
113
+ All three include:
114
+ - Login + Register screens
115
+ - Protected route stack
116
+ - Token persistence via AsyncStorage
117
+ - ScreenLayout wrapper component
118
+
119
+ ### API Client (Optional)
120
+
121
+ **Fetch** — Zero dependencies, typed wrapper with interceptors.
122
+
123
+ **Axios** — Full Axios instance with request/response interceptors, error normalisation, and typed response helpers.
124
+
125
+ ### Environment Config
126
+
127
+ Typed environment variables with platform-aware setup:
128
+
129
+ ```typescript
130
+ // config/env.ts
131
+ export const ENV = {
132
+ API_BASE_URL: process.env.API_BASE_URL ?? "https://api.example.com",
133
+ };
134
+ ```
135
+
136
+ Expo uses `EXPO_PUBLIC_*` variables. CLI uses `react-native-dotenv`.
137
+
138
+ ### Data Fetching (Optional)
139
+
140
+ **React Query** — QueryClient pre-configured, ready to wrap your app.
141
+
142
+ **SWR** — Installed and ready to use.
143
+
144
+ ### State Management (Optional)
145
+
146
+ | Option | Package | Use When |
147
+ |---|---|---|
148
+ | None | — | App state is local |
149
+ | Context API | Built-in React | Simple global state |
150
+ | Redux Toolkit | @reduxjs/toolkit | Complex state, devtools |
151
+ | Zustand | zustand | Minimal, fast, no boilerplate |
152
+
153
+ ### Validation (Optional)
154
+
155
+ | Option | Packages |
156
+ |---|---|
157
+ | Formik | formik |
158
+ | React Hook Form + Yup | react-hook-form + yup |
159
+
160
+ ### Config / Tooling
161
+
162
+ - **ESLint** — Extends `@react-native` config
163
+ - **Prettier** — Single quotes, trailing commas, arrow parens
164
+ - **Babel** — Configured with optional dotenv + module-resolver plugins
165
+ - **Jest** — `react-native` preset with example test
166
+
167
+ ---
168
+
169
+ ## Architecture Philosophy
170
+
171
+ **Feature-based, not layer-based.**
172
+
173
+ Rather than grouping files by type (all screens together, all hooks together), related code lives together by feature. This scales better as the app grows.
174
+
175
+ ```
176
+ features/
177
+ auth/
178
+ screens/
179
+ LoginScreen.tsx
180
+ RegisterScreen.tsx
181
+ hooks/
182
+ useLogin.ts
183
+ api/
184
+ authApi.ts
185
+ ```
186
+
187
+ Shared code (components, utils, hooks used across features) lives in `shared/` or `components/` at the top level.
188
+
189
+ **Thin screens, fat services.**
190
+
191
+ Screens handle UI and user interaction. Business logic, API calls, and state live in services/hooks. Screens don't call APIs directly.
192
+
193
+ **Typed from the start.**
194
+
195
+ TypeScript is on by default. Environment variables are typed. API responses are typed. No `any` defaults.
196
+
197
+ ---
198
+
199
+ ## Roadmap
200
+
201
+ **In Progress**
202
+
203
+ - [ ] MMKV storage integration (directory scaffolded, wiring in progress)
204
+ - [ ] Theming system (color tokens, typography scale, theme provider)
205
+ - [ ] Pre-commit hooks with Husky + lint-staged
206
+
207
+ **Planned**
208
+
209
+ - [ ] `@testing-library/react-native` setup
210
+ - [ ] GitHub Actions CI workflow template
211
+ - [ ] Dark mode support
212
+ - [ ] Error boundary scaffold
213
+ - [ ] i18n setup (react-i18next)
214
+
215
+ **Not Planned (Intentionally)**
216
+
217
+ - Custom UI component library — use your own or NativeBase, Tamagui, etc.
218
+ - Analytics or tracking — too opinionated, too many options
219
+ - Monorepo setup — out of scope for v1
220
+
221
+ ---
222
+
223
+ ## Status
224
+
225
+ Current version: `1.0.1-beta.3`
226
+
227
+ This is a beta release. The core scaffolding (folder structure, auth, API client, state management) is working. Some optional modules (MMKV, theming) are scaffolded but not yet wired.
228
+
229
+ Feedback and contributions welcome.
230
+
231
+ ---
232
+
233
+ ## Contributing
234
+
235
+ ```bash
236
+ git clone https://github.com/highbeek/rnstarterkit
237
+ cd rnstarterkit
238
+ npm install
239
+ npm run build
240
+ ```
241
+
242
+ Templates live in `src/templates/`. The generator logic is in `src/generators/appGenerator.ts`. Optional modules are in `src/templates/optional/`.
243
+
244
+ To test the CLI locally:
245
+
246
+ ```bash
247
+ node dist/bin/create-rnstarterkit.js myTestApp
248
+ ```
249
+
250
+ ---
251
+
252
+ ## License
253
+
254
+ MIT
@@ -95,6 +95,12 @@ async function main() {
95
95
  message: "Include CI setup?",
96
96
  default: false,
97
97
  },
98
+ {
99
+ type: "confirm",
100
+ name: "husky",
101
+ message: "Set up Husky pre-commit hooks (lint-staged)?",
102
+ default: true,
103
+ },
98
104
  ]);
99
105
  await (0, appGenerator_1.generateApp)(answers);
100
106
  }