@epic-web/workshop-presence 6.45.7 → 6.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +40 -17
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,22 +1,45 @@
1
- ## 🎈 epic-web-presence
1
+ # @epic-web/workshop-presence
2
2
 
3
- Welcome to the party, pal!
3
+ Presence (who’s here) utilities for the Epic Workshop ecosystem.
4
4
 
5
- This is a [Partykit](https://partykit.io) project, which lets you create
6
- real-time collaborative applications with minimal coding effort.
5
+ This package contains:
7
6
 
8
- [`server.ts`](./src/server.ts) is the server-side code, which is responsible for
9
- handling WebSocket events and HTTP requests.
10
- [`presence.tsx`](../workshop-app/app/utils/presence.tsx) is the client-side
11
- code, which connects to the server and listens for events.
7
+ - A shared **schema/types** module (`presence`) used by clients and servers
8
+ - A server helper (`presence.server`) that fetches and enriches presence data
9
+ for rendering in the workshop app
10
+ - A PartyKit server implementation (used by the hosted presence service)
12
11
 
13
- You can start developing by running `npm run dev` and opening
14
- [http://localhost:1999](http://localhost:1999) in your browser. When you're
15
- ready, you can deploy your application on to the PartyKit cloud with
16
- `npm run deploy`.
12
+ ## Install
17
13
 
18
- Refer to our docs for more information:
19
- https://github.com/partykit/partykit/blob/main/README.md. For more help, reach
20
- out to us on [Discord](https://discord.gg/g5uqHQJc3z),
21
- [GitHub](https://github.com/partykit/partykit), or
22
- [Twitter](https://twitter.com/partykit_io).
14
+ ```bash
15
+ npm install @epic-web/workshop-presence
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### Shared schema/types
21
+
22
+ ```ts
23
+ import { UserSchema, type User } from '@epic-web/workshop-presence/presence'
24
+
25
+ const user = UserSchema.parse({ id: '123' }) satisfies User
26
+ ```
27
+
28
+ ### Server-side: fetch present users
29
+
30
+ ```ts
31
+ import { getPresentUsers } from '@epic-web/workshop-presence/presence.server'
32
+
33
+ const users = await getPresentUsers({ request })
34
+ ```
35
+
36
+ `getPresentUsers` is intended to be called from server code (it integrates with
37
+ workshop auth/preferences when available).
38
+
39
+ ## Documentation
40
+
41
+ - Repo docs: `https://github.com/epicweb-dev/epicshop/tree/main/docs`
42
+
43
+ ## License
44
+
45
+ GPL-3.0-only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epic-web/workshop-presence",
3
- "version": "6.45.7",
3
+ "version": "6.46.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,7 +14,7 @@
14
14
  "deploy": "partykit deploy"
15
15
  },
16
16
  "dependencies": {
17
- "@epic-web/workshop-utils": "6.45.7",
17
+ "@epic-web/workshop-utils": "6.46.0",
18
18
  "zod": "^3.25.76"
19
19
  },
20
20
  "devDependencies": {
@@ -40,7 +40,7 @@
40
40
  "repository": {
41
41
  "type": "git",
42
42
  "url": "https://github.com/epicweb-dev/epicshop.git",
43
- "directory": "packages/presence"
43
+ "directory": "packages/workshop-presence"
44
44
  },
45
45
  "exports": {
46
46
  "./package.json": "./package.json",