Client - upgrade Vue to 3.3 and move to Vite

This commit is contained in:
Sam
2023-11-11 15:23:04 +01:00
parent 91455251e1
commit 1befae927d
309 changed files with 6291 additions and 12719 deletions

View File

@ -1,6 +1,6 @@
import { LocationQuery } from 'vue-router'
import type { LocationQuery } from 'vue-router'
import { IQueryOptions, TPaginationPayload } from '@/types/api'
import type { IQueryOptions, TPaginationPayload } from '@/types/api'
export const sortList: string[] = ['asc', 'desc']
export const defaultPage = 1
@ -66,7 +66,7 @@ export const workoutsPayloadKeys = [
'duration_from',
'duration_to',
'sport_id',
'title'
'title',
]
const getRange = (stop: number, start = 1): number[] => {

View File

@ -1,20 +1,20 @@
import { AxiosError } from 'axios'
import { ActionContext } from 'vuex'
import type { ActionContext } from 'vuex'
import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'
import { IAuthUserState } from '@/store/modules/authUser/types'
import { IOAuth2State } from '@/store/modules/oauth2/types'
import { IRootState } from '@/store/modules/root/types'
import { ISportsState } from '@/store/modules/sports/types'
import { IStatisticsState } from '@/store/modules/statistics/types'
import { IUsersState } from '@/store/modules/users/types'
import { IWorkoutsState } from '@/store/modules/workouts/types'
import { IApiErrorMessage } from '@/types/api'
import type { IAuthUserState } from '@/store/modules/authUser/types'
import type { IOAuth2State } from '@/store/modules/oauth2/types'
import type { IRootState } from '@/store/modules/root/types'
import type { ISportsState } from '@/store/modules/sports/types'
import type { IStatisticsState } from '@/store/modules/statistics/types'
import type { IUsersState } from '@/store/modules/users/types'
import type { IWorkoutsState } from '@/store/modules/workouts/types'
import type { IApiErrorMessage } from '@/types/api'
export const getApiUrl = (): string => {
return process.env.NODE_ENV === 'production'
return import.meta.env.PROD
? '/api/'
: `${process.env.VUE_APP_API_URL}/api/`
: `${import.meta.env.VITE_APP_API_URL}/api/`
}
export const handleError = (

View File

@ -1,5 +1,4 @@
/* eslint-disable import/no-duplicates */
import { Locale } from 'date-fns'
import type { Locale } from 'date-fns'
import { de, enUS, es, fr, gl, it, nb, nl, pl } from 'date-fns/locale'
import createI18n from '@/i18n'

View File

@ -1,7 +1,7 @@
import createI18n from '@/i18n'
import { ITranslatedSport } from '@/types/sports'
import { TUnit } from '@/types/units'
import { ICardRecord, IRecord, IRecordsBySports } from '@/types/workouts'
import type { ITranslatedSport } from '@/types/sports'
import type { TUnit } from '@/types/units'
import type { ICardRecord, IRecord, IRecordsBySports } from '@/types/workouts'
import { formatDate, getDateFormat } from '@/utils/dates'
import { convertDistance, units } from '@/utils/units'

View File

@ -1,5 +1,5 @@
import { ISport, ITranslatedSport, TActiveStatus } from '@/types/sports'
import { IWorkout } from '@/types/workouts'
import type { ISport, ITranslatedSport, TActiveStatus } from '@/types/sports'
import type { IWorkout } from '@/types/workouts'
export const sportColors: Record<string, string> = {
'Cycling (Sport)': '#4c9792',

View File

@ -15,9 +15,9 @@ import {
} from 'date-fns'
import createI18n from '@/i18n'
import { IChartDataset } from '@/types/chart'
import { ISport } from '@/types/sports'
import {
import type { IChartDataset } from '@/types/chart'
import type { ISport } from '@/types/sports'
import type {
IStatisticsChartData,
IStatisticsDateParams,
TStatisticsDatasetKeys,

View File

@ -1,4 +1,4 @@
import { TStatisticsDatasetKeys } from '@/types/statistics'
import type { TStatisticsDatasetKeys } from '@/types/statistics'
import { formatDuration } from '@/utils/duration'
import { units } from '@/utils/units'

View File

@ -1,4 +1,4 @@
import { IUnit, TFactor, TUnit } from '@/types/units'
import type { IUnit, TFactor, TUnit } from '@/types/units'
export const units: Record<string, IUnit> = {
ft: {

View File

@ -1,4 +1,4 @@
import {
import type {
IWorkout,
IWorkoutApiChartData,
IWorkoutChartData,