This project uses a highly opinionated dependency vendoring strategy. This strategy is designed to ensure that you own your availability and can always build your project. This strategy is as follows:
- All dependencies are vendored into the project into the
vendor/shards/cache/
directory - The
vendor/shards/cache/
directory is committed to the repository to ensure that all dependencies are available to build the project forever. These shards are in<name>-<version>.shard
format and take inspiration from a Ruby "Gem" when they are vendored. - The
script/bootstrap
command installs vendored dependencies withSHARDS_CACHE_PATH="vendor/.cache/shards" shards install ...
to ensure that each project has its own cache and does not interfere with other crystal projects - The
script/update
command will re-vendor all dependencies and update the vendored dependencies in the repository. This will always result is changes to all dependencies, even if the version has not changed. This is to ensure that the vendored dependencies are always up to date and can be used to build the project.
- All code must have unit tests
- 100% code coverage is enforced
- Acceptance tests are used to test the application as a whole
Run the following command to bootstrap this repository and install all dependencies:
script/bootstrap
Run the following command to update all dependencies (shards):
script/update
Run the following command to run all unit tests:
script/test
Run the following command to run all acceptance tests:
script/acceptance
Run the following command to lint the project:
script/lint
script/lint --fix # to fix any linting errors
Run the following command to format the project:
script/format
script/format --check # to check if any files need to be formatted without formatting them
This will lint and format the project, followed by running all unit tests.
To get started quickly with this project, you will need the following installed:
To get your repo setup for development do the following:
- Clone the repo
- Ensure your version of crystal matches the version in
.crystal-version
- Run the following command:
script/bootstrap
- Congrats you're ready to start developing!
- Write some code
- Run
script/test
to run unit tests and ensure your changes work - Run
script/lint
to ensure your changes follow the style guide - Run
script/format
to ensure your changes are formatted correctly - Run
script/acceptance
to run the acceptance test suite - Open a pull request 🎉