algolia / gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
https://yarn.pm/gatsby-plugin-algolia
Apache License 2.0
177 stars 45 forks source link

Update outdated use of GatsbyReporter #97

Closed prichey closed 3 years ago

prichey commented 3 years ago

Currently the plugin does this (here):

const report = require('gatsby-cli/lib/reporter');

which doesn't work in newer versions of Gatsby so the logger falls back to console.log (here).

The correct approach in Gatsby is to use the GatsbyReporter which is available to onPostBuild, via:

exports.onPostBuild = async function ({ graphql, reporter }, options) {}
prichey commented 3 years ago

I might be able to work on a PR for this after I merge a few other fixes but if anyone else feels like taking this on, it shouldn't be that bad.

Haroenv commented 3 years ago

ah thank you, this probably fixes #55, #89 and a few more!