@living-architecture/riviere-extract-conventions 0.4.2 → 0.4.4
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/dist/{interfaces.d.ts → component-contracts.d.ts} +10 -1
- package/dist/component-contracts.d.ts.map +1 -0
- package/dist/decorators.d.ts +4 -0
- package/dist/decorators.d.ts.map +1 -1
- package/dist/decorators.js +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/default-extraction.config.json +14 -0
- package/src/eslint/require-component-decorator.cjs +2 -1
- package/dist/interfaces.d.ts.map +0 -1
- /package/dist/{interfaces.js → component-contracts.js} +0 -0
|
@@ -64,4 +64,13 @@ export interface UIPageDef {
|
|
|
64
64
|
export interface DomainOpContainerDef {
|
|
65
65
|
readonly __brand?: 'DomainOpContainerDef';
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Marker interface for event publisher classes.
|
|
69
|
+
* Classes implementing this interface publish domain events via typed methods.
|
|
70
|
+
* Each public method should have exactly one parameter whose type implements EventDef.
|
|
71
|
+
* The parameter type name is matched against Event component metadata.eventName.
|
|
72
|
+
*/
|
|
73
|
+
export interface EventPublisherDef {
|
|
74
|
+
readonly __brand?: 'EventPublisherDef';
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=component-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-contracts.d.ts","sourceRoot":"","sources":["../src/component-contracts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpE;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAAE,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa,CAAC,MAAM,GAAG,OAAO;IAC7C,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAA;CAAC;AAEjF;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAAC"}
|
package/dist/decorators.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export declare function APIContainer<T>(target: T, _: ClassDecoratorContext): T;
|
|
|
17
17
|
* Marks a class as a container where all public methods are event handlers.
|
|
18
18
|
*/
|
|
19
19
|
export declare function EventHandlerContainer<T>(target: T, _: ClassDecoratorContext): T;
|
|
20
|
+
/**
|
|
21
|
+
* Marks a class as a container where all public methods are event publishers.
|
|
22
|
+
*/
|
|
23
|
+
export declare function EventPublisherContainer<T>(target: T, _: ClassDecoratorContext): T;
|
|
20
24
|
/**
|
|
21
25
|
* Marks a class as a use case component.
|
|
22
26
|
*/
|
package/dist/decorators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,KAAK,MAAM,GAAG,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C,CAE5D;AAMD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,2BAA2B,GAAG,CAAC,CAEvF;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,2BAA2B,GAAG,CAAC,CAE1F;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,2BAA2B,GAAG,CAAC,CAE3F;AASD;;;;;GAKG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,GACX,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,qBAAqB,GAAG,2BAA2B,KAAK,CAAC,CAgBnF;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,qBAAqB,GAAG,2BAA2B,GAAG,CAAC,CAE9F;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQjE"}
|
package/dist/decorators.js
CHANGED
|
@@ -25,6 +25,12 @@ export function APIContainer(target, _) {
|
|
|
25
25
|
export function EventHandlerContainer(target, _) {
|
|
26
26
|
return target;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Marks a class as a container where all public methods are event publishers.
|
|
30
|
+
*/
|
|
31
|
+
export function EventPublisherContainer(target, _) {
|
|
32
|
+
return target;
|
|
33
|
+
}
|
|
28
34
|
// ============================================================================
|
|
29
35
|
// Class-as-Component Decorators
|
|
30
36
|
// ============================================================================
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DomainOpContainer, APIContainer, EventHandlerContainer, UseCase, Event, UI, DomainOp, APIEndpoint, EventHandler, Custom, Ignore, getCustomType, } from './decorators';
|
|
2
|
-
export type { HttpMethod, APIControllerDef, EventDef, EventHandlerDef, IEventHandler, UIPageDef, DomainOpContainerDef, } from './
|
|
1
|
+
export { DomainOpContainer, APIContainer, EventHandlerContainer, EventPublisherContainer, UseCase, Event, UI, DomainOp, APIEndpoint, EventHandler, Custom, Ignore, getCustomType, } from './decorators';
|
|
2
|
+
export type { HttpMethod, APIControllerDef, EventDef, EventHandlerDef, IEventHandler, UIPageDef, DomainOpContainerDef, EventPublisherDef, } from './component-contracts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EAEvB,OAAO,EACP,KAAK,EACL,EAAE,EAEF,QAAQ,EACR,WAAW,EACX,YAAY,EAEZ,MAAM,EACN,MAAM,EAEN,aAAa,GACd,MAAM,cAAc,CAAA;AAGrB,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,uBAAuB,CAAA"}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@living-architecture/riviere-extract-conventions",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"!**/*.tsbuildinfo"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@living-architecture/riviere-extract-config": "0.4.
|
|
35
|
+
"@living-architecture/riviere-extract-config": "0.4.3"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -67,6 +67,20 @@
|
|
|
67
67
|
"subscribedEvents": { "fromGenericArg": { "interface": "IEventHandler", "position": 0 } }
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
+
"eventPublisher": {
|
|
71
|
+
"find": "methods",
|
|
72
|
+
"where": {
|
|
73
|
+
"inClassWith": {
|
|
74
|
+
"hasDecorator": {
|
|
75
|
+
"name": "EventPublisherContainer",
|
|
76
|
+
"from": "@living-architecture/riviere-extract-conventions"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"extract": {
|
|
81
|
+
"publishedEventType": { "fromParameterType": { "position": 0 } }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
70
84
|
"ui": {
|
|
71
85
|
"find": "classes",
|
|
72
86
|
"where": {
|
|
@@ -2,6 +2,7 @@ const COMPONENT_DECORATORS = [
|
|
|
2
2
|
'DomainOpContainer',
|
|
3
3
|
'APIContainer',
|
|
4
4
|
'EventHandlerContainer',
|
|
5
|
+
'EventPublisherContainer',
|
|
5
6
|
'UseCase',
|
|
6
7
|
'Event',
|
|
7
8
|
'UI',
|
|
@@ -35,7 +36,7 @@ module.exports = {
|
|
|
35
36
|
schema: [],
|
|
36
37
|
messages: {
|
|
37
38
|
missingDecorator:
|
|
38
|
-
"Class '{{className}}' requires a component decorator. Add one of: @UseCase, @Event, @UI, @DomainOpContainer, @APIContainer, @EventHandlerContainer, @Custom('type'), or @Ignore",
|
|
39
|
+
"Class '{{className}}' requires a component decorator. Add one of: @UseCase, @Event, @UI, @DomainOpContainer, @APIContainer, @EventHandlerContainer, @EventPublisherContainer, @Custom('type'), or @Ignore",
|
|
39
40
|
},
|
|
40
41
|
},
|
|
41
42
|
create(context) {
|
package/dist/interfaces.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpE;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAAE,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa,CAAC,MAAM,GAAG,OAAO;IAC7C,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAA;CAAC"}
|
|
File without changes
|