my blog https://overreacted.io

Mess around

+383 -29
+1 -1
app/HomeLink.js
··· 4 4 import { usePathname } from "next/navigation"; 5 5 import Link from "./Link"; 6 6 7 - export default function () { 7 + export default function HomeLink() { 8 8 const pathname = usePathname(); 9 9 const isActive = pathname === "/"; 10 10 return (
+17 -1
app/[slug]/markdown.css
··· 1 1 .markdown { 2 2 line-height: 28px; 3 + --path: none; 4 + --radius-top: 12px; 5 + --radius-bottom: 12px; 6 + --padding-top: 1rem; 7 + --padding-bottom: 1rem; 3 8 } 4 9 5 10 .markdown p { ··· 35 40 } 36 41 37 42 .markdown pre { 38 - @apply -mx-4 mb-8 overflow-y-auto rounded-xl p-4 text-sm; 43 + @apply -mx-4 mb-8 overflow-y-auto p-4 text-sm; 44 + clip-path: var(--path); 45 + border-top-right-radius: var(--radius-top); 46 + border-top-left-radius: var(--radius-top); 47 + border-bottom-right-radius: var(--radius-bottom); 48 + border-bottom-left-radius: var(--radius-bottom); 49 + padding-top: var(--padding-top); 50 + padding-bottom: var(--padding-bottom); 39 51 } 40 52 41 53 .markdown pre code { ··· 53 65 .markdown blockquote p { 54 66 margin: 0; 55 67 padding: 0; 68 + } 69 + 70 + .markdown p img { 71 + margin-bottom: 0; 56 72 } 57 73 58 74 .markdown ul {
+107 -26
app/[slug]/page.js
··· 8 8 import overnight from "overnight/themes/Overnight-Slumber.json"; 9 9 import "./markdown.css"; 10 10 11 - export async function generateMetadata({ params }) { 12 - const file = await readFile("./public/" + params.slug + "/index.md", "utf8"); 13 - let { data } = matter(file); 14 - return { 15 - title: data.title + " — overreacted", 16 - description: data.spoiler, 17 - }; 18 - } 11 + overnight.colors["editor.background"] = "var(--code-bg)"; 19 12 20 13 export default async function PostPage({ params }) { 21 14 const file = await readFile("./public/" + params.slug + "/index.md", "utf8"); ··· 44 37 })} 45 38 </p> 46 39 <div className="markdown mt-10"> 47 - <MDXRemote 48 - source={content} 49 - components={{ 50 - a: Link, 51 - }} 52 - options={{ 53 - mdxOptions: { 54 - remarkPlugins: [remarkSmartpants], 55 - rehypePlugins: [ 56 - [ 57 - rehypePrettyCode, 58 - { 59 - theme: overnight, 60 - }, 40 + <Defs> 41 + <MDXRemote 42 + source={content} 43 + components={{ 44 + a: Link, 45 + Server: Server, 46 + Client: Client, 47 + }} 48 + options={{ 49 + mdxOptions: { 50 + useDynamicImport: true, 51 + remarkPlugins: [remarkSmartpants], 52 + rehypePlugins: [ 53 + [ 54 + rehypePrettyCode, 55 + { 56 + theme: overnight, 57 + }, 58 + ], 61 59 ], 62 - ], 63 - }, 64 - }} 65 - /> 60 + }, 61 + }} 62 + /> 63 + </Defs> 66 64 <hr /> 67 65 <p> 68 66 <Link href={discussUrl}>Discuss on 𝕏</Link> ··· 74 72 ); 75 73 } 76 74 75 + function Defs({ children }) { 76 + return ( 77 + <div 78 + style={{ 79 + "--jaggedTopPath": `polygon(${generateJaggedTopPath()})`, 80 + "--jaggedBottomPath": `polygon(${generateJaggedBottomPath()})`, 81 + }} 82 + > 83 + {children} 84 + </div> 85 + ); 86 + } 87 + 88 + function Server({ children }) { 89 + return ( 90 + <div 91 + style={{ 92 + "--path": "var(--jaggedBottomPath)", 93 + "--radius-bottom": 0, 94 + "--padding-bottom": "1.2rem", 95 + }} 96 + > 97 + {children} 98 + </div> 99 + ); 100 + } 101 + 102 + function Client({ children, glued }) { 103 + return ( 104 + <div 105 + style={{ 106 + "--path": "var(--jaggedTopPath)", 107 + "--radius-top": 0, 108 + "--padding-top": "1.2rem", 109 + position: "relative", 110 + marginTop: glued ? -30 : 0, 111 + }} 112 + > 113 + {children} 114 + </div> 115 + ); 116 + } 117 + 118 + const jaggedSliceCount = 50; 119 + 120 + function generateJaggedBottomPath() { 121 + let path = [ 122 + ["0%", "0%"], 123 + ["100%", "0%"], 124 + ["100%", "100%"], 125 + ]; 126 + let left = 100; 127 + let top = 100; 128 + for (let i = 0; i < jaggedSliceCount; i++) { 129 + left -= 100 / jaggedSliceCount; 130 + path.push([`${left}%`, i % 2 === 0 ? `calc(${top}% - 5px)` : `${top}%`]); 131 + } 132 + path.push(["0%", "100%"]); 133 + return path.map((pair) => pair.join(" ")).join(","); 134 + } 135 + 136 + function generateJaggedTopPath() { 137 + let path = [["0%", "5px"]]; 138 + let left = 0; 139 + for (let i = 0; i < jaggedSliceCount; i++) { 140 + left += 100 / jaggedSliceCount; 141 + path.push([`${left}%`, i % 2 === 1 ? "5px" : "0"]); 142 + } 143 + path.push(["100%", "5px"]); 144 + path.push(["100%", "100%"]); 145 + path.push(["0%", "100%"]); 146 + return path.map((pair) => pair.join(" ")).join(","); 147 + } 148 + 77 149 export async function generateStaticParams() { 78 150 const entries = await readdir("./public/", { withFileTypes: true }); 79 151 const dirs = entries ··· 81 153 .map((entry) => entry.name); 82 154 return dirs.map((dir) => ({ slug: dir })); 83 155 } 156 + 157 + export async function generateMetadata({ params }) { 158 + const file = await readFile("./public/" + params.slug + "/index.md", "utf8"); 159 + let { data } = matter(file); 160 + return { 161 + title: data.title + " — overreacted", 162 + description: data.spoiler, 163 + }; 164 + }
+2
app/global.css
··· 6 6 --text: #222; 7 7 --title: #222; 8 8 --bg: white; 9 + --code-bg: #232936; 9 10 --link: #d23669; 10 11 --inlineCode-bg: rgba(255, 229, 100, 0.2); 11 12 --inlineCode-text: #1a1a1a; ··· 17 18 --text: rgba(255, 255, 255, 0.88); 18 19 --title: white; 19 20 --bg: rgb(40, 44, 53); 21 + --code-bg: #191d27; 20 22 --link: #ffa7c4; 21 23 --inlineCode-bg: rgba(115, 124, 153, 0.2); 22 24 --inlineCode-text: #e6e6e6;
+228
package-lock.json
··· 7 7 "": { 8 8 "name": "overreacted", 9 9 "version": "0.1.0", 10 + "hasInstallScript": true, 10 11 "dependencies": { 11 12 "chokidar": "^3.5.3", 12 13 "colorjs.io": "^0.4.5", ··· 27 28 "autoprefixer": "^10.4.16", 28 29 "eslint": "^8", 29 30 "eslint-config-next": "13.5.6", 31 + "patch-package": "^8.0.0", 30 32 "postcss": "^8.4.31", 31 33 "tailwindcss": "^3.3.5" 32 34 } ··· 1120 1122 "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", 1121 1123 "dev": true 1122 1124 }, 1125 + "node_modules/@yarnpkg/lockfile": { 1126 + "version": "1.1.0", 1127 + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", 1128 + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", 1129 + "dev": true 1130 + }, 1123 1131 "node_modules/acorn": { 1124 1132 "version": "8.10.0", 1125 1133 "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", ··· 1380 1388 "dev": true, 1381 1389 "dependencies": { 1382 1390 "has-symbols": "^1.0.3" 1391 + } 1392 + }, 1393 + "node_modules/at-least-node": { 1394 + "version": "1.0.0", 1395 + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", 1396 + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", 1397 + "dev": true, 1398 + "engines": { 1399 + "node": ">= 4.0.0" 1383 1400 } 1384 1401 }, 1385 1402 "node_modules/autoprefixer": { ··· 1681 1698 "node": ">= 6" 1682 1699 } 1683 1700 }, 1701 + "node_modules/ci-info": { 1702 + "version": "3.9.0", 1703 + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", 1704 + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", 1705 + "dev": true, 1706 + "funding": [ 1707 + { 1708 + "type": "github", 1709 + "url": "https://github.com/sponsors/sibiraj-s" 1710 + } 1711 + ], 1712 + "engines": { 1713 + "node": ">=8" 1714 + } 1715 + }, 1684 1716 "node_modules/client-only": { 1685 1717 "version": "0.0.1", 1686 1718 "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", ··· 2672 2704 "url": "https://github.com/sponsors/sindresorhus" 2673 2705 } 2674 2706 }, 2707 + "node_modules/find-yarn-workspace-root": { 2708 + "version": "2.0.0", 2709 + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", 2710 + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", 2711 + "dev": true, 2712 + "dependencies": { 2713 + "micromatch": "^4.0.2" 2714 + } 2715 + }, 2675 2716 "node_modules/flat-cache": { 2676 2717 "version": "3.1.1", 2677 2718 "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", ··· 2711 2752 "funding": { 2712 2753 "type": "patreon", 2713 2754 "url": "https://github.com/sponsors/rawify" 2755 + } 2756 + }, 2757 + "node_modules/fs-extra": { 2758 + "version": "9.1.0", 2759 + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", 2760 + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", 2761 + "dev": true, 2762 + "dependencies": { 2763 + "at-least-node": "^1.0.0", 2764 + "graceful-fs": "^4.2.0", 2765 + "jsonfile": "^6.0.1", 2766 + "universalify": "^2.0.0" 2767 + }, 2768 + "engines": { 2769 + "node": ">=10" 2714 2770 } 2715 2771 }, 2716 2772 "node_modules/fs.realpath": { ··· 3396 3452 "url": "https://github.com/sponsors/wooorm" 3397 3453 } 3398 3454 }, 3455 + "node_modules/is-docker": { 3456 + "version": "2.2.1", 3457 + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", 3458 + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", 3459 + "dev": true, 3460 + "bin": { 3461 + "is-docker": "cli.js" 3462 + }, 3463 + "engines": { 3464 + "node": ">=8" 3465 + }, 3466 + "funding": { 3467 + "url": "https://github.com/sponsors/sindresorhus" 3468 + } 3469 + }, 3399 3470 "node_modules/is-extendable": { 3400 3471 "version": "0.1.1", 3401 3472 "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", ··· 3650 3721 "url": "https://github.com/sponsors/ljharb" 3651 3722 } 3652 3723 }, 3724 + "node_modules/is-wsl": { 3725 + "version": "2.2.0", 3726 + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", 3727 + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", 3728 + "dev": true, 3729 + "dependencies": { 3730 + "is-docker": "^2.0.0" 3731 + }, 3732 + "engines": { 3733 + "node": ">=8" 3734 + } 3735 + }, 3653 3736 "node_modules/isarray": { 3654 3737 "version": "2.0.5", 3655 3738 "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", ··· 3715 3798 "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 3716 3799 "dev": true 3717 3800 }, 3801 + "node_modules/json-stable-stringify": { 3802 + "version": "1.1.0", 3803 + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz", 3804 + "integrity": "sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA==", 3805 + "dev": true, 3806 + "dependencies": { 3807 + "call-bind": "^1.0.5", 3808 + "isarray": "^2.0.5", 3809 + "jsonify": "^0.0.1", 3810 + "object-keys": "^1.1.1" 3811 + }, 3812 + "engines": { 3813 + "node": ">= 0.4" 3814 + }, 3815 + "funding": { 3816 + "url": "https://github.com/sponsors/ljharb" 3817 + } 3818 + }, 3718 3819 "node_modules/json-stable-stringify-without-jsonify": { 3719 3820 "version": "1.0.1", 3720 3821 "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", ··· 3738 3839 "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", 3739 3840 "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" 3740 3841 }, 3842 + "node_modules/jsonfile": { 3843 + "version": "6.1.0", 3844 + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", 3845 + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", 3846 + "dev": true, 3847 + "dependencies": { 3848 + "universalify": "^2.0.0" 3849 + }, 3850 + "optionalDependencies": { 3851 + "graceful-fs": "^4.1.6" 3852 + } 3853 + }, 3854 + "node_modules/jsonify": { 3855 + "version": "0.0.1", 3856 + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", 3857 + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", 3858 + "dev": true, 3859 + "funding": { 3860 + "url": "https://github.com/sponsors/ljharb" 3861 + } 3862 + }, 3741 3863 "node_modules/jsx-ast-utils": { 3742 3864 "version": "3.3.5", 3743 3865 "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", ··· 3768 3890 "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", 3769 3891 "engines": { 3770 3892 "node": ">=0.10.0" 3893 + } 3894 + }, 3895 + "node_modules/klaw-sync": { 3896 + "version": "6.0.0", 3897 + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", 3898 + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", 3899 + "dev": true, 3900 + "dependencies": { 3901 + "graceful-fs": "^4.1.11" 3771 3902 } 3772 3903 }, 3773 3904 "node_modules/kleur": { ··· 7221 7352 "wrappy": "1" 7222 7353 } 7223 7354 }, 7355 + "node_modules/open": { 7356 + "version": "7.4.2", 7357 + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", 7358 + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", 7359 + "dev": true, 7360 + "dependencies": { 7361 + "is-docker": "^2.0.0", 7362 + "is-wsl": "^2.1.1" 7363 + }, 7364 + "engines": { 7365 + "node": ">=8" 7366 + }, 7367 + "funding": { 7368 + "url": "https://github.com/sponsors/sindresorhus" 7369 + } 7370 + }, 7224 7371 "node_modules/optionator": { 7225 7372 "version": "0.9.3", 7226 7373 "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", ··· 7236 7383 }, 7237 7384 "engines": { 7238 7385 "node": ">= 0.8.0" 7386 + } 7387 + }, 7388 + "node_modules/os-tmpdir": { 7389 + "version": "1.0.2", 7390 + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 7391 + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", 7392 + "dev": true, 7393 + "engines": { 7394 + "node": ">=0.10.0" 7239 7395 } 7240 7396 }, 7241 7397 "node_modules/overnight": { ··· 7342 7498 "version": "6.0.1", 7343 7499 "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", 7344 7500 "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" 7501 + }, 7502 + "node_modules/patch-package": { 7503 + "version": "8.0.0", 7504 + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", 7505 + "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", 7506 + "dev": true, 7507 + "dependencies": { 7508 + "@yarnpkg/lockfile": "^1.1.0", 7509 + "chalk": "^4.1.2", 7510 + "ci-info": "^3.7.0", 7511 + "cross-spawn": "^7.0.3", 7512 + "find-yarn-workspace-root": "^2.0.0", 7513 + "fs-extra": "^9.0.0", 7514 + "json-stable-stringify": "^1.0.2", 7515 + "klaw-sync": "^6.0.0", 7516 + "minimist": "^1.2.6", 7517 + "open": "^7.4.2", 7518 + "rimraf": "^2.6.3", 7519 + "semver": "^7.5.3", 7520 + "slash": "^2.0.0", 7521 + "tmp": "^0.0.33", 7522 + "yaml": "^2.2.2" 7523 + }, 7524 + "bin": { 7525 + "patch-package": "index.js" 7526 + }, 7527 + "engines": { 7528 + "node": ">=14", 7529 + "npm": ">5" 7530 + } 7531 + }, 7532 + "node_modules/patch-package/node_modules/rimraf": { 7533 + "version": "2.7.1", 7534 + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", 7535 + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", 7536 + "dev": true, 7537 + "dependencies": { 7538 + "glob": "^7.1.3" 7539 + }, 7540 + "bin": { 7541 + "rimraf": "bin.js" 7542 + } 7543 + }, 7544 + "node_modules/patch-package/node_modules/slash": { 7545 + "version": "2.0.0", 7546 + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", 7547 + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", 7548 + "dev": true, 7549 + "engines": { 7550 + "node": ">=6" 7551 + } 7345 7552 }, 7346 7553 "node_modules/path-exists": { 7347 7554 "version": "4.0.0", ··· 8638 8845 "node": ">=0.8" 8639 8846 } 8640 8847 }, 8848 + "node_modules/tmp": { 8849 + "version": "0.0.33", 8850 + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", 8851 + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", 8852 + "dev": true, 8853 + "dependencies": { 8854 + "os-tmpdir": "~1.0.2" 8855 + }, 8856 + "engines": { 8857 + "node": ">=0.6.0" 8858 + } 8859 + }, 8641 8860 "node_modules/to-regex-range": { 8642 8861 "version": "5.0.1", 8643 8862 "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", ··· 8950 9169 "funding": { 8951 9170 "type": "opencollective", 8952 9171 "url": "https://opencollective.com/unified" 9172 + } 9173 + }, 9174 + "node_modules/universalify": { 9175 + "version": "2.0.1", 9176 + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", 9177 + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", 9178 + "dev": true, 9179 + "engines": { 9180 + "node": ">= 10.0.0" 8953 9181 } 8954 9182 }, 8955 9183 "node_modules/update-browserslist-db": {
+3 -1
package.json
··· 8 8 "build": "next build", 9 9 "start": "next start", 10 10 "lint": "next lint", 11 - "watch-content": "node ./watcher.js" 11 + "watch-content": "node ./watcher.js", 12 + "postinstall": "patch-package" 12 13 }, 13 14 "dependencies": { 14 15 "chokidar": "^3.5.3", ··· 30 31 "autoprefixer": "^10.4.16", 31 32 "eslint": "^8", 32 33 "eslint-config-next": "13.5.6", 34 + "patch-package": "^8.0.0", 33 35 "postcss": "^8.4.31", 34 36 "tailwindcss": "^3.3.5" 35 37 }
+25
patches/next-mdx-remote+4.4.1.patch
··· 1 + diff --git a/node_modules/next-mdx-remote/dist/rsc.js b/node_modules/next-mdx-remote/dist/rsc.js 2 + index 8ab7d78..a75b600 100644 3 + --- a/node_modules/next-mdx-remote/dist/rsc.js 4 + +++ b/node_modules/next-mdx-remote/dist/rsc.js 5 + @@ -2701,6 +2701,8 @@ async function serialize(source, { scope = {}, mdxOptions = {}, parseFrontmatter 6 + }; 7 + } 8 + 9 + +import Module from "node:module"; 10 + + 11 + /** 12 + * Copyright (c) HashiCorp, Inc. 13 + * SPDX-License-Identifier: MPL-2.0 14 + @@ -2722,8 +2724,9 @@ async function compileMDX({ source, options, components = {}, }) { 15 + // and all our components in scope for the function, which is the case here 16 + // we pass the names (via keys) in as the function's args, and execute the 17 + // function with the actual values. 18 + - const hydrateFn = Reflect.construct(Function, keys.concat(`${compiledSource}`)); 19 + - const Content = hydrateFn.apply(hydrateFn, values).default; 20 + + const AsyncFunction = Object.getPrototypeOf(async function() { }).constructor; 21 + + const hydrateFn = AsyncFunction(...keys.concat(`${compiledSource}`)); 22 + + const Content = (await hydrateFn.apply(hydrateFn, values)).default; 23 + return { 24 + content: React.createElement(Content, { components: components }), 25 + frontmatter,