neex 0.1.8 → 0.2.6
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/README.md +72 -238
- package/bun.lock +669 -0
- package/dist/src/cli.js +457 -24
- package/dist/src/index.js +1 -3
- package/dist/src/logger.js +0 -36
- package/dist/src/process-manager.js +146 -607
- package/dist/src/runner.js +78 -112
- package/package.json +7 -5
- package/dist/src/commands/dev-commands.js +0 -190
- package/dist/src/commands/index.js +0 -21
- package/dist/src/commands/process-commands.js +0 -679
- package/dist/src/commands/run-commands.js +0 -87
- package/dist/src/commands/server-commands.js +0 -50
- package/dist/src/dev-runner.js +0 -209
- package/dist/src/utils.js +0 -10
- package/dist/src/watcher.js +0 -245
- package/feet.txt +0 -16
package/README.md
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://github.com/Neexjs">
|
|
3
|
-
<picture>
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://neex.storage.c2.liara.space/Neex.png">
|
|
5
|
-
<img alt="Neex logo" src="https://neex.storage.c2.liara.space/Neex.png" height="150" style="border-radius: 12px;">
|
|
6
|
-
</picture>
|
|
7
|
-
</a>
|
|
8
|
-
|
|
9
|
-
# Neex v0.1.8
|
|
1
|
+
# Neex v0.2.6
|
|
10
2
|
|
|
11
3
|
### 🚀 Neex: The Modern Build System for Polyrepo-in-Monorepo Architecture
|
|
12
4
|
|
|
@@ -14,18 +6,17 @@
|
|
|
14
6
|
[](https://www.npmjs.com/package/neex)
|
|
15
7
|
[](https://github.com/neexjs/blob/main/LICENSE)
|
|
16
8
|
[](https://github.com/Neexjs)
|
|
17
|
-
</div>
|
|
18
9
|
|
|
19
10
|
## 🎯 Overview
|
|
20
11
|
|
|
21
12
|
next + express = neex 🌱
|
|
22
13
|
|
|
23
|
-
Neex is a modern build system
|
|
14
|
+
Neex is a modern build system designed to bridge the gap between polyrepo and monorepo architectures. It provides powerful script execution capabilities with features like parallel processing, colored output, and intelligent build orchestration. Whether you're managing a complex monorepo or coordinating multiple repositories, neex makes your development workflow more efficient and visually organized.
|
|
24
15
|
|
|
25
16
|
## ✨ Key Features
|
|
26
17
|
|
|
27
18
|
- 🎨 **Colored Output** - Distinguish commands with unique colors
|
|
28
|
-
- ⚡ **Dual Execution Modes** - Run commands in parallel (`
|
|
19
|
+
- ⚡ **Dual Execution Modes** - Run commands in parallel (`p`) or sequence (`s`)
|
|
29
20
|
- ⏱️ **Smart Timing** - Track execution time for each command
|
|
30
21
|
- 🛑 **Error Control** - Stop on first error (perfect for CI/CD)
|
|
31
22
|
- 🔢 **Parallel Control** - Limit concurrent processes with `--max-parallel`
|
|
@@ -34,24 +25,7 @@ Neex is a modern build system and script runner designed for **Polyrepo-in-Monor
|
|
|
34
25
|
- 🤫 **Flexible Display** - Control prefixes, timing, and output visibility
|
|
35
26
|
- 🧰 **Node.js API** - Programmatic usage in your applications
|
|
36
27
|
|
|
37
|
-
##
|
|
38
|
-
|
|
39
|
-
Install Neex globally to use it anywhere, or locally in your project.
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
# Global install
|
|
43
|
-
npm install -g neex
|
|
44
|
-
|
|
45
|
-
# Local install
|
|
46
|
-
npm install --save-dev neex # npm
|
|
47
|
-
yarn add --dev neex # yarn
|
|
48
|
-
pnpm add --save-dev neex # pnpm
|
|
49
|
-
bun add --dev neex # bun
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
When installed locally, you can run Neex commands using `npx neex ...` or by adding them to your `package.json` scripts.
|
|
53
|
-
|
|
54
|
-
## 🖥️ Usage
|
|
28
|
+
## ⚡ Quick Start
|
|
55
29
|
|
|
56
30
|
```bash
|
|
57
31
|
# Global install
|
|
@@ -66,155 +40,58 @@ bun add -D neex # bun
|
|
|
66
40
|
|
|
67
41
|
## 🖥️ Usage
|
|
68
42
|
|
|
69
|
-
###
|
|
70
|
-
|
|
71
|
-
Neex provides several commands to manage and run your scripts:
|
|
72
|
-
|
|
73
|
-
- **`px <commands...>`** (*default command*)
|
|
74
|
-
- Runs specified commands in **parallel** by default.
|
|
75
|
-
- Use the `-q` or `--sequential` flag to run them sequentially.
|
|
76
|
-
- Ideal for build steps, tests, or any tasks that can run concurrently.
|
|
77
|
-
|
|
78
|
-
- **`run <commands...>`** (alias: `s`)
|
|
79
|
-
- Runs specified commands **sequentially**.
|
|
80
|
-
- Useful for tasks that depend on the completion of previous ones (e.g., build then deploy).
|
|
81
|
-
|
|
82
|
-
- **`servers <commands...>`** (alias: `srv`)
|
|
83
|
-
- Optimized for running multiple development **servers** (e.g., backend API, frontend app) in parallel.
|
|
84
|
-
- Provides grouped and clear output for each server, making it easy to monitor logs.
|
|
85
|
-
- Detects and displays server ports and URLs.
|
|
86
|
-
|
|
87
|
-
- **`watch <commands...>`** (alias: `w`)
|
|
88
|
-
- Runs commands and **watches for file changes** to automatically restart them (Nodemon-like functionality).
|
|
89
|
-
- Highly configurable with options for watched paths, ignored patterns, extensions, and restart delays.
|
|
90
|
-
- Perfect for development workflows where you need instant feedback on code changes.
|
|
91
|
-
|
|
92
|
-
- **Process Management Commands**
|
|
93
|
-
- Neex provides built-in process management capabilities, similar to PM2, for long-running applications. These commands operate directly under `neex`:
|
|
94
|
-
- **`start <script_path_or_command> [--name <name>] [--watch] [-- <args...>]`**: Start a new process.
|
|
95
|
-
- **`stop <name_or_id>`**: Stop a running process.
|
|
96
|
-
- **`restart <name_or_id>`**: Restart a running process.
|
|
97
|
-
- **`delete <name_or_id>`**: Stop and delete a process from the list.
|
|
98
|
-
- **`list`** (aliases: `ls`, `status`): List all managed processes.
|
|
99
|
-
- **`logs [name_or_id] [--lines <number>] [--follow]`**: Display logs for a specific process or all if no ID is given.
|
|
100
|
-
- **`monit`**: Launch a monitoring interface for all managed processes.
|
|
101
|
-
- **`save`**: Save the current list of running processes.
|
|
102
|
-
- **`resurrect`**: Restart processes that were previously saved.
|
|
103
|
-
- **`startup`**: Generate a sample startup script (e.g., for systemd).
|
|
104
|
-
|
|
105
|
-
### General Command Examples
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
# Parallel execution (default behavior for px)
|
|
109
|
-
neex px "npm run build:api" "npm run build:frontend" "npm run lint"
|
|
110
|
-
# px is the command for parallel execution
|
|
111
|
-
neex px "npm run test:unit" "npm run test:integration"
|
|
112
|
-
|
|
113
|
-
# Sequential execution
|
|
114
|
-
neex run "npm run clean" "npm run build" "npm run deploy"
|
|
115
|
-
# Alias for sequential
|
|
116
|
-
neex s "echo First" "echo Second" "echo Third"
|
|
117
|
-
|
|
118
|
-
# Run 'px' commands sequentially using the -q flag
|
|
119
|
-
neex px -q "npm run step1" "npm run step2"
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### `servers` Command Examples
|
|
43
|
+
### Process Management Commands
|
|
123
44
|
|
|
124
45
|
```bash
|
|
125
|
-
# Start
|
|
126
|
-
neex
|
|
46
|
+
# Start a process
|
|
47
|
+
neex startx app.js -n "my-app" -w
|
|
127
48
|
|
|
128
|
-
#
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
# Watch for changes in './src' and restart 'npm run build'
|
|
136
|
-
neex watch "npm run build" -w ./src
|
|
49
|
+
# startx options
|
|
50
|
+
-n, --name <name> Process name
|
|
51
|
+
-w, --watch Watch for file changes
|
|
52
|
+
-r, --max-restarts <number> Maximum restart attempts
|
|
53
|
+
-d, --restart-delay <ms> Delay between restarts
|
|
137
54
|
|
|
138
|
-
#
|
|
139
|
-
neex
|
|
55
|
+
# Stop a process
|
|
56
|
+
neex stopx <process-id>
|
|
140
57
|
|
|
141
|
-
#
|
|
142
|
-
neex
|
|
58
|
+
# List processes
|
|
59
|
+
neex list
|
|
60
|
+
neex list -a # Show all processes
|
|
61
|
+
neex list -j # JSON output
|
|
62
|
+
|
|
63
|
+
# Monitor process
|
|
64
|
+
neex monit <process-id>
|
|
65
|
+
neex monit <process-id> -i 1000 # Set update interval
|
|
66
|
+
|
|
67
|
+
# View logs
|
|
68
|
+
neex log <process-id>
|
|
69
|
+
neex log <process-id> -f # Follow logs
|
|
70
|
+
neex log <process-id> -e # Show only errors
|
|
71
|
+
neex log <process-id> -w # Show only warnings
|
|
143
72
|
```
|
|
144
73
|
|
|
145
|
-
###
|
|
74
|
+
### Script Execution Commands
|
|
146
75
|
|
|
147
76
|
```bash
|
|
148
|
-
#
|
|
149
|
-
neex
|
|
150
|
-
|
|
151
|
-
# Start an app and watch for file changes
|
|
152
|
-
neex start api/index.js --name my-api --watch
|
|
153
|
-
|
|
154
|
-
# List all running processes managed by neex
|
|
155
|
-
neex list
|
|
156
|
-
|
|
157
|
-
# View logs for 'my-app'
|
|
158
|
-
neex logs my-app
|
|
159
|
-
|
|
160
|
-
# Stop 'my-api'
|
|
161
|
-
neex stop my-api
|
|
162
|
-
|
|
163
|
-
# Restart 'my-app'
|
|
164
|
-
neex restart my-app
|
|
77
|
+
# Sequential execution
|
|
78
|
+
neex s "npm install" "npm run build"
|
|
165
79
|
|
|
166
|
-
#
|
|
167
|
-
neex
|
|
80
|
+
# Parallel execution
|
|
81
|
+
neex p "npm run dev" "npm run watch"
|
|
168
82
|
```
|
|
169
83
|
|
|
170
|
-
### 🛠️
|
|
171
|
-
|
|
172
|
-
These options can be used with `run`, `px`, and `servers` commands:
|
|
173
|
-
|
|
174
|
-
| Flag | Alias | Description | Default |
|
|
175
|
-
|--------------------------|-------|---------------------------------------------------|----------------|
|
|
176
|
-
| `--no-color` | `-c` | Disable colored output | `true` (color on) |
|
|
177
|
-
| `--no-timing` | `-t` | Hide timing information for each command | `true` (timing on) |
|
|
178
|
-
| `--no-prefix` | `-p` | Hide command prefix in output | `true` (prefix on) |
|
|
179
|
-
| `--stop-on-error` | `-s` | Stop all further execution if a command fails | `false` |
|
|
180
|
-
| `--no-output` | `-o` | Hide all `stdout` and `stderr` from commands | `true` (output on) |
|
|
181
|
-
| `--minimal` | | Use minimal output format (less verbose) | `false` |
|
|
182
|
-
| `--max-parallel <number>`| | Maximum number of commands to run in parallel | CPU count |
|
|
183
|
-
| `--sequential` | `-q` | (For `px`) Run commands sequentially instead of parallel | `false` |
|
|
184
|
-
| `--retry <count>` | | Number of times to retry a failed command | `0` |
|
|
185
|
-
| `--retry-delay <ms>` | | Delay in milliseconds between retries | `1000` |
|
|
186
|
-
| `--group-output` | `-g` | (For `servers`) Group output by server | `false` |
|
|
187
|
-
|
|
188
|
-
### `watch` Command Options
|
|
189
|
-
|
|
190
|
-
| Flag | Alias | Description | Default |
|
|
191
|
-
|-----------------------------|-------|------------------------------------------------------|--------------------------------------------|
|
|
192
|
-
| `--watch <paths...>` | `-w` | Paths/glob patterns to watch | `['./']` |
|
|
193
|
-
| `--ignore <patterns...>` | `-i` | Paths/glob patterns to ignore | `['node_modules/**', '.git/**', ...]` |
|
|
194
|
-
| `--ext <extensions...>` | `-e` | File extensions to watch | `['js', 'mjs', 'json', 'ts', 'tsx', 'jsx']`|
|
|
195
|
-
| `--delay <ms>` | `-d` | Delay in milliseconds before restarting after a change | `1000` |
|
|
196
|
-
| `--clear` | | Clear console on restart | `false` |
|
|
197
|
-
| `--verbose` | | Show verbose output from the watcher | `false` |
|
|
198
|
-
| `--signal <signal>` | | Signal to send to processes on restart | `SIGTERM` |
|
|
199
|
-
| *Global options also apply* | | `no-color`, `no-timing`, etc. | |
|
|
200
|
-
|
|
201
|
-
### `start` Command Options
|
|
202
|
-
|
|
203
|
-
| Flag | Description | Default |
|
|
204
|
-
|-----------------------------|--------------------------------------------------|-----------|
|
|
205
|
-
| `--name <name>` | Specify a name for the process | Script name |
|
|
206
|
-
| `--watch` | Enable file watching and auto-restart | `false` |
|
|
207
|
-
| `--ignore-watch <paths...>` | Paths/patterns to ignore when watching | |
|
|
208
|
-
| `--watch-delay <ms>` | Delay for watch restarts | `1000` |
|
|
209
|
-
| `-- <args...>` | Arguments to pass to the script | |
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
### Advanced Example
|
|
84
|
+
### 🛠️ Options
|
|
213
85
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
86
|
+
| Flag | Alias | Description | Default |
|
|
87
|
+
|------|-------|-------------|----------|
|
|
88
|
+
| `--no-color` | `-c` | Disable colors | `false` |
|
|
89
|
+
| `--no-timing` | `-t` | Hide timing | `false` |
|
|
90
|
+
| `--no-prefix` | `-p` | Hide prefixes | `false` |
|
|
91
|
+
| `--stop-on-error` | `-s` | Stop on failure | `false` |
|
|
92
|
+
| `--no-output` | `-o` | Hide all output | `false` |
|
|
93
|
+
| `--max-parallel` | `-m` | Max parallel tasks | CPU count |
|
|
94
|
+
| `--sequential` | `-q` | Force sequential | `false` |
|
|
218
95
|
|
|
219
96
|
## 📦 Node.js API
|
|
220
97
|
|
|
@@ -244,41 +121,6 @@ async function main() {
|
|
|
244
121
|
}
|
|
245
122
|
```
|
|
246
123
|
|
|
247
|
-
### API Options (`RunOptions`)
|
|
248
|
-
|
|
249
|
-
When using Neex programmatically, you can pass an options object to the `run` function:
|
|
250
|
-
|
|
251
|
-
```typescript
|
|
252
|
-
export interface RunOptions {
|
|
253
|
-
// Run in parallel or sequentially
|
|
254
|
-
parallel: boolean;
|
|
255
|
-
// Maximum number of parallel processes (default: CPU count)
|
|
256
|
-
maxParallel?: number;
|
|
257
|
-
// Show command output (default: true)
|
|
258
|
-
printOutput: boolean;
|
|
259
|
-
// Color output (default: true)
|
|
260
|
-
color: boolean;
|
|
261
|
-
// Show timing information (default: true)
|
|
262
|
-
showTiming: boolean;
|
|
263
|
-
// Show command prefix (default: true)
|
|
264
|
-
prefix: boolean;
|
|
265
|
-
// Stop on error (default: false)
|
|
266
|
-
stopOnError: boolean;
|
|
267
|
-
// Use minimal output format (default: false)
|
|
268
|
-
minimalOutput: boolean;
|
|
269
|
-
// Group output by command (default: false, mainly for server mode)
|
|
270
|
-
groupOutput: boolean;
|
|
271
|
-
// Use server mode formatting (default: false)
|
|
272
|
-
isServerMode: boolean;
|
|
273
|
-
// Number of times to retry a failed command (default: 0)
|
|
274
|
-
retry?: number;
|
|
275
|
-
// Delay in milliseconds between retries (default: 1000)
|
|
276
|
-
retryDelay?: number;
|
|
277
|
-
// Callback to register a cleanup function, called on SIGINT/SIGTERM
|
|
278
|
-
registerCleanup?: (cleanupFn: () => void) => void;
|
|
279
|
-
}
|
|
280
|
-
```
|
|
281
|
-
|
|
282
124
|
## 🔄 CI/CD Integration
|
|
283
125
|
|
|
284
126
|
```yaml
|
|
@@ -291,55 +133,47 @@ steps:
|
|
|
291
133
|
run: neex p -s -m 4 "npm run lint" "npm test" "npm run e2e"
|
|
292
134
|
```
|
|
293
135
|
|
|
294
|
-
## 💡 Real-world
|
|
295
|
-
|
|
296
|
-
Neex shines when integrated into your `package.json` scripts.
|
|
136
|
+
## 💡 Real-world Examples
|
|
297
137
|
|
|
298
|
-
|
|
138
|
+
### Multi-part Project Execution
|
|
299
139
|
|
|
300
140
|
```json
|
|
301
141
|
{
|
|
302
142
|
"scripts": {
|
|
303
|
-
"dev
|
|
304
|
-
"dev:
|
|
305
|
-
"dev": "
|
|
306
|
-
|
|
307
|
-
"build:
|
|
308
|
-
"build:
|
|
309
|
-
"
|
|
310
|
-
|
|
311
|
-
"
|
|
312
|
-
"test:unit": "jest",
|
|
313
|
-
"test:e2e": "playwright test",
|
|
314
|
-
|
|
315
|
-
"lint": "eslint .",
|
|
316
|
-
"format": "prettier --write .",
|
|
317
|
-
"check-all": "neex p \"npm run lint\" \"npm run format -- --check\" \"npm run test\"",
|
|
318
|
-
|
|
319
|
-
"start:prod": "neex pm2 start dist/server.js --name my-prod-app",
|
|
320
|
-
"watch:build": "neex watch \"npm run build:app\" -w packages/main-app/src -e ts,tsx"
|
|
143
|
+
"dev": "neex p dev:client dev:server",
|
|
144
|
+
"dev:client": "cd apps/client && npm run dev",
|
|
145
|
+
"dev:server": "cd apps/server && npm run dev",
|
|
146
|
+
"build": "neex s build:client build:server",
|
|
147
|
+
"build:client": "cd apps/client && npm run build",
|
|
148
|
+
"build:server": "cd apps/server && npm run build",
|
|
149
|
+
"start": "neex p start:client start:server",
|
|
150
|
+
"start:client": "cd apps/client && npm run start",
|
|
151
|
+
"start:server": "cd apps/server && npm run start"
|
|
321
152
|
}
|
|
322
153
|
}
|
|
323
154
|
```
|
|
324
155
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
```bash
|
|
328
|
-
# Start all development servers with grouped output
|
|
329
|
-
npm run dev
|
|
330
|
-
|
|
331
|
-
# Build UI library and main application in parallel
|
|
332
|
-
npm run build
|
|
156
|
+
### Production Project Management
|
|
333
157
|
|
|
334
|
-
|
|
335
|
-
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"scripts": {
|
|
161
|
+
"startx": "neex startx:client && neex startx:server",
|
|
162
|
+
"startx:client": "neex startx apps/client/index.js -n client -w",
|
|
163
|
+
"startx:server": "neex startx apps/server/index.js -n server -w",
|
|
164
|
+
"stopx": "neex stopx:client && neex stopx:server",
|
|
165
|
+
"stopx:client": "neex stopx client",
|
|
166
|
+
"stopx:server": "neex stopx server"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
336
170
|
|
|
337
|
-
|
|
338
|
-
npm run start:prod
|
|
171
|
+
## Important Notes
|
|
339
172
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
173
|
+
- Logs are stored in the `.neex-logs` directory
|
|
174
|
+
- Configuration is stored in `.neex-config.json`
|
|
175
|
+
- Use `Ctrl+C` to stop live monitoring
|
|
176
|
+
- Use `neex stopx -f` for force stop when needed
|
|
343
177
|
|
|
344
178
|
## 🤝 Contributing
|
|
345
179
|
|