Skip to content

Commit

Permalink
Enforce Node 8+, update compilation target to es2017
Browse files Browse the repository at this point in the history
No more compiling down async/await! Debugging should be much less confusing now.

Also updated `Command#overloads` docs
  • Loading branch information
zajrik committed Jul 6, 2017
1 parent bddbf16 commit c0c9648
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ making it simple to get a bot up and running with minimal effort and configurati
>Note: Features described here are representative of the state of the master branch. Installing directly from GitHub
is currently preferred due to the proximity to release and dependency issues in the latest stable release.

>Use `npm install --save zajrik/yamdbf` to install from GitHub. This requires `git` to be installed and in your PATH.
>Use `npm install --save zajrik/yamdbf` to install from GitHub. This requires `git` to be installed and in your PATH,
and also requires > Node 8.0.0 to run.
>Documentation for the master branch can be found [here](https://yamdbf.js.org/indev).
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
"node",
"discordapp"
],
"engines": {
"node": ">=8.0.0"
},
"dependencies": {
"chalk": "^1.1.3",
"discord.js": "github:hydrabolt/discord.js#11.1-dev",
Expand Down
4 changes: 3 additions & 1 deletion src/command/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ export class Command<T extends Client = Client>
/**
* The name of a base command to overload. Commands may only overload
* base commands so the {@link Command#group} must be set to 'base' in
* order to overload. Commands may only be overloaded by name, not by alias
* order to overload. You must also be sure to **not** disable the base
* command that you are overloading. Commands may only be overloaded by
* name, not by alias
* @name Command#overloads
* @type {string}
*/
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export { Logger } from './util/logger/Logger';
export { logger } from './util/logger/LoggerDecorator';
export { LogLevel } from './types/LogLevel';
export { Lang } from './localization/Lang';
export { ResourceLoader } from './types/ResourceLoader';

export { deprecated } from './util/DeprecatedDecorator';

Expand Down
18 changes: 14 additions & 4 deletions test/commands/test_command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { Client, Command, Message, CommandDecorators, Logger, logger } from '../../bin';
import { Middleware } from '../../bin';
import {
Client,
Command,
Message,
CommandDecorators,
Logger,
logger,
ResourceLoader,
Middleware
} from '../../bin';
import * as util from 'util';
const { using, guildOnly, group, ownerOnly } = CommandDecorators;
const { resolve, expect } = Middleware;
const { resolve, expect, localize } = Middleware;

// @ownerOnly
// @guildOnly
Expand All @@ -23,8 +31,10 @@ export default class extends Command
// @using((message, args) => [message, args.map(a => a.toUpperCase())])
@using(resolve(`test: Number, foo: String`))
@using(expect(`test: Number, foo: ['foo', 'bar']`))
public action(message: Message, args: string[]): void
@using(localize)
public action(message: Message, [res, ...args]: [ResourceLoader, string[]]): void
{
message.channel.send(res('FOO_BAR_BAZ'));
message.channel.send(args.join(' ') || 'MISSING ARGS');
this.logger.debug('Command:test', util.inspect(this.group));
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// "noUnusedLocals": true,
// "noUnusedParameters": true,
"module": "commonjs",
"target": "es6",
"target": "es2017",
"lib": [
"es7"
],
Expand Down

0 comments on commit c0c9648

Please sign in to comment.