Migrate to Vue CLI v5

This commit is contained in:
silverpill 2022-05-18 14:33:06 +00:00
parent dee1cfa691
commit 461319a343
12 changed files with 11610 additions and 23367 deletions

View file

@ -6,7 +6,7 @@ module.exports = {
extends: [
"plugin:vue/vue3-essential",
"@vue/standard",
"@vue/typescript/recommended",
"@vue/typescript",
],
parserOptions: {
ecmaVersion: 2020,

34918
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -34,31 +34,27 @@
"@types/mocha": "^5.2.4",
"@types/sinon": "^10.0.4",
"@types/sinon-chai": "^3.2.5",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"@vue/cli-plugin-eslint": "~4.5.16",
"@vue/cli-plugin-router": "~4.5.16",
"@vue/cli-plugin-typescript": "~4.5.16",
"@vue/cli-plugin-unit-mocha": "~4.5.16",
"@vue/cli-service": "~4.5.16",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^5.25.0",
"@vue/cli-plugin-eslint": "~5.0.4",
"@vue/cli-plugin-router": "~5.0.4",
"@vue/cli-plugin-typescript": "~5.0.4",
"@vue/cli-plugin-unit-mocha": "~5.0.4",
"@vue/cli-service": "~5.0.4",
"@vue/compiler-sfc": "^3.2.23",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/eslint-config-typescript": "^7.0.0",
"@vue/eslint-config-standard": "^6.1.0",
"@vue/eslint-config-typescript": "^8.0.0",
"@vue/test-utils": "^2.0.0-0",
"chai": "^4.1.2",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^7.0.0",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.2",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^7.20.0",
"sass": "~1.32.13",
"sass-loader": "^10.2.1",
"sinon": "^11.1.2",
"sinon-chai": "^3.7.0",
"stylelint": "^13.13.1",
"stylelint-config-sass-guidelines": "^8.0.0",
"typescript": "~4.1.5"
"typescript": "~4.5.5"
},
"lavamoat": {
"allowScripts": {
@ -67,7 +63,6 @@
"core-js": false,
"nodent-runtime": false,
"ejs": false,
"node-sass": true,
"fsevents": false,
"@vue/cli-plugin-eslint>yorkie": false,
"@vue/cli-plugin-unit-mocha>mochapack>@babel/runtime-corejs2>core-js": false,
@ -75,7 +70,8 @@
"@vue/cli-service>webpack-bundle-analyzer>ejs": false,
"@vue/cli-plugin-unit-mocha>mochapack>chokidar>fsevents": false,
"@vue/cli-service>webpack-dev-server>chokidar>fsevents": false,
"sass-loader>webpack>watchpack>watchpack-chokidar2>chokidar>fsevents": false
"sass-loader>webpack>watchpack>watchpack-chokidar2>chokidar>fsevents": false,
"sass-loader>node-sass": true
}
}
}

View file

@ -210,7 +210,7 @@ export default class PostEditor extends Vue {
postData,
this.attachment,
)
} catch (error) {
} catch (error: any) {
this.errorMessage = error.message
return
}

View file

@ -17,7 +17,7 @@
<script setup lang="ts">
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-unused-vars */
import type { Post as PostObject } from "@/api/posts"
import Post from "@/components/Post.vue"

View file

@ -10,7 +10,7 @@
<script setup lang="ts">
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-unused-vars */
import { Profile } from "@/api/users"
import Avatar from "@/components/Avatar.vue"
import { useInstanceInfo } from "@/store/instance"

View file

@ -117,7 +117,7 @@ export default class LandingPage extends Vue {
invite_code: this.inviteCode,
})
authToken = await getAccessToken(message, signature)
} catch (error) {
} catch (error: any) {
this.isLoading = false
this.registrationErrorMessage = error.message
return
@ -149,7 +149,7 @@ export default class LandingPage extends Vue {
try {
authToken = await getAccessToken(message, signature)
user = await getCurrentUser(authToken)
} catch (error) {
} catch (error: any) {
this.loginErrorMessage = error.message
return
}

View file

@ -74,7 +74,7 @@
</template>
<script setup lang="ts">
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-unused-vars */
import { ref, onMounted } from "vue"
import { PAGE_SIZE } from "@/api/common"
import { updateNotificationMarker } from "@/api/markers"

View file

@ -59,7 +59,7 @@ export default class PostDetail extends Vue {
async mounted() {
try {
this.thread = await this.loader
} catch (error) {
} catch (error: any) {
if (error.message === "post not found") {
// Show "not found" text
return

View file

@ -66,7 +66,7 @@ export default class SearchResultList extends Vue {
)
this.profiles = results.accounts
this.posts = results.statuses
} catch (error) {
} catch (error: any) {
this.errorMessage = error.message
}
this.isLoading = false

View file

@ -1,13 +1,16 @@
import { expect } from "chai"
import { shallowMount } from "@vue/test-utils"
import Avatar from "@/components/Avatar.vue"
// Import doesn't work because of sass-loader (SassError: Can't find stylesheet to import)
// import Avatar from "@/components/Avatar.vue"
describe("Avatar.vue", () => {
// Not working due to Vue bug https://github.com/vuejs/vue-next/issues/3590
/*
it.skip("Renders component", () => {
const profile = { avatar: "https://test.com" }
const wrapper = shallowMount(Avatar as any, { props: { profile } })
expect(wrapper.text()).to.include("")
})
*/
})