deepspace 0.4.5 → 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.
Files changed (35) hide show
  1. package/README.md +90 -0
  2. package/dist/cli.js +3171 -1166
  3. package/dist/cli.js.map +1 -1
  4. package/dist/index.d.ts +31 -4
  5. package/dist/index.js +511 -366
  6. package/dist/index.js.map +1 -1
  7. package/dist/server.d.ts +27 -22
  8. package/dist/server.js +117 -94
  9. package/dist/server.js.map +1 -1
  10. package/dist/testing.js.map +1 -1
  11. package/dist/worker.d.ts +27 -22
  12. package/dist/worker.js +117 -94
  13. package/dist/worker.js.map +1 -1
  14. package/features/admin-page/src/AdminPage.tsx +3 -5
  15. package/features/canvas/src/CanvasEditorPage.tsx +0 -2
  16. package/features/canvas/src/components/CanvasView.tsx +1 -1
  17. package/features/docs/src/LibrarySidebar.tsx +7 -1
  18. package/features/docs/src/use-yjs-room-with-awareness.ts +4 -0
  19. package/features/file-attachments/src/AttachmentsPage.tsx +7 -1
  20. package/features/file-attachments/src/useFilePreview.ts +7 -5
  21. package/features/file-manager/src/FileManagerPage.tsx +2 -3
  22. package/features/integration-test/feature.json +10 -3
  23. package/features/integration-test/src/IntegrationTestPage.tsx +15 -12
  24. package/features/landing/src/LandingPage.tsx +1 -1
  25. package/features/landing/src/sections/FeaturesGridSection.tsx +0 -92
  26. package/features/messaging/src/components/chat/MessageItem.tsx +5 -1
  27. package/features/messaging/src/hooks/useChatChannel.ts +5 -1
  28. package/features/presence-test/feature.json +2 -1
  29. package/features/sidebar/src/AppSidebar.tsx +1 -1
  30. package/features/tasks/src/TasksPage.tsx +1 -1
  31. package/features/testing/feature.json +2 -1
  32. package/features/testing/src/TestPage.tsx +8 -8
  33. package/package.json +4 -4
  34. package/scripts/add-feature.cjs +277 -272
  35. package/dist/testing.d.ts +0 -115
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