Skip to content

Commit c6c6133

Browse files
committed
v2.0.0: Upgrade to Quasar 2 / Vue3
1 parent 184f692 commit c6c6133

95 files changed

Lines changed: 13581 additions & 26288 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
npm-debug.log
3+
.git
4+
.gitignore
5+
dist
6+
.env.local
7+
.env.*.local

.eslintrc.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
module.exports = {
22
root: true,
33
env: {
4-
node: true
4+
node: true,
5+
browser: true,
6+
es2021: true
57
},
68
extends: [
7-
"eslint:recommended",
8-
"prettier/vue",
9-
"plugin:prettier/recommended",
10-
"plugin:vue/recommended"
9+
'eslint:recommended',
10+
'plugin:vue/vue3-recommended',
11+
'prettier'
1112
],
1213
rules: {
13-
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
14-
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
15-
"vue/max-attributes-per-line": "off"
14+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
15+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
16+
'vue/max-attributes-per-line': 'off',
17+
'vue/multi-word-component-names': 'off'
1618
},
1719
parserOptions: {
18-
parser: "babel-eslint"
20+
ecmaVersion: 2021,
21+
sourceType: 'module'
1922
},
2023
overrides: [
2124
{
22-
files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"],
25+
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
2326
env: {
2427
jest: true
2528
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
node_modules
33
/dist
4+
.tmp
45

56
# local env files
67
.env.local
@@ -23,4 +24,6 @@ yarn-error.log*
2324
cypress/videos
2425
cypress/screenshots
2526

26-
env.js
27+
env.js
28+
UPGRADE_TODOS.md
29+
UPGRADE_PLAN.md

.quasar/app.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/* eslint-disable */
2+
/**
3+
* THIS FILE IS GENERATED AUTOMATICALLY.
4+
* DO NOT EDIT.
5+
*
6+
* You are probably looking on adding startup/initialization code.
7+
* Use "quasar new boot <name>" and add it there.
8+
* One boot file per concern. Then reference the file(s) in quasar.config.js > boot:
9+
* boot: ['file', ...] // do not add ".js" extension to it.
10+
*
11+
* Boot files are your "main.js"
12+
**/
13+
14+
15+
16+
import { Quasar } from 'quasar'
17+
import { markRaw } from 'vue'
18+
import RootComponent from 'app/src/App.vue'
19+
20+
import createStore from 'app/src/stores/index'
21+
import createRouter from 'app/src/router/index'
22+
23+
24+
25+
26+
27+
export default async function (createAppFn, quasarUserOptions) {
28+
// Create the app instance.
29+
// Here we inject into it the Quasar UI, the router & possibly the store.
30+
const app = createAppFn(RootComponent)
31+
32+
33+
app.config.performance = true
34+
35+
36+
app.use(Quasar, quasarUserOptions)
37+
38+
39+
40+
41+
const store = typeof createStore === 'function'
42+
? await createStore({})
43+
: createStore
44+
45+
46+
app.use(store)
47+
48+
49+
50+
51+
52+
const router = markRaw(
53+
typeof createRouter === 'function'
54+
? await createRouter({store})
55+
: createRouter
56+
)
57+
58+
59+
// make router instance available in store
60+
61+
store.use(({ store }) => { store.router = router })
62+
63+
64+
65+
// Expose the app, the router and the store.
66+
// Note that we are not mounting the app here, since bootstrapping will be
67+
// different depending on whether we are in a browser or on the server.
68+
return {
69+
app,
70+
store,
71+
router
72+
}
73+
}

.quasar/artifacts.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"folders":["/Users/oliverpohl/Projekte/gregorovius-env/gregorovius-frontend/dist/spa"]}

.quasar/client-entry.js

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/* eslint-disable */
2+
/**
3+
* THIS FILE IS GENERATED AUTOMATICALLY.
4+
* DO NOT EDIT.
5+
*
6+
* You are probably looking on adding startup/initialization code.
7+
* Use "quasar new boot <name>" and add it there.
8+
* One boot file per concern. Then reference the file(s) in quasar.config.js > boot:
9+
* boot: ['file', ...] // do not add ".js" extension to it.
10+
*
11+
* Boot files are your "main.js"
12+
**/
13+
14+
15+
import { createApp } from 'vue'
16+
17+
18+
19+
20+
21+
22+
23+
import '@quasar/extras/material-icons/material-icons.css'
24+
25+
26+
27+
28+
// We load Quasar stylesheet file
29+
import 'quasar/dist/quasar.sass'
30+
31+
32+
33+
34+
import 'src/css/app.scss'
35+
36+
37+
import createQuasarApp from './app.js'
38+
import quasarUserOptions from './quasar-user-options.js'
39+
40+
41+
42+
43+
44+
45+
console.info('[Quasar] Running SPA.')
46+
47+
48+
const publicPath = `/`
49+
50+
async function start ({
51+
app,
52+
router
53+
, store
54+
}, bootFiles) {
55+
56+
57+
58+
let hasRedirected = false
59+
const getRedirectUrl = url => {
60+
try { return router.resolve(url).href }
61+
catch (err) {}
62+
63+
return Object(url) === url
64+
? null
65+
: url
66+
}
67+
const redirect = url => {
68+
hasRedirected = true
69+
70+
if (typeof url === 'string' && /^https?:\/\//.test(url)) {
71+
window.location.href = url
72+
return
73+
}
74+
75+
const href = getRedirectUrl(url)
76+
77+
// continue if we didn't fail to resolve the url
78+
if (href !== null) {
79+
window.location.href = href
80+
81+
}
82+
}
83+
84+
const urlPath = window.location.href.replace(window.location.origin, '')
85+
86+
for (let i = 0; hasRedirected === false && i < bootFiles.length; i++) {
87+
try {
88+
await bootFiles[i]({
89+
app,
90+
router,
91+
store,
92+
ssrContext: null,
93+
redirect,
94+
urlPath,
95+
publicPath
96+
})
97+
}
98+
catch (err) {
99+
if (err && err.url) {
100+
redirect(err.url)
101+
return
102+
}
103+
104+
console.error('[Quasar] boot error:', err)
105+
return
106+
}
107+
}
108+
109+
if (hasRedirected === true) {
110+
return
111+
}
112+
113+
114+
app.use(router)
115+
116+
117+
118+
119+
120+
121+
122+
app.mount('#q-app')
123+
124+
125+
126+
127+
128+
129+
}
130+
131+
createQuasarApp(createApp, quasarUserOptions)
132+
133+
.then(app => {
134+
// eventually remove this when Cordova/Capacitor/Electron support becomes old
135+
const [ method, mapFn ] = Promise.allSettled !== void 0
136+
? [
137+
'allSettled',
138+
bootFiles => bootFiles.map(result => {
139+
if (result.status === 'rejected') {
140+
console.error('[Quasar] boot error:', result.reason)
141+
return
142+
}
143+
return result.value.default
144+
})
145+
]
146+
: [
147+
'all',
148+
bootFiles => bootFiles.map(entry => entry.default)
149+
]
150+
151+
return Promise[ method ]([
152+
153+
import('boot/axios'),
154+
155+
import('boot/matomo'),
156+
157+
import('boot/global-components')
158+
159+
]).then(bootFiles => {
160+
const boot = mapFn(bootFiles).filter(entry => typeof entry === 'function')
161+
start(app, boot)
162+
})
163+
})
164+

0 commit comments

Comments
 (0)