Skip to content

Commit

Permalink
Migrate Node.js project to TypeScript and restructure build process
Browse files Browse the repository at this point in the history
  • Loading branch information
rido-min committed Feb 24, 2025
1 parent 1f94fd9 commit fc215ba
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/src/index.js"
"program": "${workspaceFolder}/src/index.js",
"preLaunchTask": "npm: build echo-bot-skill"
}
]
}
15 changes: 15 additions & 0 deletions samples/complex/copilotstudio-skill/nodejs/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"label": "npm: build echo-bot-skill"
}
]
}
6 changes: 3 additions & 3 deletions samples/complex/copilotstudio-skill/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "node-echo-skill",
"version": "1.0.0",
"main": "index.js",
"type": "module",
"scripts": {
"lint": "eslint src",
"start": "node --env-file .env src/index.js"
"prebuild": "npm install",
"build": "tsc --build",
"start": "node --env-file .env dist/index.js"
},
"keywords": [],
"author": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// @ts-check

import { ActivityHandler, MessageFactory } from '@microsoft/agents-bot-hosting'
import pjson from '@microsoft/agents-bot-hosting/package.json' with { type: 'json' }
import pjson from '@microsoft/agents-bot-hosting/package.json'

export class EchoBot extends ActivityHandler {
constructor () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-check
import express, { json } from 'express'

import { CloudAdapter, loadAuthConfigFromEnv, authorizeJWT } from '@microsoft/agents-bot-hosting'
import pjson from '@microsoft/agents-bot-hosting/package.json' with { type: 'json' }
import pjson from '@microsoft/agents-bot-hosting/package.json'

import { EchoBot } from './bot.js'

Expand Down
20 changes: 20 additions & 0 deletions samples/complex/copilotstudio-skill/nodejs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"incremental": true,
"lib": ["ES2021"],
"target": "es2019",
"module": "commonjs",
"declaration": true,
"sourceMap": true,
"composite": true,
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo"
}
}

0 comments on commit fc215ba

Please sign in to comment.