@venizia/ignis-worker 0.2.0-7 → 0.2.0-9
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/cjs/transport/in-process.d.ts +2 -1
- package/dist/cjs/transport/in-process.d.ts.map +1 -1
- package/dist/cjs/transport/in-process.js +3 -1
- package/dist/cjs/transport/in-process.js.map +1 -1
- package/dist/esm/transport/in-process.d.ts +2 -1
- package/dist/esm/transport/in-process.d.ts.map +1 -1
- package/dist/esm/transport/in-process.js +4 -2
- package/dist/esm/transport/in-process.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BaseHelper } from '@venizia/ignis-helpers/core';
|
|
1
2
|
import type { IBffTransport } from './common/types';
|
|
2
3
|
/**
|
|
3
4
|
* No worker, no browser - the seam that makes a BFF testable in-process. It still runs the full
|
|
@@ -9,7 +10,7 @@ import type { IBffTransport } from './common/types';
|
|
|
9
10
|
* What it deliberately does NOT mirror is the timeout: in-process there is no message that can be
|
|
10
11
|
* lost, so a handler either settles or the caller's own test timeout fires.
|
|
11
12
|
*/
|
|
12
|
-
export declare class InProcessBffTransport implements IBffTransport {
|
|
13
|
+
export declare class InProcessBffTransport extends BaseHelper implements IBffTransport {
|
|
13
14
|
private readonly handler;
|
|
14
15
|
private readonly requestIdGenerator;
|
|
15
16
|
constructor(opts: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-process.d.ts","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"in-process.d.ts","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,6BAA6B,CAAC;AAG7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;;GASG;AACH,qBAAa,qBAAsB,SAAQ,UAAW,YAAW,aAAa;IAC5E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAClE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAEhC;gBAES,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;KAAE;IAMhE,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;CAyB3D"}
|
|
@@ -13,8 +13,9 @@ const encode_1 = require("../envelope/encode");
|
|
|
13
13
|
* What it deliberately does NOT mirror is the timeout: in-process there is no message that can be
|
|
14
14
|
* lost, so a handler either settles or the caller's own test timeout fires.
|
|
15
15
|
*/
|
|
16
|
-
class InProcessBffTransport {
|
|
16
|
+
class InProcessBffTransport extends core_1.BaseHelper {
|
|
17
17
|
constructor(opts) {
|
|
18
|
+
super({ scope: InProcessBffTransport.name });
|
|
18
19
|
this.requestIdGenerator = new core_1.RequestIdGenerator({
|
|
19
20
|
scope: InProcessBffTransport.name,
|
|
20
21
|
});
|
|
@@ -33,6 +34,7 @@ class InProcessBffTransport {
|
|
|
33
34
|
responseEnvelope = await encode_1.BffEnvelope.encodeResponse({ response, id });
|
|
34
35
|
}
|
|
35
36
|
catch (error) {
|
|
37
|
+
this.logger.for(this.fetch.name).error('Handler failed | id: %s | error: %s', id, error);
|
|
36
38
|
// Encoded and decoded rather than rethrown: what a UI receives over a real Worker is a
|
|
37
39
|
// rebuilt `ApplicationError` carrying only the normalised shape - never the original object,
|
|
38
40
|
// its stack or its `extra`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-process.js","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"in-process.js","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":";;;AAAA,sDAA6E;AAC7E,8CAAgD;AAIhD;;;;;;;;;G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AK,EAAE,CAAC,EAAE,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,oBAAW,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACpE,CAAC;CACF;AArCD,sDAqCC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BaseHelper } from '@venizia/ignis-helpers/core';
|
|
1
2
|
import type { IBffTransport } from './common/types.js';
|
|
2
3
|
/**
|
|
3
4
|
* No worker, no browser - the seam that makes a BFF testable in-process. It still runs the full
|
|
@@ -9,7 +10,7 @@ import type { IBffTransport } from './common/types.js';
|
|
|
9
10
|
* What it deliberately does NOT mirror is the timeout: in-process there is no message that can be
|
|
10
11
|
* lost, so a handler either settles or the caller's own test timeout fires.
|
|
11
12
|
*/
|
|
12
|
-
export declare class InProcessBffTransport implements IBffTransport {
|
|
13
|
+
export declare class InProcessBffTransport extends BaseHelper implements IBffTransport {
|
|
13
14
|
private readonly handler;
|
|
14
15
|
private readonly requestIdGenerator;
|
|
15
16
|
constructor(opts: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-process.d.ts","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"in-process.d.ts","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,6BAA6B,CAAC;AAG7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;;GASG;AACH,qBAAa,qBAAsB,SAAQ,UAAW,YAAW,aAAa;IAC5E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAClE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAEhC;gBAES,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;KAAE;IAMhE,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;CAyB3D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequestIdGenerator } from '@venizia/ignis-helpers/core';
|
|
1
|
+
import { BaseHelper, RequestIdGenerator } from '@venizia/ignis-helpers/core';
|
|
2
2
|
import { BffEnvelope } from '../envelope/encode.js';
|
|
3
3
|
/**
|
|
4
4
|
* No worker, no browser - the seam that makes a BFF testable in-process. It still runs the full
|
|
@@ -10,8 +10,9 @@ import { BffEnvelope } from '../envelope/encode.js';
|
|
|
10
10
|
* What it deliberately does NOT mirror is the timeout: in-process there is no message that can be
|
|
11
11
|
* lost, so a handler either settles or the caller's own test timeout fires.
|
|
12
12
|
*/
|
|
13
|
-
export class InProcessBffTransport {
|
|
13
|
+
export class InProcessBffTransport extends BaseHelper {
|
|
14
14
|
constructor(opts) {
|
|
15
|
+
super({ scope: InProcessBffTransport.name });
|
|
15
16
|
this.requestIdGenerator = new RequestIdGenerator({
|
|
16
17
|
scope: InProcessBffTransport.name,
|
|
17
18
|
});
|
|
@@ -30,6 +31,7 @@ export class InProcessBffTransport {
|
|
|
30
31
|
responseEnvelope = await BffEnvelope.encodeResponse({ response, id });
|
|
31
32
|
}
|
|
32
33
|
catch (error) {
|
|
34
|
+
this.logger.for(this.fetch.name).error('Handler failed | id: %s | error: %s', id, error);
|
|
33
35
|
// Encoded and decoded rather than rethrown: what a UI receives over a real Worker is a
|
|
34
36
|
// rebuilt `ApplicationError` carrying only the normalised shape - never the original object,
|
|
35
37
|
// its stack or its `extra`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-process.js","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"in-process.js","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":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F,uFAAuF;YACvF,6FAA6F;YAC7F,4BAA4B;YAC5B,MAAM,WAAW,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,WAAW,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACpE,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-worker",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-9",
|
|
4
4
|
"description": "Browser Web Worker host for the IGNIS framework: the request/response envelope, the transport contract, and WorkerApplication - the layer that listens on `onmessage` instead of a socket, so a RestApplication can serve its controllers with no server anywhere.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browser",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"prepublishOnly": "bun run rebuild"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@venizia/ignis-helpers": "^0.2.0-
|
|
78
|
-
"@venizia/ignis-inversion": "^0.2.0-
|
|
79
|
-
"@venizia/ignis-kernel": "^0.2.0-
|
|
77
|
+
"@venizia/ignis-helpers": "^0.2.0-7",
|
|
78
|
+
"@venizia/ignis-inversion": "^0.2.0-3",
|
|
79
|
+
"@venizia/ignis-kernel": "^0.2.0-8",
|
|
80
80
|
"reflect-metadata": "^0.2.2"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/bun": "^1.3.14",
|
|
88
|
-
"@venizia/dev-configs": "^0.2.0-
|
|
88
|
+
"@venizia/dev-configs": "^0.2.0-3",
|
|
89
89
|
"eslint": "^10.7.0",
|
|
90
90
|
"prettier": "^3.9.5",
|
|
91
91
|
"tsc-alias": "^1.9.1",
|