@bejibun/core 0.1.30 → 0.1.31

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 (68) hide show
  1. package/{src/builders → builders}/RouterBuilder.d.ts +2 -2
  2. package/bun.lock +5 -0
  3. package/{src/facades → facades}/Router.d.ts +2 -2
  4. package/index.d.ts +1 -1
  5. package/index.js +1 -1
  6. package/package.json +30 -24
  7. package/src/index.ts +1 -11
  8. package/src/types/index.d.ts +2 -2
  9. package/src/types/middleware.d.ts +1 -1
  10. package/tsconfig.json +5 -5
  11. package/types/index.d.ts +2 -0
  12. package/types/middleware.d.ts +7 -0
  13. package/types/router.d.ts +5 -0
  14. package/types/validator.d.ts +3 -0
  15. package/types/vine.d.ts +13 -0
  16. package/index.ts +0 -1
  17. package/src/index.d.ts +0 -9
  18. package/src/index.js +0 -9
  19. /package/{src/bases → bases}/BaseController.d.ts +0 -0
  20. /package/{src/bases → bases}/BaseController.js +0 -0
  21. /package/{src/bases → bases}/BaseModel.d.ts +0 -0
  22. /package/{src/bases → bases}/BaseModel.js +0 -0
  23. /package/{src/bases → bases}/BaseValidator.d.ts +0 -0
  24. /package/{src/bases → bases}/BaseValidator.js +0 -0
  25. /package/{src/bootstrap.d.ts → bootstrap.d.ts} +0 -0
  26. /package/{src/bootstrap.js → bootstrap.js} +0 -0
  27. /package/{src/builders → builders}/ChalkBuilder.d.ts +0 -0
  28. /package/{src/builders → builders}/ChalkBuilder.js +0 -0
  29. /package/{src/builders → builders}/EnumBuilder.d.ts +0 -0
  30. /package/{src/builders → builders}/EnumBuilder.js +0 -0
  31. /package/{src/builders → builders}/ResponseBuilder.d.ts +0 -0
  32. /package/{src/builders → builders}/ResponseBuilder.js +0 -0
  33. /package/{src/builders → builders}/RouterBuilder.js +0 -0
  34. /package/{src/builders → builders}/StrBuilder.d.ts +0 -0
  35. /package/{src/builders → builders}/StrBuilder.js +0 -0
  36. /package/{src/config → config}/cors.d.ts +0 -0
  37. /package/{src/config → config}/cors.js +0 -0
  38. /package/{src/config → config}/database.d.ts +0 -0
  39. /package/{src/config → config}/database.js +0 -0
  40. /package/{src/enums → enums}/CorsHeaderEnum.d.ts +0 -0
  41. /package/{src/enums → enums}/CorsHeaderEnum.js +0 -0
  42. /package/{src/enums → enums}/HttpMethodEnum.d.ts +0 -0
  43. /package/{src/enums → enums}/HttpMethodEnum.js +0 -0
  44. /package/{src/exceptions → exceptions}/ModelNotFoundException.d.ts +0 -0
  45. /package/{src/exceptions → exceptions}/ModelNotFoundException.js +0 -0
  46. /package/{src/exceptions → exceptions}/RouterInvalidException.d.ts +0 -0
  47. /package/{src/exceptions → exceptions}/RouterInvalidException.js +0 -0
  48. /package/{src/exceptions → exceptions}/ValidatorException.d.ts +0 -0
  49. /package/{src/exceptions → exceptions}/ValidatorException.js +0 -0
  50. /package/{src/facades → facades}/Chalk.d.ts +0 -0
  51. /package/{src/facades → facades}/Chalk.js +0 -0
  52. /package/{src/facades → facades}/Enum.d.ts +0 -0
  53. /package/{src/facades → facades}/Enum.js +0 -0
  54. /package/{src/facades → facades}/Response.d.ts +0 -0
  55. /package/{src/facades → facades}/Response.js +0 -0
  56. /package/{src/facades → facades}/Router.js +0 -0
  57. /package/{src/facades → facades}/SoftDeletes.d.ts +0 -0
  58. /package/{src/facades → facades}/SoftDeletes.js +0 -0
  59. /package/{src/facades → facades}/Str.d.ts +0 -0
  60. /package/{src/facades → facades}/Str.js +0 -0
  61. /package/{src/utils → utils}/utils.d.ts +0 -0
  62. /package/{src/utils → utils}/utils.js +0 -0
  63. /package/{src/utils → utils}/vine.d.ts +0 -0
  64. /package/{src/utils → utils}/vine.js +0 -0
  65. /package/{src/utils → utils}/vines/exists.d.ts +0 -0
  66. /package/{src/utils → utils}/vines/exists.js +0 -0
  67. /package/{src/utils → utils}/vines/unique.d.ts +0 -0
  68. /package/{src/utils → utils}/vines/unique.js +0 -0
@@ -1,5 +1,5 @@
1
- import type { IMiddleware } from "../types/middleware";
2
- import type { HandlerType, ResourceAction, RouterGroup } from "../types/router";
1
+ import type { IMiddleware } from "@/types/middleware";
2
+ import type { HandlerType, ResourceAction, RouterGroup } from "@/types/router";
3
3
  import HttpMethodEnum from "../enums/HttpMethodEnum";
4
4
  export interface ResourceOptions {
5
5
  only?: Array<ResourceAction>;
package/bun.lock CHANGED
@@ -16,6 +16,9 @@
16
16
  "@types/luxon": "^3.7.1",
17
17
  "tsc-alias": "^1.8.16",
18
18
  },
19
+ "peerDependencies": {
20
+ "typescript": "^5",
21
+ },
19
22
  },
20
23
  },
21
24
  "packages": {
@@ -209,6 +212,8 @@
209
212
 
210
213
  "tsc-alias": ["tsc-alias@1.8.16", "", { "dependencies": { "chokidar": "^3.5.3", "commander": "^9.0.0", "get-tsconfig": "^4.10.0", "globby": "^11.0.4", "mylas": "^2.1.9", "normalize-path": "^3.0.0", "plimit-lit": "^1.2.6" }, "bin": { "tsc-alias": "dist/bin/index.js" } }, "sha512-QjCyu55NFyRSBAl6+MTFwplpFcnm2Pq01rR/uxfqJoLMm6X3O14KEGtaSDZpJYaE1bJBGDjD0eSuiIWPe2T58g=="],
211
214
 
215
+ "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
216
+
212
217
  "undici-types": ["undici-types@7.14.0", "", {}, "sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA=="],
213
218
 
214
219
  "validator": ["validator@13.15.15", "", {}, "sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A=="],
@@ -1,5 +1,5 @@
1
- import type { IMiddleware } from "../types/middleware";
2
- import type { HandlerType, RouterGroup } from "../types/router";
1
+ import type { IMiddleware } from "@/types/middleware";
2
+ import type { HandlerType, RouterGroup } from "@/types/router";
3
3
  import RouterBuilder, { ResourceOptions } from "../builders/RouterBuilder";
4
4
  import HttpMethodEnum from "../enums/HttpMethodEnum";
5
5
  export default class Router {
package/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./src/index";
1
+ export * from "./utils/utils";
package/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./src/index";
1
+ export * from "./utils/utils";
package/package.json CHANGED
@@ -1,13 +1,36 @@
1
1
  {
2
2
  "name": "@bejibun/core",
3
- "version": "0.1.30",
4
- "author": "Havea Crenata <havea.crenata@gmail.com>",
3
+ "version": "0.1.31",
4
+ "description": "Core of Bejibun Framework",
5
+ "keywords": [
6
+ "bun",
7
+ "bun framework",
8
+ "core",
9
+ "bejibun",
10
+ "typescript"
11
+ ],
12
+ "homepage": "https://github.com/crenata/bejibun-core#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/crenata/bejibun-core/issues"
15
+ },
5
16
  "repository": {
6
17
  "type": "git",
7
18
  "url": "git+https://github.com/crenata/bejibun-core.git"
8
19
  },
9
- "main": "./dist/index.js",
10
- "module": "./dist/index.js",
20
+ "license": "MIT",
21
+ "author": "Havea Crenata <havea.crenata@gmail.com>",
22
+ "type": "module",
23
+ "main": "index.js",
24
+ "module": "index.js",
25
+ "types": "index.d.ts",
26
+ "scripts": {
27
+ "alias": "bunx tsc-alias -p tsconfig.json",
28
+ "copy": "cp -rf src/types dist",
29
+ "rsync": "rsync -a dist/ ./",
30
+ "clean": "rm -rf dist",
31
+ "build": "bunx tsc -p tsconfig.json && bun run alias && bun run copy && bun run rsync && bun run clean",
32
+ "deploy": "bun run build && npm publish --access public"
33
+ },
11
34
  "dependencies": {
12
35
  "@vinejs/vine": "^3.0.1",
13
36
  "chalk": "^5.6.2",
@@ -21,24 +44,7 @@
21
44
  "@types/luxon": "^3.7.1",
22
45
  "tsc-alias": "^1.8.16"
23
46
  },
24
- "bugs": {
25
- "url": "https://github.com/crenata/bejibun-core/issues"
26
- },
27
- "description": "Core of Bejibun Framework",
28
- "homepage": "https://github.com/crenata/bejibun-core#readme",
29
- "keywords": [
30
- "bun",
31
- "bun framework",
32
- "core",
33
- "bejibun",
34
- "typescript"
35
- ],
36
- "license": "MIT",
37
- "scripts": {
38
- "clean": "rm -rf dist",
39
- "build": "bun run clean && bunx tsc -p tsconfig.json && bunx tsc-alias -p tsconfig.json",
40
- "deploy": "bun run build && npm publish --access public"
41
- },
42
- "type": "module",
43
- "types": "./dist/index.d.ts"
47
+ "peerDependencies": {
48
+ "typescript": "^5"
49
+ }
44
50
  }
package/src/index.ts CHANGED
@@ -1,11 +1 @@
1
- export * from "@/facades/Chalk";
2
- export * from "@/facades/Enum";
3
- export * from "@/facades/Response";
4
- export * from "@/facades/Router";
5
- export * from "@/facades/SoftDeletes";
6
- export * from "@/facades/Str";
7
-
8
- export * from "@/types/index";
9
-
10
- export * from "@/utils/utils";
11
- export * from "@/utils/vine";
1
+ export * from "@/utils/utils";
@@ -1,2 +1,2 @@
1
- export * from "../types/middleware";
2
- export * from "../types/router";
1
+ export * from "@/types/middleware";
2
+ export * from "@/types/router";
@@ -1,4 +1,4 @@
1
- import type {HandlerType} from "../types/router";
1
+ import type {HandlerType} from "@/types/router";
2
2
 
3
3
  export type MiddlewareType = (handler: HandlerType) => HandlerType;
4
4
 
package/tsconfig.json CHANGED
@@ -2,16 +2,16 @@
2
2
  "compilerOptions": {
3
3
  "target": "ESNext",
4
4
  "module": "ESNext",
5
- "moduleResolution": "bundler",
6
5
  "declaration": true,
7
- "outDir": ".",
8
- "esModuleInterop": true,
6
+ "outDir": "dist",
7
+ "rootDir": "src",
9
8
  "strict": true,
9
+ "moduleResolution": "bundler",
10
+ "esModuleInterop": true,
10
11
  "skipLibCheck": true,
11
12
  "baseUrl": ".",
12
13
  "paths": {
13
14
  "@/*": ["src/*"]
14
15
  }
15
- },
16
- "exclude": ["node_modules"]
16
+ }
17
17
  }
@@ -0,0 +1,2 @@
1
+ export * from "@/types/middleware";
2
+ export * from "@/types/router";
@@ -0,0 +1,7 @@
1
+ import type {HandlerType} from "@/types/router";
2
+
3
+ export type MiddlewareType = (handler: HandlerType) => HandlerType;
4
+
5
+ export interface IMiddleware {
6
+ handle(handler: HandlerType): HandlerType;
7
+ }
@@ -0,0 +1,5 @@
1
+ import {BunRequest} from "bun";
2
+
3
+ export type HandlerType = (request: BunRequest) => Promise<Response>;
4
+ export type RouterGroup = Record<string, Record<string, HandlerType>>;
5
+ export type ResourceAction = "index" | "store" | "show" | "update" | "destroy";
@@ -0,0 +1,3 @@
1
+ import {SchemaTypes, VineValidator} from "@vinejs/vine";
2
+
3
+ export type ValidatorType<T extends SchemaTypes = SchemaTypes> = VineValidator<SchemaTypes, Record<string, any> | undefined>;
@@ -0,0 +1,13 @@
1
+ declare module "@vinejs/vine" {
2
+ interface VineNumber {
3
+ exists(tableOrOptions: string | { table: string; column?: string }, column?: string): this;
4
+ unique(tableOrOptions: string | { table: string; column?: string }, column?: string): this;
5
+ }
6
+
7
+ interface VineString {
8
+ exists(tableOrOptions: string | { table: string; column?: string }, column?: string): this;
9
+ unique(tableOrOptions: string | { table: string; column?: string }, column?: string): this;
10
+ }
11
+ }
12
+
13
+ export {};
package/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/index";
package/src/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export * from "./facades/Chalk";
2
- export * from "./facades/Enum";
3
- export * from "./facades/Response";
4
- export * from "./facades/Router";
5
- export * from "./facades/SoftDeletes";
6
- export * from "./facades/Str";
7
- export * from "./types/index";
8
- export * from "./utils/utils";
9
- export * from "./utils/vine";
package/src/index.js DELETED
@@ -1,9 +0,0 @@
1
- export * from "./facades/Chalk";
2
- export * from "./facades/Enum";
3
- export * from "./facades/Response";
4
- export * from "./facades/Router";
5
- export * from "./facades/SoftDeletes";
6
- export * from "./facades/Str";
7
- export * from "./types/index";
8
- export * from "./utils/utils";
9
- export * from "./utils/vine";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes