diff --git a/.circleci/build-and-publish-docs.sh b/.circleci/build-and-publish-docs.sh deleted file mode 100644 index f86b3fcc4bd..00000000000 --- a/.circleci/build-and-publish-docs.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -# Set directory to location of this script -# https://stackoverflow.com/a/3355423/1867984 -cd "$(dirname "$0")" - -yarn -v -node -v - -echo 'Installing Gitbook CLI' - -yarn global bin -yarn config get prefix -yarn config set prefix ~/.yarn -export PATH="$PATH:`yarn global bin`" - -echo 'Running Gitbook installation' - -# Generate all version's GitBook output -# For each directory in /docs ... -cd ./../docs/ -for D in *; do - if [ -d "${D}" ]; then - - echo "Generating output for: ${D}" - cd "${D}" - - # Clear previous output, generate new - rm -rf _book - gitbook install - gitbook build - - cd .. - - fi -done - -# Move CNAME File into `latest` -cp CNAME ./latest/_book/CNAME - -# Create a history folder in our latest version's output -mkdir ./latest/_book/history - -# Move each version's files to latest's history folder -for D in *; do - if [ -d "${D}" ]; then - if [ "${D}" == v* ] ; then - - echo "Moving ${D} to the latest version's history folder" - - mkdir "./latest/_book/history/${D}" - cp -v -r "./${D}/_book"/* "./latest/_book/history/${D}" - - fi - fi -done - -# Back to repo root -cd .. - -echo "Done generating documentation output" -echo 'STARTING PUBLISH' - -# WILL ALWAYS FAIL IF INITIATED FROM PR BRANCH -npx gh-pages \ - --silent \ - --repo https://$GITHUB_TOKEN@github.com/OHIF/Viewers.git \ - --message 'Autogenerated Message: [ci skip]' \ - --dist docs/latest/_book diff --git a/.circleci/config.yml b/.circleci/config.yml index 44445737699..de8d0bb6910 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,18 +65,18 @@ jobs: - run: name: 'JavaScript Test Suite' command: yarn run test:unit:ci - # PLATFORM/VIEWER + # platform/app - run: name: 'VIEWER: Combine report output' command: | - viewerCov="/home/circleci/repo/platform/viewer/coverage" + viewerCov="/home/circleci/repo/platform/app/coverage" touch "${viewerCov}/reports" cat "${viewerCov}/clover.xml" >> "${viewerCov}/reports" echo "\<<\<<\<< EOF" >> "${viewerCov}/reports" cat "${viewerCov}/lcov.info" >>"${viewerCov}/reports" echo "\<<\<<\<< EOF" >> "${viewerCov}/reports" - codecov/upload: - file: '/home/circleci/repo/platform/viewer/coverage/reports' + file: '/home/circleci/repo/platform/app/coverage/reports' flags: 'viewer' # PLATFORM/CORE - run: @@ -128,9 +128,9 @@ jobs: # Set our version number using vars echo $CIRCLE_BUILD_NUM # Build our image, auth, and push - docker build --tag ohif/viewer:PR_BUILD-$CIRCLE_BUILD_NUM . + docker build --tag ohif/app:PR_BUILD-$CIRCLE_BUILD_NUM . echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin - docker push ohif/viewer:PR_BUILD-$CIRCLE_BUILD_NUM + docker push ohif/app:PR_BUILD-$CIRCLE_BUILD_NUM ### # Workflow: DEPLOY @@ -161,68 +161,80 @@ jobs: name: 'Build the OHIF Viewer' command: yarn run build no_output_timeout: 45m - # - run: - # name: 'Upload SourceMaps, Send Deploy Notification' - # command: | - # # export FILE_1=$(find ./build/static/js -type f -name "2.*.js" -exec basename {} \;) - # # export FILE_MAIN=$(find ./build/static/js -type f -name "main.*.js" -exec basename {} \;) - # # export FILE_RUNTIME_MAIN=$(find ./build/static/js -type f -name "runtime~main.*.js" -exec basename {} \;) - # # curl https://api.rollbar.com/api/1/sourcemap -F source_map=@build/static/js/$FILE_1.map -F access_token=$ROLLBAR_TOKEN -F version=$CIRCLE_SHA1 -F minified_url=https://$GOOGLE_STORAGE_BUCKET/static/js/$FILE_1 - # # curl https://api.rollbar.com/api/1/sourcemap -F source_map=@build/static/js/$FILE_MAIN.map -F access_token=$ROLLBAR_TOKEN -F version=$CIRCLE_SHA1 -F minified_url=https://$GOOGLE_STORAGE_BUCKET/static/js/$FILE_MAIN - # # curl https://api.rollbar.com/api/1/sourcemap -F source_map=@build/static/js/$FILE_RUNTIME_MAIN.map -F access_token=$ROLLBAR_TOKEN -F version=$CIRCLE_SHA1 -F minified_url=https://$GOOGLE_STORAGE_BUCKET/static/js/$FILE_RUNTIME_MAIN - # curl --request POST https://api.rollbar.com/api/1/deploy/ -F access_token=$ROLLBAR_TOKEN -F environment=$GOOGLE_STORAGE_BUCKET -F revision=$CIRCLE_SHA1 -F local_username=CircleCI + - run: + name: 'Upload SourceMaps, Send Deploy Notification' + command: | + # export FILE_1=$(find ./build/static/js -type f -name "2.*.js" -exec basename {} \;) + # export FILE_MAIN=$(find ./build/static/js -type f -name "main.*.js" -exec basename {} \;) + # export FILE_RUNTIME_MAIN=$(find ./build/static/js -type f -name "runtime~main.*.js" -exec basename {} \;) + # curl https://api.rollbar.com/api/1/sourcemap -F source_map=@build/static/js/$FILE_1.map -F access_token=$ROLLBAR_TOKEN -F version=$CIRCLE_SHA1 -F minified_url=https://$GOOGLE_STORAGE_BUCKET/static/js/$FILE_1 + # curl https://api.rollbar.com/api/1/sourcemap -F source_map=@build/static/js/$FILE_MAIN.map -F access_token=$ROLLBAR_TOKEN -F version=$CIRCLE_SHA1 -F minified_url=https://$GOOGLE_STORAGE_BUCKET/static/js/$FILE_MAIN + # curl https://api.rollbar.com/api/1/sourcemap -F source_map=@build/static/js/$FILE_RUNTIME_MAIN.map -F access_token=$ROLLBAR_TOKEN -F version=$CIRCLE_SHA1 -F minified_url=https://$GOOGLE_STORAGE_BUCKET/static/js/$FILE_RUNTIME_MAIN + curl --request POST https://api.rollbar.com/api/1/deploy/ -F access_token=$ROLLBAR_TOKEN -F environment=$GOOGLE_STORAGE_BUCKET -F revision=$CIRCLE_SHA1 -F local_username=CircleCI # Persist :+1: - persist_to_workspace: root: ~/repo paths: - - platform/viewer/dist + - platform/app/dist - netlify.toml - .netlify - DEPLOY_TO_DEV: - docker: - - image: circleci/node:16.14.0 - environment: - TERM: xterm - NETLIFY_SITE_ID: 32708787-c9b0-4634-b50f-7ca41952da77 - working_directory: ~/repo - steps: - - attach_workspace: - at: ~/repo - - run: cd .netlify && npm install - - run: - cp .netlify/deploy-workflow/_redirects platform/viewer/dist/_redirects - - run: cd .netlify && npm run deploy + # DEPLOY_TO_DEV: + # docker: + # - image: circleci/node:16.14.0 + # environment: + # TERM: xterm + # NETLIFY_SITE_ID: 32708787-c9b0-4634-b50f-7ca41952da77 + # working_directory: ~/repo + # steps: + # - attach_workspace: + # at: ~/repo + # - run: cd .netlify && npm install + # - run: cp .netlify/deploy-workflow/_redirects platform/app/dist/_redirects + # - run: cd .netlify && npm run deploy - DEPLOY_TO_STAGING: - docker: - - image: circleci/node:16.14.0 - environment: - TERM: xterm - NETLIFY_SITE_ID: c7502ae3-b150-493c-8422-05701e44a969 - working_directory: ~/repo - steps: - - attach_workspace: - at: ~/repo - - run: cd .netlify && npm install - - run: - cp .netlify/deploy-workflow/_redirects platform/viewer/dist/_redirects - - run: cd .netlify && npm run deploy + # DEPLOY_TO_STAGING: + # docker: + # - image: circleci/node:16.14.0 + # environment: + # TERM: xterm + # NETLIFY_SITE_ID: c7502ae3-b150-493c-8422-05701e44a969 + # working_directory: ~/repo + # steps: + # - attach_workspace: + # at: ~/repo + # - run: cd .netlify && npm install + # - run: cp .netlify/deploy-workflow/_redirects platform/app/dist/_redirects + # - run: cd .netlify && npm run deploy - DEPLOY_TO_PRODUCTION: - docker: - - image: circleci/node:16.14.0 - environment: - TERM: xterm - NETLIFY_SITE_ID: 79c4a5da-5c95-4dc9-84f7-45fd9dfe21b0 - working_directory: ~/repo - steps: - - attach_workspace: - at: ~/repo - - run: cd .netlify && npm install - - run: - cp .netlify/deploy-workflow/_redirects platform/viewer/dist/_redirects - - run: cd .netlify && npm run deploy + # DEPLOY_TO_PRODUCTION: + # docker: + # - image: circleci/node:16.14.0 + # environment: + # TERM: xterm + # NETLIFY_SITE_ID: 79c4a5da-5c95-4dc9-84f7-45fd9dfe21b0 + # working_directory: ~/repo + # steps: + # - attach_workspace: + # at: ~/repo + # - run: cd .netlify && npm install + # - run: cp .netlify/deploy-workflow/_redirects platform/app/dist/_redirects + # - run: cd .netlify && npm run deploy + + # DEPLOY_TO_RELEASE_DEV: + # docker: + # - image: circleci/node:16.14.0 + # environment: + # TERM: xterm + # NETLIFY_SITE_ID: 3270878-22 + # working_directory: ~/repo + # steps: + # - attach_workspace: + # at: ~/repo + # - run: cd .netlify && npm install + # - run: + # cp .netlify/deploy-workflow/_redirects platform/app/dist/_redirects + # - run: cd .netlify && npm run deploy ### # Workflow: RELEASE @@ -261,31 +273,39 @@ jobs: name: Authenticate with NPM registry command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc - - run: npx lerna version - run: yarn run build:package-all - - run: yarn run lerna:publish - - run: npx lerna run ci:generateSuccessVersion --stream - - persist_to_workspace: - root: ~/repo - paths: . + - run: yarn run lerna:customVersion - DOCS_PUBLISH: + DOCKER_RELEASE_PUBLISH: <<: *defaults steps: - - checkout + - attach_workspace: + at: ~/repo + - setup_remote_docker: + docker_layer_caching: false - run: - name: Avoid hosts unknown for github + name: Build and push Docker image from the release branch command: | - rm -rf ~/.ssh - mkdir ~/.ssh/ - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - git config --global user.email "danny.ri.brown+ohif-bot@gmail.com" - git config --global user.name "ohif-bot" - - run: yarn global add gitbook-cli gh-pages - - run: chmod +x ~/repo/.circleci/build-and-publish-docs.sh - - run: ~/repo/.circleci/build-and-publish-docs.sh + # This file will exist if a new version was published by + # our command in the previous job. + if [[ ! -e ./version.txt ]]; then + exit 0 + else + # Remove npm config + rm -f ./.npmrc + # Set our version number using vars + export IMAGE_VERSION=$(cat version.txt) + export IMAGE_VERSION_FULL=v$IMAGE_VERSION + echo $IMAGE_VERSION + echo $IMAGE_VERSION_FULL + # Build our image, auth, and push + docker build --tag ohif/app:$IMAGE_VERSION_FULL --tag ohif/app:latest . + echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin + docker push ohif/app:$IMAGE_VERSION_FULL + docker push ohif/app:latest + fi - DOCKER_MASTER_PUBLISH: + DOCKER_BETA_PUBLISH: <<: *defaults steps: - attach_workspace: @@ -293,26 +313,25 @@ jobs: - setup_remote_docker: docker_layer_caching: false - run: - name: Build and push Docker image + name: + Build and push Docker image from the master branch (beta releases) command: | # This file will exist if a new version was published by - # our command in the previous job. Created in npm ci:generateSuccessVersion script - # in the `platform/viewer` project. - if [[ ! -e platform/viewer/success_version.txt ]]; then + # our command in the previous job. + if [[ ! -e ./version.txt ]]; then exit 0 else # Remove npm config rm -f ./.npmrc # Set our version number using vars - export IMAGE_VERSION=$(cat platform/viewer/success_version.txt) - export IMAGE_VERSION_FULL=v$IMAGE_VERSION.${CIRCLE_BUILD_NUM} + export IMAGE_VERSION=$(cat version.txt) + export IMAGE_VERSION_FULL=v$IMAGE_VERSION echo $IMAGE_VERSION echo $IMAGE_VERSION_FULL # Build our image, auth, and push - docker build --tag ohif/$IMAGE_NAME:$IMAGE_VERSION_FULL --tag ohif/$IMAGE_NAME:latest . + docker build --tag ohif/app:$IMAGE_VERSION_FULL . echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin - docker push ohif/$IMAGE_NAME:$IMAGE_VERSION_FULL - docker push ohif/$IMAGE_NAME:latest + docker push ohif/app:$IMAGE_VERSION_FULL fi workflows: @@ -320,13 +339,8 @@ workflows: PR_CHECKS: jobs: - - UNIT_TESTS: - filters: - branches: - ignore: - - master - - feature/* - - hotfix/* + - UNIT_TESTS + # E2E: PWA - cypress/run: name: 'E2E: PWA' @@ -340,7 +354,7 @@ workflows: yarn: true record: true store_artifacts: true - working_directory: platform/viewer + working_directory: platform/app build: yarn test:data start: yarn run test:e2e:serve spec: 'cypress/integration/**/*' @@ -349,11 +363,11 @@ workflows: no-workspace: true # Don't persist workspace post-steps: - store_artifacts: - path: platform/viewer/cypress/screenshots + path: platform/app/cypress/screenshots - store_artifacts: - path: platform/viewer/cypress/videos + path: platform/app/cypress/videos - store_test_results: - path: platform/viewer/cypress/results + path: platform/app/cypress/results requires: - UNIT_TESTS @@ -370,7 +384,7 @@ workflows: - run: 'rm -rf ~/.yarn && yarn -v && yarn global add wait-on' yarn: true store_artifacts: false - working_directory: platform/viewer + working_directory: platform/app build: yarn test:data && npx cross-env QUICK_BUILD=true APP_CONFIG=config/dicomweb-server.js yarn run build @@ -380,35 +394,41 @@ workflows: no-workspace: true # Don't persist workspace post-steps: - store_artifacts: - path: platform/viewer/cypress/screenshots + path: platform/app/cypress/screenshots - store_artifacts: - path: platform/viewer/cypress/videos + path: platform/app/cypress/videos requires: - AWAIT_APPROVAL - DEPLOY: + # Our master branch deploys to viewer-dev.ohif.org, the viewer.ohif.org is + # deployed from the release branch which is more stable and less frequently updated. + DEPLOY_MASTER: jobs: - BUILD: filters: branches: only: master - - DEPLOY_TO_DEV: + - NPM_PUBLISH: requires: - BUILD - - PROMOTE_TO_STAGING: - type: approval + - DOCKER_BETA_PUBLISH: + requires: + - BUILD + + # Our release branch deploys to viewer.ohif.org and is more stable and less + # frequently updated after being tested in the staging environment. + DEPLOY_RELEASE: + jobs: + - BUILD: + filters: + branches: + only: release + - NPM_PUBLISH: requires: - - DEPLOY_TO_DEV - - DEPLOY_TO_STAGING: + - BUILD + - DOCKER_RELEASE_PUBLISH: requires: - - PROMOTE_TO_STAGING - # - PROMOTE_TO_PRODUCTION: - # type: approval - # requires: - # - DEPLOY_TO_STAGING - # - DEPLOY_TO_PRODUCTION: - # requires: - # - PROMOTE_TO_PRODUCTION + - BUILD ### # Unit and E2E tests have already run for PR_CHECKS # Re-running should not gain us any confidence here @@ -434,7 +454,7 @@ workflows: # add wait-on' # Use yarn latest # yarn: true # store_artifacts: false - # working_directory: platform/viewer + # working_directory: platform/app # build: # npx cross-env QUICK_BUILD=true APP_CONFIG=config/e2e.js yarn run # build @@ -444,11 +464,11 @@ workflows: # no-workspace: true # Don't persist workspace # post-steps: # - store_artifacts: - # path: platform/viewer/cypress/screenshots + # path: platform/app/cypress/screenshots # - store_artifacts: - # path: platform/viewer/cypress/videos + # path: platform/app/cypress/videos # - store_test_results: - # path: platform/viewer/cypress/results + # path: platform/app/cypress/results # filters: # branches: # only: master diff --git a/.codecov.yml b/.codecov.yml index 0192e66211f..ec9519c68f7 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -22,4 +22,4 @@ flags: - platform/core viewer: paths: - - platform/viewer + - platform/app diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 21b80596c08..5a2907b18fd 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -9,7 +9,7 @@ body: value: | ๐Ÿ‘‹ Hello, and thank you for contributing to our project! Your support is greatly appreciated. - ๐Ÿ” Before proceeding, please make sure to read our [Rules of Conduct](https://github.com/OHIF/Viewers/blob/master/CODE_OF_CONDUCT.md) and familiarize yourself with our [development process](https://v3-docs.ohif.org/development/our-process). + ๐Ÿ” Before proceeding, please make sure to read our [Rules of Conduct](https://github.com/OHIF/Viewers/blob/master/CODE_OF_CONDUCT.md) and familiarize yourself with our [development process](https:/docs.ohif.org/development/our-process). โ“ If you're here to seek general support or ask a question, we encourage you to visit our [community discussion board](https://community.ohif.org/) diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index f0d51e6e3a2..e03e8d9afe1 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -10,7 +10,7 @@ body: ๐Ÿ” Before you proceed, please read our [Rules of Conduct](https://github.com/OHIF/Viewers/blob/master/CODE_OF_CONDUCT.md). - ๐Ÿš€ If your request is specific to your needs, consider contributing it yourself! Read our [contributing guides](https://v3-docs.ohif.org/development/contributing) to get started. + ๐Ÿš€ If your request is specific to your needs, consider contributing it yourself! Read our [contributing guides](https://docs.ohif.org/development/contributing) to get started. ๐Ÿ–Š๏ธ Please provide as much detail as possible for your feature request. Mock-up screenshots, workflow or logic flow diagrams are very helpful. Discuss how your requested feature would interact with existing features. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1b2ee820239..cc3752267f1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,6 @@ - + + - [] The documentation page has been updated as necessary for any public API additions or removals. diff --git a/.gitignore b/.gitignore index 96350ce2d4f..2911f13930f 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ screenshots/ .locize # autogenerated files -platform/viewer/src/pluginImports.js +platform/app/src/pluginImports.js /Viewers.iml -platform/viewer/.recipes/Nginx-Dcm4Che/dcm4che/dcm4che-arc/* -platform/viewer/.recipes/OpenResty-Orthanc/logs/* +platform/app/.recipes/Nginx-Dcm4Che/dcm4che/dcm4che-arc/* +platform/app/.recipes/OpenResty-Orthanc/logs/* diff --git a/.netlify/build-deploy-preview.sh b/.netlify/build-deploy-preview.sh index cb5d017d37a..4aafd667fd2 100755 --- a/.netlify/build-deploy-preview.sh +++ b/.netlify/build-deploy-preview.sh @@ -14,7 +14,7 @@ node -v # Build && Move PWA Output yarn run build:ci mkdir -p ./.netlify/www/pwa -mv platform/viewer/dist/* .netlify/www/pwa -v +mv platform/app/dist/* .netlify/www/pwa -v echo 'Web application built and copied' # Build && Move Docusaurus Output (for the docs themselves) diff --git a/.netlify/package.json b/.netlify/package.json index ca122efa12f..ea40d1a8d72 100644 --- a/.netlify/package.json +++ b/.netlify/package.json @@ -7,7 +7,7 @@ "yarn": ">=1.16.0" }, "scripts": { - "deploy": "netlify deploy --prod --dir ./../platform/viewer/dist" + "deploy": "netlify deploy --prod --dir ./../platform/app/dist" }, "devDependencies": { "netlify-cli": "^2.21.0" diff --git a/.webpack/rules/cssToJavaScript.js b/.webpack/rules/cssToJavaScript.js index aa2aafafc32..05365d31bcb 100644 --- a/.webpack/rules/cssToJavaScript.js +++ b/.webpack/rules/cssToJavaScript.js @@ -2,7 +2,7 @@ const autoprefixer = require('autoprefixer'); const path = require('path'); const tailwindcss = require('tailwindcss'); const tailwindConfigPath = path.resolve( - '../../platform/viewer/tailwind.config.js' + '../../platform/app/tailwind.config.js' ); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const devMode = process.env.NODE_ENV !== 'production'; diff --git a/.webpack/webpack.base.js b/.webpack/webpack.base.js index a288ec2f0d0..ec8ec5291eb 100644 --- a/.webpack/webpack.base.js +++ b/.webpack/webpack.base.js @@ -2,16 +2,16 @@ const dotenv = require('dotenv'); // const path = require('path'); +const fs = require('fs'); + const webpack = require('webpack'); // ~~ PLUGINS const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') .BundleAnalyzerPlugin; const TerserJSPlugin = require('terser-webpack-plugin'); -const CopyPlugin = require('copy-webpack-plugin'); // ~~ PackageJSON -const PACKAGE = require('../platform/viewer/package.json'); // const vtkRules = require('vtk.js/Utilities/config/dependency.js').webpack.core // .rules; // ~~ RULES @@ -25,10 +25,17 @@ const NODE_ENV = process.env.NODE_ENV; const QUICK_BUILD = process.env.QUICK_BUILD; const BUILD_NUM = process.env.CIRCLE_BUILD_NUM || '0'; +// read from ../version.txt +const VERSION_NUMBER = + fs.readFileSync(path.join(__dirname, '../version.txt'), 'utf8') || ''; + +const COMMIT_HASH = + fs.readFileSync(path.join(__dirname, '../commit.txt'), 'utf8') || ''; + // dotenv.config(); -module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => { +module.exports = (env, argv, { SRC_DIR, ENTRY }) => { if (!process.env.NODE_ENV) { throw new Error('process.env.NODE_ENV not set'); } @@ -40,9 +47,7 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => { const config = { mode: isProdBuild ? 'production' : 'development', devtool: isProdBuild ? 'source-map' : 'cheap-module-source-map', - entry: { - app: `${SRC_DIR}/index.js`, - }, + entry: ENTRY, optimization: { // splitChunks: { // // include all types of chunks @@ -50,7 +55,7 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => { // }, //runtimeChunk: 'single', minimize: isProdBuild, - sideEffects: true, + sideEffects: false, }, output: { // clean: true, @@ -103,14 +108,14 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => { mainFields: ['module', 'browser', 'main'], alias: { // Viewer project - '@': path.resolve(__dirname, '../platform/viewer/src'), + '@': path.resolve(__dirname, '../platform/app/src'), '@components': path.resolve( __dirname, - '../platform/viewer/src/components' + '../platform/app/src/components' ), - '@hooks': path.resolve(__dirname, '../platform/viewer/src/hooks'), - '@routes': path.resolve(__dirname, '../platform/viewer/src/routes'), - '@state': path.resolve(__dirname, '../platform/viewer/src/state'), + '@hooks': path.resolve(__dirname, '../platform/app/src/hooks'), + '@routes': path.resolve(__dirname, '../platform/app/src/routes'), + '@state': path.resolve(__dirname, '../platform/app/src/state'), 'dicom-microscopy-viewer': 'dicom-microscopy-viewer/dist/dynamic-import/dicomMicroscopyViewer.min.js', '@cornerstonejs/dicom-image-loader': @@ -122,7 +127,7 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => { path.resolve(__dirname, '../node_modules'), // Hoisted Yarn Workspace Modules path.resolve(__dirname, '../../../node_modules'), - path.resolve(__dirname, '../platform/viewer/node_modules'), + path.resolve(__dirname, '../platform/app/node_modules'), path.resolve(__dirname, '../platform/ui/node_modules'), SRC_DIR, ], @@ -139,10 +144,9 @@ module.exports = (env, argv, { SRC_DIR, DIST_DIR }) => { 'process.env.DEBUG': JSON.stringify(process.env.DEBUG), 'process.env.APP_CONFIG': JSON.stringify(process.env.APP_CONFIG || ''), 'process.env.PUBLIC_URL': JSON.stringify(process.env.PUBLIC_URL || '/'), - 'process.env.VERSION_NUMBER': JSON.stringify( - process.env.VERSION_NUMBER || PACKAGE.productVersion || '' - ), 'process.env.BUILD_NUM': JSON.stringify(BUILD_NUM), + 'process.env.VERSION_NUMBER': JSON.stringify(VERSION_NUMBER), + 'process.env.COMMIT_HASH': JSON.stringify(COMMIT_HASH), /* i18n */ 'process.env.USE_LOCIZE': JSON.stringify(process.env.USE_LOCIZE || ''), 'process.env.LOCIZE_PROJECTID': JSON.stringify( diff --git a/Dockerfile b/Dockerfile index aa62f5952aa..500ad5ae10b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# This dockerfile is used to publish the `ohif/viewer` image on dockerhub. +# This dockerfile is used to publish the `ohif/app` image on dockerhub. # # It's a good example of how to build our static application and package it # with a web server capable of hosting it as static content. @@ -68,6 +68,6 @@ RUN rm /etc/nginx/conf.d/default.conf USER nginx COPY --chown=nginx:nginx .docker/Viewer-v3.x /usr/src RUN chmod 777 /usr/src/entrypoint.sh -COPY --from=builder /usr/src/app/platform/viewer/dist /usr/share/nginx/html +COPY --from=builder /usr/src/app/platform/app/dist /usr/share/nginx/html ENTRYPOINT ["/usr/src/entrypoint.sh"] CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index f861a4803c8..7166afb4cfd 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,16 @@ provided by the Open Health Imaging Foundation (OHIF
- Read The Docs | - Edit the docs + Read The Docs
Live Demo | - Component Library + Component Library
+
+ ๐Ÿ“ฐ Join OHIF Newsletter ๐Ÿ“ฐ +
+
@@ -23,13 +26,13 @@ provided by the Open Health Imaging Foundation (OHIF [![NPM downloads][npm-downloads-image]][npm-url] [![Pulls][docker-pulls-img]][docker-image-url] [![MIT License][license-image]][license-url] -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FOHIF%2FViewers.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FOHIF%2FViewers?ref=badge_shield) - -[![Netlify Status][netlify-image]][netlify-url] -[![CircleCI][circleci-image]][circleci-url] -[![codecov][codecov-image]][codecov-url] [![This project is using Percy.io for visual regression testing.][percy-image]](percy-url) -[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors) + + + + + + ## About @@ -55,7 +58,7 @@ contributions of individuals, research groups, and commercial organizations. ### Built to Adapt -After more than 5-years of integrating with many companies and organizations, +After more than 8-years of integrating with many companies and organizations, The OHIF Viewer has been rebuilt from the ground up to better address the varying workflow and configuration needs of its many users. All of the Viewer's core features are built using it's own extension system. The same extensibility @@ -66,6 +69,7 @@ that allows us to offer: - Maximum Intensity Project (MIP) - Whole slide microscopy viewing - PDF and Dicom Structured Report rendering +- Segmentation rendering as labelmaps and contours - User Access Control (UAC) - Context specific toolbar and side panel content - and many others @@ -79,63 +83,22 @@ forking). We offer support through [GitHub Issues](https://github.com/OHIF/Viewers/issues/new/choose). You can: -- [Report a Bug ๐Ÿ›](https://github.com/OHIF/Viewers/issues/new?assignees=&labels=Community%3A+Report+%3Abug%3A&template=---bug-report.md) -- [Request a Feature ๐Ÿš€](https://github.com/OHIF/Viewers/issues/new?assignees=&labels=Community%3A+Request+%3Ahand%3A&template=---feature-request.md) -- [Ask a Question ๐Ÿค—](https://github.com/OHIF/Viewers/issues/new?assignees=&labels=Community%3A+Question+%3Aquestion%3A&template=---support-question.md) +- [Report a Bug ๐Ÿ›](https://github.com/OHIF/Viewers/issues/new?assignees=&labels=Community%3A+Report+%3Abug%3A%2CAwaiting+Reproduction&projects=&template=bug-report.yml&title=%5BBug%5D+) +- [Request a Feature ๐Ÿš€](https://github.com/OHIF/Viewers/issues/new?assignees=&labels=Community%3A+Request+%3Ahand%3A&projects=&template=feature-request.yml&title=%5BFeature+Request%5D+) +- [Ask a Question ๐Ÿค—](community.ohif.org) +- [Slack Channel](https://join.slack.com/t/cornerstonejs/shared_invite/zt-1r8xb2zau-dOxlD6jit3TN0Uwf928w9Q) For commercial support, academic collaborations, and answers to common questions; please read our [documented FAQ](https://docs.ohif.org/faq/index.html#does-ohif-offer-commercial-support). -## Quick Start Deployment - -> This is only one of many ways to configure and deploy the OHIF Viewer. To -> learn more about your options, and how to choose the best one for your -> requirements, check out -> [our deployment recipes and documentation](https://docs.ohif.org/deployment/). - -The fastest and easiest way to get started is to include the OHIF Viewer with a -script tag. In practice, this is as simple as: - -- Including the following dependencies with script tags: - - [React](https://unpkg.com/react@16/umd/react.production.min.js) - - [React Dom](https://unpkg.com/react-dom@16/umd/react-dom.production.min.js) - - The [OHIF Viewer](https://unpkg.com/@ohif/viewer) -- Have an element with an ID of `root` on the page -- Configure the OHIF Viewer at `window.config`: - -```js -window.config = { - routerBasename: '/', - servers: { - dicomWeb: [ - { - name: 'DCM4CHEE', - qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', - wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', - qidoSupportsIncludeField: true, - imageRendering: 'wadors', - thumbnailRendering: 'wadors', - }, - ], - }, -}; -``` - -- Install the viewer: - `window.OHIFStandaloneViewer.installViewer(window.config);` - -This exact setup is demonstrated in this -[CodeSandbox](https://codesandbox.io/s/viewer-script-tag-tprch) and in our -[Embedding The Viewer](https://docs.ohif.org/deployment/recipes/embedded-viewer.html) -deployment recipe. ## Developing ### Requirements - [Yarn 1.17.3+](https://yarnpkg.com/en/docs/install) -- [Node 10+](https://nodejs.org/en/) +- [Node 16+](https://nodejs.org/en/) - Yarn Workspaces should be enabled on your machine: - `yarn config set workspaces-experimental true` @@ -171,7 +134,6 @@ also supports a number of commands that can be found in their respective | ---------------------------- | ------------------------------------------------------------- | | **Develop** | | | `dev` or `start` | Default development experience for Viewer | -| `dev:project ` | Replace with `core`, `ui`, `i18n`, `cornerstone`, `vtk`, etc. | | `test:unit` | Jest multi-project test runner; overall coverage | | **Deploy** | | | `build`\* | Builds production output for our PWA Viewer | | @@ -179,7 +141,7 @@ also supports a number of commands that can be found in their respective \* - For more information on our different builds, check out our [Deploy Docs][deployment-docs] -## Projects +## Project The OHIF Medical Image Viewing Platform is maintained as a [`monorepo`][monorepo]. This means that this repository, instead of containing a @@ -190,20 +152,32 @@ you'll see the following: . โ”œโ”€โ”€ extensions # โ”‚ โ”œโ”€โ”€ _example # Skeleton of example extension -โ”‚ โ”œโ”€โ”€ default # -โ”‚ โ”œโ”€โ”€ cornerstone # image rendering and tools w/ Cornerstone -โ”‚ โ”œโ”€โ”€ cornerstone- dicom-sr # -โ”‚ โ””โ”€โ”€ measurement-tracking # +โ”‚ โ”œโ”€โ”€ default # basic set of useful functionalities (datasources, panels, etc) +โ”‚ โ”œโ”€โ”€ cornerstone # image rendering and tools w/ Cornerstone3D +โ”‚ โ”œโ”€โ”€ cornerstone-dicom-sr # DICOM Structured Report rendering and export +โ”‚ โ”œโ”€โ”€ cornerstone-dicom-sr # DICOM Structured Report rendering and export +โ”‚ โ”œโ”€โ”€ cornerstone-dicom-seg # DICOM Segmentation rendering and export +โ”‚ โ”œโ”€โ”€ cornerstone-dicom-rt # DICOM RTSTRUCT rendering +โ”‚ โ”œโ”€โ”€ cornerstone-microscopy # Whole Slide Microscopy rendering +โ”‚ โ”œโ”€โ”€ dicom-pdf # PDF rendering +โ”‚ โ”œโ”€โ”€ dicom-video # DICOM RESTful Services +โ”‚ โ”œโ”€โ”€ measurement-tracking # Longitudinal measurement tracking +โ”‚ โ”œโ”€โ”€ tmtv # Total Metabolic Tumor Volume (TMTV) calculation +| + โ”‚ โ”œโ”€โ”€ modes # โ”‚ โ”œโ”€โ”€ _example # Skeleton of example mode โ”‚ โ”œโ”€โ”€ basic-dev-mode # Basic development mode -โ”‚ โ””โ”€โ”€ longitudinal # Longitudinal mode (measurement tracking) +โ”‚ โ”œโ”€โ”€ longitudinal # Longitudinal mode (measurement tracking) +โ”‚ โ”œโ”€โ”€ tmtv # Total Metabolic Tumor Volume (TMTV) calculation mode +โ”‚ โ””โ”€โ”€ microscopy # Whole Slide Microscopy mode โ”‚ โ”œโ”€โ”€ platform # โ”‚ โ”œโ”€โ”€ core # Business Logic โ”‚ โ”œโ”€โ”€ i18n # Internationalization Support โ”‚ โ”œโ”€โ”€ ui # React component library +โ”‚ โ”œโ”€โ”€ docs # Documentation โ”‚ โ””โ”€โ”€ viewer # Connects platform and extension projects โ”‚ โ”œโ”€โ”€ ... # misc. shared configuration @@ -215,22 +189,7 @@ you'll see the following: Want to better understand why and how we've structured this repository? Read more about it in our [Architecture Documentation][ohif-architecture]. -### Platform - -These projects comprise the - -| Name | Description | Links | -| ------------------------------- | ---------------------------------------------------------------------------------------------------- | ----------------- | -| [@ohif/core][platform-core] | Business logic and classes that model the data, services, and extensions that are framework agnostic | [NPM][core-npm] | -| [@ohif/i18n][platform-i18n] | Language files and small API for wrapping component/ui text for translations | [NPM][i18n-npm] | -| [@ohif/viewer][platform-viewer] | The OHIF Viewer. Where we consume and configure all platform library's and extensions | [NPM][viewer-npm] | -| [@ohif/ui][platform-ui] | Reusable React components we consume and compose to build our Viewer's UI | [NPM][ui-npm] | - -### Extensions -This is a list of Extensions maintained by the OHIF Core team. It is possible to -customize and configure these extensions, and you can even create your own. You -can [read more about extensions here][ohif-extensions]. | Name | Description | Links | | ---------------------------------------------------- | ----------------------------------------------------- | ---------------------- | @@ -298,9 +257,9 @@ MIT ยฉ [OHIF](https://github.com/OHIF) [semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg [semantic-url]: https://github.com/semantic-release/semantic-release -[npm-url]: https://npmjs.org/package/@ohif/viewer -[npm-downloads-image]: https://img.shields.io/npm/dm/@ohif/viewer.svg?style=flat-square -[npm-version-image]: https://img.shields.io/npm/v/@ohif/viewer.svg?style=flat-square +[npm-url]: https://npmjs.org/package/@ohif/app +[npm-downloads-image]: https://img.shields.io/npm/dm/@ohif/app.svg?style=flat-square +[npm-version-image]: https://img.shields.io/npm/v/@ohif/app.svg?style=flat-square [docker-pulls-img]: https://img.shields.io/docker/pulls/ohif/viewer.svg?style=flat-square [docker-image-url]: https://hub.docker.com/r/ohif/viewer [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square @@ -316,7 +275,7 @@ MIT ยฉ [OHIF](https://github.com/OHIF) [deployment-docs]: https://docs.ohif.org/deployment/ [react-url]: https://reactjs.org/ [pwa-url]: https://developers.google.com/web/progressive-web-apps/ -[ohif-viewer-url]: https://www.npmjs.com/package/@ohif/viewer +[ohif-viewer-url]: https://www.npmjs.com/package/@ohif/app [configuration-url]: https://docs.ohif.org/configuring/ [extensions-url]: https://docs.ohif.org/extensions/ @@ -326,8 +285,8 @@ MIT ยฉ [OHIF](https://github.com/OHIF) [i18n-npm]: https://www.npmjs.com/package/@ohif/i18n [platform-ui]: platform/ui/README.md [ui-npm]: https://www.npmjs.com/package/@ohif/ui -[platform-viewer]: platform/viewer/README.md -[viewer-npm]: https://www.npmjs.com/package/@ohif/viewer +[platform-viewer]: platform/app/README.md +[viewer-npm]: https://www.npmjs.com/package/@ohif/app [extension-cornerstone]: extensions/cornerstone/README.md [cornerstone-npm]: https://www.npmjs.com/package/@ohif/extension-cornerstone diff --git a/commit.txt b/commit.txt new file mode 100644 index 00000000000..7c57ac593e8 --- /dev/null +++ b/commit.txt @@ -0,0 +1 @@ +8f34bcd048540bb7d1501a5ac514739d4ee4d68c \ No newline at end of file diff --git a/extensions/cornerstone-dicom-rt/.webpack/webpack.dev.js b/extensions/cornerstone-dicom-rt/.webpack/webpack.dev.js index 1ae30844802..6aea859ca74 100644 --- a/extensions/cornerstone-dicom-rt/.webpack/webpack.dev.js +++ b/extensions/cornerstone-dicom-rt/.webpack/webpack.dev.js @@ -1,8 +1,12 @@ const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +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 }); }; diff --git a/extensions/cornerstone-dicom-rt/.webpack/webpack.prod.js b/extensions/cornerstone-dicom-rt/.webpack/webpack.prod.js index 070a723e38d..5182c4a6a98 100644 --- a/extensions/cornerstone-dicom-rt/.webpack/webpack.prod.js +++ b/extensions/cornerstone-dicom-rt/.webpack/webpack.prod.js @@ -1,63 +1,55 @@ +const webpack = require('webpack'); +const { merge } = require('webpack-merge'); const path = require('path'); -const pkg = require('../package.json'); +const webpackCommon = require('./../../../.webpack/webpack.base.js'); +const pkg = require('./../package.json'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') + .BundleAnalyzerPlugin; -const outputFile = 'index.umd.js'; -const rootDir = path.resolve(__dirname, '../'); -const outputFolder = path.join(__dirname, `../dist/umd/${pkg.name}/`); +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.tsx`, +}; -// Todo: add ESM build for the extension in addition to umd build +module.exports = (env, argv) => { + const commonConfig = webpackCommon(env, argv, { SRC_DIR, ENTRY, DIST_DIR }); -const config = { - mode: 'production', - entry: rootDir + '/' + pkg.module, - devtool: 'source-map', - output: { - path: outputFolder, - filename: outputFile, - library: pkg.name, - libraryTarget: 'umd', - chunkFilename: '[name].chunk.js', - umdNamedDefine: true, - globalObject: "typeof self !== 'undefined' ? self : this", - }, - externals: [ - { - react: { - root: 'React', - commonjs2: 'react', - commonjs: 'react', - amd: 'react', - }, - '@ohif/core': { - commonjs2: '@ohif/core', - commonjs: '@ohif/core', - amd: '@ohif/core', - root: '@ohif/core', - }, - '@ohif/ui': { - commonjs2: '@ohif/ui', - commonjs: '@ohif/ui', - amd: '@ohif/ui', - root: '@ohif/ui', - }, + return merge(commonConfig, { + stats: { + colors: true, + hash: true, + timings: true, + assets: true, + chunks: false, + chunkModules: false, + modules: false, + children: false, + warnings: true, + }, + optimization: { + minimize: true, + sideEffects: false, + }, + output: { + path: ROOT_DIR, + library: 'ohif-extension-cornerstone-dicom-rt', + libraryTarget: 'umd', + filename: pkg.main, }, - ], - module: { - rules: [ - { - test: /(\.jsx|\.js|\.tsx|\.ts)$/, - loader: 'babel-loader', - exclude: /(node_modules|bower_components)/, - resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }, - }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, ], - }, - resolve: { - modules: [path.resolve('./node_modules'), path.resolve('./src')], - extensions: ['.json', '.js', '.jsx', '.tsx', '.ts'], - }, + plugins: [ + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, + }), + // new BundleAnalyzerPlugin(), + ], + }); }; - -module.exports = config; diff --git a/extensions/cornerstone-dicom-rt/package.json b/extensions/cornerstone-dicom-rt/package.json index 89f8071a9d7..5dbd6e62124 100644 --- a/extensions/cornerstone-dicom-rt/package.json +++ b/extensions/cornerstone-dicom-rt/package.json @@ -4,13 +4,16 @@ "description": "DICOM RT read workflow", "author": "OHIF", "license": "MIT", - "main": "dist/umd/@ohif/dicom-rt/index.umd.js", + "main": "dist/ohif-extension-cornerstone-dicom-rt.umd.js", "module": "src/index.tsx", "files": [ "dist/**", "public/**", "README.md" ], + "publishConfig": { + "access": "public" + }, "repository": "OHIF/Viewers", "keywords": [ "ohif-extension" @@ -21,7 +24,7 @@ "yarn": ">=1.18.0" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:dicom-seg": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", @@ -31,7 +34,7 @@ "@ohif/core": "^3.0.0", "@ohif/extension-default": "^3.0.0", "@ohif/extension-cornerstone": "^3.0.0", - "@ohif/i18n": "^1.0.0", + "@ohif/i18n": "^3.0.0", "prop-types": "^15.6.2", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/extensions/cornerstone-dicom-seg/.webpack/webpack.dev.js b/extensions/cornerstone-dicom-seg/.webpack/webpack.dev.js index 1ae30844802..6aea859ca74 100644 --- a/extensions/cornerstone-dicom-seg/.webpack/webpack.dev.js +++ b/extensions/cornerstone-dicom-seg/.webpack/webpack.dev.js @@ -1,8 +1,12 @@ const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +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 }); }; diff --git a/extensions/cornerstone-dicom-seg/.webpack/webpack.prod.js b/extensions/cornerstone-dicom-seg/.webpack/webpack.prod.js index 070a723e38d..017e4bbf014 100644 --- a/extensions/cornerstone-dicom-seg/.webpack/webpack.prod.js +++ b/extensions/cornerstone-dicom-seg/.webpack/webpack.prod.js @@ -1,63 +1,60 @@ +const webpack = require('webpack'); +const { merge } = require('webpack-merge'); const path = require('path'); -const pkg = require('../package.json'); +const webpackCommon = require('./../../../.webpack/webpack.base.js'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const outputFile = 'index.umd.js'; -const rootDir = path.resolve(__dirname, '../'); -const outputFolder = path.join(__dirname, `../dist/umd/${pkg.name}/`); +const pkg = require('./../package.json'); -// Todo: add ESM build for the extension in addition to umd build +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.tsx`, +}; + +const outputName = `ohif-${pkg.name.split('/').pop()}`; -const config = { - mode: 'production', - entry: rootDir + '/' + pkg.module, - devtool: 'source-map', - output: { - path: outputFolder, - filename: outputFile, - library: pkg.name, - libraryTarget: 'umd', - chunkFilename: '[name].chunk.js', - umdNamedDefine: true, - globalObject: "typeof self !== 'undefined' ? self : this", - }, - externals: [ - { - react: { - root: 'React', - commonjs2: 'react', - commonjs: 'react', - amd: 'react', - }, - '@ohif/core': { - commonjs2: '@ohif/core', - commonjs: '@ohif/core', - amd: '@ohif/core', - root: '@ohif/core', - }, - '@ohif/ui': { - commonjs2: '@ohif/ui', - commonjs: '@ohif/ui', - amd: '@ohif/ui', - root: '@ohif/ui', - }, +module.exports = (env, argv) => { + const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); + + return merge(commonConfig, { + stats: { + colors: true, + hash: true, + timings: true, + assets: true, + chunks: false, + chunkModules: false, + modules: false, + children: false, + warnings: true, + }, + optimization: { + minimize: true, + sideEffects: true, }, - ], - module: { - rules: [ - { - test: /(\.jsx|\.js|\.tsx|\.ts)$/, - loader: 'babel-loader', - exclude: /(node_modules|bower_components)/, - resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }, - }, + output: { + path: ROOT_DIR, + library: 'ohif-extension-cornerstone-dicom-seg', + libraryTarget: 'umd', + filename: pkg.main, + }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], + plugins: [ + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, + }), + // new MiniCssExtractPlugin({ + // filename: `./dist/${outputName}.css`, + // chunkFilename: `./dist/${outputName}.css`, + // }), ], - }, - resolve: { - modules: [path.resolve('./node_modules'), path.resolve('./src')], - extensions: ['.json', '.js', '.jsx', '.tsx', '.ts'], - }, + }); }; - -module.exports = config; diff --git a/extensions/cornerstone-dicom-seg/package.json b/extensions/cornerstone-dicom-seg/package.json index 577f9dc942e..e806f05bd7f 100644 --- a/extensions/cornerstone-dicom-seg/package.json +++ b/extensions/cornerstone-dicom-seg/package.json @@ -4,7 +4,7 @@ "description": "DICOM SEG read workflow", "author": "OHIF", "license": "MIT", - "main": "dist/umd/@ohif/dicom-seg/index.umd.js", + "main": "dist/ohif-extension-cornerstone-dicom-seg.umd.js", "module": "src/index.tsx", "files": [ "dist/**", @@ -15,13 +15,16 @@ "keywords": [ "ohif-extension" ], + "publishConfig": { + "access": "public" + }, "engines": { "node": ">=14", "npm": ">=6", "yarn": ">=1.18.0" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:dicom-seg": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", @@ -31,7 +34,7 @@ "@ohif/core": "^3.0.0", "@ohif/extension-default": "^3.0.0", "@ohif/extension-cornerstone": "^3.0.0", - "@ohif/i18n": "^1.0.0", + "@ohif/i18n": "^3.0.0", "prop-types": "^15.6.2", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/extensions/cornerstone-dicom-seg/src/index.tsx b/extensions/cornerstone-dicom-seg/src/index.tsx index 54dff225506..04ce5f98cb6 100644 --- a/extensions/cornerstone-dicom-seg/src/index.tsx +++ b/extensions/cornerstone-dicom-seg/src/index.tsx @@ -3,9 +3,7 @@ import React from 'react'; import { Types } from '@ohif/core'; -import getSopClassHandlerModule, { - protocols, -} from './getSopClassHandlerModule'; +import getSopClassHandlerModule from './getSopClassHandlerModule'; import PanelSegmentation from './panels/PanelSegmentation'; import getHangingProtocolModule from './getHangingProtocolModule'; @@ -90,8 +88,4 @@ const extension = { getHangingProtocolModule, }; -export default extension; - -// Export the protocols separately to allow for extending it at compile time -// in other modules -export { protocols }; +export default extension; \ No newline at end of file diff --git a/extensions/cornerstone-dicom-sr/.webpack/webpack.dev.js b/extensions/cornerstone-dicom-sr/.webpack/webpack.dev.js index db7c206b134..6aea859ca74 100644 --- a/extensions/cornerstone-dicom-sr/.webpack/webpack.dev.js +++ b/extensions/cornerstone-dicom-sr/.webpack/webpack.dev.js @@ -3,6 +3,10 @@ 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 }); }; diff --git a/extensions/cornerstone-dicom-sr/.webpack/webpack.prod.js b/extensions/cornerstone-dicom-sr/.webpack/webpack.prod.js index e1444944f1e..76dcd9ecfaf 100644 --- a/extensions/cornerstone-dicom-sr/.webpack/webpack.prod.js +++ b/extensions/cornerstone-dicom-sr/.webpack/webpack.prod.js @@ -1,17 +1,23 @@ const webpack = require('webpack'); const { merge } = require('webpack-merge'); const path = require('path'); +const webpackCommon = require('./../../../.webpack/webpack.base.js'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const pkg = require('./../package.json'); -const webpackCommon = require('./../../../.webpack/webpack.base.js'); -const ROOT_DIR = path.join(__dirname, './../'); +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.tsx`, +}; + +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: { @@ -31,19 +37,25 @@ module.exports = (env, argv) => { }, output: { path: ROOT_DIR, - library: 'OHIFExtCornerstone', + library: 'ohif-extension-cornerstone-dicom-sr', libraryTarget: 'umd', - libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), - new MiniCssExtractPlugin({ - filename: './dist/[name].css', - chunkFilename: './dist/[id].css', - }), + // new MiniCssExtractPlugin({ + // filename: `./dist/${outputName}.css`, + // chunkFilename: `./dist/${outputName}.css`, + // }), ], }); }; diff --git a/extensions/cornerstone-dicom-sr/package.json b/extensions/cornerstone-dicom-sr/package.json index 37f7d6974ea..3b3e860cd3c 100644 --- a/extensions/cornerstone-dicom-sr/package.json +++ b/extensions/cornerstone-dicom-sr/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-extension-cornerstone-dicom-sr.umd.js", "module": "src/index.tsx", "engines": { "node": ">=14", @@ -23,7 +23,7 @@ "ohif-extension" ], "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:cornerstone": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", @@ -35,7 +35,7 @@ "@ohif/core": ">=3.0.0", "@ohif/extension-cornerstone": ">=3.0.0", "@ohif/extension-measurement-tracking": "^3.0.0", - "@ohif/ui": "^2.0.0", + "@ohif/ui": "^3.0.0", "dcmjs": "^0.29.5", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", diff --git a/extensions/cornerstone/.webpack/webpack.dev.js b/extensions/cornerstone/.webpack/webpack.dev.js index 1ae30844802..6aea859ca74 100644 --- a/extensions/cornerstone/.webpack/webpack.dev.js +++ b/extensions/cornerstone/.webpack/webpack.dev.js @@ -1,8 +1,12 @@ const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +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 }); }; diff --git a/extensions/cornerstone/.webpack/webpack.prod.js b/extensions/cornerstone/.webpack/webpack.prod.js index 27e98c96f2a..74868eb44c2 100644 --- a/extensions/cornerstone/.webpack/webpack.prod.js +++ b/extensions/cornerstone/.webpack/webpack.prod.js @@ -1,15 +1,22 @@ const webpack = require('webpack'); -const merge = require('webpack-merge'); +const { merge } = require('webpack-merge'); const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +const webpackCommon = require('./../../../.webpack/webpack.base.js'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); + const pkg = require('./../package.json'); -const ROOT_DIR = path.join(__dirname, './..'); +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.tsx`, +}; + +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: { @@ -29,15 +36,25 @@ module.exports = (env, argv) => { }, output: { path: ROOT_DIR, - library: 'OHIFExtCornerstone', + library: 'ohif-extension-cornerstone', libraryTarget: 'umd', - libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), + new MiniCssExtractPlugin({ + filename: `./dist/${outputName}.css`, + chunkFilename: `./dist/${outputName}.css`, + }), ], }); }; diff --git a/extensions/cornerstone/jest.config.js b/extensions/cornerstone/jest.config.js index 9055db5b51e..2978b062ed1 100644 --- a/extensions/cornerstone/jest.config.js +++ b/extensions/cornerstone/jest.config.js @@ -8,6 +8,6 @@ module.exports = { // rootDir: "../.." // testMatch: [ // //`/platform/${pack.name}/**/*.spec.js` - // "/platform/viewer/**/*.test.js" + // "/platform/app/**/*.test.js" // ] }; diff --git a/extensions/cornerstone/package.json b/extensions/cornerstone/package.json index bd64914c023..50a53c0ea16 100644 --- a/extensions/cornerstone/package.json +++ b/extensions/cornerstone/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-extension-cornerstone.umd.js", "module": "src/index.tsx", "types": "src/types/index.ts", "exports": { @@ -25,15 +25,15 @@ "access": "public" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:cornerstone": "yarn run dev", - "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", + "build": "cross-env NODE_ENV=production webpack --progress --config .webpack/webpack.prod.js", "build:package": "yarn run build", "start": "yarn run dev" }, "peerDependencies": { "@ohif/core": "^3.0.0", - "@ohif/ui": "^2.0.0", + "@ohif/ui": "^3.0.0", "@cornerstonejs/dicom-image-loader": "^0.6.8", "@cornerstonejs/codec-charls": "^1.2.3", "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", diff --git a/extensions/cornerstone/src/services/SegmentationService/SegmentationService.ts b/extensions/cornerstone/src/services/SegmentationService/SegmentationService.ts index 26d47b3f731..220b188cb98 100644 --- a/extensions/cornerstone/src/services/SegmentationService/SegmentationService.ts +++ b/extensions/cornerstone/src/services/SegmentationService/SegmentationService.ts @@ -107,7 +107,7 @@ class SegmentationService extends PubSubService { /** * It adds a segment to a segmentation, basically just setting the properties for - * the segment + * the segment. * @param segmentationId - The ID of the segmentation you want to add a * segment to. * @param segmentIndex - The index of the segment to add. diff --git a/extensions/default/.webpack/webpack.dev.js b/extensions/default/.webpack/webpack.dev.js index db7c206b134..96d68096d9d 100644 --- a/extensions/default/.webpack/webpack.dev.js +++ b/extensions/default/.webpack/webpack.dev.js @@ -3,6 +3,11 @@ 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 }); }; diff --git a/extensions/default/.webpack/webpack.prod.js b/extensions/default/.webpack/webpack.prod.js index 33ae8b844a1..ea7b2e5bb02 100644 --- a/extensions/default/.webpack/webpack.prod.js +++ b/extensions/default/.webpack/webpack.prod.js @@ -5,12 +5,18 @@ const webpackCommon = require('./../../../.webpack/webpack.base.js'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const pkg = require('./../package.json'); -const ROOT_DIR = path.join(__dirname, './../'); + +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.ts`, +}; + +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: { @@ -30,18 +36,24 @@ module.exports = (env, argv) => { }, output: { path: ROOT_DIR, - library: 'OHIFExtCornerstone', + library: 'ohif-extension-default', libraryTarget: 'umd', - libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), new MiniCssExtractPlugin({ - filename: './dist/[name].css', - chunkFilename: './dist/[id].css', + filename: `./dist/${outputName}.css`, + chunkFilename: `./dist/${outputName}.css`, }), ], }); diff --git a/extensions/default/package.json b/extensions/default/package.json index 42f80e23ca2..462942e53df 100644 --- a/extensions/default/package.json +++ b/extensions/default/package.json @@ -5,7 +5,7 @@ "author": "OHIF Core Team", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-extension-default.umd.js", "module": "src/index.ts", "publishConfig": { "access": "public" @@ -23,7 +23,7 @@ "ohif-extension" ], "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:dicom-pdf": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", @@ -31,7 +31,7 @@ }, "peerDependencies": { "@ohif/core": "^3.0.0", - "@ohif/i18n": "^1.0.0", + "@ohif/i18n": "^3.0.0", "dcmjs": "^0.29.5", "dicomweb-client": "^0.10.2", "prop-types": "^15.6.2", diff --git a/extensions/default/src/ViewerLayout/index.tsx b/extensions/default/src/ViewerLayout/index.tsx index fc2ad36264e..7d64064fe46 100644 --- a/extensions/default/src/ViewerLayout/index.tsx +++ b/extensions/default/src/ViewerLayout/index.tsx @@ -81,7 +81,7 @@ function ViewerLayout({ const { hotkeyDefinitions, hotkeyDefaults } = hotkeysManager; const versionNumber = process.env.VERSION_NUMBER; - const buildNumber = process.env.BUILD_NUM; + const commitHash = process.env.COMMIT_HASH; const menuOptions = [ { @@ -91,7 +91,7 @@ function ViewerLayout({ show({ content: AboutModal, title: 'About OHIF Viewer', - contentProps: { versionNumber, buildNumber }, + contentProps: { versionNumber, commitHash }, }), }, { diff --git a/extensions/default/src/commandsModule.ts b/extensions/default/src/commandsModule.ts index 958f34b6021..c711280ab9d 100644 --- a/extensions/default/src/commandsModule.ts +++ b/extensions/default/src/commandsModule.ts @@ -12,7 +12,7 @@ import findViewportsByPosition, { import { ContextMenuProps } from './CustomizableContextMenu/types'; import { NavigateHistory } from './types/commandModuleTypes'; -import { history } from '@ohif/viewer'; +import { history } from '@ohif/app'; const { subscribeToNextViewportGridChange } = utils; diff --git a/extensions/dicom-microscopy/.webpack/webpack.dev.js b/extensions/dicom-microscopy/.webpack/webpack.dev.js index db7c206b134..96d68096d9d 100644 --- a/extensions/dicom-microscopy/.webpack/webpack.dev.js +++ b/extensions/dicom-microscopy/.webpack/webpack.dev.js @@ -3,6 +3,11 @@ 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 }); }; diff --git a/extensions/dicom-microscopy/.webpack/webpack.prod.js b/extensions/dicom-microscopy/.webpack/webpack.prod.js index 070a723e38d..cedfa6d10b5 100644 --- a/extensions/dicom-microscopy/.webpack/webpack.prod.js +++ b/extensions/dicom-microscopy/.webpack/webpack.prod.js @@ -1,63 +1,61 @@ +const webpack = require('webpack'); +const { merge } = require('webpack-merge'); const path = require('path'); -const pkg = require('../package.json'); +const webpackCommon = require('./../../../.webpack/webpack.base.js'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const outputFile = 'index.umd.js'; -const rootDir = path.resolve(__dirname, '../'); -const outputFolder = path.join(__dirname, `../dist/umd/${pkg.name}/`); +const pkg = require('./../package.json'); -// Todo: add ESM build for the extension in addition to umd build +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.tsx`, +}; + +const outputName = `ohif-${pkg.name.split('/').pop()}`; -const config = { - mode: 'production', - entry: rootDir + '/' + pkg.module, - devtool: 'source-map', - output: { - path: outputFolder, - filename: outputFile, - library: pkg.name, - libraryTarget: 'umd', - chunkFilename: '[name].chunk.js', - umdNamedDefine: true, - globalObject: "typeof self !== 'undefined' ? self : this", - }, - externals: [ - { - react: { - root: 'React', - commonjs2: 'react', - commonjs: 'react', - amd: 'react', - }, - '@ohif/core': { - commonjs2: '@ohif/core', - commonjs: '@ohif/core', - amd: '@ohif/core', - root: '@ohif/core', - }, - '@ohif/ui': { - commonjs2: '@ohif/ui', - commonjs: '@ohif/ui', - amd: '@ohif/ui', - root: '@ohif/ui', - }, +module.exports = (env, argv) => { + const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); + + return merge(commonConfig, { + stats: { + colors: true, + hash: true, + timings: true, + assets: true, + chunks: false, + chunkModules: false, + modules: false, + children: false, + warnings: true, + }, + optimization: { + minimize: true, + sideEffects: true, }, - ], - module: { - rules: [ - { - test: /(\.jsx|\.js|\.tsx|\.ts)$/, - loader: 'babel-loader', - exclude: /(node_modules|bower_components)/, - resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }, - }, + output: { + path: ROOT_DIR, + library: 'ohif-extension-dicom-microscopy', + libraryTarget: 'umd', + filename: pkg.main, + }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(dicom-microscopy-viewer)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], + plugins: [ + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, + }), + new MiniCssExtractPlugin({ + filename: `./dist/${outputName}.css`, + chunkFilename: `./dist/${outputName}.css`, + }), ], - }, - resolve: { - modules: [path.resolve('./node_modules'), path.resolve('./src')], - extensions: ['.json', '.js', '.jsx', '.tsx', '.ts'], - }, + }); }; - -module.exports = config; diff --git a/extensions/dicom-microscopy/package.json b/extensions/dicom-microscopy/package.json index d3b3fc02c7b..8788591edf9 100644 --- a/extensions/dicom-microscopy/package.json +++ b/extensions/dicom-microscopy/package.json @@ -4,7 +4,7 @@ "description": "OHIF extension for DICOM microscopy", "author": "Bill Wallace, md-prog", "license": "MIT", - "main": "dist/umd/@ohif/extension-dicom-microscopy/index.umd.js", + "main": "dist/ohif-extension-dicom-microscopy.umd.js", "files": [ "dist/**", "public/**", @@ -21,7 +21,7 @@ "yarn": ">=1.18.0" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:dicom-pdf": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", @@ -30,8 +30,8 @@ "peerDependencies": { "@ohif/core": "^3.0.0", "@ohif/extension-default": "^3.0.0", - "@ohif/i18n": "^1.0.0", - "@ohif/ui": "^2.0.0", + "@ohif/i18n": "^3.0.0", + "@ohif/ui": "^3.0.0", "prop-types": "^15.6.2", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/extensions/dicom-microscopy/src/services/MicroscopyService.js b/extensions/dicom-microscopy/src/services/MicroscopyService.ts similarity index 100% rename from extensions/dicom-microscopy/src/services/MicroscopyService.js rename to extensions/dicom-microscopy/src/services/MicroscopyService.ts diff --git a/extensions/dicom-pdf/.webpack/webpack.dev.js b/extensions/dicom-pdf/.webpack/webpack.dev.js new file mode 100644 index 00000000000..a973e328101 --- /dev/null +++ b/extensions/dicom-pdf/.webpack/webpack.dev.js @@ -0,0 +1,12 @@ +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, ENTRY, DIST_DIR }); +}; diff --git a/extensions/dicom-pdf/.webpack/webpack.prod.js b/extensions/dicom-pdf/.webpack/webpack.prod.js new file mode 100644 index 00000000000..a653d7b9fc3 --- /dev/null +++ b/extensions/dicom-pdf/.webpack/webpack.prod.js @@ -0,0 +1,55 @@ +const webpack = require('webpack'); +const { merge } = require('webpack-merge'); +const path = require('path'); +const webpackCommon = require('./../../../.webpack/webpack.base.js'); +const pkg = require('./../package.json'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') + .BundleAnalyzerPlugin; + +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.tsx`, +}; + +module.exports = (env, argv) => { + const commonConfig = webpackCommon(env, argv, { SRC_DIR, ENTRY, DIST_DIR }); + + return merge(commonConfig, { + stats: { + colors: true, + hash: true, + timings: true, + assets: true, + chunks: false, + chunkModules: false, + modules: false, + children: false, + warnings: true, + }, + optimization: { + minimize: true, + sideEffects: false, + }, + output: { + path: ROOT_DIR, + library: 'ohif-extension-dicom-pdf', + libraryTarget: 'umd', + filename: `${pkg.main}`, + }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], + plugins: [ + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, + }), + // new BundleAnalyzerPlugin(), + ], + }); +}; diff --git a/extensions/dicom-pdf/package.json b/extensions/dicom-pdf/package.json index 1de3bce0611..4e6789f0377 100644 --- a/extensions/dicom-pdf/package.json +++ b/extensions/dicom-pdf/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-extension-dicom-pdf.umd.js", "module": "src/index.tsx", "engines": { "node": ">=14", @@ -20,7 +20,7 @@ "access": "public" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", "start": "yarn run dev", @@ -29,7 +29,7 @@ }, "peerDependencies": { "@ohif/core": "^3.0.0", - "@ohif/ui": "^2.0.0", + "@ohif/ui": "^3.0.0", "dcmjs": "^0.29.5", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", diff --git a/extensions/dicom-video/.webpack/webpack.dev.js b/extensions/dicom-video/.webpack/webpack.dev.js index 1ae30844802..a973e328101 100644 --- a/extensions/dicom-video/.webpack/webpack.dev.js +++ b/extensions/dicom-video/.webpack/webpack.dev.js @@ -1,8 +1,12 @@ const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +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, ENTRY, DIST_DIR }); }; diff --git a/extensions/dicom-video/.webpack/webpack.prod.js b/extensions/dicom-video/.webpack/webpack.prod.js index 946363c5366..633be1c44c3 100644 --- a/extensions/dicom-video/.webpack/webpack.prod.js +++ b/extensions/dicom-video/.webpack/webpack.prod.js @@ -1,15 +1,20 @@ const webpack = require('webpack'); -const merge = require('webpack-merge'); +const { merge } = require('webpack-merge'); const path = require('path'); const webpackCommon = require('./../../../.webpack/webpack.base.js'); const pkg = require('./../package.json'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') + .BundleAnalyzerPlugin; 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.tsx`, +}; module.exports = (env, argv) => { - const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + const commonConfig = webpackCommon(env, argv, { SRC_DIR, ENTRY, DIST_DIR }); return merge(commonConfig, { stats: { @@ -25,19 +30,26 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'OHIFExtDICOMSR', + library: 'ohif-extension-dicom-video', libraryTarget: 'umd', - libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), + // new BundleAnalyzerPlugin(), ], }); }; diff --git a/extensions/dicom-video/package.json b/extensions/dicom-video/package.json index 6447fa568d6..358d55c69f5 100644 --- a/extensions/dicom-video/package.json +++ b/extensions/dicom-video/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-extension-dicom-video.umd.js", "module": "src/index.tsx", "engines": { "node": ">=14", @@ -20,7 +20,7 @@ "access": "public" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", "start": "yarn run dev", @@ -29,7 +29,7 @@ }, "peerDependencies": { "@ohif/core": "^3.0.0", - "@ohif/ui": "^2.0.0", + "@ohif/ui": "^3.0.0", "dcmjs": "^0.29.5", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", diff --git a/extensions/measurement-tracking/.webpack/webpack.dev.js b/extensions/measurement-tracking/.webpack/webpack.dev.js index db7c206b134..6aea859ca74 100644 --- a/extensions/measurement-tracking/.webpack/webpack.dev.js +++ b/extensions/measurement-tracking/.webpack/webpack.dev.js @@ -3,6 +3,10 @@ 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 }); }; diff --git a/extensions/measurement-tracking/.webpack/webpack.prod.js b/extensions/measurement-tracking/.webpack/webpack.prod.js index e1444944f1e..1b9e2190fe2 100644 --- a/extensions/measurement-tracking/.webpack/webpack.prod.js +++ b/extensions/measurement-tracking/.webpack/webpack.prod.js @@ -2,6 +2,8 @@ const webpack = require('webpack'); const { merge } = require('webpack-merge'); const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') + .BundleAnalyzerPlugin; const pkg = require('./../package.json'); const webpackCommon = require('./../../../.webpack/webpack.base.js'); @@ -10,8 +12,12 @@ 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.tsx`, +}; + 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: { @@ -27,23 +33,26 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'OHIFExtCornerstone', + library: 'ohif-extension-measurement-tracking', libraryTarget: 'umd', - libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), - new MiniCssExtractPlugin({ - filename: './dist/[name].css', - chunkFilename: './dist/[id].css', - }), + // new BundleAnalyzerPlugin(), ], }); }; diff --git a/extensions/measurement-tracking/package.json b/extensions/measurement-tracking/package.json index 7445f872047..250dd587a14 100644 --- a/extensions/measurement-tracking/package.json +++ b/extensions/measurement-tracking/package.json @@ -5,7 +5,7 @@ "author": "OHIF Core Team", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-extension-measurement-tracking.umd.js", "module": "src/index.tsx", "publishConfig": { "access": "public" @@ -23,7 +23,7 @@ "ohif-extension" ], "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:dicom-pdf": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", @@ -42,11 +42,11 @@ "react-dom": "^17.0.2", "webpack": "^5.50.0", "webpack-merge": "^5.7.3", - "@ohif/ui": "^2.0.0" + "@ohif/ui": "^3.0.0" }, "dependencies": { "@babel/runtime": "^7.20.13", - "@ohif/ui": "^2.0.0", + "@ohif/ui": "^3.0.0", "@xstate/react": "^0.8.1", "xstate": "^4.10.0" } diff --git a/extensions/test-extension/.webpack/webpack.dev.js b/extensions/test-extension/.webpack/webpack.dev.js index 1ae30844802..96d68096d9d 100644 --- a/extensions/test-extension/.webpack/webpack.dev.js +++ b/extensions/test-extension/.webpack/webpack.dev.js @@ -1,8 +1,13 @@ const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +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 }); }; diff --git a/extensions/test-extension/.webpack/webpack.prod.js b/extensions/test-extension/.webpack/webpack.prod.js index 946363c5366..5ea22163b9b 100644 --- a/extensions/test-extension/.webpack/webpack.prod.js +++ b/extensions/test-extension/.webpack/webpack.prod.js @@ -1,5 +1,5 @@ const webpack = require('webpack'); -const merge = require('webpack-merge'); +const {merge} = require('webpack-merge'); const path = require('path'); const webpackCommon = require('./../../../.webpack/webpack.base.js'); const pkg = require('./../package.json'); @@ -8,8 +8,12 @@ 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.tsx`, +}; + 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: { @@ -25,15 +29,22 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'OHIFExtDICOMSR', + library: 'ohif-extension-test', libraryTarget: 'umd', libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, diff --git a/extensions/test-extension/package.json b/extensions/test-extension/package.json index f0640ef9949..247d48034c5 100644 --- a/extensions/test-extension/package.json +++ b/extensions/test-extension/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-extension-test.umd.js", "module": "src/index.tsx", "engines": { "node": ">=14", @@ -20,7 +20,7 @@ "access": "public" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", "start": "yarn run dev", @@ -29,7 +29,7 @@ }, "peerDependencies": { "@ohif/core": "^3.0.0", - "@ohif/ui": "^2.0.0", + "@ohif/ui": "^3.0.0", "dcmjs": "0.29.4", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", diff --git a/extensions/tmtv/.webpack/webpack.dev.js b/extensions/tmtv/.webpack/webpack.dev.js index 1ae30844802..712dce53e79 100644 --- a/extensions/tmtv/.webpack/webpack.dev.js +++ b/extensions/tmtv/.webpack/webpack.dev.js @@ -1,8 +1,8 @@ const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +const webpackCommon = require('./../../../.webpack/webpack.base.js'); const SRC_DIR = path.join(__dirname, '../src'); const DIST_DIR = path.join(__dirname, '../dist'); module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR , ENTRY}); }; diff --git a/extensions/tmtv/.webpack/webpack.prod.js b/extensions/tmtv/.webpack/webpack.prod.js index 946363c5366..05ab957fc76 100644 --- a/extensions/tmtv/.webpack/webpack.prod.js +++ b/extensions/tmtv/.webpack/webpack.prod.js @@ -1,5 +1,5 @@ const webpack = require('webpack'); -const merge = require('webpack-merge'); +const {merge} = require('webpack-merge'); const path = require('path'); const webpackCommon = require('./../../../.webpack/webpack.base.js'); const pkg = require('./../package.json'); @@ -8,8 +8,13 @@ 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.tsx`, +}; + + 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: { @@ -25,15 +30,21 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'OHIFExtDICOMSR', + library: 'ohif-extension-tmtv', libraryTarget: 'umd', - libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, diff --git a/extensions/tmtv/package.json b/extensions/tmtv/package.json index 89d25ba3b65..e519f15ea12 100644 --- a/extensions/tmtv/package.json +++ b/extensions/tmtv/package.json @@ -1,11 +1,11 @@ { "name": "@ohif/extension-tmtv", "version": "3.0.1", - "description": "OHIF extension for Total Metabolic Tumore Volume", + "description": "OHIF extension for Total Metabolic Tumor Volume", "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-extension-tmtv.umd.js", "module": "src/index.tsx", "engines": { "node": ">=14", @@ -20,7 +20,7 @@ "access": "public" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", "start": "yarn run dev", @@ -29,7 +29,7 @@ }, "peerDependencies": { "@ohif/core": "^3.0.0", - "@ohif/ui": "^2.0.0", + "@ohif/ui": "^3.0.0", "dcmjs": "^0.29.5", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", diff --git a/extensions/tmtv/src/Panels/PanelROIThresholdSegmentation/PanelROIThresholdSegmentation.tsx b/extensions/tmtv/src/Panels/PanelROIThresholdSegmentation/PanelROIThresholdSegmentation.tsx index 998eb24bb3f..a18dee1c2d7 100644 --- a/extensions/tmtv/src/Panels/PanelROIThresholdSegmentation/PanelROIThresholdSegmentation.tsx +++ b/extensions/tmtv/src/Panels/PanelROIThresholdSegmentation/PanelROIThresholdSegmentation.tsx @@ -269,7 +269,7 @@ export default function PanelRoiThresholdSegmentation({ onClick={() => { // navigate to a url in a new tab window.open( - 'https://github.com/OHIF/Viewers/blob/v3-stable/modes/tmtv/README.md', + 'https://github.com/OHIF/Viewers/blob/master/modes/tmtv/README.md', '_blank' ); }} diff --git a/lerna.json b/lerna.json index 53c6ad289c1..abb138433be 100644 --- a/lerna.json +++ b/lerna.json @@ -1,19 +1,6 @@ { - "version": "independent", + "version": "3.3.0", "packages": ["extensions/*", "platform/*", "modes/*"], "npmClient": "yarn", - "useWorkspaces": true, - "command": { - "publish": { - "ignoreChanges": ["*.md", "*.yml", "*.spec.js", "*.test.js"], - "message": "chore(release): publish" - }, - "version": { - "allowBranch": "master", - "conventionalCommits": true, - "createRelease": "github", - "yes": true, - "message": "chore(release): publish [skip ci]" - } - } + "useWorkspaces": true } diff --git a/modes/basic-dev-mode/.webpack/webpack.dev.js b/modes/basic-dev-mode/.webpack/webpack.dev.js index 1ae30844802..2bc3ced0b9b 100644 --- a/modes/basic-dev-mode/.webpack/webpack.dev.js +++ b/modes/basic-dev-mode/.webpack/webpack.dev.js @@ -1,8 +1,13 @@ const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); +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.js`, +}; + + module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); }; diff --git a/modes/basic-dev-mode/.webpack/webpack.prod.js b/modes/basic-dev-mode/.webpack/webpack.prod.js index ed60094742b..7147d3b06df 100644 --- a/modes/basic-dev-mode/.webpack/webpack.prod.js +++ b/modes/basic-dev-mode/.webpack/webpack.prod.js @@ -1,5 +1,5 @@ const webpack = require('webpack'); -const merge = require('webpack-merge'); +const { merge } = require('webpack-merge'); const path = require('path'); const webpackCommon = require('./../../../.webpack/webpack.base.js'); const pkg = require('./../package.json'); @@ -8,8 +8,13 @@ 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`, +}; + + 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: { @@ -25,15 +30,21 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'OHIFModeLongitudinal', + library: 'ohif-mode-basic-dev', libraryTarget: 'umd', - libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, diff --git a/modes/basic-dev-mode/package.json b/modes/basic-dev-mode/package.json index 27f1b447452..1bcfdcb7e8f 100644 --- a/modes/basic-dev-mode/package.json +++ b/modes/basic-dev-mode/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-mode-basic-dev-mode.umd.js", "module": "src/index.js", "engines": { "node": ">=10", @@ -20,7 +20,7 @@ "access": "public" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:cornerstone": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", diff --git a/modes/basic-test-mode/.webpack/webpack.dev.js b/modes/basic-test-mode/.webpack/webpack.dev.js index db7c206b134..2bc3ced0b9b 100644 --- a/modes/basic-test-mode/.webpack/webpack.dev.js +++ b/modes/basic-test-mode/.webpack/webpack.dev.js @@ -3,6 +3,11 @@ 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.js`, +}; + + module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); }; diff --git a/modes/basic-test-mode/.webpack/webpack.prod.js b/modes/basic-test-mode/.webpack/webpack.prod.js index ecd8874190d..677f4788132 100644 --- a/modes/basic-test-mode/.webpack/webpack.prod.js +++ b/modes/basic-test-mode/.webpack/webpack.prod.js @@ -10,9 +10,12 @@ const ROOT_DIR = path.join(__dirname, './../'); const SRC_DIR = path.join(__dirname, '../src'); const DIST_DIR = path.join(__dirname, '../dist'); -const fileName = 'index.umd.js'; +const ENTRY = { + app: `${SRC_DIR}/index.js`, +}; + 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: { @@ -28,23 +31,30 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'OHIFExtCornerstone', + library: 'ohif-mode-basic-test', libraryTarget: 'umd', libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), - new MiniCssExtractPlugin({ - filename: './dist/[name].css', - chunkFilename: './dist/[id].css', - }), + // new MiniCssExtractPlugin({ + // filename: './dist/[name].css', + // chunkFilename: './dist/[id].css', + // }), ], }); }; diff --git a/modes/basic-test-mode/package.json b/modes/basic-test-mode/package.json index 226069f86e7..79b5e879130 100644 --- a/modes/basic-test-mode/package.json +++ b/modes/basic-test-mode/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-mode-test.umd.js", "module": "src/index.js", "engines": { "node": ">=14", @@ -23,7 +23,7 @@ "ohif-mode" ], "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:cornerstone": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", diff --git a/modes/longitudinal/.webpack/webpack.dev.js b/modes/longitudinal/.webpack/webpack.dev.js index db7c206b134..2bc3ced0b9b 100644 --- a/modes/longitudinal/.webpack/webpack.dev.js +++ b/modes/longitudinal/.webpack/webpack.dev.js @@ -3,6 +3,11 @@ 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.js`, +}; + + module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); }; diff --git a/modes/longitudinal/.webpack/webpack.prod.js b/modes/longitudinal/.webpack/webpack.prod.js index ecd8874190d..98ab53e9248 100644 --- a/modes/longitudinal/.webpack/webpack.prod.js +++ b/modes/longitudinal/.webpack/webpack.prod.js @@ -9,10 +9,12 @@ const webpackCommon = require('./../../../.webpack/webpack.base.js'); 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 fileName = 'index.umd.js'; 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: { @@ -28,23 +30,30 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'OHIFExtCornerstone', + library: 'ohif-mode-longitudinal', libraryTarget: 'umd', libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), - new MiniCssExtractPlugin({ - filename: './dist/[name].css', - chunkFilename: './dist/[id].css', - }), + // new MiniCssExtractPlugin({ + // filename: './dist/[name].css', + // chunkFilename: './dist/[id].css', + // }), ], }); }; diff --git a/modes/longitudinal/package.json b/modes/longitudinal/package.json index 32cd0ed37cd..f883528a746 100644 --- a/modes/longitudinal/package.json +++ b/modes/longitudinal/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-mode-longitudinal.js", "module": "src/index.js", "engines": { "node": ">=14", @@ -23,7 +23,7 @@ "ohif-mode" ], "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:cornerstone": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", diff --git a/modes/microscopy/.webpack/webpack.dev.js b/modes/microscopy/.webpack/webpack.dev.js index db7c206b134..cf62de65167 100644 --- a/modes/microscopy/.webpack/webpack.dev.js +++ b/modes/microscopy/.webpack/webpack.dev.js @@ -3,6 +3,13 @@ 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.js`, +}; + + + module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); }; diff --git a/modes/microscopy/.webpack/webpack.prod.js b/modes/microscopy/.webpack/webpack.prod.js index 163392a699a..6379fa8e534 100644 --- a/modes/microscopy/.webpack/webpack.prod.js +++ b/modes/microscopy/.webpack/webpack.prod.js @@ -1,62 +1,59 @@ +const webpack = require('webpack'); +const { merge } = require('webpack-merge'); const path = require('path'); -const pkg = require('../package.json'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const outputFile = 'index.umd.js'; -const rootDir = path.resolve(__dirname, '../'); -const outputFolder = path.join(__dirname, `../dist/umd/${pkg.name}/`); +const pkg = require('./../package.json'); +const webpackCommon = require('./../../../.webpack/webpack.base.js'); -// Todo: add ESM build for the mode in addition to umd build -const config = { - mode: 'production', - entry: rootDir + '/' + pkg.module, - devtool: 'source-map', - output: { - path: outputFolder, - filename: outputFile, - library: pkg.name, - libraryTarget: 'umd', - chunkFilename: '[name].chunk.js', - umdNamedDefine: true, - globalObject: "typeof self !== 'undefined' ? self : this", - }, - externals: [ - { - react: { - root: 'React', - commonjs2: 'react', - commonjs: 'react', - amd: 'react', - }, - '@ohif/core': { - commonjs2: '@ohif/core', - commonjs: '@ohif/core', - amd: '@ohif/core', - root: '@ohif/core', - }, - '@ohif/ui': { - commonjs2: '@ohif/ui', - commonjs: '@ohif/ui', - amd: '@ohif/ui', - root: '@ohif/ui', - }, +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.tsx`, +}; + +module.exports = (env, argv) => { + const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); + + return merge(commonConfig, { + stats: { + colors: true, + hash: true, + timings: true, + assets: true, + chunks: false, + chunkModules: false, + modules: false, + children: false, + warnings: true, + }, + optimization: { + minimize: true, + sideEffects: false, }, - ], - module: { - rules: [ - { - test: /(\.jsx|\.js|\.tsx|\.ts)$/, - loader: 'babel-loader', - exclude: /(node_modules|bower_components)/, - resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }, - }, + output: { + path: ROOT_DIR, + library: 'ohif-mode-microscopy', + libraryTarget: 'umd', + libraryExport: 'default', + filename: pkg.main, + }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], + plugins: [ + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, + }), + // new MiniCssExtractPlugin({ + // filename: './dist/[name].css', + // chunkFilename: './dist/[id].css', + // }), ], - }, - resolve: { - modules: [path.resolve('./node_modules'), path.resolve('./src')], - extensions: ['.json', '.js', '.jsx', '.tsx', '.ts'], - }, + }); }; - -module.exports = config; diff --git a/modes/microscopy/package.json b/modes/microscopy/package.json index 5490a3de54b..5080cfeb8f3 100644 --- a/modes/microscopy/package.json +++ b/modes/microscopy/package.json @@ -2,9 +2,9 @@ "name": "@ohif/mode-microscopy", "version": "3.0.0", "description": "OHIF mode for DICOM microscopy", - "author": "Bill Wallace, md-prog", + "author": "OHIF", "license": "MIT", - "main": "dist/umd/@ohif/mode-microscopy/index.umd.js", + "main": "dist/ohif-mode-microscopy.umd.js", "files": [ "dist/**", "public/**", @@ -14,6 +14,9 @@ "keywords": [ "ohif-mode" ], + "publishConfig": { + "access": "public" + }, "module": "src/index.tsx", "engines": { "node": ">=14", @@ -21,7 +24,7 @@ "yarn": ">=1.16.0" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:cornerstone": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", diff --git a/modes/tmtv/.webpack/webpack.dev.js b/modes/tmtv/.webpack/webpack.dev.js index db7c206b134..2bc3ced0b9b 100644 --- a/modes/tmtv/.webpack/webpack.dev.js +++ b/modes/tmtv/.webpack/webpack.dev.js @@ -3,6 +3,11 @@ 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.js`, +}; + + module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); }; diff --git a/modes/tmtv/.webpack/webpack.prod.js b/modes/tmtv/.webpack/webpack.prod.js index ecd8874190d..385ed85ced1 100644 --- a/modes/tmtv/.webpack/webpack.prod.js +++ b/modes/tmtv/.webpack/webpack.prod.js @@ -10,9 +10,13 @@ const ROOT_DIR = path.join(__dirname, './../'); const SRC_DIR = path.join(__dirname, '../src'); const DIST_DIR = path.join(__dirname, '../dist'); -const fileName = 'index.umd.js'; +const ENTRY = { + app: `${SRC_DIR}/index.js`, +}; + + 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: { @@ -28,23 +32,30 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'OHIFExtCornerstone', + library: 'ohif-mode-tmtv', libraryTarget: 'umd', libraryExport: 'default', filename: pkg.main, }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@ohif/, + /^@cornerstonejs/, + ], plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), - new MiniCssExtractPlugin({ - filename: './dist/[name].css', - chunkFilename: './dist/[id].css', - }), + // new MiniCssExtractPlugin({ + // filename: './dist/[name].css', + // chunkFilename: './dist/[id].css', + // }), ], }); }; diff --git a/modes/tmtv/package.json b/modes/tmtv/package.json index 3fec25c27ac..8b9fc670a96 100644 --- a/modes/tmtv/package.json +++ b/modes/tmtv/package.json @@ -5,7 +5,7 @@ "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-mode-tmtv.umd.js", "module": "src/index.js", "engines": { "node": ">=14", @@ -23,7 +23,7 @@ "ohif-mode" ], "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:cornerstone": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", diff --git a/nx.json b/nx.json index 043289266d9..5ba23220da4 100644 --- a/nx.json +++ b/nx.json @@ -51,7 +51,7 @@ "dependsOn": ["^test:e2e:serve"] }, "build": { - "outputs": ["{projectRoot}/platform/viewer/dist"] + "outputs": ["{projectRoot}/platform/app/dist"] } } } diff --git a/package.json b/package.json index 747fd461eff..350c7d48875 100644 --- a/package.json +++ b/package.json @@ -50,8 +50,7 @@ "lerna:clean": "lerna clean", "lerna:cache": "./netlify-lerna-cache.sh", "lerna:restore": "./netlify-lerna-restore.sh", - "lerna:version": "npx lerna version prerelease --force-publish", - "lerna:publish": "lerna publish from-package --dist-tag next", + "lerna:customVersion": "node version.mjs", "link-list": "npm ls --depth=0 --link=true" }, "dependencies": { @@ -103,6 +102,7 @@ "eslint-plugin-react-hooks": "^4.4.0", "eslint-plugin-tsdoc": "^0.2.11", "eslint-webpack-plugin": "^2.5.3", + "execa": "^7.1.1", "extract-css-chunks-webpack-plugin": "^4.5.4", "html-webpack-plugin": "^5.3.2", "husky": "^3.0.0", @@ -120,6 +120,7 @@ "postcss-preset-env": "^7.4.3", "prettier": "^1.18.2", "react-hot-loader": "^4.13.0", + "semver": "^7.5.1", "serve": "^14.2.0", "shader-loader": "^1.3.1", "start-server-and-test": "^1.10.0", diff --git a/platform/viewer/.all-contributorsrc b/platform/app/.all-contributorsrc similarity index 100% rename from platform/viewer/.all-contributorsrc rename to platform/app/.all-contributorsrc diff --git a/platform/viewer/.browserslistrc b/platform/app/.browserslistrc similarity index 100% rename from platform/viewer/.browserslistrc rename to platform/app/.browserslistrc diff --git a/platform/viewer/.dockerignore b/platform/app/.dockerignore similarity index 100% rename from platform/viewer/.dockerignore rename to platform/app/.dockerignore diff --git a/platform/viewer/.env b/platform/app/.env similarity index 100% rename from platform/viewer/.env rename to platform/app/.env diff --git a/platform/viewer/.env.example b/platform/app/.env.example similarity index 100% rename from platform/viewer/.env.example rename to platform/app/.env.example diff --git a/platform/viewer/.eslintignore b/platform/app/.eslintignore similarity index 100% rename from platform/viewer/.eslintignore rename to platform/app/.eslintignore diff --git a/platform/viewer/.recipes/Nginx-Dcm4che/docker-compose-dcm4che.env b/platform/app/.recipes/Nginx-Dcm4che/docker-compose-dcm4che.env similarity index 100% rename from platform/viewer/.recipes/Nginx-Dcm4che/docker-compose-dcm4che.env rename to platform/app/.recipes/Nginx-Dcm4che/docker-compose-dcm4che.env diff --git a/platform/viewer/.recipes/Nginx-Dcm4che/docker-compose.yml b/platform/app/.recipes/Nginx-Dcm4che/docker-compose.yml similarity index 100% rename from platform/viewer/.recipes/Nginx-Dcm4che/docker-compose.yml rename to platform/app/.recipes/Nginx-Dcm4che/docker-compose.yml diff --git a/platform/viewer/.recipes/Nginx-Dcm4che/etc/localtime b/platform/app/.recipes/Nginx-Dcm4che/etc/localtime similarity index 100% rename from platform/viewer/.recipes/Nginx-Dcm4che/etc/localtime rename to platform/app/.recipes/Nginx-Dcm4che/etc/localtime diff --git a/platform/viewer/.recipes/Nginx-Dcm4che/etc/timezone b/platform/app/.recipes/Nginx-Dcm4che/etc/timezone similarity index 100% rename from platform/viewer/.recipes/Nginx-Dcm4che/etc/timezone rename to platform/app/.recipes/Nginx-Dcm4che/etc/timezone diff --git a/platform/viewer/.recipes/Nginx-Dcm4che/nginx-proxy/conf/nginx.conf b/platform/app/.recipes/Nginx-Dcm4che/nginx-proxy/conf/nginx.conf similarity index 100% rename from platform/viewer/.recipes/Nginx-Dcm4che/nginx-proxy/conf/nginx.conf rename to platform/app/.recipes/Nginx-Dcm4che/nginx-proxy/conf/nginx.conf diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/.dockerignore b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/.dockerignore similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/.dockerignore rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/.dockerignore diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/.env b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/.env similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/.env rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/.env diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/config/nginx.conf b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/config/nginx.conf similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/config/nginx.conf rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/config/nginx.conf diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/config/ohif-keycloak-realm.json b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/config/ohif-keycloak-realm.json similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/config/ohif-keycloak-realm.json rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/config/ohif-keycloak-realm.json diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/config/orthanc.json b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/config/orthanc.json similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/config/orthanc.json rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/config/orthanc.json diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/docker-compose.yml b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/docker-compose.yml similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/docker-compose.yml rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/docker-compose.yml diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/dockerfile b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/dockerfile rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/account/.githold b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/account/.githold similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/account/.githold rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/account/.githold diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/admin/.githold b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/admin/.githold similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/admin/.githold rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/admin/.githold diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/email/.githold b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/email/.githold similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/email/.githold rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/email/.githold diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/resources/css/styles.css b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/resources/css/styles.css similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/resources/css/styles.css rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/resources/css/styles.css diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/resources/img/background.jpg b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/resources/img/background.jpg similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/resources/img/background.jpg rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/resources/img/background.jpg diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/theme.properties b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/theme.properties similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/theme.properties rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/login/theme.properties diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/welcome/.githold b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/welcome/.githold similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/welcome/.githold rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/keycloak-themes/ohif/welcome/.githold diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/orthanc-db/.gitignore b/platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/orthanc-db/.gitignore similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/volumes/orthanc-db/.gitignore rename to platform/app/.recipes/OpenResty-Orthanc-Keycloak/volumes/orthanc-db/.gitignore diff --git a/platform/viewer/.recipes/OpenResty-Orthanc/.dockerignore b/platform/app/.recipes/OpenResty-Orthanc/.dockerignore similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc/.dockerignore rename to platform/app/.recipes/OpenResty-Orthanc/.dockerignore diff --git a/platform/viewer/.recipes/OpenResty-Orthanc/.env b/platform/app/.recipes/OpenResty-Orthanc/.env similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc/.env rename to platform/app/.recipes/OpenResty-Orthanc/.env diff --git a/platform/viewer/.recipes/OpenResty-Orthanc/config/nginx.conf b/platform/app/.recipes/OpenResty-Orthanc/config/nginx.conf similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc/config/nginx.conf rename to platform/app/.recipes/OpenResty-Orthanc/config/nginx.conf diff --git a/platform/viewer/.recipes/OpenResty-Orthanc/config/orthanc.json b/platform/app/.recipes/OpenResty-Orthanc/config/orthanc.json similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc/config/orthanc.json rename to platform/app/.recipes/OpenResty-Orthanc/config/orthanc.json diff --git a/platform/viewer/.recipes/OpenResty-Orthanc/docker-compose.yml b/platform/app/.recipes/OpenResty-Orthanc/docker-compose.yml similarity index 94% rename from platform/viewer/.recipes/OpenResty-Orthanc/docker-compose.yml rename to platform/app/.recipes/OpenResty-Orthanc/docker-compose.yml index f6626027a4d..824ae5a3e1d 100644 --- a/platform/viewer/.recipes/OpenResty-Orthanc/docker-compose.yml +++ b/platform/app/.recipes/OpenResty-Orthanc/docker-compose.yml @@ -12,7 +12,7 @@ services: # Project root context: ./../../../../ # Relative to context - dockerfile: ./platform/viewer/.recipes/OpenResty-Orthanc/dockerfile + dockerfile: ./platform/app/.recipes/OpenResty-Orthanc/dockerfile image: webapp:latest container_name: webapp volumes: diff --git a/platform/viewer/.recipes/OpenResty-Orthanc/dockerfile b/platform/app/.recipes/OpenResty-Orthanc/dockerfile similarity index 97% rename from platform/viewer/.recipes/OpenResty-Orthanc/dockerfile rename to platform/app/.recipes/OpenResty-Orthanc/dockerfile index cbad2bf5b7b..768cbc576e7 100644 --- a/platform/viewer/.recipes/OpenResty-Orthanc/dockerfile +++ b/platform/app/.recipes/OpenResty-Orthanc/dockerfile @@ -79,6 +79,6 @@ RUN luarocks install lua-resty-openidc RUN luarocks install luacrypto # Copy build output to image -COPY --from=builder /usr/src/app/platform/viewer/dist /var/www/html +COPY --from=builder /usr/src/app/platform/app/dist /var/www/html ENTRYPOINT ["/usr/local/openresty/nginx/sbin/nginx", "-g", "daemon off;"] diff --git a/platform/viewer/.recipes/OpenResty-Orthanc/volumes/orthanc-db/.gitignore b/platform/app/.recipes/OpenResty-Orthanc/volumes/orthanc-db/.gitignore similarity index 100% rename from platform/viewer/.recipes/OpenResty-Orthanc/volumes/orthanc-db/.gitignore rename to platform/app/.recipes/OpenResty-Orthanc/volumes/orthanc-db/.gitignore diff --git a/platform/viewer/.recipes/README.md b/platform/app/.recipes/README.md similarity index 100% rename from platform/viewer/.recipes/README.md rename to platform/app/.recipes/README.md diff --git a/platform/viewer/.webpack/rules/extractStyleChunks.js b/platform/app/.webpack/rules/extractStyleChunks.js similarity index 100% rename from platform/viewer/.webpack/rules/extractStyleChunks.js rename to platform/app/.webpack/rules/extractStyleChunks.js diff --git a/platform/viewer/.webpack/rules/fontsToJavaScript.js b/platform/app/.webpack/rules/fontsToJavaScript.js similarity index 100% rename from platform/viewer/.webpack/rules/fontsToJavaScript.js rename to platform/app/.webpack/rules/fontsToJavaScript.js diff --git a/platform/viewer/.webpack/webpack.pwa.js b/platform/app/.webpack/webpack.pwa.js similarity index 100% rename from platform/viewer/.webpack/webpack.pwa.js rename to platform/app/.webpack/webpack.pwa.js diff --git a/platform/viewer/.webpack/writePluginImportsFile.js b/platform/app/.webpack/writePluginImportsFile.js similarity index 100% rename from platform/viewer/.webpack/writePluginImportsFile.js rename to platform/app/.webpack/writePluginImportsFile.js diff --git a/platform/viewer/CHANGELOG.md b/platform/app/CHANGELOG.md similarity index 100% rename from platform/viewer/CHANGELOG.md rename to platform/app/CHANGELOG.md diff --git a/platform/viewer/LICENSE b/platform/app/LICENSE similarity index 100% rename from platform/viewer/LICENSE rename to platform/app/LICENSE diff --git a/platform/viewer/README.md b/platform/app/README.md similarity index 96% rename from platform/viewer/README.md rename to platform/app/README.md index b182470c1b3..f1e1dd135d7 100644 --- a/platform/viewer/README.md +++ b/platform/app/README.md @@ -1,8 +1,8 @@
-

@ohif/viewer

-

@ohif/viewer is a zero-footprint medical image viewer provided by the Open Health Imaging Foundation (OHIF). It is a configurable and extensible progressive web application with out-of-the-box support for image archives which support DICOMweb.

+

@ohif/app

+

@ohif/app is a zero-footprint medical image viewer provided by the Open Health Imaging Foundation (OHIF). It is a configurable and extensible progressive web application with out-of-the-box support for image archives which support DICOMweb.

diff --git a/platform/viewer/assets/open-graph.fig b/platform/app/assets/open-graph.fig similarity index 100% rename from platform/viewer/assets/open-graph.fig rename to platform/app/assets/open-graph.fig diff --git a/platform/viewer/babel.config.js b/platform/app/babel.config.js similarity index 100% rename from platform/viewer/babel.config.js rename to platform/app/babel.config.js diff --git a/platform/viewer/cypress.config.ts b/platform/app/cypress.config.ts similarity index 100% rename from platform/viewer/cypress.config.ts rename to platform/app/cypress.config.ts diff --git a/platform/viewer/cypress/.eslintrc.js b/platform/app/cypress/.eslintrc.js similarity index 100% rename from platform/viewer/cypress/.eslintrc.js rename to platform/app/cypress/.eslintrc.js diff --git a/platform/viewer/cypress/fixtures/example.json b/platform/app/cypress/fixtures/example.json similarity index 100% rename from platform/viewer/cypress/fixtures/example.json rename to platform/app/cypress/fixtures/example.json diff --git a/platform/viewer/cypress/integration/OHIFPdfDisplay.spec.js b/platform/app/cypress/integration/OHIFPdfDisplay.spec.js similarity index 100% rename from platform/viewer/cypress/integration/OHIFPdfDisplay.spec.js rename to platform/app/cypress/integration/OHIFPdfDisplay.spec.js diff --git a/platform/viewer/cypress/integration/OHIFVideoDisplay.spec.js b/platform/app/cypress/integration/OHIFVideoDisplay.spec.js similarity index 100% rename from platform/viewer/cypress/integration/OHIFVideoDisplay.spec.js rename to platform/app/cypress/integration/OHIFVideoDisplay.spec.js diff --git a/platform/viewer/cypress/integration/customization/HangingProtocol.spec.js b/platform/app/cypress/integration/customization/HangingProtocol.spec.js similarity index 100% rename from platform/viewer/cypress/integration/customization/HangingProtocol.spec.js rename to platform/app/cypress/integration/customization/HangingProtocol.spec.js diff --git a/platform/viewer/cypress/integration/customization/OHIFDoubleClick.spec.js b/platform/app/cypress/integration/customization/OHIFDoubleClick.spec.js similarity index 100% rename from platform/viewer/cypress/integration/customization/OHIFDoubleClick.spec.js rename to platform/app/cypress/integration/customization/OHIFDoubleClick.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/OHIFContextMenuCustomization.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFContextMenuCustomization.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/OHIFContextMenuCustomization.spec.js rename to platform/app/cypress/integration/measurement-tracking/OHIFContextMenuCustomization.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/OHIFCornerstoneHotkeys.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneHotkeys.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/OHIFCornerstoneHotkeys.spec.js rename to platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneHotkeys.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js rename to platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/OHIFDownloadSnapshotFile.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFDownloadSnapshotFile.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/OHIFDownloadSnapshotFile.spec.js rename to platform/app/cypress/integration/measurement-tracking/OHIFDownloadSnapshotFile.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/OHIFGeneralViewer.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFGeneralViewer.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/OHIFGeneralViewer.spec.js rename to platform/app/cypress/integration/measurement-tracking/OHIFGeneralViewer.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/OHIFMeasurementPanel.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFMeasurementPanel.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/OHIFMeasurementPanel.spec.js rename to platform/app/cypress/integration/measurement-tracking/OHIFMeasurementPanel.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/OHIFSaveMeasurements.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFSaveMeasurements.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/OHIFSaveMeasurements.spec.js rename to platform/app/cypress/integration/measurement-tracking/OHIFSaveMeasurements.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/OHIFStudyBrowser.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFStudyBrowser.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/OHIFStudyBrowser.spec.js rename to platform/app/cypress/integration/measurement-tracking/OHIFStudyBrowser.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFCornerstoneHotkeys.spec.js b/platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFCornerstoneHotkeys.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFCornerstoneHotkeys.spec.js rename to platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFCornerstoneHotkeys.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFCornerstoneToolbar.spec.js b/platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFCornerstoneToolbar.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFCornerstoneToolbar.spec.js rename to platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFCornerstoneToolbar.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFDownloadSnapshotFile.spec.js b/platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFDownloadSnapshotFile.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFDownloadSnapshotFile.spec.js rename to platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFDownloadSnapshotFile.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFStudyViewer.spec.js b/platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFStudyViewer.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFStudyViewer.spec.js rename to platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFStudyViewer.spec.js diff --git a/platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFUserPreferences.spec.js b/platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFUserPreferences.spec.js similarity index 100% rename from platform/viewer/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFUserPreferences.spec.js rename to platform/app/cypress/integration/measurement-tracking/visual-regression/PercyCheckOHIFUserPreferences.spec.js diff --git a/platform/viewer/cypress/integration/study-list/OHIFStudyList.spec.js b/platform/app/cypress/integration/study-list/OHIFStudyList.spec.js similarity index 100% rename from platform/viewer/cypress/integration/study-list/OHIFStudyList.spec.js rename to platform/app/cypress/integration/study-list/OHIFStudyList.spec.js diff --git a/platform/viewer/cypress/integration/study-list/OHIFUserPreferences.spec.js b/platform/app/cypress/integration/study-list/OHIFUserPreferences.spec.js similarity index 100% rename from platform/viewer/cypress/integration/study-list/OHIFUserPreferences.spec.js rename to platform/app/cypress/integration/study-list/OHIFUserPreferences.spec.js diff --git a/platform/viewer/cypress/integration/volume/MPR.spec.js b/platform/app/cypress/integration/volume/MPR.spec.js similarity index 100% rename from platform/viewer/cypress/integration/volume/MPR.spec.js rename to platform/app/cypress/integration/volume/MPR.spec.js diff --git a/platform/viewer/cypress/plugins/index.js b/platform/app/cypress/plugins/index.js similarity index 100% rename from platform/viewer/cypress/plugins/index.js rename to platform/app/cypress/plugins/index.js diff --git a/platform/viewer/cypress/results/.gitignore b/platform/app/cypress/results/.gitignore similarity index 100% rename from platform/viewer/cypress/results/.gitignore rename to platform/app/cypress/results/.gitignore diff --git a/platform/viewer/cypress/support/DragSimulator.js b/platform/app/cypress/support/DragSimulator.js similarity index 100% rename from platform/viewer/cypress/support/DragSimulator.js rename to platform/app/cypress/support/DragSimulator.js diff --git a/platform/viewer/cypress/support/aliases.js b/platform/app/cypress/support/aliases.js similarity index 100% rename from platform/viewer/cypress/support/aliases.js rename to platform/app/cypress/support/aliases.js diff --git a/platform/viewer/cypress/support/commands.js b/platform/app/cypress/support/commands.js similarity index 100% rename from platform/viewer/cypress/support/commands.js rename to platform/app/cypress/support/commands.js diff --git a/platform/viewer/cypress/support/index.js b/platform/app/cypress/support/index.js similarity index 100% rename from platform/viewer/cypress/support/index.js rename to platform/app/cypress/support/index.js diff --git a/platform/app/jest.config.js b/platform/app/jest.config.js new file mode 100644 index 00000000000..63f2459e018 --- /dev/null +++ b/platform/app/jest.config.js @@ -0,0 +1,14 @@ +const base = require('../../jest.config.base.js'); +const pkg = require('./package'); + +module.exports = { + ...base, + name: pkg.name, + displayName: pkg.name, + setupFilesAfterEnv: ['/src/__tests__/globalSetup.js'], + // rootDir: "../.." + // testMatch: [ + // //`/platform/${pack.name}/**/*.spec.js` + // "/platform/app/**/*.test.js" + // ] +}; diff --git a/platform/viewer/jestBabelTransform.js b/platform/app/jestBabelTransform.js similarity index 100% rename from platform/viewer/jestBabelTransform.js rename to platform/app/jestBabelTransform.js diff --git a/platform/viewer/netlify.toml b/platform/app/netlify.toml similarity index 100% rename from platform/viewer/netlify.toml rename to platform/app/netlify.toml diff --git a/platform/viewer/package.json b/platform/app/package.json similarity index 97% rename from platform/viewer/package.json rename to platform/app/package.json index 4a487787a17..437f18c90d6 100644 --- a/platform/viewer/package.json +++ b/platform/app/package.json @@ -1,7 +1,7 @@ { - "name": "@ohif/viewer", - "version": "5.0.0", - "productVersion": "3.3.0", + "name": "@ohif/app", + "version": "3.0.0", + "productVersion": "3.4.0", "description": "OHIF Viewer", "author": "OHIF Contributors", "license": "MIT", @@ -57,12 +57,12 @@ "@ohif/extension-dicom-video": "^3.0.1", "@ohif/extension-dicom-microscopy": "^3.0.0", "@ohif/extension-test": "0.0.1", - "@ohif/i18n": "^1.0.0", + "@ohif/i18n": "^3.0.0", "@ohif/mode-basic-dev-mode": "^3.0.0", "@ohif/mode-test": "^0.0.1", "@ohif/mode-longitudinal": "^3.0.0", "@ohif/mode-microscopy": "^3.0.0", - "@ohif/ui": "^2.0.0", + "@ohif/ui": "^3.0.0", "@types/react": "^17.0.38", "classnames": "^2.3.2", "core-js": "^3.16.1", diff --git a/platform/viewer/pluginConfig.json b/platform/app/pluginConfig.json similarity index 100% rename from platform/viewer/pluginConfig.json rename to platform/app/pluginConfig.json diff --git a/platform/viewer/postcss.config.js b/platform/app/postcss.config.js similarity index 100% rename from platform/viewer/postcss.config.js rename to platform/app/postcss.config.js diff --git a/platform/viewer/preinstall.js b/platform/app/preinstall.js similarity index 100% rename from platform/viewer/preinstall.js rename to platform/app/preinstall.js diff --git a/platform/viewer/public/_headers b/platform/app/public/_headers similarity index 100% rename from platform/viewer/public/_headers rename to platform/app/public/_headers diff --git a/platform/viewer/public/_redirects b/platform/app/public/_redirects similarity index 100% rename from platform/viewer/public/_redirects rename to platform/app/public/_redirects diff --git a/platform/viewer/public/assets/android-chrome-144x144.png b/platform/app/public/assets/android-chrome-144x144.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-144x144.png rename to platform/app/public/assets/android-chrome-144x144.png diff --git a/platform/viewer/public/assets/android-chrome-192x192.png b/platform/app/public/assets/android-chrome-192x192.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-192x192.png rename to platform/app/public/assets/android-chrome-192x192.png diff --git a/platform/viewer/public/assets/android-chrome-256x256.png b/platform/app/public/assets/android-chrome-256x256.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-256x256.png rename to platform/app/public/assets/android-chrome-256x256.png diff --git a/platform/viewer/public/assets/android-chrome-36x36.png b/platform/app/public/assets/android-chrome-36x36.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-36x36.png rename to platform/app/public/assets/android-chrome-36x36.png diff --git a/platform/viewer/public/assets/android-chrome-384x384.png b/platform/app/public/assets/android-chrome-384x384.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-384x384.png rename to platform/app/public/assets/android-chrome-384x384.png diff --git a/platform/viewer/public/assets/android-chrome-48x48.png b/platform/app/public/assets/android-chrome-48x48.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-48x48.png rename to platform/app/public/assets/android-chrome-48x48.png diff --git a/platform/viewer/public/assets/android-chrome-512x512.png b/platform/app/public/assets/android-chrome-512x512.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-512x512.png rename to platform/app/public/assets/android-chrome-512x512.png diff --git a/platform/viewer/public/assets/android-chrome-72x72.png b/platform/app/public/assets/android-chrome-72x72.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-72x72.png rename to platform/app/public/assets/android-chrome-72x72.png diff --git a/platform/viewer/public/assets/android-chrome-96x96.png b/platform/app/public/assets/android-chrome-96x96.png similarity index 100% rename from platform/viewer/public/assets/android-chrome-96x96.png rename to platform/app/public/assets/android-chrome-96x96.png diff --git a/platform/viewer/public/assets/apple-touch-icon-1024x1024.png b/platform/app/public/assets/apple-touch-icon-1024x1024.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-1024x1024.png rename to platform/app/public/assets/apple-touch-icon-1024x1024.png diff --git a/platform/viewer/public/assets/apple-touch-icon-114x114.png b/platform/app/public/assets/apple-touch-icon-114x114.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-114x114.png rename to platform/app/public/assets/apple-touch-icon-114x114.png diff --git a/platform/viewer/public/assets/apple-touch-icon-120x120.png b/platform/app/public/assets/apple-touch-icon-120x120.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-120x120.png rename to platform/app/public/assets/apple-touch-icon-120x120.png diff --git a/platform/viewer/public/assets/apple-touch-icon-144x144.png b/platform/app/public/assets/apple-touch-icon-144x144.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-144x144.png rename to platform/app/public/assets/apple-touch-icon-144x144.png diff --git a/platform/viewer/public/assets/apple-touch-icon-152x152.png b/platform/app/public/assets/apple-touch-icon-152x152.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-152x152.png rename to platform/app/public/assets/apple-touch-icon-152x152.png diff --git a/platform/viewer/public/assets/apple-touch-icon-167x167.png b/platform/app/public/assets/apple-touch-icon-167x167.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-167x167.png rename to platform/app/public/assets/apple-touch-icon-167x167.png diff --git a/platform/viewer/public/assets/apple-touch-icon-180x180.png b/platform/app/public/assets/apple-touch-icon-180x180.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-180x180.png rename to platform/app/public/assets/apple-touch-icon-180x180.png diff --git a/platform/viewer/public/assets/apple-touch-icon-57x57.png b/platform/app/public/assets/apple-touch-icon-57x57.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-57x57.png rename to platform/app/public/assets/apple-touch-icon-57x57.png diff --git a/platform/viewer/public/assets/apple-touch-icon-60x60.png b/platform/app/public/assets/apple-touch-icon-60x60.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-60x60.png rename to platform/app/public/assets/apple-touch-icon-60x60.png diff --git a/platform/viewer/public/assets/apple-touch-icon-72x72.png b/platform/app/public/assets/apple-touch-icon-72x72.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-72x72.png rename to platform/app/public/assets/apple-touch-icon-72x72.png diff --git a/platform/viewer/public/assets/apple-touch-icon-76x76.png b/platform/app/public/assets/apple-touch-icon-76x76.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-76x76.png rename to platform/app/public/assets/apple-touch-icon-76x76.png diff --git a/platform/viewer/public/assets/apple-touch-icon-precomposed.png b/platform/app/public/assets/apple-touch-icon-precomposed.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon-precomposed.png rename to platform/app/public/assets/apple-touch-icon-precomposed.png diff --git a/platform/viewer/public/assets/apple-touch-icon.png b/platform/app/public/assets/apple-touch-icon.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-icon.png rename to platform/app/public/assets/apple-touch-icon.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-1182x2208.png b/platform/app/public/assets/apple-touch-startup-image-1182x2208.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-1182x2208.png rename to platform/app/public/assets/apple-touch-startup-image-1182x2208.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-1242x2148.png b/platform/app/public/assets/apple-touch-startup-image-1242x2148.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-1242x2148.png rename to platform/app/public/assets/apple-touch-startup-image-1242x2148.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-1496x2048.png b/platform/app/public/assets/apple-touch-startup-image-1496x2048.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-1496x2048.png rename to platform/app/public/assets/apple-touch-startup-image-1496x2048.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-1536x2008.png b/platform/app/public/assets/apple-touch-startup-image-1536x2008.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-1536x2008.png rename to platform/app/public/assets/apple-touch-startup-image-1536x2008.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-320x460.png b/platform/app/public/assets/apple-touch-startup-image-320x460.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-320x460.png rename to platform/app/public/assets/apple-touch-startup-image-320x460.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-640x1096.png b/platform/app/public/assets/apple-touch-startup-image-640x1096.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-640x1096.png rename to platform/app/public/assets/apple-touch-startup-image-640x1096.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-640x920.png b/platform/app/public/assets/apple-touch-startup-image-640x920.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-640x920.png rename to platform/app/public/assets/apple-touch-startup-image-640x920.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-748x1024.png b/platform/app/public/assets/apple-touch-startup-image-748x1024.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-748x1024.png rename to platform/app/public/assets/apple-touch-startup-image-748x1024.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-750x1294.png b/platform/app/public/assets/apple-touch-startup-image-750x1294.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-750x1294.png rename to platform/app/public/assets/apple-touch-startup-image-750x1294.png diff --git a/platform/viewer/public/assets/apple-touch-startup-image-768x1004.png b/platform/app/public/assets/apple-touch-startup-image-768x1004.png similarity index 100% rename from platform/viewer/public/assets/apple-touch-startup-image-768x1004.png rename to platform/app/public/assets/apple-touch-startup-image-768x1004.png diff --git a/platform/viewer/public/assets/browserconfig.xml b/platform/app/public/assets/browserconfig.xml similarity index 100% rename from platform/viewer/public/assets/browserconfig.xml rename to platform/app/public/assets/browserconfig.xml diff --git a/platform/viewer/public/assets/coast-228x228.png b/platform/app/public/assets/coast-228x228.png similarity index 100% rename from platform/viewer/public/assets/coast-228x228.png rename to platform/app/public/assets/coast-228x228.png diff --git a/platform/viewer/public/assets/favicon-16x16.png b/platform/app/public/assets/favicon-16x16.png similarity index 100% rename from platform/viewer/public/assets/favicon-16x16.png rename to platform/app/public/assets/favicon-16x16.png diff --git a/platform/viewer/public/assets/favicon-32x32.png b/platform/app/public/assets/favicon-32x32.png similarity index 100% rename from platform/viewer/public/assets/favicon-32x32.png rename to platform/app/public/assets/favicon-32x32.png diff --git a/platform/viewer/public/assets/favicon.ico b/platform/app/public/assets/favicon.ico similarity index 100% rename from platform/viewer/public/assets/favicon.ico rename to platform/app/public/assets/favicon.ico diff --git a/platform/viewer/public/assets/firefox_app_128x128.png b/platform/app/public/assets/firefox_app_128x128.png similarity index 100% rename from platform/viewer/public/assets/firefox_app_128x128.png rename to platform/app/public/assets/firefox_app_128x128.png diff --git a/platform/viewer/public/assets/firefox_app_512x512.png b/platform/app/public/assets/firefox_app_512x512.png similarity index 100% rename from platform/viewer/public/assets/firefox_app_512x512.png rename to platform/app/public/assets/firefox_app_512x512.png diff --git a/platform/viewer/public/assets/firefox_app_60x60.png b/platform/app/public/assets/firefox_app_60x60.png similarity index 100% rename from platform/viewer/public/assets/firefox_app_60x60.png rename to platform/app/public/assets/firefox_app_60x60.png diff --git a/platform/viewer/public/assets/manifest.webapp b/platform/app/public/assets/manifest.webapp similarity index 100% rename from platform/viewer/public/assets/manifest.webapp rename to platform/app/public/assets/manifest.webapp diff --git a/platform/viewer/public/assets/mstile-144x144.png b/platform/app/public/assets/mstile-144x144.png similarity index 100% rename from platform/viewer/public/assets/mstile-144x144.png rename to platform/app/public/assets/mstile-144x144.png diff --git a/platform/viewer/public/assets/mstile-150x150.png b/platform/app/public/assets/mstile-150x150.png similarity index 100% rename from platform/viewer/public/assets/mstile-150x150.png rename to platform/app/public/assets/mstile-150x150.png diff --git a/platform/viewer/public/assets/mstile-310x150.png b/platform/app/public/assets/mstile-310x150.png similarity index 100% rename from platform/viewer/public/assets/mstile-310x150.png rename to platform/app/public/assets/mstile-310x150.png diff --git a/platform/viewer/public/assets/mstile-310x310.png b/platform/app/public/assets/mstile-310x310.png similarity index 100% rename from platform/viewer/public/assets/mstile-310x310.png rename to platform/app/public/assets/mstile-310x310.png diff --git a/platform/viewer/public/assets/mstile-70x70.png b/platform/app/public/assets/mstile-70x70.png similarity index 100% rename from platform/viewer/public/assets/mstile-70x70.png rename to platform/app/public/assets/mstile-70x70.png diff --git a/platform/viewer/public/assets/yandex-browser-50x50.png b/platform/app/public/assets/yandex-browser-50x50.png similarity index 100% rename from platform/viewer/public/assets/yandex-browser-50x50.png rename to platform/app/public/assets/yandex-browser-50x50.png diff --git a/platform/viewer/public/assets/yandex-browser-manifest.json b/platform/app/public/assets/yandex-browser-manifest.json similarity index 100% rename from platform/viewer/public/assets/yandex-browser-manifest.json rename to platform/app/public/assets/yandex-browser-manifest.json diff --git a/platform/viewer/public/config/aws.js b/platform/app/public/config/aws.js similarity index 100% rename from platform/viewer/public/config/aws.js rename to platform/app/public/config/aws.js diff --git a/platform/viewer/public/config/default.js b/platform/app/public/config/default.js similarity index 100% rename from platform/viewer/public/config/default.js rename to platform/app/public/config/default.js diff --git a/platform/viewer/public/config/demo.js b/platform/app/public/config/demo.js similarity index 100% rename from platform/viewer/public/config/demo.js rename to platform/app/public/config/demo.js diff --git a/platform/viewer/public/config/dicomweb-server.js b/platform/app/public/config/dicomweb-server.js similarity index 100% rename from platform/viewer/public/config/dicomweb-server.js rename to platform/app/public/config/dicomweb-server.js diff --git a/platform/viewer/public/config/dicomweb_relative.js b/platform/app/public/config/dicomweb_relative.js similarity index 100% rename from platform/viewer/public/config/dicomweb_relative.js rename to platform/app/public/config/dicomweb_relative.js diff --git a/platform/viewer/public/config/docker_nginx-orthanc.js b/platform/app/public/config/docker_nginx-orthanc.js similarity index 100% rename from platform/viewer/public/config/docker_nginx-orthanc.js rename to platform/app/public/config/docker_nginx-orthanc.js diff --git a/platform/viewer/public/config/docker_openresty-orthanc-keycloak.js b/platform/app/public/config/docker_openresty-orthanc-keycloak.js similarity index 100% rename from platform/viewer/public/config/docker_openresty-orthanc-keycloak.js rename to platform/app/public/config/docker_openresty-orthanc-keycloak.js diff --git a/platform/viewer/public/config/docker_openresty-orthanc.js b/platform/app/public/config/docker_openresty-orthanc.js similarity index 100% rename from platform/viewer/public/config/docker_openresty-orthanc.js rename to platform/app/public/config/docker_openresty-orthanc.js diff --git a/platform/viewer/public/config/e2e.js b/platform/app/public/config/e2e.js similarity index 100% rename from platform/viewer/public/config/e2e.js rename to platform/app/public/config/e2e.js diff --git a/platform/viewer/public/config/google.js b/platform/app/public/config/google.js similarity index 100% rename from platform/viewer/public/config/google.js rename to platform/app/public/config/google.js diff --git a/platform/viewer/public/config/idc.js b/platform/app/public/config/idc.js similarity index 100% rename from platform/viewer/public/config/idc.js rename to platform/app/public/config/idc.js diff --git a/platform/viewer/public/config/local_dcm4chee.js b/platform/app/public/config/local_dcm4chee.js similarity index 100% rename from platform/viewer/public/config/local_dcm4chee.js rename to platform/app/public/config/local_dcm4chee.js diff --git a/platform/viewer/public/config/local_orthanc.js b/platform/app/public/config/local_orthanc.js similarity index 100% rename from platform/viewer/public/config/local_orthanc.js rename to platform/app/public/config/local_orthanc.js diff --git a/platform/viewer/public/config/local_static.js b/platform/app/public/config/local_static.js similarity index 100% rename from platform/viewer/public/config/local_static.js rename to platform/app/public/config/local_static.js diff --git a/platform/viewer/public/config/multiple.js b/platform/app/public/config/multiple.js similarity index 100% rename from platform/viewer/public/config/multiple.js rename to platform/app/public/config/multiple.js diff --git a/platform/viewer/public/config/netlify.js b/platform/app/public/config/netlify.js similarity index 100% rename from platform/viewer/public/config/netlify.js rename to platform/app/public/config/netlify.js diff --git a/platform/viewer/public/config/public_dicomweb.js b/platform/app/public/config/public_dicomweb.js similarity index 100% rename from platform/viewer/public/config/public_dicomweb.js rename to platform/app/public/config/public_dicomweb.js diff --git a/platform/viewer/public/es6-shim.min.js b/platform/app/public/es6-shim.min.js similarity index 100% rename from platform/viewer/public/es6-shim.min.js rename to platform/app/public/es6-shim.min.js diff --git a/platform/viewer/public/html-templates/index.html b/platform/app/public/html-templates/index.html similarity index 98% rename from platform/viewer/public/html-templates/index.html rename to platform/app/public/html-templates/index.html index 9bdc95e0318..9ff1c3e6926 100644 --- a/platform/viewer/public/html-templates/index.html +++ b/platform/app/public/html-templates/index.html @@ -14,7 +14,7 @@ name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OHIF Viewer + + + + + + + + + + + +
+ + + + diff --git a/platform/viewer/public/init-service-worker.js b/platform/app/public/init-service-worker.js similarity index 100% rename from platform/viewer/public/init-service-worker.js rename to platform/app/public/init-service-worker.js diff --git a/platform/viewer/public/manifest.json b/platform/app/public/manifest.json similarity index 100% rename from platform/viewer/public/manifest.json rename to platform/app/public/manifest.json diff --git a/platform/viewer/public/ohif-logo-light.svg b/platform/app/public/ohif-logo-light.svg similarity index 100% rename from platform/viewer/public/ohif-logo-light.svg rename to platform/app/public/ohif-logo-light.svg diff --git a/platform/viewer/public/ohif-logo.svg b/platform/app/public/ohif-logo.svg similarity index 100% rename from platform/viewer/public/ohif-logo.svg rename to platform/app/public/ohif-logo.svg diff --git a/platform/viewer/public/oidc-client.min.js b/platform/app/public/oidc-client.min.js similarity index 100% rename from platform/viewer/public/oidc-client.min.js rename to platform/app/public/oidc-client.min.js diff --git a/platform/viewer/public/polyfill.min.js b/platform/app/public/polyfill.min.js similarity index 100% rename from platform/viewer/public/polyfill.min.js rename to platform/app/public/polyfill.min.js diff --git a/platform/viewer/public/silent-refresh.html b/platform/app/public/silent-refresh.html similarity index 100% rename from platform/viewer/public/silent-refresh.html rename to platform/app/public/silent-refresh.html diff --git a/platform/viewer/src/App.tsx b/platform/app/src/App.tsx similarity index 100% rename from platform/viewer/src/App.tsx rename to platform/app/src/App.tsx diff --git a/platform/viewer/src/__mocks__/fileMock.js b/platform/app/src/__mocks__/fileMock.js similarity index 100% rename from platform/viewer/src/__mocks__/fileMock.js rename to platform/app/src/__mocks__/fileMock.js diff --git a/platform/viewer/src/__tests__/globalSetup.js b/platform/app/src/__tests__/globalSetup.js similarity index 100% rename from platform/viewer/src/__tests__/globalSetup.js rename to platform/app/src/__tests__/globalSetup.js diff --git a/platform/viewer/src/appInit.js b/platform/app/src/appInit.js similarity index 100% rename from platform/viewer/src/appInit.js rename to platform/app/src/appInit.js diff --git a/platform/viewer/src/components/EmptyViewport.tsx b/platform/app/src/components/EmptyViewport.tsx similarity index 100% rename from platform/viewer/src/components/EmptyViewport.tsx rename to platform/app/src/components/EmptyViewport.tsx diff --git a/platform/viewer/src/components/ViewportGrid.tsx b/platform/app/src/components/ViewportGrid.tsx similarity index 100% rename from platform/viewer/src/components/ViewportGrid.tsx rename to platform/app/src/components/ViewportGrid.tsx diff --git a/platform/viewer/src/hooks/index.js b/platform/app/src/hooks/index.js similarity index 100% rename from platform/viewer/src/hooks/index.js rename to platform/app/src/hooks/index.js diff --git a/platform/viewer/src/hooks/useDebounce.js b/platform/app/src/hooks/useDebounce.js similarity index 100% rename from platform/viewer/src/hooks/useDebounce.js rename to platform/app/src/hooks/useDebounce.js diff --git a/platform/viewer/src/hooks/useQuery.js b/platform/app/src/hooks/useQuery.js similarity index 100% rename from platform/viewer/src/hooks/useQuery.js rename to platform/app/src/hooks/useQuery.js diff --git a/platform/viewer/src/hooks/useSearchParams.js b/platform/app/src/hooks/useSearchParams.js similarity index 100% rename from platform/viewer/src/hooks/useSearchParams.js rename to platform/app/src/hooks/useSearchParams.js diff --git a/platform/viewer/src/index.js b/platform/app/src/index.js similarity index 100% rename from platform/viewer/src/index.js rename to platform/app/src/index.js diff --git a/platform/viewer/src/loadDynamicConfig.js b/platform/app/src/loadDynamicConfig.js similarity index 100% rename from platform/viewer/src/loadDynamicConfig.js rename to platform/app/src/loadDynamicConfig.js diff --git a/platform/viewer/src/routes/CallbackPage.tsx b/platform/app/src/routes/CallbackPage.tsx similarity index 100% rename from platform/viewer/src/routes/CallbackPage.tsx rename to platform/app/src/routes/CallbackPage.tsx diff --git a/platform/viewer/src/routes/DataSourceWrapper.tsx b/platform/app/src/routes/DataSourceWrapper.tsx similarity index 100% rename from platform/viewer/src/routes/DataSourceWrapper.tsx rename to platform/app/src/routes/DataSourceWrapper.tsx diff --git a/platform/viewer/src/routes/Debug.tsx b/platform/app/src/routes/Debug.tsx similarity index 100% rename from platform/viewer/src/routes/Debug.tsx rename to platform/app/src/routes/Debug.tsx diff --git a/platform/viewer/src/routes/Local/Local.tsx b/platform/app/src/routes/Local/Local.tsx similarity index 100% rename from platform/viewer/src/routes/Local/Local.tsx rename to platform/app/src/routes/Local/Local.tsx diff --git a/platform/viewer/src/routes/Local/dicomFileLoader.js b/platform/app/src/routes/Local/dicomFileLoader.js similarity index 100% rename from platform/viewer/src/routes/Local/dicomFileLoader.js rename to platform/app/src/routes/Local/dicomFileLoader.js diff --git a/platform/viewer/src/routes/Local/fileLoader.js b/platform/app/src/routes/Local/fileLoader.js similarity index 100% rename from platform/viewer/src/routes/Local/fileLoader.js rename to platform/app/src/routes/Local/fileLoader.js diff --git a/platform/viewer/src/routes/Local/fileLoaderService.js b/platform/app/src/routes/Local/fileLoaderService.js similarity index 100% rename from platform/viewer/src/routes/Local/fileLoaderService.js rename to platform/app/src/routes/Local/fileLoaderService.js diff --git a/platform/viewer/src/routes/Local/filesToStudies.js b/platform/app/src/routes/Local/filesToStudies.js similarity index 100% rename from platform/viewer/src/routes/Local/filesToStudies.js rename to platform/app/src/routes/Local/filesToStudies.js diff --git a/platform/viewer/src/routes/Local/index.js b/platform/app/src/routes/Local/index.js similarity index 100% rename from platform/viewer/src/routes/Local/index.js rename to platform/app/src/routes/Local/index.js diff --git a/platform/viewer/src/routes/Local/pdfFileLoader.js b/platform/app/src/routes/Local/pdfFileLoader.js similarity index 100% rename from platform/viewer/src/routes/Local/pdfFileLoader.js rename to platform/app/src/routes/Local/pdfFileLoader.js diff --git a/platform/viewer/src/routes/Mode/Compose.tsx b/platform/app/src/routes/Mode/Compose.tsx similarity index 100% rename from platform/viewer/src/routes/Mode/Compose.tsx rename to platform/app/src/routes/Mode/Compose.tsx diff --git a/platform/viewer/src/routes/Mode/Mode.tsx b/platform/app/src/routes/Mode/Mode.tsx similarity index 100% rename from platform/viewer/src/routes/Mode/Mode.tsx rename to platform/app/src/routes/Mode/Mode.tsx diff --git a/platform/viewer/src/routes/Mode/index.js b/platform/app/src/routes/Mode/index.js similarity index 100% rename from platform/viewer/src/routes/Mode/index.js rename to platform/app/src/routes/Mode/index.js diff --git a/platform/viewer/src/routes/Mode/studiesList.ts b/platform/app/src/routes/Mode/studiesList.ts similarity index 100% rename from platform/viewer/src/routes/Mode/studiesList.ts rename to platform/app/src/routes/Mode/studiesList.ts diff --git a/platform/viewer/src/routes/NotFound/NotFound.tsx b/platform/app/src/routes/NotFound/NotFound.tsx similarity index 100% rename from platform/viewer/src/routes/NotFound/NotFound.tsx rename to platform/app/src/routes/NotFound/NotFound.tsx diff --git a/platform/viewer/src/routes/NotFound/index.js b/platform/app/src/routes/NotFound/index.js similarity index 100% rename from platform/viewer/src/routes/NotFound/index.js rename to platform/app/src/routes/NotFound/index.js diff --git a/platform/viewer/src/routes/PrivateRoute.tsx b/platform/app/src/routes/PrivateRoute.tsx similarity index 100% rename from platform/viewer/src/routes/PrivateRoute.tsx rename to platform/app/src/routes/PrivateRoute.tsx diff --git a/platform/viewer/src/routes/SignoutCallbackComponent.tsx b/platform/app/src/routes/SignoutCallbackComponent.tsx similarity index 100% rename from platform/viewer/src/routes/SignoutCallbackComponent.tsx rename to platform/app/src/routes/SignoutCallbackComponent.tsx diff --git a/platform/viewer/src/routes/WorkList/WorkList.tsx b/platform/app/src/routes/WorkList/WorkList.tsx similarity index 99% rename from platform/viewer/src/routes/WorkList/WorkList.tsx rename to platform/app/src/routes/WorkList/WorkList.tsx index f5c91411157..921e4798e16 100644 --- a/platform/viewer/src/routes/WorkList/WorkList.tsx +++ b/platform/app/src/routes/WorkList/WorkList.tsx @@ -388,7 +388,7 @@ function WorkList({ const hasStudies = numOfStudies > 0; const versionNumber = process.env.VERSION_NUMBER; - const buildNumber = process.env.BUILD_NUM; + const commitHash = process.env.COMMIT_HASH; const menuOptions = [ { @@ -398,7 +398,7 @@ function WorkList({ show({ content: AboutModal, title: 'About OHIF Viewer', - contentProps: { versionNumber, buildNumber }, + contentProps: { versionNumber, commitHash }, }), }, { diff --git a/platform/viewer/src/routes/WorkList/filtersMeta.js b/platform/app/src/routes/WorkList/filtersMeta.js similarity index 100% rename from platform/viewer/src/routes/WorkList/filtersMeta.js rename to platform/app/src/routes/WorkList/filtersMeta.js diff --git a/platform/viewer/src/routes/WorkList/index.js b/platform/app/src/routes/WorkList/index.js similarity index 100% rename from platform/viewer/src/routes/WorkList/index.js rename to platform/app/src/routes/WorkList/index.js diff --git a/platform/viewer/src/routes/buildModeRoutes.tsx b/platform/app/src/routes/buildModeRoutes.tsx similarity index 100% rename from platform/viewer/src/routes/buildModeRoutes.tsx rename to platform/app/src/routes/buildModeRoutes.tsx diff --git a/platform/viewer/src/routes/index.tsx b/platform/app/src/routes/index.tsx similarity index 100% rename from platform/viewer/src/routes/index.tsx rename to platform/app/src/routes/index.tsx diff --git a/platform/viewer/src/sanity.test.js b/platform/app/src/sanity.test.js similarity index 100% rename from platform/viewer/src/sanity.test.js rename to platform/app/src/sanity.test.js diff --git a/platform/viewer/src/service-worker.js b/platform/app/src/service-worker.js similarity index 100% rename from platform/viewer/src/service-worker.js rename to platform/app/src/service-worker.js diff --git a/platform/viewer/src/state/appConfig.tsx b/platform/app/src/state/appConfig.tsx similarity index 100% rename from platform/viewer/src/state/appConfig.tsx rename to platform/app/src/state/appConfig.tsx diff --git a/platform/viewer/src/state/index.js b/platform/app/src/state/index.js similarity index 100% rename from platform/viewer/src/state/index.js rename to platform/app/src/state/index.js diff --git a/platform/viewer/src/utils/OpenIdConnectRoutes.tsx b/platform/app/src/utils/OpenIdConnectRoutes.tsx similarity index 100% rename from platform/viewer/src/utils/OpenIdConnectRoutes.tsx rename to platform/app/src/utils/OpenIdConnectRoutes.tsx diff --git a/platform/viewer/src/utils/getUserManagerForOpenIdConnectClient.js b/platform/app/src/utils/getUserManagerForOpenIdConnectClient.js similarity index 100% rename from platform/viewer/src/utils/getUserManagerForOpenIdConnectClient.js rename to platform/app/src/utils/getUserManagerForOpenIdConnectClient.js diff --git a/platform/viewer/src/utils/history.ts b/platform/app/src/utils/history.ts similarity index 100% rename from platform/viewer/src/utils/history.ts rename to platform/app/src/utils/history.ts diff --git a/platform/viewer/tailwind.config.js b/platform/app/tailwind.config.js similarity index 100% rename from platform/viewer/tailwind.config.js rename to platform/app/tailwind.config.js diff --git a/platform/viewer/tailwind.css b/platform/app/tailwind.css similarity index 100% rename from platform/viewer/tailwind.css rename to platform/app/tailwind.css diff --git a/platform/cli/src/index.js b/platform/cli/src/index.js index 9d2f868b0cc..e6b40563d8f 100755 --- a/platform/cli/src/index.js +++ b/platform/cli/src/index.js @@ -23,7 +23,7 @@ import { import chalk from 'chalk'; const runningDirectory = process.cwd(); -const viewerDirectory = path.resolve(runningDirectory, 'platform/viewer'); +const viewerDirectory = path.resolve(runningDirectory, 'platform/app'); const __dirname = path.dirname(fileURLToPath(import.meta.url)); const packageJsonPath = path.join(runningDirectory, 'package.json'); diff --git a/platform/cli/templates/extension/dependencies.json b/platform/cli/templates/extension/dependencies.json index 72442cf6f3d..fcbb4101b66 100644 --- a/platform/cli/templates/extension/dependencies.json +++ b/platform/cli/templates/extension/dependencies.json @@ -8,7 +8,7 @@ "yarn": ">=1.18.0" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:dicom-pdf": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", diff --git a/platform/cli/templates/mode/dependencies.json b/platform/cli/templates/mode/dependencies.json index ef5c884a61a..5bfa5f161bf 100644 --- a/platform/cli/templates/mode/dependencies.json +++ b/platform/cli/templates/mode/dependencies.json @@ -8,7 +8,7 @@ "yarn": ">=1.16.0" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:cornerstone": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", diff --git a/platform/core/.webpack/webpack.dev.js b/platform/core/.webpack/webpack.dev.js index db7c206b134..c496972cdf4 100644 --- a/platform/core/.webpack/webpack.dev.js +++ b/platform/core/.webpack/webpack.dev.js @@ -3,6 +3,12 @@ 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.ts`, +}; + + module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); }; diff --git a/platform/core/.webpack/webpack.prod.js b/platform/core/.webpack/webpack.prod.js index c6c2fb229e4..4b599bec2ad 100644 --- a/platform/core/.webpack/webpack.prod.js +++ b/platform/core/.webpack/webpack.prod.js @@ -7,8 +7,12 @@ 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.ts`, +}; + 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: { @@ -24,23 +28,19 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'ohifCore', + library: 'ohif-core', libraryTarget: 'umd', filename: pkg.main, }, - externals: [ - { - 'cornerstone-math': { - commonjs: 'cornerstone-math', - commonjs2: 'cornerstone-math', - amd: 'cornerstone-math', - root: 'cornerstoneMath', - }, - }, + externals: [ + /\b(vtk.js)/, + /\b(dcmjs)/, + /\b(gl-matrix)/, + /^@cornerstonejs/, ], }); }; diff --git a/platform/core/jest.config.js b/platform/core/jest.config.js index 9055db5b51e..2978b062ed1 100644 --- a/platform/core/jest.config.js +++ b/platform/core/jest.config.js @@ -8,6 +8,6 @@ module.exports = { // rootDir: "../.." // testMatch: [ // //`/platform/${pack.name}/**/*.spec.js` - // "/platform/viewer/**/*.test.js" + // "/platform/app/**/*.test.js" // ] }; diff --git a/platform/core/package.json b/platform/core/package.json index 1737926f708..c32c4f6d5fd 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -5,7 +5,7 @@ "author": "OHIF Core Team", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-core.umd.js", "module": "src/index.ts", "types": "src/types/index.ts", "sideEffects": "false", @@ -38,7 +38,7 @@ "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.2", "dicom-parser": "^1.8.21", - "@ohif/ui": "^2.0.0" + "@ohif/ui": "^3.0.0" }, "dependencies": { "@babel/runtime": "^7.20.13", diff --git a/platform/docs/docs/README.md b/platform/docs/docs/README.md index b80491d078a..05896daea4c 100644 --- a/platform/docs/docs/README.md +++ b/platform/docs/docs/README.md @@ -23,15 +23,18 @@ Key features: components available in a reusable component library built with React.js and Tailwind CSS -![OHIF Viewer Screenshot](./assets/img/OHIF-Viewer.png) +![OHIF Viewer Screenshot](./assets/img/OHIF-Viewer.jpg) + + + ## Where to next? The Open Health Imaging Foundation intends to provide an imaging viewer @@ -91,7 +94,7 @@ MIT ยฉ [OHIF](https://github.com/OHIF) [ohif-org]: https://www.ohif.org -[ohif-demo]: http://v3-demo.ohif.org/ +[ohif-demo]: http://viewer.ohif.org/ [dicom-web]: https://en.wikipedia.org/wiki/DICOMweb [gh-issues]: https://github.com/OHIF/Viewers/issues diff --git a/platform/docs/docs/assets/img/OHIF-Viewer.jpg b/platform/docs/docs/assets/img/OHIF-Viewer.jpg new file mode 100644 index 00000000000..f26d6a579cc Binary files /dev/null and b/platform/docs/docs/assets/img/OHIF-Viewer.jpg differ diff --git a/platform/docs/docs/assets/img/OHIF-Viewer.png b/platform/docs/docs/assets/img/OHIF-Viewer.png deleted file mode 100644 index 7f28ceb4f30..00000000000 Binary files a/platform/docs/docs/assets/img/OHIF-Viewer.png and /dev/null differ diff --git a/platform/docs/docs/configuration/configurationFiles.md b/platform/docs/docs/configuration/configurationFiles.md index 141b2c00554..b195e46f4cf 100644 --- a/platform/docs/docs/configuration/configurationFiles.md +++ b/platform/docs/docs/configuration/configurationFiles.md @@ -17,7 +17,7 @@ remotely. ## Configuration Files -The configuration for our viewer is in the `platform/viewer/public/config` +The configuration for our viewer is in the `platform/app/public/config` directory. Our build process knows which configuration file to use based on the `APP_CONFIG` environment variable. By default, its value is [`config/default.js`][default-config]. The majority of the viewer's features, @@ -25,7 +25,7 @@ and registered extension's features, are configured using this file. The simplest way is to update the existing default config: -```js title="platform/viewer/public/config/default.js" +```js title="platform/app/public/config/default.js" window.config = { routerBasename: '/', extensions: [], @@ -194,7 +194,7 @@ output. [dicomcloud-install]: https://github.com/DICOMcloud/DICOMcloud#running-the-code [osirix]: https://www.osirix-viewer.com/ [horos]: https://www.horosproject.org/ -[default-config]: https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/config/default.js -[html-templates]: https://github.com/OHIF/Viewers/tree/master/platform/viewer/public/html-templates -[config-files]: https://github.com/OHIF/Viewers/tree/master/platform/viewer/public/config +[default-config]: https://github.com/OHIF/Viewers/blob/master/platform/app/public/config/default.js +[html-templates]: https://github.com/OHIF/Viewers/tree/master/platform/app/public/html-templates +[config-files]: https://github.com/OHIF/Viewers/tree/master/platform/app/public/config diff --git a/platform/docs/docs/configuration/dataSources/dicom-json.md b/platform/docs/docs/configuration/dataSources/dicom-json.md index c6efab62ed8..08cbac7522f 100644 --- a/platform/docs/docs/configuration/dataSources/dicom-json.md +++ b/platform/docs/docs/configuration/dataSources/dicom-json.md @@ -10,7 +10,7 @@ server as well as a list of study and series instance UIDs along with metadata. An example would look like -`https://v3-demo.ohif.org/viewer/dicomjson?url=https://ohif-dicom-json-example.s3.amazonaws.com/LIDC-IDRI-0001.json` +`https://viewer.ohif.org/viewer/dicomjson?url=https://ohif-dicom-json-example.s3.amazonaws.com/LIDC-IDRI-0001.json` As you can see the url to the location of the JSON file is passed in the query after the `dicomjson` string, which is diff --git a/platform/docs/docs/configuration/dataSources/dicom-web-proxy.md b/platform/docs/docs/configuration/dataSources/dicom-web-proxy.md index 6f98b36a45b..faeea85e619 100644 --- a/platform/docs/docs/configuration/dataSources/dicom-web-proxy.md +++ b/platform/docs/docs/configuration/dataSources/dicom-web-proxy.md @@ -12,7 +12,7 @@ datasource and delegates subsequent requests for metadata and images to that. Usage is similar to that of the [DICOM JSON](./dicom-json.md) datasource and might look like -`https://v3-demo.ohif.org/viewer/dicomwebproxy?url=https://ohif-dicom-json-example.s3.amazonaws.com/dicomweb.json` +`https://viewer.ohif.org/viewer/dicomwebproxy?url=https://ohif-dicom-json-example.s3.amazonaws.com/dicomweb.json` The url to the location of the JSON file is passed in the query after the `dicomwebproxy` string, which is diff --git a/platform/docs/docs/configuration/dataSources/dicom-web.md b/platform/docs/docs/configuration/dataSources/dicom-web.md index 24b2c16b3a2..dcf4749ca80 100644 --- a/platform/docs/docs/configuration/dataSources/dicom-web.md +++ b/platform/docs/docs/configuration/dataSources/dicom-web.md @@ -32,7 +32,7 @@ _Not sure if you have `docker` installed already? Try running `docker --version` in command prompt or terminal_ > If you are using `Docker Toolbox` you need to change the _PROXY_DOMAIN_ -> parameter in _platform/viewer/package.json_ to http://192.168.99.100:8042 or +> parameter in _platform/app/package.json_ to http://192.168.99.100:8042 or > the ip docker-machine ip throws. This is the value [`WebPack`][webpack-proxy] > uses to proxy requests @@ -101,7 +101,7 @@ yarn run dev:orthanc Let's take a look at what's going on under the hood here. `yarn run dev:orthanc` is running the `dev:orthanc` script in our project's `package.json` (inside -`platform/viewer`). That script is: +`platform/app`). That script is: ```js cross-env NODE_ENV=development PROXY_TARGET=/dicom-web PROXY_DOMAIN=http://localhost:8042 APP_CONFIG=config/docker_nginx-orthanc.js webpack-dev-server --config .webpack/webpack.pwa.js -w @@ -120,7 +120,7 @@ requesting resources that live at a different domain. The `APP_CONFIG` value tells our app which file to load on to `window.config`. By default, our app uses the file at -`/platform/viewer/public/config/default.js`. Here is what that +`/platform/app/public/config/default.js`. Here is what that configuration looks like: ```js @@ -225,8 +225,8 @@ below: [osirix]: http://www.osirix-viewer.com/ [horos]: https://www.horosproject.org/ [default-config]: - https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/config/default.js + https://github.com/OHIF/Viewers/blob/master/platform/app/public/config/default.js [html-templates]: - https://github.com/OHIF/Viewers/tree/master/platform/viewer/public/html-templates + https://github.com/OHIF/Viewers/tree/master/platform/app/public/html-templates [config-files]: - https://github.com/OHIF/Viewers/tree/master/platform/viewer/public/config + https://github.com/OHIF/Viewers/tree/master/platform/app/public/config diff --git a/platform/docs/docs/configuration/dataSources/static-files.md b/platform/docs/docs/configuration/dataSources/static-files.md index c3c6471b5f1..296a879965a 100644 --- a/platform/docs/docs/configuration/dataSources/static-files.md +++ b/platform/docs/docs/configuration/dataSources/static-files.md @@ -27,11 +27,11 @@ cd /dicomweb npx http-server -p 5000 --cors -g ``` -There is then a dev environment in the platform/viewer directory which can be +There is then a dev environment in the platform/app directory which can be run against those files, like this: ``` -cd platform/viewer +cd platform/app yarn dev:static ``` diff --git a/platform/docs/docs/deployment/build-for-production.md b/platform/docs/docs/deployment/build-for-production.md index b23463237a4..b1fa6999ccc 100644 --- a/platform/docs/docs/deployment/build-for-production.md +++ b/platform/docs/docs/deployment/build-for-production.md @@ -43,9 +43,9 @@ yarn run build ``` If everything worked as expected, you should have a new `dist/` directory in the -`platform/viewer/dist` folder. It should roughly resemble the following: +`platform/app/dist` folder. It should roughly resemble the following: -```bash title="platform/viewer/dist/" +```bash title="platform/app/dist/" โ”œโ”€โ”€ app-config.js โ”œโ”€โ”€ app.bundle.js โ”œโ”€โ”€ app.css @@ -62,7 +62,7 @@ how to configure the project for your own imaging archive below. ### Configuration -The configuration for our viewer is in the `platform/viewer/public/config` +The configuration for our viewer is in the `platform/app/public/config` directory. Our build process knows which configuration file to use based on the `APP_CONFIG` environment variable. By default, its value is [`config/default.js`][default-config]. The majority of the viewer's features, @@ -101,7 +101,7 @@ directory: # Install http-server as a globally available package yarn global add http-server -# Change the directory to the platform/viewer +# Change the directory to the platform/app # Serve the files in our current directory # Accessible at: `http://localhost:8080` diff --git a/platform/docs/docs/deployment/docker.md b/platform/docs/docs/deployment/docker.md index 986a5a5e459..689ea732218 100644 --- a/platform/docs/docs/deployment/docker.md +++ b/platform/docs/docs/deployment/docker.md @@ -6,9 +6,6 @@ sidebar_position: 4 The OHIF source code provides a Dockerfile to create and run a Docker image that containerizes an [nginx](https://www.nginx.com/) web server serving the OHIF Viewer. -:::info Good to Know -The OHIF Viewer Docker image for the `v3-stable` branch is not yet published. The available image in [Docker Hub](https://hub.docker.com/r/ohif/viewer) is based on the `master` branch. -::: ## Prequisites The machine on which to build and run the Docker container must have: diff --git a/platform/docs/docs/deployment/index.md b/platform/docs/docs/deployment/index.md index 824a645de99..588bedc1d64 100644 --- a/platform/docs/docs/deployment/index.md +++ b/platform/docs/docs/deployment/index.md @@ -322,7 +322,7 @@ Please feel free to suggest or contribute your own recipes. --> -[viewer-npm]: https://www.npmjs.com/package/@ohif/viewer +[viewer-npm]: https://www.npmjs.com/package/@ohif/app [pwa-url]: https://developers.google.com/web/progressive-web-apps/ [static-assets-url]: https://www.maxcdn.com/one/visual-glossary/static-content/ [app-store]: https://medium.freecodecamp.org/i-built-a-pwa-and-published-it-in-3-app-stores-heres-what-i-learned-7cb3f56daf9b diff --git a/platform/docs/docs/deployment/nginx--image-archive.md b/platform/docs/docs/deployment/nginx--image-archive.md index 29ce7a91403..4468f463f70 100644 --- a/platform/docs/docs/deployment/nginx--image-archive.md +++ b/platform/docs/docs/deployment/nginx--image-archive.md @@ -267,7 +267,7 @@ members put together: [orthanc-docs]: http://book.orthanc-server.com/users/configuration.html#configuration [lua-resty-openidc-docs]: https://github.com/zmartzone/lua-resty-openidc -[dockerfile]: https://github.com/OHIF/Viewers/blob/master/platform/viewer/.recipes/OpenResty-Orthanc/dockerfile -[config-nginx]: https://github.com/OHIF/Viewers/blob/master/platform/viewer/.recipes/OpenResty-Orthanc/config/nginx.conf -[config-orthanc]: https://github.com/OHIF/Viewers/blob/master/platform/viewer/.recipes/OpenResty-Orthanc/config/orthanc.json +[dockerfile]: https://github.com/OHIF/Viewers/blob/master/platform/app/.recipes/OpenResty-Orthanc/dockerfile +[config-nginx]: https://github.com/OHIF/Viewers/blob/master/platform/app/.recipes/OpenResty-Orthanc/config/nginx.conf +[config-orthanc]: https://github.com/OHIF/Viewers/blob/master/platform/app/.recipes/OpenResty-Orthanc/config/orthanc.json diff --git a/platform/docs/docs/development/architecture.md b/platform/docs/docs/development/architecture.md index a8fab99a5d8..d135fcd2b38 100644 --- a/platform/docs/docs/development/architecture.md +++ b/platform/docs/docs/development/architecture.md @@ -50,7 +50,7 @@ you'll see the following: OHIF v3 is composed of the following components, described in detail in further sections: -- `@ohif/viewer`: The core framework that controls extension registration, mode +- `@ohif/app`: The core framework that controls extension registration, mode composition and routing. - `@ohif/core`: A library of useful and reusable medical imaging functionality for the web. @@ -58,7 +58,7 @@ sections: with. - `Extensions`: A set of building blocks for building applications. The OHIF org maintains a few core libraries. -- `Modes`: Configuration objects that tell @ohif/viewer how to compose +- `Modes`: Configuration objects that tell @ohif/app how to compose extensions to build applications on different routes of the platform. ## Extensions @@ -110,7 +110,7 @@ certain workflows. To summarize the difference between extensions and modes in `OHIF-v3` and extensions in `OHIF-v2` -> - `Modes` are configuration objects that tell _@ohif/viewer_ how to compose +> - `Modes` are configuration objects that tell _@ohif/app_ how to compose > extensions to build applications on different routes of the platform. > - In v2 extensions are โ€œpluginsโ€ that add functionality to a core viewer. > - In v3 extensions are building blocks that a mode uses to build an entire @@ -120,7 +120,7 @@ extensions in `OHIF-v2` ## Platform -### `@ohif/viewer` +### `@ohif/app` This library is the core library which consumes modes and extensions and builds an application. Extensions can be passed in as app configuration and will be @@ -195,7 +195,7 @@ new mode as well. [monorepo]: https://github.com/OHIF/Viewers/issues/768 [viewers-project]: https://github.com/OHIF/Viewers -[viewer-npm]: https://www.npmjs.com/package/@ohif/viewer +[viewer-npm]: https://www.npmjs.com/package/@ohif/app [pwa]: https://developers.google.com/web/progressive-web-apps/ [configuration]: ../configuration/index.md [extensions]: ../platform/extensions/index.md diff --git a/platform/docs/docs/development/getting-started.md b/platform/docs/docs/development/getting-started.md index c4e04151ceb..054d5f72e80 100644 --- a/platform/docs/docs/development/getting-started.md +++ b/platform/docs/docs/development/getting-started.md @@ -24,10 +24,6 @@ up-to-date with the upstream (original) repository. This is called a "Triangular Workflow" and is common for Open Source projects. The GitHub blog has a [good graphic that illustrates this setup][triangular-workflow]. -### `v3-stable` branch -Currently the stable branch for OHIF-v3 is `v3-stable`. Once the v3-stable branch has -feature parity with the master branch, `v3-stable` will be pushed to the master branch. -You can read more about the roadmap timeline [here](https://ohif.org/roadmap). ### Private @@ -57,9 +53,6 @@ Navigate to the root of the project's directory in your terminal and run the following commands: ```bash -# Switch to the v3 branch -git switch v3-stable - # Restore dependencies yarn install @@ -70,10 +63,10 @@ yarn run dev You should see the following output: ```bash -@ohif/viewer: i ๏ฝขwds๏ฝฃ: Project is running at http://localhost:3000/ -@ohif/viewer: i ๏ฝขwds๏ฝฃ: webpack output is served from / -@ohif/viewer: i ๏ฝขwds๏ฝฃ: Content not from webpack is served from D:\code\ohif\Viewers\platform\viewer -@ohif/viewer: i ๏ฝขwds๏ฝฃ: 404s will fallback to /index.html +@ohif/app: i ๏ฝขwds๏ฝฃ: Project is running at http://localhost:3000/ +@ohif/app: i ๏ฝขwds๏ฝฃ: webpack output is served from / +@ohif/app: i ๏ฝขwds๏ฝฃ: Content not from webpack is served from D:\code\ohif\Viewers\platform\viewer +@ohif/app: i ๏ฝขwds๏ฝฃ: 404s will fallback to /index.html # And a list of all generated files ``` @@ -111,6 +104,6 @@ yarn run build [add-remote-repo]: https://help.github.com/en/articles/fork-a-repo#step-3-configure-git-to-sync-your-fork-with-the-original-spoon-knife-repository [sync-changes]: https://help.github.com/en/articles/syncing-a-fork [triangular-workflow]: https://github.blog/2015-07-29-git-2-5-including-multiple-worktrees-and-triangular-workflows/#improved-support-for-triangular-workflows -[ohif-viewers-repo]: https://github.com/OHIF/Viewers/tree/v3-stable +[ohif-viewers-repo]: https://github.com/OHIF/Viewers/ [ohif-viewers]: https://github.com/OHIF/Viewers diff --git a/platform/docs/docs/development/ohif-cli.md b/platform/docs/docs/development/ohif-cli.md index ad55b071cde..7511e2bc73d 100644 --- a/platform/docs/docs/development/ohif-cli.md +++ b/platform/docs/docs/development/ohif-cli.md @@ -286,7 +286,7 @@ To make all the above commands work, we have created a new file called `PluginCo information needed to run the commands. You **don't need to (and should not)** edit/update/modify this file as it is automatically generated by the CLI. You can take a look at what this file contains by going to -`platform/viewer/PluginConfig.json` in your project's root directory. In short, +`platform/app/PluginConfig.json` in your project's root directory. In short, this file tracks and stores all the extensions/modes and the their version that are currently being used by the viewer. @@ -305,4 +305,4 @@ export NPM_TOKEN= The ohif-cli will add the path to the external dependencies to the webpack config, so that you can install them in your project and use them in your custom extensions and modes. To achieve this ohif-cli will update the webpack.pwa.js -file in the platform/viewer directory. +file in the platform/app directory. diff --git a/platform/docs/docs/platform/browser-support.md b/platform/docs/docs/platform/browser-support.md index f717432aedc..20ca7e8c272 100644 --- a/platform/docs/docs/platform/browser-support.md +++ b/platform/docs/docs/platform/browser-support.md @@ -4,7 +4,7 @@ sidebar_position: 2 # Browser Support The browsers that we support are specified in the `.browserlistrc` file located -in the `platform/viewer` project. While we leverage the latest language features +in the `platform/app` project. While we leverage the latest language features when writing code, we rely on `babel` to _transpile_ our code so that it can run in the browsers that we support. diff --git a/platform/docs/docs/platform/extensions/index.md b/platform/docs/docs/platform/extensions/index.md index d4637fde18b..cf60ca5fef6 100644 --- a/platform/docs/docs/platform/extensions/index.md +++ b/platform/docs/docs/platform/extensions/index.md @@ -152,24 +152,24 @@ the top level [`extensions/`][ext-source] directory. `pluginConfig.json`, by default we register all extensions in the repo. -```js title=platform/viewer/pluginConfig.json +```js title=platform/app/pluginConfig.json // Simplified version of the `pluginConfig.json` file { "extensions": [ { "packageName": "@ohif/extension-cornerstone", - "version": "3.0.0" + "version": "3.4.0" }, { "packageName": "@ohif/extension-measurement-tracking", - "version": "3.0.0" + "version": "3.4.0" }, // ... ], "modes": [ { "packageName": "@ohif/mode-longitudinal", - "version": "0.0.1" + "version": "3.4.0" } ] } @@ -319,7 +319,7 @@ documentation page. ### Contexts -The `@ohif/viewer` tracks "active contexts" that extensions can use to scope +The `@ohif/app` tracks "active contexts" that extensions can use to scope their functionality. Some example contexts being: - Route: `ROUTE:VIEWER`, `ROUTE:STUDY_LIST` diff --git a/platform/docs/docs/platform/extensions/modules/sop-class-handler.md b/platform/docs/docs/platform/extensions/modules/sop-class-handler.md index c54fb6470ee..cf70fb42fbf 100644 --- a/platform/docs/docs/platform/extensions/modules/sop-class-handler.md +++ b/platform/docs/docs/platform/extensions/modules/sop-class-handler.md @@ -105,7 +105,7 @@ of the instances to the display set. You can find another example for this mapping between raw metadata and displaySet for `DICOM-SR` extension. -## `@ohif/viewer` usage +## `@ohif/app` usage We use the `sopClassHandlerModule`s in `DisplaySetService` where we transform instances from the raw metadata format to a OHIF displaySet format. diff --git a/platform/docs/docs/platform/extensions/modules/viewport.md b/platform/docs/docs/platform/extensions/modules/viewport.md index 163a9e11dfd..4db2561ed0c 100644 --- a/platform/docs/docs/platform/extensions/modules/viewport.md +++ b/platform/docs/docs/platform/extensions/modules/viewport.md @@ -88,7 +88,7 @@ function TrackedCornerstoneViewport({ ``` -### `@ohif/viewer` +### `@ohif/app` Viewport components are managed by the `ViewportGrid` Component. Which Viewport component is used depends on: diff --git a/platform/docs/docs/platform/managers/commands.md b/platform/docs/docs/platform/managers/commands.md index fab666dacad..1f07f31a9f8 100644 --- a/platform/docs/docs/platform/managers/commands.md +++ b/platform/docs/docs/platform/managers/commands.md @@ -74,7 +74,7 @@ These methods are used internally to help determine which commands are currently valid, and how to provide them with any state they may need at the time they are called. -```js title="platform/viewer/src/appInit.js" +```js title="platform/app/src/appInit.js" const commandsManagerConfig = { getAppState: () => {}, /** Used by commands to determine active context */ diff --git a/platform/docs/docs/platform/managers/service.md b/platform/docs/docs/platform/managers/service.md index 8307d1c68f0..63c6248a54d 100644 --- a/platform/docs/docs/platform/managers/service.md +++ b/platform/docs/docs/platform/managers/service.md @@ -49,7 +49,7 @@ export default class ServicesManager { By default, `OHIF-v3` registers the following services in the `appInit`. -```js title="platform/viewer/src/appInit.js" +```js title="platform/app/src/appInit.js" servicesManager.registerServices([ CustomizationService, UINotificationService, diff --git a/platform/docs/docs/platform/modes/index.md b/platform/docs/docs/platform/modes/index.md index aa3f0cb0d39..f2c32b91ce4 100644 --- a/platform/docs/docs/platform/modes/index.md +++ b/platform/docs/docs/platform/modes/index.md @@ -368,20 +368,20 @@ Similar to extension registration, `viewer` will look inside the `pluginConfig.j find the `modes` to register. -```js title=platform/viewer/pluginConfig.json +```js title=platform/app/pluginConfig.json // Simplified version of the `pluginConfig.json` file { "extensions": [ { "packageName": "@ohif/extension-cornerstone", - "version": "3.0.0" + "version": "3.4.0" }, // ... ], "modes": [ { "packageName": "@ohif/mode-longitudinal", - "version": "0.0.1" + "version": "3.4.0" } ] } diff --git a/platform/docs/docs/platform/modes/routes.md b/platform/docs/docs/platform/modes/routes.md index 36376a131f1..cc5c722bc27 100644 --- a/platform/docs/docs/platform/modes/routes.md +++ b/platform/docs/docs/platform/modes/routes.md @@ -13,7 +13,7 @@ important part of the mode configuration. ## Route -`@ohif/viewer` **compose** extensions to build applications on different routes +`@ohif/app` **compose** extensions to build applications on different routes for the platform. Below, you can see a simplified version of the `longitudinal` mode and the diff --git a/platform/docs/docs/platform/services/data/HangingProtocolService.md b/platform/docs/docs/platform/services/data/HangingProtocolService.md index fb0c1e1d4aa..a30118f3ed5 100644 --- a/platform/docs/docs/platform/services/data/HangingProtocolService.md +++ b/platform/docs/docs/platform/services/data/HangingProtocolService.md @@ -320,7 +320,7 @@ A few custom attributes are included under @ohif/extension-test, these are namel *maxNumImageFrames *numberOfDisplaySets -To use these included custom attributes, the extension will need to be enabled under platform/viewer/pluginConfig.json: +To use these included custom attributes, the extension will need to be enabled under platform/app/pluginConfig.json: ```javascript { @@ -328,7 +328,7 @@ To use these included custom attributes, the extension will need to be enabled u ... { "packageName": "@ohif/extension-test", - "version": "0.0.1" + "version": "3.4.0" }, ... ] diff --git a/platform/docs/docs/platform/services/data/SegmentationService.md b/platform/docs/docs/platform/services/data/SegmentationService.md index 54e7f82a736..42e47c55300 100644 --- a/platform/docs/docs/platform/services/data/SegmentationService.md +++ b/platform/docs/docs/platform/services/data/SegmentationService.md @@ -8,7 +8,7 @@ sidebar_label: Segmentation Service ## Overview Using Segmentation Service you can create, edit and delete segmentation data, and -change appearance of the segmentation including color, opacity, and visibility. +change appearance of the segmentation including color, opacity and visibility. Segmentations in OHIF are based on the Segmentations in Cornerstone3D. You can read more about it in the [Cornerstone Segmentation](https://www.cornerstonejs.org/docs/concepts/cornerstone-tools/segmentation/). OHIF currently only supports diff --git a/platform/docs/docs/platform/services/pubsub.md b/platform/docs/docs/platform/services/pubsub.md index f7c9c4cced6..036e592efbd 100644 --- a/platform/docs/docs/platform/services/pubsub.md +++ b/platform/docs/docs/platform/services/pubsub.md @@ -77,7 +77,7 @@ observer. Below, we can see `simplified` `Mode.jsx` and the corresponding `useEffect` where the unsubscription functions are executed upon destruction. -```js title="platform/viewer/src/routes/Mode/Mode.jsx" +```js title="platform/app/src/routes/Mode/Mode.jsx" export default function ModeRoute(/**..**/) { /**...**/ useEffect(() => { diff --git a/platform/docs/docs/platform/services/ui/customization-service.md b/platform/docs/docs/platform/services/ui/customization-service.md index 516df2d2475..171548c20cf 100644 --- a/platform/docs/docs/platform/services/ui/customization-service.md +++ b/platform/docs/docs/platform/services/ui/customization-service.md @@ -332,7 +332,7 @@ customizationService: [ Below is the full example configuration of the customizable viewport overlay and the screenshot of the result overlay. ```javascript -// this is one of the configuration files in `platform/viewer/public/config/*.js` +// this is one of the configuration files in `platform/app/public/config/*.js` window.config = { // ... diff --git a/platform/docs/docs/platform/services/ui/index.md b/platform/docs/docs/platform/services/ui/index.md index 5ba4a539057..2a0203a743f 100644 --- a/platform/docs/docs/platform/services/ui/index.md +++ b/platform/docs/docs/platform/services/ui/index.md @@ -58,7 +58,7 @@ The `ServicesManager` is: makes the context values exposed in the app, and service's `setImplementation` can get run to override the implementation of the service.** -```js title="platform/viewer/src/App.jsx" +```js title="platform/app/src/App.jsx" function App({ config, defaultExtensions }) { /**...**/ /**...**/ @@ -189,7 +189,7 @@ clicking on the gear button on the right side of the header. A `simplified` code for our worklist is: -```js title="platform/viewer/src/routes/WorkList/WorkList.jsx" +```js title="platform/app/src/routes/WorkList/WorkList.jsx" import { useModal, Header } from '@ohif/ui'; function WorkList({ diff --git a/platform/docs/docusaurus.config.js b/platform/docs/docusaurus.config.js index fafcd00db30..3d080da6613 100644 --- a/platform/docs/docusaurus.config.js +++ b/platform/docs/docusaurus.config.js @@ -57,7 +57,7 @@ module.exports = { projectName: 'OHIF', baseUrl, baseUrlIssueBanner: true, - url: 'https://v3-docs.ohif.org', + url: 'https://docs.ohif.org', i18n: { defaultLocale: 'en', locales: isDeployPreview @@ -218,7 +218,7 @@ module.exports = { // We want users to submit doc updates to the upstream/next version! // Otherwise we risk losing the update on the next release. - return `https://github.com/OHIF/Viewers/edit/v3-stable/platform/docs/docs/${docPath}`; + return `https://github.com/OHIF/Viewers/edit/master/platform/docs/docs/${docPath}`; }, showLastUpdateAuthor: true, showLastUpdateTime: true, @@ -233,7 +233,7 @@ module.exports = { // : undefined, versions: { current: { - label: 'Version 3.3 - Segmentation Support ๐Ÿšง', + label: 'Latest', }, '2.0': { label: 'Version 2.0 - Master branch', @@ -290,13 +290,13 @@ module.exports = { { to: 'https://ohif.org/get-started', label: 'Get Started', - target: '_self', + target: '_blank', position: 'left', }, { to: 'https://ohif.org/examples', label: 'Examples', - target: '_self', + target: '_blank', position: 'left', }, { @@ -309,7 +309,7 @@ module.exports = { { to: 'https://ohif.org/community', label: 'Community', - target: '_self', + target: '_blank', position: 'left', }, { @@ -429,7 +429,7 @@ module.exports = { logo: { alt: 'OHIF ', src: 'img/netlify-color-accent.svg', - href: 'https://v3-demo.ohif.org/', + href: 'https://viewer.ohif.org/', }, copyright: `OHIF is open source software released under the MIT license.`, }, diff --git a/platform/docs/versioned_docs/version-2.0/development/getting-started.md b/platform/docs/versioned_docs/version-2.0/development/getting-started.md index 0474ef1f052..7ec30c99d9d 100644 --- a/platform/docs/versioned_docs/version-2.0/development/getting-started.md +++ b/platform/docs/versioned_docs/version-2.0/development/getting-started.md @@ -88,9 +88,6 @@ You should see the following output: ```bash # Build static assets to host a PWA yarn run build - -# Build packaged output (script-tag use) -yarn run build:package ``` ## Troubleshooting diff --git a/platform/docs/versioned_docs/version-3.0/README.md b/platform/docs/versioned_docs/version-3.0/README.md index cd6cfe17bb5..fc840c84fa3 100644 --- a/platform/docs/versioned_docs/version-3.0/README.md +++ b/platform/docs/versioned_docs/version-3.0/README.md @@ -27,7 +27,7 @@ Key features: @@ -91,7 +91,7 @@ MIT ยฉ [OHIF](https://github.com/OHIF) [ohif-org]: https://www.ohif.org -[ohif-demo]: http://v3-demo.ohif.org/ +[ohif-demo]: http://viewer.ohif.org/ [dicom-web]: https://en.wikipedia.org/wiki/DICOMweb [gh-issues]: https://github.com/OHIF/Viewers/issues diff --git a/platform/docs/versioned_docs/version-3.0/configuration/dataSources/dicom-json.md b/platform/docs/versioned_docs/version-3.0/configuration/dataSources/dicom-json.md index c6efab62ed8..08cbac7522f 100644 --- a/platform/docs/versioned_docs/version-3.0/configuration/dataSources/dicom-json.md +++ b/platform/docs/versioned_docs/version-3.0/configuration/dataSources/dicom-json.md @@ -10,7 +10,7 @@ server as well as a list of study and series instance UIDs along with metadata. An example would look like -`https://v3-demo.ohif.org/viewer/dicomjson?url=https://ohif-dicom-json-example.s3.amazonaws.com/LIDC-IDRI-0001.json` +`https://viewer.ohif.org/viewer/dicomjson?url=https://ohif-dicom-json-example.s3.amazonaws.com/LIDC-IDRI-0001.json` As you can see the url to the location of the JSON file is passed in the query after the `dicomjson` string, which is diff --git a/platform/docs/versionsArchived.json b/platform/docs/versionsArchived.json index 5b1ce50ebc5..07805e0e8d3 100644 --- a/platform/docs/versionsArchived.json +++ b/platform/docs/versionsArchived.json @@ -1,6 +1,4 @@ { - "Version 3.2 - Cornerstone3D VolumeAPI": "https://deploy-preview-3009--ohif-platform-docs.netlify.app/", - "Version 3.1 - Cornerstone3D Basics": "https://62e92bf05fc5050008aa1300--ohif-platform-docs.netlify.app/", - "Version 3.0 - Cornerstone Legacy": "https://deploy-preview-2791--ohif-platform-docs.netlify.app/", + "Version 2.0": "https://deploy-preview-2791--ohif-platform-docs.netlify.app/1.0/", "Version 1.0": "https://deploy-preview-2791--ohif-platform-docs.netlify.app/1.0/" } diff --git a/platform/i18n/.webpack/webpack.dev.js b/platform/i18n/.webpack/webpack.dev.js index db7c206b134..2bc3ced0b9b 100644 --- a/platform/i18n/.webpack/webpack.dev.js +++ b/platform/i18n/.webpack/webpack.dev.js @@ -3,6 +3,11 @@ 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.js`, +}; + + module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); + return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY }); }; diff --git a/platform/i18n/.webpack/webpack.prod.js b/platform/i18n/.webpack/webpack.prod.js index 39de350816d..fe0e4e35929 100644 --- a/platform/i18n/.webpack/webpack.prod.js +++ b/platform/i18n/.webpack/webpack.prod.js @@ -8,8 +8,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`, +}; + + + 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: { @@ -25,11 +31,11 @@ module.exports = (env, argv) => { }, optimization: { minimize: true, - sideEffects: true, + sideEffects: false, }, output: { path: ROOT_DIR, - library: 'ohifI18n', + library: 'ohif-i18n', libraryTarget: 'umd', filename: pkg.main, }, diff --git a/platform/i18n/package.json b/platform/i18n/package.json index 5b486c238da..46f56696872 100644 --- a/platform/i18n/package.json +++ b/platform/i18n/package.json @@ -1,11 +1,11 @@ { "name": "@ohif/i18n", - "version": "1.0.0", + "version": "3.0.0", "description": "Internationalization library for The OHIF Viewer", "author": "OHIF", "license": "MIT", "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", + "main": "dist/ohif-i18n.umd.js", "module": "src/index.js", "engines": { "node": ">=14", @@ -20,7 +20,7 @@ "access": "public" }, "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo", "dev:i18n": "yarn run dev", "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", "build:package": "yarn run build", diff --git a/platform/public/demo.html b/platform/public/demo.html deleted file mode 100644 index 7b3a647ed5d..00000000000 --- a/platform/public/demo.html +++ /dev/null @@ -1,9 +0,0 @@ - - -

Demo Page

-

This demo page shows how to include directories of content in the pluginConfig.json file. - The idea is that it is possible to serve up non-compiled content such as the microscopy mode - which will not be included in the compile of OHIF but can be included later on dynamically. -

- - diff --git a/platform/ui/.webpack/webpack.dev.js b/platform/ui/.webpack/webpack.dev.js index db7c206b134..f51b5ac97b1 100644 --- a/platform/ui/.webpack/webpack.dev.js +++ b/platform/ui/.webpack/webpack.dev.js @@ -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 }); }; diff --git a/platform/ui/.webpack/webpack.prod.js b/platform/ui/.webpack/webpack.prod.js index f0f0b8d372f..632f55bc6b4 100644 --- a/platform/ui/.webpack/webpack.prod.js +++ b/platform/ui/.webpack/webpack.prod.js @@ -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({}), ], }); }; diff --git a/platform/ui/package.json b/platform/ui/package.json index d913dd10488..73595aec2ed 100644 --- a/platform/ui/package.json +++ b/platform/ui/package.json @@ -1,10 +1,10 @@ { "name": "@ohif/ui", - "version": "2.0.0", + "version": "3.0.0", "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" diff --git a/platform/ui/src/components/AboutModal/AboutModal.tsx b/platform/ui/src/components/AboutModal/AboutModal.tsx index d4eed452c89..cc8de6e288d 100644 --- a/platform/ui/src/components/AboutModal/AboutModal.tsx +++ b/platform/ui/src/components/AboutModal/AboutModal.tsx @@ -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 }) => {
{/* */} - + {buildNumber && } + {commitHash && }
diff --git a/platform/ui/src/storybook/components/footer/footer.tsx b/platform/ui/src/storybook/components/footer/footer.tsx index 6b0787a38ba..a7de1a419e9 100644 --- a/platform/ui/src/storybook/components/footer/footer.tsx +++ b/platform/ui/src/storybook/components/footer/footer.tsx @@ -8,7 +8,7 @@ export const Footer = ({ componentRelativePath }) => { additional usecases, please send us a pull request. Edit this page on{' '} Github diff --git a/platform/ui/src/storybook/components/heading/heading.tsx b/platform/ui/src/storybook/components/heading/heading.tsx index d4ff4118a10..1fa964a74df 100644 --- a/platform/ui/src/storybook/components/heading/heading.tsx +++ b/platform/ui/src/storybook/components/heading/heading.tsx @@ -32,7 +32,7 @@ export const Heading = ({ title, componentRelativePath }) => { {componentRelativePath && (
/src/__tests__/globalSetup.js"] - // rootDir: "../.." - // testMatch: [ - // //`/platform/${pack.name}/**/*.spec.js` - // "/platform/viewer/**/*.test.js" - // ] -}; diff --git a/platform/viewer/public/html-templates/rollbar.html b/platform/viewer/public/html-templates/rollbar.html deleted file mode 100644 index e8899fe74be..00000000000 --- a/platform/viewer/public/html-templates/rollbar.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OHIF Viewer - - - - - - - - - - - -
- - - - - diff --git a/tsconfig.json b/tsconfig.json index 8b2cb5786c6..bde4e4d25d4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "@ohif/core": ["platform/core/src"], "@ohif/ui": ["platform/ui/src"], "@ohif/i18n": ["platform/i18n/src"], - "@ohif/viewer": ["platform/viewer/src"] + "@ohif/app": ["platform/app/src"] } }, "include": [ diff --git a/version.json b/version.json new file mode 100644 index 00000000000..f13a94ec9b9 --- /dev/null +++ b/version.json @@ -0,0 +1,4 @@ +{ + "version": "3.5.0-beta.0", + "commit": "8f34bcd048540bb7d1501a5ac514739d4ee4d68c" +} \ No newline at end of file diff --git a/version.mjs b/version.mjs new file mode 100644 index 00000000000..fcadee568b2 --- /dev/null +++ b/version.mjs @@ -0,0 +1,190 @@ +import { execa } from 'execa'; +import semver from 'semver'; +import fs from 'fs/promises'; +import glob from 'glob'; +import path from 'path'; + +async function run() { + const { stdout: branchName } = await execa('git', [ + 'rev-parse', + '--abbrev-ref', + 'HEAD', + ]); + console.log('Current branch:', branchName); + + // read the current version from lerna.json + const lernaJson = JSON.parse(await fs.readFile('lerna.json', 'utf-8')); + const currentVersion = lernaJson.version; + + console.log('Current version:', currentVersion); + + const { stdout: currentCommitHash } = await execa('git', [ + 'rev-parse', + 'HEAD', + ]); + console.log('Current commit hash:', currentCommitHash); + + const { stdout: lastCommitMessage } = await execa('git', [ + 'log', + '--format=%B', + '-n', + '1', + ]); + + let nextVersion; + + if (branchName === 'release') { + console.log('Branch: release'); + nextVersion = semver.inc(currentVersion, 'minor'); + } else { + console.log('Branch: master/main'); + const prereleaseComponents = semver.prerelease(currentVersion); + const isBumpBeta = lastCommitMessage.trim().endsWith('[BUMP BETA]'); + console.log('isBumpBeta', isBumpBeta); + + if ( + prereleaseComponents && + prereleaseComponents.includes('beta') && + !isBumpBeta + ) { + nextVersion = semver.inc(currentVersion, 'prerelease', 'beta'); + } else if (isBumpBeta && prereleaseComponents.includes('beta')) { + console.log('Bumping beta version to be fresh beta'); + nextVersion = `${semver.major(currentVersion)}.${semver.minor( + currentVersion + ) + 1}.0-beta.0`; + } else { + console.log('Bumping minor version for beta release'); + const nextMinorVersion = semver.inc(currentVersion, 'minor'); + nextVersion = `${semver.major(nextMinorVersion)}.${semver.minor( + nextMinorVersion + )}.0-beta.0`; + } + } + + if (!nextVersion) { + throw new Error('Could not determine next version'); + } + + console.log('Next version:', nextVersion); + + const versionInfo = { version: nextVersion, commit: currentCommitHash }; + await fs.writeFile('./version.json', JSON.stringify(versionInfo, null, 2)); + await fs.writeFile('./version.txt', versionInfo.version); + await fs.writeFile('./commit.txt', versionInfo.commit); + + console.log('Version info saved to version.json'); + + // Read the packages from the lerna.json file + const packages = lernaJson.packages; + + if (!packages) { + throw new Error('Could not find packages in lerna.json'); + } + + // for each package's package.json file, see if there is a peerdependency, + // and for each peer dependency see if it includes a package that + // starts with @ohif/, if so update the version to the + // next version since lerna will not handle this for us + + // Iterate over each package path pattern + for (const packagePathPattern of packages) { + // Use glob to find all matching directories + const matchingDirectories = glob.sync(packagePathPattern); + + for (const packageDirectory of matchingDirectories) { + const packageJsonPath = path.join(packageDirectory, 'package.json'); + + try { + const packageJson = JSON.parse( + await fs.readFile(packageJsonPath, 'utf-8') + ); + + if (!packageJson.peerDependencies) { + continue; + } + + for (const peerDependency of Object.keys( + packageJson.peerDependencies + )) { + if (peerDependency.startsWith('@ohif/')) { + packageJson.peerDependencies[peerDependency] = nextVersion; + + console.log( + 'updating peerdependency to ', + packageJson.peerDependencies[peerDependency] + ); + } + } + + await fs.writeFile( + packageJsonPath, + JSON.stringify(packageJson, null, 2) + '\n' + ); + + console.log(`Updated ${packageJsonPath}`); + } catch (err) { + // This could be a directory without a package.json file. Ignore and continue. + continue; + } + } + } + + // Todo: Do we really need to run the build command here? + // Maybe we need to hook the netlify deploy preview + // await execa('yarn', ['run', 'build']); + // console.log('Build command completed'); + + console.log('Committing and pushing changes...'); + await execa('git', ['add', '-A']); + await execa('git', [ + 'commit', + '-m', + 'chore(version): version.json [skip ci]', + ]); + await execa('git', ['push', 'origin', branchName]); + + console.log('Setting the version using lerna...'); + + // add a message to the commit to indicate that the version was set using lerna + await execa('npx', [ + 'lerna', + 'version', + nextVersion, + '--yes', + '--exact', + '--force-publish', + '--message', + 'chore(version): Update package versions [skip ci]', + ]); + console.log('Version set using lerna'); + + // Publishing each package, if on master/main branch publish beta versions + // otherwise publish latest + if (branchName === 'release') { + await execa('npx', [ + 'lerna', + 'publish', + 'from-package', + '--no-verify-access', + '--yes', + ]); + } else { + await execa('npx', [ + 'lerna', + 'publish', + 'from-package', + '--no-verify-access', + '--yes', + '--dist-tag', + 'beta', + ]); + } + + console.log('Finished'); +} + +run().catch(err => { + console.error('Error encountered during version bump:', err); + process.exit(1); +}); diff --git a/version.txt b/version.txt new file mode 100644 index 00000000000..ffddefe8c71 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +3.5.0-beta.0 \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index e0b3eea493d..38c0244613f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9794,6 +9794,21 @@ execa@^6.0.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" +execa@^7.1.1: + version "7.1.1" + resolved "https://registry.npmjs.org/execa/-/execa-7.1.1.tgz#3eb3c83d239488e7b409d48e8813b76bb55c9c43" + integrity sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.1" + human-signals "^4.3.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^3.0.7" + strip-final-newline "^3.0.0" + executable@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" @@ -11438,6 +11453,11 @@ human-signals@^3.0.1: resolved "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz#c740920859dafa50e5a3222da9d3bf4bb0e5eef5" integrity sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ== +human-signals@^4.3.0: + version "4.3.1" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" + integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== + humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -18434,6 +18454,13 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semve dependencies: lru-cache "^6.0.0" +semver@^7.5.1: + version "7.5.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== + dependencies: + lru-cache "^6.0.0" + semver@~7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"