Skip to content

Commit 3b459ac

Browse files
committed
chore: update packages
1 parent f3d3a20 commit 3b459ac

File tree

10 files changed

+615
-751
lines changed

10 files changed

+615
-751
lines changed

package-lock.json

Lines changed: 539 additions & 722 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/agent-api/.env.sample

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

packages/agent-api/package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
{
2-
"name": "api",
2+
"name": "agent-api",
33
"version": "1.0.0",
4-
"description": "Azure Functions API for the serverless burger agent sample",
5-
"main": "dist/src/functions/*.js",
4+
"description": "Azure Functions API for Contoso Burgers AI Agent",
5+
"private": true,
6+
"main": "./dist/src/functions/*.js",
67
"scripts": {
78
"build": "tsc",
89
"watch": "tsc -w",
910
"clean": "rimraf dist",
1011
"prestart": "npm run clean && npm run build",
1112
"start:host": "func start --port 7072",
12-
"start": "concurrently npm:start:host npm:watch --raw --kill-others"
13+
"start": "concurrently npm:start:* npm:watch --raw --kill-others",
14+
"update:local-settings": "node ./scripts/update-local-settings.mjs",
15+
"postinstall": "npm run update:local-settings"
1316
},
1417
"author": "Microsoft",
1518
"license": "MIT",
@@ -28,8 +31,8 @@
2831
"uuid": "^11.0.3"
2932
},
3033
"devDependencies": {
31-
"@types/node": "^20.x",
32-
"azure-functions-core-tools": "^4.0.5611",
33-
"typescript": "^5.4.4"
34+
"@types/node": "^20",
35+
"azure-functions-core-tools": "^4",
36+
"typescript": "^5"
3437
}
3538
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env node
2+
/*
3+
* Creates local.settings.json file for the Azure Functions.
4+
* Uses .env file for loading environment variables.
5+
* Usage: update-local-settings.mjs
6+
*/
7+
8+
import process from 'node:process';
9+
import path from 'node:path';
10+
import { writeFileSync } from 'node:fs';
11+
import { fileURLToPath } from 'node:url';
12+
import dotenv from 'dotenv';
13+
14+
const __filename = fileURLToPath(import.meta.url);
15+
const __dirname = path.dirname(__filename);
16+
17+
// Env file is located in the root of the repository
18+
dotenv.config({ path: path.join(__dirname, '../../../.env') });
19+
20+
let settings = {
21+
FUNCTIONS_WORKER_RUNTIME: 'node',
22+
AzureWebJobsFeatureFlags: 'EnableWorkerIndexing',
23+
AzureWebJobsStorage: 'UseDevelopmentStorage=true',
24+
};
25+
const settingsFilePath = path.join(__dirname, '../local.settings.json');
26+
27+
console.log('Setting Azure AI service values...');
28+
settings = {
29+
...settings,
30+
AZURE_OPENAI_API_VERSION: process.env.AZURE_OPENAI_API_VERSION,
31+
AZURE_OPENAI_INSTANCE_NAME: process.env.AZURE_OPENAI_INSTANCE_NAME,
32+
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: process.env.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME,
33+
AZURE_OPENAI_ENDPOINT: process.env.AZURE_OPENAI_ENDPOINT,
34+
};
35+
36+
console.log('Setting Cosmos DB service values...');
37+
settings = {
38+
...settings,
39+
AZURE_COSMOSDB_NOSQL_ENDPOINT: process.env.AZURE_COSMOSDB_NOSQL_ENDPOINT,
40+
};
41+
42+
writeFileSync(
43+
settingsFilePath,
44+
JSON.stringify(
45+
{
46+
IsEncrypted: false,
47+
Values: settings,
48+
},
49+
null,
50+
2,
51+
),
52+
);
53+
console.log('local.settings.json file updated successfully.');

packages/agent-webapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "agent-webapp",
33
"version": "1.0.0",
4-
"description": "Burger ordering web app with AI chat assistant",
4+
"description": "Contoso Burgers AI Agent web application",
55
"private": true,
66
"type": "module",
77
"scripts": {

packages/agent-webapp/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import process from 'node:process';
22
import { defineConfig } from 'vite';
33

44
// Expose environment variables to the client
5-
process.env.VITE_API_URL = process.env.API_URL ?? '';
6-
console.log(`Using chat API base URL: "${process.env.VITE_API_URL}"`);
5+
process.env.VITE_AGENT_API_URL = process.env.AGENT_API_URL_OVERRIDE ?? '';
6+
console.log(`Using chat API base URL: "${process.env.VITE_AGENT_API_URL}"`);
77

88
export default defineConfig({
99
build: {

packages/burger-api/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "burger-api",
33
"version": "1.0.0",
4+
"description": "Azure Functions API for Contoso Burgers",
45
"private": true,
56
"main": "./dist/src/functions/*.js",
67
"scripts": {

packages/burger-api/scripts/update-local-settings.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import process from 'node:process';
99
import path from 'node:path';
10-
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
10+
import { writeFileSync } from 'node:fs';
1111
import { fileURLToPath } from 'node:url';
1212
import dotenv from 'dotenv';
1313

packages/burger-mcp/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "burger-mcp",
33
"version": "1.0.0",
4+
"description": "Model Context Protocol (MCP) server for Contoso Burgers API",
45
"private": true,
56
"type": "module",
67
"exports": "./lib/local.js",
@@ -25,10 +26,10 @@
2526
},
2627
"devDependencies": {
2728
"@types/express": "^5.0.0",
28-
"@types/node": "^20.11.24",
29+
"@types/node": "^20",
2930
"rimraf": "^6.0.1",
30-
"tsx": "^4.19.3",
31-
"typescript": "^5.3.3"
31+
"tsx": "^4",
32+
"typescript": "^5"
3233
},
3334
"engines": {
3435
"node": ">=22.0.0"

packages/burger-webapp/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "burger-webapp",
3+
"description": "Web dashboard for displaying Contoso Burgers orders",
34
"private": true,
4-
"version": "0.0.0",
5+
"version": "1.0.0",
56
"type": "module",
67
"scripts": {
78
"start": "concurrently npm:serve:* --raw --kill-others",
@@ -17,9 +18,9 @@
1718
"lit": "^3.3.0"
1819
},
1920
"devDependencies": {
20-
"concurrently": "^9.1.2",
21+
"concurrently": "^9",
2122
"smoke": "^4.0.0",
22-
"typescript": "~5.8.3",
23+
"typescript": "^5",
2324
"vite": "^7.0.0"
2425
}
2526
}

0 commit comments

Comments
 (0)