Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 0 additions & 14 deletions .babelrc.json

This file was deleted.

78 changes: 0 additions & 78 deletions .eslintrc.js

This file was deleted.

18 changes: 18 additions & 0 deletions .github/actions/setup-node-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup Node Project
description: Setup Node and install dependencies with npm ci
inputs:
node-version:
description: Node.js version
required: false
default: '22'
runs:
using: composite
steps:
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
- name: Install dependencies
shell: bash
run: npm ci
59 changes: 42 additions & 17 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,65 @@ jobs:
build-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
node: [22]
name: ${{ matrix.os }} and node ${{ matrix.node }}
browser: [chromium, firefox]
name: ${{ matrix.os }} / node ${{ matrix.node }} / ${{ matrix.browser }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
- uses: actions/checkout@v6
- name: Setup project
uses: ./.github/actions/setup-node-project
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: |
npm ci
sudo apt-get install xvfb
node-version: '${{ matrix.node }}'
- name: Resolve Playwright version
id: playwright
run: echo "version=$(node -p "require('playwright/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ matrix.os }}-${{ matrix.browser }}-${{ steps.playwright.outputs.version }}
- name: Install Playwright browser
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install ${{ matrix.browser }}
- name: Install Playwright system deps
run: sudo npx playwright install-deps ${{ matrix.browser }}
- name: Build
run: npm run build:release
- name: Archive build output
if: github.event_name != 'merge_group'
uses: actions/upload-artifact@v4
if: github.event_name != 'merge_group' && matrix.browser == 'chromium'
uses: actions/upload-artifact@v7
with:
name: build-results-${{ matrix.runs_on }}-node_${{ matrix.node }}
name: build-results-${{ matrix.os }}-node_${{ matrix.node }}
path: dist
retention-days: 15
- name: Validate generated typescript definitions
run: |
npx tsc -p tsconfig.esm-check.json
npx tsc -p tsconfig.umd-check.json
- name: Chrome and Firefox tests
run: xvfb-run --auto-servernum npm run test -- --browsers ChromeSwiftShader,Firefox
- name: Smoke-test packed ESM tarball
if: matrix.browser == 'chromium'
run: |
tarball=$(npm pack ./dist/esm --silent)
mkdir -p /tmp/vtk-smoke
cd /tmp/vtk-smoke
npm init -y >/dev/null
npm install --no-audit --no-fund "$GITHUB_WORKSPACE/$tarball"
node -e "require('@kitware/vtk.js/Utilities/config/rules-vtk')"
node -e "require('@kitware/vtk.js/Utilities/config/chainWebpack')"
npx --no-install vtkDataConverter --help
- name: Tests
env:
TEST_BROWSER: ${{ matrix.browser }}
run: xvfb-run --auto-servernum npm test
- name: Archive test results
if: github.event_name != 'merge_group' && (success() || failure())
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: test-results-${{ matrix.runs_on }}-node_${{ matrix.node }}
path: Utilities/TestResults/Test-Report.html
name: test-results-${{ matrix.os }}-node_${{ matrix.node }}-${{ matrix.browser }}
path: Utilities/TestResults/
retention-days: 15
11 changes: 6 additions & 5 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ jobs:
runs-on: ubuntu-24.04
name: Check and lint PR
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
with:
fetch-depth: 0 # needed so commitlint can lint the commits
- name: Setup node
uses: actions/setup-node@v1
- name: Setup project
uses: ./.github/actions/setup-node-project
with:
node-version: 20
- run: npm ci
node-version: '22'
- name: Enforce code style
run: npm run validate
- name: Lint
run: npm run lint
- name: Lint commits
if: github.event_name != 'merge_group'
run: npx commitlint --from=${{ github.event.pull_request.base.sha }}
Expand Down
40 changes: 15 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ jobs:
name: npm
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
- name: Setup project
uses: ./.github/actions/setup-node-project
with:
node-version: 22
- name: Install dependencies
run: |
npm ci
sudo apt-get install xvfb
node-version: '22'
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium firefox
- name: Build
run: npm run build:release
- name: Validate code style
Expand All @@ -42,13 +40,13 @@ jobs:
npx tsc -p tsconfig.esm-check.json
npx tsc -p tsconfig.umd-check.json
- name: Chrome and Firefox tests
run: xvfb-run --auto-servernum npm run test -- --browsers ChromeSwiftShader,Firefox
run: xvfb-run --auto-servernum npm test
- name: Archive test results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: test-results
path: Utilities/TestResults/Test-Report.html
path: Utilities/TestResults/
retention-days: 15
- name: Release
env:
Expand All @@ -70,25 +68,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Setup node
uses: actions/setup-node@v1
- name: Setup project
uses: ./.github/actions/setup-node-project
with:
node-version: 22
- name: Install dependencies
run: npm ci
node-version: '22'
- name: Build
run: npm run build:release
- name: Generate API docs
run: npm run docs:generate-api
- name: Generate docs examples
run: npm run docs:generate-examples
- name: Generate docs sidebar
run: npm run docs:generate-sidebar
- name: Generate docs gallery
run: npm run docs:generate-gallery
- name: Generate docs content
run: npm run docs:generate
- name: Build docs
run: npm run docs:build
- name: Build docs examples
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-only-check.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd $(dirname $(readlink -e $0))/../../
! git grep 'test\.only(' **/test*.js
! git grep -E '\b(test|it|describe)\.only\(' -- '**/test*.js'
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ dist/
coverage/
.env
Utilities/TestResults
.vitest-attachments/
.idea
Documentation/.vitepress/cache/
Documentation/.vitepress/dist/
Documentation/build-tmp/
Documentation/content/
Documentation/Examples/
Documentation/api/*.md
!Documentation/api/index.md
Documentation/examples/*.md
!Documentation/examples/index.md
Documentation/examples/gallery.js
9 changes: 9 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "always",
"sortPackageJson": false,
"ignorePatterns": []
}
40 changes: 40 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["import"],
"env": {
"es2020": true,
"es6": true,
"browser": true
},
"globals": {
"__BASE_PATH__": "readonly",
"__VTK_TEST_NO_WEBGL__": "readonly",
"__VTK_TEST_WEBGPU__": "readonly",
"VRFrameData": "readonly"
},
"rules": {
"no-console": "off",
"no-param-reassign": [
"warn",
{
"props": false
}
],
"no-plusplus": "off",
"no-underscore-dangle": "off",
"no-unused-vars": [
"warn",
{
"args": "none"
}
],
"prefer-destructuring": "off"
},
"ignorePatterns": [
"**/example_/*.js",
"Utilities/**/*.js",
"vite.config.js",
"vitest.config.js",
".eslintrc.js"
]
}
6 changes: 6 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## From 35.x to 36

- **`vtk-lite.js` deprecated.** The UMD build previously produced a slimmed-down companion bundle `dist/umd/vtk-lite.js` (curated ColorMaps subset; `PDBReader`, `MoleculeToRepresentation`, `MobileVR`, and `webvr-polyfill` stubbed out). The Vite build pipeline no longer produces a distinct lite bundle; `vtk-lite.js` now ships as a byte-identical alias of `vtk.js` so existing `<script src=…/vtk-lite.js>` and CDN consumers continue to load. Consumers should migrate to `vtk.js` directly — the alias will be removed in a future major. Note that anything that indexed into the `ColorMaps` array by position will now see the full preset set, not the lite subset.
- **macros**: `getStateArrayMapFunc` has been removed. Inline the equivalent where needed, e.g. `arr.map((item) => (item && item.isA ? item.getState() : item))`.


## From 34.x to 35

- **vtkMapper**: mappers should overwrite `computeBounds()` instead of `getBounds` that now calls `computeBounds()` before returning a copy of the mapper bounds.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import llmstxt from 'vitepress-plugin-llms';
import { copyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms';

import { sidebar } from './sidebar';
import { BASE_URL, withBase } from './utils';
import { BASE_URL } from './utils';

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand All @@ -13,7 +13,7 @@ export default defineConfig({
description: 'VTK.js a Visualization Toolkit for the Web',
lastUpdated: true,
ignoreDeadLinks: true,
srcExclude: ['**/scripts/**',],
srcExclude: ['**/scripts/**'],
vite: {
plugins: [
llmstxt({
Expand Down
Loading
Loading