From c82fd456f1354b33118a784c6d4e68c1a772e819 Mon Sep 17 00:00:00 2001 From: SeongTae Jeong Date: Sat, 22 Jun 2024 14:14:00 +0900 Subject: [PATCH] Bump Node.js, Gatsby, and package version (#703) --- .eslintrc | 6 +- .node-version | 2 +- Dockerfile | 3 +- README.md | 3 - bin/export-index.js | 15 +- bin/fetch-contributors.js | 2 +- docker-compose.yml | 1 - gatsby-config.js | 34 +- gatsby-node.js | 2 +- package.json | 114 +- src/components/ArticlesList.jsx | 55 +- src/components/Footer.jsx | 31 +- src/config/algolia.js | 4 +- src/pages/contact/index.jsx | 4 +- .../data_sources/_databases/amazon-athena.md | 2 +- .../data_sources/_databases/amazon-aurora.md | 2 +- .../_databases/amazon-dynamodb.md | 2 +- .../_databases/amazon-redshift.md | 2 +- src/pages/data_sources/_databases/atsd.md | 2 +- .../data_sources/_databases/azure-kusto.md | 2 +- .../data_sources/_databases/cassandra.md | 2 +- .../data_sources/_databases/clickhouse.md | 2 +- .../data_sources/_databases/databricks.md | 2 +- src/pages/data_sources/_databases/druid.md | 2 +- .../data_sources/_databases/elasticsearch.md | 2 +- .../_databases/google-bigquery.md | 2 +- src/pages/data_sources/_databases/graphite.md | 2 +- .../data_sources/_databases/greenplum.md | 2 +- src/pages/data_sources/_databases/hive.md | 2 +- src/pages/data_sources/_databases/impala.md | 2 +- src/pages/data_sources/_databases/influxdb.md | 2 +- src/pages/data_sources/_databases/memsql.md | 2 +- .../_databases/microsoft-sql-server.md | 2 +- src/pages/data_sources/_databases/mongodb.md | 2 +- src/pages/data_sources/_databases/mysql.md | 2 +- src/pages/data_sources/_databases/oracle.md | 2 +- .../data_sources/_databases/postgresql.md | 2 +- src/pages/data_sources/_databases/presto.md | 2 +- src/pages/data_sources/_databases/rockset.md | 2 +- src/pages/data_sources/_databases/scylladb.md | 2 +- .../data_sources/_databases/snowflake.md | 2 +- .../data_sources/_databases/treasuredata.md | 2 +- src/pages/data_sources/_databases/vertica.md | 2 +- .../_integrations/google-analytics.md | 2 +- .../data_sources/_integrations/salesforce.md | 2 +- .../_integrations/yandex-appmetrica.md | 2 +- .../_integrations/yandex-metrica.md | 2 +- src/pages/data_sources/_partners/segment.md | 2 +- src/pages/data_sources/_partners/snowplow.md | 2 +- src/pages/data_sources/_partners/stitch.md | 2 +- src/pages/help/index.jsx | 2 +- src/pages/integrations/index.jsx | 6 +- .../pivot-table-visualizations.md | 4 +- .../narrow_text_pages/code_of_conduct.md | 2 +- src/pages/text_pages/privacy.md | 2 +- src/pages/text_pages/terms.md | 2 +- src/scss/main.scss | 3 +- src/templates/HelpArticle.jsx | 7 +- static/assets/scripts/a.js | 14 +- yarn.lock | 21754 ++++++++-------- 60 files changed, 11410 insertions(+), 10734 deletions(-) diff --git a/.eslintrc b/.eslintrc index 8e56c45d3..5cee5f7c8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,14 +1,14 @@ { "extends": [ - "prettier", - "prettier/react" + "eslint:recommended", + "prettier" ], "plugins": [ "react", "prettier" ], "parserOptions": { - "ecmaVersion": 2016, + "ecmaVersion": 2023, "sourceType": "module", "ecmaFeatures": { "jsx": true, diff --git a/.node-version b/.node-version index b85c6c7b0..87834047a 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -11.2.0 +20.12.2 diff --git a/Dockerfile b/Dockerfile index e24ee9f63..ac00ce70e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 713b52c59..25ef1d363 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/bin/export-index.js b/bin/export-index.js index 69232cd7b..323304da1 100644 --- a/bin/export-index.js +++ b/bin/export-index.js @@ -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) { diff --git a/bin/fetch-contributors.js b/bin/fetch-contributors.js index f155cfdd2..a8f17b2c1 100644 --- a/bin/fetch-contributors.js +++ b/bin/fetch-contributors.js @@ -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 { diff --git a/docker-compose.yml b/docker-compose.yml index c4be813e5..a33de1ef3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3.2' services: gatsby: build: . diff --git a/gatsby-config.js b/gatsby-config.js index a8c822892..7af7e9204 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -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', @@ -73,7 +74,6 @@ const config = { resolve: 'gatsby-plugin-netlify', options: { mergeSecurityHeaders: false, - mergeLinkHeaders: true, mergeCachingHeaders: true, }, }, diff --git a/gatsby-node.js b/gatsby-node.js index d5363454c..83c819c08 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -63,7 +63,7 @@ exports.createPages = ({ actions: { createPage }, graphql }) => { } } } - `).then(result => { + `).then((result) => { if (result.errors) { return Promise.reject(result.errors) } diff --git a/package.json b/package.json index 2e0b72d2d..03ae39d99 100644 --- a/package.json +++ b/package.json @@ -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" @@ -102,6 +108,6 @@ }, "homepage": "https://github.com/getredash/website#readme", "optionalDependencies": { - "fsevents": "^1.1.3" + "fsevents": "^2.3.3" } } diff --git a/src/components/ArticlesList.jsx b/src/components/ArticlesList.jsx index c2b644049..c3e529c02 100644 --- a/src/components/ArticlesList.jsx +++ b/src/components/ArticlesList.jsx @@ -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' @@ -39,34 +39,33 @@ ArticlesList.propTypes = { parent_category: PropTypes.string.isRequired, } -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 => } - /> -) + } + `) + + return +} diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index f43d771c1..d4de8e4fb 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -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 = ({ @@ -58,23 +58,22 @@ const Footer = ({ ) -export default (props) => ( - { + const data = useStaticQuery(graphql` + query { + allFooterLinksYaml { + edges { + node { + name + links { name - links { - name - url - } + url } } } } - `} - render={(data) =>