Compare commits

...
Author SHA1 Message Date
Oleksandr Honcharov 97b094c3d4 v0.0.16-alpha.0 2024-06-11 20:29:42 +03:00
Oleksandr Honcharov acd7ad3406 client / server ragempcommunity types peerDependency 2024-06-11 20:29:07 +03:00
Oleksandr Honcharov 0a81acf49e logger functionality 2024-06-11 20:28:57 +03:00
Oleksandr Honcharov 1b2f0d02ef server logger 2024-06-11 20:27:54 +03:00
10 changed files with 266 additions and 14 deletions
+5 -3
View File
@@ -1,8 +1,8 @@
{
"name": "rage-fw-client",
"version": "0.0.15-alpha.0",
"version": "0.0.16-alpha.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"types": "dist/src/index.d.ts",
"files": [
"dist/**/*"
],
@@ -10,10 +10,12 @@
"build": "tsup"
},
"dependencies": {
"@ragempcommunity/types-client": "^2.1.8",
"rage-fw-shared-types": "workspace:^",
"rage-rpc": "^0.4.0"
},
"peerDependencies": {
"@ragempcommunity/types-client": "^2.1.8"
},
"keywords": [],
"author": "SashaGoncharov19",
"license": "MIT",
+1 -1
View File
@@ -5,7 +5,7 @@ export default defineConfig({
outDir: './dist',
format: ['cjs'],
noExternal: ['rage-rpc'],
dts: true,
experimentalDts: true,
splitting: false,
sourcemap: false,
clean: true,
+1 -1
View File
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.15-alpha.0",
"version": "0.0.16-alpha.0",
"npmClient": "pnpm"
}
+3 -5
View File
@@ -17,10 +17,8 @@
"prettier": "^3.3.1",
"rage-rpc": "^0.4.0",
"tsup": "^8.1.0",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"winston": "^3.13.0"
},
"type": "module",
"devDependencies": {
}
"type": "module"
}
+209
View File
@@ -43,6 +43,9 @@ importers:
typescript:
specifier: ^5.4.5
version: 5.4.5
winston:
specifier: ^3.13.0
version: 3.13.0
client:
dependencies:
@@ -94,6 +97,19 @@ packages:
}
engines: { node: '>=6.9.0' }
'@colors/[email protected]':
resolution:
{
integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==,
}
engines: { node: '>=0.1.90' }
'@dabh/[email protected]':
resolution:
{
integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==,
}
'@esbuild/[email protected]':
resolution:
{
@@ -1061,6 +1077,12 @@ packages:
integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==,
}
'@types/[email protected]':
resolution:
{
integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==,
}
'@typescript-eslint/[email protected]':
resolution:
{
@@ -1694,6 +1716,12 @@ packages:
integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==,
}
[email protected]:
resolution:
{
integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==,
}
[email protected]:
resolution:
{
@@ -1701,6 +1729,18 @@ packages:
}
hasBin: true
[email protected]:
resolution:
{
integrity: sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==,
}
[email protected]:
resolution:
{
integrity: sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==,
}
[email protected]:
resolution:
{
@@ -1988,6 +2028,12 @@ packages:
integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==,
}
[email protected]:
resolution:
{
integrity: sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==,
}
[email protected]:
resolution:
{
@@ -2185,6 +2231,12 @@ packages:
integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==,
}
[email protected]:
resolution:
{
integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==,
}
[email protected]:
resolution:
{
@@ -2253,6 +2305,12 @@ packages:
integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==,
}
[email protected]:
resolution:
{
integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==,
}
[email protected]:
resolution:
{
@@ -2733,6 +2791,12 @@ packages:
integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==,
}
[email protected]:
resolution:
{
integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==,
}
[email protected]:
resolution:
{
@@ -3060,6 +3124,12 @@ packages:
}
engines: { node: '>=0.10.0' }
[email protected]:
resolution:
{
integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==,
}
[email protected]:
resolution:
{
@@ -3182,6 +3252,13 @@ packages:
}
engines: { node: '>=10' }
[email protected]:
resolution:
{
integrity: sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==,
}
engines: { node: '>= 12.0.0' }
[email protected]:
resolution:
{
@@ -3709,6 +3786,12 @@ packages:
integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==,
}
[email protected]:
resolution:
{
integrity: sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==,
}
[email protected]:
resolution:
{
@@ -4357,6 +4440,13 @@ packages:
integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==,
}
[email protected]:
resolution:
{
integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==,
}
engines: { node: '>=10' }
[email protected]:
resolution:
{
@@ -4441,6 +4531,12 @@ packages:
}
engines: { node: ^16.14.0 || >=18.0.0 }
[email protected]:
resolution:
{
integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==,
}
[email protected]:
resolution:
{
@@ -4559,6 +4655,12 @@ packages:
}
engines: { node: ^12.13.0 || ^14.15.0 || >=16.0.0 }
[email protected]:
resolution:
{
integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==,
}
[email protected]:
resolution:
{
@@ -4713,6 +4815,12 @@ packages:
}
engines: { node: '>=0.10' }
[email protected]:
resolution:
{
integrity: sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==,
}
[email protected]:
resolution:
{
@@ -4791,6 +4899,13 @@ packages:
}
engines: { node: '>=8' }
[email protected]:
resolution:
{
integrity: sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==,
}
engines: { node: '>= 14.0.0' }
[email protected]:
resolution:
{
@@ -5065,6 +5180,20 @@ packages:
integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==,
}
[email protected]:
resolution:
{
integrity: sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==,
}
engines: { node: '>= 12.0.0' }
[email protected]:
resolution:
{
integrity: sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==,
}
engines: { node: '>= 12.0.0' }
[email protected]:
resolution:
{
@@ -5210,6 +5339,14 @@ snapshots:
js-tokens: 4.0.0
picocolors: 1.0.1
'@colors/[email protected]': {}
'@dabh/[email protected]':
dependencies:
colorspace: 1.1.4
enabled: 2.0.0
kuler: 2.0.0
'@esbuild/[email protected]':
optional: true
@@ -5827,6 +5964,8 @@ snapshots:
'@types/[email protected]': {}
'@types/[email protected]': {}
'@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])':
dependencies:
'@eslint-community/regexpp': 4.10.1
@@ -6219,8 +6358,23 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
color-name: 1.1.4
simple-swizzle: 0.2.2
[email protected]: {}
[email protected]:
dependencies:
color-convert: 1.9.3
color-string: 1.9.1
[email protected]:
dependencies:
color: 3.2.1
text-hex: 1.0.0
[email protected]:
dependencies:
strip-ansi: 6.0.1
@@ -6380,6 +6534,8 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]:
dependencies:
iconv-lite: 0.6.3
@@ -6545,6 +6701,8 @@ snapshots:
dependencies:
reusify: 1.0.4
[email protected]: {}
[email protected]:
dependencies:
escape-string-regexp: 1.0.5
@@ -6585,6 +6743,8 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]:
@@ -6898,6 +7058,8 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]:
dependencies:
binary-extensions: 2.3.0
@@ -7039,6 +7201,8 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]([email protected]):
dependencies:
'@lerna/create': 8.1.3([email protected])([email protected])
@@ -7196,6 +7360,15 @@ snapshots:
chalk: 4.1.2
is-unicode-supported: 0.1.0
[email protected]:
dependencies:
'@colors/colors': 1.6.0
'@types/triple-beam': 1.3.5
fecha: 4.2.3
ms: 2.1.3
safe-stable-stringify: 2.4.3
triple-beam: 1.4.1
[email protected]: {}
[email protected]:
@@ -7602,6 +7775,10 @@ snapshots:
dependencies:
wrappy: 1.0.2
[email protected]:
dependencies:
fn.name: 1.1.0
[email protected]:
dependencies:
mimic-fn: 2.1.0
@@ -7981,6 +8158,8 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
@@ -8028,6 +8207,10 @@ snapshots:
transitivePeerDependencies:
- supports-color
[email protected]:
dependencies:
is-arrayish: 0.3.2
[email protected]: {}
[email protected]: {}
@@ -8097,6 +8280,8 @@ snapshots:
dependencies:
minipass: 3.3.6
[email protected]: {}
[email protected]: {}
[email protected]:
@@ -8190,6 +8375,8 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]:
@@ -8227,6 +8414,8 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]([email protected]):
dependencies:
typescript: 5.4.5
@@ -8373,6 +8562,26 @@ snapshots:
dependencies:
string-width: 4.2.3
[email protected]:
dependencies:
logform: 2.6.0
readable-stream: 3.6.2
triple-beam: 1.4.1
[email protected]:
dependencies:
'@colors/colors': 1.6.0
'@dabh/diagnostics': 2.0.3
async: 3.2.5
is-stream: 2.0.0
logform: 2.6.0
one-time: 1.0.0
readable-stream: 3.6.2
safe-stable-stringify: 2.4.3
stack-trace: 0.0.10
triple-beam: 1.4.1
winston-transport: 4.7.0
[email protected]: {}
[email protected]: {}
+4 -2
View File
@@ -1,6 +1,6 @@
{
"name": "rage-fw-server",
"version": "0.0.15-alpha.0",
"version": "0.0.16-alpha.0",
"main": "dist/index.js",
"types": "dist/src/index.d.ts",
"files": [
@@ -10,10 +10,12 @@
"build": "tsup"
},
"dependencies": {
"@ragempcommunity/types-server": "^2.1.8",
"rage-fw-shared-types": "workspace:^",
"rage-rpc": "^0.4.0"
},
"peerDependencies": {
"@ragempcommunity/types-server": "^2.1.8"
},
"keywords": [],
"author": "SashaGoncharov19",
"license": "MIT",
+5
View File
@@ -1,5 +1,7 @@
import rpc from 'rage-rpc'
import Logger from './logger'
import type {
RageFW_ClientEvent,
RageFW_ClientEventArguments,
@@ -90,4 +92,7 @@ class Player {
export const fw = {
event: new Server(),
player: new Player(),
system: {
log: new Logger(),
},
}
+36
View File
@@ -0,0 +1,36 @@
import winston, { format } from 'winston'
const { timestamp, printf, colorize } = format
export default class Logger {
private format = printf(({ message, level, timestamp }) => {
return `[${new Date(timestamp).toLocaleTimeString()}] [${level}]: ${message}`
})
private systemLogger = winston.createLogger({
transports: [new winston.transports.Console()],
format: format.combine(
colorize({
level: true,
colors: {
error: 'red',
warn: 'yellow',
info: 'white',
},
}),
timestamp(),
this.format,
),
})
public info(message: unknown) {
this.systemLogger.info(message)
}
public warn(message: unknown) {
this.systemLogger.warn(message)
}
public error(message: unknown) {
this.systemLogger.error(message)
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "rage-fw-shared-types",
"version": "0.0.15-alpha.0",
"version": "0.0.16-alpha.0",
"types": "types/types/index.d.ts",
"files": [
"types/**/*"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "rage-fw-shared",
"version": "0.0.15-alpha.0",
"version": "0.0.16-alpha.0",
"type": "module",
"main": "index.d.ts",
"files": [