Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 81da6ee

Browse files
authored
Merge pull request #161 from microsoft/emilio/luis
Adding Contributing.md
2 parents 0c22144 + 93c0520 commit 81da6ee

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed
Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,46 @@
55
1. Clone the repo by running 'git clone https://github.com/microsoft/botframework-cli.git'
66
2. Inside the project folder run 'npm run build'
77
3. Inside the packages folder(https://github.com/microsoft/botframework-cli/tree/master/packages) run 'npx oclif plugin <plugin-name>'
8+
4. Follow the wizard and set the prompts:
9+
10+
? npm package: @microsoft/bf-<plugin-name>
11+
? description: <Plugin brief description>
12+
? author: Microsoft
13+
? version: 1.0.0
14+
? license: MIT
15+
? Who is the GitHub owner of repository (https://github.com/OWNER/repo): microsoft
16+
? What is the GitHub name of repository (https://github.com/owner/REPO): botframework-cli
17+
? Select a package manager: npm
18+
? TypeScript: Y
19+
? Use tslint (linter for TypeScript): Y
20+
? Use mocha (testing framework): Y
21+
? Add CI service config (Press <space> to select, <a> to toggle all, <i> to invert selection): select any
22+
823
4. Go to the folder created by the previous command and add @microsoft/bf-cli-command as a dependency in your package.json file
24+
25+
"dependencies": {
26+
...,
27+
"@microsoft/bf-cli-command": "1.0.0",
28+
...
29+
}
30+
931
5. At the root level(https://github.com/microsoft/botframework-cli) run 'npm run build' to bootstrap the packages
1032

1133
## Steps to create a new command
1234
1. Inside the plugin folder run 'npx oclif command <command-name>'.
1335
a. To add a subcommand use a colon separated format as follows:
1436
<command-name:subcommand-name>
15-
2. Replace the import 'import {Command, options} from '@oclif/command' line inside the newly created command with 'import {Command, options} from '@microsoft/bf-cli-command'
16-
3. Add the type to the options property like this: static options: options.Input<any> = {}
37+
2. Replace the import 'import {Command, flags} from '@oclif/command' line inside the newly created command with '@microsoft/bf-cli-command'
38+
39+
- import {Command, flags} from '@oclif/command'
40+
+ import {Command, flags} from '@microsoft/bf-cli-command'
41+
42+
3. Add the typing to the flags property like this if needed:
43+
44+
static flags: flags.Input<any> = {
45+
help: flags.help({description: 'Display help'}),
46+
}
47+
1748
4. Implement the run method
1849

1950
## General Guidelines
@@ -55,14 +86,14 @@ Use the following verbs for standard commands
5586

5687
### Other
5788

58-
* Commands and options are case InSenSiTive, specified in lower case. So *bf Cmd:SubCmd* is same as *bf cmd:subcmd*.
89+
* Commands and options are case SenSiTive, specified in lower case. *bf cmd:subcmd*.
5990
* Multi word options are lowcase, nohyphen, multiwords. Multi word commands are forbidden.
60-
* Always have attribute-value pairs on command line args (i.e. bf cmd --arg \<val\>, NOT bf cmd \<val\>).
91+
* Prefer flags to args
6192
* Commands shall follow the *bf \[noun\]\[verb\]\[noun\]* form for example *bf qnamaker:create:kb*.
62-
* Arguments with specific units:
63-
* In general, DO NOT put units in argument names. ALWAYS put the expected units in the help text. Example: --durationinminutes should simply be --duration. This prevents the need to add more arguments later if more units are supported.
93+
* FLags with specific units:
94+
* In general, DO NOT put units in Flag names. ALWAYS put the expected units in the help text. Example: --durationinminutes should simply be --duration. This prevents the need to add more arguments later if more units are supported.
6495
* Consider allowing a syntax that will let the user specify units. For example, even if the service requires a value in minutes, consider accepting 1h or 60m. It is fine to assume a default (i.e. 60 = 60 minutes).
65-
* It is acceptable to use a unit in the argument name when it is used like an enum. For example, --startday is okay when it accepts MON, TUE, etc. --starthour is okay when it indicates an hour of the day.
96+
* It is acceptable to use a unit in the flag name when it is used like an enum. For example, --startday is okay when it accepts MON, TUE, etc. --starthour is okay when it indicates an hour of the day.
6697
* Avoid having multiple arguments that simply represent different ways of getting the same thing. Instead, use a single descriptive name and overload it appropriately. For example, assume a command which can accept a parameter file through a URL or local path.
6798

6899
### Porting Rules

0 commit comments

Comments
 (0)