Skip to content

Commit baf594e

Browse files
upgrade gatsby to v5
1 parent 82857c8 commit baf594e

File tree

24 files changed

+8965
-14056
lines changed

24 files changed

+8965
-14056
lines changed

gatsby-config.js

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const remark = require('remark');
2-
const strip = require('strip-markdown');
1+
const remark = import('remark');
2+
const strip = import('strip-markdown');
33
require('dotenv').config({
44
path: `.env.${process.env.NODE_ENV}`,
55
});
@@ -28,7 +28,7 @@ const paginatedCollection = (name, tag) => {
2828
{
2929
allMarkdownRemark(filter: {fields: {sourceInstanceName: {eq: "blog"}
3030
}, frontmatter: {disable:{ne: true},tags: {eq: "${tag}"}}},
31-
sort: {fields: [frontmatter___date], order: DESC}) {
31+
sort: {frontmatter: {date: DESC}}) {
3232
nodes {
3333
id
3434
fields {
@@ -230,8 +230,9 @@ module.exports = {
230230
wrapperStyle: 'margin-bottom: 1.0725rem',
231231
},
232232
},
233-
'gatsby-remark-copy-linked-files',
234233
'gatsby-plugin-catch-links',
234+
'gatsby-remark-copy-linked-files',
235+
235236
],
236237
},
237238
},
@@ -274,7 +275,47 @@ module.exports = {
274275
// },
275276
// },
276277
// },
277-
'gatsby-plugin-feed',
278+
{
279+
resolve: 'gatsby-plugin-feed',
280+
options:{
281+
feeds: [
282+
{
283+
serialize: ({ query: { site, allMarkdownRemark } }) => {
284+
return allMarkdownRemark.nodes.map(node => {
285+
return Object.assign({}, node.frontmatter, {
286+
description: node.excerpt,
287+
date: node.frontmatter.date,
288+
url: site.siteMetadata.siteUrl + node.fields.slug,
289+
guid: site.siteMetadata.siteUrl + node.fields.slug,
290+
custom_elements: [{ "content:encoded": node.html }],
291+
})
292+
})
293+
},
294+
query: `
295+
{
296+
allMarkdownRemark(
297+
sort: {frontmatter: {date: DESC}}
298+
) {
299+
nodes {
300+
excerpt
301+
html
302+
fields {
303+
slug
304+
}
305+
frontmatter {
306+
title
307+
date
308+
}
309+
}
310+
}
311+
}
312+
`,
313+
output: "/rss.xml",
314+
title: "Your Site's RSS Feed",
315+
},
316+
],
317+
}
318+
},
278319
{
279320
resolve: 'gatsby-plugin-manifest',
280321
options: {
@@ -304,7 +345,7 @@ module.exports = {
304345
{
305346
allMarkdownRemark(filter: {fields: {sourceInstanceName: {eq: "blog"}
306347
}, frontmatter: {disable:{ne: true},featuredBlog: {ne: true}}},
307-
sort: {fields: [frontmatter___date], order: DESC}) {
348+
sort: {frontmatter: {date: DESC}}) {
308349
nodes {
309350
id
310351
fields {
@@ -376,7 +417,7 @@ module.exports = {
376417
"cray",
377418
"swarm-learning",
378419
"hpe-nonstop"
379-
]}}}, sort: {fields: [frontmatter___date], order: DESC}) {
420+
]}}}, sort: {frontmatter: {date: DESC}}) {
380421
nodes {
381422
id
382423
fields {
@@ -455,7 +496,7 @@ module.exports = {
455496
"ilorest",
456497
"iLOrest",
457498
"ilo-restful-api"
458-
]}}}, sort: {fields: [frontmatter___date], order: DESC}) {
499+
]}}}, sort: {frontmatter: {date: DESC}}) {
459500
nodes {
460501
id
461502
fields {

gatsby-node.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ exports.createPages = async ({ graphql, actions }) => {
252252
{
253253
allMarkdownRemark(
254254
filter: { frontmatter: { disable: { ne: true } } }
255-
sort: { fields: [frontmatter___date], order: DESC }
255+
sort: {frontmatter: {date: DESC}}
256256
limit: 1000
257257
) {
258258
edges {
@@ -272,7 +272,7 @@ exports.createPages = async ({ graphql, actions }) => {
272272
}
273273
tagsGroup: allMarkdownRemark(limit: 2000,
274274
filter:{frontmatter:{disable:{ne:true}}}) {
275-
group(field: frontmatter___tags) {
275+
group(field: {frontmatter: {tags: SELECT}}) {
276276
fieldValue
277277
}
278278
}
@@ -310,10 +310,10 @@ exports.createPages = async ({ graphql, actions }) => {
310310
});
311311
} else if (post.node.fields.sourceInstanceName === 'platform') {
312312
const { sourceInstanceName, slug } = post.node.fields;
313-
console.log(
314-
`Create pages /${sourceInstanceName}${slug} from ${slug}`,
315-
);
316-
console.log('------------------------------');
313+
// console.log(
314+
// `Create pages /${sourceInstanceName}${slug} from ${slug}`,
315+
// );
316+
// console.log('------------------------------');
317317
createPage({
318318
path: `/${sourceInstanceName}${slug}`,
319319
component: platform,
@@ -324,10 +324,10 @@ exports.createPages = async ({ graphql, actions }) => {
324324
});
325325
} else if (post.node.fields.sourceInstanceName === 'greenlake') {
326326
const { sourceInstanceName, slug } = post.node.fields;
327-
console.log(
328-
`Create pages /${sourceInstanceName}${slug} from ${slug}`,
329-
);
330-
console.log('------------------------------');
327+
// console.log(
328+
// `Create pages /${sourceInstanceName}${slug} from ${slug}`,
329+
// );
330+
// console.log('------------------------------');
331331
createPage({
332332
path: `/${sourceInstanceName}${slug}`,
333333
component: platform,
@@ -338,10 +338,10 @@ exports.createPages = async ({ graphql, actions }) => {
338338
});
339339
} else if (post.node.fields.sourceInstanceName === 'event') {
340340
const { sourceInstanceName, slug } = post.node.fields;
341-
console.log(
342-
`Create pages /${sourceInstanceName}${slug} from ${slug}`,
343-
);
344-
console.log('------------------------------');
341+
// console.log(
342+
// `Create pages /${sourceInstanceName}${slug} from ${slug}`,
343+
// );
344+
// console.log('------------------------------');
345345
createPage({
346346
path: `/${sourceInstanceName}${slug}`,
347347
component: event,
@@ -352,10 +352,10 @@ exports.createPages = async ({ graphql, actions }) => {
352352
});
353353
} else if (post.node.fields.sourceInstanceName === 'newsletter') {
354354
const { sourceInstanceName, slug } = post.node.fields;
355-
console.log(
356-
`Create pages /${sourceInstanceName}${slug} from ${slug}`,
357-
);
358-
console.log('------------------------------');
355+
// console.log(
356+
// `Create pages /${sourceInstanceName}${slug} from ${slug}`,
357+
// );
358+
// console.log('------------------------------');
359359
createPage({
360360
path: `/${sourceInstanceName}${slug}`,
361361
component: newsletter,
@@ -366,10 +366,10 @@ exports.createPages = async ({ graphql, actions }) => {
366366
});
367367
} else if (post.node.fields.sourceInstanceName === 'campaign') {
368368
const { sourceInstanceName, slug } = post.node.fields;
369-
console.log(
370-
`Create pages /${sourceInstanceName}${slug} from ${slug}`,
371-
);
372-
console.log('------------------------------');
369+
// console.log(
370+
// `Create pages /${sourceInstanceName}${slug} from ${slug}`,
371+
// );
372+
// console.log('------------------------------');
373373
createPage({
374374
path: `/${sourceInstanceName}${slug}`,
375375
component: campaignTemplate,
@@ -380,10 +380,10 @@ exports.createPages = async ({ graphql, actions }) => {
380380
});
381381
} else if (post.node.fields.sourceInstanceName === 'role') {
382382
const { sourceInstanceName, slug } = post.node.fields;
383-
console.log(
384-
`Create pages /${sourceInstanceName}${slug} from ${slug}`,
385-
);
386-
console.log('------------------------------');
383+
// console.log(
384+
// `Create pages /${sourceInstanceName}${slug} from ${slug}`,
385+
// );
386+
// console.log('------------------------------');
387387
createPage({
388388
path: `/${sourceInstanceName}${slug}`,
389389
component: roleTemplate,
@@ -394,10 +394,10 @@ exports.createPages = async ({ graphql, actions }) => {
394394
});
395395
} else if (post.node.fields.sourceInstanceName === 'use-cases') {
396396
const { sourceInstanceName, slug } = post.node.fields;
397-
console.log(
398-
`Create pages /${sourceInstanceName}${slug} from ${slug}`,
399-
);
400-
console.log('------------------------------');
397+
// console.log(
398+
// `Create pages /${sourceInstanceName}${slug} from ${slug}`,
399+
// );
400+
// console.log('------------------------------');
401401
createPage({
402402
path: `/${sourceInstanceName}${slug}`,
403403
component: useCasesTemplate,

package.json

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,76 @@
77
"url": "https://github.com/hpe-dev-incubator/hpe-dev-portal/issues"
88
},
99
"dependencies": {
10-
"@babel/core": "^7.13.1",
11-
"@emotion/core": "^10.1.1",
10+
"@babel/core": "^7.23.5",
11+
"@emotion/core": "^11.0.0",
1212
"@ion-phaser/react": "^1.3.0",
13-
"@sendgrid/mail": "^7.4.2",
14-
"axios": "^1.6.0",
15-
"babel-plugin-styled-components": "^1.12.0",
16-
"dotenv": "^8.2.0",
17-
"formik": "^2.2.9",
18-
"gatsby": "^2.32.8",
19-
"gatsby-cli": "^4.12.1",
20-
"gatsby-image": "^2.11.0",
21-
"gatsby-legacy-polyfills": "^2.12.1",
22-
"gatsby-plugin-catch-links": "^2.10.0",
23-
"gatsby-plugin-feed": "^2.13.0",
24-
"gatsby-plugin-google-analytics": "^2.11.0",
25-
"gatsby-plugin-google-gtag": "2.8.0",
13+
"@sendgrid/mail": "^8.0.0",
14+
"axios": "^1.6.2",
15+
"babel-plugin-styled-components": "^2.1.4",
16+
"dotenv": "^16.3.1",
17+
"formik": "^2.4.5",
18+
"gatsby": "5.12.11",
19+
"gatsby-cli": "^5.12.4",
20+
"gatsby-image": "^3.11.0",
21+
"gatsby-legacy-polyfills": "^3.12.0",
22+
"gatsby-plugin-catch-links": "^5.12.0",
23+
"gatsby-plugin-feed": "^5.12.3",
24+
"gatsby-plugin-google-analytics": "^5.12.0",
25+
"gatsby-plugin-google-gtag": "5.12.3",
2626
"gatsby-plugin-lunr": "^1.5.2",
27-
"gatsby-plugin-manifest": "2.4.34",
28-
"gatsby-plugin-netlify-cms": "^4.10.0",
29-
"gatsby-plugin-nprogress": "2.6.0",
27+
"gatsby-plugin-manifest": "5.12.3",
28+
"gatsby-plugin-netlify-cms": "^7.12.0",
29+
"gatsby-plugin-nprogress": "5.12.0",
3030
"gatsby-plugin-paginated-collection": "^0.2.3",
31-
"gatsby-plugin-react-helmet": "^3.10.0",
32-
"gatsby-plugin-sharp": "2.6.42",
33-
"gatsby-plugin-styled-components": "^3.10.0",
34-
"gatsby-remark-copy-linked-files": "^2.10.0",
35-
"gatsby-remark-images": "^3.11.0",
36-
"gatsby-remark-prismjs": "^3.13.0",
37-
"gatsby-remark-responsive-iframe": "^2.11.0",
38-
"gatsby-remark-smartypants": "^2.10.0",
39-
"gatsby-source-filesystem": "^2.11.0",
40-
"gatsby-transformer-remark": "^2.16.0",
41-
"gatsby-transformer-sharp": "2.5.17",
42-
"grommet": "^2.16.3",
43-
"grommet-icons": "^4.5.0",
44-
"grommet-theme-hpe": "^2.0.2",
45-
"jest-styled-components": "^7.0.3",
46-
"netlify-cms-app": "^2.14.25",
31+
"gatsby-plugin-react-helmet": "^6.12.0",
32+
"gatsby-plugin-sharp": "5.12.3",
33+
"gatsby-plugin-styled-components": "^6.12.0",
34+
"gatsby-remark-copy-linked-files": "^6.12.0",
35+
"gatsby-remark-images": "^7.12.3",
36+
"gatsby-remark-prismjs": "^7.12.0",
37+
"gatsby-remark-responsive-iframe": "^6.12.0",
38+
"gatsby-remark-smartypants": "^6.12.0",
39+
"gatsby-source-filesystem": "^5.12.1",
40+
"gatsby-transformer-remark": "^6.12.3",
41+
"gatsby-transformer-sharp": "5.12.3",
42+
"grommet": "2.31.0",
43+
"grommet-icons": "^4.11.0",
44+
"grommet-theme-hpe": "^5.1.1",
45+
"jest-styled-components": "^7.2.0",
46+
"netlify-cms-app": "^2.15.72",
4747
"netlify-cms-media-library-cloudinary": "^1.3.10",
48-
"prismjs": "^1.23.0",
49-
"prop-types": "^15.7.2",
50-
"react": "^16.14.0",
51-
"react-dom": "^16.14.0",
48+
"prismjs": "^1.29.0",
49+
"prop-types": "^15.8.1",
50+
"react": "^18.2.0",
51+
"react-dom": "^18.2.0",
5252
"react-helmet": "^6.1.0",
53-
"react-player": "^2.9.0",
54-
"react-syntax-highlighter": "^15.4.3",
55-
"redux": "^4.0.5",
56-
"remark": "^11.0.2",
57-
"strip-markdown": "^3.1.2",
58-
"styled-components": "^5.2.1",
59-
"sweetalert2": "^11.7.12",
60-
"typescript": "^4.2.2",
61-
"yup": "^0.32.11"
53+
"react-player": "^2.13.0",
54+
"react-syntax-highlighter": "^15.5.0",
55+
"redux": "^5.0.0",
56+
"remark": "^15.0.1",
57+
"strip-markdown": "^6.0.0",
58+
"styled-components": "5.3.11",
59+
"sweetalert2": "^11.10.1",
60+
"typescript": "^5.3.2",
61+
"yup": "^1.3.2"
6262
},
6363
"devDependencies": {
64-
"@hpe/project-scripts": "^1.1.0",
64+
"@hpe/project-scripts": "^1.1.2",
6565
"babel-eslint": "^10.1.0",
66-
"babel-jest": "^26.6.3",
67-
"babel-preset-gatsby": "^0.5.16",
68-
"eslint": "^7.20.0",
69-
"eslint-config-airbnb": "^18.2.1",
70-
"eslint-config-prettier": "^6.15.0",
71-
"eslint-plugin-import": "^2.22.1",
72-
"eslint-plugin-jsx-a11y": "^6.4.1",
73-
"eslint-plugin-prettier": "^3.3.1",
74-
"eslint-plugin-react": "^7.22.0",
75-
"husky": "^4.3.8",
66+
"babel-jest": "^29.7.0",
67+
"babel-preset-gatsby": "^3.12.1",
68+
"eslint": "^8.55.0",
69+
"eslint-config-airbnb": "^19.0.4",
70+
"eslint-config-prettier": "^9.1.0",
71+
"eslint-plugin-import": "^2.29.0",
72+
"eslint-plugin-jsx-a11y": "^6.8.0",
73+
"eslint-plugin-prettier": "^5.0.1",
74+
"eslint-plugin-react": "^7.33.2",
75+
"husky": "^8.0.3",
7676
"identity-obj-proxy": "^3.0.0",
77-
"jest": "^26.6.3",
78-
"prettier": "^2.2.1",
79-
"react-test-renderer": "^16.14.0"
77+
"jest": "^29.7.0",
78+
"prettier": "^3.1.0",
79+
"react-test-renderer": "^18.2.0"
8080
},
8181
"homepage": "https://github.com/hpe-dev-incubator/hpe-dev-portal/blob/master/README.md",
8282
"keywords": [

src/components/BlogCard/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import remark from 'remark';
3+
import {remark} from 'remark';
44
import strip from 'strip-markdown';
55
import { navigate } from 'gatsby';
66
import {

src/pages/Home/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export const pageQuery = graphql`
216216
fields: { sourceInstanceName: { eq: "homepanels" } }
217217
frontmatter: { active: { eq: true } }
218218
}
219-
sort: { fields: [frontmatter___priority] }
219+
sort: {frontmatter: {priority: ASC}}
220220
) {
221221
edges {
222222
node {
@@ -241,7 +241,7 @@ export const pageQuery = graphql`
241241
fields: { sourceInstanceName: { eq: "opensource" } }
242242
frontmatter: { Featured: { eq: true } }
243243
}
244-
sort: { fields: [frontmatter___priority] }
244+
sort: {frontmatter: {priority: ASC}}
245245
) {
246246
edges {
247247
node {

0 commit comments

Comments
 (0)