Skip to content

Commit aaa314d

Browse files
committed
feat: Add the catalyst_builder_container package
1 parent e1f3c76 commit aaa314d

14 files changed

Lines changed: 158 additions & 11 deletions

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ This is the workspace root, select a specific package for more details.
99

1010
| Package | Description | Badges |
1111
|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
12-
| [`catalyst_builder`](./packages/catalyst_builder) | The builder package. Use this in your root package. | [![Pub](https://img.shields.io/pub/v/catalyst_builder.svg)](https://pub.dartlang.org/packages/catalyst_builder)<br> ![Pub Points](https://img.shields.io/pub/points/catalyst_builder)<br> ![Pub Likes](https://img.shields.io/pub/likes/catalyst_builder)<br> ![Pub Monthly Downloads](https://img.shields.io/pub/dm/catalyst_builder) |
12+
| [`catalyst_builder`](./packages/catalyst_builder) | The builder package. Use this in your root package or plugin package to generate the ServiceContainerPlugin. | [![Pub](https://img.shields.io/pub/v/catalyst_builder.svg)](https://pub.dartlang.org/packages/catalyst_builder)<br> ![Pub Points](https://img.shields.io/pub/points/catalyst_builder)<br> ![Pub Likes](https://img.shields.io/pub/likes/catalyst_builder)<br> ![Pub Monthly Downloads](https://img.shields.io/pub/dm/catalyst_builder) |
13+
| [`catalyst_builder_container`](./packages/catalyst_builder_container) | The container package. Use this package to resolve services from the container. | [![Pub](https://img.shields.io/pub/v/catalyst_builder_container.svg)](https://pub.dartlang.org/packages/catalyst_builder_container) <br> ![Pub Points](https://img.shields.io/pub/points/catalyst_builder_container) <br> ![Pub Likes](https://img.shields.io/pub/likes/catalyst_builder_container) <br> ![Pub Monthly Downloads](https://img.shields.io/pub/dm/catalyst_builder_container) |
1314
| [`catalyst_builder_contracts`](./packages/catalyst_builder_contracts) | The contracts package. Use this in packages that don't need to generate a service provider but provide services that can be resolved. | [![Pub](https://img.shields.io/pub/v/catalyst_builder_contracts.svg)](https://pub.dartlang.org/packages/catalyst_builder_contracts) <br> ![Pub Points](https://img.shields.io/pub/points/catalyst_builder_contracts) <br> ![Pub Likes](https://img.shields.io/pub/likes/catalyst_builder_contracts) <br> ![Pub Monthly Downloads](https://img.shields.io/pub/dm/catalyst_builder_contracts) |
1415

1516
## Roadmap
@@ -25,7 +26,9 @@ This is the workspace root, select a specific package for more details.
2526

2627
# v5 (Next)
2728

28-
| Description | Status |
29-
|------------------------------------------------------------|--------|
30-
| Remove the annotations inside the catalyst_builder_package | ☑️ |
31-
| Remove the service provider subclasses | ☑️ |
29+
| Description | Status |
30+
|---------------------------------------------------------------------------|--------|
31+
| Remove the annotations inside the catalyst_builder_package | ☑️ |
32+
| Remove the service provider subclasses | ☑️ |
33+
| Stop generating the ServiceProvider and create a default ServiceContainer | 🔲 |
34+
| Add scope support | 🔲 |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Files and directories created by pub.
2+
.dart_tool/
3+
.packages
4+
.idea/
5+
6+
# Conventional directory for build outputs.
7+
build/
8+
9+
# Omit committing pubspec.lock for library packages; see
10+
# https://dart.dev/guides/libraries/private-files#pubspeclock.
11+
pubspec.lock
12+
**/**.preflight.json
13+
**/**.DS_Store
14+
15+
**/*.g.dart
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.0.0.dev-1
2+
3+
First pre-release
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Julian Finkler <julian@mintware.de>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[![GitHub license](https://img.shields.io/github/license/mintware-de/catalyst_builder.svg)](https://github.com/mintware-de/catalyst_builder/blob/main/packages/catalyst_builder_container/LICENSE)
2+
[![Pub](https://img.shields.io/pub/v/catalyst_builder_container.svg)](https://pub.dartlang.org/packages/catalyst_builder_container)
3+
![Pub Points](https://img.shields.io/pub/points/catalyst_builder_container)
4+
![Pub Publisher](https://img.shields.io/pub/publisher/catalyst_builder_container)
5+
![Pub Likes](https://img.shields.io/pub/likes/catalyst_builder_container)
6+
7+
# Catalyst Builder Container
8+
9+
This is the container package for [catalyst_builder](https://pub.dev/packages/catalyst_builder)
10+
11+
For more details head over to the [wiki](https://github.com/mintware-de/catalyst_builder/wiki)
12+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include: package:lints/recommended.yaml
2+
3+
analyzer:
4+
language:
5+
strict-casts: true
6+
strict-inference: true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# https://dart.dev/guides/libraries/private-files
2+
# Created by `dart pub`
3+
.dart_tool/
4+
.cache/
5+
**/*.g.dart
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import 'package:catalyst_builder_container/catalyst_builder_container.dart';
2+
import 'package:catalyst_builder_contracts/catalyst_builder_contracts.dart';
3+
import 'package:catalyst_builder_contracts_example/my_service.dart';
4+
5+
import 'example.catalyst_builder.plugin.g.dart';
6+
7+
@GenerateServiceProviderPlugin(
8+
// Enter a name that is used for the service provider class
9+
pluginClassName: 'ExampleProviderPlugin',
10+
)
11+
void main() {
12+
final provider = ServiceContainer();
13+
provider.useExampleProviderPlugin();
14+
provider.boot();
15+
16+
final service = provider.resolve<MyService>();
17+
service.sayHello();
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import 'package:catalyst_builder_contracts/catalyst_builder_contracts.dart';
2+
3+
@Service()
4+
class MyService {
5+
void sayHello() {
6+
print('Hello World');
7+
}
8+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: catalyst_builder_contracts_example
2+
description: The example application for catalyst_builder_contracts
3+
version: 1.0.0
4+
5+
publish_to: none
6+
7+
environment:
8+
sdk: ^3.6.1
9+
10+
# Add regular dependencies here.
11+
dependencies:
12+
catalyst_builder_contracts:
13+
catalyst_builder_container:
14+
15+
dev_dependencies:
16+
build_runner:
17+
catalyst_builder:
18+
19+
dependency_overrides:
20+
catalyst_builder_contracts:
21+
path: ../../catalyst_builder_contracts
22+
catalyst_builder:
23+
path: ../../catalyst_builder
24+
catalyst_builder_container:
25+
path: ../

0 commit comments

Comments
 (0)