Repository for byoungz.com front-end. This repo is currently a work in progress.
- Automatic GraphQL code generation
- Light/Dark mode
- Built in A11y checks
- Code generators for utils, pages, components
- Vitest unit testing
git clone [email protected]:bbuilds/byoungz-next-headlesswp-fe.git
npm i
cp .env.example .env.local
npm run dev
Open up http://localhost:4444 in your browser.
To trigger the unit tests, run:
npm run test
npm run lint
And to auto-fix:
npm run fix
npm run generate component MyComponent
npm run generate page Blog blog
npm run generate page BlogDetail blog/[id]
npm run generate util isNumeric
This command will fetch content types from your NEXT_PUBLIC_WORDPRESS_GRAPHQL_URL
listed in the .env.local
file and generate types for them.
This command will only work if you have a running WordPress instance with the WPGraphQL plugin installed and have enabled public introspection.
Enable GraphQL Introspection
In the WordPress admin sidebar of your environment, head to GraphQL > Settings. Make sure the Enable Public Introspection option is checked.
npm run codegen:wp