Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-rc.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Feb 23, 2024
2 parents 1937928 + 4b5a0c4 commit 3048c5b
Show file tree
Hide file tree
Showing 79 changed files with 692 additions and 303 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 4

[*.{md,yml}]
[*.{md,yml,yaml}]
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/tests export-ignore
/.github export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,41 @@ All notable changes to this project will be documented in this file. This projec

## Unreleased

## [1.0.0-rc.1] - 2024-02-23

### Added

- New event bus notifier implementation that was previously missing. This completes the event bus implementation.
- New message interfaces (command, query, integration event) added to the toolkit.
- New loggable context provider interface added to the toolkit.
- Module basename now supports namespaces where an application only has a single bounded context.

### Changed

- **BREAKING** Moved the following interfaces to the `Toolkit\Messages` namespace:
- `MessageInterface`
- `IntegrationEventInterface`
- **BREAKING** Interfaces that type-hinted `Bus\CommandInterface`, `Bus\QueryInterface` or `Bus\MessageInterface` now
type-hint the new interfaces in the `Toolkit\Messages` namespace.
- **BREAKING** Moved the `EventBus` implementation from `Infrastructure\EventBus` to `EventBus`. In Deptrac, this
namespace is now part of the _Application Bus_ layer. Renamed the publisher handler and publisher handler containers
to integration event handler and container - so that they can be used for both the publisher and notifier
implementations.
- **BREAKING** Removed the `EventBus\PublishThroughMiddleware` interface. Use the
`Toolkit\Messages\DispatchThroughMiddleware` interface instead.

### Removed

- **BREAKING** removed the `deptrac-layers.yaml` file, in favour of applications including the classes in their own
Deptrac configuration.

### Deprecated

- The `Bus\CommandInterface`, `Bus\QueryInterface` and `Bus\DispatchThroughMiddleware` interfaces have been deprecated
in favour of the new interfaces in the `Toolkit\Messages` namespace.
- The `Infrastructure\Log\ContextProviderInterface` is deprecated in favour of the new
`Toolkit\Loggable\ContextProviderInterface` interface.

## [0.6.1] - 2024-02-09

### Fixed
Expand Down
18 changes: 0 additions & 18 deletions deptrac-layers.yaml

This file was deleted.

39 changes: 24 additions & 15 deletions deptrac.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
imports:
- deptrac-layers.yaml
deptrac:
paths:
- ./src
layers:
- name: PSR Log
- name: Toolkit
collectors:
- type: className
value: Psr\\Log.*
- name: Ramsey UUID
value: CloudCreativity\\Modules\\Toolkit\\*
- type: className
value: Ramsey\\Uuid\\*
- name: Domain
collectors:
- type: className
value: CloudCreativity\\Modules\\Domain\\*
- name: Infrastructure
collectors:
- type: className
value: Ramsey\\Uuid.*
value: CloudCreativity\\Modules\\Infrastructure\\*
- type: className
value: Psr\\Log\\*
- name: Application
collectors:
- type: className
value: CloudCreativity\\Modules\\Bus\\*
- type: className
value: CloudCreativity\\Modules\\EventBus\\*
ruleset:
Toolkit:
- Ramsey UUID
Application Bus:
Domain:
- Toolkit
- Infrastructure (Common)
- PSR Log
Domain (Common):
Infrastructure:
- Toolkit
Infrastructure (Common):
- Domain
Application:
- Toolkit
- Domain (Common)
- Ramsey UUID
- PSR Log
- Domain
- Infrastructure
1 change: 1 addition & 0 deletions src/Bus/CommandDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Pipeline\MiddlewareProcessor;
use CloudCreativity\Modules\Toolkit\Pipeline\PipeContainerInterface;
use CloudCreativity\Modules\Toolkit\Pipeline\PipelineBuilderFactory;
Expand Down
1 change: 1 addition & 0 deletions src/Bus/CommandDispatcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

interface CommandDispatcherInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Bus/CommandHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Messages\DispatchThroughMiddleware;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

final class CommandHandler implements CommandHandlerInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Bus/CommandHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Messages\DispatchThroughMiddleware;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

interface CommandHandlerInterface extends DispatchThroughMiddleware
Expand Down
7 changes: 6 additions & 1 deletion src/Bus/CommandInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

namespace CloudCreativity\Modules\Bus;

interface CommandInterface extends MessageInterface
use CloudCreativity\Modules\Toolkit\Messages\CommandInterface as BaseInterface;

/**
* @deprecated 1.0.0 Use CloudCreativity\Modules\Toolkit\Messages\CommandInterface
*/
interface CommandInterface extends BaseInterface
{
}
13 changes: 6 additions & 7 deletions src/Bus/DispatchThroughMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

namespace CloudCreativity\Modules\Bus;

interface DispatchThroughMiddleware
use CloudCreativity\Modules\Toolkit\Messages\DispatchThroughMiddleware as BaseDispatchThroughMiddleware;

/**
* @deprecated 1.0.0 use CloudCreativity\Modules\Toolkit\Messages\DispatchThroughMiddleware
*/
interface DispatchThroughMiddleware extends BaseDispatchThroughMiddleware
{
/**
* Get the middleware for the command or query.
*
* @return array<callable|string>
*/
public function middleware(): array;
}
2 changes: 1 addition & 1 deletion src/Bus/Middleware/CommandMiddlewareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\CommandInterface;
use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

interface CommandMiddlewareInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/ExecuteInUnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\CommandInterface;
use CloudCreativity\Modules\Infrastructure\Persistence\UnitOfWorkManagerInterface;
use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

final class ExecuteInUnitOfWork implements CommandMiddlewareInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/FlushDeferredEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\MessageInterface;
use CloudCreativity\Modules\Infrastructure\DomainEventDispatching\DeferredDispatcherInterface;
use CloudCreativity\Modules\Toolkit\Messages\MessageInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;
use Throwable;

Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/LogMessageDispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\MessageInterface;
use CloudCreativity\Modules\Infrastructure\Log\ObjectContext;
use CloudCreativity\Modules\Infrastructure\Log\ResultContext;
use CloudCreativity\Modules\Toolkit\Messages\MessageInterface;
use CloudCreativity\Modules\Toolkit\ModuleBasename;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;
use Psr\Log\LoggerInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/MessageMiddlewareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\MessageInterface;
use CloudCreativity\Modules\Toolkit\Messages\MessageInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

interface MessageMiddlewareInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/QueryMiddlewareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\QueryInterface;
use CloudCreativity\Modules\Toolkit\Messages\QueryInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

interface QueryMiddlewareInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/SetupBeforeDispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\MessageInterface;
use CloudCreativity\Modules\Toolkit\Messages\MessageInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

final class SetupBeforeDispatch implements MessageMiddlewareInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/TearDownAfterDispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\MessageInterface;
use CloudCreativity\Modules\Toolkit\Messages\MessageInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

final class TearDownAfterDispatch implements MessageMiddlewareInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/ValidateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\CommandInterface;
use CloudCreativity\Modules\Bus\Validation\CommandValidatorInterface;
use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Result\Result;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Middleware/ValidateQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
namespace CloudCreativity\Modules\Bus\Middleware;

use Closure;
use CloudCreativity\Modules\Bus\QueryInterface;
use CloudCreativity\Modules\Bus\Validation\QueryValidatorInterface;
use CloudCreativity\Modules\Toolkit\Messages\QueryInterface;
use CloudCreativity\Modules\Toolkit\Result\Result;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

Expand Down
1 change: 1 addition & 0 deletions src/Bus/QueryDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Toolkit\Messages\QueryInterface;
use CloudCreativity\Modules\Toolkit\Pipeline\MiddlewareProcessor;
use CloudCreativity\Modules\Toolkit\Pipeline\PipeContainerInterface;
use CloudCreativity\Modules\Toolkit\Pipeline\PipelineBuilderFactory;
Expand Down
1 change: 1 addition & 0 deletions src/Bus/QueryDispatcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Toolkit\Messages\QueryInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

interface QueryDispatcherInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Bus/QueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Toolkit\Messages\DispatchThroughMiddleware;
use CloudCreativity\Modules\Toolkit\Messages\QueryInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

final class QueryHandler implements QueryHandlerInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Bus/QueryHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

namespace CloudCreativity\Modules\Bus;

use CloudCreativity\Modules\Toolkit\Messages\DispatchThroughMiddleware;
use CloudCreativity\Modules\Toolkit\Messages\QueryInterface;
use CloudCreativity\Modules\Toolkit\Result\ResultInterface;

interface QueryHandlerInterface extends DispatchThroughMiddleware
Expand Down
7 changes: 6 additions & 1 deletion src/Bus/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

namespace CloudCreativity\Modules\Bus;

interface QueryInterface extends MessageInterface
use CloudCreativity\Modules\Toolkit\Messages\QueryInterface as BaseInterface;

/**
* @deprecated 1.0.0 Use CloudCreativity\Modules\Toolkit\Messages\QueryInterface
*/
interface QueryInterface extends BaseInterface
{
}
2 changes: 1 addition & 1 deletion src/Bus/Validation/CommandValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace CloudCreativity\Modules\Bus\Validation;

use CloudCreativity\Modules\Bus\CommandInterface;
use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Result\ListOfErrors;
use CloudCreativity\Modules\Toolkit\Result\ListOfErrorsInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Validation/CommandValidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace CloudCreativity\Modules\Bus\Validation;

use CloudCreativity\Modules\Bus\CommandInterface;
use CloudCreativity\Modules\Toolkit\Messages\CommandInterface;
use CloudCreativity\Modules\Toolkit\Result\ListOfErrorsInterface;

interface CommandValidatorInterface extends ValidatorInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Validation/QueryValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace CloudCreativity\Modules\Bus\Validation;

use CloudCreativity\Modules\Bus\QueryInterface;
use CloudCreativity\Modules\Toolkit\Messages\QueryInterface;
use CloudCreativity\Modules\Toolkit\Result\ListOfErrors;
use CloudCreativity\Modules\Toolkit\Result\ListOfErrorsInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Bus/Validation/QueryValidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace CloudCreativity\Modules\Bus\Validation;

use CloudCreativity\Modules\Bus\QueryInterface;
use CloudCreativity\Modules\Toolkit\Messages\QueryInterface;
use CloudCreativity\Modules\Toolkit\Result\ListOfErrorsInterface;

interface QueryValidatorInterface extends ValidatorInterface
Expand Down
Loading

0 comments on commit 3048c5b

Please sign in to comment.