Skip to content

Commit c232dea

Browse files
committed
change: Rename provider to container
1 parent 892a5af commit c232dea

38 files changed

Lines changed: 124 additions & 126 deletions

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
# Catalyst Builder
55

6-
A dependency injection provider builder for dart.
6+
A dependency injection container builder for dart.
77

88
This is the workspace root, select a specific package for more details.
99

10-
| Package | Description | Badges |
11-
|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
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_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) |
10+
| Package | Description | Badges |
11+
|-----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
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_contracts`](./packages/catalyst_builder_contracts) | The contracts package. Use this in packages that don't need to generate a service container 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) |
1414

1515
## Roadmap
1616

@@ -19,6 +19,6 @@ This is the workspace root, select a specific package for more details.
1919
| Description | Status |
2020
|---------------------------------------------------------------------------|--------|
2121
| Remove the annotations inside the catalyst_builder_package | ☑️ |
22-
| Remove the service provider subclasses | ☑️ |
22+
| Remove the service container subclasses | ☑️ |
2323
| Stop generating the ServiceProvider and create a default ServiceContainer | ☑️ |
2424
| Add scope support | 🔲 |

packages/catalyst_builder/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Catalyst Builder
1010

11-
A dependency injection provider builder for dart.
11+
A dependency injection container builder for dart.
1212

1313
Click on the image for a video on YouTube:
1414

@@ -24,9 +24,9 @@ Since [Catalyst](https://github.com/mintware-de/catalyst) is only for Dart
2424
and [Flutter Catalyst](https://github.com/mintware-de/flutter_catalyst)
2525
supports Flutter, but a mess to configure I decided to do something cooler.
2626

27-
Catalyst Builder is a dependency injection provider builder for both, Dart and Flutter. It's easy to use and dependency
27+
Catalyst Builder is a dependency injection container builder for both, Dart and Flutter. It's easy to use and dependency
2828
injection is almost done automatically. You only have to decorate your services with `@Service` and the build_runner
29-
will create a service provider for you.
29+
will create a service container for you.
3030

3131
## Installation
3232

packages/catalyst_builder/build.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ builders:
88
build_to: cache
99
auto_apply: root_package
1010
runs_before:
11-
- 'catalyst_builder:buildServiceProvider'
12-
- 'catalyst_builder:buildServiceProviderPlugin'
11+
- 'catalyst_builder:buildServiceContainerPlugin'
1312
applies_builders:
14-
- 'catalyst_builder:buildServiceProvider'
15-
- 'catalyst_builder:buildServiceProviderPlugin'
13+
- 'catalyst_builder:buildServiceContainerPlugin'
1614

17-
buildServiceProviderPlugin:
15+
buildServiceContainerPlugin:
1816
import: 'package:catalyst_builder/src/builder/builders.dart'
1917
builder_factories:
20-
- 'createServiceProviderPluginBuilder'
18+
- 'createServiceContainerPluginBuilder'
2119
build_extensions: { '.dart': [ '.catalyst_builder.plugin.g.dart' ] }
2220
build_to: source
2321
auto_apply: dependents
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import 'package:catalyst_builder_container/catalyst_builder_container.dart';
1+
import 'package:catalyst_builder/catalyst_builder.dart';
22
import 'package:catalyst_builder_example/example.dart';
33

44
void main(List<String> arguments) {
5-
var provider = ServiceContainer();
6-
provider.useExampleProviderPlugin();
5+
var container = ServiceContainer();
6+
container.useExampleContainerPlugin();
77

8-
provider.parameters['sender_username'] = 'Julian';
8+
container.parameters['sender_username'] = 'Julian';
99

1010
print('Post parameter set, pre boot');
11-
provider.boot();
11+
container.boot();
1212
print('Post boot, pre resolve');
1313

14-
var chat = provider.resolve<ChatProvider>();
14+
var chat = container.resolve<ChatProvider>();
1515
print(chat.runtimeType);
1616
chat.sendChatMessage('WTF, this is really cool!');
1717

18-
provider.register(
19-
(provider) => MySelfRegisteredService(provider.resolve()),
18+
container.register(
19+
(container) => MySelfRegisteredService(container.resolve()),
2020
);
2121

22-
var selfRegistered = provider.resolve<MySelfRegisteredService>();
22+
var selfRegistered = container.resolve<MySelfRegisteredService>();
2323
selfRegistered.sayHello();
2424

2525
// Contains CoolChatProvider and ConsoleTransport
26-
var servicesByTag = provider.resolveByTag(#chat);
26+
var servicesByTag = container.resolveByTag(#chat);
2727
for (var svc in servicesByTag) {
2828
print(svc);
2929
}
3030

31-
var broadcaster = provider.resolve<Broadcaster>();
31+
var broadcaster = container.resolve<Broadcaster>();
3232
broadcaster.sendChatMessage('Hello Broadcast using injection tag.');
3333
}

packages/catalyst_builder/example/lib/example.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export './src/manually_wired_service.dart';
77
export 'example.catalyst_builder.plugin.g.dart';
88

99
@Preload()
10-
@GenerateServiceProviderPlugin(
11-
pluginClassName: 'ExampleProviderPlugin',
10+
@GenerateServiceContainerPlugin(
11+
pluginClassName: 'ExampleContainerPlugin',
1212
)
1313
@ServiceMap(services: {
1414
ManuallyWiredServiceImplementation: Service(

packages/catalyst_builder/example/pubspec.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,15 @@ dependencies:
1212
path: ../../catalyst_builder_contracts
1313
third_party_dependency:
1414
path: ../test/third_party_dependency
15-
catalyst_builder_container:
16-
path: ../../catalyst_builder_container
15+
catalyst_builder:
16+
path: ../
1717

1818
dev_dependencies:
1919
lints: ^5.1.1
2020
build_runner: ^2.0.1
21-
catalyst_builder:
22-
path: ../
2321

2422
dependency_overrides:
2523
catalyst_builder:
2624
path: ../
2725
catalyst_builder_contracts:
2826
path: ../../catalyst_builder_contracts
29-
catalyst_builder_container:
30-
path: ../../catalyst_builder_container
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export 'src/service_container.dart';
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import 'package:build/build.dart';
22

33
import 'preflight_builder.dart';
4-
import 'service_provider_plugin_builder.dart';
4+
import 'service_container_plugin_builder.dart';
55

66
/// Creates the builder for the preflight step
77
Builder createPreflightBuilder(BuilderOptions options) => PreflightBuilder();
88

9-
/// Creates the service provider plugin builder
10-
Builder createServiceProviderPluginBuilder(BuilderOptions options) =>
11-
ServiceProviderPluginBuilder();
9+
/// Creates the service container plugin builder
10+
Builder createServiceContainerPluginBuilder(BuilderOptions options) =>
11+
ServiceContainerPluginBuilder();

packages/catalyst_builder/lib/src/builder/generator/service_provider/methods/methods.dart renamed to packages/catalyst_builder/lib/src/builder/generator/service_container/methods/methods.dart

File renamed without changes.

packages/catalyst_builder/lib/src/builder/generator/service_provider/methods/provide_exposes.dart renamed to packages/catalyst_builder/lib/src/builder/generator/service_container/methods/provide_exposes.dart

File renamed without changes.

0 commit comments

Comments
 (0)