Compare commits

...

622 Commits

Author SHA1 Message Date
Guido D'Orsi
74fa115709 Merge pull request #2455 from garden-co/changeset-release/main
Version Packages
2025-06-09 12:41:11 +02:00
github-actions[bot]
baa5278cf3 Version Packages 2025-06-09 10:33:53 +00:00
Guido D'Orsi
6852b60e72 Merge pull request #2471 from garden-co/fix/account-migration-loaded-types
Ensure the types on withMigration expect a shallowly loaded Account
2025-06-09 12:30:04 +02:00
Anselm
fc2b054fc2 Fix formatting 2025-06-09 11:13:02 +01:00
Anselm
048ac1d54f Add changeset 2025-06-09 11:10:47 +01:00
Anselm
4ed7d61ea4 Ensure the types on withMigration expect a shallowly loaded Account 2025-06-09 11:10:18 +01:00
Trisha Lim
ced325da06 Merge pull request #2470 from garden-co/docs/inspector-full-json 2025-06-09 10:23:53 +01:00
Trisha Lim
5563799a2a lint fix 2025-06-09 09:19:35 +01:00
Trisha Lim
5a783f8eac Merge pull request #2467 from joeinnes/fix-small-screen-x-overflow
Add w-full to the pagefind container div
2025-06-09 09:17:13 +01:00
Trisha Lim
0ea1530ee9 update inspector docs instruction for passing credentials 2025-06-09 09:12:56 +01:00
Trisha Lim
164579ee9c Merge pull request #2469 from timolins/paste-json-inspector
[Inspector] Allow pasting of full account JSON
2025-06-09 09:00:59 +01:00
Timo Lins
fc453e68c1 Allow pasting of full json into inspector account 2025-06-08 21:22:46 +02:00
Joe Innes
48544ca4d1 Add w-full to the pagefind container div. 2025-06-07 14:55:10 +02:00
Nikos Papadopoulos
b2e2b91dd7 Merge pull request #2461 from garden-co/nikos/ex-app-prosemirror-layout
updates richtext-prosemirror example app layout
2025-06-06 18:16:00 +02:00
Nikos Papadopoulos
36d7791326 updates richtext-prosemirror example app class names 2025-06-06 16:45:53 +01:00
Nikos Papadopoulos
707d84dea0 updates richtext-prosemirror example app layout 2025-06-06 16:22:27 +01:00
Emil Sayahi
6da8e3948c feat(docs): search (#2378)
* feat: documentation search results

Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
Co-authored-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
Co-authored-by: Trisha Lim <hello@trishalim.com>
2025-06-06 15:27:55 +01:00
Sammii
225da5ca42 Merge pull request #2458 from garden-co/feat/covalues-visualisation 2025-06-06 15:14:28 +02:00
Anselm Eickhoff
3943f7fc41 Merge pull request #2460 from garden-co/fix/vercel-ingore-build-project-id
Use vercel project ID for ignore build step
2025-06-06 14:03:59 +01:00
Anselm
d982bb50db Use vercel project ID for ignore build step 2025-06-06 14:02:51 +01:00
Sammii
92de0a6683 covalues page update 2025-06-06 13:36:33 +01:00
Sammii
e10d00b444 switch refactor 2025-06-06 13:36:24 +01:00
Sammii
89b6c1cbb9 creating Switch component from radix 2025-06-06 13:34:47 +01:00
Sammii
6ec1933d65 updating schema to zod 2025-06-06 13:34:18 +01:00
Nikos Papadopoulos
854c6761a4 Merge pull request #2459 from garden-co/nikos/docs-url-updates
updates example app URLs in documentation
2025-06-06 14:19:10 +02:00
Nikos Papadopoulos
fc8acb0688 updates example app URLs in documentation 2025-06-06 13:10:50 +01:00
Trisha Lim
7a65b35ac5 Merge pull request #2437 from garden-co/chore/tailwind-v4
chore: update react starter to tailwind v4
2025-06-06 12:45:22 +01:00
Trisha Lim
2ef3938d71 update lock file 2025-06-06 12:09:16 +01:00
Trisha Lim
1e71b23779 fix(starter): wording 2025-06-06 12:08:37 +01:00
Trisha Lim
31071a4b21 chore: update react starter to tailwind v4 2025-06-06 12:08:35 +01:00
Sammii
8f53a52110 moving covalues folder into app to see components on /covalues 2025-06-06 10:04:25 +01:00
Anselm Eickhoff
08b105508f Merge pull request #2440 from garden-co/optimize-vercel-deployments
Optimize Vercel deployments
2025-06-06 09:22:00 +01:00
Benjamin S. Leveritt
f567b3d24b Restore homepage build script 2025-06-06 08:52:52 +01:00
Benjamin S. Leveritt
dd750fc6e8 Remove ignore scripts
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-06-06 08:52:01 +01:00
Benjamin S. Leveritt
814d99e0bc Remove app name from examples 2025-06-06 08:02:38 +01:00
Benjamin S. Leveritt
0eb70c2171 Investigating what turbo-ignore defaults to on Vercel 2025-06-06 07:52:42 +01:00
Benjamin S. Leveritt
64e787a57f Remove app name 2025-06-06 07:25:11 +01:00
Benjamin S. Leveritt
1e8c3df83e Remove app name, as we no longer use it 2025-06-06 07:24:50 +01:00
Benjamin S. Leveritt
5013b1d97d Add prosekit 2025-06-06 07:24:27 +01:00
Benjamin S. Leveritt
c4837b9b92 Add ignore to organization 2025-06-06 07:10:41 +01:00
Benjamin S. Leveritt
e527cb676b Fix clerk vercel config 2025-06-06 07:02:55 +01:00
Benjamin S. Leveritt
2c75c46029 Adds turbo-ignore to examples 2025-06-06 07:00:38 +01:00
Benjamin S. Leveritt
f92f65cc28 Trying turbo-ignore 2025-06-06 06:51:17 +01:00
Benjamin S. Leveritt
d88a94bc68 Lets see what refs we have 2025-06-05 21:26:09 +01:00
Guido D'Orsi
e9bf27467f Merge pull request #2445 from garden-co/docs/rnqc-provider
docs: RNQuickCrypto provider docs
2025-06-05 21:57:49 +02:00
Sammii
c9bd778c03 Merge pull request #2456 from garden-co/feat/create-team-profile-pages
Feat/create team profile pages
2025-06-05 21:30:39 +02:00
Sammii
c3832ad794 fix formatting qualms 2025-06-05 19:26:58 +01:00
Sammii
9b807cbba9 updating gios name 2025-06-05 19:15:21 +01:00
Sammii
32fd3cab19 creating individual team member profiles 2025-06-05 19:12:39 +01:00
Sammii
7502dba11b add Brad to team page 2025-06-05 18:43:33 +01:00
Guido D'Orsi
e9baf69126 Merge pull request #2439 from garden-co/emil/addMember-error-message
fix: clarify `Group.addMember` error message
2025-06-05 19:28:52 +02:00
Trisha Lim
f597d64423 homepage alignment fix (#2453) 2025-06-05 18:22:47 +01:00
Trisha Lim
5c8ce99ab5 Merge pull request #2449 from garden-co/feat/updated-created-dates
docs and example for _createdAt and _lastUpdatedAt
2025-06-05 18:10:38 +01:00
Joe Innes
679ca6c36b docs: ✏️ Update README files to reflect changes in local sync server setup (#2444)
* docs: ✏️ Update README files to reflect changes in local sync server setup

- Changed instructions for running a local sync server to use `sync` parameter format: `{ peer: "ws://localhost:4200" }`.
- Updated multiple example README files for consistency across projects.

* Restore the example in the music player for reference
2025-06-05 18:09:34 +01:00
Emil Sayahi
e6130219fe fix: explicitly check if other account is admin 2025-06-05 10:03:45 -07:00
Trisha Lim
046075288b docs: _createdAt and _lastUpdatedAt 2025-06-05 17:38:54 +01:00
Trisha Lim
57fa927640 use history utility functions in version history app 2025-06-05 17:28:14 +01:00
Brad Anderson
b45bf9248e docs: RNQuickCrypto provider docs 2025-06-05 11:05:03 -04:00
Emil Sayahi
6c2b8a8f8f fix(addMember): clarify admins demoting admins 2025-06-05 07:54:41 -07:00
Benjamin S. Leveritt
7be49602dd Remove ignoreCommand from clerk 2025-06-05 13:11:19 +01:00
Benjamin S. Leveritt
cb73d474a6 Check previous SHA is accessible for turbo, with fallback 2025-06-05 13:11:19 +01:00
Benjamin S. Leveritt
cd03cb77f5 Add checks to other examples
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-06-05 13:11:19 +01:00
Benjamin S. Leveritt
d9d5662b7a Add more inputs for turbo 2025-06-05 13:11:19 +01:00
Benjamin S. Leveritt
39cd197494 Fallback to main checks 2025-06-05 13:11:19 +01:00
Benjamin S. Leveritt
5397fb27bc Clean up imports 2025-06-05 13:11:18 +01:00
Benjamin S. Leveritt
f0bfdc3f5f Dependency checking with Turbo 2025-06-05 13:11:18 +01:00
Benjamin S. Leveritt
5f45036e2a Add ignore to form
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-06-05 13:11:18 +01:00
Benjamin S. Leveritt
20eab19676 Compare to last successful deployment
Hopefully this works better against derivative branches

Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-06-05 13:11:18 +01:00
Benjamin S. Leveritt
6af2feb2e7 Check current project path 2025-06-05 13:11:18 +01:00
Benjamin S. Leveritt
60df32ba05 Try with chat first 2025-06-05 13:11:18 +01:00
Benjamin S. Leveritt
90f36e61d6 Optimize turbo.json for better caching and build performance 2025-06-05 13:11:17 +01:00
Benjamin S. Leveritt
2d27cd5356 Add enhanced Vercel build ignore script with intelligent change detection 2025-06-05 13:11:17 +01:00
Nikos Papadopoulos
0262b9d501 Merge pull request #2438 from garden-co/nikos-example_apps_updates
- Integrates prosekit example app in monorepo
- Updates URLs in all applicable apps in https://jazz.tools/examples to follow the format: app-name.demo.jazz.tools
- Updates URLs in all applicable example apps README files
- Renames richtext example app to richtext-prosemirror
- Moves Svelte example apps above Vue example apps
- Adds jazz.tools entries for richtext prosekit, richtext tiptap
2025-06-05 13:32:40 +02:00
Nikos Papadopoulos
115e22c89d updates pnpm-lock.yaml after merge from main 2025-06-05 12:24:56 +01:00
Nikos Papadopoulos
687d9bbbff Merge branch 'main' into nikos-example_apps_updates 2025-06-05 12:22:50 +01:00
Benjamin S. Leveritt
56ad6379d9 Merge pull request #2443 from garden-co/fix-design-system-build
Fix build for design system
2025-06-05 12:17:27 +01:00
Benjamin S. Leveritt
481ffa1d96 Add package manager 2025-06-05 12:12:08 +01:00
Guido D'Orsi
a383c7e984 Merge pull request #2432 from garden-co/changeset-release/main
Version Packages
2025-06-05 13:11:13 +02:00
github-actions[bot]
8ca283147d Version Packages 2025-06-05 11:04:14 +00:00
Guido D'Orsi
c3d87796ed chore: update changeset 2025-06-05 13:00:37 +02:00
Guido D'Orsi
cb88caced9 fix(comap): return a valid value on _createdAt even when setting a custom uniqueness value 2025-06-05 12:58:26 +02:00
Guido D'Orsi
6313ead62d Revert "fix: use creation time from CoValue header"
This reverts commit cc0479afe0.
2025-06-05 12:38:23 +02:00
Guido D'Orsi
f674910aa9 Merge pull request #2426 from garden-co/emil/comap-time-getters
feat: `_createdAt` and `_lastUpdatedAt`
2025-06-05 12:23:23 +02:00
Guido D'Orsi
37fc25f5a6 Merge pull request #2434 from garden-co/fix/svelte-costate
Fix id reactivity on CoState for Svelte 5.33 (second try)
2025-06-05 12:22:19 +02:00
Guido D'Orsi
5e9c338c27 Merge pull request #2436 from garden-co/feat/react-19-updates
fix(react-19): optimize re-renders when the values are already in memory
2025-06-05 12:21:55 +02:00
Guido D'Orsi
4b61f7c7a5 chore: format 2025-06-05 12:20:58 +02:00
Guido D'Orsi
1c8472ffbd Merge pull request #2441 from garden-co/fix/union-schema-conversion
Fix union schemas in anySchemaToCoSchema
2025-06-05 12:19:33 +02:00
Benjamin S. Leveritt
9dba68ac36 Remove migration script
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-06-05 11:18:29 +01:00
Anselm
13b57aa576 Add changeset 2025-06-05 11:10:05 +01:00
Anselm
aedf0f3ac5 Fix union schemas in anySchemaToCoSchema 2025-06-05 11:09:06 +01:00
Benjamin S. Leveritt
7fa61644b0 Revert turbo.json to original state 2025-06-05 10:19:22 +01:00
Nikos Papadopoulos
dbc6342222 renames api-key.ts to apiKey.ts 2025-06-05 10:16:53 +01:00
Benjamin S. Leveritt
12389c82f9 Add migration script to update all projects to enhanced ignore script 2025-06-05 10:05:16 +01:00
Benjamin S. Leveritt
4c03a17d3a Optimize turbo.json for better caching and build performance 2025-06-05 10:04:51 +01:00
Benjamin S. Leveritt
5d1ea45a9c Add enhanced Vercel build ignore script with change detection 2025-06-05 10:04:34 +01:00
Emil Sayahi
780961d46f fix: show role of current account 2025-06-04 16:01:45 -07:00
Emil Sayahi
cc0479afe0 fix: use creation time from CoValue header 2025-06-04 15:45:59 -07:00
Emil Sayahi
c102f18b62 Update mean-turkeys-turn.md 2025-06-04 15:15:13 -07:00
Emil Sayahi
57fb69fa6f chore: changeset 2025-06-04 15:14:41 -07:00
Emil Sayahi
8985e2d4ff fix: clarify addMember error message 2025-06-04 15:12:55 -07:00
Emil Sayahi
cfb6786468 feat(jazz-expo): API for clearing local DB (#2427)
* feat(jazz-expo): API for clearing local DB

todo:
- tests
- changeset

* Revert "feat(jazz-expo): API for clearing local DB"

This reverts commit 459e1d04ea.

* feat(jazz-expo): API for clearing local DB

* chore: changeset

* Update .changeset/plenty-ways-smash.md

Co-authored-by: Guido D'Orsi <guido@garden.co>

---------

Co-authored-by: Guido D'Orsi <guido@garden.co>
2025-06-04 12:35:04 -07:00
Emil Sayahi
5662faa9c0 chore: changeset 2025-06-04 12:10:15 -07:00
Emil Sayahi
3e7d9cb585 feat: tests 2025-06-04 12:08:56 -07:00
Nikos Papadopoulos
ec65ba74a8 reorders example apps 2025-06-04 18:52:23 +01:00
Nikos Papadopoulos
f679e6b392 updates richtext-prosemirror vercel configuration 2025-06-04 18:49:11 +01:00
Nikos Papadopoulos
3bcaa81c17 updates pnpm-lock.yaml 2025-06-04 18:34:27 +01:00
Guido D'Orsi
2116a598ae fix(react-19): optimize re-renders when the values are already in memory 2025-06-04 19:34:12 +02:00
Nikos Papadopoulos
8a00392894 adds attribution in prosekit example app README 2025-06-04 18:28:03 +01:00
Nikos Papadopoulos
f3f2e85c53 removes obsolete files 2025-06-04 18:27:17 +01:00
Nikos Papadopoulos
0ff08e9893 moves richtext example to richtext-prosemirror 2025-06-04 18:26:28 +01:00
Nikos Papadopoulos
ca517517f9 updates pnpm-lock.yaml 2025-06-04 18:07:33 +01:00
Nikos Papadopoulos
55bdbbf12e Merge branch 'main' into nikos-example_apps_updates 2025-06-04 17:55:49 +01:00
Nikos Papadopoulos
5c7a7d0f7c updates the homepage example apps URLs 2025-06-04 17:54:55 +01:00
Nikos Papadopoulos
af388c11d5 updates example apps README files, adds new apps to example page 2025-06-04 17:43:05 +01:00
Nikos Papadopoulos
df255f850f adds prosekit example app 2025-06-04 16:43:58 +01:00
Guido D'Orsi
d14a069a12 Fix id reactivity on CoState for Svelte 5.33 (second try) 2025-06-04 16:11:14 +02:00
Anselm Eickhoff
aacef80994 Merge pull request #2433 from garden-co/fix/team-page
update team page, adding me and making all socials the same order
2025-06-04 14:46:10 +01:00
Sammii
2a237e5d32 amending file .ext 2025-06-04 14:39:27 +01:00
Sammii
0fe30eca0b update team page, adding me and making all socials the same order 2025-06-04 14:23:40 +01:00
Guido D'Orsi
dea7a8dfd9 Merge pull request #2282 from Wizzel1/Add-missing-discriminator
Add missing discriminator
2025-06-04 15:21:29 +02:00
Guido D'Orsi
ab7191bed0 Merge remote-tracking branch 'origin/main' into Add-missing-discriminator 2025-06-04 15:12:14 +02:00
Guido D'Orsi
901b7c0a51 Merge pull request #2377 from garden-co/2376-groupmakepublic-as-an-alias
Add makePublic to group
2025-06-04 15:02:05 +02:00
Benjamin S. Leveritt
17bea5975c Merge pull request #2430 from garden-co/test-create-jazz-app
Test `create-jazz-app`
2025-06-04 12:54:56 +01:00
Benjamin S. Leveritt
e005ecd0a1 Add changeset 2025-06-04 12:08:27 +01:00
Benjamin S. Leveritt
e7e505e5f3 Add changeset 2025-06-04 12:03:58 +01:00
Benjamin S. Leveritt
d6ffe03d3c Add makePublic to docs 2025-06-04 12:02:18 +01:00
Benjamin S. Leveritt
1120747a24 Add makePublic alias to some example apps 2025-06-04 11:50:24 +01:00
Benjamin S. Leveritt
1e2d7d1c4e Add makePublic to group 2025-06-04 11:44:06 +01:00
Benjamin S. Leveritt
e26f110acd Merge pull request #2428 from garden-co/feature/co-map-migrations
Tweak CoMap migration copy and examples
2025-06-04 11:37:21 +01:00
Benjamin S. Leveritt
28f84a4ee6 Update lock 2025-06-04 11:31:36 +01:00
Benjamin S. Leveritt
cffe4abb84 Handle SIGINT gracefully 2025-06-04 11:21:00 +01:00
Benjamin S. Leveritt
2e0b7cee8c Refactor package manager detection into utils 2025-06-04 11:21:00 +01:00
Benjamin S. Leveritt
d3b47f59e8 Add automatic tests 2025-06-04 11:21:00 +01:00
Benjamin S. Leveritt
aea3287965 Merge pull request #2373 from lukahartwig/main
Set default package manager based on command runner
2025-06-04 11:17:25 +01:00
Benjamin S. Leveritt
6525f8a12e Merge pull request #2325 from garden-co/2324-turbo-dev-doesnt-need-to-build-the-local-package
Turbo just builds deps now
2025-06-04 09:11:16 +01:00
Benjamin S. Leveritt
fe4c934a4b Tweak copy and examples in the docs 2025-06-04 08:26:05 +01:00
Emil Sayahi
60261c8dba feat: _createdAt and _lastUpdatedAt 2025-06-03 13:34:55 -07:00
Guido D'Orsi
7411049faa Merge pull request #2423 from garden-co/changeset-release/main
Version Packages
2025-06-03 19:48:03 +02:00
github-actions[bot]
356b06559b Version Packages 2025-06-03 17:45:08 +00:00
Guido D'Orsi
193738cfe2 Merge pull request #2405 from garden-co/feature/co-map-migrations
feat: add support for coMap migrations
2025-06-03 19:40:53 +02:00
Guido D'Orsi
ddb74fa167 docs: remove unused import 2025-06-03 19:35:31 +02:00
Guido D'Orsi
aca5642671 Merge pull request #2422 from garden-co/changeset-release/main
Version Packages
2025-06-03 19:27:45 +02:00
github-actions[bot]
a5bed20c4a Version Packages 2025-06-03 17:25:46 +00:00
Guido D'Orsi
09bf53a8d3 Merge pull request #2421 from garden-co/fix/react-native-account-schema
fix: fix the AccountSchema prop type to accept co.account schemas
2025-06-03 19:22:11 +02:00
Guido D'Orsi
061ec996b1 fix: F=fix the AccountSchema prop type to accept co.account schemas 2025-06-03 19:17:19 +02:00
Guido D'Orsi
a7ee0465b5 docs: small fix 2025-06-03 18:35:04 +02:00
Guido D'Orsi
e995d8a1fe chore: fix type issue in todo example 2025-06-03 17:50:17 +02:00
Guido D'Orsi
5ccb48446e docs: cover CoMap migrations 2025-06-03 17:46:12 +02:00
Guido D'Orsi
04b20c2e42 fix: fix castAs for Zod schemas and make the CoMap migrations stable 2025-06-03 17:14:59 +02:00
Benjamin S. Leveritt
7aae2441a1 Merge pull request #2231 from garden-co/2223-history-and-time-travel-doc
2223-history-and-time-travel-doc
2025-06-03 14:35:30 +01:00
Benjamin S. Leveritt
650e95a528 Merge pull request #2414 from garden-co/2412-fix-jazz-vue-builds-following-014
Add typecheck to jazz-vue before build
2025-06-03 14:34:53 +01:00
Benjamin S. Leveritt
3d80ab11d9 Minor tweak for efficiency 2025-06-03 14:32:59 +01:00
Benjamin S. Leveritt
85e6489a3e Add note about finding from field.all and chronological order 2025-06-03 14:30:03 +01:00
Benjamin S. Leveritt
45b6c87ade Fix chronological order notes 2025-06-03 14:16:39 +01:00
Guido D'Orsi
edadc4b986 Merge pull request #2411 from garden-co/fix/id-reactivity
fix: fix id reactivity in CoState for svelte > 5.33
2025-06-03 15:06:56 +02:00
Benjamin S. Leveritt
455b722357 Add typecheck before build 2025-06-03 13:25:53 +01:00
Benjamin S. Leveritt
ad2e1d1e98 Suppress the supressions
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-06-03 13:17:37 +01:00
Benjamin S. Leveritt
7c94b70c31 Add biome linting 2025-06-03 12:53:00 +01:00
Benjamin S. Leveritt
74bcf1752e Update Provider types 2025-06-03 12:16:42 +01:00
Guido D'Orsi
97a54b3911 fix: revert changes on src/lib/jazz.class.svelte.ts 2025-06-03 13:07:23 +02:00
Benjamin S. Leveritt
c393c8880f Fix import 2025-06-03 11:41:20 +01:00
Guido D'Orsi
359157fa70 chore: add comment 2025-06-03 12:40:02 +02:00
Guido D'Orsi
62d9680449 chore: update vite to the latest version 2025-06-03 12:38:45 +02:00
Trisha Lim
db6067439d fix missing date 2025-06-03 11:26:51 +01:00
Guido D'Orsi
5051d6a410 fix: fix id reactivity in CoState for svelte > 5.33 2025-06-03 12:23:18 +02:00
Trisha Lim
25efaf30f5 add docs for storing createdAt manually 2025-06-03 11:18:37 +01:00
Trisha Lim
98aadd9842 Show date created on version history example 2025-06-03 11:17:54 +01:00
Trisha Lim
d555b18c11 test homepage routes (#2399)
* test homepage routes

* add playwright.yml to homepage dir

* Revert "add playwright.yml to homepage dir"

This reverts commit f0507ee4f7dd29d25db56d3227937c901f9225a0.

* Add turbo dep to homepage

* Split homepage playwright script out

* remove playwright from test command

* install homepage deps

* update lock file

---------

Co-authored-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-06-03 09:25:28 +01:00
Benjamin S. Leveritt
550111f8a1 Merge pull request #2408 from garden-co/2407-remove-api-reference-from-build
Remove api references from build
2025-06-02 21:05:16 +01:00
Trisha Lim
3d4a00a19d Merge pull request #2409 from garden-co/fix/expo-dark-logo
fix: expo logo color on dark mode
2025-06-02 21:03:41 +01:00
Benjamin S. Leveritt
d06c6677dc Purge typedoc dep 2025-06-02 20:45:31 +01:00
Trisha Lim
ce30f3c4ff fix: expo logo color on dark mode 2025-06-02 20:32:23 +01:00
Benjamin S. Leveritt
1072b9c2fe Remove api ref docs from llms.txt 2025-06-02 20:28:24 +01:00
Benjamin S. Leveritt
5ea41c69ef Remove all the references to API refs 2025-06-02 20:18:11 +01:00
Guido D'Orsi
2d8eed3b69 chore: remove unused var 2025-06-02 21:13:59 +02:00
Benjamin S. Leveritt
45c9c8558f Remove build script 2025-06-02 20:08:19 +01:00
Guido D'Orsi
dccb80edf0 fix: quick fix layout overflows and restore automatic next song 2025-06-02 21:07:58 +02:00
Guido D'Orsi
6f72419b6e feat: add support for coMap migrations 2025-06-02 20:23:52 +02:00
Guido D'Orsi
fc55e5c8e8 Merge pull request #2384 from garden-co/changeset-release/main
Version Packages
2025-06-02 18:29:42 +02:00
github-actions[bot]
4a74ccf399 Version Packages 2025-06-02 16:23:15 +00:00
Guido D'Orsi
a442315995 Merge pull request #2266 from garden-co/feat/encrypt-decrypt-rnqc
feat: enable RNQC for encrypt/decrypt
2025-06-02 18:18:41 +02:00
Brad Anderson
0d5ee3ed07 feat: enable RNQC for encrypt/decrypt 2025-06-02 12:16:31 -04:00
Guido D'Orsi
4e32cae8a7 feat: make the packages versions fixed 2025-06-02 16:19:28 +02:00
Guido D'Orsi
49d721a29b fix: add prosemirror and tiptap to the linked changeset 2025-06-02 16:18:44 +02:00
Guido D'Orsi
2c6d27598d Merge pull request #2397 from garden-co/fix/recursive-profile-discriminated-union
fix: make checks on the discriminator field on z.discriminatedUnion more specific and less strict
2025-06-02 16:16:25 +02:00
Guido D'Orsi
e637cb0700 fix: restore implicit discriminators support 2025-06-02 14:37:55 +02:00
Trisha Lim
c42848ece9 Merge pull request #2275 from garden-co/improvement/supported-env
homepage: supported env section, take svelte out of experimental
2025-06-02 13:36:23 +01:00
Benjamin S. Leveritt
841a818dff Merge pull request #2330 from garden-co/2323-update-docs-with-coloaded
Replace `Account` and `Loaded` with `co.account` and `co.loaded` (respectively)
2025-06-02 12:07:26 +01:00
Benjamin S. Leveritt
f74881a3fe Remove me 2025-06-02 12:05:35 +01:00
Guido D'Orsi
c559054378 fix: add support for optional dates 2025-06-02 12:55:33 +02:00
Guido D'Orsi
d6d9c0adcb fix: make checks on the discriminator field on z.discriminatedUnion more specific and less strict 2025-06-02 12:31:05 +02:00
Guido D'Orsi
cdf9b5a71c Merge pull request #2391 from garden-co/fix/recursive-profile-discriminated-union
fix: support for recursive props on co.profile and for co.image inside z.discriminatedUnion
2025-06-02 12:00:37 +02:00
Guido D'Orsi
4b950bce14 fix: support for recursive props on co.profile and for co.image inside z.discriminatedUnion 2025-06-02 11:48:54 +02:00
Benjamin S. Leveritt
8343d8f0fe Formats co.texts with backticks 2025-06-02 10:45:40 +01:00
Benjamin S. Leveritt
eeb280f17b Replace Account with co.account 2025-06-02 10:45:39 +01:00
Benjamin S. Leveritt
a927334b40 Replaces Loaded with co.loaded 2025-06-02 10:45:39 +01:00
Benjamin S. Leveritt
be0c1bcda5 Merge pull request #2367 from joeinnes/patch-2
Remove unnecessary console.log
2025-06-02 10:30:58 +01:00
Trisha Lim
b861daca60 Merge pull request #2386 from garden-co/tobiaslins-patch-1
[website] Use `/next` import for analytics
2025-06-01 18:45:18 +01:00
Benjamin S. Leveritt
b4cd307eba Merge pull request #2383 from garden-co/update-team
update team page
2025-05-31 16:44:50 +01:00
Tobias Lins
1d0e83d3fa Update layout.tsx 2025-05-31 17:05:18 +02:00
Guido D'Orsi
be7c4c29a1 chore: changeset 2025-05-30 14:42:32 +02:00
Trisha Lim
ffa4db0b61 update team page 2025-05-29 21:09:15 +02:00
Trisha Lim
7daf992c51 Merge pull request #2382 from garden-co/fix/sync-link
fix link to self-host docs
2025-05-29 20:57:19 +02:00
Trisha Lim
333c583265 fix link to self-host docs 2025-05-29 20:43:32 +02:00
Luka Hartwig
fa2227716f Remove return type 2025-05-27 23:08:56 +02:00
Guido D'Orsi
bfa5e14112 Merge pull request #1992 from boorad/feat/rn-sqlite-sync
refactor: RN sqlite adapters
2025-05-27 20:44:55 +02:00
Luka Hartwig
38dabd4602 Set default package manager based on command runner 2025-05-27 16:34:40 +02:00
Brad Anderson
dcdf89bba7 fix: re-enable android build in e2e run script 2025-05-26 11:50:36 -04:00
Brad Anderson
a6e6939015 chore: sync app namespace & e2e tests 2025-05-26 11:50:36 -04:00
Brad Anderson
71aa24054d chore: lock file after rebase 2025-05-26 11:50:36 -04:00
Guido D'Orsi
4c88421440 chore: await for WAL 2025-05-26 11:50:36 -04:00
Guido D'Orsi
64bad01d9a fix: fix expo-sqlite run 2025-05-26 11:50:36 -04:00
Brad Anderson
4dfa809a77 fix: update chat-rn landing page, invite clipboard values 2025-05-26 11:50:36 -04:00
Guido D'Orsi
726df167f8 chore: add get function 2025-05-26 11:50:36 -04:00
Guido D'Orsi
2f62cbde13 test: cover the sqlite async with tests 2025-05-26 11:50:36 -04:00
Guido D'Orsi
93ef74219d feat: add sqlite async managers 2025-05-26 11:50:36 -04:00
Guido D'Orsi
495aa81335 feat: configure the max blocking time on RN storage to 30ms 2025-05-26 11:50:36 -04:00
Guido D'Orsi
99caaba328 chore: remove unused import 2025-05-26 11:50:36 -04:00
Guido D'Orsi
4bfcc787a1 chore(sqlite): move the migration logic in SQLiteNodeBase 2025-05-26 11:50:36 -04:00
Guido D'Orsi
7e96eb12dd feat: unify sqlite storage clients 2025-05-26 11:50:35 -04:00
Brad Anderson
a71eba2eb5 chore: bump RN version for ios sim 18.4 bug 2025-05-26 11:50:35 -04:00
Brad Anderson
b129cf9328 fix: rebase main, sync only 2025-05-26 11:50:35 -04:00
Brad Anderson
a6e31c41b7 feat: expo sqlite uses WAL, all sqlite defaults to sync 2025-05-26 11:50:35 -04:00
Brad Anderson
47746ff9ba fix: sourceExts belongs in resolver 2025-05-26 11:50:35 -04:00
Brad Anderson
4e4319a546 fix: rawDBExecute (expo) needs return rows 2025-05-26 11:50:35 -04:00
Brad Anderson
d1de8baf1d fix: initialize must use raw db calls 2025-05-26 11:50:35 -04:00
Brad Anderson
d427a2a13c feat: add sync mode to sqlite client 2025-05-26 11:50:35 -04:00
Brad Anderson
1fa6c3987a refactor: RN sqlite adapters 2025-05-26 11:50:35 -04:00
Joe Innes
ddf49e532f Remove unnecessary console.log 2025-05-26 17:38:14 +02:00
Guido D'Orsi
a0c4ef72ef Merge pull request #2366 from garden-co/changeset-release/main
Version Packages
2025-05-26 14:46:53 +02:00
github-actions[bot]
99009a9054 Version Packages 2025-05-26 12:44:40 +00:00
Guido D'Orsi
e512df4eff fix: move to the latest stable version of Zod 2025-05-26 14:42:08 +02:00
pax-k
da3ede8b54 fix(cursor-docs): improved jazz general help rule 2025-05-26 13:29:01 +02:00
pax-k
56ed6d3271 fix(cursor-docs): improved jazz schema generation rule 2025-05-26 13:22:14 +02:00
pax-k
78112bb19a fix(cursor-docs): added jazz schema template 2025-05-26 13:04:39 +02:00
pax-k
ac6b0c6561 Merge branch 'main' of https://github.com/gardencmp/jazz 2025-05-26 12:51:20 +02:00
pax-k
632365a4fb fix(cursor-docs): added llms-full docs and updated the jazz schema generation rule 2025-05-26 12:51:12 +02:00
Guido D'Orsi
14f52dbc4e Merge pull request #2365 from garden-co/changeset-release/main
Version Packages
2025-05-26 12:48:04 +02:00
github-actions[bot]
82e4256e26 Version Packages 2025-05-26 10:07:42 +00:00
Guido D'Orsi
5e253cc717 chore: version bump 2025-05-26 11:12:59 +02:00
Guido D'Orsi
0c1663505c Merge pull request #2363 from garden-co/changeset-release/main
Version Packages
2025-05-26 11:07:20 +02:00
github-actions[bot]
ad85703373 Version Packages 2025-05-25 15:01:21 +00:00
Guido D'Orsi
3a6ec3791c Merge pull request #2364 from garden-co/fix/storage-group-deps
feat(react): API for SSR and Server Components
2025-05-25 16:58:34 +02:00
Guido D'Orsi
f9590f9120 feat(react): API for SSR and Server Components 2025-05-25 16:54:29 +02:00
Guido D'Orsi
706ebf87da Merge pull request #2357 from balazshevesi/main
Fix docs
2025-05-25 16:24:47 +02:00
Guido D'Orsi
00dd317a5d Merge pull request #2362 from garden-co/fix/storage-group-deps
fix(storage): align groups dependencies calculation to LocalNode
2025-05-25 16:24:04 +02:00
Guido D'Orsi
5ced45fb90 test: cover the group dependency loading with a test (temporary) 2025-05-25 15:35:00 +02:00
Guido D'Orsi
23daa7cdde fix(storage): align groups dependencies calculation to LocalNode 2025-05-25 14:34:50 +02:00
Guido D'Orsi
c018752c0c Merge pull request #2361 from garden-co/changeset-release/main
Version Packages
2025-05-24 22:54:04 +02:00
github-actions[bot]
ba3bdcc268 Version Packages 2025-05-24 20:31:26 +00:00
Guido D'Orsi
4177f6f92c Merge pull request #2360 from garden-co/feat/ssr
feat(react): add experimental_enableSSR
2025-05-24 22:28:20 +02:00
Guido D'Orsi
e32a1f7392 feat(react): add experimental_enableSSR 2025-05-24 19:11:23 +02:00
Guido D'Orsi
7c43fd37ae Merge pull request #2358 from garden-co/feat/improve-music-player-mobile
feat(music-player): make the ui usable on mobile
2025-05-24 18:37:59 +02:00
Guido D'Orsi
48168d619b feat(music-player): make the ui usable on mobile 2025-05-24 18:37:15 +02:00
Balazs Hevesi
1b9b9273e5 Update 0-14-0.mdx 2025-05-23 22:18:05 +02:00
Guido D'Orsi
2f4eada56c Merge pull request #2356 from garden-co/changeset-release/main
Version Packages
2025-05-23 21:37:52 +02:00
github-actions[bot]
709b3432d7 Version Packages 2025-05-23 19:33:52 +00:00
Guido D'Orsi
78a7672401 fix: update lockfile 2025-05-23 21:31:34 +02:00
Guido D'Orsi
bb214f0e8b fix: remove react-dom from the peerDependencies 2025-05-23 21:22:22 +02:00
Guido D'Orsi
8706398f74 Merge pull request #2355 from garden-co/changeset-release/main
Version Packages
2025-05-23 20:31:09 +02:00
github-actions[bot]
1502a6b421 Version Packages 2025-05-23 18:15:41 +00:00
Guido D'Orsi
f167112d99 fix: remove react and react-dom dev dependencies due to npm install issues 2025-05-23 20:12:58 +02:00
Guido D'Orsi
d4d6cb3307 Merge pull request #2354 from garden-co/changeset-release/main
Version Packages
2025-05-23 20:01:42 +02:00
github-actions[bot]
9565cdf323 Version Packages 2025-05-23 18:01:27 +00:00
Guido D'Orsi
dfb21ff0f2 fix: add missing deps for sqlite and secure storage 2025-05-23 19:59:08 +02:00
Guido D'Orsi
98d697fafb fix: remove react and react-native dev dependencies 2025-05-23 19:50:54 +02:00
Guido D'Orsi
9150d53f90 Merge pull request #2353 from garden-co/changeset-release/main
Version Packages
2025-05-23 19:46:39 +02:00
github-actions[bot]
ac7ecc278c Version Packages 2025-05-23 17:46:11 +00:00
Guido D'Orsi
99595bc7e3 fix: remove React Native specific steps only for chat-rn-expo 2025-05-23 19:42:45 +02:00
Guido D'Orsi
f5bae09679 fix: remove React Native specific steps as not required anymore 2025-05-23 19:40:51 +02:00
Guido D'Orsi
a7b9ae0b76 Merge pull request #2350 from garden-co/changeset-release/main
Version Packages
2025-05-23 19:24:34 +02:00
github-actions[bot]
196efcf48e Version Packages 2025-05-23 17:23:15 +00:00
Guido D'Orsi
153aa972b3 Merge pull request #2351 from garden-co/fix/chat-rn-expo
fix: fix chat-rn-expo example app
2025-05-23 19:20:25 +02:00
Guido D'Orsi
4508524f77 feat: rename demo to minimal, change React Native template to minimal auth 2025-05-23 19:20:05 +02:00
Guido D'Orsi
e7e9062dff test: disable the chat navigation step on RN expo 2025-05-23 18:44:03 +02:00
Guido D'Orsi
65e8d135c1 fix: React 19 upgrade type fixes 2025-05-23 18:36:54 +02:00
Meg Culotta
0b8e84e22d Merge pull request #2352 from garden-co/feat/2345-add-example-links-to-readmes
Add URL's to live demos in all readme files in examples
2025-05-23 11:15:46 -05:00
Margaret Culotta
7b51e38cf6 Add all other examples 2025-05-23 11:11:57 -05:00
Margaret Culotta
fcc2cbdc93 Add URL's to live demos in all readme files in examples 2025-05-23 11:09:00 -05:00
Guido D'Orsi
5aa13b5afc feat: upgrade to React 19 2025-05-23 17:53:49 +02:00
Guido D'Orsi
dc746a2fc9 chore: changeset 2025-05-23 17:36:38 +02:00
Guido D'Orsi
ca39bae001 fix: fix chat-rn-expo when used as template 2025-05-23 17:35:49 +02:00
Guido D'Orsi
020b12fa32 fix: correct definition of react in peerDependencies 2025-05-23 17:33:26 +02:00
Guido D'Orsi
bfea02c229 Merge pull request #2348 from garden-co/feat/deprecate-with-helpers
fix: deprecate withHelpers
2025-05-23 14:45:01 +02:00
Guido D'Orsi
74e6495beb Merge pull request #2349 from garden-co/feat/default-catch
feat: add shallow support for default/catch
2025-05-23 14:40:01 +02:00
Guido D'Orsi
3fe683206a feat: add shallow support for default/catch 2025-05-23 14:37:15 +02:00
Guido D'Orsi
f869d9a4dd fix: deprecate withHelpers 2025-05-23 14:30:52 +02:00
Guido D'Orsi
0724cfb95e Merge pull request #2344 from garden-co/changeset-release/main
Version Packages
2025-05-23 09:54:27 +02:00
github-actions[bot]
3b7fd14976 Version Packages 2025-05-23 07:54:03 +00:00
Guido D'Orsi
55fbe8a0a8 Merge pull request #2343 from garden-co/feat/back-to-zod
fix: move back to zod and clean up zod re-export
2025-05-23 09:50:45 +02:00
Guido D'Orsi
22c2600ef1 fix: move back to zod and clean up zod re-export 2025-05-23 09:46:36 +02:00
Benjamin S. Leveritt
156167e6d7 Update nav items
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-05-23 07:56:06 +01:00
Guido D'Orsi
d41feafebe Merge pull request #2342 from garden-co/changeset-release/main
Version Packages
2025-05-22 23:33:33 +02:00
github-actions[bot]
05e3e30451 Version Packages 2025-05-22 21:29:40 +00:00
Guido D'Orsi
637ae13131 chore: changeset 2025-05-22 23:26:46 +02:00
Guido D'Orsi
4a601a6441 Merge pull request #2340 from garden-co/fix/zod-fork
fix: switch to our zod fork with RN fixes
2025-05-22 23:24:29 +02:00
Benjamin S. Leveritt
aef84cf2ef Tweak History title
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-05-22 21:15:50 +01:00
Benjamin S. Leveritt
275a26e2c1 Splits history patterns out of history doc
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-05-22 21:12:14 +01:00
Guido D'Orsi
15b422f711 fix: switch to our zod fork with RN fixes 2025-05-22 19:48:58 +02:00
Benjamin S. Leveritt
946ae63070 Fix codeblocks for 0.14
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-05-22 16:38:05 +01:00
Trisha Lim
2e42825971 Merge pull request #2332 from garden-co/fix/passkey-svelte
fix(passkey-svelte): use AccountCoState instead of useAccount
2025-05-22 14:07:22 +01:00
Trisha Lim
089cdb2031 fix(passkey-svelte): use AccountCoState instead of useAccount 2025-05-22 13:55:06 +01:00
Benjamin S. Leveritt
5cfe47ebbe Add history to nav 2025-05-22 13:33:52 +01:00
Benjamin S. Leveritt
6ee0ec755e Minor tweaks 2025-05-22 13:33:52 +01:00
Benjamin S. Leveritt
8ffca202bd Adds type checking plus tweaks 2025-05-22 13:33:51 +01:00
Benjamin S. Leveritt
6d2bcc7490 Rename history doc 2025-05-22 13:30:54 +01:00
Guido D'Orsi
fa3cf6d0c1 Merge pull request #2331 from garden-co/changeset-release/main
Version Packages
2025-05-22 14:26:58 +02:00
github-actions[bot]
d823700a7c Version Packages 2025-05-22 12:23:10 +00:00
Guido D'Orsi
ed472e834a Merge pull request #2329 from garden-co/fix-z-create
fix: reduce the z exported APIs to the ones we support and fix compatible types
2025-05-22 14:18:56 +02:00
Guido D'Orsi
365b0ea3a9 fix: reduce the z exported APIs to the ones we support and fix compatible types 2025-05-22 14:14:39 +02:00
Benjamin S. Leveritt
43c831167f Merge pull request #2328 from garden-co/2327-remove-auto-generated-api-reference-content
Hides the API Ref links
2025-05-22 12:48:00 +01:00
Benjamin S. Leveritt
cac0f1ad2b Hides the API Ref links 2025-05-22 11:10:46 +01:00
Guido D'Orsi
f66b7c1a5a Merge pull request #2326 from garden-co/changeset-release/main
Version Packages
2025-05-22 11:49:26 +02:00
github-actions[bot]
1b57cfc3f6 Version Packages 2025-05-22 09:45:36 +00:00
Guido D'Orsi
a805e27b0a Merge pull request #2322 from garden-co/fix-z-create
fix: fixes create types for CoList, CoRecord, CoFeed and CoFileStream
2025-05-22 11:42:24 +02:00
Guido D'Orsi
9d6d9fe7a5 fix: fixes create types for CoList, CoRecord, CoFeed and CoFileStream 2025-05-22 11:33:03 +02:00
Benjamin S. Leveritt
69709c2cf2 Turbo just builds deps now
What a smol change?
2025-05-22 10:29:42 +01:00
Benjamin S. Leveritt
409758afd0 Adds tests for co.fileStream()'s this 2025-05-22 10:53:46 +02:00
Guido D'Orsi
e0bc532345 Merge pull request #2321 from garden-co/changeset-release/main
Version Packages
2025-05-22 10:14:43 +02:00
github-actions[bot]
87e02c0516 Version Packages 2025-05-22 08:14:27 +00:00
Guido D'Orsi
405f9be7b9 Merge pull request #2320 from garden-co/fix-z-create
fix: fix coMap.create with optional references
2025-05-22 10:10:01 +02:00
Guido D'Orsi
c82bf737bf Merge pull request #2319 from garden-co/fix-z-enum
feat: export the co.loaded alias
2025-05-22 10:08:49 +02:00
Guido D'Orsi
91cbb2f9d4 fix: fix coMap.create with optional types 2025-05-22 09:58:44 +02:00
Guido D'Orsi
cfbba59c6d test: reproduce the create type errors 2025-05-21 20:44:04 +02:00
Guido D'Orsi
b1209e2e09 docs: bring co.loaded in the upgrade guide 2025-05-21 19:38:06 +02:00
Guido D'Orsi
20b3d88135 feat: export the co.loaded alias 2025-05-21 19:25:47 +02:00
Guido D'Orsi
d9ad1f4de5 Merge pull request #2317 from garden-co/changeset-release/main
Version Packages
2025-05-21 18:16:49 +02:00
github-actions[bot]
c90153e0c9 Version Packages 2025-05-21 15:57:01 +00:00
Guido D'Orsi
a4241c0f4b Merge pull request #2315 from garden-co/fix-z-enum
fix: support z.enum
2025-05-21 17:53:00 +02:00
Benjamin S. Leveritt
e1ff7a65a8 Merge pull request #2316 from garden-co/fix-file-share-svelte
fix-file-share-svelte
2025-05-21 16:51:08 +01:00
Guido D'Orsi
011af55446 fix: support z.enum 2025-05-21 17:48:38 +02:00
Benjamin S. Leveritt
e9dbcf53c8 Fix formatting 2025-05-21 16:30:59 +01:00
Benjamin S. Leveritt
3da21b95ec Fix type issues 2025-05-21 16:30:49 +01:00
Benjamin S. Leveritt
a6d0dd07a1 Add type checking to build process
Can’t fathom why it’s not in there by default.
2025-05-21 15:51:25 +01:00
Trisha Lim
e7733a5428 take svelte out of experimental 2025-05-21 14:45:12 +01:00
Benjamin S. Leveritt
ac474c4afb Merge pull request #2313 from garden-co/1888-type-check-every-react-example
Final mop-up for React docs type checks
2025-05-21 13:54:36 +01:00
Benjamin S. Leveritt
afe8e1f3b2 Merge pull request #2312 from garden-co/2311-fix-type-check-on-organization-pattern
Fixes org pattern doc
2025-05-21 13:45:40 +01:00
Benjamin S. Leveritt
b12b3808fa Merge pull request #2310 from garden-co/2212-remove-skiperrorchecking-workaround-in-jazz-react-typedoc-options
Remove typedoc check skip
2025-05-21 13:37:14 +01:00
Benjamin S. Leveritt
08ec8fe709 Fixes org pattern doc 2025-05-21 13:27:52 +01:00
Benjamin S. Leveritt
f70cae6bf6 Final mop-up for React docs type checks
Closes #1888
2025-05-21 13:27:12 +01:00
Benjamin S. Leveritt
59fe373863 Remove typedoc check skip 2025-05-21 13:23:35 +01:00
Guido D'Orsi
be58b4c1d8 Merge pull request #2308 from garden-co/changeset-release/main
Version Packages
2025-05-21 13:47:28 +02:00
github-actions[bot]
96c520ae4d Version Packages 2025-05-21 11:46:24 +00:00
Benjamin S. Leveritt
a9553b4945 Merge pull request #2307 from garden-co/2220-type-check-ImageDefinition
2220-type-check-ImageDefinition
2025-05-21 12:43:43 +01:00
Guido D'Orsi
fa516522e3 Merge pull request #2301 from garden-co/fix/svelte-zod
feat: make jazz-svelte compatible with the 0.14 changes
2025-05-21 13:16:18 +02:00
Benjamin S. Leveritt
59e4b5da54 Add typechecked vanillaJS docs 2025-05-21 11:51:24 +01:00
Benjamin S. Leveritt
2fa3f94b4a Add typechecked React docs 2025-05-21 11:51:07 +01:00
Guido D'Orsi
a2f8461e26 docs: add vanilla and expo 2025-05-21 12:47:50 +02:00
Guido D'Orsi
cabaf079be docs(0-14): svelte upgrade guide, fill todo sections 2025-05-21 12:40:08 +02:00
Trisha Lim
d8de4a7ada Merge pull request #2294 from garden-co/docs/groups-type-check
docs: type check Groups
2025-05-21 10:37:53 +01:00
Benjamin S. Leveritt
e510a544b7 Merge pull request #2300 from garden-co/2220-type-check-filestreams
Fix typechecking for FileStreams
2025-05-21 10:35:38 +01:00
Guido D'Orsi
b2ee30630d feat: make jazz-svelte compatible with the 0.14 changes 2025-05-21 11:11:35 +02:00
Benjamin S. Leveritt
ab0d4f364a Fix typechecking for FileStreams 2025-05-21 09:45:42 +01:00
Trisha Lim
6d9c6ae698 docs: add twoslash type checks to Group Inheritance 2025-05-20 16:01:41 +01:00
Trisha Lim
914af3deae docs: add twoslash type checks to Public Sharing 2025-05-20 15:52:56 +01:00
Trisha Lim
4ad8e9ae78 docs: add twoslash type checks to Groups 2025-05-20 15:29:08 +01:00
Trisha Lim
1e0b496555 docs: add twoslash type check to CoLists, CoFeeds (#2281)
* docs: add twoslash type check to CoLists

* revert to not using a list type

* twoslash type check for CoFeed
2025-05-20 15:04:24 +01:00
Guido D'Orsi
0088aa8b25 Merge pull request #2292 from garden-co/changeset-release/main
Version Packages
2025-05-20 15:48:40 +02:00
github-actions[bot]
35a66df1e4 Version Packages 2025-05-20 12:52:45 +00:00
Guido D'Orsi
3b2fa64a82 Merge pull request #2291 from garden-co/fix/test
fix: restore custom AccountSchema support in testing utils
2025-05-20 14:46:22 +02:00
Guido D'Orsi
3d1027f278 chore: changeset 2025-05-20 14:46:04 +02:00
Guido D'Orsi
cc78386163 Merge pull request #2290 from garden-co/feat/extand-parent
feat: make possible to extend a group without having access to it
2025-05-20 14:17:56 +02:00
Guido D'Orsi
c240eed6a4 fix: Fix custom AccountSchema support in testing utils 2025-05-20 13:19:59 +02:00
Guido D'Orsi
2a9b7f5d52 test: more tests on group extend 2025-05-20 12:44:31 +02:00
Guido D'Orsi
f2fbd29de5 feat: make possible to extend a group without having access to it 2025-05-20 11:54:11 +02:00
Benjamin S. Leveritt
c960176a2a Merge pull request #2285 from garden-co/update-subscriptions-and-loading-for-zod
Update subscriptions and loading docs for 0.14
2025-05-20 06:43:46 +01:00
Benjamin S. Leveritt
fd4bae4cc1 Replace Resolved with Loaded 2025-05-19 22:16:41 +01:00
Benjamin S. Leveritt
ae32b7c19b Updates code expamples 2025-05-19 22:07:55 +01:00
Guido D'Orsi
83986c6699 Merge pull request #2270 from garden-co/changeset-release/main
Version Packages
2025-05-19 21:39:10 +02:00
github-actions[bot]
59a4e2cee3 Version Packages 2025-05-19 19:32:13 +00:00
Trisha Lim
d2a971c86c fix: update plaintext init to zod (#2283) 2025-05-19 20:29:15 +01:00
Trisha Lim
aae9ef49da improvement: org design pattern docs (#2253) 2025-05-19 19:38:05 +01:00
Trisha Lim
58c5ee5c73 form design pattern docs: emphasize not having a save button (#2241)
* form design pattern docs: emphasize not having a save button

* rewording to follow diataxis

* fix: instructions field shows undefined
2025-05-19 19:37:40 +01:00
Wizzel1
e88252bee4 Fix formatting 2025-05-19 20:20:52 +02:00
Wizzel1
a6b7857f6f Fix markdown formatting 2025-05-19 20:06:28 +02:00
Wizzel1
265c30158e Fix markdown formatting 2025-05-19 19:59:56 +02:00
Wizzel1
505e132f1e Run format script 2025-05-19 19:53:12 +02:00
Wizzel1
c6d5195cb5 Update tests 2025-05-19 19:48:22 +02:00
Wizzel1
8af543e7d6 Update docs 2025-05-19 19:48:17 +02:00
Wizzel1
016b2098a7 Update example 2025-05-19 19:48:11 +02:00
Trisha Lim
f1d6097ee6 fix: twoslash breaks page scroll (#2267) 2025-05-19 17:37:35 +01:00
Anselm
3172a61543 Explain Loaded 2025-05-19 16:47:40 +01:00
Trisha Lim
4683cc7ada homepage: redesign supported env section 2025-05-19 16:29:43 +01:00
Anselm
25324c28d9 Mention RN issue 2025-05-19 16:26:28 +01:00
Anselm
f74cb4885a Upgrade guide progress 2025-05-19 15:59:53 +01:00
Guido D'Orsi
4130213d82 Merge pull request #2271 from garden-co/fix/account-profile
fix: force sync of the group after acceptInvite
2025-05-19 15:35:04 +02:00
Guido D'Orsi
c36a26e669 test: update sync snapshots 2025-05-19 15:22:45 +02:00
Guido D'Orsi
c8b33ad7f1 fix: force sync of the group after acceptInvite 2025-05-19 15:14:41 +02:00
Benjamin S. Leveritt
a79489683e Merge pull request #2246 from joeinnes/2245-svelte-provider
add Svelte provider documentation and metadata
2025-05-19 14:09:08 +01:00
Guido D'Orsi
1251fb89b1 Merge pull request #2269 from garden-co/fix/account-profile
fix: make the profile access on Group members trigger updates correctly
2025-05-19 15:07:13 +02:00
Guido D'Orsi
cdfc10557a fix: make the profile access on Group members trigger updates correctly 2025-05-19 15:01:30 +02:00
Anselm
6e0481114c Fix homepage type errors 2025-05-19 13:50:40 +01:00
Anselm
f7e157d2f5 Make docNavigationItems js again 2025-05-19 13:35:10 +01:00
Anselm
ce83f101c7 More skeleton for the upgrade guide 2025-05-19 13:01:24 +01:00
Anselm Eickhoff
c3c723776e Merge pull request #2268 from garden-co/changeset-release/main
Version Packages
2025-05-19 12:57:06 +01:00
github-actions[bot]
33d7789530 Version Packages 2025-05-19 11:53:38 +00:00
Anselm Eickhoff
dcd7398b06 Merge pull request #2150 from garden-co/feature/zod-horribly
Zod support (using a schema translation layer)
2025-05-19 12:51:00 +01:00
Anselm
c3dd8d0271 Upgrade guide skeleton 2025-05-19 12:50:15 +01:00
Anselm
afe0accad5 Merge branch 'main' into feature/zod-horribly 2025-05-19 12:37:47 +01:00
Anselm
5835ed1274 Add changeset 2025-05-19 12:37:15 +01:00
Anselm
c5a6b87885 Fix betterauth example 2025-05-19 12:35:11 +01:00
Trisha Lim
294678e18e update thumbnail and desc for hend app (#2259) 2025-05-19 12:34:46 +01:00
Trisha Lim
9bb90489f8 feat(docs): link to Previous and Next pages (#2258) 2025-05-19 12:34:34 +01:00
Anselm
67efefde3f Merge branch 'main' into feature/zod-horribly 2025-05-19 12:32:37 +01:00
Anselm
5b28545714 More docs and allow broken homepage samples 2025-05-19 12:26:57 +01:00
Guido D'Orsi
b4352e38aa test: add await on group.removeMember 2025-05-19 13:16:21 +02:00
Guido D'Orsi
8015b8099b test: disable RetryUnavailable flaky test 2025-05-19 13:12:55 +02:00
Anselm
ee451ebd67 Port FileStreams docs (some schema methods missing) 2025-05-19 12:02:00 +01:00
Anselm
9dcd70c896 Port CoFeed docs 2025-05-19 11:56:07 +01:00
Anselm
bcacd04773 Post CoList docs 2025-05-19 11:53:32 +01:00
Anselm
65f20184e5 Port CoMap docs 2025-05-19 11:50:51 +01:00
Anselm
0c1817e5a4 Port accounts-and-migrations 2025-05-19 11:38:23 +01:00
Guido D'Orsi
addd31d43d test: disable RetryUnavailable flaky test 2025-05-19 12:25:54 +02:00
Giordano Ricci
53a02511e1 Merge pull request #2254 from garden-co/gio/betterauth-shadcn
Rework betterauth example
2025-05-19 11:24:18 +01:00
Anselm
c66aa631b3 Remove references to guide for now 2025-05-19 11:14:03 +01:00
Anselm
49a84bd8c5 Make .by and .members props again 2025-05-19 10:56:39 +01:00
Giordano Ricci
218ec7eb8d Merge branch 'main' into gio/betterauth-shadcn 2025-05-19 10:53:33 +01:00
Giordano Ricci
54f313e41e chore: readme & .env 2025-05-19 09:46:03 +01:00
Anselm
f14d971a75 Fix useAcceptInvite in jazz-react-native-core 2025-05-19 09:15:31 +01:00
Anselm
5290452e52 Fix CoList schema bug 2025-05-19 08:48:47 +01:00
Anselm
f49c24807a Upgrade to latest zod 2025-05-18 20:50:06 +01:00
Anselm Eickhoff
938f6767e4 add zod sponsor message 2025-05-18 20:30:23 +01:00
Anselm
b053369589 Make primitive objects & arrays actually work 2025-05-18 20:11:32 +01:00
Anselm
42c7f48c52 Fix CoFeed Proxy stuff and typecheck org example 2025-05-18 18:07:02 +01:00
Anselm
cd3c2cbe81 Move CoFeed entries into perAccount subobject 2025-05-18 17:39:21 +01:00
Anselm
e55bcafedb Make remaining tests pass 2025-05-18 17:03:41 +01:00
Anselm
dd3f7b5685 Make remaining examples build 2025-05-18 16:57:42 +01:00
Anselm
bde9d7637d Fix more examples 2025-05-18 16:36:49 +01:00
Anselm
b3f1bba17f Port all example apps except richtext and vue 2025-05-18 16:22:36 +01:00
Anselm
eb33fe6cf0 Handle non-collaborative objects & arrays 2025-05-18 15:25:04 +01:00
Anselm
54cf1b5906 Fix file name typo 2025-05-18 15:15:10 +01:00
Anselm
c7f48a0750 Split zod schema stuff into files 2025-05-18 15:13:01 +01:00
Anselm
f0419c5cde Port a bunch more apps, fix more stuff 2025-05-18 14:19:00 +01:00
Anselm
500ceb593c Add FileStreamSchema.createFromBlob, start working through examples 2025-05-18 11:09:04 +01:00
Anselm
51251fd87c Fix react package types 2025-05-18 10:28:26 +01:00
Anselm
ce27b1d6f9 Properly implement co.profile and inbox (all jazz-tools tests pass) 2025-05-18 10:25:53 +01:00
Anselm
dc46e36281 Merge branch 'emil/comap-doc-typecheck' into feature/zod-horribly 2025-05-17 22:58:10 +01:00
Anselm
b2bef6ffc2 Update intro & schema docs 2025-05-17 22:54:23 +01:00
Anselm
2766009ce6 Get rid of registered accounts 2025-05-17 22:04:22 +01:00
Anselm
8f88b212c1 Attempt to make form example work 2025-05-17 21:25:20 +01:00
Anselm
32e0133468 Extra changes after merge 2025-05-17 19:32:24 +01:00
Anselm
bf88604943 Merge branch 'main' into feature/zod-horribly 2025-05-17 19:32:11 +01:00
Anselm
9b66fde52d Add co.richText() 2025-05-17 17:43:00 +01:00
Anselm
1caa2761a4 Port a bunch of higher level packages 2025-05-17 17:28:47 +01:00
Anselm
4d54f1ec50 Port jazz-react-core 2025-05-17 16:28:25 +01:00
Anselm
135ca17438 Fix overly strict type assertions 2025-05-17 16:21:19 +01:00
Anselm
a5f9223215 Port requestToJoin (types only) 2025-05-17 16:12:06 +01:00
Anselm
b14a045cdb Port inbox tests (only types) 2025-05-17 15:44:52 +01:00
Anselm
0dfbda0487 Mostly make deep loading work 2025-05-17 15:26:20 +01:00
Anselm
19cb9c3ad3 port ContextManager test 2025-05-17 14:38:54 +01:00
Anselm
646c12f093 Make arbitrarily nested schema unions work 2025-05-17 14:22:57 +01:00
Anselm
fbbaad3e80 Port testing test 2025-05-17 11:59:50 +01:00
Anselm
425aa476c8 Port subscribe tests 2025-05-17 11:54:24 +01:00
Anselm
6922431197 Prefer accepting/returning undefined for optional refs in CoLists 2025-05-17 11:43:54 +01:00
Guido D'Orsi
31614c0a4f Merge pull request #2263 from garden-co/changeset-release/main
Version Packages
2025-05-17 08:58:51 +02:00
Emil Sayahi
07222cd6b0 fix: remove extra line 2025-05-16 15:58:18 -04:00
Emil Sayahi
4a88732f89 feat(docs): typechecking for CoMap docs 2025-05-16 15:57:55 -04:00
github-actions[bot]
57b69eb8da Version Packages 2025-05-16 19:49:36 +00:00
Guido D'Orsi
066676c243 Merge pull request #2264 from garden-co/feat/storage-streaming
feat(storage): implement content streaming
2025-05-16 21:46:46 +02:00
Giordano Ricci
2aac54b91d remove callback param from sso button 2025-05-16 20:29:55 +01:00
Giordano Ricci
4e4b53c420 remove leftover routes handlers 2025-05-16 20:24:33 +01:00
Guido D'Orsi
e141024656 feat(storage): implement content streaming 2025-05-16 20:36:09 +02:00
Guido D'Orsi
2c48ae0434 Merge pull request #2262 from garden-co/feat/storage-streaming
feat(storage): implement chunking for large content files
2025-05-16 19:46:36 +02:00
Guido D'Orsi
2bf974390d feat(storage): implement chunking for large content files 2025-05-16 18:41:14 +02:00
Anselm
a5116b9d63 Most CoList tests passing 2025-05-16 17:24:36 +01:00
Anselm
91ffdcc82f Fix _refs types 2025-05-16 17:19:15 +01:00
Anselm
810a7e6db2 Add getMe() 2025-05-16 16:58:23 +01:00
Joe Innes
e123715819 Fix missing $ in template literal (#2261)
Svelte interpolates curly braces in normal strings, but not template literals.
2025-05-16 16:47:11 +01:00
Anselm
1b1c0a98af Add co.account().createAs 2025-05-16 16:42:53 +01:00
Anselm
9fdf5b4831 Make first custom account test pass 2025-05-16 16:40:02 +01:00
Trisha Lim
0d087f3d4c docs: all roles can remove themselves from a Group (#2255) 2025-05-16 13:44:27 +01:00
Giordano Ricci
e2c222c8a6 password recovery flow 2025-05-16 12:08:12 +01:00
Guido D'Orsi
e410823087 Merge pull request #2251 from garden-co/changeset-release/main
Version Packages
2025-05-16 12:26:58 +02:00
Giordano Ricci
5262580222 cleanup layout 2025-05-16 11:26:25 +01:00
github-actions[bot]
dcc11e5b60 Version Packages 2025-05-16 10:22:41 +00:00
Guido D'Orsi
1b05fe5b55 Merge pull request #2252 from garden-co/fix/remove-members-no-parent-access
fix(group): removing members when the admin doesn't have access to the parent group read keys
2025-05-16 12:18:14 +02:00
Guido D'Orsi
de8f896bf9 Merge pull request #2247 from garden-co/feat/skipInvalid
feat: add $onError to catch errors on resolve
2025-05-16 12:17:10 +02:00
Guido D'Orsi
d63716a827 fix(group): removing members when the admin doesn't have access to the parent group read keys 2025-05-16 12:11:03 +02:00
Guido D'Orsi
a1e7fce3b9 Merge pull request #2250 from garden-co/fix/invites-upgrades
fix(invite): restore role upgrades an inviting revoked members
2025-05-16 12:02:50 +02:00
Guido D'Orsi
d5edad7ba5 fix(invite): restore role upgrades an inviting revoked members 2025-05-16 12:02:32 +02:00
Guido D'Orsi
559a4a223b test: cover more logic for $onError 2025-05-16 11:18:27 +02:00
Guido D'Orsi
16d5553ccd docs: replace expect in the example with comments 2025-05-16 09:52:01 +02:00
Guido D'Orsi
ef76c586cc docs: improve the Requesting Invites section 2025-05-15 23:25:54 +02:00
Guido D'Orsi
8ea4b9761c docs: improve the Requesting Invites section 2025-05-15 23:24:38 +02:00
Guido D'Orsi
a81f281079 feat: move to 2025-05-15 23:11:18 +02:00
Guido D'Orsi
3ecb602459 fix: remove Jazz paper scissors from the examples list because the worker isn't deployed 2025-05-15 23:09:16 +02:00
Meg Culotta
ea69ea1f67 Merge pull request #2004 from garden-co/feat/1936-add-request-invites-to-docs
Add request invites to docs
2025-05-15 15:25:28 -05:00
Margaret Culotta
e430bd061e remove unnecessary break 2025-05-15 15:18:35 -05:00
Guido D'Orsi
a957485172 chore: docs improvements and more tests 2025-05-15 19:52:00 +02:00
Margaret Culotta
9060975dfb Merge main and handle conflicts 2025-05-15 12:41:32 -05:00
Margaret Culotta
753ec83fdd remove unnecessary comments, clean up 2025-05-15 12:34:05 -05:00
Margaret Culotta
44a9785e93 clean up, clarify and simplfy examples 2025-05-15 12:28:55 -05:00
Trisha Lim
d9b390e538 remove support for demos in examples page (#2230) 2025-05-15 17:57:12 +01:00
Guido D'Orsi
b194f7831b fix: fix return type of $skipInvalid when used on nested lists 2025-05-15 18:17:53 +02:00
Giordano Ricci
9892dd708f improvements, restore SSO button 2025-05-15 17:07:14 +01:00
Guido D'Orsi
b60be9405d docs: add $skipInvalid usage 2025-05-15 17:48:32 +02:00
Guido D'Orsi
84588e0798 feat(organization): add remove member flow and add tests 2025-05-15 17:11:56 +02:00
Guido D'Orsi
e5b170f25e feat: add $skipInvalid resolve keyword 2025-05-15 17:11:09 +02:00
Joe Innes
6efdfef386 Merge remote-tracking branch 'upstream/main' into 2245-svelte-provider 2025-05-15 17:03:55 +02:00
Joe Innes
6528d350ec add Svelte provider documentation and metadata 2025-05-15 17:02:40 +02:00
Giordano Ricci
b6244582c7 wrap up 2025-05-15 15:34:19 +01:00
Guido D'Orsi
cfbf3aa51e Merge pull request #2243 from garden-co/changeset-release/main
Version Packages
2025-05-15 14:38:46 +02:00
github-actions[bot]
b1e00d2b18 Version Packages 2025-05-15 12:35:33 +00:00
Guido D'Orsi
ec330eaa14 chore: include betterauth packages in the linked changeset packages 2025-05-15 14:32:37 +02:00
Guido D'Orsi
07dd2c5e69 fix: restore the longer timeout for the storage loading 2025-05-15 14:26:18 +02:00
Giordano Ricci
37ab25ff62 wip: replace home components 2025-05-15 11:39:53 +01:00
Giordano Ricci
4750e23800 wip: login & signup forms 2025-05-15 11:18:00 +01:00
Trisha Lim
862386c19b add og:description to docs pages (#2153) 2025-05-15 09:29:55 +01:00
Benjamin S. Leveritt
30df1098e1 Merge pull request #2238 from garden-co/update-flake-lock
Updates nix flake lock
2025-05-15 09:12:46 +01:00
Benjamin S. Leveritt
dad4394eed Updates nix flake lock 2025-05-15 09:12:19 +01:00
Benjamin S. Leveritt
9b70336a38 Merge pull request #2187 from garden-co/2186-split-graphemes-with-unicode-segmenter
2186-split-graphemes-with-unicode-segmenter
2025-05-15 09:06:53 +01:00
Guido D'Orsi
75328ac49d Merge pull request #2227 from sectore/fix/pnpm-flake
fix(flake): stick with `pnpm@9.x`
2025-05-15 10:04:03 +02:00
Guido D'Orsi
0acdcf5f5f Merge pull request #2235 from garden-co/changeset-release/main
Version Packages
2025-05-15 09:39:49 +02:00
github-actions[bot]
dafcce5ecd Version Packages 2025-05-15 07:35:31 +00:00
Guido D'Orsi
c93536f795 Merge pull request #2198 from garden-co/fix/storage-sync-manager
fix(storage): create specialized sync/async storage managers
2025-05-15 09:33:06 +02:00
Guido D'Orsi
7bad34f2f5 chore: disable flaky test 2025-05-15 09:32:34 +02:00
Guido D'Orsi
91e0c09f33 feat(sqlite): smarter work scheduling 2025-05-15 09:24:17 +02:00
Guido D'Orsi
e2d6ba3922 fix(storage): create specialized sync/async storage managers 2025-05-15 09:21:50 +02:00
Guido D'Orsi
ba460c7b70 Merge pull request #2233 from garden-co/feat/smart-retry
feat(load): increase retry delay and immediately resolve on available
2025-05-15 09:20:25 +02:00
Guido D'Orsi
fc9f7c9199 Merge pull request #2232 from garden-co/fix/downgrade-writeonly
fix(group): correctly rotate the readKey when downgrating a member to writeOnly
2025-05-15 09:20:02 +02:00
Guido D'Orsi
2fcea1e91b Merge pull request #2201 from garden-co/fix/inspector-colist-items
fix(inspector): colist shows too many items after navigating from a longer colist
2025-05-14 18:55:30 +02:00
Emil Sayahi
191ae380c8 feat: jazz cloud auth & better auth integration (#1580)
* feat(auth): cloud authentication client

* new client function

* key splitting

TODO:
- POST signed key shard to keyserver
- GET key shard from keyserver & reassemble (sending JWT and signer ID)

* key shard merging

* start cloudauth example

TODO: CloudAuth with React Native

* separate packages

* fix sign-up

Bug: sqlite3 can't store updated user details (`secretSeed` is a byte array)

* fix: login

* trying to fix signup then login

* fix: XOR was skipping some bytes!!

* fix: yay! logins work for real this time

* feat: sealer secret sharding

TODO:
- Tests
- Investigate login proceeding despite Better Auth failing to authenticate (eg, with incorrect password)

* feat: provide `CryptoProvider`

* feat: specify `baseUrl` and `keyserver`

also, fixed logging in with `CloudAuthBasicUI` still happening when the user authenticates with Better Auth successfully, logs out in Jazz, then tries to log back in to the Better Auth server with incorrect credentials.
note: with this change, if the key shards are lost in the keyserver (eg, it restarts), then you cannot log back into the Better Auth account.

* feat: e2e test

* Update pnpm-lock.yaml

* fix imports

* disable cloudauth tests for now

* feat(auth): cloud authentication client

* new client function

* key splitting

TODO:
- POST signed key shard to keyserver
- GET key shard from keyserver & reassemble (sending JWT and signer ID)

* key shard merging

* start cloudauth example

TODO: CloudAuth with React Native

* separate packages

* fix sign-up

Bug: sqlite3 can't store updated user details (`secretSeed` is a byte array)

* fix: login

* trying to fix signup then login

* fix: XOR was skipping some bytes!!

* fix: yay! logins work for real this time

* feat: sealer secret sharding

TODO:
- Tests
- Investigate login proceeding despite Better Auth failing to authenticate (eg, with incorrect password)

* feat: provide `CryptoProvider`

* feat: specify `baseUrl` and `keyserver`

also, fixed logging in with `CloudAuthBasicUI` still happening when the user authenticates with Better Auth successfully, logs out in Jazz, then tries to log back in to the Better Auth server with incorrect credentials.
note: with this change, if the key shards are lost in the keyserver (eg, it restarts), then you cannot log back into the Better Auth account.

* feat: e2e test

* Update pnpm-lock.yaml

* fix imports

* disable cloudauth tests for now

* feat: clientside of new cloudauth spec

todo: run test server, test example app locally

* fix: tests

* feat(cloudauth): more developed example

* fix(cloudauth): use new `resolve` API

* fix(deps): remove unused `better-auth`

* docs(auth): cloud/better auth

* feat: additional plugins

* docs(auth): expo better auth

* feat: better auth options

* fix: docs

* rename packages

* merge

TODO: update docs

* docs: auth docs

* feat(examples): improve betterauth example

TODO:
- Self-hosted Better Auth

* feat(examples): self-hosted betterauth

* refactor

* feat(betterauth): api refactor

* fix(docs): build error

* feat(examples): email otp

* feat(examples): account deletion, verification, linking

* feat(tests): enable `betterauth` tests

* feat: begin Better Auth components

* fix: provider button text

* fix: tailwind class detection

* feat: see description

- feat: `providers` parameter for sign-in, sign-up, and settings components
- feat: `AccountProviders` component
- fix: auth state not updated on Next.js redirects
- feat: pass Better Auth client options to provider, not client object
  - feat: improved auth client type-checking in jazz packages
- docs: show usage of auth provider component

* fix: memory management

* fix: `lucide-react` import errors

* Update pnpm-lock.yaml

* Update `pnpm-lock.yaml`

* design system is driving me crazy

* Update `homepage/pnpm-lock.yaml`

`git clean -dfX; rm ./pnpm-lock.yaml; rm ./homepage/pnpm-lock.yaml; pnpm install; cd homepage && pnpm install; cd ../; pnpm install; pnpm format-and-lint:fix; pnpm build`

* fix: just move the design system package

* please just work

* widen react range

* fix: re-rendering too often

* Update `pnpm-lock.yaml`

* todo: replace alert, heading, input

* replace alert, heading, input

* Update `pnpm-lock.yaml`

* fix: minimise number of auth fetches

* Update pnpm-lock.yaml

* fix(deps): missing doc dep

* misc: optional `options` param

* feat(docs): hide documentation page

* feat(ci): add tests

* fix: `useSession` effect

* feat: remove key rotation

* fix: minimal number of fetches

* Delete JazzBetterAuth.test.ts.disabled

* feat: upgrade @noble deps

---------

Co-authored-by: Guido D'Orsi <gu.dorsi@gmail.com>
Co-authored-by: Guido D'Orsi <guido@garden.co>
2025-05-14 12:53:57 -04:00
Margaret Culotta
63d0b0673e run linter 2025-05-14 11:49:21 -05:00
Margaret Culotta
2b456b5e07 add approval code snippet 2025-05-14 11:45:25 -05:00
Margaret Culotta
e20809d314 fix errors in code snippets 2025-05-14 11:12:26 -05:00
Guido D'Orsi
eef1a5d994 feat(load): increase retry delay and immediately resolve on available 2025-05-14 17:38:21 +02:00
Guido D'Orsi
daee7b900d fix(group): correctly rotate the readKey when downgrading a member to writeOnly 2025-05-14 17:24:02 +02:00
Trisha Lim
9afcd38e3b link to discord and github from every docs page (#2224)
* link to discord and github from every docs page

* change to hr

* fix: incorrect url

* lint fix

* move links to right nav

* mobile

* use issue template to set labels and assignee

* update github link text

* increase focus area of links

* remove ComingSoon component
2025-05-14 15:50:03 +01:00
Trisha Lim
477ff0284a Merge pull request #2229 from garden-co/fix/form-docs
Add twoslash type check to design pattern docs
2025-05-14 15:45:53 +01:00
Guido D'Orsi
85604ec4c5 Merge pull request #2228 from garden-co/changeset-release/main
Version Packages
2025-05-14 16:32:12 +02:00
Trisha Lim
1c641ad03d fix import 2025-05-14 15:14:37 +01:00
Trisha Lim
87cfca41f0 Add twoslash type check to organization design pattern docs 2025-05-14 15:11:32 +01:00
Trisha Lim
2783f8c308 Add twoslash type check to form design pattern docs 2025-05-14 14:49:42 +01:00
github-actions[bot]
de783063e2 Version Packages 2025-05-14 12:46:57 +00:00
Guido D'Orsi
9681691701 Merge pull request #2226 from garden-co/feat/ws-connect-events
feat(worker): add waitForConnection and subscribeToConnectionChange APIs to handle connection drops
2025-05-14 14:42:50 +02:00
Guido D'Orsi
6c7ae1faee Merge pull request #2225 from garden-co/feat/dependencies-load
fix: recovery from missing dependencies when getting new content
2025-05-14 14:42:23 +02:00
jk
9472347b57 nix flake update 2025-05-14 14:37:57 +02:00
jk
b43395d8ed fix(flake) stick to pnpm@9.x
to be in sync with pnpm definition in `package.json`. In other case
`pnpm@10` is used and `pnpm i` or other commands won't work properly
2025-05-14 14:36:04 +02:00
Anselm Eickhoff
12e9837858 Update issue templates 2025-05-14 13:27:49 +01:00
Guido D'Orsi
422dbc4222 feat(worker): add waitForConnection and subscribeToConnectionChange APIs to handle connection drops 2025-05-14 13:09:10 +02:00
Guido D'Orsi
e7ccb2c054 fix: recovery from missing dependencies when getting new content 2025-05-14 12:58:39 +02:00
Guido D'Orsi
2f7046002d Merge pull request #2214 from garden-co/feat/sync-polish
feat: make the SyncManager async-free, support parallel load on server peers
2025-05-14 12:55:36 +02:00
Benjamin S. Leveritt
20c1588249 Merge pull request #2218 from garden-co/2217-type-check-accounts-and-migrations
Adds typechecking to Accounts and Migrations
2025-05-14 10:36:29 +01:00
Benjamin S. Leveritt
f3d3d4dc5d Adds typechecking to Accounts and Migrations 2025-05-14 09:50:38 +01:00
Anselm Eickhoff
3135d711d4 Merge pull request #2216 from garden-co/fix-account-resolve-docs
Fix account resolution in accounts-and-migrations.mdx
2025-05-14 09:02:58 +01:00
Anselm Eickhoff
14ad9622ea Update accounts-and-migrations.mdx 2025-05-14 09:02:24 +01:00
Guido D'Orsi
0fee2aa21b chore: make the SyncManager async-free, support parallel load on server peers 2025-05-13 21:44:10 +02:00
Margaret Culotta
b6de11e125 Merge branch 'main' into feat/1936-add-request-invites-to-docs 2025-05-13 12:56:38 -05:00
Guido D'Orsi
1e6581cd68 Merge pull request #2206 from garden-co/changeset-release/main
Version Packages
2025-05-13 17:48:05 +02:00
github-actions[bot]
aaacaf0130 Version Packages 2025-05-13 15:35:24 +00:00
Guido D'Orsi
7dcca057e7 Merge pull request #2205 from garden-co/feat/self-revoke
feat: allow accounts to self-remove from groups
2025-05-13 17:32:57 +02:00
Anselm
09b815b87e WIP Account schemas 2025-05-13 16:27:52 +01:00
Guido D'Orsi
63570520a3 feat: allow accounts to self-remove from groups 2025-05-13 17:27:51 +02:00
Trisha Lim
aeed9595ae Merge pull request #2203 from garden-co/docs/server-workers-example 2025-05-13 13:40:23 +01:00
Trisha Lim
6755e28d0f docs: link to server workers example 2025-05-13 12:28:18 +01:00
Trisha Lim
8e5ff13115 fix(inspector): colist shows too many items after navigating from a longer colist 2025-05-13 12:00:38 +01:00
Guido D'Orsi
23521e6468 Merge pull request #2197 from garden-co/changeset-release/main
Version Packages
2025-05-12 20:06:14 +02:00
github-actions[bot]
1627eb7652 Version Packages 2025-05-12 18:05:04 +00:00
Guido D'Orsi
ff846d9095 fix: loading RawAccount with the new subscription engine 2025-05-12 20:02:57 +02:00
Guido D'Orsi
8d7d62d64f Merge pull request #2194 from garden-co/changeset-release/main
Version Packages
2025-05-12 19:09:18 +02:00
github-actions[bot]
65a8227b2b Version Packages 2025-05-12 14:58:57 +00:00
Guido D'Orsi
a846e0730e fix: block load of invalid ids on a lower level and do not break sync when getting invalid ids 2025-05-12 16:56:32 +02:00
Trisha Lim
e9c0e65170 Merge pull request #2190 from garden-co/improvement/homepage-cta
homepage: improve CTA, move problem section down
2025-05-12 15:53:55 +01:00
Trisha Lim
14636606bd homepage: improve CTA, move problem section down 2025-05-12 14:59:31 +01:00
Guido D'Orsi
5118ff6585 chore: remove unused typecheck clause 2025-05-12 14:34:45 +02:00
Guido D'Orsi
51a0f86b99 test: add tests on the load API for unavailable retry 2025-05-12 14:34:45 +02:00
Guido D'Orsi
fa61ab4eb5 chore: make the retries use CO_VALUE_LOADING_CONFIG 2025-05-12 14:34:45 +02:00
Benjamin S. Leveritt
1ab839bd59 Switch to mapping by grapheme, rather than code points 2025-05-12 10:49:02 +01:00
Benjamin S. Leveritt
af3b13428c Replace Intl.Segmenter with unicode-segmenter 2025-05-12 10:48:23 +01:00
Benjamin S. Leveritt
fe241e7e7c Add extended tests for complex grapheme splitting 2025-05-12 10:12:56 +01:00
Trisha Lim
d4cdd43cf7 Merge pull request #2173 from garden-co/docs/change-role
add docs for changing roles and removing members in a Group
2025-05-12 10:05:48 +01:00
Anselm Eickhoff
c5d5fb25f7 Merge pull request #2183 from garden-co/jmsv/jazz-tiptap
jazz-richtext-tiptap
2025-05-10 12:27:18 +01:00
James Vickery
38f2276fdd version example app 2025-05-10 12:19:48 +01:00
James Vickery
b92bfce041 jazz-richtext-tiptap 2025-05-10 12:18:27 +01:00
Benjamin S. Leveritt
e3fd7bf6e3 Merge pull request #2154 from garden-co/1816-update-examples-to-coplaintext
Update examples to CoPlainText
2025-05-09 20:18:30 +01:00
Benjamin S. Leveritt
7526e444d6 Merge origin/main into 1816-update-examples-to-coplaintext 2025-05-09 20:00:59 +01:00
Benjamin S. Leveritt
28522bd062 Merge origin/main into 1816-update-examples-to-coplaintext 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
824be82f94 Adds a note for React use of CoText 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
8a9ef8ac78 Update chat-rn-expo-clerk with shorthands 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
5fb2f959f1 Fix comment 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
7a900d43f3 Fix formatting 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
c8624d56d2 Updates richtext with shorthands 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
8ed7c3947d Updates version-history with shorthands 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
ec0e61a442 Updates todo with shorthands 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
824d417d4e Updates form with shorthands 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
9f1ce81e09 Updates chat-vue with shorthands 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
48b32b6a72 Updates chat-rn with shorthands 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
03fec5f1b3 Updates chat with new CoPlainText shorthands 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
cdd7ac98cc Update examples/form/src/OrderForm.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
8218a272ee Update chat-rn-expo-clerk to CoPlainText 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
25d146ead8 Update chat-vue to CoPlainText 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
3f4d493286 Update chat-rn to CoPlainText 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
d476b06d0e Update version-history to CoPlainText 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
22baf1f547 Update todo to CoPlainText
Replace text with CoPlainText in todo
2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
d6ec873b1e Update form to CoPlainText 2025-05-09 20:00:38 +01:00
Benjamin S. Leveritt
160b30406b Update chat to CoPlainText 2025-05-09 20:00:38 +01:00
Guido D'Orsi
3e473eff50 chore: skip flaky test 2025-05-09 18:44:36 +02:00
Anselm
db3c737e9f Make co.feed() work 2025-05-09 16:31:24 +01:00
Anselm
28d7fe9b90 Start updating the homepage 2025-05-09 15:29:55 +01:00
Anselm
4c70ca198b Port coList tests to zod 2025-05-09 14:40:54 +01:00
Anselm
742283263f Get rid of coField<...>, stop using instance getters on CoMaps 2025-05-09 14:26:55 +01:00
Trisha Lim
a9cf6da27a add docs for changing roles and removing members in a Group 2025-05-09 13:47:00 +01:00
Anselm
5f4e9a9936 Trying to make records work 2025-05-09 10:35:18 +01:00
Anselm
2b40b3052c Implement the rest of CoMap loading & subscribing 2025-05-08 15:05:55 +01:00
Anselm
9dd926a59a Add todo for discriminated union narrowing 2025-05-08 12:08:35 +01:00
Anselm
9aa6ab6fea Make discriminated unions of CoMaps work 2025-05-08 12:03:31 +01:00
Anselm
4207fb5914 Use zod schemas for simple CoMap tests 2025-05-08 10:58:02 +01:00
Anselm
cb3e5cbe81 Fix build, update RN (to support zod4's wildcard exports) and make tests pass 2025-05-07 20:07:55 +01:00
Anselm
d199fb06b3 Make ImageDefs work, fix circular imports 2025-05-07 17:29:52 +01:00
Anselm
0eaa500aef Make basic chat app work 2025-05-07 11:17:39 +01:00
Anselm
774c05cef0 Merge branch 'main' into feature/zod-horribly 2025-05-07 09:28:45 +01:00
Anselm
96a1f303fe Merge branch 'refactor/combine-covalue-core-and-state' into feature/zod-horribly 2025-05-06 15:14:47 +01:00
Anselm
6a55a548a0 Replacing ID<CoValue> in favor of string, initial "soft" step 2025-05-06 11:17:22 +01:00
Anselm
0e87c1c971 Fix more occurences of coField 2025-05-05 15:28:48 +01:00
Anselm
89fac342bf Rename co -> coField in preparation of giving co a new meaning 2025-05-05 11:38:35 +01:00
Margaret Culotta
d23c71d511 working through twoslash errors 2025-04-30 08:11:32 -05:00
Benjamin S. Leveritt
b24071cf33 Fixes example for TwoSlash 2025-04-28 16:36:25 +01:00
Benjamin S. Leveritt
a5c88c08de Merge main into feat/1936-add-request-invites-to-docs 2025-04-28 16:14:17 +01:00
Margaret Culotta
906932db1e update imports and mocks for twoslash 2025-04-24 12:22:17 -05:00
Margaret Culotta
2033e35a41 Merge branch 'main' into feat/1936-add-request-invites-to-docs 2025-04-24 11:26:09 -05:00
Margaret Culotta
5a2a12ccbb update twoslash imports 2025-04-18 08:10:50 -05:00
Margaret Culotta
d288cb6954 update docs for request invite 2025-04-17 10:18:17 -05:00
925 changed files with 73461 additions and 26884 deletions

View File

@@ -2,8 +2,8 @@
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [
"linked": [],
"fixed": [
[
"cojson",
"cojson-storage",
@@ -12,6 +12,10 @@
"cojson-transport-ws",
"jazz-browser",
"jazz-auth-clerk",
"jazz-auth-betterauth",
"jazz-betterauth-client-plugin",
"jazz-betterauth-server-plugin",
"jazz-react-auth-betterauth",
"jazz-browser-media-images",
"jazz-expo",
"jazz-inspector",
@@ -23,6 +27,8 @@
"jazz-react-native-core",
"jazz-react-native",
"jazz-react-native-media-images",
"jazz-richtext-prosemirror",
"jazz-richtext-tiptap",
"jazz-run",
"jazz-svelte",
"jazz-tools",

10
.github/ISSUE_TEMPLATE/docs-request.md vendored Normal file
View File

@@ -0,0 +1,10 @@
---
name: Docs request
about: Allow people to quickly report issues & improvements for the docs
title: 'Docs: '
labels: docs, requested
assignees: bensleveritt
---

View File

@@ -38,7 +38,6 @@ jobs:
- name: chat-rn-expo App Pre Build
working-directory: ./examples/chat-rn-expo
run: |
pnpm build
pnpm expo prebuild --clean
- name: Install Maestro

View File

@@ -0,0 +1,46 @@
name: Playwright Tests
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
timeout-minutes: 60
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
matrix:
project: ["homepage/homepage"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Install project dependencies
run: pnpm install
working-directory: ./${{ matrix.project }}
- name: Pnpm Build
run: pnpm turbo build
working-directory: ./${{ matrix.project }}
- name: Install Playwright Browsers
run: pnpm exec playwright install
working-directory: ./${{ matrix.project }}
- name: Run Playwright tests
run: pnpm exec playwright test
working-directory: ./${{ matrix.project }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ hashFiles(format('{0}/package.json', matrix.project)) }}-playwright-report
path: ./${{ matrix.project }}/playwright-report/
retention-days: 30

View File

@@ -13,7 +13,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
project: ["tests/e2e", "examples/chat", "examples/clerk", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
project: ["tests/e2e", "examples/chat", "examples/clerk", "examples/betterauth", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/organization", "examples/pets", "starters/react-passkey-auth"]
steps:
- uses: actions/checkout@v4

5
.gitignore vendored
View File

@@ -20,6 +20,9 @@ __screenshots__
# Playwright
test-results
# Java
.java-version
.husky
.vscode/*
@@ -29,3 +32,5 @@ test-results
.cursorrules
.windsurfrules
playwright-report

View File

@@ -64,7 +64,7 @@
}
},
{
"include": ["packages/**/src/tests/**"],
"include": ["**/tests/**"],
"linter": {
"rules": {
"correctness": {

1
examples/betterauth/.env Normal file
View File

@@ -0,0 +1 @@
BETTER_AUTH_SECRET="TEST_SECRET"

47
examples/betterauth/.gitignore vendored Normal file
View File

@@ -0,0 +1,47 @@
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
sqlite.db
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
!.env
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts

View File

@@ -0,0 +1,298 @@
# betterauth
## 0.1.25
### Patch Changes
- Updated dependencies [048ac1d]
- jazz-tools@0.14.22
- jazz-betterauth-server-plugin@0.14.22
- jazz-inspector@0.14.22
- jazz-react@0.14.22
- jazz-react-auth-betterauth@0.14.22
- jazz-betterauth-client-plugin@0.14.22
## 0.1.24
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-betterauth-server-plugin@0.14.21
- jazz-inspector@0.14.21
- jazz-react@0.14.21
- jazz-react-auth-betterauth@0.14.21
- jazz-betterauth-client-plugin@0.14.21
## 0.1.23
### Patch Changes
- Updated dependencies [6f72419]
- Updated dependencies [04b20c2]
- jazz-tools@0.14.20
- jazz-betterauth-server-plugin@0.14.20
- jazz-inspector@0.14.20
- jazz-react@0.14.20
- jazz-react-auth-betterauth@0.14.20
- jazz-betterauth-client-plugin@0.14.20
## 0.1.22
### Patch Changes
- jazz-betterauth-client-plugin@0.14.19
- jazz-betterauth-server-plugin@0.14.19
- jazz-react-auth-betterauth@0.14.19
- jazz-inspector@0.14.19
- jazz-react@0.14.19
- jazz-tools@0.14.19
## 0.1.21
### Patch Changes
- Updated dependencies [4b950bc]
- Updated dependencies [d6d9c0a]
- Updated dependencies [c559054]
- jazz-tools@0.14.18
- jazz-betterauth-server-plugin@0.14.18
- jazz-inspector@0.14.18
- jazz-react@0.14.18
- jazz-react-auth-betterauth@0.14.18
- jazz-betterauth-client-plugin@0.14.18
## 0.1.20
### Patch Changes
- Updated dependencies [e512df4]
- jazz-betterauth-server-plugin@0.14.17
- jazz-tools@0.14.17
- jazz-betterauth-client-plugin@0.14.17
- jazz-inspector@0.14.17
- jazz-react@0.14.17
- jazz-react-auth-betterauth@0.14.17
## 0.1.19
### Patch Changes
- jazz-betterauth-server-plugin@0.14.16
- jazz-inspector@0.14.16
- jazz-react@0.14.16
- jazz-react-auth-betterauth@0.14.16
- jazz-tools@0.14.16
- jazz-betterauth-client-plugin@0.14.16
## 0.1.18
### Patch Changes
- Updated dependencies [f9590f9]
- jazz-react@0.14.15
- jazz-betterauth-server-plugin@0.14.15
- jazz-inspector@0.14.15
- jazz-react-auth-betterauth@0.14.15
- jazz-tools@0.14.15
- jazz-betterauth-client-plugin@0.14.15
## 0.1.17
### Patch Changes
- Updated dependencies [e32a1f7]
- jazz-tools@0.14.14
- jazz-betterauth-server-plugin@0.14.14
- jazz-inspector@0.14.14
- jazz-react@0.14.14
- jazz-react-auth-betterauth@0.14.14
- jazz-betterauth-client-plugin@0.14.14
## 0.1.16
### Patch Changes
- jazz-inspector@0.14.13
- jazz-react@0.14.13
- jazz-react-auth-betterauth@0.14.13
## 0.1.15
### Patch Changes
- jazz-inspector@0.14.12
- jazz-react@0.14.12
- jazz-react-auth-betterauth@0.14.12
## 0.1.14
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react-auth-betterauth@0.14.10
- jazz-inspector@0.14.10
- jazz-react@0.14.10
- jazz-tools@0.14.10
- jazz-betterauth-server-plugin@0.14.10
- jazz-betterauth-client-plugin@0.14.10
## 0.1.13
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-betterauth-server-plugin@0.14.9
- jazz-inspector@0.14.9
- jazz-react@0.14.9
- jazz-react-auth-betterauth@0.14.9
- jazz-betterauth-client-plugin@0.14.9
## 0.1.12
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-betterauth-server-plugin@0.14.8
- jazz-inspector@0.14.8
- jazz-react@0.14.8
- jazz-react-auth-betterauth@0.14.8
- jazz-betterauth-client-plugin@0.14.8
## 0.1.11
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-betterauth-server-plugin@0.14.7
- jazz-inspector@0.14.7
- jazz-react@0.14.7
- jazz-react-auth-betterauth@0.14.7
- jazz-betterauth-client-plugin@0.14.7
## 0.1.10
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-betterauth-server-plugin@0.14.6
- jazz-inspector@0.14.6
- jazz-react@0.14.6
- jazz-react-auth-betterauth@0.14.6
- jazz-betterauth-client-plugin@0.14.6
## 0.1.9
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-betterauth-server-plugin@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
- jazz-react-auth-betterauth@0.14.5
- jazz-betterauth-client-plugin@0.14.5
## 0.1.8
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-betterauth-server-plugin@0.14.4
- jazz-inspector@0.14.4
- jazz-react@0.14.4
- jazz-react-auth-betterauth@0.14.4
- jazz-betterauth-client-plugin@0.14.4
## 0.1.7
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-betterauth-server-plugin@0.14.2
- jazz-inspector@0.14.2
- jazz-react@0.14.2
- jazz-react-auth-betterauth@0.14.2
- jazz-betterauth-client-plugin@0.14.2
## 0.1.6
### Patch Changes
- Updated dependencies [cdfc105]
- jazz-tools@0.14.1
- jazz-betterauth-server-plugin@0.14.1
- jazz-inspector@0.14.1
- jazz-react@0.14.1
- jazz-react-auth-betterauth@0.14.1
- jazz-betterauth-client-plugin@0.14.1
## 0.1.5
### Patch Changes
- Updated dependencies [5835ed1]
- jazz-tools@0.14.0
- jazz-betterauth-server-plugin@0.14.0
- jazz-inspector@0.14.0
- jazz-react@0.14.0
- jazz-react-auth-betterauth@0.14.0
- jazz-betterauth-client-plugin@0.14.0
## 0.1.4
### Patch Changes
- jazz-betterauth-server-plugin@0.13.32
- jazz-react@0.13.32
- jazz-react-auth-betterauth@0.13.32
- jazz-betterauth-client-plugin@0.13.32
## 0.1.3
### Patch Changes
- Updated dependencies [e5b170f]
- jazz-tools@0.13.31
- jazz-betterauth-server-plugin@0.13.31
- jazz-inspector@0.13.31
- jazz-react@0.13.31
- jazz-react-auth-betterauth@0.13.31
- jazz-betterauth-client-plugin@0.13.31
## 0.1.2
### Patch Changes
- jazz-betterauth-server-plugin@0.13.30
- jazz-inspector@0.13.30
- jazz-react@0.13.30
- jazz-react-auth-betterauth@0.13.30
- jazz-tools@0.13.30
- jazz-betterauth-client-plugin@0.13.30
## 0.1.1
### Patch Changes
- Updated dependencies [8e5ff13]
- jazz-inspector@0.13.29
- jazz-betterauth-server-plugin@0.0.1
- jazz-react@0.13.29
- jazz-react-auth-betterauth@0.0.1
- jazz-tools@0.13.29
- jazz-betterauth-client-plugin@0.0.1

View File

@@ -0,0 +1,54 @@
# Better Auth Integration Example
This example demonstrates how to integrate [Better Auth](https://www.better-auth.com/) with Jazz.
## Getting started
To run this example, you may either:
* Clone the Jazz monorepo and run this example from within.
* Create a new Jazz project using this example as a template, and run that new project.
### Setting environment variables
- `NEXT_PUBLIC_AUTH_BASE_URL`: A URL to a Better Auth server. If undefined, the example will self-host a Better Auth server.
- `BETTER_AUTH_SECRET`: The encryption secret used by the self-hosted Better Auth server (required only if `NEXT_PUBLIC_AUTH_BASE_URL` is undefined)
- `GITHUB_CLIENT_ID`: The client ID for the GitHub OAuth provider used by the self-hosted Better Auth server (required only if `NEXT_PUBLIC_AUTH_BASE_URL` is undefined)
- `GITHUB_CLIENT_SECRET`: The client secret for the GitHub OAuth provider used by the self-hosted Better Auth server (required only if `NEXT_PUBLIC_AUTH_BASE_URL` is undefined)
### Using this example as a template
1. Create a new Jazz project, and use this example as a template.
```sh
npx create-jazz-app@latest betterauth-app --example betterauth
```
2. Navigate to the new project and start the development server.
```sh
cd betterauth-app
pnpm install
pnpm dev
```
### Using the monorepo
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
Clone the jazz repository.
```bash
git clone https://github.com/garden-co/jazz.git
```
Install and build dependencies.
```bash
pnpm i && npx turbo build
```
Go to the example directory.
```bash
cd jazz/examples/betterauth/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

View File

@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}

View File

@@ -0,0 +1,7 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
};
export default nextConfig;

View File

@@ -0,0 +1,51 @@
{
"name": "betterauth",
"version": "0.1.25",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"email": "email dev --dir src/components/emails"
},
"dependencies": {
"@icons-pack/react-simple-icons": "^12.8.0",
"@radix-ui/react-label": "^2.1.6",
"@radix-ui/react-slot": "^1.2.2",
"better-auth": "^1.2.4",
"better-sqlite3": "^11.9.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"jazz-betterauth-client-plugin": "workspace:*",
"jazz-betterauth-server-plugin": "workspace:*",
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:*",
"jazz-react-auth-betterauth": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-react": "^0.510.0",
"next": "15.3.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"sonner": "^2.0.3",
"tailwind-merge": "^3.3.0",
"tw-animate-css": "^1.2.5"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@playwright/test": "^1.50.1",
"@tailwindcss/postcss": "^4",
"@types/better-sqlite3": "^7.6.12",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"react-email": "^4.0.11",
"tailwindcss": "^4",
"typescript": "^5"
}
}

View File

@@ -0,0 +1,53 @@
import { defineConfig, devices } from "@playwright/test";
import isCI from "is-ci";
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// dotenv.config({ path: path.resolve(__dirname, '.env') });
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: isCI,
/* Retry on CI only */
retries: isCI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: isCI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:3000/",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
permissions: ["clipboard-read", "clipboard-write"],
},
/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
/* Run your local dev server before starting the tests */
webServer: [
{
command: "pnpm dev",
url: "http://localhost:3000/",
reuseExistingServer: !isCI,
},
],
});

View File

@@ -0,0 +1,5 @@
const config = {
plugins: ["@tailwindcss/postcss"],
};
export default config;

View File

@@ -0,0 +1,15 @@
<svg
viewBox="0 0 386 146"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
>
<path id="text"
d="M176.725 33.865H188.275V22.7H176.725V33.865ZM164.9 129.4H172.875C182.72 129.4 188.275 123.9 188.275 114.22V43.6H176.725V109.545C176.725 115.65 173.975 118.51 167.925 118.51H164.9V129.4ZM245.298 53.28C241.613 45.47 233.363 41.95 222.748 41.95C208.998 41.95 200.748 48.44 197.888 58.615L208.613 61.915C210.648 55.315 216.368 52.565 222.638 52.565C231.933 52.565 235.673 56.415 236.058 64.61C226.433 65.93 216.643 67.195 209.768 69.23C200.583 72.145 195.743 77.865 195.743 86.83C195.743 96.51 202.673 104.65 215.818 104.65C225.443 104.65 232.318 101.35 237.213 94.365V103H247.388V66.425C247.388 61.475 247.168 57.185 245.298 53.28ZM217.853 95.245C210.483 95.245 207.128 91.34 207.128 86.72C207.128 82.045 210.593 79.515 215.323 77.92C220.328 76.435 226.983 75.5 235.948 74.18C235.893 76.93 235.673 80.725 234.738 83.475C233.418 89.25 227.643 95.245 217.853 95.245ZM251.22 103H301.545V92.715H269.535L303.195 45.47V43.6H254.3V53.885H284.935L251.22 101.185V103ZM304.815 103H355.14V92.715H323.13L356.79 45.47V43.6H307.895V53.885H338.53L304.815 101.185V103Z"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M136.179 44.8277C136.179 44.8277 136.179 44.8277 136.179 44.8276V21.168C117.931 28.5527 97.9854 32.6192 77.0897 32.6192C65.1466 32.6192 53.5138 31.2908 42.331 28.7737V51.4076C42.331 51.4076 42.331 51.4076 42.331 51.4076V81.1508C41.2955 80.4385 40.1568 79.8458 38.9405 79.3915C36.1732 78.358 33.128 78.0876 30.1902 78.6145C27.2524 79.1414 24.5539 80.4419 22.4358 82.3516C20.3178 84.2613 18.8754 86.6944 18.291 89.3433C17.7066 91.9921 18.0066 94.7377 19.1528 97.2329C20.2991 99.728 22.2403 101.861 24.7308 103.361C27.2214 104.862 30.1495 105.662 33.1448 105.662H33.1455C33.6061 105.662 33.8365 105.662 34.0314 105.659C44.5583 105.449 53.042 96.9656 53.2513 86.4386C53.2534 86.3306 53.2544 86.2116 53.2548 86.0486H53.2552V85.7149L53.2552 85.5521V82.0762L53.2552 53.1993C61.0533 54.2324 69.0092 54.7656 77.0897 54.7656C77.6696 54.7656 78.2489 54.7629 78.8276 54.7574V110.696C77.792 109.983 76.6533 109.391 75.437 108.936C72.6697 107.903 69.6246 107.632 66.6867 108.159C63.7489 108.686 61.0504 109.987 58.9323 111.896C56.8143 113.806 55.3719 116.239 54.7875 118.888C54.2032 121.537 54.5031 124.283 55.6494 126.778C56.7956 129.273 58.7368 131.405 61.2273 132.906C63.7179 134.406 66.646 135.207 69.6414 135.207C70.1024 135.207 70.3329 135.207 70.5279 135.203C81.0548 134.994 89.5385 126.51 89.7478 115.983C89.7517 115.788 89.7517 115.558 89.7517 115.097V111.621L89.7517 54.3266C101.962 53.4768 113.837 51.4075 125.255 48.2397V80.9017C124.219 80.1894 123.081 79.5966 121.864 79.1424C119.097 78.1089 116.052 77.8384 113.114 78.3653C110.176 78.8922 107.478 80.1927 105.36 82.1025C103.242 84.0122 101.799 86.4453 101.215 89.0941C100.631 91.743 100.931 94.4886 102.077 96.9837C103.223 99.4789 105.164 101.612 107.655 103.112C110.145 104.612 113.073 105.413 116.069 105.413C116.53 105.413 116.76 105.413 116.955 105.409C127.482 105.2 135.966 96.7164 136.175 86.1895C136.179 85.9945 136.179 85.764 136.179 85.3029V81.8271L136.179 44.8277Z"
fill="#146AFF"
/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,12 @@
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 125 125"
fill="none"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M118.179 29.6597V6C99.931 13.3847 79.9854 17.4512 59.0897 17.4512C47.1466 17.4512 35.5138 16.1228 24.331 13.6057V36.2396V65.9828C23.2955 65.2705 22.1568 64.6778 20.9405 64.2235C18.1732 63.19 15.128 62.9196 12.1902 63.4465C9.25242 63.9734 6.55392 65.2739 4.43582 67.1836C2.31782 69.0933 0.875416 71.5264 0.291016 74.1753C-0.293384 76.8241 0.00661504 79.5697 1.15281 82.0649C2.29911 84.56 4.24032 86.693 6.73082 88.193C9.22142 89.694 12.1495 90.494 15.1448 90.494C15.6054 90.494 15.8365 90.494 16.0314 90.491C26.5583 90.281 35.042 81.7976 35.2513 71.2706C35.2534 71.1626 35.2544 71.0436 35.2548 70.8806L35.2552 70.5469V70.3841V66.9082V38.0313C43.0533 39.0644 51.0092 39.5976 59.0897 39.5976C59.6696 39.5976 60.2489 39.5949 60.8276 39.5894V95.528C59.792 94.815 58.6533 94.223 57.437 93.768C54.6697 92.735 51.6246 92.464 48.6867 92.991C45.7489 93.518 43.0504 94.819 40.9323 96.728C38.8143 98.638 37.3719 101.071 36.7875 103.72C36.2032 106.369 36.5031 109.115 37.6494 111.61C38.7956 114.105 40.7368 116.237 43.2273 117.738C45.7179 119.238 48.646 120.039 51.6414 120.039C52.1024 120.039 52.3329 120.039 52.5279 120.035C63.0548 119.826 71.5385 111.342 71.7478 100.815C71.7517 100.62 71.7517 100.39 71.7517 99.929V96.453V39.1586C83.962 38.3088 95.837 36.2395 107.255 33.0717V65.7337C106.219 65.0214 105.081 64.4286 103.864 63.9744C101.097 62.9409 98.052 62.6704 95.114 63.1973C92.176 63.7242 89.478 65.0247 87.36 66.9345C85.242 68.8442 83.799 71.2773 83.215 73.9261C82.631 76.575 82.931 79.3206 84.077 81.8157C85.223 84.3109 87.164 86.444 89.655 87.944C92.145 89.444 95.073 90.245 98.069 90.245C98.53 90.245 98.76 90.245 98.955 90.241C109.482 90.032 117.966 81.5484 118.175 71.0215C118.179 70.8265 118.179 70.596 118.179 70.1349V66.6591V29.6597Z"
fill="#146AFF"
/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,22 @@
import { Navbar } from "@/components/navbar";
import type { Metadata } from "next";
export const metadata: Metadata = {
title: "Jazz Example: Better Auth",
description: "Jazz example application demonstrating Better Auth integration",
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<Navbar />
<div className="container mx-auto pt-16 min-h-screen flex flex-col items-center justify-center">
{children}
</div>
</>
);
}

View File

@@ -0,0 +1,113 @@
"use client";
import { Button } from "@/components/ui/button";
import { useAccount } from "jazz-react";
import { Account } from "jazz-tools";
import {
AppWindowMacIcon,
FileTextIcon,
GlobeIcon,
WrenchIcon,
} from "lucide-react";
import Image from "next/image";
export default function Home() {
const { me } = useAccount(Account, { resolve: { profile: {} } });
if (!me) {
return null;
}
return (
<div className="grow flex flex-col items-center justify-center">
<main className="flex flex-col gap-8 row-start-2 grow justify-center">
<Image
src="/jazz-logo.svg"
alt="Jazz logo"
width={180}
height={38}
priority
/>
<p className="text-sm/6 text-center sm:text-left">
Signed in as{" "}
<span className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-mono font-semibold">
{me.profile.name}
</span>{" "}
with id{" "}
<span className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-mono font-semibold">
{me.id}
</span>
</p>
<div className="flex gap-4 items-center flex-row">
<Button asChild size="lg">
<a
href="https://jazz.tools/docs"
target="_blank"
rel="noopener noreferrer"
>
<Image src="/jazz.svg" alt="" width={20} height={20} />
Start building
</a>
</Button>
<Button asChild variant="secondary" size="lg">
<a
href="https://jazz.tools/docs"
target="_blank"
rel="noopener noreferrer"
>
<FileTextIcon className="size-4" />
Read the docs
</a>
</Button>
</div>
</main>
<footer className="flex gap-4 py-8">
<Button asChild variant="ghost">
<a
href="https://jazz.tools/api-reference"
target="_blank"
rel="noopener noreferrer"
>
<FileTextIcon className="size-4" />
API reference
</a>
</Button>
<Button asChild variant="ghost">
<a
href="https://jazz.tools/examples"
target="_blank"
rel="noopener noreferrer"
>
<AppWindowMacIcon className="size-4" />
Examples
</a>
</Button>
<Button asChild variant="ghost">
<a
href="https://jazz.tools/status"
target="_blank"
rel="noopener noreferrer"
>
<GlobeIcon className="size-4" />
Status
</a>
</Button>
<Button asChild variant="ghost">
<a
href="https://jazz.tools/showcase"
target="_blank"
rel="noopener noreferrer"
>
<WrenchIcon className="size-4" />
Built with Jazz
</a>
</Button>
</footer>
</div>
);
}

View File

@@ -0,0 +1,14 @@
import { UserSettings } from "@/components/user-settings";
import type { Metadata } from "next";
export const metadata: Metadata = {
title: "Settings | Jazz Example: Better Auth",
};
export default function SettingsPage() {
return (
<div className="max-w-screen-md w-full mx-auto px-4">
<UserSettings />
</div>
);
}

View File

@@ -0,0 +1,10 @@
import { auth } from "@/lib/auth";
import { toNextJsHandler } from "better-auth/next-js";
export const { GET, POST } = (() => {
if (!process.env.NEXT_PUBLIC_AUTH_BASE_URL) {
return toNextJsHandler(auth.handler);
} else {
return { GET: undefined, POST: undefined };
}
})();

View File

@@ -0,0 +1,10 @@
import { ForgotPasswordForm } from "@/components/forgot-password-form";
import type { Metadata } from "next";
export const metadata: Metadata = {
title: "Forgot password | Jazz Example: Better Auth",
};
export default function ForgotPasswordPage() {
return <ForgotPasswordForm />;
}

View File

@@ -0,0 +1,23 @@
import Image from "next/image";
import Link from "next/link";
interface Props {
children: React.ReactNode;
}
export default function AuthLayout({ children }: Props) {
return (
<div className="bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
<div className="flex w-full max-w-sm flex-col gap-6">
<Link
href="/"
className="flex items-center gap-2 self-center font-medium"
>
<Image src="/jazz.svg" alt="Jazz Logo" width={24} height={24} />
Jazz BetterAuth Demo
</Link>
{children}
</div>
</div>
);
}

View File

@@ -0,0 +1,10 @@
import { ResetPasswordForm } from "@/components/reset-password-form";
import type { Metadata } from "next";
export const metadata: Metadata = {
title: "Reset password | Jazz Example: Better Auth",
};
export default function ResetPasswordPage() {
return <ResetPasswordForm />;
}

View File

@@ -0,0 +1,11 @@
import { SigninForm } from "@/components/signin-form";
import type { Metadata } from "next";
import { ssoProviders } from "../sso-providers";
export const metadata: Metadata = {
title: "Sign in | Jazz Example: Better Auth",
};
export default function LoginPage() {
return <SigninForm providers={ssoProviders} />;
}

View File

@@ -0,0 +1,11 @@
import { SignupForm } from "@/components/signup-form";
import type { Metadata } from "next";
import { ssoProviders } from "../sso-providers";
export const metadata: Metadata = {
title: "Sign up | Jazz Example: Better Auth",
};
export default function LoginPage() {
return <SignupForm providers={ssoProviders} />;
}

View File

@@ -0,0 +1,4 @@
import type { SSOProviderType } from "jazz-react-auth-betterauth";
// Fill in the providers you want to use
export const ssoProviders: SSOProviderType[] = ["github"];

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,123 @@
@import "tailwindcss";
@import "tw-animate-css";
@custom-variant dark (&:is(.dark *));
:root {
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.145 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.145 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.985 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(0.269 0 0);
--input: oklch(0.269 0 0);
--ring: oklch(0.439 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(0.269 0 0);
--sidebar-ring: oklch(0.439 0 0);
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}

View File

@@ -0,0 +1,26 @@
import { JazzAndAuth } from "@/components/JazzAndAuth";
import { Toaster } from "@/components/ui/sonner";
import type { Metadata } from "next";
import "./globals.css";
export const metadata: Metadata = {
title: "Jazz Example: Better Auth",
description: "Jazz example application demonstrating Better Auth integration",
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className="antialiased">
<JazzAndAuth>
{children}
<Toaster richColors />
</JazzAndAuth>
</body>
</html>
);
}

View File

@@ -0,0 +1,33 @@
"use client";
import { JazzProvider } from "jazz-react";
import { AuthProvider } from "jazz-react-auth-betterauth";
import { type ReactNode, lazy } from "react";
const JazzDevTools =
process.env.NODE_ENV === "production"
? () => null
: lazy(() =>
import("jazz-inspector").then((res) => ({
default: res.JazzInspector,
})),
);
export function JazzAndAuth({ children }: { children: ReactNode }) {
return (
<JazzProvider
sync={{
peer: "wss://cloud.jazz.tools/?key=betterauth-example@garden.co",
}}
>
<AuthProvider
options={{
baseURL: process.env.NEXT_PUBLIC_AUTH_BASE_URL,
}}
>
{children}
</AuthProvider>
<JazzDevTools />
</JazzProvider>
);
}

View File

@@ -0,0 +1,137 @@
import { Button } from "@/components/ui/button";
import {
SiApple,
SiDiscord,
SiDropbox,
SiFacebook,
SiGithub,
SiGitlab,
SiGoogle,
SiKick,
SiReddit,
SiRoblox,
SiSpotify,
SiTiktok,
SiTwitch,
SiVk,
SiX,
SiZoom,
} from "@icons-pack/react-simple-icons";
import { type SSOProviderType, useAuth } from "jazz-react-auth-betterauth";
import { useRouter } from "next/navigation";
import type { ReactNode } from "react";
import { toast } from "sonner";
interface SocialProvider {
name: string;
icon?: ReactNode;
}
const socialProviderMap: Record<SSOProviderType, SocialProvider> = {
github: {
name: "GitHub",
icon: <SiGithub />,
},
google: {
name: "Google",
icon: <SiGoogle />,
},
apple: {
name: "Apple",
icon: <SiApple />,
},
discord: {
name: "Discord",
icon: <SiDiscord />,
},
facebook: {
name: "Facebook",
icon: <SiFacebook />,
},
microsoft: {
name: "Microsoft",
},
twitter: {
name: "X",
icon: <SiX />,
},
dropbox: {
name: "Dropbox",
icon: <SiDropbox />,
},
linkedin: {
name: "LinkedIn",
},
gitlab: {
name: "GitLab",
icon: <SiGitlab />,
},
kick: {
name: "Kick",
icon: <SiKick />,
},
tiktok: {
name: "TikTok",
icon: <SiTiktok />,
},
twitch: {
name: "Twitch",
icon: <SiTwitch />,
},
vk: {
name: "VK",
icon: <SiVk />,
},
zoom: {
name: "Zoom",
icon: <SiZoom />,
},
roblox: {
name: "Roblox",
icon: <SiRoblox />,
},
reddit: {
name: "Reddit",
icon: <SiReddit />,
},
spotify: {
name: "Spotify",
icon: <SiSpotify />,
},
};
interface Props {
provider: SSOProviderType;
}
export function SSOButton({ provider }: Props) {
const auth = useAuth();
const router = useRouter();
return (
<Button
type="button"
variant="outline"
onClick={() => {
auth.authClient.signIn.social(
{
provider,
},
{
onSuccess: () => {
router.push("/");
},
onError: (error) => {
toast.error("Error", {
description: error.error.message,
});
},
},
);
}}
>
{socialProviderMap[provider].icon}
Continue with {socialProviderMap[provider].name}
</Button>
);
}

View File

@@ -0,0 +1,85 @@
"use client";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { useAuth } from "jazz-react-auth-betterauth";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { toast } from "sonner";
export function ForgotPasswordForm() {
const router = useRouter();
const [email, setEmail] = useState("");
const auth = useAuth();
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
auth.authClient.forgetPassword(
{ email, redirectTo: `${window.location.origin}/auth/reset-password` },
{
onSuccess: () => {
toast.success("Email sent");
},
onError: (error) => {
toast.error("Error", {
description: error.error.message,
});
},
},
);
};
return (
<div className="flex flex-col gap-6">
<Card>
<CardHeader className="text-center">
<CardTitle className="text-xl">Recover password</CardTitle>
<CardDescription>
Enter your email to receive a link to reset your password
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleSubmit}>
<div className="grid gap-6">
<div className="grid gap-6">
<div className="grid gap-3">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
placeholder="you@example.com"
required
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
</div>
<Button type="submit" className="w-full">
Recover password
</Button>
</div>
<div className="text-center text-sm">
Back to{" "}
<Link
href="/auth/sign-in"
className="underline underline-offset-4"
>
Sign in
</Link>
</div>
</div>
</form>
</CardContent>
</Card>
</div>
);
}

View File

@@ -0,0 +1,55 @@
"use client";
import { Button } from "@/components/ui/button";
import { useAccount, useIsAuthenticated } from "jazz-react";
import { useAuth } from "jazz-react-auth-betterauth";
import { Account } from "jazz-tools";
import Image from "next/image";
import Link from "next/link";
import { useCallback } from "react";
export function Navbar() {
const { authClient } = useAuth();
const { logOut } = useAccount(Account, { resolve: { profile: {} } });
const isAuthenticated = useIsAuthenticated();
const signOut = useCallback(() => {
authClient.signOut().catch(console.error).finally(logOut);
}, [logOut, authClient]);
return (
<header className="absolute p-4 top-0 left-0 w-full z-10 flex justify-between">
<nav className="flex gap-4">
<Link href="/">
<Image
src="/jazz-logo.svg"
alt="Jazz logo"
width={96}
height={96}
priority
/>
</Link>
{isAuthenticated && (
<Button asChild variant="link">
<Link href="/settings">Settings</Link>
</Button>
)}
</nav>
<nav className="flex gap-4">
{isAuthenticated ? (
<Button onClick={signOut}>Sign out</Button>
) : (
<>
<Button asChild variant="secondary">
<Link href="/auth/sign-in">Sign in</Link>
</Button>
<Button asChild>
<Link href="/auth/sign-up">Sign up</Link>
</Button>
</>
)}
</nav>
</header>
);
}

View File

@@ -0,0 +1,108 @@
"use client";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { useAuth } from "jazz-react-auth-betterauth";
import Link from "next/link";
import { useRouter, useSearchParams } from "next/navigation";
import { useState } from "react";
import { toast } from "sonner";
export function ResetPasswordForm() {
const router = useRouter();
const [password, setPassword] = useState("");
const [confirmPassword, setConfirmPassword] = useState("");
const auth = useAuth();
const searchParams = useSearchParams();
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
const token = searchParams.get("token");
if (password !== confirmPassword) {
toast.error("Passwords do not match");
return;
}
if (!token) {
toast.error("Invalid token");
return;
}
auth.authClient.resetPassword(
{ newPassword: password, token },
{
onSuccess: () => {
toast.success("Password successfully updated");
router.push("/auth/sign-in");
},
onError: (error) => {
toast.error("Error", {
description: error.error.message,
});
},
},
);
};
return (
<div className="flex flex-col gap-6">
<Card>
<CardHeader className="text-center">
<CardTitle className="text-xl">Reset password</CardTitle>
<CardDescription>Enter your new password</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleSubmit}>
<div className="grid gap-6">
<div className="grid gap-6">
<div className="grid gap-3">
<Label htmlFor="password">New password</Label>
<Input
id="password"
type="password"
required
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
</div>
<div className="grid gap-3">
<Label htmlFor="confirmPassword">Confirm password</Label>
<Input
id="confirmPassword"
type="password"
required
value={confirmPassword}
onChange={(e) => setConfirmPassword(e.target.value)}
/>
</div>
<Button type="submit" className="w-full">
Set password
</Button>
</div>
<div className="text-center text-sm">
Back to{" "}
<Link
href="/auth/sign-in"
className="underline underline-offset-4"
>
Sign in
</Link>
</div>
</div>
</form>
</CardContent>
</Card>
</div>
);
}

View File

@@ -0,0 +1,124 @@
"use client";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { type SSOProviderType, useAuth } from "jazz-react-auth-betterauth";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { toast } from "sonner";
import { SSOButton } from "./SSOButton";
interface Props {
providers: SSOProviderType[];
}
export function SigninForm({ providers }: Props) {
const router = useRouter();
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const auth = useAuth();
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
await auth.authClient.signIn.email(
{ email, password },
{
onSuccess: async () => {
await auth.logIn();
router.push("/");
},
onError: (error) => {
toast.error("Error", {
description: error.error.message,
});
},
},
);
};
return (
<div className="flex flex-col gap-6">
<Card>
<CardHeader className="text-center">
<CardTitle className="text-xl">Welcome back</CardTitle>
<CardDescription>
Sign in with one of the following providers
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleSubmit}>
<div className="grid gap-6">
{providers.length > 0 && (
<>
<div className="flex flex-col gap-4">
{providers?.map((provider) => (
<SSOButton key={provider} provider={provider} />
))}
</div>
<div className="after:border-border relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t">
<span className="bg-card text-muted-foreground relative z-10 px-2">
Or continue with
</span>
</div>
</>
)}
<div className="grid gap-6">
<div className="grid gap-3">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
placeholder="you@example.com"
required
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
</div>
<div className="grid gap-3">
<div className="flex items-center justify-between">
<Label htmlFor="password">Password</Label>
<Link
href="/auth/forgot-password"
className="ml-auto inline-block text-sm underline-offset-4 hover:underline"
>
Forgot your password?
</Link>
</div>
<Input
id="password"
type="password"
required
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
</div>
<Button type="submit" className="w-full">
Sign in
</Button>
</div>
<div className="text-center text-sm">
Don&apos;t have an account?{" "}
<Link
href="/auth/sign-up"
className="underline underline-offset-4"
>
Sign up
</Link>
</div>
</div>
</form>
</CardContent>
</Card>
</div>
);
}

View File

@@ -0,0 +1,151 @@
"use client";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { type SSOProviderType, useAuth } from "jazz-react-auth-betterauth";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { toast } from "sonner";
import { SSOButton } from "./SSOButton";
interface Props {
providers: SSOProviderType[];
}
export function SignupForm({ providers }: Props) {
const router = useRouter();
const auth = useAuth();
const [name, setName] = useState("");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [confirmPassword, setConfirmPassword] = useState("");
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (password !== confirmPassword) {
toast.error("Error", {
description: "Passwords do not match",
});
return;
}
await auth.authClient.signUp.email(
{
email,
password,
name,
},
{
onSuccess: async () => {
await auth.signIn();
router.push("/");
},
onError: (error) => {
toast.error("Sign up error", {
description: error.error.message,
});
},
},
);
};
return (
<div className="flex flex-col gap-6">
<Card>
<CardHeader className="text-center">
<CardTitle className="text-xl">Welcome</CardTitle>
<CardDescription>
Sign up with one of the following providers
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleSubmit}>
<div className="grid gap-6">
{providers.length > 0 && (
<>
<div className="flex flex-col gap-4">
{providers?.map((provider) => (
<SSOButton key={provider} provider={provider} />
))}
</div>
<div className="after:border-border relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t">
<span className="bg-card text-muted-foreground relative z-10 px-2">
Or continue with
</span>
</div>
</>
)}
<div className="grid gap-6">
<div className="grid gap-3">
<Label htmlFor="name">Name</Label>
<Input
id="name"
type="text"
placeholder="John Doe"
required
value={name}
onChange={(e) => setName(e.target.value)}
/>
</div>
<div className="grid gap-3">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
placeholder="you@example.com"
required
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
</div>
<div className="grid gap-3">
<Label htmlFor="password">Password</Label>
<Input
id="password"
type="password"
placeholder="********"
required
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
</div>
<div className="grid gap-3">
<Label htmlFor="confirmPassword">Confirm password</Label>
<Input
id="confirmPassword"
type="password"
required
value={confirmPassword}
onChange={(e) => setConfirmPassword(e.target.value)}
/>
</div>
<Button type="submit" className="w-full">
Sign up
</Button>
</div>
<div className="text-center text-sm">
Already have an account?{" "}
<Link
href="/auth/sign-in"
className="underline underline-offset-4"
>
Sign in
</Link>
</div>
</div>
</form>
</CardContent>
</Card>
</div>
);
}

View File

@@ -0,0 +1,59 @@
import { Slot } from "@radix-ui/react-slot";
import { type VariantProps, cva } from "class-variance-authority";
import * as React from "react";
import { cn } from "@/lib/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
destructive:
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline:
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
secondary:
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
ghost:
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-9 px-4 py-2 has-[>svg]:px-3",
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
icon: "size-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
);
function Button({
className,
variant,
size,
asChild = false,
...props
}: React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean;
}) {
const Comp = asChild ? Slot : "button";
return (
<Comp
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
{...props}
/>
);
}
export { Button, buttonVariants };

View File

@@ -0,0 +1,92 @@
import * as React from "react";
import { cn } from "@/lib/utils";
function Card({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card"
className={cn(
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
className,
)}
{...props}
/>
);
}
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-header"
className={cn(
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
className,
)}
{...props}
/>
);
}
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-title"
className={cn("leading-none font-semibold", className)}
{...props}
/>
);
}
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-description"
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
);
}
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-action"
className={cn(
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
className,
)}
{...props}
/>
);
}
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-content"
className={cn("px-6", className)}
{...props}
/>
);
}
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-footer"
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
{...props}
/>
);
}
export {
Card,
CardHeader,
CardFooter,
CardTitle,
CardAction,
CardDescription,
CardContent,
};

View File

@@ -0,0 +1,21 @@
import * as React from "react";
import { cn } from "@/lib/utils";
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
<input
type={type}
data-slot="input"
className={cn(
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
className,
)}
{...props}
/>
);
}
export { Input };

View File

@@ -0,0 +1,22 @@
import * as LabelPrimitive from "@radix-ui/react-label";
import * as React from "react";
import { cn } from "@/lib/utils";
function Label({
className,
...props
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
return (
<LabelPrimitive.Root
data-slot="label"
className={cn(
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
className,
)}
{...props}
/>
);
}
export { Label };

View File

@@ -0,0 +1,22 @@
"use client";
import { Toaster as Sonner, type ToasterProps } from "sonner";
const Toaster = ({ ...props }: ToasterProps) => {
return (
<Sonner
theme="light"
className="toaster group"
style={
{
"--normal-bg": "var(--popover)",
"--normal-text": "var(--popover-foreground)",
"--normal-border": "var(--border)",
} as React.CSSProperties
}
{...props}
/>
);
};
export { Toaster };

View File

@@ -0,0 +1,60 @@
"use client";
import { Button } from "@/components/ui/button";
import { useAccount, useIsAuthenticated } from "jazz-react";
import { useAuth } from "jazz-react-auth-betterauth";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { toast } from "sonner";
export function UserSettings() {
const router = useRouter();
const { authClient } = useAuth();
const { logOut } = useAccount();
const isAuthenticated = useIsAuthenticated();
if (!isAuthenticated) {
return (
<div className="flex flex-col gap-8">
<h1 className="text-center text-2xl">Forbidden</h1>
<p className="text-center text-sm text-muted-foreground">
Please{" "}
<Link href="/auth/sign-in" className="underline text-primary">
sign in
</Link>{" "}
to access this page.
</p>
</div>
);
}
return (
<>
<div className="flex flex-col gap-8">
<h1 className="text-4xl font-semibold">Settings</h1>
<Button
variant="destructive"
className="relative"
type="button"
onClick={async (e) => {
e.preventDefault();
authClient.deleteUser(undefined, {
onSuccess: () => {
logOut();
router.push("/");
},
onError: (error) => {
toast.error("Error", {
description: error.error.message,
});
},
});
}}
>
Delete account
</Button>
</div>
</>
);
}

View File

@@ -0,0 +1,50 @@
import { betterAuth } from "better-auth";
import { getMigrations } from "better-auth/db";
import Database from "better-sqlite3";
import { jazzPlugin } from "jazz-betterauth-server-plugin";
import { socialProviders } from "./socialProviders";
export const auth = await (async () => {
// Configure Better Auth server
const auth = betterAuth({
appName: "Jazz Example: Better Auth",
database: new Database("sqlite.db"),
emailAndPassword: {
enabled: true,
async sendResetPassword({ url }) {
// Here we can send an email to the user with the reset password link
console.log("****** RESET PASSWORD ******");
console.log("navigate to", url, "to reset your password");
console.log("******");
},
},
emailVerification: {
async sendVerificationEmail(data) {
console.error("Not implemented");
},
},
socialProviders,
user: {
deleteUser: {
enabled: true,
},
},
plugins: [jazzPlugin()],
databaseHooks: {
user: {
create: {
async after(user) {
// Here we can send a welcome email to the user
console.error("Not implemented");
},
},
},
},
});
// Run database migrations
const migrations = await getMigrations(auth.options);
await migrations.runMigrations();
return auth;
})();

View File

@@ -0,0 +1,186 @@
const apple =
process.env.APPLE_CLIENT_ID &&
process.env.APPLE_CLIENT_SECRET &&
process.env.APPLE_APP_BUNDLE_IDENTIFIER
? {
apple: {
clientId: process.env.APPLE_CLIENT_ID as string,
clientSecret: process.env.APPLE_CLIENT_SECRET as string,
// For native iOS
appBundleIdentifier: process.env
.APPLE_APP_BUNDLE_IDENTIFIER as string,
},
}
: undefined;
const discord =
process.env.DISCORD_CLIENT_ID && process.env.DISCORD_CLIENT_SECRET
? {
discord: {
clientId: process.env.DISCORD_CLIENT_ID as string,
clientSecret: process.env.DISCORD_CLIENT_SECRET as string,
},
}
: undefined;
const facebook =
process.env.FACEBOOK_CLIENT_ID && process.env.FACEBOOK_CLIENT_SECRET
? {
facebook: {
clientId: process.env.FACEBOOK_CLIENT_ID as string,
clientSecret: process.env.FACEBOOK_CLIENT_SECRET as string,
},
}
: undefined;
const github =
process.env.GITHUB_CLIENT_ID && process.env.GITHUB_CLIENT_SECRET
? {
github: {
clientId: process.env.GITHUB_CLIENT_ID as string,
clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
},
}
: undefined;
const google =
process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET
? {
google: {
clientId: process.env.GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
},
}
: undefined;
const kick =
process.env.KICK_CLIENT_ID && process.env.KICK_CLIENT_SECRET
? {
kick: {
clientId: process.env.KICK_CLIENT_ID as string,
clientSecret: process.env.KICK_CLIENT_SECRET as string,
},
}
: undefined;
const microsoft =
process.env.MICROSOFT_CLIENT_ID && process.env.MICROSOFT_CLIENT_SECRET
? {
microsoft: {
clientId: process.env.MICROSOFT_CLIENT_ID as string,
clientSecret: process.env.MICROSOFT_CLIENT_SECRET as string,
tenantId: "common",
requireSelectAccount: true,
},
}
: undefined;
const tiktok =
process.env.TIKTOK_CLIENT_ID &&
process.env.TIKTOK_CLIENT_SECRET &&
process.env.TIKTOK_CLIENT_KEY
? {
tiktok: {
clientId: process.env.TIKTOK_CLIENT_ID,
clientSecret: process.env.TIKTOK_CLIENT_SECRET,
clientKey: process.env.TIKTOK_CLIENT_KEY,
},
}
: undefined;
const twitch =
process.env.TWITCH_CLIENT_ID && process.env.TWITCH_CLIENT_SECRET
? {
twitch: {
clientId: process.env.TWITCH_CLIENT_ID as string,
clientSecret: process.env.TWITCH_CLIENT_SECRET as string,
},
}
: undefined;
const twitter =
process.env.TWITTER_CLIENT_ID && process.env.TWITTER_CLIENT_SECRET
? {
twitter: {
clientId: process.env.TWITTER_CLIENT_ID,
clientSecret: process.env.TWITTER_CLIENT_SECRET,
},
}
: undefined;
const dropbox =
process.env.DROPBOX_CLIENT_ID && process.env.DROPBOX_CLIENT_SECRET
? {
dropbox: {
clientId: process.env.DROPBOX_CLIENT_ID as string,
clientSecret: process.env.DROPBOX_CLIENT_SECRET as string,
},
}
: undefined;
const linkedin =
process.env.LINKEDIN_CLIENT_ID && process.env.LINKEDIN_CLIENT_SECRET
? {
linkedin: {
clientId: process.env.LINKEDIN_CLIENT_ID as string,
clientSecret: process.env.LINKEDIN_CLIENT_SECRET as string,
},
}
: undefined;
const gitlab =
process.env.GITLAB_CLIENT_ID &&
process.env.GITLAB_CLIENT_SECRET &&
process.env.GITLAB_ISSUER
? {
gitlab: {
clientId: process.env.GITLAB_CLIENT_ID as string,
clientSecret: process.env.GITLAB_CLIENT_SECRET as string,
issuer: process.env.GITLAB_ISSUER as string,
},
}
: undefined;
const reddit =
process.env.REDDIT_CLIENT_ID && process.env.REDDIT_CLIENT_SECRET
? {
reddit: {
clientId: process.env.REDDIT_CLIENT_ID as string,
clientSecret: process.env.REDDIT_CLIENT_SECRET as string,
},
}
: undefined;
const roblox =
process.env.ROBLOX_CLIENT_ID && process.env.ROBLOX_CLIENT_SECRET
? {
roblox: {
clientId: process.env.ROBLOX_CLIENT_ID,
clientSecret: process.env.ROBLOX_CLIENT_SECRET,
},
}
: undefined;
const spotify =
process.env.SPOTIFY_CLIENT_ID && process.env.SPOTIFY_CLIENT_SECRET
? {
spotify: {
clientId: process.env.SPOTIFY_CLIENT_ID as string,
clientSecret: process.env.SPOTIFY_CLIENT_SECRET as string,
},
}
: undefined;
const vk =
process.env.VK_CLIENT_ID && process.env.VK_CLIENT_SECRET
? {
vk: {
clientId: process.env.VK_CLIENT_ID as string,
clientSecret: process.env.VK_CLIENT_SECRET as string,
},
}
: undefined;
export const socialProviders = {
...(apple && { ...apple }),
...(discord && { ...discord }),
...(facebook && { ...facebook }),
...(github && { ...github }),
...(google && { ...google }),
...(kick && { ...kick }),
...(microsoft && { ...microsoft }),
...(tiktok && { ...tiktok }),
...(twitch && { ...twitch }),
...(twitter && { ...twitter }),
...(dropbox && { ...dropbox }),
...(linkedin && { ...linkedin }),
...(gitlab && { ...gitlab }),
...(reddit && { ...reddit }),
...(roblox && { ...roblox }),
...(spotify && { ...spotify }),
...(vk && { ...vk }),
};

View File

@@ -0,0 +1,6 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

View File

@@ -0,0 +1,28 @@
import { randomBytes } from "node:crypto";
import { test } from "@playwright/test";
import { HomePage } from "./pages/HomePage";
test("should sign up, sign in, and logout", async ({ page }) => {
const username = randomBytes(4).toString("hex");
const email = `${username}@example.com`;
const password = randomBytes(8).toString("hex");
// Sign up
await page.goto("/");
const homePage = new HomePage(page);
await homePage.expectLoggedOut();
await homePage.signUpLink.click();
await homePage.signUpEmail(username, email, password);
await homePage.expectLoggedIn(username);
// Log out & sign in
await homePage.logout();
await homePage.expectLoggedOut();
await homePage.signInLink.click();
await homePage.signInEmail(email, password);
await homePage.expectLoggedIn(username);
// Logout
await homePage.logout();
await homePage.expectLoggedOut();
});

View File

@@ -0,0 +1,76 @@
import { type Page, expect } from "@playwright/test";
export class HomePage {
constructor(public page: Page) {}
usernameInput = this.page.getByRole("textbox", {
name: "Name",
exact: true,
});
emailInput = this.page.getByRole("textbox", {
name: "Email",
exact: true,
});
passwordInput = this.page.getByRole("textbox", {
name: "Password",
exact: true,
});
confirmPasswordInput = this.page.getByRole("textbox", {
name: "Confirm password",
exact: true,
});
signUpButton = this.page.getByRole("button", {
name: "Sign up",
exact: true,
});
signInButton = this.page.getByRole("button", {
name: "Sign in",
exact: true,
});
signUpLink = this.page.getByRole("link", {
name: "Sign up",
exact: true,
});
signInLink = this.page.getByRole("link", {
name: "Sign in",
exact: true,
});
logoutButton = this.page.getByRole("button", {
name: "Sign out",
exact: true,
});
async signUpEmail(name: string, email: string, password: string) {
await this.usernameInput.fill(name);
await this.emailInput.fill(email);
await this.passwordInput.fill(password);
await this.confirmPasswordInput.fill(password);
await this.signUpButton.click();
}
async signInEmail(email: string, password: string) {
await this.emailInput.fill(email);
await this.passwordInput.fill(password);
await this.signInButton.click();
}
async logout() {
await this.logoutButton.click();
}
async expectLoggedIn(name?: string) {
await expect(this.logoutButton).toBeVisible();
await expect(this.signInLink).not.toBeVisible();
await expect(this.signUpLink).not.toBeVisible();
if (name) {
await expect(this.page.getByText(`Signed in as ${name}`)).toBeVisible();
}
}
async expectLoggedOut() {
await expect(this.logoutButton).not.toBeVisible();
await expect(this.signInLink).toBeVisible();
await expect(this.signUpLink).toBeVisible();
await expect(this.page.getByText(`Anonymous user`)).toBeVisible();
}
}

View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -1,5 +1,269 @@
# chat-rn-expo-clerk
## 1.0.145
### Patch Changes
- Updated dependencies [048ac1d]
- jazz-tools@0.14.22
- jazz-expo@0.14.22
- jazz-react-native-media-images@0.14.22
## 1.0.144
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [cfb6786]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-expo@0.14.21
- jazz-react-native-media-images@0.14.21
## 1.0.143
### Patch Changes
- Updated dependencies [6f72419]
- Updated dependencies [04b20c2]
- jazz-tools@0.14.20
- jazz-expo@0.14.20
- jazz-react-native-media-images@0.14.20
## 1.0.142
### Patch Changes
- Updated dependencies [061ec99]
- jazz-expo@0.14.19
- jazz-react-native-media-images@0.14.19
- jazz-tools@0.14.19
## 1.0.141
### Patch Changes
- Updated dependencies [4b950bc]
- Updated dependencies [d6d9c0a]
- Updated dependencies [c559054]
- jazz-tools@0.14.18
- jazz-expo@0.14.18
- jazz-react-native-media-images@0.14.18
## 1.0.140
### Patch Changes
- Updated dependencies [e512df4]
- jazz-tools@0.14.17
- jazz-expo@0.14.17
- jazz-react-native-media-images@0.14.17
## 1.0.139
### Patch Changes
- jazz-expo@0.14.16
- jazz-tools@0.14.16
- jazz-react-native-media-images@0.14.16
## 1.0.138
### Patch Changes
- jazz-expo@0.14.15
- jazz-tools@0.14.15
- jazz-react-native-media-images@0.14.15
## 1.0.137
### Patch Changes
- Updated dependencies [e32a1f7]
- jazz-tools@0.14.14
- jazz-expo@0.14.14
- jazz-react-native-media-images@0.14.14
## 1.0.136
### Patch Changes
- jazz-expo@0.14.13
## 1.0.135
### Patch Changes
- jazz-expo@0.14.12
## 1.0.134
### Patch Changes
- Updated dependencies [98d697f]
- jazz-expo@0.14.11
## 1.0.133
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react-native-media-images@0.14.10
- jazz-tools@0.14.10
- jazz-expo@0.14.10
## 1.0.132
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-expo@0.14.9
- jazz-react-native-media-images@0.14.9
## 1.0.131
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-expo@0.14.8
- jazz-react-native-media-images@0.14.8
## 1.0.130
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-expo@0.14.7
- jazz-react-native-media-images@0.14.7
## 1.0.129
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-expo@0.14.6
- jazz-react-native-media-images@0.14.6
## 1.0.128
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-expo@0.14.5
- jazz-react-native-media-images@0.14.5
## 1.0.127
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-expo@0.14.4
- jazz-react-native-media-images@0.14.4
## 1.0.126
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-expo@0.14.2
- jazz-react-native-media-images@0.14.2
## 1.0.125
### Patch Changes
- Updated dependencies [cdfc105]
- jazz-tools@0.14.1
- jazz-expo@0.14.1
- jazz-react-native-media-images@0.14.1
## 1.0.124
### Patch Changes
- Updated dependencies [5835ed1]
- jazz-tools@0.14.0
- jazz-expo@0.14.0
- jazz-react-native-media-images@0.14.0
## 1.0.123
### Patch Changes
- jazz-expo@0.13.32
## 1.0.122
### Patch Changes
- Updated dependencies [e5b170f]
- jazz-tools@0.13.31
- jazz-expo@0.13.31
- jazz-react-native-media-images@0.13.31
## 1.0.121
### Patch Changes
- jazz-expo@0.13.30
- jazz-tools@0.13.30
- jazz-react-native-media-images@0.13.30
## 1.0.120
### Patch Changes
- jazz-expo@0.13.29
- jazz-tools@0.13.29
- jazz-react-native-media-images@0.13.29
## 1.0.119
### Patch Changes
- jazz-expo@0.13.28
- jazz-tools@0.13.28
- jazz-react-native-media-images@0.13.28
## 1.0.118
### Patch Changes
- jazz-expo@0.13.27
- jazz-tools@0.13.27
- jazz-react-native-media-images@0.13.27
## 1.0.117
### Patch Changes
- Updated dependencies [ff846d9]
- jazz-tools@0.13.26
- jazz-expo@0.13.26
- jazz-react-native-media-images@0.13.26
## 1.0.116
### Patch Changes
- jazz-expo@0.13.25
- jazz-tools@0.13.25
- jazz-react-native-media-images@0.13.25
## 1.0.115
### Patch Changes

View File

@@ -7,7 +7,7 @@ import { useLocalSearchParams } from "expo-router";
import { useAccount, useCoState } from "jazz-expo";
import { ProgressiveImg } from "jazz-expo";
import { createImage } from "jazz-react-native-media-images";
import { Group, ID } from "jazz-tools";
import { CoPlainText, Group, Loaded } from "jazz-tools";
import { useEffect, useLayoutEffect, useState } from "react";
import React, {
SafeAreaView,
@@ -26,7 +26,7 @@ import React, {
export default function Conversation() {
const { chatId } = useLocalSearchParams();
const { me } = useAccount();
const [chat, setChat] = useState<Chat>();
const [chat, setChat] = useState<Loaded<typeof Chat>>();
const [message, setMessage] = useState("");
const loadedChat = useCoState(Chat, chat?.id, { resolve: { $each: true } });
const navigation = useNavigation();
@@ -37,7 +37,7 @@ export default function Conversation() {
if (chatId === "new") {
createChat();
} else {
loadChat(chatId as ID<Chat>);
loadChat(chatId as string);
}
}, [chat]);
@@ -69,10 +69,10 @@ export default function Conversation() {
setChat(chat);
};
const loadChat = async (chatId: ID<Chat>) => {
const loadChat = async (chatId: string) => {
try {
const chat = await Chat.load(chatId, me);
setChat(chat);
const chat = await Chat.load(chatId);
if (chat) setChat(chat);
} catch (error) {
console.log("Error loading chat", error);
Alert.alert("Error", `Error loading chat: ${error}`);
@@ -82,7 +82,12 @@ export default function Conversation() {
const sendMessage = () => {
if (!chat) return;
if (message.trim()) {
chat.push(Message.create({ text: message }, { owner: chat._owner }));
chat.push(
Message.create(
{ text: CoPlainText.create(message, chat._owner) },
chat._owner,
),
);
setMessage("");
}
};
@@ -104,7 +109,12 @@ export default function Conversation() {
maxSize: 2048,
});
chat.push(Message.create({ text: "", image }, { owner: chat._owner }));
chat.push(
Message.create(
{ text: CoPlainText.create("", chat._owner), image },
chat._owner,
),
);
}
} catch (error) {
Alert.alert("Error", "Failed to upload image");
@@ -113,8 +123,8 @@ export default function Conversation() {
}
};
const renderMessageItem = ({ item }: { item: Message }) => {
const isMe = item._edits.text.by?.isMe;
const renderMessageItem = ({ item }: { item: Loaded<typeof Message> }) => {
const isMe = item._edits.text?.by?.isMe;
return (
<View
className={clsx(
@@ -129,7 +139,7 @@ export default function Conversation() {
isMe ? "text-right" : "text-left",
)}
>
{item._edits.text.by?.profile?.name}
{item._edits.text?.by?.profile?.name}
</Text>
) : null}
<View
@@ -165,8 +175,8 @@ export default function Conversation() {
!isMe ? "mt-2 text-gray-500" : "mt-1 text-gray-200",
)}
>
{item._edits.text.madeAt?.getHours().toString().padStart(2, "0")}:
{item._edits.text.madeAt?.getMinutes().toString().padStart(2, "0")}
{item._edits.text?.madeAt?.getHours().toString().padStart(2, "0")}:
{item._edits.text?.madeAt?.getMinutes().toString().padStart(2, "0")}
</Text>
</View>
</View>

View File

@@ -32,7 +32,7 @@ export default function ChatScreen() {
});
}, [navigation]);
const loadChat = async (chatId: ID<Chat> | "new") => {
const loadChat = async (chatId: string | "new") => {
router.navigate(`/chat/${chatId}`);
};
@@ -49,7 +49,7 @@ export default function ChatScreen() {
text: "Join",
onPress: (chatId) => {
if (chatId) {
loadChat(chatId as ID<Chat>);
loadChat(chatId);
} else {
Alert.alert("Error", "Chat ID cannot be empty.");
}

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-expo-clerk",
"main": "index.js",
"version": "1.0.115",
"version": "1.0.145",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",
@@ -18,50 +18,50 @@
"@bam.tech/react-native-image-resizer": "^3.0.11",
"@clerk/clerk-expo": "^2.2.21",
"@craftzdog/react-native-buffer": "6.0.5",
"@expo/vector-icons": "^14.0.2",
"@expo/vector-icons": "^14.1.0",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "7.0.19",
"@react-navigation/native-stack": "7.2.1",
"clsx": "^2.0.0",
"expo": "^52.0.42",
"expo-build-properties": "~0.13.1",
"expo-clipboard": "~7.0.0",
"expo-constants": "~17.0.8",
"expo-crypto": "~14.0.2",
"expo-dev-client": "~5.0.16",
"expo-file-system": "^18.0.4",
"expo-font": "~13.0.1",
"expo-image-picker": "~16.0.6",
"expo-linking": "~7.0.5",
"expo-router": "~4.0.19",
"expo-secure-store": "~14.0.0",
"expo-splash-screen": "~0.29.22",
"expo-sqlite": "15.1.3",
"expo-status-bar": "~2.0.1",
"expo-web-browser": "~14.0.1",
"expo": "^53.0.8",
"expo-build-properties": "~0.14.6",
"expo-clipboard": "~7.1.4",
"expo-constants": "~17.1.6",
"expo-crypto": "~14.1.4",
"expo-dev-client": "~5.1.8",
"expo-file-system": "^18.1.9",
"expo-font": "~13.3.1",
"expo-image-picker": "~16.1.4",
"expo-linking": "~7.1.4",
"expo-router": "~5.0.6",
"expo-secure-store": "~14.2.3",
"expo-splash-screen": "~0.30.8",
"expo-sqlite": "15.2.9",
"expo-status-bar": "~2.2.3",
"expo-web-browser": "~14.1.6",
"jazz-expo": "workspace:*",
"jazz-react-native-media-images": "workspace:*",
"jazz-tools": "workspace:*",
"nativewind": "^4.1.21",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.76.7",
"react-native-gesture-handler": "~2.20.2",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-native": "0.79.2",
"react-native-gesture-handler": "~2.24.0",
"react-native-get-random-values": "^1.11.0",
"react-native-reanimated": "~3.16.3",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "4.4.0",
"react-native-reanimated": "~3.17.5",
"react-native-safe-area-context": "5.4.0",
"react-native-screens": "4.10.0",
"react-native-url-polyfill": "^2.0.0",
"react-native-web": "~0.19.13",
"react-native-web": "~0.20.0",
"readable-stream": "4.7.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/react": "~18.3.12",
"@types/react": "~19.0.14",
"@types/react-test-renderer": "^19.0.0",
"react-test-renderer": "18.3.1",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2"
"typescript": "5.8.3"
},
"private": true
}

View File

@@ -1,8 +1,8 @@
import { CoList, CoMap, ImageDefinition, co } from "jazz-tools";
import { CoList, co, coField, z } from "jazz-tools";
export class Message extends CoMap {
text = co.string;
image = co.optional.ref(ImageDefinition);
}
export const Message = co.map({
text: co.plainText(),
image: z.optional(co.image()),
});
export class Chat extends CoList.Of(co.ref(Message)) {}
export const Chat = co.list(Message);

View File

@@ -7,8 +7,10 @@ node_modules/
.expo/
dist/
web-build/
expo-env.d.ts
# Native
.kotlin/
*.orig.*
*.jks
*.p8
@@ -33,6 +35,5 @@ yarn-error.*
# typescript
*.tsbuildinfo
ios
android
android/
ios/

View File

@@ -1,861 +1,107 @@
# chat-rn-expo
## 1.0.102
### Patch Changes
- Updated dependencies [02a240c]
- jazz-tools@0.13.23
- jazz-expo@0.13.23
## 1.0.101
### Patch Changes
- jazz-expo@0.13.22
## 1.0.100
### Patch Changes
- jazz-expo@0.13.21
- jazz-tools@0.13.21
## 1.0.99
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-expo@0.13.20
## 1.0.98
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-expo@0.13.19
## 1.0.97
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-expo@0.13.18
## 1.0.96
### Patch Changes
- jazz-expo@0.13.17
- jazz-tools@0.13.17
## 1.0.95
### Patch Changes
- jazz-expo@0.13.16
- jazz-tools@0.13.16
## 1.0.94
### Patch Changes
- jazz-expo@0.13.15
- jazz-tools@0.13.15
## 1.0.93
### Patch Changes
- Updated dependencies [bd94012]
- jazz-expo@0.13.14
- jazz-tools@0.13.14
## 1.0.92
### Patch Changes
- jazz-expo@0.13.13
- jazz-tools@0.13.13
## 1.0.91
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-expo@0.13.12
## 1.0.90
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-expo@0.13.11
## 1.0.89
### Patch Changes
- jazz-expo@0.13.10
- jazz-tools@0.13.10
## 1.0.88
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-expo@0.13.9
## 1.0.87
### Patch Changes
- jazz-expo@0.13.8
## 1.0.86
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-expo@0.13.7
## 1.0.85
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-expo@0.13.5
## 1.0.84
### Patch Changes
- Updated dependencies [3129982]
- Updated dependencies [3129982]
- jazz-expo@0.13.4
- jazz-tools@0.13.4
## 1.0.83
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-expo@0.13.3
## 1.0.82
### Patch Changes
- jazz-expo@0.13.2
- jazz-tools@0.13.2
## 1.0.81
### Patch Changes
- Updated dependencies [63a7aa0]
- jazz-expo@0.13.1
## 1.0.80
### Patch Changes
- Updated dependencies [bce3bcc]
- Updated dependencies [afd1374]
- jazz-expo@0.13.0
- jazz-tools@0.13.0
## 1.0.88
### Patch Changes
- jazz-react-native@0.12.2
- jazz-tools@0.12.2
## 1.0.87
### Patch Changes
- jazz-react-native@0.12.1
- jazz-tools@0.12.1
## 1.0.86
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-react-native@0.12.0
## 1.0.85
### Patch Changes
- jazz-react-native@0.11.8
- jazz-tools@0.11.8
## 1.0.84
### Patch Changes
- Updated dependencies [a140f55]
- Updated dependencies [2b0d1b0]
- jazz-tools@0.11.7
- jazz-react-native@0.11.7
## 1.0.83
### Patch Changes
- Updated dependencies [e7c85b7]
- jazz-react-native@0.11.6
- jazz-tools@0.11.6
## 1.0.82
### Patch Changes
- jazz-react-native@0.11.5
- jazz-tools@0.11.5
## 1.0.81
### Patch Changes
- Updated dependencies [57a3dbe]
- Updated dependencies [a717754]
- Updated dependencies [a91f343]
- jazz-tools@0.11.4
- jazz-react-native@0.11.4
## 1.0.80
### Patch Changes
- jazz-react-native@0.11.3
- jazz-tools@0.11.3
## 1.0.79
### Patch Changes
- Updated dependencies [6892dc6]
- jazz-tools@0.11.2
- jazz-react-native@0.11.2
## 1.0.78
### Patch Changes
- jazz-react-native@0.11.1
## 1.0.77
### Patch Changes
- Updated dependencies [6a96d8b]
- Updated dependencies [a35249a]
- Updated dependencies [b9d194a]
- Updated dependencies [a4713df]
- Updated dependencies [34cbdc3]
- Updated dependencies [f039e8f]
- Updated dependencies [e22de9f]
- jazz-tools@0.11.0
- jazz-react-native@0.11.0
## 1.0.76
### Patch Changes
- Updated dependencies [2f99de0]
- jazz-tools@0.10.15
- jazz-react-native@0.10.15
## 1.0.75
### Patch Changes
- Updated dependencies [75211e3]
- jazz-tools@0.10.14
- jazz-react-native@0.10.14
## 1.0.74
### Patch Changes
- Updated dependencies [07feedd]
- jazz-tools@0.10.13
- jazz-react-native@0.10.13
## 1.0.73
### Patch Changes
- Updated dependencies [4612e05]
- jazz-tools@0.10.12
- jazz-react-native@0.10.12
## 1.0.72
### Patch Changes
- Updated dependencies [5a54e4a]
- jazz-react-native@0.10.11
## 1.0.71
### Patch Changes
- Updated dependencies [3405d8f]
- jazz-react-native@0.10.10
## 1.0.70
### Patch Changes
- Updated dependencies [2fb6428]
- jazz-tools@0.10.8
- jazz-react-native@0.10.8
## 1.0.69
### Patch Changes
- Updated dependencies [1136d9b]
- Updated dependencies [0eed228]
- jazz-react-native@0.10.7
- jazz-tools@0.10.7
## 1.0.68
### Patch Changes
- Updated dependencies [ada802b]
- jazz-tools@0.10.6
- jazz-react-native@0.10.6
## 1.0.67
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react-native@0.10.5
## 1.0.66
### Patch Changes
- jazz-react-native@0.10.4
- jazz-tools@0.10.4
## 1.0.65
### Patch Changes
- Updated dependencies [d8582fc]
- jazz-tools@0.10.3
- jazz-react-native@0.10.3
## 1.0.64
### Patch Changes
- jazz-react-native@0.10.2
- jazz-tools@0.10.2
## 1.0.63
### Patch Changes
- Updated dependencies [5a63cba]
- jazz-tools@0.10.1
- jazz-react-native@0.10.1
## 1.0.62
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react-native@0.10.0
- jazz-tools@0.10.0
## 1.0.61
### Patch Changes
- jazz-react-native@0.9.23
- jazz-tools@0.9.23
## 1.0.60
### Patch Changes
- jazz-react-native@0.9.22
## 1.0.59
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-react-native@0.9.21
## 1.0.58
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-react-native@0.9.20
## 1.0.57
### Patch Changes
- jazz-react-native@0.9.19
- jazz-tools@0.9.19
## 1.0.56
### Patch Changes
- jazz-react-native@0.9.18
- jazz-tools@0.9.18
## 1.0.55
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-react-native@0.9.17
## 1.0.54
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-react-native@0.9.16
## 1.0.53
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-react-native@0.9.15
## 1.0.52
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-react-native@0.9.14
## 1.0.51
### Patch Changes
- jazz-react-native@0.9.13
- jazz-tools@0.9.13
## 1.0.50
### Patch Changes
- jazz-react-native@0.9.12
- jazz-tools@0.9.12
## 1.0.49
### Patch Changes
- jazz-react-native@0.9.11
- jazz-tools@0.9.11
## 1.0.48
### Patch Changes
- Updated dependencies [f76274c]
- Updated dependencies [5e83864]
- jazz-react-native@0.9.10
- jazz-tools@0.9.10
## 1.0.47
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-react-native@0.9.9
## 1.0.46
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react-native@0.9.8
## 1.0.45
### Patch Changes
- Updated dependencies [8a390d2]
- jazz-react-native@0.9.6
## 1.0.44
### Patch Changes
- Updated dependencies [c871912]
- jazz-react-native@0.9.5
## 1.0.43
### Patch Changes
- jazz-react-native@0.9.4
## 1.0.42
### Patch Changes
- Updated dependencies [7cd691f]
- jazz-react-native@0.9.3
## 1.0.41
### Patch Changes
- Updated dependencies [80fd3e9]
- jazz-react-native@0.9.2
## 1.0.40
### Patch Changes
- Updated dependencies [1b71969]
- jazz-tools@0.9.1
- jazz-react-native@0.9.1
## 1.0.39
### Patch Changes
- Updated dependencies [1da4d55]
- Updated dependencies [8eda792]
- Updated dependencies [1e5e3a1]
- jazz-react-native@0.9.0
- jazz-tools@0.9.0
## 1.0.38
### Patch Changes
- Updated dependencies [dc62b95]
- Updated dependencies [1de26f8]
- jazz-tools@0.8.51
- jazz-react-native@0.8.51
## 1.0.37
### Patch Changes
- jazz-react-native@0.8.50
- jazz-tools@0.8.50
## 1.0.36
### Patch Changes
- jazz-react-native@0.8.49
- jazz-tools@0.8.49
## 1.0.35
### Patch Changes
- Updated dependencies [635e824]
- Updated dependencies [0a85982]
- jazz-tools@0.8.48
- jazz-react-native@0.8.48
## 1.0.34
### Patch Changes
- Updated dependencies [33ef9c4]
- jazz-react-native@0.8.47
## 1.0.33
### Patch Changes
- Updated dependencies [ab4ffbd]
- jazz-react-native@0.8.46
## 1.0.32
### Patch Changes
- Updated dependencies [7701307]
- Updated dependencies [fa41f8e]
- Updated dependencies [88d7d9a]
- Updated dependencies [60e35ea]
- jazz-react-native@0.8.45
- jazz-tools@0.8.45
## 1.0.31
### Patch Changes
- jazz-react-native@0.8.44
- jazz-tools@0.8.44
## 1.0.30
### Patch Changes
- jazz-react-native@0.8.41
- jazz-tools@0.8.41
## 1.0.29
### Patch Changes
- Updated dependencies [0c6b0f3]
- Updated dependencies [249eecb]
- jazz-react-native@0.8.39
- jazz-tools@0.8.39
## 1.0.28
### Patch Changes
- jazz-react-native@0.8.38
- jazz-tools@0.8.38
## 1.0.27
### Patch Changes
- jazz-react-native@0.8.37
- jazz-tools@0.8.37
## 1.0.26
### Patch Changes
- Updated dependencies [c84764a]
- Updated dependencies [441fe27]
- jazz-react-native@0.8.36
- jazz-tools@0.8.36
## 1.0.25
### Patch Changes
- Updated dependencies [8b87117]
- jazz-tools@0.8.35
- jazz-react-native@0.8.35
## 1.0.24
### Patch Changes
- jazz-react-native@0.8.34
- jazz-tools@0.8.34
## 1.0.23
### Patch Changes
- Updated dependencies [df42b2b]
- jazz-tools@0.8.32
- jazz-react-native@0.8.32
## 1.0.22
### Patch Changes
- jazz-react-native@0.8.31
- jazz-tools@0.8.31
## 1.0.21
### Patch Changes
- jazz-react-native@0.8.30
- jazz-tools@0.8.30
## 1.0.20
### Patch Changes
- jazz-react-native@0.8.29
- jazz-tools@0.8.29
## 1.0.19
### Patch Changes
- jazz-react-native@0.8.28
- jazz-tools@0.8.28
## 1.0.18
### Patch Changes
- jazz-react-native@0.8.27
- jazz-tools@0.8.27
## 1.0.17
### Patch Changes
- Updated dependencies [d348c2d]
- Updated dependencies [6902b5b]
- Updated dependencies [1a0cd3d]
- jazz-tools@0.8.23
- jazz-react-native@0.8.23
## 1.0.16
### Patch Changes
- Updated dependencies [149ca97]
- jazz-tools@0.8.21
- jazz-react-native@0.8.21
## 1.0.15
### Patch Changes
- Updated dependencies [3ef3ff3]
- jazz-react-native@0.8.20
## 1.0.14
### Patch Changes
- jazz-react-native@0.8.19
- jazz-tools@0.8.19
## 1.0.13
### Patch Changes
- jazz-react-native@0.8.18
- jazz-tools@0.8.18
- Updated dependencies [048ac1d]
- jazz-tools@0.14.22
- jazz-expo@0.14.22
## 1.0.12
### Patch Changes
- jazz-react-native@0.8.17
- jazz-tools@0.8.17
- Updated dependencies [e7e505e]
- Updated dependencies [cfb6786]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-expo@0.14.21
## 1.0.11
### Patch Changes
- jazz-react-native@0.8.16
- jazz-tools@0.8.16
- Updated dependencies [6f72419]
- Updated dependencies [04b20c2]
- jazz-tools@0.14.20
- jazz-expo@0.14.20
## 1.0.10
### Patch Changes
- Updated dependencies [cce679b]
- jazz-tools@0.8.15
- jazz-react-native@0.8.15
- Updated dependencies [061ec99]
- jazz-expo@0.14.19
- jazz-tools@0.14.19
## 1.0.9
### Patch Changes
- Updated dependencies [36273b3]
- jazz-tools@0.8.14
- jazz-react-native@0.8.14
- Updated dependencies [4b950bc]
- Updated dependencies [d6d9c0a]
- Updated dependencies [c559054]
- jazz-tools@0.14.18
- jazz-expo@0.14.18
## 1.0.8
### Patch Changes
- Updated dependencies [fd011d7]
- jazz-tools@0.8.13
- jazz-react-native@0.8.13
- Updated dependencies [e512df4]
- jazz-tools@0.14.17
- jazz-expo@0.14.17
## 1.0.7
### Patch Changes
- jazz-react-native@0.8.12
- jazz-tools@0.8.12
- jazz-expo@0.14.16
- jazz-tools@0.14.16
## 1.0.6
### Patch Changes
- jazz-react-native@0.8.11
- jazz-tools@0.8.11
- jazz-expo@0.14.15
- jazz-tools@0.14.15
## 1.0.5
### Patch Changes
- b7639cf: feat(react-native): replaced react-native-mmkv with expo-secure-store and initialize it by default as kvStore in createJazzRNApp() (BREAKING)
- Updated dependencies [b7639cf]
- jazz-react-native@0.8.8
- Updated dependencies [e32a1f7]
- jazz-tools@0.14.14
- jazz-expo@0.14.14
## 1.0.4
### Patch Changes
- Updated dependencies [32b05b6]
- jazz-react-native@0.8.7
- jazz-expo@0.14.13
## 1.0.3
### Patch Changes
- jazz-react-native@0.8.6
- jazz-expo@0.14.12
## 1.0.2
### Patch Changes
- Updated dependencies [c3f4e6b]
- Updated dependencies [d9152ed]
- jazz-react-native@0.8.5
- jazz-tools@0.8.5
- Updated dependencies [98d697f]
- jazz-expo@0.14.11
## 1.0.1
### Patch Changes
- Updated dependencies
- jazz-react-native@0.8.3
- jazz-tools@0.8.3
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-tools@0.14.10
- jazz-expo@0.14.10

View File

@@ -1,24 +0,0 @@
# 🎷 Jazz + Expo + `react-navigation` + Demo Auth
## 🚀 How to Run
### 1. Inside the Workspace Root
First, install dependencies and build the project:
```bash
pnpm i
pnpm run build
```
### 2. Inside the `examples/chat-rn-expo` Directory
Next, navigate to the specific example project and run the following commands:
```bash
pnpm expo prebuild
pnpx pod-install
pnpm expo run:ios
```
This will set up and launch the app on iOS. For Android, you can replace the last command with `pnpm expo run:android`.

View File

@@ -1,55 +0,0 @@
const { withBuildProperties } = require("expo-build-properties");
const { withDangerousMod } = require("@expo/config-plugins");
const fs = require("fs/promises");
const path = require("path");
/**
* https://github.com/mrousavy/nitro/issues/422#issuecomment-2545988256
*/
function withCustomIosMod(config) {
// Use expo-build-properties to bump iOS deployment target
config = withBuildProperties(config, { ios: { deploymentTarget: "16.0" } });
// Patch the generated Podfile fallback to ensure platform is always 16.0
config = withDangerousMod(config, [
"ios",
async (modConfig) => {
const podfilePath = path.join(
modConfig.modRequest.platformProjectRoot,
"Podfile",
);
let contents = await fs.readFile(podfilePath, "utf-8");
// Check if the IPHONEOS_DEPLOYMENT_TARGET setting is already present
// We search for the key being assigned, e.g., config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] =
const deploymentTargetSettingExists =
/\.build_settings\s*\[\s*['"]IPHONEOS_DEPLOYMENT_TARGET['"]\s*\]\s*=/.test(
contents,
);
if (!deploymentTargetSettingExists) {
// IPHONEOS_DEPLOYMENT_TARGET setting not found, proceed to add it.
contents = contents.replace(
/(post_install\s+do\s+\|installer\|[\s\S]*?)(\r?\n\s end\s*)$/m,
`$1
# Expo Build Properties: force deployment target
# https://github.com/mrousavy/nitro/issues/422#issuecomment-2545988256
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
end
end
$2`,
);
}
await fs.writeFile(podfilePath, contents);
return modConfig;
},
]);
return config;
}
module.exports = ({ config }) => {
return withCustomIosMod(config);
};

View File

@@ -1,34 +1,32 @@
{
"expo": {
"name": "jazz-chat-rn-expo",
"scheme": "jazz-chat-rn-expo",
"slug": "jazz-chat-rn-expo",
"name": "chat-rn-expo",
"slug": "chat-rn-expo",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"splash": {
"image": "./assets/splash.png",
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.jazz.chatrn"
"bundleIdentifier": "tools.jazz.chatrnexpo"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.jazz.chatrn"
"edgeToEdgeEnabled": true,
"package": "tools.jazz.chatrnexpo"
},
"plugins": ["expo-secure-store", "expo-sqlite", "expo-build-properties"],
"extra": {
"eas": {
"projectId": "e0e61872-1906-4c84-b9d8-9be77355cad0"
}
"web": {
"favicon": "./assets/favicon.png"
},
"owner": "paxx"
"plugins": ["expo-secure-store", "expo-sqlite"]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -1,9 +0,0 @@
module.exports = function (api) {
api.cache(true);
return {
presets: [
["babel-preset-expo", { jsxImportSource: "nativewind" }],
"nativewind/babel",
],
};
};

View File

@@ -1,27 +0,0 @@
{
"cli": {
"version": ">= 12.5.1",
"appVersionSource": "remote"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"ios-simulator": {
"extends": "development",
"ios": {
"simulator": true
}
},
"preview": {
"distribution": "internal"
},
"production": {
"autoIncrement": true
}
},
"submit": {
"production": {}
}
}

View File

@@ -1,4 +0,0 @@
import "./polyfills";
import { registerRootComponent } from "expo";
import App from "./src/App";
registerRootComponent(App);

View File

@@ -0,0 +1,9 @@
import { registerRootComponent } from "expo";
import "./polyfills";
import App from "./src/App";
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);

View File

@@ -1,35 +0,0 @@
// Learn more https://docs.expo.dev/guides/monorepos
const { getDefaultConfig } = require("expo/metro-config");
const { withNativeWind } = require("nativewind/metro");
const { FileStore } = require("metro-cache");
const path = require("path");
// eslint-disable-next-line no-undef
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, "../..");
const config = getDefaultConfig(projectRoot, { isCSSEnabled: true });
// Since we are using pnpm, we have to setup the monorepo manually for Metro
// #1 - Watch all files in the monorepo
config.watchFolders = [workspaceRoot];
// #2 - Try resolving with project modules first, then workspace modules
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(workspaceRoot, "node_modules"),
];
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
config.resolver.requireCycleIgnorePatterns = [
/(^|\/|\\)node_modules($|\/|\\)/,
/(^|\/|\\)packages($|\/|\\)/,
];
// Use turborepo to restore the cache when possible
config.cacheStores = [
new FileStore({
root: path.join(projectRoot, "node_modules", ".cache", "metro"),
}),
];
// module.exports = config;
module.exports = withNativeWind(config, { input: "./global.css" });

View File

@@ -1 +0,0 @@
/// <reference types="nativewind/types" />

View File

@@ -1,53 +1,35 @@
{
"name": "chat-rn-expo",
"version": "1.0.102",
"main": "index.js",
"version": "1.0.13",
"main": "index.ts",
"scripts": {
"build": "expo export -p ios",
"build": "expo prebuild",
"start": "expo start",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"android": "expo run:android",
"ios": "expo prebuild && pnpx pod-install && expo run:ios",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@bacons/text-decoder": "0.0.0",
"@craftzdog/react-native-buffer": "6.0.5",
"@bacons/text-decoder": "^0.0.0",
"@craftzdog/react-native-buffer": "^6.0.5",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "7.0.19",
"@react-navigation/native-stack": "7.2.1",
"clsx": "^2.0.0",
"expo": "52.0.42",
"expo-build-properties": "~0.13.1",
"expo-clipboard": "~7.0.0",
"expo-constants": "~17.0.8",
"expo-dev-client": "~5.0.16",
"expo-linking": "~7.0.5",
"expo-secure-store": "~14.0.0",
"expo-sqlite": "15.1.3",
"expo-status-bar": "~2.0.1",
"expo-web-browser": "~14.0.1",
"expo": "~53.0.9",
"expo-clipboard": "^7.1.4",
"expo-secure-store": "~14.2.3",
"expo-sqlite": "~15.2.10",
"expo-status-bar": "~2.2.3",
"jazz-expo": "workspace:*",
"jazz-tools": "workspace:*",
"nativewind": "^4.1.21",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.76.7",
"react": "19.0.0",
"react-native": "0.79.2",
"react-native-get-random-values": "^1.11.0",
"react-native-nitro-modules": "0.25.2",
"react-native-quick-crypto": "1.0.0-beta.15",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "4.4.0",
"react-native-url-polyfill": "^2.0.0",
"readable-stream": "4.7.0"
"readable-stream": "^4.7.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/react": "~18.3.12",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2"
"@types/react": "~19.0.10",
"typescript": "~5.8.3"
},
"private": true
}

View File

@@ -1,74 +1,18 @@
import "../global.css";
import {
NavigationContainer,
useNavigationContainerRef,
} from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import * as Linking from "expo-linking";
import { RNQuickCrypto } from "jazz-expo/crypto";
import React, { StrictMode, useEffect, useState } from "react";
import HandleInviteScreen from "./invite";
import { JazzProvider } from "jazz-expo";
import React, { StrictMode } from "react";
import { apiKey } from "./apiKey";
import ChatScreen from "./chat";
const Stack = createNativeStackNavigator();
const prefix = Linking.createURL("/");
const linking = {
prefixes: [prefix],
config: {
screens: {
HandleInviteScreen: {
path: "router/invite/:valueHint?/:valueID/:inviteSecret",
},
},
},
};
function App() {
const [initialRoute, setInitialRoute] = useState<
"ChatScreen" | "HandleInviteScreen"
>("ChatScreen");
const navigationRef = useNavigationContainerRef();
useEffect(() => {
Linking.getInitialURL().then((url) => {
if (url) {
if (url && url.includes("invite")) {
setInitialRoute("HandleInviteScreen");
}
}
});
}, []);
export default function App() {
return (
<StrictMode>
<JazzProvider
CryptoProvider={RNQuickCrypto}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
>
<NavigationContainer linking={linking} ref={navigationRef}>
<Stack.Navigator initialRouteName={initialRoute}>
<Stack.Screen
options={{ title: "Jazz Chat" }}
name="ChatScreen"
// @ts-ignore
component={ChatScreen}
/>
<Stack.Screen
name="HandleInviteScreen"
component={HandleInviteScreen}
/>
</Stack.Navigator>
</NavigationContainer>
<ChatScreen />
</JazzProvider>
</StrictMode>
);
}
export default App;

View File

@@ -1,7 +1,6 @@
import clsx from "clsx";
import * as Clipboard from "expo-clipboard";
import { Group, ID, Profile } from "jazz-tools";
import { useEffect, useState } from "react";
import { Account, Group } from "jazz-tools";
import { useState } from "react";
import React, {
Button,
FlatList,
@@ -12,54 +11,38 @@ import React, {
TouchableOpacity,
View,
Alert,
StyleSheet,
} from "react-native";
import { useAccount, useCoState } from "jazz-expo";
import { Chat, Message } from "./schema";
export default function ChatScreen({ navigation }: { navigation: any }) {
const { me, logOut } = useAccount();
const [chatId, setChatId] = useState<ID<Chat>>();
export default function ChatScreen() {
const { me, logOut } = useAccount(Account, { resolve: { profile: true } });
const [chatId, setChatId] = useState<string>();
const [chatIdInput, setChatIdInput] = useState<string>();
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
const [message, setMessage] = useState("");
const profile = useCoState(Profile, me._refs.profile?.id, {});
function handleLogOut() {
setChatId(undefined);
logOut();
}
useEffect(() => {
navigation.setOptions({
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
headerLeft: () =>
loadedChat ? (
<Button
onPress={() => {
if (loadedChat?.id) {
Clipboard.setStringAsync(
`https://chat.jazz.tools/#/chat/${loadedChat.id}`,
);
Alert.alert("Copied to clipboard", `Chat ID: ${loadedChat.id}`);
}
}}
title="Share"
/>
) : null,
});
}, [navigation, loadedChat]);
const createChat = () => {
const group = Group.create({ owner: me });
const group = Group.create();
group.addMember("everyone", "writer");
const chat = Chat.create([], { owner: group });
const chat = Chat.create([], group);
setChatId(chat.id);
};
const joinChat = () => {
if (chatIdInput) {
setChatId(chatIdInput as ID<Chat>);
if (chatIdInput.startsWith("https://chat.jazz.tools/#/chat/")) {
setChatId(chatIdInput.split("/").pop());
} else {
setChatId(chatIdInput);
}
} else {
Alert.alert("Error", "Chat ID cannot be empty.");
}
@@ -79,37 +62,24 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
const isMe = item._edits?.text?.by?.isMe;
return (
<View
className={clsx(
`rounded-lg p-1 px-1.5 max-w-[80%] `,
isMe ? `bg-gray-200 self-end text-right` : `bg-gray-300 self-start `,
)}
style={[
styles.messageContainer,
isMe ? styles.myMessage : styles.otherMessage,
]}
>
{!isMe ? (
<Text
className={clsx(
`text-xs text-gray-500`,
isMe ? "text-right" : "text-left",
)}
style={[
styles.messageSender,
{ textAlign: isMe ? "right" : "left" },
]}
>
{item?._edits?.text?.by?.profile?.name}
</Text>
) : null}
<View
className={clsx(
"flex relative items-end justify-between",
isMe ? "flex-row" : "flex-row",
)}
>
<Text className={clsx(`text-black text-md max-w-[85%]`)}>
{item.text}
</Text>
<Text
className={clsx(
"text-[10px] text-gray-500 text-right ml-2",
!isMe ? "mt-2" : "mt-1",
)}
>
<View style={styles.messageContent}>
<Text style={styles.messageText}>{item.text}</Text>
<Text style={[styles.messageTime, { marginTop: !isMe ? 8 : 4 }]}>
{item?._edits?.text?.madeAt?.getHours().toString().padStart(2, "0")}
:
{item?._edits?.text?.madeAt
@@ -123,31 +93,28 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
};
return (
<View className="flex flex-col h-full">
<View style={styles.container}>
{!loadedChat ? (
<View className="flex flex-col h-full items-center justify-center">
<Text className="text-m font-bold mb-6">Username</Text>
<View style={styles.welcomeContainer}>
<Text style={styles.usernameTitle}>Username</Text>
<TextInput
className="rounded h-12 p-2 mb-12 w-40 border border-gray-200 block"
value={profile?.name ?? ""}
style={styles.usernameInput}
value={me?.profile.name ?? ""}
onChangeText={(value) => {
if (profile) {
profile.name = value;
if (me?.profile) {
me.profile.name = value;
}
}}
textAlignVertical="center"
onSubmitEditing={sendMessage}
testID="username-input"
/>
<TouchableOpacity
onPress={createChat}
className="bg-blue-500 p-4 rounded-md"
>
<Text className="text-white font-semibold">Start new chat</Text>
<TouchableOpacity onPress={createChat} style={styles.newChatButton}>
<Text style={styles.newChatButtonText}>Start new chat</Text>
</TouchableOpacity>
<Text className="text-m font-bold mt-6">Join existing chat</Text>
<Text style={styles.joinChatTitle}>Join existing chat</Text>
<TextInput
className="rounded h-12 p-2 m-2 mt-4 w-80 border border-gray-200 block"
style={styles.chatIdInput}
placeholder="Chat ID"
value={chatIdInput ?? ""}
onChangeText={(value) => {
@@ -156,27 +123,43 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
textAlignVertical="center"
onSubmitEditing={() => {
if (chatIdInput) {
setChatId(chatIdInput as ID<Chat>);
setChatId(chatIdInput);
}
}}
testID="chat-id-input"
/>
<TouchableOpacity
onPress={joinChat}
className="bg-green-500 p-4 rounded-md"
>
<Text className="text-white font-semibold">Join chat</Text>
<TouchableOpacity onPress={joinChat} style={styles.joinChatButton}>
<Text style={styles.newChatButtonText}>Join chat</Text>
</TouchableOpacity>
</View>
) : (
<>
<View style={styles.chatHeader}>
<Button
onPress={() => {
if (loadedChat?.id) {
Clipboard.setStringAsync(
`https://chat.jazz.tools/#/chat/${loadedChat.id}`,
);
Alert.alert(
"Copied to clipboard",
`Chat ID: ${loadedChat.id}`,
);
}
}}
title="Share"
/>
<Text style={{ fontWeight: "bold", fontSize: 18 }}>Jazz chat</Text>
<Button onPress={handleLogOut} title="Logout" />
</View>
<FlatList
contentContainerStyle={{
flexGrow: 1,
gap: 6,
padding: 8,
justifyContent: "flex-end",
}}
className="flex"
style={styles.messageList}
data={loadedChat}
keyExtractor={(item) => item.id}
renderItem={renderMessageItem}
@@ -185,11 +168,11 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
<KeyboardAvoidingView
keyboardVerticalOffset={110}
behavior="padding"
className="p-3 bg-white border-t border-gray-300"
style={styles.inputContainer}
>
<SafeAreaView className="flex flex-row items-center gap-2">
<SafeAreaView style={styles.inputRow}>
<TextInput
className="rounded-full h-8 py-0 px-2 border border-gray-200 block flex-1"
style={styles.messageInput}
value={message}
onChangeText={setMessage}
placeholder="Type a message..."
@@ -199,7 +182,7 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
/>
<TouchableOpacity
onPress={sendMessage}
className="bg-gray-300 text-white rounded-full h-8 w-8 items-center justify-center"
style={styles.sendButton}
testID="send-button"
>
<Text></Text>
@@ -211,3 +194,133 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: "column",
height: "100%",
},
chatHeader: {
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
padding: 8,
paddingTop: 48,
backgroundColor: "#f0f0f0",
},
welcomeContainer: {
flex: 1,
flexDirection: "column",
height: "100%",
alignItems: "center",
justifyContent: "center",
},
usernameTitle: {
fontSize: 16,
fontWeight: "bold",
marginBottom: 24,
},
usernameInput: {
borderRadius: 4,
height: 48,
padding: 8,
marginBottom: 48,
width: 160,
borderWidth: 1,
borderColor: "#e5e5e5",
},
newChatButton: {
backgroundColor: "#3b82f6",
padding: 16,
borderRadius: 6,
},
newChatButtonText: {
color: "white",
fontWeight: "600",
},
joinChatTitle: {
fontSize: 16,
fontWeight: "bold",
marginTop: 24,
},
chatIdInput: {
borderRadius: 4,
height: 48,
padding: 8,
margin: 8,
marginTop: 16,
width: 320,
borderWidth: 1,
borderColor: "#e5e5e5",
},
joinChatButton: {
backgroundColor: "#22c55e",
padding: 16,
borderRadius: 6,
},
messageList: {
display: "flex",
},
messageContainer: {
borderRadius: 8,
padding: 4,
paddingHorizontal: 6,
maxWidth: "80%",
},
myMessage: {
backgroundColor: "#e5e5e5",
alignSelf: "flex-end",
},
otherMessage: {
backgroundColor: "#d4d4d4",
alignSelf: "flex-start",
},
messageSender: {
fontSize: 12,
color: "#6b7280",
},
messageContent: {
flexDirection: "row",
alignItems: "flex-end",
justifyContent: "space-between",
},
messageText: {
color: "black",
fontSize: 16,
maxWidth: "85%",
},
messageTime: {
fontSize: 10,
color: "#6b7280",
marginLeft: 8,
},
inputContainer: {
padding: 12,
backgroundColor: "white",
borderTopWidth: 1,
borderTopColor: "#d4d4d4",
},
inputRow: {
flexDirection: "row",
alignItems: "center",
gap: 8,
},
messageInput: {
borderRadius: 9999,
height: 32,
paddingVertical: 0,
paddingHorizontal: 8,
borderWidth: 1,
borderColor: "#e5e5e5",
flex: 1,
},
sendButton: {
backgroundColor: "#d4d4d4",
borderRadius: 9999,
height: 32,
width: 32,
alignItems: "center",
justifyContent: "center",
},
});

View File

@@ -1,18 +0,0 @@
import { useAcceptInvite } from "jazz-expo";
import React, { Text } from "react-native";
import { Chat } from "./schema";
export default function HandleInviteScreen({
navigation,
}: {
navigation: any;
}) {
useAcceptInvite({
invitedObjectSchema: Chat,
onAccept: async (chatId) => {
navigation.navigate("ChatScreen", { chatId });
},
});
return <Text>Accepting invite...</Text>;
}

View File

@@ -1,7 +1,9 @@
import { CoList, CoMap, co } from "jazz-tools";
import { co, z } from "jazz-tools";
export class Message extends CoMap {
text = co.string;
}
export const Message = co.map({
text: z.string(),
});
export type Message = co.loaded<typeof Message>;
export class Chat extends CoList.Of(co.ref(Message)) {}
export const Chat = co.list(Message);
export type Chat = co.loaded<typeof Chat>;

View File

@@ -1,14 +0,0 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
// NOTE: Update this to include the paths to all of your component files.
content: [
"./app/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}",
"./src/**/*.{js,jsx,ts,tsx}",
],
presets: [require("nativewind/preset")],
theme: {
extend: {},
},
plugins: [],
};

View File

@@ -2,7 +2,7 @@
# fully erased. The tap into the input field hits the middle, and clears all
# text to the left. If there's more to the right, it slides left, and thus we
# repeat this step. https://maestro.mobile.dev/api-reference/commands/erasetext
appId: com.jazz.chatrn
appId: tools.jazz.chatrnexpo
---
- copyTextFrom:
id: ${id}

View File

@@ -1,4 +1,4 @@
appId: com.jazz.chatrn
appId: tools.jazz.chatrnexpo
---
- launchApp
@@ -8,10 +8,7 @@ appId: com.jazz.chatrn
# - assertVisible: "Reload"
# - tapOn: "Reload"
# login
- assertVisible: "Logout"
- tapOn: "Logout"
- assertVisible: "Anonymous user"
- assertVisible: "Username"
- runFlow:
label: "Erase existing username"
file: erase_text.yml
@@ -43,12 +40,13 @@ appId: com.jazz.chatrn
# logout
- tapOn: "Logout"
- assertVisible: "Username"
- assertVisible: "Anonymous user"
# join chat
- tapOn:
id: "chat-id-input"
- inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
- tapOn: "Join chat"
- assertVisible: "boorad"
- assertVisible: "bro, low key, it do be like that tho"
# - tapOn:
# id: "chat-id-input"
# - inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
# - tapOn: "Join chat"
# - assertVisible: "boorad"
# - assertVisible: "bro, low key, it do be like that tho"

View File

@@ -5,11 +5,15 @@
set -e
OUTPUT_FILE=~/output/android-install.log
mkdir -p ~/output
touch $OUTPUT_FILE
# build and install the app
echo "Building and installing Android app."
echo "If it fails, its output will be in artifact: android-install.log..."
cd ./android/
./gradlew installRelease >> ~/output/android-install.log 2>&1
./gradlew installRelease >> $OUTPUT_FILE 2>&1
cd ..
# run the e2e tests

View File

@@ -1,8 +1,6 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true,
"moduleResolution": "bundler"
},
"exclude": ["src/tests"]
"strict": true
}
}

View File

@@ -1,5 +1,289 @@
# chat-rn
## 1.0.140
### Patch Changes
- Updated dependencies [57fb69f]
- Updated dependencies [048ac1d]
- cojson@0.14.22
- jazz-tools@0.14.22
- cojson-transport-ws@0.14.22
- jazz-react-native@0.14.22
## 1.0.139
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [c3d8779]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- cojson@0.14.21
- jazz-react-native@0.14.21
- cojson-transport-ws@0.14.21
## 1.0.138
### Patch Changes
- Updated dependencies [6f72419]
- Updated dependencies [04b20c2]
- jazz-tools@0.14.20
- jazz-react-native@0.14.20
- cojson@0.14.20
- cojson-transport-ws@0.14.20
## 1.0.137
### Patch Changes
- Updated dependencies [061ec99]
- jazz-react-native@0.14.19
- cojson@0.14.19
- cojson-transport-ws@0.14.19
- jazz-tools@0.14.19
## 1.0.136
### Patch Changes
- Updated dependencies [4b950bc]
- Updated dependencies [0d5ee3e]
- Updated dependencies [d6d9c0a]
- Updated dependencies [c559054]
- jazz-tools@0.14.18
- cojson@0.14.18
- jazz-react-native@0.14.18
- cojson-transport-ws@0.14.18
## 1.0.135
### Patch Changes
- Updated dependencies [e512df4]
- jazz-tools@0.14.17
- jazz-react-native@0.14.17
## 1.0.134
### Patch Changes
- Updated dependencies [5e253cc]
- cojson@0.14.16
- cojson-transport-ws@0.14.16
- jazz-react-native@0.14.16
- jazz-tools@0.14.16
## 1.0.133
### Patch Changes
- Updated dependencies [23daa7c]
- cojson@0.14.15
- jazz-react-native@0.14.15
- cojson-transport-ws@0.14.15
- jazz-tools@0.14.15
## 1.0.132
### Patch Changes
- Updated dependencies [e32a1f7]
- jazz-tools@0.14.14
- jazz-react-native@0.14.14
## 1.0.131
### Patch Changes
- jazz-react-native@0.14.13
## 1.0.130
### Patch Changes
- jazz-react-native@0.14.12
## 1.0.129
### Patch Changes
- Updated dependencies [98d697f]
- jazz-react-native@0.14.11
## 1.0.128
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-react-native@0.14.10
- jazz-tools@0.14.10
## 1.0.127
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-react-native@0.14.9
## 1.0.126
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-react-native@0.14.8
## 1.0.125
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-react-native@0.14.7
## 1.0.124
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-react-native@0.14.6
## 1.0.123
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-react-native@0.14.5
## 1.0.122
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-react-native@0.14.4
## 1.0.121
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-react-native@0.14.2
## 1.0.120
### Patch Changes
- Updated dependencies [c8b33ad]
- Updated dependencies [cdfc105]
- cojson@0.14.1
- jazz-tools@0.14.1
- cojson-transport-ws@0.14.1
- jazz-react-native@0.14.1
## 1.0.119
### Patch Changes
- Updated dependencies [5835ed1]
- Updated dependencies [5835ed1]
- cojson@0.14.0
- jazz-tools@0.14.0
- cojson-transport-ws@0.14.0
- jazz-react-native@0.14.0
## 1.0.118
### Patch Changes
- jazz-react-native@0.13.32
## 1.0.117
### Patch Changes
- Updated dependencies [e5b170f]
- Updated dependencies [d63716a]
- Updated dependencies [d5edad7]
- jazz-tools@0.13.31
- cojson@0.13.31
- jazz-react-native@0.13.31
- cojson-transport-ws@0.13.31
## 1.0.116
### Patch Changes
- Updated dependencies [07dd2c5]
- cojson@0.13.30
- cojson-transport-ws@0.13.30
- jazz-react-native@0.13.30
- jazz-tools@0.13.30
## 1.0.115
### Patch Changes
- Updated dependencies [eef1a5d]
- Updated dependencies [191ae38]
- Updated dependencies [daee7b9]
- cojson@0.13.29
- jazz-react-native@0.13.29
- cojson-transport-ws@0.13.29
- jazz-tools@0.13.29
## 1.0.114
### Patch Changes
- Updated dependencies [e7ccb2c]
- Updated dependencies [422dbc4]
- cojson@0.13.28
- cojson-transport-ws@0.13.28
- jazz-react-native@0.13.28
- jazz-tools@0.13.28
## 1.0.113
### Patch Changes
- Updated dependencies [6357052]
- cojson@0.13.27
- cojson-transport-ws@0.13.27
- jazz-react-native@0.13.27
- jazz-tools@0.13.27
## 1.0.112
### Patch Changes
- Updated dependencies [ff846d9]
- jazz-tools@0.13.26
- jazz-react-native@0.13.26
## 1.0.111
### Patch Changes
- Updated dependencies [a846e07]
- cojson@0.13.25
- cojson-transport-ws@0.13.25
- jazz-react-native@0.13.25
- jazz-tools@0.13.25
## 1.0.110
### Patch Changes

View File

@@ -26,7 +26,7 @@ This will set up and launch the app on iOS. For Android, you can skip `pnpm pods
This was created using the following command:
```bash
pnpx @react-native-community/cli init chat-rn --version 0.76.7 --install-pods true --skip-git-init true --package-name com.chatrn --directory chat-rn
pnpx @react-native-community/cli init chat-rn --version 0.76.9 --install-pods true --skip-git-init true --package-name com.chatrn --directory chat-rn
```
Then change package name in `package.json`, and begin build instructions above.

View File

@@ -2,9 +2,9 @@
"name": "ChatRN",
"displayName": "ChatRN",
"android": {
"package": "com.anonymous.ChatRN"
"package": "tools.jazz.chatrn"
},
"ios": {
"bundleIdentifier": "com.anonymous.ChatRN"
"bundleIdentifier": "tools.jazz.chatrn"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,7 @@ module.exports = makeMetroConfig({
resolveRequest: MetroSymlinksResolver(),
extraNodeModules,
nodeModulesPaths,
sourceExts: ["mjs", "js", "json", "ts", "tsx"],
},
sourceExts: ["mjs", "js", "json", "ts", "tsx"],
watchFolders,
});

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.110",
"version": "1.0.140",
"main": "index.js",
"scripts": {
"android": "react-native run-android",
@@ -23,8 +23,8 @@
"cojson-transport-ws": "workspace:*",
"jazz-react-native": "workspace:*",
"jazz-tools": "workspace:*",
"react": "18.3.1",
"react-native": "0.76.7",
"react": "19.0.0",
"react-native": "0.79.2",
"react-native-get-random-values": "^1.11.0",
"react-native-mmkv": "^3.2.0",
"react-native-polyfill-globals": "^3.1.0",
@@ -40,10 +40,10 @@
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.76.7",
"@react-native/eslint-config": "0.76.7",
"@react-native/metro-config": "0.76.7",
"@react-native/typescript-config": "0.76.7",
"@react-native/babel-preset": "0.76.9",
"@react-native/eslint-config": "0.76.9",
"@react-native/metro-config": "0.76.9",
"@react-native/typescript-config": "0.76.9",
"@rnx-kit/metro-config": "^2.0.1",
"@rnx-kit/metro-resolver-symlinks": "^0.2.1",
"@types/react": "^18.3.12",

View File

@@ -1,9 +1,8 @@
import Clipboard from "@react-native-clipboard/clipboard";
import { useAccount, useCoState } from "jazz-react-native";
import { Group, ID, Profile } from "jazz-tools";
import { CoPlainText, Group, ID, Loaded, Profile } from "jazz-tools";
import { useEffect, useState } from "react";
import {
Alert,
Button,
FlatList,
KeyboardAvoidingView,
@@ -18,7 +17,8 @@ import { Chat, Message } from "./schema";
export function ChatScreen({ navigation }: { navigation: any }) {
const { me, logOut } = useAccount();
const [chatId, setChatId] = useState<ID<Chat>>();
const [chatId, setChatId] = useState<string>();
const [chatIdInput, setChatIdInput] = useState<string>();
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
const [message, setMessage] = useState("");
const profile = useCoState(Profile, me._refs.profile?.id, {});
@@ -36,10 +36,8 @@ export function ChatScreen({ navigation }: { navigation: any }) {
<Button
onPress={() => {
if (loadedChat?.id) {
Clipboard.setString(
`https://chat.jazz.tools/#/chat/${loadedChat.id}`,
);
Alert.alert("Copied to clipboard", `Chat ID: ${loadedChat.id}`);
Clipboard.setString(loadedChat.id);
console.log("Copied to clipboard", `Chat ID: ${loadedChat.id}`);
}
}}
title="Share"
@@ -56,40 +54,29 @@ export function ChatScreen({ navigation }: { navigation: any }) {
};
const joinChat = () => {
Alert.prompt(
"Join Chat",
"Enter the Chat ID (example: co_zBGEHYvRfGuT2YSBraY3njGjnde)",
[
{
text: "Cancel",
style: "cancel",
},
{
text: "Join",
onPress: (chatId) => {
if (chatId) {
setChatId(chatId as ID<Chat>);
} else {
Alert.alert("Error", "Chat ID cannot be empty.");
}
},
},
],
"plain-text",
);
if (chatIdInput) {
setChatId(chatIdInput as ID<Chat>);
} else {
console.warn("Error: Chat ID cannot be empty.");
}
};
const sendMessage = () => {
if (!loadedChat) return;
if (message.trim()) {
loadedChat.push(
Message.create({ text: message }, { owner: loadedChat?._owner }),
Message.create(
{ text: CoPlainText.create(message, loadedChat?._owner) },
loadedChat?._owner,
),
);
setMessage("");
}
};
const renderMessageItem = ({ item }: { item: Message }) => {
const renderMessageItem = ({
item,
}: { item: Loaded<typeof Message, { text: true }> }) => {
const isMe = item._edits?.text?.by?.isMe;
return (
<View
@@ -148,6 +135,16 @@ export function ChatScreen({ navigation }: { navigation: any }) {
<TouchableOpacity onPress={createChat} style={styles.newChatButton}>
<Text style={styles.buttonText}>Start new chat</Text>
</TouchableOpacity>
<Text style={styles.usernameLabel}>Join existing chat</Text>
<TextInput
style={styles.chatIdInput}
placeholder="Chat ID"
value={chatIdInput ?? ""}
onChangeText={setChatIdInput}
textAlignVertical="center"
onSubmitEditing={joinChat}
testID="chat-id-input"
/>
<TouchableOpacity onPress={joinChat} style={styles.joinChatButton}>
<Text style={styles.buttonText}>Join chat</Text>
</TouchableOpacity>
@@ -200,27 +197,91 @@ export function ChatScreen({ navigation }: { navigation: any }) {
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: "column",
height: "100%",
},
welcomeContainer: {
flex: 1,
alignItems: "center",
justifyContent: "center",
padding: 16,
},
usernameLabel: {
fontSize: 16,
fontWeight: "bold",
marginBottom: 16,
},
usernameInput: {
width: 160,
height: 48,
borderWidth: 1,
borderColor: "#ddd",
borderRadius: 8,
paddingHorizontal: 8,
marginBottom: 24,
},
chatIdInput: {
width: 320,
height: 48,
borderWidth: 1,
borderColor: "#ddd",
borderRadius: 8,
paddingHorizontal: 8,
marginBottom: 24,
marginTop: 8,
},
newChatButton: {
backgroundColor: "#3B82F6",
padding: 16,
borderRadius: 8,
marginBottom: 24,
},
joinChatButton: {
backgroundColor: "#10B981",
padding: 16,
borderRadius: 8,
},
buttonText: {
color: "white",
fontSize: 16,
fontWeight: "bold",
textAlign: "center",
},
messageList: {
flex: 1,
},
inputContainer: {
padding: 12,
},
inputWrapper: {
flexDirection: "row",
alignItems: "center",
borderWidth: 1,
borderColor: "#ddd",
borderRadius: 8,
paddingHorizontal: 12,
},
messageInput: {
flex: 1,
height: 32,
paddingHorizontal: 8,
},
sendButton: {
paddingHorizontal: 16,
},
messageContainer: {
borderRadius: 8,
paddingVertical: 4,
paddingHorizontal: 6,
maxWidth: "80%",
flexDirection: "column",
alignItems: "flex-start",
marginBottom: 8,
},
myMessage: {
backgroundColor: "#e5e7eb", // gray-200
alignSelf: "flex-end",
textAlign: "right",
},
otherMessage: {
backgroundColor: "#d1d5db", // gray-300
alignSelf: "flex-start",
},
senderName: {
fontSize: 12,
color: "#6b7280", // gray-500
color: "#666",
marginBottom: 4,
},
textRight: {
textAlign: "right",
@@ -229,92 +290,27 @@ const styles = StyleSheet.create({
textAlign: "left",
},
messageContent: {
position: "relative",
flexDirection: "row",
alignItems: "flex-end",
justifyContent: "space-between",
backgroundColor: "#f0f0f0",
borderRadius: 8,
padding: 8,
},
messageText: {
color: "#000000",
fontSize: 16,
maxWidth: "85%",
},
timestamp: {
fontSize: 10,
color: "#6b7280", // gray-500
textAlign: "right",
marginLeft: 8,
color: "#666",
marginTop: 4,
},
timestampOther: {
textAlign: "left",
marginTop: 8,
},
timestampMy: {
textAlign: "right",
marginTop: 4,
},
welcomeContainer: {
flex: 1,
flexDirection: "column",
height: "100%",
alignItems: "center",
justifyContent: "center",
},
usernameLabel: {
fontSize: 16,
fontWeight: "bold",
marginBottom: 24,
},
usernameInput: {
borderRadius: 4,
height: 48,
padding: 8,
marginBottom: 48,
width: 160,
borderWidth: 1,
borderColor: "#e5e7eb", // gray-200
},
newChatButton: {
backgroundColor: "#3b82f6", // blue-500
padding: 16,
borderRadius: 6,
},
joinChatButton: {
backgroundColor: "#10b981", // green-500
padding: 16,
borderRadius: 6,
marginTop: 16,
},
buttonText: {
color: "white",
fontWeight: "600",
},
messageList: {
flex: 1,
},
inputContainer: {
paddingVertical: 16,
paddingHorizontal: 10,
backgroundColor: "white",
borderTopWidth: 1,
borderTopColor: "#d1d5db", // gray-300
},
inputWrapper: {
flex: 1,
flexDirection: "row",
alignItems: "center",
margin: 5,
},
messageInput: {
borderRadius: 20,
height: 32,
paddingVertical: 0,
paddingHorizontal: 8,
borderWidth: 1,
borderColor: "#e5e7eb", // gray-200
flex: 1,
},
sendButton: {
marginLeft: 10,
backgroundColor: "#d1d5db", // gray-300
avatar: {
borderRadius: 16,
height: 32,
width: 32,

View File

@@ -1,7 +1,7 @@
import { CoList, CoMap, co } from "jazz-tools";
import { co } from "jazz-tools";
export class Message extends CoMap {
text = co.string;
}
export const Message = co.map({
text: co.plainText(),
});
export class Chat extends CoList.Of(co.ref(Message)) {}
export const Chat = co.list(Message);

View File

@@ -1,5 +1,249 @@
# chat-vue
## 0.0.120
### Patch Changes
- Updated dependencies [048ac1d]
- jazz-tools@0.14.22
- jazz-browser@0.14.22
- jazz-vue@0.14.22
## 0.0.119
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-browser@0.14.21
- jazz-vue@0.14.21
## 0.0.118
### Patch Changes
- Updated dependencies [6f72419]
- Updated dependencies [04b20c2]
- jazz-tools@0.14.20
- jazz-browser@0.14.20
- jazz-vue@0.14.20
## 0.0.117
### Patch Changes
- jazz-browser@0.14.19
- jazz-tools@0.14.19
- jazz-vue@0.14.19
## 0.0.116
### Patch Changes
- Updated dependencies [4b950bc]
- Updated dependencies [d6d9c0a]
- Updated dependencies [c559054]
- jazz-tools@0.14.18
- jazz-browser@0.14.18
- jazz-vue@0.14.18
## 0.0.115
### Patch Changes
- Updated dependencies [e512df4]
- jazz-tools@0.14.17
- jazz-browser@0.14.17
- jazz-vue@0.14.17
## 0.0.114
### Patch Changes
- jazz-browser@0.14.16
- jazz-tools@0.14.16
- jazz-vue@0.14.16
## 0.0.113
### Patch Changes
- jazz-browser@0.14.15
- jazz-tools@0.14.15
- jazz-vue@0.14.15
## 0.0.112
### Patch Changes
- Updated dependencies [e32a1f7]
- jazz-tools@0.14.14
- jazz-browser@0.14.14
- jazz-vue@0.14.14
## 0.0.111
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-tools@0.14.10
- jazz-browser@0.14.10
- jazz-vue@0.14.10
## 0.0.110
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-browser@0.14.9
- jazz-vue@0.14.9
## 0.0.109
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-browser@0.14.8
- jazz-vue@0.14.8
## 0.0.108
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-browser@0.14.7
- jazz-vue@0.14.7
## 0.0.107
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-browser@0.14.6
- jazz-vue@0.14.6
## 0.0.106
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-browser@0.14.5
- jazz-vue@0.14.5
## 0.0.105
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-browser@0.14.4
- jazz-vue@0.14.4
## 0.0.104
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-browser@0.14.2
- jazz-vue@0.14.2
## 0.0.103
### Patch Changes
- Updated dependencies [cdfc105]
- jazz-tools@0.14.1
- jazz-browser@0.14.1
- jazz-vue@0.14.1
## 0.0.102
### Patch Changes
- Updated dependencies [5835ed1]
- jazz-tools@0.14.0
- jazz-browser@0.14.0
- jazz-vue@0.14.0
## 0.0.101
### Patch Changes
- jazz-browser@0.13.32
- jazz-vue@0.13.32
## 0.0.100
### Patch Changes
- Updated dependencies [e5b170f]
- jazz-tools@0.13.31
- jazz-browser@0.13.31
- jazz-vue@0.13.31
## 0.0.99
### Patch Changes
- jazz-browser@0.13.30
- jazz-tools@0.13.30
- jazz-vue@0.13.30
## 0.0.98
### Patch Changes
- jazz-browser@0.13.29
- jazz-tools@0.13.29
- jazz-vue@0.13.29
## 0.0.97
### Patch Changes
- jazz-browser@0.13.28
- jazz-tools@0.13.28
- jazz-vue@0.13.28
## 0.0.96
### Patch Changes
- jazz-browser@0.13.27
- jazz-tools@0.13.27
- jazz-vue@0.13.27
## 0.0.95
### Patch Changes
- Updated dependencies [ff846d9]
- jazz-tools@0.13.26
- jazz-browser@0.13.26
- jazz-vue@0.13.26
## 0.0.94
### Patch Changes
- jazz-browser@0.13.25
- jazz-tools@0.13.25
- jazz-vue@0.13.25
## 0.0.93
### Patch Changes

View File

@@ -58,4 +58,4 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of `JazzProvider` in [./src/main.ts](./src/main.ts).
You can also run a local sync server by running `npx jazz-run sync`, and setting the `sync` parameter of `JazzProvider` in [./src/main.ts](./src/main.ts) to `{ peer: "ws://localhost:4200" }`.

View File

@@ -1,11 +1,11 @@
{
"name": "chat-vue",
"version": "0.0.93",
"version": "0.0.120",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build-type-check": "run-p type-check \"build-only {@}\" --",
"build-type-check": "run-p type-check \"build {@}\" --",
"preview": "vite preview",
"build": "vite build",
"type-check": "vue-tsc --build --force",
@@ -32,7 +32,7 @@
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",
"vite": "6.0.11",
"vite": "6.3.5",
"vite-plugin-vue-devtools": "^7.4.6",
"vue-tsc": "^2.1.6"
}

View File

@@ -1,9 +1,9 @@
<template>
<BubbleContainer :fromMe="lastEdit.by?.isMe">
<BubbleBody>{{ msg.text }}</BubbleBody>
<BubbleInfo :by="lastEdit.by?.profile?.name" :madeAt="lastEdit.madeAt" />
</BubbleContainer>
</template>
<BubbleContainer :fromMe="lastEdit.by?.isMe">
<BubbleBody>{{ msg.text }}</BubbleBody>
<BubbleInfo :by="lastEdit.by?.profile?.name" :madeAt="lastEdit.madeAt" />
</BubbleContainer>
</template>
<script lang="ts">
import { computed, defineComponent } from "vue";

View File

@@ -1,7 +1,7 @@
import { CoList, CoMap, co } from "jazz-tools";
import { CoList, CoMap, CoPlainText, coField } from "jazz-tools";
export class Message extends CoMap {
text = co.string;
text = coField.ref(CoPlainText);
}
export class Chat extends CoList.Of(co.ref(Message)) {}
export class Chat extends CoList.Of(coField.ref(Message)) {}

View File

@@ -25,7 +25,7 @@
</template>
<script lang="ts">
import type { ID } from "jazz-tools";
import { CoPlainText, type ID } from "jazz-tools";
import { useCoState } from "jazz-vue";
import { type PropType, computed, defineComponent, ref } from "vue";
import ChatBody from "../components/ChatBody.vue";
@@ -61,7 +61,12 @@ export default defineComponent({
}
function handleSubmit(text: string) {
chat?.value?.push(Message.create({ text }, { owner: chat.value._owner }));
chat?.value?.push(
Message.create(
{ text: CoPlainText.create(text, chat.value._owner) },
chat.value._owner,
),
);
}
return {

View File

@@ -1,5 +1,265 @@
# jazz-example-chat
## 0.0.220
### Patch Changes
- Updated dependencies [048ac1d]
- jazz-tools@0.14.22
- jazz-inspector@0.14.22
- jazz-react@0.14.22
## 0.0.219
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-inspector@0.14.21
- jazz-react@0.14.21
## 0.0.218
### Patch Changes
- Updated dependencies [6f72419]
- Updated dependencies [04b20c2]
- jazz-tools@0.14.20
- jazz-inspector@0.14.20
- jazz-react@0.14.20
## 0.0.217
### Patch Changes
- jazz-inspector@0.14.19
- jazz-react@0.14.19
- jazz-tools@0.14.19
## 0.0.216
### Patch Changes
- Updated dependencies [4b950bc]
- Updated dependencies [d6d9c0a]
- Updated dependencies [c559054]
- jazz-tools@0.14.18
- jazz-inspector@0.14.18
- jazz-react@0.14.18
## 0.0.215
### Patch Changes
- Updated dependencies [e512df4]
- jazz-tools@0.14.17
- jazz-inspector@0.14.17
- jazz-react@0.14.17
## 0.0.214
### Patch Changes
- jazz-inspector@0.14.16
- jazz-react@0.14.16
- jazz-tools@0.14.16
## 0.0.213
### Patch Changes
- Updated dependencies [f9590f9]
- jazz-react@0.14.15
- jazz-inspector@0.14.15
- jazz-tools@0.14.15
## 0.0.212
### Patch Changes
- Updated dependencies [e32a1f7]
- jazz-tools@0.14.14
- jazz-inspector@0.14.14
- jazz-react@0.14.14
## 0.0.211
### Patch Changes
- jazz-inspector@0.14.13
- jazz-react@0.14.13
## 0.0.210
### Patch Changes
- jazz-inspector@0.14.12
- jazz-react@0.14.12
## 0.0.209
### Patch Changes
- Updated dependencies [dc746a2]
- Updated dependencies [f869d9a]
- Updated dependencies [3fe6832]
- jazz-inspector@0.14.10
- hash-slash@0.2.3
- jazz-react@0.14.10
- jazz-tools@0.14.10
## 0.0.208
### Patch Changes
- Updated dependencies [22c2600]
- jazz-tools@0.14.9
- jazz-inspector@0.14.9
- jazz-react@0.14.9
## 0.0.207
### Patch Changes
- Updated dependencies [637ae13]
- jazz-tools@0.14.8
- jazz-inspector@0.14.8
- jazz-react@0.14.8
## 0.0.206
### Patch Changes
- Updated dependencies [365b0ea]
- jazz-tools@0.14.7
- jazz-inspector@0.14.7
- jazz-react@0.14.7
## 0.0.205
### Patch Changes
- Updated dependencies [9d6d9fe]
- Updated dependencies [9d6d9fe]
- jazz-tools@0.14.6
- jazz-inspector@0.14.6
- jazz-react@0.14.6
## 0.0.204
### Patch Changes
- Updated dependencies [91cbb2f]
- Updated dependencies [20b3d88]
- jazz-tools@0.14.5
- jazz-inspector@0.14.5
- jazz-react@0.14.5
## 0.0.203
### Patch Changes
- Updated dependencies [011af55]
- jazz-tools@0.14.4
- jazz-inspector@0.14.4
- jazz-react@0.14.4
## 0.0.202
### Patch Changes
- Updated dependencies [3d1027f]
- Updated dependencies [c240eed]
- jazz-tools@0.14.2
- jazz-inspector@0.14.2
- jazz-react@0.14.2
## 0.0.201
### Patch Changes
- Updated dependencies [cdfc105]
- jazz-tools@0.14.1
- jazz-inspector@0.14.1
- jazz-react@0.14.1
## 0.0.200
### Patch Changes
- Updated dependencies [5835ed1]
- jazz-tools@0.14.0
- jazz-inspector@0.14.0
- jazz-react@0.14.0
## 0.0.199
### Patch Changes
- jazz-react@0.13.32
## 0.0.198
### Patch Changes
- Updated dependencies [e5b170f]
- jazz-tools@0.13.31
- jazz-inspector@0.13.31
- jazz-react@0.13.31
## 0.0.197
### Patch Changes
- jazz-inspector@0.13.30
- jazz-react@0.13.30
- jazz-tools@0.13.30
## 0.0.196
### Patch Changes
- Updated dependencies [8e5ff13]
- jazz-inspector@0.13.29
- jazz-react@0.13.29
- jazz-tools@0.13.29
## 0.0.195
### Patch Changes
- jazz-inspector@0.13.28
- jazz-react@0.13.28
- jazz-tools@0.13.28
## 0.0.194
### Patch Changes
- jazz-inspector@0.13.27
- jazz-react@0.13.27
- jazz-tools@0.13.27
## 0.0.193
### Patch Changes
- Updated dependencies [ff846d9]
- jazz-tools@0.13.26
- jazz-inspector@0.13.26
- jazz-react@0.13.26
## 0.0.192
### Patch Changes
- jazz-inspector@0.13.25
- jazz-react@0.13.25
- jazz-tools@0.13.25
## 0.0.191
### Patch Changes

View File

@@ -60,4 +60,4 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<JazzProvider>` provider component in [./src/main.tsx](./src/main.tsx).
You can also run a local sync server by running `npx jazz-run sync`, and setting the `sync` parameter of `JazzProvider` in [./src/app.tsx](./src/app.tsx) to `{ peer: "ws://localhost:4200" }`.

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.191",
"version": "0.0.220",
"type": "module",
"scripts": {
"dev": "vite",
@@ -19,19 +19,20 @@
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0",
"zod": "3.25.28"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.3.2",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react-swc": "^3.10.1",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",
"vite": "6.0.11"
"vite": "6.3.5"
}
}

View File

@@ -3,7 +3,7 @@ import { getRandomUsername, inIframe, onChatLoad } from "@/util.ts";
import { useIframeHashRouter } from "hash-slash";
import { JazzInspector } from "jazz-inspector";
import { JazzProvider, useAccount } from "jazz-react";
import { Group, ID } from "jazz-tools";
import { Group } from "jazz-tools";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { ChatScreen } from "./chatScreen.tsx";
@@ -18,7 +18,7 @@ export function App() {
const createChat = () => {
if (!me) return;
const group = Group.create();
group.addMember("everyone", "writer");
group.makePublic("writer");
const chat = Chat.create([], group);
router.navigate("/#/chat/" + chat.id);
@@ -43,7 +43,7 @@ export function App() {
</TopBar>
{router.route({
"/": () => createChat() as never,
"/chat/:id": (id) => <ChatScreen chatID={id as ID<Chat>} />,
"/chat/:id": (id) => <ChatScreen chatID={id} />,
})}
</AppContainer>
);

View File

@@ -1,5 +1,5 @@
import { createImage, useAccount, useCoState } from "jazz-react";
import { Account, ID } from "jazz-tools";
import { Account, co } from "jazz-tools";
import { useState } from "react";
import { Chat, Message } from "./schema.ts";
import {
@@ -15,8 +15,10 @@ import {
TextInput,
} from "./ui.tsx";
export function ChatScreen(props: { chatID: ID<Chat> }) {
const chat = useCoState(Chat, props.chatID, { resolve: { $each: true } });
export function ChatScreen(props: { chatID: string }) {
const chat = useCoState(Chat, props.chatID, {
resolve: { $each: { text: true } },
});
const account = useAccount();
const [showNLastMessages, setShowNLastMessages] = useState(30);
@@ -36,7 +38,15 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
}
createImage(file, { owner: chat._owner }).then((image) => {
chat.push(Message.create({ text: file.name, image: image }, chat._owner));
chat.push(
Message.create(
{
text: co.plainText().create(file.name, chat._owner),
image: image,
},
chat._owner,
),
);
});
};
@@ -66,7 +76,12 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
<TextInput
onSubmit={(text) => {
chat.push(Message.create({ text }, { owner: chat._owner }));
chat.push(
Message.create(
{ text: co.plainText().create(text, chat._owner) },
chat._owner,
),
);
}}
/>
</InputBar>
@@ -74,8 +89,11 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
);
}
function ChatBubble(props: { me: Account; msg: Message }) {
if (!props.me.canRead(props.msg)) {
function ChatBubble(props: {
me: Account;
msg: co.loaded<typeof Message, { text: true }>;
}) {
if (!props.me.canRead(props.msg) || !props.msg.text?.toString()) {
return (
<BubbleContainer fromMe={false}>
<BubbleBody fromMe={false}>
@@ -89,7 +107,7 @@ function ChatBubble(props: { me: Account; msg: Message }) {
}
const lastEdit = props.msg._edits.text;
const fromMe = lastEdit.by?.isMe;
const fromMe = lastEdit?.by?.isMe;
const { text, image } = props.msg;
return (
@@ -98,7 +116,9 @@ function ChatBubble(props: { me: Account; msg: Message }) {
{image && <BubbleImage image={image} />}
<BubbleText text={text} />
</BubbleBody>
<BubbleInfo by={lastEdit.by?.profile?.name} madeAt={lastEdit.madeAt} />
{lastEdit && (
<BubbleInfo by={lastEdit.by?.profile?.name} madeAt={lastEdit.madeAt} />
)}
</BubbleContainer>
);
}

View File

@@ -1,8 +1,10 @@
import { CoList, CoMap, ImageDefinition, co } from "jazz-tools";
import { co, z } from "jazz-tools";
export class Message extends CoMap {
text = co.string;
image = co.optional.ref(ImageDefinition);
}
export const Message = co.map({
text: co.plainText(),
image: z.optional(co.image()),
});
export type Message = co.loaded<typeof Message>;
export class Chat extends CoList.Of(co.ref(Message)) {}
export const Chat = co.list(Message);
export type Chat = co.loaded<typeof Chat>;

View File

@@ -1,6 +1,6 @@
import clsx from "clsx";
import { ProgressiveImg } from "jazz-react";
import { ImageDefinition } from "jazz-tools";
import { CoPlainText, ImageDefinition } from "jazz-tools";
import { ImageIcon } from "lucide-react";
import { useId, useRef } from "react";
@@ -70,7 +70,10 @@ export function BubbleBody(props: {
);
}
export function BubbleText(props: { text: string; className?: string }) {
export function BubbleText(props: {
text: CoPlainText | string;
className?: string;
}) {
return (
<p className={clsx("px-2 leading-relaxed", props.className)}>
{props.text}

Some files were not shown because too many files have changed in this diff Show More