Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit 7a3c6bf

Browse files
tiltecpogopaulenicksellen
authored
Quasar 2 - second try (#2438)
* rename styl files to sass files * install quasar v2 and quasar/app v3 * upgrade eslint * update quasar.conf.js * remove hard-source-webpack-plugin It is not compatible with webpack 5. mzgoddard/hard-source-webpack-plugin#546 * migrate stylus syntax to sass syntax * fix line in .eslintrc * upgrade vue router https://next.router.vuejs.org/guide/migration/index.html * upgrade vuex https://next.quasar.dev/start/upgrade-guide#vuex-v4 * upgrade vue-i18n https://next.quasar.dev/start/upgrade-guide#vue-i18n-v9 * content-class -> class and content-style -> style https://next.quasar.dev/start/upgrade-guide#qdrawer-qdialog-qmenu-qtooltip * update QScrollObserver https://next.quasar.dev/start/upgrade-guide#qscrollobserver * update QTable ://next.quasar.dev/start/upgrade-guide#qtable * zh-hant -> zh-TW * add stylus loader * upgrade vue-router, vuex, eslint-parser downgrade stylus-loader * remove old vue dependency * fix datastore and boot files * WIP fix storybook * fix storybook setup * fix first story * fix i18n datetime breaking change * fix storybook $icon support * rewrite some component styles to sass * change stylelint to look for sass files * remove $listeners * WIP messy upgrade * fix two more tests * updates & fixes * yarn upgrade * add @-alias for service worker compilation * try to fix some tests * rewrite '>>>' to '::v-deep()' * add percentage sign * update dependencies * add back margin on feedbackitem * fix statistics sidenav entry * fix some redirects * fix: value -> modelValue * fix date-time input on small screens * fix search * ignore storybook-static * hey linter * hey hey * fix mobile sidenav * fix some map stuff * avoid CSP by using vue-i18n runtime * Revert "avoid CSP by using vue-i18n runtime" This reverts commit 7438954. * yarn upgrade * skip extra upgrade step * drop outdated comment * clarify comment about compat mode * Fix sending wall messages * Update deps * Downgrade to jest 27 Until vuejs/vue-jest#467 * replace unmaintained eslint-plugin-node with eslint-plugin-n * adjust code style eslint-config-standard has evolved * try skipping one test * Fix storyshot tests * Update snapshots * Style fixes * Remove debug logging * Fix router tests * Fix signup component test * Fix conversation tests * Fix map tests * Style fixes * Update snapshots There is a discrepancy with the date formatting depending on different installations of nodejs, so this might be an ongoing issue.... * Explain use of markRaw * remove double space Co-authored-by: pogopaule <[email protected]> Co-authored-by: Nick Sellen <[email protected]>
1 parent 09a73c0 commit 7a3c6bf

File tree

309 files changed

+14824
-15053
lines changed

Some content is hidden

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

309 files changed

+14824
-15053
lines changed

.circleci/config.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,8 @@ jobs:
373373
git config user.name "CircleCI"
374374
git branch --delete --force $BRANCH || true
375375
git checkout -b $BRANCH
376-
yarn upgrade --latest --ignore-engines
377-
# stay with quasar@1 and vue@2 and webpack@4 until we found time to upgrade
378-
# downgrade stylelint due to https://github.com/karrot-dev/karrot-frontend/issues/2461
379-
yarn upgrade --ignore-engines vue@legacy quasar@legacy @quasar/app@legacy vuex-persistedstate@^3.1.0 stylelint-webpack-plugin@^2.2.2 eslint-webpack-plugin@2 @quasar/quasar-ui-qiconpicker@qv1 @vue/test-utils@^1.3.0 stylelint@^13.13.1 vue-router@^3 vue-i18n@^8
376+
# holding back jest to 27 due to https://github.com/vuejs/vue-jest/issues/467
377+
yarn upgrade --latest --ignore-engines jest@^27 babel-jest@^27 jest-environment-jsdom@^27
380378
tee pr.txt \<<EOL
381379
[CI] update dependencies
382380

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
/src-cordova
55
/.quasar
66
/node_modules
7+
/storybook-static
8+
/docs/_book
9+
/docs/node_modules
10+
/docs/book

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
// Uncomment any of the lines below to choose desired strictness,
2121
// but leave only one uncommented!
2222
// See https://eslint.vuejs.org/rules/#available-rules
23-
'plugin:vue/recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
23+
'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
2424

2525
'standard',
2626

.storybook/main.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
// require('@storybook/addon-postcss')
2+
13
const QuasarConfFile = require('@quasar/app/lib/quasar-conf-file')
24
const getQuasarCtx = require('@quasar/app/lib/helpers/get-quasar-ctx')
35

46
module.exports = {
5-
stories: ['../src/**/*.story.js'],
7+
core: {
8+
builder: 'webpack5',
9+
},
10+
stories: ['../src/**/LatestMessages.story.js'],
611
addons: [
712
'@storybook/addon-actions',
813
'@storybook/addon-links',
14+
'@storybook/addon-essentials',
915
],
1016
webpackFinal: async (config, { configType }) => {
1117
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
@@ -19,7 +25,7 @@ module.exports = {
1925
const quasarConfig = new QuasarConfFile(ctx)
2026
await quasarConfig.prepare()
2127
await quasarConfig.compile()
22-
const webpackConfig = quasarConfig.webpackConf
28+
const webpackConfig = quasarConfig.webpackConf.renderer
2329

2430
// Manual merge with our webpack config
2531
config.module.rules = webpackConfig.module.rules

.storybook/preview.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
// Vue config
2-
import 'quasar/dist/quasar.styl'
3-
import '../src/css/app.styl'
2+
import 'quasar/dist/quasar.css'
3+
import '@/css/app.sass'
44

5-
import Vue from 'vue'
6-
import Vuex from 'vuex'
7-
import VueI18n from 'vue-i18n'
8-
import VueRouter from 'vue-router'
9-
import configureQuasar from '>/configureQuasar'
10-
import { RouterLinkStub, TransitionStub, TransitionGroupStub } from '@vue/test-utils'
11-
import { IconPlugin } from '@/base/icons'
5+
// import Vuex from 'vuex'
6+
// import VueRouter from 'vue-router'
7+
import { i18nPlugin } from '@/base/i18n'
8+
import { Quasar } from 'quasar'
9+
import quasarConfig from '>/quasarConfig'
10+
import { RouterLinkStub } from '@vue/test-utils'
11+
import icons from '@/base/icons'
12+
import { app } from '@storybook/vue3'
1213

13-
Vue.config.productionTip = false
14-
Vue.config.devtools = true
15-
configureQuasar(Vue)
16-
Vue.use(Vuex) // Install Vuex
17-
Vue.use(IconPlugin)
18-
Vue.use(VueI18n)
19-
Vue.use(VueRouter)
14+
app.use(i18nPlugin)
15+
app.use(Quasar, quasarConfig)
16+
// app.use(Vuex)
17+
// app.use(VueRouter)
18+
app.config.globalProperties.$icon = icons.get
2019

21-
Vue.component('RouterLink', RouterLinkStub)
22-
Vue.component('Transition', TransitionStub)
23-
Vue.component('TransitionGroup', TransitionGroupStub)
24-
Vue.directive('measure', {})
25-
Vue.config.errorHandler = (err, vm, info) => {
20+
app.component('RouterLink', RouterLinkStub)
21+
app.directive('measure', {})
22+
app.config.errorHandler = (err, vm, info) => {
2623
console.log(err, vm, info)
2724
}
2825

CONTRIBUTE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,4 @@ To make it easier to look for documentation and help on the internet, here's a l
8080
* JS framework: [VueJS](https://vuejs.org/v2/guide/)
8181
* UI framework: [Quasar](http://quasar.dev/guide/)
8282
* State management: [Vuex](https://vuex.vuejs.org/en/)
83-
* Style: [Stylus](http://stylus-lang.com/)
8483
* Test framework: [Jest](https://facebook.github.io/jest/docs/en/getting-started.html)

build/stylelintCustomSyntax.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/src/forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,4 @@ e.g. the status about a `save` action would be available as `saveStatus` or the
169169
- uses `hasNonFieldError` & `firstNonFieldError` to show errors unrelated to fields?
170170
- sets `::loading="isPending"` on submit button?
171171
- uses pending status for non-submit actions? (e.g. destroy)
172-
- Does the form use [vuelidate](https://monterail.github.io/vuelidate/) (`$v`) to check for validation errors client-side?
172+
- Does the form use [vuelidate](https://vuelidate-next.netlify.app) to check for validation errors client-side?

docs/src/frontend-structure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ src/
1717
- ...
1818
- datastore/ # vuex namespaced modules and plugins
1919
- activity.js
20-
- activity.spec.js # unit test
20+
- activity.spec.js # unit test
2121
- ...
2222
- components/ # reusable components (atoms, molecules, organism)
2323
- ActivityUser.vue
@@ -26,7 +26,7 @@ src/
2626
- ...
2727
- pages/ # page templates and instances
2828
- ActivitiesManage.vue # page connected with mapGetters and mapActions
29-
- ActivitiesManageUI.vue # or with vuex-connect
29+
- ActivitiesManageUI.vue
3030
- ...
3131
```
3232

jest.config.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const esModules = ['quasar', 'quasar/lang', 'lodash-es', 'leaflet'].join('|')
2+
3+
module.exports = {
4+
roots: [
5+
'<rootDir>/src/',
6+
],
7+
globals: {
8+
__DEV__: true,
9+
},
10+
testEnvironment: 'jsdom',
11+
testEnvironmentOptions: {
12+
pretendToBeVisual: true,
13+
},
14+
collectCoverage: true,
15+
coverageDirectory: './coverage/',
16+
coverageReporters: [
17+
'json',
18+
'lcov',
19+
],
20+
// Needed in JS codebases too because of feature flags
21+
coveragePathIgnorePatterns: ['/node_modules/', '.d.ts$'],
22+
testMatch: [
23+
'<rootDir>/src/**/*.spec.js',
24+
],
25+
moduleDirectories: [
26+
'node_modules',
27+
'<rootDir>/src',
28+
],
29+
moduleFileExtensions: ['vue', 'js', 'json'],
30+
moduleNameMapper: {
31+
'^quasar$': 'quasar/dist/quasar.esm.prod.js',
32+
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/test/fileMock.js',
33+
'\\.(css|less|styl|stylus|sass|scss)$': '<rootDir>/test/styleMock.js',
34+
'@/(.*)$': '<rootDir>/src/$1',
35+
'>/(.*)$': '<rootDir>/test/$1',
36+
},
37+
transform: {
38+
'.*\\.vue$': '@vue/vue3-jest',
39+
'.*\\.js$': 'babel-jest',
40+
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
41+
},
42+
transformIgnorePatterns: [`node_modules/(?!(${esModules}))`],
43+
snapshotSerializers: ['jest-serializer-vue'],
44+
setupFiles: [
45+
'<rootDir>/test/setup/env.js',
46+
'<rootDir>/test/setup/unhandledPromiseRejectionHandler.js',
47+
'<rootDir>/test/setup/mockRandom.js',
48+
'<rootDir>/test/setup/mockScroll.js',
49+
'<rootDir>/test/setup/mockUserAgent.js',
50+
'<rootDir>/test/setup/mockLocation.js',
51+
'jest-canvas-mock',
52+
],
53+
setupFilesAfterEnv: [
54+
'<rootDir>/test/setup/afterEnv.js',
55+
],
56+
}

jsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"exclude": [
1515
"dist",
1616
".quasar",
17-
"node_modules"
17+
"node_modules",
18+
"storybook-static",
19+
"docs/_book"
1820
]
1921
}

0 commit comments

Comments
 (0)