Skip to content

Commit 08ff214

Browse files
authored
Chore/kill yalc with fire (OHIF#629)
* 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
1 parent cac911f commit 08ff214

File tree

919 files changed

+45697
-52142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

919 files changed

+45697
-52142
lines changed

.babelrc

-19
This file was deleted.

.circleci/config.yml

+160-56
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2
1+
version: 2.1
22

33
### ABOUT
44
#
@@ -9,17 +9,29 @@ version: 2
99
# create pull request previews and to update `https://docs.ohif.org`
1010
###
1111

12+
orbs:
13+
codecov: codecov/[email protected]
14+
cypress: cypress-io/[email protected]
15+
1216
defaults: &defaults
13-
working_directory: ~/repo
1417
docker:
15-
- image: circleci/node:10.15.1
18+
- image: circleci/node:10.16.0
19+
environment:
20+
TERM: xterm # Enable colors in term
21+
working_directory: ~/repo
1622

1723
jobs:
18-
build_and_test:
24+
PR_UNIT_TESTS:
1925
<<: *defaults
26+
2027
steps:
21-
# Download and cache dependencies
22-
- checkout
28+
# Enable yarn workspaces
29+
- run: yarn config set workspaces-experimental true
30+
31+
# Checkout code and ALL Git Tags
32+
- checkout:
33+
post:
34+
- git fetch --all
2335
- restore_cache:
2436
name: Restore Yarn and Cypress Package Cache
2537
keys:
@@ -35,47 +47,109 @@ jobs:
3547
paths:
3648
- ~/.cache ## Cache yarn and Cypress
3749
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
38-
# Build & Test
39-
- run: yarn build:package:ci
40-
# https://www.viget.com/articles/using-junit-on-circleci-2-0-with-jest-and-eslint/
50+
51+
# RUN TESTS
4152
- run:
4253
name: 'JavaScript Test Suite'
43-
command: yarn test:unit:ci
44-
environment:
45-
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
46-
# Store result
47-
- store_test_results:
48-
path: reports/junit
49-
- store_artifacts:
50-
path: reports/junit
54+
command: yarn run test:unit:ci
55+
56+
# PLATFORM/VIEWER
57+
- run:
58+
name: 'VIEWER: Combine report output'
59+
command: |
60+
viewerCov="/home/circleci/repo/platform/viewer/coverage"
61+
touch "${viewerCov}/reports"
62+
cat "${viewerCov}/clover.xml" >> "${viewerCov}/reports"
63+
echo "\<<\<<\<< EOF" >> "${viewerCov}/reports"
64+
cat "${viewerCov}/lcov.info" >>"${viewerCov}/reports"
65+
echo "\<<\<<\<< EOF" >> "${viewerCov}/reports"
66+
- codecov/upload:
67+
file: '/home/circleci/repo/platform/viewer/coverage/reports'
68+
flags: 'viewer'
69+
70+
# PLATFORM/CORE
71+
- run:
72+
name: 'CORE: Combine report output'
73+
command: |
74+
coreCov="/home/circleci/repo/platform/core/coverage"
75+
touch "${coreCov}/reports"
76+
cat "${coreCov}/clover.xml" >> "${coreCov}/reports"
77+
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
78+
cat "${coreCov}/lcov.info" >> "${coreCov}/reports"
79+
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
80+
- codecov/upload:
81+
file: '/home/circleci/repo/platform/core/coverage/reports'
82+
flags: 'core'
83+
5184
# Persist :+1:
5285
- persist_to_workspace:
5386
root: ~/repo
5487
paths: .
5588

56-
e2e_test:
57-
working_directory: ~/repo
58-
docker:
59-
- image: cypress/base:8
60-
environment:
61-
## this enables colors in the output
62-
TERM: xterm
89+
MERGE_UNIT_TESTS:
90+
<<: *defaults
91+
6392
steps:
64-
- attach_workspace:
65-
at: ~/repo
93+
# Enable yarn workspaces
94+
- run: yarn config set workspaces-experimental true
95+
96+
# Checkout code and ALL Git Tags
97+
- checkout:
98+
post:
99+
- git fetch --all
66100
- restore_cache:
67101
name: Restore Yarn and Cypress Package Cache
68102
keys:
69103
# when lock file changes, use increasingly general patterns to restore cache
70104
- yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
71105
- yarn-packages-v1-{{ .Branch }}-
72106
- yarn-packages-v1-
73-
# - run: $(yarn bin)/cypress run --record
74-
# Shouldn't be needed if we're using a package cache that contains Cypress
75-
# Could do a check here, if it doesn't exist, install cypress?
76-
- run: yarn install
77-
- run: yarn run test:e2e:ci
78-
- run: yarn run test:e2e:scriptTag
107+
- run:
108+
name: Install Dependencies
109+
command: yarn install --frozen-lockfile
110+
- save_cache:
111+
name: Save Yarn Package Cache
112+
paths:
113+
- ~/.cache ## Cache yarn and Cypress
114+
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
115+
116+
# RUN TESTS
117+
- run:
118+
name: 'JavaScript Test Suite'
119+
command: yarn run test:unit:ci
120+
121+
# PLATFORM/VIEWER
122+
- run:
123+
name: 'VIEWER: Combine report output'
124+
command: |
125+
viewerCov="/home/circleci/repo/platform/viewer/coverage"
126+
touch "${viewerCov}/reports"
127+
cat "${viewerCov}/clover.xml" >> "${viewerCov}/reports"
128+
echo "\<<\<<\<< EOF" >> "${viewerCov}/reports"
129+
cat "${viewerCov}/lcov.info" >>"${viewerCov}/reports"
130+
echo "\<<\<<\<< EOF" >> "${viewerCov}/reports"
131+
- codecov/upload:
132+
file: '/home/circleci/repo/platform/viewer/coverage/reports'
133+
flags: 'viewer'
134+
135+
# PLATFORM/CORE
136+
- run:
137+
name: 'CORE: Combine report output'
138+
command: |
139+
coreCov="/home/circleci/repo/platform/core/coverage"
140+
touch "${coreCov}/reports"
141+
cat "${coreCov}/clover.xml" >> "${coreCov}/reports"
142+
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
143+
cat "${coreCov}/lcov.info" >> "${coreCov}/reports"
144+
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
145+
- codecov/upload:
146+
file: '/home/circleci/repo/platform/core/coverage/reports'
147+
flags: 'core'
148+
149+
# Persist :+1:
150+
- persist_to_workspace:
151+
root: ~/repo
152+
paths: .
79153

80154
npm_publish:
81155
<<: *defaults
@@ -87,11 +161,14 @@ jobs:
87161
command:
88162
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking
89163
no\n" > ~/.ssh/config
90-
# --no-ci argument is not ideal; however, semantic-rlease thinks we're
91-
# attempting to run it from a `pr`, which is not the case
164+
# - run:
165+
# name: Publish using Semantic Release
166+
# command: npx semantic-release --debug
92167
- run:
93-
name: Publish using Semantic Release
94-
command: npx semantic-release --debug
168+
npx lerna version --allow-branch monorepo --conventional-commits
169+
--conventional-prerelease=* --create-release github
170+
- run: npx lerna publish from-package --canary --dist-tag canary
171+
95172
# Persist :+1:
96173
- persist_to_workspace:
97174
root: ~/repo
@@ -215,43 +292,70 @@ workflows:
215292
# PULL REQUESTS
216293
pull_requests:
217294
jobs:
218-
- build_and_test:
295+
- PR_UNIT_TESTS:
219296
filters:
220297
branches:
221298
ignore:
222299
- master
223300
- feature/*
224301
- hotfix/*
225-
- e2e_test:
302+
# Cypress job added by `cypress-io` orb
303+
- cypress/run:
304+
pre-steps:
305+
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v' # Use yarn latest
306+
yarn: true
307+
store_artifacts: true
308+
start: yarn run dev
309+
wait-on: 'http://localhost:3000'
310+
no-workspace: true # Don't persist workspace
311+
working_directory: platform/viewer
312+
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
313+
post-steps:
314+
- store_test_results:
315+
path: cypress/results
226316
requires:
227-
- build_and_test
317+
- PR_UNIT_TESTS
228318

229319
# MERGE TO MASTER
230320
cut_release:
231321
jobs:
232-
- build_and_test:
322+
- MERGE_UNIT_TESTS:
233323
filters:
234324
branches:
235-
only: master
236-
- e2e_test:
325+
only: monorepo
326+
# only: master
327+
# Cypress job added by `cypress-io` orb
328+
- cypress/run:
329+
pre-steps:
330+
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v' # Use yarn latest
331+
yarn: true
332+
record: true
333+
store_artifacts: true
334+
start: yarn run dev
335+
wait-on: 'http://localhost:3000'
336+
working_directory: platform/viewer
337+
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
338+
post-steps:
339+
- store_test_results:
340+
path: cypress/results
237341
requires:
238-
- build_and_test
342+
- MERGE_UNIT_TESTS
239343
# Update NPM
240344
- npm_publish:
241345
requires:
242-
- e2e_test
346+
- cypress/run
243347
# Update docs.ohif.org
244-
- docs_publish:
245-
requires:
246-
- e2e_test
348+
# - docs_publish:
349+
# requires:
350+
# - cypress/run
247351
# Update hub.docker.org
248-
- docker_publish:
249-
requires:
250-
- npm_publish
352+
# - docker_publish:
353+
# requires:
354+
# - npm_publish
251355
# Update viewer.ohif.org
252-
- build_demo_site:
253-
requires:
254-
- e2e_test
255-
- demo_site_publish:
256-
requires:
257-
- build_demo_site
356+
# - build_demo_site:
357+
# requires:
358+
# - cypress/run
359+
# - demo_site_publish:
360+
# requires:
361+
# - build_demo_site

.codecov.yml

+11
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,15 @@ coverage:
99
project:
1010
default:
1111
threshold: 0.10%
12+
core:
13+
flags: core
14+
viewer:
15+
flags: viewer
1216
patch: off
17+
flags:
18+
core:
19+
paths:
20+
- platform/core
21+
viewer:
22+
paths:
23+
- platform/viewer

.eslintrc .eslintrc.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"extends": ["react-app", "eslint:recommended", "plugin:react/recommended"],
2+
"extends": [
3+
"react-app",
4+
"eslint:recommended",
5+
"plugin:react/recommended",
6+
"plugin:prettier/recommended"
7+
],
38
"parser": "babel-eslint",
49
"env": {
510
"jest": true

.gitattributes

-40
This file was deleted.

0 commit comments

Comments
 (0)