Compare commits

...
15 Commits
Author SHA1 Message Date
Oleksandr Honcharov 22e2c6f980 v0.1.0 2024-06-15 16:47:36 +03:00
Oleksandr Honcharov 059dc7bed8 production files readme 2024-06-15 16:47:14 +03:00
sashagoncharov19 93b0cb1979 Update cli/src/utils/update.ts 2024-06-15 13:42:17 +00:00
rilaxik 37fdfa6d90 added issue template 2024-06-15 14:35:36 +01:00
rilaxik 7bf9433bef readme bump 2024-06-14 20:44:45 +01:00
rilaxik 15254a35ba readme docs reference 2024-06-14 19:06:47 +01:00
rilaxik 2b523fcbe5 license 2024-06-14 18:09:24 +01:00
rilaxik 4f4723625e readme bump 2024-06-14 17:59:16 +01:00
rilaxik 93922288b1 readme updates + wiki references 2024-06-14 17:58:04 +01:00
Oleksandr Honcharov 630c06bb91 v0.0.30-alpha.0 2024-06-13 23:08:00 +03:00
Oleksandr Honcharov 31136ad7e0 some fixes 2024-06-13 23:07:43 +03:00
Oleksandr Honcharov e9f77bf88d v0.0.29-alpha.0 2024-06-13 22:57:52 +03:00
Oleksandr Honcharov 424513dd56 v0.0.28-alpha.0 2024-06-13 22:48:02 +03:00
Oleksandr Honcharov 36c241a117 cli rework 2024-06-13 22:47:33 +03:00
Oleksandr Honcharov 333bd9df13 v0.0.27-alpha.0 2024-06-13 22:03:27 +03:00
18 changed files with 225 additions and 56 deletions
+63
View File
@@ -0,0 +1,63 @@
name: Bug Report
about: Create a report to help us improve
rules:
- All issues must be reported in English
- Ensure you have searched for existing issues before creating a new one
- Provide as much detail as possible to help us resolve the issue efficiently
body:
- type: dropdown
id: package_version
attributes:
label: Package Version
description: Select the version of the package where the bug was found
options:
- 0.1.0
validations:
required: true
- type: textarea
id: bug_description
attributes:
label: Bug Description
description: Provide a detailed description of the bug
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction (Optional)
description: Steps to reproduce the bug, if applicable
validations:
required: true
- type: dropdown
id: os
attributes:
label: OS Where the Bug Was Found
description: Select the operating system where the bug was found
options:
- Windows
- macOS
- Linux
- Other (please specify at the end of bug description)
validations:
required: true
- type: input
id: cli_version
attributes:
label: CLI Version (Optional)
description: Specify the CLI version if used
validations:
required: false
- type: textarea
id: additional_information
attributes:
label: Additional Information
description: Add any other information that might be useful in diagnosing the issue
validations:
required: false
+3 -2
View File
@@ -1,10 +1,11 @@
{ {
"name": "rage-fw-cef", "name": "rage-fw-cef",
"version": "0.0.26-alpha.0", "version": "0.1.0",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
"files": [ "files": [
"dist/**/*" "dist/**/*",
"readme.md"
], ],
"scripts": { "scripts": {
"build": "tsup" "build": "tsup"
+2
View File
@@ -0,0 +1,2 @@
# RageFW CEF
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs)
+5 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "create-rage-fw", "name": "create-rage-fw",
"version": "0.0.26-alpha.0", "version": "0.1.0",
"bin": { "bin": {
"rage-fw": "dist/index.js" "rage-fw": "dist/index.js"
}, },
@@ -10,6 +10,10 @@
"build": "tsup", "build": "tsup",
"start": "npx ./dist create" "start": "npx ./dist create"
}, },
"files": [
"dist/**/*",
"readme.md"
],
"description": "CLI to scaffold a template project for RageFW", "description": "CLI to scaffold a template project for RageFW",
"keywords": [], "keywords": [],
"author": "rilaxik", "author": "rilaxik",
+29
View File
@@ -0,0 +1,29 @@
# 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/)
``pnpm create rage-fw@latest``
## TL;DR
- ``Initialize new project`` - create new template project
- ``Install RAGE:MP updater`` - download and update RAGE:MP server files
## Options
For now, you will see a few available options. They are described in detail below
- ``Initialize new project``
- ``Install RAGE:MP updater``
### Initialize new project
Using this options will forward you to common project-creation menu
- ``Enter project name``
This option will specify a name for your project which is used as a folder name too. Defaults to **rage-fw**
- ``Select frontend``
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)**
### Install Rage:MP updater
This option will simplify installation process of Rage:MP server files required to start your server
+6 -36
View File
@@ -1,31 +1,11 @@
import type { CommandModule, Argv, ArgumentsCamelCase } from 'yargs'
import c from 'chalk' import c from 'chalk'
import { input, select } from '@inquirer/prompts' import { input, select } from '@inquirer/prompts'
import clone from 'git-clone' import clone from 'git-clone'
import path from 'node:path' import path from 'node:path'
import { checkForUpdate } from '../utils/update' export async function initProject() {
let folder
function builder(yargs: Argv) { let framework
return yargs
.option('projectName', {
alias: 'p',
description: 'Name of the folder to scaffold a project to',
type: 'string',
demandOption: false,
})
.option('template', {
alias: 't',
description: 'Frontend framework to use for CEF',
type: 'string',
demandOption: false,
})
.middleware(async () => await checkForUpdate())
}
async function handler(args: ArgumentsCamelCase) {
let folder = (args.projectName as string) ?? args.p
let framework = (args.template as string) ?? args.t
if (!folder) { if (!folder) {
folder = await input({ folder = await input({
@@ -68,7 +48,7 @@ async function handler(args: ArgumentsCamelCase) {
clone( clone(
'https://git.entityseven.com/entityseven/rage-framework-example', 'https://git.entityseven.com/entityseven/rage-framework-example',
path.join(__dirname, folder), path.join(process.cwd(), folder),
{}, {},
err => { err => {
if (err) { if (err) {
@@ -77,20 +57,10 @@ async function handler(args: ArgumentsCamelCase) {
} }
console.log(c.gray('Scaffolded project into'), folder) console.log(c.gray('Scaffolded project into'), folder)
console.log( console.log(
c.blueBright( c.gray(
'Working on Rage Framework. RageFW © Powered by Entity Seven Group', `Project was created ar dir: ${path.join(process.cwd(), folder)}`,
), ),
) )
}, },
) )
} }
const init: CommandModule = {
command: 'create [folderName] [template]',
aliases: 'c',
describe: 'Scaffold a template project using RageFW',
builder,
handler,
}
export default init
+37
View File
@@ -0,0 +1,37 @@
import axios from 'axios'
import * as fs from 'node:fs'
const latestReleases =
'https://git.entityseven.com/api/v1/repos/entityseven/rage-server-downloader/releases?page=1&limit=1'
type Release = {
id: number
}
type Asset = {
browser_download_url: string
}
export async function downloadUpdater(): Promise<void> {
const id = await getLatestReleaseID()
const latestAssets = `https://git.entityseven.com/api/v1/repos/entityseven/rage-server-downloader/releases/${id}/assets?page=1&limit=1`
axios.get<Asset[]>(latestAssets).then(async ({ data }) => {
const downloadURL = data[0].browser_download_url
const file = await axios.get(data[0].browser_download_url, {
responseType: 'arraybuffer',
})
const fileData = Buffer.from(file.data, 'binary')
const fileSplit = downloadURL.split('/')
const fileName = fileSplit[fileSplit.length - 1]
fs.writeFileSync(`./${fileName}`, fileData)
})
}
async function getLatestReleaseID() {
return axios.get<Release[]>(latestReleases).then(({ data }) => data[0].id)
}
+38 -9
View File
@@ -1,11 +1,40 @@
import yargs from 'yargs' import c from 'chalk'
import { select } from '@inquirer/prompts'
import create from './commands/create' import { checkForUpdate } from './utils/update'
import { initProject } from './commands/create'
import { downloadUpdater } from './commands/download-updater'
yargs enum Actions {
.usage('<cmd> [args]') INIT_PROJECT = 'INIT_PROJECT',
// .scriptName('rage-fw') UPDATER = 'UPDATER',
// .usage('$0 <cmd> [args]') }
// @ts-ignore
.command(create) ;(async () => {
.help().argv await checkForUpdate()
console.log(
c.blueBright('Rage FW CLI | Powered by Entity Seven Group <3'),
)
const action = await select({
message: c.gray('Select action:'),
choices: [
{
name: 'Initialize new project',
value: Actions.INIT_PROJECT,
description: 'Initialize new project and start develop',
},
{
name: 'Install RAGE:MP updater',
value: Actions.UPDATER,
description:
'Use our custom updater to download and update RAGE:MP server files.',
},
],
loop: true,
})
if (action === Actions.INIT_PROJECT) await initProject()
if (action === Actions.UPDATER) await downloadUpdater()
})()
+2 -1
View File
@@ -18,8 +18,9 @@ export async function checkForUpdate(): Promise<void> {
.then(({ data }) => { .then(({ data }) => {
const latestVersion = data[0].name const latestVersion = data[0].name
if (!(latestVersion === version)) if (latestVersion !== `v${version}`)
notifyUserAboutUpdate(latestVersion) notifyUserAboutUpdate(latestVersion)
else console.log(c.yellow(`Version: ${version}`))
}) })
.then(() => res()), .then(() => res()),
) )
+3 -2
View File
@@ -1,10 +1,11 @@
{ {
"name": "rage-fw-client", "name": "rage-fw-client",
"version": "0.0.26-alpha.0", "version": "0.1.0",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
"files": [ "files": [
"dist/**/*" "dist/**/*",
"readme.md"
], ],
"scripts": { "scripts": {
"build": "tsup" "build": "tsup"
+2
View File
@@ -0,0 +1,2 @@
# RageFW Client
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs)
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"$schema": "node_modules/lerna/schemas/lerna-schema.json", "$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.26-alpha.0", "version": "0.1.0",
"npmClient": "pnpm" "npmClient": "pnpm"
} }
+13
View File
@@ -0,0 +1,13 @@
# Custom Attribution-NoDerivs 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.
+13 -1
View File
@@ -9,7 +9,16 @@ RageFW is a type-safe framework for developing Rage:MP servers. Designed with de
- **Logging System:** Keep track of server activities and debug like a pro with our built-in, feature-rich logging system. After all, even virtual cops need evidence - **Logging System:** Keep track of server activities and debug like a pro with our built-in, feature-rich logging system. After all, even virtual cops need evidence
## Getting Started ## Getting Started
*soon* You can find out more about our CLI [here](https://git.entityseven.com/entityseven/rage-framework/wiki/CLI)
At the moment automation we have only works via [pnpm](https://pnpm.io/). To scaffold a basic project with minor settings you can use our CLI:
``pnpm create rage-fw``
This will give you a few options, among them, you can find ``Initialize new project``. Use that option to scaffold a new project for yourself using the preferred frontend framework
## Documentation
[Available here](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs+%40+0.0.30-alpha.0.-)
## Contributing ## Contributing
Join our community of developers and contribute to the ongoing development of RageFW. At the moment the only way to contribute is opening issues Join our community of developers and contribute to the ongoing development of RageFW. At the moment the only way to contribute is opening issues
@@ -17,4 +26,7 @@ Join our community of developers and contribute to the ongoing development of Ra
## Support ## Support
Need help? Reach out via our community forums or contact us directly through our support channels. We're committed to help you as we can Need help? Reach out via our community forums or contact us directly through our support channels. We're committed to help you as we can
## License
Licensed under **Custom Attribution-NoDerivs Software License**
> *RageFW - because in the world of GTA:RP, nobody has time for type errors* > *RageFW - because in the world of GTA:RP, nobody has time for type errors*
+3 -2
View File
@@ -1,10 +1,11 @@
{ {
"name": "rage-fw-server", "name": "rage-fw-server",
"version": "0.0.26-alpha.0", "version": "0.1.0",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
"files": [ "files": [
"dist/**/*" "dist/**/*",
"readme.md"
], ],
"scripts": { "scripts": {
"build": "tsup" "build": "tsup"
+2
View File
@@ -0,0 +1,2 @@
# RageFW Server
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs)
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "rage-fw-shared-types", "name": "rage-fw-shared-types",
"version": "0.0.26-alpha.0", "version": "0.1.0",
"types": "types/types/index.d.ts", "types": "types/types/index.d.ts",
"files": [ "files": [
"types/**/*" "types/**/*"
+2
View File
@@ -0,0 +1,2 @@
# RageFW Shared types
[Read docs for details](https://git.entityseven.com/entityseven/rage-framework/wiki/Docs)