Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(all-needed): including basis, directories, pubspecs, examples, github actions, etc #106

Merged
merged 23 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8475fbb
refactor(all-needed): including basis, directories, pubpsecs, example…
gbtb16 Jan 17, 2024
78c34a2
refactor(all-needed): including basis, directories, pubpsecs, example…
gbtb16 Jan 17, 2024
8ebadfc
fix(bashes): changed directories in actions bashes.
gbtb16 Jan 17, 2024
82012d9
fix(dart-format): ran dart format in all files.
gbtb16 Jan 17, 2024
a6fdf4b
fix(kiwi-cli-tools): changed directory of old "tools".
gbtb16 Jan 17, 2024
bb7bd18
fix(kiwi-cli-actions): dart format code.
gbtb16 Jan 17, 2024
208890f
fix(changelog-workflow): changed worflow to run more independently.
gbtb16 Jan 17, 2024
a1d3170
fix(kiwi-generator): fix tests.
gbtb16 Jan 17, 2024
69c826f
fix(readme): updated readme file to reflect the recent changes.
gbtb16 Jan 17, 2024
d732bec
fix(kiwi-generator): fixed all tests to dart 3.0.
gbtb16 Jan 17, 2024
4fde4cc
fix(kiwi-generator): fixed services attributes.
gbtb16 Jan 17, 2024
d1bdd7f
fix(kiwi-generator): fixed tests.
gbtb16 Jan 17, 2024
33bee11
fix(files): fixed readme of kiwi and kiwi_generator; generate kiwi_ge…
gbtb16 Jan 17, 2024
7389afa
fix(kiwi-generator): fixed all tests.
gbtb16 Jan 17, 2024
284a1ee
fix(kiwi-generator): fixed all files with errors.
gbtb16 Jan 17, 2024
fa3a0cd
fix(dart-format) ran dart format in test files of kiwi_generator pack…
gbtb16 Jan 17, 2024
b6612d4
fix(tests): testing
gbtb16 Jan 17, 2024
5146576
fix(tests): testing.
gbtb16 Jan 17, 2024
8760792
fix(test): changed error message.
gbtb16 Jan 17, 2024
9989e4f
fix(tests): fixed all tests with issues.
gbtb16 Jan 31, 2024
3e7a12f
fix(workflow): fixed dart format workflow.
gbtb16 Jan 31, 2024
9e1c169
fix(workflow): fixed workflows issue with dart format.
gbtb16 Jan 31, 2024
f028e27
feature(getters): implemented providers getters about named, unnamed …
gbtb16 Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pub"
directory: "/kiwi"
- package-ecosystem: "pub.dev"
directory: "/packages/kiwi"
schedule:
interval: "daily"
labels:
- "pub"
- "pub.dev"
- "kiwi"
- "dependencies"
- package-ecosystem: "pub"
directory: "/kiwi_generator"

- package-ecosystem: "pub.dev"
directory: "/packages/kiwi_generator"
schedule:
interval: "daily"
labels:
- "pub"
- "kiwi_generator"
- "pub.dev"
- "kiwi generator"
- "dependencies"

- package-ecosystem: "github-actions"
- package-ecosystem: "github actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "github-actions"
- "github actions"
- "dependencies"
20 changes: 10 additions & 10 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: build_all

on:
push:
branches: [ "master" ]
branches: [ 'master', 'stable' ]
pull_request:
branches: [ "master" ]
branches: [ 'master', 'stable' ]

jobs:
flutter:
Expand All @@ -17,12 +17,12 @@ jobs:
- uses: subosito/[email protected]
with:
channel: ${{ matrix.version }}
- name: Build & format for flutter_example
- name: Build & format for flutter_kiwi example
run: |
cd flutter_example
cd examples/flutter_kiwi
flutter packages get
flutter packages pub run build_runner build --delete-conflicting-outputs
dart format .
dart format --line-length 160 .
- name: Use verify-changed-files to check if any of the above files changed.
uses: tj-actions/verify-changed-files@v17
- name: Run step only when any of the above files change.
Expand All @@ -41,16 +41,16 @@ jobs:
sdk: ${{ matrix.sdk }}
- name: Build & format for kiwi_generator
run: |
cd kiwi_generator
cd packages/kiwi_generator
dart pub get
dart run build_runner build --delete-conflicting-outputs
dart format .
- name: Build & format for example
dart format --line-length 160 .
- name: Build & format for dart_kiwi example
run: |
cd example
cd examples/dart_kiwi
dart pub get
dart run build_runner build --delete-conflicting-outputs
dart format .
dart format --line-length 160 .
- name: Use verify-changed-files to check if any of the above files changed.
uses: tj-actions/verify-changed-files@v17
- name: Run step only when any of the above files change.
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: changelog

on:
push:
branches: [ "master" ]
branches: [ 'master', 'stable' ]
pull_request:
branches: [ "master" ]
branches: [ 'master', 'stable' ]

jobs:
check:
Expand All @@ -16,7 +16,6 @@ jobs:
sdk: 'stable'
- name: Check changelog
run: |
cd tool/actions
cd tools/kiwi_cli_actions
dart pub get
cd ../..
dart run tool/actions/changelog_checker.dart
dart run
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: example
name: dart_kiwi_example

on:
push:
branches: [ "master" ]
branches: [ 'master', 'stable' ]
pull_request:
branches: [ "master" ]
branches: [ 'master', 'stable' ]

jobs:
check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: example
working-directory: examples/dart_kiwi
steps:
- uses: actions/checkout@v4
- uses: subosito/[email protected]
with:
channel: 'stable'
- run: flutter packages get
- run: flutter analyze
- run: dart format -o none --set-exit-if-changed .
- run: dart format --line-length 160 -o none --set-exit-if-changed .
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: flutter_example
name: flutter_kiwi_example

on:
push:
branches: [ "master" ]
branches: [ 'master', 'stable' ]
pull_request:
branches: [ "master" ]
branches: [ 'master', 'stable' ]

jobs:
check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: flutter_example
working-directory: examples/flutter_kiwi
steps:
- uses: actions/checkout@v4
- uses: subosito/[email protected]
with:
channel: 'stable'
- run: flutter packages get
- run: flutter analyze
- run: dart format -o none --set-exit-if-changed .
- run: dart format --line-length 160 -o none --set-exit-if-changed .
8 changes: 4 additions & 4 deletions .github/workflows/kiwi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: kiwi

on:
push:
branches: [ "master" ]
branches: [ 'master', 'stable' ]
pull_request:
branches: [ "master" ]
branches: [ 'master', 'stable' ]

jobs:
check:
Expand All @@ -14,13 +14,13 @@ jobs:
sdk: [ stable, beta, dev ]
defaults:
run:
working-directory: kiwi
working-directory: packages/kiwi
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
- run: dart analyze --fatal-infos --fatal-warnings .
- run: dart format -o none --set-exit-if-changed .
- run: dart format --line-length 160 -o none --set-exit-if-changed .
- run: dart pub run test
8 changes: 4 additions & 4 deletions .github/workflows/kiwi_generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: kiwi_generator

on:
push:
branches: [ "master" ]
branches: [ 'master', 'stable' ]
pull_request:
branches: [ "master" ]
branches: [ 'master', 'stable' ]

jobs:
check:
Expand All @@ -14,13 +14,13 @@ jobs:
sdk: [ stable, beta, dev ]
defaults:
run:
working-directory: kiwi_generator
working-directory: packages/kiwi_generator
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
- run: dart analyze --fatal-infos --fatal-warnings .
- run: dart format -o none --set-exit-if-changed .
- run: dart format --line-length 160 -o none --set-exit-if-changed .
- run: dart pub run test
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![kiwi](https://github.com/gbtb16/kiwi/actions/workflows/kiwi.yml/badge.svg?branch=master)](https://github.com/gbtb16/kiwi/actions/workflows/kiwi.yml)
[![kiwi_generator](https://github.com/gbtb16/kiwi/actions/workflows/kiwi_generator.yml/badge.svg?branch=master)](https://github.com/gbtb16/kiwi/actions/workflows/kiwi_generator.yml)
[![flutter_example](https://github.com/gbtb16/kiwi/actions/workflows/flutter_example.yml/badge.svg?branch=master)](https://github.com/gbtb16/kiwi/actions/workflows/flutter_example.yml)
[![example](https://github.com/gbtb16/kiwi/actions/workflows/example.yml/badge.svg?branch=master)](https://github.com/gbtb16/kiwi/actions/workflows/example.yml)
[![dart_kiwi_example](https://github.com/gbtb16/kiwi/actions/workflows/dart_kiwi_example.yml/badge.svg?branch=master)](https://github.com/gbtb16/kiwi/actions/workflows/dart_kiwi_example.yml)
[![flutter_kiwi_example](https://github.com/gbtb16/kiwi/actions/workflows/flutter_kiwi_example.yml/badge.svg?branch=master)](https://github.com/gbtb16/kiwi/actions/workflows/flutter_kiwi_example.yml)

![Logo](https://raw.githubusercontent.com/gbtb16/kiwi/master/images/logo.png)

Expand All @@ -13,39 +13,35 @@ The container does not rely on reflection, it's just a `Map`, so it's fast.

While using the generator, only constructor injection is supported.

**IMPORTANT: Dart2 is required to use this package.**

**IMPORTANT: From 1.0.0 Container is removed. Use KiwiContainer instead. (better Flutter support)**

## KiwiContainer and annotations
## Kiwi

[![Pub](https://img.shields.io/pub/v/kiwi.svg)](https://pub.dartlang.org/packages/kiwi)

[Source Code](https://github.com/gbtb16/kiwi/tree/master/kiwi)
[Source Code](https://github.com/gbtb16/kiwi/tree/master/packages/kiwi)

The core package providing the IoC container and the annotations which has no dependencies.

Import it into your pubspec `dependencies:` section.

## Generator
## Kiwi Generator

[![Pub](https://img.shields.io/pub/v/kiwi_generator.svg)](https://pub.dartlang.org/packages/kiwi_generator)

[Source Code](https://github.com/gbtb16/kiwi/tree/master/kiwi_generator)
[Source Code](https://github.com/gbtb16/kiwi/tree/master/packages/kiwi_generator)

The package providing the generator.

Import it into your pubspec `dev_dependencies:` section.

## Example
## Dart Kiwi Example

[Source Code](https://github.com/gbtb16/kiwi/tree/master/example)
[Source Code](https://github.com/gbtb16/kiwi/tree/master/examples/dart_kiwi)

An example showing how to setup `kiwi` and `kiwi_generator`.
An example showing how to setup `kiwi` and `kiwi_generator` inside a Dart CLI project.

## Flutter Example
## Flutter Kiwi Example

[Source Code](https://github.com/gbtb16/kiwi/tree/master/flutter_example)
[Source Code](https://github.com/gbtb16/kiwi/tree/master/examples/flutter_kiwi)

An example showing how to setup `kiwi` and `kiwi_generator` inside a Flutter project.

Expand Down
3 changes: 0 additions & 3 deletions example/lib/src/models/pump.dart

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:example/src/models/coffee_maker.dart';
import 'package:example/src/modules/drip_coffee_module.dart';
import 'package:dart_kiwi/src/models/coffee_maker.dart';
import 'package:dart_kiwi/src/modules/drip_coffee_module.dart';
import 'package:kiwi/kiwi.dart';

void main() {
void main(List<String> arguments) async {
CoffeeInjector coffeeInjector = getCoffeeInjector();
coffeeInjector.configure();

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:example/src/models/heater.dart';
import 'package:example/src/models/model.dart';
import 'package:example/src/models/pump.dart';
import 'package:dart_kiwi/src/models/heater.dart';
import 'package:dart_kiwi/src/models/model.dart';
import 'package:dart_kiwi/src/models/pump.dart';

class CoffeeMaker {
final Heater _heater;
final Pump _pump;
final Model _model;

CoffeeMaker(
const CoffeeMaker(
this._heater,
this._pump,
this._model,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:example/src/models/heater.dart';
import 'package:dart_kiwi/src/models/heater.dart';

class PowerOutlet {}
class PowerOutlet {
const PowerOutlet();
}

class Electricity {
Electricity(PowerOutlet outlet);
const Electricity(PowerOutlet outlet);
}

class ElectricHeater implements Heater {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
abstract class Heater {
abstract interface class Heater {
void on();
void off();
bool get isHot;
Expand Down
3 changes: 3 additions & 0 deletions examples/dart_kiwi/lib/src/models/pump.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
abstract interface class Pump {
void pump();
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:example/src/models/heater.dart';
import 'package:example/src/models/pump.dart';
import 'package:dart_kiwi/src/models/heater.dart';
import 'package:dart_kiwi/src/models/pump.dart';

class Thermosiphon implements Pump {
final Heater _heater;

Thermosiphon(this._heater);
const Thermosiphon(this._heater);

@override
void pump() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:example/src/models/coffee_maker.dart';
import 'package:example/src/models/electric_heater.dart';
import 'package:example/src/models/heater.dart';
import 'package:example/src/models/model.dart';
import 'package:example/src/models/pump.dart';
import 'package:example/src/models/thermosiphon.dart';
import 'package:dart_kiwi/src/models/coffee_maker.dart';
import 'package:dart_kiwi/src/models/electric_heater.dart';
import 'package:dart_kiwi/src/models/heater.dart';
import 'package:dart_kiwi/src/models/model.dart';
import 'package:dart_kiwi/src/models/pump.dart';
import 'package:dart_kiwi/src/models/thermosiphon.dart';
import 'package:kiwi/kiwi.dart';

part 'drip_coffee_module.g.dart';
Expand Down
Loading