budexp 0.1.0
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/LICENSE +21 -0
- package/README.md +516 -0
- package/bin/budexp.js +162 -0
- package/package.json +63 -0
- package/src/commands/build.js +548 -0
- package/src/commands/check.js +130 -0
- package/src/commands/clean.js +92 -0
- package/src/commands/dev.js +186 -0
- package/src/utils/cleaner.js +377 -0
- package/src/utils/eas.js +198 -0
- package/src/utils/expo-doctor.js +1097 -0
- package/src/utils/logger.js +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jorge Silva
|
|
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
ADDED
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
# ๐ budexp - Expo & React Native Dev Tools
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/budexp)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://github.com/JorgeSilva1997/budexp/issues)
|
|
6
|
+
[](https://github.com/JorgeSilva1997/budexp/stargazers)
|
|
7
|
+
[](https://github.com/sponsors/JorgeSilva1997)
|
|
8
|
+
|
|
9
|
+
A powerful **CLI tool** that dramatically speeds up mobile development with **Expo**, **React Native**, **Android**, and **iOS**.
|
|
10
|
+
|
|
11
|
+
This toolkit automates the painful stuff:
|
|
12
|
+
|
|
13
|
+
- โ Cleaning caches
|
|
14
|
+
- โ Killing running apps
|
|
15
|
+
- โ Deleting native folders
|
|
16
|
+
- โ Reinstalling dependencies
|
|
17
|
+
- โ Rebuilding native code
|
|
18
|
+
- โ Building APK/IPA (local or cloud)
|
|
19
|
+
- โ Running dev builds
|
|
20
|
+
- โ Health checks with beautiful HTML reports
|
|
21
|
+
- โ EAS integration and build tracking
|
|
22
|
+
- โ Interactive progress indicators
|
|
23
|
+
- โ And more...
|
|
24
|
+
|
|
25
|
+
If you're tired of "Metro stuck", "Watchman warnings", weird build errors, or inconsistent native state... **this tool is for you.**
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## โจ Highlights
|
|
30
|
+
|
|
31
|
+
- ๐จ **Beautiful HTML Reports** - Visual health checks with recommendations
|
|
32
|
+
- ๐ **Local & Cloud Builds** - Choose between fast local builds or EAS cloud builds
|
|
33
|
+
- ๐ **Smart Progress Indicators** - Real-time spinners show what's happening
|
|
34
|
+
- ๐ **EAS Build Tracking** - List and view your builds without leaving the terminal
|
|
35
|
+
- ๐ฏ **Auto-fix Issues** - Automatically detect and fix common problems
|
|
36
|
+
- ๐ **One-Command Workflows** - From clean slate to running app in minutes
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
### Global Installation (Recommended)
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install -g budexp
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or using yarn:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
yarn global add budexp
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Or using pnpm:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pnpm add -g budexp
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Local Development
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/JorgeSilva1997/budexp.git
|
|
64
|
+
cd budexp
|
|
65
|
+
npm install
|
|
66
|
+
npm link # Makes budexp available globally
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Requirements
|
|
72
|
+
|
|
73
|
+
- Node.js >= 14
|
|
74
|
+
- Expo project
|
|
75
|
+
- Expo CLI available through `npx expo`
|
|
76
|
+
- EAS CLI installed/logged in for EAS commands
|
|
77
|
+
- Android Studio/ADB for Android workflows
|
|
78
|
+
- Xcode for iOS workflows on macOS
|
|
79
|
+
- Watchman recommended on macOS
|
|
80
|
+
|
|
81
|
+
> **Important:** `budexp clean --all`, `budexp dev`, and `budexp build --local` perform cleanup operations in the current project. They can remove `node_modules`, clear caches, delete generated native folders (`android/` and/or `ios/`), reinstall dependencies, and rebuild native code. Run them from the root of the Expo project you want to operate on, preferably with a clean git state.
|
|
82
|
+
|
|
83
|
+
## Usage
|
|
84
|
+
|
|
85
|
+
### Development Mode
|
|
86
|
+
|
|
87
|
+
Run your app in development mode with automatic cleaning and rebuilding:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Interactive platform selection
|
|
91
|
+
budexp dev
|
|
92
|
+
|
|
93
|
+
# Android only
|
|
94
|
+
budexp dev --android
|
|
95
|
+
|
|
96
|
+
# iOS only
|
|
97
|
+
budexp dev --ios
|
|
98
|
+
|
|
99
|
+
# Both platforms
|
|
100
|
+
budexp dev --all
|
|
101
|
+
|
|
102
|
+
# Select target device (emulator/simulator or physical)
|
|
103
|
+
budexp dev --android --device
|
|
104
|
+
|
|
105
|
+
# Skip report open prompt and continue if health issues are found
|
|
106
|
+
budexp dev --android --no-open --yes
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**What it does:**
|
|
110
|
+
|
|
111
|
+
1. Runs `expo-doctor` with animated progress spinner
|
|
112
|
+
2. Generates a beautiful HTML health report with recommendations
|
|
113
|
+
3. Prompts to open the report in your browser
|
|
114
|
+
4. Kills running applications
|
|
115
|
+
5. Cleans all caches (Metro, Expo, Watchman)
|
|
116
|
+
6. Deletes native folders
|
|
117
|
+
7. Removes `node_modules`
|
|
118
|
+
8. Detects lock files and prompts whether to delete them (recommended: keep for deterministic installs)
|
|
119
|
+
9. Reinstalls dependencies
|
|
120
|
+
10. Rebuilds native code with `expo prebuild`
|
|
121
|
+
11. Starts the development build
|
|
122
|
+
|
|
123
|
+
### Build Mode (APK/IPA)
|
|
124
|
+
|
|
125
|
+
Build production-ready APK/IPA files locally or in the cloud:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Interactive platform and build type selection
|
|
129
|
+
budexp build
|
|
130
|
+
|
|
131
|
+
# Android only
|
|
132
|
+
budexp build --android
|
|
133
|
+
|
|
134
|
+
# iOS only
|
|
135
|
+
budexp build --ios
|
|
136
|
+
|
|
137
|
+
# Both platforms
|
|
138
|
+
budexp build --all
|
|
139
|
+
|
|
140
|
+
# Force local build
|
|
141
|
+
budexp build --android --local
|
|
142
|
+
|
|
143
|
+
# Skip report open prompt and continue if health issues are found
|
|
144
|
+
budexp build --android --local --no-open --yes
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Build Options:**
|
|
148
|
+
|
|
149
|
+
- ๐ **Local build** - Fast, free, no internet required
|
|
150
|
+
- โ๏ธ **Cloud build (EAS)** - Slower, requires EAS account, builds in the cloud
|
|
151
|
+
|
|
152
|
+
**What it does:**
|
|
153
|
+
|
|
154
|
+
1. Runs `expo-doctor` and generates HTML report
|
|
155
|
+
2. Asks you to choose local or cloud build
|
|
156
|
+
3. **For local builds:**
|
|
157
|
+
- Performs full clean (same as dev mode)
|
|
158
|
+
- Reinstalls dependencies
|
|
159
|
+
- Rebuilds native code
|
|
160
|
+
- Builds APK/IPA using EAS local build
|
|
161
|
+
- Automatically moves build artifacts into `builds/` and names them with app name, version, and date
|
|
162
|
+
- If `builds/` doesnโt exist, prompts for permission to create it
|
|
163
|
+
- Checks whether `builds/` is ignored by `.gitignore` and prompts to add it if missing
|
|
164
|
+
- Prompts to submit to App/Play Store
|
|
165
|
+
4. **For cloud builds:**
|
|
166
|
+
- Checks EAS login status
|
|
167
|
+
- Submits build to EAS cloud
|
|
168
|
+
- Provides commands to track build progress
|
|
169
|
+
|
|
170
|
+
### Clean Command
|
|
171
|
+
|
|
172
|
+
Clean caches, dependencies, or native folders:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Interactive cleaning options
|
|
176
|
+
budexp clean
|
|
177
|
+
|
|
178
|
+
# Clean everything
|
|
179
|
+
budexp clean --all
|
|
180
|
+
|
|
181
|
+
# Clean caches only
|
|
182
|
+
budexp clean --cache
|
|
183
|
+
|
|
184
|
+
# Clean native folders only
|
|
185
|
+
budexp clean --native
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
> `budexp clean --all` removes `node_modules`, clears Metro/Expo/Watchman caches, and can delete generated native folders. Use it only inside the Expo project you intend to clean.
|
|
189
|
+
|
|
190
|
+
### Check Commands
|
|
191
|
+
|
|
192
|
+
#### Health Check
|
|
193
|
+
|
|
194
|
+
Run `expo-doctor` and get a stunning HTML report:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
budexp check health
|
|
198
|
+
# or simply
|
|
199
|
+
budexp check
|
|
200
|
+
|
|
201
|
+
# Generate the report without prompting to open it
|
|
202
|
+
budexp check --no-open
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
This will:
|
|
206
|
+
|
|
207
|
+
- Run `expo-doctor` with animated spinner
|
|
208
|
+
- Generate a beautiful HTML report with:
|
|
209
|
+
- ๐ Statistics dashboard (errors, warnings, checks)
|
|
210
|
+
- ๐ก Actionable recommendations with direct links
|
|
211
|
+
- โ Detailed error list
|
|
212
|
+
- โ ๏ธ Warning list
|
|
213
|
+
- ๐ Full terminal output with search
|
|
214
|
+
- ๐จ Modern, gradient design
|
|
215
|
+
- Prompt to open report in your default browser
|
|
216
|
+
- Display summary in terminal
|
|
217
|
+
|
|
218
|
+
#### EAS Status
|
|
219
|
+
|
|
220
|
+
Check your EAS login status and configuration:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
budexp check eas
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Shows:
|
|
227
|
+
|
|
228
|
+
- Login status and email
|
|
229
|
+
- Build profiles configuration
|
|
230
|
+
- Submit configuration
|
|
231
|
+
|
|
232
|
+
#### EAS Build List
|
|
233
|
+
|
|
234
|
+
List your recent EAS builds:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
budexp check eas:list
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Displays your last 20 builds with:
|
|
241
|
+
|
|
242
|
+
- Build ID
|
|
243
|
+
- Platform (Android/iOS)
|
|
244
|
+
- Status (in progress, completed, failed)
|
|
245
|
+
- Created date
|
|
246
|
+
- App version
|
|
247
|
+
|
|
248
|
+
#### EAS Build Details
|
|
249
|
+
|
|
250
|
+
View detailed information about a specific build:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
budexp check eas:view <build-id>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Shows:
|
|
257
|
+
|
|
258
|
+
- Complete build information
|
|
259
|
+
- Build artifacts
|
|
260
|
+
- Build logs
|
|
261
|
+
- Download links (if available)
|
|
262
|
+
|
|
263
|
+
#### EAS Project Info
|
|
264
|
+
|
|
265
|
+
Display EAS project configuration:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
budexp check eas:project
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Shows:
|
|
272
|
+
|
|
273
|
+
- Project ID
|
|
274
|
+
- Slug
|
|
275
|
+
- Owner
|
|
276
|
+
- SDK version
|
|
277
|
+
|
|
278
|
+
#### Auto-Fix
|
|
279
|
+
|
|
280
|
+
Run health check and attempt to fix issues:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
budexp check fix
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
This will:
|
|
287
|
+
|
|
288
|
+
- Run `expo-doctor`
|
|
289
|
+
- Attempt to fix issues using `expo fix`
|
|
290
|
+
- Re-run health check to verify fixes
|
|
291
|
+
- Generate HTML reports
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Command Reference
|
|
296
|
+
|
|
297
|
+
### `budexp dev [options]`
|
|
298
|
+
|
|
299
|
+
Run app in development mode.
|
|
300
|
+
|
|
301
|
+
**Options:**
|
|
302
|
+
|
|
303
|
+
- `--android` - Build for Android only
|
|
304
|
+
- `--ios` - Build for iOS only
|
|
305
|
+
- `--all` - Build for both platforms
|
|
306
|
+
- `--device` - Select target device (emulator/simulator or physical)
|
|
307
|
+
- `--no-open` - Do not prompt to open the health report
|
|
308
|
+
- `--yes` - Automatically continue when health check issues are found
|
|
309
|
+
|
|
310
|
+
### `budexp build [options]`
|
|
311
|
+
|
|
312
|
+
Build APK/IPA for production.
|
|
313
|
+
|
|
314
|
+
**Options:**
|
|
315
|
+
|
|
316
|
+
- `--android` - Build for Android only
|
|
317
|
+
- `--ios` - Build for iOS only
|
|
318
|
+
- `--all` - Build for both platforms
|
|
319
|
+
- `--local` - Force local build (skip cloud build prompt)
|
|
320
|
+
- `--profile <name>` - EAS build profile
|
|
321
|
+
- `--no-open` - Do not prompt to open the health report
|
|
322
|
+
- `--yes` - Automatically continue when health check issues are found
|
|
323
|
+
|
|
324
|
+
### `budexp clean [options]`
|
|
325
|
+
|
|
326
|
+
Clean caches, dependencies, or native folders.
|
|
327
|
+
|
|
328
|
+
**Options:**
|
|
329
|
+
|
|
330
|
+
- `--all` - Clean everything (caches, node_modules, native folders)
|
|
331
|
+
- `--cache` - Clean caches only
|
|
332
|
+
- `--native` - Clean native folders only
|
|
333
|
+
|
|
334
|
+
### `budexp check [type] [buildId]`
|
|
335
|
+
|
|
336
|
+
Check app status and health.
|
|
337
|
+
|
|
338
|
+
**Types:**
|
|
339
|
+
|
|
340
|
+
- `health` (default) - Run expo-doctor and show health report
|
|
341
|
+
- `eas` - Check EAS login status and configuration
|
|
342
|
+
- `eas:list` - List recent EAS builds
|
|
343
|
+
- `eas:view <build-id>` - View detailed build information
|
|
344
|
+
- `eas:project` - Display EAS project info
|
|
345
|
+
- `fix` - Run health check and attempt to fix issues
|
|
346
|
+
|
|
347
|
+
**Options:**
|
|
348
|
+
|
|
349
|
+
- `--no-open` - Do not prompt to open the health report
|
|
350
|
+
|
|
351
|
+
**Examples:**
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
budexp check health
|
|
355
|
+
budexp check eas
|
|
356
|
+
budexp check eas:list
|
|
357
|
+
budexp check eas:view abc123-def456
|
|
358
|
+
budexp check eas:project
|
|
359
|
+
budexp check fix
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Features
|
|
365
|
+
|
|
366
|
+
### ๐จ Beautiful HTML Reports
|
|
367
|
+
|
|
368
|
+
Every health check generates a modern, interactive HTML report featuring:
|
|
369
|
+
|
|
370
|
+
- **Statistics Dashboard** - Quick overview of errors, warnings, and total checks
|
|
371
|
+
- **Recommendations Section** - Actionable steps with direct links to documentation
|
|
372
|
+
- **Collapsible Sections** - Organized errors and warnings
|
|
373
|
+
- **Search Functionality** - Find specific issues in terminal output
|
|
374
|
+
- **Copy to Clipboard** - One-click copy of full output
|
|
375
|
+
- **Responsive Design** - Works on mobile and desktop
|
|
376
|
+
- **Dark Theme** - Terminal-style output section
|
|
377
|
+
|
|
378
|
+
### ๐ Local vs Cloud Builds
|
|
379
|
+
|
|
380
|
+
Choose your build strategy based on your needs:
|
|
381
|
+
|
|
382
|
+
| Feature | Local Build | Cloud Build |
|
|
383
|
+
| -------- | -------------------- | ----------------- |
|
|
384
|
+
| Speed | โก Fast | ๐ Slower |
|
|
385
|
+
| Cost | ๐ Free | ๐ฐ Requires EAS |
|
|
386
|
+
| Internet | โ Not required | โ
Required |
|
|
387
|
+
| Storage | ๐พ Uses your disk | โ๏ธ Cloud storage |
|
|
388
|
+
| Best for | Development, testing | Production, CI/CD |
|
|
389
|
+
|
|
390
|
+
### ๐ Smart Progress Indicators
|
|
391
|
+
|
|
392
|
+
Never wonder what's happening:
|
|
393
|
+
|
|
394
|
+
- Animated spinners during long operations
|
|
395
|
+
- Clear status messages
|
|
396
|
+
- Success/warning/error indicators
|
|
397
|
+
- Real-time feedback
|
|
398
|
+
|
|
399
|
+
### ๐ EAS Build Tracking
|
|
400
|
+
|
|
401
|
+
Track your builds without leaving the terminal:
|
|
402
|
+
|
|
403
|
+
- List recent builds with status
|
|
404
|
+
- View detailed build information
|
|
405
|
+
- Check project configuration
|
|
406
|
+
- All from the command line
|
|
407
|
+
|
|
408
|
+
### ๐ฏ Automatic Health Checks
|
|
409
|
+
|
|
410
|
+
Before launching in dev mode or building APK/IPA, `budexp` automatically runs `expo-doctor` and generates a detailed HTML report. You'll be notified of any issues and can choose to continue or fix them first.
|
|
411
|
+
|
|
412
|
+
### ๐งน Smart Cleaning
|
|
413
|
+
|
|
414
|
+
The tool intelligently:
|
|
415
|
+
|
|
416
|
+
- Detects and kills running Metro/React Native processes
|
|
417
|
+
- Stops apps on connected Android devices
|
|
418
|
+
- Cleans all relevant caches (Metro, Expo, Watchman, Haste map)
|
|
419
|
+
- Removes native folders when needed
|
|
420
|
+
- Handles multiple package managers (npm, yarn, pnpm, bun)
|
|
421
|
+
|
|
422
|
+
### ๐ EAS Integration
|
|
423
|
+
|
|
424
|
+
- Automatically detects EAS login status
|
|
425
|
+
- Prompts to login when needed
|
|
426
|
+
- Supports both local and cloud builds
|
|
427
|
+
- Build tracking and monitoring
|
|
428
|
+
- Automated submission flow
|
|
429
|
+
|
|
430
|
+
### ๐ Build Naming
|
|
431
|
+
|
|
432
|
+
APK/IPA files are automatically renamed with:
|
|
433
|
+
|
|
434
|
+
- App name (from `app.json`)
|
|
435
|
+
- Version number
|
|
436
|
+
- Current date
|
|
437
|
+
|
|
438
|
+
Format: `appname-1.0.0-2025-01-28.apk`
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## Why This Exists
|
|
443
|
+
|
|
444
|
+
Expo & React Native sometimes get into a weird build state where:
|
|
445
|
+
|
|
446
|
+
- Caches break
|
|
447
|
+
- Native directories conflict
|
|
448
|
+
- Metro behaves erratically
|
|
449
|
+
- EAS builds fail
|
|
450
|
+
- Device installs get stuck
|
|
451
|
+
|
|
452
|
+
This toolkit solves all of that with one set of robust commands, plus beautiful reports and progress indicators to keep you informed.
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## Quick Start
|
|
457
|
+
|
|
458
|
+
After installation, navigate to your Expo project directory and run:
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
# Check your project health with beautiful HTML report
|
|
462
|
+
budexp check health
|
|
463
|
+
|
|
464
|
+
# Start development mode
|
|
465
|
+
budexp dev --android
|
|
466
|
+
|
|
467
|
+
# Build for production (choose local or cloud)
|
|
468
|
+
budexp build --ios
|
|
469
|
+
|
|
470
|
+
# Track your EAS builds
|
|
471
|
+
budexp check eas:list
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## Screenshots
|
|
477
|
+
|
|
478
|
+
### Health Check Report
|
|
479
|
+
|
|
480
|
+
Beautiful HTML reports with statistics, recommendations, and full terminal output.
|
|
481
|
+
|
|
482
|
+
### Progress Indicators
|
|
483
|
+
|
|
484
|
+
Real-time spinners show exactly what's happening during long operations.
|
|
485
|
+
|
|
486
|
+
### EAS Build List
|
|
487
|
+
|
|
488
|
+
Track all your builds from the command line.
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
## Contributing
|
|
493
|
+
|
|
494
|
+
PRs, improvements, and suggestions are welcome!
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
## License
|
|
499
|
+
|
|
500
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
## Changelog
|
|
505
|
+
|
|
506
|
+
### v0.1.0
|
|
507
|
+
|
|
508
|
+
- ๐จ Beautiful HTML reports with recommendations
|
|
509
|
+
- ๐ Local and cloud build options
|
|
510
|
+
- ๐ Animated progress indicators
|
|
511
|
+
- ๐ EAS build tracking commands
|
|
512
|
+
- ๐ฏ Auto-fix functionality
|
|
513
|
+
- ๐งน Smart cleaning utilities
|
|
514
|
+
- ๐ Automatic build renaming
|
|
515
|
+
|
|
516
|
+
---
|
package/bin/budexp.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { program } = require('commander');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const packageJson = require('../package.json');
|
|
6
|
+
|
|
7
|
+
// Import command modules
|
|
8
|
+
const devCommand = require('../src/commands/dev');
|
|
9
|
+
const buildCommand = require('../src/commands/build');
|
|
10
|
+
const cleanCommand = require('../src/commands/clean');
|
|
11
|
+
const checkCommand = require('../src/commands/check');
|
|
12
|
+
|
|
13
|
+
// CLI metadata
|
|
14
|
+
program
|
|
15
|
+
.name('budexp')
|
|
16
|
+
.description(
|
|
17
|
+
'A powerful CLI tool to facilitate mobile development with Expo + React Native stack'
|
|
18
|
+
)
|
|
19
|
+
.version(packageJson.version);
|
|
20
|
+
|
|
21
|
+
// Improve error UX
|
|
22
|
+
program.showHelpAfterError();
|
|
23
|
+
program.showSuggestionAfterError();
|
|
24
|
+
|
|
25
|
+
// Emoji map
|
|
26
|
+
const icons = {
|
|
27
|
+
dev: '๐งช',
|
|
28
|
+
build: '๐ฆ',
|
|
29
|
+
clean: '๐งน',
|
|
30
|
+
check: '๐',
|
|
31
|
+
help: 'โ',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Custom help UI
|
|
35
|
+
program.configureHelp({
|
|
36
|
+
formatHelp: (cmd, helper) => {
|
|
37
|
+
const commands = helper.visibleCommands(cmd);
|
|
38
|
+
const options = helper.visibleOptions(cmd);
|
|
39
|
+
const isRoot = cmd === program;
|
|
40
|
+
|
|
41
|
+
const maxCommandLen = Math.max(4, ...commands.map((c) => c.name().length));
|
|
42
|
+
const maxFlagsLen = Math.max(8, ...options.map((o) => o.flags.length));
|
|
43
|
+
|
|
44
|
+
const headerTitle = isRoot ? '๐ budexp' : `๐ budexp ${cmd.name()}`;
|
|
45
|
+
const headerSubtitle = isRoot
|
|
46
|
+
? 'A powerful CLI for Expo + React Native'
|
|
47
|
+
: cmd.description() || 'Command help';
|
|
48
|
+
|
|
49
|
+
const commandsSection =
|
|
50
|
+
commands.length > 0
|
|
51
|
+
? `${chalk.yellow('\nCOMMANDS')}\n${commands
|
|
52
|
+
.map((c) => {
|
|
53
|
+
const name = c.name();
|
|
54
|
+
const icon = icons[name] || ' ';
|
|
55
|
+
return ` ${icon} ${chalk.green(name.padEnd(maxCommandLen + 2))}${c.description()}`;
|
|
56
|
+
})
|
|
57
|
+
.join('\n')}\n`
|
|
58
|
+
: '';
|
|
59
|
+
|
|
60
|
+
const optionsSection =
|
|
61
|
+
options.length > 0
|
|
62
|
+
? `${chalk.yellow('\nOPTIONS')}\n${options
|
|
63
|
+
.map((o) => ` ${chalk.cyan(o.flags.padEnd(maxFlagsLen + 2))}${o.description}`)
|
|
64
|
+
.join('\n')}\n`
|
|
65
|
+
: '';
|
|
66
|
+
|
|
67
|
+
const examples = isRoot
|
|
68
|
+
? [
|
|
69
|
+
'$ budexp dev --ios',
|
|
70
|
+
'$ budexp dev --android --device',
|
|
71
|
+
'$ budexp build --android',
|
|
72
|
+
'$ budexp clean --all',
|
|
73
|
+
'$ budexp check eas:list',
|
|
74
|
+
]
|
|
75
|
+
: cmd.name() === 'dev'
|
|
76
|
+
? [
|
|
77
|
+
'$ budexp dev --ios',
|
|
78
|
+
'$ budexp dev --android',
|
|
79
|
+
'$ budexp dev --android --device',
|
|
80
|
+
'$ budexp dev --all --device',
|
|
81
|
+
]
|
|
82
|
+
: cmd.name() === 'build'
|
|
83
|
+
? ['$ budexp build --android', '$ budexp build --ios', '$ budexp build --all']
|
|
84
|
+
: cmd.name() === 'clean'
|
|
85
|
+
? ['$ budexp clean --all', '$ budexp clean --cache', '$ budexp clean --native']
|
|
86
|
+
: cmd.name() === 'check'
|
|
87
|
+
? [
|
|
88
|
+
'$ budexp check',
|
|
89
|
+
'$ budexp check eas',
|
|
90
|
+
'$ budexp check eas:list',
|
|
91
|
+
'$ budexp check eas:view <buildId>',
|
|
92
|
+
]
|
|
93
|
+
: [`$ ${helper.commandUsage(cmd)}`];
|
|
94
|
+
|
|
95
|
+
const examplesSection = `${chalk.yellow('\nEXAMPLES')}\n${examples
|
|
96
|
+
.map((e) => ` ${chalk.gray(e)}`)
|
|
97
|
+
.join('\n')}\n`;
|
|
98
|
+
|
|
99
|
+
const tip = isRoot
|
|
100
|
+
? `${chalk.gray('\nTip:')} ${chalk.gray('Run')} ${chalk.white('budexp <command> --help')} ${chalk.gray('for command options.')}\n`
|
|
101
|
+
: '';
|
|
102
|
+
|
|
103
|
+
return `\n${chalk.bold.cyan(headerTitle)}\n${chalk.gray('โโโโโโโโโโโโโโโโโโโโโโโโโโโโ')}\n${chalk.gray(headerSubtitle)}\n\n${chalk.yellow('USAGE')}\n ${helper.commandUsage(cmd)}\n${commandsSection}${optionsSection}${examplesSection}${tip}`;
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Dev command
|
|
108
|
+
program
|
|
109
|
+
.command('dev')
|
|
110
|
+
.description('Run the app in development mode')
|
|
111
|
+
.option('--all', 'Run on both iOS and Android')
|
|
112
|
+
.option('--ios', 'Run on iOS only')
|
|
113
|
+
.option('--android', 'Run on Android only')
|
|
114
|
+
.option('--device', 'Select target device (emulator/simulator or physical)')
|
|
115
|
+
.option('--no-open', 'Do not prompt to open the health report')
|
|
116
|
+
.option('--yes', 'Automatically continue when health check issues are found')
|
|
117
|
+
.action(async (options) => {
|
|
118
|
+
await devCommand(options);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// Build command
|
|
122
|
+
program
|
|
123
|
+
.command('build')
|
|
124
|
+
.description('Build APK/IPA for production')
|
|
125
|
+
.option('--all', 'Build for both iOS and Android')
|
|
126
|
+
.option('--ios', 'Build for iOS only')
|
|
127
|
+
.option('--android', 'Build for Android only')
|
|
128
|
+
.option('--local', 'Build locally using EAS local build')
|
|
129
|
+
.option('--profile <name>', 'EAS build profile (e.g. development, preview, production)')
|
|
130
|
+
.option('--no-open', 'Do not prompt to open the health report')
|
|
131
|
+
.option('--yes', 'Automatically continue when health check issues are found')
|
|
132
|
+
.action(async (options) => {
|
|
133
|
+
await buildCommand(options);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Clean command
|
|
137
|
+
program
|
|
138
|
+
.command('clean')
|
|
139
|
+
.description('Clean caches, node_modules, and native folders')
|
|
140
|
+
.option('--all', 'Clean everything including native folders')
|
|
141
|
+
.option('--cache', 'Clean caches only')
|
|
142
|
+
.option('--native', 'Clean native folders only')
|
|
143
|
+
.action(async (options) => {
|
|
144
|
+
await cleanCommand(options);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Check command
|
|
148
|
+
program
|
|
149
|
+
.command('check')
|
|
150
|
+
.description('Check app status and health')
|
|
151
|
+
.argument(
|
|
152
|
+
'[type]',
|
|
153
|
+
'Type of check: health, eas, eas:list, eas:view, eas:project, or fix',
|
|
154
|
+
'health'
|
|
155
|
+
)
|
|
156
|
+
.argument('[buildId]', 'Build ID for eas:view command')
|
|
157
|
+
.option('--no-open', 'Do not prompt to open the health report')
|
|
158
|
+
.action(async (type, buildId, options) => {
|
|
159
|
+
await checkCommand(type, buildId, options);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
program.parse();
|