Skip to content

Commit

Permalink
refactor: updated linters, updated metadata (#202)
Browse files Browse the repository at this point in the history
* refactor: updated linters, updated metadata

* refactor: updated linters, updated metadata

* feat: added error log for dio adapter

* feat: updated dependencies

* feat: format
  • Loading branch information
jhomlala authored Jun 22, 2024
1 parent 24d75ff commit eca55b1
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 78 deletions.
10 changes: 5 additions & 5 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@

```yaml
dependencies:
alice: ^1.0.0-dev5
alice: ^1.0.0-dev6
```
2. Choose adapter based on your HTTP client. **pubspec.yaml** file:
### Dio
```yaml
dependencies:
alice_dio: ^1.0.2
alice_dio: ^1.0.3
```
### Chopper
```yaml
dependencies:
alice_chopper: ^1.0.2
alice_chopper: ^1.0.3
```
### Http
```yaml
dependencies:
alice_http: ^1.0.2
alice_http: ^1.0.3
```
### Http Client
```yaml
dependencies:
alice_http_client: ^1.0.2
alice_http_client: ^1.0.3
```
3. Run `get` command:
Expand Down
21 changes: 18 additions & 3 deletions packages/alice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
# 1.0.0-dev.6

* [BREAKING_CHANGE] Bumped minimal Flutter version to 3.10.0.
* Changed lint from very good analysis to flutter lints (by Klemen
Tusar https://github.com/techouse).
* General refactor of code base (by Klemen Tusar https://github.com/techouse).
* Added stacktrace to logs (by Klemen Tusar https://github.com/techouse).

# 1.0.0-dev.5

* Updated readme.
* Updated examples configuration (by Klemen Tusar https://github.com/techouse).

# 1.0.0-dev.4

* Updated metadata.

# 1.0.0-dev.3

* Updated links.
* Updated readme.

# 1.0.0-dev.2

* Updated links.
* Updated readme.

# 1.0.0-dev.1
* [BREAKING_CHANGE] Extracted http clients interceptors to separate packages. See migration guide here.
* [BREAKING_CHANGE] Removed methods: `getChopperInterceptor`, `onHttpResponse`, `onHttpClientResponse`, `getDioInterceptor` from `Alice` class.

* [BREAKING_CHANGE] Extracted http clients interceptors to separate packages. See migration guide
here.
* [BREAKING_CHANGE] Removed
methods: `getChopperInterceptor`, `onHttpResponse`, `onHttpClientResponse`, `getDioInterceptor`
from `Alice` class.
* Updated example.
* Updated dependencies.


# 0.4.2

* [BREAKING_CHANGE] Changed type of library from plugin to package. This means native (
Expand Down
3 changes: 1 addition & 2 deletions packages/alice/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: alice
description: Alice is an HTTP Inspector tool which helps debugging http requests. It catches and stores http requests and responses, which can be viewed via simple UI.
version: 1.0.0-dev.5
#author: Jakub Homlala <jhomlala@gmail.com>
version: 1.0.0-dev.6
homepage: https://github.com/jhomlala/alice
repository: https://github.com/jhomlala/alice

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

* Create error log on http exception (by Klemen Tusar https://github.com/techouse).
* Fixed HTTP error status (by Klemen Tusar https://github.com/techouse).
* Changed linter from very good analysis to flutter lints.
* General code base refactor.

# 1.0.3

* Replaced milliseconds with UUID for alice token header (by Klemen
Expand Down
20 changes: 7 additions & 13 deletions packages/alice_chopper/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
1include: package:very_good_analysis/analysis_options.yaml
analyzer:
exclude:
- "lib/generated_plugin_registrant.dart"
- "**.g.dart"

include: package:flutter_lints/flutter.yaml

linter:
rules:
public_member_api_docs: false
flutter_style_todos: false
avoid_final_parameters: false
sort_constructors_first: false
avoid_function_literals_in_foreach_calls: false
avoid_positional_boolean_parameters: false
use_if_null_to_convert_nulls_to_bools: false
use_build_context_synchronously: false
prefer_constructors_over_static_methods: false
use_setters_to_change_properties: false
avoid_print: false
sort_pub_dependencies: false
#library_annotations: false
2 changes: 1 addition & 1 deletion packages/alice_chopper/lib/alice_chopper_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AliceChopperAdapter with AliceAdapter implements Interceptor {
applyHeader(
chain.request,
'alice_token',
Uuid().v4(),
const Uuid().v4(),
),
);

Expand Down
8 changes: 5 additions & 3 deletions packages/alice_chopper/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: alice_chopper
description: "Alice + Chopper integration. It contains plugin for Alice which allows to use Chopper package."
version: 1.0.3
version: 1.0.4
repository: https://github.com/jhomlala/alice
homepage: https://github.com/jhomlala/alice

Expand All @@ -9,10 +9,12 @@ environment:
flutter: ">=3.3.0"

dependencies:
alice: ^1.0.0-dev.4
alice: ^1.0.0-dev.6
chopper: ^8.0.0
http: ^1.2.1
uuid: ^4.4.0
flutter:
sdk: flutter

dev_dependencies:
very_good_analysis: ^5.1.0
flutter_lints: ^4.0.0
6 changes: 6 additions & 0 deletions packages/alice_dio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.0.3

* Changed linter from very good analysis to flutter lints.
* General code base refactor.
* Create error log on http exception.

# 1.0.2

* Fixed Alice dependency path (by Klemen Tusar https://github.com/techouse).
Expand Down
20 changes: 7 additions & 13 deletions packages/alice_dio/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
1include: package:very_good_analysis/analysis_options.yaml
analyzer:
exclude:
- "lib/generated_plugin_registrant.dart"
- "**.g.dart"

include: package:flutter_lints/flutter.yaml

linter:
rules:
public_member_api_docs: false
flutter_style_todos: false
avoid_final_parameters: false
sort_constructors_first: false
avoid_function_literals_in_foreach_calls: false
avoid_positional_boolean_parameters: false
use_if_null_to_convert_nulls_to_bools: false
use_build_context_synchronously: false
prefer_constructors_over_static_methods: false
use_setters_to_change_properties: false
avoid_print: false
sort_pub_dependencies: false
#library_annotations: false
15 changes: 11 additions & 4 deletions packages/alice_dio/lib/alice_dio_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import 'package:alice/model/alice_http_call.dart';
import 'package:alice/model/alice_http_error.dart';
import 'package:alice/model/alice_http_request.dart';
import 'package:alice/model/alice_http_response.dart';
import 'package:alice/model/alice_log.dart';
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';

class AliceDioAdapter extends InterceptorsWrapper with AliceAdapter {
/// Handles dio request and creates alice http call based on it
Expand Down Expand Up @@ -45,22 +47,22 @@ class AliceDioAdapter extends InterceptorsWrapper with AliceAdapter {

if (data.fields.isNotEmpty == true) {
final fields = <AliceFormDataField>[];
data.fields.forEach((entry) {
for (var entry in data.fields) {
fields.add(AliceFormDataField(entry.key, entry.value));
});
}
request.formDataFields = fields;
}
if (data.files.isNotEmpty == true) {
final files = <AliceFormDataFile>[];
data.files.forEach((entry) {
for (var entry in data.files) {
files.add(
AliceFormDataFile(
entry.value.filename,
entry.value.contentType.toString(),
entry.value.length,
),
);
});
}

request.formDataFiles = files;
}
Expand Down Expand Up @@ -149,6 +151,11 @@ class AliceDioAdapter extends InterceptorsWrapper with AliceAdapter {
httpResponse,
error.response!.requestOptions.hashCode,
);
aliceCore.addLog(AliceLog(
message: error.toString(),
level: DiagnosticLevel.error,
error: error,
stackTrace: error.stackTrace));
}
handler.next(error);
}
Expand Down
6 changes: 4 additions & 2 deletions packages/alice_dio/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ environment:
flutter: ">=3.3.0"

dependencies:
alice: ^1.0.0-dev.4
alice: ^1.0.0-dev.6
dio: ^5.4.3+1
flutter:
sdk: flutter

dev_dependencies:
very_good_analysis: ^5.1.0
flutter_lints: ^4.0.0
4 changes: 4 additions & 0 deletions packages/alice_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.3

* Changed linter from very good analysis to flutter lints.

# 1.0.2

* Fixed Alice dependency path (by Klemen Tusar https://github.com/techouse).
Expand Down
20 changes: 7 additions & 13 deletions packages/alice_http/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
1include: package:very_good_analysis/analysis_options.yaml
analyzer:
exclude:
- "lib/generated_plugin_registrant.dart"
- "**.g.dart"

include: package:flutter_lints/flutter.yaml

linter:
rules:
public_member_api_docs: false
flutter_style_todos: false
avoid_final_parameters: false
sort_constructors_first: false
avoid_function_literals_in_foreach_calls: false
avoid_positional_boolean_parameters: false
use_if_null_to_convert_nulls_to_bools: false
use_build_context_synchronously: false
prefer_constructors_over_static_methods: false
use_setters_to_change_properties: false
avoid_print: false
sort_pub_dependencies: false
#library_annotations: false
6 changes: 3 additions & 3 deletions packages/alice_http/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: alice_http
description: "Alice + HTTP integration. It contains plugin for Alice which allows to use http package."
version: 1.0.2
version: 1.0.3
repository: https://github.com/jhomlala/alice
homepage: https://github.com/jhomlala/alice

Expand All @@ -9,8 +9,8 @@ environment:
flutter: ">=3.3.0"

dependencies:
alice: ^1.0.0-dev.4
alice: ^1.0.0-dev.6
http: ^1.2.1

dev_dependencies:
very_good_analysis: ^5.1.0
flutter_lints: ^4.0.0
4 changes: 4 additions & 0 deletions packages/alice_http_client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.3

* Changed linter from very good analysis to flutter lints.

# 1.0.2

* Fixed Alice dependency path (by Klemen Tusar https://github.com/techouse).
Expand Down
20 changes: 7 additions & 13 deletions packages/alice_http_client/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
1include: package:very_good_analysis/analysis_options.yaml
analyzer:
exclude:
- "lib/generated_plugin_registrant.dart"
- "**.g.dart"

include: package:flutter_lints/flutter.yaml

linter:
rules:
public_member_api_docs: false
flutter_style_todos: false
avoid_final_parameters: false
sort_constructors_first: false
avoid_function_literals_in_foreach_calls: false
avoid_positional_boolean_parameters: false
use_if_null_to_convert_nulls_to_bools: false
use_build_context_synchronously: false
prefer_constructors_over_static_methods: false
use_setters_to_change_properties: false
avoid_print: false
sort_pub_dependencies: false
#library_annotations: false
6 changes: 3 additions & 3 deletions packages/alice_http_client/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: alice_http_client
description: "Alice + HTTP Client integration. It contains plugin for Alice which allows to use Http Client."
version: 1.0.2
version: 1.0.3
repository: https://github.com/jhomlala/alice
homepage: https://github.com/jhomlala/alice

Expand All @@ -9,7 +9,7 @@ environment:
flutter: ">=3.3.0"

dependencies:
alice: ^1.0.0-dev.4
alice: ^1.0.0-dev.6

dev_dependencies:
very_good_analysis: ^5.1.0
flutter_lints: ^4.0.0

0 comments on commit eca55b1

Please sign in to comment.