From 4b532183afc2f0d7cf5a072d18a5c343abed9f28 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Tue, 6 Aug 2019 15:03:43 -0400 Subject: [PATCH] Reduce duplicate code in `@ohif/core` --- platform/core/.codecov.yml | 2 -- platform/core/.gitignore | 27 -------------- platform/core/README.md | 58 ++++-------------------------- platform/core/package.json | 57 ++++++------------------------ platform/core/rollup.config.js | 64 ---------------------------------- 5 files changed, 18 insertions(+), 190 deletions(-) delete mode 100644 platform/core/.codecov.yml delete mode 100644 platform/core/.gitignore delete mode 100644 platform/core/rollup.config.js diff --git a/platform/core/.codecov.yml b/platform/core/.codecov.yml deleted file mode 100644 index 3d13ff988..000000000 --- a/platform/core/.codecov.yml +++ /dev/null @@ -1,2 +0,0 @@ -fixes: - - "::platform/core/" diff --git a/platform/core/.gitignore b/platform/core/.gitignore deleted file mode 100644 index 007760ae4..000000000 --- a/platform/core/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# dependencies -node_modules - -# builds -build -dist -.rpt2_cache -coverage/ -junit.xml - -# misc -.DS_Store -.env -.env.local -.env.development.local -.env.test.local -.env.production.local -package-lock.json - -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.idea -.yalc -yalc.lock diff --git a/platform/core/README.md b/platform/core/README.md index c60361196..1d19e6ff0 100644 --- a/platform/core/README.md +++ b/platform/core/README.md @@ -1,20 +1,15 @@
-

ohif-core

-

ohif-core is a collection of useful functions and classes for building web-based medical imaging applications. This library helps power OHIF's zero-footprint DICOM viewer.

+

@ohif/core

+

@ohif/core is a collection of useful functions and classes for building web-based medical imaging applications. This library helps power OHIF's zero-footprint DICOM viewer.


-[![CircleCI][circleci-image]][circleci-url] -[![codecov][codecov-image]][codecov-url] -[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors) -[![code style: prettier][prettier-image]][prettier-url] -[![semantic-release][semantic-image]][semantic-url] - [![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] +[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors) [![MIT License][license-image]][license-url] @@ -53,10 +48,10 @@ implementation][react-viewer]. ``` // with npm -npm i ohif-core --save-exact +npm i @ohif/core --save-exact // with yarn -yarn add ohif-core --exact +yarn add @ohif/core --exact ``` ### Usage @@ -105,31 +100,6 @@ your tests, reporting the results to your terminal. Make a pull request with your changes to `master`, and a core team member will review your work. If you have any questions, please don't hesitate to reach out via a GitHub issue. -## Issues - -_Looking to contribute? Look for the [Good First Issue][good-first-issue] -label._ - -### 🐛 Bugs - -Please file an issue for bugs, missing documentation, or unexpected behavior. - -[**See Bugs**][bugs] - -### 💡 Feature Requests - -Please file an issue to suggest new features. Vote on feature requests by adding -a 👍. This helps maintainers prioritize what to work on. - -[**See Feature Requests**][requests-feature] - -### ❓ Questions - -For questions related to using the library, please visit our support community, -or file an issue on GitHub. - -[Google Group][google-group] - ## Contributors Thanks goes to these wonderful people @@ -155,27 +125,13 @@ Links: -[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square -[contributing-url]: https://github.com/OHIF/ohif-core/blob/master/CONTRIBUTING.md -[circleci-image]: https://circleci.com/gh/OHIF/ohif-core.svg?style=svg -[circleci-url]: https://circleci.com/gh/OHIF/ohif-core -[codecov-image]: https://codecov.io/gh/OHIF/ohif-core/branch/master/graph/badge.svg -[codecov-url]: https://codecov.io/gh/OHIF/ohif-core -[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square -[prettier-url]: https://github.com/prettier/prettier -[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-core [npm-downloads-image]: https://img.shields.io/npm/dm/ohif-core.svg?style=flat-square [npm-version-image]: https://img.shields.io/npm/v/ohif-core.svg?style=flat-square +[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square +[contributing-url]: https://github.com/OHIF/ohif-core/blob/master/CONTRIBUTING.md [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square [license-url]: LICENSE [react-viewer]: https://github.com/OHIF/Viewers/tree/react - -[bugs]: https://github.com/OHIF/ohif-core/labels/bug -[requests-feature]: https://github.com/OHIF/ohif-core/labels/enhancement -[good-first-issue]: https://github.com/OHIF/ohif-core/labels/good%20first%20issue -[google-group]: https://groups.google.com/forum/#!forum/cornerstone-platform diff --git a/platform/core/package.json b/platform/core/package.json index 1a7202bec..1d9aeecc9 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -1,8 +1,8 @@ { "name": "@ohif/core", "version": "0.11.1-alpha.0", - "description": "Useful functions and classes for building web-based medical imaging applications", - "author": "OHIF Contributors", + "description": "Generic business logic for web-based medical imaging applications", + "author": "OHIF Core Team", "license": "MIT", "repository": "OHIF/Viewers", "main": "dist/index.umd.js", @@ -16,14 +16,15 @@ "npm": ">=5" }, "scripts": { + "start": "yarn run dev", + "dev": "jest --watch", + "dev:core": "yarn run dev", "test:unit": "jest --watch", "test:unit:ci": "jest --ci --runInBand --collectCoverage", - "build": "rollup -c", - "lerna:build": "webpack --config config/webpack.prod.js -w -d", - "dev": "jest --watch", - "start": "rollup -c -w", + "build": "webpack --config config/webpack.prod.js -d", + "build:package": "yarn run build", "lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}", - "prepublishOnly": "npm run build" + "prepublishOnly": "yarn run build" }, "peerDependencies": { "cornerstone-core": "^2.2.8", @@ -41,44 +42,8 @@ "mousetrap": "^1.6.3", "validate.js": "^0.12.0" }, - "devDependencies": { - "@svgr/rollup": "^4.1.0", - "babel-eslint": "10.0.1", - "babel-jest": "^24.7.1", - "commitizen": "3.1.x", - "cross-env": "^5.2.0", - "cz-conventional-changelog": "2.1.x", - "eslint": "5.13.0", - "eslint-config-prettier": "^4.3.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-node": "^8.0.0", - "eslint-plugin-prettier": "^3.1.0", - "eslint-plugin-promise": "^4.0.1", - "husky": "^1.2.1", - "jest": "^24.7.1", - "jest-junit": "^6.3.0", - "lint-staged": "^8.1.0", - "prettier": "^1.15.3", - "redux-testkit": "^1.0.6", - "rollup": "^1.1.2", - "rollup-plugin-babel": "^4.1.0", - "rollup-plugin-commonjs": "^9.2.0", - "rollup-plugin-json": "^4.0.0", - "rollup-plugin-node-resolve": "^4.0.0", - "rollup-plugin-peer-deps-external": "^2.2.0", - "rollup-plugin-postcss": "^2.0.3", - "rollup-plugin-url": "^2.1.0", - "semantic-release": "15.13.x", - "stylelint": "^9.9.0", - "stylelint-config-recommended": "^2.1.0", - "stylus": "^0.54.5" - }, "files": [ - "dist" - ], - "config": { - "commitizen": { - "path": "./node_modules/cz-conventional-changelog" - } - } + "dist", + "README.md" + ] } diff --git a/platform/core/rollup.config.js b/platform/core/rollup.config.js deleted file mode 100644 index 6deb3bb36..000000000 --- a/platform/core/rollup.config.js +++ /dev/null @@ -1,64 +0,0 @@ -import babel from 'rollup-plugin-babel' -import commonjs from 'rollup-plugin-commonjs' -import external from 'rollup-plugin-peer-deps-external' -import postcss from 'rollup-plugin-postcss' -import resolve from 'rollup-plugin-node-resolve' -import url from 'rollup-plugin-url' -import json from 'rollup-plugin-json' -import svgr from '@svgr/rollup' -import pkg from './package.json' - -const globals = { - 'react': 'React', - 'react-dom': 'ReactDOM', - 'cornerstone-core': 'cornerstone', - 'cornerstone-math': 'cornerstoneMath', - 'cornerstone-tools': 'cornerstoneTools', - 'cornerstone-wado-image-loader': 'cornerstoneWADOImageLoader', - 'dicom-parser': 'dicomParser' -}; - -export default { - input: 'src/index.js', - output: [ - { - file: pkg.main, - format: 'umd', - name: 'OHIF', - sourcemap: true, - exports: 'named', - globals - }, - { - file: pkg.module, - format: 'es', - sourcemap: true, - exports: 'named', - globals - }, - ], - plugins: [ - external(), - postcss({ - modules: false - }), - url(), - json(), - svgr(), - babel({ - exclude: 'node_modules/**', - externalHelpers: false, - runtimeHelpers: true - }), - resolve(), - commonjs({ - include: 'node_modules/**', - namedExports: { - 'node_modules/dicomweb-client/build/dicomweb-client.js': [ - 'api' - ] - } - }), - ], - external: Object.keys(pkg.peerDependencies || {}), -}