gib-runs 2.3.5 → 2.3.7
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/.gib-runs.json.example +21 -0
- package/CHANGELOG.md +17 -1
- package/README.md +26 -9
- package/gib-run.js +8 -0
- package/index.js +15 -11
- package/package.json +3 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"port": 8080,
|
|
3
|
+
"host": "0.0.0.0",
|
|
4
|
+
"open": true,
|
|
5
|
+
"logLevel": 2,
|
|
6
|
+
"compression": true,
|
|
7
|
+
"cors": false,
|
|
8
|
+
"spa": false,
|
|
9
|
+
"watch": ["src", "public", "dist"],
|
|
10
|
+
"ignore": ["*.test.js", "*.spec.js", "*.map"],
|
|
11
|
+
"middleware": [],
|
|
12
|
+
"wait": 100,
|
|
13
|
+
"noCssInject": false,
|
|
14
|
+
"qrCode": false,
|
|
15
|
+
"tunnel": false,
|
|
16
|
+
"autoRestart": false,
|
|
17
|
+
"enableUpload": false,
|
|
18
|
+
"enableHealth": true,
|
|
19
|
+
"logToFile": false,
|
|
20
|
+
"customErrorPage": true
|
|
21
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [2.3.
|
|
5
|
+
## [2.3.7] - 2026-02-13
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- 📁 **Project-Level Config File** - Support for `.gib-runs.json` in project root
|
|
9
|
+
- Overrides global config (`~/.gib-runs.json`)
|
|
10
|
+
- Priority: Project config > Global config > CLI args > Defaults
|
|
11
|
+
- Perfect for team-shared project settings
|
|
12
|
+
- 🎯 **Improved Watch Ignore Patterns** - Better file watching performance
|
|
13
|
+
- Auto-ignore common directories: `node_modules`, `.git`, `dist`, `build`, `coverage`, `.next`, `.nuxt`, `.output`, `out`, `target`
|
|
14
|
+
- Prevents unnecessary reloads from build artifacts
|
|
15
|
+
- Reduces CPU usage during development
|
|
16
|
+
- ⚡ **Enhanced File Watching Stability** - More reliable change detection
|
|
17
|
+
- Added `awaitWriteFinish` option to prevent partial file reads
|
|
18
|
+
- Ignores permission errors automatically
|
|
19
|
+
- Debounced file changes for better performance
|
|
20
|
+
|
|
21
|
+
## [2.3.6] - 2026-02-12
|
|
6
22
|
|
|
7
23
|
### Added
|
|
8
24
|
- 🔄 **Environment Variable Replacement** - Automatic replacement of `${VAR_NAME}` patterns in HTML files
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://github.com/levouinse/gib-runs/blob/main/LICENSE)
|
|
4
4
|
[](https://github.com/levouinse/gib-runs)
|
|
5
5
|
|
|
6
|
-
# 🚀 GIB-RUNS v2.3.
|
|
6
|
+
# 🚀 GIB-RUNS v2.3.7
|
|
7
7
|
|
|
8
8
|
**Modern development server with live reload - Unlike some people, this actually runs on merit, not connections.**
|
|
9
9
|
|
|
@@ -61,10 +61,13 @@ The name is a playful nod to Indonesia's Vice President Gibran Rakabuming Raka,
|
|
|
61
61
|
- 🚦 **Rate Limiting** - Protect against abuse (better protection than family connections)
|
|
62
62
|
- 🌐 **Network Access** - True network binding that actually works (unlike some political promises)
|
|
63
63
|
|
|
64
|
-
### New in v2.3.
|
|
65
|
-
-
|
|
64
|
+
### New in v2.3.7 🎉
|
|
65
|
+
- 📁 **Project-Level Config File** - `.gib-runs.json` in project root (overrides global config)
|
|
66
|
+
- 🎯 **Improved Watch Ignore** - Auto-ignore common directories (node_modules, dist, build, etc)
|
|
67
|
+
- ⚡ **Enhanced File Watching** - Better stability with awaitWriteFinish option
|
|
66
68
|
|
|
67
|
-
### New in v2.3.
|
|
69
|
+
### New in v2.3.6 🎉
|
|
70
|
+
- 🔄 **Environment Variable Replacement** - Automatic replacement of `${VAR_NAME}` in HTML files from .env
|
|
68
71
|
- 🔁 **Auto-Restart on Crash** - Automatically restart server on unexpected errors (resilient mode)
|
|
69
72
|
- 📤 **File Upload Endpoint** - Built-in file upload support for development (POST to /upload)
|
|
70
73
|
- 💚 **Health Check Endpoint** - Monitor server health and statistics (GET /health)
|
|
@@ -226,7 +229,7 @@ const server = gibRun.start({
|
|
|
226
229
|
|
|
227
230
|
### Configuration File
|
|
228
231
|
|
|
229
|
-
Create `~/.gib-runs.json` for default settings:
|
|
232
|
+
Create `~/.gib-runs.json` for global default settings:
|
|
230
233
|
|
|
231
234
|
```json
|
|
232
235
|
{
|
|
@@ -239,6 +242,20 @@ Create `~/.gib-runs.json` for default settings:
|
|
|
239
242
|
}
|
|
240
243
|
```
|
|
241
244
|
|
|
245
|
+
Or create `.gib-runs.json` in your project root for project-specific settings (overrides global config):
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"port": 3000,
|
|
250
|
+
"spa": true,
|
|
251
|
+
"watch": ["src", "public"],
|
|
252
|
+
"ignore": ["*.test.js", "*.spec.js"],
|
|
253
|
+
"middleware": ["performance", "security"]
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**Priority**: Project config > Global config > CLI arguments > Defaults
|
|
258
|
+
|
|
242
259
|
## 🔒 HTTPS Configuration
|
|
243
260
|
|
|
244
261
|
Create an HTTPS configuration module:
|
|
@@ -389,7 +406,7 @@ gib-runs
|
|
|
389
406
|
Network URLs are **ALWAYS shown automatically** when you start the server:
|
|
390
407
|
|
|
391
408
|
```
|
|
392
|
-
🚀 GIB-RUNS v2.3.
|
|
409
|
+
🚀 GIB-RUNS v2.3.7
|
|
393
410
|
"Unlike Gibran, this actually works through merit"
|
|
394
411
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
395
412
|
📁 Root: /home/user/project
|
|
@@ -508,7 +525,7 @@ gib-runs --tunnel-service=tunnelto
|
|
|
508
525
|
### Example Output
|
|
509
526
|
|
|
510
527
|
```
|
|
511
|
-
🚀 GIB-RUNS v2.3.
|
|
528
|
+
🚀 GIB-RUNS v2.3.7
|
|
512
529
|
"Unlike Gibran, this actually works through merit"
|
|
513
530
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
514
531
|
📁 Root: /home/user/project
|
|
@@ -638,7 +655,7 @@ pm2 list
|
|
|
638
655
|
### Example Output
|
|
639
656
|
|
|
640
657
|
```
|
|
641
|
-
🚀 GIB-RUNS v2.3.
|
|
658
|
+
🚀 GIB-RUNS v2.3.7
|
|
642
659
|
"Unlike Gibran, this actually works through merit"
|
|
643
660
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
644
661
|
📁 Root: /home/user/project
|
|
@@ -665,7 +682,7 @@ pm2 list
|
|
|
665
682
|
|
|
666
683
|
**Unlike Gibran's career, these processes run on actual merit and capability!** 🔥
|
|
667
684
|
|
|
668
|
-
## 🆕 New Features in v2.3.
|
|
685
|
+
## 🆕 New Features in v2.3.6
|
|
669
686
|
|
|
670
687
|
### Auto-Restart on Crash
|
|
671
688
|
|
package/gib-run.js
CHANGED
|
@@ -23,6 +23,14 @@ if (fs.existsSync(configPath)) {
|
|
|
23
23
|
if (opts.ignorePattern) opts.ignorePattern = new RegExp(opts.ignorePattern);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
// Project-level config (overrides global config)
|
|
27
|
+
var projectConfigPath = path.join(process.cwd(), '.gib-runs.json');
|
|
28
|
+
if (fs.existsSync(projectConfigPath)) {
|
|
29
|
+
var projectConfig = fs.readFileSync(projectConfigPath, 'utf8');
|
|
30
|
+
assign(opts, JSON.parse(projectConfig));
|
|
31
|
+
if (opts.ignorePattern) opts.ignorePattern = new RegExp(opts.ignorePattern);
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
for (var i = process.argv.length - 1; i >= 2; --i) {
|
|
27
35
|
var arg = process.argv[i];
|
|
28
36
|
if (arg.indexOf("--port=") > -1) {
|
package/index.js
CHANGED
|
@@ -74,12 +74,6 @@ function staticServer(root) {
|
|
|
74
74
|
if (hasNoOrigin && (possibleExtensions.indexOf(x) > -1)) {
|
|
75
75
|
// TODO: Sync file read here is not nice, but we need to determine if the html should be injected or not
|
|
76
76
|
var contents = fs.readFileSync(filepath, "utf8");
|
|
77
|
-
|
|
78
|
-
// Replace environment variables like ${APP_NAME}
|
|
79
|
-
contents = contents.replace(/\$\{([A-Z_]+)\}/g, function(fullMatch, varName) {
|
|
80
|
-
return process.env[varName] || fullMatch;
|
|
81
|
-
});
|
|
82
|
-
|
|
83
77
|
for (var i = 0; i < injectCandidates.length; ++i) {
|
|
84
78
|
match = injectCandidates[i].exec(contents);
|
|
85
79
|
if (match) {
|
|
@@ -106,12 +100,14 @@ function staticServer(root) {
|
|
|
106
100
|
res.setHeader('Content-Length', len);
|
|
107
101
|
var originalPipe = stream.pipe;
|
|
108
102
|
stream.pipe = function(resp) {
|
|
109
|
-
// Replace ${
|
|
110
|
-
var
|
|
111
|
-
return
|
|
103
|
+
// Replace environment variables ${VAR_NAME} with actual values
|
|
104
|
+
var envReplacer = es.mapSync(function(data) {
|
|
105
|
+
return data.toString().replace(/\$\{([^}]+)\}/g, function(match, varName) {
|
|
106
|
+
return process.env[varName] || '';
|
|
107
|
+
});
|
|
112
108
|
});
|
|
113
109
|
var codeInject = es.replace(new RegExp(injectTag, "i"), INJECTED_CODE + injectTag);
|
|
114
|
-
originalPipe.call(stream,
|
|
110
|
+
originalPipe.call(stream, envReplacer).pipe(codeInject).pipe(resp);
|
|
115
111
|
};
|
|
116
112
|
}
|
|
117
113
|
}
|
|
@@ -631,6 +627,9 @@ GibRuns.start = function(options) {
|
|
|
631
627
|
},
|
|
632
628
|
function(testPath) { // Ignore common build artifacts
|
|
633
629
|
return /\.(log|lock|tmp)$/.test(testPath);
|
|
630
|
+
},
|
|
631
|
+
function(testPath) { // Ignore common directories
|
|
632
|
+
return /(^|\/)((node_modules|\.git|dist|build|coverage|\.next|\.nuxt|\.output|out|target)(\/|$))/.test(testPath);
|
|
634
633
|
}
|
|
635
634
|
];
|
|
636
635
|
if (options.ignore) {
|
|
@@ -642,7 +641,12 @@ GibRuns.start = function(options) {
|
|
|
642
641
|
// Setup file watcher
|
|
643
642
|
GibRuns.watcher = chokidar.watch(watchPaths, {
|
|
644
643
|
ignored: ignored,
|
|
645
|
-
ignoreInitial: true
|
|
644
|
+
ignoreInitial: true,
|
|
645
|
+
ignorePermissionErrors: true,
|
|
646
|
+
awaitWriteFinish: {
|
|
647
|
+
stabilityThreshold: 100,
|
|
648
|
+
pollInterval: 50
|
|
649
|
+
}
|
|
646
650
|
});
|
|
647
651
|
function handleChange(changePath) {
|
|
648
652
|
GibRuns.reloadCount++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gib-runs",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
4
4
|
"description": "Modern development server with live reload, hot module replacement, and advanced features for all project types - runs on merit, not nepotism",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"development",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"compression": "^1.7.4",
|
|
29
29
|
"connect": "^3.7.0",
|
|
30
30
|
"cors": "^2.8.5",
|
|
31
|
-
"dotenv": "^16.
|
|
31
|
+
"dotenv": "^16.6.1",
|
|
32
32
|
"event-stream": "^4.0.1",
|
|
33
33
|
"faye-websocket": "^0.11.4",
|
|
34
34
|
"http-auth": "^4.2.0",
|
|
35
35
|
"localtunnel": "^2.0.2",
|
|
36
36
|
"morgan": "^1.10.0",
|
|
37
|
-
"multer": "^
|
|
37
|
+
"multer": "^2.0.2",
|
|
38
38
|
"object-assign": "^4.1.1",
|
|
39
39
|
"open": "^8.4.2",
|
|
40
40
|
"ora": "^5.4.1",
|