create-catalyst-app 0.0.2-canary.0 → 0.0.2-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/templates/common/config/config.json +5 -3
- package/templates/common/server/server.js +7 -2
- package/templates/common/src/js/containers/Home/{Home.js → Home.jsx} +1 -1
- package/templates/common/src/js/routes/{index.js → index.jsx} +1 -1
- package/templates/common/src/static/css/resources/index.scss +1 -0
- package/templates/none-js/client/{index.js → index.jsx} +1 -1
- package/templates/none-js/package.json +5 -5
- package/templates/none-js/src/js/containers/App/{index.js → index.jsx} +1 -1
- package/templates/none-js/src/js/routes/{utils.js → utils.jsx} +9 -9
- package/templates/{rtk-js/client/index.js → redux-js/client/index.jsx} +2 -2
- package/templates/redux-js/package.json +3 -3
- package/templates/redux-js/src/js/containers/App/{index.js → index.jsx} +1 -1
- package/templates/redux-js/src/js/containers/App/reducer.js +1 -1
- package/templates/redux-js/src/js/routes/{utils.js → utils.jsx} +8 -8
- package/templates/redux-js/src/js/store/index.js +2 -1
- package/templates/{redux-js/client/index.js → rtk-js/client/index.jsx} +2 -2
- package/templates/rtk-js/package.json +3 -3
- package/templates/rtk-js/src/js/containers/App/{index.js → index.jsx} +1 -1
- package/templates/rtk-js/src/js/routes/{utils.js → utils.jsx} +8 -8
- package/templates/rtk-js/src/js/store/index.js +2 -1
- /package/templates/common/server/{document.js → document.jsx} +0 -0
- /package/templates/common/src/js/containers/Home/{Home.scss → Home.module.scss} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-catalyst-app",
|
|
3
3
|
"bin": "scripts/cli.cjs",
|
|
4
|
-
"version": "0.0.2-canary.
|
|
4
|
+
"version": "0.0.2-canary.1",
|
|
5
5
|
"description": "cli package to scaffold Catalyst application",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"commander": "^8.2.0",
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
"prettier": "^3.2.5"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT"
|
|
20
|
-
}
|
|
20
|
+
}
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
"WEBPACK_DEV_SERVER_HOSTNAME": "localhost",
|
|
5
5
|
"WEBPACK_DEV_SERVER_PORT": 3006,
|
|
6
6
|
"BUILD_OUTPUT_PATH": "build",
|
|
7
|
-
"PUBLIC_STATIC_ASSET_PATH": "/
|
|
7
|
+
"PUBLIC_STATIC_ASSET_PATH": "/client/",
|
|
8
8
|
"PUBLIC_STATIC_ASSET_URL": "http://localhost:3005",
|
|
9
9
|
"API_URL": "",
|
|
10
10
|
"ANALYZE_BUNDLE": false,
|
|
11
|
-
"CLIENT_ENV_VARIABLES": [
|
|
12
|
-
|
|
11
|
+
"CLIENT_ENV_VARIABLES": [
|
|
12
|
+
"API_URL"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import express from "express"
|
|
2
|
+
import path from "path"
|
|
3
|
+
import { fileURLToPath } from "node:url"
|
|
4
|
+
import { dirname } from "node:path"
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
7
|
+
const __dirname = dirname(__filename)
|
|
3
8
|
|
|
4
9
|
// Server middlewares are added here.
|
|
5
10
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./variables.scss";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import "./styles"
|
|
3
3
|
import { hydrateRoot } from "react-dom/client"
|
|
4
|
-
import { RouterProvider } from "
|
|
4
|
+
import { RouterProvider } from "catalyst-core"
|
|
5
5
|
import clientRouter from "catalyst-core/router/ClientRouter"
|
|
6
6
|
|
|
7
7
|
const { __ROUTER_INITIAL_DATA__: routerInitialData } = window
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-catalyst-app-starter",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"scripts": {
|
|
5
6
|
"start": "catalyst start",
|
|
6
7
|
"build": "catalyst build",
|
|
@@ -17,13 +18,12 @@
|
|
|
17
18
|
"@css": "src/static/css",
|
|
18
19
|
"@routes": "src/js/routes/"
|
|
19
20
|
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@tata1mg/router": "0.0.1-beta.3",
|
|
22
|
-
"catalyst-core": "0.0.2-canary.0"
|
|
23
|
-
},
|
|
24
21
|
"devDependencies": {
|
|
25
22
|
"eslint": "^8.26.0",
|
|
26
23
|
"eslint-plugin-react": "^7.34.1",
|
|
27
24
|
"eslint-plugin-react-hooks": "^4.6.0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"catalyst-core": "^0.0.2-canary.1"
|
|
28
28
|
}
|
|
29
|
-
}
|
|
29
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Suspense } from "react"
|
|
2
|
-
import { RouterDataProvider, MetaTag } from "
|
|
3
|
-
import App from "@containers/App"
|
|
4
|
-
import routes from "./index.
|
|
2
|
+
import { RouterDataProvider, MetaTag } from "catalyst-core"
|
|
3
|
+
import App from "@containers/App/index.jsx"
|
|
4
|
+
import routes from "./index.jsx"
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Making the routes array compatible with the format accepted by createBrowserRouter
|
|
@@ -12,19 +12,19 @@ import routes from "./index.js"
|
|
|
12
12
|
export const preparedRoutes = ({ routerInitialState }) => {
|
|
13
13
|
const getPreparedRoutes = (routes) => {
|
|
14
14
|
return routes.map((route, index) => {
|
|
15
|
-
let element = null
|
|
16
|
-
const Component = route.component
|
|
17
|
-
|
|
15
|
+
let element = null
|
|
16
|
+
const Component = route.component
|
|
17
|
+
|
|
18
18
|
if (typeof Component === "object" && route.fallback) {
|
|
19
19
|
element = (
|
|
20
20
|
<Suspense fallback={route.fallback}>
|
|
21
21
|
<Component key={index} />
|
|
22
22
|
</Suspense>
|
|
23
|
-
)
|
|
23
|
+
)
|
|
24
24
|
} else {
|
|
25
|
-
element = <Component key={index}
|
|
25
|
+
element = <Component key={index} />
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
const routeToRender = {
|
|
29
29
|
...route,
|
|
30
30
|
element: element,
|
|
@@ -2,7 +2,7 @@ import React from "react"
|
|
|
2
2
|
import "./styles"
|
|
3
3
|
import { hydrateRoot } from "react-dom/client"
|
|
4
4
|
import { Provider } from "react-redux"
|
|
5
|
-
import { RouterProvider } from "
|
|
5
|
+
import { RouterProvider } from "catalyst-core"
|
|
6
6
|
import clientRouter from "catalyst-core/router/ClientRouter"
|
|
7
7
|
import configureStore from "@store"
|
|
8
8
|
|
|
@@ -20,4 +20,4 @@ const Application = (
|
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
const container = document.getElementById("app")
|
|
23
|
-
hydrateRoot(container, Application)
|
|
23
|
+
hydrateRoot(container, Application)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-catalyst-app-starter",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"scripts": {
|
|
5
6
|
"start": "catalyst start",
|
|
6
7
|
"build": "catalyst build",
|
|
@@ -19,9 +20,8 @@
|
|
|
19
20
|
"@store": "src/js/store/index.js"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"@tata1mg/router": "0.0.1-beta.3",
|
|
23
|
-
"catalyst-core": "0.0.2-canary.0",
|
|
24
23
|
"@reduxjs/toolkit": "1.9.3",
|
|
24
|
+
"catalyst-core": "^0.0.2-canary.1",
|
|
25
25
|
"react-redux": "^8.1.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"eslint-plugin-react": "^7.34.1",
|
|
30
30
|
"eslint-plugin-react-hooks": "^4.6.0"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Suspense } from "react"
|
|
2
|
-
import { RouterDataProvider, MetaTag } from "
|
|
3
|
-
import App from "@containers/App"
|
|
4
|
-
import routes from "./index.
|
|
2
|
+
import { RouterDataProvider, MetaTag } from "catalyst-core"
|
|
3
|
+
import App from "@containers/App/index.jsx"
|
|
4
|
+
import routes from "./index.jsx"
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Making the routes array compatible with the format accepted by createBrowserRouter
|
|
@@ -12,19 +12,19 @@ import routes from "./index.js"
|
|
|
12
12
|
export const preparedRoutes = ({ store, routerInitialState }) => {
|
|
13
13
|
const getPreparedRoutes = (routes) => {
|
|
14
14
|
return routes.map((route, index) => {
|
|
15
|
-
let element = null
|
|
16
|
-
const Component = route.component
|
|
15
|
+
let element = null
|
|
16
|
+
const Component = route.component
|
|
17
17
|
|
|
18
18
|
if (typeof Component === "object" && route.fallback) {
|
|
19
19
|
element = (
|
|
20
20
|
<Suspense fallback={route.fallback}>
|
|
21
21
|
<Component key={index} />
|
|
22
22
|
</Suspense>
|
|
23
|
-
)
|
|
23
|
+
)
|
|
24
24
|
} else {
|
|
25
|
-
element = <Component key={index}
|
|
25
|
+
element = <Component key={index} />
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
const routeToRender = {
|
|
29
29
|
...route,
|
|
30
30
|
element: element,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as toolkitRaw from "@reduxjs/toolkit"
|
|
2
|
+
const { configureStore: createStore } = toolkitRaw.default ?? toolkitRaw
|
|
2
3
|
import { combineReducers } from "redux"
|
|
3
4
|
import { shellReducer } from "@containers/App/reducer.js"
|
|
4
5
|
import fetchInstance from "@api"
|
|
@@ -2,7 +2,7 @@ import React from "react"
|
|
|
2
2
|
import "./styles"
|
|
3
3
|
import { hydrateRoot } from "react-dom/client"
|
|
4
4
|
import { Provider } from "react-redux"
|
|
5
|
-
import { RouterProvider } from "
|
|
5
|
+
import { RouterProvider } from "catalyst-core"
|
|
6
6
|
import clientRouter from "catalyst-core/router/ClientRouter"
|
|
7
7
|
import configureStore from "@store"
|
|
8
8
|
|
|
@@ -20,4 +20,4 @@ const Application = (
|
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
const container = document.getElementById("app")
|
|
23
|
-
hydrateRoot(container, Application)
|
|
23
|
+
hydrateRoot(container, Application)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-catalyst-app-starter",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"scripts": {
|
|
5
6
|
"start": "catalyst start",
|
|
6
7
|
"build": "catalyst build",
|
|
@@ -19,9 +20,8 @@
|
|
|
19
20
|
"@store": "src/js/store/index.js"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"@tata1mg/router": "0.0.1-beta.3",
|
|
23
|
-
"catalyst-core": "0.0.2-canary.0",
|
|
24
23
|
"@reduxjs/toolkit": "1.9.3",
|
|
24
|
+
"catalyst-core": "^0.0.2-canary.1",
|
|
25
25
|
"react-redux": "^8.1.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"eslint-plugin-react": "^7.34.1",
|
|
30
30
|
"eslint-plugin-react-hooks": "^4.6.0"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Suspense } from "react"
|
|
2
|
-
import { RouterDataProvider, MetaTag } from "
|
|
3
|
-
import App from "@containers/App"
|
|
4
|
-
import routes from "./index.
|
|
2
|
+
import { RouterDataProvider, MetaTag } from "catalyst-core"
|
|
3
|
+
import App from "@containers/App/index.jsx"
|
|
4
|
+
import routes from "./index.jsx"
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Making the routes array compatible with the format accepted by createBrowserRouter
|
|
@@ -12,19 +12,19 @@ import routes from "./index.js"
|
|
|
12
12
|
export const preparedRoutes = ({ store, routerInitialState }) => {
|
|
13
13
|
const getPreparedRoutes = (routes) => {
|
|
14
14
|
return routes.map((route, index) => {
|
|
15
|
-
let element = null
|
|
16
|
-
const Component = route.component
|
|
15
|
+
let element = null
|
|
16
|
+
const Component = route.component
|
|
17
17
|
|
|
18
18
|
if (typeof Component === "object" && route.fallback) {
|
|
19
19
|
element = (
|
|
20
20
|
<Suspense fallback={route.fallback}>
|
|
21
21
|
<Component key={index} />
|
|
22
22
|
</Suspense>
|
|
23
|
-
)
|
|
23
|
+
)
|
|
24
24
|
} else {
|
|
25
|
-
element = <Component key={index}
|
|
25
|
+
element = <Component key={index} />
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
const routeToRender = {
|
|
29
29
|
...route,
|
|
30
30
|
element: element,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as toolkitRaw from "@reduxjs/toolkit"
|
|
2
|
+
const { configureStore: createStore } = toolkitRaw.default ?? toolkitRaw
|
|
2
3
|
import { combineReducers } from "redux"
|
|
3
4
|
import { shellReducer } from "@containers/App/reducer.js"
|
|
4
5
|
import fetchInstance from "@api"
|
|
File without changes
|
|
File without changes
|