Skip to content

Commit 6f9c24c

Browse files
authored
Npm update everything except next.js and bulma (#790)
* use next/font instead of @next/font Fixes build error due to future deprecation of @next/font in favor of next/font. See https://nextjs.org/docs/messages/built-in-next-font * npm bump classnames https://github.com/JedWatson/classnames/blob/main/HISTORY.md No breaking changes * npm bump glob https://github.com/isaacs/node-glob/blob/main/changelog.md Used for listing the blog articles. Changed to using globSync alias instead of glob. * npm bump highlight.js https://github.com/highlightjs/highlight.js/blob/main/CHANGES.md No relevant changes * npm bump react and react-dom https://github.com/facebook/react/blob/main/CHANGELOG.md No relevant changes * npm bump rehype-highlight, rehype-raw and add lowlight https://github.com/rehypejs/rehype-highlight/releases/tag/7.0.1 https://github.com/rehypejs/rehype-highlight/releases/tag/7.0.0 https://github.com/rehypejs/rehype-raw/releases/tag/7.0.0 Required adding lowlight as a dependency to the project and updating the config to use the common languages from lowlight as these are no longer included in the config by default. No relevant changes in rehype-raw * npm bump rehype-slug rehypejs/rehype-slug@5.1.0...6.0.0 No relevant changes * npm bump rehype-stringify, remark{-parse,-rehype}, unified{,-stream} bumped together as these should be using consistent versions. https://github.com/rehypejs/rehype/releases https://github.com/remarkjs/remark/releases https://github.com/remarkjs/remark-rehype/releases https://github.com/unifiedjs/unified/releases https://github.com/unifiedjs/unified-stream/releases/tag/3.0.0 * npm bump unist-util-visit https://github.com/syntax-tree/unist-util-visit/releases/tag/5.0.0 * npm bump dev dependencies * npm bump sass https://github.com/sass/dart-sass/blob/main/CHANGELOG.md No obvious breaking changes, but this is a large version bump (48 versions), so there may be some sutle ones. No errors. * npm run fmt
1 parent 4bd85d5 commit 6f9c24c

File tree

5 files changed

+2269
-1502
lines changed

5 files changed

+2269
-1502
lines changed

components/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { FC, ReactNode } from "react";
22

33
import Head from "next/head";
44
import Navigation from "./nav";
5-
import { Roboto } from "@next/font/google";
5+
import { Roboto } from "next/font/google";
66

77
const roboto = Roboto({
88
weight: ["300", "400", "500", "700"],

lib/api.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import fs from "fs";
2-
import glob from "glob";
2+
import { globSync } from "glob";
33
import path from "path";
44
import matter from "gray-matter";
55

@@ -40,8 +40,7 @@ export function getLastBlog() {
4040
}
4141

4242
export function getDateOrderedPaths(root) {
43-
return glob
44-
.sync(`${contentDir}/${root}/*.md`)
43+
return globSync(`${contentDir}/${root}/*.md`)
4544
.map((fullPath) => {
4645
const path = fullPath.replace(`${contentDir}/`, "").replace(/\.md$/, "");
4746
const page = loadPage(path);

lib/markdown.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import remarkParse from "remark-parse";
33
import remarkRehype from "remark-rehype";
44
import rehypeStringify from "rehype-stringify";
55
import rehypeHighlight from "rehype-highlight";
6+
import { common } from "lowlight";
67
import rehypeRaw from "rehype-raw";
78
import rehypeSlug from "rehype-slug";
89
import { visit } from "unist-util-visit";
@@ -69,7 +70,7 @@ const rehyperBlockquotePlusOptions = {
6970
};
7071

7172
const rehypeHighlightOptions = {
72-
languages: { rust: rust },
73+
languages: { ...common, rust: rust },
7374
aliases: { rust: ["rs", "rust,compile_fail", "rust,ignore", "rust="] },
7475
plainText: ["txt", "text", "plain", "log"],
7576
};
@@ -79,13 +80,11 @@ export const toHTML = async (raw) => {
7980
await unified()
8081
.use(remarkParse)
8182
.use(remarkCodeRemoveSomeLines)
82-
// @ts-expect-error: unified's plugin type mistakenly selects the wrong union overload
8383
.use(remarkRehype, { allowDangerousHtml: true })
8484
.use(rehypeHighlight, rehypeHighlightOptions)
8585
.use(rehypeRaw)
8686
.use(rehypeSlug)
8787
.use(rehyperBlockquotePlus, rehyperBlockquotePlusOptions)
88-
// @ts-expect-error: unified's plugin type mistakenly selects the Array<void> union variant
8988
.use(rehypeStringify)
9089
.process(raw),
9190
);

0 commit comments

Comments
 (0)