Companion project for the Creating a Source Plugin Gatsby tutorial.
You'll need to have these tools installed:
- Node.js (v18 or newer)
- Git
- Yarn
You can also follow Part 0: Set Up Your Development Environment for more detailed instructions.
- Clone this project
yarn
to install dependenciesyarn test
to run unit testsyarn lint:fix
to run linting
yarn develop:deps
to build & serve the API at http://localhost:4000, and to also watch the source plugin for changesyarn develop:site
in another terminal window to rungatsby develop
for the test site
If you make changes to the source plugin you will need to restart the site
server to see the changes reflected in the site.
yarn start:api
to build and serve the API at http://localhost:4000yarn build
in another terminal window to build the production plugin and siteyarn serve:site
to serve the Gatsby site at http://localhost:9000. You should see an overview of all posts
This project includes three directories:
api
is the example mock backend API you will source fromplugin
is the example source pluginsite
is the example site
The source plugin consumes the API, and the site uses the source plugin.