create-catalyst-app-internal 0.0.1-beta.9 → 0.0.2-canary.2
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 +56 -0
- 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 +7 -8
- package/scripts/cli.cjs +58 -37
- package/templates/common/.eslintignore +1 -0
- package/templates/common/.eslintrc +28 -0
- package/templates/common/README.md +2 -2
- package/templates/common/api.js +12 -23
- package/templates/common/client/styles.js +1 -12
- package/templates/common/config/config.json +2 -23
- package/templates/common/public/favicon.ico +0 -0
- package/templates/common/server/{document.js → document.jsx} +2 -4
- package/templates/common/server/index.js +1 -0
- package/templates/common/server/server.js +13 -1
- package/templates/common/src/js/containers/Home/{Home.js → Home.jsx} +1 -1
- package/templates/common/src/js/routes/index.jsx +11 -0
- package/templates/common/src/static/css/resources/index.scss +1 -0
- package/templates/none-js/client/index.jsx +18 -0
- package/templates/none-js/package.json +11 -5
- package/templates/{redux-js/src/js/containers/App/index.js → none-js/src/js/containers/App/index.jsx} +2 -2
- package/templates/none-js/src/js/routes/utils.jsx +54 -0
- package/templates/redux-js/client/index.jsx +23 -0
- package/templates/redux-js/package.json +11 -5
- package/templates/{none-js/src/js/containers/App/index.js → redux-js/src/js/containers/App/index.jsx} +2 -2
- package/templates/redux-js/src/js/containers/App/reducer.js +1 -2
- package/templates/redux-js/src/js/routes/utils.jsx +54 -0
- package/templates/redux-js/src/js/store/index.js +2 -2
- package/templates/rtk-js/client/index.jsx +24 -0
- package/templates/rtk-js/package.json +11 -5
- package/templates/rtk-js/src/js/containers/App/{index.js → index.jsx} +2 -2
- package/templates/rtk-js/src/js/containers/App/reducer.js +1 -1
- package/templates/rtk-js/src/js/routes/utils.jsx +54 -0
- package/templates/rtk-js/src/js/store/index.js +2 -2
- package/templates/common/.babelrc +0 -26
- package/templates/common/src/js/routes/index.js +0 -17
- package/templates/common/src/js/routes/utils.js +0 -29
- package/templates/none-js/client/index.js +0 -23
- package/templates/redux-js/client/index.js +0 -28
- package/templates/rtk-js/client/index.js +0 -28
- /package/templates/common/src/js/containers/Home/{Home.scss → Home.module.scss} +0 -0
|
@@ -1,23 +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 { RouterProvider } from "@tata1mg/router"
|
|
6
|
-
import clientRouter from "catalyst-core-internal/router/ClientRouter"
|
|
7
|
-
|
|
8
|
-
window.addEventListener("load", () => {
|
|
9
|
-
loadableReady(() => {
|
|
10
|
-
const { __ROUTER_INITIAL_DATA__: routerInitialData, __INITIAL_STATE__ } = window
|
|
11
|
-
|
|
12
|
-
const router = clientRouter({ routerInitialState: routerInitialData })
|
|
13
|
-
|
|
14
|
-
const Application = (
|
|
15
|
-
<React.StrictMode>
|
|
16
|
-
<RouterProvider router={router} />
|
|
17
|
-
</React.StrictMode>
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
const container = document.getElementById("app")
|
|
21
|
-
hydrateRoot(container, Application)
|
|
22
|
-
})
|
|
23
|
-
})
|
|
@@ -1,28 +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 { Provider } from "react-redux"
|
|
6
|
-
import { RouterProvider } from "@tata1mg/router"
|
|
7
|
-
import clientRouter from "catalyst-core-internal/router/ClientRouter"
|
|
8
|
-
import configureStore from "@store"
|
|
9
|
-
|
|
10
|
-
window.addEventListener("load", () => {
|
|
11
|
-
loadableReady(() => {
|
|
12
|
-
const { __ROUTER_INITIAL_DATA__: routerInitialData, __INITIAL_STATE__ } = window
|
|
13
|
-
const store = configureStore(__INITIAL_STATE__ || {})
|
|
14
|
-
|
|
15
|
-
const router = clientRouter({ store, routerInitialState: routerInitialData })
|
|
16
|
-
|
|
17
|
-
const Application = (
|
|
18
|
-
<Provider store={store} serverState={__INITIAL_STATE__}>
|
|
19
|
-
<React.StrictMode>
|
|
20
|
-
<RouterProvider router={router} />
|
|
21
|
-
</React.StrictMode>
|
|
22
|
-
</Provider>
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
const container = document.getElementById("app")
|
|
26
|
-
hydrateRoot(container, Application)
|
|
27
|
-
})
|
|
28
|
-
})
|
|
@@ -1,28 +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 { Provider } from "react-redux"
|
|
6
|
-
import { RouterProvider } from "@tata1mg/router"
|
|
7
|
-
import clientRouter from "catalyst-core-internal/router/ClientRouter"
|
|
8
|
-
import configureStore from "@store"
|
|
9
|
-
|
|
10
|
-
window.addEventListener("load", () => {
|
|
11
|
-
loadableReady(() => {
|
|
12
|
-
const { __ROUTER_INITIAL_DATA__: routerInitialData, __INITIAL_STATE__ } = window
|
|
13
|
-
const store = configureStore(__INITIAL_STATE__ || {})
|
|
14
|
-
|
|
15
|
-
const router = clientRouter({ store, routerInitialState: routerInitialData })
|
|
16
|
-
|
|
17
|
-
const Application = (
|
|
18
|
-
<Provider store={store} serverState={__INITIAL_STATE__}>
|
|
19
|
-
<React.StrictMode>
|
|
20
|
-
<RouterProvider router={router} />
|
|
21
|
-
</React.StrictMode>
|
|
22
|
-
</Provider>
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
const container = document.getElementById("app")
|
|
26
|
-
hydrateRoot(container, Application)
|
|
27
|
-
})
|
|
28
|
-
})
|
|
File without changes
|