@blixis-io/events 0.0.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/LICENSE +21 -0
- package/README.md +33 -1
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +127 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michael Voeten
|
|
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.
|
package/README.md
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
# `@blixis-io/events`
|
|
2
|
+
|
|
3
|
+
An in-process domain event bus (`defineEventsModule`, `EventBus.emit`/`on`). Depends only on `@blixis-io/core` — usable in any app, HTTP or not.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @blixis-io/events @blixis-io/core @blixis-io/di
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
// events.ts
|
|
11
|
+
type AppEvents = {
|
|
12
|
+
"post.created": { postId: string; title: string };
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const { EventsModule, EVENT_BUS } = defineEventsModule<AppEvents>();
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
@Injectable()
|
|
20
|
+
class PostsService {
|
|
21
|
+
constructor(@Inject(EVENT_BUS) private readonly events: EventBus<AppEvents>) {}
|
|
22
|
+
|
|
23
|
+
async create(input: CreatePostInput) {
|
|
24
|
+
const post = await this.repo.insert(input);
|
|
25
|
+
await this.events.emit("post.created", { postId: post.id, title: post.title });
|
|
26
|
+
return post;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Runs every handler for an event concurrently, in-process — no persistence, no delivery guarantee across a crash. Deliberately the only implementation for now; see the docs for why a transactional outbox was deferred rather than built ahead of a real need.
|
|
32
|
+
|
|
33
|
+
Part of [Blixis Framework](https://github.com/blixis-io/framework) — full docs: [Events](https://blixis-io.github.io/framework/concepts/events/) · [API reference](https://blixis-io.github.io/framework/reference/blixis-events/).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DynamicModule } from "@blixis-io/core";
|
|
2
|
+
import { InjectionToken } from "@blixis-io/di";
|
|
3
|
+
//#region src/module.d.ts
|
|
4
|
+
type EventHandler<Payload> = (payload: Payload) => void | Promise<void>;
|
|
5
|
+
interface EventBus<Events extends Record<string, unknown>> {
|
|
6
|
+
emit<K extends keyof Events & string>(type: K, payload: Events[K]): Promise<void>;
|
|
7
|
+
/** Registers `handler` for `type`, returning a function that unsubscribes just this handler. */
|
|
8
|
+
on<K extends keyof Events & string>(type: K, handler: EventHandler<Events[K]>): () => void;
|
|
9
|
+
}
|
|
10
|
+
interface EventsForRootOptions {
|
|
11
|
+
/** Makes `EVENT_BUS` visible to every module without each one importing this one directly. Defaults to `false`. */
|
|
12
|
+
global?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Builds an `EVENT_BUS` token typed to one app's event map. Same
|
|
16
|
+
* factory-closure shape as `defineConfigModule`/`defineAuthModule` — the
|
|
17
|
+
* event-name-to-payload map is app-specific, so it's a generic parameter
|
|
18
|
+
* fixed once per app, not baked into the package.
|
|
19
|
+
*/
|
|
20
|
+
export declare function defineEventsModule<Events extends Record<string, unknown>>(): {
|
|
21
|
+
EventsModule: {
|
|
22
|
+
forRoot(options?: EventsForRootOptions): DynamicModule;
|
|
23
|
+
};
|
|
24
|
+
EVENT_BUS: InjectionToken<EventBus<Events>>;
|
|
25
|
+
/**
|
|
26
|
+
* Subscribes the decorated method to `type`. The compiler checks the method accepts that event's
|
|
27
|
+
* payload. Works on any singleton provider (or controller) in the application; the handlers are
|
|
28
|
+
* attached once the app has booted, so an event emitted from `onModuleInit` is not seen yet.
|
|
29
|
+
*/
|
|
30
|
+
OnEvent: <K extends keyof Events & string>(type: K) => <T extends (payload: Events[K]) => void | Promise<void>>(target: object, method: string | symbol, descriptor: TypedPropertyDescriptor<T>) => void;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export type { EventBus, EventHandler, EventsForRootOptions };
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/module.ts"],"mappings":";;;KASY,aAAa,YAAY,SAAS,mBAAmB;UAEhD,SAAS,eAAe;EACvC,KAAK,gBAAgB,iBAAiB,MAAM,GAAG,SAAS,OAAO,KAAK;;EAEpE,GAAG,gBAAgB,iBAAiB,MAAM,GAAG,SAAS,aAAa,OAAO;;UAG3D;;EAEf;;;;;;;;wBA4Dc,mBAAmB,eAAe;EAChD;IAAgB,QAAQ,UAAU,uBAAuB;;EACzD,WAAW,eAAe,SAAS;;;;;;EAMnC,UAAU,gBAAgB,iBACxB,MAAM,OACF,WAAW,SAAS,OAAO,cAAc,eAC7C,gBACA,yBACA,YAAY,wBAAwB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Module } from "@blixis-io/core";
|
|
2
|
+
import { Inject, Injectable, InjectionToken, defineMetadata, getOwnMetadata } from "@blixis-io/di";
|
|
3
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
4
|
+
function __decorate(decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
12
|
+
function __decorateMetadata(k, v) {
|
|
13
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateParam.js
|
|
17
|
+
function __decorateParam(paramIndex, decorator) {
|
|
18
|
+
return function(target, key) {
|
|
19
|
+
decorator(target, key, paramIndex);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/module.ts
|
|
24
|
+
/**
|
|
25
|
+
* Runs every handler for an event concurrently and in-process — no
|
|
26
|
+
* persistence, no delivery guarantee across a crash. Deliberately the only
|
|
27
|
+
* implementation for now; see `concepts/events.md` for why a transactional
|
|
28
|
+
* outbox was deferred rather than built ahead of a real consumer.
|
|
29
|
+
*/
|
|
30
|
+
let InProcessEventBus = class InProcessEventBus {
|
|
31
|
+
#handlers = /* @__PURE__ */ new Map();
|
|
32
|
+
on(type, handler) {
|
|
33
|
+
let handlers = this.#handlers.get(type);
|
|
34
|
+
if (!handlers) {
|
|
35
|
+
handlers = /* @__PURE__ */ new Set();
|
|
36
|
+
this.#handlers.set(type, handlers);
|
|
37
|
+
}
|
|
38
|
+
handlers.add(handler);
|
|
39
|
+
return () => handlers.delete(handler);
|
|
40
|
+
}
|
|
41
|
+
async emit(type, payload) {
|
|
42
|
+
const handlers = this.#handlers.get(type);
|
|
43
|
+
if (!handlers || handlers.size === 0) return;
|
|
44
|
+
await Promise.all([...handlers].map(async (handler) => {
|
|
45
|
+
try {
|
|
46
|
+
await handler(payload);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error(`event handler for "${type}" failed:`, error);
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
InProcessEventBus = __decorate([Injectable()], InProcessEventBus);
|
|
54
|
+
/**
|
|
55
|
+
* Builds an `EVENT_BUS` token typed to one app's event map. Same
|
|
56
|
+
* factory-closure shape as `defineConfigModule`/`defineAuthModule` — the
|
|
57
|
+
* event-name-to-payload map is app-specific, so it's a generic parameter
|
|
58
|
+
* fixed once per app, not baked into the package.
|
|
59
|
+
*/
|
|
60
|
+
function defineEventsModule() {
|
|
61
|
+
var _EventsModule;
|
|
62
|
+
const EVENT_BUS = new InjectionToken("blixis.events.bus");
|
|
63
|
+
const HANDLERS = Symbol("blixis.events.handlers");
|
|
64
|
+
function OnEvent(type) {
|
|
65
|
+
return (target, method, _descriptor) => {
|
|
66
|
+
const own = getOwnMetadata(HANDLERS, target) ?? [];
|
|
67
|
+
defineMetadata(HANDLERS, [...own, {
|
|
68
|
+
type,
|
|
69
|
+
method
|
|
70
|
+
}], target);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** Every `@OnEvent` handler declared on `instance`'s class or any of its base classes. */
|
|
74
|
+
function handlersOf(instance) {
|
|
75
|
+
const records = [];
|
|
76
|
+
for (let proto = Object.getPrototypeOf(instance); typeof proto === "object" && proto !== null; proto = Object.getPrototypeOf(proto)) records.push(...getOwnMetadata(HANDLERS, proto) ?? []);
|
|
77
|
+
return records;
|
|
78
|
+
}
|
|
79
|
+
/** Finds the `@OnEvent` methods across the whole application after boot and subscribes them. */
|
|
80
|
+
let EventSubscriber = class EventSubscriber {
|
|
81
|
+
#unsubscribe = [];
|
|
82
|
+
constructor(bus) {
|
|
83
|
+
this.bus = bus;
|
|
84
|
+
}
|
|
85
|
+
onApplicationBootstrap(app) {
|
|
86
|
+
for (const [, instance] of app.resolved()) {
|
|
87
|
+
if (typeof instance !== "object" || instance === null) continue;
|
|
88
|
+
for (const { type, method } of handlersOf(instance)) {
|
|
89
|
+
const handle = Reflect.get(instance, method);
|
|
90
|
+
if (typeof handle !== "function") throw new TypeError(`${instance.constructor.name}.${String(method)} is decorated with @OnEvent("${type}") but is not a method.`);
|
|
91
|
+
this.#unsubscribe.push(this.bus.on(type, (payload) => Reflect.apply(handle, instance, [payload])));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
onApplicationShutdown() {
|
|
96
|
+
for (const off of this.#unsubscribe.splice(0)) off();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
EventSubscriber = __decorate([
|
|
100
|
+
Injectable(),
|
|
101
|
+
__decorateParam(0, Inject(EVENT_BUS)),
|
|
102
|
+
__decorateMetadata("design:paramtypes", [Object])
|
|
103
|
+
], EventSubscriber);
|
|
104
|
+
let EventsModule = _EventsModule = class EventsModule {
|
|
105
|
+
static forRoot(options = {}) {
|
|
106
|
+
return {
|
|
107
|
+
module: _EventsModule,
|
|
108
|
+
providers: [{
|
|
109
|
+
provide: EVENT_BUS,
|
|
110
|
+
useClass: InProcessEventBus
|
|
111
|
+
}, EventSubscriber],
|
|
112
|
+
exports: [EVENT_BUS],
|
|
113
|
+
global: options.global ?? false
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
EventsModule = _EventsModule = __decorate([Module()], EventsModule);
|
|
118
|
+
return {
|
|
119
|
+
EventsModule,
|
|
120
|
+
EVENT_BUS,
|
|
121
|
+
OnEvent
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { defineEventsModule };
|
|
126
|
+
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/module.ts"],"sourcesContent":["import {\n Module,\n type BootstrapContext,\n type DynamicModule,\n type OnApplicationBootstrap,\n type OnApplicationShutdown,\n} from \"@blixis-io/core\";\nimport { defineMetadata, getOwnMetadata, Inject, Injectable, InjectionToken } from \"@blixis-io/di\";\n\nexport type EventHandler<Payload> = (payload: Payload) => void | Promise<void>;\n\nexport interface EventBus<Events extends Record<string, unknown>> {\n emit<K extends keyof Events & string>(type: K, payload: Events[K]): Promise<void>;\n /** Registers `handler` for `type`, returning a function that unsubscribes just this handler. */\n on<K extends keyof Events & string>(type: K, handler: EventHandler<Events[K]>): () => void;\n}\n\nexport interface EventsForRootOptions {\n /** Makes `EVENT_BUS` visible to every module without each one importing this one directly. Defaults to `false`. */\n global?: boolean;\n}\n\n/**\n * Runs every handler for an event concurrently and in-process — no\n * persistence, no delivery guarantee across a crash. Deliberately the only\n * implementation for now; see `concepts/events.md` for why a transactional\n * outbox was deferred rather than built ahead of a real consumer.\n */\n@Injectable()\nclass InProcessEventBus<Events extends Record<string, unknown>> implements EventBus<Events> {\n readonly #handlers = new Map<string, Set<EventHandler<never>>>();\n\n on<K extends keyof Events & string>(type: K, handler: EventHandler<Events[K]>): () => void {\n let handlers = this.#handlers.get(type);\n if (!handlers) {\n handlers = new Set();\n this.#handlers.set(type, handlers);\n }\n handlers.add(handler);\n return () => handlers.delete(handler);\n }\n\n async emit<K extends keyof Events & string>(type: K, payload: Events[K]): Promise<void> {\n const handlers = this.#handlers.get(type);\n if (!handlers || handlers.size === 0) {\n return;\n }\n\n await Promise.all(\n [...handlers].map(async (handler) => {\n try {\n // Handlers for every event type share one Set<EventHandler<never>>\n // collection (indexed by the string `type`, not a type-level key),\n // so there's no way for TS to correlate a specific handler back to\n // the K it was registered with — this cast is the one place that\n // trusts `type` actually matches, same as `on()`'s own erasure.\n await handler(payload as never);\n } catch (error) {\n // A handler's own failure never blocks sibling handlers or the\n // caller — same self-contained fallback @blixis-io/logging's own\n // transport-failure handling already uses.\n console.error(`event handler for \"${type}\" failed:`, error);\n }\n }),\n );\n }\n}\n\ninterface HandlerRecord {\n type: string;\n method: string | symbol;\n}\n\n/**\n * Builds an `EVENT_BUS` token typed to one app's event map. Same\n * factory-closure shape as `defineConfigModule`/`defineAuthModule` — the\n * event-name-to-payload map is app-specific, so it's a generic parameter\n * fixed once per app, not baked into the package.\n */\nexport function defineEventsModule<Events extends Record<string, unknown>>(): {\n EventsModule: { forRoot(options?: EventsForRootOptions): DynamicModule };\n EVENT_BUS: InjectionToken<EventBus<Events>>;\n /**\n * Subscribes the decorated method to `type`. The compiler checks the method accepts that event's\n * payload. Works on any singleton provider (or controller) in the application; the handlers are\n * attached once the app has booted, so an event emitted from `onModuleInit` is not seen yet.\n */\n OnEvent: <K extends keyof Events & string>(\n type: K,\n ) => <T extends (payload: Events[K]) => void | Promise<void>>(\n target: object,\n method: string | symbol,\n descriptor: TypedPropertyDescriptor<T>,\n ) => void;\n} {\n const EVENT_BUS = new InjectionToken<EventBus<Events>>(\"blixis.events.bus\");\n // One metadata key per factory, so two event maps in one app never pick up each other's handlers.\n const HANDLERS = Symbol(\"blixis.events.handlers\");\n\n function OnEvent<K extends keyof Events & string>(type: K) {\n return <T extends (payload: Events[K]) => void | Promise<void>>(\n target: object,\n method: string | symbol,\n _descriptor: TypedPropertyDescriptor<T>,\n ): void => {\n const own = getOwnMetadata<HandlerRecord[]>(HANDLERS, target) ?? [];\n defineMetadata(HANDLERS, [...own, { type, method }], target);\n };\n }\n\n /** Every `@OnEvent` handler declared on `instance`'s class or any of its base classes. */\n function handlersOf(instance: object): HandlerRecord[] {\n const records: HandlerRecord[] = [];\n for (let proto: unknown = Object.getPrototypeOf(instance); typeof proto === \"object\" && proto !== null; proto = Object.getPrototypeOf(proto)) {\n records.push(...(getOwnMetadata<HandlerRecord[]>(HANDLERS, proto) ?? []));\n }\n return records;\n }\n\n /** Finds the `@OnEvent` methods across the whole application after boot and subscribes them. */\n @Injectable()\n class EventSubscriber implements OnApplicationBootstrap, OnApplicationShutdown {\n readonly #unsubscribe: (() => void)[] = [];\n\n constructor(@Inject(EVENT_BUS) private readonly bus: EventBus<Events>) {}\n\n onApplicationBootstrap(app: BootstrapContext): void {\n for (const [, instance] of app.resolved()) {\n if (typeof instance !== \"object\" || instance === null) {\n continue;\n }\n for (const { type, method } of handlersOf(instance)) {\n const handle: unknown = Reflect.get(instance, method);\n if (typeof handle !== \"function\") {\n throw new TypeError(`${instance.constructor.name}.${String(method)} is decorated with @OnEvent(\"${type}\") but is not a method.`);\n }\n this.#unsubscribe.push(this.bus.on(type, (payload) => Reflect.apply(handle, instance, [payload]) as void | Promise<void>));\n }\n }\n }\n\n onApplicationShutdown(): void {\n for (const off of this.#unsubscribe.splice(0)) {\n off();\n }\n }\n }\n\n @Module()\n class EventsModule {\n static forRoot(options: EventsForRootOptions = {}): DynamicModule {\n return {\n module: EventsModule,\n providers: [{ provide: EVENT_BUS, useClass: InProcessEventBus }, EventSubscriber],\n exports: [EVENT_BUS],\n global: options.global ?? false,\n };\n }\n }\n\n return { EventsModule, EVENT_BUS, OnEvent };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IACM,oBADN,MACM,kBAAsF;CAC1F,4BAAqB,IAAI,IAAsC;CAE/D,GAAoC,MAAS,SAA8C;EACzF,IAAI,WAAW,KAAK,UAAU,IAAI,IAAI;EACtC,IAAI,CAAC,UAAU;GACb,2BAAW,IAAI,IAAI;GACnB,KAAK,UAAU,IAAI,MAAM,QAAQ;EACnC;EACA,SAAS,IAAI,OAAO;EACpB,aAAa,SAAS,OAAO,OAAO;CACtC;CAEA,MAAM,KAAsC,MAAS,SAAmC;EACtF,MAAM,WAAW,KAAK,UAAU,IAAI,IAAI;EACxC,IAAI,CAAC,YAAY,SAAS,SAAS,GACjC;EAGF,MAAM,QAAQ,IACZ,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,OAAO,YAAY;GACnC,IAAI;IAMF,MAAM,QAAQ,OAAgB;GAChC,SAAS,OAAO;IAId,QAAQ,MAAM,sBAAsB,KAAK,YAAY,KAAK;GAC5D;EACF,CAAC,CACH;CACF;AACF;AAtCC,oBAAA,WAAA,CAAA,WAAW,CAAA,GAAA,iBAAA;;;;;;;AAmDZ,SAAgB,qBAed;;CACA,MAAM,YAAY,IAAI,eAAiC,mBAAmB;CAE1E,MAAM,WAAW,OAAO,wBAAwB;CAEhD,SAAS,QAAyC,MAAS;EACzD,QACE,QACA,QACA,gBACS;GACT,MAAM,MAAM,eAAgC,UAAU,MAAM,KAAK,CAAC;GAClE,eAAe,UAAU,CAAC,GAAG,KAAK;IAAE;IAAM;GAAO,CAAC,GAAG,MAAM;EAC7D;CACF;;CAGA,SAAS,WAAW,UAAmC;EACrD,MAAM,UAA2B,CAAC;EAClC,KAAK,IAAI,QAAiB,OAAO,eAAe,QAAQ,GAAG,OAAO,UAAU,YAAY,UAAU,MAAM,QAAQ,OAAO,eAAe,KAAK,GACzI,QAAQ,KAAK,GAAI,eAAgC,UAAU,KAAK,KAAK,CAAC,CAAE;EAE1E,OAAO;CACT;;CAGA,IACM,kBADN,MACM,gBAAyE;EAC7E,eAAwC,CAAC;EAEzC,YAAY,KAA2D;GAAvB,KAAA,MAAA;EAAwB;EAExE,uBAAuB,KAA6B;GAClD,KAAK,MAAM,GAAG,aAAa,IAAI,SAAS,GAAG;IACzC,IAAI,OAAO,aAAa,YAAY,aAAa,MAC/C;IAEF,KAAK,MAAM,EAAE,MAAM,YAAY,WAAW,QAAQ,GAAG;KACnD,MAAM,SAAkB,QAAQ,IAAI,UAAU,MAAM;KACpD,IAAI,OAAO,WAAW,YACpB,MAAM,IAAI,UAAU,GAAG,SAAS,YAAY,KAAK,GAAG,OAAO,MAAM,EAAE,+BAA+B,KAAK,wBAAwB;KAEjI,KAAK,aAAa,KAAK,KAAK,IAAI,GAAG,OAAO,YAAY,QAAQ,MAAM,QAAQ,UAAU,CAAC,OAAO,CAAC,CAAyB,CAAC;IAC3H;GACF;EACF;EAEA,wBAA8B;GAC5B,KAAK,MAAM,OAAO,KAAK,aAAa,OAAO,CAAC,GAC1C,IAAI;EAER;CACF;;EA1BC,WAAW;EAIG,gBAAA,GAAA,OAAO,SAAS,CAAA;;;CAwB/B,IACM,eAAA,gBADN,MACM,aAAa;EACjB,OAAO,QAAQ,UAAgC,CAAC,GAAkB;GAChE,OAAO;IACL,QAAA;IACA,WAAW,CAAC;KAAE,SAAS;KAAW,UAAU;IAAkB,GAAG,eAAe;IAChF,SAAS,CAAC,SAAS;IACnB,QAAQ,QAAQ,UAAU;GAC5B;EACF;CACF;CAVC,eAAA,gBAAA,WAAA,CAAA,OAAO,CAAA,GAAA,YAAA;CAYR,OAAO;EAAE;EAAc;EAAW;CAAQ;AAC5C"}
|
package/package.json
CHANGED
|
@@ -1 +1,44 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@blixis-io/events",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "An in-process domain event bus (defineEventsModule, EventBus.emit/on). Depends only on @blixis-io/core — usable in any app, HTTP or not.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Michael Voeten <michael@voeten.online>",
|
|
7
|
+
"homepage": "https://blixis-io.github.io/framework/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/blixis-io/framework.git",
|
|
11
|
+
"directory": "packages/events"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=24"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"events",
|
|
19
|
+
"pub-sub",
|
|
20
|
+
"event-bus",
|
|
21
|
+
"typescript"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"@blixis-io/source": "./src/index.ts",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@blixis-io/core": "0.3.0",
|
|
38
|
+
"@blixis-io/di": "0.1.1"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
42
|
+
"build": "rolldown -c"
|
|
43
|
+
}
|
|
44
|
+
}
|