@sjcrh/proteinpaint-front 2.215.0 → 2.216.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/bundles.tgz +0 -0
- package/init.js +22 -8
- package/package.json +3 -3
- package/public/cards/BCF.json +1 -0
- package/public/cards/bedj.json +1 -0
- package/public/cards/bigwig.json +1 -0
- package/src/index.js +45 -1
package/bundles.tgz
CHANGED
|
Binary file
|
package/init.js
CHANGED
|
@@ -36,23 +36,27 @@ const BIN_READY = `${BIN_DIR}/.pp-bundle-ready`
|
|
|
36
36
|
|
|
37
37
|
console.log('CWD', CWD)
|
|
38
38
|
try {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
39
|
+
// The public dir and its index.html and cards are optional: when they cannot be added, such as to a public/ mount
|
|
40
|
+
// that this process cannot write to, the server serves the copies in this package instead (see the server's
|
|
41
|
+
// serverconfig frontPublicDir and app.middlewares.js), so a failure is a warning, not an error.
|
|
42
|
+
mayAddToPublic(`make a public directory at ${CWD}`, () => {
|
|
43
|
+
if (!fs.existsSync(PUBLIC_DIR)) fs.mkdirSync(PUBLIC_DIR)
|
|
44
|
+
})
|
|
43
45
|
// index.html / cards are ensured independently of the bundle below (idempotent, and needed even when
|
|
44
46
|
// the bundle is reused), so a skipped regeneration still leaves the public scaffolding in place.
|
|
45
47
|
if (!publicBinOnly) {
|
|
46
|
-
|
|
48
|
+
mayAddToPublic('create a public/index.html file', () => {
|
|
49
|
+
if (fs.existsSync(`${PUBLIC_DIR}/index.html`)) return
|
|
47
50
|
console.log(`creating a public/index.html file`)
|
|
48
51
|
fs.copyFileSync(path.join(__dirname, './public/index.html'), `${PUBLIC_DIR}/index.html`)
|
|
49
|
-
}
|
|
50
|
-
|
|
52
|
+
})
|
|
53
|
+
mayAddToPublic('copy cards into the public/cards folder', () => {
|
|
54
|
+
if (fs.existsSync(`${PUBLIC_DIR}/cards`)) return
|
|
51
55
|
console.log(`Copying cards into public/cards folder`)
|
|
52
56
|
execSync(`cp -r ${CWD}/node_modules/@sjcrh/proteinpaint-front/public/cards ${PUBLIC_DIR}/cards`, {
|
|
53
57
|
stdio: 'inherit'
|
|
54
58
|
})
|
|
55
|
-
}
|
|
59
|
+
})
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
// Generate the bundle into CWD/bin only if it isn't already there. CWD/bin is in the container's
|
|
@@ -92,3 +96,13 @@ try {
|
|
|
92
96
|
console.error(e)
|
|
93
97
|
throw e
|
|
94
98
|
}
|
|
99
|
+
|
|
100
|
+
function mayAddToPublic(action, fn) {
|
|
101
|
+
try {
|
|
102
|
+
fn()
|
|
103
|
+
} catch (e) {
|
|
104
|
+
console.warn(
|
|
105
|
+
`unable to ${action}, the server serves the proteinpaint-front package copy: ${e.code || e.message || e}`
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcrh/proteinpaint-front",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.216.1",
|
|
4
4
|
"browser": "src/app.js",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": "init.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"test:integration": "echo 'TODO: front integration tests'"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@sjcrh/proteinpaint-client": "2.
|
|
17
|
+
"@sjcrh/proteinpaint-client": "2.216.0",
|
|
18
18
|
"webpack": "^5.76.0",
|
|
19
19
|
"webpack-cli": "^4.9.2",
|
|
20
20
|
"webpack-node-externals": "^3.0.0"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"url": "https://github.com/stjude/proteinpaint",
|
|
33
33
|
"directory": "front"
|
|
34
34
|
},
|
|
35
|
-
"_buildTime": "2026-
|
|
35
|
+
"_buildTime": "2026-10-03T19:06:51Z"
|
|
36
36
|
}
|
package/public/cards/BCF.json
CHANGED
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"label": "Remote BCF file",
|
|
50
|
+
"configFeature": "ALLOW_remotefilefromurl",
|
|
50
51
|
"download": "https://proteinpaint.stjude.org/ppdemo/hg38/bcf/bcfDemoFiles.tar.gz",
|
|
51
52
|
"message": "If the index file is not available at the same URL or named differently, please include <code>.indexURL</code> in the BCF object.",
|
|
52
53
|
"urlparam": "?genome=hg38&gene=p53&mds3bcfurl=remote,https://proteinpaint.stjude.org/ppdemo/hg38/bcf/test.bcf.gz",
|
package/public/cards/bedj.json
CHANGED
package/public/cards/bigwig.json
CHANGED
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"label": "Remote File",
|
|
70
|
+
"configFeature": "ALLOW_remotefilefromurl",
|
|
70
71
|
"urlparam": "?block=on&genome=hg19&bigwigurl=BigWig%20remote%20file,https://hgdownload.soe.ucsc.edu/goldenPath/hg19/phyloP100way/hg19.100way.phyloP100way.bw",
|
|
71
72
|
"runargs":{
|
|
72
73
|
"parseurl": true,
|
package/src/index.js
CHANGED
|
@@ -1 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
import { runproteinpaint } from '@sjcrh/proteinpaint-client'
|
|
2
|
+
export { runproteinpaint }
|
|
3
|
+
|
|
4
|
+
// this entry is only bundled as the PP server's /bin/proteinpaint.js, and so
|
|
5
|
+
// the startup check of this page's client version against the served bundle applies
|
|
6
|
+
runproteinpaint.enableBundleCheck?.()
|
|
7
|
+
mayRetryChunkLoads()
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
Chunk filenames have a content hash (see webpack.config.js). A chunk request may fail when:
|
|
11
|
+
- a new deployment has replaced the chunks that an already loaded page expects, or
|
|
12
|
+
- during a rolling deployment, an updated page requests a new chunk from a host that
|
|
13
|
+
still serves the previous version
|
|
14
|
+
|
|
15
|
+
Retry a failed chunk load, which may reach an updated host in the second case,
|
|
16
|
+
then notify the user if it still fails.
|
|
17
|
+
*/
|
|
18
|
+
function mayRetryChunkLoads() {
|
|
19
|
+
// __webpack_require__ is replaced by webpack with its runtime, which has
|
|
20
|
+
// .e() to load a chunk and .u() to get a chunk's filename
|
|
21
|
+
if (typeof __webpack_require__ != 'function' || !__webpack_require__.e || !__webpack_require__.u) return
|
|
22
|
+
const ensureChunk = __webpack_require__.e
|
|
23
|
+
const getChunkFilename = __webpack_require__.u
|
|
24
|
+
const retryDelays = [1000, 3000] // milliseconds
|
|
25
|
+
const retries = {} // {chunkId: number of retries}
|
|
26
|
+
|
|
27
|
+
// a retried chunk URL has a query parameter, so that a failed response is not reused from a cache
|
|
28
|
+
__webpack_require__.u = chunkId => getChunkFilename(chunkId) + (retries[chunkId] ? `?retry=${retries[chunkId]}` : '')
|
|
29
|
+
|
|
30
|
+
__webpack_require__.e = async (chunkId, ...args) => {
|
|
31
|
+
for (let i = 0; ; i++) {
|
|
32
|
+
try {
|
|
33
|
+
return await ensureChunk(chunkId, ...args)
|
|
34
|
+
} catch (e) {
|
|
35
|
+
if (e?.name != 'ChunkLoadError') throw e
|
|
36
|
+
if (i >= retryDelays.length) {
|
|
37
|
+
runproteinpaint.onChunkLoadError?.(e)
|
|
38
|
+
throw e
|
|
39
|
+
}
|
|
40
|
+
retries[chunkId] = i + 1
|
|
41
|
+
await new Promise(resolve => setTimeout(resolve, retryDelays[i]))
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|