From 9d693ad4dbecd449bd7de708a2742a6ae32d7762 Mon Sep 17 00:00:00 2001 From: Hernan Torrisi Date: Fri, 8 Aug 2025 13:34:03 -0700 Subject: [PATCH 01/11] bump rive canvas to 2.31.1 --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9956da5..0a6d559 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,10 @@ }, "homepage": "https://github.com/rive-app/rive-react#readme", "dependencies": { - "@rive-app/canvas": "2.31.0", - "@rive-app/canvas-lite": "2.31.0", - "@rive-app/webgl": "2.31.0", - "@rive-app/webgl2": "2.31.0" + "@rive-app/canvas": "2.31.1", + "@rive-app/canvas-lite": "2.31.1", + "@rive-app/webgl": "2.31.1", + "@rive-app/webgl2": "2.31.1" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0" From 5b248b43c1f12a95b8e44b5124851f8f4e578013 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 18:10:46 +0200 Subject: [PATCH 02/11] chore: try a force clean --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0c052e1..c2dcd2d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,6 +28,8 @@ jobs: with: node-version: '16.x' registry-url: 'https://registry.npmjs.org' + - name: Force NPM clean + run: npm cache clean --force - name: Install Modules run: npm install - name: Run type check From 21e4c0f462076aabaa34a3c65a0fb811f4d0c11d Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 18:13:32 +0200 Subject: [PATCH 03/11] chore: bumpy node --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c2dcd2d..3370c20 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,7 +26,7 @@ jobs: run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} - uses: actions/setup-node@v2 with: - node-version: '16.x' + node-version: '20.x' registry-url: 'https://registry.npmjs.org' - name: Force NPM clean run: npm cache clean --force From a7362c139fe9526b55d6d2b6665d293050358126 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 18:44:12 +0200 Subject: [PATCH 04/11] chore: add esnext.disposable --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 2c19277..b1a437b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "declaration": true, "esModuleInterop": true, "jsx": "react", - "lib": ["esnext", "dom"], + "lib": ["esnext", "dom", "esnext.disposable"], "module": "commonjs", "moduleResolution": "node", "noImplicitAny": true, From e27e722ae1d74f3bf40aba0a5d66ad4f848083eb Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 18:52:09 +0200 Subject: [PATCH 05/11] chore: pin node dev dependency to stop pulling 22 --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a6d559..bcca57f 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@testing-library/jest-dom": "^5.13.0", "@testing-library/react": "^16.3.0", "@types/jest": "^27.0.3", + "@types/node": "^18.19.122", "@types/offscreencanvas": "^2019.6.4", "@types/react": "^18.0.0", "@types/testing-library__jest-dom": "^5.9.5", @@ -72,7 +73,7 @@ "react-dom": "^18.0.0", "release-it": "^14.10.0", "ts-jest": "^27.1.1", - "typescript": "^4.5.4", + "typescript": "^5.6.0", "watch": "^1.0.2" } } From 170a8362cd7c5c9409851744ac232f09b7bb7352 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 18:56:13 +0200 Subject: [PATCH 06/11] chore: go back to typescript version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bcca57f..6e4bed0 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "react-dom": "^18.0.0", "release-it": "^14.10.0", "ts-jest": "^27.1.1", - "typescript": "^5.6.0", + "typescript": "^4.5.4", "watch": "^1.0.2" } } From 5b22a8c128d036de384f9c63e61fba62d7f1fcf8 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 19:14:32 +0200 Subject: [PATCH 07/11] chore: bump deps --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6e4bed0..a34d7d3 100644 --- a/package.json +++ b/package.json @@ -67,13 +67,13 @@ "eslint-plugin-react": "^7.27.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-storybook": "^0.5.12", - "jest": "^27.0.4", + "jest": "^29.7.0", "prettier": "^2.3.1", "react": "^18.0.0", "react-dom": "^18.0.0", "release-it": "^14.10.0", - "ts-jest": "^27.1.1", - "typescript": "^4.5.4", + "ts-jest": "^29.4.1", + "typescript": "^5.9.2", "watch": "^1.0.2" } } From be8790fc0a954480cc1e6f928aee9446379ce758 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 19:18:41 +0200 Subject: [PATCH 08/11] chore: bump deps --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a34d7d3..a8373d7 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@babel/core": "^7.18.0", "@testing-library/jest-dom": "^5.13.0", "@testing-library/react": "^16.3.0", - "@types/jest": "^27.0.3", + "@types/jest": "^29.5.14", "@types/node": "^18.19.122", "@types/offscreencanvas": "^2019.6.4", "@types/react": "^18.0.0", @@ -68,6 +68,7 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-storybook": "^0.5.12", "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "prettier": "^2.3.1", "react": "^18.0.0", "react-dom": "^18.0.0", From bb58106a5801811b4d956e04ca31f5b3a76086be Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 19:56:49 +0200 Subject: [PATCH 09/11] chore: new deps and fix test --- package.json | 31 +++++++++++++++---------------- test/useStateMachine.test.tsx | 13 ++----------- tsconfig.json | 2 +- 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index a8373d7..57450dc 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,10 @@ }, "homepage": "https://github.com/rive-app/rive-react#readme", "dependencies": { - "@rive-app/canvas": "2.31.1", - "@rive-app/canvas-lite": "2.31.1", - "@rive-app/webgl": "2.31.1", - "@rive-app/webgl2": "2.31.1" + "@rive-app/canvas": "2.31.0", + "@rive-app/canvas-lite": "2.31.0", + "@rive-app/webgl": "2.31.0", + "@rive-app/webgl2": "2.31.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0" @@ -47,34 +47,33 @@ "@babel/core": "^7.18.0", "@testing-library/jest-dom": "^5.13.0", "@testing-library/react": "^16.3.0", - "@types/jest": "^29.5.14", - "@types/node": "^18.19.122", + "@types/jest": "^27.0.3", "@types/offscreencanvas": "^2019.6.4", "@types/react": "^18.0.0", "@types/testing-library__jest-dom": "^5.9.5", - "@typescript-eslint/eslint-plugin": "^5.7.0", - "@typescript-eslint/parser": "^5.7.0", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", "auto-changelog": "^2.3.0", "babel-loader": "^8.2.5", "bunchee": "1.8.5", - "eslint": "^7.28.0", + "eslint": "^8.57.1", "eslint-config-prettier": "^8.3.0", - "eslint-config-standard": "^16.0.3", + "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.0", - "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-promise": "^6.6.0", "eslint-plugin-react": "^7.27.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-storybook": "^0.5.12", - "jest": "^29.7.0", - "jest-environment-jsdom": "^29.7.0", + "jest": "^27.0.4", + "jest-mock": "^30.0.5", "prettier": "^2.3.1", "react": "^18.0.0", "react-dom": "^18.0.0", "release-it": "^14.10.0", - "ts-jest": "^29.4.1", - "typescript": "^5.9.2", + "ts-jest": "^27.1.1", + "typescript": "^4.5.4", "watch": "^1.0.2" } -} +} \ No newline at end of file diff --git a/test/useStateMachine.test.tsx b/test/useStateMachine.test.tsx index 74c9398..37fd7bd 100644 --- a/test/useStateMachine.test.tsx +++ b/test/useStateMachine.test.tsx @@ -1,4 +1,3 @@ -import { mocked } from 'jest-mock'; import { renderHook } from '@testing-library/react'; import useStateMachineInput from '../src/hooks/useStateMachineInput'; @@ -35,6 +34,7 @@ function getRiveMock({ const riveMock = new Rive({ canvas: undefined as unknown as HTMLCanvasElement, }); + if (smiInputs) { riveMock.stateMachineInputs = jest.fn().mockReturnValue(smiInputs); } @@ -51,8 +51,6 @@ describe('useStateMachineInput', () => { it('returns null if there is no state machine name', () => { const riveMock = getRiveMock(); - mocked(Rive).mockImplementation(() => riveMock); - const { result } = renderHook(() => useStateMachineInput(riveMock, '', 'testInput') ); @@ -71,10 +69,8 @@ describe('useStateMachineInput', () => { it('returns null if there are no inputs for the state machine', () => { const riveMock = getRiveMock({ smiInputs: [] }); - mocked(Rive).mockImplementation(() => riveMock); - const { result } = renderHook(() => - useStateMachineInput(riveMock as Rive, 'smName', '') + useStateMachineInput(riveMock, 'smName', '') ); expect(result.current).toBeNull(); }); @@ -85,8 +81,6 @@ describe('useStateMachineInput', () => { } as StateMachineInput; const riveMock = getRiveMock({ smiInputs: [smInput] }); - mocked(Rive).mockImplementation(() => riveMock); - const { result } = renderHook(() => useStateMachineInput(riveMock, 'smName', 'numInput') ); @@ -99,8 +93,6 @@ describe('useStateMachineInput', () => { } as StateMachineInput; const riveMock = getRiveMock({ smiInputs: [smInput] }); - mocked(Rive).mockImplementation(() => riveMock); - const { result } = renderHook(() => useStateMachineInput(riveMock, 'smName', 'boolInput') ); @@ -113,7 +105,6 @@ describe('useStateMachineInput', () => { value: false, } as StateMachineInput; const riveMock = getRiveMock({ smiInputs: [smInput] }); - mocked(Rive).mockImplementation(() => riveMock); const { result } = renderHook(() => useStateMachineInput(riveMock, 'smName', 'boolInput', true) diff --git a/tsconfig.json b/tsconfig.json index b1a437b..2c19277 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "declaration": true, "esModuleInterop": true, "jsx": "react", - "lib": ["esnext", "dom", "esnext.disposable"], + "lib": ["esnext", "dom"], "module": "commonjs", "moduleResolution": "node", "noImplicitAny": true, From 8cc1f2ba693d1da8ffdc5c5e75aa35dd7683b02d Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 19:59:52 +0200 Subject: [PATCH 10/11] ci: bump node again --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3370c20..1423d59 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,7 +26,7 @@ jobs: run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} - uses: actions/setup-node@v2 with: - node-version: '20.x' + node-version: '22.x' registry-url: 'https://registry.npmjs.org' - name: Force NPM clean run: npm cache clean --force From 40f57f4effe77caaff965cddaec0a1cfb48a4141 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 11 Aug 2025 20:06:10 +0200 Subject: [PATCH 11/11] chore: add node types --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 57450dc..744a88e 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@testing-library/jest-dom": "^5.13.0", "@testing-library/react": "^16.3.0", "@types/jest": "^27.0.3", + "@types/node": "^18.17.0", "@types/offscreencanvas": "^2019.6.4", "@types/react": "^18.0.0", "@types/testing-library__jest-dom": "^5.9.5", @@ -76,4 +77,4 @@ "typescript": "^4.5.4", "watch": "^1.0.2" } -} \ No newline at end of file +}