From 13fd9e604c4387203c9e9728c56c9e116ac7e244 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 13 Jun 2024 12:41:21 +0200 Subject: [PATCH] Remove old interface Signed-off-by: Knut Ahlers --- editor/.eslintrc.js | 151 ----- src/app.vue | 356 ------------ src/automessages.vue | 445 -------------- src/const.js | 26 - src/generalConfig.vue | 778 ------------------------- src/main.js | 118 ---- src/raffle.vue | 1185 ------------------------------------- src/router.js | 35 -- src/rules.vue | 1282 ----------------------------------------- src/tplEditor.vue | 195 ------- 10 files changed, 4571 deletions(-) delete mode 100644 editor/.eslintrc.js delete mode 100644 src/app.vue delete mode 100644 src/automessages.vue delete mode 100644 src/const.js delete mode 100644 src/generalConfig.vue delete mode 100644 src/main.js delete mode 100644 src/raffle.vue delete mode 100644 src/router.js delete mode 100644 src/rules.vue delete mode 100644 src/tplEditor.vue diff --git a/editor/.eslintrc.js b/editor/.eslintrc.js deleted file mode 100644 index c2d2368..0000000 --- a/editor/.eslintrc.js +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Hack to automatically load globally installed eslint modules - * on Archlinux systems placed in /usr/lib/node_modules - * - * Source: https://github.com/eslint/eslint/issues/11914#issuecomment-569108633 - */ - -const Module = require('module') - -const hacks = [ - 'babel-eslint', - 'eslint-plugin-vue', -] - -const ModuleFindPath = Module._findPath -Module._findPath = (request, paths, isMain) => { - const r = ModuleFindPath(request, paths, isMain) - if (!r && hacks.includes(request)) { - return require.resolve(`/usr/lib/node_modules/${request}`) - } - return r -} - -/* - * ESLint configuration derived as differences from eslint:recommended - * with changes I found useful to ensure code quality and equal formatting - * https://eslint.org/docs/user-guide/configuring - */ - -module.exports = { - env: { - browser: true, - node: true, - }, - - extends: [ - 'plugin:vue/recommended', - 'eslint:recommended', // https://eslint.org/docs/rules/ - ], - - globals: { - process: true, - }, - - parserOptions: { - ecmaVersion: 2020, - parser: 'babel-eslint', - }, - - plugins: [ - // required to lint *.vue files - 'vue', - ], - - reportUnusedDisableDirectives: true, - - root: true, - - rules: { - 'array-bracket-newline': ['error', { multiline: true }], - 'array-bracket-spacing': ['error'], - 'arrow-body-style': ['error', 'as-needed'], - 'arrow-parens': ['error', 'as-needed'], - 'arrow-spacing': ['error', { after: true, before: true }], - 'block-spacing': ['error'], - 'brace-style': ['error', '1tbs'], - 'camelcase': ['error'], - 'comma-dangle': ['error', 'always-multiline'], - 'comma-spacing': ['error'], - 'comma-style': ['error', 'last'], - 'curly': ['error'], - 'default-case-last': ['error'], - 'default-param-last': ['error'], - 'dot-location': ['error', 'property'], - 'dot-notation': ['error'], - 'eol-last': ['error', 'always'], - 'eqeqeq': ['error', 'always', { null: 'ignore' }], - 'func-call-spacing': ['error', 'never'], - 'function-paren-newline': ['error', 'multiline'], - 'generator-star-spacing': ['off'], // allow async-await - 'implicit-arrow-linebreak': ['error'], - 'indent': ['error', 2], - 'key-spacing': ['error', { afterColon: true, beforeColon: false, mode: 'strict' }], - 'keyword-spacing': ['error'], - 'linebreak-style': ['error', 'unix'], - 'lines-between-class-members': ['error'], - 'multiline-comment-style': ['warn'], - 'newline-per-chained-call': ['error'], - 'no-alert': ['error'], - 'no-console': ['off'], - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', // allow debugger during development - 'no-duplicate-imports': ['error'], - 'no-else-return': ['error'], - 'no-empty-function': ['error'], - 'no-extra-parens': ['error'], - 'no-implicit-coercion': ['error'], - 'no-lonely-if': ['error'], - 'no-multi-spaces': ['error'], - 'no-multiple-empty-lines': ['warn', { max: 2, maxBOF: 0, maxEOF: 0 }], - 'no-promise-executor-return': ['error'], - 'no-return-assign': ['error'], - 'no-script-url': ['error'], - 'no-template-curly-in-string': ['error'], - 'no-trailing-spaces': ['error'], - 'no-unneeded-ternary': ['error'], - 'no-unreachable-loop': ['error'], - 'no-unsafe-optional-chaining': ['error'], - 'no-useless-return': ['error'], - 'no-var': ['error'], - 'no-warning-comments': ['error'], - 'no-whitespace-before-property': ['error'], - 'object-curly-newline': ['error', { consistent: true }], - 'object-curly-spacing': ['error', 'always'], - 'object-shorthand': ['error'], - 'padded-blocks': ['error', 'never'], - 'prefer-arrow-callback': ['error'], - 'prefer-const': ['error'], - 'prefer-object-spread': ['error'], - 'prefer-rest-params': ['error'], - 'prefer-template': ['error'], - 'quote-props': ['error', 'consistent-as-needed', { keywords: false }], - 'quotes': ['error', 'single', { allowTemplateLiterals: true }], - 'require-atomic-updates': ['error'], - 'require-await': ['error'], - 'semi': ['error', 'never'], - 'sort-imports': ['error', { ignoreCase: true, ignoreDeclarationSort: false, ignoreMemberSort: false }], - 'sort-keys': ['error', 'asc', { caseSensitive: true, natural: false }], - 'space-before-blocks': ['error', 'always'], - 'space-before-function-paren': ['error', 'never'], - 'space-in-parens': ['error', 'never'], - 'space-infix-ops': ['error'], - 'space-unary-ops': ['error', { nonwords: false, words: true }], - 'spaced-comment': ['warn', 'always'], - 'switch-colon-spacing': ['error'], - 'template-curly-spacing': ['error', 'never'], - 'unicode-bom': ['error', 'never'], - 'vue/new-line-between-multi-line-property': ['error'], - 'vue/no-empty-component-block': ['error'], - 'vue/no-reserved-component-names': ['error'], - 'vue/no-template-target-blank': ['error'], - 'vue/no-unused-properties': ['error'], - 'vue/no-unused-refs': ['error'], - 'vue/no-useless-mustaches': ['error'], - 'vue/order-in-components': ['off'], // Collides with sort-keys - 'vue/require-name-property': ['error'], - 'vue/v-for-delimiter-style': ['error'], - 'vue/v-on-function-call': ['error'], - 'wrap-iife': ['error'], - 'yoda': ['error'], - }, -} diff --git a/src/app.vue b/src/app.vue deleted file mode 100644 index c859531..0000000 --- a/src/app.vue +++ /dev/null @@ -1,356 +0,0 @@ - - - - - diff --git a/src/automessages.vue b/src/automessages.vue deleted file mode 100644 index bebe96d..0000000 --- a/src/automessages.vue +++ /dev/null @@ -1,445 +0,0 @@ - - - diff --git a/src/const.js b/src/const.js deleted file mode 100644 index 8ecace1..0000000 --- a/src/const.js +++ /dev/null @@ -1,26 +0,0 @@ -export const BUILTIN_TEMPLATE_FUNCTIONS = [ - 'and', - 'call', - 'html', - 'index', - 'slice', - 'js', - 'len', - 'not', - 'or', - 'print', - 'printf', - 'println', - 'urlquery', -] - -export const CRON_VALIDATION = /^(?:(?:@every (?:\d+(?:s|m|h))+)|(?:(?:(?:(?:\d+,)+\d+|(?:\d+(?:\/|-)\d+)|\d+|\*|\*\/\d+)(?: |$)){5}))$/ -export const NANO = 1000000000 - -export const NOTIFY_CHANGE_PENDING = 'changePending' -export const NOTIFY_CONFIG_RELOAD = 'configReload' -export const NOTIFY_ERROR = 'error' -export const NOTIFY_FETCH_ERROR = 'fetchError' -export const NOTIFY_LOADING_DATA = 'loadingData' - -export const REGEXP_USER = /^[a-z0-9_]{4,25}$/ diff --git a/src/generalConfig.vue b/src/generalConfig.vue deleted file mode 100644 index 9cdd28b..0000000 --- a/src/generalConfig.vue +++ /dev/null @@ -1,778 +0,0 @@ - - - diff --git a/src/main.js b/src/main.js deleted file mode 100644 index 257b357..0000000 --- a/src/main.js +++ /dev/null @@ -1,118 +0,0 @@ -/* eslint-disable sort-imports */ - -// Darkly design -import 'bootstrap/dist/css/bootstrap.css' -import 'bootstrap-vue/dist/bootstrap-vue.css' -import 'bootswatch/dist/darkly/bootstrap.css' - -import axios from 'axios' - -// Vue & BootstrapVue -import Vue from 'vue' -import { BootstrapVue } from 'bootstrap-vue' -import VueRouter from 'vue-router' - -Vue.use(BootstrapVue) -Vue.use(VueRouter) - -// FontAwesome -import { library } from '@fortawesome/fontawesome-svg-core' -import { fab } from '@fortawesome/free-brands-svg-icons' -import { fas } from '@fortawesome/free-solid-svg-icons' -import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome' - -library.add(fab, fas) -Vue.component('FontAwesomeIcon', FontAwesomeIcon) -Vue.component('FontAwesomeLayers', FontAwesomeLayers) - -// App -import App from './app.vue' -import Router from './router.js' - -Vue.config.devtools = process.env.NODE_ENV === 'dev' -Vue.config.silent = process.env.NODE_ENV !== 'dev' - -Vue.prototype.$bus = new Vue() - -new Vue({ - components: { App }, - computed: { - axiosOptions() { - return { - headers: { - authorization: this.authToken, - }, - } - }, - }, - - data: { - authToken: null, - commonToastOpts: { - appendToast: true, - autoHideDelay: 3000, - bodyClass: 'd-none', - solid: true, - toaster: 'b-toaster-bottom-right', - }, - - vars: {}, - }, - - el: '#app', - - methods: { - fetchVars() { - return axios.get('editor/vars.json') - .then(resp => { - this.vars = resp.data - }) - }, - - toastError(message, options = {}) { - this.$bvToast.toast('...', { - ...this.commonToastOpts, - ...options, - noAutoHide: true, - title: message, - variant: 'danger', - }) - }, - - toastInfo(message, options = {}) { - this.$bvToast.toast('...', { - ...this.commonToastOpts, - ...options, - title: message, - variant: 'info', - }) - }, - - toastSuccess(message, options = {}) { - this.$bvToast.toast('...', { - ...this.commonToastOpts, - ...options, - title: message, - variant: 'success', - }) - }, - }, - - mounted() { - this.fetchVars() - - const params = new URLSearchParams(window.location.hash.replace(/^[#/]+/, '')) - if (params.has('access_token')) { - this.authToken = params.get('access_token') || null - this.$router.replace({ name: 'general-config' }) - } - }, - - name: 'TwitchBotEditor', - - render(h) { - return h(App, { props: { isAuthenticated: Boolean(this.authToken) } }) - }, - - router: Router, -}) diff --git a/src/raffle.vue b/src/raffle.vue deleted file mode 100644 index f07104e..0000000 --- a/src/raffle.vue +++ /dev/null @@ -1,1185 +0,0 @@ - - - diff --git a/src/router.js b/src/router.js deleted file mode 100644 index 60191fe..0000000 --- a/src/router.js +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable sort-imports */ - -import VueRouter from 'vue-router' - -import Automessages from './automessages.vue' -import GeneralConfig from './generalConfig.vue' -import Raffle from './raffle.vue' -import Rules from './rules.vue' - -const routes = [ - { - component: GeneralConfig, - name: 'general-config', - path: '/', - }, - { - component: Automessages, - name: 'edit-automessages', - path: '/automessages', - }, - { - component: Raffle, - name: 'raffle', - path: '/raffle', - }, - { - component: Rules, - name: 'edit-rules', - path: '/rules', - }, -] - -export default new VueRouter({ - routes, -}) diff --git a/src/rules.vue b/src/rules.vue deleted file mode 100644 index c7a8216..0000000 --- a/src/rules.vue +++ /dev/null @@ -1,1282 +0,0 @@ - - - diff --git a/src/tplEditor.vue b/src/tplEditor.vue deleted file mode 100644 index 2ac2376..0000000 --- a/src/tplEditor.vue +++ /dev/null @@ -1,195 +0,0 @@ - - - - -