create-catalyst-app-internal 0.0.1-beta.11 → 0.0.1-beta.13

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 ADDED
@@ -0,0 +1,52 @@
1
+ # Creating a Catalyst App
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:
4
+
5
+ ```bash
6
+ npx create-catalyst-app
7
+ ```
8
+
9
+ Upon execution, you'll be prompted to name your project. Once named, a template will be cloned into the specified directory.
10
+
11
+ ```bash
12
+ ✔ What is your project named? my-app
13
+ ```
14
+
15
+ Next, select your preferred state management tool from the provided options.
16
+
17
+ ```bash
18
+ ? Choose state management: › - Use arrow-keys. Return to submit .
19
+ ❯ Redux
20
+ Redux Toolkit (RTK)
21
+ None
22
+ ```
23
+
24
+ Following your selection, a default template will be cloned into the directory, and all necessary packages will be installed.
25
+
26
+ ## Getting Started
27
+ Commence development by initiating the application in development mode with the following commands:
28
+
29
+ Navigate into the directory
30
+
31
+ ```bash
32
+ cd my-app
33
+ ```
34
+ For running the application in development mode, run:
35
+ ```bash
36
+ npm run start
37
+ ```
38
+
39
+ For a production build, change NODE_ENV to "production" in config/config.json, and then run :
40
+
41
+ ```bash
42
+ npm run build
43
+ ```
44
+
45
+ To serve the production build, execute:
46
+
47
+ ```bash
48
+ npm run serve
49
+ ```
50
+
51
+ ## Documentation
52
+ Explore the complete documentation at [https://catalyst.1mg.com](https://catalyst.1mg.com).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-catalyst-app-internal",
3
3
  "bin": "scripts/cli.cjs",
4
- "version": "0.0.1-beta.11",
4
+ "version": "0.0.1-beta.13",
5
5
  "description": "cli package to scaffold Catalyst application",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  ## Getting Started
2
2
 
3
- Commence development by initiating the application in development mode with 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
 
@@ -8,7 +8,7 @@ For running the application in development mode, run:
8
8
  npm run start
9
9
  ```
10
10
 
11
- For a production build, utilize:
11
+ For a production build, change NODE_ENV to "production" in config/config.json, then run :
12
12
 
13
13
  ```bash
14
14
  npm run build
@@ -1,14 +1,3 @@
1
- /* Style Loader
2
- *
3
- * Anything imported in here will either be added to the vendor CSS chunk, or
4
- * the main app CSS chunk. Where they will go depends on its location or its
5
- * extension.
6
- *
7
- * Files will be added to the vendor.css chunk if:
8
- * - they are located inside `node_modules`, or
9
- * - they are plain .css files.
10
- * Otherwise, files will be added to the main app.css chunk.
11
- */
1
+ // Include initial base styles. Global styles will come here.
12
2
 
13
- // Include initial base styles.
14
3
  import "@css/base/index.scss"
@@ -8,25 +8,7 @@
8
8
  "PUBLIC_STATIC_ASSET_URL": "http://localhost:3005",
9
9
  "NODE_ENV": "development",
10
10
  "API_URL": "",
11
- "ANALYZE_BUNDLE": false,
12
11
  "CLIENT_ENV_VARIABLES": [
13
- "NODE_SERVER_HOSTNAME",
14
- "NODE_SERVER_PORT",
15
- "WEBPACK_DEV_SERVER_HOSTNAME",
16
- "WEBPACK_DEV_SERVER_PORT",
17
- "BUILD_OUTPUT_PATH",
18
- "PUBLIC_STATIC_ASSET_PATH",
19
- "PUBLIC_STATIC_ASSET_URL",
20
- "NODE_ENV",
21
- "BUILD_ENV",
22
- "API_URL",
23
- "ANALYZE_BUNDLE",
24
- "ENABLE_DEBUG_LOGS",
25
- "ENABLE_FILE_LOGGING",
26
- "ENABLE_CONSOLE_LOGGING",
27
- "ANALYZE_BUNDLE",
28
- "ENABLE_DEBUG_LOGS",
29
- "ENABLE_FILE_LOGGING",
30
- "ENABLE_CONSOLE_LOGGING"
12
+ "API_URL"
31
13
  ]
32
14
  }
@@ -1 +1,2 @@
1
+ // This function is executed before server starts.
1
2
  export const preServerInit = () => {}
@@ -1,8 +1,8 @@
1
- const express = require('express');
2
- const path = require('path');
1
+ const express = require("express")
2
+ const path = require("path")
3
3
 
4
- export function addMiddlewares(app) {
5
-
6
- app.use('/favicon.ico', express.static(path.join(__dirname, '../favicon.ico')));
4
+ // Server middlewares are added here.
7
5
 
6
+ export function addMiddlewares(app) {
7
+ app.use("/favicon.ico", express.static(path.join(__dirname, "../public/favicon.ico")))
8
8
  }
@@ -17,6 +17,6 @@
17
17
  "dependencies": {
18
18
  "@loadable/component": "^5.16.3",
19
19
  "@tata1mg/router": "^0.0.1-beta.0",
20
- "catalyst-core-internal": "^0.0.1-beta.4"
20
+ "catalyst-core-internal": "^0.0.1-beta.7"
21
21
  }
22
22
  }
@@ -0,0 +1,28 @@
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
+ export const preparedRoutes = ({ routerInitialState }) => {
7
+ return [
8
+ {
9
+ element: (
10
+ <RouterDataProvider config={{}} initialState={routerInitialState}>
11
+ <MetaTag />
12
+ <App />
13
+ </RouterDataProvider>
14
+ ),
15
+ children: getRoutes()?.map((route, index) => {
16
+ const Component = route.component
17
+ return {
18
+ ...route,
19
+ element: <Component key={index} />,
20
+ }
21
+ }),
22
+ },
23
+ ]
24
+ }
25
+
26
+ export const getRoutes = () => {
27
+ return routes
28
+ }
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@loadable/component": "^5.16.3",
20
20
  "@tata1mg/router": "^0.0.1-beta.0",
21
- "catalyst-core-internal": "^0.0.1-beta.4",
21
+ "catalyst-core-internal": "^0.0.1-beta.7",
22
22
  "@reduxjs/toolkit": "1.9.3",
23
23
  "react-redux": "^8.1.3"
24
24
  }
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@loadable/component": "^5.16.3",
20
20
  "@tata1mg/router": "^0.0.1-beta.0",
21
- "catalyst-core-internal": "^0.0.1-beta.4",
21
+ "catalyst-core-internal": "^0.0.1-beta.7",
22
22
  "@reduxjs/toolkit": "1.9.3",
23
23
  "react-redux": "^8.1.3"
24
24
  }
@@ -0,0 +1,28 @@
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
+ export const preparedRoutes = ({ store, routerInitialState }) => {
7
+ return [
8
+ {
9
+ element: (
10
+ <RouterDataProvider config={{}} initialState={routerInitialState} fetcherArgs={{ store }}>
11
+ <MetaTag />
12
+ <App />
13
+ </RouterDataProvider>
14
+ ),
15
+ children: getRoutes()?.map((route, index) => {
16
+ const Component = route.component
17
+ return {
18
+ ...route,
19
+ element: <Component key={index} />,
20
+ }
21
+ }),
22
+ },
23
+ ]
24
+ }
25
+
26
+ export const getRoutes = () => {
27
+ return routes
28
+ }
Binary file