Closed LekoArts closed 3 years ago
Thanks @LekoArts! I noticed in https://github.com/algolia/gatsby-plugin-algolia/issues/123 that the import for the reporter:
possibly might not work with v3. Do you have any ideas on why that could be / the better alternative?
Does Gatsby think it's interesting to move this package to the Gatsby monorepo instead of this repo?
Hi!
Yeah, the reporter shouldn't be required from gatsby-cli
but used like here: https://www.gatsbyjs.com/docs/reference/config-files/node-api-helpers/#reporter
It gets added to the APIs:
exports.onPostBuild = ({ reporter }) => {
reporter.info(`Your Gatsby site has been built!`)
}
Generally speaking we currently don't want to add new packages to our monorepo, we only maintain critical plugins and let companies maintain their own ones :)
I'll adjust the PR to also change the reporter
then :)
https://github.com/algolia/gatsby-plugin-algolia/issues/97 proposes the same (correct) thing :)
Ah I was confused with it all Lennart, thanks for updating the PR with the fix!
This code is untested so far, would appreciate if you can give it a test spin (I don't have any algolia set up) :)
Thanks for the quick merge! As I said, please test it before publishing it 👍
I had to update the example to v2, but once that was done it all worked, thanks @LekoArts
Ideally you should upgrade to v3 😅 But if it works on v2 I'm confident that v3 will also work (but better safe than sorry)
yes, I'll do it soon!
Hello, Gatsby maintainer here 👋
While looking at the plugin I noticed that the
peerDependency
is set incorrectly. It should be a dependency ongatsby
and notgatsby-cli
. We're in the process of providing more helpful information on the/plugins
page of our website and for that we need plugins to set theirpeerDependencies
correctly/more specific.I've also updated the minimum Node version as v3 requires at least 12.13.0.
Thanks!
Fixes https://github.com/algolia/gatsby-plugin-algolia/issues/123 Fixes https://github.com/algolia/gatsby-plugin-algolia/issues/126 Fixes https://github.com/algolia/gatsby-plugin-algolia/issues/97