chore: add triplex config

pull/42/head
Michael Dougall 2024-03-05 21:46:21 +11:00
parent b0d0a9126c
commit 1b58a27e9d
No known key found for this signature in database
GPG Key ID: A39E8BB1F493D906
3 changed files with 52 additions and 0 deletions

15
.triplex/config.json Normal file
View File

@ -0,0 +1,15 @@
{
"$schema": "https://triplex.dev/config.schema.json",
"components": ["../src/components/**/*.(j|t)sx"],
"files": ["../src/components/**/*.(j|t)sx"],
"provider": "./provider.tsx",
"assetsDir": "models",
"rendererAttributes": {
"gl": {
"antialias": false,
"stencil": false,
"depth": false,
"powerPreference": "high-performance"
}
}
}

16
.triplex/provider.tsx Normal file
View File

@ -0,0 +1,16 @@
import React from "react";
import { Physics } from "@react-three/rapier";
export default function Provider({
children,
physicsDisabled = true,
}: {
children: React.ReactNode;
physicsDisabled?: boolean;
}) {
return (
<Physics gravity={[0, -90, 0]} timeStep="vary" paused={physicsDisabled}>
{children}
</Physics>
);
}

21
tsconfig.json Normal file
View File

@ -0,0 +1,21 @@
{
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "es2022"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"types": ["@react-three/fiber"]
},
"exclude": ["node_modules"],
"include": ["."]
}