1
0
mirror of synced 2026-02-03 18:01:02 -05:00

Compare commits

...

205 Commits

Author SHA1 Message Date
Blitz.js Bot
fa6e96731a (meta) updated @iojcde contributions 2022-07-25 08:36:58 -04:00
Blitz.js Bot
f59dfda878 (meta) added @iojcde as contributor 2022-07-22 10:43:55 -04:00
Blitz.js Bot
e15c62a8d8 (meta) added @SerekKiri as contributor 2022-07-20 02:12:31 -04:00
Blitz.js Bot
f97c123ddb (meta) updated @the-bayer contributions 2022-07-14 06:11:38 -04:00
Blitz.js Bot
7fd287f004 (meta) updated @Zeko369 contributions 2022-07-12 08:41:32 -04:00
Blitz.js Bot
f0bbdf561d (meta) added @Trancever as contributor 2022-07-11 05:35:13 -04:00
Brandon Bayer
a9c6bcc63f Update CODEOWNERS 2022-07-05 18:06:07 +02:00
Blitz.js Bot
e1fc695d24 (meta) updated @datner contributions 2022-06-30 05:05:37 -04:00
Blitz.js Bot
525e436b9d (meta) added @sergous as contributor 2022-06-20 07:19:40 -04:00
Blitz.js Bot
a98f972bef (meta) added @remlse as contributor 2022-06-20 06:50:14 -04:00
Blitz.js Bot
1c2fdfee37 (meta) added @datner as contributor 2022-06-19 12:13:48 -04:00
Blitz.js Bot
8102086400 (meta) added @jakedee as contributor 2022-06-19 08:49:58 -04:00
Blitz.js Bot
0366729a95 (meta) updated @andreasasprou contributions 2022-06-13 11:07:46 -04:00
Blitz.js Bot
352d2af366 (meta) added @iDavidB as contributor 2022-06-08 17:50:05 -04:00
Blitz.js Bot
9b8c4039f0 (meta) added @webdeb as contributor 2022-06-07 13:09:03 -04:00
Blitz.js Bot
262b647855 (meta) added @minho42 as contributor 2022-06-07 13:05:48 -04:00
Min ho Kim
03017046f7 Fix typos in docs (#3395)
(ignore)
2022-06-07 10:05:43 -07:00
Blitz.js Bot
28d2671ddb (meta) added @paulm17 as contributor 2022-06-07 13:02:32 -04:00
Blitz.js Bot
86da1612da (meta) added @rmassie as contributor 2022-06-07 12:59:17 -04:00
Blake Bayer
919465c9b6 Add try/catch in change password mutation (#3337)
* Revert "Update change password w/ try/catch"

This reverts commit 186532ef2d.

* Update changePassword.ts

* Update packages/generator/templates/app/app/auth/mutations/changePassword.ts

Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>

* Update changePassword.ts

* Apply suggestions from code review

Co-authored-by: Aleksandra <alexsandra.sikora@gmail.com>
2022-05-10 11:27:13 +02:00
Blitz.js Bot
b84ed74496 (meta) updated @ganeshmani contributions 2022-05-08 08:44:55 -04:00
Blitz.js Bot
dc86c78bd1 (meta) added @the-bayer as contributor 2022-04-29 08:31:27 -04:00
Blake Bayer
45b38cc836 Revert "Update change password w/ try/catch" (#3323)
This reverts commit 186532ef2d.
2022-04-29 14:31:23 +02:00
the-bayer
186532ef2d Update change password w/ try/catch 2022-04-27 11:30:25 -04:00
Blitz.js Bot
77858c5558 (meta) updated @dillonraphael contributions 2022-04-15 08:35:51 -04:00
Aleksandra
e9a98ffe3d bump recipe/example versions (ignore) 2022-04-12 12:46:49 +02:00
Aleksandra
2c06dd6f18 v0.45.4 2022-04-12 12:45:36 +02:00
Aleksandra
881d686233 Upgradereact and @types/react in new app templates, update types (#3282)
(newapp)
2022-04-12 12:38:49 +02:00
Blitz.js Bot
a7deaafbc7 (meta) updated @dillonraphael contributions 2022-04-07 12:46:42 -04:00
Blitz.js Bot
7c698f0b35 (meta) added @Caslus as contributor 2022-04-04 04:45:50 -04:00
Blitz.js Bot
09a8c94392 (meta) added @timfee as contributor 2022-04-04 04:36:59 -04:00
Tim Feeley
35b9ded76e Fix typo in recipe step name (#3265)
(ignore)
2022-04-04 10:36:54 +02:00
Blitz.js Bot
85c10b9d3f (meta) added @davidbarker as contributor 2022-04-04 04:20:49 -04:00
Blitz.js Bot
2675942c58 (meta) added @jscyo as contributor 2022-03-28 05:59:31 -04:00
Aleksandra
b3ad310f6f Add JDLT to sponsors list (#3226)
(meta)
2022-03-10 10:20:09 -05:00
Blitz.js Bot
d41385b592 (meta) added @numanaral as contributor 2022-03-06 14:37:25 -05:00
Husnul Jahneer
dfbab3919d Add @husnuljahneer as L1 Maintainer (#3142)
(meta)
2022-02-28 10:50:13 -05:00
Blitz.js Bot
e5c607164e (meta) added @eai04191 as contributor 2022-02-24 19:20:19 -05:00
John Vandivier
49d1e91a64 don't suggest faker.js in code comments (#3178)
(newapp)
2022-02-23 10:09:58 +01:00
Blitz.js Bot
19ea640705 (meta) added @Lokprakash-babu as contributor 2022-02-23 03:03:14 -05:00
Brandon Bayer
f2d814813f (newapp) change preview-email to just in time import so it doesn't need to be in production deps 2022-02-17 11:29:31 -05:00
dependabot[bot]
f99ebf5f37 Bump superjson from 1.7.5 to 1.8.1 in /nextjs (#3165)
Bumps [superjson](https://github.com/blitz-js/superjson) from 1.7.5 to 1.8.1.
- [Release notes](https://github.com/blitz-js/superjson/releases)
- [Commits](https://github.com/blitz-js/superjson/compare/v1.7.5...v1.8.1)

---
updated-dependencies:
- dependency-name: superjson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-11 12:43:41 +01:00
Aleksandra
ef2c0cdd67 bump recipe/example versions (ignore) 2022-02-09 17:07:08 +01:00
Aleksandra
d658af7407 v0.45.3 2022-02-09 17:05:40 +01:00
Brandon Bayer
0f8f15f31c upgrade superjson (#3162)
(patch)
2022-02-09 10:51:50 -05:00
Brandon Bayer
600467035a fix blitz logging to respect FORCE_COLOR=0 (#3157)
(patch)
2022-02-09 12:40:12 +01:00
Aleksandra Sikora
d25aee1313 Bump @prisma/sdk in installer and cli packages (#3158)
(ignore)
2022-02-08 13:45:33 +01:00
dependabot[bot]
0cc2a3aab7 Bump node-fetch from 2.6.1 to 2.6.7 in /nextjs (#3156)
(ignore)
2022-02-08 11:09:14 +01:00
Mochi
75e6b9fb74 Add NextUI recipe (#3152)
(recipe)
2022-02-07 11:50:50 +01:00
Aleksandra Sikora
6e8a65fa7f Update sponsors list (#3153)
(ignore)
2022-01-28 17:01:24 +01:00
Blitz.js Bot
01dce6b09a (meta) added @ReykCS as contributor 2022-01-26 14:21:20 -05:00
Aleksandra Sikora
ceeed729c6 Remove outdated tests (#3141)
(ignore)
2022-01-24 13:16:40 +01:00
Blitz.js Bot
7f35af5bd2 (meta) added @husnuljahneer as contributor 2022-01-23 08:30:20 -05:00
Blitz.js Bot
c603195004 (meta) added @shellord as contributor 2022-01-21 05:45:44 -05:00
saheenshoukath
bac35e06c8 Add @shellord as L1 maintainer (#3140) 2022-01-21 11:45:39 +01:00
Aleksandra
7add9cad87 bump recipe/example versions (ignore) 2022-01-20 11:41:47 +01:00
Aleksandra
16dae9b081 v0.45.2 2022-01-20 11:40:16 +01:00
Brandon Bayer
9f52f36c18 Fix passport adapter secureProxy to always work regardless of request headers (#3135)
(patch)
2022-01-19 17:29:21 -05:00
Aleksandra
621d87fdb7 bump recipe/example versions (ignore) 2022-01-18 18:28:24 +01:00
Aleksandra
871e709076 v0.45.1 2022-01-18 18:27:00 +01:00
Brandon Bayer
1e3ae5d445 fix passport adapter to work behind cloudfront (#3132)
(patch)
2022-01-18 12:11:23 -05:00
Aleksandra Sikora
a344c1f89e Update Seedling Sponsors list (#3130)
(ignore)
2022-01-17 11:02:34 +01:00
Blitz.js Bot
ee742530d9 (meta) added @Nfinished as contributor 2022-01-10 07:17:38 -05:00
Adam Trager
f102f4c873 Fix useRedirectAuthenticatedSession is not a function (#3117)
(patch)
2022-01-10 13:17:32 +01:00
Aleksandra
eebeeee6b7 bump recipe/example versions (ignore) 2022-01-06 16:27:01 +01:00
Aleksandra
18842fd56f v0.45.0 2022-01-06 16:25:41 +01:00
Blitz.js Bot
ea1e75b355 (meta) added @ospfranco as contributor 2022-01-04 06:59:45 -05:00
Aleksandra Sikora
34ed51a0db Fix blitz g mutation creating a file with invalid name (#3104)
(patch)
2022-01-03 19:24:08 +01:00
Marcus Reinhardt
4ce4bb92bb Add addRunCommandStep to the recipe builder (#3090)
(recipes)
2022-01-03 17:00:05 +01:00
Blitz.js Bot
75ed86eafb (meta) added @maltekiessling as contributor 2022-01-01 15:57:06 -05:00
Blitz.js Bot
a4bcfb4737 (meta) added @dineshgadge as contributor 2021-12-29 13:05:08 -05:00
Dinesh Gadge
bfd3be403e Fix RedirectError not redirecting on the client (#3100)
(patch)
2021-12-29 19:05:03 +01:00
Brandon Bayer
bfd75229c1 bump recipe/example versions (ignore) 2021-12-24 12:54:12 -05:00
Brandon Bayer
91172b82d9 v0.45.0-canary.0 2021-12-24 12:52:42 -05:00
Blitz.js Bot
c9f416713a (meta) added @robertrisch as contributor 2021-12-23 09:24:26 -05:00
Blitz.js Bot
11eb4208e6 (meta) added @arpitdalal as contributor 2021-12-21 17:18:42 -05:00
Aleksandra Sikora
fbd387a30c Update sponsors list (#3089)
(ignore)
2021-12-21 17:44:56 +01:00
Blitz.js Bot
018e2405f2 (meta) added @c-ciobanu as contributor 2021-12-21 07:59:16 -05:00
Blitz.js Bot
c631f1ef15 (meta) added @sarahdayan as contributor 2021-12-20 12:21:38 -05:00
Sarah Dayan
3ce4f97de7 Update links to PostgreSQL guide (#3087)
(meta)
2021-12-20 18:21:33 +01:00
JuanM04
77ad2c02ce Update material-ui recipe — remove @mui/styles (#3076)
(recipe)
2021-12-20 15:19:51 +01:00
Aleksandra Sikora
ecf5a29e19 Support custom templates folder with blitz generate (#3068)
(minor)
2021-12-17 16:42:58 +01:00
Blitz.js Bot
ec8632a3e9 (meta) added @kreako as contributor 2021-12-16 09:11:53 -05:00
Blitz.js Bot
98f91e24c1 (meta) added @SofianeDjellouli as contributor 2021-12-14 05:56:59 -05:00
Blitz.js Bot
49c5a1e1be (meta) updated @zenhob contributions 2021-12-14 05:50:28 -05:00
Francesco Sardo
9a00412049 Fix inconsistent formatting in LoginForm component and Login page (#3063)
(newapp)
2021-12-13 16:48:04 +01:00
John Vandivier
03fd49bb29 Use free tier by default in Render recipe (#3060)
(recipe)
2021-12-13 12:41:13 +01:00
Brandon Bayer
8b607b9463 bump recipe/example versions (ignore) 2021-12-11 17:00:54 -05:00
Brandon Bayer
e3472171a5 v0.44.4 2021-12-11 16:59:28 -05:00
Aleksandra Sikora
5f1c6a4571 Move installer package to nextjs/packages (#3044)
(patch)
2021-12-10 13:26:54 +01:00
Mochi
d05f00c0a8 Update tailwindcss recipe to v3 (#3050)
(recipe)
2021-12-10 12:22:13 +01:00
Aleksandra Sikora
0715bb7a02 Load env vars for blitz new command - ignore cached variables (#3043)
(patch)
2021-12-09 19:30:49 +01:00
JuanM04
00d1ddff0b Set blitz version to latest in new apps templates (#3048)
(newapp)
2021-12-09 15:52:56 +01:00
Blitz.js Bot
0f99de91ae (meta) added @skotchpine as contributor 2021-12-08 13:18:08 -05:00
tyler
9cff223033 Load nested mutations and queries in blitz console (#3031)
(patch)
2021-12-08 19:18:02 +01:00
Aleksandra Sikora
1d6021dd36 Upgrade @mrleebo/prisma-ast version and fix breaking @db.Text (#3041)
(patch)
2021-12-08 18:20:04 +01:00
Aleksandra Sikora
c4df5d8d04 Remove nullish coalescing from post-install script (#3040)
(patch)
2021-12-08 16:25:02 +01:00
Brandon Bayer
9019f1cf27 bump recipe/example versions (ignore) 2021-12-06 18:19:46 -05:00
Brandon Bayer
d92b7efe00 v0.44.3 2021-12-06 18:18:25 -05:00
Brandon Bayer
daea45eeb2 relax some unnecessary type requirements for blitz.config.ts (#3036)
(patch)
2021-12-06 18:17:02 -05:00
Brandon Bayer
8dcc5ebe23 fix blitz build not loading production env by default (#3037)
(patch)
2021-12-06 18:16:41 -05:00
Brandon Bayer
d36138361d bump recipe/example versions (ignore) 2021-12-06 15:56:24 -05:00
Brandon Bayer
831b0d4bcd v0.44.2 2021-12-06 15:55:01 -05:00
Brandon Bayer
5d9fcd22be fix env file loading to default to development instead of production (#3033)
(patch)
2021-12-06 15:52:50 -05:00
Brandon Bayer
1c51ab403b fix so that blitz config env config values can be type string | undefined (#3034)
(patch)
2021-12-06 15:52:09 -05:00
Brandon Bayer
c3c9e89302 bump recipe/example versions (ignore) 2021-12-06 13:05:55 -05:00
Brandon Bayer
e842c9f224 v0.44.1 2021-12-06 13:04:26 -05:00
JuanM04
abeb0c5d14 Fix APP_ENV loading to not load all .env files (#3026)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2021-12-06 13:02:41 -05:00
Brandon Bayer
18d1a685a9 Fix windows incompatibility with nested dependency (#3030)
(patch)
2021-12-06 12:56:48 -05:00
Blitz.js Bot
9255050eee (meta) added @MukulKolpe as contributor 2021-12-06 12:20:37 -05:00
Mukul Kolpe
915f5fa479 Fix next_stdlib__WEBPACK_IMPORTED_MODULE_1__.connectMiddleware is not a function (#3024)
(patch)
2021-12-06 12:20:32 -05:00
Aleksandra Sikora
24dcac6978 Fix jest-preset syntax error (#3027)
(patch)
2021-12-06 11:50:04 -05:00
JuanM04
adef11ba8e Update default app blitz-env.d.ts 2021-12-05 19:45:18 -03:00
Blitz.js Bot
4233caa909 (meta) added @david-arteaga as contributor 2021-12-05 09:47:39 -05:00
Aleksandra
8f5cad91d4 bump recipe/example versions (ignore) 2021-12-03 22:55:11 +01:00
Aleksandra
ac5121beda v0.44.0 2021-12-03 22:53:40 +01:00
Aleksandra Sikora
5460fbb484 Move display package to nextjs fork (#2989)
(meta)
2021-12-03 16:46:55 -05:00
Aleksandra Sikora
ad71e15290 Make prefetching work with usePaginatedQuery and useInfiniteQuery (#3014)
(patch)
2021-12-03 20:54:40 +01:00
Aleksandra Sikora
4aba0d31f6 Load env variables based on APP_ENV or -e flag (#2878)
(minor)
2021-12-03 16:05:37 +01:00
Blitz.js Bot
19ad91709e (meta) added @divpreet as contributor 2021-12-03 08:23:32 -05:00
Blitz.js Bot
74efbad6d0 (meta) added @ajanth97 as contributor 2021-11-27 07:58:45 -05:00
Ilya
0fd6a4d5e3 Support RouteUrlObject as redirect.destination in GetServerSideProps/GetStaticProps (#2932)
(minor)
2021-11-24 14:12:47 +01:00
Blitz.js Bot
1c12da5495 (meta) added @davidchristie as contributor 2021-11-24 04:41:37 -05:00
Aleksandra Sikora
c4c90477c5 Upgrade react to 18-beta in new app templates (#2998)
(newapp)
2021-11-23 14:11:24 +01:00
dependabot[bot]
a9aaeec047 Bump tar from 2.2.2 to 4.4.18 in /nextjs (#2996)
(patch)
2021-11-22 13:33:28 +01:00
JuanM04
8420f6ddb8 Add "volta" settings to package.json and update node-version (#2994)
(meta)
2021-11-22 12:30:12 +01:00
Brandon Bayer
3a1ea75a55 fix missing BlitzConfig type (#2987)
(patch)
2021-11-19 18:11:28 +01:00
Blitz.js Bot
b23c2cdc36 (meta) added @noxify as contributor 2021-11-18 11:44:27 -05:00
Marcus Reinhardt
12c081b830 Add info about a required manual step to graphql-apollo-server recipe (#2905)
(recipe)
2021-11-18 17:44:21 +01:00
Aleksandra Sikora
11492dcfbd Upgrade typescript to 4.5 (#2973)
(newapp)
2021-11-18 15:50:43 +01:00
JuanM04
de874ca20e Fix lint warnings (#2968)
(meta)
2021-11-18 14:00:50 +01:00
Brandon Bayer
92ab9c3867 move blitz babel config into nextjs fork (#2903)
(patch)
2021-11-17 19:19:49 -05:00
Aleksandra
12c1b7331b bump recipe/example versions (ignore) 2021-11-17 17:29:35 +01:00
Aleksandra
c98788425d v0.43.0 2021-11-17 17:28:25 +01:00
Aleksandra Sikora
a279fb90af Update zod validators in new app template (#2971)
(newapp)
2021-11-17 13:06:48 +01:00
Aleksandra Sikora
4f868ad2ac Fix routes manifest location when using pnpm (#2963)
(patch)
2021-11-17 10:52:28 +01:00
Ilya
522da1a3d7 Add --file flag to blitz db seed command (#2962)
(minor)
2021-11-16 16:42:35 +01:00
JuanM04
e767f51182 Install recipes automatically (blitz install --yes) (#2954)
(minor)
2021-11-16 16:08:01 +01:00
JuanM04
3479686f44 Add vanilla-extract recipe (#2946)
(recipe)
2021-11-16 14:29:53 +01:00
Brandon Bayer
fafab00edc Move superjson integration from babel plugin into core (#2939)
(patch)
2021-11-15 22:19:33 -05:00
Aleksandra Sikora
fe7a3c3a85 Disable autoRun for jest extension by default (#2943)
(patch)
2021-11-15 13:44:51 +01:00
Aleksandra Sikora
252c9b11fe Add @damilolarandolph as L1 maintainer (#2953)
(meta)
2021-11-14 15:58:01 +01:00
Blitz.js Bot
9ddc85dbe3 (meta) added @rockmanvnx6 as contributor 2021-11-14 09:48:06 -05:00
JuanM04
ee07fc3b3f Unify recipes Program types and fix blitz install (#2952)
(patch)
2021-11-14 15:47:31 +01:00
JuanM04
18c6981958 @blitzjs/installer improvements (#2887) 2021-11-12 12:37:36 +01:00
Aleksandra Sikora
f85b0efc33 add meetkai as seedling sponsor (#2938)
(meta)
2021-11-11 18:28:21 +01:00
Blitz.js Bot
da8925ab51 (meta) added @coryhouse as contributor 2021-11-11 08:44:43 -05:00
Blitz.js Bot
23f85d6c27 (meta) added @danestves as contributor 2021-11-11 06:04:33 -05:00
Blitz.js Bot
58d566983a (meta) added @basilk76 as contributor 2021-11-10 12:56:35 -05:00
Aleksandra Sikora
6b59d21e2d Fix installing dependencies of styled-components recipe (#2934)
(recipe)
2021-11-10 14:15:57 +01:00
Blitz.js Bot
f2b2e5a414 (meta) added @5minpause as contributor 2021-11-10 07:37:47 -05:00
Blitz.js Bot
862e54b453 (meta) added @netwarex as contributor 2021-11-10 04:46:12 -05:00
Péter Nyári
32983cb454 Add Passenger recipe (#2890)
(recipe)
2021-11-10 10:46:06 +01:00
Blitz.js Bot
47c3c947ef (meta) added @NorfeldtAbtion as contributor 2021-11-09 14:13:41 -05:00
Blitz.js Bot
20e7c16237 (meta) updated @lovethebomb contributions 2021-11-08 12:16:32 -05:00
Blitz.js Bot
c512b7a29e (meta) added @lovethebomb as contributor 2021-11-08 11:53:04 -05:00
Lucas Heymès
5870251839 Add ability to set blitz logging type to json (#2888)
(patch)
2021-11-08 17:52:53 +01:00
Brandon Bayer
457015ae5b bump recipe/example versions (ignore) 2021-11-06 15:19:40 -04:00
Brandon Bayer
a19c480c19 v0.42.4 2021-11-06 15:18:19 -04:00
Brandon Bayer
2f397f0e99 v0.42.3 2021-11-06 14:57:41 -04:00
Brandon Bayer
c081599547 v0.42.2 2021-11-06 14:51:31 -04:00
Brandon Bayer
e3876b387e fix build TypeError: Cannot read property 'children' of undefined (#2924)
(patch)
2021-11-06 14:49:26 -04:00
Brandon Bayer
937e4061d6 bump recipe/example versions (ignore) 2021-11-06 13:15:12 -04:00
Brandon Bayer
3312b4316b v0.42.1 2021-11-06 13:14:15 -04:00
Brandon Bayer
6653f31b27 Fix build error: No QueryClient set (#2914)
(patch)
2021-11-06 13:09:47 -04:00
Blitz.js Bot
e109813b67 (meta) added @thisdotrob as contributor 2021-11-06 12:28:26 -04:00
Brandon Bayer
4384ce0514 (newapp) On login page, pass user to the onSuccess callback (#2919) 2021-11-05 17:32:51 -04:00
Blitz.js Bot
a1d8008cb5 (meta) added @chrisj-back2work as contributor 2021-11-05 13:42:51 -04:00
Blitz.js Bot
919e9f637d (meta) added @lucasvazq as contributor 2021-11-04 06:17:09 -04:00
Lucas Vazquez
d2f2e4b315 Show the error message from prisma generate when blitz codegen fails (#2891)
(patch)
2021-11-04 11:17:02 +01:00
Brandon Bayer
c91de5134e move Blitz eslint config into nextjs fork (#2902)
(meta)
2021-11-03 18:48:58 -04:00
Aleksandra
8fa479a991 bump recipe/example versions (ignore) 2021-11-03 16:37:05 +01:00
Aleksandra
6d93450ae0 v0.42.0 2021-11-03 16:35:08 +01:00
Brandon Bayer
c089980fca bump recipe/example versions (ignore) 2021-11-02 18:59:08 -04:00
Brandon Bayer
f4cf751b96 v0.41.2-canary.5 2021-11-02 18:58:02 -04:00
Brandon Bayer
46b8103b5f fix so middleware errors (like CSRFMissmatchError) don't crash the server (#2901)
(patch)
2021-11-02 18:08:20 -04:00
Brandon Bayer
9fc06a2279 update monorepo browserslist version (#2900)
(meta)
2021-11-02 16:51:24 -04:00
Aleksandra Sikora
731bf5451d Fix using HOCs in _app.js (#2897)
(patch)
2021-11-02 16:07:59 -04:00
Brandon Bayer
e660b7b89d update influxdb telemetry token
(ignore)
2021-11-02 15:23:18 -04:00
Blitz.js Bot
046587d025 (meta) added @devtombiz as contributor 2021-10-29 08:25:44 -04:00
Thomas Brenneur
2dd578a2db Add next-rosetta example (#2872)
(example)
2021-10-29 14:25:39 +02:00
Blitz.js Bot
afd6e3f914 (meta) added @dvnrsn as contributor 2021-10-28 08:06:35 -04:00
Devin Rasmussen
e183fb4afb Export MutateFunction type from blitz/react-query (#2882)
(patch)
2021-10-28 14:06:30 +02:00
Blitz.js Bot
aa008866cc (meta) added @cbejensen as contributor 2021-10-26 18:42:14 -04:00
Aleksandra Sikora
b388a50352 add prompt to blitz new to choose javascript or typescript (#2739) 2021-10-22 11:41:06 +02:00
Simon Knott
fa78180768 Update dehydrated state integration test for Map (#2649)
Co-authored-by: Cody George <cody.george@airtasker.com> (meta)
2021-10-21 18:15:51 -04:00
Blitz.js Bot
f8e9d75afd (meta) added @RobertBroersma as contributor 2021-10-21 12:01:38 -04:00
Aleksandra Sikora
797618e338 Fix blitz generate in javascript projects (#2859)
(patch)
2021-10-21 10:43:24 -04:00
Blitz.js Bot
52d569e47e (meta) added @cj as contributor 2021-10-21 06:45:11 -04:00
CJ Lazell
f85ae04953 Allow setting secureCookies in sessionMiddleware config (#2361)
(patch)
2021-10-21 12:45:05 +02:00
Brandon Bayer
2fc6c07133 bump recipe/example versions (ignore) 2021-10-20 19:33:34 -04:00
Brandon Bayer
feba2b6ea9 v0.41.2-canary.4 2021-10-20 19:32:17 -04:00
Brandon Bayer
51d91c3c9d Remove internal @blitzjs/config package and move @blitzjs/repl into core (meta) (#2860) 2021-10-20 19:30:59 -04:00
Brandon Bayer
a5d3d02275 bump recipe/example versions (ignore) 2021-10-20 18:43:00 -04:00
Brandon Bayer
5fcd1d5b23 v0.41.2-canary.3 2021-10-20 18:42:04 -04:00
Brandon Bayer
a808d3c120 fix broken route manifest in 0.41.2-canary.2 (#2870)
(patch)
2021-10-20 18:40:08 -04:00
Geoffrey
8fc8800088 Add support for async experimental.initServer() (#2798)
Co-authored-by: Brandon Bayer <b@bayer.ws> (minor)
2021-10-20 18:19:39 -04:00
Blitz.js Bot
4d1c997a56 (meta) added @vivek7405 as contributor 2021-10-20 18:13:56 -04:00
Vivek
90d96552be Add bulma recipe (recipe) (#2850)
Co-authored-by: Aleksandra Sikora <alexsandra.sikora@gmail.com>
Co-authored-by: Brandon Bayer <b@bayer.ws>
2021-10-20 18:13:51 -04:00
Blitz.js Bot
7c4e9c81a0 (meta) added @sitek94 as contributor 2021-10-20 15:26:41 -04:00
Blitz.js Bot
40a6c7d0aa (meta) added @camsloanftc as contributor 2021-10-20 15:12:00 -04:00
Brandon Bayer
60b9f444c0 pin react and react-dom versions in package.json (And I think fix the cannot find module react issue) (#2868)
(newapp)
2021-10-20 12:18:50 -04:00
Aleksandra Sikora
4d95e31013 Update seedling sponsors list in Readme (#2867)
(ignore)
2021-10-20 16:17:01 +02:00
Moyuru
eb4097be96 Update material-ui recipe, migrate from v4 to v5 (#2853)
(recipe)
2021-10-20 15:36:45 +02:00
Brandon Bayer
f1c000e8f1 bump recipe/example versions (ignore) 2021-10-19 18:25:08 -04:00
495 changed files with 11245 additions and 4793 deletions

View File

@@ -309,7 +309,8 @@
"profile": "https://github.com/Zeko369",
"contributions": [
"code",
"doc"
"doc",
"test"
]
},
{
@@ -625,7 +626,8 @@
"avatar_url": "https://avatars0.githubusercontent.com/u/17050715?v=4",
"profile": "https://cloudnweb.dev/",
"contributions": [
"code"
"code",
"test"
]
},
{
@@ -970,7 +972,9 @@
"avatar_url": "https://avatars0.githubusercontent.com/u/3496193?v=4",
"profile": "https://twitter.com/dillonraphael",
"contributions": [
"code"
"code",
"test",
"doc"
]
},
{
@@ -2964,7 +2968,8 @@
"avatar_url": "https://avatars.githubusercontent.com/u/12092?v=4",
"profile": "http://zackhobson.com/",
"contributions": [
"code"
"code",
"doc"
]
},
{
@@ -3065,7 +3070,8 @@
"avatar_url": "https://avatars.githubusercontent.com/u/8077469?v=4",
"profile": "https://andreas.fyi",
"contributions": [
"code"
"code",
"test"
]
},
{
@@ -3295,6 +3301,550 @@
"test",
"doc"
]
},
{
"login": "camsloanftc",
"name": "Cam Sloan",
"avatar_url": "https://avatars.githubusercontent.com/u/16295659?v=4",
"profile": "https://github.com/camsloanftc",
"contributions": [
"doc"
]
},
{
"login": "sitek94",
"name": "Maciek Sitkowski",
"avatar_url": "https://avatars.githubusercontent.com/u/58401630?v=4",
"profile": "https://macieksitkowski.com",
"contributions": [
"doc"
]
},
{
"login": "vivek7405",
"name": "Vivek",
"avatar_url": "https://avatars.githubusercontent.com/u/24492244?v=4",
"profile": "https://github.com/vivek7405",
"contributions": [
"doc",
"code"
]
},
{
"login": "cj",
"name": "CJ Lazell",
"avatar_url": "https://avatars.githubusercontent.com/u/1819?v=4",
"profile": "http://cj.io",
"contributions": [
"code"
]
},
{
"login": "RobertBroersma",
"name": "Robert",
"avatar_url": "https://avatars.githubusercontent.com/u/4519828?v=4",
"profile": "robertbroersma.com",
"contributions": [
"doc"
]
},
{
"login": "cbejensen",
"name": "Christian Jensen",
"avatar_url": "https://avatars.githubusercontent.com/u/12374723?v=4",
"profile": "https://christianjensen.netlify.com",
"contributions": [
"doc"
]
},
{
"login": "dvnrsn",
"name": "Devin Rasmussen",
"avatar_url": "https://avatars.githubusercontent.com/u/9112811?v=4",
"profile": "https://github.com/dvnrsn",
"contributions": [
"code"
]
},
{
"login": "devtombiz",
"name": "Thomas Brenneur",
"avatar_url": "https://avatars.githubusercontent.com/u/23282613?v=4",
"profile": "www.linkedin.com/in/devtom",
"contributions": [
"code",
"doc",
"test"
]
},
{
"login": "lucasvazq",
"name": "Lucas Vazquez",
"avatar_url": "https://avatars.githubusercontent.com/u/38964964?v=4",
"profile": "https://lucasvazq.github.io/",
"contributions": [
"code"
]
},
{
"login": "chrisj-back2work",
"name": "Chris Johnson",
"avatar_url": "https://avatars.githubusercontent.com/u/68551954?v=4",
"profile": "https://github.com/chrisj-back2work",
"contributions": [
"doc"
]
},
{
"login": "thisdotrob",
"name": "Rob Stevenson",
"avatar_url": "https://avatars.githubusercontent.com/u/12902589?v=4",
"profile": "https://github.com/thisdotrob",
"contributions": [
"doc"
]
},
{
"login": "lovethebomb",
"name": "Lucas Heymès",
"avatar_url": "https://avatars.githubusercontent.com/u/1363056?v=4",
"profile": "www.lucas.computer",
"contributions": [
"code",
"doc"
]
},
{
"login": "NorfeldtAbtion",
"name": "Lasse Norfeldt",
"avatar_url": "https://avatars.githubusercontent.com/u/53769763?v=4",
"profile": "https://github.com/NorfeldtAbtion",
"contributions": [
"doc"
]
},
{
"login": "netwarex",
"name": "Péter Nyári",
"avatar_url": "https://avatars.githubusercontent.com/u/6048614?v=4",
"profile": "https://nyaripeter.hu/",
"contributions": [
"doc",
"code"
]
},
{
"login": "5minpause",
"name": "Holger Frohloff",
"avatar_url": "https://avatars.githubusercontent.com/u/84148?v=4",
"profile": "https://www.holgerfrohloff.de",
"contributions": [
"doc"
]
},
{
"login": "basilk76",
"name": "Basil Khan",
"avatar_url": "https://avatars.githubusercontent.com/u/45275512?v=4",
"profile": "https://github.com/basilk76",
"contributions": [
"doc"
]
},
{
"login": "danestves",
"name": "Daniel Esteves",
"avatar_url": "https://avatars.githubusercontent.com/u/31737273?v=4",
"profile": "https://danestves.com/",
"contributions": [
"doc"
]
},
{
"login": "coryhouse",
"name": "Cory House",
"avatar_url": "https://avatars.githubusercontent.com/u/1688997?v=4",
"profile": "http://www.bitnative.com",
"contributions": [
"doc"
]
},
{
"login": "rockmanvnx6",
"name": "Austin (Thang Pham)",
"avatar_url": "https://avatars.githubusercontent.com/u/16440123?v=4",
"profile": "https://auspham.dev/",
"contributions": [
"doc"
]
},
{
"login": "noxify",
"name": "Marcus Reinhardt",
"avatar_url": "https://avatars.githubusercontent.com/u/521777?v=4",
"profile": "https://jammeryhq.com",
"contributions": [
"doc",
"code"
]
},
{
"login": "davidchristie",
"name": "David Christie",
"avatar_url": "https://avatars.githubusercontent.com/u/12044333?v=4",
"profile": "https://github.com/davidchristie",
"contributions": [
"doc"
]
},
{
"login": "ajanth97",
"name": "Ajanth",
"avatar_url": "https://avatars.githubusercontent.com/u/50458502?v=4",
"profile": "https://github.com/ajanth97",
"contributions": [
"doc"
]
},
{
"login": "divpreet",
"name": "Div",
"avatar_url": "https://avatars.githubusercontent.com/u/2805650?v=4",
"profile": "https://github.com/divpreet",
"contributions": [
"doc"
]
},
{
"login": "david-arteaga",
"name": "David Arteaga",
"avatar_url": "https://avatars.githubusercontent.com/u/7199015?v=4",
"profile": "https://github.com/david-arteaga",
"contributions": [
"doc"
]
},
{
"login": "MukulKolpe",
"name": "Mukul Kolpe",
"avatar_url": "https://avatars.githubusercontent.com/u/78664749?v=4",
"profile": "https://github.com/MukulKolpe",
"contributions": [
"code"
]
},
{
"login": "skotchpine",
"name": "tyler",
"avatar_url": "https://avatars.githubusercontent.com/u/13043909?v=4",
"profile": "https://github.com/skotchpine",
"contributions": [
"code"
]
},
{
"login": "SofianeDjellouli",
"name": "Sofiane Djellouli",
"avatar_url": "https://avatars.githubusercontent.com/u/38258952?v=4",
"profile": "https://github.com/SofianeDjellouli",
"contributions": [
"doc"
]
},
{
"login": "kreako",
"name": "kreako",
"avatar_url": "https://avatars.githubusercontent.com/u/65113001?v=4",
"profile": "https://github.com/kreako",
"contributions": [
"doc"
]
},
{
"login": "sarahdayan",
"name": "Sarah Dayan",
"avatar_url": "https://avatars.githubusercontent.com/u/5370675?v=4",
"profile": "https://sarahdayan.dev",
"contributions": [
"code"
]
},
{
"login": "c-ciobanu",
"name": "Cristi Ciobanu",
"avatar_url": "https://avatars.githubusercontent.com/u/33382714?v=4",
"profile": "https://github.com/c-ciobanu",
"contributions": [
"doc"
]
},
{
"login": "arpitdalal",
"name": "Arpit Dalal",
"avatar_url": "https://avatars.githubusercontent.com/u/61059807?v=4",
"profile": "https://arpitdalal.dev",
"contributions": [
"doc"
]
},
{
"login": "robertrisch",
"name": "robertrisch",
"avatar_url": "https://avatars.githubusercontent.com/u/73828816?v=4",
"profile": "https://github.com/robertrisch",
"contributions": [
"doc"
]
},
{
"login": "dineshgadge",
"name": "Dinesh Gadge",
"avatar_url": "https://avatars.githubusercontent.com/u/186976?v=4",
"profile": "https://github.com/dineshgadge",
"contributions": [
"code"
]
},
{
"login": "maltekiessling",
"name": "Malte Kießling",
"avatar_url": "https://avatars.githubusercontent.com/u/30420110?v=4",
"profile": "https://github.com/maltekiessling",
"contributions": [
"doc"
]
},
{
"login": "ospfranco",
"name": "Oscar Franco",
"avatar_url": "https://avatars.githubusercontent.com/u/1634213?v=4",
"profile": "ospfranco.com",
"contributions": [
"doc"
]
},
{
"login": "Nfinished",
"name": "Adam Trager",
"avatar_url": "https://avatars.githubusercontent.com/u/1719791?v=4",
"profile": "adamtrager.com",
"contributions": [
"code"
]
},
{
"login": "shellord",
"name": "saheenshoukath",
"avatar_url": "https://avatars.githubusercontent.com/u/2632896?v=4",
"profile": "https://saheen.codes",
"contributions": [
"doc"
]
},
{
"login": "husnuljahneer",
"name": "Husnul Jahneer",
"avatar_url": "https://avatars.githubusercontent.com/u/54552763?v=4",
"profile": "https://jahneer.me",
"contributions": [
"doc"
]
},
{
"login": "ReykCS",
"name": "Reyk",
"avatar_url": "https://avatars.githubusercontent.com/u/40463716?v=4",
"profile": "https://github.com/ReykCS",
"contributions": [
"doc"
]
},
{
"login": "Lokprakash-babu",
"name": "Lokprakash Babu",
"avatar_url": "https://avatars.githubusercontent.com/u/60031382?v=4",
"profile": "https://github.com/Lokprakash-babu",
"contributions": [
"doc"
]
},
{
"login": "eai04191",
"name": "eai04191",
"avatar_url": "https://avatars.githubusercontent.com/u/3516343?v=4",
"profile": "https://mizle.net",
"contributions": [
"doc"
]
},
{
"login": "numanaral",
"name": "Numan",
"avatar_url": "https://avatars.githubusercontent.com/u/25233323?v=4",
"profile": "https://numanaral.github.io/?ref=github",
"contributions": [
"doc"
]
},
{
"login": "jscyo",
"name": "Joel Coutinho",
"avatar_url": "https://avatars.githubusercontent.com/u/6310783?v=4",
"profile": "https://github.com/jscyo",
"contributions": [
"doc"
]
},
{
"login": "davidbarker",
"name": "David Barker",
"avatar_url": "https://avatars.githubusercontent.com/u/1597139?v=4",
"profile": "https://github.com/davidbarker",
"contributions": [
"doc"
]
},
{
"login": "timfee",
"name": "Tim Feeley",
"avatar_url": "https://avatars.githubusercontent.com/u/3246342?v=4",
"profile": "http://www.timfeeley.com/",
"contributions": [
"code"
]
},
{
"login": "Caslus",
"name": "lucas philippe",
"avatar_url": "https://avatars.githubusercontent.com/u/22855640?v=4",
"profile": "https://github.com/Caslus",
"contributions": [
"doc"
]
},
{
"login": "the-bayer",
"name": "Blake Bayer",
"avatar_url": "https://avatars.githubusercontent.com/u/94391693?v=4",
"profile": "https://github.com/the-bayer",
"contributions": [
"code",
"doc"
]
},
{
"login": "rmassie",
"name": "R Massie",
"avatar_url": "https://avatars.githubusercontent.com/u/7375518?v=4",
"profile": "https://github.com/rmassie",
"contributions": [
"doc"
]
},
{
"login": "paulm17",
"name": "Paul",
"avatar_url": "https://avatars.githubusercontent.com/u/387463?v=4",
"profile": "https://github.com/paulm17",
"contributions": [
"doc"
]
},
{
"login": "minho42",
"name": "Min ho Kim",
"avatar_url": "https://avatars.githubusercontent.com/u/15278512?v=4",
"profile": "https://minho42.com",
"contributions": [
"doc"
]
},
{
"login": "webdeb",
"name": "webdeb",
"avatar_url": "https://avatars.githubusercontent.com/u/14992140?v=4",
"profile": "https://github.com/webdeb",
"contributions": [
"doc"
]
},
{
"login": "iDavidB",
"name": "David",
"avatar_url": "https://avatars.githubusercontent.com/u/32268383?v=4",
"profile": "https://github.com/iDavidB",
"contributions": [
"doc",
"code",
"test"
]
},
{
"login": "jakedee",
"name": "Jake Dowie",
"avatar_url": "https://avatars.githubusercontent.com/u/5058625?v=4",
"profile": "https://jdlt.co.uk",
"contributions": [
"doc"
]
},
{
"login": "datner",
"name": "Datner",
"avatar_url": "https://avatars.githubusercontent.com/u/22598347?v=4",
"profile": "https://github.com/datner",
"contributions": [
"doc",
"code",
"test"
]
},
{
"login": "remlse",
"name": "remlse",
"avatar_url": "https://avatars.githubusercontent.com/u/54984957?v=4",
"profile": "https://github.com/remlse",
"contributions": [
"doc"
]
},
{
"login": "sergous",
"name": "Sergei Smirnov",
"avatar_url": "https://avatars.githubusercontent.com/u/545151?v=4",
"profile": "https://github.com/sergous",
"contributions": [
"doc"
]
},
{
"login": "Trancever",
"name": "Dawid Urbaniak",
"avatar_url": "https://avatars.githubusercontent.com/u/18584155?v=4",
"profile": "https://twitter.com/trensik",
"contributions": [
"doc",
"code"
]
},
{
"login": "SerekKiri",
"name": "Kacper Potyrała",
"avatar_url": "https://avatars.githubusercontent.com/u/29735836?v=4",
"profile": "kiri.dev",
"contributions": [
"doc"
]
},
{
"login": "iojcde",
"name": "Jeeho Ahn",
"avatar_url": "https://avatars.githubusercontent.com/u/31413538?v=4",
"profile": "jcde.xyz",
"contributions": [
"doc",
"tool"
]
}
],
"contributorsPerLine": 7,

4
.github/CODEOWNERS vendored
View File

@@ -1,8 +1,8 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
* @flybayer @beerose
* @beerose
# packages/cli/**/* @aem, @flybayer
# packages/generator/**/* @aem @flybayer
packages/generator/templates**/* @flybayer
# packages/generator/templates**/* @flybayer
# packages/installer/**/* @aem @flybayer

View File

@@ -15,6 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Count size
uses: preactjs/compressed-size-action@v2
with:

View File

@@ -30,9 +30,9 @@ jobs:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
**/node_modules
key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v14-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.node_version}}-yarn-v13-
${{ runner.os }}-${{ runner.node_version}}-yarn-v14-
- name: Install dependencies
run: yarn install --frozen-lockfile --silent
env:
@@ -74,9 +74,9 @@ jobs:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
**/node_modules
key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v14-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.node_version}}-yarn-v13-
${{ runner.os }}-${{ runner.node_version}}-yarn-v14-
- run: yarn install --frozen-lockfile --check-files
- name: Build Packages
run: yarn build
@@ -98,6 +98,10 @@ jobs:
with:
path: ./*
key: ${{ runner.os }}-${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Setup kernel to increase watchers
if: runner.os == 'Linux'
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@@ -106,6 +110,33 @@ jobs:
env:
CI: true
testNextPackages:
name: Next - Test Packages
defaults:
run:
working-directory: nextjs
needs: build-linux
runs-on: ubuntu-latest
env:
BLITZ_TELEMETRY_DISABLED: 1
steps:
- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ runner.os }}-${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Setup kernel to increase watchers
if: runner.os == 'Linux'
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Test Next Packages
run: yarn testonly:packages
env:
CI: true
testBlitzExamples:
timeout-minutes: 30
name: Blitz - Test Example Apps (ubuntu-latest)
@@ -120,6 +151,10 @@ jobs:
with:
path: ./*
key: ${{ runner.os }}-${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
# Needed to get cypress binary
- run: yarn cypress install
- name: Install sass
@@ -157,9 +192,9 @@ jobs:
# path: |
# ${{ steps.yarn-cache-dir-path.outputs.dir }}
# **/node_modules
# key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }}
# key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v14-${{ hashFiles('yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-
# ${{ runner.os }}-${{ runner.node_version}}-yarn-v14-
- run: yarn install --frozen-lockfile --check-files
- name: Build Packages
run: yarn build
@@ -222,6 +257,10 @@ jobs:
with:
path: ./*
key: ${{ runner.os }}-${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
# TODO: remove after we fix watchpack watching too much
- name: Setup kernel to increase watchers
@@ -256,9 +295,9 @@ jobs:
# path: |
# ${{ steps.yarn-cache-dir-path.outputs.dir }}
# **/node_modules
# key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }}
# key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v14-${{ hashFiles('yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-
# ${{ runner.os }}-${{ runner.node_version}}-yarn-v14-
- run: yarn install --frozen-lockfile --check-files
- name: Build Packages
run: yarn build
@@ -285,7 +324,10 @@ jobs:
with:
path: ./*
key: ${{ runner.os }}-${{ github.sha }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
# TODO: remove after we fix watchpack watching too much
- name: Setup kernel to increase watchers
if: runner.os == 'Linux'
@@ -318,9 +360,9 @@ jobs:
# path: |
# ${{ steps.yarn-cache-dir-path.outputs.dir }}
# **/node_modules
# key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-${{ hashFiles('yarn.lock') }}
# key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v14-${{ hashFiles('yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-${{ runner.node_version}}-yarn-v13-
# ${{ runner.os }}-${{ runner.node_version}}-yarn-v14-
- run: yarn install --frozen-lockfile --check-files
- name: Build Packages
run: yarn build
@@ -363,6 +405,7 @@ jobs:
testIntegrationBlitzWin,
testUnit,
testBlitzPackages,
testNextPackages,
testBlitzExamples,
testBlitzExamplesWin,
]

View File

@@ -4,6 +4,12 @@
## Notes For Core Team
### To Publish a new NPM Package under `@blitzjs/` namespace
1. cd into the package directory
2. Run `npm publish --tag danger --access public`
- `--access public` is required because scoped packages are set to private by default
### Syncing Next.js Fork
1. Run `yarn push-nextjs`

145
README.md
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-349-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-408-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">
@@ -107,18 +107,21 @@ Your financial contributions help ensure Blitz continues to be developed and mai
<table>
<tr>
<td><a aria-label="Andreas Asprou" href="https://andreas.fyi">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/andreas.jpg" width="40px"/>
</a></td>
<td><a aria-label="Robert Malko" href="https://github.com/malkomalko">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/rob_blitz.jpg" width="40px"/>
</a></td>
<td><a aria-label="Digas" href="https://digsas.com">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/digsas.svg" width="40px"/>
</a></td>
<td><a aria-label="userTrack" href="https://www.usertrack.net/?ref=blitzjs">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/usertrack.png" width="40px"/>
</a></td>
<td>
<a aria-label="Andreas Asprou" href="https://andreas.fyi">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/andreas.jpg" width="40px"/>
</a>
</td>
<td>
<a aria-label="MeetKai" href="https://meetkai.com/?ref=blitzjs">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/meetkai.png" width="40px"/>
</a>
</td>
<td>
<a aria-label="JDLT" href="https://jdlt.co.uk/?ref=blitzjs">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/jdlt.png" width="40px"/>
</a>
</td>
</tr>
</table>
@@ -149,11 +152,6 @@ Your financial contributions help ensure Blitz continues to be developed and mai
<a aria-label="Fauna" href="https://dashboard.fauna.com/accounts/register?utm_source=BlitzJS&utm_medium=sponsorship&utm_campaign=BlitzJS_Sponsorship_2020">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/Fauna_Logo_Blue.png" width="300px">
</a>
</td>
<td>
<a aria-label="GraphCMS" href="https://graphcms.com/?utm_source=BlitzJS&utm_medium=sponsorship&utm_campaign=BlitzJS_Sponsorship_2021">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/graphcms.png" width="300px">
</a>
</td>
</tr>
</table>
@@ -231,6 +229,30 @@ _Issue triage, pull request triage, community encouragement and moderation, etc_
</sub>
</a>
</td>
<td align="center">
<a href="https://damilolarandolph.com/">
<img src="https://avatars.githubusercontent.com/damilolarandolph" width="100px;" alt="Damilola Randolph avatar" /><br />
<sub>
<b>Damilola Randolph</b>
</sub>
</a>
</td>
<td align="center">
<a href="https://www.saheen.me/">
<img src="https://avatars.githubusercontent.com/shellord" width="100px;" alt="Saheen Shoukath avatar" /><br />
<sub>
<b>Saheen Shoukath</b>
</sub>
</a>
</td>
<td align="center">
<a href="https://jahneer.me">
<img src="https://avatars.githubusercontent.com/husnuljahneer" width="100px;" alt="Husnul Jahneer avatar" /><br />
<sub>
<b>Husnul Jahneer</b>
</sub>
</a>
</td>
</tr>
</table>
<!-- markdownlint-enable -->
@@ -285,7 +307,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
</tr>
<tr>
<td align="center"><a href="https://github.com/sonnypgs"><img src="https://avatars3.githubusercontent.com/u/1431300?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sonny</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sonnypgs" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Zeko369"><img src="https://avatars3.githubusercontent.com/u/3064377?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fran Zekan</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Zeko369" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=Zeko369" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Zeko369"><img src="https://avatars3.githubusercontent.com/u/3064377?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fran Zekan</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Zeko369" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=Zeko369" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=Zeko369" title="Tests">⚠️</a></td>
<td align="center"><a href="http://twitter.com/JanBaykara"><img src="https://avatars2.githubusercontent.com/u/237556?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jan Baykara</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=janbaykara" title="Documentation">📖</a></td>
<td align="center"><a href="https://mikeattara.com"><img src="https://avatars1.githubusercontent.com/u/31483629?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mike Perry Y Attara</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=mikeattara" title="Documentation">📖</a></td>
<td align="center"><a href="https://devanthe.dev"><img src="https://avatars0.githubusercontent.com/u/354652?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Devan</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=DevanB" title="Documentation">📖</a></td>
@@ -326,7 +348,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<td align="center"><a href="http://anteprimorac.com.hr"><img src="https://avatars0.githubusercontent.com/u/972083?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ante Primorac</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=anteprimorac" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=anteprimorac" title="Documentation">📖</a></td>
<td align="center"><a href="http://mykalmachon.dev"><img src="https://avatars1.githubusercontent.com/u/7844994?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mykal Machon</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=MykalMachon" title="Code">💻</a></td>
<td align="center"><a href="https://jamiedavenport.dev"><img src="https://avatars2.githubusercontent.com/u/1329874?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jamie Davenport</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=jamiedavenport" title="Code">💻</a> <a href="#maintenance-jamiedavenport" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://cloudnweb.dev/"><img src="https://avatars0.githubusercontent.com/u/17050715?v=4?s=100" width="100px;" alt=""/><br /><sub><b>GaneshMani</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ganeshmani" title="Code">💻</a></td>
<td align="center"><a href="https://cloudnweb.dev/"><img src="https://avatars0.githubusercontent.com/u/17050715?v=4?s=100" width="100px;" alt=""/><br /><sub><b>GaneshMani</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ganeshmani" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=ganeshmani" title="Tests">⚠️</a></td>
</tr>
<tr>
<td align="center"><a href="http://ramonmorcillo.com"><img src="https://avatars3.githubusercontent.com/u/31936665?v=4?s=100" width="100px;" alt=""/><br /><sub><b>reymon359</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=reymon359" title="Code">💻</a></td>
@@ -375,7 +397,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="Tests">⚠️</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>
@@ -649,7 +671,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<td align="center"><a href="https://github.com/bravo-kernel"><img src="https://avatars.githubusercontent.com/u/230500?v=4?s=100" width="100px;" alt=""/><br /><sub><b>bravo-kernel</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=bravo-kernel" title="Code">💻</a></td>
<td align="center"><a href="https://samholmes.net"><img src="https://avatars.githubusercontent.com/u/8385528?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sam Holmes</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sam3d" title="Code">💻</a></td>
<td align="center"><a href="https://doncicuto.medium.com"><img src="https://avatars.githubusercontent.com/u/30386061?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Miguel Cabrerizo</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=doncicuto" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=doncicuto" title="Documentation">📖</a></td>
<td align="center"><a href="http://zackhobson.com/"><img src="https://avatars.githubusercontent.com/u/12092?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zack Hobson</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=zenhob" title="Code">💻</a></td>
<td align="center"><a href="http://zackhobson.com/"><img src="https://avatars.githubusercontent.com/u/12092?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zack Hobson</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=zenhob" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=zenhob" title="Documentation">📖</a></td>
<td align="center"><a href="https://www.mokhtar.dev"><img src="https://avatars.githubusercontent.com/u/13026820?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mokhtar</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=m5r" title="Documentation">📖</a></td>
</tr>
<tr>
@@ -664,7 +686,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<tr>
<td align="center"><a href="https://github.com/ratson"><img src="https://avatars.githubusercontent.com/u/2682937?v=4?s=100" width="100px;" alt=""/><br /><sub><b>(◕ᴥ◕)</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ratson" title="Code">💻</a></td>
<td align="center"><a href="maciejmyslinski.com"><img src="https://avatars.githubusercontent.com/u/11421186?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mat Milbury</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=maciejmyslinski" title="Documentation">📖</a></td>
<td align="center"><a href="https://andreas.fyi"><img src="https://avatars.githubusercontent.com/u/8077469?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andreas Asprou</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=andreasasprou" title="Code">💻</a></td>
<td align="center"><a href="https://andreas.fyi"><img src="https://avatars.githubusercontent.com/u/8077469?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andreas Asprou</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=andreasasprou" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=andreasasprou" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/kotx"><img src="https://avatars.githubusercontent.com/u/33439542?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kot</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=kotx" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=kotx" title="Tests">⚠️</a> <a href="https://github.com/blitz-js/blitz/commits?author=kotx" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/isaka1022"><img src="https://avatars.githubusercontent.com/u/28589716?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amane</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=isaka1022" title="Documentation">📖</a></td>
<td align="center"><a href="johnleung.com"><img src="https://avatars.githubusercontent.com/u/20699?v=4?s=100" width="100px;" alt=""/><br /><sub><b>John Leung</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=fuzzthink" title="Documentation">📖</a></td>
@@ -695,6 +717,83 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<td align="center"><a href="https://p-siriphanthong.github.io/"><img src="https://avatars.githubusercontent.com/u/29949429?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Punn Siriphanthong</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=p-siriphanthong" title="Code">💻</a></td>
<td align="center"><a href="https://my-portfolio-292eb.web.app"><img src="https://avatars.githubusercontent.com/u/83679827?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shawn Fetanat</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=shawn-fetanat" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/mochi-sann"><img src="https://avatars.githubusercontent.com/u/44772513?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Moyuru</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=mochi-sann" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=mochi-sann" title="Tests">⚠️</a> <a href="https://github.com/blitz-js/blitz/commits?author=mochi-sann" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/camsloanftc"><img src="https://avatars.githubusercontent.com/u/16295659?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cam Sloan</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=camsloanftc" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://macieksitkowski.com"><img src="https://avatars.githubusercontent.com/u/58401630?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Maciek Sitkowski</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sitek94" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/vivek7405"><img src="https://avatars.githubusercontent.com/u/24492244?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vivek</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=vivek7405" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=vivek7405" title="Code">💻</a></td>
<td align="center"><a href="http://cj.io"><img src="https://avatars.githubusercontent.com/u/1819?v=4?s=100" width="100px;" alt=""/><br /><sub><b>CJ Lazell</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=cj" title="Code">💻</a></td>
<td align="center"><a href="robertbroersma.com"><img src="https://avatars.githubusercontent.com/u/4519828?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Robert</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=RobertBroersma" title="Documentation">📖</a></td>
<td align="center"><a href="https://christianjensen.netlify.com"><img src="https://avatars.githubusercontent.com/u/12374723?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Christian Jensen</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=cbejensen" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/dvnrsn"><img src="https://avatars.githubusercontent.com/u/9112811?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Devin Rasmussen</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=dvnrsn" title="Code">💻</a></td>
<td align="center"><a href="www.linkedin.com/in/devtom"><img src="https://avatars.githubusercontent.com/u/23282613?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Thomas Brenneur</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=devtombiz" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=devtombiz" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=devtombiz" title="Tests">⚠️</a></td>
</tr>
<tr>
<td align="center"><a href="https://lucasvazq.github.io/"><img src="https://avatars.githubusercontent.com/u/38964964?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lucas Vazquez</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=lucasvazq" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/chrisj-back2work"><img src="https://avatars.githubusercontent.com/u/68551954?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chris Johnson</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=chrisj-back2work" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/thisdotrob"><img src="https://avatars.githubusercontent.com/u/12902589?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rob Stevenson</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=thisdotrob" title="Documentation">📖</a></td>
<td align="center"><a href="www.lucas.computer"><img src="https://avatars.githubusercontent.com/u/1363056?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lucas Heymès</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=lovethebomb" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=lovethebomb" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/NorfeldtAbtion"><img src="https://avatars.githubusercontent.com/u/53769763?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lasse Norfeldt</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=NorfeldtAbtion" title="Documentation">📖</a></td>
<td align="center"><a href="https://nyaripeter.hu/"><img src="https://avatars.githubusercontent.com/u/6048614?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Péter Nyári</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=netwarex" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=netwarex" title="Code">💻</a></td>
<td align="center"><a href="https://www.holgerfrohloff.de"><img src="https://avatars.githubusercontent.com/u/84148?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Holger Frohloff</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=5minpause" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/basilk76"><img src="https://avatars.githubusercontent.com/u/45275512?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Basil Khan</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=basilk76" title="Documentation">📖</a></td>
<td align="center"><a href="https://danestves.com/"><img src="https://avatars.githubusercontent.com/u/31737273?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Daniel Esteves</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=danestves" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.bitnative.com"><img src="https://avatars.githubusercontent.com/u/1688997?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cory House</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=coryhouse" title="Documentation">📖</a></td>
<td align="center"><a href="https://auspham.dev/"><img src="https://avatars.githubusercontent.com/u/16440123?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Austin (Thang Pham)</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=rockmanvnx6" title="Documentation">📖</a></td>
<td align="center"><a href="https://jammeryhq.com"><img src="https://avatars.githubusercontent.com/u/521777?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Marcus Reinhardt</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=noxify" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=noxify" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/davidchristie"><img src="https://avatars.githubusercontent.com/u/12044333?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David Christie</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=davidchristie" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/ajanth97"><img src="https://avatars.githubusercontent.com/u/50458502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ajanth</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ajanth97" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/divpreet"><img src="https://avatars.githubusercontent.com/u/2805650?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Div</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=divpreet" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/david-arteaga"><img src="https://avatars.githubusercontent.com/u/7199015?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David Arteaga</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=david-arteaga" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/MukulKolpe"><img src="https://avatars.githubusercontent.com/u/78664749?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mukul Kolpe</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=MukulKolpe" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/skotchpine"><img src="https://avatars.githubusercontent.com/u/13043909?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tyler</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=skotchpine" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/SofianeDjellouli"><img src="https://avatars.githubusercontent.com/u/38258952?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sofiane Djellouli</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=SofianeDjellouli" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/kreako"><img src="https://avatars.githubusercontent.com/u/65113001?v=4?s=100" width="100px;" alt=""/><br /><sub><b>kreako</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=kreako" title="Documentation">📖</a></td>
<td align="center"><a href="https://sarahdayan.dev"><img src="https://avatars.githubusercontent.com/u/5370675?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sarah Dayan</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sarahdayan" title="Code">💻</a></td>
</tr>
<tr>
<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/dineshgadge"><img src="https://avatars.githubusercontent.com/u/186976?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dinesh Gadge</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=dineshgadge" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/maltekiessling"><img src="https://avatars.githubusercontent.com/u/30420110?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Malte Kießling</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=maltekiessling" title="Documentation">📖</a></td>
<td align="center"><a href="ospfranco.com"><img src="https://avatars.githubusercontent.com/u/1634213?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Oscar Franco</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ospfranco" title="Documentation">📖</a></td>
<td align="center"><a href="adamtrager.com"><img src="https://avatars.githubusercontent.com/u/1719791?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Adam Trager</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Nfinished" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://saheen.codes"><img src="https://avatars.githubusercontent.com/u/2632896?v=4?s=100" width="100px;" alt=""/><br /><sub><b>saheenshoukath</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=shellord" title="Documentation">📖</a></td>
<td align="center"><a href="https://jahneer.me"><img src="https://avatars.githubusercontent.com/u/54552763?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Husnul Jahneer</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=husnuljahneer" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/ReykCS"><img src="https://avatars.githubusercontent.com/u/40463716?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Reyk</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ReykCS" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Lokprakash-babu"><img src="https://avatars.githubusercontent.com/u/60031382?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lokprakash Babu</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Lokprakash-babu" title="Documentation">📖</a></td>
<td align="center"><a href="https://mizle.net"><img src="https://avatars.githubusercontent.com/u/3516343?v=4?s=100" width="100px;" alt=""/><br /><sub><b>eai04191</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=eai04191" title="Documentation">📖</a></td>
<td align="center"><a href="https://numanaral.github.io/?ref=github"><img src="https://avatars.githubusercontent.com/u/25233323?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Numan</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=numanaral" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/jscyo"><img src="https://avatars.githubusercontent.com/u/6310783?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Joel Coutinho</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=jscyo" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/davidbarker"><img src="https://avatars.githubusercontent.com/u/1597139?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David Barker</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=davidbarker" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.timfeeley.com/"><img src="https://avatars.githubusercontent.com/u/3246342?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tim Feeley</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=timfee" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Caslus"><img src="https://avatars.githubusercontent.com/u/22855640?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lucas philippe</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Caslus" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/the-bayer"><img src="https://avatars.githubusercontent.com/u/94391693?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Blake Bayer</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=the-bayer" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=the-bayer" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/rmassie"><img src="https://avatars.githubusercontent.com/u/7375518?v=4?s=100" width="100px;" alt=""/><br /><sub><b>R Massie</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=rmassie" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/paulm17"><img src="https://avatars.githubusercontent.com/u/387463?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=paulm17" title="Documentation">📖</a></td>
<td align="center"><a href="https://minho42.com"><img src="https://avatars.githubusercontent.com/u/15278512?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Min ho Kim</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=minho42" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/webdeb"><img src="https://avatars.githubusercontent.com/u/14992140?v=4?s=100" width="100px;" alt=""/><br /><sub><b>webdeb</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=webdeb" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/iDavidB"><img src="https://avatars.githubusercontent.com/u/32268383?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=iDavidB" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=iDavidB" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=iDavidB" title="Tests">⚠️</a></td>
<td align="center"><a href="https://jdlt.co.uk"><img src="https://avatars.githubusercontent.com/u/5058625?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jake Dowie</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=jakedee" 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> <a href="https://github.com/blitz-js/blitz/commits?author=datner" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/remlse"><img src="https://avatars.githubusercontent.com/u/54984957?v=4?s=100" width="100px;" alt=""/><br /><sub><b>remlse</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=remlse" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/sergous"><img src="https://avatars.githubusercontent.com/u/545151?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sergei Smirnov</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sergous" title="Documentation">📖</a></td>
<td align="center"><a href="https://twitter.com/trensik"><img src="https://avatars.githubusercontent.com/u/18584155?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dawid Urbaniak</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Trancever" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=Trancever" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="kiri.dev"><img src="https://avatars.githubusercontent.com/u/29735836?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kacper Potyrała</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=SerekKiri" title="Documentation">📖</a></td>
<td align="center"><a href="jcde.xyz"><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></td>
</tr>
</table>

View File

@@ -6,5 +6,5 @@ TODO
## Reporting a Vulnerability
Email Brandon Bayer at b@bayer.ws to report a vulnerablity, and he will follow up with you asap.
Email Brandon Bayer at b@bayer.ws to report a vulnerability, and he will follow up with you asap.

View File

@@ -1,24 +0,0 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M79.4831 1.95572C70.2813 -0.81923 55.2811 -0.617415 46.1549 2.4098L18.6125 11.5167C9.48627 14.5313 9.38542 19.7784 18.3856 23.1588L49.9743 35.028C58.9744 38.4084 73.6217 38.194 82.5084 34.5487L110.883 22.9192C119.782 19.2739 119.53 14.0267 110.316 11.2518L79.4831 1.95572Z" fill="url(#paint0_linear)"/>
<path d="M84.235 38.6101C75.3357 42.2554 68.0625 53.1029 68.0625 62.727V113.635C68.0625 123.259 74.9071 127.245 83.2644 122.489L109.282 107.706C117.639 102.951 124.912 91.208 125.442 81.6092L127.837 37.8281C128.366 28.2167 121.509 23.3479 112.609 26.9932L84.235 38.6101Z" fill="url(#paint1_linear)"/>
<path d="M0.0071345 37.8409C-0.257575 28.2295 6.877 23.1211 15.8771 26.5015L47.4658 38.3707C56.466 41.7511 63.8274 52.3842 63.8274 62.0082V112.916C63.8274 122.54 56.882 126.715 48.386 122.212L17.0998 105.6C8.60392 101.085 1.44415 89.5306 1.16683 79.9192L0.0071345 37.8409Z" fill="url(#paint2_linear)"/>
</g>
<defs>
<linearGradient id="paint0_linear" x1="63.9326" y1="0" x2="63.9326" y2="124.497" gradientUnits="userSpaceOnUse">
<stop stop-color="#036EB8"/>
<stop offset="1" stop-color="#469196"/>
</linearGradient>
<linearGradient id="paint1_linear" x1="63.9326" y1="0" x2="63.9326" y2="124.497" gradientUnits="userSpaceOnUse">
<stop stop-color="#036EB8"/>
<stop offset="1" stop-color="#469196"/>
</linearGradient>
<linearGradient id="paint2_linear" x1="63.9326" y1="0" x2="63.9326" y2="124.497" gradientUnits="userSpaceOnUse">
<stop stop-color="#036EB8"/>
<stop offset="1" stop-color="#469196"/>
</linearGradient>
<clipPath id="clip0">
<rect width="128" height="128" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

BIN
assets/jdlt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
assets/meetkai.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -6,12 +6,14 @@ import {
useRouterQuery,
useMutation,
invoke,
Image,
useQuery,
BlitzPage,
} from "blitz"
import getUser from "app/users/queries/getUser"
import trackView from "app/users/mutations/trackView"
import Layout from "app/core/layouts/Layout"
import logo from "public/logo.png"
import {Routes} from ".blitz"
@@ -88,7 +90,7 @@ const Home: BlitzPage = () => (
<main>
<div className="logo">
<img src="/logo.png" alt="blitz.js" />
<Image src={logo} alt="blitz.js" width={400} height={200} />
</div>
<Suspense fallback={"Loading..."}>

View File

@@ -0,0 +1,13 @@
import {Ctx} from "blitz"
import db from "db"
export default async function currentUserQuery(_ = null, {session}: Ctx) {
if (!session.userId) return null
const user = await db.user.findFirst({
where: {id: session.userId},
select: {id: true, name: true, email: true, role: true},
})
return user
}

View File

@@ -16,6 +16,9 @@ module.exports = withBundleAnalyzer({
cli: {
clearConsoleOnBlitzDev: false,
},
codegen: {
templateDir: "./my-templates",
},
log: {
// level: "trace",
},

View File

@@ -4,7 +4,6 @@
* and then export it. That way you can import here and anywhere else
* and use it straight away.
*/
import previewEmail from "preview-email"
type ResetPasswordMailer = {
to: string
@@ -38,6 +37,7 @@ export function forgotPasswordMailer({to, token}: ResetPasswordMailer) {
throw new Error("No production email implementation in mailers/forgotPasswordMailer")
} else {
// Preview email in the browser
const previewEmail = (await import("preview-email")).default
await previewEmail(msg)
}
},

View File

@@ -5,6 +5,7 @@
"dev": "blitz dev",
"build": "blitz build",
"start": "blitz start",
"console": "blitz console",
"studio": "blitz prisma studio",
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
"analyze": "cross-env ANALYZE=true blitz build",
@@ -29,7 +30,7 @@
},
"dependencies": {
"@prisma/client": "2.24.1",
"blitz": "0.41.2-canary.1",
"blitz": "0.45.4",
"final-form": "4.20.1",
"passport-auth0": "1.4.0",
"passport-github2": "0.1.12",

View File

@@ -1,8 +1,9 @@
import {Link, BlitzPage, useMutation} from "blitz"
import {Link, BlitzPage, useMutation, Image} from "blitz"
import Layout from "app/layouts/Layout"
import logout from "app/auth/mutations/logout"
import {useCurrentUser} from "app/hooks/useCurrentUser"
import {Suspense} from "react"
import logo from "public/logo.png"
/*
* This file is just for a pleasant getting started page for your new app.
@@ -54,7 +55,7 @@ const Home: BlitzPage = () => {
<div className="container">
<main>
<div className="logo">
<img src="/logo.png" alt="blitz.js" />
<Image src={logo} alt="blitz.js" />
</div>
<p>
<strong>Congrats!</strong> Your app is ready, including user sign-up and log-in.

View File

@@ -4,8 +4,7 @@
* This seed function is executed when you run `blitz db seed`.
*
* Probably you want to use a library like https://chancejs.com
* or https://github.com/Marak/Faker.js to easily generate
* realistic data.
* to easily generate realistic data.
*/
const seed = async () => {
// for (let i = 0; i < 5; i++) {

View File

@@ -31,7 +31,7 @@
},
"dependencies": {
"@prisma/client": "2.24.1",
"blitz": "0.41.2-canary.1",
"blitz": "0.45.4",
"final-form": "4.20.1",
"prisma": "2.24.1",
"react": "0.0.0-experimental-6a589ad71",

View File

@@ -1,7 +1,7 @@
import blitz from "blitz/custom-server"
import {createServer} from "http"
import {parse} from "url"
import {log} from "@blitzjs/display"
import {log} from "next/dist/server/lib/logging"
const {PORT = "3000"} = process.env
const dev = process.env.NODE_ENV !== "production"

View File

@@ -1,5 +1,7 @@
process.env.NODE_ENV = "test"
require("dotenv-flow").config({ silent: true })
import { loadEnvConfig } from "@blitzjs/env"
loadEnvConfig()
import "./register-ts-paths"
import db from "db"

View File

@@ -59,7 +59,7 @@ model Token {
// NOTE: It's highly recommended to use an enum for the token type
// but enums only work in Postgres.
// See: https://blitzjs.com/docs/database-overview#switch-to-postgresql
// See: https://blitzjs.com/docs/database-overview#switch-to-postgre-sql
// enum TokenType {
// RESET_PASSWORD
// }

View File

@@ -4,8 +4,7 @@
* This seed function is executed when you run `blitz db seed`.
*
* Probably you want to use a library like https://chancejs.com
* or https://github.com/Marak/Faker.js to easily generate
* realistic data.
* to easily generate realistic data.
*/
const seed = async () => {
// for (let i = 0; i < 5; i++) {

View File

@@ -4,7 +4,6 @@
* and then export it. That way you can import here and anywhere else
* and use it straight away.
*/
import previewEmail from "preview-email"
type ResetPasswordMailer = {
to: string
@@ -38,6 +37,7 @@ export function forgotPasswordMailer({ to, token }: ResetPasswordMailer) {
throw new Error("No production email implementation in mailers/forgotPasswordMailer")
} else {
// Preview email in the browser
const previewEmail = (await import("preview-email")).default
await previewEmail(msg)
}
},

View File

@@ -34,7 +34,7 @@
},
"dependencies": {
"@prisma/client": "2.24.1",
"blitz": "0.41.2-canary.1",
"blitz": "0.45.4",
"final-form": "4.20.1",
"react": "0.0.0-experimental-6a589ad71",
"react-dom": "0.0.0-experimental-6a589ad71",

View File

@@ -4,8 +4,7 @@
* This seed function is executed when you run `blitz db seed`.
*
* Probably you want to use a library like https://chancejs.com
* or https://github.com/Marak/Faker.js to easily generate
* realistic data.
* to easily generate realistic data.
*/
const seed = async () => {
// for (let i = 0; i < 5; i++) {

View File

@@ -28,7 +28,7 @@
]
},
"dependencies": {
"blitz": "0.41.2-canary.1",
"blitz": "0.45.4",
"final-form": "4.20.1",
"graphql": "15.5.0",
"graphql-request": "3.4.0",

View File

@@ -3,4 +3,6 @@
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import "@testing-library/jest-dom/extend-expect"
require("dotenv-flow").config({ silent: true })
import { loadEnvConfig } from "@blitzjs/env"
loadEnvConfig()

View File

@@ -0,0 +1,11 @@
# https://EditorConfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

View File

@@ -0,0 +1,3 @@
# This env file should be checked into source control
# This is the place for default values for all environments
# Values in `.env.local` and `.env.production` will override these values

View File

@@ -0,0 +1,3 @@
module.exports = {
extends: ["blitz"],
}

56
examples/i18n-next-rosetta/.gitignore vendored Normal file
View File

@@ -0,0 +1,56 @@
# dependencies
node_modules
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*
.npm
web_modules/
# blitz
/.blitz/
/.next/
*.sqlite
*.sqlite-journal
.now
.blitz**
blitz-log.log
# misc
.DS_Store
# local env files
.env.local
.env.*.local
.envrc
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Testing
.coverage
*.lcov
.nyc_output
lib-cov
# Caches
*.tsbuildinfo
.eslintcache
.node_repl_history
.yarn-integrity
# Serverless directories
.serverless/
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

View File

@@ -0,0 +1 @@
_

View File

@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
npx pretty-quick --staged

View File

@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx tsc
npm run lint
npm run test

View File

@@ -0,0 +1,7 @@
save-exact=true
legacy-peer-deps=true
public-hoist-pattern[]=next
public-hoist-pattern[]=secure-password
public-hoist-pattern[]=*jest*
public-hoist-pattern[]=@testing-library/*

View File

@@ -0,0 +1,9 @@
.gitkeep
.env*
*.ico
*.lock
db/migrations
.next
.blitz
.yarn
.pnp*

View File

@@ -0,0 +1,132 @@
# Blitz localization with next-rosetta Example
This example shows how to use [next-rosetta](https://www.npmjs.com/package/next-rosetta) to translate your application. It has English and French locales and need to be adapted to your own use case.
## Getting started
### Install dependencies
```
# with npm
npm install next-rosetta
# with yarn
yarn add next-rosetta
```
### Configure the international routing in the `blitz.config.ts` file
```ts
// blitz.config.ts
import { BlitzConfig } from "blitz"
const config: BlitzConfig = {
i18n: {
// These are all the locales you want to support
locales: ["en", "fr"],
// This is the default locale you want to be used when visiting
// a path without locale prefix e.g. `/users`
defaultLocale: "en",
},
}
module.exports = config
```
### Create locales
Create a directory named `i18n` in your project. If you are using TypeScript you can define the type schema and create every locale based on that interface. An example:
```ts
export interface MyLocale {
locale: string
home: {
logout: string
userId: string
userRole: string
signUp: string
login: string
welcome: {
part1: string
part2: string
}
...
```
Then you can add files with translations. Here's an English example:
```ts
import type { MyLocale } from "."
export const table: MyLocale = {
locale: "English",
home: {
logout: "Logout",
userId: "User Id",
userRole: "User Role",
signUp: "Sign Up",
login: "Login",
welcome: {
part1: "Congrats!",
part2: " Your app is ready, including user sign-up and log-in.",
},
...
```
### Add the i18n provider in `app/pages/_app.tsx`
```diff
import { I18nProvider } from "next-rosetta"
export default function App({ Component, pageProps }: AppProps) {
const getLayout = Component.getLayout || ((page) => page)
return (
+ <I18nProvider table={pageProps.table}>
<ErrorBoundary
FallbackComponent={RootErrorFallback}
onReset={useQueryErrorResetBoundary().reset}
>
{getLayout(<Component {...pageProps} />)}
</ErrorBoundary>
+ </I18nProvider>
)
}
```
### Use `next-rosetta` in your components
Here is an example if you are using `getStaticProps`:
```ts
// app/pages/index.tsx
import type { GetStaticProps } from "next"
import { useI18n, I18nProps } from "next-rosetta"
import type { MyLocale } from "../i18n"
function HomePage() {
const { t } = useI18n<MyLocale>()
return (
<div>
<h3>{t("title")}</h3>
<p>{t("welcome", { name: "John" })}</p>
<button>{t("profile.button")}</button>
</div>
)
}
// You can use I18nProps<T> for type-safety (optional)
export const getStaticProps: GetStaticProps<I18nProps<MyLocale>> = async (context) => {
const locale = context.locale || context.defaultLocale
const { table = {} } = await import(`../i18n/${locale}`) // Import locale
return { props: { table } } // Passed to `app/pages/_app.tsx`
}
```
Take a look at the following files to see how `next-rosetta` can be used in a Blitz application:
- `app/pages/index.tsx`
- `app/auth/components/LoginForm.tsx`
- `app/auth/pages/login.tsx`
Refer to the [docs](https://github.com/useflyyer/next-rosetta) for more examples.

View File

@@ -0,0 +1,61 @@
import { AuthenticationError, Link, useMutation, Routes } from "blitz"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import login from "app/auth/mutations/login"
import { Login } from "app/auth/validations"
import { useI18n } from "next-rosetta"
import type { MyLocale } from "app/core/i18n"
type LoginFormProps = {
onSuccess?: () => void
}
export const LoginForm = (props: LoginFormProps) => {
const [loginMutation] = useMutation(login)
const { t } = useI18n<MyLocale>()
return (
<div>
<h1>{t("loginPage.login")}</h1>
<Form
submitText={t("loginPage.login") as string | undefined}
schema={Login}
initialValues={{ email: "", password: "" }}
onSubmit={async (values) => {
try {
await loginMutation(values)
props.onSuccess?.()
} catch (error: any) {
if (error instanceof AuthenticationError) {
return { [FORM_ERROR]: t("loginPage.credentialError") }
} else {
return {
[FORM_ERROR]: t("loginPage.unexpectedError", { message: error.toString() }),
}
}
}
}}
>
<LabeledTextField name="email" label={t("loginPage.email") as any} placeholder="Email" />
<LabeledTextField
name="password"
label={t("loginPage.password") as any}
placeholder="Password"
type="password"
/>
<div>
<Link href={Routes.ForgotPasswordPage()}>
<a>{t("loginPage.forgotPassword")}</a>
</Link>
</div>
</Form>
<div style={{ marginTop: "1rem" }}>
{t("loginPage.Or")} <Link href={Routes.SignupPage()}>{t("loginPage.signUp")}</Link>
</div>
</div>
)
}
export default LoginForm

View File

@@ -0,0 +1,43 @@
import { useMutation } from "blitz"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import signup from "app/auth/mutations/signup"
import { Signup } from "app/auth/validations"
type SignupFormProps = {
onSuccess?: () => void
}
export const SignupForm = (props: SignupFormProps) => {
const [signupMutation] = useMutation(signup)
return (
<div>
<h1>Create an Account</h1>
<Form
submitText="Create Account"
schema={Signup}
initialValues={{ email: "", password: "" }}
onSubmit={async (values) => {
try {
await signupMutation(values)
props.onSuccess?.()
} catch (error: any) {
if (error.code === "P2002" && error.meta?.target?.includes("email")) {
// This error comes from Prisma
return { email: "This email is already being used" }
} else {
return { [FORM_ERROR]: error.toString() }
}
}
}}
>
<LabeledTextField name="email" label="Email" placeholder="Email" />
<LabeledTextField name="password" label="Password" placeholder="Password" type="password" />
</Form>
</div>
)
}
export default SignupForm

View File

@@ -0,0 +1,23 @@
import { NotFoundError, SecurePassword, resolver } from "blitz"
import db from "db"
import { authenticateUser } from "./login"
import { ChangePassword } from "../validations"
export default resolver.pipe(
resolver.zod(ChangePassword),
resolver.authorize(),
async ({ currentPassword, newPassword }, ctx) => {
const user = await db.user.findFirst({ where: { id: ctx.session.userId! } })
if (!user) throw new NotFoundError()
await authenticateUser(user.email, currentPassword)
const hashedPassword = await SecurePassword.hash(newPassword.trim())
await db.user.update({
where: { id: user.id },
data: { hashedPassword },
})
return true
}
)

View File

@@ -0,0 +1,56 @@
import { hash256, Ctx } from "blitz"
import forgotPassword from "./forgotPassword"
import db from "db"
import previewEmail from "preview-email"
beforeEach(async () => {
await db.$reset()
})
const generatedToken = "plain-token"
jest.mock("next/stdlib-server", () => ({
...jest.requireActual<object>("next/stdlib-server")!,
generateToken: () => generatedToken,
}))
jest.mock("preview-email", () => jest.fn())
describe("forgotPassword mutation", () => {
it("does not throw error if user doesn't exist", async () => {
await expect(forgotPassword({ email: "no-user@email.com" }, {} as Ctx)).resolves.not.toThrow()
})
it("works correctly", async () => {
// Create test user
const user = await db.user.create({
data: {
email: "user@example.com",
tokens: {
// Create old token to ensure it's deleted
create: {
type: "RESET_PASSWORD",
hashedToken: "token",
expiresAt: new Date(),
sentTo: "user@example.com",
},
},
},
include: { tokens: true },
})
// Invoke the mutation
await forgotPassword({ email: user.email }, {} as Ctx)
const tokens = await db.token.findMany({ where: { userId: user.id } })
const token = tokens[0]
// delete's existing tokens
expect(tokens.length).toBe(1)
expect(token.id).not.toBe(user.tokens[0].id)
expect(token.type).toBe("RESET_PASSWORD")
expect(token.sentTo).toBe(user.email)
expect(token.hashedToken).toBe(hash256(generatedToken))
expect(token.expiresAt > new Date()).toBe(true)
expect(previewEmail).toBeCalled()
})
})

View File

@@ -0,0 +1,41 @@
import { resolver, generateToken, hash256 } from "blitz"
import db from "db"
import { forgotPasswordMailer } from "mailers/forgotPasswordMailer"
import { ForgotPassword } from "../validations"
const RESET_PASSWORD_TOKEN_EXPIRATION_IN_HOURS = 4
export default resolver.pipe(resolver.zod(ForgotPassword), async ({ email }) => {
// 1. Get the user
const user = await db.user.findFirst({ where: { email: email.toLowerCase() } })
// 2. Generate the token and expiration date.
const token = generateToken()
const hashedToken = hash256(token)
const expiresAt = new Date()
expiresAt.setHours(expiresAt.getHours() + RESET_PASSWORD_TOKEN_EXPIRATION_IN_HOURS)
// 3. If user with this email was found
if (user) {
// 4. Delete any existing password reset tokens
await db.token.deleteMany({ where: { type: "RESET_PASSWORD", userId: user.id } })
// 5. Save this new token in the database.
await db.token.create({
data: {
user: { connect: { id: user.id } },
type: "RESET_PASSWORD",
expiresAt,
hashedToken,
sentTo: user.email,
},
})
// 6. Send the email
await forgotPasswordMailer({ to: user.email, token }).send()
} else {
// 7. If no user found wait the same time so attackers can't tell the difference
await new Promise((resolve) => setTimeout(resolve, 750))
}
// 8. Return the same result whether a password reset email was sent or not
return
})

View File

@@ -0,0 +1,31 @@
import { resolver, SecurePassword, AuthenticationError } from "blitz"
import db from "db"
import { Login } from "../validations"
import { Role } from "types"
export const authenticateUser = async (rawEmail: string, rawPassword: string) => {
const email = rawEmail.toLowerCase().trim()
const password = rawPassword.trim()
const user = await db.user.findFirst({ where: { email } })
if (!user) throw new AuthenticationError()
const result = await SecurePassword.verify(user.hashedPassword, password)
if (result === SecurePassword.VALID_NEEDS_REHASH) {
// Upgrade hashed password with a more secure hash
const improvedHash = await SecurePassword.hash(password)
await db.user.update({ where: { id: user.id }, data: { hashedPassword: improvedHash } })
}
const { hashedPassword, ...rest } = user
return rest
}
export default resolver.pipe(resolver.zod(Login), async ({ email, password }, ctx) => {
// This throws an error if credentials are invalid
const user = await authenticateUser(email, password)
await ctx.session.$create({ userId: user.id, role: user.role as Role })
return user
})

View File

@@ -0,0 +1,5 @@
import { Ctx } from "blitz"
export default async function logout(_: any, ctx: Ctx) {
return await ctx.session.$revoke()
}

View File

@@ -0,0 +1,82 @@
import resetPassword from "./resetPassword"
import db from "db"
import { hash256, SecurePassword } from "blitz"
beforeEach(async () => {
await db.$reset()
})
const mockCtx: any = {
session: {
$create: jest.fn,
},
}
describe("resetPassword mutation", () => {
it("works correctly", async () => {
expect(true).toBe(true)
// Create test user
const goodToken = "randomPasswordResetToken"
const expiredToken = "expiredRandomPasswordResetToken"
const future = new Date()
future.setHours(future.getHours() + 4)
const past = new Date()
past.setHours(past.getHours() - 4)
const user = await db.user.create({
data: {
email: "user@example.com",
tokens: {
// Create old token to ensure it's deleted
create: [
{
type: "RESET_PASSWORD",
hashedToken: hash256(expiredToken),
expiresAt: past,
sentTo: "user@example.com",
},
{
type: "RESET_PASSWORD",
hashedToken: hash256(goodToken),
expiresAt: future,
sentTo: "user@example.com",
},
],
},
},
include: { tokens: true },
})
const newPassword = "newPassword"
// Non-existent token
await expect(
resetPassword({ token: "no-token", password: "", passwordConfirmation: "" }, mockCtx)
).rejects.toThrowError()
// Expired token
await expect(
resetPassword(
{ token: expiredToken, password: newPassword, passwordConfirmation: newPassword },
mockCtx
)
).rejects.toThrowError()
// Good token
await resetPassword(
{ token: goodToken, password: newPassword, passwordConfirmation: newPassword },
mockCtx
)
// Delete's the token
const numberOfTokens = await db.token.count({ where: { userId: user.id } })
expect(numberOfTokens).toBe(0)
// Updates user's password
const updatedUser = await db.user.findFirst({ where: { id: user.id } })
expect(await SecurePassword.verify(updatedUser!.hashedPassword, newPassword)).toBe(
SecurePassword.VALID
)
})
})

View File

@@ -0,0 +1,47 @@
import { resolver, SecurePassword, hash256 } from "blitz"
import db from "db"
import { ResetPassword } from "../validations"
import login from "./login"
export class ResetPasswordError extends Error {
name = "ResetPasswordError"
message = "Reset password link is invalid or it has expired."
}
export default resolver.pipe(resolver.zod(ResetPassword), async ({ password, token }, ctx) => {
// 1. Try to find this token in the database
const hashedToken = hash256(token)
const possibleToken = await db.token.findFirst({
where: { hashedToken, type: "RESET_PASSWORD" },
include: { user: true },
})
// 2. If token not found, error
if (!possibleToken) {
throw new ResetPasswordError()
}
const savedToken = possibleToken
// 3. Delete token so it can't be used again
await db.token.delete({ where: { id: savedToken.id } })
// 4. If token has expired, error
if (savedToken.expiresAt < new Date()) {
throw new ResetPasswordError()
}
// 5. Since token is valid, now we can update the user's password
const hashedPassword = await SecurePassword.hash(password.trim())
const user = await db.user.update({
where: { id: savedToken.userId },
data: { hashedPassword },
})
// 6. Revoke all existing login sessions for this user
await db.session.deleteMany({ where: { userId: user.id } })
// 7. Now log the user in with the new credentials
await login({ email: user.email, password }, ctx)
return true
})

View File

@@ -0,0 +1,15 @@
import { resolver, SecurePassword } from "blitz"
import db from "db"
import { Signup } from "app/auth/validations"
import { Role } from "types"
export default resolver.pipe(resolver.zod(Signup), async ({ email, password }, ctx) => {
const hashedPassword = await SecurePassword.hash(password.trim())
const user = await db.user.create({
data: { email: email.toLowerCase().trim(), hashedPassword, role: "USER" },
select: { id: true, name: true, email: true, role: true },
})
await ctx.session.$create({ userId: user.id, role: user.role as Role })
return user
})

View File

@@ -0,0 +1,48 @@
import { BlitzPage, useMutation } from "blitz"
import Layout from "app/core/layouts/Layout"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import { ForgotPassword } from "app/auth/validations"
import forgotPassword from "app/auth/mutations/forgotPassword"
const ForgotPasswordPage: BlitzPage = () => {
const [forgotPasswordMutation, { isSuccess }] = useMutation(forgotPassword)
return (
<div>
<h1>Forgot your password?</h1>
{isSuccess ? (
<div>
<h2>Request Submitted</h2>
<p>
If your email is in our system, you will receive instructions to reset your password
shortly.
</p>
</div>
) : (
<Form
submitText="Send Reset Password Instructions"
schema={ForgotPassword}
initialValues={{ email: "" }}
onSubmit={async (values) => {
try {
await forgotPasswordMutation(values)
} catch (error: any) {
return {
[FORM_ERROR]: "Sorry, we had an unexpected error. Please try again.",
}
}
}}
>
<LabeledTextField name="email" label="Email" placeholder="Email" />
</Form>
)}
</div>
)
}
ForgotPasswordPage.redirectAuthenticatedTo = "/"
ForgotPasswordPage.getLayout = (page) => <Layout title="Forgot Your Password?">{page}</Layout>
export default ForgotPasswordPage

View File

@@ -0,0 +1,32 @@
import { useRouter, BlitzPage } from "blitz"
import Layout from "app/core/layouts/Layout"
import { LoginForm } from "app/auth/components/LoginForm"
import type { GetStaticProps } from "blitz"
import { I18nProps } from "next-rosetta"
import type { MyLocale } from "app/core/i18n"
const LoginPage: BlitzPage = () => {
const router = useRouter()
return (
<div>
<LoginForm
onSuccess={() => {
const next = router.query.next ? decodeURIComponent(router.query.next as string) : "/"
router.push(next)
}}
/>
</div>
)
}
LoginPage.redirectAuthenticatedTo = "/"
LoginPage.getLayout = (page) => <Layout title="Log In">{page}</Layout>
export const getStaticProps: GetStaticProps<I18nProps<MyLocale>> = async (context) => {
const locale = context.locale || context.defaultLocale
const { table = {} } = await import(`app/core/i18n/${locale}`) // Import locale
return { props: { table } } // Passed to `/pages/_app.tsx`
}
export default LoginPage

View File

@@ -0,0 +1,60 @@
import { BlitzPage, useRouterQuery, Link, useMutation } from "blitz"
import Layout from "app/core/layouts/Layout"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import { ResetPassword } from "app/auth/validations"
import resetPassword from "app/auth/mutations/resetPassword"
import { Routes } from ".blitz"
const ResetPasswordPage: BlitzPage = () => {
const query = useRouterQuery()
const [resetPasswordMutation, { isSuccess }] = useMutation(resetPassword)
return (
<div>
<h1>Set a New Password</h1>
{isSuccess ? (
<div>
<h2>Password Reset Successfully</h2>
<p>
Go to the <Link href={Routes.Home()}>homepage</Link>
</p>
</div>
) : (
<Form
submitText="Reset Password"
schema={ResetPassword}
initialValues={{ password: "", passwordConfirmation: "", token: query.token as string }}
onSubmit={async (values) => {
try {
await resetPasswordMutation(values)
} catch (error: any) {
if (error.name === "ResetPasswordError") {
return {
[FORM_ERROR]: error.message,
}
} else {
return {
[FORM_ERROR]: "Sorry, we had an unexpected error. Please try again.",
}
}
}
}}
>
<LabeledTextField name="password" label="New Password" type="password" />
<LabeledTextField
name="passwordConfirmation"
label="Confirm New Password"
type="password"
/>
</Form>
)}
</div>
)
}
ResetPasswordPage.redirectAuthenticatedTo = "/"
ResetPasswordPage.getLayout = (page) => <Layout title="Reset Your Password">{page}</Layout>
export default ResetPasswordPage

View File

@@ -0,0 +1,19 @@
import { useRouter, BlitzPage } from "blitz"
import Layout from "app/core/layouts/Layout"
import { SignupForm } from "app/auth/components/SignupForm"
import { Routes } from ".blitz"
const SignupPage: BlitzPage = () => {
const router = useRouter()
return (
<div>
<SignupForm onSuccess={() => router.push(Routes.Home())} />
</div>
)
}
SignupPage.redirectAuthenticatedTo = "/"
SignupPage.getLayout = (page) => <Layout title="Sign Up">{page}</Layout>
export default SignupPage

View File

@@ -0,0 +1,33 @@
import { z } from "zod"
const password = z.string().min(10).max(100)
export const Signup = z.object({
email: z.string().email(),
password,
})
export const Login = z.object({
email: z.string().email(),
password: z.string(),
})
export const ForgotPassword = z.object({
email: z.string().email(),
})
export const ResetPassword = z
.object({
password: password,
passwordConfirmation: password,
token: z.string(),
})
.refine((data) => data.password === data.passwordConfirmation, {
message: "Passwords don't match",
path: ["passwordConfirmation"], // set the path of the error
})
export const ChangePassword = z.object({
currentPassword: z.string(),
newPassword: password,
})

View File

@@ -0,0 +1,59 @@
import { ReactNode, PropsWithoutRef } from "react"
import { Form as FinalForm, FormProps as FinalFormProps } from "react-final-form"
import { z } from "zod"
import { validateZodSchema } from "blitz"
export { FORM_ERROR } from "final-form"
export interface FormProps<S extends z.ZodType<any, any>>
extends Omit<PropsWithoutRef<JSX.IntrinsicElements["form"]>, "onSubmit"> {
/** All your form fields */
children?: ReactNode
/** Text to display in the submit button */
submitText?: string
schema?: S
onSubmit: FinalFormProps<z.infer<S>>["onSubmit"]
initialValues?: FinalFormProps<z.infer<S>>["initialValues"]
}
export function Form<S extends z.ZodType<any, any>>({
children,
submitText,
schema,
initialValues,
onSubmit,
...props
}: FormProps<S>) {
return (
<FinalForm
initialValues={initialValues}
validate={validateZodSchema(schema)}
onSubmit={onSubmit}
render={({ handleSubmit, submitting, submitError }) => (
<form onSubmit={handleSubmit} className="form" {...props}>
{/* Form fields supplied as children are rendered here */}
{children}
{submitError && (
<div role="alert" style={{ color: "red" }}>
{submitError}
</div>
)}
{submitText && (
<button type="submit" disabled={submitting}>
{submitText}
</button>
)}
<style global jsx>{`
.form > * + * {
margin-top: 1rem;
}
`}</style>
</form>
)}
/>
)
}
export default Form

View File

@@ -0,0 +1,66 @@
import { forwardRef, ComponentPropsWithoutRef, PropsWithoutRef } from "react"
import { useField, UseFieldConfig } from "react-final-form"
export interface LabeledTextFieldProps extends PropsWithoutRef<JSX.IntrinsicElements["input"]> {
/** Field name. */
name: string
/** Field label. */
label: string
/** Field type. Doesn't include radio buttons and checkboxes */
type?: "text" | "password" | "email" | "number"
outerProps?: PropsWithoutRef<JSX.IntrinsicElements["div"]>
labelProps?: ComponentPropsWithoutRef<"label">
fieldProps?: UseFieldConfig<string>
}
export const LabeledTextField = forwardRef<HTMLInputElement, LabeledTextFieldProps>(
({ name, label, outerProps, fieldProps, labelProps, ...props }, ref) => {
const {
input,
meta: { touched, error, submitError, submitting },
} = useField(name, {
parse:
props.type === "number"
? (Number as any)
: // Converting `""` to `null` ensures empty values will be set to null in the DB
(v) => (v === "" ? null : v),
...fieldProps,
})
const normalizedError = Array.isArray(error) ? error.join(", ") : error || submitError
return (
<div {...outerProps}>
<label {...labelProps}>
{label}
<input {...input} disabled={submitting} {...props} ref={ref} />
</label>
{touched && normalizedError && (
<div role="alert" style={{ color: "red" }}>
{normalizedError}
</div>
)}
<style jsx>{`
label {
display: flex;
flex-direction: column;
align-items: start;
font-size: 1rem;
}
input {
font-size: 1rem;
padding: 0.25rem 0.5rem;
border-radius: 3px;
border: 1px solid purple;
appearance: none;
margin-top: 0.5rem;
}
`}</style>
</div>
)
}
)
export default LabeledTextField

View File

@@ -0,0 +1,7 @@
import { useQuery } from "blitz"
import getCurrentUser from "app/users/queries/getCurrentUser"
export const useCurrentUser = () => {
const [user] = useQuery(getCurrentUser, null)
return user
}

View File

@@ -0,0 +1,42 @@
import type { MyLocale } from "."
export const table: MyLocale = {
locale: "English",
home: {
logout: "Logout",
userId: "User Id",
userRole: "User Role",
signUp: "Sign Up",
login: "Login",
welcome: {
part1: "Congrats!",
part2: " Your app is ready, including user sign-up and log-in.",
},
paragraph: {
line1: "To add a new model to your app,",
line2: "run the following in your terminal:",
},
code: "blitz generate all project name:string",
parenthesis: "(And select Yes to run prisma migrate)",
restart: {
part1: "Then ",
part2: "restart the server",
},
goto: "and go to",
project: "/projects",
documentationLink: "Documentation",
githubLink: "Github Repo",
discordLink: "Discord Community",
footer: "Powered by Blitz.js",
},
loginPage: {
login: "Login",
credentialError: "Sorry, those credentials are invalid",
unexpectedError: "Sorry, we had an unexpected error. Please try again. - {{message}}",
forgotPassword: "Forgot your password?",
signUp: "Sign Up",
email: "Email",
password: "Password",
or: "Or",
},
}

View File

@@ -0,0 +1,43 @@
import type { MyLocale } from "."
export const table: MyLocale = {
locale: "Français",
home: {
logout: "Deconnexion",
userId: "Id",
userRole: "Role",
signUp: "Créez un compte",
login: "Connexion",
welcome: {
part1: "Bravo!",
part2:
" Votre application est prête, incluant la création de compte utilisateurs et la connexion.",
},
paragraph: {
line1: "Pour rajouter un modèle à votre application,",
line2: "exécutez ce qui suit dans votre terminal:",
},
code: "blitz generate all project name:string",
parenthesis: '(Et sélectionnez "Yes to run prisma migrate")',
restart: {
part1: "Ensuite ",
part2: "redémarrez le serveur",
},
goto: "et allez sur",
project: "/projects",
documentationLink: "Documentation",
githubLink: "Github",
discordLink: "Communauté Discord",
footer: "Crée avec Blitz.js",
},
loginPage: {
login: "Connexion",
credentialError: "Désolé, l'identifiant et le mot de passe sont invalide.",
unexpectedError: "Désolé, erreur inatendue. Essayez à nouveau. - {{message}}",
forgotPassword: "Vous avez oublié votre mot de passe?",
signUp: "Enregistrez-vous",
email: "Courriel",
password: "Mot de passe",
or: "Ou",
},
}

View File

@@ -0,0 +1,42 @@
// Check: https://github.com/useflyyer/next-rosetta
export interface MyLocale {
locale: string
home: {
logout: string
userId: string
userRole: string
signUp: string
login: string
welcome: {
part1: string
part2: string
}
paragraph: {
line1: string
line2: string
}
code: string
parenthesis: string
restart: {
part1: string
part2: string
}
goto: string
project: string
documentationLink: string
githubLink: string
discordLink: string
footer: string
}
loginPage: {
login: string
credentialError: string
unexpectedError: string
forgotPassword: string
signUp: string
email: string
password: string
or: string
}
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from "react"
import { Head } from "blitz"
type LayoutProps = {
title?: string
children: ReactNode
}
const Layout = ({ title, children }: LayoutProps) => {
return (
<>
<Head>
<title>{title || "blitzI18nRosetta"}</title>
<link rel="icon" href="/favicon.ico" />
</Head>
{children}
</>
)
}
export default Layout

View File

@@ -0,0 +1,19 @@
import { Head, ErrorComponent } from "blitz"
// ------------------------------------------------------
// 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,43 @@
import {
AppProps,
ErrorBoundary,
ErrorComponent,
AuthenticationError,
AuthorizationError,
ErrorFallbackProps,
useQueryErrorResetBoundary,
} from "blitz"
import LoginForm from "app/auth/components/LoginForm"
import { I18nProvider } from "next-rosetta"
export default function App({ Component, pageProps }: AppProps) {
const getLayout = Component.getLayout || ((page) => page)
return (
<I18nProvider table={pageProps.table}>
<ErrorBoundary
FallbackComponent={RootErrorFallback}
onReset={useQueryErrorResetBoundary().reset}
>
{getLayout(<Component {...pageProps} />)}
</ErrorBoundary>
</I18nProvider>
)
}
function RootErrorFallback({ error, resetErrorBoundary }: ErrorFallbackProps) {
if (error instanceof AuthenticationError) {
return <LoginForm onSuccess={resetErrorBoundary} />
} else if (error instanceof AuthorizationError) {
return (
<ErrorComponent
statusCode={error.statusCode}
title="Sorry, you are not authorized to access this"
/>
)
} else {
return (
<ErrorComponent statusCode={error.statusCode || 400} title={error.message || error.name} />
)
}
}

View File

@@ -0,0 +1,23 @@
import { Document, Html, DocumentHead, Main, BlitzScript /*DocumentContext*/ } from "blitz"
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">
<DocumentHead />
<body>
<Main />
<BlitzScript />
</body>
</Html>
)
}
}
export default MyDocument

View File

@@ -0,0 +1,25 @@
import { render } from "test/utils"
import Home from "./index"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"
jest.mock("app/core/hooks/useCurrentUser")
const mockUseCurrentUser = useCurrentUser as jest.MockedFunction<typeof useCurrentUser>
test.skip("renders blitz documentation link", () => {
// This is an example of how to ensure a specific item is in the document
// But it's disabled by default (by test.skip) so the test doesn't fail
// when you remove the the default content from the page
// This is an example on how to mock api hooks when testing
mockUseCurrentUser.mockReturnValue({
id: 1,
name: "User",
email: "user@email.com",
role: "user",
})
const { getByText } = render(<Home />)
const linkElement = getByText(/Documentation/i)
expect(linkElement).toBeInTheDocument()
})

View File

@@ -0,0 +1,301 @@
import { Suspense } from "react"
import { Image, Link, BlitzPage, useMutation } from "blitz"
import Layout from "app/core/layouts/Layout"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"
import logout from "app/auth/mutations/logout"
import logo from "public/logo.png"
import type { GetStaticProps } from "blitz"
import { useI18n, I18nProps } from "next-rosetta"
import type { MyLocale } from "app/core/i18n"
import { Routes } from ".blitz"
/*
* This file is just for a pleasant getting started page for your new app.
* You can delete everything in here and start from scratch if you like.
*/
const UserInfo = () => {
const currentUser = useCurrentUser()
const [logoutMutation] = useMutation(logout)
const { t } = useI18n<MyLocale>()
if (currentUser) {
return (
<>
<button
className="button small"
onClick={async () => {
await logoutMutation()
}}
>
{t("home.logout")}
</button>
<div>
{t("home.userId")}: <code>{currentUser.id}</code>
<br />
{t("home.userRole")}: <code>{currentUser.role}</code>
</div>
</>
)
} else {
return (
<>
<Link href={Routes.SignupPage()}>
<a className="button small">
<strong>{t("home.signUp")}</strong>
</a>
</Link>
<Link href={Routes.LoginPage()}>
<a className="button small">
<strong>{t("home.login")}</strong>
</a>
</Link>
</>
)
}
}
const LangSelect = () => {
return (
<div>
<Link href="/" locale="en">
English
</Link>{" "}
<Link href="/" locale="fr">
Français
</Link>
</div>
)
}
const Home: BlitzPage = () => {
const { t } = useI18n<MyLocale>()
return (
<div className="container">
<LangSelect></LangSelect>
<main>
<div className="logo">
<Image src={logo} alt="blitzjs" />
</div>
<p>
<strong>{t("home.welcome.part1")}</strong>
{t("home.welcome.part2")}
</p>
<div className="buttons" style={{ marginTop: "1rem", marginBottom: "1rem" }}>
<Suspense fallback="Loading...">
<UserInfo />
</Suspense>
</div>
<p>
<strong>
{t("home.paragraph.line1")}
<br />
{t("home.paragraph.line2")}
</strong>
</p>
<pre>
<code>{t("home.code")}</code>
</pre>
<div style={{ marginBottom: "1rem" }}>{t("home.parenthesis")}</div>
<div>
<p>
{t("home.restart.part1")}
<strong>{t("home.restart.part2")}</strong>
</p>
<pre>
<code>Ctrl + c</code>
</pre>
<pre>
<code>blitz dev</code>
</pre>
<p>
{t("home.goto")}{" "}
<Link href="/projects">
<a>{t("home.project")}</a>
</Link>
</p>
</div>
<div className="buttons" style={{ marginTop: "5rem" }}>
<a
className="button"
href="https://blitzjs.com/docs/getting-started?utm_source=blitz-new&utm_medium=app-template&utm_campaign=blitz-new"
target="_blank"
rel="noopener noreferrer"
>
{t("home.documentationLink")}
</a>
<a
className="button-outline"
href="https://github.com/blitz-js/blitz"
target="_blank"
rel="noopener noreferrer"
>
{t("home.githubLink")}
</a>
<a
className="button-outline"
href="https://discord.blitzjs.com"
target="_blank"
rel="noopener noreferrer"
>
{t("home.discordLink")}
</a>
</div>
</main>
<footer>
<a
href="https://blitzjs.com?utm_source=blitz-new&utm_medium=app-template&utm_campaign=blitz-new"
target="_blank"
rel="noopener noreferrer"
>
{t("home.footer")}
</a>
</footer>
<style jsx global>{`
@import url("https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@300;700&display=swap");
html,
body {
padding: 0;
margin: 0;
font-family: "Libre Franklin", -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
box-sizing: border-box;
}
.container {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
main p {
font-size: 1.2rem;
}
p {
text-align: center;
}
footer {
width: 100%;
height: 60px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
background-color: #45009d;
}
footer a {
display: flex;
justify-content: center;
align-items: center;
}
footer a {
color: #f4f4f4;
text-decoration: none;
}
.logo {
margin-bottom: 2rem;
}
.logo img {
width: 300px;
}
.buttons {
display: grid;
grid-auto-flow: column;
grid-gap: 0.5rem;
}
.button {
font-size: 1rem;
background-color: #6700eb;
padding: 1rem 2rem;
color: #f4f4f4;
text-align: center;
}
.button.small {
padding: 0.5rem 1rem;
}
.button:hover {
background-color: #45009d;
}
.button-outline {
border: 2px solid #6700eb;
padding: 1rem 2rem;
color: #6700eb;
text-align: center;
}
.button-outline:hover {
border-color: #45009d;
color: #45009d;
}
pre {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
text-align: center;
}
code {
font-size: 0.9rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
margin-top: 3rem;
}
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
}
`}</style>
</div>
)
}
Home.suppressFirstRenderFlicker = true
Home.getLayout = (page) => <Layout title="Home">{page}</Layout>
export const getStaticProps: GetStaticProps<I18nProps<MyLocale>> = async (context) => {
const locale = context.locale || context.defaultLocale
const { table = {} } = await import(`app/core/i18n/${locale}`) // Import locale
return { props: { table } } // Passed to `/pages/_app.tsx`
}
export default Home

View File

@@ -0,0 +1,13 @@
import { Ctx } from "blitz"
import db from "db"
export default async function getCurrentUser(_ = null, { session }: Ctx) {
if (!session.userId) return null
const user = await db.user.findFirst({
where: { id: session.userId },
select: { id: true, name: true, email: true, role: true },
})
return user
}

View File

@@ -0,0 +1,4 @@
module.exports = {
presets: ["blitz/babel"],
plugins: [],
}

View File

@@ -0,0 +1,26 @@
import { BlitzConfig, sessionMiddleware, simpleRolesIsAuthorized } from "blitz"
const config: BlitzConfig = {
middleware: [
sessionMiddleware({
cookiePrefix: "i18n-next-rosetta-examples",
isAuthorized: simpleRolesIsAuthorized,
}),
],
/* Uncomment this to customize the webpack config
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
// Important: return the modified config
return config
},
*/
i18n: {
// These are all the locales you want to support
locales: ["en", "fr"],
// This is the default locale you want to be used when visiting
// a path without locale prefix e.g. `/users`
defaultLocale: "en",
},
}
module.exports = config

View File

@@ -0,0 +1,7 @@
import { enhancePrisma } from "blitz"
import { PrismaClient } from "@prisma/client"
const EnhancedPrisma = enhancePrisma(PrismaClient)
export * from "@prisma/client"
export default new EnhancedPrisma()

View File

@@ -0,0 +1,47 @@
-- CreateTable
CREATE TABLE "User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"name" TEXT,
"email" TEXT NOT NULL,
"hashedPassword" TEXT,
"role" TEXT NOT NULL DEFAULT 'USER'
);
-- CreateTable
CREATE TABLE "Session" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"expiresAt" DATETIME,
"handle" TEXT NOT NULL,
"hashedSessionToken" TEXT,
"antiCSRFToken" TEXT,
"publicData" TEXT,
"privateData" TEXT,
"userId" INTEGER,
CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "Token" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"hashedToken" TEXT NOT NULL,
"type" TEXT NOT NULL,
"expiresAt" DATETIME NOT NULL,
"sentTo" TEXT NOT NULL,
"userId" INTEGER NOT NULL,
CONSTRAINT "Token_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
-- CreateIndex
CREATE UNIQUE INDEX "Session_handle_key" ON "Session"("handle");
-- CreateIndex
CREATE UNIQUE INDEX "Token_hashedToken_type_key" ON "Token"("hashedToken", "type");

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "sqlite"

View File

@@ -0,0 +1,65 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "sqlite"
url = "file:./db.sqlite"
}
generator client {
provider = "prisma-client-js"
}
// --------------------------------------
model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String?
email String @unique
hashedPassword String?
role String @default("USER")
tokens Token[]
sessions Session[]
}
model Session {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
expiresAt DateTime?
handle String @unique
hashedSessionToken String?
antiCSRFToken String?
publicData String?
privateData String?
user User? @relation(fields: [userId], references: [id])
userId Int?
}
model Token {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
hashedToken String
type String
// See note below about TokenType enum
// type TokenType
expiresAt DateTime
sentTo String
user User @relation(fields: [userId], references: [id])
userId Int
@@unique([hashedToken, type])
}
// NOTE: It's highly recommended to use an enum for the token type
// but enums only work in Postgres.
// See: https://blitzjs.com/docs/database-overview#switch-to-postgre-sql
// enum TokenType {
// RESET_PASSWORD
// }

View File

@@ -0,0 +1,15 @@
// import db from "./index"
/*
* This seed function is executed when you run `blitz db seed`.
*
* Probably you want to use a library like https://chancejs.com
* to easily generate realistic data.
*/
const seed = async () => {
// for (let i = 0; i < 5; i++) {
// await db.project.create({ data: { name: "Project " + i } })
// }
}
export default seed

View File

@@ -0,0 +1,7 @@
import type { Config } from "@jest/types"
const config: Config.InitialOptions = {
preset: "blitz",
}
export default config

View File

@@ -0,0 +1,45 @@
/* TODO - You need to add a mailer integration in `integrations/` and import here.
*
* The integration file can be very simple. Instantiate the email client
* and then export it. That way you can import here and anywhere else
* and use it straight away.
*/
type ResetPasswordMailer = {
to: string
token: string
}
export function forgotPasswordMailer({ to, token }: ResetPasswordMailer) {
// In production, set APP_ORIGIN to your production server origin
const origin = process.env.APP_ORIGIN || process.env.BLITZ_DEV_SERVER_ORIGIN
const resetUrl = `${origin}/reset-password?token=${token}`
const msg = {
from: "TODO@example.com",
to,
subject: "Your Password Reset Instructions",
html: `
<h1>Reset Your Password</h1>
<h3>NOTE: You must set up a production email integration in mailers/forgotPasswordMailer.ts</h3>
<a href="${resetUrl}">
Click here to set a new password
</a>
`,
}
return {
async send() {
if (process.env.NODE_ENV === "production") {
// TODO - send the production email, like this:
// await postmark.sendEmail(msg)
throw new Error("No production email implementation in mailers/forgotPasswordMailer")
} else {
// Preview email in the browser
const previewEmail = (await import("preview-email")).default
await previewEmail(msg)
}
},
}
}

View File

@@ -0,0 +1,49 @@
{
"name": "@examples/i18n-next-rosetta",
"version": "1.0.0",
"scripts": {
"dev": "blitz dev",
"build": "blitz build",
"start": "blitz start",
"studio": "blitz prisma studio",
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
"test": "prisma generate && blitz codegen && yarn test:jest",
"test:jest": "jest",
"test:watch": "jest --watch",
"prepare": "husky install"
},
"prisma": {
"schema": "db/schema.prisma"
},
"prettier": {
"semi": false,
"printWidth": 100
},
"lint-staged": {
"*.{js,ts,tsx}": [
"eslint --fix"
]
},
"dependencies": {
"@prisma/client": "2.24.1",
"blitz": "0.45.4",
"final-form": "4.20.1",
"next-rosetta": "1.3.1",
"react": "0.0.0-experimental-6a589ad71",
"react-dom": "0.0.0-experimental-6a589ad71",
"react-final-form": "6.5.2",
"zod": "3.10.1"
},
"devDependencies": {
"@types/preview-email": "2.0.0",
"@types/react": "17.0.2",
"eslint": "7.21.0",
"husky": "5.1.2",
"lint-staged": "10.5.4",
"prettier": "2.2.1",
"pretty-quick": "3.1.0",
"preview-email": "3.0.3",
"prisma": "2.24.1"
},
"private": true
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,4 @@
// This is the jest 'setupFilesAfterEnv' setup file
// It's a good place to set globals, add global before/after hooks, etc
export {} // so TS doesn't complain

View File

@@ -0,0 +1,105 @@
import { RouterContext, BlitzRouter, BlitzProvider } from "blitz"
import { render as defaultRender } from "@testing-library/react"
import { renderHook as defaultRenderHook } from "@testing-library/react-hooks"
export * from "@testing-library/react"
// --------------------------------------------------------------------------------
// This file customizes the render() and renderHook() test functions provided
// by React testing library. It adds a router context wrapper with a mocked router.
//
// You should always import `render` and `renderHook` from this file
//
// This is the place to add any other context providers you need while testing.
// --------------------------------------------------------------------------------
// --------------------------------------------------
// render()
// --------------------------------------------------
// Override the default test render with our own
//
// You can override the router mock like this:
//
// const { baseElement } = render(<MyComponent />, {
// router: { pathname: '/my-custom-pathname' },
// });
// --------------------------------------------------
export function render(
ui: RenderUI,
{ wrapper, router, dehydratedState, ...options }: RenderOptions = {}
) {
if (!wrapper) {
// Add a default context wrapper if one isn't supplied from the test
wrapper = ({ children }) => (
<BlitzProvider dehydratedState={dehydratedState}>
<RouterContext.Provider value={{ ...mockRouter, ...router }}>
{children}
</RouterContext.Provider>
</BlitzProvider>
)
}
return defaultRender(ui, { wrapper, ...options })
}
// --------------------------------------------------
// renderHook()
// --------------------------------------------------
// Override the default test renderHook with our own
//
// You can override the router mock like this:
//
// const result = renderHook(() => myHook(), {
// router: { pathname: '/my-custom-pathname' },
// });
// --------------------------------------------------
export function renderHook(
hook: RenderHook,
{ wrapper, router, dehydratedState, ...options }: RenderHookOptions = {}
) {
if (!wrapper) {
// Add a default context wrapper if one isn't supplied from the test
wrapper = ({ children }) => (
<BlitzProvider dehydratedState={dehydratedState}>
<RouterContext.Provider value={{ ...mockRouter, ...router }}>
{children}
</RouterContext.Provider>
</BlitzProvider>
)
}
return defaultRenderHook(hook, { wrapper, ...options })
}
export const mockRouter: BlitzRouter = {
basePath: "",
pathname: "/",
route: "/",
asPath: "/",
params: {},
query: {},
isReady: true,
isLocaleDomain: false,
isPreview: false,
push: jest.fn(),
replace: jest.fn(),
reload: jest.fn(),
back: jest.fn(),
prefetch: jest.fn(),
beforePopState: jest.fn(),
events: {
on: jest.fn(),
off: jest.fn(),
emit: jest.fn(),
},
isFallback: false,
}
type DefaultParams = Parameters<typeof defaultRender>
type RenderUI = DefaultParams[0]
type RenderOptions = DefaultParams[1] & { router?: Partial<BlitzRouter>; dehydratedState?: unknown }
type DefaultHookParams = Parameters<typeof defaultRenderHook>
type RenderHook = DefaultHookParams[0]
type RenderHookOptions = DefaultHookParams[1] & {
router?: Partial<BlitzRouter>
dehydratedState?: unknown
}

View File

@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"baseUrl": "./",
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"noUncheckedIndexedAccess": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo"
},
"exclude": ["node_modules", "**/*.e2e.ts", "cypress"],
"include": ["blitz-env.d.ts", "**/*.ts", "**/*.tsx"]
}

View File

@@ -0,0 +1,18 @@
import { DefaultCtx, SessionContext, SimpleRolesIsAuthorized } from "blitz"
import { User } from "db"
// Note: You should switch to Postgres and then use a DB enum for role type
export type Role = "ADMIN" | "USER"
declare module "blitz" {
export interface Ctx extends DefaultCtx {
session: SessionContext
}
export interface Session {
isAuthorized: SimpleRolesIsAuthorized<Role>
PublicData: {
userId: User["id"]
role: Role
}
}
}

View File

@@ -26,7 +26,7 @@
]
},
"dependencies": {
"blitz": "0.41.2-canary.1",
"blitz": "0.45.4",
"knex": "0.21.16",
"react": "0.0.0-experimental-6a589ad71",
"react-dom": "0.0.0-experimental-6a589ad71",

View File

@@ -33,7 +33,7 @@
},
"dependencies": {
"@prisma/client": "2.24.1",
"blitz": "0.41.2-canary.1",
"blitz": "0.45.4",
"prisma": "2.24.1",
"react": "0.0.0-experimental-6a589ad71",
"react-dom": "0.0.0-experimental-6a589ad71"

View File

@@ -1,12 +1,13 @@
import { BlitzPage } from "blitz"
import { BlitzPage, Image } from "blitz"
import Layout from "app/core/layouts/Layout"
import logo from "public/logo.png"
const Home: BlitzPage = () => {
return (
<div className="container">
<main>
<div className="logo">
<img src="/logo.png" alt="blitz.js" />
<Image src={logo} alt="blitz.js" />
</div>
<p>
<strong>Congrats!</strong> Your static app is ready.

View File

@@ -33,7 +33,7 @@
},
"dependencies": {
"@prisma/client": "2.24.1",
"blitz": "0.41.2-canary.1",
"blitz": "0.45.4",
"final-form": "4.20.1",
"prisma": "2.24.1",
"react": "0.0.0-experimental-6a589ad71",

View File

@@ -21,7 +21,7 @@
},
"dependencies": {
"@prisma/client": "2.24.1",
"blitz": "0.41.2-canary.1",
"blitz": "0.45.4",
"final-form": "4.20.1",
"prisma": "2.24.1",
"react": "0.0.0-experimental-6a589ad71",

View File

@@ -1,5 +1,5 @@
{
"version": "0.41.2-canary.2",
"version": "0.45.4",
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,

View File

@@ -1 +1 @@
14.18.1
16.13.0

View File

@@ -12,6 +12,7 @@
"dev": "lerna run dev --stream --parallel",
"dev2": "while true; do yarn --check-files && yarn dev; done",
"testonly": "jest --runInBand",
"testonly:packages": "ultra -r --filter \"packages/*\" --concurrency 15 test",
"testheadless": "cross-env HEADLESS=true yarn testonly",
"testsafari": "cross-env BROWSER_NAME=safari yarn testonly",
"testfirefox": "cross-env BROWSER_NAME=firefox yarn testonly",
@@ -60,8 +61,8 @@
"@types/passport": "1.0.5",
"@types/sharp": "0.28.4",
"@types/string-hash": "1.1.1",
"@typescript-eslint/eslint-plugin": "4.17.0",
"@typescript-eslint/parser": "^4.20.0",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"@vercel/fetch": "6.1.1",
"@zeit/next-css": "1.0.2-canary.2",
"@zeit/next-sass": "1.0.2-canary.2",
@@ -110,7 +111,7 @@
"lost": "8.3.1",
"minimatch": "3.0.4",
"moment": "^2.24.0",
"node-fetch": "2.6.1",
"node-fetch": "2.6.7",
"node-notifier": "5.4.0",
"node-sass": "5.0.0",
"npm-run-all": "4.1.5",
@@ -144,7 +145,8 @@
"tailwindcss": "1.1.3",
"taskr": "1.1.0",
"tree-kill": "1.2.2",
"typescript": "4.4.2",
"typescript": "4.5.2",
"ultra-runner": "3.10.5",
"wait-port": "0.2.2",
"web-streams-polyfill": "2.1.1",
"webpack-bundle-analyzer": "4.3.0",
@@ -152,7 +154,7 @@
},
"resolutions": {
"browserslist": "4.16.6",
"caniuse-lite": "1.0.30001228"
"caniuse-lite": "1.0.30001274"
},
"engines": {
"node": ">=12.0.0"

View File

@@ -42,8 +42,8 @@
"got": "10.7.0",
"prompts": "2.1.0",
"rimraf": "3.0.0",
"tar": "6.1.11",
"typescript": "4.3.4",
"tar": "4.4.18",
"typescript": "4.5.2",
"update-check": "1.5.4",
"validate-npm-package-name": "3.0.0"
},

View File

@@ -14,7 +14,9 @@ module.exports = {
],
plugins: ['import', 'react', 'jsx-a11y'],
rules: {
'import/no-anonymous-default-export': 'warn',
'import/no-anonymous-default-export': 'error',
'import/no-webpack-loader-syntax': 'off',
'react/display-name': 'off',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'jsx-a11y/alt-text': [
@@ -29,6 +31,7 @@ module.exports = {
'jsx-a11y/aria-unsupported-elements': 'warn',
'jsx-a11y/role-has-required-aria-props': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
'@next/next/no-html-link-for-pages': 'off', // Until we add multi pages support to Blitz
},
parser: './parser.js',
parserOptions: {

View File

@@ -1,18 +1,18 @@
{
"private": true,
"name": "eslint-config-next",
"version": "11.1.0",
"description": "ESLint configuration used by NextJS.",
"name": "eslint-config-blitz",
"version": "0.45.4",
"description": "Blitz.js eslint config",
"main": "index.js",
"license": "MIT",
"repository": {
"url": "vercel/next.js",
"url": "blitz-js/blitz",
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "11.1.0",
"@rushstack/eslint-patch": "^1.0.6",
"@typescript-eslint/parser": "^4.20.0",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"eslint-import-resolver-node": "^0.3.4",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.22.1",

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