@acmekit/event-bus-local 2.13.1

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 ADDED
@@ -0,0 +1,63 @@
1
+ <p align="center">
2
+ <a href="https://www.acmekit.com">
3
+ <img alt="AcmeKit" src="https://user-images.githubusercontent.com/7554214/153162406-bf8fd16f-aa98-4604-b87b-e13ab4baf604.png" width="100" />
4
+ </a>
5
+ </p>
6
+ <h1 align="center">
7
+ @acmekit/event-bus-local
8
+ </h1>
9
+
10
+ <h4 align="center">
11
+ <a href="https://docs.acmekit.com">Documentation</a> |
12
+ <a href="https://www.acmekit.com">Website</a>
13
+ </h4>
14
+
15
+ <p align="center">
16
+ An open source composable commerce engine built for developers.
17
+ </p>
18
+ <p align="center">
19
+ <a href="https://github.com/acmekit/acmekit/blob/master/LICENSE">
20
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="AcmeKit is released under the MIT license." />
21
+ </a>
22
+ <a href="https://circleci.com/gh/acmekit/acmekit">
23
+ <img src="https://circleci.com/gh/acmekit/acmekit.svg?style=shield" alt="Current CircleCI build status." />
24
+ </a>
25
+ <a href="https://github.com/acmekit/acmekit/blob/master/CONTRIBUTING.md">
26
+ <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" alt="PRs welcome!" />
27
+ </a>
28
+ <a href="https://www.producthunt.com/posts/acmekit"><img src="https://img.shields.io/badge/Product%20Hunt-%231%20Product%20of%20the%20Day-%23DA552E" alt="Product Hunt"></a>
29
+ <a href="https://discord.gg/xpCwq3Kfn8">
30
+ <img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" />
31
+ </a>
32
+ <a href="https://twitter.com/intent/follow?screen_name=acmekit">
33
+ <img src="https://img.shields.io/twitter/follow/acmekit.svg?label=Follow%20@acmekit" alt="Follow @acmekit" />
34
+ </a>
35
+ </p>
36
+
37
+ ## Overview
38
+
39
+ Local Event Bus module for AcmeKit. When installed, the events system of AcmeKit is powered by the Node EventEmitter. This module installed by default in new (> v1.8.0) AcmeKit projects.
40
+
41
+ The Node EventEmitter is limited to a single process environment. We generally recommend using the `@acmekit/event-bus-redis` module in a production environment.
42
+
43
+ ## Getting started
44
+
45
+ Install the module:
46
+
47
+ ```bash
48
+ yarn add @acmekit/event-bus-local
49
+ ```
50
+
51
+ You don't need to add the module to your project configuration as it is the default one. AcmeKit will try to use it, if no other event buses are installed.
52
+
53
+ ```js
54
+ module.exports = {
55
+ // ...
56
+ modules: [ ... ],
57
+ // ...
58
+ }
59
+ ```
60
+
61
+ ## Configuration
62
+
63
+ The module comes with no configuration options.
@@ -0,0 +1,8 @@
1
+ import { ModuleExports } from "@acmekit/framework/types";
2
+ import LocalEventBus from "./services/event-bus-local";
3
+ export declare const service: typeof LocalEventBus;
4
+ export declare const loaders: (({ logger }: import("@acmekit/framework/types").LoaderOptions) => Promise<void>)[];
5
+ declare const moduleDefinition: ModuleExports;
6
+ export default moduleDefinition;
7
+ export * from "./initialize";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,OAAO,aAAa,MAAM,4BAA4B,CAAA;AAEtD,eAAO,MAAM,OAAO,sBAAgB,CAAA;AACpC,eAAO,MAAM,OAAO,qFAAW,CAAA;AAE/B,QAAA,MAAM,gBAAgB,EAAE,aAGvB,CAAA;AAED,eAAe,gBAAgB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.loaders = exports.service = void 0;
21
+ const loaders_1 = __importDefault(require("./loaders"));
22
+ const event_bus_local_1 = __importDefault(require("./services/event-bus-local"));
23
+ exports.service = event_bus_local_1.default;
24
+ exports.loaders = [loaders_1.default];
25
+ const moduleDefinition = {
26
+ service: exports.service,
27
+ loaders: exports.loaders,
28
+ };
29
+ exports.default = moduleDefinition;
30
+ __exportStar(require("./initialize"), exports);
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,wDAA8B;AAC9B,iFAAsD;AAEzC,QAAA,OAAO,GAAG,yBAAa,CAAA;AACvB,QAAA,OAAO,GAAG,CAAC,iBAAM,CAAC,CAAA;AAE/B,MAAM,gBAAgB,GAAkB;IACtC,OAAO,EAAP,eAAO;IACP,OAAO,EAAP,eAAO;CACR,CAAA;AAED,kBAAe,gBAAgB,CAAA;AAC/B,+CAA4B"}
@@ -0,0 +1,3 @@
1
+ import { IEventBusService } from "@acmekit/framework/types";
2
+ export declare const initialize: () => Promise<IEventBusService>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAG3D,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,gBAAgB,CAQ3D,CAAA"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initialize = void 0;
4
+ const modules_sdk_1 = require("@acmekit/framework/modules-sdk");
5
+ const utils_1 = require("@acmekit/framework/utils");
6
+ const initialize = async () => {
7
+ const serviceKey = utils_1.Modules.EVENT_BUS;
8
+ const loaded = await modules_sdk_1.AcmeKitModule.bootstrap({
9
+ moduleKey: serviceKey,
10
+ defaultPath: "@acmekit/event-bus-local",
11
+ });
12
+ return loaded[serviceKey];
13
+ };
14
+ exports.initialize = initialize;
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":";;;AAAA,gEAA8D;AAE9D,oDAAkD;AAE3C,MAAM,UAAU,GAAG,KAAK,IAA+B,EAAE;IAC9D,MAAM,UAAU,GAAG,eAAO,CAAC,SAAS,CAAA;IACpC,MAAM,MAAM,GAAG,MAAM,2BAAa,CAAC,SAAS,CAAmB;QAC7D,SAAS,EAAE,UAAU;QACrB,WAAW,EAAE,0BAA0B;KACxC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,UAAU,CAAC,CAAA;AAC3B,CAAC,CAAA;AARY,QAAA,UAAU,cAQtB"}
@@ -0,0 +1,4 @@
1
+ import { LoaderOptions } from "@acmekit/framework/types";
2
+ declare const _default: ({ logger }: LoaderOptions) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;yBAElC,YAAY,aAAa,KAAG,OAAO,CAAC,IAAI,CAAC;AAA/D,wBAIC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = async ({ logger }) => {
4
+ logger?.warn("Local Event Bus installed. This is not recommended for production.");
5
+ };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":";;AAEA,kBAAe,KAAK,EAAE,EAAE,MAAM,EAAiB,EAAiB,EAAE;IAChE,MAAM,EAAE,IAAI,CACV,oEAAoE,CACrE,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { EventBusTypes, InternalModuleDeclaration, Logger, AcmeKitContainer, Message, Subscriber } from "@acmekit/framework/types";
2
+ import { AbstractEventBusModuleService } from "@acmekit/framework/utils";
3
+ import { EventEmitter } from "events";
4
+ type InjectedDependencies = {
5
+ logger: Logger;
6
+ };
7
+ type StagingQueueType = Map<string, Message[]>;
8
+ export default class LocalEventBusService extends AbstractEventBusModuleService {
9
+ protected readonly logger_: Logger;
10
+ protected readonly eventEmitter_: EventEmitter;
11
+ protected groupedEventsMap_: StagingQueueType;
12
+ constructor({ logger }: AcmeKitContainer & InjectedDependencies, moduleOptions: {} | undefined, moduleDeclaration: InternalModuleDeclaration);
13
+ private logProcessingEvent;
14
+ /**
15
+ * Accept an event name and some options
16
+ *
17
+ * @param eventsData
18
+ * @param options The options can include `internal` which will prevent the event from being logged
19
+ */
20
+ emit<T = unknown>(eventsData: Message<T> | Message<T>[], options?: Record<string, unknown>): Promise<void>;
21
+ private groupOrEmitEvent;
22
+ private groupEvent;
23
+ releaseGroupedEvents(eventGroupId: string): Promise<void>;
24
+ clearGroupedEvents(eventGroupId: string, { eventNames }?: {
25
+ eventNames?: string[];
26
+ }): Promise<void>;
27
+ subscribe(event: string | symbol, subscriber: Subscriber, context?: EventBusTypes.SubscriberContext): this;
28
+ unsubscribe(event: string | symbol, subscriber: Subscriber, context: EventBusTypes.SubscriberContext): this;
29
+ }
30
+ export {};
31
+ //# sourceMappingURL=event-bus-local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-bus-local.d.ts","sourceRoot":"","sources":["../../src/services/event-bus-local.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,yBAAyB,EACzB,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,UAAU,EACX,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAGrC,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;AAM9C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,6BAA6B;IAC7E,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAClC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAA;IAC9C,SAAS,CAAC,iBAAiB,EAAE,gBAAgB,CAAA;gBAG3C,EAAE,MAAM,EAAE,EAAE,gBAAgB,GAAG,oBAAoB,EACnD,aAAa,gBAAK,EAClB,iBAAiB,EAAE,yBAAyB;IAW9C,OAAO,CAAC,kBAAkB;IAgB1B;;;;;OAKG;IACG,IAAI,CAAC,CAAC,GAAG,OAAO,EACpB,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,EACrC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACpC,OAAO,CAAC,IAAI,CAAC;YAkBF,gBAAgB;YAmChB,UAAU;IAWlB,oBAAoB,CAAC,YAAY,EAAE,MAAM;IAmCzC,kBAAkB,CACtB,YAAY,EAAE,MAAM,EACpB,EAAE,UAAU,EAAE,GAAE;QAAE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;KAAO;IAahD,SAAS,CACP,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,aAAa,CAAC,iBAAiB,GACxC,IAAI;IA0BP,WAAW,CACT,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,aAAa,CAAC,iBAAiB,GACvC,IAAI;CAqBR"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@acmekit/framework/utils");
4
+ const events_1 = require("events");
5
+ const promises_1 = require("timers/promises");
6
+ const eventEmitter = new events_1.EventEmitter();
7
+ eventEmitter.setMaxListeners(Infinity);
8
+ // eslint-disable-next-line max-len
9
+ class LocalEventBusService extends utils_1.AbstractEventBusModuleService {
10
+ constructor({ logger }, moduleOptions = {}, moduleDeclaration) {
11
+ // @ts-ignore
12
+ // eslint-disable-next-line prefer-rest-params
13
+ super(...arguments);
14
+ this.logger_ = logger ?? console;
15
+ this.eventEmitter_ = eventEmitter;
16
+ this.groupedEventsMap_ = new Map();
17
+ }
18
+ logProcessingEvent(eventData, options = {}, totalSubscribers) {
19
+ if (totalSubscribers &&
20
+ !options?.internal &&
21
+ !eventData.options?.internal) {
22
+ this.logger_.info(`Processing ${eventData.name} which has ${totalSubscribers} subscribers`);
23
+ }
24
+ }
25
+ /**
26
+ * Accept an event name and some options
27
+ *
28
+ * @param eventsData
29
+ * @param options The options can include `internal` which will prevent the event from being logged
30
+ */
31
+ async emit(eventsData, options = {}) {
32
+ const normalizedEventsData = Array.isArray(eventsData)
33
+ ? eventsData
34
+ : [eventsData];
35
+ for (const eventData of normalizedEventsData) {
36
+ await this.groupOrEmitEvent({
37
+ ...eventData,
38
+ options,
39
+ });
40
+ }
41
+ }
42
+ // If the data of the event consists of a eventGroupId, we don't emit the event, instead
43
+ // we add them to a queue grouped by the eventGroupId and release them when
44
+ // explicitly requested.
45
+ // This is useful in the event of a distributed transaction where you'd want to emit
46
+ // events only once the transaction ends.
47
+ async groupOrEmitEvent(eventData) {
48
+ const { options, ...eventBody } = eventData;
49
+ const eventGroupId = eventBody.metadata?.eventGroupId;
50
+ const hasStarSubscriber = this.eventEmitter_.listenerCount("*") > 0;
51
+ if (eventGroupId) {
52
+ await this.groupEvent(eventGroupId, eventData);
53
+ }
54
+ else {
55
+ const options_ = eventData.options;
56
+ const delay = (ms) => (ms ? (0, promises_1.setTimeout)(ms) : Promise.resolve());
57
+ const eventListenersCount = this.eventEmitter_.listenerCount(eventData.name);
58
+ delay(options_?.delay).then(async () => {
59
+ // Call interceptors before emitting
60
+ void this.callInterceptors(eventData, { isGrouped: false });
61
+ if (eventListenersCount) {
62
+ this.eventEmitter_.emit(eventData.name, eventBody);
63
+ }
64
+ if (hasStarSubscriber) {
65
+ this.eventEmitter_.emit("*", eventBody);
66
+ }
67
+ const totalSubscribers = eventListenersCount + (hasStarSubscriber ? 1 : 0);
68
+ this.logProcessingEvent(eventData, options, totalSubscribers);
69
+ });
70
+ }
71
+ }
72
+ // Groups an event to a queue to be emitted upon explicit release
73
+ async groupEvent(eventGroupId, eventData) {
74
+ const groupedEvents = this.groupedEventsMap_.get(eventGroupId) || [];
75
+ groupedEvents.push(eventData);
76
+ this.groupedEventsMap_.set(eventGroupId, groupedEvents);
77
+ }
78
+ async releaseGroupedEvents(eventGroupId) {
79
+ let groupedEvents = this.groupedEventsMap_.get(eventGroupId) || [];
80
+ groupedEvents = JSON.parse(JSON.stringify(groupedEvents));
81
+ const hasStarSubscriber = this.eventEmitter_.listenerCount("*") > 0;
82
+ for (const event of groupedEvents) {
83
+ const { options, ...eventBody } = event;
84
+ const eventListenersCount = this.eventEmitter_.listenerCount(event.name);
85
+ const options_ = options;
86
+ const delay = (ms) => (ms ? (0, promises_1.setTimeout)(ms) : Promise.resolve());
87
+ delay(options_?.delay).then(async () => {
88
+ // Call interceptors before emitting grouped events
89
+ void this.callInterceptors(event, { isGrouped: true, eventGroupId });
90
+ if (eventListenersCount) {
91
+ this.eventEmitter_.emit(event.name, eventBody);
92
+ }
93
+ if (hasStarSubscriber) {
94
+ this.eventEmitter_.emit("*", eventBody);
95
+ }
96
+ const totalSubscribers = eventListenersCount + (hasStarSubscriber ? 1 : 0);
97
+ this.logProcessingEvent(event, options, totalSubscribers);
98
+ });
99
+ }
100
+ await this.clearGroupedEvents(eventGroupId);
101
+ }
102
+ async clearGroupedEvents(eventGroupId, { eventNames } = {}) {
103
+ if (eventNames?.length) {
104
+ const groupedEvents = this.groupedEventsMap_.get(eventGroupId) || [];
105
+ const eventsToKeep = groupedEvents.filter((event) => !eventNames.includes(event.name));
106
+ this.groupedEventsMap_.set(eventGroupId, eventsToKeep);
107
+ }
108
+ else {
109
+ this.groupedEventsMap_.delete(eventGroupId);
110
+ }
111
+ }
112
+ subscribe(event, subscriber, context) {
113
+ super.subscribe(event, subscriber, context);
114
+ const subscriberId = context?.subscriberId ?? subscriber.subscriberId;
115
+ const wrappedSubscriber = async (data) => {
116
+ try {
117
+ await subscriber(data);
118
+ }
119
+ catch (err) {
120
+ this.logger_.error(`An error occurred while processing ${event.toString()}:`);
121
+ this.logger_.error(err);
122
+ }
123
+ };
124
+ if (subscriberId) {
125
+ ;
126
+ wrappedSubscriber.subscriberId = subscriberId;
127
+ }
128
+ this.eventEmitter_.on(event, wrappedSubscriber);
129
+ return this;
130
+ }
131
+ unsubscribe(event, subscriber, context) {
132
+ super.unsubscribe(event, subscriber, context);
133
+ const subscriberId = context?.subscriberId ?? subscriber.subscriberId;
134
+ if (subscriberId) {
135
+ const listeners = this.eventEmitter_.listeners(event);
136
+ const wrappedSubscriber = listeners.find((listener) => listener.subscriberId === subscriberId);
137
+ if (wrappedSubscriber) {
138
+ this.eventEmitter_.off(event, wrappedSubscriber);
139
+ }
140
+ }
141
+ else {
142
+ this.eventEmitter_.off(event, subscriber);
143
+ }
144
+ return this;
145
+ }
146
+ }
147
+ exports.default = LocalEventBusService;
148
+ //# sourceMappingURL=event-bus-local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-bus-local.js","sourceRoot":"","sources":["../../src/services/event-bus-local.ts"],"names":[],"mappings":";;AASA,oDAAwE;AACxE,mCAAqC;AACrC,8CAA4C;AAQ5C,MAAM,YAAY,GAAG,IAAI,qBAAY,EAAE,CAAA;AACvC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;AAEtC,mCAAmC;AACnC,MAAqB,oBAAqB,SAAQ,qCAA6B;IAK7E,YACE,EAAE,MAAM,EAA2C,EACnD,aAAa,GAAG,EAAE,EAClB,iBAA4C;QAE5C,aAAa;QACb,8CAA8C;QAC9C,KAAK,CAAC,GAAG,SAAS,CAAC,CAAA;QAEnB,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,OAAO,CAAA;QAChC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAA;QACjC,IAAI,CAAC,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAA;IACpC,CAAC;IAEO,kBAAkB,CACxB,SAAkB,EAClB,UAAmC,EAAE,EACrC,gBAAwB;QAExB,IACE,gBAAgB;YAChB,CAAC,OAAO,EAAE,QAAQ;YAClB,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,EAC5B,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,cAAc,SAAS,CAAC,IAAI,cAAc,gBAAgB,cAAc,CACzE,CAAA;QACH,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,UAAqC,EACrC,UAAmC,EAAE;QAErC,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;YACpD,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;QAEhB,KAAK,MAAM,SAAS,IAAI,oBAAoB,EAAE,CAAC;YAC7C,MAAM,IAAI,CAAC,gBAAgB,CAAC;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CAAC,IAAI,CACtC,CAAC,QAAQ,EAAE,EAAE,CAAE,QAAgB,CAAC,YAAY,KAAK,YAAY,CAC9D,CAAA;YAED,IAAI,iBAAiB,EAAE,CAAC;gBACtB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,iBAAwB,CAAC,CAAA;YACzD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;QAC3C,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArND,uCAqNC"}
@@ -0,0 +1 @@
1
+ {"root":["../src/index.ts","../src/initialize/index.ts","../src/loaders/index.ts","../src/services/event-bus-local.ts","../src/services/__tests__/event-bus-local.ts"],"version":"5.9.3"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@acmekit/event-bus-local",
3
+ "version": "2.13.1",
4
+ "description": "Local Event Bus Module for AcmeKit",
5
+ "main": "dist/index.js",
6
+ "files": [
7
+ "dist",
8
+ "!dist/**/__tests__",
9
+ "!dist/**/__mocks__",
10
+ "!dist/**/__fixtures__"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/acmekit/acmekit",
15
+ "directory": "packages/modules/event-bus-local"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "engines": {
21
+ "node": ">=20"
22
+ },
23
+ "author": "AcmeKit",
24
+ "license": "MIT",
25
+ "devDependencies": {
26
+ "@acmekit/framework": "2.13.1"
27
+ },
28
+ "scripts": {
29
+ "watch": "yarn run -T tsc --build --watch",
30
+ "build": "yarn run -T rimraf dist && yarn run -T tsc --build",
31
+ "test": "../../../node_modules/.bin/jest --passWithNoTests --testPathPattern=src",
32
+ "test:integration": "../../../node_modules/.bin/jest --passWithNoTests --no-cache --bail --detectOpenHandles --forceExit --logHeapUsage --testPathPattern=\"integration-tests/__tests__/.*\\.spec\\.ts\""
33
+ },
34
+ "peerDependencies": {
35
+ "@acmekit/framework": "2.13.1"
36
+ }
37
+ }