@open-core/framework 1.0.5-beta.2 → 1.0.5
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/adapters/contracts/IEngineEvents.d.ts +3 -3
- package/dist/adapters/contracts/IExports.d.ts +2 -2
- package/dist/adapters/contracts/client/IClientLocalPlayerBridge.d.ts +21 -0
- package/dist/adapters/contracts/client/IClientLocalPlayerBridge.js +6 -0
- package/dist/adapters/contracts/client/IClientRuntimeBridge.d.ts +5 -5
- package/dist/adapters/contracts/client/camera/IClientCameraPort.d.ts +107 -0
- package/dist/adapters/contracts/client/camera/IClientCameraPort.js +8 -0
- package/dist/adapters/contracts/client/camera/index.d.ts +1 -0
- package/dist/adapters/contracts/client/camera/index.js +1 -0
- package/dist/adapters/contracts/client/index.d.ts +4 -0
- package/dist/adapters/contracts/client/index.js +4 -0
- package/dist/adapters/contracts/client/ped/IClientPedPort.d.ts +62 -0
- package/dist/adapters/contracts/client/ped/IClientPedPort.js +5 -0
- package/dist/adapters/contracts/client/ped/index.d.ts +1 -0
- package/dist/adapters/contracts/client/ped/index.js +1 -0
- package/dist/adapters/contracts/client/progress/IClientProgressPort.d.ts +53 -0
- package/dist/adapters/contracts/client/progress/IClientProgressPort.js +8 -0
- package/dist/adapters/contracts/client/progress/index.d.ts +1 -0
- package/dist/adapters/contracts/client/progress/index.js +1 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnBridge.d.ts +5 -6
- package/dist/adapters/contracts/client/spawn/IClientSpawnBridge.js +5 -1
- package/dist/adapters/contracts/client/spawn/IClientSpawnPort.d.ts +19 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnPort.js +2 -0
- package/dist/adapters/contracts/client/spawn/index.d.ts +2 -0
- package/dist/adapters/contracts/client/spawn/index.js +2 -0
- package/dist/adapters/contracts/client/spawn/types.d.ts +3 -0
- package/dist/adapters/contracts/client/ui/webview/IClientWebViewBridge.d.ts +1 -0
- package/dist/adapters/contracts/client/ui/webview/types.d.ts +2 -0
- package/dist/adapters/contracts/client/vehicle/IClientVehiclePort.d.ts +166 -0
- package/dist/adapters/contracts/client/vehicle/IClientVehiclePort.js +8 -0
- package/dist/adapters/contracts/client/vehicle/index.d.ts +1 -0
- package/dist/adapters/contracts/client/vehicle/index.js +1 -0
- package/dist/adapters/contracts/transport/events.api.d.ts +3 -3
- package/dist/adapters/contracts/transport/rpc.api.d.ts +3 -3
- package/dist/adapters/node/transport/node.events.d.ts +4 -4
- package/dist/adapters/node/transport/node.rpc.d.ts +3 -3
- package/dist/adapters/node/transport/node.rpc.js +1 -1
- package/dist/contracts.d.ts +1 -0
- package/dist/contracts.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/kernel/logger/client-log-console.js +8 -8
- package/dist/kernel/logger/index.d.ts +1 -1
- package/dist/kernel/logger/index.js +1 -1
- package/dist/kernel/logger/logger.types.d.ts +1 -0
- package/dist/kernel/logger/logger.types.js +35 -0
- package/dist/kernel/logger/transports/buffered.transport.js +4 -4
- package/dist/kernel/logger/transports/console.transport.js +2 -2
- package/dist/kernel/logger/transports/simple-console.transport.js +2 -2
- package/dist/runtime/client/adapter/index.d.ts +5 -0
- package/dist/runtime/client/adapter/index.js +5 -0
- package/dist/runtime/client/adapter/node-camera-port.d.ts +19 -0
- package/dist/runtime/client/adapter/node-camera-port.js +31 -0
- package/dist/runtime/client/adapter/node-client-adapter.js +15 -1
- package/dist/runtime/client/adapter/node-local-player-bridge.d.ts +3 -0
- package/dist/runtime/client/adapter/node-local-player-bridge.js +9 -0
- package/dist/runtime/client/adapter/node-log-console.js +8 -8
- package/dist/runtime/client/adapter/node-ped-port.d.ts +20 -0
- package/dist/runtime/client/adapter/node-ped-port.js +38 -0
- package/dist/runtime/client/adapter/node-progress-port.d.ts +8 -0
- package/dist/runtime/client/adapter/node-progress-port.js +27 -0
- package/dist/runtime/client/adapter/node-runtime-bridge.d.ts +2 -4
- package/dist/runtime/client/adapter/node-spawn-bridge.d.ts +5 -5
- package/dist/runtime/client/adapter/node-spawn-bridge.js +8 -4
- package/dist/runtime/client/adapter/node-vehicle-port.d.ts +31 -0
- package/dist/runtime/client/adapter/node-vehicle-port.js +73 -0
- package/dist/runtime/client/adapter/node-webview-bridge.d.ts +1 -0
- package/dist/runtime/client/adapter/node-webview-bridge.js +2 -0
- package/dist/runtime/client/controllers/appearance.controller.d.ts +3 -3
- package/dist/runtime/client/controllers/appearance.controller.js +11 -10
- package/dist/runtime/client/controllers/spawner.controller.js +4 -3
- package/dist/runtime/client/services/camera.d.ts +4 -26
- package/dist/runtime/client/services/camera.js +21 -27
- package/dist/runtime/client/services/notification.service.d.ts +3 -3
- package/dist/runtime/client/services/notification.service.js +7 -7
- package/dist/runtime/client/services/ped.service.d.ts +6 -21
- package/dist/runtime/client/services/ped.service.js +31 -78
- package/dist/runtime/client/services/progress.service.d.ts +4 -50
- package/dist/runtime/client/services/progress.service.js +11 -143
- package/dist/runtime/client/services/session-bridge.service.js +3 -2
- package/dist/runtime/client/services/spawn.service.d.ts +3 -5
- package/dist/runtime/client/services/spawn.service.js +12 -17
- package/dist/runtime/client/services/vehicle-client.service.d.ts +3 -3
- package/dist/runtime/client/services/vehicle-client.service.js +43 -143
- package/dist/runtime/client/services/vehicle.service.d.ts +4 -41
- package/dist/runtime/client/services/vehicle.service.js +24 -130
- package/dist/runtime/client/webview-bridge.d.ts +3 -0
- package/dist/runtime/client/webview-bridge.js +6 -0
- package/dist/runtime/client/webview.service.d.ts +1 -0
- package/dist/runtime/client/webview.service.js +5 -0
- package/dist/runtime/server/adapter/node-player-appearance-lifecycle-server.js +3 -2
- package/dist/runtime/server/adapter/node-player-lifecycle-server.js +4 -3
- package/dist/runtime/server/adapter/node-vehicle-lifecycle-server.js +2 -1
- package/dist/runtime/server/apis/chat.api.js +6 -5
- package/dist/runtime/server/apis/npcs.api.js +2 -1
- package/dist/runtime/server/apis/parallel-compute.api.js +1 -0
- package/dist/runtime/server/apis/vehicle-modification.api.js +6 -4
- package/dist/runtime/server/apis/vehicles.api.js +7 -4
- package/dist/runtime/server/bootstrap.js +13 -12
- package/dist/runtime/server/controllers/command-export.controller.js +4 -2
- package/dist/runtime/server/controllers/remote-command-execution.controller.js +2 -1
- package/dist/runtime/server/controllers/vehicle.controller.js +6 -5
- package/dist/runtime/server/decorators/command.d.ts +2 -0
- package/dist/runtime/server/decorators/command.js +3 -1
- package/dist/runtime/server/entities/npc.d.ts +1 -1
- package/dist/runtime/server/entities/player.d.ts +1 -1
- package/dist/runtime/server/entities/player.js +10 -3
- package/dist/runtime/server/helpers/command-validation.helper.js +20 -7
- package/dist/runtime/server/helpers/function-helper.d.ts +1 -0
- package/dist/runtime/server/helpers/function-helper.js +15 -8
- package/dist/runtime/server/implementations/local/channel.local.d.ts +1 -1
- package/dist/runtime/server/implementations/local/channel.local.js +3 -2
- package/dist/runtime/server/ports/channel.api-port.d.ts +1 -1
- package/dist/runtime/server/services/parallel/worker-pool.d.ts +1 -1
- package/dist/runtime/server/services/parallel/worker-pool.js +38 -6
- package/dist/runtime/server/services/parallel/worker.js +1 -0
- package/dist/runtime/server/system/schema-generator.d.ts +1 -1
- package/dist/runtime/server/system/schema-generator.js +6 -3
- package/dist/runtime/shared/helpers/process-tuple-schema.js +3 -0
- package/dist/runtime/shared/types/system-types.d.ts +55 -0
- package/dist/runtime/shared/types/system-types.js +54 -0
- package/package.json +21 -11
|
@@ -12,6 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
import { EventsAPI } from '../../../../adapters/contracts/transport/events.api';
|
|
14
14
|
import { inject, injectable } from 'tsyringe';
|
|
15
|
+
import { SYSTEM_EVENTS } from '../../../shared/types/system-types';
|
|
15
16
|
import { Channels } from '../../ports/channel.api-port';
|
|
16
17
|
import { ChannelType } from '../../types';
|
|
17
18
|
import { Players } from '../../ports/players.api-port';
|
|
@@ -96,7 +97,7 @@ let LocalChannelImplementation = class LocalChannelImplementation extends Channe
|
|
|
96
97
|
if (targetIds.length === 0) {
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
|
-
this.events.emit(
|
|
100
|
+
this.events.emit(SYSTEM_EVENTS.chat.addMessage, targetIds, {
|
|
100
101
|
args: [author ?? sender.name, message],
|
|
101
102
|
color: color,
|
|
102
103
|
});
|
|
@@ -111,7 +112,7 @@ let LocalChannelImplementation = class LocalChannelImplementation extends Channe
|
|
|
111
112
|
if (targetIds.length === 0) {
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
|
-
this.events.emit(
|
|
115
|
+
this.events.emit(SYSTEM_EVENTS.chat.addMessage, targetIds, {
|
|
115
116
|
args: [author, message],
|
|
116
117
|
color: color,
|
|
117
118
|
});
|
|
@@ -23,7 +23,7 @@ export declare class WorkerPool extends SimpleEventEmitter {
|
|
|
23
23
|
private workerIdCounter;
|
|
24
24
|
private cleanupInterval;
|
|
25
25
|
private isShuttingDown;
|
|
26
|
-
private
|
|
26
|
+
private workerSource;
|
|
27
27
|
constructor(config?: Partial<WorkerPoolConfig>);
|
|
28
28
|
/**
|
|
29
29
|
* Check if using native workers
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Tasks are executed in `node:worker_threads` and communicated through
|
|
6
6
|
* structured-cloned messages.
|
|
7
7
|
*/
|
|
8
|
-
import * as path from 'node:path';
|
|
9
8
|
import { Worker } from 'node:worker_threads';
|
|
10
9
|
const DEFAULT_CONFIG = {
|
|
11
10
|
minWorkers: 0,
|
|
@@ -56,9 +55,9 @@ class NativeWorker {
|
|
|
56
55
|
currentTask = null;
|
|
57
56
|
worker;
|
|
58
57
|
pendingResponses = new Map();
|
|
59
|
-
constructor(id,
|
|
58
|
+
constructor(id, workerSource, callbacks) {
|
|
60
59
|
this.id = id;
|
|
61
|
-
this.worker = new Worker(
|
|
60
|
+
this.worker = new Worker(workerSource, { eval: true });
|
|
62
61
|
this.worker.on('message', (response) => {
|
|
63
62
|
const handlers = this.pendingResponses.get(response.id);
|
|
64
63
|
if (handlers) {
|
|
@@ -149,11 +148,44 @@ export class WorkerPool extends SimpleEventEmitter {
|
|
|
149
148
|
workerIdCounter = 0;
|
|
150
149
|
cleanupInterval = null;
|
|
151
150
|
isShuttingDown = false;
|
|
152
|
-
|
|
151
|
+
workerSource;
|
|
153
152
|
constructor(config = {}) {
|
|
154
153
|
super();
|
|
155
154
|
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
156
|
-
this.
|
|
155
|
+
this.workerSource = `
|
|
156
|
+
const { parentPort } = require('worker_threads')
|
|
157
|
+
const { performance } = require('perf_hooks')
|
|
158
|
+
|
|
159
|
+
if (!parentPort) {
|
|
160
|
+
throw new Error('native worker must be executed inside a Worker thread')
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function executeCompute(functionBody, input) {
|
|
164
|
+
const fn = new Function('input', 'return (' + functionBody + ')(input)')
|
|
165
|
+
return fn(input)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
parentPort.on('message', (message) => {
|
|
169
|
+
const startTime = performance.now()
|
|
170
|
+
|
|
171
|
+
try {
|
|
172
|
+
const result = executeCompute(message.functionBody, message.input)
|
|
173
|
+
parentPort.postMessage({
|
|
174
|
+
id: message.id,
|
|
175
|
+
success: true,
|
|
176
|
+
result,
|
|
177
|
+
executionTime: performance.now() - startTime,
|
|
178
|
+
})
|
|
179
|
+
} catch (error) {
|
|
180
|
+
parentPort.postMessage({
|
|
181
|
+
id: message.id,
|
|
182
|
+
success: false,
|
|
183
|
+
error: error instanceof Error ? error.message : String(error),
|
|
184
|
+
executionTime: performance.now() - startTime,
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
`;
|
|
157
189
|
// Start cleanup interval
|
|
158
190
|
this.cleanupInterval = setInterval(() => this.cleanupIdleWorkers(), 10000);
|
|
159
191
|
// Spawn minimum workers
|
|
@@ -261,7 +293,7 @@ export class WorkerPool extends SimpleEventEmitter {
|
|
|
261
293
|
spawnWorker() {
|
|
262
294
|
try {
|
|
263
295
|
const id = this.workerIdCounter++;
|
|
264
|
-
const worker = new NativeWorker(id, this.
|
|
296
|
+
const worker = new NativeWorker(id, this.workerSource, {
|
|
265
297
|
onExit: (workerId, code) => {
|
|
266
298
|
const existing = this.workers.get(workerId);
|
|
267
299
|
if (!existing)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
export declare function generateSchemaFromTypes(paramTypes: any[]): z.ZodTuple | undefined;
|
|
2
|
+
export declare function generateSchemaFromTypes(paramTypes: any[], defaultParams?: boolean[]): z.ZodTuple | undefined;
|
|
@@ -19,7 +19,10 @@ function typeToZodSchema(type) {
|
|
|
19
19
|
return undefined;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
function applyOptional(schema, optional) {
|
|
23
|
+
return optional ? schema.optional() : schema;
|
|
24
|
+
}
|
|
25
|
+
export function generateSchemaFromTypes(paramTypes, defaultParams = []) {
|
|
23
26
|
if (!paramTypes || paramTypes.length === 0)
|
|
24
27
|
return z.tuple([]);
|
|
25
28
|
if (paramTypes[0] !== Player) {
|
|
@@ -28,11 +31,11 @@ export function generateSchemaFromTypes(paramTypes) {
|
|
|
28
31
|
if (paramTypes.length === 1)
|
|
29
32
|
return z.tuple([]);
|
|
30
33
|
const argSchemas = [];
|
|
31
|
-
for (const t of paramTypes.slice(1)) {
|
|
34
|
+
for (const [index, t] of paramTypes.slice(1).entries()) {
|
|
32
35
|
const s = typeToZodSchema(t);
|
|
33
36
|
if (!s)
|
|
34
37
|
return undefined;
|
|
35
|
-
argSchemas.push(s);
|
|
38
|
+
argSchemas.push(applyOptional(s, defaultParams[index + 1] ?? false));
|
|
36
39
|
}
|
|
37
40
|
return z.tuple(argSchemas);
|
|
38
41
|
}
|
|
@@ -25,5 +25,8 @@ export function processTupleSchema(schema, args) {
|
|
|
25
25
|
return [...positional, [args[positionalCount]]];
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
if (args.length < items.length) {
|
|
29
|
+
return [...args, ...Array.from({ length: items.length - args.length }, () => undefined)];
|
|
30
|
+
}
|
|
28
31
|
return args;
|
|
29
32
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
type ValueOf<T> = T[keyof T];
|
|
2
|
+
declare const SYSTEM_EVENT_NAMESPACE = "opencore";
|
|
3
|
+
export type RemoteCommandExecuteEventName = `${typeof SYSTEM_EVENT_NAMESPACE}:command:execute:${string}`;
|
|
4
|
+
export declare const buildRemoteCommandExecuteEventName: (resourceName: string) => RemoteCommandExecuteEventName;
|
|
5
|
+
export declare const SYSTEM_EVENTS: {
|
|
6
|
+
readonly core: {
|
|
7
|
+
readonly ready: `_systemcore:${string}`;
|
|
8
|
+
readonly requestReady: `_systemcore:${string}`;
|
|
9
|
+
};
|
|
10
|
+
readonly chat: {
|
|
11
|
+
readonly message: `opencore:${string}:${string}`;
|
|
12
|
+
readonly addMessage: `opencore:${string}:${string}`;
|
|
13
|
+
readonly send: `opencore:${string}:${string}`;
|
|
14
|
+
readonly clear: `opencore:${string}:${string}`;
|
|
15
|
+
};
|
|
16
|
+
readonly command: {
|
|
17
|
+
readonly execute: `opencore:${string}:${string}`;
|
|
18
|
+
};
|
|
19
|
+
readonly spawner: {
|
|
20
|
+
readonly spawn: `opencore:${string}:${string}`;
|
|
21
|
+
readonly teleport: `opencore:${string}:${string}`;
|
|
22
|
+
readonly respawn: `opencore:${string}:${string}`;
|
|
23
|
+
};
|
|
24
|
+
readonly appearance: {
|
|
25
|
+
readonly apply: `opencore:${string}:${string}`;
|
|
26
|
+
readonly reset: `opencore:${string}:${string}`;
|
|
27
|
+
};
|
|
28
|
+
readonly vehicle: {
|
|
29
|
+
readonly create: `opencore:${string}:${string}`;
|
|
30
|
+
readonly createResult: `opencore:${string}:${string}`;
|
|
31
|
+
readonly delete: `opencore:${string}:${string}`;
|
|
32
|
+
readonly deleteResult: `opencore:${string}:${string}`;
|
|
33
|
+
readonly repair: `opencore:${string}:${string}`;
|
|
34
|
+
readonly repairResult: `opencore:${string}:${string}`;
|
|
35
|
+
readonly repaired: `opencore:${string}:${string}`;
|
|
36
|
+
readonly setLocked: `opencore:${string}:${string}`;
|
|
37
|
+
readonly getData: `opencore:${string}:${string}`;
|
|
38
|
+
readonly dataResult: `opencore:${string}:${string}`;
|
|
39
|
+
readonly getPlayerVehicles: `opencore:${string}:${string}`;
|
|
40
|
+
readonly playerVehiclesResult: `opencore:${string}:${string}`;
|
|
41
|
+
readonly created: `opencore:${string}:${string}`;
|
|
42
|
+
readonly deleted: `opencore:${string}:${string}`;
|
|
43
|
+
readonly modified: `opencore:${string}:${string}`;
|
|
44
|
+
readonly warpInto: `opencore:${string}:${string}`;
|
|
45
|
+
};
|
|
46
|
+
readonly npc: {
|
|
47
|
+
readonly deleted: `opencore:${string}:${string}`;
|
|
48
|
+
};
|
|
49
|
+
readonly session: {
|
|
50
|
+
readonly playerInit: `opencore:${string}:${string}`;
|
|
51
|
+
readonly teleportTo: `opencore:${string}:${string}`;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export type SystemEventName = ValueOf<ValueOf<typeof SYSTEM_EVENTS>>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const SYSTEM_EVENT_NAMESPACE = 'opencore';
|
|
2
|
+
const SYSTEM_CORE_EVENT_NAMESPACE = '_systemcore';
|
|
3
|
+
const systemEvent = (scope, action) => `${SYSTEM_EVENT_NAMESPACE}:${scope}:${action}`;
|
|
4
|
+
const systemCoreEvent = (action) => `${SYSTEM_CORE_EVENT_NAMESPACE}:${action}`;
|
|
5
|
+
export const buildRemoteCommandExecuteEventName = (resourceName) => `${SYSTEM_EVENTS.command.execute}:${resourceName}`;
|
|
6
|
+
export const SYSTEM_EVENTS = {
|
|
7
|
+
core: {
|
|
8
|
+
ready: systemCoreEvent('ready'),
|
|
9
|
+
requestReady: systemCoreEvent('request-ready'),
|
|
10
|
+
},
|
|
11
|
+
chat: {
|
|
12
|
+
message: systemEvent('chat', 'message'),
|
|
13
|
+
addMessage: systemEvent('chat', 'addMessage'),
|
|
14
|
+
send: systemEvent('chat', 'send'),
|
|
15
|
+
clear: systemEvent('chat', 'clear'),
|
|
16
|
+
},
|
|
17
|
+
command: {
|
|
18
|
+
execute: systemEvent('command', 'execute'),
|
|
19
|
+
},
|
|
20
|
+
spawner: {
|
|
21
|
+
spawn: systemEvent('spawner', 'spawn'),
|
|
22
|
+
teleport: systemEvent('spawner', 'teleport'),
|
|
23
|
+
respawn: systemEvent('spawner', 'respawn'),
|
|
24
|
+
},
|
|
25
|
+
appearance: {
|
|
26
|
+
apply: systemEvent('appearance', 'apply'),
|
|
27
|
+
reset: systemEvent('appearance', 'reset'),
|
|
28
|
+
},
|
|
29
|
+
vehicle: {
|
|
30
|
+
create: systemEvent('vehicle', 'create'),
|
|
31
|
+
createResult: systemEvent('vehicle', 'createResult'),
|
|
32
|
+
delete: systemEvent('vehicle', 'delete'),
|
|
33
|
+
deleteResult: systemEvent('vehicle', 'deleteResult'),
|
|
34
|
+
repair: systemEvent('vehicle', 'repair'),
|
|
35
|
+
repairResult: systemEvent('vehicle', 'repairResult'),
|
|
36
|
+
repaired: systemEvent('vehicle', 'repaired'),
|
|
37
|
+
setLocked: systemEvent('vehicle', 'setLocked'),
|
|
38
|
+
getData: systemEvent('vehicle', 'getData'),
|
|
39
|
+
dataResult: systemEvent('vehicle', 'dataResult'),
|
|
40
|
+
getPlayerVehicles: systemEvent('vehicle', 'getPlayerVehicles'),
|
|
41
|
+
playerVehiclesResult: systemEvent('vehicle', 'playerVehiclesResult'),
|
|
42
|
+
created: systemEvent('vehicle', 'created'),
|
|
43
|
+
deleted: systemEvent('vehicle', 'deleted'),
|
|
44
|
+
modified: systemEvent('vehicle', 'modified'),
|
|
45
|
+
warpInto: systemEvent('vehicle', 'warpInto'),
|
|
46
|
+
},
|
|
47
|
+
npc: {
|
|
48
|
+
deleted: systemEvent('npc', 'deleted'),
|
|
49
|
+
},
|
|
50
|
+
session: {
|
|
51
|
+
playerInit: systemEvent('player', 'sessionInit'),
|
|
52
|
+
teleportTo: systemEvent('player', 'teleportTo'),
|
|
53
|
+
},
|
|
54
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-core/framework",
|
|
3
|
-
"version": "1.0.5
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Secure, event-driven TypeScript Framework & Runtime engine for CitizenFX (Cfx).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -75,12 +75,15 @@
|
|
|
75
75
|
"bench": "npx tsx benchmark/index.ts",
|
|
76
76
|
"bench:core": "npx tsx benchmark/index.ts --core",
|
|
77
77
|
"bench:load": "npx vitest run --project benchmark",
|
|
78
|
-
"bench:all": "npx tsx benchmark/index.ts --all"
|
|
78
|
+
"bench:all": "npx tsx benchmark/index.ts --all",
|
|
79
|
+
"validate": "pnpm check && pnpm typecheck && pnpm test",
|
|
80
|
+
"lint-staged": "lint-staged",
|
|
81
|
+
"prepare": "husky"
|
|
79
82
|
},
|
|
80
83
|
"keywords": [
|
|
81
84
|
"framework",
|
|
82
85
|
"opencore",
|
|
83
|
-
"
|
|
86
|
+
"ragemp",
|
|
84
87
|
"citizenfx",
|
|
85
88
|
"redm",
|
|
86
89
|
"typescript",
|
|
@@ -88,7 +91,7 @@
|
|
|
88
91
|
],
|
|
89
92
|
"author": "OpenCore Team",
|
|
90
93
|
"license": "MPL-2.0",
|
|
91
|
-
"packageManager": "pnpm@10.
|
|
94
|
+
"packageManager": "pnpm@10.33.0",
|
|
92
95
|
"peerDependencies": {
|
|
93
96
|
"reflect-metadata": "^0.2.2",
|
|
94
97
|
"tsyringe": "^4.10.0",
|
|
@@ -98,16 +101,23 @@
|
|
|
98
101
|
"uuid": "^13.0.0"
|
|
99
102
|
},
|
|
100
103
|
"devDependencies": {
|
|
101
|
-
"@biomejs/biome": "^2.
|
|
102
|
-
"@types/node": "^25.0
|
|
103
|
-
"@vitest/coverage-v8": "^4.
|
|
104
|
-
"dependency-cruiser": "^17.3.
|
|
104
|
+
"@biomejs/biome": "^2.4.8",
|
|
105
|
+
"@types/node": "^25.5.0",
|
|
106
|
+
"@vitest/coverage-v8": "^4.1.1",
|
|
107
|
+
"dependency-cruiser": "^17.3.9",
|
|
105
108
|
"eslint-config-prettier": "^10.1.8",
|
|
106
109
|
"eslint-plugin-import": "^2.32.0",
|
|
107
110
|
"graphviz": "^0.0.9",
|
|
108
|
-
"
|
|
111
|
+
"husky": "^9.1.7",
|
|
112
|
+
"lint-staged": "^16.2.6",
|
|
113
|
+
"tinybench": "^6.0.0",
|
|
109
114
|
"tsx": "^4.21.0",
|
|
110
|
-
"typescript": "^
|
|
111
|
-
"vitest": "^4.
|
|
115
|
+
"typescript": "^6.0.2",
|
|
116
|
+
"vitest": "^4.1.1"
|
|
117
|
+
},
|
|
118
|
+
"lint-staged": {
|
|
119
|
+
"*.{js,cjs,mjs,ts,tsx,json,md}": [
|
|
120
|
+
"biome check --write --no-errors-on-unmatched"
|
|
121
|
+
]
|
|
112
122
|
}
|
|
113
123
|
}
|