Restructure files
This commit is contained in:
parent
afc5854615
commit
19a51f8df7
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
<script>
|
||||
import * as skinview3d from 'skinview3d'
|
||||
import { emit } from '../js/event'
|
||||
import { emit } from '../scripts/event'
|
||||
import SkinSteve from '../images/textures/steve.png'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import Vue from 'vue'
|
||||
import './js'
|
||||
import * as emitter from './js/event'
|
||||
import routes from './route'
|
||||
import './scripts'
|
||||
import * as emitter from './scripts/event'
|
||||
import routes from './scripts/route'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
|
|
|
|||
|
|
@ -1,100 +0,0 @@
|
|||
export default [
|
||||
{
|
||||
path: '/',
|
||||
module: [() => import('./stylus/home.styl')],
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
component: () => import('./views/user/Dashboard.vue'),
|
||||
el: '#usage-box',
|
||||
},
|
||||
{
|
||||
path: 'user/closet',
|
||||
component: () => import('./views/user/Closet.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'user/player',
|
||||
component: () => import('./views/user/Players.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'user/player/bind',
|
||||
component: () => import('./views/user/Bind.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'user/profile',
|
||||
component: () => import('./views/user/Profile.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin',
|
||||
module: [() => import('./views/admin/Dashboard')],
|
||||
},
|
||||
{
|
||||
path: 'admin/users',
|
||||
component: () => import('./views/admin/Users.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin/players',
|
||||
component: () => import('./views/admin/Players.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin/customize',
|
||||
component: () => import('./views/admin/Customization.vue'),
|
||||
el: '#change-color',
|
||||
},
|
||||
{
|
||||
path: 'admin/plugins/manage',
|
||||
component: () => import('./views/admin/Plugins.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin/plugins/market',
|
||||
component: () => import('./views/admin/Market.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin/update',
|
||||
component: () => import('./views/admin/Update.vue'),
|
||||
el: '#update-button',
|
||||
},
|
||||
{
|
||||
path: 'auth/login',
|
||||
component: () => import('./views/auth/Login.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'auth/register',
|
||||
component: () => import('./views/auth/Register.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'auth/forgot',
|
||||
component: () => import('./views/auth/Forgot.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'auth/reset/(\\d+)',
|
||||
component: () => import('./views/auth/Reset.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'skinlib',
|
||||
component: () => import('./views/skinlib/List.vue'),
|
||||
el: '.content-wrapper',
|
||||
},
|
||||
{
|
||||
path: 'skinlib/show/(\\d+)',
|
||||
component: () => import('./views/skinlib/Show.vue'),
|
||||
el: '.content > .row:nth-child(1)',
|
||||
},
|
||||
{
|
||||
path: 'skinlib/upload',
|
||||
component: () => import('./views/skinlib/Upload.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
]
|
||||
100
resources/assets/src/scripts/route.ts
Normal file
100
resources/assets/src/scripts/route.ts
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
export default [
|
||||
{
|
||||
path: '/',
|
||||
module: [() => import('../styles/home.styl')],
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
component: () => import('../views/user/Dashboard.vue'),
|
||||
el: '#usage-box',
|
||||
},
|
||||
{
|
||||
path: 'user/closet',
|
||||
component: () => import('../views/user/Closet.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'user/player',
|
||||
component: () => import('../views/user/Players.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'user/player/bind',
|
||||
component: () => import('../views/user/Bind.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'user/profile',
|
||||
component: () => import('../views/user/Profile.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin',
|
||||
module: [() => import('../views/admin/Dashboard')],
|
||||
},
|
||||
{
|
||||
path: 'admin/users',
|
||||
component: () => import('../views/admin/Users.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin/players',
|
||||
component: () => import('../views/admin/Players.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin/customize',
|
||||
component: () => import('../views/admin/Customization.vue'),
|
||||
el: '#change-color',
|
||||
},
|
||||
{
|
||||
path: 'admin/plugins/manage',
|
||||
component: () => import('../views/admin/Plugins.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin/plugins/market',
|
||||
component: () => import('../views/admin/Market.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
{
|
||||
path: 'admin/update',
|
||||
component: () => import('../views/admin/Update.vue'),
|
||||
el: '#update-button',
|
||||
},
|
||||
{
|
||||
path: 'auth/login',
|
||||
component: () => import('../views/auth/Login.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'auth/register',
|
||||
component: () => import('../views/auth/Register.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'auth/forgot',
|
||||
component: () => import('../views/auth/Forgot.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'auth/reset/(\\d+)',
|
||||
component: () => import('../views/auth/Reset.vue'),
|
||||
el: 'form',
|
||||
},
|
||||
{
|
||||
path: 'skinlib',
|
||||
component: () => import('../views/skinlib/List.vue'),
|
||||
el: '.content-wrapper',
|
||||
},
|
||||
{
|
||||
path: 'skinlib/show/(\\d+)',
|
||||
component: () => import('../views/skinlib/Show.vue'),
|
||||
el: '.content > .row:nth-child(1)',
|
||||
},
|
||||
{
|
||||
path: 'skinlib/upload',
|
||||
component: () => import('../views/skinlib/Upload.vue'),
|
||||
el: '.content',
|
||||
},
|
||||
]
|
||||
|
|
@ -5,7 +5,7 @@ import 'echarts/lib/chart/line'
|
|||
import 'echarts/lib/component/dataZoom'
|
||||
import 'echarts/lib/component/legend'
|
||||
import 'echarts/lib/component/tooltip'
|
||||
import { get } from '../../js/net'
|
||||
import { get } from '../../scripts/net'
|
||||
|
||||
interface ChartData {
|
||||
labels: string[]
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
<script>
|
||||
import { VueGoodTable } from 'vue-good-table'
|
||||
import 'vue-good-table/dist/vue-good-table.min.css'
|
||||
import { trans } from '../../js/i18n'
|
||||
import { trans } from '../../scripts/i18n'
|
||||
import tableOptions from '../../components/mixins/tableOptions'
|
||||
import serverTable from '../../components/mixins/serverTable'
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ import ButtonGroup from 'element-ui/lib/button-group'
|
|||
import 'element-ui/lib/theme-chalk/select.css'
|
||||
import Select from 'element-ui/lib/select'
|
||||
import Option from 'element-ui/lib/option'
|
||||
import { queryString } from '../../js/utils'
|
||||
import { queryString } from '../../scripts/utils'
|
||||
import SkinLibItem from '../../components/SkinLibItem.vue'
|
||||
|
||||
Vue.use(ButtonGroup)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
@import "../../stylus/auth.styl"
|
||||
@import "../../styles/auth.styl"
|
||||
|
||||
.player-select
|
||||
width 100%
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@
|
|||
|
||||
<script>
|
||||
import Paginate from 'vuejs-paginate'
|
||||
import { debounce, queryString } from '../../js/utils'
|
||||
import { debounce, queryString } from '../../scripts/utils'
|
||||
import ClosetItem from '../../components/ClosetItem.vue'
|
||||
import EmailVerification from '../../components/EmailVerification.vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import Vue from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Previewer from '@/components/Previewer.vue'
|
||||
import * as emitter from '@/js/event'
|
||||
import * as emitter from '@/scripts/event'
|
||||
import * as mockedSkinview3d from '../__mocks__/skinview3d'
|
||||
|
||||
type Viewer = Vue & { viewer: mockedSkinview3d.SkinViewer }
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import {
|
||||
checkForUpdates,
|
||||
checkForPluginUpdates,
|
||||
} from '@/js/check-updates'
|
||||
import { init } from '@/js/net'
|
||||
} from '@/scripts/check-updates'
|
||||
import { init } from '@/scripts/net'
|
||||
|
||||
test('check for BS updates', async () => {
|
||||
window.fetch = jest.fn()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import * as emitter from '@/js/event'
|
||||
import * as emitter from '@/scripts/event'
|
||||
|
||||
test('add listener and emit event', () => {
|
||||
const mockA = jest.fn()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { trans } from '@/js/i18n'
|
||||
import { trans } from '@/scripts/i18n'
|
||||
import Vue from 'vue'
|
||||
|
||||
test('mount to global', () => {
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { logout } from '@/js/logout'
|
||||
import { post } from '@/js/net'
|
||||
import { MessageBox } from '@/js/element'
|
||||
import { logout } from '@/scripts/logout'
|
||||
import { post } from '@/scripts/net'
|
||||
import { MessageBox } from '@/scripts/element'
|
||||
|
||||
jest.mock('@/js/net')
|
||||
jest.mock('@/js/element')
|
||||
jest.mock('@/scripts/net')
|
||||
jest.mock('@/scripts/element')
|
||||
|
||||
test('log out', async () => {
|
||||
MessageBox.confirm
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import Vue from 'vue'
|
||||
import * as net from '@/js/net'
|
||||
import { on } from '@/js/event'
|
||||
import { showAjaxError } from '@/js/notify'
|
||||
import * as net from '@/scripts/net'
|
||||
import { on } from '@/scripts/event'
|
||||
import { showAjaxError } from '@/scripts/notify'
|
||||
|
||||
jest.mock('@/js/notify')
|
||||
jest.mock('@/scripts/notify')
|
||||
|
||||
;(window as Window & { Request: any }).Request = class {
|
||||
headers: Map<string, string>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import $ from 'jquery'
|
||||
import * as notify from '@/js/notify'
|
||||
import * as notify from '@/scripts/notify'
|
||||
|
||||
test('show AJAX error', () => {
|
||||
// @ts-ignore
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import * as utils from '@/js/utils'
|
||||
import * as utils from '@/scripts/utils'
|
||||
|
||||
test('debounce', () => {
|
||||
const stub = jest.fn()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import * as net from '../../src/js/net'
|
||||
import * as net from '../../src/scripts/net'
|
||||
|
||||
export const init = {} as typeof net.init
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import * as notify from '../../src/js/notify'
|
||||
import * as notify from '../../src/scripts/notify'
|
||||
|
||||
export const showAjaxError = {} as jest.Mock<
|
||||
ReturnType<typeof notify.showAjaxError>,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'
|
|||
import Plugins from '@/views/admin/Plugins.vue'
|
||||
import { flushPromises } from '../../utils'
|
||||
|
||||
jest.mock('@/js/notify')
|
||||
jest.mock('@/scripts/notify')
|
||||
|
||||
test('render dependencies', async () => {
|
||||
Vue.prototype.$http.get.mockResolvedValue([
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import Vue from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Users from '@/views/admin/Users.vue'
|
||||
import '@/js/i18n'
|
||||
import '@/scripts/i18n'
|
||||
import { MessageBoxData } from 'element-ui/types/message-box'
|
||||
import { flushPromises } from '../../utils'
|
||||
|
||||
jest.mock('@/js/i18n', () => ({
|
||||
jest.mock('@/scripts/i18n', () => ({
|
||||
trans: (key: string) => key,
|
||||
}))
|
||||
|
||||
|
|
|
|||
|
|
@ -279,5 +279,5 @@ test('select specified texture initially', async () => {
|
|||
const wrapper = mount(Closet)
|
||||
jest.runAllTimers()
|
||||
await wrapper.vm.$nextTick()
|
||||
jest.unmock('@/js/utils')
|
||||
jest.unmock('@/scripts/utils')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
"noEmit": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/js/*": [
|
||||
"@/scripts/*": [
|
||||
"./resources/assets/tests/ts-shims/*",
|
||||
"./resources/assets/src/js/*"
|
||||
"./resources/assets/src/scripts/*"
|
||||
],
|
||||
"@/components/*": [
|
||||
"./resources/assets/src/components/*"
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ const config = {
|
|||
'bootstrap/dist/css/bootstrap.min.css',
|
||||
'admin-lte/dist/css/alt/AdminLTE-without-plugins.min.css',
|
||||
'element-ui/lib/theme-chalk/base.css',
|
||||
'./resources/assets/src/element.scss',
|
||||
'./resources/assets/src/styles/element.scss',
|
||||
'@fortawesome/fontawesome-free/css/fontawesome.min.css',
|
||||
'@fortawesome/fontawesome-free/css/regular.min.css',
|
||||
'@fortawesome/fontawesome-free/css/solid.min.css',
|
||||
'./resources/assets/src/stylus/common.styl',
|
||||
'./resources/assets/src/styles/common.styl',
|
||||
],
|
||||
setup: './resources/assets/src/stylus/setup.styl',
|
||||
setup: './resources/assets/src/styles/setup.styl',
|
||||
},
|
||||
output: {
|
||||
path: `${__dirname}/public/app`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user