create-ern-boilerplate 0.0.9 โ†’ 0.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ern-boilerplate",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Expo React Native boilerplate generator",
5
5
  "bin": {
6
6
  "create-ern-boilerplate": "./create.js",
@@ -1,274 +1,171 @@
1
- # Expo React Native Boilerplate
1
+ # ๐Ÿš€ create-ern-boilerplate
2
2
 
3
- A comprehensive boilerplate for building React Native applications with Expo, featuring authentication, theming, and a clean architecture.
3
+ CLI untuk membuat proyek **React Native Expo** dengan cepat menggunakan berbagai template yang sudah disiapkan.
4
4
 
5
- ## Features
5
+ Dengan alat ini, kamu bisa membuat project baru hanya dalam hitungan detik โ€” baik secara interaktif maupun langsung (tanpa prompt).
6
6
 
7
- - โœ… **Expo Router** - File-based routing
8
- - โœ… **TypeScript** - Type-safe development
9
- - โœ… **NativeWind (Tailwind CSS)** - Utility-first styling
10
- - โœ… **Authentication Context** - Global auth state management
11
- - โœ… **Theme Support** - Light/Dark mode with system preference
12
- - โœ… **Mock API Server** - JSON Server for development
13
- - โœ… **Secure Storage** - Expo SecureStore for sensitive data
14
- - โœ… **Path Aliases** - Clean imports with `@` prefix
15
- - โœ… **Form Validation** - Built-in validation utilities
16
- - โœ… **Reusable Components** - Button, Input, Card, Loading, etc.
7
+ ---
17
8
 
18
- ## Project Structure
9
+ ## ๐Ÿ“ฆ Instalasi
19
10
 
20
- ```
21
- .
22
- โ”œโ”€โ”€ app
23
- โ”‚ โ”œโ”€โ”€ (admin) # Halaman & route khusus admin
24
- โ”‚ โ”œโ”€โ”€ (auth) # Halaman auth (login, register, dsb)
25
- โ”‚ โ”œโ”€โ”€ (protected) # Halaman yang membutuhkan autentikasi
26
- โ”‚ โ””โ”€โ”€ _layout.tsx # Root layout untuk Expo Router
27
- โ”‚
28
- โ”œโ”€โ”€ server
29
- โ”‚ โ”œโ”€โ”€ db.json # Mock data untuk JSON Server
30
- โ”‚
31
- โ”œโ”€โ”€ src
32
- โ”‚ โ”œโ”€โ”€ assets # Gambar, font, dan aset statis
33
- โ”‚ โ”œโ”€โ”€ components # Komponen UI reusable
34
- โ”‚ โ”œโ”€โ”€ contexts # Context API (Auth, Theme, dsb)
35
- โ”‚ โ”œโ”€โ”€ hooks # Custom React hooks
36
- โ”‚ โ”œโ”€โ”€ services # API service (Axios, interceptors, dll)
37
- โ”‚ โ”œโ”€โ”€ theme # Konfigurasi tema (warna, dark mode)
38
- โ”‚ โ”œโ”€โ”€ types # TypeScript type definitions
39
- โ”‚ โ””โ”€โ”€ utils # Helper functions & constants
40
- โ”‚
41
- โ”œโ”€โ”€ app.json # Konfigurasi Expo project
42
- โ”œโ”€โ”€ babel.config.js # Konfigurasi Babel
43
- โ”œโ”€โ”€ expo-env.d.ts # Type definitions untuk Expo environment
44
- โ”œโ”€โ”€ global.css # Global style untuk Tailwind / NativeWind
45
- โ”œโ”€โ”€ index.ts # Entry point utama aplikasi
46
- โ”œโ”€โ”€ LICENSE # Lisensi project
47
- โ”œโ”€โ”€ metro.config.js # Konfigurasi Metro bundler
48
- โ”œโ”€โ”€ nativewind-env.d.ts # Type support untuk NativeWind
49
- โ”œโ”€โ”€ package.json # Dependency & script project
50
- โ”œโ”€โ”€ package-lock.json # Lock file npm
51
- โ”œโ”€โ”€ README.md # Dokumentasi project
52
- โ”œโ”€โ”€ structure.txt # Struktur folder (auto-generated)
53
- โ”œโ”€โ”€ tailwind.config.js # Konfigurasi TailwindCSS
54
- โ””โ”€โ”€ tsconfig.json # Konfigurasi TypeScript
11
+ Kamu **tidak perlu menginstal package ini secara global**.
12
+ Cukup jalankan menggunakan **npx**:
55
13
 
14
+ ```bash
15
+ npx create-ern-boilerplate
56
16
  ```
57
17
 
58
- ## Getting Started
59
-
60
- ### Prerequisites
61
-
62
- - Node.js 18+
63
- - npm or yarn
64
- - Expo CLI
18
+ ---
65
19
 
66
- ### Installation
20
+ ## ๐Ÿง  Contoh Penggunaan
67
21
 
68
- 1. Clone the repository:
69
- ```bash
70
- git clone <your-repo-url>
71
- cd <your-repo-folder>
72
- ```
22
+ ### ๐ŸŸข 1. Mode Interaktif (Default)
73
23
 
74
- 2. Install dependencies:
75
- ```bash
76
- npm install
77
- ```
24
+ Jalankan tanpa argumen tambahan:
78
25
 
79
- 3. Start the development server:
80
26
  ```bash
81
- npm run start
27
+ npx create-ern-boilerplate
82
28
  ```
83
29
 
84
- This will start both the Expo development server and the mock API server.
85
-
86
- ### Available Scripts
87
-
88
- - `npm start` - Start Expo development server
89
- - `npm run android` - Run on Android
90
- - `npm run ios` - Run on iOS
91
- - `npm run web` - Run on web
92
- - `npm run lint` - Run ESLint
93
- - `npm run type-check` - Run TypeScript type checking
94
-
95
- ## Configuration
30
+ Kamu akan ditanya:
96
31
 
97
- ### API Configuration
32
+ - Nama project
33
+ - Deskripsi
34
+ - Template yang ingin digunakan
35
+ - Apakah ingin langsung install dependencies
98
36
 
99
- Edit `src/utils/constants.ts` to configure your API endpoints:
37
+ **Contoh:**
100
38
 
101
- ```typescript
102
- export const API_CONFIG = {
103
- BASE_URL: __DEV__ ? 'http://localhost:3001' : 'https://api.yourapp.com',
104
- TIMEOUT: 10000,
105
- };
106
39
  ```
107
-
108
- ### Theme Configuration
109
-
110
- Customize colors in `src/theme/colors.ts`:
111
-
112
- ```typescript
113
- export const colors = {
114
- light: {
115
- primary: '#3b82f6',
116
- // ... other colors
117
- },
118
- dark: {
119
- primary: '#3b82f6',
120
- // ... other colors
121
- },
122
- };
40
+ ? Nama project kamu: my-expo-app
41
+ ? Deskripsi singkat: Aplikasi keren dengan Expo
42
+ ? Pilih template: redux
43
+ ? Langsung install dependencies setelah membuat project? Yes
123
44
  ```
124
45
 
125
- ## Authentication
46
+ ---
126
47
 
127
- The boilerplate includes a complete authentication flow:
48
+ ### ๐ŸŸก 2. Mode Cepat (Tanpa Prompt)
128
49
 
129
- ### Default Credentials
50
+ Langsung buat project baru tanpa pertanyaan:
130
51
 
131
- - **Admin**: developer@localhost.com / @developer
132
- - **User**: user@localhost.com / @developer
52
+ ```bash
53
+ npx create-ern-boilerplate my-app -y
54
+ ```
133
55
 
134
- ### Using Authentication
56
+ โœ… Otomatis pakai **template default (`minimal`)**
57
+ โœ… Langsung install dependencies
135
58
 
136
- ```typescript
137
- import { useAuth } from '@hooks/useAuth';
59
+ ---
138
60
 
139
- function MyComponent() {
140
- const { user, login, logout, isAuthenticated } = useAuth();
141
-
142
- // Use authentication methods
143
- }
144
- ```
61
+ ### ๐Ÿ”ต 3. Mode Cepat + Custom Deskripsi + Template
145
62
 
146
- ## Theming
63
+ Kamu bisa langsung menentukan deskripsi dan template yang digunakan:
147
64
 
148
- Switch between light and dark themes:
65
+ ```bash
66
+ npx create-ern-boilerplate my-app -y --desc "Boilerplate lengkap" --template redux
67
+ ```
149
68
 
150
- ```typescript
151
- import { useTheme } from '@hooks/useTheme';
69
+ ๐Ÿ“ Akan langsung generate project **my-app**
70
+ ๐Ÿ“„ Isi deskripsi otomatis
71
+ ๐Ÿงฉ Menggunakan template **redux**
72
+ โš™๏ธ Auto install dependencies
152
73
 
153
- function MyComponent() {
154
- const { theme, colors, setThemeMode } = useTheme();
155
-
156
- // theme: 'light' | 'dark'
157
- // colors: current theme colors
158
- // setThemeMode: 'light' | 'dark' | 'auto'
159
- }
160
- ```
74
+ ---
161
75
 
162
- ## API Services
76
+ ## โš™๏ธ Argumen & Opsi CLI
163
77
 
164
- ### Making API Calls
78
+ | Opsi | Alias | Deskripsi | Contoh |
79
+ |------|--------|------------|--------|
80
+ | `-y` / `--yes` | | Jalankan mode cepat tanpa prompt | `npx create-ern-boilerplate my-app -y` |
81
+ | `--desc` | | Tambahkan deskripsi project | `--desc "Aplikasi keren"` |
82
+ | `--template` | | Pilih template tertentu | `--template redux` |
83
+ | `--install` | | Auto install dependencies di mode cepat | `-y --install` |
165
84
 
166
- ```typescript
167
- import { newsService } from '@services/newsService';
85
+ ---
168
86
 
169
- // Get all news
170
- const news = await newsService.getNews({ limit: 10 });
87
+ ## ๐Ÿงฉ Struktur Template
171
88
 
172
- // Get single news item
173
- const newsItem = await newsService.getNewsById('1');
89
+ Semua template disimpan di folder:
174
90
 
175
- // Create news
176
- const newNews = await newsService.createNews({
177
- title: 'New Article',
178
- content: 'Content here',
179
- // ...
180
- });
91
+ ```
92
+ /templates
93
+ โ”œโ”€โ”€ minimal
94
+ โ”œโ”€โ”€ redux
95
+ โ”œโ”€โ”€ default
96
+ โ””โ”€โ”€ ...
181
97
  ```
182
98
 
183
- ## Custom Hooks
184
-
185
- ### useAuth
99
+ Kamu dapat menambahkan template baru cukup dengan menambahkan folder baru di dalam direktori `templates`.
186
100
 
187
- Access authentication state and methods.
101
+ ---
188
102
 
189
- ### useTheme
103
+ ## ๐Ÿ› ๏ธ Cara Kerja
190
104
 
191
- Access theme configuration and toggle themes.
105
+ 1. CLI membaca argumen dari perintah yang kamu jalankan.
106
+ 2. Jika mode interaktif: akan menampilkan prompt dengan `inquirer`.
107
+ 3. Template yang dipilih akan disalin ke folder project baru.
108
+ 4. `package.json` dan `app.json` akan di-update otomatis:
109
+ - Nama project
110
+ - Deskripsi
111
+ - Bundle identifier (iOS / Android)
112
+ 5. Jika dipilih, dependencies akan langsung diinstall.
192
113
 
193
- ## Components
114
+ ---
194
115
 
195
- ### Button
116
+ ## ๐Ÿงพ Contoh Hasil
196
117
 
197
- ```typescript
198
- <Button
199
- title="Click Me"
200
- variant="primary"
201
- size="md"
202
- onPress={() => {}}
203
- loading={false}
204
- fullWidth
205
- />
206
- ```
118
+ Setelah menjalankan perintah:
207
119
 
208
- ### Input
209
-
210
- ```typescript
211
- <Input
212
- label="Email"
213
- placeholder="Enter email"
214
- value={email}
215
- onChangeText={setEmail}
216
- error={emailError}
217
- secureTextEntry
218
- />
120
+ ```bash
121
+ npx create-ern-boilerplate my-expo-app -y --desc "Boilerplate lengkap" --template redux
219
122
  ```
220
123
 
221
- ### Card
124
+ CLI akan menghasilkan struktur seperti:
222
125
 
223
- ```typescript
224
- <Card className="mb-4">
225
- <Text>Card content</Text>
226
- </Card>
227
126
  ```
228
-
229
- ### Loading
230
-
231
- ```typescript
232
- <Loading text="Loading..." fullScreen />
127
+ my-expo-app/
128
+ โ”œโ”€โ”€ app.json
129
+ โ”œโ”€โ”€ package.json
130
+ โ”œโ”€โ”€ App.js
131
+ โ”œโ”€โ”€ src/
132
+ โ”‚ โ”œโ”€โ”€ components/
133
+ โ”‚ โ”œโ”€โ”€ screens/
134
+ โ”‚ โ”œโ”€โ”€ redux/
135
+ โ”‚ โ””โ”€โ”€ ...
136
+ โ””โ”€โ”€ ...
233
137
  ```
234
138
 
235
- ## Path Aliases
236
-
237
- Use clean imports with configured path aliases:
139
+ Dan kamu bisa langsung menjalankan:
238
140
 
239
- ```typescript
240
- import { Button } from '@components/common/Button';
241
- import { useAuth } from '@hooks/useAuth';
242
- import { newsService } from '@services/newsService';
141
+ ```bash
142
+ cd my-expo-app
143
+ npm run start
243
144
  ```
244
145
 
245
- ## Deployment
146
+ ---
246
147
 
247
- ### Building for Production
248
148
 
249
- ```bash
250
- # For Android
251
- eas build --platform android
149
+ ---
252
150
 
253
- # For iOS
254
- eas build --platform ios
151
+ ## ๐Ÿ’ก Tips
255
152
 
256
- # For both
257
- eas build --platform all
258
- ```
153
+ - Jalankan `--template` dengan nama folder template yang tersedia.
154
+ - Tambahkan flag `--install` untuk auto install di mode cepat.
155
+ - Kamu bisa menambahkan template buatan sendiri di folder `templates`.
156
+
157
+ ---
259
158
 
260
- ## Contributing
159
+ ---
261
160
 
262
- 1. Fork the repository
263
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
264
- 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
265
- 4. Push to the branch (`git push origin feature/amazing-feature`)
266
- 5. Open a Pull Request
161
+ ## ๐Ÿชช Lisensi
267
162
 
268
- ## License
163
+ Lisensi: [MIT](./LICENSE)
269
164
 
270
- MIT License - feel free to use this boilerplate for your projects!
165
+ ---
271
166
 
272
- ## Support
167
+ ## ๐Ÿ’ฌ Penulis
273
168
 
274
- For issues and questions, please open an issue on GitHub.
169
+ Dibuat dengan โค๏ธ oleh **[Zedfar]**
170
+ ๐Ÿ“ง Kontak: ulfar.far@gmail.com
171
+ ๐Ÿ™ GitHub: [@zedfar](https://github.com/zedfar)