-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gatsby-cli): Add a plugin authoring help in gatsby-cli #13450
Conversation
|
||
Resources: | ||
- Walk through the tutorial (https://www.gatsbyjs.org/docs/source-plugin-tutorial/) | ||
- Read requirements for Gatsby packages (file and naming conventions) (https://www.gatsbyjs.org/docs/how-plugins-work/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is changing as part of #13261, so we'll probably want to wait until that lands and update this URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcysutton we can also create a short-link, e.g. https://gatsby.dev/how-plugins-work
and probably should for links in the CLI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh yes! the content referenced on that page is moving though. I think the best place will be: /docs/creating-plugins/
And /docs/creating-a-source-plugin/
or /docs/pixabay-source-plugin-tutorial/
for the tutorial link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcysutton do you have a PR id where the page /docs/creating-plugins/
is created ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was in #13261, which has now been merged! I'll chat with the team about creating short links.
Thank you for your reviews @marcysutton and @DSchau 👍 |
This is looking great! @frinyvonnick do you know if this PR would make the command |
Sure but it displays the whole message maybe we should have a shorter message for top-level help command @shannonbux @marcysutton ? |
@sidharthachatterjee does #13089 affect this PR ? |
Thank you for your review @shannonbux 👍 |
Hmm. This will conflict with the future implementation of #10294. I don't think general info like this should be a top level command. @shannonbux 's recommendations for cli in #13376 were more appropriate. I also think this brings up a larger conversation concerning CLI design. I've brought it up with Jason before but it probably needs to be a larger conversation. In relation to #10294 Should the comamand be This seems like a very important design decision for the future maintainability and UX of the CLI. Any decisions we make now, no matter how small, need to be maintained in the future. If we design well now we might be able to avoid breaking the API in the future and requiring a version bump. @frinyvonnick Thanks for working on this. This really isn't about your work in particular as much as it is me being concerned about the future of the CLI. Hope this all makes sense. This is a larger conversation that should probably be held outside of this particular PR, though it might hold up its merge. This discussion can continue here: #13537 |
Hi @moonmeister, thank you for your review 👍 I totally understand, I'll be patient till the discussion is over so I could finish this PR 😉 |
Ok, after reading @moonmeister's PR, I think these can work together. What if you change this one @frinyvonnick to say: plugin [action] [plugin-name] run commands pertaining to gatsby plugins And then, when people run $ gatsby plugin --help
plugin add [plugin-name] Installs npm package, adds plugin to `gatsby-config.js`, warns if further config is needed.
plugin remove [plugin-name] Removes npm package from `node_modules` and `package.json`, removes config from `gatsby-config.js`
plugin config [plugin-name] Runs through configuration options again for dev to change answers if desired, defaults to current config
plugin search [search term(s)] Searches the [plugin database](https://www.gatsbyjs.org/plugins/) and returns relevant options
Resources:
Using a plugin:
- [What is a Plugin?](https://www.gatsbyjs.org/docs/what-is-a-plugin/)
- [Using a Plugin in Your Site](https://www.gatsbyjs.org/docs/using-a-plugin-in-your-site/)
- [What You Don't Need Plugins For](https://www.gatsbyjs.org/docs/what-you-dont-need-plugins-for/)
- [Loading Plugins from Your Local Plugins Folder](https://www.gatsbyjs.org/docs/loading-plugins-from-your-local-plugins-folder/)
- [Plugin Library](https://www.gatsbyjs.org/plugins/)
Creating a plugin:
- [Naming a Plugin](https://www.gatsbyjs.org/docs/naming-a-plugin/)
- [Files Gatsby Looks for in a Plugin](https://www.gatsbyjs.org/docs/files-gatsby-looks-for-in-a-plugin/)
- [Creating a Local Plugin](https://www.gatsbyjs.org/docs/creating-a-local-plugin/)
- [Creating a Source Plugin](https://www.gatsbyjs.org/docs/creating-a-source-plugin/)
- [Creating a Transformer Plugin](https://www.gatsbyjs.org/docs/creating-a-transformer-plugin/)
- [Submit to Plugin Library](https://www.gatsbyjs.org/contributing/submit-to-plugin-library/)
- [Pixabay Source Plugin Tutorial](https://www.gatsbyjs.org/docs/pixabay-source-plugin-tutorial/)
- [Maintaining a Plugin](https://www.gatsbyjs.org/docs/maintaining-a-plugin/)
- Join Discord #plugin-authoring channel to ask questions!
Run `gatsby plugin --help` anytime you'd like to see this information again. Thank you! Is this too insanely long? |
I'm leaning towards insanely long. What if we did something like |
So @shannonbux this PR is paused until gatsbyjs/rfcs#38 is merged ? |
Sounds like we can probably move forward...the CLI implementation just needs to be decided. |
Great suggestion @moonmeister. How about this? plugin [action] [plugin-name] run commands pertaining to gatsby plugins And then, when people run $ gatsby plugin --help
plugin add [plugin-name] Installs npm package, adds plugin to `gatsby-config.js`, warns if further config is needed.
plugin remove [plugin-name] Removes npm package from `node_modules` and `package.json`, removes config from `gatsby-config.js`
plugin config [plugin-name] Runs through configuration options again for dev to change answers if desired, defaults to current config
plugin search [search term(s)] Searches the [plugin database](https://www.gatsbyjs.org/plugins/) and returns relevant options
plugin docs Directs you to docs about using and creating plugins
Run `gatsby plugin --help` anytime you'd like to see this information again. Thank you! If you all are good with this idea, with these changes the PR could then be ready to merge imho |
Seems nice to me @shannonbux 👍! @moonmeister what do you think of it ? |
@shannonbux @frinyvonnick looks good. |
I moved to @shannonbux is this extra message mandatory ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
9538636
to
6106cd6
Compare
Someone of the @gatsbyjs/core could review it ? 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly great--thanks!
Few other comments (that I can't leave suggestions for):
gatsby plugin
should have documentation, specifically in:
Thanks for this--and your patience!
Co-Authored-By: Dustin Schau <DSchau@users.noreply.github.com>
Thanks @DSchau for your review, I'll update documentation as soon as possible 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Successfully published:
Thanks so much! |
…#13450) * ✨ Add a plugin helping center * 👌 Take care of @marcysutton review * 👌 Take care of @shannonbux review * ♻️ Move to gatsby plugin docs * 👌 Apply suggestions from code review Co-Authored-By: Dustin Schau <DSchau@users.noreply.github.com> * 📝 Add documentation about new command
Description
It implements a help message about plugin authoring as suggested by @shannonbux
Related Issues
Related #13376