From f612108e186f24e5b1071d1dcf2c2527a011fa53 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Sun, 6 Aug 2023 17:18:35 +0200 Subject: [PATCH] Update compat tests to use THREE.r155 --- .../package/.gitignore | 0 .../package/index.html | 0 .../package/package.json | 6 +- .../basic-react17/package/src/App/Scene.tsx | 135 ++++++++++++++++ .../basic-react17/package/src/App/useDrag.ts | 150 ++++++++++++++++++ .../basic-react17/package/src/index.tsx | 12 ++ .../package/tsconfig.json | 0 .../react17.compat-test.ts | 1 + .../{cra => r3f-cra}/cra.compat-test.ts | 0 .../{cra => r3f-cra}/package/.gitignore | 0 .../{cra => r3f-cra}/package/README.md | 0 .../{cra => r3f-cra}/package/package.json | 6 +- .../package/public/index.html | 0 .../{cra => r3f-cra}/package/src/App/App.tsx | 2 +- .../package/src/App/state.json | 0 .../{cra => r3f-cra}/package/src/index.tsx | 0 .../next-latest.compat-test.ts | 0 .../package/.gitignore | 0 .../package/README.md | 0 .../package/next-env.d.ts | 0 .../package/package.json | 6 +- .../package/pages/index.js | 0 .../package/public/favicon.ico | Bin .../package/src/App/App.tsx | 2 +- .../package/src/App/state.json | 0 .../package/tsconfig.json | 0 .../package/.gitignore | 0 .../package/index.html | 0 .../package/package.json | 6 +- .../package/src/App/App.tsx | 2 +- .../package/src/App/state.json | 0 .../package/src/index.tsx | 0 .../package/tsconfig.json | 0 .../parcel1.compat-test.ts | 0 .../package/.gitignore | 0 .../package/index.html | 0 .../package/package.json | 6 +- .../package/src/App/App.tsx | 2 +- .../package/src/App/state.json | 0 .../package/src/index.js | 0 .../package/tsconfig.json | 0 .../react18.compat-test.ts | 0 .../{vite2 => r3f-vite2}/package/.gitignore | 0 .../{vite2 => r3f-vite2}/package/index.html | 0 .../{vite2 => r3f-vite2}/package/package.json | 8 +- .../r3f-vite2/package/src/App/App.tsx | 102 ++++++++++++ .../package/src/App/state.json | 0 .../{vite2 => r3f-vite2}/package/src/main.tsx | 0 .../package/src/vite-env.d.ts | 0 .../package/tsconfig.json | 0 .../package/tsconfig.node.json | 0 .../package/vite.config.ts | 0 .../{vite2 => r3f-vite2}/vite2.compat-test.ts | 0 .../{vite4 => r3f-vite4}/package/.gitignore | 0 .../{vite4 => r3f-vite4}/package/index.html | 0 .../{vite4 => r3f-vite4}/package/package.json | 6 +- .../r3f-vite4/package/src/App/App.tsx | 102 ++++++++++++ .../package/src/App/state.json | 0 .../{vite4 => r3f-vite4}/package/src/main.tsx | 0 .../package/src/vite-env.d.ts | 0 .../package/tsconfig.json | 0 .../package/tsconfig.node.json | 0 .../package/vite.config.ts | 0 .../{vite4 => r3f-vite4}/vite4.compat-test.ts | 0 .../fixtures/react17/package/src/index.tsx | 19 --- .../fixtures/react18/package/src/App/App.tsx | 102 ------------ .../fixtures/vite2/package/src/App/App.tsx | 102 ------------ .../fixtures/vite4/package/src/App/App.tsx | 102 ------------ .../fixtures/vite4/package/src/App/state.json | 19 --- compat-tests/integrity.compat-test.ts | 10 +- 70 files changed, 534 insertions(+), 374 deletions(-) rename compat-tests/fixtures/{parcel1 => basic-react17}/package/.gitignore (100%) rename compat-tests/fixtures/{parcel1 => basic-react17}/package/index.html (100%) rename compat-tests/fixtures/{react17 => basic-react17}/package/package.json (73%) create mode 100644 compat-tests/fixtures/basic-react17/package/src/App/Scene.tsx create mode 100644 compat-tests/fixtures/basic-react17/package/src/App/useDrag.ts create mode 100644 compat-tests/fixtures/basic-react17/package/src/index.tsx rename compat-tests/fixtures/{parcel1 => basic-react17}/package/tsconfig.json (100%) rename compat-tests/fixtures/{react17 => basic-react17}/react17.compat-test.ts (98%) rename compat-tests/fixtures/{cra => r3f-cra}/cra.compat-test.ts (100%) rename compat-tests/fixtures/{cra => r3f-cra}/package/.gitignore (100%) rename compat-tests/fixtures/{cra => r3f-cra}/package/README.md (100%) rename compat-tests/fixtures/{cra => r3f-cra}/package/package.json (91%) rename compat-tests/fixtures/{cra => r3f-cra}/package/public/index.html (100%) rename compat-tests/fixtures/{cra => r3f-cra}/package/src/App/App.tsx (99%) rename compat-tests/fixtures/{cra => r3f-cra}/package/src/App/state.json (100%) rename compat-tests/fixtures/{cra => r3f-cra}/package/src/index.tsx (100%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/next-latest.compat-test.ts (100%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/.gitignore (100%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/README.md (100%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/next-env.d.ts (100%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/package.json (78%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/pages/index.js (100%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/public/favicon.ico (100%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/src/App/App.tsx (99%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/src/App/state.json (100%) rename compat-tests/fixtures/{next-latest => r3f-next-latest}/package/tsconfig.json (100%) rename compat-tests/fixtures/{react17 => r3f-parcel1}/package/.gitignore (100%) rename compat-tests/fixtures/{react17 => r3f-parcel1}/package/index.html (100%) rename compat-tests/fixtures/{parcel1 => r3f-parcel1}/package/package.json (80%) rename compat-tests/fixtures/{parcel1 => r3f-parcel1}/package/src/App/App.tsx (99%) rename compat-tests/fixtures/{parcel1 => r3f-parcel1}/package/src/App/state.json (100%) rename compat-tests/fixtures/{parcel1 => r3f-parcel1}/package/src/index.tsx (100%) rename compat-tests/fixtures/{react17 => r3f-parcel1}/package/tsconfig.json (100%) rename compat-tests/fixtures/{parcel1 => r3f-parcel1}/parcel1.compat-test.ts (100%) rename compat-tests/fixtures/{react18 => r3f-react18}/package/.gitignore (100%) rename compat-tests/fixtures/{react18 => r3f-react18}/package/index.html (100%) rename compat-tests/fixtures/{react18 => r3f-react18}/package/package.json (79%) rename compat-tests/fixtures/{react17 => r3f-react18}/package/src/App/App.tsx (99%) rename compat-tests/fixtures/{react17 => r3f-react18}/package/src/App/state.json (100%) rename compat-tests/fixtures/{react18 => r3f-react18}/package/src/index.js (100%) rename compat-tests/fixtures/{react18 => r3f-react18}/package/tsconfig.json (100%) rename compat-tests/fixtures/{react18 => r3f-react18}/react18.compat-test.ts (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/package/.gitignore (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/package/index.html (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/package/package.json (79%) create mode 100644 compat-tests/fixtures/r3f-vite2/package/src/App/App.tsx rename compat-tests/fixtures/{react18 => r3f-vite2}/package/src/App/state.json (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/package/src/main.tsx (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/package/src/vite-env.d.ts (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/package/tsconfig.json (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/package/tsconfig.node.json (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/package/vite.config.ts (100%) rename compat-tests/fixtures/{vite2 => r3f-vite2}/vite2.compat-test.ts (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/package/.gitignore (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/package/index.html (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/package/package.json (84%) create mode 100644 compat-tests/fixtures/r3f-vite4/package/src/App/App.tsx rename compat-tests/fixtures/{vite2 => r3f-vite4}/package/src/App/state.json (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/package/src/main.tsx (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/package/src/vite-env.d.ts (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/package/tsconfig.json (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/package/tsconfig.node.json (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/package/vite.config.ts (100%) rename compat-tests/fixtures/{vite4 => r3f-vite4}/vite4.compat-test.ts (100%) delete mode 100644 compat-tests/fixtures/react17/package/src/index.tsx delete mode 100644 compat-tests/fixtures/react18/package/src/App/App.tsx delete mode 100644 compat-tests/fixtures/vite2/package/src/App/App.tsx delete mode 100644 compat-tests/fixtures/vite4/package/src/App/App.tsx delete mode 100644 compat-tests/fixtures/vite4/package/src/App/state.json diff --git a/compat-tests/fixtures/parcel1/package/.gitignore b/compat-tests/fixtures/basic-react17/package/.gitignore similarity index 100% rename from compat-tests/fixtures/parcel1/package/.gitignore rename to compat-tests/fixtures/basic-react17/package/.gitignore diff --git a/compat-tests/fixtures/parcel1/package/index.html b/compat-tests/fixtures/basic-react17/package/index.html similarity index 100% rename from compat-tests/fixtures/parcel1/package/index.html rename to compat-tests/fixtures/basic-react17/package/index.html diff --git a/compat-tests/fixtures/react17/package/package.json b/compat-tests/fixtures/basic-react17/package/package.json similarity index 73% rename from compat-tests/fixtures/react17/package/package.json rename to compat-tests/fixtures/basic-react17/package/package.json index 2117ca7..a1f6df9 100644 --- a/compat-tests/fixtures/react17/package/package.json +++ b/compat-tests/fixtures/basic-react17/package/package.json @@ -5,15 +5,13 @@ "start": "serve dist" }, "dependencies": { - "@react-three/drei": "^7.3.1", - "@react-three/fiber": "^7.0.6", "@theatre/core": "0.0.1-COMPAT.1", - "@theatre/r3f": "0.0.1-COMPAT.1", "@theatre/studio": "0.0.1-COMPAT.1", "parcel-bundler": "^1.12.5", "react": "^17.0.2", "react-dom": "^17.0.2", - "three": "^0.137.0", + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.0", "serve": "14.2.0" } } diff --git a/compat-tests/fixtures/basic-react17/package/src/App/Scene.tsx b/compat-tests/fixtures/basic-react17/package/src/App/Scene.tsx new file mode 100644 index 0000000..a9c503f --- /dev/null +++ b/compat-tests/fixtures/basic-react17/package/src/App/Scene.tsx @@ -0,0 +1,135 @@ +import type {IScrub} from '@theatre/studio' +import studio from '@theatre/studio' +import React, {useLayoutEffect, useMemo, useState} from 'react' +import type {ISheet, ISheetObject, IProject} from '@theatre/core' +import type {UseDragOpts} from './useDrag' +import useDrag from './useDrag' + +studio.initialize() + +const boxObjectConfig = { + x: 0, + y: 0, +} + +const Box: React.FC<{ + id: string + sheet: ISheet + selectedObject: ISheetObject | undefined +}> = ({id, sheet, selectedObject}) => { + // This is cheap to call and always returns the same value, so no need for useMemo() + const obj = sheet.object(id, boxObjectConfig) + + const isSelected = selectedObject === obj + + const [pos, setPos] = useState<{x: number; y: number}>({x: 0, y: 0}) + + useLayoutEffect(() => { + const unsubscribeFromChanges = obj.onValuesChange((newValues) => { + setPos(newValues) + }) + return unsubscribeFromChanges + }, [id]) + + const [divRef, setDivRef] = useState(null) + + const dragOpts = useMemo((): UseDragOpts => { + let scrub: IScrub | undefined + let initial: typeof obj.value + let firstOnDragCalled = false + return { + onDragStart() { + scrub = studio.scrub() + initial = obj.value + firstOnDragCalled = false + }, + onDrag(x, y) { + if (!firstOnDragCalled) { + studio.setSelection([obj]) + firstOnDragCalled = true + } + scrub!.capture(({set}) => { + set(obj.props, {x: x + initial.x, y: y + initial.y}) + }) + }, + onDragEnd(dragHappened) { + if (dragHappened) { + scrub!.commit() + } else { + scrub!.discard() + } + }, + lockCursorTo: 'move', + } + }, []) + + useDrag(divRef, dragOpts) + + return ( +
{ + studio.setSelection([obj]) + }} + ref={setDivRef} + style={{ + width: 100, + height: 100, + background: 'gray', + position: 'absolute', + left: pos.x + 'px', + top: pos.y + 'px', + boxSizing: 'border-box', + border: isSelected ? '1px solid #5a92fa' : '1px solid transparent', + }} + >
+ ) +} + +let lastBoxId = 1 + +export const Scene: React.FC<{project: IProject}> = ({project}) => { + const [boxes, setBoxes] = useState>(['0', '1']) + + // This is cheap to call and always returns the same value, so no need for useMemo() + const sheet = project.sheet('Scene', 'default') + const [selection, _setSelection] = useState>([]) + + useLayoutEffect(() => { + return studio.onSelectionChange((newSelection) => { + _setSelection( + newSelection.filter( + (s): s is ISheetObject => s.type === 'Theatre_SheetObject_PublicAPI', + ), + ) + }) + }) + + return ( +
+ + {boxes.map((id) => ( + + ))} +
+ ) +} diff --git a/compat-tests/fixtures/basic-react17/package/src/App/useDrag.ts b/compat-tests/fixtures/basic-react17/package/src/App/useDrag.ts new file mode 100644 index 0000000..7f21101 --- /dev/null +++ b/compat-tests/fixtures/basic-react17/package/src/App/useDrag.ts @@ -0,0 +1,150 @@ +import {useLayoutEffect, useRef} from 'react' + +const noop = () => {} + +function createCursorLock(cursor: string) { + const el = document.createElement('div') + el.style.cssText = ` + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 9999999;` + + el.style.cursor = cursor + document.body.appendChild(el) + const relinquish = () => { + document.body.removeChild(el) + } + + return relinquish +} + +export type UseDragOpts = { + disabled?: boolean + dontBlockMouseDown?: boolean + lockCursorTo?: string + onDragStart?: (event: MouseEvent) => void | false + onDragEnd?: (dragHappened: boolean) => void + onDrag: (dx: number, dy: number, event: MouseEvent) => void +} + +export default function useDrag( + target: HTMLElement | undefined | null, + opts: UseDragOpts, +) { + const optsRef = useRef(opts) + optsRef.current = opts + + const modeRef = useRef<'dragStartCalled' | 'dragging' | 'notDragging'>( + 'notDragging', + ) + + const stateRef = useRef<{ + dragHappened: boolean + startPos: { + x: number + y: number + } + }>({dragHappened: false, startPos: {x: 0, y: 0}}) + + useLayoutEffect(() => { + if (!target) return + + const getDistances = (event: MouseEvent): [number, number] => { + const {startPos} = stateRef.current + return [event.screenX - startPos.x, event.screenY - startPos.y] + } + + let relinquishCursorLock = noop + + const dragHandler = (event: MouseEvent) => { + if (!stateRef.current.dragHappened && optsRef.current.lockCursorTo) { + relinquishCursorLock = createCursorLock(optsRef.current.lockCursorTo) + } + if (!stateRef.current.dragHappened) stateRef.current.dragHappened = true + modeRef.current = 'dragging' + + const deltas = getDistances(event) + optsRef.current.onDrag(deltas[0], deltas[1], event) + } + + const dragEndHandler = () => { + removeDragListeners() + modeRef.current = 'notDragging' + + optsRef.current.onDragEnd && + optsRef.current.onDragEnd(stateRef.current.dragHappened) + relinquishCursorLock() + relinquishCursorLock = noop + } + + const addDragListeners = () => { + document.addEventListener('mousemove', dragHandler) + document.addEventListener('mouseup', dragEndHandler) + } + + const removeDragListeners = () => { + document.removeEventListener('mousemove', dragHandler) + document.removeEventListener('mouseup', dragEndHandler) + } + + const preventUnwantedClick = (event: MouseEvent) => { + if (optsRef.current.disabled) return + if (stateRef.current.dragHappened) { + if ( + !optsRef.current.dontBlockMouseDown && + modeRef.current !== 'notDragging' + ) { + event.stopPropagation() + event.preventDefault() + } + stateRef.current.dragHappened = false + } + } + + const dragStartHandler = (event: MouseEvent) => { + const opts = optsRef.current + if (opts.disabled === true) return + + if (event.button !== 0) return + const resultOfStart = opts.onDragStart && opts.onDragStart(event) + + if (resultOfStart === false) return + + if (!opts.dontBlockMouseDown) { + event.stopPropagation() + event.preventDefault() + } + + modeRef.current = 'dragStartCalled' + + const {screenX, screenY} = event + stateRef.current.startPos = {x: screenX, y: screenY} + stateRef.current.dragHappened = false + + addDragListeners() + } + + const onMouseDown = (e: MouseEvent) => { + dragStartHandler(e) + } + + target.addEventListener('mousedown', onMouseDown) + target.addEventListener('click', preventUnwantedClick) + + return () => { + removeDragListeners() + target.removeEventListener('mousedown', onMouseDown) + target.removeEventListener('click', preventUnwantedClick) + relinquishCursorLock() + + if (modeRef.current !== 'notDragging') { + optsRef.current.onDragEnd && + optsRef.current.onDragEnd(modeRef.current === 'dragging') + } + modeRef.current = 'notDragging' + } + }, [target]) +} diff --git a/compat-tests/fixtures/basic-react17/package/src/index.tsx b/compat-tests/fixtures/basic-react17/package/src/index.tsx new file mode 100644 index 0000000..993ead8 --- /dev/null +++ b/compat-tests/fixtures/basic-react17/package/src/index.tsx @@ -0,0 +1,12 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import studio from '@theatre/studio' +import {getProject} from '@theatre/core' +import {Scene} from './App/Scene' + +studio.initialize() + +ReactDOM.render( + , + document.getElementById('root')!, +) diff --git a/compat-tests/fixtures/parcel1/package/tsconfig.json b/compat-tests/fixtures/basic-react17/package/tsconfig.json similarity index 100% rename from compat-tests/fixtures/parcel1/package/tsconfig.json rename to compat-tests/fixtures/basic-react17/package/tsconfig.json diff --git a/compat-tests/fixtures/react17/react17.compat-test.ts b/compat-tests/fixtures/basic-react17/react17.compat-test.ts similarity index 98% rename from compat-tests/fixtures/react17/react17.compat-test.ts rename to compat-tests/fixtures/basic-react17/react17.compat-test.ts index 7821be1..9c2d7d5 100644 --- a/compat-tests/fixtures/react17/react17.compat-test.ts +++ b/compat-tests/fixtures/basic-react17/react17.compat-test.ts @@ -14,6 +14,7 @@ describe(`react17`, () => { // this one is failing for some reason, but manually running the server works fine describe(`build`, () => { + return function startServerOnPort(port: number): ProcessPromise { cd(PATH_TO_PACKAGE) diff --git a/compat-tests/fixtures/cra/cra.compat-test.ts b/compat-tests/fixtures/r3f-cra/cra.compat-test.ts similarity index 100% rename from compat-tests/fixtures/cra/cra.compat-test.ts rename to compat-tests/fixtures/r3f-cra/cra.compat-test.ts diff --git a/compat-tests/fixtures/cra/package/.gitignore b/compat-tests/fixtures/r3f-cra/package/.gitignore similarity index 100% rename from compat-tests/fixtures/cra/package/.gitignore rename to compat-tests/fixtures/r3f-cra/package/.gitignore diff --git a/compat-tests/fixtures/cra/package/README.md b/compat-tests/fixtures/r3f-cra/package/README.md similarity index 100% rename from compat-tests/fixtures/cra/package/README.md rename to compat-tests/fixtures/r3f-cra/package/README.md diff --git a/compat-tests/fixtures/cra/package/package.json b/compat-tests/fixtures/r3f-cra/package/package.json similarity index 91% rename from compat-tests/fixtures/cra/package/package.json rename to compat-tests/fixtures/r3f-cra/package/package.json index f59d7ae..f3d5664 100644 --- a/compat-tests/fixtures/cra/package/package.json +++ b/compat-tests/fixtures/r3f-cra/package/package.json @@ -10,9 +10,9 @@ "serve": "serve -s build" }, "dependencies": { - "@react-three/drei": "^9.11.3", - "@react-three/fiber": "^8.0.19", - "three": "^0.141.0", + "@react-three/drei": "^9.80.1", + "@react-three/fiber": "^8.13.6", + "three": "^0.155.0", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", diff --git a/compat-tests/fixtures/cra/package/public/index.html b/compat-tests/fixtures/r3f-cra/package/public/index.html similarity index 100% rename from compat-tests/fixtures/cra/package/public/index.html rename to compat-tests/fixtures/r3f-cra/package/public/index.html diff --git a/compat-tests/fixtures/cra/package/src/App/App.tsx b/compat-tests/fixtures/r3f-cra/package/src/App/App.tsx similarity index 99% rename from compat-tests/fixtures/cra/package/src/App/App.tsx rename to compat-tests/fixtures/r3f-cra/package/src/App/App.tsx index 17797a7..dfef2f9 100644 --- a/compat-tests/fixtures/cra/package/src/App/App.tsx +++ b/compat-tests/fixtures/r3f-cra/package/src/App/App.tsx @@ -9,7 +9,7 @@ import state from './state.json' function Plane({color, theatreKey, ...props}: any) { return ( - + ) diff --git a/compat-tests/fixtures/cra/package/src/App/state.json b/compat-tests/fixtures/r3f-cra/package/src/App/state.json similarity index 100% rename from compat-tests/fixtures/cra/package/src/App/state.json rename to compat-tests/fixtures/r3f-cra/package/src/App/state.json diff --git a/compat-tests/fixtures/cra/package/src/index.tsx b/compat-tests/fixtures/r3f-cra/package/src/index.tsx similarity index 100% rename from compat-tests/fixtures/cra/package/src/index.tsx rename to compat-tests/fixtures/r3f-cra/package/src/index.tsx diff --git a/compat-tests/fixtures/next-latest/next-latest.compat-test.ts b/compat-tests/fixtures/r3f-next-latest/next-latest.compat-test.ts similarity index 100% rename from compat-tests/fixtures/next-latest/next-latest.compat-test.ts rename to compat-tests/fixtures/r3f-next-latest/next-latest.compat-test.ts diff --git a/compat-tests/fixtures/next-latest/package/.gitignore b/compat-tests/fixtures/r3f-next-latest/package/.gitignore similarity index 100% rename from compat-tests/fixtures/next-latest/package/.gitignore rename to compat-tests/fixtures/r3f-next-latest/package/.gitignore diff --git a/compat-tests/fixtures/next-latest/package/README.md b/compat-tests/fixtures/r3f-next-latest/package/README.md similarity index 100% rename from compat-tests/fixtures/next-latest/package/README.md rename to compat-tests/fixtures/r3f-next-latest/package/README.md diff --git a/compat-tests/fixtures/next-latest/package/next-env.d.ts b/compat-tests/fixtures/r3f-next-latest/package/next-env.d.ts similarity index 100% rename from compat-tests/fixtures/next-latest/package/next-env.d.ts rename to compat-tests/fixtures/r3f-next-latest/package/next-env.d.ts diff --git a/compat-tests/fixtures/next-latest/package/package.json b/compat-tests/fixtures/r3f-next-latest/package/package.json similarity index 78% rename from compat-tests/fixtures/next-latest/package/package.json rename to compat-tests/fixtures/r3f-next-latest/package/package.json index ddd6676..e7a7220 100644 --- a/compat-tests/fixtures/next-latest/package/package.json +++ b/compat-tests/fixtures/r3f-next-latest/package/package.json @@ -6,9 +6,9 @@ "start": "next start" }, "dependencies": { - "@react-three/drei": "^9.11.3", - "@react-three/fiber": "^8.0.19", - "three": "^0.141.0", + "@react-three/drei": "^9.80.1", + "@react-three/fiber": "^8.13.6", + "three": "^0.155.0", "@theatre/core": "0.0.1-COMPAT.1", "@theatre/r3f": "0.0.1-COMPAT.1", "@theatre/studio": "0.0.1-COMPAT.1", diff --git a/compat-tests/fixtures/next-latest/package/pages/index.js b/compat-tests/fixtures/r3f-next-latest/package/pages/index.js similarity index 100% rename from compat-tests/fixtures/next-latest/package/pages/index.js rename to compat-tests/fixtures/r3f-next-latest/package/pages/index.js diff --git a/compat-tests/fixtures/next-latest/package/public/favicon.ico b/compat-tests/fixtures/r3f-next-latest/package/public/favicon.ico similarity index 100% rename from compat-tests/fixtures/next-latest/package/public/favicon.ico rename to compat-tests/fixtures/r3f-next-latest/package/public/favicon.ico diff --git a/compat-tests/fixtures/next-latest/package/src/App/App.tsx b/compat-tests/fixtures/r3f-next-latest/package/src/App/App.tsx similarity index 99% rename from compat-tests/fixtures/next-latest/package/src/App/App.tsx rename to compat-tests/fixtures/r3f-next-latest/package/src/App/App.tsx index 17797a7..dfef2f9 100644 --- a/compat-tests/fixtures/next-latest/package/src/App/App.tsx +++ b/compat-tests/fixtures/r3f-next-latest/package/src/App/App.tsx @@ -9,7 +9,7 @@ import state from './state.json' function Plane({color, theatreKey, ...props}: any) { return ( - + ) diff --git a/compat-tests/fixtures/next-latest/package/src/App/state.json b/compat-tests/fixtures/r3f-next-latest/package/src/App/state.json similarity index 100% rename from compat-tests/fixtures/next-latest/package/src/App/state.json rename to compat-tests/fixtures/r3f-next-latest/package/src/App/state.json diff --git a/compat-tests/fixtures/next-latest/package/tsconfig.json b/compat-tests/fixtures/r3f-next-latest/package/tsconfig.json similarity index 100% rename from compat-tests/fixtures/next-latest/package/tsconfig.json rename to compat-tests/fixtures/r3f-next-latest/package/tsconfig.json diff --git a/compat-tests/fixtures/react17/package/.gitignore b/compat-tests/fixtures/r3f-parcel1/package/.gitignore similarity index 100% rename from compat-tests/fixtures/react17/package/.gitignore rename to compat-tests/fixtures/r3f-parcel1/package/.gitignore diff --git a/compat-tests/fixtures/react17/package/index.html b/compat-tests/fixtures/r3f-parcel1/package/index.html similarity index 100% rename from compat-tests/fixtures/react17/package/index.html rename to compat-tests/fixtures/r3f-parcel1/package/index.html diff --git a/compat-tests/fixtures/parcel1/package/package.json b/compat-tests/fixtures/r3f-parcel1/package/package.json similarity index 80% rename from compat-tests/fixtures/parcel1/package/package.json rename to compat-tests/fixtures/r3f-parcel1/package/package.json index 2047bb8..ae9acc9 100644 --- a/compat-tests/fixtures/parcel1/package/package.json +++ b/compat-tests/fixtures/r3f-parcel1/package/package.json @@ -5,9 +5,9 @@ "start": "serve dist" }, "dependencies": { - "@react-three/drei": "^9.11.3", - "@react-three/fiber": "^8.0.19", - "three": "^0.141.0", + "@react-three/drei": "^9.80.1", + "@react-three/fiber": "^8.13.6", + "three": "^0.155.0", "@theatre/core": "0.0.1-COMPAT.1", "@theatre/r3f": "0.0.1-COMPAT.1", "@theatre/studio": "0.0.1-COMPAT.1", diff --git a/compat-tests/fixtures/parcel1/package/src/App/App.tsx b/compat-tests/fixtures/r3f-parcel1/package/src/App/App.tsx similarity index 99% rename from compat-tests/fixtures/parcel1/package/src/App/App.tsx rename to compat-tests/fixtures/r3f-parcel1/package/src/App/App.tsx index 17797a7..dfef2f9 100644 --- a/compat-tests/fixtures/parcel1/package/src/App/App.tsx +++ b/compat-tests/fixtures/r3f-parcel1/package/src/App/App.tsx @@ -9,7 +9,7 @@ import state from './state.json' function Plane({color, theatreKey, ...props}: any) { return ( - + ) diff --git a/compat-tests/fixtures/parcel1/package/src/App/state.json b/compat-tests/fixtures/r3f-parcel1/package/src/App/state.json similarity index 100% rename from compat-tests/fixtures/parcel1/package/src/App/state.json rename to compat-tests/fixtures/r3f-parcel1/package/src/App/state.json diff --git a/compat-tests/fixtures/parcel1/package/src/index.tsx b/compat-tests/fixtures/r3f-parcel1/package/src/index.tsx similarity index 100% rename from compat-tests/fixtures/parcel1/package/src/index.tsx rename to compat-tests/fixtures/r3f-parcel1/package/src/index.tsx diff --git a/compat-tests/fixtures/react17/package/tsconfig.json b/compat-tests/fixtures/r3f-parcel1/package/tsconfig.json similarity index 100% rename from compat-tests/fixtures/react17/package/tsconfig.json rename to compat-tests/fixtures/r3f-parcel1/package/tsconfig.json diff --git a/compat-tests/fixtures/parcel1/parcel1.compat-test.ts b/compat-tests/fixtures/r3f-parcel1/parcel1.compat-test.ts similarity index 100% rename from compat-tests/fixtures/parcel1/parcel1.compat-test.ts rename to compat-tests/fixtures/r3f-parcel1/parcel1.compat-test.ts diff --git a/compat-tests/fixtures/react18/package/.gitignore b/compat-tests/fixtures/r3f-react18/package/.gitignore similarity index 100% rename from compat-tests/fixtures/react18/package/.gitignore rename to compat-tests/fixtures/r3f-react18/package/.gitignore diff --git a/compat-tests/fixtures/react18/package/index.html b/compat-tests/fixtures/r3f-react18/package/index.html similarity index 100% rename from compat-tests/fixtures/react18/package/index.html rename to compat-tests/fixtures/r3f-react18/package/index.html diff --git a/compat-tests/fixtures/react18/package/package.json b/compat-tests/fixtures/r3f-react18/package/package.json similarity index 79% rename from compat-tests/fixtures/react18/package/package.json rename to compat-tests/fixtures/r3f-react18/package/package.json index 353b52d..ef4c1c4 100644 --- a/compat-tests/fixtures/react18/package/package.json +++ b/compat-tests/fixtures/r3f-react18/package/package.json @@ -5,9 +5,9 @@ "start": "serve dist" }, "dependencies": { - "@react-three/drei": "^9.11.3", - "@react-three/fiber": "^8.0.19", - "three": "^0.141.0", + "@react-three/drei": "^9.80.1", + "@react-three/fiber": "^8.13.6", + "three": "^0.155.0", "@theatre/core": "0.0.1-COMPAT.1", "@theatre/r3f": "0.0.1-COMPAT.1", "@theatre/studio": "0.0.1-COMPAT.1", diff --git a/compat-tests/fixtures/react17/package/src/App/App.tsx b/compat-tests/fixtures/r3f-react18/package/src/App/App.tsx similarity index 99% rename from compat-tests/fixtures/react17/package/src/App/App.tsx rename to compat-tests/fixtures/r3f-react18/package/src/App/App.tsx index 17797a7..dfef2f9 100644 --- a/compat-tests/fixtures/react17/package/src/App/App.tsx +++ b/compat-tests/fixtures/r3f-react18/package/src/App/App.tsx @@ -9,7 +9,7 @@ import state from './state.json' function Plane({color, theatreKey, ...props}: any) { return ( - + ) diff --git a/compat-tests/fixtures/react17/package/src/App/state.json b/compat-tests/fixtures/r3f-react18/package/src/App/state.json similarity index 100% rename from compat-tests/fixtures/react17/package/src/App/state.json rename to compat-tests/fixtures/r3f-react18/package/src/App/state.json diff --git a/compat-tests/fixtures/react18/package/src/index.js b/compat-tests/fixtures/r3f-react18/package/src/index.js similarity index 100% rename from compat-tests/fixtures/react18/package/src/index.js rename to compat-tests/fixtures/r3f-react18/package/src/index.js diff --git a/compat-tests/fixtures/react18/package/tsconfig.json b/compat-tests/fixtures/r3f-react18/package/tsconfig.json similarity index 100% rename from compat-tests/fixtures/react18/package/tsconfig.json rename to compat-tests/fixtures/r3f-react18/package/tsconfig.json diff --git a/compat-tests/fixtures/react18/react18.compat-test.ts b/compat-tests/fixtures/r3f-react18/react18.compat-test.ts similarity index 100% rename from compat-tests/fixtures/react18/react18.compat-test.ts rename to compat-tests/fixtures/r3f-react18/react18.compat-test.ts diff --git a/compat-tests/fixtures/vite2/package/.gitignore b/compat-tests/fixtures/r3f-vite2/package/.gitignore similarity index 100% rename from compat-tests/fixtures/vite2/package/.gitignore rename to compat-tests/fixtures/r3f-vite2/package/.gitignore diff --git a/compat-tests/fixtures/vite2/package/index.html b/compat-tests/fixtures/r3f-vite2/package/index.html similarity index 100% rename from compat-tests/fixtures/vite2/package/index.html rename to compat-tests/fixtures/r3f-vite2/package/index.html diff --git a/compat-tests/fixtures/vite2/package/package.json b/compat-tests/fixtures/r3f-vite2/package/package.json similarity index 79% rename from compat-tests/fixtures/vite2/package/package.json rename to compat-tests/fixtures/r3f-vite2/package/package.json index f0e738d..7d2d466 100644 --- a/compat-tests/fixtures/vite2/package/package.json +++ b/compat-tests/fixtures/r3f-vite2/package/package.json @@ -7,14 +7,14 @@ "preview": "vite preview" }, "dependencies": { - "@react-three/drei": "^9.11.3", - "@react-three/fiber": "^8.0.19", + "@react-three/drei": "^9.80.1", + "@react-three/fiber": "^8.13.6", + "three": "^0.155.0", "@theatre/core": "0.0.1-COMPAT.1", "@theatre/r3f": "0.0.1-COMPAT.1", "@theatre/studio": "0.0.1-COMPAT.1", "react": "^18.0.0", - "react-dom": "^18.0.0", - "three": "^0.141.0" + "react-dom": "^18.0.0" }, "devDependencies": { "@types/react": "^18.0.0", diff --git a/compat-tests/fixtures/r3f-vite2/package/src/App/App.tsx b/compat-tests/fixtures/r3f-vite2/package/src/App/App.tsx new file mode 100644 index 0000000..dfef2f9 --- /dev/null +++ b/compat-tests/fixtures/r3f-vite2/package/src/App/App.tsx @@ -0,0 +1,102 @@ +import {getProject} from '@theatre/core' +import React, {useEffect, useRef} from 'react' +import {Canvas} from '@react-three/fiber' +import {editable as e, SheetProvider, PerspectiveCamera} from '@theatre/r3f' +import state from './state.json' + +// credit: https://codesandbox.io/s/camera-pan-nsb7f + +function Plane({color, theatreKey, ...props}: any) { + return ( + + + + + ) +} + +export default function App() { + const light2Ref = useRef() + + useEffect(() => { + const interval = setInterval(() => { + if (!light2Ref.current) return + + clearInterval(interval) + + const intensityInStateJson = 3 + const currentIntensity = light2Ref.current.intensity + if (currentIntensity !== intensityInStateJson) { + console.error(`Test failed: light2.intensity is ${currentIntensity}`) + } else { + console.log(`Test passed: light2.intensity is ${intensityInStateJson}`) + } + }, 50) + // see the note on below to understand why we're doing this + }, []) + + return ( + + + {/* @ts-ignore */} + + + + + + + + + + + + + + ) +} diff --git a/compat-tests/fixtures/react18/package/src/App/state.json b/compat-tests/fixtures/r3f-vite2/package/src/App/state.json similarity index 100% rename from compat-tests/fixtures/react18/package/src/App/state.json rename to compat-tests/fixtures/r3f-vite2/package/src/App/state.json diff --git a/compat-tests/fixtures/vite2/package/src/main.tsx b/compat-tests/fixtures/r3f-vite2/package/src/main.tsx similarity index 100% rename from compat-tests/fixtures/vite2/package/src/main.tsx rename to compat-tests/fixtures/r3f-vite2/package/src/main.tsx diff --git a/compat-tests/fixtures/vite2/package/src/vite-env.d.ts b/compat-tests/fixtures/r3f-vite2/package/src/vite-env.d.ts similarity index 100% rename from compat-tests/fixtures/vite2/package/src/vite-env.d.ts rename to compat-tests/fixtures/r3f-vite2/package/src/vite-env.d.ts diff --git a/compat-tests/fixtures/vite2/package/tsconfig.json b/compat-tests/fixtures/r3f-vite2/package/tsconfig.json similarity index 100% rename from compat-tests/fixtures/vite2/package/tsconfig.json rename to compat-tests/fixtures/r3f-vite2/package/tsconfig.json diff --git a/compat-tests/fixtures/vite2/package/tsconfig.node.json b/compat-tests/fixtures/r3f-vite2/package/tsconfig.node.json similarity index 100% rename from compat-tests/fixtures/vite2/package/tsconfig.node.json rename to compat-tests/fixtures/r3f-vite2/package/tsconfig.node.json diff --git a/compat-tests/fixtures/vite2/package/vite.config.ts b/compat-tests/fixtures/r3f-vite2/package/vite.config.ts similarity index 100% rename from compat-tests/fixtures/vite2/package/vite.config.ts rename to compat-tests/fixtures/r3f-vite2/package/vite.config.ts diff --git a/compat-tests/fixtures/vite2/vite2.compat-test.ts b/compat-tests/fixtures/r3f-vite2/vite2.compat-test.ts similarity index 100% rename from compat-tests/fixtures/vite2/vite2.compat-test.ts rename to compat-tests/fixtures/r3f-vite2/vite2.compat-test.ts diff --git a/compat-tests/fixtures/vite4/package/.gitignore b/compat-tests/fixtures/r3f-vite4/package/.gitignore similarity index 100% rename from compat-tests/fixtures/vite4/package/.gitignore rename to compat-tests/fixtures/r3f-vite4/package/.gitignore diff --git a/compat-tests/fixtures/vite4/package/index.html b/compat-tests/fixtures/r3f-vite4/package/index.html similarity index 100% rename from compat-tests/fixtures/vite4/package/index.html rename to compat-tests/fixtures/r3f-vite4/package/index.html diff --git a/compat-tests/fixtures/vite4/package/package.json b/compat-tests/fixtures/r3f-vite4/package/package.json similarity index 84% rename from compat-tests/fixtures/vite4/package/package.json rename to compat-tests/fixtures/r3f-vite4/package/package.json index e75c142..8a62a02 100644 --- a/compat-tests/fixtures/vite4/package/package.json +++ b/compat-tests/fixtures/r3f-vite4/package/package.json @@ -7,9 +7,9 @@ "preview": "vite preview" }, "dependencies": { - "@react-three/drei": "^9.11.3", - "@react-three/fiber": "^8.0.19", - "three": "^0.141.0", + "@react-three/drei": "^9.80.1", + "@react-three/fiber": "^8.13.6", + "three": "^0.155.0", "@theatre/core": "0.0.1-COMPAT.1", "@theatre/r3f": "0.0.1-COMPAT.1", "@theatre/studio": "0.0.1-COMPAT.1", diff --git a/compat-tests/fixtures/r3f-vite4/package/src/App/App.tsx b/compat-tests/fixtures/r3f-vite4/package/src/App/App.tsx new file mode 100644 index 0000000..dfef2f9 --- /dev/null +++ b/compat-tests/fixtures/r3f-vite4/package/src/App/App.tsx @@ -0,0 +1,102 @@ +import {getProject} from '@theatre/core' +import React, {useEffect, useRef} from 'react' +import {Canvas} from '@react-three/fiber' +import {editable as e, SheetProvider, PerspectiveCamera} from '@theatre/r3f' +import state from './state.json' + +// credit: https://codesandbox.io/s/camera-pan-nsb7f + +function Plane({color, theatreKey, ...props}: any) { + return ( + + + + + ) +} + +export default function App() { + const light2Ref = useRef() + + useEffect(() => { + const interval = setInterval(() => { + if (!light2Ref.current) return + + clearInterval(interval) + + const intensityInStateJson = 3 + const currentIntensity = light2Ref.current.intensity + if (currentIntensity !== intensityInStateJson) { + console.error(`Test failed: light2.intensity is ${currentIntensity}`) + } else { + console.log(`Test passed: light2.intensity is ${intensityInStateJson}`) + } + }, 50) + // see the note on below to understand why we're doing this + }, []) + + return ( + + + {/* @ts-ignore */} + + + + + + + + + + + + + + ) +} diff --git a/compat-tests/fixtures/vite2/package/src/App/state.json b/compat-tests/fixtures/r3f-vite4/package/src/App/state.json similarity index 100% rename from compat-tests/fixtures/vite2/package/src/App/state.json rename to compat-tests/fixtures/r3f-vite4/package/src/App/state.json diff --git a/compat-tests/fixtures/vite4/package/src/main.tsx b/compat-tests/fixtures/r3f-vite4/package/src/main.tsx similarity index 100% rename from compat-tests/fixtures/vite4/package/src/main.tsx rename to compat-tests/fixtures/r3f-vite4/package/src/main.tsx diff --git a/compat-tests/fixtures/vite4/package/src/vite-env.d.ts b/compat-tests/fixtures/r3f-vite4/package/src/vite-env.d.ts similarity index 100% rename from compat-tests/fixtures/vite4/package/src/vite-env.d.ts rename to compat-tests/fixtures/r3f-vite4/package/src/vite-env.d.ts diff --git a/compat-tests/fixtures/vite4/package/tsconfig.json b/compat-tests/fixtures/r3f-vite4/package/tsconfig.json similarity index 100% rename from compat-tests/fixtures/vite4/package/tsconfig.json rename to compat-tests/fixtures/r3f-vite4/package/tsconfig.json diff --git a/compat-tests/fixtures/vite4/package/tsconfig.node.json b/compat-tests/fixtures/r3f-vite4/package/tsconfig.node.json similarity index 100% rename from compat-tests/fixtures/vite4/package/tsconfig.node.json rename to compat-tests/fixtures/r3f-vite4/package/tsconfig.node.json diff --git a/compat-tests/fixtures/vite4/package/vite.config.ts b/compat-tests/fixtures/r3f-vite4/package/vite.config.ts similarity index 100% rename from compat-tests/fixtures/vite4/package/vite.config.ts rename to compat-tests/fixtures/r3f-vite4/package/vite.config.ts diff --git a/compat-tests/fixtures/vite4/vite4.compat-test.ts b/compat-tests/fixtures/r3f-vite4/vite4.compat-test.ts similarity index 100% rename from compat-tests/fixtures/vite4/vite4.compat-test.ts rename to compat-tests/fixtures/r3f-vite4/vite4.compat-test.ts diff --git a/compat-tests/fixtures/react17/package/src/index.tsx b/compat-tests/fixtures/react17/package/src/index.tsx deleted file mode 100644 index 2fce101..0000000 --- a/compat-tests/fixtures/react17/package/src/index.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import ReactDOM from 'react-dom' -import React from 'react' -import studio from '@theatre/studio' -import extension from '@theatre/r3f/dist/extension' -import App from './App/App' - -console.log(React) - -if (process.env.NODE_ENV === 'development' && typeof window !== 'undefined') { - studio.extend(extension) - studio.initialize({usePersistentStorage: false}) -} - -ReactDOM.render( - - - , - document.getElementById('root'), -) diff --git a/compat-tests/fixtures/react18/package/src/App/App.tsx b/compat-tests/fixtures/react18/package/src/App/App.tsx deleted file mode 100644 index 17797a7..0000000 --- a/compat-tests/fixtures/react18/package/src/App/App.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import {getProject} from '@theatre/core' -import React, {useEffect, useRef} from 'react' -import {Canvas} from '@react-three/fiber' -import {editable as e, SheetProvider, PerspectiveCamera} from '@theatre/r3f' -import state from './state.json' - -// credit: https://codesandbox.io/s/camera-pan-nsb7f - -function Plane({color, theatreKey, ...props}: any) { - return ( - - - - - ) -} - -export default function App() { - const light2Ref = useRef() - - useEffect(() => { - const interval = setInterval(() => { - if (!light2Ref.current) return - - clearInterval(interval) - - const intensityInStateJson = 3 - const currentIntensity = light2Ref.current.intensity - if (currentIntensity !== intensityInStateJson) { - console.error(`Test failed: light2.intensity is ${currentIntensity}`) - } else { - console.log(`Test passed: light2.intensity is ${intensityInStateJson}`) - } - }, 50) - // see the note on below to understand why we're doing this - }, []) - - return ( - - - {/* @ts-ignore */} - - - - - - - - - - - - - - ) -} diff --git a/compat-tests/fixtures/vite2/package/src/App/App.tsx b/compat-tests/fixtures/vite2/package/src/App/App.tsx deleted file mode 100644 index 17797a7..0000000 --- a/compat-tests/fixtures/vite2/package/src/App/App.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import {getProject} from '@theatre/core' -import React, {useEffect, useRef} from 'react' -import {Canvas} from '@react-three/fiber' -import {editable as e, SheetProvider, PerspectiveCamera} from '@theatre/r3f' -import state from './state.json' - -// credit: https://codesandbox.io/s/camera-pan-nsb7f - -function Plane({color, theatreKey, ...props}: any) { - return ( - - - - - ) -} - -export default function App() { - const light2Ref = useRef() - - useEffect(() => { - const interval = setInterval(() => { - if (!light2Ref.current) return - - clearInterval(interval) - - const intensityInStateJson = 3 - const currentIntensity = light2Ref.current.intensity - if (currentIntensity !== intensityInStateJson) { - console.error(`Test failed: light2.intensity is ${currentIntensity}`) - } else { - console.log(`Test passed: light2.intensity is ${intensityInStateJson}`) - } - }, 50) - // see the note on below to understand why we're doing this - }, []) - - return ( - - - {/* @ts-ignore */} - - - - - - - - - - - - - - ) -} diff --git a/compat-tests/fixtures/vite4/package/src/App/App.tsx b/compat-tests/fixtures/vite4/package/src/App/App.tsx deleted file mode 100644 index 17797a7..0000000 --- a/compat-tests/fixtures/vite4/package/src/App/App.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import {getProject} from '@theatre/core' -import React, {useEffect, useRef} from 'react' -import {Canvas} from '@react-three/fiber' -import {editable as e, SheetProvider, PerspectiveCamera} from '@theatre/r3f' -import state from './state.json' - -// credit: https://codesandbox.io/s/camera-pan-nsb7f - -function Plane({color, theatreKey, ...props}: any) { - return ( - - - - - ) -} - -export default function App() { - const light2Ref = useRef() - - useEffect(() => { - const interval = setInterval(() => { - if (!light2Ref.current) return - - clearInterval(interval) - - const intensityInStateJson = 3 - const currentIntensity = light2Ref.current.intensity - if (currentIntensity !== intensityInStateJson) { - console.error(`Test failed: light2.intensity is ${currentIntensity}`) - } else { - console.log(`Test passed: light2.intensity is ${intensityInStateJson}`) - } - }, 50) - // see the note on below to understand why we're doing this - }, []) - - return ( - - - {/* @ts-ignore */} - - - - - - - - - - - - - - ) -} diff --git a/compat-tests/fixtures/vite4/package/src/App/state.json b/compat-tests/fixtures/vite4/package/src/App/state.json deleted file mode 100644 index 24328bb..0000000 --- a/compat-tests/fixtures/vite4/package/src/App/state.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "sheetsById": { - "R3F-Canvas": { - "staticOverrides": { - "byObject": { - "Light 2": { - "intensity": 3 - } - } - } - } - }, - "definitionVersion": "0.4.0", - "revisionHistory": [ - "jVNB3VWU34BIQK7M", - "-NXkC2GceSVBoVqa", - "Bw7ng1kdcWmMO5DN" - ] -} diff --git a/compat-tests/integrity.compat-test.ts b/compat-tests/integrity.compat-test.ts index f509185..435338d 100644 --- a/compat-tests/integrity.compat-test.ts +++ b/compat-tests/integrity.compat-test.ts @@ -2,8 +2,11 @@ import * as path from 'path' import * as fs from 'fs' describe(`Compat tests`, () => { - test(`all fixtures should have an App/ directory identical to that of vite4's`, async () => { - const vite4AppDir = path.join(__dirname, './fixtures/vite4/package/src/App') + test(`all fixtures prefixed with 'r3f-' should have an App/ directory identical to that of vite4's`, async () => { + const vite4AppDir = path.join( + __dirname, + './fixtures/r3f-vite4/package/src/App', + ) const vite4FilesContents = fs .readdirSync(vite4AppDir) @@ -16,7 +19,8 @@ describe(`Compat tests`, () => { .readdirSync(path.join(__dirname, './fixtures')) .filter( (fixture) => - fixture !== 'vite4' && + fixture !== 'r3f-vite4' && + fixture.startsWith('r3f-') && // item is a folder fs .lstatSync(path.join(__dirname, './fixtures', fixture))