diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b197ea..8347084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,4 +6,5 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [Unreleased] -- Initial release \ No newline at end of file +- Initial release +- Support ESM templates diff --git a/README.md b/README.md index aef888d..46f0b9d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Use [sern](https://sern-handler.js.org) as your discord framework please. Thanks ## Usage -you can use `ctxeph`, `ctxopt`, `sernevent` and `serncommand`. +you can use `ctxeph`, `ctxopt`, `sernevent`, `serncommand`, `serneventesm` and `serncommandesm`. ## Release Notes diff --git a/snippets/snippets.code-snippets b/snippets/snippets.code-snippets index 9bfdce8..4e71552 100644 --- a/snippets/snippets.code-snippets +++ b/snippets/snippets.code-snippets @@ -1,47 +1,59 @@ { - // Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and - // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: - // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the - // same ids are connected. - // Example: - // "Print to console": { - // "prefix": "log", - // "body": [ - // "console.log('$1');", - // "$2" - // ], - // "description": "Log output to console" - // } - "sern: Send ephemeral message": { - "scope": "js,ts", - "prefix": "ctxeph", - "body": [ - "ctx.reply({content: `$1`, ephemeral: true})", - ], - "description": "Send an ephemeral message with some content." - }, - "sern: Send message with empty array": { - "scope": "js,ts", - "prefix": "ctxopt", - "body": [ - "ctx.reply({$1})", - ], - "description": "Send a message with an empty array." - }, - "sern: Create a simple event": { - "scope": "js,ts", - "prefix": "sernevent", - "body": [ - "const { EventType, eventModule } = require('@sern\/handler');\r\n\r\nexport default eventModule({\r\n type: EventType.${1:Discord},\r\n name : '$2',\r\n execute($3) {\r\n $4\r\n }\r\n })" - ], - "description": "Create a simple event in sern." - }, - "sern: Create a simple command": { - "scope": "js,ts", - "prefix": "serncommand", - "body": [ - "const { commandModule, CommandType } = require('@sern\/handler');\r\n\r\nexport default commandModule({\r\n\ttype: CommandType.$1,\r\n\tplugins: [],\r\n\tdescription: '$2',\r\n\toptions: [],\r\n\texecute: async (ctx, options) => {\r\n\t\t$3\r\n\t},\r\n});" - ], - "description": "Create a simple command in sern." - }, -} \ No newline at end of file + // Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and + // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the + // same ids are connected. + // Example: + // "Print to console": { + // "prefix": "log", + // "body": [ + // "console.log('$1');", + // "$2" + // ], + // "description": "Log output to console" + // } + "sern: Send ephemeral message": { + "scope": "js,ts", + "prefix": "ctxeph", + "body": ["ctx.reply({content: `$1`, ephemeral: true})"], + "description": "Send an ephemeral message with some content." + }, + "sern: Send message with empty array": { + "scope": "js,ts", + "prefix": "ctxopt", + "body": ["ctx.reply({$1})"], + "description": "Send a message with an empty array." + }, + "sern: Create a simple event": { + "scope": "js,ts", + "prefix": "sernevent", + "body": [ + "const { EventType, eventModule } = require('@sern/handler');\r\n\r\nexport default eventModule({\r\n type: EventType.${1:Discord},\r\n name : '$2',\r\n execute($3) {\r\n $4\r\n }\r\n })" + ], + "description": "Create a simple event in sern." + }, + "sern: Create a simple command": { + "scope": "js,ts", + "prefix": "serncommand", + "body": [ + "const { commandModule, CommandType } = require('@sern/handler');\r\n\r\nexport default commandModule({\r\n\ttype: CommandType.$1,\r\n\tplugins: [],\r\n\tdescription: '$2',\r\n\toptions: [],\r\n\texecute: async (ctx, options) => {\r\n\t\t$3\r\n\t},\r\n});" + ], + "description": "Create a simple command in sern." + }, + "sern: Create a simple ESM event": { + "scope": "js,ts", + "prefix": "serneventesm", + "body": [ + "import { EventType, eventModule } from '@sern/handler';\r\n\r\nexport default eventModule({\r\n type: EventType.${1:Discord},\r\n name : '$2',\r\n execute($3) {\r\n $4\r\n }\r\n })" + ], + "description": "Create a simple event in sern." + }, + "sern: Create a simple ESM command": { + "scope": "js,ts", + "prefix": "serncommandesm", + "body": [ + "import { commandModule, CommandType } from '@sern/handler';\r\n\r\nexport default commandModule({\r\n\ttype: CommandType.$1,\r\n\tplugins: [],\r\n\tdescription: '$2',\r\n\toptions: [],\r\n\texecute: async (ctx, options) => {\r\n\t\t$3\r\n\t},\r\n});" + ], + "description": "Create a simple command in sern." + } +} diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md deleted file mode 100644 index 2fadf67..0000000 --- a/vsc-extension-quickstart.md +++ /dev/null @@ -1,23 +0,0 @@ -# Welcome to your VS Code Extension - -## What's in the folder - -* This folder contains all of the files necessary for your extension. -* `package.json` - this is the manifest file that defines the location of the snippet file and specifies the language of the snippets. -* `snippets/snippets.code-snippets` - the file containing all snippets. - -## Get up and running straight away - -* Press `F5` to open a new window with your extension loaded. -* Create a new file with a file name suffix matching your language. -* Verify that your snippets are proposed on IntelliSense. - -## Make changes - -* You can relaunch the extension from the debug toolbar after making changes to the files listed above. -* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. - -## Install your extension - -* To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. -* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.