Compare commits
157 Commits
@blitzjs/n
...
@blitzjs/g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac9c4cebc8 | ||
|
|
a7e37c58db | ||
|
|
b0d2505a85 | ||
|
|
024cd819e3 | ||
|
|
12cb7a727d | ||
|
|
923703b661 | ||
|
|
70f9ae4921 | ||
|
|
c738ecacbc | ||
|
|
ad0b087d9f | ||
|
|
dc694cf1cf | ||
|
|
4c221b655e | ||
|
|
c11f0401cf | ||
|
|
830b51d0dc | ||
|
|
bec9512e30 | ||
|
|
1493729d6b | ||
|
|
6bb5980da9 | ||
|
|
7310f7171d | ||
|
|
d855ee3e1d | ||
|
|
93851d90ca | ||
|
|
3ab05b3cda | ||
|
|
bb3dd56f7a | ||
|
|
1d9804a610 | ||
|
|
0fd1f9c9b1 | ||
|
|
b86b569d56 | ||
|
|
b405c1e876 | ||
|
|
c957828ea6 | ||
|
|
c78e5c4704 | ||
|
|
009664e0f5 | ||
|
|
3110522dca | ||
|
|
7269ac2bc5 | ||
|
|
7a7ce2229e | ||
|
|
10c23d3d20 | ||
|
|
d93b05d0ac | ||
|
|
aafdc5b4c4 | ||
|
|
37ef42811b | ||
|
|
34cc29e40c | ||
|
|
bee19a259d | ||
|
|
9ada0f6661 | ||
|
|
425559d360 | ||
|
|
0411689b1d | ||
|
|
0d3514cd27 | ||
|
|
a9edde6d83 | ||
|
|
5c5decbce2 | ||
|
|
e476beba39 | ||
|
|
1a1b23a7e8 | ||
|
|
ae0b714f69 | ||
|
|
7817fe3a85 | ||
|
|
30bb474abb | ||
|
|
135b30efde | ||
|
|
527e48ac3e | ||
|
|
b905270875 | ||
|
|
96ea5291e4 | ||
|
|
9c2e7d372c | ||
|
|
493d505b24 | ||
|
|
09da992bef | ||
|
|
bbac7906e8 | ||
|
|
21ca3a9b02 | ||
|
|
32274803d9 | ||
|
|
9ded8dacba | ||
|
|
80ffbeaa4c | ||
|
|
6bde1b07da | ||
|
|
b918055bf3 | ||
|
|
f9a2971f05 | ||
|
|
72b08f2269 | ||
|
|
2124a4d0c5 | ||
|
|
8aee25c58a | ||
|
|
f1003faf94 | ||
|
|
50468a3bb0 | ||
|
|
891d91bf4d | ||
|
|
f96c953457 | ||
|
|
a80d2a8f77 | ||
|
|
b336ad05f4 | ||
|
|
39ca0ef8bf | ||
|
|
4cad9cca25 | ||
|
|
b6fc940bf2 | ||
|
|
a946dd5889 | ||
|
|
e3750b049d | ||
|
|
fb01cc7788 | ||
|
|
ac8c412da2 | ||
|
|
dfd2408e95 | ||
|
|
9741287050 | ||
|
|
0e9c81abdc | ||
|
|
9e05d6e155 | ||
|
|
17f70e65ef | ||
|
|
0ddc5a8169 | ||
|
|
e6fb09d494 | ||
|
|
d846fc6be9 | ||
|
|
f5e80e3835 | ||
|
|
17ce29e5e4 | ||
|
|
46d9f81adf | ||
|
|
994cfc6292 | ||
|
|
7811748526 | ||
|
|
ce45368334 | ||
|
|
4e9c1f60b6 | ||
|
|
508682c8f8 | ||
|
|
962eb58af6 | ||
|
|
17669b3af8 | ||
|
|
ec6299c36a | ||
|
|
6ac2d3412a | ||
|
|
85f9959d1f | ||
|
|
354f0440d6 | ||
|
|
ac365a0656 | ||
|
|
0729291099 | ||
|
|
9cf924ee86 | ||
|
|
b545a38b87 | ||
|
|
1463a20471 | ||
|
|
0e762fb557 | ||
|
|
6fe860512c | ||
|
|
adfe8ff919 | ||
|
|
980869fbc8 | ||
|
|
00f6d5576a | ||
|
|
1945d85db2 | ||
|
|
b0c21b0706 | ||
|
|
931156c352 | ||
|
|
1436e76180 | ||
|
|
c3bb5cd95b | ||
|
|
8b08fe4e38 | ||
|
|
604dc3b345 | ||
|
|
20fb3b9427 | ||
|
|
66ea6ec0cb | ||
|
|
8490b07246 | ||
|
|
f15a519017 | ||
|
|
cfcd3f83df | ||
|
|
adabb11a0c | ||
|
|
909dc76087 | ||
|
|
c5c727cb67 | ||
|
|
6ff9ec0d75 | ||
|
|
da17cc8a24 | ||
|
|
89bf993a1d | ||
|
|
68f129491c | ||
|
|
c096891bf0 | ||
|
|
81b4b41a99 | ||
|
|
e8271d579c | ||
|
|
9e798b152b | ||
|
|
3c6f43a11d | ||
|
|
8107138e2f | ||
|
|
8cb1134d94 | ||
|
|
2073714f8d | ||
|
|
9631c45833 | ||
|
|
2150dcc3e7 | ||
|
|
63605961b4 | ||
|
|
d711948809 | ||
|
|
1f6b0b54c2 | ||
|
|
4603a2b7bd | ||
|
|
01f3a03ea9 | ||
|
|
36e26193b7 | ||
|
|
4a9aa9f7ff | ||
|
|
1e1bb73b2d | ||
|
|
99205f52d5 | ||
|
|
d03a1165d7 | ||
|
|
d87288a2e9 | ||
|
|
fdff45a592 | ||
|
|
469f55a429 | ||
|
|
e6c31704ed | ||
|
|
35a070ad7d | ||
|
|
9674efc0bf | ||
|
|
666a3ae3e6 |
6
.changeset/big-phones-bow.md
Normal file
6
.changeset/big-phones-bow.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
add mounted check inside withBlitz
|
||||
7
.changeset/breezy-cameras-double.md
Normal file
7
.changeset/breezy-cameras-double.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Fix codegen and postinstall to make work with pnpm
|
||||
5
.changeset/bright-mangos-run.md
Normal file
5
.changeset/bright-mangos-run.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Add queryClient to RPC Plugin exports
|
||||
@@ -7,5 +7,5 @@
|
||||
"access": "restricted",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": ["web", "test-*"]
|
||||
"ignore": ["web", "test-*", "toolkit-app"]
|
||||
}
|
||||
|
||||
5
.changeset/cool-doors-invent.md
Normal file
5
.changeset/cool-doors-invent.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Add invokeWithCtx function
|
||||
6
.changeset/dirty-monkeys-greet.md
Normal file
6
.changeset/dirty-monkeys-greet.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Use alpha version for blitz dependency, fix package manager selection
|
||||
6
.changeset/eleven-humans-sort.md
Normal file
6
.changeset/eleven-humans-sort.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
codemod fixes
|
||||
5
.changeset/empty-berries-rule.md
Normal file
5
.changeset/empty-berries-rule.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
fix app generator for pnpm unmet dependency
|
||||
5
.changeset/empty-turkeys-wave.md
Normal file
5
.changeset/empty-turkeys-wave.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Use `useRouter` from next/router in useParams function
|
||||
5
.changeset/fair-wombats-sneeze.md
Normal file
5
.changeset/fair-wombats-sneeze.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
added superjson
|
||||
5
.changeset/famous-kings-explain.md
Normal file
5
.changeset/famous-kings-explain.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
updated nextjs version in generator & npmrc file
|
||||
5
.changeset/fast-trainers-kneel.md
Normal file
5
.changeset/fast-trainers-kneel.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Export Zod utils from blitz core package
|
||||
5
.changeset/flat-bees-approve.md
Normal file
5
.changeset/flat-bees-approve.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
set default enviornment variable to development unless build and start command
|
||||
6
.changeset/four-brooms-juggle.md
Normal file
6
.changeset/four-brooms-juggle.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Add missing RouteUrlObject on Page.authenticate.redirectTo
|
||||
5
.changeset/four-meals-fry.md
Normal file
5
.changeset/four-meals-fry.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
export BlitzPage & BlitzLayout types from @blitzjs/next
|
||||
5
.changeset/fuzzy-jars-admire.md
Normal file
5
.changeset/fuzzy-jars-admire.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
fix codemod for wrapping \_app arrow function & fix codemod for nested pages directory
|
||||
5
.changeset/gentle-dogs-reply.md
Normal file
5
.changeset/gentle-dogs-reply.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Update queryClient import in codemod
|
||||
5
.changeset/good-insects-wink.md
Normal file
5
.changeset/good-insects-wink.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Allow passing optional type argument for ParamsType in GSSP
|
||||
5
.changeset/green-papayas-do.md
Normal file
5
.changeset/green-papayas-do.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Update codemod and template with a new queryClient import location
|
||||
5
.changeset/healthy-rice-shout.md
Normal file
5
.changeset/healthy-rice-shout.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
detailed print env info
|
||||
6
.changeset/hot-drinks-approve.md
Normal file
6
.changeset/hot-drinks-approve.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Upgrade @types/react, fix typings inside @blitzjs/next
|
||||
6
.changeset/late-steaks-give.md
Normal file
6
.changeset/late-steaks-give.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Support RPC error middleware
|
||||
6
.changeset/lemon-games-press.md
Normal file
6
.changeset/lemon-games-press.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Update Next.js version and addBasePath location
|
||||
5
.changeset/lovely-colts-share.md
Normal file
5
.changeset/lovely-colts-share.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
fix broken cli versioning
|
||||
7
.changeset/lucky-cows-try.md
Normal file
7
.changeset/lucky-cows-try.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/auth": patch
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
rename middleware type for blitz server plugin
|
||||
5
.changeset/modern-cameras-pull.md
Normal file
5
.changeset/modern-cameras-pull.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Support `prefetchBlitzQuery` in gSSP and gSP
|
||||
5
.changeset/moody-squids-cheer.md
Normal file
5
.changeset/moody-squids-cheer.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
test automated publish
|
||||
5
.changeset/nervous-beds-travel.md
Normal file
5
.changeset/nervous-beds-travel.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
useParam & useParams functions now accessible from @blitzjs/next
|
||||
5
.changeset/nervous-dolls-rule.md
Normal file
5
.changeset/nervous-dolls-rule.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Move middlewares from blitz config to blitz server with codemod
|
||||
6
.changeset/new-coats-turn.md
Normal file
6
.changeset/new-coats-turn.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Handle duplicate imports with Blitz upgrade-legacy codemod
|
||||
5
.changeset/nice-deers-dream.md
Normal file
5
.changeset/nice-deers-dream.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Export BlitzProvider from @blitzjs/next
|
||||
5
.changeset/nice-starfishes-live.md
Normal file
5
.changeset/nice-starfishes-live.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
add mounted check to app generator template
|
||||
5
.changeset/olive-bees-buy.md
Normal file
5
.changeset/olive-bees-buy.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Fix templates source in RPC codemod step
|
||||
5
.changeset/olive-feet-rhyme.md
Normal file
5
.changeset/olive-feet-rhyme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Add codemod to upgrade from legacy framework to the Blitz Toolkit
|
||||
11
.changeset/plenty-bottles-swim.md
Normal file
11
.changeset/plenty-bottles-swim.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
- Add mounted check to withBlitz
|
||||
- Upgrade @types/react, fix typings inside @blitzjs/next
|
||||
- Support prefetchBlitzQuery in gSP and gSSP
|
||||
- Add db seed cli command
|
||||
- Add try/catch to changePassword mutation
|
||||
5
.changeset/poor-penguins-look.md
Normal file
5
.changeset/poor-penguins-look.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
add `db seed` cli command
|
||||
5
.changeset/poor-shrimps-think.md
Normal file
5
.changeset/poor-shrimps-think.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Setup SuperJson for GSSP and GSP
|
||||
5
.changeset/popular-teachers-pay.md
Normal file
5
.changeset/popular-teachers-pay.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Handle next/dynamic default import in codemod
|
||||
@@ -12,16 +12,87 @@
|
||||
"@blitzjs/rpc": "2.0.0-alpha.0",
|
||||
"@blitzjs/config": "0.0.0",
|
||||
"@blitzjs/generator": "2.0.0-alpha.0",
|
||||
"@blitzjs/codemod": "2.0.0-alpha.0",
|
||||
"template": "0.0.0",
|
||||
"toolkit-app": "1.0.0"
|
||||
"toolkit-app": "1.0.0",
|
||||
"test-qm": "0.0.0",
|
||||
"test-no-suspense": "0.0.0",
|
||||
"test-trailing-slash": "0.0.0",
|
||||
"test-middleware": "0.0.0"
|
||||
},
|
||||
"changesets": [
|
||||
"big-phones-bow",
|
||||
"breezy-cameras-double",
|
||||
"bright-mangos-run",
|
||||
"cool-doors-invent",
|
||||
"dirty-monkeys-greet",
|
||||
"eleven-humans-sort",
|
||||
"empty-berries-rule",
|
||||
"empty-turkeys-wave",
|
||||
"fair-wombats-sneeze",
|
||||
"famous-kings-explain",
|
||||
"fast-trainers-kneel",
|
||||
"flat-bees-approve",
|
||||
"four-brooms-juggle",
|
||||
"four-meals-fry",
|
||||
"fuzzy-jars-admire",
|
||||
"gentle-dogs-reply",
|
||||
"good-insects-wink",
|
||||
"great-months-train",
|
||||
"green-papayas-do",
|
||||
"healthy-rice-shout",
|
||||
"hot-drinks-approve",
|
||||
"late-steaks-give",
|
||||
"lemon-games-press",
|
||||
"lovely-colts-share",
|
||||
"lucky-cows-try",
|
||||
"modern-cameras-pull",
|
||||
"moody-squids-cheer",
|
||||
"nervous-beds-travel",
|
||||
"nervous-dolls-rule",
|
||||
"new-coats-turn",
|
||||
"nice-deers-dream",
|
||||
"nice-starfishes-live",
|
||||
"nine-onions-admire",
|
||||
"ninety-pets-heal",
|
||||
"olive-bees-buy",
|
||||
"olive-feet-rhyme",
|
||||
"plenty-bottles-swim",
|
||||
"poor-peas-lick",
|
||||
"poor-penguins-look",
|
||||
"poor-shrimps-think",
|
||||
"popular-teachers-pay",
|
||||
"purple-singers-greet",
|
||||
"quiet-feet-travel",
|
||||
"quiet-pans-hunt",
|
||||
"quiet-sloths-rule",
|
||||
"rich-chairs-invent",
|
||||
"rich-queens-travel",
|
||||
"sharp-falcons-begin",
|
||||
"shy-olives-hang",
|
||||
"silent-colts-reply",
|
||||
"slow-walls-poke",
|
||||
"small-socks-confess",
|
||||
"smooth-planets-admire",
|
||||
"strong-apes-reply",
|
||||
"stupid-walls-sell",
|
||||
"swift-drinks-dress",
|
||||
"tall-meals-learn",
|
||||
"tame-keys-reply",
|
||||
"tasty-news-collect",
|
||||
"ten-hairs-listen",
|
||||
"ten-rivers-burn",
|
||||
"twenty-beans-pump"
|
||||
"tender-pianos-check",
|
||||
"thick-parrots-float",
|
||||
"thirty-countries-build",
|
||||
"twenty-beans-pump",
|
||||
"two-kiwis-help",
|
||||
"two-tigers-type",
|
||||
"unlucky-papayas-sleep",
|
||||
"violet-bags-leave",
|
||||
"violet-lions-help",
|
||||
"weak-suns-shave",
|
||||
"wicked-ghosts-cough",
|
||||
"wise-frogs-give"
|
||||
]
|
||||
}
|
||||
|
||||
7
.changeset/purple-singers-greet.md
Normal file
7
.changeset/purple-singers-greet.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
"@blitzjs/codemod": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
getQueryClient function & queryClient codemod updates & shared plugin config
|
||||
5
.changeset/quiet-feet-travel.md
Normal file
5
.changeset/quiet-feet-travel.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
fix source path for templates
|
||||
5
.changeset/quiet-pans-hunt.md
Normal file
5
.changeset/quiet-pans-hunt.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Removes the suspense wrapper from withBlitz since it's not needed
|
||||
5
.changeset/quiet-sloths-rule.md
Normal file
5
.changeset/quiet-sloths-rule.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Removes the check for when withBlitz is mounted before rendering the users app. We had this previously to avoid the react 18 suspense error being showin in development with nextjs.
|
||||
5
.changeset/rich-chairs-invent.md
Normal file
5
.changeset/rich-chairs-invent.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Rename prefetchBlitzQuery to prefetchQuery, add prefetchInfiniteQuery
|
||||
8
.changeset/rich-queens-travel.md
Normal file
8
.changeset/rich-queens-travel.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/auth": patch
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Remove references to the logging package
|
||||
5
.changeset/sharp-falcons-begin.md
Normal file
5
.changeset/sharp-falcons-begin.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Use routes manifest in template app
|
||||
6
.changeset/shy-olives-hang.md
Normal file
6
.changeset/shy-olives-hang.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Update RPC plugin setup in templates
|
||||
6
.changeset/slow-walls-poke.md
Normal file
6
.changeset/slow-walls-poke.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Allow resolverPath to be a function which is ran for every file path that is converted to RPC Route
|
||||
5
.changeset/small-socks-confess.md
Normal file
5
.changeset/small-socks-confess.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
---
|
||||
|
||||
Add passport adapter to @blitzjs/auth
|
||||
5
.changeset/smooth-planets-admire.md
Normal file
5
.changeset/smooth-planets-admire.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Add missing \_document.tsx and 404.tsx pages to the new app templates
|
||||
5
.changeset/strong-apes-reply.md
Normal file
5
.changeset/strong-apes-reply.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Remove as any assertion for the PrismaStorage argument
|
||||
8
.changeset/stupid-walls-sell.md
Normal file
8
.changeset/stupid-walls-sell.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/auth": patch
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
testing set dist-tag
|
||||
5
.changeset/swift-drinks-dress.md
Normal file
5
.changeset/swift-drinks-dress.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Fix postinstall script not being found
|
||||
5
.changeset/tall-meals-learn.md
Normal file
5
.changeset/tall-meals-learn.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Upgrade Prisma to v4.0.0
|
||||
5
.changeset/tame-keys-reply.md
Normal file
5
.changeset/tame-keys-reply.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Add aliases for Blitz CLI commands
|
||||
6
.changeset/tasty-news-collect.md
Normal file
6
.changeset/tasty-news-collect.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
init codemod generator
|
||||
5
.changeset/ten-hairs-listen.md
Normal file
5
.changeset/ten-hairs-listen.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Allow customizing PreviewData in gSSP
|
||||
7
.changeset/tender-pianos-check.md
Normal file
7
.changeset/tender-pianos-check.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
various improvements and fixes
|
||||
5
.changeset/thick-parrots-float.md
Normal file
5
.changeset/thick-parrots-float.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
allow extension catch in getAllFiles codemod util
|
||||
5
.changeset/thirty-countries-build.md
Normal file
5
.changeset/thirty-countries-build.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
add @blitzjs/generator as external
|
||||
5
.changeset/two-kiwis-help.md
Normal file
5
.changeset/two-kiwis-help.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
fix generate cli command
|
||||
5
.changeset/two-tigers-type.md
Normal file
5
.changeset/two-tigers-type.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix running bin commands with Blitz CLI
|
||||
5
.changeset/unlucky-papayas-sleep.md
Normal file
5
.changeset/unlucky-papayas-sleep.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
remove console logs inside onPostInstall in the new cli command
|
||||
5
.changeset/violet-bags-leave.md
Normal file
5
.changeset/violet-bags-leave.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Update templates directory for codemod
|
||||
5
.changeset/violet-lions-help.md
Normal file
5
.changeset/violet-lions-help.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Add resolverBasePath to Blitz config to change the way rpc routes are generated
|
||||
5
.changeset/weak-suns-shave.md
Normal file
5
.changeset/weak-suns-shave.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Move blitz config to next.config.js
|
||||
5
.changeset/wicked-ghosts-cough.md
Normal file
5
.changeset/wicked-ghosts-cough.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
fix template sourcepath because of new env variable
|
||||
5
.changeset/wise-frogs-give.md
Normal file
5
.changeset/wise-frogs-give.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
use latest tag for generator template on rpc & auth packages
|
||||
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1,5 +1,5 @@
|
||||
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
|
||||
|
||||
* @flybayer @beerose
|
||||
* @flybayer @beerose @dillonraphael
|
||||
|
||||
packages/generator/templates**/* @flybayer
|
||||
|
||||
58
.github/workflows/release.yml
vendored
Normal file
58
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js 16.x
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- name: Creating .npmrc
|
||||
run: |
|
||||
cat << EOF > "$HOME/.npmrc"
|
||||
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
||||
EOF
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Pre-publish
|
||||
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
with:
|
||||
version: 6.32.6
|
||||
- run: pnpm install --no-frozen-lockfile
|
||||
- run: pnpm build
|
||||
|
||||
- name: Create Release Pull Request
|
||||
uses: blitz-js/changesets-action@main
|
||||
with:
|
||||
publish: pnpm release
|
||||
createGithubReleases: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
# - name: Github Release
|
||||
# uses: release-drafter/release-drafter@v5.19.0
|
||||
# with:
|
||||
# config-name: release-drafter.yml
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
2
.npmrc
2
.npmrc
@@ -1,7 +1,9 @@
|
||||
save-exact=true
|
||||
strict-peer-dependencies=false
|
||||
|
||||
public-hoist-pattern[]=secure-password
|
||||
public-hoist-pattern[]=*types*
|
||||
public-hoist-pattern[]=*eslint*
|
||||
public-hoist-pattern[]=@prettier/plugin-*
|
||||
public-hoist-pattern[]=*prettier-plugin-*
|
||||
strict-peer-dependencies=false
|
||||
|
||||
@@ -1,5 +1,156 @@
|
||||
# toolkit-app
|
||||
|
||||
## 1.0.1-alpha.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.21
|
||||
- @blitzjs/auth@2.0.0-alpha.21
|
||||
- @blitzjs/next@2.0.0-alpha.21
|
||||
- @blitzjs/rpc@2.0.0-alpha.21
|
||||
- @blitzjs/config@2.0.0-alpha.21
|
||||
|
||||
## 1.0.1-alpha.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- blitz@2.0.0-alpha.20
|
||||
- @blitzjs/auth@2.0.0-alpha.20
|
||||
- @blitzjs/next@2.0.0-alpha.20
|
||||
- @blitzjs/rpc@2.0.0-alpha.20
|
||||
- @blitzjs/config@2.0.0-alpha.20
|
||||
|
||||
## 1.0.1-alpha.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- Updated dependencies [2150dcc3]
|
||||
- @blitzjs/next@2.0.0-alpha.19
|
||||
- blitz@2.0.0-alpha.19
|
||||
- @blitzjs/auth@2.0.0-alpha.19
|
||||
- @blitzjs/rpc@2.0.0-alpha.19
|
||||
- @blitzjs/config@2.0.0-alpha.19
|
||||
|
||||
## 1.0.1-alpha.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- blitz@2.0.0-alpha.18
|
||||
- @blitzjs/auth@2.0.0-alpha.18
|
||||
- @blitzjs/next@2.0.0-alpha.18
|
||||
- @blitzjs/rpc@2.0.0-alpha.18
|
||||
- @blitzjs/config@2.0.0-alpha.18
|
||||
|
||||
## 1.0.1-alpha.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.17
|
||||
- @blitzjs/auth@2.0.0-alpha.17
|
||||
- @blitzjs/next@2.0.0-alpha.17
|
||||
- @blitzjs/rpc@2.0.0-alpha.17
|
||||
- @blitzjs/config@2.0.0-alpha.17
|
||||
|
||||
## 1.0.1-alpha.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- blitz@2.0.0-alpha.16
|
||||
- @blitzjs/auth@2.0.0-alpha.16
|
||||
- @blitzjs/next@2.0.0-alpha.16
|
||||
- @blitzjs/rpc@2.0.0-alpha.16
|
||||
- @blitzjs/config@2.0.0-alpha.16
|
||||
|
||||
## 1.0.1-alpha.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.15
|
||||
- @blitzjs/auth@2.0.0-alpha.15
|
||||
- @blitzjs/next@2.0.0-alpha.15
|
||||
- @blitzjs/rpc@2.0.0-alpha.15
|
||||
- @blitzjs/config@2.0.0-alpha.15
|
||||
|
||||
## 1.0.1-alpha.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- blitz@2.0.0-alpha.14
|
||||
- @blitzjs/auth@2.0.0-alpha.14
|
||||
- @blitzjs/next@2.0.0-alpha.14
|
||||
- @blitzjs/rpc@2.0.0-alpha.14
|
||||
- @blitzjs/config@2.0.0-alpha.14
|
||||
|
||||
## 1.0.1-alpha.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- blitz@2.0.0-alpha.13
|
||||
- @blitzjs/next@2.0.0-alpha.13
|
||||
- @blitzjs/auth@2.0.0-alpha.13
|
||||
- @blitzjs/rpc@2.0.0-alpha.13
|
||||
- @blitzjs/config@2.0.0-alpha.13
|
||||
|
||||
## 1.0.1-alpha.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- blitz@2.0.0-alpha.12
|
||||
- @blitzjs/auth@2.0.0-alpha.12
|
||||
- @blitzjs/next@2.0.0-alpha.12
|
||||
- @blitzjs/rpc@2.0.0-alpha.12
|
||||
- @blitzjs/config@2.0.0-alpha.12
|
||||
|
||||
## 1.0.1-alpha.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @blitzjs/next@2.0.0-alpha.11
|
||||
- @blitzjs/auth@2.0.0-alpha.11
|
||||
- @blitzjs/rpc@2.0.0-alpha.11
|
||||
- @blitzjs/config@2.0.0-alpha.11
|
||||
- blitz@2.0.0-alpha.11
|
||||
|
||||
## 1.0.1-alpha.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.10
|
||||
- @blitzjs/auth@2.0.0-alpha.10
|
||||
- @blitzjs/next@2.0.0-alpha.10
|
||||
- @blitzjs/rpc@2.0.0-alpha.10
|
||||
- @blitzjs/config@2.0.0-alpha.10
|
||||
|
||||
## 1.0.1-alpha.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- blitz@2.0.0-alpha.9
|
||||
- @blitzjs/auth@2.0.0-alpha.9
|
||||
- @blitzjs/next@2.0.0-alpha.9
|
||||
- @blitzjs/rpc@2.0.0-alpha.9
|
||||
- @blitzjs/config@2.0.0-alpha.9
|
||||
|
||||
## 1.0.1-alpha.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- blitz@2.0.0-alpha.8
|
||||
- @blitzjs/auth@2.0.0-alpha.8
|
||||
- @blitzjs/next@2.0.0-alpha.8
|
||||
- @blitzjs/rpc@2.0.0-alpha.8
|
||||
- @blitzjs/config@2.0.0-alpha.8
|
||||
|
||||
## 1.0.1-alpha.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Form, FORM_ERROR } from "app/core/components/Form"
|
||||
import login from "app/auth/mutations/login"
|
||||
import { Login } from "app/auth/validations"
|
||||
import { useMutation } from "@blitzjs/rpc"
|
||||
import { Routes } from "@blitzjs/next"
|
||||
|
||||
type LoginFormProps = {
|
||||
onSuccess?: (user: PromiseReturnType<typeof login>) => void
|
||||
@@ -39,7 +40,7 @@ export const LoginForm = (props: LoginFormProps) => {
|
||||
<LabeledTextField name="email" label="Email" placeholder="Email" />
|
||||
<LabeledTextField name="password" label="Password" placeholder="Password" type="password" />
|
||||
<div>
|
||||
<Link href="/auth/forgot-password" passHref>
|
||||
<Link href={Routes.ForgotPasswordPage()} passHref>
|
||||
<a>Forgot your password?</a>
|
||||
</Link>
|
||||
</div>
|
||||
@@ -47,7 +48,7 @@ export const LoginForm = (props: LoginFormProps) => {
|
||||
|
||||
<div style={{ marginTop: "1rem" }}>
|
||||
Or{" "}
|
||||
<Link href="/auth/signup" passHref>
|
||||
<Link href={Routes.SignupPage()} passHref>
|
||||
<a>Sign Up</a>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NotFoundError } from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { authenticateUser } from "./login"
|
||||
import { ChangePassword } from "../validations"
|
||||
import { resolver } from "@blitzjs/rpc"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { generateToken, hash256 } from "@blitzjs/auth"
|
||||
import { resolver } from "@blitzjs/rpc"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { forgotPasswordMailer } from "mailers/forgotPasswordMailer"
|
||||
import { ForgotPassword } from "../validations"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SecurePassword } from "@blitzjs/auth"
|
||||
import { resolver } from "@blitzjs/rpc"
|
||||
import { AuthenticationError } from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { Role } from "types"
|
||||
import { Login } from "../validations"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SecurePassword, hash256 } from "@blitzjs/auth"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { ResetPassword } from "../validations"
|
||||
import login from "./login"
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { SecurePassword } from "@blitzjs/auth"
|
||||
import { Role } from "types"
|
||||
|
||||
export default async function signup(input, ctx) {
|
||||
const blitzContext = ctx
|
||||
@@ -13,6 +14,7 @@ export default async function signup(input, ctx) {
|
||||
|
||||
await blitzContext.session.$create({
|
||||
userId: user.id,
|
||||
role: user.role as Role,
|
||||
})
|
||||
|
||||
return { userId: blitzContext.session.userId, ...user, email: input.email }
|
||||
|
||||
@@ -7,12 +7,6 @@ export const { withBlitz } = setupBlitzClient({
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "web-cookie-prefix",
|
||||
}),
|
||||
BlitzRpcPlugin({
|
||||
reactQueryOptions: {
|
||||
queries: {
|
||||
staleTime: 7000,
|
||||
},
|
||||
},
|
||||
}),
|
||||
BlitzRpcPlugin({}),
|
||||
],
|
||||
})
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { setupBlitzServer } from "@blitzjs/next"
|
||||
import { AuthServerPlugin, PrismaStorage } from "@blitzjs/auth"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { simpleRolesIsAuthorized } from "@blitzjs/auth"
|
||||
|
||||
const { gSSP, gSP, api } = setupBlitzServer({
|
||||
plugins: [
|
||||
AuthServerPlugin({
|
||||
cookiePrefix: "web-cookie-prefix",
|
||||
// TODO fix type
|
||||
storage: PrismaStorage(db as any),
|
||||
storage: PrismaStorage(db),
|
||||
isAuthorized: simpleRolesIsAuthorized,
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Ctx } from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
|
||||
export default async function getCurrentUser(_ = null, { session }: Ctx) {
|
||||
if (!session.userId) return null
|
||||
|
||||
@@ -5,4 +5,4 @@ const EnhancedPrisma = enhancePrisma(PrismaClient)
|
||||
|
||||
export * from "@prisma/client"
|
||||
const db = new EnhancedPrisma()
|
||||
export { db }
|
||||
export default db
|
||||
|
||||
47
apps/toolkit-app/db/migrations/20220427214932_/migration.sql
Normal file
47
apps/toolkit-app/db/migrations/20220427214932_/migration.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "User" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
"name" TEXT,
|
||||
"email" TEXT NOT NULL,
|
||||
"hashedPassword" TEXT,
|
||||
"role" TEXT NOT NULL DEFAULT 'USER'
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Session" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
"expiresAt" DATETIME,
|
||||
"handle" TEXT NOT NULL,
|
||||
"hashedSessionToken" TEXT,
|
||||
"antiCSRFToken" TEXT,
|
||||
"publicData" TEXT,
|
||||
"privateData" TEXT,
|
||||
"userId" INTEGER,
|
||||
CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE SET NULL ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Token" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
"hashedToken" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"expiresAt" DATETIME NOT NULL,
|
||||
"sentTo" TEXT NOT NULL,
|
||||
"userId" INTEGER NOT NULL,
|
||||
CONSTRAINT "Token_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Session_handle_key" ON "Session"("handle");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Token_hashedToken_type_key" ON "Token"("hashedToken", "type");
|
||||
@@ -1,4 +1,4 @@
|
||||
// import db from "./index"
|
||||
import db from "./index"
|
||||
|
||||
/*
|
||||
* This seed function is executed when you run `blitz db seed`.
|
||||
@@ -7,9 +7,15 @@
|
||||
* to easily generate realistic data.
|
||||
*/
|
||||
const seed = async () => {
|
||||
// for (let i = 0; i < 5; i++) {
|
||||
// await db.project.create({ data: { name: "Project " + i } })
|
||||
// }
|
||||
await db.$reset()
|
||||
|
||||
for (let i = 0; i < 1; i++) {
|
||||
await db.user.create({
|
||||
data: {
|
||||
email: "test@test.com",
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default seed
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "toolkit-app",
|
||||
"version": "1.0.1-alpha.2",
|
||||
"version": "1.0.1-alpha.16",
|
||||
"scripts": {
|
||||
"start:dev": "pnpm run prisma:start && next dev",
|
||||
"buildapp": "prisma generate && next build",
|
||||
"buildapp": "NODE_ENV=production pnpm blitz codegen && pnpm prisma generate && next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"prisma:start": "prisma generate && prisma migrate deploy",
|
||||
@@ -29,14 +29,14 @@
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@hookform/resolvers": "2.8.8",
|
||||
"@prisma/client": "3.9.0",
|
||||
"blitz": "workspace:2.0.0-alpha.7",
|
||||
"next": "12.1.1",
|
||||
"prisma": "3.9.0",
|
||||
"blitz": "workspace:2.0.0-alpha.53",
|
||||
"next": "12.2.0",
|
||||
"prisma": "4.0.0",
|
||||
"react": "18.0.0",
|
||||
"react-dom": "18.0.0",
|
||||
"react-hook-form": "7.29.0",
|
||||
"ts-node": "10.7.0",
|
||||
"zod": "3.10.1"
|
||||
"zod": "3.17.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
@@ -45,7 +45,7 @@
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/node": "17.0.16",
|
||||
"@types/preview-email": "2.0.1",
|
||||
"@types/react": "17.0.43",
|
||||
"@types/react": "18.0.1",
|
||||
"eslint": "7.32.0",
|
||||
"husky": "7.0.4",
|
||||
"jest": "27.5.1",
|
||||
|
||||
20
apps/toolkit-app/pages/404.tsx
Normal file
20
apps/toolkit-app/pages/404.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import Head from "next/head"
|
||||
import { ErrorComponent } from "@blitzjs/next"
|
||||
|
||||
// ------------------------------------------------------
|
||||
// This page is rendered if a route match is not found
|
||||
// ------------------------------------------------------
|
||||
export default function Page404() {
|
||||
const statusCode = 404
|
||||
const title = "This page could not be found"
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>
|
||||
{statusCode}: {title}
|
||||
</title>
|
||||
</Head>
|
||||
<ErrorComponent statusCode={statusCode} title={title} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import { ErrorFallbackProps, ErrorComponent, ErrorBoundary } from "@blitzjs/next"
|
||||
import { ErrorFallbackProps, ErrorComponent, ErrorBoundary, AppProps } from "@blitzjs/next"
|
||||
import { AuthenticationError, AuthorizationError } from "blitz"
|
||||
import type { AppProps } from "next/app"
|
||||
import React, { Suspense } from "react"
|
||||
import React from "react"
|
||||
import { withBlitz } from "app/blitz-client"
|
||||
|
||||
function RootErrorFallback({ error }: ErrorFallbackProps) {
|
||||
@@ -27,9 +26,7 @@ function RootErrorFallback({ error }: ErrorFallbackProps) {
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<ErrorBoundary FallbackComponent={RootErrorFallback}>
|
||||
<Suspense fallback="Loading...">
|
||||
<Component {...pageProps} />
|
||||
</Suspense>
|
||||
<Component {...pageProps} />
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
||||
|
||||
22
apps/toolkit-app/pages/_document.tsx
Normal file
22
apps/toolkit-app/pages/_document.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import Document, { Html, Main, NextScript, Head } from "next/document"
|
||||
|
||||
class MyDocument extends Document {
|
||||
// Only uncomment if you need to customize this behaviour
|
||||
// static async getInitialProps(ctx: DocumentContext) {
|
||||
// const initialProps = await Document.getInitialProps(ctx)
|
||||
// return {...initialProps}
|
||||
// }
|
||||
render() {
|
||||
return (
|
||||
<Html lang="en">
|
||||
<Head />
|
||||
<body>
|
||||
<Main />
|
||||
<NextScript />
|
||||
</body>
|
||||
</Html>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default MyDocument
|
||||
@@ -1,13 +1,14 @@
|
||||
import { useRouter } from "next/router"
|
||||
import Layout from "app/core/layouts/Layout"
|
||||
import { SignupForm } from "app/auth/components/SignupForm"
|
||||
import { Routes } from "@blitzjs/next"
|
||||
|
||||
const SignupPage = () => {
|
||||
const router = useRouter()
|
||||
|
||||
return (
|
||||
<Layout title="Sign Up">
|
||||
<SignupForm onSuccess={() => router.push("/")} />
|
||||
<SignupForm onSuccess={() => router.push(Routes.Home())} />
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { useCurrentUser } from "app/core/hooks/useCurrentUser"
|
||||
import logout from "app/auth/mutations/logout"
|
||||
import logo from "public/logo.png"
|
||||
import { useMutation } from "@blitzjs/rpc"
|
||||
import { Routes } from "@blitzjs/next"
|
||||
|
||||
/*
|
||||
* This file is just for a pleasant getting started page for your new app.
|
||||
@@ -37,12 +38,12 @@ const UserInfo = () => {
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Link href="/auth/signup" passHref>
|
||||
<Link href={Routes.SignupPage()} passHref>
|
||||
<a className="button small">
|
||||
<strong>Sign Up</strong>
|
||||
</a>
|
||||
</Link>
|
||||
<Link href="/auth/login" passHref>
|
||||
<Link href={Routes.LoginPage()} passHref>
|
||||
<a className="button small">
|
||||
<strong>Login</strong>
|
||||
</a>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"baseUrl": "./",
|
||||
"baseUrl": ".",
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": false,
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import {setupBlitzServer} from "@blitzjs/next"
|
||||
import {AuthServerPlugin, PrismaStorage} from "@blitzjs/auth"
|
||||
import {prisma as db} from "../prisma/index"
|
||||
import db from "db"
|
||||
import {simpleRolesIsAuthorized} from "@blitzjs/auth"
|
||||
|
||||
const {gSSP, gSP, api} = setupBlitzServer({
|
||||
plugins: [
|
||||
AuthServerPlugin({
|
||||
cookiePrefix: "webapp-cookie-prefix",
|
||||
// TODO fix type
|
||||
storage: PrismaStorage(db as any),
|
||||
storage: PrismaStorage(db),
|
||||
isAuthorized: simpleRolesIsAuthorized,
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {Ctx} from "blitz"
|
||||
import {prisma} from "../../prisma"
|
||||
import {User} from "prisma"
|
||||
import db, {User} from "db"
|
||||
|
||||
export default async function createUser(
|
||||
input: {name: string; email: string},
|
||||
@@ -8,7 +7,7 @@ export default async function createUser(
|
||||
): Promise<User> {
|
||||
ctx.session.$authorize()
|
||||
|
||||
const user = await prisma.user.create({data: {name: input.name, email: input.email}})
|
||||
const user = await db.user.create({data: {name: input.name, email: input.email}})
|
||||
|
||||
return user
|
||||
}
|
||||
|
||||
27
apps/web/app/queries/getInfiniteUsers.ts
Normal file
27
apps/web/app/queries/getInfiniteUsers.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import {resolver} from "@blitzjs/rpc"
|
||||
import {paginate} from "blitz"
|
||||
import db, {Prisma} from "db"
|
||||
|
||||
interface GetUsersInput
|
||||
extends Pick<Prisma.UserFindManyArgs, "where" | "orderBy" | "skip" | "take"> {}
|
||||
|
||||
export default resolver.pipe(async ({where, orderBy, skip = 0, take = 100}: GetUsersInput) => {
|
||||
const {
|
||||
items: users,
|
||||
hasMore,
|
||||
nextPage,
|
||||
count,
|
||||
} = await paginate({
|
||||
skip,
|
||||
take,
|
||||
count: () => db.user.count({where}),
|
||||
query: (paginateArgs) => db.user.findMany({...paginateArgs, where, orderBy}),
|
||||
})
|
||||
|
||||
return {
|
||||
users,
|
||||
nextPage,
|
||||
hasMore,
|
||||
count,
|
||||
}
|
||||
})
|
||||
@@ -1,11 +1,10 @@
|
||||
import {Ctx} from "blitz"
|
||||
import {prisma} from "../../prisma"
|
||||
import {User} from "prisma"
|
||||
import db, {User} from "db"
|
||||
|
||||
export default async function getUsers(_input: {}, ctx: Ctx): Promise<User[]> {
|
||||
ctx.session.$authorize()
|
||||
|
||||
const users = await prisma.user.findMany()
|
||||
const users = await db.user.findMany()
|
||||
|
||||
return users
|
||||
}
|
||||
|
||||
8
apps/web/app/queries/getUsersAuth.ts
Normal file
8
apps/web/app/queries/getUsersAuth.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import {resolver} from "@blitzjs/rpc"
|
||||
import db from "db"
|
||||
|
||||
export default resolver.pipe(resolver.authorize(), async () => {
|
||||
const users = await db.user.findMany()
|
||||
|
||||
return users
|
||||
})
|
||||
@@ -5,4 +5,4 @@ const EnhancedPrisma = enhancePrisma(PrismaClient)
|
||||
|
||||
export * from "@prisma/client"
|
||||
const prisma = new EnhancedPrisma()
|
||||
export {prisma}
|
||||
export default prisma
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user