easybuild-nox 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 NoxTheDev
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,405 @@
1
+ # easy-build 🚀
2
+
3
+ A universal build tool for **EVERYTHING** - Node.js, Electron, Docker, Cloud deployments, and more.
4
+
5
+ ## Features
6
+
7
+ - **Universal Support** - Works with ANY Node.js project
8
+ - **Auto-Detection** - Automatically detects your framework and bundler
9
+ - **Cross-Platform** - Build for Windows, Linux, and Mac
10
+ - **Electron Support** - Full Electron desktop app building
11
+ - **Docker Integration** - Generate and build Docker images
12
+ - **Cloud Deploy** - Deploy to Vercel, Netlify, AWS, GCP, Azure, and more
13
+ - **TypeScript** - Full TypeScript support
14
+ - **Monorepo** - Works with monorepo setups
15
+ - **Zero Config** - Works out of the box with sensible defaults
16
+ - **Shared Modules** - Save disk space by sharing modules across projects!
17
+ - **50+ Frameworks** - Support for all major frameworks
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install -g easy-build
23
+ ```
24
+
25
+ Or use directly in your project:
26
+
27
+ ```bash
28
+ npx easy-build <command>
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ### Initialize a new project
34
+
35
+ ```bash
36
+ easy init my-app
37
+ ```
38
+
39
+ Available templates:
40
+ - `express-api` - Express.js REST API
41
+ - `fastify-api` - Fastify high-performance API
42
+ - `nest-api` - NestJS enterprise API
43
+ - `react-app` - React with Vite
44
+ - `vue-app` - Vue 3 with Vite
45
+ - `astro-app` - Astro static site
46
+ - `astro-react` - Astro + React
47
+ - `astro-vue` - Astro + Vue
48
+ - `qwik-app` - Qwik instant-loading app
49
+ - `electron-app` - Electron desktop app
50
+ - `typescript-lib` - TypeScript library
51
+ - `cli-tool` - Command-line tool
52
+ - `docker-app` - App with Docker support
53
+ - `blank` - Empty project
54
+
55
+ ### Run your project
56
+
57
+ ```bash
58
+ easy run
59
+ # or
60
+ easy dev
61
+ ```
62
+
63
+ ### Build your project
64
+
65
+ ```bash
66
+ easy build
67
+ ```
68
+
69
+ The build command auto-detects your project type and uses the appropriate bundler.
70
+
71
+ ## Commands
72
+
73
+ ### `easy init [name]`
74
+
75
+ Initialize a new project with a template.
76
+
77
+ ```bash
78
+ easy init my-app --template react-app
79
+ ```
80
+
81
+ ### `easy run`
82
+
83
+ Run your project in production mode.
84
+
85
+ ```bash
86
+ easy run --port 8080 --host 0.0.0.0
87
+ easy run --no-shared # Disable shared modules for this run
88
+ ```
89
+
90
+ ### `easy dev`
91
+
92
+ Start development server with hot reload.
93
+
94
+ ```bash
95
+ easy dev --port 3000
96
+ easy dev --no-shared # Disable shared modules for this run
97
+ ```
98
+
99
+ ### `easy build`
100
+
101
+ Build your project for production.
102
+
103
+ ```bash
104
+ easy build
105
+ easy build --target electron --platform win
106
+ easy build --target docker
107
+ easy build --minify --sourcemap
108
+ ```
109
+
110
+ Options:
111
+ - `--target <target>` - Build target: `node`, `frontend`, `electron`, `docker`, `library` (default: auto)
112
+ - `--platform <platform>` - Target platform: `win`, `linux`, `mac`, `all` (default: current)
113
+ - `--minify` - Minify output (default: true)
114
+ - `--sourcemap` - Generate source maps
115
+ - `--outDir <dir>` - Output directory (default: dist)
116
+
117
+ ### `easy electron`
118
+
119
+ Electron-specific operations.
120
+
121
+ ```bash
122
+ easy electron --action dev
123
+ easy electron --action build --platform all
124
+ easy electron --action pack
125
+ ```
126
+
127
+ Options:
128
+ - `--action <action>` - Action: `dev`, `build`, `pack`
129
+ - `--platform <platform>` - Target: `win`, `mac`, `linux`, `all`
130
+ - `--arch <arch>` - Architecture: `x64`, `arm64`, `all`
131
+
132
+ ### `easy docker`
133
+
134
+ Docker operations.
135
+
136
+ ```bash
137
+ easy docker --action build
138
+ easy docker --action run --port 3000
139
+ easy docker --action stop
140
+ easy docker --action logs
141
+ ```
142
+
143
+ Options:
144
+ - `--action <action>` - Action: `build`, `run`, `stop`, `logs`, `push`
145
+ - `--tag <tag>` - Docker image tag (default: latest)
146
+ - `--port <port>` - Port mapping (default: 3000)
147
+
148
+ ### `easy deploy`
149
+
150
+ Deploy your application to the cloud.
151
+
152
+ ```bash
153
+ easy deploy --provider vercel
154
+ easy deploy --provider netlify
155
+ easy deploy --provider railway
156
+ ```
157
+
158
+ Supported providers:
159
+ - **Vercel** - Best for frontend/fullstack
160
+ - **Netlify** - Best for static sites
161
+ - **Railway** - Easy fullstack deployment
162
+ - **Render** - Simple cloud hosting
163
+ - **Fly.io** - Global edge deployment
164
+ - **AWS** - Amazon Web Services
165
+ - **GCP** - Google Cloud Platform
166
+ - **Azure** - Microsoft Azure
167
+
168
+ ### `easy test`
169
+
170
+ Run tests with auto-detection of test framework.
171
+
172
+ ```bash
173
+ easy test
174
+ easy test --watch
175
+ easy test --coverage
176
+ easy test --filter "my test"
177
+ ```
178
+
179
+ ### `easy package`
180
+
181
+ Package your application for distribution.
182
+
183
+ ```bash
184
+ easy package --type bin --platform linux
185
+ easy package --type app --platform win
186
+ easy package --type docker
187
+ easy package --type npm
188
+ ```
189
+
190
+ Options:
191
+ - `--type <type>` - Package type: `bin`, `app`, `docker`, `npm`, `single`
192
+ - `--platform <platform>` - Target: `win`, `linux`, `mac`, `current`
193
+ - `--arch <arch>` - Architecture: `x64`, `arm64`, `all`
194
+
195
+ ### `easy analyze`
196
+
197
+ Analyze bundle size and dependencies.
198
+
199
+ ```bash
200
+ easy analyze
201
+ easy analyze --dir dist --format json
202
+ ```
203
+
204
+ ### `easy clean`
205
+
206
+ Clean build artifacts and caches.
207
+
208
+ ```bash
209
+ easy clean
210
+ easy clean --dist
211
+ easy clean --node-modules
212
+ easy clean --cache
213
+ easy clean --all
214
+ ```
215
+
216
+ ### `easy lint`
217
+
218
+ Run linting and formatting.
219
+
220
+ ```bash
221
+ easy lint
222
+ easy lint --fix
223
+ easy lint --eslint
224
+ easy lint --prettier
225
+ ```
226
+
227
+ ### `easy modules`
228
+
229
+ Manage shared modules to save disk space! **Enabled by default!**
230
+
231
+ ```bash
232
+ easy modules install # Install all project dependencies to shared folder
233
+ easy modules install express # Install specific module
234
+ easy modules update # Update all shared modules
235
+ easy modules update express # Update specific module
236
+ easy modules list # List all installed shared modules
237
+ easy modules clean # Remove unused modules
238
+ easy modules sync # Sync project dependencies to shared modules
239
+ easy modules stats # Show disk usage statistics
240
+ ```
241
+
242
+ **Why use shared modules?**
243
+ - Save 100MB+ disk space per project
244
+ - Faster installs (modules are cached globally)
245
+ - Consistent versions across projects
246
+ - Less network bandwidth usage
247
+
248
+ **How it works:**
249
+ 1. Modules are installed to `~/.easy/modules/`
250
+ 2. Your project symlinks `node_modules` to the shared folder
251
+ 3. If a module exists, it's reused (no download needed)
252
+ 4. Run `easy modules sync` to update your project
253
+
254
+ ### `easy config`
255
+
256
+ Manage global configuration.
257
+
258
+ ```bash
259
+ easy config --show # Show current config
260
+ easy config --enable-shared # Enable shared modules globally (default)
261
+ easy config --disable-shared # Disable shared modules globally
262
+ easy config -g build.minify # Get a config value
263
+ easy config set build.minify false # Set a config value
264
+ ```
265
+
266
+ ## Configuration
267
+
268
+ Create `easy.config.js` in your project root:
269
+
270
+ ```javascript
271
+ module.exports = {
272
+ // Project settings
273
+ name: 'my-app',
274
+ version: '1.0.0',
275
+
276
+ // Entry point
277
+ entry: 'src/index.js',
278
+ outDir: 'dist',
279
+
280
+ // Build settings
281
+ build: {
282
+ minify: true,
283
+ sourcemap: false,
284
+ analyze: false,
285
+ clean: true,
286
+ },
287
+
288
+ // Development server
289
+ dev: {
290
+ port: 3000,
291
+ host: 'localhost',
292
+ open: true,
293
+ watch: true,
294
+ },
295
+
296
+ // Electron settings
297
+ electron: {
298
+ enabled: false,
299
+ main: 'electron/main.js',
300
+ preload: 'electron/preload.js',
301
+ output: 'release',
302
+ platforms: ['win', 'mac', 'linux'],
303
+ arch: ['x64', 'arm64'],
304
+ },
305
+
306
+ // Docker settings
307
+ docker: {
308
+ enabled: false,
309
+ baseImage: 'node:20-alpine',
310
+ port: 3000,
311
+ },
312
+
313
+ // Cloud deployment
314
+ deploy: {
315
+ provider: null,
316
+ region: 'us-east-1',
317
+ },
318
+ };
319
+ ```
320
+
321
+ ## Supported Frameworks
322
+
323
+ ### Backend
324
+ - Express.js
325
+ - Fastify
326
+ - Koa
327
+ - Hapi
328
+ - NestJS
329
+ - AdonisJS
330
+ - Strapi
331
+
332
+ ### Frontend
333
+ - React
334
+ - Vue
335
+ - Angular
336
+ - Svelte
337
+ - SolidJS
338
+ - Preact
339
+ - Lit
340
+
341
+ ### Full-Stack
342
+ - Next.js
343
+ - Nuxt
344
+ - Remix
345
+ - Gatsby
346
+ - Astro
347
+ - SvelteKit
348
+
349
+ ### Desktop
350
+ - Electron
351
+ - Tauri
352
+ - Neutralino
353
+
354
+ ### Mobile
355
+ - React Native
356
+ - Ionic
357
+ - NativeScript
358
+ - Expo
359
+
360
+ ## Supported Bundlers
361
+
362
+ - esbuild (default)
363
+ - Webpack
364
+ - Vite
365
+ - Rollup
366
+ - Parcel
367
+ - SWC
368
+ - Turbopack
369
+
370
+ ## Examples
371
+
372
+ ### Build an Express API for Linux
373
+
374
+ ```bash
375
+ easy build --target node --platform linux
376
+ ```
377
+
378
+ ### Build an Electron app for all platforms
379
+
380
+ ```bash
381
+ easy electron --action build --platform all
382
+ ```
383
+
384
+ ### Create a Docker image and run it
385
+
386
+ ```bash
387
+ easy docker --action build
388
+ easy docker --action run --port 8080
389
+ ```
390
+
391
+ ### Deploy to Vercel
392
+
393
+ ```bash
394
+ easy deploy --provider vercel
395
+ ```
396
+
397
+ ### Package as standalone binary
398
+
399
+ ```bash
400
+ easy package --type bin --platform linux --arch x64
401
+ ```
402
+
403
+ ## License
404
+
405
+ MIT
package/bin/easy.js ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { Command } = require('commander');
4
+ const chalk = require('chalk');
5
+ const pkg = require('../package.json');
6
+
7
+ const program = new Command();
8
+
9
+ // Fun ASCII art banner
10
+ const banner = `
11
+ ${chalk.green('███████╗ █████╗ ███████╗██╗ ██╗')}
12
+ ${chalk.green('██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝')}
13
+ ${chalk.green('█████╗ ███████║███████╗ ╚████╔╝ ')}
14
+ ${chalk.green('██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ')}
15
+ ${chalk.green('███████╗██║ ██║███████║ ██║ ')}
16
+ ${chalk.green('╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ')}
17
+ ${chalk.cyan('────────────────────────────────────')}
18
+ ${chalk.white(' The Universal Build Tool')}
19
+ ${chalk.gray(' v' + pkg.version + ' - Supports EVERYTHING')}
20
+ `;
21
+
22
+ program
23
+ .name('easy')
24
+ .description(banner)
25
+ .version(pkg.version);
26
+
27
+ // Import commands
28
+ const runCommand = require('../src/commands/run');
29
+ const buildCommand = require('../src/commands/build');
30
+ const initCommand = require('../src/commands/init');
31
+ const devCommand = require('../src/commands/dev');
32
+ const testCommand = require('../src/commands/test');
33
+ const deployCommand = require('../src/commands/deploy');
34
+ const dockerCommand = require('../src/commands/docker');
35
+ const electronCommand = require('../src/commands/electron');
36
+ const packageCommand = require('../src/commands/package');
37
+ const analyzeCommand = require('../src/commands/analyze');
38
+ const cleanCommand = require('../src/commands/clean');
39
+ const lintCommand = require('../src/commands/lint');
40
+ const modulesCommand = require('../src/commands/modules');
41
+ const configCommand = require('../src/commands/config');
42
+ const generateCommand = require('../src/commands/generate');
43
+ const envCommand = require('../src/commands/env');
44
+ const dbCommand = require('../src/commands/db');
45
+ const infoCommand = require('../src/commands/info');
46
+ const healthCommand = require('../src/commands/health');
47
+ const proxyCommand = require('../src/commands/proxy');
48
+
49
+ // Register commands
50
+ program.addCommand(runCommand);
51
+ program.addCommand(buildCommand);
52
+ program.addCommand(initCommand);
53
+ program.addCommand(devCommand);
54
+ program.addCommand(testCommand);
55
+ program.addCommand(deployCommand);
56
+ program.addCommand(dockerCommand);
57
+ program.addCommand(electronCommand);
58
+ program.addCommand(packageCommand);
59
+ program.addCommand(analyzeCommand);
60
+ program.addCommand(cleanCommand);
61
+ program.addCommand(lintCommand);
62
+ program.addCommand(modulesCommand);
63
+ program.addCommand(configCommand);
64
+ program.addCommand(generateCommand);
65
+ program.addCommand(envCommand);
66
+ program.addCommand(dbCommand);
67
+ program.addCommand(infoCommand);
68
+ program.addCommand(healthCommand);
69
+ program.addCommand(proxyCommand);
70
+
71
+ program.parse(process.argv);
package/easy.config.js ADDED
@@ -0,0 +1,58 @@
1
+ // easy.config.js - Configuration for easy-build
2
+ // https://github.com/noxthedev/easy-build
3
+
4
+ module.exports = {
5
+ // Project settings
6
+ name: 'my-app',
7
+ version: '1.0.0',
8
+
9
+ // Entry point
10
+ entry: 'src/index.js',
11
+ outDir: 'dist',
12
+
13
+ // Build settings
14
+ build: {
15
+ minify: true,
16
+ sourcemap: false,
17
+ analyze: false,
18
+ clean: true,
19
+ },
20
+
21
+ // Development server
22
+ dev: {
23
+ port: 3000,
24
+ host: 'localhost',
25
+ open: true,
26
+ watch: true,
27
+ },
28
+
29
+ // TypeScript (auto-detected)
30
+ typescript: {
31
+ enabled: false,
32
+ tsconfig: 'tsconfig.json',
33
+ declaration: true,
34
+ },
35
+
36
+ // Electron settings (if building desktop app)
37
+ electron: {
38
+ enabled: false,
39
+ main: 'electron/main.js',
40
+ preload: 'electron/preload.js',
41
+ output: 'release',
42
+ platforms: ['win', 'mac', 'linux'],
43
+ arch: ['x64', 'arm64'],
44
+ },
45
+
46
+ // Docker settings
47
+ docker: {
48
+ enabled: false,
49
+ baseImage: 'node:20-alpine',
50
+ port: 3000,
51
+ },
52
+
53
+ // Cloud deployment
54
+ deploy: {
55
+ provider: null, // 'vercel', 'netlify', 'railway', 'aws', 'gcp', 'azure'
56
+ region: 'us-east-1',
57
+ },
58
+ };
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "easybuild-nox",
3
+ "version": "1.0.0",
4
+ "description": "A universal build tool for EVERYTHING - Node.js, Electron, Docker, Cloud, and more",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "easy": "./bin/easy.js"
8
+ },
9
+ "scripts": {
10
+ "test": "node bin/easy.js run"
11
+ },
12
+ "keywords": [
13
+ "build",
14
+ "compiler",
15
+ "nodejs",
16
+ "electron",
17
+ "docker",
18
+ "cloud",
19
+ "vercel",
20
+ "netlify",
21
+ "aws",
22
+ "gcp",
23
+ "azure",
24
+ "react",
25
+ "vue",
26
+ "angular",
27
+ "svelte",
28
+ "nextjs",
29
+ "nuxt",
30
+ "nest",
31
+ "express",
32
+ "fastify",
33
+ "typescript",
34
+ "esbuild",
35
+ "webpack",
36
+ "vite",
37
+ "rollup",
38
+ "parcel",
39
+ "cross-platform",
40
+ "windows",
41
+ "linux",
42
+ "mac",
43
+ "monorepo"
44
+ ],
45
+ "author": "NoxTheDev",
46
+ "license": "MIT",
47
+ "dependencies": {
48
+ "commander": "^12.1.0",
49
+ "esbuild": "^0.21.0",
50
+ "electron-builder": "^24.13.3",
51
+ "pkg": "^5.8.1",
52
+ "ora": "^5.4.1",
53
+ "chalk": "^4.1.2",
54
+ "inquirer": "^8.2.6",
55
+ "fs-extra": "^11.2.0",
56
+ "typescript": "^5.4.0",
57
+ "webpack": "^5.91.0",
58
+ "webpack-cli": "^5.1.4",
59
+ "vite": "^5.2.0",
60
+ "rollup": "^4.14.0",
61
+ "parcel": "^2.12.0",
62
+ "dockerode": "^4.0.2",
63
+ "node-forge": "^1.3.1",
64
+ "semver": "^7.6.0"
65
+ },
66
+ "engines": {
67
+ "node": ">=18.0.0"
68
+ }
69
+ }