diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c58293159a..f7fd2afd6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [20.9] steps: - uses: actions/checkout@v3 @@ -28,7 +28,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [20.9] steps: - uses: actions/checkout@v3 @@ -47,7 +47,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [20.9] steps: - uses: actions/checkout@v3 @@ -60,12 +60,14 @@ jobs: - run: yarn test VisualRegression: + # skip this until the new API is ready + if: false name: Visual regression tests runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [20.9] steps: - uses: actions/checkout@v3 @@ -79,11 +81,13 @@ jobs: run: yarn test:e2e:ci Compatibility-Tests: + # skip this until the new API is ready + if: false runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [20.9] steps: - uses: actions/checkout@v3 diff --git a/compat-tests/package.json b/compat-tests/package.json index d3061ff4bd..c7f8a1dd39 100644 --- a/compat-tests/package.json +++ b/compat-tests/package.json @@ -2,17 +2,17 @@ "name": "@theatre/compat-tests", "private": true, "scripts": { - "install-fixtures": "node -r esbuild-register ./scripts/install-fixtures.ts", - "clean": "node -r esbuild-register ./scripts/clean.ts" + "install-fixtures": "tsx ./scripts/install-fixtures.ts", + "clean": "tsx ./scripts/clean.ts" }, "dependencies": { "@cspotcode/zx": "^6.1.2", "@verdaccio/types": "^10.8.0", "esbuild": "^0.18.18", - "esbuild-register": "^3.4.2", "node-cleanup": "^2.1.2", "playwright": "^1.29.1", "prettier": "^2.6.2", + "tsx": "4.7.0", "verdaccio": "^5.26.1", "verdaccio-auth-memory": "^10.2.2", "verdaccio-memory": "^10.3.2" diff --git a/devEnv/cli.ts b/devEnv/cli.ts index bf51967c85..b7e76be789 100644 --- a/devEnv/cli.ts +++ b/devEnv/cli.ts @@ -27,21 +27,24 @@ $.quote = function quote(arg) { ) } +const packagesToBuild = [ + '@theatre/dataverse', + '@theatre/saaz', + '@theatre/core', + '@theatre/studio', + '@theatre/react', + '@theatre/r3f', + 'theatric', + '@theatre/browser-bundles', +] + prog .command( 'build clean', 'Cleans the build artifacts and output directories of all the main packages', ) .action(async () => { - const packages = [ - '@theatre/saaz', - 'theatre', - '@theatre/dataverse', - '@theatre/react', - '@theatre/browser-bundles', - '@theatre/r3f', - 'theatric', - ] + const packages = [...packagesToBuild] await Promise.all([ ...packages.map((workspace) => $`yarn workspace ${workspace} run clean`), @@ -49,22 +52,11 @@ prog }) prog.command('build', 'Builds all the main packages').action(async () => { - const packagesToBuild = [ - '@theatre/saaz', - 'theatre', - '@theatre/dataverse', - '@theatre/react', - '@theatre/browser-bundles', - '@theatre/r3f', - 'theatric', - ] async function build() { - await Promise.all([ - $`yarn run build:ts`, - ...packagesToBuild.map( - (workspace) => $`yarn workspace ${workspace} run build`, - ), - ]) + await $`yarn run build:ts` + for (const workspace of packagesToBuild) { + await $`yarn workspace ${workspace} run build` + } } void build() @@ -80,42 +72,13 @@ prog * * It assigns the same version number to all packages (like lerna's fixed mode). **/ - const packagesToBuild = [ - '@theatre/saaz', - 'theatre', - '@theatre/dataverse', - '@theatre/react', - '@theatre/browser-bundles', - '@theatre/r3f', - 'theatric', - ] - const packagesToPublish = [ - '@theatre/core', - '@theatre/studio', - '@theatre/dataverse', - '@theatre/saaz', - '@theatre/react', - '@theatre/browser-bundles', - '@theatre/r3f', - 'theatric', - ] + const packagesToPublish = [...packagesToBuild] /** * All these packages will have the same version from monorepo/package.json */ - const packagesWhoseVersionsShouldBump = [ - '.', - 'theatre', - 'theatre/core', - 'theatre/studio', - 'packages/dataverse', - 'packages/react', - 'packages/saaz', - 'packages/browser-bundles', - 'packages/r3f', - 'packages/theatric', - ] + const packagesWhoseVersionsShouldBump = ['.', ...packagesToPublish] // our packages will check for this env variable to make sure their // prepublish script is only called from the `$ cd /path/to/monorepo; yarn run release` diff --git a/devEnv/ensurePublishing.js b/devEnv/ensurePublishing.js index 07fd346240..93a480b21e 100644 --- a/devEnv/ensurePublishing.js +++ b/devEnv/ensurePublishing.js @@ -1,7 +1,4 @@ -if ( - process.env.THEATRE_IS_PUBLISHING !== 'true' && - process.env.USING_YALC !== 'true' -) { +if (process.env.THEATRE_IS_PUBLISHING !== 'true') { throw Error( `This script may run only when the "release" command in monorepo's root is running.`, ) diff --git a/docker-compose.yml b/docker-compose.yml index ec4cf3ef95..6b036e0016 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ version: '3.8' name: theatre-monorepo services: node: - image: mcr.microsoft.com/playwright:v1.36.0-jammy + image: mcr.microsoft.com/playwright:v1.40.0-jammy volumes: - .:/app # This ignores all node_modules folders/sub-folders so that we can have a separate installation diff --git a/examples/basic-dom/Scene.tsx b/examples/basic-dom/Scene.tsx index 140c363e7a..4bfc163236 100644 --- a/examples/basic-dom/Scene.tsx +++ b/examples/basic-dom/Scene.tsx @@ -5,7 +5,7 @@ import type {UseDragOpts} from './useDrag' import useDrag from './useDrag' import theatre from '@theatre/core' -theatre.init({studio: true}) +void theatre.init({studio: true}) const boxObjectConfig = { x: 0, diff --git a/examples/basic-dom/index.tsx b/examples/basic-dom/index.tsx index 5173bf1508..1decf76706 100644 --- a/examples/basic-dom/index.tsx +++ b/examples/basic-dom/index.tsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client' import theatre, {getProject} from '@theatre/core' import {Scene} from './Scene' -theatre.init({studio: true}) +void theatre.init({studio: true}) ReactDOM.createRoot(document.getElementById('root')!).render( , diff --git a/package.json b/package.json index e7212eaa09..c3fcbf10ea 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "compat-tests" ], "scripts": { - "cli": "node -r esbuild-register devEnv/cli.ts", + "cli": "tsx devEnv/cli.ts", "playground": "yarn workspace playground run serve", "benchmarks": "yarn workspace benchmarks run serve", "test:e2e": "yarn workspace playground run test", @@ -38,7 +38,6 @@ "@typescript-eslint/eslint-plugin": "^6.16.0", "@typescript-eslint/parser": "^6.16.0", "esbuild": "^0.18.18", - "esbuild-register": "^3.4.2", "eslint": "^8.56.0", "eslint-plugin-import": "2.29.1", "eslint-plugin-jsx-a11y": "^6.7.1", @@ -58,6 +57,7 @@ "node-gyp": "^9.1.0", "prettier": "^3.1.1", "sade": "^1.8.1", + "tsx": "4.7.0", "typescript": "5.1.6", "yaml": "^2.3.1" }, diff --git a/packages/app/package.json b/packages/app/package.json index ca1b31bdf8..f9818b9e2b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "cli": "node -r esbuild-register devEnv/cli.ts", + "cli": "tsx devEnv/cli.ts", "start": "yarn cli prod start", "lint": "next lint", "prebuild": "yarn cli prebuild", @@ -44,7 +44,6 @@ "cross-env": "^7.0.3", "dotenv": "^16.3.1", "esbuild": "^0.18.20", - "esbuild-register": "^3.4.2", "eslint-config-next": "13.4.13", "jose": "^4.14.4", "lucide-react": "^0.289.0", diff --git a/packages/app/src/app/(protected)/_components/EditWorkspaceDialog.tsx b/packages/app/src/app/(protected)/_components/EditWorkspaceDialog.tsx index 9fd6108db3..523b84b296 100644 --- a/packages/app/src/app/(protected)/_components/EditWorkspaceDialog.tsx +++ b/packages/app/src/app/(protected)/_components/EditWorkspaceDialog.tsx @@ -66,8 +66,8 @@ export default function EditWorkspaceDialog({ name: values.name, description: values.description, }) - queryUtils.teams.invalidate() - queryUtils.workspaces.invalidate() + void queryUtils.teams.invalidate() + void queryUtils.workspaces.invalidate() } catch (error) { toast({ variant: 'destructive', diff --git a/packages/app/src/app/(protected)/_components/InviteGuestsDialog.tsx b/packages/app/src/app/(protected)/_components/InviteGuestsDialog.tsx index 00b9901169..8af40defbf 100644 --- a/packages/app/src/app/(protected)/_components/InviteGuestsDialog.tsx +++ b/packages/app/src/app/(protected)/_components/InviteGuestsDialog.tsx @@ -64,7 +64,7 @@ export default function InviteGuestsDialog({ id: workspaceId, invites: [{email: values.email, accessLevel: values.accessLevel}], }) - queryUtils.workspaces.invalidate() + void queryUtils.workspaces.invalidate() } catch (error) { toast({ variant: 'destructive', @@ -157,7 +157,7 @@ function Guests({workspaceId}: {workspaceId: string}) { async function handleRemoveGuest(email: string) { await removeGuest({id: workspaceId, email}) - queryUtils.workspaces.getGuests.invalidate() + void queryUtils.workspaces.getGuests.invalidate() } async function handleChangeAccessLevel( @@ -165,7 +165,7 @@ function Guests({workspaceId}: {workspaceId: string}) { accessLevel: 'READ' | 'READ_WRITE', ) { await changeAccessLevel({id: workspaceId, email, accessLevel}) - queryUtils.workspaces.getGuests.invalidate() + void queryUtils.workspaces.getGuests.invalidate() } return ( diff --git a/packages/app/src/app/(protected)/_components/InviteTeamMembersPrompt.tsx b/packages/app/src/app/(protected)/_components/InviteTeamMembersPrompt.tsx index 6eaea93bd9..e80f2e7bea 100644 --- a/packages/app/src/app/(protected)/_components/InviteTeamMembersPrompt.tsx +++ b/packages/app/src/app/(protected)/_components/InviteTeamMembersPrompt.tsx @@ -53,7 +53,7 @@ const InviteTeamMembersPrompt: FC<{id: string}> = ({id}) => { id, invites: [{email: values.email, role: values.role}], }) - queryUtils.teams.invalidate() + void queryUtils.teams.invalidate() } catch (error) { toast({ variant: 'destructive', diff --git a/packages/app/src/app/(protected)/_components/NewWorkspaceDialog.tsx b/packages/app/src/app/(protected)/_components/NewWorkspaceDialog.tsx index 8fcb021a9b..6a0c5d24e7 100644 --- a/packages/app/src/app/(protected)/_components/NewWorkspaceDialog.tsx +++ b/packages/app/src/app/(protected)/_components/NewWorkspaceDialog.tsx @@ -56,8 +56,8 @@ export default function NewWorkspaceDialog({teamId}: {teamId: string}) { description: values.description, teamId, }) - queryUtils.teams.invalidate() - queryUtils.workspaces.invalidate() + void queryUtils.teams.invalidate() + void queryUtils.workspaces.invalidate() } catch (error) { toast({ variant: 'destructive', diff --git a/packages/app/src/app/(protected)/_components/NotificationsPopover.tsx b/packages/app/src/app/(protected)/_components/NotificationsPopover.tsx index 8e5cce2a65..dfed7c7c2f 100644 --- a/packages/app/src/app/(protected)/_components/NotificationsPopover.tsx +++ b/packages/app/src/app/(protected)/_components/NotificationsPopover.tsx @@ -57,8 +57,8 @@ const Invitations = () => {