@jbrowse/cli 2.10.3 → 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.
package/README.md CHANGED
@@ -53,7 +53,7 @@ It is likely preferable in most cases to install the tools globally with
53
53
  - [`jbrowse add-track-json TRACK`](#jbrowse-add-track-json-track)
54
54
  - [`jbrowse admin-server`](#jbrowse-admin-server)
55
55
  - [`jbrowse create LOCALPATH`](#jbrowse-create-localpath)
56
- - [`jbrowse help [COMMANDS]`](#jbrowse-help-commands)
56
+ - [`jbrowse help [COMMAND]`](#jbrowse-help-command)
57
57
  - [`jbrowse make-pif FILE`](#jbrowse-make-pif-file)
58
58
  - [`jbrowse remove-track TRACK`](#jbrowse-remove-track-track)
59
59
  - [`jbrowse set-default-session`](#jbrowse-set-default-session)
@@ -205,7 +205,7 @@ EXAMPLES
205
205
  ```
206
206
 
207
207
  _See code:
208
- [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/add-assembly.ts)_
208
+ [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/add-assembly.ts)_
209
209
 
210
210
  ## `jbrowse add-connection CONNECTIONURLORPATH`
211
211
 
@@ -256,7 +256,7 @@ EXAMPLES
256
256
  ```
257
257
 
258
258
  _See code:
259
- [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/add-connection.ts)_
259
+ [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/add-connection.ts)_
260
260
 
261
261
  ## `jbrowse add-track TRACK`
262
262
 
@@ -337,7 +337,7 @@ EXAMPLES
337
337
  ```
338
338
 
339
339
  _See code:
340
- [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/add-track.ts)_
340
+ [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/add-track.ts)_
341
341
 
342
342
  ## `jbrowse add-track-json TRACK`
343
343
 
@@ -367,7 +367,7 @@ EXAMPLES
367
367
  ```
368
368
 
369
369
  _See code:
370
- [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/add-track-json.ts)_
370
+ [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/add-track-json.ts)_
371
371
 
372
372
  ## `jbrowse admin-server`
373
373
 
@@ -399,7 +399,7 @@ EXAMPLES
399
399
  ```
400
400
 
401
401
  _See code:
402
- [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/admin-server.ts)_
402
+ [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/admin-server.ts)_
403
403
 
404
404
  ## `jbrowse create LOCALPATH`
405
405
 
@@ -456,18 +456,18 @@ EXAMPLES
456
456
  ```
457
457
 
458
458
  _See code:
459
- [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/create.ts)_
459
+ [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/create.ts)_
460
460
 
461
- ## `jbrowse help [COMMANDS]`
461
+ ## `jbrowse help [COMMAND]`
462
462
 
463
463
  Display help for jbrowse.
464
464
 
465
465
  ```
466
466
  USAGE
467
- $ jbrowse help [COMMANDS] [-n]
467
+ $ jbrowse help [COMMAND...] [-n]
468
468
 
469
469
  ARGUMENTS
470
- COMMANDS Command to show help for.
470
+ COMMAND... Command to show help for.
471
471
 
472
472
  FLAGS
473
473
  -n, --nested-commands Include all nested commands in the output.
@@ -477,7 +477,7 @@ DESCRIPTION
477
477
  ```
478
478
 
479
479
  _See code:
480
- [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.15/src/commands/help.ts)_
480
+ [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.20/src/commands/help.ts)_
481
481
 
482
482
  ## `jbrowse make-pif FILE`
483
483
 
@@ -507,7 +507,7 @@ EXAMPLES
507
507
  ```
508
508
 
509
509
  _See code:
510
- [src/commands/make-pif.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/make-pif.ts)_
510
+ [src/commands/make-pif.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/make-pif.ts)_
511
511
 
512
512
  ## `jbrowse remove-track TRACK`
513
513
 
@@ -535,7 +535,7 @@ EXAMPLES
535
535
  ```
536
536
 
537
537
  _See code:
538
- [src/commands/remove-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/remove-track.ts)_
538
+ [src/commands/remove-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/remove-track.ts)_
539
539
 
540
540
  ## `jbrowse set-default-session`
541
541
 
@@ -568,7 +568,7 @@ EXAMPLES
568
568
  ```
569
569
 
570
570
  _See code:
571
- [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/set-default-session.ts)_
571
+ [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/set-default-session.ts)_
572
572
 
573
573
  ## `jbrowse sort-gff FILE`
574
574
 
@@ -599,7 +599,7 @@ EXAMPLES
599
599
  ```
600
600
 
601
601
  _See code:
602
- [src/commands/sort-gff.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/sort-gff.ts)_
602
+ [src/commands/sort-gff.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/sort-gff.ts)_
603
603
 
604
604
  ## `jbrowse text-index`
605
605
 
@@ -666,7 +666,7 @@ EXAMPLES
666
666
  ```
667
667
 
668
668
  _See code:
669
- [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/text-index.ts)_
669
+ [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/text-index.ts)_
670
670
 
671
671
  ## `jbrowse upgrade [LOCALPATH]`
672
672
 
@@ -729,7 +729,7 @@ EXAMPLES
729
729
  ```
730
730
 
731
731
  _See code:
732
- [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v2.10.3/products/jbrowse-cli/src/commands/upgrade.ts)_
732
+ [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v2.11.0/products/jbrowse-cli/src/commands/upgrade.ts)_
733
733
 
734
734
  <!-- commandsstop -->
735
735
 
package/lib/base.js CHANGED
@@ -57,6 +57,7 @@ class JBrowseCommand extends core_1.Command {
57
57
  }
58
58
  if (locationUrl) {
59
59
  if (check) {
60
+ // @ts-expect-error
60
61
  const response = await (0, fetchWithProxy_1.default)(locationUrl, { method: 'HEAD' });
61
62
  if (!response.ok) {
62
63
  throw new Error(`${locationUrl} result ${response.statusText}`);
@@ -48,9 +48,11 @@ class AddConnection extends base_1.default {
48
48
  }
49
49
  : {}),
50
50
  connectionId: id,
51
- assemblyNames: assemblyNames || type === 'JBrowse1Connection'
52
- ? [configContents.assemblies[0]?.name]
53
- : undefined,
51
+ assemblyNames: assemblyNames
52
+ ? assemblyNames.split(',')
53
+ : type === 'JBrowse1Connection'
54
+ ? [configContents.assemblies[0]?.name]
55
+ : undefined,
54
56
  ...(config ? (0, json_parse_better_errors_1.default)(config) : {}),
55
57
  };
56
58
  if (!configContents.connections) {
@@ -84,6 +86,7 @@ class AddConnection extends base_1.default {
84
86
  let response;
85
87
  try {
86
88
  if (check) {
89
+ // @ts-expect-error
87
90
  response = await (0, fetchWithProxy_1.default)(locationUrl, { method: 'HEAD' });
88
91
  }
89
92
  if (!response || response.ok) {
@@ -241,7 +241,8 @@ class AddTrack extends base_1.default {
241
241
  /\.vcf$/i.test(location) ||
242
242
  /\.gtf?$/i.test(location) ||
243
243
  /\.gff3?$/i.test(location) ||
244
- /\.chain(\.gz)?$/i.test(location)) {
244
+ /\.chain(\.gz)?$/i.test(location) ||
245
+ /\.hic$/i.test(location)) {
245
246
  return {
246
247
  file: location,
247
248
  };
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_fetch_1 = __importDefault(require("node-fetch"));
7
- const proxy_agent_1 = require("proxy-agent");
3
+ const node_1 = require("node-fetch-native/node");
4
+ const proxy_1 = require("node-fetch-native/proxy");
5
+ const proxy = (0, proxy_1.createProxy)();
8
6
  // The correct proxy `Agent` implementation to use will be determined
9
7
  // via the `http_proxy` / `https_proxy` / `no_proxy` / etc. env vars
8
+ // https://github.com/unjs/node-fetch-native?tab=readme-ov-file#proxy-support
10
9
  function fetchWithProxy(url, options = {}) {
11
- const agent = new proxy_agent_1.ProxyAgent();
12
- return (0, node_fetch_1.default)(url, { agent, ...options });
10
+ return (0, node_1.fetch)(url, { ...options, ...proxy });
13
11
  }
14
12
  exports.default = fetchWithProxy;
@@ -21,11 +21,13 @@ async function* indexGff3({ config, attributesToIndex, inLocation, outLocation,
21
21
  if (!quiet) {
22
22
  progressBar.start(totalBytes, 0);
23
23
  }
24
+ // @ts-expect-error
24
25
  stream.on('data', chunk => {
25
26
  receivedBytes += chunk.length;
26
27
  progressBar.update(receivedBytes);
27
28
  });
28
29
  const rl = readline_1.default.createInterface({
30
+ // @ts-expect-error
29
31
  input: inLocation.match(/.b?gz$/) ? stream.pipe((0, zlib_1.createGunzip)()) : stream,
30
32
  });
31
33
  for await (const line of rl) {
@@ -50,7 +52,7 @@ async function* indexGff3({ config, attributesToIndex, inLocation, outLocation,
50
52
  .map(f => f.split('='))
51
53
  .map(([key, val]) => [
52
54
  key.trim(),
53
- decodeURIComponent(val).trim().split(',').join(' '),
55
+ (0, util_1.decodeURIComponentNoThrow)(val).trim().split(',').join(' '),
54
56
  ]));
55
57
  const attrs = attributesToIndex
56
58
  .map(attr => col9attrs[attr])
@@ -21,12 +21,14 @@ async function* indexVcf({ config, attributesToIndex, inLocation, outLocation, q
21
21
  if (!quiet) {
22
22
  progressBar.start(totalBytes, 0);
23
23
  }
24
+ // @ts-expect-error
24
25
  stream.on('data', chunk => {
25
26
  receivedBytes += chunk.length;
26
27
  progressBar.update(receivedBytes);
27
28
  });
28
29
  const gzStream = inLocation.match(/.b?gz$/)
29
- ? stream.pipe((0, zlib_1.createGunzip)())
30
+ ? // @ts-expect-error
31
+ stream.pipe((0, zlib_1.createGunzip)())
30
32
  : stream;
31
33
  const rl = readline_1.default.createInterface({
32
34
  input: gzStream,
@@ -46,7 +48,9 @@ async function* indexVcf({ config, attributesToIndex, inLocation, outLocation, q
46
48
  .map(f => f.split('='))
47
49
  .map(([key, val]) => [
48
50
  key.trim(),
49
- val ? decodeURIComponent(val).trim().split(',').join(' ') : undefined,
51
+ val
52
+ ? (0, util_1.decodeURIComponentNoThrow)(val).trim().split(',').join(' ')
53
+ : undefined,
50
54
  ]));
51
55
  const end = fields.END;
52
56
  const locStr = `${ref}:${pos}..${end || +pos + 1}`;
package/lib/util.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getLocalOrRemoteStream = void 0;
6
+ exports.decodeURIComponentNoThrow = exports.getLocalOrRemoteStream = void 0;
7
7
  const common_1 = require("./types/common");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
@@ -23,3 +23,13 @@ async function getLocalOrRemoteStream(uri, out) {
23
23
  return { totalBytes, stream };
24
24
  }
25
25
  exports.getLocalOrRemoteStream = getLocalOrRemoteStream;
26
+ function decodeURIComponentNoThrow(uri) {
27
+ try {
28
+ return decodeURIComponent(uri);
29
+ }
30
+ catch (e) {
31
+ // avoid throwing exception on a failure to decode URI component
32
+ return uri;
33
+ }
34
+ }
35
+ exports.decodeURIComponentNoThrow = decodeURIComponentNoThrow;
@@ -1123,5 +1123,5 @@
1123
1123
  ]
1124
1124
  }
1125
1125
  },
1126
- "version": "2.10.3"
1126
+ "version": "2.11.0"
1127
1127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/cli",
3
- "version": "2.10.3",
3
+ "version": "2.11.0",
4
4
  "description": "A command line tool for working with JBrowse 2",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -56,8 +56,7 @@
56
56
  "express": "^4.17.1",
57
57
  "ixixx": "^2.0.1",
58
58
  "json-parse-better-errors": "^1.0.2",
59
- "node-fetch": "^2.6.0",
60
- "proxy-agent": "^6.2.1",
59
+ "node-fetch-native": "^1.6.4",
61
60
  "rimraf": "^5.0.0",
62
61
  "tslib": "^2.3.1"
63
62
  },
@@ -75,5 +74,5 @@
75
74
  "publishConfig": {
76
75
  "access": "public"
77
76
  },
78
- "gitHead": "c8fc800cd17decd72b2e971c7a6add3b95214e72"
77
+ "gitHead": "3d43a820b9274a6160aa4dc15616147f390d9094"
79
78
  }