Compare commits

...

540 Commits

Author SHA1 Message Date
Guido D'Orsi
b5f1bb35d1 Merge pull request #1356 from garden-co/changeset-release/main
Version Packages
2025-02-11 15:59:34 +01:00
github-actions[bot]
b4ed7b0587 Version Packages 2025-02-11 14:51:45 +00:00
Guido D'Orsi
652ff8f53c Merge pull request #1251 from garden-co/authv2
Jazz 0.10.0
2025-02-11 15:50:11 +01:00
Guido D'Orsi
f519cd7356 Merge pull request #1337 from garden-co/jazz-689-group-extension-with-role-mapping
feat: add role mapping to group extension
2025-02-11 15:36:15 +01:00
Guido D'Orsi
20babc2e41 docs: add Group suffix on the group variables 2025-02-11 15:26:39 +01:00
Guido D'Orsi
6fc8efc1b5 Apply suggestions from code review
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-02-11 15:22:05 +01:00
Trisha Lim
e30bd2f489 Refine dark mode styles in chat demo 2025-02-11 21:01:53 +07:00
Guido D'Orsi
0b9cc2e0aa Merge branch 'authv2' into jazz-689-group-extension-with-role-mapping 2025-02-11 14:36:06 +01:00
Guido D'Orsi
610543c5b8 chore: changeset 2025-02-11 14:35:41 +01:00
Guido D'Orsi
53dbfee385 fix: fix Svelte tests preprocessing 2025-02-11 14:34:28 +01:00
Guido D'Orsi
9c577b98cd Apply suggestions from code review
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-02-11 14:33:38 +01:00
Guido D'Orsi
b2c03ca8c4 chore: restore shell: bash on action.yml 2025-02-11 13:01:19 +01:00
Guido D'Orsi
3feb3e82ff docs: small improvement on the wrapper suggestion 2025-02-11 12:59:06 +01:00
Guido D'Orsi
95e9bdb624 chore: update action.yaml to use blacksmith 2025-02-11 12:57:57 +01:00
Guido D'Orsi
68127a95d0 Merge remote-tracking branch 'origin/main' into authv2 2025-02-11 12:56:21 +01:00
Anselm Eickhoff
690e65ac06 Merge pull request #1352 from garden-co/blacksmith-migration-44f38f3
blacksmith.sh: Migrate workflows to Blacksmith
2025-02-11 11:42:01 +00:00
Guido D'Orsi
6f007a9470 Merge remote-tracking branch 'origin/authv2' into jazz-689-group-extension-with-role-mapping 2025-02-11 12:37:55 +01:00
Guido D'Orsi
23c588c717 docs: improve upgrade docs
Co-authored-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-02-11 12:34:38 +01:00
blacksmith-sh[bot]
494d902e79 Migrate workflows to Blacksmith 2025-02-11 11:25:06 +00:00
Guido D'Orsi
eebee4db6a docs: group inheritance and upgrade docs 2025-02-11 12:18:40 +01:00
Guido D'Orsi
44f38f3438 Merge pull request #1346 from garden-co/jazz-697-fix-copy-button-alignment
Fix copy button alignment
2025-02-11 11:45:06 +01:00
Guido D'Orsi
950db502c2 Merge pull request #1313 from boorad/feat/maestro
feat: add Maestro e2e tests for RN
2025-02-11 11:39:06 +01:00
Trisha Lim
33293f3b64 Fix copy button alignment 2025-02-11 16:20:55 +07:00
Guido D'Orsi
d5d448670d feat: add role mapping to group extension 2025-02-10 17:31:25 +01:00
Brad Anderson
e3c3913c74 test: don't forget self 2025-02-10 10:14:49 -05:00
Brad Anderson
2ee2fcaa27 test: more selective trigger 2025-02-10 10:13:56 -05:00
Brad Anderson
edc77c4bd5 test: PR feedback 2025-02-10 10:06:41 -05:00
Guido D'Orsi
0ce25f143b Merge pull request #1333 from garden-co/authv2-frameworks-docs
docs: update the upgrade guide & authentication docs for the other frameworks
2025-02-10 14:57:34 +01:00
Trisha Lim
e35018a5fa Redesign mobile nav (#1177) 2025-02-10 20:53:33 +07:00
Guido D'Orsi
0d05c927f1 docs: update the upgrade guide & authentication docs for the other frameworks 2025-02-10 14:44:09 +01:00
Guido D'Orsi
4ef43e3477 Merge pull request #1321 from garden-co/changeset-release/main
Version Packages
2025-02-10 11:34:24 +01:00
Guido D'Orsi
d7ce078f17 Merge pull request #1311 from garden-co/authv2-docs
Update docs for the new auth flow
2025-02-08 13:10:25 +01:00
Brad Anderson
95349d59f8 test: opt out of analytics 2025-02-07 16:31:24 -05:00
Brad Anderson
bb13b6e41d test: stop erase_text forever loop 2025-02-07 15:00:34 -05:00
Brad Anderson
3c2da2f0db gha 2025-02-07 13:34:44 -05:00
Brad Anderson
7bac26cf7f gha 2025-02-07 13:01:55 -05:00
Brad Anderson
d3d9200acf gha 2025-02-07 12:39:47 -05:00
Guido D'Orsi
60558ee664 Merge pull request #1325 from garden-co/authv2-group-api
fix: make Group.removeMember return the promise from CoJSON
2025-02-07 18:35:31 +01:00
Guido D'Orsi
6354135af4 Merge pull request #1327 from garden-co/reduce-max-retry-not-found
fix: reduce the retries on coValue not found to two
2025-02-07 18:34:58 +01:00
Guido D'Orsi
69a0befb7b chore: fix type issues on tests 2025-02-07 18:34:17 +01:00
Brad Anderson
c48aa7358a gha 2025-02-07 12:28:18 -05:00
Guido D'Orsi
01517d1463 Merge pull request #1326 from garden-co/authv2upgrade-guide
docs: upgrade guide for react
2025-02-07 18:14:31 +01:00
Brad Anderson
cdd7e6454f gha 2025-02-07 12:09:55 -05:00
Brad Anderson
2e030ea942 fix: no-go on xlarge - billing put their hand out 2025-02-07 12:09:55 -05:00
Brad Anderson
5207c00582 fix: try xlarge 2025-02-07 12:09:55 -05:00
Brad Anderson
22fa01b9c5 fix: startup timeout 5 mins 👀 2025-02-07 12:09:55 -05:00
Brad Anderson
f5a1e42dd6 fix: maestro path and startup timeout 2025-02-07 12:09:55 -05:00
Brad Anderson
58fe07351e test: missed a couple workflows for source code action 2025-02-07 12:09:54 -05:00
Brad Anderson
25e79fd001 fix: add shell to action 2025-02-07 12:09:54 -05:00
Brad Anderson
53868a4d50 test: corepack and maestro bin 2025-02-07 12:09:54 -05:00
Brad Anderson
21f6f4d933 test: switch order to give app time to install/launch 2025-02-07 12:09:54 -05:00
Brad Anderson
21f691b6da test: enable Maestro install for non-local runs 2025-02-07 12:09:54 -05:00
Brad Anderson
45c46ff14a test: add shell to composite action 2025-02-07 12:09:54 -05:00
Brad Anderson
6dad0878da test: share source code action, run e2e rn tests 2025-02-07 12:09:54 -05:00
Brad Anderson
3b6552d728 feat: add Maestro e2e tests for RN 2025-02-07 12:09:54 -05:00
Guido D'Orsi
e83ce5d6c8 docs: small typos and corrections 2025-02-07 18:03:00 +01:00
Guido D'Orsi
b6c672a1ad docs: improvments on the auth docs based on PR feedback 2025-02-07 17:43:05 +01:00
Guido D'Orsi
e2cfa60caa docs: improvments on the auth docs based on PR feedback 2025-02-07 17:28:27 +01:00
Guido D'Orsi
fa8f4e03d2 docs: improvments on the upgrade guide based on PR feedback 2025-02-07 17:18:58 +01:00
Guido D'Orsi
ac3d9fa2c3 fix: educe the retries on coValue not found to one 2025-02-07 15:06:10 +01:00
Guido D'Orsi
ff325ebf2a docs: improve the React authentication docs 2025-02-07 14:50:24 +01:00
Guido D'Orsi
71825cb90a feat: simplify Passphrase auth consumer API 2025-02-07 14:32:32 +01:00
Guido D'Orsi
d1281e560a docs: add the loading API and the changes on the workers 2025-02-06 17:42:37 +01:00
Guido D'Orsi
a1dc7f38ed docs: upgrade guide for react on auth & local-only 2025-02-06 16:43:14 +01:00
Guido D'Orsi
581118b918 fix: rename getCurrentUserPassphrase into getCurrentAccountPassphrase 2025-02-06 12:04:48 +01:00
github-actions[bot]
ab378b3d16 Version Packages 2025-02-06 09:41:56 +00:00
Guido D'Orsi
dd034643da fix: make Group.removeMember return the promise from CoJSON 2025-02-06 10:41:29 +01:00
Guido D'Orsi
bc2e531c05 Merge pull request #1323 from garden-co/fix/garden-copyright
Update copyright to 2025
2025-02-06 10:40:41 +01:00
Guido D'Orsi
334f6cf2d8 Merge pull request #1324 from garden-co/authv2-browser-integration-tests
test: cover browser sync scenarios with tests
2025-02-06 10:31:43 +01:00
Guido D'Orsi
31296a6ce2 test: moar isolation 2025-02-06 10:31:14 +01:00
Guido D'Orsi
6fc8ae8293 test: skip flaky test 2025-02-06 10:27:23 +01:00
Guido D'Orsi
a1d6e7147b test: close sync servers on test end 2025-02-06 10:25:11 +01:00
Guido D'Orsi
0d111b15f8 test: do not close the context 2025-02-06 10:15:33 +01:00
Guido D'Orsi
95b9c4825f test: increase timeout on CI 2025-02-05 19:41:33 +01:00
Guido D'Orsi
65e26d9ba4 test: cover file download from storage 2025-02-05 19:25:59 +01:00
Guido D'Orsi
cabce37133 fix: correctly handle cd when the project name has spaces 2025-02-05 18:56:47 +01:00
Guido D'Orsi
20c4484066 feat: better solution to isolate IndexedDB databases 2025-02-05 18:55:24 +01:00
Guido D'Orsi
17dc5fc37f chore: little context on what are the commands 2025-02-05 18:45:31 +01:00
Guido D'Orsi
05d907b675 test: add tests for check sync on unstable connections 2025-02-05 18:36:10 +01:00
Guido D'Orsi
62cb650356 feat: make possible to disable storage 2025-02-05 18:22:49 +01:00
Guido D'Orsi
9f833b3931 test: fix failing clerk test 2025-02-05 17:31:04 +01:00
Guido D'Orsi
f0d123979c test: cover browser sync scenarios with tests 2025-02-05 17:15:39 +01:00
Guido D'Orsi
90078a4bce fix(logOut): return a Promise to wait for the credentials clear 2025-02-05 17:15:17 +01:00
Guido D'Orsi
2d3aa76bf0 fix: use addListener to catch the clerk auth changes 2025-02-05 15:21:46 +01:00
Guido D'Orsi
86bd86b966 docs: update docs with the new auth flow and changes 2025-02-05 13:04:37 +01:00
Guido D'Orsi
bebd0ede64 chore: rename onAnonymousUserDiscarded into onAnonymousAccountDiscarded 2025-02-05 12:43:37 +01:00
Trisha Lim
14bdd496f7 Update copyright to 2025 2025-02-05 18:36:15 +07:00
Guido D'Orsi
91fcb3f6b6 Merge pull request #1309 from garden-co/fix/rotate-before-revoke
fix: move access revoke after key rotation
2025-02-05 11:19:18 +01:00
Guido D'Orsi
ff94cadd7b Merge pull request #1319 from garden-co/feat/throw-ensure-loaded-mis
feat: make ensureLoaded throw when the resolved value is undefined
2025-02-05 11:15:17 +01:00
Guido D'Orsi
60fe8f9106 Merge pull request #1320 from garden-co/authv2-vitest-upgrade
feat: upgrade vitest to v3 and vite to v6
2025-02-05 11:15:05 +01:00
Guido D'Orsi
5158581b0c chore(ci): install playwright deps 2025-02-04 18:12:16 +01:00
Guido D'Orsi
ee511b4934 test: run indexeddb tests on browser mode 2025-02-04 18:10:15 +01:00
Guido D'Orsi
bc13653236 fix: playwrite duplicate versions 2025-02-04 17:43:07 +01:00
Guido D'Orsi
fe28e254a3 feat: upgrade vitest to v3 and vite to v6 2025-02-04 17:24:56 +01:00
Guido D'Orsi
82179812de feat: drop node 14 polyfill for globalThis.crypto 2025-02-04 17:22:08 +01:00
Guido D'Orsi
d42c2aa014 feat: make ensureLoaded throw when the resolved value is undefined 2025-02-04 14:55:48 +01:00
Guido D'Orsi
ff92316488 Merge pull request #1318 from garden-co/pre-release
feat: add a pre-release action
2025-02-04 11:45:58 +01:00
Guido D'Orsi
00f1072f5a fix: use glob 2025-02-04 11:40:09 +01:00
Guido D'Orsi
c2d56b5eb8 chore: add a console.log 2025-02-04 11:32:09 +01:00
Guido D'Orsi
0d9eacc1ec fix: remove --affected 2025-02-04 11:23:57 +01:00
Guido D'Orsi
75491e65c0 chore(ci): fix syntax errors 2025-02-04 11:20:23 +01:00
Guido D'Orsi
a93df6fcb2 Merge branch 'main' into authv2 2025-02-04 11:19:52 +01:00
Guido D'Orsi
b5962b4f81 chore(ci): fix syntax errors 2025-02-04 11:19:07 +01:00
Guido D'Orsi
b5be0273a6 fix pre-release.yml syntax error 2025-02-04 11:17:40 +01:00
Guido D'Orsi
62a1aec555 feat: add a pre-release action 2025-02-04 11:14:45 +01:00
Benjamin S. Leveritt
5053a6fc80 Uses latest corepack as part of CI build 2025-02-04 10:10:49 +01:00
Guido D'Orsi
f038c2d378 Merge pull request #1315 from garden-co/jazz-686-use-latest-corepack
Uses latest corepack as part of CI build
2025-02-04 10:10:06 +01:00
Benjamin S. Leveritt
febafecfdd Uses latest corepack as part of CI build 2025-02-04 09:08:23 +00:00
Guido D'Orsi
394feb715d Merge pull request #1305 from garden-co/isomorphic-worker
feat: remove the ws dependency and use native WebSocket
2025-02-04 10:01:47 +01:00
Guido D'Orsi
76c125e628 Merge pull request #1312 from garden-co/authv2-test-apis
feat: improve compat between new auth api and testing api
2025-02-03 21:54:58 +01:00
Guido D'Orsi
10ac9d8659 chore: add file extension for the .svelte.ts imports 2025-02-03 20:46:58 +01:00
Trisha Lim
9a6d950727 Replace api key in apiKey.ts in create-jazz-app 2025-02-03 21:58:39 +07:00
Trisha Lim
326d3b90c2 Move api key of example apps into apiKey.ts 2025-02-03 21:58:39 +07:00
Trisha Lim
499f39340b Fix type 2025-02-03 21:58:39 +07:00
Trisha Lim
54eba823ad Add changeset 2025-02-03 21:58:39 +07:00
Trisha Lim
61e787ec89 Add API key param to create jazz app 2025-02-03 21:58:39 +07:00
Trisha Lim
95d42b1340 Add framework param to create-jazz-app 2025-02-03 21:58:39 +07:00
Trisha Lim
bf9840ea46 Remove unused types 2025-02-03 21:58:39 +07:00
Guido D'Orsi
74dbbaf4d4 test: cover migration globalMe management 2025-01-31 17:09:26 +01:00
Guido D'Orsi
c2ae5b6206 feat: add Passphrase auth 2025-01-31 17:09:26 +01:00
Guido D'Orsi
25de660d27 test: add tests for PassPhrase auth 2025-01-31 17:09:25 +01:00
Guido D'Orsi
de90f45f41 feat(testing): throw when multiple migrations are executed in parallel 2025-01-31 17:09:25 +01:00
Guido D'Orsi
dda79df1c3 feat: improve compat between new auth api and testing api 2025-01-31 17:09:23 +01:00
Guido D'Orsi
26ea68999b Merge pull request #1310 from garden-co/authv2-throw-guest-mode
fix: throw when auth hooks are used in guest mode
2025-01-31 14:12:06 +01:00
Guido D'Orsi
4cfb4af1da Merge pull request #1308 from garden-co/authv2-onAnonymousUserDiscarded
feat: API to handle the authenticate on top of an anonymous user
2025-01-31 14:11:34 +01:00
Guido D'Orsi
11eaa99af7 fix: throw when auth hooks are used in guest mode 2025-01-30 19:34:22 +01:00
Guido D'Orsi
93231c27f4 fix: fix error handling on WebSocket and move WebSocketPeerWithReconnection in cojson-transport-ws for better DX 2025-01-30 19:33:04 +01:00
Guido D'Orsi
e7b9c90eef Merge remote-tracking branch 'origin/main' into authv2 2025-01-30 19:11:52 +01:00
Guido D'Orsi
70c9a5db88 fix: move access revoke after key rotation 2025-01-30 19:01:28 +01:00
Guido D'Orsi
2e6c2498b5 feat: API to handle the authenticate on top of an anonymous user 2025-01-30 18:36:16 +01:00
Guido D'Orsi
e7fd617ca9 test: remove only modifier 2025-01-30 18:35:59 +01:00
Guido D'Orsi
bd5b03b18d fix: always close the websocket on error 2025-01-30 18:30:52 +01:00
Guido D'Orsi
3a7ab9b3a1 feat: remove the ws dependency and use native WebSocket 2025-01-30 11:43:10 +01:00
Trisha Lim
0cf789622c Remove dropdown component 2025-01-30 12:02:45 +08:00
Trisha Lim
d63f5eec5e Move kicker to a separate component 2025-01-30 12:02:45 +08:00
Trisha Lim
42bd8b76a1 Create a more flexible component for headings 2025-01-30 12:02:45 +08:00
Trisha Lim
73742656ae Design system improvements 2025-01-30 12:02:45 +08:00
Guido D'Orsi
f71f26d1dc Merge pull request #1303 from garden-co/changeset-release/main
Version Packages
2025-01-29 19:43:35 +01:00
github-actions[bot]
95822300d7 Version Packages 2025-01-29 18:39:50 +00:00
Guido D'Orsi
679fe040cf Merge pull request #1302 from garden-co/handler-websocket-errors
fix: handle websocket errors and add onSuccess callback
2025-01-29 19:38:38 +01:00
Guido D'Orsi
14b6149f50 fix: handle websocket errors and add onSuccess callback 2025-01-29 18:58:56 +01:00
Guido D'Orsi
4446738940 chore: disable formatter on package.json 2025-01-29 18:57:48 +01:00
Guido D'Orsi
c8ad016d9c fix: improve ws error management 2025-01-29 18:46:04 +01:00
Guido D'Orsi
498954fd09 chore: changeset 2025-01-29 18:34:03 +01:00
Guido D'Orsi
198f6d3627 Merge remote-tracking branch 'origin/main' into authv2 2025-01-29 18:23:57 +01:00
Guido D'Orsi
f701f2a4f4 Merge pull request #1300 from garden-co/authv2-example-apps
feat: change the peer & localOnly props into sync
2025-01-29 18:21:19 +01:00
Guido D'Orsi
94131ba6d6 feat: change the peer & localOnly props into sync 2025-01-29 18:17:21 +01:00
Guido D'Orsi
c0e892313f Merge pull request #1282 from garden-co/not-found-state
fix(useCoState): return null when a coValue is not found
2025-01-29 18:13:20 +01:00
Guido D'Orsi
b426342c02 fix(useCoState): return null when a coValue is not found 2025-01-29 18:12:56 +01:00
Giordano Ricci
bbbd773c3f Merge pull request #1299 from garden-co/changeset-release/main
Version Packages
2025-01-29 16:53:17 +00:00
github-actions[bot]
7d5f4e5881 Version Packages 2025-01-29 16:40:51 +00:00
Giordano Ricci
29c44538dc Merge pull request #1298 from garden-co/gio/is-it-really-me
Change isMe to indicate whether an account is the currently active account
2025-01-29 16:39:46 +00:00
Giordano Ricci
198f995b21 update changeset 2025-01-29 16:31:33 +00:00
Guido D'Orsi
2d639667a3 Merge pull request #1296 from garden-co/authv2-example-apps
feat: improve builtin auth UIs
2025-01-29 17:24:33 +01:00
Giordano Ricci
1be017d69d make isMe indicate whether an account is the currently active one, add isLocalNodeOwner to reproduce previous behavior 2025-01-29 16:20:14 +00:00
Guido D'Orsi
03df4fee8e fix: move the Auth UI outside the container div 2025-01-29 16:34:36 +01:00
Guido D'Orsi
c658ed3404 fix: remove the localOnly prop where breaking 2025-01-29 16:20:07 +01:00
Guido D'Orsi
99e58e60dc test: fix the PasskeyAuthBasicUI test 2025-01-29 16:04:58 +01:00
Guido D'Orsi
a9ad0284e9 fix: fdix example apps tests 2025-01-29 15:39:31 +01:00
Guido D'Orsi
6e2d791c4b feat: better username management in chat example 2025-01-29 13:58:02 +01:00
Guido D'Orsi
f9be857bbb feat: improve builtin auth UIs 2025-01-29 13:40:38 +01:00
Guido D'Orsi
1288ac140e Merge pull request #1293 from garden-co/authv2-auth-state-refactoring
feat: update the React Native packages with the new auth system
2025-01-29 10:31:52 +01:00
Guido D'Orsi
7f07f7e049 Merge pull request #1294 from boorad/authv2-web-example-refactoring
feat: update web examples to new auth system
2025-01-29 10:31:25 +01:00
Guido D'Orsi
b22589bbad test: add integration tests for the websocket peer 2025-01-29 10:26:09 +01:00
Guido D'Orsi
be144adeee chore: rename onSuccessCalles to isFirstMessage and add a test 2025-01-29 10:17:59 +01:00
Brad Anderson
513619b04e feat: update web examples to new auth system 2025-01-28 23:13:44 -05:00
Guido D'Orsi
81f6a75aac chore: add comment 2025-01-28 20:11:52 +01:00
Guido D'Orsi
913d03de75 feat: update the RN example apps with the new Auth system 2025-01-28 19:34:56 +01:00
Guido D'Orsi
2d0172d839 feat: update the React Native packages with the new auth system 2025-01-28 19:34:04 +01:00
Guido D'Orsi
27d46641e3 feat: unify React Native and Jazz Tools DemoAuth users management 2025-01-28 19:32:55 +01:00
Guido D'Orsi
1014816d79 feat: move WebSocketPeerWithReconnection to jazz-tools 2025-01-28 19:09:34 +01:00
Guido D'Orsi
441194acb7 feat: add onSuccess hook and close the WebSocket on error 2025-01-28 19:06:35 +01:00
Guido D'Orsi
c9bea7200f feat: rename jazz-browser-clerk-auth in jazz-clerk-auth and update jazz-react-native-auth-clerk 2025-01-28 19:05:43 +01:00
Guido D'Orsi
9eaa88bd83 Merge pull request #1291 from garden-co/authv2-auth-state-refactoring
feat: make auth state platform agnostic
2025-01-28 18:35:50 +01:00
Guido D'Orsi
6ada48d57a chore: remove unused imports 2025-01-28 18:05:55 +01:00
Guido D'Orsi
8fa978df21 fix: initialize the anonymous storage only if newAccountProps is not provided 2025-01-28 16:27:25 +01:00
Guido D'Orsi
df7356fd24 chore: cleanup and small fix on websocket enable/disable 2025-01-28 14:45:58 +01:00
Guido D'Orsi
153fa4ce44 fix: invalidate context when localOnly is updated 2025-01-28 12:19:46 +01:00
Guido D'Orsi
6105bd2c88 test: cover createContext and ContextManager 2025-01-28 12:09:48 +01:00
Guido D'Orsi
c06d63eec1 fix: align passphrase auth with the current auth flow 2025-01-28 10:54:47 +01:00
Guido D'Orsi
4ee7359370 test: PassphraseAuth 2025-01-27 22:25:22 +01:00
Guido D'Orsi
7b5c47b377 test: cover DemoAuth 2025-01-27 22:12:42 +01:00
Guido D'Orsi
7ad57e88f3 test: add tests on the react-core auth hooks 2025-01-27 21:59:06 +01:00
Guido D'Orsi
c181e55557 feat: make auth state platform agnostic 2025-01-27 19:27:21 +01:00
Benjamin S. Leveritt
5574be699b Merge pull request #1290 from garden-co/jazz-682-update-nix-flake-to-node-22
Chore: Update nix flake for node22
2025-01-27 15:25:16 +00:00
Benjamin S. Leveritt
b3142cb8ed Chore: Update nix flake for node22 2025-01-27 15:02:20 +00:00
Benjamin S. Leveritt
cb08d9d1a3 Merge pull request #1240 from garden-co/jazz-662-add-llmstxt
Adds LLMs.txt generator
2025-01-27 14:55:10 +00:00
Guido D'Orsi
7e0cd721e6 Merge remote-tracking branch 'origin/main' into authv2 2025-01-27 15:51:33 +01:00
Guido D'Orsi
4d01cbae03 Merge pull request #1288 from garden-co/sync-tests-improvements
Improve sync tests and add some utils to track the messages exchanges
2025-01-27 15:47:03 +01:00
Guido D'Orsi
13f6389559 chore: format text 2025-01-27 15:38:34 +01:00
Guido D'Orsi
f6ea9bcc50 test: remove flaky test 2025-01-27 15:37:02 +01:00
Guido D'Orsi
f6f2766eac test: cover the initial messages exchanges 2025-01-27 15:35:35 +01:00
Guido D'Orsi
f8f63bface test: simplify sync tests with the test sync pattern 2025-01-27 15:35:34 +01:00
Guido D'Orsi
5ec561fec4 Merge pull request #1281 from garden-co/changeset-release/main
Version Packages
2025-01-27 11:07:35 +01:00
github-actions[bot]
277787cbd2 Version Packages 2025-01-27 10:03:17 +00:00
Guido D'Orsi
dda4336721 Merge pull request #1252 from garden-co/fix-ts-symbol-error
fix(typescript): replace private symbols with prefixed strings
2025-01-27 11:01:37 +01:00
Guido D'Orsi
59ddff40ab Merge pull request #1270 from garden-co/authv2-clerk
feat: improve the clerk integration
2025-01-27 11:01:13 +01:00
Guido D'Orsi
064d19b48c chore: move jazz-react-core version up to 0.9.19 2025-01-27 09:27:18 +01:00
Guido D'Orsi
3ea269f4d8 chore: package json formatting 2025-01-27 09:27:00 +01:00
Guido D'Orsi
c4b8befe27 Merge pull request #1278 from garden-co/changeset-release/main
Version Packages
2025-01-27 09:21:29 +01:00
Guido D'Orsi
06f667ef2a Merge pull request #1280 from doingandlearning/patch-2
Update README.md
2025-01-27 09:21:16 +01:00
github-actions[bot]
bac3cc7bf8 Version Packages 2025-01-27 08:17:07 +00:00
Guido D'Orsi
6ad0a9f886 chore: changeset 2025-01-27 09:15:44 +01:00
Kevin Cunningham
9b12932b66 Update README.md 2025-01-26 09:10:49 +00:00
Guido D'Orsi
82bb0d51d9 Merge pull request #1277 from garden-co/changeset-release/main
Version Packages
2025-01-25 20:27:12 +01:00
Guido D'Orsi
39dede92e8 Merge pull request #1273 from garden-co/fix/remove-npm-create
Remove npm create jazz-app from instructions
2025-01-25 20:27:00 +01:00
github-actions[bot]
84f4e6e48d Version Packages 2025-01-25 19:22:29 +00:00
Guido D'Orsi
e629dea585 fix: remove internal imports to cojson 2025-01-25 20:21:22 +01:00
Guido D'Orsi
2faf22ffff chore: changeset 2025-01-25 18:45:43 +01:00
Guido D'Orsi
2273505a13 Merge pull request #1276 from anchpop/@anchpop/remove-inspector-vite
fix(jazz-inspector): export typescript types and remove unneeded vite build step
2025-01-25 18:45:30 +01:00
Andre Popovitch
19eb29d831 fix(jazz-inspector): export typescript types and remove unneeded vite build step 2025-01-26 00:04:00 +09:00
Andre Popovitch
738c4c2bd7 fix(jazz-inspector): Add files entry to package.json so dist is included in published releases 2025-01-25 23:37:27 +09:00
Guido D'Orsi
64e2273475 Merge pull request #1274 from garden-co/changeset-release/main
Version Packages
2025-01-25 11:20:10 +01:00
github-actions[bot]
5a85c89154 Version Packages 2025-01-25 10:18:09 +00:00
Guido D'Orsi
8898b10e89 chore: changeset 2025-01-25 11:16:54 +01:00
Andre Popovitch
dc2d4e25f7 Remove npm create for examples 2025-01-25 18:09:52 +08:00
Trisha Lim
9275c4f6c0 Remove npm create jazz-app from instructions 2025-01-25 18:07:48 +08:00
Guido D'Orsi
cb75cc62b2 chore: exclude storage from the propsChanged check 2025-01-25 00:38:09 +01:00
Guido D'Orsi
b141f6a62f fix: double context creation on React 2025-01-25 00:36:58 +01:00
Guido D'Orsi
4a251a528c feat: improve the clerk integration 2025-01-24 19:37:59 +01:00
Guido D'Orsi
ac3c2df474 Merge pull request #1268 from garden-co/changeset-release/main
Version Packages
2025-01-24 17:32:53 +01:00
github-actions[bot]
681f973d4b Version Packages 2025-01-24 16:17:09 +00:00
Guido D'Orsi
338be7622f Merge pull request #1269 from garden-co/feat/group-add-member-typechecks
fix: improve typescript types for group.addMember
2025-01-24 17:15:57 +01:00
Guido D'Orsi
1227047b03 fix: improve typescript types for group.addMember 2025-01-24 17:07:32 +01:00
Guido D'Orsi
9afde8d0be Merge pull request #1267 from garden-co/feat/invite
feat: move invite API in jazz-tools
2025-01-24 17:06:10 +01:00
Guido D'Orsi
c2ca1feba0 feat: move invite API in jazz-tools 2025-01-24 16:52:34 +01:00
Guido D'Orsi
f8b6119996 feat: translate isAnonymous checks into isAuthenticated and add tests 2025-01-24 16:15:18 +01:00
pax
98c265304a Merge pull request #1265 from garden-co/changeset-release/main
Version Packages
2025-01-24 16:57:00 +02:00
github-actions[bot]
675e3e8046 Version Packages 2025-01-24 14:44:45 +00:00
pax
4acba8c990 Merge pull request #1245 from garden-co/JZI-64/handle-gibberish-names-when-signing-up-using-email
Extract friendly user name for profile creation when authenticating using Clerk with a regular email address
2025-01-24 16:43:46 +02:00
pax-k
a93adeb1fe chore: cleanup 2025-01-24 16:35:32 +02:00
Guido D'Orsi
a7c90f749e feat: move the context manager into jazz-tools 2025-01-24 15:30:43 +01:00
pax-k
cf8773f3de chore: pnpm lock 2025-01-24 16:28:27 +02:00
pax-k
3be94ae1e7 feat: extended clerk auth creation props with "other" field 2025-01-24 14:31:04 +02:00
pax-k
6a8aa06d18 fix: cleaning clerk creds 2025-01-24 13:36:27 +02:00
Anselm Eickhoff
dc17889209 Fix incorrect sentence about migrate being static 2025-01-24 10:57:53 +00:00
Benjamin S. Leveritt
4dab70eea3 Adds docs to llms-full 2025-01-24 10:51:32 +00:00
Guido D'Orsi
55f9d8e120 Merge pull request #1260 from garden-co/changeset-release/main
Version Packages
2025-01-24 09:47:45 +01:00
github-actions[bot]
15b9457ed8 Version Packages 2025-01-24 08:03:18 +00:00
Guido D'Orsi
898297e95c Merge pull request #1259 from garden-co/jazz-672-create-jazz-app-cant-clone-repos
Fix: create-jazz-app fails if no starter param
2025-01-24 09:02:16 +01:00
Trisha Lim
0fc4f24cd5 Add changeset 2025-01-24 15:25:50 +08:00
Trisha Lim
63b5ad9edf Fix: create-jazz-app fails if no starter param 2025-01-24 15:23:23 +08:00
Trisha Lim
873c3264ca Update gitignore 2025-01-24 14:56:22 +08:00
Trisha Lim
34f89e48aa Fix example readme instructions 2025-01-24 14:56:22 +08:00
Guido D'Orsi
b01cc1fe9d fix(typescript): fix type error on ItemsSym 2025-01-23 19:21:29 +01:00
Guido D'Orsi
3a6e34589f feat: defaultName and better props tracking 2025-01-23 18:34:37 +01:00
Benjamin S. Leveritt
68e9c85d8f Adds docs to llms.txt 2025-01-23 16:44:44 +00:00
Benjamin S. Leveritt
1b124ff5c7 Changes extension for use in nodeJS 2025-01-23 16:44:29 +00:00
Guido D'Orsi
a1d512d9d7 Merge remote-tracking branch 'origin/main' into authv2 2025-01-23 17:28:14 +01:00
Guido D'Orsi
51bf6b7fdc Merge pull request #1223 from garden-co/auth-flow-rewrite
Auth flow rewrite
2025-01-23 17:26:53 +01:00
Guido D'Orsi
b5826fc0a5 Merge pull request #1176 from garden-co/user-onboarding-upgrade
feat: zero-setup auth, anonymous user upgrade and localOnly sync
2025-01-23 17:22:50 +01:00
Guido D'Orsi
becdd2f451 test(music-player): fix e2e tests 2025-01-23 17:12:47 +01:00
Guido D'Orsi
3b20bf354f feat: migrate svelte 2025-01-23 16:58:44 +01:00
Benjamin S. Leveritt
ab2645765d Generates two llms.txt, listing and full 2025-01-23 15:13:45 +00:00
Benjamin S. Leveritt
2dec852ce2 Adds API ref links to methods 2025-01-23 13:14:19 +00:00
Benjamin S. Leveritt
8cb09379f4 Adds ids for methods 2025-01-23 13:13:41 +00:00
Guido D'Orsi
fff7fe934b feat: update Vue 2025-01-23 12:55:12 +01:00
Benjamin S. Leveritt
9fb2e61e01 Extracts more information 2025-01-23 11:39:52 +00:00
pax-k
24b3b6afc1 chore: changeset 2025-01-22 20:33:55 +02:00
pax-k
c2eed7e2c4 fix: extract friendly user name for profile creation when authenticating using clerk with a regular email address 2025-01-22 20:32:32 +02:00
Guido D'Orsi
f97ef696e3 Merge pull request #1244 from garden-co/changeset-release/main
Version Packages
2025-01-22 19:22:23 +01:00
github-actions[bot]
ad65cb8ab5 Version Packages 2025-01-22 18:22:06 +00:00
Guido D'Orsi
8d8131410a Merge pull request #1243 from garden-co/testing-migration-ctx
fix: correctly set the globalMe before the migration when calling createJazzTestAccount
2025-01-22 19:20:52 +01:00
Guido D'Orsi
7491711b72 fix: correctly set the globalMe before the migration when calling createJazzTestAccount 2025-01-22 19:19:07 +01:00
Giordano Ricci
5933aa59c1 Merge pull request #1242 from garden-co/changeset-release/main
Version Packages
2025-01-22 17:33:31 +00:00
github-actions[bot]
da96bec465 Version Packages 2025-01-22 17:30:19 +00:00
Guido D'Orsi
483422c0e9 Merge pull request #1241 from garden-co/guido/test
feat: API to setup a test sync in the test environment
2025-01-22 18:28:38 +01:00
Guido D'Orsi
3df93cc147 chore: changeset 2025-01-22 18:22:16 +01:00
Guido D'Orsi
d686edfa6c chore: add tests and use ref to track the current sync server 2025-01-22 18:22:15 +01:00
Giordano Ricci
497b0ade1f feat: API to setup a test sync in the test environment 2025-01-22 18:21:48 +01:00
Benjamin S. Leveritt
794927cac3 Adds LLMs.txt generator 2025-01-22 17:09:29 +00:00
Guido D'Orsi
4c8d128eee feat: auth flow rewrite 2025-01-22 18:04:45 +01:00
Guido D'Orsi
86acbcd0d6 Merge pull request #1237 from garden-co/changeset-release/main
Version Packages
2025-01-22 12:51:45 +01:00
github-actions[bot]
9111c85445 Version Packages 2025-01-22 11:46:06 +00:00
Guido D'Orsi
1d87879787 Merge pull request #1231 from garden-co/revert-1229-revert-custom-logger
Restore cutom logger
2025-01-22 12:44:53 +01:00
Guido D'Orsi
7c777f2bdf test: cover the storage regression with a test 2025-01-22 12:41:51 +01:00
Benjamin S. Leveritt
aa8067b8d0 Merge pull request #1234 from garden-co/fix-clerk-example
chore: simplify clerk example auth-context
2025-01-22 10:15:21 +00:00
Guido D'Orsi
bd66cdeb78 chore: simplify clerk example auth-context 2025-01-22 10:29:54 +01:00
Guido D'Orsi
8d29e50669 feat: adapt the logger interface to pino 2025-01-21 17:52:40 +01:00
Guido D'Orsi
5a7398d242 Revert "Revert custom logger" 2025-01-21 17:08:37 +01:00
Guido D'Orsi
74b984fbe6 Merge pull request #1230 from garden-co/changeset-release/main
Version Packages
2025-01-21 16:53:36 +01:00
github-actions[bot]
f8e00204b4 Version Packages 2025-01-21 15:49:31 +00:00
Guido D'Orsi
76543df765 Merge pull request #1229 from garden-co/revert-custom-logger
Revert custom logger
2025-01-21 16:48:17 +01:00
Guido D'Orsi
15d4b2a5f7 chore: changeset 2025-01-21 16:44:37 +01:00
Guido D'Orsi
2e67f91fe0 Revert "feat: make it possible to customize the logger in cojson"
This reverts commit 5863badbb0.
2025-01-21 16:42:54 +01:00
Guido D'Orsi
df106ca680 test: fix create image test 2025-01-21 11:15:18 +01:00
Guido D'Orsi
c58f93b597 Merge remote-tracking branch 'origin/main' into user-onboarding-upgrade 2025-01-21 10:49:01 +01:00
Guido D'Orsi
3f2a0ead1b fix: self-review fixes 2025-01-21 10:34:42 +01:00
Guido D'Orsi
c9e6d2998e feat: improve the jazz-react provider 2025-01-20 20:10:18 +01:00
Benjamin S. Leveritt
0eb21a3471 Merge pull request #1216 from boorad/feat/demo-auth-theme
fix: phone theme drives light/dark mode in Demo Auth
2025-01-20 13:27:19 +00:00
Guido D'Orsi
99e88d3497 Merge pull request #1220 from garden-co/changeset-release/main
Version Packages
2025-01-20 13:06:56 +01:00
github-actions[bot]
f09ce70d3c Version Packages 2025-01-20 11:57:26 +00:00
Guido D'Orsi
7d62e2735f Merge pull request #1219 from garden-co/custom-logger
feat: make it possible to customize the logger in cojson
2025-01-20 12:56:11 +01:00
Guido D'Orsi
40634c6ec1 chore: update lockfile 2025-01-20 12:41:08 +01:00
Guido D'Orsi
5863badbb0 feat: make it possible to customize the logger in cojson 2025-01-20 12:34:31 +01:00
Guido D'Orsi
8bc758ce95 Merge remote-tracking branch 'origin/main' into user-onboarding-upgrade 2025-01-20 12:32:25 +01:00
Guido D'Orsi
56d26222e7 Merge pull request #1214 from garden-co/feat/queue-optimization
perf: optimize queue processing under heavy load
2025-01-20 12:30:58 +01:00
Guido D'Orsi
bd34084104 Merge pull request #1218 from garden-co/feat/inspector-component
feat: in-app inspector component for react web
2025-01-20 12:27:09 +01:00
Guido D'Orsi
f5e6fe927d chore: clean deps 2025-01-20 12:21:56 +01:00
Guido D'Orsi
93c49639c2 feat: in-app inspector component 2025-01-19 19:58:07 +01:00
Brad Anderson
aabe7bef34 fix: phone theme drives light/dark mode in Demo Auth 2025-01-17 23:07:38 -05:00
Guido D'Orsi
909165d813 test: cover nested SchemaUnion 2025-01-18 00:27:33 +01:00
Guido D'Orsi
6bee742b65 Merge pull request #1207 from garden-co/changeset-release/main
Version Packages
2025-01-18 00:26:30 +01:00
github-actions[bot]
23486d01b9 Version Packages 2025-01-17 23:23:34 +00:00
Guido D'Orsi
b761d5a730 Merge pull request #1215 from garden-co/fix/auth-issues
fix: improve error management on initial auth, fixed an infinite loop when migration fails
2025-01-18 00:22:06 +01:00
Guido D'Orsi
9181e74fc8 chore: add ts-ignore on an error flagged by some Typescript versions 2025-01-18 00:14:54 +01:00
Guido D'Orsi
5e83864f41 fix: improve error management on initial auth, fixed an infinite loop when migration fails 2025-01-18 00:12:46 +01:00
Guido D'Orsi
73079ca1b7 test: update e2e tests 2025-01-17 22:57:45 +01:00
Guido D'Orsi
789cf66de2 test: fix failing test 2025-01-17 20:00:44 +01:00
Guido D'Orsi
c36f19a97f fix: fix imports & and tests on createJazzBrowserContext 2025-01-17 19:28:38 +01:00
Guido D'Orsi
109338923a chore: update lockfile 2025-01-17 18:18:57 +01:00
Guido D'Orsi
f4c2501b06 chore: move auth hook in useInJazzAuth 2025-01-17 18:18:24 +01:00
Guido D'Orsi
9161229474 chore: revert the changes on the todo example 2025-01-17 18:17:46 +01:00
Guido D'Orsi
265f2f40bf fix: fix passkey auth cancelation and add tests 2025-01-17 17:50:35 +01:00
Guido D'Orsi
d2935ac2ae feat: make clerk auth compatible with passkeys 2025-01-17 14:49:25 +01:00
Guido D'Orsi
aaf00b8a20 feat: update starter example with anonymous auth 2025-01-17 14:49:25 +01:00
Guido D'Orsi
f9c6a49d2a feat: onboarding auth on todo example 2025-01-17 14:49:25 +01:00
Guido D'Orsi
2f54a48a3d feat: make auth code disappear from the React setup 2025-01-17 14:49:25 +01:00
Guido D'Orsi
be4dd0a787 feat: centralize auth secret management 2025-01-17 14:49:25 +01:00
Guido D'Orsi
f3f072e7cf feat: improve login/signup code and better UX on the music player auth 2025-01-17 14:49:24 +01:00
Guido D'Orsi
a6270bf552 feat: add onboarding user upgrade to Passkey and Clerk auth 2025-01-17 14:49:24 +01:00
Guido D'Orsi
de5f2d6d5b Merge pull request #1213 from garden-co/fix/handle-unknown-covaule-types
perf: skip coValue content creation on access
2025-01-17 14:44:03 +01:00
Guido D'Orsi
4aa377dea7 chore: changeset 2025-01-17 14:42:05 +01:00
Guido D'Orsi
efbf3d84ac chore: changeset 2025-01-17 14:41:51 +01:00
Guido D'Orsi
b90393b43e perf: optimize queue processing under heavy load 2025-01-17 14:28:00 +01:00
Guido D'Orsi
31ae73fe0e perf: skip coValue content creation on access 2025-01-17 12:49:24 +01:00
Guido D'Orsi
7a5adfc4dc Merge pull request #1212 from garden-co/fix/handle-unknown-covaule-types
feat: handle unknown coValue content instead of triggering an error
2025-01-17 12:23:50 +01:00
Guido D'Orsi
850e264912 feat: handle unknown coValue content instead of triggering an error 2025-01-17 12:02:32 +01:00
Anselm Eickhoff
aa81779ad8 Update page.tsx 2025-01-17 09:59:40 +00:00
Guido D'Orsi
72c97c0835 Merge pull request #1208 from garden-co/0.9.8-changelog
docs: add the 0.9.8 changelog
2025-01-14 18:35:21 +01:00
Guido D'Orsi
12809a6733 docs: add the 0.9.8 changelog 2025-01-14 17:21:51 +01:00
Guido D'Orsi
c55aeff98e docs: fix CoMap load & subscribe docs example 2025-01-14 16:56:47 +01:00
Guido D'Orsi
16b76e401c docs: fix jazz-tools tsDoc generation 2025-01-14 16:48:42 +01:00
Guido D'Orsi
d2470efd6f test: add a test to cover an indirect communication between nodes 2025-01-14 16:45:11 +01:00
pax
1a97b1b77c Merge pull request #1205 from garden-co/JAZZ-647/fix-image-handling-in-rn-chat-demo
Fix image handling in RN Chat Demo
2025-01-14 17:43:54 +02:00
Guido D'Orsi
adde5b78f3 Merge pull request #1201 from garden-co/changeset-release/main
Version Packages
2025-01-14 16:24:28 +01:00
github-actions[bot]
06fd3a3686 Version Packages 2025-01-14 14:02:14 +00:00
Anselm Eickhoff
d231b6ae2a Merge pull request #1191 from garden-co/fix/create-jazz-app
Use example apps as starter with create-jazz-app
2025-01-14 14:00:52 +00:00
pax-k
f76274c19a chore: changeset 2025-01-14 15:15:59 +02:00
Benjamin S. Leveritt
e471fc5d23 Merge pull request #1204 from garden-co/jazz-648-homepage-generate-docs-pointing-to-wrong-jazz-react
Fix location of jazz-react entryPoint for docs gen
2025-01-14 13:15:35 +00:00
pax-k
cb1b602255 Merge remote-tracking branch 'upstream/main' into JAZZ-647/fix-image-handling-in-rn-chat-demo 2025-01-14 15:14:30 +02:00
pax-k
a728dbf632 fix: image handling in react-native 2025-01-14 15:14:06 +02:00
Benjamin S. Leveritt
84d06d180a Fix location of jazz-react entryPoint for docs gen 2025-01-14 13:13:18 +00:00
Benjamin S. Leveritt
342e4d9f5e Merge pull request #1173 from garden-co/jazz-534-richtext-changes
Improve coRichText support
2025-01-14 12:46:50 +00:00
Benjamin S. Leveritt
8eb92471ae Add changeset 2025-01-14 12:44:19 +00:00
Guido D'Orsi
0cfc32f591 Merge pull request #1198 from garden-co/changeset-release/main
Version Packages
2025-01-14 12:42:19 +01:00
github-actions[bot]
e8b1e07625 Version Packages 2025-01-14 10:20:58 +00:00
pax
f97946bd21 Merge pull request #1199 from garden-co/fix-react-usecontext-reference
Fix React.useContext() reference
2025-01-14 12:19:41 +02:00
pax-k
f7f461db31 chore: changeset 2025-01-14 12:04:47 +02:00
pax-k
653d09c337 fix: explicitly use useContext() instead of React.useContext() 2025-01-14 12:03:53 +02:00
pax-k
3fa5ac30ff chore: cleanup 2025-01-14 11:39:59 +02:00
Guido D'Orsi
4095041da9 Merge pull request #1179 from garden-co/jazz-640-api-make-the-current-active-account-the-default-in
Without me
2025-01-14 10:11:40 +01:00
Guido D'Orsi
c1c2f39cb5 test: fix failing test 2025-01-14 09:33:33 +01:00
Benjamin S. Leveritt
e5b93871f7 Add test for insertion at start 2025-01-14 08:22:04 +00:00
Benjamin S. Leveritt
896aeb571d Fix multiple insertions at start 2025-01-14 08:22:03 +00:00
Guido D'Orsi
f7f1a0aff0 fix: use groups as defult owner 2025-01-13 20:24:51 +01:00
Guido D'Orsi
3bc82dc382 Update homepage/homepage/app/docs/[framework]/[...slug]/guide/react.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-01-13 19:36:14 +01:00
Guido D'Orsi
99bac77ae7 Update homepage/homepage/app/docs/[framework]/[...slug]/guide/react.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-01-13 19:36:03 +01:00
Guido D'Orsi
5705ebdcad Update packages/jazz-tools/src/implementation/activeAccountContext.ts
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-01-13 19:35:54 +01:00
pax
f3fb445c9e Merge pull request #1197 from garden-co/JAZZ-638/set-specific-package-version-on-create-jazz-app
create-jazz-app gets the latest semver package version for jazz-* dependencies from NPM via HTTP
2025-01-13 18:19:08 +02:00
pax-k
c60fe8aae2 chore: cleanup 2025-01-13 18:15:43 +02:00
pax-k
d2a882e531 fix: actually throw an error if getLatestPackageVersions() fails, without falling back to "latest" 2025-01-13 18:11:37 +02:00
pax-k
036fa1f43b chore: changeset 2025-01-13 18:06:41 +02:00
pax-k
839b4af45c fix: fetching latest semver jazz-* package versions from NPM when using create-jazz-app, instead of using "latest" 2025-01-13 18:04:07 +02:00
Trisha Lim
3a9797ce75 Add changeset 2025-01-13 14:48:59 +00:00
Trisha Lim
b2f14c0339 Update examples README 2025-01-13 12:37:57 +00:00
Guido D'Orsi
5d9405ccc3 Merge pull request #1196 from garden-co/changeset-release/main
Version Packages
2025-01-13 12:09:46 +01:00
github-actions[bot]
d54db4358c Version Packages 2025-01-13 11:06:47 +00:00
Guido D'Orsi
a172f61494 fix: types for the WebSocket peer 2025-01-13 12:05:22 +01:00
Guido D'Orsi
225280d37a fix: fix type error and tsconfig 2025-01-12 23:45:40 +01:00
Guido D'Orsi
c735ab6b95 Merge pull request #1195 from garden-co/changeset-release/main
Version Packages
2025-01-12 23:37:50 +01:00
github-actions[bot]
d47e59783f Version Packages 2025-01-12 22:32:21 +00:00
Guido D'Orsi
8a390d255d fix: fix account type registration using the sources for the TS definitions 2025-01-12 23:31:15 +01:00
Guido D'Orsi
03540b22c1 fix: fix prepublish script on jazz-react-native-auth-clerk 2025-01-12 22:58:26 +01:00
Guido D'Orsi
fad96fe4f4 Merge pull request #1194 from garden-co/changeset-release/main
Version Packages
2025-01-12 22:54:05 +01:00
github-actions[bot]
19b706d125 Version Packages 2025-01-12 21:53:34 +00:00
Guido D'Orsi
c871912188 feat(rn): add clearUserCredentials API to programmatically delete the current user stored credentials 2025-01-12 22:52:05 +01:00
Guido D'Orsi
7124bd05c8 Merge pull request #1192 from garden-co/changeset-release/main
Version Packages
2025-01-12 20:13:38 +01:00
github-actions[bot]
783f444cff Version Packages 2025-01-12 15:44:47 +00:00
Guido D'Orsi
0f57687d81 Update .changeset 2025-01-12 16:42:24 +01:00
Guido D'Orsi
235bf1f4e4 Merge pull request #1190 from tobiaslins/fix-react-core-type-error
[jazz-react-core] Fix type error from `useRef`
2025-01-12 16:41:31 +01:00
Trisha Lim
2d7b4b6c82 Update create-jazz-app readme 2025-01-12 14:36:03 +00:00
Trisha Lim
68369c16da Clone example apps in create-jazz-app 2025-01-12 14:30:53 +00:00
Tobias Lins
90f36db63a Fix type error 2025-01-12 15:23:03 +01:00
Trisha Lim
f002110c28 Allow partial options in create-jazz-app 2025-01-12 13:53:37 +00:00
Guido D'Orsi
83513b624e Merge pull request #1187 from garden-co/changeset-release/main
Version Packages
2025-01-12 12:41:54 +01:00
github-actions[bot]
6042250940 Version Packages 2025-01-12 09:54:11 +00:00
Guido D'Orsi
f78c234780 fix(rn): add unstable_enablePackageExports to the metro config 2025-01-12 10:53:03 +01:00
Guido D'Orsi
21efae9276 Merge pull request #1185 from garden-co/changeset-release/main
Version Packages
2025-01-11 16:35:54 +01:00
github-actions[bot]
1e58606ae7 Version Packages 2025-01-11 14:44:01 +00:00
Guido D'Orsi
4a11682316 Merge pull request #1186 from tobiaslins/fix-priority-rn-sqlite
[React Native] Change priority of sqlite to `100`
2025-01-11 15:42:46 +01:00
Tobias Lins
3e92680b08 Update README.md 2025-01-11 15:12:37 +01:00
Tobias Lins
2be47d688b Change priority of sqlite to 100 2025-01-11 15:11:37 +01:00
Guido D'Orsi
2ddccdbca5 Update dull-walls-crash.md 2025-01-11 14:00:02 +01:00
Guido D'Orsi
ab05897cd6 Merge pull request #1183 from tobiaslins/improve-expo-secure-storage
[react native] don't require faceid for every KV operation
2025-01-11 13:56:16 +01:00
Tobias Lins
7cd691f5f0 Create dull-walls-crash.md 2025-01-11 13:48:08 +01:00
Tobias Lins
24a13af657 Improve initialization when using custom kv storage 2025-01-11 13:41:12 +01:00
Tobias Lins
b13530e84b don't require faceid for every get/set 2025-01-11 11:09:56 +01:00
Guido D'Orsi
3911b72f87 docs: fix version number on the rn upgrade docs 2025-01-11 00:23:32 +01:00
Guido D'Orsi
ec278cfcd8 Merge pull request #1182 from garden-co/changeset-release/main
Version Packages
2025-01-11 00:22:19 +01:00
github-actions[bot]
912730378e Version Packages 2025-01-10 21:59:07 +00:00
Guido D'Orsi
ac35f19f01 Merge pull request #1130 from tobiaslins/rn-storage-sqlite
feat: sqlite react native storage
2025-01-10 22:58:03 +01:00
Guido D'Orsi
c25a1af96e feat: update test and add active account management to testing utils 2025-01-10 17:20:47 +01:00
Guido D'Orsi
70667d06a1 fix: cover FileStream and createImage 2025-01-10 17:02:07 +01:00
Guido D'Orsi
31fd994d83 Merge pull request #1180 from garden-co/jazz-636-add-test-for-react-starter-app
Fix and test react starter app
2025-01-10 16:53:42 +01:00
Guido D'Orsi
fc934157f6 fix: remove unused import 2025-01-10 16:52:07 +01:00
Guido D'Orsi
0bbded1772 docs: update examples with the new simplified API 2025-01-10 16:50:51 +01:00
Trisha Lim
a6eea34c74 Run starter test 2025-01-10 15:35:16 +00:00
Trisha Lim
3605b746a9 Highlight new lines on upgrade guide 2025-01-10 15:32:02 +00:00
Trisha Lim
4b29a9aaa6 Test react starter app 2025-01-10 15:30:15 +00:00
Trisha Lim
e60a9f4a74 Fix react starter app 2025-01-10 15:26:56 +00:00
Guido D'Orsi
d1d773bc9c feat: make possible to call the load/subscribe/create API without passing me 2025-01-10 16:19:41 +01:00
Guido D'Orsi
55e8a269c0 fix: fix homepage type error 2025-01-10 12:45:42 +01:00
Guido D'Orsi
0db0aadd45 fix: fix homepage type error 2025-01-10 12:38:12 +01:00
Guido D'Orsi
83f3873e03 feat: make the persistence disabled by default 2025-01-10 12:26:14 +01:00
Guido D'Orsi
80fd3e9697 chore: changeset 2025-01-10 12:16:04 +01:00
Guido D'Orsi
bae8268b29 feat: add upgrade docs and option to disable storage 2025-01-10 12:14:16 +01:00
Benjamin S. Leveritt
466c5f695a Revert mark position calculations 2025-01-09 15:30:37 +00:00
Benjamin S. Leveritt
b6a70228ea Tidy up
Remove
2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
ac32c432da Fix test 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
066ac6bf98 Add subscription test 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
ccfa7d9943 Add sync test 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
90c76a01a6 Fix up import/exports 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
807b52cccf Remove unused test 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
fb7c6c6bbf Fix removeMark implementation with tests 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
12e619b990 Add tag type filter 2025-01-09 14:55:44 +00:00
Benjamin S. Leveritt
aba2f8110c Fix removeMark 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
862e3fc7ed Fix insertMark 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
51fc92759a Add .length method 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
c8fac3381d Refactor mark validation fn 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
9723090f91 Stablises mark resolution 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
4783e08c69 Add annotations 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
34959ff0ec Fixes formatting in tests 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
bec9be84d5 Add subscription tests 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
277ee9d7e4 Add test for sync and loading 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
314518a87f Add tests for position ops 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
c280fa11c3 Add test for splitting nested children 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
929f5785a8 Fix docs
Passing tests

Remove duplicate `createPlainText` from inherited account
2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
9ae92c19ab Fix imports for coPlainText 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
599bb7355e Fix comment 2025-01-09 14:55:43 +00:00
Benjamin S. Leveritt
ad76a2f44f Fix libs for coPlainText 2025-01-09 14:55:43 +00:00
Anselm Eickhoff
3a3ad44f13 More progress 2025-01-09 14:55:42 +00:00
Anselm Eickhoff
db01bfb0a8 More implementation 2025-01-09 14:55:42 +00:00
Guido D'Orsi
3e9b7e829c Merge pull request #1175 from garden-co/jazz-639-fix-passkey-svelte
Fix imports for passkey-svelte
2025-01-09 15:51:05 +01:00
Benjamin S. Leveritt
530720f2b9 Fix imports 2025-01-09 14:47:23 +00:00
Benjamin S. Leveritt
a5d6d364db Merge pull request #877 from garden-co/benjamin-jazz-534
Bring CoPlainText up to current
2025-01-09 13:05:56 +00:00
Benjamin S. Leveritt
cb7e580942 Simplify Segmenter comment
Co-authored-by: Guido D'Orsi <guido@float.com>
2025-01-09 12:02:51 +00:00
Benjamin S. Leveritt
8653fc7eb1 Improve thrown error for envs missing Segmenter 2025-01-09 12:02:51 +00:00
Benjamin S. Leveritt
d077702250 Move segmenter into constructor
Chore: Fix formatting
2025-01-09 12:02:51 +00:00
Benjamin S. Leveritt
472b15d940 Move segmenter into class 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
f71176b362 Chore: Fix formatting 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
aa5f988776 Fix imports 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
328311e781 Moves Document into component 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
f2875de83d Add comments 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
2108f918b4 Chore: Format source 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
32441bdcd6 Fix export types 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
b80b9c08db Fix exports for rich-text example 2025-01-09 10:58:19 +00:00
Benjamin S. Leveritt
4f09c94098 Fix libs for coPlainText 2025-01-09 10:58:15 +00:00
pax
5e47f2fb52 Merge pull request #1168 from garden-co/changeset-release/main
Version Packages
2025-01-09 12:22:38 +02:00
github-actions[bot]
47f2f62b4f Version Packages 2025-01-09 10:19:41 +00:00
pax
61642b2536 Merge pull request #1170 from garden-co/feat/anonymous-auth
feat: add Onboarding auth to handle users onboarding without an auth screen
2025-01-09 12:18:12 +02:00
pax-k
20d12c5aa1 chore: formatting 2025-01-09 12:16:56 +02:00
pax-k
dd9ac6e4f8 fix: migrate DemoAuth old localStorage key to new one 2025-01-09 12:16:23 +02:00
Guido D'Orsi
1b7196938f feat: add Onboarding auth to handle users onboarding without an auth screen 2025-01-09 11:11:06 +01:00
pax-k
5d9818914c chore: changeset 2025-01-09 12:08:40 +02:00
pax-k
f33ec81f19 fix: DemoAuth localStorage key name 2025-01-09 12:01:08 +02:00
Guido D'Orsi
a9dbcc29d0 fix: migrate starter to jazz 0.9 2025-01-09 09:35:08 +01:00
Anselm Eickhoff
f30f92d1b6 Merge pull request #1167 from garden-co/fix/set-fixed-version-starter-app
Set fixed version for packages in starter apps (temporary fix)
2025-01-08 22:52:37 +00:00
Trisha Lim
33d250d0e1 Add changeset 2025-01-08 22:27:33 +00:00
Trisha Lim
f025ffa7b1 Set fixed version for packages in starter apps 2025-01-08 22:20:00 +00:00
Guido D'Orsi
6467bb89b3 docs: fix ensureLoaded migrate example 2025-01-08 21:58:00 +01:00
Trisha Lim
7fc9195068 Fix face id icon 2025-01-08 18:30:28 +00:00
Guido D'Orsi
2e7e276abf Merge pull request #1158 from garden-co/homepage-doc-improvements
Homepage doc improvements
2025-01-08 19:17:31 +01:00
Guido D'Orsi
cc249d3e8b docs: update the migration docs and comment the TODO 2025-01-08 19:17:21 +01:00
Guido D'Orsi
2db8b35cf7 feat: simplify storage setup and update docs 2025-01-08 18:12:22 +01:00
Anselm
f098002da5 Add todos 2025-01-08 17:03:19 +00:00
Anselm
0b47d279c0 Accounts and migrations docs sketch 2025-01-08 17:03:03 +00:00
Guido D'Orsi
a3234f3912 Merge remote-tracking branch 'origin/main' into pr-rn-storage-sqlite 2025-01-08 16:38:35 +01:00
Guido D'Orsi
2a6f2bbb4b Merge pull request #1144 from garden-co/changeset-release/main
Version Packages
2025-01-08 14:28:34 +01:00
github-actions[bot]
fcdad5d80d Version Packages 2025-01-08 12:05:19 +00:00
Guido D'Orsi
dfa15c1e0f Merge pull request #1128 from garden-co/next
Jazz 0.9.0 - Top level imports for hooks and simplified app setup
2025-01-08 13:04:05 +01:00
Guido D'Orsi
bead3462e7 Merge pull request #1151 from garden-co/react-0.9.0-migration-docs
feat(svelte): syncronously resolve local values in useCoState
2025-01-08 12:57:00 +01:00
Guido D'Orsi
246f91937c feat(svelte): syncronously resolve local values in useCoState 2025-01-08 12:49:41 +01:00
Guido D'Orsi
468de3d3af Merge pull request #1150 from garden-co/react-0.9.0-migration-docs
docs: migration docs for rn, vue and svelte
2025-01-08 12:49:15 +01:00
Guido D'Orsi
ee292b8855 docs: migration docs for rn, vue and svelte 2025-01-08 12:40:26 +01:00
Guido D'Orsi
38a6361aed Merge remote-tracking branch 'origin/main' into next 2025-01-08 12:28:01 +01:00
Guido D'Orsi
0231650b6b Merge pull request #1148 from garden-co/styling/code-snippet
Styling improvements for code snippets
2025-01-08 12:26:36 +01:00
Guido D'Orsi
35e4af88d0 Merge pull request #1139 from garden-co/top-level-imports-vue
feat(jazz-vue): simplify app setup and make composables available as top-level imports
2025-01-08 12:01:29 +01:00
Guido D'Orsi
a44a1496ca Merge pull request #1145 from garden-co/react-0.9.0-migration-docs
docs: migration docs for jazz-react 0.9.0
2025-01-08 11:26:15 +01:00
Tobias Lins
7ebc77c95f Update chat.tsx 2025-01-08 09:54:55 +01:00
Tobias Lins
de20b17989 Update App.tsx 2025-01-08 09:53:37 +01:00
Tobias Lins
cae4b244e8 Update polyfills.js 2025-01-08 09:52:53 +01:00
Tobias Lins
eed5aec08d Cleanup 2025-01-08 09:51:29 +01:00
Tobias Lins
90fa0e0588 Merge remote-tracking branch 'upstream/main' into rn-storage-sqlite 2025-01-08 09:26:44 +01:00
Guido D'Orsi
2269bd4d8f docs: improvements 2025-01-07 19:28:27 +01:00
Guido D'Orsi
b3bd55f969 chore: add comment 2025-01-07 18:51:06 +01:00
Guido D'Orsi
dd91354eb4 docs: migration docs for jazz-react 0.9.0 2025-01-07 18:51:05 +01:00
Guido D'Orsi
27c294166b Merge remote-tracking branch 'origin/main' into next 2025-01-07 18:50:47 +01:00
Guido D'Orsi
0cdf004902 Merge pull request #1129 from garden-co/jazz-621-add-upgrade-guides-section-to-document-breaking-changes
Add upgrade guides section to docs
2025-01-07 17:10:23 +01:00
Guido D'Orsi
9dd8d9510b feat: simplify app setup and make hooks available as top-level imports 2025-01-07 16:08:31 +01:00
Guido D'Orsi
6de44dd8d1 feat: move the common test API to jazz-tools 2025-01-07 14:36:12 +01:00
Guido D'Orsi
41e88b82b7 Merge pull request #1117 from garden-co/react-native-top-level-hooks
feat: top-level imports for react native hooks
2025-01-07 14:04:23 +01:00
pax-k
afe73c05fe chore: cleanup 2025-01-07 14:31:44 +02:00
Anselm Eickhoff
f4fc60707f More progress 2025-01-07 07:51:07 +00:00
Anselm Eickhoff
8527c3fef9 More plaintext progress 2025-01-07 07:50:26 +00:00
Anselm Eickhoff
c279174465 Rich text progress 2025-01-07 07:50:26 +00:00
Anselm
49fa18825b Progress on text 2025-01-07 07:50:26 +00:00
Anselm
32d7dca15b More implementation 2025-01-07 07:50:25 +00:00
Anselm
8ba2d47e48 Implement RawCoPlainText 2025-01-07 07:40:30 +00:00
Tobias Lins
c4d5cad2d4 Fixes 2025-01-05 10:53:59 +01:00
Tobias Lins
718543cf83 fix tx support 2025-01-04 16:52:05 +01:00
Tobias Lins
ca8f21358e Move to other library 2025-01-04 12:42:22 +01:00
Guido D'Orsi
d56fc0874c Merge pull request #1118 from garden-co/svelte-top-level-hooks
feat: top-level imports for svelte hooks
2025-01-04 12:23:20 +01:00
Tobias Lins
d09584fa88 WIP sqlite react native storage 2025-01-04 11:24:13 +01:00
Guido D'Orsi
ade4890ede chore: changeset 2025-01-03 18:45:36 +01:00
Guido D'Orsi
b734c66a90 fix(testing): mock crypto functions incompatible with jsDom 2025-01-03 18:44:00 +01:00
Trisha Lim
bc979ba26e Hide/show content based on framework 2025-01-03 17:20:14 +00:00
Guido D'Orsi
906acaf417 fix: handle kvStore init inside RNDemoAuth 2025-01-03 18:11:28 +01:00
Trisha Lim
432724f63e Render example guide 2025-01-03 17:09:42 +00:00
Guido D'Orsi
1e5e3a1599 feat: top-level imports for react native hooks 2025-01-03 17:45:45 +01:00
Guido D'Orsi
37699c1831 test: update svelte tests 2025-01-03 17:45:14 +01:00
Guido D'Orsi
6c6da24281 feat: top-level imports for svelte hooks 2025-01-03 17:45:13 +01:00
Guido D'Orsi
2d85476433 chore: update the version history example 2025-01-03 17:39:14 +01:00
Trisha Lim
cdc8a6b568 Add example guides 2025-01-03 15:22:01 +00:00
Trisha Lim
1b539483d1 Add page in docs for upgrade guides 2025-01-03 14:37:20 +00:00
Guido D'Orsi
25eab61cd0 Merge pull request #1104 from garden-co/jazz-361-make-jazz-react-hooks-global
feat: top-level imports for Jazz react hooks
2025-01-03 15:16:37 +01:00
Guido D'Orsi
43a782937f chore: update docs 2025-01-03 15:16:10 +01:00
Guido D'Orsi
de1a3ee84a Update homepage/homepage/app/docs/[framework]/[...slug]/project-setup/react.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-01-03 15:14:33 +01:00
Guido D'Orsi
b12eb407cb Merge remote-tracking branch 'origin/main' into jazz-361-make-jazz-react-hooks-global 2025-01-03 11:10:11 +01:00
Guido D'Orsi
90096d65e9 chore: remove unused import 2025-01-02 17:22:03 +01:00
Guido D'Orsi
0e7f1aa44a chore: move platform agnostic code in jazz-react-core 2025-01-02 16:52:24 +01:00
Guido D'Orsi
68932ee4ce feat(react): hard deprecate the previous way of creating React Jazz apps 2025-01-02 13:38:17 +01:00
Guido D'Orsi
cf22cfcc88 fix: fix typescript errors 2024-12-30 19:15:04 +01:00
Guido D'Orsi
c5b5eacba5 docs(guide): fix the snippets indentation 2024-12-30 18:34:53 +01:00
Guido D'Orsi
380bcb2d14 chore: simplfy comment about the AccountSchema registration 2024-12-30 18:21:32 +01:00
Guido D'Orsi
956a4d1b5e chore: migrate to use top-level hook imports 2024-12-30 18:16:06 +01:00
Guido D'Orsi
b7fb4b4b0b docs: update React docs to use the top-level imports 2024-12-30 18:15:09 +01:00
Guido D'Orsi
4433745cff feat: simplify App creation and make the hooks available as top-level imports 2024-12-30 18:14:57 +01:00
Guido D'Orsi
8eda79227b perf(subscribe): add an option to resolve locally available CoValues syncronously 2024-12-30 18:11:19 +01:00
Guido D'Orsi
1a3ec55e6e feat: makes possible to directly import the crypto module 2024-12-30 17:53:35 +01:00
663 changed files with 45899 additions and 10982 deletions

View File

@@ -11,7 +11,7 @@
"cojson-storage-sqlite",
"cojson-transport-ws",
"jazz-browser",
"jazz-browser-auth-clerk",
"jazz-auth-clerk",
"jazz-browser-media-images",
"jazz-nodejs",
"jazz-react",

View File

@@ -1,7 +0,0 @@
---
"jazz-react-native": patch
---
Fix username key hashing in DemoAuth
Improve error handling when loading an existing account fails
Fix the double context creation in Reacc development mode

View File

@@ -1,5 +0,0 @@
---
"cojson": patch
---
Add the assign method to RawCoMap to create bulk transactions and optimize RawCoMap init

36
.github/actions/source-code/action.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: Get and Build Source Code
runs:
using: "composite"
steps:
- name: Enable latestcorepack
shell: bash
run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- name: Install Node.js
uses: useblacksmith/setup-node@v5
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: useblacksmith/cache@v5
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile

View File

@@ -6,7 +6,7 @@ on:
jobs:
build-examples:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
matrix:
example: [
@@ -23,36 +23,13 @@ jobs:
]
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Enable corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Pnpm Build
run: |

View File

@@ -2,51 +2,25 @@ name: Build Starters
on:
push:
branches: [ "main" ]
branches: ["main"]
jobs:
build-starters:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
matrix:
starter: [
"react-demo-auth-tailwind",
]
starter: ["react-demo-auth-tailwind"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/checkout@v4
with:
submodules: true
- name: Enable corepack
run: corepack enable
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Pnpm Build
run: |
pnpm install
pnpm turbo build;
working-directory: ./starters/${{ matrix.starter }}
- name: Pnpm Build
run: |
pnpm install
pnpm turbo build;
working-directory: ./starters/${{ matrix.starter }}

View File

@@ -6,7 +6,7 @@ on:
jobs:
quality:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4

91
.github/workflows/e2e-rn-test.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: End-to-End Tests for React Native
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/e2e-rn-test.yml"
- "examples/chat-rn/**"
- "examples/chat-rn-clerk/**"
- "packages/jazz-react-native*/**"
jobs:
e2e-tests:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Create Output Directory
run: |
mkdir -p ~/output
- name: Pnpm Build
run: pnpm turbo build --filter="./packages/*"
- name: iOS Simulator
id: ios-simulator
uses: futureware-tech/simulator-action@v4
with:
os: iOS
wait_for_boot: true
- name: chat-rn App Pre Build
working-directory: ./examples/chat-rn
run: |
pnpm build
pnpm expo prebuild --clean
- name: chat-rn App Build
working-directory: ./examples/chat-rn/ios
run: |
xcodebuild -scheme "jazzchatrn" \
-workspace jazzchatrn.xcworkspace \
-archivePath $RUNNER_TEMP/jazzchatrn.xcarchive \
-derivedDataPath $RUNNER_TEMP/build \
-destination "id=${{ steps.ios-simulator.outputs.udid }}" \
-configuration Release \
-sdk iphonesimulator \
build
xcrun simctl install booted $RUNNER_TEMP/build/Build/Products/Release-iphonesimulator/jazzchatrn.app
xcrun simctl spawn booted log stream --level debug | tee ~/output/sim.log &
- name: Install Maestro
run: |
curl -fsSL "https://get.maestro.mobile.dev" | bash
- name: chat-rn App Test
id: e2e_test
working-directory: ./examples/chat-rn
continue-on-error: true
run: |
export PATH="$PATH":"$HOME/.maestro/bin"
export MAESTRO_DRIVER_STARTUP_TIMEOUT=300000 # setting to 5 mins 👀
export MAESTRO_CLI_NO_ANALYTICS=1
maestro test test/e2e/flow.yml
- name: Copy Maestro and Diagnostic Files
if: steps.e2e_test.outcome != 'success'
run: |
cp -r ~/Library/Logs/DiagnosticReports/* ~/output
cp -r ~/.maestro/tests/* ~/output
- name: Upload Output Files
if: steps.e2e_test.outcome != 'success'
uses: actions/upload-artifact@v4
with:
name: e2e-test-output
path: ~/output/*
retention-days: 5
- name: Exit with Test Result
if: always()
run: |
if [ "${{ steps.e2e_test.outcome }}" != "success" ]; then
exit 1
fi

View File

@@ -8,38 +8,16 @@ on:
jobs:
test:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Enable corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Build jazz-run
run: pnpm exec turbo build && chmod +x dist/index.js;
@@ -48,4 +26,3 @@ jobs:
- name: Run create account
run: ./dist/index.js account create --name "Jazz Run CI test"
working-directory: ./packages/jazz-run

View File

@@ -9,41 +9,19 @@ on:
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
continue-on-error: true
strategy:
matrix:
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "examples/onboarding"]
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "examples/onboarding", "starters/react-demo-auth-tailwind"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Enable corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Pnpm Build
run: pnpm turbo build

22
.github/workflows/pre-release.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Pre-Publish tagged Pull Requests
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
pre-release:
if: contains(github.event.pull_request.labels.*.name, 'pre-release')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Pnpm Build
run: pnpm turbo build --filter="./packages/*"
- name: Pre publish
run: pnpm exec pkg-pr-new publish "./packages/*"

View File

@@ -17,35 +17,13 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Create Release Pull Request or Publish to npm
id: changesets

View File

@@ -9,39 +9,20 @@ on:
jobs:
unit-tests:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Pnpm Build
run: pnpm turbo build --filter="./packages/*"
- name: Install Playwright Browsers
run: pnpm exec playwright install
- name: Unit Tests
run: pnpm test:ci

2
.gitignore vendored
View File

@@ -19,3 +19,5 @@ test-results
.husky
.vscode/settings.json
.svelte-kit

View File

@@ -1,4 +1,4 @@
Copyright 2024, Garden Computing, Inc.
Copyright 2025, Garden Computing, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.

View File

@@ -17,4 +17,4 @@ For community and support, please join our [Discord](https://discord.gg/utDMjHYg
- Community & support: [Discord](https://discord.gg/utDMjHYg42)
- Updates: [X](https://x.com/jazz_tools) & [Email](https://garden.co/news)
Copyright 2024 &mdash; Garden Computing, Inc.
Copyright 2025 &mdash; Garden Computing, Inc.

View File

@@ -42,6 +42,15 @@
}
},
"overrides": [
{
"include": ["**/package.json"],
"linter": {
"enabled": false
},
"formatter": {
"enabled": false
}
},
{
"include": ["packages/**/src/**"],
"linter": {

View File

@@ -1,5 +1,233 @@
# chat-rn-clerk
## 1.0.65
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react-native-auth-clerk@0.10.0
- jazz-react-native@0.10.0
- jazz-tools@0.10.0
- jazz-react-native-media-images@0.10.0
## 1.0.64
### Patch Changes
- jazz-react-native@0.9.23
- jazz-react-native-auth-clerk@0.9.23
- jazz-tools@0.9.23
- jazz-react-native-media-images@0.9.23
## 1.0.63
### Patch Changes
- jazz-react-native@0.9.22
- jazz-react-native-auth-clerk@0.9.22
## 1.0.62
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-react-native@0.9.21
- jazz-react-native-auth-clerk@0.9.21
- jazz-react-native-media-images@0.9.21
## 1.0.61
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-react-native@0.9.20
- jazz-react-native-auth-clerk@0.9.20
- jazz-react-native-media-images@0.9.20
## 1.0.60
### Patch Changes
- jazz-react-native@0.9.19
- jazz-react-native-auth-clerk@0.9.19
- jazz-tools@0.9.19
- jazz-react-native-media-images@0.9.19
## 1.0.59
### Patch Changes
- jazz-react-native@0.9.18
- jazz-react-native-auth-clerk@0.9.18
- jazz-tools@0.9.18
- jazz-react-native-media-images@0.9.18
## 1.0.58
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-react-native@0.9.17
- jazz-react-native-auth-clerk@0.9.17
- jazz-react-native-media-images@0.9.17
## 1.0.57
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-react-native-auth-clerk@0.9.16
- jazz-tools@0.9.16
- jazz-react-native@0.9.16
- jazz-react-native-media-images@0.9.16
## 1.0.56
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-react-native@0.9.15
- jazz-react-native-auth-clerk@0.9.15
- jazz-react-native-media-images@0.9.15
## 1.0.55
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-react-native@0.9.14
- jazz-react-native-auth-clerk@0.9.14
- jazz-react-native-media-images@0.9.14
## 1.0.54
### Patch Changes
- jazz-react-native@0.9.13
- jazz-react-native-auth-clerk@0.9.13
- jazz-tools@0.9.13
- jazz-react-native-media-images@0.9.13
## 1.0.53
### Patch Changes
- jazz-react-native@0.9.12
- jazz-react-native-auth-clerk@0.9.12
- jazz-tools@0.9.12
- jazz-react-native-media-images@0.9.12
## 1.0.52
### Patch Changes
- jazz-react-native@0.9.11
- jazz-react-native-auth-clerk@0.9.11
- jazz-tools@0.9.11
- jazz-react-native-media-images@0.9.11
## 1.0.51
### Patch Changes
- f76274c: Fix image handling in react-native
- Updated dependencies [f76274c]
- Updated dependencies [5e83864]
- jazz-react-native@0.9.10
- jazz-tools@0.9.10
- jazz-react-native-auth-clerk@0.9.10
- jazz-react-native-media-images@0.9.10
## 1.0.50
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-react-native@0.9.9
- jazz-react-native-auth-clerk@0.9.9
- jazz-react-native-media-images@0.9.9
## 1.0.49
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react-native@0.9.8
- jazz-react-native-auth-clerk@0.9.8
- jazz-react-native-media-images@0.9.8
## 1.0.48
### Patch Changes
- Updated dependencies [8a390d2]
- jazz-react-native@0.9.6
- jazz-react-native-auth-clerk@0.9.6
## 1.0.47
### Patch Changes
- Updated dependencies [c871912]
- jazz-react-native@0.9.5
- jazz-react-native-auth-clerk@0.9.5
## 1.0.46
### Patch Changes
- jazz-react-native@0.9.4
- jazz-react-native-auth-clerk@0.9.4
## 1.0.45
### Patch Changes
- Updated dependencies [7cd691f]
- jazz-react-native@0.9.3
- jazz-react-native-auth-clerk@0.9.3
## 1.0.44
### Patch Changes
- Updated dependencies [80fd3e9]
- jazz-react-native@0.9.2
- jazz-react-native-auth-clerk@0.9.2
## 1.0.43
### Patch Changes
- Updated dependencies [1b71969]
- jazz-tools@0.9.1
- jazz-react-native@0.9.1
- jazz-react-native-auth-clerk@0.9.1
- jazz-react-native-media-images@0.9.1
## 1.0.42
### Patch Changes
- Updated dependencies [1da4d55]
- Updated dependencies [8eda792]
- Updated dependencies [1e5e3a1]
- jazz-react-native@0.9.0
- jazz-tools@0.9.0
- jazz-react-native-auth-clerk@0.9.0
- jazz-react-native-media-images@0.9.0
## 1.0.41
### Patch Changes

View File

@@ -37,7 +37,13 @@
],
"expo-secure-store",
"expo-font",
"expo-router"
"expo-router",
[
"expo-image-picker",
{
"photosPermission": "The app accesses your photos to let you share them with your friends."
}
]
],
"extra": {
"eas": {

View File

@@ -1,9 +1,9 @@
import { Redirect, Stack } from "expo-router";
import { useIsAuthenticated } from "jazz-react-native";
import React from "react";
import { useAuth } from "../../src/auth-context";
export default function HomeLayout() {
const { isAuthenticated } = useAuth();
const isAuthenticated = useIsAuthenticated();
if (isAuthenticated) {
return <Redirect href={"/chat"} />;

View File

@@ -1,8 +1,8 @@
import { Redirect, Stack } from "expo-router";
import { useAuth } from "../../src/auth-context";
import { useIsAuthenticated } from "jazz-react-native";
export default function UnAuthenticatedLayout() {
const { isAuthenticated } = useAuth();
const isAuthenticated = useIsAuthenticated();
if (isAuthenticated) {
return <Redirect href={"/chat"} />;

View File

@@ -1,9 +1,12 @@
import { useAccount, useCoState } from "@/src/jazz";
import { Chat, Message } from "@/src/schema";
import { useFocusEffect, useNavigation } from "@react-navigation/native";
import { useNavigation } from "@react-navigation/native";
import clsx from "clsx";
import * as Clipboard from "expo-clipboard";
import * as ImagePicker from "expo-image-picker";
import { useLocalSearchParams } from "expo-router";
import { useAccount, useCoState } from "jazz-react-native";
import { ProgressiveImg } from "jazz-react-native";
import { createImage } from "jazz-react-native-media-images";
import { Group, ID } from "jazz-tools";
import { useEffect, useLayoutEffect, useState } from "react";
import React, {
@@ -16,6 +19,8 @@ import React, {
KeyboardAvoidingView,
TextInput,
Button,
Image,
ActivityIndicator,
} from "react-native";
export default function Conversation() {
@@ -25,6 +30,7 @@ export default function Conversation() {
const [message, setMessage] = useState("");
const loadedChat = useCoState(Chat, chat?.id, [{}]);
const navigation = useNavigation();
const [isUploading, setIsUploading] = useState(false);
useEffect(() => {
if (chat) return;
@@ -81,6 +87,32 @@ export default function Conversation() {
}
};
const handleImageUpload = async () => {
try {
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Images,
base64: true,
quality: 0.7,
});
if (!result.canceled && result.assets[0].base64 && chat) {
setIsUploading(true);
const base64Uri = `data:image/jpeg;base64,${result.assets[0].base64}`;
const image = await createImage(base64Uri, {
owner: chat._owner,
maxSize: 2048,
});
chat.push(Message.create({ text: "", image }, { owner: chat._owner }));
}
} catch (error) {
Alert.alert("Error", "Failed to upload image");
} finally {
setIsUploading(false);
}
};
const renderMessageItem = ({ item }: { item: Message }) => {
const isMe = item._edits.text.by?.isMe;
return (
@@ -106,14 +138,27 @@ export default function Conversation() {
isMe ? "flex-row" : "flex-row",
)}
>
<Text
className={clsx(
!isMe ? "text-black" : "text-gray-200",
`text-md max-w-[85%]`,
)}
>
{item.text}
</Text>
{item.image && (
<ProgressiveImg image={item.image} maxWidth={1024}>
{({ src, res, originalSize }) => (
<Image
source={{ uri: src }}
className="w-48 h-48 rounded-lg mb-2"
resizeMode="cover"
/>
)}
</ProgressiveImg>
)}
{item.text && (
<Text
className={clsx(
!isMe ? "text-black" : "text-gray-200",
`text-md max-w-[85%]`,
)}
>
{item.text}
</Text>
)}
<Text
className={clsx(
"text-[10px] text-right ml-2",
@@ -147,6 +192,17 @@ export default function Conversation() {
className="p-3 bg-white border-t border-gray-300"
>
<SafeAreaView className="flex-row items-center gap-2">
<TouchableOpacity
onPress={handleImageUpload}
disabled={isUploading}
className="h-10 w-10 items-center justify-center"
>
{isUploading ? (
<ActivityIndicator size="small" color="#0000ff" />
) : (
<Text className="text-2xl">🖼</Text>
)}
</TouchableOpacity>
<TextInput
className="flex-1 rounded-full h-10 px-4 bg-gray-100 border border-gray-300 focus:border-blue-500 focus:bg-white"
value={message}

View File

@@ -11,7 +11,7 @@ import React, {
} from "react-native";
import { useUser } from "@clerk/clerk-expo";
import { useAccount } from "../../src/jazz";
import { useAccount } from "jazz-react-native";
import { Chat } from "../../src/schema";
export default function ChatScreen() {
@@ -20,10 +20,15 @@ export default function ChatScreen() {
const navigation = useNavigation();
const { user } = useUser();
function handleLogOut() {
logOut();
router.navigate("/");
}
useLayoutEffect(() => {
navigation.setOptions({
headerTitle: "Chat",
headerRight: () => <Button onPress={logOut} title="Logout" />,
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
});
}, [navigation]);

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-clerk",
"main": "index.js",
"version": "1.0.41",
"version": "1.0.65",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",
@@ -20,6 +20,7 @@
"@bam.tech/react-native-image-resizer": "^3.0.11",
"@clerk/clerk-expo": "^2.2.21",
"@expo/vector-icons": "^14.0.2",
"@op-engineering/op-sqlite": "^11.2.12",
"@react-native-community/netinfo": "^11.4.1",
"@react-navigation/native": "^7.0.13",
"@react-navigation/native-stack": "^7.1.14",
@@ -34,6 +35,7 @@
"expo-dev-client": "~5.0.5",
"expo-file-system": "^18.0.4",
"expo-font": "~13.0.1",
"expo-image-picker": "~16.0.4",
"expo-linking": "~7.0.3",
"expo-router": "~4.0.11",
"expo-secure-store": "~14.0.0",
@@ -70,7 +72,7 @@
"jest": "^29.2.1",
"jest-expo": "~52.0.2",
"react-test-renderer": "18.2.0",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2"
},
"private": true

View File

@@ -0,0 +1 @@
export const apiKey = "chat-rn-clerk-example-jazz@garden.co";

View File

@@ -1,62 +1,21 @@
import { useClerk, useUser } from "@clerk/clerk-expo";
import { useJazzClerkAuth } from "jazz-react-native-auth-clerk";
import React, {
createContext,
PropsWithChildren,
useContext,
useEffect,
useState,
} from "react";
import { Text, View } from "react-native";
import { Jazz, kvStore } from "./jazz";
const AuthContext = createContext<{
isAuthenticated: boolean;
isLoading: boolean;
}>({
isAuthenticated: false,
isLoading: true,
});
export function useAuth() {
return useContext(AuthContext);
}
import { useClerk } from "@clerk/clerk-expo";
import { JazzProviderWithClerk } from "jazz-react-native-auth-clerk";
import React, { PropsWithChildren } from "react";
import { apiKey } from "./apiKey";
export function JazzAndAuth({ children }: PropsWithChildren) {
const { isSignedIn, isLoaded: isClerkLoaded } = useUser();
const clerk = useClerk();
const [auth, state] = useJazzClerkAuth(clerk, kvStore);
const [isAuthenticated, setIsAuthenticated] = useState(false);
useEffect(() => {
if (isSignedIn && isClerkLoaded && auth) {
setIsAuthenticated(true);
} else {
setIsAuthenticated(false);
}
}, [isSignedIn, isClerkLoaded, auth]);
return (
<AuthContext.Provider
value={{ isAuthenticated, isLoading: !isClerkLoaded || !auth }}
<JazzProviderWithClerk
clerk={clerk}
storage="sqlite"
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
when: "signedUp", // This makes the app work in local mode when the user is not authenticated
}}
>
{state?.errors?.length > 0 &&
state.errors.map((error) => (
<View key={error}>
<Text style={{ color: "red" }}>{error}</Text>
</View>
))}
{auth && clerk.user ? (
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=chat-rn-clerk-example-jazz@garden.co"
storage={undefined}
>
{children}
</Jazz.Provider>
) : (
children
)}
</AuthContext.Provider>
{children}
</JazzProviderWithClerk>
);
}

View File

@@ -1,4 +0,0 @@
import { createJazzRNApp } from "jazz-react-native";
export const Jazz = createJazzRNApp();
export const { useAccount, useCoState, useAcceptInvite, kvStore } = Jazz;

View File

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

View File

@@ -1,5 +1,190 @@
# chat-rn
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.38",
"version": "1.0.62",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",
@@ -13,6 +13,7 @@
},
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@op-engineering/op-sqlite": "^11.2.12",
"@react-native-community/netinfo": "^11.4.1",
"@react-navigation/native": "^7.0.13",
"@react-navigation/native-stack": "^7.1.14",
@@ -45,7 +46,7 @@
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "^18.3.12",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2"
},
"private": true

View File

@@ -9,9 +9,9 @@ import * as Linking from "expo-linking";
import React, { StrictMode, useEffect, useState } from "react";
import HandleInviteScreen from "./invite";
import { DemoAuthBasicUI, useDemoAuth } from "jazz-react-native";
import { JazzProvider } from "jazz-react-native";
import { apiKey } from "./apiKey";
import ChatScreen from "./chat";
import { Jazz } from "./jazz";
const Stack = createNativeStackNavigator();
@@ -29,12 +29,10 @@ const linking = {
};
function App() {
const [auth, state] = useDemoAuth();
const [initialRoute, setInitialRoute] = useState<
"ChatScreen" | "HandleInviteScreen"
>("ChatScreen");
const navigationRef = useNavigationContainerRef();
useEffect(() => {
Linking.getInitialURL().then((url) => {
if (url) {
@@ -45,16 +43,13 @@ function App() {
});
}, []);
if (!auth) {
return null;
}
return (
<StrictMode>
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=chat-rn-example-jazz@garden.co"
storage={undefined}
<JazzProvider
storage="sqlite"
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
>
<NavigationContainer linking={linking} ref={navigationRef}>
<Stack.Navigator initialRouteName={initialRoute}>
@@ -70,10 +65,7 @@ function App() {
/>
</Stack.Navigator>
</NavigationContainer>
</Jazz.Provider>
{state.state !== "signedIn" ? (
<DemoAuthBasicUI appName="Jazz Chat" state={state} />
) : null}
</JazzProvider>
</StrictMode>
);
}

View File

@@ -0,0 +1 @@
export const apiKey = "chat-rn-example-jazz@garden.co";

View File

@@ -1,6 +1,6 @@
import clsx from "clsx";
import * as Clipboard from "expo-clipboard";
import { Group, ID } from "jazz-tools";
import { Group, ID, Profile } from "jazz-tools";
import { useEffect, useState } from "react";
import React, {
Button,
@@ -14,7 +14,7 @@ import React, {
Alert,
} from "react-native";
import { useAccount, useCoState } from "./jazz";
import { useAccount, useCoState } from "jazz-react-native";
import { Chat, Message } from "./schema";
export default function ChatScreen({ navigation }: { navigation: any }) {
@@ -22,10 +22,16 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
const [chatId, setChatId] = useState<ID<Chat>>();
const loadedChat = useCoState(Chat, chatId, [{}]);
const [message, setMessage] = useState("");
const profile = useCoState(Profile, me._refs.profile?.id, {});
function handleLogOut() {
setChatId(undefined);
logOut();
}
useEffect(() => {
navigation.setOptions({
headerRight: () => <Button onPress={logOut} title="Logout" />,
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
headerLeft: () =>
loadedChat ? (
<Button
@@ -131,6 +137,19 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
<View className="flex flex-col h-full">
{!loadedChat ? (
<View className="flex flex-col h-full items-center justify-center">
<Text className="text-m font-bold mb-6">Username</Text>
<TextInput
className="rounded h-12 p-2 mb-12 w-40 border border-gray-200 block"
value={profile?.name ?? ""}
onChangeText={(value) => {
if (profile) {
profile.name = value;
}
}}
textAlignVertical="center"
onSubmitEditing={sendMessage}
testID="username-input"
/>
<TouchableOpacity
onPress={createChat}
className="bg-blue-500 p-4 rounded-md"
@@ -172,10 +191,12 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
placeholder="Type a message..."
textAlignVertical="center"
onSubmitEditing={sendMessage}
testID="message-input"
/>
<TouchableOpacity
onPress={sendMessage}
className="bg-gray-300 text-white rounded-full h-8 w-8 items-center justify-center"
testID="send-button"
>
<Text></Text>
</TouchableOpacity>

View File

@@ -1,13 +1,7 @@
import { useAcceptInvite } from "jazz-react-native";
import React, { Text } from "react-native";
import { useAcceptInvite } from "./jazz";
import { Chat } from "./schema";
type ChatScreenParams = {
valueHint?: string;
valueID?: string;
inviteSecret?: string;
};
export default function HandleInviteScreen({
navigation,
}: {

View File

@@ -1,4 +0,0 @@
import { createJazzRNApp } from "jazz-react-native";
export const Jazz = createJazzRNApp();
export const { useAccount, useCoState, useAcceptInvite } = Jazz;

View File

@@ -0,0 +1,16 @@
# this sub-flow exists to work around an ios issue where the text field is not
# 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
---
- copyTextFrom:
id: ${id}
- repeat:
times: 4
commands:
- tapOn:
id: ${id}
- eraseText
- copyTextFrom:
id: ${id}

View File

@@ -0,0 +1,47 @@
appId: com.jazz.chatrn
---
- launchApp
# # handle Expo screens (for local dev)
# - assertVisible: "Continue"
# - tapOn: "Continue"
# - assertVisible: "Reload"
# - tapOn: "Reload"
# login
- assertVisible: "Anonymous user"
- runFlow:
label: "Erase existing username"
file: erase_text.yml
env:
id: "username-input"
- inputText: "boorad"
- assertVisible: "boorad"
# start new chat
- tapOn: "Start new chat"
- assertVisible: "Share"
- assertVisible: "Jazz Chat"
- assertVisible: "Logout"
# send a message
- runFlow:
label: "Erase existing message"
file: erase_text.yml
env:
id: "message-input"
- inputText: "bro, low key, it do be like that tho"
- tapOn:
id: "send-button"
- assertVisible: "bro, low key, it do be like that tho"
# get invite code
- tapOn: "Share"
- assertVisible: "Copied to clipboard"
- tapOn: "OK"
# this assert doesn't work. maestro.copiedText only populates from `copyTextFrom`
# - assertTrue: ${maestro.copiedText.startsWith("co_z")}
# logout
- tapOn: "Logout"
- assertVisible: "Anonymous user"

View File

@@ -1,5 +1,174 @@
# chat-vue
## 0.0.49
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-browser@0.10.0
- jazz-tools@0.10.0
- jazz-vue@0.10.0
## 0.0.48
### Patch Changes
- jazz-browser@0.9.23
- jazz-tools@0.9.23
- jazz-vue@0.9.23
## 0.0.47
### Patch Changes
- jazz-browser@0.9.22
- jazz-vue@0.9.22
## 0.0.46
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-browser@0.9.21
- jazz-vue@0.9.21
## 0.0.45
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-browser@0.9.20
- jazz-vue@0.9.20
## 0.0.44
### Patch Changes
- jazz-browser@0.9.19
- jazz-tools@0.9.19
- jazz-vue@0.9.19
## 0.0.43
### Patch Changes
- jazz-browser@0.9.18
- jazz-tools@0.9.18
- jazz-vue@0.9.18
## 0.0.42
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-browser@0.9.17
- jazz-vue@0.9.17
## 0.0.41
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-browser@0.9.16
- jazz-vue@0.9.16
## 0.0.40
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-browser@0.9.15
- jazz-vue@0.9.15
## 0.0.39
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-browser@0.9.14
- jazz-vue@0.9.14
## 0.0.38
### Patch Changes
- jazz-browser@0.9.13
- jazz-tools@0.9.13
- jazz-vue@0.9.13
## 0.0.37
### Patch Changes
- jazz-browser@0.9.12
- jazz-tools@0.9.12
- jazz-vue@0.9.12
## 0.0.36
### Patch Changes
- jazz-browser@0.9.11
- jazz-tools@0.9.11
- jazz-vue@0.9.11
## 0.0.35
### Patch Changes
- Updated dependencies [5e83864]
- jazz-tools@0.9.10
- jazz-browser@0.9.10
- jazz-vue@0.9.10
## 0.0.34
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-browser@0.9.9
- jazz-vue@0.9.9
## 0.0.33
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-browser@0.9.8
- jazz-vue@0.9.8
## 0.0.32
### Patch Changes
- Updated dependencies [1b71969]
- Updated dependencies [5d98189]
- jazz-browser@0.9.1
- jazz-tools@0.9.1
- jazz-vue@0.9.1
## 0.0.31
### Patch Changes
- Updated dependencies [9dd8d95]
- Updated dependencies [8eda792]
- jazz-vue@0.9.0
- jazz-tools@0.9.0
- jazz-browser@0.9.0
## 0.0.30
### Patch Changes

View File

@@ -1,29 +1,55 @@
# Chat example with Jazz and Vue
## Installing & running the example locally
## Getting started
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx degit gardencmp/jazz jazz
npx create-jazz-app@latest --example chat-vue --project-name chat-vue
```
Go to the todo-vue example directory:
Go to the new project directory.
```bash
cd jazz/examples/chat-vue
cd chat-vue
```
Install and build dependencies:
Run the dev server.
```bash
npm run 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
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/chat-vue/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.

View File

@@ -1,6 +1,6 @@
{
"name": "chat-vue",
"version": "0.0.30",
"version": "0.0.49",
"private": true,
"type": "module",
"scripts": {
@@ -30,9 +30,9 @@
"eslint-plugin-vue": "^9.28.0",
"npm-run-all2": "^6.2.3",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",
"vite": "^5.4.10",
"vite": "^6.0.11",
"vite-plugin-vue-devtools": "^7.4.6",
"vue-tsc": "^2.1.6"
}

View File

@@ -9,9 +9,9 @@
</template>
<script setup lang="ts">
import { useAccount } from "jazz-vue";
import AppContainer from "./components/AppContainer.vue";
import TopBar from "./components/TopBar.vue";
import { useAccount } from "./main";
const { me, logOut } = useAccount();
</script>

View File

@@ -0,0 +1 @@
export const apiKey = "chat-example-jazz@garden.co";

View File

@@ -1,36 +1,31 @@
import { DemoAuthBasicUI, createJazzVueApp, useDemoAuth } from "jazz-vue";
import { DemoAuthBasicUI, JazzProvider } from "jazz-vue";
import { createApp, defineComponent, h } from "vue";
import App from "./App.vue";
import "./index.css";
import { apiKey } from "@/apiKey";
import router from "./router";
const Jazz = createJazzVueApp();
export const { useAccount, useCoState } = Jazz;
const { JazzProvider } = Jazz;
const RootComponent = defineComponent({
name: "RootComponent",
setup() {
const { authMethod, state } = useDemoAuth();
return () => [
return () =>
h(
JazzProvider,
{
auth: authMethod.value,
peer: "wss://cloud.jazz.tools/?key=chat-example-jazz@garden.co",
sync: {
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
},
},
{
default: () => h(App),
},
),
state.state !== "signedIn" &&
h(DemoAuthBasicUI, {
appName: "Jazz Chat",
state,
}),
];
h(
DemoAuthBasicUI,
{
appName: "Jazz Vue Chat",
},
{
default: () => h(App),
},
),
);
},
});

View File

@@ -26,12 +26,12 @@
<script lang="ts">
import type { ID } from "jazz-tools";
import { useCoState } from "jazz-vue";
import { type PropType, computed, defineComponent, ref } from "vue";
import ChatBody from "../components/ChatBody.vue";
import ChatBubble from "../components/ChatBubble.vue";
import ChatInput from "../components/ChatInput.vue";
import EmptyChatMessage from "../components/EmptyChatMessage.vue";
import { useCoState } from "../main";
import { Chat, Message } from "../schema";
export default defineComponent({

View File

@@ -4,8 +4,8 @@
<script setup lang="ts">
import { Group } from "jazz-tools";
import { useAccount } from "jazz-vue";
import { useRouter } from "vue-router";
import { useAccount } from "../main";
import { Chat } from "../schema";
const router = useRouter();

View File

@@ -1,5 +1,180 @@
# jazz-example-chat
## 0.0.145
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react@0.10.0
- jazz-tools@0.10.0
- jazz-browser-media-images@0.10.0
## 0.0.144
### Patch Changes
- jazz-react@0.9.23
- jazz-tools@0.9.23
- jazz-browser-media-images@0.9.23
## 0.0.143
### Patch Changes
- jazz-browser-media-images@0.9.22
- jazz-react@0.9.22
## 0.0.142
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-browser-media-images@0.9.21
- jazz-react@0.9.21
## 0.0.141
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-browser-media-images@0.9.20
- jazz-react@0.9.20
## 0.0.140
### Patch Changes
- jazz-react@0.9.19
- jazz-tools@0.9.19
- jazz-browser-media-images@0.9.19
## 0.0.139
### Patch Changes
- jazz-react@0.9.18
- jazz-tools@0.9.18
- jazz-browser-media-images@0.9.18
## 0.0.138
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-browser-media-images@0.9.17
- jazz-react@0.9.17
## 0.0.137
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-browser-media-images@0.9.16
- jazz-react@0.9.16
## 0.0.136
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-browser-media-images@0.9.15
- jazz-react@0.9.15
## 0.0.135
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-browser-media-images@0.9.14
- jazz-react@0.9.14
## 0.0.134
### Patch Changes
- jazz-react@0.9.13
- jazz-tools@0.9.13
- jazz-browser-media-images@0.9.13
## 0.0.133
### Patch Changes
- jazz-react@0.9.12
- jazz-tools@0.9.12
- jazz-browser-media-images@0.9.12
## 0.0.132
### Patch Changes
- jazz-react@0.9.11
- jazz-tools@0.9.11
- jazz-browser-media-images@0.9.11
## 0.0.131
### Patch Changes
- f76274c: Fix image handling in react-native
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
- jazz-browser-media-images@0.9.10
## 0.0.130
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-browser-media-images@0.9.9
- jazz-react@0.9.9
## 0.0.129
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
- jazz-browser-media-images@0.9.8
## 0.0.128
### Patch Changes
- jazz-react@0.9.4
## 0.0.127
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
- jazz-browser-media-images@0.9.1
## 0.0.126
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
- jazz-browser-media-images@0.9.0
## 0.0.125
### Patch Changes

View File

@@ -2,30 +2,56 @@
Live version: [https://chat.jazz.tools](https://chat.jazz.tools)
## Installing & running the example locally
## Getting started
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx degit gardencmp/jazz jazz
npx create-jazz-app@latest --example chat --project-name chat
```
Go to the chat example directory:
Go to the new project directory.
```bash
cd jazz/examples/chat
cd chat
```
Install and build dependencies:
Run the dev server.
```bash
npm run 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
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/chat/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
@@ -34,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 `<Jazz.Provider>` provider component in [./src/main.tsx](./src/main.tsx).
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).

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.125",
"version": "0.0.145",
"type": "module",
"scripts": {
"dev": "vite",
@@ -23,15 +23,15 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.50.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",
"vite": "^5.4.10"
"vite": "^6.0.11"
}
}

View File

@@ -0,0 +1 @@
export const apiKey = "chat-example-jazz@garden.co";

View File

@@ -1,9 +1,13 @@
import { inIframe, onChatLoad } from "@/util.ts";
import { apiKey } from "@/apiKey.ts";
import { getRandomUsername, inIframe, onChatLoad } from "@/util.ts";
import { useIframeHashRouter } from "hash-slash";
import { JazzProvider, useAccount } from "jazz-react";
import { Group, ID } from "jazz-tools";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { ChatScreen } from "./chatScreen.tsx";
import { useAccount } from "./main.tsx";
import { Chat } from "./schema.ts";
import { ThemeProvider } from "./themeProvider.tsx";
import { AppContainer, TopBar } from "./ui.tsx";
export function App() {
@@ -12,9 +16,9 @@ export function App() {
const createChat = () => {
if (!me) return;
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);
router.navigate("/#/chat/" + chat.id);
// for https://jazz.tools marketing site demo only
@@ -24,7 +28,15 @@ export function App() {
return (
<AppContainer>
<TopBar>
<p>{me?.profile?.name}</p>
<input
type="text"
value={me?.profile?.name ?? ""}
onChange={(e) => {
if (!me?.profile) return;
me.profile.name = e.target.value;
}}
placeholder="Set username"
/>
{!inIframe && <button onClick={logOut}>Log out</button>}
</TopBar>
{router.route({
@@ -34,3 +46,21 @@ export function App() {
</AppContainer>
);
}
const url = new URL(window.location.href);
const defaultProfileName = url.searchParams.get("user") ?? getRandomUsername();
createRoot(document.getElementById("root")!).render(
<ThemeProvider>
<StrictMode>
<JazzProvider
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
defaultProfileName={defaultProfileName}
>
<App />
</JazzProvider>
</StrictMode>
</ThemeProvider>,
);

View File

@@ -1,7 +1,7 @@
import { createImage } from "jazz-browser-media-images";
import { useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { useState } from "react";
import { useAccount, useCoState } from "./main.tsx";
import { Chat, Message } from "./schema.ts";
import {
BubbleBody,
@@ -18,7 +18,6 @@ import {
export function ChatScreen(props: { chatID: ID<Chat> }) {
const chat = useCoState(Chat, props.chatID, [{}]);
const { me } = useAccount();
const [showNLastMessages, setShowNLastMessages] = useState(30);
if (!chat)
@@ -27,8 +26,6 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
);
const sendImage = (event: React.ChangeEvent<HTMLInputElement>) => {
if (!me?.profile) return;
const file = event.currentTarget.files?.[0];
if (!file) return;
@@ -39,12 +36,7 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
}
createImage(file, { owner: chat._owner }).then((image) => {
chat.push(
Message.create(
{ text: file.name, image: image },
{ owner: chat._owner },
),
);
chat.push(Message.create({ text: file.name, image: image }, chat._owner));
});
};

View File

@@ -1,36 +0,0 @@
import { ThemeProvider } from "@/themeProvider.tsx";
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { App } from "./app.tsx";
const Jazz = createJazzReactApp();
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, state] = useDemoAuth();
return (
<>
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=chat-example-jazz@garden.co"
>
{children}
</Jazz.Provider>
{state.state !== "signedIn" && (
<DemoAuthBasicUI appName="Jazz Chat" state={state} />
)}
</>
);
}
createRoot(document.getElementById("root")!).render(
<ThemeProvider>
<StrictMode>
<JazzAndAuth>
<App />
</JazzAndAuth>
</StrictMode>
</ThemeProvider>,
);

View File

@@ -6,7 +6,7 @@ import { useId, useRef } from "react";
export function AppContainer(props: { children: React.ReactNode }) {
return (
<div className="flex flex-col justify-between w-screen h-screen bg-stone-50 dark:bg-black dark:text-white">
<div className="flex flex-col justify-between w-screen h-screen bg-stone-50 dark:bg-stone-925 dark:text-white">
{props.children}
</div>
);
@@ -14,7 +14,7 @@ export function AppContainer(props: { children: React.ReactNode }) {
export function TopBar(props: { children: React.ReactNode }) {
return (
<div className="p-3 bg-white w-full flex justify-between gap-2 border-b dark:bg-transparent dark:border-stone-800">
<div className="p-3 bg-white w-full flex justify-between gap-2 border-b dark:bg-transparent dark:border-stone-900">
{props.children}
</div>
);
@@ -33,7 +33,7 @@ export function ChatBody(props: { children: React.ReactNode }) {
export function EmptyChatMessage() {
return (
<div className="h-full text-base text-stone-500 flex items-center justify-center px-3 text-lg md:text-2xl">
<div className="h-full text-base text-stone-500 flex items-center justify-center px-3 md:text-2xl">
Start a conversation below.
</div>
);
@@ -61,7 +61,7 @@ export function BubbleBody(props: {
"line-clamp-10 text-ellipsis whitespace-pre-wrap",
"rounded-2xl overflow-hidden max-w-[calc(100%-5rem)] shadow-sm p-1",
props.fromMe
? "bg-white dark:bg-stone-700 dark:text-white"
? "bg-white dark:bg-stone-900 dark:text-white"
: "bg-blue text-white",
)}
>
@@ -97,7 +97,7 @@ export function BubbleInfo(props: { by: string | undefined; madeAt: Date }) {
export function InputBar(props: { children: React.ReactNode }) {
return (
<div className="p-3 bg-white border-t shadow-2xl mt-auto flex gap-1 dark:bg-transparent dark:border-stone-800">
<div className="p-3 bg-white border-t shadow-2xl mt-auto flex gap-1 dark:bg-transparent dark:border-stone-900">
{props.children}
</div>
);
@@ -147,7 +147,7 @@ export function TextInput(props: { onSubmit: (text: string) => void }) {
</label>
<input
id={inputId}
className="rounded-full py-1 px-3 border block w-full placeholder:text-stone-500 dark:bg-black dark:text-white dark:border-stone-700"
className="rounded-full py-1 px-3 border block w-full placeholder:text-stone-500 dark:bg-stone-925 dark:text-white dark:border-stone-900"
placeholder="Type a message and press Enter"
maxLength={2048}
onKeyDown={({ key, currentTarget: input }) => {

View File

@@ -15,3 +15,20 @@ export function onChatLoad(chat: Chat) {
}
export const inIframe = window.self !== window.top;
const animals = [
"elephant",
"penguin",
"giraffe",
"octopus",
"kangaroo",
"dolphin",
"cheetah",
"koala",
"platypus",
"pangolin",
];
export function getRandomUsername() {
return `Anonymous ${animals[Math.floor(Math.random() * animals.length)]}`;
}

View File

@@ -1,48 +1,35 @@
import { test } from "@playwright/test";
import { ChatPage } from "./pages/ChatPage";
import { LoginPage } from "./pages/LoginPage";
test("chat between two users", async ({ page }) => {
const loginPage = new LoginPage(page);
test("chat between two users", async ({ page: marioPage, browser }) => {
const context = await browser.newContext();
const luigiPage = await context.newPage();
const mario = "S. Mario";
const luigi = "Luigi";
await marioPage.goto("/");
await loginPage.goto();
await loginPage.fillUsername(mario);
await loginPage.signup();
const marioChat = new ChatPage(marioPage);
const luigiChat = new ChatPage(luigiPage);
const chatPage = new ChatPage(page);
await marioChat.setUsername("Mario");
const message1ByMario = "Hello Luigi, are you ready to save the princess?";
await chatPage.sendMessage(message1ByMario);
await chatPage.expectMessageRow(message1ByMario);
await marioChat.sendMessage(message1ByMario);
await marioChat.expectMessageRow(message1ByMario);
const roomURL = page.url();
const roomURL = marioPage.url();
await luigiPage.goto(roomURL);
await chatPage.logout();
await luigiChat.setUsername("Luigi");
await loginPage.expectLoaded();
await loginPage.fillUsername(luigi);
await loginPage.signup();
await page.goto(roomURL);
await chatPage.expectMessageRow(message1ByMario);
await luigiChat.expectMessageRow(message1ByMario);
const message2ByLuigi =
"No, I'm not ready yet. I'm still trying to find the key to the castle.";
await chatPage.sendMessage(message2ByLuigi);
await chatPage.expectMessageRow(message2ByLuigi);
await luigiChat.sendMessage(message2ByLuigi);
await luigiChat.expectMessageRow(message2ByLuigi);
await chatPage.logout();
await loginPage.loginAs(mario);
await page.goto(roomURL);
await chatPage.expectMessageRow(message1ByMario);
await chatPage.expectMessageRow(message2ByLuigi);
await marioChat.expectMessageRow(message1ByMario);
await luigiChat.expectMessageRow(message2ByLuigi);
});

View File

@@ -4,7 +4,7 @@ export class ChatPage {
readonly page: Page;
readonly messageInput: Locator;
readonly logoutButton: Locator;
readonly usernameInput: Locator;
constructor(page: Page) {
this.page = page;
this.messageInput = page.getByRole("textbox", {
@@ -13,6 +13,11 @@ export class ChatPage {
this.logoutButton = page.getByRole("button", {
name: "Log out",
});
this.usernameInput = page.getByPlaceholder("Set username");
}
async setUsername(username: string) {
await this.usernameInput.fill(username);
}
async sendMessage(message: string) {

View File

@@ -1,40 +0,0 @@
import { Locator, Page, expect } from "@playwright/test";
export class LoginPage {
readonly page: Page;
readonly usernameInput: Locator;
readonly signupButton: Locator;
constructor(page: Page) {
this.page = page;
this.usernameInput = page.getByRole("textbox");
this.signupButton = page.getByRole("button", {
name: "Sign up",
});
}
async goto() {
this.page.goto("/");
}
async fillUsername(value: string) {
await this.usernameInput.clear();
await this.usernameInput.fill(value);
}
async loginAs(value: string) {
await this.page
.getByRole("button", {
name: value,
})
.click();
}
async signup() {
await this.signupButton.click();
}
async expectLoaded() {
await expect(this.signupButton).toBeVisible();
}
}

View File

@@ -1,5 +1,180 @@
# minimal-auth-clerk
## 0.0.44
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react-auth-clerk@0.10.0
- jazz-react@0.10.0
- jazz-tools@0.10.0
## 0.0.43
### Patch Changes
- jazz-react@0.9.23
- jazz-react-auth-clerk@0.9.23
- jazz-tools@0.9.23
## 0.0.42
### Patch Changes
- jazz-react@0.9.22
- jazz-react-auth-clerk@0.9.22
## 0.0.41
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-react@0.9.21
- jazz-react-auth-clerk@0.9.21
## 0.0.40
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-react@0.9.20
- jazz-react-auth-clerk@0.9.20
## 0.0.39
### Patch Changes
- jazz-react@0.9.19
- jazz-react-auth-clerk@0.9.19
- jazz-tools@0.9.19
## 0.0.38
### Patch Changes
- jazz-react@0.9.18
- jazz-react-auth-clerk@0.9.18
- jazz-tools@0.9.18
## 0.0.37
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-react@0.9.17
- jazz-react-auth-clerk@0.9.17
## 0.0.36
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-react-auth-clerk@0.9.16
- jazz-tools@0.9.16
- jazz-react@0.9.16
## 0.0.35
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-react@0.9.15
- jazz-react-auth-clerk@0.9.15
## 0.0.34
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-react@0.9.14
- jazz-react-auth-clerk@0.9.14
## 0.0.33
### Patch Changes
- jazz-react@0.9.13
- jazz-react-auth-clerk@0.9.13
- jazz-tools@0.9.13
## 0.0.32
### Patch Changes
- jazz-react@0.9.12
- jazz-react-auth-clerk@0.9.12
- jazz-tools@0.9.12
## 0.0.31
### Patch Changes
- jazz-react@0.9.11
- jazz-react-auth-clerk@0.9.11
- jazz-tools@0.9.11
## 0.0.30
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
- jazz-react-auth-clerk@0.9.10
## 0.0.29
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-react@0.9.9
- jazz-react-auth-clerk@0.9.9
## 0.0.28
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
- jazz-react-auth-clerk@0.9.8
## 0.0.27
### Patch Changes
- jazz-react@0.9.4
- jazz-react-auth-clerk@0.9.4
## 0.0.26
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
- jazz-react-auth-clerk@0.9.1
## 0.0.25
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
- jazz-react-auth-clerk@0.9.0
## 0.0.24
### Patch Changes

View File

@@ -4,30 +4,56 @@ This is an example of how to use clerk authentication with Jazz.
Live version: https://clerk-demo.jazz.tools
## Installing & running the example locally
## Getting started
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx degit gardencmp/jazz jazz
npx create-jazz-app@latest --example clerk --project-name clerk
```
Go to the clerk example directory:
Go to the new project directory.
```bash
cd jazz/examples/clerk
cd clerk
```
Install and build dependencies:
Run the dev server.
```bash
npm run 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
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/clerk/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.24",
"version": "0.0.44",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,7 +13,7 @@
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:0.8.51",
"jazz-react-auth-clerk": "workspace:0.10.0",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
@@ -25,6 +25,6 @@
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "~5.6.2",
"vite": "^5.4.10"
"vite": "^6.0.11"
}
}

View File

@@ -1,13 +1,25 @@
import { useAccount } from "./main";
import { SignInButton } from "@clerk/clerk-react";
import { useAccount, useIsAuthenticated } from "jazz-react";
function App() {
const { me, logOut } = useAccount();
const isAuthenticated = useIsAuthenticated();
if (isAuthenticated) {
return (
<div className="container">
<h1>You're logged in</h1>
<p>Welcome back, {me?.profile?.name}</p>
<button onClick={() => logOut()}>Logout</button>
</div>
);
}
return (
<div className="container">
<h1>You're logged in</h1>
<p>Welcome back, {me?.profile?.name}</p>
<button onClick={() => logOut()}>Logout</button>
<h1>You're not logged in</h1>
<SignInButton />
</div>
);
}

View File

@@ -0,0 +1 @@
export const apiKey = "minimal-auth-clerk-example@garden.co";

View File

@@ -62,7 +62,7 @@ button {
}
.container {
max-width: 200px;
max-width: 400px;
margin: 0 auto;
padding: 0 1rem;
display: flex;

View File

@@ -1,10 +1,10 @@
import { ClerkProvider, SignInButton, useClerk } from "@clerk/clerk-react";
import { createJazzReactApp } from "jazz-react";
import { useJazzClerkAuth } from "jazz-react-auth-clerk";
import { ClerkProvider, useClerk } from "@clerk/clerk-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzProviderWithClerk } from "jazz-react-auth-clerk";
import { apiKey } from "./apiKey";
// Import your publishable key
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
@@ -13,38 +13,28 @@ if (!PUBLISHABLE_KEY) {
throw new Error("Add your Clerk publishable key to the .env.local file");
}
const Jazz = createJazzReactApp();
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
function JazzProvider({ children }: { children: React.ReactNode }) {
const clerk = useClerk();
const [auth, state] = useJazzClerkAuth(clerk);
return (
<main className="container">
{state?.errors?.map((error) => (
<div key={error}>{error}</div>
))}
{clerk.user && auth ? (
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=minimal-auth-clerk-example@garden.co"
>
{children}
</Jazz.Provider>
) : (
<SignInButton />
)}
</main>
<JazzProviderWithClerk
clerk={clerk}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
when: "signedUp", // This makes the app work in local mode when the user is not authenticated
}}
>
{children}
</JazzProviderWithClerk>
);
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
<JazzAndAuth>
<JazzProvider>
<App />
</JazzAndAuth>
</JazzProvider>
</ClerkProvider>
</StrictMode>,
);

View File

@@ -1,5 +1,154 @@
# file-share-svelte
## 0.0.29
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-tools@0.10.0
- jazz-svelte@0.10.0
## 0.0.28
### Patch Changes
- jazz-svelte@0.9.23
- jazz-tools@0.9.23
## 0.0.27
### Patch Changes
- jazz-svelte@0.9.22
## 0.0.26
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-svelte@0.9.21
## 0.0.25
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-svelte@0.9.20
## 0.0.24
### Patch Changes
- jazz-svelte@0.9.19
- jazz-tools@0.9.19
## 0.0.23
### Patch Changes
- jazz-svelte@0.9.18
- jazz-tools@0.9.18
## 0.0.22
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-svelte@0.9.17
## 0.0.21
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-svelte@0.9.16
## 0.0.20
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-svelte@0.9.15
## 0.0.19
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-svelte@0.9.14
## 0.0.18
### Patch Changes
- jazz-svelte@0.9.13
- jazz-tools@0.9.13
## 0.0.17
### Patch Changes
- jazz-svelte@0.9.12
- jazz-tools@0.9.12
## 0.0.16
### Patch Changes
- jazz-svelte@0.9.11
- jazz-tools@0.9.11
## 0.0.15
### Patch Changes
- Updated dependencies [5e83864]
- jazz-tools@0.9.10
- jazz-svelte@0.9.10
## 0.0.14
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-svelte@0.9.9
## 0.0.13
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-svelte@0.9.8
## 0.0.12
### Patch Changes
- Updated dependencies [1b71969]
- jazz-tools@0.9.1
- jazz-svelte@0.9.1
## 0.0.11
### Patch Changes
- Updated dependencies [9dd8d95]
- Updated dependencies [8eda792]
- jazz-svelte@0.9.0
- jazz-tools@0.9.0
## 0.0.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "file-share-svelte",
"version": "0.0.10",
"version": "0.0.29",
"private": true,
"type": "module",
"scripts": {
@@ -18,8 +18,8 @@
},
"devDependencies": {
"@sveltejs/adapter-vercel": "^5.5.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.1",
"@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"@types/is-ci": "^3.0.4",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
@@ -32,10 +32,10 @@
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",
"typescript-eslint": "^8.0.0",
"vite": "^5.4.10"
"vite": "^6.0.11"
},
"dependencies": {
"@tailwindcss/typography": "^0.5.15",

View File

@@ -0,0 +1 @@
export const apiKey = "file-share-svelte@garden.co"

View File

@@ -3,7 +3,7 @@
import { SharedFile } from '$lib/schema';
import { FileStream } from 'jazz-tools';
import { File, FileDown, Trash2, Link2 } from 'lucide-svelte';
import { useAccount } from '$lib/jazz';
import { useAccount } from 'jazz-svelte';
import { toast } from 'svelte-sonner';
import { formatFileSize } from '$lib/utils';

View File

@@ -1,7 +0,0 @@
import { createJazzApp } from 'jazz-svelte';
import { FileShareAccount } from './schema';
export const { useAccount, useCoState, useAcceptInvite, useAccountOrGuest, Provider } =
createJazzApp({
AccountSchema: FileShareAccount
});

View File

@@ -17,6 +17,6 @@ export function formatFileSize(bytes: number): string {
* @param createdAt The creation date
* @returns A unique file ID string
*/
export function generateTempFileId(fileName: string, createdAt: Date): string {
return `file-${fileName}-${createdAt.getTime()}`;
export function generateTempFileId(fileName: string | undefined, createdAt: Date | undefined): string {
return `file-${fileName ?? 'unknown'}-${createdAt?.getTime() ?? 0}`;
}

View File

@@ -1,13 +1,20 @@
<script lang="ts" module>
declare module 'jazz-svelte' {
interface Register {
Account: FileShareAccount;
}
}
</script>
<script lang="ts">
import { Provider } from '$lib/jazz';
import { JazzProvider } from 'jazz-svelte';
import { PasskeyAuthBasicUI, usePasskeyAuth } from 'jazz-svelte';
import { Toaster } from 'svelte-sonner';
import '../app.css';
import { FileShareAccount } from '$lib/schema';
import {apiKey} from '../apiKey';
let { children } = $props();
const auth = usePasskeyAuth({
appName: 'File Share'
});
</script>
<svelte:head>
@@ -16,17 +23,16 @@
<Toaster richColors />
{#if auth.state.state === 'ready'}
<div class="fixed inset-0 flex items-center justify-center bg-gray-50/80">
<div class="rounded-lg bg-white p-8 shadow-lg">
<PasskeyAuthBasicUI state={auth.state} />
</div>
</div>
{/if}
{#if auth.current}
<Provider auth={auth.current} peer="wss://cloud.jazz.tools/?key=file-share-svelte@garden.co">
<JazzProvider
AccountSchema={FileShareAccount}
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
when: "signedUp",
}}
>
<PasskeyAuthBasicUI appName="File Share">
<div class="min-h-screen bg-gray-100">
{@render children()}
</div>
</Provider>
{/if}
</PasskeyAuthBasicUI>
</JazzProvider>

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { useAccount, useCoState } from '$lib/jazz';
import { useAccount, useCoState } from 'jazz-svelte';
import { SharedFile, ListOfSharedFiles } from '$lib/schema';
import { createInviteLink } from 'jazz-svelte';
import { FileStream } from 'jazz-tools';
@@ -28,7 +28,7 @@
const input = event.target as HTMLInputElement;
const files = input.files;
if (!files || !files.length || !me?.root?.sharedFiles || !me.root.publicGroup) return;
if (!files || !files.length || !me.root?.sharedFiles || !me.root.publicGroup) return;
const file = files[0];
const fileName = file.name;
@@ -129,12 +129,14 @@
{#if sharedFiles.current}
{#if !(sharedFiles.current.length === 0 && uploadingFiles.size === 0)}
{#each [...sharedFiles.current, ...uploadingFiles.values()] as file (generateTempFileId(file?.name, file?.createdAt))}
<FileItem
{file}
loading={uploadingFiles.has(generateTempFileId(file?.name, file?.createdAt))}
onShare={shareFile}
onDelete={deleteFile}
/>
{#if file}
<FileItem
{file}
loading={uploadingFiles.has(generateTempFileId(file?.name, file?.createdAt))}
onShare={shareFile}
onDelete={deleteFile}
/>
{/if}
{/each}
{:else}
<p class="text-center text-gray-500">No files yet</p>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { useAccount, useCoState } from '$lib/jazz';
import { useAccount, useCoState } from 'jazz-svelte';
import { SharedFile } from '$lib/schema';
import { File, FileDown, Link2 } from 'lucide-svelte';
import type { ID } from 'jazz-tools';

View File

@@ -1,5 +1,179 @@
# form
## 0.0.40
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react@0.10.0
- jazz-tools@0.10.0
- jazz-browser-media-images@0.10.0
## 0.0.39
### Patch Changes
- jazz-react@0.9.23
- jazz-tools@0.9.23
- jazz-browser-media-images@0.9.23
## 0.0.38
### Patch Changes
- jazz-browser-media-images@0.9.22
- jazz-react@0.9.22
## 0.0.37
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-browser-media-images@0.9.21
- jazz-react@0.9.21
## 0.0.36
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-browser-media-images@0.9.20
- jazz-react@0.9.20
## 0.0.35
### Patch Changes
- jazz-react@0.9.19
- jazz-tools@0.9.19
- jazz-browser-media-images@0.9.19
## 0.0.34
### Patch Changes
- jazz-react@0.9.18
- jazz-tools@0.9.18
- jazz-browser-media-images@0.9.18
## 0.0.33
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-browser-media-images@0.9.17
- jazz-react@0.9.17
## 0.0.32
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-browser-media-images@0.9.16
- jazz-react@0.9.16
## 0.0.31
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-browser-media-images@0.9.15
- jazz-react@0.9.15
## 0.0.30
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-browser-media-images@0.9.14
- jazz-react@0.9.14
## 0.0.29
### Patch Changes
- jazz-react@0.9.13
- jazz-tools@0.9.13
- jazz-browser-media-images@0.9.13
## 0.0.28
### Patch Changes
- jazz-react@0.9.12
- jazz-tools@0.9.12
- jazz-browser-media-images@0.9.12
## 0.0.27
### Patch Changes
- jazz-react@0.9.11
- jazz-tools@0.9.11
- jazz-browser-media-images@0.9.11
## 0.0.26
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
- jazz-browser-media-images@0.9.10
## 0.0.25
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-browser-media-images@0.9.9
- jazz-react@0.9.9
## 0.0.24
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
- jazz-browser-media-images@0.9.8
## 0.0.23
### Patch Changes
- jazz-react@0.9.4
## 0.0.22
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
- jazz-browser-media-images@0.9.1
## 0.0.21
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
- jazz-browser-media-images@0.9.0
## 0.0.20
### Patch Changes

View File

@@ -17,30 +17,56 @@ converting it into a `BubbleTeaOrder`.
[See the full guide here.](https://jazz.tools/docs/react/design-patterns/form)
## Installing & running the example locally
## Getting started
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx degit gardencmp/jazz jazz
npx create-jazz-app@latest --example form --project-name form
```
Go to the form example directory:
Go to the new project directory.
```bash
cd jazz/examples/form
cd form
```
Install and build dependencies:
Run the dev server.
```bash
npm run 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
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/form/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
@@ -49,4 +75,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 `<Jazz.Provider>` provider component in [./src/main.tsx](./src/main.tsx).
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).

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.0.20",
"version": "0.0.40",
"type": "module",
"scripts": {
"dev": "vite",
@@ -20,7 +20,7 @@
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.50.1",
"@tailwindcss/forms": "^0.5.9",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
@@ -29,8 +29,8 @@
"globals": "^15.11.0",
"is-ci": "^3.0.1",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",
"vite": "^5.4.10"
"vite": "^6.0.11"
}
}

View File

@@ -1,9 +1,9 @@
import { useIframeHashRouter } from "hash-slash";
import { useAccount } from "jazz-react";
import { ID } from "jazz-tools";
import { CreateOrder } from "./CreateOrder.tsx";
import { EditOrder } from "./EditOrder.tsx";
import { Orders } from "./Orders.tsx";
import { useAccount } from "./main";
import { BubbleTeaOrder } from "./schema.ts";
function App() {

View File

@@ -1,10 +1,10 @@
import { useIframeHashRouter } from "hash-slash";
import { useAccount, useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { useState } from "react";
import { Errors } from "./Errors.tsx";
import { LinkToHome } from "./LinkToHome.tsx";
import { OrderForm } from "./OrderForm.tsx";
import { useAccount, useCoState } from "./main.tsx";
import {
BubbleTeaOrder,
DraftBubbleTeaOrder,
@@ -30,12 +30,9 @@ export function CreateOrder() {
me.root.orders.push(draft as BubbleTeaOrder);
// reset the draft
me.root.draft = DraftBubbleTeaOrder.create(
{
addOns: ListOfBubbleTeaAddOns.create([], me),
},
me,
);
me.root.draft = DraftBubbleTeaOrder.create({
addOns: ListOfBubbleTeaAddOns.create([]),
});
router.navigate("/");
};

View File

@@ -1,4 +1,4 @@
import { useAccount } from "./main.tsx";
import { useAccount } from "jazz-react";
export function DraftIndicator() {
const { me } = useAccount({

View File

@@ -1,8 +1,8 @@
import { useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { LinkToHome } from "./LinkToHome.tsx";
import { OrderForm } from "./OrderForm.tsx";
import { OrderThumbnail } from "./OrderThumbnail.tsx";
import { useCoState } from "./main.tsx";
import { BubbleTeaOrder } from "./schema.ts";
export function EditOrder(props: { id: ID<BubbleTeaOrder> }) {

View File

@@ -1,6 +1,6 @@
import { useAccount } from "jazz-react";
import { DraftIndicator } from "./DraftIndicator.tsx";
import { OrderThumbnail } from "./OrderThumbnail.tsx";
import { useAccount } from "./main.tsx";
export function Orders() {
const { me } = useAccount({

View File

@@ -0,0 +1 @@
export const apiKey = "form-example@garden.co";

View File

@@ -1,39 +1,26 @@
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
import { JazzProvider } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { apiKey } from "./apiKey";
import { JazzAccount } from "./schema.ts";
const Jazz = createJazzReactApp({
AccountSchema: JazzAccount,
});
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, authState] = useDemoAuth();
return (
<>
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=form-example@garden.co"
>
{children}
</Jazz.Provider>
{authState.state !== "signedIn" && (
<DemoAuthBasicUI appName="Form" state={authState} />
)}
</>
);
declare module "jazz-react" {
interface Register {
Account: JazzAccount;
}
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<JazzAndAuth>
<JazzProvider
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
AccountSchema={JazzAccount}
>
<App />
</JazzAndAuth>
</JazzProvider>
</StrictMode>,
);

View File

@@ -1,13 +1,7 @@
import { expect, test } from "@playwright/test";
import { LoginPage } from "./pages/LoginPage";
test("create and edit an order", async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.goto();
await loginPage.fillUsername("Alice");
await loginPage.signup();
await page.goto("/");
// start an order
await page.getByRole("link", { name: "Add new order" }).click();
await page.getByLabel("Base tea").selectOption("Oolong");

View File

@@ -1,40 +0,0 @@
import { Locator, Page, expect } from "@playwright/test";
export class LoginPage {
readonly page: Page;
readonly usernameInput: Locator;
readonly signupButton: Locator;
constructor(page: Page) {
this.page = page;
this.usernameInput = page.getByRole("textbox");
this.signupButton = page.getByRole("button", {
name: "Sign up",
});
}
async goto() {
this.page.goto("/");
}
async fillUsername(value: string) {
await this.usernameInput.clear();
await this.usernameInput.fill(value);
}
async loginAs(value: string) {
await this.page
.getByRole("button", {
name: value,
})
.click();
}
async signup() {
await this.signupButton.click();
}
async expectLoaded() {
await expect(this.signupButton).toBeVisible();
}
}

View File

@@ -1,5 +1,179 @@
# image-upload
## 0.0.42
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react@0.10.0
- jazz-tools@0.10.0
- jazz-browser-media-images@0.10.0
## 0.0.41
### Patch Changes
- jazz-react@0.9.23
- jazz-tools@0.9.23
- jazz-browser-media-images@0.9.23
## 0.0.40
### Patch Changes
- jazz-browser-media-images@0.9.22
- jazz-react@0.9.22
## 0.0.39
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-browser-media-images@0.9.21
- jazz-react@0.9.21
## 0.0.38
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-browser-media-images@0.9.20
- jazz-react@0.9.20
## 0.0.37
### Patch Changes
- jazz-react@0.9.19
- jazz-tools@0.9.19
- jazz-browser-media-images@0.9.19
## 0.0.36
### Patch Changes
- jazz-react@0.9.18
- jazz-tools@0.9.18
- jazz-browser-media-images@0.9.18
## 0.0.35
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-browser-media-images@0.9.17
- jazz-react@0.9.17
## 0.0.34
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-browser-media-images@0.9.16
- jazz-react@0.9.16
## 0.0.33
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-browser-media-images@0.9.15
- jazz-react@0.9.15
## 0.0.32
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-browser-media-images@0.9.14
- jazz-react@0.9.14
## 0.0.31
### Patch Changes
- jazz-react@0.9.13
- jazz-tools@0.9.13
- jazz-browser-media-images@0.9.13
## 0.0.30
### Patch Changes
- jazz-react@0.9.12
- jazz-tools@0.9.12
- jazz-browser-media-images@0.9.12
## 0.0.29
### Patch Changes
- jazz-react@0.9.11
- jazz-tools@0.9.11
- jazz-browser-media-images@0.9.11
## 0.0.28
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
- jazz-browser-media-images@0.9.10
## 0.0.27
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-browser-media-images@0.9.9
- jazz-react@0.9.9
## 0.0.26
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
- jazz-browser-media-images@0.9.8
## 0.0.25
### Patch Changes
- jazz-react@0.9.4
## 0.0.24
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
- jazz-browser-media-images@0.9.1
## 0.0.23
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
- jazz-browser-media-images@0.9.0
## 0.0.22
### Patch Changes

View File

@@ -4,30 +4,56 @@ This is an example of how to upload and render images with Jazz.
Live version: https://image-upload-demo.jazz.tools
## Installing & running the example locally
## Getting started
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx degit gardencmp/jazz jazz
npx create-jazz-app@latest --example image-upload --project-name image-upload
```
Go to the image-upload example directory:
Go to the new project directory.
```bash
cd jazz/examples/image-upload
cd image-upload
```
Install and build dependencies:
Run the dev server.
```bash
npm run 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
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/image-upload/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.22",
"version": "0.0.42",
"type": "module",
"scripts": {
"dev": "vite",
@@ -24,6 +24,6 @@
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "~5.6.2",
"vite": "^5.4.10"
"vite": "^6.0.11"
}
}

View File

@@ -1,5 +1,5 @@
import { useAccount } from "jazz-react";
import ImageUpload from "./ImageUpload.tsx";
import { useAccount } from "./main";
function App() {
const { me, logOut } = useAccount();

View File

@@ -1,8 +1,7 @@
import { createImage } from "jazz-browser-media-images";
import { ProgressiveImg } from "jazz-react";
import { ProgressiveImg, useAccount } from "jazz-react";
import { ImageDefinition } from "jazz-tools";
import { ChangeEvent, useRef } from "react";
import { useAccount } from "./main.tsx";
function Image({ image }: { image: ImageDefinition }) {
return (

View File

@@ -0,0 +1 @@
export const apiKey = "image-upload-example@garden.co";

View File

@@ -1,39 +1,26 @@
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
import { JazzProvider } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { apiKey } from "./apiKey.ts";
import { JazzAccount } from "./schema.ts";
const Jazz = createJazzReactApp({
AccountSchema: JazzAccount,
});
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, authState] = useDemoAuth();
return (
<>
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=image-upload-example@garden.co"
>
{children}
</Jazz.Provider>
{authState.state !== "signedIn" && (
<DemoAuthBasicUI appName="Image upload" state={authState} />
)}
</>
);
declare module "jazz-react" {
interface Register {
Account: JazzAccount;
}
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<JazzAndAuth>
<JazzProvider
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
AccountSchema={JazzAccount}
>
<App />
</JazzAndAuth>
</JazzProvider>
</StrictMode>,
);

View File

@@ -1,5 +1,98 @@
# jazz-example-inspector
## 0.0.103
### Patch Changes
- Updated dependencies [b426342]
- Updated dependencies [498954f]
- Updated dependencies [8217981]
- Updated dependencies [ac3d9fa]
- Updated dependencies [610543c]
- cojson@0.10.0
- cojson-transport-ws@0.10.0
## 0.0.102
### Patch Changes
- Updated dependencies [70c9a5d]
- cojson@0.9.23
- cojson-transport-ws@0.9.23
## 0.0.101
### Patch Changes
- Updated dependencies [14b6149]
- cojson-transport-ws@0.9.22
## 0.0.100
### Patch Changes
- Updated dependencies [6ad0a9f]
- cojson@0.9.19
- cojson-transport-ws@0.9.19
## 0.0.99
### Patch Changes
- Updated dependencies [8898b10]
- cojson@0.9.18
- cojson-transport-ws@0.9.18
## 0.0.98
### Patch Changes
- Updated dependencies [8d29e50]
- cojson-transport-ws@0.9.13
- cojson@0.9.13
## 0.0.97
### Patch Changes
- Updated dependencies [15d4b2a]
- cojson-transport-ws@0.9.12
- cojson@0.9.12
## 0.0.96
### Patch Changes
- Updated dependencies [efbf3d8]
- Updated dependencies [5863bad]
- cojson@0.9.11
- cojson-transport-ws@0.9.11
## 0.0.95
### Patch Changes
- Updated dependencies [4aa377d]
- cojson@0.9.10
- cojson-transport-ws@0.9.10
## 0.0.94
### Patch Changes
- Updated dependencies [8eb9247]
- cojson@0.9.9
- cojson-transport-ws@0.9.9
## 0.0.93
### Patch Changes
- Updated dependencies [8eda792]
- Updated dependencies [1ef3226]
- cojson@0.9.0
- cojson-transport-ws@0.9.0
## 0.0.92
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector",
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.92",
"version": "0.0.103",
"type": "module",
"scripts": {
"dev": "vite",
@@ -12,12 +12,12 @@
},
"dependencies": {
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.8.50",
"cojson-transport-ws": "workspace:0.8.50",
"cojson": "workspace:0.10.0",
"cojson-transport-ws": "workspace:0.10.0",
"hash-slash": "workspace:0.2.1",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
@@ -37,8 +37,8 @@
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",
"vite": "^5.4.10"
"vite": "^6.0.11"
}
}

View File

@@ -0,0 +1 @@
export const apiKey = "";

View File

@@ -1,5 +1,180 @@
# jazz-example-musicplayer
## 0.0.66
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-inspector@0.10.0
- jazz-react@0.10.0
- jazz-tools@0.10.0
## 0.0.65
### Patch Changes
- jazz-inspector@0.9.23
- jazz-react@0.9.23
- jazz-tools@0.9.23
## 0.0.64
### Patch Changes
- jazz-react@0.9.22
## 0.0.63
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-inspector@0.9.22
- jazz-react@0.9.21
## 0.0.62
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-inspector@0.9.21
- jazz-react@0.9.20
## 0.0.61
### Patch Changes
- jazz-inspector@0.9.20
- jazz-react@0.9.19
- jazz-tools@0.9.19
## 0.0.60
### Patch Changes
- Updated dependencies [2faf22f]
- jazz-inspector@0.9.19
## 0.0.59
### Patch Changes
- jazz-inspector@0.9.18
- jazz-react@0.9.18
- jazz-tools@0.9.18
## 0.0.58
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-inspector@0.9.17
- jazz-react@0.9.17
## 0.0.57
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-inspector@0.9.16
- jazz-react@0.9.16
## 0.0.56
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-inspector@0.9.15
- jazz-react@0.9.15
## 0.0.55
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-inspector@0.9.14
- jazz-react@0.9.14
## 0.0.54
### Patch Changes
- jazz-inspector@0.9.13
- jazz-react@0.9.13
- jazz-tools@0.9.13
## 0.0.53
### Patch Changes
- jazz-inspector@0.9.12
- jazz-react@0.9.12
- jazz-tools@0.9.12
## 0.0.52
### Patch Changes
- jazz-inspector@0.9.11
- jazz-react@0.9.11
- jazz-tools@0.9.11
## 0.0.51
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
## 0.0.50
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-react@0.9.9
## 0.0.49
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
## 0.0.48
### Patch Changes
- jazz-react@0.9.4
## 0.0.47
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
## 0.0.46
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
## 0.0.45
### Patch Changes

View File

@@ -2,30 +2,56 @@
Live version: https://music-demo.jazz.tools
## Installing & running the example locally
## Getting started
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx degit gardencmp/jazz jazz
npx create-jazz-app@latest --example music-player --project-name music-player
```
Go to the music-player example directory:
Go to the new project directory.
```bash
cd jazz/examples/music-player
cd music-player
```
Install and build dependencies:
Run the dev server.
```bash
npm run 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
```
Start the dev server:
Go to the example directory.
```bash
cd jazz/examples/music-player/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
@@ -34,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 cojson-simple-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 `<Jazz.Provider>` provider component in [./src/2_main.tsx](./src/2_main.tsx).
You can also run a local sync server by running `npx cojson-simple-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/2_main.tsx](./src/2_main.tsx).

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.45",
"version": "0.0.66",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,13 +13,17 @@
"test:ui": "playwright test --ui"
},
"dependencies": {
"@radix-ui/react-dialog": "^1.1.4",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-toast": "^1.1.4",
"@radix-ui/react-tooltip": "^1.1.6",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-react": "workspace:0.8.51",
"jazz-tools": "workspace:0.8.51",
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:0.10.0",
"jazz-tools": "workspace:0.10.0",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -29,14 +33,14 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.50.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",
"vite": "^5.4.10"
"vite": "^6.0.11"
}
}

View File

@@ -36,6 +36,8 @@ export class MusicTrack extends CoMap {
*/
file = co.ref(FileStream);
waveform = co.ref(MusicTrackWaveform);
isExampleTrack = co.optional.boolean;
}
export class MusicTrackWaveform extends CoMap {
@@ -86,28 +88,20 @@ export class MusicaAccount extends Account {
* You can use it to set up the account root and any other initial CoValues you need.
*/
migrate() {
if (!this._refs.root) {
const ownership = { owner: this };
if (this.root === undefined) {
const tracks = ListOfTracks.create([]);
const rootPlaylist = Playlist.create({
tracks,
title: "",
});
const tracks = ListOfTracks.create([], ownership);
const rootPlaylist = Playlist.create(
{
tracks,
title: "",
},
ownership,
);
this.root = MusicaAccountRoot.create(
{
rootPlaylist,
playlists: ListOfPlaylists.create([], ownership),
activeTrack: null,
activePlaylist: rootPlaylist,
exampleDataLoaded: false,
},
ownership,
);
this.root = MusicaAccountRoot.create({
rootPlaylist,
playlists: ListOfPlaylists.create([]),
activeTrack: null,
activePlaylist: rootPlaylist,
exampleDataLoaded: false,
});
}
}
}

View File

@@ -1,4 +1,5 @@
import { Toaster } from "@/components/ui/toaster";
import { JazzInspector } from "jazz-inspector";
/* eslint-disable react-refresh/only-export-components */
import React from "react";
import ReactDOM from "react-dom/client";
@@ -10,26 +11,22 @@ import { PlayerControls } from "./components/PlayerControls";
import "./index.css";
import { MusicaAccount } from "@/1_schema";
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
import { apiKey } from "@/apiKey.ts";
import { JazzProvider } from "jazz-react";
import { onAnonymousAccountDiscarded } from "./4_actions";
import { useUploadExampleData } from "./lib/useUploadExampleData";
/**
* Walkthrough: The top-level provider `<Jazz.Provider/>`
* Walkthrough: The top-level provider `<JazzProvider/>`
*
* This shows how to use the top-level provider `<Jazz.Provider/>`,
* This shows how to use the top-level provider `<JazzProvider/>`,
* which provides the rest of the app with a controlled account (used through `useAccount` later).
* Here we use `DemoAuth` which is great for prototyping you app without wasting time on figuring out
* the best way to do auth.
*
* `<Jazz.Provider/>` also runs our account migration
* `<JazzProvider/>` also runs our account migration
*/
const Jazz = createJazzReactApp({
AccountSchema: MusicaAccount,
});
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
function Main() {
const mediaPlayer = useMediaPlayer();
@@ -59,33 +56,31 @@ function Main() {
);
}
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, state] = useDemoAuth();
const peer =
(new URL(window.location.href).searchParams.get(
"peer",
) as `ws://${string}`) ?? `wss://cloud.jazz.tools/?key=${apiKey}`;
const peer =
(new URL(window.location.href).searchParams.get(
"peer",
) as `ws://${string}`) ??
"wss://cloud.jazz.tools/?key=music-player-example-jazz@garden.co";
return (
<>
<Jazz.Provider
storage={["singleTabOPFS", "indexedDB"]}
auth={auth}
peer={peer}
>
{children}
</Jazz.Provider>
<DemoAuthBasicUI appName="Jazz Music Player" state={state} />
</>
);
declare module "jazz-react" {
interface Register {
Account: MusicaAccount;
}
}
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<JazzAndAuth>
<JazzProvider
sync={{
peer,
when: "signedUp", // This makes the app work in local mode when the user is anonymous
}}
storage="indexedDB"
AccountSchema={MusicaAccount}
defaultProfileName="Anonymous unicorn"
onAnonymousAccountDiscarded={onAnonymousAccountDiscarded}
>
<Main />
</JazzAndAuth>
<JazzInspector />
</JazzProvider>
</React.StrictMode>,
);

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