Skip to content

Commit

Permalink
chore: more comprehensive usage of import type (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Feb 2, 2024
1 parent 4061290 commit ad9e127
Show file tree
Hide file tree
Showing 29 changed files with 38 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/api/annonars/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'

import { Record as ClinvarSeqvarRecord } from '../../pbs/annonars/clinvar/minimal'
import { Record as ClinvarStrucvarRecord } from '../../pbs/annonars/clinvar/sv'
Expand Down
2 changes: 1 addition & 1 deletion src/api/mehari/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Types for interfacing with the Mehari API.
*/
import { GenomeBuild } from '../../lib/genomeBuilds'
import type { GenomeBuild } from '../../lib/genomeBuilds'

/**
* Enumeration for the putative impact.
Expand Down
2 changes: 1 addition & 1 deletion src/api/pubtator/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { urlConfig } from '../../lib/urlConfig'
import { SearchResult } from './types'
import type { SearchResult } from './types'

/**
* Client for PubTator V3 API queries.
Expand Down
2 changes: 1 addition & 1 deletion src/components/GeneClinvarCard/ClinvarFreqPlot.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { ClinvarPerGeneRecord } from '../../pbs/annonars/clinvar/per_gene'
Expand Down
2 changes: 1 addition & 1 deletion src/components/GeneClinvarCard/ClinvarImpact.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { ClinvarPerGeneRecord } from '../../pbs/annonars/clinvar/per_gene'
Expand Down
2 changes: 1 addition & 1 deletion src/components/GeneClinvarCard/GeneClinvarCard.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { TranscriptResult } from '../../api/dotty'
Expand Down
2 changes: 1 addition & 1 deletion src/components/GeneClinvarCard/VariationLandscape.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path'
import { describe, expect, test } from 'vitest'

import { TranscriptResult } from '../../api/dotty'
import { GenomeBuild } from '../../lib/genomeBuilds'
import type { GenomeBuild } from '../../lib/genomeBuilds'
import { setupMountedComponents } from '../../lib/testUtils'
import { ClinvarPerGeneRecord } from '../../pbs/annonars/clinvar/per_gene'
import VariationLandscape from './VariationLandscape.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { TranscriptResult } from '../../api/dotty'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { describe, expect, test } from 'vitest'

import { setupMountedComponents } from '../../lib/testUtils'
import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base'
import { SearchResults } from '../../store/pubtator'
import type { SearchResults } from '../../store/pubtator'
import { StoreState } from '../../store/types'
import GeneLiteratureCard from './GeneLiteratureCard.vue'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import variantInfoBrca1Json from '../../api/annonars/fixture.variantInfo.BRCA1.json'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import seqvarCsqResultBrca1Json from '../../api/mehari/fixture.seqvarCsqResponse.BRCA1.json'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SeqvarFreqsCard/AutosomalFreqs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path'
import { describe, expect, it } from 'vitest'

import { SeqvarInfoResponse } from '../../api/annonars/types'
import { Seqvar } from '../../lib/genomicVars'
import type { Seqvar } from '../../lib/genomicVars'
import { setupMountedComponents } from '../../lib/testUtils'
import AutosomalFreqs from './AutosomalFreqs.vue'

Expand Down
2 changes: 1 addition & 1 deletion src/components/SeqvarFreqsCard/SeqvarFreqsCard.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import fixtureSeqvarInfoBrca1Json from '../../api/annonars/fixture.variantInfo.BRCA1.json'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SeqvarFreqsCard/lib.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Seqvar } from '../../lib/genomicVars'
import type { Seqvar } from '../../lib/genomicVars'

/**
* Returns whether the given variant looks mitochondrial.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import fixtureSeqvarInfoBrca1Json from '../../api/annonars/fixture.variantInfo.BRCA1.json'
Expand Down
2 changes: 1 addition & 1 deletion src/components/SeqvarToolsCard/SeqvarToolsCard.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import fixtureSeqvarInfoBrca1Json from '../../api/annonars/fixture.variantInfo.BRCA1.json'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import fs from 'fs'
import path from 'path'
import { describe, expect, it } from 'vitest'

import { Strucvar } from '../../lib/genomicVars'
import type { Strucvar } from '../../lib/genomicVars'
import { setupMountedComponents } from '../../lib/testUtils'
import { ResponseRecord as ClinvarSvRecord } from '../../pbs/annonars/clinvar/sv'
import StrucvarClinvarCard from './StrucvarClinvarCard.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { Strucvar } from '../../lib/genomicVars'
import type { Strucvar } from '../../lib/genomicVars'
import { ResponseRecord as ClinvarSvRecord } from '../../pbs/annonars/clinvar/sv'
import { StoreState } from '../../store'
import { useStrucvarInfoStore } from '../../store/strucvarInfo'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { JsonValue } from '@protobuf-ts/runtime'
import type { JsonValue } from '@protobuf-ts/runtime'
import type { Meta, StoryObj } from '@storybook/vue3'

import { StrucvarResult } from '../../api/mehari'
import strucvarResultBrca1Json from '../../api/mehari/fixture.strucvarCsqResponse.BRCA1.json'
import geneInfoBrca1Json from '../../components/GenePathogenicityCard/fixture.geneInfo.BRCA1.json'
import { Strucvar } from '../../lib/genomicVars'
import type { Strucvar } from '../../lib/genomicVars'
import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base'
import { StoreState } from '../../store'
import StrucvarGeneListCard from './StrucvarGeneListCard.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/vue3'

import { Strucvar } from '../../lib/genomicVars'
import type { Strucvar } from '../../lib/genomicVars'
import StrucvarToolsCard from './StrucvarToolsCard.vue'

// We define the fixtures inline here as they are small.
Expand Down
8 changes: 7 additions & 1 deletion src/lib/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import { type TestingPinia, createTestingPinia } from '@pinia/testing'
import { type VueWrapper, flushPromises, mount } from '@vue/test-utils'
import { vi } from 'vitest'
import { h } from 'vue'
import { RouteRecordRaw, Router, RouterView, createRouter, createWebHistory } from 'vue-router'
import {
type RouteRecordRaw,
type Router,
RouterView,
createRouter,
createWebHistory
} from 'vue-router'
import { createVuetify } from 'vuetify'
import { md3 } from 'vuetify/blueprints'
import * as components from 'vuetify/components'
Expand Down
2 changes: 1 addition & 1 deletion src/store/geneInfo/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ref } from 'vue'
import { AnnonarsClient } from '../../api/annonars'
import { DottyClient } from '../../api/dotty'
import { type HpoTerm, VigunoClient } from '../../api/viguno'
import { GenomeBuild } from '../../lib/genomeBuilds'
import { type GenomeBuild } from '../../lib/genomeBuilds'
import { urlConfig } from '../../lib/urlConfig'
import { StoreState } from '../types'

Expand Down
2 changes: 1 addition & 1 deletion src/store/pubtator/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ref } from 'vue'

import { PubtatorClient } from '../../api/pubtator'
import { StoreState } from '../../store/types'
import { SearchResults } from './types'
import { type SearchResults } from './types'

export const usePubtatorStore = defineStore('pubtator', () => {
/** The current store state. */
Expand Down
2 changes: 1 addition & 1 deletion src/store/pubtator/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SearchResult } from '../../api/pubtator'
import { type SearchResult } from '../../api/pubtator'

/** Enumeration for annotation types */
export enum AnnotationType {
Expand Down

0 comments on commit ad9e127

Please sign in to comment.