diff --git a/package-lock.json b/package-lock.json index 6a049a9..0ef8cc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,13 @@ { "name": "communication-services-web-chat-hero", "version": "1.0.0", - "lockfileVersion": 1 + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "communication-services-web-chat-hero", + "version": "1.0.0", + "license": "MIT" + } + } } diff --git a/package.json b/package.json index 5855941..f86174e 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,14 @@ "description": "--- page_type: sample languages: - javascript - nodejs - products: - azure - azure-communication-services ---", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "setup": "cd Server && npm install && cd ../Chat && npm install && cd ..", - "start": "cd Chat && npm run start && cd ..", - "build": "cd Server && npm run build && cd ../Chat && npm run build && cd ..", - "package": "cd Chat && npm run package && cd .." + "setup:chat": "cd Chat && npm install", + "setup:server": "cd Server && npm install", + "setup": "npm run setup:chat && npm run setup:server", + "start": "node startChat.js", + "build:chat": "cd Chat && npm run build", + "build:server": "cd Server && npm run build", + "build": "npm run build:chat && npm run build:server", + "package": "cd Chat && npm run package" }, "repository": { "type": "git", diff --git a/startChat.js b/startChat.js new file mode 100644 index 0000000..270ee01 --- /dev/null +++ b/startChat.js @@ -0,0 +1,12 @@ +const { spawn } = require('child_process'); + +// This script will spawn a new process to run the npm start command inside the Chat directory. +const child = spawn('npm', ['run', 'start'], { + stdio: 'inherit', + cwd: './Chat', + shell: true +}); + +child.on('exit', (code) => { + process.exit(code); +});