Skip to content

Commit 66578b0

Browse files
authored
fix: Update generators and remove Core Bot templates (#4867)
* Update empty bot templates * Update echo bot templates * Remove core bot templates and its references * Fix unit tests
1 parent 87d0ad1 commit 66578b0

File tree

79 files changed

+69
-5280
lines changed

Some content is hidden

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

79 files changed

+69
-5280
lines changed

generators/generator-botbuilder/README.md

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ The generator supports three different template options. The table below can he
1414
| Template | Description |
1515
| ---------- | --------- |
1616
| Echo Bot | A good template if you want a little more than "Hello World!", but not much more. This template handles the very basics of sending messages to a bot, and having the bot process the messages by repeating them back to the user. This template produces a bot that simply "echoes" back to the user anything the user says to the bot. |
17-
| Core Bot | Our most advanced template, the Core template provides 6 core features every bot is likely to have. This template covers the core features of a Conversational-AI bot using [LUIS](https://www.luis.ai). See the **Core Bot Features** table below for more details. |
1817
| Empty Bot | A good template if you are familiar with Bot Framework v4, and simply want a basic skeleton project. Also a good option if you want to take sample code from the documentation and paste it into a minimal bot in order to learn. |
1918

2019
### How to Choose a Template
2120

2221
| Template | When This Template is a Good Choice |
2322
| -------- | -------- |
2423
| Echo Bot | You are new to Bot Framework v4 and want a working bot with minimal features. |
25-
| Core Bot | You understand some of the core concepts of Bot Framework v4 and are beyond the concepts introduced in the Echo Bot template. You're familiar with or are ready to learn concepts such as language understanding using LUIS, managing multi-turn conversations with Dialogs, handling user initiated Dialog interruptions, and using Adaptive Cards to welcome your users. |
2624
| Empty Bot | You are a seasoned Bot Framework v4 developer. You've built bots before, and want the minimum skeleton of a bot. |
2725

2826
### Template Overview
@@ -31,38 +29,18 @@ The generator supports three different template options. The table below can he
3129

3230
The Echo Bot template is slightly more than the a classic "Hello World!" example, but not by much. This template shows the basic structure of a bot, how a bot recieves messages from a user, and how a bot sends messages to a user. The bot will "echo" back to the user, what the user says to the bot. It is a good choice for first time, new to Bot Framework v4 developers.
3331

34-
#### Core Bot Template
35-
36-
The Core Bot template consists of set of core features most every bot is likely to have. Building off of the core message processing features found in the Echo Bot template, this template adds a number of more sophisticated features. The table below lists these features and provides links to additional documentation.
37-
38-
| Core Bot Features | Description |
39-
| ------------------ | ----------- |
40-
| [Send and receive messages](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-send-messages?view=azure-bot-service-4.0&tabs=javascript) | The primary way your bot will communicate with users, and likewise receive communication, is through message activities. Some messages may simply consist of plain text, while others may contain richer content such as cards or attachments. |
41-
| [Proactive messaging](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-proactive-message?view=azure-bot-service-4.0) using [Adaptive Cards](https://docs.microsoft.com/azure/bot-service/bot-builder-send-welcome-message?view=azure-bot-service-4.0?#using-adaptive-card-greeting) | The primary goal when creating any bot is to engage your user in a meaningful conversation. One of the best ways to achieve this goal is to ensure that from the moment a user first connects to your bot, they understand your bot’s main purpose and capabilities. We refer to this as "welcoming the user." The Core template uses an [Adaptive Card](http://adaptivecards.io) to implement this behavior. |
42-
| [Language understanding using LUIS](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-v4-luis?view=azure-bot-service-4.0) | The ability to understand what your user means conversationally and contextually can be a difficult task, but can provide your bot a more natural conversation feel. Language Understanding, called LUIS, enables you to do just that so that your bot can recognize the intent of user messages, allow for more natural language from your user, and better direct the conversation flow. |
43-
| [Multi-turn conversation support using Dialogs](https://docs.microsoft.com/azure/bot-service/bot-builder-concept-dialog?view=azure-bot-service-4.0) | The ability to manage conversations is an important part of the bot/user interation. Bot Framework introduces the concept of a Dialog to handle this conversational pattern. Dialog objects process inbound Activities and generate outbound responses. The business logic of the bot runs either directly or indirectly within Dialog classes. |
44-
| [Managing conversation state](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-v4-state?view=azure-bot-service-4.0) | A key to good bot design is to track the context of a conversation, so that your bot remembers things like the answers to previous questions. |
45-
| [How to handle user-initiated interruptions](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-handle-user-interrupt?view=azure-bot-service-4.0) | While you may think that your users will follow your defined conversation flow step by step, chances are good that they will change their minds or ask a question in the middle of the process instead of answering the question. Handling interruptions means making sure your bot is prepared to handle situations like this. |
46-
| [How to unit test a bot](https://aka.ms/cs-unit-test-docs) | Optionally, the Core Bot template can generate corresponding unit tests that shows how to use the testing framework introduced in Bot Framework version 4.5. Selecting this option provides a complete set of units tests for Core Bot. It shows how to write unit tests to test the various features of Core Bot. To add the Core Bot unit tests, run the generator and answer `yes` when prompted. See below for an example of how to do this from the command line. |
47-
4832
#### Empty Bot Template
4933

5034
The Empty Bot template is the minimal skeleton code for a bot. It provides a stub `onTurn` handler but does not perform any actions. If you are experienced writing bots with Bot Framework v4 and want the minimum scaffolding, the Empty template is for you.
5135

5236
## Features by Template
5337

54-
| Feature | Empty Bot | Echo Bot | Core Bot |
55-
| --------- | :-----: | :-----: | :-----: |
56-
| Generate code in JavaScript or TypesScript | X | X | X |
57-
| Support local development and testing using the [Bot Framework Emulator v4](https://www.github.com/microsoft/botframework-emulator) | X | X | X |
58-
| Core bot message processing | | X | X |
59-
| Deploy your bot to Microsoft Azure | | X | X |
60-
| Welcome new users using Adaptive Card technology | | | X |
61-
| Support AI-based greetings using [LUIS](https://www.luis.ai) | | | X |
62-
| Use Dialogs to manage more in-depth conversations | | | X |
63-
| Manage conversation state | | | X |
64-
| Handle user interruptions | | | X |
65-
| Unit test a bot using Bot Framework Testing framework (optional) | | | X |
38+
| Feature | Empty Bot | Echo Bot |
39+
| --------- | :-----: | :-----: |
40+
| Generate code in JavaScript or TypesScript | X | X |
41+
| Support local development and testing using the [Bot Framework Emulator v4](https://www.github.com/microsoft/botframework-emulator) | X | X |
42+
| Core bot message processing | | X |
43+
| Deploy your bot to Microsoft Azure | | X |
6644

6745
## Installation
6846

@@ -108,17 +86,16 @@ The generator supports a number of command line options that can be used to chan
10886
| --botname, -N | The name given to the bot project |
10987
| --description, -D | A brief bit of text that describes the purpose of the bot |
11088
| --language, -L | The programming language for the project. Options are `JavaScript` or `TypeScript`. |
111-
| --template, -T | The template used to generate the project. Options are `empty`, `echo`, or `core`. See [https://aka.ms/botbuilder-generator](https://aka.ms/botbuilder-generator) for additional information regarding the different template option and their functional differences. |
112-
| --addtests | _A Core Bot Template Only Feature_. The generator will add unit tests to the Core Bot generated bot. This option is not available to other templates at this time. To learn more about the test framework released with Bot Framework v4.5, see [How to unit test bots](https://aka.ms/js-unit-test-docs). This option is intended to enable automated bot generation for testing purposes. |
89+
| --template, -T | The template used to generate the project. Options are `empty` or `echo`. See [https://aka.ms/botbuilder-generator](https://aka.ms/botbuilder-generator) for additional information regarding the different template option and their functional differences. |
11390
| --noprompt | The generator will not prompt for confirmation before creating a new bot. Any requirement options not passed on the command line will use a reasonable default value. This option is intended to enable automated bot generation for testing purposes. |
11491
11592
#### Example Using Command Line Options
11693
117-
This example shows how to pass command line options to the generator, setting the default language to TypeScript and the default template to Core.
94+
This example shows how to pass command line options to the generator, setting the default language to TypeScript and the default template to Echo.
11895
11996
```bash
120-
# Run the generator defaulting the language to TypeScript and the template to core
121-
yo botbuilder --L "TypeScript" --T "core"
97+
# Run the generator defaulting the language to TypeScript and the template to echo
98+
yo botbuilder --L "TypeScript" --T "Echo"
12299
```
123100
124101
### Generating a Bot Using --noprompt
@@ -133,7 +110,6 @@ The generator can be run in `--noprompt` mode, which can be used for automated b
133110
| --description, -D | "Demonstrate the core capabilities of the Microsoft Bot Framework" |
134111
| --language, -L | `JavaScript` |
135112
| --template, -T | `echo` |
136-
| --addtests | When specified, will cause the Core Bot template to add unit tests. |
137113
138114
#### Examples Using --noprompt
139115
@@ -151,13 +127,6 @@ This example shows how to run the generator in --noprompt mode, using all the de
151127
yo botbuilder --noprompt
152128
```
153129
154-
This example shows how to run the generator in --noprompt mode, generating a TypeScript Core Bot with unit tests.
155-
156-
```bash
157-
# Run the generator using all default options
158-
yo botbuilder -N "my-core-bot-with-tests" -D "A core bot with tests in TypeScript" -L "TypeScript" -T "core" --addtests --noprompt
159-
```
160-
161130
## Running Your Bot
162131
163132
### Running Your Bot Locally
@@ -202,15 +171,6 @@ The code generated by the botbuilder generator is lint compliant. Depending on
202171
npm run lint
203172
```
204173

205-
#### Testing Core Bots with Tests
206-
207-
Core Bot templates generated with unit tests can be tested using the following:
208-
209-
```bash
210-
# launch mocha, run unit tests, report code coverage
211-
npm test
212-
```
213-
214174
## Deploy Your Bot to Azure
215175

216176
After creating the bot and testing it locally, you can deploy it to Azure to make it accessible from anywhere.

generators/generator-botbuilder/components/commonFilesWriter.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ module.exports.commonFilesWriter = (generator, templatePath) => {
4040

4141
// write the project files common to all templates
4242
// do any text token processing where required
43-
// NOTE: core bot with tests overwrites this file to add a npm test script command
4443
generator.fs.copyTpl(
4544
generator.templatePath(path.join(templatePath, 'package.json.' + extension)),
4645
generator.destinationPath('package.json'),

generators/generator-botbuilder/components/constants.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
// display names of the template options
55
module.exports.BOT_TEMPLATE_NAME_EMPTY = 'Empty Bot';
66
module.exports.BOT_TEMPLATE_NAME_SIMPLE = 'Echo Bot';
7-
module.exports.BOT_TEMPLATE_NAME_CORE = 'Core Bot';
87

98
// aka.ms links to documentation for each template option
109
module.exports.BOT_HELP_URL_EMPTY = 'https://aka.ms/bot-template-empty';
1110
module.exports.BOT_HELP_URL_SIMPLE = 'https://aka.ms/bot-template-echo';
12-
module.exports.BOT_HELP_URL_CORE = 'https://aka.ms/bot-template-core';
1311

1412
// --noprompt template values
1513
module.exports.BOT_TEMPLATE_NOPROMPT_EMPTY = 'empty';
1614
module.exports.BOT_TEMPLATE_NOPROMPT_SIMPLE = 'echo';
17-
module.exports.BOT_TEMPLATE_NOPROMPT_CORE = 'core';
1815

1916
// programming language name options
2017
module.exports.BOT_LANG_NAME_JAVASCRIPT = 'JavaScript';

0 commit comments

Comments
 (0)