The beauty of contributing to open source is that you can clone your favorite project, get it running locally, and test out experiments and changes in real time! Way to feel like a wizard.
On this page:
- Repo setup
- Creating your own plugins and loaders
- Making changes to the starter Library
- Contributing example sites
- Using Docker to set up test environments
- Development tools
This page includes details specific to the Gatsby core and ecosystem codebase.
To start setting up the Gatsby repo on your machine using git, Yarn and Gatsby-CLI, check out the page on setting up your local dev environment.
Alternatively, you can skip the local setup and use an online dev environment.
To contribute to the blog or Gatsbyjs.org website, check out the setup steps on the blog and website contributions page. For instructions on contributing to the docs, visit the docs contributions page.
If you create a loader or plugin, we would love for you to open source it and put it on npm. For more information on creating custom plugins, please see the documentation for plugins and the API specification.
Note: You don’t need to follow these steps to submit to the starter library. This is only necessary if you’d like to contribute to the functionality of the starter library. To submit a starter, follow these steps instead.
To develop on the starter library, you’ll need to supply a GitHub personal access token.
- Create a personal access token in your GitHub Developer settings.
- In the new token’s settings, grant that token the “public_repo” scope.
- Create a file in the root of
.env.development, and add the token to that file like so:
.env.development file is ignored by git. Your token should never be committed.
Gatsby’s policy is that “Using” example sites (like those in the examples part of the repo) should only be around plugins that are maintained by the core team as it’s hard to keep things up to date otherwise.
To contribute example sites, it is recommended to create your own GitHub repo and link to it from your source plugin, etc.
With all of the possible Gatsby integrations, it might help to spin up a Docker container with the software application you need to test. This makes installation a breeze, so you can focus less on getting set up and more on the integration details that matter to you.
Do you have a setup not listed here? Let us know by adding it to this file and opening a PR.
To install Wordpress to use with Gatsby, this
docker-compose.yml file will come in handy:
version: '2'services:db:image: mysql:5.6container_name: sessions_dbports:- "3306:3306"volumes:- "./.data/db:/var/lib/mysql"restart: alwaysenvironment:MYSQL_ROOT_PASSWORD: wordpressMYSQL_DATABASE: wordpressMYSQL_USER: wordpressMYSQL_PASSWORD: wordpresswordpress:image: wordpress:latestcontainer_name: sessions_wordpressdepends_on:- dblinks:- dbports:- "7000:80"restart: alwaysenvironment:WORDPRESS_DB_HOST: db:3306WORDPRESS_DB_PASSWORD: wordpressvolumes:- ./wp-content:/var/www/html/wp-content- ./wp-app:/var/www/htmlphpmyadmin:image: phpmyadmin/phpmyadmincontainer_name: sessions_phpmyadminenvironment:- PMA_ARBITRARY=1- PMA_HOST=sessions_db- PMA_USER=wordpress- PMA_PASSWORD=wordpressrestart: alwaysports:- 8080:80volumes:- /sessions
Use the above file contents when following the Docker Wordpress install instructions: https://docs.docker.com/compose/wordpress/
Using Docker Compose, you can start and stop a Wordpress instance and integrate it with the Gatsby Wordpress source plugin.
Check Debugging the build process page to learn how to debug Gatsby.
At any point during the contributing process, the Gatsby Core team would love to help! We hold a weekly Core Maintainer’s meeting where you can share your creation(s) and receive advice and feedback directly from the team!
Edit this page on GitHub