1
0
mirror of synced 2026-02-04 12:08:33 -05:00

Compare commits

...

131 Commits

Author SHA1 Message Date
github-actions[bot]
ada5cac7e3 Version Packages (alpha) (#3650)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-08-02 11:02:12 +02:00
Blitz.js Bot
e286bcb3ff (meta) added @datner as contributor 2022-08-02 04:57:42 -04:00
Datner
dd5f51744f Move enchancePrisma to a browser entrypoint (#3609)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-08-02 10:57:37 +02:00
github-actions[bot]
99b054a44a Version Packages (alpha) (#3645)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-01 13:11:24 +02:00
Aleksandra
54db8a46dd Comment out version check until it's fixed & fix missing value in pkg manager options (#3647) 2022-08-01 13:01:56 +02:00
Blitz.js Bot
6125eb7837 (meta) added @tommywong-dev as contributor 2022-08-01 05:08:00 -04:00
Dillon Raphael
62bf12b5c6 Update how cli checks if isInternalBlitzMonorepoDevelopment for codegen (#3644)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-08-01 11:03:19 +02:00
github-actions[bot]
8e4580a446 Version Packages (alpha) (#3642)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-30 21:03:36 +02:00
Fran Zekan
f52ca398ee Upgrade React-Query to V4 (#3557) 2022-07-30 20:59:38 +02:00
github-actions[bot]
922bc276d9 Version Packages (alpha) (#3638)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-29 19:58:38 +02:00
Dillon Raphael
365e67094c Fixes db seed command (#3639)
* require db.default in db runSeed cli command
2022-07-29 19:51:23 +02:00
Dillon Raphael
31d7a6f413 Adds rootDir prefix to tsconfig alias module name mapper (#3634)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-07-29 11:36:43 +02:00
github-actions[bot]
8726b16bb9 Version Packages (alpha) (#3632) 2022-07-28 20:06:17 +02:00
Dillon Raphael
240f378b54 passes the correct arguments to runCommandFromBin in blitz cli index (#3631) 2022-07-28 19:57:08 +02:00
github-actions[bot]
d6655f0178 Version Packages (alpha) (#3630)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dillon Raphael <dillon@creatorsneverdie.com>
2022-07-28 16:23:15 +02:00
Blitz.js Bot
001c174cbf (meta) updated @dillonraphael contributions 2022-07-28 10:18:55 -04:00
Dillon Raphael
1d863f352a Fix APP_ENV not being set before running loadEnvConfig (#3629)
* rearanges the order of setting --env before loading envConfig
2022-07-28 16:16:19 +02:00
Blitz.js Bot
a36110171a (meta) added @sherryxiao1988 as contributor 2022-07-27 13:29:50 -04:00
github-actions[bot]
37b5e35e22 Version Packages (alpha) (#3622)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-27 18:51:31 +02:00
beerose
3b213a35b0 Add missing changesets 2022-07-27 18:46:06 +02:00
Marcus Reinhardt
809f6019be Remove debug print (#3616)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-27 18:44:51 +02:00
Aleksandra
a51b1e85e1 Export router-context from blitz-next (#3621) 2022-07-27 18:23:28 +02:00
Blitz.js Bot
a948dbb7b8 (meta) added @ryanwashburne as contributor 2022-07-27 11:08:20 -04:00
github-actions[bot]
4b91c429ca Version Packages (alpha) (#3588)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-26 17:09:46 +02:00
Aleksandra
6ab9db7802 Infer result type in the api handler (#3610) 2022-07-26 17:04:39 +02:00
Blitz.js Bot
d3e6b02ad4 (meta) updated @iojcde contributions 2022-07-26 05:21:37 -04:00
Jeeho Ahn
813365da61 (meta) add @iojcde as contributor (#3606) 2022-07-26 11:21:32 +02:00
Blitz.js Bot
6559c25f71 (meta) added @saadaltabari as contributor 2022-07-25 09:08:44 -04:00
saadaltabari
83b355900b Truncate error messages in passportAuth redirectUri (#3596)
Co-authored-by: Fran Zekan <zekan.fran369@gmail.com>
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-25 15:08:40 +02:00
Fran Zekan
c721c104db Hook up react-query fetch cancellation (#3590)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-07-25 14:57:42 +02:00
Fran Zekan
7e538ba451 Import ErrorComponent as DefaultErrorComponent (#3589)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-25 11:33:38 +02:00
Dillon Raphael
8e00605a86 Codemod: update the error messages based on if it's a babel parse error or an unexpected error (#3593) 2022-07-25 11:15:28 +02:00
Dillon Raphael
dcdcd04055 Various codemod fixes (#3576)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-22 20:55:33 +02:00
Fran Zekan
e339e2fd0a Hoist up react-query (#3585)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-22 20:35:37 +02:00
Brandon Bayer
37e1ec4abc Update README.md messaging (#3577)
* Update README.md

* Update pnpm lock

Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-22 20:23:02 +02:00
github-actions[bot]
718a194891 Version Packages (alpha) (#3583)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-22 20:06:49 +02:00
Fran Zekan
0f18c68d63 Fix prefetching, again... (#3578)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-07-22 18:08:12 +02:00
Aleksandra
3511d5b69b [temporary fix] skip version check until internal issues are resolved (#3584) 2022-07-22 17:05:40 +02:00
Aleksandra
716e188d13 Fix queries/mutations lookup on Windows (#3581) 2022-07-22 16:16:01 +02:00
github-actions[bot]
57a53fa3c2 Version Packages (alpha) (#3561)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-20 14:34:36 +02:00
Fran Zekan
abb1ad5d1c Don't throw error on a missing app/api folder when running codemod (#3568)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-20 08:26:14 +02:00
Brandon Bayer
7096083038 Update CODEOWNERS 2022-07-19 18:29:15 +02:00
Ante Primorac
0ac6e17122 fix blitz not loading custom server (#3564)
* fix blitz not loading custom server
2022-07-19 00:42:14 +02:00
Brandon Bayer
8bcb471a53 Fix auth issue where session token and publicData cookie were updated unnecessarily, leading to potential user logout (#3556)
* fix auth issue where session token and public data token was updated unnecessarily
2022-07-19 00:19:55 +02:00
Brandon Bayer
abe2afccdf Fix a long-standing issue with occasional blitz auth flakiness (#3554)
* fix cookie set bug
2022-07-19 00:06:38 +02:00
Fran Zekan
d9fc5d8e26 Fix queryClient not working the same in SSP and SP (#3563)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-07-18 17:14:53 +02:00
Aleksandra
3f20a47405 Fix delete session type (#3560) 2022-07-18 12:58:03 +02:00
github-actions[bot]
72addbbeed Version Packages (alpha) (#3540)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-18 11:29:22 +02:00
Fran Zekan
1c809094fd Fix Page.authenticate not working for layout components (#3547)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-18 10:39:07 +02:00
Fran Zekan
54a66a95dc Show all blitz packages when running blitz version command (#3553)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-07-18 10:03:44 +02:00
Fran Zekan
8d9ea00e1d Fix prefetching multiple queries causes only the last one to be passed to page (#3551) 2022-07-17 19:28:45 +02:00
Fran Zekan
ab4d9de70f Don't try to copy RPC API endpoint in templates that don't have it (#3545)
* Don't try to copy RPC API endpoint in templates that don't have it
2022-07-17 18:08:08 +02:00
Fran Zekan
8f166a5db0 Check for new versions when running CLI (#3465)
* Simple function to call new on every cli invocation to update blitz

* Fix printing of how to

* Catch network errors

* Cleanup

* Loop through all locally installed and packages and check if an update is needed

* cache checkForLatestVersion so it runs only on every 24 hours

* make update message pretty

* uncomment shouldUpdate boolean

* run checkLatestVersion on dev command and new

* Dont run in our monorepo + small changes

* Create curly-seas-serve.md

Co-authored-by: Dillon Raphael <dillon@creatorsneverdie.com>
2022-07-17 01:01:52 +02:00
Datner
df7cee84ad fix(blitz-rpc): fix 6th pipe resolver not returning resolved value (#3537)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-07-15 12:18:00 +02:00
github-actions[bot]
b364af7f57 Version Packages (alpha) (#3516)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-14 16:07:20 +02:00
Fran Zekan
20fc9f80f4 Fix SSP / SP not prefetching queries correctly (#3518)
* Fix prefetchQuery getting key for infinite wrong

* Add new webpack loader to transform resolvers server-side to have _routePath and other meta values

* Fix key error when loading dehydrated props

* Add unit-tests for loader-server-resolvers.ts
2022-07-12 14:41:26 +02:00
Aleksandra
80e1ead7cb Create jest.config.js with new app generator (#3532)
* Create jest.config.js with new app generator
2022-07-12 11:44:36 +02:00
Fran Zekan
a3bbe6ce3f Fix routes manifest showing duplicates for non queries|resolvers reso… (#3531)
* Fix routes manifest showing duplicates for non queries|resolvers resolver type

* Simplify resolverType checking
2022-07-12 11:36:59 +02:00
Fran Zekan
348fd6f5e4 Fix redirectAuthenticatedTo errors (#3529)
* Wrap BlitzProvider from next with RouterContext
2022-07-11 21:47:16 +02:00
Dawid Urbaniak
cacb65d633 fix: fix wrong import of the db module in blitz db seed command function (#3526)
* fix: fix wrong import of the db module
2022-07-11 11:35:08 +02:00
Fran Zekan
f397cc2036 Fix switch case fall-through bug in CLI (#3525)
* Fix redundant if

* Fix switch fallthrough cases

* Extract install map to top

* Create cool-horses-check.md

Co-authored-by: Dillon Raphael <dillon@creatorsneverdie.com>
2022-07-11 10:30:03 +02:00
Fran Zekan
ffa7b5ccc2 If project name argument is set to "." change it to current folder name (#3523)
* If project name argument is set to "." change it to current folder name

* Create two-carpets-rhyme.md

Co-authored-by: Dillon Raphael <dillon@creatorsneverdie.com>
2022-07-11 10:22:03 +02:00
Aleksandra
a961aff881 Add missing lint deps (#3515) 2022-07-07 16:45:02 +02:00
github-actions[bot]
ac9c4cebc8 Version Packages (alpha) (#3514)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-07 15:43:57 +02:00
Dillon Raphael
a7e37c58db Export BlitzProvider from blitz-next (#3513)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-07 15:36:52 +02:00
Brandon Bayer
b0d2505a85 Update CODEOWNERS 2022-07-06 23:54:29 +02:00
github-actions[bot]
024cd819e3 Version Packages (alpha) (#3512)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-06 19:25:31 +02:00
Dillon Raphael
12cb7a727d Upgrade Prisma to v4.0.0 (#3511)
* Upgrade Prisma to v4.0.0

* Changeset
2022-07-06 19:21:36 +02:00
github-actions[bot]
923703b661 Version Packages (alpha) (#3510)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-06 18:26:09 +02:00
Dillon Raphael
70f9ae4921 Handle next/dynamic default import in codemod (#3509) 2022-07-06 18:21:45 +02:00
beerose
c738ecacbc Remove --tag option from release script 2022-07-06 17:07:55 +02:00
github-actions[bot]
ad0b087d9f Version Packages (alpha) (#3507)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-06 16:03:29 +02:00
Dillon Raphael
dc694cf1cf remove mounted check from withBlitz (#3504)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-07-06 15:59:18 +02:00
Aleksandra
4c221b655e Tag @blitzjs/rpc and @blitzjs/auth with alpha, update package.json files (#3508) 2022-07-06 13:56:25 +02:00
Aleksandra
c11f0401cf Update Next.js version and addBasePath location (#3506) 2022-07-06 13:14:48 +02:00
github-actions[bot]
830b51d0dc Version Packages (alpha) (#3492)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-04 17:39:14 +02:00
David
bec9512e30 Expand & rename baseResolverPath (#3421)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-07-04 17:35:36 +02:00
Dillon Raphael
1493729d6b forked changesets action 2022-07-04 16:48:30 +02:00
Dillon Raphael
6bb5980da9 revert changesets action version 2022-07-04 15:44:21 +02:00
Dillon Raphael
7310f7171d use forked changesets github action 2022-07-04 15:32:28 +02:00
github-actions[bot]
d855ee3e1d Version Packages (alpha) (#3487)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-04 13:29:42 +02:00
Aleksandra
93851d90ca Handle duplicated imports with Blitz codemod (#3486) 2022-07-04 13:25:44 +02:00
beerose
3ab05b3cda Update pnpm-lock.yaml 2022-07-01 17:07:36 +02:00
github-actions[bot]
bb3dd56f7a Version Packages (alpha) (#3482)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 17:06:10 +02:00
Aleksandra
1d9804a610 remove references to the logging package (#3474) 2022-07-01 17:01:41 +02:00
Aleksandra
0fd1f9c9b1 Revert codemod changes (#3483) 2022-07-01 16:10:28 +02:00
Aleksandra
b86b569d56 Remove as any assertion for the PrismaStorage argument (#3481) 2022-07-01 16:04:58 +02:00
Aleksandra
b405c1e876 Add missing _document and 404 pages to the templates (#3480) 2022-07-01 12:44:37 +02:00
Dillon Raphael
c957828ea6 remove release-drafter 2022-06-30 11:54:31 +02:00
Dillon Raphael
c78e5c4704 set config name in release action 2022-06-30 11:47:58 +02:00
Dillon Raphael
009664e0f5 Merge branch 'main' of github.com:blitz-js/blitz 2022-06-30 11:33:42 +02:00
Dillon Raphael
3110522dca release drafter template 2022-06-30 11:33:32 +02:00
github-actions[bot]
7269ac2bc5 Version Packages (alpha) (#3472)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-30 11:09:25 +02:00
Datner
7a7ce2229e Add middleware integration tests (#3411)
* Set up middleware integration test application

* Add middleware integration test

* Update pnpm lock

Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-06-30 11:05:30 +02:00
Dillon Raphael
10c23d3d20 Merge branch 'main' of github.com:blitz-js/blitz 2022-06-29 13:03:54 +02:00
Dillon Raphael
d93b05d0ac Add github release template 2022-06-29 13:03:41 +02:00
Dillon Raphael
aafdc5b4c4 Codemod: Move middlewares from blitz config to blitz server (#3471)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-06-29 12:52:56 +02:00
Dillon Raphael
37ef42811b Merge branch 'main' of github.com:blitz-js/blitz 2022-06-29 12:24:44 +02:00
Dillon Raphael
34cc29e40c Turn off auto github releases 2022-06-29 12:24:26 +02:00
Fran Zekan
bee19a259d Hook up onError function for rpc server and next (#3460)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-06-29 12:18:22 +02:00
Fran Zekan
9ada0f6661 Allow customizing PreviewData in gSSP (#3461) 2022-06-29 11:42:41 +02:00
Dillon Raphael
425559d360 pnpm install without frozen lockfile for github release action 2022-06-29 10:40:12 +02:00
Dillon Raphael
0411689b1d pnpmlock 2022-06-26 06:28:07 -04:00
github-actions[bot]
0d3514cd27 Version Packages (alpha) (#3464)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-26 06:18:37 -04:00
Dillon Raphael
a9edde6d83 pnpmlock 2022-06-26 06:05:38 -04:00
Dillon Raphael
5c5decbce2 Remove suspense wrapper from withBlitz (#3463)
* remove suspense wrapper

* changeset
2022-06-26 06:02:45 -04:00
beerose
e476beba39 Update pnpm-lock.yaml 2022-06-23 17:00:27 +02:00
github-actions[bot]
1a1b23a7e8 Version Packages (alpha) (#3459)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-23 16:59:54 +02:00
Fran Zekan
ae0b714f69 Expanding types for GetServerSideProps (#3457)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-06-23 16:56:41 +02:00
Aleksandra
7817fe3a85 Add missing RouteUrlObject on Page.authenticate.redirectTo (#3458) 2022-06-23 16:45:27 +02:00
beerose
30bb474abb Update pnpm-lock.yaml 2022-06-23 13:32:30 +02:00
github-actions[bot]
135b30efde Version Packages (alpha) (#3456)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-23 13:31:59 +02:00
Aleksandra
527e48ac3e Fix running bin commands with Blitz CLI (#3455) 2022-06-23 13:29:22 +02:00
beerose
b905270875 Update pnpm-lock.yaml 2022-06-23 12:56:21 +02:00
github-actions[bot]
96ea5291e4 Version Packages (alpha) (#3454)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-23 12:54:23 +02:00
Aleksandra
9c2e7d372c Import useRouter form next/router in useParams.tsx (#3453) 2022-06-23 12:47:01 +02:00
beerose
493d505b24 Update pnpm-lock 2022-06-22 12:12:57 +02:00
github-actions[bot]
09da992bef Version Packages (alpha) (#3450)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-22 12:11:54 +02:00
Dillon Raphael
bbac7906e8 fix codemod for wrapping \_app arrow function and nested pages directory (#3443)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-06-22 10:55:35 +02:00
Dillon Raphael
21ca3a9b02 pnpmlock 2022-06-21 10:27:09 -04:00
github-actions[bot]
32274803d9 Version Packages (alpha) (#3449)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-21 10:25:53 -04:00
Dillon Raphael
9ded8dacba Export useParam & useParams from @blitzjs/next (#3448) 2022-06-21 14:45:29 +02:00
beerose
80ffbeaa4c Update pnpm-lock.yaml 2022-06-19 18:20:49 +02:00
github-actions[bot]
6bde1b07da Version Packages (alpha) (#3445)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-19 18:18:57 +02:00
Datner
b918055bf3 Add aliases for Blitz CLI commands (#3410)
Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-06-19 18:13:43 +02:00
Aleksandra
f9a2971f05 Improve typings in blitz cli package (#3444) 2022-06-19 15:48:27 +02:00
Dillon Raphael
72b08f2269 pnpmlock 2022-06-13 15:45:47 -04:00
github-actions[bot]
2124a4d0c5 Version Packages (alpha) (#3440)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-13 15:41:12 -04:00
Dillon Raphael
8aee25c58a changeset 2022-06-13 15:37:27 -04:00
Dillon Raphael
f1003faf94 update generator template (#3439) 2022-06-13 15:35:38 -04:00
Andreas Asprou
50468a3bb0 Fix duplicate react-query clients (#3431)
* Fix duplicate react-query clients

* fix tests

* add codemod & remove queryClient export from generator templates

Co-authored-by: Dillon Raphael <dillon@creatorsneverdie.com>
2022-06-13 11:07:41 -04:00
219 changed files with 4899 additions and 1649 deletions

View File

@@ -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,64 @@
"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"
]
},
{
"login": "datner",
"name": "Datner",
"avatar_url": "https://avatars.githubusercontent.com/u/22598347?v=4",
"profile": "https://github.com/datner",
"contributions": [
"doc",
"code"
]
}
],
"contributorsPerLine": 7,

View 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

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Fixes the db seed command so that the database can disconnect after running the seed file.

View 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.

View 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

View 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

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Check for new versions when running CLI

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/auth": patch
---
Update `deleteSession` return type — allow undefined values

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Use `useRouter` from next/router in useParams function

View File

@@ -0,0 +1,6 @@
---
"@blitzjs/auth": patch
"@blitzjs/next": patch
---
Add missing RouteUrlObject on Page.authenticate.redirectTo

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Export router-context from browser entrypoint

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Fix APP_ENV not being set before loading env config

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/codemod": patch
---
fix codemod for wrapping \_app arrow function & fix codemod for nested pages directory

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Fixes wrong import of the db module in `blitz db seed` command function

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Allow passing optional type argument for ParamsType in GSSP

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Allow prefetching multiple queries in gSSP and gSP

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Add missing value to "skip" option when choosing a package manager during new app scaffolding

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Show all blitz packages when running `blitz version` command

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Fix blitz codegen to work with monorepos

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Improve codemod utilities

View File

@@ -0,0 +1,6 @@
---
"@blitzjs/next": patch
"@blitzjs/rpc": patch
---
Support RPC error middleware

View File

@@ -0,0 +1,6 @@
---
"@blitzjs/rpc": patch
"@blitzjs/generator": patch
---
Update Next.js version and addBasePath location

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
Don't try to copy RPC API endpoint in templates that don't have it

View 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.

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
Add hoist pattern entry for react-query in new app templates

View File

@@ -0,0 +1,6 @@
---
"@blitzjs/next": patch
"blitz": patch
---
Fix redirectAuthenticatedTo errors

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
useParam & useParams functions now accessible from @blitzjs/next

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/codemod": patch
---
Move middlewares from blitz config to blitz server with codemod

View File

@@ -0,0 +1,6 @@
---
"blitz": patch
"@blitzjs/codemod": patch
---
Handle duplicate imports with Blitz upgrade-legacy codemod

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Export BlitzProvider from @blitzjs/next

View File

@@ -0,0 +1,7 @@
---
"@blitzjs/next": patch
"@blitzjs/rpc": patch
"blitz": patch
---
Fix SSP / SP not prefetching queries correctly

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Temporarily skip version check

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
Add missing lint deps to the new app templates

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": patch
---
Fix pipe resolver return type

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Passes the correct arguments (without flags) to any bin command ran with the blitz cli

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/codemod": patch
---
Handle next/dynamic default import in codemod

View File

@@ -17,59 +17,122 @@
"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-maps-fetch",
"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"
]
}

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/codemod": patch
---
Import ErrorComponent as DefaultErrorComponent

View File

@@ -0,0 +1,7 @@
---
"@blitzjs/rpc": patch
"@blitzjs/codemod": patch
"@blitzjs/generator": patch
---
getQueryClient function & queryClient codemod updates & shared plugin config

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
fixes blitz not loading custom server

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Removes the suspense wrapper from withBlitz since it's not needed

View 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.

View File

@@ -0,0 +1,8 @@
---
"blitz": patch
"@blitzjs/auth": patch
"@blitzjs/next": patch
"@blitzjs/rpc": patch
---
Remove references to the logging package

View File

@@ -0,0 +1,6 @@
---
"@blitzjs/next": patch
"@blitzjs/rpc": patch
---
Upgrade react-query to v4

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Avoid reassigning queryClient in prefetch methods

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Infer result type in the `api` handler and allow customizing it

View File

@@ -0,0 +1,6 @@
---
"@blitzjs/next": patch
"@blitzjs/generator": patch
---
Add jest.config.js to newly generated typescript apps

View 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

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
Add missing \_document.tsx and 404.tsx pages to the new app templates

View 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

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/auth": patch
---
Fix `Page.authenticate` not working for layout components

View 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.

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
Remove as any assertion for the PrismaStorage argument

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": patch
---
Fix queries/mutations lookup on Windows

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
Upgrade Prisma to v4.0.0

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Add aliases for Blitz CLI commands

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Fix `enhancePrisma is undefined` errors by moving the utility function to a browser entrypoint

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Allow customizing PreviewData in gSSP

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Fix routes manifest showing duplicates for non queries|resolvers reso…

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": patch
---
Remove debug console.log

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Fix prefetching multiple queries causes only the last one to be passed to page

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
During `blitz new` if project name argument is set to "." change it to current folder name

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Fix running bin commands with Blitz CLI

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Set prefix in moduleNameWrapper's options in Blitz's jest configuration

2
.github/CODEOWNERS vendored
View File

@@ -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

View File

@@ -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 }}

2
.npmrc
View File

@@ -6,4 +6,4 @@ public-hoist-pattern[]=*types*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=@prettier/plugin-*
public-hoist-pattern[]=*prettier-plugin-*
strict-peer-dependencies=false

View File

@@ -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

View File

@@ -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-387-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,14 @@ 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>
<td align="center"><a href="https://github.com/datner"><img src="https://avatars.githubusercontent.com/u/22598347?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Datner</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=datner" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=datner" title="Code">💻</a></td>
</tr>
</table>

View File

@@ -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*

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 }

View File

@@ -2,7 +2,7 @@ import { AuthClientPlugin } from "@blitzjs/auth"
import { setupBlitzClient } from "@blitzjs/next"
import { BlitzRpcPlugin } from "@blitzjs/rpc"
export const { withBlitz, queryClient } = setupBlitzClient({
export const { withBlitz } = setupBlitzClient({
plugins: [
AuthClientPlugin({
cookiePrefix: "web-cookie-prefix",

View File

@@ -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,
}),
],

View File

@@ -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>

View File

@@ -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

View File

@@ -5,4 +5,4 @@ const EnhancedPrisma = enhancePrisma(PrismaClient)
export * from "@prisma/client"
const db = new EnhancedPrisma()
export { db }
export default db

View File

@@ -1,4 +1,4 @@
import { db } from "./index"
import db from "./index"
/*
* This seed function is executed when you run `blitz db seed`.

View File

@@ -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.37",
"next": "12.1.6-canary.17",
"prisma": "3.9.0",
"@prisma/client": "4.0.0",
"blitz": "workspace:2.0.0-alpha.65",
"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",

View 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} />
</>
)
}

View 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
View 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/*

View File

@@ -2,7 +2,7 @@ import {AuthClientPlugin} from "@blitzjs/auth"
import {setupBlitzClient} from "@blitzjs/next"
import {BlitzRpcPlugin} from "@blitzjs/rpc"
const {withBlitz, queryClient} = setupBlitzClient({
const {withBlitz} = setupBlitzClient({
plugins: [
AuthClientPlugin({
cookiePrefix: "webapp-cookie-prefix",
@@ -17,4 +17,4 @@ const {withBlitz, queryClient} = setupBlitzClient({
],
})
export {withBlitz, queryClient}
export {withBlitz}

View File

@@ -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,
}),
],

View File

@@ -10,7 +10,6 @@ module.exports = withBlitz(
customServer: {
hotReload: false,
},
resolverBasePath: "root",
},
}),
)

View File

@@ -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"

View File

@@ -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>
)
}

View File

@@ -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,
}),
],

View File

@@ -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"
},

View File

@@ -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>
)
}

View File

@@ -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})

View File

@@ -5,4 +5,4 @@ const EnhancedPrisma = enhancePrisma(PrismaClient)
export * from "@prisma/client"
const prisma = new EnhancedPrisma()
export {prisma}
export default prisma

View File

@@ -1,4 +1,4 @@
import {prisma} from "./index"
import prisma from "./index"
import {SecurePassword} from "@blitzjs/auth"
const seed = async () => {

View File

@@ -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"]

View 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
}
}
}

View File

@@ -0,0 +1,2 @@
SESSION_SECRET_KEY=hsdenhJfpLHrGjgdgg3jdF8g2bYD2PaQ
HEADLESS=true

View File

@@ -0,0 +1 @@
module.exports = require("@blitzjs/config/eslint")

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