Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mapter228 authored Sep 27, 2024
0 parents commit efbf107
Show file tree
Hide file tree
Showing 73 changed files with 2,753 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/jsx-runtime',
],
overrides: [],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
globals: {
launcherAPI: 'readonly',
},
settings: {
react: {
version: 'detect',
},
},
};
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Releases Build

on:
push:
branches: [master]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- name: Cache NPM dependencies
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Download dependencies
run: npm i

- name: Build Launcher
run: npm run build

- name: Pack and publish Launcher
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Заменить на кастомный токен (например GH_TOKEN)
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Aurora files ignore
build
out

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

package-lock.json
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": true,
"singleQuote": true
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"syler.sass-indented",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "node",
"request": "launch",
"runtimeArgs": ["run-script", "dev"],
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal"
}
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020-2023 AuroraTeam

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.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<p align="center"><img src="./resources/icon.png" width="200px" height="200px"></p>
<h1 align="center">AuroraLauncher (Client)</h1>

Здесь содержится код программы лаунчера (клиентского интерфейса). Код лаунчсервера и других библиотек находится в [этом репозитории](https://github.com/AuroraTeam/AuroraLauncher).
39 changes: 39 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { esbuildDecorators } from '@aurora-launcher/esbuild-decorators';
import { context } from 'esbuild';
import minimist from 'minimist';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { _, watch, ...args } = minimist(process.argv.slice(2));

if (!watch) {
console.log('Build...');
console.time('Build successfully');
}

const ctx = await context({
entryPoints: ['src/main/index.ts'],
bundle: true,
sourcemap: true,
platform: 'node',
target: 'node20',
format: 'cjs',
outdir: 'build/main',
external: ['electron'],
keepNames: true,
loader: {
'.png': 'file',
//TODO Secure auth
'.pem': 'base64',
},
plugins: [esbuildDecorators()],
...args,
}).catch(() => process.exit(1));

if (watch) {
console.log('Watching...');
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
console.timeEnd('Build successfully');
}
19 changes: 19 additions & 0 deletions config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// import token from './public.pem';

export const window = {
width: 900,
height: 550,
frame: false,
resizable: false,
maximizable: false,
fullscreenable: false,
title: 'Aurora Launcher',
};

export const api = {
ws: 'ws://127.0.0.1:1370/ws',
web: 'http://127.0.0.1:1370',
// extraToken: token,
};

export const appPath = '.aurora-launcher';
128 changes: 128 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"name": "aurora-launcher-app",
"version": "0.0.4",
"description": "Launcher for Minecraft",
"main": "build/main/index.js",
"private": true,
"scripts": {
"dev": "concurrently -i -n electron,main,preload,renderer -c cyan.bold,blue.bold,yellow.bold,magenta.bold \"npm:start:dev\" \"npm:build:main -- --watch --sourcemap=inline\" \"npm:build:preload -- --watch --sourcemap=inline\" \"vite\"",
"build": "concurrently -n main,preload,renderer -c blue.bold,yellow.bold,magenta.bold \"npm:build:main\" \"npm:build:preload\" \"npm:build:renderer\" --kill-others-on-fail",
"build:main": "node build.mjs",
"build:preload": "esbuild src/preload/index.ts --platform=node --bundle --outdir=build/preload --external:electron --format=iife",
"build:renderer": "tsc && vite build",
"start:dev": "cross-env DEV=true nodemon --watch src --ext ts,tsx --ignore 'src/renderer' --exec npm run start:prod",
"start:prod": "electron .",
"clean": "rimraf build out",
"prettier": "prettier --config .prettierrc.json --write src",
"typecheck": "tsc --noEmit",
"lint": "eslint src --ext .ts,.tsx",
"lint:fix": "npm run lint -- --fix",
"pack": "electron-builder --dir",
"release": "electron-builder",
"obf": "javascript-obfuscator build/main/index.js --output build/main/index-obf.js --split-strings-chunk-length 8",
"bytenode": "bytenode -c build/main/index-obf.js -e"
},
"repository": {
"type": "git",
"url": "git+https://github.com/AuroraTeam/Launcher.git"
},
"author": "AuroraTeam",
"contributors": [
"JoCat (https://github.com/JoCat)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/AuroraTeam/Launcher/issues"
},
"homepage": "https://github.com/AuroraTeam/Launcher#readme",
"devDependencies": {
"@aurora-launcher/esbuild-decorators": "^0.0.1",
"@types/node": "^18.17.15",
"@types/react": "^18.0.18",
"@types/react-dom": "^18.0.6",
"@types/semver": "^7.3.8",
"@types/tar": "^6.1.6",
"@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"@vitejs/plugin-react": "^4.0.0",
"bytenode": "^1.5.3",
"concurrently": "^8.0.1",
"cross-env": "^7.0.3",
"electron": "^26.1.0",
"electron-builder": "^24.6.4",
"electron-extension-installer": "^1.1.3",
"esbuild": "^0.19.2",
"eslint": "^8.13.0",
"eslint-plugin-react": "^7.31.1",
"import-sort-style-module": "^6.0.0",
"javascript-obfuscator": "^4.1.0",
"minimist": "^1.2.8",
"nodemon": "^3.0.1",
"prettier": "^3.0.3",
"prettier-plugin-import-sort": "^0.0.7",
"rimraf": "^5.0.0",
"sass": "^1.55.0",
"source-map-support": "^0.5.21",
"typescript": "^5.0.4",
"vite": "^5.0.9"
},
"dependencies": {
"@aurora-launcher/api": "^0.3.0",
"@aurora-launcher/core": "^0.18.0",
"electron-updater": "^6.1.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.3.0",
"recoil": "^0.7.5",
"reflect-metadata": "^0.1.13",
"semver": "^7.3.5",
"skinview3d": "^2.2.1",
"tar": "^6.2.0",
"typedi": "^0.10.0"
},
"importSort": {
".tsx, .ts, .mjs, .js": {
"style": "module",
"parser": "typescript"
}
},
"build": {
"appId": "ru.aurora.launcher",
"productName": "Aurora Launcher",
"publish": [
{
"provider": "github",
"releaseType": "release",
"owner": "AuroraTeam",
"repo": "Launcher"
}
],
"directories": {
"buildResources": "resources"
},
"files": [
"build/**/*",
"!node_modules/**/*"
],
"nsis": {
"artifactName": "${name}-Setup-${version}.${ext}"
},
"mac": {
"category": "public.app-category.games"
},
"linux": {
"target": [
"deb",
"rpm",
"AppImage"
],
"category": "Game",
"maintainer": "AuroraTeam <[email protected]>"
}
},
"optionalDependencies": {
"@swc/core-linux-x64-gnu": "^1.3.96",
"@swc/core-linux-x64-musl": "^1.3.96"
}
}
Binary file added resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/common/channels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export const EVENTS = {
WINDOW: {
HIDE: 'window:hide',
CLOSE: 'window:close',
},
SCENES: {
LOGIN: {
AUTH: 'scenes:login:auth',
},
SERVERS_LIST: {
GET_SERVERS: 'scenes:serversList:getServers',
SELECT_SERVER: 'scenes:serversList:selectServer',
},
SERVER_PANEL: {
GET_PROFILE: 'scenes:serverPanel:getProfile',
GET_SERVER: 'scenes:serverPanel:getServer',
START_GAME: 'scenes:serverPanel:startGame',
TEXT_TO_CONSOLE: 'scenes:serverPanel:textToConsole',
LOAD_PROGRESS: 'scenes:serverPanel:loadProgress',
STOP_GAME: 'scenes:serverPanel:stopGame',
},
},
};
Loading

0 comments on commit efbf107

Please sign in to comment.