deepspace 0.4.4 → 0.5.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.
- package/README.md +90 -0
- package/dist/cli.js +2912 -1984
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +31 -4
- package/dist/index.js +511 -366
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +29 -108
- package/dist/server.js +126 -589
- package/dist/server.js.map +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/worker.d.ts +29 -108
- package/dist/worker.js +126 -589
- package/dist/worker.js.map +1 -1
- package/features/admin-page/src/AdminPage.tsx +3 -5
- package/features/canvas/src/CanvasEditorPage.tsx +0 -2
- package/features/canvas/src/components/CanvasView.tsx +1 -1
- package/features/docs/src/LibrarySidebar.tsx +7 -1
- package/features/docs/src/use-yjs-room-with-awareness.ts +4 -0
- package/features/file-attachments/src/AttachmentsPage.tsx +7 -1
- package/features/file-attachments/src/useFilePreview.ts +7 -5
- package/features/file-manager/src/FileManagerPage.tsx +2 -3
- package/features/integration-test/feature.json +10 -3
- package/features/integration-test/src/IntegrationTestPage.tsx +15 -12
- package/features/landing/src/LandingPage.tsx +1 -1
- package/features/landing/src/sections/FeaturesGridSection.tsx +0 -92
- package/features/messaging/src/components/chat/MessageItem.tsx +5 -1
- package/features/messaging/src/hooks/useChatChannel.ts +5 -1
- package/features/presence-test/feature.json +2 -1
- package/features/sidebar/src/AppSidebar.tsx +1 -1
- package/features/tasks/src/TasksPage.tsx +1 -1
- package/features/testing/feature.json +2 -1
- package/features/testing/src/TestPage.tsx +8 -8
- package/package.json +4 -4
- package/scripts/add-feature.cjs +277 -272
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# deepspace
|
|
2
|
+
|
|
3
|
+
The DeepSpace SDK — build real-time collaborative apps on Cloudflare Workers.
|
|
4
|
+
Bundles auth, real-time data subscriptions, RBAC, messaging, file storage,
|
|
5
|
+
collaborative editing (Yjs), and zero-config deployment behind two imports.
|
|
6
|
+
|
|
7
|
+
The fastest way to start is to scaffold a full app rather than wire the SDK up
|
|
8
|
+
by hand:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm create deepspace my-app
|
|
12
|
+
cd my-app
|
|
13
|
+
npm run dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install deepspace
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`react` / `react-dom` are peer dependencies for the client entry point.
|
|
23
|
+
|
|
24
|
+
## Entry points
|
|
25
|
+
|
|
26
|
+
The package has two entry points:
|
|
27
|
+
|
|
28
|
+
- **`deepspace`** — the React client SDK (hooks, providers, auth, storage,
|
|
29
|
+
messaging, theme). Runs in the browser.
|
|
30
|
+
- **`deepspace/worker`** — the Cloudflare Worker runtime (`RecordRoom`, schemas,
|
|
31
|
+
JWT verification, HMAC auth). Runs in your app's Worker.
|
|
32
|
+
|
|
33
|
+
## Minimal usage
|
|
34
|
+
|
|
35
|
+
Client — wrap your app and subscribe to a collection:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { RecordProvider, useQuery } from 'deepspace'
|
|
39
|
+
|
|
40
|
+
function App() {
|
|
41
|
+
return (
|
|
42
|
+
<RecordProvider roomId="my-app">
|
|
43
|
+
<Tasks />
|
|
44
|
+
</RecordProvider>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function Tasks() {
|
|
49
|
+
const { records, status } = useQuery('tasks', {
|
|
50
|
+
orderBy: 'createdAt',
|
|
51
|
+
orderDir: 'desc',
|
|
52
|
+
})
|
|
53
|
+
if (status === 'loading') return null
|
|
54
|
+
return (
|
|
55
|
+
<ul>
|
|
56
|
+
{records.map((r) => (
|
|
57
|
+
<li key={r.recordId}>{r.data.title}</li>
|
|
58
|
+
))}
|
|
59
|
+
</ul>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Worker — expose a `RecordRoom` Durable Object:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { RecordRoom } from 'deepspace/worker'
|
|
68
|
+
|
|
69
|
+
export class MyRoom extends RecordRoom {}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## CLI
|
|
73
|
+
|
|
74
|
+
The package ships a `deepspace` binary for local dev and deployment:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx deepspace login # authenticate
|
|
78
|
+
npx deepspace dev # run locally
|
|
79
|
+
npx deepspace deploy # deploy to *.app.space
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Debugging
|
|
83
|
+
|
|
84
|
+
Client SDK connection/auth/Yjs logs are silent by default. Enable them with
|
|
85
|
+
`localStorage.DEEPSPACE_DEBUG = '1'` in the browser. Set the `DEEPSPACE_DO_PERF`
|
|
86
|
+
env binding on your Worker to emit per-connection `[DO Perf]` timing logs.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT
|