Skip to content

Commit fa8dd9f

Browse files
committed
whattheduck: Use more restrictive imports
1 parent 0831159 commit fa8dd9f

16 files changed

Lines changed: 47 additions & 47 deletions

apps/whattheduck/histoire.setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { SocketClient } from 'socket-call-client';
2222

2323
import en from '~translations/en.json';
2424
import sv from '~translations/sv.json';
25-
import { i18n } from '~web';
25+
import i18n from '~web/src/i18n';
2626

2727
import router from './src/router';
2828

apps/whattheduck/src/components/FullIssue.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<script setup lang="ts">
1919
import type { EntryPartInfo } from '~dm-types/EntryPartInfo';
20-
import { stores as webStores } from '~web';
20+
import { coa } from '~web/src/stores/coa';
2121
2222
import { wtdcollection } from '~/stores/wtdcollection';
2323
@@ -33,7 +33,7 @@ const {
3333
partInfo?: EntryPartInfo;
3434
}>();
3535
36-
const coaStore = webStores.coa();
36+
const coaStore = coa();
3737
3838
const { getCollectionIssues } = wtdcollection();
3939

apps/whattheduck/src/components/Issue.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
</template>
44

55
<script setup lang="ts">
6-
import { stores as webStores } from '~web';
6+
import { coa } from '~web/src/stores/coa';
77
8-
const { coa: webCoa } = webStores;
9-
const { issuecodeDetails } = storeToRefs(webCoa());
8+
const { issuecodeDetails } = storeToRefs(coa());
109
defineProps<{
1110
issuecode: string;
1211
}>();

apps/whattheduck/src/components/Medal.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
</template>
1818

1919
<script setup lang="ts">
20-
import { components as webComponents } from '~web';
20+
import MedalImage from '~web/src/components/MedalImage.vue';
2121
2222
import { images as wtdImages } from '~/stores/images';
2323
24-
const { MedalImage } = webComponents;
25-
2624
const {
2725
contribution,
2826
nextLevel = false,

apps/whattheduck/src/components/Navigation.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</template>
3939

4040
<script setup lang="ts">
41-
import { stores } from '~web';
41+
import { coa } from '~web/src/stores/coa';
4242
4343
import Country from './Country.vue';
4444
import GlobeIcon from './GlobeIcon.vue';
@@ -48,7 +48,7 @@ import Publication from './Publication.vue';
4848
import { app } from '~/stores/app';
4949
5050
const { currentNavigationItem, countrycode, publicationcode, issuecodes } = storeToRefs(app());
51-
const { countryNames, publicationNames } = storeToRefs(stores.coa());
51+
const { countryNames, publicationNames } = storeToRefs(coa());
5252
5353
const maxParts = 4;
5454

apps/whattheduck/src/components/NavigationDrawer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ import {
7171
settingsOutline,
7272
settingsSharp,
7373
} from 'ionicons/icons';
74-
import { stores as webStores } from '~web';
74+
import { users } from '~web/src/stores/users';
7575
7676
import { app } from '~/stores/app';
7777
import { wtdcollection } from '~/stores/wtdcollection';
7878
7979
const { t } = useI18n();
8080
const { token, isOffline, isIOS } = storeToRefs(app());
8181
const collectionStore = wtdcollection();
82-
const points = computed(() => webStores.users().points);
82+
const points = computed(() => users().points);
8383
8484
interface AppPage {
8585
title: string;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { composables as webComposables } from '~web';
1+
import useMedal from '~web/src/composables/useMedal';
22

3-
export default webComposables.useMedal;
3+
export default useMedal;

apps/whattheduck/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import VueVirtualScroller from 'vue-virtual-scroller';
2626

2727
import en from '~translations/en.json';
2828
import sv from '~translations/sv.json';
29-
import { i18n } from '~web';
29+
import i18n from '~web/src/i18n';
3030

3131
import App from './App.vue';
3232
import router from './router';

apps/whattheduck/src/stores/wtdcollection.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@ import { defineStore } from 'pinia';
33
import type { EntryPartInfo } from '~dm-types/EntryPartInfo';
44
import type { IssueWithIssuecodeOnly } from '~dm-types/IssueWithIssuecodeOnly';
55
import type { issue, purchase } from '~prisma-schemas/schemas/dm';
6-
import { composables as webComposables, stores as webStores } from '~web';
6+
import useCollection from '~web/src/composables/useCollection';
7+
import { coa } from '~web/src/stores/coa';
8+
import { collection } from '~web/src/stores/collection';
9+
import { stats } from '~web/src/stores/stats';
10+
import { users } from '~web/src/stores/users';
711

812
export type purchaseWithStringDate = Omit<purchase, 'date' | 'userId'> & {
913
date: string;
1014
};
1115

1216
export const wtdcollection = defineStore('wtdcollection', () => {
13-
const coaStore = webStores.coa();
14-
const webCollectionStore = webStores.collection();
17+
const coaStore = coa();
18+
const webCollectionStore = collection();
1519

1620
const {
1721
createPurchase,
@@ -43,9 +47,9 @@ export const wtdcollection = defineStore('wtdcollection', () => {
4347
totalUniqueIssues,
4448
user,
4549
} = storeToRefs(webCollectionStore);
46-
const statsStore = webStores.stats();
47-
const usersStore = webStores.users();
48-
const { quotedIssues, quotationSum } = webComposables.useCollection(issues);
50+
const statsStore = stats();
51+
const usersStore = users();
52+
const { quotedIssues, quotationSum } = useCollection(issues);
4953

5054
const ownedCountries = computed(() =>
5155
ownedPublications.value
@@ -75,8 +79,8 @@ export const wtdcollection = defineStore('wtdcollection', () => {
7579
async () => {
7680
const issue = quotedIssues.value?.sort((a, b) => b.estimationGivenCondition - a.estimationGivenCondition)[0];
7781
if (issue) {
78-
await coa().fetchIssuecodeDetails([issue.issuecode]);
79-
return { ...issue, ...coa().issuecodeDetails[issue.issuecode] };
82+
await coaStore.fetchIssuecodeDetails([issue.issuecode]);
83+
return { ...issue, ...coaStore.issuecodeDetails[issue.issuecode] };
8084
}
8185
return issue;
8286
},

apps/whattheduck/src/views/CountryList.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
</template>
2626

2727
<script setup lang="ts">
28-
import { stores } from '~web';
28+
import { coa } from '~web/src/stores/coa';
2929
3030
import { getOwnershipText, getOwnershipPercentages } from '~/composables/useOwnership';
3131
import { app } from '~/stores/app';
3232
import { wtdcollection } from '~/stores/wtdcollection';
3333
3434
const { totalPerCountryWithoutDuplicates, ownedCountries } = storeToRefs(wtdcollection());
35-
const { countryNames, issueCountsByCountrycode: coaIssueCountsPerCountrycode } = storeToRefs(stores.coa());
35+
const { countryNames, issueCountsByCountrycode: coaIssueCountsPerCountrycode } = storeToRefs(coa());
3636
const { isCoaView } = storeToRefs(app());
3737
3838
const ownershipPercentages = computed(() =>

0 commit comments

Comments
 (0)