diff --git a/package-lock.json b/package-lock.json index 714bb134..d5c5c4c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@types/validator": "^13.11.5", "axios": "^1.6.0", "bad-words-next": "^2.2.1", + "cross-env": "^7.0.3", "crypto-js": "^4.2.0", "dotenv": "^16.3.1", "emoji-picker-react": "^4.5.7", @@ -3320,11 +3321,27 @@ "node": ">= 6" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -6149,8 +6166,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/issue-parser": { "version": "6.0.0", @@ -10469,7 +10485,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -11724,7 +11739,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -11736,7 +11750,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -13115,7 +13128,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -15787,11 +15799,18 @@ } } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -17879,8 +17898,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "issue-parser": { "version": "6.0.0", @@ -20820,8 +20838,7 @@ "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "path-parse": { "version": "1.0.7", @@ -21701,7 +21718,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "requires": { "shebang-regex": "^3.0.0" } @@ -21709,8 +21725,7 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "side-channel": { "version": "1.0.4", @@ -22738,7 +22753,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "requires": { "isexe": "^2.0.0" } diff --git a/package.json b/package.json index 054c1775..949126e1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "v3.0.0-development", "private": true, "scripts": { - "dev": "next dev", + "dev": "cross-env NODE_OPTIONS='--inspect' next dev", "build": "next build", "start": "next start", "lint": "eslint --ext .js,.jsx,.ts,.tsx --ignore-path .gitignore --fix src", @@ -23,6 +23,7 @@ "@types/validator": "^13.11.5", "axios": "^1.6.0", "bad-words-next": "^2.2.1", + "cross-env": "^7.0.3", "crypto-js": "^4.2.0", "dotenv": "^16.3.1", "emoji-picker-react": "^4.5.7", diff --git a/src/components/Chat.tsx b/src/components/Chat.tsx index 0f106c8f..4d4fa77f 100644 --- a/src/components/Chat.tsx +++ b/src/components/Chat.tsx @@ -202,6 +202,8 @@ const Chat = () => { oldMessage, }); + console.log({ editedMessage }); + updateMessage({ ...editedMessage, roomId: app.currentRoomId, diff --git a/src/lib/chatSocket.ts b/src/lib/chatSocket.ts index a7d57576..cbe39d05 100644 --- a/src/lib/chatSocket.ts +++ b/src/lib/chatSocket.ts @@ -23,7 +23,7 @@ export default function useChatUtils(socket: Socket | undefined) { reject(err); return; } - + console.log({ sentMessage }); resolve(sentMessage); } ); diff --git a/src/server/service/mongo.ts b/src/server/service/mongo.ts index bef78fad..4e3281d1 100644 --- a/src/server/service/mongo.ts +++ b/src/server/service/mongo.ts @@ -6,7 +6,7 @@ let connection: Connection | null = null; let mongooseInstance: Mongoose | null = null; // Retrieve the MongoDB connection string from environment variables. -const connectionString = process.env.MongoDB_URL; +const connectionString = process.env.NEXT_PUBLIC_MongoDB_URL; // Async function to establish and return a MongoDB connection. const connectMongo = async (): Promise => { diff --git a/src/service/mailService.ts b/src/service/mailService.ts index 73df8375..f046813d 100644 --- a/src/service/mailService.ts +++ b/src/service/mailService.ts @@ -4,13 +4,13 @@ const sendMail = async (subject: string, toEmail: string, otpText: string) => { const transporter = nodemailer.createTransport({ service: 'gmail', auth: { - user: process.env.NODEMAILER_EMAIL, - pass: process.env.NODEMAILER_PW, + user: process.env.NEXT_PUBLIC_NODEMAILER_EMAIL, + pass: process.env.NEXT_PUBLIC_NODEMAILER_PW, }, }); const mailOptions = { - from: process.env.NODEMAILER_EMAIL, + from: process.env.NEXT_PUBLIC_NODEMAILER_EMAIL, to: toEmail, subject, text: otpText,