Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
feat(gui): initial version of a GUI for configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
nysos3 committed Mar 7, 2019
1 parent 6ebfdc7 commit cb16ed4
Show file tree
Hide file tree
Showing 112 changed files with 27,045 additions and 7,344 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not ie <= 8
66 changes: 63 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,66 @@
module.exports = {
root: true,
extends: [
'@clickagy/eslint-config'
]
env: {
node: true,
},
'extends': [
'plugin:vue/recommended',
'@vue/standard',
],
rules: {
// Allow async-await
'generator-star-spacing': 'off',
// No async function without await
'require-await': 'error',
'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
// Prefer const over let
'prefer-const': ['error', {
'destructuring': 'any',
'ignoreReadBeforeAssign': false,
}],
// No single if in an 'else' block
'no-lonely-if': 'error',
// Force curly braces for control flow, including if blocks with a single statement
curly: ['error', 'all'],
// Force dot notation when possible
'dot-notation': 'error',
'no-var': 'error',
'comma-dangle': ['error', 'always-multiline'],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/max-attributes-per-line': [
'error',
{
singleline: 2,
multiline: {
max: 1,
allowFirstLine: false,
},
},
],
'vue/component-name-in-template-casing': [
'error',
'kebab-case',
{
ignores: [],
},
],
'vue/html-indent': [
'error',
2,
{
attribute: 1,
baseIndent: 0,
closeBracket: 0,
alignAttributesVertically: true,
ignores: [],
},
],
'vue/no-parsing-error': ['error', {
'x-invalid-end-tag': false,
}],
},
parserOptions: {
parser: 'babel-eslint',
},
}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,22 @@ $RECYCLE.BIN/
/*.log
/lib-es5/
/Air-for-Steam*/

/dist

/tests/e2e/videos/
/tests/e2e/screenshots/

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

*.sw*

#Electron-builder output
/dist_electron
40 changes: 29 additions & 11 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
overrides: [{
test: './lib',
presets: [
[
'@babel/env',
{
modules: 'commonjs',
},
},
],
],
],
plugins: [
'transform-runtime',
],
plugins: [
[
'@babel/transform-runtime',
{
corejs: false,
helpers: true,
regenerator: true,
useESModules: false,
},
],
],
}],
}

// module.exports = {
// presets: [
// '@vue/app',
// ],
// plugins: [

// ],
// }
10 changes: 1 addition & 9 deletions bin/airforsteam.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
#!/usr/bin/env node

let es6
try {
// eslint-disable-next-line no-new-func
es6 = new Function('() => {}')
} catch (e) {
es6 = false
}
es6 ? require('../lib/cli') : require('../lib-es5/cli')
module.exports = require('../lib-es5/cli')
Binary file added build/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"node_modules"
],
"include": [
"lib/**/*"
"lib/**/*", "lib/.babelrc.js"
]
}
52 changes: 15 additions & 37 deletions lib/actions/configure.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
const os = require('os')
const path = require('path')
const fs = require('fs-extra')
const inquirer = require('inquirer')
const chalk = require('chalk')
const platformFolders = require('platform-folders')
const emoji = require('../utils/emoji')
const installSkin = require('../utils/install-skin')
import os from 'os'
import path from 'path'
import fs from 'fs-extra'
import inquirer from 'inquirer'
import chalk from 'chalk'
import { getConfigHome } from 'platform-folders'
import emoji from '../utils/emoji'
import installSkin from '../utils/install-skin'
import repoHelper from '../utils/repo-helper'

async function configure (state) {
// download from airforsteam github
await repoHelper.download(state)
// get options from the user
await askForTheme(state)
await askForColor(state)
Expand All @@ -28,7 +31,7 @@ function askForTheme (state) {
name: 'theme',
message: `Select a theme:`,
type: 'list',
choices: ['Dark', 'Blue', 'Light'],
choices: state.get('availableThemes'),
default: state.get('theme'),
},
{
Expand All @@ -45,32 +48,7 @@ function askForTheme (state) {
}

function askForColor (state) {
const availableColors = {
sky: 'Material Blue',
sea: 'Material Teal',
breeze: 'Material Light Blue',
slate: 'Material Blue Grey',
truffle: 'Dark Brown',
gunmetal: 'Black',
silver: 'Material Grey',
grass: 'Material Green',
rose: 'Material Pink',
cinnabar: 'Material Red',
lavender: 'Material Indigo',
lilac: 'Material Deep Purple (Kinda)',
deeppurple: 'Material Deep Purple (For real)',
steamblue: 'Steam Blue (Recommended for Blue Theme)',
youtubered: 'YouTube Red',
numix: 'Contributed by Markus-Deviant (markus-deviant.deviantart.com), Numix Project by Satyajit (satya164.deviantart.com)',
happyorange: 'Contributed by Xanoxis',
emerald: 'Contributed by Jarlave',
google: 'Contributed by CorruptComputer',
materialblue: 'Contributed by iavenjqasdf',
spotify: 'Spotify Green. Contributed by Mamulokki',
deepblue: 'Contributed by Absolute Zero',
'kdeplasma5-darkbreeze': 'Contributed by plata',
pixeldark: 'Contributed by snowtyler',
}
const availableColors = state.get('availableColors')

if (state.get('theme') !== 'Dark') {
delete availableColors.spotify
Expand Down Expand Up @@ -117,7 +95,7 @@ async function askForInstallPath (state) {

if (defaultLocation === '') {
if (os.type() === 'Darwin') {
defaultLocation = path.resolve(platformFolders.getConfigHome(), 'Steam', 'Steam.AppBundle', 'Steam', 'Contents', 'MacOS', 'skins')
defaultLocation = path.resolve(getConfigHome(), 'Steam', 'Steam.AppBundle', 'Steam', 'Contents', 'MacOS', 'skins')
} else if (os.type() === 'Windows_NT') {
defaultLocation = 'C:\\Program Files (x86)\\Steam\\skins'
} else if (os.type() === 'Linux') {
Expand Down Expand Up @@ -146,4 +124,4 @@ async function askForInstallPath (state) {
}
}

module.exports = configure
export default configure
10 changes: 10 additions & 0 deletions lib/actions/reinstall-skin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import repoHelper from '../utils/repo-helper'
import installSkin from '../utils/install-skin'

async function reinstallSkin (state) {
await repoHelper.download(state)

await installSkin(state)
}

export default reinstallSkin
12 changes: 6 additions & 6 deletions lib/actions/setup.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const chalk = require('chalk')
const confirmFontsInstalled = require('../utils/font-helper')
const repoHelper = require('../utils/repo-helper')
const emoji = require('../utils/emoji')
const configure = require('./configure')
import chalk from 'chalk'
import confirmFontsInstalled from '../utils/font-helper'
import repoHelper from '../utils/repo-helper'
import emoji from '../utils/emoji'
import configure from './configure'

async function setup (state) {
const latestVersion = await repoHelper.getVersion(state)
Expand All @@ -20,4 +20,4 @@ async function setup (state) {
await configure(state)
}

module.exports = setup
export default setup
10 changes: 5 additions & 5 deletions lib/actions/update.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const chalk = require('chalk')
const repoHelper = require('../utils/repo-helper')
const emoji = require('../utils/emoji')
const installSkin = require('../utils/install-skin')
import chalk from 'chalk'
import repoHelper from '../utils/repo-helper'
import emoji from '../utils/emoji'
import installSkin from '../utils/install-skin'

async function update (state) {
const updateAvailable = await repoHelper.updateAvailable(state)
Expand All @@ -18,4 +18,4 @@ async function update (state) {
state.pr()
}

module.exports = update
export default update
Loading

0 comments on commit cb16ed4

Please sign in to comment.