lamix 4.2.8 → 4.2.9

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
@@ -3,7 +3,7 @@ This package supports MySQL (mysql2), PostgreSQL (pg), and SQLite (sqlite3).
3
3
  A simple Node.js CLI for generating Models and running database migrations and seeders with MySQL, using a custom DB wrapper.
4
4
 
5
5
  ---
6
- get all Usage in examples folder provided for any issue or support get in tourch @ `andrewkhabweri@gmail.com`
6
+ get all Usage in examples provided for any issue or support get in tourch @ `andrewkhabweri@gmail.com`
7
7
  ## Features
8
8
 
9
9
  - Generate migration files dynamically with fields
@@ -51,7 +51,7 @@ image
51
51
  file
52
52
 
53
53
 
54
- Migrations table Supports chainable modifiers filled Manually :
54
+ Migrations table Supports chainable modifiers filled can be added Manually :
55
55
 
56
56
  .notNullable()
57
57
 
@@ -86,8 +86,8 @@ npm i lamix
86
86
 
87
87
  2. Install dependencies (if any).
88
88
  > This tool uses `mysql2`,`pg`,`sqlite3` driver, so make sure you install your prefered driver:
89
- EITHER
90
- Configure DB via environment variables: `'DB_CONNECTION=mysql',DB_HOST=yourvalue`, `DB_USER=yourvalue`, `DB_PASS=yourvalue`, `DB_NAME=yourvalue`, `DB_PORT=yourvalue`, `DB_CONNECTION_LIMIT=yourvalue`.
89
+ DATABASE CONNECTION IN `.env`FILE
90
+ Configure DB via environment variables: `'DB_CONNECTION=mysql',DB_HOST=your db hast`, `DB_USER=your db user`, `DB_PASS=your db password`, `DB_NAME=your db name`, `DB_PORT=your db port`, `DB_CONNECTION_LIMIT=100`.
91
91
 
92
92
  ## Quick start
93
93
  for database connection use any driver of your choice eg
@@ -104,15 +104,8 @@ for database connection use any driver of your choice eg
104
104
  ```bash
105
105
  npm i lamix
106
106
 
107
- npm install mysql2
107
+ npm install mysql2 # or pg or sqlite3
108
108
 
109
109
  ```bash
110
- #Make Sure you put this in package.json inside your project directory for
111
- #CLI generating Commands to work
112
-
113
- "scripts": {
114
- "artisan": "node ./node_modules/lamix/artisan.js"
115
- }
116
-
117
110
  # TO See All the Available CLI Commands Run in Terminal
118
- npm run artisan --
111
+ npx lamix
package/artisan.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/artisan.js CHANGED
@@ -592,22 +592,21 @@ module.exports = ${className};
592
592
  📦 CLI Migration & Seeder Tool
593
593
 
594
594
  Usage:
595
- npm run artisan --
595
+ npx lamix
596
596
  🔹 Migration Commands:
597
- npm run artisan -- make:migration <TableName> [columns]
598
- npm run artisan -- migrate
599
- npm run artisan -- migrate:rollback
597
+ make:migration <TableName> [column:type ...]
598
+ migrate
599
+ migrate:rollback
600
600
 
601
601
  🔹 Seeder Commands:
602
- npm run artisan -- make:seeder <name>
603
- npm run artisan -- db:seed
604
- npm run artisan -- db:seed:refresh
605
- npm run artisan -- db:seed:only <filename.js>
602
+ make:seeder <name>
603
+ db:seed
604
+ db:seed:refresh
605
+ db:seed:only <file>
606
606
 
607
607
  🔹 Model Generator:
608
- npm run artisan -- make:model <name>
609
- npm run artisan -- make:model <ModelName> [field:type ...]
610
- npm run artisan -- make:model <name> name:string price:decimal stock:integer
608
+ make:model <Name>
609
+ make:model <Name> field:type field:type
611
610
  `);
612
611
  }
613
612
  })();
package/examples/User.md CHANGED
@@ -12,7 +12,7 @@ class User extends BaseModel {
12
12
  email: 'required|email|unique:users,email',
13
13
  password: 'required|string|min:6',
14
14
  phone: 'nullable|phone',
15
- status: 'nullable|boolean'
15
+ status: 'boolean'
16
16
  };
17
17
 
18
18
  profile() {
@@ -34,8 +34,8 @@ class User extends BaseModel {
34
34
 
35
35
  // One-to-many: User -> Post
36
36
  posts() {
37
- Post = require('./Post');
38
- return this.hasMany(Post, 'user_id', 'id').onDelete('cascade');
37
+ const Post = require('./Post');
38
+ return this.hasMany(Post', 'user_id', 'id').onDelete('cascade');
39
39
  }
40
40
  }
41
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lamix",
3
- "version": "4.2.8",
3
+ "version": "4.2.9",
4
4
  "description": "lamix - ORM for Node-express js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -15,6 +15,7 @@
15
15
  "index.js",
16
16
  "index.d.ts",
17
17
  "artisan.js",
18
+ "artisan.d.ts",
18
19
  "README.md",
19
20
  "examples"
20
21
  ],
@@ -22,12 +23,14 @@
22
23
  "type": "git",
23
24
  "url": "https://github.com/andrewkhabweri-spec/lamix.git"
24
25
  },
26
+ "bin": {
27
+ "lamix": "./artisan.js"
28
+ },
25
29
  "scripts": {
26
- "artisan": "node artisan.js",
27
30
  "build": "tsc && echo 'Build complete'"
28
31
  },
29
32
  "devDependencies": {
30
- "@types/node": "^24.1.0",
33
+ "@types/node": "^25.0.3",
31
34
  "typescript": "^5.9.3"
32
35
  },
33
36
  "dependencies": {