Skip to content

Commit

Permalink
Chore/kill yalc with fire (#629)
Browse files Browse the repository at this point in the history
* init

* more shifting

* Move @babel dependencies up to workspace root

* Begin updating dependent libraries to use sync'd webpack builds w/ watches

* Commit changes before a long weekend

* Split packages into platform and extensions

* Consolidate how/where we specify file/module type entrypoints

* Make it possible to pass in extensions as App props

* Resolve viewer's modules

* Target for UMD bundle

* Add Webpack Stylus loader

* Provide WebPack build options for microscopy, vtk, and ui

* Better entrypoint for extensions

* Push changes up to switch PCs

* Fix ESM symlink build for Viewers

* Shift docs to root

* Specify additional lerna config props

* Begin providing basic readme info

* Rename example extension folder

* Shift links to bottom of doc

* First attempt at a netlify deploy preview

* Attempt to fix deploy preview build

* push workspace enabled to initial command; remove second yarn install; use npx to call gitbook cli commands

* Try to use global gitbook-cli

* Export node_modules path

* More agressive with modifying PATH

* Follow deploy log output advice

* try again to set bin path

* Try swapping bash with a new shell

* Try bash -l instead of exec bash

* Annd let's try again

* and again

* We may have figured it out johnny, boy

* We need to pull cornerstone-wado-image-loader files from hoisted node_modules

* Attempt to fix ticks/escapes

* Change copy syntax; try running tests on viewers from root for circleci

* Lower version to match circleci image

* Try alternative jest-canvas-mock location and version file syntax

* Run version command instead of calling node directly

* Try alternative jest transform

* Set path and enable workspaces

* Add codecov flags

* Use cpx so our copying finishes?

* Get all platform unit tests to run

* Run and report individually and in parallel

* Try once relying on codecov yaml to split w/ flags

* Add projects to split by flags

* Generate separate reports

* Trigger codecov after everything has finished running; these may not support flags

* Use recommended flags from issue comments for codecov

* Fix typo

* Remove clear flag

* Shift back to calling codecov from root

* Generate example for codecov issue

* Try fixing paths

* Simplify

* Try using codecov orb

* Bump circleci version

* Upload core and viewer

* Use full string paths

* Remove individual codecov calls

* Fix dir

* Combine files before upload

* Escape anchors

* tryfix syntax

* Escape string literal

* Combine lines to reduce path

* long paths

* Use home alias

* Fix filename

* Try to see the contents of our cat'd file

* Also upload `core`

* Try running with aliased folder

* Fix path; split PR and Merge unit tests into separate jobs

* Set default threshold

* Fix typo

* Changing to scoped package names

* Adding note

* Catch more updates

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]

* Clean up primary readme

* Support for dev and dev:* commands

* Shift build command; satisfy default PWA build

* Remove old scripts

* Clean up UI to set webpack scripts

* Tidy up project links

* Clean duplicate code in UI project

* Update UI project's docs

* Clean up ui and i18n config

* Reduce duplicate code in `@ohif/core`

* Fix @ohif/ui versions

* bump @ohif/core versions

* Redux testkit dep

* Remove unused/duplicate config files for projects/packages

* ohif-core --> @ohif/core

* Safer publish command

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]

* test version bump

* Add global prettier config

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]

* test lerna publish

* Update package.jsons

* Fix build scripts

* catch changes

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]

* fix eslint issues caused by eslint 6 and our react-app config

* Publish with canary tag

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]

* Simplify build

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]

* Split version and publish

* chore(release): publish %s [skip ci]

 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]
 - @ohif/[email protected]

* Try simplify netlify build

* react-viewerbase --> @ohif/ui

* add test for stylus loader

* Try new way to specify publish path

* Use an output folder that won't be ignored

* Try move command

* fiddle with paths

* Dig for some information

* Make sure we're in root for our commands

* Remove discovery

* Setup script-tag example

* Fix typo

* Move config folder

* Update cornerstone extension to use shared/root webpack configs

* capture changes

* Update extension webpack configs

* Don't check in docz output

* Fix babel runtime resolution issue

* Simplify ui build steps

* Push in progress

* Shift directories

* Get viewer dev path to work

* Fix viewer commonjs build

* Fix build pwa config for viewers

* Make sure our package specific command can be called from root

* Update notes

* Fix imports and misc. merge notes

* Bump wado-image-loader version

* Switch up commands to remove webworkers copy

* Fix CI config

* Fix more broken package references

* Add react-dropzone

* Persist so e2e test can use

* Fix lockfile

* Use cypress orb to simplify CI

* Fix config

* Try again

* Install yarn latest for orb

* Install yarn a different way

* Wait on correct port

* Run tests in viewer project

* Fix cypress config

* Make Cypress happier - use default location

* Simplify e2e testing

* Capture UI changes since fork

* Catch core up

* Grab latest deps after merge

* Fix broken import

* Make sure cornerstone-wado-image-loader resolves to 3+

* Note regarding orbs

* Fix refresh on 404 routes

* Fix odd error for cornerstone-wado-image-loader

* Different target for UMD

* Simplify dev script

* Try to get fancy with netlify output

* Let's do it again

* Try to fix measurementTools issue

* See if we can get our lerna magic to work on merge to monorepo branch
  • Loading branch information
dannyrb authored Aug 13, 2019
1 parent cac911f commit 08ff214
Show file tree
Hide file tree
Showing 919 changed files with 45,697 additions and 52,142 deletions.
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

216 changes: 160 additions & 56 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2
version: 2.1

### ABOUT
#
Expand All @@ -9,17 +9,29 @@ version: 2
# create pull request previews and to update `https://docs.ohif.org`
###

orbs:
codecov: codecov/[email protected]
cypress: cypress-io/[email protected]

defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:10.15.1
- image: circleci/node:10.16.0
environment:
TERM: xterm # Enable colors in term
working_directory: ~/repo

jobs:
build_and_test:
PR_UNIT_TESTS:
<<: *defaults

steps:
# Download and cache dependencies
- checkout
# Enable yarn workspaces
- run: yarn config set workspaces-experimental true

# Checkout code and ALL Git Tags
- checkout:
post:
- git fetch --all
- restore_cache:
name: Restore Yarn and Cypress Package Cache
keys:
Expand All @@ -35,47 +47,109 @@ jobs:
paths:
- ~/.cache ## Cache yarn and Cypress
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
# Build & Test
- run: yarn build:package:ci
# https://www.viget.com/articles/using-junit-on-circleci-2-0-with-jest-and-eslint/

# RUN TESTS
- run:
name: 'JavaScript Test Suite'
command: yarn test:unit:ci
environment:
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
# Store result
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit
command: yarn run test:unit:ci

# PLATFORM/VIEWER
- run:
name: 'VIEWER: Combine report output'
command: |
viewerCov="/home/circleci/repo/platform/viewer/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'
flags: 'viewer'

# PLATFORM/CORE
- run:
name: 'CORE: Combine report output'
command: |
coreCov="/home/circleci/repo/platform/core/coverage"
touch "${coreCov}/reports"
cat "${coreCov}/clover.xml" >> "${coreCov}/reports"
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
cat "${coreCov}/lcov.info" >> "${coreCov}/reports"
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
- codecov/upload:
file: '/home/circleci/repo/platform/core/coverage/reports'
flags: 'core'

# Persist :+1:
- persist_to_workspace:
root: ~/repo
paths: .

e2e_test:
working_directory: ~/repo
docker:
- image: cypress/base:8
environment:
## this enables colors in the output
TERM: xterm
MERGE_UNIT_TESTS:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo
# Enable yarn workspaces
- run: yarn config set workspaces-experimental true

# Checkout code and ALL Git Tags
- checkout:
post:
- git fetch --all
- restore_cache:
name: Restore Yarn and Cypress 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: $(yarn bin)/cypress run --record
# Shouldn't be needed if we're using a package cache that contains Cypress
# Could do a check here, if it doesn't exist, install cypress?
- run: yarn install
- run: yarn run test:e2e:ci
- run: yarn run test:e2e:scriptTag
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
paths:
- ~/.cache ## Cache yarn and Cypress
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}

# RUN TESTS
- run:
name: 'JavaScript Test Suite'
command: yarn run test:unit:ci

# PLATFORM/VIEWER
- run:
name: 'VIEWER: Combine report output'
command: |
viewerCov="/home/circleci/repo/platform/viewer/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'
flags: 'viewer'

# PLATFORM/CORE
- run:
name: 'CORE: Combine report output'
command: |
coreCov="/home/circleci/repo/platform/core/coverage"
touch "${coreCov}/reports"
cat "${coreCov}/clover.xml" >> "${coreCov}/reports"
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
cat "${coreCov}/lcov.info" >> "${coreCov}/reports"
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
- codecov/upload:
file: '/home/circleci/repo/platform/core/coverage/reports'
flags: 'core'

# Persist :+1:
- persist_to_workspace:
root: ~/repo
paths: .

npm_publish:
<<: *defaults
Expand All @@ -87,11 +161,14 @@ jobs:
command:
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking
no\n" > ~/.ssh/config
# --no-ci argument is not ideal; however, semantic-rlease thinks we're
# attempting to run it from a `pr`, which is not the case
# - run:
# name: Publish using Semantic Release
# command: npx semantic-release --debug
- run:
name: Publish using Semantic Release
command: npx semantic-release --debug
npx lerna version --allow-branch monorepo --conventional-commits
--conventional-prerelease=* --create-release github
- run: npx lerna publish from-package --canary --dist-tag canary

# Persist :+1:
- persist_to_workspace:
root: ~/repo
Expand Down Expand Up @@ -215,43 +292,70 @@ workflows:
# PULL REQUESTS
pull_requests:
jobs:
- build_and_test:
- PR_UNIT_TESTS:
filters:
branches:
ignore:
- master
- feature/*
- hotfix/*
- e2e_test:
# Cypress job added by `cypress-io` orb
- cypress/run:
pre-steps:
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v' # Use yarn latest
yarn: true
store_artifacts: true
start: yarn run dev
wait-on: 'http://localhost:3000'
no-workspace: true # Don't persist workspace
working_directory: platform/viewer
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
post-steps:
- store_test_results:
path: cypress/results
requires:
- build_and_test
- PR_UNIT_TESTS

# MERGE TO MASTER
cut_release:
jobs:
- build_and_test:
- MERGE_UNIT_TESTS:
filters:
branches:
only: master
- e2e_test:
only: monorepo
# only: master
# Cypress job added by `cypress-io` orb
- cypress/run:
pre-steps:
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v' # Use yarn latest
yarn: true
record: true
store_artifacts: true
start: yarn run dev
wait-on: 'http://localhost:3000'
working_directory: platform/viewer
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
post-steps:
- store_test_results:
path: cypress/results
requires:
- build_and_test
- MERGE_UNIT_TESTS
# Update NPM
- npm_publish:
requires:
- e2e_test
- cypress/run
# Update docs.ohif.org
- docs_publish:
requires:
- e2e_test
# - docs_publish:
# requires:
# - cypress/run
# Update hub.docker.org
- docker_publish:
requires:
- npm_publish
# - docker_publish:
# requires:
# - npm_publish
# Update viewer.ohif.org
- build_demo_site:
requires:
- e2e_test
- demo_site_publish:
requires:
- build_demo_site
# - build_demo_site:
# requires:
# - cypress/run
# - demo_site_publish:
# requires:
# - build_demo_site
11 changes: 11 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,15 @@ coverage:
project:
default:
threshold: 0.10%
core:
flags: core
viewer:
flags: viewer
patch: off
flags:
core:
paths:
- platform/core
viewer:
paths:
- platform/viewer
7 changes: 6 additions & 1 deletion .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"extends": ["react-app", "eslint:recommended", "plugin:react/recommended"],
"extends": [
"react-app",
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"parser": "babel-eslint",
"env": {
"jest": true
Expand Down
40 changes: 0 additions & 40 deletions .gitattributes

This file was deleted.

Loading

0 comments on commit 08ff214

Please sign in to comment.