From 01e4eaca5eac6fd00a86d7dfc5553e496e7fa4bc Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 16 Apr 2023 17:37:46 +0300 Subject: [PATCH] v1.4.3 --- index.ts | 16 ++++++++-------- package.json | 2 +- src/Parser.ts | 12 ++++++------ src/classes/Command.ts | 12 ++++++------ src/classes/CommandOption.ts | 4 ++-- src/classes/SubcommandGroupOption.ts | 4 ++-- src/classes/SubcommandOption.ts | 4 ++-- src/interfaces/Command.ts | 10 +++++----- src/interfaces/CommandOption.ts | 4 ++-- tsconfig.json | 2 +- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/index.ts b/index.ts index 166014f..30728f7 100644 --- a/index.ts +++ b/index.ts @@ -1,10 +1,10 @@ -export { Parser, ParseError, ArgsResult } from './src/Parser'; +export { Parser, ParseError, ArgsResult } from './src/Parser.js'; -export { Command } from './src/classes/Command'; -export { CommandOption } from './src/classes/CommandOption'; -export { SubcommandGroupOption } from './src/classes/SubcommandGroupOption'; -export { SubcommandOption } from './src/classes/SubcommandOption'; +export { Command } from './src/classes/Command.js'; +export { CommandOption } from './src/classes/CommandOption.js'; +export { SubcommandGroupOption } from './src/classes/SubcommandGroupOption.js'; +export { SubcommandOption } from './src/classes/SubcommandOption.js'; -export { IResolver } from './src/interfaces/Resolver'; -export { OptionType, CommandOptionDefinition } from './src/interfaces/CommandOption'; -export { CommandDefinition } from './src/interfaces/Command'; \ No newline at end of file +export { IResolver } from './src/interfaces/Resolver.js'; +export { OptionType, CommandOptionDefinition } from './src/interfaces/CommandOption.js'; +export { CommandDefinition } from './src/interfaces/Command.js'; \ No newline at end of file diff --git a/package.json b/package.json index 26e64f1..2b2790a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@navy.gif/commandparser", - "version": "1.4.2", + "version": "1.4.3", "description": "Parser meant to parse commands and their options for discord bots", "author": "Navy.gif", "license": "MIT", diff --git a/src/Parser.ts b/src/Parser.ts index 23aadc3..0e91d96 100644 --- a/src/Parser.ts +++ b/src/Parser.ts @@ -1,12 +1,12 @@ // eslint-disable-next-line max-classes-per-file import { EventEmitter } from 'events'; -import Command from './classes/Command'; -import CommandOption from './classes/CommandOption'; +import Command from './classes/Command.js'; +import CommandOption from './classes/CommandOption.js'; -import { OptionType } from "./interfaces/CommandOption"; -import IResolver from './interfaces/Resolver'; -import ExtendedMap from "./util/Map"; -import Util from "./util/Util"; +import { OptionType } from "./interfaces/CommandOption.js"; +import IResolver from './interfaces/Resolver.js'; +import ExtendedMap from "./util/Map.js"; +import Util from "./util/Util.js"; type ArgsResult = { [key: string]: CommandOption diff --git a/src/classes/Command.ts b/src/classes/Command.ts index bf3fba2..542a5eb 100644 --- a/src/classes/Command.ts +++ b/src/classes/Command.ts @@ -1,9 +1,9 @@ -import { OptionType } from "../interfaces/CommandOption"; -import { ICommand, CommandDefinition } from "../interfaces/Command"; -import SubcommandOption from "./SubcommandOption"; -import SubcommandGroupOption from "./SubcommandGroupOption"; -import CommandOption from "./CommandOption"; -import { ArgsResult } from "../Parser"; +import { OptionType } from "../interfaces/CommandOption.js"; +import { ICommand, CommandDefinition } from "../interfaces/Command.js"; +import SubcommandOption from "./SubcommandOption.js"; +import SubcommandGroupOption from "./SubcommandGroupOption.js"; +import CommandOption from "./CommandOption.js"; +import { ArgsResult } from "../Parser.js"; abstract class Command implements ICommand { diff --git a/src/classes/CommandOption.ts b/src/classes/CommandOption.ts index 2401b45..96714be 100644 --- a/src/classes/CommandOption.ts +++ b/src/classes/CommandOption.ts @@ -1,6 +1,6 @@ /* eslint-disable no-undefined */ -import ICommandOption, { Choice, CommandOptionDefinition, DependsOnMode, OptionType, ParseResult } from "../interfaces/CommandOption"; -import IResolver from "../interfaces/Resolver"; +import ICommandOption, { Choice, CommandOptionDefinition, DependsOnMode, OptionType, ParseResult } from "../interfaces/CommandOption.js"; +import IResolver from "../interfaces/Resolver.js"; class CommandOption implements ICommandOption { diff --git a/src/classes/SubcommandGroupOption.ts b/src/classes/SubcommandGroupOption.ts index db9457a..36deef1 100644 --- a/src/classes/SubcommandGroupOption.ts +++ b/src/classes/SubcommandGroupOption.ts @@ -1,5 +1,5 @@ -import { CommandOptionDefinition, OptionType } from "../interfaces/CommandOption"; -import CommandOption from "./CommandOption"; +import { CommandOptionDefinition, OptionType } from "../interfaces/CommandOption.js"; +import CommandOption from "./CommandOption.js"; class SubcommandGroupOption extends CommandOption { constructor (def: CommandOptionDefinition) { diff --git a/src/classes/SubcommandOption.ts b/src/classes/SubcommandOption.ts index 223a0a5..05c1806 100644 --- a/src/classes/SubcommandOption.ts +++ b/src/classes/SubcommandOption.ts @@ -1,5 +1,5 @@ -import { CommandOptionDefinition, OptionType } from "../interfaces/CommandOption"; -import CommandOption from "./CommandOption"; +import { CommandOptionDefinition, OptionType } from "../interfaces/CommandOption.js"; +import CommandOption from "./CommandOption.js"; class SubcommandOption extends CommandOption { constructor (def: CommandOptionDefinition) { diff --git a/src/interfaces/Command.ts b/src/interfaces/Command.ts index 881fc5f..7fadf50 100644 --- a/src/interfaces/Command.ts +++ b/src/interfaces/Command.ts @@ -1,8 +1,8 @@ -import CommandOption from '../classes/CommandOption'; -import SubcommandGroupOption from '../classes/SubcommandGroupOption'; -import SubcommandOption from '../classes/SubcommandOption'; -import { ArgsResult } from '../Parser'; -import { CommandOptionDefinition } from './CommandOption'; +import CommandOption from '../classes/CommandOption.js'; +import SubcommandGroupOption from '../classes/SubcommandGroupOption.js'; +import SubcommandOption from '../classes/SubcommandOption.js'; +import { ArgsResult } from '../Parser.js'; +import { CommandOptionDefinition } from './CommandOption.js'; interface ICommand { diff --git a/src/interfaces/CommandOption.ts b/src/interfaces/CommandOption.ts index 01f0ae4..fd35798 100644 --- a/src/interfaces/CommandOption.ts +++ b/src/interfaces/CommandOption.ts @@ -28,8 +28,8 @@ // | 'FLOAT' // | 'POINTS' -import CommandOption from "../classes/CommandOption"; -import IResolver from "./Resolver"; +import CommandOption from "../classes/CommandOption.js"; +import IResolver from "./Resolver.js"; enum OptionType { SUB_COMMAND, diff --git a/tsconfig.json b/tsconfig.json index 2311167..09f5b37 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,7 +27,7 @@ /* Modules */ "module": "ES2022", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + "moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */