Compare commits

..

54 Commits

Author SHA1 Message Date
Guido D'Orsi
a383c7e984 Merge pull request #2432 from garden-co/changeset-release/main
Version Packages
2025-06-05 13:11:13 +02:00
github-actions[bot]
8ca283147d Version Packages 2025-06-05 11:04:14 +00:00
Guido D'Orsi
c3d87796ed chore: update changeset 2025-06-05 13:00:37 +02:00
Guido D'Orsi
cb88caced9 fix(comap): return a valid value on _createdAt even when setting a custom uniqueness value 2025-06-05 12:58:26 +02:00
Guido D'Orsi
6313ead62d Revert "fix: use creation time from CoValue header"
This reverts commit cc0479afe0.
2025-06-05 12:38:23 +02:00
Guido D'Orsi
f674910aa9 Merge pull request #2426 from garden-co/emil/comap-time-getters
feat: `_createdAt` and `_lastUpdatedAt`
2025-06-05 12:23:23 +02:00
Guido D'Orsi
37fc25f5a6 Merge pull request #2434 from garden-co/fix/svelte-costate
Fix id reactivity on CoState for Svelte 5.33 (second try)
2025-06-05 12:22:19 +02:00
Guido D'Orsi
5e9c338c27 Merge pull request #2436 from garden-co/feat/react-19-updates
fix(react-19): optimize re-renders when the values are already in memory
2025-06-05 12:21:55 +02:00
Guido D'Orsi
4b61f7c7a5 chore: format 2025-06-05 12:20:58 +02:00
Guido D'Orsi
1c8472ffbd Merge pull request #2441 from garden-co/fix/union-schema-conversion
Fix union schemas in anySchemaToCoSchema
2025-06-05 12:19:33 +02:00
Benjamin S. Leveritt
9dba68ac36 Remove migration script
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-06-05 11:18:29 +01:00
Anselm
13b57aa576 Add changeset 2025-06-05 11:10:05 +01:00
Anselm
aedf0f3ac5 Fix union schemas in anySchemaToCoSchema 2025-06-05 11:09:06 +01:00
Benjamin S. Leveritt
7fa61644b0 Revert turbo.json to original state 2025-06-05 10:19:22 +01:00
Benjamin S. Leveritt
12389c82f9 Add migration script to update all projects to enhanced ignore script 2025-06-05 10:05:16 +01:00
Benjamin S. Leveritt
4c03a17d3a Optimize turbo.json for better caching and build performance 2025-06-05 10:04:51 +01:00
Benjamin S. Leveritt
5d1ea45a9c Add enhanced Vercel build ignore script with change detection 2025-06-05 10:04:34 +01:00
Emil Sayahi
cc0479afe0 fix: use creation time from CoValue header 2025-06-04 15:45:59 -07:00
Emil Sayahi
cfb6786468 feat(jazz-expo): API for clearing local DB (#2427)
* feat(jazz-expo): API for clearing local DB

todo:
- tests
- changeset

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

This reverts commit 459e1d04ea.

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

* chore: changeset

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

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

---------

Co-authored-by: Guido D'Orsi <guido@garden.co>
2025-06-04 12:35:04 -07:00
Emil Sayahi
5662faa9c0 chore: changeset 2025-06-04 12:10:15 -07:00
Emil Sayahi
3e7d9cb585 feat: tests 2025-06-04 12:08:56 -07:00
Guido D'Orsi
2116a598ae fix(react-19): optimize re-renders when the values are already in memory 2025-06-04 19:34:12 +02:00
Guido D'Orsi
d14a069a12 Fix id reactivity on CoState for Svelte 5.33 (second try) 2025-06-04 16:11:14 +02:00
Anselm Eickhoff
aacef80994 Merge pull request #2433 from garden-co/fix/team-page
update team page, adding me and making all socials the same order
2025-06-04 14:46:10 +01:00
Sammii
2a237e5d32 amending file .ext 2025-06-04 14:39:27 +01:00
Sammii
0fe30eca0b update team page, adding me and making all socials the same order 2025-06-04 14:23:40 +01:00
Guido D'Orsi
dea7a8dfd9 Merge pull request #2282 from Wizzel1/Add-missing-discriminator
Add missing discriminator
2025-06-04 15:21:29 +02:00
Guido D'Orsi
ab7191bed0 Merge remote-tracking branch 'origin/main' into Add-missing-discriminator 2025-06-04 15:12:14 +02:00
Guido D'Orsi
901b7c0a51 Merge pull request #2377 from garden-co/2376-groupmakepublic-as-an-alias
Add makePublic to group
2025-06-04 15:02:05 +02:00
Benjamin S. Leveritt
17bea5975c Merge pull request #2430 from garden-co/test-create-jazz-app
Test `create-jazz-app`
2025-06-04 12:54:56 +01:00
Benjamin S. Leveritt
e005ecd0a1 Add changeset 2025-06-04 12:08:27 +01:00
Benjamin S. Leveritt
e7e505e5f3 Add changeset 2025-06-04 12:03:58 +01:00
Benjamin S. Leveritt
d6ffe03d3c Add makePublic to docs 2025-06-04 12:02:18 +01:00
Benjamin S. Leveritt
1120747a24 Add makePublic alias to some example apps 2025-06-04 11:50:24 +01:00
Benjamin S. Leveritt
1e2d7d1c4e Add makePublic to group 2025-06-04 11:44:06 +01:00
Benjamin S. Leveritt
e26f110acd Merge pull request #2428 from garden-co/feature/co-map-migrations
Tweak CoMap migration copy and examples
2025-06-04 11:37:21 +01:00
Benjamin S. Leveritt
28f84a4ee6 Update lock 2025-06-04 11:31:36 +01:00
Benjamin S. Leveritt
cffe4abb84 Handle SIGINT gracefully 2025-06-04 11:21:00 +01:00
Benjamin S. Leveritt
2e0b7cee8c Refactor package manager detection into utils 2025-06-04 11:21:00 +01:00
Benjamin S. Leveritt
d3b47f59e8 Add automatic tests 2025-06-04 11:21:00 +01:00
Benjamin S. Leveritt
aea3287965 Merge pull request #2373 from lukahartwig/main
Set default package manager based on command runner
2025-06-04 11:17:25 +01:00
Benjamin S. Leveritt
6525f8a12e Merge pull request #2325 from garden-co/2324-turbo-dev-doesnt-need-to-build-the-local-package
Turbo just builds deps now
2025-06-04 09:11:16 +01:00
Benjamin S. Leveritt
fe4c934a4b Tweak copy and examples in the docs 2025-06-04 08:26:05 +01:00
Emil Sayahi
60261c8dba feat: _createdAt and _lastUpdatedAt 2025-06-03 13:34:55 -07:00
Luka Hartwig
fa2227716f Remove return type 2025-05-27 23:08:56 +02:00
Luka Hartwig
38dabd4602 Set default package manager based on command runner 2025-05-27 16:34:40 +02:00
Benjamin S. Leveritt
69709c2cf2 Turbo just builds deps now
What a smol change?
2025-05-22 10:29:42 +01:00
Wizzel1
e88252bee4 Fix formatting 2025-05-19 20:20:52 +02:00
Wizzel1
a6b7857f6f Fix markdown formatting 2025-05-19 20:06:28 +02:00
Wizzel1
265c30158e Fix markdown formatting 2025-05-19 19:59:56 +02:00
Wizzel1
505e132f1e Run format script 2025-05-19 19:53:12 +02:00
Wizzel1
c6d5195cb5 Update tests 2025-05-19 19:48:22 +02:00
Wizzel1
8af543e7d6 Update docs 2025-05-19 19:48:17 +02:00
Wizzel1
016b2098a7 Update example 2025-05-19 19:48:11 +02:00
160 changed files with 1955 additions and 588 deletions

View File

@@ -1,5 +1,20 @@
# betterauth
## 0.1.24
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-betterauth-server-plugin@0.14.21
- jazz-inspector@0.14.21
- jazz-react@0.14.21
- jazz-react-auth-betterauth@0.14.21
- jazz-betterauth-client-plugin@0.14.21
## 0.1.23
### Patch Changes

View File

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

View File

@@ -1,5 +1,18 @@
# chat-rn-expo-clerk
## 1.0.144
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [cfb6786]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-expo@0.14.21
- jazz-react-native-media-images@0.14.21
## 1.0.143
### Patch Changes

View File

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

View File

@@ -1,5 +1,17 @@
# chat-rn-expo
## 1.0.12
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [cfb6786]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-expo@0.14.21
## 1.0.11
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn-expo",
"version": "1.0.11",
"version": "1.0.12",
"main": "index.ts",
"scripts": {
"build": "expo prebuild",

View File

@@ -1,5 +1,19 @@
# chat-rn
## 1.0.139
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [c3d8779]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- cojson@0.14.21
- jazz-react-native@0.14.21
- cojson-transport-ws@0.14.21
## 1.0.138
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.138",
"version": "1.0.139",
"main": "index.js",
"scripts": {
"android": "react-native run-android",

View File

@@ -1,5 +1,17 @@
# chat-vue
## 0.0.119
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-browser@0.14.21
- jazz-vue@0.14.21
## 0.0.118
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-vue",
"version": "0.0.118",
"version": "0.0.119",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,17 @@
# jazz-example-chat
## 0.0.219
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-inspector@0.14.21
- jazz-react@0.14.21
## 0.0.218
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.218",
"version": "0.0.219",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -18,7 +18,7 @@ export function App() {
const createChat = () => {
if (!me) return;
const group = Group.create();
group.addMember("everyone", "writer");
group.makePublic("writer");
const chat = Chat.create([], group);
router.navigate("/#/chat/" + chat.id);

View File

@@ -1,5 +1,17 @@
# minimal-auth-clerk
## 0.0.118
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
- jazz-react-auth-clerk@0.14.21
## 0.0.117
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.117",
"version": "0.0.118",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,18 @@
# file-share-svelte
## 0.0.103
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [d14a069]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-svelte@0.14.21
- jazz-inspector-element@0.14.21
## 0.0.102
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "file-share-svelte",
"version": "0.0.102",
"version": "0.0.103",
"private": true,
"type": "module",
"scripts": {
@@ -30,7 +30,7 @@
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte": "^5.33.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",

View File

@@ -1,5 +1,17 @@
# jazz-tailwind-demo-auth-starter
## 0.0.58
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-inspector@0.14.21
- jazz-react@0.14.21
## 0.0.57
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "filestream",
"private": true,
"version": "0.0.57",
"version": "0.0.58",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# form
## 0.1.59
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.1.58
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.1.58",
"version": "0.1.59",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# image-upload
## 0.0.115
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.114
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.114",
"version": "0.0.115",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,14 @@
# jazz-example-inspector
## 0.0.168
### Patch Changes
- Updated dependencies [c3d8779]
- cojson@0.14.21
- jazz-inspector@0.14.21
- cojson-transport-ws@0.14.21
## 0.0.167
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.167",
"version": "0.0.168",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# jazz-nextjs
## 0.1.8
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.1.7
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-nextjs",
"version": "0.1.7",
"version": "0.1.8",
"private": true,
"scripts": {
"dev": "next dev --turbopack",

View File

@@ -1,5 +1,16 @@
# multi-cursors
## 0.0.111
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.110
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "multi-cursors",
"private": true,
"version": "0.0.110",
"version": "0.0.111",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -36,7 +36,7 @@ export const CursorAccount = co
if (account.profile === undefined) {
const group = Group.create();
group.addMember("everyone", "reader"); // The profile info is visible to everyone
group.makePublic(); // The profile info is visible to everyone
account.profile = CursorProfile.create(
{

View File

@@ -1,5 +1,17 @@
# multiauth
## 0.0.59
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
- jazz-react-auth-clerk@0.14.21
## 0.0.58
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "multiauth",
"private": true,
"version": "0.0.58",
"version": "0.0.59",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,17 @@
# jazz-example-musicplayer
## 0.0.140
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-inspector@0.14.21
- jazz-react@0.14.21
## 0.0.139
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.139",
"version": "0.0.140",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# organization
## 0.0.111
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.110
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "organization",
"private": true,
"version": "0.0.110",
"version": "0.0.111",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,17 @@
# passkey-svelte
## 0.0.105
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [d14a069]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-svelte@0.14.21
## 0.0.104
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "passkey-svelte",
"version": "0.0.104",
"version": "0.0.105",
"type": "module",
"private": true,
"scripts": {
@@ -25,7 +25,7 @@
"globals": "^15.11.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"svelte": "^5.0.0",
"svelte": "^5.33.0",
"svelte-check": "^4.0.0",
"typescript": "5.6.2",
"typescript-eslint": "^8.0.0",

View File

@@ -1,5 +1,16 @@
# minimal-auth-passkey
## 0.0.116
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.115
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passkey",
"private": true,
"version": "0.0.115",
"version": "0.0.116",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# passphrase
## 0.0.113
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.112
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passphrase",
"private": true,
"version": "0.0.112",
"version": "0.0.113",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# jazz-password-manager
## 0.0.137
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.136
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.136",
"version": "0.0.137",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# jazz-example-pets
## 0.0.235
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.234
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-pets",
"private": true,
"version": "0.0.234",
"version": "0.0.235",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,16 @@
# reactions
## 0.0.115
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.114
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "reactions",
"private": true,
"version": "0.0.114",
"version": "0.0.115",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,17 @@
# richtext-tiptap
## 0.1.28
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
- jazz-richtext-tiptap@0.14.21
## 0.1.27
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "richtext-tiptap",
"private": true,
"version": "0.1.27",
"version": "0.1.28",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -44,7 +44,7 @@ export const JazzAccount = co
if (account.profile === undefined) {
const group = Group.create();
group.addMember("everyone", "reader"); // The profile info is visible to everyone
group.makePublic(); // The profile info is visible to everyone
account.profile = JazzProfile.create(
{

View File

@@ -1,5 +1,17 @@
# richtext
## 0.0.105
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
- jazz-richtext-prosemirror@0.14.21
## 0.0.104
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "richtext",
"private": true,
"version": "0.0.104",
"version": "0.0.105",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -46,7 +46,7 @@ export const JazzAccount = co
if (account.profile === undefined) {
const group = Group.create();
group.addMember("everyone", "reader"); // The profile info is visible to everyone
group.makePublic(); // The profile info is visible to everyone
account.profile = JazzProfile.create(
{

View File

@@ -1,5 +1,17 @@
# todo-vue
## 0.0.117
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-browser@0.14.21
- jazz-vue@0.14.21
## 0.0.116
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "todo-vue",
"version": "0.0.116",
"version": "0.0.117",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,16 @@
# jazz-example-todo
## 0.0.234
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-react@0.14.21
## 0.0.233
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-todo",
"private": true,
"version": "0.0.233",
"version": "0.0.234",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,17 @@
# version-history
## 0.0.113
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- jazz-inspector@0.14.21
- jazz-react@0.14.21
## 0.0.112
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "version-history",
"private": true,
"version": "0.0.112",
"version": "0.0.113",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -20,6 +20,7 @@ export const team: Array<TeamMember> = [
github: "aeplay",
website: "http://anselm.io",
bluesky: "anselm.io",
linkedin: "anselm-eickhoff",
},
{
name: "Guido D'Orsi",
@@ -29,12 +30,13 @@ export const team: Array<TeamMember> = [
github: "gdorsi",
},
{
name: "Andrei Popa",
titles: ["Full-Stack Dev", "Infra"],
image: "andrei.jpeg",
location: "Bucharest, Romania ",
x: "elitepax",
github: "pax-k",
name: "Giordano Ricci",
titles: ["Full-Stack Dev", "Observability Expert"],
location: "Lisbon, Portugal ",
github: "Elfo404",
website: "https://giordanoricci.com",
linkedin: "giordanoricci",
image: "gio.jpg",
},
{
name: "Trisha Lim",
@@ -51,22 +53,13 @@ export const team: Array<TeamMember> = [
location: "Portsmouth, UK ",
github: "bensleveritt",
},
{
name: "Giordano Ricci",
titles: ["Full-Stack Dev", "DevOps"],
location: "Lisbon, Portugal ",
linkedin: "giordanoricci",
github: "Elfo404",
website: "https://giordanoricci.com",
image: "gio.jpg",
},
{
name: "Nikos Papadopoulos",
titles: ["Full-Stack Dev"],
location: "Farnham, UK",
github: "4rknova",
website: "https://www.4rknova.com",
linkedin: "nikpapas",
github: "4rknova",
image: "nikos.png",
},
{
@@ -74,8 +67,8 @@ export const team: Array<TeamMember> = [
titles: ["Full-Stack Dev", "Support Dev"],
location: "San Francisco, California, US",
github: "emmyoh",
linkedin: "emil-sayahi",
bluesky: "sayahi.bsky.social",
linkedin: "emil-sayahi",
image: "emil.jpg",
},
{
@@ -85,30 +78,23 @@ export const team: Array<TeamMember> = [
github: "mculotta120",
image: "meg.jpg",
},
{
name: "James Vickery",
location: "Birmingham, UK",
titles: ["Full-Stack Dev", "Support Dev"],
github: "jmsv",
bluesky: "jmsv.bsky.social",
image: "james.jpg",
},
{
name: "Stephanie Lemmeyer",
location: "Boston, Massachusetts, US",
titles: ["Lead DevOps"],
github: "slemmeyer",
linkedin: "stephanielemmeyer",
website: "https://stephanielemmeyer.me",
image: "stephanie.jpg",
},
{
name: "Nikita Voloboev",
location: "Barcelona, Spain",
titles: ["Full-Stack Dev"],
github: "nikitavoloboev",
x: "nikitavoloboev",
github: "nikitavoloboev",
website: "https://nikiv.dev",
image: "nikita.jpg",
},
{
name: "Sammii Kellow",
location: "London, UK",
titles: ["Design Engineer", "Marketing"],
x: "SammiiHaylock",
github: "sammii-hk",
website: "https://sammii.dev",
linkedin: "sammii",
image: "sammii.jpg",
},
];

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

View File

@@ -1,7 +1,7 @@
```tsx
const group = Group.create();
group.addMember(Alice, "writer");
group.addMember("everyone", "reader");
group.makePublic();
Message.create({ text: "..." }, group);
```

View File

@@ -8,8 +8,7 @@ import { ContentByFramework, CodeGroup } from '@/components/forMdx'
## Public sharing
You can share CoValues publicly by setting the `owner` to a `Group`, and granting
access to "everyone".
You can share CoValues publicly by setting the `owner` to a `Group`, and granting access to "everyone".
<CodeGroup>
```ts twoslash
@@ -20,6 +19,19 @@ group.addMember("everyone", "writer");
```
</CodeGroup>
You can also use `makePublic(role)` alias to grant access to everyone with a specific role (defaults to `reader`).
<CodeGroup>
```ts twoslash
import { Group } from "jazz-tools";
// ---cut---
const group = Group.create();
group.addMember("everyone", "writer"); // [!code --]
group.makePublic("writer"); // [!code ++]
// group.makePublic(); // Defaults to "reader" access
```
</CodeGroup>
This is done in the [chat example](https://github.com/garden-co/jazz/tree/main/examples/chat) where anyone can join the chat, and send messages.
You can also [add members by Account ID](/docs/groups/intro#adding-group-members-by-id).

View File

@@ -209,7 +209,7 @@ export const MyAppAccount = co.account({
if (account.profile === undefined) {
const profileGroup = Group.create();
// Unlike the root, we want the profile to be publicly readable.
profileGroup.addMember("everyone", "reader");
profileGroup.makePublic();
account.profile = MyAppProfile.create({
name: creationProps?.name ?? "New user",

View File

@@ -1,5 +1,5 @@
export const metadata = {
description: "CoValues are the core abstraction of Jazz. They're your bread-and-butter datastructures that you use to represent everything in your app."
description: "CoValues are the core abstraction of Jazz. They're your bread-and-butter datastructures that you use to represent everything in your app.",
};
import { CodeGroup, ComingSoon } from "@/components/forMdx";
@@ -23,6 +23,7 @@ CoValues model JSON with CoMaps and CoLists, but also offer CoFeeds for simple p
Fundamentally, CoValues are as dynamic and flexible as JSON, but in Jazz you use them by defining fixed schemas to describe the shape of data in your app.
This helps correctness and development speed, but is particularly important...
- when you evolve your app and need migrations
- when different clients and server workers collaborate on CoValues and need to make compatible changes
@@ -76,6 +77,7 @@ const project = TodoProject.create(
Group.create()
);
```
</CodeGroup>
## Types of CoValues
@@ -96,6 +98,7 @@ const Task = co.map({
completed: z.boolean(),
});
```
</CodeGroup>
Or record-like CoMaps (key-value pairs, where keys are always `string`):
@@ -112,6 +115,7 @@ const ColorToHex = co.record(z.string(), z.string());
const ColorToFruit = co.record(z.string(), Fruit);
```
</CodeGroup>
@@ -137,6 +141,7 @@ const Task = co.map({
const ListOfColors = co.list(z.string());
const ListOfTasks = co.list(Task);
```
</CodeGroup>
See the corresponding sections for [creating](/docs/using-covalues/colists#creating-colists),
@@ -207,7 +212,7 @@ import { co, z } from "jazz-tools";
const ButtonWidget = co.map({
type: z.literal("button"),
label: z.string(),
});
});
const SliderWidget = co.map({
type: z.literal("slider"),
@@ -215,8 +220,9 @@ const SliderWidget = co.map({
max: z.number(),
});
const WidgetUnion = z.discriminatedUnion([ButtonWidget, SliderWidget]);
const WidgetUnion = z.discriminatedUnion("type", [ButtonWidget, SliderWidget]);
```
</CodeGroup>
See the corresponding sections for [creating](/docs/using-covalues/schemaunions#creating-schemaunions),
@@ -246,15 +252,15 @@ export const ListOfColors = co.list(z.string());
Here's a quick overview of the primitive types you can use:
<CodeGroup>
```ts twoslash
import { z } from "jazz-tools";
// ---cut---
z.string(); // For simple strings
z.number(); // For numbers
```ts twoslash
import {z} from "jazz-tools";
// ---cut---
z.string(); // For simple strings
z.number(); // For numbers
z.boolean(); // For booleans
z.null(); // For null
z.date(); // For dates
z.literal(["waiting", "ready"]); // For enums
z.null(); // For null
z.date(); // For dates
z.literal(["waiting", "ready"]); // For enums
```
</CodeGroup>
@@ -311,6 +317,7 @@ const Company = co.map({
members: ListOfPeople,
});
```
</CodeGroup>
#### Optional References
@@ -363,6 +370,7 @@ const Person = co.map({
const ListOfPeople = co.list(Person);
```
</CodeGroup>
Note: similarly, if you use modifiers like `z.optional()` you'll need to help TypeScript along:
@@ -378,6 +386,7 @@ const Person = co.map({
}
});
```
</CodeGroup>
### Helper methods
@@ -417,3 +426,4 @@ const fullName = getPersonFullName(person);
const age = getPersonAgeAsOf(person, new Date());
```
</CodeGroup>
```

View File

@@ -308,7 +308,9 @@ project.coordinator = undefined; // Remove the reference
## Running migrations on CoMaps
Migrations in CoMaps are functions that run when a CoMap is loaded, not when it's created. They're useful for updating the structure of existing CoMaps to match new schema versions. Migrations are synchronous and cannot be async.
Migrations are functions that run when a CoMap is loaded, allowing you to update existing data to match new schema versions. Use them when you need to modify the structure of CoMaps that already exist in your app. Unlike [Account migrations](/docs/schemas/accounts-and-migrations#when-migrations-run), CoMap migrations are not run when a CoMap is created.
**Note:** Migrations are run synchronously and cannot be run asynchronously.
Here's an example of a migration that adds the `priority` field to the `Task` CoMap:
@@ -316,6 +318,7 @@ Here's an example of a migration that adds the `priority` field to the `Task` Co
```ts twoslash
import { co, z } from "jazz-tools";
// ---cut---
const Task = co
.map({
done: z.boolean(),
@@ -326,35 +329,35 @@ const Task = co
.withMigration((task) => {
if (task.version === 1) {
task.priority = "medium";
task.version = 2; // Upgrade the version so the migration won't run again
// Upgrade the version so the migration won't run again
task.version = 2;
}
});
```
</CodeGroup>
### Migrations best practices
### Migration best practices
It's always a good idea to keep the schema backward & forward compatible when possible.
This means that you should:
- Only add new fields, never rename or change the type of existing fields
- The new fields should be optional if possible
Design your schema changes to be compatible with existing data:
- **Add, don't change:** Only add new fields; avoid renaming or changing types of existing fields
- **Make new fields optional:** This prevents errors when loading older data
- **Use version fields:** Track schema versions to run migrations only when needed
### Migration & reader permissions
Migrations need to modify the CoMap's structure, so they are not allowed if you only have read permissions on the CoMap.
Migrations need write access to modify CoMaps. If some users only have read permissions, they can't run migrations on those CoMaps.
If some users might have only read permissions, you should be more careful about how you handle migrations.
**Forward-compatible schemas** (where new fields are optional) handle this gracefully - users can still use the app even if migrations haven't run.
If your schemas are forward compatible, good news! They should still be able to use your app even if the migration has not been run yet.
This means that you won't need to do manage both versions of the CoMap in your app.
**Non-compatible changes** require handling both schema versions in your app code using discriminated unions.
If they are not forward compatible, you will need to handle both versions of the CoMap in your app using a discriminated union:
When you can't guarantee all users can run migrations, handle multiple schema versions explicitly:
<CodeGroup>
```ts twoslash
import { co, z } from "jazz-tools";
// ---cut---
const TaskV1 = co.map({
version: z.literal(1),
done: z.boolean(),
@@ -362,19 +365,22 @@ const TaskV1 = co.map({
});
const TaskV2 = co.map({
version: z.literal(2), // This time we need to be more strict about the version to make the discriminated union work
// We need to be more strict about the version to make the
// discriminated union work
version: z.literal(2),
done: z.boolean(),
text: z.string(),
priority: z.enum(["low", "medium", "high"]),
}).withMigration((task) => {
// @ts-expect-error - we are checking the version field to see if we need to run the migration
// @ts-expect-error - check if we need to run the migration
if (task.version === 1) {
task.version = 2;
task.priority = "medium";
}
});
// Export the discriminated union because some users might not be able to run the migration
// Export the discriminated union; because some users might
// not be able to run the migration
export const Task = z.discriminatedUnion("version", [
TaskV1,
TaskV2,

View File

@@ -35,7 +35,7 @@ const MyAccount = co.account({
MyAccount.withMigration((account, creationProps) => {
if (account.profile === undefined) {
const profileGroup = Group.create();
profileGroup.addMember("everyone", "reader");
profileGroup.makePublic();
account.profile = MyProfile.create(
{
name: creationProps?.name ?? "New user",

View File

@@ -36,7 +36,7 @@ const MyAccount = co.account({
MyAccount.withMigration((account, creationProps) => {
if (account.profile === undefined) {
const profileGroup = Group.create();
profileGroup.addMember("everyone", "reader");
profileGroup.makePublic();
account.profile = MyProfile.create(
{
name: creationProps?.name ?? "New user",

View File

@@ -0,0 +1,215 @@
import { execSync } from "child_process";
import { existsSync, readFileSync } from "fs";
import { join } from "path";
const branchName =
process.env.VERCEL_GIT_COMMIT_REF ||
execSync("git rev-parse --abbrev-ref HEAD").toString().trim();
const currentAppName = process.env.APP_NAME;
const homepageAppName = "jazz-homepage";
// Helper function to execute git commands safely
function gitCommand(command) {
try {
return execSync(command, { encoding: "utf8" }).trim();
} catch (error) {
console.log(`Git command failed: ${command}`);
return "";
}
}
// Get list of changed files since last deployment
function getChangedFiles() {
// Try to get files changed since the last commit on the main branch
let changedFiles = gitCommand("git diff --name-only HEAD~1 HEAD");
// If that fails, get files changed in the current commit
if (!changedFiles) {
changedFiles = gitCommand("git diff --name-only HEAD^ HEAD");
}
// If still no files, assume we need to build (safety fallback)
if (!changedFiles) {
console.log("⚠️ Could not determine changed files, proceeding with build");
return null;
}
return changedFiles.split("\n").filter((file) => file.trim() !== "");
}
// Determine project path from APP_NAME
function getProjectPath(appName) {
if (appName === homepageAppName) {
return "homepage/homepage";
}
// Check examples first
const examplePath = `examples/${appName.replace(/^jazz-/, "")}`;
if (existsSync(examplePath)) {
return examplePath;
}
// Check starters
const starterPath = `starters/${appName.replace(/^jazz-/, "")}`;
if (existsSync(starterPath)) {
return starterPath;
}
// Fallback - try the exact app name
if (existsSync(appName)) {
return appName;
}
console.log(`⚠️ Could not determine project path for ${appName}`);
return null;
}
// Get dependencies from package.json
function getProjectDependencies(projectPath) {
const packageJsonPath = join(projectPath, "package.json");
if (!existsSync(packageJsonPath)) {
return [];
}
try {
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
const deps = {
...packageJson.dependencies,
...packageJson.devDependencies,
};
// Filter to only local workspace dependencies (packages that start with workspace path)
return Object.keys(deps).filter(
(dep) =>
deps[dep].startsWith("workspace:") ||
dep.startsWith("@jazz-tools/") ||
dep.startsWith("jazz-"),
);
} catch (error) {
console.log(
`Error reading package.json for ${projectPath}:`,
error.message,
);
return [];
}
}
// Check if any workspace packages changed
function workspacePackagesChanged(changedFiles, dependencies) {
return changedFiles.some((file) => {
// Check if any file in packages/ directory changed
if (file.startsWith("packages/")) {
const packageName = file.split("/")[1];
// Check if this package is a dependency of our project
return dependencies.some(
(dep) =>
dep.includes(packageName) ||
file.startsWith(`packages/${packageName}`),
);
}
return false;
});
}
// Check if global configuration files changed
function globalConfigChanged(changedFiles) {
const globalFiles = [
"package.json",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
"turbo.json",
"tsconfig.json",
"vite.config.ts",
"biome.json",
".npmrc",
".nvmrc",
"ignore-vercel-build.js",
"ignore-vercel-build-enhanced.js",
];
return changedFiles.some((file) => globalFiles.includes(file));
}
// Main logic
console.log(
`🔍 Checking build necessity for ${currentAppName} on branch ${branchName}`,
);
// Keep existing docs branch logic
if (
branchName === "main" &&
process.env.VERCEL_GIT_COMMIT_MESSAGE?.includes("docs")
) {
if (currentAppName === homepageAppName) {
console.log(
'✅ Building homepage because a "docs" branch was merged into "main".',
);
process.exit(1);
} else {
console.log(
`🛑 Skipping build for ${currentAppName} after \"docs\" branch merged to main.`,
);
process.exit(0);
}
} else if (branchName.includes("docs")) {
if (currentAppName === homepageAppName) {
console.log('✅ Building homepage for "docs" branch.');
process.exit(1);
} else {
console.log(`🛑 Skipping build for ${currentAppName} on \"docs\" branch.`);
process.exit(0);
}
}
// Enhanced change detection
const changedFiles = getChangedFiles();
if (!changedFiles) {
console.log(
"✅ Could not determine changes, proceeding with build for safety.",
);
process.exit(1);
}
console.log(`📁 Changed files: ${changedFiles.length}`);
console.log(changedFiles.map((f) => ` - ${f}`).join("\n"));
const projectPath = getProjectPath(currentAppName);
if (!projectPath) {
console.log(
"✅ Could not determine project path, proceeding with build for safety.",
);
process.exit(1);
}
console.log(`📂 Project path: ${projectPath}`);
// Check if project files changed
const projectChanged = changedFiles.some((file) =>
file.startsWith(projectPath + "/"),
);
// Check if global config changed
const globalChanged = globalConfigChanged(changedFiles);
// Check if dependencies changed
const dependencies = getProjectDependencies(projectPath);
const depsChanged = workspacePackagesChanged(changedFiles, dependencies);
console.log(`📊 Change analysis:`);
console.log(` - Project files changed: ${projectChanged}`);
console.log(` - Global config changed: ${globalChanged}`);
console.log(` - Dependencies changed: ${depsChanged}`);
console.log(` - Dependencies: ${dependencies.join(", ") || "none"}`);
// Decision logic
if (projectChanged || globalChanged || depsChanged) {
console.log(
`✅ Building ${currentAppName} - changes detected that affect this project.`,
);
process.exit(1);
} else {
console.log(
`🛑 Skipping build for ${currentAppName} - no relevant changes detected.`,
);
process.exit(0);
}

View File

@@ -1,5 +1,13 @@
# cojson-storage-indexeddb
## 0.14.21
### Patch Changes
- Updated dependencies [c3d8779]
- cojson@0.14.21
- cojson-storage@0.14.21
## 0.14.20
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage-indexeddb",
"version": "0.14.20",
"version": "0.14.21",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,13 @@
# cojson-storage-sqlite
## 0.14.21
### Patch Changes
- Updated dependencies [c3d8779]
- cojson@0.14.21
- cojson-storage@0.14.21
## 0.14.20
### Patch Changes

View File

@@ -1,13 +1,13 @@
{
"name": "cojson-storage-sqlite",
"type": "module",
"version": "0.14.20",
"version": "0.14.21",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"dependencies": {
"better-sqlite3": "^11.7.0",
"cojson": "workspace:0.14.20",
"cojson": "workspace:0.14.21",
"cojson-storage": "workspace:*"
},
"devDependencies": {

View File

@@ -1,5 +1,12 @@
# cojson-storage
## 0.14.21
### Patch Changes
- Updated dependencies [c3d8779]
- cojson@0.14.21
## 0.14.20
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage",
"version": "0.14.20",
"version": "0.14.21",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,12 @@
# cojson-transport-nodejs-ws
## 0.14.21
### Patch Changes
- Updated dependencies [c3d8779]
- cojson@0.14.21
## 0.14.20
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "cojson-transport-ws",
"type": "module",
"version": "0.14.20",
"version": "0.14.21",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,5 +1,11 @@
# cojson
## 0.14.21
### Patch Changes
- c3d8779: Fix setting latestTxMadeAt when the transaction is empty. (can happen when calling assign with an empty object)
## 0.14.20
## 0.14.19

View File

@@ -25,7 +25,7 @@
},
"type": "module",
"license": "MIT",
"version": "0.14.20",
"version": "0.14.21",
"devDependencies": {
"@opentelemetry/sdk-metrics": "^2.0.0",
"typescript": "catalog:"

View File

@@ -50,6 +50,8 @@ export class RawCoMapView<
/** @internal */
latestTxMadeAt: number;
/** @internal */
earliestTxMadeAt: number | null;
/** @internal */
ops: {
[Key in keyof Shape & string]?: MapOp<Key, Shape[Key]>[];
};
@@ -75,6 +77,7 @@ export class RawCoMapView<
this.id = core.id as CoID<this>;
this.core = core;
this.latestTxMadeAt = 0;
this.earliestTxMadeAt = null;
this.ignorePrivateTransactions =
options?.ignorePrivateTransactions ?? false;
this.ops = {};
@@ -98,6 +101,10 @@ export class RawCoMapView<
return;
}
if (this.earliestTxMadeAt === null && newValidTransactions[0]) {
this.earliestTxMadeAt = newValidTransactions[0].madeAt;
}
const { ops } = this;
const changedEntries = new Map<
@@ -106,6 +113,10 @@ export class RawCoMapView<
>();
for (const { txID, changes, madeAt } of newValidTransactions) {
if (madeAt > this.latestTxMadeAt) {
this.latestTxMadeAt = madeAt;
}
for (let changeIdx = 0; changeIdx < changes.length; changeIdx++) {
const change = changes[changeIdx] as MapOpPayload<
keyof Shape & string,
@@ -118,10 +129,6 @@ export class RawCoMapView<
change,
};
if (madeAt > this.latestTxMadeAt) {
this.latestTxMadeAt = madeAt;
}
const entries = ops[change.key];
if (!entries) {
const entries = [entry];

View File

@@ -1,5 +1,11 @@
# create-jazz-app
## 0.1.21
### Patch Changes
- e005ecd: Sets selected package manager based on command runner
## 0.1.20
### Patch Changes

View File

@@ -17,11 +17,13 @@ You can create a new Jazz app in two ways:
### Interactive mode
Simply run:
```bash
npx create-jazz-app@latest
```
Then follow the interactive prompts to select your:
- Framework and authentication combination
- Package manager
- Project name

View File

@@ -5,7 +5,7 @@
"types": "src/index.ts",
"type": "module",
"license": "MIT",
"version": "0.1.20",
"version": "0.1.21",
"bin": {
"create-jazz-app": "./dist/index.js"
},
@@ -20,12 +20,15 @@
"@types/degit": "^2.8.3",
"@types/gradient-string": "^1.1.2",
"@types/inquirer": "^9.0.3",
"typescript": "catalog:"
"typescript": "catalog:",
"vitest": "catalog:"
},
"scripts": {
"dev": "tsc --watch",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"build": "rm -rf ./dist && tsc --sourceMap --outDir dist"
"build": "rm -rf ./dist && tsc --sourceMap --outDir dist",
"test": "vitest --run --root ../../ --project create-jazz-app",
"test:watch": "vitest --watch --root ../../ --project create-jazz-app"
}
}

View File

@@ -16,11 +16,15 @@ import {
frameworkToAuthExamples,
frameworks,
} from "./config.js";
import { type PackageManager, getPkgManager } from "./utils.js";
// Handle SIGINT (Ctrl+C) gracefully
process.on("SIGINT", () => {
process.exit(0);
});
const program = new Command();
type PackageManager = "npm" | "yarn" | "pnpm" | "bun" | "deno";
type ScaffoldOptions = {
template: FrameworkAuthPair | string;
projectName: string;
@@ -443,6 +447,8 @@ async function promptUser(
}
if (!partialOptions.packageManager) {
const defaultPackageManager = getPkgManager();
questions.push({
type: "list",
name: "packageManager",
@@ -454,7 +460,7 @@ async function promptUser(
{ name: chalk.white("bun"), value: "bun" },
{ name: chalk.white("deno"), value: "deno" },
],
default: "npm",
default: defaultPackageManager,
});
}

View File

@@ -0,0 +1,23 @@
export type PackageManager = "npm" | "yarn" | "pnpm" | "bun" | "deno";
export function getPkgManager(): PackageManager {
const userAgent = process.env.npm_config_user_agent || "";
if (userAgent.startsWith("yarn")) {
return "yarn";
}
if (userAgent.startsWith("pnpm")) {
return "pnpm";
}
if (userAgent.startsWith("bun")) {
return "bun";
}
if (userAgent.startsWith("deno")) {
return "deno";
}
return "npm";
}

View File

@@ -0,0 +1,100 @@
import fs from "fs";
import path from "path";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
// Mock inquirer to avoid interactive prompts during testing
vi.mock("inquirer", () => ({
default: {
prompt: vi.fn(),
},
}));
// Mock degit to avoid actual cloning during tests
vi.mock("degit", () => ({
default: vi.fn(() => ({
clone: vi.fn().mockResolvedValue(undefined),
})),
}));
// Mock ora (spinner) to avoid output during tests
vi.mock("ora", () => ({
default: vi.fn(() => ({
start: vi.fn().mockReturnThis(),
succeed: vi.fn().mockReturnThis(),
fail: vi.fn().mockReturnThis(),
})),
}));
describe("CLI Integration Tests", () => {
const testDir = path.join(__dirname, "..", "test-temp");
let originalUserAgent: string | undefined;
let originalCwd: string;
beforeEach(() => {
originalUserAgent = process.env.npm_config_user_agent;
originalCwd = process.cwd();
// Create test directory
if (fs.existsSync(testDir)) {
fs.rmSync(testDir, { recursive: true, force: true });
}
fs.mkdirSync(testDir, { recursive: true });
});
afterEach(() => {
// Restore original values
if (originalUserAgent !== undefined) {
process.env.npm_config_user_agent = originalUserAgent;
} else {
delete process.env.npm_config_user_agent;
}
process.chdir(originalCwd);
// Clean up test directory
if (fs.existsSync(testDir)) {
fs.rmSync(testDir, { recursive: true, force: true });
}
});
it("should automatically select pnpm when invoked via pnpm dlx", async () => {
// Set up environment to simulate pnpm dlx
process.env.npm_config_user_agent =
"pnpm/8.15.4 npm/? node/v20.11.1 darwin x64";
// Mock inquirer.prompt to simulate user selecting all other options except package manager
const inquirer = await import("inquirer");
const mockPrompt = vi.mocked(inquirer.default.prompt);
mockPrompt.mockResolvedValue({
starter: "react-demo-auth",
projectName: "test-app",
// Note: packageManager is not included, so it should be auto-detected
});
// We can't easily test the full CLI without actually running it,
// but we can test that the package manager detection works correctly
// by importing and testing the logic directly
const { getPkgManager } = await import("../src/utils.js");
const detectedManager = getPkgManager();
expect(detectedManager).toBe("pnpm");
});
it("should automatically select yarn when invoked via yarn", async () => {
process.env.npm_config_user_agent =
"yarn/1.22.19 npm/? node/v20.11.1 darwin x64";
const { getPkgManager } = await import("../src/utils.js");
const detectedManager = getPkgManager();
expect(detectedManager).toBe("yarn");
});
it("should fall back to npm when no user agent is set", async () => {
delete process.env.npm_config_user_agent;
const { getPkgManager } = await import("../src/utils.js");
const detectedManager = getPkgManager();
expect(detectedManager).toBe("npm");
});
});

View File

@@ -0,0 +1,88 @@
import { execSync } from "child_process";
import fs from "fs";
import path from "path";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
describe("End-to-End CLI Tests", () => {
const testDir = path.join(__dirname, "..", "test-temp");
let originalUserAgent: string | undefined;
let originalCwd: string;
beforeEach(() => {
originalUserAgent = process.env.npm_config_user_agent;
originalCwd = process.cwd();
// Create test directory
if (fs.existsSync(testDir)) {
fs.rmSync(testDir, { recursive: true, force: true });
}
fs.mkdirSync(testDir, { recursive: true });
});
afterEach(() => {
// Restore original values
if (originalUserAgent !== undefined) {
process.env.npm_config_user_agent = originalUserAgent;
} else {
delete process.env.npm_config_user_agent;
}
process.chdir(originalCwd);
// Clean up test directory
if (fs.existsSync(testDir)) {
fs.rmSync(testDir, { recursive: true, force: true });
}
});
it("should show pnpm as default when run with pnpm user agent", () => {
// Set up environment to simulate pnpm dlx
process.env.npm_config_user_agent =
"pnpm/8.15.4 npm/? node/v20.11.1 darwin x64";
try {
// Run the CLI with --help to see the default package manager behavior
// We use the built version of the CLI
const result = execSync("node ./dist/index.js --help", {
cwd: path.join(__dirname, ".."),
encoding: "utf-8",
env: {
...process.env,
npm_config_user_agent: "pnpm/8.15.4 npm/? node/v20.11.1 darwin x64",
},
});
// The help output should contain information about package managers
expect(result).toContain("create-jazz-app");
} catch (error) {
// Help command exits with code 0, but execSync might throw
// This is expected behavior for --help
console.log("Help command executed successfully");
}
});
it("should detect package manager correctly in non-interactive mode", () => {
// Test with all required flags to avoid prompts
process.env.npm_config_user_agent =
"pnpm/8.15.4 npm/? node/v20.11.1 darwin x64";
try {
// This would normally create a project, but we're just testing the detection
// We'll use a dry-run approach by checking the help output
const result = execSync("node ./dist/index.js --help", {
cwd: path.join(__dirname, ".."),
encoding: "utf-8",
env: {
...process.env,
npm_config_user_agent: "pnpm/8.15.4 npm/? node/v20.11.1 darwin x64",
},
});
// Verify the CLI runs without errors
expect(result).toBeDefined();
} catch (error) {
// Expected for help command
console.log("CLI executed successfully");
}
});
});

View File

@@ -0,0 +1,75 @@
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { getPkgManager } from "../src/utils.js";
describe("Package Manager Detection", () => {
let originalUserAgent: string | undefined;
beforeEach(() => {
// Save the original value
originalUserAgent = process.env.npm_config_user_agent;
});
afterEach(() => {
// Restore the original value
if (originalUserAgent !== undefined) {
process.env.npm_config_user_agent = originalUserAgent;
} else {
delete process.env.npm_config_user_agent;
}
});
it("should detect pnpm when run via pnpm dlx", () => {
// Simulate the environment variable that pnpm sets
process.env.npm_config_user_agent =
"pnpm/8.15.4 npm/? node/v20.11.1 darwin x64";
const result = getPkgManager();
expect(result).toBe("pnpm");
});
it("should detect yarn when run via yarn", () => {
process.env.npm_config_user_agent =
"yarn/1.22.19 npm/? node/v20.11.1 darwin x64";
const result = getPkgManager();
expect(result).toBe("yarn");
});
it("should detect bun when run via bun", () => {
process.env.npm_config_user_agent =
"bun/1.0.25 npm/? node/v20.11.1 darwin x64";
const result = getPkgManager();
expect(result).toBe("bun");
});
it("should detect deno when run via deno", () => {
process.env.npm_config_user_agent =
"deno/1.40.0 npm/? node/v20.11.1 darwin x64";
const result = getPkgManager();
expect(result).toBe("deno");
});
it("should default to npm when no user agent is set", () => {
delete process.env.npm_config_user_agent;
const result = getPkgManager();
expect(result).toBe("npm");
});
it("should default to npm when user agent is empty", () => {
process.env.npm_config_user_agent = "";
const result = getPkgManager();
expect(result).toBe("npm");
});
it("should default to npm when user agent doesn't match any known package manager", () => {
process.env.npm_config_user_agent =
"unknown-manager/1.0.0 npm/? node/v20.11.1 darwin x64";
const result = getPkgManager();
expect(result).toBe("npm");
});
});

View File

@@ -0,0 +1,9 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
environment: "node",
include: ["tests/**/*.test.ts"],
},
});

View File

@@ -1,5 +1,19 @@
# jazz-auth-betterauth
## 0.14.21
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [c3d8779]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- cojson@0.14.21
- jazz-browser@0.14.21
- jazz-betterauth-client-plugin@0.14.21
## 0.14.20
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-auth-betterauth",
"version": "0.14.20",
"version": "0.14.21",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,18 @@
# jazz-auth-clerk
## 0.14.21
### Patch Changes
- Updated dependencies [e7e505e]
- Updated dependencies [c3d8779]
- Updated dependencies [13b57aa]
- Updated dependencies [5662faa]
- Updated dependencies [2116a59]
- jazz-tools@0.14.21
- cojson@0.14.21
- jazz-browser@0.14.21
## 0.14.20
### Patch Changes

View File

@@ -1,14 +1,14 @@
{
"name": "jazz-auth-clerk",
"version": "0.14.20",
"version": "0.14.21",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"dependencies": {
"cojson": "workspace:0.14.20",
"jazz-browser": "workspace:0.14.20",
"jazz-tools": "workspace:0.14.20"
"cojson": "workspace:0.14.21",
"jazz-browser": "workspace:0.14.21",
"jazz-tools": "workspace:0.14.21"
},
"scripts": {
"format-and-lint": "biome check .",

View File

@@ -1,5 +1,11 @@
# jazz-betterauth-client-plugin
## 0.14.21
### Patch Changes
- jazz-betterauth-server-plugin@0.14.21
## 0.14.20
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-betterauth-client-plugin",
"version": "0.14.20",
"version": "0.14.21",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

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