fix: Allow the mode setup/creation to be async, and provide a few more values to extension/app config/mode setup. (#4016)

This commit is contained in:
Bill Wallace authored and GitHub committed 2024-06-19 09:32:00 -04:00
1 parent 01e200986c
commit 88575c6c09
55 files changed
+2618 -3421

No files matched your search

+3
View File
@@ -108,6 +108,9 @@ module.exports = (env, argv) => {
globOptions: {
ignore: ['**/*.min.js.map'],
},
// The dicom-microscopy-viewer is optional, so if it doeesn't get
// installed, it shouldn't cause issues.
noErrorOnMissing: true,
},
// Copy dicom-image-loader build files
{
+2 -2
View File
@@ -106,10 +106,10 @@ Cypress.Commands.add('isPageLoaded', (url = '/basic-test') => {
Cypress.Commands.add('openStudyList', () => {
cy.initRouteAliases();
cy.visit('/');
cy.visit('/', { timeout: 15000 });
// For some reason cypress 12.x does not like to stub the network request
// so we just wait herer for 1 second
// so we just wait here for 1 second
// cy.wait('@getStudies');
cy.waitQueryList();
});
+7 -15
View File
@@ -75,12 +75,13 @@
"@svgr/webpack": "^8.1.0",
"@types/react": "^18.3.3",
"classnames": "^2.3.2",
"core-js": "^3.16.1",
"core-js": "*",
"cornerstone-math": "^0.1.9",
"dcmjs": "^0.29.12",
"dcmjs": "*",
"detect-gpu": "^4.0.16",
"dicom-parser": "^1.8.9",
"dotenv-webpack": "^1.7.0",
"file-loader": "^6.2.0",
"hammerjs": "^2.0.8",
"history": "^5.3.0",
"i18next": "^17.0.3",
@@ -94,24 +95,15 @@
"react-dropzone": "^10.1.7",
"react-i18next": "^12.2.2",
"react-resize-detector": "^10.0.1",
"react-router": "^6.8.1",
"react-router-dom": "^6.8.1"
"react-router": "^6.23.1",
"react-router-dom": "^6.8.1",
"url-loader": "^4.1.1"
},
"devDependencies": {
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@percy/cypress": "^3.1.1",
"@playwright/test": "^1.44.0",
"@types/node": "^20.12.12",
"cypress": "13.7.2",
"cypress-file-upload": "^3.5.3",
"glob": "^8.0.3",
"identity-obj-proxy": "3.0.x",
"lodash": "^4.17.21",
"tailwindcss": "3.2.4",
"terser-webpack-plugin": "^5.1.1",
"webpack": "^5.50.0",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^4.7.2",
"webpack-merge": "^5.7.3"
"tailwindcss": "3.2.4"
}
}
+2 -2
View File
@@ -41,7 +41,7 @@ async function appInit(appConfigOrFunc, defaultExtensions, defaultModes) {
const appConfig = {
...(typeof appConfigOrFunc === 'function'
? await appConfigOrFunc({ servicesManager })
? await appConfigOrFunc({ servicesManager, loadModules })
: appConfigOrFunc),
};
@@ -113,7 +113,7 @@ async function appInit(appConfigOrFunc, defaultExtensions, defaultModes) {
? appConfig.modesConfiguration[id]
: {};
mode = mode.modeFactory({ modeConfiguration });
mode = await mode.modeFactory({ modeConfiguration, loadModules });
}
if (modesById.has(id)) {
+1 -1
View File
@@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';
import { execa } from 'execa';
import { keywords } from './enums/index.js';
import { validateYarn, addExtensionToConfig, addModeToConfig } from './utils/index.js';
import { validateYarn, addExtensionToConfig, addModeToConfig } from './utils/index';
async function linkPackage(packageDir, options, addToConfig, keyword) {
const { viewerDirectory } = options;
+1 -1
View File
@@ -1,5 +1,5 @@
import fs from 'fs';
import { prettyPrint } from './utils/index.js';
import { prettyPrint } from './utils/index';
import { colors } from './enums/index.js';
const listPlugins = async configPath => {
+1 -1
View File
@@ -1,6 +1,6 @@
import axios from 'axios';
import { prettyPrint } from './utils/index.js';
import { prettyPrint } from './utils/index';
import { keywords, colors, endPoints } from './enums/index.js';
async function searchRegistry(keyword) {
+1 -1
View File
@@ -1,7 +1,7 @@
import { execa } from 'execa';
import fs from 'fs';
import path from 'path';
import { validateYarn, removeExtensionFromConfig, removeModeFromConfig } from './utils/index.js';
import { validateYarn, removeExtensionFromConfig, removeModeFromConfig } from './utils/index';
const linkPackage = async (packageName, options, removeFromConfig) => {
const { viewerDirectory } = options;
@@ -43,7 +43,7 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['react-hot-loader/babel'],
plugins: ['react-refresh/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
@@ -53,10 +53,10 @@
"copy-webpack-plugin": "^10.2.0",
"cross-env": "^7.0.3",
"dotenv": "^14.1.0",
"eslint": "^5.0.1",
"eslint": "^8.39.0",
"eslint-loader": "^2.0.0",
"webpack": "^5.50.0",
"webpack-merge": "^5.7.3",
"webpack-cli": "^4.7.2"
"webpack-cli": "^5.0.2"
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['react-hot-loader/babel'],
plugins: ['react-refresh/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
@@ -42,10 +42,10 @@
"copy-webpack-plugin": "^10.2.0",
"cross-env": "^7.0.3",
"dotenv": "^14.1.0",
"eslint": "^5.0.1",
"eslint": "^8.39.0",
"eslint-loader": "^2.0.0",
"webpack": "^5.50.0",
"webpack-merge": "^5.7.3",
"webpack-cli": "^4.7.2"
"webpack-cli": "^5.0.2"
}
}
+6 -6
View File
@@ -35,28 +35,28 @@
"peerDependencies": {
"@cornerstonejs/codec-charls": "^1.2.3",
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.2",
"@cornerstonejs/codec-openjph": "^2.4.2",
"@cornerstonejs/dicom-image-loader": "^1.77.6",
"@cornerstonejs/codec-openjpeg": "^1.2.3",
"@cornerstonejs/codec-openjph": "^2.4.5",
"@cornerstonejs/dicom-image-loader": "^1.78.1",
"@ohif/ui": "3.9.0-beta.46",
"cornerstone-math": "0.1.9",
"dicom-parser": "^1.8.21"
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"dcmjs": "^0.29.12",
"dcmjs": "*",
"dicomweb-client": "^0.10.4",
"gl-matrix": "^3.4.3",
"isomorphic-base64": "^1.0.2",
"lodash.clonedeep": "^4.5.0",
"lodash.merge": "^4.6.2",
"lodash.mergewith": "^4.6.2",
"moment": "^2.24.0",
"moment": "*",
"object-hash": "2.1.1",
"query-string": "^6.14.0",
"validate.js": "^0.12.0"
},
"devDependencies": {
"webpack-merge": "5.7.3"
"webpack-merge": "*"
}
}
+1 -2
View File
@@ -7,8 +7,8 @@ import type {
BaseDataSourceConfigurationAPI,
BaseDataSourceConfigurationAPIItem,
} from './DataSourceConfigurationAPI';
import type { PresentationIds } from '../services/ViewportGridService';
export type * from '../services/ViewportGridService';
export type * from '../services/CustomizationService/types';
// Separate out some generic types
export type * from './Consumer';
@@ -31,5 +31,4 @@ export {
DataSourceDefinition,
BaseDataSourceConfigurationAPI,
BaseDataSourceConfigurationAPIItem,
PresentationIds,
};
+1 -1
View File
@@ -1,4 +1,4 @@
import * as utils from './index.js';
import * as utils from './index';
describe('Top level exports', () => {
test('should export the modules ', () => {
File renamed without changes.
+1 -1
View File
@@ -28,7 +28,7 @@
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"optionalDependencies": {
"@docusaurus/core": "2.4.3",
"@docusaurus/plugin-client-redirects": "2.4.3",
"@docusaurus/plugin-google-gtag": "2.4.3",
+1 -1
View File
@@ -18,7 +18,7 @@
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-slot": "^1.0.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"clsx": "*",
"cmdk": "^1.0.0",
"date-fns": "^3.6.0",
"framer-motion": "6.2.4",
+1 -1
View File
@@ -44,7 +44,7 @@
"d3-shape": "3",
"d3-zoom": "3",
"lodash.debounce": "4.0.8",
"moment": "2.29.4",
"moment": "*",
"mousetrap": "^1.6.5",
"react": "^18.3.1",
"react-dates": "^21.8.0",