Skip to content

Commit bd596ce

Browse files
committed
Update webplugin
- Instead of hello world, provide Dicoogle Health Check, the tutorial webplugin - use parcel to build the plugin
1 parent 8bb7632 commit bd596ce

File tree

12 files changed

+4087
-143
lines changed

12 files changed

+4087
-143
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<directory>src/main/resources/html5/</directory>
2525
</resource>
2626
<resource>
27-
<directory>src/main/resources/webplugin-sample</directory>
27+
<directory>src/main/resources/webplugin-sample/dist</directory>
2828
<targetPath>WebPlugins/webplugin-sample</targetPath>
2929
<filtering>false</filtering>
3030
<includes>

src/main/resources/webplugin-sample/.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
.parcel-cache/
2+
node_modules/
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# demo
2-
> demo
1+
# Dicoogle Health Check web UI plugin
2+
3+
> Checks for issues in the Dicoogle archive.
34
45
This is a web UI menu plugin for Dicoogle.
6+
The development tutorial is available in the [Dicoogle Learning Pack](https://bioinformatics-ua.github.io/dicoogle-learning-pack/docs/webplugins/).
57

68
## Building
79

@@ -11,4 +13,4 @@ npm install
1113

1214
## Deploying
1315

14-
Place `module.js` and `package.json` in a folder in the WebPlugins directory.
16+
Place `dist/module.js` and `dist/package.json` in a folder in the `WebPlugins/` directory.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// This build script updates the output package.json file.
2+
//
3+
// Although using the original package.json file works,
4+
// it is better to provide a simple version to production,
5+
// to reduce size and simplify the plugin.
6+
const fs = require('fs');
7+
const packageJson = require('./package.json');
8+
9+
const {
10+
name,
11+
version,
12+
private,
13+
description,
14+
license,
15+
dicoogle,
16+
} = packageJson;
17+
18+
const out = {
19+
name,
20+
version,
21+
private,
22+
description,
23+
license,
24+
main: dicoogle['module-file'] || 'module.js',
25+
dicoogle,
26+
};
27+
fs.mkdirSync('dist', {recursive: true});
28+
fs.writeFileSync("dist/package.json", JSON.stringify(out, undefined, 2));

src/main/resources/webplugin-sample/dist/module.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "dicoogle-healthcheck",
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "Example web UI plugin for Dicoogle",
6+
"license": "MIT",
7+
"main": "module.js",
8+
"dicoogle": {
9+
"slot-id": "menu",
10+
"caption": "Health Check",
11+
"module-file": "module.js"
12+
}
13+
}

src/main/resources/webplugin-sample/module.js

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)