Skip to content

Commit 292f0f5

Browse files
itamargivhasanakg
andauthored
Update vue and peers (#758)
* Install vue3 and dependencies * Mock correct version of inertia * Update error message fallback render function * Fix missing Vue import * Setup i18n * Setup pinia * Update defineComponent * Replace wikit-dialog with codex-dialog in Home.vue * Replace wikit-dialog with codex-dialog in Results.vue * Update bubble * Update lifecycle methods * Fix TS errors * Remove vuex from tests * Replace wikit dialog and select * Empty playground.vue * Add migration eslint rules * Update propsData to props * Update tests * Add lost package-lock.json * Setup i18n (#753) * Setup i18n * Remove unnecessary function --------- Co-authored-by: Itamar Givon <itamar.givon.dev@gmail.com> * Setup pinia * Resolve package-lock conflicts * Remove console.log * Restore Playground.vue * Fix linting issues * Update package-lock * Fix i18n (#760) * Enable parsing of wikitext style links in i18n messages * Update links in i18n messagesto wikitext style * Update browser tests (#759) * Fix browser tests * Disable assertVue assertions * Oops, missed two! --------- Co-authored-by: Itamar Givon <itamar.givon.dev@gmail.com> * Fix mix manifest --------- Co-authored-by: Hasan Akgün <hasanakg@outlook.com>
1 parent 0422da1 commit 292f0f5

Some content is hidden

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

41 files changed

+2217
-2188
lines changed

.eslintrc.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ module.exports = {
1212
rules: {
1313
'max-len': [ 'error', 120 ],
1414
'no-multiple-empty-lines' : ['error', { 'max': 1 }],
15-
'vue/multi-word-component-names' : [ 'off' ]
16-
},
15+
'vue/multi-word-component-names' : [ 'off' ],
16+
// Migration changes
17+
'vue/no-deprecated-v-bind-sync': 'off',
18+
'vue/no-deprecated-slot-attribute': 'off',
19+
'vue/require-explicit-emits': 'off',
20+
'vue/no-deprecated-v-on-native-modifier': 'off',
21+
'vue/no-deprecated-slot-scope-attribute': 'off',
22+
'vue/no-v-for-template-key-on-child': 'off',
23+
'vue/no-deprecated-destroyed-lifecycle': 'off',
24+
'vue/no-v-model-argument': 'off'
25+
},
1726
};

jest.config.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const path = require("path");
12
module.exports = {
23
// Where are your vue tests located?
34
"roots": [
@@ -9,7 +10,7 @@ module.exports = {
910
// js: transform js files with babel, we can now use import statements in tests
1011
// ts: transform ts files with babel, to import ts files into js specs
1112
"transform": {
12-
".*\\.(vue)$": "<rootDir>/node_modules/@vue/vue2-jest",
13+
".*\\.(vue)$": "<rootDir>/node_modules/@vue/vue3-jest",
1314
"^.+\\.js$": "<rootDir>/node_modules/babel-jest",
1415
"^.+\\.tsx?$": "<rootDir>/node_modules/ts-jest"
1516
},
@@ -21,6 +22,29 @@ module.exports = {
2122
// "import Counter from '@/Counter.vue'"
2223
// (no need for a full path)
2324
"moduleNameMapper": {
24-
"^@/(.*)$": "<rootDir>/resources/js/$1"
25+
"^vue$": "@vue/compat",
26+
'^@vue/composition-api$': '@vue/compat',
27+
'^@wmde/wikit-vue-components$':
28+
'@wmde/wikit-vue-components/dist/wikit-vue-components-vue3compat.common.js',
29+
'^wikit-dist(.*)$': "<rootDir>/node_modules/@wmde/wikit-vue-components/dist$1",
30+
"^@/(.*)$": "<rootDir>/resources/js/$1",
2531
},
32+
// For Vue migration build
33+
// Further info: https://test-utils.vuejs.org/migration/#-vue-vue3-jest-jest-28
34+
"testEnvironmentOptions": {
35+
"customExportConditions": ["node", "node-addons"],
36+
},
37+
// For Vue migration build
38+
// Add compat config to test as well
39+
"globals": {
40+
"vue-jest": {
41+
"compilerOptions": {
42+
compatConfig: {
43+
MODE: 3,
44+
COMPILER_V_ON_NATIVE: true,
45+
COMPILER_V_BIND_SYNC: true
46+
}
47+
}
48+
}
49+
}
2650
}

package-lock.json

Lines changed: 1624 additions & 1465 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
"production": "mix --production"
1616
},
1717
"devDependencies": {
18+
"@pinia/testing": "^0.1.3",
1819
"@types/jest": "^29.5.5",
1920
"@types/lodash": "^4.14.199",
2021
"@typescript-eslint/eslint-plugin": "^6.7.5",
2122
"@typescript-eslint/parser": "^6.7.5",
23+
"@vue/compiler-sfc": "^3.3.8",
2224
"@vue/eslint-config-typescript": "^12.0.0",
23-
"@vue/test-utils": "^1.3.6",
24-
"@vue/vue2-jest": "^29.2.6",
25+
"@vue/test-utils": "^2.0.0",
26+
"@vue/vue3-jest": "^29.2.4",
27+
"@vue/runtime-dom": "^3.3.8",
2528
"@wikimedia/codex": "^0.20.0",
2629
"@wikimedia/codex-design-tokens": "^0.20.0",
2730
"@wikimedia/codex-icons": "^0.20.0",
@@ -42,25 +45,19 @@
4245
"ts-jest": "^29.1.0",
4346
"ts-loader": "^9.5.0",
4447
"typescript": "^5.2.2",
45-
"vue-loader": "^15.10.2",
46-
"vue-template-compiler": "^2.6.14"
48+
"vue-loader": "^16.0.0"
4749
},
4850
"dependencies": {
4951
"@inertiajs/inertia": "^0.11.0",
50-
"@inertiajs/inertia-vue": "^0.8.0",
51-
"@vue/composition-api": "^1.7.2",
52+
"@inertiajs/inertia-vue3": "^0.6.0",
53+
"@vue/compat": "^3.3.8",
5254
"@wmde/wikit-tokens": "^2.1.0-alpha.15",
5355
"@wmde/wikit-vue-components": "^2.1.0-alpha.16",
5456
"date-fns": "^2.30.0",
5557
"lodash": "^4.17.21",
58+
"pinia": "^2.1.7",
5659
"ress": "^5.0.2",
57-
"vue": "^2.6.14",
58-
"vue-banana-i18n": "1.5.0",
59-
"vuex": "^3.6.2"
60-
},
61-
"overrides": {
62-
"@wikimedia/codex": {
63-
"vue": "^2.6.14"
64-
}
60+
"vue": "^3.3.8",
61+
"vue-banana-i18n": "2.3.0"
6562
}
6663
}

public/i18n/en.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"review-status-none": "None of the above",
4848
"result-form-submit": "Save reviews",
4949
"changes-submitted-message": "Review successfully saved for:",
50-
"log-in-message": "Please <a href=\"$1\">log in</a> to make any changes.",
50+
"log-in-message": "Please [$1 log in] to make any changes.",
5151
"results-page-description": "You can fix them! The table below presents you with links to the statements on Wikidata and to the entries on the external source. You can compare the values and manually fix the mismatches by editing Wikidata or the external source. After investigating and fixing the mismatches, you can indicate their status using the options from the drop-down. This tool will not automatically make these edits for you upon submission.",
5252
"results-page-title": "What should I do with the mismatches?",
5353
"results-instructions-button": "Instructions",
@@ -80,17 +80,17 @@
8080
"faq-dialog-question-relevance": "How up-to-date are the mismatches?",
8181
"faq-dialog-answer-relevance": "It depends! Inspecting external databases, catalogs and websites takes a lot of time and resources. The checks are performed periodically in batches. We try hard to remove outdated mismatches, but you might still find some.",
8282
"faq-dialog-question-contributing": "How can I contribute new mismatches?",
83-
"faq-dialog-answer-contributing": "If you've compared Wikidata's data against an external source and have found mismatches, you can open a task in <a href=\"$1\">Phabricator</a> to request an upload of your mismatches.",
83+
"faq-dialog-answer-contributing": "If you've compared Wikidata's data against an external source and have found mismatches, you can open a task in [$1 Phabricator] to request an upload of your mismatches.",
8484
"faq-dialog-question-more-info": "Where can I find more information?",
85-
"faq-dialog-answer-more-info": "This tool’s documentation and the source code are available on <a href=\"$1\">GitHub</a>. You can read more about the Mismatch Finder on <a href=\"$2\">Wikidata</a> or you can <a href=\"$3\">give us feedback</a>.",
85+
"faq-dialog-answer-more-info": "This tool’s documentation and the source code are available on [$1 GitHub]. You can read more about the Mismatch Finder on [$2 Wikidata] or you can [$3 give us feedback].",
8686
"wikidata-tool-footer-about-tool": "About the $1",
87-
"wikidata-tool-footer-license": "Licensed under <a href=\"$1\">$2</a>",
87+
"wikidata-tool-footer-license": "Licensed under [$1 $2]",
8888
"wikidata-tool-footer-source": "Get source code",
8989
"wikidata-tool-footer-issues": "Report an issue",
9090
"wikidata-tool-footer-about-us": "About us",
9191
"wikidata-tool-footer-privacy": "Privacy policy",
9292
"wikidata-tool-footer-wmde": "Wikimedia Deutschland",
93-
"wikidata-tool-footer-team": "Made with ♥ by the <a href=\"$1\">Wikidata Team</a>",
93+
"wikidata-tool-footer-team": "Made with ♥ by the [$1 Wikidata Team]",
9494
"mismatch-finder-license": "BSD 3-Clause License",
9595
"mismatch-finder-footer-more-tools": "More data quality tools",
9696
"tool-query-builder": "Query Builder",

public/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"/js/app.js": "/js/app.js",
3-
"/css/noscript.css": "/css/noscript.css",
43
"/css/app.css": "/css/app.css",
4+
"/css/noscript.css": "/css/noscript.css",
55
"/images/clear.svg": "/images/clear.svg",
66
"/images/close.svg": "/images/close.svg",
77
"/images/download-stats.svg": "/images/download-stats.svg",

resources/js/Components/AuthWidget.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010

1111
<script lang="ts">
1212
13-
import Vue, { PropType } from 'vue';
13+
import type { PropType } from 'vue';
14+
import { defineComponent } from 'vue';
1415
import User from '../types/User';
1516
import { Link as WikitLink } from '@wmde/wikit-vue-components';
1617
17-
export default Vue.extend({
18+
export default defineComponent({
1819
props: {
1920
user: Object as PropType<User>
2021
},

resources/js/Components/LanguageSelector.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
import LanguageSelectorInput from '../Components/LanguageSelectorInput.vue';
3636
import LanguageSelectorOptionsMenu from '../Components/LanguageSelectorOptionsMenu.vue';
3737
import Language from '../types/Language';
38-
import Vue from 'vue';
38+
import { defineComponent } from 'vue';
3939
import languagedata from '@wikimedia/language-data';
4040
import closeUrl from '../../img/close.svg';
4141
42-
export default Vue.extend( {
42+
export default defineComponent( {
4343
name: 'LanguageSelector',
4444
components: {
4545
LanguageSelectorInput,

resources/js/Components/LanguageSelectorInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
</template>
3030

3131
<script lang="ts">
32-
import Vue from 'vue';
32+
import { defineComponent } from 'vue';
3333
import searchUrl from '../../img/search.svg';
3434
import clearUrl from '../../img/clear.svg';
3535
36-
export default Vue.extend( {
36+
export default defineComponent( {
3737
name: 'LanguageSelectorInput',
3838
props: {
3939
value: {

resources/js/Components/LanguageSelectorOptionsMenu.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535

3636
<script lang="ts">
3737
import Language from '../types/Language';
38-
import Vue, { PropType } from 'vue';
38+
import type { PropType } from 'vue';
39+
import { defineComponent } from 'vue';
3940
40-
export default Vue.extend( {
41+
export default defineComponent( {
4142
name: 'LanguageSelectorOptionsMenu',
4243
props: {
4344
languages: {

0 commit comments

Comments
 (0)