From 3791ec0d2d475235338aae90817e421d1cc3bc7f Mon Sep 17 00:00:00 2001 From: Divyam Ahuja Date: Tue, 22 Feb 2022 17:02:32 +0530 Subject: [PATCH] frontend and serverless setup done --- README.md | 25 +------ package.json | 2 + pages/[id].tsx | 74 ++++++++++++++++++ pages/_document.tsx | 15 ++++ pages/api/get/[id].ts | 63 ++++++++++++++++ pages/api/hello.ts | 13 ---- pages/api/new.ts | 64 ++++++++++++++++ pages/index.tsx | 118 +++++++++++++++-------------- styles/Editor.module.css | 36 +++++++++ styles/Header.module.css | 33 ++++++++ styles/Home.module.css | 116 ----------------------------- styles/Viewer.module.css | 19 +++++ styles/globals.css | 22 ++++-- yarn.lock | 157 ++++++++++++++++++++++++++++++++++++++- 14 files changed, 540 insertions(+), 217 deletions(-) create mode 100644 pages/[id].tsx create mode 100644 pages/_document.tsx create mode 100644 pages/api/get/[id].ts delete mode 100644 pages/api/hello.ts create mode 100644 pages/api/new.ts create mode 100644 styles/Editor.module.css create mode 100644 styles/Header.module.css delete mode 100644 styles/Home.module.css create mode 100644 styles/Viewer.module.css diff --git a/README.md b/README.md index c87e042..4e50429 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +This is a code sharing web application written in next.js using Serverless Functions and MongoDB/FaunaDB as database. ## Getting Started @@ -9,26 +9,3 @@ npm run dev # or yarn dev ``` - -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. - -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. - -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/package.json b/package.json index ca9b216..6fd3584 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "lint": "next lint" }, "dependencies": { + "faunadb": "^4.5.2", + "highlight.js": "^11.4.0", "next": "12.1.0", "react": "17.0.2", "react-dom": "17.0.2" diff --git a/pages/[id].tsx b/pages/[id].tsx new file mode 100644 index 0000000..a01c696 --- /dev/null +++ b/pages/[id].tsx @@ -0,0 +1,74 @@ +import { useRef, useEffect, useState } from 'react' +import type { NextPage } from 'next' +import Head from 'next/head' +import { useRouter } from 'next/router' +import hljs from 'highlight.js' + +import styles from '../styles/Viewer.module.css' +import header_styles from '../styles/Header.module.css' +import 'highlight.js/styles/atom-one-dark.css'; + +const Viewer: NextPage = () => { + + const codeRef = useRef(null) + const [code, setCode] = useState("") + + const router = useRouter() + const { id } = router.query + + useEffect(() => { + fetch(`/api/get/${id}`) + .then(res => res.json()) + .then((data) => setCode(data.code)) + .catch(() => router.push('/')) + }, []) + + const lines = code.split('\n'); + + const html = hljs.highlightAuto(code); + + useEffect(() => { + if (codeRef.current) + codeRef.current.innerHTML = html.value; + }, [html]) + + return ( +
+ + fastbin + + + + +
+
fastbin
+
+
router.push('/')} + >note_add
+
+
+ +
+ + { + lines.map((line, index) =>
 {index + 1} 
) + } +
+
+                    
+                    
+                
+
+
+ ) +} + +export async function getServerSideProps() { + return { + props: {}, + } +} + +export default Viewer diff --git a/pages/_document.tsx b/pages/_document.tsx new file mode 100644 index 0000000..8ef64c8 --- /dev/null +++ b/pages/_document.tsx @@ -0,0 +1,15 @@ +import { Html, Head, Main, NextScript } from 'next/document' + +export default function Document() { + return ( + + + + + +
+ + + + ) +} \ No newline at end of file diff --git a/pages/api/get/[id].ts b/pages/api/get/[id].ts new file mode 100644 index 0000000..a7409ba --- /dev/null +++ b/pages/api/get/[id].ts @@ -0,0 +1,63 @@ +import type { NextApiRequest, NextApiResponse } from 'next' +import faunadb, { Collection, Get, Ref, Time } from 'faunadb' + +type Data = { + code: string +} + +type FaunaQueryResponse = { + ref?: typeof Ref + ts?: typeof Time + data?: Data +} + +const client = new faunadb.Client({ + secret: process.env.FAUNA_SECRET || "", + domain: 'db.us.fauna.com', + port: 443, + scheme: 'https' +}) + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse +) { + const id = req.query['id'] + + client.query( + Get(Ref(Collection('data'), id)) + ) + .then((ret) => res.status(200).json({code: ret?.data?.code || ""})) + .catch((error) => { + res.status(404).send({code: ""}) + }) + + + /* // MongoDB + let data = JSON.stringify({ + collection: "data", + database: "fastbin", + dataSource: "Cluster0", + filter: { + "_id": { "$oid": id} + }, + }) + + fetch("https://data.mongodb-api.com/app/data-gizgg/endpoint/data/beta/action/findOne", { + method: 'POST', + headers: { + "Content-Type": "application/json", + "Access-Control-Request-Headers": "*", + "api-key": process.env.MONGO_API_KEY || "", + }, + body: data + }) + .then((response) => response.json()) + .then((data) => { + res.status(200).json({code: data.document.code}) + }) + .catch((error) => { + res.status(404).send({code: ""}) + }) + */ +} diff --git a/pages/api/hello.ts b/pages/api/hello.ts deleted file mode 100644 index f8bcc7e..0000000 --- a/pages/api/hello.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from 'next' - -type Data = { - name: string -} - -export default function handler( - req: NextApiRequest, - res: NextApiResponse -) { - res.status(200).json({ name: 'John Doe' }) -} diff --git a/pages/api/new.ts b/pages/api/new.ts new file mode 100644 index 0000000..64ee299 --- /dev/null +++ b/pages/api/new.ts @@ -0,0 +1,64 @@ +import type { NextApiRequest, NextApiResponse } from "next"; +import faunadb from 'faunadb' + +let q = faunadb.query + +type Data = { + id: string; +}; + +const client = new faunadb.Client({ + secret: process.env.FAUNA_SECRET || "", + domain: 'db.us.fauna.com', + port: 443, + scheme: 'https' +}) + + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse +) { + if (req.method !== 'POST') res.status(404).send({id: ""}); + + const code = req.body.data; + + client.query( + q.Create( + q.Collection('data'), + { data: { 'code': code } } + ) + ).then((response) => { + res.status(200).json({id: response?.ref?.id}) + }).catch((error) => { + res.status(404).send({id: ""}) + }) + + /* // Mongodb + let data = JSON.stringify({ + collection: "data", + database: "fastbin", + dataSource: "Cluster0", + document: { + "code": code + }, + }) + + fetch("https://data.mongodb-api.com/app/data-gizgg/endpoint/data/beta/action/insertOne", { + method: 'POST', + headers: { + "Content-Type": "application/json", + "Access-Control-Request-Headers": "*", + "api-key": process.env.MONGO_API_KEY || "", + }, + body: data + }) + .then((response) => response.json()) + .then((data) => { + res.status(200).json({id: data['insertedId']}) + }) + .catch((error) => { + res.status(404).send({id: ""}) + }) + */ +} diff --git a/pages/index.tsx b/pages/index.tsx index 86b5b3b..b02ad09 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,70 +1,80 @@ +import { useEffect, useRef } from 'react' import type { NextPage } from 'next' import Head from 'next/head' -import Image from 'next/image' -import styles from '../styles/Home.module.css' +import { useRouter } from 'next/router' + +import styles from '../styles/Editor.module.css' +import header_styles from '../styles/Header.module.css' + const Home: NextPage = () => { + + const codeRef = useRef(null) + const router = useRouter() + + const save = () => { + fetch('/api/new', { + 'method': 'POST', + 'headers': { + 'Content-Type': 'application/json' + }, + 'body': JSON.stringify({ data: codeRef.current?.value }) + }).then(res => res.json()) + .then(({ id }) => router.push(`/${id}`)) + .catch(() => router.push('/')) + } + + useEffect(() => { + const listener = (event : KeyboardEvent) => { + if (event.code === "KeyS" && event.ctrlKey === true) { + event.preventDefault() + save() + } + } + + document.addEventListener('keydown', listener) + + return () => { + document.removeEventListener('keydown', listener) + } + }, [save]) + return ( - +
+ + {">"} + + +
) } diff --git a/styles/Editor.module.css b/styles/Editor.module.css new file mode 100644 index 0000000..066e577 --- /dev/null +++ b/styles/Editor.module.css @@ -0,0 +1,36 @@ +.container { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + color: white; + align-items: flex-start; + justify-content: center; +} + +.editor { + display: flex; + color: white; + width: 100%; + height: 100%; + flex: 1; + padding-top: 10px; +} + +.editor .line-numbers { + padding-left: 10px; + padding-right: 10px; + user-select: none; +} + +.code-editor { + flex: 1; + padding: 3px; + overflow-x: auto; + resize: none; + outline: none; + background-color: transparent; + border: none; + color: #fff; + font-size: larger; +} \ No newline at end of file diff --git a/styles/Header.module.css b/styles/Header.module.css new file mode 100644 index 0000000..64c022b --- /dev/null +++ b/styles/Header.module.css @@ -0,0 +1,33 @@ +.header { + display: flex; + color: white; + border-bottom-color: var(--border-color, white); + border-bottom-width: 2px; + border-bottom-style: solid; + width: 100%; + justify-content: space-between; + align-items: center; +} + +.buttons-container { + display: flex; +} + +.buttons { + padding: 15px; + cursor: pointer; + user-select: none; +} + +.buttons:hover { + background-color: rgba(69, 69, 69, 0.5); +} + +.logo { + padding-left: 20px; + padding-right: 20px; + font-size: xx-large; + font-style: italic; + pointer-events: none; + user-select: none; +} diff --git a/styles/Home.module.css b/styles/Home.module.css deleted file mode 100644 index 32a57d5..0000000 --- a/styles/Home.module.css +++ /dev/null @@ -1,116 +0,0 @@ -.container { - padding: 0 2rem; -} - -.main { - min-height: 100vh; - padding: 4rem 0; - flex: 1; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} - -.footer { - display: flex; - flex: 1; - padding: 2rem 0; - border-top: 1px solid #eaeaea; - justify-content: center; - align-items: center; -} - -.footer a { - display: flex; - justify-content: center; - align-items: center; - flex-grow: 1; -} - -.title a { - color: #0070f3; - text-decoration: none; -} - -.title a:hover, -.title a:focus, -.title a:active { - text-decoration: underline; -} - -.title { - margin: 0; - line-height: 1.15; - font-size: 4rem; -} - -.title, -.description { - text-align: center; -} - -.description { - margin: 4rem 0; - line-height: 1.5; - font-size: 1.5rem; -} - -.code { - background: #fafafa; - border-radius: 5px; - padding: 0.75rem; - font-size: 1.1rem; - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, - Bitstream Vera Sans Mono, Courier New, monospace; -} - -.grid { - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; - max-width: 800px; -} - -.card { - margin: 1rem; - padding: 1.5rem; - text-align: left; - color: inherit; - text-decoration: none; - border: 1px solid #eaeaea; - border-radius: 10px; - transition: color 0.15s ease, border-color 0.15s ease; - max-width: 300px; -} - -.card:hover, -.card:focus, -.card:active { - color: #0070f3; - border-color: #0070f3; -} - -.card h2 { - margin: 0 0 1rem 0; - font-size: 1.5rem; -} - -.card p { - margin: 0; - font-size: 1.25rem; - line-height: 1.5; -} - -.logo { - height: 1em; - margin-left: 0.5rem; -} - -@media (max-width: 600px) { - .grid { - width: 100%; - flex-direction: column; - } -} diff --git a/styles/Viewer.module.css b/styles/Viewer.module.css new file mode 100644 index 0000000..93abde0 --- /dev/null +++ b/styles/Viewer.module.css @@ -0,0 +1,19 @@ +.viewer { + display: flex; + color: white; + width: 100%; + flex: 1; + padding-top: 10px; +} + +.line-numbers { + padding-top: 3px; + padding-left: 10px; + padding-right: 10px; +} + +.code { + flex: 1; + padding: 3px; + overflow-x: auto; +} \ No newline at end of file diff --git a/styles/globals.css b/styles/globals.css index e5e2dcc..5450c21 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -1,9 +1,22 @@ -html, -body { - padding: 0; +:root { + --bg-color: rgb(29, 29, 29); + --border-color: rgb(69, 69, 69); +} + +* { margin: 0; + padding: 0; + box-sizing: border-box; +} + +html, +body, +#__next { + width: 100%; + height: 100%; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + background-color: var(--bg-color); } a { @@ -11,6 +24,3 @@ a { text-decoration: none; } -* { - box-sizing: border-box; -} diff --git a/yarn.lock b/yarn.lock index 69616bb..ad4ae5d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -232,12 +232,19 @@ ajv@^6.10.0, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ansi-align@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== + dependencies: + string-width "^4.1.0" + ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -311,6 +318,25 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base64-js@^1.2.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +boxen@^5.0.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.2" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -326,6 +352,11 @@ braces@^3.0.1: dependencies: fill-range "^7.0.1" +btoa-lite@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" + integrity sha1-M3dm2hWAEhD92VbCLpxokaudAzc= + call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -339,12 +370,17 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== +camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + caniuse-lite@^1.0.30001283: version "1.0.30001312" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz#e11eba4b87e24d22697dae05455d5aea28550d5f" integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ== -chalk@^4.0.0: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -352,6 +388,11 @@ chalk@^4.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -374,6 +415,13 @@ core-js-pure@^3.20.2: resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.21.1.tgz#8c4d1e78839f5f46208de7230cebfb72bc3bdb51" integrity sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ== +cross-fetch@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== + dependencies: + node-fetch "2.6.7" + cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -447,6 +495,16 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dotenv@^8.2.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" + integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + emoji-regex@^9.2.2: version "9.2.2" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" @@ -728,6 +786,22 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +faunadb@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/faunadb/-/faunadb-4.5.2.tgz#b58175f2da62d7655e4c13ee0478898d174cbde2" + integrity sha512-XQ2yDoPZc5/IqC4eS4tP5tjewFbAK8UdQYLDGlUiJy5E9F3rpvYCMdjlkRWcaxOMD2yPYr8NSoql10zy1CNoCA== + dependencies: + base64-js "^1.2.0" + boxen "^5.0.1" + btoa-lite "^1.0.0" + chalk "^4.1.1" + cross-fetch "^3.1.5" + dotenv "^8.2.0" + fn-annotate "^1.1.3" + node-abort-controller "^3.0.1" + object-assign "^4.1.0" + util-deprecate "^1.0.2" + file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -762,6 +836,11 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== +fn-annotate@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fn-annotate/-/fn-annotate-1.2.0.tgz#28da000117dea61842fe61f353f41cf4c93a7a7e" + integrity sha1-KNoAARfephhC/mHzU/Qc9Mk6en4= + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -880,6 +959,11 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +highlight.js@^11.4.0: + version "11.4.0" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.4.0.tgz#34ceadd49e1596ee5aba3d99346cdfd4845ee05a" + integrity sha512-nawlpCBCSASs7EdvZOYOYVkJpGmAOKMYZgZtUqSRqodZE0GRVcFKwo1RcpeOemqh9hyttTdd5wDBwHkuSyUfnA== + ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" @@ -964,6 +1048,11 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -1184,7 +1273,19 @@ next@12.1.0: "@next/swc-win32-ia32-msvc" "12.1.0" "@next/swc-win32-x64-msvc" "12.1.0" -object-assign@^4.1.1: +node-abort-controller@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.0.1.tgz#f91fa50b1dee3f909afabb7e261b1e1d6b0cb74e" + integrity sha512-/ujIVxthRs+7q6hsdjHMaj8hRG9NuWmwrz+JdRwZ14jdFoKSkm+vDsCbF9PLpnSqjaWQJuTmVtcWHNLr+vrOFw== + +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" + +object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -1489,6 +1590,15 @@ source-map-js@^1.0.1: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.2: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string.prototype.matchall@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa" @@ -1519,7 +1629,7 @@ string.prototype.trimstart@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -strip-ansi@^6.0.1: +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -1565,6 +1675,11 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: version "3.12.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" @@ -1628,11 +1743,29 @@ use-subscription@1.5.1: dependencies: object-assign "^4.1.1" +util-deprecate@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + 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" @@ -1651,11 +1784,27 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"