Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dguo committed Feb 23, 2024
1 parent 8229eef commit 6d87a7a
Show file tree
Hide file tree
Showing 10 changed files with 1,396 additions and 1,018 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
20.11.1
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 18.16.0
nodejs 20.11.1
19 changes: 16 additions & 3 deletions components/SyntaxHighlighter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@ import {LightAsync} from "react-syntax-highlighter";
import {a11yDark} from "react-syntax-highlighter/dist/cjs/styles/hljs";

function SyntaxHighlighter(props) {
return (
const {children, className, node, ...rest} = props;
const match = /language-(\w+)/.exec(className || "");

if (!children) {
return null;
}

return match ? (
<LightAsync
language={props.language}
{...rest}
PreTag="div"
children={String(children).replace(/\n$/, "")}
language={match[1]}
style={a11yDark}
children={props.value || ""}
/>
) : (
<code {...rest} className={className}>
{children}
</code>
);
}

Expand Down
2 changes: 1 addition & 1 deletion components/Template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function Template() {
id="rendered"
className="markdown-body bg-white p-4 rounded-lg"
>
<ReactMarkdown renderers={{code: SyntaxHighlighter}}>
<ReactMarkdown components={{code: SyntaxHighlighter}}>
{template}
</ReactMarkdown>
</div>
Expand Down
6 changes: 6 additions & 0 deletions global.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ a.anchorjs-link:hover {
#faq h2 > a.anchorjs-link {
@apply text-blue-400;
}

/* For code examples in the rendered template, avoid padding because the div
that comes with react-syntax-highliter handles it. */
.markdown-body pre {
padding: 0px;
}
16 changes: 8 additions & 8 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[build]
command = "yarn run export"
publish = "build"
command = "yarn run build"
publish = "build"

# Plausible
[[redirects]]
from = "/lava-cake/js/script.js"
to = "https://plausible.io/js/script.js"
status = 200
from = "/lava-cake/js/script.js"
to = "https://plausible.io/js/script.js"
status = 200
[[redirects]]
from = "/lava-cake/api/event"
to = "https://plausible.io/api/event"
status = 200
from = "/lava-cake/api/event"
to = "https://plausible.io/api/event"
status = 200
11 changes: 10 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
module.exports = {
// @ts-check

/**
* @type {import('next').NextConfig}
**/
const nextConfig = {
distDir: "build",
output: "export",
productionBrowserSourceMaps: true
};

module.exports = nextConfig;
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"scripts": {
"dev": "yarn install && next dev",
"build": "next build",
"export": "next build && next export -o build",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
Expand All @@ -14,27 +13,27 @@
"license": "MIT",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "6.2.0",
"@fortawesome/free-solid-svg-icons": "6.2.0",
"@fortawesome/fontawesome-svg-core": "6.5.1",
"@fortawesome/free-solid-svg-icons": "6.5.1",
"@fortawesome/react-fontawesome": "0.2.0",
"github-markdown-css": "5.1.0",
"github-markdown-css": "5.5.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-github-corner": "2.5.0",
"react-markdown": "5.0.3",
"react-markdown": "9.0.1",
"react-syntax-highlighter": "15.5.0",
"react-textarea-autosize": "8.4.1"
"react-textarea-autosize": "8.5.3"
},
"devDependencies": {
"@types/node": "18.11.9",
"@types/react": "18.0.25",
"@types/react-syntax-highlighter": "15.5.5",
"autoprefixer": "10.4.13",
"next": "13.5.1",
"postcss": "8.4.31",
"prettier": "2.7.1",
"tailwindcss": "3.2.2",
"typescript": "4.8.4"
"@types/node": "20.11.20",
"@types/react": "18.2.57",
"@types/react-syntax-highlighter": "15.5.11",
"autoprefixer": "10.4.17",
"next": "14.1.0",
"postcss": "8.4.35",
"prettier": "3.2.5",
"tailwindcss": "3.4.1",
"typescript": "5.3.3"
},
"prettier": {
"bracketSpacing": false,
Expand Down
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "github-markdown-css/github-markdown.css";
import "github-markdown-css/github-markdown-light.css";
import "../global.css";

import "@fortawesome/fontawesome-svg-core/styles.css";
Expand Down
Loading

0 comments on commit 6d87a7a

Please sign in to comment.