create-bot-ts 1.0.6 → 1.0.8

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 +104 -81
  2. package/package.json +4 -2
package/index.js CHANGED
@@ -167,101 +167,124 @@ cp.exec("npm init -y", { cwd: process.cwd() }, () => {
167
167
  color: "blue",
168
168
  });
169
169
  cp.exec(
170
- "yarn add discord.js bufferutil erlpack zlib-sync utf-8-validate",
170
+ "yarn add discord.js bufferutil zlib-sync utf-8-validate",
171
171
  { cwd: process.cwd() },
172
172
  () => {
173
173
  spinner.update({
174
- text: "Adding necessary devDependencies",
175
- color: "yellow",
174
+ text: "Adding utility dependencies",
175
+ color: "blue",
176
176
  });
177
177
  cp.exec(
178
- `yarn add --dev eslint eslint-config-airbnb-base eslint-config-prettier eslint-import-resolver-node eslint-plugin-import eslint-plugin-prettier @typescript-eslint/eslint-plugin @types/node @typescript-eslint/parser husky lint-staged node-notifier prettier ts-node ts-node-dev typescript`,
179
- { cwd: process.cwd() },
178
+ "yarn add consola common-tags table dotenv",
179
+ {
180
+ cwd: process.cwd(),
181
+ },
180
182
  () => {
181
183
  spinner.update({
182
- text: "Setting up husky...",
183
- color: "cyan",
184
- });
185
- cp.execSync("yarn dlx husky-init --yarn2", {
186
- cwd: process.cwd(),
187
- });
188
- spinner.update({
189
- text: "Setting up sdks...",
190
- color: "cyan",
184
+ text: "Adding necessary devDependencies",
185
+ color: "yellow",
191
186
  });
187
+ cp.exec(
188
+ `yarn add --dev eslint eslint-config-airbnb-base eslint-config-prettier eslint-import-resolver-node eslint-plugin-import eslint-plugin-prettier @typescript-eslint/eslint-plugin @types/node @typescript-eslint/parser husky lint-staged node-notifier prettier ts-node ts-node-dev typescript`,
189
+ { cwd: process.cwd() },
190
+ () => {
191
+ spinner.update({
192
+ text: "Setting up husky...",
193
+ color: "cyan",
194
+ });
195
+ cp.execSync("yarn dlx husky-init --yarn2", {
196
+ cwd: process.cwd(),
197
+ });
198
+ spinner.update({
199
+ text: "Setting up sdks...",
200
+ color: "cyan",
201
+ });
192
202
 
193
- cp.execSync("yarn dlx @yarnpkg/sdks vscode", {
194
- cwd: process.cwd(),
195
- });
203
+ cp.execSync(
204
+ "yarn dlx @yarnpkg/sdks vscode",
205
+ {
206
+ cwd: process.cwd(),
207
+ }
208
+ );
196
209
 
197
- spinner.update({
198
- text: "Adding scripts...",
199
- color: "magenta",
200
- });
201
- const package = JSON.parse(
202
- fs.readFileSync(
203
- path.join(process.cwd(), "package.json"),
204
- { encoding: "utf-8" }
205
- )
206
- );
207
- package.scripts = {
208
- test: "yarn eslint",
209
- prod: "ts-node --transpile-only ./src/index.ts",
210
- dev: "ts-node-dev --respawn --transpile-only --notify --rs ./src/index.ts",
211
- prettier: "prettier ./src/**/*.ts",
212
- "prettier:fix":
213
- "prettier --write ./src/**/*.ts",
214
- eslint: "eslint ./src/**/*.ts",
215
- "eslint:fix": "eslint --fix ./src/**/*.ts",
216
- };
217
- package["lint-staged"] = {
218
- "./src/**/*.ts": ["eslint --fix"],
219
- };
210
+ spinner.update({
211
+ text: "Adding scripts...",
212
+ color: "magenta",
213
+ });
214
+ const package = JSON.parse(
215
+ fs.readFileSync(
216
+ path.join(
217
+ process.cwd(),
218
+ "package.json"
219
+ ),
220
+ { encoding: "utf-8" }
221
+ )
222
+ );
223
+ package.scripts = {
224
+ test: "yarn eslint",
225
+ prod: "ts-node --transpile-only ./src/index.ts",
226
+ dev: "ts-node-dev --respawn --transpile-only --notify --rs ./src/index.ts",
227
+ prettier: "prettier ./src/**/*.ts",
228
+ "prettier:fix":
229
+ "prettier --write ./src/**/*.ts",
230
+ eslint: "eslint ./src/**/*.ts",
231
+ "eslint:fix":
232
+ "eslint --fix ./src/**/*.ts",
233
+ };
234
+ package["lint-staged"] = {
235
+ "./src/**/*.ts": ["eslint --fix"],
236
+ };
220
237
 
221
- fs.writeFileSync(
222
- path.join(process.cwd(), "package.json"),
223
- JSON.stringify(package, null, 4)
224
- );
225
-
226
- spinner.update({
227
- text: "Generating README.md...",
228
- color: "magenta",
229
- });
230
-
231
- fs.writeFileSync(
232
- path.join(process.cwd(), "README.md"),
233
- outdent`
234
- # ${package.name}
235
-
236
- Created with created with [create-bot-ts](https://github.com/MahoMuri/create-bot-ts)
237
-
238
- Based from [create-ts-pro](https://github.com/Milo123456789/create-ts-pro)
239
-
240
- Features:
241
- - Yarn PnP
242
- - Husky
243
- - ESlint and prettier
244
- - TypeScript
245
- - Version Plugin
246
- - Upgrade-interactive plugin
238
+ fs.writeFileSync(
239
+ path.join(
240
+ process.cwd(),
241
+ "package.json"
242
+ ),
243
+ JSON.stringify(package, null, 4)
244
+ );
247
245
 
248
- Next Steps, run:
249
- \`\`\`sh
250
- yarn create @eslint/config
251
- \`\`\`
246
+ spinner.update({
247
+ text: "Generating README.md...",
248
+ color: "magenta",
249
+ });
252
250
 
253
- to fully initialize eslint.
254
- `
251
+ fs.writeFileSync(
252
+ path.join(process.cwd(), "README.md"),
253
+ outdent`
254
+ # ${package.name}
255
+
256
+ Created with created with [create-bot-ts](https://github.com/MahoMuri/create-bot-ts)
257
+
258
+ Based from [create-ts-pro](https://github.com/Milo123456789/create-ts-pro)
259
+
260
+ Features:
261
+ - Yarn PnP
262
+ - Husky
263
+ - ESlint and prettier
264
+ - TypeScript
265
+ - Version Plugin
266
+ - Upgrade-interactive plugin
267
+
268
+ Next Steps, run:
269
+ \`\`\`sh
270
+ yarn create @eslint/config
271
+ \`\`\`
272
+
273
+ to fully initialize eslint.
274
+ `
275
+ );
276
+ const diff = process.hrtime(time);
277
+ const seconds =
278
+ (diff[0] * NS_PER_SEC +
279
+ diff[1] * MS_PER_NS) /
280
+ NS_PER_SEC;
281
+ spinner.success({
282
+ text: `Successfully Generated ${
283
+ package.name
284
+ } template in ${seconds.toFixed(3)}s`,
285
+ });
286
+ }
255
287
  );
256
- const diff = process.hrtime(time);
257
- const seconds =
258
- (diff[0] * NS_PER_SEC + diff[1] * MS_PER_NS) /
259
- NS_PER_SEC;
260
- spinner.success({
261
- text: `Successfully Generated ${
262
- package.name
263
- } template in ${seconds.toFixed(3)}s`,
264
- });
265
288
  }
266
289
  );
267
290
  }
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "create-bot-ts",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "\"MahoMuri's personal template for Discord Bots\"",
5
5
  "main": "index.js",
6
6
  "author": "MahoMuri",
7
7
  "license": "MIT",
8
- "bin": "index.js",
8
+ "bin": {
9
+ "create-bot-ts": "index.js"
10
+ },
9
11
  "private": false,
10
12
  "dependencies": {
11
13
  "nanospinner": "^1.0.0",