Skip to content

Commit

Permalink
chore(deps): update to Nuxt 2.16 (Vue 2.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
PFischbeck committed Feb 17, 2023
1 parent 3a4c37e commit af09533
Show file tree
Hide file tree
Showing 6 changed files with 2,771 additions and 2,221 deletions.
12 changes: 9 additions & 3 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module.exports = {
root: true,
settings: {
"import/ignore": ["@vueuse*"],
},
env: {
browser: true,
node: true,
Expand Down Expand Up @@ -58,6 +55,15 @@ module.exports = {
],

// TODO Gradually activate all rules
// Allow Promise in onMounted
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
arguments: false,
},
},
],
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
Expand Down
44 changes: 23 additions & 21 deletions frontend/components/Domain/Recipe/RecipeDialogSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<script lang="ts">
import { defineComponent, toRefs, reactive, ref, watch, useRoute } from "@nuxtjs/composition-api";
import { watchDebounced } from "@vueuse/shared";
import { watchDebounced } from "@vueuse/shared";
import RecipeCardMobile from "./RecipeCardMobile.vue";
import { RecipeSummary } from "~/lib/api/types/recipe";
import { useUserApi } from "~/composables/api";
Expand Down Expand Up @@ -136,32 +136,34 @@ export default defineComponent({
dialog.value = true;
}
function close() {
dialog.value = false;
}
// ===========================================================================
// Basic Search
const api = useUserApi();
const search = ref("")
watchDebounced(search, async (val) => {
console.log(val)
if (val) {
state.loading = true;
// @ts-expect-error - inferred type is wrong
const { data, error } = await api.recipes.search({ search: val as string, page: 1, perPage: 10 });
if (error || !data) {
console.error(error);
state.searchResults = [];
} else {
state.searchResults = data.items;
const search = ref("");
watchDebounced(
search,
async (val) => {
console.log(val);
if (val) {
state.loading = true;
const { data, error } = await api.recipes.search({ search: val, page: 1, perPage: 10 });
if (error || !data) {
console.error(error);
state.searchResults = [];
} else {
state.searchResults = data.items;
}
state.loading = false;
}
state.loading = false;
}
}, { debounce: 500, maxWait: 1000 });
},
{ debounce: 500, maxWait: 1000 }
);
// ===========================================================================
// Select Handler
Expand All @@ -171,7 +173,7 @@ export default defineComponent({
context.emit(SELECTED_EVENT, recipe);
}
return { ...toRefs(state), dialog, open, close, handleSelect, search, };
return { ...toRefs(state), dialog, open, close, handleSelect, search };
},
});
</script>
Expand Down
4 changes: 1 addition & 3 deletions frontend/components/global/BaseDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default defineComponent({
type: String,
default: function () {
return this.$t("general.create");
}
},
},
keepOpen: {
default: false,
Expand All @@ -118,8 +118,6 @@ export default defineComponent({
setup(props, context) {
const dialog = computed<boolean>({
get() {
// @ts-expect-error - props inference doesn't work here for some reason
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return props.value;
},
set(val) {
Expand Down
16 changes: 9 additions & 7 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,26 @@
"@nuxtjs/i18n": "7.2.0",
"@nuxtjs/proxy": "^2.1.0",
"@nuxtjs/pwa": "3.2.0",
"@vue/composition-api": "^1.7.0",
"@vueuse/core": "^9.9.0",
"core-js": "^3.27.0",
"date-fns": "^2.29.3",
"fuse.js": "^6.6.2",
"isomorphic-dompurify": "^0.27.0",
"nuxt": "^2.15.8",
"nuxt": "^2.16.0",
"v-jsoneditor": "^1.4.5",
"vuedraggable": "^2.24.3",
"vuetify": "^2.6.13"
},
"devDependencies": {
"@babel/eslint-parser": "^7.19.1",
"@nuxt/types": "^2.15.7",
"@nuxt/types": "^2.16.0",
"@nuxt/typescript-build": "^2.1.0",
"@nuxtjs/composition-api": "^0.32.0",
"@nuxtjs/composition-api": "^0.33.1",
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"@nuxtjs/eslint-module": "3.1.0",
"@nuxtjs/google-fonts": "2.0.0",
"@nuxtjs/vuetify": "^1.12.1",
"@types/sortablejs": "^1.15.0",
"@vue/runtime-dom": "^3.2.45",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-nuxt": "^4.0.0",
Expand All @@ -53,7 +51,11 @@
"lint-staged": "^13.1.0",
"nuxt-vite": "0.2.3",
"prettier": "^2.8.1",
"vitest": "^0.28.0",
"vue2-script-setup-transform": "^0.3.5"
"vitest": "^0.28.0"
},
"resolutions": {
"vue-template-compiler": "2.7.14",
"vue-demi": "^0.13.11",
"typescript": "^4.9.5"
}
}
3 changes: 1 addition & 2 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
]
},
"vueCompilerOptions": {
"target": 2,
"experimentalCompatMode": 2
"target": 2.7
},
"include": ["**/*", ".eslintrc.js"],
"exclude": ["node_modules", ".nuxt", "dist"]
Expand Down
Loading

0 comments on commit af09533

Please sign in to comment.