feat(app): change ohif viewer to ohif app (#3451)

This commit is contained in:
Alireza authored and GitHub committed 2023-06-06 20:06:31 -04:00
1 parent 6715ad9bd6
commit 16afa740b6
333 files changed
+2123 -1149

No files matched your search

+4 -1
View File
@@ -2,7 +2,10 @@ const path = require('path');
const webpackCommon = require('./../../../.webpack/webpack.base.js');
const SRC_DIR = path.join(__dirname, '../src');
const DIST_DIR = path.join(__dirname, '../dist');
const ENTRY = {
app: `${SRC_DIR}/index.tsx`,
};
module.exports = (env, argv) => {
return webpackCommon(env, argv, { SRC_DIR, DIST_DIR });
return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY });
};
+22 -9
View File
@@ -1,6 +1,8 @@
const { merge } = require('webpack-merge');
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
const webpackCommon = require('./../../../.webpack/webpack.base.js');
const pkg = require('./../package.json');
@@ -9,8 +11,14 @@ const ROOT_DIR = path.join(__dirname, './..');
const SRC_DIR = path.join(__dirname, '../src');
const DIST_DIR = path.join(__dirname, '../dist');
const ENTRY = {
app: `${SRC_DIR}/index.js`,
};
const outputName = `ohif-${pkg.name.split('/').pop()}`;
module.exports = (env, argv) => {
const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR });
const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY });
return merge(commonConfig, {
stats: {
@@ -26,23 +34,28 @@ module.exports = (env, argv) => {
},
optimization: {
minimize: true,
sideEffects: true,
sideEffects: false,
},
output: {
path: ROOT_DIR,
library: 'ohifUi',
library: 'ohif-ui',
libraryTarget: 'umd',
filename: pkg.main,
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
externals: [
/\b(dcmjs)/,
/\b(gl-matrix)/,
{
react: 'React',
'react-dom': 'ReactDOM',
},
],
plugins: [
new MiniCssExtractPlugin({
filename: `./dist/[name].css`,
chunkFilename: `./dist/[id].css`,
filename: `./dist/${outputName}.css`,
chunkFilename: `./dist/${outputName}.css`,
}),
// new BundleAnalyzerPlugin({}),
],
});
};
+6 -6
View File
@@ -1,10 +1,10 @@
{
"name": "@ohif/ui",
"version": "2.0.0",
"version": "3.5.0-beta.1",
"description": "A set of React components for Medical Imaging Viewers",
"author": "OHIF Contributors",
"license": "MIT",
"main": "dist/index.umd.js",
"main": "dist/ohif-ui.umd.js",
"module": "src/index.js",
"publishConfig": {
"access": "public"
@@ -37,17 +37,17 @@
"moment": "2.29.4",
"mousetrap": "^1.6.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dates": "^21.8.0",
"react-dnd": "14.0.2",
"react-dnd-html5-backend": "14.0.0",
"react-dom": "^17.0.2",
"react-draggable": "4.4.3",
"react-error-boundary": "^3.1.3",
"react-modal": "3.11.2",
"react-outside-click-handler": "^1.3.0",
"react-select": "3.0.8",
"react-with-direction": "^1.3.1",
"react-window": "^1.8.9",
"react-with-direction": "^1.3.1",
"swiper": "^8.4.2",
"webpack": "^5.81.0"
},
@@ -57,18 +57,18 @@
"@storybook/addon-docs": "^7.0.7",
"@storybook/addon-essentials": "^7.0.7",
"@storybook/addon-links": "^7.0.7",
"@storybook/cli": "^7.0.7",
"@storybook/react": "^7.0.7",
"@storybook/react-webpack5": "^7.0.7",
"@storybook/source-loader": "^7.0.7",
"@storybook/cli": "^7.0.7",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
"dotenv-webpack": "^8.0.1",
"postcss": "^8.4.23",
"postcss-loader": "^7.2.4",
"prop-types": "^15.8.1",
"storybook": "^7.0.7",
"remark-gfm": "^3.0.1",
"storybook": "^7.0.7",
"tailwindcss": "3.2.4"
}
}
@@ -43,7 +43,7 @@ const Row = ({ title, value, link }) => {
);
};
const AboutModal = ({ buildNumber, versionNumber }) => {
const AboutModal = ({ buildNumber, versionNumber, commitHash }) => {
const { os, version, name } = detect();
const browser = `${name[0].toUpperCase()}${name.substr(1)} ${version}`;
@@ -80,16 +80,17 @@ const AboutModal = ({ buildNumber, versionNumber }) => {
<div className="flex flex-col">
<Row
title="Repository URL"
value="https://github.com/OHIF/Viewers/tree/v3-stable"
link="https://github.com/OHIF/Viewers/tree/v3-stable"
value="https://github.com/OHIF/Viewers/"
link="https://github.com/OHIF/Viewers/"
/>
{/* <Row
title="Last Master Commits"
value="https://github.com/OHIF/Viewers/tree/v3-stable"
link="https://github.com/OHIF/Viewers/tree/v3-stable"
value="https://github.com/OHIF/Viewers/"
link="https://github.com/OHIF/Viewers/"
/> */}
<Row title="Version number" value={versionNumber} />
<Row title="Build number" value={buildNumber} />
{buildNumber && <Row title="Build number" value={buildNumber} />}
{commitHash && <Row title="Commit Hash" value={commitHash} />}
<Row title="Browser" value={browser} />
<Row title="OS" value={os} />
</div>
@@ -8,7 +8,7 @@ export const Footer = ({ componentRelativePath }) => {
additional usecases, please send us a pull request. Edit this page on{' '}
<a
className="text-blue-400"
href={`https://github.com/OHIF/Viewers/edit/v3-stable/platform/ui/src/components/${componentRelativePath}`}
href={`https://github.com/OHIF/Viewers/edit/master/platform/ui/src/components/${componentRelativePath}`}
>
Github
</a>
@@ -32,7 +32,7 @@ export const Heading = ({ title, componentRelativePath }) => {
{componentRelativePath && (
<div>
<a
href={`https://github.com/OHIF/Viewers/blob/v3-stable/platform/ui/src/components/${componentRelativePath}`}
href={`https://github.com/OHIF/Viewers/blob/master/platform/ui/src/components/${componentRelativePath}`}
className="text-sm font-normal text-blue-600"
target="_blank"
rel="noopener noreferrer"