Skip to content

Commit

Permalink
build(frontend): update frontend packages 2024-08-21 (#1828)
Browse files Browse the repository at this point in the history
Updates packages:
typescript
vue-tsc
vuetify
@typescript-eslint packages
vite-plugin-checker
and makes some necessary changes.
Fixes #1750
  • Loading branch information
Bettelstab authored Aug 21, 2024
1 parent 8aa3a3b commit 8446bb8
Show file tree
Hide file tree
Showing 20 changed files with 12,220 additions and 14,561 deletions.
26,580 changes: 12,095 additions & 14,485 deletions frontend/package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"vue": "3.4.35",
"vue-i18n": "9.13.0",
"vue3-toastify": "^0.2.2",
"vuetify": "^3.5.17",
"vuetify": "^3.7.0",
"ws": "^8.18.0"
},
"devDependencies": {
Expand All @@ -101,8 +101,8 @@
"@types/js-cookie": "^3.0.6",
"@types/node": "^20.14.8",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"@vitest/coverage-v8": "^2.0.5",
"@vue/test-utils": "^2.4.6",
"chromatic": "^11.7.0",
Expand Down Expand Up @@ -138,12 +138,12 @@
"stylelint-config-standard-scss": "^13.1.0",
"ts-node": "^10.9.2",
"tsx": "^4.15.7",
"typescript": "^5.4.5",
"vite-plugin-checker": "^0.6.4",
"typescript": "^5.5.4",
"vite-plugin-checker": "^0.7.2",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-vuetify": "^2.0.3",
"vitest": "^2.0.4",
"vue-tsc": "^1.8.27"
"vue-tsc": "^2.0.29"
},
"imports": {
"#components/*": "./src/components/*",
Expand Down
5 changes: 4 additions & 1 deletion frontend/renderer/+onRenderHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ async function renderToString(app: App) {
err = err_
}
const appHtml = await renderToString_(app)
if (err) throw err
if (err) {
if (err instanceof Error) throw err
else throw new Error(String(err))
}
return appHtml
}

Expand Down
5 changes: 3 additions & 2 deletions frontend/scripts/buildServer/import.meta.url-polyfill.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any */
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
export const importMetaUrl =
typeof document === 'undefined'
? (new (require('url').URL)('file:' + __filename) as URL).href
? // eslint-disable-next-line @typescript-eslint/no-require-imports
(new (require('url').URL)('file:' + __filename) as URL).href
: (document.currentScript && (document.currentScript as any).src) ||
new URL('main.js', document.baseURI).href
3 changes: 2 additions & 1 deletion frontend/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const hasToken = (cookieString: string | undefined) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return !!JSON.parse(parse(cookieString).auth).user
} catch (error) {
return false
if (error instanceof SyntaxError) return false
throw error
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ exports[`AboutMeView > renders 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down Expand Up @@ -680,7 +684,11 @@ exports[`AboutMeView > renders initials 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down Expand Up @@ -1264,7 +1272,11 @@ exports[`AboutMeView > renders without social media accounts 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ exports[`EditSocialMedia > renders 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down Expand Up @@ -236,7 +240,11 @@ exports[`EditSocialMedia > renders 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ exports[`EditUserDetails > renders 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down Expand Up @@ -236,7 +240,11 @@ exports[`EditUserDetails > renders 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/cockpit/cockpit-card/CockpitCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const props = defineProps<{
</script>

<style scoped lang="scss">
@use 'sass:map';
@import 'vuetify/lib/styles/settings/_variables';
.cockpit-card {
Expand Down Expand Up @@ -46,7 +47,7 @@ const props = defineProps<{
border-width: 0.5px;
}
@media #{map-get($display-breakpoints, 'md-and-up')} {
@media #{map.get($display-breakpoints, 'md-and-up')} {
.narrow {
--card-width: 335px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ exports[`UserInfo > renders 1`] = `
aria-owns="v-menu-0"
class="user-info rounded-pill d-flex flex-row text-icon border-sm align-center justify-center"
data-v-607bdd70=""
targetref="[object Object]"
>
<div
Expand Down
12 changes: 4 additions & 8 deletions frontend/src/components/tablesDrawer/TablesDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
<v-navigation-drawer
v-model="isVisible"
:location="location"
width="auto"
mobile
class="menu-drawer px-4"
:class="[{ 'changing-orientation': isChangingOrientation }]"
:style="drawerStyle"
>
<v-text-field
v-model="searchValue"
Expand Down Expand Up @@ -76,10 +75,6 @@ const filteredItems = computed(() => {
const currentLocation = ref(props.location)
const isChangingOrientation = ref(false)
const drawerStyle = computed(() => ({
transition: isChangingOrientation.value ? 'none' : undefined,
}))
watch(
() => props.location,
(newLocation) => {
Expand All @@ -97,6 +92,7 @@ watch(
</script>

<style scoped lang="scss">
@use 'sass:map';
@import 'vuetify/lib/styles/settings/_variables';
.menu-drawer {
Expand All @@ -116,7 +112,7 @@ watch(
transition: none !important;
}
@media #{map-get($display-breakpoints, 'sm-and-down')} {
@media #{map.get($display-breakpoints, 'sm-and-down')} {
.menu-drawer {
left: var(--sides) !important;
z-index: 2000 !important;
Expand All @@ -128,7 +124,7 @@ watch(
}
}
@media #{map-get($display-breakpoints, 'md-and-up')} {
@media #{map.get($display-breakpoints, 'md-and-up')} {
.menu-drawer {
border-radius: 20px 0 0 20px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`TablesDrawer > renders correctly 1`] = `
class="v-navigation-drawer v-navigation-drawer--right v-navigation-drawer--temporary v-theme--light v-navigation-drawer--mobile menu-drawer px-4"
data-v-cf2c9067=""
drawer="true"
style="right: 0px; z-index: 1004; transform: translateX(110%); position: fixed; height: calc(100% - 0px - 0px); top: 0px; bottom: 0px;"
style="right: 0px; z-index: 1004; transform: translateX(256px); position: fixed; transition: none !important; height: calc(100% - 0px - 0px); top: 0px; bottom: 0px; width: 256px;"
>
<!---->
<!---->
Expand Down Expand Up @@ -50,7 +50,11 @@ exports[`TablesDrawer > renders correctly 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/layouts/DefaultLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ import TablesDrawer from '#components/tablesDrawer/TablesDrawer.vue'
import { JoinMyTableMutationResult, joinMyTableMutation } from '#mutations/joinMyTableMutation'
import GlobalErrorHandler from '#plugins/globalErrorHandler'
const isTablesDrawerVisible = defineModel<boolean>()
const isTablesDrawerVisible = ref(false)
const toggleDrawer = () => {
isTablesDrawerVisible.value = !isTablesDrawerVisible.value
Expand Down Expand Up @@ -150,6 +150,7 @@ const enterTable = async () => {
</script>

<style scoped lang="scss">
@use 'sass:map';
@import '#root/src/assets/scss/style';
@import 'vuetify/lib/styles/settings/_variables';
Expand All @@ -163,7 +164,7 @@ const enterTable = async () => {
margin-top: 70px;
}
@media #{map-get($display-breakpoints, 'sm-and-down')} {
@media #{map.get($display-breakpoints, 'sm-and-down')} {
.page-container {
margin-bottom: 50px;
}
Expand Down Expand Up @@ -221,11 +222,11 @@ const enterTable = async () => {
transition: bottom 0.75s;
&--active {
@media #{map-get($display-breakpoints, 'sm-and-down')} {
@media #{map.get($display-breakpoints, 'sm-and-down')} {
bottom: 60px;
}
@media #{map-get($display-breakpoints, 'md-and-up')} {
@media #{map.get($display-breakpoints, 'md-and-up')} {
bottom: 120px;
}
}
Expand Down
18 changes: 10 additions & 8 deletions frontend/src/layouts/__snapshots__/DefaultLayout.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`DefaultLayout > renders 1`] = `
<header
class="v-toolbar v-toolbar--flat v-toolbar--density-default v-theme--light v-locale--is-ltr v-app-bar app-bar"
data-v-75d0be1e=""
style="top: 0px; z-index: 1006; transform: translateY(0%); position: fixed; transition: none !important; left: 0px; width: calc(100% - 0px - 0px);"
style="top: 0px; z-index: 1006; transform: translateY(0px); position: fixed; transition: none !important; left: 0px; width: calc(100% - 0px - 0px);"
>
<!---->
Expand Down Expand Up @@ -679,7 +679,6 @@ exports[`DefaultLayout > renders 1`] = `
aria-owns="v-menu-1"
class="ml-2 user-info rounded-pill d-flex flex-row text-icon border-sm align-center justify-center"
data-v-607bdd70=""
targetref="[object Object]"
>
<div
Expand Down Expand Up @@ -755,7 +754,7 @@ exports[`DefaultLayout > renders 1`] = `
<nav
class="v-navigation-drawer v-navigation-drawer--right v-navigation-drawer--temporary v-theme--light v-navigation-drawer--mobile menu-drawer px-4 changing-orientation"
data-v-cf2c9067=""
style="bottom: 0px; z-index: 1004; transform: translateX(110%); position: fixed; right: 0px; height: calc(100% - 70px - 0px); top: 70px; transition: none;"
style="bottom: 0px; z-index: 1004; transform: translateX(256px); position: fixed; transition: none !important; height: calc(100% - 70px - 0px); width: 256px; right: 0px; top: 70px;"
>
<!---->
<!---->
Expand Down Expand Up @@ -792,7 +791,11 @@ exports[`DefaultLayout > renders 1`] = `
<!---->
<div
class="v-progress-linear__background"
style="width: 100%;"
style="opacity: NaN;"
/>
<div
class="v-progress-linear__buffer"
style="opacity: NaN; width: 0%;"
/>
<transition-stub
appear="false"
Expand Down Expand Up @@ -1652,7 +1655,7 @@ exports[`DefaultLayout > renders 1`] = `
class="v-btn v-btn--elevated v-theme--light v-btn--density-default v-btn--variant-elevated main-button main-button--border-gradient main-button-auto assistant-button"
data-v-2b63c1fe=""
data-v-75d0be1e=""
style="background-color: #f09630; color: #000; caret-color: #000; height: auto; width: auto;"
style="background-color: #f09630; color: #000; caret-color: #000; width: auto; height: auto;"
type="button"
>
Expand Down Expand Up @@ -1693,7 +1696,7 @@ exports[`DefaultLayout > renders 1`] = `
class="v-btn v-btn--elevated v-theme--light v-btn--density-default v-btn--variant-elevated main-button main-button--border-yellow main-button-auto new-table-button"
data-v-2b63c1fe=""
data-v-75d0be1e=""
style="background-color: #f09630; color: #000; caret-color: #000; height: auto; width: auto;"
style="background-color: #f09630; color: #000; caret-color: #000; width: auto; height: auto;"
type="button"
>
Expand Down Expand Up @@ -1734,7 +1737,7 @@ exports[`DefaultLayout > renders 1`] = `
class="v-btn v-btn--elevated v-theme--light v-btn--density-default v-btn--variant-elevated main-button main-button--border-blue main-button-auto new-project-button"
data-v-2b63c1fe=""
data-v-75d0be1e=""
style="background-color: #f09630; color: #000; caret-color: #000; height: auto; width: auto;"
style="background-color: #f09630; color: #000; caret-color: #000; width: auto; height: auto;"
type="button"
>
Expand Down Expand Up @@ -2295,7 +2298,6 @@ exports[`DefaultLayout > renders 1`] = `
aria-owns="v-menu-8"
class="mx-auto user-info rounded-pill d-flex flex-row text-icon border-sm align-center justify-center"
data-v-607bdd70=""
targetref="[object Object]"
>
<div
Expand Down
12 changes: 5 additions & 7 deletions frontend/src/pages/Guard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ describe('global route guard', () => {

describe('unauthenticated', () => {
it('throws and redirects', () => {
try {
// eslint-disable-next-line vitest/require-to-throw-message
expect(guard({ hasToken: false } as PageContextServer)).toThrow()
} catch (error) {
// eslint-disable-next-line vitest/no-conditional-expect
expect(redirect).toHaveBeenCalledWith('/signin')
}
/* We expect redirect('/signin') to be thrown, but it's an object,
which is not an acceptable argument for toThrow(). */
/* eslint-disable-next-line vitest/require-to-throw-message */
expect(() => guard({ hasToken: false } as PageContextServer)).toThrow()
expect(redirect).toHaveBeenCalledWith('/signin')
})
})

Expand Down
Loading

0 comments on commit 8446bb8

Please sign in to comment.