Thank you for contributing to TMViz! This document contains everything you need to know to get the project up and running locally for development, as well as what you need to do before submitting a pull request.
- Fork this repository to your own GitHub account and then clone it to your local device.
- Create a new feature branch:
git checkout -b my-new-feature
- Install the dependencies:
yarn
- Run
yarn dev
to build and watch for code changes - Commit your changes:
git commit -am 'Add some feature'
- Push to the branch: git push -u origin my-new-feature
- Create a Pull Request
Before submitting a pull request, make sure the following conditions are met:
- The code has been formatted correctly (run
yarn format
to format your code with Prettier) - No errors on ESLint (run
yarn lint
to run ESLint) - No type errors on TypeScript (run
yarn type-check
)
If one or more of the conditions above are not met, the GitHub Actions CI might fail to build your code.
TMViz is built using Next.js. This means that there are some folder conventions enforced by the framework itself (e.g. for Next.js pages).
Outside of that, we have devised our own project structure as follows:
_data
- data which are statically generated on build time, e.g. site metadata, and main menu._pages
- pages written in Markdown. Every Markdown file inside this folder will be generated with the filename as its slug.public
- Next.js public assets directory.src
- Contains our source files.components
- Layout + design-system components (primarily used in Customiser).modules
- Contains core functionalities, separated by feature.pages
- Next.js server-rendered pages.types
- TypeScript types used across multiple feature modules.utils
- Utility functions used across multiple feature modules.