Connect, collaborate, and grow with a community of TypeScript developers
Add vercel toolbar to localhost for comments (#412)
Sean Boulte1e571672b1b
diff --git a/LOCAL.md b/LOCAL.mdindex 4710c3c9..10940a53 100644--- a/LOCAL.md+++ b/LOCAL.md@@ -154,4 +154,13 @@ pnpm refreshThis tends to resolve the issue as it entirely destroys and rebuilds + reseeds the database.</details>-<!-- Other stuff here? I can't think of anything -->++<details>+ <summary>How do I use the `@vercel/toolbar` locally?</summary>+ If you have access to the vercel project then you can run `vercel link` (make sure you have the vercel CLI).++Follow the interactive CLI to link it to the Trash Company/typehero project.++From there on out you should be able to read and make comments while on local host for that branch.++</details>diff --git a/apps/web/next.config.js b/apps/web/next.config.mjssimilarity index 70%rename from apps/web/next.config.jsrename to apps/web/next.config.mjsindex 5e05dcbd..446ee000 100644--- a/apps/web/next.config.js+++ b/apps/web/next.config.mjs@@ -1,5 +1,9 @@+// NOTE: this whole package is bugged and once they fix this we can remove this workaround+// eslint-disable-next-line import/no-unresolved+import withVercelToolbar from '@vercel/toolbar/plugins/next';+/** @type {import("next").NextConfig} */-const config = {+const nextConfig = {webpack: (config) => {config.module.rules.push({test: /\.md$/,@@ -32,4 +36,5 @@ const config = {},swcMinify: true,};-export default config;++export default withVercelToolbar()(nextConfig);diff --git a/apps/web/package.json b/apps/web/package.jsonindex dacda601..d5846b59 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -35,6 +35,7 @@"@uploadthing/react": "^5.2.0","@vercel/analytics": "^1.0.2","@vercel/edge-config": "^0.2.1",+ "@vercel/toolbar": "^0.1.1","clsx": "^2.0.0","cmdk": "^0.2.0","date-fns": "^2.30.0",diff --git a/apps/web/src/app/providers.tsx b/apps/web/src/app/providers.tsxindex e53e8d9e..7ae64e96 100644--- a/apps/web/src/app/providers.tsx+++ b/apps/web/src/app/providers.tsx@@ -1,5 +1,6 @@'use client';+import { VercelToolbar } from '@vercel/toolbar/next';import { SessionProvider } from '@repo/auth/react';import { TooltipProvider } from '@repo/ui';import { QueryClient, QueryClientProvider } from '@tanstack/react-query';@@ -15,17 +16,16 @@ interface Props {const queryClient = new QueryClient();export function Providers({ children }: Props) {+ const shouldInjectToolbar = process.env.NODE_ENV === 'development';+return (- <BalancerProvider>- <QueryClientProvider client={queryClient}>- <SessionProvider>- <ThemeProvider attribute="class">- <FeatureFlagProvider>- <TooltipProvider>{children}</TooltipProvider>- </FeatureFlagProvider>- </ThemeProvider>- </SessionProvider>- </QueryClientProvider>- </BalancerProvider>+ <QueryClientProvider client={queryClient}>+ <SessionProvider>+ <ThemeProvider attribute="class">+ <TooltipProvider>{children}</TooltipProvider>+ {shouldInjectToolbar ? <VercelToolbar /> : null}+ </ThemeProvider>+ </SessionProvider>+ </QueryClientProvider>);}diff --git a/package.json b/package.jsonindex 561993bc..8d37fdc3 100644--- a/package.json+++ b/package.json@@ -37,7 +37,8 @@"patchedDependencies": {"[email protected]": "patches/[email protected]","@monaco-editor/[email protected]": "patches/@[email protected]",- "[email protected]": "patches/[email protected]"+ "[email protected]": "patches/[email protected]",+ "@vercel/[email protected]": "patches/@[email protected]"}}}diff --git a/patches/@[email protected] b/patches/@[email protected]new file mode 100644index 00000000..97a34351--- /dev/null+++ b/patches/@[email protected]@@ -0,0 +1,10 @@+diff --git a/dist/plugins/next.d.ts b/dist/plugins/next.d.ts+index 0ae554ab8855bd02482d3acd33d4a0173620d1ac..2976671117e4d0ab114d66e309098893b73480b8 100644+--- a/dist/plugins/next.d.ts++++ b/dist/plugins/next.d.ts+@@ -5,4 +5,4 @@ interface VercelToolbarConfig {+ }+ declare function withVercelToolbar(config?: VercelToolbarConfig): (nextConfig: NextConfig) => NextConfig;++-export { VercelToolbarConfig, withVercelToolbar };++export { VercelToolbarConfig, withVercelToolbar as default };\ No newline at end of filediff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 34676c02..a4eede78 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -8,6 +8,9 @@ patchedDependencies:'@monaco-editor/[email protected]':hash: xep4qb27qzc6gvlhv2fxe3r2kapath: patches/@[email protected]+ '@vercel/[email protected]':+ hash: mukejyv3x4f3mriytfjb3reaxi+ path: patches/@[email protected]hash: j3oqxjoadtct3pc6tokddngzsmpath: patches/[email protected]@@ -249,6 +252,9 @@ importers:'@vercel/edge-config':specifier: ^0.2.1version: 0.2.1+ '@vercel/toolbar':+ specifier: ^0.1.1+ version: 0.1.1(patch_hash=mukejyv3x4f3mriytfjb3reaxi)([email protected])clsx:specifier: ^2.0.0version: 2.0.0@@ -652,7 +658,7 @@ importers:dependencies:'@next/eslint-plugin-next':specifier: canary- version: 13.4.20-canary.3+ version: 13.4.13-canary.13'@repo/tsconfig':specifier: workspace:*version: link:../config-typescript@@ -664,7 +670,7 @@ importers:version: 5.62.0([email protected])([email protected])'@vercel/style-guide':specifier: ^4.0.2eslint:specifier: ^8.40.0version: 8.45.0@@ -1716,8 +1722,8 @@ packages:glob: 7.1.7dev: true- /@next/[email protected]:- resolution: {integrity: sha512-8GPnrUU4zgD3ACO72j5i9ssYnS3BExijJpNQGGJAzf6i1olDiv8okv+tKhKerIKxybx//oHM6+JvdcTVHyzuiw==}+ /@next/[email protected]:+ resolution: {integrity: sha512-lEXi0QLWUuXlMQRLSk/6JUUoOcjACOKbJYPKe0R1XyF5Kf7/Czdm072UJb3betXqiWw5v54GoOOmyDaUDCn5Rw==}dependencies:glob: 7.1.7dev: false@@ -3530,6 +3536,117 @@ packages:engines: {node: '>=12'}dev: false+ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-YaJ4EMgVUI6JHzWO14lr6vn/BLJEoFN4Sqd20l0/oBcLLENkP8gnPtX1jB7OhIu0AE40VCweAqvSP+0/pgzB1g==}+ engines: {node: '>=12.4.0'}+ dependencies:+ es-mime-types: 0.0.16+ negotiator: 0.6.3+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-EPqdanEZ/vhpuxl4Nn/QIkS+5Wkbt8NgO/FqYj2kHttvwYkaoSFi7HUns17UQAQcak5JLbPEt67Qf4wvwy/fNQ==}+ engines: {node: '>=12.x'}+ dependencies:+ '@tinyhttp/cookie': 1.3.0+ '@tinyhttp/proxy-addr': 1.3.0+ '@tinyhttp/req': 1.3.0+ '@tinyhttp/res': 1.3.0+ '@tinyhttp/router': 1.3.0+ regexparam: 1.3.0+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-sSj7YDVz7NcHDn6/O/I3WjtC8ZWJKKIGULoV+pgrLvJvtXK5WroE1Fm8rHRQewh2d9NMajh/7NX6NuSlF8LUaQ==}+ engines: {node: '>=12.4.0'}+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-xCQZyCT1S/Rn2Z3SX2gp4IDAwW9AUnjky6hKvqzmMaQqEbIk7e2GCOXW5yjndbfGNTJAxj0tuLNMF4G8aLkfMw==}+ engines: {node: '>=12.4.0'}+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-4ZVfP8WApV9ZRchv/1i0QiKdP0wxWTUNv4ZsMQrqK0p1KXA0/SvpYUTS6bp1E6Yo0dNxcKte4wJ4FCWFDcShhQ==}+ engines: {node: '>=12.4.0'}+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-QM5j5t0GLucBuBePoOilcz1/zDpqX+LtUdtkPn7IvoHTNJYNxEfSUmIMPUPhyVY7mvbwvafPUCK8u1Byx0+NfQ==}+ engines: {node: '>=12.4.0'}+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-aWnDb4NuMf/UTm1H88rZgqu32E6t3iDHSHtAppiQCH4M7jRfTUEpiZjz//S+giDnOxAuYttLrXQ1+HGpgzyYUQ==}+ engines: {node: '>=12.4.0'}+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-U2FPtOH+DoFtd98edMRyqiquRaiuEl5I2PMUWdKaBSpiAIR96buyanQ7hScenz1MihK0AVid7wLAviaJU+Xlyg==}+ engines: {node: '>=12.4.0'}+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-7Kv6YIC/PlhUwyqAGXhg4DoQDOzbYlcGPkNv/KZAMFj9fZ6IEZyneyaClnD21hMT8qa7g3Z/66hxLa/WxiPAYA==}+ engines: {node: '>=12.4.0'}+ dependencies:+ '@tinyhttp/forwarded': 1.3.0+ ipaddr.js: 2.1.0+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-zIbtJA7Hp2p4MqszP2jOBi2NWi8fTGd4lso+0CjwJa+WTE+lgXVAy6mN12rTAxjXweAyRvQpRIJ5W2r8OLuEXQ==}+ engines: {node: '>=12.4.0'}+ dependencies:+ '@tinyhttp/accepts': 1.3.0+ '@tinyhttp/type-is': 1.3.0+ '@tinyhttp/url': 1.3.0+ es-fresh: 0.0.8+ range-parser: 1.2.1+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-ez6fCpGsYoU6HUBq0e+m4l6Cffu2FeucK+m5Z6a8sBGqLR7/teB1pFufCOPwrdwzdNrLNarGJpsNQpvQqDMWaA==}+ engines: {node: '>=12.4.0'}+ dependencies:+ '@tinyhttp/content-disposition': 1.3.0+ '@tinyhttp/cookie': 1.3.0+ '@tinyhttp/cookie-signature': 1.3.0+ '@tinyhttp/encode-url': 0.3.0+ '@tinyhttp/req': 1.3.0+ '@tinyhttp/send': 1.3.0+ es-mime-types: 0.0.16+ es-vary: 0.0.8+ escape-html: 1.0.3+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-I2HDtMq7WM4E1JfLyllJp+IAp3Hc0xLetfgi8d1TQkhms8/XC9ZhgOIlimc3//ncMZSIxofkj7TpDCdEd6M/eQ==}+ engines: {node: '>=12.4.0'}+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-3Tn8NaLhNdcIJQqc/3ZBFV0hX6jCaFNDX5/vWxoPubDrh8HOpn2foPXL7ZIRk8GDkaB/M3cSzKIlKpnTKmh0Nw==}+ engines: {node: '>=12.4.0'}+ dependencies:+ '@tinyhttp/etag': 1.3.0+ es-content-type: 0.0.10+ es-mime-types: 0.0.16+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-3NClOYPNJst9vVLcb793epRI+ZuRwl6IjxSq9LkGN8TEBbtNgv2vTmXZRWcUs2zY9Ju+NQIYecWcsG0Kx23E+g==}+ engines: {node: '>=12.4.0'}+ dependencies:+ es-content-type: 0.0.10+ es-mime-types: 0.0.16+ dev: false++ /@tinyhttp/[email protected]:+ resolution: {integrity: sha512-GgdKez5AaQRIm0kFNp7BZnxFQ2F7LZ7g3rOQ/v11oYZR3jhH7JPGM+7hZQjYqFXD/5TK/of7hepu418K2fghvg==}+ engines: {node: '>=12.4.0'}+ dev: false+/@types/[email protected]:resolution: {integrity: sha512-Vqm22aZrCvCd6I5g1SvpW151jfqwTzEZ7XJ3yZ6xaZG31nUEOEyzzVImjRcsN8Wi/QyPxId/x8GTtgIbsy8kEw==}dev: true@@ -3951,7 +4068,7 @@ packages:yoga-wasm-web: 0.3.0dev: false- /@vercel/[email protected](@next/[email protected])([email protected])([email protected])([email protected]):+ /@vercel/[email protected](@next/[email protected])([email protected])([email protected])([email protected]):resolution: {integrity: sha512-FroL+oOePzhw7n/I+f7zr4WNroGHT/+2TlW6WH9+CVSjMNsEyu7Qstj2mI5gWIBjT1Y2ZImKPppCzI2cIYmNZw==}engines: {node: '>=16'}peerDependencies:@@ -3971,7 +4088,7 @@ packages:dependencies:'@babel/core': 7.22.10'@babel/eslint-parser': 7.22.10(@babel/[email protected])([email protected])- '@next/eslint-plugin-next': 13.4.20-canary.3+ '@next/eslint-plugin-next': 13.4.13-canary.13'@rushstack/eslint-patch': 1.3.2'@typescript-eslint/eslint-plugin': 5.59.1(@typescript-eslint/[email protected])([email protected])([email protected])'@typescript-eslint/parser': 5.62.0([email protected])([email protected])@@ -3999,6 +4116,20 @@ packages:- supports-colordev: false+ /@vercel/[email protected](patch_hash=mukejyv3x4f3mriytfjb3reaxi)([email protected]):+ resolution: {integrity: sha512-mN7Tg2dgAew0kLtq3doBF8IaGY4/RJfDbH81sGolOqKco50g75u8pJm+3PfRLxBWGkpz3/QB2tKQvg6/HlnaHA==}+ peerDependencies:+ next: '>=11.0.0'+ dependencies:+ '@tinyhttp/app': 1.3.0+ chokidar: 3.5.3+ execa: 5.1.1+ find-up: 5.0.0+ get-port: 5.1.1+ next: 13.4.19([email protected])([email protected])+ dev: false+ patched: true+/@webassemblyjs/[email protected]:resolution: {integrity: sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==}dependencies:@@ -5139,6 +5270,23 @@ packages:unbox-primitive: 1.0.2which-typed-array: 1.1.10+ resolution: {integrity: sha512-yCgcv1M2IuFUoGZ3zE4OR2INGmZOwEuyaE5WX4MOKGpJcO8JXgVOIcXVicwnTqlxvx6qs9IJGl/Rr1+YtCkRgg==}+ engines: {node: '>=12.x'}+ dev: false++ resolution: {integrity: sha512-ZM+K/T/zHJVuOhaz19iymidACazB1fl2uihBtSfRie8YzN1YM+KldVmNaU+GSmVvTOPSO2utKOhxcOinr5tKjw==}+ engines: {node: '>=12.x'}+ dev: false++ resolution: {integrity: sha512-84QoSLeA7cdTeHpALFNl3ZOstXfvLt426/kaOgmSxmNUOhi4GesKVkhJgIfnsqGNziYezVA8rvZUsXj7oWX2qQ==}+ engines: {node: '>=12.x'}+ dependencies:+ mime-db: 1.52.0+ dev: false+resolution: {integrity: sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==}dev: true@@ -5164,6 +5312,11 @@ packages:is-date-object: 1.0.5is-symbol: 1.0.4+ resolution: {integrity: sha512-fiERjQiCHrXUAToNRT/sh7MtXnfei9n7cF9oVQRUEp9L5BGXsTKSPaXq8L+4v0c/ezfvuTWd/f0JSl5IBRUvSg==}+ engines: {node: '>=12.x'}+ dev: false+resolution: {integrity: sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==}engines: {node: '>=12'}@@ -5437,6 +5590,10 @@ packages:resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}engines: {node: '>=6'}+ resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}+ dev: false+resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}engines: {node: '>=0.8.0'}@@ -6211,6 +6368,11 @@ packages:engines: {node: '>=6'}dev: false+ resolution: {integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==}+ engines: {node: '>=8'}+ dev: false+resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}engines: {node: '>=10'}@@ -6657,6 +6819,11 @@ packages:loose-envify: 1.4.0dev: false+ resolution: {integrity: sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==}+ engines: {node: '>= 10'}+ dev: false+resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==}dev: false@@ -7668,6 +7835,11 @@ packages:resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}+ resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}+ engines: {node: '>= 0.6'}+ dev: false+resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}dev: true@@ -8438,6 +8610,11 @@ packages:safe-buffer: 5.2.1dev: true+ resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}+ engines: {node: '>= 0.6'}+ dev: false+resolution: {integrity: sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==}engines: {node: '>= 10.13.0'}@@ -8833,6 +9010,11 @@ packages:define-properties: 1.2.0functions-have-names: 1.2.3+ resolution: {integrity: sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g==}+ engines: {node: '>=6'}+ dev: false+resolution: {integrity: sha512-iAeaL5JyF4XxkcvWzpi/0SAF7iV7qOTaHS56tJuEsXziQc3+PEmMn65kV8OFgbO9mRVY7J1fRC/aLvot1PsNkg==}engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}