## π₯ Installation
To install the base criteria dependency, run the following command:
```sh
npm i @codelytv/criteria
```
Then, install the preferred criteria transformer. You can transform in two directions:
Create a Criteria from:
- [Next.js Request](./packages/criteria-from-next-request)
- [URL](./packages/criteria-from-url)
Convert a Criteria to:
- [Elasticsearch (and esql)](./packages/criteria-to-elasticsearch)
- [MySql](./packages/criteria-to-mysql)
You can also create your custom transformer.
### β Testing
To facilitate the testing of the criteria, you can use the provided [object mothers](https://www.martinfowler.com/bliki/ObjectMother.html):
```sh
npm i @codelytv/criteria-test-mother --save-dev
```
## β Other implementations
We have [another implementation in PHP](https://github.com/CodelyTV/php-criteria) with converters for Laravel and Symfony. π
## π Release
1. At the end of each Pull Request, execute `pnpm changeset` to add the changes to the changelog.
2. Push the changes.
3. When the Pull Request is merged, a new release will be triggered, affecting only the modified packages.
If you want to merge a code without a changeset (for example, a Readme or test modification) you should execute
`pnpm changeset --empty` in your Pull Request before merging it.