create-catalyst-app-internal 0.0.1-beta.65 → 0.0.1-beta.66

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 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.65",
4
+ "version": "0.0.1-beta.66",
5
5
  "description": "cli package to scaffold Catalyst application",
6
6
  "dependencies": {
7
7
  "commander": "^8.2.0",
package/scripts/cli.cjs CHANGED
@@ -17,6 +17,7 @@ const program = new Commander.Command()
17
17
  .arguments("[folderName]")
18
18
  .usage(`${green("[folderName]")} [options]`)
19
19
  .action((name) => (projectName = name))
20
+ .addOption(new Option("-y, --yes [yes]", "Use default configuration"))
20
21
  .addOption(
21
22
  new Option(
22
23
  "-s, --state-management [stateManagement]",
@@ -27,6 +28,14 @@ const program = new Commander.Command()
27
28
  )
28
29
  .action(async (folderName = null, cmd) => {
29
30
  try {
31
+ let config = {
32
+ folderName,
33
+ language: null,
34
+ tailWindSupport: null,
35
+ description: null,
36
+ stateManagement: cmd.stateManagement,
37
+ }
38
+
30
39
  if (process.argv.includes("new-route")) {
31
40
  const createRoutePath = path.join(__dirname, "../codemod/new-route/index.js")
32
41
  execSync(`node ${createRoutePath}`, { stdio: "inherit" })
@@ -37,7 +46,19 @@ const program = new Commander.Command()
37
46
 
38
47
  // Use options provided through commander or prompt the user
39
48
  validateOptions(cmd)
40
- const projectName = folderName || (await promptProjectName())
49
+
50
+ if (cmd.yes) {
51
+ console.log("Using default configuration.")
52
+ config = {
53
+ folderName: "my-app",
54
+ language: "js",
55
+ tailWindSupport: false,
56
+ description: "Default catalyst app",
57
+ stateManagement: "none",
58
+ }
59
+ }
60
+
61
+ const projectName = config.folderName || (await promptProjectName())
41
62
  let isNameValid = validate(projectName)
42
63
  if (!isNameValid.validForNewPackages) {
43
64
  isNameValid?.warnings?.forEach?.((item) => console.log(red(item)))
@@ -49,10 +70,10 @@ const program = new Commander.Command()
49
70
  console.log(red(`${projectName} already exists, try again.`))
50
71
  process.exit(1)
51
72
  }
52
- const projectDescription = await promptDescription()
53
- const language = await promptTypescript()
54
- const tailWindSupport = await promptTailwind()
55
- const stateManagement = cmd.stateManagement || (await promptStateManagement())
73
+ const projectDescription = config.description || (await promptDescription())
74
+ const language = config.language || (await promptTypescript())
75
+ const tailWindSupport = config.tailWindSupport !== null || (await promptTailwind())
76
+ const stateManagement = config.stateManagement || (await promptStateManagement())
56
77
 
57
78
  // Define mapping of options to repository suffixes
58
79
  const repositorySuffixes = {
@@ -123,8 +144,8 @@ const program = new Commander.Command()
123
144
 
124
145
  // to test locally, comment the upper execSync and uncomment this one.
125
146
  // execSync(`npm pack --pack-destination=${tempDir} --silent`, {
126
- // cwd: process.cwd(),
127
- // });
147
+ // cwd: process.cwd(),
148
+ // })
128
149
 
129
150
  return tarballFilePath
130
151
  } catch (error) {
@@ -168,7 +189,7 @@ const program = new Commander.Command()
168
189
  console.log("An error occurred", e)
169
190
  }
170
191
 
171
- cyan(`Run cd ${projectName} && npm start to get started.`)
192
+ console.log(cyan(`Run cd ${projectName} && npm start to get started.`))
172
193
  }
173
194
  } catch (error) {
174
195
  console.error(red("An error occurred:"), error.message)
@@ -283,6 +304,10 @@ function validateOptions(cmd) {
283
304
  if (cmd.stateManagement && !["rtk", "redux", "none"].includes(cmd.stateManagement.toLowerCase())) {
284
305
  throw new Error('Invalid state management option. Use "rtk", "redux", or "none".')
285
306
  }
307
+
308
+ if (cmd.yes && typeof cmd.yes !== "boolean") {
309
+ throw new Error('Invalid option for "yes". Use "-y" or "--yes" to accept defaults.')
310
+ }
286
311
  }
287
312
 
288
313
  function deleteDirectory(dirPath) {
@@ -1,5 +1,5 @@
1
1
  import React from "react"
2
- import { Head, Body } from "catalyst-core-internal"
2
+ import { Head, Body } from "catalyst-core"
3
3
 
4
4
  function Document(props) {
5
5
  return (
@@ -3,7 +3,7 @@ import "./styles"
3
3
  import { hydrateRoot } from "react-dom/client"
4
4
  import { loadableReady } from "@loadable/component"
5
5
  import { RouterProvider } from "@tata1mg/router"
6
- import clientRouter from "catalyst-core-internal/router/ClientRouter"
6
+ import clientRouter from "catalyst-core/router/ClientRouter"
7
7
 
8
8
  window.addEventListener("load", () => {
9
9
  loadableReady(() => {
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@loadable/component": "^5.16.3",
22
22
  "@tata1mg/router": "^0.0.1-beta.7",
23
- "catalyst-core-internal": "0.0.1-beta.64"
23
+ "catalyst-core": "0.0.1-beta.14"
24
24
  },
25
25
  "devDependencies": {
26
26
  "eslint": "^8.26.0",
@@ -3,7 +3,7 @@ import "./styles"
3
3
  import { hydrateRoot } from "react-dom/client"
4
4
  import { loadableReady } from "@loadable/component"
5
5
  import { RouterProvider } from "@tata1mg/router"
6
- import clientRouter from "catalyst-core-internal/router/ClientRouter"
6
+ import clientRouter from "catalyst-core/router/ClientRouter"
7
7
 
8
8
  window.addEventListener("load", () => {
9
9
  loadableReady(() => {
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@loadable/component": "^5.16.3",
23
23
  "@tata1mg/router": "^0.0.1-beta.7",
24
- "catalyst-core-internal": "0.0.1-beta.64"
24
+ "catalyst-core": "0.0.1-beta.14"
25
25
  },
26
26
  "devDependencies": {
27
27
  "eslint": "^8.26.0",
@@ -4,7 +4,7 @@ import { hydrateRoot } from "react-dom/client"
4
4
  import { loadableReady } from "@loadable/component"
5
5
  import { Provider } from "react-redux"
6
6
  import { RouterProvider } from "@tata1mg/router"
7
- import clientRouter from "catalyst-core-internal/router/ClientRouter"
7
+ import clientRouter from "catalyst-core/router/ClientRouter"
8
8
  import configureStore from "@store"
9
9
 
10
10
  window.addEventListener("load", () => {
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@loadable/component": "^5.16.3",
23
23
  "@tata1mg/router": "^0.0.1-beta.7",
24
- "catalyst-core-internal": "0.0.1-beta.64",
24
+ "catalyst-core": "0.0.1-beta.14",
25
25
  "@reduxjs/toolkit": "1.9.3",
26
26
  "react-redux": "^8.1.3"
27
27
  },
@@ -4,7 +4,7 @@ import { hydrateRoot } from "react-dom/client"
4
4
  import { loadableReady } from "@loadable/component"
5
5
  import { Provider } from "react-redux"
6
6
  import { RouterProvider } from "@tata1mg/router"
7
- import clientRouter from "catalyst-core-internal/router/ClientRouter"
7
+ import clientRouter from "catalyst-core/router/ClientRouter"
8
8
  import configureStore from "@store"
9
9
 
10
10
  window.addEventListener("load", () => {
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@loadable/component": "^5.16.3",
24
24
  "@tata1mg/router": "^0.0.1-beta.7",
25
- "catalyst-core-internal": "0.0.1-beta.64",
25
+ "catalyst-core": "0.0.1-beta.14",
26
26
  "@reduxjs/toolkit": "1.9.3",
27
27
  "react-redux": "^8.1.3"
28
28
  },
@@ -4,7 +4,7 @@ import { hydrateRoot } from "react-dom/client"
4
4
  import { loadableReady } from "@loadable/component"
5
5
  import { Provider } from "react-redux"
6
6
  import { RouterProvider } from "@tata1mg/router"
7
- import clientRouter from "catalyst-core-internal/router/ClientRouter"
7
+ import clientRouter from "catalyst-core/router/ClientRouter"
8
8
  import configureStore from "@store"
9
9
 
10
10
  window.addEventListener("load", () => {
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@loadable/component": "^5.16.3",
23
23
  "@tata1mg/router": "^0.0.1-beta.7",
24
- "catalyst-core-internal": "0.0.1-beta.64",
24
+ "catalyst-core": "0.0.1-beta.14",
25
25
  "@reduxjs/toolkit": "1.9.3",
26
26
  "react-redux": "^8.1.3"
27
27
  },
@@ -4,7 +4,7 @@ import { hydrateRoot } from "react-dom/client"
4
4
  import { loadableReady } from "@loadable/component"
5
5
  import { Provider } from "react-redux"
6
6
  import { RouterProvider } from "@tata1mg/router"
7
- import clientRouter from "catalyst-core-internal/router/ClientRouter"
7
+ import clientRouter from "catalyst-core/router/ClientRouter"
8
8
  import configureStore from "@store"
9
9
 
10
10
  window.addEventListener("load", () => {
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@loadable/component": "^5.16.3",
24
24
  "@tata1mg/router": "^0.0.1-beta.7",
25
- "catalyst-core-internal": "0.0.1-beta.64",
25
+ "catalyst-core": "0.0.1-beta.14",
26
26
  "@reduxjs/toolkit": "1.9.3",
27
27
  "react-redux": "^8.1.3"
28
28
  },