@jbrowse/cli 4.3.0 → 5.0.0-beta.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.
- package/README.md +331 -57
- package/bin/run +1 -1
- package/bundle/index.js +457 -2574
- package/dist/base.js +0 -3
- package/dist/bin.js +2 -1
- package/dist/cliFetch.js +3 -0
- package/dist/commands/add-assembly/index.js +46 -19
- package/dist/commands/add-assembly/utils.js +204 -290
- package/dist/commands/add-connection.js +73 -79
- package/dist/commands/add-track-json.js +24 -12
- package/dist/commands/add-track-utils/adapter-utils.js +173 -288
- package/dist/commands/add-track-utils/file-operations.js +27 -11
- package/dist/commands/add-track-utils/multiwig.js +47 -0
- package/dist/commands/add-track-utils/track-config.js +68 -25
- package/dist/commands/add-track-utils/validators.js +36 -20
- package/dist/commands/add-track.js +178 -62
- package/dist/commands/admin-server/index.js +30 -49
- package/dist/commands/admin-server/utils.js +235 -125
- package/dist/commands/create.js +18 -34
- package/dist/commands/make-pif/cigar-utils.js +62 -19
- package/dist/commands/make-pif/index.js +98 -11
- package/dist/commands/make-pif/pif-generator.js +276 -42
- package/dist/commands/process-utils.js +13 -2
- package/dist/commands/remove-track.js +20 -13
- package/dist/commands/set-default-session.js +35 -31
- package/dist/commands/shared/config-operations.js +3 -10
- package/dist/commands/shared/sort-utils.js +67 -10
- package/dist/commands/shared/validators.js +38 -3
- package/dist/commands/sort-bed.js +2 -33
- package/dist/commands/sort-gff.js +2 -33
- package/dist/commands/text-index/adapter-utils.js +6 -23
- package/dist/commands/text-index/aggregate.js +40 -34
- package/dist/commands/text-index/command.js +35 -7
- package/dist/commands/text-index/config-utils.js +60 -83
- package/dist/commands/text-index/file-list.js +32 -18
- package/dist/commands/text-index/index.js +4 -4
- package/dist/commands/text-index/indexing-utils.js +49 -73
- package/dist/commands/text-index/per-track.js +44 -31
- package/dist/commands/text-index/validators.js +1 -1
- package/dist/commands/upgrade.js +20 -32
- package/dist/commands/validate/configManifest.generated.js +5394 -0
- package/dist/commands/validate/displayDefaultKeys.js +28 -0
- package/dist/commands/validate/index.js +97 -0
- package/dist/commands/validate/suggest.js +35 -0
- package/dist/commands/validate/types.js +6 -0
- package/dist/commands/validate/validateConfig.js +457 -0
- package/dist/index.js +99 -50
- package/dist/types/common.js +3 -27
- package/dist/utils.js +309 -128
- package/dist/version.js +1 -1
- package/package.json +8 -10
- package/dist/commands/make-pif/file-utils.js +0 -30
- package/dist/commands/track-utils.js +0 -74
- package/dist/util.js +0 -35
package/dist/util.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { createReadStream } from 'fs';
|
|
2
|
-
import { stat } from 'fs/promises';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { Readable } from 'stream';
|
|
5
|
-
import { createRemoteStream, isURL } from "./types/common.js";
|
|
6
|
-
export async function getLocalOrRemoteStream(uri, out) {
|
|
7
|
-
if (isURL(uri)) {
|
|
8
|
-
const result = await createRemoteStream(uri);
|
|
9
|
-
return {
|
|
10
|
-
totalBytes: +(result.headers.get('Content-Length') || 0),
|
|
11
|
-
stream: result.body,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
const filename = path.isAbsolute(uri) ? uri : path.join(out, uri);
|
|
16
|
-
const stats = await stat(filename);
|
|
17
|
-
const nodeStream = createReadStream(filename);
|
|
18
|
-
return {
|
|
19
|
-
totalBytes: stats.size,
|
|
20
|
-
stream: Readable.toWeb(nodeStream),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export function decodeURIComponentNoThrow(uri) {
|
|
25
|
-
if (!uri.includes('%')) {
|
|
26
|
-
return uri;
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
return decodeURIComponent(uri);
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
// avoid throwing exception on a failure to decode URI component
|
|
33
|
-
return uri;
|
|
34
|
-
}
|
|
35
|
-
}
|