Skip to content

Commit dfb204a

Browse files
committed
Added namespace lowercase restriction for consistency. Added CHANGELOG. Cleaned up README from all the info that is now on the Wiki
1 parent 6f714e6 commit dfb204a

16 files changed

+58
-390
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ jobs:
5555
url: https://github.com/${{github.repository}}
5656
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json
5757
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip
58+
license: https://github.com/${{github.repository}}/blob/main/LICENSE
59+
readme: https://github.com/${{github.repository}}/blob/main/README
60+
bugs: https://github.com/${{github.repository}}/issues
61+
changelog: https://github.com/${{github.repository}}/blob/main/CHANGELOG
5862

5963
- name: Build
6064
run: npm run build

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Commander - FoundryVTT at your fingertips
2+
3+
## v0.1.0 (2022-02-19)
4+
- Initial Release
5+
- Complete functionality, but pending some improvements before calling it v1.0.0

README

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
![Module Version](https://img.shields.io/github/v/release/ccjmk/commander?color=blue)
2+
![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)
3+
4+
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/N4N88281M)
5+
6+
# Commander - FoundryVTT at your fingertips
7+
8+
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.
9+
10+
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).
11+
12+
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)!
13+
14+
## Executing Commands
15+
16+
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)*
17+
18+
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.
19+
20+
> For information on how to add new commands, please refer to [The Wiki](https://github.com/ccjmk/commander/wiki)
21+
22+
## Licensing
23+
24+
This project is being developed under the terms of the
25+
[LIMITED LICENSE AGREEMENT FOR MODULE DEVELOPMENT] for Foundry Virtual Tabletop.
26+
27+
MIT - for more info please read the LICENSE file.
28+
29+
[LIMITED LICENSE AGREEMENT FOR MODULE DEVELOPMENT]: https://foundryvtt.com/article/license/

README.md

Lines changed: 0 additions & 207 deletions
This file was deleted.

src/module.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
{
22
"name": "commander",
33
"title": "Commander",
4-
"description": "Command launcher for running and registering commands executable solely by keyboard",
4+
"description": "Command launcher for running and registering commands executable by keyboard",
55
"version": "This is auto replaced",
6-
"author": "ccjmk",
6+
"authors": [
7+
{
8+
"name": "ccjmk",
9+
"url": "https://github.com/ccjmk"
10+
},
11+
{
12+
"name": "Miguel Galante",
13+
"url": "https://www.linkedin.com/in/miguelgalante"
14+
}
15+
],
716
"minimumCoreVersion": "9",
817
"compatibleCoreVersion": "9",
918
"scripts": [],
@@ -22,10 +31,10 @@
2231
"url": "This is auto replaced",
2332
"manifest": "This is auto replaced",
2433
"download": "This is auto replaced",
25-
"license": "",
26-
"readme": "",
27-
"bugs": "",
28-
"changelog": "",
34+
"license": "This is auto replaced",
35+
"readme": "This is auto replaced",
36+
"bugs": "This is auto replaced",
37+
"changelog": "This is auto replaced",
2938
"system": [],
3039
"library": false
3140
}

src/module/commandHandler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ function startsWithOverride(input: string) {
200200

201201
function isValidCommand(command: any): command is Command {
202202
isValidStringField(command.name, 'name');
203-
isValidCommandName(command.name);
203+
isValidLowercaseString(command.name);
204204
isValidStringField(command.namespace, 'namespace');
205+
isValidLowercaseString(command.namespace);
205206
isValidStringField(command.description, 'description', true);
206207
isValidStringField(command.schema, 'schema');
207208
isValidSchema(command);
@@ -286,7 +287,7 @@ function removeOrphanQuotes(input: string): string {
286287
return input;
287288
}
288289

289-
function isValidCommandName(name: any) {
290+
function isValidLowercaseString(name: any) {
290291
const lowercaseName = name.toLocaleLowerCase().trim();
291292
if (lowercaseName !== name) {
292293
throw new Error(localize('Handler.Reg.CommandNameNotLowercase'));

src/module/commands/commandIndex.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import openSheetByNameCommand from './openSheetByName';
55
import openSheetByPlayerCommand from './openSheetByPlayer';
66
import showAllowedCommand from './showAllowedCommands';
77
import goTabCommand from './goTab';
8-
import suggestionsCommand from './examples/suggestionsExample';
98
import infoCommand from './info';
109
import tokenActiveEffectCommand from './tokenActiveEffect';
1110

@@ -18,8 +17,6 @@ const registerCommands = (register: (command: Command, replace: boolean, silentE
1817
register(goTabCommand, false, true);
1918
register(infoCommand, false, true);
2019
register(tokenActiveEffectCommand, false, true);
21-
22-
register(suggestionsCommand, false, true); // TODO delete after testing
2320
};
2421

2522
export default registerCommands;

src/module/commands/examples/allArgsExample.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/module/commands/examples/booleanArgExample.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/module/commands/examples/numberArgExample.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)