From 036d539736d01141831028961eaabf369ec9cb6b Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Mon, 5 Feb 2024 09:00:40 +0100 Subject: [PATCH] refactor: rename src/store => src/stores (#84) --- src/components/GeneLiteratureCard/GeneLiteratureCard.spec.ts | 4 ++-- .../GeneLiteratureCard/GeneLiteratureCard.stories.ts | 4 ++-- src/components/GeneLiteratureCard/GeneLiteratureCard.vue | 4 ++-- .../StrucvarClinvarCard/StrucvarClinvarCard.stories.ts | 4 ++-- .../StrucvarGeneListCard/StrucvarGeneListCard.spec.ts | 2 +- .../StrucvarGeneListCard/StrucvarGeneListCard.stories.ts | 2 +- src/components/StrucvarGeneListCard/StrucvarGeneListCard.vue | 2 +- .../cadaPrio/__snapshots__/store.spec.ts.snap | 0 src/{store => stores}/cadaPrio/index.ts | 0 src/{store => stores}/cadaPrio/store.spec.ts | 2 +- src/{store => stores}/cadaPrio/store.ts | 2 +- src/{store => stores}/cadaPrio/types.ts | 0 .../geneInfo/__snapshots__/store.spec.ts.snap | 0 src/{store => stores}/geneInfo/index.ts | 0 src/{store => stores}/geneInfo/store.spec.ts | 0 src/{store => stores}/geneInfo/store.ts | 0 src/{store => stores}/geneInfo/types.ts | 0 src/{store => stores}/index.ts | 0 src/{store => stores}/pubtator/index.ts | 0 src/{store => stores}/pubtator/store.ts | 2 +- src/{store => stores}/pubtator/types.ts | 0 src/{store => stores}/seqvarInfo/index.ts | 0 src/{store => stores}/seqvarInfo/store.ts | 2 +- .../strucvarInfo/fixture.responseCsqDel.BRCA1.json | 0 src/{store => stores}/strucvarInfo/index.ts | 0 src/{store => stores}/strucvarInfo/store.spec.ts | 2 +- src/{store => stores}/strucvarInfo/store.ts | 2 +- src/{store => stores}/types.ts | 0 28 files changed, 17 insertions(+), 17 deletions(-) rename src/{store => stores}/cadaPrio/__snapshots__/store.spec.ts.snap (100%) rename src/{store => stores}/cadaPrio/index.ts (100%) rename src/{store => stores}/cadaPrio/store.spec.ts (97%) rename src/{store => stores}/cadaPrio/store.ts (97%) rename src/{store => stores}/cadaPrio/types.ts (100%) rename src/{store => stores}/geneInfo/__snapshots__/store.spec.ts.snap (100%) rename src/{store => stores}/geneInfo/index.ts (100%) rename src/{store => stores}/geneInfo/store.spec.ts (100%) rename src/{store => stores}/geneInfo/store.ts (100%) rename src/{store => stores}/geneInfo/types.ts (100%) rename src/{store => stores}/index.ts (100%) rename src/{store => stores}/pubtator/index.ts (100%) rename src/{store => stores}/pubtator/store.ts (97%) rename src/{store => stores}/pubtator/types.ts (100%) rename src/{store => stores}/seqvarInfo/index.ts (100%) rename src/{store => stores}/seqvarInfo/store.ts (99%) rename src/{store => stores}/strucvarInfo/fixture.responseCsqDel.BRCA1.json (100%) rename src/{store => stores}/strucvarInfo/index.ts (100%) rename src/{store => stores}/strucvarInfo/store.spec.ts (99%) rename src/{store => stores}/strucvarInfo/store.ts (98%) rename src/{store => stores}/types.ts (100%) diff --git a/src/components/GeneLiteratureCard/GeneLiteratureCard.spec.ts b/src/components/GeneLiteratureCard/GeneLiteratureCard.spec.ts index c262e93..941ca83 100644 --- a/src/components/GeneLiteratureCard/GeneLiteratureCard.spec.ts +++ b/src/components/GeneLiteratureCard/GeneLiteratureCard.spec.ts @@ -4,8 +4,8 @@ import { describe, expect, test } from 'vitest' import { setupMountedComponents } from '../../lib/testUtils' import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base' -import type { SearchResults } from '../../store/pubtator' -import { StoreState } from '../../store/types' +import type { SearchResults } from '../../stores/pubtator' +import { StoreState } from '../../stores/types' import GeneLiteratureCard from './GeneLiteratureCard.vue' // Load fixture data for gene TGDS (little data) and BRCA1 (lots of data). diff --git a/src/components/GeneLiteratureCard/GeneLiteratureCard.stories.ts b/src/components/GeneLiteratureCard/GeneLiteratureCard.stories.ts index e823e0d..fc93e35 100644 --- a/src/components/GeneLiteratureCard/GeneLiteratureCard.stories.ts +++ b/src/components/GeneLiteratureCard/GeneLiteratureCard.stories.ts @@ -2,8 +2,8 @@ import type { JsonValue } from '@protobuf-ts/runtime' import type { Meta, StoryObj } from '@storybook/vue3' import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base' -import { StoreState } from '../../store' -import { usePubtatorStore } from '../../store/pubtator' +import { StoreState } from '../../stores' +import { usePubtatorStore } from '../../stores/pubtator' import geneInfoBrca1Json from '../GenePathogenicityCard/fixture.geneInfo.BRCA1.json' import geneInfoTgdsJson from '../GenePathogenicityCard/fixture.geneInfo.TGDS.json' import GeneLiteratureCard from './GeneLiteratureCard.vue' diff --git a/src/components/GeneLiteratureCard/GeneLiteratureCard.vue b/src/components/GeneLiteratureCard/GeneLiteratureCard.vue index 85dce9d..469497a 100644 --- a/src/components/GeneLiteratureCard/GeneLiteratureCard.vue +++ b/src/components/GeneLiteratureCard/GeneLiteratureCard.vue @@ -12,8 +12,8 @@ import { type AnnotationLocation, AnnotationType, usePubtatorStore -} from '../../store/pubtator' -import { StoreState } from '../../store/types' +} from '../../stores/pubtator' +import { StoreState } from '../../stores/types' import DocsLink from '../DocsLink/DocsLink.vue' /** This component's props. */ diff --git a/src/components/StrucvarClinvarCard/StrucvarClinvarCard.stories.ts b/src/components/StrucvarClinvarCard/StrucvarClinvarCard.stories.ts index 39a4347..df8a206 100644 --- a/src/components/StrucvarClinvarCard/StrucvarClinvarCard.stories.ts +++ b/src/components/StrucvarClinvarCard/StrucvarClinvarCard.stories.ts @@ -3,8 +3,8 @@ import type { Meta, StoryObj } from '@storybook/vue3' import type { Strucvar } from '../../lib/genomicVars' import { ResponseRecord as ClinvarSvRecord } from '../../pbs/annonars/clinvar/sv' -import { StoreState } from '../../store' -import { useStrucvarInfoStore } from '../../store/strucvarInfo' +import { StoreState } from '../../stores' +import { useStrucvarInfoStore } from '../../stores/strucvarInfo' import StrucvarClinvarCard from './StrucvarClinvarCard.vue' import clinvarSvRecordsJson from './fixture.clinvarSvRecords.BRCA1.json' diff --git a/src/components/StrucvarGeneListCard/StrucvarGeneListCard.spec.ts b/src/components/StrucvarGeneListCard/StrucvarGeneListCard.spec.ts index 31a2b6c..de5ef33 100644 --- a/src/components/StrucvarGeneListCard/StrucvarGeneListCard.spec.ts +++ b/src/components/StrucvarGeneListCard/StrucvarGeneListCard.spec.ts @@ -8,7 +8,7 @@ import { StrucvarResult } from '../../api/mehari/types' import { type Strucvar } from '../../lib/genomicVars' import { setupMountedComponents } from '../../lib/testUtils' import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base' -import { StoreState } from '../../store' +import { StoreState } from '../../stores' import StrucvarGeneListCard from './StrucvarGeneListCard.vue' /** Example Strucvar */ diff --git a/src/components/StrucvarGeneListCard/StrucvarGeneListCard.stories.ts b/src/components/StrucvarGeneListCard/StrucvarGeneListCard.stories.ts index 0b978e2..3e0170f 100644 --- a/src/components/StrucvarGeneListCard/StrucvarGeneListCard.stories.ts +++ b/src/components/StrucvarGeneListCard/StrucvarGeneListCard.stories.ts @@ -6,7 +6,7 @@ import strucvarResultBrca1Json from '../../api/mehari/fixture.strucvarCsqRespons import geneInfoBrca1Json from '../../components/GenePathogenicityCard/fixture.geneInfo.BRCA1.json' import type { Strucvar } from '../../lib/genomicVars' import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base' -import { StoreState } from '../../store' +import { StoreState } from '../../stores' import StrucvarGeneListCard from './StrucvarGeneListCard.vue' // We define the fixtures inline here as they are small. diff --git a/src/components/StrucvarGeneListCard/StrucvarGeneListCard.vue b/src/components/StrucvarGeneListCard/StrucvarGeneListCard.vue index 4927d69..2451f55 100644 --- a/src/components/StrucvarGeneListCard/StrucvarGeneListCard.vue +++ b/src/components/StrucvarGeneListCard/StrucvarGeneListCard.vue @@ -6,7 +6,7 @@ import { TX_EFFECT_LABELS } from '../../api/mehari/constants' import type { GeneTranscriptEffects } from '../../api/mehari/types' import { type Strucvar } from '../../lib/genomicVars' import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base' -import { StoreState } from '../../store' +import { StoreState } from '../../stores' import DocsLink from '../DocsLink/DocsLink.vue' import GeneListEntry from './GeneListEntry.vue' diff --git a/src/store/cadaPrio/__snapshots__/store.spec.ts.snap b/src/stores/cadaPrio/__snapshots__/store.spec.ts.snap similarity index 100% rename from src/store/cadaPrio/__snapshots__/store.spec.ts.snap rename to src/stores/cadaPrio/__snapshots__/store.spec.ts.snap diff --git a/src/store/cadaPrio/index.ts b/src/stores/cadaPrio/index.ts similarity index 100% rename from src/store/cadaPrio/index.ts rename to src/stores/cadaPrio/index.ts diff --git a/src/store/cadaPrio/store.spec.ts b/src/stores/cadaPrio/store.spec.ts similarity index 97% rename from src/store/cadaPrio/store.spec.ts rename to src/stores/cadaPrio/store.spec.ts index 23aee41..92cdc08 100644 --- a/src/store/cadaPrio/store.spec.ts +++ b/src/stores/cadaPrio/store.spec.ts @@ -4,7 +4,7 @@ import { createPinia, setActivePinia } from 'pinia' import { beforeEach, describe, expect, it, vi } from 'vitest' import createFetchMock from 'vitest-fetch-mock' -import { StoreState } from '../../store' +import { StoreState } from '..' import { useCadaPrioStore } from './store' const predictResponseJson = JSON.parse( diff --git a/src/store/cadaPrio/store.ts b/src/stores/cadaPrio/store.ts similarity index 97% rename from src/store/cadaPrio/store.ts rename to src/stores/cadaPrio/store.ts index 1d85e50..5730251 100644 --- a/src/store/cadaPrio/store.ts +++ b/src/stores/cadaPrio/store.ts @@ -6,8 +6,8 @@ import { defineStore } from 'pinia' import { ref } from 'vue' +import { StoreState } from '..' import { CadaPrioClient } from '../../api/cadaPrio' -import { StoreState } from '../../store' import { GeneRank } from './types' /** Options for `loadData()` */ diff --git a/src/store/cadaPrio/types.ts b/src/stores/cadaPrio/types.ts similarity index 100% rename from src/store/cadaPrio/types.ts rename to src/stores/cadaPrio/types.ts diff --git a/src/store/geneInfo/__snapshots__/store.spec.ts.snap b/src/stores/geneInfo/__snapshots__/store.spec.ts.snap similarity index 100% rename from src/store/geneInfo/__snapshots__/store.spec.ts.snap rename to src/stores/geneInfo/__snapshots__/store.spec.ts.snap diff --git a/src/store/geneInfo/index.ts b/src/stores/geneInfo/index.ts similarity index 100% rename from src/store/geneInfo/index.ts rename to src/stores/geneInfo/index.ts diff --git a/src/store/geneInfo/store.spec.ts b/src/stores/geneInfo/store.spec.ts similarity index 100% rename from src/store/geneInfo/store.spec.ts rename to src/stores/geneInfo/store.spec.ts diff --git a/src/store/geneInfo/store.ts b/src/stores/geneInfo/store.ts similarity index 100% rename from src/store/geneInfo/store.ts rename to src/stores/geneInfo/store.ts diff --git a/src/store/geneInfo/types.ts b/src/stores/geneInfo/types.ts similarity index 100% rename from src/store/geneInfo/types.ts rename to src/stores/geneInfo/types.ts diff --git a/src/store/index.ts b/src/stores/index.ts similarity index 100% rename from src/store/index.ts rename to src/stores/index.ts diff --git a/src/store/pubtator/index.ts b/src/stores/pubtator/index.ts similarity index 100% rename from src/store/pubtator/index.ts rename to src/stores/pubtator/index.ts diff --git a/src/store/pubtator/store.ts b/src/stores/pubtator/store.ts similarity index 97% rename from src/store/pubtator/store.ts rename to src/stores/pubtator/store.ts index fed49a7..7cd3f97 100644 --- a/src/store/pubtator/store.ts +++ b/src/stores/pubtator/store.ts @@ -5,7 +5,7 @@ import { defineStore } from 'pinia' import { ref } from 'vue' import { PubtatorClient } from '../../api/pubtator' -import { StoreState } from '../../store/types' +import { StoreState } from '../types' import { type SearchResults } from './types' export const usePubtatorStore = defineStore('pubtator', () => { diff --git a/src/store/pubtator/types.ts b/src/stores/pubtator/types.ts similarity index 100% rename from src/store/pubtator/types.ts rename to src/stores/pubtator/types.ts diff --git a/src/store/seqvarInfo/index.ts b/src/stores/seqvarInfo/index.ts similarity index 100% rename from src/store/seqvarInfo/index.ts rename to src/stores/seqvarInfo/index.ts diff --git a/src/store/seqvarInfo/store.ts b/src/stores/seqvarInfo/store.ts similarity index 99% rename from src/store/seqvarInfo/store.ts rename to src/stores/seqvarInfo/store.ts index 45b7688..fdceee7 100644 --- a/src/store/seqvarInfo/store.ts +++ b/src/stores/seqvarInfo/store.ts @@ -7,13 +7,13 @@ import equal from 'fast-deep-equal' import { defineStore } from 'pinia' import { ref } from 'vue' +import { StoreState } from '..' import { AnnonarsClient, SeqvarInfoResult } from '../../api/annonars' import { MehariClient, SeqvarResultEntry } from '../../api/mehari' import { type HpoTerm, VigunoClient } from '../../api/viguno' import { type Seqvar } from '../../lib/genomicVars' import { ClinvarPerGeneRecord } from '../../pbs/annonars/clinvar/per_gene' import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base' -import { StoreState } from '../../store' export const useSeqvarInfoStore = defineStore('seqvarInfo', () => { /** The current store state. */ diff --git a/src/store/strucvarInfo/fixture.responseCsqDel.BRCA1.json b/src/stores/strucvarInfo/fixture.responseCsqDel.BRCA1.json similarity index 100% rename from src/store/strucvarInfo/fixture.responseCsqDel.BRCA1.json rename to src/stores/strucvarInfo/fixture.responseCsqDel.BRCA1.json diff --git a/src/store/strucvarInfo/index.ts b/src/stores/strucvarInfo/index.ts similarity index 100% rename from src/store/strucvarInfo/index.ts rename to src/stores/strucvarInfo/index.ts diff --git a/src/store/strucvarInfo/store.spec.ts b/src/stores/strucvarInfo/store.spec.ts similarity index 99% rename from src/store/strucvarInfo/store.spec.ts rename to src/stores/strucvarInfo/store.spec.ts index 4747dbc..011d7c2 100644 --- a/src/store/strucvarInfo/store.spec.ts +++ b/src/stores/strucvarInfo/store.spec.ts @@ -4,9 +4,9 @@ import { createPinia, setActivePinia } from 'pinia' import { beforeEach, describe, expect, it, vi } from 'vitest' import createFetchMock from 'vitest-fetch-mock' +import { StoreState } from '..' import type { Strucvar } from '../../lib/genomicVars' import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base' -import { StoreState } from '../../store' import { useStrucvarInfoStore } from './store' /** Fixtures loaded from JSON files. */ diff --git a/src/store/strucvarInfo/store.ts b/src/stores/strucvarInfo/store.ts similarity index 98% rename from src/store/strucvarInfo/store.ts rename to src/stores/strucvarInfo/store.ts index f33e508..0920418 100644 --- a/src/store/strucvarInfo/store.ts +++ b/src/stores/strucvarInfo/store.ts @@ -7,10 +7,10 @@ import equal from 'fast-deep-equal' import { defineStore } from 'pinia' import { ref } from 'vue' +import { StoreState } from '..' import { AnnonarsClient } from '../../api/annonars' import { MehariClient } from '../../api/mehari' import { type Strucvar } from '../../lib/genomicVars' -import { StoreState } from '../../store' /** `ClinvarSvRecord` is a type alias for easier future interface definition. */ export type ClinvarSvRecord = any | null diff --git a/src/store/types.ts b/src/stores/types.ts similarity index 100% rename from src/store/types.ts rename to src/stores/types.ts