neex 0.6.99 β 0.7.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/README.md +224 -355
- package/dist/src/cli-init.js +1 -0
- package/package.json +19 -10
package/README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
<div align="center">
|
|
2
3
|
<a href="https://github.com/Neexjs">
|
|
3
4
|
<picture>
|
|
@@ -6,9 +7,10 @@
|
|
|
6
7
|
</picture>
|
|
7
8
|
</a>
|
|
8
9
|
|
|
9
|
-
# Neex v0.
|
|
10
|
+
# Neex v0.7.1
|
|
11
|
+
|
|
12
|
+
### Neex - Modern Fullstack Framework Built on Express and Next.js. Fast to Start, Easy to Build, Ready to Deploy.
|
|
10
13
|
|
|
11
|
-
### π Neex: The Modern Build System for Polyrepo-in-Monorepo Architecture
|
|
12
14
|
|
|
13
15
|
[](https://www.npmjs.com/package/neex)
|
|
14
16
|
[](https://www.npmjs.com/package/neex)
|
|
@@ -16,475 +18,342 @@
|
|
|
16
18
|
[](https://github.com/Neexjs)
|
|
17
19
|
</div>
|
|
18
20
|
|
|
19
|
-
## π― Overview
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Neex is a modern build system and script runner designed for **Polyrepo-in-Monorepo** architectures, but powerful enough for any project. It simplifies managing and running multiple scripts across your project, whether they are microservices, frontend applications, or build tasks. Neex offers robust features like parallel and sequential execution, live-reloading for development (`watch`), optimized server running (`servers`), and even basic process management (`pm2`-like commands), all aimed at making your development workflow more efficient, organized, and visually clear.
|
|
22
|
+
## π― Overview
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
**Neex = nextjs + express π±**
|
|
26
25
|
|
|
27
|
-
- π¨ **Colored Output** - Distinguish commands with unique colors
|
|
28
|
-
- β‘ **Dual Execution Modes** - Run commands in parallel (`px`) or sequence (`s`, `run`)
|
|
29
|
-
- β±οΈ **Smart Timing** - Track execution time for each command
|
|
30
|
-
- π **Error Control** - Stop on first error (perfect for CI/CD)
|
|
31
|
-
- π’ **Parallel Control** - Limit concurrent processes with `--max-parallel`
|
|
32
|
-
- π» **Clean Output** - Structured and readable command output
|
|
33
|
-
- π‘οΈ **Safe Shutdown** - Graceful process termination on interrupt
|
|
34
|
-
- π€« **Flexible Display** - Control prefixes, timing, and output visibility
|
|
35
|
-
- π§° **Node.js API** - Programmatic usage in your applications
|
|
36
26
|
|
|
37
|
-
|
|
27
|
+
**Neex: A Powerful Fusion of Next.js and Express for Fullstack Development**
|
|
38
28
|
|
|
39
|
-
|
|
29
|
+
**Neex** is a modern and advanced fullstack framework that combines **Next.js** and **Express** to deliver an exceptional development experience. Designed for speed, simplicity, and scalability, Neex empowers developers to effortlessly build and deploy robust, high-performance applications.
|
|
40
30
|
|
|
41
|
-
|
|
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
|
-
```
|
|
31
|
+
## β¨ Why Choose Neex?
|
|
51
32
|
|
|
52
|
-
|
|
33
|
+
Unlock the full potential of your fullstack projects with Neexβs powerful features, tailored for modern web development:
|
|
53
34
|
|
|
54
|
-
|
|
35
|
+
* ποΈ **Fullstack Architecture**: Independent codebases for **frontend (Next.js)** and **backend (Express)** with isolated dependencies for maximum flexibility.
|
|
36
|
+
* π **Monorepo Workflow**: Enjoy the simplicity of a single repository with clear separation between frontend and backend domains.
|
|
37
|
+
* β‘ **Zero Configuration**: Out-of-the-box setup for **TypeScript**, **Prisma**, and **environment variable management** for instant development readiness.
|
|
38
|
+
* π οΈ **Production-Ready**: Built-in best practices for performance, scalability, and reliability at an enterprise level.
|
|
39
|
+
* π¦ **Isolated Dependencies**: Each part of the stack has its own `package.json` to ensure modular and scalable development.
|
|
40
|
+
* π§© **Separation of Concerns**: Clearly divided frontend and backend logic leads to cleaner, more maintainable codebases.
|
|
41
|
+
* π **Secure Environment Management**: Built-in support for `dotenv` to handle environment variables safely and efficiently.
|
|
42
|
+
* π **Database Integration**: Native support for **Prisma ORM** enables fast, type-safe, and efficient database development.
|
|
43
|
+
* π οΈ **Powerful CLI**: Intuitive CLI commands to simplify development, building, and deployment workflows.
|
|
55
44
|
|
|
56
|
-
|
|
57
|
-
# Global install
|
|
58
|
-
npm i -g neex
|
|
59
|
-
|
|
60
|
-
# Local install
|
|
61
|
-
npm i -D neex # npm
|
|
62
|
-
yarn add -D neex # yarn
|
|
63
|
-
pnpm add -D neex # pnpm
|
|
64
|
-
bun add -D neex # bun
|
|
65
|
-
```
|
|
45
|
+
With these features, **Neex** is the ideal choice for developers seeking a fullstack framework thatβs **SEO-optimized, scalable, efficient, and developer-friendly**. Start building high-performance web applications today with Neexβs robust toolset and clean architecture.
|
|
66
46
|
|
|
67
|
-
## π₯οΈ Usage
|
|
68
47
|
|
|
69
|
-
### Core Commands
|
|
70
48
|
|
|
71
|
-
|
|
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
|
|
49
|
+
## π Quick Start
|
|
106
50
|
|
|
107
|
-
|
|
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"
|
|
51
|
+
### Create a New Neex Project β Step-by-Step
|
|
112
52
|
|
|
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
53
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
54
|
+
1. **Run one of the creation commands**:
|
|
55
|
+
```bash
|
|
56
|
+
npx neex init
|
|
57
|
+
# or
|
|
58
|
+
npx create-neex
|
|
59
|
+
```
|
|
121
60
|
|
|
122
|
-
|
|
61
|
+
2. **Enter your project name** (e.g., `my-awesome-project`).
|
|
123
62
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
63
|
+
3. **Select your package manager**:
|
|
64
|
+
- npm
|
|
65
|
+
- yarn
|
|
66
|
+
- pnpm
|
|
67
|
+
- bun
|
|
127
68
|
|
|
128
|
-
|
|
129
|
-
neex servers --group-output "npm run dev:service-a" "npm run dev:service-b"
|
|
130
|
-
```
|
|
69
|
+
4. **Wait for the project structure to be created** automatically.
|
|
131
70
|
|
|
132
|
-
|
|
71
|
+
5. **Install dependencies**:
|
|
72
|
+
```bash
|
|
73
|
+
cd my-project
|
|
74
|
+
npm install # or yarn, pnpm install, bun install
|
|
75
|
+
```
|
|
133
76
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
77
|
+
6. **Start development**:
|
|
78
|
+
```bash
|
|
79
|
+
npm run dev # or yarn dev, pnpm dev, bun dev
|
|
80
|
+
```
|
|
137
81
|
|
|
138
|
-
|
|
139
|
-
|
|
82
|
+
7. **Access your project**:
|
|
83
|
+
- client: `http://localhost:3000`
|
|
84
|
+
- server: `http://localhost:8000`
|
|
140
85
|
|
|
141
|
-
|
|
142
|
-
neex watch "node server.js" --clear --delay 1500
|
|
143
|
-
```
|
|
86
|
+
## π₯οΈ CLI Commands
|
|
144
87
|
|
|
145
|
-
|
|
88
|
+
Neex provides a powerful CLI with commands tailored for development, building, and production deployment.
|
|
146
89
|
|
|
147
|
-
|
|
148
|
-
# Start a Node.js app and give it a name
|
|
149
|
-
neex start server.js --name my-app
|
|
90
|
+
### Core Commands
|
|
150
91
|
|
|
151
|
-
|
|
152
|
-
neex
|
|
92
|
+
- **`neex init`**: Initializes a new Neex project using `create-neex`.
|
|
93
|
+
- **`neex dev [file]`**: Starts a fast TypeScript development server with live-reloading.
|
|
94
|
+
- **`neex build [source]`**: Compiles TypeScript projects for production.
|
|
95
|
+
- **`neex start [file]`**: Starts a production-ready application with process management (PM2-like).
|
|
96
|
+
- **`neex p <commands...>`** (aliases: `par`, `parallel`): Runs commands in parallel.
|
|
97
|
+
- **`neex s <commands...>`** (aliases: `seq`, `sequential`): Runs commands sequentially.
|
|
98
|
+
- **`neex dev:clean`**: Cleans development cache and temporary files.
|
|
99
|
+
- **`neex dev:check`**: Validates TypeScript configuration.
|
|
100
|
+
- **`neex dev:info`**: Displays development server information.
|
|
153
101
|
|
|
154
|
-
|
|
155
|
-
neex list
|
|
102
|
+
### Command Examples
|
|
156
103
|
|
|
157
|
-
|
|
158
|
-
neex logs my-app
|
|
104
|
+
#### Development (`dev` Command)
|
|
159
105
|
|
|
160
|
-
|
|
161
|
-
neex stop my-api
|
|
106
|
+
The `dev` command provides a fast, live-reloading development environment.
|
|
162
107
|
|
|
163
|
-
|
|
164
|
-
|
|
108
|
+
```bash
|
|
109
|
+
# Start development server for a TypeScript file
|
|
110
|
+
neex dev src/index.ts
|
|
165
111
|
|
|
166
|
-
#
|
|
167
|
-
neex
|
|
168
|
-
```
|
|
112
|
+
# Watch specific directories
|
|
113
|
+
neex dev --watch src,public "npm run dev"
|
|
169
114
|
|
|
170
|
-
|
|
115
|
+
# Ignore patterns
|
|
116
|
+
neex dev --ignore "*.log,dist/**" "node server.js"
|
|
171
117
|
|
|
172
|
-
|
|
118
|
+
# Specify file extensions
|
|
119
|
+
neex dev --ext ts,tsx,js "npm run dev"
|
|
173
120
|
|
|
174
|
-
|
|
121
|
+
# Ultra-fast mode with 50ms delay
|
|
122
|
+
neex dev --fast "npm run dev"
|
|
123
|
+
```
|
|
175
124
|
|
|
176
|
-
|
|
125
|
+
#### Building (`build` Command)
|
|
177
126
|
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
neex dev # runs: npm run dev
|
|
181
|
-
```
|
|
127
|
+
Compile TypeScript projects for production.
|
|
182
128
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
```
|
|
129
|
+
```bash
|
|
130
|
+
# Build project from src to dist
|
|
131
|
+
neex build
|
|
187
132
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
neex dev # runs: node main.js (for JavaScript)
|
|
191
|
-
neex dev # runs: npx ts-node main.ts (for TypeScript)
|
|
192
|
-
```
|
|
133
|
+
# Build with source maps and watch mode
|
|
134
|
+
neex build src --sourcemap --watch
|
|
193
135
|
|
|
194
|
-
|
|
136
|
+
# Quick compilation
|
|
137
|
+
neex compile src
|
|
138
|
+
```
|
|
195
139
|
|
|
196
|
-
|
|
140
|
+
#### Production (`start` Command)
|
|
197
141
|
|
|
198
|
-
|
|
199
|
-
# JavaScript file
|
|
200
|
-
neex dev app.js # runs: node app.js
|
|
142
|
+
Run production-ready applications with advanced process management.
|
|
201
143
|
|
|
202
|
-
# TypeScript file
|
|
203
|
-
neex dev server.ts # runs: npx ts-node server.ts
|
|
204
144
|
|
|
205
|
-
# ES modules
|
|
206
|
-
neex dev index.mjs
|
|
207
145
|
|
|
208
|
-
# CommonJS TypeScript
|
|
209
|
-
neex dev main.cts
|
|
210
|
-
```
|
|
211
146
|
|
|
212
|
-
#### 3. Package Manager Scripts
|
|
213
147
|
|
|
214
|
-
Run npm/yarn/pnpm scripts:
|
|
215
148
|
|
|
216
149
|
```bash
|
|
217
|
-
#
|
|
218
|
-
neex
|
|
219
|
-
neex dev "npm run start"
|
|
220
|
-
neex dev "npm run build"
|
|
221
|
-
|
|
222
|
-
# yarn scripts
|
|
223
|
-
neex dev "yarn dev"
|
|
224
|
-
neex dev "yarn start"
|
|
225
|
-
|
|
226
|
-
# pnpm scripts
|
|
227
|
-
neex dev "pnpm dev"
|
|
228
|
-
neex dev "pnpm start"
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
#### 4. System Commands
|
|
150
|
+
# Start production server
|
|
151
|
+
neex start dist/server.js
|
|
232
152
|
|
|
233
|
-
|
|
153
|
+
# Start with multiple workers
|
|
154
|
+
neex start dist/server.js --workers 4
|
|
234
155
|
|
|
235
|
-
|
|
236
|
-
neex
|
|
237
|
-
neex dev "php server.php"
|
|
238
|
-
neex dev "go run main.go"
|
|
239
|
-
neex dev "cargo run"
|
|
240
|
-
neex dev "dotnet run"
|
|
156
|
+
# Enable health check endpoint
|
|
157
|
+
neex start dist/server.js --health-port 3001
|
|
241
158
|
```
|
|
242
159
|
|
|
243
|
-
#### 5. Configuration Options
|
|
244
160
|
|
|
245
|
-
|
|
161
|
+
Below is an example of `package.json` scripts for running two projects (frontend and backend) concurrently, along with ORM (Prisma) integration, tailored for a Neex project with a polyrepo-in-monorepo architecture. This example demonstrates how to use Neex commands to manage development, building, and production workflows efficiently.
|
|
246
162
|
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"scripts": {
|
|
166
|
+
"dev": "neex p dev:client dev:server",
|
|
167
|
+
"dev:client": "cd apps/client && bun run dev",
|
|
168
|
+
"dev:server": "cd apps/server && bun run dev",
|
|
169
|
+
"build": "neex s prisma:generate prisma:migrate build:client build:server",
|
|
170
|
+
"build:client": "cd apps/client && bun run build",
|
|
171
|
+
"build:server": "cd apps/server && bun run build",
|
|
172
|
+
"start": "neex p start:client start:server",
|
|
173
|
+
"start:client": "cd apps/client && bun run start",
|
|
174
|
+
"start:server": "cd apps/server && bun run start",
|
|
175
|
+
"prisma:generate": "cd apps/server && bunx prisma generate",
|
|
176
|
+
"prisma:migrate": "cd apps/server && bunx prisma db push"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
250
180
|
|
|
251
|
-
|
|
252
|
-
neex dev --ignore "*.log" --ignore "temp/**" "node server.js"
|
|
181
|
+
### Explanation of Scripts
|
|
253
182
|
|
|
254
|
-
|
|
255
|
-
|
|
183
|
+
- **`dev`**: Uses `neex p` to run the frontend (`dev:client`) and backend (`dev:server`) development servers in parallel, leveraging Neex's ability to manage concurrent processes with clear output.
|
|
184
|
+
- **`dev:client`**: Runs the Next.js frontend development server in the `apps/client` directory using Bun.
|
|
185
|
+
- **`dev:server`**: Runs the Express backend development server in the `apps/server` directory using Bun.
|
|
186
|
+
- **`build`**: Uses `neex s` to sequentially execute Prisma-related tasks (`prisma:generate`, `prisma:migrate`) followed by building both the frontend (`build:client`) and backend (`build:server`) projects.
|
|
187
|
+
- **`build:client`**: Builds the Next.js frontend in the `apps/client` directory.
|
|
188
|
+
- **`build:server`**: Builds the Express backend in the `apps/server` directory.
|
|
189
|
+
- **`start`**: Uses `neex p` to start both the frontend (`start:client`) and backend (`start:server`) in production mode concurrently, utilizing Neex's advanced process management for clustering and health checks.
|
|
190
|
+
- **`start:client`**: Starts the Next.js frontend in production mode.
|
|
191
|
+
- **`start:server`**: Starts the Express backend in production mode.
|
|
192
|
+
- **`prisma:generate`**: Generates the Prisma client for the backend in `apps/server`.
|
|
193
|
+
- **`prisma:migrate`**: Applies Prisma database migrations in `apps/server`.
|
|
256
194
|
|
|
257
|
-
|
|
258
|
-
neex dev --delay 2000 "npm run dev"
|
|
195
|
+
### Running the Scripts
|
|
259
196
|
|
|
260
|
-
|
|
261
|
-
|
|
197
|
+
```bash
|
|
198
|
+
npm run dev # Starts frontend and backend development servers in parallel
|
|
199
|
+
npm run build # Sequentially generates Prisma client, applies migrations, and builds both projects
|
|
200
|
+
npm run start # Starts frontend and backend in production mode concurrently
|
|
201
|
+
```
|
|
262
202
|
|
|
263
|
-
|
|
264
|
-
neex dev --minimal "npm run dev"
|
|
203
|
+
Below is an example of `package.json` scripts for running two projects (frontend and backend) concurrently, along with ORM (Prisma) integration, tailored for a Neex project. This example demonstrates how to use Neex commands to manage development, building, and production workflows efficiently.
|
|
265
204
|
|
|
266
|
-
|
|
267
|
-
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"scripts": {
|
|
208
|
+
"dev": "neex p dev:client dev:server",
|
|
209
|
+
"dev:client": "cd apps/client && bun run dev",
|
|
210
|
+
"dev:server": "cd apps/server && bun run dev",
|
|
211
|
+
"build": "neex s prisma:generate prisma:migrate build:client build:server",
|
|
212
|
+
"build:client": "cd apps/client && bun run build",
|
|
213
|
+
"build:server": "cd apps/server && bun run build",
|
|
214
|
+
"start": "neex p start:client start:server",
|
|
215
|
+
"start:client": "cd apps/client && bun run start",
|
|
216
|
+
"start:server": "cd apps/server && bun run start",
|
|
217
|
+
"prisma:generate": "cd apps/server && bunx prisma generate",
|
|
218
|
+
"prisma:migrate": "cd apps/server && bunx prisma db push"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
268
222
|
|
|
269
|
-
# Disable timing display
|
|
270
|
-
neex dev --no-timing "npm run dev"
|
|
271
223
|
|
|
272
|
-
|
|
273
|
-
neex dev --stop-on-error "npm run test"
|
|
274
|
-
```
|
|
224
|
+
#### Parallel and Sequential Execution
|
|
275
225
|
|
|
276
|
-
|
|
226
|
+
Run multiple scripts efficiently.
|
|
277
227
|
|
|
278
228
|
```bash
|
|
279
|
-
#
|
|
280
|
-
neex
|
|
229
|
+
# Parallel execution
|
|
230
|
+
neex p "npm run build:frontend" "npm run build:backend"
|
|
281
231
|
|
|
282
|
-
#
|
|
283
|
-
neex
|
|
232
|
+
# Sequential execution
|
|
233
|
+
neex s "npm run clean" "npm run build" "npm run deploy"
|
|
284
234
|
|
|
285
|
-
#
|
|
286
|
-
neex
|
|
235
|
+
# Parallel with sequential flag
|
|
236
|
+
neex p -q "npm run step1" "npm run step2"
|
|
237
|
+
```
|
|
287
238
|
|
|
288
|
-
|
|
289
|
-
neex dev --watch app --ext js "node app.js"
|
|
239
|
+
## π Project Structure
|
|
290
240
|
|
|
291
|
-
|
|
292
|
-
neex dev --watch src --ext js,html "npm run electron"
|
|
241
|
+
Neex creates a polyrepo-in-monorepo structure for clear separation and scalability:
|
|
293
242
|
|
|
294
|
-
|
|
295
|
-
|
|
243
|
+
```
|
|
244
|
+
my-project/
|
|
245
|
+
βββ .env # Root environment variables
|
|
246
|
+
βββ apps/
|
|
247
|
+
β βββ client/ # Next.js frontend project
|
|
248
|
+
β β βββ src/
|
|
249
|
+
β β β βββ app/ # Next.js App Router
|
|
250
|
+
β β β βββ ...
|
|
251
|
+
β β βββ next.config.ts
|
|
252
|
+
β β βββ package.json # Frontend dependencies
|
|
253
|
+
β β βββ tsconfig.json
|
|
254
|
+
β βββ server/ # Express backend project
|
|
255
|
+
β βββ src/
|
|
256
|
+
β β βββ server.ts # Express server entry
|
|
257
|
+
β β βββ ...
|
|
258
|
+
β βββ package.json # Backend dependencies
|
|
259
|
+
β βββ tsconfig.json
|
|
260
|
+
βββ package.json # Root orchestration
|
|
261
|
+
βββ README.md
|
|
296
262
|
```
|
|
297
263
|
|
|
298
|
-
|
|
264
|
+
Each `apps/client` and `apps/server` directory is a fully independent project that can be extracted into its own repository if needed, while benefiting from a unified monorepo workflow.
|
|
299
265
|
|
|
300
|
-
|
|
301
|
-
# No command specified and no default script
|
|
302
|
-
neex dev
|
|
303
|
-
# Error: No command specified for 'neex dev' and no default script
|
|
266
|
+
## βοΈ Advanced Options
|
|
304
267
|
|
|
305
|
-
|
|
306
|
-
neex dev nonexistent.js
|
|
307
|
-
# Warning: File "nonexistent.js" not found. Attempting to run as command.
|
|
308
|
-
```
|
|
268
|
+
### `neex init`
|
|
309
269
|
|
|
310
|
-
|
|
270
|
+
```bash
|
|
271
|
+
# Create in current directory
|
|
272
|
+
npx create-neex@latest .
|
|
311
273
|
|
|
312
|
-
|
|
274
|
+
# Create with specific name
|
|
275
|
+
npx create-neex@latest my-project
|
|
313
276
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
neex p "npm run build:api" "npm run build:frontend" "npm run lint"
|
|
317
|
-
neex par "npm run test:unit" "npm run test:integration"
|
|
318
|
-
neex parallel "npm run test:frontend" "npm run test:backend"
|
|
277
|
+
# Enable debug mode
|
|
278
|
+
npx create-neex@latest my-project --debug
|
|
319
279
|
```
|
|
320
280
|
|
|
321
|
-
###
|
|
281
|
+
### `neex dev`
|
|
322
282
|
|
|
323
283
|
```bash
|
|
324
|
-
#
|
|
325
|
-
neex
|
|
326
|
-
neex seq "echo First" "echo Second" "echo Third"
|
|
327
|
-
neex sequential "npm run step1" "npm run step2" "npm run step3"
|
|
328
|
-
```
|
|
284
|
+
# Custom restart delay
|
|
285
|
+
neex dev --delay 2000 "npm run dev"
|
|
329
286
|
|
|
330
|
-
|
|
287
|
+
# Disable console clearing
|
|
288
|
+
neex dev --no-clear "node app.js"
|
|
331
289
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
neex p -q "npm run step1" "npm run step2"
|
|
335
|
-
neex par -q "npm run build" "npm run test"
|
|
336
|
-
neex parallel -q "npm run lint" "npm run format"
|
|
290
|
+
# Framework-specific example (Nest.js)
|
|
291
|
+
neex dev --watch src --ext ts "npm run start:dev"
|
|
337
292
|
```
|
|
338
293
|
|
|
339
|
-
###
|
|
294
|
+
### `neex build`
|
|
340
295
|
|
|
341
296
|
```bash
|
|
342
|
-
#
|
|
343
|
-
neex
|
|
297
|
+
# Custom output directory
|
|
298
|
+
neex build src --output build
|
|
344
299
|
|
|
345
|
-
#
|
|
346
|
-
neex
|
|
300
|
+
# Specify TypeScript target
|
|
301
|
+
neex build src --target es2022
|
|
347
302
|
|
|
348
|
-
#
|
|
349
|
-
neex
|
|
303
|
+
# Analyze bundle size
|
|
304
|
+
neex build src --analyze
|
|
350
305
|
```
|
|
351
306
|
|
|
352
|
-
###
|
|
307
|
+
### `neex start`
|
|
353
308
|
|
|
354
309
|
```bash
|
|
355
|
-
#
|
|
356
|
-
neex
|
|
357
|
-
```
|
|
310
|
+
# Custom port
|
|
311
|
+
neex start dist/server.js --port 8080
|
|
358
312
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
```javascript
|
|
362
|
-
import { run } from 'neex';
|
|
363
|
-
// or: const { run } = require('neex');
|
|
364
|
-
|
|
365
|
-
async function main() {
|
|
366
|
-
try {
|
|
367
|
-
// Sequential execution
|
|
368
|
-
await run(['echo Step 1', 'echo Step 2'], {
|
|
369
|
-
parallel: false,
|
|
370
|
-
stopOnError: true,
|
|
371
|
-
color: true
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
// Parallel execution (max 2)
|
|
375
|
-
await run(['npm test', 'npm run build'], {
|
|
376
|
-
parallel: true,
|
|
377
|
-
maxParallel: 2,
|
|
378
|
-
stopOnError: true
|
|
379
|
-
});
|
|
380
|
-
} catch (error) {
|
|
381
|
-
console.error('Failed:', error);
|
|
382
|
-
process.exit(1);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
```
|
|
313
|
+
# Enable Node.js inspector
|
|
314
|
+
neex start dist/server.js --inspect
|
|
386
315
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
When using Neex programmatically, you can pass an options object to the `run` function:
|
|
390
|
-
|
|
391
|
-
```typescript
|
|
392
|
-
export interface RunOptions {
|
|
393
|
-
// Run in parallel or sequentially
|
|
394
|
-
parallel: boolean;
|
|
395
|
-
// Maximum number of parallel processes (default: CPU count)
|
|
396
|
-
maxParallel?: number;
|
|
397
|
-
// Show command output (default: true)
|
|
398
|
-
printOutput: boolean;
|
|
399
|
-
// Color output (default: true)
|
|
400
|
-
color: boolean;
|
|
401
|
-
// Show timing information (default: true)
|
|
402
|
-
showTiming: boolean;
|
|
403
|
-
// Show command prefix (default: true)
|
|
404
|
-
prefix: boolean;
|
|
405
|
-
// Stop on error (default: false)
|
|
406
|
-
stopOnError: boolean;
|
|
407
|
-
// Use minimal output format (default: false)
|
|
408
|
-
minimalOutput: boolean;
|
|
409
|
-
// Group output by command (default: false, mainly for server mode)
|
|
410
|
-
groupOutput: boolean;
|
|
411
|
-
// Use server mode formatting (default: false)
|
|
412
|
-
isServerMode: boolean;
|
|
413
|
-
// Number of times to retry a failed command (default: 0)
|
|
414
|
-
retry?: number;
|
|
415
|
-
// Delay in milliseconds between retries (default: 1000)
|
|
416
|
-
retryDelay?: number;
|
|
417
|
-
// Callback to register a cleanup function, called on SIGINT/SIGTERM
|
|
418
|
-
registerCleanup?: (cleanupFn: () => void) => void;
|
|
419
|
-
}
|
|
316
|
+
# Set memory limit
|
|
317
|
+
neex start dist/server.js --max-memory 1G
|
|
420
318
|
```
|
|
421
319
|
|
|
422
|
-
## π CI/CD Integration
|
|
423
|
-
|
|
424
|
-
```yaml
|
|
425
|
-
# GitHub Actions example
|
|
426
|
-
steps:
|
|
427
|
-
- name: Test & Build
|
|
428
|
-
run: neex s -s "npm test" "npm run build"
|
|
429
320
|
|
|
430
|
-
- name: Parallel Tasks
|
|
431
|
-
run: neex p -s -m 4 "npm run lint" "npm test" "npm run e2e"
|
|
432
|
-
```
|
|
433
321
|
|
|
434
|
-
## π‘ Real-world Scenarios & `package.json` Integration
|
|
435
322
|
|
|
436
|
-
|
|
323
|
+
## π‘ Real-World Scenarios
|
|
437
324
|
|
|
438
|
-
|
|
325
|
+
Integrate Neex into your `package.json` for a seamless workflow:
|
|
439
326
|
|
|
440
327
|
```json
|
|
441
328
|
{
|
|
442
329
|
"scripts": {
|
|
443
|
-
"dev
|
|
444
|
-
"
|
|
445
|
-
"
|
|
446
|
-
|
|
447
|
-
"build:ui": "cd packages/ui-library && npm run build",
|
|
448
|
-
"build:app": "cd packages/main-app && npm run build",
|
|
449
|
-
"build": "neex runx \"npm run build:ui\" \"npm run build:app\"",
|
|
450
|
-
|
|
451
|
-
"test": "neex runx -s \"npm run test:unit\" \"npm run test:e2e\"",
|
|
452
|
-
"test:unit": "jest",
|
|
453
|
-
"test:e2e": "playwright test",
|
|
454
|
-
|
|
455
|
-
"lint": "eslint .",
|
|
456
|
-
"format": "prettier --write .",
|
|
457
|
-
"check-all": "neex p \"npm run lint\" \"npm run format -- --check\" \"npm run test\"",
|
|
458
|
-
|
|
459
|
-
"start:prod": "neex pm2 start dist/server.js --name my-prod-app",
|
|
460
|
-
"watch:build": "neex watch \"npm run build:app\" -w packages/main-app/src -e ts,tsx"
|
|
330
|
+
"dev": "neex dev src/server.ts",
|
|
331
|
+
"build": "neex build",
|
|
332
|
+
"start": "neex start"
|
|
461
333
|
}
|
|
462
334
|
}
|
|
463
335
|
```
|
|
464
336
|
|
|
465
|
-
|
|
337
|
+
Run scripts with:
|
|
466
338
|
|
|
467
339
|
```bash
|
|
468
|
-
# Start
|
|
469
|
-
npm run
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
npm run build
|
|
340
|
+
npm run dev # Start development server with live-reloading
|
|
341
|
+
npm run build # Compile TypeScript project for production
|
|
342
|
+
npm run start # Start production server
|
|
343
|
+
```
|
|
473
344
|
|
|
474
|
-
|
|
475
|
-
npm run check-all
|
|
345
|
+
This configuration provides a minimal yet effective setup for developing, building, and deploying your Neex project. The `dev` command runs a TypeScript development server, `build` compiles the project, and `start` launches the production application.
|
|
476
346
|
|
|
477
|
-
|
|
478
|
-
npm run start:prod
|
|
347
|
+
## π System Requirements
|
|
479
348
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
349
|
+
- **Node.js**: 20.0.0 or later
|
|
350
|
+
- **OS**: macOS, Windows, or Linux
|
|
351
|
+
- **Package Manager**: npm, yarn, pnpm, or bun
|
|
483
352
|
|
|
484
353
|
## π€ Contributing
|
|
485
354
|
|
|
486
|
-
|
|
355
|
+
Contributions are welcome! Visit our [GitHub issues page](https://github.com/Neexjs) to get started.
|
|
487
356
|
|
|
488
357
|
## π License
|
|
489
358
|
|
|
490
|
-
MIT
|
|
359
|
+
MIT License. See [LICENSE](https://github.com/neexjs/blob/main/LICENSE) for details.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "The Modern Build System for Polyrepo-in-Monorepo Architecture",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -19,13 +19,22 @@
|
|
|
19
19
|
"test:sequence": "node ./dist/src/cli.js run \"echo Step 1\" \"echo Step 2\" \"echo Step 3\""
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
22
|
+
"fullstack-framework",
|
|
23
|
+
"nextjs",
|
|
24
|
+
"express",
|
|
25
|
+
"monorepo",
|
|
26
|
+
"polyrepo",
|
|
27
|
+
"typescript",
|
|
28
|
+
"prisma",
|
|
29
|
+
"cli",
|
|
30
|
+
"build-system",
|
|
31
|
+
"web-development",
|
|
32
|
+
"node",
|
|
33
|
+
"javascript",
|
|
34
|
+
"production-ready",
|
|
35
|
+
"dotenv",
|
|
36
|
+
"parallel-execution",
|
|
37
|
+
"sequential-execution"
|
|
29
38
|
],
|
|
30
39
|
"author": "foshati",
|
|
31
40
|
"license": "MIT",
|
|
@@ -51,10 +60,10 @@
|
|
|
51
60
|
"typescript": "^4.9.3"
|
|
52
61
|
},
|
|
53
62
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
63
|
+
"node": ">=20.0.0"
|
|
55
64
|
},
|
|
56
65
|
"repository": {
|
|
57
66
|
"type": "git",
|
|
58
67
|
"url": "https://github.com/Neexjs"
|
|
59
68
|
}
|
|
60
|
-
}
|
|
69
|
+
}
|