Skip to content

Commit

Permalink
chore: move Teams chef sample to local repo (#931)
Browse files Browse the repository at this point in the history
* chore: add teams chef bot sample

* chore: update online config

* ci: update code owners
  • Loading branch information
HuihuiWu-Microsoft committed Jun 25, 2023
1 parent 406af3f commit f6d8eb8
Show file tree
Hide file tree
Showing 29 changed files with 1,081 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .config/samples-config-v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,7 @@
],
"time": "5min to run",
"configuration": "Manual configurations required",
"suggested": false,
"url": "https://github.com/OfficeDev/teams-chef-sample/tree/main/teams-chef-bot",
"packageLink": "https://github.com/OfficeDev/teams-chef-sample/archive/refs/heads/main.zip",
"relativePath": "teams-chef-sample-main/teams-chef-bot"
"suggested": false
}
]
}
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@
/todo-list-with-Azure-backend @adashen @formulahendry
/todo-list-with-Azure-backend-M365 @kimizhu @swatDong @kuojianlu
/developer-assist-dashboard @eriolchan @huimiu @hund030 @JerryYangKai
/whos-next-meeting-app @MSFT-yiz @HuihuiWu-Microsoft
/teams-chef-bot @MSFT-yiz @HuihuiWu-Microsoft
/.github/workflows/cd.yml @adashen @LongOddCode @Siglud @qinezh @wenytang-ms
8 changes: 8 additions & 0 deletions teams-chef-bot/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bin
build
demo-packages
dist
manifest
node_modules
package-lock.json
docs/assets/main.js
75 changes: 75 additions & 0 deletions teams-chef-bot/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"parser": "@typescript-eslint/parser",
"root": true,
"env": {
"browser": true,
"node": true,
"es2015": true,
"mocha": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:import/recommended",
"plugin:jsdoc/recommended",

"plugin:security/recommended",
"plugin:prettier/recommended" // Recommended to be last
// Currently sample contains no frontend
// "plugin:react/recommended",
// "plugin:react/jsx-runtime"
],
"plugins": [
"@typescript-eslint",
"jsdoc",

"mocha",
"only-warn",
"prettier"
// "react"
],
"parserOptions": {
"ecmaVersion": 2015,
// Allows for the parsing of modern ECMAScript features
"sourceType": "module" // Allows for the use of imports
// "ecmaFeatures": {
// "jsx": true
// }
},
"rules": {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"lodash/prefer-includes": "off",
"no-async-promise-executor": "off",
"no-constant-condition": "off",
"no-undef": "off", // Disabled due to conflicts with @typescript/eslint
"no-unused-vars": "off", // Disabled due to conflicts with @typescript/eslint
"prettier/prettier": "error"
// Currently sample contains no frontend
// "react/react-in-jsx-scope": "off",
// "react/prop-types": "off"
},
"overrides": [
{
"files": ["bin/*.js", "lib/*.js"]
}
],
"ignorePatterns": ["node_modules/*"],
"settings": {
// "react": {
// "version": "detect"
// }
}
}
14 changes: 14 additions & 0 deletions teams-chef-bot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.env
.deployment
*.zip

# TeamsFx files
env/.env.*.user
env/.env.local
build
appPackage/build
.localSettings
.notification.localstore.json

/node_modules
/lib
7 changes: 7 additions & 0 deletions teams-chef-bot/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bin
build
demo-packages
dist
manifest
node_modules
package-lock.json
11 changes: 11 additions & 0 deletions teams-chef-bot/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"arrowParens": "always",
"endOfLine": "auto",
"printWidth": 120,
"semi": true,
"singleAttributePerLine": false,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "none",
"useTabs": false
}
95 changes: 95 additions & 0 deletions teams-chef-bot/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Remote (Edge)",
"type": "pwa-msedge",
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
"presentation": {
"group": "remote",
"order": 1
},
"internalConsoleOptions": "neverOpen"
},
{
"name": "Launch Remote (Chrome)",
"type": "pwa-chrome",
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
"presentation": {
"group": "remote",
"order": 2
},
"internalConsoleOptions": "neverOpen"
},
{
"name": "Launch App (Edge)",
"type": "pwa-msedge",
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${{local:TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
"cascadeTerminateToConfigurations": [
"Attach to Local Service"
],
"presentation": {
"group": "all",
"hidden": true
},
"internalConsoleOptions": "neverOpen"
},
{
"name": "Launch App (Chrome)",
"type": "pwa-chrome",
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${{local:TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
"cascadeTerminateToConfigurations": [
"Attach to Local Service"
],
"presentation": {
"group": "all",
"hidden": true
},
"internalConsoleOptions": "neverOpen"
},
{
"name": "Attach to Local Service",
"type": "pwa-node",
"request": "attach",
"port": 9239,
"restart": true,
"presentation": {
"group": "all",
"hidden": true
},
"internalConsoleOptions": "neverOpen"
}
],
"compounds": [
{
"name": "Debug (Edge)",
"configurations": [
"Launch App (Edge)",
"Attach to Local Service"
],
"preLaunchTask": "Start Teams App Locally",
"presentation": {
"group": "all",
"order": 1
},
"stopAll": true
},
{
"name": "Debug (Chrome)",
"configurations": [
"Launch App (Chrome)",
"Attach to Local Service"
],
"preLaunchTask": "Start Teams App Locally",
"presentation": {
"group": "all",
"order": 2
},
"stopAll": true
}
]
}
11 changes: 11 additions & 0 deletions teams-chef-bot/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"debug.onTaskErrors": "abort",
"json.schemas": [
{
"fileMatch": [
"/aad.*.json"
],
"schema": {}
}
]
}
105 changes: 105 additions & 0 deletions teams-chef-bot/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// This file is automatically generated by Teams Toolkit.
// The teamsfx tasks defined in this file require Teams Toolkit version >= 5.0.0.
// See https://aka.ms/teamsfx-tasks for details on how to customize each task.
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Teams App Locally",
"dependsOn": [
"Validate prerequisites",
"Start local tunnel",
"Provision",
"Deploy",
"Start application"
],
"dependsOrder": "sequence"
},
{
// Check all required prerequisites.
// See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args.
"label": "Validate prerequisites",
"type": "teamsfx",
"command": "debug-check-prerequisites",
"args": {
"prerequisites": [
"nodejs", // Validate if Node.js is installed.
"m365Account", // Sign-in prompt for Microsoft 365 account, then validate if the account enables the sideloading permission.
"portOccupancy" // Validate available ports to ensure those debug ones are not occupied.
],
"portOccupancy": [
3978, // app service port
9239 // app inspector port for Node.js debugger
]
}
},
{
// Start the local tunnel service to forward public URL to local port and inspect traffic.
// See https://aka.ms/teamsfx-tasks/local-tunnel for the detailed args definitions.
"label": "Start local tunnel",
"type": "teamsfx",
"command": "debug-start-local-tunnel",
"args": {
"type": "dev-tunnel",
"ports": [
{
"portNumber": 3978,
"protocol": "http",
"access": "public",
"writeToEnvironmentFile": {
"endpoint": "BOT_ENDPOINT", // output tunnel endpoint as BOT_ENDPOINT
"domain": "BOT_DOMAIN" // output tunnel domain as BOT_DOMAIN
}
}
],
"env": "local"
},
"isBackground": true,
"problemMatcher": "$teamsfx-local-tunnel-watch"
},
{
// Create the debug resources.
// See https://aka.ms/teamsfx-tasks/provision to know the details and how to customize the args.
"label": "Provision",
"type": "teamsfx",
"command": "provision",
"args": {
"env": "local"
}
},
{
// Build project.
// See https://aka.ms/teamsfx-tasks/deploy to know the details and how to customize the args.
"label": "Deploy",
"type": "teamsfx",
"command": "deploy",
"args": {
"env": "local"
}
},
{
"label": "Start application",
"type": "shell",
"command": "yarn dev:teamsfx",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": {
"pattern": [
{
"regexp": "^.*$",
"file": 0,
"location": 1,
"message": 2
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "[nodemon] starting",
"endsPattern": "restify listening to|Bot/ME service listening at|[nodemon] app crashed"
}
}
}
]
}
Loading

0 comments on commit f6d8eb8

Please sign in to comment.