Skip to content

Commit 941b07a

Browse files
committed
ci: align CI npm with the local lock-file generator
Two CI breakages surfaced after the first PR run: 1. Lock-file mismatch. package-lock.json is generated locally by npm 11 (Node 24); the GitHub runner ships npm 10 with Node 22, which refuses to npm ci because cosmiconfig and ts-node are absent in shapes the older format expects. Bump npm on the runner before install in both ci.yml and publish.yaml, instead of regenerating the lock file in an older format and fighting drift on every developer install. 2. Lint failures in the new test files. Add an eslint override for src/__tests__/** that turns off a small set of rules that conflict with vitest patterns (vi.mock between imports, non-null assertions after expect-truthy, no-op stub methods), and run prettier over ConeRendering.test.tsx for the remaining formatting nits.
1 parent f6fff99 commit 941b07a

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

.eslintrc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,16 @@
3535
"import/export": 0,
3636
"n/no-callback-literal": 0,
3737
"@typescript-eslint/no-explicit-any": 0
38-
}
38+
},
39+
"overrides": [
40+
{
41+
"files": ["src/__tests__/**"],
42+
"rules": {
43+
"import/first": 0,
44+
"no-useless-return": 0,
45+
"@typescript-eslint/no-non-null-assertion": 0,
46+
"@typescript-eslint/no-non-null-asserted-optional-chain": 0
47+
}
48+
}
49+
]
3950
}

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
with:
2323
node-version: 22
2424
cache: 'npm'
25+
- name: Upgrade npm
26+
# The lock file is generated by npm >= 11 locally; bump the runner's
27+
# npm so its lock-file expectations match before running npm ci.
28+
run: npm install -g npm@latest
2529
- name: Install dependencies
2630
run: npm ci
2731
- name: Test

.github/workflows/publish.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
uses: actions/setup-node@v1
1919
with:
2020
node-version: 22
21+
- name: Upgrade npm
22+
run: npm install -g npm@latest
2123
- name: Install dependencies
2224
run: npm ci
2325
- name: Build

src/__tests__/ConeRendering.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
* latter proves the former already happened.
3131
*/
3232

33-
import { createRef } from 'react';
3433
import { cleanup, render } from '@testing-library/react';
34+
import { createRef } from 'react';
3535
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
3636

3737
// ---------------------------------------------------------------------------
@@ -119,8 +119,8 @@ import vtkConeSource from '@kitware/vtk.js/Filters/Sources/ConeSource';
119119
import Algorithm from '../core/Algorithm';
120120
import GeometryRepresentation from '../core/GeometryRepresentation';
121121
import View from '../core/View';
122-
import deletionRegistry from '../utils/DeletionRegistry';
123122
import { IRepresentation, IView } from '../types';
123+
import deletionRegistry from '../utils/DeletionRegistry';
124124

125125
// ---------------------------------------------------------------------------
126126
// Helpers
@@ -186,7 +186,10 @@ describe('Cone rendering pipeline', () => {
186186
const { repRef } = renderConeScene();
187187

188188
const mapper = repRef.current?.getMapper();
189-
expect(mapper, 'GeometryRepresentation should expose a mapper').toBeTruthy();
189+
expect(
190+
mapper,
191+
'GeometryRepresentation should expose a mapper'
192+
).toBeTruthy();
190193

191194
const polyData = mapper!.getInputData();
192195
expect(

0 commit comments

Comments
 (0)