gib-runs 2.3.8 → 2.4.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/.jshintrc +10 -0
- package/CHANGELOG.md +27 -0
- package/README.md +73 -55
- package/index.js +181 -110
- package/lib/process-runner.js +105 -97
- package/lib/tunnel.js +73 -136
- package/middleware/error-page.js +2 -6
- package/middleware/health.js +37 -28
- package/middleware/history.js +35 -0
- package/middleware/logger.js +11 -6
- package/middleware/performance.js +10 -14
- package/middleware/rate-limit.js +17 -27
- package/middleware/security.js +7 -21
- package/middleware/spa-ignore-assets.js +9 -8
- package/middleware/spa.js +7 -7
- package/middleware/upload.js +29 -31
- package/package.json +1 -1
package/.jshintrc
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [2.4.0] - 2026-02-15
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- 📜 **Request History Tracking** - New `/history` endpoint
|
|
9
|
+
- Tracks last 50 HTTP requests with full details
|
|
10
|
+
- Includes timestamp, method, URL, status, duration, and IP
|
|
11
|
+
- Perfect for debugging and monitoring
|
|
12
|
+
- 📊 **Detailed File Change Notifications** - Enhanced file watching
|
|
13
|
+
- Shows file size on changes: `File changed: app.js (12.45KB)`
|
|
14
|
+
- Separate notifications for file add/delete events
|
|
15
|
+
- ➕ File added (logLevel >= 2)
|
|
16
|
+
- ➖ File deleted (logLevel >= 2)
|
|
17
|
+
- 📝 **Comprehensive Logging** - Complete request and error logging
|
|
18
|
+
- All requests logged with timestamp and IP address
|
|
19
|
+
- Consistent ISO 8601 timestamps across all logs
|
|
20
|
+
- Works in static, npm-script, and exec modes
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- 🔧 **Improved Error Handling** - Better error messages with timestamps
|
|
24
|
+
- Server errors include timestamp and stack trace
|
|
25
|
+
- Process errors in npm/exec mode properly logged
|
|
26
|
+
- Watcher errors show detailed information
|
|
27
|
+
- ⚡ **Enhanced Process Runner** - Better npm-script and exec mode
|
|
28
|
+
- Stderr properly captured and logged with timestamps
|
|
29
|
+
- Exit codes and signals logged with context
|
|
30
|
+
- Cleaner output formatting
|
|
31
|
+
|
|
5
32
|
## [2.3.8] - 2026-02-15
|
|
6
33
|
|
|
7
34
|
### Changed
|
package/README.md
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
[](https://www.npmjs.org/package/gib-runs)
|
|
5
5
|
[](https://github.com/levouinse/gib-runs/blob/main/LICENSE)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A modern development server with live reload and hot module replacement. Built for developers who value capability over connections.
|
|
8
8
|
|
|
9
|
-
> *"Unlike some people, this actually runs on
|
|
9
|
+
> *"Unlike some people, this actually runs on merit, not nepotism."*
|
|
10
10
|
|
|
11
11
|
## Why GIB-RUNS?
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Named after Indonesia's Vice President Gibran Rakabuming Raka, who got his position through family connections. But unlike certain political figures, this server:
|
|
14
14
|
|
|
15
|
-
- ✅ Earned its position through
|
|
16
|
-
- ✅ Works
|
|
15
|
+
- ✅ Earned its position through real features
|
|
16
|
+
- ✅ Works without shortcuts or special treatment
|
|
17
17
|
- ✅ Serves everyone equally
|
|
18
|
-
- ✅ Transparent about what it does
|
|
19
|
-
- ✅ Performance based on
|
|
18
|
+
- ✅ Transparent and honest about what it does
|
|
19
|
+
- ✅ Performance based on actual metrics
|
|
20
20
|
|
|
21
21
|
*"When your dev server has more integrity than some vice presidents."*
|
|
22
22
|
|
|
@@ -26,6 +26,8 @@ The name playfully references Indonesia's Vice President Gibran Rakabuming Raka,
|
|
|
26
26
|
- ⚡ **Hot CSS Injection** - Update styles without full page reload
|
|
27
27
|
- 🎨 **Beautiful UI** - Modern status indicator with real-time feedback
|
|
28
28
|
- 📊 **Performance Monitoring** - Track requests, reloads, and uptime
|
|
29
|
+
- 📝 **Comprehensive Logging** - All requests, errors, and file changes with timestamps and file sizes
|
|
30
|
+
- 📜 **Request History** - Track last 50 requests via `/history` endpoint
|
|
29
31
|
- 🗜️ **Compression** - Built-in gzip compression
|
|
30
32
|
- 🔒 **HTTPS/HTTP2** - Secure development with modern protocols
|
|
31
33
|
- 🌐 **CORS Support** - Easy cross-origin development
|
|
@@ -34,7 +36,7 @@ The name playfully references Indonesia's Vice President Gibran Rakabuming Raka,
|
|
|
34
36
|
- 🔌 **Proxy Support** - Proxy API requests during development
|
|
35
37
|
- 📦 **Middleware** - Extend functionality with custom middleware
|
|
36
38
|
- 🎭 **Mount Directories** - Serve multiple directories on different routes
|
|
37
|
-
- 🚀 **NPM Scripts** - Run npm
|
|
39
|
+
- 🚀 **NPM Scripts** - Run npm scripts alongside the server
|
|
38
40
|
- 🔄 **PM2 Integration** - Production-ready process management
|
|
39
41
|
- 🌍 **Public Tunnels** - Share your dev server with anyone, anywhere
|
|
40
42
|
- 📱 **Multi-Device** - Access from any device on your network
|
|
@@ -68,44 +70,16 @@ gib-runs --spa
|
|
|
68
70
|
gib-runs --https=./config/https.conf.js
|
|
69
71
|
```
|
|
70
72
|
|
|
71
|
-
##
|
|
73
|
+
## Common Use Cases
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|--------|-------------|---------|
|
|
75
|
-
| `--port=NUMBER` | Port to use | `8080` |
|
|
76
|
-
| `--host=ADDRESS` | Address to bind to | `0.0.0.0` |
|
|
77
|
-
| `--open=PATH` | Path to open in browser | `/` |
|
|
78
|
-
| `--no-browser` | Suppress browser launch | `false` |
|
|
79
|
-
| `-q, --quiet` | Suppress logging | `false` |
|
|
80
|
-
| `-V, --verbose` | Verbose logging | `false` |
|
|
81
|
-
| `--watch=PATH` | Paths to watch (comma-separated) | All files |
|
|
82
|
-
| `--ignore=PATH` | Paths to ignore (comma-separated) | None |
|
|
83
|
-
| `--no-css-inject` | Reload page on CSS change | `false` |
|
|
84
|
-
| `--spa` | Single Page App mode | `false` |
|
|
85
|
-
| `--cors` | Enable CORS | `false` |
|
|
86
|
-
| `--https=PATH` | HTTPS config module | None |
|
|
87
|
-
| `--proxy=ROUTE:URL` | Proxy requests | None |
|
|
88
|
-
| `--middleware=PATH` | Custom middleware | None |
|
|
89
|
-
| `--htpasswd=PATH` | HTTP auth file | None |
|
|
90
|
-
| `--tunnel` | Create public tunnel | `false` |
|
|
91
|
-
| `--tunnel-service=NAME` | Tunnel service (lt, cf, ngrok) | `localtunnel` |
|
|
92
|
-
| `--npm-script=SCRIPT` | Run npm script (dev, start, etc) | None |
|
|
93
|
-
| `--exec=COMMAND` | Run custom command | None |
|
|
94
|
-
| `--pm2` | Use PM2 process manager | `false` |
|
|
95
|
-
| `--auto-restart` | Auto-restart server on crash | `false` |
|
|
96
|
-
| `--enable-upload` | Enable file upload endpoint | `false` |
|
|
97
|
-
| `--log-to-file` | Log requests to file | `false` |
|
|
98
|
-
|
|
99
|
-
## Usage Examples
|
|
100
|
-
|
|
101
|
-
### Basic Server
|
|
75
|
+
### Basic Development Server
|
|
102
76
|
|
|
103
77
|
```bash
|
|
104
|
-
# Serve current directory
|
|
78
|
+
# Serve current directory with live reload
|
|
105
79
|
gib-runs
|
|
106
80
|
|
|
107
|
-
#
|
|
108
|
-
gib-runs --port=3000
|
|
81
|
+
# Custom port and verbose logging
|
|
82
|
+
gib-runs --port=3000 --verbose
|
|
109
83
|
|
|
110
84
|
# Serve specific directory
|
|
111
85
|
gib-runs ./public
|
|
@@ -117,7 +91,7 @@ gib-runs ./public
|
|
|
117
91
|
# SPA mode (redirects all routes to index.html)
|
|
118
92
|
gib-runs --spa
|
|
119
93
|
|
|
120
|
-
#
|
|
94
|
+
# SPA with custom port
|
|
121
95
|
gib-runs --spa --port=8000
|
|
122
96
|
```
|
|
123
97
|
|
|
@@ -147,7 +121,7 @@ gib-runs --mount=/static:./assets --mount=/lib:./node_modules
|
|
|
147
121
|
# Run npm dev script with live reload
|
|
148
122
|
gib-runs --npm-script=dev
|
|
149
123
|
|
|
150
|
-
# Run with PM2
|
|
124
|
+
# Run with PM2 process manager
|
|
151
125
|
gib-runs --npm-script=dev --pm2
|
|
152
126
|
|
|
153
127
|
# Run custom command
|
|
@@ -163,7 +137,7 @@ gib-runs --tunnel
|
|
|
163
137
|
# Use Cloudflare Tunnel
|
|
164
138
|
gib-runs --tunnel-service=cloudflared
|
|
165
139
|
|
|
166
|
-
# Use Ngrok
|
|
140
|
+
# Use Ngrok (requires auth token)
|
|
167
141
|
gib-runs --tunnel-service=ngrok --tunnel-authtoken=YOUR_TOKEN
|
|
168
142
|
```
|
|
169
143
|
|
|
@@ -187,15 +161,33 @@ Then run:
|
|
|
187
161
|
gib-runs --https=./https.conf.js
|
|
188
162
|
```
|
|
189
163
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
# Create htpasswd file
|
|
194
|
-
htpasswd -c .htpasswd username
|
|
164
|
+
## CLI Options
|
|
195
165
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
166
|
+
| Option | Description | Default |
|
|
167
|
+
|--------|-------------|---------|
|
|
168
|
+
| `--port=NUMBER` | Port to use | `8080` |
|
|
169
|
+
| `--host=ADDRESS` | Address to bind to | `0.0.0.0` |
|
|
170
|
+
| `--open=PATH` | Path to open in browser | `/` |
|
|
171
|
+
| `--no-browser` | Suppress browser launch | `false` |
|
|
172
|
+
| `-q, --quiet` | Suppress logging | `false` |
|
|
173
|
+
| `-V, --verbose` | Verbose logging | `false` |
|
|
174
|
+
| `--watch=PATH` | Paths to watch (comma-separated) | All files |
|
|
175
|
+
| `--ignore=PATH` | Paths to ignore (comma-separated) | None |
|
|
176
|
+
| `--no-css-inject` | Reload page on CSS change | `false` |
|
|
177
|
+
| `--spa` | Single Page App mode | `false` |
|
|
178
|
+
| `--cors` | Enable CORS | `false` |
|
|
179
|
+
| `--https=PATH` | HTTPS config module | None |
|
|
180
|
+
| `--proxy=ROUTE:URL` | Proxy requests | None |
|
|
181
|
+
| `--middleware=PATH` | Custom middleware | None |
|
|
182
|
+
| `--htpasswd=PATH` | HTTP auth file | None |
|
|
183
|
+
| `--tunnel` | Create public tunnel | `false` |
|
|
184
|
+
| `--tunnel-service=NAME` | Tunnel service (lt, cf, ngrok) | `localtunnel` |
|
|
185
|
+
| `--npm-script=SCRIPT` | Run npm script | None |
|
|
186
|
+
| `--exec=COMMAND` | Run custom command | None |
|
|
187
|
+
| `--pm2` | Use PM2 process manager | `false` |
|
|
188
|
+
| `--auto-restart` | Auto-restart server on crash | `false` |
|
|
189
|
+
| `--enable-upload` | Enable file upload endpoint | `false` |
|
|
190
|
+
| `--log-to-file` | Log requests to file | `false` |
|
|
199
191
|
|
|
200
192
|
## Node.js API
|
|
201
193
|
|
|
@@ -263,10 +255,37 @@ Or `.gib-runs.json` in your project root (overrides global config):
|
|
|
263
255
|
}
|
|
264
256
|
```
|
|
265
257
|
|
|
266
|
-
**Priority**:
|
|
258
|
+
**Priority**: CLI arguments > Project config > Global config > Defaults
|
|
267
259
|
|
|
268
260
|
## Advanced Features
|
|
269
261
|
|
|
262
|
+
### Request History
|
|
263
|
+
|
|
264
|
+
Track all HTTP requests for debugging:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# View request history
|
|
268
|
+
curl http://localhost:8080/history
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Response:
|
|
272
|
+
|
|
273
|
+
```json
|
|
274
|
+
{
|
|
275
|
+
"total": 10,
|
|
276
|
+
"requests": [
|
|
277
|
+
{
|
|
278
|
+
"timestamp": "2026-02-15T06:09:17.875Z",
|
|
279
|
+
"method": "GET",
|
|
280
|
+
"url": "/index.html",
|
|
281
|
+
"status": 200,
|
|
282
|
+
"duration": "5ms",
|
|
283
|
+
"ip": "127.0.0.1"
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
270
289
|
### Environment Variables
|
|
271
290
|
|
|
272
291
|
Automatically loads `.env` file from project root:
|
|
@@ -357,7 +376,7 @@ cat gib-runs.log | jq 'select(.duration | tonumber > 100)'
|
|
|
357
376
|
Create `middleware/custom.js`:
|
|
358
377
|
|
|
359
378
|
```javascript
|
|
360
|
-
module.exports =
|
|
379
|
+
module.exports = (req, res, next) => {
|
|
361
380
|
console.log('Request:', req.url);
|
|
362
381
|
next();
|
|
363
382
|
};
|
|
@@ -379,7 +398,6 @@ Server automatically binds to `0.0.0.0` and shows all network URLs:
|
|
|
379
398
|
📁 Root: /home/user/project
|
|
380
399
|
🌐 Local: http://127.0.0.1:8080
|
|
381
400
|
🔗 Network: http://192.168.1.100:8080
|
|
382
|
-
🔗 Network: http://10.0.0.5:8080
|
|
383
401
|
🔄 Live Reload: Enabled
|
|
384
402
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
385
403
|
```
|