diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index ac115b2e..aac33bae 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -29,35 +29,36 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v2 - - name: Activate multipack + - name: Activate tools run: | echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH - pub global activate multipack + pub global activate melos + pub global activate uni - name: Check pubspec run: | - multipack --only $PACKAGE pubspec clean - multipack --only $PACKAGE exec git diff --exit-code pubspec.yaml - - name: Override local dependencies + melos clean + melos --scope $PACKAGE exec -- git diff --exit-code pubspec.yaml + - name: Bootstrap run: | - multipack pubspec hard_override + melos --scope $PACKAGE bootstrap - name: Get dependencies run: | - multipack --only $PACKAGE pub get + melos --scope $PACKAGE exec -- uni pub get - name: Check formatting run: | echo "" echo "A list of incorrectly formatted files may follow:" echo "" - multipack --only $PACKAGE fmt -n . --set-exit-if-changed + melos --scope $PACKAGE exec -- uni --tooling legacy format -n . --set-exit-if-changed echo "" - name: Analyze package run: | - multipack --only $PACKAGE analyze --version - multipack --only $PACKAGE analyze --fatal-warnings --no-hints . + melos --scope $PACKAGE exec -- uni analyze --version + melos --scope $PACKAGE exec -- uni analyze --fatal-warnings . - name: Run tests run: | - multipack --only $PACKAGE exec [ ! -d ./test ] && exit 0 - multipack --only $PACKAGE pub run test + melos --scope $PACKAGE exec -- [ -d ./test ] || exit 0 + melos --scope $PACKAGE exec -- uni test examples: strategy: matrix: @@ -74,37 +75,38 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v2 - - name: Activate multipack + - name: Activate tools run: | echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH - pub global activate multipack + pub global activate melos + pub global activate uni - name: Check pubspec run: | - multipack --only $PACKAGE pubspec clean - multipack --only $PACKAGE exec git diff --exit-code pubspec.yaml - - name: Override local dependencies + melos clean + melos --scope $PACKAGE exec -- git diff --exit-code pubspec.yaml + - name: Bootstrap run: | - multipack pubspec hard_override + melos --scope $PACKAGE bootstrap - name: Get dependencies run: | - multipack --only $PACKAGE pub get + melos --scope $PACKAGE exec -- uni pub get - name: Run builders run: | - multipack --only $PACKAGE pub run build_runner build --delete-conflicting-outputs + melos --scope $PACKAGE exec -- uni pub run build_runner build --delete-conflicting-outputs - name: Check build diff run: | - multipack --only $PACKAGE exec git diff --exit-code **/*.gql.dart + melos --scope $PACKAGE exec -- git diff --exit-code **/*.gql.dart - name: Check formatting run: | echo "" echo "A list of incorrectly formatted files may follow:" echo "" - multipack --only $PACKAGE fmt -n . --set-exit-if-changed + melos --scope $PACKAGE exec -- uni --tooling legacy format -n . --set-exit-if-changed echo "" - name: Analyze package run: | - multipack --only $PACKAGE analyze --version - multipack --only $PACKAGE analyze --fatal-warnings --no-hints . + melos --scope $PACKAGE exec -- uni analyze --version + melos --scope $PACKAGE exec -- uni analyze --fatal-warnings . builder_tests: strategy: matrix: @@ -119,41 +121,42 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v2 - - name: Activate multipack + - name: Activate tools run: | echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH - pub global activate multipack + pub global activate melos + pub global activate uni - name: Check pubspec run: | - multipack --only $PACKAGE pubspec clean - multipack --only $PACKAGE exec git diff --exit-code pubspec.yaml - - name: Override local dependencies + melos clean + melos --scope $PACKAGE exec -- git diff --exit-code pubspec.yaml + - name: Bootstrap run: | - multipack pubspec hard_override + melos --scope $PACKAGE bootstrap - name: Get dependencies run: | - multipack --only $PACKAGE pub get + melos --scope $PACKAGE exec -- uni pub get - name: Run builders run: | - multipack --only $PACKAGE pub run build_runner build --delete-conflicting-outputs + melos --scope $PACKAGE exec -- uni pub run build_runner build --delete-conflicting-outputs - name: Check build diff run: | - multipack --only $PACKAGE exec git diff --exit-code **/*.gql.dart + melos --scope $PACKAGE exec -- git diff --exit-code **/*.gql.dart - name: Check formatting run: | echo "" echo "A list of incorrectly formatted files may follow:" echo "" - multipack --only $PACKAGE fmt -n . --set-exit-if-changed + melos --scope $PACKAGE exec -- uni --tooling legacy format -n . --set-exit-if-changed echo "" - name: Analyze package run: | - multipack --only $PACKAGE analyze --version - multipack --only $PACKAGE analyze --fatal-warnings --no-hints . + melos --scope $PACKAGE exec -- uni analyze --version + melos --scope $PACKAGE exec -- uni analyze --fatal-warnings . - name: Run tests run: | - multipack --only $PACKAGE exec [ ! -d ./test ] && exit 0 - multipack --only $PACKAGE pub run test + melos --scope $PACKAGE exec -- [ -d ./test ] || exit 0 + melos --scope $PACKAGE exec -- uni test publish_dry_run: runs-on: ubuntu-latest @@ -166,7 +169,7 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v2 - - name: Activate multipack + - name: Activate tools run: | echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH pub global activate multipack @@ -191,13 +194,13 @@ jobs: run: | apt update apt install -y graphviz - - name: Activate multipack + - name: Activate tools run: | echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH - pub global activate multipack + pub global activate melos - name: Generate SVG run: | - multipack info | dot -Tsvg -o docs/gql.svg + melos list --gviz | dot -Tsvg -o docs/gql.svg cat docs/gql.svg - name: Check changes run: | diff --git a/README.md b/README.md index f905c99b..0122cd01 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Star on GitHub][github-star-badge]][github-star-link] [![Watch on GitHub][github-forks-badge]][github-forks-link] [![Discord][discord-badge]][discord-link] +[![Melos][melos-badge]][melos-link] [license-badge]: https://img.shields.io/github/license/gql-dart/gql.svg?style=for-the-badge [license-link]: https://github.com/gql-dart/gql/blob/master/LICENSE @@ -21,6 +22,8 @@ [discord-badge]: https://img.shields.io/discord/559455668810153989.svg?style=for-the-badge&logo=discord&logoColor=ffffff [discord-link]: https://discord.gg/NryjpVa +[melos-badge]: https://img.shields.io/badge/maintained%20with-melos-f700ff.svg?style=for-the-badge +[melos-link]: https://github.com/invertase/melos This is an effort to advance the Dart GraphQL ecosystem. @@ -154,31 +157,18 @@ and to build a community around this vendor-neutral implementation. Community contributions are welcome. -### `multipack` -This repo uses [`multipack`](https://github.com/gql-dart/multipack). To activate it run the following command. +### `melos` +This repo uses [`melos`](https://docs.page/invertase/melos) for monorepo management. To activate it run the following command. ```bash -pub global activate multipack +dart pub global activate melos ``` -`multipack` provides a simple way of running commands in multiple packages at once. It builds a directed graph of packages -to run commands in topological order. - -Link all local packages by running -```bash -multipack pubspec override -``` - -Get all packages by running -```bash -multipack pub get -``` - -Clean up the pubspec file before publishing +Start your work by [bootstrapping the monorepo](https://docs.page/invertase/melos/getting-started#bootstrapping). ```bash -multipack pubspec clean +melos bootstrap ``` -See more usage examples in [.github/workflows/dart.yml](.github/workflows/dart.yml). +See more usage examples of `melos` in [.github/workflows/dart.yml](.github/workflows/dart.yml). ## Features and bugs diff --git a/docs/gql.svg b/docs/gql.svg index 0adbb924..f98936de 100644 --- a/docs/gql.svg +++ b/docs/gql.svg @@ -6,585 +6,586 @@ - + packages - + -cluster - +cluster . + +. -cluster links - -links +cluster codegen + +codegen -cluster codegen - -codegen +cluster links + +links cluster examples - -examples + +examples - + -gql_pedantic - -gql_pedantic +cats + +cats - + -cats - -cats +end_to_end_test + +end_to_end_test - - -gql - -gql + + +gql_build + +gql_build - + -gql->gql_pedantic - - +end_to_end_test->gql_build + + - + + +gql_code_builder + +gql_code_builder + + -gql->cats - - +end_to_end_test->gql_code_builder + + - + gql_exec - -gql_exec - - - -gql_exec->gql_pedantic - - + +gql_exec - + -gql_exec->gql - - +end_to_end_test->gql_exec + + - - -gql_link - -gql_link + + +gql + +gql - - -gql_link->gql_pedantic - - + + +gql->cats + + - + + +gql_pedantic + +gql_pedantic + + -gql_link->gql - - +gql->gql_pedantic + + - + -gql_link->gql_exec - - - - - -gql_websocket_link - -gql_websocket_link +gql_build->gql + + - - -gql_websocket_link->gql_pedantic - - + + +gql_build->gql_code_builder + + - + -gql_websocket_link->gql - - +gql_build->gql_pedantic + + - + -gql_websocket_link->gql_exec - - +gql_code_builder->gql + + - + -gql_websocket_link->gql_link - - +gql_code_builder->gql_exec + + - - -gql_transform_link - -gql_transform_link + + +gql_code_builder->gql_pedantic + + - - -gql_transform_link->gql_pedantic - - + + +gql_dedupe_link + +gql_dedupe_link - + -gql_transform_link->gql - - +gql_dedupe_link->gql + + - + -gql_transform_link->gql_exec - - +gql_dedupe_link->gql_exec + + - + + +gql_link + +gql_link + + -gql_transform_link->gql_link - - +gql_dedupe_link->gql_link + + - - -gql_http_link - -gql_http_link + + +gql_dedupe_link->gql_pedantic + + - - -gql_http_link->gql_pedantic - - + + +gql_dio_link + +gql_dio_link - + + +gql_dio_link->gql + + + + -gql_http_link->gql - - +gql_dio_link->gql_exec + + - + -gql_http_link->gql_exec - - +gql_dio_link->gql_link + + - - -gql_http_link->gql_link - - + + +gql_dio_link->gql_pedantic + + - + gql_error_link - -gql_error_link - - - -gql_error_link->gql_pedantic - - + +gql_error_link gql_error_link->gql - - + + gql_error_link->gql_exec - - + + gql_error_link->gql_link - - + + - - -gql_code_builder - -gql_code_builder + + +gql_error_link->gql_pedantic + + - - -gql_code_builder->gql_pedantic - - + + +gql_example_build + +gql_example_build - + -gql_code_builder->gql - - +gql_example_build->gql_build + + - + -gql_code_builder->gql_exec - - +gql_example_build->gql_pedantic + + - - -gql_build - -gql_build + + +gql_example_cli + +gql_example_cli - - -gql_build->gql_pedantic - - + + +gql_example_cli->gql + + - + + +gql_example_cli->gql_build + + + + -gql_build->gql - - +gql_example_cli->gql_exec + + - + + +gql_http_link + +gql_http_link + + -gql_build->gql_code_builder - - +gql_example_cli->gql_http_link + + - - -gql_example_http_auth_link - -gql_example_http_auth_link + + +gql_example_cli->gql_link + + - - -gql_example_http_auth_link->gql_pedantic - - + + +gql_example_cli->gql_pedantic + + - - -gql_example_http_auth_link->gql - - + + +gql_example_cli_github + +gql_example_cli_github - + -gql_example_http_auth_link->gql_exec - - +gql_example_cli_github->gql + + - - -gql_example_http_auth_link->gql_link - - + + +gql_example_cli_github->gql_build + + - + + +gql_example_cli_github->gql_exec + + + + -gql_example_http_auth_link->gql_transform_link - - +gql_example_cli_github->gql_http_link + + - + -gql_example_http_auth_link->gql_http_link - - +gql_example_cli_github->gql_link + + - - -gql_example_http_auth_link->gql_error_link - - + + +gql_example_cli_github->gql_pedantic + + - - -gql_example_http_auth_link->gql_build - - + + +gql_transform_link + +gql_transform_link - - -gql_example_flutter - -gql_example_flutter + + +gql_example_cli_github->gql_transform_link + + - - -gql_example_flutter->gql_pedantic - - + + +gql_example_dio_link + +gql_example_dio_link - - -gql_example_flutter->gql - - + + +gql_example_dio_link->gql + + - + + +gql_example_dio_link->gql_dio_link + + + + -gql_example_flutter->gql_exec - - +gql_example_dio_link->gql_exec + + - - -gql_example_flutter->gql_link - - + + +gql_example_dio_link->gql_link + + - - -gql_example_flutter->gql_http_link - - + + +gql_example_flutter + +gql_example_flutter - + -gql_example_flutter->gql_build - - - - - -gql_dio_link - -gql_dio_link +gql_example_flutter->gql + + - + -gql_dio_link->gql_pedantic - - +gql_example_flutter->gql_build + + - - -gql_dio_link->gql - - + + +gql_example_flutter->gql_exec + + - + -gql_dio_link->gql_exec - - - - - -gql_dio_link->gql_link - - +gql_example_flutter->gql_http_link + + - - -gql_example_dio_link - -gql_example_dio_link + + +gql_example_flutter->gql_link + + - + -gql_example_dio_link->gql - - +gql_example_flutter->gql_pedantic + + - - -gql_example_dio_link->gql_exec - - + + +gql_example_http_auth_link + +gql_example_http_auth_link - + -gql_example_dio_link->gql_link - - +gql_example_http_auth_link->gql + + - - -gql_example_dio_link->gql_dio_link - - + + +gql_example_http_auth_link->gql_build + + - - -gql_example_cli_github - -gql_example_cli_github + + +gql_example_http_auth_link->gql_error_link + + - - -gql_example_cli_github->gql_pedantic - - + + +gql_example_http_auth_link->gql_exec + + - + -gql_example_cli_github->gql - - - - - -gql_example_cli_github->gql_exec - - +gql_example_http_auth_link->gql_http_link + + - + -gql_example_cli_github->gql_link - - +gql_example_http_auth_link->gql_link + + - + -gql_example_cli_github->gql_transform_link - - - - - -gql_example_cli_github->gql_http_link - - +gql_example_http_auth_link->gql_pedantic + + - - -gql_example_cli_github->gql_build - - + + +gql_example_http_auth_link->gql_transform_link + + - - -gql_example_cli - -gql_example_cli + + +gql_exec->gql + + - - -gql_example_cli->gql_pedantic - - + + +gql_exec->gql_pedantic + + - + -gql_example_cli->gql - - - - - -gql_example_cli->gql_exec - - +gql_http_link->gql + + - + -gql_example_cli->gql_link - - +gql_http_link->gql_exec + + - + + +gql_http_link->gql_link + + + + -gql_example_cli->gql_http_link - - +gql_http_link->gql_pedantic + + - - -gql_example_cli->gql_build - - + + +gql_link->gql + + - - -gql_example_build - -gql_example_build + + +gql_link->gql_exec + + - + -gql_example_build->gql_pedantic - - - - - -gql_example_build->gql_build - - - - - -gql_dedupe_link - -gql_dedupe_link +gql_link->gql_pedantic + + - - -gql_dedupe_link->gql_pedantic - - + + +gql_transform_link->gql + + - - -gql_dedupe_link->gql - - + + +gql_transform_link->gql_exec + + - + -gql_dedupe_link->gql_exec - - +gql_transform_link->gql_link + + - - -gql_dedupe_link->gql_link - - + + +gql_transform_link->gql_pedantic + + - + -end_to_end_test - -end_to_end_test +gql_websocket_link + +gql_websocket_link - - -end_to_end_test->gql_exec - - + + +gql_websocket_link->gql + + - - -end_to_end_test->gql_code_builder - - + + +gql_websocket_link->gql_exec + + - + -end_to_end_test->gql_build - - +gql_websocket_link->gql_link + + + + + +gql_websocket_link->gql_pedantic + + diff --git a/links/gql_http_link/lib/src/_utils.dart b/links/gql_http_link/lib/src/_utils.dart index 97ece858..84abb4cd 100644 --- a/links/gql_http_link/lib/src/_utils.dart +++ b/links/gql_http_link/lib/src/_utils.dart @@ -1,6 +1,4 @@ import "dart:convert"; -import "dart:typed_data"; -import "package:meta/meta.dart"; import "package:http/http.dart"; import "package:gql/ast.dart"; diff --git a/links/gql_http_link/pubspec.yaml b/links/gql_http_link/pubspec.yaml index 839c12cd..67ed54f2 100644 --- a/links/gql_http_link/pubspec.yaml +++ b/links/gql_http_link/pubspec.yaml @@ -15,4 +15,3 @@ dev_dependencies: test: ^1.0.0 mockito: ^4.1.1 gql_pedantic: ^1.0.2 - http_parser: ^3.1.4 diff --git a/melos.yaml b/melos.yaml new file mode 100644 index 00000000..3b24026b --- /dev/null +++ b/melos.yaml @@ -0,0 +1,8 @@ +name: gql_monorepo +packages: + - cats/* + - codegen/** + - examples/** + - gql/* + - gql_pedantic/* + - links/**