refactor: remove barrel files (#1855)

This commit is contained in:
Phan An 2024-10-17 11:41:30 +07:00 committed by GitHub
parent 9c5b763267
commit 387b937820
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
344 changed files with 1294 additions and 997 deletions

View file

@ -37,10 +37,10 @@
<script lang="ts" setup>
import { defineAsyncComponent, onMounted, provide, ref, watch } from 'vue'
import { useOnline } from '@vueuse/core'
import { queueStore } from '@/stores'
import { authService } from '@/services'
import { queueStore } from '@/stores/queueStore'
import { authService } from '@/services/authService'
import { CurrentPlayableKey, DialogBoxKey, MessageToasterKey, OverlayKey } from '@/symbols'
import { useRouter } from '@/composables'
import { useRouter } from '@/composables/useRouter'
import DialogBox from '@/components/ui/DialogBox.vue'
import MessageToaster from '@/components/ui/message-toaster/MessageToaster.vue'

View file

@ -1,19 +1,20 @@
import isMobile from 'ismobilejs'
import { isObject, mergeWith } from 'lodash'
import type { RenderOptions } from '@testing-library/vue'
import { cleanup, createEvent, fireEvent, render } from '@testing-library/vue'
import { afterEach, beforeEach, vi } from 'vitest'
import { defineComponent, nextTick } from 'vue'
import { commonStore, userStore } from '@/stores'
import { http } from '@/services'
import factory from '@/__tests__/factory'
import { DialogBoxKey, MessageToasterKey, OverlayKey, RouterKey } from '@/symbols'
import { DialogBoxStub, MessageToasterStub, OverlayStub } from '@/__tests__/stubs'
import { routes } from '@/config'
import Router from '@/router'
import userEvent from '@testing-library/user-event'
import type { UserEvent } from '@testing-library/user-event/dist/types/setup/setup'
import type { EventType } from '@testing-library/dom/types/events'
import { cleanup, createEvent, fireEvent, render } from '@testing-library/vue'
import { afterEach, beforeEach, vi } from 'vitest'
import { defineComponent, nextTick } from 'vue'
import factory from '@/__tests__/factory'
import { DialogBoxStub, MessageToasterStub, OverlayStub } from '@/__tests__/stubs'
import { commonStore } from '@/stores/commonStore'
import { userStore } from '@/stores/userStore'
import { http } from '@/services/http'
import { DialogBoxKey, MessageToasterKey, OverlayKey, RouterKey } from '@/symbols'
import { routes } from '@/config/routes'
import Router from '@/router'
// A deep-merge function that
// - supports symbols as keys (_.merge doesn't)

View file

@ -1,5 +1,5 @@
import type { Faker } from '@faker-js/faker'
import { genres } from '@/config'
import { genres } from '@/config/genres'
export default (faker: Faker): Genre => {
return {

View file

@ -1,5 +1,5 @@
import { faker } from '@faker-js/faker'
import { genres } from '@/config'
import { genres } from '@/config/genres'
const generate = (partOfCompilation = false): Song => {
const artistId = faker.datatype.number({ min: 3 })

View file

@ -1,6 +1,6 @@
import type { Ref } from 'vue'
import { ref } from 'vue'
import { noop } from '@/utils'
import { noop } from '@/utils/helpers'
import type MessageToaster from '@/components/ui/message-toaster/MessageToaster.vue'
import type DialogBox from '@/components/ui/DialogBox.vue'

View file

@ -1,8 +1,12 @@
import { createApp } from 'vue'
import { focus, hideBrokenIcon, newTab, overflowFade, tooltip } from '@/directives'
import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome'
import { createApp } from 'vue'
import { focus } from '@/directives/focus'
import { tooltip } from '@/directives/tooltip'
import { hideBrokenIcon } from '@/directives/hideBrokenIcon'
import { overflowFade } from '@/directives/overflowFade'
import { newTab } from '@/directives/newTab'
import { RouterKey } from '@/symbols'
import { routes } from '@/config'
import { routes } from '@/config/routes'
import Router from '@/router'
import '@/../css/app.pcss'
import App from './App.vue'

View file

@ -1,10 +1,12 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import { downloadService, playbackService } from '@/services'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore, songStore } from '@/stores'
import { eventBus } from '@/utils'
import { downloadService } from '@/services/downloadService'
import { playbackService } from '@/services/playbackService'
import { commonStore } from '@/stores/commonStore'
import { songStore } from '@/stores/songStore'
import { eventBus } from '@/utils/eventBus'
import AlbumCard from './AlbumCard.vue'
let album: Album

View file

@ -32,10 +32,15 @@
<script lang="ts" setup>
import { computed, toRef, toRefs } from 'vue'
import { eventBus } from '@/utils'
import { albumStore, artistStore, commonStore, songStore } from '@/stores'
import { downloadService, playbackService } from '@/services'
import { useDraggable, useRouter } from '@/composables'
import { eventBus } from '@/utils/eventBus'
import { albumStore } from '@/stores/albumStore'
import { artistStore } from '@/stores/artistStore'
import { commonStore } from '@/stores/commonStore'
import { songStore } from '@/stores/songStore'
import { downloadService } from '@/services/downloadService'
import { playbackService } from '@/services/playbackService'
import { useDraggable } from '@/composables/useDragAndDrop'
import { useRouter } from '@/composables/useRouter'
import BaseCard from '@/components/ui/album-artist/AlbumOrArtistCard.vue'

View file

@ -3,9 +3,11 @@ import { expect, it } from 'vitest'
import { screen } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { eventBus } from '@/utils'
import { downloadService, playbackService } from '@/services'
import { commonStore, songStore } from '@/stores'
import { eventBus } from '@/utils/eventBus'
import { downloadService } from '@/services/downloadService'
import { playbackService } from '@/services/playbackService'
import { commonStore } from '@/stores/commonStore'
import { songStore } from '@/stores/songStore'
import AlbumContextMenu from './AlbumContextMenu.vue'
let album: Album

View file

@ -16,10 +16,15 @@
<script lang="ts" setup>
import { computed, ref, toRef } from 'vue'
import { albumStore, artistStore, commonStore, songStore } from '@/stores'
import { downloadService, playbackService } from '@/services'
import { useContextMenu, useRouter } from '@/composables'
import { eventBus } from '@/utils'
import { albumStore } from '@/stores/albumStore'
import { artistStore } from '@/stores/artistStore'
import { commonStore } from '@/stores/commonStore'
import { songStore } from '@/stores/songStore'
import { downloadService } from '@/services/downloadService'
import { playbackService } from '@/services/playbackService'
import { useContextMenu } from '@/composables/useContextMenu'
import { useRouter } from '@/composables/useRouter'
import { eventBus } from '@/utils/eventBus'
const { go } = useRouter()
const { base, ContextMenu, open, trigger } = useContextMenu()

View file

@ -2,8 +2,8 @@ import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore } from '@/stores'
import { mediaInfoService } from '@/services'
import { commonStore } from '@/stores/commonStore'
import { mediaInfoService } from '@/services/mediaInfoService'
import AlbumInfoComponent from './AlbumInfo.vue'
let album: Album

View file

@ -33,8 +33,8 @@
<script lang="ts" setup>
import { defineAsyncComponent, ref, toRefs, watch } from 'vue'
import { mediaInfoService } from '@/services'
import { useThirdPartyServices } from '@/composables'
import { mediaInfoService } from '@/services/mediaInfoService'
import { useThirdPartyServices } from '@/composables/useThirdPartyServices'
import AlbumThumbnail from '@/components/ui/album-artist/AlbumOrArtistThumbnail.vue'
import AlbumArtistInfo from '@/components/ui/album-artist/AlbumOrArtistInfo.vue'

View file

@ -2,8 +2,8 @@ import { screen } from '@testing-library/vue'
import factory from '@/__tests__/factory'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { songStore } from '@/stores/songStore'
import AlbumTrackList from './AlbumTrackList.vue'
import { songStore } from '@/stores'
new class extends UnitTestCase {
protected test () {

View file

@ -17,7 +17,7 @@
<script lang="ts" setup>
import { onMounted, provide, ref, toRefs } from 'vue'
import { songStore } from '@/stores'
import { songStore } from '@/stores/songStore'
import { PlayablesKey } from '@/symbols'
import TrackListItem from '@/components/album/AlbumTrackListItem.vue'

View file

@ -1,11 +1,11 @@
import { ref } from 'vue'
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import { songStore } from '@/stores'
import { playbackService } from '@/services'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { songStore } from '@/stores/songStore'
import { playbackService } from '@/services/playbackService'
import { PlayablesKey } from '@/symbols'
import { ref } from 'vue'
import AlbumTrackListItem from './AlbumTrackListItem.vue'
new class extends UnitTestCase {

View file

@ -15,10 +15,12 @@
<script lang="ts" setup>
import type { Ref } from 'vue'
import { computed, defineAsyncComponent, toRefs } from 'vue'
import { songStore } from '@/stores'
import { authService, playbackService } from '@/services'
import { useThirdPartyServices } from '@/composables'
import { requireInjection, secondsToHis } from '@/utils'
import { songStore } from '@/stores/songStore'
import { authService } from '@/services/authService'
import { playbackService } from '@/services/playbackService'
import { useThirdPartyServices } from '@/composables/useThirdPartyServices'
import { requireInjection } from '@/utils/helpers'
import { secondsToHis } from '@/utils/formatters'
import { PlayablesKey } from '@/symbols'
const props = defineProps<{ album: Album, track: AlbumTrack }>()

View file

@ -1,11 +1,13 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import { downloadService, playbackService } from '@/services'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore, songStore } from '@/stores'
import { downloadService } from '@/services/downloadService'
import { playbackService } from '@/services/playbackService'
import { commonStore } from '@/stores/commonStore'
import { songStore } from '@/stores/songStore'
import { eventBus } from '@/utils/eventBus'
import ArtistCard from './ArtistCard.vue'
import { eventBus } from '@/utils'
let artist: Artist

View file

@ -24,10 +24,14 @@
<script lang="ts" setup>
import { computed, toRef, toRefs } from 'vue'
import { eventBus } from '@/utils'
import { artistStore, commonStore, songStore } from '@/stores'
import { downloadService, playbackService } from '@/services'
import { useDraggable, useRouter } from '@/composables'
import { eventBus } from '@/utils/eventBus'
import { artistStore } from '@/stores/artistStore'
import { commonStore } from '@/stores/commonStore'
import { songStore } from '@/stores/songStore'
import { downloadService } from '@/services/downloadService'
import { playbackService } from '@/services/playbackService'
import { useDraggable } from '@/composables/useDragAndDrop'
import { useRouter } from '@/composables/useRouter'
import BaseCard from '@/components/ui/album-artist/AlbumOrArtistCard.vue'

View file

@ -1,11 +1,13 @@
import Router from '@/router'
import { expect, it } from 'vitest'
import { screen } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { eventBus } from '@/utils'
import { downloadService, playbackService } from '@/services'
import { commonStore, songStore } from '@/stores'
import { screen } from '@testing-library/vue'
import { eventBus } from '@/utils/eventBus'
import { downloadService } from '@/services/downloadService'
import { playbackService } from '@/services/playbackService'
import { commonStore } from '@/stores/commonStore'
import { songStore } from '@/stores/songStore'
import ArtistContextMenu from './ArtistContextMenu.vue'
let artist: Artist

View file

@ -17,10 +17,14 @@
<script lang="ts" setup>
import { computed, ref, toRef } from 'vue'
import { artistStore, commonStore, songStore } from '@/stores'
import { downloadService, playbackService } from '@/services'
import { useContextMenu, useRouter } from '@/composables'
import { eventBus } from '@/utils'
import { artistStore } from '@/stores/artistStore'
import { commonStore } from '@/stores/commonStore'
import { songStore } from '@/stores/songStore'
import { downloadService } from '@/services/downloadService'
import { playbackService } from '@/services/playbackService'
import { useContextMenu } from '@/composables/useContextMenu'
import { useRouter } from '@/composables/useRouter'
import { eventBus } from '@/utils/eventBus'
const { go } = useRouter()
const { base, ContextMenu, open, trigger } = useContextMenu()

View file

@ -1,9 +1,9 @@
import { expect, it } from 'vitest'
import { screen } from '@testing-library/vue'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore } from '@/stores'
import { screen } from '@testing-library/vue'
import { mediaInfoService } from '@/services'
import { commonStore } from '@/stores/commonStore'
import { mediaInfoService } from '@/services/mediaInfoService'
import ArtistInfoComponent from './ArtistInfo.vue'
let artist: Artist

View file

@ -23,8 +23,8 @@
<script lang="ts" setup>
import { ref, toRefs, watch } from 'vue'
import { mediaInfoService } from '@/services'
import { useThirdPartyServices } from '@/composables'
import { mediaInfoService } from '@/services/mediaInfoService'
import { useThirdPartyServices } from '@/composables/useThirdPartyServices'
import ArtistThumbnail from '@/components/ui/album-artist/AlbumOrArtistThumbnail.vue'
import AlbumArtistInfo from '@/components/ui/album-artist/AlbumOrArtistInfo.vue'

View file

@ -1,7 +1,7 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { authService } from '@/services'
import { authService } from '@/services/authService'
import ForgotPasswordForm from './ForgotPasswordForm.vue'
new class extends UnitTestCase {

View file

@ -23,8 +23,9 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { authService } from '@/services'
import { useErrorHandler, useMessageToaster } from '@/composables'
import { authService } from '@/services/authService'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useMessageToaster } from '@/composables/useMessageToaster'
import Btn from '@/components/ui/form/Btn.vue'
import TextInput from '@/components/ui/form/TextInput.vue'

View file

@ -2,8 +2,8 @@ import { screen, waitFor } from '@testing-library/vue'
import type { Mock } from 'vitest'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { authService } from '@/services'
import { logger } from '@/utils'
import { authService } from '@/services/authService'
import { logger } from '@/utils/logger'
import LoginFrom from './LoginForm.vue'
new class extends UnitTestCase {

View file

@ -40,9 +40,9 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { authService } from '@/services'
import { logger } from '@/utils'
import { useMessageToaster } from '@/composables'
import { authService } from '@/services/authService'
import { logger } from '@/utils/logger'
import { useMessageToaster } from '@/composables/useMessageToaster'
import Btn from '@/components/ui/form/Btn.vue'
import PasswordField from '@/components/ui/form/PasswordField.vue'

View file

@ -1,7 +1,7 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { authService } from '@/services'
import { authService } from '@/services/authService'
import ResetPasswordForm from './ResetPasswordForm.vue'
new class extends UnitTestCase {

View file

@ -19,9 +19,12 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { authService } from '@/services'
import { base64Decode, logger } from '@/utils'
import { useErrorHandler, useMessageToaster, useRouter } from '@/composables'
import { authService } from '@/services/authService'
import { base64Decode } from '@/utils/crypto'
import { logger } from '@/utils/logger'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { useRouter } from '@/composables/useRouter'
import PasswordField from '@/components/ui/form/PasswordField.vue'
import Btn from '@/components/ui/form/Btn.vue'

View file

@ -11,7 +11,7 @@
<script lang="ts" setup>
import googleLogo from '@/../img/logos/google.svg'
import { openPopup } from '@/utils'
import { openPopup } from '@/utils/helpers'
const emit = defineEmits<{
(e: 'success', data: any): void

View file

@ -1,9 +1,9 @@
import { screen, waitFor } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import AcceptInvitation from './AcceptInvitation.vue'
import { invitationService } from '@/services'
import factory from '@/__tests__/factory'
import { invitationService } from '@/services/invitationService'
import AcceptInvitation from './AcceptInvitation.vue'
new class extends UnitTestCase {
protected test () {

View file

@ -43,8 +43,9 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { invitationService } from '@/services'
import { useErrorHandler, useRouter } from '@/composables'
import { invitationService } from '@/services/invitationService'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useRouter } from '@/composables/useRouter'
import Btn from '@/components/ui/form/Btn.vue'
import PasswordField from '@/components/ui/form/PasswordField.vue'

View file

@ -1,7 +1,7 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { plusService } from '@/services'
import { plusService } from '@/services/plusService'
import Form from './ActivateLicenseForm.vue'
new class extends UnitTestCase {

View file

@ -15,12 +15,13 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { plusService } from '@/services'
import { forceReloadWindow } from '@/utils'
import { useDialogBox, useErrorHandler } from '@/composables'
import { plusService } from '@/services/plusService'
import { useDialogBox } from '@/composables/useDialogBox'
import { useErrorHandler } from '@/composables/useErrorHandler'
import Btn from '@/components/ui/form/Btn.vue'
import TextInput from '@/components/ui/form/TextInput.vue'
import { forceReloadWindow } from '@/utils/helpers'
const { showSuccessDialog } = useDialogBox()
const licenseKey = ref('')

View file

@ -10,7 +10,7 @@
<script lang="ts" setup>
import { faPlus } from '@fortawesome/free-solid-svg-icons'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
import Btn from '@/components/ui/form/Btn.vue'

View file

@ -1,7 +1,7 @@
import { screen } from '@testing-library/vue'
import { commonStore } from '@/stores'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore } from '@/stores/commonStore'
import Modal from './KoelPlusModal.vue'
new class extends UnitTestCase {

View file

@ -37,7 +37,7 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { useKoelPlus } from '@/composables'
import { useKoelPlus } from '@/composables/useKoelPlus'
import Btn from '@/components/ui/form/Btn.vue'
import ActivateLicenseForm from '@/components/koel-plus/ActivateLicenseForm.vue'

View file

@ -1,8 +1,8 @@
import { it } from 'vitest'
import { screen, waitFor } from '@testing-library/vue'
import factory from '@/__tests__/factory'
import { eventBus } from '@/utils'
import type { Events } from '@/config'
import { eventBus } from '@/utils/eventBus'
import type { Events } from '@/config/events'
import UnitTestCase from '@/__tests__/UnitTestCase'
import ModalWrapper from './ModalWrapper.vue'

View file

@ -10,7 +10,8 @@
<script lang="ts" setup>
import { defineAsyncComponent, ref, watch } from 'vue'
import { arrayify, eventBus, provideReadonly } from '@/utils'
import { arrayify, provideReadonly } from '@/utils/helpers'
import { eventBus } from '@/utils/eventBus'
import { ModalContextKey } from '@/symbols'
const modalNameToComponentMap = {

View file

@ -1,7 +1,7 @@
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { screen } from '@testing-library/vue'
import { eventBus } from '@/utils'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils/eventBus'
import FooterExtraControls from './FooterExtraControls.vue'
new class extends UnitTestCase {

View file

@ -35,8 +35,9 @@
import { faBolt, faCompress, faExpand } from '@fortawesome/free-solid-svg-icons'
import { AudioLinesIcon } from 'lucide-vue-next'
import { computed, onMounted, ref } from 'vue'
import { eventBus, isFullscreenSupported, isAudioContextSupported as useEqualizer } from '@/utils'
import { useRouter } from '@/composables'
import { eventBus } from '@/utils/eventBus'
import { isFullscreenSupported, isAudioContextSupported as useEqualizer } from '@/utils/supports'
import { useRouter } from '@/composables/useRouter'
import VolumeSlider from '@/components/ui/VolumeSlider.vue'
import FooterBtn from '@/components/layout/app-footer/FooterButton.vue'

View file

@ -1,10 +1,10 @@
import { ref } from 'vue'
import { expect, it } from 'vitest'
import { screen } from '@testing-library/vue'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { CurrentPlayableKey } from '@/symbols'
import { playbackService } from '@/services'
import { screen } from '@testing-library/vue'
import { playbackService } from '@/services/playbackService'
import Component from './FooterPlaybackControls.vue'
new class extends UnitTestCase {

View file

@ -22,8 +22,8 @@
<script lang="ts" setup>
import { faStepBackward, faStepForward } from '@fortawesome/free-solid-svg-icons'
import { ref } from 'vue'
import { playbackService } from '@/services'
import { requireInjection } from '@/utils'
import { playbackService } from '@/services/playbackService'
import { requireInjection } from '@/utils/helpers'
import { CurrentPlayableKey } from '@/symbols'
import RepeatModeSwitch from '@/components/ui/RepeatModeSwitch.vue'

View file

@ -16,9 +16,11 @@
<script setup lang="ts">
import { faListOl } from '@fortawesome/free-solid-svg-icons'
import { ref } from 'vue'
import { useDroppable, useMessageToaster, useRouter } from '@/composables'
import { queueStore } from '@/stores'
import { pluralize } from '@/utils'
import { useDroppable } from '@/composables/useDragAndDrop'
import { useRouter } from '@/composables/useRouter'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { queueStore } from '@/stores/queueStore'
import { pluralize } from '@/utils/formatters'
import FooterButton from '@/components/layout/app-footer/FooterButton.vue'

View file

@ -20,9 +20,11 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { defaultCover, getPlayableProp, isSong, requireInjection } from '@/utils'
import defaultCover from '@/../img/covers/default.svg'
import { getPlayableProp, requireInjection } from '@/utils/helpers'
import { isSong } from '@/utils/typeGuards'
import { CurrentPlayableKey } from '@/symbols'
import { useDraggable } from '@/composables'
import { useDraggable } from '@/composables/useDragAndDrop'
const { startDragging } = useDraggable('playables')

View file

@ -1,8 +1,9 @@
import { waitFor } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { playbackService, volumeManager } from '@/services'
import { preferenceStore } from '@/stores'
import { playbackService } from '@/services/playbackService'
import { volumeManager } from '@/services/volumeManager'
import { preferenceStore } from '@/stores/preferenceStore'
import Component from './index.vue'
new class extends UnitTestCase {

View file

@ -20,11 +20,16 @@
<script lang="ts" setup>
import { throttle } from 'lodash'
import { computed, nextTick, ref, watch } from 'vue'
import { eventBus, isAudioContextSupported, isSong, requireInjection } from '@/utils'
import { CurrentPlayableKey } from '@/symbols'
import { artistStore, preferenceStore } from '@/stores'
import { audioService, playbackService } from '@/services'
import { useFullscreen } from '@vueuse/core'
import { eventBus } from '@/utils/eventBus'
import { isSong } from '@/utils/typeGuards'
import { isAudioContextSupported } from '@/utils/supports'
import { requireInjection } from '@/utils/helpers'
import { CurrentPlayableKey } from '@/symbols'
import { artistStore } from '@/stores/artistStore'
import { preferenceStore } from '@/stores/preferenceStore'
import { audioService } from '@/services/audioService'
import { playbackService } from '@/services/playbackService'
import AudioPlayer from '@/components/layout/app-footer/AudioPlayer.vue'
import SongInfo from '@/components/layout/app-footer/FooterSongInfo.vue'

View file

@ -1,9 +1,10 @@
import { ref } from 'vue'
import { screen, waitFor } from '@testing-library/vue'
import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import { albumStore, preferenceStore } from '@/stores'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { albumStore } from '@/stores/albumStore'
import { preferenceStore } from '@/stores/preferenceStore'
import { CurrentPlayableKey } from '@/symbols'
import AlbumArtOverlay from '@/components/ui/AlbumArtOverlay.vue'
import MainContent from './MainContent.vue'

View file

@ -40,9 +40,11 @@
<script lang="ts" setup>
import { defineAsyncComponent, onMounted, ref, toRef } from 'vue'
import { isSong, requireInjection } from '@/utils'
import { preferenceStore } from '@/stores'
import { useRouter, useThirdPartyServices } from '@/composables'
import { isSong } from '@/utils/typeGuards'
import { requireInjection } from '@/utils/helpers'
import { preferenceStore } from '@/stores/preferenceStore'
import { useRouter } from '@/composables/useRouter'
import { useThirdPartyServices } from '@/composables/useThirdPartyServices'
import { CurrentPlayableKey } from '@/symbols'
import HomeScreen from '@/components/screens/HomeScreen.vue'

View file

@ -1,7 +1,7 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore } from '@/stores'
import { commonStore } from '@/stores/commonStore'
import AboutKoelButton from './AboutKoelButton.vue'
new class extends UnitTestCase {

View file

@ -15,8 +15,8 @@
<script lang="ts" setup>
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'
import { eventBus } from '@/utils'
import { useNewVersionNotification } from '@/composables'
import { eventBus } from '@/utils/eventBus'
import { useNewVersionNotification } from '@/composables/useNewVersionNotification'
import SideSheetButton from '@/components/layout/main-wrapper/side-sheet/SideSheetButton.vue'

View file

@ -1,7 +1,7 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
import LogoutButton from './LogoutButton.vue'
new class extends UnitTestCase {

View file

@ -6,7 +6,7 @@
<script lang="ts" setup>
import { faArrowRightFromBracket } from '@fortawesome/free-solid-svg-icons'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
import SideSheetButton from '@/components/layout/main-wrapper/side-sheet/SideSheetButton.vue'

View file

@ -4,11 +4,14 @@ import type { Mock } from 'vitest'
import { expect, it } from 'vitest'
import type { RenderResult } from '@testing-library/vue'
import { screen, waitFor } from '@testing-library/vue'
import factory from '@/__tests__/factory'
import { albumStore, artistStore, commonStore, preferenceStore } from '@/stores'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { albumStore } from '@/stores/albumStore'
import { artistStore } from '@/stores/artistStore'
import { commonStore } from '@/stores/commonStore'
import { preferenceStore } from '@/stores/preferenceStore'
import { CurrentPlayableKey } from '@/symbols'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
import Component from './SideSheet.vue'
new class extends UnitTestCase {

View file

@ -75,9 +75,14 @@ import isMobile from 'ismobilejs'
import { faBars } from '@fortawesome/free-solid-svg-icons'
import type { Ref } from 'vue'
import { computed, defineAsyncComponent, onMounted, ref, watch } from 'vue'
import { albumStore, artistStore, preferenceStore } from '@/stores'
import { useErrorHandler, useThirdPartyServices } from '@/composables'
import { eventBus, isSong, requireInjection } from '@/utils'
import { albumStore } from '@/stores/albumStore'
import { artistStore } from '@/stores/artistStore'
import { preferenceStore } from '@/stores/preferenceStore'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useThirdPartyServices } from '@/composables/useThirdPartyServices'
import { eventBus } from '@/utils/eventBus'
import { isSong } from '@/utils/typeGuards'
import { requireInjection } from '@/utils/helpers'
import { CurrentPlayableKey } from '@/symbols'
import ProfileAvatar from '@/components/ui/ProfileAvatar.vue'

View file

@ -1,7 +1,7 @@
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore } from '@/stores'
import { screen } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore } from '@/stores/commonStore'
import Component from './SideSheetTabHeader.vue'
new class extends UnitTestCase {

View file

@ -43,7 +43,7 @@ import { faCompactDisc, faFeather } from '@fortawesome/free-solid-svg-icons'
import { MicVocalIcon } from 'lucide-vue-next'
import { faYoutube } from '@fortawesome/free-brands-svg-icons'
import { computed } from 'vue'
import { useThirdPartyServices } from '@/composables'
import { useThirdPartyServices } from '@/composables/useThirdPartyServices'
import SideSheetButton from '@/components/layout/main-wrapper/side-sheet/SideSheetButton.vue'

View file

@ -1,7 +1,7 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
import Component from './HomeButton.vue'
new class extends UnitTestCase {

View file

@ -10,7 +10,7 @@
<script setup lang="ts">
import { faHome } from '@fortawesome/free-solid-svg-icons'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
const onClick = () => eventBus.emit('TOGGLE_SIDEBAR')
</script>

View file

@ -43,9 +43,10 @@
<script lang="ts" setup>
import { faFolder, faFolderOpen } from '@fortawesome/free-solid-svg-icons'
import { computed, ref, toRefs } from 'vue'
import { playlistFolderStore, playlistStore } from '@/stores'
import { eventBus } from '@/utils'
import { useDraggable, useDroppable } from '@/composables'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { playlistStore } from '@/stores/playlistStore'
import { eventBus } from '@/utils/eventBus'
import { useDraggable, useDroppable } from '@/composables/useDragAndDrop'
import PlaylistSidebarItem from './PlaylistSidebarItem.vue'
import SidebarItem from './SidebarItem.vue'

View file

@ -1,8 +1,8 @@
import { expect, it } from 'vitest'
import { fireEvent, screen } from '@testing-library/vue'
import { eventBus } from '@/utils'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { eventBus } from '@/utils/eventBus'
import PlaylistSidebarItem from './PlaylistSidebarItem.vue'
new class extends UnitTestCase {

View file

@ -25,9 +25,11 @@
import { faClockRotateLeft, faHeart, faUsers, faWandMagicSparkles } from '@fortawesome/free-solid-svg-icons'
import { ListMusicIcon } from 'lucide-vue-next'
import { computed, ref, toRefs } from 'vue'
import { eventBus } from '@/utils'
import { favoriteStore } from '@/stores'
import { useDraggable, useDroppable, usePlaylistManagement, useRouter } from '@/composables'
import { eventBus } from '@/utils/eventBus'
import { useRouter } from '@/composables/useRouter'
import { favoriteStore } from '@/stores/favoriteStore'
import { useDraggable, useDroppable } from '@/composables/useDragAndDrop'
import { usePlaylistManagement } from '@/composables/usePlaylistManagement'
import SidebarItem from '@/components/layout/main-wrapper/sidebar/SidebarItem.vue'

View file

@ -1,8 +1,8 @@
import { it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { screen } from '@testing-library/vue'
import { commonStore } from '@/stores'
import { eventBus } from '@/utils'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore } from '@/stores/commonStore'
import { eventBus } from '@/utils/eventBus'
import Sidebar from './Sidebar.vue'
const standardItems = [

View file

@ -39,8 +39,12 @@
<script lang="ts" setup>
import { faTimes } from '@fortawesome/free-solid-svg-icons'
import { computed, ref, watch } from 'vue'
import { eventBus } from '@/utils'
import { useAuthorization, useKoelPlus, useLocalStorage, useRouter, useUpload } from '@/composables'
import { eventBus } from '@/utils/eventBus'
import { useAuthorization } from '@/composables/useAuthorization'
import { useKoelPlus } from '@/composables/useKoelPlus'
import { useLocalStorage } from '@/composables/useLocalStorage'
import { useUpload } from '@/composables/useUpload'
import { useRouter } from '@/composables/useRouter'
import BtnUpgradeToPlus from '@/components/koel-plus/BtnUpgradeToPlus.vue'
import HomeButton from '@/components/layout/main-wrapper/sidebar/HomeButton.vue'

View file

@ -1,9 +1,9 @@
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { screen } from '@testing-library/vue'
import { faHome } from '@fortawesome/free-solid-svg-icons'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils/eventBus'
import Component from './SidebarItem.vue'
import { eventBus } from '@/utils'
new class extends UnitTestCase {
protected test () {

View file

@ -24,8 +24,8 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter } from '@/composables'
import { eventBus } from '@/utils'
import { useRouter } from '@/composables/useRouter'
import { eventBus } from '@/utils/eventBus'
const props = withDefaults(defineProps<{ href?: string | undefined, screen?: ScreenName | undefined }>(), {
href: undefined,

View file

@ -1,5 +1,5 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import { screen } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import SidebarManageSection from './SidebarManageSection.vue'

View file

@ -29,7 +29,8 @@
<script lang="ts" setup>
import { faTools, faUpload, faUsers } from '@fortawesome/free-solid-svg-icons'
import { useAuthorization, useUpload } from '@/composables'
import { useAuthorization } from '@/composables/useAuthorization'
import { useUpload } from '@/composables/useUpload'
import SidebarSection from '@/components/layout/main-wrapper/sidebar/SidebarSection.vue'
import SidebarSectionHeader from '@/components/layout/main-wrapper/sidebar/SidebarSectionHeader.vue'

View file

@ -1,8 +1,9 @@
import { screen } from '@testing-library/vue'
import { it } from 'vitest'
import { playlistFolderStore, playlistStore } from '@/stores'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { playlistStore } from '@/stores/playlistStore'
import SidebarPlaylistsSection from './SidebarPlaylistsSection.vue'
import PlaylistSidebarItem from './PlaylistSidebarItem.vue'
import PlaylistFolderSidebarItem from './PlaylistFolderSidebarItem.vue'

View file

@ -16,7 +16,9 @@
<script lang="ts" setup>
import { computed, toRef } from 'vue'
import { favoriteStore, playlistFolderStore, playlistStore } from '@/stores'
import { favoriteStore } from '@/stores/favoriteStore'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { playlistStore } from '@/stores/playlistStore'
import PlaylistSidebarItem from './PlaylistSidebarItem.vue'
import PlaylistFolderSidebarItem from './PlaylistFolderSidebarItem.vue'

View file

@ -1,7 +1,7 @@
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
import SidebarYourLibrarySection from './SidebarYourLibrarySection.vue'
new class extends UnitTestCase {

View file

@ -47,7 +47,7 @@ import { faCompactDisc, faMusic, faPodcast } from '@fortawesome/free-solid-svg-i
import { GuitarIcon, MicVocalIcon } from 'lucide-vue-next'
import { unescape } from 'lodash'
import { ref } from 'vue'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
import SidebarSection from '@/components/layout/main-wrapper/sidebar/SidebarSection.vue'
import SidebarSectionHeader from '@/components/layout/main-wrapper/sidebar/SidebarSectionHeader.vue'

View file

@ -1,8 +1,8 @@
import { expect, it } from 'vitest'
import { commonStore } from '@/stores'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { http } from '@/services'
import { screen, waitFor } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { commonStore } from '@/stores/commonStore'
import { http } from '@/services/http'
import AboutKoelModel from './AboutKoelModal.vue'
new class extends UnitTestCase {

View file

@ -63,8 +63,10 @@
</template>
<script lang="ts" setup>
import { useAuthorization, useKoelPlus, useNewVersionNotification } from '@/composables'
import { eventBus } from '@/utils'
import { useAuthorization } from '@/composables/useAuthorization'
import { useKoelPlus } from '@/composables/useKoelPlus'
import { useNewVersionNotification } from '@/composables/useNewVersionNotification'
import { eventBus } from '@/utils/eventBus'
import SponsorList from '@/components/meta/SponsorList.vue'
import Btn from '@/components/ui/form/Btn.vue'

View file

@ -1,6 +1,6 @@
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { http } from '@/services'
import { http } from '@/services/http'
import CreditsBlock from './CreditsBlock.vue'
new class extends UnitTestCase {

View file

@ -12,7 +12,7 @@
<script lang="ts" setup>
import { orderBy } from 'lodash'
import { onMounted, ref } from 'vue'
import { http } from '@/services'
import { http } from '@/services/http'
interface DemoCredits {
name: string

View file

@ -1,9 +1,9 @@
import { expect, it, vi } from 'vitest'
import { screen } from '@testing-library/vue'
import { preferenceStore } from '@/stores'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { preferenceStore } from '@/stores/preferenceStore'
import { http } from '@/services/http'
import SupportKoel from './SupportKoel.vue'
import { http } from '@/services'
new class extends UnitTestCase {
protected beforeEach () {

View file

@ -21,8 +21,8 @@
<script lang="ts" setup>
import isMobile from 'ismobilejs'
import { ref, watch } from 'vue'
import { preferenceStore } from '@/stores'
import { useKoelPlus } from '@/composables'
import { preferenceStore } from '@/stores/preferenceStore'
import { useKoelPlus } from '@/composables/useKoelPlus'
const delayUntilShow = 30 * 60 * 1000 // 30 minutes

View file

@ -1,10 +1,9 @@
import { expect, it } from 'vitest'
import { screen, waitFor } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils'
import type { Events } from '@/config'
import CreateNewPlaylistContextMenu from './CreatePlaylistContextMenu.vue'
import { eventBus } from '@/utils/eventBus'
import type { Events } from '@/config/events'
import Component from './CreatePlaylistContextMenu.vue'
new class extends UnitTestCase {
protected test () {
@ -21,7 +20,7 @@ new class extends UnitTestCase {
}
private async renderComponent () {
this.render(CreateNewPlaylistContextMenu)
this.render(Component)
eventBus.emit('CREATE_NEW_PLAYLIST_CONTEXT_MENU_REQUESTED', { top: 420, left: 42 })
await this.tick(2)
}

View file

@ -9,9 +9,9 @@
</template>
<script lang="ts" setup>
import { useContextMenu } from '@/composables'
import { eventBus } from '@/utils'
import type { Events } from '@/config'
import { useContextMenu } from '@/composables/useContextMenu'
import { eventBus } from '@/utils/eventBus'
import type { Events } from '@/config/events'
const { base, ContextMenu, open, trigger } = useContextMenu()

View file

@ -11,7 +11,7 @@
<script lang="ts" setup>
import { faCirclePlus } from '@fortawesome/free-solid-svg-icons'
import { eventBus } from '@/utils'
import { eventBus } from '@/utils/eventBus'
const requestContextMenu = (e: MouseEvent) => {
const { bottom, right } = (e.currentTarget as HTMLButtonElement).getBoundingClientRect()

View file

@ -1,9 +1,9 @@
import { expect, it } from 'vitest'
import { screen } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { playlistFolderStore } from '@/stores'
import factory from '@/__tests__/factory'
import CreatePlaylistFolderForm from './CreatePlaylistFolderForm.vue'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import Component from './CreatePlaylistFolderForm.vue'
new class extends UnitTestCase {
protected test () {
@ -11,7 +11,7 @@ new class extends UnitTestCase {
const storeMock = this.mock(playlistFolderStore, 'store')
.mockResolvedValue(factory('playlist-folder'))
this.render(CreatePlaylistFolderForm)
this.render(Component)
await this.type(screen.getByPlaceholderText('Folder name'), 'My folder')
await this.user.click(screen.getByRole('button', { name: 'Save' }))

View file

@ -25,14 +25,18 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { playlistFolderStore } from '@/stores'
import { useDialogBox, useErrorHandler, useMessageToaster, useOverlay } from '@/composables'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { useDialogBox } from '@/composables/useDialogBox'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { useOverlay } from '@/composables/useOverlay'
import Btn from '@/components/ui/form/Btn.vue'
import TextInput from '@/components/ui/form/TextInput.vue'
import FormRow from '@/components/ui/form/FormRow.vue'
const emit = defineEmits<{ (e: 'close'): void }>()
const { showOverlay, hideOverlay } = useOverlay()
const { toastSuccess } = useMessageToaster()
const { showConfirmDialog } = useDialogBox()

View file

@ -1,11 +1,11 @@
import { expect, it } from 'vitest'
import { ref } from 'vue'
import { screen } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { playlistStore } from '@/stores'
import factory from '@/__tests__/factory'
import { ref } from 'vue'
import { playlistStore } from '@/stores/playlistStore'
import { ModalContextKey } from '@/symbols'
import CreatePlaylistForm from './CreatePlaylistForm.vue'
import Component from './CreatePlaylistForm.vue'
new class extends UnitTestCase {
protected test () {
@ -13,7 +13,7 @@ new class extends UnitTestCase {
const folder = factory('playlist-folder')
const storeMock = this.mock(playlistStore, 'store').mockResolvedValue(factory('playlist'))
this.render(CreatePlaylistForm, {
this.render(Component, {
global: {
provide: {
[<symbol>ModalContextKey]: [ref({ folder })],
@ -36,7 +36,7 @@ new class extends UnitTestCase {
const folder = factory('playlist-folder')
const storeMock = this.mock(playlistStore, 'store').mockResolvedValue(factory('playlist'))
this.render(CreatePlaylistForm, {
this.render(Component, {
global: {
provide: {
[<symbol>ModalContextKey]: [ref({ folder, playables })],

View file

@ -34,9 +34,16 @@
<script lang="ts" setup>
import { computed, ref, toRef } from 'vue'
import { playlistFolderStore, playlistStore } from '@/stores'
import { getPlayableCollectionContentType, pluralize } from '@/utils'
import { useDialogBox, useErrorHandler, useMessageToaster, useModal, useOverlay, useRouter } from '@/composables'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { playlistStore } from '@/stores/playlistStore'
import { getPlayableCollectionContentType } from '@/utils/typeGuards'
import { pluralize } from '@/utils/formatters'
import { useRouter } from '@/composables/useRouter'
import { useDialogBox } from '@/composables/useDialogBox'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { useModal } from '@/composables/useModal'
import { useOverlay } from '@/composables/useOverlay'
import Btn from '@/components/ui/form/Btn.vue'
import TextInput from '@/components/ui/form/TextInput.vue'
@ -44,6 +51,7 @@ import FormRow from '@/components/ui/form/FormRow.vue'
import SelectBox from '@/components/ui/form/SelectBox.vue'
const emit = defineEmits<{ (e: 'close'): void }>()
const { showOverlay, hideOverlay } = useOverlay()
const { toastSuccess } = useMessageToaster()
const { showConfirmDialog } = useDialogBox()

View file

@ -1,18 +1,18 @@
import { ref } from 'vue'
import { screen, waitFor } from '@testing-library/vue'
import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { playlistFolderStore } from '@/stores'
import factory from '@/__tests__/factory'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { ModalContextKey } from '@/symbols'
import EditPlaylistFolderForm from './EditPlaylistFolderForm.vue'
import Component from './EditPlaylistFolderForm.vue'
new class extends UnitTestCase {
protected test () {
it('submits', async () => {
const folder = factory('playlist-folder', { name: 'My folder' })
const renameMock = this.mock(playlistFolderStore, 'rename')
this.render(EditPlaylistFolderForm, {
this.render(Component, {
global: {
provide: {
[<symbol>ModalContextKey]: [ref({ folder })],

View file

@ -19,14 +19,19 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { playlistFolderStore } from '@/stores'
import { useDialogBox, useErrorHandler, useMessageToaster, useModal, useOverlay } from '@/composables'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { useDialogBox } from '@/composables/useDialogBox'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { useOverlay } from '@/composables/useOverlay'
import { useModal } from '@/composables/useModal'
import Btn from '@/components/ui/form/Btn.vue'
import TextInput from '@/components/ui/form/TextInput.vue'
import FormRow from '@/components/ui/form/FormRow.vue'
const emit = defineEmits<{ (e: 'close'): void }>()
const { showOverlay, hideOverlay } = useOverlay()
const { toastSuccess } = useMessageToaster()
const { showConfirmDialog } = useDialogBox()

View file

@ -1,11 +1,12 @@
import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { playlistFolderStore, playlistStore } from '@/stores'
import { ref } from 'vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { playlistStore } from '@/stores/playlistStore'
import { screen, waitFor } from '@testing-library/vue'
import { ModalContextKey } from '@/symbols'
import EditPlaylistForm from './EditPlaylistForm.vue'
import Component from './EditPlaylistForm.vue'
new class extends UnitTestCase {
protected test () {
@ -21,7 +22,7 @@ new class extends UnitTestCase {
const updateMock = this.mock(playlistStore, 'update')
this.render(EditPlaylistForm, {
this.render(Component, {
global: {
provide: {
[<symbol>ModalContextKey]: [ref({ playlist })],

View file

@ -36,8 +36,13 @@
<script lang="ts" setup>
import { ref, toRef } from 'vue'
import { playlistFolderStore, playlistStore } from '@/stores'
import { useDialogBox, useErrorHandler, useMessageToaster, useModal, useOverlay } from '@/composables'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { playlistStore } from '@/stores/playlistStore'
import { useDialogBox } from '@/composables/useDialogBox'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { useOverlay } from '@/composables/useOverlay'
import { useModal } from '@/composables/useModal'
import Btn from '@/components/ui/form/Btn.vue'
import TextInput from '@/components/ui/form/TextInput.vue'
@ -45,6 +50,7 @@ import FormRow from '@/components/ui/form/FormRow.vue'
import SelectBox from '@/components/ui/form/SelectBox.vue'
const emit = defineEmits<{ (e: 'close'): void }>()
const { showOverlay, hideOverlay } = useOverlay()
const { toastSuccess } = useMessageToaster()
const { showConfirmDialog } = useDialogBox()

View file

@ -2,7 +2,7 @@ import { expect, it } from 'vitest'
import { screen, waitFor } from '@testing-library/vue'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { playlistCollaborationService } from '@/services'
import { playlistCollaborationService } from '@/services/playlistCollaborationService'
import Component from './InvitePlaylistCollaborators.vue'
new class extends UnitTestCase {

View file

@ -12,10 +12,10 @@
<script lang="ts" setup>
import { faCheckCircle, faCircleNotch } from '@fortawesome/free-solid-svg-icons'
import { computed, ref, toRefs } from 'vue'
import { copyText } from '@/utils'
import { playlistCollaborationService } from '@/services'
import { playlistCollaborationService } from '@/services/playlistCollaborationService'
import Btn from '@/components/ui/form/Btn.vue'
import { copyText } from '@/utils/helpers'
const props = defineProps<{ playlist: Playlist }>()
const { playlist } = toRefs(props)

View file

@ -1,7 +1,7 @@
import { ref } from 'vue'
import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { ref } from 'vue'
import { ModalContextKey } from '@/symbols'
import Modal from './PlaylistCollaborationModal.vue'

View file

@ -35,13 +35,15 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { useAuthorization, useModal } from '@/composables'
import { useAuthorization } from '@/composables/useAuthorization'
import { useModal } from '@/composables/useModal'
import Btn from '@/components/ui/form/Btn.vue'
import InviteCollaborators from '@/components/playlist/InvitePlaylistCollaborators.vue'
import CollaboratorList from '@/components/playlist/PlaylistCollaboratorList.vue'
const emit = defineEmits<{ (e: 'close'): void }>()
const playlist = useModal().getFromContext<Playlist>('playlist')
const { currentUser } = useAuthorization()

View file

@ -1,7 +1,7 @@
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { playlistCollaborationService } from '@/services'
import { playlistCollaborationService } from '@/services/playlistCollaborationService'
import Component from './PlaylistCollaboratorList.vue'
new class extends UnitTestCase {

View file

@ -17,9 +17,11 @@
import { sortBy } from 'lodash'
import type { Ref } from 'vue'
import { computed, onMounted, ref, toRefs } from 'vue'
import { useAuthorization, useDialogBox, useErrorHandler } from '@/composables'
import { playlistCollaborationService } from '@/services'
import { eventBus } from '@/utils'
import { playlistCollaborationService } from '@/services/playlistCollaborationService'
import { eventBus } from '@/utils/eventBus'
import { useAuthorization } from '@/composables/useAuthorization'
import { useDialogBox } from '@/composables/useDialogBox'
import { useErrorHandler } from '@/composables/useErrorHandler'
import ListSkeleton from '@/components/ui/skeletons/PlaylistCollaboratorListSkeleton.vue'
import ListItem from '@/components/playlist/PlaylistCollaboratorListItem.vue'

View file

@ -28,10 +28,10 @@
<script lang="ts" setup>
import { faCircleCheck } from '@fortawesome/free-solid-svg-icons'
import { toRefs } from 'vue'
import { useAuthorization } from '@/composables/useAuthorization'
import Btn from '@/components/ui/form/Btn.vue'
import UserAvatar from '@/components/user/UserAvatar.vue'
import { useAuthorization } from '@/composables'
const props = defineProps<{
collaborator: PlaylistCollaborator

View file

@ -1,12 +1,14 @@
import Router from '@/router'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils'
import factory from '@/__tests__/factory'
import { screen, waitFor } from '@testing-library/vue'
import { queueStore, songStore, userStore } from '@/stores'
import { playbackService } from '@/services'
import { MessageToasterStub } from '@/__tests__/stubs'
import { screen, waitFor } from '@testing-library/vue'
import { queueStore } from '@/stores/queueStore'
import { songStore } from '@/stores/songStore'
import { userStore } from '@/stores/userStore'
import { playbackService } from '@/services/playbackService'
import { eventBus } from '@/utils/eventBus'
import Router from '@/router'
import PlaylistContextMenu from './PlaylistContextMenu.vue'
new class extends UnitTestCase {

View file

@ -17,10 +17,15 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { eventBus } from '@/utils'
import { useContextMenu, useKoelPlus, useMessageToaster, usePolicies, useRouter } from '@/composables'
import { playbackService } from '@/services'
import { queueStore, songStore } from '@/stores'
import { eventBus } from '@/utils/eventBus'
import { useRouter } from '@/composables/useRouter'
import { useContextMenu } from '@/composables/useContextMenu'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { usePolicies } from '@/composables/usePolicies'
import { useKoelPlus } from '@/composables/useKoelPlus'
import { playbackService } from '@/services/playbackService'
import { queueStore } from '@/stores/queueStore'
import { songStore } from '@/stores/songStore'
const { base, ContextMenu, open, trigger } = useContextMenu()
const { go } = useRouter()

View file

@ -1,12 +1,13 @@
import Router from '@/router'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils'
import factory from '@/__tests__/factory'
import { screen, waitFor } from '@testing-library/vue'
import { playlistStore, songStore } from '@/stores'
import { playbackService } from '@/services'
import UnitTestCase from '@/__tests__/UnitTestCase'
import factory from '@/__tests__/factory'
import { MessageToasterStub } from '@/__tests__/stubs'
import { playlistStore } from '@/stores/playlistStore'
import { songStore } from '@/stores/songStore'
import { playbackService } from '@/services/playbackService'
import { eventBus } from '@/utils/eventBus'
import Router from '@/router'
import PlaylistFolderContextMenu from './PlaylistFolderContextMenu.vue'
new class extends UnitTestCase {

View file

@ -17,10 +17,13 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { eventBus } from '@/utils'
import { playlistStore, songStore } from '@/stores'
import { playbackService } from '@/services'
import { useContextMenu, useMessageToaster, useRouter } from '@/composables'
import { eventBus } from '@/utils/eventBus'
import { playlistStore } from '@/stores/playlistStore'
import { playbackService } from '@/services/playbackService'
import { useRouter } from '@/composables/useRouter'
import { useContextMenu } from '@/composables/useContextMenu'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { songStore } from '@/stores/songStore'
const { base, ContextMenu, open, trigger } = useContextMenu()
const { go } = useRouter()

View file

@ -53,17 +53,16 @@
<script lang="ts" setup>
import { faPlus } from '@fortawesome/free-solid-svg-icons'
import { ref, toRef } from 'vue'
import { playlistFolderStore, playlistStore } from '@/stores'
import {
useDialogBox,
useErrorHandler,
useKoelPlus,
useMessageToaster,
useModal,
useOverlay,
useRouter,
useSmartPlaylistForm,
} from '@/composables'
import { playlistFolderStore } from '@/stores/playlistFolderStore'
import { playlistStore } from '@/stores/playlistStore'
import { useDialogBox } from '@/composables/useDialogBox'
import { useErrorHandler } from '@/composables/useErrorHandler'
import { useMessageToaster } from '@/composables/useMessageToaster'
import { useModal } from '@/composables/useModal'
import { useOverlay } from '@/composables/useOverlay'
import { useSmartPlaylistForm } from '@/composables/useSmartPlaylistForm'
import { useRouter } from '@/composables/useRouter'
import { useKoelPlus } from '@/composables/useKoelPlus'
import CheckBox from '@/components/ui/form/CheckBox.vue'
import TextInput from '@/components/ui/form/TextInput.vue'

Some files were not shown because too many files have changed in this diff Show more