Compare commits
913 Commits
styling/co
...
example-co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c563c3675f | ||
|
|
05372df4be | ||
|
|
c32c405bfd | ||
|
|
3c0b2cb689 | ||
|
|
6a2a176361 | ||
|
|
824bbc8bab | ||
|
|
e7ae6d95ba | ||
|
|
8bdf6908b8 | ||
|
|
12bc4fb2d3 | ||
|
|
75211e3c82 | ||
|
|
3185a20777 | ||
|
|
0c3905f93f | ||
|
|
8a31f56770 | ||
|
|
4373e290fe | ||
|
|
037ed4d59d | ||
|
|
c030128b28 | ||
|
|
34946c18bc | ||
|
|
fcca08655a | ||
|
|
adcd08c95a | ||
|
|
937e20b248 | ||
|
|
a759d9a7aa | ||
|
|
38af5b8dc8 | ||
|
|
b9473da159 | ||
|
|
cb1126ac15 | ||
|
|
989211f02f | ||
|
|
49a1a9d6f0 | ||
|
|
2f32599987 | ||
|
|
9ede39c229 | ||
|
|
ca3eb9dbd8 | ||
|
|
12273cf35b | ||
|
|
b3d4944608 | ||
|
|
2068aaff13 | ||
|
|
9dfad43433 | ||
|
|
db4986059e | ||
|
|
ed5369e99b | ||
|
|
2671fca1dc | ||
|
|
c81a2dcd0b | ||
|
|
b7a19c0693 | ||
|
|
2678bdbcca | ||
|
|
ee7823b33e | ||
|
|
46683235ba | ||
|
|
8ce7bb808c | ||
|
|
3a69928ebc | ||
|
|
00790a1535 | ||
|
|
56ccf5ea65 | ||
|
|
4814595724 | ||
|
|
706357ac4f | ||
|
|
4fcc8edc70 | ||
|
|
0f8ba9966b | ||
|
|
91fa2e092a | ||
|
|
ff52d6df3e | ||
|
|
a539b9e26b | ||
|
|
f3129a7914 | ||
|
|
d349b794e1 | ||
|
|
fad14dcff6 | ||
|
|
b99f13c948 | ||
|
|
e7cb337a24 | ||
|
|
85c9a432c3 | ||
|
|
c28d1c331c | ||
|
|
474ea89b81 | ||
|
|
4772309fb6 | ||
|
|
1501510cfc | ||
|
|
eda1588907 | ||
|
|
b14e0bfe24 | ||
|
|
87aa43b46b | ||
|
|
b93ce9fb7e | ||
|
|
a7d83e1c10 | ||
|
|
76a693da15 | ||
|
|
df2f021cfd | ||
|
|
50b15d2d1d | ||
|
|
48bf7cb188 | ||
|
|
e2e0af34b5 | ||
|
|
6a5bcd3063 | ||
|
|
bf7e62ec76 | ||
|
|
71dda6b10b | ||
|
|
4612e0545e | ||
|
|
07feedd641 | ||
|
|
edbd567f11 | ||
|
|
4d8bb9cdb8 | ||
|
|
1971448f5d | ||
|
|
0e861e7df8 | ||
|
|
6e3f1efcd0 | ||
|
|
eb87d10783 | ||
|
|
5a54e4aa50 | ||
|
|
16b0a22ded | ||
|
|
6a8ce1e32d | ||
|
|
10a4b0e888 | ||
|
|
3c973c84ce | ||
|
|
d469d68771 | ||
|
|
c068d7a369 | ||
|
|
25088ed5db | ||
|
|
21e74998e8 | ||
|
|
a2e9ae4731 | ||
|
|
0514a7e64b | ||
|
|
b063cccdfc | ||
|
|
d89d2978ff | ||
|
|
221ca30790 | ||
|
|
caa6c147c8 | ||
|
|
4da51e8f9c | ||
|
|
a2076b179b | ||
|
|
3fa276c18d | ||
|
|
1928519d39 | ||
|
|
f4fa80b782 | ||
|
|
782df5d4b8 | ||
|
|
9db20ad630 | ||
|
|
3405d8f275 | ||
|
|
0a64dca0cd | ||
|
|
4d0b9b1bf1 | ||
|
|
403d61c8e8 | ||
|
|
0685c1cd5f | ||
|
|
834203f270 | ||
|
|
f01bc19257 | ||
|
|
6405a77aa2 | ||
|
|
ace6486075 | ||
|
|
23c3e5a125 | ||
|
|
e3d75e5c97 | ||
|
|
7838075bd6 | ||
|
|
dd792bf0ca | ||
|
|
233aae1deb | ||
|
|
153dc996a5 | ||
|
|
2b548c1758 | ||
|
|
167b588553 | ||
|
|
424930d06d | ||
|
|
d624a676d8 | ||
|
|
06f2af465d | ||
|
|
c7332f84b9 | ||
|
|
68fdbfbe94 | ||
|
|
e98d0e0c7f | ||
|
|
7efe89df31 | ||
|
|
2fb6428ea1 | ||
|
|
5a8f5d8bc2 | ||
|
|
2cc9daab37 | ||
|
|
e0276f42ee | ||
|
|
363be52022 | ||
|
|
1e87fc7772 | ||
|
|
03ec5d3ec8 | ||
|
|
5f272ff6ba | ||
|
|
12392424dd | ||
|
|
58eb3c0a98 | ||
|
|
adf965d53d | ||
|
|
3baa951bb9 | ||
|
|
b726e31669 | ||
|
|
63bb31e0ad | ||
|
|
d059460abd | ||
|
|
ba81951331 | ||
|
|
bd132bb9ad | ||
|
|
1ee435ad95 | ||
|
|
07273f7ab8 | ||
|
|
646ad330ae | ||
|
|
af8e6e3f82 | ||
|
|
f247525dfe | ||
|
|
012022db2b | ||
|
|
da92891498 | ||
|
|
b0c55720f8 | ||
|
|
a3d825fc6f | ||
|
|
29ca2e6f65 | ||
|
|
07a683c13d | ||
|
|
e53f02d6d7 | ||
|
|
4915bfa26d | ||
|
|
af45aac5f2 | ||
|
|
1136d9b744 | ||
|
|
92e78dc262 | ||
|
|
bf76d798c4 | ||
|
|
627f8c4c28 | ||
|
|
a1e0410863 | ||
|
|
03897a2689 | ||
|
|
823f546028 | ||
|
|
9bc54d1939 | ||
|
|
30780c05f0 | ||
|
|
118b6294ac | ||
|
|
6dc9b9d2ec | ||
|
|
ccbcee5102 | ||
|
|
0ae2067c3c | ||
|
|
2137938ead | ||
|
|
d14bb57ff5 | ||
|
|
3f42a4ddf9 | ||
|
|
0eed228170 | ||
|
|
a519537701 | ||
|
|
43c79cac2a | ||
|
|
44dbaa00d4 | ||
|
|
a0df32e81a | ||
|
|
236d8226d8 | ||
|
|
1220fa5d97 | ||
|
|
f3a5f83f25 | ||
|
|
a1bd6fc79b | ||
|
|
0f83320222 | ||
|
|
a3c4067de3 | ||
|
|
3042627748 | ||
|
|
8cea1e96cf | ||
|
|
64bb9ba90e | ||
|
|
f136dfe39b | ||
|
|
b32ae6240c | ||
|
|
fc4a89f77f | ||
|
|
7a6f8db509 | ||
|
|
086b9af565 | ||
|
|
5e95d8b76e | ||
|
|
47e0b68c2e | ||
|
|
5cc58c8e02 | ||
|
|
9df644c578 | ||
|
|
a20e430e7f | ||
|
|
1e625f3c12 | ||
|
|
8b3686c7ce | ||
|
|
bce04ee06d | ||
|
|
f2e9115f4c | ||
|
|
6854f9930c | ||
|
|
ee0897d9a8 | ||
|
|
243ab074eb | ||
|
|
385659b243 | ||
|
|
938f9256db | ||
|
|
88521721bf | ||
|
|
2701630582 | ||
|
|
07ce619fa2 | ||
|
|
895de1a470 | ||
|
|
4450761a7b | ||
|
|
08b3d65c0b | ||
|
|
5dac731f26 | ||
|
|
e99308cda2 | ||
|
|
88e314d980 | ||
|
|
62e0e5d721 | ||
|
|
aa16ad9c1c | ||
|
|
ada802bff8 | ||
|
|
44e1d140ca | ||
|
|
e0ef3fc1de | ||
|
|
a31ac66213 | ||
|
|
b444b2e96a | ||
|
|
8fcc4b5e50 | ||
|
|
33bfbee9cf | ||
|
|
d08e4e263b | ||
|
|
471b8c6a15 | ||
|
|
7dd080d907 | ||
|
|
69c81a3e90 | ||
|
|
d8ed987461 | ||
|
|
beb45c2656 | ||
|
|
e6241dfb5a | ||
|
|
1d71ca1511 | ||
|
|
65941c7f87 | ||
|
|
a37dc1c22f | ||
|
|
774f232390 | ||
|
|
12c19fc940 | ||
|
|
f0ae3ace13 | ||
|
|
cc973137b7 | ||
|
|
7fff0e0b36 | ||
|
|
6909357f64 | ||
|
|
59ff77e0dc | ||
|
|
338f5421f4 | ||
|
|
a7590d14d6 | ||
|
|
e0daca300b | ||
|
|
a5347b613b | ||
|
|
9de58bb098 | ||
|
|
de1be9ac18 | ||
|
|
43df7f2b48 | ||
|
|
5f4f70d06d | ||
|
|
a9aa61c2c0 | ||
|
|
bc0d2fcd23 | ||
|
|
f5675c49a2 | ||
|
|
da13e9cf7c | ||
|
|
ab2546ca71 | ||
|
|
43c36a8c20 | ||
|
|
24ad5f42b5 | ||
|
|
c620d9c87c | ||
|
|
59121a1f52 | ||
|
|
f766de8d9e | ||
|
|
eb8621550a | ||
|
|
5d28413648 | ||
|
|
d0ed7177a3 | ||
|
|
091d753ab4 | ||
|
|
87f917d297 | ||
|
|
88acea362a | ||
|
|
0107f4939d | ||
|
|
f468b89994 | ||
|
|
617ea91a13 | ||
|
|
b0ef1259ae | ||
|
|
a0ba4f235f | ||
|
|
e197900fc5 | ||
|
|
1af6072299 | ||
|
|
510e8874e1 | ||
|
|
ed7ee85304 | ||
|
|
ac726421d2 | ||
|
|
585b22941e | ||
|
|
5d557a830a | ||
|
|
f0188df13b | ||
|
|
4c8ce0a24f | ||
|
|
8645f8ce86 | ||
|
|
d01d467136 | ||
|
|
ad4fcbafa4 | ||
|
|
05c51d5a85 | ||
|
|
ab20a81751 | ||
|
|
adad802ceb | ||
|
|
32b1cc9dab | ||
|
|
5c236e5c3c | ||
|
|
7616d5789b | ||
|
|
631486e235 | ||
|
|
5e0d63a4d6 | ||
|
|
ba988cbb90 | ||
|
|
6f6800bcd8 | ||
|
|
90290902e8 | ||
|
|
d8582fc9ed | ||
|
|
5c76e37f14 | ||
|
|
0117d0c9b9 | ||
|
|
b90c766c05 | ||
|
|
262a36e456 | ||
|
|
cb1df65beb | ||
|
|
ea91e63ff2 | ||
|
|
8eae2eb31e | ||
|
|
c9044f5123 | ||
|
|
24340173fa | ||
|
|
53e88993a0 | ||
|
|
ece168878b | ||
|
|
cad84db52b | ||
|
|
342a385111 | ||
|
|
f87ba7d927 | ||
|
|
7c7f55b85c | ||
|
|
0e5b9f5292 | ||
|
|
2f5af3dece | ||
|
|
2c35e2ba85 | ||
|
|
0a4f79d5a4 | ||
|
|
43cb7abba7 | ||
|
|
25f76f6b02 | ||
|
|
6a56561c98 | ||
|
|
2ac31e7c51 | ||
|
|
1bbefab5a9 | ||
|
|
1143b32cf3 | ||
|
|
51ada27810 | ||
|
|
954ecb3984 | ||
|
|
05089270d9 | ||
|
|
fecc81111a | ||
|
|
4d3e7dbcd5 | ||
|
|
ee65f18fd9 | ||
|
|
bcbc4636ed | ||
|
|
8c323c4513 | ||
|
|
4103ea0c88 | ||
|
|
58905ae8f4 | ||
|
|
733ebec902 | ||
|
|
10a3834668 | ||
|
|
593c3aeb6e | ||
|
|
a55d71c28d | ||
|
|
c030c7a57e | ||
|
|
e5b4c0448a | ||
|
|
0d516a3c6a | ||
|
|
271ff3eb40 | ||
|
|
dcc836ff98 | ||
|
|
65f630fb44 | ||
|
|
b68f85542b | ||
|
|
f122a9f938 | ||
|
|
22da4ea136 | ||
|
|
80e86c92b2 | ||
|
|
e15d994df6 | ||
|
|
48ac92bc67 | ||
|
|
226b1171e6 | ||
|
|
29228e21fe | ||
|
|
302a1e6660 | ||
|
|
d3603625fd | ||
|
|
fa94d8c171 | ||
|
|
aeb094baa1 | ||
|
|
18f3497397 | ||
|
|
8be7158d1f | ||
|
|
cae3a9ee32 | ||
|
|
6260045140 | ||
|
|
466d79d9a6 | ||
|
|
67776c77a0 | ||
|
|
e6868d3030 | ||
|
|
c8ae3a36ca | ||
|
|
bf9c158455 | ||
|
|
1301112a6b | ||
|
|
c447f08029 | ||
|
|
5a63cbae9b | ||
|
|
7d06f1dbf4 | ||
|
|
e48a3e4c27 | ||
|
|
a326ed971c | ||
|
|
b5f1bb35d1 | ||
|
|
b4ed7b0587 | ||
|
|
652ff8f53c | ||
|
|
f519cd7356 | ||
|
|
20babc2e41 | ||
|
|
6fc8efc1b5 | ||
|
|
e30bd2f489 | ||
|
|
0b9cc2e0aa | ||
|
|
610543c5b8 | ||
|
|
53dbfee385 | ||
|
|
9c577b98cd | ||
|
|
6139803679 | ||
|
|
b2c03ca8c4 | ||
|
|
3feb3e82ff | ||
|
|
95e9bdb624 | ||
|
|
68127a95d0 | ||
|
|
690e65ac06 | ||
|
|
6f007a9470 | ||
|
|
23c588c717 | ||
|
|
494d902e79 | ||
|
|
eebee4db6a | ||
|
|
44f38f3438 | ||
|
|
bb2052e1f2 | ||
|
|
40af02acb3 | ||
|
|
950db502c2 | ||
|
|
3bdb753b78 | ||
|
|
33293f3b64 | ||
|
|
d5d448670d | ||
|
|
e3c3913c74 | ||
|
|
2ee2fcaa27 | ||
|
|
edc77c4bd5 | ||
|
|
0ce25f143b | ||
|
|
e35018a5fa | ||
|
|
0d05c927f1 | ||
|
|
4ef43e3477 | ||
|
|
d7ce078f17 | ||
|
|
95349d59f8 | ||
|
|
bb13b6e41d | ||
|
|
3c2da2f0db | ||
|
|
7bac26cf7f | ||
|
|
d3d9200acf | ||
|
|
60558ee664 | ||
|
|
6354135af4 | ||
|
|
69a0befb7b | ||
|
|
c48aa7358a | ||
|
|
01517d1463 | ||
|
|
cdd7e6454f | ||
|
|
2e030ea942 | ||
|
|
5207c00582 | ||
|
|
22fa01b9c5 | ||
|
|
f5a1e42dd6 | ||
|
|
58fe07351e | ||
|
|
25e79fd001 | ||
|
|
53868a4d50 | ||
|
|
21f6f4d933 | ||
|
|
21f691b6da | ||
|
|
45c46ff14a | ||
|
|
6dad0878da | ||
|
|
3b6552d728 | ||
|
|
e83ce5d6c8 | ||
|
|
b6c672a1ad | ||
|
|
e2cfa60caa | ||
|
|
fa8f4e03d2 | ||
|
|
ac3d9fa2c3 | ||
|
|
ff325ebf2a | ||
|
|
71825cb90a | ||
|
|
d1281e560a | ||
|
|
a1dc7f38ed | ||
|
|
581118b918 | ||
|
|
ab378b3d16 | ||
|
|
dd034643da | ||
|
|
bc2e531c05 | ||
|
|
334f6cf2d8 | ||
|
|
31296a6ce2 | ||
|
|
6fc8ae8293 | ||
|
|
a1d6e7147b | ||
|
|
0d111b15f8 | ||
|
|
95b9c4825f | ||
|
|
65e26d9ba4 | ||
|
|
cabce37133 | ||
|
|
20c4484066 | ||
|
|
17dc5fc37f | ||
|
|
05d907b675 | ||
|
|
62cb650356 | ||
|
|
9f833b3931 | ||
|
|
f0d123979c | ||
|
|
90078a4bce | ||
|
|
2d3aa76bf0 | ||
|
|
86bd86b966 | ||
|
|
bebd0ede64 | ||
|
|
14bdd496f7 | ||
|
|
91fcb3f6b6 | ||
|
|
ff94cadd7b | ||
|
|
60fe8f9106 | ||
|
|
5158581b0c | ||
|
|
ee511b4934 | ||
|
|
bc13653236 | ||
|
|
fe28e254a3 | ||
|
|
82179812de | ||
|
|
d42c2aa014 | ||
|
|
ff92316488 | ||
|
|
00f1072f5a | ||
|
|
c2d56b5eb8 | ||
|
|
0d9eacc1ec | ||
|
|
75491e65c0 | ||
|
|
a93df6fcb2 | ||
|
|
b5962b4f81 | ||
|
|
b5be0273a6 | ||
|
|
62a1aec555 | ||
|
|
5053a6fc80 | ||
|
|
f038c2d378 | ||
|
|
febafecfdd | ||
|
|
394feb715d | ||
|
|
76c125e628 | ||
|
|
10ac9d8659 | ||
|
|
9a6d950727 | ||
|
|
326d3b90c2 | ||
|
|
499f39340b | ||
|
|
54eba823ad | ||
|
|
61e787ec89 | ||
|
|
95d42b1340 | ||
|
|
bf9840ea46 | ||
|
|
74dbbaf4d4 | ||
|
|
c2ae5b6206 | ||
|
|
25de660d27 | ||
|
|
de90f45f41 | ||
|
|
dda79df1c3 | ||
|
|
26ea68999b | ||
|
|
4cfb4af1da | ||
|
|
11eaa99af7 | ||
|
|
93231c27f4 | ||
|
|
e7b9c90eef | ||
|
|
70c9a5db88 | ||
|
|
2e6c2498b5 | ||
|
|
e7fd617ca9 | ||
|
|
bd5b03b18d | ||
|
|
3a7ab9b3a1 | ||
|
|
0cf789622c | ||
|
|
d63f5eec5e | ||
|
|
42bd8b76a1 | ||
|
|
73742656ae | ||
|
|
f71f26d1dc | ||
|
|
95822300d7 | ||
|
|
679fe040cf | ||
|
|
14b6149f50 | ||
|
|
4446738940 | ||
|
|
c8ad016d9c | ||
|
|
498954fd09 | ||
|
|
198f6d3627 | ||
|
|
f701f2a4f4 | ||
|
|
94131ba6d6 | ||
|
|
c0e892313f | ||
|
|
b426342c02 | ||
|
|
bbbd773c3f | ||
|
|
7d5f4e5881 | ||
|
|
29c44538dc | ||
|
|
198f995b21 | ||
|
|
2d639667a3 | ||
|
|
1be017d69d | ||
|
|
03df4fee8e | ||
|
|
c658ed3404 | ||
|
|
99e58e60dc | ||
|
|
a9ad0284e9 | ||
|
|
6e2d791c4b | ||
|
|
f9be857bbb | ||
|
|
1288ac140e | ||
|
|
7f07f7e049 | ||
|
|
b22589bbad | ||
|
|
be144adeee | ||
|
|
513619b04e | ||
|
|
81f6a75aac | ||
|
|
913d03de75 | ||
|
|
2d0172d839 | ||
|
|
27d46641e3 | ||
|
|
1014816d79 | ||
|
|
441194acb7 | ||
|
|
c9bea7200f | ||
|
|
9eaa88bd83 | ||
|
|
6ada48d57a | ||
|
|
8fa978df21 | ||
|
|
df7356fd24 | ||
|
|
153fa4ce44 | ||
|
|
6105bd2c88 | ||
|
|
c06d63eec1 | ||
|
|
4ee7359370 | ||
|
|
7b5c47b377 | ||
|
|
7ad57e88f3 | ||
|
|
c181e55557 | ||
|
|
5574be699b | ||
|
|
b3142cb8ed | ||
|
|
cb08d9d1a3 | ||
|
|
7e0cd721e6 | ||
|
|
4d01cbae03 | ||
|
|
13f6389559 | ||
|
|
f6ea9bcc50 | ||
|
|
f6f2766eac | ||
|
|
f8f63bface | ||
|
|
5ec561fec4 | ||
|
|
277787cbd2 | ||
|
|
dda4336721 | ||
|
|
59ddff40ab | ||
|
|
064d19b48c | ||
|
|
3ea269f4d8 | ||
|
|
c4b8befe27 | ||
|
|
06f667ef2a | ||
|
|
bac3cc7bf8 | ||
|
|
6ad0a9f886 | ||
|
|
9b12932b66 | ||
|
|
82bb0d51d9 | ||
|
|
39dede92e8 | ||
|
|
84f4e6e48d | ||
|
|
e629dea585 | ||
|
|
2faf22ffff | ||
|
|
2273505a13 | ||
|
|
19eb29d831 | ||
|
|
738c4c2bd7 | ||
|
|
64e2273475 | ||
|
|
5a85c89154 | ||
|
|
8898b10e89 | ||
|
|
dc2d4e25f7 | ||
|
|
9275c4f6c0 | ||
|
|
cb75cc62b2 | ||
|
|
b141f6a62f | ||
|
|
4a251a528c | ||
|
|
ac3c2df474 | ||
|
|
681f973d4b | ||
|
|
338be7622f | ||
|
|
1227047b03 | ||
|
|
9afde8d0be | ||
|
|
c2ca1feba0 | ||
|
|
f8b6119996 | ||
|
|
98c265304a | ||
|
|
675e3e8046 | ||
|
|
4acba8c990 | ||
|
|
a93adeb1fe | ||
|
|
a7c90f749e | ||
|
|
cf8773f3de | ||
|
|
3be94ae1e7 | ||
|
|
6a8aa06d18 | ||
|
|
dc17889209 | ||
|
|
4dab70eea3 | ||
|
|
55f9d8e120 | ||
|
|
15b9457ed8 | ||
|
|
898297e95c | ||
|
|
0fc4f24cd5 | ||
|
|
63b5ad9edf | ||
|
|
873c3264ca | ||
|
|
34f89e48aa | ||
|
|
b01cc1fe9d | ||
|
|
3a6e34589f | ||
|
|
68e9c85d8f | ||
|
|
1b124ff5c7 | ||
|
|
a1d512d9d7 | ||
|
|
51bf6b7fdc | ||
|
|
b5826fc0a5 | ||
|
|
becdd2f451 | ||
|
|
3b20bf354f | ||
|
|
ab2645765d | ||
|
|
2dec852ce2 | ||
|
|
8cb09379f4 | ||
|
|
fff7fe934b | ||
|
|
9fb2e61e01 | ||
|
|
24b3b6afc1 | ||
|
|
c2eed7e2c4 | ||
|
|
f97ef696e3 | ||
|
|
ad65cb8ab5 | ||
|
|
8d8131410a | ||
|
|
7491711b72 | ||
|
|
5933aa59c1 | ||
|
|
da96bec465 | ||
|
|
483422c0e9 | ||
|
|
3df93cc147 | ||
|
|
d686edfa6c | ||
|
|
497b0ade1f | ||
|
|
794927cac3 | ||
|
|
4c8d128eee | ||
|
|
86acbcd0d6 | ||
|
|
9111c85445 | ||
|
|
1d87879787 | ||
|
|
7c777f2bdf | ||
|
|
aa8067b8d0 | ||
|
|
bd66cdeb78 | ||
|
|
8d29e50669 | ||
|
|
5a7398d242 | ||
|
|
74b984fbe6 | ||
|
|
f8e00204b4 | ||
|
|
76543df765 | ||
|
|
15d4b2a5f7 | ||
|
|
2e67f91fe0 | ||
|
|
df106ca680 | ||
|
|
c58f93b597 | ||
|
|
3f2a0ead1b | ||
|
|
c9e6d2998e | ||
|
|
0eb21a3471 | ||
|
|
99e88d3497 | ||
|
|
f09ce70d3c | ||
|
|
7d62e2735f | ||
|
|
40634c6ec1 | ||
|
|
5863badbb0 | ||
|
|
8bc758ce95 | ||
|
|
56d26222e7 | ||
|
|
bd34084104 | ||
|
|
f5e6fe927d | ||
|
|
93c49639c2 | ||
|
|
aabe7bef34 | ||
|
|
909165d813 | ||
|
|
6bee742b65 | ||
|
|
23486d01b9 | ||
|
|
b761d5a730 | ||
|
|
9181e74fc8 | ||
|
|
5e83864f41 | ||
|
|
73079ca1b7 | ||
|
|
789cf66de2 | ||
|
|
c36f19a97f | ||
|
|
109338923a | ||
|
|
f4c2501b06 | ||
|
|
9161229474 | ||
|
|
265f2f40bf | ||
|
|
d2935ac2ae | ||
|
|
aaf00b8a20 | ||
|
|
f9c6a49d2a | ||
|
|
2f54a48a3d | ||
|
|
be4dd0a787 | ||
|
|
f3f072e7cf | ||
|
|
a6270bf552 | ||
|
|
de5f2d6d5b | ||
|
|
4aa377dea7 | ||
|
|
efbf3d84ac | ||
|
|
b90393b43e | ||
|
|
31ae73fe0e | ||
|
|
7a5adfc4dc | ||
|
|
850e264912 | ||
|
|
aa81779ad8 | ||
|
|
72c97c0835 | ||
|
|
12809a6733 | ||
|
|
c55aeff98e | ||
|
|
16b76e401c | ||
|
|
d2470efd6f | ||
|
|
1a97b1b77c | ||
|
|
adde5b78f3 | ||
|
|
06fd3a3686 | ||
|
|
d231b6ae2a | ||
|
|
f76274c19a | ||
|
|
e471fc5d23 | ||
|
|
cb1b602255 | ||
|
|
a728dbf632 | ||
|
|
84d06d180a | ||
|
|
342e4d9f5e | ||
|
|
8eb92471ae | ||
|
|
0cfc32f591 | ||
|
|
e8b1e07625 | ||
|
|
f97946bd21 | ||
|
|
f7f461db31 | ||
|
|
653d09c337 | ||
|
|
3fa5ac30ff | ||
|
|
4095041da9 | ||
|
|
c1c2f39cb5 | ||
|
|
e5b93871f7 | ||
|
|
896aeb571d | ||
|
|
f7f1a0aff0 | ||
|
|
3bc82dc382 | ||
|
|
99bac77ae7 | ||
|
|
5705ebdcad | ||
|
|
f3fb445c9e | ||
|
|
c60fe8aae2 | ||
|
|
d2a882e531 | ||
|
|
036fa1f43b | ||
|
|
839b4af45c | ||
|
|
3a9797ce75 | ||
|
|
b2f14c0339 | ||
|
|
5d9405ccc3 | ||
|
|
d54db4358c | ||
|
|
a172f61494 | ||
|
|
225280d37a | ||
|
|
c735ab6b95 | ||
|
|
d47e59783f | ||
|
|
8a390d255d | ||
|
|
03540b22c1 | ||
|
|
fad96fe4f4 | ||
|
|
19b706d125 | ||
|
|
c871912188 | ||
|
|
7124bd05c8 | ||
|
|
783f444cff | ||
|
|
0f57687d81 | ||
|
|
235bf1f4e4 | ||
|
|
2d7b4b6c82 | ||
|
|
68369c16da | ||
|
|
90f36db63a | ||
|
|
f002110c28 | ||
|
|
83513b624e | ||
|
|
6042250940 | ||
|
|
f78c234780 | ||
|
|
21efae9276 | ||
|
|
1e58606ae7 | ||
|
|
4a11682316 | ||
|
|
3e92680b08 | ||
|
|
2be47d688b | ||
|
|
2ddccdbca5 | ||
|
|
ab05897cd6 | ||
|
|
7cd691f5f0 | ||
|
|
24a13af657 | ||
|
|
b13530e84b | ||
|
|
3911b72f87 | ||
|
|
ec278cfcd8 | ||
|
|
912730378e | ||
|
|
ac35f19f01 | ||
|
|
c25a1af96e | ||
|
|
70667d06a1 | ||
|
|
31fd994d83 | ||
|
|
fc934157f6 | ||
|
|
0bbded1772 | ||
|
|
a6eea34c74 | ||
|
|
3605b746a9 | ||
|
|
4b29a9aaa6 | ||
|
|
e60a9f4a74 | ||
|
|
d1d773bc9c | ||
|
|
55e8a269c0 | ||
|
|
0db0aadd45 | ||
|
|
83f3873e03 | ||
|
|
80fd3e9697 | ||
|
|
bae8268b29 | ||
|
|
466c5f695a | ||
|
|
b6a70228ea | ||
|
|
ac32c432da | ||
|
|
066ac6bf98 | ||
|
|
ccfa7d9943 | ||
|
|
90c76a01a6 | ||
|
|
807b52cccf | ||
|
|
fb7c6c6bbf | ||
|
|
12e619b990 | ||
|
|
aba2f8110c | ||
|
|
862e3fc7ed | ||
|
|
51fc92759a | ||
|
|
c8fac3381d | ||
|
|
9723090f91 | ||
|
|
4783e08c69 | ||
|
|
34959ff0ec | ||
|
|
bec9be84d5 | ||
|
|
277ee9d7e4 | ||
|
|
314518a87f | ||
|
|
c280fa11c3 | ||
|
|
929f5785a8 | ||
|
|
9ae92c19ab | ||
|
|
599bb7355e | ||
|
|
ad76a2f44f | ||
|
|
3a3ad44f13 | ||
|
|
db01bfb0a8 | ||
|
|
3e9b7e829c | ||
|
|
530720f2b9 | ||
|
|
a5d6d364db | ||
|
|
cb7e580942 | ||
|
|
8653fc7eb1 | ||
|
|
d077702250 | ||
|
|
472b15d940 | ||
|
|
f71176b362 | ||
|
|
aa5f988776 | ||
|
|
328311e781 | ||
|
|
f2875de83d | ||
|
|
2108f918b4 | ||
|
|
32441bdcd6 | ||
|
|
b80b9c08db | ||
|
|
4f09c94098 | ||
|
|
5e47f2fb52 | ||
|
|
47f2f62b4f | ||
|
|
61642b2536 | ||
|
|
20d12c5aa1 | ||
|
|
dd9ac6e4f8 | ||
|
|
1b7196938f | ||
|
|
5d9818914c | ||
|
|
f33ec81f19 | ||
|
|
a9dbcc29d0 | ||
|
|
f30f92d1b6 | ||
|
|
33d250d0e1 | ||
|
|
f025ffa7b1 | ||
|
|
6467bb89b3 | ||
|
|
7fc9195068 | ||
|
|
2e7e276abf | ||
|
|
cc249d3e8b | ||
|
|
2db8b35cf7 | ||
|
|
f098002da5 | ||
|
|
0b47d279c0 | ||
|
|
a3234f3912 | ||
|
|
2a6f2bbb4b | ||
|
|
fcdad5d80d | ||
|
|
dfa15c1e0f | ||
|
|
bead3462e7 | ||
|
|
246f91937c | ||
|
|
468de3d3af | ||
|
|
ee292b8855 | ||
|
|
38a6361aed | ||
|
|
0231650b6b | ||
|
|
35e4af88d0 | ||
|
|
a44a1496ca | ||
|
|
7ebc77c95f | ||
|
|
de20b17989 | ||
|
|
cae4b244e8 | ||
|
|
eed5aec08d | ||
|
|
90fa0e0588 | ||
|
|
2269bd4d8f | ||
|
|
b3bd55f969 | ||
|
|
dd91354eb4 | ||
|
|
27c294166b | ||
|
|
0cdf004902 | ||
|
|
9dd8d9510b | ||
|
|
6de44dd8d1 | ||
|
|
41e88b82b7 | ||
|
|
afe73c05fe | ||
|
|
f4fc60707f | ||
|
|
8527c3fef9 | ||
|
|
c279174465 | ||
|
|
49fa18825b | ||
|
|
32d7dca15b | ||
|
|
8ba2d47e48 | ||
|
|
c4d5cad2d4 | ||
|
|
718543cf83 | ||
|
|
ca8f21358e | ||
|
|
d56fc0874c | ||
|
|
d09584fa88 | ||
|
|
ade4890ede | ||
|
|
b734c66a90 | ||
|
|
bc979ba26e | ||
|
|
906acaf417 | ||
|
|
432724f63e | ||
|
|
1e5e3a1599 | ||
|
|
37699c1831 | ||
|
|
6c6da24281 | ||
|
|
2d85476433 | ||
|
|
cdc8a6b568 | ||
|
|
1b539483d1 | ||
|
|
25eab61cd0 | ||
|
|
43a782937f | ||
|
|
de1a3ee84a | ||
|
|
b12eb407cb | ||
|
|
90096d65e9 | ||
|
|
0e7f1aa44a | ||
|
|
68932ee4ce | ||
|
|
cf22cfcc88 | ||
|
|
c5b5eacba5 | ||
|
|
380bcb2d14 | ||
|
|
956a4d1b5e | ||
|
|
b7fb4b4b0b | ||
|
|
4433745cff | ||
|
|
8eda79227b | ||
|
|
1a3ec55e6e |
@@ -11,7 +11,7 @@
|
||||
"cojson-storage-sqlite",
|
||||
"cojson-transport-ws",
|
||||
"jazz-browser",
|
||||
"jazz-browser-auth-clerk",
|
||||
"jazz-auth-clerk",
|
||||
"jazz-browser-media-images",
|
||||
"jazz-nodejs",
|
||||
"jazz-react",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
"jazz-react-native": patch
|
||||
---
|
||||
|
||||
Fix username key hashing in DemoAuth
|
||||
Improve error handling when loading an existing account fails
|
||||
Fix the double context creation in Reacc development mode
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"cojson": patch
|
||||
---
|
||||
|
||||
Add the assign method to RawCoMap to create bulk transactions and optimize RawCoMap init
|
||||
39
.github/actions/android-emulator/action.yml
vendored
Normal file
39
.github/actions/android-emulator/action.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Setup Android Emulator
|
||||
|
||||
inputs:
|
||||
api-level:
|
||||
description: 'API level to use for the emulator'
|
||||
required: true
|
||||
default: '29'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Enable KVM
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
|
||||
- name: Gradle cache
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: AVD cache
|
||||
uses: useblacksmith/cache@v5
|
||||
id: avd-cache
|
||||
with:
|
||||
path: |
|
||||
~/.android/avd/*
|
||||
~/.android/adb*
|
||||
key: avd-${{ inputs.api-level }}
|
||||
|
||||
- name: Create AVD and Generate Snapshot for Caching
|
||||
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: ${{ inputs.api-level }}
|
||||
force-avd-creation: false
|
||||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
|
||||
disable-animations: false
|
||||
script: echo "Generated AVD snapshot for caching."
|
||||
36
.github/actions/source-code/action.yml
vendored
Normal file
36
.github/actions/source-code/action.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Get and Build Source Code
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Enable latestcorepack
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||
npm install -g corepack@latest
|
||||
echo "After : corepack version => $(corepack --version)"
|
||||
corepack enable
|
||||
pnpm --version
|
||||
|
||||
- name: Install Node.js
|
||||
uses: useblacksmith/setup-node@v5
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: useblacksmith/cache@v5
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pnpm install --frozen-lockfile
|
||||
34
.github/workflows/build-examples.yaml
vendored
34
.github/workflows/build-examples.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build-examples:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
strategy:
|
||||
matrix:
|
||||
example: [
|
||||
@@ -19,40 +19,16 @@ jobs:
|
||||
"pets",
|
||||
"reactions",
|
||||
"todo",
|
||||
"onboarding",
|
||||
]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Setup Source Code
|
||||
uses: ./.github/actions/source-code/
|
||||
|
||||
- name: Pnpm Build
|
||||
run: |
|
||||
|
||||
52
.github/workflows/build-starters.yaml
vendored
52
.github/workflows/build-starters.yaml
vendored
@@ -2,51 +2,25 @@ name: Build Starters
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
branches: ["main"]
|
||||
|
||||
jobs:
|
||||
build-starters:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
strategy:
|
||||
matrix:
|
||||
starter: [
|
||||
"react-demo-auth-tailwind",
|
||||
]
|
||||
starter: ["react-passkey-auth"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
- name: Setup Source Code
|
||||
uses: ./.github/actions/source-code/
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
|
||||
- name: Pnpm Build
|
||||
run: |
|
||||
pnpm install
|
||||
pnpm turbo build;
|
||||
working-directory: ./starters/${{ matrix.starter }}
|
||||
- name: Pnpm Build
|
||||
run: |
|
||||
pnpm install
|
||||
pnpm turbo build;
|
||||
working-directory: ./starters/${{ matrix.starter }}
|
||||
|
||||
2
.github/workflows/code-quality.yml
vendored
2
.github/workflows/code-quality.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
85
.github/workflows/e2e-rn-test.yml
vendored
Normal file
85
.github/workflows/e2e-rn-test.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: End-to-End Tests for React Native
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- ".github/actions/android-emulator/**"
|
||||
- ".github/actions/source-code/**"
|
||||
- ".github/workflows/e2e-rn-test.yml"
|
||||
- "examples/chat-rn/**"
|
||||
- "examples/chat-rn-clerk/**"
|
||||
- "packages/**"
|
||||
|
||||
jobs:
|
||||
e2e-tests:
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Source Code
|
||||
uses: ./.github/actions/source-code/
|
||||
|
||||
- name: Create Output Directory
|
||||
run: |
|
||||
mkdir -p ~/output
|
||||
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: corretto
|
||||
java-version: 22
|
||||
cache: gradle
|
||||
|
||||
- name: Pnpm Build
|
||||
run: pnpm turbo build --filter="./packages/*"
|
||||
|
||||
- name: chat-rn App Pre Build
|
||||
working-directory: ./examples/chat-rn
|
||||
run: |
|
||||
pnpm build
|
||||
pnpm expo prebuild --clean
|
||||
|
||||
- name: Install Maestro
|
||||
run: |
|
||||
curl -fsSL "https://get.maestro.mobile.dev" | bash
|
||||
|
||||
- name: Setup Android Emulator
|
||||
id: android-emulator
|
||||
uses: ./.github/actions/android-emulator/
|
||||
with:
|
||||
api-level: 29
|
||||
|
||||
- name: Test App
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
id: e2e_test
|
||||
continue-on-error: true
|
||||
with:
|
||||
api-level: 29
|
||||
force-avd-creation: false
|
||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
|
||||
disable-animations: true
|
||||
working-directory: ./examples/chat-rn/
|
||||
script: ./test/e2e/run.sh
|
||||
|
||||
- name: Copy Maestro Output
|
||||
if: steps.e2e_test.outcome != 'success'
|
||||
run: |
|
||||
cp -r ~/.maestro/tests/* ~/output
|
||||
|
||||
- name: Upload Output Files
|
||||
if: steps.e2e_test.outcome != 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: e2e-test-output
|
||||
path: ~/output/*
|
||||
retention-days: 5
|
||||
|
||||
- name: Exit with Test Result
|
||||
if: always()
|
||||
run: |
|
||||
if [ "${{ steps.e2e_test.outcome }}" != "success" ]; then
|
||||
exit 1
|
||||
fi
|
||||
31
.github/workflows/jazz-run.yml
vendored
31
.github/workflows/jazz-run.yml
vendored
@@ -8,38 +8,16 @@ on:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Source Code
|
||||
uses: ./.github/actions/source-code/
|
||||
|
||||
- name: Build jazz-run
|
||||
run: pnpm exec turbo build && chmod +x dist/index.js;
|
||||
@@ -48,4 +26,3 @@ jobs:
|
||||
- name: Run create account
|
||||
run: ./dist/index.js account create --name "Jazz Run CI test"
|
||||
working-directory: ./packages/jazz-run
|
||||
|
||||
32
.github/workflows/playwright.yml
vendored
32
.github/workflows/playwright.yml
vendored
@@ -9,41 +9,19 @@ on:
|
||||
jobs:
|
||||
test:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "examples/onboarding"]
|
||||
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Source Code
|
||||
uses: ./.github/actions/source-code/
|
||||
|
||||
- name: Pnpm Build
|
||||
run: pnpm turbo build
|
||||
|
||||
102
.github/workflows/pre-release.yml
vendored
Normal file
102
.github/workflows/pre-release.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
name: Pre-Publish tagged Pull Requests
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, labeled]
|
||||
|
||||
jobs:
|
||||
pre-release:
|
||||
if: contains(github.event.pull_request.labels.*.name, 'pre-release')
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Source Code
|
||||
uses: ./.github/actions/source-code/
|
||||
|
||||
- name: Pnpm Build
|
||||
run: pnpm turbo build --filter="./packages/*"
|
||||
|
||||
- name: Pre publish
|
||||
run: pnpm exec pkg-pr-new publish --json output.json --comment=off "./packages/*"
|
||||
|
||||
- name: Post or update comment
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
|
||||
|
||||
const packages = output.packages
|
||||
.map((p) => `- ${p.name}: ${p.url}`)
|
||||
.join('\n');
|
||||
|
||||
const sha =
|
||||
context.event_name === 'pull_request'
|
||||
? context.payload.pull_request.head.sha
|
||||
: context.payload.after;
|
||||
|
||||
const resolutions = Object.fromEntries(
|
||||
output.packages.map((p) => [p.name, p.url])
|
||||
);
|
||||
|
||||
const commitUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${sha}`;
|
||||
|
||||
const body = `## Jazz pre-release
|
||||
|
||||
### Packages:
|
||||
|
||||
\`\`\`json
|
||||
${JSON.stringify(resolutions, null, 4)}
|
||||
\`\`\`
|
||||
|
||||
[View Commit](${commitUrl})`;
|
||||
|
||||
async function logPublishInfo() {
|
||||
console.log('\n' + '='.repeat(50));
|
||||
console.log('Publish Information');
|
||||
console.log('='.repeat(50));
|
||||
console.log('\nPublished Packages:');
|
||||
console.log(output.packages);
|
||||
console.log('\nTemplates:');
|
||||
console.log(templates);
|
||||
console.log(`\nCommit URL: ${commitUrl}`);
|
||||
console.log('\n' + '='.repeat(50));
|
||||
}
|
||||
|
||||
if (context.eventName === 'pull_request') {
|
||||
if (context.issue.number) {
|
||||
await github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: body,
|
||||
});
|
||||
}
|
||||
} else if (context.eventName === 'push') {
|
||||
const pullRequests = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
head: `${context.repo.owner}:${context.ref.replace(
|
||||
'refs/heads/',
|
||||
''
|
||||
)}`,
|
||||
});
|
||||
|
||||
if (pullRequests.data.length > 0) {
|
||||
await github.rest.issues.createComment({
|
||||
issue_number: pullRequests.data[0].number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: body,
|
||||
});
|
||||
} else {
|
||||
console.log(
|
||||
'No open pull request found for this push. Logging publish information to console:'
|
||||
);
|
||||
await logPublishInfo();
|
||||
}
|
||||
}
|
||||
30
.github/workflows/release.yml
vendored
30
.github/workflows/release.yml
vendored
@@ -17,35 +17,13 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Source Code
|
||||
uses: ./.github/actions/source-code/
|
||||
|
||||
- name: Create Release Pull Request or Publish to npm
|
||||
id: changesets
|
||||
|
||||
31
.github/workflows/unit-test.yml
vendored
31
.github/workflows/unit-test.yml
vendored
@@ -9,39 +9,20 @@ on:
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Source Code
|
||||
uses: ./.github/actions/source-code/
|
||||
|
||||
- name: Pnpm Build
|
||||
run: pnpm turbo build --filter="./packages/*"
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: pnpm exec playwright install
|
||||
|
||||
- name: Unit Tests
|
||||
run: pnpm test:ci
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -7,11 +7,15 @@ docsTmp
|
||||
coverage
|
||||
.direnv
|
||||
|
||||
# Typescript
|
||||
**/*.tsbuildinfo
|
||||
|
||||
# Next.js
|
||||
**/.next
|
||||
|
||||
# Vite output
|
||||
**/dist
|
||||
__screenshots__
|
||||
|
||||
# Playwright
|
||||
test-results
|
||||
@@ -19,3 +23,5 @@ test-results
|
||||
.husky
|
||||
|
||||
.vscode/settings.json
|
||||
|
||||
.svelte-kit
|
||||
@@ -36,7 +36,7 @@ We welcome all ideas! If you have suggestions, feel free to open an issue marked
|
||||
|
||||
### 5. Local Setup
|
||||
|
||||
You'll need Node.js 20.x or 22.x installed (we're working on support for 23.x), and pnpm 9.x installed. If you're using nix, run `nix develop` to get a shell with the correct versions of everything installed.
|
||||
You'll need Node.js 22.x installed (we're working on support for 23.x), and pnpm 9.x installed. If you're using nix, run `nix develop` to get a shell with the correct versions of everything installed.
|
||||
|
||||
1. **Clone the repository**:
|
||||
```bash
|
||||
@@ -48,7 +48,25 @@ You'll need Node.js 20.x or 22.x installed (we're working on support for 23.x),
|
||||
pnpm install
|
||||
```
|
||||
|
||||
3. **Run tests** to verify everything is working:
|
||||
3. **Install homepage dependencies**:
|
||||
|
||||
```bash
|
||||
cd homepage && pnpm install
|
||||
```
|
||||
|
||||
4. **Go back to the project root**:
|
||||
|
||||
```bash
|
||||
cd ..
|
||||
```
|
||||
|
||||
4. **Build the packages**:
|
||||
|
||||
```bash
|
||||
pnpm build
|
||||
```
|
||||
|
||||
5. **Run tests** to verify everything is working:
|
||||
```bash
|
||||
pnpm test
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright 2024, Garden Computing, Inc.
|
||||
Copyright 2025, Garden Computing, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
||||
|
||||
@@ -17,4 +17,4 @@ For community and support, please join our [Discord](https://discord.gg/utDMjHYg
|
||||
- Community & support: [Discord](https://discord.gg/utDMjHYg42)
|
||||
- Updates: [X](https://x.com/jazz_tools) & [Email](https://garden.co/news)
|
||||
|
||||
Copyright 2024 — Garden Computing, Inc.
|
||||
Copyright 2025 — Garden Computing, Inc.
|
||||
|
||||
21
biome.json
21
biome.json
@@ -12,7 +12,9 @@
|
||||
"**/ios/**",
|
||||
"**/android/**",
|
||||
"packages/jazz-svelte/**",
|
||||
"examples/*svelte*/**"
|
||||
"examples/*svelte*/**",
|
||||
"homepage/homepage/**",
|
||||
"**/package.json"
|
||||
]
|
||||
},
|
||||
"formatter": {
|
||||
@@ -52,21 +54,24 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"include": ["packages/**/src/tests/**", "packages/**/src/test/**"],
|
||||
"include": ["packages/cojson-storage*/**", "cojson-transport-ws/**"],
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"useImportExtensions": "off"
|
||||
}
|
||||
"recommended": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"include": ["packages/cojson-storage-indexeddb/**"],
|
||||
"include": ["packages/**/src/tests/**"],
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"correctness": {
|
||||
"useImportExtensions": "off"
|
||||
},
|
||||
"style": {
|
||||
"noNonNullAssertion": "off"
|
||||
},
|
||||
"suspicious": {
|
||||
"noExplicitAny": "info"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,364 @@
|
||||
# chat-rn-clerk
|
||||
|
||||
## 1.0.79
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [75211e3]
|
||||
- jazz-tools@0.10.14
|
||||
- jazz-react-native@0.10.14
|
||||
- jazz-react-native-auth-clerk@0.10.14
|
||||
- jazz-react-native-media-images@0.10.14
|
||||
|
||||
## 1.0.78
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [07feedd]
|
||||
- jazz-tools@0.10.13
|
||||
- jazz-react-native@0.10.13
|
||||
- jazz-react-native-auth-clerk@0.10.13
|
||||
- jazz-react-native-media-images@0.10.13
|
||||
|
||||
## 1.0.77
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4612e05]
|
||||
- jazz-tools@0.10.12
|
||||
- jazz-react-native@0.10.12
|
||||
- jazz-react-native-auth-clerk@0.10.12
|
||||
- jazz-react-native-media-images@0.10.12
|
||||
|
||||
## 1.0.76
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a54e4a]
|
||||
- jazz-react-native@0.10.11
|
||||
- jazz-react-native-auth-clerk@0.10.11
|
||||
|
||||
## 1.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3405d8f]
|
||||
- jazz-react-native@0.10.10
|
||||
- jazz-react-native-auth-clerk@0.10.10
|
||||
|
||||
## 1.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native-auth-clerk@0.10.9
|
||||
|
||||
## 1.0.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [2fb6428]
|
||||
- jazz-tools@0.10.8
|
||||
- jazz-react-native@0.10.8
|
||||
- jazz-react-native-auth-clerk@0.10.8
|
||||
- jazz-react-native-media-images@0.10.8
|
||||
|
||||
## 1.0.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1136d9b]
|
||||
- Updated dependencies [0eed228]
|
||||
- jazz-react-native@0.10.7
|
||||
- jazz-tools@0.10.7
|
||||
- jazz-react-native-auth-clerk@0.10.7
|
||||
- jazz-react-native-media-images@0.10.7
|
||||
|
||||
## 1.0.71
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ada802b]
|
||||
- jazz-tools@0.10.6
|
||||
- jazz-react-native@0.10.6
|
||||
- jazz-react-native-auth-clerk@0.10.6
|
||||
- jazz-react-native-media-images@0.10.6
|
||||
|
||||
## 1.0.70
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59ff77e]
|
||||
- jazz-tools@0.10.5
|
||||
- jazz-react-native@0.10.5
|
||||
- jazz-react-native-auth-clerk@0.10.5
|
||||
- jazz-react-native-media-images@0.10.5
|
||||
|
||||
## 1.0.69
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.10.4
|
||||
- jazz-react-native-auth-clerk@0.10.4
|
||||
- jazz-tools@0.10.4
|
||||
- jazz-react-native-media-images@0.10.4
|
||||
|
||||
## 1.0.68
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8582fc]
|
||||
- jazz-tools@0.10.3
|
||||
- jazz-react-native@0.10.3
|
||||
- jazz-react-native-auth-clerk@0.10.3
|
||||
- jazz-react-native-media-images@0.10.3
|
||||
|
||||
## 1.0.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.10.2
|
||||
- jazz-react-native-auth-clerk@0.10.2
|
||||
- jazz-tools@0.10.2
|
||||
- jazz-react-native-media-images@0.10.2
|
||||
|
||||
## 1.0.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a63cba]
|
||||
- jazz-tools@0.10.1
|
||||
- jazz-react-native@0.10.1
|
||||
- jazz-react-native-auth-clerk@0.10.1
|
||||
- jazz-react-native-media-images@0.10.1
|
||||
|
||||
## 1.0.65
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [498954f]
|
||||
- Updated dependencies [d42c2aa]
|
||||
- Updated dependencies [dd03464]
|
||||
- Updated dependencies [b426342]
|
||||
- jazz-react-native-auth-clerk@0.10.0
|
||||
- jazz-react-native@0.10.0
|
||||
- jazz-tools@0.10.0
|
||||
- jazz-react-native-media-images@0.10.0
|
||||
|
||||
## 1.0.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.23
|
||||
- jazz-react-native-auth-clerk@0.9.23
|
||||
- jazz-tools@0.9.23
|
||||
- jazz-react-native-media-images@0.9.23
|
||||
|
||||
## 1.0.63
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.22
|
||||
- jazz-react-native-auth-clerk@0.9.22
|
||||
|
||||
## 1.0.62
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1be017d]
|
||||
- jazz-tools@0.9.21
|
||||
- jazz-react-native@0.9.21
|
||||
- jazz-react-native-auth-clerk@0.9.21
|
||||
- jazz-react-native-media-images@0.9.21
|
||||
|
||||
## 1.0.61
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react-native@0.9.20
|
||||
- jazz-react-native-auth-clerk@0.9.20
|
||||
- jazz-react-native-media-images@0.9.20
|
||||
|
||||
## 1.0.60
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.19
|
||||
- jazz-react-native-auth-clerk@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-react-native-media-images@0.9.19
|
||||
|
||||
## 1.0.59
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.18
|
||||
- jazz-react-native-auth-clerk@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-react-native-media-images@0.9.18
|
||||
|
||||
## 1.0.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react-native@0.9.17
|
||||
- jazz-react-native-auth-clerk@0.9.17
|
||||
- jazz-react-native-media-images@0.9.17
|
||||
|
||||
## 1.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-react-native-auth-clerk@0.9.16
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react-native@0.9.16
|
||||
- jazz-react-native-media-images@0.9.16
|
||||
|
||||
## 1.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react-native@0.9.15
|
||||
- jazz-react-native-auth-clerk@0.9.15
|
||||
- jazz-react-native-media-images@0.9.15
|
||||
|
||||
## 1.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react-native@0.9.14
|
||||
- jazz-react-native-auth-clerk@0.9.14
|
||||
- jazz-react-native-media-images@0.9.14
|
||||
|
||||
## 1.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.13
|
||||
- jazz-react-native-auth-clerk@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-react-native-media-images@0.9.13
|
||||
|
||||
## 1.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.12
|
||||
- jazz-react-native-auth-clerk@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-react-native-media-images@0.9.12
|
||||
|
||||
## 1.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.11
|
||||
- jazz-react-native-auth-clerk@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-react-native-media-images@0.9.11
|
||||
|
||||
## 1.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- f76274c: Fix image handling in react-native
|
||||
- Updated dependencies [f76274c]
|
||||
- Updated dependencies [5e83864]
|
||||
- jazz-react-native@0.9.10
|
||||
- jazz-tools@0.9.10
|
||||
- jazz-react-native-auth-clerk@0.9.10
|
||||
- jazz-react-native-media-images@0.9.10
|
||||
|
||||
## 1.0.50
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8eb9247]
|
||||
- jazz-tools@0.9.9
|
||||
- jazz-react-native@0.9.9
|
||||
- jazz-react-native-auth-clerk@0.9.9
|
||||
- jazz-react-native-media-images@0.9.9
|
||||
|
||||
## 1.0.49
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d1d773b]
|
||||
- jazz-tools@0.9.8
|
||||
- jazz-react-native@0.9.8
|
||||
- jazz-react-native-auth-clerk@0.9.8
|
||||
- jazz-react-native-media-images@0.9.8
|
||||
|
||||
## 1.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8a390d2]
|
||||
- jazz-react-native@0.9.6
|
||||
- jazz-react-native-auth-clerk@0.9.6
|
||||
|
||||
## 1.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c871912]
|
||||
- jazz-react-native@0.9.5
|
||||
- jazz-react-native-auth-clerk@0.9.5
|
||||
|
||||
## 1.0.46
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.4
|
||||
- jazz-react-native-auth-clerk@0.9.4
|
||||
|
||||
## 1.0.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7cd691f]
|
||||
- jazz-react-native@0.9.3
|
||||
- jazz-react-native-auth-clerk@0.9.3
|
||||
|
||||
## 1.0.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80fd3e9]
|
||||
- jazz-react-native@0.9.2
|
||||
- jazz-react-native-auth-clerk@0.9.2
|
||||
|
||||
## 1.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1b71969]
|
||||
- jazz-tools@0.9.1
|
||||
- jazz-react-native@0.9.1
|
||||
- jazz-react-native-auth-clerk@0.9.1
|
||||
- jazz-react-native-media-images@0.9.1
|
||||
|
||||
## 1.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1da4d55]
|
||||
- Updated dependencies [8eda792]
|
||||
- Updated dependencies [1e5e3a1]
|
||||
- jazz-react-native@0.9.0
|
||||
- jazz-tools@0.9.0
|
||||
- jazz-react-native-auth-clerk@0.9.0
|
||||
- jazz-react-native-media-images@0.9.0
|
||||
|
||||
## 1.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -37,7 +37,13 @@
|
||||
],
|
||||
"expo-secure-store",
|
||||
"expo-font",
|
||||
"expo-router"
|
||||
"expo-router",
|
||||
[
|
||||
"expo-image-picker",
|
||||
{
|
||||
"photosPermission": "The app accesses your photos to let you share them with your friends."
|
||||
}
|
||||
]
|
||||
],
|
||||
"extra": {
|
||||
"eas": {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Redirect, Stack } from "expo-router";
|
||||
import { useIsAuthenticated } from "jazz-react-native";
|
||||
import React from "react";
|
||||
import { useAuth } from "../../src/auth-context";
|
||||
|
||||
export default function HomeLayout() {
|
||||
const { isAuthenticated } = useAuth();
|
||||
const isAuthenticated = useIsAuthenticated();
|
||||
|
||||
if (isAuthenticated) {
|
||||
return <Redirect href={"/chat"} />;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Redirect, Stack } from "expo-router";
|
||||
import { useAuth } from "../../src/auth-context";
|
||||
import { useIsAuthenticated } from "jazz-react-native";
|
||||
|
||||
export default function UnAuthenticatedLayout() {
|
||||
const { isAuthenticated } = useAuth();
|
||||
const isAuthenticated = useIsAuthenticated();
|
||||
|
||||
if (isAuthenticated) {
|
||||
return <Redirect href={"/chat"} />;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import "../global.css";
|
||||
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
|
||||
import { secureStore } from "@clerk/clerk-expo/secure-store";
|
||||
import { useFonts } from "expo-font";
|
||||
import { Slot } from "expo-router";
|
||||
import * as SplashScreen from "expo-splash-screen";
|
||||
@@ -33,7 +34,11 @@ export default function RootLayout() {
|
||||
}
|
||||
|
||||
return (
|
||||
<ClerkProvider tokenCache={tokenCache} publishableKey={publishableKey}>
|
||||
<ClerkProvider
|
||||
tokenCache={tokenCache}
|
||||
publishableKey={publishableKey}
|
||||
__experimental_resourceCache={secureStore}
|
||||
>
|
||||
<ClerkLoaded>
|
||||
<JazzAndAuth>
|
||||
<Slot />
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { useAccount, useCoState } from "@/src/jazz";
|
||||
import { Chat, Message } from "@/src/schema";
|
||||
import { useFocusEffect, useNavigation } from "@react-navigation/native";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import clsx from "clsx";
|
||||
import * as Clipboard from "expo-clipboard";
|
||||
import * as ImagePicker from "expo-image-picker";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useAccount, useCoState } from "jazz-react-native";
|
||||
import { ProgressiveImg } from "jazz-react-native";
|
||||
import { createImage } from "jazz-react-native-media-images";
|
||||
import { Group, ID } from "jazz-tools";
|
||||
import { useEffect, useLayoutEffect, useState } from "react";
|
||||
import React, {
|
||||
@@ -16,6 +19,8 @@ import React, {
|
||||
KeyboardAvoidingView,
|
||||
TextInput,
|
||||
Button,
|
||||
Image,
|
||||
ActivityIndicator,
|
||||
} from "react-native";
|
||||
|
||||
export default function Conversation() {
|
||||
@@ -25,6 +30,7 @@ export default function Conversation() {
|
||||
const [message, setMessage] = useState("");
|
||||
const loadedChat = useCoState(Chat, chat?.id, [{}]);
|
||||
const navigation = useNavigation();
|
||||
const [isUploading, setIsUploading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (chat) return;
|
||||
@@ -81,6 +87,32 @@ export default function Conversation() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleImageUpload = async () => {
|
||||
try {
|
||||
const result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ImagePicker.MediaTypeOptions.Images,
|
||||
base64: true,
|
||||
quality: 0.7,
|
||||
});
|
||||
|
||||
if (!result.canceled && result.assets[0].base64 && chat) {
|
||||
setIsUploading(true);
|
||||
const base64Uri = `data:image/jpeg;base64,${result.assets[0].base64}`;
|
||||
|
||||
const image = await createImage(base64Uri, {
|
||||
owner: chat._owner,
|
||||
maxSize: 2048,
|
||||
});
|
||||
|
||||
chat.push(Message.create({ text: "", image }, { owner: chat._owner }));
|
||||
}
|
||||
} catch (error) {
|
||||
Alert.alert("Error", "Failed to upload image");
|
||||
} finally {
|
||||
setIsUploading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const renderMessageItem = ({ item }: { item: Message }) => {
|
||||
const isMe = item._edits.text.by?.isMe;
|
||||
return (
|
||||
@@ -106,14 +138,27 @@ export default function Conversation() {
|
||||
isMe ? "flex-row" : "flex-row",
|
||||
)}
|
||||
>
|
||||
<Text
|
||||
className={clsx(
|
||||
!isMe ? "text-black" : "text-gray-200",
|
||||
`text-md max-w-[85%]`,
|
||||
)}
|
||||
>
|
||||
{item.text}
|
||||
</Text>
|
||||
{item.image && (
|
||||
<ProgressiveImg image={item.image} maxWidth={1024}>
|
||||
{({ src, res, originalSize }) => (
|
||||
<Image
|
||||
source={{ uri: src }}
|
||||
className="w-48 h-48 rounded-lg mb-2"
|
||||
resizeMode="cover"
|
||||
/>
|
||||
)}
|
||||
</ProgressiveImg>
|
||||
)}
|
||||
{item.text && (
|
||||
<Text
|
||||
className={clsx(
|
||||
!isMe ? "text-black" : "text-gray-200",
|
||||
`text-md max-w-[85%]`,
|
||||
)}
|
||||
>
|
||||
{item.text}
|
||||
</Text>
|
||||
)}
|
||||
<Text
|
||||
className={clsx(
|
||||
"text-[10px] text-right ml-2",
|
||||
@@ -147,6 +192,17 @@ export default function Conversation() {
|
||||
className="p-3 bg-white border-t border-gray-300"
|
||||
>
|
||||
<SafeAreaView className="flex-row items-center gap-2">
|
||||
<TouchableOpacity
|
||||
onPress={handleImageUpload}
|
||||
disabled={isUploading}
|
||||
className="h-10 w-10 items-center justify-center"
|
||||
>
|
||||
{isUploading ? (
|
||||
<ActivityIndicator size="small" color="#0000ff" />
|
||||
) : (
|
||||
<Text className="text-2xl">🖼️</Text>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
<TextInput
|
||||
className="flex-1 rounded-full h-10 px-4 bg-gray-100 border border-gray-300 focus:border-blue-500 focus:bg-white"
|
||||
value={message}
|
||||
|
||||
@@ -11,7 +11,7 @@ import React, {
|
||||
} from "react-native";
|
||||
|
||||
import { useUser } from "@clerk/clerk-expo";
|
||||
import { useAccount } from "../../src/jazz";
|
||||
import { useAccount } from "jazz-react-native";
|
||||
import { Chat } from "../../src/schema";
|
||||
|
||||
export default function ChatScreen() {
|
||||
@@ -20,10 +20,15 @@ export default function ChatScreen() {
|
||||
const navigation = useNavigation();
|
||||
const { user } = useUser();
|
||||
|
||||
function handleLogOut() {
|
||||
logOut();
|
||||
router.navigate("/");
|
||||
}
|
||||
|
||||
useLayoutEffect(() => {
|
||||
navigation.setOptions({
|
||||
headerTitle: "Chat",
|
||||
headerRight: () => <Button onPress={logOut} title="Logout" />,
|
||||
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
|
||||
});
|
||||
}, [navigation]);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ config.resolver.nodeModulesPaths = [
|
||||
path.resolve(workspaceRoot, "node_modules"),
|
||||
];
|
||||
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
||||
config.resolver.unstable_enablePackageExports = true;
|
||||
config.resolver.requireCycleIgnorePatterns = [
|
||||
/(^|\/|\\)node_modules($|\/|\\)/,
|
||||
/(^|\/|\\)packages($|\/|\\)/,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "chat-rn-clerk",
|
||||
"main": "index.js",
|
||||
"version": "1.0.41",
|
||||
"version": "1.0.79",
|
||||
"scripts": {
|
||||
"build": "expo export -p ios",
|
||||
"start": "expo start",
|
||||
@@ -9,22 +9,22 @@
|
||||
"format-and-lint:fix": "biome check . --write",
|
||||
"android": "expo run:android",
|
||||
"ios": "expo run:ios",
|
||||
"web": "expo start --web",
|
||||
"test": "jest --watchAll"
|
||||
"web": "expo start --web"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "jest-expo"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
||||
"@bacons/text-decoder": "0.0.0",
|
||||
"@bam.tech/react-native-image-resizer": "^3.0.11",
|
||||
"@craftzdog/react-native-buffer": "6.0.5",
|
||||
"@clerk/clerk-expo": "^2.2.21",
|
||||
"@expo/vector-icons": "^14.0.2",
|
||||
"@op-engineering/op-sqlite": "^11.2.12",
|
||||
"@react-native-community/netinfo": "^11.4.1",
|
||||
"@react-navigation/native": "^7.0.13",
|
||||
"@react-navigation/native-stack": "^7.1.14",
|
||||
"base-64": "^1.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"clsx": "^2.0.0",
|
||||
"expo": "^52.0.0",
|
||||
"expo-build-properties": "~0.13.1",
|
||||
@@ -34,6 +34,7 @@
|
||||
"expo-dev-client": "~5.0.5",
|
||||
"expo-file-system": "^18.0.4",
|
||||
"expo-font": "~13.0.1",
|
||||
"expo-image-picker": "~16.0.4",
|
||||
"expo-linking": "~7.0.3",
|
||||
"expo-router": "~4.0.11",
|
||||
"expo-secure-store": "~14.0.0",
|
||||
@@ -49,18 +50,14 @@
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-native": "~0.76.3",
|
||||
"react-native-fetch-api": "^3.0.0",
|
||||
"react-native-gesture-handler": "~2.20.2",
|
||||
"react-native-get-random-values": "^1.11.0",
|
||||
"react-native-polyfill-globals": "^3.1.0",
|
||||
"react-native-quick-base64": "^2.1.2",
|
||||
"react-native-reanimated": "~3.16.3",
|
||||
"react-native-safe-area-context": "4.12.0",
|
||||
"react-native-screens": "4.1.0",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
"react-native-web": "~0.19.13",
|
||||
"text-encoding": "^0.7.0",
|
||||
"web-streams-polyfill": "^3.2.1"
|
||||
"readable-stream": "4.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
@@ -70,7 +67,7 @@
|
||||
"jest": "^29.2.1",
|
||||
"jest-expo": "~52.0.2",
|
||||
"react-test-renderer": "18.2.0",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.6.2"
|
||||
},
|
||||
"private": true
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
import "react-native-polyfill-globals/auto";
|
||||
import "@azure/core-asynciterator-polyfill";
|
||||
import { Buffer } from "buffer";
|
||||
import { polyfillGlobal } from "react-native/Libraries/Utilities/PolyfillFunctions";
|
||||
import { ReadableStream } from "web-streams-polyfill/ponyfill/es6";
|
||||
/* eslint-disable import/order */
|
||||
|
||||
// @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);
|
||||
|
||||
import "@azure/core-asynciterator-polyfill";
|
||||
|
||||
import "@bacons/text-decoder/install";
|
||||
|
||||
import "react-native-get-random-values";
|
||||
|
||||
1
examples/chat-rn-clerk/src/apiKey.ts
Normal file
1
examples/chat-rn-clerk/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const apiKey = "chat-rn-clerk-example-jazz@garden.co";
|
||||
@@ -1,62 +1,21 @@
|
||||
import { useClerk, useUser } from "@clerk/clerk-expo";
|
||||
import { useJazzClerkAuth } from "jazz-react-native-auth-clerk";
|
||||
import React, {
|
||||
createContext,
|
||||
PropsWithChildren,
|
||||
useContext,
|
||||
useEffect,
|
||||
useState,
|
||||
} from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import { Jazz, kvStore } from "./jazz";
|
||||
|
||||
const AuthContext = createContext<{
|
||||
isAuthenticated: boolean;
|
||||
isLoading: boolean;
|
||||
}>({
|
||||
isAuthenticated: false,
|
||||
isLoading: true,
|
||||
});
|
||||
|
||||
export function useAuth() {
|
||||
return useContext(AuthContext);
|
||||
}
|
||||
import { useClerk } from "@clerk/clerk-expo";
|
||||
import { JazzProviderWithClerk } from "jazz-react-native-auth-clerk";
|
||||
import React, { PropsWithChildren } from "react";
|
||||
import { apiKey } from "./apiKey";
|
||||
|
||||
export function JazzAndAuth({ children }: PropsWithChildren) {
|
||||
const { isSignedIn, isLoaded: isClerkLoaded } = useUser();
|
||||
const clerk = useClerk();
|
||||
const [auth, state] = useJazzClerkAuth(clerk, kvStore);
|
||||
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (isSignedIn && isClerkLoaded && auth) {
|
||||
setIsAuthenticated(true);
|
||||
} else {
|
||||
setIsAuthenticated(false);
|
||||
}
|
||||
}, [isSignedIn, isClerkLoaded, auth]);
|
||||
|
||||
return (
|
||||
<AuthContext.Provider
|
||||
value={{ isAuthenticated, isLoading: !isClerkLoaded || !auth }}
|
||||
<JazzProviderWithClerk
|
||||
clerk={clerk}
|
||||
storage="sqlite"
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
when: "signedUp", // This makes the app work in local mode when the user is not authenticated
|
||||
}}
|
||||
>
|
||||
{state?.errors?.length > 0 &&
|
||||
state.errors.map((error) => (
|
||||
<View key={error}>
|
||||
<Text style={{ color: "red" }}>{error}</Text>
|
||||
</View>
|
||||
))}
|
||||
{auth && clerk.user ? (
|
||||
<Jazz.Provider
|
||||
auth={auth}
|
||||
peer="wss://cloud.jazz.tools/?key=chat-rn-clerk-example-jazz@garden.co"
|
||||
storage={undefined}
|
||||
>
|
||||
{children}
|
||||
</Jazz.Provider>
|
||||
) : (
|
||||
children
|
||||
)}
|
||||
</AuthContext.Provider>
|
||||
{children}
|
||||
</JazzProviderWithClerk>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import { createJazzRNApp } from "jazz-react-native";
|
||||
|
||||
export const Jazz = createJazzRNApp();
|
||||
export const { useAccount, useCoState, useAcceptInvite, kvStore } = Jazz;
|
||||
@@ -1,7 +1,8 @@
|
||||
import { CoList, CoMap, co } from "jazz-tools";
|
||||
import { CoList, CoMap, ImageDefinition, co } from "jazz-tools";
|
||||
|
||||
export class Message extends CoMap {
|
||||
text = co.string;
|
||||
image = co.optional.ref(ImageDefinition);
|
||||
}
|
||||
|
||||
export class Chat extends CoList.Of(co.ref(Message)) {}
|
||||
|
||||
@@ -1,5 +1,291 @@
|
||||
# chat-rn
|
||||
|
||||
## 1.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [75211e3]
|
||||
- jazz-tools@0.10.14
|
||||
- jazz-react-native@0.10.14
|
||||
|
||||
## 1.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [07feedd]
|
||||
- jazz-tools@0.10.13
|
||||
- jazz-react-native@0.10.13
|
||||
|
||||
## 1.0.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4612e05]
|
||||
- jazz-tools@0.10.12
|
||||
- jazz-react-native@0.10.12
|
||||
|
||||
## 1.0.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a54e4a]
|
||||
- jazz-react-native@0.10.11
|
||||
|
||||
## 1.0.71
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3405d8f]
|
||||
- jazz-react-native@0.10.10
|
||||
|
||||
## 1.0.70
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [2fb6428]
|
||||
- jazz-tools@0.10.8
|
||||
- jazz-react-native@0.10.8
|
||||
|
||||
## 1.0.69
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1136d9b]
|
||||
- Updated dependencies [0eed228]
|
||||
- jazz-react-native@0.10.7
|
||||
- jazz-tools@0.10.7
|
||||
|
||||
## 1.0.68
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ada802b]
|
||||
- jazz-tools@0.10.6
|
||||
- jazz-react-native@0.10.6
|
||||
|
||||
## 1.0.67
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59ff77e]
|
||||
- jazz-tools@0.10.5
|
||||
- jazz-react-native@0.10.5
|
||||
|
||||
## 1.0.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.10.4
|
||||
- jazz-tools@0.10.4
|
||||
|
||||
## 1.0.65
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8582fc]
|
||||
- jazz-tools@0.10.3
|
||||
- jazz-react-native@0.10.3
|
||||
|
||||
## 1.0.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.10.2
|
||||
- jazz-tools@0.10.2
|
||||
|
||||
## 1.0.63
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a63cba]
|
||||
- jazz-tools@0.10.1
|
||||
- jazz-react-native@0.10.1
|
||||
|
||||
## 1.0.62
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [498954f]
|
||||
- Updated dependencies [d42c2aa]
|
||||
- Updated dependencies [dd03464]
|
||||
- Updated dependencies [b426342]
|
||||
- jazz-react-native@0.10.0
|
||||
- jazz-tools@0.10.0
|
||||
|
||||
## 1.0.61
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.23
|
||||
- jazz-tools@0.9.23
|
||||
|
||||
## 1.0.60
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.22
|
||||
|
||||
## 1.0.59
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1be017d]
|
||||
- jazz-tools@0.9.21
|
||||
- jazz-react-native@0.9.21
|
||||
|
||||
## 1.0.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react-native@0.9.20
|
||||
|
||||
## 1.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 1.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 1.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react-native@0.9.17
|
||||
|
||||
## 1.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react-native@0.9.16
|
||||
|
||||
## 1.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react-native@0.9.15
|
||||
|
||||
## 1.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react-native@0.9.14
|
||||
|
||||
## 1.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 1.0.50
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 1.0.49
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 1.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [f76274c]
|
||||
- Updated dependencies [5e83864]
|
||||
- jazz-react-native@0.9.10
|
||||
- jazz-tools@0.9.10
|
||||
|
||||
## 1.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8eb9247]
|
||||
- jazz-tools@0.9.9
|
||||
- jazz-react-native@0.9.9
|
||||
|
||||
## 1.0.46
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d1d773b]
|
||||
- jazz-tools@0.9.8
|
||||
- jazz-react-native@0.9.8
|
||||
|
||||
## 1.0.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8a390d2]
|
||||
- jazz-react-native@0.9.6
|
||||
|
||||
## 1.0.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c871912]
|
||||
- jazz-react-native@0.9.5
|
||||
|
||||
## 1.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.4
|
||||
|
||||
## 1.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7cd691f]
|
||||
- jazz-react-native@0.9.3
|
||||
|
||||
## 1.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [80fd3e9]
|
||||
- jazz-react-native@0.9.2
|
||||
|
||||
## 1.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1b71969]
|
||||
- jazz-tools@0.9.1
|
||||
- jazz-react-native@0.9.1
|
||||
|
||||
## 1.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1da4d55]
|
||||
- Updated dependencies [8eda792]
|
||||
- Updated dependencies [1e5e3a1]
|
||||
- jazz-react-native@0.9.0
|
||||
- jazz-tools@0.9.0
|
||||
|
||||
## 1.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -19,7 +19,6 @@ config.resolver.nodeModulesPaths = [
|
||||
path.resolve(workspaceRoot, "node_modules"),
|
||||
];
|
||||
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
||||
config.resolver.unstable_enablePackageExports = true;
|
||||
config.resolver.requireCycleIgnorePatterns = [
|
||||
/(^|\/|\\)node_modules($|\/|\\)/,
|
||||
/(^|\/|\\)packages($|\/|\\)/,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chat-rn",
|
||||
"version": "1.0.38",
|
||||
"version": "1.0.75",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "expo export -p ios",
|
||||
@@ -13,16 +13,17 @@
|
||||
},
|
||||
"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.2.12",
|
||||
"@react-native-community/netinfo": "^11.4.1",
|
||||
"@react-navigation/native": "^7.0.13",
|
||||
"@react-navigation/native-stack": "^7.1.14",
|
||||
"base-64": "^1.0.0",
|
||||
"clsx": "^2.0.0",
|
||||
"expo": "^52.0.0",
|
||||
"expo-build-properties": "~0.13.1",
|
||||
"expo-clipboard": "~7.0.0",
|
||||
"expo-constants": "~17.0.3",
|
||||
"expo-crypto": "~14.0.1",
|
||||
"expo-dev-client": "~5.0.5",
|
||||
"expo-linking": "~7.0.3",
|
||||
"expo-secure-store": "~14.0.0",
|
||||
@@ -33,19 +34,16 @@
|
||||
"nativewind": "^4.1.21",
|
||||
"react": "^18.3.1",
|
||||
"react-native": "~0.76.3",
|
||||
"react-native-fetch-api": "^3.0.0",
|
||||
"react-native-get-random-values": "^1.11.0",
|
||||
"react-native-polyfill-globals": "^3.1.0",
|
||||
"react-native-safe-area-context": "4.12.0",
|
||||
"react-native-screens": "4.1.0",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
"text-encoding": "^0.7.0",
|
||||
"web-streams-polyfill": "^3.2.1"
|
||||
"readable-stream": "4.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@types/react": "^18.3.12",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.6.2"
|
||||
},
|
||||
"private": true
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
import "react-native-polyfill-globals/auto";
|
||||
import "@azure/core-asynciterator-polyfill";
|
||||
import { polyfillGlobal } from "react-native/Libraries/Utilities/PolyfillFunctions";
|
||||
import { ReadableStream } from "web-streams-polyfill/ponyfill/es6";
|
||||
/* eslint-disable import/order */
|
||||
|
||||
// @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);
|
||||
|
||||
import "@azure/core-asynciterator-polyfill";
|
||||
|
||||
import "@bacons/text-decoder/install";
|
||||
|
||||
import "react-native-get-random-values";
|
||||
|
||||
@@ -9,9 +9,9 @@ import * as Linking from "expo-linking";
|
||||
import React, { StrictMode, useEffect, useState } from "react";
|
||||
import HandleInviteScreen from "./invite";
|
||||
|
||||
import { DemoAuthBasicUI, useDemoAuth } from "jazz-react-native";
|
||||
import { JazzProvider } from "jazz-react-native";
|
||||
import { apiKey } from "./apiKey";
|
||||
import ChatScreen from "./chat";
|
||||
import { Jazz } from "./jazz";
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
@@ -29,12 +29,10 @@ const linking = {
|
||||
};
|
||||
|
||||
function App() {
|
||||
const [auth, state] = useDemoAuth();
|
||||
const [initialRoute, setInitialRoute] = useState<
|
||||
"ChatScreen" | "HandleInviteScreen"
|
||||
>("ChatScreen");
|
||||
const navigationRef = useNavigationContainerRef();
|
||||
|
||||
useEffect(() => {
|
||||
Linking.getInitialURL().then((url) => {
|
||||
if (url) {
|
||||
@@ -45,16 +43,13 @@ function App() {
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (!auth) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<StrictMode>
|
||||
<Jazz.Provider
|
||||
auth={auth}
|
||||
peer="wss://cloud.jazz.tools/?key=chat-rn-example-jazz@garden.co"
|
||||
storage={undefined}
|
||||
<JazzProvider
|
||||
storage="sqlite"
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
}}
|
||||
>
|
||||
<NavigationContainer linking={linking} ref={navigationRef}>
|
||||
<Stack.Navigator initialRouteName={initialRoute}>
|
||||
@@ -70,10 +65,7 @@ function App() {
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
</NavigationContainer>
|
||||
</Jazz.Provider>
|
||||
{state.state !== "signedIn" ? (
|
||||
<DemoAuthBasicUI appName="Jazz Chat" state={state} />
|
||||
) : null}
|
||||
</JazzProvider>
|
||||
</StrictMode>
|
||||
);
|
||||
}
|
||||
|
||||
1
examples/chat-rn/src/apiKey.ts
Normal file
1
examples/chat-rn/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const apiKey = "chat-rn-example-jazz@garden.co";
|
||||
@@ -1,6 +1,6 @@
|
||||
import clsx from "clsx";
|
||||
import * as Clipboard from "expo-clipboard";
|
||||
import { Group, ID } from "jazz-tools";
|
||||
import { Group, ID, Profile } from "jazz-tools";
|
||||
import { useEffect, useState } from "react";
|
||||
import React, {
|
||||
Button,
|
||||
@@ -14,7 +14,7 @@ import React, {
|
||||
Alert,
|
||||
} from "react-native";
|
||||
|
||||
import { useAccount, useCoState } from "./jazz";
|
||||
import { useAccount, useCoState } from "jazz-react-native";
|
||||
import { Chat, Message } from "./schema";
|
||||
|
||||
export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||
@@ -22,10 +22,16 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||
const [chatId, setChatId] = useState<ID<Chat>>();
|
||||
const loadedChat = useCoState(Chat, chatId, [{}]);
|
||||
const [message, setMessage] = useState("");
|
||||
const profile = useCoState(Profile, me._refs.profile?.id, {});
|
||||
|
||||
function handleLogOut() {
|
||||
setChatId(undefined);
|
||||
logOut();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
navigation.setOptions({
|
||||
headerRight: () => <Button onPress={logOut} title="Logout" />,
|
||||
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
|
||||
headerLeft: () =>
|
||||
loadedChat ? (
|
||||
<Button
|
||||
@@ -131,6 +137,19 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||
<View className="flex flex-col h-full">
|
||||
{!loadedChat ? (
|
||||
<View className="flex flex-col h-full items-center justify-center">
|
||||
<Text className="text-m font-bold mb-6">Username</Text>
|
||||
<TextInput
|
||||
className="rounded h-12 p-2 mb-12 w-40 border border-gray-200 block"
|
||||
value={profile?.name ?? ""}
|
||||
onChangeText={(value) => {
|
||||
if (profile) {
|
||||
profile.name = value;
|
||||
}
|
||||
}}
|
||||
textAlignVertical="center"
|
||||
onSubmitEditing={sendMessage}
|
||||
testID="username-input"
|
||||
/>
|
||||
<TouchableOpacity
|
||||
onPress={createChat}
|
||||
className="bg-blue-500 p-4 rounded-md"
|
||||
@@ -172,10 +191,12 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
|
||||
placeholder="Type a message..."
|
||||
textAlignVertical="center"
|
||||
onSubmitEditing={sendMessage}
|
||||
testID="message-input"
|
||||
/>
|
||||
<TouchableOpacity
|
||||
onPress={sendMessage}
|
||||
className="bg-gray-300 text-white rounded-full h-8 w-8 items-center justify-center"
|
||||
testID="send-button"
|
||||
>
|
||||
<Text>↑</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import { useAcceptInvite } from "jazz-react-native";
|
||||
import React, { Text } from "react-native";
|
||||
import { useAcceptInvite } from "./jazz";
|
||||
import { Chat } from "./schema";
|
||||
|
||||
type ChatScreenParams = {
|
||||
valueHint?: string;
|
||||
valueID?: string;
|
||||
inviteSecret?: string;
|
||||
};
|
||||
|
||||
export default function HandleInviteScreen({
|
||||
navigation,
|
||||
}: {
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import { createJazzRNApp } from "jazz-react-native";
|
||||
|
||||
export const Jazz = createJazzRNApp();
|
||||
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
||||
16
examples/chat-rn/test/e2e/erase_text.yml
Normal file
16
examples/chat-rn/test/e2e/erase_text.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
# this sub-flow exists to work around an ios issue where the text field is not
|
||||
# fully erased. The tap into the input field hits the middle, and clears all
|
||||
# text to the left. If there's more to the right, it slides left, and thus we
|
||||
# repeat this step. https://maestro.mobile.dev/api-reference/commands/erasetext
|
||||
appId: com.jazz.chatrn
|
||||
---
|
||||
- copyTextFrom:
|
||||
id: ${id}
|
||||
- repeat:
|
||||
times: 4
|
||||
commands:
|
||||
- tapOn:
|
||||
id: ${id}
|
||||
- eraseText
|
||||
- copyTextFrom:
|
||||
id: ${id}
|
||||
48
examples/chat-rn/test/e2e/flow.yml
Normal file
48
examples/chat-rn/test/e2e/flow.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
appId: com.jazz.chatrn
|
||||
---
|
||||
- launchApp
|
||||
|
||||
# # handle Expo screens (for local dev)
|
||||
# - assertVisible: "Continue"
|
||||
# - tapOn: "Continue"
|
||||
# - assertVisible: "Reload"
|
||||
# - tapOn: "Reload"
|
||||
|
||||
# login
|
||||
- assertVisible: "Anonymous user"
|
||||
- runFlow:
|
||||
label: "Erase existing username"
|
||||
file: erase_text.yml
|
||||
env:
|
||||
id: "username-input"
|
||||
- inputText: "boorad"
|
||||
- assertVisible: "boorad"
|
||||
|
||||
# start new chat
|
||||
- tapOn: "Start new chat"
|
||||
- assertVisible: "Share"
|
||||
- assertVisible: "Jazz Chat"
|
||||
- assertVisible: "Logout"
|
||||
|
||||
# send a message
|
||||
- runFlow:
|
||||
label: "Erase existing message"
|
||||
file: erase_text.yml
|
||||
env:
|
||||
id: "message-input"
|
||||
- inputText: "bro, low key, it do be like that tho"
|
||||
- tapOn:
|
||||
id: "send-button"
|
||||
- assertVisible: "bro, low key, it do be like that tho"
|
||||
|
||||
# get invite code
|
||||
- tapOn: "Share"
|
||||
- assertVisible: "Copied to clipboard"
|
||||
- tapOn: "OK"
|
||||
# this assert doesn't work. maestro.copiedText only populates from `copyTextFrom`
|
||||
# - assertTrue: ${maestro.copiedText.startsWith("co_z")}
|
||||
|
||||
# logout
|
||||
- tapOn: "Logout"
|
||||
- assertVisible: "boorad"
|
||||
- assertVisible: "bro, low key, it do be like that tho"
|
||||
20
examples/chat-rn/test/e2e/run.sh
Executable file
20
examples/chat-rn/test/e2e/run.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/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
|
||||
|
||||
# build and install the app
|
||||
echo "Building and installing Android app."
|
||||
echo "If it fails, its output will be in artifact: android-install.log..."
|
||||
cd ./android/
|
||||
./gradlew installRelease >> ~/output/android-install.log 2>&1
|
||||
cd ..
|
||||
|
||||
# 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
|
||||
@@ -1,5 +1,282 @@
|
||||
# chat-vue
|
||||
|
||||
## 0.0.61
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [75211e3]
|
||||
- jazz-tools@0.10.14
|
||||
- jazz-browser@0.10.14
|
||||
- jazz-vue@0.10.14
|
||||
|
||||
## 0.0.60
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [07feedd]
|
||||
- jazz-tools@0.10.13
|
||||
- jazz-browser@0.10.13
|
||||
- jazz-vue@0.10.13
|
||||
|
||||
## 0.0.59
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4612e05]
|
||||
- jazz-tools@0.10.12
|
||||
- jazz-vue@0.10.12
|
||||
- jazz-browser@0.10.12
|
||||
|
||||
## 0.0.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [834203f]
|
||||
- jazz-browser@0.10.9
|
||||
- jazz-vue@0.10.9
|
||||
|
||||
## 0.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1e87fc7]
|
||||
- Updated dependencies [2fb6428]
|
||||
- jazz-browser@0.10.8
|
||||
- jazz-tools@0.10.8
|
||||
- jazz-vue@0.10.8
|
||||
|
||||
## 0.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1136d9b]
|
||||
- Updated dependencies [bf76d79]
|
||||
- Updated dependencies [0eed228]
|
||||
- jazz-browser@0.10.7
|
||||
- jazz-tools@0.10.7
|
||||
- jazz-vue@0.10.7
|
||||
|
||||
## 0.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ada802b]
|
||||
- jazz-tools@0.10.6
|
||||
- jazz-browser@0.10.6
|
||||
- jazz-vue@0.10.6
|
||||
|
||||
## 0.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59ff77e]
|
||||
- jazz-tools@0.10.5
|
||||
- jazz-browser@0.10.5
|
||||
- jazz-vue@0.10.5
|
||||
|
||||
## 0.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.10.4
|
||||
- jazz-tools@0.10.4
|
||||
- jazz-vue@0.10.4
|
||||
|
||||
## 0.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8582fc]
|
||||
- jazz-tools@0.10.3
|
||||
- jazz-browser@0.10.3
|
||||
- jazz-vue@0.10.3
|
||||
|
||||
## 0.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.10.2
|
||||
- jazz-tools@0.10.2
|
||||
- jazz-vue@0.10.2
|
||||
|
||||
## 0.0.50
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a63cba]
|
||||
- jazz-tools@0.10.1
|
||||
- jazz-browser@0.10.1
|
||||
- jazz-vue@0.10.1
|
||||
|
||||
## 0.0.49
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [498954f]
|
||||
- Updated dependencies [d42c2aa]
|
||||
- Updated dependencies [dd03464]
|
||||
- Updated dependencies [b426342]
|
||||
- jazz-browser@0.10.0
|
||||
- jazz-tools@0.10.0
|
||||
- jazz-vue@0.10.0
|
||||
|
||||
## 0.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.23
|
||||
- jazz-tools@0.9.23
|
||||
- jazz-vue@0.9.23
|
||||
|
||||
## 0.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.22
|
||||
- jazz-vue@0.9.22
|
||||
|
||||
## 0.0.46
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1be017d]
|
||||
- jazz-tools@0.9.21
|
||||
- jazz-browser@0.9.21
|
||||
- jazz-vue@0.9.21
|
||||
|
||||
## 0.0.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser@0.9.20
|
||||
- jazz-vue@0.9.20
|
||||
|
||||
## 0.0.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-vue@0.9.19
|
||||
|
||||
## 0.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-vue@0.9.18
|
||||
|
||||
## 0.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser@0.9.17
|
||||
- jazz-vue@0.9.17
|
||||
|
||||
## 0.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser@0.9.16
|
||||
- jazz-vue@0.9.16
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser@0.9.15
|
||||
- jazz-vue@0.9.15
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser@0.9.14
|
||||
- jazz-vue@0.9.14
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-vue@0.9.13
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-vue@0.9.12
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-vue@0.9.11
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5e83864]
|
||||
- jazz-tools@0.9.10
|
||||
- jazz-browser@0.9.10
|
||||
- jazz-vue@0.9.10
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8eb9247]
|
||||
- jazz-tools@0.9.9
|
||||
- jazz-browser@0.9.9
|
||||
- jazz-vue@0.9.9
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d1d773b]
|
||||
- jazz-tools@0.9.8
|
||||
- jazz-browser@0.9.8
|
||||
- jazz-vue@0.9.8
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1b71969]
|
||||
- Updated dependencies [5d98189]
|
||||
- jazz-browser@0.9.1
|
||||
- jazz-tools@0.9.1
|
||||
- jazz-vue@0.9.1
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9dd8d95]
|
||||
- Updated dependencies [8eda792]
|
||||
- jazz-vue@0.9.0
|
||||
- jazz-tools@0.9.0
|
||||
- jazz-browser@0.9.0
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,29 +1,55 @@
|
||||
# Chat example with Jazz and Vue
|
||||
|
||||
## Installing & running the example locally
|
||||
## Getting started
|
||||
|
||||
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
||||
You can either
|
||||
1. Clone the jazz repository, and run the app within the monorepo.
|
||||
2. Or create a new Jazz project using this example as a template.
|
||||
|
||||
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
|
||||
|
||||
### Using the example as a template
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npx degit gardencmp/jazz jazz
|
||||
npx create-jazz-app@latest --example chat-vue --project-name chat-vue
|
||||
```
|
||||
|
||||
Go to the todo-vue example directory:
|
||||
Go to the new project directory.
|
||||
```bash
|
||||
cd jazz/examples/chat-vue
|
||||
cd chat-vue
|
||||
```
|
||||
|
||||
Install and build dependencies:
|
||||
Run the dev server.
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Using the monorepo
|
||||
|
||||
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
|
||||
|
||||
Clone the jazz repository.
|
||||
```bash
|
||||
git clone https://github.com/garden-co/jazz.git
|
||||
```
|
||||
|
||||
Install and build dependencies.
|
||||
```bash
|
||||
pnpm i && npx turbo build
|
||||
```
|
||||
|
||||
Start the dev server:
|
||||
Go to the example directory.
|
||||
```bash
|
||||
cd jazz/examples/chat-vue/
|
||||
```
|
||||
|
||||
Start the dev server.
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
||||
|
||||
## Questions / problems / feedback
|
||||
|
||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chat-vue",
|
||||
"version": "0.0.30",
|
||||
"version": "0.0.61",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -30,9 +30,9 @@
|
||||
"eslint-plugin-vue": "^9.28.0",
|
||||
"npm-run-all2": "^6.2.3",
|
||||
"postcss": "^8.4.27",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.6.2",
|
||||
"vite": "^5.4.10",
|
||||
"vite": "^6.0.11",
|
||||
"vite-plugin-vue-devtools": "^7.4.6",
|
||||
"vue-tsc": "^2.1.6"
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useAccount } from "jazz-vue";
|
||||
import AppContainer from "./components/AppContainer.vue";
|
||||
import TopBar from "./components/TopBar.vue";
|
||||
import { useAccount } from "./main";
|
||||
|
||||
const { me, logOut } = useAccount();
|
||||
</script>
|
||||
|
||||
1
examples/chat-vue/src/apiKey.ts
Normal file
1
examples/chat-vue/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const apiKey = "chat-example-jazz@garden.co";
|
||||
@@ -1,36 +1,31 @@
|
||||
import { DemoAuthBasicUI, createJazzVueApp, useDemoAuth } from "jazz-vue";
|
||||
import { DemoAuthBasicUI, JazzProvider } from "jazz-vue";
|
||||
import { createApp, defineComponent, h } from "vue";
|
||||
import App from "./App.vue";
|
||||
import "./index.css";
|
||||
import { apiKey } from "@/apiKey";
|
||||
import router from "./router";
|
||||
|
||||
const Jazz = createJazzVueApp();
|
||||
export const { useAccount, useCoState } = Jazz;
|
||||
const { JazzProvider } = Jazz;
|
||||
|
||||
const RootComponent = defineComponent({
|
||||
name: "RootComponent",
|
||||
setup() {
|
||||
const { authMethod, state } = useDemoAuth();
|
||||
|
||||
return () => [
|
||||
return () =>
|
||||
h(
|
||||
JazzProvider,
|
||||
{
|
||||
auth: authMethod.value,
|
||||
peer: "wss://cloud.jazz.tools/?key=chat-example-jazz@garden.co",
|
||||
sync: {
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
},
|
||||
},
|
||||
{
|
||||
default: () => h(App),
|
||||
},
|
||||
),
|
||||
|
||||
state.state !== "signedIn" &&
|
||||
h(DemoAuthBasicUI, {
|
||||
appName: "Jazz Chat",
|
||||
state,
|
||||
}),
|
||||
];
|
||||
h(
|
||||
DemoAuthBasicUI,
|
||||
{
|
||||
appName: "Jazz Vue Chat",
|
||||
},
|
||||
{
|
||||
default: () => h(App),
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
|
||||
<script lang="ts">
|
||||
import type { ID } from "jazz-tools";
|
||||
import { useCoState } from "jazz-vue";
|
||||
import { type PropType, computed, defineComponent, ref } from "vue";
|
||||
import ChatBody from "../components/ChatBody.vue";
|
||||
import ChatBubble from "../components/ChatBubble.vue";
|
||||
import ChatInput from "../components/ChatInput.vue";
|
||||
import EmptyChatMessage from "../components/EmptyChatMessage.vue";
|
||||
import { useCoState } from "../main";
|
||||
import { Chat, Message } from "../schema";
|
||||
|
||||
export default defineComponent({
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Group } from "jazz-tools";
|
||||
import { useAccount } from "jazz-vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useAccount } from "../main";
|
||||
import { Chat } from "../schema";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -1,5 +1,287 @@
|
||||
# jazz-example-chat
|
||||
|
||||
## 0.0.157
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [75211e3]
|
||||
- jazz-tools@0.10.14
|
||||
- jazz-react@0.10.14
|
||||
- jazz-browser-media-images@0.10.14
|
||||
|
||||
## 0.0.156
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [07feedd]
|
||||
- jazz-tools@0.10.13
|
||||
- jazz-browser-media-images@0.10.13
|
||||
- jazz-react@0.10.13
|
||||
|
||||
## 0.0.155
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4612e05]
|
||||
- jazz-tools@0.10.12
|
||||
- jazz-react@0.10.12
|
||||
- jazz-browser-media-images@0.10.12
|
||||
|
||||
## 0.0.154
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.10.9
|
||||
- jazz-react@0.10.9
|
||||
|
||||
## 0.0.153
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [2fb6428]
|
||||
- jazz-tools@0.10.8
|
||||
- jazz-react@0.10.8
|
||||
- jazz-browser-media-images@0.10.8
|
||||
|
||||
## 0.0.152
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1136d9b]
|
||||
- Updated dependencies [0eed228]
|
||||
- jazz-react@0.10.7
|
||||
- jazz-tools@0.10.7
|
||||
- jazz-browser-media-images@0.10.7
|
||||
|
||||
## 0.0.151
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1d71ca1]
|
||||
- Updated dependencies [ada802b]
|
||||
- hash-slash@0.2.2
|
||||
- jazz-react@0.10.6
|
||||
- jazz-tools@0.10.6
|
||||
- jazz-browser-media-images@0.10.6
|
||||
|
||||
## 0.0.150
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59ff77e]
|
||||
- jazz-tools@0.10.5
|
||||
- jazz-browser-media-images@0.10.5
|
||||
- jazz-react@0.10.5
|
||||
|
||||
## 0.0.149
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.4
|
||||
- jazz-tools@0.10.4
|
||||
- jazz-browser-media-images@0.10.4
|
||||
|
||||
## 0.0.148
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8582fc]
|
||||
- jazz-tools@0.10.3
|
||||
- jazz-browser-media-images@0.10.3
|
||||
- jazz-react@0.10.3
|
||||
|
||||
## 0.0.147
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.2
|
||||
- jazz-tools@0.10.2
|
||||
- jazz-browser-media-images@0.10.2
|
||||
|
||||
## 0.0.146
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a63cba]
|
||||
- jazz-tools@0.10.1
|
||||
- jazz-browser-media-images@0.10.1
|
||||
- jazz-react@0.10.1
|
||||
|
||||
## 0.0.145
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [498954f]
|
||||
- Updated dependencies [d42c2aa]
|
||||
- Updated dependencies [dd03464]
|
||||
- Updated dependencies [b426342]
|
||||
- jazz-react@0.10.0
|
||||
- jazz-tools@0.10.0
|
||||
- jazz-browser-media-images@0.10.0
|
||||
|
||||
## 0.0.144
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.23
|
||||
- jazz-tools@0.9.23
|
||||
- jazz-browser-media-images@0.9.23
|
||||
|
||||
## 0.0.143
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.9.22
|
||||
- jazz-react@0.9.22
|
||||
|
||||
## 0.0.142
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1be017d]
|
||||
- jazz-tools@0.9.21
|
||||
- jazz-browser-media-images@0.9.21
|
||||
- jazz-react@0.9.21
|
||||
|
||||
## 0.0.141
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.140
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.139
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.138
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.137
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.136
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.135
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.134
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.133
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.132
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.131
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- f76274c: Fix image handling in react-native
|
||||
- Updated dependencies [5e83864]
|
||||
- jazz-react@0.9.10
|
||||
- jazz-tools@0.9.10
|
||||
- jazz-browser-media-images@0.9.10
|
||||
|
||||
## 0.0.130
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8eb9247]
|
||||
- jazz-tools@0.9.9
|
||||
- jazz-browser-media-images@0.9.9
|
||||
- jazz-react@0.9.9
|
||||
|
||||
## 0.0.129
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d1d773b]
|
||||
- jazz-tools@0.9.8
|
||||
- jazz-react@0.9.8
|
||||
- jazz-browser-media-images@0.9.8
|
||||
|
||||
## 0.0.128
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.4
|
||||
|
||||
## 0.0.127
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1b71969]
|
||||
- jazz-react@0.9.1
|
||||
- jazz-tools@0.9.1
|
||||
- jazz-browser-media-images@0.9.1
|
||||
|
||||
## 0.0.126
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [956a4d1]
|
||||
- Updated dependencies [8eda792]
|
||||
- jazz-react@0.9.0
|
||||
- jazz-tools@0.9.0
|
||||
- jazz-browser-media-images@0.9.0
|
||||
|
||||
## 0.0.125
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -2,30 +2,56 @@
|
||||
|
||||
Live version: [https://chat.jazz.tools](https://chat.jazz.tools)
|
||||
|
||||
## Installing & running the example locally
|
||||
## Getting started
|
||||
|
||||
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
||||
You can either
|
||||
1. Clone the jazz repository, and run the app within the monorepo.
|
||||
2. Or create a new Jazz project using this example as a template.
|
||||
|
||||
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
|
||||
|
||||
### Using the example as a template
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npx degit gardencmp/jazz jazz
|
||||
npx create-jazz-app@latest --example chat --project-name chat
|
||||
```
|
||||
|
||||
Go to the chat example directory:
|
||||
Go to the new project directory.
|
||||
```bash
|
||||
cd jazz/examples/chat
|
||||
cd chat
|
||||
```
|
||||
|
||||
Install and build dependencies:
|
||||
Run the dev server.
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Using the monorepo
|
||||
|
||||
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
|
||||
|
||||
Clone the jazz repository.
|
||||
```bash
|
||||
git clone https://github.com/garden-co/jazz.git
|
||||
```
|
||||
|
||||
Install and build dependencies.
|
||||
```bash
|
||||
pnpm i && npx turbo build
|
||||
```
|
||||
|
||||
Start the dev server:
|
||||
Go to the example directory.
|
||||
```bash
|
||||
cd jazz/examples/chat/
|
||||
```
|
||||
|
||||
Start the dev server.
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
||||
|
||||
## Questions / problems / feedback
|
||||
|
||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||
@@ -34,4 +60,4 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
|
||||
|
||||
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
|
||||
|
||||
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<Jazz.Provider>` provider component in [./src/main.tsx](./src/main.tsx).
|
||||
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<JazzProvider>` provider component in [./src/main.tsx](./src/main.tsx).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-chat",
|
||||
"private": true,
|
||||
"version": "0.0.125",
|
||||
"version": "0.0.157",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -9,8 +9,8 @@
|
||||
"format-and-lint": "biome check .",
|
||||
"format-and-lint:fix": "biome check . --write",
|
||||
"preview": "vite preview",
|
||||
"test": "playwright test",
|
||||
"test:ui": "playwright test --ui"
|
||||
"test:e2e": "playwright test",
|
||||
"test:e2e:ui": "playwright test --ui"
|
||||
},
|
||||
"dependencies": {
|
||||
"clsx": "^2.0.0",
|
||||
@@ -23,15 +23,15 @@
|
||||
"react-dom": "^18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.46.1",
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"@vitejs/plugin-react-swc": "^3.3.2",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"is-ci": "^3.0.1",
|
||||
"postcss": "^8.4.27",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.6.2",
|
||||
"vite": "^5.4.10"
|
||||
"vite": "^6.0.11"
|
||||
}
|
||||
}
|
||||
|
||||
1
examples/chat/src/apiKey.ts
Normal file
1
examples/chat/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const apiKey = "chat-example-jazz@garden.co";
|
||||
@@ -1,9 +1,13 @@
|
||||
import { inIframe, onChatLoad } from "@/util.ts";
|
||||
import { apiKey } from "@/apiKey.ts";
|
||||
import { getRandomUsername, inIframe, onChatLoad } from "@/util.ts";
|
||||
import { useIframeHashRouter } from "hash-slash";
|
||||
import { JazzProvider, useAccount } from "jazz-react";
|
||||
import { Group, ID } from "jazz-tools";
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { ChatScreen } from "./chatScreen.tsx";
|
||||
import { useAccount } from "./main.tsx";
|
||||
import { Chat } from "./schema.ts";
|
||||
import { ThemeProvider } from "./themeProvider.tsx";
|
||||
import { AppContainer, TopBar } from "./ui.tsx";
|
||||
|
||||
export function App() {
|
||||
@@ -12,9 +16,9 @@ export function App() {
|
||||
|
||||
const createChat = () => {
|
||||
if (!me) return;
|
||||
const group = Group.create({ owner: me });
|
||||
const group = Group.create();
|
||||
group.addMember("everyone", "writer");
|
||||
const chat = Chat.create([], { owner: group });
|
||||
const chat = Chat.create([], group);
|
||||
router.navigate("/#/chat/" + chat.id);
|
||||
|
||||
// for https://jazz.tools marketing site demo only
|
||||
@@ -24,7 +28,16 @@ export function App() {
|
||||
return (
|
||||
<AppContainer>
|
||||
<TopBar>
|
||||
<p>{me?.profile?.name}</p>
|
||||
<input
|
||||
type="text"
|
||||
value={me?.profile?.name ?? ""}
|
||||
className="bg-transparent"
|
||||
onChange={(e) => {
|
||||
if (!me?.profile) return;
|
||||
me.profile.name = e.target.value;
|
||||
}}
|
||||
placeholder="Set username"
|
||||
/>
|
||||
{!inIframe && <button onClick={logOut}>Log out</button>}
|
||||
</TopBar>
|
||||
{router.route({
|
||||
@@ -34,3 +47,21 @@ export function App() {
|
||||
</AppContainer>
|
||||
);
|
||||
}
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
const defaultProfileName = url.searchParams.get("user") ?? getRandomUsername();
|
||||
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<ThemeProvider>
|
||||
<StrictMode>
|
||||
<JazzProvider
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
}}
|
||||
defaultProfileName={defaultProfileName}
|
||||
>
|
||||
<App />
|
||||
</JazzProvider>
|
||||
</StrictMode>
|
||||
</ThemeProvider>,
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createImage } from "jazz-browser-media-images";
|
||||
import { useCoState } from "jazz-react";
|
||||
import { ID } from "jazz-tools";
|
||||
import { useState } from "react";
|
||||
import { useAccount, useCoState } from "./main.tsx";
|
||||
import { Chat, Message } from "./schema.ts";
|
||||
import {
|
||||
BubbleBody,
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
|
||||
export function ChatScreen(props: { chatID: ID<Chat> }) {
|
||||
const chat = useCoState(Chat, props.chatID, [{}]);
|
||||
const { me } = useAccount();
|
||||
const [showNLastMessages, setShowNLastMessages] = useState(30);
|
||||
|
||||
if (!chat)
|
||||
@@ -27,8 +26,6 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
|
||||
);
|
||||
|
||||
const sendImage = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (!me?.profile) return;
|
||||
|
||||
const file = event.currentTarget.files?.[0];
|
||||
|
||||
if (!file) return;
|
||||
@@ -39,12 +36,7 @@ export function ChatScreen(props: { chatID: ID<Chat> }) {
|
||||
}
|
||||
|
||||
createImage(file, { owner: chat._owner }).then((image) => {
|
||||
chat.push(
|
||||
Message.create(
|
||||
{ text: file.name, image: image },
|
||||
{ owner: chat._owner },
|
||||
),
|
||||
);
|
||||
chat.push(Message.create({ text: file.name, image: image }, chat._owner));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
import { ThemeProvider } from "@/themeProvider.tsx";
|
||||
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { App } from "./app.tsx";
|
||||
|
||||
const Jazz = createJazzReactApp();
|
||||
export const { useAccount, useCoState } = Jazz;
|
||||
|
||||
function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
||||
const [auth, state] = useDemoAuth();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Jazz.Provider
|
||||
auth={auth}
|
||||
peer="wss://cloud.jazz.tools/?key=chat-example-jazz@garden.co"
|
||||
>
|
||||
{children}
|
||||
</Jazz.Provider>
|
||||
{state.state !== "signedIn" && (
|
||||
<DemoAuthBasicUI appName="Jazz Chat" state={state} />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<ThemeProvider>
|
||||
<StrictMode>
|
||||
<JazzAndAuth>
|
||||
<App />
|
||||
</JazzAndAuth>
|
||||
</StrictMode>
|
||||
</ThemeProvider>,
|
||||
);
|
||||
@@ -6,7 +6,7 @@ import { useId, useRef } from "react";
|
||||
|
||||
export function AppContainer(props: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="flex flex-col justify-between w-screen h-screen bg-stone-50 dark:bg-black dark:text-white">
|
||||
<div className="flex flex-col justify-between w-screen h-screen bg-stone-50 dark:bg-stone-925 dark:text-white">
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
@@ -14,7 +14,7 @@ export function AppContainer(props: { children: React.ReactNode }) {
|
||||
|
||||
export function TopBar(props: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="p-3 bg-white w-full flex justify-between gap-2 border-b dark:bg-transparent dark:border-stone-800">
|
||||
<div className="p-3 bg-white w-full flex justify-between gap-2 border-b dark:bg-transparent dark:border-stone-900">
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
@@ -33,7 +33,7 @@ export function ChatBody(props: { children: React.ReactNode }) {
|
||||
|
||||
export function EmptyChatMessage() {
|
||||
return (
|
||||
<div className="h-full text-base text-stone-500 flex items-center justify-center px-3 text-lg md:text-2xl">
|
||||
<div className="h-full text-base text-stone-500 flex items-center justify-center px-3 md:text-2xl">
|
||||
Start a conversation below.
|
||||
</div>
|
||||
);
|
||||
@@ -61,7 +61,7 @@ export function BubbleBody(props: {
|
||||
"line-clamp-10 text-ellipsis whitespace-pre-wrap",
|
||||
"rounded-2xl overflow-hidden max-w-[calc(100%-5rem)] shadow-sm p-1",
|
||||
props.fromMe
|
||||
? "bg-white dark:bg-stone-700 dark:text-white"
|
||||
? "bg-white dark:bg-stone-900 dark:text-white"
|
||||
: "bg-blue text-white",
|
||||
)}
|
||||
>
|
||||
@@ -97,7 +97,7 @@ export function BubbleInfo(props: { by: string | undefined; madeAt: Date }) {
|
||||
|
||||
export function InputBar(props: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="p-3 bg-white border-t shadow-2xl mt-auto flex gap-1 dark:bg-transparent dark:border-stone-800">
|
||||
<div className="p-3 bg-white border-t shadow-2xl mt-auto flex gap-1 dark:bg-transparent dark:border-stone-900">
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
@@ -147,7 +147,7 @@ export function TextInput(props: { onSubmit: (text: string) => void }) {
|
||||
</label>
|
||||
<input
|
||||
id={inputId}
|
||||
className="rounded-full py-1 px-3 border block w-full placeholder:text-stone-500 dark:bg-black dark:text-white dark:border-stone-700"
|
||||
className="rounded-full py-1 px-3 border block w-full placeholder:text-stone-500 dark:bg-stone-925 dark:text-white dark:border-stone-900"
|
||||
placeholder="Type a message and press Enter"
|
||||
maxLength={2048}
|
||||
onKeyDown={({ key, currentTarget: input }) => {
|
||||
|
||||
@@ -15,3 +15,20 @@ export function onChatLoad(chat: Chat) {
|
||||
}
|
||||
|
||||
export const inIframe = window.self !== window.top;
|
||||
|
||||
const animals = [
|
||||
"elephant",
|
||||
"penguin",
|
||||
"giraffe",
|
||||
"octopus",
|
||||
"kangaroo",
|
||||
"dolphin",
|
||||
"cheetah",
|
||||
"koala",
|
||||
"platypus",
|
||||
"pangolin",
|
||||
];
|
||||
|
||||
export function getRandomUsername() {
|
||||
return `Anonymous ${animals[Math.floor(Math.random() * animals.length)]}`;
|
||||
}
|
||||
|
||||
@@ -1,48 +1,35 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { ChatPage } from "./pages/ChatPage";
|
||||
import { LoginPage } from "./pages/LoginPage";
|
||||
|
||||
test("chat between two users", async ({ page }) => {
|
||||
const loginPage = new LoginPage(page);
|
||||
test("chat between two users", async ({ page: marioPage, browser }) => {
|
||||
const context = await browser.newContext();
|
||||
const luigiPage = await context.newPage();
|
||||
|
||||
const mario = "S. Mario";
|
||||
const luigi = "Luigi";
|
||||
await marioPage.goto("/");
|
||||
|
||||
await loginPage.goto();
|
||||
await loginPage.fillUsername(mario);
|
||||
await loginPage.signup();
|
||||
const marioChat = new ChatPage(marioPage);
|
||||
const luigiChat = new ChatPage(luigiPage);
|
||||
|
||||
const chatPage = new ChatPage(page);
|
||||
await marioChat.setUsername("Mario");
|
||||
|
||||
const message1ByMario = "Hello Luigi, are you ready to save the princess?";
|
||||
|
||||
await chatPage.sendMessage(message1ByMario);
|
||||
await chatPage.expectMessageRow(message1ByMario);
|
||||
await marioChat.sendMessage(message1ByMario);
|
||||
await marioChat.expectMessageRow(message1ByMario);
|
||||
|
||||
const roomURL = page.url();
|
||||
const roomURL = marioPage.url();
|
||||
await luigiPage.goto(roomURL);
|
||||
|
||||
await chatPage.logout();
|
||||
await luigiChat.setUsername("Luigi");
|
||||
|
||||
await loginPage.expectLoaded();
|
||||
|
||||
await loginPage.fillUsername(luigi);
|
||||
await loginPage.signup();
|
||||
|
||||
await page.goto(roomURL);
|
||||
|
||||
await chatPage.expectMessageRow(message1ByMario);
|
||||
await luigiChat.expectMessageRow(message1ByMario);
|
||||
|
||||
const message2ByLuigi =
|
||||
"No, I'm not ready yet. I'm still trying to find the key to the castle.";
|
||||
|
||||
await chatPage.sendMessage(message2ByLuigi);
|
||||
await chatPage.expectMessageRow(message2ByLuigi);
|
||||
await luigiChat.sendMessage(message2ByLuigi);
|
||||
await luigiChat.expectMessageRow(message2ByLuigi);
|
||||
|
||||
await chatPage.logout();
|
||||
await loginPage.loginAs(mario);
|
||||
|
||||
await page.goto(roomURL);
|
||||
|
||||
await chatPage.expectMessageRow(message1ByMario);
|
||||
await chatPage.expectMessageRow(message2ByLuigi);
|
||||
await marioChat.expectMessageRow(message1ByMario);
|
||||
await luigiChat.expectMessageRow(message2ByLuigi);
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@ export class ChatPage {
|
||||
readonly page: Page;
|
||||
readonly messageInput: Locator;
|
||||
readonly logoutButton: Locator;
|
||||
|
||||
readonly usernameInput: Locator;
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
this.messageInput = page.getByRole("textbox", {
|
||||
@@ -13,6 +13,11 @@ export class ChatPage {
|
||||
this.logoutButton = page.getByRole("button", {
|
||||
name: "Log out",
|
||||
});
|
||||
this.usernameInput = page.getByPlaceholder("Set username");
|
||||
}
|
||||
|
||||
async setUsername(username: string) {
|
||||
await this.usernameInput.fill(username);
|
||||
}
|
||||
|
||||
async sendMessage(message: string) {
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import { Locator, Page, expect } from "@playwright/test";
|
||||
|
||||
export class LoginPage {
|
||||
readonly page: Page;
|
||||
readonly usernameInput: Locator;
|
||||
readonly signupButton: Locator;
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
this.usernameInput = page.getByRole("textbox");
|
||||
this.signupButton = page.getByRole("button", {
|
||||
name: "Sign up",
|
||||
});
|
||||
}
|
||||
|
||||
async goto() {
|
||||
this.page.goto("/");
|
||||
}
|
||||
|
||||
async fillUsername(value: string) {
|
||||
await this.usernameInput.clear();
|
||||
await this.usernameInput.fill(value);
|
||||
}
|
||||
|
||||
async loginAs(value: string) {
|
||||
await this.page
|
||||
.getByRole("button", {
|
||||
name: value,
|
||||
})
|
||||
.click();
|
||||
}
|
||||
|
||||
async signup() {
|
||||
await this.signupButton.click();
|
||||
}
|
||||
|
||||
async expectLoaded() {
|
||||
await expect(this.signupButton).toBeVisible();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,286 @@
|
||||
# minimal-auth-clerk
|
||||
|
||||
## 0.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [75211e3]
|
||||
- jazz-tools@0.10.14
|
||||
- jazz-react@0.10.14
|
||||
- jazz-react-auth-clerk@0.10.14
|
||||
|
||||
## 0.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [07feedd]
|
||||
- jazz-tools@0.10.13
|
||||
- jazz-react@0.10.13
|
||||
- jazz-react-auth-clerk@0.10.13
|
||||
|
||||
## 0.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4612e05]
|
||||
- jazz-tools@0.10.12
|
||||
- jazz-react@0.10.12
|
||||
- jazz-react-auth-clerk@0.10.12
|
||||
|
||||
## 0.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.9
|
||||
- jazz-react-auth-clerk@0.10.9
|
||||
|
||||
## 0.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [2fb6428]
|
||||
- jazz-tools@0.10.8
|
||||
- jazz-react@0.10.8
|
||||
- jazz-react-auth-clerk@0.10.8
|
||||
|
||||
## 0.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1136d9b]
|
||||
- Updated dependencies [0eed228]
|
||||
- jazz-react-auth-clerk@0.10.7
|
||||
- jazz-react@0.10.7
|
||||
- jazz-tools@0.10.7
|
||||
|
||||
## 0.0.50
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1d71ca1]
|
||||
- Updated dependencies [ada802b]
|
||||
- jazz-react-auth-clerk@0.10.6
|
||||
- jazz-react@0.10.6
|
||||
- jazz-tools@0.10.6
|
||||
|
||||
## 0.0.49
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59ff77e]
|
||||
- jazz-tools@0.10.5
|
||||
- jazz-react@0.10.5
|
||||
- jazz-react-auth-clerk@0.10.5
|
||||
|
||||
## 0.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.4
|
||||
- jazz-react-auth-clerk@0.10.4
|
||||
- jazz-tools@0.10.4
|
||||
|
||||
## 0.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8582fc]
|
||||
- jazz-tools@0.10.3
|
||||
- jazz-react@0.10.3
|
||||
- jazz-react-auth-clerk@0.10.3
|
||||
|
||||
## 0.0.46
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.2
|
||||
- jazz-react-auth-clerk@0.10.2
|
||||
- jazz-tools@0.10.2
|
||||
|
||||
## 0.0.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a63cba]
|
||||
- jazz-tools@0.10.1
|
||||
- jazz-react@0.10.1
|
||||
- jazz-react-auth-clerk@0.10.1
|
||||
|
||||
## 0.0.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [498954f]
|
||||
- Updated dependencies [d42c2aa]
|
||||
- Updated dependencies [dd03464]
|
||||
- Updated dependencies [b426342]
|
||||
- jazz-react-auth-clerk@0.10.0
|
||||
- jazz-react@0.10.0
|
||||
- jazz-tools@0.10.0
|
||||
|
||||
## 0.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.23
|
||||
- jazz-react-auth-clerk@0.9.23
|
||||
- jazz-tools@0.9.23
|
||||
|
||||
## 0.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.22
|
||||
- jazz-react-auth-clerk@0.9.22
|
||||
|
||||
## 0.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1be017d]
|
||||
- jazz-tools@0.9.21
|
||||
- jazz-react@0.9.21
|
||||
- jazz-react-auth-clerk@0.9.21
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
- jazz-react-auth-clerk@0.9.20
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-react-auth-clerk@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-react-auth-clerk@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
- jazz-react-auth-clerk@0.9.17
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-react-auth-clerk@0.9.16
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
- jazz-react-auth-clerk@0.9.15
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
- jazz-react-auth-clerk@0.9.14
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-react-auth-clerk@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-react-auth-clerk@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-react-auth-clerk@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5e83864]
|
||||
- jazz-react@0.9.10
|
||||
- jazz-tools@0.9.10
|
||||
- jazz-react-auth-clerk@0.9.10
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8eb9247]
|
||||
- jazz-tools@0.9.9
|
||||
- jazz-react@0.9.9
|
||||
- jazz-react-auth-clerk@0.9.9
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d1d773b]
|
||||
- jazz-tools@0.9.8
|
||||
- jazz-react@0.9.8
|
||||
- jazz-react-auth-clerk@0.9.8
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.4
|
||||
- jazz-react-auth-clerk@0.9.4
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1b71969]
|
||||
- jazz-react@0.9.1
|
||||
- jazz-tools@0.9.1
|
||||
- jazz-react-auth-clerk@0.9.1
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [956a4d1]
|
||||
- Updated dependencies [8eda792]
|
||||
- jazz-react@0.9.0
|
||||
- jazz-tools@0.9.0
|
||||
- jazz-react-auth-clerk@0.9.0
|
||||
|
||||
## 0.0.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -4,30 +4,56 @@ This is an example of how to use clerk authentication with Jazz.
|
||||
|
||||
Live version: https://clerk-demo.jazz.tools
|
||||
|
||||
## Installing & running the example locally
|
||||
## Getting started
|
||||
|
||||
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
||||
You can either
|
||||
1. Clone the jazz repository, and run the app within the monorepo.
|
||||
2. Or create a new Jazz project using this example as a template.
|
||||
|
||||
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
|
||||
|
||||
### Using the example as a template
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npx degit gardencmp/jazz jazz
|
||||
npx create-jazz-app@latest --example clerk --project-name clerk
|
||||
```
|
||||
|
||||
Go to the clerk example directory:
|
||||
Go to the new project directory.
|
||||
```bash
|
||||
cd jazz/examples/clerk
|
||||
cd clerk
|
||||
```
|
||||
|
||||
Install and build dependencies:
|
||||
Run the dev server.
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Using the monorepo
|
||||
|
||||
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
|
||||
|
||||
Clone the jazz repository.
|
||||
```bash
|
||||
git clone https://github.com/garden-co/jazz.git
|
||||
```
|
||||
|
||||
Install and build dependencies.
|
||||
```bash
|
||||
pnpm i && npx turbo build
|
||||
```
|
||||
|
||||
Start the dev server:
|
||||
Go to the example directory.
|
||||
```bash
|
||||
cd jazz/examples/clerk/
|
||||
```
|
||||
|
||||
Start the dev server.
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
||||
|
||||
## Questions / problems / feedback
|
||||
|
||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "clerk",
|
||||
"private": true,
|
||||
"version": "0.0.24",
|
||||
"version": "0.0.56",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -13,7 +13,7 @@
|
||||
"dependencies": {
|
||||
"@clerk/clerk-react": "^5.4.1",
|
||||
"jazz-react": "workspace:*",
|
||||
"jazz-react-auth-clerk": "workspace:0.8.51",
|
||||
"jazz-react-auth-clerk": "workspace:0.10.14",
|
||||
"jazz-tools": "workspace:*",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
@@ -25,6 +25,6 @@
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"globals": "^15.11.0",
|
||||
"typescript": "~5.6.2",
|
||||
"vite": "^5.4.10"
|
||||
"vite": "^6.0.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
import { useAccount } from "./main";
|
||||
import { SignInButton } from "@clerk/clerk-react";
|
||||
import { useAccount, useIsAuthenticated } from "jazz-react";
|
||||
|
||||
function App() {
|
||||
const { me, logOut } = useAccount();
|
||||
|
||||
const isAuthenticated = useIsAuthenticated();
|
||||
|
||||
if (isAuthenticated) {
|
||||
return (
|
||||
<div className="container">
|
||||
<h1>You're logged in</h1>
|
||||
<p>Welcome back, {me?.profile?.name}</p>
|
||||
<button onClick={() => logOut()}>Logout</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="container">
|
||||
<h1>You're logged in</h1>
|
||||
<p>Welcome back, {me?.profile?.name}</p>
|
||||
<button onClick={() => logOut()}>Logout</button>
|
||||
<h1>You're not logged in</h1>
|
||||
<SignInButton />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
1
examples/clerk/src/apiKey.ts
Normal file
1
examples/clerk/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const apiKey = "minimal-auth-clerk-example@garden.co";
|
||||
@@ -62,7 +62,7 @@ button {
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 200px;
|
||||
max-width: 400px;
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem;
|
||||
display: flex;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ClerkProvider, SignInButton, useClerk } from "@clerk/clerk-react";
|
||||
import { createJazzReactApp } from "jazz-react";
|
||||
import { useJazzClerkAuth } from "jazz-react-auth-clerk";
|
||||
import { ClerkProvider, useClerk } from "@clerk/clerk-react";
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./App.tsx";
|
||||
import "./index.css";
|
||||
import { JazzProviderWithClerk } from "jazz-react-auth-clerk";
|
||||
import { apiKey } from "./apiKey";
|
||||
|
||||
// Import your publishable key
|
||||
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
|
||||
@@ -13,38 +13,28 @@ if (!PUBLISHABLE_KEY) {
|
||||
throw new Error("Add your Clerk publishable key to the .env.local file");
|
||||
}
|
||||
|
||||
const Jazz = createJazzReactApp();
|
||||
export const { useAccount, useCoState } = Jazz;
|
||||
|
||||
function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
||||
function JazzProvider({ children }: { children: React.ReactNode }) {
|
||||
const clerk = useClerk();
|
||||
const [auth, state] = useJazzClerkAuth(clerk);
|
||||
|
||||
return (
|
||||
<main className="container">
|
||||
{state?.errors?.map((error) => (
|
||||
<div key={error}>{error}</div>
|
||||
))}
|
||||
{clerk.user && auth ? (
|
||||
<Jazz.Provider
|
||||
auth={auth}
|
||||
peer="wss://cloud.jazz.tools/?key=minimal-auth-clerk-example@garden.co"
|
||||
>
|
||||
{children}
|
||||
</Jazz.Provider>
|
||||
) : (
|
||||
<SignInButton />
|
||||
)}
|
||||
</main>
|
||||
<JazzProviderWithClerk
|
||||
clerk={clerk}
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
when: "signedUp", // This makes the app work in local mode when the user is not authenticated
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</JazzProviderWithClerk>
|
||||
);
|
||||
}
|
||||
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<StrictMode>
|
||||
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
|
||||
<JazzAndAuth>
|
||||
<JazzProvider>
|
||||
<App />
|
||||
</JazzAndAuth>
|
||||
</JazzProvider>
|
||||
</ClerkProvider>
|
||||
</StrictMode>,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,247 @@
|
||||
# file-share-svelte
|
||||
|
||||
## 0.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [75211e3]
|
||||
- jazz-tools@0.10.14
|
||||
- jazz-svelte@0.10.14
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [07feedd]
|
||||
- jazz-tools@0.10.13
|
||||
- jazz-svelte@0.10.13
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4612e05]
|
||||
- jazz-svelte@0.10.12
|
||||
- jazz-tools@0.10.12
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.10.9
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [2fb6428]
|
||||
- jazz-tools@0.10.8
|
||||
- jazz-svelte@0.10.8
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1136d9b]
|
||||
- Updated dependencies [0eed228]
|
||||
- jazz-svelte@0.10.7
|
||||
- jazz-tools@0.10.7
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [ada802b]
|
||||
- jazz-tools@0.10.6
|
||||
- jazz-svelte@0.10.6
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59ff77e]
|
||||
- jazz-tools@0.10.5
|
||||
- jazz-svelte@0.10.5
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.10.4
|
||||
- jazz-tools@0.10.4
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8582fc]
|
||||
- jazz-tools@0.10.3
|
||||
- jazz-svelte@0.10.3
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.10.2
|
||||
- jazz-tools@0.10.2
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a63cba]
|
||||
- jazz-tools@0.10.1
|
||||
- jazz-svelte@0.10.1
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [498954f]
|
||||
- Updated dependencies [d42c2aa]
|
||||
- Updated dependencies [dd03464]
|
||||
- Updated dependencies [b426342]
|
||||
- jazz-tools@0.10.0
|
||||
- jazz-svelte@0.10.0
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.23
|
||||
- jazz-tools@0.9.23
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.22
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1be017d]
|
||||
- jazz-tools@0.9.21
|
||||
- jazz-svelte@0.9.21
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-svelte@0.9.20
|
||||
|
||||
## 0.0.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-svelte@0.9.17
|
||||
|
||||
## 0.0.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-svelte@0.9.16
|
||||
|
||||
## 0.0.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-svelte@0.9.15
|
||||
|
||||
## 0.0.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-svelte@0.9.14
|
||||
|
||||
## 0.0.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5e83864]
|
||||
- jazz-tools@0.9.10
|
||||
- jazz-svelte@0.9.10
|
||||
|
||||
## 0.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8eb9247]
|
||||
- jazz-tools@0.9.9
|
||||
- jazz-svelte@0.9.9
|
||||
|
||||
## 0.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d1d773b]
|
||||
- jazz-tools@0.9.8
|
||||
- jazz-svelte@0.9.8
|
||||
|
||||
## 0.0.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1b71969]
|
||||
- jazz-tools@0.9.1
|
||||
- jazz-svelte@0.9.1
|
||||
|
||||
## 0.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [9dd8d95]
|
||||
- Updated dependencies [8eda792]
|
||||
- jazz-svelte@0.9.0
|
||||
- jazz-tools@0.9.0
|
||||
|
||||
## 0.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "file-share-svelte",
|
||||
"version": "0.0.10",
|
||||
"version": "0.0.41",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -13,13 +13,13 @@
|
||||
"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": "playwright test",
|
||||
"test:ui": "playwright test --ui"
|
||||
"test:e2e": "playwright test",
|
||||
"test:e2e:ui": "playwright test --ui"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-vercel": "^5.5.0",
|
||||
"@sveltejs/kit": "^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^4.0.1",
|
||||
"@sveltejs/kit": "^2.16.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
"@types/is-ci": "^3.0.4",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"eslint": "^9.7.0",
|
||||
@@ -32,10 +32,10 @@
|
||||
"prettier-plugin-tailwindcss": "^0.6.5",
|
||||
"svelte": "^5.0.0",
|
||||
"svelte-check": "^4.0.0",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.6.2",
|
||||
"typescript-eslint": "^8.0.0",
|
||||
"vite": "^5.4.10"
|
||||
"vite": "^6.0.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
|
||||
1
examples/file-share-svelte/src/apiKey.ts
Normal file
1
examples/file-share-svelte/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const apiKey = "file-share-svelte@garden.co"
|
||||
@@ -3,7 +3,7 @@
|
||||
import { SharedFile } from '$lib/schema';
|
||||
import { FileStream } from 'jazz-tools';
|
||||
import { File, FileDown, Trash2, Link2 } from 'lucide-svelte';
|
||||
import { useAccount } from '$lib/jazz';
|
||||
import { useAccount } from 'jazz-svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { formatFileSize } from '$lib/utils';
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { createJazzApp } from 'jazz-svelte';
|
||||
import { FileShareAccount } from './schema';
|
||||
|
||||
export const { useAccount, useCoState, useAcceptInvite, useAccountOrGuest, Provider } =
|
||||
createJazzApp({
|
||||
AccountSchema: FileShareAccount
|
||||
});
|
||||
@@ -17,6 +17,6 @@ export function formatFileSize(bytes: number): string {
|
||||
* @param createdAt The creation date
|
||||
* @returns A unique file ID string
|
||||
*/
|
||||
export function generateTempFileId(fileName: string, createdAt: Date): string {
|
||||
return `file-${fileName}-${createdAt.getTime()}`;
|
||||
export function generateTempFileId(fileName: string | undefined, createdAt: Date | undefined): string {
|
||||
return `file-${fileName ?? 'unknown'}-${createdAt?.getTime() ?? 0}`;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
<script lang="ts" module>
|
||||
declare module 'jazz-svelte' {
|
||||
interface Register {
|
||||
Account: FileShareAccount;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { Provider } from '$lib/jazz';
|
||||
import { JazzProvider } from 'jazz-svelte';
|
||||
import { PasskeyAuthBasicUI, usePasskeyAuth } from 'jazz-svelte';
|
||||
import { Toaster } from 'svelte-sonner';
|
||||
import '../app.css';
|
||||
import { FileShareAccount } from '$lib/schema';
|
||||
import {apiKey} from '../apiKey';
|
||||
|
||||
let { children } = $props();
|
||||
const auth = usePasskeyAuth({
|
||||
appName: 'File Share'
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -16,17 +23,16 @@
|
||||
|
||||
<Toaster richColors />
|
||||
|
||||
{#if auth.state.state === 'ready'}
|
||||
<div class="fixed inset-0 flex items-center justify-center bg-gray-50/80">
|
||||
<div class="rounded-lg bg-white p-8 shadow-lg">
|
||||
<PasskeyAuthBasicUI state={auth.state} />
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if auth.current}
|
||||
<Provider auth={auth.current} peer="wss://cloud.jazz.tools/?key=file-share-svelte@garden.co">
|
||||
<JazzProvider
|
||||
AccountSchema={FileShareAccount}
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
when: "signedUp",
|
||||
}}
|
||||
>
|
||||
<PasskeyAuthBasicUI appName="File Share">
|
||||
<div class="min-h-screen bg-gray-100">
|
||||
{@render children()}
|
||||
</div>
|
||||
</Provider>
|
||||
{/if}
|
||||
</PasskeyAuthBasicUI>
|
||||
</JazzProvider>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { useAccount, useCoState } from '$lib/jazz';
|
||||
import { useAccount, useCoState } from 'jazz-svelte';
|
||||
import { SharedFile, ListOfSharedFiles } from '$lib/schema';
|
||||
import { createInviteLink } from 'jazz-svelte';
|
||||
import { FileStream } from 'jazz-tools';
|
||||
@@ -28,7 +28,7 @@
|
||||
const input = event.target as HTMLInputElement;
|
||||
const files = input.files;
|
||||
|
||||
if (!files || !files.length || !me?.root?.sharedFiles || !me.root.publicGroup) return;
|
||||
if (!files || !files.length || !me.root?.sharedFiles || !me.root.publicGroup) return;
|
||||
|
||||
const file = files[0];
|
||||
const fileName = file.name;
|
||||
@@ -129,12 +129,14 @@
|
||||
{#if sharedFiles.current}
|
||||
{#if !(sharedFiles.current.length === 0 && uploadingFiles.size === 0)}
|
||||
{#each [...sharedFiles.current, ...uploadingFiles.values()] as file (generateTempFileId(file?.name, file?.createdAt))}
|
||||
<FileItem
|
||||
{file}
|
||||
loading={uploadingFiles.has(generateTempFileId(file?.name, file?.createdAt))}
|
||||
onShare={shareFile}
|
||||
onDelete={deleteFile}
|
||||
/>
|
||||
{#if file}
|
||||
<FileItem
|
||||
{file}
|
||||
loading={uploadingFiles.has(generateTempFileId(file?.name, file?.createdAt))}
|
||||
onShare={shareFile}
|
||||
onDelete={deleteFile}
|
||||
/>
|
||||
{/if}
|
||||
{/each}
|
||||
{:else}
|
||||
<p class="text-center text-gray-500">No files yet</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { useAccount, useCoState } from '$lib/jazz';
|
||||
import { useAccount, useCoState } from 'jazz-svelte';
|
||||
import { SharedFile } from '$lib/schema';
|
||||
import { File, FileDown, Link2 } from 'lucide-svelte';
|
||||
import type { ID } from 'jazz-tools';
|
||||
|
||||
@@ -1,5 +1,286 @@
|
||||
# form
|
||||
|
||||
## 0.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [75211e3]
|
||||
- jazz-tools@0.10.14
|
||||
- jazz-react@0.10.14
|
||||
- jazz-browser-media-images@0.10.14
|
||||
|
||||
## 0.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [07feedd]
|
||||
- jazz-tools@0.10.13
|
||||
- jazz-browser-media-images@0.10.13
|
||||
- jazz-react@0.10.13
|
||||
|
||||
## 0.0.50
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4612e05]
|
||||
- jazz-tools@0.10.12
|
||||
- jazz-react@0.10.12
|
||||
- jazz-browser-media-images@0.10.12
|
||||
|
||||
## 0.0.49
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.10.9
|
||||
- jazz-react@0.10.9
|
||||
|
||||
## 0.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [2fb6428]
|
||||
- jazz-tools@0.10.8
|
||||
- jazz-react@0.10.8
|
||||
- jazz-browser-media-images@0.10.8
|
||||
|
||||
## 0.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1136d9b]
|
||||
- Updated dependencies [0eed228]
|
||||
- jazz-react@0.10.7
|
||||
- jazz-tools@0.10.7
|
||||
- jazz-browser-media-images@0.10.7
|
||||
|
||||
## 0.0.46
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1d71ca1]
|
||||
- Updated dependencies [ada802b]
|
||||
- hash-slash@0.2.2
|
||||
- jazz-react@0.10.6
|
||||
- jazz-tools@0.10.6
|
||||
- jazz-browser-media-images@0.10.6
|
||||
|
||||
## 0.0.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59ff77e]
|
||||
- jazz-tools@0.10.5
|
||||
- jazz-browser-media-images@0.10.5
|
||||
- jazz-react@0.10.5
|
||||
|
||||
## 0.0.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.4
|
||||
- jazz-tools@0.10.4
|
||||
- jazz-browser-media-images@0.10.4
|
||||
|
||||
## 0.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8582fc]
|
||||
- jazz-tools@0.10.3
|
||||
- jazz-browser-media-images@0.10.3
|
||||
- jazz-react@0.10.3
|
||||
|
||||
## 0.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.2
|
||||
- jazz-tools@0.10.2
|
||||
- jazz-browser-media-images@0.10.2
|
||||
|
||||
## 0.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a63cba]
|
||||
- jazz-tools@0.10.1
|
||||
- jazz-browser-media-images@0.10.1
|
||||
- jazz-react@0.10.1
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [498954f]
|
||||
- Updated dependencies [d42c2aa]
|
||||
- Updated dependencies [dd03464]
|
||||
- Updated dependencies [b426342]
|
||||
- jazz-react@0.10.0
|
||||
- jazz-tools@0.10.0
|
||||
- jazz-browser-media-images@0.10.0
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.23
|
||||
- jazz-tools@0.9.23
|
||||
- jazz-browser-media-images@0.9.23
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.9.22
|
||||
- jazz-react@0.9.22
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1be017d]
|
||||
- jazz-tools@0.9.21
|
||||
- jazz-browser-media-images@0.9.21
|
||||
- jazz-react@0.9.21
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5e83864]
|
||||
- jazz-react@0.9.10
|
||||
- jazz-tools@0.9.10
|
||||
- jazz-browser-media-images@0.9.10
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8eb9247]
|
||||
- jazz-tools@0.9.9
|
||||
- jazz-browser-media-images@0.9.9
|
||||
- jazz-react@0.9.9
|
||||
|
||||
## 0.0.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d1d773b]
|
||||
- jazz-tools@0.9.8
|
||||
- jazz-react@0.9.8
|
||||
- jazz-browser-media-images@0.9.8
|
||||
|
||||
## 0.0.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.4
|
||||
|
||||
## 0.0.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1b71969]
|
||||
- jazz-react@0.9.1
|
||||
- jazz-tools@0.9.1
|
||||
- jazz-browser-media-images@0.9.1
|
||||
|
||||
## 0.0.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [956a4d1]
|
||||
- Updated dependencies [8eda792]
|
||||
- jazz-react@0.9.0
|
||||
- jazz-tools@0.9.0
|
||||
- jazz-browser-media-images@0.9.0
|
||||
|
||||
## 0.0.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -17,30 +17,56 @@ converting it into a `BubbleTeaOrder`.
|
||||
|
||||
[See the full guide here.](https://jazz.tools/docs/react/design-patterns/form)
|
||||
|
||||
## Installing & running the example locally
|
||||
## Getting started
|
||||
|
||||
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
||||
You can either
|
||||
1. Clone the jazz repository, and run the app within the monorepo.
|
||||
2. Or create a new Jazz project using this example as a template.
|
||||
|
||||
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
|
||||
|
||||
### Using the example as a template
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npx degit gardencmp/jazz jazz
|
||||
npx create-jazz-app@latest --example form --project-name form
|
||||
```
|
||||
|
||||
Go to the form example directory:
|
||||
Go to the new project directory.
|
||||
```bash
|
||||
cd jazz/examples/form
|
||||
cd form
|
||||
```
|
||||
|
||||
Install and build dependencies:
|
||||
Run the dev server.
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Using the monorepo
|
||||
|
||||
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
|
||||
|
||||
Clone the jazz repository.
|
||||
```bash
|
||||
git clone https://github.com/garden-co/jazz.git
|
||||
```
|
||||
|
||||
Install and build dependencies.
|
||||
```bash
|
||||
pnpm i && npx turbo build
|
||||
```
|
||||
|
||||
Start the dev server:
|
||||
Go to the example directory.
|
||||
```bash
|
||||
cd jazz/examples/form/
|
||||
```
|
||||
|
||||
Start the dev server.
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
||||
|
||||
## Questions / problems / feedback
|
||||
|
||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||
@@ -49,4 +75,4 @@ If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or
|
||||
|
||||
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
|
||||
|
||||
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<Jazz.Provider>` provider component in [./src/main.tsx](./src/main.tsx).
|
||||
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<JazzProvider>` provider component in [./src/main.tsx](./src/main.tsx).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "form",
|
||||
"private": true,
|
||||
"version": "0.0.20",
|
||||
"version": "0.0.52",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@playwright/test": "^1.46.1",
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@tailwindcss/forms": "^0.5.9",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
@@ -29,8 +29,8 @@
|
||||
"globals": "^15.11.0",
|
||||
"is-ci": "^3.0.1",
|
||||
"postcss": "^8.4.27",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.6.2",
|
||||
"vite": "^5.4.10"
|
||||
"vite": "^6.0.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,29 +3,13 @@ import { ID } from "jazz-tools";
|
||||
import { CreateOrder } from "./CreateOrder.tsx";
|
||||
import { EditOrder } from "./EditOrder.tsx";
|
||||
import { Orders } from "./Orders.tsx";
|
||||
import { useAccount } from "./main";
|
||||
import { BubbleTeaOrder } from "./schema.ts";
|
||||
|
||||
function App() {
|
||||
const { me, logOut } = useAccount();
|
||||
const router = useIframeHashRouter();
|
||||
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
<nav className="container py-2 border-b flex items-center justify-between">
|
||||
<span>
|
||||
You're logged in as <strong>{me?.profile?.name}</strong>
|
||||
</span>
|
||||
<button
|
||||
className="bg-stone-100 py-1.5 px-3 text-sm rounded-md dark:bg-stone-900 dark:text-white"
|
||||
onClick={() => logOut()}
|
||||
>
|
||||
Log out
|
||||
</button>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main className="container py-8 space-y-8">
|
||||
{router.route({
|
||||
"/": () => <Orders />,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useIframeHashRouter } from "hash-slash";
|
||||
import { useAccount, useCoState } from "jazz-react";
|
||||
import { ID } from "jazz-tools";
|
||||
import { useState } from "react";
|
||||
import { Errors } from "./Errors.tsx";
|
||||
import { LinkToHome } from "./LinkToHome.tsx";
|
||||
import { OrderForm } from "./OrderForm.tsx";
|
||||
import { useAccount, useCoState } from "./main.tsx";
|
||||
import {
|
||||
BubbleTeaOrder,
|
||||
DraftBubbleTeaOrder,
|
||||
@@ -30,12 +30,9 @@ export function CreateOrder() {
|
||||
me.root.orders.push(draft as BubbleTeaOrder);
|
||||
|
||||
// reset the draft
|
||||
me.root.draft = DraftBubbleTeaOrder.create(
|
||||
{
|
||||
addOns: ListOfBubbleTeaAddOns.create([], me),
|
||||
},
|
||||
me,
|
||||
);
|
||||
me.root.draft = DraftBubbleTeaOrder.create({
|
||||
addOns: ListOfBubbleTeaAddOns.create([]),
|
||||
});
|
||||
|
||||
router.navigate("/");
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useAccount } from "./main.tsx";
|
||||
import { useAccount } from "jazz-react";
|
||||
|
||||
export function DraftIndicator() {
|
||||
const { me } = useAccount({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useCoState } from "jazz-react";
|
||||
import { ID } from "jazz-tools";
|
||||
import { LinkToHome } from "./LinkToHome.tsx";
|
||||
import { OrderForm } from "./OrderForm.tsx";
|
||||
import { OrderThumbnail } from "./OrderThumbnail.tsx";
|
||||
import { useCoState } from "./main.tsx";
|
||||
import { BubbleTeaOrder } from "./schema.ts";
|
||||
|
||||
export function EditOrder(props: { id: ID<BubbleTeaOrder> }) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useAccount } from "jazz-react";
|
||||
import { DraftIndicator } from "./DraftIndicator.tsx";
|
||||
import { OrderThumbnail } from "./OrderThumbnail.tsx";
|
||||
import { useAccount } from "./main.tsx";
|
||||
|
||||
export function Orders() {
|
||||
const { me } = useAccount({
|
||||
|
||||
1
examples/form/src/apiKey.ts
Normal file
1
examples/form/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const apiKey = "form-example@garden.co";
|
||||
@@ -1,39 +1,26 @@
|
||||
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
|
||||
import { JazzProvider } from "jazz-react";
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./App.tsx";
|
||||
import "./index.css";
|
||||
import { apiKey } from "./apiKey";
|
||||
import { JazzAccount } from "./schema.ts";
|
||||
|
||||
const Jazz = createJazzReactApp({
|
||||
AccountSchema: JazzAccount,
|
||||
});
|
||||
|
||||
export const { useAccount, useCoState } = Jazz;
|
||||
|
||||
function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
||||
const [auth, authState] = useDemoAuth();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Jazz.Provider
|
||||
auth={auth}
|
||||
peer="wss://cloud.jazz.tools/?key=form-example@garden.co"
|
||||
>
|
||||
{children}
|
||||
</Jazz.Provider>
|
||||
|
||||
{authState.state !== "signedIn" && (
|
||||
<DemoAuthBasicUI appName="Form" state={authState} />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
declare module "jazz-react" {
|
||||
interface Register {
|
||||
Account: JazzAccount;
|
||||
}
|
||||
}
|
||||
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<StrictMode>
|
||||
<JazzAndAuth>
|
||||
<JazzProvider
|
||||
sync={{
|
||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||
}}
|
||||
AccountSchema={JazzAccount}
|
||||
>
|
||||
<App />
|
||||
</JazzAndAuth>
|
||||
</JazzProvider>
|
||||
</StrictMode>,
|
||||
);
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { LoginPage } from "./pages/LoginPage";
|
||||
|
||||
test("create and edit an order", async ({ page }) => {
|
||||
const loginPage = new LoginPage(page);
|
||||
|
||||
await loginPage.goto();
|
||||
await loginPage.fillUsername("Alice");
|
||||
await loginPage.signup();
|
||||
|
||||
await page.goto("/");
|
||||
// start an order
|
||||
await page.getByRole("link", { name: "Add new order" }).click();
|
||||
await page.getByLabel("Base tea").selectOption("Oolong");
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import { Locator, Page, expect } from "@playwright/test";
|
||||
|
||||
export class LoginPage {
|
||||
readonly page: Page;
|
||||
readonly usernameInput: Locator;
|
||||
readonly signupButton: Locator;
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
this.usernameInput = page.getByRole("textbox");
|
||||
this.signupButton = page.getByRole("button", {
|
||||
name: "Sign up",
|
||||
});
|
||||
}
|
||||
|
||||
async goto() {
|
||||
this.page.goto("/");
|
||||
}
|
||||
|
||||
async fillUsername(value: string) {
|
||||
await this.usernameInput.clear();
|
||||
await this.usernameInput.fill(value);
|
||||
}
|
||||
|
||||
async loginAs(value: string) {
|
||||
await this.page
|
||||
.getByRole("button", {
|
||||
name: value,
|
||||
})
|
||||
.click();
|
||||
}
|
||||
|
||||
async signup() {
|
||||
await this.signupButton.click();
|
||||
}
|
||||
|
||||
async expectLoaded() {
|
||||
await expect(this.signupButton).toBeVisible();
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"root":["./src/app.tsx","./src/createorder.tsx","./src/draftindicator.tsx","./src/editorder.tsx","./src/errors.tsx","./src/linktohome.tsx","./src/orderform.tsx","./src/orderthumbnail.tsx","./src/orders.tsx","./src/main.tsx","./src/schema.ts","./src/vite-env.d.ts"],"version":"5.6.3"}
|
||||
@@ -1,5 +1,285 @@
|
||||
# image-upload
|
||||
|
||||
## 0.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [75211e3]
|
||||
- jazz-tools@0.10.14
|
||||
- jazz-react@0.10.14
|
||||
- jazz-browser-media-images@0.10.14
|
||||
|
||||
## 0.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [07feedd]
|
||||
- jazz-tools@0.10.13
|
||||
- jazz-browser-media-images@0.10.13
|
||||
- jazz-react@0.10.13
|
||||
|
||||
## 0.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4612e05]
|
||||
- jazz-tools@0.10.12
|
||||
- jazz-react@0.10.12
|
||||
- jazz-browser-media-images@0.10.12
|
||||
|
||||
## 0.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.10.9
|
||||
- jazz-react@0.10.9
|
||||
|
||||
## 0.0.50
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [2fb6428]
|
||||
- jazz-tools@0.10.8
|
||||
- jazz-react@0.10.8
|
||||
- jazz-browser-media-images@0.10.8
|
||||
|
||||
## 0.0.49
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1136d9b]
|
||||
- Updated dependencies [0eed228]
|
||||
- jazz-react@0.10.7
|
||||
- jazz-tools@0.10.7
|
||||
- jazz-browser-media-images@0.10.7
|
||||
|
||||
## 0.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1d71ca1]
|
||||
- Updated dependencies [ada802b]
|
||||
- jazz-react@0.10.6
|
||||
- jazz-tools@0.10.6
|
||||
- jazz-browser-media-images@0.10.6
|
||||
|
||||
## 0.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [59ff77e]
|
||||
- jazz-tools@0.10.5
|
||||
- jazz-browser-media-images@0.10.5
|
||||
- jazz-react@0.10.5
|
||||
|
||||
## 0.0.46
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.4
|
||||
- jazz-tools@0.10.4
|
||||
- jazz-browser-media-images@0.10.4
|
||||
|
||||
## 0.0.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8582fc]
|
||||
- jazz-tools@0.10.3
|
||||
- jazz-browser-media-images@0.10.3
|
||||
- jazz-react@0.10.3
|
||||
|
||||
## 0.0.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.10.2
|
||||
- jazz-tools@0.10.2
|
||||
- jazz-browser-media-images@0.10.2
|
||||
|
||||
## 0.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5a63cba]
|
||||
- jazz-tools@0.10.1
|
||||
- jazz-browser-media-images@0.10.1
|
||||
- jazz-react@0.10.1
|
||||
|
||||
## 0.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [498954f]
|
||||
- Updated dependencies [d42c2aa]
|
||||
- Updated dependencies [dd03464]
|
||||
- Updated dependencies [b426342]
|
||||
- jazz-react@0.10.0
|
||||
- jazz-tools@0.10.0
|
||||
- jazz-browser-media-images@0.10.0
|
||||
|
||||
## 0.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.23
|
||||
- jazz-tools@0.9.23
|
||||
- jazz-browser-media-images@0.9.23
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.9.22
|
||||
- jazz-react@0.9.22
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1be017d]
|
||||
- jazz-tools@0.9.21
|
||||
- jazz-browser-media-images@0.9.21
|
||||
- jazz-react@0.9.21
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5e83864]
|
||||
- jazz-react@0.9.10
|
||||
- jazz-tools@0.9.10
|
||||
- jazz-browser-media-images@0.9.10
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8eb9247]
|
||||
- jazz-tools@0.9.9
|
||||
- jazz-browser-media-images@0.9.9
|
||||
- jazz-react@0.9.9
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d1d773b]
|
||||
- jazz-tools@0.9.8
|
||||
- jazz-react@0.9.8
|
||||
- jazz-browser-media-images@0.9.8
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.4
|
||||
|
||||
## 0.0.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1b71969]
|
||||
- jazz-react@0.9.1
|
||||
- jazz-tools@0.9.1
|
||||
- jazz-browser-media-images@0.9.1
|
||||
|
||||
## 0.0.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [956a4d1]
|
||||
- Updated dependencies [8eda792]
|
||||
- jazz-react@0.9.0
|
||||
- jazz-tools@0.9.0
|
||||
- jazz-browser-media-images@0.9.0
|
||||
|
||||
## 0.0.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -4,30 +4,56 @@ This is an example of how to upload and render images with Jazz.
|
||||
|
||||
Live version: https://image-upload-demo.jazz.tools
|
||||
|
||||
## Installing & running the example locally
|
||||
## Getting started
|
||||
|
||||
(This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
||||
You can either
|
||||
1. Clone the jazz repository, and run the app within the monorepo.
|
||||
2. Or create a new Jazz project using this example as a template.
|
||||
|
||||
Start by downloading the [jazz repository](https://github.com/garden-co/jazz):
|
||||
|
||||
### Using the example as a template
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npx degit gardencmp/jazz jazz
|
||||
npx create-jazz-app@latest --example image-upload --project-name image-upload
|
||||
```
|
||||
|
||||
Go to the image-upload example directory:
|
||||
Go to the new project directory.
|
||||
```bash
|
||||
cd jazz/examples/image-upload
|
||||
cd image-upload
|
||||
```
|
||||
|
||||
Install and build dependencies:
|
||||
Run the dev server.
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Using the monorepo
|
||||
|
||||
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
|
||||
|
||||
Clone the jazz repository.
|
||||
```bash
|
||||
git clone https://github.com/garden-co/jazz.git
|
||||
```
|
||||
|
||||
Install and build dependencies.
|
||||
```bash
|
||||
pnpm i && npx turbo build
|
||||
```
|
||||
|
||||
Start the dev server:
|
||||
Go to the example directory.
|
||||
```bash
|
||||
cd jazz/examples/image-upload/
|
||||
```
|
||||
|
||||
Start the dev server.
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
|
||||
|
||||
## Questions / problems / feedback
|
||||
|
||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-upload",
|
||||
"private": true,
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.54",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -24,6 +24,6 @@
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"globals": "^15.11.0",
|
||||
"typescript": "~5.6.2",
|
||||
"vite": "^5.4.10"
|
||||
"vite": "^6.0.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
import ImageUpload from "./ImageUpload.tsx";
|
||||
import { useAccount } from "./main";
|
||||
|
||||
function App() {
|
||||
const { me, logOut } = useAccount();
|
||||
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
<nav className="container">
|
||||
<span>
|
||||
You're logged in as <strong>{me?.profile?.name}</strong>
|
||||
</span>
|
||||
<button onClick={() => logOut()}>Log out</button>
|
||||
</nav>
|
||||
</header>
|
||||
<main className="container">
|
||||
<ImageUpload />
|
||||
</main>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { createImage } from "jazz-browser-media-images";
|
||||
import { ProgressiveImg } from "jazz-react";
|
||||
import { ProgressiveImg, useAccount } from "jazz-react";
|
||||
import { ImageDefinition } from "jazz-tools";
|
||||
import { ChangeEvent, useRef } from "react";
|
||||
import { useAccount } from "./main.tsx";
|
||||
|
||||
function Image({ image }: { image: ImageDefinition }) {
|
||||
return (
|
||||
@@ -47,7 +46,12 @@ export default function ImageUpload() {
|
||||
) : (
|
||||
<div>
|
||||
<label>Upload image</label>
|
||||
<input ref={inputRef} type="file" onChange={onImageChange} />
|
||||
<input
|
||||
ref={inputRef}
|
||||
type="file"
|
||||
accept="image/png, image/jpeg, image/gif"
|
||||
onChange={onImageChange}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user