https://github.com/leancodepl/contractsgenerator-dart
Dart contracts client generator for a CQRS API
https://github.com/leancodepl/contractsgenerator-dart
Last synced: about 1 year ago
JSON representation
Dart contracts client generator for a CQRS API
- Host: GitHub
- URL: https://github.com/leancodepl/contractsgenerator-dart
- Owner: leancodepl
- Created: 2021-07-13T15:28:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-21T14:58:02.000Z (about 1 year ago)
- Last Synced: 2025-03-26T14:54:03.018Z (about 1 year ago)
- Language: Dart
- Homepage:
- Size: 285 KB
- Stars: 3
- Watchers: 5
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dart contracts generator
[](https://pub.dev/packages/leancode_contracts_generator)
[](https://github.com/leancodepl/contractsgenerator-dart/actions)
[](https://github.com/leancodepl/contractsgenerator-dart/actions)
Dart contracts client generator for a CQRS API. Generated code is based on the format described in .
## Prerequisites
You will need to have .NET 6 and the .NET version used in your project installed on your system and have `dotnet` available in your PATH.
### M1 macs
When installing multiple .NET sdks you need to make sure all of them are for the same architecture. Unfortunately since .NET 6 is the first .NET version to include native arm64 macOS builds, you will be forced to install the x64 version regardless:
```sh
# tap into repo that hosts mutually compatible dotnet casks
brew tap isen-ng/dotnet-sdk-versions
# force x64 .NET6
arch -x86_64 brew install dotnet-sdk6-0-100
# install your needed version (see https://github.com/isen-ng/homebrew-dotnet-sdk-versions#versions)
brew install --cask dotnet-sdk5-0-400
```
Finally, add the x64 dotnet to your `PATH`: `/usr/local/share/dotnet/x64`
## Installation
```sh
dart pub add leancode_contracts_generator --dev
dart pub add leancode_contracts
```
## Usage
First run will take longer due to the need to download external dependencies.
- Initialize a config file filled with defaults with `dart run leancode_contracts_generator init`
- Generate client contracts code with `dart run leancode_contracts_generator`