profile
viewpoint
Michaël De Boey MichaelDeBoey Alpha IT Sint-Niklaas, Belgium https://michaeldeboey.be 👨‍💻 JavaScript/TypeScript engineer with a passion for @reactjs

gatsbyjs/gatsby 47602

Build blazing fast, modern apps and websites with React

codesandbox/codesandbox-client 9932

An online IDE for rapid web development

gatsbyjs/gatsby-nl 2

Dutch translation of Gatsbyjs.org

MichaelDeBoey/bnp-complaint-explanation-template 1

Let's urge BNP Paribas Fortis to develop a working PSD 2 interface (API), so we all can have some Cake! 💪

MichaelDeBoey/bnp-complaint-generator 1

Let's urge BNP Paribas Fortis to develop a working PSD 2 interface (API), so we all can have some Cake! 💪

MichaelDeBoey/apollo-client 0

:rocket: A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server

MichaelDeBoey/apollo-upload-client 0

A terminating Apollo Link for Apollo Client that allows FileList, File, Blob or ReactNativeFile instances within query or mutation variables and sends GraphQL multipart requests.

MichaelDeBoey/babel-plugin-codegen 0

💥 Generate code at build-time

MichaelDeBoey/babel-plugin-macros 0

🎣 Allows you to build simple compile-time libraries

pull request commentrobinmetral/gatsby-plugin-pinterest

feat: Update pluginOptionsSchema with deprecation warnings

@robinmetral Rebased my branch onto upstream/master 🙂

MichaelDeBoey

comment created time in 7 hours

push eventMichaelDeBoey/gatsby-plugin-pinterest

Robin Métral

commit sha 5651f937e251ff6ae57873b63b39c86628eecae3

fix: disable CI runs on node@latest (#19) This node version is causing issues with cache and timeouts in Travis. Disabling for now, tests will only run on fixed node versions until further notice.

view details

Michaël De Boey

commit sha 8b7ab2fb7862d7ffe5d74c51fb4709360da20317

feat: Update pluginOptionsSchema with deprecation warnings

view details

push time in 7 hours

delete branch MichaelDeBoey/create-react-app

delete branch : imgbot

delete time in 9 hours

pull request commentfacebook/create-react-app

feat: remove remaining React imports

Shouldn't this be handled automatically by eslint-plugin-react when React 17 is detected? 🤔

CC: @yannickcr

nickmccurdy

comment created time in 9 hours

delete branch MichaelDeBoey/create-react-app

delete branch : patch-1

delete time in 9 hours

issue closedcodesandbox/codesandbox-client

Configuring which TypeScript version is used?

Can we make it so that I can configure which version of TypeScript to use? Can I (for instance) install typescript@next and use that?

closed time in 2 days

ffMathy

pull request commenttesting-library/eslint-plugin-jest-dom

fix: pin kcd-scripts at 6.5

@benmonro Do you have a more detailed thing that I can have a look at?

benmonro

comment created time in 2 days

delete branch MichaelDeBoey/draft-js

delete branch : imgbot

delete time in 3 days

issue commentMichaelDeBoey/gatsby-remark-embedder

Support Tidal

@xdebbie Adding support for Tidal seems like a good one to me, accepting PRs if you want to give it a go 🙂

xdebbie

comment created time in 3 days

delete branch MichaelDeBoey/invariant-packages

delete branch : patch-1

delete time in 3 days

delete branch MichaelDeBoey/eslint-plugin-jest-dom

delete branch : prefer-to-have-value

delete time in 3 days

push eventMichaelDeBoey/gatsby

Jonathan Steele

commit sha 45cd878b27effaaef93c7d57b6a68ea202acce34

docs(guide): Remove beta notes from GraphCMS sourcing guide (#27589) Co-authored-by: Lennart <lekoarts@gmail.com>

view details

Michaël De Boey

commit sha 5140240daba3e78ce53c61684f417cc3baae8b93

chore(gatsby-plugin-glamor): Add pluginOptionsSchema validation

view details

push time in 4 days

push eventMichaelDeBoey/gatsby

Jonathan Steele

commit sha 45cd878b27effaaef93c7d57b6a68ea202acce34

docs(guide): Remove beta notes from GraphCMS sourcing guide (#27589) Co-authored-by: Lennart <lekoarts@gmail.com>

view details

Michaël De Boey

commit sha 7936fe0d87e71f0d3f26f5c1a9722af3ef689021

chore(gatsby-plugin-flow): Add pluginOptionsSchema validation

view details

push time in 4 days

push eventMichaelDeBoey/gatsby

Jonathan Steele

commit sha 45cd878b27effaaef93c7d57b6a68ea202acce34

docs(guide): Remove beta notes from GraphCMS sourcing guide (#27589) Co-authored-by: Lennart <lekoarts@gmail.com>

view details

Michaël De Boey

commit sha 246a0929509a1c44442ed4ba1fd69a774f50932a

chore(gatsby-plugin-cxs): Add pluginOptionsSchema validation

view details

push time in 4 days

push eventMichaelDeBoey/gatsby

Jonathan Steele

commit sha 45cd878b27effaaef93c7d57b6a68ea202acce34

docs(guide): Remove beta notes from GraphCMS sourcing guide (#27589) Co-authored-by: Lennart <lekoarts@gmail.com>

view details

Michaël De Boey

commit sha 02655558b641fd0bb8b9c8114e727e7e521633ac

chore(gatsby-plugin-twitter): Add pluginOptionsSchema validation

view details

push time in 4 days

push eventMichaelDeBoey/gatsby

Michaël De Boey

commit sha bbbe4502b2f322c20e7db2f32cbf9af16f3039b6

chore(gatsby-plugin-glamor): Add pluginOptionsSchema validation

view details

push time in 4 days

push eventMichaelDeBoey/gatsby

Michaël De Boey

commit sha 98990097b3e686170003f1dc53386e2b630b6194

chore(gatsby-plugin-flow): Add pluginOptionsSchema validation

view details

push time in 4 days

push eventMichaelDeBoey/gatsby

Michaël De Boey

commit sha 086af19a3cea38acc53d5218c2bd8e8527981fdd

chore(gatsby-plugin-cxs): Add pluginOptionsSchema validation

view details

push time in 4 days

push eventMichaelDeBoey/gatsby

Michaël De Boey

commit sha 3b89985e938bc243148c206289b80cc4198ee011

chore(gatsby-plugin-twitter): Add pluginOptionsSchema validation

view details

push time in 4 days

PR opened facebook/create-react-app

chore: Update .prettierrc

es5 is the default value for trailingComma since prettier@2.x

+0 -1

0 comment

1 changed file

pr created time in 4 days

push eventMichaelDeBoey/create-react-app

Michaël De Boey

commit sha ac40f144fdc0158e022b517652b350ebfbdfbc10

chore: Update .prettierrc

view details

push time in 4 days

delete branch MichaelDeBoey/create-react-app

delete branch : update-dependencies

delete time in 4 days

push eventMichaelDeBoey/create-react-app

Michaël De Boey

commit sha 329f39236359751278b8c8ae0951e123bd6977f4

feat: Update ESLint dependencies (#9856)

view details

Michaël De Boey

commit sha 9e518ef56a76d4fe9ea1661a15750541a62f838d

feat: Update all dependencies

view details

push time in 4 days

delete branch MichaelDeBoey/create-react-app

delete branch : update-eslint-dependencies

delete time in 4 days

PR opened facebook/create-react-app

Reviewers
feat: Update all dependencies

Follow-up of #9856

+125 -130

0 comment

11 changed files

pr created time in 4 days

create barnchMichaelDeBoey/create-react-app

branch : update-dependencies

created branch time in 4 days

pull request commentrobinmetral/gatsby-plugin-pinterest

feat: Update pluginOptionsSchema with deprecation warnings

@robinmetral I don't know what happened there tbh...

MichaelDeBoey

comment created time in 4 days

push eventMichaelDeBoey/create-react-app

Michaël De Boey

commit sha 10fa97281d51be992fec43caa0ac1557191ec4ea

feat(eslint-config-react-app): Add jest & testing-library rules (#8963)

view details

Michaël De Boey

commit sha 4a8e0da125e3623fff19a5e733cf7aadbf7b0133

feat: Update ESLint dependencies

view details

push time in 4 days

delete branch MichaelDeBoey/create-react-app

delete branch : jest-dom-and-testing-library-rules

delete time in 4 days

push eventMichaelDeBoey/create-react-app

Michaël De Boey

commit sha ed919b1d6fcf6a331d6565bbd1894353b404ac62

Make eslint-plugin-jest an optional peerDependency (#9670)

view details

Michaël De Boey

commit sha bdb4d1c36d6cd722dc7f5954efef25577c9d0c8f

feat(eslint-config-react-app): Add jest & testing-library rules

view details

push time in 5 days

delete branch MichaelDeBoey/create-react-app

delete branch : optional-eslint-plugin-jest

delete time in 5 days

Pull request review commentfacebook/create-react-app

feat(eslint-config-react-app): Add jest & testing-library rules

 // and we try not to use "ERROR" level at all.  module.exports = {-  plugins: ['jest'],+  plugins: ['jest', 'jest-dom', 'testing-library'],   overrides: [     {       files: ['**/__tests__/**/*', '**/*.{spec,test}.*'],       env: {         'jest/globals': true,       },       // A subset of the recommended rules:-      // https://github.com/jest-community/eslint-plugin-jest#rules       rules: {-        'jest/expect-expect': 'warn',-        'jest/no-identical-title': 'warn',-        'jest/valid-describe': 'warn',-        'jest/valid-expect': 'warn',-        'jest/valid-expect-in-promise': 'warn',+        // https://github.com/jest-community/eslint-plugin-jest+        'jest/expect-expect': 'off',+        'jest/no-commented-out-tests': 'warn',+        'jest/no-conditional-expect': 'error',+        'jest/no-deprecated-functions': 'warn',+        'jest/no-disabled-tests': 'warn',+        'jest/no-done-callback': 'error',+        'jest/no-export': 'error',+        'jest/no-focused-tests': 'warn',+        'jest/no-identical-title': 'error',+        'jest/no-interpolation-in-snapshots': 'error',+        'jest/no-jasmine-globals': 'error',+        'jest/no-jest-import': 'error',+        'jest/no-mocks-import': 'error',+        'jest/no-standalone-expect': 'off',+        'jest/no-test-callback': 'off',+        'jest/no-test-prefixes': 'warn',+        'jest/valid-describe': 'error',+        'jest/valid-expect': 'error',+        'jest/valid-expect-in-promise': 'error',+        'jest/valid-title': 'warn',++        // https://github.com/testing-library/eslint-plugin-jest-dom+        'jest-dom/prefer-checked': 'warn',+        'jest-dom/prefer-empty': 'warn',+        'jest-dom/prefer-enabled-disabled': 'warn',+        'jest-dom/prefer-focus': 'warn',+        'jest-dom/prefer-required': 'warn',+        'jest-dom/prefer-to-have-attribute': 'warn',+        'jest-dom/prefer-to-have-style': 'warn',+        'jest-dom/prefer-to-have-text-content': 'warn',++        // https://github.com/testing-library/eslint-plugin-testing-library+        'testing-library/await-async-query': 'error',+        'testing-library/await-async-utils': 'error',+        'testing-library/no-await-sync-query': 'warn',+        'testing-library/no-debug': 'warn',+        'testing-library/no-dom-import': ['error', 'react'],+        'testing-library/no-manual-cleanup': 'error',+        'testing-library/no-render-in-setup': 'error',+        'testing-library/no-wait-for-empty-callback': 'error',+        'testing-library/no-wait-for-snapshot': 'error',+        'testing-library/prefer-explicit-assert': 'warn',+        'testing-library/prefer-find-by': 'warn',+        'testing-library/prefer-presence-queries': 'warn',+        'testing-library/prefer-screen-queries': 'warn',+        'testing-library/prefer-wait-for': 'warn',

For now I kept the testing-library/no-await-sync-query, testing-library/no-dom-import & testing-library/no-wait-for-empty-callback rules Let me know if they need to be removed 🙂

MichaelDeBoey

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentfacebook/create-react-app

feat(eslint-config-react-app): Add jest & testing-library rules

 // and we try not to use "ERROR" level at all.  module.exports = {-  plugins: ['jest'],+  plugins: ['jest', 'jest-dom', 'testing-library'],   overrides: [     {       files: ['**/__tests__/**/*', '**/*.{spec,test}.*'],       env: {         'jest/globals': true,       },       // A subset of the recommended rules:-      // https://github.com/jest-community/eslint-plugin-jest#rules       rules: {-        'jest/expect-expect': 'warn',-        'jest/no-identical-title': 'warn',-        'jest/valid-describe': 'warn',-        'jest/valid-expect': 'warn',-        'jest/valid-expect-in-promise': 'warn',+        // https://github.com/jest-community/eslint-plugin-jest+        'jest/expect-expect': 'off',+        'jest/no-commented-out-tests': 'warn',+        'jest/no-conditional-expect': 'error',+        'jest/no-deprecated-functions': 'warn',+        'jest/no-disabled-tests': 'warn',+        'jest/no-done-callback': 'error',+        'jest/no-export': 'error',+        'jest/no-focused-tests': 'warn',+        'jest/no-identical-title': 'error',+        'jest/no-interpolation-in-snapshots': 'error',+        'jest/no-jasmine-globals': 'error',+        'jest/no-jest-import': 'error',+        'jest/no-mocks-import': 'error',+        'jest/no-standalone-expect': 'off',+        'jest/no-test-callback': 'off',+        'jest/no-test-prefixes': 'warn',+        'jest/valid-describe': 'error',+        'jest/valid-expect': 'error',+        'jest/valid-expect-in-promise': 'error',+        'jest/valid-title': 'warn',

For now I kept the jest/no-jasmine-globals rule Let me know if it needs to be removed 🙂

MichaelDeBoey

comment created time in 5 days

PullRequestReviewEvent

push eventMichaelDeBoey/create-react-app

Hongbo Miao

commit sha 6a51dcdfb84d1a47294fcbf9d7d569eaf1b4d571

Add AVIF image support (#9611) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

Brody McKee

commit sha 1f2d387db621ed9b0dbb62c36676d191942197d7

fix: resolve new JSX runtime issues (#9788)

view details

Alexey Pyltsyn

commit sha 6f3e32e3b16e1f8bc72cf45e0e39d8cd20685d02

Upgrade Docusaurus to latest version (#9728)

view details

Clément DUNGLER

commit sha d07b7d025f5933710fcb01718617dbdf4bc54c33

Replace deprecated eslint-loader with eslint-webpack-plugin (#9751) * Replace deprecated eslint-loader by eslint-webpack-plugin * Update eslintFormatter for eslint-webpack-plugin * fix: always enable jsx-uses-react Co-authored-by: Brody McKee <mrmckeb@hotmail.com>

view details

Dan Abramov

commit sha b1f8536ccb45d58ace98835e0ad967326e750fd1

Add 3.4.4 to the changelog

view details

Johannes Pfeiffer

commit sha 79655944120b3681303c65cf61058ade0dc6b332

Bump resolve-url-loader version (#9841) * Bump resolve-url-loader version * Unpin resolve-url-loader

view details

Ian Schmitz

commit sha 0a93e32a434ba9995feb1a879bebf520fa6464e6

Fix refreshOverlayInterop module scope error (#9805)

view details

Michaël De Boey

commit sha a670c12e91b39d747ae666cfc764d7485f1d75e7

feat(eslint-config-react-app): Add jest & testing-library rules

view details

push time in 5 days

pull request commentgatsbyjs/gatsby

chore(gatsby-plugin-flow): Add pluginOptionsSchema validation

@wardpeet I figured since there's not really anything to test and #27356 also doesn't have tests, I didn't need to add them. But if you want, I can add them for you

MichaelDeBoey

comment created time in 5 days

PR opened robinmetral/gatsby-plugin-pinterest

feat: Update pluginOptionsSchema with deprecation warnings

Thanks to @mxstbr for creating https://github.com/gatsbyjs/gatsby/pull/27541 and pointing this out! 👊

+29 -1

0 comment

2 changed files

pr created time in 5 days

PR opened gatsbyjs/gatsby

chore(gatsby-plugin-glamor): Add pluginOptionsSchema validation

Description

Just like @mxstbr did in #27356

+2 -0

0 comment

1 changed file

pr created time in 5 days

PR opened gatsbyjs/gatsby

chore(gatsby-plugin-twitter): Add pluginOptionsSchema validation

Description

Just like @mxstbr did in #27356

+1 -0

0 comment

1 changed file

pr created time in 5 days

PR opened gatsbyjs/gatsby

chore(gatsby-plugin-cxs): Add pluginOptionsSchema validation

Description

Just like @mxstbr did in #27356

+1 -0

0 comment

1 changed file

pr created time in 5 days

PR opened gatsbyjs/gatsby

chore(gatsby-plugin-flow): Add pluginOptionsSchema validation

Description

Just like @mxstbr did in #27356

+3 -1

0 comment

1 changed file

pr created time in 5 days

Pull request review commentgatsbyjs/gatsby

docs(plugins): more in-depth pluginOptionsSchema documentation

+---+title: Validating plugin options+---++To help users [configure plugins](/docs/configuring-usage-with-plugin-options/) correctly, a plugin can optionally define a schema to enforce a type for each option. Gatsby will validate that the options users pass match the schema to help them correctly set up their site.++## How to define an options schema++To define their options schema, plugins export [`pluginOptionsSchema`](/docs/node-apis/#pluginOptionsSchema) from their `gatsby-node.js` file. This function gets passed an instance of [Joi](https://joi.dev) to define the schema with.++For example, consider the following plugin called `gatsby-plugin-console-log`:++```javascript:title=gatsby-config.js+module.exports = {+  plugins: [+    {+      resolve: `gatsby-plugin-console-log`,+      options: {+        optionA: true,+        message: "Hello world"+        optionB: false, // Optional.+      },+    },+  ],+}+```++`gatsby-plugin-console-log` can ensure users have to pass a boolean to `optionA` and a string to `message`, as well as optionally pass a boolean to `optionB`, with this `pluginOptionsSchema`:++```javascript:title=plugins/gatsby-plugin-console-log/gatsby-node.js+exports.pluginOptionsSchema = ({ Joi }) => {+  return Joi.object({+    optionA: Joi.boolean().required().description(`Enables optionA.`),+    message: Joi.string()+      .required()+      .description(`The message logged to the console.`),+    optionB: Joi.boolean().description(`Enables optionB.`),+  })+}+```++If users pass options that do not match the schema, the validation will show an error when they run `gatsby develop` and prompt them to fix their configuration.++## Unit testing an options schema++To verify that a `pluginOptionsSchema` behaves as expected, unit test it with different configurations using the [`gatsby-plugin-utils` package](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-utils#testpluginoptionsschema).++1. Add the `gatsby-plugin-utils` package to your site:++   ```shell+   npm install gatsby-plugin-utils+   ```++2. Use the `testPluginOptionsSchema` function exported from the package in your test file. For example, with [Jest](https://jestjs.io):++   ```javascript:title=plugins/gatsby-plugin-console/__tests__/gatsby-node.js+   // This is an example using Jest (https://jestjs.io/)+   import { testPluginOptionsSchema } from "gatsby-plugin-utils"+   import { pluginOptionsSchema } from "../gatsby-node"++   describe(`pluginOptionsSchema`, () => {+     it(`should invalidate incorrect options`, () => {+       const options = {+         optionA: undefined, // Should be a boolean+         message: 123, // Should be a string+         optionB: `not a boolean`, // Should be a boolean+       }+       const { isValid, errors } = testPluginOptionsSchema(+         pluginOptionsSchema,+         options+       )++       expect(isValid).toBe(false)+       expect(errors).toEqual([+         `"optionA" is required`,+         `"message" must be a string`,+         `"optionB" must be a boolean`,+       ])+     })++     it(`should validate correct options`, () => {+       const options = {+         optionA: false,+         message: "string",+         optionB: true,+       }+       const { isValid, errors } = testPluginOptionsSchema(+         pluginOptionsSchema,+         options+       )++       expect(isValid).toBe(true)+       expect(errors).toEqual([])+     })+   })+   ```++## Best practices for option schemas++The [Joi API documentation](https://joi.dev/api/) is a great reference to use while working on a `pluginOptionsSchema` as it shows all the available types and methods.++Here are some specific Joi best practices for `pluginOptionsSchema`s:++- [Add descriptions](#add-descriptions)+- [Set default options](#set-default-options)+- [Validate external access](#validate-external-access) where necessary+- [Add custom error messages](#add-custom-error-messages) where useful+- [Deprecate options](#deprecating-options) in a major version release rather than removing them++### Add descriptions++Make sure that every option and field has a `.description()` explaining its purpose. This is helpful for documentation as users can look at the schema and understand all the options. There might also be tooling in the future that auto-generates plugin option documentation from the schema.++### Set default options

This makes it look like it's preferred to set default values on the schema over using JavaScript default values.

exports.onPreInit = (_, { message = `default message` }) => {
  console.log(`logging: "${message}" to the console`)
}

Any reason for this preference? 🤔

mxstbr

comment created time in 5 days

Pull request review commentgatsbyjs/gatsby

docs(plugins): more in-depth pluginOptionsSchema documentation

+---+title: Validating plugin options+---++To help users [configure plugins](/docs/configuring-usage-with-plugin-options/) correctly, a plugin can optionally define a schema to enforce a type for each option. Gatsby will validate that the options users pass match the schema to help them correctly set up their site.++## How to define an options schema++To define their options schema, plugins export [`pluginOptionsSchema`](/docs/node-apis/#pluginOptionsSchema) from their `gatsby-node.js` file. This function gets passed an instance of [Joi](https://joi.dev) to define the schema with.++For example, consider the following plugin called `gatsby-plugin-console-log`:++```javascript:title=gatsby-config.js+module.exports = {+  plugins: [+    {+      resolve: `gatsby-plugin-console-log`,+      options: {+        optionA: true,+        message: "Hello world"+        optionB: false, // Optional.+      },+    },+  ],+}+```++`gatsby-plugin-console-log` can ensure users have to pass a boolean to `optionA` and a string to `message`, as well as optionally pass a boolean to `optionB`, with this `pluginOptionsSchema`:++```javascript:title=plugins/gatsby-plugin-console-log/gatsby-node.js+exports.pluginOptionsSchema = ({ Joi }) => {+  return Joi.object({+    optionA: Joi.boolean().required().description(`Enables optionA.`),+    message: Joi.string()+      .required()+      .description(`The message logged to the console.`),+    optionB: Joi.boolean().description(`Enables optionB.`),+  })+}+```++If users pass options that do not match the schema, the validation will show an error when they run `gatsby develop` and prompt them to fix their configuration.++## Unit testing an options schema++To verify that a `pluginOptionsSchema` behaves as expected, unit test it with different configurations using the [`gatsby-plugin-utils` package](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-utils#testpluginoptionsschema).++1. Add the `gatsby-plugin-utils` package to your site:++   ```shell+   npm install gatsby-plugin-utils+   ```++2. Use the `testPluginOptionsSchema` function exported from the package in your test file. For example, with [Jest](https://jestjs.io):++   ```javascript:title=plugins/gatsby-plugin-console/__tests__/gatsby-node.js+   // This is an example using Jest (https://jestjs.io/)+   import { testPluginOptionsSchema } from "gatsby-plugin-utils"+   import { pluginOptionsSchema } from "../gatsby-node"++   describe(`pluginOptionsSchema`, () => {+     it(`should invalidate incorrect options`, () => {+       const options = {+         optionA: undefined, // Should be a boolean+         message: 123, // Should be a string+         optionB: `not a boolean`, // Should be a boolean+       }+       const { isValid, errors } = testPluginOptionsSchema(+         pluginOptionsSchema,+         options+       )++       expect(isValid).toBe(false)+       expect(errors).toEqual([+         `"optionA" is required`,+         `"message" must be a string`,+         `"optionB" must be a boolean`,+       ])+     })++     it(`should validate correct options`, () => {+       const options = {+         optionA: false,+         message: "string",+         optionB: true,+       }+       const { isValid, errors } = testPluginOptionsSchema(+         pluginOptionsSchema,+         options+       )++       expect(isValid).toBe(true)+       expect(errors).toEqual([])+     })+   })+   ```++## Best practices for option schemas++The [Joi API documentation](https://joi.dev/api/) is a great reference to use while working on a `pluginOptionsSchema` as it shows all the available types and methods.++Here are some specific Joi best practices for `pluginOptionsSchema`s:++- [Add descriptions](#add-descriptions)+- [Set default options](#set-default-options)+- [Validate external access](#validate-external-access) where necessary+- [Add custom error messages](#add-custom-error-messages) where useful+- [Deprecate options](#deprecating-options) in a major version release rather than removing them++### Add descriptions++Make sure that every option and field has a `.description()` explaining its purpose. This is helpful for documentation as users can look at the schema and understand all the options. There might also be tooling in the future that auto-generates plugin option documentation from the schema.++### Set default options++You can use the `.default()` method to set a default value for an option. For example with `gatsby-plugin-console-log`, you can have the `message` option default to `"default message"` in case a user does not pass their own `message`:++```javascript:title=plugins/gatsby-plugin-console-log/gatsby-node.js+exports.pluginOptionsSchema = ({ Joi }) => {+  return Joi.object({+    optionA: Joi.boolean().required().description(`Enables optionA.`),+    message: Joi.string()+      .default(`default message`) // highlight-line+      .description(`The message logged to the console.`),+    optionB: Joi.boolean().description(`Enables optionB.`),+  })+}+```++Accessing `pluginOptions.message` would then log `"default message"` in all plugin APIs if the user does not supply their own value:++```javascript:title=plugins/gatsby-plugin-console-log/gatsby-node.js+exports.onPreInit = (_, pluginOptions) => {+  console.log(+    `logging: "${pluginOptions.message}" to the console` // highlight-line+  )+}+```++### Validating external access++Some plugins (particularly source plugins) query external APIs. With the `.external()` method, you can asynchronously validate that the user has access to the API, providing a better experience if they pass invalid secrets.++For example, this is how the [Contentful source plugin](/plugins/gatsby-source-contentful/) ensures the user has access to the space they are trying to query:++```javascript:title=gatsby-source-contentful/gatsby-node.js+exports.pluginOptionsSchema = ({ Joi }) => {+  return Joi.object({+    accessToken: Joi.string().required(),+    spaceId: Joi.string().required(),+    // ...more options here...+  }).external(async pluginOptions => {+    try {+      await contentful+        .createClient({+          space: pluginOptions.spaceId,+          accessToken: pluginOptions.accessToken,+        })+        .getSpace()+    } catch (err) {
    } catch {
mxstbr

comment created time in 5 days

Pull request review commentgatsbyjs/gatsby

docs(plugins): more in-depth pluginOptionsSchema documentation

+---+title: Validating plugin options+---++To help users [configure plugins](/docs/configuring-usage-with-plugin-options/) correctly, a plugin can optionally define a schema to enforce a type for each option. Gatsby will validate that the options users pass match the schema to help them correctly set up their site.++## How to define an options schema++To define their options schema, plugins export [`pluginOptionsSchema`](/docs/node-apis/#pluginOptionsSchema) from their `gatsby-node.js` file. This function gets passed an instance of [Joi](https://joi.dev) to define the schema with.++For example, consider the following plugin called `gatsby-plugin-console-log`:++```javascript:title=gatsby-config.js+module.exports = {+  plugins: [+    {+      resolve: `gatsby-plugin-console-log`,+      options: {+        optionA: true,+        message: "Hello world"+        optionB: false, // Optional.+      },+    },+  ],+}+```++`gatsby-plugin-console-log` can ensure users have to pass a boolean to `optionA` and a string to `message`, as well as optionally pass a boolean to `optionB`, with this `pluginOptionsSchema`:++```javascript:title=plugins/gatsby-plugin-console-log/gatsby-node.js+exports.pluginOptionsSchema = ({ Joi }) => {+  return Joi.object({+    optionA: Joi.boolean().required().description(`Enables optionA.`),+    message: Joi.string()+      .required()+      .description(`The message logged to the console.`),+    optionB: Joi.boolean().description(`Enables optionB.`),+  })+}+```++If users pass options that do not match the schema, the validation will show an error when they run `gatsby develop` and prompt them to fix their configuration.++## Unit testing an options schema++To verify that a `pluginOptionsSchema` behaves as expected, unit test it with different configurations using the [`gatsby-plugin-utils` package](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-utils#testpluginoptionsschema).++1. Add the `gatsby-plugin-utils` package to your site:++   ```shell+   npm install gatsby-plugin-utils

This should be a devDependency I think? 🤔

   npm install --dev gatsby-plugin-utils
mxstbr

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

delete branch MichaelDeBoey/gatsby-plugin-pinterest

delete branch : support-pluginOptionsSchema

delete time in 5 days

pull request commentrobinmetral/gatsby-plugin-pinterest

feat: Add support for the new pluginOptionsSchema function in gatsby-node

That's why I added the if-statement 😉

MichaelDeBoey

comment created time in 5 days

issue openedkentcdodds/kcd-scripts

Babel removes test files from src directory after building

  • kcd-scripts version: 6.6.0
  • node version: 14.14.0
  • npm version: 6.14.8

Relevant code or config

$ kcd-scripts build --out-dir .

What you did: Run npm run build in the root of the project

What happened: src/__tests__/gatsby-node.js was deleted

Reproduction repository: https://github.com/MichaelDeBoey/gatsby-plugin-pinterest/tree/support-pluginOptionsSchema

Problem description: When implementing https://github.com/robinmetral/gatsby-plugin-pinterest/pull/15 and running npm run build or npm run validate in the root of the project, src/__tests__/gatsby-node.js was deleted.

Suggested solution: Investigation needed 🤔

created time in 5 days

push eventMichaelDeBoey/gatsby-plugin-pinterest

Michaël De Boey

commit sha 7859508253ad678cdd1a1d5eedfdafbe5a3693b8

feat: Add support for the new pluginOptionsSchema function in gatsby-node

view details

push time in 5 days

PR opened robinmetral/gatsby-plugin-pinterest

feat: Add support for the new pluginOptionsSchema function in gatsby-node

Since https://github.com/gatsbyjs/gatsby/pull/27242 is implemented, we should add support for the new pluginOptionsSchema in gatsby-node.

+29 -6

0 comment

4 changed files

pr created time in 5 days

startedMichaelDeBoey/gatsby-plugin-pinterest

started time in 6 days

issue commentnpm/cli

[BUG] fails to install packages on my Gatsby website

When building gatsby-remark-embedder against Node 15, I got the same error: https://travis-ci.com/github/MichaelDeBoey/gatsby-remark-embedder/jobs/402578685

I managed to get the same error by first doing a clean install on Node 14 (using npm@6.14.8) on macOS, switching to Node 15 (using npm@7.0.2) and doing another npm install.

pedrolamas

comment created time in 6 days

issue commentMichaelDeBoey/gatsby-remark-embedder

Instagram returns 400 response about deprecated oEmbed endpoint

:tada: This issue has been resolved in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

teeaarbee

comment created time in 6 days

pull request commentMichaelDeBoey/gatsby-remark-embedder

fix(Instagram): Update Instagram oEmbed endpoint

:tada: This PR is included in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

MichaelDeBoey

comment created time in 6 days

pull request commentMichaelDeBoey/gatsby-remark-embedder

docs: add teeaarbee as a contributor

:tada: This PR is included in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

allcontributors[bot]

comment created time in 6 days

release MichaelDeBoey/gatsby-remark-embedder

v4.0.0

released time in 6 days

created tagMichaelDeBoey/gatsby-remark-embedder

tagv4.0.0

Gatsby Remark plugin to embed well known services by their URL.

created time in 6 days

push eventMichaelDeBoey/gatsby-remark-embedder

Michaël De Boey

commit sha 2880ab119760fd0f267437bffcd679b9ec7b0c7b

fix(Instagram): Update Instagram oEmbed endpoint (#148) BREAKING CHANGE: You'll now need to pass a required `accessToken` option whenever you're using the Instagram service. Check out the Instagram oEmbed access token docs and requirements to know how to get this.

view details

push time in 7 days

PR merged MichaelDeBoey/gatsby-remark-embedder

fix(Instagram): Update Instagram oEmbed endpoint ⚙️ Instagram

As announced on their developers blog, Facebook made changes to tokenless access for Instagram oEmbed endpoints. This means we now have to pass an accessToken, which is an App Access Token (recommended) or Client Access Token.

BREAKING CHANGE: You'll now need to pass a required accessToken option whenever you're using the Instagram service. Check out the Instagram oEmbed access token docs and requirements to know how to get this.

Fixes #147

+56 -4

1 comment

4 changed files

MichaelDeBoey

pr closed time in 7 days

delete branch MichaelDeBoey/gatsby-remark-embedder

delete branch : update-instagram-eombed-endpoint

delete time in 7 days

delete branch MichaelDeBoey/gatsby-plugin-pinterest

delete branch : update-dependencies

delete time in 7 days

delete branch MichaelDeBoey/gatsby-plugin-pinterest

delete branch : cleanup-repo

delete time in 7 days

Pull request review commentrobinmetral/gatsby-plugin-pinterest

chore: Update dependencies

   ],   "scripts": {     "build": "kcd-scripts build --out-dir .",-    "contributors:add": "all-contributors add",-    "contributors:generate": "all-contributors generate",     "lint": "kcd-scripts lint",     "validate": "kcd-scripts validate"   },   "dependencies": {-    "@babel/runtime": "^7.9.2"+    "@babel/runtime": "^7.12.1"   },   "devDependencies": {-    "all-contributors-cli": "^6.14.0",-    "kcd-scripts": "^5.6.1"+    "kcd-scripts": "^6.6.0"

It's safe to merge 🙂

MichaelDeBoey

comment created time in 7 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentrobinmetral/gatsby-plugin-pinterest

chore: Cleanup repo

 learn how: http://kcd.im/pull-request  - `gatsby-plugin-pinterest` version: - `node` version:-- `npm` (or `yarn`) version:+- `npm` version:

I made it equal to kcd-scripts

MichaelDeBoey

comment created time in 7 days

delete branch codesandbox/codesandbox-client

delete branch : snyk-fix-628ad80dc3ba2aae18f9f15b2666d001

delete time in 7 days

PR closed codesandbox/codesandbox-client

[Snyk] Security upgrade gulp from 3.9.1 to 4.0.0

<h3>Snyk has created this PR to fix one or more vulnerable packages in the npm dependencies of this project.</h3>

merge advice

Changes included in this PR

  • Changes to the following files to upgrade the vulnerable dependencies to a fixed version:
    • packages/app/package.json

Vulnerabilities that will be fixed

With an upgrade:
Severity Priority Score (*) Issue Breaking Change Exploit Maturity
high severity 589/1000 <br/> Why? Has a fix available, CVSS 7.5 Regular Expression Denial of Service (ReDoS) <br/>SNYK-JS-MINIMATCH-1019388 Yes No Known Exploit

(*) Note that the real score may have changed since the PR was raised.

<details> <summary><b>Commit messages</b></summary> </br> <details> <summary>Package name: <b>gulp</b></summary> The new version differs by 134 commits.</br> <ul> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/55eb23a268dcc7340bb40808600fd4802848c06f">55eb23a</a> Release: 4.0.0</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/173a532d0b79912ccf0050e6c5b4ffddd0d0fd1d">173a532</a> Docs: Fix the installation instructions</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/ec54d09570a891d39a2ccd6f5b13d9a5dd57c68f">ec54d09</a> Docs: Improve note about out-of-date docs</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/03b7c9860bea45649dbfd0c3d83e82a9ea58b4b2">03b7c98</a> Docs: Update recipes to install gulp@next</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/2eba29ed5d4d72209548c5b16798ff4c2d2c50a9">2eba29e</a> Docs: Remove run-sequence from recipes</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/76eb4d68c72a87cb1450fdbb069882ee6508f235">76eb4d6</a> Docs: Add installation instructions & update badges</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/fbc162fe92b6c73c5332b069f2347a0fe8b5d5f3">fbc162f</a> Docs: Remove references to gulp-util</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/3011cf9a50898030304a159c9e0bad30630380e3">3011cf9</a> Scaffold: Normalize repository</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/f27be05f6d7650ffb3ec3f9375f2d9c50c7010df">f27be05</a> Update: Remove graceful-fs from test suite</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/361ab63d5d661dee46e032c3ecac1e085c526f1a">361ab63</a> Upgrade: Update glob-watcher</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/064d1001528bc493282f006db6b02d24f97bd981">064d100</a> Build: Avoid broken node 9</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/057df5963034eb6426d99650abba15e4d912b0b7">057df59</a> Release: 4.0.0-alpha.3</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/c1ba80cb6b1a2e1469a7f422ec6ee93ac589d714">c1ba80c</a> Breaking: Upgrade major versions of glob-watcher, gulp-cli & vinyl-fs</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/89acc5c17e115ec03ec6b17341c3ffdf5e2db837">89acc5c</a> Docs: Improve ES2015 task exporting examples (#1999)</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/0ac9e043a4d6947ff2ae4496657ae44b21b5a958">0ac9e04</a> Docs: Add "Project structure" section to CONTRIBUTING.md (#1859)</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/723cbc40e76f3b43c3ec7d56fa4ed36298e912b4">723cbc4</a> Docs: Fix syntax in recipe example (#1715)</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/d420a6a742af91dcfc3e5a83f7552d2a8114471f">d420a6a</a> Docs: Have gulp.lastRun take a function to avoid task registration (#1828)</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/29ece6fc230fec095b84906437530b0257b26a4c">29ece6f</a> Upgrade: Update undertaker</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/e931cb0bbf5acfb68f3e3086dae311ec733f0f14">e931cb0</a> Docs: Fix changelog typos (#1696)</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/477db84761551ab25127447a8425c79dc4808e15">477db84</a> Docs: Add a "BrowserSync with Gulp 4" recipe (#1659)</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/d4ed3c7e3fb13f3b1bf6f8309cca8459e53f9edb">d4ed3c7</a> Docs: Add options.cwd for gulp.src API (#1645)</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/5dc3b07bd61c217c432c508573583827ef592cd1">5dc3b07</a> Docs: Update gulp.watch API to align with glob-watcher</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/0c660697b8376c0185bb9e65aca0c01107b7433e">0c66069</a> Breaking: Replace chokidar as gulp.watch with glob-watcher wrapper</li> <li><a href="https://snyk.io/redirect/github/gulpjs/gulp/commit/c3dbc10afa7dcd8c86eebcd7f87967ac1f680da2">c3dbc10</a> Docs: Clarify incremental builds example (#1609)</li> </ul>

<a href="https://snyk.io/redirect/github/gulpjs/gulp/compare/9c14e3a13a73a32e424f144d62566671b2fcdbed...55eb23a268dcc7340bb40808600fd4802848c06f">See the full diff</a> </details> </details>

Check the changes in this PR to ensure they won't cause issues with your project.


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIzZDI2MDcxNC01NWQ0LTQxOTgtYjg2OC00NjVkMWUyYjg0OTYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjNkMjYwNzE0LTU1ZDQtNDE5OC1iODY4LTQ2NWQxZTJiODQ5NiJ9fQ==" width="0" height="0"/> 🧐 View latest project report

🛠 Adjust project settings

📚 Read more about Snyk's upgrade and patch logic

+1 -1

1 comment

1 changed file

snyk-bot

pr closed time in 7 days

push eventMichaelDeBoey/gatsby-remark-embedder

allcontributors[bot]

commit sha 4247d4c0ca07861d97564c99e90282a7e914b6f6

docs: add teeaarbee as a contributor (#149) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

view details

push time in 7 days

delete branch MichaelDeBoey/gatsby-remark-embedder

delete branch : all-contributors/add-teeaarbee

delete time in 7 days

PR merged MichaelDeBoey/gatsby-remark-embedder

docs: add teeaarbee as a contributor

Adds @teeaarbee as a contributor for bug.

This was requested by MichaelDeBoey in this comment

+11 -2

0 comment

2 changed files

allcontributors[bot]

pr closed time in 7 days

issue commentMichaelDeBoey/gatsby-remark-embedder

Instagram returns 400 response about deprecated oEmbed endpoint

@all-contributors Please add @teeaarbee for bug

teeaarbee

comment created time in 7 days

PR closed codesandbox/codesandbox-client

Doc basic improvements invalid

<!-- Please make sure you are familiar with and follow the instructions in the contributing guidelines (found in the CONTRIBUTING.md file).

Please fill out the information below to expedite the review and (hopefully) merge of your pull request! -->

What kind of change does this PR introduce?

<!-- Is it a Bug fix, feature, docs update, ... -->

What is the current behavior?

<!-- You can also link to an open issue here -->

What is the new behavior?

<!-- if this is a feature change -->

What steps did you take to test this? This is required before we can merge, make sure to test the flow you've updated.

  1. Step A
  2. Step B
  3. Step C

Checklist

<!-- Have you done all of these things? --> <!-- add "N/A" to the end of each line that's irrelevant to your changes --> <!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->

  • [ ] Documentation
  • [ ] Testing <!-- We can only merge the PR if this is checked -->
  • [ ] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
  • [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions -->

<!-- feel free to add additional comments --> <!-- Thank you for contributing! -->

+5 -5

2 comments

1 changed file

devenpklnddfsdf

pr closed time in 7 days

PR opened MichaelDeBoey/gatsby-remark-embedder

Reviewers
fix(Instagram): Update Instagram oEmbed endpoint ⚙️ Instagram

As announced on their developers blog, Facebook made changes to tokenless access for Instagram oEmbed endpoints. This means we now have to pass an accessToken, which is an App Access Token (recommended) or Client Access Token.

BREAKING CHANGE: You'll now need to pass a required accessToken option whenever you're using the Instagram service. Check out the Instagram oEmbed access token docs and requirements to know how to get this.

Fixes #147

+56 -4

0 comment

4 changed files

pr created time in 7 days

push eventMichaelDeBoey/gatsby-remark-embedder

Michaël De Boey

commit sha 410f12ae0354a624dddf78caca11df1d981c8d42

fix(Instagram): Update Instagram oEmbed endpoint BREAKING CHANGE: You'll now need to pass a required `accessToken` option whenever you're using the Instagram service. Check out the Instagram oEmbed access token docs and requirements to know how to get this.

view details

push time in 7 days

issue commentMichaelDeBoey/gatsby-remark-embedder

Deploy is getting failed on vercel

@teeaarbee It's weird that the endpoint is throwing 400 responses since the endpoint isn't deprecated (yet). Although we should support the new API asap.

teeaarbee

comment created time in 8 days

issue commentMichaelDeBoey/gatsby-remark-embedder

Deploy is getting failed on vercel

Hi @teeaarbee! 👋

Can you please try without the trailing slash and see if that works? I'm currently not at my computer to try it out myself.

teeaarbee

comment created time in 9 days

push eventMichaelDeBoey/gatsby-plugin-instagram-embed

Michaël De Boey

commit sha ab517ac3113bc29494d042ed4c744f041dcb6f1a

chore: Update dependencies

view details

Michaël De Boey

commit sha a1677f282c482ade86e23a9e37bf4d60ba00f8e5

chore: Cleanup repo

view details

push time in 9 days

delete branch codesandbox/codesandbox-client

delete branch : fix-preact-warning

delete time in 10 days

delete branch codesandbox/codesandbox-client

delete branch : auto-preview-layout

delete time in 10 days

delete branch codesandbox/codesandbox-client

delete branch : christianalfoni-patch-2

delete time in 10 days

delete branch codesandbox/codesandbox-client

delete branch : garethx-workspace-docs

delete time in 10 days

pull request commentMichaelDeBoey/gatsby-remark-embedder

feat(CodePen): Add support for height & width options

should I make the changes in this PR or create a new one?

You can just hard reset this branch onto upstream/master and push new commits

talohana

comment created time in 10 days

delete branch MichaelDeBoey/gatsby

delete branch : fix-plugin-google-analytics-gatsby-node

delete time in 10 days

PullRequestReviewEvent

Pull request review commentgatsbyjs/gatsby

feat(gatsby): plugin option validation

-exports.onPreInit = ({ reporter }, options) => {-  if (!options.trackingId) {-    reporter.warn(-      `The Google Analytics plugin requires a tracking ID. Did you mean to add it?`-    )-  }-}

Here you go: https://github.com/gatsbyjs/gatsby/pull/27495 🙂

mxstbr

comment created time in 11 days

PullRequestReviewEvent

PR opened gatsbyjs/gatsby

fix(gatsby-plugin-google-analytics): Fix gatsby-node so we still have a warning on older gatsby versions

Description

As discussed with @mxstbr in https://github.com/gatsbyjs/gatsby/pull/27242#discussion_r506326021, I added onPreInit again in case GATSBY_EXPERIMENTAL_PLUGIN_OPTION_VALIDATION isn't true

+46 -36

0 comment

1 changed file

pr created time in 11 days

create barnchMichaelDeBoey/gatsby

branch : fix-plugin-google-analytics-gatsby-node

created branch time in 11 days

Pull request review commentgatsbyjs/gatsby

feat(gatsby): plugin option validation

-exports.onPreInit = ({ reporter }, options) => {-  if (!options.trackingId) {-    reporter.warn(-      `The Google Analytics plugin requires a tracking ID. Did you mean to add it?`-    )-  }-}

On it boss! 😉

mxstbr

comment created time in 11 days

more