@bejibun/database 0.1.19 → 0.1.20
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/CHANGELOG.md +23 -8
- package/LICENSE +1 -1
- package/README.md +7 -7
- package/commands/db/DbSeedCommand.js +35 -18
- package/package.json +11 -11
- package/tsconfig.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,22 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
## [v0.1.
|
|
6
|
+
## [v0.1.20](https://github.com/Bejibun-Framework/bejibun-database/compare/v0.1.14...v0.1.20) - 2026-05-11
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
### 📖 Changes
|
|
11
|
+
- Added `db:seed --seeder file.ts` for specific file seeder
|
|
12
|
+
- Added `db:seed --force` for skip confirmation in production
|
|
13
|
+
|
|
14
|
+
### ❤️Contributors
|
|
15
|
+
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
16
|
+
|
|
17
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-database/blob/master/CHANGELOG.md
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## [v0.1.14](https://github.com/Bejibun-Framework/bejibun-database/compare/v0.1.12...v0.1.14) - 2025-10-25
|
|
7
22
|
|
|
8
23
|
### 🩹 Fixes
|
|
9
24
|
- Fix `make:migration` migration filename
|
|
@@ -15,11 +30,11 @@ All notable changes to this project will be documented in this file.
|
|
|
15
30
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
16
31
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
17
32
|
|
|
18
|
-
**Full Changelog**: https://github.com/
|
|
33
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-database/blob/master/CHANGELOG.md
|
|
19
34
|
|
|
20
35
|
---
|
|
21
36
|
|
|
22
|
-
## [v0.1.12](https://github.com/
|
|
37
|
+
## [v0.1.12](https://github.com/Bejibun-Framework/bejibun-database/compare/v0.1.11...v0.1.12) - 2025-10-25
|
|
23
38
|
|
|
24
39
|
### 🩹 Fixes
|
|
25
40
|
- Fix `make:migration` counter undefined
|
|
@@ -32,11 +47,11 @@ What's New :
|
|
|
32
47
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
33
48
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
34
49
|
|
|
35
|
-
**Full Changelog**: https://github.com/
|
|
50
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-database/blob/master/CHANGELOG.md
|
|
36
51
|
|
|
37
52
|
---
|
|
38
53
|
|
|
39
|
-
## [v0.1.11](https://github.com/
|
|
54
|
+
## [v0.1.11](https://github.com/Bejibun-Framework/bejibun-database/compare/v0.1.1...v0.1.11) - 2025-10-25
|
|
40
55
|
|
|
41
56
|
### 🩹 Fixes
|
|
42
57
|
|
|
@@ -48,11 +63,11 @@ What's New :
|
|
|
48
63
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
49
64
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
50
65
|
|
|
51
|
-
**Full Changelog**: https://github.com/
|
|
66
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-database/blob/master/CHANGELOG.md
|
|
52
67
|
|
|
53
68
|
---
|
|
54
69
|
|
|
55
|
-
## [v0.1.1](https://github.com/
|
|
70
|
+
## [v0.1.1](https://github.com/Bejibun-Framework/bejibun-database/compare/v0.1.0...v0.1.1) - 2025-10-22
|
|
56
71
|
|
|
57
72
|
### 🩹 Fixes
|
|
58
73
|
|
|
@@ -73,4 +88,4 @@ Available Commands :
|
|
|
73
88
|
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
74
89
|
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
75
90
|
|
|
76
|
-
**Full Changelog**: https://github.com/
|
|
91
|
+
**Full Changelog**: https://github.com/Bejibun-Framework/bejibun-database/blob/master/CHANGELOG.md
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="https://github.com/
|
|
3
|
+
<img src="https://github.com/Bejibun-Framework/bejibun/blob/master/public/images/bejibun.png?raw=true" width="150" alt="Bejibun" />
|
|
4
4
|
|
|
5
|
-
](https://img.shields.io/github/v/release/
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
10
|
|
|
11
11
|
</div>
|
|
12
12
|
|
|
@@ -75,7 +75,7 @@ If you find this project helpful and want to support it, you can donate via cryp
|
|
|
75
75
|
|
|
76
76
|
| EVM | Solana |
|
|
77
77
|
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
78
|
-
| <img src="https://github.com/
|
|
78
|
+
| <img src="https://github.com/Bejibun-Framework/bejibun/blob/master/public/images/EVM.png?raw=true" width="150" /> | <img src="https://github.com/Bejibun-Framework/bejibun/blob/master/public/images/SOL.png?raw=true" width="150" /> |
|
|
79
79
|
| 0xdABe8750061410D35cE52EB2a418c8cB004788B3 | GAnoyvy9p3QFyxikWDh9hA3fmSk2uiPLNWyQ579cckMn |
|
|
80
80
|
|
|
81
81
|
Or you can buy this `$BJBN (Bejibun)` tokens [here](https://pump.fun/coin/CQhbNnCGKfDaKXt8uE61i5DrBYJV7NPsCDD9vQgypump), beware of bots.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Chalk from "@bejibun/logger/facades/Chalk";
|
|
2
|
+
import { ask, defineValue, isNotEmpty } from "@bejibun/utils";
|
|
2
3
|
import ora from "ora";
|
|
3
4
|
import path from "path";
|
|
4
5
|
import Database from "../../facades/Database";
|
|
@@ -20,7 +21,10 @@ export default class DbSeedCommand {
|
|
|
20
21
|
*
|
|
21
22
|
* @var $options Array<Array<any>>
|
|
22
23
|
*/
|
|
23
|
-
$options = [
|
|
24
|
+
$options = [
|
|
25
|
+
["-f, --force", "Skip command confirmation"],
|
|
26
|
+
["-s, --seeder", "Specific file seeder"]
|
|
27
|
+
];
|
|
24
28
|
/**
|
|
25
29
|
* The arguments of the console command.
|
|
26
30
|
*
|
|
@@ -29,23 +33,36 @@ export default class DbSeedCommand {
|
|
|
29
33
|
$arguments = [];
|
|
30
34
|
async handle(options, args) {
|
|
31
35
|
const database = Database.knex();
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
const environment = defineValue(Bun.env.APP_ENV, "development");
|
|
37
|
+
const bypass = isNotEmpty(options.force);
|
|
38
|
+
const seeder = options.seeder;
|
|
39
|
+
let confirm = "Y";
|
|
40
|
+
if (environment === "production" && !bypass)
|
|
41
|
+
confirm = await ask(Chalk.setValue("Application in production. Are you sure you want to run this command? (Y/N): ")
|
|
42
|
+
.inline()
|
|
43
|
+
.error()
|
|
44
|
+
.show());
|
|
45
|
+
if (confirm.toUpperCase() === "Y") {
|
|
46
|
+
const spinner = ora(Chalk.setValue("Seeding...")
|
|
47
|
+
.info()
|
|
48
|
+
.show()).start();
|
|
49
|
+
try {
|
|
50
|
+
const logs = (await database.seed.run({
|
|
51
|
+
specific: defineValue(seeder)
|
|
52
|
+
})).flat();
|
|
53
|
+
spinner.succeed("Seeding finished");
|
|
54
|
+
if (logs.length > 0)
|
|
55
|
+
logs.forEach((seeder) => spinner.succeed(path.basename(seeder)));
|
|
56
|
+
else
|
|
57
|
+
spinner.succeed("No seeders were run.");
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
spinner.fail(`Seeding failed : ${error.message}`);
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
await database.destroy();
|
|
64
|
+
spinner.stop();
|
|
65
|
+
}
|
|
49
66
|
}
|
|
50
67
|
}
|
|
51
68
|
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bejibun/database",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"author": "Havea Crenata <havea.crenata@gmail.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/Bejibun-Framework/bejibun-database.git"
|
|
8
8
|
},
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"module": "index.js",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/bun": "latest",
|
|
13
|
-
"tsc-alias": "^1.8.
|
|
13
|
+
"tsc-alias": "^1.8.17"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
16
|
-
"url": "https://github.com/
|
|
16
|
+
"url": "https://github.com/Bejibun-Framework/bejibun-database/issues"
|
|
17
17
|
},
|
|
18
18
|
"description": "Database for Bejibun Framework",
|
|
19
|
-
"homepage": "https://github.com/
|
|
19
|
+
"homepage": "https://github.com/Bejibun-Framework/bejibun-database#readme",
|
|
20
20
|
"keywords": [
|
|
21
21
|
"bun",
|
|
22
22
|
"bun framework",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"type": "module",
|
|
38
38
|
"types": "index.d.ts",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@bejibun/app": "^0.1.
|
|
41
|
-
"@bejibun/logger": "^0.1.
|
|
42
|
-
"@bejibun/utils": "^0.1.
|
|
43
|
-
"knex": "^3.
|
|
44
|
-
"ora": "^9.
|
|
45
|
-
"pg": "^8.
|
|
40
|
+
"@bejibun/app": "^0.1.23",
|
|
41
|
+
"@bejibun/logger": "^0.1.22",
|
|
42
|
+
"@bejibun/utils": "^0.1.28",
|
|
43
|
+
"knex": "^3.2.10",
|
|
44
|
+
"ora": "^9.4.0",
|
|
45
|
+
"pg": "^8.20.0"
|
|
46
46
|
}
|
|
47
47
|
}
|