Skip to content

Commit

Permalink
Edit: Continue updating releative imports
Browse files Browse the repository at this point in the history
Also adds @root
Only used by the package.json
Doesn't even feel right anyways

That should be the rest of them besides the ones that are in the same directory.

This should get any that traverse up directories
  • Loading branch information
ctsstc committed Apr 26, 2020
1 parent 5770d1c commit c77d701
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 23 deletions.
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
"node"
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
'^@/(.*)$': '<rootDir>/src/$1',
'@root/(.*)$': '<rootDir>/$1'
}
};
2 changes: 1 addition & 1 deletion src/commands/_template.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ICommand from '@/library/interfaces/iCommand';
import { Message } from 'discord.js';
import ICommand from '../library/interfaces/iCommand';

// Hack for implementing with static properties/methods
let CommandName: ICommand;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/add.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Message } from "discord.js";
import ICommand from "../library/interfaces/iCommand";
import ICommand from "@/library/interfaces/iCommand";

let Add: ICommand;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/format.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Message } from 'discord.js';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';

// Hack for implementing with static properties/methods
let Format: ICommand;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/gitProfile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';
import { Message } from 'discord.js';
import moment from 'moment';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';
import IGithubProfile from './interfaces/iGithubProfile';

let GitProfile: ICommand;
Expand Down
6 changes: 3 additions & 3 deletions src/commands/help.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Message } from 'discord.js';
import config from '../config';
import Commands from '../library/commands';
import ICommand from '../library/interfaces/iCommand';
import config from '@/config';
import Commands from '@/library/commands';
import ICommand from '@/library/interfaces/iCommand';

let Help: ICommand;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/lmgtfy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Message } from 'discord.js';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';

let Lmgtfy: ICommand;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/magic8ball.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Message } from 'discord.js';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';

let Magic8Ball: ICommand;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/rules.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Message } from 'discord.js';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';

let Rules: ICommand;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/say.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Message } from 'discord.js';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';

let Say: ICommand;

Expand Down
4 changes: 2 additions & 2 deletions src/commands/search.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import config from '@/config';
import ICommand from '@/library/interfaces/iCommand';
import axios, { AxiosResponse } from 'axios';
import { Message } from 'discord.js';
import config from '../config';
import ICommand from '../library/interfaces/iCommand';

let Search: ICommand;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/source.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Message } from 'discord.js';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';

let Source: ICommand;

Expand Down
6 changes: 3 additions & 3 deletions src/commands/version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import config from '@/config';
import { version } from '@root/package.json';
import { Message } from 'discord.js';
import { version } from '../../package.json';
import config from '../config';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';

let Version: ICommand;

Expand Down
4 changes: 2 additions & 2 deletions src/commands/weather.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios, { AxiosResponse } from 'axios';
import { Message } from 'discord.js';
import config from '../config';
import ICommand from '../library/interfaces/iCommand';
import config from '@/config';
import ICommand from '@/library/interfaces/iCommand';

let Weather: ICommand;

Expand Down
2 changes: 1 addition & 1 deletion src/commands/xmas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Message } from 'discord.js';
import ICommand from '../library/interfaces/iCommand';
import ICommand from '@/library/interfaces/iCommand';

let Xmas: ICommand;

Expand Down
2 changes: 1 addition & 1 deletion src/library/core.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import config from '@/config';
import { Client, GuildMember, Message, TextChannel } from 'discord.js';
import glob from 'glob';
import config from '../config';
import CommandLoader from './commandLoader';
import CommandParser from './commandParser';
import Commands from './commands';
Expand Down
2 changes: 1 addition & 1 deletion src/library/interfaces/iCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Client, Message } from "discord.js";
import Commands from "../commands";
import Commands from "@/commands";

/**
* An interface for all commands to extend, representing the API that all
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"paths": {
"@/*": [
"./*"
],
"@root/*": [
"../*"
]
}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
Expand Down

0 comments on commit c77d701

Please sign in to comment.