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

Commit a7b78dd

Browse files
author
Jonathan Spruance (Insight Global)
committed
Merge branch 'cli-update-check-refactor' of https://github.com/microsoft/botframework-cli into cli-update-check-refactor
2 parents f1b2ca6 + 65c3c9e commit a7b78dd

File tree

180 files changed

+21849
-3700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+21849
-3700
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ typings/
6868
#package-lock.json
6969
package-lock.json
7070

71+
#tsconfig.tsbuildinfo
72+
tsconfig.tsbuildinfo
73+
7174
#vscode files
7275
.vscode
7376
packages/dialog/test/commands/dialog/projects/obj/Debug/netcoreapp2.1/LUISGen.csproj.CoreCompileInputs.cache
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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "root",
3+
"version": "1.0.0",
34
"scripts": {
45
"build": "lerna run build && lerna bootstrap",
56
"test": "lerna run test",

packages/chatdown/README.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
bf-chatdown
1+
@microsoft/bf-chatdown
22
========
33

44
Tool for parsing chat files and outputting replayable activities
@@ -8,23 +8,6 @@ Tool for parsing chat files and outputting replayable activities
88
[![Downloads/week](https://img.shields.io/npm/dw/chatdown.svg)](https://www.npmjs.com/package/@microsoft/bf-chatdown)
99
[![License](https://img.shields.io/npm/l/chatdown.svg)](https://github.com/microsoft/botframework-cli/blob/master/packages/chatdown/package.json)
1010

11-
<!-- toc -->
12-
* [Usage](#usage)
13-
* [Commands](#commands)
14-
<!-- tocstop -->
15-
# Usage
16-
<!-- usage -->
17-
```sh-session
18-
$ bf COMMAND
19-
running command...
20-
$ bf (-v|--version|version)
21-
@microsoft/bf-chatdown/0.0.0 darwin-x64 node-v12.1.0
22-
$ bf --help [COMMAND]
23-
USAGE
24-
$ bf COMMAND
25-
...
26-
```
27-
<!-- usagestop -->
2811
# Commands
2912
<!-- commands -->
3013
* [`bf chatdown`](#bf-chatdown)

0 commit comments

Comments
 (0)