Skip to content

Commit

Permalink
Merge pull request #16 from ricardoboss/issues/14-monorepo
Browse files Browse the repository at this point in the history
Prepare monorepo
  • Loading branch information
ricardoboss authored Mar 28, 2024
2 parents 9863fbf + fb2132a commit c2f551a
Show file tree
Hide file tree
Showing 79 changed files with 103 additions and 42 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ on:

jobs:
test:
name: Analyze, format, and test
strategy:
fail-fast: false
matrix:
package: ['kiota_abstractions', 'kiota_http']

name: '${{ matrix.package }}: Analyze & Test'
runs-on: ubuntu-latest

steps:
Expand All @@ -24,17 +29,23 @@ jobs:

- name: Install dependencies
run: dart pub get
working-directory: packages/${{ matrix.package }}

- name: Verify formatting
continue-on-error: true
run: dart format --output=none --set-exit-if-changed .
working-directory: packages/${{ matrix.package }}

- name: Analyze project source
continue-on-error: true
run: dart analyze --fatal-infos
working-directory: packages/${{ matrix.package }}

- name: Run build_runner
if: contains(fromJson('[ "kiota_abstractions" ]'), matrix.package)
run: dart run build_runner build --delete-conflicting-outputs
working-directory: packages/${{ matrix.package }}

- name: Run tests
run: dart test
working-directory: packages/${{ matrix.package }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ migrate_working_dir/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
pubspec.lock
**/doc/api/
.dart_tool/
build/
4 changes: 0 additions & 4 deletions CHANGELOG.md

This file was deleted.

34 changes: 7 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
The Kiota abstractions library for Dart defines the basic constructs Kiota projects need once
a client has been generated from an OpenAPI definition.
# `dart_kiota`

A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to the
abstraction package to build and run.

## Usage

Install the package in the generated project:

> For now, you can add the git repository as a dependency in your `pubspec.yaml` file:
>
> ```yaml
> dependencies:
> kiota_abstractions:
> git:
> url: https://github.com/ricardoboss/dart_kiota_abstractions.git
> ref: main
> ```
```bash
dart pub add kiota_abstractions
```
This is the Dart implementation of the Kiota library.

## Development

Expand All @@ -35,20 +15,20 @@ From the comment at: https://github.com/microsoft/kiota/issues/2199#issuecomment

#### Abstractions

- [x] Backing stores https://github.com/ricardoboss/dart_kiota_abstractions/pull/10
- [x] Authentication https://github.com/ricardoboss/dart_kiota_abstractions/pull/12
- [x] Backing store abstractions https://github.com/ricardoboss/dart_kiota_abstractions/pull/10
- [x] Authentication abstractions https://github.com/ricardoboss/dart_kiota_abstractions/pull/12

#### Implementations

- [ ] Text serialization/deserialization
- [ ] JSON serialization/deserialization
- [ ] Form data serialization/deserialization
These could be added in the future or by other packages.
- [ ] Muli-part serialization/deserialization
- [ ] Dart HTTP request adapter

### License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.

---

Expand Down
3 changes: 3 additions & 0 deletions packages/kiota_abstractions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Unreleased

* Provides interfaces and base classes for a basic Kiota client
24 changes: 24 additions & 0 deletions packages/kiota_abstractions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The Kiota abstractions library for Dart defines the basic constructs Kiota projects need once
a client has been generated from an OpenAPI definition.

A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to the
abstraction package to build and run.

## Usage

Install the package in the generated project:

> For now, you can add the git repository as a dependency in your `pubspec.yaml` file:
>
> ```yaml
> dependencies:
> kiota_abstractions:
> git:
> url: https://github.com/ricardoboss/dart_kiota.git
> ref: main
> path: packages/kiota_abstractions
> ```
```bash
dart pub add kiota_abstractions
```
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ import 'dart:collection';
import 'dart:math';
import 'dart:typed_data';

import 'package:kiota_abstractions/src/case_insensitive_map.dart';
import 'package:std_uritemplate/std_uritemplate.dart';
import 'package:uuid/uuid.dart';

part 'src/authentication/allowed_hosts_validator.dart';
part 'src/api_client_builder.dart';
part 'src/authentication/access_token_provider.dart';
part 'src/authentication/allowed_hosts_validator.dart';
part 'src/authentication/anonymous_authentication_provider.dart';
part 'src/authentication/api_key_authentication_provider.dart';
part 'src/authentication/api_key_location.dart';
part 'src/authentication/authentication_provider.dart';
part 'src/authentication/base_bearer_token_authentication_provider.dart';
part 'src/api_client_builder.dart';
part 'src/base_request_builder.dart';
part 'src/case_insensitive_map.dart';
part 'src/date_only.dart';
part 'src/error_mappings.dart';
part 'src/extensions/base_request_builder_extensions.dart';
Expand Down Expand Up @@ -55,7 +55,6 @@ part 'src/serialization/parse_node_proxy_factory.dart';
part 'src/serialization/serialization_writer.dart';
part 'src/serialization/serialization_writer_factory.dart';
part 'src/serialization/serialization_writer_factory_registry.dart';
part 'src/time_only.dart';
part 'src/serialization/serialization_writer_proxy_factory.dart';
part 'src/store/backed_model.dart';
part 'src/store/backing_store.dart';
Expand All @@ -66,3 +65,4 @@ part 'src/store/backing_store_serialization_writer_proxy_factory.dart';
part 'src/store/backing_store_subscription_callback.dart';
part 'src/store/in_memory_backing_store.dart';
part 'src/store/in_memory_backing_store_factory.dart';
part 'src/time_only.dart';
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
part of '../kiota_abstractions.dart';

/// Stores key-value pairs with case-insensitive keys.
///
/// Internally uses two maps to store the data. The first map stores the
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions pubspec.yaml → packages/kiota_abstractions/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: kiota_abstractions
description: "Kiota abstractions for Dart."
version: 0.0.1-dev.1
homepage: https://github.com/ricardoboss/dart_kiota_abstractions
description: "Kiota abstractions for Dart"
version: 0.0.1-pre.1
homepage: https://github.com/ricardoboss/dart_kiota_abstractions/tree/main/packages/kiota_abstractions
publish_to: 'none'

topics:
Expand All @@ -14,11 +14,11 @@ environment:
sdk: '>=3.2.6 <4.0.0'

dependencies:
std_uritemplate: ^0.0.52
std_uritemplate: ^0.0.55
uuid: ^4.3.3

dev_dependencies:
strict: ^2.0.0
test: ^1.25.0
test: ^1.25.2
mockito: ^5.4.4
build_runner: ^2.4.8
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions packages/kiota_http/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The `kiota_http` package implements a HTTP client for generated Kiota clients using the
[`http`](https://pub.dev/packages/http) package.

## Usage

Install the package in the generated project:

> For now, you can add the git repository as a dependency in your `pubspec.yaml` file:
>
> ```yaml
> dependencies:
> kiota_http_client:
> git:
> url: https://github.com/ricardoboss/dart_kiota.git
> ref: main
> path: packages/kiota_http
> ```
```bash
dart pub add kiota_http
```
17 changes: 17 additions & 0 deletions packages/kiota_http/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: kiota_http
description: "Kiota http client for Dart"
version: 0.0.1-pre.1
homepage: https://github.com/ricardoboss/dart_kiota_abstractions/tree/main/packages/kiota_http
publish_to: 'none'

environment:
sdk: '>=3.2.6 <4.0.0'

dependencies:
kiota_abstractions:
path: ../kiota_abstractions
http: ^1.2.1
http_parser: ^4.0.2

dev_dependencies:
test: ^1.25.2
7 changes: 7 additions & 0 deletions packages/kiota_http/test/dummy_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:test/test.dart';

void main() {
test('dummy test', () {
expect(1, 1);
});
}

0 comments on commit c2f551a

Please sign in to comment.