millas 0.2.6 → 0.2.8

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.
@@ -66,8 +66,6 @@ storage/logs/*.log
66
66
  storage/uploads/*
67
67
  !storage/uploads/.gitkeep
68
68
  database/database.sqlite
69
- # Millas migration snapshot — auto-generated, do not commit
70
- .millas/
71
69
  `,
72
70
 
73
71
  // ─── millas.config.js ─────────────────────────────────────────
@@ -106,6 +104,7 @@ function resolveMillas() {
106
104
  const {
107
105
  Application,
108
106
  Admin,
107
+ LogServiceProvider,
109
108
  CacheServiceProvider,
110
109
  StorageServiceProvider,
111
110
  MailServiceProvider,
@@ -124,6 +123,7 @@ const app = new Application(expressApp);
124
123
 
125
124
  // ── Register service providers ──────────────────────────────────
126
125
  app.providers([
126
+ LogServiceProvider, // first — so Log works in all other providers
127
127
  CacheServiceProvider,
128
128
  StorageServiceProvider,
129
129
  MailServiceProvider,
@@ -198,6 +198,38 @@ module.exports = function (Route) {
198
198
 
199
199
  });
200
200
  };
201
+ `,
202
+
203
+ // ─── config/logging.js ────────────────────────────────────────
204
+ 'config/logging.js': `'use strict';
205
+
206
+ /**
207
+ * Logging Configuration
208
+ *
209
+ * Levels (lowest → highest): verbose | debug | info | warn | error | wtf
210
+ * Channels: 'console' | 'file' | 'null'
211
+ * Formats: 'pretty' (coloured) | 'simple' (plain text) | 'json' (structured)
212
+ */
213
+ module.exports = {
214
+ level: process.env.LOG_LEVEL || (process.env.NODE_ENV === 'production' ? 'info' : 'debug'),
215
+
216
+ defaultTag: process.env.APP_NAME || 'App',
217
+
218
+ channels: [
219
+ {
220
+ driver: 'console',
221
+ format: 'pretty',
222
+ },
223
+ {
224
+ driver: 'file',
225
+ format: 'simple',
226
+ path: 'storage/logs',
227
+ prefix: '${projectName}',
228
+ level: 'warn',
229
+ maxFiles: 30,
230
+ },
231
+ ],
232
+ };
201
233
  `,
202
234
 
203
235
  // ─── config/app.js ────────────────────────────────────────────
@@ -358,37 +390,17 @@ millas make:controller UserController
358
390
 
359
391
  # Generate a model
360
392
  millas make:model User
361
- \`\`\`
362
393
 
363
- ## Database Migrations (Django-style)
364
-
365
- Millas handles migrations automatically — you only edit your model files.
366
-
367
- \`\`\`bash
368
- # 1. Edit app/models/User.js — add, remove, or change fields
369
- # 2. Generate migration files from your changes
370
- millas makemigrations
371
-
372
- # 3. Apply pending migrations to the database
394
+ # Run migrations
373
395
  millas migrate
374
396
  \`\`\`
375
397
 
376
- Other migration commands:
377
-
378
- \`\`\`bash
379
- millas migrate:status # Show which migrations have run
380
- millas migrate:rollback # Undo the last batch
381
- millas migrate:fresh # Drop everything and re-run all migrations
382
- millas migrate:reset # Roll back all migrations
383
- millas migrate:refresh # Reset + re-run (like fresh but using down() methods)
384
- \`\`\`
385
-
386
398
  ## Project Structure
387
399
 
388
400
  \`\`\`
389
401
  app/
390
402
  controllers/ # HTTP controllers
391
- models/ # ORM models ← only file you edit for schema changes
403
+ models/ # ORM models
392
404
  services/ # Business logic
393
405
  middleware/ # HTTP middleware
394
406
  jobs/ # Background jobs
@@ -396,14 +408,13 @@ bootstrap/
396
408
  app.js # Application entry point
397
409
  config/ # Configuration files
398
410
  database/
399
- migrations/ # Auto-generated — do not edit by hand
411
+ migrations/ # Database migrations
400
412
  seeders/ # Database seeders
401
413
  routes/
402
414
  web.js # Web routes
403
415
  api.js # API routes
404
416
  storage/ # Logs, uploads
405
417
  providers/ # Service providers
406
- .millas/ # Migration snapshot (gitignored)
407
418
  \`\`\`
408
419
  `,
409
420
  };