@ddd-ts-kit/aspects 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ builder
|
|
|
51
51
|
The port is an abstract class and the class is what is bound. `StripeGateway` has no import
|
|
52
52
|
from this package and no knowledge of the policy. In the declared style, the default of a
|
|
53
53
|
generated project, there is no module file and the same policy is stated in the declaration
|
|
54
|
-
of the adapter: `@Adapter(PaymentGateway, { kind: 'external', aspects: [retry({ attempts: 3 }), timeout(2000)] }
|
|
54
|
+
of the adapter: `@Adapter(PaymentGateway, { kind: 'external', aspects: [retry({ attempts: 3 }), timeout(2000)] })`. Without a container an aspect is a function:
|
|
55
55
|
`retry({ attempts: 3 })(new StripeGateway(settings), { kind: 'external' })`.
|
|
56
56
|
|
|
57
57
|
### 2. At the composition root, on every binding
|
|
@@ -365,7 +365,7 @@ source line.
|
|
|
365
365
|
the Vitest config. Files wrapped at the composition root need nothing in either mode.
|
|
366
366
|
- **With a declaration.** `@Adapter(...)` on the class and `@Retry(...)` on its methods
|
|
367
367
|
compose, with the `aspects` of the declaration around the decorators of the methods:
|
|
368
|
-
`@Adapter(PaymentGateway, { kind: 'external' }
|
|
368
|
+
`@Adapter(PaymentGateway, { kind: 'external' })`. A static method, a
|
|
369
369
|
method named by a symbol and a hard-private (`#`) method are refused.
|
|
370
370
|
|
|
371
371
|
The `./decorators` entry is separate: nothing else in the package imports it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/aspects",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Cross-cutting behaviour applied from outside: logging, metrics, retry, timeout, circuit breaker and caching as composable wrappers at the composition root, as bus middlewares, or as standard decorators on adapters. The domain stays clean.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@ddd-ts-kit/kernel": "0.
|
|
37
|
+
"@ddd-ts-kit/kernel": "0.2.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@ddd-ts-kit/di": "0.
|
|
40
|
+
"@ddd-ts-kit/di": "0.2.0"
|
|
41
41
|
}
|
|
42
42
|
}
|