Skip to content

Commit

Permalink
feat: Cornerstone3D 2.0 (#1400)
Browse files Browse the repository at this point in the history
Co-authored-by: Bill Wallace <[email protected]>
  • Loading branch information
sedghi and wayfarer3130 authored Oct 29, 2024
1 parent 089ac3e commit 692d9af
Show file tree
Hide file tree
Showing 1,528 changed files with 49,738 additions and 48,179 deletions.
19 changes: 15 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
paths:
- packages/core/dist
- packages/tools/dist
- packages/streaming-image-volume-loader/dist
- packages/adapters/dist
- packages/dicomImageLoader/dist
- packages/nifti-volume-loader/dist
Expand All @@ -60,6 +59,12 @@ jobs:
- attach_workspace:
at: ~/repo
- run: yarn run api-check
FORMAT_CHECK:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run: yarn run format-check

# https://circleci.com/docs/2.0/collect-test-data/#karma
TEST:
Expand Down Expand Up @@ -129,6 +134,9 @@ workflows:
- BUILD:
requires:
- CHECKOUT
- FORMAT_CHECK:
requires:
- BUILD
- API_CHECK:
requires:
- BUILD
Expand All @@ -144,16 +152,19 @@ workflows:
branches:
only:
- main
- beta
# - beta
- BUILD:
requires:
- CHECKOUT
- HOLD_FOR_APPROVAL:
type: approval
requires:
- BUILD
- TEST:
requires:
- CHECKOUT
- NPM_PUBLISH:
requires:
- BUILD
- TEST
- HOLD_FOR_APPROVAL

# VS Code Extension Version: 1.5.1
86 changes: 55 additions & 31 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
// - @typescript-eslint
//
//
// eslint-plugin-import
// - import
"plugins": [
"@typescript-eslint/eslint-plugin",
"@typescript-eslint",
"import",
"eslint-plugin-tsdoc",
"prettier"
Expand All @@ -41,42 +40,44 @@
// -
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
// sets up the plugin AND eslint-config-prettier
"plugin:prettier/recommended"
],

"parserOptions": {
"ecmaVersion": 2021,
"ecmaVersion": 2022,
"sourceType": "module",
"project": "./tsconfig.json",
"tsconfigRootDir": "./"
"tsconfigRootDir": "./",
"warnOnUnsupportedTypeScriptVersion": false
},
"ignorePatterns": ["packages/docs"],
"ignorePatterns": ["packages/docs", "dist", "**/*_test.js", "**/*_jest.js", "**/*babel*", "**/*.d.ts", "**/*_types.ts"],
"rules": {
"import/no-cycle": ["error", { "maxDepth": 15 }],
// Enforce consistent brace style for all control statements for readability
"curly": "error",
"tsdoc/syntax": "warn",
"tsdoc/syntax": "off",
"@typescript-eslint/ban-ts-comment": "off",
"import/no-cycle": "error",
"no-console": [
"warn",
{
"allow": ["warn", "error"]
}
],
// note you must disable the base rule
// as it can report incorrect errors
"no-console": "off",
"no-unused-vars": "off",
// Allow skipping unused variables in params calls by using _Name
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
"prefer": "type-imports",
"disallowTypeAnnotations": true
}
],
"@typescript-eslint/no-import-type-side-effects": "error",

"import/extensions": [
"error",
"ignorePackages",
Expand All @@ -88,37 +89,60 @@
}
],
"import/prefer-default-export": "off",
// eslint-plugin-prettier
"prettier/prettier": [
"error",
{
"endOfLine": "auto",
"printWidth": 80
}
],
"no-undef": "warn"
"no-undef": "warn",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off"
},

"overrides": [
{
"files": ["*.ts", "*.tsx"], // Apply the rules to TypeScript files
"rules": {
"import/no-cycle": ["error", { "maxDepth": 15 }]
}
},
{
"files": ["**/examples/**"],
"rules": {
"@typescript-eslint/no-explicit-any": "off" // Disable the rule for files in the examples directory
}
}
],
"env": {
"es6": true,
"browser": true,
"node": true
},

"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"typescript": {
"project": "./tsconfig.json"
}
}
},

"globals": {
"context": true,
"assert": true,
"SharedArrayBuffer": true
"jasmine": true,
"es6": true,
"browser": true,
"node": true,
"afterEach": true,
"beforeEach": true,
"done": true,
"describe": "readonly",
"beforeAll": "readonly",
"it": "readonly",
"jest": "readonly",
"expect": "readonly",
"assert": true
}
}
9 changes: 5 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
playwright-tests:
timeout-minutes: 60
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -18,12 +18,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies playwright
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: export NODE_OPTIONS="--max_old_space_size=8192" && npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
run:
export NODE_OPTIONS="--max_old_space_size=8192" && npx playwright test --shard=${{
matrix.shardIndex }}/${{ matrix.shardTotal }}

- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
Expand All @@ -36,7 +38,6 @@ jobs:
merge-reports:
if: ${{ !cancelled() }}
needs: [playwright-tests]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ package-lock.json

# Example output
.static-examples
.static-examples-playwright

# Docs output
packages/docs/dist/
Expand Down
3 changes: 1 addition & 2 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# .husky/pre-commit

yarn lint-staged
4 changes: 0 additions & 4 deletions .webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ module.exports = (env, argv, { DIST_DIR }) => {
resolve: {
modules: [path.resolve(PROJECT_ROOT, './node_modules'), SRC_PATH],
extensions: ['.ts', '.tsx', '.js', '.jsx'],
alias: {
'@cornerstonejs/dicom-image-loader':
'@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js',
},
fallback: {
fs: false,
path: require.resolve('path-browserify'),
Expand Down
Loading

0 comments on commit 692d9af

Please sign in to comment.