Skip to content

Commit

Permalink
Upgrade Gatsby to v5
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Nov 26, 2023
1 parent 65dae3c commit c855b78
Show file tree
Hide file tree
Showing 8 changed files with 3,219 additions and 2,337 deletions.
5,445 changes: 3,161 additions & 2,284 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "quill-monorepo",
"private": true,
"version": "2.0.0-dev.4",
"description": "Your powerful, rich text editor",
"author": "Jason Chen <jhchen7@gmail.com>",
Expand Down
2 changes: 1 addition & 1 deletion packages/quill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"defaults"
],
"scripts": {
"build:dev": "./scripts/build development",
"build": "./scripts/build development",
"build:prod": "./scripts/build production",
"build:webpack": "webpack",
"build:release": "./_develop/scripts/release.sh",
Expand Down
40 changes: 19 additions & 21 deletions packages/website/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,25 @@ module.exports = {
});
});
},
query: `
{
allMdx(
sort: { fields: frontmatter___date, order: DESC }
filter: { fields: { pageType: { eq: "blog" } } }
) {
nodes {
frontmatter {
date(formatString: "DD MMM yyyy")
title
}
fields {
permalink
}
id
body
excerpt
}
}
}
`,
query: `{
allMdx(
sort: {frontmatter: {date: DESC}}
filter: {fields: {pageType: {eq: "blog"}}}
) {
nodes {
frontmatter {
date(formatString: "DD MMM yyyy")
title
}
fields {
permalink
}
id
body
excerpt
}
}
}`,
output: '/feed.xml',
title: siteMetadata.title,
match: '^/blog/',
Expand Down
2 changes: 2 additions & 0 deletions packages/website/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ exports.onCreateNode = async ({ node, actions, getNode, reporter, cache }) => {
name: `pageType`,
value: pageType,
});
console.log(filePath)
createNodeField({
node,
name: `slug`,
Expand Down Expand Up @@ -72,6 +73,7 @@ exports.onCreateNode = async ({ node, actions, getNode, reporter, cache }) => {
};
const { default: Content } = await run(result.processedMDX, args);
const value = renderToStaticMarkup(Content(args));
console.log(value)
createNodeField({
node,
name: `excerpt`,
Expand Down
27 changes: 17 additions & 10 deletions packages/website/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
{
"name": "website",
"private": true,
"version": "1.0.0",
"description": "",
"main": "gatsby-browser.js",
"keywords": [],
"author": "",
"license": "BSD-3-Clause",
"overrides": {
"graphql": {
"version": "16.8.1"
}
},
"scripts": {
"build": "gatsby build",
"serve": "gatsby serve",
"develop": "gatsby develop"
},
"dependencies": {
"@mdx-js/react": "^2.1.5",
"babel-preset-gatsby": "^2.24.0",
"@mdx-js/react": "^3.0.0",
"classnames": "^2.3.2",
"gatsby-plugin-google-analytics": "^4.24.0",
"quill": "*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"slugify": "^1.6.5"
},
"devDependencies": {
"gatsby": "^4.24.5",
"gatsby-plugin-feed": "^4.24.0",
"gatsby-plugin-mdx": "^4.3.0",
"babel-preset-gatsby": "^3.12.1",
"gatsby": "^5.12.11",
"gatsby-plugin-feed": "^5.12.3",
"gatsby-plugin-google-analytics": "^5.12.0",
"gatsby-plugin-mdx": "^5.12.3",
"gatsby-plugin-react-svg": "^3.1.0",
"gatsby-plugin-sass": "^5.24.0",
"gatsby-plugin-sass": "^6.12.3",
"gatsby-remark-find-replace": "^0.3.0",
"gatsby-remark-prismjs": "^6.24.0",
"gatsby-source-filesystem": "^4.24.0",
"prism-react-renderer": "^1.3.5",
"gatsby-remark-prismjs": "^7.12.0",
"gatsby-source-filesystem": "^5.12.1",
"prism-react-renderer": "^2.3.0",
"prismjs": "^1.29.0",
"sass": "^1.55.0"
}
Expand Down
3 changes: 1 addition & 2 deletions packages/website/root-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MDXProvider } from '@mdx-js/react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import { Highlight } from 'prism-react-renderer';
import CodePen from './src/components/CodePen';
import Editor from './src/components/Editor';
import {
Expand All @@ -26,7 +26,6 @@ const components = {
const matches = className.match(/language-(?<lang>.*)/);
return (
<Highlight
{...defaultProps}
code={children.props.children}
language={
matches && matches.groups && matches.groups.lang
Expand Down
36 changes: 17 additions & 19 deletions packages/website/src/pages/blog/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,27 @@ const Blog = ({ data }) => (
</Default>
);

export const query = graphql`
query {
allMdx(
sort: { fields: frontmatter___date, order: DESC }
filter: { fields: { pageType: { eq: "blog" } } }
) {
nodes {
fields {
slug
permalink
excerpt
}
frontmatter {
date(formatString: "DD MMM yyyy")
title
}
id
body
export const query = graphql`{
allMdx(
sort: {frontmatter: {date: DESC}}
filter: {fields: {pageType: {eq: "blog"}}}
) {
nodes {
fields {
slug
permalink
excerpt
}
frontmatter {
date(formatString: "DD MMM yyyy")
title
}
id
body
excerpt
}
}
`;
}`;

export const Head = () => (
<>
Expand Down

0 comments on commit c855b78

Please sign in to comment.