From e47dcf27fc81f17bcd0ce8183cd033b67e97c7b1 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Tue, 6 Aug 2019 14:22:44 -0400 Subject: [PATCH] Clean duplicate code in UI project --- .../ISSUE_TEMPLATE/---bug-report.md | 0 .../ISSUE_TEMPLATE/---feature-request.md | 0 .../ISSUE_TEMPLATE/---support-question.md | 0 LICENSE | 21 ++++ maintainer-notes.md | 2 + platform/ui/.circleci/config.yml | 85 -------------- platform/ui/.codecov.yml | 2 - platform/ui/.vscode/extensions.json | 8 -- platform/ui/.vscode/settings.json | 29 ----- platform/ui/doczrc.js | 106 ++++++------------ platform/ui/netlify.toml | 21 ---- 11 files changed, 57 insertions(+), 217 deletions(-) rename {platform/ui/.github => .github}/ISSUE_TEMPLATE/---bug-report.md (100%) rename {platform/ui/.github => .github}/ISSUE_TEMPLATE/---feature-request.md (100%) rename {platform/ui/.github => .github}/ISSUE_TEMPLATE/---support-question.md (100%) create mode 100644 LICENSE delete mode 100644 platform/ui/.circleci/config.yml delete mode 100644 platform/ui/.codecov.yml delete mode 100644 platform/ui/.vscode/extensions.json delete mode 100644 platform/ui/.vscode/settings.json delete mode 100644 platform/ui/netlify.toml diff --git a/platform/ui/.github/ISSUE_TEMPLATE/---bug-report.md b/.github/ISSUE_TEMPLATE/---bug-report.md similarity index 100% rename from platform/ui/.github/ISSUE_TEMPLATE/---bug-report.md rename to .github/ISSUE_TEMPLATE/---bug-report.md diff --git a/platform/ui/.github/ISSUE_TEMPLATE/---feature-request.md b/.github/ISSUE_TEMPLATE/---feature-request.md similarity index 100% rename from platform/ui/.github/ISSUE_TEMPLATE/---feature-request.md rename to .github/ISSUE_TEMPLATE/---feature-request.md diff --git a/platform/ui/.github/ISSUE_TEMPLATE/---support-question.md b/.github/ISSUE_TEMPLATE/---support-question.md similarity index 100% rename from platform/ui/.github/ISSUE_TEMPLATE/---support-question.md rename to .github/ISSUE_TEMPLATE/---support-question.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..19e20dd35 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Open Health Imaging Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/maintainer-notes.md b/maintainer-notes.md index a16a8e503..7295bad5a 100644 --- a/maintainer-notes.md +++ b/maintainer-notes.md @@ -14,3 +14,5 @@ yarn add --dev -W package-name - Patch status for PRs (we care about threshold only) - Allows us to use multiproject test runner - Flags per project for merged coverage; easier to break down coverage per project +- Remove all-contributors bot; install CLI per project and add per project commands +- diff --git a/platform/ui/.circleci/config.yml b/platform/ui/.circleci/config.yml deleted file mode 100644 index cf72be118..000000000 --- a/platform/ui/.circleci/config.yml +++ /dev/null @@ -1,85 +0,0 @@ -version: 2 - -### ABOUT -# -# This configuration powers our Circleci.io integration -# -# Note: -# Netlify works independently from this configuration to -# create pull request previews and to update `https://react.ohif.org` -### - -defaults: &defaults - working_directory: ~/repo - docker: - - image: circleci/node:10.15.1 - -jobs: - build_and_test: - <<: *defaults - steps: - # Download and cache dependencies - - checkout - - restore_cache: - name: Restore Yarn Package Cache - keys: - # when lock file changes, use increasingly general patterns to restore cache - - yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }} - - yarn-packages-v1-{{ .Branch }}- - - yarn-packages-v1- - - run: - name: Install Dependencies - command: yarn install --frozen-lockfile - - save_cache: - name: Save Yarn Package Cache - paths: - - ~/.cache/yarn - key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }} - - # Build & Test - - run: yarn build - - run: yarn test - - # Persist :+1: - - persist_to_workspace: - root: ~/repo - paths: . - - npm_publish: - <<: *defaults - steps: - - attach_workspace: - at: ~/repo - - run: - name: Avoid hosts unknown for github - command: - mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking - no\n" > ~/.ssh/config - - run: - name: Publish using Semantic Release - command: npx semantic-release - -workflows: - version: 2 - - # PULL REQUESTS - pull_requests: - jobs: - - build_and_test: - filters: - branches: - ignore: - - master - - feature/* - - hotfix/* - - # MERGE TO MASTER - cut_release: - jobs: - - build_and_test: - filters: - branches: - only: master - - npm_publish: - requires: - - build_and_test diff --git a/platform/ui/.codecov.yml b/platform/ui/.codecov.yml deleted file mode 100644 index 4b5537fc7..000000000 --- a/platform/ui/.codecov.yml +++ /dev/null @@ -1,2 +0,0 @@ -fixes: - - "::platform/ui/" diff --git a/platform/ui/.vscode/extensions.json b/platform/ui/.vscode/extensions.json deleted file mode 100644 index 2280f7c91..000000000 --- a/platform/ui/.vscode/extensions.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "recommendations": [ - "esbenp.prettier-vscode", - "sysoev.language-stylus", - "silvenon.mdx", - "dbaeumer.vscode-eslint" - ] -} diff --git a/platform/ui/.vscode/settings.json b/platform/ui/.vscode/settings.json deleted file mode 100644 index 4b67a8bd3..000000000 --- a/platform/ui/.vscode/settings.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "editor.rulers": [80, 120], - - // === - // Spacing - // === - - "editor.insertSpaces": true, - "editor.tabSize": 2, - "editor.trimAutoWhitespace": true, - "files.trimTrailingWhitespace": true, - "files.eol": "\n", - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, - - // === - // Event Triggers - // === - - "editor.formatOnSave": true, - "eslint.autoFixOnSave": true, - "eslint.run": "onSave", - "eslint.validate": [ - { "language": "javascript", "autoFix": true }, - { "language": "javascriptreact", "autoFix": true } - ], - "prettier.disableLanguages": [], - "prettier.endOfLine": "lf" -} diff --git a/platform/ui/doczrc.js b/platform/ui/doczrc.js index 06466abd9..b3abf4cd3 100644 --- a/platform/ui/doczrc.js +++ b/platform/ui/doczrc.js @@ -3,48 +3,44 @@ * https://www.docz.site/docs/project-configuration */ -import { css } from 'docz-plugin-css'; +import { css } from "docz-plugin-css"; export default { - dest: 'example/build', - public: '/public', - wrapper: 'src/__docs__/wrapper', - indexHtml: 'src/__docs__/index.html', + dest: "example/build", + public: "/public", + wrapper: "src/__docs__/wrapper", + indexHtml: "src/__docs__/index.html", // Limited support for importing `.styl` files codeSandbox: false, // https://github.com/pedronauck/docz/pull/849/files // Because we re-export using `index.js` files notUseSpecifiers: true, - // filterComponents: files => - // files.filter(filepath => - // /\/[A-Z]\w*(\/index)?\.(js|jsx|ts|tsx)$/.test(filepath) - // ), menu: [ - 'Introduction', - 'Getting Started', - { name: 'Elements', menu: ['Form / Select'] }, + "Introduction", + "Getting Started", + { name: "Elements", menu: ["Form / Select"] }, { - name: 'Components', + name: "Components", menu: [ - 'CINE Dialog', - 'Layout Button', - 'Measurement Table', - 'Overlay Trigger', - 'Quick Switch', - 'Rounded Button Group', - 'Select Tree', - 'Simple Dialog', - 'Study Browser', - 'Study List', - 'Table List', - 'Toolbar Section', - 'About Modal', - 'User Preferences Modal', - ], + "CINE Dialog", + "Layout Button", + "Measurement Table", + "Overlay Trigger", + "Quick Switch", + "Rounded Button Group", + "Select Tree", + "Simple Dialog", + "Study Browser", + "Study List", + "Table List", + "Toolbar Section", + "About Modal", + "User Preferences Modal" + ] }, - 'Styling & Theming', - 'Translating', - 'Compatibility', + "Styling & Theming", + "Translating", + "Compatibility" ], // Rollup Aliases? // https://github.com/pedronauck/docz/issues/373 @@ -53,9 +49,9 @@ export default { css(), // Stylus css({ - preprocessor: 'stylus', - cssmodules: false, - }), + preprocessor: "stylus", + cssmodules: false + }) ], // `docz` uses file-loader to pull in SVGs. This kills our icons before // They can be picked up by our `babel-plugin-inline-react-svg` dependency @@ -64,50 +60,16 @@ export default { // How we delete our rule: // https://github.com/neutrinojs/webpack-chain/issues/48 onCreateWebpackChain: config => { - config.module.rules.delete('svg'); - - // config.module - // .rule('svg') - // .test(/\.(svg)(\?.*)?$/) - // .use('file-loader') - // .loader(require.resolve('file-loader')) - // .options({ - // name: `static/img/[name].[ext]`, - // }) + config.module.rules.delete("svg"); }, modifyBabelRc: babelrc => { const newBabelRc = { ...babelrc, plugins: [ ...babelrc.plugins, - require.resolve('babel-plugin-inline-react-svg'), - ], + require.resolve("babel-plugin-inline-react-svg") + ] }; return newBabelRc; - }, + } }; - -/* - * Alternative ways to extend/modify underlying webpack config - * -modifyBundlerConfig: (config) => { - config.module.rules.push({ - test: /\.scss$/, - use: ["style-loader", "css-loader", "sass-loader"] - }) - - return config -} - * - * - * -onCreateWebpackChain: config => { - config.module - .rule('css') - .test(/\.css$/) - .use('css-loader') - .loader('css-loader') - .options({ sourceMap: false, - importLoaders: 2 }) -} -*/ diff --git a/platform/ui/netlify.toml b/platform/ui/netlify.toml deleted file mode 100644 index 2aace3d92..000000000 --- a/platform/ui/netlify.toml +++ /dev/null @@ -1,21 +0,0 @@ -# https://www.netlify.com/docs/continuous-deployment/#deploy-contexts -# -# Global settings applied to the whole site. -# -# “base” is the directory to change to before starting build. If you set base: -# that is where we will look for package.json/.nvmrc/etc, not repo root! -# “command” is your build command. -# “publish” is the directory to publish (relative to the root of your repo). - -# COMMENT: NODE_VERSION in root `.nvmrc` takes priority -# COMMENT: Why we specify YARN_FLAGS: https://www.netlify.com/docs/build-gotchas/#yarn -[build.environment] - NODE_VERSION = "10.15.3" - YARN_VERSION = "1.15.2" - YARN_FLAGS = "--no-ignore-optional --pure-lockfile" - -# COMMENT: This a rule for Single Page Applications -[[redirects]] - from = "/*" - to = "/index.html" - status = 200 \ No newline at end of file