Skip to content

Commit 252907a

Browse files
committed
Upgrade deps, fix blog
1 parent 8c286ee commit 252907a

20 files changed

+2729
-7773
lines changed

next-env.d.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2+
output: "export",
23
trailingSlash: true,
34
};

package-lock.json

+2,605-7,508
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+17-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "next build",
88
"export": "next export",
99
"format": "npm run prettier -- \"{src,posts,public}/**/*.{js,jsx,ts,tsx,json,css,md,yml,yaml}\"",
10-
"postbuild": "ts-node --files src/scripts/feed.ts",
10+
"postbuild": "tsx src/scripts/feed.ts",
1111
"start": "next start",
1212
"typecheck": "tsc",
1313
"prettier": "prettier --write"
@@ -31,27 +31,25 @@
3131
"*.{js,jsx,ts,tsx,json,css,md,yml,yaml}": "npm run prettier"
3232
},
3333
"dependencies": {
34-
"date-fns": "^2.14.0",
35-
"globby": "^11.0.0",
36-
"gray-matter": "4.0.2",
37-
"react": "^16.13.0",
38-
"react-dom": "^16.13.0",
34+
"date-fns": "^3.6.0",
35+
"globby": "^14.0.2",
36+
"gray-matter": "^4.0.3",
37+
"react": "^18.3.1",
38+
"react-dom": "^18.3.1",
3939
"react-free-style": "^11.1.0",
40-
"remark": "^12.0.0",
41-
"remark-highlight.js": "^6.0.0",
42-
"remark-html": "^11.0.2",
43-
"typescript": "^3.9.2"
40+
"remark": "^15.0.1",
41+
"remark-highlight.js": "^7.0.1",
42+
"remark-html": "^16.0.1",
43+
"typescript": "^5.5.4"
4444
},
4545
"devDependencies": {
46-
"@cloudflare/wrangler": "^1.9.2",
47-
"@types/jest": "^26.0.20",
48-
"@types/node": "^14.0.1",
49-
"@types/react": "^17.0.0",
50-
"@types/react-dom": "^17.0.0",
51-
"fdir": "^5.0.0",
46+
"@types/jest": "^29.5.12",
47+
"@types/node": "^22.5.2",
48+
"@types/react": "^18.3.5",
49+
"@types/react-dom": "^18.3.0",
5250
"feed": "^4.2.0",
53-
"next": "^10.0.5",
54-
"prettier": "^2.0.5",
55-
"ts-node": "^9.1.1"
51+
"next": "^14.2.7",
52+
"prettier": "^3.3.3",
53+
"tsx": "^4.19.0"
5654
}
5755
}

posts/2014-01-function-arity-in-javascript.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var arity = function (length, fn) {
3838
__slice.call(names, 0, length).join(",") +
3939
") {\n" +
4040
"return fn.apply(this, arguments);\n" +
41-
"})"
41+
"})",
4242
);
4343
};
4444
```

posts/2014-01-javascript-partial-application.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var partial = variadic(function (fn, args) {
5454
remaining,
5555
variadic(function (called) {
5656
return fn.apply(this, args.concat(called));
57-
})
57+
}),
5858
);
5959
});
6060
```

posts/2014-02-introducing-node-retest.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ retest(app).post(
8181
// was set to `application/x-www-form-urlencoded`, we would expect the
8282
// response body to equal `test=data`.
8383
expect(res.body).to.equal('{"test":"data"}');
84-
}
84+
},
8585
);
8686
```
8787

posts/2014-05-angular-js-number-validation-bug.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ it("...", function () {
9898
var $element = $compile(
9999
'<form name="form">' +
100100
' <input name="num" ng-model="model.value" app-type="number">' +
101-
"</form>"
101+
"</form>",
102102
)($scope);
103103

104104
// Set the value to what you want to test.

public/_redirects

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/articles/2011/04/wii-jailbreak-3-0-4-2 /posts/2011-04-wii-jailbreak
2+
/articles/2011/09/warning-somethings-not-right /posts/2011-09-warning-somethings-not-right
3+
/articles/2011/10/geektool-change-desktop-background /posts/2011-10-geektool-change-desktop-background
4+
/articles/2012/04/local-development-with-dnsmasq /posts/2012-04-local-development-with-dnsmasq
5+
/articles/2013/04/contributing-to-open-source /posts/2013-04-contributing-to-open-source
6+
/articles/2013/07/improve-dev-tools-console-workflow /posts/2013-07-improve-dev-tools-console-workflow
7+
/articles/2013/08/sublime-text-preferences /posts/2013-08-sublime-text-preferences
8+
/articles/2013/08/writing-github-pages-deploy-script /posts/2013-08-github-pages-deploy-script
9+
/articles/2013/09/introduction-to-browserify /posts/2013-09-introduction-to-browserify
10+
/articles/2013/12/javascript-bind-function /posts/2013-12-javascript-bind-function
11+
/articles/2013/12/javascript-variadic-function /posts/2013-12-javascript-variadic-function
12+
/articles/2014/01/compose-functions-javascript /posts/2014-01-compose-functions-javascript
13+
/articles/2014/01/forcing-function-arity-in-javascript /posts/2014-01-function-arity-in-javascript
14+
/articles/2014/01/javascript-invoke-function /posts/2014-01-javascript-invoke-function
15+
/articles/2014/01/javascript-result-utility /posts/2014-01-javascript-result-utility
16+
/articles/2014/01/javascript-tap-function /posts/2014-01-javascript-tap-function
17+
/articles/2014/01/partial-application-in-javascript /posts/2014-01-javascript-partial-application
18+
/articles/2014/01/wrapping-javascript-functions /posts/2014-01-wrapping-javascript-functions
19+
/articles/2014/02/introducing-node-retest /posts/2014-02-introducing-node-retest
20+
/articles/2014/02/mocha-test-harmony-generators /posts/2014-02-mocha-test-harmony-generators
21+
/articles/2014/05/angular-js-number-validation-bug /posts/2014-05-angular-js-number-validation-bug
22+
/articles/2014/09/building-a-blog-with-metalsmith /posts/2014-09-building-a-blog-with-metalsmith
23+
/articles/2014/12/syntax-highlighting-blog-diff-support /posts/2014-12-syntax-highlighting-blog-diff-support
24+
/articles/2015/04/typescript-constructor-of-type /posts/2015-04-typescript-constructor-of-type
25+
/articles/2015/06/facetime-auto-answer-applescript /posts/2015-06-facetime-auto-answer
26+
/articles/2015/06/skype-auto-answer-with-applescript /posts/2015-06-skype-auto-answer
27+
/articles/2015/11/state-of-typescript-packaging /posts/2015-11-state-of-typescript-packaging
28+
/articles/2016/01/intro-to-free-style-css-in-js /posts/2016-01-intro-to-free-style-css-in-js
29+
/self/2017-04-09-review /posts/2017-04-09-review
30+
/self/2017-04-16-review /posts/2017-04-16-review
31+
/self/2017-04-24-review /posts/2017-04-24-review
32+
/self/2017-05-01-review /posts/2017-05-01-review
33+
/self/2017-05-07-review /posts/2017-05-07-review
34+
/self/2017-05-16-review /posts/2017-05-16-review
35+
/self/2017-05-22-review /posts/2017-05-22-review
36+
/self/2017-05-30-review /posts/2017-05-30-review
37+
/self/2017-06-05-review /posts/2017-06-05-review
38+
/self/2017-06-12-review /posts/2017-06-12-review
39+
/self/2017-06-22-review /posts/2017-06-22-review
40+
/self/2017-06-26-review /posts/2017-06-26-review
41+
/self/2017-07-04-review /posts/2017-07-04-review
42+
/self/2017-07-10-review /posts/2017-07-10-review
43+
/self/2017-07-17-review /posts/2017-07-17-review
44+
/self/2017-07-23-review /posts/2017-07-23-review
45+
/self/2017-07-31-review /posts/2017-07-31-review
46+
/self/2017-08-09-review /posts/2017-08-09-review
47+
/self/2017-08-20-review /posts/2017-08-20-review
48+
/self/2017-08-28-review /posts/2017-08-28-review
49+
/self/2017-09-05-review /posts/2017-09-05-review
50+
/self/2017-09-11-review /posts/2017-09-11-review
51+
/software/git /posts/software-git

src/components/layout.tsx

+29-28
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ const Container = styled("div", [
5050
'button,[type="button"],[type="reset"],[type="submit"]': {
5151
WebkitAppearance: "button",
5252
},
53-
'button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner': {
54-
borderStyle: "none",
55-
padding: "0",
56-
},
57-
'button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring': {
58-
outline: "1px dotted ButtonText",
59-
},
53+
'button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner':
54+
{
55+
borderStyle: "none",
56+
padding: "0",
57+
},
58+
'button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring':
59+
{
60+
outline: "1px dotted ButtonText",
61+
},
6062
fieldset: { padding: "0.35em 0.75em 0.625em" },
6163
legend: {
6264
boxSizing: "border-box",
@@ -72,9 +74,10 @@ const Container = styled("div", [
7274
boxSizing: "border-box",
7375
padding: "0",
7476
},
75-
'[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button': {
76-
height: "auto",
77-
},
77+
'[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button':
78+
{
79+
height: "auto",
80+
},
7881
'[type="search"]': { WebkitAppearance: "textfield", outlineOffset: "-2px" },
7982
'[type="search"]::-webkit-search-decoration': { WebkitAppearance: "none" },
8083
"::-webkit-file-upload-button": {
@@ -133,7 +136,7 @@ const Header = styled("ul", {
133136
fontSize: "1.2em",
134137
});
135138

136-
const HeaderLink = styled("a", {
139+
const HeaderLink = styled(Link, {
137140
color: "inherit",
138141
textDecoration: "none",
139142
borderBottom: "2px solid transparent",
@@ -233,9 +236,10 @@ const Content = styled("div", {
233236
color: "#a71d5d",
234237
},
235238
".hljs-number,.hljs-hexcolor,.hljs-constant": { color: "#0086b3" },
236-
".hljs-string,.hljs-tag .hljs-value,.hljs-phpdoc,.hljs-dartdoc,.hljs-formula": {
237-
color: "#df5000",
238-
},
239+
".hljs-string,.hljs-tag .hljs-value,.hljs-phpdoc,.hljs-dartdoc,.hljs-formula":
240+
{
241+
color: "#df5000",
242+
},
239243
".hljs-title,.hljs-id,.hljs-preprocessor": { color: "#795da3" },
240244
".hljs-class .hljs-title,.hljs-type,.hljs-literal,.hljs-command": {
241245
color: "#458",
@@ -250,10 +254,11 @@ const Content = styled("div", {
250254
color: "#990073",
251255
},
252256
".hljs-built_in": { color: "#0086b3" },
253-
".hljs-preprocessor,.hljs-pragma,.hljs-pi,.hljs-doctype,.hljs-shebang,.hljs-cdata": {
254-
color: "#999",
255-
fontWeight: "bolder",
256-
},
257+
".hljs-preprocessor,.hljs-pragma,.hljs-pi,.hljs-doctype,.hljs-shebang,.hljs-cdata":
258+
{
259+
color: "#999",
260+
fontWeight: "bolder",
261+
},
257262
".hljs-deletion": { background: "#fdd" },
258263
".hljs-addition": { background: "#dfd" },
259264
".hljs-change": { background: "#0086b3" },
@@ -275,16 +280,12 @@ export const Layout = ({ page, children }: Props) => {
275280
<BorderTop />
276281
<Container>
277282
<Header>
278-
<Link href="/" passHref>
279-
<PrimaryHeaderLink className={page === "index" ? "active" : ""}>
280-
Writing
281-
</PrimaryHeaderLink>
282-
</Link>
283-
<Link href="/supporters/" passHref>
284-
<HeaderLink className={page === "supporters" ? "active" : ""}>
285-
Supporters
286-
</HeaderLink>
287-
</Link>
283+
<PrimaryHeaderLink
284+
href="/"
285+
className={page === "index" ? "active" : ""}
286+
>
287+
Writing
288+
</PrimaryHeaderLink>
288289
</Header>
289290

290291
<Content>{children}</Content>

src/lib/api.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { join } from "path";
22
import matter from "gray-matter";
3-
import globby from "globby";
3+
import { globby } from "globby";
44
import { readFile } from "fs/promises";
55
import { PostEntity } from "../types/entities";
66
import markdownToHtml from "./md";
@@ -25,6 +25,6 @@ export async function getAllPosts() {
2525
const paths = await getPostPaths();
2626
const pages = await Promise.all(paths.map((x) => getPostByPath(x)));
2727
return pages.sort((a, b) =>
28-
(a.data.date || "") < (b.data.date || "") ? 1 : -1
28+
(a.data.date || "") < (b.data.date || "") ? 1 : -1,
2929
);
3030
}

src/lib/md.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import remark from "remark";
1+
import { remark } from "remark";
22
import html from "remark-html";
33
import highlight from "remark-highlight.js";
44

src/pages/index.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ const Index: React.FC<Props> = ({ posts }) => {
3434
<Article key={x.title}>
3535
<ArticleMetadata>{x.date}</ArticleMetadata>
3636
<ArticleTitle>
37-
<Link href={x.url}>
38-
<a>{x.title}</a>
39-
</Link>
37+
<Link href={x.url}>{x.title}</Link>
4038
</ArticleTitle>
4139
</Article>
4240
);

src/pages/supporters.tsx

-41
This file was deleted.

tsconfig.json

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
59
"allowJs": true,
610
"skipLibCheck": true,
711
"strict": true,
@@ -12,13 +16,19 @@
1216
"moduleResolution": "node",
1317
"resolveJsonModule": true,
1418
"isolatedModules": true,
15-
"jsx": "preserve"
19+
"jsx": "preserve",
20+
"incremental": true
1621
},
1722
"ts-node": {
1823
"compilerOptions": {
1924
"module": "commonjs"
2025
}
2126
},
22-
"exclude": ["node_modules"],
23-
"include": ["src/**/*", "next-env.d.ts"]
27+
"exclude": [
28+
"node_modules"
29+
],
30+
"include": [
31+
"src/**/*",
32+
"next-env.d.ts"
33+
]
2434
}

0 commit comments

Comments
 (0)