create-catalyst-app 0.0.1-beta.2 → 0.0.1-beta.21
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 → Readme.md} +7 -4
- package/codemod/new-route/index.js +98 -0
- package/codemod/new-route/template.js +119 -0
- package/codemod/new-route/transformers/createReducer.js +38 -0
- package/codemod/new-route/transformers/createRoute.js +33 -0
- package/codemod/new-route/utils.js +90 -0
- package/license +10 -0
- package/package.json +18 -18
- package/scripts/cli.cjs +359 -0
- package/templates/common/.eslintignore +1 -6
- package/templates/common/.eslintrc +13 -38
- package/templates/common/README.md +16 -20
- package/templates/common/api.js +12 -25
- package/templates/common/client/styles.js +1 -13
- package/templates/common/config/config.json +10 -16
- package/templates/common/public/favicon.ico +0 -0
- package/templates/{redux-js → common}/server/document.js +2 -4
- package/templates/common/server/index.js +2 -0
- package/templates/common/server/server.js +8 -0
- package/templates/common/src/js/containers/Home/Home.js +23 -40
- package/templates/common/src/js/containers/Home/Home.scss +34 -0
- package/templates/common/src/js/routes/index.js +9 -48
- package/templates/common/src/static/css/base/index.scss +0 -7
- package/templates/common/src/static/css/base/styles.scss +0 -160
- package/templates/common/src/static/css/resources/_variables.scss +0 -172
- package/{my-app → templates/common}/webpackConfig.js +3 -2
- package/templates/mcp-root/mcp/context.md +674 -0
- package/templates/mcp-root/mcp/mcp.js +36 -0
- package/templates/none-js/client/index.js +8 -12
- package/templates/none-js/package.json +13 -35
- package/templates/none-js/src/js/containers/App/index.js +12 -36
- package/templates/none-js/src/js/routes/utils.js +42 -0
- package/templates/none-ts/client/index.js +23 -0
- package/templates/none-ts/package.json +34 -0
- package/templates/none-ts/src/js/containers/App/index.js +16 -0
- package/templates/none-ts/src/js/routes/utils.js +42 -0
- package/templates/none-ts/tsconfig.json +13 -0
- package/templates/none-ts/types.d.ts +4 -0
- package/templates/redux-js/client/index.js +6 -5
- package/templates/redux-js/package.json +16 -35
- package/templates/redux-js/src/js/containers/App/actions.js +1 -4
- package/templates/redux-js/src/js/containers/App/index.js +12 -38
- package/templates/redux-js/src/js/containers/App/reducer.js +15 -17
- package/templates/redux-js/src/js/routes/utils.js +42 -0
- package/templates/redux-js/src/js/store/index.js +17 -68
- package/{my-app → templates/redux-ts}/client/index.js +4 -3
- package/templates/redux-ts/package.json +37 -0
- package/{my-app → templates/redux-ts}/src/js/containers/App/actions.js +1 -4
- package/templates/redux-ts/src/js/containers/App/index.js +16 -0
- package/templates/redux-ts/src/js/containers/App/reducer.js +19 -0
- package/templates/redux-ts/src/js/routes/utils.js +42 -0
- package/templates/redux-ts/src/js/store/index.js +28 -0
- package/templates/redux-ts/tsconfig.json +13 -0
- package/templates/redux-ts/types.d.ts +4 -0
- package/templates/rtk-js/client/index.js +6 -5
- package/templates/rtk-js/package.json +16 -35
- package/templates/rtk-js/src/js/containers/App/index.js +12 -38
- package/templates/rtk-js/src/js/containers/App/reducer.js +1 -9
- package/templates/rtk-js/src/js/routes/utils.js +42 -0
- package/templates/rtk-js/src/js/store/index.js +12 -6
- package/templates/rtk-ts/client/index.js +28 -0
- package/templates/rtk-ts/package.json +37 -0
- package/templates/rtk-ts/src/js/containers/App/index.js +16 -0
- package/{my-app → templates/rtk-ts}/src/js/containers/App/reducer.js +1 -9
- package/templates/rtk-ts/src/js/routes/utils.js +42 -0
- package/templates/rtk-ts/src/js/store/index.js +28 -0
- package/templates/rtk-ts/tsconfig.json +13 -0
- package/templates/rtk-ts/types.d.ts +4 -0
- package/templates/tailwind/postcss.config.js +5 -0
- package/templates/tailwind/src/static/css/base/index.scss +2 -0
- package/my-app/.babelrc +0 -26
- package/my-app/.eslintignore +0 -6
- package/my-app/.eslintrc +0 -53
- package/my-app/.stylelintrc +0 -35
- package/my-app/README.md +0 -23
- package/my-app/api.js +0 -29
- package/my-app/checkVersion.js +0 -3
- package/my-app/client/styles.js +0 -14
- package/my-app/config/config.json +0 -15
- package/my-app/config/config_template.json +0 -18
- package/my-app/config/index.js +0 -44
- package/my-app/package.json +0 -28
- package/my-app/server/document.js +0 -14
- package/my-app/server/index.js +0 -3
- package/my-app/server/server.js +0 -3
- package/my-app/src/js/containers/App/index.js +0 -16
- package/my-app/src/js/containers/DemoPage/DemoPage.js +0 -39
- package/my-app/src/js/containers/DemoPage/DemoPage.scss +0 -3
- package/my-app/src/js/containers/Home/Home.js +0 -25
- package/my-app/src/js/containers/Home/Home.scss +0 -36
- package/my-app/src/js/reducer/index.js +0 -80
- package/my-app/src/js/routes/index.js +0 -43
- package/my-app/src/js/stateManager/stateProvider.js +0 -34
- package/my-app/src/js/store/index.js +0 -22
- package/my-app/src/static/css/base/index.scss +0 -2
- package/my-app/src/static/css/base/styles.scss +0 -3
- package/my-app/src/static/css/base/typography.scss +0 -53
- package/my-app/src/static/css/resources/_variables.scss +0 -0
- package/my-app/src/static/fonts/.gitkeep +0 -0
- package/my-app/src/static/fonts/Inter-Bold-Subset.otf +0 -0
- package/my-app/src/static/fonts/Inter-Italic-Subset.otf +0 -0
- package/my-app/src/static/fonts/Inter-Light-Subset.otf +0 -0
- package/my-app/src/static/fonts/Inter-Medium-Subset.otf +0 -0
- package/my-app/src/static/fonts/Inter-Regular-Subset.otf +0 -0
- package/my-app/src/static/fonts/Inter-SemiBold-Subset.otf +0 -0
- package/my-app/src/static/fonts/Poppins-Bold-Subset.woff2 +0 -0
- package/my-app/src/static/fonts/Poppins-Italic-Subset.woff2 +0 -0
- package/my-app/src/static/fonts/Poppins-Medium-Subset.woff2 +0 -0
- package/my-app/src/static/fonts/Poppins-Regular-Subset.woff2 +0 -0
- package/my-app/src/static/fonts/Poppins-SemiBold-Subset.woff2 +0 -0
- package/scripts/cli.mjs +0 -266
- package/templates/common/.babelrc +0 -26
- package/templates/common/.editorconfig +0 -12
- package/templates/common/.prettierrc.json +0 -7
- package/templates/common/.stylelintrc +0 -35
- package/templates/common/checkVersion.js +0 -3
- package/templates/common/client/index.js +0 -39
- package/templates/common/config/config_template.json +0 -18
- package/templates/common/config/index.js +0 -77
- package/templates/common/package.json +0 -56
- package/templates/common/server/CustomDocument.js +0 -14
- package/templates/common/server/customIndex.js +0 -3
- package/templates/common/server/customServer.js +0 -16
- package/templates/common/src/js/containers/App/actions.js +0 -20
- package/templates/common/src/js/containers/App/index.js +0 -46
- package/templates/common/src/js/containers/App/reducer.js +0 -21
- package/templates/common/src/js/containers/PDP/PDP.js +0 -37
- package/templates/common/src/js/reducer/index.js +0 -80
- package/templates/common/src/js/stateManager/stateProvider.js +0 -34
- package/templates/common/src/js/store/index.js +0 -77
- package/templates/common/src/static/css/base/_overrides.scss +0 -81
- package/templates/common/src/static/css/base/animations.js +0 -38
- package/templates/common/src/static/css/base/layout.scss +0 -242
- package/templates/common/src/static/css/base/typography.scss +0 -285
- package/templates/common/src/static/css/resources/_mixins.scss +0 -196
- package/templates/common/src/static/css/resources/_vendors.scss +0 -1
- package/templates/common/src/static/fonts/.gitkeep +0 -0
- package/templates/common/src/static/fonts/Inter-Bold-Subset.otf +0 -0
- package/templates/common/src/static/fonts/Inter-Italic-Subset.otf +0 -0
- package/templates/common/src/static/fonts/Inter-Light-Subset.otf +0 -0
- package/templates/common/src/static/fonts/Inter-Medium-Subset.otf +0 -0
- package/templates/common/src/static/fonts/Inter-Regular-Subset.otf +0 -0
- package/templates/common/src/static/fonts/Inter-SemiBold-Subset.otf +0 -0
- package/templates/common/src/static/fonts/Poppins-Bold-Subset.woff2 +0 -0
- package/templates/common/src/static/fonts/Poppins-Italic-Subset.woff2 +0 -0
- package/templates/common/src/static/fonts/Poppins-Light-Subset.woff2 +0 -0
- package/templates/common/src/static/fonts/Poppins-Medium-Subset.woff2 +0 -0
- package/templates/common/src/static/fonts/Poppins-Regular-Subset.woff2 +0 -0
- package/templates/common/src/static/fonts/Poppins-SemiBold-Subset.woff2 +0 -0
- package/templates/none-js/.babelrc +0 -26
- package/templates/none-js/.eslintignore +0 -6
- package/templates/none-js/.eslintrc +0 -53
- package/templates/none-js/.prettierrc.json +0 -7
- package/templates/none-js/.stylelintrc +0 -35
- package/templates/none-js/README.md +0 -22
- package/templates/none-js/api.js +0 -29
- package/templates/none-js/checkVersion.js +0 -3
- package/templates/none-js/client/styles.js +0 -15
- package/templates/none-js/config/config.json +0 -15
- package/templates/none-js/config/config_template.json +0 -18
- package/templates/none-js/config/index.js +0 -44
- package/templates/none-js/server/document.js +0 -14
- package/templates/none-js/server/index.js +0 -3
- package/templates/none-js/server/server.js +0 -16
- package/templates/none-js/src/js/containers/DemoPage/DemoPage.js +0 -39
- package/templates/none-js/src/js/containers/DemoPage/DemoPage.scss +0 -3
- package/templates/none-js/src/js/containers/Home/Home.js +0 -27
- package/templates/none-js/src/js/containers/Home/Home.scss +0 -36
- package/templates/none-js/src/js/routes/index.js +0 -49
- package/templates/none-js/src/js/stateManager/stateProvider.js +0 -19
- package/templates/none-js/src/js/store/index.js +0 -6
- package/templates/none-js/src/static/css/base/index.scss +0 -3
- package/templates/none-js/src/static/css/base/styles.scss +0 -11
- package/templates/none-js/src/static/css/base/typography.scss +0 -53
- package/templates/none-js/src/static/css/resources/_variables.scss +0 -1
- package/templates/none-js/src/static/fonts/.gitkeep +0 -0
- package/templates/none-js/src/static/fonts/Inter-Bold-Subset.otf +0 -0
- package/templates/none-js/src/static/fonts/Inter-Italic-Subset.otf +0 -0
- package/templates/none-js/src/static/fonts/Inter-Light-Subset.otf +0 -0
- package/templates/none-js/src/static/fonts/Inter-Medium-Subset.otf +0 -0
- package/templates/none-js/src/static/fonts/Inter-Regular-Subset.otf +0 -0
- package/templates/none-js/src/static/fonts/Inter-SemiBold-Subset.otf +0 -0
- package/templates/none-js/src/static/fonts/Poppins-Bold-Subset.woff2 +0 -0
- package/templates/none-js/src/static/fonts/Poppins-Italic-Subset.woff2 +0 -0
- package/templates/none-js/src/static/fonts/Poppins-Medium-Subset.woff2 +0 -0
- package/templates/none-js/src/static/fonts/Poppins-Regular-Subset.woff2 +0 -0
- package/templates/none-js/src/static/fonts/Poppins-SemiBold-Subset.woff2 +0 -0
- package/templates/none-js/webpackConfig.js +0 -5
- package/templates/redux-js/.babelrc +0 -26
- package/templates/redux-js/.eslintignore +0 -6
- package/templates/redux-js/.eslintrc +0 -53
- package/templates/redux-js/.prettierrc.json +0 -7
- package/templates/redux-js/.stylelintrc +0 -35
- package/templates/redux-js/README.md +0 -22
- package/templates/redux-js/api.js +0 -29
- package/templates/redux-js/checkVersion.js +0 -3
- package/templates/redux-js/client/styles.js +0 -15
- package/templates/redux-js/config/config.json +0 -15
- package/templates/redux-js/config/config_template.json +0 -18
- package/templates/redux-js/config/index.js +0 -44
- package/templates/redux-js/server/index.js +0 -3
- package/templates/redux-js/server/server.js +0 -16
- package/templates/redux-js/src/js/containers/DemoPage/DemoPage.js +0 -39
- package/templates/redux-js/src/js/containers/DemoPage/DemoPage.scss +0 -3
- package/templates/redux-js/src/js/containers/Home/Home.js +0 -27
- package/templates/redux-js/src/js/containers/Home/Home.scss +0 -36
- package/templates/redux-js/src/js/reducer/index.js +0 -80
- package/templates/redux-js/src/js/routes/index.js +0 -49
- package/templates/redux-js/src/js/stateManager/stateProvider.js +0 -34
- package/templates/redux-js/src/static/css/base/index.scss +0 -3
- package/templates/redux-js/src/static/css/base/styles.scss +0 -11
- package/templates/redux-js/src/static/css/base/typography.scss +0 -53
- package/templates/redux-js/src/static/css/resources/_variables.scss +0 -1
- package/templates/redux-js/src/static/fonts/.gitkeep +0 -0
- package/templates/redux-js/src/static/fonts/Inter-Bold-Subset.otf +0 -0
- package/templates/redux-js/src/static/fonts/Inter-Italic-Subset.otf +0 -0
- package/templates/redux-js/src/static/fonts/Inter-Light-Subset.otf +0 -0
- package/templates/redux-js/src/static/fonts/Inter-Medium-Subset.otf +0 -0
- package/templates/redux-js/src/static/fonts/Inter-Regular-Subset.otf +0 -0
- package/templates/redux-js/src/static/fonts/Inter-SemiBold-Subset.otf +0 -0
- package/templates/redux-js/src/static/fonts/Poppins-Bold-Subset.woff2 +0 -0
- package/templates/redux-js/src/static/fonts/Poppins-Italic-Subset.woff2 +0 -0
- package/templates/redux-js/src/static/fonts/Poppins-Medium-Subset.woff2 +0 -0
- package/templates/redux-js/src/static/fonts/Poppins-Regular-Subset.woff2 +0 -0
- package/templates/redux-js/src/static/fonts/Poppins-SemiBold-Subset.woff2 +0 -0
- package/templates/redux-js/webpackConfig.js +0 -5
- package/templates/rtk-js/.babelrc +0 -26
- package/templates/rtk-js/.eslintignore +0 -6
- package/templates/rtk-js/.eslintrc +0 -53
- package/templates/rtk-js/.prettierrc.json +0 -7
- package/templates/rtk-js/.stylelintrc +0 -35
- package/templates/rtk-js/README.md +0 -23
- package/templates/rtk-js/api.js +0 -29
- package/templates/rtk-js/checkVersion.js +0 -3
- package/templates/rtk-js/client/styles.js +0 -15
- package/templates/rtk-js/config/config.json +0 -15
- package/templates/rtk-js/config/config_template.json +0 -18
- package/templates/rtk-js/config/index.js +0 -44
- package/templates/rtk-js/server/document.js +0 -14
- package/templates/rtk-js/server/index.js +0 -3
- package/templates/rtk-js/server/server.js +0 -16
- package/templates/rtk-js/src/js/containers/DemoPage/DemoPage.js +0 -39
- package/templates/rtk-js/src/js/containers/DemoPage/DemoPage.scss +0 -3
- package/templates/rtk-js/src/js/containers/Home/Home.js +0 -27
- package/templates/rtk-js/src/js/containers/Home/Home.scss +0 -36
- package/templates/rtk-js/src/js/reducer/index.js +0 -80
- package/templates/rtk-js/src/js/routes/index.js +0 -49
- package/templates/rtk-js/src/js/stateManager/stateProvider.js +0 -34
- package/templates/rtk-js/src/static/css/base/index.scss +0 -3
- package/templates/rtk-js/src/static/css/base/styles.scss +0 -11
- package/templates/rtk-js/src/static/css/base/typography.scss +0 -53
- package/templates/rtk-js/src/static/css/resources/_variables.scss +0 -1
- package/templates/rtk-js/src/static/fonts/.gitkeep +0 -0
- package/templates/rtk-js/src/static/fonts/Inter-Bold-Subset.otf +0 -0
- package/templates/rtk-js/src/static/fonts/Inter-Italic-Subset.otf +0 -0
- package/templates/rtk-js/src/static/fonts/Inter-Light-Subset.otf +0 -0
- package/templates/rtk-js/src/static/fonts/Inter-Medium-Subset.otf +0 -0
- package/templates/rtk-js/src/static/fonts/Inter-Regular-Subset.otf +0 -0
- package/templates/rtk-js/src/static/fonts/Inter-SemiBold-Subset.otf +0 -0
- package/templates/rtk-js/src/static/fonts/Poppins-Bold-Subset.woff2 +0 -0
- package/templates/rtk-js/src/static/fonts/Poppins-Italic-Subset.woff2 +0 -0
- package/templates/rtk-js/src/static/fonts/Poppins-Medium-Subset.woff2 +0 -0
- package/templates/rtk-js/src/static/fonts/Poppins-Regular-Subset.woff2 +0 -0
- package/templates/rtk-js/src/static/fonts/Poppins-SemiBold-Subset.woff2 +0 -0
- package/templates/rtk-js/webpackConfig.js +0 -5
- /package/{my-app/.prettierrc.json → .prettierrc.json} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { RouterDataProvider, MetaTag } from "@tata1mg/router"
|
|
3
|
+
import App from "@containers/App"
|
|
4
|
+
import routes from "./index.js"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Making the routes array compatible with the format accepted by createBrowserRouter
|
|
8
|
+
* API on the client side
|
|
9
|
+
* https://reactrouter.com/en/main/routers/create-browser-router
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const preparedRoutes = ({ store, routerInitialState }) => {
|
|
13
|
+
const getPreparedRoutes = (routes) => {
|
|
14
|
+
return routes.map((route, index) => {
|
|
15
|
+
const Component = route.component
|
|
16
|
+
const routeToRender = {
|
|
17
|
+
...route,
|
|
18
|
+
element: <Component key={index} />,
|
|
19
|
+
}
|
|
20
|
+
if (route.children) {
|
|
21
|
+
routeToRender.children = getPreparedRoutes(route.children)
|
|
22
|
+
}
|
|
23
|
+
return routeToRender
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
element: (
|
|
30
|
+
<RouterDataProvider config={{}} initialState={routerInitialState} fetcherArgs={{ store }}>
|
|
31
|
+
<MetaTag />
|
|
32
|
+
<App />
|
|
33
|
+
</RouterDataProvider>
|
|
34
|
+
),
|
|
35
|
+
children: getPreparedRoutes(routes),
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const getRoutes = () => {
|
|
41
|
+
return routes
|
|
42
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { configureStore as createStore } from "@reduxjs/toolkit"
|
|
2
|
+
import { combineReducers } from "redux"
|
|
3
|
+
import { shellReducer } from "@containers/App/reducer.js"
|
|
4
|
+
import fetchInstance from "@api"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Function that initializes the store with the initialstate and adds middlewares that can be used during action dispatch
|
|
8
|
+
* @param {object} initialState Default state
|
|
9
|
+
* @param {object} request Request object that we recieve on server, this is only recieved when store is initialized on the server.
|
|
10
|
+
* @return {object} The store itself
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const configureStore = (initialState) => {
|
|
14
|
+
const api = fetchInstance
|
|
15
|
+
const store = createStore({
|
|
16
|
+
reducer: combineReducers({ shellReducer }),
|
|
17
|
+
middleware: (getDefaultMiddleware) =>
|
|
18
|
+
getDefaultMiddleware({
|
|
19
|
+
thunk: {
|
|
20
|
+
extraArgument: { api },
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
preloadedState: initialState,
|
|
24
|
+
})
|
|
25
|
+
return store
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default configureStore
|
package/my-app/.babelrc
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
[
|
|
4
|
-
"@babel/preset-env",
|
|
5
|
-
{
|
|
6
|
-
"targets": {
|
|
7
|
-
"node": "current"
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
"@babel/preset-react"
|
|
12
|
-
],
|
|
13
|
-
"plugins": [
|
|
14
|
-
"@babel/plugin-proposal-object-rest-spread",
|
|
15
|
-
"transform-es2015-modules-commonjs",
|
|
16
|
-
"transform-class-properties",
|
|
17
|
-
"dynamic-import-node",
|
|
18
|
-
"@loadable/babel-plugin"
|
|
19
|
-
],
|
|
20
|
-
"env": {
|
|
21
|
-
"test": {
|
|
22
|
-
"presets": ["@babel/preset-react"]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"ignore": ["__TEST__"]
|
|
26
|
-
}
|
package/my-app/.eslintignore
DELETED
package/my-app/.eslintrc
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "@babel/eslint-parser",
|
|
3
|
-
"rules": {
|
|
4
|
-
"prettier/prettier": "error",
|
|
5
|
-
"no-console": "warn",
|
|
6
|
-
"react/prop-types": 1,
|
|
7
|
-
"react/display-name": [0, { "ignoreTranspilerName": true }],
|
|
8
|
-
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
|
|
9
|
-
"no-prototype-builtins": "off",
|
|
10
|
-
"jam3/no-sanitizer-with-danger": 2,
|
|
11
|
-
"react/jsx-no-target-blank": [0, {
|
|
12
|
-
"enforceDynamicLinks": "never"
|
|
13
|
-
}]
|
|
14
|
-
},
|
|
15
|
-
"env": {
|
|
16
|
-
"browser": true,
|
|
17
|
-
"es6": true,
|
|
18
|
-
"jest": true,
|
|
19
|
-
"node": true
|
|
20
|
-
},
|
|
21
|
-
"globals": {
|
|
22
|
-
"expect": true,
|
|
23
|
-
"__non_webpack_require__": true,
|
|
24
|
-
"logger": "readonly",
|
|
25
|
-
"AppCallbacks": "readonly"
|
|
26
|
-
},
|
|
27
|
-
"extends": ["eslint:recommended", "plugin:react/recommended"],
|
|
28
|
-
"parserOptions": {
|
|
29
|
-
"sourceType": "module",
|
|
30
|
-
"ecmaFeatures": {
|
|
31
|
-
"experimentalObjectRestSpread": true,
|
|
32
|
-
"jsx": true
|
|
33
|
-
},
|
|
34
|
-
"babelOptions": {
|
|
35
|
-
"configFile": "./babel.config.js"
|
|
36
|
-
},
|
|
37
|
-
"ecmaVersion": 6
|
|
38
|
-
},
|
|
39
|
-
"plugins": ["babel", "react", "react-hooks", "prettier", "jam3"],
|
|
40
|
-
"settings": {
|
|
41
|
-
"react": {
|
|
42
|
-
"createClass": "createReactClass",
|
|
43
|
-
"pragma": "React",
|
|
44
|
-
"version": "detect"
|
|
45
|
-
},
|
|
46
|
-
"propWrapperFunctions": [
|
|
47
|
-
"forbidExtraProps",
|
|
48
|
-
{ "property": "freeze", "object": "Object" },
|
|
49
|
-
{ "property": "myFavoriteWrapper" }
|
|
50
|
-
],
|
|
51
|
-
"linkComponents": ["Hyperlink", { "name": "Link", "linkAttribute": "to" }]
|
|
52
|
-
}
|
|
53
|
-
}
|
package/my-app/.stylelintrc
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"stylelint-config-standard-scss",
|
|
4
|
-
"stylelint-config-prettier-scss",
|
|
5
|
-
"stylelint-config-css-modules"
|
|
6
|
-
],
|
|
7
|
-
"plugins": ["stylelint-prettier"],
|
|
8
|
-
"rules": {
|
|
9
|
-
"property-no-vendor-prefix":null,
|
|
10
|
-
"scss/function-no-unknown": null,
|
|
11
|
-
"selector-class-pattern": null,
|
|
12
|
-
"prettier/prettier": true,
|
|
13
|
-
"color-no-invalid-hex": true,
|
|
14
|
-
"comment-empty-line-before": ["always", { "ignore": ["stylelint-commands", "after-comment"] }],
|
|
15
|
-
"indentation": 4,
|
|
16
|
-
"number-leading-zero": null,
|
|
17
|
-
"max-empty-lines": 2,
|
|
18
|
-
"declaration-no-important": true,
|
|
19
|
-
"block-no-empty": true,
|
|
20
|
-
"no-empty-source": null,
|
|
21
|
-
"selector-pseudo-class-no-unknown": null,
|
|
22
|
-
"selector-type-no-unknown": null,
|
|
23
|
-
"rule-empty-line-before": ["always", { "except": ["first-nested"], "ignore": ["after-comment"] }],
|
|
24
|
-
"declaration-property-unit-allowed-list": {
|
|
25
|
-
"/.*/": ["em", "rem", "%", "s", "vh", "vw", "px", "deg", "ms", "dpi", "dvh", "fr"]
|
|
26
|
-
},
|
|
27
|
-
"at-rule-no-unknown": null,
|
|
28
|
-
"scss/double-slash-comment-whitespace-inside": null,
|
|
29
|
-
"scss/at-mixin-pattern": null,
|
|
30
|
-
"scss/dollar-variable-pattern": null,
|
|
31
|
-
"selector-id-pattern": null,
|
|
32
|
-
"keyframes-name-pattern": null,
|
|
33
|
-
"selector-pseudo-element-no-unknown": null
|
|
34
|
-
}
|
|
35
|
-
}
|
package/my-app/README.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
## Getting Started
|
|
2
|
-
Commence development by initiating the application in development mode with the following commands:
|
|
3
|
-
|
|
4
|
-
For running the application in development mode, run:
|
|
5
|
-
|
|
6
|
-
```bash
|
|
7
|
-
npm run start
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
For a production build, utilize:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
npm run build
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
To serve the production build, execute:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm run serve
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Documentation
|
|
23
|
-
Explore the complete documentation at [https://catalyst.1mg.com](https://catalyst.1mg.com).
|
package/my-app/api.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const apiInstance = () => {
|
|
2
|
-
const fetchFunction = async (url, options) => {
|
|
3
|
-
let baseURL = process.env.API_URL
|
|
4
|
-
let finalUrl = baseURL + url
|
|
5
|
-
|
|
6
|
-
// Request Interceptor - you can modify request here
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Add query params if exist
|
|
10
|
-
if (Object.keys(options?.params).length > 0) {
|
|
11
|
-
finalUrl = url + "?" + new URLSearchParams(options.params)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return fetch(finalUrl, options)
|
|
15
|
-
.then(async (response) => {
|
|
16
|
-
const parsedResponse = await response.json()
|
|
17
|
-
// Response Interceptor - you can modify response here
|
|
18
|
-
return parsedResponse
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
get: fetchFunction,
|
|
23
|
-
post: fetchFunction,
|
|
24
|
-
delete: fetchFunction,
|
|
25
|
-
patch: fetchFunction,
|
|
26
|
-
put: fetchFunction
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export default { apiInstance }
|
package/my-app/checkVersion.js
DELETED
package/my-app/client/styles.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* Style Loader
|
|
2
|
-
*
|
|
3
|
-
* Anything imported in here will either be added to the vendor CSS chunk, or
|
|
4
|
-
* the main app CSS chunk. Where they will go depends on its location or its
|
|
5
|
-
* extension.
|
|
6
|
-
*
|
|
7
|
-
* Files will be added to the vendor.css chunk if:
|
|
8
|
-
* - they are located inside `node_modules`, or
|
|
9
|
-
* - they are plain .css files.
|
|
10
|
-
* Otherwise, files will be added to the main app.css chunk.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// Include initial base styles.
|
|
14
|
-
import "@css/base/index.scss"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"APPLICATION_PORT": "3005",
|
|
3
|
-
"APPLICATION_BASE_URL": "http://localhost:3005",
|
|
4
|
-
"SERVER_PATH": "http://localhost:3005",
|
|
5
|
-
"OUTPUT_PATH": "build",
|
|
6
|
-
"PUBLIC_OUTPUT_PATH": "build/public",
|
|
7
|
-
"PUBLIC_ASSET_PATH": "http://localhost:3006/assets/",
|
|
8
|
-
"LOCAL_ASSET_PATH": "/assets/",
|
|
9
|
-
"EXTERNAL_BASE_URL": "http://localhost:3005",
|
|
10
|
-
"DEV_SERVER_PORT": 3006,
|
|
11
|
-
"DEV_SERVER_HOSTNAME": "localhost",
|
|
12
|
-
"DEV_SERVER_HOST_URL": "http://localhost:3006",
|
|
13
|
-
"ENV_NAME": "local",
|
|
14
|
-
"BUILD_ENV": ""
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"S3_BUCKET": "",
|
|
3
|
-
"S3_FOLDER": "",
|
|
4
|
-
"CDN_ASSET_PATH": "",
|
|
5
|
-
"APPLICATION_PORT": "",
|
|
6
|
-
"APPLICATION_BASE_URL": "",
|
|
7
|
-
"SERVER_PATH": "",
|
|
8
|
-
"OUTPUT_PATH": "",
|
|
9
|
-
"PUBLIC_OUTPUT_PATH": "",
|
|
10
|
-
"PUBLIC_ASSET_PATH": "",
|
|
11
|
-
"LOCAL_ASSET_PATH": "",
|
|
12
|
-
"EXTERNAL_BASE_URL": "",
|
|
13
|
-
"DEV_SERVER_PORT": 0,
|
|
14
|
-
"DEV_SERVER_HOSTNAME": "",
|
|
15
|
-
"DEV_SERVER_HOST_URL": "",
|
|
16
|
-
"ENV_NAME": "",
|
|
17
|
-
"BUILD_ENV": ""
|
|
18
|
-
}
|
package/my-app/config/index.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
// Enable or disable server-side rendering
|
|
3
|
-
enableSSR: true,
|
|
4
|
-
|
|
5
|
-
// Enable or disable dynamic imports (code splitting)
|
|
6
|
-
enableDynamicImports: true,
|
|
7
|
-
|
|
8
|
-
// Enable or disable speed measure plugin to measure your webpack build speed
|
|
9
|
-
enableSpeedMeasure: false,
|
|
10
|
-
|
|
11
|
-
// The env vars to expose on the client side. If you add them here, they will
|
|
12
|
-
// be available on the client as process.env[VAR_NAME], same as they would be
|
|
13
|
-
// in node.js.
|
|
14
|
-
//
|
|
15
|
-
// **WARNING**: Be careful not to expose any secrets here!
|
|
16
|
-
clientEnv: [
|
|
17
|
-
"NODE_ENV",
|
|
18
|
-
"APPLICATION_BASE_URL",
|
|
19
|
-
"LOCAL_ASSET_PATH",
|
|
20
|
-
"INTERNAL_NODE_API_URL",
|
|
21
|
-
"BUILD_ENV",
|
|
22
|
-
"EXTERNAL_BASE_URL",
|
|
23
|
-
"SERVER_PATH",
|
|
24
|
-
"ENV_NAME",
|
|
25
|
-
"src_path"
|
|
26
|
-
],
|
|
27
|
-
|
|
28
|
-
/* The identifier to use for css-modules.
|
|
29
|
-
*/
|
|
30
|
-
cssModulesIdentifierProd: "[name]__[local]__[hash:base64:5]",
|
|
31
|
-
cssModulesIdentifierDev: "[name]__[local]",
|
|
32
|
-
|
|
33
|
-
// Isomorphic configuration
|
|
34
|
-
isomorphicConfig: {
|
|
35
|
-
debug: true,
|
|
36
|
-
|
|
37
|
-
assets: {
|
|
38
|
-
images: {
|
|
39
|
-
extensions: ["png", "jpg", "jpeg", "gif", "ico", "svg", "json"],
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
}
|
package/my-app/package.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-app",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "wefdver",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"start": "catalyst start",
|
|
7
|
-
"build": "catalyst build",
|
|
8
|
-
"serve": "catalyst serve"
|
|
9
|
-
},
|
|
10
|
-
"_moduleAliases": {
|
|
11
|
-
"@containers": "src/js/containers",
|
|
12
|
-
"@lib": "src/js/lib",
|
|
13
|
-
"$server": "server",
|
|
14
|
-
"@constants": "src/js/constants",
|
|
15
|
-
"@config": "config",
|
|
16
|
-
"@components": "src/js/components",
|
|
17
|
-
"@css": "src/static/css",
|
|
18
|
-
"@routes": "src/js/routes/index.js",
|
|
19
|
-
"@store": "src/js/store/index.js"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@loadable/component": "^5.16.3",
|
|
23
|
-
"@reduxjs/toolkit": "1.9.3",
|
|
24
|
-
"@tata1mg/router": "^0.0.1-alpha.13",
|
|
25
|
-
"catalyst-core": "0.0.1-beta.1",
|
|
26
|
-
"react-redux": "^8.1.3"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { Head, Body } from "catalyst-core"
|
|
3
|
-
|
|
4
|
-
function Document(props) {
|
|
5
|
-
return (
|
|
6
|
-
<html lang={props.lang}>
|
|
7
|
-
<Head {...props}>
|
|
8
|
-
<meta charset="final-order" />
|
|
9
|
-
</Head>
|
|
10
|
-
<Body {...props} />
|
|
11
|
-
</html>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
export default Document
|
package/my-app/server/index.js
DELETED
package/my-app/server/server.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react"
|
|
2
|
-
import { useOutlet } from "@tata1mg/router"
|
|
3
|
-
import { reduxTest } from "./reducer"
|
|
4
|
-
const App = () => {
|
|
5
|
-
const o = useOutlet()
|
|
6
|
-
const [outlet] = useState(o)
|
|
7
|
-
|
|
8
|
-
return <>{outlet}</>
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
App.serverSideFunction = ({store}) => {
|
|
12
|
-
store.dispatch(reduxTest())
|
|
13
|
-
return new Promise((resolve) => resolve())
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default App
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import { useCurrentRouteData, Link } from "@tata1mg/router";
|
|
3
|
-
import css from './DemoPage.scss'
|
|
4
|
-
|
|
5
|
-
const Demo = () => {
|
|
6
|
-
const { data, isFetched, loading } = useCurrentRouteData() || {}
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
console.log("data is =>", data)
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
<div>
|
|
15
|
-
<div className={css.textColor}>Welcome to Demo page</div>
|
|
16
|
-
<Link to={"/"}>link</Link>
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
Demo.serverFetcher = async ({ req }, { store }) => {
|
|
22
|
-
console.log("server fetcher called!!")
|
|
23
|
-
const res = await fetch("https://jsonblob.com/api/1206830251241234432");
|
|
24
|
-
const json = await res.json();
|
|
25
|
-
return json;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
Demo.clientFetcher = async ({ }, { }) => {
|
|
29
|
-
console.log("client fetcher called")
|
|
30
|
-
const res = await fetch("https://jsonblob.com/api/1206830251241234432");
|
|
31
|
-
const json = await res.json();
|
|
32
|
-
return json;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
Demo.MetaTagFunction = (routerData) => {
|
|
36
|
-
return [<title key="PDP">PDP</title>]
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default Demo;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import css from './Home.scss'
|
|
3
|
-
|
|
4
|
-
function Landing() {
|
|
5
|
-
return (
|
|
6
|
-
<div className={css.app}>
|
|
7
|
-
<header className={css.appHeader}>
|
|
8
|
-
<h1 className={css.heading}>Catalyst</h1>
|
|
9
|
-
<p>
|
|
10
|
-
Edit files inside src directory and save to reload.
|
|
11
|
-
</p>
|
|
12
|
-
<a
|
|
13
|
-
className={css.appLink}
|
|
14
|
-
href="https://catalyst.1mg.com"
|
|
15
|
-
target="_blank"
|
|
16
|
-
rel="noopener noreferrer"
|
|
17
|
-
>
|
|
18
|
-
Learn Catalyst
|
|
19
|
-
</a>
|
|
20
|
-
</header>
|
|
21
|
-
</div>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default Landing
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
body {
|
|
2
|
-
margin: 0;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.app {
|
|
6
|
-
text-align: center;
|
|
7
|
-
margin: 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.appLogo {
|
|
11
|
-
height: 40vmin;
|
|
12
|
-
pointer-events: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
16
|
-
.appLogo {
|
|
17
|
-
animation: App-logo-spin infinite 20s linear;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.appHeader {
|
|
22
|
-
background-color: #282c34;
|
|
23
|
-
min-height: 100vh;
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
align-items: center;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
font-size: calc(10px + 2vmin);
|
|
29
|
-
color: white;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.appLink {
|
|
33
|
-
color: #61dafb;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { combineReducers } from "redux"
|
|
2
|
-
// Import your reducers here
|
|
3
|
-
|
|
4
|
-
import shellReducer from "@containers/App/reducer"
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @description A 'Reducer Manager' object, which keeps track of all the registered reducers and exposes a reduce() function. For detailed info :- https://redux.js.org/usage/code-splitting#using-a-reducer-manager
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
function createReducerManager() {
|
|
11
|
-
// FRAMEWORK COMMENT THIS SHOULD BE EXPOSED TO USER
|
|
12
|
-
// Create an object which maps keys to reducers
|
|
13
|
-
const reducers = {
|
|
14
|
-
shellReducer,
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Create the initial combinedReducer
|
|
18
|
-
let reducerObj = combineReducers(reducers)
|
|
19
|
-
|
|
20
|
-
// An array which is used to delete state keys when reducers are removed
|
|
21
|
-
let keysToRemove = []
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
getReducerMap: () => combineReducers(reducers),
|
|
25
|
-
// The root reducer function exposed by this object
|
|
26
|
-
|
|
27
|
-
// This will be passed to the store
|
|
28
|
-
reduce: (state, action) => {
|
|
29
|
-
// If any reducers have been removed, clean up their state first
|
|
30
|
-
if (keysToRemove.length > 0) {
|
|
31
|
-
state = { ...state }
|
|
32
|
-
for (let key of keysToRemove) {
|
|
33
|
-
delete state[key]
|
|
34
|
-
}
|
|
35
|
-
keysToRemove = []
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Delegate to the combined reducer
|
|
39
|
-
return reducerObj(state, action)
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
// Adds a new reducer with the specified key
|
|
43
|
-
add: (reducer) => {
|
|
44
|
-
for (let key in reducer) {
|
|
45
|
-
if (!key) {
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// We will skip a step if the reducer is already present
|
|
50
|
-
if (reducers[key]) {
|
|
51
|
-
continue
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Add the reducer to the reducer mapping
|
|
55
|
-
reducers[key] = reducer[key]
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Generate a new combined reducer
|
|
59
|
-
return combineReducers(reducers)
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
// Removes a reducer with the specified key
|
|
63
|
-
remove: (key) => {
|
|
64
|
-
if (!key || !reducers[key]) {
|
|
65
|
-
return
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Remove it from the reducer mapping
|
|
69
|
-
delete reducers[key]
|
|
70
|
-
|
|
71
|
-
// Add the key to the list of keys to clean up
|
|
72
|
-
keysToRemove.push(key)
|
|
73
|
-
|
|
74
|
-
// Generate a new combined reducer
|
|
75
|
-
return combineReducers(reducers)
|
|
76
|
-
},
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export default createReducerManager
|