From 3e2b304427b9559f662c289784c24002c9a8ab0c Mon Sep 17 00:00:00 2001 From: Sam Poder Date: Thu, 10 Aug 2023 17:52:42 -0400 Subject: [PATCH 1/2] Remove the use of `next-compose-plugins` --- next.config.js | 4 +--- package.json | 1 - yarn.lock | 5 ----- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/next.config.js b/next.config.js index 8420483b..c2e99466 100755 --- a/next.config.js +++ b/next.config.js @@ -281,9 +281,7 @@ const nextConfig = { } } -const withPlugins = require('next-compose-plugins') - const withMDX = require('@next/mdx')({ extension: /\.mdx?$/ }) const withTM = require('next-transpile-modules')(['animejs']) -module.exports = withPlugins([withTM, withMDX], nextConfig) +module.exports = withTM(withMDX(nextConfig)) diff --git a/package.json b/package.json index 5eee1979..ccf794c2 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "js-confetti": "^0.11.0", "lodash": "^4.17.21", "next": "^12.3.1", - "next-compose-plugins": "^2.2.1", "next-transpile-modules": "^10.0.0", "react": "^17.0.2", "react-before-after-slider-component": "^1.1.6", diff --git a/yarn.lock b/yarn.lock index 126f9cd8..9f36fd24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3476,11 +3476,6 @@ natural-compare@^1.4.0: resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -next-compose-plugins@^2.2.1: - version "2.2.1" - resolved "https://registry.npmjs.org/next-compose-plugins/-/next-compose-plugins-2.2.1.tgz" - integrity sha512-OjJ+fV15FXO2uQXQagLD4C0abYErBjyjE0I0FHpOEIB8upw0hg1ldFP6cqHTJBH1cZqy96OeR3u1dJ+Ez2D4Bg== - next-transpile-modules@^10.0.0: version "10.0.0" resolved "https://registry.npmjs.org/next-transpile-modules/-/next-transpile-modules-10.0.0.tgz" From f3f91d9003e60333398b6daa87ef15a2f6a1dab9 Mon Sep 17 00:00:00 2001 From: Sam Poder Date: Thu, 10 Aug 2023 18:00:00 -0400 Subject: [PATCH 2/2] Codebase Cleanup --- components/index/cards/workshops.js | 1 - components/index/events.js | 1 - components/slack/slack-events.js | 2 +- lib/use-form.js | 1 - pages/amas/geohot.js | 1 - pages/amas/sal.js | 1 - pages/api/bank/apply.js | 3 +-- pages/api/bank/demo.js | 4 +--- pages/api/channels/resolve.js | 4 ++-- pages/api/join.js | 2 -- pages/api/stickers.js | 7 ++----- pages/api/winter-rsvp.js | 2 +- pages/bank/apply.js | 3 +-- pages/index.js | 11 ++++------- 14 files changed, 13 insertions(+), 30 deletions(-) diff --git a/components/index/cards/workshops.js b/components/index/cards/workshops.js index 3e3584db..b986e401 100644 --- a/components/index/cards/workshops.js +++ b/components/index/cards/workshops.js @@ -16,7 +16,6 @@ const WorkshopCard = ({ }) => ( { `/api/channels/resolve/?id=${lastJsonMessage.channel}` ) .then(r => r.json()) - .catch(err => console.log(err)) + .catch(err => console.error(err)) if (whitelistedChannels.has(name)) { //this check should happen before the web req, to save on net resources diff --git a/lib/use-form.js b/lib/use-form.js index 2e08963a..530cd621 100644 --- a/lib/use-form.js +++ b/lib/use-form.js @@ -49,7 +49,6 @@ const useForm = ( }) .then(r => r.json()) .then(r => { - console.log('Form success!') setStatus('success') if (callback) callback(r) setTimeout(() => setStatus('default'), 3500) diff --git a/pages/amas/geohot.js b/pages/amas/geohot.js index 35e2e4f0..bfc103d3 100644 --- a/pages/amas/geohot.js +++ b/pages/amas/geohot.js @@ -12,7 +12,6 @@ export default function Geohot() { if (typeof window !== 'undefined') { setTimeout(function () { window.location.reload() - console.log('hi') }, milliseconds) } diff --git a/pages/amas/sal.js b/pages/amas/sal.js index 19b21e25..699a31c3 100644 --- a/pages/amas/sal.js +++ b/pages/amas/sal.js @@ -12,7 +12,6 @@ export default function Sal() { if (typeof window !== 'undefined') { setTimeout(function () { window.location.reload() - console.log('hi') }, milliseconds) } diff --git a/pages/api/bank/apply.js b/pages/api/bank/apply.js index 9e67d0f9..e51aded4 100644 --- a/pages/api/bank/apply.js +++ b/pages/api/bank/apply.js @@ -53,10 +53,9 @@ export default async function handler(req, res) { 'Slack Username': data.slackUsername }) res.writeHead(302, { Location: '/bank/apply/success' }).end() - console.log(r) }) .catch(error => { - console.log(error) + console.error(error) res.writeHead(500, { Location: `/bank/apply?step=3&airtable-error=${error}` }) diff --git a/pages/api/bank/demo.js b/pages/api/bank/demo.js index edf1cda2..3bbc3dfa 100644 --- a/pages/api/bank/demo.js +++ b/pages/api/bank/demo.js @@ -27,8 +27,6 @@ export default async function handler(req, res) { }) .then(r => r.json()) .then(async r => { - console.log(data) - await applicationsTable.create({ 'Email Address': data.userEmail, 'Event Name': `${data.eventName} (${data.teamType} ${data.teamNumber})`, @@ -40,7 +38,7 @@ export default async function handler(req, res) { .json({ message: 'Success! Check your email for next steps.' }) }) .catch(error => { - console.log(error) + console.error(error) res.json({ status: 'Something went wrong', error }) }) } else { diff --git a/pages/api/channels/resolve.js b/pages/api/channels/resolve.js index 37ef865a..c04e7758 100644 --- a/pages/api/channels/resolve.js +++ b/pages/api/channels/resolve.js @@ -10,13 +10,13 @@ export default async function handler(req, res) { ) if (!channelDataReq.ok) { - console.log(await channelDataReq.text()) + console.warn(await channelDataReq.text()) return res.status(503).end() } const channelData = await channelDataReq.json() if (!channelData.ok) { - console.log(channelData) + console.warn(channelData) return res.status(400).end() } diff --git a/pages/api/join.js b/pages/api/join.js index 7bd04a3d..94f37299 100644 --- a/pages/api/join.js +++ b/pages/api/join.js @@ -7,7 +7,6 @@ const joinTable = new AirtablePlus({ }) async function postData(url = '', data = {}, headers = {}) { - console.log(data) const response = await fetch(url, { method: 'POST', mode: 'cors', @@ -84,7 +83,6 @@ export default async function handler(req, res) { }, { authorization: `Bearer ${process.env.TORIEL_KEY}` } ) - console.log(result) res.json({ status: 'success', message: 'You’ve been invited to Slack!' }) } else { res.json({ diff --git a/pages/api/stickers.js b/pages/api/stickers.js index 7d39cefe..4d933a02 100644 --- a/pages/api/stickers.js +++ b/pages/api/stickers.js @@ -32,7 +32,7 @@ export default async function handler(req, res) { filterByFormula: `AND({Email} = '${data.email}', {Is Valid?} = '1', {Club} = '')` }) )[0] - console.log('address', address) + if (!address) { address = await addressesTable.create({ 'Street (First Line)': data.addressFirst, @@ -43,8 +43,6 @@ export default async function handler(req, res) { Country: data.country, Person: [personRecord.id] }) - - console.log('created address:', address) } if ( @@ -80,10 +78,9 @@ export default async function handler(req, res) { }) .then(r => { res.json({ status: 'success' }) - console.log(r.statusText) }) .catch(error => { - console.log(error) + console.error(error) res.json({ status: 'error', error }) }) } else { diff --git a/pages/api/winter-rsvp.js b/pages/api/winter-rsvp.js index 9d912442..e8a9a1a2 100644 --- a/pages/api/winter-rsvp.js +++ b/pages/api/winter-rsvp.js @@ -27,7 +27,7 @@ export default async function handler(req, res) { }) .then(res => res.status(200).json({ success: true })) .catch(error => { - console.log(error) + console.error(error) res.json({ status: 'Something went wrong', error }) }) } else { diff --git a/pages/bank/apply.js b/pages/bank/apply.js index 3ee2a683..52ca5ccc 100644 --- a/pages/bank/apply.js +++ b/pages/bank/apply.js @@ -21,7 +21,6 @@ const valiadateAddress = async step => { // Get the raw personal address input const userAddress = sessionStorage.getItem('bank-signup-userAddress') - console.log(userAddress) if (!userAddress) return const result = await geocode(userAddress) @@ -62,7 +61,7 @@ export default function Apply() { ] useEffect(() => { - console.log(`Form error: ${formError}`) + console.error(`Form error: ${formError}`) if (!router.isReady) return setStep(parseInt(router.query.step)) diff --git a/pages/index.js b/pages/index.js index 02e3bcc3..edf8edce 100644 --- a/pages/index.js +++ b/pages/index.js @@ -115,10 +115,11 @@ function Page({ ] // janky right now and does not show last image - console.log( - `White sheets of paper\nWaiting to be printed on\nA blank console waits` - ) + useEffect(() => { + console.log( + `White sheets of paper\nWaiting to be printed on\nA blank console waits` + ) if (count === images.length - 1) { setCount(0) } @@ -152,11 +153,9 @@ function Page({ reveal={reveal} onMouseEnter={() => { setHover(true) - console.log('hover:', hover) }} onMouseOut={() => { setHover(false) - console.log('hover:', hover) }} /> @@ -361,7 +360,6 @@ function Page({ }} onClick={() => { setCount(count + 1) - console.log(count) }} >