arcanajs 2.1.6 → 2.2.1
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 +45 -3
- package/framework/cli/index.js +127 -25
- package/framework/cli/templates.d.ts +6 -0
- package/framework/cli/templates.js +41 -0
- package/framework/cli/webpack.config.js +87 -44
- package/framework/lib/client/index.js +23 -7
- package/framework/lib/index.d.ts +2 -2
- package/framework/lib/index.js +40 -17
- package/framework/lib/server/ArcanaJSMiddleware.d.ts +9 -1
- package/framework/lib/server/ArcanaJSMiddleware.js +35 -13
- package/framework/lib/server/ArcanaJSServer.d.ts +2 -0
- package/framework/lib/server/ArcanaJSServer.js +77 -59
- package/framework/lib/server/ControllerBinder.js +4 -1
- package/framework/lib/server/CsrfMiddleware.js +10 -3
- package/framework/lib/server/DynamicRouter.d.ts +1 -1
- package/framework/lib/server/DynamicRouter.js +5 -1
- package/framework/lib/server/ResponseHandlerMiddleware.js +5 -1
- package/framework/lib/server/Router.d.ts +1 -1
- package/framework/lib/server/Router.js +16 -8
- package/framework/lib/server.d.ts +10 -0
- package/framework/lib/server.js +41 -6
- package/framework/lib/shared/components/Body.js +7 -3
- package/framework/lib/shared/components/Head.js +47 -10
- package/framework/lib/shared/components/Link.js +9 -5
- package/framework/lib/shared/components/NavLink.js +10 -6
- package/framework/lib/shared/components/Page.js +9 -5
- package/framework/lib/shared/context/HeadContext.js +5 -2
- package/framework/lib/shared/context/PageContext.js +5 -2
- package/framework/lib/shared/context/RouterContext.js +9 -5
- package/framework/lib/shared/core/ArcanaJSApp.js +18 -14
- package/framework/lib/shared/hooks/useHead.d.ts +1 -1
- package/framework/lib/shared/hooks/useHead.js +7 -3
- package/framework/lib/shared/hooks/useLocation.js +7 -3
- package/framework/lib/shared/hooks/usePage.js +7 -3
- package/framework/lib/shared/hooks/useParams.js +8 -4
- package/framework/lib/shared/hooks/useQuery.js +7 -3
- package/framework/lib/shared/hooks/useRouter.d.ts +1 -1
- package/framework/lib/shared/hooks/useRouter.js +8 -4
- package/framework/lib/shared/utils/createSingletonContext.js +6 -3
- package/framework/lib/shared/views/ErrorPage.d.ts +7 -0
- package/framework/lib/shared/views/ErrorPage.js +11 -0
- package/framework/lib/shared/views/NotFoundPage.d.ts +5 -0
- package/framework/lib/shared/views/NotFoundPage.js +10 -0
- package/framework/templates/ErrorPage.tsx +137 -0
- package/framework/templates/HomePage.tsx +344 -0
- package/framework/templates/NotFoundPage.tsx +109 -0
- package/framework/templates/arcanajs.png +0 -0
- package/framework/templates/arcanajs.svg +12 -0
- package/framework/templates/client-index.tsx +7 -0
- package/framework/templates/favicon.ico +0 -0
- package/framework/templates/globals.css +198 -0
- package/framework/templates/package.json +15 -0
- package/framework/templates/postcss.config.js +6 -0
- package/framework/templates/server-controller-home.ts +7 -0
- package/framework/templates/server-index.ts +10 -0
- package/framework/templates/server-routes-web.ts +7 -0
- package/package.json +30 -25
- package/framework/lib/shared/hooks/useDynamicComponents.d.ts +0 -1
- package/framework/lib/shared/hooks/useDynamicComponents.js +0 -16
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "arcanajs-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "arcanajs dev",
|
|
7
|
+
"build": "arcanajs build",
|
|
8
|
+
"start": "arcanajs start"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"arcanajs": "^2.2.1",
|
|
12
|
+
"react": "^19.2.0",
|
|
13
|
+
"react-dom": "^19.2.0"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arcanajs",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "ArcanaJS Framework",
|
|
5
5
|
"main": "framework/lib/index.js",
|
|
6
6
|
"types": "framework/lib/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
|
-
".":
|
|
9
|
-
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./framework/lib/index.d.ts",
|
|
10
|
+
"default": "./framework/lib/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./server": {
|
|
13
|
+
"types": "./framework/lib/server.d.ts",
|
|
14
|
+
"default": "./framework/lib/server.js"
|
|
15
|
+
},
|
|
16
|
+
"./client": {
|
|
17
|
+
"types": "./framework/lib/client/index.d.ts",
|
|
18
|
+
"default": "./framework/lib/client/index.js"
|
|
19
|
+
}
|
|
10
20
|
},
|
|
11
21
|
"bin": {
|
|
12
22
|
"arcanajs": "./bin/arcanajs.js"
|
|
@@ -16,50 +26,45 @@
|
|
|
16
26
|
"bin"
|
|
17
27
|
],
|
|
18
28
|
"scripts": {
|
|
19
|
-
"build": "tsc -p tsconfig.json && cp src/lib/server/default-index.html framework/lib/server/ && cp src/lib/global.d.ts framework/lib/"
|
|
20
|
-
"build:app": "node bin/arcanajs.js build",
|
|
21
|
-
"dev:app": "node bin/arcanajs.js dev",
|
|
22
|
-
"start:app": "node bin/arcanajs.js start",
|
|
23
|
-
"lint": "eslint"
|
|
29
|
+
"build": "tsc -p tsconfig.json && cp src/lib/server/default-index.html framework/lib/server/ && cp src/lib/global.d.ts framework/lib/ && cp -r src/templates framework/"
|
|
24
30
|
},
|
|
25
31
|
"dependencies": {
|
|
26
|
-
"compression": "^1.8.1",
|
|
27
|
-
"cookie-parser": "^1.4.7",
|
|
28
|
-
"cross-env": "^10.1.0",
|
|
29
|
-
"express": "^5.1.0",
|
|
30
|
-
"helmet": "^8.1.0",
|
|
31
|
-
"react": "^19.2.0",
|
|
32
|
-
"react-dom": "^19.2.0",
|
|
33
32
|
"@babel/core": "^7.23.0",
|
|
34
33
|
"@babel/preset-env": "^7.23.0",
|
|
35
34
|
"@babel/preset-react": "^7.22.15",
|
|
36
35
|
"@babel/preset-typescript": "^7.23.0",
|
|
37
36
|
"@tailwindcss/postcss": "^4.1.17",
|
|
37
|
+
"@types/compression": "^1.8.1",
|
|
38
|
+
"@types/cookie-parser": "^1.4.10",
|
|
39
|
+
"@types/express": "^5.0.5",
|
|
40
|
+
"@types/node": "^24.10.1",
|
|
41
|
+
"@types/react": "^19.2.7",
|
|
42
|
+
"@types/react-dom": "^19.2.3",
|
|
43
|
+
"@types/ws": "^8.18.1",
|
|
38
44
|
"autoprefixer": "^10.4.22",
|
|
39
45
|
"babel-loader": "^10.0.0",
|
|
40
46
|
"clean-webpack-plugin": "^4.0.0",
|
|
41
|
-
"
|
|
47
|
+
"compression": "^1.8.1",
|
|
48
|
+
"cookie-parser": "^1.4.7",
|
|
49
|
+
"cross-env": "^10.1.0",
|
|
42
50
|
"css-loader": "^7.1.2",
|
|
51
|
+
"express": "^5.1.0",
|
|
52
|
+
"helmet": "^8.1.0",
|
|
43
53
|
"html-webpack-plugin": "^5.6.5",
|
|
44
54
|
"mini-css-extract-plugin": "^2.9.4",
|
|
45
55
|
"null-loader": "^4.0.1",
|
|
46
56
|
"postcss": "^8.5.6",
|
|
47
57
|
"postcss-loader": "^8.2.0",
|
|
58
|
+
"react": "^19.2.0",
|
|
59
|
+
"react-dom": "^19.2.0",
|
|
48
60
|
"style-loader": "^4.0.0",
|
|
49
61
|
"tailwindcss": "^4.1.17",
|
|
50
|
-
"ts-loader": "^9.4.4",
|
|
51
62
|
"ts-node": "^10.9.2",
|
|
52
63
|
"tsx": "^4.20.6",
|
|
53
64
|
"typescript": "^5.9.3",
|
|
54
65
|
"webpack": "^5.103.0",
|
|
55
66
|
"webpack-cli": "^6.0.1",
|
|
56
67
|
"webpack-node-externals": "^3.0.0",
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
"@types/compression": "^1.8.1",
|
|
60
|
-
"@types/cookie-parser": "^1.4.10",
|
|
61
|
-
"@types/react": "^19.2.7",
|
|
62
|
-
"@types/react-dom": "^19.2.3"
|
|
63
|
-
},
|
|
64
|
-
"devDependencies": {}
|
|
68
|
+
"ws": "^8.18.3"
|
|
69
|
+
}
|
|
65
70
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useDynamicComponents: (loader: () => Promise<any>) => any;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
export const useDynamicComponents = (loader) => {
|
|
3
|
-
const [component, setComponent] = useState(null);
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
let mounted = true;
|
|
6
|
-
loader().then((mod) => {
|
|
7
|
-
if (mounted) {
|
|
8
|
-
setComponent(mod.default || mod);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
return () => {
|
|
12
|
-
mounted = false;
|
|
13
|
-
};
|
|
14
|
-
}, []); // loader dependency omitted to avoid loops if loader is inline
|
|
15
|
-
return component;
|
|
16
|
-
};
|