Skip to content

Commit

Permalink
Use path aliases when importing files (#37)
Browse files Browse the repository at this point in the history
* feat(TS Compiler): setup path aliases

* feat(imports): use path aliases everywhere
  • Loading branch information
TheMineWay authored Apr 4, 2024
1 parent 86bf962 commit 0911826
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/commands/code-interpreter/slash/RunCode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SlashCommand } from "../../../modules/handlers/HandlerBuilders.js";
import { SlashCommand } from "@modules/handlers/HandlerBuilders.js";
import { Attachment, EmbedBuilder, SlashCommandBuilder } from "discord.js";
import { CreateRunnerResponse, GetRunnerDetails } from "../utils/ApiTypes.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/code-interpreter/slash/SessionResult.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SlashCommand } from "../../../modules/handlers/HandlerBuilders.js";
import { SlashCommand } from "@modules/handlers/HandlerBuilders.js";
import { EmbedBuilder, SlashCommandBuilder } from "discord.js";
import { CreateRunnerResponse } from "../utils/ApiTypes.js";
import { checkRunnerDetails, checkRunnerStatus, getResultEmbed } from "../utils/RunnerUtils.js";
Expand Down
4 changes: 2 additions & 2 deletions src/commands/slash/SetupStats.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SlashCommand } from "../../modules/handlers/HandlerBuilders.js";
import { SlashCommand } from "@modules/handlers/HandlerBuilders.js";
import { ChannelType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js";
import { logger } from "../../modules/utils/logger.js";
import { logger } from "@modules/utils/logger.js";

export default new SlashCommand({
builder: new SlashCommandBuilder()
Expand Down
2 changes: 1 addition & 1 deletion src/commands/slash/Test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SlashCommand } from "../../modules/handlers/HandlerBuilders.js";
import { SlashCommand } from "@modules/handlers/HandlerBuilders.js";
import { SlashCommandBuilder } from "discord.js";

export default new SlashCommand({
Expand Down
6 changes: 3 additions & 3 deletions src/events/GuildMemberAdd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Event } from "../modules/handlers/HandlerBuilders.js";
import { Event } from "@modules/handlers/HandlerBuilders.js";
import { Events, GuildMember } from "discord.js";
import { logger } from "../modules/utils/logger.js";
import updateStats from "../modules/utils/updateStats.js";
import { logger } from "@modules/utils/logger.js";
import updateStats from "@modules/utils/updateStats.js";

export default new Event({
event: Events.GuildMemberAdd,
Expand Down
6 changes: 3 additions & 3 deletions src/events/GuildMemberRemove.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Event } from "../modules/handlers/HandlerBuilders.js";
import { Event } from "@modules/handlers/HandlerBuilders.js";
import { Events, GuildMember } from "discord.js";
import { logger } from "../modules/utils/logger.js";
import updateStats from "../modules/utils/updateStats.js";
import { logger } from "@modules/utils/logger.js";
import updateStats from "@modules/utils/updateStats.js";

export default new Event({
event: Events.GuildMemberRemove,
Expand Down
2 changes: 1 addition & 1 deletion src/events/InteractionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
SelectMenuInteraction,
UserContextMenuCommandInteraction
} from "discord.js";
import { logger, notifyError } from "../modules/utils/logger.js";
import { logger, notifyError } from "@modules/utils/logger.js";

export default new Event({
event: Events.InteractionCreate,
Expand Down
6 changes: 3 additions & 3 deletions src/events/Ready.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Event } from "../modules/handlers/HandlerBuilders.js";
import { Event } from "@modules/handlers/HandlerBuilders.js";
import { ActivityOptions, ActivityType, Events } from "discord.js";
import { logger } from "../modules/utils/logger.js";
import { EventContext } from "../modules/handlers/HandlerContext.js";
import { logger } from "@modules/utils/logger.js";
import { EventContext } from "@modules/handlers/HandlerContext.js";

const presences: ActivityOptions[] = [
{ name: "your SaaS projects", type: ActivityType.Watching },
Expand Down
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"skipLibCheck": true,
"rootDir": "src",
"outDir": "dist",
"strictPropertyInitialization": false
"strictPropertyInitialization": false,
"baseUrl": ".",
"paths": {
"@events/*": ["src/events/*"],
"@commands/*": ["src/commands/*"],
"@modules/*": ["src/modules/*"]
}
}
}

0 comments on commit 0911826

Please sign in to comment.