From 7905bf1a8aa99cfa0d45013a2852ddf36c263484 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 23 Oct 2024 15:54:43 +0530 Subject: [PATCH 1/8] Enable livekit plugin --- .env | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 6b3e9013d81..ebc0ebd5be3 100644 --- a/.env +++ b/.env @@ -12,4 +12,6 @@ REACT_CARE_API_URL=https://careapi.ohc.network # Dev envs ESLINT_NO_DEV_ERRORS=true CARE_CDN_URL="https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com http://localhost:4566" -REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn" \ No newline at end of file +REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn" + +REACT_ENABLED_APPS="ohcnetwork/care_livekit_fe@main" From ce8d4aa388463626c912ac17ae498ff1f3f88395 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 23 Oct 2024 15:59:56 +0530 Subject: [PATCH 2/8] update dockerfile to install git --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3a96ab3c28a..8180806abb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then apt-get update && apt-get install -y python3-dev make g++; fi +RUN if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then apt-get update && apt-get install -y python3-dev make g++ git; fi COPY package.json package-lock.json ./ From c747c828c7b404ff6cf2097da6e6cf16539a77d2 Mon Sep 17 00:00:00 2001 From: Vysakh Premkumar <84713473+tellmeY18@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:22:37 +0530 Subject: [PATCH 3/8] fixed docker build Replaced git-get with native git. --- scripts/setup-care-apps.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/setup-care-apps.js b/scripts/setup-care-apps.js index 4106775e63e..a90e08e2056 100644 --- a/scripts/setup-care-apps.js +++ b/scripts/setup-care-apps.js @@ -33,12 +33,20 @@ const installApp = (app) => { const appDir = path.join(appsDir, app.package.split("/")[1]); console.log(`Cloning ${app.package}...`); + + // Form the clone URL + const cloneUrl = `https://github.com/${app.package.replace("github:", "")}.git`; + + // Use git clone instead of gitget to ensure .git folder is present + const branchOption = app.branch ? `--branch ${app.branch}` : ""; + execSync( - `npx -y gitget ${app.package}${app.branch ? `#${app.branch}` : ""} apps/${app.package.split("/")[1]} `, + `git clone ${branchOption} ${cloneUrl} ${appDir}`, { stdio: "inherit", }, ); + // Create a care-package.lock file fs.writeFileSync( path.join(appDir, "care-package.lock"), From c6d53acfba3b40329db2fc1d0fc96d5dbe94acd8 Mon Sep 17 00:00:00 2001 From: Vysakh Premkumar <84713473+tellmeY18@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:42:25 +0530 Subject: [PATCH 4/8] replaced native git with simple-git Added NPM package simple-git to perform git clone. --- package-lock.json | 159 +++++++------------------------------ package.json | 3 +- scripts/setup-care-apps.js | 59 +++++++------- 3 files changed, 62 insertions(+), 159 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd7bb8423c6..b31f240d8cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,6 +55,7 @@ "react-pdf": "^9.1.0", "react-webcam": "^7.2.0", "rehype-raw": "^6.1.1", + "simple-git": "^3.27.0", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", @@ -110,6 +111,7 @@ "apps/care_livekit_fe": { "name": "care-livekit", "version": "0.0.1", + "extraneous": true, "license": "ISC", "dependencies": { "@livekit/components-react": "^2.6.2", @@ -1886,11 +1888,6 @@ "node": ">=6.9.0" } }, - "node_modules/@bufbuild/protobuf": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz", - "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==" - }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -2791,63 +2788,20 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@livekit/components-core": { - "version": "0.11.9", - "resolved": "https://registry.npmjs.org/@livekit/components-core/-/components-core-0.11.9.tgz", - "integrity": "sha512-LPE1BZ+YTaqsVqGy/GAlpiO5rEI8XpEaf1TQcGdZN1BCBas9hTHt7/aHMbHQJ0K5xuAFQx8is6dFe451T4qXIQ==", + "node_modules/@kwsites/file-exists": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", + "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", + "license": "MIT", "dependencies": { - "@floating-ui/dom": "1.6.11", - "loglevel": "1.9.1", - "rxjs": "7.8.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "livekit-client": "^2.5.7", - "tslib": "^2.6.2" + "debug": "^4.1.1" } }, - "node_modules/@livekit/components-react": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@livekit/components-react/-/components-react-2.6.5.tgz", - "integrity": "sha512-G3BpBlKy+lWTV9MH3/oBTBC17Z8CWqZ9GnjcG/xmYI0IvqmY89tVWph7cj2Bq0taniA+mD3U9EMPr68fOb1m1g==", - "dependencies": { - "@livekit/components-core": "0.11.9", - "clsx": "2.1.1", - "usehooks-ts": "3.1.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@livekit/krisp-noise-filter": "^0.2.12", - "livekit-client": "^2.5.7", - "react": ">=18", - "react-dom": ">=18", - "tslib": "^2.6.2" - }, - "peerDependenciesMeta": { - "@livekit/krisp-noise-filter": { - "optional": true - } - } - }, - "node_modules/@livekit/components-styles": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@livekit/components-styles/-/components-styles-1.1.4.tgz", - "integrity": "sha512-QCupn7tQ/dy/WZclrfsgtDe8peiGYS6Ied1IGkKOysaXo04l90t62SIUTKyxgd0dNDhUDC0p34qCggGZs/44lQ==", - "engines": { - "node": ">=18" - } - }, - "node_modules/@livekit/protocol": { - "version": "1.24.0", - "resolved": "https://registry.npmjs.org/@livekit/protocol/-/protocol-1.24.0.tgz", - "integrity": "sha512-9dCsqnkMn7lvbI4NGh18zhLDsrXyUcpS++TEFgEk5Xv1WM3R2kT3EzqgL1P/mr3jaabM6rJ8wZA/KJLuQNpF5w==", - "dependencies": { - "@bufbuild/protobuf": "^1.10.0" - } + "node_modules/@kwsites/promise-deferred": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", + "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", + "license": "MIT" }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", @@ -6593,10 +6547,6 @@ "node": ">=6" } }, - "node_modules/care-livekit": { - "resolved": "apps/care_livekit_fe", - "link": true - }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -11692,26 +11642,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/livekit-client": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/livekit-client/-/livekit-client-2.5.9.tgz", - "integrity": "sha512-oDpK6SKYB1F+mNO+25DA0bF0cD2XoOJeD8ji4YQpzDBQv2IxeyKrQhoqXAqrYgIKuiMNkImSf+yg2v7EHSl4Og==", - "dependencies": { - "@livekit/protocol": "1.24.0", - "events": "^3.3.0", - "loglevel": "^1.8.0", - "sdp-transform": "^2.14.1", - "ts-debounce": "^4.0.0", - "tslib": "2.7.0", - "typed-emitter": "^2.1.0", - "webrtc-adapter": "^9.0.0" - } - }, - "node_modules/livekit-client/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" - }, "node_modules/load-plugin": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-6.0.3.tgz", @@ -11823,6 +11753,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true, "license": "MIT" }, "node_modules/lodash.isplainobject": { @@ -11917,18 +11848,6 @@ "node": ">=8" } }, - "node_modules/loglevel": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.1.tgz", - "integrity": "sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==", - "engines": { - "node": ">= 0.6.0" - }, - "funding": { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/loglevel" - } - }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -17184,14 +17103,6 @@ "integrity": "sha512-d7wDPgDV3DDiqulJjKiV2865wKsJ34YI+NDREbm+FySq6WuKOikwyNQcm+doLAZ1O6ltdO0SeKle2xMpN3Brgw==", "license": "MIT" }, - "node_modules/sdp-transform": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.2.tgz", - "integrity": "sha512-icY6jVao7MfKCieyo1AyxFYm1baiM+fA00qW/KrNNVlkxHAd34riEKuEkUe4bBb3gJwLJZM+xT60Yj1QL8rHiA==", - "bin": { - "sdp-verify": "checker.js" - } - }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -17441,6 +17352,21 @@ "simple-concat": "^1.0.0" } }, + "node_modules/simple-git": { + "version": "3.27.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.27.0.tgz", + "integrity": "sha512-ivHoFS9Yi9GY49ogc6/YAi3Fl9ROnF4VyubNylgCkA+RVqLaKWnDSzXOVzya8csELIaWaYNutsEuAhZrtOjozA==", + "license": "MIT", + "dependencies": { + "@kwsites/file-exists": "^1.1.1", + "@kwsites/promise-deferred": "^1.1.1", + "debug": "^4.3.5" + }, + "funding": { + "type": "github", + "url": "https://github.com/steveukx/git-js?sponsor=1" + } + }, "node_modules/size-sensor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/size-sensor/-/size-sensor-1.0.2.tgz", @@ -18517,11 +18443,6 @@ "typescript": ">=4.2.0" } }, - "node_modules/ts-debounce": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ts-debounce/-/ts-debounce-4.0.0.tgz", - "integrity": "sha512-+1iDGY6NmOGidq7i7xZGA4cm8DAa6fqdYcvO5Z6yBevH++Bdo9Qt/mN0TzHUgcCcKv1gmh9+W5dHqz8pMWbCbg==" - }, "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", @@ -18702,14 +18623,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typed-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/typed-emitter/-/typed-emitter-2.1.0.tgz", - "integrity": "sha512-g/KzbYKbH5C2vPkaXGu8DJlHrGKHLsM25Zg9WuC9pMGfuvT+X25tZQWo5fK1BjBm8+UrVE9LDCvaY0CQk+fXDA==", - "optionalDependencies": { - "rxjs": "*" - } - }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -19287,20 +19200,6 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, - "node_modules/usehooks-ts": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/usehooks-ts/-/usehooks-ts-3.1.0.tgz", - "integrity": "sha512-bBIa7yUyPhE1BCc0GmR96VU/15l/9gP1Ch5mYdLcFBaFGQsdmXkvjV0TtOqW1yUd6VjIwDunm+flSciCQXujiw==", - "dependencies": { - "lodash.debounce": "^4.0.8" - }, - "engines": { - "node": ">=16.15.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17 || ^18" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index e779081dc4b..d1cc24439d0 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "react-pdf": "^9.1.0", "react-webcam": "^7.2.0", "rehype-raw": "^6.1.1", + "simple-git": "^3.27.0", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", @@ -168,4 +169,4 @@ "node": ">=20.12.0" }, "packageManager": "npm@10.5.0" -} \ No newline at end of file +} diff --git a/scripts/setup-care-apps.js b/scripts/setup-care-apps.js index a90e08e2056..4a25ffbb9ad 100644 --- a/scripts/setup-care-apps.js +++ b/scripts/setup-care-apps.js @@ -5,8 +5,10 @@ const fs = require("fs"); // eslint-disable-next-line @typescript-eslint/no-var-requires const path = require("path"); // eslint-disable-next-line @typescript-eslint/no-var-requires +const simpleGit = require("simple-git"); require("dotenv").config({ path: [".env.local", ".env"] }); + console.log("Preinstall script running"); // Function to read apps.json or return an empty array if it doesn't exist @@ -28,39 +30,40 @@ const appsDir = path.join(__dirname, "..", "apps"); if (!fs.existsSync(appsDir)) { fs.mkdirSync(appsDir); } - -const installApp = (app) => { +const installApp = async (app) => { const appDir = path.join(appsDir, app.package.split("/")[1]); console.log(`Cloning ${app.package}...`); - // Form the clone URL - const cloneUrl = `https://github.com/${app.package.replace("github:", "")}.git`; - - // Use git clone instead of gitget to ensure .git folder is present - const branchOption = app.branch ? `--branch ${app.branch}` : ""; - - execSync( - `git clone ${branchOption} ${cloneUrl} ${appDir}`, - { - stdio: "inherit", - }, - ); - - // Create a care-package.lock file - fs.writeFileSync( - path.join(appDir, "care-package.lock"), - JSON.stringify( - { - package: app.package, - branch: app.branch, - }, - null, - 2, - ), - ); + const git = simpleGit(); + + try { + // Form the clone URL + const cloneUrl = `https://github.com/${app.package.replace("github:", "")}.git`; + + // Clone the repository using simple-git + await git.clone(cloneUrl, appDir, { + '--branch': app.branch, // Use branch if provided + }); + + // Create a care-package.lock file + fs.writeFileSync( + path.join(appDir, "care-package.lock"), + JSON.stringify( + { + package: app.package, + branch: app.branch, + }, + null, + 2, + ), + ); + + console.log(`Cloned ${app.package} successfully.`); + } catch (error) { + console.error(`Error cloning ${app.package}:`, error); + } }; - // Clone or pull care apps appsConfig.forEach((app) => { const appDir = path.join(appsDir, app.package.split("/")[1]); From abee5368cabc3efc972a286b172906249c6ca50d Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Thu, 24 Oct 2024 12:32:13 +0530 Subject: [PATCH 5/8] Revert "replaced native git with simple-git" This reverts commit c6d53acfba3b40329db2fc1d0fc96d5dbe94acd8. --- package-lock.json | 159 ++++++++++++++++++++++++++++++------- package.json | 3 +- scripts/setup-care-apps.js | 59 +++++++------- 3 files changed, 159 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index b31f240d8cf..bd7bb8423c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,6 @@ "react-pdf": "^9.1.0", "react-webcam": "^7.2.0", "rehype-raw": "^6.1.1", - "simple-git": "^3.27.0", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", @@ -111,7 +110,6 @@ "apps/care_livekit_fe": { "name": "care-livekit", "version": "0.0.1", - "extraneous": true, "license": "ISC", "dependencies": { "@livekit/components-react": "^2.6.2", @@ -1888,6 +1886,11 @@ "node": ">=6.9.0" } }, + "node_modules/@bufbuild/protobuf": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz", + "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==" + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -2788,20 +2791,63 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@kwsites/file-exists": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", - "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", - "license": "MIT", + "node_modules/@livekit/components-core": { + "version": "0.11.9", + "resolved": "https://registry.npmjs.org/@livekit/components-core/-/components-core-0.11.9.tgz", + "integrity": "sha512-LPE1BZ+YTaqsVqGy/GAlpiO5rEI8XpEaf1TQcGdZN1BCBas9hTHt7/aHMbHQJ0K5xuAFQx8is6dFe451T4qXIQ==", "dependencies": { - "debug": "^4.1.1" + "@floating-ui/dom": "1.6.11", + "loglevel": "1.9.1", + "rxjs": "7.8.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "livekit-client": "^2.5.7", + "tslib": "^2.6.2" } }, - "node_modules/@kwsites/promise-deferred": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", - "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", - "license": "MIT" + "node_modules/@livekit/components-react": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@livekit/components-react/-/components-react-2.6.5.tgz", + "integrity": "sha512-G3BpBlKy+lWTV9MH3/oBTBC17Z8CWqZ9GnjcG/xmYI0IvqmY89tVWph7cj2Bq0taniA+mD3U9EMPr68fOb1m1g==", + "dependencies": { + "@livekit/components-core": "0.11.9", + "clsx": "2.1.1", + "usehooks-ts": "3.1.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@livekit/krisp-noise-filter": "^0.2.12", + "livekit-client": "^2.5.7", + "react": ">=18", + "react-dom": ">=18", + "tslib": "^2.6.2" + }, + "peerDependenciesMeta": { + "@livekit/krisp-noise-filter": { + "optional": true + } + } + }, + "node_modules/@livekit/components-styles": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@livekit/components-styles/-/components-styles-1.1.4.tgz", + "integrity": "sha512-QCupn7tQ/dy/WZclrfsgtDe8peiGYS6Ied1IGkKOysaXo04l90t62SIUTKyxgd0dNDhUDC0p34qCggGZs/44lQ==", + "engines": { + "node": ">=18" + } + }, + "node_modules/@livekit/protocol": { + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/@livekit/protocol/-/protocol-1.24.0.tgz", + "integrity": "sha512-9dCsqnkMn7lvbI4NGh18zhLDsrXyUcpS++TEFgEk5Xv1WM3R2kT3EzqgL1P/mr3jaabM6rJ8wZA/KJLuQNpF5w==", + "dependencies": { + "@bufbuild/protobuf": "^1.10.0" + } }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", @@ -6547,6 +6593,10 @@ "node": ">=6" } }, + "node_modules/care-livekit": { + "resolved": "apps/care_livekit_fe", + "link": true + }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -11642,6 +11692,26 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/livekit-client": { + "version": "2.5.9", + "resolved": "https://registry.npmjs.org/livekit-client/-/livekit-client-2.5.9.tgz", + "integrity": "sha512-oDpK6SKYB1F+mNO+25DA0bF0cD2XoOJeD8ji4YQpzDBQv2IxeyKrQhoqXAqrYgIKuiMNkImSf+yg2v7EHSl4Og==", + "dependencies": { + "@livekit/protocol": "1.24.0", + "events": "^3.3.0", + "loglevel": "^1.8.0", + "sdp-transform": "^2.14.1", + "ts-debounce": "^4.0.0", + "tslib": "2.7.0", + "typed-emitter": "^2.1.0", + "webrtc-adapter": "^9.0.0" + } + }, + "node_modules/livekit-client/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, "node_modules/load-plugin": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-6.0.3.tgz", @@ -11753,7 +11823,6 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true, "license": "MIT" }, "node_modules/lodash.isplainobject": { @@ -11848,6 +11917,18 @@ "node": ">=8" } }, + "node_modules/loglevel": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.1.tgz", + "integrity": "sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -17103,6 +17184,14 @@ "integrity": "sha512-d7wDPgDV3DDiqulJjKiV2865wKsJ34YI+NDREbm+FySq6WuKOikwyNQcm+doLAZ1O6ltdO0SeKle2xMpN3Brgw==", "license": "MIT" }, + "node_modules/sdp-transform": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.2.tgz", + "integrity": "sha512-icY6jVao7MfKCieyo1AyxFYm1baiM+fA00qW/KrNNVlkxHAd34riEKuEkUe4bBb3gJwLJZM+xT60Yj1QL8rHiA==", + "bin": { + "sdp-verify": "checker.js" + } + }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -17352,21 +17441,6 @@ "simple-concat": "^1.0.0" } }, - "node_modules/simple-git": { - "version": "3.27.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.27.0.tgz", - "integrity": "sha512-ivHoFS9Yi9GY49ogc6/YAi3Fl9ROnF4VyubNylgCkA+RVqLaKWnDSzXOVzya8csELIaWaYNutsEuAhZrtOjozA==", - "license": "MIT", - "dependencies": { - "@kwsites/file-exists": "^1.1.1", - "@kwsites/promise-deferred": "^1.1.1", - "debug": "^4.3.5" - }, - "funding": { - "type": "github", - "url": "https://github.com/steveukx/git-js?sponsor=1" - } - }, "node_modules/size-sensor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/size-sensor/-/size-sensor-1.0.2.tgz", @@ -18443,6 +18517,11 @@ "typescript": ">=4.2.0" } }, + "node_modules/ts-debounce": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ts-debounce/-/ts-debounce-4.0.0.tgz", + "integrity": "sha512-+1iDGY6NmOGidq7i7xZGA4cm8DAa6fqdYcvO5Z6yBevH++Bdo9Qt/mN0TzHUgcCcKv1gmh9+W5dHqz8pMWbCbg==" + }, "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", @@ -18623,6 +18702,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typed-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typed-emitter/-/typed-emitter-2.1.0.tgz", + "integrity": "sha512-g/KzbYKbH5C2vPkaXGu8DJlHrGKHLsM25Zg9WuC9pMGfuvT+X25tZQWo5fK1BjBm8+UrVE9LDCvaY0CQk+fXDA==", + "optionalDependencies": { + "rxjs": "*" + } + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -19200,6 +19287,20 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/usehooks-ts": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/usehooks-ts/-/usehooks-ts-3.1.0.tgz", + "integrity": "sha512-bBIa7yUyPhE1BCc0GmR96VU/15l/9gP1Ch5mYdLcFBaFGQsdmXkvjV0TtOqW1yUd6VjIwDunm+flSciCQXujiw==", + "dependencies": { + "lodash.debounce": "^4.0.8" + }, + "engines": { + "node": ">=16.15.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index d1cc24439d0..e779081dc4b 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,6 @@ "react-pdf": "^9.1.0", "react-webcam": "^7.2.0", "rehype-raw": "^6.1.1", - "simple-git": "^3.27.0", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", @@ -169,4 +168,4 @@ "node": ">=20.12.0" }, "packageManager": "npm@10.5.0" -} +} \ No newline at end of file diff --git a/scripts/setup-care-apps.js b/scripts/setup-care-apps.js index 4a25ffbb9ad..a90e08e2056 100644 --- a/scripts/setup-care-apps.js +++ b/scripts/setup-care-apps.js @@ -5,10 +5,8 @@ const fs = require("fs"); // eslint-disable-next-line @typescript-eslint/no-var-requires const path = require("path"); // eslint-disable-next-line @typescript-eslint/no-var-requires -const simpleGit = require("simple-git"); require("dotenv").config({ path: [".env.local", ".env"] }); - console.log("Preinstall script running"); // Function to read apps.json or return an empty array if it doesn't exist @@ -30,40 +28,39 @@ const appsDir = path.join(__dirname, "..", "apps"); if (!fs.existsSync(appsDir)) { fs.mkdirSync(appsDir); } -const installApp = async (app) => { + +const installApp = (app) => { const appDir = path.join(appsDir, app.package.split("/")[1]); console.log(`Cloning ${app.package}...`); - const git = simpleGit(); - - try { - // Form the clone URL - const cloneUrl = `https://github.com/${app.package.replace("github:", "")}.git`; - - // Clone the repository using simple-git - await git.clone(cloneUrl, appDir, { - '--branch': app.branch, // Use branch if provided - }); - - // Create a care-package.lock file - fs.writeFileSync( - path.join(appDir, "care-package.lock"), - JSON.stringify( - { - package: app.package, - branch: app.branch, - }, - null, - 2, - ), - ); - - console.log(`Cloned ${app.package} successfully.`); - } catch (error) { - console.error(`Error cloning ${app.package}:`, error); - } + // Form the clone URL + const cloneUrl = `https://github.com/${app.package.replace("github:", "")}.git`; + + // Use git clone instead of gitget to ensure .git folder is present + const branchOption = app.branch ? `--branch ${app.branch}` : ""; + + execSync( + `git clone ${branchOption} ${cloneUrl} ${appDir}`, + { + stdio: "inherit", + }, + ); + + // Create a care-package.lock file + fs.writeFileSync( + path.join(appDir, "care-package.lock"), + JSON.stringify( + { + package: app.package, + branch: app.branch, + }, + null, + 2, + ), + ); }; + // Clone or pull care apps appsConfig.forEach((app) => { const appDir = path.join(appsDir, app.package.split("/")[1]); From 46f543446db95279ed794b85875a30594667493a Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Thu, 24 Oct 2024 13:06:32 +0530 Subject: [PATCH 6/8] fix docker builds --- .dockerignore | 2 +- Dockerfile | 7 +++--- package-lock.json | 45 +++++++++++++++++++++++++++----------- scripts/setup-care-apps.js | 11 +++------- 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.dockerignore b/.dockerignore index 8744ba7daec..2bbc69139ff 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,4 @@ node_modules build .dockerignore Dockerfile -.git +.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8180806abb8..4ab5ed7dbc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,10 @@ WORKDIR /app ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then apt-get update && apt-get install -y python3-dev make g++ git; fi +RUN apt-get update && apt-get install -y git + +RUN if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then apt-get install -y python3-dev make g++; fi + COPY package.json package-lock.json ./ @@ -13,8 +16,6 @@ RUN npm install COPY . . -RUN npm run setup - RUN npm run build diff --git a/package-lock.json b/package-lock.json index bd7bb8423c6..a4276cb3d35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1889,7 +1889,8 @@ "node_modules/@bufbuild/protobuf": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz", - "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==" + "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==", + "license": "(Apache-2.0 AND BSD-3-Clause)" }, "node_modules/@colors/colors": { "version": "1.5.0", @@ -2792,9 +2793,10 @@ } }, "node_modules/@livekit/components-core": { - "version": "0.11.9", - "resolved": "https://registry.npmjs.org/@livekit/components-core/-/components-core-0.11.9.tgz", - "integrity": "sha512-LPE1BZ+YTaqsVqGy/GAlpiO5rEI8XpEaf1TQcGdZN1BCBas9hTHt7/aHMbHQJ0K5xuAFQx8is6dFe451T4qXIQ==", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@livekit/components-core/-/components-core-0.11.10.tgz", + "integrity": "sha512-PvFlKq1W64b9GfFjG7L4/o7ulAl5yFFpDTvG+JHQiXkaPaecMPt/qPbs6zdvUlC7om1TGMuW/pIN7o585Xz9Fg==", + "license": "Apache-2.0", "dependencies": { "@floating-ui/dom": "1.6.11", "loglevel": "1.9.1", @@ -2809,11 +2811,12 @@ } }, "node_modules/@livekit/components-react": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@livekit/components-react/-/components-react-2.6.5.tgz", - "integrity": "sha512-G3BpBlKy+lWTV9MH3/oBTBC17Z8CWqZ9GnjcG/xmYI0IvqmY89tVWph7cj2Bq0taniA+mD3U9EMPr68fOb1m1g==", + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/@livekit/components-react/-/components-react-2.6.7.tgz", + "integrity": "sha512-z8dgrBrRXIe7oagwFyjehdwL/4zpySJyPdAjeMDXZVbTXYNAugb3a88Ws9yQz4PZFECLkIPXJCN3C3YR+bgh5Q==", + "license": "Apache-2.0", "dependencies": { - "@livekit/components-core": "0.11.9", + "@livekit/components-core": "0.11.10", "clsx": "2.1.1", "usehooks-ts": "3.1.0" }, @@ -2837,14 +2840,22 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/@livekit/components-styles/-/components-styles-1.1.4.tgz", "integrity": "sha512-QCupn7tQ/dy/WZclrfsgtDe8peiGYS6Ied1IGkKOysaXo04l90t62SIUTKyxgd0dNDhUDC0p34qCggGZs/44lQ==", + "license": "Apache-2.0", "engines": { "node": ">=18" } }, + "node_modules/@livekit/mutex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@livekit/mutex/-/mutex-1.0.0.tgz", + "integrity": "sha512-aiUhoThBNF9UyGTxEURFzJLhhPLIVTnQiEVMjRhPnfHNKLfo2JY9xovHKIus7B78UD5hsP6DlgpmAsjrz4U0Iw==", + "license": "Apache-2.0" + }, "node_modules/@livekit/protocol": { "version": "1.24.0", "resolved": "https://registry.npmjs.org/@livekit/protocol/-/protocol-1.24.0.tgz", "integrity": "sha512-9dCsqnkMn7lvbI4NGh18zhLDsrXyUcpS++TEFgEk5Xv1WM3R2kT3EzqgL1P/mr3jaabM6rJ8wZA/KJLuQNpF5w==", + "license": "Apache-2.0", "dependencies": { "@bufbuild/protobuf": "^1.10.0" } @@ -11693,10 +11704,12 @@ } }, "node_modules/livekit-client": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/livekit-client/-/livekit-client-2.5.9.tgz", - "integrity": "sha512-oDpK6SKYB1F+mNO+25DA0bF0cD2XoOJeD8ji4YQpzDBQv2IxeyKrQhoqXAqrYgIKuiMNkImSf+yg2v7EHSl4Og==", + "version": "2.5.10", + "resolved": "https://registry.npmjs.org/livekit-client/-/livekit-client-2.5.10.tgz", + "integrity": "sha512-H7EeIb19LAH8ejlvhh0JWtWkvXDan6Yf3bpFGlDMb54uPmyRgBY+McfgQsFgJCB9WJL0X+GYUoV1Cmnn8iAoIQ==", + "license": "Apache-2.0", "dependencies": { + "@livekit/mutex": "1.0.0", "@livekit/protocol": "1.24.0", "events": "^3.3.0", "loglevel": "^1.8.0", @@ -11710,7 +11723,8 @@ "node_modules/livekit-client/node_modules/tslib": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "license": "0BSD" }, "node_modules/load-plugin": { "version": "6.0.3", @@ -11921,6 +11935,7 @@ "version": "1.9.1", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.1.tgz", "integrity": "sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==", + "license": "MIT", "engines": { "node": ">= 0.6.0" }, @@ -17188,6 +17203,7 @@ "version": "2.14.2", "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.2.tgz", "integrity": "sha512-icY6jVao7MfKCieyo1AyxFYm1baiM+fA00qW/KrNNVlkxHAd34riEKuEkUe4bBb3gJwLJZM+xT60Yj1QL8rHiA==", + "license": "MIT", "bin": { "sdp-verify": "checker.js" } @@ -18520,7 +18536,8 @@ "node_modules/ts-debounce": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/ts-debounce/-/ts-debounce-4.0.0.tgz", - "integrity": "sha512-+1iDGY6NmOGidq7i7xZGA4cm8DAa6fqdYcvO5Z6yBevH++Bdo9Qt/mN0TzHUgcCcKv1gmh9+W5dHqz8pMWbCbg==" + "integrity": "sha512-+1iDGY6NmOGidq7i7xZGA4cm8DAa6fqdYcvO5Z6yBevH++Bdo9Qt/mN0TzHUgcCcKv1gmh9+W5dHqz8pMWbCbg==", + "license": "MIT" }, "node_modules/ts-interface-checker": { "version": "0.1.13", @@ -18706,6 +18723,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/typed-emitter/-/typed-emitter-2.1.0.tgz", "integrity": "sha512-g/KzbYKbH5C2vPkaXGu8DJlHrGKHLsM25Zg9WuC9pMGfuvT+X25tZQWo5fK1BjBm8+UrVE9LDCvaY0CQk+fXDA==", + "license": "MIT", "optionalDependencies": { "rxjs": "*" } @@ -19291,6 +19309,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/usehooks-ts/-/usehooks-ts-3.1.0.tgz", "integrity": "sha512-bBIa7yUyPhE1BCc0GmR96VU/15l/9gP1Ch5mYdLcFBaFGQsdmXkvjV0TtOqW1yUd6VjIwDunm+flSciCQXujiw==", + "license": "MIT", "dependencies": { "lodash.debounce": "^4.0.8" }, diff --git a/scripts/setup-care-apps.js b/scripts/setup-care-apps.js index a90e08e2056..7fcfe0baedf 100644 --- a/scripts/setup-care-apps.js +++ b/scripts/setup-care-apps.js @@ -1,5 +1,5 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires -const { execSync } = require("child_process"); +const { execSync, spawnSync } = require("child_process"); // eslint-disable-next-line @typescript-eslint/no-var-requires const fs = require("fs"); // eslint-disable-next-line @typescript-eslint/no-var-requires @@ -38,14 +38,9 @@ const installApp = (app) => { const cloneUrl = `https://github.com/${app.package.replace("github:", "")}.git`; // Use git clone instead of gitget to ensure .git folder is present - const branchOption = app.branch ? `--branch ${app.branch}` : ""; + const branchOption = app.branch ? ["--branch", app.branch] : []; - execSync( - `git clone ${branchOption} ${cloneUrl} ${appDir}`, - { - stdio: "inherit", - }, - ); + spawnSync("git", ["clone", ...branchOption, cloneUrl, appDir]); // Create a care-package.lock file fs.writeFileSync( From 095099eaad580ce28bbe7aa60a801860f3d3986f Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Thu, 24 Oct 2024 13:08:38 +0530 Subject: [PATCH 7/8] add apps to docker ignore --- .dockerignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 2bbc69139ff..c0d7ac9cd23 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,5 @@ node_modules build .dockerignore Dockerfile -.git \ No newline at end of file +.git +apps \ No newline at end of file From b4a7ce48f3abd6cd19d0983b78f4b3ef8ee666ec Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Thu, 24 Oct 2024 13:14:56 +0530 Subject: [PATCH 8/8] remove obvious comments --- scripts/setup-care-apps.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/setup-care-apps.js b/scripts/setup-care-apps.js index 7fcfe0baedf..870c73bd247 100644 --- a/scripts/setup-care-apps.js +++ b/scripts/setup-care-apps.js @@ -34,10 +34,7 @@ const installApp = (app) => { console.log(`Cloning ${app.package}...`); - // Form the clone URL const cloneUrl = `https://github.com/${app.package.replace("github:", "")}.git`; - - // Use git clone instead of gitget to ensure .git folder is present const branchOption = app.branch ? ["--branch", app.branch] : []; spawnSync("git", ["clone", ...branchOption, cloneUrl, appDir]);