Compare commits

...

222 Commits

Author SHA1 Message Date
Guido D'Orsi
5763c684c5 Merge pull request #2539 from garden-co/changeset-release/main
Version Packages
2025-06-17 17:37:06 +02:00
github-actions[bot]
a82b216901 Version Packages 2025-06-17 15:23:51 +00:00
Guido D'Orsi
f20182b1cc Merge pull request #2514 from garden-co/perf/async-storage
feat: improve missing deps recovery & parallelize storage reads
2025-06-17 17:20:46 +02:00
Brad Anderson
ef4fdff4fc Merge pull request #2543 from garden-co/fix/remove-rn-buffer-polyfill
fix: remove RN Buffer polyfill for ProgressiveImg
2025-06-17 09:48:53 -04:00
Trisha Lim
0f5e22f522 Merge pull request #2540 from garden-co/inspector/reduce-height
inspector: UI improvements
2025-06-17 14:12:10 +01:00
Brad Anderson
fc71d4548c fix: remove RN Buffer polyfill for ProgressiveImg 2025-06-17 09:04:30 -04:00
Guido D'Orsi
f5c90d875f chore: add comments on the account loading 2025-06-17 14:34:31 +02:00
Benjamin S. Leveritt
65963fffc8 Merge pull request #2273 from garden-co/feat/1514-coValue-types-data-access-docs
#1514 - Connecting CoValue docs
2025-06-17 12:44:12 +01:00
Benjamin S. Leveritt
7f09bc9475 Merge pull request #2542 from garden-co/fix-highlighter
Fix highlighter
2025-06-16 21:36:35 +01:00
Benjamin S. Leveritt
d97956e5db Reverts highlighter 2025-06-16 21:06:50 +01:00
Benjamin S. Leveritt
38e0e3f29b Bumps rehype toc dep 2025-06-16 21:06:13 +01:00
Benjamin S. Leveritt
2526e88cd1 Merge pull request #2284 from garden-co/feat/1604-Add-docs-for-soft-delete 2025-06-16 19:05:42 +01:00
Trisha Lim
5360000f61 show copy button on raw data 2025-06-16 17:37:01 +01:00
Trisha Lim
ca638e4d92 inspector: show raw data for account type 2025-06-16 17:29:15 +01:00
Guido D'Orsi
594d68e9ee fix: delay session parsing to when the account becomes available 2025-06-16 18:28:23 +02:00
Trisha Lim
de1ea09ec5 reduce height of embedded inspector 2025-06-16 17:14:00 +01:00
Guido D'Orsi
cf30fbd575 chore: update lockfile 2025-06-16 18:04:18 +02:00
Guido D'Orsi
598e669705 fix: remove redundant initialAdmin check on getDependedOnCoValuesFromRawData 2025-06-16 18:03:19 +02:00
Guido D'Orsi
e4ed11cd9d fix: load missing accounts when required by new transactions 2025-06-16 18:03:19 +02:00
Guido D'Orsi
e74a077823 feat: improve missing dependencies recovery & management 2025-06-16 18:03:18 +02:00
Guido D'Orsi
680a2e2b99 perf(async-storage): parralelize reads 2025-06-16 18:03:18 +02:00
Guido D'Orsi
861d7b88f8 Merge pull request #2538 from garden-co/legowhales_main
fix: Svelte CoState reactivity issue v3
2025-06-16 18:02:26 +02:00
Guido D'Orsi
e35a380d16 chore: changeset 2025-06-16 17:55:20 +02:00
Guido D'Orsi
08b1601dd1 test(jazz-svelte): add test based on Virtua 2025-06-16 17:55:20 +02:00
Benjamin S. Leveritt
d413df4864 Adds optional to deleted 2025-06-16 16:51:12 +01:00
Benjamin S. Leveritt
b177b09724 Removes a return 2025-06-16 16:24:49 +01:00
Benjamin S. Leveritt
3110459530 Fixes examples 2025-06-16 16:18:37 +01:00
Jérémy Le Mardelé
f66ed45460 fix: CoState reactivity issue v3 2025-06-16 17:17:12 +02:00
Trisha Lim
9cbbd55eef Examples and github actions cleanup (#2529) 2025-06-16 15:45:52 +01:00
Benjamin S. Leveritt
e4e3e173da Merge pull request #2536 from garden-co/benjamin-gco-564-docs-internal-links-showing-undefined-instead-of-proper
Refactor out remark/rehype plugins
2025-06-16 15:19:10 +01:00
Benjamin S. Leveritt
9a438a05ae Fixes typing 2025-06-16 15:06:35 +01:00
Benjamin S. Leveritt
fb126b8194 Refactors out highlight plugin 2025-06-16 13:56:27 +01:00
Benjamin S. Leveritt
a58ca736ec Moves html-to-jsx out 2025-06-16 13:49:00 +01:00
Benjamin S. Leveritt
39d916aeff Removes unused deps 2025-06-16 13:39:22 +01:00
Benjamin S. Leveritt
554dd8e6e6 Moves with-toc into plugin file 2025-06-16 13:39:22 +01:00
Benjamin S. Leveritt
8d8cb77316 Adds typechecks 2025-06-16 13:39:22 +01:00
Benjamin S. Leveritt
4c615ba5c2 Moves rehype-plugins into folder 2025-06-16 13:39:22 +01:00
Benjamin S. Leveritt
30dc4a8caa Moves with-slug fn out 2025-06-16 13:39:22 +01:00
Benjamin S. Leveritt
ffdad97a32 Fixes theme types 2025-06-16 13:39:21 +01:00
Benjamin S. Leveritt
f548199027 Typechecks next config 2025-06-16 13:39:16 +01:00
Benjamin S. Leveritt
9fecaee697 Adds test for header id 2025-06-16 13:37:27 +01:00
Benjamin S. Leveritt
f3409d8575 Moves generating header code out 2025-06-16 13:35:57 +01:00
Trisha Lim
8b66c92c46 Merge pull request #2531 from garden-co/feat/examples-analytics
track event: template command copied from examples page
2025-06-16 11:11:31 +01:00
Guido D'Orsi
dd60538ea2 Merge pull request #2511 from Wizzel1/Add-docs-for-accept-invite
Add docs for accept invite
2025-06-16 12:05:36 +02:00
Trisha Lim
8a7aab8520 Merge pull request #2530 from garden-co/chore/update-examples-tailwind-v4-shadcn
chore: update examples with shadcn to tailwind v4
2025-06-16 10:16:59 +01:00
Trisha Lim
d3fc467514 fix lock file conflicts 2025-06-16 09:56:50 +01:00
Giordano Ricci
6d1bd2b70a Merge pull request #2532 from garden-co/fix/lock
fix: lock file
2025-06-13 19:12:01 +01:00
Trisha Lim
6e79c8679e fix: lock file 2025-06-13 18:09:26 +01:00
Trisha Lim
222a8c2976 lint fix 2025-06-13 18:02:03 +01:00
Trisha Lim
5b7f02024e undo wordlist change 2025-06-13 18:02:03 +01:00
Trisha Lim
4b94b25a11 fix button variant 2025-06-13 18:02:03 +01:00
Trisha Lim
a99df9cb13 pets app: upgrade to tailwind v4 2025-06-13 18:02:02 +01:00
Trisha Lim
d359a4f491 music player app: upgrade to tailwind v4 2025-06-13 18:01:53 +01:00
Trisha Lim
588d7f41a2 todo app: upgrade radix 2025-06-13 18:01:53 +01:00
Trisha Lim
1951d0f5b1 todo app: upgrade to tailwind v4 2025-06-13 18:01:53 +01:00
Trisha Lim
3ffb74d170 Merge pull request #2520 from garden-co/chore/update-examples-tw-v4
chore: upgrade examples to tailwind v4
2025-06-13 18:01:04 +01:00
Guido D'Orsi
597545741b Merge pull request #2515 from garden-co/changeset-release/main
Version Packages
2025-06-13 17:58:33 +02:00
github-actions[bot]
5e42e2a8d8 Version Packages 2025-06-13 15:52:42 +00:00
Guido D'Orsi
19e2a61398 fix: changeset 2025-06-13 17:48:32 +02:00
Trisha Lim
cb5fe3380e track event: template command copied from examples page 2025-06-13 16:48:00 +01:00
Trisha Lim
5b06a9d0a7 Merge pull request #2528 from garden-co/chat-svelte
Create Svelte version of chat example
2025-06-13 15:29:58 +01:00
Trisha Lim
41c4fbb8f9 update lock file 2025-06-13 15:14:20 +01:00
Trisha Lim
95febc7777 Revert "update lock file"
This reverts commit 7d80839396a88bfa85d71a79a0fe899b0b6c9fc1.
2025-06-13 15:13:35 +01:00
Trisha Lim
7ddff0a550 update lock file 2025-06-13 15:13:35 +01:00
Joe Innes
cebc58cd3a fix(layout): 🔄 revert to random username generation
* Removed derived username assignment from URL parameters.

https://github.com/garden-co/jazz/pull/2339#discussion_r2139972049
2025-06-13 15:13:22 +01:00
Joe Innes
044626fbc8 test(chat): add test to ensure user is not assigned 'Anonymous user' name
* Implemented a new test case to verify that users do not receive the username 'Anonymous user' upon joining the chat.
* Added a method `expectUserNameNotToBeAnonymousUser` in `ChatPage` to facilitate this check.
2025-06-13 15:13:22 +01:00
Joe Innes
28fdc43c89 fix(chat): 🔄 reload on logout to update profile name
* Ensure the application reloads after logging out to reflect the default profile name.
* Also trim the `user` URL param (in case a user passes an empty param, generate a random username)
2025-06-13 15:13:22 +01:00
Joe Innes
2602a49f12 fix(app.html): 🖼️ add type attribute to icon link
* Ensures the correct MIME type is specified for the icon.
2025-06-13 15:13:22 +01:00
Joe Innes
8505b0a0b6 Minor tweaks:
- Update API Key
- Remove Prettier comment
- Fix README (#2424)
2025-06-13 15:13:22 +01:00
Joe Innes
f2418ff364 Create Svelte version of chat example 2025-06-13 15:13:22 +01:00
Joe Innes
c81a49ebc3 Create Svelte version of chat example 2025-06-13 15:13:20 +01:00
Guido D'Orsi
3cd07dca31 Merge pull request #2518 from garden-co/fix/passkey-login
fix(passkey): increase the challenge to 20 bytes and disable the attestation
2025-06-13 15:05:15 +02:00
Trisha Lim
f69707f1af fix lock file 2025-06-13 13:40:46 +01:00
Trisha Lim
57e748d2ba undo upgrading pets and music app 2025-06-13 13:37:47 +01:00
Trisha Lim
c0cfdc0d32 update examples to tailwind v4 2025-06-13 13:37:47 +01:00
Guido D'Orsi
3763a99e14 test: fix passskey tests 2025-06-13 14:01:30 +02:00
Guido D'Orsi
201e2fd015 Merge pull request #2299 from garden-co/emil/group-inheritance-evolution
feat: deprecate extend methods
2025-06-13 13:18:21 +02:00
Guido D'Orsi
3e743d56d3 fix: improve the error UI in PasskeyAuthBasicUI 2025-06-13 11:37:43 +02:00
Guido D'Orsi
b3ff726794 chore: changeset 2025-06-13 11:25:08 +02:00
Guido D'Orsi
f98f88d89b fix: restore the attestation to direct 2025-06-13 11:24:46 +02:00
Trisha Lim
56974412df Merge pull request #2513 from joeinnes/2371-gitignore-dotenv-files
chore: ✏️ update README and .gitignore files
2025-06-12 20:23:11 +01:00
Joe Innes
adaedd2da2 chore: ✏️ update .env.example and fix demo URL
* Added .env.example file with necessary environment variables.
* Corrected demo URL in README.
2025-06-12 21:13:56 +02:00
Guido D'Orsi
a11472a497 chore: show the error cause on the PasskeyAuthBasicUI 2025-06-12 20:02:29 +02:00
Guido D'Orsi
3f269c7483 chore: log the error cause on the music player auth modal 2025-06-12 20:00:55 +02:00
Guido D'Orsi
81b6b8fd04 fix: increase the challenge to 20 bytes and disable the attestation 2025-06-12 19:47:55 +02:00
Trisha Lim
2939790335 Merge pull request #2306 from garden-co/feat/svelte-starter
svelte starter app
2025-06-12 16:18:41 +01:00
Guido D'Orsi
7e4ba07c4c fix type error on sharing.mdx 2025-06-12 17:14:13 +02:00
Trisha Lim
48c29435bc replace Loaded with co.loaded 2025-06-12 15:53:54 +01:00
Trisha Lim
8668906376 refactor helper methods in starters 2025-06-12 15:53:54 +01:00
Trisha Lim
6d84e9e83f remove changelog 2025-06-12 15:53:54 +01:00
Trisha Lim
1fea0ef69c match prettier with monorepo biome as much as possible 2025-06-12 15:53:54 +01:00
Trisha Lim
e4314accb6 upgrade vite 2025-06-12 15:53:54 +01:00
Trisha Lim
ee3a4048ef missing test command 2025-06-12 15:53:54 +01:00
Trisha Lim
9ee1edef3b update lock file 2025-06-12 15:53:53 +01:00
Trisha Lim
8ab5a09a86 fix vite and tailwind config 2025-06-12 15:53:53 +01:00
Trisha Lim
2624442903 add playwright tests 2025-06-12 15:53:52 +01:00
Trisha Lim
2d199089d5 svelte starter 2025-06-12 15:53:14 +01:00
Trisha Lim
683c170b9d svelte starter 2025-06-12 15:53:14 +01:00
Joe Innes
ce0e9f0102 chore: ✏️ update README and .gitignore files
* Added instructions for renaming `.env.example` to `.env` in multiple README files.
* Updated `.gitignore` files to include `.env` and `.env.*` while excluding `.env.example` and `.env.test`.
* Removed `.env` file from `examples/multi-cursors`.
* Improved consistency across example projects.
2025-06-12 13:40:19 +02:00
Benjamin S. Leveritt
518406e23d Merge pull request #2497 from garden-co/benjamin-gco-546-throw-on-typecheck-failures-with-twoslash
Throw on typecheck failures with twoslash
2025-06-12 12:39:53 +01:00
Nikos Papadopoulos
4dcbafa058 Merge pull request #2508 from garden-co/2503-create-invitation-onclick-rather-than-pre-emptively-in-org-example
organization example app: Invitation creation moved to button click event
2025-06-12 13:06:09 +02:00
Benjamin S. Leveritt
7ae9e01848 Fix. 2025-06-12 11:27:13 +01:00
Benjamin S. Leveritt
dd9ecf660d Fix? 2025-06-12 11:24:22 +01:00
Benjamin S. Leveritt
4f849050dc Fix? 2025-06-12 11:17:33 +01:00
Wizzel1
7591ac1f7e Update homepage/homepage/content/docs/groups/sharing.mdx
Co-authored-by: Guido D'Orsi <gu.dorsi@gmail.com>
2025-06-12 11:48:08 +02:00
Benjamin S. Leveritt
681600220f Excludes homepage from catalog deps 2025-06-12 10:36:26 +01:00
Benjamin S. Leveritt
384e239ad5 Bumps next to 15 in design system 2025-06-12 10:25:34 +01:00
Benjamin S. Leveritt
54e1a09a46 Bumps next to 15 2025-06-12 10:24:07 +01:00
Benjamin S. Leveritt
392a9c5aac Moves react deps to catalogs 2025-06-12 10:22:28 +01:00
Wizzel1
7f9b82a975 Add cut to hide type errors
Co-authored-by: Guido D'Orsi <gu.dorsi@gmail.com>
2025-06-12 11:16:53 +02:00
Wizzel1
5f65ca0874 Rephrase context 2025-06-12 10:58:59 +02:00
Wizzel1
5a88024420 Clean up section 2025-06-12 10:54:20 +02:00
Wizzel1
bf025724aa Add section 2025-06-12 10:52:58 +02:00
Benjamin S. Leveritt
478334eabf Merge pull request #2482 from garden-co/2480-add-more-context-to-introduction-from-the-homepage
Adds context to the introduction page
2025-06-12 08:49:10 +01:00
Benjamin S. Leveritt
479f9b0113 Adds extends to turbo configs
As they're in a workspace
2025-06-12 08:33:16 +01:00
Benjamin S. Leveritt
812622b161 Adds package manager to package.json 2025-06-12 08:25:59 +01:00
Benjamin S. Leveritt
8b35fae4b6 Adds an error suppression for old code 2025-06-12 08:20:53 +01:00
Benjamin S. Leveritt
9e2ecb0378 Bumps React to 19 2025-06-12 08:11:54 +01:00
Guido D'Orsi
fe908b5300 Merge pull request #2502 from garden-co/changeset-release/main
Version Packages
2025-06-11 19:03:46 +02:00
github-actions[bot]
1f99807971 Version Packages 2025-06-11 16:52:35 +00:00
Guido D'Orsi
47f54c4d81 Merge pull request #2490 from garden-co/fix/svelte-auth-state
feat(svelte): add isAuthenticated state to AccountCoState & fix id reactivity edge cases
2025-06-11 18:44:31 +02:00
Guido D'Orsi
814f65acaf Merge pull request #2509 from garden-co/fix/rn-db-connection-reuse
fix(rn): reuse the same db connection when doing login/logout
2025-06-11 18:44:08 +02:00
Guido D'Orsi
78fd4c86a1 Merge pull request #2506 from garden-co/fix/clerk-test
fix(clerk example): missing api key in e2e test
2025-06-11 18:37:25 +02:00
Guido D'Orsi
678f326bc1 fix(rn): reuse the same db connection when doing login/logout 2025-06-11 18:25:07 +02:00
Guido D'Orsi
ea33ad4864 fix(svelte): fix some edge cases in the id reactivity on CoState 2025-06-11 18:18:28 +02:00
Guido D'Orsi
57b6d5efb4 test: skip failing tests on PasskeyAuthBasicUI/svelte 2025-06-11 18:18:09 +02:00
Guido D'Orsi
15929b121d feat(svelte): add isAuthenticated state to AccountCoState 2025-06-11 18:18:09 +02:00
Nikos Papadopoulos
6edd061202 removes invite link state 2025-06-11 17:07:07 +01:00
Trisha Lim
eb4cef196c inspector: add tests with playwright (#2500)
* test account dropdown

* remove unused packages

* test account

* attempt test covalues

* test: add createAccount utility

* move things around

* improve locator text

* add inspector to playwright.yml

---------

Co-authored-by: Guido D'Orsi <gu.dorsi@gmail.com>
2025-06-11 17:05:14 +01:00
Emil Sayahi
85703f9241 fix: remove .env from betterauth example (#2507)
* fix: remove `.env` from `betterauth` example

* fix: match convention
2025-06-11 08:59:39 -07:00
Nikos Papadopoulos
865d5385e9 moves invitation creation to button click event in organization example app 2025-06-11 16:55:18 +01:00
Trisha Lim
5bb12523ee create-jazz-app: delete .env.test file 2025-06-11 16:37:26 +01:00
Trisha Lim
190cb1efb2 copy .env.test to .env in test 2025-06-11 16:15:52 +01:00
Trisha Lim
46ab1f6db2 try .env.test 2025-06-11 15:55:29 +01:00
Trisha Lim
a44fc6fc6d move env to build step 2025-06-11 15:36:29 +01:00
Trisha Lim
2376a8d3b2 add .env.example to clerk examples 2025-06-11 15:34:05 +01:00
Trisha Lim
2c3ec2fea6 fix(clerk example): missing api key in e2e test 2025-06-11 15:26:35 +01:00
Nikos Papadopoulos
da6f6ec4d5 Merge pull request #2496 from garden-co/2462-add-jazz-inspector-to-all-example-apps
integrates inspector to all example apps
2025-06-11 16:21:38 +02:00
Guido D'Orsi
8c78b37bfb Merge pull request #2492 from garden-co/feat/add-error-boundary-for-inspector
Add error boundary for inspector
2025-06-11 16:18:03 +02:00
Nikos Papadopoulos
5f382309de updates pnpm-lock.yaml 2025-06-11 15:04:31 +01:00
Divya
aa7eb3cf2c fix: ts error with error type 2025-06-11 09:36:23 -04:00
Divya
9b41762e96 fix: styling 2025-06-11 09:23:07 -04:00
Nikos Papadopoulos
28be460286 Merge pull request #2504 from garden-co/nikos/clerk_rn_env_ignore
fix for clerk rn example app .env
2025-06-11 15:22:27 +02:00
Divya
df8af06814 fix: pr feedback 2025-06-11 09:14:04 -04:00
Divya
2ef460fccf fix: build errors and style tweaks 2025-06-11 09:14:04 -04:00
Divya
9660e2c03c feat: Add error boundary to inspector so we can tell if a coId is invalid 2025-06-11 09:14:04 -04:00
Nikos Papadopoulos
908645e4b7 removes clerk rn example app .env and updates .gitignore rules 2025-06-11 14:11:29 +01:00
Nikos Papadopoulos
f3ca37ed5e Merge pull request #2501 from garden-co/nikos/clerk_env_ignore
fix for clerk example app .env
2025-06-11 14:57:03 +02:00
Nikos Papadopoulos
a9d0fd14c4 removes unused inspector dependency from passkey-svelte package.json 2025-06-11 13:51:14 +01:00
Guido D'Orsi
c496f49bb0 Merge pull request #2499 from garden-co/2498-fix-progressiveimg-cannot-be-used-as-a-jsx-component
Fix `ProgressiveImg` cannot be used as a jsx component
2025-06-11 14:42:09 +02:00
Nikos Papadopoulos
b26666ab4c removes clerk example app .env and updates .gitignore rules 2025-06-11 13:26:20 +01:00
Benjamin S. Leveritt
9088a349a0 Adds changeset 2025-06-11 12:49:35 +01:00
Benjamin S. Leveritt
54b12dcb7a Returns explicit type for ProgressiveImg 2025-06-11 12:47:34 +01:00
Benjamin S. Leveritt
a998f94789 Includes the recommendation in the error 2025-06-11 12:46:53 +01:00
Benjamin S. Leveritt
d17eecfe16 Removes z.null from docs 2025-06-11 12:19:29 +01:00
Nikos Papadopoulos
71b9a5ce25 updates clerk example .gitignore to add .env exclusion 2025-06-11 11:55:17 +01:00
Benjamin S. Leveritt
8ebfbc86db Rethrows in production 2025-06-11 11:36:56 +01:00
Benjamin S. Leveritt
abad8e762f Changes config to throw on typecheck error 2025-06-11 11:21:49 +01:00
Benjamin S. Leveritt
037e16392e Removes list of frameworks 2025-06-11 10:55:19 +01:00
Benjamin S. Leveritt
49ac65c123 Reorders list 2025-06-11 10:55:19 +01:00
Benjamin S. Leveritt
3510fb1273 Update homepage/homepage/content/docs/index.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-06-11 10:55:19 +01:00
Benjamin S. Leveritt
bc3efe7ca0 Tweaks 2025-06-11 10:55:19 +01:00
Benjamin S. Leveritt
3b06a7809e Adds why and how sections 2025-06-11 10:55:18 +01:00
Benjamin S. Leveritt
58aa04bb10 Adds introduction paragraph 2025-06-11 10:55:18 +01:00
Trisha Lim
afb94ef043 Merge pull request #2487 from garden-co/feat/link-to-frameworks
link to framework docs from homepage
2025-06-11 10:34:29 +01:00
Nikos Papadopoulos
7554dd9f88 integrates inspector to all example apps 2025-06-11 10:13:21 +01:00
Benjamin S. Leveritt
7a3cfabb4c Merge pull request #2481 from garden-co/changeset-release/main
Version Packages
2025-06-11 09:49:08 +01:00
github-actions[bot]
df7101a8ee Version Packages 2025-06-11 08:47:01 +00:00
Benjamin S. Leveritt
f74b46ee2f Merge pull request #2495 from garden-co/2494-applydiff-out-of-bounds-for-strings-with-emoji
Fix: `applyDiff` out of bounds for strings with emoji
2025-06-11 09:43:30 +01:00
Benjamin S. Leveritt
9177579f53 Fixs coText applyDiff out of bounds insertion with emoji 2025-06-11 09:35:56 +01:00
Benjamin S. Leveritt
f1c00903f9 Removes unused navigator code 2025-06-11 09:34:06 +01:00
Benjamin S. Leveritt
1ca9299590 Adds grapheme split helpers for coText 2025-06-11 09:33:45 +01:00
Trisha Lim
4f0fb6c27f link to framework docs from homepage 2025-06-10 22:59:51 +01:00
Benjamin S. Leveritt
34082ccaf5 Merge pull request #2486 from garden-co/add-context-to-twoslash-errors
Adds more details to twoslash errors
2025-06-10 17:40:55 +01:00
Benjamin S. Leveritt
a09c417d81 Formats title and code to make is easier to spot 2025-06-10 17:36:41 +01:00
Emil Sayahi
034bd20b39 Merge branch 'main' into emil/group-inheritance-evolution 2025-06-10 09:10:10 -07:00
Benjamin S. Leveritt
00a188c22f Merge pull request #2484 from garden-co/2483-encryption-in-jazz-docs
2483 encryption in jazz docs
2025-06-10 16:39:31 +01:00
Benjamin S. Leveritt
dc630b0807 Update homepage/homepage/content/docs/resources/encryption.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-06-10 16:39:20 +01:00
Benjamin S. Leveritt
484baabe22 Updates introduction sentence as per feedback 2025-06-10 16:38:16 +01:00
Benjamin S. Leveritt
f529bede7b Adds more details to twoslash errors
To make it easier to track down
2025-06-10 16:37:01 +01:00
Emil Sayahi
87f82ac7cd fix(changeset): minor to patch 2025-06-10 08:07:48 -07:00
Trisha Lim
6f637d21ab Merge pull request #2446 from garden-co/feat/analytics
feat: track create-jazz-app copy action in hero
2025-06-10 15:54:23 +01:00
Benjamin S. Leveritt
aeb96510da Adds a section to the FAQ 2025-06-10 15:31:20 +01:00
Benjamin S. Leveritt
d53cc3676d Adds Encryption reference doc 2025-06-10 15:23:13 +01:00
Guido D'Orsi
81dedb6395 Merge pull request #2448 from garden-co/fix/react-native-db-connection
fix(react-native): close db connections and keep the same instance of storage over JazzProvider renders
2025-06-10 12:24:19 +02:00
Nikos Papadopoulos
17cb04bfb1 Merge pull request #2478 from garden-co/2477-fix-mime-types-for-favicon-in-all-example-apps
fixes favicon mime type for example apps
2025-06-10 12:22:39 +02:00
Nikos Papadopoulos
a98b4e5d81 updates links to public directory 2025-06-09 23:13:47 +01:00
Nikos Papadopoulos
7eb7e2f656 reorders metadata tags for consistency across example apps 2025-06-09 20:22:36 +01:00
Nikos Papadopoulos
80703ea1cc tidy up for metadata tags 2025-06-09 20:15:49 +01:00
Nikos Papadopoulos
d46e0b9d0c fixes favicon mime type, replaces png with ico files where applicable, moves favicon to ./public for consistency 2025-06-09 20:00:45 +01:00
Nikos Papadopoulos
430a9e252a Merge pull request #2475 from garden-co/2474-fix-favicon-for-richtext-prosekit-and-organization-examples
fixes missing favicon for richtext-prosekit and organization examples
2025-06-09 16:26:19 +02:00
Nikos Papadopoulos
6f519462df fixes missing favicon for richtext-prosekit and organization examples 2025-06-09 15:13:41 +01:00
Guido D'Orsi
a0ae2811ce test: wait for Join chat to be visible 2025-06-09 15:51:01 +02:00
Guido D'Orsi
73e5a3548a fix: make chat-rn example private 2025-06-09 13:03:04 +02:00
Guido D'Orsi
c5da3a42a1 fix: remove version field from examples to exclude them from the changelog 2025-06-09 12:49:07 +02:00
Guido D'Orsi
8ef14d4850 fix: do not create a storage adapter on each JazzProvider render 2025-06-05 18:22:00 +02:00
Guido D'Orsi
1a7b7942ad test(expo): restore the chat loading test 2025-06-05 18:22:00 +02:00
Guido D'Orsi
5f42c97184 fix: close the DB connection when the node/context is closed 2025-06-05 18:22:00 +02:00
Trisha Lim
2a2b474aa4 feat: track create-jazz-app copy action in hero 2025-06-05 16:16:06 +01:00
Margaret Culotta
bf9312ad15 Update for deprecated withHelpers 2025-05-24 18:27:41 -05:00
Margaret Culotta
b54eac6484 Merge branch 'main' into feat/1604-Add-docs-for-soft-delete 2025-05-24 17:46:22 -05:00
Margaret Culotta
286b17431a update per pr feedback, update language, revert change to DocsNav 2025-05-21 08:25:27 -05:00
Emil Sayahi
e8c1a3535a fix(docs): remove parent/child terminology 2025-05-21 09:09:05 -04:00
Emil Sayahi
b05878962b Merge branch 'main' into emil/group-inheritance-evolution 2025-05-21 08:54:41 -04:00
Emil Sayahi
54b4595f23 feat(docs): reduce 'parent', 'child' groups 2025-05-20 18:37:23 -04:00
Emil Sayahi
99a2d9be00 chore: changeset 2025-05-20 17:07:37 -04:00
Emil Sayahi
bf1fbdc8c4 feat(docs): 'Groups as members' 2025-05-20 17:01:33 -04:00
Margaret Culotta
7c88b2c55d Update examples and content to reflect zod changes 2025-05-20 15:28:12 -05:00
Emil Sayahi
14b3aa29c7 feat(docs): type-checking for inheritance docs 2025-05-20 16:00:26 -04:00
Emil Sayahi
bfaadb9d67 feat(tests): unextend test in jazz-tools 2025-05-20 15:38:25 -04:00
Emil Sayahi
cb770e565d feat: group extend should error with writeOnly
todo:
- add unextend tests in `packages/jazz-tools/src/tests/groupsAndAccounts.test.ts`
- test affected example apps by hand
- rewrite group inheritance documentation in terms of adding & removing groups as members
- changeset
2025-05-20 14:52:32 -04:00
Margaret Culotta
15190250e5 handle pr feedback 2025-05-20 13:47:48 -05:00
Emil Sayahi
a50a9e6c9b feat: deprecate extend methods
todo:
- add unextend tests in `packages/jazz-tools/src/tests/groupsAndAccounts.test.ts`
  - also add more `addMember` tests
    - `member` is not `Group` but `role` is `undefined` (type error)
    - `member` is not `Group` but `role` is `inherit` (type error)
- changeset
2025-05-20 13:35:43 -04:00
Margaret Culotta
b8f91dcb9d Merge branch 'main' into feat/1514-coValue-types-data-access-docs 2025-05-20 12:14:35 -05:00
Margaret Culotta
23f5879b54 clean up linting 2025-05-20 11:49:53 -05:00
Margaret Culotta
f882b68490 Break up soft deletion section into coMap and coList to better describe pattern 2025-05-20 11:46:40 -05:00
Margaret Culotta
ce149eba76 clean up code snippet 2025-05-19 15:13:14 -05:00
Margaret Culotta
41d3a5c755 Merge branch 'main' into feat/1604-Add-docs-for-soft-delete 2025-05-19 13:43:52 -05:00
Margaret Culotta
bb67d6c5fd Add docs for soft delete 2025-05-19 12:40:30 -05:00
Margaret Culotta
60bf6f0a7a Add section for soft delete pattern 2025-05-19 11:29:52 -05:00
Margaret Culotta
83765a8509 Add documentation and sidebar link for Connecting CoValues 2025-05-19 08:54:32 -05:00
Margaret Culotta
be8ac6fc70 Add new section 2025-05-15 15:08:35 -05:00
482 changed files with 12548 additions and 5533 deletions

View File

@@ -10,15 +10,9 @@ jobs:
strategy:
matrix:
example: [
"chat",
"clerk",
"passkey",
"inspector",
"music-player",
"password-manager",
"pets",
"reactions",
"todo",
"passkey-svelte",
"chat-svelte",
"file-share-svelte",
]
steps:

View File

@@ -1,26 +0,0 @@
name: Build Starters
on:
push:
branches: ["main"]
jobs:
build-starters:
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
matrix:
starter: ["react-passkey-auth"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Pnpm Build
run: |
pnpm install
pnpm turbo build;
working-directory: ./starters/${{ matrix.starter }}

View File

@@ -22,6 +22,9 @@ jobs:
- name: Setup Source Code
uses: ./.github/actions/source-code/
- name: Install root dependencies
run: pnpm install && pnpm turbo build
- name: Install project dependencies
run: pnpm install
working-directory: ./${{ matrix.project }}

View File

@@ -13,7 +13,21 @@ jobs:
continue-on-error: true
strategy:
matrix:
project: ["tests/e2e", "examples/chat", "examples/clerk", "examples/betterauth", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/organization", "examples/pets", "starters/react-passkey-auth"]
project: [
"tests/e2e",
"examples/chat",
"examples/clerk",
"examples/betterauth",
"examples/file-share-svelte",
"examples/form",
"examples/inspector",
"examples/music-player",
"examples/organization",
"examples/pets",
"starters/react-passkey-auth",
"starters/svelte-passkey-auth",
"packages/jazz-svelte"
]
steps:
- uses: actions/checkout@v4
@@ -24,7 +38,11 @@ jobs:
uses: ./.github/actions/source-code/
- name: Pnpm Build
run: pnpm turbo build
run: |
if [ -f .env.test ]; then
cp .env.test .env
fi
pnpm turbo build
working-directory: ./${{ matrix.project }}
- name: Install Playwright Browsers

View File

@@ -13,6 +13,7 @@
"**/android/**",
"packages/jazz-svelte/**",
"examples/*svelte*/**",
"starters/*svelte*/**",
"examples/jazz-paper-scissors/src/routeTree.gen.ts",
"homepage/homepage/**",
"**/package.json"

View File

@@ -36,8 +36,10 @@ yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
!.env
.env
.env.*
!.env.example
!.env.test
# vercel
.vercel

View File

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

View File

@@ -1,6 +1,5 @@
{
"name": "betterauth",
"version": "0.1.25",
"private": true,
"type": "module",
"scripts": {

View File

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

View File

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

View File

@@ -15,3 +15,9 @@ web-build/
ios
android
# Env
.env
.env.*
!.env.example
!.env.test

View File

@@ -8,9 +8,12 @@ First, install dependencies and build the project:
```bash
pnpm i
mv .env.example .env
pnpm run build
```
Don't forget to update `VITE_CLERK_PUBLISHABLE_KEY` in `.env` with your [Publishable Key](https://clerk.com/docs/deployments/clerk-environment-variables#clerk-publishable-and-secret-keys) from Clerk.
### 2. Inside the `examples/chat-rn-expo-clerk` Directory
Next, navigate to the specific example project and run the following commands:

View File

@@ -1,7 +1,6 @@
{
"name": "chat-rn-expo-clerk",
"main": "index.js",
"version": "1.0.145",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",
@@ -17,7 +16,6 @@
"@bacons/text-decoder": "0.0.0",
"@bam.tech/react-native-image-resizer": "^3.0.11",
"@clerk/clerk-expo": "^2.2.21",
"@craftzdog/react-native-buffer": "6.0.5",
"@expo/vector-icons": "^14.1.0",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "7.0.19",

View File

@@ -3,9 +3,6 @@
// @ts-expect-error - @types/react-native doesn't cover this file
import { polyfillGlobal } from "react-native/Libraries/Utilities/PolyfillFunctions";
import { Buffer } from "@craftzdog/react-native-buffer";
polyfillGlobal("Buffer", () => Buffer);
// @ts-expect-error - @types/readable-stream doesn't have ReadableStream type
import { ReadableStream } from "readable-stream";
polyfillGlobal("ReadableStream", () => ReadableStream);

View File

@@ -36,4 +36,9 @@ yarn-error.*
# typescript
*.tsbuildinfo
android/
ios/
ios/
# env files
.env
.env.*
!.env.example
!.env.test

View File

@@ -1,6 +1,5 @@
{
"name": "chat-rn-expo",
"version": "1.0.13",
"main": "index.ts",
"scripts": {
"build": "expo prebuild",
@@ -12,7 +11,7 @@
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@bacons/text-decoder": "^0.0.0",
"@craftzdog/react-native-buffer": "^6.0.5",
"@bam.tech/react-native-image-resizer": "^3.0.11",
"@react-native-community/netinfo": "11.4.1",
"expo": "~53.0.9",
"expo-clipboard": "^7.1.4",

View File

@@ -3,9 +3,6 @@
// @ts-expect-error - @types/react-native doesn't cover this file
import { polyfillGlobal } from "react-native/Libraries/Utilities/PolyfillFunctions";
import { Buffer } from "@craftzdog/react-native-buffer";
polyfillGlobal("Buffer", () => Buffer);
// @ts-expect-error - @types/readable-stream doesn't have ReadableStream type
import { ReadableStream } from "readable-stream";
polyfillGlobal("ReadableStream", () => ReadableStream);

View File

@@ -128,7 +128,11 @@ export default function ChatScreen() {
}}
testID="chat-id-input"
/>
<TouchableOpacity onPress={joinChat} style={styles.joinChatButton}>
<TouchableOpacity
testID="join-chat-button"
onPress={joinChat}
style={styles.joinChatButton}
>
<Text style={styles.newChatButtonText}>Join chat</Text>
</TouchableOpacity>
</View>

View File

@@ -41,12 +41,17 @@ appId: tools.jazz.chatrnexpo
# logout
- tapOn: "Logout"
- assertVisible: "Username"
- assertVisible: "Anonymous user"
# join chat
- extendedWaitUntil:
visible: "Anonymous user"
timeout: 10000
# join chat
## Commented because it fails on CI
# - tapOn:
# id: "chat-id-input"
# - inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
# - tapOn: "Join chat"
# - tapOn:
# id: "join-chat-button"
# - assertVisible: "boorad"
# - assertVisible: "bro, low key, it do be like that tho"

View File

@@ -0,0 +1,13 @@
#!/bin/bash
# This script is necessary, because unlike ios, the android emulator action
# accepts a script, runs it as your tests, then terminates.
set -e
# run the e2e tests
export PATH="$PATH":"$HOME/.maestro/bin"
export MAESTRO_DRIVER_STARTUP_TIMEOUT=300000 # setting to 5 mins 👀
export MAESTRO_CLI_NO_ANALYTICS=1
export MAESTRO_CLI_ANALYSIS_NOTIFICATION_DISABLED=true
maestro test test/e2e/flow.yml

View File

@@ -73,3 +73,9 @@ yarn-error.log
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# env files
.env
.env.*
!.env.example
!.env.test

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.140",
"private": true,
"main": "index.js",
"scripts": {
"android": "react-native run-android",
@@ -12,7 +12,6 @@
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@bacons/text-decoder": "0.0.0",
"@craftzdog/react-native-buffer": "6.0.5",
"@op-engineering/op-sqlite": "^11.4.8",
"@react-native-clipboard/clipboard": "1.16.1",
"@react-native-community/netinfo": "11.4.1",

View File

@@ -4,9 +4,6 @@
import { polyfillGlobal } from "react-native/Libraries/Utilities/PolyfillFunctions";
// import 'react-native-polyfill-globals/auto';
import { Buffer } from "@craftzdog/react-native-buffer";
polyfillGlobal("Buffer", () => Buffer);
// @ts-expect-error - @types/readable-stream doesn't have ReadableStream type
import { ReadableStream } from "readable-stream";
polyfillGlobal("ReadableStream", () => ReadableStream);

21
examples/chat-svelte/.gitignore vendored Normal file
View File

@@ -0,0 +1,21 @@
node_modules
# Output
.output
.vercel
/.svelte-kit
/build
# OS
.DS_Store
Thumbs.db
# Env
.env
.env.*
!.env.example
!.env.test
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

View File

@@ -0,0 +1 @@
engine-strict=true

View File

@@ -0,0 +1,4 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock

View File

@@ -0,0 +1,16 @@
{
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}

View File

@@ -0,0 +1,554 @@
# passkey-svelte
## 0.0.86
### Patch Changes
- Updated dependencies [e35a380]
- jazz-svelte@0.14.26
- jazz-tools@0.14.26
- jazz-browser-media-images@0.14.26
## 0.0.85
### Patch Changes
- Updated dependencies [99a2d9b]
- jazz-tools@0.14.25
- jazz-browser-media-images@0.14.25
- jazz-svelte@0.14.25
## 0.0.84
### Patch Changes
- jazz-svelte@0.13.30
- jazz-tools@0.13.30
## 0.0.83
### Patch Changes
- jazz-svelte@0.13.29
- jazz-tools@0.13.29
## 0.0.82
### Patch Changes
- jazz-svelte@0.13.28
- jazz-tools@0.13.28
## 0.0.81
### Patch Changes
- jazz-svelte@0.13.27
- jazz-tools@0.13.27
## 0.0.80
### Patch Changes
- Updated dependencies [ff846d9]
- jazz-tools@0.13.26
- jazz-svelte@0.13.26
## 0.0.79
### Patch Changes
- jazz-svelte@0.13.25
- jazz-tools@0.13.25
## 0.0.78
### Patch Changes
- Updated dependencies [ec546b4]
- jazz-svelte@0.13.24
## 0.0.77
### Patch Changes
- Updated dependencies [3431076]
- Updated dependencies [02a240c]
- jazz-svelte@0.13.23
- jazz-tools@0.13.23
## 0.0.76
### Patch Changes
- jazz-svelte@0.13.21
- jazz-tools@0.13.21
## 0.0.75
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-svelte@0.13.20
## 0.0.74
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-svelte@0.13.19
## 0.0.73
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-svelte@0.13.18
## 0.0.72
### Patch Changes
- jazz-svelte@0.13.17
- jazz-tools@0.13.17
## 0.0.71
### Patch Changes
- jazz-svelte@0.13.16
- jazz-tools@0.13.16
## 0.0.70
### Patch Changes
- jazz-svelte@0.13.15
- jazz-tools@0.13.15
## 0.0.69
### Patch Changes
- jazz-svelte@0.13.14
- jazz-tools@0.13.14
## 0.0.68
### Patch Changes
- jazz-svelte@0.13.13
- jazz-tools@0.13.13
## 0.0.67
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-svelte@0.13.12
## 0.0.66
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-svelte@0.13.11
## 0.0.65
### Patch Changes
- jazz-svelte@0.13.10
- jazz-tools@0.13.10
## 0.0.64
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-svelte@0.13.9
## 0.0.63
### Patch Changes
- jazz-svelte@0.13.7
## 0.0.62
### Patch Changes
- jazz-svelte@0.13.5
## 0.0.61
### Patch Changes
- jazz-svelte@0.13.4
## 0.0.60
### Patch Changes
- jazz-svelte@0.13.3
## 0.0.59
### Patch Changes
- jazz-svelte@0.13.2
## 0.0.58
### Patch Changes
- jazz-svelte@0.13.0
## 0.0.57
### Patch Changes
- jazz-svelte@0.12.2
## 0.0.56
### Patch Changes
- jazz-svelte@0.12.1
## 0.0.55
### Patch Changes
- jazz-svelte@0.12.0
## 0.0.54
### Patch Changes
- jazz-svelte@0.11.8
## 0.0.53
### Patch Changes
- jazz-svelte@0.11.7
## 0.0.52
### Patch Changes
- 1bfa9bb: Removed when="singedUp" from examples apps' Jazz providers. This is a really niche use-case option and can lead to broken-feeling experiences when anonymous users try to load something.
- jazz-svelte@0.11.6
## 0.0.51
### Patch Changes
- jazz-svelte@0.11.5
## 0.0.50
### Patch Changes
- jazz-svelte@0.11.4
## 0.0.49
### Patch Changes
- jazz-svelte@0.11.3
## 0.0.48
### Patch Changes
- jazz-svelte@0.11.2
## 0.0.47
### Patch Changes
- jazz-svelte@0.11.0
## 0.0.46
### Patch Changes
- jazz-svelte@0.10.15
## 0.0.45
### Patch Changes
- jazz-svelte@0.10.14
## 0.0.44
### Patch Changes
- jazz-svelte@0.10.13
## 0.0.43
### Patch Changes
- Updated dependencies [4612e05]
- jazz-svelte@0.10.12
## 0.0.42
### Patch Changes
- jazz-svelte@0.10.9
## 0.0.41
### Patch Changes
- jazz-svelte@0.10.8
## 0.0.40
### Patch Changes
- Updated dependencies [1136d9b]
- jazz-svelte@0.10.7
## 0.0.39
### Patch Changes
- jazz-svelte@0.10.6
## 0.0.38
### Patch Changes
- jazz-svelte@0.10.5
## 0.0.37
### Patch Changes
- jazz-svelte@0.10.4
## 0.0.36
### Patch Changes
- jazz-svelte@0.10.3
## 0.0.35
### Patch Changes
- jazz-svelte@0.10.2
## 0.0.34
### Patch Changes
- jazz-svelte@0.10.1
## 0.0.33
### Patch Changes
- Updated dependencies [b426342]
- jazz-svelte@0.10.0
## 0.0.32
### Patch Changes
- jazz-svelte@0.9.23
## 0.0.31
### Patch Changes
- jazz-svelte@0.9.22
## 0.0.30
### Patch Changes
- jazz-svelte@0.9.21
## 0.0.29
### Patch Changes
- jazz-svelte@0.9.20
## 0.0.28
### Patch Changes
- jazz-svelte@0.9.19
## 0.0.27
### Patch Changes
- jazz-svelte@0.9.18
## 0.0.26
### Patch Changes
- jazz-svelte@0.9.17
## 0.0.25
### Patch Changes
- jazz-svelte@0.9.16
## 0.0.24
### Patch Changes
- jazz-svelte@0.9.15
## 0.0.23
### Patch Changes
- jazz-svelte@0.9.14
## 0.0.22
### Patch Changes
- jazz-svelte@0.9.13
## 0.0.21
### Patch Changes
- jazz-svelte@0.9.12
## 0.0.20
### Patch Changes
- jazz-svelte@0.9.11
## 0.0.19
### Patch Changes
- jazz-svelte@0.9.10
## 0.0.18
### Patch Changes
- jazz-svelte@0.9.9
## 0.0.17
### Patch Changes
- jazz-svelte@0.9.8
## 0.0.16
### Patch Changes
- jazz-svelte@0.9.1
## 0.0.15
### Patch Changes
- Updated dependencies [9dd8d95]
- jazz-svelte@0.9.0
## 0.0.14
### Patch Changes
- jazz-svelte@0.8.51
## 0.0.13
### Patch Changes
- jazz-svelte@0.8.50
## 0.0.12
### Patch Changes
- jazz-svelte@0.8.49
## 0.0.11
### Patch Changes
- jazz-svelte@0.8.48
## 0.0.10
### Patch Changes
- jazz-svelte@0.8.45
## 0.0.9
### Patch Changes
- jazz-svelte@0.8.44
## 0.0.8
### Patch Changes
- jazz-svelte@0.8.41
## 0.0.7
### Patch Changes
- jazz-svelte@0.8.40
## 0.0.6
### Patch Changes
- Updated dependencies [aa21072]
- jazz-svelte@0.8.39
## 0.0.5
### Patch Changes
- jazz-svelte@0.8.38
## 0.0.4
### Patch Changes
- jazz-svelte@0.0.4
## 0.0.3
### Patch Changes
- jazz-svelte@0.0.3
## 0.0.2
### Patch Changes
- Updated dependencies [0e59e65]
- jazz-svelte@0.0.2

View File

@@ -0,0 +1,68 @@
# Chat example with Jazz and Svelte
## Getting started
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx create-jazz-app@latest chat-app --example chat-svelte
```
Go to the new project directory.
```bash
cd chat-app
```
Run the dev server.
```bash
npm run dev
```
### Using the monorepo
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
Clone the jazz repository.
```bash
git clone https://github.com/garden-co/jazz.git
```
Install and build dependencies.
```bash
pnpm i && npx turbo build
```
Go to the example directory.
```bash
cd jazz/examples/chat-svelte/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
## Configuration: sync server
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 setting the `sync` parameter of `JazzProvider` in [./src/routes/+layout.svelte](./src/routes/+layout.svelte) to `{ peer: "ws://localhost:4200" }`.

View File

@@ -0,0 +1,33 @@
import prettier from 'eslint-config-prettier';
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import ts from 'typescript-eslint';
export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
);

View File

@@ -0,0 +1,44 @@
{
"name": "chat-svelte",
"version": "0.0.86",
"type": "module",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"format-and-lint": "pnpm run format && pnpm run lint",
"format-and-lint:fix": "pnpm run format --write && pnpm run lint --fix",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/kit": "^2.21.1",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@types/eslint": "^9.6.1",
"eslint": "^9.27.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.46.1",
"globals": "^15.15.0",
"jazz-inspector-element": "workspace:*",
"prettier": "^3.5.3",
"prettier-plugin-svelte": "^3.4.0",
"svelte": "^5.31.1",
"svelte-check": "^4.2.1",
"typescript": "5.6.2",
"typescript-eslint": "^8.32.1",
"vite": "6.0.11"
},
"dependencies": {
"@tailwindcss/vite": "^4.1.7",
"jazz-browser-media-images": "workspace:*",
"jazz-svelte": "workspace:*",
"jazz-tools": "workspace:*",
"tailwindcss": "^4.1.7"
}
}

View File

@@ -0,0 +1,54 @@
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

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

View File

@@ -0,0 +1,21 @@
@import 'tailwindcss';
@theme {
--color-stone-50: oklch(0.988281 0.002 75);
--color-stone-75: oklch(0.980563 0.002 75);
--color-stone-100: oklch(0.964844 0.002 75);
--color-stone-200: oklch(0.917969 0.002 75);
--color-stone-300: oklch(0.853516 0.002 75);
--color-stone-400: oklch(0.789063 0.002 75);
--color-stone-500: oklch(0.726563 0.002 75);
--color-stone-600: oklch(0.613281 0.002 75);
--color-stone-700: oklch(0.523438 0.002 75);
--color-stone-800: oklch(0.412109 0.002 75);
--color-stone-900: oklch(0.302734 0.002 75);
--color-stone-925: oklch(0.22 0.002 75);
--color-stone-950: oklch(0.193359 0.002 75);
--color-blue: oklch(0.57 0.2346 261.2);
}
:focus {
@apply outline-hidden;
}

13
examples/chat-svelte/src/app.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
export {};

View File

@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/jazz-icon.png" type="image/png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@@ -0,0 +1,9 @@
<script lang="ts">
let { children } = $props();
</script>
<div
class="flex flex-col justify-between w-screen h-screen bg-stone-50 dark:bg-stone-925 dark:text-white"
>
{@render children()}
</div>

View File

@@ -0,0 +1,13 @@
<script lang="ts">
import type { Snippet } from 'svelte';
let { children, fromMe }: { children: Snippet; fromMe: boolean | undefined } = $props();
</script>
<div
class="line-clamp-10 text-ellipsis rounded-2xl overflow-hidden max-w-[calc(100%-5rem)] shadow-sm p-1 {fromMe
? 'bg-white dark:bg-stone-900 dark:text-white'
: 'bg-blue text-white'}"
>
{@render children()}
</div>

View File

@@ -0,0 +1,9 @@
<script lang="ts">
import type { Snippet } from 'svelte';
let { children, fromMe }: { children: Snippet; fromMe: boolean | undefined } = $props();
const align = fromMe ? 'items-end' : 'items-start';
</script>
<div class="{align} flex flex-col m-3" role="row">
{@render children()}
</div>

View File

@@ -0,0 +1,12 @@
<script lang="ts">
import { ImageDefinition, type Loaded } from 'jazz-tools';
import { useProgressiveImg } from '$lib/utils/useProgressiveImage.svelte';
let { image }: { image: Loaded<typeof ImageDefinition> } = $props();
const { src } = $derived(
useProgressiveImg({
image
})
);
</script>
<img class="h-auto max-h-[20rem] max-w-full rounded-t-xl mb-1" {src} alt="" />

View File

@@ -0,0 +1,7 @@
<script lang="ts">
let { by, madeAt }: { by: string | undefined; madeAt: Date } = $props();
</script>
<div class="text-xs text-neutral-500 mt-1.5">
{by} · {madeAt.toLocaleTimeString()}
</div>

View File

@@ -0,0 +1,7 @@
<script lang="ts">
import type { CoPlainText } from 'jazz-tools';
let { text, className }: { text: CoPlainText | string | null; className?: string } = $props();
</script>
<div class="whitespace-pre-wrap"><p class="px-2 leading-relaxed {className}">{text}</p></div>

View File

@@ -0,0 +1,7 @@
<script lang="ts">
let { children } = $props();
</script>
<div class="flex flex-col-reverse flex-1 overflow-y-auto" role="application">
{@render children()}
</div>

View File

@@ -0,0 +1,36 @@
<script lang="ts">
import BubbleBody from '$lib/components/BubbleBody.svelte';
import BubbleContainer from '$lib/components/BubbleContainer.svelte';
import BubbleImage from '$lib/components/BubbleImage.svelte';
import BubbleInfo from '$lib/components/BubbleInfo.svelte';
import BubbleText from '$lib/components/BubbleText.svelte';
import type { Message } from '$lib/schema';
import type { Account, Loaded } from 'jazz-tools';
let {
me,
msg
}: {
me: Loaded<typeof Account> | null | undefined;
msg: Loaded<typeof Message>;
} = $props();
const lastEdit = $derived(msg._edits.text);
const fromMe = $derived(lastEdit?.by?.isMe);
const { text, image } = $derived(msg);
</script>
{#if me && (!me.canRead(msg) || !msg.text?.toString())}
<BubbleContainer fromMe={false}>
<BubbleBody fromMe={false}>
<BubbleText text="Message not readable" className="italic text-gray-500"></BubbleText>
</BubbleBody>
</BubbleContainer>
{:else}
<BubbleContainer {fromMe}>
<BubbleBody {fromMe}>
{#if image}
<BubbleImage {image} />{/if}
<BubbleText {text} />
</BubbleBody>
<BubbleInfo by={lastEdit?.by?.profile?.name} madeAt={lastEdit?.madeAt || new Date()} />
</BubbleContainer>
{/if}

View File

@@ -0,0 +1,3 @@
<div class="flex items-center justify-center h-full px-3 text-base text-stone-500 md:text-2xl">
Start a conversation below.
</div>

View File

@@ -0,0 +1,19 @@
<script lang="ts">
let { size = 24, strokeWidth = 2 } = $props();
</script>
<svg
xmlns="http://www.w3.org/2000/svg"
width={size}
height={size}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width={strokeWidth}
stroke-linecap="round"
stroke-linejoin="round"
class="lucide lucide-image-icon lucide-image"
><rect width="18" height="18" x="3" y="3" rx="2" ry="2" /><circle cx="9" cy="9" r="2" /><path
d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"
/></svg
>

View File

@@ -0,0 +1,32 @@
<script lang="ts">
import type { ChangeEventHandler } from 'svelte/elements';
import ImageIcon from '$lib/components/ImageIcon.svelte';
let { onImageChange }: { onImageChange?: ChangeEventHandler<HTMLInputElement> } = $props();
let input = $state<HTMLInputElement>();
const onUploadClick = () => {
input?.click();
};
</script>
<button
type="button"
aria-label="Send image"
title="Send image"
onclick={onUploadClick}
class="text-stone-500 p-1.5 rounded-full hover:bg-stone-100 hover:text-stone-800 dark:hover:bg-stone-800 dark:hover:text-stone-200 transition-colors"
>
<ImageIcon size={24} strokeWidth={1.5} />
</button>
<label class="sr-only">
Image
<input
bind:this={input}
type="file"
accept="image/png, image/jpeg, image/gif"
onchange={onImageChange}
/>
</label>

View File

@@ -0,0 +1,9 @@
<script lang="ts">
let { children } = $props();
</script>
<div
class="flex gap-1 p-3 mt-auto bg-white border-t shadow-2xl border-stone-200 dark:bg-transparent dark:border-stone-900"
>
{@render children()}
</div>

View File

@@ -0,0 +1,20 @@
<script lang="ts">
let { onSubmit }: { onSubmit: (text: string) => void } = $props();
const inputId = $props.id();
</script>
<div class="flex-1">
<label class="sr-only" for={inputId}> Type a message and press Enter </label>
<input
id={inputId}
class="block w-full px-3 py-1 border rounded-full border-stone-200 placeholder:text-stone-500 dark:bg-stone-925 dark:text-white dark:border-stone-900"
placeholder="Type a message and press Enter"
maxLength={2048}
type="text"
onkeydown={({ key, currentTarget: input }) => {
if (key !== 'Enter' || !input.value) return;
onSubmit(input.value);
input.value = '';
}}
/>
</div>

View File

@@ -0,0 +1,9 @@
<script lang="ts">
let { children } = $props();
</script>
<div
class="flex justify-between w-full gap-2 p-3 bg-white border-b border-stone-200 dark:bg-transparent dark:border-stone-900"
>
{@render children()}
</div>

View File

@@ -0,0 +1,8 @@
import { co, z } from 'jazz-tools';
export const Message = co.map({
text: co.plainText(),
image: z.optional(co.image())
});
export const Chat = co.list(Message);

View File

@@ -0,0 +1,16 @@
const animals = [
'elephant',
'penguin',
'giraffe',
'octopus',
'kangaroo',
'dolphin',
'cheetah',
'koala',
'platypus',
'pangolin'
];
export function getRandomUsername() {
return `Anonymous ${animals[Math.floor(Math.random() * animals.length)]}`;
}

View File

@@ -0,0 +1,53 @@
import { ImageDefinition, type Loaded } from 'jazz-tools';
import { onDestroy } from 'svelte';
export function useProgressiveImg({
image,
maxWidth,
targetWidth
}: {
image: Loaded<typeof ImageDefinition> | null | undefined;
maxWidth?: number;
targetWidth?: number;
}) {
let current = $state<{
src?: string;
res?: `${number}x${number}` | 'placeholder';
}>();
const originalSize = $state(image?.originalSize);
const unsubscribe = image?.subscribe({}, (update: Loaded<typeof ImageDefinition>) => {
const highestRes = ImageDefinition.highestResAvailable(update, { maxWidth, targetWidth });
if (highestRes) {
if (highestRes.res !== current?.res) {
const blob = highestRes.stream.toBlob();
if (blob) {
const blobURI = URL.createObjectURL(blob);
current = { src: blobURI, res: highestRes.res };
setTimeout(() => URL.revokeObjectURL(blobURI), 200);
}
}
} else {
current = {
src: update?.placeholderDataURL,
res: 'placeholder'
};
}
});
onDestroy(() => () => {
unsubscribe?.();
});
return {
get src() {
return current?.src;
},
get res() {
return current?.res;
},
originalSize
};
}

View File

@@ -0,0 +1,32 @@
<script lang="ts">
import '../app.css';
import { JazzProvider } from 'jazz-svelte';
import 'jazz-inspector-element';
import { page } from '$app/state';
import { apiKey } from '../apiKey';
import { getRandomUsername } from '$lib/utils';
let { children } = $props();
const defaultProfileName = getRandomUsername();
</script>
<svelte:head>
<title>Jazz Chat Example</title>
</svelte:head>
<div class="h-full bg-white text-stone-700 dark:text-stone-400 dark:bg-stone-925">
<JazzProvider
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`
}}
{defaultProfileName}
>
{@render children?.()}
</JazzProvider>
<jazz-inspector></jazz-inspector>
</div>
<style>
:global(html, body) {
margin: 0;
}
</style>

View File

@@ -0,0 +1,16 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { Chat } from '$lib/schema';
import { AccountCoState } from 'jazz-svelte';
import { Account, Group } from 'jazz-tools';
const account = new AccountCoState(Account);
const me = $derived(account.current);
$effect(() => {
if (!me) return;
const group = Group.create();
group.addMember('everyone', 'writer');
const chat = Chat.create([], group);
goto(`/chat/${chat.id}`);
});
</script>

View File

@@ -0,0 +1,116 @@
<script lang="ts">
import { createImage } from 'jazz-browser-media-images';
import { AccountCoState, CoState } from 'jazz-svelte';
import { Account, CoPlainText, type ID } from 'jazz-tools';
import { page } from '$app/state';
import { Chat, Message } from '$lib/schema';
import AppContainer from '$lib/components/AppContainer.svelte';
import ChatBody from '$lib/components/ChatBody.svelte';
import ChatBubble from '$lib/components/ChatBubble.svelte';
import EmptyChatMessage from '$lib/components/EmptyChatMessage.svelte';
import ImageInput from '$lib/components/ImageInput.svelte';
import InputBar from '$lib/components/InputBar.svelte';
import TopBar from '$lib/components/TopBar.svelte';
import TextInput from '$lib/components/TextInput.svelte';
const chatId = $derived(page.params.id) as ID<typeof Chat>;
const chat = $derived(
new CoState(Chat, chatId, {
resolve: {
$each: {
text: true
}
}
})
);
const account = new AccountCoState(Account, {
resolve: {
profile: true
}
});
const me = $derived(account.current);
let showNLastMessages = $state(30);
const sendImage = (event: Event & { currentTarget: HTMLInputElement }) => {
const file = event.currentTarget.files?.[0];
if (!file || !chat.current) return;
if (file.size > 5000000) {
alert('Please upload an image less than 5MB.');
return;
}
createImage(file, { owner: chat.current._owner }).then((image) => {
if (!chat.current) return;
chat.current.push(
Message.create(
{
text: CoPlainText.create(file.name, chat.current._owner),
image: image
},
chat.current._owner
)
);
});
};
</script>
<AppContainer>
<TopBar>
<input
type="text"
value={me?.profile?.name ?? ''}
class="bg-transparent"
onchange={(e) => {
if (!me?.profile) return;
const target = e.target as HTMLInputElement;
me.profile.name = target.value;
}}
placeholder="Set username"
/>
<button
onclick={() => {
account.logOut();
window.location.reload(); // Otherwise the provider will not update with default profile name
}}>Log out</button
>
</TopBar>
{#if !chat}
<div class="flex items-center justify-center flex-1">Loading...</div>
{:else}
<ChatBody>
{#if chat.current && chat.current.length > 0}
{#each chat.current.slice(-showNLastMessages).reverse() as msg (msg.id)}
<ChatBubble {me} {msg} />
{/each}
{:else}
<EmptyChatMessage />
{/if}
{#if chat.current && chat.current.length > showNLastMessages}
<button
class="block px-4 py-1 mx-auto my-2 border rounded"
onclick={() => (showNLastMessages += 10)}
>
Show more
</button>
{/if}
</ChatBody>
<InputBar>
<ImageInput onImageChange={sendImage} />
<TextInput
onSubmit={(text: string) => {
if (!chat.current) return;
chat.current.push(
Message.create(
{ text: CoPlainText.create(text, chat.current._owner) },
chat.current._owner
)
);
}}
/>
</InputBar>
{/if}
</AppContainer>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,18 @@
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
}
};
export default config;

View File

@@ -0,0 +1,40 @@
import { expect } from 'vitest';
import { ChatPage } from './pages/ChatPage';
import { test } from '@playwright/test';
test('chat works between two windows', async ({ page: marioPage, browser }) => {
await marioPage.goto('/');
const context = await browser.newContext();
const luigiPage = await context.newPage();
await marioPage.waitForURL('/chat/**');
const roomUrl = marioPage.url();
await luigiPage.goto(roomUrl);
const marioChat = new ChatPage(marioPage);
const luigiChat = new ChatPage(luigiPage);
await marioChat.setUsername('Mario');
const message1ByMario = 'Hello Luigi, are you ready to save the princess?';
await marioChat.sendMessage(message1ByMario);
await marioChat.expectMessageRow(message1ByMario);
const roomURL = marioPage.url();
await luigiPage.goto(roomURL);
await luigiChat.setUsername('Luigi');
await luigiChat.expectMessageRow(message1ByMario);
const message2ByLuigi = "No, I'm not ready yet. I'm still trying to find the key to the castle.";
await luigiChat.sendMessage(message2ByLuigi);
await luigiChat.expectMessageRow(message2ByLuigi);
await marioChat.expectMessageRow(message1ByMario);
await luigiChat.expectMessageRow(message2ByLuigi);
await context.close();
});

View File

@@ -0,0 +1,41 @@
import { type Locator, type Page, expect } from '@playwright/test';
export class ChatPage {
readonly page: Page;
readonly messageInput: Locator;
readonly logoutButton: Locator;
readonly usernameInput: Locator;
constructor(page: Page) {
this.page = page;
this.messageInput = page.getByRole('textbox', {
name: 'Type a message and press Enter'
});
this.logoutButton = page.getByRole('button', {
name: 'Log out'
});
this.usernameInput = page.getByPlaceholder('Set username');
}
async setUsername(username: string) {
await this.usernameInput.fill(username);
}
async sendMessage(message: string) {
await this.messageInput.fill(message);
await this.messageInput.press('Enter');
}
async expectMessageRow(message: string) {
await expect(this.page.getByText(message)).toBeVisible();
}
async expectUserNameNotToBeAnonymousUser() {
await expect(this.usernameInput).not.toHaveValue(/anonymous user/i);
await expect(this.usernameInput).toHaveValue(/^Anonymous \w+/);
}
async logout() {
await this.logoutButton.click();
await this.page.goto('/');
}
}

View File

@@ -0,0 +1,19 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
}
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}

View File

@@ -0,0 +1,7 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [tailwindcss(), sveltekit()]
});

View File

@@ -1 +1,6 @@
dist
dist
# env files
.env
.env.*
!.env.example
!.env.test

View File

@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="./public/favicon.ico" type="image/png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz Chat Vue Example</title>
</head>
<body>

View File

@@ -1,6 +1,5 @@
{
"name": "chat-vue",
"version": "0.0.120",
"private": true,
"type": "module",
"scripts": {
@@ -25,12 +24,12 @@
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/tsconfig": "^0.5.1",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"eslint-plugin-vue": "^9.28.0",
"npm-run-all2": "^6.2.3",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"postcss": "^8.4.40",
"@tailwindcss/postcss": "^4.1.10",
"tailwindcss": "^4.1.10",
"typescript": "5.6.2",
"vite": "6.3.5",
"vite-plugin-vue-devtools": "^7.4.6",

View File

@@ -1,6 +1,5 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
"@tailwindcss/postcss": {},
},
};

View File

@@ -1,3 +1 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

View File

@@ -1,11 +0,0 @@
import type { Config } from "tailwindcss";
const config: Config = {
content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
export default config;

View File

@@ -29,3 +29,9 @@ sync-db/
/playwright-report/
/blob-report/
/playwright/.cache/
# env files
.env
.env.*
!.env.example
!.env.test

View File

@@ -2,7 +2,7 @@
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/jazz-logo.png" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="/src/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz Chat Example</title>

View File

@@ -1,56 +0,0 @@
job "chat$BRANCH_SUFFIX" {
region = "global"
datacenters = ["*"]
group "static" {
count = 4
network {
port "http" {
to = 80
}
}
constraint {
attribute = "${node.class}"
operator = "="
value = "cloud"
}
spread {
attribute = "${node.datacenter}"
weight = 100
}
constraint {
distinct_hosts = true
}
task "server" {
driver = "docker"
config {
image = "$DOCKER_TAG"
ports = ["http"]
auth = {
username = "$DOCKER_USER"
password = "$DOCKER_PASSWORD"
}
}
service {
tags = ["public"]
name = "chat$BRANCH_SUFFIX"
port = "http"
provider = "consul"
}
resources {
cpu = 50 # MHz
memory = 50 # MB
}
}
}
}
# deploy bump 4

View File

@@ -1,7 +1,6 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.220",
"type": "module",
"scripts": {
"dev": "vite",
@@ -25,13 +24,13 @@
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@tailwindcss/postcss": "^4.1.10",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react-swc": "^3.10.1",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"postcss": "^8.4.40",
"tailwindcss": "^4.1.10",
"typescript": "5.6.2",
"vite": "6.3.5"
}

View File

@@ -1,6 +1,5 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
"@tailwindcss/postcss": {},
},
};

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,3 +1,54 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";
/* Custom stone color palette */
@theme {
--color-stone-50: oklch(0.988281 0.002 75);
--color-stone-75: oklch(0.980563 0.002 75);
--color-stone-100: oklch(0.964844 0.002 75);
--color-stone-200: oklch(0.917969 0.002 75);
--color-stone-300: oklch(0.853516 0.002 75);
--color-stone-400: oklch(0.789063 0.002 75);
--color-stone-500: oklch(0.726563 0.002 75);
--color-stone-600: oklch(0.613281 0.002 75);
--color-stone-700: oklch(0.523438 0.002 75);
--color-stone-800: oklch(0.412109 0.002 75);
--color-stone-900: oklch(0.302734 0.002 75);
--color-stone-925: oklch(0.22 0.002 75);
--color-stone-950: oklch(0.193359 0.002 75);
/* Blue color overrides */
--color-blue-50: #eef2ff;
--color-blue-100: #e0e7ff;
--color-blue-200: #c7d2fe;
--color-blue-300: #a5b4fc;
--color-blue-400: #818cf8;
--color-blue-500: #5870f1;
--color-blue-600: #5145cd;
--color-blue-700: #4338ca;
--color-blue-800: #3730a3;
--color-blue-900: #312e81;
--color-blue-950: #1e1b4b;
--color-blue: #146aff;
}
@layer base {
*:focus {
outline: none;
}
:root {
--border-default: var(--color-stone-200);
}
.dark {
--border-default: var(--color-stone-900);
}
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--border-default, currentColor);
}
}

View File

@@ -86,7 +86,7 @@ export function BubbleImage(props: { image: ImageDefinition }) {
<ProgressiveImg image={props.image}>
{({ src }) => (
<img
className="h-auto max-h-[20rem] max-w-full rounded-t-xl mb-1"
className="h-auto max-h-80 max-w-full rounded-t-xl mb-1"
src={src}
/>
)}

View File

@@ -1,67 +0,0 @@
import type { Config } from "tailwindcss";
import plugin from "tailwindcss/plugin";
const colors = require("tailwindcss/colors");
const stonePalette = {
50: "oklch(0.988281 0.002 75)",
75: "oklch(0.980563 0.002 75)",
100: "oklch(0.964844 0.002 75)",
200: "oklch(0.917969 0.002 75)",
300: "oklch(0.853516 0.002 75)",
400: "oklch(0.789063 0.002 75)",
500: "oklch(0.726563 0.002 75)",
600: "oklch(0.613281 0.002 75)",
700: "oklch(0.523438 0.002 75)",
800: "oklch(0.412109 0.002 75)",
900: "oklch(0.302734 0.002 75)",
925: "oklch(0.220000 0.002 75)",
950: "oklch(0.193359 0.002 75)",
} as const;
const stonePaletteWithAlpha = { ...stonePalette };
Object.keys(stonePalette).forEach((key) => {
stonePaletteWithAlpha[key] = stonePaletteWithAlpha[key].replace(
")",
"/ <alpha-value>)",
);
});
const config: Config = {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {
colors: {
stone: stonePaletteWithAlpha,
blue: {
...colors.indigo,
500: "#5870F1",
DEFAULT: "#146AFF",
},
},
container: {
center: true,
padding: {
DEFAULT: "0.75rem",
sm: "1rem",
},
screens: {
md: "500px",
lg: "500px",
xl: "500px",
},
},
},
},
plugins: [
plugin(({ addBase }) =>
addBase({
"*:focus": {
outline: "none",
},
}),
),
],
} as const;
export default config;

View File

@@ -0,0 +1 @@
VITE_CLERK_PUBLISHABLE_KEY=

View File

@@ -1 +1 @@
VITE_CLERK_PUBLISHABLE_KEY=pk_test_ZXZpZGVudC1kYW5lLTg5LmNsZXJrLmFjY291bnRzLmRldiQ
VITE_CLERK_PUBLISHABLE_KEY=pk_test_ZXZpZGVudC1kYW5lLTg5LmNsZXJrLmFjY291bnRzLmRldiQ

View File

@@ -23,4 +23,10 @@ dist-ssr
*.sln
*.sw?
playwright-report
playwright-report
# Env
.env
.env.*
!.env.example
!.env.test

View File

@@ -7,23 +7,34 @@ Live version: [https://clerk-demo.jazz.tools](https://clerk-demo.jazz.tools)
## Getting started
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx create-jazz-app@latest clerk-app --example clerk
```
Go to the new project directory.
```bash
cd clerk-app
```
Rename .env.example to .env
```bash
mv .env.example .env
```
Update `VITE_CLERK_PUBLISHABLE_KEY` with your [Publishable Key](https://clerk.com/docs/deployments/clerk-environment-variables#clerk-publishable-and-secret-keys) from Clerk.
Run the dev server.
```bash
npm run dev
```
@@ -33,21 +44,33 @@ npm run dev
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
Clone the jazz repository.
```bash
git clone https://github.com/garden-co/jazz.git
```
Install and build dependencies.
```bash
pnpm i && npx turbo build
```
Go to the example directory.
```bash
cd jazz/examples/clerk/
```
Rename .env.example to .env
```bash
mv .env.example .env
```
Update `VITE_CLERK_PUBLISHABLE_KEY` with your [Publishable Key](https://clerk.com/docs/deployments/clerk-environment-variables#clerk-publishable-and-secret-keys) from Clerk.
Start the dev server.
```bash
pnpm dev
```
@@ -57,4 +80,3 @@ Open [http://localhost:5173](http://localhost:5173) with your browser to see the
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Minimal Auth Clerk Example | Jazz</title>
</head>

View File

@@ -1,7 +1,6 @@
{
"name": "clerk",
"private": true,
"version": "0.0.119",
"type": "module",
"scripts": {
"dev": "vite",
@@ -14,6 +13,7 @@
},
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:*",
"jazz-tools": "workspace:*",

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -3,6 +3,7 @@ import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzInspector } from "jazz-inspector";
import { JazzProviderWithClerk } from "jazz-react-auth-clerk";
import { ReactNode } from "react";
import { apiKey } from "./apiKey";
@@ -44,6 +45,7 @@ if (location.search.includes("expirationTest")) {
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
<JazzProvider>
<App />
<JazzInspector />
</JazzProvider>
</ClerkProvider>
</StrictMode>,

View File

@@ -1,6 +1,5 @@
{
"name": "file-share-svelte",
"version": "0.0.104",
"private": true,
"type": "module",
"scripts": {
@@ -21,7 +20,6 @@
"@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"@types/is-ci": "^3.0.4",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
@@ -32,7 +30,8 @@
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.33.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.17",
"@tailwindcss/postcss": "^4.1.10",
"tailwindcss": "^4.1.10",
"typescript": "5.6.2",
"typescript-eslint": "^8.0.0",
"vite": "6.3.5"

View File

@@ -1,6 +1,5 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
"@tailwindcss/postcss": {},
},
};

View File

@@ -1,3 +1 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@import 'tailwindcss';

View File

@@ -1,8 +1,8 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta charset="utf-8" />
<link rel="icon" type="image/png" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>

View File

@@ -1,11 +1,3 @@
<script lang="ts" module>
declare module 'jazz-svelte' {
interface Register {
Account: typeof FileShareAccount;
}
}
</script>
<script lang="ts">
import { JazzProvider } from 'jazz-svelte';
import "jazz-inspector-element"

View File

@@ -66,7 +66,7 @@
</script>
<div class="min-h-screen bg-gray-50">
<div class="container mx-auto max-w-4xl px-4 py-8">
<div class="mx-auto max-w-4xl px-4 py-8">
<div class="mb-12 flex items-center justify-between">
<div>
<h1 class="mb-2 text-4xl font-bold text-gray-900">File Share</h1>

View File

@@ -51,7 +51,7 @@
</svelte:head>
{#if file.current}
<div class="container mx-auto max-w-3xl p-4">
<div class="mx-auto max-w-3xl p-4">
<div class="rounded-lg bg-white p-6 shadow-md">
<div class="mb-6 flex items-center justify-between">
<div class="flex items-center gap-3">
@@ -88,7 +88,7 @@
</div>
</div>
{:else}
<div class="container mx-auto max-w-3xl p-4">
<div class="mx-auto max-w-3xl p-4">
<div class="rounded-lg bg-white p-6 shadow-md">
<p class="text-gray-600">Loading file...</p>
</div>

View File

@@ -1,12 +0,0 @@
import typography from '@tailwindcss/typography';
import type { Config } from 'tailwindcss';
export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {}
},
plugins: [typography]
} satisfies Config;

View File

@@ -25,4 +25,10 @@ dist-ssr
*.sln
*.sw?
playwright-report
playwright-report
# env files
.env
.env.*
!.env.example
!.env.test

View File

@@ -2,7 +2,7 @@
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="./public/favicon.ico" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz | React + Demo Auth + Tailwind</title>
</head>

View File

@@ -1,7 +1,6 @@
{
"name": "filestream",
"private": true,
"version": "0.0.59",
"type": "module",
"scripts": {
"dev": "vite",
@@ -11,22 +10,22 @@
"format-and-lint:fix": "biome check . --write"
},
"dependencies": {
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"jazz-inspector": "workspace:*",
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@tailwindcss/postcss": "^4.1.10",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@vitejs/plugin-react": "^4.5.1",
"autoprefixer": "^10.4.20",
"globals": "^15.11.0",
"is-ci": "^3.0.1",
"postcss": "^8.5.3",
"tailwindcss": "^3.4.17",
"tailwindcss": "^4.1.10",
"typescript": "5.6.2",
"vite": "6.3.5"
}

View File

@@ -1,6 +1,5 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
"@tailwindcss/postcss": {},
},
};

View File

@@ -4,7 +4,7 @@ import { Logo } from "./Logo.tsx";
function App() {
return (
<>
<main className="container mt-16 flex flex-col gap-8">
<main className="max-w-3xl mx-auto px-3 mt-16 flex flex-col gap-8">
<Logo />
<FileWidget />
</main>

View File

@@ -1,3 +1 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

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