create-chayns-app 1.1.28 → 1.2.0-beta.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/dist/index.cjs +130 -0
- package/package.json +24 -16
- package/templates/api-v5/internal/js/src/redux-modules/index.js +17 -0
- package/templates/api-v5/internal/js/src/redux-modules/loggerMiddleware.js +31 -0
- package/templates/api-v5/internal/js/src/utils/logger.js +31 -0
- package/templates/api-v5/internal/ts/src/redux-modules/index.ts +20 -0
- package/templates/api-v5/internal/ts/src/redux-modules/loggerMiddleware.ts +45 -0
- package/templates/api-v5/internal/ts/src/utils/logger.ts +31 -0
- package/templates/api-v5/page/src/components/AppWrapper.jsx +7 -9
- package/templates/api-v5/page/src/index.html +1 -1
- package/templates/api-v5/page/src/index.jsx +2 -2
- package/templates/api-v5/page-module/src/components/App.jsx +19 -16
- package/templates/api-v5/page-module/src/components/AppWrapper.jsx +10 -12
- package/templates/api-v5/page-module-redux/src/components/App.jsx +22 -16
- package/templates/api-v5/page-module-redux/src/components/AppWrapper.jsx +7 -7
- package/templates/api-v5/page-redux/src/components/AppWrapper.jsx +9 -11
- package/templates/api-v5/page-redux/src/index.html +1 -1
- package/templates/api-v5/page-redux/src/index.jsx +2 -2
- package/templates/api-v5/page-ts/src/components/AppWrapper.tsx +7 -9
- package/templates/api-v5/page-ts/src/index.html +1 -1
- package/templates/api-v5/page-ts/src/index.tsx +2 -2
- package/templates/api-v5/page-ts-module/src/components/App.tsx +17 -14
- package/templates/api-v5/page-ts-module/src/components/AppWrapper.tsx +7 -7
- package/templates/api-v5/page-ts-module-redux/src/components/App.tsx +21 -14
- package/templates/api-v5/page-ts-module-redux/src/components/AppWrapper.tsx +13 -9
- package/templates/api-v5/page-ts-redux/src/components/AppWrapper.tsx +9 -11
- package/templates/api-v5/page-ts-redux/src/index.html +1 -1
- package/templates/api-v5/page-ts-redux/src/index.tsx +1 -2
- package/templates/api-v5/shared/.env.development.local +0 -2
- package/templates/api-v5/shared/{ts/src/constants/server-urls.ts → js/src/constants/serverUrls.js} +0 -1
- package/templates/api-v5/shared/js/src/redux-modules/counter/slice.js +5 -0
- package/templates/api-v5/shared/js/src/redux-modules/index.js +7 -3
- package/templates/api-v5/shared/toolkit.config-module.js +4 -2
- package/templates/api-v5/shared/toolkit.config.js +3 -3
- package/templates/api-v5/shared/{js/src/constants/server-urls.js → ts/src/constants/serverUrls.ts} +0 -1
- package/templates/api-v5/shared/ts/src/hooks/redux.ts +5 -0
- package/templates/api-v5/shared/ts/src/redux-modules/counter/slice.ts +5 -0
- package/templates/api-v5/shared/ts/src/redux-modules/index.ts +8 -4
- package/templates/api-v5/shared/ts/src/types/environment.d.ts +2 -2
- package/templates/api-v5/shared/ts/src/types/global.d.ts +5 -0
- package/templates/api-v5/shared/ts/tsconfig.json +17 -19
- package/templates/page/README.md +5 -8
- package/templates/page/src/index.html +1 -1
- package/templates/shared/README.md +5 -8
- package/templates/shared/tests/setup.js +9 -0
- package/templates/shared/vitest.config.mjs +18 -0
- package/.github/workflows/publish.yml +0 -21
- package/dist/index.js +0 -40
- package/templates/api-v5/shared/js/src/redux-modules/counter/selectors.js +0 -5
- package/templates/api-v5/shared/js/template-package-redux.json +0 -40
- package/templates/api-v5/shared/js/template-package.json +0 -38
- package/templates/api-v5/shared/ts/src/redux-modules/counter/selectors.ts +0 -6
- package/templates/api-v5/shared/ts/template-package-redux.json +0 -39
- package/templates/api-v5/shared/ts/template-package.json +0 -37
- package/templates/page/template-package.json +0 -33
- package/templates/shared/template-gitignore +0 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-chayns-app",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Create a new chayns® development project in one command.",
|
|
6
6
|
"keywords": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/TobitSoftware/create-chayns-app.git"
|
|
19
|
+
"url": "git+https://github.com/TobitSoftware/create-chayns-app.git"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"author": {
|
|
@@ -25,28 +25,36 @@
|
|
|
25
25
|
},
|
|
26
26
|
"main": "index.js",
|
|
27
27
|
"bin": {
|
|
28
|
-
"create-chayns-app": "dist/index.
|
|
28
|
+
"create-chayns-app": "dist/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"type": "module",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"templates"
|
|
34
|
+
],
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
29
37
|
},
|
|
30
38
|
"scripts": {
|
|
31
|
-
"build": "
|
|
39
|
+
"build": "node ./scripts/build.js",
|
|
40
|
+
"watch": "node ./scripts/watch.js",
|
|
32
41
|
"format": "prettier . --ignore-path .gitignore --write",
|
|
33
42
|
"prepublishOnly": "npm run build",
|
|
34
43
|
"start": "node src/index.js"
|
|
35
44
|
},
|
|
36
45
|
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"chalk": "4.1
|
|
39
|
-
"commander": "
|
|
46
|
+
"@eslint/js": "^9.19.0",
|
|
47
|
+
"chalk": "^5.4.1",
|
|
48
|
+
"commander": "^13.1.0",
|
|
40
49
|
"enquirer": "^2.4.1",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"ora": "
|
|
47
|
-
"prettier": "^3.
|
|
48
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
49
|
-
"react-redux": "^9.1.2",
|
|
50
|
+
"esbuild": "^0.24.2",
|
|
51
|
+
"eslint": "^9.19.0",
|
|
52
|
+
"execa": "^8.0.1",
|
|
53
|
+
"fast-glob": "^3.3.3",
|
|
54
|
+
"is-npm": "^6.0.0",
|
|
55
|
+
"ora": "^8.1.1",
|
|
56
|
+
"prettier": "^3.4.2",
|
|
57
|
+
"prettier-plugin-packagejson": "^2.5.8",
|
|
50
58
|
"validate-npm-package-name": "^6.0.0"
|
|
51
59
|
},
|
|
52
60
|
"publishConfig": {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { configureStore, combineReducers } from '@reduxjs/toolkit';
|
|
2
|
+
import { counterReducer } from './counter/slice';
|
|
3
|
+
import { loggerMiddleware } from './loggerMiddleware';
|
|
4
|
+
|
|
5
|
+
const rootReducer = combineReducers({
|
|
6
|
+
counter: counterReducer,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const createStore = (preloadedState) => configureStore({
|
|
10
|
+
reducer: rootReducer,
|
|
11
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(loggerMiddleware),
|
|
12
|
+
preloadedState,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const store = createStore();
|
|
16
|
+
|
|
17
|
+
export default store;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import logger from "../utils/logger";
|
|
2
|
+
|
|
3
|
+
export const loggerMiddleware = () => (next) => (action) => {
|
|
4
|
+
try {
|
|
5
|
+
const metaAction = action;
|
|
6
|
+
if (metaAction.meta.requestStatus === 'rejected') {
|
|
7
|
+
if (metaAction.meta.aborted || metaAction.meta.condition) {
|
|
8
|
+
return next(action);
|
|
9
|
+
}
|
|
10
|
+
if (process.env.NODE_ENV === 'development') {
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
console.log('redux action error', action);
|
|
13
|
+
}
|
|
14
|
+
logger.error({
|
|
15
|
+
message: 'redux action error',
|
|
16
|
+
customText: metaAction.type,
|
|
17
|
+
data: { arg: metaAction.meta.arg },
|
|
18
|
+
section: 'redux-modules/loggerMiddleware',
|
|
19
|
+
}, metaAction.error);
|
|
20
|
+
}
|
|
21
|
+
return next(action);
|
|
22
|
+
} catch (ex) {
|
|
23
|
+
logger.error({
|
|
24
|
+
message: 'error in store',
|
|
25
|
+
data: {
|
|
26
|
+
action,
|
|
27
|
+
}
|
|
28
|
+
}, ex);
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getCurrentPage, getSite, getUser } from 'chayns-api';
|
|
2
|
+
import { ChaynsLogger } from 'chayns-logger';
|
|
3
|
+
|
|
4
|
+
const logger = new ChaynsLogger({
|
|
5
|
+
// TODO: create and insert your applicationUid
|
|
6
|
+
applicationUid: '<applicationUid>',
|
|
7
|
+
overrideOnError: true,
|
|
8
|
+
overrideConsoleError: process.env.NODE_ENV !== 'development',
|
|
9
|
+
useDevServer: process.env.NODE_ENV === 'development' || ['qa', 'development'].includes(process.env.BUILD_ENV),
|
|
10
|
+
version: process.env.BUILD_VERSION,
|
|
11
|
+
throttleTime: 1000,
|
|
12
|
+
middleware: (payload) => {
|
|
13
|
+
try {
|
|
14
|
+
const currentPage = getCurrentPage();
|
|
15
|
+
// eslint-disable-next-line no-param-reassign
|
|
16
|
+
payload.siteId ??= currentPage.siteId;
|
|
17
|
+
// eslint-disable-next-line no-param-reassign
|
|
18
|
+
payload.customNumber ??= currentPage.id;
|
|
19
|
+
// eslint-disable-next-line no-param-reassign
|
|
20
|
+
payload.personId ??= getUser()?.personId;
|
|
21
|
+
// eslint-disable-next-line no-param-reassign
|
|
22
|
+
payload.locationId ??= getSite().locationId;
|
|
23
|
+
} catch {
|
|
24
|
+
//
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return true;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default logger;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { configureStore, combineReducers } from '@reduxjs/toolkit';
|
|
2
|
+
import { counterReducer } from './counter/slice';
|
|
3
|
+
import { loggerMiddleware } from './loggerMiddleware';
|
|
4
|
+
|
|
5
|
+
const rootReducer = combineReducers({
|
|
6
|
+
counter: counterReducer,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const createStore = (preloadedState?: RootState) => configureStore({
|
|
10
|
+
reducer: rootReducer,
|
|
11
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(loggerMiddleware),
|
|
12
|
+
preloadedState,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const store = createStore();
|
|
16
|
+
|
|
17
|
+
export type RootState = ReturnType<typeof rootReducer>;
|
|
18
|
+
export type AppDispatch = ReturnType<typeof createStore>["dispatch"];
|
|
19
|
+
|
|
20
|
+
export default store;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Middleware } from "@reduxjs/toolkit";
|
|
2
|
+
import logger from "../utils/logger";
|
|
3
|
+
|
|
4
|
+
type MetaAction = {
|
|
5
|
+
type: string;
|
|
6
|
+
payload: unknown;
|
|
7
|
+
meta: {
|
|
8
|
+
arg: unknown;
|
|
9
|
+
requestId: string;
|
|
10
|
+
requestStatus: 'pending' | 'rejected' | 'fulfilled';
|
|
11
|
+
aborted?: boolean;
|
|
12
|
+
condition?: boolean;
|
|
13
|
+
},
|
|
14
|
+
error?: Error;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const loggerMiddleware: Middleware = () => (next) => (action) => {
|
|
18
|
+
try {
|
|
19
|
+
const metaAction = action as MetaAction;
|
|
20
|
+
if (metaAction.meta.requestStatus === 'rejected') {
|
|
21
|
+
if (metaAction.meta.aborted || metaAction.meta.condition) {
|
|
22
|
+
return next(action);
|
|
23
|
+
}
|
|
24
|
+
if (process.env.NODE_ENV === 'development') {
|
|
25
|
+
// eslint-disable-next-line no-console
|
|
26
|
+
console.log('redux action error', action);
|
|
27
|
+
}
|
|
28
|
+
logger.error({
|
|
29
|
+
message: 'redux action error',
|
|
30
|
+
customText: metaAction.type,
|
|
31
|
+
data: { arg: metaAction.meta.arg },
|
|
32
|
+
section: 'redux-modules/loggerMiddleware',
|
|
33
|
+
}, metaAction.error);
|
|
34
|
+
}
|
|
35
|
+
return next(action);
|
|
36
|
+
} catch (ex) {
|
|
37
|
+
logger.error({
|
|
38
|
+
message: 'error in store',
|
|
39
|
+
data: {
|
|
40
|
+
action,
|
|
41
|
+
}
|
|
42
|
+
}, ex as Error);
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getCurrentPage, getSite, getUser } from 'chayns-api';
|
|
2
|
+
import { ChaynsLogger } from 'chayns-logger';
|
|
3
|
+
|
|
4
|
+
const logger = new ChaynsLogger({
|
|
5
|
+
// TODO: create and insert your applicationUid
|
|
6
|
+
applicationUid: '<applicationUid>',
|
|
7
|
+
overrideOnError: true,
|
|
8
|
+
overrideConsoleError: process.env.NODE_ENV !== 'development',
|
|
9
|
+
useDevServer: process.env.NODE_ENV === 'development' || ['qa', 'development'].includes(process.env.BUILD_ENV),
|
|
10
|
+
version: process.env.BUILD_VERSION,
|
|
11
|
+
throttleTime: 1000,
|
|
12
|
+
middleware: (payload) => {
|
|
13
|
+
try {
|
|
14
|
+
const currentPage = getCurrentPage();
|
|
15
|
+
// eslint-disable-next-line no-param-reassign
|
|
16
|
+
payload.siteId ??= currentPage.siteId;
|
|
17
|
+
// eslint-disable-next-line no-param-reassign
|
|
18
|
+
payload.customNumber ??= currentPage.id;
|
|
19
|
+
// eslint-disable-next-line no-param-reassign
|
|
20
|
+
payload.personId ??= getUser()?.personId;
|
|
21
|
+
// eslint-disable-next-line no-param-reassign
|
|
22
|
+
payload.locationId ??= getSite().locationId;
|
|
23
|
+
} catch {
|
|
24
|
+
//
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return true;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default logger;
|
|
@@ -3,14 +3,12 @@ import { ChaynsProvider } from 'chayns-api';
|
|
|
3
3
|
import { PageProvider } from '@chayns-components/core';
|
|
4
4
|
import App from './App';
|
|
5
5
|
|
|
6
|
-
const AppWrapper = () =>
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
}
|
|
6
|
+
const AppWrapper = () => (
|
|
7
|
+
<ChaynsProvider>
|
|
8
|
+
<PageProvider>
|
|
9
|
+
<App />
|
|
10
|
+
</PageProvider>
|
|
11
|
+
</ChaynsProvider>
|
|
12
|
+
);
|
|
15
13
|
|
|
16
14
|
export default AppWrapper;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import AppWrapper from './components/AppWrapper';
|
|
4
|
-
|
|
4
|
+
{{ logger-import }}
|
|
5
5
|
try {
|
|
6
6
|
const root = createRoot(document.querySelector('#root'));
|
|
7
|
-
root.render(<AppWrapper/>);
|
|
7
|
+
root.render(<AppWrapper />);
|
|
8
8
|
} catch (e) {
|
|
9
9
|
console.error('Encountered error at `ReactDOM.render`: ', e);
|
|
10
10
|
}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { WaitUntil } from 'chayns-api';
|
|
3
3
|
import { SmallWaitCursor } from '@chayns-components/core';
|
|
4
4
|
import './app.scss';
|
|
5
5
|
|
|
6
6
|
const App = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const [taskList] = useState(() => [
|
|
8
|
+
// first level tasks are executed one after the other
|
|
9
|
+
() =>
|
|
10
|
+
new Promise((resolve) => {
|
|
11
|
+
setTimeout(resolve, 1000);
|
|
12
|
+
}), // Add your initial Requests, textstrings here
|
|
11
13
|
[
|
|
12
|
-
//
|
|
13
|
-
]
|
|
14
|
-
]
|
|
14
|
+
// second level tasks are executed in parallel
|
|
15
|
+
],
|
|
16
|
+
]);
|
|
15
17
|
|
|
16
|
-
return (
|
|
18
|
+
return (
|
|
17
19
|
<WaitUntil
|
|
18
20
|
tasks={taskList}
|
|
19
|
-
loadingComponent={
|
|
20
|
-
<div style={{
|
|
21
|
-
<SmallWaitCursor/>
|
|
21
|
+
loadingComponent={
|
|
22
|
+
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
|
23
|
+
<SmallWaitCursor />
|
|
22
24
|
</div>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
}
|
|
26
|
+
>
|
|
27
|
+
<h1>Hi! Welcome to your newly created chayns application!</h1>
|
|
28
|
+
</WaitUntil>
|
|
29
|
+
);
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
export default App;
|
|
@@ -3,17 +3,15 @@ import { ChaynsProvider, withCompatMode } from 'chayns-api';
|
|
|
3
3
|
import { PageProvider } from '@chayns-components/core';
|
|
4
4
|
import App from './App';
|
|
5
5
|
|
|
6
|
-
const AppWrapper = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
}
|
|
6
|
+
const AppWrapper = (props) => (
|
|
7
|
+
<div className="{{ package-name-underscore }}">
|
|
8
|
+
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
|
9
|
+
<ChaynsProvider {...props}>
|
|
10
|
+
<PageProvider>
|
|
11
|
+
<App />
|
|
12
|
+
</PageProvider>
|
|
13
|
+
</ChaynsProvider>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
18
16
|
|
|
19
17
|
export default withCompatMode(AppWrapper);
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { WaitUntil } from 'chayns-api';
|
|
3
3
|
import { SmallWaitCursor } from '@chayns-components/core';
|
|
4
4
|
import { useSelector } from 'react-redux';
|
|
5
|
-
import {
|
|
5
|
+
import { selectCounterValue } from '../redux-modules/counter/slice';
|
|
6
|
+
import './app.scss';
|
|
6
7
|
|
|
7
8
|
const App = () => {
|
|
8
|
-
const counter = useSelector(
|
|
9
|
+
const counter = useSelector(selectCounterValue);
|
|
9
10
|
|
|
10
|
-
const taskList = [
|
|
11
|
-
//
|
|
12
|
-
() =>
|
|
11
|
+
const [taskList] = useState(() => [
|
|
12
|
+
// first level tasks are executed one after the other
|
|
13
|
+
() =>
|
|
14
|
+
new Promise((resolve) => {
|
|
15
|
+
setTimeout(resolve, 1000);
|
|
16
|
+
}), // Add your initial Requests, textstrings here
|
|
13
17
|
[
|
|
14
|
-
//
|
|
15
|
-
]
|
|
16
|
-
]
|
|
18
|
+
// second level tasks are executed in parallel
|
|
19
|
+
],
|
|
20
|
+
]);
|
|
17
21
|
|
|
18
|
-
return (
|
|
22
|
+
return (
|
|
19
23
|
<WaitUntil
|
|
20
24
|
tasks={taskList}
|
|
21
|
-
loadingComponent={
|
|
22
|
-
<div style={{
|
|
23
|
-
<SmallWaitCursor/>
|
|
25
|
+
loadingComponent={
|
|
26
|
+
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
|
27
|
+
<SmallWaitCursor />
|
|
24
28
|
</div>
|
|
25
|
-
|
|
29
|
+
}
|
|
26
30
|
>
|
|
27
|
-
<h1>Hi! Welcome to your newly created chayns application
|
|
28
|
-
|
|
31
|
+
<h1>Hi! Welcome to your newly created chayns application!</h1>
|
|
32
|
+
<p>Count: {counter}</p>
|
|
33
|
+
</WaitUntil>
|
|
34
|
+
);
|
|
29
35
|
};
|
|
30
36
|
|
|
31
37
|
export default App;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Provider } from 'react-redux';
|
|
2
3
|
import { ChaynsProvider, withCompatMode } from 'chayns-api';
|
|
3
4
|
import { PageProvider } from '@chayns-components/core';
|
|
4
5
|
import App from './App';
|
|
5
6
|
import store from '../redux-modules';
|
|
6
|
-
import { Provider } from 'react-redux';
|
|
7
7
|
|
|
8
|
-
const AppWrapper = (
|
|
9
|
-
|
|
10
|
-
/* eslint-disable-next-line react/jsx-props-no-spreading */
|
|
8
|
+
const AppWrapper = (props) => (
|
|
9
|
+
<div className="{{ package-name-underscore }}">
|
|
10
|
+
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
|
11
11
|
<ChaynsProvider {...props}>
|
|
12
12
|
<Provider store={store}>
|
|
13
13
|
<PageProvider>
|
|
14
|
-
<App/>
|
|
14
|
+
<App />
|
|
15
15
|
</PageProvider>
|
|
16
16
|
</Provider>
|
|
17
17
|
</ChaynsProvider>
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
20
|
|
|
21
21
|
export default withCompatMode(AppWrapper);
|
|
@@ -5,16 +5,14 @@ import { PageProvider } from '@chayns-components/core';
|
|
|
5
5
|
import store from '../redux-modules';
|
|
6
6
|
import App from './App';
|
|
7
7
|
|
|
8
|
-
const AppWrapper = () =>
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
18
|
-
}
|
|
8
|
+
const AppWrapper = () => (
|
|
9
|
+
<ChaynsProvider>
|
|
10
|
+
<Provider store={store}>
|
|
11
|
+
<PageProvider>
|
|
12
|
+
<App />
|
|
13
|
+
</PageProvider>
|
|
14
|
+
</Provider>
|
|
15
|
+
</ChaynsProvider>
|
|
16
|
+
);
|
|
19
17
|
|
|
20
18
|
export default AppWrapper;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import AppWrapper from './components/AppWrapper';
|
|
4
|
-
|
|
4
|
+
{{ logger-import }}
|
|
5
5
|
try {
|
|
6
6
|
const root = createRoot(document.querySelector('#root'));
|
|
7
|
-
root.render(<AppWrapper/>);
|
|
7
|
+
root.render(<AppWrapper />);
|
|
8
8
|
} catch (e) {
|
|
9
9
|
console.error('Encountered error at `ReactDOM.render`: ', e);
|
|
10
10
|
}
|
|
@@ -3,14 +3,12 @@ import { ChaynsProvider } from 'chayns-api';
|
|
|
3
3
|
import { PageProvider } from '@chayns-components/core';
|
|
4
4
|
import App from './App';
|
|
5
5
|
|
|
6
|
-
const AppWrapper = () =>
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
);
|
|
14
|
-
}
|
|
6
|
+
const AppWrapper = () => (
|
|
7
|
+
<ChaynsProvider>
|
|
8
|
+
<PageProvider>
|
|
9
|
+
<App />
|
|
10
|
+
</PageProvider>
|
|
11
|
+
</ChaynsProvider>
|
|
12
|
+
);
|
|
15
13
|
|
|
16
14
|
export default AppWrapper;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import AppWrapper from './components/AppWrapper';
|
|
4
|
-
|
|
4
|
+
{{ logger-import }}
|
|
5
5
|
try {
|
|
6
6
|
const root = createRoot(document.querySelector('#root') as Element);
|
|
7
|
-
root.render(<AppWrapper/>);
|
|
7
|
+
root.render(<AppWrapper />);
|
|
8
8
|
} catch (e) {
|
|
9
9
|
console.error('Encountered error at `ReactDOM.render`: ', e);
|
|
10
10
|
}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { WaitUntil } from 'chayns-api';
|
|
3
3
|
import { SmallWaitCursor } from '@chayns-components/core';
|
|
4
4
|
import './app.scss';
|
|
5
5
|
|
|
6
6
|
const App = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const [taskList] = useState(() => [
|
|
8
|
+
// first level tasks are executed one after the other
|
|
9
|
+
() =>
|
|
10
|
+
new Promise((resolve) => {
|
|
11
|
+
setTimeout(resolve, 1000);
|
|
12
|
+
}), // Add your initial Requests, textstrings here
|
|
11
13
|
[
|
|
12
|
-
//
|
|
13
|
-
]
|
|
14
|
-
]
|
|
14
|
+
// second level tasks are executed in parallel
|
|
15
|
+
],
|
|
16
|
+
]);
|
|
15
17
|
|
|
16
|
-
return (
|
|
18
|
+
return (
|
|
17
19
|
<WaitUntil
|
|
18
20
|
tasks={taskList}
|
|
19
|
-
loadingComponent={
|
|
20
|
-
<div style={{
|
|
21
|
-
<SmallWaitCursor/>
|
|
21
|
+
loadingComponent={
|
|
22
|
+
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
|
23
|
+
<SmallWaitCursor />
|
|
22
24
|
</div>
|
|
23
|
-
|
|
25
|
+
}
|
|
24
26
|
>
|
|
25
27
|
<h1>Hi! Welcome to your newly created chayns application!</h1>
|
|
26
|
-
</WaitUntil
|
|
28
|
+
</WaitUntil>
|
|
29
|
+
);
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
export default App;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { ChaynsProvider, withCompatMode } from 'chayns-api';
|
|
3
3
|
import { PageProvider } from '@chayns-components/core';
|
|
4
4
|
import App from './App';
|
|
5
5
|
|
|
6
|
-
const AppWrapper = (
|
|
7
|
-
|
|
8
|
-
/* eslint-disable-next-line react/jsx-props-no-spreading */
|
|
6
|
+
const AppWrapper = (props: ComponentPropsWithoutRef<typeof ChaynsProvider>) => (
|
|
7
|
+
<div className="{{ package-name-underscore }}">
|
|
8
|
+
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
|
9
9
|
<ChaynsProvider {...props}>
|
|
10
10
|
<PageProvider>
|
|
11
|
-
<App/>
|
|
11
|
+
<App />
|
|
12
12
|
</PageProvider>
|
|
13
13
|
</ChaynsProvider>
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
16
|
|
|
17
17
|
export default withCompatMode(AppWrapper);
|