create-catalyst-app-internal 0.0.1-beta.16 → 0.0.1-beta.18
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 +5 -1
- package/package.json +1 -5
- package/templates/common/README.md +1 -1
- package/templates/common/api.js +1 -1
- package/templates/common/config/config.json +1 -1
- package/templates/common/server/document.js +1 -2
- package/templates/common/src/js/routes/index.js +0 -6
- package/templates/none-js/package.json +2 -4
- package/templates/none-js/src/js/routes/utils.js +37 -36
- package/templates/redux-js/package.json +2 -4
- package/templates/redux-js/src/js/containers/App/reducer.js +0 -1
- package/templates/redux-js/src/js/routes/utils.js +37 -37
- package/templates/rtk-js/package.json +2 -4
- package/templates/rtk-js/src/js/routes/utils.js +37 -37
package/Readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Creating a Catalyst App
|
|
2
2
|
|
|
3
|
-
Scaffold
|
|
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.
|
|
4
|
+
"version": "0.0.1-beta.18",
|
|
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",
|
package/templates/common/api.js
CHANGED
|
@@ -19,14 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@loadable/component": "^5.16.3",
|
|
22
|
-
"@tata1mg/router": "^0.0.2-alpha.
|
|
23
|
-
"catalyst-core-internal": "^0.0.1-beta.
|
|
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",
|
|
27
|
-
"eslint-plugin-babel": "^5.3.1",
|
|
28
27
|
"eslint-plugin-react": "^7.34.1",
|
|
29
|
-
"@babel/eslint-parser": "^7.19.1",
|
|
30
28
|
"eslint-plugin-react-hooks": "^4.6.0"
|
|
31
29
|
}
|
|
32
30
|
}
|
|
@@ -1,41 +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"
|
|
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
|
+
*/
|
|
5
11
|
|
|
6
12
|
export const preparedRoutes = ({ routerInitialState }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
};
|
|
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
|
+
}
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
};
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
element: (
|
|
30
|
+
<RouterDataProvider config={{}} initialState={routerInitialState}>
|
|
31
|
+
<MetaTag />
|
|
32
|
+
<App />
|
|
33
|
+
</RouterDataProvider>
|
|
34
|
+
),
|
|
35
|
+
children: getPreparedRoutes(routes),
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
}
|
|
38
39
|
|
|
39
40
|
export const getRoutes = () => {
|
|
40
|
-
|
|
41
|
-
}
|
|
41
|
+
return routes
|
|
42
|
+
}
|
|
@@ -20,16 +20,14 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@loadable/component": "^5.16.3",
|
|
23
|
-
"@tata1mg/router": "^0.0.2-alpha.
|
|
24
|
-
"catalyst-core-internal": "^0.0.1-beta.
|
|
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
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"eslint": "^8.26.0",
|
|
30
|
-
"eslint-plugin-babel": "^5.3.1",
|
|
31
30
|
"eslint-plugin-react": "^7.34.1",
|
|
32
|
-
"@babel/eslint-parser": "^7.19.1",
|
|
33
31
|
"eslint-plugin-react-hooks": "^4.6.0"
|
|
34
32
|
}
|
|
35
33
|
}
|
|
@@ -1,42 +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"
|
|
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
|
+
*/
|
|
5
11
|
|
|
6
12
|
export const preparedRoutes = ({ store, routerInitialState }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
};
|
|
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
|
+
}
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
children: getPreparedRoutes(routes),
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
};
|
|
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
39
|
|
|
40
40
|
export const getRoutes = () => {
|
|
41
|
-
|
|
42
|
-
}
|
|
41
|
+
return routes
|
|
42
|
+
}
|
|
@@ -20,16 +20,14 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@loadable/component": "^5.16.3",
|
|
23
|
-
"@tata1mg/router": "^0.0.2-alpha.
|
|
24
|
-
"catalyst-core-internal": "^0.0.1-beta.
|
|
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
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"eslint": "^8.26.0",
|
|
30
|
-
"eslint-plugin-babel": "^5.3.1",
|
|
31
30
|
"eslint-plugin-react": "^7.34.1",
|
|
32
|
-
"@babel/eslint-parser": "^7.19.1",
|
|
33
31
|
"eslint-plugin-react-hooks": "^4.6.0"
|
|
34
32
|
}
|
|
35
33
|
}
|
|
@@ -1,42 +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"
|
|
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
|
+
*/
|
|
5
11
|
|
|
6
12
|
export const preparedRoutes = ({ store, routerInitialState }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
};
|
|
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
|
+
}
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
children: getPreparedRoutes(routes),
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
};
|
|
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
39
|
|
|
40
40
|
export const getRoutes = () => {
|
|
41
|
-
|
|
42
|
-
}
|
|
41
|
+
return routes
|
|
42
|
+
}
|