Compare commits
140 Commits
@blitzjs/a
...
blitz@2.0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99b054a44a | ||
|
|
54db8a46dd | ||
|
|
6125eb7837 | ||
|
|
62bf12b5c6 | ||
|
|
8e4580a446 | ||
|
|
f52ca398ee | ||
|
|
922bc276d9 | ||
|
|
365e67094c | ||
|
|
31d7a6f413 | ||
|
|
8726b16bb9 | ||
|
|
240f378b54 | ||
|
|
d6655f0178 | ||
|
|
001c174cbf | ||
|
|
1d863f352a | ||
|
|
a36110171a | ||
|
|
37b5e35e22 | ||
|
|
3b213a35b0 | ||
|
|
809f6019be | ||
|
|
a51b1e85e1 | ||
|
|
a948dbb7b8 | ||
|
|
4b91c429ca | ||
|
|
6ab9db7802 | ||
|
|
d3e6b02ad4 | ||
|
|
813365da61 | ||
|
|
6559c25f71 | ||
|
|
83b355900b | ||
|
|
c721c104db | ||
|
|
7e538ba451 | ||
|
|
8e00605a86 | ||
|
|
dcdcd04055 | ||
|
|
e339e2fd0a | ||
|
|
37e1ec4abc | ||
|
|
718a194891 | ||
|
|
0f18c68d63 | ||
|
|
3511d5b69b | ||
|
|
716e188d13 | ||
|
|
57a53fa3c2 | ||
|
|
abb1ad5d1c | ||
|
|
7096083038 | ||
|
|
0ac6e17122 | ||
|
|
8bcb471a53 | ||
|
|
abe2afccdf | ||
|
|
d9fc5d8e26 | ||
|
|
3f20a47405 | ||
|
|
72addbbeed | ||
|
|
1c809094fd | ||
|
|
54a66a95dc | ||
|
|
8d9ea00e1d | ||
|
|
ab4d9de70f | ||
|
|
8f166a5db0 | ||
|
|
df7cee84ad | ||
|
|
b364af7f57 | ||
|
|
20fc9f80f4 | ||
|
|
80e1ead7cb | ||
|
|
a3bbe6ce3f | ||
|
|
348fd6f5e4 | ||
|
|
cacb65d633 | ||
|
|
f397cc2036 | ||
|
|
ffa7b5ccc2 | ||
|
|
a961aff881 | ||
|
|
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 |
@@ -970,7 +970,8 @@
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/3496193?v=4",
|
||||
"profile": "https://twitter.com/dillonraphael",
|
||||
"contributions": [
|
||||
"code"
|
||||
"code",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -3590,6 +3591,54 @@
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "saadaltabari",
|
||||
"name": "saadaltabari",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/29986512?v=4",
|
||||
"profile": "https://github.com/saadaltabari",
|
||||
"contributions": [
|
||||
"doc",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "iojcde",
|
||||
"name": "Jeeho Ahn",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/31413538?v=4",
|
||||
"profile": "https://github.com/iojcde",
|
||||
"contributions": [
|
||||
"doc",
|
||||
"tool",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ryanwashburne",
|
||||
"name": "Ryan Washburne",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/12566087?v=4",
|
||||
"profile": "https://linkedin.com/in/ryanwashburne",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "sherryxiao1988",
|
||||
"name": "Shundan Xiao",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1202426?v=4",
|
||||
"profile": "https://github.com/sherryxiao1988",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tommywong-dev",
|
||||
"name": "tommywong-dev",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/79971095?v=4",
|
||||
"profile": "https://github.com/tommywong-dev",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
||||
6
.changeset/breezy-moose-behave.md
Normal file
6
.changeset/breezy-moose-behave.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"blitz": minor
|
||||
"@blitzjs/auth": patch
|
||||
---
|
||||
|
||||
Truncate errors from `api/auth/<strategy>/callback` request to 100 characters before passing them to the `?authError=` query parameter
|
||||
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
|
||||
5
.changeset/calm-carpets-deny.md
Normal file
5
.changeset/calm-carpets-deny.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fixes the db seed command so that the database can disconnect after running the seed file.
|
||||
5
.changeset/calm-nails-wait.md
Normal file
5
.changeset/calm-nails-wait.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
These are various changes to will make the codemod more dynamic and work with a larger variety of codebases. These fixes are implemented to make the codemod work with flightdeck.
|
||||
5
.changeset/clean-walls-wink.md
Normal file
5
.changeset/clean-walls-wink.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Pass `signal` from useQuery to Blitz internal rpc client to be able to cancel queries on unmount
|
||||
5
.changeset/cool-horses-check.md
Normal file
5
.changeset/cool-horses-check.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fixes issue when generating a new blitz app with the form flag that ends up installing the wrong form library
|
||||
5
.changeset/curly-seas-serve.md
Normal file
5
.changeset/curly-seas-serve.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Check for new versions when running CLI
|
||||
5
.changeset/dirty-planets-chew.md
Normal file
5
.changeset/dirty-planets-chew.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
---
|
||||
|
||||
Update `deleteSession` return type — allow undefined values
|
||||
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-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
|
||||
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-sheep-judge.md
Normal file
5
.changeset/four-sheep-judge.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Export router-context from browser entrypoint
|
||||
5
.changeset/fuzzy-bees-warn.md
Normal file
5
.changeset/fuzzy-bees-warn.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix APP_ENV not being set before loading env config
|
||||
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-apes-drum.md
Normal file
5
.changeset/good-apes-drum.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fixes wrong import of the db module in `blitz db seed` command function
|
||||
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/gorgeous-buses-scream.md
Normal file
5
.changeset/gorgeous-buses-scream.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Allow prefetching multiple queries in gSSP and gSP
|
||||
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/happy-hotels-visit.md
Normal file
5
.changeset/happy-hotels-visit.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Add missing value to "skip" option when choosing a package manager during new app scaffolding
|
||||
5
.changeset/heavy-apes-judge.md
Normal file
5
.changeset/heavy-apes-judge.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Show all blitz packages when running `blitz version` command
|
||||
5
.changeset/hot-cups-rhyme.md
Normal file
5
.changeset/hot-cups-rhyme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix blitz codegen to work with monorepos
|
||||
5
.changeset/hungry-baboons-swim.md
Normal file
5
.changeset/hungry-baboons-swim.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Improve codemod utilities
|
||||
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/lemon-seas-push.md
Normal file
5
.changeset/lemon-seas-push.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Don't try to copy RPC API endpoint in templates that don't have it
|
||||
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
|
||||
10
.changeset/mean-gorillas-reply.md
Normal file
10
.changeset/mean-gorillas-reply.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix a long-standing issue with occasional blitz auth flakiness
|
||||
|
||||
This bug would sometimes cause users to be logged out or to experience an CSRFTokenMismatchError. This bug, when encountered, usually by lots of setPublicData or session.create calls, would not set the cookie headers correctly resulting in cookies being set to a previous state or in a possibly undefined state.
|
||||
|
||||
There are no security concerns as far as I can tell.
|
||||
5
.changeset/modern-ligers-behave.md
Normal file
5
.changeset/modern-ligers-behave.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Add hoist pattern entry for react-query in new app templates
|
||||
6
.changeset/moody-bags-walk.md
Normal file
6
.changeset/moody-bags-walk.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix redirectAuthenticatedTo errors
|
||||
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
|
||||
7
.changeset/nine-birds-confess.md
Normal file
7
.changeset/nine-birds-confess.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/rpc": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix SSP / SP not prefetching queries correctly
|
||||
5
.changeset/ninety-lies-press.md
Normal file
5
.changeset/ninety-lies-press.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Temporarily skip version check
|
||||
5
.changeset/olive-sheep-rhyme.md
Normal file
5
.changeset/olive-sheep-rhyme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Add missing lint deps to the new app templates
|
||||
5
.changeset/perfect-eyes-repeat.md
Normal file
5
.changeset/perfect-eyes-repeat.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Fix pipe resolver return type
|
||||
5
.changeset/polite-lizards-love.md
Normal file
5
.changeset/polite-lizards-love.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Passes the correct arguments (without flags) to any bin command ran with the blitz cli
|
||||
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
|
||||
@@ -17,53 +17,121 @@
|
||||
"toolkit-app": "1.0.0",
|
||||
"test-qm": "0.0.0",
|
||||
"test-no-suspense": "0.0.0",
|
||||
"test-trailing-slash": "0.0.0"
|
||||
"test-trailing-slash": "0.0.0",
|
||||
"test-middleware": "0.0.0"
|
||||
},
|
||||
"changesets": [
|
||||
"big-phones-bow",
|
||||
"breezy-cameras-double",
|
||||
"breezy-moose-behave",
|
||||
"bright-mangos-run",
|
||||
"calm-carpets-deny",
|
||||
"calm-nails-wait",
|
||||
"clean-walls-wink",
|
||||
"cool-doors-invent",
|
||||
"cool-horses-check",
|
||||
"curly-seas-serve",
|
||||
"dirty-monkeys-greet",
|
||||
"dirty-planets-chew",
|
||||
"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",
|
||||
"four-sheep-judge",
|
||||
"fuzzy-bees-warn",
|
||||
"fuzzy-jars-admire",
|
||||
"gentle-dogs-reply",
|
||||
"good-apes-drum",
|
||||
"good-insects-wink",
|
||||
"gorgeous-buses-scream",
|
||||
"great-months-train",
|
||||
"green-papayas-do",
|
||||
"happy-hotels-visit",
|
||||
"healthy-rice-shout",
|
||||
"heavy-apes-judge",
|
||||
"hot-cups-rhyme",
|
||||
"hot-drinks-approve",
|
||||
"hungry-baboons-swim",
|
||||
"late-steaks-give",
|
||||
"lemon-games-press",
|
||||
"lemon-seas-push",
|
||||
"lovely-colts-share",
|
||||
"lucky-cows-try",
|
||||
"mean-gorillas-reply",
|
||||
"modern-cameras-pull",
|
||||
"modern-ligers-behave",
|
||||
"moody-bags-walk",
|
||||
"moody-squids-cheer",
|
||||
"nervous-beds-travel",
|
||||
"nervous-dolls-rule",
|
||||
"new-coats-turn",
|
||||
"nice-deers-dream",
|
||||
"nice-starfishes-live",
|
||||
"nine-birds-confess",
|
||||
"nine-onions-admire",
|
||||
"ninety-lies-press",
|
||||
"ninety-pets-heal",
|
||||
"olive-bees-buy",
|
||||
"olive-feet-rhyme",
|
||||
"olive-sheep-rhyme",
|
||||
"perfect-eyes-repeat",
|
||||
"plenty-bottles-swim",
|
||||
"polite-lizards-love",
|
||||
"poor-peas-lick",
|
||||
"poor-penguins-look",
|
||||
"poor-shrimps-think",
|
||||
"popular-teachers-pay",
|
||||
"pretty-games-march",
|
||||
"purple-singers-greet",
|
||||
"quick-cycles-confess",
|
||||
"quiet-feet-travel",
|
||||
"quiet-pans-hunt",
|
||||
"quiet-sloths-rule",
|
||||
"rich-chairs-invent",
|
||||
"rich-queens-travel",
|
||||
"sharp-falcons-begin",
|
||||
"shy-olives-hang",
|
||||
"shy-pumpkins-try",
|
||||
"silent-colts-reply",
|
||||
"silly-apricots-share",
|
||||
"six-apricots-kick",
|
||||
"slimy-needles-taste",
|
||||
"slow-walls-poke",
|
||||
"small-socks-confess",
|
||||
"smooth-planets-admire",
|
||||
"smooth-stingrays-drum",
|
||||
"soft-adults-smell",
|
||||
"sour-lemons-hunt",
|
||||
"strong-apes-reply",
|
||||
"stupid-walls-sell",
|
||||
"sweet-kiwis-cross",
|
||||
"swift-drinks-dress",
|
||||
"tall-meals-learn",
|
||||
"tame-keys-reply",
|
||||
"tasty-news-collect",
|
||||
"ten-hairs-listen",
|
||||
"ten-rivers-burn",
|
||||
"tender-pianos-check",
|
||||
"thick-parrots-float",
|
||||
"thirty-countries-build",
|
||||
"tidy-clouds-smoke",
|
||||
"tough-toes-pull",
|
||||
"twelve-lemons-smile",
|
||||
"twenty-beans-pump",
|
||||
"two-carpets-rhyme",
|
||||
"two-kiwis-help",
|
||||
"two-tigers-type",
|
||||
"unlucky-papayas-sleep",
|
||||
"violet-bags-leave",
|
||||
"violet-lions-help",
|
||||
"weak-suns-shave",
|
||||
"wicked-ghosts-cough",
|
||||
"wicked-rings-walk",
|
||||
"wise-frogs-give"
|
||||
]
|
||||
}
|
||||
|
||||
5
.changeset/pretty-games-march.md
Normal file
5
.changeset/pretty-games-march.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Import ErrorComponent as DefaultErrorComponent
|
||||
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/quick-cycles-confess.md
Normal file
5
.changeset/quick-cycles-confess.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
fixes blitz not loading custom server
|
||||
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.
|
||||
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
|
||||
6
.changeset/shy-pumpkins-try.md
Normal file
6
.changeset/shy-pumpkins-try.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Upgrade react-query to v4
|
||||
5
.changeset/silly-apricots-share.md
Normal file
5
.changeset/silly-apricots-share.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Avoid reassigning queryClient in prefetch methods
|
||||
5
.changeset/six-apricots-kick.md
Normal file
5
.changeset/six-apricots-kick.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Infer result type in the `api` handler and allow customizing it
|
||||
6
.changeset/slimy-needles-taste.md
Normal file
6
.changeset/slimy-needles-taste.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Add jest.config.js to newly generated typescript apps
|
||||
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/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/smooth-stingrays-drum.md
Normal file
5
.changeset/smooth-stingrays-drum.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Updates the error messages based on if it's a babel parse error or an unexpected error
|
||||
5
.changeset/soft-adults-smell.md
Normal file
5
.changeset/soft-adults-smell.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
---
|
||||
|
||||
Fix `Page.authenticate` not working for layout components
|
||||
9
.changeset/sour-lemons-hunt.md
Normal file
9
.changeset/sour-lemons-hunt.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix auth issue where session token and publicData cookie were updated unnecessarily, leading to potential user logout
|
||||
|
||||
- Previously, we were updating the session token each time public data changed. This is not needed, and it would cause race condition bugs where a user could be unexpectedly logged out because a request already in flight would not match the new session token.
|
||||
- Previously, we were updating the publicData cookie even when it hadn't changed. This may reduce unnecessary re-renders on the client.
|
||||
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
|
||||
5
.changeset/sweet-kiwis-cross.md
Normal file
5
.changeset/sweet-kiwis-cross.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Fix queries/mutations lookup on Windows
|
||||
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
|
||||
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
|
||||
5
.changeset/tidy-clouds-smoke.md
Normal file
5
.changeset/tidy-clouds-smoke.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix routes manifest showing duplicates for non queries|resolvers reso…
|
||||
5
.changeset/tough-toes-pull.md
Normal file
5
.changeset/tough-toes-pull.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Remove debug console.log
|
||||
5
.changeset/twelve-lemons-smile.md
Normal file
5
.changeset/twelve-lemons-smile.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Fix prefetching multiple queries causes only the last one to be passed to page
|
||||
5
.changeset/two-carpets-rhyme.md
Normal file
5
.changeset/two-carpets-rhyme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
During `blitz new` if project name argument is set to "." change it to current folder name
|
||||
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/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/wicked-rings-walk.md
Normal file
5
.changeset/wicked-rings-walk.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
Set prefix in moduleNameWrapper's options in Blitz's jest configuration
|
||||
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
|
||||
* @beerose @dillonraphael
|
||||
|
||||
packages/generator/templates**/* @flybayer
|
||||
|
||||
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -7,9 +7,15 @@ on:
|
||||
|
||||
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
|
||||
@@ -32,13 +38,21 @@ jobs:
|
||||
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
with:
|
||||
version: 6.32.6
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm install --no-frozen-lockfile
|
||||
- run: pnpm build
|
||||
|
||||
- name: Create Release Pull Request
|
||||
uses: changesets/action@v1
|
||||
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 }}
|
||||
|
||||
1
.npmrc
1
.npmrc
@@ -6,3 +6,4 @@ public-hoist-pattern[]=*types*
|
||||
public-hoist-pattern[]=*eslint*
|
||||
public-hoist-pattern[]=@prettier/plugin-*
|
||||
public-hoist-pattern[]=*prettier-plugin-*
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Contributing
|
||||
|
||||
[Read the Contributing Guide at Blitzjs.com](https://blitzjs.com/docs/contributing)
|
||||
[Read the Contributing Guide at Blitzjs.com](https://alpha.blitzjs.com/docs/contributing)
|
||||
|
||||
## To run tests
|
||||
|
||||
|
||||
55
README.md
55
README.md
@@ -6,7 +6,7 @@
|
||||
<img alt="" src="https://img.shields.io/badge/Join%20our%20community-6700EB.svg?style=for-the-badge&labelColor=000000&logoWidth=20&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQ9SURBVHgB7d3dVdtAEIbhcSpICUoH0IEogQqSVBBSAU4FSSpIOoAORAfQgSghHXzZ1U/YcMD4R9rZmf2ec3y448LyiNf27iLiGIAmPLrweC9Un3DhrzG6EarLNP09nlwJ1SOZ/lQr5N80/S/p2QMVCBf5N17XCfm1Y/rBHqjAG9PPHvBsz+mf9WAP+HLA9M/YA14cOP2payH7jpj+VCtk1wnTP+vj7xCy6cTpn7EHLMLp059iD1iD8eveJbVCNsSLheX1YA/YgOWnf8YeKB3Wmf7Ud6Fy4f/FHmtpxbl3YlC4MJ/Cj0bWdwPnPbARg+L0S54XQHS32WwuxClzd4CM0z9rPfeAuTtA5ulPXYQ7wZ04Y+oOoDD9KZc9YOoOoDj9s4dwFzgXR6w1wIPoOvPWA9buAHEJ173o3gWiy3AnuBUHLEbgmYwvAk1/wuM8vAgexThzbwPDkx7/DHwVXfFOxP2GmsKd4Ab6zPeAyU8CI7AHFmH2BRCBPXAyk18GzUrqAXCTiR4ssyj0VFw/oCU8+e+RZ33AWz6KMaYbIIWxB+JSLs1bsbkeMN0AqakHvoku9oA2sAfqBvbAQdw0QArsgb25aYBUQT3QgT2gB+yBuqGcHij2UCqXDZACe2Anlw2QYg/QAOyBuoE98CL3DZDCuK4/rh/Q7oGL6U+TOvcNkJoijN8X1C48+T+g75eQDrAH/qmqAVJgDwyqaoAUe4AGYA/UDZX3QLUNkEIZPRCd5+6BahsgVUgPROwBTSijB7jpVAvGHriHvmw9wAZ4BpX1ABvgmakHtPcbRuwBTWAPULgAV9D/jKDY9YRvwvgEaurD44uQHvAol7qBW7WKluVtIHiUS7GyvA0s6CiXDnxrpQfsgbqBS7GKk/2jYHCrVlGyfxTMrVo0ALdq1Q3sgSKofh0M9oA61a+D2QM0AHugbmAPqClmSRjK2apVVQ8UsySsoK1aHdgDesCtWnUDeyCrIpeFg1u3sylyWTi3btMA7IG6gT2wuuK3hoE9sKrit4YVslWLPaAN7IG6ocKt2zmY2h4O9sDiTG0PZw/QANy6XTewBxZj9ogYVHy025LMHhEz9cBn0We6B0yfERReBLfhx0/R1YQHPx/QBPbA0VwcEwf2wNFcHBPHHjiem3MC2QPHcXdSaJjA+KfgTPQ8hhfjBzHC40mhlzJ+Xq9lK4a4PCs43AVaGTed5mZq+iOXZwWHi3AnOj2wFWNcnxYe7gTxLtBKHuamP/J+Wnh8a5irB7ZC5Yk9gPX1QuXC+usHWqGyhYvUYR0a7zboUOFCNVhnk0krZAOW7wFOvzXhom2xnEbIHizTA1wEYhWW6YFGyC6c1gOcfg9wfA80Qj7g8B7g9HuCww+haIR8wf49wOn3Cvv9k8tGyC/s7gFOv3fY3QONkH+v9MBWqB7PeqDn9FcIT//kcitUn6kHOu/T/xfWzlQy3dEHhwAAAABJRU5ErkJggg==">
|
||||
</a>
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||
<a aria-label="All Contributors" href="#contributors-"><img alt="" src="https://img.shields.io/badge/all_contributors-381-17BB8A.svg?style=for-the-badge&labelColor=000000"></a>
|
||||
<a aria-label="All Contributors" href="#contributors-"><img alt="" src="https://img.shields.io/badge/all_contributors-386-17BB8A.svg?style=for-the-badge&labelColor=000000"></a>
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||
<a aria-label="License" href="https://github.com/blitz-js/blitz/blob/canary/LICENSE">
|
||||
<img alt="" src="https://img.shields.io/npm/l/blitz.svg?style=for-the-badge&labelColor=000000&color=blue">
|
||||
@@ -19,25 +19,12 @@
|
||||
|
||||
<br>
|
||||
|
||||
<h1 align="center">The Fullstack React Framework</h1>
|
||||
|
||||
<h5 align="center">"Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails</h3>
|
||||
<h3 align="center"><a href="https://blitzjs.com/docs/get-started" target="_blank">Read the Documentation</a></h3>
|
||||
<br>
|
||||
|
||||
“Zero-API” data layer **lets you import server code directly into your React components** instead of having to manually add API endpoints and do client-side fetching and caching.
|
||||
|
||||
New Blitz apps come with **all the boring stuff already set up for you!** Like ESLint, Prettier, Jest, user sign up, log in, and password reset.
|
||||
|
||||
Provides **helpful defaults and conventions** for things like routing, file structure, and authentication while also being extremely flexible.
|
||||
|
||||
<h1 align="center">The Missing Fullstack Toolkit for Next.js</h1>
|
||||
|
||||
<br>
|
||||
|
||||
### Quick Start
|
||||
|
||||
You need Node.js 12 or newer
|
||||
|
||||
#### Install Blitz
|
||||
|
||||
Run `npm install -g blitz` or `yarn global add blitz`
|
||||
@@ -53,37 +40,8 @@ _You can alternatively use [`npx`](https://www.npmjs.com/package/npx)_
|
||||
|
||||
<br><br>
|
||||
|
||||
<a aria-label="Bytes Newsletter" href="https://ui.dev/bytes/?r=blitzjs">
|
||||
<img alt="Bytes Newsletter" src="https://files-8wtskjofb.vercel.app/smarter-16x1.jpg">
|
||||
</a>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
|
||||
|
||||
### The Foundational Principles
|
||||
|
||||
1. Fullstack & Monolithic
|
||||
2. API Not Required
|
||||
3. Convention over Configuration
|
||||
4. Loose Opinions
|
||||
5. Easy to Start, Easy to Scale
|
||||
6. Stability
|
||||
7. Community over Code
|
||||
|
||||
[The Blitz Manifesto](https://blitzjs.com/docs/manifesto) explains these principles in detail.
|
||||
|
||||
<br>
|
||||
|
||||
### What is Blitz Designed For?
|
||||
|
||||
Blitz is designed for tiny to large database-backed applications that have one or more graphical user interfaces.
|
||||
|
||||
While we currently only support web, we are pursuing the dream of a single monolithic application that runs on web and mobile with maximum code sharing and minimal boilerplate.
|
||||
|
||||
<br>
|
||||
|
||||
## Welcome to the Blitz Community 👋
|
||||
|
||||
The Blitz community is warm, safe, diverse, inclusive, and fun! LGBTQ+, women, and minorities are especially welcome. Please read our [Code of Conduct](https://blitzjs.com/docs/code-of-conduct).
|
||||
@@ -379,7 +337,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/jschepmans"><img src="https://avatars2.githubusercontent.com/u/5782977?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Johan Schepmans</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=jschepmans" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://twitter.com/dillonraphael"><img src="https://avatars0.githubusercontent.com/u/3496193?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dillon Raphael</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=dillonraphael" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://twitter.com/dillonraphael"><img src="https://avatars0.githubusercontent.com/u/3496193?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dillon Raphael</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=dillonraphael" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=dillonraphael" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/clgeoio"><img src="https://avatars2.githubusercontent.com/u/37571416?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cody G</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=clgeoio" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=clgeoio" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/madflow"><img src="https://avatars0.githubusercontent.com/u/183248?v=4?s=100" width="100px;" alt=""/><br /><sub><b>madflow</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=madflow" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://twitter.com/nitaking_"><img src="https://avatars2.githubusercontent.com/u/10850034?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Satoshi Nitawaki</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=nitaking" title="Code">💻</a> <a href="#maintenance-nitaking" title="Maintenance">🚧</a> <a href="#question-nitaking" title="Answering Questions">💬</a> <a href="https://github.com/blitz-js/blitz/commits?author=nitaking" title="Documentation">📖</a></td>
|
||||
@@ -741,6 +699,13 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
|
||||
<td align="center"><a href="https://github.com/c-ciobanu"><img src="https://avatars.githubusercontent.com/u/33382714?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cristi Ciobanu</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=c-ciobanu" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://arpitdalal.dev"><img src="https://avatars.githubusercontent.com/u/61059807?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Arpit Dalal</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=arpitdalal" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/robertrisch"><img src="https://avatars.githubusercontent.com/u/73828816?v=4?s=100" width="100px;" alt=""/><br /><sub><b>robertrisch</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=robertrisch" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/saadaltabari"><img src="https://avatars.githubusercontent.com/u/29986512?v=4?s=100" width="100px;" alt=""/><br /><sub><b>saadaltabari</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=saadaltabari" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=saadaltabari" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/iojcde"><img src="https://avatars.githubusercontent.com/u/31413538?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeeho Ahn</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=iojcde" title="Documentation">📖</a> <a href="#tool-iojcde" title="Tools">🔧</a> <a href="https://github.com/blitz-js/blitz/commits?author=iojcde" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://linkedin.com/in/ryanwashburne"><img src="https://avatars.githubusercontent.com/u/12566087?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ryan Washburne</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ryanwashburne" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/sherryxiao1988"><img src="https://avatars.githubusercontent.com/u/1202426?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shundan Xiao</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sherryxiao1988" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/tommywong-dev"><img src="https://avatars.githubusercontent.com/u/79971095?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tommywong-dev</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=tommywong-dev" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
save-exact=true
|
||||
legacy-peer-deps=true
|
||||
|
||||
public-hoist-pattern[]=@tanstack/react-query
|
||||
public-hoist-pattern[]=next
|
||||
public-hoist-pattern[]=secure-password
|
||||
public-hoist-pattern[]=*jest*
|
||||
@@ -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 }
|
||||
|
||||
@@ -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,7 +1,11 @@
|
||||
import React from "react"
|
||||
import Head from "next/head"
|
||||
import React, { FC } from "react"
|
||||
import { BlitzLayout } from "@blitzjs/next"
|
||||
|
||||
const Layout: FC<{ title?: string; children?: React.ReactNode }> = ({ title, children }) => {
|
||||
const Layout: BlitzLayout<{ title?: string; children?: React.ReactNode }> = ({
|
||||
title,
|
||||
children,
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { db } from "./index"
|
||||
import db from "./index"
|
||||
|
||||
/*
|
||||
* This seed function is executed when you run `blitz db seed`.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "toolkit-app",
|
||||
"version": "1.0.1-alpha.16",
|
||||
"scripts": {
|
||||
"start:dev": "pnpm run prisma:start && next dev",
|
||||
"start:dev": "pnpm run prisma:start && blitz dev",
|
||||
"buildapp": "NODE_ENV=production pnpm blitz codegen && pnpm prisma generate && next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
@@ -28,15 +28,15 @@
|
||||
"@blitzjs/next": "workspace:*",
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@hookform/resolvers": "2.8.8",
|
||||
"@prisma/client": "3.9.0",
|
||||
"blitz": "workspace:2.0.0-alpha.33",
|
||||
"next": "12.1.6-canary.17",
|
||||
"prisma": "3.9.0",
|
||||
"@prisma/client": "4.0.0",
|
||||
"blitz": "workspace:2.0.0-alpha.64",
|
||||
"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",
|
||||
@@ -46,7 +46,10 @@
|
||||
"@types/node": "17.0.16",
|
||||
"@types/preview-email": "2.0.1",
|
||||
"@types/react": "18.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.9.1",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-config-next": "12.2.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"husky": "7.0.4",
|
||||
"jest": "27.5.1",
|
||||
"lint-staged": "12.1.7",
|
||||
|
||||
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} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
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
|
||||
8
apps/web/.npmrc
Normal file
8
apps/web/.npmrc
Normal file
@@ -0,0 +1,8 @@
|
||||
save-exact=true
|
||||
legacy-peer-deps=true
|
||||
|
||||
public-hoist-pattern[]=@tanstack/react-query
|
||||
public-hoist-pattern[]=next
|
||||
public-hoist-pattern[]=secure-password
|
||||
public-hoist-pattern[]=*jest*
|
||||
public-hoist-pattern[]=@testing-library/*
|
||||
@@ -7,8 +7,7 @@ const {gSSP, gSP, api} = setupBlitzServer({
|
||||
plugins: [
|
||||
AuthServerPlugin({
|
||||
cookiePrefix: "webapp-cookie-prefix",
|
||||
// TODO fix type
|
||||
storage: PrismaStorage(db as any),
|
||||
storage: PrismaStorage(db),
|
||||
isAuthorized: simpleRolesIsAuthorized,
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
"@blitzjs/config": "workspace:*",
|
||||
"@blitzjs/next": "workspace:*",
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@prisma/client": "3.9.0",
|
||||
"@prisma/client": "4.0.0",
|
||||
"@types/jest": "27.4.1",
|
||||
"@types/passport-twitter": "1.0.37",
|
||||
"blitz": "workspace:*",
|
||||
"jest": "27.5.1",
|
||||
"next": "12.1.6-canary.17",
|
||||
"next": "12.2.0",
|
||||
"passport-mock-strategy": "2.0.0",
|
||||
"passport-twitter": "1.0.4",
|
||||
"prisma": "3.9.0",
|
||||
"prisma": "4.0.0",
|
||||
"react": "18.0.0",
|
||||
"react-dom": "18.0.0",
|
||||
"ts-node": "10.7.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {ErrorFallbackProps, ErrorComponent, ErrorBoundary, AppProps} from "@blitzjs/next"
|
||||
import {AuthenticationError, AuthorizationError} from "blitz"
|
||||
import React from "react"
|
||||
import React, {Suspense} from "react"
|
||||
import {withBlitz} from "app/blitz-client"
|
||||
|
||||
function RootErrorFallback({error}: ErrorFallbackProps) {
|
||||
@@ -26,7 +26,9 @@ function RootErrorFallback({error}: ErrorFallbackProps) {
|
||||
function MyApp({Component, pageProps}: AppProps) {
|
||||
return (
|
||||
<ErrorBoundary FallbackComponent={RootErrorFallback}>
|
||||
<Component {...pageProps} />
|
||||
<Suspense fallback="Loading...">
|
||||
<Component {...pageProps} />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import {setupBlitzServer} from "@blitzjs/next"
|
||||
import {AuthServerPlugin, PrismaStorage} from "@blitzjs/auth"
|
||||
import {simpleRolesIsAuthorized} from "@blitzjs/auth"
|
||||
import {prisma as db} from "../prisma/index"
|
||||
import db from "../prisma/index"
|
||||
|
||||
const {gSSP, gSP, api} = setupBlitzServer({
|
||||
plugins: [
|
||||
AuthServerPlugin({
|
||||
cookiePrefix: "auth-tests-cookie-prefix",
|
||||
storage: PrismaStorage(db as any),
|
||||
storage: PrismaStorage(db),
|
||||
isAuthorized: simpleRolesIsAuthorized,
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
"@blitzjs/auth": "workspace:*",
|
||||
"@blitzjs/config": "workspace:*",
|
||||
"@blitzjs/next": "workspace:*",
|
||||
"@prisma/client": "3.9.0",
|
||||
"@prisma/client": "4.0.0",
|
||||
"blitz": "workspace:*",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "12.1.6-canary.17",
|
||||
"prisma": "3.9.0",
|
||||
"next": "12.2.0",
|
||||
"prisma": "4.0.0",
|
||||
"react": "18.0.0",
|
||||
"react-dom": "18.0.0"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {ErrorFallbackProps, ErrorComponent, ErrorBoundary, AppProps} from "@blitzjs/next"
|
||||
import {AuthenticationError, AuthorizationError} from "blitz"
|
||||
import React from "react"
|
||||
import React, {Suspense} from "react"
|
||||
import {withBlitz} from "../app/blitz-client"
|
||||
|
||||
function RootErrorFallback({error}: ErrorFallbackProps) {
|
||||
@@ -25,9 +25,11 @@ function RootErrorFallback({error}: ErrorFallbackProps) {
|
||||
|
||||
function MyApp({Component, pageProps}: AppProps) {
|
||||
return (
|
||||
<ErrorBoundary FallbackComponent={RootErrorFallback}>
|
||||
<Component {...pageProps} />
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback="Loading...">
|
||||
<ErrorBoundary FallbackComponent={RootErrorFallback}>
|
||||
<Component {...pageProps} />
|
||||
</ErrorBoundary>
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {api} from "../../app/blitz-server"
|
||||
import {prisma} from "../../prisma/index"
|
||||
import prisma from "../../prisma/index"
|
||||
import {SecurePassword} from "@blitzjs/auth"
|
||||
import {Role} from "../../types"
|
||||
|
||||
export const authenticateUser = async (email: string, password: string) => {
|
||||
const user = await prisma.user.findFirst({where: {email}})
|
||||
@@ -26,6 +27,7 @@ export default api(async (req, res, ctx) => {
|
||||
|
||||
await blitzContext.session.$create({
|
||||
userId: user.id,
|
||||
role: user.role as Role,
|
||||
})
|
||||
|
||||
res.status(200).json({email: req.query.email, userId: blitzContext.session.userId})
|
||||
|
||||
@@ -5,4 +5,4 @@ const EnhancedPrisma = enhancePrisma(PrismaClient)
|
||||
|
||||
export * from "@prisma/client"
|
||||
const prisma = new EnhancedPrisma()
|
||||
export {prisma}
|
||||
export default prisma
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {prisma} from "./index"
|
||||
import prisma from "./index"
|
||||
import {SecurePassword} from "@blitzjs/auth"
|
||||
|
||||
const seed = async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"extends": "@blitzjs/config/tsconfig.nextjs.json",
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "types"],
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"react": ["./node_modules/@types/react"]
|
||||
|
||||
15
integration-tests/auth/types.ts
Normal file
15
integration-tests/auth/types.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import {SimpleRolesIsAuthorized} from "@blitzjs/auth"
|
||||
import {User} from "./prisma"
|
||||
|
||||
export type Role = "ADMIN" | "USER"
|
||||
|
||||
declare module "@blitzjs/auth" {
|
||||
export interface Session {
|
||||
isAuthorized: SimpleRolesIsAuthorized<Role>
|
||||
PublicData: {
|
||||
userId: User["id"]
|
||||
role: Role
|
||||
views?: number
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user