create-ern-boilerplate 0.0.31 → 0.0.33

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/create.js CHANGED
@@ -225,19 +225,20 @@ ${chalk.bold("\nšŸ“– READING ORDER (Urutan Baca yang Direkomendasikan):\n")}
225
225
 
226
226
  ${chalk.green("Happy coding! šŸ’»")}
227
227
  `);
228
+ }
228
229
 
229
230
 
230
231
 
231
- // === Helper untuk menampilkan daftar template ===
232
- async function getTemplateChoices() {
233
- const templatesDir = path.join(__dirname, "templates");
234
- const folders = await fs.readdir(templatesDir);
235
- return folders.filter((f) =>
236
- fs.statSync(path.join(templatesDir, f)).isDirectory()
237
- );
238
- }
232
+ // === Helper untuk menampilkan daftar template ===
233
+ async function getTemplateChoices() {
234
+ const templatesDir = path.join(__dirname, "templates");
235
+ const folders = await fs.readdir(templatesDir);
236
+ return folders.filter((f) =>
237
+ fs.statSync(path.join(templatesDir, f)).isDirectory()
238
+ );
239
+ }
239
240
 
240
- main().catch((err) => {
241
- console.error(chalk.red("Terjadi kesalahan:"), err);
242
- process.exit(1);
243
- });
241
+ main().catch((err) => {
242
+ console.error(chalk.red("Terjadi kesalahan:"), err);
243
+ process.exit(1);
244
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ern-boilerplate",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "description": "Expo React Native boilerplate generator",
5
5
  "bin": {
6
6
  "create-ern-boilerplate": "./create.js",
@@ -8,10 +8,48 @@ When you first enter this project, read these files in order:
8
8
 
9
9
  1. **`README.md`** - Understand project structure and features
10
10
  2. **`ai-context.json`** - Know where to generate each type of code
11
- 3. **`GENERATE_RULES.md`** - Learn code generation patterns
11
+ 3. **`GENERATE_RULES.md`** - āš ļø **READ THIS FIRST** - Tech stack & dependency rules
12
12
  4. **`CONVENTIONS.md`** - Understand coding standards
13
13
  5. **`examples/`** - See actual working code patterns
14
14
 
15
+ ## 🚨 CRITICAL RULES - Read First!
16
+
17
+ ### Tech Stack Restrictions
18
+
19
+ **NEVER add new dependencies or change versions!**
20
+
21
+ ```json
22
+ Fixed Versions:
23
+ {
24
+ "react": "19.1.0", // DO NOT change
25
+ "react-native": "0.81.4", // DO NOT change
26
+ "expo": "^54.0.10", // DO NOT change (SDK 54 only!)
27
+ "expo-router": "~6.0.12" // DO NOT change
28
+ }
29
+ ```
30
+
31
+ ### What You CAN Use (Already Installed)
32
+
33
+ āœ… **State:** Zustand, TanStack Query, React Hook Form
34
+ āœ… **UI:** NativeWind, Lucide Icons, React Native Paper
35
+ āœ… **HTTP:** Axios
36
+ āœ… **Expo Modules:** Camera, Location, Notifications, etc. (SDK 54 only!)
37
+
38
+ ### What You CANNOT Do
39
+
40
+ āŒ Install new packages
41
+ āŒ Suggest upgrading Expo SDK
42
+ āŒ Use React 18 APIs
43
+ āŒ Add lodash, moment, or other utilities
44
+
45
+ ### What to Do Instead
46
+
47
+ āœ… Use existing packages from package.json
48
+ āœ… Write vanilla JavaScript/TypeScript
49
+ āœ… Create custom utilities in src/utils/
50
+
51
+ **See GENERATE_RULES.md for complete package management rules!**
52
+
15
53
  ## šŸ“‹ Quick Reference
16
54
 
17
55
  ### File Locations (from ai-context.json)
@@ -261,6 +299,8 @@ import { newsService } from '@/services/newsService';
261
299
  ## 🚦 Quick Checklist
262
300
 
263
301
  Before generating code:
302
+ - [ ] āš ļø **Check package.json** - Only use existing packages!
303
+ - [ ] āš ļø **NO new dependencies** - Use what's already installed
264
304
  - [ ] Read examples/ folder
265
305
  - [ ] Check ai-context.json for paths
266
306
  - [ ] Use TypeScript types
@@ -270,6 +310,7 @@ Before generating code:
270
310
  - [ ] Handle error state
271
311
  - [ ] Follow naming conventions
272
312
  - [ ] Use NativeWind classes
313
+ - [ ] Use Expo SDK 54 compatible APIs only
273
314
 
274
315
  ## šŸ’” Pro Tips
275
316
 
@@ -305,6 +346,9 @@ ls src/store/
305
346
  ## šŸŽÆ Success Criteria
306
347
 
307
348
  Your generated code is good if:
349
+ āœ… **Uses ONLY existing packages** from package.json
350
+ āœ… **NO new dependencies** added
351
+ āœ… **Expo SDK 54 compatible** only
308
352
  āœ… Follows examples/ patterns exactly
309
353
  āœ… Uses TypeScript properly
310
354
  āœ… Uses path aliases (@/)
@@ -2,6 +2,60 @@
2
2
 
3
3
  Standards and best practices for this project.
4
4
 
5
+ ## āš ļø Dependencies & Package Management
6
+
7
+ ### CRITICAL RULE: NO New Dependencies!
8
+
9
+ **NEVER add, upgrade, or change package versions without explicit permission.**
10
+
11
+ ```json
12
+ // āŒ FORBIDDEN
13
+ npm install lodash
14
+ npm install expo-image
15
+ yarn add react-query
16
+
17
+ // āœ… ALLOWED
18
+ Use packages already in package.json
19
+ ```
20
+
21
+ ### Tech Stack Versions (FIXED)
22
+
23
+ ```
24
+ React: 19.1.0
25
+ React Native: 0.81.4
26
+ Expo SDK: 54.x (^54.0.10)
27
+ ```
28
+
29
+ **DO NOT suggest upgrading these versions!**
30
+
31
+ ### Available Packages
32
+
33
+ Check `package.json` for the complete list of allowed packages.
34
+
35
+ **Commonly Used:**
36
+ - **State:** `zustand`, `@tanstack/react-query`, `react-hook-form`
37
+ - **UI:** `nativewind`, `lucide-react-native`, `react-native-paper`
38
+ - **HTTP:** `axios`
39
+ - **Expo:** All `expo-*` packages (SDK 54 compatible)
40
+
41
+ ### Instead of Installing New Packages
42
+
43
+ ```typescript
44
+ // āŒ DON'T: Suggest new packages
45
+ "Let's install lodash for array utilities"
46
+
47
+ // āœ… DO: Use vanilla JavaScript
48
+ const unique = [...new Set(array)];
49
+ const chunk = (arr, size) =>
50
+ Array.from({ length: Math.ceil(arr.length / size) }, (_, i) =>
51
+ arr.slice(i * size, i * size + size)
52
+ );
53
+
54
+ // āœ… DO: Create utility functions
55
+ // src/utils/arrays.ts
56
+ export const groupBy = (arr, key) => { /* ... */ };
57
+ ```
58
+
5
59
  ## File Naming
6
60
 
7
61
  ```
@@ -327,13 +381,15 @@ const handlePress = useCallback(() => {
327
381
 
328
382
  ## Summary
329
383
 
330
- 1. **TypeScript** - Always use proper types
331
- 2. **Path Aliases** - Use `@/` for imports
332
- 3. **NativeWind** - Use Tailwind classes
333
- 4. **Theme Support** - Always support light/dark
334
- 5. **Error Handling** - Always handle errors
335
- 6. **Loading States** - Always show loading
336
- 7. **Clean Code** - Small functions, clear names
337
- 8. **Examples** - Check `examples/` folder
384
+ 1. **NO New Dependencies** - Use only what's in package.json āš ļø
385
+ 2. **Fixed Tech Stack** - React 19.1.0, RN 0.81.4, Expo SDK 54 āš ļø
386
+ 3. **TypeScript** - Always use proper types
387
+ 4. **Path Aliases** - Use `@/` for imports
388
+ 5. **NativeWind** - Use Tailwind classes
389
+ 6. **Theme Support** - Always support light/dark
390
+ 7. **Error Handling** - Always handle errors
391
+ 8. **Loading States** - Always show loading
392
+ 9. **Clean Code** - Small functions, clear names
393
+ 10. **Examples** - Check `examples/` folder
338
394
 
339
395
  When in doubt, check the `examples/` folder!
@@ -2,6 +2,97 @@
2
2
 
3
3
  Guidelines for AI agents generating code for this project.
4
4
 
5
+ ## āš ļø CRITICAL: Package Management & Tech Stack
6
+
7
+ ### STRICT RULES - Dependencies
8
+
9
+ **NEVER add new dependencies** without explicit user permission!
10
+
11
+ 1. **DO NOT add new dependencies** - Use only what's in package.json
12
+ 2. **DO NOT suggest installing** additional libraries
13
+ 3. **DO NOT upgrade/downgrade** package versions
14
+ 4. **FOLLOW exact versions** specified in package.json
15
+
16
+ ### Fixed Tech Stack Versions
17
+
18
+ ```json
19
+ {
20
+ "react": "19.1.0",
21
+ "react-native": "0.81.4",
22
+ "expo": "^54.0.10",
23
+ "expo-router": "~6.0.12",
24
+ "nativewind": "^4.0.36",
25
+ "zustand": "^5.0.0"
26
+ }
27
+ ```
28
+
29
+ ### Allowed Libraries (Already Installed)
30
+
31
+ Only use these packages that are already in package.json:
32
+
33
+ **State Management:**
34
+ - `zustand` (^5.0.0) - Global state
35
+ - `@tanstack/react-query` (^5.51.0) - Server state
36
+ - `react-hook-form` (^7.66.0) - Forms
37
+
38
+ **UI & Styling:**
39
+ - `nativewind` (^4.0.36) - Tailwind CSS
40
+ - `lucide-react-native` (^0.546.0) - Icons
41
+ - `react-native-toast-message` (^2.3.3) - Toasts
42
+ - `react-native-modal` (^13.0.1) - Modals
43
+ - `react-native-paper` (^5.12.3) - Material UI
44
+
45
+ **Navigation:**
46
+ - `expo-router` (~6.0.12) - File-based routing
47
+
48
+ **HTTP & API:**
49
+ - `axios` (^1.7.2) - HTTP client
50
+
51
+ **Expo Modules (SDK 54):**
52
+ - All expo-* packages are pinned to SDK 54 compatible versions
53
+ - See package.json for complete list
54
+
55
+ ### Examples of What NOT to Do
56
+
57
+ ```typescript
58
+ // āŒ DON'T suggest installing new packages
59
+ "Let's install react-query for data fetching"
60
+ "You need to install expo-image"
61
+ "Add lodash for utilities"
62
+
63
+ // āŒ DON'T use incompatible Expo SDK versions
64
+ import { Image } from 'expo-image'; // If not in package.json
65
+
66
+ // āŒ DON'T suggest version upgrades
67
+ "Upgrade to Expo SDK 51"
68
+ "Use React 18 instead"
69
+
70
+ // āœ… DO use existing packages
71
+ import { useQuery } from '@tanstack/react-query'; // Already installed
72
+ import { Camera } from 'expo-camera'; // Already installed (SDK 54)
73
+ ```
74
+
75
+ ### What to Do Instead
76
+
77
+ ```typescript
78
+ // āœ… Use built-in utilities
79
+ const unique = [...new Set(array)]; // Instead of lodash.uniq
80
+
81
+ // āœ… Use existing packages
82
+ import { useQuery } from '@tanstack/react-query'; // āœ“ Already installed
83
+ import { Camera } from 'expo-camera'; // āœ“ Already installed
84
+
85
+ // āœ… Write custom utilities
86
+ // src/utils/helpers.ts
87
+ export const debounce = (fn, delay) => { /* ... */ };
88
+ ```
89
+
90
+ ### When User Asks for New Feature
91
+
92
+ 1. **First**: Check if existing packages can do it
93
+ 2. **Second**: Implement with vanilla JavaScript/React Native
94
+ 3. **Last resort**: Ask user if they want to add new dependency
95
+
5
96
  ## File Locations
6
97
 
7
98
  From `ai-context.json`: