Skip to content

Commit

Permalink
Merge pull request #23 from ci010/beta
Browse files Browse the repository at this point in the history
Beta Release

Former-commit-id: 2b4121c
  • Loading branch information
ci010 authored Jul 6, 2019
2 parents 790924b + 4adc804 commit 47c97c6
Show file tree
Hide file tree
Showing 76 changed files with 2,459 additions and 1,883 deletions.
30 changes: 20 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"plugin:vue/recommended"
],
"plugins": [
"html",
"vue"
],
"settings": {
Expand All @@ -29,15 +28,24 @@
}
}
},
"rules": {
"import/extensions": [
"error",
"always",
{
"js": "never",
"vue": "never"
"overrides": [
{
"files": [
"src/**/*.vue"
],
"rules": {
"indent": [
"error",
2,
{
"SwitchCase": 1
}
]
}
],
}
],
"rules": {
"import/extensions": 0,
"vue/valid-v-if": "error",
"import/no-extraneous-dependencies": [
"error",
Expand Down Expand Up @@ -72,6 +80,8 @@
"no-mixed-operators": 0,
"no-plusplus": 0,
"space-before-function-paren": 0,
"object-curly-newline": 0
"object-curly-newline": 0,
"vue/max-attributes-per-line": 0,
"vue/html-closing-bracket-newline": 0
}
}
29 changes: 15 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Commented sections below can be used to run tests on the CI server
# https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing
osx_image: xcode8.3
sudo: required
dist: trusty
language: c
language: node_js
node_js: "10.16.0"

matrix:
include:
- os: osx
osx_image: xcode8.3
- os: linux
dist: trusty
env: CC=clang CXX=clang++ npm_config_clang=1
compiler: clang
- os: windows
cache:
directories:
- node_modules
Expand All @@ -22,23 +25,21 @@ addons:
- icnsutils
#- xvfb
before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
"$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
| tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install git-lfs; fi;
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then git lfs pull; else git pull; fi;

install:
#- export DISPLAY=':99.0'
#- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- nvm install 10
- curl -o- -L https://yarnpkg.com/install.sh | bash
- source ~/.bashrc
- npm install -g xvfb-maybe
- yarn
- npm run install:native
# - nvm install 10
# - curl -o- -L https://yarnpkg.com/install.sh | bash
# - source ~/.bashrc
# - npm install -g xvfb-maybe
- npm install
script:
#- xvfb-maybe node_modules/.bin/karma start test/unit/karma.conf.js
#- yarn run pack && xvfb-maybe node_modules/.bin/mocha test/e2e
- yarn run build
- npm run build
branches:
only:
- master
15 changes: 15 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"eamodio.gitlens",
"dbaeumer.vscode-eslint",
"yzhang.markdown-all-in-one",
"eg2.vscode-npm-script",
"ms-vscode.vscode-typescript-tslint-plugin",
"octref.vetur"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
22 changes: 11 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
"vue"
{
"language": "vue",
"autoFix": true
}
],
"eslint.options": {
"plugins": [
"html"
]
},
"eslint.enable": true,
"files.eol": "\n",
"files.exclude": {
Expand All @@ -21,16 +18,19 @@
"**/node_modules": true
},
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.validation.template": true,
"vetur.format.defaultFormatter.html": "none",
"vetur.format.defaultFormatterOptions": {
"vscode-typescript": {
"indent_size": 4
},
"js-beautify-html": {
"indent_char": " ",
"indent_character": " ",
"indent_inner_html": false,
"indent_size": 2,
"indent_with_tabs": true,
"indent_size": 4,
"indent_with_tabs": false,
"wrap_attributes": "auto",
"wrap_attributes_indent_size": 2,
"wrap_line_length": 100
}
},
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Voxelauncher

[![Build Status](https://travis-ci.org/ci010/VoxeLauncher.svg?branch=master)](https://travis-ci.org/ci010/VoxeLauncher)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e75f39022a114ab9aabf266425ae8b9e)](https://www.codacy.com/app/ci010/VoxeLauncher?utm_source=github.com&utm_medium=referral&utm_content=ci010/VoxeLauncher&utm_campaign=Badge_Grade)

> An WIP Minecraft Launcher based on electron-vue
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json.REMOVED.git-id

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "voxelauncher",
"productName": "VoxeLauncher",
"version": "0.0.1-alpha.3",
"version": "0.0.1-beta",
"author": "cijhn@hotmail.com",
"description": "A great minecraft launcher in the feature",
"license": "MIT",
Expand Down Expand Up @@ -109,7 +109,7 @@
"in-gfw": "^1.2.0",
"lzma-native": "^4.0.5",
"treelike-task": "^0.0.15",
"ts-minecraft": "^5.2.2",
"ts-minecraft": "^5.2.3",
"uuid": "^3.2.1",
"vue": "^2.6.10",
"vue-electron": "^1.0.6",
Expand Down
1 change: 1 addition & 0 deletions src/main/ipc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface CustomEvents {

on(channel: 'store-ready', listener: (store: Store<RootState>) => void): this;

on(channel: 'minecraft-window-ready', listener: () => void): this;
on(channel: 'minecraft-start', listener: () => void): this;
on(channel: 'minecraft-exit', listener: (exitStatus?: { code?: string, signal?: string, crashReport?: string, crashReportLocation?: string }) => void): this;
on(channel: 'minecraft-stdout', listener: (out: string) => void): this;
Expand Down
62 changes: 28 additions & 34 deletions src/main/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ export default function setup(context, store) {
context.configDock((dock) => {
});


let waitForReady = true;

context.ipcMain
.on('window-hide', (event, id) => {
id = id || event.sender.id;
Expand Down Expand Up @@ -110,7 +107,6 @@ export default function setup(context, store) {
}
})
.on('minecraft-start', () => {
waitForReady = true;
})
.on('minecraft-exit', (status) => {
if (mainRef) {
Expand All @@ -121,40 +117,38 @@ export default function setup(context, store) {
loggerRef = null;
}
})
.on('minecraft-stdout', (out) => {
if (waitForReady && out.indexOf('Reloading ResourceManager') !== -1 || out.indexOf('LWJGL Version: ') !== -1) {
waitForReady = false;

if (mainRef && mainRef.isVisible()) {
mainRef.webContents.send('minecraft-window-ready');
const { hideLauncher } = store.getters.selectedProfile;
if (hideLauncher) {
mainRef.hide();
}
.on('minecraft-window-ready', () => {
if (mainRef && mainRef.isVisible()) {
mainRef.webContents.send('minecraft-window-ready');
const { hideLauncher } = store.getters.selectedProfile;
if (hideLauncher) {
mainRef.hide();
}
}

if (loggerRef === undefined && store.getters.selectedProfile.showLog) {
createLoggerWindow();
}
if (loggerRef === undefined && store.getters.selectedProfile.showLog) {
createLoggerWindow();
}

context.configDock((dock) => {
dock.setMenu(Menu.buildFromTemplate([
{
label: 'Show Log',
type: 'normal',
click() {
if (!loggerRef) {
createLoggerWindow();
} else if (!loggerRef.isVisible()) {
loggerRef.show();
} else {
loggerRef.focus();
}
},
context.configDock((dock) => {
dock.setMenu(Menu.buildFromTemplate([
{
label: 'Show Log',
type: 'normal',
click() {
if (!loggerRef) {
createLoggerWindow();
} else if (!loggerRef.isVisible()) {
loggerRef.show();
} else {
loggerRef.focus();
}
},
]));
});
}
},
]));
});
})
.on('minecraft-stdout', (out) => {
if (loggerRef) {
loggerRef.webContents.send('minecraft-stdout', out);
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/setup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import { CustomEvents } from './ipc';
import { BrowserWindow, BrowserWindowConstructorOptions, Tray, Dock } from 'electron';
import { Repo } from '../universal/store/store';
interface Instance {
requestFocus(): void
dispose(): void
listeners: { [channel: string]: Function[] }
requestFocus(): void;
dispose(): void;
listeners: { [channel: string]: Function[] };
}
interface Hook {
requestFocus(): void
dispose(): void
requestFocus(): void;
dispose(): void;
}
interface Context {
createWindow(url: string, option: BrowserWindowConstructorOptions): BrowserWindow;
ipcMain: CustomEvents,
ipcMain: CustomEvents;
configTray(func: (tray: Tray) => void): this;
configDock(func: (dock: Dock) => void): this;
}
type Setup = (context: Context, store: Repo) => Hook;
type Setup = (context: Context, store: Repo) => Hook;
3 changes: 3 additions & 0 deletions src/main/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ async function load() {
root(state, r) { state.root = r; },
},
actions: {
async quit() {
app.quit();
},
async showItemInFolder(context, item) {
shell.showItemInFolder(item);
},
Expand Down
Loading

0 comments on commit 47c97c6

Please sign in to comment.