@jbrowse/plugin-legacy-jbrowse 2.10.2 → 2.11.0

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.
@@ -293,10 +293,11 @@ function regularizeClass(root, className) {
293
293
  return className;
294
294
  }
295
295
  function guessStoreClass(trackConfig, urlTemplate) {
296
+ var _a, _b;
296
297
  if (!trackConfig) {
297
298
  return '';
298
299
  }
299
- if (trackConfig.type && trackConfig.type.includes('/FixedImage')) {
300
+ if ((_a = trackConfig.type) === null || _a === void 0 ? void 0 : _a.includes('/FixedImage')) {
300
301
  return `JBrowse/Store/TiledImage/Fixed${trackConfig.backendVersion === 0 ? '_v0' : ''}`;
301
302
  }
302
303
  if (/\.jsonz?$/i.test(urlTemplate)) {
@@ -338,7 +339,7 @@ function guessStoreClass(trackConfig, urlTemplate) {
338
339
  if (/\.2bit$/i.test(urlTemplate)) {
339
340
  return 'JBrowse/Store/SeqFeature/TwoBit';
340
341
  }
341
- if (trackConfig.type && trackConfig.type.endsWith('/Sequence')) {
342
+ if ((_b = trackConfig.type) === null || _b === void 0 ? void 0 : _b.endsWith('/Sequence')) {
342
343
  return 'JBrowse/Store/Sequence/StaticChunked';
343
344
  }
344
345
  return '';
@@ -5,7 +5,7 @@ const io_1 = require("@jbrowse/core/util/io");
5
5
  const util_1 = require("@jbrowse/core/util");
6
6
  const tracks_1 = require("@jbrowse/core/util/tracks");
7
7
  function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
8
- var _a;
8
+ var _a, _b, _c, _d, _e;
9
9
  const jb2TrackConfig = {
10
10
  trackId: (0, util_1.objectHash)(jb1TrackConfig),
11
11
  name: jb1TrackConfig.key || jb1TrackConfig.label,
@@ -19,7 +19,7 @@ function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
19
19
  jb2TrackConfig.category = category ? category.split(/\s*\/\s*/) : [];
20
20
  const { storeClass } = jb1TrackConfig;
21
21
  if (!jb1TrackConfig.urlTemplate) {
22
- if (!(storeClass && storeClass.endsWith('FromConfig'))) {
22
+ if (!(storeClass === null || storeClass === void 0 ? void 0 : storeClass.endsWith('FromConfig'))) {
23
23
  const trackIdentifier = jb1TrackConfig.key || jb1TrackConfig.label;
24
24
  console.warn(`Could not import JBrowse1 track "${trackIdentifier}" because it does not have a "urlTemplate" or is not a "FromConfig" track`);
25
25
  return (0, tracks_1.generateUnsupportedTrackConf)(jb2TrackConfig.name, trackIdentifier, jb2TrackConfig.category);
@@ -99,11 +99,10 @@ function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
99
99
  }
100
100
  if (storeClass === 'JBrowse/Store/SeqFeature/BigWig' ||
101
101
  storeClass === 'JBrowse/Store/BigWig') {
102
- if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('XYPlot')) {
102
+ if ((_b = jb1TrackConfig.type) === null || _b === void 0 ? void 0 : _b.endsWith('XYPlot')) {
103
103
  jb2TrackConfig.defaultRendering = 'xyplot';
104
104
  }
105
- else if (jb1TrackConfig.type &&
106
- jb1TrackConfig.type.endsWith('Density')) {
105
+ else if ((_c = jb1TrackConfig.type) === null || _c === void 0 ? void 0 : _c.endsWith('Density')) {
107
106
  jb2TrackConfig.defaultRendering = 'density';
108
107
  }
109
108
  return {
@@ -330,10 +329,10 @@ function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
330
329
  }
331
330
  jb2TrackConfig.type = (0, tracks_1.guessTrackType)(jb2TrackConfig.adapter.type);
332
331
  if (jb2TrackConfig.type === 'QuantitativeTrack') {
333
- if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('XYPlot')) {
332
+ if ((_d = jb1TrackConfig.type) === null || _d === void 0 ? void 0 : _d.endsWith('XYPlot')) {
334
333
  jb2TrackConfig.defaultRendering = 'xyplot';
335
334
  }
336
- else if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('Density')) {
335
+ else if ((_e = jb1TrackConfig.type) === null || _e === void 0 ? void 0 : _e.endsWith('Density')) {
337
336
  jb2TrackConfig.defaultRendering = 'density';
338
337
  }
339
338
  }
@@ -65,7 +65,7 @@ function default_1(pluginManager) {
65
65
  }
66
66
  catch (error) {
67
67
  console.error(error);
68
- session.notify(`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');
68
+ 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);
69
69
  (_b = session.breakConnection) === null || _b === void 0 ? void 0 : _b.call(session, self.configuration);
70
70
  }
71
71
  },
@@ -284,10 +284,11 @@ function regularizeClass(root, className) {
284
284
  return className;
285
285
  }
286
286
  function guessStoreClass(trackConfig, urlTemplate) {
287
+ var _a, _b;
287
288
  if (!trackConfig) {
288
289
  return '';
289
290
  }
290
- if (trackConfig.type && trackConfig.type.includes('/FixedImage')) {
291
+ if ((_a = trackConfig.type) === null || _a === void 0 ? void 0 : _a.includes('/FixedImage')) {
291
292
  return `JBrowse/Store/TiledImage/Fixed${trackConfig.backendVersion === 0 ? '_v0' : ''}`;
292
293
  }
293
294
  if (/\.jsonz?$/i.test(urlTemplate)) {
@@ -329,7 +330,7 @@ function guessStoreClass(trackConfig, urlTemplate) {
329
330
  if (/\.2bit$/i.test(urlTemplate)) {
330
331
  return 'JBrowse/Store/SeqFeature/TwoBit';
331
332
  }
332
- if (trackConfig.type && trackConfig.type.endsWith('/Sequence')) {
333
+ if ((_b = trackConfig.type) === null || _b === void 0 ? void 0 : _b.endsWith('/Sequence')) {
333
334
  return 'JBrowse/Store/Sequence/StaticChunked';
334
335
  }
335
336
  return '';
@@ -2,7 +2,7 @@ import { openLocation } from '@jbrowse/core/util/io';
2
2
  import { objectHash } from '@jbrowse/core/util';
3
3
  import { generateUnknownTrackConf, generateUnsupportedTrackConf, guessAdapter, guessTrackType, UNKNOWN, UNSUPPORTED, } from '@jbrowse/core/util/tracks';
4
4
  export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
5
- var _a;
5
+ var _a, _b, _c, _d, _e;
6
6
  const jb2TrackConfig = {
7
7
  trackId: objectHash(jb1TrackConfig),
8
8
  name: jb1TrackConfig.key || jb1TrackConfig.label,
@@ -16,7 +16,7 @@ export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
16
16
  jb2TrackConfig.category = category ? category.split(/\s*\/\s*/) : [];
17
17
  const { storeClass } = jb1TrackConfig;
18
18
  if (!jb1TrackConfig.urlTemplate) {
19
- if (!(storeClass && storeClass.endsWith('FromConfig'))) {
19
+ if (!(storeClass === null || storeClass === void 0 ? void 0 : storeClass.endsWith('FromConfig'))) {
20
20
  const trackIdentifier = jb1TrackConfig.key || jb1TrackConfig.label;
21
21
  console.warn(`Could not import JBrowse1 track "${trackIdentifier}" because it does not have a "urlTemplate" or is not a "FromConfig" track`);
22
22
  return generateUnsupportedTrackConf(jb2TrackConfig.name, trackIdentifier, jb2TrackConfig.category);
@@ -96,11 +96,10 @@ export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
96
96
  }
97
97
  if (storeClass === 'JBrowse/Store/SeqFeature/BigWig' ||
98
98
  storeClass === 'JBrowse/Store/BigWig') {
99
- if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('XYPlot')) {
99
+ if ((_b = jb1TrackConfig.type) === null || _b === void 0 ? void 0 : _b.endsWith('XYPlot')) {
100
100
  jb2TrackConfig.defaultRendering = 'xyplot';
101
101
  }
102
- else if (jb1TrackConfig.type &&
103
- jb1TrackConfig.type.endsWith('Density')) {
102
+ else if ((_c = jb1TrackConfig.type) === null || _c === void 0 ? void 0 : _c.endsWith('Density')) {
104
103
  jb2TrackConfig.defaultRendering = 'density';
105
104
  }
106
105
  return {
@@ -327,10 +326,10 @@ export function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
327
326
  }
328
327
  jb2TrackConfig.type = guessTrackType(jb2TrackConfig.adapter.type);
329
328
  if (jb2TrackConfig.type === 'QuantitativeTrack') {
330
- if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('XYPlot')) {
329
+ if ((_d = jb1TrackConfig.type) === null || _d === void 0 ? void 0 : _d.endsWith('XYPlot')) {
331
330
  jb2TrackConfig.defaultRendering = 'xyplot';
332
331
  }
333
- else if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('Density')) {
332
+ else if ((_e = jb1TrackConfig.type) === null || _e === void 0 ? void 0 : _e.endsWith('Density')) {
334
333
  jb2TrackConfig.defaultRendering = 'density';
335
334
  }
336
335
  }
@@ -37,7 +37,7 @@ export default function (pluginManager) {
37
37
  }
38
38
  catch (error) {
39
39
  console.error(error);
40
- session.notify(`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');
40
+ 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);
41
41
  (_b = session.breakConnection) === null || _b === void 0 ? void 0 : _b.call(session, self.configuration);
42
42
  }
43
43
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-legacy-jbrowse",
3
- "version": "2.10.2",
3
+ "version": "2.11.0",
4
4
  "description": "JBrowse 2 plugin for connecting to and reading JBrowse 1 data",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@gmod/nclist": "^0.2.1",
40
- "buffer-crc32": "^0.2.13",
40
+ "buffer-crc32": "^1.0.0",
41
41
  "generic-filehandle": "^3.0.0",
42
42
  "get-value": "^3.0.1",
43
43
  "set-value": "^4.0.1"
@@ -55,5 +55,5 @@
55
55
  "distModule": "esm/index.js",
56
56
  "srcModule": "src/index.ts",
57
57
  "module": "esm/index.js",
58
- "gitHead": "7ca3b7db337ebd88853e2d96cdab940ed550c4fb"
58
+ "gitHead": "3d43a820b9274a6160aa4dc15616147f390d9094"
59
59
  }