create-discord-app 4.2.0-dev.1765238522-f38395ec4 → 4.2.0-dev.1765281707-2c3bf5c81

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 (44) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/template/Bun/JavaScript/eslint.config.js +21 -0
  4. package/template/Bun/JavaScript/node_modules/.bin/eslint +21 -0
  5. package/template/Bun/JavaScript/node_modules/.bin/prettier +21 -0
  6. package/template/Bun/JavaScript/package.json +5 -5
  7. package/template/Bun/JavaScript/src/index.js +1 -0
  8. package/template/Bun/TypeScript/eslint.config.js +26 -0
  9. package/template/Bun/TypeScript/node_modules/.bin/eslint +21 -0
  10. package/template/Bun/TypeScript/node_modules/.bin/prettier +21 -0
  11. package/template/Bun/TypeScript/node_modules/.bin/tsc +21 -0
  12. package/template/Bun/TypeScript/node_modules/.bin/tsserver +21 -0
  13. package/template/Bun/TypeScript/package.json +5 -5
  14. package/template/Bun/TypeScript/src/index.ts +1 -0
  15. package/template/Bun/TypeScript/tsconfig.json +3 -3
  16. package/template/Deno/.vscode/settings.json +1 -1
  17. package/template/Deno/src/util/loaders.ts +2 -2
  18. package/template/JavaScript/.prettierignore +1 -0
  19. package/template/JavaScript/.vscode/extensions.json +0 -1
  20. package/template/JavaScript/.vscode/settings.json +1 -1
  21. package/template/JavaScript/node_modules/.bin/eslint +21 -0
  22. package/template/JavaScript/node_modules/.bin/prettier +21 -0
  23. package/template/JavaScript/package.json +1 -1
  24. package/template/JavaScript/src/util/loaders.js +2 -2
  25. package/template/TypeScript/.prettierignore +1 -1
  26. package/template/TypeScript/.turbo/turbo-build.log +4 -0
  27. package/template/TypeScript/.vscode/extensions.json +0 -1
  28. package/template/TypeScript/.vscode/settings.json +1 -1
  29. package/template/TypeScript/eslint.config.js +1 -1
  30. package/template/TypeScript/node_modules/.bin/eslint +21 -0
  31. package/template/TypeScript/node_modules/.bin/prettier +21 -0
  32. package/template/TypeScript/node_modules/.bin/tsc +21 -0
  33. package/template/TypeScript/node_modules/.bin/tsserver +21 -0
  34. package/template/TypeScript/package.json +3 -3
  35. package/template/TypeScript/src/commands/index.ts +1 -1
  36. package/template/TypeScript/src/commands/ping.ts +1 -1
  37. package/template/TypeScript/src/commands/utility/user.ts +1 -1
  38. package/template/TypeScript/src/events/index.ts +1 -1
  39. package/template/TypeScript/src/events/interactionCreate.ts +2 -2
  40. package/template/TypeScript/src/events/ready.ts +1 -1
  41. package/template/TypeScript/src/index.ts +1 -1
  42. package/template/TypeScript/src/util/deploy.ts +1 -1
  43. package/template/TypeScript/src/util/loaders.ts +8 -10
  44. package/template/TypeScript/tsconfig.json +6 -3
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- var __defProp=Object.defineProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0});import process3 from"process";import{styleText as styleText3}from"util";import{Option,program}from"commander";import prompts from"prompts";import validateProjectName from"validate-npm-package-name";var package_default_name="create-discord-app",package_default_version="4.2.0-dev.1765238522-f38395ec4";import{cp,glob,mkdir,stat,readdir,readFile,writeFile}from"fs/promises";import path from"path";import process2 from"process";import{URL}from"url";import{styleText as styleText2}from"util";import{execSync}from"child_process";import process from"process";import{styleText}from"util";var NODE_PACKAGE_MANAGERS=["npm","pnpm","yarn"];function resolvePackageManager(){const npmConfigUserAgent=process.env.npm_config_user_agent;return"undefined"!=typeof Deno?"deno":npmConfigUserAgent?npmConfigUserAgent.startsWith("npm")?"npm":npmConfigUserAgent.startsWith("yarn")?"yarn":npmConfigUserAgent.startsWith("pnpm")?"pnpm":npmConfigUserAgent.startsWith("bun")?"bun":(console.error(styleText("yellow",`Detected an unsupported package manager (${npmConfigUserAgent}). Falling back to npm.`)),"npm"):"npm"}function install(packageManager2){let installCommand=`${packageManager2} install`;switch(console.log(`Installing dependencies with ${packageManager2}...`),packageManager2){case"yarn":console.log(),installCommand=[`${packageManager2} set version stable`,`${packageManager2} config set nodeLinker node-modules`,`${packageManager2} config set logFilters --json '[{ "code": "YN0002", "level": "discard" }, { "code": "YN0013", "level": "discard" }, { "code": "YN0032", "level": "discard" }, { "code": "YN0060", "level": "discard" }]'`,`${packageManager2} plugin import interactive-tools`,`${packageManager2} plugin import workspace-tools`,installCommand];break;case"deno":installCommand=`${packageManager2} cache --reload src/index.ts`;break;case"pnpm":case"bun":console.log()}const env={...process.env,ADBLOCK:"1",NODE_ENV:"development",DISABLE_OPENCOLLECTIVE:"1"};if(Array.isArray(installCommand))for(const[index,command]of installCommand.entries()){if(index===installCommand.length-1){execSync(command,{stdio:"inherit",env:env});break}execSync(command,{stdio:"ignore",env:env})}else execSync(installCommand,{stdio:"inherit",env:env})}function isNodePackageManager(packageManager2){return NODE_PACKAGE_MANAGERS.includes(packageManager2)}async function createDiscordBot({directory:directory,installPackages:installPackages2,typescript:typescript2,packageManager:packageManager2}){const root=path.resolve(directory),directoryName=path.basename(root);console.log();(!(await stat(root).catch(async error=>{if("ENOENT"===error.code)return await mkdir(root,{recursive:!0}),stat(root);throw error})).isDirectory()||(await readdir(root)).length>0)&&(console.error(styleText2("red",`The directory ${styleText2("yellow",`"${directoryName}"`)} is either not a directory or is not empty.`)),console.error(styleText2("red","Please specify an empty directory.")),process2.exit(1)),console.log(`Creating ${directoryName} in ${styleText2("green",root)}.`);const deno2="deno"===packageManager2;await cp(new URL("../template/"+(deno2?"Deno":typescript2?"TypeScript":"JavaScript"),import.meta.url),root,{recursive:!0});const bun="bun"===packageManager2;bun&&(await cp(new URL(`../template/Bun/${typescript2?"TypeScript":"JavaScript"}/package.json`,import.meta.url),`${root}/package.json`),typescript2&&(await cp(new URL("../template/Bun/TypeScript/tsconfig.eslint.json",import.meta.url),`${root}/tsconfig.eslint.json`),await cp(new URL("../template/Bun/TypeScript/tsconfig.json",import.meta.url),`${root}/tsconfig.json`))),process2.chdir(root);const newVSCodeSettings=await readFile("./.vscode/settings.json",{encoding:"utf8"}).then(str=>{let newStr=str.replace("[REPLACE_ME]",deno2||bun?"auto":packageManager2);return deno2&&(newStr=newStr.replaceAll('"[REPLACE_BOOL]"',!0)),newStr});await writeFile("./.vscode/settings.json",newVSCodeSettings);const globIterator=glob("./src/**/*.ts");for await(const file of globIterator){const newData=await readFile(file,{encoding:"utf8"}).then(str=>str.replaceAll("[REPLACE_IMPORT_EXT]",typescript2&&!isNodePackageManager(packageManager2)?"ts":"js"));await writeFile(file,newData)}if(!deno2){const newPackageJSON=await readFile("./package.json",{encoding:"utf8"}).then(str=>{let newStr=str.replace("[REPLACE_ME]",directoryName);return newStr=newStr.replaceAll("[REPLACE_IMPORT_EXT]",typescript2&&!isNodePackageManager(packageManager2)?"ts":"js"),newStr});await writeFile("./package.json",newPackageJSON)}if(installPackages2)try{install(packageManager2)}catch(error){console.log();"SIGINT"===error.signal?console.log(styleText2("red","Installation aborted.")):(console.error(styleText2("red","Installation failed.")),process2.exit(1))}console.log(),console.log(styleText2("green","All done! Be sure to read through the discord.js guide for help on your journey.")),console.log(`Link: ${styleText2("cyan","https://discordjs.guide")}`)}__name(resolvePackageManager,"resolvePackageManager"),__name(install,"install"),__name(isNodePackageManager,"isNodePackageManager"),__name(createDiscordBot,"createDiscordBot");var projectDirectory="",handleSigTerm=__name(()=>process3.exit(0),"handleSigTerm");process3.on("SIGINT",handleSigTerm),process3.on("SIGTERM",handleSigTerm);var onPromptState=__name(state=>{state.aborted&&(process3.stdout.write("[?25h"),process3.stdout.write("\n"),process3.exit(1))},"onPromptState");program.name(package_default_name).version(package_default_version).description("Create a basic discord.js bot.").argument("[directory]","What is the name of the directory you want to create this project in?").usage(`${styleText3("green","<directory>")}`).action(directory=>{projectDirectory=directory}).option("--typescript","Whether to use the TypeScript template.").option("--javascript","Whether to use the JavaScript template.").option("--no-install","Whether to not automatically install the packages.").addOption(new Option("--package-manager <packageManager>","The package manager to use.").choices(["npm","pnpm","yarn","bun","deno"]).default(resolvePackageManager())).allowUnknownOption().parse();var{typescript:typescript,javascript:javascript,packageManager:packageManager,install:installPackages}=program.opts();if(projectDirectory||(projectDirectory=(await prompts({onState:onPromptState,type:"text",name:"directory",initial:"my-bot",message:"What is the name of the directory you want to create this project in?",validate:__name(directory=>{const validationResult=validateProjectName(directory);if(!validationResult.validForNewPackages){const errors=[];for(const error of[...validationResult.errors??[],...validationResult.warnings??[]])errors.push(styleText3("red",`- ${error}`));return styleText3("red",`Cannot create a project named ${styleText3("yellow",`"${directory}"`)} due to npm naming restrictions.\n\nErrors:\n${errors.join("\n")}\n\n${styleText3("red","\nSee https://docs.npmjs.com/cli/configuring-npm/package-json for more details.")}}`)}return!0},"validate")})).directory),!("deno"===packageManager)&&void 0===typescript&&void 0===javascript){const{useTypescript:useTypescript}=await prompts({onState:onPromptState,type:"toggle",name:"useTypescript",message:"Do you want to use TypeScript?",initial:!0,active:"Yes",inactive:"No"});typescript=useTypescript}await createDiscordBot({typescript:typescript,directory:projectDirectory,packageManager:packageManager,installPackages:installPackages});
2
+ var __defProp=Object.defineProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0});import process3 from"process";import{styleText as styleText3}from"util";import{Option,program}from"commander";import prompts from"prompts";import validateProjectName from"validate-npm-package-name";var package_default_name="create-discord-app",package_default_version="4.2.0-dev.1765281707-2c3bf5c81";import{cp,mkdir,stat,readdir,readFile,writeFile}from"fs/promises";import path from"path";import process2 from"process";import{URL}from"url";import{styleText as styleText2}from"util";import{execSync}from"child_process";import process from"process";import{styleText}from"util";function resolvePackageManager(){const npmConfigUserAgent=process.env.npm_config_user_agent;return"undefined"!=typeof Deno?"deno":npmConfigUserAgent?npmConfigUserAgent.startsWith("npm")?"npm":npmConfigUserAgent.startsWith("yarn")?"yarn":npmConfigUserAgent.startsWith("pnpm")?"pnpm":npmConfigUserAgent.startsWith("bun")?"bun":(console.error(styleText("yellow",`Detected an unsupported package manager (${npmConfigUserAgent}). Falling back to npm.`)),"npm"):"npm"}function install(packageManager2){let installCommand=`${packageManager2} install`;switch(console.log(`Installing dependencies with ${packageManager2}...`),packageManager2){case"yarn":console.log(),installCommand=[`${packageManager2} set version stable`,`${packageManager2} config set nodeLinker node-modules`,`${packageManager2} config set logFilters --json '[{ "code": "YN0002", "level": "discard" }, { "code": "YN0013", "level": "discard" }, { "code": "YN0032", "level": "discard" }, { "code": "YN0060", "level": "discard" }]'`,`${packageManager2} plugin import interactive-tools`,`${packageManager2} plugin import workspace-tools`,installCommand];break;case"deno":installCommand=`${packageManager2} cache --reload src/index.ts`;break;case"pnpm":case"bun":console.log()}const env={...process.env,ADBLOCK:"1",NODE_ENV:"development",DISABLE_OPENCOLLECTIVE:"1"};if(Array.isArray(installCommand))for(const[index,command]of installCommand.entries()){if(index===installCommand.length-1){execSync(command,{stdio:"inherit",env:env});break}execSync(command,{stdio:"ignore",env:env})}else execSync(installCommand,{stdio:"inherit",env:env})}async function createDiscordBot({directory:directory,installPackages:installPackages2,typescript:typescript2,packageManager:packageManager2}){const root=path.resolve(directory),directoryName=path.basename(root);console.log();(!(await stat(root).catch(async error=>{if("ENOENT"===error.code)return await mkdir(root,{recursive:!0}),stat(root);throw error})).isDirectory()||(await readdir(root)).length>0)&&(console.error(styleText2("red",`The directory ${styleText2("yellow",`"${directoryName}"`)} is either not a directory or is not empty.`)),console.error(styleText2("red","Please specify an empty directory.")),process2.exit(1)),console.log(`Creating ${directoryName} in ${styleText2("green",root)}.`);const deno2="deno"===packageManager2;await cp(new URL("../template/"+(deno2?"Deno":typescript2?"TypeScript":"JavaScript"),import.meta.url),root,{recursive:!0});const bun="bun"===packageManager2;bun&&(await cp(new URL(`../template/Bun/${typescript2?"TypeScript":"JavaScript"}/package.json`,import.meta.url),`${root}/package.json`),typescript2&&(await cp(new URL("../template/Bun/TypeScript/tsconfig.eslint.json",import.meta.url),`${root}/tsconfig.eslint.json`),await cp(new URL("../template/Bun/TypeScript/tsconfig.json",import.meta.url),`${root}/tsconfig.json`))),process2.chdir(root);const newVSCodeSettings=await readFile("./.vscode/settings.json",{encoding:"utf8"});if(await writeFile("./.vscode/settings.json",newVSCodeSettings.replace(/"npm\.packageManager":\s*"[^"]+"/,`"npm.packageManager": "${deno2||bun?"auto":packageManager2}"`)),!deno2){const newPackageJSON=await readFile("./package.json",{encoding:"utf8"});await writeFile("./package.json",newPackageJSON.replace(/"name":\s*"[^"]+"/,`"name": "${directoryName}"`))}if(installPackages2)try{install(packageManager2)}catch(error){console.log();"SIGINT"===error.signal?console.log(styleText2("red","Installation aborted.")):(console.error(styleText2("red","Installation failed.")),process2.exit(1))}console.log(),console.log(styleText2("green","All done! Be sure to read through the discord.js guide for help on your journey.")),console.log(`Link: ${styleText2("cyan","https://discordjs.guide")}`)}__name(resolvePackageManager,"resolvePackageManager"),__name(install,"install"),__name(createDiscordBot,"createDiscordBot");var projectDirectory="",handleSigTerm=__name(()=>process3.exit(0),"handleSigTerm");process3.on("SIGINT",handleSigTerm),process3.on("SIGTERM",handleSigTerm);var onPromptState=__name(state=>{state.aborted&&(process3.stdout.write("[?25h"),process3.stdout.write("\n"),process3.exit(1))},"onPromptState");program.name(package_default_name).version(package_default_version).description("Create a basic discord.js bot.").argument("[directory]","What is the name of the directory you want to create this project in?").usage(`${styleText3("green","<directory>")}`).action(directory=>{projectDirectory=directory}).option("--typescript","Whether to use the TypeScript template.").option("--javascript","Whether to use the JavaScript template.").option("--no-install","Whether to not automatically install the packages.").addOption(new Option("--package-manager <packageManager>","The package manager to use.").choices(["npm","pnpm","yarn","bun","deno"]).default(resolvePackageManager())).allowUnknownOption().parse();var{typescript:typescript,javascript:javascript,packageManager:packageManager,install:installPackages}=program.opts();if(projectDirectory||(projectDirectory=(await prompts({onState:onPromptState,type:"text",name:"directory",initial:"my-bot",message:"What is the name of the directory you want to create this project in?",validate:__name(directory=>{const validationResult=validateProjectName(directory);if(!validationResult.validForNewPackages){const errors=[];for(const error of[...validationResult.errors??[],...validationResult.warnings??[]])errors.push(styleText3("red",`- ${error}`));return styleText3("red",`Cannot create a project named ${styleText3("yellow",`"${directory}"`)} due to npm naming restrictions.\n\nErrors:\n${errors.join("\n")}\n\n${styleText3("red","\nSee https://docs.npmjs.com/cli/configuring-npm/package-json for more details.")}}`)}return!0},"validate")})).directory),!("deno"===packageManager)&&void 0===typescript&&void 0===javascript){const{useTypescript:useTypescript}=await prompts({onState:onPromptState,type:"toggle",name:"useTypescript",message:"Do you want to use TypeScript?",initial:!0,active:"Yes",inactive:"No"});typescript=useTypescript}await createDiscordBot({typescript:typescript,directory:projectDirectory,packageManager:packageManager,installPackages:installPackages});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "create-discord-app",
4
- "version": "4.2.0-dev.1765238522-f38395ec4",
4
+ "version": "4.2.0-dev.1765281707-2c3bf5c81",
5
5
  "description": "A simple way to create a startup Discord bot.",
6
6
  "type": "module",
7
7
  "bin": "./dist/index.js",
@@ -0,0 +1,21 @@
1
+ import common from 'eslint-config-neon/common';
2
+ import node from 'eslint-config-neon/node';
3
+ import prettier from 'eslint-config-neon/prettier';
4
+
5
+ const config = [
6
+ {
7
+ ignores: [],
8
+ },
9
+ ...common,
10
+ ...node,
11
+ ...prettier,
12
+ {
13
+ rules: {
14
+ 'jsdoc/check-tag-names': 0,
15
+ 'jsdoc/no-undefined-types': 0,
16
+ 'jsdoc/valid-types': 0,
17
+ },
18
+ },
19
+ ];
20
+
21
+ export default config;
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../eslint/bin/eslint.js" "$@"
19
+ else
20
+ exec node "$basedir/../eslint/bin/eslint.js" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../prettier/bin/prettier.cjs" "$@"
19
+ else
20
+ exec node "$basedir/../prettier/bin/prettier.cjs" "$@"
21
+ fi
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "name": "[REPLACE_ME]",
3
+ "name": "@discordjs/template-bun-javascript",
4
4
  "version": "0.1.0",
5
5
  "private": true,
6
6
  "type": "module",
7
7
  "scripts": {
8
- "lint": "prettier --check . && eslint --ext .[REPLACE_IMPORT_EXT] --format=pretty src",
9
- "deploy": "bun run src/util/deploy.[REPLACE_IMPORT_EXT]",
10
- "format": "prettier --write . && eslint --ext .[REPLACE_IMPORT_EXT] --fix --format=pretty src",
11
- "start": "bun run src/index.[REPLACE_IMPORT_EXT]"
8
+ "lint": "prettier --check . && eslint --ext .js --format=pretty src",
9
+ "deploy": "bun run src/util/deploy.js",
10
+ "format": "prettier --write . && eslint --ext .js --fix --format=pretty src",
11
+ "start": "bun run src/index.js"
12
12
  },
13
13
  "dependencies": {
14
14
  "@discordjs/core": "^2.4.0",
@@ -0,0 +1 @@
1
+ console.log();
@@ -0,0 +1,26 @@
1
+ import common from 'eslint-config-neon/common';
2
+ import node from 'eslint-config-neon/node';
3
+ import prettier from 'eslint-config-neon/prettier';
4
+ import typescript from 'eslint-config-neon/typescript';
5
+
6
+ const config = [
7
+ {
8
+ ignores: [],
9
+ },
10
+ ...common,
11
+ ...node,
12
+ ...typescript,
13
+ ...prettier,
14
+ {
15
+ languageOptions: {
16
+ parserOptions: {
17
+ project: ['./tsconfig.eslint.json'],
18
+ },
19
+ },
20
+ rules: {
21
+ 'import/extensions': 0,
22
+ },
23
+ },
24
+ ];
25
+
26
+ export default config;
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../eslint/bin/eslint.js" "$@"
19
+ else
20
+ exec node "$basedir/../eslint/bin/eslint.js" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../prettier/bin/prettier.cjs" "$@"
19
+ else
20
+ exec node "$basedir/../prettier/bin/prettier.cjs" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsc" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsserver" "$@"
21
+ fi
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "name": "[REPLACE_ME]",
3
+ "name": "@discordjs/template-bun-typescript",
4
4
  "version": "0.1.0",
5
5
  "private": true,
6
6
  "type": "module",
7
7
  "scripts": {
8
- "lint": "tsc && prettier --check . && eslint --ext .[REPLACE_IMPORT_EXT] --format=pretty src",
9
- "deploy": "bun run src/util/deploy.[REPLACE_IMPORT_EXT]",
10
- "format": "prettier --write . && eslint --ext .[REPLACE_IMPORT_EXT] --fix --format=pretty src",
11
- "start": "bun run src/index.[REPLACE_IMPORT_EXT]"
8
+ "lint": "tsc && prettier --check . && eslint --ext .ts --format=pretty src",
9
+ "deploy": "bun run src/util/deploy.ts",
10
+ "format": "prettier --write . && eslint --ext .ts --fix --format=pretty src",
11
+ "start": "bun run src/index.ts"
12
12
  },
13
13
  "dependencies": {
14
14
  "@discordjs/core": "^2.4.0",
@@ -0,0 +1 @@
1
+ export {};
@@ -2,14 +2,14 @@
2
2
  "$schema": "https://json.schemastore.org/tsconfig.json",
3
3
  "extends": ["@sapphire/ts-config", "@sapphire/ts-config/extra-strict"],
4
4
  "compilerOptions": {
5
+ "allowImportingTsExtensions": true,
5
6
  "declaration": false,
6
7
  "declarationMap": false,
8
+ "incremental": false,
7
9
  "module": "ESNext",
8
10
  "moduleResolution": "Bundler",
9
- "target": "ESNext",
10
- "outDir": "dist",
11
11
  "noEmit": true,
12
- "allowImportingTsExtensions": true,
12
+ "target": "ESNext",
13
13
  "skipLibCheck": true
14
14
  }
15
15
  }
@@ -8,5 +8,5 @@
8
8
  "editor.trimAutoWhitespace": false,
9
9
  "files.insertFinalNewline": true,
10
10
  "files.eol": "\n",
11
- "deno.enable": "[REPLACE_BOOL]"
11
+ "deno.enable": true
12
12
  }
@@ -1,6 +1,6 @@
1
1
  import type { PathLike } from 'node:fs';
2
2
  import { glob, stat } from 'node:fs/promises';
3
- import { resolve } from 'node:path';
3
+ import { basename, resolve } from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import type { Command } from '../commands/index.ts';
6
6
  import { predicate as commandPredicate } from '../commands/index.ts';
@@ -43,7 +43,7 @@ export async function loadStructures<Structure>(
43
43
  // Loop through all the matching files in the directory
44
44
  for await (const file of glob(pattern)) {
45
45
  // If the file is index.ts, skip the file
46
- if (file.endsWith('/index.ts')) {
46
+ if (basename(file) === 'index.ts') {
47
47
  continue;
48
48
  }
49
49
 
@@ -0,0 +1 @@
1
+ pnpm-lock.yaml
@@ -2,7 +2,6 @@
2
2
  "recommendations": [
3
3
  "esbenp.prettier-vscode",
4
4
  "dbaeumer.vscode-eslint",
5
- "tamasfe.even-better-toml",
6
5
  "codezombiech.gitignore",
7
6
  "christian-kohler.npm-intellisense",
8
7
  "christian-kohler.path-intellisense"
@@ -9,5 +9,5 @@
9
9
  "editor.trimAutoWhitespace": false,
10
10
  "files.insertFinalNewline": true,
11
11
  "files.eol": "\n",
12
- "npm.packageManager": "[REPLACE_ME]"
12
+ "npm.packageManager": "[REPLACE_PACKAGE_MANAGER]"
13
13
  }
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../eslint/bin/eslint.js" "$@"
19
+ else
20
+ exec node "$basedir/../eslint/bin/eslint.js" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../prettier/bin/prettier.cjs" "$@"
19
+ else
20
+ exec node "$basedir/../prettier/bin/prettier.cjs" "$@"
21
+ fi
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "name": "[REPLACE_ME]",
3
+ "name": "@discordjs/template-javascript",
4
4
  "version": "0.1.0",
5
5
  "private": true,
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  import { glob, stat } from 'node:fs/promises';
2
- import { resolve } from 'node:path';
2
+ import { basename, resolve } from 'node:path';
3
3
  import { fileURLToPath, URL } from 'node:url';
4
4
  import { predicate as commandPredicate } from '../commands/index.js';
5
5
  import { predicate as eventPredicate } from '../events/index.js';
@@ -40,7 +40,7 @@ export async function loadStructures(dir, predicate, recursive = true) {
40
40
  // Loop through all the matching files in the directory
41
41
  for await (const file of glob(pattern)) {
42
42
  // If the file is index.js, skip the file
43
- if (file.endsWith('/index.js')) {
43
+ if (basename(file) === 'index.js') {
44
44
  continue;
45
45
  }
46
46
 
@@ -1 +1 @@
1
- dist
1
+ pnpm-lock.yaml
@@ -0,0 +1,4 @@
1
+
2
+ > @discordjs/template-typescript@0.1.0 build /home/runner/work/discord.js/discord.js/packages/create-discord-bot/template/TypeScript
3
+ > tsc
4
+
@@ -2,7 +2,6 @@
2
2
  "recommendations": [
3
3
  "esbenp.prettier-vscode",
4
4
  "dbaeumer.vscode-eslint",
5
- "tamasfe.even-better-toml",
6
5
  "codezombiech.gitignore",
7
6
  "christian-kohler.npm-intellisense",
8
7
  "christian-kohler.path-intellisense"
@@ -9,5 +9,5 @@
9
9
  "editor.trimAutoWhitespace": false,
10
10
  "files.insertFinalNewline": true,
11
11
  "files.eol": "\n",
12
- "npm.packageManager": "[REPLACE_ME]"
12
+ "npm.packageManager": "[REPLACE_PACKAGE_MANAGER]"
13
13
  }
@@ -5,7 +5,7 @@ import typescript from 'eslint-config-neon/typescript';
5
5
 
6
6
  const config = [
7
7
  {
8
- ignores: ['**/dist/*'],
8
+ ignores: [],
9
9
  },
10
10
  ...common,
11
11
  ...node,
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules/eslint/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/eslint@9.39.1_jiti@2.6.1/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../eslint/bin/eslint.js" "$@"
19
+ else
20
+ exec node "$basedir/../eslint/bin/eslint.js" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/prettier@3.7.4/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../prettier/bin/prettier.cjs" "$@"
19
+ else
20
+ exec node "$basedir/../prettier/bin/prettier.cjs" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsc" "$@"
21
+ fi
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/discord.js/discord.js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsserver" "$@"
21
+ fi
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "name": "[REPLACE_ME]",
3
+ "name": "@discordjs/template-typescript",
4
4
  "version": "0.1.0",
5
5
  "private": true,
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
9
  "lint": "prettier --check . && eslint --ext .ts --format=pretty src",
10
- "deploy": "node --env-file=.env dist/util/deploy.js",
10
+ "deploy": "node --env-file=.env src/util/deploy.ts",
11
11
  "format": "prettier --write . && eslint --ext .ts --fix --format=pretty src",
12
- "start": "node --env-file=.env dist/index.js"
12
+ "start": "node --env-file=.env src/index.ts"
13
13
  },
14
14
  "dependencies": {
15
15
  "@discordjs/core": "^2.4.0",
@@ -1,6 +1,6 @@
1
1
  import type { RESTPostAPIApplicationCommandsJSONBody, CommandInteraction } from 'discord.js';
2
2
  import { z } from 'zod';
3
- import type { StructurePredicate } from '../util/loaders.[REPLACE_IMPORT_EXT]';
3
+ import type { StructurePredicate } from '../util/loaders.ts';
4
4
 
5
5
  /**
6
6
  * Defines the structure of a command
@@ -1,4 +1,4 @@
1
- import type { Command } from './index.[REPLACE_IMPORT_EXT]';
1
+ import type { Command } from './index.ts';
2
2
 
3
3
  export default {
4
4
  data: {
@@ -1,4 +1,4 @@
1
- import type { Command } from '../index.[REPLACE_IMPORT_EXT]';
1
+ import type { Command } from '../index.ts';
2
2
 
3
3
  export default {
4
4
  data: {
@@ -1,6 +1,6 @@
1
1
  import type { ClientEvents } from 'discord.js';
2
2
  import { z } from 'zod';
3
- import type { StructurePredicate } from '../util/loaders.[REPLACE_IMPORT_EXT]';
3
+ import type { StructurePredicate } from '../util/loaders.ts';
4
4
 
5
5
  /**
6
6
  * Defines the structure of an event.
@@ -1,7 +1,7 @@
1
1
  import { URL } from 'node:url';
2
2
  import { Events } from 'discord.js';
3
- import { loadCommands } from '../util/loaders.[REPLACE_IMPORT_EXT]';
4
- import type { Event } from './index.[REPLACE_IMPORT_EXT]';
3
+ import { loadCommands } from '../util/loaders.ts';
4
+ import type { Event } from './index.ts';
5
5
 
6
6
  const commands = await loadCommands(new URL('../commands/', import.meta.url));
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { Events } from 'discord.js';
2
- import type { Event } from './index.[REPLACE_IMPORT_EXT]';
2
+ import type { Event } from './index.ts';
3
3
 
4
4
  export default {
5
5
  name: Events.ClientReady,
@@ -1,7 +1,7 @@
1
1
  import process from 'node:process';
2
2
  import { URL } from 'node:url';
3
3
  import { Client, GatewayIntentBits } from 'discord.js';
4
- import { loadEvents } from './util/loaders.[REPLACE_IMPORT_EXT]';
4
+ import { loadEvents } from './util/loaders.ts';
5
5
 
6
6
  // Initialize the client
7
7
  const client = new Client({ intents: [GatewayIntentBits.Guilds] });
@@ -2,7 +2,7 @@ import process from 'node:process';
2
2
  import { URL } from 'node:url';
3
3
  import { API } from '@discordjs/core/http-only';
4
4
  import { REST } from 'discord.js';
5
- import { loadCommands } from './loaders.[REPLACE_IMPORT_EXT]';
5
+ import { loadCommands } from './loaders.ts';
6
6
 
7
7
  const commands = await loadCommands(new URL('../commands/', import.meta.url));
8
8
  const commandData = [...commands.values()].map((command) => command.data);
@@ -1,11 +1,9 @@
1
1
  import type { PathLike } from 'node:fs';
2
2
  import { glob, stat } from 'node:fs/promises';
3
- import { resolve } from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
- import type { Command } from '../commands/index.[REPLACE_IMPORT_EXT]';
6
- import { predicate as commandPredicate } from '../commands/index.[REPLACE_IMPORT_EXT]';
7
- import type { Event } from '../events/index.[REPLACE_IMPORT_EXT]';
8
- import { predicate as eventPredicate } from '../events/index.[REPLACE_IMPORT_EXT]';
3
+ import { basename, resolve } from 'node:path';
4
+ import { fileURLToPath, URL } from 'node:url';
5
+ import { predicate as commandPredicate, type Command } from '../commands/index.ts';
6
+ import { predicate as eventPredicate, type Event } from '../events/index.ts';
9
7
 
10
8
  /**
11
9
  * A predicate to check if the structure is valid
@@ -36,14 +34,14 @@ export async function loadStructures<Structure>(
36
34
  // Create an empty array to store the structures
37
35
  const structures: Structure[] = [];
38
36
 
39
- // Create a glob pattern to match the .[REPLACE_IMPORT_EXT] files
37
+ // Create a glob pattern to match the .ts files
40
38
  const basePath = dir instanceof URL ? fileURLToPath(dir) : dir.toString();
41
- const pattern = resolve(basePath, recursive ? '**/*.[REPLACE_IMPORT_EXT]' : '*.[REPLACE_IMPORT_EXT]');
39
+ const pattern = resolve(basePath, recursive ? '**/*.ts' : '*.ts');
42
40
 
43
41
  // Loop through all the matching files in the directory
44
42
  for await (const file of glob(pattern)) {
45
- // If the file is index.[REPLACE_IMPORT_EXT], skip the file
46
- if (file.endsWith('/index.[REPLACE_IMPORT_EXT]')) {
43
+ // If the file is index.ts, skip the file
44
+ if (basename(file) === 'index.ts') {
47
45
  continue;
48
46
  }
49
47
 
@@ -2,12 +2,15 @@
2
2
  "$schema": "https://json.schemastore.org/tsconfig.json",
3
3
  "extends": ["@sapphire/ts-config", "@sapphire/ts-config/extra-strict"],
4
4
  "compilerOptions": {
5
+ "allowImportingTsExtensions": true,
6
+ "erasableSyntaxOnly": true,
5
7
  "declaration": false,
6
8
  "declarationMap": false,
7
- "module": "NodeNext",
8
- "moduleResolution": "NodeNext",
9
+ "incremental": false,
10
+ "module": "ESNext",
11
+ "moduleResolution": "Bundler",
12
+ "noEmit": true,
9
13
  "target": "ESNext",
10
- "outDir": "dist",
11
14
  "skipLibCheck": true
12
15
  }
13
16
  }