diff --git a/plugins/data-management/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.js.snap b/plugins/data-management/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.js.snap index 6652a4693e..6a2c6090e5 100644 --- a/plugins/data-management/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.js.snap +++ b/plugins/data-management/src/PluginStoreWidget/components/__snapshots__/PluginStoreWidget.test.js.snap @@ -501,28 +501,6 @@ exports[` renders with the available plugins 1`] = ` SequencePlugin

-
  • - -

    - TrackHubRegistryPlugin -

    -
  • diff --git a/plugins/trackhub-registry/package.json b/plugins/trackhub-registry/package.json deleted file mode 100644 index f4b25e7d36..0000000000 --- a/plugins/trackhub-registry/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "@jbrowse/plugin-trackhub-registry", - "version": "2.2.2", - "description": "Add a connection to The Track Hub Registry", - "keywords": [ - "jbrowse", - "jbrowse2" - ], - "license": "Apache-2.0", - "homepage": "https://jbrowse.org", - "bugs": "https://github.com/GMOD/jbrowse-components/issues", - "repository": { - "type": "git", - "url": "https://github.com/GMOD/jbrowse-components.git", - "directory": "plugins/trackhub-registry" - }, - "author": "JBrowse Team", - "distMain": "dist/index.js", - "srcMain": "src/index.ts", - "main": "src/index.ts", - "files": [ - "dist", - "src", - "esm" - ], - "scripts": { - "build": "npm-run-all build:*", - "test": "cd ../..; jest plugins/trackhub-registry", - "prepublishOnly": "yarn test", - "prepack": "yarn build && yarn useDist", - "postpack": "yarn useSrc", - "useDist": "node ../../scripts/useDist.js", - "useSrc": "node ../../scripts/useSrc.js", - "prebuild": "npm run clean", - "build:esm": "tsc --build tsconfig.build.esm.json", - "build:es5": "tsc --build tsconfig.build.es5.json", - "clean": "rimraf dist esm *.tsbuildinfo" - }, - "dependencies": { - "@gmod/ucsc-hub": "^0.1.6", - "@mui/icons-material": "^5.0.1" - }, - "peerDependencies": { - "@jbrowse/core": "^2.0.0", - "@mui/material": "^5.0.0", - "mobx": "^6.0.0", - "mobx-react": "^7.0.0", - "mobx-state-tree": "^5.0.0", - "react": ">=16.8.0", - "tss-react": "^4.0.0" - }, - "private": true, - "distModule": "esm/index.js", - "srcModule": "src/index.ts", - "module": "" -} diff --git a/plugins/trackhub-registry/src/index.test.js b/plugins/trackhub-registry/src/index.test.js deleted file mode 100644 index 81361b0007..0000000000 --- a/plugins/trackhub-registry/src/index.test.js +++ /dev/null @@ -1,21 +0,0 @@ -import PluginManager from '@jbrowse/core/PluginManager' -import ThisPlugin from '.' - -describe('Data management', () => { - let pluginManager - - beforeAll(() => { - const originalConsoleWarn = console.warn - console.warn = jest.fn() - pluginManager = new PluginManager([new ThisPlugin()]) - pluginManager.createPluggableElements() - pluginManager.configure() - console.warn = originalConsoleWarn - }) - - it("won't add if already added", () => { - expect(() => pluginManager.addPlugin(new ThisPlugin())).toThrow( - /JBrowse already configured, cannot add plugins/, - ) - }) -}) diff --git a/plugins/trackhub-registry/src/index.ts b/plugins/trackhub-registry/src/index.ts deleted file mode 100644 index b544f0d78e..0000000000 --- a/plugins/trackhub-registry/src/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { lazy } from 'react' -import ConnectionType from '@jbrowse/core/pluggableElementTypes/ConnectionType' -import Plugin from '@jbrowse/core/Plugin' -import PluginManager from '@jbrowse/core/PluginManager' -import { configSchema, modelFactory } from './trackhub-registry' - -export default class TrackHubRegistryPlugin extends Plugin { - name = 'TrackHubRegistryPlugin' - - install(pluginManager: PluginManager) { - pluginManager.addConnectionType( - () => - new ConnectionType({ - name: 'TheTrackHubRegistryConnection', - configSchema, - configEditorComponent: lazy( - () => import('./trackhub-registry/TrackHubRegistrySelect'), - ), - stateModel: modelFactory(pluginManager), - displayName: 'The Track Hub Registry', - description: 'A hub from The Track Hub Registry', - url: '//trackhubregistry.org/', - }), - ) - } -} diff --git a/plugins/trackhub-registry/src/trackhub-registry/HubDetails.tsx b/plugins/trackhub-registry/src/trackhub-registry/HubDetails.tsx deleted file mode 100644 index f5e028a04b..0000000000 --- a/plugins/trackhub-registry/src/trackhub-registry/HubDetails.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { openLocation } from '@jbrowse/core/util/io' -import { HubFile } from '@gmod/ucsc-hub' -import { - Card, - CardActions, - CardContent, - CardHeader, - IconButton, - LinearProgress, - Typography, -} from '@mui/material' -import EmailIcon from '@mui/icons-material/Email' -import OpenInNewIcon from '@mui/icons-material/OpenInNew' -import { SanitizedHTML } from '@jbrowse/core/ui' - -function HubDetails(props: { - hub: { url: string; longLabel: string; shortLabel: string } -}) { - const [hubFile, setHubFile] = useState>() - const [error, setError] = useState() - - const { hub } = props - - const { url: hubUrl, longLabel, shortLabel } = hub - - useEffect(() => { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - ;(async () => { - try { - const hubHandle = openLocation({ - uri: hubUrl, - locationType: 'UriLocation', - }) - const hubTxt = await hubHandle.readFile('utf8') - const newHubFile = new HubFile(hubTxt) - setHubFile(newHubFile) - } catch (error) { - console.error(error) - setError(error) - } - })() - }, [hubUrl]) - - if (error) { - return ( - - - {`${error}`} - - - ) - } - if (hubFile) { - return ( - - - - - - - - - - {hubFile.get('descriptionUrl') ? ( - - - - ) : null} - - - ) - } - return -} - -export default HubDetails diff --git a/plugins/trackhub-registry/src/trackhub-registry/SelectBox.tsx b/plugins/trackhub-registry/src/trackhub-registry/SelectBox.tsx deleted file mode 100644 index 96092b0dc9..0000000000 --- a/plugins/trackhub-registry/src/trackhub-registry/SelectBox.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React from 'react' -import { - FormControl, - InputLabel, - FormHelperText, - MenuItem, - Select, - SelectChangeEvent, -} from '@mui/material' - -import { makeStyles } from 'tss-react/mui' - -const useStyles = makeStyles()(theme => ({ - formControl: { - minWidth: 192, - marginLeft: theme.spacing(2), - marginRight: theme.spacing(2), - }, -})) - -function SelectBox({ - selectList, - selectedItem, - handleSelect, - label, - helpText, -}: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - selectList: any[] - // eslint-disable-next-line @typescript-eslint/no-explicit-any - selectedItem: any - label: string - helpText: string - handleSelect: (evt: SelectChangeEvent) => void -}) { - const { classes } = useStyles() - return ( - - {label} - - - {helpText} - - ) -} - -export default SelectBox diff --git a/plugins/trackhub-registry/src/trackhub-registry/TrackHubRegistrySelect.tsx b/plugins/trackhub-registry/src/trackhub-registry/TrackHubRegistrySelect.tsx deleted file mode 100644 index c98beb6527..0000000000 --- a/plugins/trackhub-registry/src/trackhub-registry/TrackHubRegistrySelect.tsx +++ /dev/null @@ -1,311 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { openLocation } from '@jbrowse/core/util/io' -import { - FormControl, - FormControlLabel, - FormLabel, - LinearProgress, - Radio, - RadioGroup, - Tooltip, - Typography, -} from '@mui/material' -import { makeStyles } from 'tss-react/mui' -import { AbstractSessionModel, isAbortException } from '@jbrowse/core/util' -import { AnyConfigurationModel } from '@jbrowse/core/configuration' -import { AssemblySelector, SanitizedHTML } from '@jbrowse/core/ui' - -// locals -import HubDetails from './HubDetails' -import SelectBox from './SelectBox' -import { mfetch, post_with_params } from './util' - -function QueryStatus({ status }: { status: string }) { - return ( - <> - - {status} - - ) -} - -// Need this for FormControlLabel to work with Tooltip -// https://github.com/mui-org/material-ui/issues/2225#issuecomment-460041878 -function Wire({ - children, - ...props -}: { - children: React.FC - [key: string]: unknown -}) { - return children(props) -} - -const useStyles = makeStyles()(theme => ({ - hubList: { - maxHeight: 400, - overflowY: 'auto', - }, - genomeSelector: { - marginTop: theme.spacing(1), - }, -})) - -interface HubAssembly { - name: string - synonyms: string[] -} - -function TrackHubRegistrySelect({ - model: trackHubConfig, - session, -}: { - model: AnyConfigurationModel - session: AbstractSessionModel -}) { - const [error, setError] = useState() - const [assemblies, setAssemblies] = useState>() - const [selectedSpecies, setSelectedSpecies] = useState('') - const [selectedTrackhubAssembly, setSelectedTrackhubAssembly] = useState('') - const [hubs, setHubs] = useState(new Map()) - const [allHubsRetrieved, setAllHubsRetrieved] = useState(false) - const [selectedHub, setSelectedHub] = useState('') - const [selectedLocalAssembly, setSelectedLocalAssembly] = useState() - const { classes } = useStyles() - - useEffect(() => { - const controller = new AbortController() - const { signal } = controller - // eslint-disable-next-line @typescript-eslint/no-floating-promises - ;(async () => { - try { - const pingResponse = await mfetch( - 'https://www.trackhubregistry.org/api/info/ping', - { signal }, - ) - if (pingResponse.ping !== 1) { - setError('Registry is not available') - return - } - const assembliesResponse = await mfetch( - 'https://www.trackhubregistry.org/api/info/assemblies', - { signal }, - ) - setAssemblies(assembliesResponse) - } catch (e) { - if (!isAbortException(e)) { - console.error(e) - setError(e) - } - } - })() - - return () => { - controller.abort() - } - }, []) - - useEffect(() => { - const controller = new AbortController() - const { signal } = controller - async function getHubs(reset?: boolean) { - const entriesPerPage = 10 - const newHubs = reset ? new Map() : new Map(hubs) - const page = Math.floor(hubs.size / entriesPerPage) + 1 - const response = await post_with_params( - 'https://www.trackhubregistry.org/api/search', - { page, entries_per_page: entriesPerPage }, - { - body: JSON.stringify({ assembly: selectedTrackhubAssembly }), - signal, - }, - ) - if (response) { - for (const item of response.items) { - if (item.hub.url.startsWith('ftp://')) { - item.error = 'JBrowse cannot add connections from FTP sources' - } else { - const hub = openLocation({ - uri: item.hub.url, - locationType: 'UriLocation', - }) - try { - await hub.stat() - } catch (error) { - item.error = `${error}` - } - } - newHubs.set(item.id, item) - } - setHubs(newHubs) - if (newHubs.size === response.total_entries) { - setAllHubsRetrieved(true) - } - } - } - - // eslint-disable-next-line @typescript-eslint/no-floating-promises - ;(async () => { - try { - if (!error) { - if (selectedTrackhubAssembly && !hubs.size) { - await getHubs(true) - } else if (hubs.size && !allHubsRetrieved) { - await getHubs() - } - } - } catch (e) { - if (!isAbortException(e)) { - console.error(e) - setError(e) - } - } - })() - - return () => { - controller.abort() - } - }, [selectedTrackhubAssembly, error, hubs, allHubsRetrieved]) - - const renderItems = [ - - The Track Hub Registry - , - ] - - if (error) { - renderItems.push( - - {`${error}`} - , - ) - return
    {renderItems}
    - } - - if (!assemblies) { - renderItems.push( - , - ) - return
    {renderItems}
    - } - - const speciesList = Object.keys(assemblies).sort() - - renderItems.push( - { - setSelectedSpecies(event.target.value) - setSelectedTrackhubAssembly('') - setHubs(new Map()) - setSelectedHub('') - setAllHubsRetrieved(false) - }} - label="Species" - helpText="Select a species" - />, - ) - - if (selectedSpecies) { - // trackhubregistry has this nonsense hg19 with alias hg38 entry, filter it out - const ret = assemblies[selectedSpecies].filter( - s => !(s.name === 'GRCh37' && s.synonyms[0] === 'hg38'), - ) - renderItems.push( - { - setSelectedTrackhubAssembly(event.target.value) - setHubs(new Map()) - setSelectedHub('') - setAllHubsRetrieved(false) - }} - label="Assembly" - helpText="Select an assembly" - />, - ) - } - - if (selectedTrackhubAssembly) { - renderItems.push( -
    - - Select an assembly from our local tracklist if it doesn't match the - assembly name on the remote trackhub - - setSelectedLocalAssembly(val)} - selected={selectedLocalAssembly || selectedTrackhubAssembly} - /> -
    - - Hubs: -
    - { - const newHub = event.target.value - setSelectedHub(newHub) - - // set values on a trackhub registry configSchema - trackHubConfig.target.name.set(hubs.get(newHub).hub.shortLabel) - trackHubConfig.target.assemblyNames.set([ - selectedTrackhubAssembly, - ]) - trackHubConfig.target.trackDbId.set(newHub) - }} - > - {Array.from(hubs.values()) - .filter( - ({ assembly }) => - assembly.name === selectedTrackhubAssembly || - assembly.synonyms.includes(selectedTrackhubAssembly), - ) - .map(h => { - const { error, id, hub } = h - const { shortLabel, longLabel } = hub - return ( - - {formControlProps => ( - } - placement="left" - > - } - disabled={Boolean(error)} - control={} - {...formControlProps} - /> - - )} - - ) - })} - -
    -
    -
    , - ) - if (!allHubsRetrieved) { - renderItems.push() - } - } - - if (selectedHub) { - renderItems.push( - , - ) - } - - return <>{renderItems} -} - -export default TrackHubRegistrySelect diff --git a/plugins/trackhub-registry/src/trackhub-registry/configSchema.ts b/plugins/trackhub-registry/src/trackhub-registry/configSchema.ts deleted file mode 100644 index b31a4fe2e9..0000000000 --- a/plugins/trackhub-registry/src/trackhub-registry/configSchema.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { baseConnectionConfig } from '@jbrowse/core/pluggableElementTypes/models' -import { ConfigurationSchema } from '@jbrowse/core/configuration' - -/** - * #config TheTrackHubRegistryConnection - */ -function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars - -export default ConfigurationSchema( - 'TheTrackHubRegistryConnection', - { - /** - * #slot - */ - trackDbId: { - type: 'string', - defaultValue: '', - description: 'id of the trackDb in The Track Hub Registry', - }, - }, - { - /** - * #baseConfiguration - */ - baseConfiguration: baseConnectionConfig, - }, -) diff --git a/plugins/trackhub-registry/src/trackhub-registry/index.ts b/plugins/trackhub-registry/src/trackhub-registry/index.ts deleted file mode 100644 index adb697af61..0000000000 --- a/plugins/trackhub-registry/src/trackhub-registry/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { default as modelFactory } from './model' - -export { default as configSchema } from './configSchema' diff --git a/plugins/trackhub-registry/src/trackhub-registry/model.ts b/plugins/trackhub-registry/src/trackhub-registry/model.ts deleted file mode 100644 index 80be76840c..0000000000 --- a/plugins/trackhub-registry/src/trackhub-registry/model.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { - AnyConfigurationModel, - ConfigurationReference, - readConfObject, - getConf, -} from '@jbrowse/core/configuration' -import { BaseConnectionModelFactory } from '@jbrowse/core/pluggableElementTypes/models' -import PluginManager from '@jbrowse/core/PluginManager' -import { getSession } from '@jbrowse/core/util' -import { types, Instance } from 'mobx-state-tree' - -// locals -import configSchema from './configSchema' -import { generateTracks } from './tracks' -import { mfetch } from './util' - -export default function stateModelFactory(pluginManager: PluginManager) { - return types - .compose( - 'TheTrackHubRegistryConnection', - BaseConnectionModelFactory(pluginManager), - types.model({ - type: types.literal('TheTrackHubRegistryConnection'), - configuration: ConfigurationReference(configSchema), - }), - ) - .volatile(() => ({ - error: undefined as unknown, - })) - .actions(self => ({ - async connect(connectionConf: AnyConfigurationModel) { - // @ts-ignore - self.clear() - const trackDbId = readConfObject(connectionConf, 'trackDbId') - try { - const trackDb = await mfetch( - `https://www.trackhubregistry.org/api/search/trackdb/${trackDbId}`, - ) - // eslint-disable-next-line no-underscore-dangle - const assemblyName = trackDb._source.assembly.name - const session = getSession(self) - const assembly = session.assemblyManager.get(assemblyName) - if (!assembly) { - throw new Error(`unknown assembly ${assemblyName}`) - } - const sequenceAdapter = getConf(assembly, ['sequence', 'adapter']) - self.setTrackConfs( - generateTracks(trackDb, assemblyName, sequenceAdapter), - ) - } catch (e) { - console.error(e) - this.setError(e) - } - }, - setError(e: unknown) { - self.error = e - }, - })) -} - -export type TrackHubConnectionStateModel = ReturnType -export type TrackHubConnectionModel = Instance diff --git a/plugins/trackhub-registry/src/trackhub-registry/tracks.js b/plugins/trackhub-registry/src/trackhub-registry/tracks.js deleted file mode 100644 index d31aebab4c..0000000000 --- a/plugins/trackhub-registry/src/trackhub-registry/tracks.js +++ /dev/null @@ -1,249 +0,0 @@ -import { objectHash } from '@jbrowse/core/util' -import { generateUnsupportedTrackConf } from '@jbrowse/core/util/tracks' - -export function generateTracks(trackDb, assemblyName, sequenceAdapter) { - // eslint-disable-next-line no-underscore-dangle - const { configuration } = trackDb._source - const subTracks = getSubtracks({ members: configuration }) - return subTracks.map(subTrack => { - const ret = makeTrackConfig( - subTrack, - // eslint-disable-next-line no-underscore-dangle - trackDb._source.hub.url, - sequenceAdapter, - ) - ret.trackId = `trackhub-registry-${objectHash(ret)}` - ret.assemblyNames = [assemblyName] - return ret - }) - - function getSubtracks(track, trackPath = []) { - if (track.members) { - return Object.values(track.members) - .map(subTrack => - getSubtracks( - subTrack, - track.shortLabel ? trackPath.concat([track.shortLabel]) : trackPath, - ), - ) - .flat() - } - track.categories = trackPath - return [track] - } -} - -function makeTrackConfig(track, trackDbUrl, sequenceAdapter) { - const trackType = track.type - let baseTrackType = trackType.split(' ')[0].toLowerCase() - if ( - baseTrackType === 'bam' && - track.bigDataUrl.toLowerCase().endsWith('cram') - ) { - baseTrackType = 'cram' - } - const { bigDataUrl } = track - const bigDataLocation = { - uri: new URL(bigDataUrl, trackDbUrl).href, - locationType: 'UriLocation', - } - const { categories } = track - let bigDataIndexLocation - switch (baseTrackType) { - case 'bam': - if (trackDbUrl) { - bigDataIndexLocation = track.bigDataIndex - ? { - uri: new URL(track.bigDataIndex, trackDbUrl).href, - locationType: 'UriLocation', - } - : { - uri: new URL(`${track.bigDataUrl}.bai`, trackDbUrl).href, - locationType: 'UriLocation', - } - } else { - bigDataIndexLocation = track.bigDataIndex - ? { localPath: track.bigDataIndex, locationType: 'LocalPathLocation' } - : { - localPath: `${track.bigDataUrl}.bai`, - locationType: 'LocalPathLocation', - } - } - return { - type: 'AlignmentsTrack', - name: track.shortLabel, - description: track.longLabel, - category: categories, - adapter: { - type: 'BamAdapter', - bamLocation: bigDataLocation, - index: { - location: bigDataIndexLocation, - }, - }, - } - case 'bed': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'bed5floatscore': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'bedgraph': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'bedrnaelements': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'bigbarchart': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'bigbed': - return { - type: 'FeatureTrack', - name: track.shortLabel, - description: track.longLabel, - category: categories, - adapter: { - type: 'BigBedAdapter', - bigBedLocation: bigDataLocation, - }, - } - case 'bigchain': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'biginteract': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'bigmaf': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'bigpsl': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'bigwig': - return { - type: 'QuantitativeTrack', - name: track.shortLabel, - description: track.longLabel, - category: categories, - adapter: { - type: 'BigWigAdapter', - bigWigLocation: bigDataLocation, - }, - } - case 'broadpeak': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'coloredexon': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'cram': - if (trackDbUrl) { - bigDataIndexLocation = track.bigDataIndex - ? { - uri: new URL(track.bigDataIndex, trackDbUrl).href, - locationType: 'UriLocation', - } - : { - uri: new URL(`${track.bigDataUrl}.bai`, trackDbUrl).href, - locationType: 'UriLocation', - } - } else { - bigDataIndexLocation = track.bigDataIndex - ? { localPath: track.bigDataIndex, locationType: 'LocalPathLocation' } - : { - localPath: `${track.bigDataUrl}.bai`, - locationType: 'LocalPathLocation', - } - } - return { - type: 'AlignmentsTrack', - name: track.shortLabel, - description: track.longLabel, - category: categories, - adapter: { - type: 'CramAdapter', - bamLocation: bigDataLocation, - index: { location: bigDataIndexLocation }, - sequenceAdapter, - }, - } - case 'gvf': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'ld2': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'narrowpeak': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'peptidemapping': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'vcftabix': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'wig': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - case 'wigmaf': - return generateUnsupportedTrackConf( - track.shortLabel, - baseTrackType, - categories, - ) - default: - throw new Error(`Unsupported track type: ${baseTrackType}`) - } -} diff --git a/plugins/trackhub-registry/src/trackhub-registry/util.tsx b/plugins/trackhub-registry/src/trackhub-registry/util.tsx deleted file mode 100644 index b9df74dcc2..0000000000 --- a/plugins/trackhub-registry/src/trackhub-registry/util.tsx +++ /dev/null @@ -1,25 +0,0 @@ -export async function mfetch(url: string, request?: RequestInit) { - const response = await fetch(url, request) - if (!response.ok) { - throw new Error( - `HTTP - ${response.status}: ${await response.text()} from - ${url}`, - ) - } - return response.json() -} - -export async function post_with_params( - url: string, - params = {} as Record, - options = {} as RequestInit, -) { - const urlParams = Object.keys(params) - .map(param => `${param}=${params[param]}`) - .join(';') - return mfetch(`${url}${urlParams ? `?${urlParams}` : ''}`, { - ...options, - method: 'POST', - }) -} diff --git a/plugins/trackhub-registry/tsconfig.build.es5.json b/plugins/trackhub-registry/tsconfig.build.es5.json deleted file mode 100644 index d74a282563..0000000000 --- a/plugins/trackhub-registry/tsconfig.build.es5.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./tsconfig", - "compilerOptions": { - "declaration": true, - "noEmit": false, - "outDir": "dist", - "rootDir": "./src", - "composite": true, - "target": "es2018", - "module": "commonjs" - }, - "include": ["./src/**/*.ts*", "./src/**/*.js*"], - "exclude": ["src/**/*.test.ts*", "src/**/*.test.js*"], - "references": [ - { - "path": "../../packages/core/tsconfig.build.json" - } - ] -} diff --git a/plugins/trackhub-registry/tsconfig.build.esm.json b/plugins/trackhub-registry/tsconfig.build.esm.json deleted file mode 100644 index 1b45068b63..0000000000 --- a/plugins/trackhub-registry/tsconfig.build.esm.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "./tsconfig", - "compilerOptions": { - "declaration": true, - "noEmit": false, - "outDir": "esm", - "rootDir": "./src", - "composite": true, - "target": "es2018" - }, - "include": ["./src/**/*.ts*", "./src/**/*.js*"], - "exclude": ["src/**/*.test.ts*", "src/**/*.test.js*"], - "references": [ - { - "path": "../../packages/core/tsconfig.build.json" - } - ] -} diff --git a/plugins/trackhub-registry/tsconfig.json b/plugins/trackhub-registry/tsconfig.json deleted file mode 100644 index 627f330f2d..0000000000 --- a/plugins/trackhub-registry/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "include": ["src", "types"], - "compilerOptions": { - "declaration": true, - "sourceMap": true, - "rootDir": "./src" - } -} diff --git a/products/jbrowse-desktop/package.json b/products/jbrowse-desktop/package.json index d7d1b7dd34..d3b724f6f1 100644 --- a/products/jbrowse-desktop/package.json +++ b/products/jbrowse-desktop/package.json @@ -71,7 +71,6 @@ "@jbrowse/plugin-sv-inspector": "^2.2.2", "@jbrowse/plugin-svg": "^2.2.2", "@jbrowse/plugin-text-indexing": "^2.2.2", - "@jbrowse/plugin-trackhub-registry": "^2.2.2", "@jbrowse/plugin-trix": "^2.2.2", "@jbrowse/plugin-variants": "^2.2.2", "@jbrowse/plugin-wiggle": "^2.2.2", diff --git a/products/jbrowse-desktop/src/corePlugins.ts b/products/jbrowse-desktop/src/corePlugins.ts index fd09ebed9f..4d7a138302 100644 --- a/products/jbrowse-desktop/src/corePlugins.ts +++ b/products/jbrowse-desktop/src/corePlugins.ts @@ -19,7 +19,6 @@ import Menus from '@jbrowse/plugin-menus' import RDF from '@jbrowse/plugin-rdf' import Sequence from '@jbrowse/plugin-sequence' import SVG from '@jbrowse/plugin-svg' -import TrackHubRegistry from '@jbrowse/plugin-trackhub-registry' import Variants from '@jbrowse/plugin-variants' import Wiggle from '@jbrowse/plugin-wiggle' import GCContent from '@jbrowse/plugin-gccontent' @@ -50,7 +49,6 @@ const corePlugins = [ Menus, RDF, Sequence, - TrackHubRegistry, TextIndex, Variants, Wiggle, diff --git a/products/jbrowse-web/package.json b/products/jbrowse-web/package.json index ce929ca3f2..e035f39742 100644 --- a/products/jbrowse-web/package.json +++ b/products/jbrowse-web/package.json @@ -44,7 +44,6 @@ "@jbrowse/plugin-spreadsheet-view": "^2.2.2", "@jbrowse/plugin-sv-inspector": "^2.2.2", "@jbrowse/plugin-svg": "^2.2.2", - "@jbrowse/plugin-trackhub-registry": "^2.2.2", "@jbrowse/plugin-trix": "^2.2.2", "@jbrowse/plugin-variants": "^2.2.2", "@jbrowse/plugin-wiggle": "^2.2.2", diff --git a/products/jbrowse-web/src/corePlugins.ts b/products/jbrowse-web/src/corePlugins.ts index 62815bc4d1..311df6f256 100644 --- a/products/jbrowse-web/src/corePlugins.ts +++ b/products/jbrowse-web/src/corePlugins.ts @@ -18,7 +18,6 @@ import Menus from '@jbrowse/plugin-menus' import RDF from '@jbrowse/plugin-rdf' import Sequence from '@jbrowse/plugin-sequence' import SVG from '@jbrowse/plugin-svg' -import TrackHubRegistry from '@jbrowse/plugin-trackhub-registry' import Variants from '@jbrowse/plugin-variants' import Wiggle from '@jbrowse/plugin-wiggle' import GCContent from '@jbrowse/plugin-gccontent' @@ -47,7 +46,6 @@ const corePlugins = [ Menus, RDF, Sequence, - TrackHubRegistry, Variants, Wiggle, GCContent,