First commit of the 2023 version of FA
Modified readme file for proper install Electron dev env works Build untested so far
|
@ -1,9 +1,8 @@
|
|||
/dist
|
||||
/src-bex/www
|
||||
/src-capacitor
|
||||
/src-cordova
|
||||
/.quasar
|
||||
/node_modules
|
||||
.eslintrc.js
|
||||
babel.config.js
|
||||
/src-ssr
|
||||
/src-ssr
|
||||
/quasar.config.*.temporary.compiled*
|
||||
|
|
|
@ -1,27 +1,22 @@
|
|||
const { resolve } = require('path');
|
||||
module.exports = {
|
||||
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
||||
// This option interrupts the configuration hierarchy at this file
|
||||
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
|
||||
root: true,
|
||||
|
||||
// https://eslint.vuejs.org/user-guide/#how-to-use-custom-parser
|
||||
// https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
|
||||
// Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
|
||||
// `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
|
||||
parserOptions: {
|
||||
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#configuration
|
||||
// https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#eslint
|
||||
// Needed to make the parser take into account 'vue' files
|
||||
extraFileExtensions: ['.vue'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
project: resolve(__dirname, './tsconfig.json'),
|
||||
tsconfigRootDir: __dirname,
|
||||
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
|
||||
sourceType: 'module' // Allows for the use of imports
|
||||
parser: require.resolve('@typescript-eslint/parser'),
|
||||
extraFileExtensions: [ '.vue' ]
|
||||
},
|
||||
|
||||
env: {
|
||||
browser: true
|
||||
browser: true,
|
||||
es2021: true,
|
||||
node: true,
|
||||
'vue/setup-compiler-macros': true
|
||||
},
|
||||
|
||||
// Rules order is important, please avoid shuffling them
|
||||
|
@ -32,8 +27,6 @@ module.exports = {
|
|||
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage
|
||||
// ESLint typescript rules
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
// consider disabling this class of rules if linting takes too long
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
|
||||
// Uncomment any of the lines below to choose desired strictness,
|
||||
// but leave only one uncommented!
|
||||
|
@ -43,17 +36,17 @@ module.exports = {
|
|||
// 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
|
||||
|
||||
'standard'
|
||||
|
||||
|
||||
],
|
||||
|
||||
plugins: [
|
||||
// required to apply rules which need type information
|
||||
'@typescript-eslint',
|
||||
|
||||
// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file
|
||||
// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
|
||||
// required to lint *.vue files
|
||||
'vue',
|
||||
|
||||
'vue'
|
||||
|
||||
],
|
||||
|
||||
globals: {
|
||||
|
@ -71,6 +64,7 @@ module.exports = {
|
|||
|
||||
// add your custom rules here
|
||||
rules: {
|
||||
|
||||
// allow async-await
|
||||
'generator-star-spacing': 'off',
|
||||
// allow paren-less arrow functions
|
||||
|
@ -80,19 +74,30 @@ module.exports = {
|
|||
'multiline-ternary': 'off',
|
||||
|
||||
'import/first': 'off',
|
||||
'import/named': 'error',
|
||||
'import/namespace': 'error',
|
||||
'import/default': 'error',
|
||||
'import/export': 'error',
|
||||
'import/extensions': 'off',
|
||||
'import/no-unresolved': 'off',
|
||||
'import/no-extraneous-dependencies': 'off',
|
||||
|
||||
// The core 'import/named' rules
|
||||
// does not work with type definitions
|
||||
'import/named': 'off',
|
||||
|
||||
'prefer-promise-reject-errors': 'off',
|
||||
|
||||
// TypeScript
|
||||
quotes: ['warn', 'single', { avoidEscape: true }],
|
||||
|
||||
// this rule, if on, would require explicit return type on the `render` function
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
|
||||
// in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
|
||||
// The core 'no-unused-vars' rules (in the eslint:recommended ruleset)
|
||||
// does not work with type definitions
|
||||
'no-unused-vars': 'off',
|
||||
|
||||
// allow debugger during development only
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
4
.gitignore
vendored
|
@ -5,6 +5,7 @@ node_modules
|
|||
# Quasar core related directories
|
||||
.quasar
|
||||
/dist
|
||||
/quasar.config.*.temporary.compiled*
|
||||
|
||||
# Cordova related directories and files
|
||||
/src-cordova/node_modules
|
||||
|
@ -31,3 +32,6 @@ yarn-error.log*
|
|||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
|
||||
# local .env files
|
||||
.env.local*
|
||||
|
|
3
.npmrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
# pnpm-related options
|
||||
shamefully-hoist=true
|
||||
strict-peer-dependencies=false
|
|
@ -1,8 +0,0 @@
|
|||
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
// to edit target browsers: use "browserslist" field in package.json
|
||||
require('autoprefixer')
|
||||
]
|
||||
}
|
8
.vscode/extensions.json
vendored
|
@ -1,12 +1,14 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
|
||||
"octref.vetur"
|
||||
"editorconfig.editorconfig",
|
||||
"vue.volar",
|
||||
"wayou.vscode-todo-highlight"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"octref.vetur",
|
||||
"hookyqr.beautify",
|
||||
"dbaeumer.jshint",
|
||||
"ms-vscode.vscode-typescript-tslint-plugin"
|
||||
]
|
||||
}
|
||||
}
|
21
.vscode/settings.json
vendored
|
@ -1,7 +1,16 @@
|
|||
{
|
||||
"vetur.validation.template": false,
|
||||
"vetur.format.enable": false,
|
||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"vetur.experimental.templateInterpolationService": true
|
||||
}
|
||||
"editor.bracketPairColorization.enabled": true,
|
||||
"editor.guides.bracketPairs": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||
"editor.codeActionsOnSave": [
|
||||
"source.fixAll.eslint"
|
||||
],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"vue"
|
||||
],
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
18
README.md
|
@ -1,20 +1,22 @@
|
|||
# Fantasia Archive (y)
|
||||
# Fantasia Archive (fantasia-archive)
|
||||
|
||||
A database manager for world building
|
||||
A worldbuilding database manager
|
||||
|
||||
## Install the dependencies
|
||||
Use Yarn 1.22.19 or stuff is gonna bug out.
|
||||
|
||||
## Install the dependencies and set up the project
|
||||
```bash
|
||||
npm install
|
||||
yarn
|
||||
```
|
||||
|
||||
### Start the app in development mode (hot-code reloading, error reporting, etc.)
|
||||
### Start the app in Quasar development mode (hot-code reloading, error reporting, etc.)
|
||||
```bash
|
||||
quasar dev
|
||||
quasar dev -m electron
|
||||
```
|
||||
|
||||
### Lint the files
|
||||
```bash
|
||||
npm run lint
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Build the app for production
|
||||
|
@ -23,4 +25,4 @@ quasar build
|
|||
```
|
||||
|
||||
### Customize the configuration
|
||||
See [Configuring quasar.conf.js](https://v2.quasar.dev/quasar-cli/quasar-conf-js).
|
||||
See [Configuring quasar.config.js](https://v2.quasar.dev/quasar-cli-vite/quasar-config-js).
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
/* eslint-env node */
|
||||
|
||||
module.exports = api => {
|
||||
return {
|
||||
presets: [
|
||||
[
|
||||
'@quasar/babel-preset-app',
|
||||
api.caller(caller => caller && caller.target === 'node')
|
||||
? { targets: { node: 'current' } }
|
||||
: {}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
<link rel="icon" type="image/ico" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<!-- DO NOT touch the following DIV -->
|
||||
<div id="q-app"></div>
|
||||
<!-- quasar:entry-point -->
|
||||
</body>
|
||||
</html>
|
9722
package-lock.json
generated
60
package.json
|
@ -1,48 +1,44 @@
|
|||
{
|
||||
"name": "y",
|
||||
"name": "fantasia-archive",
|
||||
"version": "0.0.1",
|
||||
"description": "A database manager for world building",
|
||||
"description": "A worldbuilding database manager",
|
||||
"productName": "Fantasia Archive",
|
||||
"author": "Elvanos <xfenix@seznam.cz>",
|
||||
"author": "Elvanos <elvanos66@gmail.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"lint": "eslint --ext .js,.ts,.vue ./",
|
||||
"test": "echo \"No test specified\" && exit 0"
|
||||
"test": "echo \"No test specified\" && exit 0",
|
||||
"dev": "quasar dev",
|
||||
"build": "quasar build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@quasar/extras": "^1.0.0",
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.6.5",
|
||||
"quasar": "^2.0.0",
|
||||
"vue-i18n": "^9.0.0-beta.0",
|
||||
"vuex": "^4.0.1"
|
||||
"@electron/remote": "^2.0.10",
|
||||
"@quasar/extras": "^1.16.4",
|
||||
"axios": "^1.2.1",
|
||||
"pinia": "^2.0.11",
|
||||
"quasar": "^2.6.0",
|
||||
"vue": "^3.0.0",
|
||||
"vue-i18n": "^9.2.2",
|
||||
"vue-router": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.13.14",
|
||||
"@quasar/app": "^3.0.0",
|
||||
"@types/node": "^10.17.15",
|
||||
"@typescript-eslint/eslint-plugin": "^4.16.1",
|
||||
"@typescript-eslint/parser": "^4.16.1",
|
||||
"eslint": "^7.14.0",
|
||||
"eslint-config-standard": "^16.0.2",
|
||||
"@intlify/vite-plugin-vue-i18n": "^3.3.1",
|
||||
"@quasar/app-vite": "^1.3.0",
|
||||
"@types/node": "^12.20.21",
|
||||
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
||||
"@typescript-eslint/parser": "^5.10.0",
|
||||
"autoprefixer": "^10.4.2",
|
||||
"electron": "^25.5.0",
|
||||
"eslint": "^8.10.0",
|
||||
"eslint-config-standard": "^17.0.0",
|
||||
"eslint-plugin-import": "^2.19.1",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"eslint-plugin-vue": "^7.0.0"
|
||||
"eslint-plugin-n": "^15.0.0",
|
||||
"eslint-plugin-promise": "^6.0.0",
|
||||
"eslint-plugin-vue": "^9.0.0",
|
||||
"typescript": "^4.5.4"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 10 Chrome versions",
|
||||
"last 10 Firefox versions",
|
||||
"last 4 Edge versions",
|
||||
"last 7 Safari versions",
|
||||
"last 8 Android versions",
|
||||
"last 8 ChromeAndroid versions",
|
||||
"last 8 FirefoxAndroid versions",
|
||||
"last 10 iOS versions",
|
||||
"last 5 Opera versions"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 12.22.1",
|
||||
"node": "^18 || ^16 || ^14.19",
|
||||
"npm": ">= 6.13.4",
|
||||
"yarn": ">= 1.21.1"
|
||||
}
|
||||
|
|
27
postcss.config.cjs
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* eslint-disable */
|
||||
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
// https://github.com/postcss/autoprefixer
|
||||
require('autoprefixer')({
|
||||
overrideBrowserslist: [
|
||||
'last 4 Chrome versions',
|
||||
'last 4 Firefox versions',
|
||||
'last 4 Edge versions',
|
||||
'last 4 Safari versions',
|
||||
'last 4 Android versions',
|
||||
'last 4 ChromeAndroid versions',
|
||||
'last 4 FirefoxAndroid versions',
|
||||
'last 4 iOS versions'
|
||||
]
|
||||
})
|
||||
|
||||
// https://github.com/elchininet/postcss-rtlcss
|
||||
// If you want to support RTL css, then
|
||||
// 1. yarn/npm install postcss-rtlcss
|
||||
// 2. optionally set quasar.config.js > framework > lang to an RTL language
|
||||
// 3. uncomment the following line:
|
||||
// require('postcss-rtlcss')
|
||||
]
|
||||
}
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9.4 KiB |
229
quasar.conf.js
|
@ -1,229 +0,0 @@
|
|||
/*
|
||||
* 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/quasar-conf-js
|
||||
|
||||
/* eslint-env node */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const { configure } = require('quasar/wrappers')
|
||||
|
||||
module.exports = configure(function (ctx) {
|
||||
return {
|
||||
// https://v2.quasar.dev/quasar-cli/supporting-ts
|
||||
supportTS: {
|
||||
tsCheckerConfig: {
|
||||
eslint: {
|
||||
enabled: true,
|
||||
files: './src/**/*.{ts,tsx,js,jsx,vue}'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 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: [
|
||||
'i18n',
|
||||
'axios'
|
||||
],
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css
|
||||
css: [
|
||||
'app.scss'
|
||||
],
|
||||
|
||||
// https://github.com/quasarframework/quasar/tree/dev/extras
|
||||
extras: [
|
||||
// 'ionicons-v4',
|
||||
// 'mdi-v5',
|
||||
// 'fontawesome-v5',
|
||||
// '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/quasar-conf-js#Property%3A-build
|
||||
build: {
|
||||
vueRouterMode: 'hash', // available values: 'hash', 'history'
|
||||
|
||||
// transpile: false,
|
||||
|
||||
// Add dependencies for transpiling with Babel (Array of string/regex)
|
||||
// (from node_modules, which are by default not transpiled).
|
||||
// Applies only if "transpile" is set to true.
|
||||
// transpileDependencies: [],
|
||||
|
||||
// rtl: true, // https://v2.quasar.dev/options/rtl-support
|
||||
// preloadChunks: true,
|
||||
// showProgress: false,
|
||||
// gzip: true,
|
||||
// analyze: true,
|
||||
|
||||
// Options below are automatically set depending on the env, set them if you want to override
|
||||
// extractCSS: false,
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli/handling-webpack
|
||||
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
||||
chainWebpack (/* chain */) {
|
||||
//
|
||||
}
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
|
||||
devServer: {
|
||||
https: false,
|
||||
port: 8080,
|
||||
open: true // opens browser window automatically
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
|
||||
framework: {
|
||||
config: {},
|
||||
|
||||
// iconSet: 'material-icons', // 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: []
|
||||
},
|
||||
|
||||
// animations: 'all', // --- includes all animations
|
||||
// https://v2.quasar.dev/options/animations
|
||||
animations: [],
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr
|
||||
ssr: {
|
||||
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)
|
||||
|
||||
maxAge: 1000 * 60 * 60 * 24 * 30,
|
||||
// Tell browser when a file from the server should expire from cache (in ms)
|
||||
|
||||
chainWebpackWebserver (/* chain */) {
|
||||
//
|
||||
},
|
||||
|
||||
middlewares: [
|
||||
ctx.prod ? 'compression' : '',
|
||||
'render' // keep this as last one
|
||||
]
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
|
||||
pwa: {
|
||||
workboxPluginMode: 'GenerateSW', // 'GenerateSW' or 'InjectManifest'
|
||||
workboxOptions: {}, // only for GenerateSW
|
||||
|
||||
// for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
|
||||
// if using workbox in InjectManifest mode
|
||||
chainWebpackCustomSW (/* chain */) {
|
||||
//
|
||||
},
|
||||
|
||||
manifest: {
|
||||
name: 'Fantasia Archive',
|
||||
short_name: 'Fantasia Archive',
|
||||
description: 'A database manager for world building',
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
background_color: '#ffffff',
|
||||
theme_color: '#027be3',
|
||||
icons: [
|
||||
{
|
||||
src: 'icons/icon-128x128.png',
|
||||
sizes: '128x128',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: 'icons/icon-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: 'icons/icon-256x256.png',
|
||||
sizes: '256x256',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: 'icons/icon-384x384.png',
|
||||
sizes: '384x384',
|
||||
type: 'image/png'
|
||||
},
|
||||
{
|
||||
src: 'icons/icon-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli/developing-cordova-apps/configuring-cordova
|
||||
cordova: {
|
||||
// noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli/developing-capacitor-apps/configuring-capacitor
|
||||
capacitor: {
|
||||
hideSplashscreen: true
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
|
||||
electron: {
|
||||
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: 'y'
|
||||
},
|
||||
|
||||
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
||||
chainWebpack (/* chain */) {
|
||||
// do something with the Electron main process Webpack cfg
|
||||
// extendWebpackMain also available besides this chainWebpackMain
|
||||
},
|
||||
|
||||
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
||||
chainWebpackPreload (/* chain */) {
|
||||
// do something with the Electron main process Webpack cfg
|
||||
// extendWebpackPreload also available besides this chainWebpackPreload
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
220
quasar.config.js
Normal file
|
@ -0,0 +1,220 @@
|
|||
/* 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')
|
||||
|
||||
module.exports = configure(function (/* ctx */) {
|
||||
return {
|
||||
eslint: {
|
||||
// fix: true,
|
||||
// include: [],
|
||||
// exclude: [],
|
||||
// rawOptions: {},
|
||||
warnings: true,
|
||||
errors: true
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
|
||||
// preFetch: true,
|
||||
|
||||
// app boot file (/src/boot)
|
||||
// --> boot files are part of "main.js"
|
||||
// https://v2.quasar.dev/quasar-cli-vite/boot-files
|
||||
boot: [
|
||||
'i18n',
|
||||
'axios'
|
||||
],
|
||||
|
||||
// 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',
|
||||
'fontawesome-v6',
|
||||
// 'eva-icons',
|
||||
// 'themify',
|
||||
// 'line-awesome',
|
||||
|
||||
// 'roboto-font', // optional, you are not bound to it
|
||||
'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
|
||||
'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: 'node16'
|
||||
},
|
||||
|
||||
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
|
||||
|
||||
// extendViteConf (viteConf) {},
|
||||
// viteVuePluginOptions: {},
|
||||
|
||||
vitePlugins: [
|
||||
['@intlify/vite-plugin-vue-i18n', {
|
||||
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
|
||||
// compositionOnly: false,
|
||||
|
||||
// if you want to use named tokens in your Vue I18n messages, such as 'Hello {name}',
|
||||
// you need to set `runtimeOnly: false`
|
||||
// runtimeOnly: false,
|
||||
|
||||
// you need to set i18n resource including paths !
|
||||
include: path.resolve(__dirname, './src/i18n/**')
|
||||
}]
|
||||
]
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
|
||||
devServer: {
|
||||
// https: true
|
||||
open: true // opens browser window automatically
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
|
||||
framework: {
|
||||
config: {},
|
||||
|
||||
// iconSet: 'material-icons', // 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: []
|
||||
},
|
||||
|
||||
// animations: 'all', // --- includes all animations
|
||||
// https://v2.quasar.dev/options/animations
|
||||
animations: [],
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#sourcefiles
|
||||
// sourceFiles: {
|
||||
// rootComponent: 'src/App.vue',
|
||||
// router: 'src/router/index',
|
||||
// store: 'src/store/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-vite/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-vite/developing-pwa/configuring-pwa
|
||||
pwa: {
|
||||
workboxMode: 'generateSW', // or 'injectManifest'
|
||||
injectPwaMetaTags: true,
|
||||
swFilename: 'sw.js',
|
||||
manifestFilename: 'manifest.json',
|
||||
useCredentialsForManifestTag: false
|
||||
// useFilenameHashes: true,
|
||||
// extendGenerateSWOptions (cfg) {}
|
||||
// extendInjectManifestOptions (cfg) {},
|
||||
// extendManifestJson (json) {}
|
||||
// extendPWACustomSWConf (esbuildConf) {}
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-cordova-apps/configuring-cordova
|
||||
cordova: {
|
||||
// noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-capacitor-apps/configuring-capacitor
|
||||
capacitor: {
|
||||
hideSplashscreen: true
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/configuring-electron
|
||||
electron: {
|
||||
// extendElectronMainConf (esbuildConf)
|
||||
// extendElectronPreloadConf (esbuildConf)
|
||||
|
||||
inspectPort: 5858,
|
||||
|
||||
bundler: 'builder', // '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: 'fantasia-archive'
|
||||
}
|
||||
},
|
||||
|
||||
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-browser-extensions/configuring-bex
|
||||
bex: {
|
||||
contentScripts: [
|
||||
'my-content-script'
|
||||
]
|
||||
|
||||
// extendBexScriptsConf (esbuildConf) {}
|
||||
// extendBexManifestJson (json) {}
|
||||
}
|
||||
}
|
||||
})
|
8
src-electron/electron-env.d.ts
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/* eslint-disable */
|
||||
|
||||
declare namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
QUASAR_ELECTRON_PRELOAD: string;
|
||||
APP_URL: string;
|
||||
}
|
||||
}
|
10
src-electron/electron-flag.d.ts
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* eslint-disable */
|
||||
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
|
||||
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
|
||||
import "quasar/dist/types/feature-flag";
|
||||
|
||||
declare module "quasar/dist/types/feature-flag" {
|
||||
interface QuasarFeatureFlags {
|
||||
electron: true;
|
||||
}
|
||||
}
|
66
src-electron/electron-main.ts
Normal file
|
@ -0,0 +1,66 @@
|
|||
import { app, BrowserWindow, nativeTheme } from 'electron'
|
||||
import { initialize, enable } from '@electron/remote/main'
|
||||
import path from 'path'
|
||||
import os from 'os'
|
||||
|
||||
// needed in case process is undefined under Linux
|
||||
const platform = process.platform || os.platform()
|
||||
|
||||
try {
|
||||
if (platform === 'win32' && nativeTheme.shouldUseDarkColors === true) {
|
||||
require('fs').unlinkSync(
|
||||
path.join(app.getPath('userData'), 'DevTools Extensions')
|
||||
)
|
||||
}
|
||||
} catch (_) {}
|
||||
|
||||
initialize()
|
||||
|
||||
let mainWindow: BrowserWindow | undefined
|
||||
|
||||
function createWindow () {
|
||||
/**
|
||||
* Initial window options
|
||||
*/
|
||||
mainWindow = new BrowserWindow({
|
||||
useContentSize: true,
|
||||
frame: false,
|
||||
icon: path.resolve(__dirname, 'icons/icon.png'), // tray icon
|
||||
webPreferences: {
|
||||
sandbox: false,
|
||||
contextIsolation: true,
|
||||
// More info: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/electron-preload-script
|
||||
preload: path.resolve(__dirname, process.env.QUASAR_ELECTRON_PRELOAD)
|
||||
}
|
||||
})
|
||||
|
||||
enable(mainWindow.webContents)
|
||||
|
||||
mainWindow.setMenu(null)
|
||||
mainWindow.maximize()
|
||||
|
||||
mainWindow.loadURL(process.env.APP_URL)
|
||||
|
||||
if (process.env.DEBUGGING) {
|
||||
// if on DEV or Production with debug enabled
|
||||
mainWindow.webContents.openDevTools()
|
||||
}
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = undefined
|
||||
})
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
if (mainWindow === undefined) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
62
src-electron/electron-preload.ts
Normal file
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* This file is used specifically for security reasons.
|
||||
* Here you can access Nodejs stuff and inject functionality into
|
||||
* the renderer thread (accessible there through the "window" object)
|
||||
*
|
||||
* WARNING!
|
||||
* If you import anything from node_modules, then make sure that the package is specified
|
||||
* in package.json > dependencies and NOT in devDependencies
|
||||
*
|
||||
* Example (injects window.myAPI.doAThing() into renderer thread):
|
||||
*
|
||||
* import { contextBridge } from 'electron'
|
||||
*
|
||||
* contextBridge.exposeInMainWorld('myAPI', {
|
||||
* doAThing: () => {}
|
||||
* })
|
||||
*
|
||||
* WARNING!
|
||||
* If accessing Node functionality (like importing @electron/remote) then in your
|
||||
* electron-main.ts you will need to set the following when you instantiate BrowserWindow:
|
||||
*
|
||||
* mainWindow = new BrowserWindow({
|
||||
* // ...
|
||||
* webPreferences: {
|
||||
* // ...
|
||||
* sandbox: false // <-- to be able to import @electron/remote in preload script
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
|
||||
import { contextBridge } from 'electron'
|
||||
import { BrowserWindow } from '@electron/remote'
|
||||
|
||||
contextBridge.exposeInMainWorld('faWindowAPI', {
|
||||
|
||||
minimize () {
|
||||
const currentWindow = BrowserWindow.getFocusedWindow()
|
||||
|
||||
if (currentWindow !== null) {
|
||||
currentWindow.minimize()
|
||||
}
|
||||
},
|
||||
|
||||
toggleMaximize () {
|
||||
const currentWindow = BrowserWindow.getFocusedWindow()
|
||||
|
||||
if (currentWindow !== null) {
|
||||
if (currentWindow.isMaximized()) {
|
||||
currentWindow.unmaximize()
|
||||
} else {
|
||||
currentWindow.maximize()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
close () {
|
||||
const currentWindow = BrowserWindow.getFocusedWindow()
|
||||
if (currentWindow !== null) {
|
||||
currentWindow.close()
|
||||
}
|
||||
}
|
||||
})
|
BIN
src-electron/icons/icon.icns
Normal file
BIN
src-electron/icons/icon.ico
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
src-electron/icons/icon.png
Normal file
After Width: | Height: | Size: 13 KiB |
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import axios, { AxiosInstance } from 'axios'
|
|||
declare module '@vue/runtime-core' {
|
||||
interface ComponentCustomProperties {
|
||||
$axios: AxiosInstance;
|
||||
$api: AxiosInstance;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,14 +3,31 @@ import { createI18n } from 'vue-i18n'
|
|||
|
||||
import messages from 'src/i18n'
|
||||
|
||||
const i18n = createI18n({
|
||||
locale: 'en-US',
|
||||
messages
|
||||
})
|
||||
export type MessageLanguages = keyof typeof messages;
|
||||
// Type-define 'en-US' as the master schema for the resource
|
||||
export type MessageSchema = typeof messages['en-US'];
|
||||
|
||||
// See https://vue-i18n.intlify.dev/guide/advanced/typescript.html#global-resource-schema-type-definition
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
declare module 'vue-i18n' {
|
||||
// define the locale messages schema
|
||||
export interface DefineLocaleMessage extends MessageSchema {}
|
||||
|
||||
// define the datetime format schema
|
||||
export interface DefineDateTimeFormat {}
|
||||
|
||||
// define the number format schema
|
||||
export interface DefineNumberFormat {}
|
||||
}
|
||||
/* eslint-enable @typescript-eslint/no-empty-interface */
|
||||
|
||||
export default boot(({ app }) => {
|
||||
const i18n = createI18n({
|
||||
locale: 'en-US',
|
||||
legacy: false,
|
||||
messages
|
||||
})
|
||||
|
||||
// Set i18n instance on app
|
||||
app.use(i18n)
|
||||
})
|
||||
|
||||
export { i18n }
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
|
||||
<q-item-section>
|
||||
<q-item-label>{{ title }}</q-item-label>
|
||||
<q-item-label caption>
|
||||
{{ caption }}
|
||||
</q-item-label>
|
||||
<q-item-label caption>{{ caption }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
|
|
@ -39,7 +39,7 @@ function useDisplayTodo (todos: Ref<Todo[]>) {
|
|||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CompositionComponent',
|
||||
name: 'ExampleComponent',
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
|
@ -17,6 +17,7 @@ $secondary : #26A69A;
|
|||
$accent : #9C27B0;
|
||||
|
||||
$dark : #1D1D1D;
|
||||
$dark-page : #121212;
|
||||
|
||||
$positive : #21BA45;
|
||||
$negative : #C10015;
|
||||
|
|
2
src/env.d.ts
vendored
|
@ -1,3 +1,5 @@
|
|||
/* eslint-disable */
|
||||
|
||||
declare namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
NODE_ENV: string;
|
||||
|
|
|
@ -23,12 +23,10 @@
|
|||
v-model="leftDrawerOpen"
|
||||
show-if-above
|
||||
bordered
|
||||
class="bg-grey-1"
|
||||
>
|
||||
<q-list>
|
||||
<q-item-label
|
||||
header
|
||||
class="text-grey-8"
|
||||
>
|
||||
Essential Links
|
||||
</q-item-label>
|
||||
|
@ -48,6 +46,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from 'vue'
|
||||
import EssentialLink from 'components/EssentialLink.vue'
|
||||
|
||||
const linksList = [
|
||||
|
@ -95,8 +94,6 @@ const linksList = [
|
|||
}
|
||||
]
|
||||
|
||||
import { defineComponent, ref } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'MainLayout',
|
||||
|
||||
|
|
|
@ -26,6 +26,6 @@
|
|||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Error404'
|
||||
name: 'ErrorNotFound'
|
||||
})
|
||||
</script>
|
|
@ -11,11 +11,11 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Todo, Meta } from 'components/models'
|
||||
import ExampleComponent from 'components/CompositionComponent.vue'
|
||||
import ExampleComponent from 'components/ExampleComponent.vue'
|
||||
import { defineComponent, ref } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PageIndex',
|
||||
name: 'IndexPage',
|
||||
components: { ExampleComponent },
|
||||
setup () {
|
||||
const todos = ref<Todo[]>([
|
9
src/quasar.d.ts
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
/* eslint-disable */
|
||||
|
||||
// Forces TS to apply `@quasar/app-vite` augmentations of `quasar` package
|
||||
// Removing this would break `quasar/wrappers` imports as those typings are declared
|
||||
// into `@quasar/app-vite`
|
||||
// As a side effect, since `@quasar/app-vite` reference `quasar` to augment it,
|
||||
// this declaration also apply `quasar` own
|
||||
// augmentations (eg. adds `$q` into Vue component context)
|
||||
/// <reference types="@quasar/app-vite" />
|
|
@ -5,7 +5,7 @@ import {
|
|||
createWebHashHistory,
|
||||
createWebHistory
|
||||
} from 'vue-router'
|
||||
import { StateInterface } from '../store'
|
||||
|
||||
import routes from './routes'
|
||||
|
||||
/*
|
||||
|
@ -17,7 +17,7 @@ import routes from './routes'
|
|||
* with the Router instance.
|
||||
*/
|
||||
|
||||
export default route<StateInterface>(function (/* { store, ssrContext } */) {
|
||||
export default route(function (/* { store, ssrContext } */) {
|
||||
const createHistory = process.env.SERVER
|
||||
? createMemoryHistory
|
||||
: (process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory)
|
||||
|
@ -29,9 +29,7 @@ export default route<StateInterface>(function (/* { store, ssrContext } */) {
|
|||
// 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.MODE === 'ssr' ? void 0 : process.env.VUE_ROUTER_BASE
|
||||
)
|
||||
history: createHistory(process.env.VUE_ROUTER_BASE)
|
||||
})
|
||||
|
||||
return Router
|
||||
|
|
|
@ -4,14 +4,14 @@ const routes: RouteRecordRaw[] = [
|
|||
{
|
||||
path: '/',
|
||||
component: () => import('layouts/MainLayout.vue'),
|
||||
children: [{ path: '', component: () => import('pages/Index.vue') }]
|
||||
children: [{ path: '', component: () => import('pages/IndexPage.vue') }]
|
||||
},
|
||||
|
||||
// Always leave this as last one,
|
||||
// but you can also remove it
|
||||
{
|
||||
path: '/:catchAll(.*)*',
|
||||
component: () => import('pages/Error404.vue')
|
||||
component: () => import('pages/ErrorNotFound.vue')
|
||||
}
|
||||
]
|
||||
|
||||
|
|
10
src/shims-vue.d.ts
vendored
|
@ -1,6 +1,10 @@
|
|||
/* eslint-disable */
|
||||
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
// Mocks all files ending in `.vue` showing them as plain Vue instances
|
||||
declare module '*.vue' {
|
||||
import { ComponentOptions } from 'vue'
|
||||
const component: ComponentOptions
|
||||
export default component
|
||||
import type { DefineComponent } from 'vue';
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
import { store } from 'quasar/wrappers'
|
||||
import { InjectionKey } from 'vue'
|
||||
import {
|
||||
createStore,
|
||||
Store as VuexStore,
|
||||
useStore as vuexUseStore
|
||||
} from 'vuex'
|
||||
|
||||
// import example from './module-example'
|
||||
// import { ExampleStateInterface } from './module-example/state';
|
||||
|
||||
/*
|
||||
* 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 interface StateInterface {
|
||||
// Define your own store structure, using submodules if needed
|
||||
// example: ExampleStateInterface;
|
||||
// Declared as unknown to avoid linting issue. Best to strongly type as per the line above.
|
||||
example: unknown
|
||||
}
|
||||
|
||||
// provide typings for `this.$store`
|
||||
declare module '@vue/runtime-core' {
|
||||
interface ComponentCustomProperties {
|
||||
$store: VuexStore<StateInterface>
|
||||
}
|
||||
}
|
||||
|
||||
// provide typings for `useStore` helper
|
||||
export const storeKey: InjectionKey<VuexStore<StateInterface>> = Symbol('vuex-key')
|
||||
|
||||
export default store(function (/* { ssrContext } */) {
|
||||
const Store = createStore<StateInterface>({
|
||||
modules: {
|
||||
// example
|
||||
},
|
||||
|
||||
// enable strict mode (adds overhead!)
|
||||
// for dev mode and --debug builds only
|
||||
strict: !!process.env.DEBUGGING
|
||||
})
|
||||
|
||||
return Store
|
||||
})
|
||||
|
||||
export function useStore () {
|
||||
return vuexUseStore(storeKey)
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
import { ActionTree } from 'vuex'
|
||||
import { StateInterface } from '../index'
|
||||
import { ExampleStateInterface } from './state'
|
||||
|
||||
const actions: ActionTree<ExampleStateInterface, StateInterface> = {
|
||||
someAction (/* context */) {
|
||||
// your code
|
||||
}
|
||||
}
|
||||
|
||||
export default actions
|
|
@ -1,11 +0,0 @@
|
|||
import { GetterTree } from 'vuex'
|
||||
import { StateInterface } from '../index'
|
||||
import { ExampleStateInterface } from './state'
|
||||
|
||||
const getters: GetterTree<ExampleStateInterface, StateInterface> = {
|
||||
someAction (/* context */) {
|
||||
// your code
|
||||
}
|
||||
}
|
||||
|
||||
export default getters
|
|
@ -1,16 +0,0 @@
|
|||
import { Module } from 'vuex'
|
||||
import { StateInterface } from '../index'
|
||||
import state, { ExampleStateInterface } from './state'
|
||||
import actions from './actions'
|
||||
import getters from './getters'
|
||||
import mutations from './mutations'
|
||||
|
||||
const exampleModule: Module<ExampleStateInterface, StateInterface> = {
|
||||
namespaced: true,
|
||||
actions,
|
||||
getters,
|
||||
mutations,
|
||||
state
|
||||
}
|
||||
|
||||
export default exampleModule
|
|
@ -1,10 +0,0 @@
|
|||
import { MutationTree } from 'vuex'
|
||||
import { ExampleStateInterface } from './state'
|
||||
|
||||
const mutation: MutationTree<ExampleStateInterface> = {
|
||||
someMutation (/* state: ExampleStateInterface */) {
|
||||
// your code
|
||||
}
|
||||
}
|
||||
|
||||
export default mutation
|
|
@ -1,11 +0,0 @@
|
|||
export interface ExampleStateInterface {
|
||||
prop: boolean;
|
||||
}
|
||||
|
||||
function state (): ExampleStateInterface {
|
||||
return {
|
||||
prop: false
|
||||
}
|
||||
}
|
||||
|
||||
export default state
|
15
src/stores/example-store.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useCounterStore = defineStore('counter', {
|
||||
state: () => ({
|
||||
counter: 0
|
||||
}),
|
||||
getters: {
|
||||
doubleCount: (state) => state.counter * 2
|
||||
},
|
||||
actions: {
|
||||
increment () {
|
||||
this.counter++
|
||||
}
|
||||
}
|
||||
})
|
32
src/stores/index.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { store } from 'quasar/wrappers'
|
||||
import { createPinia } from 'pinia'
|
||||
import { Router } from 'vue-router'
|
||||
|
||||
/*
|
||||
* When adding new properties to stores, you should also
|
||||
* extend the `PiniaCustomProperties` interface.
|
||||
* @see https://pinia.vuejs.org/core-concepts/plugins.html#typing-new-store-properties
|
||||
*/
|
||||
declare module 'pinia' {
|
||||
export interface PiniaCustomProperties {
|
||||
readonly router: Router;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 } */) => {
|
||||
const pinia = createPinia()
|
||||
|
||||
// You can add Pinia plugins here
|
||||
// pinia.use(SomePiniaPlugin)
|
||||
|
||||
return pinia
|
||||
})
|
10
src/stores/store-flag.d.ts
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* eslint-disable */
|
||||
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
|
||||
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
|
||||
import "quasar/dist/types/feature-flag";
|
||||
|
||||
declare module "quasar/dist/types/feature-flag" {
|
||||
interface QuasarFeatureFlags {
|
||||
store: true;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "@quasar/app/tsconfig-preset",
|
||||
"extends": "@quasar/app-vite/tsconfig-preset",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "."
|
||||
}
|
||||
}
|
||||
}
|