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

Commit b91b3a8

Browse files
author
Chris McConnell
authored
CLI consistency of dialog:verify with dialog:merge, luis:build with config (#741)
* Initial check-in. * Allof Working. * Move definitions local. * Launch to sdk. * Everything working for new merge. * schema: working * Working except that allof expansion does not expand local references. * Simplification and some analysis working. * Add extends. * Everything working. * Update help * Fix typo * Expand allOf and validate final schema. * Missing as warning and validate schema. * Update tests. * Update test to pass on server. * Normalize paths. * Check normalize for mac * Update for mac paths and lint. * Address review comments. * Update documentation and fix $id bugs. * Address review commehts * Fix bad merge. * Documentation and update verify to work with latest schemas. * Fix extra import. * Luconfig reflects CLI args. Added deleteOldVersion to cli. Update config:set:luis to include authoringKey. * Address lint issues.
1 parent 0d0c852 commit b91b3a8

File tree

18 files changed

+229
-533
lines changed

18 files changed

+229
-533
lines changed

.vscode/launch.json

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"999999",
1717
"--colors",
1818
"-g",
19-
".*dialog:merge.*"
19+
"dialog:merge.*"
2020
],
2121
"internalConsoleOptions": "openOnSessionStart",
2222
"outputCapture": "std",
@@ -36,7 +36,7 @@
3636
"999999",
3737
"--colors",
3838
"-g",
39-
".*dialog:verify.*"
39+
"dialog:verify.*"
4040
],
4141
"internalConsoleOptions": "openOnSessionStart",
4242
"outputCapture": "std",
@@ -144,6 +144,24 @@
144144
"internalConsoleOptions": "openOnSessionStart",
145145
"cwd": "${workspaceFolder}/../botbuilder-dotnet"
146146
},
147+
{
148+
"type": "node",
149+
"request": "launch",
150+
"name": "BotBuilder verify",
151+
"preLaunchTask": "${defaultBuildTask}",
152+
"program": "${workspaceFolder}/packages/dialog/bin/run",
153+
"outputCapture": "std",
154+
"outFiles": [
155+
"./packages/dialog/lib/**"
156+
],
157+
"args": [
158+
"dialog:verify",
159+
"tests/**/*.dialog",
160+
"--verbose"
161+
],
162+
"internalConsoleOptions": "openOnSessionStart",
163+
"cwd": "${workspaceFolder}/../botbuilder-dotnet"
164+
},
147165
{
148166
"type": "node",
149167
"request": "launch",
@@ -179,18 +197,13 @@
179197
"luis:build",
180198
"--in",
181199
".",
200+
"--luConfig",
201+
"luconfig.json",
182202
"--authoringKey",
183-
"${env:LUIS_AUTHORING_KEY}",
184-
"--botName",
185-
"sandwich",
186-
"--dialog",
187-
"--suffix",
188-
"${env:USERNAME}",
189-
"--out",
190-
"."
203+
"${env:LUIS_AUTHORING_KEY}"
191204
],
192205
"internalConsoleOptions": "openOnSessionStart",
193-
"cwd": "${env:TEMP}/sandwich.out/luis"
206+
"cwd": "${env:TEMP}/sandwich.out"
194207
},
195208
{
196209
"type": "node",

common/config/rush/pnpm-lock.yaml

Lines changed: 27 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/config/README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ This package is intended for Microsoft use only and should be consumed through @
88

99
# Commands
1010
<!-- commands -->
11-
* [`bf config`](#bf-config)
12-
* [`bf config:set`](#bf-configset)
13-
* [`bf config:set:luis`](#bf-configsetluis)
14-
* [`bf config:set:qnamaker`](#bf-configsetqnamaker)
15-
* [`bf config:set:telemetry`](#bf-configsettelemetry)
16-
* [`bf config:show`](#bf-configshow)
17-
* [`bf config:show:luis`](#bf-configshowluis)
18-
* [`bf config:show:qnamaker`](#bf-configshowqnamaker)
19-
* [`bf config:show:telemetry`](#bf-configshowtelemetry)
11+
- [@microsoft/bf-cli-config](#microsoftbf-cli-config)
12+
- [Commands](#commands)
13+
- [`bf config`](#bf-config)
14+
- [`bf config:set`](#bf-configset)
15+
- [`bf config:set:luis`](#bf-configsetluis)
16+
- [`bf config:set:qnamaker`](#bf-configsetqnamaker)
17+
- [`bf config:set:telemetry`](#bf-configsettelemetry)
18+
- [`bf config:show`](#bf-configshow)
19+
- [`bf config:show:luis`](#bf-configshowluis)
20+
- [`bf config:show:qnamaker`](#bf-configshowqnamaker)
21+
- [`bf config:show:telemetry`](#bf-configshowtelemetry)
2022

2123
## `bf config`
2224

@@ -59,13 +61,14 @@ USAGE
5961
OPTIONS
6062
-h, --help show CLI help
6163
--appId=appId LUIS application Id
64+
--authoringKey=authoringKey LUIS cognitive services authoring key (aka Ocp-Apim-Subscription-Key).
6265
--endpoint=endpoint LUIS application endpoint hostname, ex: <region>.api.cognitive.microsoft.com
6366
--subscriptionKey=subscriptionKey LUIS cognitive services subscription key (aka Ocp-Apim-Subscription-Key)
6467
--versionId=versionId LUIS version Id
6568
6669
EXAMPLE
6770
68-
$ bf config:set:luis --appId {APPLICATION_ID} --subscriptionKey {SUBSCRIPTION_KEY} --versionId {VERSION_ID}
71+
$ bf config:set:luis --appId {APPLICATION_ID} --authoringKey {AUTHORING_KEY} --subscriptionKey {SUBSCRIPTION_KEY} --versionId {VERSION_ID}
6972
--endpoint {ENDPOINT}
7073
```
7174

packages/config/src/commands/config/set/luis.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ export default class ConfigSetLuis extends Command {
1010
static description = 'Stores default LUIS application values in global config.'
1111

1212
static examples = [`
13-
$ bf config:set:luis --appId {APPLICATION_ID} --subscriptionKey {SUBSCRIPTION_KEY} --versionId {VERSION_ID} --endpoint {ENDPOINT}
13+
$ bf config:set:luis --appId {APPLICATION_ID} --authoringKey {AUTHORING_KEY} --subscriptionKey {SUBSCRIPTION_KEY} --versionId {VERSION_ID} --endpoint {ENDPOINT}
1414
`]
1515

1616
static flags: flags.Input<any> = {
1717
help: flags.help({char: 'h'}),
18-
subscriptionKey: flags.string({description: 'LUIS cognitive services subscription key (aka Ocp-Apim-Subscription-Key)'}),
1918
appId: flags.string({description: 'LUIS application Id'}),
19+
authoringKey: flags.string({description: 'LUIS cognitive services authoring key (aka Ocp-Apim-Subscription-Key).'}),
20+
subscriptionKey: flags.string({description: 'LUIS cognitive services subscription key (aka Ocp-Apim-Subscription-Key)'}),
2021
versionId: flags.string({description: 'LUIS version Id'}),
2122
endpoint: flags.string({description: 'LUIS application endpoint hostname, ex: <region>.api.cognitive.microsoft.com'}),
2223
}

packages/dialog/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ This package is intended for Microsoft use only and should be consumed through @
1010

1111
# Commands
1212
<!-- commands -->
13-
* [`bf `](#bf-)
14-
* [`bf dialog`](#bf-dialog)
15-
* [`bf dialog:merge PATTERNS`](#bf-dialogmerge-patterns)
16-
* [`bf dialog:verify PATTERNS`](#bf-dialogverify-patterns)
13+
- [@microsoft/bf-dialog](#microsoftbf-dialog)
14+
- [Commands](#commands)
15+
- [`bf `](#bf)
16+
- [`bf dialog`](#bf-dialog)
17+
- [`bf dialog:merge PATTERNS`](#bf-dialogmerge-patterns)
18+
- [`bf dialog:verify PATTERNS`](#bf-dialogverify-patterns)
1719

1820
## `bf `
1921

@@ -27,7 +29,7 @@ OPTIONS
2729
-h, --help show CLI help
2830
```
2931

30-
_See code: [src\commands\index.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/blob/v1.0.0/src\commands\index.ts)_
32+
_See code: [src/commands/index.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/index.ts)_
3133

3234
## `bf dialog`
3335

@@ -41,7 +43,7 @@ OPTIONS
4143
-h, --help Dialog command help
4244
```
4345

44-
_See code: [src\commands\dialog\index.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/blob/v1.0.0/src\commands\dialog\index.ts)_
46+
_See code: [src/commands/dialog/index.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/dialog/index.ts)_
4547

4648
## `bf dialog:merge PATTERNS`
4749

@@ -64,7 +66,7 @@ EXAMPLES
6466
$ bf dialog:merge libraries/**/*.schema **/*.csproj -o app.schema
6567
```
6668

67-
_See code: [src\commands\dialog\merge.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/blob/v1.0.0/src\commands\dialog\merge.ts)_
69+
_See code: [src/commands/dialog/merge.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/dialog/merge.ts)_
6870

6971
## `bf dialog:verify PATTERNS`
7072

@@ -82,5 +84,5 @@ OPTIONS
8284
--verbose Show verbose output
8385
```
8486

85-
_See code: [src\commands\dialog\verify.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/blob/v1.0.0/src\commands\dialog\verify.ts)_
87+
_See code: [src/commands/dialog/verify.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/dialog/verify.ts)_
8688
<!-- commandsstop -->

packages/dialog/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
"@types/lru-cache": "^5.1.0",
4646
"@types/semver": "^6.0.1",
4747
"@types/xml2js": "^0.4.4",
48-
"ajv": "^6.9.1",
48+
"ajv": "^6.12.2",
4949
"chalk": "^2.4.2",
5050
"clone": "^2.1.2",
5151
"fs-extra": "^8.1.0",
5252
"get-uri": "~3.0.2",
53-
"globby": "^9.2.0",
53+
"globby": "^11.0.0",
5454
"@apidevtools/json-schema-ref-parser": "^9.0.1",
5555
"os": "~0.1.1",
5656
"path": "^0.12.7",

packages/dialog/src/commands/dialog/verify.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ export default class DialogVerify extends Command {
1414
{ name: 'patterns', required: true, description: 'Any number of glob regex patterns to match .dialog files.' },
1515
]
1616

17+
static strict = false
18+
1719
static flags: flags.Input<any> = {
1820
help: flags.help({ char: 'h' }),
19-
verbose: flags.boolean({ description: 'Show verbose output', default: false }),
21+
verbose: flags.boolean({ char: 'v', description: 'Show verbose output', default: false }),
2022
}
2123

2224
private currentFile = ''
@@ -106,5 +108,4 @@ export default class DialogVerify extends Command {
106108
this.errors++
107109
this.error(`${this.currentFile} - error ${code || ''}: ${msg}`)
108110
}
109-
110111
}

0 commit comments

Comments
 (0)