create-catalyst-app-internal 0.0.3-canary.30 → 0.0.3-canary.32

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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/scripts/cli.cjs +8 -108
  3. package/templates/common/webpackConfig.js +0 -1
  4. package/templates/none-js/package.json +2 -2
  5. package/templates/redux-js/package.json +2 -2
  6. package/templates/rtk-js/package.json +2 -2
  7. package/templates/mcp-root/mcp/context.md +0 -674
  8. package/templates/mcp-root/mcp/mcp.js +0 -36
  9. package/templates/none-ts/client/index.js +0 -23
  10. package/templates/none-ts/package.json +0 -40
  11. package/templates/none-ts/src/js/containers/App/index.js +0 -16
  12. package/templates/none-ts/src/js/routes/utils.js +0 -42
  13. package/templates/none-ts/tsconfig.json +0 -13
  14. package/templates/none-ts/types.d.ts +0 -4
  15. package/templates/redux-ts/client/index.js +0 -28
  16. package/templates/redux-ts/package.json +0 -43
  17. package/templates/redux-ts/src/js/containers/App/actions.js +0 -17
  18. package/templates/redux-ts/src/js/containers/App/index.js +0 -16
  19. package/templates/redux-ts/src/js/containers/App/reducer.js +0 -19
  20. package/templates/redux-ts/src/js/routes/utils.js +0 -42
  21. package/templates/redux-ts/src/js/store/index.js +0 -28
  22. package/templates/redux-ts/tsconfig.json +0 -13
  23. package/templates/redux-ts/types.d.ts +0 -4
  24. package/templates/rtk-ts/client/index.js +0 -28
  25. package/templates/rtk-ts/package.json +0 -43
  26. package/templates/rtk-ts/src/js/containers/App/index.js +0 -16
  27. package/templates/rtk-ts/src/js/containers/App/reducer.js +0 -18
  28. package/templates/rtk-ts/src/js/routes/utils.js +0 -42
  29. package/templates/rtk-ts/src/js/store/index.js +0 -28
  30. package/templates/rtk-ts/tsconfig.json +0 -13
  31. package/templates/rtk-ts/types.d.ts +0 -4
  32. package/templates/tailwind/postcss.config.js +0 -5
  33. package/templates/tailwind/src/static/css/base/index.scss +0 -2
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.3-canary.30",
4
+ "version": "0.0.3-canary.32",
5
5
  "description": "cli package to scaffold Catalyst application",
6
6
  "dependencies": {
7
7
  "commander": "^8.2.0",
package/scripts/cli.cjs CHANGED
@@ -17,7 +17,6 @@ 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"))
21
20
  .addOption(
22
21
  new Option(
23
22
  "-s, --state-management [stateManagement]",
@@ -28,39 +27,15 @@ const program = new Commander.Command()
28
27
  )
29
28
  .action(async (folderName = null, cmd) => {
30
29
  try {
31
- let config = {
32
- folderName,
33
- language: null,
34
- tailWindSupport: null,
35
- description: null,
36
- stateManagement: cmd.stateManagement,
37
- mcpSupport: null,
38
- }
39
-
40
30
  if (process.argv.includes("new-route")) {
41
31
  const createRoutePath = path.join(__dirname, "../codemod/new-route/index.js")
42
32
  execSync(`node ${createRoutePath}`, { stdio: "inherit" })
43
33
  return
44
34
  }
45
35
 
46
- console.log(cyan(`Using create-catalyst-app version ${bold(packageJson.version)}`))
47
-
48
36
  // Use options provided through commander or prompt the user
49
37
  validateOptions(cmd)
50
-
51
- if (cmd.yes) {
52
- console.log("Using default configuration.")
53
- config = {
54
- folderName: "my-app",
55
- language: "js",
56
- tailWindSupport: false,
57
- description: "Default catalyst app",
58
- stateManagement: "none",
59
- mcpSupport: true,
60
- }
61
- }
62
-
63
- const projectName = config.folderName || (await promptProjectName())
38
+ const projectName = folderName || (await promptProjectName())
64
39
  let isNameValid = validate(projectName)
65
40
  if (!isNameValid.validForNewPackages) {
66
41
  isNameValid?.warnings?.forEach?.((item) => console.log(red(item)))
@@ -72,11 +47,9 @@ const program = new Commander.Command()
72
47
  console.log(red(`${projectName} already exists, try again.`))
73
48
  process.exit(1)
74
49
  }
75
- const projectDescription = config.description || (await promptDescription())
76
- const language = config.language || (await promptTypescript())
77
- const tailWindSupport = config.tailWindSupport !== null || (await promptTailwind())
78
- const stateManagement = config.stateManagement || (await promptStateManagement())
79
- const mcpSupport = config.mcpSupport !== null || (await promptMcp())
50
+ const language = "js"
51
+ const projectDescription = await promptDescription()
52
+ const stateManagement = cmd.stateManagement || (await promptStateManagement())
80
53
 
81
54
  // Define mapping of options to repository suffixes
82
55
  const repositorySuffixes = {
@@ -92,13 +65,7 @@ const program = new Commander.Command()
92
65
 
93
66
  const commonCodeDirectory = "package/templates/common"
94
67
  const selectedTemplateCode = `package/templates/${repositorySuffixes[stateManagement]}-${repositorySuffixes[language]}`
95
- const tailwindCodeDirectory = "package/templates/tailwind"
96
- const mcpCodeDirectory = "package/templates/mcp-root"
97
-
98
68
  const subDirectoriesToExtract = [commonCodeDirectory, selectedTemplateCode]
99
- if (tailWindSupport) subDirectoriesToExtract.push(tailwindCodeDirectory)
100
- if (mcpSupport) subDirectoriesToExtract.push(mcpCodeDirectory)
101
-
102
69
  const extractionDestination = `/${projectName}/`
103
70
  let tempDir
104
71
  ;(() => {
@@ -111,27 +78,10 @@ const program = new Commander.Command()
111
78
  createGitignore(projectName)
112
79
 
113
80
  execSync(
114
- `cd ${projectName} && npm i && npm pkg set name=${projectName} ${projectDescription ? `description="${projectDescription}"` : ""} && git init --quiet`,
81
+ `cd ${projectName} && npm i && npm pkg set name=${projectName} ${projectDescription ? `description="${projectDescription}"` : ""} && git init --quiet && git add . && git commit -m "initial commit from Create Catalyst App"`,
115
82
  { stdio: "inherit" }
116
83
  )
117
84
 
118
- if (tailWindSupport) {
119
- execSync(`cd ${projectName} && npm i tailwindcss@4.1.4 @tailwindcss/postcss@4.1.4`, {
120
- stdio: "inherit",
121
- })
122
- }
123
-
124
- if (mcpSupport) {
125
- execSync(`cd ${projectName} && npm i @modelcontextprotocol/sdk`, { stdio: "inherit" })
126
- }
127
-
128
- execSync(
129
- `cd ${projectName} && git add . && git commit -m "initial commit from Create Catalyst App"`,
130
- {
131
- stdio: "inherit",
132
- }
133
- )
134
-
135
85
  console.log(`\n${green(bold("Success!"))} created ${projectName} at ${projectPath}`)
136
86
  console.log("Inside this directory, you can run the following commands.")
137
87
 
@@ -164,8 +114,8 @@ const program = new Commander.Command()
164
114
 
165
115
  // to test locally, comment the upper execSync and uncomment this one.
166
116
  // execSync(`npm pack --pack-destination=${tempDir} --silent`, {
167
- // cwd: process.cwd(),
168
- // })
117
+ // cwd: process.cwd(),
118
+ // });
169
119
 
170
120
  return tarballFilePath
171
121
  } catch (error) {
@@ -200,19 +150,13 @@ const program = new Commander.Command()
200
150
  if (entry.path.startsWith(selectedTemplateCode)) {
201
151
  entry.path = entry.path.replace(selectedTemplateCode, extractionDestination)
202
152
  }
203
- if (entry.path.startsWith(tailwindCodeDirectory)) {
204
- entry.path = entry.path.replace(tailwindCodeDirectory, extractionDestination)
205
- }
206
- if (entry.path.startsWith(mcpCodeDirectory)) {
207
- entry.path = entry.path.replace(mcpCodeDirectory, extractionDestination)
208
- }
209
153
  },
210
154
  })
211
155
  } catch (e) {
212
156
  console.log("An error occurred", e)
213
157
  }
214
158
 
215
- console.log(cyan(`Run cd ${projectName} && npm start to get started.`))
159
+ cyan(`Run cd ${projectName} && npm start to get started.`)
216
160
  }
217
161
  } catch (error) {
218
162
  console.error(red("An error occurred:"), error.message)
@@ -274,46 +218,6 @@ async function promptDescription() {
274
218
  } else return null
275
219
  }
276
220
 
277
- async function promptTypescript() {
278
- const response = await prompts({
279
- type: "select",
280
- name: "typescript",
281
- message: "Would you like to use TypeScript?",
282
- choices: [
283
- { title: "Yes", value: "ts" },
284
- { title: "No", value: "js" },
285
- ],
286
- })
287
-
288
- return response.typescript
289
- }
290
-
291
- async function promptTailwind() {
292
- const response = await prompts({
293
- type: "select",
294
- name: "tailwind",
295
- message: "Would you like to use Tailwind CSS?",
296
- choices: [
297
- { title: "Yes", value: true },
298
- { title: "No", value: false },
299
- ],
300
- })
301
- return response.tailwind
302
- }
303
-
304
- async function promptMcp() {
305
- const response = await prompts({
306
- type: "select",
307
- name: "mcp",
308
- message: "Would you like to setup an MCP server?",
309
- choices: [
310
- { title: "Yes", value: true },
311
- { title: "No", value: false },
312
- ],
313
- })
314
- return response.mcp
315
- }
316
-
317
221
  function validateOptions(cmd) {
318
222
  // Validate language option
319
223
  if (cmd.lang && !["js", "ts"].includes(cmd.lang.toLowerCase())) {
@@ -324,10 +228,6 @@ function validateOptions(cmd) {
324
228
  if (cmd.stateManagement && !["rtk", "redux", "none"].includes(cmd.stateManagement.toLowerCase())) {
325
229
  throw new Error('Invalid state management option. Use "rtk", "redux", or "none".')
326
230
  }
327
-
328
- if (cmd.yes && typeof cmd.yes !== "boolean") {
329
- throw new Error('Invalid option for "yes". Use "-y" or "--yes" to accept defaults.')
330
- }
331
231
  }
332
232
 
333
233
  function deleteDirectory(dirPath) {
@@ -2,5 +2,4 @@ module.exports = {
2
2
  developmentPlugins: [],
3
3
  ssrPlugins: [],
4
4
  clientPlugins: [],
5
- transpileModules: [],
6
5
  }
@@ -25,8 +25,8 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@loadable/component": "^5.16.3",
28
- "@tata1mg/router": "0.0.1-beta.7",
29
- "catalyst-core-internal": "0.0.3-canary.30"
28
+ "@tata1mg/router": "^0.0.1-beta.6",
29
+ "catalyst-core-internal": "0.0.3-canary.32"
30
30
  },
31
31
  "devDependencies": {
32
32
  "eslint": "^8.26.0",
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@loadable/component": "^5.16.3",
29
- "@tata1mg/router": "0.0.1-beta.7",
30
- "catalyst-core-internal": "0.0.3-canary.30",
29
+ "@tata1mg/router": "^0.0.1-beta.6",
30
+ "catalyst-core-internal": "0.0.3-canary.32",
31
31
  "@reduxjs/toolkit": "1.9.3",
32
32
  "react-redux": "^8.1.3"
33
33
  },
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@loadable/component": "^5.16.3",
29
- "@tata1mg/router": "0.0.1-beta.7",
30
- "catalyst-core-internal": "0.0.3-canary.30",
29
+ "@tata1mg/router": "^0.0.1-beta.6",
30
+ "catalyst-core-internal": "0.0.3-canary.32",
31
31
  "@reduxjs/toolkit": "1.9.3",
32
32
  "react-redux": "^8.1.3"
33
33
  },