feat: new Total Metabolic Tumor Volume tmtv (#2866)
* fix: ptDisplaySet metadata problem * fix: typo in xhrHeader field * fix: temporary fix for crosshairs on reload data * fix hotkey bug for input fields * upgrade docusarusu to stable release * circle ci node upgrade * cypress node upgrade * bump node in netlify * bump node version * remove versioned docs * update resources * fix: webpack injection of plugins * fix meaningful label for panels * add reviews and fix cli for creation * copy over chunks if exists in the build * edit templates * edit templates * fix yarn lock * fix(plugin):Deploy on windows is broken Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
This commit is contained in:
1 parent
ae897c47e0
commit
10b4ed5f8c
41 files changed
+2020
-811
No files matched your search
@@ -1,5 +1,6 @@
|
||||
const pluginConfig = require('../pluginConfig.json');
|
||||
const fs = require('fs');
|
||||
const glob = require('glob');
|
||||
|
||||
const autogenerationDisclaimer = `
|
||||
// THIS FILE IS AUTOGENERATED AS PART OF THE EXTENSION AND MODE PLUGIN PROCESS.
|
||||
@@ -44,11 +45,12 @@ function getFormattedImportBlock(importLines) {
|
||||
}
|
||||
|
||||
function getFormattedWindowBlock(addToWindowLines) {
|
||||
let content = "const extensions = [];\n" +
|
||||
"const modes = [];\n" +
|
||||
"const modesFactory = [];\n" +
|
||||
"window.extensions = extensions;\n" +
|
||||
"window.modes = modes;\n\n";
|
||||
let content =
|
||||
'const extensions = [];\n' +
|
||||
'const modes = [];\n' +
|
||||
'const modesFactory = [];\n' +
|
||||
'window.extensions = extensions;\n' +
|
||||
'window.modes = modes;\n\n';
|
||||
|
||||
addToWindowLines.forEach(addToWindowLine => {
|
||||
content += addToWindowLine;
|
||||
@@ -58,34 +60,67 @@ function getFormattedWindowBlock(addToWindowLines) {
|
||||
}
|
||||
|
||||
function getRuntimeLoadModesExtensions() {
|
||||
return "\n\n// Add a dynamic runtime loader\n" +
|
||||
"export default async () => {\n" +
|
||||
" for(const modeFactory of modesFactory) {\n" +
|
||||
" const newModes = await modeFactory(modes,extensions);\n" +
|
||||
" newModes.forEach(newMode => modes.push(newMode));\n" +
|
||||
"}\n}\n";
|
||||
return (
|
||||
'\n\n// Add a dynamic runtime loader\n' +
|
||||
'export default async () => {\n' +
|
||||
' for(const modeFactory of modesFactory) {\n' +
|
||||
' const newModes = await modeFactory(modes,extensions);\n' +
|
||||
' newModes.forEach(newMode => modes.push(newMode));\n' +
|
||||
'}\n}\n'
|
||||
);
|
||||
}
|
||||
|
||||
const createCopyPluginFromExtensions = (SRC_DIR, DIST_DIR, plugins) => {
|
||||
const createCopyPluginToDistForLink = (
|
||||
SRC_DIR,
|
||||
DIST_DIR,
|
||||
plugins,
|
||||
folderName
|
||||
) => {
|
||||
return plugins
|
||||
.map(plugin => {
|
||||
const from = `${SRC_DIR}/../node_modules/${plugin.packageName}/${folderName}/`;
|
||||
const exists = fs.existsSync(from);
|
||||
return exists
|
||||
? {
|
||||
from,
|
||||
to: DIST_DIR,
|
||||
toType: 'dir',
|
||||
}
|
||||
: undefined;
|
||||
})
|
||||
.filter(x => !!x);
|
||||
};
|
||||
|
||||
return plugins.map(plugin => {
|
||||
const from = `${SRC_DIR}/../node_modules/${plugin.packageName}/public/`;
|
||||
const exists = fs.existsSync(from);
|
||||
return exists ? {
|
||||
from,
|
||||
to: DIST_DIR,
|
||||
toType: 'dir',
|
||||
} : undefined;
|
||||
}
|
||||
).filter(x => !!x);
|
||||
}
|
||||
const createCopyPluginToDistForBuild = (
|
||||
SRC_DIR,
|
||||
DIST_DIR,
|
||||
plugins,
|
||||
folderName
|
||||
) => {
|
||||
return plugins
|
||||
.map(plugin => {
|
||||
const from = `${SRC_DIR}/../../../node_modules/${plugin.packageName}/${folderName}/`;
|
||||
const exists = fs.existsSync(from);
|
||||
return exists
|
||||
? {
|
||||
from,
|
||||
to: DIST_DIR,
|
||||
toType: 'dir',
|
||||
}
|
||||
: undefined;
|
||||
})
|
||||
.filter(x => !!x);
|
||||
};
|
||||
|
||||
function writePluginImportsFile(SRC_DIR, DIST_DIR) {
|
||||
let pluginImportsJsContent = autogenerationDisclaimer;
|
||||
|
||||
const extensionLines = constructLines(pluginConfig.extensions, 'extensions');
|
||||
const modeLines = constructLines(pluginConfig.modes, 'modes');
|
||||
const modesFactoryLines = constructLines(pluginConfig.modesFactory, 'modesFactory');
|
||||
const modesFactoryLines = constructLines(
|
||||
pluginConfig.modesFactory,
|
||||
'modesFactory'
|
||||
);
|
||||
|
||||
pluginImportsJsContent += getFormattedImportBlock([
|
||||
...extensionLines.importLines,
|
||||
@@ -112,17 +147,71 @@ function writePluginImportsFile(SRC_DIR, DIST_DIR) {
|
||||
}
|
||||
);
|
||||
|
||||
const copyPluginFromExtensions = createCopyPluginFromExtensions(
|
||||
SRC_DIR, DIST_DIR,
|
||||
// Build packages using cli add-mode and add-extension
|
||||
// will get added to the root node_modules, but the linked packages
|
||||
// will be hosted at the viewer node_modules.
|
||||
|
||||
const copyPluginPublicToDistBuild = createCopyPluginToDistForBuild(
|
||||
SRC_DIR,
|
||||
DIST_DIR,
|
||||
[
|
||||
...pluginConfig.modesFactory,
|
||||
...pluginConfig.modes,
|
||||
...pluginConfig.extensions,
|
||||
...pluginConfig.umd,
|
||||
]
|
||||
)
|
||||
],
|
||||
'public'
|
||||
);
|
||||
|
||||
return copyPluginFromExtensions;
|
||||
const copyPluginPublicToDistLink = createCopyPluginToDistForLink(
|
||||
SRC_DIR,
|
||||
DIST_DIR,
|
||||
[
|
||||
...pluginConfig.modesFactory,
|
||||
...pluginConfig.modes,
|
||||
...pluginConfig.extensions,
|
||||
...pluginConfig.umd,
|
||||
],
|
||||
'public'
|
||||
);
|
||||
|
||||
// Temporary way to copy chunks from the dist folder so that the become
|
||||
// available
|
||||
const copyPluginDistToDistBuild = createCopyPluginToDistForBuild(
|
||||
SRC_DIR,
|
||||
DIST_DIR,
|
||||
[
|
||||
...pluginConfig.modesFactory,
|
||||
...pluginConfig.modes,
|
||||
...pluginConfig.extensions,
|
||||
...pluginConfig.umd,
|
||||
],
|
||||
'dist'
|
||||
);
|
||||
|
||||
const copyPluginDistToDistLink = createCopyPluginToDistForLink(
|
||||
SRC_DIR,
|
||||
DIST_DIR,
|
||||
[
|
||||
...pluginConfig.modesFactory,
|
||||
...pluginConfig.modes,
|
||||
...pluginConfig.extensions,
|
||||
...pluginConfig.umd,
|
||||
],
|
||||
'dist'
|
||||
);
|
||||
|
||||
console.log('copy plugins', [...copyPluginPublicToDistBuild,
|
||||
...copyPluginPublicToDistLink,
|
||||
...copyPluginDistToDistBuild,
|
||||
...copyPluginDistToDistLink,
|
||||
])
|
||||
return [
|
||||
...copyPluginPublicToDistBuild,
|
||||
...copyPluginPublicToDistLink,
|
||||
...copyPluginDistToDistBuild,
|
||||
...copyPluginDistToDistLink,
|
||||
];
|
||||
}
|
||||
|
||||
module.exports = writePluginImportsFile;
|
||||
@@ -20,7 +20,7 @@
|
||||
[build.environment]
|
||||
# If 'production', `yarn install` does not install devDependencies
|
||||
NODE_ENV = "development"
|
||||
NODE_VERSION = "14.19.1"
|
||||
NODE_VERSION = "16.14.0"
|
||||
YARN_VERSION = "1.22.5"
|
||||
RUBY_VERSION = "2.6.2"
|
||||
YARN_FLAGS = "--no-ignore-optional --pure-lockfile"
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
"config-point": "^0.4.8",
|
||||
"core-js": "^3.16.1",
|
||||
"cornerstone-math": "^0.1.9",
|
||||
"cornerstone-wado-image-loader": "^4.2.0",
|
||||
"cornerstone-wado-image-loader": "^4.2.1",
|
||||
"dcmjs": "^0.24.5",
|
||||
"detect-gpu": "^4.0.16",
|
||||
"dicom-parser": "^1.8.9",
|
||||
@@ -90,6 +90,7 @@
|
||||
"cypress-file-upload": "^3.5.3",
|
||||
"identity-obj-proxy": "3.0.x",
|
||||
"lodash": "4.17.15",
|
||||
"glob": "^8.0.3",
|
||||
"tailwindcss": "2.2.4",
|
||||
"terser-webpack-plugin": "^5.1.1",
|
||||
"webpack": "^5.50.0",
|
||||
|
||||
@@ -33,10 +33,12 @@
|
||||
{
|
||||
"packageName": "@ohif/mode-longitudinal",
|
||||
"version": "3.0.0"
|
||||
},
|
||||
{
|
||||
"packageName": "@ohif/mode-tmtv",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"modesFactory": [
|
||||
],
|
||||
"umd": [
|
||||
]
|
||||
"modesFactory": [],
|
||||
"umd": []
|
||||
}
|
||||
Reference in new issue
Block a user