@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 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.14](https://github.com/crenata/bejibun-database/compare/v0.1.12...v0.1.14) - 2025-10-25
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/crenata/bejibun-database/blob/master/CHANGELOG.md
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/crenata/bejibun-database/compare/v0.1.11...v0.1.12) - 2025-10-25
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/crenata/bejibun-database/blob/master/CHANGELOG.md
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/crenata/bejibun-database/compare/v0.1.1...v0.1.11) - 2025-10-25
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/crenata/bejibun-database/blob/master/CHANGELOG.md
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/crenata/bejibun-database/compare/v0.1.0...v0.1.1) - 2025-10-22
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/crenata/bejibun-database/blob/master/CHANGELOG.md
91
+ **Full Changelog**: https://github.com/Bejibun-Framework/bejibun-database/blob/master/CHANGELOG.md
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Havea Crenata
3
+ Copyright (c) 2025 Bejibun Framework
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  <div align="center">
2
2
 
3
- <img src="https://github.com/crenata/bejibun/blob/master/public/images/bejibun.png?raw=true" width="150" alt="Bejibun" />
3
+ <img src="https://github.com/Bejibun-Framework/bejibun/blob/master/public/images/bejibun.png?raw=true" width="150" alt="Bejibun" />
4
4
 
5
- ![GitHub top language](https://img.shields.io/github/languages/top/crenata/bejibun-database)
6
- ![GitHub all releases](https://img.shields.io/github/downloads/crenata/bejibun-database/total)
7
- ![GitHub issues](https://img.shields.io/github/issues/crenata/bejibun-database)
8
- ![GitHub](https://img.shields.io/github/license/crenata/bejibun-database)
9
- ![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/crenata/bejibun-database?display_name=tag&include_prereleases)
5
+ ![GitHub top language](https://img.shields.io/github/languages/top/Bejibun-Framework/bejibun-database)
6
+ ![GitHub all releases](https://img.shields.io/github/downloads/Bejibun-Framework/bejibun-database/total)
7
+ ![GitHub issues](https://img.shields.io/github/issues/Bejibun-Framework/bejibun-database)
8
+ ![GitHub](https://img.shields.io/github/license/Bejibun-Framework/bejibun-database)
9
+ ![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Bejibun-Framework/bejibun-database?display_name=tag&include_prereleases)
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/crenata/bejibun/blob/master/public/images/EVM.png?raw=true" width="150" /> | <img src="https://github.com/crenata/bejibun/blob/master/public/images/SOL.png?raw=true" width="150" /> |
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 spinner = ora(Chalk.setValue("Seeding...")
33
- .info()
34
- .show()).start();
35
- try {
36
- const logs = (await database.seed.run()).flat();
37
- spinner.succeed("Seeding finished");
38
- if (logs.length > 0)
39
- logs.forEach((seeder) => spinner.succeed(path.basename(seeder)));
40
- else
41
- spinner.succeed("No seeders were run.");
42
- }
43
- catch (error) {
44
- spinner.fail(`Seeding failed : ${error.message}`);
45
- }
46
- finally {
47
- await database.destroy();
48
- spinner.stop();
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.19",
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/crenata/bejibun-database.git"
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.16"
13
+ "tsc-alias": "^1.8.17"
14
14
  },
15
15
  "bugs": {
16
- "url": "https://github.com/crenata/bejibun-database/issues"
16
+ "url": "https://github.com/Bejibun-Framework/bejibun-database/issues"
17
17
  },
18
18
  "description": "Database for Bejibun Framework",
19
- "homepage": "https://github.com/crenata/bejibun-database#readme",
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.20",
41
- "@bejibun/logger": "^0.1.20",
42
- "@bejibun/utils": "^0.1.18",
43
- "knex": "^3.1.0",
44
- "ora": "^9.0.0",
45
- "pg": "^8.16.3"
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
  }
package/tsconfig.json CHANGED
@@ -12,6 +12,8 @@
12
12
  "baseUrl": ".",
13
13
  "paths": {
14
14
  "@/*": ["src/*"]
15
- }
15
+ },
16
+ "ignoreDeprecations": "6.0",
17
+ "types": ["bun-types"]
16
18
  }
17
19
  }