Skip to content

Commit

Permalink
Fix npm watch script for TypeScript samples (#949)
Browse files Browse the repository at this point in the history
* Fix bug introduced with yeoman nodejs template default bot name change

a PR that changed the default bot name used by the yeoman generator from camelCase to kabob-case didn’t include an update to the documentation.

this corrects that

* Fixes #901 Yeoman generated echobot "watch" script does not watch

PR #820 was a partical fix.
this PR includes fixes for all the typescript samples
it also fixes README.MD file casing to be README.md where this was broken
  • Loading branch information
sgellock authored Nov 18, 2018
1 parent 93c8bf0 commit 94417f3
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 28 deletions.
2 changes: 1 addition & 1 deletion generators/generator-botbuilder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The table below describes the reasonable set of defaults used when `--noprompt`

| Commandline Option | Description |
| ------------------ | ----------- |
| --botname, -N | `myChatBot` |
| --botname, -N | `my-chat-bot` |
| --description, -D | `Demonstrate the core capabilities of the Microsoft Bot Framework` |
| --language, -L | `JavaScript` |
| --template, -T | `basic` |
Expand Down
5 changes: 3 additions & 2 deletions samples/javascript_typescript/01.console-echo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "BotBuilder v4 TypeScript console echobot sample",
"main": "index.js",
"scripts": {
"build-sample": "tsc",
"build": "tsc",
"start": "tsc && node ./lib/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "nodemon -e ts --exec \"npm start\""
"watch": "concurrently --kill-others \"tsc -w\" \"nodemon ./lib/index.js\""
},
"author": "Microsoft",
"license": "MIT",
Expand All @@ -16,6 +16,7 @@
"readline": "^1.3.0"
},
"devDependencies": {
"concurrently": "^4.0.1",
"nodemon": "^1.18.6",
"tslint": "^5.11.0",
"tslint-microsoft-contrib": "^5.2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "Bot Builder v4 echo bot sample",
"main": "./lib/index.js",
"scripts": {
"build-sample": "tsc",
"build": "tsc",
"start": "tsc && node ./lib/index.js",
"watch": "nodemon -e ts --exec \"npm start\""
"watch": "concurrently --kill-others \"tsc -w\" \"nodemon ./lib/index.js\""
},
"author": "Microsoft",
"license": "MIT",
Expand All @@ -17,6 +17,7 @@
"restify": "^7.2.2"
},
"devDependencies": {
"concurrently": "^4.0.1",
"nodemon": "^1.18.6",
"tslint": "^5.11.0",
"tslint-microsoft-contrib": "^5.2.1"
Expand Down
5 changes: 3 additions & 2 deletions samples/javascript_typescript/11.qnamaker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "Bot Builder v4 QnA Maker sample",
"main": "./lib/index.js",
"scripts": {
"build-sample": "tsc",
"build": "tsc",
"start": "tsc && node ./lib/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "nodemon -e ts --exec \"npm start\""
"watch": "concurrently --kill-others \"tsc -w\" \"nodemon ./lib/index.js\""
},
"author": "Microsoft",
"license": "MIT",
Expand All @@ -19,6 +19,7 @@
"restify": "^7.2.2"
},
"devDependencies": {
"concurrently": "^4.0.1",
"nodemon": "^1.18.6",
"tslint": "^5.11.0",
"tslint-microsoft-contrib": "^5.2.1"
Expand Down
29 changes: 17 additions & 12 deletions samples/javascript_typescript/12.nlp-with-luis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,28 @@ In order to run this sample, you must have TypeScript installed. To install Typ
- Click the [Download](https://www.typescriptlang.org/#download-links) button.
- Follow the installation instructions for your development environment.

### Set up LUIS
- Navigate to [LUIS portal](https://www.luis.ai).
- Click the `Sign in` button.
- Click on `My Apps`.
- Click on the `Import new app` button.
- Click on the `Choose File` and select [Reminders.json](cognitiveModels/Reminders.json) from the `BotBuilder-Samples/samples/javascript_typescript/12.nlp-with-luis/cognitiveModels` folder.
- Update [nlp-with-luis.bot](nlp-with-luis.bot) file with your AppId, SubscriptionKey, Region and Version.
You can find this information under "Publish" tab for your LUIS application at [LUIS portal](https://www.luis.ai). For example, for
- The `AppID` can be found in "Application Information"
- The `SubscriptionKey` can be found in "Keys and Endpoints", under the `Key 1` column
- The `region` can be found in "Keys and Endpoints", under the `Region` column

The Version is listed on the page. [See an example .bot service configuration for using LUIS here](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-v4-luis?view=azure-bot-service-4.0&tabs=js#configure-your-bot-to-use-your-luis-app).
- Update [nlp-with-luis.bot](nlp-with-luis.bot) file with your Authoring Key.
You can find this under your user settings at [luis.ai](https://www.luis.ai). Click on your name in the upper right hand corner of the portal, and click on the "Settings" menu option. Add this to your .bot file's service configuration as `authoringKey`.
- Click on the `Choose File` and select [reminders.json](cognitiveModels/reminders.json) from the `BotBuilder-Samples/javascript_nodejs/12.nlp-with-luis/cognitiveModels` folder.
- Provide a name for the LUIS app
- Click on the `Train` button. To train your language model.
- Click on the `Publish` button. To publish your trained language model.
- Update [nlp-with-luis.bot](nlp-with-luis.bot) file with your AppId, SubscriptionKey, Region and Version.
You can find this information under "Keys and Endpoint" tab for your LUIS application at [LUIS portal](https://www.luis.ai). For example, for https://westus.settingsapi.cognitive.microsoft.com/luis/v2.0/apps/{LuisAppID}?subscription-key={LuisSubscriptionKey}&verbose=true&timezoneOffset=0&q=

The Version is listed on the page.
Note: Enter either the "authoringKey" OR "subscriptionKey", not both.
[See an example .bot service configuration for using LUIS here](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-v4-luis?view=azure-bot-service-4.0&tabs=js#configure-your-bot-to-use-your-luis-app).

- Update [index.js](index.js) and set the `LUIS_CONFIGURATION` value to match the `name` field in your service declaration.

- Update [nlp-with-luis.bot](nlp-with-luis.bot) file with your Authoring Key.
You can find this under your user settings at [luis.ai](https://www.luis.ai). Click on your name in the upper right hand corner of the portal, and click on the "Settings" menu option.

NOTE: Once you publish your app on LUIS portal for the first time, it may take some time to go live.

- Your .bot file should now include an item in the services array that looks like this:

```javascript
Expand Down
5 changes: 3 additions & 2 deletions samples/javascript_typescript/12.nlp-with-luis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "Bot Builder v4 sample using LUIS for NLP",
"main": "./lib/index.js",
"scripts": {
"build-sample": "tsc",
"build": "tsc",
"start": "tsc && node ./lib/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "nodemon -e ts --exec \"npm start\""
"watch": "concurrently --kill-others \"tsc -w\" \"nodemon ./lib/index.js\""
},
"author": "Microsoft",
"license": "MIT",
Expand All @@ -19,6 +19,7 @@
"restify": "^7.2.2"
},
"devDependencies": {
"concurrently": "^4.0.1",
"nodemon": "^1.18.6",
"tslint": "^5.11.0",
"tslint-microsoft-contrib": "^5.2.1"
Expand Down
4 changes: 2 additions & 2 deletions samples/javascript_typescript/13.basic-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ Update `.env` with the appropriate keys botFilePath and botFileSecret.
### Running the bot

```
node ./index.js
npm start
```
### Developing the bot

```
nodemon ./index.js
npm run watch
```


Expand Down
11 changes: 6 additions & 5 deletions samples/javascript_typescript/13.basic-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"name": "basic-bot",
"version": "0.1.0",
"description": "A basic bot that demonstrates core AI capabilities",
"author": "Microsoft Bot Framework Team",
"license": "MIT",
"main": "index.js",
"scripts": {
"build-sample": "tsc",
"build": "tsc",
"start": "tsc && node ./lib/index.js",
"watch": "nodemon -e ts --exec \"npm start\"",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "concurrently --kill-others \"tsc -w\" \"nodemon ./lib/index.js\""
},
"author": "Microsoft Bot Framework Team",
"license": "MIT",
"dependencies": {
"botbuilder": "^4.1.5",
"botbuilder-ai": "^4.1.5",
Expand All @@ -20,6 +20,7 @@
"restify": "^7.2.2"
},
"devDependencies": {
"concurrently": "^4.0.1",
"nodemon": "^1.18.6",
"tslint": "^5.11.0",
"tslint-microsoft-contrib": "^5.2.1"
Expand Down

0 comments on commit 94417f3

Please sign in to comment.