Skip to content

Commit 4227c0a

Browse files
rido-minJhontSouth
andauthored
Add VSCode build/debug seetings and ESLint (#71)
* Add ESLint configuration and scripts for code quality checks * Refactor launch configurations and tasks for copilotstudio-client; add environment template * Update CI workflow to set working directory for linting and dependency installation in samples * Replace ESLint configuration with neostandard; update lint script and clean up code formatting * Add README.md for M365 Agents SDK Samples with debugging instructions * Add samples list to README.md for better navigation and clarity * Update sample links in README.md for improved navigation * Update samples table in README.md for consistency in column headers * Fix endpoint URL format in manifest.template.json by removing the protocol prefix * Add post-create command and recommended extensions for development container * Install OpenSSH server in post-create command for improved development environment setup * Fix typo in postCreateCommand.sh for xdg-utils installation * Update devcontainer image version and add new VS Code extensions * Update devcontainer image and add TypeScript and Deno features * Add ESLint extension to development container configuration * Refactor VS Code configurations and update package import syntax for improved project structure * Migrate Node.js project to TypeScript and restructure build process * Add cards bot sample (#68) * add cards bot sample * remove action card --------- Co-authored-by: Rido <rido-min@users.noreply.github.com> * Add prebuild and prestart scripts, and configure VS Code launch and tasks for Node.js samples * Add build steps for Cards bot and Skill bot in CI workflow * Remove VS Code configuration from .gitignore and add node-samples workspace file --------- Co-authored-by: Jhonatan Sandoval Velasco <122501764+JhontSouth@users.noreply.github.com>
1 parent 8bf0927 commit 4227c0a

35 files changed

+4332
-124
lines changed

.devcontainer/devcontainer.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
"features": {
77
"ghcr.io/devcontainers/features/azure-cli:1": {},
88
"ghcr.io/devcontainers/features/powershell:1": {},
9-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
10-
"ghcr.io/stuartleeks/dev-container-features/dev-tunnels:0": {}
9+
"ghcr.io/stuartleeks/dev-container-features/dev-tunnels:0": {},
10+
"ghcr.io/devcontainers-community/npm-features/typescript:1": {},
11+
"ghcr.io/devcontainers-extra/features/deno:1": {}
1112
},
1213
"customizations": {
1314
"vscode": {
1415
"extensions": [
1516
"GitHub.copilot-chat",
16-
"TeamsDevApp.vscode-adaptive-cards"
17+
"TeamsDevApp.vscode-adaptive-cards",
18+
"ms-dotnettools.csdevkit",
19+
"github.vscode-github-actions",
20+
"dbaeumer.vscode-eslint"
1721
]
1822
}
19-
}
23+
},
24+
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh"
2025
}

.devcontainer/postCreateCommand.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sudo apt update
2+
3+
sudo DEBIAN_FRONTEND=noninteractive \
4+
UCF_FORCE_CONFFOLD=1 \
5+
UCF_FORCE_CONFDEF=1 \
6+
apt -o Dpkg::Options::="--force-confdef" \
7+
-o Dpkg::Options::="--force-confold" \
8+
install openssh-server -y
9+
10+
sudo apt upgrade -y
11+
sudo apt install xdg-utils -y

.github/workflows/ci-node.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,34 @@ jobs:
1919
with:
2020
node-version: 22
2121

22-
- name: Build echo bot
22+
- name: Install dependencies
23+
run: npm install
24+
working-directory: ./samples
25+
26+
- name: Run lint
27+
run: npm run lint
28+
working-directory: ./samples
29+
30+
- name: Build Echo bot
2331
working-directory: ./samples/basic/echo-bot/nodejs/
2432
run: |
2533
npm install
2634
npm run build
2735
36+
- name: Build Cards bot
37+
working-directory: ./samples/basic/cards/nodejs/
38+
run: |
39+
npm install
40+
npm run build
41+
2842
- name: Build Copilot Studio client sample
2943
working-directory: ./samples/basic/copilotstudio-client/nodejs/
44+
run: |
45+
npm install
46+
npm run build
47+
48+
- name: Build Skill bot
49+
working-directory: ./samples/complex/copilotstudio-skill/nodejs/
3050
run: |
3151
npm install
3252
npm run build

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,6 @@ MigrationBackup/
376376
# Fody - auto-generated XML schema
377377
FodyWeavers.xsd
378378

379-
# VS Code files for those working on multiple tools
380-
.vscode/*
381-
!.vscode/settings.json
382-
!.vscode/tasks.json
383-
!.vscode/launch.json
384-
!.vscode/extensions.json
385-
*.code-workspace
386-
387379
# Local History for Visual Studio Code
388380
.history/
389381

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"github.copilot-chat",
5+
"github.codespaces",
6+
"ms-dotnettools.csdevkit",
7+
"teamsdevapp.vscode-adaptive-cards"
8+
]
9+
}

.vscode/launch.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

node-samples.code-workspace

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "samples/basic/echo-bot/nodejs",
5+
"name" : "echo bot"
6+
},
7+
{
8+
"path": "samples/basic/cards/nodejs",
9+
"name": "cards"
10+
},
11+
{
12+
"path": "samples/basic/copilotstudio-client/nodejs",
13+
"name": "copilotstudio-client"
14+
},
15+
{
16+
"path" : "samples/complex/copilotstudio-skill/nodejs",
17+
"name": "copilotstudio-skill"
18+
}
19+
]
20+
}

samples/.vscode/launch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
]
8+
}

samples/.vscode/tasks.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": []
4+
}

samples/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# M365 Agents SDK Samples
2+
3+
To enable debugging, open this folder using Visual Studio Code (VSCode). Follow these steps:
4+
5+
1. Launch VSCode.
6+
2. Select `File` > `Open Folder...`.
7+
3. Navigate to the `/workspaces/Agents/samples` directory and open it.
8+
4. Once the folder is open, you can start debugging by setting breakpoints and running the samples.
9+
10+
## Samples list
11+
12+
|Category | Name | Description | node | dotnet | python |
13+
|---------|-------------|-------------|--------|--------|--------|
14+
| Basic | Echo Bot | Simplest bot | [basic/echo-bot/nodejs](./basic/echo-bot/nodejs) | TBD | TBD |
15+
| Basic | Copilot Studio Client | Consume CopilotStudio Agent | [basic/copilotstudio-client/nodejs](./basic/copilotstudio-client/nodejs) | TBD | TBD |
16+
| Complex | Copilot Studio Skill | Call the echo bot from a Copilot Studio skill | [complex/copilotstudio-skill/nodejs](./complex/copilotstudio-skill/nodejs) | TBD | TBD |

0 commit comments

Comments
 (0)