From f99e85aeaecfd57745bbd45a680d66135b4a6d01 Mon Sep 17 00:00:00 2001 From: Shubham Waje Date: Mon, 30 Jan 2023 19:04:08 +0530 Subject: [PATCH 01/19] Add firebase config with app --- .gitignore | 2 + config/firebase.ts | 18 ++ docker-compose.yml | 4 +- jest.config.js | 1 + package.json | 1 + yarn.lock | 639 ++++++++++++++++++++++++++++++++++++++++++++- 6 files changed, 662 insertions(+), 3 deletions(-) create mode 100644 config/firebase.ts diff --git a/.gitignore b/.gitignore index 5ca8ffb..c5a346f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ /.pnp .pnp.js +.env + # testing /coverage diff --git a/config/firebase.ts b/config/firebase.ts new file mode 100644 index 0000000..e0c5d5a --- /dev/null +++ b/config/firebase.ts @@ -0,0 +1,18 @@ +import { initializeApp } from "firebase/app"; +import { getAnalytics } from "firebase/analytics"; +import { getAuth } from "firebase/auth"; + +const firebaseConfig = { + apiKey: process.env._API_KEY, + authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN, + projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, + storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET, + messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID, + appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID, + measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID, +}; + +const app = initializeApp(firebaseConfig); + +export const analytics = getAnalytics(app); +export const auth = getAuth(app); diff --git a/docker-compose.yml b/docker-compose.yml index 40e6cbb..1d5e8bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,5 +10,5 @@ services: command: yarn dev ports: - "3000:3000" - environment: - NODE_ENV: development + env_file: + - ./.env diff --git a/jest.config.js b/jest.config.js index 8a2d28d..88deea2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,6 +14,7 @@ const customJestConfig = { "^@/utils(.*)$": "/utils/$1", "^@/types(.*)$": "/types/$1", "^@/lib(.*)$": "/lib/$1", + "^@/config(.*)$": "/config/$1", }, moduleDirectories: ["node_modules", __dirname], testEnvironment: "jest-environment-jsdom", diff --git a/package.json b/package.json index 17a6acc..e7ca3df 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@uiw/react-codemirror": "^4.19.7", "eslint": "8.32.0", "eslint-config-next": "13.1.5", + "firebase": "^9.16.0", "html-to-image": "^1.11.4", "next": "13.1.5", "react": "18.2.0", diff --git a/yarn.lock b/yarn.lock index 85d1d96..fbba7ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -581,6 +581,408 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@firebase/analytics-compat@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@firebase/analytics-compat/-/analytics-compat-0.2.1.tgz#bec4f3773ae901ffb08a939ed4bc48ad2ec0d6ee" + integrity sha512-qfFAGS4YFsBbmZwVa7xaDnGh7k9BKF4o/piyjySAv0lxRYd74/tSrm3kMk1YM7GCti7PdbgKvl6oSR70zMFQjw== + dependencies: + "@firebase/analytics" "0.9.1" + "@firebase/analytics-types" "0.8.0" + "@firebase/component" "0.6.1" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/analytics-types@0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@firebase/analytics-types/-/analytics-types-0.8.0.tgz#551e744a29adbc07f557306530a2ec86add6d410" + integrity sha512-iRP+QKI2+oz3UAh4nPEq14CsEjrjD6a5+fuypjScisAh9kXKFvdJOZJDwk7kikLvWVLGEs9+kIUS4LPQV7VZVw== + +"@firebase/analytics@0.9.1": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.9.1.tgz#7ed7dac7a12659e20231b701c4fa1e1ca1285883" + integrity sha512-ARXtNHDrjDhVrs5MqmFDpr5yyCw89r1eHLd+Dw9fotAufxL1WTmo6O9bJqKb7QulIJaA84vsFokA3NaO2DNCnQ== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/installations" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/app-check-compat@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@firebase/app-check-compat/-/app-check-compat-0.3.1.tgz#09842f5e393e05641eebd9d93f75c7a28b17aced" + integrity sha512-IaSYdmaoQgWUrN6rjAYJs1TGXj38Wl9damtrDEyJBf7+rrvKshPAP/CP6e2bd89XOMZKbvy8rKoe1CqX1K3ZjQ== + dependencies: + "@firebase/app-check" "0.6.1" + "@firebase/app-check-types" "0.5.0" + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/app-check-interop-types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/app-check-interop-types/-/app-check-interop-types-0.2.0.tgz#9106270114ca4e7732457e8319333866a26285d8" + integrity sha512-+3PQIeX6/eiVK+x/yg8r6xTNR97fN7MahFDm+jiQmDjcyvSefoGuTTNQuuMScGyx3vYUBeZn+Cp9kC0yY/9uxQ== + +"@firebase/app-check-types@0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@firebase/app-check-types/-/app-check-types-0.5.0.tgz#1b02826213d7ce6a1cf773c329b46ea1c67064f4" + integrity sha512-uwSUj32Mlubybw7tedRzR24RP8M8JUVR3NPiMk3/Z4bCmgEKTlQBwMXrehDAZ2wF+TsBq0SN1c6ema71U/JPyQ== + +"@firebase/app-check@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@firebase/app-check/-/app-check-0.6.1.tgz#5be49dab1b7cab214cb9c8411a710fa12548a92e" + integrity sha512-gDG4Gr4n3MnBZAAwLMynU9u/b+f1y87lCezfwlmN1gUxD85mJcvp4hLf87fACTyRkdVfe8hqSXm+MOYn2bMGLg== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/app-compat@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@firebase/app-compat/-/app-compat-0.2.1.tgz#29b310267244c273445a5776945c0be1e168ecc2" + integrity sha512-UgPy2ZO0li0j4hAkaZKY9P1TuJEx5RylhUWPzCb8DZhBm+uHdfsFI9Yr+wMlu6qQH2sWoweFtYU6ljGzxwdctw== + dependencies: + "@firebase/app" "0.9.1" + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/app-types@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.9.0.tgz#35b5c568341e9e263b29b3d2ba0e9cfc9ec7f01e" + integrity sha512-AeweANOIo0Mb8GiYm3xhTEBVCmPwTYAu9Hcd2qSkLuga/6+j9b1Jskl5bpiSQWy9eJ/j5pavxj6eYogmnuzm+Q== + +"@firebase/app@0.9.1": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.9.1.tgz#e3935befdd5bd739003d51779af1620e36d81cce" + integrity sha512-Z8wOSol+pvp4CFyY1mW+aqdZlrwhW/ha2YXQ6/avJ56c5Hnvt4k6GktZE6o5NyzvfJTgNHryhMtnEJMIuLaT4w== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + idb "7.0.1" + tslib "^2.1.0" + +"@firebase/auth-compat@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@firebase/auth-compat/-/auth-compat-0.3.1.tgz#542012424b68e9b7e78a90cbc4290c1b7d37fef8" + integrity sha512-Ndcaam+IL1TuJ6hZ0EcQ+v261cK3kPm4mvUtouoTfl3FNinm9XvhccN8ojuaRtIV9TiY18mzGjONKF5ZCXLIZw== + dependencies: + "@firebase/auth" "0.21.1" + "@firebase/auth-types" "0.12.0" + "@firebase/component" "0.6.1" + "@firebase/util" "1.9.0" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/auth-interop-types@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@firebase/auth-interop-types/-/auth-interop-types-0.2.1.tgz#78884f24fa539e34a06c03612c75f222fcc33742" + integrity sha512-VOaGzKp65MY6P5FI84TfYKBXEPi6LmOCSMMzys6o2BN2LOsqy7pCuZCup7NYnfbk5OkkQKzvIfHOzTm0UDpkyg== + +"@firebase/auth-types@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.12.0.tgz#f28e1b68ac3b208ad02a15854c585be6da3e8e79" + integrity sha512-pPwaZt+SPOshK8xNoiQlK5XIrS97kFYc3Rc7xmy373QsOJ9MmqXxLaYssP5Kcds4wd2qK//amx/c+A8O2fVeZA== + +"@firebase/auth@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.21.1.tgz#67347b7ab3bfcc3e92afd89af2ed0eb591277d2d" + integrity sha512-/ap7eT9X7kZTD4Fn2m+nJyC1a9DfFo0H4euoJDN8U+JCMN+GOqkPbkMWCey7wV510WNoPCZQ05+nsAqKkbEVJw== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/component@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.6.1.tgz#1099d18700fd35b114a2ddc4b5e91ce23971e45f" + integrity sha512-yvKthG0InjFx9aOPnh6gk0lVNfNVEtyq3LwXgZr+hOwD0x/CtXq33XCpqv0sQj5CA4FdMy8OO+y9edI+ZUw8LA== + dependencies: + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/database-compat@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@firebase/database-compat/-/database-compat-0.3.1.tgz#417043cb25388e44086dde0605f2ce7dc1bf9902" + integrity sha512-sI7LNh0C8PCq9uUKjrBKLbZvqHTSjsf2LeZRxin+rHVegomjsOAYk9OzYwxETWh3URhpMkCM8KcTl7RVwAldog== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/database" "0.14.1" + "@firebase/database-types" "0.10.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/database-types@0.10.1": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.10.1.tgz#6c2288a7da869acd34f6b61493bb5f8d962b3a2a" + integrity sha512-UgUx9VakTHbP2WrVUdYrUT2ofTFVfWjGW2O1fwuvvMyo6WSnuSyO5nB1u0cyoMPvO25dfMIUVerfK7qFfwGL3Q== + dependencies: + "@firebase/app-types" "0.9.0" + "@firebase/util" "1.9.0" + +"@firebase/database@0.14.1": + version "0.14.1" + resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.14.1.tgz#2f2efaceb85ec51b6b10d3647340b44233f7c2ee" + integrity sha512-iX6/p7hoxUMbYAGZD+D97L05xQgpkslF2+uJLZl46EdaEfjVMEwAdy7RS/grF96kcFZFg502LwPYTXoIdrZqOA== + dependencies: + "@firebase/auth-interop-types" "0.2.1" + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + faye-websocket "0.11.4" + tslib "^2.1.0" + +"@firebase/firestore-compat@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@firebase/firestore-compat/-/firestore-compat-0.3.1.tgz#f571b2398cfcfe1c2b094d908c21c06c98f232f7" + integrity sha512-7eE4O2ASyy5X2h4a+KCRt0ZpliUAKo2jrKxKl1ZVCnOOjSCkXXeRVRG9eNZRqBwukhdwskJTM9acs0WxmKOYLA== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/firestore" "3.8.1" + "@firebase/firestore-types" "2.5.1" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/firestore-types@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-2.5.1.tgz#464b2ee057956599ca34de50eae957c30fdbabb7" + integrity sha512-xG0CA6EMfYo8YeUxC8FeDzf6W3FX1cLlcAGBYV6Cku12sZRI81oWcu61RSKM66K6kUENP+78Qm8mvroBcm1whw== + +"@firebase/firestore@3.8.1": + version "3.8.1" + resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-3.8.1.tgz#16a933529b31cefc01f4805d33a2f513d47ed0f4" + integrity sha512-oc2HMkUnq/zF+g9o974tp5RVCdXCnrU8e5S98ajfWG/hGV+8pr4i6vIa4z0yEXKWGi4X0FguxrC69z1dxEJbNg== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + "@firebase/webchannel-wrapper" "0.9.0" + "@grpc/grpc-js" "~1.7.0" + "@grpc/proto-loader" "^0.6.13" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/functions-compat@0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@firebase/functions-compat/-/functions-compat-0.3.1.tgz#4adeb5ff79ded8c9ba1ddc7e15f26220b5e9ddd6" + integrity sha512-f2D2XoRN+QCziCrUL7UrLaBEoG3v2iAeyNwbbOQ3vv0rI0mtku2/yeB2OINz5/iI6oIrBPUMNLr5fitofj7FpQ== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/functions" "0.9.1" + "@firebase/functions-types" "0.6.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/functions-types@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.6.0.tgz#ccd7000dc6fc668f5acb4e6a6a042a877a555ef2" + integrity sha512-hfEw5VJtgWXIRf92ImLkgENqpL6IWpYaXVYiRkFY1jJ9+6tIhWM7IzzwbevwIIud/jaxKVdRzD7QBWfPmkwCYw== + +"@firebase/functions@0.9.1": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.9.1.tgz#5a5999b474596ce5bb2d6020deb8540dc3ad17a9" + integrity sha512-xCSSU4aVSqYU+lCqhn9o5jJcE1KLUOOKyJfCTdCSCyTn2J3vl9Vk4TDm3JSb1Eu6XsNWtxeMW188F/GYxuMWcw== + dependencies: + "@firebase/app-check-interop-types" "0.2.0" + "@firebase/auth-interop-types" "0.2.1" + "@firebase/component" "0.6.1" + "@firebase/messaging-interop-types" "0.2.0" + "@firebase/util" "1.9.0" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/installations-compat@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@firebase/installations-compat/-/installations-compat-0.2.1.tgz#0ee4ceb2145c79f88427f5d0c51d55f6e9ef3898" + integrity sha512-X4IBVKajEeaE45zWX0Y1q8ey39aPFLa+BsUoYzsduMzCxcMBIPZd5/lV1EVGt8SN3+unnC2J75flYkxXVlhBoQ== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/installations" "0.6.1" + "@firebase/installations-types" "0.5.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/installations-types@0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@firebase/installations-types/-/installations-types-0.5.0.tgz#2adad64755cd33648519b573ec7ec30f21fb5354" + integrity sha512-9DP+RGfzoI2jH7gY4SlzqvZ+hr7gYzPODrbzVD82Y12kScZ6ZpRg/i3j6rleto8vTFC8n6Len4560FnV1w2IRg== + +"@firebase/installations@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.6.1.tgz#727749e9959e898fa8af93f054b30f50dcc1ad18" + integrity sha512-gpobP09LLLakBfNCL04fyblfyb3oX1pn+iNmELygrcAkXTO13IAMuOzThI+Xk4NHQZMX1p5GFSAiGbG4yfsSUQ== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/util" "1.9.0" + idb "7.0.1" + tslib "^2.1.0" + +"@firebase/logger@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.4.0.tgz#15ecc03c452525f9d47318ad9491b81d1810f113" + integrity sha512-eRKSeykumZ5+cJPdxxJRgAC3G5NknY2GwEbKfymdnXtnT0Ucm4pspfR6GT4MUQEDuJwRVbVcSx85kgJulMoFFA== + dependencies: + tslib "^2.1.0" + +"@firebase/messaging-compat@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@firebase/messaging-compat/-/messaging-compat-0.2.1.tgz#7eb1b610dfbe30635c684245e71a354c866dd273" + integrity sha512-BykvXtAWOs0W4Ik79lNfMKSxaUCtOJ47PJ9Vw2ySHZ14vFFNuDAtRTOBOlAFhUpsHqRoQFvFCkBGsRIQYq8hzw== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/messaging" "0.12.1" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/messaging-interop-types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.0.tgz#6056f8904a696bf0f7fdcf5f2ca8f008e8f6b064" + integrity sha512-ujA8dcRuVeBixGR9CtegfpU4YmZf3Lt7QYkcj693FFannwNuZgfAYaTmbJ40dtjB81SAu6tbFPL9YLNT15KmOQ== + +"@firebase/messaging@0.12.1": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.12.1.tgz#71f218a14302ec4b09eb81dfa3fbe8d94b797340" + integrity sha512-/F+2OWarR8TcJJVlQS6zBoHHfXMgfgR0/ukQ3h7Ow3WZ3WZ9+Sj/gvxzothXZm+WtBylfXuhiANFgHEDFL0J0w== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/installations" "0.6.1" + "@firebase/messaging-interop-types" "0.2.0" + "@firebase/util" "1.9.0" + idb "7.0.1" + tslib "^2.1.0" + +"@firebase/performance-compat@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@firebase/performance-compat/-/performance-compat-0.2.1.tgz#65bb8910b9434cb3d518c86c9b372177b29e5d03" + integrity sha512-4mn6eS7r2r+ZAHvU0OHE+3ZO+x6gOVhf2ypBoijuDNaRNjSn9GcvA8udD4IbJ8FNv/k7mbbtA9AdxVb701Lr1g== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/performance" "0.6.1" + "@firebase/performance-types" "0.2.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/performance-types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@firebase/performance-types/-/performance-types-0.2.0.tgz#400685f7a3455970817136d9b48ce07a4b9562ff" + integrity sha512-kYrbr8e/CYr1KLrLYZZt2noNnf+pRwDq2KK9Au9jHrBMnb0/C9X9yWSXmZkFt4UIdsQknBq8uBB7fsybZdOBTA== + +"@firebase/performance@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.6.1.tgz#0ca5efaf9523cf42777a6770706626514da2ca60" + integrity sha512-mT/CWz3CLgyn/a3sO/TJgrTt+RA3DfuvWwGXY9zmIiuBZY2bDi1M2uMefJdJKc9sBUPRajNF6RL10nGYq3BAuQ== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/installations" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/remote-config-compat@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@firebase/remote-config-compat/-/remote-config-compat-0.2.1.tgz#d04be14a5aaa0e9fed36a7bf746610707f0a8e29" + integrity sha512-RPCj7c2Q3QxMgJH3YCt0iD57KppFApghxAGETzlr6Jm6vT7k0vqvk2KgRBgKa4koJBsgwlUtRn2roaCqUEadyg== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/remote-config" "0.4.1" + "@firebase/remote-config-types" "0.3.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/remote-config-types@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/remote-config-types/-/remote-config-types-0.3.0.tgz#689900dcdb3e5c059e8499b29db393e4e51314b4" + integrity sha512-RtEH4vdcbXZuZWRZbIRmQVBNsE7VDQpet2qFvq6vwKLBIQRQR5Kh58M4ok3A3US8Sr3rubYnaGqZSurCwI8uMA== + +"@firebase/remote-config@0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.4.1.tgz#1f27108e402a84a2334464eaa00857827bca83d6" + integrity sha512-RCzBH3FjAPRSP3M1T7jdxLYBesIdLtNIQ0fR9ywJpGSSa0kIXEJ9iSZMTP+9pJtaCxz8db07FvjEqg7Y+lgjzg== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/installations" "0.6.1" + "@firebase/logger" "0.4.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/storage-compat@0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@firebase/storage-compat/-/storage-compat-0.2.1.tgz#1500490a197724901cd4b6f36f63c824607452c9" + integrity sha512-H0oFdYsMn2Z6tP9tlVERBkJiZsCbFAcl3Li1dnpvDg9g323egdjCnUUgH/tJODRR/Y84iZSNRkg4FvHDVI/o7Q== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/storage" "0.10.1" + "@firebase/storage-types" "0.7.0" + "@firebase/util" "1.9.0" + tslib "^2.1.0" + +"@firebase/storage-types@0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@firebase/storage-types/-/storage-types-0.7.0.tgz#0beaeafb62be7ebcf402e25b8cf8fa5a157fe925" + integrity sha512-n/8pYd82hc9XItV3Pa2KGpnuJ/2h/n/oTAaBberhe6GeyWQPnsmwwRK94W3GxUwBA/ZsszBAYZd7w7tTE+6XXA== + +"@firebase/storage@0.10.1": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.10.1.tgz#389e4b8b2731bc0bb8c20b8ce314916168a866ef" + integrity sha512-eN4ME+TFCh5KfyG9uo8PhE6cgKjK5Rb9eucQg1XEyLHMiaZiUv2xSuWehJn0FaL+UdteoaWKuRUZ4WXRDskXrA== + dependencies: + "@firebase/component" "0.6.1" + "@firebase/util" "1.9.0" + node-fetch "2.6.7" + tslib "^2.1.0" + +"@firebase/util@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@firebase/util/-/util-1.9.0.tgz#4aad6d777d140296839874a48339c6544d3ff11c" + integrity sha512-oeoq/6Sr9btbwUQs5HPfeww97bf7qgBbkknbDTXpRaph2LZ23O9XLCE5tJy856SBmGQfO4xBZP8dyryLLM2nSQ== + dependencies: + tslib "^2.1.0" + +"@firebase/webchannel-wrapper@0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.9.0.tgz#9340bce56560a8bdba1d25d6281d4bfc397450dc" + integrity sha512-BpiZLBWdLFw+qFel9p3Zs1jD6QmH7Ii4aTDu6+vx8ShdidChZUXqDhYJly4ZjSgQh54miXbBgBrk0S+jTIh/Qg== + +"@grpc/grpc-js@~1.7.0": + version "1.7.3" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.7.3.tgz#f2ea79f65e31622d7f86d4b4c9ae38f13ccab99a" + integrity sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog== + dependencies: + "@grpc/proto-loader" "^0.7.0" + "@types/node" ">=12.12.47" + +"@grpc/proto-loader@^0.6.13": + version "0.6.13" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.13.tgz#008f989b72a40c60c96cd4088522f09b05ac66bc" + integrity sha512-FjxPYDRTn6Ec3V0arm1FtSpmP6V50wuph2yILpyvTKzjc76oDdoihXqM1DzOW5ubvCC8GivfCnNtfaRE8myJ7g== + dependencies: + "@types/long" "^4.0.1" + lodash.camelcase "^4.3.0" + long "^4.0.0" + protobufjs "^6.11.3" + yargs "^16.2.0" + +"@grpc/proto-loader@^0.7.0": + version "0.7.4" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.4.tgz#4946a84fbf47c3ddd4e6a97acb79d69a9f47ebf2" + integrity sha512-MnWjkGwqQ3W8fx94/c1CwqLsNmHHv2t0CFn+9++6+cDphC1lolpg9M2OU0iebIjK//pBNX9e94ho+gjx6vz39w== + dependencies: + "@types/long" "^4.0.1" + lodash.camelcase "^4.3.0" + long "^4.0.0" + protobufjs "^7.0.0" + yargs "^16.2.0" + "@headlessui/react@^1.7.7": version "1.7.7" resolved "https://registry.yarnpkg.com/@headlessui/react/-/react-1.7.7.tgz#d6f8708d8943ae8ebb1a6929108234e4515ac7e8" @@ -1091,6 +1493,59 @@ tiny-glob "^0.2.9" tslib "^2.4.0" +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + "@rushstack/eslint-patch@^1.1.3": version "1.2.0" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz#8be36a1f66f3265389e90b5f9c9962146758f728" @@ -1258,7 +1713,12 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== -"@types/node@*", "@types/node@18.11.18": +"@types/long@^4.0.1": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" + integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== + +"@types/node@*", "@types/node@18.11.18", "@types/node@>=12.12.47", "@types/node@>=13.7.0": version "18.11.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== @@ -2026,6 +2486,15 @@ client-only@0.0.1, client-only@^0.0.1: resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -2742,6 +3211,13 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +faye-websocket@0.11.4: + version "0.11.4" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" + integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== + dependencies: + websocket-driver ">=0.5.1" + fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" @@ -2779,6 +3255,38 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +firebase@^9.16.0: + version "9.16.0" + resolved "https://registry.yarnpkg.com/firebase/-/firebase-9.16.0.tgz#f9b7f07bf67ff5d1e7e925d502b9ac02133058e6" + integrity sha512-nNLpDwJvfP3crRc6AjnHH46TAkFzk8zimNVMJfYRCwAf5amOSGyU8duuc3IsJF6dQGiYLSfzfr2tMCsQa+rhKQ== + dependencies: + "@firebase/analytics" "0.9.1" + "@firebase/analytics-compat" "0.2.1" + "@firebase/app" "0.9.1" + "@firebase/app-check" "0.6.1" + "@firebase/app-check-compat" "0.3.1" + "@firebase/app-compat" "0.2.1" + "@firebase/app-types" "0.9.0" + "@firebase/auth" "0.21.1" + "@firebase/auth-compat" "0.3.1" + "@firebase/database" "0.14.1" + "@firebase/database-compat" "0.3.1" + "@firebase/firestore" "3.8.1" + "@firebase/firestore-compat" "0.3.1" + "@firebase/functions" "0.9.1" + "@firebase/functions-compat" "0.3.1" + "@firebase/installations" "0.6.1" + "@firebase/installations-compat" "0.2.1" + "@firebase/messaging" "0.12.1" + "@firebase/messaging-compat" "0.2.1" + "@firebase/performance" "0.6.1" + "@firebase/performance-compat" "0.2.1" + "@firebase/remote-config" "0.4.1" + "@firebase/remote-config-compat" "0.2.1" + "@firebase/storage" "0.10.1" + "@firebase/storage-compat" "0.2.1" + "@firebase/util" "1.9.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -3055,6 +3563,11 @@ html-to-image@^1.11.4: resolved "https://registry.yarnpkg.com/html-to-image/-/html-to-image-1.11.4.tgz#a5c7d4b13ed13bf9922661ae20629a971cbc1e86" integrity sha512-I6jeGpjSI/pea+p/8q6HAWPxptZkEYaZ40ZLnpCHuhCJJnUHQ/YzMEQMNY/KMdPZJ4+GJIwo9dnJy76eW9p9cg== +http-parser-js@>=0.5.1: + version "0.5.8" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" + integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== + http-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" @@ -3084,6 +3597,11 @@ iconv-lite@0.6.3: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +idb@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/idb/-/idb-7.0.1.tgz#d2875b3a2f205d854ee307f6d196f246fea590a7" + integrity sha512-UUxlE7vGWK5RfB/fDwEGgRf84DY/ieqNha6msMV99UsEMQhJ1RwbCd8AYBj3QMgnE3VZnfQvm4oKVCJTYlqIgg== + ignore@^5.2.0: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" @@ -3923,6 +4441,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -3933,6 +4456,16 @@ lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + +long@^5.0.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" + integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== + loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -4080,6 +4613,13 @@ next@13.1.5: "@next/swc-win32-ia32-msvc" "13.1.5" "@next/swc-win32-x64-msvc" "13.1.5" +node-fetch@2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -4448,6 +4988,43 @@ prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +protobufjs@^6.11.3: + version "6.11.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" + integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + +protobufjs@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.0.tgz#ca6b1ceb9a9efe21186ba96178089ec563011a5e" + integrity sha512-hYCqTDuII4iJ4stZqiuGCSU8xxWl5JeXYpwARGtn/tWcKCAro6h3WQz+xpsNbXW0UYqpmTQFEyFWO0G0Kjt64g== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/node" ">=13.7.0" + long "^5.0.0" + psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" @@ -4613,6 +5190,11 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +safe-buffer@>=5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + safe-regex-test@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" @@ -4955,6 +5537,11 @@ tr46@^3.0.0: dependencies: punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" @@ -4970,6 +5557,11 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@^2.1.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + tslib@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" @@ -5096,11 +5688,30 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + webidl-conversions@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== +websocket-driver@>=0.5.1: + version "0.7.4" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" + integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== + dependencies: + http-parser-js ">=0.5.1" + safe-buffer ">=5.1.0" + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.4" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" + integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== + whatwg-encoding@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" @@ -5121,6 +5732,14 @@ whatwg-url@^11.0.0: tr46 "^3.0.0" webidl-conversions "^7.0.0" +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -5228,11 +5847,29 @@ yaml@^1.10.2: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + yargs@^17.3.1: version "17.6.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" From e1c0cc22de1ddb9f4f2743c154ab0ac733c43237 Mon Sep 17 00:00:00 2001 From: Shubham Waje Date: Mon, 30 Jan 2023 19:45:55 +0530 Subject: [PATCH 02/19] Add authentication with github --- components/editor/SnippngCodeArea.tsx | 4 +- components/editor/SnippngControlHeader.tsx | 4 +- components/form/Button.tsx | 2 +- components/icons/GithubIcon.tsx | 22 ++++++++ config/firebase.ts | 3 +- context/AuthContext.tsx | 62 ++++++++++++++++++++++ context/SnippngEditorContext.tsx | 12 ++++- layout/Header.tsx | 24 ++++++++- pages/_app.tsx | 9 ++-- pages/index.tsx | 14 +---- 10 files changed, 130 insertions(+), 26 deletions(-) create mode 100644 components/icons/GithubIcon.tsx create mode 100644 context/AuthContext.tsx diff --git a/components/editor/SnippngCodeArea.tsx b/components/editor/SnippngCodeArea.tsx index 77aa2cf..e6c77c5 100644 --- a/components/editor/SnippngCodeArea.tsx +++ b/components/editor/SnippngCodeArea.tsx @@ -7,7 +7,7 @@ import { langs, loadLanguage } from "@uiw/codemirror-extensions-langs"; import * as themes from "@uiw/codemirror-themes-all"; import CodeMirror from "@uiw/react-codemirror"; -import { SnippngEditorContext } from "@/context/SnippngEditorContext"; +import { useSnippngEditor } from "@/context/SnippngEditorContext"; import { WidthHandler } from "@/lib/width-handler"; import NoSSRWrapper from "../NoSSRWrapper"; import SnippngControlHeader from "./SnippngControlHeader"; @@ -17,7 +17,7 @@ const SnippngCodeArea = () => { const [code, setCode] = useState(DEFAULT_CODE_SNIPPET); const editorRef = createRef(); - const { editorConfig, handleConfigChange } = useContext(SnippngEditorContext); + const { editorConfig, handleConfigChange } = useSnippngEditor(); const { selectedLang, selectedTheme, diff --git a/components/editor/SnippngControlHeader.tsx b/components/editor/SnippngControlHeader.tsx index 750b101..255d620 100644 --- a/components/editor/SnippngControlHeader.tsx +++ b/components/editor/SnippngControlHeader.tsx @@ -1,4 +1,4 @@ -import { SnippngEditorContext } from "@/context/SnippngEditorContext"; +import { useSnippngEditor } from "@/context/SnippngEditorContext"; import { ColorPicker } from "@/lib/color-picker"; import { LANGUAGES, THEMES } from "@/lib/constants"; import { getEditorWrapperBg } from "@/utils"; @@ -20,7 +20,7 @@ import Select from "../form/Select"; const SnippngControlHeader = () => { const [downloadingSnippet, setDownloadingSnippet] = useState(false); - const { editorConfig, handleConfigChange } = useContext(SnippngEditorContext); + const { editorConfig, handleConfigChange } = useSnippngEditor(); const { selectedLang, diff --git a/components/form/Button.tsx b/components/form/Button.tsx index d09b838..de4a2d2 100644 --- a/components/form/Button.tsx +++ b/components/form/Button.tsx @@ -16,7 +16,7 @@ const Button: React.FC< )} > {StartIcon ? : null} - {props.children} + {props.children} {EndIcon ? : null} ); diff --git a/components/icons/GithubIcon.tsx b/components/icons/GithubIcon.tsx new file mode 100644 index 0000000..07a2091 --- /dev/null +++ b/components/icons/GithubIcon.tsx @@ -0,0 +1,22 @@ +import React from "react"; + +const GithubIcon: React.FC> = ({ + ...props +}) => { + return ( + + + + ); +}; + +export default GithubIcon; diff --git a/config/firebase.ts b/config/firebase.ts index e0c5d5a..7a2b6a5 100644 --- a/config/firebase.ts +++ b/config/firebase.ts @@ -3,7 +3,7 @@ import { getAnalytics } from "firebase/analytics"; import { getAuth } from "firebase/auth"; const firebaseConfig = { - apiKey: process.env._API_KEY, + apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY, authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN, projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET, @@ -14,5 +14,4 @@ const firebaseConfig = { const app = initializeApp(firebaseConfig); -export const analytics = getAnalytics(app); export const auth = getAuth(app); diff --git a/context/AuthContext.tsx b/context/AuthContext.tsx new file mode 100644 index 0000000..81b5abb --- /dev/null +++ b/context/AuthContext.tsx @@ -0,0 +1,62 @@ +import React, { createContext, useContext, useEffect, useState } from "react"; +import { onAuthStateChanged } from "firebase/auth"; +import { + User, + GithubAuthProvider, + signInWithPopup, + signOut, + browserLocalPersistence, + setPersistence, +} from "firebase/auth"; +import { auth } from "@/config/firebase"; + +const provider = new GithubAuthProvider(); + +const AuthContext = createContext<{ + user: User | null; + loginWithGithub: () => Promise; + logout: () => void; +}>({ + user: null, + loginWithGithub: async () => {}, + logout: () => {}, +}); + +const useAuth = () => useContext(AuthContext); + +const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ + children, +}) => { + const [user, setUser] = useState(null); + + const loginWithGithub = async () => { + await setPersistence(auth, browserLocalPersistence) + .then(() => { + return signInWithPopup(auth, provider); + }) + .catch((error) => { + alert(error.message); + }); + }; + + const logout = async () => { + await signOut(auth); + }; + + useEffect(() => { + const unsubscribe = onAuthStateChanged(auth, (fbUser) => { + setUser(fbUser); + }); + return () => { + unsubscribe(); + }; + }, []); + + return ( + + {children} + + ); +}; + +export { useAuth, AuthProvider }; diff --git a/context/SnippngEditorContext.tsx b/context/SnippngEditorContext.tsx index c1655ab..97aa354 100644 --- a/context/SnippngEditorContext.tsx +++ b/context/SnippngEditorContext.tsx @@ -3,7 +3,13 @@ import { SnippngEditorConfigInterface, SnippngEditorContextInterface, } from "@/types"; -import React, { createContext, useCallback, useEffect, useState } from "react"; +import React, { + createContext, + useCallback, + useContext, + useEffect, + useState, +} from "react"; const SnippngEditorContext = createContext({ editorConfig: { ...defaultEditorConfig }, @@ -17,6 +23,8 @@ const SnippngEditorContext = createContext({ (value: V) => {}, }); +const useSnippngEditor = () => useContext(SnippngEditorContext); + const SnippngContextProvider: React.FC<{ children: React.ReactNode }> = ({ children, }) => { @@ -59,4 +67,4 @@ const SnippngContextProvider: React.FC<{ children: React.ReactNode }> = ({ ); }; -export { SnippngContextProvider, SnippngEditorContext }; +export { SnippngContextProvider, useSnippngEditor }; diff --git a/layout/Header.tsx b/layout/Header.tsx index 7620824..c7ee3ce 100644 --- a/layout/Header.tsx +++ b/layout/Header.tsx @@ -1,14 +1,34 @@ -import { Logo, ThemeToggle } from "@/components"; +import { Button, Logo, ThemeToggle } from "@/components"; +import GithubIcon from "@/components/icons/GithubIcon"; +import { useAuth } from "@/context/AuthContext"; +import { useContext } from "react"; const Header = () => { + const { loginWithGithub, user, logout } = useAuth(); return (
diff --git a/pages/_app.tsx b/pages/_app.tsx index a46519f..001b099 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,11 +1,14 @@ +import { AuthProvider } from "@/context/AuthContext"; import { SnippngContextProvider } from "@/context/SnippngEditorContext"; import "@/styles/globals.css"; import type { AppProps } from "next/app"; export default function App({ Component, pageProps }: AppProps) { return ( - - - + + + + + ); } diff --git a/pages/index.tsx b/pages/index.tsx index 23db83a..e3006b5 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,4 +1,5 @@ import { Button, SnippngCodeArea, SnippngWindowControls } from "@/components"; +import GithubIcon from "@/components/icons/GithubIcon"; import Layout from "@/layout/Layout"; import { LANGUAGES, THEMES } from "@/lib/constants"; import { PlusCircleIcon, SparklesIcon } from "@heroicons/react/24/outline"; @@ -97,18 +98,7 @@ export default function Home() { rel="noreferrer" className="text-sm dark:text-white text-zinc-900 inline-flex items-center" > - - - + Contribute on GitHub{" "}