Coder Social home page Coder Social logo

pnp / generator-teams Goto Github PK

View Code? Open in Web Editor NEW
411.0 52.0 108.0 25.2 MB

A Yeoman Generator for Microsoft Teams

Home Page: https://pnp.github.io/generator-teams

License: MIT License

JavaScript 2.77% TypeScript 91.12% HTML 5.52% Shell 0.28% Dockerfile 0.16% SCSS 0.14%
yeoman-generator microsoft-teams office365 office bot bot-framework msteamsdev typescript

generator-teams's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-teams's Issues

Build not working on Azure

Hi everyone,
the issue is a result of deploy.cmd:104.
Locally I could run the server but when running the deployment script on Azure the following error ocurred:

Command: deploy.cmd
Handling node.js deployment.
Using start-up script dist/server.js from package.json.
Generated web.config.
Node.js versions available on the platform are: 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.8.27, 0.8.28, 0.10.5, 0.10.18, 0.10.21, 0.10.24, 0.10.26, 0.10.28, 0.10.29, 0.10.31, 0.10.32, 0.10.40, 0.12.0, 0.12.2, 0.12.3, 0.12.6, 4.0.0, 4.1.0, 4.1.2, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.3.0, 4.3.2, 4.4.0, 4.4.1, 4.4.6, 4.4.7, 4.5.0, 4.6.0, 4.6.1, 4.8.4, 5.0.0, 5.1.1, 5.3.0, 5.4.0, 5.5.0, 5.6.0, 5.7.0, 5.7.1, 5.8.0, 5.9.1, 6.0.0, 6.1.0, 6.2.2, 6.3.0, 6.5.0, 6.6.0, 6.7.0, 6.9.0, 6.9.1, 6.9.2, 6.9.4, 6.9.5, 6.10.0, 6.10.3, 6.11.1, 6.11.2, 6.11.5, 7.0.0, 7.1.0, 7.2.0, 7.3.0, 7.4.0, 7.5.0, 7.6.0, 7.7.0, 7.7.4, 7.10.0, 7.10.1, 8.0.0, 8.1.4, 8.4.0, 8.5.0, 8.7.0, 8.8.0, 8.8.1, 8.9.0.
Selected node.js version 8.9.0. Use package.json file to choose a different version.
Selected npm version 5.5.1
Updating iisnode.yml at D:\home\site\wwwroot\dist\iisnode.yml
npm WARN [email protected] No license field.
up to date in 11.932s

npm WARN lifecycle The node binary used for scripts is D:\Program Files (x86)\nodejs\0.10.28\node.exe but npm is using D:\Program Files (x86)\nodejs\8.9.0\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] build D:\home\site\repository
> gulp build


D:\home\site\repository\gulpfile.js:11
const zip = require('gulp-zip');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Liftoff.handleArguments (D:\home\site\repository\node_modules\gulp\bin\gulp.js:116:3)
    at Liftoff.<anonymous> (D:\home\site\repository\node_modules\liftoff\index.js:198:16)
    at module.exports (D:\home\site\repository\node_modules\flagged-respawn\index.js:17:3)
    at Liftoff.<anonymous> (D:\home\site\repository\node_modules\liftoff\index.js:190:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 8
npm ERR! [email protected] build: `gulp build`
Failed exitCode=8, command="D:\Program Files (x86)\nodejs\8.9.0\node.exe" "D:\Program Files (x86)\npm\5.5.1\node_modules\npm\bin\npm-cli.js" run-script build
npm ERR! Exit status 8
npm ERR! 
An error has occurred during web site deployment.
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\local\AppData\npm-cache\_logs\2017-11-14T08_05_37_157Z-debug.log
npm WARN [email protected] No license field.\r\n\r\nnpm WARN lifecycle The node binary used for scripts is D:\Program Files (x86)\nodejs\0.10.28\node.exe but npm is using D:\Program Files (x86)\nodejs\8.9.0\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.\r\n\r\nD:\home\site\repository\gulpfile.js:11\r\nconst zip = require('gulp-zip');\r\n^^^^^\r\nSyntaxError: Use of const in strict mode.\r\n    at Module._compile (module.js:439:25)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:312:12)\r\n    at Module.require (module.js:364:17)\r\n    at require (module.js:380:17)\r\n    at Liftoff.handleArguments (D:\home\site\repository\node_modules\gulp\bin\gulp.js:116:3)\r\n    at Liftoff.<anonymous> (D:\home\site\repository\node_modules\liftoff\index.js:198:16)\r\n    at module.exports (D:\home\site\repository\node_modules\flagged-respawn\index.js:17:3)\r\n    at Liftoff.<anonymous> (D:\home\site\repository\node_modules\liftoff\index.js:190:9)\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 8\r\nnpm ERR! [email protected] build: `gulp build`\r\nnpm ERR! Exit status 8\r\nnpm ERR! \r\nnpm ERR! Failed at the [email protected] build script.\r\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR!     D:\local\AppData\npm-cache\_logs\2017-11-14T08_05_37_157Z-debug.log\r\nD:\Program Files (x86)\SiteExtensions\Kudu\67.61109.3117\bin\Scripts\starter.cmd deploy.cmd

My workaround to resolve this issue: Comment out deploy.cmd:104-109 and do the build process locally by running gulp on my local machine. Then push everything to azure app service.

It seems like gulp is not working like it should. Maybe here is a compatibility issue with some package versions?

Best regards,
Steven

Add support for sass

Is your feature request related to a problem? Please describe.
Please describe the problem you are trying to solve.

Describe the solution you'd like
Please describe the desired behavior.

Describe alternatives you've considered
Please describe alternative solutions or features you have considered.

gulp manifest result in schema-validation error

[15:07:06] 'schema-validation' errored after 21 s
[15:07:06] SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at Request.request [as _callback] (D:\Source\Repos\cqwp\gulpfile.js:151:64)
at self.callback (D:\Source\Repos\cqwp\node_modules\request\request.js:185:22)
at Request.emit (events.js:189:13)
at Request.EventEmitter.emit (domain.js:441:20)
at Request.onRequestError (D:\Source\Repos\cqwp\node_modules\request\request.js:881:8)
at ClientRequest.emit (events.js:189:13)
at ClientRequest.EventEmitter.emit (domain.js:441:20)
at TLSSocket.socketErrorListener (_http_client.js:392:9)
at TLSSocket.emit (events.js:189:13)

Ignoring of generators folder

i would suggest, that we should ignore the generators folders in .git file and generate it via. build server, thereby we have less conflicts on pull requests. [Enhancement]

Injection missing the css - With fix

I've seen the tab html pages missing their css markup in the 'dist' folder.

I fixed this by changing a line in the gulpfile.js

var injectSources = ["./dist/web/scripts//*.js", "./dist/web/assets//*.css"]

Why ask for another bot ID for compose extension?

When you ask to include a compose extension in the generated application, why does it ask for a bot ID again if it already has one for the bot itself?

Or maybe the current version doesn't handle the case where you can create both a bot and a compose extension?

Is there any sample code or demo please

Hi Wictor,

This generator is awesome, it opens a door for me in Teams development. I've already created a project by it, can you please guide me what is the next? where can I find sample code or demo to continue dev and deploy it to my Office 365 Teams please?

Thank you.

Best Wishes,
Shrenky

Add support for localization

Describe the solution you'd like
I'd like to see a sub-generator for localization (schema 1.5+) that generates the localizationInfo object in the manifest. This generator should also be able to be invoked multiple times, to add additional language files.
Also, not that any updates to the main manifest needs to be replicated to the localized manifest versions.
Also, the packaging must ensure to package the localization files

Manifest version/schema mismatch

The manifest generated by the generator starts with:

"$schema": "https://statics.teams.microsoft.com/sdk/v1.2/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.0",

Which appears to stop the manifest from being loaded by either the teams client (when sideloading) or App Studio (when importing the package)
Fix appears to be updating the manifest version:

"$schema": "https://statics.teams.microsoft.com/sdk/v1.2/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.2",

An upgrade "core files" option

Is your feature request related to a problem? Please describe.
Upgrading a project to a new version works, however that does not upgrade the core files, such as all the npm packages and the gulpfile.js

Describe the solution you'd like
Add an option, where you could run an "Upgrade solution" in the generator to get the latest versions of all dependencies.

Required "guid" module missing

As soon as we install globally the generator on Windows 10 and try to run the generator using "yo teams-tab", an error is thrown stating that the "guid" module is missing.

image

When installing the guid module (npm install guid --global), it starts to work again.

JS heap out of memory when using `gulp serve`

When using gulp serve --debug, after some number of rebuilds due to file changes, the gulp process will crash with an out of memory error. I haven't counted how many rebuilds it takes but it's probably at least 10 or so. The callstack varies a lot.

[10:29:04] Starting 'build'...
[10:29:04] Starting 'webpack'...

<--- Last few GCs --->

[130836:0000014A8A32CAA0]  4931482 ms: Mark-sweep 1384.4 (1456.8) -> 1384.4 (1457.3) MB, 1609.0 / 0.0 ms  allocation failure GC in old space requested
[130836:0000014A8A32CAA0]  4933019 ms: Mark-sweep 1384.4 (1457.3) -> 1384.3 (1424.8) MB, 1536.5 / 0.0 ms  last resort GC in old space requested
[130836:0000014A8A32CAA0]  4934138 ms: Mark-sweep 1384.3 (1424.8) -> 1384.3 (1424.8) MB, 1119.6 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0000037620EA5879 <JSObject>
    1: stringSlice(aka stringSlice) [buffer.js:560] [bytecode=0000018DF7D6C789 offset=94](this=0000016BD6B822D1 <undefined>,buf=0000025C47B176F9 <Uint8Array map = 0000001B8C0C3A71>,encoding=0000037620EB5221 <String[4]: utf8>,start=0,end=413676)
    2: toString [buffer.js:633] [bytecode=0000018DF7D6C3D9 offset=145](this=0000025C47B176F9 <Uint8Array map = 0000001B8C0C3A71>,encoding=0000037620EB5...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node_module_register
 2: v8::internal::FatalProcessOutOfMemory
 3: v8::internal::FatalProcessOutOfMemory
 4: v8::internal::Factory::NewRawTwoByteString
 5: v8::internal::Factory::NewStringFromUtf8
 6: v8::String::NewFromUtf8
 7: v8::internal::compiler::Type::Negative31
 8: std::vector<v8::CpuProfileDeoptFrame,std::allocator<v8::CpuProfileDeoptFrame> >::vector<v8::CpuProfileDeoptFrame,std::allocator<v8::CpuProfileDeoptFrame> >
 9: v8::internal::wasm::SignatureMap::Find
10: v8::internal::Builtins::CallableFor
11: v8::internal::Builtins::CallableFor
12: v8::internal::Builtins::CallableFor
13: 000000897FC843C1

dotenv with imports does not work

The template uses the following pattern in server.ts to load env vars before initializing the app:

require('dotenv').config();
import * as allComponents from './TeamsAppsComponents';

However, this does not work because all imports are resolved first before any top-level code is executed in the file. Thus, a bot component imported via TeamsAppsComponents, which uses the @BotDeclaration wrapper to provide the app ID and password from process.env, will not find those env vars.

The workaround is to modify the gulpfile's nodemon task to pass --require dotenv/config as node args.

Compile error on preview-2.7.0 - Dialogs cannot be resolved

When i try to compile a bot project template without static tab on the preview-2.7.0 version with this command "npm run build", then i'm getting the following exception

Module not found: Error: Can't resolve './dialogs/HelpDialog' in 'path\to\file' resolve './dialogs/HelpDialog'

Module not found: Error: Can't resolve './dialogs/WelcomeDialog' in 'path\to\file' resolve './dialogs/WelcomeDialog'

Steps:

  • Create a bot project template
  • without static tab
  • npm run build

Solution:

  • We should remove the HelpDialog Imports and WelcomeDialog Imports, if user doesn't want to create a static tab.

Generated tou.html file has git merge comments

Installed generator (1.2.0)
Ran generator, keeping all defaults (building a tab)
In the resulting project, the file src\app\web\tou.html has the following content (notice the body has an unresolved git merge):

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>
        sample1 - Terms of Use
    </title>
    <!-- inject:css -->
    <!-- endinject -->
</head>

<body>
    <h1>
<<<<<<< 518c71130ed175654e3e20a3c8c05e33e65f4cf6
        sample1 Terms of use</h1>
    <p>
        Add your terms of use here...
=======
        sample1 Terms of Use</h1>
    <p>
        Add your Terms of Use here...
>>>>>>> Typos and updates for "Apps" nomenclature, ngrok info
    </p>
</body>

</html>

Message extensions fails when the name starts with a number

Describe the bug
When creating a messaging extension that has a name that starts with a number the generator fails with the following exception:

-- Details --
Path: C:/code/test/272a/src/app/272AMessageExtensionBot/272AMessageExtensionBot.ts
Text: "...ssor, CardFactory, TurnContext, MemoryStorage, ConversationState, ActivityTypes } from \"botbuilder\";\nimport 272AMessageExtension from \"../272AMessageExtension/272AMessageExtension\";\nimport { TeamsContext, TeamsActivityProcessor } from \"botbuilder-teams\";\r\n\r\n// Initialize debug logging module\r\nconst log = debug(\"msteams\");\r\n\r\n/**\r\n * Implementation for 2..."
Stack: Error: Unexpected scenario where a(n) OpenBraceToken was not found.
    at getTokenEnd (C:\code\github\generator-teams\node_modules\ts-morph\dist\compiler\ast\utils\CommentNodeParser.js:87:23)
    at Function.getContainerBodyPos (C:\code\github\generator-teams\node_modules\ts-morph\dist\compiler\ast\utils\CommentNodeParser.js:78:20)
    at getNodes (C:\code\github\generator-teams\node_modules\ts-morph\dist\compiler\ast\utils\CommentNodeParser.js:98:48)
    at getNodes.next (<anonymous>)
    at Function.from (native)
    at Function.getOrParseChildren (C:\code\github\generator-teams\node_modules\ts-morph\dist\compiler\ast\utils\CommentNodeParser.js:37:30)
    at Function.getCompilerForEachChildren (C:\code\github\generator-teams\node_modules\ts-morph\dist\compiler\ast\utils\ExtendedParser.js:26:79)

To Reproduce
Steps to reproduce the behavior:

  1. Generate a new project
  2. Choose a message extension
  3. Give the name to the message extension something that starts with a number (for example 111 Test
  4. Now it will fail when writing files

Expected behavior
That it does not fail - likely renames the file/class so it does not start with a number, or checks that during the input process

Screenshots
If applicable, add screenshots to help explain your problem.

Detailed information

  • Generator version: 2.7.1
  • OS: Windows
  • Node version: 8.15.0
  • Npm version: 6.9.0

Enhancement: Support dialogs and stored conversation states in CustomBots

Current behavior

Currently the generated Custom Bot is basically just a Node Express handler which receives the posted message as input and returns a message back to the caller. Therefore the provided template does not support "long running" dialogs, stored conversation states or other services offered by the UniversalBot class.

Enhancement idea

Custom bots could be identical to the "Bot Framework" bots and support Dialogs and other services offered by the UniversalBot.

This could be done by writing a custom IConnector which would receive and parse the message from MS Teams and pass it on to the UniversalBot handler. The template could also utilize the provided MemoryBotStorage to store the dialog state in memory, but the user could also write a custom implementation of IBotStorage to persist the state to a database etc..

Implementing a custom Connector should not be an impossible thing to do. The Console Connector included in the Bot Framework gives a nice starting point for it.

If you think that this would be a good idea and a way to go with the Custom Bot generator, then I could help out with implementing it.

Small typo in README.md in generator

There is a small typo in the README.md in the generator at line 42:

  1. Go to the created Web App and configure Deployment Credentials. Not that this is only done once per Microsoft Azure Account.

I think you meant:

  1. Go to the created Web App and configure Deployment Credentials. Note that this is only done once per Microsoft Azure Account.

Doesn't work on macOS

This generator doesn't seem to work (no matter the parameters) on macOS, but works fine on Windows:
image

events.js:167
      throw er; // Unhandled 'error' event
      ^

TypeError: s.addSyntheticLeadingComment is not a function
    at Function.insertTsExportDeclaration (/usr/local/lib/node_modules/generator-teams/generators/tab/index.js:1:1949)
    at e.TabGenerator.writing (/usr/local/lib/node_modules/generator-teams/generators/tab/index.js:1:4098)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-teams/node_modules/yeoman-generator/lib/index.js:424:27)
    at /usr/local/lib/node_modules/generator-teams/node_modules/run-async/index.js:25:25
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/generator-teams/node_modules/run-async/index.js:24:19
    at self.env.runLoop.add.completed (/usr/local/lib/node_modules/generator-teams/node_modules/yeoman-generator/lib/index.js:425:13)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
Emitted 'error' event at:
    at Immediate.setImmediate (/usr/local/lib/node_modules/generator-teams/node_modules/yeoman-generator/lib/index.js:433:22)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)

Edit: This problem persists on both the @master and @preview versions

ReferenceError: global is not defined for 2.7-preview@1

Describe the bug
I'm implementing server component tests for generator-teams via. supertest npm package. I implemented a sample test (you can find it here):
https://github.com/cagdasdavulcu/cd-test-05/blob/master/src/app/__tests__/Server.spec.ts

if i run the tests, then i'm getting an exception ReferenceError: global is not defined from the package 'express-msteams-host'.

You can use my sample repository for reproducing the problem (just clone it and run the command 'npm run test'):
https://github.com/cagdasdavulcu/cd-test-05

Screenshots
image

ReferenceError: global is not defined

   5 | import { MsTeamsApiRouter, MsTeamsPageRouter } from "express-msteams-host";
   6 | import * as debug from "debug";
>  7 |
     | ^
   8 | // Initialize debug logging module
   9 | const log = debug("msteams");
  10 |

  at eval (eval at Object.<anonymous> (node_modules/botframework-connector/src/index.ts:1:2), <anonymous>:3:13)
  at Object.<anonymous> (node_modules/botframework-connector/src/index.ts:1:213)
  at Object.<anonymous> (node_modules/botbuilder/src/botFrameworkAdapter.ts:10:1)
  at Object.<anonymous> (node_modules/botbuilder/src/index.ts:9:1)
  at Object.<anonymous> (node_modules/express-msteams-host/lib/routers/MsTeamsApiRouter.js:43:20)
  at Object.<anonymous> (node_modules/express-msteams-host/lib/routers/index.js:5:26)
  at Object.<anonymous> (node_modules/express-msteams-host/lib/index.js:9:10)
  at Object.<anonymous> (src/app/server.ts:7:30)
  at Object.<anonymous> (src/app/__tests__/Server.spec.ts:4:16)

Detailed information

  • Generator version: [2.7.1-preview@1]
  • OS: [Windows]
  • Node version: [10.15.3]
  • Npm version: [6.9.0]

Side loading apps

Not sure if I'm doing anything wrong...

When I try to side load tab apps I'm getting the following error message in my Teams log ( similar messages in the interface too:

2017-10-10T09:47:47.914Z Err	AppsTab: Failed to validate app manifest. Error: Error while reading manifest.json: Failed to find icon  "https://myapps.azurewebsites.net/assets/tab-44.png" file in the package Failed to find icon  "https://myapps.azurewebsites.net/assets/tab-88.png" file in the package
2017-10-10T09:47:47.906Z Inf	ExtensionManifestService: Failed in converting package into definition, Error:Failed to find icon  "https://myapps.azurewebsites.net/assets/tab-44.png" file in the package Failed to find icon  "https://myapps.azurewebsites.net/assets/tab-88.png" file in the package
2017-10-10T09:47:47.662Z Inf	AppsTab: Starting upload of tab definition

When I try to do the same with a Bot template I'm getting:

2017-10-10T14:23:29.131Z Err	AppsTab: Failed to validate app manifest. Error: Error while reading manifest.json
2017-10-10T14:23:29.127Z Inf	ExtensionManifestService: Failed in converting package into definition, Error:TypeError: Cannot read property 'mri' of undefined
2017-10-10T14:23:29.125Z Err	Unhandled exception. TypeError: Cannot read property 'mri' of undefined, cause: 
2017-10-10T14:23:29.003Z Inf	AppsTab: Starting upload of tab definition

At this stage I'm not sure if this is a single or multiple problems. It could be a single problem with side loading

Change wording in prompt for URL

PREVIEW generator: The generator prompts for a URL. The URL prompt comes before the selection of components. The prompt is:

"The URL where you will host this tab"

If I am not building a tab, this prompt is confusing.

Add support for Message Handlers

Describe the solution you'd like
Add a new generator with support for message handlers, as specified in schema 1.5 and later.

Another small error in the README.md in the generator

At step 10 the web app name isn't inserted:

  1. Run the following command to set up the remote repository: git remote add azure https://<username>@TeamsTabs.scm.azurewebsites.net:443/TeamsTabs.git. You need to replace with the name of the user you set up in Deployment Credentials. You can also copy the URL from Options in the Azure Web App.

should be:

  1. Run the following command to set up the remote repository: git remote add azure https://<username>@<webappname>.scm.azurewebsites.net:443/<webappname>.git. You need to replace with the name of the user you set up in Deployment Credentials. You can also copy the URL from Options in the Azure Web App.

yeoman-test for ensuring template generation

generator-teams changes should be tested via. yeoman-test package for ensuring, that the the projects can be generated successfully. It should also included in build pipeline.

Create Documentation

Add documentation to the microsoft-teams-docs repository on how to use the generator

Deploy of a bot

Hi Wictor,

i got a issue when i deploy a bot via the bot framework and push it to azure. i get the following error hope you can help a bit

$ git push azure master
Counting objects: 35, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (32/32), done.
Writing objects: 100% (35/35), 27.10 KiB | 0 bytes/s, done.
Total 35 (delta 2), reused 0 (delta 0)
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id '41e411b2e6'.
remote: Running custom deployment command...
remote: Running deployment command...
remote: Handling node.js deployment.
remote: Using start-up script dist/server.js from package.json.
remote: Generated web.config.
remote: The package.json file does not specify node.js engine version constraints.
remote: The node.js application will run with the default node.js version 0.10.28.
remote: Selected npm version 1.4.9
remote: npm WARN package.json [email protected] No repository field.
remote: npm http GET https://registry.npmjs.org/body-parser
remote: npm http GET https://registry.npmjs.org/browser-request
remote: npm http GET https://registry.npmjs.org/express
remote: npm http GET https://registry.npmjs.org/botbuilder
remote: npm http GET https://registry.npmjs.org/express-session
remote: npm http GET https://registry.npmjs.org/gulp
remote: npm http GET https://registry.npmjs.org/gulp-inject
remote: npm http GET https://registry.npmjs.org/gulp-util
remote: npm http GET https://registry.npmjs.org/gulp-zip
remote: npm http GET https://registry.npmjs.org/morgan
remote: npm http GET https://registry.npmjs.org/nodemon
remote: npm http GET https://registry.npmjs.org/run-sequence
remote: npm http GET https://registry.npmjs.org/ts-loader
remote: npm http GET https://registry.npmjs.org/typescript
remote: npm http GET https://registry.npmjs.org/webpack
remote: npm http GET https://registry.npmjs.org/types/body-parser
remote: npm http GET https://registry.npmjs.org/types/express
remote: npm http GET https://registry.npmjs.org/types/morgan
remote: npm http GET https://registry.npmjs.org/types/express-session
remote: npm http 200 https://registry.npmjs.org/browser-request
remote: npm http 200 https://registry.npmjs.org/gulp-inject
remote: npm http 200 https://registry.npmjs.org/gulp-zip
remote: npm http 200 https://registry.npmjs.org/botbuilder
remote: npm http 200 https://registry.npmjs.org/gulp-util
remote: npm http 200 https://registry.npmjs.org/body-parser
remote: npm http 200 https://registry.npmjs.org/morgan
remote: npm http 200 https://registry.npmjs.org/run-sequence
remote: npm http 200 https://registry.npmjs.org/gulp
remote: npm http 200 https://registry.npmjs.org/ts-loader
remote: npm http 200 https://registry.npmjs.org/express-session
remote: npm http GET https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz
remote: npm http GET https://registry.npmjs.org/gulp-inject/-/gulp-inject-4.2.0.tgz
remote: npm http GET https://registry.npmjs.org/gulp-zip/-/gulp-zip-4.0.0.tgz
remote: npm http GET https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz
remote: npm http 200 https://registry.npmjs.org/nodemon
remote: npm http GET https://registry.npmjs.org/botbuilder/-/botbuilder-3.7.0.tgz
remote: npm http GET https://registry.npmjs.org/body-parser/-/body-parser-1.17.1.tgz
remote: npm http GET https://registry.npmjs.org/morgan/-/morgan-1.8.1.tgz
remote: npm http GET https://registry.npmjs.org/run-sequence/-/run-sequence-1.2.2.tgz
remote: npm http 200 https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz
remote: npm http GET https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz
remote: npm http 200 https://registry.npmjs.org/gulp-zip/-/gulp-zip-4.0.0.tgz
remote: npm http 200 https://registry.npmjs.org/gulp-inject/-/gulp-inject-4.2.0.tgz
remote: npm http 200 https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz
remote: npm http 200 https://registry.npmjs.org/body-parser/-/body-parser-1.17.1.tgz
remote: npm http 200 https://registry.npmjs.org/morgan/-/morgan-1.8.1.tgz
remote: npm http 200 https://registry.npmjs.org/run-sequence/-/run-sequence-1.2.2.tgz
remote: npm http 200 https://registry.npmjs.org/botbuilder/-/botbuilder-3.7.0.tgz
remote: npm http 200 https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz
remote: npm http GET https://registry.npmjs.org/ts-loader/-/ts-loader-2.0.3.tgz
remote: npm http GET https://registry.npmjs.org/express-session/-/express-session-1.15.2.tgz
remote: npm http 200 https://registry.npmjs.org/express
remote: npm http GET https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz
remote: npm http 200 https://registry.npmjs.org/ts-loader/-/ts-loader-2.0.3.tgz
remote: npm http 404 https://registry.npmjs.org/types/express
remote: npm http 404 https://registry.npmjs.org/types/body-parser
remote: npm http 404 https://registry.npmjs.org/types/morgan
remote: npm http 200 https://registry.npmjs.org/express-session/-/express-session-1.15.2.tgz
remote: npm http 200 https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz
remote: npm http 404 https://registry.npmjs.org/types/express-session
remote: npm ERR! 404 Not Found
remote: npm ERR! 404
remote: npm ERR! 404 'types/body-parser' is not in the npm registry.
remote: npm ERR! 404 You should bug the author to publish it
remote: npm ERR! 404 It was specified as a dependency of 'demobotsps'
remote: npm ERR! 404
remote: npm ERR! 404 Note that you can also install from a
remote: npm ERR! 404 tarball, folder, or http url, or git url.
remote:
remote: npm ERR! System Windows_NT 6.2.9200
remote: npm ERR! command "D:\Program Files (x86)\nodejs\0.10.28\node.exe" "D:\Program Files (x86)\npm\1.4.9\node_modules\npm\bin\npm-cli.js" "install" "--producti
on"
remote: npm ERR! cwd D:\home\site\repository
remote: npm ERR! node -v v0.10.28
remote: npm ERR! npm -v 1.4.9
remote: npm ERR! code E404
remote: npm http GET https://registry.npmjs.org/express/-/express-4.15.2.tgz
remote: npm http 200 https://registry.npmjs.org/express/-/express-4.15.2.tgz
remote: npm http 200 https://registry.npmjs.org/webpack
remote: npm http GET https://registry.npmjs.org/webpack/-/webpack-2.5.1.tgz
remote: npm http 200 https://registry.npmjs.org/webpack/-/webpack-2.5.1.tgz
remote: npm http 200 https://registry.npmjs.org/typescript
remote: npm http GET https://registry.npmjs.org/typescript/-/typescript-2.3.2.tgz
remote: npm http 200 https://registry.npmjs.org/typescript/-/typescript-2.3.2.tgz
remote: .
remote: Failed exitCode=1, command="D:\Program Files (x86)\nodejs\0.10.28\node.exe" "D:\Program Files (x86)\npm\1.4.9\node_modules\npm\bin\npm-cli.js" install --production
remote: An error has occurred during web site deployment.
remote: npm
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://demobotsps.scm.azurewebsites.net:443/demobotsps.git

  • [new branch] master -> master

Integrating templates for more complex bots

Wictor, today the bot portion of the generator template is pretty basic.

We've been working on a templatized version of a more complex bot we built. The GitHub project for the template is here: https://github.com/OfficeDev/microsoft-teams-template-bot and an example of it is here: https://teams.microsoft.com/l/chat/0/0?users=28:d75efef8-8a73-4b32-b7ad-9a05a7cff408.

Please take a look at the templates though - while I want there to be a more robust bot implementation, having these blank templates in place may be overkill. On the other hand, they don't take up a lot of space. The Yeoman generator itself wouldn't touch them, they would be, in essence, static files.

The project always fail to deploy to azure

Hi team

The generator is so great for teams developers. I really love it.
I found some issue about deploy process. when I follow the guidance by README.md, I always fail with some error message as below

=====================

Counting objects: 50, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (46/46), done.
Writing objects: 100% (50/50), 81.04 KiB | 3.86 MiB/s, done.
Total 50 (delta 9), reused 4 (delta 0)
remote: Updating branch 'master'.
remote: ..
remote: Updating submodules.
remote: Preparing deployment for commit id '2fd733df3e'.
remote: Running custom deployment command...
remote: Running deployment command...
remote: /home/site/repository/deploy.cmd: line 1: @if: command not found
remote: /home/site/repository/deploy.cmd: line 3: ::: command not found
remote: /home/site/repository/deploy.cmd: line 4: ::: command not found
remote: /home/site/repository/deploy.cmd: line 5: ::: command not found
remote: /home/site/repository/deploy.cmd: line 6: ::: command not found
remote: /home/site/repository/deploy.cmd: line 8: ::: command not found
remote: /home/site/repository/deploy.cmd: line 9: ::: command not found
remote: /home/site/repository/deploy.cmd: line 11: ::: command not found
remote: /home/site/repository/deploy.cmd: line 12: nul: Permission denied
remote: /home/site/repository/deploy.cmd: line 13: syntax error near unexpected token (' remote: /home/site/repository/deploy.cmd: line 13: IF %ERRORLEVEL% NEQ 0 ('
remote:
remote: App container will begin restart within 10 seconds.
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://testnodedeploy.scm.azurewebsites.net:443/testnodedeploy.git

  • [new branch] master -> master
    PS C:\Users\arechen\devdaysteamsbotworkshop> git push azure masterEverything up-to-date
    PS C:\Users\arechen\devdaysteamsbotworkshop> git push azure master
    Counting objects: 3, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 281 bytes | 140.00 KiB/s, done.
    Total 3 (delta 2), reused 0 (delta 0)
    remote: Updating branch 'master'.
    remote: Updating submodules.
    remote: Preparing deployment for commit id 'e58fe4b054'.
    remote: Running custom deployment command...
    remote: Running deployment command...
    remote: Handling node.js deployment.
    remote: Using start-up script dist/server.js from package.json.
    remote: Generated web.config.
    remote: The package.json file does not specify node.js engine version constraints.
    remote: The node.js application will run with the default node.js version 6.9.1.
    remote: Selected npm version 3.10.8
    remote: ..
    remote: npm WARN [email protected] No repository field.
    remote: npm WARN [email protected] No license field.
    remote:
    remote: > [email protected] build D:\home\site\repository
    remote: > gulp build
    remote:
    remote: [08:04:13] Local gulp not found in D:\home\site\repository
    remote: [08:04:13] Try running: npm install gulp
    remote:
    remote: npm ERR! Windows_NT 10.0.14393
    remote: npm ERR! argv "D:\Program Files (x86)\nodejs\6.9.1\node.exe" "D:\Program Files (x86)\npm\3.10.8\node_modules\npm\bin\npm-cli.js" "run-script" "build"
    remote: npm ERR! node v6.9.1
    remote: npm ERR! npm v3.10.8
    remote: npm ERR! code ELIFECYCLE
    remote: Failed exitCode=1, command="D:\Program Files (x86)\nodejs\6.9.1\node.exe" "D:\Program Files (x86)\npm\3.10.8\node_modules\npm\bin\npm-cli.js" run-script build
    remote: npm ERR! [email protected] build: gulp build
    remote: An error has occurred during web site deployment.
    remote: npm ERR! Exit status 1
    remote: npm ERR!
    remote: npm ERR! Failed at the [email protected] build script 'gulp build'.
    remote: npm ERR! Make sure you have the latest version of node.js and npm installed.
    remote: npm ERR! If you do, this is most likely a problem with the devdaysteamsbotworkshop package,
    remote: npm ERR! not with npm itself.
    remote: npm ERR! Tell the author that this fails on your system:
    remote: npm ERR! gulp build
    remote: npm ERR! You can get information on how to open an issue for this project with:remote: npm ERR! npm bugs devdaysteamsbotworkshop
    remote: npm ERR! Or if that isn't available, you can get their info via:
    remote: npm ERR! npm owner ls devdaysteamsbotworkshop
    remote: npm ERR! There is likely additional logging output above.
    remote:
    remote: npm ERR! Please include the following file with any support request:
    remote: npm ERR! D:\home\site\repository\npm-debug.log
    remote:
    remote: Error - Changes committed to remote repository but deployment to website failed.

Advanced configuration option

Is your feature request related to a problem? Please describe.
Adding more and more functionality is going to make the generator even more complex and give the users a lot of questions. Adding an option to go to run using advanced settings could make this easier

Describe the solution you'd like
Add a a question as one of the initial questions that asks the user if they want to run advanced setup.

The provided value "./dist/web/scripts" is not an absolute path!

I'm getting an error when running the webpack build "The provided value "./dist/web/scripts" is not an absolute path , same for /dist "
I've found that can be worked around via appending __dirname + in the right place in the webpack.config.
Couldn't see any contribution guidelines so figured would log it as a bug, but happy to fork and submit as pull request if that is helpful.

Can't set headers after they are sent

Any request to the generated bot seems to throw the following exception:

Error: Can't set headers after they are sent.
    at validateHeader (_http_outgoing.js:491:11)
    at ServerResponse.setHeader (_http_outgoing.js:498:3)
    at C:\Users\coats\source\repos\yo-teams-test\dist\server.js:113:9
    at Layer.handle [as handle_request] (C:\Users\coats\source\repos\yo-teams-test\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\coats\source\repos\yo-teams-test\node_modules\express\lib\router\index.js:317:13)
    at C:\Users\coats\source\repos\yo-teams-test\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\coats\source\repos\yo-teams-test\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\coats\source\repos\yo-teams-test\node_modules\express\lib\router\index.js:275:10)
    at next (C:\Users\coats\source\repos\yo-teams-test\node_modules\express\lib\router\route.js:127:14)
    at C:\Users\coats\source\repos\yo-teams-test\node_modules\botbuilder\lib\bots\ChatConnector.js:481:21

Then the request seems to be served appropriately

Generated MessageExtension: non static host

Hi,

shouldn't the generated MessageExtension rather use the HOSTNAME from the .env instead of a static one which is being asked during the generation ?

If you switch the host in .env when doing local testing or debugging with ngrok it still uses the static value you entered in the initial generation process.

File: /src/messageExtension/templates/src/app/{messageExtensionName}/{messageExtensionClassName}.ts
Line: 15 + 43

Add Azure AD SSO support to Tabs

Is your feature request related to a problem? Please describe.
Add Azure AD SSO support to Tabs

Describe the solution you'd like
A great SSO experience for end-users

Add AppInsights support

Is your feature request related to a problem? Please describe.
Detailed statistics and monitoring of the solution would be a great addition

Describe the solution you'd like
Add support for specifying an AppInsights logging key

Tab project cannot be compiled on 2.7.0-preview3

TS2322: Type '{ theme: ThemeStyle; fontSize: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'.
Property 'theme' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.