Skip to content

Commit

Permalink
Organise imports
Browse files Browse the repository at this point in the history
  • Loading branch information
man90es committed Nov 7, 2023
1 parent 87d3c5f commit a561363
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 54 deletions.
6 changes: 2 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
</template>

<script setup>
import { useJsonDataStore } from "@/stores/jsonData"
import AppFooter from "@/components/AppFooter"
import BackgroundLayer from "@/components/BackgroundLayer"
import SiteHeader from "@/components/SiteHeader"
import { AppFooter, BackgroundLayer, SiteHeader } from "@/components"
import { useJsonDataStore } from "@/stores"
const jsonData = useJsonDataStore()
jsonData.sync()
Expand Down
4 changes: 2 additions & 2 deletions src/components/AppFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</template>

<script setup>
import { useJsonDataStore } from "@/stores/jsonData"
import { useStrings } from "@/hooks/strings"
import { useJsonDataStore } from "@/stores"
import { useStrings } from "@/hooks"
const strings = useStrings()
const json = useJsonDataStore()
Expand Down
5 changes: 2 additions & 3 deletions src/components/CharacterCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@

<script setup>
import { computed } from "vue"
import { useJsonDataStore } from "@/stores/jsonData"
import ElementBadge from "@/components/ElementBadge"
import ConstellationBadge from "@/components/ConstellationBadge"
import { ConstellationBadge, ElementBadge } from "@/components"
import { useJsonDataStore } from "@/stores"
const jsonData = useJsonDataStore()
const props = defineProps({
Expand Down
8 changes: 3 additions & 5 deletions src/components/CharacterSelectionPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
</template>

<script setup>
import { CharacterCard, PopupShell, SelectButton } from "@/components"
import { computed, ref, onBeforeUnmount } from "vue"
import { sortingOptions, useCharacterIdList } from "@/hooks/characterIdList"
import { useUserDataStore } from "@/stores/userData"
import CharacterCard from "@/components/CharacterCard"
import PopupShell from "@/components/PopupShell"
import SelectButton from "@/components/SelectButton"
import { sortingOptions, useCharacterIdList } from "@/hooks"
import { useUserDataStore } from "@/stores"
const emit = defineEmits(["close", "select"])
const props = defineProps({ meta: Object, exclude: Array })
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConstellationBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script setup>
import { computed } from "vue"
import { useUserDataStore } from "@/stores/userData"
import { useUserDataStore } from "@/stores"
const userData = useUserDataStore()
Expand Down
5 changes: 2 additions & 3 deletions src/components/ConstellationPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@

<script setup>
import { computed, onBeforeUnmount } from "vue"
import { useJsonDataStore } from "@/stores/jsonData"
import { useUserDataStore } from "@/stores/userData"
import PopupShell from "@/components/PopupShell"
import { PopupShell } from "@/components"
import { useJsonDataStore, useUserDataStore } from "@/stores"
const emit = defineEmits(["abort"])
const jsonData = useJsonDataStore()
Expand Down
2 changes: 1 addition & 1 deletion src/components/ElementBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<script setup>
import { computed } from "vue"
import { useJsonDataStore } from "@/stores/jsonData"
import { useJsonDataStore } from "@/stores"
const props = defineProps({
elementId: { type: String, required: true },
Expand Down
4 changes: 2 additions & 2 deletions src/components/ImportPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
</template>

<script setup>
import { PopupShell } from "@/components"
import { readGOOD } from "@/utils"
import { ref } from "vue"
import { useUserDataStore } from "@/stores/userData"
import PopupShell from "@/components/PopupShell"
import { useUserDataStore } from "@/stores"
const emit = defineEmits(["abort"])
const error = ref("")
Expand Down
4 changes: 2 additions & 2 deletions src/components/PartyRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
</template>

<script setup>
import { CharacterCard } from "@/components"
import { computed } from "vue"
import { useUserDataStore } from "@/stores/userData"
import CharacterCard from "./CharacterCard"
import { useUserDataStore } from "@/stores"
const emit = defineEmits(["cardClick"])
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/TierLine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script setup>
import CharacterCard from "@/components/CharacterCard"
import { CharacterCard } from "@/components"
defineProps({
tier: { type: String, required: true },
Expand Down
13 changes: 13 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export { default as AppFooter } from "./AppFooter.vue"
export { default as BackgroundLayer } from "./BackgroundLayer.vue"
export { default as CharacterCard } from "./CharacterCard.vue"
export { default as CharacterSelectionPopup } from "./CharacterSelectionPopup.vue"
export { default as ConstellationBadge } from "./ConstellationBadge.vue"
export { default as ConstellationPopup } from "./ConstellationPopup.vue"
export { default as ElementBadge } from "./ElementBadge.vue"
export { default as ImportPopup } from "./ImportPopup.vue"
export { default as PartyRow } from "./PartyRow.vue"
export { default as PopupShell } from "./PopupShell.vue"
export { default as SelectButton } from "./SelectButton.vue"
export { default as SiteHeader } from "./SiteHeader.vue"
export { default as TierLine } from "./TierLine.vue"
2 changes: 1 addition & 1 deletion src/hooks/characterIdList.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { computed, readonly } from "vue"
import { useJsonDataStore } from "@/stores/jsonData"
import { useJsonDataStore } from "@/stores"
import type { Ref } from "vue"

export const sortingOptions = [
Expand Down
5 changes: 5 additions & 0 deletions src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { sortingOptions, useCharacterIdList } from "./characterIdList"
export { useInsights } from "./insights"
export { useStrings } from "./strings"
export { useSuggested } from "./suggested"
export { useTierList } from "./tierList"
3 changes: 1 addition & 2 deletions src/hooks/insights.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import _capitalise from "lodash/capitalize"
import _difference from "lodash/difference"
import { computed } from "vue"
import { useJsonDataStore } from "@/stores/jsonData"
import { useJsonDataStore, useUserDataStore } from "@/stores"
import { useRoute } from "vue-router"
import { useUserDataStore } from "@/stores/userData"

const reactionRequirements: { [key: string]: string[][] } = {
aggravate: [
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/suggested.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import _shuffle from "lodash/shuffle"
import _sum from "lodash/sum"
import _uniq from "lodash/uniq"
import { computed } from "vue"
import { useJsonDataStore } from "@/stores/jsonData"
import { useJsonDataStore, useUserDataStore } from "@/stores"
import { useRoute } from "vue-router"
import { useUserDataStore } from "@/stores/userData"
import type { Character, ProcessedCharacter, Preset, JSONData } from "@/types"

function processCharacter(id: string, character: Character, constellation: number): ProcessedCharacter {
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/tierList.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import _range from "lodash/range"
import { computed, readonly } from "vue"
import { useJsonDataStore } from "@/stores/jsonData"
import { useUserDataStore } from "@/stores/userData"
import { useJsonDataStore, useUserDataStore } from "@/stores"
import type { Ref } from "vue"

// Arbitrary letters used for each rank
Expand Down
2 changes: 2 additions & 0 deletions src/stores/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { useJsonDataStore } from "./jsonData"
export { useUserDataStore } from "./userData"
10 changes: 3 additions & 7 deletions src/views/CharactersView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@
</template>

<script setup>
import { CharacterCard, ConstellationPopup, ImportPopup, SelectButton } from "@/components"
import { ref, onBeforeUnmount } from "vue"
import { sortingOptions, useCharacterIdList } from "@/hooks/characterIdList"
import { sortingOptions, useCharacterIdList, useStrings } from "@/hooks"
import { useHead } from "@vueuse/head"
import { useRouter } from "vue-router"
import { useStrings } from "@/hooks/strings"
import { useUserDataStore } from "@/stores/userData"
import CharacterCard from "@/components/CharacterCard"
import ConstellationPopup from "@/components/ConstellationPopup"
import ImportPopup from "@/components/ImportPopup"
import SelectButton from "@/components/SelectButton"
import { useUserDataStore } from "@/stores"
const router = useRouter()
const strings = useStrings()
Expand Down
4 changes: 2 additions & 2 deletions src/views/LandingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import { onBeforeUnmount } from "vue"
import { useHead } from "@vueuse/head"
import { useRouter } from "vue-router"
import { useStrings } from "@/hooks/strings"
import { useUserDataStore } from "@/stores/userData"
import { useStrings } from "@/hooks"
import { useUserDataStore } from "@/stores"
const router = useRouter()
const strings = useStrings()
Expand Down
6 changes: 3 additions & 3 deletions src/views/PartiesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

<script setup>
import { onMounted } from "vue"
import { PartyRow } from "@/components"
import { useHead } from "@vueuse/head"
import { useRouter } from "vue-router"
import { useStrings } from "@/hooks/strings"
import { useUserDataStore } from "@/stores/userData"
import PartyRow from "@/components/PartyRow"
import { useStrings } from "@/hooks"
import { useUserDataStore } from "@/stores"
useHead({ title: `My parties | ${process.env.VUE_APP_SITE_NAME}` })
Expand Down
9 changes: 3 additions & 6 deletions src/views/PartyBuilderView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@
</template>

<script setup>
import { CharacterCard, CharacterSelectionPopup, PartyRow } from "@/components"
import { getRandomReassurance } from "@/utils"
import { ref, computed, onBeforeUnmount } from "vue"
import { useHead } from "@vueuse/head"
import { useInsights } from "@/hooks/insights"
import { useInsights, useSuggested } from "@/hooks"
import { useRouter, useRoute } from "vue-router"
import { useSuggested } from "@/hooks/suggested"
import { useUserDataStore } from "@/stores/userData"
import CharacterCard from "@/components/CharacterCard"
import CharacterSelectionPopup from "@/components/CharacterSelectionPopup"
import PartyRow from "@/components/PartyRow"
import { useUserDataStore } from "@/stores"
useHead({ title: `Edit party | ${process.env.VUE_APP_SITE_NAME}` })
Expand Down
8 changes: 3 additions & 5 deletions src/views/TierListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@

<script setup>
import { ref } from "vue"
import { useStrings } from "@/hooks/strings"
import { useTierList } from "@/hooks/tierList"
import { useUserDataStore } from "@/stores/userData"
import SelectButton from "@/components/SelectButton"
import TierLine from "@/components/TierLine"
import { SelectButton, TierLine } from "@/components"
import { useStrings, useTierList } from "@/hooks"
import { useUserDataStore } from "@/stores"
const displayUnowned = ref(false)
Expand Down

0 comments on commit a561363

Please sign in to comment.