Skip to content

Commit 6a40f7f

Browse files
Upgrade Gatsby and MUI
Signed-off-by: Tanisha Agarwal <[email protected]>
1 parent f2af2c2 commit 6a40f7f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+51512
-17097
lines changed

.eslintrc.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,17 @@
3535
},
3636
"plugins": [
3737
"react",
38-
"@typescript-eslint"
38+
"@typescript-eslint",
39+
"import"
3940
],
4041
"rules": {
41-
"quotes": [2, "single", "avoid-escape"]
42+
"quotes": [2, "single", "avoid-escape"],
43+
"react/function-component-definition": [
44+
2,
45+
{
46+
"namedComponents": "arrow-function",
47+
"unnamedComponents": "arrow-function"
48+
}
49+
]
4250
}
4351
}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

content/en/04-tutorials/02-pxl-scripts/01-write-pxl-scripts/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ title: "How to Write a PxL Script"
33
metaTitle: "Tutorials | PxL Scripts | How to Write a PxL Script"
44
metaDescription: "Write Custom PxL Scripts"
55
order: 10
6-
redirect_from:
7-
- /tutorials/pxl-scripts
86
---
97

108
## Overview

gatsby-browser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import MainThemeProvider from './src/components/mainThemeProvider.tsx';
2626
import './src/global.css';
2727
import SidebarProvider from './src/components/sidebar/sidebarProvider.tsx';
2828
import SearchProvider from './src/components/search-context.tsx';
29+
// eslint-disable-next-line import/extensions
2930
import { processClientEntry, runZoom } from './src/components/image-zoom-modal.plugin.ts';
3031
import TabSwitcherProvider from './src/components/tabSwitcherProvider.tsx';
3132

gatsby-config.js

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const algolia = {
4949
apiKey: algoliaApiKey,
5050
indexName: algoliaIndex, // for all queries
5151
// eslint-disable-next-line global-require
52+
// eslint-disable-next-line import/extensions
5253
queries: require('./src/utils/algolia-queries.ts').queries,
5354
settings: {
5455
// optional, any index settings
@@ -63,11 +64,25 @@ const algolia = {
6364

6465
const plugins = [
6566
'gatsby-plugin-sitemap',
67+
'gatsby-plugin-sharp',
68+
'gatsby-plugin-emotion',
69+
'gatsby-plugin-react-helmet',
70+
'gatsby-plugin-material-ui',
71+
'gatsby-plugin-styled-components',
72+
'gatsby-transformer-json',
6673
{
67-
resolve: 'gatsby-plugin-material-ui',
68-
74+
resolve: 'gatsby-source-filesystem',
75+
options: {
76+
name: 'external',
77+
path: `${__dirname}/external`,
78+
},
79+
},
80+
{
81+
resolve: 'gatsby-transformer-remark',
82+
options: {
83+
plugins: ['gatsby-remark-images'],
84+
},
6985
},
70-
'gatsby-plugin-styled-components',
7186
{
7287
resolve: 'gatsby-plugin-mdx',
7388
options: {
@@ -76,7 +91,7 @@ const plugins = [
7691
resolve: 'gatsby-remark-relative-images',
7792
},
7893
{
79-
resolve: require.resolve('./src/plugins/gatsby-plugin-code-tabs.ts'),
94+
resolve: require.resolve('./src/plugins/gatsby-plugin-code-tabs'),
8095
},
8196
{
8297
resolve: 'gatsby-remark-images',
@@ -94,21 +109,17 @@ const plugins = [
94109
extensions: ['.mdx', '.md'],
95110
},
96111
},
97-
'gatsby-plugin-sharp',
98-
'gatsby-plugin-emotion',
99-
'gatsby-plugin-force-trailing-slashes',
100-
'gatsby-plugin-react-helmet',
101112
{
102-
resolve: 'gatsby-plugin-react-helmet-canonical-urls',
113+
resolve: 'gatsby-source-filesystem',
103114
options: {
104-
siteUrl: 'https://docs.px.dev',
115+
name: 'en',
116+
path: `${__dirname}/content/`,
105117
},
106118
},
107119
{
108-
resolve: 'gatsby-source-filesystem',
120+
resolve: 'gatsby-plugin-react-helmet-canonical-urls',
109121
options: {
110-
name: 'en',
111-
path: `${__dirname}/content/`,
122+
siteUrl: 'https://docs.px.dev',
112123
},
113124
},
114125
{
@@ -141,9 +152,9 @@ const plugins = [
141152
{
142153
resolve: 'gatsby-plugin-sass',
143154
options: {
144-
includePaths: ['node_modules', './src/scss'],
145-
// eslint-disable-next-line global-require
146-
implementation: require('sass'),
155+
sassOptions: {
156+
includePaths: ['node_modules', './src/scss'],
157+
},
147158
},
148159
},
149160
{
@@ -158,13 +169,13 @@ const plugins = [
158169
},
159170
'@pauliescanlon/gatsby-mdx-embed',
160171
'gatsby-plugin-remove-serviceworker',
172+
'gatsby-plugin-meta-redirect',
161173
{
162174
resolve: 'gatsby-redirect-from',
163175
options: {
164176
query: 'allMdx',
165177
},
166178
},
167-
'gatsby-plugin-meta-redirect',
168179
];
169180

170181
if ('GATSBY_ALGOLIA_APP_ID' in process.env) {
@@ -173,6 +184,7 @@ if ('GATSBY_ALGOLIA_APP_ID' in process.env) {
173184

174185
module.exports = {
175186
pathPrefix: config.gatsby.pathPrefix,
187+
trailingSlash: 'always',
176188
siteMetadata: {
177189
title: config.siteMetadata.title,
178190
description: config.siteMetadata.description,

gatsby-node.js

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/extensions */
12
/*
23
* Copyright 2018- The Pixie Authors.
34
*
@@ -262,15 +263,24 @@ exports.createPages = ({
262263
);
263264
});
264265
};
265-
exports.onCreateWebpackConfig = ({ actions }) => {
266+
exports.onCreateWebpackConfig = ({ actions, plugins }) => {
266267
actions.setWebpackConfig({
267268
resolve: {
268269
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
269270
alias: { $components: path.resolve(__dirname, 'src/components') },
271+
fallback: {
272+
fs: false,
273+
path: require.resolve('path-browserify'),
274+
process: require.resolve('process/browser'),
275+
buffer: require.resolve('buffer'),
276+
},
270277
},
271-
node: {
272-
fs: 'empty',
273-
},
278+
plugins: [
279+
plugins.provide({
280+
process: 'process/browser',
281+
Buffer: ['buffer', 'Buffer'],
282+
}),
283+
],
274284
});
275285
};
276286

@@ -441,13 +451,22 @@ exports.onCreateNode = ({
441451
exports.createSchemaCustomization = ({ actions }) => {
442452
const { createTypes } = actions;
443453
const typeDefs = `
444-
type Mdx implements Node {
445-
frontmatter: MdxFrontmatter
446-
}
447-
type MdxFrontmatter @infer {
448-
449-
hidden: Boolean
450-
}
451-
`;
454+
type Mdx implements Node {
455+
frontmatter: MdxFrontmatter
456+
}
457+
type MdxFrontmatter @infer {
458+
hidden: Boolean
459+
}
460+
type SitePage implements Node {
461+
fields: SitePageFields
462+
}
463+
type SitePageFields {
464+
slug: String
465+
id: String
466+
title: String
467+
level: Int
468+
directory: Boolean
469+
}
470+
`;
452471
createTypes(typeDefs);
453472
};

0 commit comments

Comments
 (0)