Skip to content

Commit

Permalink
fix: update dependencies, normalize testing (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiledal authored Oct 1, 2024
1 parent 47bbc3c commit 69b6e3a
Show file tree
Hide file tree
Showing 16 changed files with 11,314 additions and 7,956 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
5 changes: 4 additions & 1 deletion .github/workflows/r3-rapier-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ jobs:
uses: actions/setup-node@v3.6.0
with:
node-version: 18.x

- name: Enable corepack
run: corepack enable

- name: Install Node Dependencies
run: yarn
run: yarn --immutable

- name: Run typedoc
run: yarn docs:build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 18

- name: Install Dependencies
run: yarn --frozen-lockfile
run: yarn --immutable

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ jobs:
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "npm"
node-version: 18

- name: Enable corepack
run: corepack enable

- name: Install deps
run: yarn --frozen-lockfile
run: yarn --immutable

- name: "Run tests"
run: npm run test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,6 @@ dist
# OSX
.DS_Store

packages/react-three-rapier/docs
packages/react-three-rapier/docs

.yarn
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"three": "0.146.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.3",
"typescript": "^4.6.3",
"@vitejs/plugin-react": "4.0.3",
"typescript": "4.6.3",
"vite": "3.0.3"
},
"repository": "https://github.com/pmndrs/react-three-rapier/tree/master/demo"
Expand Down
2 changes: 1 addition & 1 deletion demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const routes: Record<string, ReactNode> = {
spring: <SpringExample />,
"rope-joint": <RopeJointExample />,
"active-collision-types": <ActiveCollisionTypesExample />,
"contact-skin": <ContactSkinExample />,
"contact-skin": <ContactSkinExample />
};

export const App = () => {
Expand Down
29 changes: 16 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,25 @@
"arrowParens": "always"
},
"dependencies": {
"@babel/core": "^7.17.10",
"@babel/preset-env": "^7.17.10",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@manypkg/cli": "^0.19.1",
"@preconstruct/cli": "^2.1.5",
"@babel/core": "7.17.10",
"@babel/preset-env": "7.17.10",
"@babel/preset-react": "7.16.7",
"@babel/preset-typescript": "7.16.7",
"@changesets/cli": "2.27.1",
"@commitlint/cli": "17.1.2",
"@commitlint/config-conventional": "17.1.0",
"@manypkg/cli": "0.19.1",
"@preconstruct/cli": "2.1.5",
"@testing-library/react": "14.0.0",
"buffer": "^6.0.3",
"np": "^7.6.1",
"@vitejs/plugin-react": "4.0.3",
"@vitest/ui": "1.2.2",
"jsdom": "24.0.0",
"prettier": "2.7.1",
"simple-git-hooks": "^2.8.0",
"simple-git-hooks": "2.8.0",
"typedoc": "0.23.24",
"typescript": "^4.6.3"
"typescript": "4.6.3",
"vitest": "1.2.2",
"vitest-canvas-mock": "0.3.3"
},
"scripts": {
"ci": "preconstruct validate && manypkg check && yarn test",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-three-rapier-addons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"three": "*"
},
"dependencies": {
"three-stdlib": "2.23.9"
"three-stdlib": "^2.29.4"
},
"devDependencies": {
"@react-three/fiber": "8.9.1",
Expand Down
11 changes: 3 additions & 8 deletions packages/react-three-rapier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,15 @@
"files": [
"dist"
],
"scripts": {},
"devDependencies": {
"@react-three/drei": "9.74.14",
"@react-three/fiber": "8.9.1",
"@react-three/test-renderer": "8.1.5",
"@react-three/test-renderer": "8.2.1",
"@types/react-dom": "18.0.2",
"@types/three": "^0.152.1",
"@vitejs/plugin-react": "^4.0.3",
"@vitest/ui": "0.32.0",
"happy-dom": "9.19.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"three": "0.146.0",
"vitest": "0.32.0"
"three": "0.146.0"
},
"peerDependencies": {
"@react-three/fiber": ">=8.9.0",
Expand All @@ -31,7 +26,7 @@
"dependencies": {
"@dimforge/rapier3d-compat": "0.13.1",
"suspend-react": "^0.1.3",
"three-stdlib": "2.23.9"
"three-stdlib": "^2.29.4"
},
"repository": "https://github.com/pmndrs/react-three-rapier/tree/master/packages/react-three-rapier"
}
2 changes: 0 additions & 2 deletions packages/react-three-rapier/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
</p>

<p align="center">
⚠️ This library is under development. All APIs are subject to change. ⚠️
<br />
For contributions, please read the <a href="https://github.com/pmndrs/react-three-rapier/blob/main/packages/react-three-rapier/CONTRIBUTING.md">🪧 Contribution Guide</a>.
<br/>
For available APIs, see <a href="https://pmndrs.github.io/react-three-rapier/">🧩 API Docs</a>
Expand Down
7 changes: 4 additions & 3 deletions packages/react-three-rapier/tests/physics.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from "../src";
import React, { useEffect } from "react";
import ReactThreeTestRenderer from "@react-three/test-renderer";
import { Box } from "@react-three/drei";
import {
getScenePositions,
pause,
Expand All @@ -21,7 +20,6 @@ import {
UseRapierMounter
} from "./test-utils";
import { useFrame } from "@react-three/fiber";
import { renderHook } from "@testing-library/react";

describe("physics", () => {
describe("useRapier exposed things", () => {
Expand All @@ -40,7 +38,10 @@ describe("physics", () => {
ref={rigidBody}
linearVelocity={[20, 20, 20]}
>
<Box />
<mesh>
<boxGeometry />
<meshStandardMaterial />
</mesh>
</RigidBody>
</Physics>
);
Expand Down
3 changes: 3 additions & 0 deletions packages/react-three-rapier/tests/setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// vitest.setup.ts
import "vitest-canvas-mock";

// @ts-ignore
global.IS_REACT_ACT_ENVIRONMENT = true;

Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as path from "path";
export default defineConfig({
plugins: [react()],
test: {
environment: "happy-dom",
environment: "jsdom",
setupFiles: path.resolve(
process.cwd(),
"./packages/react-three-rapier/tests/setup.ts"
Expand Down
Loading

0 comments on commit 69b6e3a

Please sign in to comment.