@vielzeug/herald 2.1.0 → 2.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/dist/bus.cjs +1 -1
- package/dist/bus.cjs.map +1 -1
- package/dist/bus.d.ts.map +1 -1
- package/dist/bus.js +108 -82
- package/dist/bus.js.map +1 -1
- package/dist/herald.cjs +1 -1
- package/dist/herald.cjs.map +1 -1
- package/dist/herald.iife.js +1 -1
- package/dist/herald.iife.js.map +1 -1
- package/dist/herald.js +1 -1
- package/dist/herald.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types.d.ts +37 -21
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -9
- package/dist/devtools.cjs +0 -2
- package/dist/devtools.cjs.map +0 -1
- package/dist/devtools.d.ts +0 -34
- package/dist/devtools.d.ts.map +0 -1
- package/dist/devtools.js +0 -16
- package/dist/devtools.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { combineSignals, createBus } from './bus';
|
|
2
2
|
export { BusDisposedError, HeraldConfigError, HeraldError } from './errors';
|
|
3
3
|
export { pipeEvents } from './pipe';
|
|
4
|
-
export type { Bus,
|
|
4
|
+
export type { Bus, BusOptions, EmissionErrorContext, EventKey, EventMap, EventStream, HeraldEvent, Listener, Middleware, PipeableKey, PipeEntry, SubscribeOptions, Unsubscribe, WaitAnyResult, } from './types';
|
|
5
5
|
//# 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,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,YAAY,EACV,GAAG,EACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,YAAY,EACV,GAAG,EACH,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -37,28 +37,34 @@ export type EmissionErrorContext<T extends EventMap = EventMap> = {
|
|
|
37
37
|
*/
|
|
38
38
|
export type Middleware<T extends EventMap = EventMap> = (event: EventKey<T>, payload: unknown, next: () => void) => void;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
40
|
+
* Runtime events emitted by {@link Bus.tap}.
|
|
41
|
+
* Subscribe via `bus.tap(handler)` — handler errors are swallowed.
|
|
42
42
|
*/
|
|
43
|
-
export type
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
export type HeraldEvent<T extends EventMap = EventMap> = {
|
|
44
|
+
readonly event: EventKey<T>;
|
|
45
|
+
readonly listeners: number;
|
|
46
|
+
readonly payload: unknown;
|
|
47
|
+
readonly type: 'emit';
|
|
48
|
+
} | {
|
|
49
|
+
readonly event: EventKey<T>;
|
|
50
|
+
readonly type: 'subscribe';
|
|
51
|
+
} | {
|
|
52
|
+
readonly event: EventKey<T>;
|
|
53
|
+
readonly type: 'unsubscribe';
|
|
54
|
+
} | {
|
|
55
|
+
readonly type: 'subscribe-any';
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: 'unsubscribe-any';
|
|
58
|
+
} | {
|
|
59
|
+
readonly error: unknown;
|
|
60
|
+
readonly event: EventKey<T>;
|
|
61
|
+
readonly type: 'listener-error';
|
|
62
|
+
} | {
|
|
63
|
+
readonly type: 'dispose';
|
|
46
64
|
};
|
|
47
65
|
export type BusOptions<T extends EventMap = EventMap> = {
|
|
48
|
-
/**
|
|
49
|
-
* Custom logger for `debug` and `warn` output.
|
|
50
|
-
* Provide `logger.debug` to enable subscription/emission/disposal logging with `[herald:*]` prefixes.
|
|
51
|
-
* Omit to disable all debug output. Pass `{}` to silence warnings too.
|
|
52
|
-
*
|
|
53
|
-
* Prefer `debugBus()` from `@vielzeug/herald/devtools` over wiring this manually — it passes
|
|
54
|
-
* `console.debug` for you and is tree-shaken from production bundles.
|
|
55
|
-
*
|
|
56
|
-
* **Note:** Event key strings appear in log messages — do not encode sensitive data in event names.
|
|
57
|
-
*/
|
|
58
|
-
logger?: BusLogger;
|
|
59
66
|
/**
|
|
60
67
|
* Warn when a single event's active listener count exceeds this threshold.
|
|
61
|
-
* Output goes to `logger.warn` (default: `console.warn`).
|
|
62
68
|
* Useful for detecting listener leaks during development. Default: no check.
|
|
63
69
|
*/
|
|
64
70
|
maxListeners?: number;
|
|
@@ -69,11 +75,11 @@ export type BusOptions<T extends EventMap = EventMap> = {
|
|
|
69
75
|
middleware?: readonly Middleware<T>[];
|
|
70
76
|
/**
|
|
71
77
|
* Optional display name for this bus instance.
|
|
72
|
-
* Appears in
|
|
73
|
-
* Useful when running multiple buses concurrently to identify which bus produced
|
|
78
|
+
* Appears in `BusDisposedError` messages.
|
|
79
|
+
* Useful when running multiple buses concurrently to identify which bus produced an error.
|
|
74
80
|
*
|
|
75
|
-
* **Note:** The name is embedded in `BusDisposedError` messages
|
|
76
|
-
* sensitive or user-derived values that could leak via error trackers
|
|
81
|
+
* **Note:** The name is embedded in `BusDisposedError` messages — avoid using
|
|
82
|
+
* sensitive or user-derived values that could leak via error trackers.
|
|
77
83
|
*/
|
|
78
84
|
name?: string;
|
|
79
85
|
/**
|
|
@@ -238,5 +244,15 @@ export type Bus<T extends EventMap> = {
|
|
|
238
244
|
* These fire on every emission regardless of event key.
|
|
239
245
|
*/
|
|
240
246
|
wildcardCount(): number;
|
|
247
|
+
/**
|
|
248
|
+
* Observe runtime events (emit, subscribe, unsubscribe, listener-error, dispose) without
|
|
249
|
+
* affecting bus behavior. Handler errors are swallowed. Returns an unsubscribe function.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* bus.tap((event) => console.debug(`herald:${event.type}`, event));
|
|
253
|
+
*/
|
|
254
|
+
tap(handler: (event: HeraldEvent<T>) => void, options?: {
|
|
255
|
+
signal?: AbortSignal;
|
|
256
|
+
}): Unsubscribe;
|
|
241
257
|
};
|
|
242
258
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACpE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;AAC/C,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+FAA+F;IAC/F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAChE,8BAA8B;IAC9B,GAAG,EAAE,OAAO,CAAC;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AAQ,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAC3E,MAAM,EAAE,CAAC,EACT,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC9B,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAChC;;;OAGG;IACH,aAAa,IAAI,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,WAAW,CAAC;CAChG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vielzeug/herald",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Typed event bus — pub/sub with namespaces, wildcards, and once-listeners",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,11 +23,6 @@
|
|
|
23
23
|
"require": "./dist/index.cjs",
|
|
24
24
|
"types": "./dist/index.d.ts"
|
|
25
25
|
},
|
|
26
|
-
"./devtools": {
|
|
27
|
-
"import": "./dist/devtools.js",
|
|
28
|
-
"require": "./dist/devtools.cjs",
|
|
29
|
-
"types": "./dist/devtools.d.ts"
|
|
30
|
-
},
|
|
31
26
|
"./testing": {
|
|
32
27
|
"import": "./dist/testing.js",
|
|
33
28
|
"require": "./dist/testing.cjs",
|
|
@@ -36,14 +31,12 @@
|
|
|
36
31
|
},
|
|
37
32
|
"typesVersions": {
|
|
38
33
|
"*": {
|
|
39
|
-
"devtools": [
|
|
40
|
-
"dist/devtools.d.ts"
|
|
41
|
-
],
|
|
42
34
|
"testing": [
|
|
43
35
|
"dist/testing/index.d.ts"
|
|
44
36
|
]
|
|
45
37
|
}
|
|
46
38
|
},
|
|
39
|
+
"sideEffects": false,
|
|
47
40
|
"publishConfig": {
|
|
48
41
|
"access": "public",
|
|
49
42
|
"registry": "https://registry.npmjs.org/"
|
package/dist/devtools.cjs
DELETED
package/dist/devtools.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.cjs","names":[],"sources":["../src/devtools.ts"],"sourcesContent":["/**\n * @vielzeug/herald — debug utilities for bus visualisation.\n *\n * Import from the dedicated sub-path so it is tree-shaken from production bundles:\n * ```ts\n * import { debugBus } from '@vielzeug/herald/devtools';\n * ```\n */\n\nimport { createBus } from './bus';\nimport type { Bus, BusLogger, BusOptions, EventMap } from './types';\n\n/**\n * Creates a {@link Bus} with debug logging pre-wired to `console.debug`.\n *\n * Equivalent to `createBus({ logger: { debug: console.debug } })` but imported\n * from a dedicated sub-path so `console.debug` references are tree-shaken from\n * production bundles when this sub-path is not imported.\n *\n * Logs subscription registrations/removals, emissions, and disposal with\n * `[herald:*]` prefixes. Pass `logger.warn` to also redirect or silence warnings.\n *\n * @example\n * ```ts\n * import { debugBus } from '@vielzeug/herald/devtools';\n *\n * const bus = debugBus<MyEvents>();\n * // or redirect to a custom logger:\n * const bus = debugBus<MyEvents>({ logger: { warn: myLogger.warn } });\n * ```\n */\nexport function debugBus<T extends EventMap>(\n options?: Omit<BusOptions<T>, 'logger'> & { logger?: { warn?: BusLogger['warn'] } },\n): Bus<T> {\n const { logger, ...rest } = options ?? {};\n\n return createBus<T>({\n ...rest,\n logger: { debug: console.debug, warn: logger?.warn },\n });\n}\n"],"mappings":"gGA+BA,SAAgB,EACd,EACQ,CACR,GAAM,CAAE,SAAQ,GAAG,GAAS,GAAW,CAAC,EAExC,OAAO,EAAA,UAAa,CAClB,GAAG,EACH,OAAQ,CAAE,MAAO,QAAQ,MAAO,KAAM,GAAQ,IAAK,CACrD,CAAC,CACH"}
|
package/dist/devtools.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @vielzeug/herald — debug utilities for bus visualisation.
|
|
3
|
-
*
|
|
4
|
-
* Import from the dedicated sub-path so it is tree-shaken from production bundles:
|
|
5
|
-
* ```ts
|
|
6
|
-
* import { debugBus } from '@vielzeug/herald/devtools';
|
|
7
|
-
* ```
|
|
8
|
-
*/
|
|
9
|
-
import type { Bus, BusLogger, BusOptions, EventMap } from './types';
|
|
10
|
-
/**
|
|
11
|
-
* Creates a {@link Bus} with debug logging pre-wired to `console.debug`.
|
|
12
|
-
*
|
|
13
|
-
* Equivalent to `createBus({ logger: { debug: console.debug } })` but imported
|
|
14
|
-
* from a dedicated sub-path so `console.debug` references are tree-shaken from
|
|
15
|
-
* production bundles when this sub-path is not imported.
|
|
16
|
-
*
|
|
17
|
-
* Logs subscription registrations/removals, emissions, and disposal with
|
|
18
|
-
* `[herald:*]` prefixes. Pass `logger.warn` to also redirect or silence warnings.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* import { debugBus } from '@vielzeug/herald/devtools';
|
|
23
|
-
*
|
|
24
|
-
* const bus = debugBus<MyEvents>();
|
|
25
|
-
* // or redirect to a custom logger:
|
|
26
|
-
* const bus = debugBus<MyEvents>({ logger: { warn: myLogger.warn } });
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function debugBus<T extends EventMap>(options?: Omit<BusOptions<T>, 'logger'> & {
|
|
30
|
-
logger?: {
|
|
31
|
-
warn?: BusLogger['warn'];
|
|
32
|
-
};
|
|
33
|
-
}): Bus<T>;
|
|
34
|
-
//# sourceMappingURL=devtools.d.ts.map
|
package/dist/devtools.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../src/devtools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,QAAQ,EACzC,OAAO,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;KAAE,CAAA;CAAE,GAClF,GAAG,CAAC,CAAC,CAAC,CAOR"}
|
package/dist/devtools.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createBus as e } from "./bus.js";
|
|
2
|
-
//#region src/devtools.ts
|
|
3
|
-
function t(t) {
|
|
4
|
-
let { logger: n, ...r } = t ?? {};
|
|
5
|
-
return e({
|
|
6
|
-
...r,
|
|
7
|
-
logger: {
|
|
8
|
-
debug: console.debug,
|
|
9
|
-
warn: n?.warn
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { t as debugBus };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=devtools.js.map
|
package/dist/devtools.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.js","names":[],"sources":["../src/devtools.ts"],"sourcesContent":["/**\n * @vielzeug/herald — debug utilities for bus visualisation.\n *\n * Import from the dedicated sub-path so it is tree-shaken from production bundles:\n * ```ts\n * import { debugBus } from '@vielzeug/herald/devtools';\n * ```\n */\n\nimport { createBus } from './bus';\nimport type { Bus, BusLogger, BusOptions, EventMap } from './types';\n\n/**\n * Creates a {@link Bus} with debug logging pre-wired to `console.debug`.\n *\n * Equivalent to `createBus({ logger: { debug: console.debug } })` but imported\n * from a dedicated sub-path so `console.debug` references are tree-shaken from\n * production bundles when this sub-path is not imported.\n *\n * Logs subscription registrations/removals, emissions, and disposal with\n * `[herald:*]` prefixes. Pass `logger.warn` to also redirect or silence warnings.\n *\n * @example\n * ```ts\n * import { debugBus } from '@vielzeug/herald/devtools';\n *\n * const bus = debugBus<MyEvents>();\n * // or redirect to a custom logger:\n * const bus = debugBus<MyEvents>({ logger: { warn: myLogger.warn } });\n * ```\n */\nexport function debugBus<T extends EventMap>(\n options?: Omit<BusOptions<T>, 'logger'> & { logger?: { warn?: BusLogger['warn'] } },\n): Bus<T> {\n const { logger, ...rest } = options ?? {};\n\n return createBus<T>({\n ...rest,\n logger: { debug: console.debug, warn: logger?.warn },\n });\n}\n"],"mappings":";;AA+BA,SAAgB,EACd,GACQ;CACR,IAAM,EAAE,WAAQ,GAAG,MAAS,KAAW,CAAC;CAExC,OAAO,EAAa;EAClB,GAAG;EACH,QAAQ;GAAE,OAAO,QAAQ;GAAO,MAAM,GAAQ;EAAK;CACrD,CAAC;AACH"}
|