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
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { RouterDataProvider, MetaTag } from "@tata1mg/router";
|
|
3
|
-
import Home from "@containers/Home/Home";
|
|
4
|
-
import App from "@containers/App";
|
|
5
|
-
|
|
6
|
-
const routes = [
|
|
7
|
-
{
|
|
8
|
-
path: "/",
|
|
9
|
-
end: true,
|
|
10
|
-
component: Home,
|
|
11
|
-
},
|
|
12
|
-
];
|
|
13
|
-
const getRoutes = () => {
|
|
14
|
-
return routes;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Making the routes array compatible with the format accepted by createBrowserRouter
|
|
19
|
-
* API on the client side
|
|
20
|
-
*/
|
|
21
|
-
export const preparedRoutes = ({store,routerInitialState}) => {
|
|
22
|
-
|
|
23
|
-
return ([
|
|
24
|
-
{
|
|
25
|
-
element: (
|
|
26
|
-
<RouterDataProvider config={{}} initialState={routerInitialState} fetcherArgs={{store}} >
|
|
27
|
-
<MetaTag/>
|
|
28
|
-
<App />
|
|
29
|
-
</RouterDataProvider>
|
|
30
|
-
),
|
|
31
|
-
children: getRoutes()?.map((route, index) => {
|
|
32
|
-
const Component = route.component;
|
|
33
|
-
// const pageType = route.staticPageType ? route.staticPageType : null
|
|
34
|
-
return {
|
|
35
|
-
...route,
|
|
36
|
-
element: <Component key={index} />,
|
|
37
|
-
};
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
])
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default getRoutes;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Provider } from "react-redux";
|
|
3
|
-
import configureStore from "../store";
|
|
4
|
-
|
|
5
|
-
const ClientProvider = ({ children }) => {
|
|
6
|
-
const { __INITIAL_STATE__ } = window;
|
|
7
|
-
|
|
8
|
-
let store = configureStore(__INITIAL_STATE__);
|
|
9
|
-
return (
|
|
10
|
-
<Provider store={store} serverState={__INITIAL_STATE__}>
|
|
11
|
-
{children}
|
|
12
|
-
</Provider>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const ServerProvider = ({ store, children }) => {
|
|
17
|
-
return <Provider store={store}>{children}</Provider>; //on server
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const serverStore = (initialState,req) => {
|
|
22
|
-
// will create a new store on server and this store would be available in server provider
|
|
23
|
-
return configureStore(initialState, req);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const hydrateClient = (serverStore) => {
|
|
27
|
-
const state = serverStore.getState();
|
|
28
|
-
|
|
29
|
-
return <script>{`window.__INITIAL_STATE__ = ${state} `}</script>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// will be calling hydrate client in the template wrapper
|
|
33
|
-
|
|
34
|
-
export { ClientProvider, ServerProvider, hydrateClient, serverStore };
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
const configureStore = (initialState,request) => {
|
|
7
|
-
const api = fetchInstance
|
|
8
|
-
const store = createStore({
|
|
9
|
-
reducer: combineReducers({shellReducer}),
|
|
10
|
-
middleware: (getDefaultMiddleware) =>
|
|
11
|
-
getDefaultMiddleware({
|
|
12
|
-
thunk: {
|
|
13
|
-
extraArgument: { api },
|
|
14
|
-
},
|
|
15
|
-
}),
|
|
16
|
-
preloadedState: initialState,
|
|
17
|
-
})
|
|
18
|
-
return store
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export default configureStore
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: Inter;
|
|
3
|
-
font-style: normal;
|
|
4
|
-
font-weight: 300;
|
|
5
|
-
font-display: block;
|
|
6
|
-
src: local("Inter Light"), local("Inter-Light"), url($font_url + "Inter-Light-Subset.otf");
|
|
7
|
-
unicode-range: U+0020-007F, U+201C, U+201D, U+00A;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@font-face {
|
|
11
|
-
font-family: Inter;
|
|
12
|
-
font-style: normal;
|
|
13
|
-
font-weight: 400;
|
|
14
|
-
font-display: block;
|
|
15
|
-
src: local("Inter Regular"), local("Inter-Regular"), url($font_url + "Inter-Regular-Subset.otf");
|
|
16
|
-
unicode-range: U+0020-007F, U+201C, U+201D, U+00A;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@font-face {
|
|
20
|
-
font-family: Inter;
|
|
21
|
-
font-style: italic;
|
|
22
|
-
font-weight: 400;
|
|
23
|
-
font-display: block;
|
|
24
|
-
src: local("Inter Italic"), local("Inter-Italic"), url($font_url + "Inter-Italic-Subset.otf");
|
|
25
|
-
unicode-range: U+0020-007F, U+201C, U+201D, U+00A;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@font-face {
|
|
29
|
-
font-family: Inter;
|
|
30
|
-
font-style: normal;
|
|
31
|
-
font-weight: 500;
|
|
32
|
-
font-display: block;
|
|
33
|
-
src: local("Inter Medium"), local("Inter-Medium"), url($font_url + "Inter-Medium-Subset.otf");
|
|
34
|
-
unicode-range: U+0020-007F, U+201C, U+201D, U+00A;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@font-face {
|
|
38
|
-
font-family: Inter;
|
|
39
|
-
font-style: normal;
|
|
40
|
-
font-weight: 600;
|
|
41
|
-
font-display: block;
|
|
42
|
-
src: local("Inter SemiBold"), local("Inter-SemiBold"), url($font_url + "Inter-SemiBold-Subset.otf");
|
|
43
|
-
unicode-range: U+0020-007F, U+201C, U+201D, U+00A;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@font-face {
|
|
47
|
-
font-family: Inter;
|
|
48
|
-
font-style: normal;
|
|
49
|
-
font-weight: 700;
|
|
50
|
-
font-display: block;
|
|
51
|
-
src: local("Inter Bold"), local("Inter-Bold"), url($font_url + "Inter-Bold-Subset.otf");
|
|
52
|
-
unicode-range: U+0020-007F, U+201C, U+201D, U+00A;
|
|
53
|
-
}
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/scripts/cli.mjs
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { exec, execSync } from "child_process";
|
|
3
|
-
import Commander, { Option } from "commander";
|
|
4
|
-
import prompts from "prompts";
|
|
5
|
-
import { red, green, cyan, yellow } from "picocolors";
|
|
6
|
-
import ora from "ora";
|
|
7
|
-
import packageJson from "../package.json" assert { type: "json" };
|
|
8
|
-
import tar from "tar";
|
|
9
|
-
import path from "path";
|
|
10
|
-
import fs from "fs";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Hardcoded branch
|
|
15
|
-
let projectName = null;
|
|
16
|
-
const program = new Commander.Command(packageJson.name)
|
|
17
|
-
.version(packageJson.version)
|
|
18
|
-
.description("Copy code from a specific branch of a GitHub repository.")
|
|
19
|
-
.arguments("[folderName]")
|
|
20
|
-
.usage(`${green("[folderName]")} [options]`)
|
|
21
|
-
.action((name) => (projectName = name))
|
|
22
|
-
// .addOption(
|
|
23
|
-
// new Option(
|
|
24
|
-
// "-l, --lang <lang>",
|
|
25
|
-
// "Specify the language (js or ts)",
|
|
26
|
-
// /^(js|ts)$/i
|
|
27
|
-
// )
|
|
28
|
-
// )
|
|
29
|
-
.addOption(
|
|
30
|
-
new Option(
|
|
31
|
-
"-s, --state-management [stateManagement]",
|
|
32
|
-
"Specify state management (rtk, redux, or none)",
|
|
33
|
-
/^(rtk|redux|none)$/i,
|
|
34
|
-
"none"
|
|
35
|
-
)
|
|
36
|
-
)
|
|
37
|
-
.action(async (folderName = null, cmd) => {
|
|
38
|
-
try {
|
|
39
|
-
// Use options provided through commander or prompt the user
|
|
40
|
-
validateOptions(cmd);
|
|
41
|
-
const projectName = folderName || (await promptProjectName());
|
|
42
|
-
const language = "js"
|
|
43
|
-
const stateManagement =
|
|
44
|
-
cmd.stateManagement || (await promptStateManagement());
|
|
45
|
-
|
|
46
|
-
const resolvedProjectPath = path.resolve(projectName.trim());
|
|
47
|
-
const projectPath = path.basename(resolvedProjectPath);
|
|
48
|
-
const root = path.resolve(projectPath);
|
|
49
|
-
console.log("project path is ====>", root);
|
|
50
|
-
|
|
51
|
-
// Define mapping of options to repository suffixes
|
|
52
|
-
const repositorySuffixes = {
|
|
53
|
-
js: "js",
|
|
54
|
-
ts: "ts",
|
|
55
|
-
redux: "redux",
|
|
56
|
-
rtk: "rtk",
|
|
57
|
-
none: "none",
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const packageName = packageJson.name;
|
|
62
|
-
const packageVersion = packageJson.version;
|
|
63
|
-
|
|
64
|
-
const subdirectoryToExtract = `package/templates/${repositorySuffixes[stateManagement]}-${repositorySuffixes[language]}`;
|
|
65
|
-
|
|
66
|
-
const extractionDestination = `/${projectName}/`;
|
|
67
|
-
const spinner = ora(
|
|
68
|
-
`Cloning.....`
|
|
69
|
-
).start();
|
|
70
|
-
(() => {
|
|
71
|
-
try {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const tempDir = createTempDir();
|
|
75
|
-
|
|
76
|
-
console.log(`\nPacking npm package: ${packageName}@${packageVersion}`);
|
|
77
|
-
const packageFilePath = packNpmPackage(
|
|
78
|
-
packageName,
|
|
79
|
-
packageVersion,
|
|
80
|
-
tempDir
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
console.log(cyan(`Extracting`));
|
|
84
|
-
extractSubdirectory(packageFilePath);
|
|
85
|
-
console.log(green(`Extraction Complete`));
|
|
86
|
-
console.log(cyan("generating npmrc"))
|
|
87
|
-
generateNPMRC(projectName)
|
|
88
|
-
console.log(cyan(`Installing Packages`));
|
|
89
|
-
execSync(
|
|
90
|
-
`cd ${projectName} && npm i`
|
|
91
|
-
,{stdio:"inherit"})
|
|
92
|
-
spinner.stop()
|
|
93
|
-
|
|
94
|
-
// Optionally, you can delete the temporary directory
|
|
95
|
-
// fs.rmdirSync(tempDir, { recursive: true });
|
|
96
|
-
deleteDirectory(tempDir)
|
|
97
|
-
} catch (error) {
|
|
98
|
-
spinner.stop()
|
|
99
|
-
console.error(`Error: ${error.message}`);
|
|
100
|
-
process.exit(1);
|
|
101
|
-
}
|
|
102
|
-
})();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
function packNpmPackage (packageName, packageVersion, tempDir) {
|
|
106
|
-
const tarballFileName = `${packageName}-${packageVersion}.tgz`;
|
|
107
|
-
const tarballFilePath = path.join(tempDir, tarballFileName);
|
|
108
|
-
|
|
109
|
-
try {
|
|
110
|
-
execSync(`npm pack ${packageName}@${packageVersion} --silent`, {
|
|
111
|
-
cwd: tempDir,
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
return tarballFilePath;
|
|
115
|
-
} catch (error) {
|
|
116
|
-
console.error(`Error packing npm package: ${error.message}`);
|
|
117
|
-
throw error;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Function to create a temporary directory
|
|
122
|
-
function createTempDir() {
|
|
123
|
-
const tempDir = fs.mkdtempSync(path.join(process.cwd(), "temp-"));
|
|
124
|
-
console.log("temp dir is ===>",tempDir)
|
|
125
|
-
return tempDir;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Function to extract subdirectory from npm package and delete tar file
|
|
129
|
-
function extractSubdirectory(packageFilePath) {
|
|
130
|
-
tar.extract({
|
|
131
|
-
file: packageFilePath,
|
|
132
|
-
sync: true,
|
|
133
|
-
filter: (path, entry) => {
|
|
134
|
-
return path.startsWith(`${subdirectoryToExtract}/`);
|
|
135
|
-
},
|
|
136
|
-
cwd: path.join(process.cwd()),
|
|
137
|
-
onentry: (entry) => {
|
|
138
|
-
// Modify entry path to remove the initial 'package/' prefix
|
|
139
|
-
entry.path = entry.path.replace(
|
|
140
|
-
`${subdirectoryToExtract}/`,
|
|
141
|
-
extractionDestination
|
|
142
|
-
);
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (stateManagement !== "none") {
|
|
149
|
-
console.log(
|
|
150
|
-
cyan(
|
|
151
|
-
`You chose ${language}, ${stateManagement}. You can now start working on your project!`
|
|
152
|
-
)
|
|
153
|
-
);
|
|
154
|
-
} else {
|
|
155
|
-
console.log(
|
|
156
|
-
cyan(
|
|
157
|
-
`You chose ${language} without state management. You can now start working on your project!`
|
|
158
|
-
)
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
} catch (error) {
|
|
166
|
-
|
|
167
|
-
console.error(red("An error occurred:"), error.message);
|
|
168
|
-
process.exit(1);
|
|
169
|
-
}
|
|
170
|
-
})
|
|
171
|
-
.allowUnknownOption();
|
|
172
|
-
|
|
173
|
-
program.parse(process.argv);
|
|
174
|
-
|
|
175
|
-
async function promptLanguage() {
|
|
176
|
-
const response = await prompts({
|
|
177
|
-
type: "select",
|
|
178
|
-
name: "lang",
|
|
179
|
-
message: "Choose the language:",
|
|
180
|
-
choices: [
|
|
181
|
-
{ title: "js", value: "js" },
|
|
182
|
-
{ title: "ts", value: "ts" },
|
|
183
|
-
],
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
return response.lang;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async function promptStateManagement() {
|
|
190
|
-
const response = await prompts({
|
|
191
|
-
type: "select",
|
|
192
|
-
name: "stateManagement",
|
|
193
|
-
message: "Choose state management:",
|
|
194
|
-
choices: [
|
|
195
|
-
{ title: "Redux", value: "redux" },
|
|
196
|
-
{ title: "Redux Toolkit (RTK)", value: "rtk" },
|
|
197
|
-
{ title: "None", value: "none" },
|
|
198
|
-
],
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
return response.stateManagement;
|
|
202
|
-
}
|
|
203
|
-
async function promptProjectName() {
|
|
204
|
-
const res = await prompts({
|
|
205
|
-
type: "text",
|
|
206
|
-
name: "path",
|
|
207
|
-
message: "What is your project named?",
|
|
208
|
-
initial: "my-app",
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
if (typeof res.path === "string") {
|
|
212
|
-
projectName = res.path.trim();
|
|
213
|
-
return res.path;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (!res.path || projectName === "") {
|
|
217
|
-
console.log(
|
|
218
|
-
"\nPlease specify the project directory:\n" +
|
|
219
|
-
` ${cyan(program.name())} ${green("<project-directory>")}\n` +
|
|
220
|
-
"For example:\n" +
|
|
221
|
-
` ${cyan(program.name())} ${green("my-next-app")}\n\n` +
|
|
222
|
-
`Run ${cyan(`${program.name()} --help`)} to see all options.`
|
|
223
|
-
);
|
|
224
|
-
process.exit(1);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function validateOptions(cmd) {
|
|
229
|
-
// Validate language option
|
|
230
|
-
if (cmd.lang && !["js", "ts"].includes(cmd.lang.toLowerCase())) {
|
|
231
|
-
throw new Error('Invalid language option. Use "js" or "ts".');
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Validate state management option
|
|
235
|
-
if (
|
|
236
|
-
cmd.stateManagement &&
|
|
237
|
-
!["rtk", "redux", "none"].includes(cmd.stateManagement.toLowerCase())
|
|
238
|
-
) {
|
|
239
|
-
throw new Error(
|
|
240
|
-
'Invalid state management option. Use "rtk", "redux", or "none".'
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function deleteDirectory(dirPath) {
|
|
246
|
-
if (fs.existsSync(dirPath)) {
|
|
247
|
-
fs.readdirSync(dirPath).forEach((file) => {
|
|
248
|
-
const currentPath = path.join(dirPath, file);
|
|
249
|
-
if (fs.lstatSync(currentPath).isDirectory()) {
|
|
250
|
-
deleteDirectory(currentPath);
|
|
251
|
-
} else {
|
|
252
|
-
fs.unlinkSync(currentPath);
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
fs.rmdirSync(dirPath);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function generateNPMRC (projectName) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
const npmrcContent = "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
|
|
263
|
-
|
|
264
|
-
fs.writeFileSync(process.cwd()+`/${projectName}/.npmrc`,npmrcContent);
|
|
265
|
-
|
|
266
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
// import "./styles"
|
|
3
|
-
import { hydrateRoot } from "react-dom/client"
|
|
4
|
-
import { loadableReady } from "@loadable/component"
|
|
5
|
-
import {createBrowserRouter,RouterProvider } from "@tata1mg/router"
|
|
6
|
-
import {ClientProvider} from "../src/js/stateManager/stateProvider.js"
|
|
7
|
-
import { preparedRoutes } from "../src/js/routes/index.js"
|
|
8
|
-
import configureStore from "../src/js/store/index.js"
|
|
9
|
-
window.addEventListener("load", () => {
|
|
10
|
-
loadableReady(() => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// Hydrate the redux store from server state.
|
|
14
|
-
// visitor id is sent with ga track events but we observed multiple cases where visitor id was not being passed. It could be due to the case that maybe cookie is not accessible in some cases. Hence, setting it here as a fallback in case gtmUtility.js is not able to get it any other way.
|
|
15
|
-
// window.visitorId = store.getState()?.shellReducer?.visitorId
|
|
16
|
-
// const platform = store.getState()?.shellReducer?.webviewPlatform
|
|
17
|
-
// const store = {}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const {__ROUTER_INITIAL_DATA__:routerInitialData,__INITIAL_STATE__ } = window
|
|
21
|
-
// console.log("router initila data is ====>",routerInitialData)
|
|
22
|
-
const store = configureStore(__INITIAL_STATE__||{})
|
|
23
|
-
const router = createBrowserRouter(
|
|
24
|
-
preparedRoutes({ store, routerInitialState:(routerInitialData) })
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
const Application = (
|
|
28
|
-
<ClientProvider>
|
|
29
|
-
<React.StrictMode>
|
|
30
|
-
<RouterProvider router={router}/>
|
|
31
|
-
</React.StrictMode>
|
|
32
|
-
</ClientProvider>
|
|
33
|
-
)
|
|
34
|
-
// localStorage.setItem("isWebview", window.__INITIAL_STATE__?.shellReducer?.isWebview)
|
|
35
|
-
|
|
36
|
-
const container = document.getElementById("app")
|
|
37
|
-
hydrateRoot(container, Application)
|
|
38
|
-
})
|
|
39
|
-
})
|
|
@@ -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
|
-
}
|