Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e29dc20398 | ||
|
|
82050004f6 | ||
|
|
179d7b8b93 | ||
|
|
978d15bd25 | ||
|
|
4e48772950 | ||
|
|
84994ef121 | ||
|
|
166b933b71 | ||
|
|
e3d7a66646 | ||
|
|
f977e6191f | ||
|
|
593f4650a3 | ||
|
|
d56c52abf5 | ||
|
|
f5648abb00 | ||
|
|
47375c0a15 | ||
|
|
b55204ee61 | ||
|
|
51f50141ab | ||
|
|
495217ecd5 | ||
|
|
7e43e0d106 | ||
|
|
2f1d1d9f0d | ||
|
|
cc40d90070 | ||
|
|
469d970654 | ||
|
|
217e0ddf01 | ||
|
|
ea572070ef | ||
|
|
d56475d08a | ||
|
|
c2684a48fc | ||
|
|
0059a41d0d | ||
|
|
cc1ebbd66b | ||
|
|
301a65e77f |
@@ -0,0 +1,8 @@
|
||||
# Changesets
|
||||
|
||||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
||||
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
||||
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
||||
|
||||
We have a quick list of common questions to get you started engaging with this project in
|
||||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [
|
||||
["@entityseven/rage-fw-browser","@entityseven/rage-fw-client","@entityseven/rage-fw-server"]
|
||||
],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "master",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
env:
|
||||
node: true
|
||||
es6: true
|
||||
es2019: true
|
||||
extends:
|
||||
- 'eslint:recommended'
|
||||
- 'plugin:@typescript-eslint/recommended'
|
||||
# - 'prettier'
|
||||
parser: '@typescript-eslint/parser'
|
||||
parserOptions:
|
||||
ecmaVersion: '2019'
|
||||
sourceType: 'script'
|
||||
plugins:
|
||||
- '@typescript-eslint'
|
||||
ignorePatterns:
|
||||
- 'node_modules'
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
"argsIgnorePattern": '^_',
|
||||
"varsIgnorePattern": '^_',
|
||||
"caughtErrorsIgnorePattern": '^_'
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/ban-types': 'off',
|
||||
'consistent-return': 'warn',
|
||||
'no-empty': 'off',
|
||||
}
|
||||
@@ -28,7 +28,7 @@ body:
|
||||
- type: textarea
|
||||
id: reproduction
|
||||
attributes:
|
||||
label: Reproduction (Optional)
|
||||
label: Reproduction
|
||||
description: Steps to reproduce the bug, if applicable
|
||||
validations:
|
||||
required: true
|
||||
@@ -57,7 +57,7 @@ body:
|
||||
- type: textarea
|
||||
id: additional_information
|
||||
attributes:
|
||||
label: Additional Information
|
||||
label: Additional Information (Optional)
|
||||
description: Add any other information that might be useful in diagnosing the issue
|
||||
validations:
|
||||
required: false
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
.idea
|
||||
node_modules
|
||||
|
||||
dist
|
||||
dist
|
||||
.nx/cache
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"dependencyTypes": ["prod", "peer", "dev"],
|
||||
"versionGroups": [
|
||||
{
|
||||
"label": "Ensure @ragempcommunity/types-* always match",
|
||||
"packages": ["**"],
|
||||
"dependencies": ["@ragempcommunity/types-cef","@ragempcommunity/types-client", "@ragempcommunity/types-server"],
|
||||
"pinVersion": "sameRange",
|
||||
"range": "^"
|
||||
},
|
||||
{
|
||||
"label": "Use workspace protocol when developing local packages",
|
||||
"packages": ["**"],
|
||||
"dependencies": ["@entityseven/rage-fw-shared-types", "@entityseven/rage-fw-rpc"]
|
||||
"pinVersion": "workspace:*",
|
||||
"range": ""
|
||||
},
|
||||
{
|
||||
"label": "Ensure @types/node match same version (for tsup)",
|
||||
"packages": ["**"],
|
||||
"dependencies": ["@types/node"],
|
||||
"pinVersion": "sameRange",
|
||||
"range": ""
|
||||
},
|
||||
{
|
||||
"label": "Ensure newest breaking Typescript version",
|
||||
"packages": ["**"],
|
||||
"dependencies": ["typescript"],
|
||||
"pinVersion": "sameRange",
|
||||
"range": "^"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# Custom Attribution-NoDerivs Software License
|
||||
# Custom Attribution-NoDerives Software License
|
||||
|
||||
This license allows you to use, copy, and distribute the RageFW (the "Software"), including for commercial purposes, provided that the following conditions are met:
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Custom Attribution-NoDerives Software License
|
||||
|
||||
Copyright (c) 2024 Entity Seven Group
|
||||
|
||||
This license allows you to use, copy, and distribute the RageFW (the "Software"), including for commercial purposes, provided that the following conditions are met:
|
||||
|
||||
1. **Attribution:** You must give appropriate credit to the original author of the Software, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
||||
|
||||
2. **No Derivative Works:** You may not modify, transform, or build upon the Software.
|
||||
|
||||
3. **Usage and Commercial Use:** You are allowed to use, sell, and gain income from projects that utilize the Software, as long as you comply with the terms of this license.
|
||||
|
||||
4. **No Additional Restrictions:** You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+56
-28
@@ -1,32 +1,60 @@
|
||||
{
|
||||
"name": "@entityseven/rage-fw-browser",
|
||||
"version": "0.2.1-0.2.0-alpha.2.0",
|
||||
"private": false,
|
||||
"name": "@entityseven/rage-fw-browser",
|
||||
"version": "0.2.0",
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md",
|
||||
"LICENSE",
|
||||
"package.json"
|
||||
],
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsup"
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@entityseven/rage-fw-rpc": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "22.12.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@entityseven/rage-fw-shared-types": "workspace:*",
|
||||
"@ragempcommunity/types-cef": "^2.1.8",
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"description": "Package used on a browser-side of your Rage:MP Server",
|
||||
"keywords": [
|
||||
"ragefw",
|
||||
"rage-fw",
|
||||
"ragemp",
|
||||
"rage:mp",
|
||||
"rage",
|
||||
"gta5"
|
||||
],
|
||||
"author": "Entity Seven Group",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Danya H",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@entityseven/rage-fw-rpc": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@entityseven/rage-fw-shared-types": "workspace:^",
|
||||
"@ragempcommunity/types-cef": "^2.1.8"
|
||||
},
|
||||
"description": "RageFW CEF side",
|
||||
"keywords": [],
|
||||
"author": "SashaGoncharov19",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "rilaxik",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"gitHead": "ffd542c1deddb3033e16e0dae7557313ae09b05f"
|
||||
{
|
||||
"name": "Oleksandr Honcharov",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/SashaGoncharov19/"
|
||||
}
|
||||
],
|
||||
"license": "Custom-Attribution-NoDerivs",
|
||||
"gitHead": "ffd542c1deddb3033e16e0dae7557313ae09b05f"
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
# RageFW CEF
|
||||
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs)
|
||||
# RageFW Browser
|
||||
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki)
|
||||
@@ -1,11 +1,6 @@
|
||||
import { Helper } from './helper'
|
||||
import { rpc } from './rpc'
|
||||
import type * as T from '../types'
|
||||
import {
|
||||
RageFW_BrowserEvent,
|
||||
RageFW_ClientEvent,
|
||||
RageFW_ServerEvent,
|
||||
} from '../types'
|
||||
|
||||
/** Browser-side interactions */
|
||||
export class Browser extends Helper {
|
||||
|
||||
+4
-21
@@ -1,25 +1,8 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "Base",
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"display": "Browser",
|
||||
"compilerOptions": {
|
||||
"incremental": false,
|
||||
"composite": false,
|
||||
"target": "ES2022",
|
||||
"experimentalDecorators": true,
|
||||
"moduleDetection": "auto",
|
||||
"module": "CommonJS",
|
||||
"resolveJsonModule": true,
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"sourceMap": false,
|
||||
"downlevelIteration": false,
|
||||
"inlineSourceMap": false,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
"types": ["./node_modules/@ragempcommunity/types-cef/index.d.ts", "node"]
|
||||
},
|
||||
"extends": ["../tsconfig.ragefw.json"]
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { defineConfig } from 'tsup'
|
||||
|
||||
export default defineConfig({
|
||||
entry: ['src/index.ts'],
|
||||
entry: ['src/**/*.ts'],
|
||||
outDir: './dist',
|
||||
format: ['cjs'],
|
||||
noExternal: ['rage-rpc'],
|
||||
experimentalDts: true,
|
||||
splitting: false,
|
||||
bundle: false,
|
||||
sourcemap: false,
|
||||
clean: true,
|
||||
})
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Entity Seven Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+20
-14
@@ -1,19 +1,21 @@
|
||||
{
|
||||
"name": "@entityseven/create-rage-fw",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"bin": {
|
||||
"rage-fw": "dist/index.js"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"watch": "tsc -w",
|
||||
"build": "tsup",
|
||||
"start": "npx ./dist create"
|
||||
"start": "npx ./dist create",
|
||||
"install": "pnpm install --ignore-workspace"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md"
|
||||
],
|
||||
"dependencies": {
|
||||
"@inquirer/prompts": "^5.0.5",
|
||||
"ky": "^1.7.2",
|
||||
@@ -21,16 +23,20 @@
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.2",
|
||||
"@types/node": "^22.12.0",
|
||||
"@types/yargs": "^17.0.32",
|
||||
"prettier": "^3.3.2",
|
||||
"typescript": "^5.4.5"
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"description": "CLI to scaffold a template project for RageFW",
|
||||
"keywords": [],
|
||||
"author": "rilaxik",
|
||||
"contributors": [{
|
||||
"name": "SashaGoncharov19"
|
||||
}],
|
||||
"description": "CLI to scaffold a preview for Rage FW",
|
||||
"keywords": ["create-rage-fw","ragefw-cli", "ragefw", "rage-fw", "ragemp", "rage:mp", "rage", "gta5"],
|
||||
"author": "Entity Seven Group",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Danya H",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik/"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
Generated
+488
@@ -0,0 +1,488 @@
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@inquirer/prompts':
|
||||
specifier: ^5.0.5
|
||||
version: 5.5.0
|
||||
chalk:
|
||||
specifier: 4.1.2
|
||||
version: 4.1.2
|
||||
ky:
|
||||
specifier: ^1.7.2
|
||||
version: 1.7.4
|
||||
yargs:
|
||||
specifier: ^17.7.2
|
||||
version: 17.7.2
|
||||
devDependencies:
|
||||
'@types/node':
|
||||
specifier: ^22.12.0
|
||||
version: 22.12.0
|
||||
'@types/yargs':
|
||||
specifier: ^17.0.32
|
||||
version: 17.0.33
|
||||
prettier:
|
||||
specifier: ^3.3.2
|
||||
version: 3.4.2
|
||||
typescript:
|
||||
specifier: ^5.7.3
|
||||
version: 5.7.3
|
||||
|
||||
packages:
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-sMgdETOfi2dUHT8r7TT1BTKOwNvdDGFDXYWtQ2J69SvlYNntk9I/gJe7r5yvMwwsuKnYbuRs3pNhx4tgNck5aA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-9KHOpJ+dIL5SZli8lJ6xdaYLPPzB8xB9GZItg39MBybzhxA16vxmszmQFrRwbOA918WA2rvu8xhDEg/p6LXKbw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-qnJsUcOGCSG1e5DTOErmv2BPQqrtT6uzqn1vI/aYGiPKq+FgslGZmtdnXbhuI7IlT7OByDoEEqdnhUnVR2hhLw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-XfnpCStx2xgh1LIRqPXrTNEEByqQWoxsWYzNRSEUxJ5c6EQlhMogJ3vHKu8aXuTacebtaZzMAHwEL0kAflKOBw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-ilUnia/GZUtfSZy3YEErXLJ2Sljo/mf9fiKc08n18DdwdmDbOzRcTv65H1jjDvlsAuvdFXf4Sa/aL7iw/NanVA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-5otqIpgsPYIshqhgtEwSspBQE40etouR8VIxzpJkv9i0dVHIpyhiivbkH9/dGiMLdyamT54YRdGJLfl8TFnLHg==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-BHDeL0catgHdcHbSFFUddNzvx/imzJMft+tWDPwTm3hfu8/tApk1HrooNngB2Mb4qY+KaRWF+iZqoVUPeslEog==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-zzfNuINhFF7OLAtGHfhwOW2TlYJyli7lOUoJUXw/uyklcwalV6WRXBXtFIicN8rTRK1XTiPWB4UY+YuW8dsnLQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-h+/5LSj51dx7hp5xOn4QFnUaKeARwUCLs6mIhtkJ0JYPBLmEYjdHSYh7I6GrLg9LwpJ3xeX0FZgAG1q0QdCpVQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-YmDobTItPP3WcEI86GvPo+T2sRHkxxOq/kXmsBjHS5BVXUgvgZ5AfJjkvQvZr03T81NnI3KrrRuMzeuYUQRFOA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-MzICLu4yS7V8AA61sANROZ9vT1H3ooca5dSmI1FjZkzq7o/koMsRfQSzRtFo+F3Ao4Sf1C0bpLKejpKB/+j6MA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
resolution: {integrity: sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==}
|
||||
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-Fll2FZ1riMjNmlmJOdAyY5pUbkftXslB5DgEzlIuNaiWhXd00FhWxVC/r4yV/4wBb9JfImTu+jiSvXTkJ7F/gA==}
|
||||
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==}
|
||||
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==}
|
||||
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==}
|
||||
engines: {node: '>= 12'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
|
||||
engines: {node: '>=7.0.0'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
||||
engines: {node: 6.* || 8.* || >= 10.*}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-zYEr/gh7uLW2l4su11bmQ2M9xLgQLjyvx58UyNM/6nuqyWFHPX5ktMjvpev3F8QWdjSsHUpnWew4PBCswBNuMQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==}
|
||||
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==}
|
||||
engines: {node: '>=14'}
|
||||
hasBin: true
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
|
||||
engines: {node: '>=14'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
|
||||
engines: {node: '>=0.6.0'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==}
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/figures': 1.0.9
|
||||
'@inquirer/type': 1.5.5
|
||||
ansi-escapes: 4.3.2
|
||||
yoctocolors-cjs: 2.1.2
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/type': 1.5.5
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/figures': 1.0.9
|
||||
'@inquirer/type': 2.0.0
|
||||
'@types/mute-stream': 0.0.4
|
||||
'@types/node': 22.12.0
|
||||
'@types/wrap-ansi': 3.0.0
|
||||
ansi-escapes: 4.3.2
|
||||
cli-width: 4.1.0
|
||||
mute-stream: 1.0.0
|
||||
signal-exit: 4.1.0
|
||||
strip-ansi: 6.0.1
|
||||
wrap-ansi: 6.2.0
|
||||
yoctocolors-cjs: 2.1.2
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/type': 1.5.5
|
||||
external-editor: 3.1.0
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/type': 1.5.5
|
||||
yoctocolors-cjs: 2.1.2
|
||||
|
||||
'@inquirer/[email protected]': {}
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/type': 1.5.5
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/type': 1.5.5
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/type': 1.5.5
|
||||
ansi-escapes: 4.3.2
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/checkbox': 2.5.0
|
||||
'@inquirer/confirm': 3.2.0
|
||||
'@inquirer/editor': 2.2.0
|
||||
'@inquirer/expand': 2.3.0
|
||||
'@inquirer/input': 2.3.0
|
||||
'@inquirer/number': 1.1.0
|
||||
'@inquirer/password': 2.2.0
|
||||
'@inquirer/rawlist': 2.3.0
|
||||
'@inquirer/search': 1.1.0
|
||||
'@inquirer/select': 2.5.0
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/type': 1.5.5
|
||||
yoctocolors-cjs: 2.1.2
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/figures': 1.0.9
|
||||
'@inquirer/type': 1.5.5
|
||||
yoctocolors-cjs: 2.1.2
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
'@inquirer/core': 9.2.1
|
||||
'@inquirer/figures': 1.0.9
|
||||
'@inquirer/type': 1.5.5
|
||||
ansi-escapes: 4.3.2
|
||||
yoctocolors-cjs: 2.1.2
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
mute-stream: 1.0.0
|
||||
|
||||
'@inquirer/[email protected]':
|
||||
dependencies:
|
||||
mute-stream: 1.0.0
|
||||
|
||||
'@types/[email protected]':
|
||||
dependencies:
|
||||
'@types/node': 22.12.0
|
||||
|
||||
'@types/[email protected]':
|
||||
dependencies:
|
||||
undici-types: 6.20.0
|
||||
|
||||
'@types/[email protected]': {}
|
||||
|
||||
'@types/[email protected]': {}
|
||||
|
||||
'@types/[email protected]':
|
||||
dependencies:
|
||||
'@types/yargs-parser': 21.0.3
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
type-fest: 0.21.3
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
color-convert: 2.0.1
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
supports-color: 7.2.0
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
string-width: 4.2.3
|
||||
strip-ansi: 6.0.1
|
||||
wrap-ansi: 7.0.0
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
color-name: 1.1.4
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
chardet: 0.7.0
|
||||
iconv-lite: 0.4.24
|
||||
tmp: 0.0.33
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
safer-buffer: 2.1.2
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
emoji-regex: 8.0.0
|
||||
is-fullwidth-code-point: 3.0.0
|
||||
strip-ansi: 6.0.1
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
ansi-regex: 5.0.1
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
has-flag: 4.0.0
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
os-tmpdir: 1.0.2
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
string-width: 4.2.3
|
||||
strip-ansi: 6.0.1
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
string-width: 4.2.3
|
||||
strip-ansi: 6.0.1
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
cliui: 8.0.1
|
||||
escalade: 3.2.0
|
||||
get-caller-file: 2.0.5
|
||||
require-directory: 2.1.1
|
||||
string-width: 4.2.3
|
||||
y18n: 5.0.8
|
||||
yargs-parser: 21.1.1
|
||||
|
||||
[email protected]: {}
|
||||
+26
-14
@@ -1,29 +1,41 @@
|
||||
# RageFW CLI
|
||||
|
||||
To make you life easier while using RageFW we created a basic CLI. At the moment automation we have only works via [pnpm](https://pnpm.io/)
|
||||
To make you life easier while using RageFW we created a basic CLI. At the moment automation we have only works via [pnpm](https://pnpm.io/) and [bun](https://bun.sh/)
|
||||
|
||||
``pnpm create @entityseven/rage-fw@latest``
|
||||
|
||||
## TL;DR
|
||||
``bun create @entityseven/rage-fw@latest``
|
||||
|
||||
# TL;DR
|
||||
- ``Initialize new project`` - create new template project
|
||||
- ``Test our RPC`` - scaffold an example for ``@entityseven/rage-fw-rpc``
|
||||
- ``Install RAGE:MP updater`` - download and update RAGE:MP server files
|
||||
|
||||
## Options
|
||||
# Options
|
||||
For now, you will see a few available options. They are described in detail below
|
||||
|
||||
- ``Initialize new project``
|
||||
- ``Test our RPC``
|
||||
- ``Install RAGE:MP updater``
|
||||
|
||||
### Initialize new project
|
||||
Using this options will forward you to common project-creation menu
|
||||
- ``Enter project name``
|
||||
## Initialize new project
|
||||
Using this option will forward you to common project creation menu
|
||||
|
||||
This option will specify a name for your project which is used as a folder name too. Defaults to **rage-fw**
|
||||
- ``Enter project name``
|
||||
This option will specify a name for your project which is used as a folder name too. Defaults to **rage-fw-example**
|
||||
|
||||
- ``Select frontend``
|
||||
- ``Select front-end``
|
||||
Use selector menu to choose which front-end framework you want to use. We will do our best to expand this menu with various solutions
|
||||
|
||||
Use this selector menu to choose which frontend framework you want to use. We will do our best to expand this menu after some time.
|
||||
Defaults to **React + TypeScript (Vite)**
|
||||
## Test our RPC
|
||||
Using this option will forward you to common project creation menu
|
||||
|
||||
### Install Rage:MP updater
|
||||
This option will simplify installation process of Rage:MP server files required to start your server
|
||||
- ``Enter project name``
|
||||
This option will specify a name for your project which is used as a folder name too. Defaults to **rage-fw-rpc-example**
|
||||
|
||||
- ``Select front-end``
|
||||
Use selector menu to choose which front-end framework you want to use. We will do our best to expand this menu with various solutions
|
||||
|
||||
## Install Rage:MP updater
|
||||
This option will simplify installation and update process of Rage:MP server files required to start your server
|
||||
|
||||
# Contribution
|
||||
If you wish to help us in expanding examples selection with different framework you are very welcome to open PRs and Issues
|
||||
+23
-15
@@ -3,9 +3,22 @@ import { input, select } from '@inquirer/prompts'
|
||||
import path from 'node:path'
|
||||
import { cloneBranch } from '../utils/cloner'
|
||||
|
||||
const choices = {
|
||||
'react-18': {
|
||||
name: 'React 18',
|
||||
value: 'react-18',
|
||||
description: 'React 18 + TypeScript (Vite) as a front-end',
|
||||
},
|
||||
'svelte-5': {
|
||||
name: 'Svelte 5',
|
||||
value: 'svelte-5',
|
||||
description: 'Svelte 5 + TypeScript (Vite) as a front-end',
|
||||
},
|
||||
} as const
|
||||
|
||||
export async function initProject() {
|
||||
let folder
|
||||
let framework
|
||||
let folder: string | undefined
|
||||
let framework: keyof typeof choices | undefined
|
||||
|
||||
if (!folder) {
|
||||
folder = await input({
|
||||
@@ -18,27 +31,21 @@ export async function initProject() {
|
||||
|
||||
if (!framework) {
|
||||
framework = await select({
|
||||
message: c.gray('Select frontend:'),
|
||||
message: c.gray('Select front-end:'),
|
||||
default: 'react-18',
|
||||
loop: true,
|
||||
choices: [
|
||||
{
|
||||
name: 'React + TypeScript (Vite)',
|
||||
value: 'react-18',
|
||||
description: 'React + TypeScript (Vite) as a frontend',
|
||||
},
|
||||
],
|
||||
choices: Object.values(choices),
|
||||
})
|
||||
} else {
|
||||
console.log(c.gray('Frontend:'), framework)
|
||||
console.log(c.gray('Front-end:'), choices[framework].name)
|
||||
}
|
||||
|
||||
console.log(
|
||||
c.gray('\nScaffolding template project into'),
|
||||
folder,
|
||||
c.gray('with'),
|
||||
framework,
|
||||
c.gray('as a frontend..'),
|
||||
choices[framework].name,
|
||||
c.gray('as a front-end..'),
|
||||
)
|
||||
|
||||
cloneBranch(
|
||||
@@ -50,11 +57,12 @@ export async function initProject() {
|
||||
console.log(c.gray('Scaffolded project into'), folder)
|
||||
console.log(
|
||||
c.gray(
|
||||
`Project was created ar dir: ${path.join(process.cwd(), folder)}`,
|
||||
`Project was created in: ${path.join(process.cwd(), folder)}`,
|
||||
),
|
||||
)
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(c.red('Error occured: \n', e))
|
||||
console.log(c.red('Error occurred: \n', e))
|
||||
console.log(c.red('Please open an issue if you see this'))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -5,20 +5,20 @@ import { cloneBranch } from '../utils/cloner'
|
||||
|
||||
const choices = {
|
||||
'rpc-react-18': {
|
||||
name: 'Vite + React 18 + TypeScript',
|
||||
name: 'React 18',
|
||||
value: 'rpc-react-18',
|
||||
description: 'Vite + React 18 + TypeScript as a frontend',
|
||||
description: 'Vite + React 18 + TypeScript as a front-end',
|
||||
},
|
||||
'rpc-svelte-5': {
|
||||
name: 'Vite + Svelte 5 + TypeScript',
|
||||
name: 'Svelte 5',
|
||||
value: 'rpc-svelte-5',
|
||||
description: 'Vite + Svelte 5 + TypeScript as a frontend',
|
||||
description: 'Vite + Svelte 5 + TypeScript as a front-end',
|
||||
},
|
||||
} as const
|
||||
|
||||
export async function testRpc() {
|
||||
let folder
|
||||
let framework
|
||||
let folder: string | undefined
|
||||
let framework: keyof typeof choices | undefined
|
||||
|
||||
if (!folder) {
|
||||
folder = await input({
|
||||
@@ -31,13 +31,13 @@ export async function testRpc() {
|
||||
|
||||
if (!framework) {
|
||||
framework = await select({
|
||||
message: c.gray('Select frontend:'),
|
||||
message: c.gray('Select front-end:'),
|
||||
default: 'rpc-react-18',
|
||||
loop: true,
|
||||
choices: Object.values(choices),
|
||||
})
|
||||
} else {
|
||||
console.log(c.gray('Frontend:'), framework)
|
||||
console.log(c.gray('Front-end:'), choices[framework].name)
|
||||
}
|
||||
|
||||
console.log(
|
||||
@@ -45,7 +45,7 @@ export async function testRpc() {
|
||||
folder,
|
||||
c.gray('with'),
|
||||
choices[framework].name,
|
||||
c.gray('as a frontend..'),
|
||||
c.gray('as a frontend'),
|
||||
)
|
||||
|
||||
cloneBranch(
|
||||
@@ -62,6 +62,7 @@ export async function testRpc() {
|
||||
)
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(c.red('Error occured: \n', e))
|
||||
console.log(c.red('Error occurred: \n', e))
|
||||
console.log(c.red('Please open an issue if you see this'))
|
||||
})
|
||||
}
|
||||
|
||||
+14
-4
@@ -12,10 +12,19 @@ enum Actions {
|
||||
UPDATER = 'UPDATER',
|
||||
}
|
||||
|
||||
process.on('exit', () => {
|
||||
console.log(c.blueBright('\n\nRage FW CLI | Exiting..'))
|
||||
process.exit(0)
|
||||
})
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
console.log(c.blueBright('\n\nRage FW CLI | Exiting..'))
|
||||
process.exit(0)
|
||||
})
|
||||
;(async () => {
|
||||
await checkForUpdates()
|
||||
|
||||
console.log(c.blueBright('Rage FW CLI | Powered by Entity Seven Group ️<3'))
|
||||
console.log(c.blueBright('Rage FW CLI | Powered by Entity Seven Group <3'))
|
||||
|
||||
const action = await select({
|
||||
message: c.gray('Select action:'),
|
||||
@@ -26,16 +35,16 @@ enum Actions {
|
||||
description: 'Initialize a new project and start developing',
|
||||
},
|
||||
{
|
||||
name: 'Test our RPC',
|
||||
name: 'Test our Rpc',
|
||||
value: Actions.TEST_RPC,
|
||||
description:
|
||||
'Initialize a new skeleton project with our RPC set up',
|
||||
'Initialize a new skeleton project with our Rpc all set',
|
||||
},
|
||||
{
|
||||
name: 'Install RAGE:MP updater',
|
||||
value: Actions.UPDATER,
|
||||
description:
|
||||
'Use our tool to download or update RAGE:MP server files in two clicks',
|
||||
'Use our tool to download or update RAGE:MP server files in just two clicks',
|
||||
},
|
||||
],
|
||||
loop: true,
|
||||
@@ -53,5 +62,6 @@ enum Actions {
|
||||
break
|
||||
default:
|
||||
console.log(c.red('Something went wrong..'))
|
||||
console.log(c.red('Please open an issue if you see this'))
|
||||
}
|
||||
})()
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"lib": ["DOM", "ES6"],
|
||||
"lib": ["DOM", "esnext"],
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Custom Attribution-NoDerives Software License
|
||||
|
||||
Copyright (c) 2024 Entity Seven Group
|
||||
|
||||
This license allows you to use, copy, and distribute the RageFW (the "Software"), including for commercial purposes, provided that the following conditions are met:
|
||||
|
||||
1. **Attribution:** You must give appropriate credit to the original author of the Software, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
||||
|
||||
2. **No Derivative Works:** You may not modify, transform, or build upon the Software.
|
||||
|
||||
3. **Usage and Commercial Use:** You are allowed to use, sell, and gain income from projects that utilize the Software, as long as you comply with the terms of this license.
|
||||
|
||||
4. **No Additional Restrictions:** You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+58
-28
@@ -1,32 +1,62 @@
|
||||
{
|
||||
"name": "@entityseven/rage-fw-client",
|
||||
"version": "0.2.1-0.2.0-alpha.2.0",
|
||||
"private": false,
|
||||
"name": "@entityseven/rage-fw-client",
|
||||
"version": "0.2.0",
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md",
|
||||
"LICENSE",
|
||||
"package.json"
|
||||
],
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsup"
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@entityseven/rage-fw-rpc": "workspace:*",
|
||||
"zod": "^3.24.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "22.12.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@entityseven/rage-fw-shared-types": "workspace:*",
|
||||
"@ragempcommunity/types-client": "^2.1.8",
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"description": "Package used on a client-side of your Rage:MP Server",
|
||||
"keywords": [
|
||||
"rage-fw-client",
|
||||
"ragefw",
|
||||
"rage-fw",
|
||||
"ragemp",
|
||||
"rage:mp",
|
||||
"rage",
|
||||
"gta5"
|
||||
],
|
||||
"author": "Entity Seven Group",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Danya H",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@entityseven/rage-fw-rpc": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@entityseven/rage-fw-shared-types": "workspace:^",
|
||||
"@ragempcommunity/types-client": "^2.1.8"
|
||||
},
|
||||
"description": "RageFW Client side",
|
||||
"keywords": [],
|
||||
"author": "SashaGoncharov19",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "rilaxik",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"gitHead": "ffd542c1deddb3033e16e0dae7557313ae09b05f"
|
||||
{
|
||||
"name": "Oleksandr Honcharov",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/SashaGoncharov19/"
|
||||
}
|
||||
],
|
||||
"license": "Custom-Attribution-NoDerivs",
|
||||
"gitHead": "ffd542c1deddb3033e16e0dae7557313ae09b05f"
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
# RageFW Client
|
||||
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs)
|
||||
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki)
|
||||
+4
-21
@@ -1,25 +1,8 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "Base",
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"display": "Client",
|
||||
"compilerOptions": {
|
||||
"incremental": false,
|
||||
"composite": false,
|
||||
"target": "ES2022",
|
||||
"experimentalDecorators": true,
|
||||
"moduleDetection": "auto",
|
||||
"module": "CommonJS",
|
||||
"resolveJsonModule": true,
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"sourceMap": false,
|
||||
"downlevelIteration": false,
|
||||
"inlineSourceMap": false,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
"types": ["./node_modules/@ragempcommunity/types-client/index.d.ts"]
|
||||
},
|
||||
"extends": ["../tsconfig.ragefw.json"]
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { defineConfig } from 'tsup'
|
||||
|
||||
export default defineConfig({
|
||||
entry: ['src/index.ts'],
|
||||
entry: ['src/**/*.ts'],
|
||||
outDir: './dist',
|
||||
format: ['cjs'],
|
||||
noExternal: ['rage-rpc'],
|
||||
experimentalDts: true,
|
||||
splitting: false,
|
||||
bundle: false,
|
||||
sourcemap: false,
|
||||
clean: true,
|
||||
})
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import globals from 'globals'
|
||||
import pluginJs from '@eslint/js'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
import type { Linter } from 'eslint'
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: ['**/.*/*', '**/dist/*', '**/node_modules/*', '*.config.*'],
|
||||
},
|
||||
pluginJs.configs.recommended,
|
||||
...(tseslint.configs.recommended as Linter.Config[]),
|
||||
{
|
||||
name: 'global',
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/ban-types': 'off',
|
||||
'consistent-return': 'off',
|
||||
'no-empty': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'browser/rpc',
|
||||
files: ['browser/src/*.{ts,js}', 'rpc/src/*.{ts,js}'],
|
||||
languageOptions: {
|
||||
globals: { ...globals.browser, ...globals.node, ...globals.es2022 },
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'cli',
|
||||
files: ['cli/src/*.{ts,js}'],
|
||||
languageOptions: {
|
||||
globals: { ...globals.node, ...globals.es2024 },
|
||||
ecmaVersion: 2024,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'client/server/shared',
|
||||
files: [
|
||||
'client/**/*.{ts,js}',
|
||||
'server/**/*.{ts,js}',
|
||||
'shared/**/*.{ts,js}',
|
||||
],
|
||||
languageOptions: {
|
||||
globals: { ...globals.node, ...globals.es2022 },
|
||||
},
|
||||
},
|
||||
] satisfies Linter.Config[]
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||
"version": "0.2.1-0.2.0-alpha.2.0",
|
||||
"npmClient": "pnpm"
|
||||
}
|
||||
+55
-21
@@ -1,30 +1,64 @@
|
||||
{
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"*",
|
||||
"!cli"
|
||||
],
|
||||
"scripts": {
|
||||
"publish": "lerna publish --force-publish",
|
||||
"build": "lerna run build",
|
||||
"lint": "eslint --c .eslintrc.yaml --ext .ts client/ server/ shared-types/",
|
||||
|
||||
"rebuild:browser": "cd browser && pnpm build",
|
||||
"rebuild:client": "cd client && pnpm build",
|
||||
"rebuild:server": "cd server && pnpm build",
|
||||
"rebuild": "pnpm rebuild:browser && pnpm rebuild:client && pnpm rebuild:server"
|
||||
"lint": "eslint . --config eslint.config.ts",
|
||||
"_____build": "echo build",
|
||||
"build:browser": "cd browser && pnpm build",
|
||||
"build:client": "cd client && pnpm build",
|
||||
"build:server": "cd server && pnpm build",
|
||||
"build:rpc": "cd rpc && pnpm build",
|
||||
"build": "pnpm build:browser && pnpm build:client && pnpm build:server && pnpm build:rpc",
|
||||
"_____deps": "echo must be ran before lerna commands",
|
||||
"deps:check": "syncpack list-mismatches",
|
||||
"deps:fix": "syncpack fix-mismatches",
|
||||
"_____publish": "echo publish",
|
||||
"publish:check": "pnpm run deps:check && pnpm run lint",
|
||||
"publish:changeset": "pnpm changeset add",
|
||||
"publish:version": "pnpm changeset version"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/api-extractor": "^7.47.0",
|
||||
"@changesets/cli": "^2.27.12",
|
||||
"@eslint/js": "^9.19.0",
|
||||
"@microsoft/api-extractor": "^7.49.1",
|
||||
"@ragempcommunity/types-cef": "^2.1.8",
|
||||
"@ragempcommunity/types-client": "^2.1.8",
|
||||
"@ragempcommunity/types-server": "^2.1.8",
|
||||
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
||||
"@typescript-eslint/parser": "^7.13.0",
|
||||
"@types/node": "^22.8.1",
|
||||
"eslint": "^8.56.0",
|
||||
"lerna": "^8.1.3",
|
||||
"prettier": "^3.3.1",
|
||||
"rage-rpc": "^0.4.0",
|
||||
"tsup": "^8.1.0",
|
||||
"typescript": "^5.4.5",
|
||||
"winston": "^3.13.0"
|
||||
"eslint": "^9.19.0",
|
||||
"globals": "^15.14.0",
|
||||
"jiti": "^2.4.2",
|
||||
"prettier": "^3.4.2",
|
||||
"tsup": "^8.3.6",
|
||||
"typescript": "^5.7.3",
|
||||
"typescript-eslint": "^8.22.0",
|
||||
"winston": "^3.17.0"
|
||||
},
|
||||
"type": "module"
|
||||
"engines": {
|
||||
"node": ">=14",
|
||||
"pnpm": ">=10"
|
||||
},
|
||||
"pnpm": {
|
||||
"requiredScripts": []
|
||||
},
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"license": "SEE INDIVIDUALLY FOR EACH PACKAGE",
|
||||
"author": "Entity Seven Group",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Danya H",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik/"
|
||||
},
|
||||
{
|
||||
"name": "Oleksandr Honcharov",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/SashaGoncharov19/"
|
||||
}
|
||||
],
|
||||
"devDependencies": {
|
||||
"syncpack": "^13.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+3291
-8538
File diff suppressed because it is too large
Load Diff
+2
-4
@@ -1,5 +1,3 @@
|
||||
packages:
|
||||
- "server"
|
||||
- "client"
|
||||
- "browser"
|
||||
- "shared-types"
|
||||
- "*"
|
||||
- "!cli"
|
||||
+41
-40
@@ -1,42 +1,43 @@
|
||||
{
|
||||
"name": "@entityseven/rage-fw-rpc",
|
||||
"description": "Rage FW RPC",
|
||||
"version": "0.2.5",
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"start": "npx ./dist create"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "^7.47.9",
|
||||
"prettier": "^3.3.2",
|
||||
"tsup": "^8.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5"
|
||||
},
|
||||
"keywords": [
|
||||
"ragemp",
|
||||
"rage",
|
||||
"rpc",
|
||||
"rage-rpc",
|
||||
"ragerpc"
|
||||
],
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"author": {
|
||||
"name": "rilaxik",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "SashaGoncharov19",
|
||||
"url": "https://github.com/SashaGoncharov19"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"gitHead": "04eb7240735c4a0e4855ebabbe8d5b326819fa76"
|
||||
"private": false,
|
||||
"name": "@entityseven/rage-fw-rpc",
|
||||
"version": "0.2.5",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"start": "npx ./dist create"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "22.12.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"description": "Rage-FW RPC (Remote procedure caller) for Rage:MP",
|
||||
"keywords": [
|
||||
"ragefw",
|
||||
"rage-fw",
|
||||
"ragemp",
|
||||
"rage",
|
||||
"rpc",
|
||||
"rage-rpc",
|
||||
"ragerpc",
|
||||
"gta5"
|
||||
],
|
||||
"author": "Entity Seven Group",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Danya H",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik/"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"gitHead": "04eb7240735c4a0e4855ebabbe8d5b326819fa76"
|
||||
}
|
||||
|
||||
+3
-3
@@ -3,13 +3,13 @@ is an all-in package with asynchronous RPC implementation for RageMP servers in
|
||||
|
||||
# Installation
|
||||
``` shell
|
||||
npm i rage-fw-rpc
|
||||
npm i @entityseven/rage-fw-rpc
|
||||
```
|
||||
```shell
|
||||
pnpm i rage-fw-rpc
|
||||
pnpm i @entityseven/rage-fw-rpc
|
||||
```
|
||||
```shell
|
||||
yarn add rage-fw-rpc
|
||||
yarn add @entityseven/rage-fw-rpc
|
||||
```
|
||||
|
||||
Import installed package and initialize rpc:
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ export class Browser extends Wrapper {
|
||||
* NOT INTENDED FOR OUT-OF-CONTEXT USE
|
||||
*/
|
||||
public _resolveEmitDestination(dataRaw: string) {
|
||||
let state = Utils.prepareExecution(dataRaw)
|
||||
const state = Utils.prepareExecution(dataRaw)
|
||||
|
||||
switch (state.calledTo) {
|
||||
case Environment.BROWSER:
|
||||
|
||||
+53
-53
@@ -91,7 +91,7 @@ class Rpc extends Wrapper {
|
||||
*/
|
||||
public register<
|
||||
CallbackArguments extends unknown[] = unknown[],
|
||||
CallbackReturn extends unknown = unknown,
|
||||
CallbackReturn = unknown,
|
||||
EventName extends string = string,
|
||||
>(
|
||||
eventName: EventName,
|
||||
@@ -155,7 +155,7 @@ class Rpc extends Wrapper {
|
||||
public async callClient<
|
||||
Arguments extends unknown[] = unknown[],
|
||||
EventName extends string = string,
|
||||
Return extends unknown = unknown,
|
||||
Return = unknown,
|
||||
>(eventName: EventName, args?: Arguments): Promise<Return>
|
||||
/**
|
||||
* Calls a client-side event from server or browser
|
||||
@@ -178,37 +178,28 @@ class Rpc extends Wrapper {
|
||||
public async callClient<
|
||||
Arguments extends unknown[] = unknown[],
|
||||
EventName extends string = string,
|
||||
Return extends unknown = unknown,
|
||||
Return = unknown,
|
||||
>(player: PlayerMp, eventName: EventName, args?: Arguments): Promise<Return>
|
||||
public async callClient(
|
||||
playerOrEventName: PlayerMp | string,
|
||||
eventNameOrArgs?: string | unknown[],
|
||||
args?: unknown[],
|
||||
) {
|
||||
_is1StParamPlayer(playerOrEventName)
|
||||
? this.log(
|
||||
'callClient',
|
||||
eventNameOrArgs as string,
|
||||
playerOrEventName,
|
||||
eventNameOrArgs,
|
||||
args,
|
||||
)
|
||||
: this.log(
|
||||
'callClient',
|
||||
playerOrEventName as string,
|
||||
eventNameOrArgs,
|
||||
)
|
||||
if (_is1StParamPlayer(playerOrEventName)) {
|
||||
this.log(
|
||||
'callClient',
|
||||
eventNameOrArgs as string,
|
||||
playerOrEventName,
|
||||
eventNameOrArgs,
|
||||
args,
|
||||
)
|
||||
} else {
|
||||
this.log('callClient', playerOrEventName as string, eventNameOrArgs)
|
||||
}
|
||||
|
||||
if (this.forceBrowserDevMode_) return
|
||||
Utils.errorUnknownEnvironment(this.environment_)
|
||||
|
||||
function _is1StParamPlayer(x: unknown): x is PlayerMp {
|
||||
return typeof x === 'object'
|
||||
}
|
||||
|
||||
function _is2NdParamEventName(x: unknown): x is string {
|
||||
return typeof x === 'string'
|
||||
}
|
||||
|
||||
if (this.environment_ === Environment.CLIENT) {
|
||||
// client
|
||||
return await this.call(
|
||||
@@ -260,6 +251,14 @@ class Rpc extends Wrapper {
|
||||
mp.trigger(Events.LOCAL_EVENT_LISTENER, dataRaw)
|
||||
return (await this.responseHandler(state.uuid)).data
|
||||
}
|
||||
|
||||
function _is1StParamPlayer(x: unknown): x is PlayerMp {
|
||||
return typeof x === 'object'
|
||||
}
|
||||
|
||||
function _is2NdParamEventName(x: unknown): x is string {
|
||||
return typeof x === 'string'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -282,7 +281,7 @@ class Rpc extends Wrapper {
|
||||
public async callServer<
|
||||
Arguments extends unknown[] = unknown[],
|
||||
EventName extends string = string,
|
||||
Return extends unknown = unknown,
|
||||
Return = unknown,
|
||||
>(eventName: EventName, args?: Arguments): Promise<Return> {
|
||||
this.log('callServer', eventName, args)
|
||||
if (this.forceBrowserDevMode_)
|
||||
@@ -337,7 +336,7 @@ class Rpc extends Wrapper {
|
||||
public async callBrowser<
|
||||
Arguments extends unknown[] = unknown[],
|
||||
EventName extends string = string,
|
||||
Return extends unknown = unknown,
|
||||
Return = unknown,
|
||||
>(eventName: EventName, args?: Arguments): Promise<Return>
|
||||
/**
|
||||
* Calls a browser-side event from server or client
|
||||
@@ -360,37 +359,32 @@ class Rpc extends Wrapper {
|
||||
public async callBrowser<
|
||||
Arguments extends unknown[] = unknown[],
|
||||
EventName extends string = string,
|
||||
Return extends unknown = unknown,
|
||||
Return = unknown,
|
||||
>(player: PlayerMp, eventName: EventName, args?: Arguments): Promise<Return>
|
||||
public async callBrowser(
|
||||
playerOrEventName: PlayerMp | string,
|
||||
eventNameOrArgs?: string | unknown[],
|
||||
args?: unknown[],
|
||||
) {
|
||||
_is1StParamPlayer(playerOrEventName)
|
||||
? this.log(
|
||||
'DEV callClient',
|
||||
eventNameOrArgs as string,
|
||||
playerOrEventName,
|
||||
eventNameOrArgs,
|
||||
args,
|
||||
)
|
||||
: this.log(
|
||||
'DEV callClient',
|
||||
playerOrEventName as string,
|
||||
eventNameOrArgs,
|
||||
)
|
||||
if (_is1StParamPlayer(playerOrEventName)) {
|
||||
this.log(
|
||||
'DEV callClient',
|
||||
eventNameOrArgs as string,
|
||||
playerOrEventName,
|
||||
eventNameOrArgs,
|
||||
args,
|
||||
)
|
||||
} else {
|
||||
this.log(
|
||||
'DEV callClient',
|
||||
playerOrEventName as string,
|
||||
eventNameOrArgs,
|
||||
)
|
||||
}
|
||||
|
||||
if (this.forceBrowserDevMode_) return
|
||||
Utils.errorUnknownEnvironment(this.environment_)
|
||||
|
||||
function _is1StParamPlayer(x: unknown): x is PlayerMp {
|
||||
return typeof x === 'object'
|
||||
}
|
||||
|
||||
function _is2NdParamEventName(x: unknown): x is string {
|
||||
return typeof x === 'string'
|
||||
}
|
||||
|
||||
const state: RPCState = {
|
||||
uuid: Utils.generateUUID(),
|
||||
eventName: !_is1StParamPlayer(playerOrEventName)
|
||||
@@ -424,6 +418,14 @@ class Rpc extends Wrapper {
|
||||
}
|
||||
|
||||
return (await this.responseHandler(state.uuid)).data
|
||||
|
||||
function _is1StParamPlayer(x: unknown): x is PlayerMp {
|
||||
return typeof x === 'object'
|
||||
}
|
||||
|
||||
function _is2NdParamEventName(x: unknown): x is string {
|
||||
return typeof x === 'string'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -446,14 +448,14 @@ class Rpc extends Wrapper {
|
||||
public async call<
|
||||
Arguments extends unknown[] = unknown[],
|
||||
EventName extends string = string,
|
||||
Return extends unknown = unknown,
|
||||
Return = unknown,
|
||||
>(eventName: EventName, args?: Arguments): Promise<Return> {
|
||||
this.log('call', eventName, args)
|
||||
if (this.forceBrowserDevMode_)
|
||||
return undefined as unknown as Promise<Return>
|
||||
Utils.errorUnknownEnvironment(this.environment_)
|
||||
|
||||
let state: RPCState = {
|
||||
const state: RPCState = {
|
||||
uuid: Utils.generateUUID(),
|
||||
eventName,
|
||||
calledTo: this.environment_,
|
||||
@@ -469,9 +471,7 @@ class Rpc extends Wrapper {
|
||||
/**
|
||||
* redirects an event in cases of it calling its own environment
|
||||
*/
|
||||
private async callSelf<Return extends unknown = unknown>(
|
||||
state: RPCState,
|
||||
): Promise<Return> {
|
||||
private async callSelf<Return = unknown>(state: RPCState): Promise<Return> {
|
||||
state = this.verifyEvent_(state)
|
||||
if (state.knownError) {
|
||||
this.triggerError_(state, state.knownError)
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
import { Wrapper } from './wrapper'
|
||||
import {
|
||||
type PlayerMp,
|
||||
Environment,
|
||||
Events,
|
||||
type PlayerMp,
|
||||
RPCEventType,
|
||||
RPCState,
|
||||
RpcWrapperConfig,
|
||||
@@ -20,7 +20,7 @@ export class Server extends Wrapper {
|
||||
) {
|
||||
super(options)
|
||||
|
||||
if (!!options.forceBrowserDevMode) return
|
||||
if (options.forceBrowserDevMode) return
|
||||
|
||||
// specific event to save player in context as it is not available on server -> server calls
|
||||
mp.events.add(
|
||||
@@ -35,7 +35,7 @@ export class Server extends Wrapper {
|
||||
* NOT INTENDED FOR OUT-OF-CONTEXT USE
|
||||
*/
|
||||
public _resolveEmitDestination(player: PlayerMp, dataRaw: string) {
|
||||
let state = Utils.prepareExecution(dataRaw)
|
||||
const state = Utils.prepareExecution(dataRaw)
|
||||
|
||||
switch (state.calledTo) {
|
||||
case Environment.SERVER:
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ export class Wrapper {
|
||||
|
||||
// checks if event is available (registered) in current environment
|
||||
protected verifyEvent_(data: string | RPCState): RPCState {
|
||||
let rpcData =
|
||||
const rpcData =
|
||||
typeof data === 'string' ? Utils.prepareExecution(data) : data
|
||||
|
||||
if (!this.state_[rpcData.eventName]) {
|
||||
|
||||
+4
-15
@@ -1,29 +1,18 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "RPC",
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"lib": [
|
||||
"ES6",
|
||||
"es2022",
|
||||
"dom"
|
||||
],
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
|
||||
"outDir": "bin",
|
||||
"esModuleInterop": true,
|
||||
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noImplicitAny": true,
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"./index.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"extends": ["../tsconfig.ragefw.json"]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
Custom Attribution-NoDerives Software License
|
||||
|
||||
Copyright (c) 2024 Entity Seven Group
|
||||
|
||||
This license allows you to use, copy, and distribute the RageFW (the "Software"), including for commercial purposes, provided that the following conditions are met:
|
||||
|
||||
1. **Attribution:** You must give appropriate credit to the original author of the Software, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
||||
|
||||
2. **No Derivative Works:** You may not modify, transform, or build upon the Software.
|
||||
|
||||
3. **Usage and Commercial Use:** You are allowed to use, sell, and gain income from projects that utilize the Software, as long as you comply with the terms of this license.
|
||||
|
||||
4. **No Additional Restrictions:** You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+58
-28
@@ -1,32 +1,62 @@
|
||||
{
|
||||
"name": "@entityseven/rage-fw-server",
|
||||
"version": "0.2.1-0.2.0-alpha.2.0",
|
||||
"private": false,
|
||||
"name": "@entityseven/rage-fw-server",
|
||||
"version": "0.2.0",
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md",
|
||||
"LICENSE",
|
||||
"package.json"
|
||||
],
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"readme.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsup"
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@entityseven/rage-fw-rpc": "workspace:*",
|
||||
"zod": "^3.24.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "22.12.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@entityseven/rage-fw-shared-types": "workspace:*",
|
||||
"@ragempcommunity/types-server": "^2.1.8",
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"description": "Package used on a server-side of your Rage:MP Server",
|
||||
"keywords": [
|
||||
"rage-fw-server",
|
||||
"ragefw",
|
||||
"rage-fw",
|
||||
"ragemp",
|
||||
"rage:mp",
|
||||
"rage",
|
||||
"gta5"
|
||||
],
|
||||
"author": "Entity Seven Group",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Danya H",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@entityseven/rage-fw-rpc": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@entityseven/rage-fw-shared-types": "workspace:^",
|
||||
"@ragempcommunity/types-server": "^2.1.8"
|
||||
},
|
||||
"description": "RageFW Server side",
|
||||
"keywords": [],
|
||||
"author": "SashaGoncharov19",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "rilaxik",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"gitHead": "ffd542c1deddb3033e16e0dae7557313ae09b05f"
|
||||
{
|
||||
"name": "Oleksandr Honcharov",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/SashaGoncharov19/"
|
||||
}
|
||||
],
|
||||
"license": "Custom-Attribution-NoDerivs",
|
||||
"gitHead": "ffd542c1deddb3033e16e0dae7557313ae09b05f"
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
# RageFW Server
|
||||
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs)
|
||||
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki)
|
||||
@@ -4,8 +4,8 @@ const { timestamp, printf, colorize } = format
|
||||
|
||||
/** Used to log in a server console */
|
||||
export class Logger {
|
||||
private format = printf(({ message, level, timestamp }) => {
|
||||
return `[${new Date(timestamp).toLocaleTimeString()}] [${level}]: ${message}`
|
||||
private format = printf(({ message, level }) => {
|
||||
return `[${new Date().toLocaleTimeString()}] [${level}]: ${message}`
|
||||
})
|
||||
|
||||
private systemLogger = winston.createLogger({
|
||||
|
||||
+4
-21
@@ -1,25 +1,8 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "Base",
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"display": "Server",
|
||||
"compilerOptions": {
|
||||
"incremental": false,
|
||||
"composite": false,
|
||||
"target": "ES2022",
|
||||
"experimentalDecorators": true,
|
||||
"moduleDetection": "auto",
|
||||
"module": "CommonJS",
|
||||
"resolveJsonModule": true,
|
||||
"declaration": true,
|
||||
"declarationMap": false,
|
||||
"sourceMap": false,
|
||||
"downlevelIteration": false,
|
||||
"inlineSourceMap": false,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
"types": ["./node_modules/@ragempcommunity/types-server/index.d.ts"]
|
||||
},
|
||||
"extends": ["../tsconfig.ragefw.json"]
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { defineConfig } from 'tsup'
|
||||
|
||||
export default defineConfig({
|
||||
entry: ['src/index.ts'],
|
||||
entry: ['src/**/*.ts'],
|
||||
outDir: './dist',
|
||||
format: ['cjs'],
|
||||
noExternal: ['rage-rpc'],
|
||||
experimentalDts: true,
|
||||
splitting: false,
|
||||
bundle: false,
|
||||
sourcemap: false,
|
||||
clean: true,
|
||||
})
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# Custom Attribution-NoDerives Software License
|
||||
|
||||
This license allows you to use, copy, and distribute the RageFW (the "Software"), including for commercial purposes, provided that the following conditions are met:
|
||||
|
||||
1. **Attribution:** You must give appropriate credit to the original author of the Software, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
||||
|
||||
2. **No Derivative Works:** You may not modify, transform, or build upon the Software.
|
||||
|
||||
3. **Usage and Commercial Use:** You are allowed to use, sell, and gain income from projects that utilize the Software, as long as you comply with the terms of this license.
|
||||
|
||||
4. **No Additional Restrictions:** You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,12 +1,30 @@
|
||||
{
|
||||
"name": "@entityseven/rage-fw-shared-types",
|
||||
"version": "0.2.1-0.2.0-alpha.2.0",
|
||||
"types": "types/types/index.d.ts",
|
||||
"private": false,
|
||||
"files": [
|
||||
"types/**/*"
|
||||
"types/**/*",
|
||||
"readme.md",
|
||||
"LICENSE",
|
||||
"package.json"
|
||||
],
|
||||
"author": "SashaGoncharov19",
|
||||
"license": "MIT",
|
||||
"types": "types/types/index.d.ts",
|
||||
"name": "@entityseven/rage-fw-shared-types",
|
||||
"version": "0.2.0",
|
||||
"description": "Package used among all environments of your Rage-FW based server",
|
||||
"keywords": ["rage-fw-shared-types", "rage-fw-shared","ragefw", "rage-fw", "ragemp", "rage:mp", "rage", "gta5"],
|
||||
"type": "module",
|
||||
"author": "Entity Seven Group",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Danya H",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/rilaxik/"
|
||||
},
|
||||
{
|
||||
"name": "Oleksandr Honcharov",
|
||||
"email": "[email protected]",
|
||||
"url": "https://github.com/SashaGoncharov19/"
|
||||
}
|
||||
],
|
||||
"license": "Custom-Attribution-NoDerives",
|
||||
"gitHead": "ffd542c1deddb3033e16e0dae7557313ae09b05f"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# RageFW Shared types
|
||||
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs)
|
||||
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki)
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"target": "es2022",
|
||||
"lib": [
|
||||
"ESNext",
|
||||
"ES2019",
|
||||
"es2022",
|
||||
"dom"
|
||||
],
|
||||
"moduleResolution": "node",
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"incremental": false,
|
||||
"composite": false,
|
||||
|
||||
"target": "es2022",
|
||||
"moduleDetection": "auto",
|
||||
"module": "commonjs",
|
||||
|
||||
"esModuleInterop": true,
|
||||
"experimentalDecorators": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noImplicitAny": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"downlevelIteration": false,
|
||||
"inlineSourceMap": false,
|
||||
"sourceMap": false
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist",
|
||||
".tsup"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user