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.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/Bun/JavaScript/eslint.config.js +21 -0
- package/template/Bun/JavaScript/node_modules/.bin/eslint +21 -0
- package/template/Bun/JavaScript/node_modules/.bin/prettier +21 -0
- package/template/Bun/JavaScript/package.json +5 -5
- package/template/Bun/JavaScript/src/index.js +1 -0
- package/template/Bun/TypeScript/eslint.config.js +26 -0
- package/template/Bun/TypeScript/node_modules/.bin/eslint +21 -0
- package/template/Bun/TypeScript/node_modules/.bin/prettier +21 -0
- package/template/Bun/TypeScript/node_modules/.bin/tsc +21 -0
- package/template/Bun/TypeScript/node_modules/.bin/tsserver +21 -0
- package/template/Bun/TypeScript/package.json +5 -5
- package/template/Bun/TypeScript/src/index.ts +1 -0
- package/template/Bun/TypeScript/tsconfig.json +3 -3
- package/template/Deno/.vscode/settings.json +1 -1
- package/template/Deno/src/util/loaders.ts +2 -2
- package/template/JavaScript/.prettierignore +1 -0
- package/template/JavaScript/.vscode/extensions.json +0 -1
- package/template/JavaScript/.vscode/settings.json +1 -1
- package/template/JavaScript/node_modules/.bin/eslint +21 -0
- package/template/JavaScript/node_modules/.bin/prettier +21 -0
- package/template/JavaScript/package.json +1 -1
- package/template/JavaScript/src/util/loaders.js +2 -2
- package/template/TypeScript/.prettierignore +1 -1
- package/template/TypeScript/.turbo/turbo-build.log +4 -0
- package/template/TypeScript/.vscode/extensions.json +0 -1
- package/template/TypeScript/.vscode/settings.json +1 -1
- package/template/TypeScript/eslint.config.js +1 -1
- package/template/TypeScript/node_modules/.bin/eslint +21 -0
- package/template/TypeScript/node_modules/.bin/prettier +21 -0
- package/template/TypeScript/node_modules/.bin/tsc +21 -0
- package/template/TypeScript/node_modules/.bin/tsserver +21 -0
- package/template/TypeScript/package.json +3 -3
- package/template/TypeScript/src/commands/index.ts +1 -1
- package/template/TypeScript/src/commands/ping.ts +1 -1
- package/template/TypeScript/src/commands/utility/user.ts +1 -1
- package/template/TypeScript/src/events/index.ts +1 -1
- package/template/TypeScript/src/events/interactionCreate.ts +2 -2
- package/template/TypeScript/src/events/ready.ts +1 -1
- package/template/TypeScript/src/index.ts +1 -1
- package/template/TypeScript/src/util/deploy.ts +1 -1
- package/template/TypeScript/src/util/loaders.ts +8 -10
- 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.
|
|
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.
|
|
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": "
|
|
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 .
|
|
9
|
-
"deploy": "bun run src/util/deploy.
|
|
10
|
-
"format": "prettier --write . && eslint --ext .
|
|
11
|
-
"start": "bun run src/index.
|
|
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": "
|
|
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 .
|
|
9
|
-
"deploy": "bun run src/util/deploy.
|
|
10
|
-
"format": "prettier --write . && eslint --ext .
|
|
11
|
-
"start": "bun run src/index.
|
|
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
|
-
"
|
|
12
|
+
"target": "ESNext",
|
|
13
13
|
"skipLibCheck": true
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -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
|
|
46
|
+
if (basename(file) === 'index.ts') {
|
|
47
47
|
continue;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pnpm-lock.yaml
|
|
@@ -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,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
|
|
43
|
+
if (basename(file) === 'index.js') {
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
pnpm-lock.yaml
|
|
@@ -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": "
|
|
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
|
|
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
|
|
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.
|
|
3
|
+
import type { StructurePredicate } from '../util/loaders.ts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Defines the structure of a command
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { URL } from 'node:url';
|
|
2
2
|
import { Events } from 'discord.js';
|
|
3
|
-
import { loadCommands } from '../util/loaders.
|
|
4
|
-
import type { Event } from './index.
|
|
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,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.
|
|
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.
|
|
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
|
|
6
|
-
import { predicate as
|
|
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 .
|
|
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 ? '**/*.
|
|
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.
|
|
46
|
-
if (file
|
|
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
|
-
"
|
|
8
|
-
"
|
|
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
|
}
|