diff --git a/examples/.storybook/main.ts b/examples/.storybook/main.ts index 24c3576..0986e94 100644 --- a/examples/.storybook/main.ts +++ b/examples/.storybook/main.ts @@ -18,6 +18,15 @@ const config: StorybookConfig = { if (!config.resolve) config.resolve = {}; if (!config.resolve.alias) config.resolve.alias = {}; + config.resolve.alias['react'] = path.resolve( + __dirname, + '../../node_modules/react' + ); + config.resolve.alias['react-dom'] = path.resolve( + __dirname, + '../../node_modules/react-dom' + ); + config.resolve.alias['@rive-app/react-canvas'] = path.resolve( __dirname, '../../' diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index b87cb00..0000000 --- a/examples/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Getting Started with Create React App - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.\ -You will also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). diff --git a/examples/package.json b/examples/package.json index 30f8c28..4d73e43 100644 --- a/examples/package.json +++ b/examples/package.json @@ -11,21 +11,11 @@ "@types/node": "^16.18.126", "@types/react": "^19.1.2", "@types/react-dom": "^19.1.2", - "react": "^19.1.0", - "react-dom": "^19.1.0", "react-scripts": "5.0.1", "typescript": "^4.9.5", - "web-vitals": "^2.1.4", - "@rive-app/react-canvas": "file:../", - "@rive-app/react-canvas-lite": "file:../", - "@rive-app/react-webgl": "file:../", - "@rive-app/react-webgl2": "file:../" + "web-vitals": "^2.1.4" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build" }, @@ -58,7 +48,6 @@ "@storybook/react-webpack5": "^8.6.12", "@storybook/test": "^8.6.12", "eslint-plugin-storybook": "^0.12.0", - "prop-types": "^15.8.1", "storybook": "^8.6.12", "webpack": "^5.99.6" } diff --git a/examples/public/favicon.ico b/examples/public/favicon.ico deleted file mode 100644 index a11777c..0000000 Binary files a/examples/public/favicon.ico and /dev/null differ diff --git a/examples/public/index.html b/examples/public/index.html deleted file mode 100644 index aa069f2..0000000 --- a/examples/public/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - React App - - - -
- - - diff --git a/examples/public/logo192.png b/examples/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/examples/public/logo192.png and /dev/null differ diff --git a/examples/public/logo512.png b/examples/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/examples/public/logo512.png and /dev/null differ diff --git a/examples/public/manifest.json b/examples/public/manifest.json deleted file mode 100644 index 080d6c7..0000000 --- a/examples/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/examples/public/robots.txt b/examples/public/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/examples/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/examples/src/App.css b/examples/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/examples/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/examples/src/App.test.tsx b/examples/src/App.test.tsx deleted file mode 100644 index 2a68616..0000000 --- a/examples/src/App.test.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/examples/src/App.tsx b/examples/src/App.tsx deleted file mode 100644 index e68d620..0000000 --- a/examples/src/App.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import { RiveThing } from './components/RiveThing'; -import './App.css'; - -function App() { - return ( -
- -
- ); -} - -export default App; diff --git a/examples/src/index.css b/examples/src/index.css deleted file mode 100644 index ec2585e..0000000 --- a/examples/src/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/examples/src/index.tsx b/examples/src/index.tsx deleted file mode 100644 index 032464f..0000000 --- a/examples/src/index.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; - -const root = ReactDOM.createRoot( - document.getElementById('root') as HTMLElement -); -root.render( - - - -); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/examples/src/logo.svg b/examples/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/examples/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/examples/src/react-app-env.d.ts b/examples/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5..0000000 --- a/examples/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/src/reportWebVitals.ts b/examples/src/reportWebVitals.ts deleted file mode 100644 index 49a2a16..0000000 --- a/examples/src/reportWebVitals.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ReportHandler } from 'web-vitals'; - -const reportWebVitals = (onPerfEntry?: ReportHandler) => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/examples/src/setupTests.ts b/examples/src/setupTests.ts deleted file mode 100644 index 8f2609b..0000000 --- a/examples/src/setupTests.ts +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom'; diff --git a/examples/tsconfig.json b/examples/tsconfig.json index a273b0c..b84744c 100644 --- a/examples/tsconfig.json +++ b/examples/tsconfig.json @@ -6,6 +6,12 @@ "dom.iterable", "esnext" ], + "paths": { + "@rive-app/react-canvas": ["../"], + "@rive-app/react-webgl": ["../"], + "@rive-app/react-webgl2": ["../"], + "@rive-app/react-canvas-lite": ["../"] + }, "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, diff --git a/examples/webpack.config.js b/examples/webpack.config.js deleted file mode 100644 index 85d1ad0..0000000 --- a/examples/webpack.config.js +++ /dev/null @@ -1,29 +0,0 @@ -const path = require('path'); - -module.exports = { - // other settings... - resolve: { - alias: { - '@rive-app/react-canvas': path.resolve(__dirname, '../'), - '@rive-app/react-webgl': path.resolve(__dirname, '../'), - '@rive-app/react-webgl2': path.resolve(__dirname, '../'), - '@rive-app/react-canvas-lite': path.resolve(__dirname, '../'), - }, - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }, - module: { - rules: [ - { - test: /\.(js|jsx|ts|tsx)$/, - include: [ - path.resolve(__dirname, 'src'), - path.resolve(__dirname, '../'), - ], - use: 'babel-loader', - }, - ], - }, - watchOptions: { - ignored: /node_modules/, - }, -}; diff --git a/examples/yarn.lock b/examples/yarn.lock index a630bf8..ef2eaaf 100644 --- a/examples/yarn.lock +++ b/examples/yarn.lock @@ -1719,58 +1719,6 @@ schema-utils "^4.2.0" source-map "^0.7.3" -"@rive-app/canvas-lite@2.27.0": - version "2.27.0" - resolved "https://registry.yarnpkg.com/@rive-app/canvas-lite/-/canvas-lite-2.27.0.tgz#04d36a0f58b6e5dd7f117e187616df7ff009ca86" - integrity sha512-pVU+G2k4yyVHzuEHHuiuJ2KRRkNrUzR2q6Xtksxlgc2D0nWgea6cQXym7pI3Bb2pCnXP9C07HDnteNyxO7kcUQ== - -"@rive-app/canvas@2.27.0": - version "2.27.0" - resolved "https://registry.yarnpkg.com/@rive-app/canvas/-/canvas-2.27.0.tgz#322b91dfbf791754e219cfe0a97059b50fdf45e2" - integrity sha512-wXGYCjXO+UpqesRPVSy7YmTnKSelhJVEu6kCWNWzwFD5IfwaM7rF9oG6WsubZ/D2Aacl9snaJUWjos7Em8mUSg== - -"@rive-app/react-canvas-lite@file:..": - version "4.18.8" - dependencies: - "@rive-app/canvas" "2.27.0" - "@rive-app/canvas-lite" "2.27.0" - "@rive-app/webgl" "2.27.0" - "@rive-app/webgl2" "2.27.0" - -"@rive-app/react-canvas@file:..": - version "4.18.8" - dependencies: - "@rive-app/canvas" "2.27.0" - "@rive-app/canvas-lite" "2.27.0" - "@rive-app/webgl" "2.27.0" - "@rive-app/webgl2" "2.27.0" - -"@rive-app/react-webgl2@file:..": - version "4.18.8" - dependencies: - "@rive-app/canvas" "2.27.0" - "@rive-app/canvas-lite" "2.27.0" - "@rive-app/webgl" "2.27.0" - "@rive-app/webgl2" "2.27.0" - -"@rive-app/react-webgl@file:..": - version "4.18.8" - dependencies: - "@rive-app/canvas" "2.27.0" - "@rive-app/canvas-lite" "2.27.0" - "@rive-app/webgl" "2.27.0" - "@rive-app/webgl2" "2.27.0" - -"@rive-app/webgl2@2.27.0": - version "2.27.0" - resolved "https://registry.yarnpkg.com/@rive-app/webgl2/-/webgl2-2.27.0.tgz#854a527309375b61873339e418180d68eb9f3e96" - integrity sha512-RmrHsB5swsliKZhFFwMlwKTP9Afl4ZvcXlWT0Wf/556dUEF9yi15/QxQl/0gHaYi6wiacYpJ+JG0BC6rEkUC3Q== - -"@rive-app/webgl@2.27.0": - version "2.27.0" - resolved "https://registry.yarnpkg.com/@rive-app/webgl/-/webgl-2.27.0.tgz#2a6f98d3c68356a1ec4308857be2deb45b3a2022" - integrity sha512-8UJ9cjibP2JHUiyM6ZvuokaUysEGPF9u/UsHNYzjI6+qgamvErcvmnkeAMDwLNA4y93c6vTK6Qp1uKKW3eHVqw== - "@rollup/plugin-babel@^5.2.0": version "5.3.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" @@ -8652,7 +8600,7 @@ react-docgen@^7.0.0: resolve "^1.22.1" strip-indent "^4.0.0" -"react-dom@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", react-dom@^19.1.0: +"react-dom@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0": version "19.1.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.1.0.tgz#133558deca37fa1d682708df8904b25186793623" integrity sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g== @@ -8739,7 +8687,7 @@ react-scripts@5.0.1: optionalDependencies: fsevents "^2.3.2" -"react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", react@^19.1.0: +"react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0": version "19.1.0" resolved "https://registry.yarnpkg.com/react/-/react-19.1.0.tgz#926864b6c48da7627f004795d6cce50e90793b75" integrity sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==