@madhusha_99/exp-gen 1.3.0 → 1.4.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/README.md CHANGED
@@ -1,59 +1,110 @@
1
1
  # exp-gen 🚀
2
2
 
3
- **exp-gen** is a lightning-fast, interactive CLI tool designed to scaffold Express.js API projects in seconds. Whether you prefer **TypeScript** or **JavaScript**, `exp-gen` sets up your directory structure, configuration, and database boilerplate so you can start coding immediately.
3
+ [![NPM version](https://img.shields.io/npm/v/@madhusha_99/exp-gen?color=2e1065&label=)](https://www.npmjs.com/package/@madhusha_99/exp-gen)
4
+
5
+ **exp-gen** a lightning-fast, interactive CLI tool designed to scaffold **Express.js REST APIs** in seconds.
6
+
7
+ Whether you're starting a project with **TypeScript** or **JavaScript**, `exp-gen` generates a clean layered architecture, configures your preferred database boilerplate so you can start coding immediately, and now includes a **built-in web-based Regex Simulator** to help you build and debug regular expressions visually.
8
+
9
+ ---
10
+
11
+ ## âœĻ Features
12
+
13
+ - 🚀 Interactive CLI powered by `@clack/prompts`
14
+ - ⚡ Scaffold Express.js APIs in seconds
15
+ - ðŸŸĶ TypeScript support
16
+ - ðŸŸĻ JavaScript support
17
+ - 🗂 Professional layered architecture
18
+ - 🍃 MongoDB (Mongoose)
19
+ - 🐎 MySQL
20
+ - ðŸŠķ SQLite
21
+ - 🐘 PostgreSQL (JavaScript projects)
22
+ - ðŸ“Ķ Optional automatic dependency installation
23
+ - 🔎 Built-in **Regex Simulator**
24
+ - 🌐 Opens automatically in your browser
25
+ - ðŸŽĻ Modern developer-friendly UI
26
+ - 📖 Live regex explanation & validation
4
27
 
5
28
  ---
6
29
 
7
- ## 🚀 Quick Start
30
+ # 🚀 Installation
8
31
 
9
- To use the generator anywhere on your system, install it globally via npm:
32
+ Install globally using npm:
10
33
 
11
34
  ```bash
12
35
  npm install -g @madhusha_99/exp-gen
13
36
  ```
14
37
 
15
- Once installed, you can initialize a new project using any of the following commands:
38
+ ---
39
+
40
+ # 🚀 Usage
41
+
42
+ After installation you can launch the CLI using any of the following commands:
16
43
 
17
44
  ```bash
18
45
  exp
19
- # OR
46
+ ```
47
+
48
+ or
49
+
50
+ ```bash
20
51
  gen
21
- # OR
52
+ ```
53
+
54
+ or
55
+
56
+ ```bash
22
57
  express-draft
23
58
  ```
24
59
 
60
+ When the CLI starts you'll be greeted with an interactive menu.
61
+
62
+ ```
63
+ 🚀 Scaffold a new Express API
64
+
65
+ 🔎 Run Regex Simulator
66
+ ```
67
+
25
68
  ---
26
69
 
27
- ## 🛠 User Guide
70
+ # 🚀 Scaffold Express API
28
71
 
29
- ### 1. Initialize Project
72
+ Choose **Scaffold a new Express API** and answer a few questions.
30
73
 
31
- Run `exp` in your terminal. The interactive CLI (powered by `@clack/prompts`) will guide you through the setup:
74
+ The CLI will ask for:
32
75
 
33
- ![exp-gen](https://github.com/user-attachments/assets/d2766261-519e-4485-aef4-53e1edaaa18a)
76
+ - Project name
77
+ - Language
78
+ - Database
79
+ - Install dependencies
34
80
 
35
- - **Project Name:** Enter your project folder name (e.g., `my-api`).
36
- - **Language:** Choose between **TypeScript** (Recommended) or **JavaScript**.
37
- - **Database:** Select your preferred database.
38
- - _Currently Supported:_ **MongoDB** (via Mongoose), **MySQL**, **SQLite**, and **PostgreSQL** (only for JavaScript projects).
39
- - _Coming Soon:_ **PostgreSQL** (Prisma).
40
- - **Install Dependencies:** Choose `Yes` to let the CLI run `npm install` for you automatically.
81
+ Supported languages
41
82
 
42
- ### 2. Navigate and Run
83
+ - **TypeScript** _(Recommended for type safety)_ – Currently available with **MongoDB (Mongoose)** and **No Database** templates. More database integrations will be added in future releases.
84
+ - **JavaScript** – Full template support for all currently available databases, including **MongoDB (Mongoose)**, **MySQL (mysql2)**, **SQLite (sqlite3)**, **PostgreSQL (pg)**, and **No Database**.
43
85
 
44
- After the scaffolding is complete, follow the on-screen instructions:
86
+ ## 🗄ïļ Supported Databases
45
87
 
46
- ```bash
47
- cd <your-project-name>
48
- npm run dev
49
- ```
88
+ | Database | JavaScript | TypeScript | Driver / ORM | Status |
89
+ | ------------------- | :--------: | :--------: | ------------ | :-----: |
90
+ | MongoDB | ✅ | ✅ | Mongoose | Stable |
91
+ | MySQL | ✅ | ❌ | mysql2 | Stable |
92
+ | SQLite | ✅ | ❌ | sqlite3 | Stable |
93
+ | PostgreSQL | ✅ | ❌ | pg | Stable |
94
+ | None (No Database) | ✅ | ✅ | — | Stable |
95
+ | Prisma (MongoDB) | 🚧 | 🚧 | Prisma ORM | Planned |
96
+ | Prisma (MySQL) | 🚧 | 🚧 | Prisma ORM | Planned |
97
+ | Prisma (PostgreSQL) | 🚧 | 🚧 | Prisma ORM | Planned |
98
+ | Prisma (SQLite) | 🚧 | 🚧 | Prisma ORM | Planned |
99
+
100
+ #### Preview
101
+
102
+ ![Scaffold Express API Demo](./bin//assets/Scaffold.gif)
50
103
 
51
104
  ---
52
105
 
53
106
  ## 📁 Project Structure
54
107
 
55
- `exp-gen` scaffolds a professional **Layered Architecture**, ensuring your code remains scalable and maintainable as it grows:
56
-
57
108
  - **`configs/`**: Environment variables and database connection logic.
58
109
  - **`controllers/`**: Bridges the routes and the business logic; handles requests/responses.
59
110
  - **`dtos/`**: Data Transfer Objects for validating and shaping incoming data.
@@ -66,32 +117,197 @@ npm run dev
66
117
  - **`utils/`**: Shared helper functions and utility classes.
67
118
  - **`app.ts`**: The application entry point.
68
119
 
120
+ The generated architecture **follows a clean layered design making projects easier to maintain and scale.**
121
+
122
+ ---
123
+
124
+ # 🔎 Regex Simulator
125
+
126
+ Starting from **v1.4.0**, `exp-gen` includes a fully interactive **Regex Simulator**.
127
+
128
+ Simply choose:
129
+
130
+ ```
131
+ 🔎 Run Regex Simulator
132
+ ```
133
+
134
+ The CLI automatically starts a lightweight local server and opens the Regex Simulator in your default web browser.
135
+
136
+ > ✅ **No additional dependencies are required.** The simulator is built into `exp-gen` and runs entirely on your local machine.
137
+
138
+ #### Preview
139
+
140
+ ![Regex Simulator Demo](./bin//assets/Regex.gif)
141
+
142
+ ![Regex Simulator Web](./bin//assets/RegexWeb.png)
143
+
144
+ ---
145
+
146
+ ## Features in Regex Simulator
147
+
148
+ - ⚡ Live regex matching
149
+ - 📖 Regex rule explanations
150
+ - ðŸŽŊ Capture group visualization
151
+ - 🔍 Match position detection
152
+ - ðŸšĻ Friendly validation errors
153
+ - 🧠 Beginner-friendly regex guidance
154
+ - 🏷 Regex flag helper
155
+ - 🌙 Modern dark developer UI
156
+ - 🌐 Runs completely locally
157
+
158
+ **Example**
159
+
160
+ ```regex
161
+ (?<name>\w+)-(\d+)
162
+ ```
163
+
164
+ **Input:**
165
+
166
+ ```
167
+ hello-123
168
+ world-456
169
+ invalid-value
170
+ ```
171
+
172
+ **Output:**
173
+
174
+ ```
175
+ ✓ Match 1
176
+ hello-123
177
+
178
+ Group 1:
179
+ hello
180
+
181
+ Group 2:
182
+ 123
183
+ ```
184
+
185
+ **The simulator also explains regex tokens such as:**
186
+
187
+ | Token | Description |
188
+ | ----------- | ------------------- |
189
+ | `\d` | Digit |
190
+ | `\w` | Word character |
191
+ | `.` | Any character |
192
+ | `+` | One or more |
193
+ | `*` | Zero or more |
194
+ | `?` | Optional |
195
+ | `^` | Start of input |
196
+ | `$` | End of input |
197
+ | `()` | Capture group |
198
+ | `(?<name>)` | Named capture group |
199
+
200
+ ---
201
+
202
+ # 🚀 Example Workflow
203
+
204
+ ```bash
205
+ exp
206
+ ```
207
+
208
+ ```
209
+ ✔ What would you like to do?
210
+
211
+ âŊ 🚀 Scaffold a new Express API
212
+ 🔎 Run Regex Simulator
213
+ ```
214
+
215
+ or
216
+
217
+ ```
218
+ ✔ What would you like to do?
219
+
220
+ 🚀 Scaffold a new Express API
221
+ âŊ 🔎 Run Regex Simulator
222
+ ```
223
+
224
+ ---
225
+
226
+ # ðŸ“Ķ After Scaffolding
227
+
228
+ Navigate into your project
229
+
230
+ ```bash
231
+ cd my-project
232
+ ```
233
+
234
+ If dependencies were installed
235
+
236
+ ```bash
237
+ npm run dev
238
+ ```
239
+
240
+ Otherwise
241
+
242
+ ```bash
243
+ npm install
244
+ npm run dev
245
+ ```
246
+
69
247
  ---
70
248
 
71
249
  ## ðŸĪ Contributing
72
250
 
73
- We love open source! `exp-gen` is a community-driven project, and we welcome contributions to make it better.
251
+ **We love open source! `exp-gen` is a community-driven project, and we welcome contributions to make it better.**
252
+
253
+ You can help by:
254
+
255
+ - Adding new database templates
256
+ - Improving generated project templates
257
+ - Improving the Regex Simulator
258
+ - Reporting bugs
259
+ - Suggesting new CLI features
260
+
261
+ **Clone the project**
262
+
263
+ ```bash
264
+ git clone https://github.com/Open-Core-Lab/exp-gen.git
265
+ ```
266
+
267
+ **Install dependencies**
268
+
269
+ ```bash
270
+ npm install
271
+ ```
272
+
273
+ **Run locally**
274
+
275
+ ```bash
276
+ npm run dev
277
+ ```
74
278
 
75
- ### How to contribute
279
+ ---
280
+
281
+ # 📋 Roadmap
76
282
 
77
- 1. **Add Database Templates:** We are looking for contributors to help build out the `PostgreSQL (Prisma)`, templates in the `src/templates` folder.
78
- 2. **Report Bugs:** Found a glitch? Open an [issue](https://github.com/Open-Core-Lab/exp-gen/issues).
79
- 3. **Feature Requests:** Have an idea for a new feature? Let us know!
283
+ **Upcoming features include:**
80
284
 
81
- ### Local Development Setup
285
+ - **Prisma support**
286
+ - **Docker template generation**
287
+ - **JWT Authentication template**
288
+ - **Swagger/OpenAPI generation**
289
+ - **Testing templates (Vitest/Jest)**
290
+ - **Redis integration**
291
+ - **Prisma PostgreSQL template**
292
+ - **Environment profile generator**
293
+ - **More Regex Simulator utilities**
294
+
295
+ ---
82
296
 
83
- If you want to work on the CLI itself:
297
+ ## ⭐ Support
84
298
 
85
- 1. Clone the repo: `git clone https://github.com/Open-Core-Lab/exp-gen.git`
86
- 2. Install dependencies: `npm install`
87
- 3. Make your changes and submit a Pull Request!
299
+ If you enjoy using **exp-gen**, consider giving the repository a ⭐ on GitHub.
300
+
301
+ It helps the project grow and supports future development.
302
+
303
+ **Repository: [exp-gen](https://github.com/Open-Core-Lab/exp-gen)**
88
304
 
89
305
  ---
90
306
 
91
- ## 📄 License
307
+ # 📄 License
92
308
 
93
309
  This project is licensed under the **[MIT License](https://github.com/Open-Core-Lab/exp-gen/blob/main/LICENSE)**.
94
310
 
95
- ---
311
+ **Happy coding! 🚀**
96
312
 
97
- **Happy coding! 🚀** _Maintained by [Madhusha Prasad](https://github.com/MadhushaPrasad)_
313
+ _Maintained with âĪïļ by [Madhusha Prasad](https://github.com/MadhushaPrasad)_
Binary file
Binary file
Binary file
@@ -20,6 +20,7 @@ async function copyAssets() {
20
20
  { src: "LICENSE", dest: "LICENSE" },
21
21
  { src: "README.md", dest: "README.md" },
22
22
  { src: "package-config/package.json", dest: "package.json" },
23
+ { src: "bin/assets", dest: "bin/assets" },
23
24
  ];
24
25
  for (const file of filesToCopy) {
25
26
  const srcFile = path.resolve(rootDir, file.src);
@@ -1 +1 @@
1
- {"version":3,"file":"copyTemplates.js","sourceRoot":"","sources":["../../bin/copyTemplates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,eAAe;QACf,wEAAwE;QACxE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAE9C,wBAAwB;QACxB,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EA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GAAG,EAAE,6BAA6B,EAAE,IAAI,EAAE,cAAc,EAAE;YAC5D,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE;SAC1C,CAAC;QAEF,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAElD,sDAAsD;YACtD,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBACjC,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBACjC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,mBAAmB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAC3D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,GAAG,+BAA+B,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,UAAU,EAAE,CAAC"}
@@ -0,0 +1,233 @@
1
+ import http from "http";
2
+ import net from "net";
3
+ import { exec } from "child_process";
4
+ import pc from "picocolors";
5
+ import * as p from "@clack/prompts";
6
+ function findAvailablePort(port) {
7
+ return new Promise((resolve) => {
8
+ const server = net.createServer();
9
+ server.listen(port, () => {
10
+ server.close(() => resolve(port));
11
+ });
12
+ server.on("error", () => resolve(findAvailablePort(port + 1)));
13
+ });
14
+ }
15
+ function openBrowser(url) {
16
+ const commands = {
17
+ win32: `start "" "${url}"`,
18
+ darwin: `open "${url}"`,
19
+ linux: `xdg-open "${url}"`,
20
+ };
21
+ const command = commands[process.platform] ?? commands.linux;
22
+ exec(command);
23
+ }
24
+ // --- Regex simulator Logic ---
25
+ const clientScript = `
26
+ const pattern = document.querySelector("#pattern");
27
+ const flags = document.querySelector("#flags");
28
+ const input = document.querySelector("#input");
29
+ const results = document.querySelector("#results");
30
+ const error = document.querySelector("#error");
31
+ const count = document.querySelector("#count");
32
+ const explain = document.querySelector("#explain");
33
+
34
+ function explainRegex(value) {
35
+ const rules = {
36
+ "\\\\d": "Matches any digit (0-9)",
37
+ "\\\\w": "Matches word characters",
38
+ "+": "Requires one or more repetitions",
39
+ "*": "Allows zero or more repetitions",
40
+ "^": "Start of line/input anchor",
41
+ "$": "End of line/input anchor",
42
+ "(?<": "Named capture group"
43
+ };
44
+
45
+ explain.innerHTML = "";
46
+
47
+ Object.keys(rules)
48
+ .filter(x => value.includes(x))
49
+ .forEach(x => {
50
+ explain.innerHTML += \`
51
+ <div>
52
+ <span class="token">\${x}</span> - \${rules[x]}
53
+ </div>
54
+ \`;
55
+ });
56
+
57
+ if (!explain.innerHTML) {
58
+ explain.innerHTML = "â„đ No special tokens detected";
59
+ }
60
+ }
61
+
62
+ function run() {
63
+ results.innerHTML = "";
64
+ error.classList.add("hidden");
65
+
66
+ try {
67
+ let combinedFlags = flags.value;
68
+ if (!combinedFlags.includes("g")) combinedFlags += "g";
69
+ if (!combinedFlags.includes("m")) combinedFlags += "m";
70
+
71
+ const regex = new RegExp(pattern.value, combinedFlags);
72
+ let matches = [];
73
+ let m;
74
+
75
+ while ((m = regex.exec(input.value)) !== null) {
76
+ matches.push(m);
77
+ if (m[0] === "") {
78
+ regex.lastIndex++;
79
+ }
80
+ if (matches.length > 100) break;
81
+ }
82
+
83
+ count.innerText = \`\${matches.length} match\${matches.length === 1 ? "" : "es"}\`;
84
+
85
+ if (!matches.length) {
86
+ results.innerHTML = \`<div class="text-yellow-400">No matches found</div>\`;
87
+ return;
88
+ }
89
+
90
+ matches.forEach((m, i) => {
91
+ results.innerHTML += \`
92
+ <div class="bg-slate-950 border border-slate-800 rounded-lg p-4">
93
+ <div class="text-green-400">✓ Match #\${i + 1}</div>
94
+ <div class="mt-2">Value: <b>\${m[0]}</b></div>
95
+ <div class="text-xs text-slate-500">Index: \${m.index}</div>
96
+ \${m.slice(1).map((g, n) => \`
97
+ <div class="text-cyan-400 pl-2 border-l border-slate-800 mt-1 text-xs">
98
+ Group \${n + 1}: \${g !== undefined ? g : 'undefined'}
99
+ </div>
100
+ \`).join("")}
101
+ </div>
102
+ \`;
103
+ });
104
+
105
+ explainRegex(pattern.value);
106
+ } catch (e) {
107
+ error.classList.remove("hidden");
108
+ error.innerHTML = \`
109
+ <strong>Invalid Regex</strong><br>
110
+ \${e.message}<br><br>
111
+ Tip: Check brackets (), [], {}, and flags.
112
+ \`;
113
+ count.innerText = "error";
114
+ }
115
+ }
116
+
117
+ [pattern, flags, input].forEach(x => x.addEventListener("input", run));
118
+ run();
119
+ `;
120
+ // --- Static Pure HTML Template ---
121
+ const htmlContent = `
122
+ <!DOCTYPE html>
123
+ <html>
124
+ <head>
125
+ <meta charset="UTF-8">
126
+ <title>exp-gen Regex Simulator</title>
127
+ <script src="https://cdn.tailwindcss.com"></script>
128
+ <style>
129
+ body { font-family: "JetBrains Mono", "Fira Code", monospace; }
130
+ textarea, input { outline: none; }
131
+ .glow { box-shadow: 0 0 25px rgba(34, 211, 238, .15); }
132
+ .token { padding: 4px 8px; border-radius: 6px; background: #1e293b; color: #38bdf8; font-size: 12px; }
133
+ .flag-token { padding: 2px 6px; border-radius: 4px; background: #2e1065; color: #c084fc; font-size: 11px; font-weight: bold; }
134
+ </style>
135
+ </head>
136
+ <body class="bg-[#020617] text-slate-200 min-h-screen">
137
+ <header class="p-5 border-b border-slate-800 bg-[#0f172a] flex justify-between">
138
+ <div>
139
+ <h1 class="text-xl font-bold text-cyan-400">🚀 exp-gen Regex Simulator</h1>
140
+ <p class="text-xs text-slate-400">Interactive JavaScript Regex Debugger</p>
141
+ </div>
142
+ <div class="text-xs text-slate-500">CLI Powered Tool</div>
143
+ </header>
144
+
145
+ <main class="grid lg:grid-cols-2 gap-5 p-5">
146
+ <section class="space-y-5">
147
+ <div class="bg-[#0f172a] border border-slate-800 rounded-xl p-5 glow">
148
+ <div class="flex flex-col md:flex-row md:items-center justify-between gap-2 mb-3">
149
+ <h2 class="text-sm text-slate-400">REGEX PATTERN & FLAGS</h2>
150
+
151
+ <div class="flex flex-wrap gap-1.5 items-center">
152
+ <span class="text-[11px] text-slate-500 mr-1">Flags:</span>
153
+ <span class="flag-token" title="Global: Find all matches">g → global</span>
154
+ <span class="flag-token" title="Multiline: ^ and $ match line boundaries">m → multiline</span>
155
+ <span class="flag-token" title="Insensitive: Case-blind matching">i → insensitive</span>
156
+ <span class="flag-token" title="Single-line: Dot matches newline">s → dotAll</span>
157
+ </div>
158
+ </div>
159
+
160
+ <div class="flex">
161
+ <span class="bg-slate-900 px-3 py-3 text-cyan-400">/</span>
162
+ <input id="pattern" class="flex-1 bg-slate-950 p-3 font-mono" value="(?&lt;name&gt;\\w+)-(\\d+)">
163
+ <span class="bg-slate-900 px-3 py-3 text-cyan-400">/</span>
164
+ <input id="flags" class="w-20 bg-slate-950 p-3 text-purple-400 font-bold tracking-wide placeholder-slate-700" value="m" placeholder="flags">
165
+ </div>
166
+ <div id="error" class="hidden mt-3 bg-red-950 border border-red-900 text-red-300 p-3 rounded-lg text-xs"></div>
167
+ </div>
168
+
169
+ <div class="bg-[#0f172a] border border-slate-800 rounded-xl p-5">
170
+ <h2 class="text-sm text-slate-400 mb-3">TEST STRING</h2>
171
+ <textarea id="input" class="w-full h-52 bg-slate-950 rounded-lg p-4 font-mono">hello-123\nworld-456\nbad-value\nMadhusha@gmail.com\nmadushaprasad21@gmail.com</textarea>
172
+ </div>
173
+
174
+ <div class="bg-[#0f172a] border border-slate-800 rounded-xl p-5">
175
+ <h2 class="text-sm text-slate-400 mb-3">COMMON RULES</h2>
176
+ <div class="flex flex-wrap gap-2">
177
+ <span class="token">\\d → number</span>
178
+ <span class="token">\\w → word</span>
179
+ <span class="token">+ → repeat</span>
180
+ <span class="token">* → optional</span>
181
+ <span class="token">^ → start</span>
182
+ <span class="token">$ → end</span>
183
+ <span class="token">() → group</span>
184
+ </div>
185
+ </div>
186
+ </section>
187
+
188
+ <section class="bg-[#0f172a] border border-slate-800 rounded-xl p-5">
189
+ <div class="flex justify-between">
190
+ <h2 class="text-sm text-slate-400">MATCH RESULTS</h2>
191
+ <span id="count" class="text-xs text-green-400">0 matches</span>
192
+ </div>
193
+ <div id="results" class="mt-5 space-y-3"></div>
194
+
195
+ <div class="mt-5 border-t border-slate-800 pt-5">
196
+ <h2 class="text-sm text-slate-400 mb-3">PATTERN EXPLANATION</h2>
197
+ <div id="explain" class="text-xs text-slate-300 space-y-2"></div>
198
+ </div>
199
+ </section>
200
+ </main>
201
+
202
+ <script>${clientScript}</script>
203
+ </body>
204
+ </html>
205
+ `;
206
+ export async function runRegexSimulator() {
207
+ console.clear();
208
+ // Native HTTP Server Setup
209
+ const server = http.createServer((req, res) => {
210
+ res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
211
+ res.end(htmlContent);
212
+ });
213
+ const port = await findAvailablePort(4000);
214
+ await new Promise((resolve) => {
215
+ server.listen(port, () => {
216
+ const url = `http://localhost:${port}`;
217
+ p.outro(pc.green("✔ Regex simulator environment started"));
218
+ // Print a clean visual card in the terminal console
219
+ // Pixel-perfect console dashboard card
220
+ console.log(pc.cyan("┌──────────────────────────────────────────────────────────────┐"));
221
+ console.log(`${pc.cyan("│")} 🔎 ${pc.bold("Live Regex Simulator Environment Active")}`);
222
+ console.log(`${pc.cyan("│")}`);
223
+ console.log(`${pc.cyan("│")} ${pc.dim("Portal URL:")} ${pc.underline(pc.yellow(url.padEnd(38)))}`);
224
+ console.log(`${pc.cyan("│")}`);
225
+ console.log(`${pc.cyan("│")} ${pc.dim("Control:")} Press ${pc.inverse(pc.bold(" Ctrl + C "))} to terminate server`);
226
+ console.log(pc.cyan("└──────────────────────────────────────────────────────────────┘\n"));
227
+ openBrowser(url);
228
+ resolve();
229
+ });
230
+ });
231
+ return new Promise(() => { });
232
+ }
233
+ //# sourceMappingURL=regexSimulator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regexSimulator.js","sourceRoot":"","sources":["../../bin/regexSimulator.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEpC,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;YACvB,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,GAAW;IAC9B,MAAM,QAAQ,GAAG;QACf,KAAK,EAAE,aAAa,GAAG,GAAG;QAC1B,MAAM,EAAE,SAAS,GAAG,GAAG;QACvB,KAAK,EAAE,aAAa,GAAG,GAAG;KAC3B,CAAC;IAEF,MAAM,OAAO,GACX,QAAQ,CAAC,OAAO,CAA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CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,yCAAyC,CAAC,EAAE,CAC5E,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/B,OAAO,CAAC,GAAG,CACT,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CACxF,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/B,OAAO,CAAC,GAAG,CACT,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,sBAAsB,CAC5G,CAAC;YACF,OAAO,CAAC,GAAG,CACT,EAAE,CAAC,IAAI,CACL,oEAAoE,CACrE,CACF,CAAC;YACF,WAAW,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC/B,CAAC"}
package/bin/script.js CHANGED
@@ -6,6 +6,7 @@ import fs from "fs/promises";
6
6
  import path from "path";
7
7
  import { fileURLToPath } from "url";
8
8
  import scaffoldProject from "./scaffoldProject.js";
9
+ import { runRegexSimulator } from "./regexSimulator.js";
9
10
  const __filename = fileURLToPath(import.meta.url);
10
11
  const __dirname = path.dirname(__filename);
11
12
  async function getAppVersion() {
@@ -39,6 +40,19 @@ async function main() {
39
40
  console.clear();
40
41
  const appVersion = await getAppVersion();
41
42
  p.intro(`${pc.bgCyan(pc.black(" EXPRESS GENERATOR "))} ${pc.dim(`v${appVersion}`)}\n${pc.dim("Scaffold your Express API in seconds 🚀")}`);
43
+ // choose scaffold or regex simulator
44
+ const action = await safePrompt(p.select({
45
+ message: "What would you like to do?\n",
46
+ options: [
47
+ { value: "scaffold", label: "🚀 Scaffold a new Express API" },
48
+ { value: "regex", label: "🔎 Run Regex Simulator" },
49
+ ],
50
+ }));
51
+ // check user input
52
+ if (action === "regex") {
53
+ await runRegexSimulator();
54
+ process.exit(0);
55
+ }
42
56
  const project = await p.group({
43
57
  name: () => safePrompt(p.text({
44
58
  message: "Project name",
package/bin/script.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"script.js","sourceRoot":"","sources":["../../bin/script.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,KAAK,UAAU,aAAa;IAC1B,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,gCAAgC,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC;KAC3C,CAAC;IAEF,KAAK,MAAM,UAAU,IAAI,UAAU,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ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AO,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAC/E,CAAC;IAEF,CAAC,CAAC,IAAI,CACJ,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;MAC7C,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,SAAS;MACjC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;MAC5C,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAC9D,uBAAuB,CACxB,CAAC;IAEF,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC;IAC9B,EAAE,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;IAE7B,OAAO,CAAC,OAAO;QACb,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC;QACxB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,4BAA4B,CAC1C;;IAEE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAE1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madhusha_99/exp-gen",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "This is a very simple and small generator for creating Express.js projects with TypeScript or Javascript. You can use it to quickly start a new API project.",
5
5
  "main": "bin/script.js",
6
6
  "bin": {