From c20d0061a7db3f58dc02349b17432fa612fe7909 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Fri, 23 Feb 2024 16:17:18 +0100 Subject: [PATCH] fix: removed client-side Link from server components --- .husky/pre-commit | 2 +- commitlint.config.ts | 4 +- components/custom/customLink.tsx | 1 + components/custom/footer.tsx | 1 + components/emails/confirmation.tsx | 8 +-- components/emails/unsubscribe.tsx | 3 +- package.json | 1 + yarn.lock | 101 ++++++++++++++++++++++++++++- 8 files changed, 110 insertions(+), 11 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index a2389f0..ea3ec41 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,7 +1,7 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -yarn audit +yarn audit-ci yarn format yarn lint yarn typecheck diff --git a/commitlint.config.ts b/commitlint.config.ts index 422b194..c34aa79 100644 --- a/commitlint.config.ts +++ b/commitlint.config.ts @@ -1 +1,3 @@ -module.exports = { extends: ['@commitlint/config-conventional'] }; +module.exports = { + extends: ['@commitlint/config-conventional'] +}; diff --git a/components/custom/customLink.tsx b/components/custom/customLink.tsx index 7238c0e..38297fb 100644 --- a/components/custom/customLink.tsx +++ b/components/custom/customLink.tsx @@ -1,3 +1,4 @@ +'use client'; import Link from 'next/link'; import { Button } from '../ui/button'; diff --git a/components/custom/footer.tsx b/components/custom/footer.tsx index ebc9699..0e26fb2 100644 --- a/components/custom/footer.tsx +++ b/components/custom/footer.tsx @@ -1,3 +1,4 @@ +'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { CustomLink } from './customLink'; diff --git a/components/emails/confirmation.tsx b/components/emails/confirmation.tsx index 681a510..deaaa33 100644 --- a/components/emails/confirmation.tsx +++ b/components/emails/confirmation.tsx @@ -1,4 +1,3 @@ -import { CustomLink } from '../custom/customLink'; import { Note } from './components/note'; import Template from './template'; @@ -22,10 +21,9 @@ export default function ConfirmationTemplate(code: string) { justifyContent: 'center' }} > - + + {'Confirm subscription'} + If you didn't subscribe to our newsletter, please ignore this diff --git a/components/emails/unsubscribe.tsx b/components/emails/unsubscribe.tsx index d58e6d8..bbf00ec 100644 --- a/components/emails/unsubscribe.tsx +++ b/components/emails/unsubscribe.tsx @@ -1,4 +1,3 @@ -import { CustomLink } from '../custom/customLink'; import { Note } from './components/note'; import Template from './template'; @@ -22,7 +21,7 @@ export default function UnsubscribeTemplate() { justifyContent: 'center' }} > - + {'Re-subscribe'} If you have any questions or concerns, please feel free to{' '} diff --git a/package.json b/package.json index 11db254..fbe74fb 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@types/react": "^18", "@types/react-dom": "^18", "@typescript-eslint/parser": "^6.12.0", + "audit-ci": "^6.6.1", "autoprefixer": "^10.0.1", "eslint": "^8", "eslint-config-next": "14.0.3", diff --git a/yarn.lock b/yarn.lock index 779e357..d4cba90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1209,6 +1209,24 @@ __metadata: languageName: node linkType: hard +"audit-ci@npm:^6.6.1": + version: 6.6.1 + resolution: "audit-ci@npm:6.6.1" + dependencies: + JSONStream: "npm:^1.3.5" + cross-spawn: "npm:^7.0.3" + escape-string-regexp: "npm:^4.0.0" + event-stream: "npm:4.0.1" + jju: "npm:^1.4.0" + readline-transform: "npm:1.0.0" + semver: "npm:^7.0.0" + yargs: "npm:^17.0.0" + bin: + audit-ci: dist/bin.js + checksum: ec2c5792182146e14be46f17fdc21129a6429e16dbde29c3b619c42f33251f26b06a4e9dcc8b7b1a1e2bc7576907049b5b8655b759df550f3af1f04ed2252af5 + languageName: node + linkType: hard + "autoprefixer@npm:^10.0.1": version: 10.4.17 resolution: "autoprefixer@npm:10.4.17" @@ -1872,6 +1890,13 @@ __metadata: languageName: node linkType: hard +"duplexer@npm:^0.1.1, duplexer@npm:~0.1.1": + version: 0.1.2 + resolution: "duplexer@npm:0.1.2" + checksum: c57bcd4bdf7e623abab2df43a7b5b23d18152154529d166c1e0da6bee341d84c432d157d7e97b32fecb1bf3a8b8857dd85ed81a915789f550637ed25b8e64fc2 + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -2362,6 +2387,21 @@ __metadata: languageName: node linkType: hard +"event-stream@npm:4.0.1": + version: 4.0.1 + resolution: "event-stream@npm:4.0.1" + dependencies: + duplexer: "npm:^0.1.1" + from: "npm:^0.1.7" + map-stream: "npm:0.0.7" + pause-stream: "npm:^0.0.11" + split: "npm:^1.0.1" + stream-combiner: "npm:^0.2.2" + through: "npm:^2.3.8" + checksum: cedb3f7ffda81f1524b66c284b4a41bb8407246bd7fe461b89a07807d28753460596e430f1346c135a64c5ba88d2a5d0711d072379b39c2266756125877aebd5 + languageName: node + linkType: hard + "eventemitter3@npm:^5.0.1": version: 5.0.1 resolution: "eventemitter3@npm:5.0.1" @@ -2535,6 +2575,13 @@ __metadata: languageName: node linkType: hard +"from@npm:^0.1.7": + version: 0.1.7 + resolution: "from@npm:0.1.7" + checksum: 3aab5aea8fe8e1f12a5dee7f390d46a93431ce691b6222dcd5701c5d34378e51ca59b44967da1105a0f90fcdf5d7629d963d51e7ccd79827d19693bdcfb688d4 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -3409,6 +3456,13 @@ __metadata: languageName: node linkType: hard +"jju@npm:^1.4.0": + version: 1.4.0 + resolution: "jju@npm:1.4.0" + checksum: f3f444557e4364cfc06b1abf8331bf3778b26c0c8552ca54429bc0092652172fdea26cbffe33e1017b303d5aa506f7ede8571857400efe459cb7439180e2acad + languageName: node + linkType: hard + "js-beautify@npm:^1.14.11": version: 1.14.11 resolution: "js-beautify@npm:1.14.11" @@ -3794,6 +3848,13 @@ __metadata: languageName: node linkType: hard +"map-stream@npm:0.0.7": + version: 0.0.7 + resolution: "map-stream@npm:0.0.7" + checksum: 77da244656dad5013bd147b0eef6f0343a212f14761332b97364fe348d4d70f0b8a0903457d6fc88772ec7c3d4d048b24f8db3aa5c0f77a8ce8bf2391473b8ec + languageName: node + linkType: hard + "matchmediaquery@npm:^0.3.0": version: 0.3.1 resolution: "matchmediaquery@npm:0.3.1" @@ -4131,6 +4192,7 @@ __metadata: "@typescript-eslint/eslint-plugin": "npm:^6.12.0" "@typescript-eslint/parser": "npm:^6.12.0" "@vercel/analytics": "npm:^1.1.1" + audit-ci: "npm:^6.6.1" autoprefixer: "npm:^10.0.1" class-variance-authority: "npm:^0.7.0" clsx: "npm:^2.0.0" @@ -4523,6 +4585,15 @@ __metadata: languageName: node linkType: hard +"pause-stream@npm:^0.0.11": + version: 0.0.11 + resolution: "pause-stream@npm:0.0.11" + dependencies: + through: "npm:~2.3" + checksum: 86f12c64cdaaa8e45ebaca4e39a478e1442db8b4beabc280b545bfaf79c0e2f33c51efb554aace5c069cc441c7b924ba484837b345eaa4ba6fc940d62f826802 + languageName: node + linkType: hard + "peberminta@npm:^0.9.0": version: 0.9.0 resolution: "peberminta@npm:0.9.0" @@ -4908,6 +4979,13 @@ __metadata: languageName: node linkType: hard +"readline-transform@npm:1.0.0": + version: 1.0.0 + resolution: "readline-transform@npm:1.0.0" + checksum: 504f8918453cac366c375aef1181f312bd05df5f8049686d0b4ad5d4214ecbf844c7470af2027f19051141e6a90dac4dfb9f3e2689ba652a3cf059d730517ec5 + languageName: node + linkType: hard + "redent@npm:^3.0.0": version: 3.0.0 resolution: "redent@npm:3.0.0" @@ -5190,7 +5268,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.5": +"semver@npm:^7.0.0, semver@npm:^7.3.5": version: 7.6.0 resolution: "semver@npm:7.6.0" dependencies: @@ -5392,6 +5470,15 @@ __metadata: languageName: node linkType: hard +"split@npm:^1.0.1": + version: 1.0.1 + resolution: "split@npm:1.0.1" + dependencies: + through: "npm:2" + checksum: 7f489e7ed5ff8a2e43295f30a5197ffcb2d6202c9cf99357f9690d645b19c812bccf0be3ff336fea5054cda17ac96b91d67147d95dbfc31fbb5804c61962af85 + languageName: node + linkType: hard + "sprintf-js@npm:^1.1.3": version: 1.1.3 resolution: "sprintf-js@npm:1.1.3" @@ -5408,6 +5495,16 @@ __metadata: languageName: node linkType: hard +"stream-combiner@npm:^0.2.2": + version: 0.2.2 + resolution: "stream-combiner@npm:0.2.2" + dependencies: + duplexer: "npm:~0.1.1" + through: "npm:~2.3.4" + checksum: b5d2782fbfa9251c88e01af1b1f54bc183673a776989dce2842b345be7fc3ce7eb2eade363b3c198ba0e5153a20a96e0014d0d0e884153f885d7ee919f22b639 + languageName: node + linkType: hard + "streamsearch@npm:^1.1.0": version: 1.1.0 resolution: "streamsearch@npm:1.1.0" @@ -5741,7 +5838,7 @@ __metadata: languageName: node linkType: hard -"through@npm:>=2.2.7 <3": +"through@npm:2, through@npm:>=2.2.7 <3, through@npm:^2.3.8, through@npm:~2.3, through@npm:~2.3.4": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: 4b09f3774099de0d4df26d95c5821a62faee32c7e96fb1f4ebd54a2d7c11c57fe88b0a0d49cf375de5fee5ae6bf4eb56dbbf29d07366864e2ee805349970d3cc