create-catalyst-app-internal 0.0.1-beta.61 → 0.0.1-beta.63

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.61",
4
+ "version": "0.0.1-beta.63",
5
5
  "description": "cli package to scaffold Catalyst application",
6
6
  "dependencies": {
7
7
  "commander": "^8.2.0",
package/scripts/cli.cjs CHANGED
@@ -47,8 +47,9 @@ const program = new Commander.Command()
47
47
  console.log(red(`${projectName} already exists, try again.`))
48
48
  process.exit(1)
49
49
  }
50
- const language = await promptTypescript()
51
50
  const projectDescription = await promptDescription()
51
+ const language = await promptTypescript()
52
+ const tailWindSupport = await promptTailwind()
52
53
  const stateManagement = cmd.stateManagement || (await promptStateManagement())
53
54
 
54
55
  // Define mapping of options to repository suffixes
@@ -65,7 +66,11 @@ const program = new Commander.Command()
65
66
 
66
67
  const commonCodeDirectory = "package/templates/common"
67
68
  const selectedTemplateCode = `package/templates/${repositorySuffixes[stateManagement]}-${repositorySuffixes[language]}`
69
+ const tailwindCodeDirectory = "package/templates/tailwind"
70
+
68
71
  const subDirectoriesToExtract = [commonCodeDirectory, selectedTemplateCode]
72
+ if (tailWindSupport) subDirectoriesToExtract.push(tailwindCodeDirectory)
73
+
69
74
  const extractionDestination = `/${projectName}/`
70
75
  let tempDir
71
76
  ;(() => {
@@ -77,6 +82,8 @@ const program = new Commander.Command()
77
82
  extractSubdirectory(packageFilePath)
78
83
  createGitignore(projectName)
79
84
 
85
+ if (tailWindSupport) setupTailwind(projectName)
86
+
80
87
  execSync(
81
88
  `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"`,
82
89
  { stdio: "inherit" }
@@ -150,6 +157,9 @@ const program = new Commander.Command()
150
157
  if (entry.path.startsWith(selectedTemplateCode)) {
151
158
  entry.path = entry.path.replace(selectedTemplateCode, extractionDestination)
152
159
  }
160
+ if (entry.path.startsWith(tailwindCodeDirectory)) {
161
+ entry.path = entry.path.replace(tailwindCodeDirectory, extractionDestination)
162
+ }
153
163
  },
154
164
  })
155
165
  } catch (e) {
@@ -232,6 +242,35 @@ async function promptTypescript() {
232
242
  return response.typescript
233
243
  }
234
244
 
245
+ async function promptTailwind() {
246
+ const response = await prompts({
247
+ type: "select",
248
+ name: "tailwind",
249
+ message: "Would you like to use Tailwind CSS?",
250
+ choices: [
251
+ { title: "Yes", value: true },
252
+ { title: "No", value: false },
253
+ ],
254
+ })
255
+ return response.tailwind
256
+ }
257
+
258
+ async function setupTailwind(projectName) {
259
+ try {
260
+ const packageJsonPath = path.join(process.cwd(), projectName, "package.json")
261
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"))
262
+ packageJson.dependencies = {
263
+ ...(packageJson.dependencies || {}),
264
+ tailwindcss: "^4.1.4",
265
+ "@tailwindcss/postcss": "^4.1.4",
266
+ }
267
+ fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
268
+ } catch (error) {
269
+ console.log("Error while setting up tailwind:", error)
270
+ process.exit(1)
271
+ }
272
+ }
273
+
235
274
  function validateOptions(cmd) {
236
275
  // Validate language option
237
276
  if (cmd.lang && !["js", "ts"].includes(cmd.lang.toLowerCase())) {
@@ -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": "^0.0.1-beta.13"
23
+ "catalyst-core": "0.0.1-beta.13"
24
24
  },
25
25
  "devDependencies": {
26
26
  "eslint": "^8.26.0",
@@ -3,7 +3,7 @@
3
3
  "version": "1.0.0",
4
4
  "scripts": {
5
5
  "start": "catalyst start",
6
- "build": "catalyst build",
6
+ "build": "npm run typecheck && catalyst build",
7
7
  "serve": "catalyst serve",
8
8
  "lint": "eslint .",
9
9
  "devBuild": "catalyst devBuild",
@@ -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": "^0.0.1-beta.13"
24
+ "catalyst-core": "0.0.1-beta.13"
25
25
  },
26
26
  "devDependencies": {
27
27
  "eslint": "^8.26.0",
@@ -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": "^0.0.1-beta.13",
24
+ "catalyst-core": "0.0.1-beta.13",
25
25
  "@reduxjs/toolkit": "1.9.3",
26
26
  "react-redux": "^8.1.3"
27
27
  },
@@ -3,7 +3,7 @@
3
3
  "version": "1.0.0",
4
4
  "scripts": {
5
5
  "start": "catalyst start",
6
- "build": "catalyst build",
6
+ "build": "npm run typecheck && catalyst build",
7
7
  "serve": "catalyst serve",
8
8
  "lint": "eslint .",
9
9
  "devBuild": "catalyst devBuild",
@@ -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": "^0.0.1-beta.13",
25
+ "catalyst-core": "0.0.1-beta.13",
26
26
  "@reduxjs/toolkit": "1.9.3",
27
27
  "react-redux": "^8.1.3"
28
28
  },
@@ -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": "^0.0.1-beta.13",
24
+ "catalyst-core": "0.0.1-beta.13",
25
25
  "@reduxjs/toolkit": "1.9.3",
26
26
  "react-redux": "^8.1.3"
27
27
  },
@@ -3,7 +3,7 @@
3
3
  "version": "1.0.0",
4
4
  "scripts": {
5
5
  "start": "catalyst start",
6
- "build": "catalyst build",
6
+ "build": "npm run typecheck && catalyst build",
7
7
  "serve": "catalyst serve",
8
8
  "lint": "eslint .",
9
9
  "devBuild": "catalyst devBuild",
@@ -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": "^0.0.1-beta.13",
25
+ "catalyst-core": "0.0.1-beta.13",
26
26
  "@reduxjs/toolkit": "1.9.3",
27
27
  "react-redux": "^8.1.3"
28
28
  },
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ plugins: {
3
+ "@tailwindcss/postcss": {},
4
+ },
5
+ }
@@ -0,0 +1,2 @@
1
+ @import "styles";
2
+ @import "tailwindcss";