Skip to content

Commit

Permalink
Added namespace lowercase restriction for consistency. Added CHANGELO…
Browse files Browse the repository at this point in the history
…G. Cleaned up README from all the info that is now on the Wiki
  • Loading branch information
ccjmk committed Mar 18, 2022
1 parent 6f714e6 commit dfb204a
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 390 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ jobs:
url: https://github.com/${{github.repository}}
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip
license: https://github.com/${{github.repository}}/blob/main/LICENSE
readme: https://github.com/${{github.repository}}/blob/main/README
bugs: https://github.com/${{github.repository}}/issues
changelog: https://github.com/${{github.repository}}/blob/main/CHANGELOG

- name: Build
run: npm run build
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Commander - FoundryVTT at your fingertips

## v0.1.0 (2022-02-19)
- Initial Release
- Complete functionality, but pending some improvements before calling it v1.0.0
29 changes: 29 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
![Module Version](https://img.shields.io/github/v/release/ccjmk/commander?color=blue)
![FoundryVersion](https://img.shields.io/endpoint?url=https://foundryshields.com/version?url=https%3A%2F%2Fgithub.com%2Fccjmk%2Fcommander%2Freleases%2Fdownload%2Fv0.1.0-pre%2Fmodule.json)

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/N4N88281M)

# Commander - FoundryVTT at your fingertips

Commander is a tool inspired vaguely inspired by the likes of `Launchy` or `Wox`, and a similar feeling like `SearchAnywhere`, that lets you run commands from a shortcut-invoked prompt.

This module provides the command-line input and the API for registering new commands, and will provide some example and general-use commands. The command-line is opened by default by clicking Ctrl+Backtick (the ` right next to the 1 in english keyboards).

It is not the intention of this module to provide commands specific to particular systems, but mostly the tooling and more generic commands applicable to anyone regardless of game system. If you have such a command that you want to share, [don't be afraid to open a pull request](https://github.com/ccjmk/commander/pulls)!

## Executing Commands

You can open the Commander widget by pressing the corresponding keybinding, configurable in-game, with the default been Ctrl+Backtick. *(the ` right next to the 1 in english keyboards)*

Then you can start typing! Command suggestions will pop up as you type, you can auto-accept the selected suggestion with `Tab`/`Enter`, or select other suggestions using `Up` or `Down`. An `Enter` when no suggestion is selected sends the Command for execution.

> For information on how to add new commands, please refer to [The Wiki](https://github.com/ccjmk/commander/wiki)

## Licensing

This project is being developed under the terms of the
[LIMITED LICENSE AGREEMENT FOR MODULE DEVELOPMENT] for Foundry Virtual Tabletop.

MIT - for more info please read the LICENSE file.

[LIMITED LICENSE AGREEMENT FOR MODULE DEVELOPMENT]: https://foundryvtt.com/article/license/
207 changes: 0 additions & 207 deletions README.md

This file was deleted.

21 changes: 15 additions & 6 deletions src/module.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"name": "commander",
"title": "Commander",
"description": "Command launcher for running and registering commands executable solely by keyboard",
"description": "Command launcher for running and registering commands executable by keyboard",
"version": "This is auto replaced",
"author": "ccjmk",
"authors": [
{
"name": "ccjmk",
"url": "https://github.com/ccjmk"
},
{
"name": "Miguel Galante",
"url": "https://www.linkedin.com/in/miguelgalante"
}
],
"minimumCoreVersion": "9",
"compatibleCoreVersion": "9",
"scripts": [],
Expand All @@ -22,10 +31,10 @@
"url": "This is auto replaced",
"manifest": "This is auto replaced",
"download": "This is auto replaced",
"license": "",
"readme": "",
"bugs": "",
"changelog": "",
"license": "This is auto replaced",
"readme": "This is auto replaced",
"bugs": "This is auto replaced",
"changelog": "This is auto replaced",
"system": [],
"library": false
}
5 changes: 3 additions & 2 deletions src/module/commandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ function startsWithOverride(input: string) {

function isValidCommand(command: any): command is Command {
isValidStringField(command.name, 'name');
isValidCommandName(command.name);
isValidLowercaseString(command.name);
isValidStringField(command.namespace, 'namespace');
isValidLowercaseString(command.namespace);
isValidStringField(command.description, 'description', true);
isValidStringField(command.schema, 'schema');
isValidSchema(command);
Expand Down Expand Up @@ -286,7 +287,7 @@ function removeOrphanQuotes(input: string): string {
return input;
}

function isValidCommandName(name: any) {
function isValidLowercaseString(name: any) {
const lowercaseName = name.toLocaleLowerCase().trim();
if (lowercaseName !== name) {
throw new Error(localize('Handler.Reg.CommandNameNotLowercase'));
Expand Down
3 changes: 0 additions & 3 deletions src/module/commands/commandIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import openSheetByNameCommand from './openSheetByName';
import openSheetByPlayerCommand from './openSheetByPlayer';
import showAllowedCommand from './showAllowedCommands';
import goTabCommand from './goTab';
import suggestionsCommand from './examples/suggestionsExample';
import infoCommand from './info';
import tokenActiveEffectCommand from './tokenActiveEffect';

Expand All @@ -18,8 +17,6 @@ const registerCommands = (register: (command: Command, replace: boolean, silentE
register(goTabCommand, false, true);
register(infoCommand, false, true);
register(tokenActiveEffectCommand, false, true);

register(suggestionsCommand, false, true); // TODO delete after testing
};

export default registerCommands;
31 changes: 0 additions & 31 deletions src/module/commands/examples/allArgsExample.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/module/commands/examples/booleanArgExample.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/module/commands/examples/numberArgExample.ts

This file was deleted.

Loading

0 comments on commit dfb204a

Please sign in to comment.