@arikajs/cli 0.0.1

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.
Files changed (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +366 -0
  3. package/dist/bin/arika.d.ts +3 -0
  4. package/dist/bin/arika.d.ts.map +1 -0
  5. package/dist/bin/arika.js +21 -0
  6. package/dist/bin/arika.js.map +1 -0
  7. package/dist/src/ApplicationLoader.d.ts +8 -0
  8. package/dist/src/ApplicationLoader.d.ts.map +1 -0
  9. package/dist/src/ApplicationLoader.js +31 -0
  10. package/dist/src/ApplicationLoader.js.map +1 -0
  11. package/dist/src/Bootstrap.d.ts +5 -0
  12. package/dist/src/Bootstrap.d.ts.map +1 -0
  13. package/dist/src/Bootstrap.js +66 -0
  14. package/dist/src/Bootstrap.js.map +1 -0
  15. package/dist/src/Commands/CacheTableCommand.d.ts +7 -0
  16. package/dist/src/Commands/CacheTableCommand.d.ts.map +1 -0
  17. package/dist/src/Commands/CacheTableCommand.js +45 -0
  18. package/dist/src/Commands/CacheTableCommand.js.map +1 -0
  19. package/dist/src/Commands/DatabaseCommand.d.ts +11 -0
  20. package/dist/src/Commands/DatabaseCommand.d.ts.map +1 -0
  21. package/dist/src/Commands/DatabaseCommand.js +94 -0
  22. package/dist/src/Commands/DatabaseCommand.js.map +1 -0
  23. package/dist/src/Commands/DbSeedCommand.d.ts +10 -0
  24. package/dist/src/Commands/DbSeedCommand.d.ts.map +1 -0
  25. package/dist/src/Commands/DbSeedCommand.js +70 -0
  26. package/dist/src/Commands/DbSeedCommand.js.map +1 -0
  27. package/dist/src/Commands/DocsGenerateCommand.d.ts +8 -0
  28. package/dist/src/Commands/DocsGenerateCommand.d.ts.map +1 -0
  29. package/dist/src/Commands/DocsGenerateCommand.js +102 -0
  30. package/dist/src/Commands/DocsGenerateCommand.js.map +1 -0
  31. package/dist/src/Commands/KeyGenerateCommand.d.ts +9 -0
  32. package/dist/src/Commands/KeyGenerateCommand.d.ts.map +1 -0
  33. package/dist/src/Commands/KeyGenerateCommand.js +44 -0
  34. package/dist/src/Commands/KeyGenerateCommand.js.map +1 -0
  35. package/dist/src/Commands/ListCommand.d.ts +7 -0
  36. package/dist/src/Commands/ListCommand.d.ts.map +1 -0
  37. package/dist/src/Commands/ListCommand.js +26 -0
  38. package/dist/src/Commands/ListCommand.js.map +1 -0
  39. package/dist/src/Commands/MakeMigrationCommand.d.ts +14 -0
  40. package/dist/src/Commands/MakeMigrationCommand.d.ts.map +1 -0
  41. package/dist/src/Commands/MakeMigrationCommand.js +72 -0
  42. package/dist/src/Commands/MakeMigrationCommand.js.map +1 -0
  43. package/dist/src/Commands/MakeSeederCommand.d.ts +14 -0
  44. package/dist/src/Commands/MakeSeederCommand.d.ts.map +1 -0
  45. package/dist/src/Commands/MakeSeederCommand.js +56 -0
  46. package/dist/src/Commands/MakeSeederCommand.js.map +1 -0
  47. package/dist/src/Commands/MigrateCommand.d.ts +10 -0
  48. package/dist/src/Commands/MigrateCommand.d.ts.map +1 -0
  49. package/dist/src/Commands/MigrateCommand.js +69 -0
  50. package/dist/src/Commands/MigrateCommand.js.map +1 -0
  51. package/dist/src/Commands/MigrateRollbackCommand.d.ts +10 -0
  52. package/dist/src/Commands/MigrateRollbackCommand.d.ts.map +1 -0
  53. package/dist/src/Commands/MigrateRollbackCommand.js +69 -0
  54. package/dist/src/Commands/MigrateRollbackCommand.js.map +1 -0
  55. package/dist/src/Commands/NewCommand.d.ts +8 -0
  56. package/dist/src/Commands/NewCommand.d.ts.map +1 -0
  57. package/dist/src/Commands/NewCommand.js +112 -0
  58. package/dist/src/Commands/NewCommand.js.map +1 -0
  59. package/dist/src/Commands/QueueTableCommand.d.ts +7 -0
  60. package/dist/src/Commands/QueueTableCommand.d.ts.map +1 -0
  61. package/dist/src/Commands/QueueTableCommand.js +49 -0
  62. package/dist/src/Commands/QueueTableCommand.js.map +1 -0
  63. package/dist/src/Commands/ServeCommand.d.ts +7 -0
  64. package/dist/src/Commands/ServeCommand.d.ts.map +1 -0
  65. package/dist/src/Commands/ServeCommand.js +60 -0
  66. package/dist/src/Commands/ServeCommand.js.map +1 -0
  67. package/dist/src/TemplateManager.d.ts +19 -0
  68. package/dist/src/TemplateManager.d.ts.map +1 -0
  69. package/dist/src/TemplateManager.js +133 -0
  70. package/dist/src/TemplateManager.js.map +1 -0
  71. package/dist/src/index.d.ts +3 -0
  72. package/dist/src/index.d.ts.map +1 -0
  73. package/dist/src/index.js +8 -0
  74. package/dist/src/index.js.map +1 -0
  75. package/dist/tests/Cli.test.d.ts +2 -0
  76. package/dist/tests/Cli.test.d.ts.map +1 -0
  77. package/dist/tests/Cli.test.js +16 -0
  78. package/dist/tests/Cli.test.js.map +1 -0
  79. package/package.json +55 -0
  80. package/templates/app/.env.example +47 -0
  81. package/templates/app/app/Controllers/UserController.ts +88 -0
  82. package/templates/app/app/Http/Kernel.ts +18 -0
  83. package/templates/app/app/Models/User.ts +15 -0
  84. package/templates/app/bootstrap/app.ts +13 -0
  85. package/templates/app/config/app.ts +9 -0
  86. package/templates/app/config/cache.ts +37 -0
  87. package/templates/app/config/database.ts +36 -0
  88. package/templates/app/config/filesystems.ts +33 -0
  89. package/templates/app/config/http.ts +5 -0
  90. package/templates/app/config/logging.ts +35 -0
  91. package/templates/app/config/mail.ts +27 -0
  92. package/templates/app/config/queue.ts +40 -0
  93. package/templates/app/database/migrations/0001_create_users_table.ts +23 -0
  94. package/templates/app/package.json +21 -0
  95. package/templates/app/resources/views/welcome.html +470 -0
  96. package/templates/app/routes/api.ts +34 -0
  97. package/templates/app/routes/web.ts +6 -0
  98. package/templates/app/server.ts +16 -0
  99. package/templates/app/tsconfig.json +15 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ArikaJs
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,366 @@
1
+ # @arikajs/cli
2
+
3
+ <div align="center">
4
+
5
+ **The Official Command-Line Interface for ArikaJS**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@arikajs/cli.svg)](https://www.npmjs.com/package/@arikajs/cli)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ </div>
11
+
12
+ ---
13
+
14
+ ## 📦 Installation & Usage
15
+
16
+ ### Option 1: Use with `npx` (Recommended)
17
+
18
+ The fastest way to use the ArikaJS CLI without installing it globally:
19
+
20
+ ```bash
21
+ npx @arikajs/cli new my-app
22
+ ```
23
+
24
+ ### Option 2: Global Installation
25
+
26
+ Install the CLI globally to use the `arika` command anywhere:
27
+
28
+ ```bash
29
+ npm install -g @arikajs/cli
30
+
31
+ # Then use directly:
32
+ arika new my-app
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 🚀 Quick Start
38
+
39
+ Create a new ArikaJS application:
40
+
41
+ ```bash
42
+ # Create a new project
43
+ arika new my-awesome-app
44
+
45
+ # Navigate to your project
46
+ cd my-awesome-app
47
+
48
+ # Install dependencies
49
+ npm install
50
+
51
+ # Start the development server
52
+ npm run dev
53
+ ```
54
+
55
+ Your application will be running at `http://localhost:8000` 🎉
56
+
57
+ ---
58
+
59
+ ## 📋 Available Commands
60
+
61
+ ### `arika new <name>`
62
+
63
+ Create a new ArikaJS application.
64
+
65
+ ```bash
66
+ arika new my-app
67
+ ```
68
+
69
+ **Options:**
70
+ - `<name>` - The name of your application
71
+
72
+ **Interactive Prompts:**
73
+ - Install dependencies automatically? (Y/n)
74
+
75
+ **What it does:**
76
+ - Creates a new directory with your app name
77
+ - Scaffolds the complete application structure
78
+ - Sets up configuration files
79
+ - Generates a secure application key
80
+ - Optionally installs npm dependencies
81
+
82
+ ---
83
+
84
+ ### `arika serve`
85
+
86
+ Start the development server.
87
+
88
+ ```bash
89
+ # Start in development mode with hot-reload
90
+ arika serve --dev
91
+
92
+ # Start in production mode
93
+ arika serve
94
+ ```
95
+
96
+ **Options:**
97
+ - `--dev` - Run with TypeScript hot-reload using tsx
98
+ - `--port <port>` - Specify the port (default: from .env or 8000)
99
+
100
+ ---
101
+
102
+ ### `arika key:generate`
103
+
104
+ Generate a new application encryption key.
105
+
106
+ ```bash
107
+ arika key:generate
108
+ ```
109
+
110
+ **What it does:**
111
+ - Generates a secure random 32-character key
112
+ - Updates your `.env` file with `APP_KEY`
113
+ - Required for encryption, sessions, and security features
114
+
115
+ ---
116
+
117
+ ### `arika migrate`
118
+
119
+ Run database migrations.
120
+
121
+ ```bash
122
+ # Run all pending migrations
123
+ arika migrate
124
+
125
+ # Rollback the last batch of migrations
126
+ arika migrate:rollback
127
+
128
+ # Rollback all migrations
129
+ arika migrate:reset
130
+
131
+ # Rollback and re-run all migrations
132
+ arika migrate:refresh
133
+ ```
134
+
135
+ ---
136
+
137
+ ### `arika make:migration <name>`
138
+
139
+ Create a new database migration.
140
+
141
+ ```bash
142
+ arika make:migration create_users_table
143
+ ```
144
+
145
+ **What it does:**
146
+ - Creates a new migration file in `database/migrations/`
147
+ - Includes timestamp prefix for ordering
148
+ - Provides template with `up()` and `down()` methods
149
+
150
+ **Example output:**
151
+ ```
152
+ database/migrations/0001_create_users_table.ts
153
+ ```
154
+
155
+ ---
156
+
157
+ ### `arika queue:table`
158
+
159
+ Create the database table for queue jobs.
160
+
161
+ ```bash
162
+ arika queue:table
163
+ ```
164
+
165
+ **What it does:**
166
+ - Creates a migration for the `jobs` table
167
+ - Sets up the schema for background job processing
168
+
169
+ ---
170
+
171
+ ## 📁 Project Structure
172
+
173
+ When you create a new project with `arika new`, you get this structure:
174
+
175
+ ```
176
+ my-app/
177
+ ├── app/
178
+ │ ├── Controllers/ # HTTP controllers
179
+ │ ├── Models/ # Database models
180
+ │ ├── Middleware/ # Custom middleware
181
+ │ └── Http/
182
+ │ └── Kernel.ts # HTTP kernel configuration
183
+ ├── bootstrap/
184
+ │ └── app.ts # Application bootstrap
185
+ ├── config/ # Configuration files
186
+ │ ├── app.ts
187
+ │ ├── database.ts
188
+ │ └── logging.ts
189
+ ├── database/
190
+ │ └── migrations/ # Database migrations
191
+ ├── routes/
192
+ │ └── web.ts # Route definitions
193
+ ├── .env # Environment variables
194
+ ├── .env.example # Environment template
195
+ ├── server.ts # Application entry point
196
+ ├── tsconfig.json # TypeScript configuration
197
+ └── package.json # npm dependencies
198
+ ```
199
+
200
+ ---
201
+
202
+ ## 🔧 Configuration
203
+
204
+ The CLI respects your project's configuration:
205
+
206
+ ### Environment Variables
207
+
208
+ Create a `.env` file in your project root:
209
+
210
+ ```env
211
+ APP_NAME=MyApp
212
+ APP_ENV=development
213
+ APP_KEY=your-32-character-secret-key
214
+ APP_PORT=8000
215
+
216
+ DB_CONNECTION=mysql
217
+ DB_HOST=localhost
218
+ DB_PORT=3306
219
+ DB_DATABASE=myapp
220
+ DB_USERNAME=root
221
+ DB_PASSWORD=secret
222
+ ```
223
+
224
+ ### TypeScript Configuration
225
+
226
+ The generated `tsconfig.json` is optimized for ArikaJS:
227
+
228
+ ```json
229
+ {
230
+ "compilerOptions": {
231
+ "target": "ES2022",
232
+ "module": "commonjs",
233
+ "outDir": "./dist",
234
+ "rootDir": "./",
235
+ "strict": true,
236
+ "esModuleInterop": true,
237
+ "skipLibCheck": true,
238
+ "experimentalDecorators": true,
239
+ "emitDecoratorMetadata": true
240
+ }
241
+ }
242
+ ```
243
+
244
+ ---
245
+
246
+ ## 🎯 Usage Examples
247
+
248
+ ### Creating a New Project
249
+
250
+ ```bash
251
+ # Create a new project
252
+ $ arika new blog-api
253
+
254
+ 🚀 Creating a new ArikaJS application: /path/to/blog-api
255
+
256
+ ? Would you like to install dependencies automatically? Yes
257
+
258
+ Scaffolding project in /path/to/blog-api...
259
+ Installing dependencies...
260
+
261
+ ✨ Project created successfully!
262
+
263
+ Next steps:
264
+ cd blog-api
265
+ npm run dev
266
+
267
+ Happy coding with ArikaJS!
268
+ ```
269
+
270
+ ### Starting Development Server
271
+
272
+ ```bash
273
+ $ cd blog-api
274
+ $ arika serve --dev
275
+
276
+ Starting ArikaJS development server...
277
+ Using tsx to run TypeScript server with hot-reload...
278
+ 🚀 Starting ArikaJS application...
279
+ [2026-02-15 19:00:00] INFO: ArikaJS application listening on http://localhost:8000
280
+ ```
281
+
282
+ ### Running Migrations
283
+
284
+ ```bash
285
+ # Create a migration
286
+ $ arika make:migration create_posts_table
287
+ ✅ Created migration: database/migrations/0001_create_posts_table.ts
288
+
289
+ # Run migrations
290
+ $ arika migrate
291
+ Migrating: 0001_create_posts_table
292
+ Migrated: 0001_create_posts_table
293
+ ```
294
+
295
+ ---
296
+
297
+ ## 🛠️ Development
298
+
299
+ ### Building from Source
300
+
301
+ ```bash
302
+ # Clone the repository
303
+ git clone https://github.com/arikajs/cli.git
304
+ cd cli
305
+
306
+ # Install dependencies
307
+ npm install
308
+
309
+ # Build the CLI
310
+ npm run build
311
+
312
+ # Link for local development
313
+ npm link
314
+ ```
315
+
316
+ ### Testing
317
+
318
+ ```bash
319
+ # Run tests
320
+ npm test
321
+
322
+ # Run tests in watch mode
323
+ npm run test:watch
324
+ ```
325
+
326
+ ---
327
+
328
+ ## 📚 Related Packages
329
+
330
+ The CLI works seamlessly with the ArikaJS ecosystem:
331
+
332
+ - [`arikajs`](https://www.npmjs.com/package/arikajs) - Core framework
333
+ - [`@arikajs/router`](https://www.npmjs.com/package/@arikajs/router) - Routing system
334
+ - [`@arikajs/database`](https://www.npmjs.com/package/@arikajs/database) - Database ORM
335
+ - [`@arikajs/auth`](https://www.npmjs.com/package/@arikajs/auth) - Authentication
336
+ - [`@arikajs/validation`](https://www.npmjs.com/package/@arikajs/validation) - Validation
337
+
338
+ ---
339
+
340
+ ## 🤝 Contributing
341
+
342
+ We welcome contributions! Please see our [Contributing Guide](https://github.com/arikajs/cli/blob/main/CONTRIBUTING.md).
343
+
344
+ ---
345
+
346
+ ## 📝 License
347
+
348
+ The ArikaJS CLI is open-sourced software licensed under the [MIT license](LICENSE).
349
+
350
+ ---
351
+
352
+ ## 💬 Support
353
+
354
+ - 📖 [Documentation](https://github.com/arikajs/cli#readme)
355
+ - 💬 [Discord Community](https://discord.gg/arikajs)
356
+ - 🐛 [Issue Tracker](https://github.com/arikajs/cli/issues)
357
+
358
+ ---
359
+
360
+ <div align="center">
361
+
362
+ **Part of the ArikaJS Framework**
363
+
364
+ [GitHub](https://github.com/arikajs) • [npm](https://www.npmjs.com/package/arikajs)
365
+
366
+ </div>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=arika.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arika.d.ts","sourceRoot":"","sources":["../../bin/arika.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const Bootstrap_1 = require("../src/Bootstrap");
5
+ async function run() {
6
+ try {
7
+ const registry = await Bootstrap_1.Bootstrap.boot();
8
+ let args = process.argv.slice(2);
9
+ // Default to 'list' if no command provided
10
+ if (args.length === 0) {
11
+ args = ['list'];
12
+ }
13
+ await registry.run(args);
14
+ }
15
+ catch (error) {
16
+ console.error(`\x1b[31mError: ${error.message}\x1b[0m`);
17
+ process.exit(1);
18
+ }
19
+ }
20
+ run();
21
+ //# sourceMappingURL=arika.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arika.js","sourceRoot":"","sources":["../../bin/arika.ts"],"names":[],"mappings":";;;AAEA,gDAA6C;AAE7C,KAAK,UAAU,GAAG;IACd,IAAI,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,qBAAS,CAAC,IAAI,EAAE,CAAC;QACxC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEjC,2CAA2C;QAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpB,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC;QAED,MAAM,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,kBAAkB,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,GAAG,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare class ApplicationLoader {
2
+ static findRoot(): string;
3
+ static load(): Promise<{
4
+ root: string;
5
+ isArikaProject: boolean;
6
+ }>;
7
+ }
8
+ //# sourceMappingURL=ApplicationLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApplicationLoader.d.ts","sourceRoot":"","sources":["../../src/ApplicationLoader.ts"],"names":[],"mappings":"AAIA,qBAAa,iBAAiB;WACZ,QAAQ,IAAI,MAAM;WAaZ,IAAI;;;;CAS3B"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ApplicationLoader = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ class ApplicationLoader {
10
+ static findRoot() {
11
+ let current = process.cwd();
12
+ while (current !== path_1.default.dirname(current)) {
13
+ if (fs_1.default.existsSync(path_1.default.join(current, 'package.json'))) {
14
+ return current;
15
+ }
16
+ current = path_1.default.dirname(current);
17
+ }
18
+ return process.cwd();
19
+ }
20
+ static async load() {
21
+ const root = this.findRoot();
22
+ // In a real scenario, we would load the application from the project root
23
+ // and boot the foundation.
24
+ return {
25
+ root,
26
+ isArikaProject: fs_1.default.existsSync(path_1.default.join(root, 'arika.json')) || fs_1.default.existsSync(path_1.default.join(root, 'kernel.ts'))
27
+ };
28
+ }
29
+ }
30
+ exports.ApplicationLoader = ApplicationLoader;
31
+ //# sourceMappingURL=ApplicationLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApplicationLoader.js","sourceRoot":"","sources":["../../src/ApplicationLoader.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AACxB,4CAAoB;AAEpB,MAAa,iBAAiB;IACnB,MAAM,CAAC,QAAQ;QAClB,IAAI,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAE5B,OAAO,OAAO,KAAK,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACvC,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;gBACpD,OAAO,OAAO,CAAC;YACnB,CAAC;YACD,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;IACzB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,IAAI;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC7B,0EAA0E;QAC1E,2BAA2B;QAC3B,OAAO;YACH,IAAI;YACJ,cAAc,EAAE,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;SAC9G,CAAC;IACN,CAAC;CACJ;AAvBD,8CAuBC"}
@@ -0,0 +1,5 @@
1
+ import { CommandRegistry } from '@arikajs/console';
2
+ export declare class Bootstrap {
3
+ static boot(): Promise<CommandRegistry>;
4
+ }
5
+ //# sourceMappingURL=Bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bootstrap.d.ts","sourceRoot":"","sources":["../../src/Bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAOnD,qBAAa,SAAS;WACE,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;CAyBvD"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Bootstrap = void 0;
37
+ const console_1 = require("@arikajs/console");
38
+ const ApplicationLoader_1 = require("./ApplicationLoader");
39
+ const NewCommand_1 = require("./Commands/NewCommand");
40
+ const ListCommand_1 = require("./Commands/ListCommand");
41
+ const ServeCommand_1 = require("./Commands/ServeCommand");
42
+ const KeyGenerateCommand_1 = require("./Commands/KeyGenerateCommand");
43
+ class Bootstrap {
44
+ static async boot() {
45
+ const registry = new console_1.CommandRegistry();
46
+ // Core commands
47
+ registry.register(NewCommand_1.NewCommand);
48
+ registry.register(ListCommand_1.ListCommand);
49
+ registry.register(ServeCommand_1.ServeCommand);
50
+ registry.register(KeyGenerateCommand_1.KeyGenerateCommand);
51
+ registry.registerLazy('docs:generate', 'Generate API documentation, Postman collection, and OpenAPI spec', () => Promise.resolve().then(() => __importStar(require('./Commands/DocsGenerateCommand'))));
52
+ // Database-related commands (Lazy-loaded)
53
+ registry.registerLazy('migrate', 'Run the database migrations', () => Promise.resolve().then(() => __importStar(require('./Commands/MigrateCommand'))));
54
+ registry.registerLazy('migrate:rollback', 'Rollback the last database migration', () => Promise.resolve().then(() => __importStar(require('./Commands/MigrateRollbackCommand'))));
55
+ registry.registerLazy('make:migration {name}', 'Create a new migration file', () => Promise.resolve().then(() => __importStar(require('./Commands/MakeMigrationCommand'))));
56
+ registry.registerLazy('make:seeder {name}', 'Create a new seeder file', () => Promise.resolve().then(() => __importStar(require('./Commands/MakeSeederCommand'))));
57
+ registry.registerLazy('db:seed {--class=}', 'Seed the database with records', () => Promise.resolve().then(() => __importStar(require('./Commands/DbSeedCommand'))));
58
+ registry.registerLazy('queue:table', 'Create a migration for the queue jobs database table', () => Promise.resolve().then(() => __importStar(require('./Commands/QueueTableCommand'))));
59
+ registry.registerLazy('cache:table', 'Create a migration for the cache database table', () => Promise.resolve().then(() => __importStar(require('./Commands/CacheTableCommand'))));
60
+ const app = await ApplicationLoader_1.ApplicationLoader.load();
61
+ // In the future, this will discovery commands from @arikajs dependencies
62
+ return registry;
63
+ }
64
+ }
65
+ exports.Bootstrap = Bootstrap;
66
+ //# sourceMappingURL=Bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bootstrap.js","sourceRoot":"","sources":["../../src/Bootstrap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAmD;AACnD,2DAAwD;AACxD,sDAAmD;AACnD,wDAAqD;AACrD,0DAAuD;AACvD,sEAAmE;AAEnE,MAAa,SAAS;IACX,MAAM,CAAC,KAAK,CAAC,IAAI;QACpB,MAAM,QAAQ,GAAG,IAAI,yBAAe,EAAE,CAAC;QAEvC,gBAAgB;QAChB,QAAQ,CAAC,QAAQ,CAAC,uBAAU,CAAC,CAAC;QAC9B,QAAQ,CAAC,QAAQ,CAAC,yBAAW,CAAC,CAAC;QAC/B,QAAQ,CAAC,QAAQ,CAAC,2BAAY,CAAC,CAAC;QAChC,QAAQ,CAAC,QAAQ,CAAC,uCAAkB,CAAC,CAAC;QACtC,QAAQ,CAAC,YAAY,CAAC,eAAe,EAAE,kEAAkE,EAAE,GAAG,EAAE,mDAAQ,gCAAgC,GAAC,CAAC,CAAC;QAE3J,0CAA0C;QAC1C,QAAQ,CAAC,YAAY,CAAC,SAAS,EAAE,6BAA6B,EAAE,GAAG,EAAE,mDAAQ,2BAA2B,GAAC,CAAC,CAAC;QAC3G,QAAQ,CAAC,YAAY,CAAC,kBAAkB,EAAE,sCAAsC,EAAE,GAAG,EAAE,mDAAQ,mCAAmC,GAAC,CAAC,CAAC;QACrI,QAAQ,CAAC,YAAY,CAAC,uBAAuB,EAAE,6BAA6B,EAAE,GAAG,EAAE,mDAAQ,iCAAiC,GAAC,CAAC,CAAC;QAC/H,QAAQ,CAAC,YAAY,CAAC,oBAAoB,EAAE,0BAA0B,EAAE,GAAG,EAAE,mDAAQ,8BAA8B,GAAC,CAAC,CAAC;QACtH,QAAQ,CAAC,YAAY,CAAC,oBAAoB,EAAE,gCAAgC,EAAE,GAAG,EAAE,mDAAQ,0BAA0B,GAAC,CAAC,CAAC;QACxH,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,sDAAsD,EAAE,GAAG,EAAE,mDAAQ,8BAA8B,GAAC,CAAC,CAAC;QAC3I,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,iDAAiD,EAAE,GAAG,EAAE,mDAAQ,8BAA8B,GAAC,CAAC,CAAC;QAEtI,MAAM,GAAG,GAAG,MAAM,qCAAiB,CAAC,IAAI,EAAE,CAAC;QAE3C,yEAAyE;QAEzE,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AA1BD,8BA0BC"}
@@ -0,0 +1,7 @@
1
+ import { Command } from '@arikajs/console';
2
+ export declare class CacheTableCommand extends Command {
3
+ signature: string;
4
+ description: string;
5
+ handle(): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=CacheTableCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheTableCommand.d.ts","sourceRoot":"","sources":["../../../src/Commands/CacheTableCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,qBAAa,iBAAkB,SAAQ,OAAO;IACnC,SAAS,SAAiB;IAC1B,WAAW,SAAqD;IAE1D,MAAM;CA+BtB"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CacheTableCommand = void 0;
7
+ const console_1 = require("@arikajs/console");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ class CacheTableCommand extends console_1.Command {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.signature = 'cache:table';
14
+ this.description = 'Create a migration for the cache database table';
15
+ }
16
+ async handle() {
17
+ const migrationsDir = path_1.default.join(process.cwd(), 'database/migrations');
18
+ if (!fs_1.default.existsSync(migrationsDir)) {
19
+ fs_1.default.mkdirSync(migrationsDir, { recursive: true });
20
+ }
21
+ const timestamp = new Date().toISOString().replace(/[-:T]/g, '').split('.')[0];
22
+ const fileName = `${timestamp}_create_cache_table.ts`;
23
+ const filePath = path_1.default.join(migrationsDir, fileName);
24
+ const content = `import { Schema, Blueprint } from '@arikajs/database';
25
+
26
+ export default class CreateCacheTable {
27
+ public async up() {
28
+ await Schema.create('cache', (table: Blueprint) => {
29
+ table.string('key').unique();
30
+ table.mediumText('value');
31
+ table.integer('expiration').nullable();
32
+ });
33
+ }
34
+
35
+ public async down() {
36
+ await Schema.dropIfExists('cache');
37
+ }
38
+ }
39
+ `;
40
+ fs_1.default.writeFileSync(filePath, content);
41
+ this.info(`Migration created: ${filePath}`);
42
+ }
43
+ }
44
+ exports.CacheTableCommand = CacheTableCommand;
45
+ //# sourceMappingURL=CacheTableCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheTableCommand.js","sourceRoot":"","sources":["../../../src/Commands/CacheTableCommand.ts"],"names":[],"mappings":";;;;;;AACA,8CAA2C;AAC3C,4CAAoB;AACpB,gDAAwB;AAExB,MAAa,iBAAkB,SAAQ,iBAAO;IAA9C;;QACW,cAAS,GAAG,aAAa,CAAC;QAC1B,gBAAW,GAAG,iDAAiD,CAAC;IAiC3E,CAAC;IA/BU,KAAK,CAAC,MAAM;QACf,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,qBAAqB,CAAC,CAAC;QAEtE,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YAChC,YAAE,CAAC,SAAS,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/E,MAAM,QAAQ,GAAG,GAAG,SAAS,wBAAwB,CAAC;QACtD,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAEpD,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;CAevB,CAAC;QAEM,YAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAC;IAChD,CAAC;CACJ;AAnCD,8CAmCC"}
@@ -0,0 +1,11 @@
1
+ import { Command } from '@arikajs/console';
2
+ /**
3
+ * Base class for database-related commands
4
+ */
5
+ export declare abstract class DatabaseCommand extends Command {
6
+ /**
7
+ * Get a DatabaseManager instance configured with application settings
8
+ */
9
+ protected getDatabaseManager(): Promise<any>;
10
+ }
11
+ //# sourceMappingURL=DatabaseCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatabaseCommand.d.ts","sourceRoot":"","sources":["../../../src/Commands/DatabaseCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3C;;GAEG;AACH,8BAAsB,eAAgB,SAAQ,OAAO;IACjD;;OAEG;cACa,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC;CA4CrD"}