@rvoh/psychic-websockets 0.2.4 → 0.3.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/cjs/src/cable/index.js +1 -1
- package/dist/cjs/src/cable/ws.js +1 -1
- package/dist/cjs/src/error/ws/MissingWsRedisConnection.js +1 -1
- package/dist/cjs/src/index.js +5 -5
- package/dist/cjs/src/psychic-app-websockets/cache.js +17 -0
- package/dist/cjs/src/{psychic-application-websockets → psychic-app-websockets}/index.js +8 -8
- package/dist/esm/src/cable/index.js +6 -6
- package/dist/esm/src/cable/ws.js +3 -3
- package/dist/esm/src/error/ws/MissingWsRedisConnection.js +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/psychic-app-websockets/cache.js +12 -0
- package/dist/esm/src/{psychic-application-websockets → psychic-app-websockets}/index.js +8 -8
- package/dist/types/src/cable/index.d.ts +4 -4
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/psychic-app-websockets/cache.d.ts +4 -0
- package/dist/types/src/{psychic-application-websockets → psychic-app-websockets}/index.d.ts +12 -12
- package/package.json +11 -11
- package/dist/cjs/src/psychic-application-websockets/cache.js +0 -17
- package/dist/esm/src/psychic-application-websockets/cache.js +0 -12
- package/dist/types/src/psychic-application-websockets/cache.d.ts +0 -4
|
@@ -6,7 +6,7 @@ const socketio = require("socket.io");
|
|
|
6
6
|
const yoctocolors_1 = require("yoctocolors");
|
|
7
7
|
const MissingWsRedisConnection_js_1 = require("../error/ws/MissingWsRedisConnection.js");
|
|
8
8
|
const EnvInternal_js_1 = require("../helpers/EnvInternal.js");
|
|
9
|
-
const index_js_1 = require("../psychic-
|
|
9
|
+
const index_js_1 = require("../psychic-app-websockets/index.js");
|
|
10
10
|
class Cable {
|
|
11
11
|
app;
|
|
12
12
|
io;
|
package/dist/cjs/src/cable/ws.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.InvalidWsPathError = void 0;
|
|
|
4
4
|
const dream_1 = require("@rvoh/dream");
|
|
5
5
|
const redis_emitter_1 = require("@socket.io/redis-emitter");
|
|
6
6
|
const EnvInternal_js_1 = require("../helpers/EnvInternal.js");
|
|
7
|
-
const index_js_1 = require("../psychic-
|
|
7
|
+
const index_js_1 = require("../psychic-app-websockets/index.js");
|
|
8
8
|
const redisWsKey_js_1 = require("./redisWsKey.js");
|
|
9
9
|
class Ws {
|
|
10
10
|
allowedPaths;
|
|
@@ -11,7 +11,7 @@ In conf/app.ts, either:
|
|
|
11
11
|
1.) disable websockets by omitting the call to psy.set('websockets', ...), OR
|
|
12
12
|
2.) provide a redis connection for your websockets, as shown below:
|
|
13
13
|
|
|
14
|
-
export default async (psy:
|
|
14
|
+
export default async (psy: PsychicApp) => {
|
|
15
15
|
...
|
|
16
16
|
|
|
17
17
|
psy.set('websockets', {
|
package/dist/cjs/src/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var index_js_1 = require("./
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
var index_js_2 = require("./cable/index.js");
|
|
7
|
-
Object.defineProperty(exports, "Cable", { enumerable: true, get: function () { return index_js_2.default; } });
|
|
3
|
+
exports.PsychicAppWebsockets = exports.Ws = exports.Cable = void 0;
|
|
4
|
+
var index_js_1 = require("./cable/index.js");
|
|
5
|
+
Object.defineProperty(exports, "Cable", { enumerable: true, get: function () { return index_js_1.default; } });
|
|
8
6
|
var ws_js_1 = require("./cable/ws.js");
|
|
9
7
|
Object.defineProperty(exports, "Ws", { enumerable: true, get: function () { return ws_js_1.default; } });
|
|
8
|
+
var index_js_2 = require("./psychic-app-websockets/index.js");
|
|
9
|
+
Object.defineProperty(exports, "PsychicAppWebsockets", { enumerable: true, get: function () { return index_js_2.default; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cachePsychicAppWebsockets = cachePsychicAppWebsockets;
|
|
4
|
+
exports.getCachedPsychicAppWebsockets = getCachedPsychicAppWebsockets;
|
|
5
|
+
exports.getCachedPsychicAppWebsocketsOrFail = getCachedPsychicAppWebsocketsOrFail;
|
|
6
|
+
let _psychicAppWebsockets = undefined;
|
|
7
|
+
function cachePsychicAppWebsockets(psychicAppWebsockets) {
|
|
8
|
+
_psychicAppWebsockets = psychicAppWebsockets;
|
|
9
|
+
}
|
|
10
|
+
function getCachedPsychicAppWebsockets() {
|
|
11
|
+
return _psychicAppWebsockets;
|
|
12
|
+
}
|
|
13
|
+
function getCachedPsychicAppWebsocketsOrFail() {
|
|
14
|
+
if (!_psychicAppWebsockets)
|
|
15
|
+
throw new Error('must call `cachePsychicAppWebsockets` before loading cached psychic application websockets');
|
|
16
|
+
return _psychicAppWebsockets;
|
|
17
|
+
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const index_js_1 = require("../cable/index.js");
|
|
4
4
|
const cache_js_1 = require("./cache.js");
|
|
5
|
-
class
|
|
5
|
+
class PsychicAppWebsockets {
|
|
6
6
|
static async init(psychicApp, cb) {
|
|
7
|
-
const psychicWsApp = new
|
|
7
|
+
const psychicWsApp = new PsychicAppWebsockets(psychicApp);
|
|
8
8
|
await cb(psychicWsApp);
|
|
9
9
|
psychicApp.on('server:shutdown', async (psychicServer) => {
|
|
10
10
|
const cable = psychicServer.$attached.cable;
|
|
@@ -20,17 +20,17 @@ class PsychicApplicationWebsockets {
|
|
|
20
20
|
psychicServer.attach('cable', cable);
|
|
21
21
|
return cable.httpServer;
|
|
22
22
|
});
|
|
23
|
-
(0, cache_js_1.
|
|
23
|
+
(0, cache_js_1.cachePsychicAppWebsockets)(psychicWsApp);
|
|
24
24
|
return psychicWsApp;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Returns the cached psychic application if it has been set.
|
|
28
28
|
* If it has not been set, an exception is raised.
|
|
29
29
|
*
|
|
30
|
-
* The psychic application can be set by calling
|
|
30
|
+
* The psychic application can be set by calling PsychicApp#init
|
|
31
31
|
*/
|
|
32
32
|
static getOrFail() {
|
|
33
|
-
return (0, cache_js_1.
|
|
33
|
+
return (0, cache_js_1.getCachedPsychicAppWebsocketsOrFail)();
|
|
34
34
|
}
|
|
35
35
|
psychicApp;
|
|
36
36
|
static log(...args) {
|
|
@@ -61,7 +61,7 @@ class PsychicApplicationWebsockets {
|
|
|
61
61
|
this._hooks.wsConnect.push(cb);
|
|
62
62
|
break;
|
|
63
63
|
default:
|
|
64
|
-
throw new Error(`unrecognized event provided to
|
|
64
|
+
throw new Error(`unrecognized event provided to PsychicAppWebsockets#on: ${hookEventType}`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
set(option, value) {
|
|
@@ -79,8 +79,8 @@ class PsychicApplicationWebsockets {
|
|
|
79
79
|
};
|
|
80
80
|
break;
|
|
81
81
|
default:
|
|
82
|
-
throw new Error(`Unhandled option type passed to
|
|
82
|
+
throw new Error(`Unhandled option type passed to PsychicAppWebsockets#set: ${option}`);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
exports.default =
|
|
86
|
+
exports.default = PsychicAppWebsockets;
|
|
@@ -4,7 +4,7 @@ import * as socketio from 'socket.io';
|
|
|
4
4
|
import colors from 'yoctocolors';
|
|
5
5
|
import MissingWsRedisConnection from '../error/ws/MissingWsRedisConnection.js';
|
|
6
6
|
import EnvInternal from '../helpers/EnvInternal.js';
|
|
7
|
-
import
|
|
7
|
+
import PsychicAppWebsockets from '../psychic-app-websockets/index.js';
|
|
8
8
|
export default class Cable {
|
|
9
9
|
app;
|
|
10
10
|
io;
|
|
@@ -55,7 +55,7 @@ export default class Cable {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
this.bindToRedis();
|
|
58
|
-
const psychicAppWebsockets =
|
|
58
|
+
const psychicAppWebsockets = PsychicAppWebsockets.getOrFail();
|
|
59
59
|
await this.listen({
|
|
60
60
|
port: parseInt((port || psychicAppWebsockets.psychicApp.port).toString()),
|
|
61
61
|
});
|
|
@@ -80,7 +80,7 @@ export default class Cable {
|
|
|
80
80
|
return new Promise(accept => {
|
|
81
81
|
this.httpServer.listen(port, () => {
|
|
82
82
|
if (!EnvInternal.isTest) {
|
|
83
|
-
const app =
|
|
83
|
+
const app = PsychicAppWebsockets.getOrFail().psychicApp;
|
|
84
84
|
app.logger.info(PsychicServer.asciiLogo());
|
|
85
85
|
app.logger.info('\n');
|
|
86
86
|
app.logger.info(colors.cyan('socket server started '));
|
|
@@ -99,16 +99,16 @@ export default class Cable {
|
|
|
99
99
|
this.redisConnections.push(pubClient);
|
|
100
100
|
this.redisConnections.push(subClient);
|
|
101
101
|
pubClient.on('error', error => {
|
|
102
|
-
|
|
102
|
+
PsychicAppWebsockets.log('PUB CLIENT ERROR', error);
|
|
103
103
|
});
|
|
104
104
|
subClient.on('error', error => {
|
|
105
|
-
|
|
105
|
+
PsychicAppWebsockets.log('sub CLIENT ERROR', error);
|
|
106
106
|
});
|
|
107
107
|
try {
|
|
108
108
|
this.io.adapter(createAdapter(pubClient, subClient));
|
|
109
109
|
}
|
|
110
110
|
catch (error) {
|
|
111
|
-
|
|
111
|
+
PsychicAppWebsockets.log('FAILED TO ADAPT', error);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
package/dist/esm/src/cable/ws.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateTime, uniq } from '@rvoh/dream';
|
|
2
2
|
import { Emitter } from '@socket.io/redis-emitter';
|
|
3
3
|
import EnvInternal from '../helpers/EnvInternal.js';
|
|
4
|
-
import
|
|
4
|
+
import PsychicAppWebsockets from '../psychic-app-websockets/index.js';
|
|
5
5
|
import redisWsKey from './redisWsKey.js';
|
|
6
6
|
export default class Ws {
|
|
7
7
|
allowedPaths;
|
|
@@ -11,7 +11,7 @@ export default class Ws {
|
|
|
11
11
|
namespace;
|
|
12
12
|
redisKeyPrefix;
|
|
13
13
|
static async register(socket, id, redisKeyPrefix = 'user') {
|
|
14
|
-
const psychicWebsocketsApp =
|
|
14
|
+
const psychicWebsocketsApp = PsychicAppWebsockets.getOrFail();
|
|
15
15
|
const redisClient = psychicWebsocketsApp.websocketOptions.connection;
|
|
16
16
|
const interpretedId = id?.isDreamInstance ? id.primaryKeyValue : id;
|
|
17
17
|
const key = redisWsKey(interpretedId, redisKeyPrefix);
|
|
@@ -42,7 +42,7 @@ export default class Ws {
|
|
|
42
42
|
boot() {
|
|
43
43
|
if (this.booted)
|
|
44
44
|
return;
|
|
45
|
-
const psychicWebsocketsApp =
|
|
45
|
+
const psychicWebsocketsApp = PsychicAppWebsockets.getOrFail();
|
|
46
46
|
this.redisClient = psychicWebsocketsApp.websocketOptions.connection;
|
|
47
47
|
this.io = new Emitter(this.redisClient).of(this.namespace);
|
|
48
48
|
this.booted = true;
|
|
@@ -9,7 +9,7 @@ In conf/app.ts, either:
|
|
|
9
9
|
1.) disable websockets by omitting the call to psy.set('websockets', ...), OR
|
|
10
10
|
2.) provide a redis connection for your websockets, as shown below:
|
|
11
11
|
|
|
12
|
-
export default async (psy:
|
|
12
|
+
export default async (psy: PsychicApp) => {
|
|
13
13
|
...
|
|
14
14
|
|
|
15
15
|
psy.set('websockets', {
|
package/dist/esm/src/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as PsychicApplicationWebsockets } from './psychic-application-websockets/index.js';
|
|
2
1
|
export { default as Cable } from './cable/index.js';
|
|
3
2
|
export { default as Ws } from './cable/ws.js';
|
|
3
|
+
export { default as PsychicAppWebsockets } from './psychic-app-websockets/index.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
let _psychicAppWebsockets = undefined;
|
|
2
|
+
export function cachePsychicAppWebsockets(psychicAppWebsockets) {
|
|
3
|
+
_psychicAppWebsockets = psychicAppWebsockets;
|
|
4
|
+
}
|
|
5
|
+
export function getCachedPsychicAppWebsockets() {
|
|
6
|
+
return _psychicAppWebsockets;
|
|
7
|
+
}
|
|
8
|
+
export function getCachedPsychicAppWebsocketsOrFail() {
|
|
9
|
+
if (!_psychicAppWebsockets)
|
|
10
|
+
throw new Error('must call `cachePsychicAppWebsockets` before loading cached psychic application websockets');
|
|
11
|
+
return _psychicAppWebsockets;
|
|
12
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Cable from '../cable/index.js';
|
|
2
|
-
import {
|
|
3
|
-
export default class
|
|
2
|
+
import { cachePsychicAppWebsockets, getCachedPsychicAppWebsocketsOrFail } from './cache.js';
|
|
3
|
+
export default class PsychicAppWebsockets {
|
|
4
4
|
static async init(psychicApp, cb) {
|
|
5
|
-
const psychicWsApp = new
|
|
5
|
+
const psychicWsApp = new PsychicAppWebsockets(psychicApp);
|
|
6
6
|
await cb(psychicWsApp);
|
|
7
7
|
psychicApp.on('server:shutdown', async (psychicServer) => {
|
|
8
8
|
const cable = psychicServer.$attached.cable;
|
|
@@ -18,17 +18,17 @@ export default class PsychicApplicationWebsockets {
|
|
|
18
18
|
psychicServer.attach('cable', cable);
|
|
19
19
|
return cable.httpServer;
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
cachePsychicAppWebsockets(psychicWsApp);
|
|
22
22
|
return psychicWsApp;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Returns the cached psychic application if it has been set.
|
|
26
26
|
* If it has not been set, an exception is raised.
|
|
27
27
|
*
|
|
28
|
-
* The psychic application can be set by calling
|
|
28
|
+
* The psychic application can be set by calling PsychicApp#init
|
|
29
29
|
*/
|
|
30
30
|
static getOrFail() {
|
|
31
|
-
return
|
|
31
|
+
return getCachedPsychicAppWebsocketsOrFail();
|
|
32
32
|
}
|
|
33
33
|
psychicApp;
|
|
34
34
|
static log(...args) {
|
|
@@ -59,7 +59,7 @@ export default class PsychicApplicationWebsockets {
|
|
|
59
59
|
this._hooks.wsConnect.push(cb);
|
|
60
60
|
break;
|
|
61
61
|
default:
|
|
62
|
-
throw new Error(`unrecognized event provided to
|
|
62
|
+
throw new Error(`unrecognized event provided to PsychicAppWebsockets#on: ${hookEventType}`);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
set(option, value) {
|
|
@@ -77,7 +77,7 @@ export default class PsychicApplicationWebsockets {
|
|
|
77
77
|
};
|
|
78
78
|
break;
|
|
79
79
|
default:
|
|
80
|
-
throw new Error(`Unhandled option type passed to
|
|
80
|
+
throw new Error(`Unhandled option type passed to PsychicAppWebsockets#set: ${option}`);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Express } from 'express';
|
|
2
2
|
import * as http from 'http';
|
|
3
3
|
import * as socketio from 'socket.io';
|
|
4
|
-
import
|
|
4
|
+
import PsychicAppWebsockets from '../psychic-app-websockets/index.js';
|
|
5
5
|
export default class Cable {
|
|
6
|
-
app:
|
|
6
|
+
app: Express;
|
|
7
7
|
io: socketio.Server | undefined;
|
|
8
8
|
httpServer: http.Server;
|
|
9
9
|
private config;
|
|
10
10
|
private redisConnections;
|
|
11
|
-
constructor(app:
|
|
11
|
+
constructor(app: Express, config: PsychicAppWebsockets);
|
|
12
12
|
connect(): void;
|
|
13
13
|
start(port?: number): Promise<void>;
|
|
14
14
|
stop(): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as PsychicApplicationWebsockets } from './psychic-application-websockets/index.js';
|
|
2
1
|
export { default as Cable } from './cable/index.js';
|
|
3
2
|
export { default as Ws } from './cable/ws.js';
|
|
3
|
+
export { default as PsychicAppWebsockets } from './psychic-app-websockets/index.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import PsychicAppWebsockets from './index.js';
|
|
2
|
+
export declare function cachePsychicAppWebsockets(psychicAppWebsockets: PsychicAppWebsockets): void;
|
|
3
|
+
export declare function getCachedPsychicAppWebsockets(): PsychicAppWebsockets | undefined;
|
|
4
|
+
export declare function getCachedPsychicAppWebsocketsOrFail(): PsychicAppWebsockets;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PsychicApp } from '@rvoh/psychic';
|
|
2
2
|
import { Cluster, Redis } from 'ioredis';
|
|
3
3
|
import { Socket, Server as SocketServer } from 'socket.io';
|
|
4
|
-
export default class
|
|
5
|
-
static init(psychicApp:
|
|
4
|
+
export default class PsychicAppWebsockets {
|
|
5
|
+
static init(psychicApp: PsychicApp, cb: (app: PsychicAppWebsockets) => void | Promise<void>): Promise<PsychicAppWebsockets>;
|
|
6
6
|
/**
|
|
7
7
|
* Returns the cached psychic application if it has been set.
|
|
8
8
|
* If it has not been set, an exception is raised.
|
|
9
9
|
*
|
|
10
|
-
* The psychic application can be set by calling
|
|
10
|
+
* The psychic application can be set by calling PsychicApp#init
|
|
11
11
|
*/
|
|
12
|
-
static getOrFail():
|
|
13
|
-
psychicApp:
|
|
14
|
-
static log(...args: Parameters<typeof
|
|
15
|
-
constructor(psychicApp:
|
|
12
|
+
static getOrFail(): PsychicAppWebsockets;
|
|
13
|
+
psychicApp: PsychicApp;
|
|
14
|
+
static log(...args: Parameters<typeof PsychicApp.log>): void;
|
|
15
|
+
constructor(psychicApp: PsychicApp);
|
|
16
16
|
private _websocketOptions;
|
|
17
17
|
get websocketOptions(): PsychicWebsocketOptions & {
|
|
18
18
|
subConnection?: RedisOrRedisClusterConnection;
|
|
19
19
|
};
|
|
20
20
|
private _hooks;
|
|
21
|
-
get hooks():
|
|
21
|
+
get hooks(): PsychicAppWebsocketsHooks;
|
|
22
22
|
on<T extends PsychicWebsocketsHookEventType>(hookEventType: T, cb: T extends 'ws:start' ? (server: SocketServer) => void | Promise<void> : T extends 'ws:connect' ? (socket: Socket) => void | Promise<void> : never): void;
|
|
23
|
-
set<Opt extends
|
|
23
|
+
set<Opt extends PsychicAppWebsocketsOption>(option: Opt, value: unknown): void;
|
|
24
24
|
}
|
|
25
25
|
interface PsychicWebsocketOptions {
|
|
26
26
|
connection: Redis;
|
|
27
27
|
}
|
|
28
|
-
export type
|
|
28
|
+
export type PsychicAppWebsocketsOption = 'websockets';
|
|
29
29
|
export type PsychicWebsocketsHookEventType = 'ws:start' | 'ws:connect';
|
|
30
|
-
export interface
|
|
30
|
+
export interface PsychicAppWebsocketsHooks {
|
|
31
31
|
wsStart: ((server: SocketServer) => void | Promise<void>)[];
|
|
32
32
|
wsConnect: ((socket: Socket) => void | Promise<void>)[];
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@rvoh/psychic-websockets",
|
|
4
4
|
"description": "Websocket system for Psychic applications",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"author": "RVO Health",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"client": "yarn --cwd=./client start",
|
|
27
27
|
"client:fspec": "BROWSER=none VITE_PSYCHIC_ENV=test yarn --cwd=./client start",
|
|
28
|
-
"psy": "NODE_ENV=${NODE_ENV:-test} yarn
|
|
29
|
-
"
|
|
30
|
-
"
|
|
28
|
+
"psy": "NODE_ENV=${NODE_ENV:-test} yarn psy:ts",
|
|
29
|
+
"psy:js": "node ./dist/test-app/src/cli/index.js",
|
|
30
|
+
"psy:ts": "tsx ./test-app/src/cli/index.ts",
|
|
31
31
|
"build": "echo \"building cjs...\" && rm -rf dist && npx tsc -p ./tsconfig.cjs.build.json && echo \"building esm...\" && npx tsc -p ./tsconfig.esm.build.json",
|
|
32
32
|
"uspec": "vitest --config ./spec/unit/vite.config.ts",
|
|
33
33
|
"fspec": "vitest run --config=./spec/features/vite.config.ts",
|
|
34
34
|
"fspec:hanging": "vitest run --config=./spec/features/vite.config.ts --reporter=hanging-process",
|
|
35
35
|
"format": "yarn run prettier . --write",
|
|
36
36
|
"lint": "yarn run eslint --no-warn-ignored \"src/**/*.ts\" && yarn run prettier . --check",
|
|
37
|
-
"dev": "NODE_ENV=development WORKER_COUNT=0
|
|
37
|
+
"dev": "NODE_ENV=development WORKER_COUNT=0 tsx ./test-app/main.ts",
|
|
38
38
|
"prepack": "yarn build"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@eslint/js": "=9.0.0",
|
|
51
|
-
"@rvoh/dream": "^0.
|
|
52
|
-
"@rvoh/dream-spec-helpers": "^0.2.
|
|
53
|
-
"@rvoh/psychic": "^0.
|
|
54
|
-
"@rvoh/psychic-spec-helpers": "^0.
|
|
51
|
+
"@rvoh/dream": "^0.39.0",
|
|
52
|
+
"@rvoh/dream-spec-helpers": "^0.2.4",
|
|
53
|
+
"@rvoh/psychic": "^0.31.0",
|
|
54
|
+
"@rvoh/psychic-spec-helpers": "^0.6.0",
|
|
55
55
|
"@socket.io/redis-adapter": "^8.3.0",
|
|
56
56
|
"@socket.io/redis-emitter": "^5.1.0",
|
|
57
57
|
"@types/express": "^4",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"socket.io-adapter": "^2.5.5",
|
|
73
73
|
"socket.io-client": "^4.8.1",
|
|
74
74
|
"supertest": "^7.0.0",
|
|
75
|
-
"ts-node": "^10.9.2",
|
|
76
75
|
"tslib": "^2.7.0",
|
|
76
|
+
"tsx": "^4.19.3",
|
|
77
77
|
"typedoc": "^0.26.6",
|
|
78
78
|
"typescript": "^5.8.2",
|
|
79
79
|
"typescript-eslint": "=7.18.0",
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"yoctocolors": "^2.1.1"
|
|
85
85
|
}
|
|
86
|
-
}
|
|
86
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cachePsychicApplicationWebsockets = cachePsychicApplicationWebsockets;
|
|
4
|
-
exports.getCachedPsychicApplicationWebsockets = getCachedPsychicApplicationWebsockets;
|
|
5
|
-
exports.getCachedPsychicApplicationWebsocketsOrFail = getCachedPsychicApplicationWebsocketsOrFail;
|
|
6
|
-
let _psychicAppWebsockets = undefined;
|
|
7
|
-
function cachePsychicApplicationWebsockets(psychicAppWebsockets) {
|
|
8
|
-
_psychicAppWebsockets = psychicAppWebsockets;
|
|
9
|
-
}
|
|
10
|
-
function getCachedPsychicApplicationWebsockets() {
|
|
11
|
-
return _psychicAppWebsockets;
|
|
12
|
-
}
|
|
13
|
-
function getCachedPsychicApplicationWebsocketsOrFail() {
|
|
14
|
-
if (!_psychicAppWebsockets)
|
|
15
|
-
throw new Error('must call `cachePsychicApplicationWebsockets` before loading cached psychic application websockets');
|
|
16
|
-
return _psychicAppWebsockets;
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
let _psychicAppWebsockets = undefined;
|
|
2
|
-
export function cachePsychicApplicationWebsockets(psychicAppWebsockets) {
|
|
3
|
-
_psychicAppWebsockets = psychicAppWebsockets;
|
|
4
|
-
}
|
|
5
|
-
export function getCachedPsychicApplicationWebsockets() {
|
|
6
|
-
return _psychicAppWebsockets;
|
|
7
|
-
}
|
|
8
|
-
export function getCachedPsychicApplicationWebsocketsOrFail() {
|
|
9
|
-
if (!_psychicAppWebsockets)
|
|
10
|
-
throw new Error('must call `cachePsychicApplicationWebsockets` before loading cached psychic application websockets');
|
|
11
|
-
return _psychicAppWebsockets;
|
|
12
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import PsychicApplicationWebsockets from './index.js';
|
|
2
|
-
export declare function cachePsychicApplicationWebsockets(psychicAppWebsockets: PsychicApplicationWebsockets): void;
|
|
3
|
-
export declare function getCachedPsychicApplicationWebsockets(): PsychicApplicationWebsockets | undefined;
|
|
4
|
-
export declare function getCachedPsychicApplicationWebsocketsOrFail(): PsychicApplicationWebsockets;
|