Compare commits

..

267 Commits

Author SHA1 Message Date
Anselm Eickhoff
44497fd058 Merge pull request #668 from gardencmp/changeset-release/main
Version Packages
2024-11-01 10:20:07 +00:00
github-actions[bot]
a18c187818 Version Packages 2024-11-01 10:04:27 +00:00
Anselm Eickhoff
f49949cc25 Merge pull request #653 from gardencmp/feature/react-provider-dev-mode
fix: ensure that the react provider doesn't run twice on dev
2024-11-01 10:03:09 +00:00
Anselm
3cc6aee7e6 Add changeset 2024-11-01 09:54:11 +00:00
Anselm Eickhoff
c80763100e Merge pull request #651 from gardencmp/gudorsi-jazz-248-storage-peer
feat: introduce the storage peer role
2024-11-01 09:50:14 +00:00
Anselm
6ed75ebb35 Add changeset 2024-11-01 09:49:30 +00:00
Anselm Eickhoff
30d7734124 Merge pull request #663 from gardencmp/trishalim-jazz-443
Close mobile nav after clicking a link
2024-11-01 09:41:10 +00:00
Anselm Eickhoff
bca8b44189 Merge pull request #664 from gardencmp/trishalim-jazz-445
Docs: create separate pages for nextjs and react native
2024-11-01 09:31:11 +00:00
Anselm Eickhoff
36a069c90f Merge pull request #666 from gardencmp/feature/jazz-run-integration-test
chore(jazz-run): extract commands business logic and add tests
2024-11-01 09:29:12 +00:00
Guido D'Orsi
757b37e8ed feat: introduce the storage peer role 2024-10-31 23:18:47 +01:00
Guido D'Orsi
46b1163058 chore(jazz-run): split commands and core logic and add tests 2024-10-31 23:09:42 +01:00
Trisha Lim
8c261b0409 Create separate pages for nextjs and react native 2024-10-31 19:36:19 +00:00
Trisha Lim
fdacde57dd Lint fix 2024-10-31 19:10:38 +00:00
Trisha Lim
817dd7dde1 Close mobile nav after clicking a link 2024-10-31 19:07:11 +00:00
Anselm Eickhoff
6279dd1467 Merge pull request #662 from gardencmp/trishalim-jazz-446
Add yellow dot as legend for docs that are WIP
2024-10-31 17:30:18 +00:00
Trisha Lim
abd4b94392 Add legend in side nav to indicate WIP docs 2024-10-31 17:24:03 +00:00
Trisha Lim
68c6ee77c0 Remove % progress in docs, add '/coming-soon' page 2024-10-31 17:18:33 +00:00
Anselm Eickhoff
d2b2812428 Merge pull request #658 from gardencmp/fix/sticky-nav
Fix nav is not sticking to top
2024-10-31 16:29:52 +00:00
Anselm Eickhoff
fe214cc3c2 Merge pull request #657 from gardencmp/fix/h4-style
Fix styling for h4 in prose
2024-10-31 16:29:39 +00:00
Anselm Eickhoff
2cca9506ad Merge pull request #656 from gardencmp/react-native-docs
React native docs
2024-10-31 16:29:06 +00:00
Trisha Lim
17e69aff8f Add space between main content and footer 2024-10-31 14:22:33 +00:00
Trisha Lim
c45331e645 Fix nav is not sticking to top 2024-10-31 14:21:13 +00:00
Trisha Lim
4337001526 Fix styling for h4 in prose 2024-10-31 13:52:23 +00:00
pax-k
9eef1ec031 fix(docs): layout centering 2024-10-31 15:33:54 +02:00
pax-k
9d31bbc3aa chore(docs): added react native docs 2024-10-31 15:20:01 +02:00
Guido D'Orsi
911add3dea fix: ensure that the react provider doesn't run twice on dev 2024-10-31 11:19:48 +01:00
Anselm Eickhoff
eed9ad99d8 Merge pull request #652 from gardencmp/changeset-release/main 2024-10-30 20:20:51 +00:00
github-actions[bot]
a1d0793e95 Version Packages 2024-10-30 20:06:28 +00:00
Anselm Eickhoff
ac9aad2ff5 Merge pull request #646 from gardencmp/gudorsi-jazz-248
Improve the jazz-run create command and make it possible to subscribe to the peer sync state
2024-10-30 20:05:19 +00:00
Guido D'Orsi
1ed4ab5a8e chore: changeset 2024-10-30 19:50:24 +01:00
Anselm Eickhoff
b03aed69b6 Merge pull request #558 from gardencmp/trishalim-jazz-388
Docs outline, move guide pages to right side nav
2024-10-30 17:53:28 +00:00
Anselm
1120d84c89 Merge branch 'main' into trishalim-jazz-388 2024-10-30 17:32:03 +00:00
Anselm Eickhoff
4e4671cba2 Merge pull request #623 from gardencmp/aeplay-jazz-146 2024-10-30 16:40:29 +00:00
Anselm
cdca330f1e Remove Roadmap 2024-10-30 15:15:55 +00:00
Anselm
bf8840cfbc Write introduction 2024-10-30 15:15:23 +00:00
Anselm
89d4da8d50 Make unfinshed docs unclickable & fix mobile docs nav 2024-10-30 14:42:35 +00:00
Anselm Eickhoff
74e441d233 Merge pull request #645 from gardencmp/trishalim-jazz-358
Add dark/light theme toggler
2024-10-30 13:36:50 +00:00
Anselm Eickhoff
58e5682e3d Merge pull request #634 from gardencmp/trishalim-jazz-430
Redesign diagrams section
2024-10-30 13:34:47 +00:00
Trisha Lim
4915422646 Don't set border colors 2024-10-30 11:32:17 +00:00
Trisha Lim
2337d66ec5 Fix nav disappears 2024-10-30 11:31:05 +00:00
Trisha Lim
e2c73d3c3d Rename localSrc to localsrc due to react error 2024-10-30 11:11:15 +00:00
Trisha Lim
e4c0314368 Redesign problem section 2024-10-30 11:08:13 +00:00
Trisha Lim
228cd42b23 Fix console errors 2024-10-30 10:53:57 +00:00
Trisha Lim
1c80492482 Theme toggle button styling 2024-10-30 10:51:38 +00:00
Guido D'Orsi
bfbd5c514b chore(ci): fix the jazz-tools action 2024-10-29 22:34:30 +01:00
Anselm
520bcfd72a Public shaming for missing docs 2024-10-29 21:26:26 +00:00
Guido D'Orsi
566fde6ecc chore(jazz-run): chore extract the accountCreate command 2024-10-29 21:56:03 +01:00
Guido D'Orsi
c44b5db09a test: add a github action to test account create 2024-10-29 21:52:43 +01:00
Guido D'Orsi
477d0aa899 fix(jazz-run): replace the sleep with a sync status check on create account 2024-10-29 21:42:28 +01:00
Guido D'Orsi
60171b477f feat: move all the optimisticKnownStates update operation inside PeerKnownStates 2024-10-29 21:40:26 +01:00
Trisha Lim
9d4fb4d32b Layout fix 2024-10-29 19:24:44 +00:00
Trisha Lim
d5b9544f6b Move next-themes installation to design system 2024-10-29 19:14:10 +00:00
Trisha Lim
357e6ba59f Add theme toggle to footer for gcmp 2024-10-29 19:09:42 +00:00
Trisha Lim
0aca58af1e Move theme toggle to footer 2024-10-29 19:09:41 +00:00
Trisha Lim
790caf6f0d Delete themeProvider 2024-10-29 19:09:07 +00:00
Trisha Lim
d4fbae2bf3 Add dark/light theme toggler 2024-10-29 19:09:07 +00:00
Guido D'Orsi
da3bc74fe5 Merge pull request #620 from gardencmp/feature/sync-state-resume-repro
test: add an E2E test to test the sync resumability
2024-10-29 19:15:25 +01:00
Anselm Eickhoff
a1bd53100b Merge pull request #643 from gardencmp/trishalim-jazz-437
Set default border color for dark mode
2024-10-29 17:36:52 +00:00
Trisha Lim
46d8b19918 Fix bold text color 2024-10-29 16:44:25 +00:00
Trisha Lim
8ed31452b9 Fix heading font sizes in home page 2024-10-29 16:37:01 +00:00
Trisha Lim
dfb8c3f329 Remove unnecessary border color styling 2024-10-29 16:28:26 +00:00
Trisha Lim
de0045e2ee Set default border color for dark mode 2024-10-29 15:48:59 +00:00
Anselm Eickhoff
7dfb485558 Merge pull request #641 from gardencmp/trishalim-jazz-435
Typography: styling, refactor defaults
2024-10-29 15:02:17 +00:00
Anselm Eickhoff
81ac9d0dfd Merge pull request #595 from gardencmp/trishalim-jazz-415
Add team members to team page
2024-10-29 15:02:06 +00:00
Anselm Eickhoff
1430ef6158 Merge pull request #640 from gardencmp/changeset-release/main
Version Packages
2024-10-29 14:53:58 +00:00
Trisha Lim
8759bccc02 Increase h2 font size 2024-10-29 14:40:33 +00:00
Trisha Lim
5dd0e31e2a Add text-reset util for resetting link styles 2024-10-29 14:32:50 +00:00
Trisha Lim
a2c1586d26 Use prose in hero description 2024-10-29 14:27:49 +00:00
Trisha Lim
7000698629 Move strong styling to tailwind config 2024-10-29 14:09:37 +00:00
Trisha Lim
f52511721e Use prose to style bold text 2024-10-29 13:57:57 +00:00
Trisha Lim
94e84dd5bd Dark mode styling for prose 2024-10-29 13:49:16 +00:00
Trisha Lim
ee0b1695fd Move CodeGroup component to design system 2024-10-29 12:14:42 +00:00
Trisha Lim
e338e9005b Move prose text styling into tailwind config 2024-10-29 12:08:34 +00:00
github-actions[bot]
00f2dea6ab Version Packages 2024-10-29 12:06:41 +00:00
Anselm
4fe3ae89da No-frozen-lockfile after versioning 2024-10-29 12:05:28 +00:00
Anselm
195d703e1f Use proper changeset-version script 2024-10-29 12:01:57 +00:00
Anselm
a49e3492ec Reinstall after changeset version 2024-10-29 11:57:18 +00:00
Anselm
a81846241c Add changeset for account create fix 2024-10-29 11:49:42 +00:00
Anselm
e0d62096af Add corepack to release action 2024-10-29 11:47:46 +00:00
Anselm
77ee9bc529 Add changesets release action 2024-10-29 11:46:45 +00:00
Trisha Lim
e20c4a2d76 Update Anselm's links 2024-10-29 11:18:41 +00:00
Anselm
675e72aec3 Tiny code sample fix 2024-10-29 11:12:46 +00:00
Anselm Eickhoff
8a45e6d642 Merge pull request #631 from gardencmp/feature/fix-account-create
fix(jazz-run): fix error on account create
2024-10-29 11:07:50 +00:00
Anselm Eickhoff
171565a88c Merge pull request #635 from gardencmp/trishalim-jazz-433
Change "jazz" to "Jazz"
2024-10-29 11:02:13 +00:00
Guido D'Orsi
f8945e99a9 test: add an E2E test to test the sync resumability 2024-10-28 21:52:39 +01:00
Trisha Lim
830a007a08 Add Marina's links, photos 2024-10-28 19:57:40 +00:00
Trisha Lim
3072072c60 Update home page title 2024-10-28 17:04:47 +00:00
Trisha Lim
2bb672ea20 Change "jazz" to "Jazz" 2024-10-28 16:52:29 +00:00
Trisha Lim
b6f7c61445 Add placeholder for empty image 2024-10-28 16:08:54 +00:00
Guido D'Orsi
a9af4fa0ff fix(jazz-run): fix error on account create 2024-10-28 00:04:41 +01:00
Anselm
e37369027e Fix prose 2024-10-25 13:20:55 -07:00
Anselm
47eedc4433 Merge branch 'main' into aeplay-jazz-146 2024-10-25 13:20:06 -07:00
Anselm Eickhoff
3d4c151260 Merge pull request #629 from gardencmp/hero-cleanup
pixel-level adjustments
2024-10-25 13:07:09 -07:00
Anselm
eadbb2b8e5 pixel-level adjustments 2024-10-25 13:06:22 -07:00
Anselm Eickhoff
12ab0b9ac1 Merge pull request #628 from gardencmp/hero-cleanup
Hero cleanup
2024-10-25 12:50:54 -07:00
Anselm
a723ad5e92 Better hero heading breaking 2024-10-25 12:26:22 -07:00
Anselm
a459193bbd Better hero breaking 2024-10-25 12:24:52 -07:00
Anselm
65c0eecc62 Less extreme negative margin on after diagram on mobile 2024-10-25 12:23:23 -07:00
Anselm
7f63675ee5 Fix horizontal overscroll on mobile 2024-10-25 12:20:54 -07:00
Anselm
35f236f17e Copy improvements 2024-10-25 12:07:38 -07:00
Anselm
4131754c32 Changes to hero diagram 2024-10-25 11:19:04 -07:00
Anselm Eickhoff
8ead3a7ce5 Merge pull request #625 from gardencmp/home/diagrams
Redesign diagrams
2024-10-25 08:27:54 -07:00
Trisha Lim
2aa055e164 Move "hard things.." to separate component 2024-10-25 11:48:12 +01:00
Trisha Lim
2e2e0b8dce New diagram for right side 2024-10-25 11:43:35 +01:00
Trisha Lim
42897dc211 Dark mode styling 2024-10-24 17:07:58 +01:00
Trisha Lim
d80a8f35ec Remove unused file 2024-10-24 12:48:41 +01:00
Trisha Lim
7a6dcc28b2 Redesign diagrams section 2024-10-24 12:26:06 +01:00
Anselm
3f78c011df Start sketching out CoValue schema section 2024-10-23 22:36:05 +01:00
Anselm Eickhoff
55aa159b56 Merge pull request #626 from gardencmp/home/features
Quick fix for features section being squished
2024-10-23 21:48:38 +01:00
Trisha Lim
6225427363 Rename "Sync" to "Real-time sync" 2024-10-23 21:24:45 +01:00
Trisha Lim
81d922d490 Rename "E2EE" to "E2E encryption" 2024-10-23 21:24:24 +01:00
Trisha Lim
0ba357dab7 Move auth into features section 2024-10-23 21:23:46 +01:00
Anselm Eickhoff
03b4c3cd12 new slogan 2024-10-23 21:14:10 +01:00
Anselm Eickhoff
265b2aaf83 Merge pull request #622 from gardencmp/copy/local-first-hero
Rewrite hero copy
2024-10-23 20:09:46 +01:00
Anselm
fbb22f1e9d Small fixes 2024-10-23 19:55:00 +01:00
Anselm
280e1e25e3 Minimal server-side explanation 2024-10-23 19:52:15 +01:00
Anselm
c7306a0c57 React & Next setup section (with TODOs) 2024-10-23 19:21:16 +01:00
Trisha Lim
4af29dd034 Address feedback 2024-10-23 18:37:19 +01:00
Trisha Lim
4d70862344 Address feedback 2024-10-23 18:13:15 +01:00
Anselm
d40ef934e8 Add sync-and-storage page 2024-10-23 16:52:39 +01:00
Trisha Lim
7af0b2b938 Rewrite hero copy 2024-10-23 12:15:51 +01:00
Anselm Eickhoff
49ee543b5e Merge pull request #613 from gardencmp/bsl-branch-2
Community Contribution Docs
2024-10-22 14:46:38 +01:00
Benjamin S. Leveritt
f68be96d86 Add contact address 2024-10-22 13:26:39 +01:00
Anselm Eickhoff
99721a2e56 Merge pull request #612 from gardencmp/trishalim-jazz-421
Move code samples from hero section to its own section
2024-10-22 11:22:12 +01:00
Trisha Lim
e4b6678538 Mobile adjustments, address feedback 2024-10-22 10:24:45 +01:00
Trisha Lim
bb443269c3 Remove handwritten font 2024-10-22 09:56:31 +01:00
Anselm Eickhoff
2e97deb894 Merge pull request #615 from gardencmp/gcmp/favicon
Update favicon for gcmp
2024-10-22 09:25:48 +01:00
Guido D'Orsi
cabec79dde Merge pull request #604 from gardencmp/feature/music-player-tests
test: add E2E tests on the Music Player example
2024-10-21 22:06:52 +02:00
Trisha Lim
6f9afdc2d3 Update favicon for gcmp 2024-10-21 21:00:02 +01:00
Trisha Lim
3e8d4fdd53 Update team members info 2024-10-21 20:54:11 +01:00
Trisha Lim
35d5e4b39e Add jazz cloud step 2024-10-21 18:07:25 +01:00
Benjamin S. Leveritt
aeb521e6d9 Add note about code standard tools 2024-10-21 17:45:07 +01:00
Trisha Lim
5228dc43c9 Move testimonial to design system 2024-10-21 17:16:41 +01:00
Benjamin S. Leveritt
4ba7731dce Add code of conduct 2024-10-21 17:16:25 +01:00
Trisha Lim
1afe45d2f2 Mobile view 2024-10-21 17:11:06 +01:00
Benjamin S. Leveritt
7e574191eb Add contributing guide 2024-10-21 17:08:26 +01:00
Anselm
4ac35b5b6d Hide test post 2024-10-21 17:03:16 +01:00
Trisha Lim
88a6cc132f Redesign testimonial 2024-10-21 16:42:16 +01:00
Trisha Lim
574509e83a Increase padding on diagram 2024-10-21 16:30:47 +01:00
Trisha Lim
f9ce03113e Decrease font size under "hard things.." 2024-10-21 16:20:25 +01:00
Trisha Lim
b0eda8350a Add step descriptions, testimonial 2024-10-21 15:53:39 +01:00
Trisha Lim
9cb5ea332a Move code samples to a separate section 2024-10-21 14:27:39 +01:00
Anselm Eickhoff
1f409493de Merge pull request #608 from hamirmahal/fix/usage-of-a-deprecated-nodejs-version-in-unit-test
fix: usage of `a deprecated Node.js version` in CI
2024-10-21 11:53:09 +01:00
Hamir Mahal
5ac310ff9f fix: usage of a deprecated Node.js version in CI 2024-10-20 09:44:05 -07:00
Anselm Eickhoff
9a96203f8d Merge pull request #602 from gardencmp/trishalim-jazz-419
Add blog to gcmp
2024-10-20 15:58:02 +01:00
Guido D'Orsi
5239a05734 chore: extract MusicTrackTitleInput component 2024-10-18 23:04:13 +02:00
Guido D'Orsi
4bed591002 test: add E2E tests on the Music Player example 2024-10-18 22:39:45 +02:00
Trisha Lim
aede27f986 Move meta into mdx file 2024-10-18 19:22:59 +01:00
Trisha Lim
8aeb89e878 Add jsonld to blog post 2024-10-18 19:09:31 +01:00
Trisha Lim
31cec1986b Add blog posts feed 2024-10-18 19:09:31 +01:00
Trisha Lim
d7ae755ce4 Blog post page styling 2024-10-18 19:09:31 +01:00
Trisha Lim
d425c18b9a Add blog to gcmp 2024-10-18 19:09:31 +01:00
Anselm Eickhoff
91d94abaf2 Merge pull request #599 from gardencmp/styling/input
Add Input component and prettier to design system
2024-10-18 13:15:01 +01:00
Trisha Lim
5730c933ee Add prettier to design-system project 2024-10-18 11:09:50 +01:00
Trisha Lim
68be1274bf Add input component to design system 2024-10-18 11:06:39 +01:00
Trisha Lim
e4180308ea Dark mode 2024-10-18 10:41:13 +01:00
Anselm Eickhoff
14fec451ec Merge pull request #596 from gardencmp/feature/covalue-state
chore: refactor CoValueState to manage the availability logic
2024-10-18 10:15:37 +01:00
Guido D'Orsi
916073ee2a chore: refactor CoValueState to manage the availability logic 2024-10-18 00:28:44 +02:00
Trisha Lim
2b48954693 Add team members to team page 2024-10-17 21:17:11 +01:00
Anselm Eickhoff
d789ee031f Merge pull request #594 from gardencmp/trishalim-jazz-416 2024-10-17 19:09:09 +01:00
Trisha Lim
a58a73b9f2 Fix env var possibly undefined 2024-10-17 18:16:54 +01:00
Trisha Lim
4172e9f160 Add social image 2024-10-17 18:14:53 +01:00
Trisha Lim
04baa537b9 Add newsletter subscription form using Resend 2024-10-17 18:08:14 +01:00
Anselm
4a2649c2d1 Fix homepages workspace 2024-10-17 16:10:46 +01:00
Anselm Eickhoff
0845853e42 Merge pull request #593 from gardencmp/trishalim-jazz-414
Add gcmp project
2024-10-17 15:42:58 +01:00
Trisha Lim
933be40123 Dark mode styling 2024-10-17 14:37:13 +01:00
Trisha Lim
c385b9a501 Delete files 2024-10-17 14:33:17 +01:00
Trisha Lim
2c1774dc46 Add content for blog and team pages 2024-10-17 14:27:49 +01:00
Trisha Lim
77d7b4b99d Add navigation 2024-10-17 14:20:02 +01:00
Trisha Lim
3c6dca4779 Add home page content 2024-10-17 14:01:02 +01:00
Trisha Lim
1eba3a3e92 Initialize gcmp project 2024-10-17 13:34:33 +01:00
Trisha Lim
ef30e47b4b Move logos to design system 2024-10-17 12:59:20 +01:00
Trisha Lim
384e6dd3be Move Button component to design system 2024-10-17 12:52:09 +01:00
Anselm Eickhoff
5b61efc2cc Merge pull request #587 from gardencmp/trishalim-jazz-412
Add links to live demo in readme
2024-10-17 12:14:34 +01:00
Anselm Eickhoff
2623fa465c Merge pull request #584 from gardencmp/refactor/illustration
Convert hero illustration to code instead of image
2024-10-17 11:25:54 +01:00
Anselm Eickhoff
b5c8ea8e1c Merge pull request #575 from gardencmp/Rename-Jazz-Mesh-to-Jazz-Cloud
Rename Jazz Mesh to Jazz Cloud
2024-10-17 11:24:08 +01:00
Trisha Lim
352026e8ab Move highlight to another line 2024-10-17 10:17:57 +01:00
Trisha Lim
4a56365495 Add links to live demo in readme 2024-10-17 10:13:09 +01:00
Benjamin S. Leveritt
dfed6883f8 Fix leftovers 2024-10-17 07:50:44 +01:00
Trisha Lim
4473463f4a Change "Jazz Mesh" to "Jazz Cloud" in diagram 2024-10-17 07:47:00 +01:00
Benjamin S. Leveritt
b79619dcb3 Rename Global Cloud -> Jazz Cloud 2024-10-17 07:46:21 +01:00
Benjamin S. Leveritt
fe54274ac1 Update cojson docs 2024-10-17 07:46:21 +01:00
Benjamin S. Leveritt
61c1a38ba4 Update homepage cloud section 2024-10-17 07:46:18 +01:00
Benjamin S. Leveritt
76c1341549 Update homepage urls 2024-10-17 07:45:32 +01:00
Benjamin S. Leveritt
9d1bd08b77 Rename mesh page -> cloud page 2024-10-17 07:45:29 +01:00
Benjamin S. Leveritt
6cf7b974c1 Update job templates 2024-10-17 07:44:56 +01:00
Benjamin S. Leveritt
edb030e348 Update cloud blocks in mesh docs 2024-10-17 07:44:52 +01:00
Benjamin S. Leveritt
f644fc6610 Update example readmes 2024-10-17 07:28:40 +01:00
Benjamin S. Leveritt
8c7b721903 Update wss:// urls to cloud.jazz.tools 2024-10-17 07:28:40 +01:00
Trisha Lim
6b16f7a0c3 Highlight important lines 2024-10-16 21:47:20 +01:00
Trisha Lim
f3a6c752b4 Add description 2024-10-16 21:18:48 +01:00
Trisha Lim
0e053b2d47 Install handwritten font Sriracha 2024-10-16 21:04:59 +01:00
Trisha Lim
f462139327 Convert illustration to code 2024-10-16 21:01:07 +01:00
Anselm
8e32fd8688 Release 2024-10-16 19:30:35 +01:00
Anselm Eickhoff
2066543754 Merge pull request #583 from gardencmp/aeplay-jazz-410
Fix internal imports in jazz-nodejs
2024-10-16 19:29:18 +01:00
Anselm
a251aaabea Add changeset 2024-10-16 19:23:09 +01:00
Anselm
da95d6de08 Fix internal imports in jazz-nodejs 2024-10-16 19:21:17 +01:00
Anselm Eickhoff
cb367c38c8 Merge pull request #579 from gardencmp/styling/secondary-button
Styling for secondary button
2024-10-16 16:14:37 +01:00
Anselm Eickhoff
4acefe350c Merge pull request #580 from gardencmp/trishalim-jazz-349
Set meta title, description, and image
2024-10-16 16:13:34 +01:00
Trisha Lim
db8fa169d9 Set meta title, description, and image 2024-10-16 14:09:21 +01:00
Trisha Lim
1703bc6c74 Styling for secondary button 2024-10-16 13:29:58 +01:00
Anselm
49d8287b24 Anselm's proposed structure 2024-10-16 11:41:22 +01:00
Trisha Lim
b6af85c91e Add simple public sharing 2024-10-16 11:28:34 +01:00
Trisha Lim
308ab80736 Rearrange outline 2024-10-16 11:27:51 +01:00
Trisha Lim
b759f29ab8 Increase docs body width 2024-10-16 11:09:22 +01:00
Trisha Lim
b826adabbf Show proposed outline 2024-10-16 11:00:52 +01:00
Anselm Eickhoff
7dd3d57800 Merge pull request #532 from gardencmp/anselm-jazz-378
Simplify pricing
2024-10-16 10:44:15 +01:00
Anselm
e0670a8742 Move CTA texts back under the button 2024-10-16 10:39:23 +01:00
Anselm
61f62660ca Address Trisha's feedback 2024-10-16 10:25:09 +01:00
Anselm Eickhoff
acca37fc4b Merge pull request #538 from gardencmp/trishalim-jazz-379
Redesign landing page hero
2024-10-16 10:11:15 +01:00
Anselm
88b01a14a6 Format 2024-10-16 10:09:03 +01:00
Anselm
30917c9b2e Wider gaps for tier logos 2024-10-16 10:08:50 +01:00
Anselm
4c22c75b45 Fix lockfile 2024-10-16 09:55:40 +01:00
Anselm
e9baca6781 Apply feedback 2024-10-16 09:46:39 +01:00
Anselm
46983ca49b Add missing icon 2024-10-15 17:40:49 +01:00
Anselm
c3e9790436 New iteration 2024-10-15 17:35:54 +01:00
Trisha Lim
2b4e839926 Remove empty pages from nav 2024-10-15 09:44:41 +01:00
Trisha Lim
c7aae14e03 Fix layout 2024-10-15 09:37:43 +01:00
Anselm Eickhoff
2444344929 Merge pull request #561 from gardencmp/fix-docs-typo 2024-10-15 09:21:11 +01:00
Anselm Eickhoff
d247183892 Merge pull request #472 from gardencmp/feature/react-adapter 2024-10-15 09:19:37 +01:00
pax-k
a81fe66e8f chore: docs 2024-10-14 23:28:13 +03:00
pax-k
6d43977b12 chore: docs 2024-10-14 23:24:38 +03:00
pax-k
14c00e5dd4 chore: react-native docs 2024-10-14 23:21:21 +03:00
Guido D'Orsi
be492a8184 chore(music-player): add the react-compiler linting rule 2024-10-14 22:12:50 +02:00
Guido D'Orsi
90149ac411 test: add subscribe tests 2024-10-14 20:40:08 +02:00
Guido D'Orsi
7bae6e43b7 fix(password-manager): fix infinite loop on the shared folder loading 2024-10-14 20:40:08 +02:00
Guido D'Orsi
32c2435cb1 fix(subscription): renew root value identity at each update 2024-10-14 20:40:08 +02:00
Guido D'Orsi
64feacd2c1 feat(react): migrate to useSyncExternalStore 2024-10-14 20:40:08 +02:00
Trisha Lim
263fe7a4b3 Increase container width 2024-10-14 18:44:12 +01:00
Trisha Lim
8049f1d972 Lint fix 2024-10-14 18:26:48 +01:00
Trisha Lim
f3263e60ff Add table of contents to left hand side 2024-10-14 18:24:48 +01:00
Benjamin S. Leveritt
79dd3eecb6 Fix typo, improve copy 2024-10-14 17:47:21 +01:00
Anselm
62bbe9a09b Release 2024-10-14 17:32:12 +01:00
Anselm Eickhoff
4dd80a65da Merge pull request #559 from gardencmp/expo-secure-store-for-jazz-react-native
Expo secure store for jazz react native
2024-10-14 17:30:15 +01:00
pax-k
52dd1d37ab fix(react-native): set ExpoSecureStoreAdapter values accessible AFTER_FIRST_UNLOCK 2024-10-14 19:26:05 +03:00
pax-k
b75df6fa5c chore: revert jazz-react-native-media-images bump 2024-10-14 19:03:37 +03:00
pax-k
b7639cffd3 chore: changeset 2024-10-14 19:02:52 +03:00
pax-k
21575f2e79 feat(react-native): replaced react-native-mmkv with expo-secure-store and initialize it by default as kvStore in createJazzRNApp() (BREAKING) 2024-10-14 19:00:36 +03:00
Trisha Lim
6d6849707e Move guide down 2024-10-14 16:24:58 +01:00
Trisha Lim
11ac24e3f4 Update lock file 2024-10-14 16:13:55 +01:00
Trisha Lim
7a30f3c025 Set docs intro as /docs 2024-10-14 16:13:12 +01:00
Trisha Lim
c84f96c436 Fix guide URLs 2024-10-14 16:13:12 +01:00
Trisha Lim
0ecf666c9f Refactor components 2024-10-14 16:13:12 +01:00
Trisha Lim
42e4969f92 Define new outline 2024-10-14 16:13:12 +01:00
pax-k
35587aaacc chore: bump jazz-react-native-media-images 2024-10-14 17:34:26 +03:00
Anselm
2398dedbae FIx lockfile 2024-10-14 15:30:42 +01:00
Anselm
d545a3b8d6 Release 2024-10-14 15:27:53 +01:00
Anselm Eickhoff
dce673ff7a Merge pull request #546 from gardencmp/feat/client-batching
feat: enable batching on client peers
2024-10-14 15:27:20 +01:00
pax
d18f6bf371 Merge pull request #557 from gardencmp/fix-native-peer-dependencies
Weaker native peer dependencies
2024-10-14 17:25:42 +03:00
pax-k
32b05b69a3 chore: changeset 2024-10-14 17:25:01 +03:00
pax-k
c1a5c3cad7 fix(react-native): weaker peer dependencies 2024-10-14 17:23:43 +03:00
Guido D'Orsi
e82cf3dd71 chore: add changeset 2024-10-14 14:56:34 +02:00
Guido D'Orsi
c715587a54 feat: enable batching on client peers 2024-10-14 14:31:54 +02:00
Trisha Lim
1ad823b52e Fix duplicate code 2024-10-11 16:49:09 +01:00
Trisha Lim
7dd958e920 Icon styling for dark mode 2024-10-11 16:38:44 +01:00
Trisha Lim
41d977d3b0 Illustration for dark mode 2024-10-11 16:36:58 +01:00
Trisha Lim
a9a3ad6e67 Mobile view 2024-10-11 16:17:12 +01:00
Trisha Lim
ca2bde4748 Illustration changes 2024-10-11 15:59:57 +01:00
Trisha Lim
9c3945b82a Add code samples to hero 2024-10-11 14:58:25 +01:00
Trisha Lim
86b2d98ba8 Add code snippet to the right of hero 2024-10-11 11:07:31 +01:00
Trisha Lim
bd8efcdb4d Redesign landing page hero 2024-10-11 10:27:57 +01:00
Trisha Lim
fe279ea94c Update copy 2024-10-10 19:42:51 +01:00
Trisha Lim
8481b3bf16 Styling for pricing section (#533) 2024-10-10 18:35:52 +01:00
Anselm
3311828432 Address some wording feedback 2024-10-10 17:37:28 +01:00
Anselm
f03f8dfeaa Better CTA subtext 2024-10-10 16:35:43 +01:00
Anselm
05e0b3d795 Less cringe CTA 2024-10-10 16:33:24 +01:00
Anselm
7ce08753f1 Simplify pricing 2024-10-10 16:27:33 +01:00
296 changed files with 10595 additions and 2584 deletions

51
.github/workflows/jazz-run.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Jazz Run Tests
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
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: Build jazz-run
run: pnpm exec turbo build && chmod +x dist/index.js;
working-directory: ./packages/jazz-run
- name: Run create account
run: ./dist/index.js account create --name "Jazz Run CI test"
working-directory: ./packages/jazz-run

View File

@@ -13,7 +13,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
project: ["e2e/BinaryCoStream", "e2e/CoValues", "examples/chat", "examples/pets"]
project: ["e2e/BinaryCoStream", "e2e/CoValues", "examples/chat", "examples/music-player", "examples/pets"]
steps:
- uses: actions/checkout@v3

51
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- 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: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset-version
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -13,13 +13,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
@@ -29,7 +29,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}

131
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,131 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to [the community leaders responsible for enforcement](mailto:hello@gcmp.io).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

73
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,73 @@
# Contribution Guide
Thank you for considering contributing to Jazz! Jazz is an open-source framework for building local-first apps. We value your time and effort and are excited to collaborate with you. This guide will help you get started with contributing.
## How to Contribute
### 1. Reporting Bugs
If you find a bug, please [open an issue with as much detail as possible](https://github.com/gardencmp/jazz/issues). Include:
- A clear and descriptive title.
- Steps to reproduce the issue.
- What you expected to happen.
- What actually happened.
### 2. Suggesting Enhancements
We welcome all ideas! If you have suggestions, feel free to open an issue marked with the "enhancement" label. Please provide context on why the enhancement would be beneficial and how it could be implemented.
### 3. Pull Requests
1. **Fork the repository** and create your feature branch (see [GitHub's guide on forking a repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo) if you're unfamiliar with the process):
2. **Make your changes**, ensuring that you follow our coding standards (`pnpm format` (prettier) and `pnpm lint` (eslint) will automatically let you know there are issues).
3. **Commit your changes** with a descriptive commit message.
4. **Push to your fork** and submit a pull request.
5. **Describe your pull request**, explaining the problem it solves or the enhancement it adds.
### 4. Code Style Guidelines
- We use [Prettier](https://prettier.io/) for formatting. Please ensure your code is formatted before submitting.
- Write descriptive comments where necessary.
### 5. Local Setup
1. **Clone the repository**:
```bash
git clone https://github.com/gardencmp/jazz.git
```
2. **Install dependencies**:
```bash
pnpm install
```
3. **Run tests** to verify everything is working:
```bash
pnpm test
```
### 6. Testing
Please write tests for any new features or bug fixes. We use Vitest for unit tests. Make sure all tests pass before submitting a pull request.
### 7. Communication
- If you're unsure about anything, feel free to ask questions by opening a discussion, reaching out via issues, or on our [Discord](https://discord.gg/utDMjHYg42).
- Be respectful and constructive, this is a welcoming community for everyone.
- Please be mindful of GitHubs [Community Guidelines](https://docs.github.com/en/site-policy/github-terms/github-community-guidelines), which include being kind, avoiding disruptive behavior, and respecting others.
## Code of Conduct
Please read and adhere to our [Code of Conduct](./CODE_OF_CONDUCT.md) to ensure a positive experience for all contributors.
---
Thank you again for your interest in contributing to Jazz. Your help makes this project better for everyone!
If you have any questions, don't hesitate to reach out. Let's make something great together!

View File

@@ -1,5 +1,30 @@
# @jazz-e2e/binarycostream
## 0.0.90
### Patch Changes
- Updated dependencies [6ed75eb]
- Updated dependencies [3cc6aee]
- cojson@0.8.12
- jazz-react@0.8.12
- jazz-tools@0.8.12
## 0.0.89
### Patch Changes
- Updated dependencies [1ed4ab5]
- cojson@0.8.11
- jazz-react@0.8.11
- jazz-tools@0.8.11
## 0.0.88
### Patch Changes
- jazz-react@0.8.7
## 0.0.87
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@jazz-e2e/binarycostream",
"private": true,
"version": "0.0.87",
"version": "0.0.90",
"type": "module",
"scripts": {
"dev": "vite",
@@ -14,11 +14,11 @@
"*.{js,jsx,mdx,json}": "prettier --write"
},
"dependencies": {
"cojson": "workspace:0.8.5",
"cojson": "workspace:0.8.12",
"hash-slash": "workspace:0.2.1",
"is-ci": "^3.0.1",
"jazz-react": "workspace:0.8.6",
"jazz-tools": "workspace:0.8.5",
"jazz-react": "workspace:0.8.12",
"jazz-tools": "workspace:0.8.12",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},

View File

@@ -27,10 +27,11 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: isCI ? "http://localhost:4173/" : "http://localhost:5173",
baseURL: "http://localhost:5173/",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
permissions: ["clipboard-read", "clipboard-write"],
},
/* Configure projects for major browsers */
@@ -42,8 +43,11 @@ export default defineConfig({
],
/* Run your local dev server before starting the tests */
webServer: isCI ? {
command: "pnpm preview",
url: "http://localhost:4173/",
} : undefined,
webServer: [
{
command: "pnpm preview --port 5173",
url: "http://localhost:5173/",
reuseExistingServer: !isCI,
},
],
});

View File

@@ -28,7 +28,7 @@ export function AuthAndJazz({ children }: { children: React.ReactNode }) {
<Jazz.Provider auth={auth} peer={
localSync
? `ws://localhost:4200?key=${key}`
: `wss://mesh.jazz.tools/?key=${key}`
: `wss://cloud.jazz.tools/?key=${key}`
}>
{children}
</Jazz.Provider>

View File

@@ -1,5 +1,30 @@
# @jazz-e2e/covalues
## 0.0.89
### Patch Changes
- Updated dependencies [6ed75eb]
- Updated dependencies [3cc6aee]
- cojson@0.8.12
- jazz-react@0.8.12
- jazz-tools@0.8.12
## 0.0.88
### Patch Changes
- Updated dependencies [1ed4ab5]
- cojson@0.8.11
- jazz-react@0.8.11
- jazz-tools@0.8.11
## 0.0.87
### Patch Changes
- jazz-react@0.8.7
## 0.0.86
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@jazz-e2e/covalues",
"private": true,
"version": "0.0.86",
"version": "0.0.89",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -27,10 +27,11 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: isCI ? "http://localhost:4173/" : "http://localhost:5173",
baseURL: "http://localhost:5173/",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
permissions: ["clipboard-read", "clipboard-write"],
},
/* Configure projects for major browsers */
@@ -42,8 +43,11 @@ export default defineConfig({
],
/* Run your local dev server before starting the tests */
webServer: isCI ? {
command: "pnpm preview",
url: "http://localhost:4173/",
} : undefined,
webServer: [
{
command: "pnpm preview --port 5173",
url: "http://localhost:5173/",
reuseExistingServer: !isCI,
},
],
});

View File

@@ -2,15 +2,20 @@ import React from "react";
import ReactDOM from "react-dom/client";
import { AuthAndJazz } from "./jazz";
import { TestInput } from "./pages/TestInput";
import { RouterProvider, createHashRouter } from "react-router-dom";
import { ResumeSyncState } from "./pages/ResumeSyncState";
import { RouterProvider, createBrowserRouter } from "react-router-dom";
const router = createHashRouter([
const router = createBrowserRouter([
{
path: "/",
path: "/test-input",
element: <TestInput />,
},
{
path: "/test-input",
path: "/resume-sync",
element: <ResumeSyncState />,
},
{
path: "/",
element: <TestInput />,
},
]);

View File

@@ -1,25 +1,43 @@
import { createJazzReactApp } from "jazz-react";
import { ephemeralCredentialsAuth } from "jazz-tools";
import { useState } from "react";
import { createJazzReactApp, useDemoAuth } from "jazz-react";
import { useEffect, useRef } from "react";
const key = `test-comap@jazz.tools`;
const localSync = new URLSearchParams(location.search).has("localSync");
const url = new URL(window.location.href);
const peer =
(url.searchParams.get("peer") as `ws://${string}`) ??
`wss://cloud.jazz.tools/`;
const Jazz = createJazzReactApp();
export const { useAccount, useCoState } = Jazz;
export function AuthAndJazz({ children }: { children: React.ReactNode }) {
const [ephemeralAuth] = useState(ephemeralCredentialsAuth())
return (
<Jazz.Provider auth={ephemeralAuth} peer={
localSync
? `ws://localhost:4200?key=${key}`
: `wss://mesh.jazz.tools/?key=${key}`
}>
{children}
</Jazz.Provider>
);
function getUserInfo() {
return url.searchParams.get("userName") ?? "Mister X";
}
export function AuthAndJazz({ children }: { children: React.ReactNode }) {
const [auth, state] = useDemoAuth();
const signedUp = useRef(false);
useEffect(() => {
if (state.state === "ready" && !signedUp.current) {
const userName = getUserInfo();
if (state.existingUsers.includes(userName)) {
state.logInAs(userName);
} else {
state.signUp(userName);
}
signedUp.current = true;
}
}, [state.state]);
return (
<Jazz.Provider auth={auth} peer={`${peer}?key=${key}`}>
{children}
</Jazz.Provider>
);
}

View File

@@ -0,0 +1,53 @@
import { co, CoMap, Group, ID } from "jazz-tools";
import { useAccount, useCoState } from "../jazz";
import { useEffect, useState } from "react";
export class ResumeSyncCoMap extends CoMap {
value = co.string;
}
function getIdParam() {
const url = new URL(window.location.href);
return (url.searchParams.get("id") as ID<ResumeSyncCoMap>) ?? undefined;
}
export function ResumeSyncState() {
const [id, setId] = useState(getIdParam);
const coMap = useCoState(ResumeSyncCoMap, id);
const { me } = useAccount();
useEffect(() => {
if (id) {
const url = new URL(window.location.href);
url.searchParams.set("id", id);
history.pushState({}, "", url.toString());
}
}, [id])
useEffect(() => {
if (!me || id) return;
const group = Group.create({ owner: me });
group.addMember("everyone", "writer");
setId(ResumeSyncCoMap.create({ value: "" }, { owner: group }).id);
}, [me]);
if (!coMap) return null;
return (
<div>
<h1>Resume Sync State</h1>
<p data-testid="id">{coMap.id}</p>
<label htmlFor="value">Value</label>
<input
id="value"
value={coMap.value ?? ""}
onChange={(e) => {
coMap.value = e.target.value;
}}
/>
</div>
);
}

View File

@@ -0,0 +1,47 @@
import { test, expect } from "@playwright/test";
import { setTimeout } from "node:timers/promises";
test.describe("ResumeSyncState", () => {
test.skip("should resume the sync even after a page reload", async ({ page, browser }) => {
const context = page.context();
await page.goto("/resume-sync?userName=SuperMario");
const id = await page.getByTestId("id").textContent();
// Sync an initial value
await page.getByRole("textbox", { name: "Value" }).fill("Let's go!");
await setTimeout(1000);
await context.setOffline(true);
// Change the value while offline
await page.getByRole("textbox", { name: "Value" }).fill("Mammamia!");
// Navigate away from the page
await page.goto(`about:blank`);
await setTimeout(1000);
await context.setOffline(false);
// Reload the page but without loading the coValue
// await page.goto(`/resume-sync?userName=SuperMario`);
await page.goto(`/resume-sync?userName=SuperMario`);
await setTimeout(1000);
await expect(page.getByTestId("id")).toBeInViewport();
// Create a new incognito instance and try to load the coValue
const newUserPage = await (await browser.newContext()).newPage();
await newUserPage.goto(`/resume-sync?userName=Luigi&id=${id}`);
await expect(newUserPage.getByTestId("id")).toBeInViewport();
// The initial user should have synced the value even if the coValue was not loaded
// when the user is back online
await expect(newUserPage.getByRole("textbox", { name: "Value" })).toHaveValue("Mammamia!", {
timeout: 20_000
});
});
});

View File

@@ -1,5 +1,29 @@
# jazz-example-book-shelf
## 0.1.5
### Patch Changes
- Updated dependencies [3cc6aee]
- jazz-react@0.8.12
- jazz-tools@0.8.12
- jazz-browser-media-images@0.8.12
## 0.1.4
### Patch Changes
- jazz-react@0.8.11
- jazz-tools@0.8.11
- jazz-browser-media-images@0.8.11
## 0.1.3
### Patch Changes
- jazz-browser-media-images@0.8.7
- jazz-react@0.8.7
## 0.1.2
### Patch Changes

View File

@@ -1,5 +1,7 @@
# Jazz Book Shelf Example
Live version: [https://books-demo.jazz.tools](https://books-demo.jazz.tools)
## Installing & running the example locally
(this requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
@@ -36,6 +38,6 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
## Configuration: sync server
By default, the example app uses [Jazz Global Mesh](https://jazz.tools/mesh) (`wss://sync.jazz.tools`) - so cross-device use, invites and collaboration should just work.
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/components/JazzAndAuth.tsx](./src/2_main.tsx).

View File

@@ -14,7 +14,7 @@ job "example-bookShelf$BRANCH_SUFFIX" {
constraint {
attribute = "${node.class}"
operator = "="
value = "mesh"
value = "cloud"
}
spread {

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-example-book-shelf",
"version": "0.1.2",
"version": "0.1.5",
"private": true,
"scripts": {
"dev": "next dev",
@@ -11,9 +11,9 @@
},
"dependencies": {
"clsx": "^2.0.0",
"jazz-browser-media-images": "workspace:0.8.6",
"jazz-react": "workspace:0.8.6",
"jazz-tools": "workspace:0.8.5",
"jazz-browser-media-images": "workspace:0.8.12",
"jazz-react": "workspace:0.8.12",
"jazz-tools": "workspace:0.8.12",
"next": "14.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"

View File

@@ -17,7 +17,7 @@ export function JazzAndAuth({ children }: { children: React.ReactNode }) {
<Jazz.Provider
auth={auth}
// replace `you@example.com` with your email as a temporary API key
peer="wss://mesh.jazz.tools/?key=you@example.com"
peer="wss://cloud.jazz.tools/?key=you@example.com"
>
{children}
</Jazz.Provider>

View File

@@ -1,5 +1,33 @@
# jazz-example-chat
## 0.0.89
### Patch Changes
- Updated dependencies [6ed75eb]
- Updated dependencies [3cc6aee]
- cojson@0.8.12
- jazz-react@0.8.12
- jazz-react-auth-clerk@0.8.12
- jazz-tools@0.8.12
## 0.0.88
### Patch Changes
- Updated dependencies [1ed4ab5]
- cojson@0.8.11
- jazz-react@0.8.11
- jazz-react-auth-clerk@0.8.11
- jazz-tools@0.8.11
## 0.0.87
### Patch Changes
- jazz-react@0.8.7
- jazz-react-auth-clerk@0.8.7
## 0.0.86
### Patch Changes

View File

@@ -1,6 +1,6 @@
# Jazz Chat Example (with Clerk auth)
<!-- Live version: [https://chat-clerk.jazz.tools](https://chat-clerk.jazz.tools) -->
Live version: [https://chat-clerk-demo.jazz.tools](https://chat-clerk-demo.jazz.tools)
## Installing & running the example locally
@@ -37,6 +37,6 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
## Configuration: sync server
By default, the example app uses [Jazz Global Mesh](https://jazz.tools/mesh) (`wss://sync.jazz.tools`) - so cross-device use, invites and collaboration should just work.
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/2_main.tsx](./src/2_main.tsx).

View File

@@ -14,7 +14,7 @@ job "chat$BRANCH_SUFFIX" {
constraint {
attribute = "${node.class}"
operator = "="
value = "mesh"
value = "cloud"
}
spread {

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat-clerk",
"private": true,
"version": "0.0.86",
"version": "0.0.89",
"type": "module",
"scripts": {
"dev": "vite",
@@ -21,11 +21,11 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.8.5",
"cojson": "workspace:0.8.12",
"hash-slash": "workspace:0.2.1",
"jazz-react": "workspace:0.8.6",
"jazz-react-auth-clerk": "workspace:0.8.6",
"jazz-tools": "workspace:0.8.5",
"jazz-react": "workspace:0.8.12",
"jazz-react-auth-clerk": "workspace:0.8.12",
"jazz-tools": "workspace:0.8.12",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.2.0",

View File

@@ -21,7 +21,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
{auth ? (
<Jazz.Provider
auth={auth}
peer="wss://mesh.jazz.tools/?key=chat-example-jazz-clerk@gcmp.io"
peer="wss://cloud.jazz.tools/?key=chat-example-jazz-clerk@gcmp.io"
>
{children}
</Jazz.Provider>

View File

@@ -1,5 +1,40 @@
# chat-rn-clerk
## 1.0.5
### Patch Changes
- jazz-react-auth-clerk@0.8.12
- jazz-react-native@0.8.12
- jazz-tools@0.8.12
- jazz-react-native-media-images@0.8.8
## 1.0.4
### Patch Changes
- jazz-react-auth-clerk@0.8.11
- jazz-react-native@0.8.11
- jazz-tools@0.8.11
- jazz-react-native-media-images@0.8.7
## 1.0.3
### Patch Changes
- b7639cf: feat(react-native): replaced react-native-mmkv with expo-secure-store and initialize it by default as kvStore in createJazzRNApp() (BREAKING)
- Updated dependencies [b7639cf]
- jazz-react-native@0.8.8
## 1.0.2
### Patch Changes
- Updated dependencies [32b05b6]
- jazz-react-native-media-images@0.8.6
- jazz-react-native@0.8.7
- jazz-react-auth-clerk@0.8.7
## 1.0.1
### Patch Changes

View File

@@ -1,76 +1,24 @@
<p align="center">
<a href="https://clerk.com?utm_source=github&utm_medium=clerk_docs" target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./assets/images/light-logo.png">
<img alt="Clerk Logo for light background" src="./assets/images/dark-logo.png" height="64">
</picture>
</a>
<br />
</p>
<div align="center">
<h1>
Clerk and Expo Quickstart
</h1>
<a href="https://www.npmjs.com/package/@clerk/clerk-js">
<img alt="Downloads" src="https://img.shields.io/npm/dm/@clerk/clerk-js" />
</a>
<a href="https://discord.com/invite/b5rXHjAg7A">
<img alt="Discord" src="https://img.shields.io/discord/856971667393609759?color=7389D8&label&logo=discord&logoColor=ffffff" />
</a>
<a href="https://twitter.com/clerkdev">
<img alt="Twitter" src="https://img.shields.io/twitter/url.svg?label=%40clerkdev&style=social&url=https%3A%2F%2Ftwitter.com%2Fclerkdev" />
</a>
<br />
<br />
<img alt="Clerk Hero Image" src="./assets/images/hero.png">
</div>
# 🎷 Jazz + Expo + `expo-router` + Clerk Auth
## Introduction
## 🚀 How to Run
Clerk is a developer-first authentication and user management solution. It provides pre-built React components and hooks for sign-in, sign-up, user profile, and organization management. Clerk is designed to be easy to use and customize, and can be dropped into any React or Next.js application.
### 1. Inside the Workspace Root
After following the quickstart you'll have learned how to:
- Install `@clerk/clerk-expo`
- Setup your environment key
- Wrap your Expo app in `<ClerkProvider />` and supply your `tokenCache`
- Conditionally show content based on your auth state
- Build your sign-in and sign-up pages
## Running the template
First, install dependencies and build the project:
```bash
git clone https://github.com/clerk/clerk-expo-quickstart
pnpm i
pnpm run build
```
To run the example locally, you'll need to make sure you have XCode installed and configured properly, then:
### 2. Inside the `examples/chat-rn-clerk` Directory
1. Sign up for a Clerk account at [https://clerk.com](https://dashboard.clerk.com/sign-up?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=10-24-2023&utm_term=clerk-expo-quickstart).
Next, navigate to the specific example project and run the following commands:
2. Go to the [Clerk dashboard](https://dashboard.clerk.com?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=10-24-2023&utm_term=clerk-expo-quickstart) and create an application.
```bash
pnpm expo prebuild
npx pod-install
pnpm expo run:ios
```
3. Set the required Clerk environment variable as shown in [the example `env` file](./.env.example).
4. `npm install` the required dependencies.
5. `npm run start` to launch the development server.
## Learn more
To learn more about Clerk and Expo, check out the following resources:
- [Quickstart: Get started with Expo and Clerk](https://clerk.com/docs/quickstarts/expo?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=10-24-2023&utm_term=clerk-expo-quickstart)
- [Clerk Documentation](https://clerk.com/docs/references/expo/overview?utm_source=DevRel&utm_medium=docs&utm_campaign=templates&utm_content=10-24-2023&utm_term=clerk-expo-quickstart)
- [Expo Documentation](https://docs.expo.dev/)
## Found an issue or want to leave feedback
Feel free to create a support thread on our [Discord](https://clerk.com/discord). Our support team will be happy to assist you in the `#support` channel.
## Connect with us
You can discuss ideas, ask questions, and meet others from the community in our [Discord](https://discord.com/invite/b5rXHjAg7A).
If you prefer, you can also find support through our [Twitter](https://twitter.com/ClerkDev), or you can [email](mailto:support@clerk.dev) us!
This will set up and launch the app on iOS. For Android, you can replace the last command with `pnpm expo run:android`.

View File

@@ -1,45 +1,46 @@
{
"expo": {
"name": "jazz-chat-rn-clerk",
"scheme": "jazz-chat-rn-clerk",
"slug": "jazz-chat-rn-clerk",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.jazz.chatrnclerk"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.jazz.chatrnclerk"
},
"plugins": [
[
"expo-build-properties",
{
"ios": {
"newArchEnabled": true
},
"android": {
"newArchEnabled": true
}
}
]
],
"extra": {
"eas": {
"projectId": "ca3d46e5-a10a-47ec-9d77-3b841e1c62d4"
}
"expo": {
"name": "jazz-chat-rn-clerk",
"scheme": "jazz-chat-rn-clerk",
"slug": "jazz-chat-rn-clerk",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.jazz.chatrnclerk"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.jazz.chatrnclerk"
},
"plugins": [
[
"expo-build-properties",
{
"ios": {
"newArchEnabled": true
},
"android": {
"newArchEnabled": true
}
}
],
"expo-secure-store"
],
"extra": {
"eas": {
"projectId": "ca3d46e5-a10a-47ec-9d77-3b841e1c62d4"
}
}
}
}

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-clerk",
"main": "index.js",
"version": "1.0.1",
"version": "1.0.5",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",

View File

@@ -49,7 +49,7 @@ export function JazzAndAuth({ children }: PropsWithChildren) {
{auth ? (
<Jazz.Provider
auth={auth}
peer="wss://mesh.jazz.tools/?key=chat-rn-clerk-example-jazz@gcmp.io"
peer="wss://cloud.jazz.tools/?key=chat-rn-clerk-example-jazz@gcmp.io"
storage={undefined}
>
{children}

View File

@@ -1,7 +1,4 @@
import { createJazzRNApp } from "jazz-react-native";
import { MMKVStorage } from "./mmkv-storage";
const nativeStorage = new MMKVStorage();
export const Jazz = createJazzRNApp({ nativeStorage });
export const Jazz = createJazzRNApp();
export const { useAccount, useCoState, useAcceptInvite } = Jazz;

View File

@@ -1,25 +0,0 @@
import { MMKV } from "react-native-mmkv";
import type { NativeStorage } from "jazz-react-native";
const storage = new MMKV();
export class MMKVStorage implements NativeStorage {
get(key: string): Promise<string | undefined> {
return Promise.resolve(storage.getString(key));
}
set(key: string, value: string): Promise<void> {
storage.set(key, value);
return Promise.resolve();
}
delete(key: string): Promise<void> {
storage.delete(key);
return Promise.resolve();
}
clearAll(): Promise<void> {
storage.clearAll();
return Promise.resolve();
}
}

View File

@@ -1 +0,0 @@
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_ZXZpZGVudC1kYW5lLTg5LmNsZXJrLmFjY291bnRzLmRldiQ

View File

@@ -1,5 +1,34 @@
# chat-rn
## 1.0.7
### Patch Changes
- jazz-react-native@0.8.12
- jazz-tools@0.8.12
## 1.0.6
### Patch Changes
- jazz-react-native@0.8.11
- jazz-tools@0.8.11
## 1.0.5
### Patch Changes
- b7639cf: feat(react-native): replaced react-native-mmkv with expo-secure-store and initialize it by default as kvStore in createJazzRNApp() (BREAKING)
- Updated dependencies [b7639cf]
- jazz-react-native@0.8.8
## 1.0.4
### Patch Changes
- Updated dependencies [32b05b6]
- jazz-react-native@0.8.7
## 1.0.3
### Patch Changes

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.3",
"version": "1.0.7",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",
@@ -23,6 +23,7 @@
"expo-crypto": "~13.0.2",
"expo-dev-client": "~4.0.28",
"expo-linking": "~6.3.1",
"expo-secure-store": "~13.0.2",
"expo-status-bar": "~1.12.1",
"expo-web-browser": "~13.0.3",
"jazz-react-native": "workspace:*",

View File

@@ -51,7 +51,7 @@ function App() {
<StrictMode>
<Jazz.Provider
auth={auth}
peer="wss://mesh.jazz.tools/?key=chat-rn-example-jazz@gcmp.io"
peer="wss://cloud.jazz.tools/?key=chat-rn-example-jazz@gcmp.io"
storage={undefined}
>
<NavigationContainer linking={linking} ref={navigationRef}>

View File

@@ -1,7 +1,4 @@
import { createJazzRNApp } from "jazz-react-native";
import { MMKVStorage } from "./mmkv-storage";
const nativeStorage = new MMKVStorage();
export const Jazz = createJazzRNApp({ nativeStorage });
export const Jazz = createJazzRNApp();
export const { useAccount, useCoState, useAcceptInvite } = Jazz;

View File

@@ -1,25 +0,0 @@
import { MMKV } from "react-native-mmkv";
import type { NativeStorage } from "jazz-react-native";
const storage = new MMKV();
export class MMKVStorage implements NativeStorage {
get(key: string): Promise<string | undefined> {
return Promise.resolve(storage.getString(key));
}
set(key: string, value: string): Promise<void> {
storage.set(key, value);
return Promise.resolve();
}
delete(key: string): Promise<void> {
storage.delete(key);
return Promise.resolve();
}
clearAll(): Promise<void> {
storage.clearAll();
return Promise.resolve();
}
}

View File

@@ -1,5 +1,30 @@
# jazz-example-chat
## 0.0.91
### Patch Changes
- Updated dependencies [6ed75eb]
- Updated dependencies [3cc6aee]
- cojson@0.8.12
- jazz-react@0.8.12
- jazz-tools@0.8.12
## 0.0.90
### Patch Changes
- Updated dependencies [1ed4ab5]
- cojson@0.8.11
- jazz-react@0.8.11
- jazz-tools@0.8.11
## 0.0.89
### Patch Changes
- jazz-react@0.8.7
## 0.0.88
### Patch Changes

View File

@@ -37,6 +37,6 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
## Configuration: sync server
By default, the example app uses [Jazz Global Mesh](https://jazz.tools/mesh) (`wss://sync.jazz.tools`) - so cross-device use, invites and collaboration should just work.
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/2_main.tsx](./src/2_main.tsx).

View File

@@ -14,7 +14,7 @@ job "chat$BRANCH_SUFFIX" {
constraint {
attribute = "${node.class}"
operator = "="
value = "mesh"
value = "cloud"
}
spread {

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.88",
"version": "0.0.91",
"type": "module",
"scripts": {
"dev": "vite",
@@ -22,10 +22,10 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.8.5",
"cojson": "workspace:0.8.12",
"hash-slash": "workspace:0.2.1",
"jazz-react": "workspace:0.8.6",
"jazz-tools": "workspace:0.8.5",
"jazz-react": "workspace:0.8.12",
"jazz-tools": "workspace:0.8.12",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.2.0",

View File

@@ -27,7 +27,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: isCI ? "http://localhost:4173/" : "http://localhost:5173",
baseURL: "http://localhost:5173/",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
@@ -43,8 +43,11 @@ export default defineConfig({
],
/* Run your local dev server before starting the tests */
webServer: isCI ? {
command: "pnpm preview",
url: "http://localhost:4173/",
} : undefined,
webServer: [
{
command: "pnpm preview --port 5173",
url: "http://localhost:5173/",
reuseExistingServer: !isCI,
},
],
});

View File

@@ -13,7 +13,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
<>
<Jazz.Provider
auth={auth}
peer="wss://mesh.jazz.tools/?key=chat-example-jazz@gcmp.io"
peer="wss://cloud.jazz.tools/?key=chat-example-jazz@gcmp.io"
>
{children}
</Jazz.Provider>

View File

@@ -1,5 +1,28 @@
# jazz-example-inspector
## 0.0.67
### Patch Changes
- Updated dependencies [6ed75eb]
- cojson@0.8.12
- cojson-transport-ws@0.8.12
## 0.0.66
### Patch Changes
- Updated dependencies [1ed4ab5]
- cojson@0.8.11
- cojson-transport-ws@0.8.11
## 0.0.65
### Patch Changes
- Updated dependencies [e82cf3d]
- cojson-transport-ws@0.8.7
## 0.0.64
### Patch Changes

View File

@@ -14,7 +14,7 @@ job "inspector$BRANCH_SUFFIX" {
constraint {
attribute = "${node.class}"
operator = "="
value = "mesh"
value = "cloud"
}
spread {

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector",
"private": true,
"version": "0.0.64",
"version": "0.0.67",
"type": "module",
"scripts": {
"dev": "vite",
@@ -15,8 +15,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.8.5",
"cojson-transport-ws": "workspace:0.8.6",
"cojson": "workspace:0.8.12",
"cojson-transport-ws": "workspace:0.8.12",
"hash-slash": "workspace:0.2.1",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",

View File

@@ -61,8 +61,8 @@ export default function CoJsonViewerApp() {
WasmCrypto.create().then(async (crypto) => {
const wsPeer = createWebSocketPeer({
id: "mesh",
websocket: new WebSocket("wss://mesh.jazz.tools"),
id: "cloud",
websocket: new WebSocket("wss://cloud.jazz.tools"),
role: "server",
});
const node = await LocalNode.withLoadedAccount({

View File

@@ -9,11 +9,12 @@ module.exports = {
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
plugins: ['react-refresh', "eslint-plugin-react-compiler"],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
"react-compiler/react-compiler": "error"
},
}

View File

@@ -22,3 +22,10 @@ dist-ssr
*.njsproj
*.sln
*.sw?
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
sync-db/

View File

@@ -1,5 +1,26 @@
# jazz-example-musicplayer
## 0.0.11
### Patch Changes
- Updated dependencies [3cc6aee]
- jazz-react@0.8.12
- jazz-tools@0.8.12
## 0.0.10
### Patch Changes
- jazz-react@0.8.11
- jazz-tools@0.8.11
## 0.0.9
### Patch Changes
- jazz-react@0.8.7
## 0.0.8
### Patch Changes

View File

@@ -37,6 +37,6 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
## Configuration: sync server
By default, the example app uses [Jazz Global Mesh](https://jazz.tools/mesh) (`wss://sync.jazz.tools`) - so cross-device use, invites and collaboration should just work.
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).

View File

@@ -14,7 +14,7 @@ job "example-musicPlayer$BRANCH_SUFFIX" {
constraint {
attribute = "${node.class}"
operator = "="
value = "mesh"
value = "cloud"
}
spread {

View File

@@ -1,14 +1,16 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.8",
"version": "0.0.11",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"format": "prettier --write './src/**/*.{ts,tsx}'",
"preview": "vite preview"
"preview": "vite preview",
"test": "playwright test",
"test:ui": "playwright test --ui"
},
"lint-staged": {
"*.{ts,tsx}": "eslint --fix",
@@ -20,8 +22,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-react": "workspace:0.8.6",
"jazz-tools": "workspace:0.8.5",
"jazz-react": "workspace:0.8.12",
"jazz-tools": "workspace:0.8.12",
"lucide-react": "^0.274.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@@ -31,6 +33,7 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@types/react": "^18.2.19",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.2.1",
@@ -38,6 +41,7 @@
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.14",
"eslint": "^8.46.0",
"eslint-plugin-react-compiler": "0.0.0-experimental-fa06e2c-20241014",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"postcss": "^8.4.27",

View File

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

View File

@@ -66,7 +66,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
(new URL(window.location.href).searchParams.get(
"peer",
) as `ws://${string}`) ??
"wss://mesh.jazz.tools/?key=music-player-example-jazz@gcmp.io";
"wss://cloud.jazz.tools/?key=music-player-example-jazz@gcmp.io";
return (
<>

View File

@@ -11,6 +11,8 @@ import { ID } from "jazz-tools";
import { Playlist } from "./1_schema";
import { createInviteLink } from "jazz-react";
import { useToast } from "@/hooks/use-toast"
import { PlaylistTitleInput } from "./components/PlaylistTitleInput";
import { LogoutButton } from "./components/LogoutButton";
export function HomePage({ mediaPlayer }: { mediaPlayer: MediaPlayer }) {
/**
@@ -57,14 +59,6 @@ export function HomePage({ mediaPlayer }: { mediaPlayer: MediaPlayer }) {
const isPlaylistOwner = playlist?._owner.myRole() === "admin";
const isActivePlaylist = playlistId === me?.root.activePlaylist?.id;
const handlePlaylistTitleChange = (
evt: React.ChangeEvent<HTMLInputElement>,
) => {
if (!playlist) return;
playlist.title = evt.target.value;
};
const handlePlaylistShareClick = async () => {
if (!isPlaylistOwner) return;
@@ -88,12 +82,7 @@ export function HomePage({ mediaPlayer }: { mediaPlayer: MediaPlayer }) {
All tracks
</h1>
) : (
<input
value={playlist?.title ?? ""}
onChange={handlePlaylistTitleChange}
className="text-2xl font-bold text-blue-800 bg-transparent"
disabled={!isPlaylistOwner}
/>
<PlaylistTitleInput playlistId={playlistId} />
)}
<div className="flex items-center space-x-4">
{isRootPlaylist && (
@@ -104,7 +93,7 @@ export function HomePage({ mediaPlayer }: { mediaPlayer: MediaPlayer }) {
Add file
</FileUploadButton>
<Button onClick={handleCreatePlaylist}>
Create new playlist
New playlist
</Button>
</>
)}
@@ -113,6 +102,7 @@ export function HomePage({ mediaPlayer }: { mediaPlayer: MediaPlayer }) {
Share playlist
</Button>
)}
<LogoutButton />
</div>
</div>
<ul className="flex flex-col">

View File

@@ -128,3 +128,19 @@ export async function addTrackToPlaylist(
playlist.tracks?.push(trackClone);
}
export async function updatePlaylistTitle(playlist: Playlist, title: string) {
playlist.title = title;
}
export async function updateMusicTrackTitle(track: MusicTrack, title: string) {
track.title = title;
}
export async function updateActivePlaylist(playlist: Playlist, me: MusicaAccount) {
me.root!.activePlaylist = playlist ?? me.root!.rootPlaylist;
}
export async function updateActiveTrack(track: MusicTrack, me: MusicaAccount) {
me.root!.activeTrack = track;
}

View File

@@ -5,6 +5,7 @@ import { MusicTrack, Playlist } from "@/1_schema";
import { useRef, useState } from "react";
import { getNextTrack, getPrevTrack } from "./lib/getters";
import { BinaryCoStream, ID } from "jazz-tools";
import { updateActivePlaylist, updateActiveTrack } from "./4_actions";
export function useMediaPlayer() {
const { me } = useAccount();
@@ -39,7 +40,7 @@ export function useMediaPlayer() {
return;
}
me.root.activeTrack = track;
updateActiveTrack(track, me);
await playMedia(file);
@@ -52,7 +53,7 @@ export function useMediaPlayer() {
const track = await getNextTrack(me);
if (track) {
me.root.activeTrack = track;
updateActiveTrack(track, me);
await loadTrack(track);
}
}
@@ -78,7 +79,7 @@ export function useMediaPlayer() {
return;
}
me.root.activePlaylist = playlist ?? me.root.rootPlaylist;
updateActivePlaylist(playlist!, me);
await loadTrack(track);

View File

@@ -0,0 +1,12 @@
import { Button } from "./ui/button";
import { useAccount } from "@/2_main";
export function LogoutButton() {
const { logOut } = useAccount();
return (
<Button onClick={logOut}>
Logout
</Button>
);
}

View File

@@ -7,11 +7,11 @@ import {
DropdownMenuItem,
} from "@/components/ui/dropdown-menu";
import { MoreHorizontal } from "lucide-react";
import { ChangeEvent } from "react";
import { Button } from "./ui/button";
import { useAccount, useCoState } from "@/2_main";
import { addTrackToPlaylist } from "@/4_actions";
import { ID } from "jazz-tools";
import { MusicTrackTitleInput } from "./MusicTrackTitleInput";
export function MusicTrackRow({
trackId,
@@ -28,11 +28,6 @@ export function MusicTrackRow({
}) {
const track = useCoState(MusicTrack, trackId);
function handleTrackTitleChange(evt: ChangeEvent<HTMLInputElement>) {
if (!track) return;
track.title = evt.target.value;
}
const { me } = useAccount({
root: {
playlists: [{}],
@@ -64,6 +59,7 @@ export function MusicTrackRow({
!isPlaying && "group-hover:bg-slate-300 rounded-full",
)}
onClick={handleTrackClick}
aria-label={`${isPlaying ? "Pause" : "Play"} ${track?.title}`}
>
{isLoading ? (
<div className="animate-spin">߷</div>
@@ -73,25 +69,12 @@ export function MusicTrackRow({
"▶️"
)}
</button>
<div
className="relative flex-grow"
onClick={(evt) => evt.stopPropagation()}
>
<input
className="absolute w-full h-full left-0 bg-transparent px-1"
value={track?.title}
onChange={handleTrackTitleChange}
spellCheck="false"
/>
<span className="opacity-0 px-1 w-fit pointer-events-none whitespace-pre">
{track?.title}
</span>
</div>
<MusicTrackTitleInput trackId={trackId} />
<div onClick={(evt) => evt.stopPropagation()}>
{showAddToPlaylist && (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" className="h-8 w-8 p-0">
<Button variant="ghost" className="h-8 w-8 p-0" aria-label={`Open ${track?.title} menu`}>
<span className="sr-only">Open menu</span>
<MoreHorizontal className="h-4 w-4" />
</Button>

View File

@@ -0,0 +1,52 @@
import { MusicTrack } from "@/1_schema";
import { useCoState } from "@/2_main";
import { updateMusicTrackTitle } from "@/4_actions";
import { ID } from "jazz-tools";
import { ChangeEvent, useState } from "react";
export function MusicTrackTitleInput({
trackId,
}: {
trackId: ID<MusicTrack> | undefined;
}) {
const track = useCoState(MusicTrack, trackId);
const [isEditing, setIsEditing] = useState(false);
const [localTrackTitle, setLocalTrackTitle] = useState("");
function handleTitleChange(evt: ChangeEvent<HTMLInputElement>) {
setLocalTrackTitle(evt.target.value);
}
function handleFoucsIn() {
setIsEditing(true);
setLocalTrackTitle(track?.title ?? "");
}
function handleFocusOut() {
setIsEditing(false);
setLocalTrackTitle("");
track && updateMusicTrackTitle(track, localTrackTitle);
}
const inputValue = isEditing ? localTrackTitle : track?.title ?? "";
return (
<div
className="relative flex-grow"
onClick={(evt) => evt.stopPropagation()}
>
<input
className="absolute w-full h-full left-0 bg-transparent px-1"
value={inputValue}
onChange={handleTitleChange}
spellCheck="false"
onFocus={handleFoucsIn}
onBlur={handleFocusOut}
aria-label={`Edit track title: ${track?.title}`}
/>
<span className="opacity-0 px-1 w-fit pointer-events-none whitespace-pre">
{inputValue}
</span>
</div>
);
}

View File

@@ -39,12 +39,14 @@ export function PlayerControls({ mediaPlayer }: { mediaPlayer: MediaPlayer }) {
<button
onClick={mediaPlayer.playPrevTrack}
className="text-blue-600 hover:text-blue-800"
aria-label="Previous track"
>
<SkipBack size={20} />
</button>
<button
onClick={playState.toggle}
className="w-[42px] h-[42px] flex items-center justify-center bg-blue-600 rounded-full text-white hover:bg-blue-700"
aria-label={isPlaying ? "Pause active track" : "Play active track"}
>
{isPlaying ? (
<Pause size={24} fill="currentColor" />
@@ -55,6 +57,7 @@ export function PlayerControls({ mediaPlayer }: { mediaPlayer: MediaPlayer }) {
<button
onClick={mediaPlayer.playNextTrack}
className="text-blue-600 hover:text-blue-800"
aria-label="Next track"
>
<SkipForward size={20} />
</button>

View File

@@ -0,0 +1,45 @@
import { Playlist } from "@/1_schema";
import { useCoState } from "@/2_main";
import {
updatePlaylistTitle
} from "@/4_actions";
import { ID } from "jazz-tools";
import { ChangeEvent, useState } from "react";
export function PlaylistTitleInput({
playlistId,
}: {
playlistId: ID<Playlist> | undefined;
}) {
const playlist = useCoState(Playlist, playlistId);
const [isEditing, setIsEditing] = useState(false);
const [localPlaylistTitle, setLocalPlaylistTitle] = useState("");
function handleTitleChange(evt: ChangeEvent<HTMLInputElement>) {
setLocalPlaylistTitle(evt.target.value);
}
function handleFoucsIn() {
setIsEditing(true);
setLocalPlaylistTitle(playlist?.title ?? "");
}
function handleFocusOut() {
setIsEditing(false);
setLocalPlaylistTitle("");
playlist && updatePlaylistTitle(playlist, localPlaylistTitle);
}
const inputValue = isEditing ? localPlaylistTitle : playlist?.title ?? "";
return (
<input
value={inputValue}
onChange={handleTitleChange}
className="text-2xl font-bold text-blue-800 bg-transparent"
onFocus={handleFoucsIn}
onBlur={handleFocusOut}
aria-label={`Playlist title`}
/>
);
}

View File

@@ -53,6 +53,7 @@ export function Waveform(props: { track: MusicTrack; height: number }) {
style={{
height: height * value,
}}
aria-label={`Seek to ${(i / barCount) * duration} seconds`}
/>
))}
</div>

View File

@@ -0,0 +1,44 @@
import { test } from "@playwright/test";
import { LoginPage } from "./pages/LoginPage";
import { HomePage } from "./pages/HomePage";
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
test("create a new playlist and share", async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.goto();
await loginPage.fillUsername("S. Mario");
await loginPage.signup();
const homePage = new HomePage(page);
// The example song should be loaded
await homePage.expectMusicTrack("Example song");
await homePage.editTrackTitle("Example song", "Super Mario World");
await homePage.createPlaylist();
await homePage.editPlaylistTitle("Save the princess");
await homePage.navigateToPlaylist("All tracks");
await homePage.addTrackToPlaylist("Super Mario World", "Save the princess");
await homePage.navigateToPlaylist("Save the princess");
await homePage.expectMusicTrack("Super Mario World");
const url = await homePage.getShareLink();
await sleep(4000); // Wait for the sync to complete
await homePage.logout();
await loginPage.goto();
await loginPage.fillUsername("Luigi");
await loginPage.signup();
await page.goto(url);
await homePage.expectMusicTrack("Super Mario World");
await homePage.playMusicTrack("Super Mario World");
await homePage.expectActiveTrackPlaying();
});

View File

@@ -0,0 +1,102 @@
import { Page, expect } from "@playwright/test";
export class HomePage {
constructor(public page: Page) {}
newPlaylistButton = this.page.getByRole("button", {
name: "New Playlist",
});
playlistTitleInput = this.page.getByRole("textbox", {
name: "Playlist title",
});
logoutButton = this.page.getByRole("button", {
name: "Logout",
});
async expectActiveTrackPlaying() {
await expect(
this.page.getByRole("button", {
name: `Pause active track`,
}),
).toBeVisible({
timeout: 10_000,
});
}
async expectMusicTrack(trackName: string) {
await expect(
this.page.getByRole("button", {
name: `Play ${trackName}`,
}),
).toBeVisible();
}
async playMusicTrack(trackName: string) {
await this.page
.getByRole("button", {
name: `Play ${trackName}`,
})
.click();
}
async editTrackTitle(trackTitle: string, newTitle: string) {
await this.page
.getByRole("textbox", {
name: `Edit track title: ${trackTitle}`,
})
.fill(newTitle);
}
async createPlaylist() {
await this.newPlaylistButton.click();
}
async editPlaylistTitle(playlistTitle: string) {
await this.playlistTitleInput.fill(playlistTitle);
}
async navigateToPlaylist(playlistTitle: string) {
await this.page
.getByRole("link", {
name: playlistTitle,
})
.click();
}
async getShareLink() {
await this.page
.getByRole("button", {
name: "Share playlist",
})
.click();
const inviteUrl = await this.page.evaluate(() =>
navigator.clipboard.readText(),
);
expect(inviteUrl).toBeTruthy();
return inviteUrl;
}
async addTrackToPlaylist(trackTitle: string, playlistTitle: string) {
await this.page
.getByRole("button", {
name: `Open ${trackTitle} menu`,
})
.click();
await this.page
.getByRole("menuitem", {
name: `Add to ${playlistTitle}`,
})
.click();
}
async logout() {
await this.logoutButton.click();
}
}

View File

@@ -0,0 +1,40 @@
import { Page, Locator, 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,26 @@
# jazz-password-manager
## 0.0.10
### Patch Changes
- Updated dependencies [3cc6aee]
- jazz-react@0.8.12
- jazz-tools@0.8.12
## 0.0.9
### Patch Changes
- jazz-react@0.8.11
- jazz-tools@0.8.11
## 0.0.8
### Patch Changes
- jazz-react@0.8.7
## 0.0.7
### Patch Changes

View File

@@ -62,6 +62,6 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
## Configuration: sync server
By default, the example app uses [Jazz Global Mesh](https://jazz.tools/mesh) (`wss://sync.jazz.tools`) - so cross-device use, invites and collaboration should just work.
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).

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.7",
"version": "0.0.10",
"type": "module",
"scripts": {
"dev": "vite",
@@ -11,8 +11,8 @@
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
},
"dependencies": {
"jazz-react": "workspace:0.8.6",
"jazz-tools": "workspace:0.8.5",
"jazz-react": "workspace:0.8.12",
"jazz-tools": "workspace:0.8.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.41.5",

View File

@@ -24,7 +24,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
<>
<Jazz.Provider
auth={auth}
peer="wss://mesh.jazz.tools/?key=password-manager-example-jazz@gcmp.io"
peer="wss://cloud.jazz.tools/?key=password-manager-example-jazz@gcmp.io"
>
{children}
</Jazz.Provider>

View File

@@ -5,9 +5,13 @@ import Table from "./components/table";
import NewItemModal from "./components/new-item-modal";
import InviteModal from "./components/invite-modal";
import { saveItem, deleteItem, createFolder, updateItem } from "./4_actions";
import { saveItem, deleteItem, createFolder, updateItem, addSharedFolder } from "./4_actions";
import { Alert, AlertDescription } from "./components/alert";
import { Folder, FolderList, PasswordItem } from "./1_schema";
import {
Folder,
FolderList,
PasswordItem,
} from "./1_schema";
import { useAccount, useCoState } from "./2_main";
import { CoMapInit, Group, ID } from "jazz-tools";
import { useNavigate, useParams } from "react-router-dom";
@@ -17,20 +21,19 @@ const VaultPage: React.FC = () => {
const { me, logOut } = useAccount();
const sharedFolderId = useParams<{ sharedFolderId: ID<Folder> }>()
.sharedFolderId;
const sharedFolder = useCoState(Folder, sharedFolderId);
const navigate = useNavigate();
useEffect(() => {
if (!sharedFolderId || !sharedFolder || !me.root?.folders) return;
const existsIndex = me.root?.folders.findIndex(
(f) => f?.id === sharedFolder.id
);
if (existsIndex > -1) {
me.root?.folders?.splice(existsIndex, 1);
}
me.root?.folders?.push(sharedFolder);
navigate("/vault");
}, [sharedFolder, me.root?.folders, sharedFolderId, navigate]);
if (!sharedFolderId) return;
addSharedFolder(sharedFolderId, me).then(() => {
navigate("/vault");
});
// We want to trigger this only on mount
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const items = me.root?.folders?.flatMap(
(folder) =>

View File

@@ -1,4 +1,4 @@
import { Group } from "jazz-tools";
import { Group, ID } from "jazz-tools";
import {
Folder,
PasswordItem,
@@ -8,6 +8,7 @@ import {
import { CoMapInit } from "jazz-tools";
import { createInviteLink } from "jazz-react";
import { PasswordItemFormValues } from "./types";
import { waitForCoValue } from "./lib/waitForCoValue";
export const saveItem = (item: CoMapInit<PasswordItem>): PasswordItem => {
const passwordItem = PasswordItem.create(item, {
@@ -54,3 +55,24 @@ export const shareFolder = (
}
return undefined;
};
export async function addSharedFolder(
sharedFolderId: ID<Folder>,
me: PasswordManagerAccount) {
const [sharedFolder, account] = await Promise.all([
await waitForCoValue(Folder, sharedFolderId, me, Boolean, {}),
await waitForCoValue(PasswordManagerAccount, me.id, me, Boolean, {
root: {
folders: [],
},
}),
]);
if (!account.root?.folders) return;
const found = account.root.folders.some((f) => f?.id === sharedFolder.id);
if (!found) {
account.root.folders.push(sharedFolder);
}
}

View File

@@ -0,0 +1,39 @@
import {
Account,
CoValue,
CoValueClass,
DepthsIn,
ID,
subscribeToCoValue,
} from "jazz-tools";
export function waitForCoValue<T extends CoValue>(
coMap: CoValueClass<T>,
valueId: ID<T>,
account: Account,
predicate: (value: T) => boolean,
depth: DepthsIn<T>
) {
return new Promise<T>((resolve) => {
function subscribe() {
const unsubscribe = subscribeToCoValue(
coMap,
valueId,
account,
depth,
(value) => {
if (predicate(value)) {
resolve(value);
unsubscribe();
}
},
() => {
unsubscribe();
setTimeout(subscribe, 100);
}
);
}
subscribe();
});
}

View File

@@ -1,5 +1,29 @@
# jazz-example-pets
## 0.0.108
### Patch Changes
- Updated dependencies [3cc6aee]
- jazz-react@0.8.12
- jazz-tools@0.8.12
- jazz-browser-media-images@0.8.12
## 0.0.107
### Patch Changes
- jazz-react@0.8.11
- jazz-tools@0.8.11
- jazz-browser-media-images@0.8.11
## 0.0.106
### Patch Changes
- jazz-browser-media-images@0.8.7
- jazz-react@0.8.7
## 0.0.105
### Patch Changes

View File

@@ -37,6 +37,6 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
## Configuration: sync server
By default, the example app uses [Jazz Global Mesh](https://jazz.tools/mesh) (`wss://sync.jazz.tools`) - so cross-device use, invites and collaboration should just work.
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/2_main.tsx](./src/2_main.tsx).

View File

@@ -14,7 +14,7 @@ job "example-pets$BRANCH_SUFFIX" {
constraint {
attribute = "${node.class}"
operator = "="
value = "mesh"
value = "cloud"
}
spread {

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-pets",
"private": true,
"version": "0.0.105",
"version": "0.0.108",
"type": "module",
"scripts": {
"dev": "vite",
@@ -23,9 +23,9 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-browser-media-images": "workspace:0.8.6",
"jazz-react": "workspace:0.8.6",
"jazz-tools": "workspace:0.8.5",
"jazz-browser-media-images": "workspace:0.8.12",
"jazz-react": "workspace:0.8.12",
"jazz-tools": "workspace:0.8.12",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.2.0",
@@ -50,7 +50,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"is-ci": "^3.0.1",
"jazz-run": "workspace:0.8.6",
"jazz-run": "workspace:0.8.12",
"postcss": "^8.4.27",
"tailwindcss": "3.3.2",
"typescript": "^5.3.3",

View File

@@ -18,7 +18,7 @@ const peer =
(new URL(window.location.href).searchParams.get(
"peer",
) as `ws://${string}`) ??
"wss://mesh.jazz.tools/?key=pets-example-jazz@gcmp.io";
"wss://cloud.jazz.tools/?key=pets-example-jazz@gcmp.io";
/** Walkthrough: The top-level provider `<Jazz.Provider/>`
*

View File

@@ -1,5 +1,26 @@
# jazz-example-todo
## 0.0.107
### Patch Changes
- Updated dependencies [3cc6aee]
- jazz-react@0.8.12
- jazz-tools@0.8.12
## 0.0.106
### Patch Changes
- jazz-react@0.8.11
- jazz-tools@0.8.11
## 0.0.105
### Patch Changes
- jazz-react@0.8.7
## 0.0.104
### Patch Changes

View File

@@ -64,6 +64,6 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
## Configuration: sync server
By default, the example app uses [Jazz Global Mesh](https://jazz.tools/mesh) (`wss://sync.jazz.tools`) - so cross-device use, invites and collaboration should just work.
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/2_main.tsx](./src/2_main.tsx).

View File

@@ -14,7 +14,7 @@ job "example-todo$BRANCH_SUFFIX" {
constraint {
attribute = "${node.class}"
operator = "="
value = "mesh"
value = "cloud"
}
spread {

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-todo",
"private": true,
"version": "0.0.104",
"version": "0.0.107",
"type": "module",
"scripts": {
"dev": "vite",
@@ -20,8 +20,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-react": "workspace:0.8.6",
"jazz-tools": "workspace:0.8.5",
"jazz-react": "workspace:0.8.12",
"jazz-tools": "workspace:0.8.12",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.2.0",

View File

@@ -44,7 +44,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
<>
<Jazz.Provider
auth={passkeyAuth}
peer="wss://mesh.jazz.tools/?key=todo-example-jazz@gcmp.io"
peer="wss://cloud.jazz.tools/?key=todo-example-jazz@gcmp.io"
>
{children}
</Jazz.Provider>

View File

@@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"format": "prettier --write './**/*.{ts,tsx,json}'"
},
"dependencies": {
"@evilmartians/harmony": "^1.0.0",
@@ -14,6 +15,7 @@
"clsx": "^2.1.1",
"lucide-react": "^0.436.0",
"next": "14.2.7",
"next-themes": "^0.2.1",
"react": "^18",
"react-dom": "^18",
"tailwind-merge": "^1.14.0",
@@ -28,6 +30,7 @@
"eslint": "^8",
"eslint-config-next": "14.2.7",
"postcss": "^8",
"prettier": "^3.2.5",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
}

View File

@@ -16,6 +16,7 @@ export function Button(props: ButtonProps) {
size = "md",
variant = "primary",
href,
disabled,
} = props;
const sizeClasses = {
@@ -27,14 +28,15 @@ export function Button(props: ButtonProps) {
primary:
"bg-blue border-blue text-white font-medium bg-blue hover:bg-blue-800 hover:border-blue-800",
secondary:
"text-stone-900 border border-stone-200 font-medium hover:border-stone-300 dark:border-stone-900 dark:hover:border-stone-800 dark:text-white",
"text-stone-900 border font-medium hover:border-stone-300 hover:dark:border-stone-700 dark:text-white",
};
const classNames = clsx(
className,
"rounded-lg transition-colors",
"rounded-lg text-center transition-colors",
sizeClasses[size],
variantClasses[variant],
disabled && "opacity-50 cursor-not-allowed pointer-events-none",
);
if (href) {
@@ -46,14 +48,7 @@ export function Button(props: ButtonProps) {
}
return (
<button
className={clsx(
className,
sizeClasses[size],
variantClasses[variant],
)}
{...props}
>
<button className={classNames} {...props}>
{children}
</button>
);

View File

@@ -6,12 +6,10 @@ export function CodeRef({ children }: { children: React.ReactNode }) {
className={clsx(
"font-mono",
"text-[0.9em]",
"px-1 py-0.5",
"rounded-sm",
"border",
"text-stone-800 dark:text-stone-200",
"px-2 py-1",
"rounded",
"text-stone-900 dark:text-stone-200",
"bg-stone-100 dark:bg-stone-800",
"border-stone-200 dark:border-stone-900"
)}
>
{children}

View File

@@ -10,7 +10,7 @@ export function ComingSoonBadge({ when = "soon" }: { when?: string }) {
"text-[0.6rem]",
"px-1 py-0.5",
"rounded-xl",
"align-text-top"
"align-text-top",
)}
>
Coming&nbsp;{when}

View File

@@ -6,8 +6,8 @@ export function GridCard(props: { children: ReactNode; className?: string }) {
<div
className={clsx(
"col-span-2 p-4 [&>h4]:mt-0 [&>h3]:mt-0 [&>:last-child]:mb-0",
"border border-stone-200 dark:border-stone-900 rounded-xl shadow-sm",
props.className
"border rounded-xl shadow-sm",
props.className,
)}
>
{props.children}

View File

@@ -15,7 +15,7 @@ export function H1({ children, className }: HeadingProps) {
"text-5xl lg:text-6xl",
"mb-3",
"font-medium",
"tracking-tighter"
"tracking-tighter",
)}
>
{children}
@@ -30,10 +30,10 @@ export function H2({ children, className }: HeadingProps) {
className,
"font-display",
"text-stone-950 dark:text-white",
"text-2xl",
"text-2xl md:text-4xl",
"mb-2",
"font-semibold",
"tracking-tight"
"tracking-tight",
)}
>
{children}
@@ -48,10 +48,10 @@ export function H3({ children, className }: HeadingProps) {
className,
"font-display",
"text-stone-950 dark:text-white",
"text-xl",
"text-xl md:text-2xl",
"mb-2",
"font-semibold",
"tracking-tight"
"tracking-tight",
)}
>
{children}

View File

@@ -1,3 +1,3 @@
export function LI({ children }: { children: React.ReactNode }) {
return <li className="marker:text-stone-500 marker:text-lg">{children}</li>;
}
}

View File

@@ -1,3 +1,11 @@
export function P({ children }: { children: React.ReactNode }) {
return <p className="mb-4">{children}</p>;
import clsx from "clsx";
export function P({
children,
className,
}: {
children: React.ReactNode;
className?: string;
}) {
return <p className={clsx(className, "mb-4")}>{children}</p>;
}

View File

@@ -21,10 +21,10 @@ export function TextLink({
"text-stone-800 dark:text-stone-200",
"hover:text-black dark:hover:text-white",
"decoration-stone-300 dark:decoration-stone-700",
"hover:decoration-stone-800 dark:hover:decoration-stone-200"
"hover:decoration-stone-800 dark:hover:decoration-stone-200",
)}
>
{children}
</Link>
);
}
}

View File

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

View File

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

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