Skip to content

Commit

Permalink
refactor: tsconfig, nodejs, builds (#1054)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayymmeena authored Jun 18, 2024
1 parent 7411eb3 commit f27ffb6
Show file tree
Hide file tree
Showing 64 changed files with 260 additions and 321 deletions.
33 changes: 0 additions & 33 deletions docs/docs/discordx/basics/sharding.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,6 @@ discord.**js** has stated

However if you are curious you may continue to read this doc! But don't worry about sharding until 2,000 guilds. Focus on building a quality bot as sharding adds more complexity.

### What if my bot does not compile with tsc?

If your bot does not compile with `tsc` but runs with `ts-node` you will **not** be able to shard with the discord.**js** sharding managers.

I found success with using this `tsconfig.json`

```json
{
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"strict": true,
"noImplicitAny": true,
"sourceMap": true,
"emitDecoratorMetadata": false,
"experimentalDecorators": true,
"importHelpers": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "Node",
"outDir": "./src/build"
},
"exclude": ["node_modules"],
"indent": [true, "spaces", 2]
}
```

If you are receiving errors that complain about imports. Try using the following import where the compiler complains about the import.

```diff
- import fs from 'fs';
+ import fs = require("fs");
```

## I'm Ready

Did you really read the previous section? If not go back and read it.
Expand Down
28 changes: 6 additions & 22 deletions docs/docs/discordx/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,11 @@ Your tsconfig.json file should look like this:
"compilerOptions": {
"module": "ESNext", // required
"target": "ESNext", // required
"noImplicitAny": true,
"sourceMap": true,
"strict": true,
"rootDir": "src",
"outDir": "dist",
"emitDecoratorMetadata": false, // required
"experimentalDecorators": true, // required
"declaration": false,
"importHelpers": true, // required
"forceConsistentCasingInFileNames": true,
"moduleResolution": "Node", // required
"esModuleInterop": true // required
},
"exclude": ["node_modules"]
"experimentalDecorators": true // required
}
}
```

Expand All @@ -237,19 +229,11 @@ Your tsconfig.json file should look like this:
"compilerOptions": {
"module": "CommonJS", // required
"target": "ESNext", // required
"noImplicitAny": true,
"sourceMap": true,
"strict": true,
"rootDir": "src",
"outDir": "dist",
"emitDecoratorMetadata": false, // required
"experimentalDecorators": true, // required
"declaration": false,
"importHelpers": true, // required
"forceConsistentCasingInFileNames": true,
"moduleResolution": "Node", // required
"esModuleInterop": true // required
},
"exclude": ["node_modules"]
"experimentalDecorators": true // required
}
}
```

Expand Down
Loading

0 comments on commit f27ffb6

Please sign in to comment.