From cec5cdcff4305471ef350ea8245837091dc54d57 Mon Sep 17 00:00:00 2001 From: Antoine BERNIER Date: Sat, 16 Nov 2024 00:15:47 +0100 Subject: [PATCH] doc --- README.md | 40 +++++++++++++++++++++++++++ docs/getting-started/introduction.mdx | 24 ++-------------- 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 6af2e40fa..2841f2e6a 100644 --- a/README.md +++ b/README.md @@ -796,3 +796,43 @@ https://pmndrs.github.io/drei [Documentation has moved here](https://pmndrs.github.io/drei/staging/shadow-alpha) + +## Dev + +### INSTALL + +```sh +$ corepack enable +$ yarn install +``` + +### Test + +#### Local + +Pre-requisites: + +- ```sh + $ npx playwright install + ``` + +To run visual tests locally: + +```sh +$ yarn build +$ yarn test +``` + +#### Docker + +Or in the same environment as the CI: + +```sh +$ yarn build +$ docker run --init --rm -v $(pwd):/app -w /app ghcr.io/pmndrs/playwright:drei sh -c "corepack enable && yarn install && yarn test" +``` + +> [!TIP] +> If running on mac m-series, you may need to add `--platform linux/arm64` to the docker command. + +To update a snapshot, simply remove it and relaunch the test command. diff --git a/docs/getting-started/introduction.mdx b/docs/getting-started/introduction.mdx index 224188abb..e173eeaad 100644 --- a/docs/getting-started/introduction.mdx +++ b/docs/getting-started/introduction.mdx @@ -5,7 +5,8 @@ nav: -1 --- - A growing collection of useful helpers and fully functional, ready-made abstractions for [@react-three/fiber](https://github.com/pmndrs/react-three-fiber). + A growing collection of useful helpers and fully functional, ready-made abstractions for + [@react-three/fiber](https://github.com/pmndrs/react-three-fiber). [![logo](../logo.jpg)](https://codesandbox.io/s/bfplr) @@ -37,24 +38,3 @@ import { PerspectiveCamera, PositionalAudio, ... } from '@react-three/drei/nativ ``` The `native` route of the library **does not** export `Html` or `Loader`. The default export of the library is `web` which **does** export `Html` and `Loader`. - -## INSTALL - -```sh -& corepack enable -$ yarn install -``` - -## Tests - -To run visual tests in the same environment as the CI: - -```sh -$ yarn build -$ docker run --init --rm -v $(pwd):/app -w /app ghcr.io/pmndrs/playwright:main yarn test -``` - -> [!TIP] -> If running on mac m-series, you may need to add `--platform linux/arm64` to the docker command. - -To update a snapshot, simply remove it and relaunch the test command.