@razvan11/paladin 1.1.0 → 1.1.2
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/dist/components/LayoutView.d.ts +1 -0
- package/dist/index.js +22 -11
- package/package.json +66 -65
package/dist/index.js
CHANGED
|
@@ -19969,23 +19969,29 @@ class App {
|
|
|
19969
19969
|
}
|
|
19970
19970
|
async run() {
|
|
19971
19971
|
const self2 = this;
|
|
19972
|
+
const honoFetch = this.app.fetch.bind(this.app);
|
|
19973
|
+
const wsPaths = new Set;
|
|
19972
19974
|
this.wsHandlers.forEach((_3, path) => {
|
|
19973
|
-
|
|
19974
|
-
const upgraded = self2.server?.upgrade(c3.req.raw, {
|
|
19975
|
-
data: { path }
|
|
19976
|
-
});
|
|
19977
|
-
if (upgraded) {
|
|
19978
|
-
return new Response(null, { status: 101 });
|
|
19979
|
-
}
|
|
19980
|
-
return c3.text("WebSocket upgrade failed", 400);
|
|
19981
|
-
});
|
|
19975
|
+
wsPaths.add(path);
|
|
19982
19976
|
});
|
|
19983
19977
|
try {
|
|
19984
19978
|
const server = Bun.serve({
|
|
19985
19979
|
port: 3000,
|
|
19986
19980
|
hostname: "localhost",
|
|
19987
19981
|
development: false,
|
|
19988
|
-
fetch
|
|
19982
|
+
fetch(req, server2) {
|
|
19983
|
+
const url = new URL(req.url);
|
|
19984
|
+
if (wsPaths.has(url.pathname)) {
|
|
19985
|
+
const upgraded = server2.upgrade(req, {
|
|
19986
|
+
data: { path: url.pathname }
|
|
19987
|
+
});
|
|
19988
|
+
if (upgraded) {
|
|
19989
|
+
return;
|
|
19990
|
+
}
|
|
19991
|
+
return new Response("WebSocket upgrade failed", { status: 400 });
|
|
19992
|
+
}
|
|
19993
|
+
return honoFetch(req, server2);
|
|
19994
|
+
},
|
|
19989
19995
|
websocket: {
|
|
19990
19996
|
message(ws, message) {
|
|
19991
19997
|
const wsPath = ws.data?.path;
|
|
@@ -21020,7 +21026,8 @@ var LayoutView = ({
|
|
|
21020
21026
|
className = "",
|
|
21021
21027
|
children,
|
|
21022
21028
|
head,
|
|
21023
|
-
clientData
|
|
21029
|
+
clientData,
|
|
21030
|
+
favicon
|
|
21024
21031
|
}) => {
|
|
21025
21032
|
return /* @__PURE__ */ jsxDEV2("html", {
|
|
21026
21033
|
lang: "en",
|
|
@@ -21041,6 +21048,10 @@ var LayoutView = ({
|
|
|
21041
21048
|
/* @__PURE__ */ jsxDEV2("title", {
|
|
21042
21049
|
children: title
|
|
21043
21050
|
}, undefined, false, undefined, this),
|
|
21051
|
+
favicon && /* @__PURE__ */ jsxDEV2("link", {
|
|
21052
|
+
rel: "image/svg+xml",
|
|
21053
|
+
href: favicon
|
|
21054
|
+
}, undefined, false, undefined, this),
|
|
21044
21055
|
styles3.map((href) => /* @__PURE__ */ jsxDEV2("link", {
|
|
21045
21056
|
rel: "stylesheet",
|
|
21046
21057
|
href
|
package/package.json
CHANGED
|
@@ -1,67 +1,68 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
2
|
+
"name": "@razvan11/paladin",
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "A Bun-based backend framework with decorators, dependency injection, and controller registration",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bun",
|
|
7
|
+
"backend",
|
|
8
|
+
"framework",
|
|
9
|
+
"decorators",
|
|
10
|
+
"hono",
|
|
11
|
+
"inversify",
|
|
12
|
+
"dependency-injection"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Razvan",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/razvan/backend_framework"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "bun run ./example/index.ts",
|
|
35
|
+
"build": "bun build ./framework/index.ts --outdir ./dist --target bun --external react --external react-dom && bun run build:types",
|
|
36
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
37
|
+
"prepublishOnly": "bun run build",
|
|
38
|
+
"fmt": "bunx @biomejs/biome format --write",
|
|
39
|
+
"lint": "bunx @biomejs/biome lint --write",
|
|
40
|
+
"check": "bunx @biomejs/biome check"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@biomejs/biome": "^2.3.10",
|
|
44
|
+
"@types/bun": "latest",
|
|
45
|
+
"@types/react": "^19.2.7",
|
|
46
|
+
"@types/react-dom": "^19.2.3",
|
|
47
|
+
"typeorm": "^0.3.28"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"typescript": "^5",
|
|
51
|
+
"react": "^19.0.0",
|
|
52
|
+
"react-dom": "^19.0.0"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"chalk": "^5.6.2",
|
|
56
|
+
"class-validator": "^0.14.3",
|
|
57
|
+
"hono": "^4.11.1",
|
|
58
|
+
"inversify": "^7.10.8",
|
|
59
|
+
"pretty-error": "^4.0.0",
|
|
60
|
+
"react": "^19.2.3",
|
|
61
|
+
"react-dom": "^19.2.3",
|
|
62
|
+
"react-router": "^7.11.0",
|
|
63
|
+
"react-router-dom": "^7.11.0",
|
|
64
|
+
"reflect-metadata": "^0.2.2",
|
|
65
|
+
"zod": "^4.2.1"
|
|
66
|
+
}
|
|
67
67
|
}
|
|
68
|
+
|