meocord 1.3.1 → 1.3.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 CHANGED
@@ -10,13 +10,12 @@ While still growing, MeoCord provides a solid foundation for developers to creat
10
10
 
11
11
  - [Features](#features)
12
12
  - [Getting Started](#getting-started)
13
+ - [Prerequisites](#prerequisites)
14
+ - [Create Fresh App](#create-fresh-app)
13
15
  - [Project Structure](#project-structure)
14
16
  - [Example Structure](#example-structure)
15
17
  - [Key Components](#key-components)
16
18
  - [Configuration](#configuration)
17
- - [Getting Started](#getting-started)
18
- - [Prerequisites](#prerequisites)
19
- - [Create Fresh App](#create-fresh-app)
20
19
  - [CLI Usage](#cli-usage)
21
20
  - [Development Guide](#development-guide)
22
21
  - [Deployment Guide](#deployment-guide)
@@ -59,9 +58,9 @@ While still growing, MeoCord provides a solid foundation for developers to creat
59
58
 
60
59
  ### Prerequisites
61
60
 
62
- - **Node.js**: Ensure you have version **22.14.0** or higher, as it’s the current LTS release.
63
- - **TypeScript**: Version **5.7** or above is required for compatibility with modern features.
64
- - **Bun**: Version **1.x** or above is required as the package manager.
61
+ - **Runtime**: **Node.js** (latest LTS) or **Bun** (1.x+).
62
+ - **TypeScript**: Version **6** or above.
63
+ - **Package Manager**: Any of **npm**, **yarn**, **pnpm**, or **bun**. The CLI will detect installed package managers and let you choose.
65
64
 
66
65
  ### Module Support
67
66
 
@@ -145,12 +144,21 @@ Follow these steps to create and run a **MeoCord** application:
145
144
 
146
145
  ### 1. Create a fresh MeoCord Application
147
146
 
148
- Use the CLI to generate your application.
147
+ Use the CLI to generate your application. You'll be prompted to choose a package manager from those installed on your system.
149
148
 
150
149
  ```shell
151
150
  npx meocord create <your-app-name>
152
151
  ```
153
152
 
153
+ You can also skip the prompt by specifying a package manager directly:
154
+
155
+ ```shell
156
+ npx meocord create <your-app-name> --use-bun
157
+ npx meocord create <your-app-name> --use-npm
158
+ npx meocord create <your-app-name> --use-yarn
159
+ npx meocord create <your-app-name> --use-pnpm
160
+ ```
161
+
154
162
  ---
155
163
 
156
164
  ### 2. Configure `meocord.config.ts`
@@ -176,14 +184,14 @@ Use the CLI to start your application.
176
184
  Run in development mode:
177
185
 
178
186
  ```shell
179
- bun start:dev
187
+ npx meocord start --dev
180
188
  ```
181
189
 
182
190
  - **Production Mode**:
183
191
  Run in production mode with fresh production build:
184
192
 
185
193
  ```shell
186
- bun start:prod --build # use arg `--build` if not built yet or use `bun build:prod` first
194
+ npx meocord start --build --prod
187
195
  ```
188
196
 
189
197
  ---
@@ -218,7 +226,7 @@ When using MeoCord, the expected project structure is as follows:
218
226
  │   └── services
219
227
  │   └── sample.service.ts
220
228
  ├── tsconfig.json
221
- └── bun.lock
229
+ └── <lockfile> # bun.lock / package-lock.json / yarn.lock / pnpm-lock.yaml
222
230
  ```
223
231
 
224
232
  This structure ensures clear separation of concerns and scalable project architecture.
@@ -362,13 +370,13 @@ The **MeoCord CLI** is designed to help you manage, build, and run your applicat
362
370
  To ensure you see the most accurate and complete list of commands and options, always refer to the help menu by running:
363
371
 
364
372
  ```shell
365
- bun meocord --help
373
+ npx meocord --help
366
374
  ```
367
375
 
368
376
  Below is an example of the help display output:
369
377
 
370
378
  ```textmate
371
- bun meocord --help
379
+ npx meocord --help
372
380
  MeoCord Copyright (C) 2025 Ukasyah Rahmatullah Zada
373
381
  This program comes with ABSOLUTELY NO WARRANTY; for details type `meocord show -w'.
374
382
  This is free software, and you are welcome to redistribute it
@@ -412,8 +420,8 @@ Builds the application in **production** or **development** mode.
412
420
  **Usage:**
413
421
 
414
422
  ```shell
415
- bun meocord build --prod # Build for production
416
- bun meocord build --dev # Build for development
423
+ npx meocord build --prod # Build for production
424
+ npx meocord build --dev # Build for development
417
425
  ```
418
426
 
419
427
  #### `meocord start`
@@ -423,8 +431,8 @@ Starts the application with options for either a **production** or **development
423
431
  **Usage:**
424
432
 
425
433
  ```shell
426
- bun meocord start --build --prod # Start in production mode with fresh production build
427
- bun meocord start --dev # Start in development mode (will always fresh build)
434
+ npx meocord start --build --prod # Start in production mode with fresh production build
435
+ npx meocord start --dev # Start in development mode (will always fresh build)
428
436
  ```
429
437
 
430
438
  #### `meocord generate` (Alias: `meocord g`)
@@ -434,13 +442,13 @@ Scaffolds application components such as controllers, services, and other elemen
434
442
  **Usage:**
435
443
 
436
444
  ```text
437
- bun meocord generate|g [options] [command]
445
+ npx meocord generate|g [options] [command]
438
446
  ```
439
447
 
440
448
  **Example:**
441
449
 
442
450
  ```shell
443
- bun meocord g co slash "user"
451
+ npx meocord g co slash "user"
444
452
  ```
445
453
 
446
454
  This command will generate a `user` slash controller.
@@ -450,7 +458,7 @@ This command will generate a `user` slash controller.
450
458
  For detailed usage of any particular command, append the `--help` flag to it. For instance:
451
459
 
452
460
  ```shell
453
- bun meocord g --help
461
+ npx meocord g --help
454
462
  ```
455
463
 
456
464
  This will provide command-specific help and options.
@@ -464,7 +472,7 @@ This will provide command-specific help and options.
464
472
  Run the application in development mode with live-reload for a seamless coding experience:
465
473
 
466
474
  ```shell
467
- bun meocord start --dev
475
+ npx meocord start --dev
468
476
  ```
469
477
 
470
478
  ### Building for Production
@@ -472,7 +480,7 @@ bun meocord start --dev
472
480
  Generate an optimized and compiled production build with:
473
481
 
474
482
  ```shell
475
- bun meocord build --prod
483
+ npx meocord build --prod
476
484
  ```
477
485
 
478
486
  Once built, you can deploy or run the application efficiently.
@@ -484,19 +492,25 @@ Once built, you can deploy or run the application efficiently.
484
492
  Install all necessary dependencies, including development dependencies, before building:
485
493
 
486
494
  ```shell
487
- bun install --frozen-lockfile
495
+ npm ci # npm
496
+ yarn install --frozen-lockfile # yarn
497
+ pnpm install --frozen-lockfile # pnpm
498
+ bun install --frozen-lockfile # bun
488
499
  ```
489
500
 
490
501
  Generate an optimized and compiled production build:
491
502
 
492
503
  ```shell
493
- bun meocord build --prod
504
+ npx meocord build --prod
494
505
  ```
495
506
 
496
507
  Clean up and focus on production-only dependencies:
497
508
 
498
509
  ```shell
499
- bun install --production
510
+ npm ci --omit=dev # npm
511
+ yarn install --production # yarn
512
+ pnpm install --prod # pnpm
513
+ bun install --production # bun
500
514
  ```
501
515
 
502
516
  Ensure the following essential files and folders are prepared for deployment on the server:
@@ -507,13 +521,13 @@ Ensure the following essential files and folders are prepared for deployment on
507
521
  ├── node_modules (production dependencies only)
508
522
  ├── .env (if applicable, ensure it contains necessary variables)
509
523
  ├── package.json
510
- └── bun.lock
524
+ └── <lockfile> # bun.lock / package-lock.json / yarn.lock / pnpm-lock.yaml
511
525
  ```
512
526
 
513
527
  Start the application in production mode on the server:
514
528
 
515
529
  ```shell
516
- bun meocord start --prod
530
+ npx meocord start --prod
517
531
  ```
518
532
 
519
533
  ---
@@ -103,15 +103,24 @@ For full license details, refer to:
103
103
  await wait(100);
104
104
  process.exit(1);
105
105
  }
106
- // Check Node.js version
107
- const MINIMUM_NODE_VERSION = '22.14.0';
108
- const [major, minor, patch] = process.version.slice(1).split('.').map(Number);
109
- const [minMajor, minMinor, minPatch] = MINIMUM_NODE_VERSION.split('.').map(Number);
110
- if (major < minMajor || major === minMajor && minor < minMinor || major === minMajor && minor === minMinor && patch < minPatch) {
111
- p.cancel(`Node.js v${MINIMUM_NODE_VERSION} or higher is required. Current: ${process.version}`);
106
+ let latestLTS = null;
107
+ try {
108
+ const res = await fetch('https://nodejs.org/dist/index.json');
109
+ const releases = await res.json();
110
+ const ltsRelease = releases.find((r)=>r.lts !== false);
111
+ if (ltsRelease) latestLTS = ltsRelease.version.slice(1);
112
+ } catch {
113
+ p.cancel('No internet connection. Creating a MeoCord app requires network access.');
112
114
  await wait(100);
113
115
  process.exit(1);
114
116
  }
117
+ if (latestLTS) {
118
+ const [major, minor, patch] = process.version.slice(1).split('.').map(Number);
119
+ const [minMajor, minMinor, minPatch] = latestLTS.split('.').map(Number);
120
+ if (major < minMajor || major === minMajor && minor < minMinor || major === minMajor && minor === minMinor && patch < minPatch) {
121
+ p.log.warn(`Your Node.js (${process.version}) is behind the latest LTS (v${latestLTS}). Consider upgrading for best compatibility.`);
122
+ }
123
+ }
115
124
  // Determine package manager
116
125
  const installedPMs = detectInstalledPMs();
117
126
  let pm;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "meocord",
3
3
  "description": "MeoCord is a lightweight and modular framework for building scalable Discord bots using TypeScript and Discord.js. It simplifies bot development with an extensible architecture, TypeScript-first approach, and powerful CLI tools.",
4
- "version": "1.3.1",
4
+ "version": "1.3.2",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "lint": "eslint --fix . && tsc --noEmit",