planetscale / beam

A simple message board for your organization or project
https://planetscale.com/blog/introducing-beam
MIT License
2.06k stars 141 forks source link

initial cleanup steps #93

Closed thejessewinton closed 1 year ago

thejessewinton commented 1 year ago
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
beam ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 16, 2023 at 7:54PM (UTC)
thejessewinton commented 1 year ago

There are a lot of changed files, but the significant majority are from semi-colon change. Actual functioning code is minimal.

jasonlong commented 1 year ago

Update prettier config to include semi-colon.

I didn't see any changes specific to semi-colons. The change doesn't now allow them, correct?

This will be a lot easier soon when you have access to the Vercel account, but here's the current build log:

Details
[12:42:09.125] Running build in Portland, USA (West) – pdx1 [12:42:09.181] Cloning github.com/planetscale/beam (Branch: thejessewinton/initial-cleanup, Commit: c9b9a4d) [12:42:09.903] Cloning completed: 721.29ms [12:42:11.746] Skipping build cache since Package Manager changed from "npm" to "pnpm" [12:42:12.669] Running "vercel build" [12:42:13.115] Vercel CLI 28.16.15 [12:42:13.437] Detected `pnpm-lock.yaml` generated by pnpm 7... [12:42:13.467] Installing dependencies... [12:42:14.100] Lockfile is up to date, resolution step is skipped [12:42:14.149] Progress: resolved 1, reused 0, downloaded 0, added 0 [12:42:14.280] Packages: +512 [12:42:14.280] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [12:42:14.700] Packages are hard linked from the content-addressable store to the virtual store. [12:42:14.700] Content-addressable store is at: /vercel/.local/share/pnpm/store/v3 [12:42:14.700] Virtual store is at: node_modules/.pnpm [12:42:15.162] Progress: resolved 512, reused 0, downloaded 15, added 13 [12:42:16.154] Progress: resolved 512, reused 0, downloaded 54, added 53 [12:42:17.163] Progress: resolved 512, reused 0, downloaded 103, added 97 [12:42:18.164] Progress: resolved 512, reused 0, downloaded 199, added 197 [12:42:19.171] Progress: resolved 512, reused 0, downloaded 259, added 256 [12:42:20.172] Progress: resolved 512, reused 0, downloaded 317, added 313 [12:42:21.172] Progress: resolved 512, reused 0, downloaded 389, added 386 [12:42:22.172] Progress: resolved 512, reused 0, downloaded 463, added 462 [12:42:23.186] Progress: resolved 512, reused 0, downloaded 506, added 505 [12:42:24.172] Progress: resolved 512, reused 0, downloaded 508, added 508 [12:42:25.172] Progress: resolved 512, reused 0, downloaded 509, added 509 [12:42:26.209] Progress: resolved 512, reused 0, downloaded 510, added 510 [12:42:27.217] Progress: resolved 512, reused 0, downloaded 512, added 512, done [12:42:27.516] .../node_modules/@prisma/engines postinstall$ node scripts/postinstall.js [12:42:27.517] .../core-js@3.29.0/node_modules/core-js postinstall$ node -e "try{require('./postinstall')}catch(e){}" [12:42:27.604] .../core-js@3.29.0/node_modules/core-js postinstall: Done [12:42:28.649] .../node_modules/@prisma/engines postinstall: Done [12:42:28.934] .../prisma@4.11.0/node_modules/prisma preinstall$ node scripts/preinstall-entry.js [12:42:29.015] .../prisma@4.11.0/node_modules/prisma preinstall: Done [12:42:29.016] .../prisma@4.11.0/node_modules/prisma install$ node scripts/install-entry.js [12:42:29.092] .../prisma@4.11.0/node_modules/prisma install: Done [12:42:29.259] .../node_modules/@prisma/client postinstall$ node scripts/postinstall.js [12:42:30.653] .../node_modules/@prisma/client postinstall: Prisma schema loaded from prisma/schema.prisma [12:42:31.487] .../node_modules/@prisma/client postinstall: ✔ Generated Prisma Client (4.11.0 | library) to ./node_modules/.pnpm/@prisma+client@4.11.0_prisma@4.11.0/node_modules/@prisma/client in 176ms [12:42:31.488] .../node_modules/@prisma/client postinstall: You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client [12:42:31.488] .../node_modules/@prisma/client postinstall: ``` [12:42:31.488] .../node_modules/@prisma/client postinstall: import { PrismaClient } from '@prisma/client' [12:42:31.488] .../node_modules/@prisma/client postinstall: const prisma = new PrismaClient() [12:42:31.488] .../node_modules/@prisma/client postinstall: ``` [12:42:31.521] .../node_modules/@prisma/client postinstall: Done [12:42:31.797] [12:42:31.797] dependencies: [12:42:31.798] + @headlessui/react 1.7.12 [12:42:31.798] + @next-auth/prisma-adapter 1.0.5 [12:42:31.798] + @prisma/client 4.11.0 [12:42:31.798] + @radix-ui/react-tooltip 1.0.4 [12:42:31.798] + @tanstack/react-query 4.24.10 [12:42:31.798] + @trpc/client 10.13.2 [12:42:31.798] + @trpc/next 10.13.2 [12:42:31.798] + @trpc/react-query 10.13.2 [12:42:31.798] + @trpc/server 10.13.2 [12:42:31.798] + @tryfabric/mack 1.2.1 [12:42:31.798] + @typescript-eslint/eslint-plugin 5.54.0 [12:42:31.798] + cloudinary 1.34.0 [12:42:31.798] + crypto-hash 2.0.1 [12:42:31.799] + date-fns 2.29.3 [12:42:31.800] + envsafe 2.0.3 [12:42:31.800] + eslint-config-prettier 8.6.0 [12:42:31.800] + eslint-plugin-prettier 4.2.1 [12:42:31.800] + gemoji 7.1.0 [12:42:31.800] + isomorphic-dompurify 1.0.0 [12:42:31.800] + marked 4.2.12 [12:42:31.800] + match-sorter 6.3.1 [12:42:31.800] + next 13.2.3 [12:42:31.800] + next-auth 4.19.2 [12:42:31.800] + next-themes 0.2.1 [12:42:31.800] + react 18.2.0 [12:42:31.800] + react-beforeunload 2.5.3 [12:42:31.800] + react-detect-click-outside 1.1.7 [12:42:31.800] + react-div-100vh 0.7.0 [12:42:31.801] + react-dom 18.2.0 [12:42:31.801] + react-hook-form 7.43.3 [12:42:31.801] + react-hot-toast 2.4.0 [12:42:31.801] + react-textarea-autosize 8.4.0 [12:42:31.802] + superjson 1.12.2 [12:42:31.802] + textarea-caret 3.1.0 [12:42:31.802] + textarea-markdown-editor 1.0.4 [12:42:31.802] + use-debounce 7.0.1 [12:42:31.802] + use-item-list 0.1.2 [12:42:31.802] + zod 3.20.6 [12:42:31.802] [12:42:31.802] devDependencies: [12:42:31.802] + @tailwindcss/forms 0.5.3 [12:42:31.802] + @tailwindcss/typography 0.5.9 [12:42:31.802] + @types/marked 4.0.8 [12:42:31.802] + @types/node 18.14.2 [12:42:31.802] + @types/react 18.0.28 [12:42:31.802] + @types/react-beforeunload 2.1.1 [12:42:31.802] + @types/react-dom 18.0.11 [12:42:31.802] + @types/textarea-caret 3.0.1 [12:42:31.802] + autoprefixer 10.4.13 [12:42:31.803] + eslint 8.35.0 [12:42:31.803] + eslint-config-next 13.2.3 [12:42:31.803] + postcss 8.4.21 [12:42:31.803] + prettier 2.8.4 [12:42:31.803] + prisma 4.11.0 [12:42:31.803] + tailwindcss 3.2.7 [12:42:31.803] + typescript 4.9.5 [12:42:31.803] [12:42:31.804] Done in 18.2s [12:42:31.823] Detected Next.js version: 13.2.3 [12:42:31.864] Running "pnpm run build" [12:42:32.414] [12:42:32.415] > beam@1.0.0 build /vercel/path0 [12:42:32.415] > next build [12:42:32.415] [12:42:32.917] Attention: Next.js now collects completely anonymous telemetry regarding usage. [12:42:32.918] This information is used to shape Next.js' roadmap and prioritize features. [12:42:32.918] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: [12:42:32.918] https://nextjs.org/telemetry [12:42:32.918] [12:42:33.023] info - Linting and checking validity of types... [12:42:40.740] [12:42:40.740] ./pages/post/[id]/index.tsx [12:42:40.740] 53:22 Warning: 'likedPostId' is defined but never used. @typescript-eslint/no-unused-vars [12:42:40.740] 77:22 Warning: 'unlikedPostId' is defined but never used. @typescript-eslint/no-unused-vars [12:42:40.740] [12:42:40.740] ./components/post-summary.tsx [12:42:40.740] 30:3 Warning: 'onLike' is defined but never used. @typescript-eslint/no-unused-vars [12:42:40.740] 31:3 Warning: 'onUnlike' is defined but never used. @typescript-eslint/no-unused-vars [12:42:40.740] [12:42:40.741] info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules [12:42:43.338] info - Creating an optimized production build... [12:43:01.410] info - Compiled successfully [12:43:01.419] info - Collecting page data... [12:43:02.763] Error: This should only be included on the client (but the env vars wont be exposed) [12:43:02.763] at Object.3341 (/vercel/path0/.next/server/pages/sign-in.js:55:11) [12:43:02.764] at __webpack_require__ (/vercel/path0/.next/server/webpack-runtime.js:25:42) [12:43:02.764] at __webpack_exec__ (/vercel/path0/.next/server/pages/sign-in.js:352:39) [12:43:02.764] at /vercel/path0/.next/server/pages/sign-in.js:353:64 [12:43:02.764] at Function.__webpack_require__.X (/vercel/path0/.next/server/webpack-runtime.js:177:21) [12:43:02.764] at /vercel/path0/.next/server/pages/sign-in.js:353:47 [12:43:02.764] at Object. (/vercel/path0/.next/server/pages/sign-in.js:356:3) [12:43:02.764] at Module._compile (internal/modules/cjs/loader.js:1085:14) [12:43:02.764] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) [12:43:02.764] at Module.load (internal/modules/cjs/loader.js:950:32) [12:43:02.765] [12:43:02.766] > Build error occurred [12:43:02.767] Error: Failed to collect page data for /sign-in [12:43:02.768] at /vercel/path0/node_modules/.pnpm/next@13.2.3_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/build/utils.js:991:15 [12:43:02.768] at processTicksAndRejections (internal/process/task_queues.js:95:5) { [12:43:02.768] type: 'Error' [12:43:02.768] } [12:43:02.812]  ELIFECYCLE  Command failed with exit code 1. [12:43:02.846] Error: Command "pnpm run build" exited with 1 [12:43:03.263] BUILD_FAILED: Command "pnpm run build" exited with 1
thejessewinton commented 1 year ago

Yes, definitely will be easier when I can get access there!

For now, this is good, the issue is related to weird envs and env-safe; I'll take another look.

The prettier config should automatically add semi-colons at the end of lines now, but maybe I didn't merge the changes into my branches correctly, sorry for the confusion.

thejessewinton commented 1 year ago

I'll try and get all these errors fixed up by tomorrow so this can be off the plate into next week!

jasonlong commented 1 year ago

Re: semi-colons, can we keep that change out? I know people have strong opinions both ways, but I really don't like them and that seems to be the consensus within PlanetScale. It would be nice to keep the coding styles similar as much as possible.

thejessewinton commented 1 year ago

@jasonlong we certainly can, sounds like a deal!

thejessewinton commented 1 year ago

Made some fixes here; for some reason there's a weird issue with getServerSession on the sign-in page; for now I removed the redirect while I try and debug, but at least we can get a working build for now. Sorry for the delay.

jasonlong commented 1 year ago

Thanks @thejessewinton. I think the only way to test this out is to just merge it and see if the deploy works. I'll report back :soon:.

jasonlong commented 1 year ago

Oof, there's errors accessing the deployment internally so I'm going to revert this for now.

Taking a quick glance in my console, I noticed this two errors:

thejessewinton commented 1 year ago

Oh boy, sorry. Will be easier to debug once I'm able to access it, like you said, so I'll put this on hold for the time being so no one's time is being wasted. I'll keep testing locally as well.

jasonlong commented 1 year ago

No worries. Yeah, probably easiest to wait until you can access our internal instance. Also, we have a shared prettier config we use on a couple of projects so it might make sense to just use that going forward. All things we can discuss shortly.

thejessewinton commented 1 year ago

Great; sounds easier!