create-sb-react 1.0.1 → 1.0.3

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 (2) hide show
  1. package/index.js +13 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -13,7 +13,7 @@ const answers = await inquirer.prompt([
13
13
  message: "Project Name?"
14
14
  },
15
15
  {
16
- type: "list",
16
+ type: "rawlist",
17
17
  name: "language",
18
18
  message: "Choose Language",
19
19
  choices: [
@@ -28,7 +28,7 @@ const answers = await inquirer.prompt([
28
28
  ]
29
29
  },
30
30
  {
31
- type: "list",
31
+ type: "rawlist",
32
32
  name: "style",
33
33
  message: "Choose Styling",
34
34
  choices: [
@@ -70,17 +70,25 @@ execSync(
70
70
  }
71
71
  );
72
72
 
73
- console.log("🔤 Installing cspell...");
73
+ console.log("🔤 Installing cspell and prettier...");
74
74
 
75
75
  execSync(
76
- "npm install --save-dev cspell",
76
+ "npm install --save-dev cspell prettier",
77
77
  {
78
78
  stdio: "inherit"
79
79
  }
80
80
  );
81
81
 
82
+ fs.writeJsonSync(".prettierrc", {
83
+ semi: true,
84
+ singleQuote: false,
85
+ tabWidth: 2,
86
+ trailingComma: "es5"
87
+ }, { spaces: 2 });
88
+
82
89
  const packageJson = fs.readJsonSync("package.json");
83
90
  packageJson.scripts["spell-check"] = "cspell \"src/**/*.{js,jsx,ts,tsx,scss}\"";
91
+ packageJson.scripts["format"] = "prettier --write src/**/*.{js,jsx,ts,tsx,scss,css}";
84
92
  fs.writeJsonSync("package.json", packageJson, { spaces: 2 });
85
93
 
86
94
  fs.writeJsonSync("cspell.json", {
@@ -101,7 +109,7 @@ execSync("git init", { stdio: "inherit" });
101
109
  execSync("npx husky init", { stdio: "inherit" });
102
110
  fs.writeFileSync(
103
111
  ".husky/pre-commit",
104
- "npm run lint\nnpm run spell-check\nnpm run build\n"
112
+ "npm run format\nnpm run lint\nnpm run spell-check\nnpm run build\n"
105
113
  );
106
114
 
107
115
  if (answers.style === "tailwind") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sb-react",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "React Vite CLI",
5
5
  "bin": {
6
6
  "create-sb-react": "./index.js"