react-msaview 5.7.0 → 5.7.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 +1 -1
- package/bundle/index.js +86 -86
- package/bundle/index.js.map +3 -3
- package/dist/fetchUtils.js +15 -1
- package/dist/fetchUtils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/src/fetchUtils.test.ts +17 -0
- package/src/fetchUtils.ts +16 -1
- package/src/version.ts +1 -1
package/dist/fetchUtils.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import { fetchAndMaybeUnzipText
|
|
1
|
+
import { fetchAndMaybeUnzipText } from '@jbrowse/core/util';
|
|
2
|
+
/**
|
|
3
|
+
* Extract the human-readable text from a status value, which core reports
|
|
4
|
+
* either as a bare string or as a `{message, current, total}` progress object.
|
|
5
|
+
*
|
|
6
|
+
* Inlined rather than imported from `@jbrowse/core/util` on purpose:
|
|
7
|
+
* `statusMessageText` is a recent core export, and in the UMD plugin build
|
|
8
|
+
* `@jbrowse/core/util` is an external resolved against whatever core the host
|
|
9
|
+
* jbrowse-web ships. Against an older host this import lands as `undefined` and
|
|
10
|
+
* every download tick throws `statusMessageText is not a function`. Keeping the
|
|
11
|
+
* one-liner local makes the viewer work on old and new hosts alike.
|
|
12
|
+
*/
|
|
13
|
+
function statusMessageText(status) {
|
|
14
|
+
return typeof status === 'string' ? status : status?.message;
|
|
15
|
+
}
|
|
2
16
|
/**
|
|
3
17
|
* Fetch text from a filehandle while reporting download/unzip progress through
|
|
4
18
|
* setStatus, and wiring a Cancel handler that aborts the underlying request.
|
package/dist/fetchUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchUtils.js","sourceRoot":"","sources":["../src/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fet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
|
|
|
1
|
-
export const version = '5.7.
|
|
1
|
+
export const version = '5.7.1';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-msaview",
|
|
3
3
|
"author": "Colin",
|
|
4
|
-
"version": "5.7.
|
|
4
|
+
"version": "5.7.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"colord": "^2.9.3",
|
|
44
44
|
"flatbush": "^4.6.2",
|
|
45
|
-
"@jbrowse/svgcanvas": "5.7.
|
|
46
|
-
"msa-parsers": "5.7.
|
|
45
|
+
"@jbrowse/svgcanvas": "5.7.1",
|
|
46
|
+
"msa-parsers": "5.7.1"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"clean": "rimraf dist bundle",
|
package/src/fetchUtils.test.ts
CHANGED
|
@@ -30,6 +30,23 @@ describe('fetchTextWithProgress', () => {
|
|
|
30
30
|
])
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
+
test('reports the message from a determinate progress status', async () => {
|
|
34
|
+
const statuses: (FetchStatus | undefined)[] = []
|
|
35
|
+
await fetchTextWithProgress(
|
|
36
|
+
loc,
|
|
37
|
+
s => statuses.push(s),
|
|
38
|
+
async (_loc, opts) => {
|
|
39
|
+
opts.statusCallback({
|
|
40
|
+
message: 'Downloading file',
|
|
41
|
+
current: 5,
|
|
42
|
+
total: 10,
|
|
43
|
+
})
|
|
44
|
+
return 'GREETINGS'
|
|
45
|
+
},
|
|
46
|
+
)
|
|
47
|
+
expect(statuses[0]?.msg).toBe('Downloading file')
|
|
48
|
+
})
|
|
49
|
+
|
|
33
50
|
test('clears status even when the fetch throws', async () => {
|
|
34
51
|
const statuses: (FetchStatus | undefined)[] = []
|
|
35
52
|
await expect(
|
package/src/fetchUtils.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import { fetchAndMaybeUnzipText
|
|
1
|
+
import { fetchAndMaybeUnzipText } from '@jbrowse/core/util'
|
|
2
2
|
|
|
3
3
|
import type { RpcStatus } from '@jbrowse/core/util'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Extract the human-readable text from a status value, which core reports
|
|
7
|
+
* either as a bare string or as a `{message, current, total}` progress object.
|
|
8
|
+
*
|
|
9
|
+
* Inlined rather than imported from `@jbrowse/core/util` on purpose:
|
|
10
|
+
* `statusMessageText` is a recent core export, and in the UMD plugin build
|
|
11
|
+
* `@jbrowse/core/util` is an external resolved against whatever core the host
|
|
12
|
+
* jbrowse-web ships. Against an older host this import lands as `undefined` and
|
|
13
|
+
* every download tick throws `statusMessageText is not a function`. Keeping the
|
|
14
|
+
* one-liner local makes the viewer work on old and new hosts alike.
|
|
15
|
+
*/
|
|
16
|
+
function statusMessageText(status: RpcStatus | undefined) {
|
|
17
|
+
return typeof status === 'string' ? status : status?.message
|
|
18
|
+
}
|
|
19
|
+
|
|
5
20
|
export interface FetchStatus {
|
|
6
21
|
msg: string
|
|
7
22
|
url?: string
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.7.
|
|
1
|
+
export const version = '5.7.1'
|