Skip to content

Commit

Permalink
Bump Node.js, Gatsby, and package version (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucydodo authored Jun 22, 2024
1 parent d8ffe3d commit c82fd45
Show file tree
Hide file tree
Showing 60 changed files with 11,410 additions and 10,734 deletions.
6 changes: 3 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"extends": [
"prettier",
"prettier/react"
"eslint:recommended",
"prettier"
],
"plugins": [
"react",
"prettier"
],
"parserOptions": {
"ecmaVersion": 2016,
"ecmaVersion": 2023,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.2.0
20.12.2
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM node:10-alpine
FROM node:20-alpine

WORKDIR /app
COPY . /app
CMD ["SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm_config_arch=x64 npm_config_platform=linux yarn add sharp"]
ENTRYPOINT ["yarn"]
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ yarn fetch-contributors > website/_data/contributors.json

### Gatsby Installed Locally

**This seems to depend on Node v10. Until the dependencies updated to support
newer versions of Node, you can use the Docker setup.**

To start Gatsby in development mode and serve the the website on
`http://localhost:8000` use:

Expand Down
15 changes: 9 additions & 6 deletions bin/export-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ browser.on('result', function onResult(content) {
})

browser.on('end', function onEnd() {
fs.writeFile('browse.json', JSON.stringify(hits, null, 2), 'utf-8', function(
err
) {
if (err) throw err
console.log('Your index has been exported!')
})
fs.writeFile(
'browse.json',
JSON.stringify(hits, null, 2),
'utf-8',
function (err) {
if (err) throw err
console.log('Your index has been exported!')
}
)
})

browser.on('error', function onError(err) {
Expand Down
2 changes: 1 addition & 1 deletion bin/fetch-contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function getPage(page) {
}

return new Promise((resolve, reject) => {
request(url, { qs, headers }, function(error, response, body) {
request(url, { qs, headers }, function (error, response, body) {
if (error) {
reject(error)
} else {
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.2'
services:
gatsby:
build: .
Expand Down
34 changes: 17 additions & 17 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,25 @@ const config = {
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-video',
options: {
width: '100%',
height: 'auto',
preload: 'auto',
muted: true,
autoplay: true,
playsinline: true,
controls: false,
loop: true
}},
{
resolve: "gatsby-remark-external-links",
resolve: 'gatsby-remark-video',
options: {
target: "_blank",
rel: "nofollow noopener noreferrer"
}
width: '100%',
height: 'auto',
preload: 'auto',
muted: true,
autoplay: true,
playsinline: true,
controls: false,
loop: true,
},
},
{
resolve: 'gatsby-remark-external-links',
options: {
target: '_blank',
rel: 'nofollow noopener noreferrer',
},
},
{
resolve: 'gatsby-remark-images',
Expand All @@ -73,7 +74,6 @@ const config = {
resolve: 'gatsby-plugin-netlify',
options: {
mergeSecurityHeaders: false,
mergeLinkHeaders: true,
mergeCachingHeaders: true,
},
},
Expand Down
2 changes: 1 addition & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ exports.createPages = ({ actions: { createPage }, graphql }) => {
}
}
}
`).then(result => {
`).then((result) => {
if (result.errors) {
return Promise.reject(result.errors)
}
Expand Down
114 changes: 60 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,74 @@
"description": "Redash Website & Knowledge Base",
"main": "n/a",
"dependencies": {
"algoliasearch": "^3.32.0",
"bootstrap-sass": "^3.4.0",
"gatsby": "2.0.91",
"gatsby-image": "2.0.25",
"gatsby-link": "2.0.7",
"gatsby-plugin-algolia": "^0.3.0",
"gatsby-plugin-catch-links": "2.0.9",
"gatsby-plugin-feed": "2.0.11",
"gatsby-plugin-google-analytics": "2.0.8",
"gatsby-plugin-netlify": "2.0.6",
"gatsby-plugin-nprogress": "2.0.7",
"gatsby-plugin-preact": "2.0.8",
"gatsby-plugin-react-helmet": "3.0.5",
"algoliasearch": "^4.23.3",
"axios": "1.7.2",
"bootstrap-sass": "3.4.1",
"gatsby": "5.13.6",
"gatsby-image": "3.11.0",
"gatsby-link": "5.13.1",
"gatsby-plugin-algolia": "^1.0.3",
"gatsby-plugin-catch-links": "5.13.1",
"gatsby-plugin-feed": "5.13.1",
"gatsby-plugin-google-analytics": "5.13.1",
"gatsby-plugin-netlify": "5.1.1",
"gatsby-plugin-nprogress": "5.13.1",
"gatsby-plugin-preact": "7.13.1",
"gatsby-plugin-react-helmet": "6.13.1",
"gatsby-plugin-react-next": "2.0.1-13",
"gatsby-plugin-remove-serviceworker": "^1.0.0",
"gatsby-plugin-sass": "^2.0.0-rc.2",
"gatsby-plugin-sharp": "2.0.16",
"gatsby-plugin-sitemap": "2.0.3",
"gatsby-plugin-twitter": "2.0.8",
"gatsby-remark-copy-linked-files": "2.0.8",
"gatsby-plugin-sass": "^6.13.1",
"gatsby-plugin-sharp": "5.13.1",
"gatsby-plugin-sitemap": "6.13.1",
"gatsby-plugin-twitter": "5.13.1",
"gatsby-remark-copy-linked-files": "6.13.1",
"gatsby-remark-external-links": "^0.0.4",
"gatsby-remark-images": "3.0.1",
"gatsby-remark-prismjs": "3.1.4",
"gatsby-remark-responsive-iframe": "2.0.8",
"gatsby-remark-smartypants": "2.0.7",
"gatsby-remark-images": "7.13.1",
"gatsby-remark-prismjs": "7.13.1",
"gatsby-remark-responsive-iframe": "6.13.1",
"gatsby-remark-smartypants": "6.13.1",
"gatsby-remark-video": "^1.2.5",
"gatsby-source-filesystem": "2.0.12",
"gatsby-transformer-json": "^2.1.6",
"gatsby-transformer-remark": "2.1.17",
"gatsby-transformer-sharp": "2.1.9",
"gatsby-transformer-yaml": "^2.1.6",
"gatsby-source-filesystem": "5.13.1",
"gatsby-transformer-json": "^5.13.1",
"gatsby-transformer-remark": "6.13.1",
"gatsby-transformer-sharp": "5.13.1",
"gatsby-transformer-yaml": "^5.13.1",
"got": "14.4.1",
"gry": "6.1.0",
"natives": "1.1.6",
"package.json": "^2.0.1",
"react-bootstrap": "^0.32.4",
"source-map": "^0.7.3"
"postcss": "8.4.38",
"react-bootstrap": "^2.10.2",
"source-map": "^0.7.4",
"webpack-dev-middleware": "7.2.1"
},
"devDependencies": {
"@fortawesome/fontawesome-svg-core": "1.2.10",
"@fortawesome/free-brands-svg-icons": "5.6.1",
"@fortawesome/free-solid-svg-icons": "5.6.1",
"@fortawesome/react-fontawesome": "0.1.3",
"animate.css": "3.7.0",
"babel-eslint": "10.0.1",
"@fortawesome/fontawesome-svg-core": "6.5.2",
"@fortawesome/free-brands-svg-icons": "6.5.2",
"@fortawesome/free-solid-svg-icons": "6.5.2",
"@fortawesome/react-fontawesome": "0.2.2",
"animate.css": "4.1.1",
"babel-eslint": "10.1.0",
"emergence.js": "1.1.2",
"eslint": "5.11.0",
"eslint-config-prettier": "3.3.0",
"eslint-plugin-prettier": "3.0.0",
"eslint-plugin-react": "7.11.1",
"eslint": "9.4.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.34.2",
"font-awesome": "4.7.0",
"gh-pages": "2.0.1",
"husky": "1.3.0",
"lint-staged": "8.1.0",
"lodash": "4.17.13",
"modern-normalize": "0.5.0",
"node-sass": "4.11.0",
"prettier": "1.15.3",
"prismjs": "1.15.0",
"react": "16.8.6",
"react-dom": "16.8.6",
"react-helmet": "5.2.1",
"textlint": "11.0.2",
"textlint-rule-preset-ja-spacing": "2.0.1",
"textlint-rule-preset-japanese": "4.0.0"
"gh-pages": "6.1.1",
"husky": "9.0.11",
"lint-staged": "15.2.5",
"lodash": "4.17.21",
"modern-normalize": "2.0.0",
"node-sass": "9.0.0",
"prettier": "3.3.1",
"prismjs": "1.29.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-helmet": "6.1.0",
"textlint": "14.0.4",
"textlint-rule-preset-ja-spacing": "2.4.3",
"textlint-rule-preset-japanese": "10.0.3"
},
"resolutions": {
"natives": "1.1.3"
Expand Down Expand Up @@ -102,6 +108,6 @@
},
"homepage": "https://github.com/getredash/website#readme",
"optionalDependencies": {
"fsevents": "^1.1.3"
"fsevents": "^2.3.3"
}
}
55 changes: 27 additions & 28 deletions src/components/ArticlesList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StaticQuery, graphql } from 'gatsby'
import { graphql, useStaticQuery } from 'gatsby'
import PropTypes from 'prop-types'
import Link from 'components/Link'

Expand Down Expand Up @@ -39,34 +39,33 @@ ArticlesList.propTypes = {
parent_category: PropTypes.string.isRequired,
}

export default props => (
<StaticQuery
query={graphql`
{
allMarkdownRemark(
sort: {
order: ASC
fields: [frontmatter___order, frontmatter___title]
}
filter: {
fileAbsolutePath: { regex: "/pages/kb/" }
frontmatter: { layout: { ne: "kb-category" } }
}
) {
edges {
node {
frontmatter {
title
category
parent_category
slug
description
}
export default props => {
const data = useStaticQuery(graphql`
query {
allMarkdownRemark(
sort: [
{frontmatter: {order: ASC}},
{frontmatter: {title: ASC}}
]
filter: {
fileAbsolutePath: { regex: "/pages/kb/" }
frontmatter: { layout: { ne: "kb-category" } }
}
) {
edges {
node {
frontmatter {
title
category
parent_category
slug
description
}
}
}
}
`}
render={data => <ArticlesList data={data} {...props} />}
/>
)
}
`)

return <ArticlesList data={data} {...props} />
}
31 changes: 15 additions & 16 deletions src/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { StaticQuery, graphql } from 'gatsby'
import { graphql, useStaticQuery } from 'gatsby'
import Link from 'components/Link'

const Footer = ({
Expand Down Expand Up @@ -58,23 +58,22 @@ const Footer = ({
</footer>
)

export default (props) => (
<StaticQuery
query={graphql`
{
allFooterLinksYaml {
edges {
node {
export default (props) => {
const data = useStaticQuery(graphql`
query {
allFooterLinksYaml {
edges {
node {
name
links {
name
links {
name
url
}
url
}
}
}
}
`}
render={(data) => <Footer data={data} {...props} />}
/>
)
}
`)

return <Footer data={data} {...props} />
}
4 changes: 2 additions & 2 deletions src/config/algolia.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ function aritclePath(frontmatter) {

function transformer({ data }) {
// console.log(data)
return data.allMarkdownRemark.edges.map(edge => {
return data.allMarkdownRemark.edges.map((edge) => {
return {
url: aritclePath(edge.node.frontmatter),
title: edge.node.frontmatter.title,
parent_category: edge.node.frontmatter.parent_category,
category: edge.node.frontmatter.category,
text: edge.node.text,
headings: edge.node.headings.map(heading => heading.value),
headings: edge.node.headings.map((heading) => heading.value),
objectID: aritclePath(edge.node.frontmatter),
}
})
Expand Down
Loading

0 comments on commit c82fd45

Please sign in to comment.