commandkit 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
 
7
+ ## [0.0.7] - 2023-07-02
8
+
9
+ ### Changed
10
+
11
+ - Give validation functions access to the full command object (commandObj) excluding the run function (as that is handled by the command handler), as opposed to just the `data` and `options` properties.
12
+
13
+ ## [0.0.6] - 2023-07-02
14
+
15
+ ### Fixed
16
+
17
+ - Fixed a bug where wrong event names were being registered on Windows.
18
+
7
19
  ## [0.0.5] - 2023-07-02
8
20
 
9
21
  ### Added
@@ -218,9 +218,11 @@ class CommandHandler {
218
218
  }
219
219
  // Run user validation functions
220
220
  const validationFunctions = this._data.validations;
221
+ const { data, options, run, ...rest } = targetCommand;
221
222
  const commandObj = {
222
223
  data: targetCommand.data,
223
224
  options: targetCommand.options,
225
+ ...rest,
224
226
  };
225
227
  let canRun = true;
226
228
  for (const validationFunction of validationFunctions) {
@@ -15,8 +15,7 @@ class EventHandler {
15
15
  _buildEvents() {
16
16
  const eventFolderPaths = (0, get_paths_1.getFolderPaths)(this._data.eventsPath);
17
17
  for (const eventFolderPath of eventFolderPaths) {
18
- const eventFolderPathChunks = eventFolderPath.replace('\\', '/').split('/');
19
- const eventName = eventFolderPathChunks[eventFolderPathChunks.length - 1];
18
+ const eventName = eventFolderPath.replace(/\\/g, '/').split('/').pop();
20
19
  const eventFilePaths = (0, get_paths_1.getFilePaths)(eventFolderPath).filter((path) => path.endsWith('.js') || path.endsWith('.ts'));
21
20
  const eventObj = {
22
21
  name: eventName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commandkit",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {