create-bot-ts 1.0.4 → 1.0.6

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