Skip to content

Commit ffea5fd

Browse files
committed
chore: remove service worker and update deps
as the service-worker prevents the updating of static assets from other subsites
1 parent 75a08b2 commit ffea5fd

File tree

4 files changed

+3494
-4214
lines changed

4 files changed

+3494
-4214
lines changed

.github/workflows/deploy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
14+
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 18
16+
node-version: 20
1717
- uses: pnpm/action-setup@v2
1818
with:
1919
version: 8

gatsby-config.js renamed to gatsby-config.mjs

+11-18
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
function esmRequire(name) {
2-
return function plugin(opts) {
3-
return async (...args) => {
4-
const { default: plugin } = await import(name);
5-
return plugin(opts)(...args);
6-
};
7-
};
8-
}
1+
import remarkGfm from 'remark-gfm';
2+
import remarkExternalLinks from 'remark-external-links';
3+
import rehypePrism from 'rehype-prism-plus';
4+
import rehypeSlug from 'rehype-slug';
95

10-
module.exports = {
6+
export default {
117
siteMetadata: {
128
siteUrl: 'https://violentmonkey.github.io/',
139
title: 'Violentmonkey',
@@ -66,7 +62,7 @@ module.exports = {
6662
icon: 'src/assets/vm.png',
6763
},
6864
},
69-
'gatsby-plugin-offline',
65+
'gatsby-plugin-remove-serviceworker',
7066
{
7167
resolve: 'gatsby-plugin-mdx',
7268
options: {
@@ -78,12 +74,6 @@ module.exports = {
7874
offsetY: 70,
7975
},
8076
},
81-
{
82-
resolve: 'gatsby-remark-external-links',
83-
options: {
84-
rel: 'noopener noreferrer',
85-
},
86-
},
8777
{
8878
resolve: 'gatsby-remark-images',
8979
options: {
@@ -94,7 +84,11 @@ module.exports = {
9484
'@gera2ld/gatsby-remark-emoji',
9585
],
9686
mdxOptions: {
97-
rehypePlugins: [esmRequire('rehype-prism-plus')],
87+
remarkPlugins: [remarkGfm, remarkExternalLinks],
88+
rehypePlugins: [
89+
rehypeSlug,
90+
[rehypePrism, { ignoreMissing: true }],
91+
],
9892
},
9993
},
10094
},
@@ -107,7 +101,6 @@ module.exports = {
107101
// query: 'allMdx',
108102
// },
109103
// },
110-
// 'gatsby-plugin-meta-redirect',
111104
{
112105
resolve: 'gatsby-source-filesystem',
113106
options: {

package.json

+21-20
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,42 @@
1616
"author": "Gerald <[email protected]>",
1717
"license": "MIT",
1818
"engines": {
19-
"node": ">=18"
19+
"node": ">=20"
2020
},
2121
"devDependencies": {
2222
"@babel/preset-react": "^7.22.5",
23-
"@gera2ld/plaid": "~2.6.0",
23+
"@gera2ld/plaid": "~2.7.0",
2424
"babel-plugin-module-resolver": "^5.0.0"
2525
},
2626
"dependencies": {
2727
"@gera2ld/gatsby-remark-emoji": "^0.2.0",
28-
"@mapbox/rehype-prism": "^0.8.0",
2928
"@mdx-js/mdx": "^2.3.0",
3029
"@mdx-js/react": "^2.3.0",
31-
"@unocss/reset": "^0.55.2",
32-
"gatsby": "^5.11.0",
33-
"gatsby-plugin-catch-links": "^5.11.0",
34-
"gatsby-plugin-google-gtag": "^5.11.0",
35-
"gatsby-plugin-image": "^3.11.0",
36-
"gatsby-plugin-manifest": "^5.11.0",
37-
"gatsby-plugin-mdx": "^5.11.0",
38-
"gatsby-plugin-meta-redirect": "^1.1.1",
39-
"gatsby-plugin-offline": "^6.11.0",
40-
"gatsby-plugin-postcss": "^6.11.0",
41-
"gatsby-plugin-sharp": "^5.11.0",
42-
"gatsby-plugin-sitemap": "^6.11.0",
30+
"@unocss/reset": "^0.58.5",
31+
"gatsby": "^5.13.3",
32+
"gatsby-plugin-catch-links": "^5.13.0",
33+
"gatsby-plugin-google-gtag": "^5.13.0",
34+
"gatsby-plugin-image": "^3.13.0",
35+
"gatsby-plugin-manifest": "^5.13.0",
36+
"gatsby-plugin-mdx": "^5.13.0",
37+
"gatsby-plugin-postcss": "^6.13.0",
38+
"gatsby-plugin-remove-serviceworker": "^1.0.0",
39+
"gatsby-plugin-sharp": "^5.13.0",
40+
"gatsby-plugin-sitemap": "^6.13.0",
4341
"gatsby-redirect-from": "^1.0.5",
44-
"gatsby-remark-autolink-headers": "^6.11.0",
42+
"gatsby-remark-autolink-headers": "^6.13.1",
4543
"gatsby-remark-external-links": "^0.0.4",
46-
"gatsby-remark-images": "^7.11.0",
47-
"gatsby-remark-prismjs": "^7.11.0",
48-
"gatsby-source-filesystem": "^5.11.0",
49-
"gatsby-transformer-sharp": "^5.11.0",
44+
"gatsby-remark-images": "^7.13.0",
45+
"gatsby-source-filesystem": "^5.13.0",
46+
"gatsby-transformer-sharp": "^5.13.0",
47+
"mdx-embed": "^1.1.2",
5048
"prismjs": "^1.29.0",
5149
"react": "^18.2.0",
5250
"react-dom": "^18.2.0",
5351
"rehype-prism-plus": "^1.6.3",
52+
"rehype-slug": "^6.0.0",
53+
"remark-external-links": "^9.0.1",
54+
"remark-gfm": "^3.0.1",
5455
"unstated-next": "^1.1.0",
5556
"webfontloader": "^1.6.28"
5657
}

0 commit comments

Comments
 (0)