You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new folder for our snippet inside of example folder .
10
+
1. Copy `tsconfig.json`, `package.json`, `src/index.tsx`, `public/index.html`, `public/github.css`, and `.gitignore` from the `chat-room-react` example folder (1) into the new snippet example folder. (1: `examples/chat-room-react`)
11
+
- Update index.html's github anchor link to point to `https://github.com/rivet-gg/actor-core/tree/main/examples/{insert example name}`
12
+
2. Copy the `actor-json.ts` file from the snippet folder into the file `actors/app.ts` in the example folder. Make sure its being exported & setup correctly (see example from `chat-room-react/actors/app.ts`: )
13
+
```
14
+
// We get rid of the default export
15
+
// export default ...
16
+
17
+
// and instead...
18
+
19
+
// Create and export the app
20
+
export const app = setup({
21
+
actors: { actor },
22
+
});
23
+
24
+
// Export type for client type checking
25
+
export type App = typeof app;
26
+
```
27
+
3. Copy the `App.tsx` from the snippet folder into `src/App.tsx` file, and then make it export the main app class as `export default function ReactApp`
28
+
4. Ask for user review at this point and see if you should continue. If you continue:
29
+
5. Call `yarn install` and fix any type errors. Review to other `examples/*` folders for sample.
30
+
31
+
# NOTES
32
+
1. Everything should be installed wit yarn
33
+
2. Environment variables should be used for any LLM calls
34
+
- Make sure to use dotenv to put the env to use
35
+
3. Feel free to install any missing packages that were present in the original snippet.
0 commit comments