@jbrowse/plugin-legacy-jbrowse 3.7.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/esm/JBrowse1Connection/configSchema.d.ts +3 -3
  2. package/esm/JBrowse1Connection/get-value.js +1 -1
  3. package/esm/JBrowse1Connection/index.js +2 -2
  4. package/esm/JBrowse1Connection/jb1ConfigLoad.d.ts +1 -1
  5. package/esm/JBrowse1Connection/jb1ConfigLoad.js +2 -2
  6. package/esm/JBrowse1Connection/jb1ConfigParse.d.ts +1 -1
  7. package/esm/JBrowse1Connection/jb1ConfigParse.js +12 -10
  8. package/esm/JBrowse1Connection/jb1ToJb2.d.ts +2 -3
  9. package/esm/JBrowse1Connection/jb1ToJb2.js +7 -9
  10. package/esm/JBrowse1Connection/model.d.ts +16 -24
  11. package/esm/JBrowse1Connection/model.js +8 -14
  12. package/esm/JBrowse1Connection/util.d.ts +1 -1
  13. package/esm/JBrowse1Connection/util.js +13 -3
  14. package/esm/JBrowse1TextSearchAdapter/HttpMap.js +16 -1
  15. package/esm/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.d.ts +1 -1
  16. package/esm/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.js +3 -1
  17. package/esm/JBrowse1TextSearchAdapter/configSchema.d.ts +2 -2
  18. package/esm/JBrowse1TextSearchAdapter/index.js +2 -2
  19. package/esm/NCListAdapter/NCListAdapter.d.ts +1 -1
  20. package/esm/NCListAdapter/NCListAdapter.js +4 -3
  21. package/esm/NCListAdapter/NCListFeature.js +3 -0
  22. package/esm/NCListAdapter/configSchema.d.ts +2 -2
  23. package/esm/NCListAdapter/index.js +2 -2
  24. package/esm/index.js +5 -8
  25. package/package.json +25 -32
  26. package/dist/GuessNCList/index.d.ts +0 -2
  27. package/dist/GuessNCList/index.js +0 -18
  28. package/dist/JBrowse1Connection/configSchema.d.ts +0 -27
  29. package/dist/JBrowse1Connection/configSchema.js +0 -23
  30. package/dist/JBrowse1Connection/get-value.d.ts +0 -10
  31. package/dist/JBrowse1Connection/get-value.js +0 -86
  32. package/dist/JBrowse1Connection/index.d.ts +0 -2
  33. package/dist/JBrowse1Connection/index.js +0 -19
  34. package/dist/JBrowse1Connection/jb1ConfigLoad.d.ts +0 -36
  35. package/dist/JBrowse1Connection/jb1ConfigLoad.js +0 -253
  36. package/dist/JBrowse1Connection/jb1ConfigParse.d.ts +0 -4
  37. package/dist/JBrowse1Connection/jb1ConfigParse.js +0 -341
  38. package/dist/JBrowse1Connection/jb1ToJb2.d.ts +0 -49
  39. package/dist/JBrowse1Connection/jb1ToJb2.js +0 -408
  40. package/dist/JBrowse1Connection/model.d.ts +0 -75
  41. package/dist/JBrowse1Connection/model.js +0 -82
  42. package/dist/JBrowse1Connection/types.d.ts +0 -91
  43. package/dist/JBrowse1Connection/types.js +0 -2
  44. package/dist/JBrowse1Connection/util.d.ts +0 -8
  45. package/dist/JBrowse1Connection/util.js +0 -86
  46. package/dist/JBrowse1TextSearchAdapter/HttpMap.d.ts +0 -19
  47. package/dist/JBrowse1TextSearchAdapter/HttpMap.js +0 -65
  48. package/dist/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.d.ts +0 -28
  49. package/dist/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.js +0 -58
  50. package/dist/JBrowse1TextSearchAdapter/configSchema.d.ts +0 -21
  51. package/dist/JBrowse1TextSearchAdapter/configSchema.js +0 -24
  52. package/dist/JBrowse1TextSearchAdapter/index.d.ts +0 -2
  53. package/dist/JBrowse1TextSearchAdapter/index.js +0 -49
  54. package/dist/NCListAdapter/NCListAdapter.d.ts +0 -17
  55. package/dist/NCListAdapter/NCListAdapter.js +0 -48
  56. package/dist/NCListAdapter/NCListFeature.d.ts +0 -16
  57. package/dist/NCListAdapter/NCListFeature.js +0 -58
  58. package/dist/NCListAdapter/configSchema.d.ts +0 -15
  59. package/dist/NCListAdapter/configSchema.js +0 -21
  60. package/dist/NCListAdapter/index.d.ts +0 -2
  61. package/dist/NCListAdapter/index.js +0 -52
  62. package/dist/index.d.ts +0 -6
  63. package/dist/index.js +0 -23
@@ -1,4 +1,4 @@
1
- declare const JBrowse1Connection: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
1
+ declare const JBrowse1Connection: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
2
2
  dataDirLocation: {
3
3
  type: string;
4
4
  defaultValue: {
@@ -12,7 +12,7 @@ declare const JBrowse1Connection: import("@jbrowse/core/configuration/configurat
12
12
  type: string;
13
13
  defaultValue: never[];
14
14
  };
15
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
15
+ }, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
16
16
  name: {
17
17
  type: string;
18
18
  defaultValue: string;
@@ -23,5 +23,5 @@ declare const JBrowse1Connection: import("@jbrowse/core/configuration/configurat
23
23
  defaultValue: never[];
24
24
  description: string;
25
25
  };
26
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>, undefined>>;
26
+ }, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>, undefined>>;
27
27
  export default JBrowse1Connection;
@@ -12,7 +12,7 @@ const split = (path, splitChar, options) => {
12
12
  return path.split(splitChar);
13
13
  };
14
14
  const isValid = (key, target = {}, options) => {
15
- if (typeof (options === null || options === void 0 ? void 0 : options.isValid) === 'function') {
15
+ if (typeof options?.isValid === 'function') {
16
16
  return options.isValid(key, target);
17
17
  }
18
18
  return true;
@@ -1,6 +1,6 @@
1
1
  import ConnectionType from '@jbrowse/core/pluggableElementTypes/ConnectionType';
2
- import configSchema from './configSchema';
3
- import modelFactory from './model';
2
+ import configSchema from "./configSchema.js";
3
+ import modelFactory from "./model.js";
4
4
  export default function JBrowse1ConnectionF(pluginManager) {
5
5
  pluginManager.addConnectionType(() => new ConnectionType({
6
6
  name: 'JBrowse1Connection',
@@ -1,4 +1,4 @@
1
- import type { Config, JBLocation } from './types';
1
+ import type { Config, JBLocation } from './types.ts';
2
2
  export declare function fetchJb1(dataRoot?: JBLocation, baseConfig?: Config, baseConfigRoot?: JBLocation): Promise<Config>;
3
3
  export declare function createFinalConfig(baseConfig: Config, defaults?: {
4
4
  tracks: never[];
@@ -1,6 +1,6 @@
1
1
  import { openLocation } from '@jbrowse/core/util/io';
2
- import { parseJB1Conf, parseJB1Json, regularizeConf } from './jb1ConfigParse';
3
- import { deepUpdate, fillTemplate } from './util';
2
+ import { parseJB1Conf, parseJB1Json, regularizeConf } from "./jb1ConfigParse.js";
3
+ import { deepUpdate, fillTemplate } from "./util.js";
4
4
  function isUriLocation(location) {
5
5
  return location.uri !== undefined;
6
6
  }
@@ -1,4 +1,4 @@
1
- import type { Config } from './types';
1
+ import type { Config } from './types.ts';
2
2
  export declare function parseJB1Json(config: Config | string, url: string): Config;
3
3
  export declare function parseJB1Conf(config: string, url: string): Config;
4
4
  export declare function regularizeConf(conf: Config, url: string): Config;
@@ -1,7 +1,7 @@
1
1
  import { objectHash } from '@jbrowse/core/util';
2
2
  import setValue from 'set-value';
3
- import getValue from './get-value';
4
- import { isSource, isTrack } from './util';
3
+ import getValue from "./get-value.js";
4
+ import { isSource, isTrack } from "./util.js";
5
5
  export function parseJB1Json(config, url) {
6
6
  if (typeof config === 'string') {
7
7
  let parsedConf;
@@ -143,7 +143,7 @@ export function regularizeConf(conf, url) {
143
143
  }
144
144
  }
145
145
  const meta = conf.trackMetadata;
146
- if (meta === null || meta === void 0 ? void 0 : meta.sources) {
146
+ if (meta?.sources) {
147
147
  if (typeof meta.sources === 'string') {
148
148
  meta.sources = [meta.sources];
149
149
  }
@@ -184,10 +184,14 @@ export function regularizeConf(conf, url) {
184
184
  if (conf.sourceUrl) {
185
185
  const addBase = [];
186
186
  if (conf.tracks) {
187
- addBase.push(...conf.tracks);
187
+ for (const track of conf.tracks) {
188
+ addBase.push(track);
189
+ }
188
190
  }
189
191
  if (conf.stores) {
190
- addBase.push(...Object.values(conf.stores));
192
+ for (const store of Object.values(conf.stores)) {
193
+ addBase.push(store);
194
+ }
191
195
  }
192
196
  if (conf.names) {
193
197
  addBase.push(conf.names);
@@ -252,11 +256,10 @@ function regularizeClass(root, className) {
252
256
  return className;
253
257
  }
254
258
  function guessStoreClass(trackConfig, urlTemplate) {
255
- var _a, _b;
256
259
  if (!trackConfig) {
257
260
  return '';
258
261
  }
259
- if ((_a = trackConfig.type) === null || _a === void 0 ? void 0 : _a.includes('/FixedImage')) {
262
+ if (trackConfig.type?.includes('/FixedImage')) {
260
263
  return `JBrowse/Store/TiledImage/Fixed${trackConfig.backendVersion === 0 ? '_v0' : ''}`;
261
264
  }
262
265
  if (/\.jsonz?$/i.test(urlTemplate)) {
@@ -298,13 +301,12 @@ function guessStoreClass(trackConfig, urlTemplate) {
298
301
  if (/\.2bit$/i.test(urlTemplate)) {
299
302
  return 'JBrowse/Store/SeqFeature/TwoBit';
300
303
  }
301
- if ((_b = trackConfig.type) === null || _b === void 0 ? void 0 : _b.endsWith('/Sequence')) {
304
+ if (trackConfig.type?.endsWith('/Sequence')) {
302
305
  return 'JBrowse/Store/Sequence/StaticChunked';
303
306
  }
304
307
  return '';
305
308
  }
306
309
  function synthesizeTrackStoreConfig(mainConf, trackConfig) {
307
- var _a;
308
310
  const { urlTemplate = '' } = trackConfig;
309
311
  const storeClass = trackConfig.storeClass
310
312
  ? regularizeClass('JBrowse/Store', trackConfig.storeClass)
@@ -322,7 +324,7 @@ function synthesizeTrackStoreConfig(mainConf, trackConfig) {
322
324
  storeClass === 'JBrowse/Store/SeqFeature/TwoBit' ||
323
325
  storeClass === 'JBrowse/Store/Sequence/TwoBit' ||
324
326
  trackConfig.useAsRefSeqStore) &&
325
- !((_a = mainConf.stores) === null || _a === void 0 ? void 0 : _a.refseqs)
327
+ !mainConf.stores?.refseqs
326
328
  ? 'refseqs'
327
329
  : `store${objectHash(storeConf)}`;
328
330
  if (!mainConf.stores) {
@@ -1,4 +1,4 @@
1
- import type { RefSeqs, Track } from './types';
1
+ import type { RefSeqs, Track } from './types.ts';
2
2
  interface Jb2Track {
3
3
  trackId: string;
4
4
  name: string;
@@ -30,7 +30,6 @@ interface Jb2Adapter {
30
30
  indexType?: string;
31
31
  };
32
32
  rootUrlTemplate?: Jb2Location;
33
- sequenceAdapter?: Jb2Adapter;
34
33
  }
35
34
  interface Jb2Feature {
36
35
  refName: string;
@@ -44,6 +43,6 @@ interface Jb2Location {
44
43
  blobId?: string;
45
44
  locationType?: string;
46
45
  }
47
- export declare function convertTrackConfig(jb1TrackConfig: Track, dataRoot: string, sequenceAdapter: Jb2Adapter): Jb2Track;
46
+ export declare function convertTrackConfig(jb1TrackConfig: Track, dataRoot: string): Jb2Track;
48
47
  export declare function createRefSeqsAdapter(refSeqs: string | RefSeqs): Promise<Jb2Adapter>;
49
48
  export {};
@@ -1,8 +1,7 @@
1
1
  import { objectHash } from '@jbrowse/core/util';
2
2
  import { openLocation } from '@jbrowse/core/util/io';
3
3
  import { UNKNOWN, UNSUPPORTED, generateUnknownTrackConf, generateUnsupportedTrackConf, guessAdapter, guessTrackType, } from '@jbrowse/core/util/tracks';
4
- export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
5
- var _a, _b, _c, _d, _e;
4
+ export function convertTrackConfig(jb1TrackConfig, dataRoot) {
6
5
  const jb2TrackConfig = {
7
6
  trackId: objectHash(jb1TrackConfig),
8
7
  name: jb1TrackConfig.key || jb1TrackConfig.label,
@@ -12,11 +11,11 @@ export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
12
11
  if (description) {
13
12
  jb2TrackConfig.description = description;
14
13
  }
15
- const category = jb1TrackConfig.category || ((_a = jb1TrackConfig.metadata) === null || _a === void 0 ? void 0 : _a.category);
14
+ const category = jb1TrackConfig.category || jb1TrackConfig.metadata?.category;
16
15
  jb2TrackConfig.category = category ? category.split(/\s*\/\s*/) : [];
17
16
  const { storeClass } = jb1TrackConfig;
18
17
  if (!jb1TrackConfig.urlTemplate) {
19
- if (!(storeClass === null || storeClass === void 0 ? void 0 : storeClass.endsWith('FromConfig'))) {
18
+ if (!storeClass?.endsWith('FromConfig')) {
20
19
  const trackIdentifier = jb1TrackConfig.key || jb1TrackConfig.label;
21
20
  console.warn(`Could not import JBrowse1 track "${trackIdentifier}" because it does not have a "urlTemplate" or is not a "FromConfig" track`);
22
21
  return generateUnsupportedTrackConf(jb2TrackConfig.name, trackIdentifier, jb2TrackConfig.category);
@@ -67,7 +66,6 @@ export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
67
66
  const adapter = {
68
67
  type: 'CramAdapter',
69
68
  cramLocation: { uri: urlTemplate, locationType: 'UriLocation' },
70
- sequenceAdapter,
71
69
  craiLocation: jb1TrackConfig.craiUrlTemplate
72
70
  ? {
73
71
  uri: resolveUrlTemplate(jb1TrackConfig.craiUrlTemplate),
@@ -96,10 +94,10 @@ export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
96
94
  }
97
95
  if (storeClass === 'JBrowse/Store/SeqFeature/BigWig' ||
98
96
  storeClass === 'JBrowse/Store/BigWig') {
99
- if ((_b = jb1TrackConfig.type) === null || _b === void 0 ? void 0 : _b.endsWith('XYPlot')) {
97
+ if (jb1TrackConfig.type?.endsWith('XYPlot')) {
100
98
  jb2TrackConfig.defaultRendering = 'xyplot';
101
99
  }
102
- else if ((_c = jb1TrackConfig.type) === null || _c === void 0 ? void 0 : _c.endsWith('Density')) {
100
+ else if (jb1TrackConfig.type?.endsWith('Density')) {
103
101
  jb2TrackConfig.defaultRendering = 'density';
104
102
  }
105
103
  return {
@@ -322,10 +320,10 @@ export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
322
320
  }
323
321
  jb2TrackConfig.type = guessTrackType(jb2TrackConfig.adapter.type);
324
322
  if (jb2TrackConfig.type === 'QuantitativeTrack') {
325
- if ((_d = jb1TrackConfig.type) === null || _d === void 0 ? void 0 : _d.endsWith('XYPlot')) {
323
+ if (jb1TrackConfig.type?.endsWith('XYPlot')) {
326
324
  jb2TrackConfig.defaultRendering = 'xyplot';
327
325
  }
328
- else if ((_e = jb1TrackConfig.type) === null || _e === void 0 ? void 0 : _e.endsWith('Density')) {
326
+ else if (jb1TrackConfig.type?.endsWith('Density')) {
329
327
  jb2TrackConfig.defaultRendering = 'density';
330
328
  }
331
329
  }
@@ -1,8 +1,8 @@
1
1
  import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
3
- name: import("mobx-state-tree").ISimpleType<string>;
4
- tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
5
- configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
+ export default function stateModelFactory(pluginManager: PluginManager): import("@jbrowse/mobx-state-tree").IModelType<{
3
+ name: import("@jbrowse/mobx-state-tree").ISimpleType<string>;
4
+ tracks: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IAnyModelType>;
5
+ configuration: import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaType<{
6
6
  name: {
7
7
  type: string;
8
8
  defaultValue: string;
@@ -13,9 +13,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
13
13
  defaultValue: never[];
14
14
  description: string;
15
15
  };
16
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
16
+ }, import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, "connectionId">>;
17
17
  } & {
18
- configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
18
+ configuration: import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaType<{
19
19
  dataDirLocation: {
20
20
  type: string;
21
21
  defaultValue: {
@@ -29,7 +29,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
29
29
  type: string;
30
30
  defaultValue: never[];
31
31
  };
32
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
32
+ }, import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaOptions<import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaType<{
33
33
  name: {
34
34
  type: string;
35
35
  defaultValue: string;
@@ -40,36 +40,28 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
40
40
  defaultValue: never[];
41
41
  description: string;
42
42
  };
43
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>, undefined>>;
44
- type: import("mobx-state-tree").ISimpleType<"JBrowse1Connection">;
43
+ }, import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, "connectionId">>, undefined>>;
44
+ type: import("@jbrowse/mobx-state-tree").ISimpleType<"JBrowse1Connection">;
45
45
  }, {
46
46
  connect(_arg: import("@jbrowse/core/configuration").AnyConfigurationModel): void;
47
47
  } & {
48
48
  afterAttach(): void;
49
49
  addTrackConf(trackConf: Record<string, unknown> | ({
50
50
  [x: string]: any;
51
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
51
+ } & import("@jbrowse/mobx-state-tree/dist/internal").NonEmptyObject & {
52
52
  setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
53
53
  [x: string]: any;
54
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
55
- setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
56
- [x: string]: any;
57
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
58
- } & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
59
- } & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)): any;
54
+ } & import("@jbrowse/mobx-state-tree/dist/internal").NonEmptyObject & any & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
55
+ } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)): any;
60
56
  addTrackConfs(trackConfs: (Record<string, unknown> | ({
61
57
  [x: string]: any;
62
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
58
+ } & import("@jbrowse/mobx-state-tree/dist/internal").NonEmptyObject & {
63
59
  setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
64
60
  [x: string]: any;
65
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
66
- setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
67
- [x: string]: any;
68
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
69
- } & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
70
- } & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>))[]): void;
61
+ } & import("@jbrowse/mobx-state-tree/dist/internal").NonEmptyObject & any & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
62
+ } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>))[]): void;
71
63
  setTrackConfs(trackConfs: import("@jbrowse/core/configuration").AnyConfigurationModel[]): void;
72
64
  clear(): void;
73
65
  } & {
74
66
  connect(): Promise<void>;
75
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
67
+ }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
@@ -1,8 +1,8 @@
1
- import { ConfigurationReference, getConf, readConfObject, } from '@jbrowse/core/configuration';
1
+ import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
2
2
  import { BaseConnectionModelFactory } from '@jbrowse/core/pluggableElementTypes/models';
3
3
  import { getSession } from '@jbrowse/core/util';
4
- import { types } from 'mobx-state-tree';
5
- import configSchema from './configSchema';
4
+ import { types } from '@jbrowse/mobx-state-tree';
5
+ import configSchema from "./configSchema.js";
6
6
  export default function stateModelFactory(pluginManager) {
7
7
  return types
8
8
  .compose('JBrowse1Connection', BaseConnectionModelFactory(pluginManager), types.model({
@@ -11,24 +11,18 @@ export default function stateModelFactory(pluginManager) {
11
11
  }))
12
12
  .actions(self => ({
13
13
  async connect() {
14
- var _a, _b;
15
14
  const session = getSession(self);
16
15
  try {
17
16
  const dataDirLocation = getConf(self, 'dataDirLocation');
18
- const { fetchJb1 } = await import('./jb1ConfigLoad');
19
- const { convertTrackConfig } = await import('./jb1ToJb2');
17
+ const { fetchJb1 } = await import("./jb1ConfigLoad.js");
18
+ const { convertTrackConfig } = await import("./jb1ToJb2.js");
20
19
  const config = await fetchJb1(dataDirLocation);
21
20
  const assemblyName = getConf(self, 'assemblyNames')[0];
22
21
  if (!assemblyName) {
23
22
  throw new Error('assembly name required for JBrowse 1 connection');
24
23
  }
25
- const conf = session.assemblies.find(a => readConfObject(a, 'name') === assemblyName);
26
- if (!conf) {
27
- throw new Error(`Assembly "${assemblyName}" not found`);
28
- }
29
- const sequenceAdapter = readConfObject(conf, ['sequence', 'adapter']);
30
- const jb2Tracks = (_a = config.tracks) === null || _a === void 0 ? void 0 : _a.map(jb1Track => ({
31
- ...convertTrackConfig(jb1Track, config.dataRoot || '', sequenceAdapter),
24
+ const jb2Tracks = config.tracks?.map(jb1Track => ({
25
+ ...convertTrackConfig(jb1Track, config.dataRoot || ''),
32
26
  assemblyNames: [assemblyName],
33
27
  }));
34
28
  self.setTrackConfs(jb2Tracks);
@@ -36,7 +30,7 @@ export default function stateModelFactory(pluginManager) {
36
30
  catch (error) {
37
31
  console.error(error);
38
32
  session.notifyError(`There was a problem connecting to the JBrowse 1 data directory "${self.name}". Please make sure you have entered a valid location. The error that was thrown is: "${error}"`, error);
39
- (_b = session.breakConnection) === null || _b === void 0 ? void 0 : _b.call(session, self.configuration);
33
+ session.breakConnection?.(self.configuration);
40
34
  }
41
35
  },
42
36
  }));
@@ -1,4 +1,4 @@
1
- import type { Source, Track } from './types';
1
+ import type { Source, Track } from './types.ts';
2
2
  export declare function isTrack(arg: any): arg is Track;
3
3
  export declare function isSource(arg: any): arg is Source;
4
4
  type Obj = Record<string, any>;
@@ -1,12 +1,17 @@
1
- import getValue from './get-value';
1
+ import getValue from "./get-value.js";
2
2
  export function isTrack(arg) {
3
- return (arg === null || arg === void 0 ? void 0 : arg.label) && typeof arg.label === 'string';
3
+ return arg?.label && typeof arg.label === 'string';
4
4
  }
5
5
  export function isSource(arg) {
6
- return (arg === null || arg === void 0 ? void 0 : arg.url) && typeof arg.url === 'string';
6
+ return arg?.url && typeof arg.url === 'string';
7
7
  }
8
8
  export function deepUpdate(a, b) {
9
9
  for (const prop of Object.keys(b)) {
10
+ if (prop === '__proto__' ||
11
+ prop === 'constructor' ||
12
+ prop === 'prototype') {
13
+ continue;
14
+ }
10
15
  if (prop in a &&
11
16
  typeof b[prop] === 'object' &&
12
17
  typeof a[prop] === 'object') {
@@ -66,6 +71,11 @@ export function structuredClone(src) {
66
71
  function mixin(dest, source, copyFunc) {
67
72
  const empty = {};
68
73
  for (const name in source) {
74
+ if (name === '__proto__' ||
75
+ name === 'constructor' ||
76
+ name === 'prototype') {
77
+ continue;
78
+ }
69
79
  const s = source[name];
70
80
  if (!(name in dest) ||
71
81
  (dest[name] !== s && (!(name in empty) || empty[name] !== s))) {
@@ -1,5 +1,20 @@
1
- import crc32 from 'crc/crc32';
1
+ const crcTable = new Uint32Array(256);
2
+ for (let i = 0; i < 256; i++) {
3
+ let c = i;
4
+ for (let j = 0; j < 8; j++) {
5
+ c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
6
+ }
7
+ crcTable[i] = c;
8
+ }
9
+ function crc32(str) {
10
+ let crc = 0xffffffff;
11
+ for (let i = 0; i < str.length; i++) {
12
+ crc = crcTable[(crc ^ str.charCodeAt(i)) & 0xff] ^ (crc >>> 8);
13
+ }
14
+ return (crc ^ 0xffffffff) >>> 0;
15
+ }
2
16
  export default class HttpMap {
17
+ url;
3
18
  constructor(args) {
4
19
  this.url = args.url.endsWith('/') ? args.url : `${args.url}/`;
5
20
  }
@@ -1,6 +1,6 @@
1
1
  import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
2
2
  import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
- import HttpMap from './HttpMap';
3
+ import HttpMap from './HttpMap.ts';
4
4
  import type PluginManager from '@jbrowse/core/PluginManager';
5
5
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
6
6
  import type { BaseTextSearchAdapter, BaseTextSearchArgs } from '@jbrowse/core/data_adapters/BaseAdapter';
@@ -1,8 +1,10 @@
1
1
  import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
2
2
  import { readConfObject } from '@jbrowse/core/configuration';
3
3
  import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
4
- import HttpMap from './HttpMap';
4
+ import HttpMap from "./HttpMap.js";
5
5
  export default class JBrowse1TextSearchAdapter extends BaseAdapter {
6
+ httpMap;
7
+ tracksNames;
6
8
  constructor(config, getSubAdapter, pluginManager) {
7
9
  super(config, getSubAdapter, pluginManager);
8
10
  const namesIndex = readConfObject(config, 'namesIndexLocation');
@@ -1,4 +1,4 @@
1
- declare const _default: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
1
+ declare const _default: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
2
2
  namesIndexLocation: {
3
3
  type: string;
4
4
  defaultValue: {
@@ -17,5 +17,5 @@ declare const _default: import("@jbrowse/core/configuration/configurationSchema"
17
17
  defaultValue: never[];
18
18
  description: string;
19
19
  };
20
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "textSearchAdapterId">>;
20
+ }, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "textSearchAdapterId">>;
21
21
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import TextSearchAdapterType from '@jbrowse/core/pluggableElementTypes/TextSearchAdapterType';
2
- import configSchema from './configSchema';
2
+ import configSchema from "./configSchema.js";
3
3
  export default function JBrowse1TextSearchAdapterF(pluginManager) {
4
4
  pluginManager.addTextSearchAdapterType(() => new TextSearchAdapterType({
5
5
  name: 'JBrowse1TextSearchAdapter',
6
6
  configSchema,
7
7
  description: 'A JBrowse 1 text search adapter',
8
- getAdapterClass: () => import('./JBrowse1TextSearchAdapter').then(t => t.default),
8
+ getAdapterClass: () => import("./JBrowse1TextSearchAdapter.js").then(t => t.default),
9
9
  }));
10
10
  }
@@ -1,5 +1,5 @@
1
1
  import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import NCListFeature from './NCListFeature';
2
+ import NCListFeature from './NCListFeature.ts';
3
3
  import type PluginManager from '@jbrowse/core/PluginManager';
4
4
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
5
5
  import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
@@ -3,8 +3,10 @@ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
3
3
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
4
4
  import { checkStopToken } from '@jbrowse/core/util/stopToken';
5
5
  import { RemoteFile } from 'generic-filehandle2';
6
- import NCListFeature from './NCListFeature';
6
+ import NCListFeature from "./NCListFeature.js";
7
7
  export default class NCListAdapter extends BaseFeatureDataAdapter {
8
+ nclist;
9
+ configRefNames;
8
10
  constructor(config, getSubAdapter, pluginManager) {
9
11
  super(config, getSubAdapter, pluginManager);
10
12
  const refNames = this.getConf('refNames');
@@ -32,9 +34,8 @@ export default class NCListAdapter extends BaseFeatureDataAdapter {
32
34
  return new NCListFeature(ncFeature, undefined, `${this.id}-${ncFeature.id()}`);
33
35
  }
34
36
  async hasDataForRefName(refName) {
35
- var _a;
36
37
  const root = await this.nclist.getDataRoot(refName);
37
- return !!((_a = root === null || root === void 0 ? void 0 : root.stats) === null || _a === void 0 ? void 0 : _a.featureCount);
38
+ return !!root?.stats?.featureCount;
38
39
  }
39
40
  async getRefNames() {
40
41
  return this.configRefNames || [];
@@ -1,6 +1,9 @@
1
1
  const jb2ToJb1 = { refName: 'seq_id' };
2
2
  const jb1ToJb2 = { seq_id: 'refName' };
3
3
  export default class NCListFeature {
4
+ ncFeature;
5
+ parentHandle;
6
+ uniqueId;
4
7
  constructor(ncFeature, parent, id) {
5
8
  this.ncFeature = ncFeature;
6
9
  this.uniqueId = id || ncFeature.id();
@@ -1,4 +1,4 @@
1
- declare const NCListAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
1
+ declare const NCListAdapter: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
2
2
  rootUrlTemplate: {
3
3
  type: string;
4
4
  defaultValue: {
@@ -11,5 +11,5 @@ declare const NCListAdapter: import("@jbrowse/core/configuration/configurationSc
11
11
  defaultValue: never[];
12
12
  description: string;
13
13
  };
14
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
14
+ }, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
15
15
  export default NCListAdapter;
@@ -1,5 +1,5 @@
1
1
  import { AdapterType } from '@jbrowse/core/pluggableElementTypes';
2
- import configSchema from './configSchema';
2
+ import configSchema from "./configSchema.js";
3
3
  export default function NCListAdapterF(pluginManager) {
4
4
  pluginManager.addAdapterType(() => new AdapterType({
5
5
  name: 'NCListAdapter',
@@ -8,6 +8,6 @@ export default function NCListAdapterF(pluginManager) {
8
8
  adapterMetadata: {
9
9
  category: 'Uncommon',
10
10
  },
11
- getAdapterClass: () => import('./NCListAdapter').then(r => r.default),
11
+ getAdapterClass: () => import("./NCListAdapter.js").then(r => r.default),
12
12
  }));
13
13
  }
package/esm/index.js CHANGED
@@ -1,13 +1,10 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import GuessNCListF from './GuessNCList';
3
- import JBrowse1ConnectionF from './JBrowse1Connection';
4
- import JBrowse1TextSearchAdapterF from './JBrowse1TextSearchAdapter';
5
- import NCListAdapterF from './NCListAdapter';
2
+ import GuessNCListF from "./GuessNCList/index.js";
3
+ import JBrowse1ConnectionF from "./JBrowse1Connection/index.js";
4
+ import JBrowse1TextSearchAdapterF from "./JBrowse1TextSearchAdapter/index.js";
5
+ import NCListAdapterF from "./NCListAdapter/index.js";
6
6
  export default class LegacyJBrowsePlugin extends Plugin {
7
- constructor() {
8
- super(...arguments);
9
- this.name = 'LegacyJBrowsePlugin';
10
- }
7
+ name = 'LegacyJBrowsePlugin';
11
8
  install(pluginManager) {
12
9
  NCListAdapterF(pluginManager);
13
10
  GuessNCListF(pluginManager);