@common-stack/generate-plugin 7.1.1-alpha.3 → 7.1.1-alpha.5
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 +8 -0
- package/lib/generators/add-backend/files/package.json +1 -1
- package/lib/generators/add-frontend/frameworks/antui/src/root.tsx.template +37 -2
- package/lib/generators/add-frontend/frameworks/chakraui/src/root.tsx.template +38 -7
- package/lib/generators/add-frontend/frameworks/tailwindui/src/root.tsx.template +37 -8
- package/lib/generators/add-frontend/templates/package.json +2 -2
- package/lib/generators/add-fullstack/files/package.json +2 -2
- package/lib/generators/add-moleculer/files/package.json +3 -3
- package/lib/generators/add-package/files/browser/package.json +1 -1
- package/lib/generators/add-package/files/server/package.json +1 -1
- package/package.json +2 -2
- package/src/generators/add-backend/files/package.json +1 -1
- package/src/generators/add-frontend/frameworks/antui/src/root.tsx.template +37 -2
- package/src/generators/add-frontend/frameworks/chakraui/src/root.tsx.template +38 -7
- package/src/generators/add-frontend/frameworks/tailwindui/src/root.tsx.template +37 -8
- package/src/generators/add-frontend/templates/package.json +2 -2
- package/src/generators/add-fullstack/files/package.json +2 -2
- package/src/generators/add-moleculer/files/package.json +3 -3
- package/src/generators/add-package/files/browser/package.json +1 -1
- package/src/generators/add-package/files/server/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.1.1-alpha.5](https://github.com/cdmbase/common-stack/compare/v7.1.1-alpha.4...v7.1.1-alpha.5) (2025-04-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @common-stack/generate-plugin
|
|
9
|
+
|
|
10
|
+
## [7.1.1-alpha.4](https://github.com/cdmbase/common-stack/compare/v7.1.1-alpha.3...v7.1.1-alpha.4) (2025-04-14)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @common-stack/generate-plugin
|
|
13
|
+
|
|
6
14
|
## [7.1.1-alpha.3](https://github.com/cdmbase/common-stack/compare/v7.1.1-alpha.2...v7.1.1-alpha.3) (2025-04-13)
|
|
7
15
|
|
|
8
16
|
### Features
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@apollo/client": "^3.9.0",
|
|
66
66
|
"@babel/runtime": "^7.20.1",
|
|
67
|
-
"@common-stack/server-stack": "7.1.1-alpha.
|
|
67
|
+
"@common-stack/server-stack": "7.1.1-alpha.4",
|
|
68
68
|
"@remix-run/node": "~2.10.1",
|
|
69
69
|
"lodash": "^4.17.15",
|
|
70
70
|
"react": "18.2.0"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Links, Meta, Outlet, Scripts, ScrollRestoration, useRouteLoaderData, useRouteError } from '@remix-run/react';
|
|
4
|
+
import { json } from '@remix-run/node';
|
|
4
5
|
import { PluginArea } from '@common-stack/client-react';
|
|
5
6
|
import { subscribeReduxRouter } from '@common-stack/remix-router-redux';
|
|
6
7
|
import { ApplicationErrorHandler } from '@admin-layout/ant-ui';
|
|
@@ -10,10 +11,40 @@ import clientModules, { plugins } from '@app/frontend-stack-react/modules.js';
|
|
|
10
11
|
// @ts-ignore
|
|
11
12
|
import { useChangeLanguage } from 'remix-i18next/react';
|
|
12
13
|
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { LayoutCookieProvider } from '@admin-layout/client';
|
|
15
|
+
import { settingsLoaderUtil } from '@admin-layout/client/lib/components/UpdateSettings/UpdateSettings.server';
|
|
16
|
+
import { IAppLoadContext, IResourceParams } from '@common-stack/client-core';
|
|
17
|
+
import { FillRenderProvider, PluginsLoader } from '@common-stack/components-pro';
|
|
13
18
|
// @ts-ignore
|
|
14
19
|
import { ErrorBoundary } from '@app/frontend-stack-react/entries/antui/components/ErrorBoundary';
|
|
15
20
|
import { LocaleContext } from './context';
|
|
16
21
|
|
|
22
|
+
export const loader = async ({
|
|
23
|
+
request,
|
|
24
|
+
context,
|
|
25
|
+
params,
|
|
26
|
+
}: {
|
|
27
|
+
request: Request;
|
|
28
|
+
context: IAppLoadContext;
|
|
29
|
+
params: IResourceParams;
|
|
30
|
+
}) => {
|
|
31
|
+
const settingsResponse = await settingsLoaderUtil({ request });
|
|
32
|
+
const loadedPlugins = await PluginsLoader(plugins, { request, context, params });
|
|
33
|
+
|
|
34
|
+
return json(
|
|
35
|
+
{
|
|
36
|
+
settings: settingsResponse?.settings,
|
|
37
|
+
loadedPlugins,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
headers: [
|
|
41
|
+
['Cache-Control', 'max-age=300, s-maxage=600'],
|
|
42
|
+
['Set-Cookie', settingsResponse?.setCookie],
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
17
48
|
export const handle = {
|
|
18
49
|
i18n: 'common',
|
|
19
50
|
};
|
|
@@ -77,7 +108,9 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|
|
77
108
|
</head>
|
|
78
109
|
<body>
|
|
79
110
|
<PluginArea />
|
|
80
|
-
|
|
111
|
+
<FillRenderProvider>
|
|
112
|
+
{clientModules.getWrappedRoot(children)}
|
|
113
|
+
</FillRenderProvider>
|
|
81
114
|
<ScrollRestoration />
|
|
82
115
|
<Scripts />
|
|
83
116
|
{getConstants()}
|
|
@@ -90,7 +123,9 @@ export default function App() {
|
|
|
90
123
|
return (
|
|
91
124
|
<ApplicationErrorHandler plugins={plugins}>
|
|
92
125
|
<ConfigProvider>
|
|
93
|
-
<
|
|
126
|
+
<LayoutCookieProvider>
|
|
127
|
+
<Outlet />
|
|
128
|
+
</LayoutCookieProvider>
|
|
94
129
|
</ConfigProvider>
|
|
95
130
|
</ApplicationErrorHandler>
|
|
96
131
|
);
|
|
@@ -14,9 +14,41 @@ import { useContext } from 'react';
|
|
|
14
14
|
import { ServerStyleContext, ClientStyleContext, LocaleContext } from './context';
|
|
15
15
|
import { withEmotionCache } from '@emotion/react';
|
|
16
16
|
import { useChangeLanguage } from 'remix-i18next/react';
|
|
17
|
+
import { LayoutCookieProvider } from '@admin-layout/client';
|
|
18
|
+
import { settingsLoaderUtil } from '@admin-layout/client/lib/components/UpdateSettings/UpdateSettings.server';
|
|
19
|
+
import { IAppLoadContext, IResourceParams } from '@common-stack/client-core';
|
|
20
|
+
import { FillRenderProvider, PluginsLoader } from '@common-stack/components-pro';
|
|
21
|
+
// @ts-ignore
|
|
17
22
|
import { i18nextInstance as i18next } from '@app/frontend-stack-react/i18n-localization/i18next.server.js';
|
|
23
|
+
// @ts-ignore
|
|
18
24
|
import { ErrorBoundary } from '@app/frontend-stack-react/entries/chakraui/components/ErrorBoundary.js';
|
|
19
25
|
|
|
26
|
+
export const loader = async ({
|
|
27
|
+
request,
|
|
28
|
+
context,
|
|
29
|
+
params,
|
|
30
|
+
}: {
|
|
31
|
+
request: Request;
|
|
32
|
+
context: IAppLoadContext;
|
|
33
|
+
params: IResourceParams;
|
|
34
|
+
}) => {
|
|
35
|
+
const settingsResponse = await settingsLoaderUtil({ request });
|
|
36
|
+
const loadedPlugins = await PluginsLoader(plugins, { request, context, params });
|
|
37
|
+
|
|
38
|
+
return json(
|
|
39
|
+
{
|
|
40
|
+
settings: settingsResponse?.settings,
|
|
41
|
+
loadedPlugins,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
headers: [
|
|
45
|
+
['Cache-Control', 'max-age=300, s-maxage=600'],
|
|
46
|
+
['Set-Cookie', settingsResponse?.setCookie],
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
20
52
|
interface DocumentProps {
|
|
21
53
|
children: React.ReactNode;
|
|
22
54
|
}
|
|
@@ -67,12 +99,7 @@ export const Document = withEmotionCache(({ children }: DocumentProps, emotionCa
|
|
|
67
99
|
</>
|
|
68
100
|
);
|
|
69
101
|
});
|
|
70
|
-
|
|
71
|
-
export let loader = async ({ request }) => {
|
|
72
|
-
let locale = await i18next.getLocale(request);
|
|
73
|
-
return json({ locale });
|
|
74
|
-
};
|
|
75
|
-
*/
|
|
102
|
+
|
|
76
103
|
export let handle = {
|
|
77
104
|
i18n: 'common',
|
|
78
105
|
};
|
|
@@ -94,7 +121,11 @@ export default function App() {
|
|
|
94
121
|
|
|
95
122
|
return (
|
|
96
123
|
<ApplicationErrorHandler plugins={plugins}>
|
|
97
|
-
<Document>
|
|
124
|
+
<Document>
|
|
125
|
+
<FillRenderProvider>
|
|
126
|
+
{clientModules.getWrappedRoot(<LayoutCookieProvider><Outlet /></LayoutCookieProvider>)}
|
|
127
|
+
</FillRenderProvider>
|
|
128
|
+
</Document>
|
|
98
129
|
</ApplicationErrorHandler>
|
|
99
130
|
);
|
|
100
131
|
}
|
|
@@ -11,6 +11,10 @@ import clientModules, { plugins } from '@app/frontend-stack-react/modules.js';
|
|
|
11
11
|
// @ts-ignore
|
|
12
12
|
import { useChangeLanguage } from 'remix-i18next/react';
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { LayoutCookieProvider } from '@admin-layout/client';
|
|
15
|
+
import { settingsLoaderUtil } from '@admin-layout/client/lib/components/UpdateSettings/UpdateSettings.server';
|
|
16
|
+
import { IAppLoadContext, IResourceParams } from '@common-stack/client-core';
|
|
17
|
+
import { FillRenderProvider, PluginsLoader } from '@common-stack/components-pro';
|
|
14
18
|
// @ts-ignore
|
|
15
19
|
import { i18nextInstance as i18next } from '@app/frontend-stack-react/i18n-localization/i18next.server.js';
|
|
16
20
|
import stylesheet from "./tailwind.css?url";
|
|
@@ -19,12 +23,33 @@ export const links: LinksFunction = () => [
|
|
|
19
23
|
{ rel: "stylesheet", href: stylesheet },
|
|
20
24
|
];
|
|
21
25
|
|
|
22
|
-
export const loader = async ({
|
|
26
|
+
export const loader = async ({
|
|
27
|
+
request,
|
|
28
|
+
context,
|
|
29
|
+
params,
|
|
30
|
+
}: {
|
|
31
|
+
request: Request;
|
|
32
|
+
context: IAppLoadContext;
|
|
33
|
+
params: IResourceParams;
|
|
34
|
+
}) => {
|
|
23
35
|
const locale = await i18next.getLocale(request);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
const settingsResponse = await settingsLoaderUtil({ request });
|
|
37
|
+
const loadedPlugins = await PluginsLoader(plugins, { request, context, params });
|
|
38
|
+
|
|
39
|
+
return json(
|
|
40
|
+
{
|
|
41
|
+
__ENV__: publicEnv,
|
|
42
|
+
locale,
|
|
43
|
+
settings: settingsResponse?.settings,
|
|
44
|
+
loadedPlugins,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
headers: [
|
|
48
|
+
['Cache-Control', 'max-age=300, s-maxage=600'],
|
|
49
|
+
['Set-Cookie', settingsResponse?.setCookie],
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
);
|
|
28
53
|
};
|
|
29
54
|
|
|
30
55
|
export const handle = {
|
|
@@ -87,7 +112,9 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|
|
87
112
|
</head>
|
|
88
113
|
<body>
|
|
89
114
|
<PluginArea />
|
|
90
|
-
|
|
115
|
+
<FillRenderProvider>
|
|
116
|
+
{clientModules.getWrappedRoot(children)}
|
|
117
|
+
</FillRenderProvider>
|
|
91
118
|
<ScrollRestoration />
|
|
92
119
|
<Scripts />
|
|
93
120
|
{getConstants()}
|
|
@@ -109,8 +136,10 @@ const TestComponent = () => {
|
|
|
109
136
|
|
|
110
137
|
export default function App() {
|
|
111
138
|
return (
|
|
112
|
-
|
|
113
|
-
|
|
139
|
+
<LayoutCookieProvider>
|
|
140
|
+
{/* <Outlet /> */}
|
|
141
|
+
<TestComponent />
|
|
142
|
+
</LayoutCookieProvider>
|
|
114
143
|
);
|
|
115
144
|
}
|
|
116
145
|
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"common": "link:./common"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@common-stack/frontend-stack-react": "7.1.1-alpha.
|
|
59
|
+
"@common-stack/frontend-stack-react": "7.1.1-alpha.3",
|
|
60
60
|
"@react-icons/all-files": "^4.1.0",
|
|
61
61
|
"classnames": "^2.2.6",
|
|
62
62
|
"compression": "^1.7.4",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@cdmbase/vite-plugin-i18next-loader": "^2.0.12",
|
|
84
|
-
"@common-stack/rollup-vite-utils": "7.1.1-alpha.
|
|
84
|
+
"@common-stack/rollup-vite-utils": "7.1.1-alpha.3",
|
|
85
85
|
"@remix-run/dev": "~2.10.1",
|
|
86
86
|
"@remix-run/serve": "~2.10.1",
|
|
87
87
|
"cross-env": "^7.0.3",
|
|
@@ -141,8 +141,8 @@
|
|
|
141
141
|
"@babel/register": "^7.18.9",
|
|
142
142
|
"@babel/runtime": "^7.20.1",
|
|
143
143
|
"@common-stack/env-list-loader": "7.0.4-alpha.0",
|
|
144
|
-
"@common-stack/generate-plugin": "7.1.1-alpha.
|
|
145
|
-
"@common-stack/rollup-vite-utils": "7.1.1-alpha.
|
|
144
|
+
"@common-stack/generate-plugin": "7.1.1-alpha.4",
|
|
145
|
+
"@common-stack/rollup-vite-utils": "7.1.1-alpha.3",
|
|
146
146
|
"@emotion/babel-plugin": "^11.11.0",
|
|
147
147
|
"@graphql-codegen/add": "^5.0.3",
|
|
148
148
|
"@graphql-codegen/cli": "^5.0.4",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"common": "link:./common"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@common-stack/client-core": "7.1.1-alpha.
|
|
32
|
+
"@common-stack/client-core": "7.1.1-alpha.3",
|
|
33
33
|
"@common-stack/core": "7.0.4-alpha.17",
|
|
34
34
|
"@common-stack/server-core": "7.0.4-alpha.17",
|
|
35
|
-
"@common-stack/server-stack": "7.1.1-alpha.
|
|
36
|
-
"@common-stack/store-mongo": "7.
|
|
35
|
+
"@common-stack/server-stack": "7.1.1-alpha.4",
|
|
36
|
+
"@common-stack/store-mongo": "7.1.1-alpha.4",
|
|
37
37
|
"@container-stack/mailing-api": "5.2.1-alpha.1",
|
|
38
38
|
"helmet": "^3.21.2",
|
|
39
39
|
"react": "18.2.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@cdm-logger/server": ">=9.0.3",
|
|
65
65
|
"@common-stack/core": "7.0.4-alpha.17",
|
|
66
66
|
"@common-stack/server-core": "7.0.4-alpha.17",
|
|
67
|
-
"@common-stack/store-mongo": "7.
|
|
67
|
+
"@common-stack/store-mongo": "7.1.1-alpha.4",
|
|
68
68
|
"@container-stack/mailing-api": ">=0.0.35-alpha.1",
|
|
69
69
|
"@vscode-alt/monaco-editor": "^0.21.4",
|
|
70
70
|
"inversify": "^5.0.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/generate-plugin",
|
|
3
|
-
"version": "7.1.1-alpha.
|
|
3
|
+
"version": "7.1.1-alpha.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
},
|
|
27
27
|
"executors": "./executors.json",
|
|
28
28
|
"generators": "./generators.json",
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "3976681bf92acdd17287156670aba7c0f0cfa733"
|
|
30
30
|
}
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@apollo/client": "^3.9.0",
|
|
66
66
|
"@babel/runtime": "^7.20.1",
|
|
67
|
-
"@common-stack/server-stack": "7.1.1-alpha.
|
|
67
|
+
"@common-stack/server-stack": "7.1.1-alpha.4",
|
|
68
68
|
"@remix-run/node": "~2.10.1",
|
|
69
69
|
"lodash": "^4.17.15",
|
|
70
70
|
"react": "18.2.0"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Links, Meta, Outlet, Scripts, ScrollRestoration, useRouteLoaderData, useRouteError } from '@remix-run/react';
|
|
4
|
+
import { json } from '@remix-run/node';
|
|
4
5
|
import { PluginArea } from '@common-stack/client-react';
|
|
5
6
|
import { subscribeReduxRouter } from '@common-stack/remix-router-redux';
|
|
6
7
|
import { ApplicationErrorHandler } from '@admin-layout/ant-ui';
|
|
@@ -10,10 +11,40 @@ import clientModules, { plugins } from '@app/frontend-stack-react/modules.js';
|
|
|
10
11
|
// @ts-ignore
|
|
11
12
|
import { useChangeLanguage } from 'remix-i18next/react';
|
|
12
13
|
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { LayoutCookieProvider } from '@admin-layout/client';
|
|
15
|
+
import { settingsLoaderUtil } from '@admin-layout/client/lib/components/UpdateSettings/UpdateSettings.server';
|
|
16
|
+
import { IAppLoadContext, IResourceParams } from '@common-stack/client-core';
|
|
17
|
+
import { FillRenderProvider, PluginsLoader } from '@common-stack/components-pro';
|
|
13
18
|
// @ts-ignore
|
|
14
19
|
import { ErrorBoundary } from '@app/frontend-stack-react/entries/antui/components/ErrorBoundary';
|
|
15
20
|
import { LocaleContext } from './context';
|
|
16
21
|
|
|
22
|
+
export const loader = async ({
|
|
23
|
+
request,
|
|
24
|
+
context,
|
|
25
|
+
params,
|
|
26
|
+
}: {
|
|
27
|
+
request: Request;
|
|
28
|
+
context: IAppLoadContext;
|
|
29
|
+
params: IResourceParams;
|
|
30
|
+
}) => {
|
|
31
|
+
const settingsResponse = await settingsLoaderUtil({ request });
|
|
32
|
+
const loadedPlugins = await PluginsLoader(plugins, { request, context, params });
|
|
33
|
+
|
|
34
|
+
return json(
|
|
35
|
+
{
|
|
36
|
+
settings: settingsResponse?.settings,
|
|
37
|
+
loadedPlugins,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
headers: [
|
|
41
|
+
['Cache-Control', 'max-age=300, s-maxage=600'],
|
|
42
|
+
['Set-Cookie', settingsResponse?.setCookie],
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
17
48
|
export const handle = {
|
|
18
49
|
i18n: 'common',
|
|
19
50
|
};
|
|
@@ -77,7 +108,9 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|
|
77
108
|
</head>
|
|
78
109
|
<body>
|
|
79
110
|
<PluginArea />
|
|
80
|
-
|
|
111
|
+
<FillRenderProvider>
|
|
112
|
+
{clientModules.getWrappedRoot(children)}
|
|
113
|
+
</FillRenderProvider>
|
|
81
114
|
<ScrollRestoration />
|
|
82
115
|
<Scripts />
|
|
83
116
|
{getConstants()}
|
|
@@ -90,7 +123,9 @@ export default function App() {
|
|
|
90
123
|
return (
|
|
91
124
|
<ApplicationErrorHandler plugins={plugins}>
|
|
92
125
|
<ConfigProvider>
|
|
93
|
-
<
|
|
126
|
+
<LayoutCookieProvider>
|
|
127
|
+
<Outlet />
|
|
128
|
+
</LayoutCookieProvider>
|
|
94
129
|
</ConfigProvider>
|
|
95
130
|
</ApplicationErrorHandler>
|
|
96
131
|
);
|
|
@@ -14,9 +14,41 @@ import { useContext } from 'react';
|
|
|
14
14
|
import { ServerStyleContext, ClientStyleContext, LocaleContext } from './context';
|
|
15
15
|
import { withEmotionCache } from '@emotion/react';
|
|
16
16
|
import { useChangeLanguage } from 'remix-i18next/react';
|
|
17
|
+
import { LayoutCookieProvider } from '@admin-layout/client';
|
|
18
|
+
import { settingsLoaderUtil } from '@admin-layout/client/lib/components/UpdateSettings/UpdateSettings.server';
|
|
19
|
+
import { IAppLoadContext, IResourceParams } from '@common-stack/client-core';
|
|
20
|
+
import { FillRenderProvider, PluginsLoader } from '@common-stack/components-pro';
|
|
21
|
+
// @ts-ignore
|
|
17
22
|
import { i18nextInstance as i18next } from '@app/frontend-stack-react/i18n-localization/i18next.server.js';
|
|
23
|
+
// @ts-ignore
|
|
18
24
|
import { ErrorBoundary } from '@app/frontend-stack-react/entries/chakraui/components/ErrorBoundary.js';
|
|
19
25
|
|
|
26
|
+
export const loader = async ({
|
|
27
|
+
request,
|
|
28
|
+
context,
|
|
29
|
+
params,
|
|
30
|
+
}: {
|
|
31
|
+
request: Request;
|
|
32
|
+
context: IAppLoadContext;
|
|
33
|
+
params: IResourceParams;
|
|
34
|
+
}) => {
|
|
35
|
+
const settingsResponse = await settingsLoaderUtil({ request });
|
|
36
|
+
const loadedPlugins = await PluginsLoader(plugins, { request, context, params });
|
|
37
|
+
|
|
38
|
+
return json(
|
|
39
|
+
{
|
|
40
|
+
settings: settingsResponse?.settings,
|
|
41
|
+
loadedPlugins,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
headers: [
|
|
45
|
+
['Cache-Control', 'max-age=300, s-maxage=600'],
|
|
46
|
+
['Set-Cookie', settingsResponse?.setCookie],
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
20
52
|
interface DocumentProps {
|
|
21
53
|
children: React.ReactNode;
|
|
22
54
|
}
|
|
@@ -67,12 +99,7 @@ export const Document = withEmotionCache(({ children }: DocumentProps, emotionCa
|
|
|
67
99
|
</>
|
|
68
100
|
);
|
|
69
101
|
});
|
|
70
|
-
|
|
71
|
-
export let loader = async ({ request }) => {
|
|
72
|
-
let locale = await i18next.getLocale(request);
|
|
73
|
-
return json({ locale });
|
|
74
|
-
};
|
|
75
|
-
*/
|
|
102
|
+
|
|
76
103
|
export let handle = {
|
|
77
104
|
i18n: 'common',
|
|
78
105
|
};
|
|
@@ -94,7 +121,11 @@ export default function App() {
|
|
|
94
121
|
|
|
95
122
|
return (
|
|
96
123
|
<ApplicationErrorHandler plugins={plugins}>
|
|
97
|
-
<Document>
|
|
124
|
+
<Document>
|
|
125
|
+
<FillRenderProvider>
|
|
126
|
+
{clientModules.getWrappedRoot(<LayoutCookieProvider><Outlet /></LayoutCookieProvider>)}
|
|
127
|
+
</FillRenderProvider>
|
|
128
|
+
</Document>
|
|
98
129
|
</ApplicationErrorHandler>
|
|
99
130
|
);
|
|
100
131
|
}
|
|
@@ -11,6 +11,10 @@ import clientModules, { plugins } from '@app/frontend-stack-react/modules.js';
|
|
|
11
11
|
// @ts-ignore
|
|
12
12
|
import { useChangeLanguage } from 'remix-i18next/react';
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { LayoutCookieProvider } from '@admin-layout/client';
|
|
15
|
+
import { settingsLoaderUtil } from '@admin-layout/client/lib/components/UpdateSettings/UpdateSettings.server';
|
|
16
|
+
import { IAppLoadContext, IResourceParams } from '@common-stack/client-core';
|
|
17
|
+
import { FillRenderProvider, PluginsLoader } from '@common-stack/components-pro';
|
|
14
18
|
// @ts-ignore
|
|
15
19
|
import { i18nextInstance as i18next } from '@app/frontend-stack-react/i18n-localization/i18next.server.js';
|
|
16
20
|
import stylesheet from "./tailwind.css?url";
|
|
@@ -19,12 +23,33 @@ export const links: LinksFunction = () => [
|
|
|
19
23
|
{ rel: "stylesheet", href: stylesheet },
|
|
20
24
|
];
|
|
21
25
|
|
|
22
|
-
export const loader = async ({
|
|
26
|
+
export const loader = async ({
|
|
27
|
+
request,
|
|
28
|
+
context,
|
|
29
|
+
params,
|
|
30
|
+
}: {
|
|
31
|
+
request: Request;
|
|
32
|
+
context: IAppLoadContext;
|
|
33
|
+
params: IResourceParams;
|
|
34
|
+
}) => {
|
|
23
35
|
const locale = await i18next.getLocale(request);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
const settingsResponse = await settingsLoaderUtil({ request });
|
|
37
|
+
const loadedPlugins = await PluginsLoader(plugins, { request, context, params });
|
|
38
|
+
|
|
39
|
+
return json(
|
|
40
|
+
{
|
|
41
|
+
__ENV__: publicEnv,
|
|
42
|
+
locale,
|
|
43
|
+
settings: settingsResponse?.settings,
|
|
44
|
+
loadedPlugins,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
headers: [
|
|
48
|
+
['Cache-Control', 'max-age=300, s-maxage=600'],
|
|
49
|
+
['Set-Cookie', settingsResponse?.setCookie],
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
);
|
|
28
53
|
};
|
|
29
54
|
|
|
30
55
|
export const handle = {
|
|
@@ -87,7 +112,9 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|
|
87
112
|
</head>
|
|
88
113
|
<body>
|
|
89
114
|
<PluginArea />
|
|
90
|
-
|
|
115
|
+
<FillRenderProvider>
|
|
116
|
+
{clientModules.getWrappedRoot(children)}
|
|
117
|
+
</FillRenderProvider>
|
|
91
118
|
<ScrollRestoration />
|
|
92
119
|
<Scripts />
|
|
93
120
|
{getConstants()}
|
|
@@ -109,8 +136,10 @@ const TestComponent = () => {
|
|
|
109
136
|
|
|
110
137
|
export default function App() {
|
|
111
138
|
return (
|
|
112
|
-
|
|
113
|
-
|
|
139
|
+
<LayoutCookieProvider>
|
|
140
|
+
{/* <Outlet /> */}
|
|
141
|
+
<TestComponent />
|
|
142
|
+
</LayoutCookieProvider>
|
|
114
143
|
);
|
|
115
144
|
}
|
|
116
145
|
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"common": "link:./common"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@common-stack/frontend-stack-react": "7.1.1-alpha.
|
|
59
|
+
"@common-stack/frontend-stack-react": "7.1.1-alpha.3",
|
|
60
60
|
"@react-icons/all-files": "^4.1.0",
|
|
61
61
|
"classnames": "^2.2.6",
|
|
62
62
|
"compression": "^1.7.4",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@cdmbase/vite-plugin-i18next-loader": "^2.0.12",
|
|
84
|
-
"@common-stack/rollup-vite-utils": "7.1.1-alpha.
|
|
84
|
+
"@common-stack/rollup-vite-utils": "7.1.1-alpha.3",
|
|
85
85
|
"@remix-run/dev": "~2.10.1",
|
|
86
86
|
"@remix-run/serve": "~2.10.1",
|
|
87
87
|
"cross-env": "^7.0.3",
|
|
@@ -141,8 +141,8 @@
|
|
|
141
141
|
"@babel/register": "^7.18.9",
|
|
142
142
|
"@babel/runtime": "^7.20.1",
|
|
143
143
|
"@common-stack/env-list-loader": "7.0.4-alpha.0",
|
|
144
|
-
"@common-stack/generate-plugin": "7.1.1-alpha.
|
|
145
|
-
"@common-stack/rollup-vite-utils": "7.1.1-alpha.
|
|
144
|
+
"@common-stack/generate-plugin": "7.1.1-alpha.4",
|
|
145
|
+
"@common-stack/rollup-vite-utils": "7.1.1-alpha.3",
|
|
146
146
|
"@emotion/babel-plugin": "^11.11.0",
|
|
147
147
|
"@graphql-codegen/add": "^5.0.3",
|
|
148
148
|
"@graphql-codegen/cli": "^5.0.4",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"common": "link:./common"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@common-stack/client-core": "7.1.1-alpha.
|
|
32
|
+
"@common-stack/client-core": "7.1.1-alpha.3",
|
|
33
33
|
"@common-stack/core": "7.0.4-alpha.17",
|
|
34
34
|
"@common-stack/server-core": "7.0.4-alpha.17",
|
|
35
|
-
"@common-stack/server-stack": "7.1.1-alpha.
|
|
36
|
-
"@common-stack/store-mongo": "7.
|
|
35
|
+
"@common-stack/server-stack": "7.1.1-alpha.4",
|
|
36
|
+
"@common-stack/store-mongo": "7.1.1-alpha.4",
|
|
37
37
|
"@container-stack/mailing-api": "5.2.1-alpha.1",
|
|
38
38
|
"helmet": "^3.21.2",
|
|
39
39
|
"react": "18.2.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@cdm-logger/server": ">=9.0.3",
|
|
65
65
|
"@common-stack/core": "7.0.4-alpha.17",
|
|
66
66
|
"@common-stack/server-core": "7.0.4-alpha.17",
|
|
67
|
-
"@common-stack/store-mongo": "7.
|
|
67
|
+
"@common-stack/store-mongo": "7.1.1-alpha.4",
|
|
68
68
|
"@container-stack/mailing-api": ">=0.0.35-alpha.1",
|
|
69
69
|
"@vscode-alt/monaco-editor": "^0.21.4",
|
|
70
70
|
"inversify": "^5.0.1",
|