mirror of https://github.com/requarks/wiki
parent
81e0a67f68
commit
166f519c75
@ -1,6 +1,4 @@
|
||||
/dist
|
||||
/src-capacitor
|
||||
/src-cordova
|
||||
/.quasar
|
||||
/node_modules
|
||||
.eslintrc.js
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,293 +0,0 @@
|
||||
/* eslint-env node */
|
||||
|
||||
/*
|
||||
* This file runs in a Node context (it's NOT transpiled by Babel), so use only
|
||||
* the ES6 features that are supported by your Node version. https://node.green/
|
||||
*/
|
||||
|
||||
// Configuration for your app
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
|
||||
|
||||
const { configure } = require('quasar/wrappers')
|
||||
const path = require('path')
|
||||
const yaml = require('js-yaml')
|
||||
const fs = require('fs')
|
||||
|
||||
module.exports = configure(function (ctx) {
|
||||
const userConfig = ctx.dev ? {
|
||||
dev: { port: 3001, hmrClientPort: 3001 },
|
||||
...yaml.load(fs.readFileSync(path.resolve(__dirname, '../config.yml'), 'utf8'))
|
||||
} : {}
|
||||
|
||||
return {
|
||||
eslint: {
|
||||
fix: true,
|
||||
// include = [],
|
||||
// exclude = [],
|
||||
// rawOptions = {},
|
||||
warnings: true,
|
||||
errors: true
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli/prefetch-feature
|
||||
preFetch: true,
|
||||
|
||||
// app boot file (/src/boot)
|
||||
// --> boot files are part of "main.js"
|
||||
// https://v2.quasar.dev/quasar-cli/boot-files
|
||||
boot: [
|
||||
'apollo',
|
||||
'components',
|
||||
'externals',
|
||||
'eventbus',
|
||||
'i18n',
|
||||
{
|
||||
server: false,
|
||||
path: 'monaco'
|
||||
}
|
||||
],
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
|
||||
css: [
|
||||
'app.scss'
|
||||
],
|
||||
|
||||
// https://github.com/quasarframework/quasar/tree/dev/extras
|
||||
extras: [
|
||||
// 'ionicons-v4',
|
||||
// 'mdi-v5',
|
||||
// 'mdi-v7',
|
||||
// 'fontawesome-v6',
|
||||
// 'eva-icons',
|
||||
// 'themify',
|
||||
'line-awesome'
|
||||
// 'roboto-font-latin-ext' // this or either 'roboto-font', NEVER both!
|
||||
// 'roboto-font', // optional, you are not bound to it
|
||||
// 'material-icons' // optional, you are not bound to it
|
||||
],
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
|
||||
build: {
|
||||
target: {
|
||||
browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
|
||||
node: 'node18'
|
||||
},
|
||||
|
||||
vueRouterMode: 'history', // available values: 'hash', 'history'
|
||||
// vueRouterBase,
|
||||
// vueDevtools,
|
||||
vueOptionsAPI: false,
|
||||
|
||||
rebuildCache: true, // rebuilds Vite/linter/etc cache on startup
|
||||
|
||||
// publicPath: '/',
|
||||
// analyze: true,
|
||||
// env: {},
|
||||
// rawDefine: {}
|
||||
// ignorePublicFolder: true,
|
||||
// minify: false,
|
||||
// polyfillModulePreload: true,
|
||||
distDir: '../assets',
|
||||
|
||||
extendViteConf (viteConf) {
|
||||
if (ctx.prod) {
|
||||
viteConf.build.assetsDir = '_assets'
|
||||
viteConf.build.rollupOptions = {
|
||||
...viteConf.build.rollupOptions ?? {},
|
||||
output: {
|
||||
manualChunks (id) {
|
||||
if (id.includes('lodash')) {
|
||||
return 'lodash'
|
||||
// } else if (id.includes('quasar')) {
|
||||
// return 'quasar'
|
||||
} else if (id.includes('pages/Admin')) {
|
||||
return 'admin'
|
||||
} else if (id.includes('pages/Profile')) {
|
||||
return 'profile'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
viteConf.build.chunkSizeWarningLimit = 5000
|
||||
viteConf.optimizeDeps.include = [
|
||||
'prosemirror-state',
|
||||
'prosemirror-transform',
|
||||
'prosemirror-model',
|
||||
'prosemirror-view'
|
||||
]
|
||||
}
|
||||
viteConf.build.dynamicImportVarsOptions = {
|
||||
warnOnError: true,
|
||||
include: ['!/_blocks/**']
|
||||
}
|
||||
},
|
||||
// viteVuePluginOptions: {},
|
||||
|
||||
vitePlugins: [
|
||||
['@intlify/unplugin-vue-i18n/vite', {
|
||||
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
|
||||
// compositionOnly: false,
|
||||
|
||||
// you need to set i18n resource including paths !
|
||||
include: path.resolve(__dirname, './src/i18n/locales/**')
|
||||
}]
|
||||
]
|
||||
// sourcemap: true
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
|
||||
devServer: {
|
||||
// https: true
|
||||
open: false, // opens browser window automatically
|
||||
port: userConfig.dev?.port,
|
||||
proxy: ['_graphql', '_blocks', '_site', '_thumb', '_user'].reduce((result, key) => {
|
||||
result[`/${key}`] = {
|
||||
target: {
|
||||
host: '127.0.0.1',
|
||||
port: userConfig.port
|
||||
}
|
||||
}
|
||||
return result
|
||||
}, {}),
|
||||
hmr: {
|
||||
clientPort: userConfig.dev?.hmrClientPort
|
||||
},
|
||||
vueDevtools: true
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
|
||||
framework: {
|
||||
config: {
|
||||
brand: {
|
||||
header: '#000',
|
||||
sidebar: '#1976D2'
|
||||
},
|
||||
loading: {
|
||||
delay: 500,
|
||||
spinner: 'QSpinnerGrid',
|
||||
spinnerSize: 32,
|
||||
spinnerColor: 'white',
|
||||
customClass: 'loading-darker'
|
||||
},
|
||||
loadingBar: {
|
||||
color: 'primary',
|
||||
size: '1px',
|
||||
position: 'top'
|
||||
},
|
||||
notify: {
|
||||
position: 'top',
|
||||
progress: true,
|
||||
color: 'green',
|
||||
icon: 'las la-check',
|
||||
actions: [
|
||||
{
|
||||
icon: 'las la-times',
|
||||
color: 'white',
|
||||
size: 'sm',
|
||||
round: true,
|
||||
handler: () => {}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
iconSet: 'mdi-v7', // Quasar icon set
|
||||
lang: 'en-US', // Quasar language pack
|
||||
|
||||
// For special cases outside of where the auto-import strategy can have an impact
|
||||
// (like functional components as one of the examples),
|
||||
// you can manually specify Quasar components/directives to be available everywhere:
|
||||
//
|
||||
// components: [],
|
||||
// directives: [],
|
||||
|
||||
// Quasar plugins
|
||||
plugins: [
|
||||
'Dialog',
|
||||
'Loading',
|
||||
'LoadingBar',
|
||||
'Meta',
|
||||
'Notify'
|
||||
]
|
||||
},
|
||||
|
||||
// animations: 'all', // --- includes all animations
|
||||
// https://v2.quasar.dev/options/animations
|
||||
animations: [],
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#property-sourcefiles
|
||||
sourceFiles: {
|
||||
// rootComponent: 'src/App.vue',
|
||||
// router: 'src/router/index',
|
||||
store: 'src/stores/index'
|
||||
// registerServiceWorker: 'src-pwa/register-service-worker',
|
||||
// serviceWorker: 'src-pwa/custom-service-worker',
|
||||
// pwaManifestFile: 'src-pwa/manifest.json',
|
||||
// electronMain: 'src-electron/electron-main',
|
||||
// electronPreload: 'src-electron/electron-preload'
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr
|
||||
ssr: {
|
||||
// ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
|
||||
// will mess up SSR
|
||||
|
||||
// extendSSRWebserverConf (esbuildConf) {},
|
||||
// extendPackageJson (json) {},
|
||||
|
||||
pwa: false,
|
||||
|
||||
// manualStoreHydration: true,
|
||||
// manualPostHydrationTrigger: true,
|
||||
|
||||
prodPort: 3000, // The default port that the production server should use
|
||||
// (gets superseded if process.env.PORT is specified at runtime)
|
||||
|
||||
middlewares: [
|
||||
'render' // keep this as last one
|
||||
]
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
|
||||
pwa: {
|
||||
workboxMode: 'generateSW', // or 'injectManifest'
|
||||
injectPwaMetaTags: true,
|
||||
swFilename: 'sw.js',
|
||||
manifestFilename: 'manifest.json',
|
||||
useCredentialsForManifestTag: false
|
||||
// extendGenerateSWOptions (cfg) {}
|
||||
// extendInjectManifestOptions (cfg) {},
|
||||
// extendManifestJson (json) {}
|
||||
// extendPWACustomSWConf (esbuildConf) {}
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
|
||||
electron: {
|
||||
// extendElectronMainConf (esbuildConf)
|
||||
// extendElectronPreloadConf (esbuildConf)
|
||||
|
||||
inspectPort: 5858,
|
||||
|
||||
bundler: 'packager', // 'packager' or 'builder'
|
||||
|
||||
packager: {
|
||||
// https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
|
||||
|
||||
// OS X / Mac App Store
|
||||
// appBundleId: '',
|
||||
// appCategoryType: '',
|
||||
// osxSign: '',
|
||||
// protocol: 'myapp://path',
|
||||
|
||||
// Windows only
|
||||
// win32metadata: { ... }
|
||||
},
|
||||
|
||||
builder: {
|
||||
// https://www.electron.build/configuration/configuration
|
||||
|
||||
appId: 'ux'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
@ -1,13 +1,11 @@
|
||||
import { boot } from 'quasar/wrappers'
|
||||
|
||||
import BlueprintIcon from '../components/BlueprintIcon.vue'
|
||||
import StatusLight from '../components/StatusLight.vue'
|
||||
import LoadingGeneric from '../components/LoadingGeneric.vue'
|
||||
import BlueprintIcon from '@/components/BlueprintIcon.vue'
|
||||
import StatusLight from '@/components/StatusLight.vue'
|
||||
import LoadingGeneric from '@/components/LoadingGeneric.vue'
|
||||
import VNetworkGraph from 'v-network-graph'
|
||||
|
||||
export default boot(({ app }) => {
|
||||
export function initializeComponents (app) {
|
||||
app.component('BlueprintIcon', BlueprintIcon)
|
||||
app.component('LoadingGeneric', LoadingGeneric)
|
||||
app.component('StatusLight', StatusLight)
|
||||
app.use(VNetworkGraph)
|
||||
})
|
||||
}
|
||||
|
@ -0,0 +1,80 @@
|
||||
import { createApp } from 'vue'
|
||||
import { Quasar, Dialog, Loading, LoadingBar, Meta, Notify } from 'quasar'
|
||||
import { initializeRouter } from './router'
|
||||
import { initializeStore } from './stores'
|
||||
import { initializeApollo } from './boot/apollo'
|
||||
import { initializeComponents } from './boot/components'
|
||||
import { initializeEventBus } from './boot/eventbus'
|
||||
import { initializeExternals } from './boot/externals'
|
||||
import { initializeI18n } from './boot/i18n'
|
||||
import quasarIconSet from 'quasar/icon-set/mdi-v7'
|
||||
|
||||
// Import icon libraries
|
||||
import '@quasar/extras/roboto-font/roboto-font.css'
|
||||
import '@mdi/font/css/materialdesignicons.css'
|
||||
import '@quasar/extras/line-awesome/line-awesome.css'
|
||||
|
||||
// Import Quasar css
|
||||
import 'quasar/src/css/index.sass'
|
||||
import './css/app.scss'
|
||||
|
||||
import RootApp from './App.vue'
|
||||
|
||||
const router = initializeRouter()
|
||||
const store = initializeStore(router)
|
||||
|
||||
const app = createApp(RootApp)
|
||||
app.use(store)
|
||||
app.use(router)
|
||||
|
||||
initializeApollo(store)
|
||||
initializeComponents(app)
|
||||
initializeEventBus()
|
||||
initializeExternals(router, store)
|
||||
initializeI18n(app, store)
|
||||
|
||||
app.use(Quasar, {
|
||||
plugins: {
|
||||
Dialog,
|
||||
Loading,
|
||||
LoadingBar,
|
||||
Meta,
|
||||
Notify
|
||||
},
|
||||
iconSet: quasarIconSet,
|
||||
config: {
|
||||
brand: {
|
||||
header: '#000',
|
||||
sidebar: '#1976D2'
|
||||
},
|
||||
loading: {
|
||||
delay: 500,
|
||||
spinner: 'QSpinnerGrid',
|
||||
spinnerSize: 32,
|
||||
spinnerColor: 'white',
|
||||
customClass: 'loading-darker'
|
||||
},
|
||||
loadingBar: {
|
||||
color: 'primary',
|
||||
size: '1px',
|
||||
position: 'top'
|
||||
},
|
||||
notify: {
|
||||
position: 'top',
|
||||
progress: true,
|
||||
color: 'green',
|
||||
icon: 'las la-check',
|
||||
actions: [
|
||||
{
|
||||
icon: 'las la-times',
|
||||
color: 'white',
|
||||
size: 'sm',
|
||||
round: true,
|
||||
handler: () => {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
app.mount('#app')
|
@ -1,30 +1,16 @@
|
||||
import { route } from 'quasar/wrappers'
|
||||
import { createRouter, createMemoryHistory, createWebHistory, createWebHashHistory } from 'vue-router'
|
||||
import { createRouter, createMemoryHistory, createWebHistory } from 'vue-router'
|
||||
import routes from './routes'
|
||||
|
||||
/*
|
||||
* If not building with SSR mode, you can
|
||||
* directly export the Router instantiation;
|
||||
*
|
||||
* The function below can be async too; either use
|
||||
* async/await or return a Promise which resolves
|
||||
* with the Router instance.
|
||||
*/
|
||||
|
||||
export default route(function (/* { store, ssrContext } */) {
|
||||
const createHistory = process.env.SERVER
|
||||
export function initializeRouter () {
|
||||
const createHistory = import.meta.env.SSR
|
||||
? createMemoryHistory
|
||||
: (process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory)
|
||||
: createWebHistory
|
||||
|
||||
const Router = createRouter({
|
||||
const router = createRouter({
|
||||
scrollBehavior: () => ({ left: 0, top: 0 }),
|
||||
routes,
|
||||
|
||||
// Leave this as is and make changes in quasar.conf.js instead!
|
||||
// quasar.conf.js -> build -> vueRouterMode
|
||||
// quasar.conf.js -> build -> publicPath
|
||||
history: createHistory(process.env.VUE_ROUTER_BASE)
|
||||
history: createHistory(import.meta.env.BASE_URL)
|
||||
})
|
||||
|
||||
return Router
|
||||
})
|
||||
return router
|
||||
}
|
||||
|
@ -1,20 +1,15 @@
|
||||
import { store } from 'quasar/wrappers'
|
||||
import { createPinia } from 'pinia'
|
||||
import { markRaw } from 'vue'
|
||||
|
||||
/*
|
||||
* If not building with SSR mode, you can
|
||||
* directly export the Store instantiation;
|
||||
*
|
||||
* The function below can be async too; either use
|
||||
* async/await or return a Promise which resolves
|
||||
* with the Store instance.
|
||||
*/
|
||||
|
||||
export default store((/* { ssrContext } */) => {
|
||||
export function initializeStore (router) {
|
||||
const pinia = createPinia()
|
||||
|
||||
// You can add Pinia plugins here
|
||||
// pinia.use(SomePiniaPlugin)
|
||||
|
||||
pinia.use(({ store }) => {
|
||||
store.router = markRaw(router)
|
||||
})
|
||||
|
||||
return pinia
|
||||
})
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import yaml from 'js-yaml'
|
||||
import fs from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
const userConfig = mode === 'development' ? {
|
||||
dev: { port: 3001, hmrClientPort: 3001 },
|
||||
...yaml.load(fs.readFileSync(fileURLToPath(new URL('../config.yml', import.meta.url)), 'utf8'))
|
||||
} : {}
|
||||
|
||||
return {
|
||||
build: {
|
||||
assetsDir: '_assets',
|
||||
chunkSizeWarningLimit: 5000,
|
||||
dynamicImportVarsOptions: {
|
||||
warnOnError: true,
|
||||
include: ['!/_blocks/**']
|
||||
},
|
||||
outDir: '../assets',
|
||||
target: 'es2022',
|
||||
...(mode === 'production') && {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks (id) {
|
||||
if (id.includes('lodash')) {
|
||||
return 'lodash'
|
||||
// } else if (id.includes('quasar')) {
|
||||
// return 'quasar'
|
||||
} else if (id.includes('pages/Admin')) {
|
||||
return 'admin'
|
||||
} else if (id.includes('pages/Profile')) {
|
||||
return 'profile'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
'prosemirror-state',
|
||||
'prosemirror-transform',
|
||||
'prosemirror-model',
|
||||
'prosemirror-view'
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
vue({
|
||||
template: { transformAssetUrls }
|
||||
}),
|
||||
quasar({
|
||||
autoImportComponentCase: 'kebab',
|
||||
sassVariables: 'src/css/quasar.variables.scss'
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
},
|
||||
server: {
|
||||
// https: true
|
||||
open: false, // opens browser window automatically
|
||||
port: userConfig.dev?.port,
|
||||
proxy: ['_graphql', '_blocks', '_site', '_thumb', '_user'].reduce((result, key) => {
|
||||
result[`/${key}`] = {
|
||||
target: {
|
||||
host: '127.0.0.1',
|
||||
port: userConfig.port
|
||||
}
|
||||
}
|
||||
return result
|
||||
}, {}),
|
||||
hmr: {
|
||||
clientPort: userConfig.dev?.hmrClientPort
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
Loading…
Reference in new issue