create-catalyst-app-internal 0.0.1-beta.17 → 0.0.1-beta.19

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Creating a Catalyst App
2
2
 
3
- Scaffold your Catalyst app swiftly with `create-catalyst-app`. This tool expedites the process by initializing your project with predefined configurations. To kickstart your project, execute the following command:
3
+ Scaffold your Catalyst app swiftly with `create-catalyst-app`. This tool expedites the process by initializing your project with predefined configurations. To kickstart your project, execute the following command:
4
4
 
5
5
  ```bash
6
6
  npx create-catalyst-app@latest
@@ -24,6 +24,7 @@ Next, select your preferred state management tool from the provided options.
24
24
  Following your selection, a default template will be cloned into the directory, and all necessary packages will be installed.
25
25
 
26
26
  ## Getting Started
27
+
27
28
  Commence development by initiating the application in development mode with the following commands:
28
29
 
29
30
  Navigate into the directory
@@ -31,7 +32,9 @@ Navigate into the directory
31
32
  ```bash
32
33
  cd my-app
33
34
  ```
35
+
34
36
  For running the application in development mode, run:
37
+
35
38
  ```bash
36
39
  npm run start
37
40
  ```
@@ -49,4 +52,5 @@ npm run serve
49
52
  ```
50
53
 
51
54
  ## Documentation
55
+
52
56
  Explore the complete documentation at [https://catalyst.1mg.com](https://catalyst.1mg.com).
package/package.json CHANGED
@@ -1,12 +1,8 @@
1
1
  {
2
2
  "name": "create-catalyst-app-internal",
3
3
  "bin": "scripts/cli.cjs",
4
- "version": "0.0.1-beta.17",
4
+ "version": "0.0.1-beta.19",
5
5
  "description": "cli package to scaffold Catalyst application",
6
- "main": "index.js",
7
- "scripts": {
8
- "start": "node index.js"
9
- },
10
6
  "dependencies": {
11
7
  "commander": "^8.2.0",
12
8
  "fs": "^0.0.1-security",
@@ -1,6 +1,6 @@
1
1
  ## Getting Started
2
2
 
3
- Commence development by initiating the the following commands:
3
+ Commence development by initiating the the following commands:
4
4
 
5
5
  For running the application in development mode, run:
6
6
 
@@ -1,27 +1,16 @@
1
- const apiInstance = () => {
2
- const fetchFunction = async (url, options) => {
3
- let baseURL = process.env.API_URL
4
- let finalUrl = baseURL + url
1
+ const fetchFunction = (url, options) => {
2
+ let baseURL = process.env.API_URL
3
+ let finalUrl = baseURL + url
5
4
 
6
- // Request Interceptor - modify request here
5
+ // Request Interceptor - modify request here
7
6
 
8
- // Add query params
9
- if (Object.keys(options?.params).length > 0) {
10
- finalUrl = url + "?" + new URLSearchParams(options.params)
11
- }
12
-
13
- return fetch(finalUrl, options).then(async (response) => {
14
- const parsedResponse = await response.json()
15
- // Response Interceptor - modify response here
16
- return parsedResponse
7
+ return fetch(finalUrl, options)
8
+ .then(response => {
9
+ return response.json().then(parsedResponse => {
10
+ // Response Interceptor - modify response here
11
+ return parsedResponse
12
+ })
17
13
  })
18
- }
19
- return {
20
- get: fetchFunction,
21
- post: fetchFunction,
22
- delete: fetchFunction,
23
- patch: fetchFunction,
24
- put: fetchFunction,
25
- }
26
14
  }
27
- export default apiInstance
15
+
16
+ export default fetchFunction
@@ -8,5 +8,5 @@
8
8
  "PUBLIC_STATIC_ASSET_URL": "http://localhost:3005",
9
9
  "API_URL": "",
10
10
  "ANALYZE_BUNDLE": false,
11
- "CLIENT_ENV_VARIABLES": [ "API_URL" ]
11
+ "CLIENT_ENV_VARIABLES": ["API_URL"]
12
12
  }
@@ -4,8 +4,7 @@ import { Head, Body } from "catalyst-core-internal"
4
4
  function Document(props) {
5
5
  return (
6
6
  <html lang="en">
7
- <Head {...props}>
8
- </Head>
7
+ <Head {...props}></Head>
9
8
  <Body {...props} />
10
9
  </html>
11
10
  )
@@ -19,8 +19,8 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@loadable/component": "^5.16.3",
22
- "@tata1mg/router": "^0.0.2-alpha.2",
23
- "catalyst-core-internal": "^0.0.1-beta.10"
22
+ "@tata1mg/router": "^0.0.2-alpha.7",
23
+ "catalyst-core-internal": "^0.0.1-beta.11"
24
24
  },
25
25
  "devDependencies": {
26
26
  "eslint": "^8.26.0",
@@ -1,7 +1,7 @@
1
- import React from "react";
2
- import { RouterDataProvider, MetaTag } from "@tata1mg/router";
3
- import App from "@containers/App";
4
- import routes from "./index.js";
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
5
 
6
6
  /**
7
7
  * Making the routes array compatible with the format accepted by createBrowserRouter
@@ -10,38 +10,33 @@ import routes from "./index.js";
10
10
  */
11
11
 
12
12
  export const preparedRoutes = ({ routerInitialState }) => {
13
- const getPreparedRoutes = (routes) => {
14
- return routes.map((route, index) => {
15
- const Component = route.component;
16
- const routeToRender = {
17
- ...route,
18
- element: (
19
- <Component key={index} />
20
- ),
21
- };
22
- if (route.children) {
23
- routeToRender.children = getPreparedRoutes(route.children);
24
- }
25
- return routeToRender;
26
- });
27
- };
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
+ }
28
26
 
29
- return [
30
- {
31
- element: (
32
- <RouterDataProvider
33
- config={{}}
34
- initialState={routerInitialState}
35
- >
36
- <MetaTag />
37
- <App />
38
- </RouterDataProvider>
39
- ),
40
- children: getPreparedRoutes(routes),
41
- },
42
- ];
43
- };
27
+ return [
28
+ {
29
+ element: (
30
+ <RouterDataProvider config={{}} initialState={routerInitialState}>
31
+ <MetaTag />
32
+ <App />
33
+ </RouterDataProvider>
34
+ ),
35
+ children: getPreparedRoutes(routes),
36
+ },
37
+ ]
38
+ }
44
39
 
45
40
  export const getRoutes = () => {
46
- return routes;
47
- };
41
+ return routes
42
+ }
@@ -20,8 +20,8 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@loadable/component": "^5.16.3",
23
- "@tata1mg/router": "^0.0.2-alpha.2",
24
- "catalyst-core-internal": "^0.0.1-beta.10",
23
+ "@tata1mg/router": "^0.0.2-alpha.7",
24
+ "catalyst-core-internal": "^0.0.1-beta.11",
25
25
  "@reduxjs/toolkit": "1.9.3",
26
26
  "react-redux": "^8.1.3"
27
27
  },
@@ -17,4 +17,3 @@ export const shellReducer = (state = defaultState, action) => {
17
17
  return state
18
18
  }
19
19
  }
20
-
@@ -1,7 +1,7 @@
1
- import React from "react";
2
- import { RouterDataProvider, MetaTag } from "@tata1mg/router";
3
- import App from "@containers/App";
4
- import routes from "./index.js";
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
5
 
6
6
  /**
7
7
  * Making the routes array compatible with the format accepted by createBrowserRouter
@@ -10,39 +10,33 @@ import routes from "./index.js";
10
10
  */
11
11
 
12
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: (
19
- <Component key={index} />
20
- ),
21
- };
22
- if (route.children) {
23
- routeToRender.children = getPreparedRoutes(route.children);
24
- }
25
- return routeToRender;
26
- });
27
- };
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
+ }
28
26
 
29
- return [
30
- {
31
- element: (
32
- <RouterDataProvider
33
- config={{}}
34
- initialState={routerInitialState}
35
- fetcherArgs={{ store }}
36
- >
37
- <MetaTag />
38
- <App />
39
- </RouterDataProvider>
40
- ),
41
- children: getPreparedRoutes(routes),
42
- },
43
- ];
44
- };
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
+ }
45
39
 
46
40
  export const getRoutes = () => {
47
- return routes;
48
- };
41
+ return routes
42
+ }
@@ -20,8 +20,8 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@loadable/component": "^5.16.3",
23
- "@tata1mg/router": "^0.0.2-alpha.2",
24
- "catalyst-core-internal": "^0.0.1-beta.10",
23
+ "@tata1mg/router": "^0.0.2-alpha.7",
24
+ "catalyst-core-internal": "^0.0.1-beta.11",
25
25
  "@reduxjs/toolkit": "1.9.3",
26
26
  "react-redux": "^8.1.3"
27
27
  },
@@ -1,7 +1,7 @@
1
- import React from "react";
2
- import { RouterDataProvider, MetaTag } from "@tata1mg/router";
3
- import App from "@containers/App";
4
- import routes from "./index.js";
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
5
 
6
6
  /**
7
7
  * Making the routes array compatible with the format accepted by createBrowserRouter
@@ -10,39 +10,33 @@ import routes from "./index.js";
10
10
  */
11
11
 
12
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: (
19
- <Component key={index} />
20
- ),
21
- };
22
- if (route.children) {
23
- routeToRender.children = getPreparedRoutes(route.children);
24
- }
25
- return routeToRender;
26
- });
27
- };
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
+ }
28
26
 
29
- return [
30
- {
31
- element: (
32
- <RouterDataProvider
33
- config={{}}
34
- initialState={routerInitialState}
35
- fetcherArgs={{ store }}
36
- >
37
- <MetaTag />
38
- <App />
39
- </RouterDataProvider>
40
- ),
41
- children: getPreparedRoutes(routes),
42
- },
43
- ];
44
- };
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
+ }
45
39
 
46
40
  export const getRoutes = () => {
47
- return routes;
48
- };
41
+ return routes
42
+ }