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

Compare commits

...

353 Commits

Author SHA1 Message Date
Brandon Bayer
bd440ba8e4 fix test 2021-01-19 16:06:50 -05:00
Brandon Bayer
7454b6c033 fix queries running before session data is fully loaded 2021-01-19 15:55:16 -05:00
Brandon Bayer
fbf9439415 Drastically simplify eslint integration with new eslint-config-blitz package (#1749)
(minor)
2021-01-19 14:54:35 -05:00
depfu[bot]
4bae636085 Update dependencies (2021-01-19) (#1736)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2021-01-19 12:56:12 -05:00
Brandon Bayer
837d3a3126 Fix all queries not being refetched on login (patch) (#1748) 2021-01-19 12:18:50 -05:00
Brandon Bayer
e5baf8c256 Add @marina-ki as a contributor 2021-01-19 11:29:45 -05:00
Brandon Bayer
04ed4952e4 Add @mikeesto as a contributor 2021-01-19 11:27:44 -05:00
Brandon Bayer
39ebadccc1 Change session cookies to have a unique prefixed based on package.json name field (major) (#1743)
* change session cookies to have a unique prefixed based on package.json name field

* fix test
2021-01-19 01:24:09 +00:00
Brandon Bayer
9636017262 (newapp) Add changePassword mutation (#1741) 2021-01-18 18:45:35 -05:00
Brandon Bayer
2fc04d3f02 (newapp) Remove app/auth/auth-utils.ts by moving code into the login mutation (#1740) 2021-01-18 18:44:03 -05:00
allcontributors[bot]
fb8a352349 docs: add bacongravy as a contributor (#1742)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-18 18:43:53 -05:00
David Kramer
a3a32bbbf4 Automatically disable useQuery suspense when not using concurrent mode (#1735)
(patch)
2021-01-18 18:42:30 -05:00
Robert Malko
d39a9e60a5 Add .yalc folder to ignore paths (#1734)
(patch)
2021-01-18 16:22:17 -05:00
allcontributors[bot]
a6247fb570 docs: add tarunama as a contributor (#1739)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-18 16:21:28 -05:00
t.kuriyama
9f22ff7525 Fix blitz generate bug when model name ends with number (#1727)
(patch)
2021-01-18 16:18:15 -05:00
Brandon Bayer
cc3c1f1205 Drastically simplify Jest integration with a Blitz jest preset and by moving test dependencies into blitz. (#1725)
(major)
2021-01-16 15:25:13 -05:00
Robert Malko
66d8aa48a7 Add @malkomalko as L1 Maintainer (#1728)
(meta)
2021-01-16 10:40:29 -05:00
Brandon Bayer
c6ee429e61 fix makeServerOnlyPrisma() not working in Jest tests (patch) (#1726) 2021-01-16 00:25:19 +00:00
Brandon Bayer
b243da00ec Add makeServerOnlyPrisma() utility, allow db in client bundle, and update new app template (#1720)
(major)
2021-01-15 14:51:32 -05:00
Brandon Bayer
38bc98755b Change blitz generate to generate all pages in app/pages/ and update new app structure with app/core/ (#1719)
(major)
2021-01-15 14:50:12 -05:00
Robert Malko
a959ae5b58 Remove console.log from reflexjs recipe (#1722)
(recipe)
2021-01-15 13:58:11 -05:00
Brandon Bayer
7b102f654c Add generateToken() and hash256() utilities (#1721) (minor)
* add `generateToken()` and `hash256()` utilities

* fix bundle size
2021-01-14 18:10:47 -05:00
Brandon Bayer
4b293abc41 v0.29.2 2021-01-13 18:32:01 -05:00
Brandon Bayer
82fe3a0eb5 Fix logout not triggering re-renders for all queries (patch) (#1717) 2021-01-13 18:29:10 -05:00
Brandon Bayer
db7a3e5451 Fix: blitz db seed should not run prisma migrations (#1718) 2021-01-13 18:21:37 -05:00
Brandon Bayer
484f434d8e fix blitz compiler to ignore sqlite files (#1716) 2021-01-13 22:29:16 +00:00
Robert Malko
ddb434f847 (newapp) Fix studio package.json script to use new blitz prisma command (#1709) 2021-01-13 11:04:23 -05:00
Brandon Bayer
103609cf0b v0.29.1 2021-01-12 19:29:18 -05:00
Brandon Bayer
8dbb0bbbdb Fix new apps failing to initialize the database in 0.29.0 (patch) (#1707)
* wip

* more stuff

* more
2021-01-13 00:27:34 +00:00
Brandon Bayer
58a68c83fd fix --help flag for blitz prisma command not being sent to prisma (#1706) 2021-01-12 23:07:48 +00:00
Brandon Bayer
a2a5564a96 v0.29.0 2021-01-12 17:32:14 -05:00
Brandon Bayer
2aab361dbc Add isReady: true to mockRouter in test/utils.tsx for Next.js 10.0.5 (newapp) 2021-01-12 15:01:08 -05:00
allcontributors[bot]
a0f827a351 docs: add ranjan-purbey as a contributor (#1705)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-12 14:38:37 -05:00
Ranjan Purbey
f4bda9f52f Fix extra ms in API log message (#1702)
(patch)
2021-01-12 14:37:20 -05:00
t.kuriyama
92abe2b0b9 Update .eslintrc.js on examples/custom-server to add @typescript-eslint parser/plugin config (#1700)
(meta)
2021-01-12 14:34:31 -05:00
Joaquin Bravo Contreras
62efe3f4ee Prisma 2.13+ Support: Remove all blitz db commands except blitz db seed and use prisma CLI directly (major) (#1661)
Co-authored-by: Brandon Bayer <b@bayer.ws>
2021-01-11 21:41:04 -05:00
allcontributors[bot]
17e08de16b docs: add jackbravo as a contributor (#1699)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-11 19:15:12 -05:00
allcontributors[bot]
31a88aca89 docs: add rembrandtreyes as a contributor (#1698)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-11 18:52:45 -05:00
Rembrandt Reyes
aa06d4bf1a Add some tests to @blitzjs/installer (meta) (#1690) 2021-01-11 18:52:15 -05:00
allcontributors[bot]
26c8bfb215 docs: add malkomalko as a contributor (#1697)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-11 18:49:43 -05:00
Robert Malko
2b0e12a08e Pin versions in chakra recipe (#1695)
(recipe)
2021-01-11 18:49:32 -05:00
depfu[bot]
0d8c0a16b6 Update all Yarn dependencies (2021-01-11) (#1692)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> (meta)
2021-01-11 15:07:08 -05:00
allcontributors[bot]
a9bf1fd3a0 docs: add koolii as a contributor (#1689)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-09 15:52:00 -05:00
t.kuriyama
c0a392ac4e Update jest config for a deprecated option (#1687)
(meta)
2021-01-09 15:51:22 -05:00
Brandon Bayer
dcb5edc72c Add @doi-t as a contributor 2021-01-09 12:06:16 -05:00
Brandon Bayer
5b57277808 v0.29.0-canary.0 2021-01-08 18:30:43 -05:00
depfu[bot]
9ff878a107 Upgrade next: 10.0.4 → 10.0.5 (patch) (NOTE: need to add isReady to mockRouter in test/utils.ts) (#1681)
* Update next to version 10.0.5

* few fixes

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Brandon Bayer <b@bayer.ws>
2021-01-08 23:28:39 +00:00
Brandon Bayer
87af792e41 Add blitz prisma CLI command for Prisma 2.13+ support (#1685)
* add `blitz prisma` command

* fix type case
2021-01-08 23:07:05 +00:00
Alex Johansson
a957d2f227 Add custom server support! (#1492)
Co-authored-by: Brandon Bayer <b@bayer.ws> (minor)
2021-01-08 17:29:05 -05:00
depfu[bot]
2efcb71d2e Update tslog to version 3.0.5 (#1680)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2021-01-07 17:15:11 +00:00
Brandon Bayer
3a94cc10c1 Add SecurePassword utilities to core so you can remove them from auth-utils.ts (minor) (#1667)
(minor)
2021-01-06 18:59:00 -05:00
allcontributors[bot]
afc77338ef docs: add rembrandtreyes as a contributor (#1679)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-06 17:59:05 -05:00
Rembrandt Reyes
948fad7996 Add config option for cookie domain to sessionMiddleware (#1673)
(minor)
2021-01-06 17:58:49 -05:00
allcontributors[bot]
295436c7e5 docs: add kyken as a contributor (#1678)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-01-06 17:54:02 -05:00
Tsuyoshi Osawa
3f95ad3bbf Fix bug preventing a semicolon in session publicData (#1676)
(patch)
2021-01-06 17:53:49 -05:00
Brandon Bayer
396f7e551f Add @creimers as a contributor 2021-01-05 16:18:46 -05:00
Brandon Bayer
2284dd8621 v0.28.0 2021-01-04 15:20:20 -05:00
Brandon Bayer
25d057dd90 Add @linbudu599 as a contributor 2021-01-02 15:00:20 -05:00
Brandon Bayer
9be0d74816 v0.28.0-canary.2 2021-01-01 17:36:09 -05:00
Brandon Bayer
27974e4268 Change a number of dependencies to use ranges to help reduce size of installed node_modules (patch) (#1665)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-01 22:13:56 +00:00
Brandon Bayer
c700ee4b9a Change log message from "alpha software" to "beta software" (patch) 2021-01-01 16:54:26 -05:00
Brandon Bayer
da2916fccf (newapp) Update a few dependencies including React to 0.0.0-experimental-3310209d0 (#1662)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-01 21:48:43 +00:00
Steffan Harris
59c839c65f Remove unnecessary log message about git core.excludesFiles (patch) (#1663)
* Removed build console message about core.excludesFiles

* Update parse-chokidar-rules-from-gitignore.ts

Co-authored-by: Brandon Bayer <b@bayer.ws>
2021-01-01 21:29:35 +00:00
Brandon Bayer
1341b10e57 Upgrade all dependencies (patch) (#1657) 2020-12-31 18:56:34 -05:00
Kevin Østerkilde
da678523d8 (newapp) Change Final Form <LabeledTextField/> to properly parse numbers (#1658)
See https://github.com/blitz-js/blitz/issues/1636
2020-12-31 16:46:48 -05:00
depfu[bot]
34145212ad Upgrade Node.js to version 12.20.0 (#1655)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2020-12-30 22:37:59 +00:00
Brandon Bayer
e4fd4a8990 fix a false duplicate error with .coverage directory in your project (#1654)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-30 21:13:18 +00:00
Brandon Bayer
682664bd0c Improve error message from useQuery for case of incorrect resolver location (patch) (#1653)
* improve error message for useQuery

* tweak
2020-12-30 20:54:46 +00:00
Alex Johansson
384b847b39 Remove unused packages from @blitzjs/server (patch) (#1634)
* Remove unused packages from `packages/server`

* lodash-es

Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-29 23:25:13 +00:00
Alex Johansson
db0cddf5ed Remove pretty-ms dependency (move code into core) (patch) (#1628)
* Remove `pretty-ms` dep

* naïve prettyMs-fn

* use `Date.now` shorthand

* fmt negative numbers as well

Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-29 23:08:34 +00:00
Simon Knott
01754dcbbd Fix bug preventing imports from files/libraries ending in "pages" or "api" (patch) (#1649)
* Add regression example

* Dont rewrite file-imports that end in /pages or /api

Only import directory imports (where import "someDir/pages" actually means "someDir/pages/index.js").

Closes #1646

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-29 22:52:28 +00:00
Alex Johansson
387ffc6a80 Remove implicit auto-build with blitz start --production. blitz build now a pre-requisite (major) (#1623)
* Remove auto-build

* remove `folder-hash` dep

* build before start

Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-29 22:35:45 +00:00
Arjun Dubey
303fad2853 Fix blitz db commands showing incorrect error (patch) (#1648)
* update db.ts

* updated db.ts

* Update packages/cli/src/commands/db.ts

Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-29 22:18:49 +00:00
Alex Johansson
a1227ee37a Remove unused packages from core (patch) (#1630)
* Remove unused packages from `core`

* update lockfile

* lodash-es

Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-29 21:41:51 +00:00
Brandon Bayer
b31e1ac245 Add @timReynolds as a contributor 2020-12-29 16:20:46 -05:00
Brandon Bayer
4e79196222 Add @phillipkregg as a contributor 2020-12-29 16:16:42 -05:00
Brandon Bayer
9b57078d31 bump yarn.lock
(ignore)
2020-12-23 14:22:30 -05:00
Brandon Bayer
cb80788734 v0.28.0-canary.1 2020-12-23 14:21:42 -05:00
depfu[bot]
845d171721 Upgrade next: 10.0.3 → 10.0.4 (patch) (#1644)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-23 14:18:16 -05:00
Alex Johansson
5f57f3c9ea only use node-fetch (#1642)
next.js bundles it

Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-23 19:17:19 +00:00
Brandon Bayer
96a0fffa00 fix broken css module imports (#1645)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-23 18:50:59 +00:00
Alex Johansson
6d71a60154 Remove unsued dep node-fetch (#1632)
Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-23 18:22:19 +00:00
Alex Johansson
dd5a6b8273 Remove unused packages from file-pipeline (#1631)
Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-23 18:05:42 +00:00
Alex Johansson
a3452937c3 remove hasha dependency (#1627)
Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-23 17:47:58 +00:00
Brandon Bayer
6826920184 update codeowners again
(ignore)
2020-12-23 12:29:30 -05:00
Brandon Bayer
0dc9feeb1e update codeowners
(ignore)
2020-12-23 12:23:15 -05:00
Alex Johansson
12b5161918 Remove unused packages from @blitzjs/installer (patch) (#1633)
Co-authored-by: Brandon Bayer <b@bayer.ws>
2020-12-23 12:17:22 -05:00
Brandon Bayer
e72b602600 Fix CI windows example test and other CI maintenance (#1639) 2020-12-23 11:46:04 -05:00
Brandon Bayer
a271fe9267 Change all agnosticSource tests to not run on windows (#1643)
(meta)
2020-12-22 18:51:15 -05:00
Alex Johansson
75758f8130 Timeout example testing after 20mins (#1640)
(meta)
2020-12-22 18:36:15 -05:00
Brandon Bayer
d48161d203 improve release script patch
(meta)
2020-12-22 13:55:56 -05:00
Reo Ishiyama
1682ce0474 Added Reo as L1 Maintainer to the README (#1637)
(meta)
2020-12-22 13:53:43 -05:00
Alex Johansson
bc7970690c Skip flaky windows packages test (#1635)
(meta)
2020-12-22 13:49:40 -05:00
Brandon Bayer
d9c5299436 v0.28.0-canary.0 2020-12-17 16:24:02 -05:00
Brandon Bayer
bc829d6bd4 update release patch auto categorize allcontributors
(meta)
2020-12-17 16:20:36 -05:00
allcontributors[bot]
ec71d2ad0d docs: add chanand as a contributor (#1621)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-12-17 16:17:48 -05:00
chanand
b18393bcab Fix: allow numbers and underscore in names for blitz generate model (#1618)
(patch)
2020-12-17 16:15:27 -05:00
allcontributors[bot]
2eb26617bc docs: add arjundubey-cr as a contributor (#1620)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-17 16:12:04 -05:00
Arjun Dubey
95988755ed Fix bug where cancelling blitz install still outputs success message (#1616)
(patch)
2020-12-17 16:11:50 -05:00
allcontributors[bot]
87ad97ce2b docs: add Kosai106 as a contributor (#1619)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-17 16:09:45 -05:00
Kevin Østerkilde
a58685229f Add missing exports for LinkProps, ImageProps, and ErrorProps (#1613)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2020-12-17 16:09:31 -05:00
Brandon Bayer
2ad5b68eab Dylan Brookes retires from core team
(meta)
2020-12-17 13:09:10 -05:00
allcontributors[bot]
8ac511aba3 docs: add jackbravo as a contributor (#1614)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-16 11:05:06 -05:00
Steffan Harris
12d93c7532 Removed unstable_ prefix from session middleware (#1607)
(major)
2020-12-15 17:17:18 -05:00
Brandon Bayer
e53f1b21bc fix render logo
(ignore)
2020-12-15 11:42:46 -05:00
Brandon Bayer
b0a4bed5e3 update render logo
(ignore)
2020-12-15 11:40:25 -05:00
Brandon Bayer
a4a672645c update render link
(ignore)
2020-12-14 16:46:47 -05:00
Brandon Bayer
88f9b4b5e5 fix readme logo size
(ignore)
2020-12-14 16:42:12 -05:00
Brandon Bayer
b62dce39dd add Render.com as a Bronze Sponsor!
(meta)
2020-12-14 16:39:48 -05:00
allcontributors[bot]
2b9b79ca2d docs: add mattfwood as a contributor (#1601)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-12 17:26:43 -05:00
Matt Wood
aba8492fc0 Minor typo fix in chakra recipe explanation (#1597)
(recipe)
2020-12-12 17:26:31 -05:00
dependabot[bot]
34f5b08101 Bump ini from 1.3.5 to 1.3.8 (#1599)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)
(meta)
Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-12 17:24:37 -05:00
Brandon Bayer
322fc6d0a9 fix readme
(ignore)
2020-12-12 11:30:24 -05:00
Brandon Bayer
34ee44e0bf Add Andreas Asprou as a seedling sponsor
(meta)
2020-12-12 11:26:02 -05:00
Brandon Bayer
4517a675a5 Fix bug where "db" in a path name will break client side imports (patch) (#1594) 2020-12-10 19:01:28 -05:00
Brandon Bayer
6ce248f694 (newapp) Change prisma version to be pinned to a minor version (#1595) 2020-12-10 18:54:42 -05:00
allcontributors[bot]
e68eb6d118 docs: add beeplin as a contributor (#1593)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-10 17:51:50 -05:00
tundera
ab81073003 Add Reflexjs recipe (#1585)
Co-authored-by: Brandon Bayer <b@bayer.ws> (recipe)
2020-12-10 17:48:18 -05:00
tundera
78410abe82 Fix and improve Theme UI recipe (#1583)
Co-authored-by: Brandon Bayer <b@bayer.ws> (recipe)
2020-12-10 17:43:20 -05:00
allcontributors[bot]
7d76f646d0 docs: add rayandrews as a contributor (#1592)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-10 17:35:36 -05:00
allcontributors[bot]
e97e964099 docs: add AkifumiSato as a contributor (#1591)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-10 17:33:38 -05:00
Akifumi Sato
fa358cd328 Remove error stack from console output on testing (#1540)
Co-authored-by: Brandon Bayer <b@bayer.ws> (meta)
2020-12-10 17:31:28 -05:00
Ray Andrew
5360a839d8 Add blitz routes command to see all routes (#1478)
Co-authored-by: Brandon Bayer <b@bayer.ws>
2020-12-10 17:28:25 -05:00
Brandon Bayer
a7493258eb Add G2i as sponsor
(meta)
2020-12-08 18:17:46 -05:00
Brandon Bayer
909f3b3392 fix theme-ui recipe
(ignore)
2020-12-05 19:15:23 -05:00
Brandon Bayer
688b05df78 v0.27.0 2020-12-05 19:07:30 -05:00
allcontributors[bot]
ec301dc22e docs: add markylaing as a contributor (#1578)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-05 18:55:35 -05:00
markylaing
df5271c1f0 Change passport adapter to accept an array of objects with authenticate options for each strategy (#1564)
Co-authored-by: Brandon Bayer <b@bayer.ws> (major)
2020-12-05 18:54:29 -05:00
allcontributors[bot]
bad2e3758e docs: add tundera as a contributor (#1577)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-05 18:45:53 -05:00
tundera
23b36b83f8 Add Theme UI recipe (including MDX!) (#1366)
Co-authored-by: Brandon Bayer <b@bayer.ws> (recipe)
2020-12-05 18:44:25 -05:00
allcontributors[bot]
94d9daf215 docs: add Khaledgarbaya as a contributor (#1576)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-12-05 18:32:34 -05:00
Khaled Garbaya
aae261c589 Fix blitz generate folder names to always be kebab-case (#1554)
(patch)
2020-12-05 18:31:20 -05:00
Brandon Bayer
4e3261d776 Fix module not found issues by moving isomorphic resolver imports behind experimental flag (#1574)
* move resolver isomorphic imports into an experimental flag

* maybe fix flaky windows test

* fix store test (patch)
2020-12-05 17:29:44 -05:00
Brandon Bayer
74083f704c v0.27.0-canary.3 2020-12-03 18:57:56 -05:00
Brandon Bayer
68e1abf727 add missing dependency
(ignore)
2020-12-03 18:54:53 -05:00
Brandon Bayer
1d3ca10164 v0.27.0-canary.2 2020-12-03 18:48:42 -05:00
Brandon Bayer
0c1cd9cc3f Fix broken blitz install (#1571) 2020-12-03 18:46:49 -05:00
depfu[bot]
e186f86389 Upgrade next.js: 10.0.2 → 10.0.3 (patch) (#1568)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2020-12-02 09:37:37 -05:00
Brandon Bayer
6954f448ad v0.27.0-canary.1 2020-12-01 13:01:25 -05:00
Brandon Bayer
656414369c (newapp) Change useCurrentUser hook to not use useSession (fixes UX) (#1563) 2020-12-01 12:57:11 -05:00
Brandon Bayer
760ab549c8 Fix broken blitz install (#1562)
(patch)
2020-12-01 12:56:02 -05:00
Justin Hall
de37d606a3 Update Emotion recipe to v11 (#1559)
(recipe)
2020-12-01 12:04:40 -05:00
Brandon Bayer
e58dbf3486 Add @saintmalik as a contributor 2020-12-01 11:53:33 -05:00
Brandon Bayer
6bb5b04199 Add @ugogo as a contributor 2020-12-01 11:49:53 -05:00
Brandon Bayer
85c2aa280d v0.27.0-canary.0 2020-11-28 13:29:52 -05:00
allcontributors[bot]
f8138f0d4d docs: add jonstuebe as a contributor (#1553)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-28 13:24:43 -05:00
Jon Stuebe
894bd7f06d Fix message in the blitz generate pages edit page (#1552)
(patch)
2020-11-28 13:24:28 -05:00
Brandon Bayer
ba7c8c5785 Add log level option to blitz.config.js (#1551)
(minor)
2020-11-28 13:21:29 -05:00
Brandon Bayer
05431ec7b5 v0.26.2 2020-11-27 15:38:21 -05:00
Brandon Bayer
005904e863 Change auth-utils.ts to be side-effect free (newapp) (#1549) 2020-11-27 15:33:57 -05:00
Brandon Bayer
c330651f35 Another try at fixing flaky windows test (meta) (#1548)
* another try at fixing flaky windows test

* revert last test changes and add logs
2020-11-27 15:31:57 -05:00
Brandon Bayer
8af274817d Fix regression in 0.26.1 if you have a test folder inside app/ (patch) (#1547)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-27 15:31:48 -05:00
Brandon Bayer
f06fd070ef Add yalc for testing blitz locally (meta) (#1542) 2020-11-27 14:56:04 -05:00
Brandon Bayer
b9d3f439e8 Add a second css module integration test (meta) (#1538)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-27 14:54:58 -05:00
Brandon Bayer
e49a6c29d1 Fix a flaky file-pipeline test (meta) (#1541) 2020-11-27 13:47:49 -05:00
Brandon Bayer
0b5ca09c7f v0.26.1 2020-11-27 12:22:28 -05:00
allcontributors[bot]
c6f480705d docs: add tpatel as a contributor (#1537)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (patch)
2020-11-27 11:20:27 -05:00
Thibaut Patel
7c3adc460b Fix blitz compiler to ignore gitignored files during processing (#1534)
(patch)
2020-11-27 11:19:07 -05:00
Simon Knott
e8da527325 Fix tree shaking for imports from queries/mutations (#1532)
(patch)
2020-11-27 11:15:29 -05:00
allcontributors[bot]
39d7f092ec docs: add sakulstra as a contributor (#1536)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-27 11:09:12 -05:00
Lukas Strassel
6732fa374b fix: add postcss to tailwind recipe (#1533)
I just tried blitz.js the first time and wanted to play around with the recipes.
Installing the tailwindcss recipe broke the app due to to css import errors displaying a prompt to also install postcss which solved the issue, so I guess it makes sense to fix at the recipe level?
2020-11-27 11:07:54 -05:00
Konrad Kalemba
cceae6efa2 Fix to allow for unicode chars in session data (#1527)
(patch)
2020-11-26 11:16:18 -05:00
Brandon Bayer
016af57a07 Add @williamkwao as a contributor 2020-11-26 11:05:33 -05:00
Brandon Bayer
a9ea76e43c update yarn.lock (ignore) 2020-11-24 11:04:25 -05:00
Brandon Bayer
394d7df094 v0.26.0 2020-11-24 11:00:44 -05:00
depfu[bot]
78007fc967 Upgrade @prisma/client: 2.12.0-dev.53 → 2.12.0 (patch) (#1522)
* Update @prisma/client to version 2.12.0

* fix

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Brandon Bayer <b@bayer.ws>
2020-11-24 15:48:49 +00:00
Brandon Bayer
c1ac5b027e Change prisma.findOne to prisma.findFirst for Prisma 2.12 compatibility (#1525)
(minor)
2020-11-24 10:19:19 -05:00
depfu[bot]
b6b898c9b3 Upgrade @prisma/sdk: 2.10.0 → 2.12.0 (example) (#1524)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2020-11-24 10:18:31 -05:00
depfu[bot]
f96bcb80d0 Upgrade @prisma/cli: 2.10.0 → 2.12.0 (example) (#1523)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2020-11-24 10:18:18 -05:00
Alex Johansson
1194ffde82 Change useParam / useParams to always return undefined for empty/invalid values instead of "" and NaN (patch) (#1491)
* do parsing in useParams instead of useParam

* simplify

# Conflicts:
#	packages/core/src/use-params.ts

* fix typescript error

Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-24 15:16:41 +00:00
allcontributors[bot]
24082d53e0 docs: add Mzaien as a contributor (#1526)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-24 10:00:29 -05:00
Abdullah Mzaien
61bbc43497 (recipe) Update tailwind recipe to v2 (#1486)
Co-authored-by: Mzaien <s201540840@kfupm.edu.sa>
Co-authored-by: Brandon Bayer <b@bayer.ws>
2020-11-24 09:58:25 -05:00
allcontributors[bot]
3dcf2bffe2 docs: add rap2hpoutre as a contributor (#1520)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-23 21:28:07 -05:00
Raphaël Huchet
653b93b089 Fix bug where blitz db seed will error silently (#1510)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2020-11-23 21:26:47 -05:00
Alex Johansson
1b663c0e8b Fix lint warnings (#1515)
(meta)
2020-11-23 19:55:02 -05:00
Brandon Bayer
5747642055 Update blitz generate templates for Prisma 2.12.0 compatibility (#1518)
(minor)
2020-11-23 19:24:26 -05:00
Brandon Bayer
53b2e273b4 update fauna link in fauna example readme
(ignore)
2020-11-23 14:25:17 -05:00
Brandon Bayer
3ed4844d87 v0.25.1-canary.3 2020-11-20 21:31:30 -05:00
Ray Andrew
b6b37f4661 Automatically clear .blitz cache when you change blitz versions (#1446)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2020-11-20 21:29:16 -05:00
Brandon Bayer
236415222d Fix broken css modules imports on canary (patch) (#1499)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-20 21:20:22 -05:00
allcontributors[bot]
bd76ff6049 docs: add rayandrews as a contributor (#1502)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-20 21:09:10 -05:00
Alex Johansson
a51757c174 Change useParam() to always return undefined if param doesn’t exist (#1474)
(minor)
2020-11-20 21:03:32 -05:00
allcontributors[bot]
9d8f63df3d docs: add dmzza as a contributor (#1501)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-20 21:01:59 -05:00
David Mazza
4890a7cf5b Fix File not found with singular glob (#1493)
(patch)
2020-11-20 21:01:31 -05:00
allcontributors[bot]
8089ec7d15 docs: add KATT as a contributor (#1500)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-20 20:59:05 -05:00
Alex Johansson
f6fd1d0285 Cleanup unused args in server (#1494)
(meta)
2020-11-20 20:58:51 -05:00
Brandon Bayer
f655410167 v0.25.1-canary.2 2020-11-20 19:44:22 -05:00
Brandon Bayer
8f20b0729a Add @rap2hpoutre as a contributor 2020-11-20 19:41:07 -05:00
Brandon Bayer
f37e6e8ebc (newapp) Add .next and .blitz to .prettierignore (#1498) 2020-11-20 19:40:36 -05:00
Brandon Bayer
5a934c3211 Fix an import edgecase by only rewriting relative paths imports for files in special folders (patch) (#1496)
* change to only change relative paths for files in special folders

* fix for windows
2020-11-21 00:35:14 +00:00
Brandon Bayer
b079c6e944 update kodiak again
(ignore)
2020-11-20 19:16:21 -05:00
Brandon Bayer
2f0ca0f549 update kodiak config
(ignore)
2020-11-20 19:03:24 -05:00
Brandon Bayer
555ea5bac7 set up Kodiak for PR automerging
(meta)
2020-11-20 18:49:12 -05:00
Brandon Bayer
75b63ed087 yarn.lock
(ignore)
2020-11-18 21:36:42 -05:00
Brandon Bayer
ded2e2a546 v0.25.1-canary.1 2020-11-18 21:35:13 -05:00
Brandon Bayer
f70d8d9a15 Rudi Yardley retired as core member
(meta)
2020-11-18 19:21:12 -05:00
Simon Knott
4d54e89621 Fix ability to import from pages, API routes, and queries/mutations (#1456)
Co-authored-by: Brandon Bayer <b@bayer.ws> (fix)
2020-11-18 19:11:43 -05:00
Brandon Bayer
69b91223d7 Add new Image component from Next.js 10 (#1423)
(minor)
2020-11-18 19:10:11 -05:00
Brandon Bayer
8c5061ead5 Remove undocumented hasOne and hasMany options from blitz generate model (#1476)
(patch)
2020-11-18 17:46:00 -05:00
depfu[bot]
19ffe20330 Upgrade next: 10.0.1 → 10.0.2 (patch) (#1481)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2020-11-18 15:27:08 -05:00
Brandon Bayer
9819543f47 v0.25.1-canary.0 2020-11-17 21:47:30 -05:00
Brandon Bayer
b42eec1b66 Fix issue where blitz start --production rebuilds during deployment (#1477)
(patch)
2020-11-17 21:23:58 -05:00
Brandon Bayer
0ef8d16da5 Fix image component external domains not working in production (#1463) 2020-11-17 12:29:39 -05:00
Flavio
37e1ff3427 Added Flavio as L1 Maintainer to the README (#1469)
* Added Flavio as L1 Maintainer to the READMe

* Added Flavio's correct  photo to L1 Maintainer section
2020-11-15 15:06:03 -05:00
allcontributors[bot]
63b0682f06 docs: add piotrski as a contributor (#1467)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-14 20:45:13 -05:00
Piotrek Tomczewski
735d2f628b Update Chakra UI Recipe for 1.0 (#1466)
(recipe)
2020-11-14 20:44:55 -05:00
Fran Zekan
d2a3f1a0b1 Only run Lambda warm-up HEAD requests when target is serverless (#159)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2020-11-14 20:43:36 -05:00
Brandon Bayer
b54cbadebe Fix initial migration for new apps is not included in the initial git commit (#1464)
(patch)
2020-11-14 19:26:53 -05:00
Brandon Bayer
1126b139a9 Add @cwray-tech as a contributor 2020-11-14 10:35:08 -05:00
Brandon Bayer
db44295738 Add Fauna Example (#1458)
(example)
2020-11-14 09:48:01 -05:00
Brandon Bayer
539f457207 v0.25.0 2020-11-11 18:33:47 -05:00
Brandon Bayer
383e856e33 Fix infinite loop with multiple tabs open (#1453)
(patch)
2020-11-11 18:26:59 -05:00
Brandon Bayer
7d05d4e4c4 update bytes newsletter link
(ignore)
2020-11-11 08:59:26 -05:00
Brandon Bayer
1555d09a45 v0.25.0-canary.6 2020-11-10 20:56:28 -05:00
Brandon Bayer
05bf388d8d (newapp) Upgrade react version to 0.0.0-experimental-4ead6b530 (#1451) 2020-11-10 20:50:15 -05:00
Brandon Bayer
41ad93b327 Improve error message for invalid RPC requests (#1450)
(patch)
2020-11-10 20:50:01 -05:00
Brandon Bayer
56b18e40df Add Bytes Newsletter signup banner 2020-11-10 20:48:00 -05:00
Brandon Bayer
e2acb1a6a1 Fix broken static pre-rendering with useQuery (#1444)
(patch)
2020-11-10 20:13:39 -05:00
Brandon Bayer
680c44180c v0.25.0-canary.5 2020-11-09 21:37:28 -05:00
Brandon Bayer
158b6684a7 truly fix the corrupted build this time
(patch)
2020-11-09 21:35:24 -05:00
Brandon Bayer
2a4a209de9 v0.25.0-canary.4 2020-11-09 21:28:51 -05:00
Brandon Bayer
4f862f04b0 fix corrupted build
(patch)
2020-11-09 21:27:20 -05:00
Brandon Bayer
7eb7943b55 v0.25.0-canary.3 2020-11-09 21:09:13 -05:00
Brandon Bayer
bf009c2e3e Fix CLI cannot find module get-latest-version error (#1442)
(patch)
2020-11-09 21:04:17 -05:00
allcontributors[bot]
94ff1da4de docs: add akirabaruah as a contributor (#1441)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-09 20:25:06 -05:00
Akira Baruah
a6f4ca0068 Improve error message about git and git config (#1432)
(patch)
2020-11-09 20:24:47 -05:00
dependabot[bot]
533e0cbaae Bump next from 9.5.1 to 10.0.1 in /examples/plain-js (#1431)
Bumps [next](https://github.com/vercel/next.js) from 9.5.1 to 10.0.1.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v9.5.1...v10.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (meta)
2020-11-07 17:30:28 -05:00
Brandon Bayer
25df2c0c29 Revert react query to 2.5.12 because of concurrent mode bugs (#1430)
(minor)
2020-11-07 16:59:49 -05:00
Brandon Bayer
c4d759304d Add @Talor-A as a contributor 2020-11-07 10:47:00 -05:00
allcontributors[bot]
a856304062 docs: add benediktms as a contributor (#1429)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-07 10:43:11 -05:00
Benedikt Schnatterbeck
be7d0ee723 Cypress test fix (#1369)
Co-authored-by: Brandon Bayer <b@bayer.ws> (meta)
2020-11-07 10:42:57 -05:00
Brandon Bayer
91aebf44bc Fix: disable useQuery on first render, when router params don't exist yet AND fix TS type for useRouter() (#1422)
(patch)
2020-11-07 10:38:04 -05:00
Hiroki Isogai
6d45d52f7a Fix cannot read property '_clientVersion' of undefined (#1419)
(patch)
2020-11-05 20:14:08 -05:00
allcontributors[bot]
c451a5d55e docs: add wobsoriano as a contributor (#1420)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-05 08:56:54 -05:00
Robert Soriano
646e8ae0f6 Remove React imports from page templates (#1418)
(patch)
2020-11-05 08:56:34 -05:00
Brandon Bayer
28ded0c1b1 v0.25.0-canary.2 2020-11-04 21:58:07 -05:00
Brandon Bayer
8c9de5a1de Fix useInfiniteQuery bug on canary where page params are empty (#1416)
(patch)
2020-11-04 21:50:22 -05:00
Brandon Bayer
a3c468b779 Switch to superjson for error serialization (enables using instanceof) (#1414)
(patch)
2020-11-04 21:04:14 -05:00
Brandon Bayer
6907e92d14 Add @leggsimon as a contributor 2020-11-04 20:49:09 -05:00
Brandon Bayer
418173849b Add @ericsakmar as a contributor 2020-11-04 20:44:08 -05:00
Abu Uzayr
087230e800 Upon blitz new, prompt user for upgrade if blitz version is outdated (#1397)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2020-11-04 20:01:26 -05:00
Brandon Bayer
1ccfc7e5ba Add @matamatanot as a contributor 2020-11-04 19:15:00 -05:00
allcontributors[bot]
cdbe9e3cef docs: add isoppp as a contributor (#1412)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-11-04 18:56:53 -05:00
Hiroki Isogai
a254b70139 Remove as prop from blitz generate page templates (#1411)
(patch)
2020-11-04 18:56:39 -05:00
depfu[bot]
c3c0e55597 Upgrade next: 10.0.0 → 10.0.1 (#1409)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> (minor)
2020-11-04 18:54:55 -05:00
depfu[bot]
26f8e97b25 Upgrade @prisma/sdk: 2.6.0 → 2.10.0 (#1393)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> (meta)
2020-11-03 09:16:26 -05:00
depfu[bot]
353e4efea6 Upgrade @prisma/cli: 2.4.1 → 2.10.0 (minor) (#1394)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> (example)
2020-10-30 18:37:15 -04:00
depfu[bot]
ae934bc6b7 Upgrade @prisma/client: 2.8.0 → 2.10.0 (minor) (#1395)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> (example)
2020-10-28 22:01:55 -04:00
Brandon Bayer
8ebb383764 commit yarn.lock 2020-10-27 22:19:00 -04:00
Brandon Bayer
8f7b064cee v0.25.0-canary.1 2020-10-27 22:18:13 -04:00
Brandon Bayer
73fa209e9f Fix useInfiniteQuery broken cache (#1391)
(patch)
2020-10-27 22:16:21 -04:00
sirmyron
3372307112 Add sirmyron l1 maintainer (#1389)
Co-authored-by: Myron Davis <myron@dizari.com> (meta)
2020-10-27 21:02:31 -04:00
depfu[bot]
c1e771d8a7 Upgrade next: 9.5.5 → 10.0.0 (major) (#1385)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2020-10-27 20:55:46 -04:00
Brandon Bayer
0dc2891387 Remove tailwind example app (#1384)
(example)
2020-10-27 20:54:47 -04:00
allcontributors[bot]
819929e2f6 docs: add mweibel as a contributor (#1382)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-25 16:16:31 -04:00
Michael Weibel
e76f23dc3d (newapp) Move typescript to production dependencies (so blitz db seed works on prod deploy) (#1377) 2020-10-25 16:16:11 -04:00
allcontributors[bot]
33c6d8e5e1 docs: add maciekgrzybek as a contributor (#1381)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-25 15:57:49 -04:00
maciek_grzybek
f927aa05ee Fix inconsistencies with the CLI -h flag (#1257)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2020-10-25 15:57:33 -04:00
Jirka Svoboda
2efbe7bd51 Added eslint import sorting (#1345)
(meta)
2020-10-25 15:32:32 -04:00
allcontributors[bot]
c0e88cb509 docs: add machadolucasvp as a contributor (#1380)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-25 15:31:43 -04:00
Lucas Machado
cb8c268a14 (newapp) Move tsc from pre-commit to pre-push hook (#1362) 2020-10-25 15:31:28 -04:00
Brandon Bayer
6df771c86e Update @nksaraf as a contributor 2020-10-25 15:29:15 -04:00
Brandon Bayer
dbef6f9389 Add @goleary as a contributor 2020-10-25 15:28:32 -04:00
Brandon Bayer
f4eaebb52a v0.25.0-canary.0 2020-10-21 09:11:26 -05:00
allcontributors[bot]
4df2dfd5fc docs: add nemesv as a contributor (#1373)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-21 09:08:19 -05:00
Viktor Nemes
f20de5ad53 Fix blitz db seed not working (#1363)
(patch)
2020-10-21 09:08:04 -05:00
allcontributors[bot]
005edc089a docs: add sirmyron as a contributor (#1361)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-18 16:44:35 -05:00
sirmyron
ddab8d063d Added useMemo call for response from useRouter (#1352)
Co-authored-by: Myron Davis <myron@dizari.com> (patch)
2020-10-18 16:44:13 -05:00
Brandon Bayer
308744681b Fix your jest tests failing because of useQuery error message (#1357)
(patch)
2020-10-18 16:35:28 -05:00
allcontributors[bot]
291b988c05 docs: add markhaehnel as a contributor (#1360)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-18 16:33:31 -05:00
Mark Hähnel
7fdd97bb7d Fix blitz CLI not using proper exit codes (#1316)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2020-10-18 16:33:16 -05:00
allcontributors[bot]
02af10133c docs: add dulcehc as a contributor (#1359)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-18 16:30:02 -05:00
Dulce Hernández
de01a52886 (newapp) Add incremental:true to tsconfig.json (#1350) 2020-10-18 16:29:39 -05:00
Brandon Bayer
cbcbeefd40 Add @zanedb as a contributor 2020-10-18 16:21:40 -05:00
allcontributors[bot]
7083da0297 docs: add nksaraf as a contributor (#1358)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-18 16:12:30 -05:00
Nikhil Saraf
83b08f00eb Fix db.connect error when using without prisma (#1342)
(patch)
2020-10-18 16:12:17 -05:00
Rafael Nunes
3e7bf85750 Adds test to assert useMutation validation (#1351)
(meta)
2020-10-18 15:32:48 -05:00
Brandon Bayer
e9d626d495 (newapp) Fix tests not found if app has blitz in the name (#1355) 2020-10-18 15:30:26 -05:00
André Ericson
bc9983a31e Add setQueryData to react-query-utils AND rename mutate to setQueryData (#1291)
(major)
2020-10-18 10:35:41 -05:00
depfu[bot]
c798d39c4b Fix error stack trace regression by upgrading tslog: 2.9.0 → 2.9.1 (patch) (#1348)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> (patch)
2020-10-17 18:50:06 -05:00
depfu[bot]
0394ced3ff Upgrade superjson: 1.2.3 → 1.3.0 (#1347)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> (patch)
2020-10-17 17:24:13 -05:00
Brandon Bayer
fc40c9dc23 v0.24.3 2020-10-16 12:07:55 -04:00
Jose Felix
728ef2d2a6 Add loading progress indicator to blitz console (#1336)
(patch)
2020-10-16 12:05:28 -04:00
Victor Nahuel Chaves
bc725db4ec Fix can't install any recipe (#1339)
(patch)
2020-10-16 11:51:30 -04:00
allcontributors[bot]
6cd3bb32a7 docs: add sewerynkalemba as a contributor (#1332)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-14 19:06:06 -04:00
Seweryn Kalemba
14faf68a0b Export missing AuthenticatedSessionContext type (#1330)
(patch)
2020-10-14 19:05:48 -04:00
allcontributors[bot]
e7bdafc2c5 docs: add ntgussoni as a contributor (#1328)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-14 17:24:32 -04:00
Nicolas Torres
241a62e465 Fix .gitignore files not being ignored by blitz (#1150)
Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: Rudi Yardley <contact@rudiyardley.com> (patch)
2020-10-14 17:23:00 -04:00
Konrad Kalemba
5118be3ddd Add Recipe for Base Web - a UI framework from Uber (#1319)
(recipe)
2020-10-14 17:02:41 -04:00
allcontributors[bot]
eebe8bcdfb docs: add peter50216 as a contributor (#1327)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-14 17:01:12 -04:00
Peter Shih
e4983c6f2e (newapp) Fix tests not working out of box (#1323) 2020-10-14 17:00:14 -04:00
André Ericson
3d3bb20365 Remove incorrect deprecation warning when using useMutation (#1320)
(patch)
2020-10-14 16:31:26 -04:00
Konrad Kalemba
77f9e60a9c Fix recipes to add their providers at the root of App's return function (#1324)
(recipe)
2020-10-14 16:29:08 -04:00
Brandon Bayer
66111f74bf v0.24.2 2020-10-13 21:10:24 -04:00
allcontributors[bot]
c2bb7728b2 docs: add nahue as a contributor (#1321)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-13 19:30:46 -04:00
Victor Nahuel Chaves
d5c2fa15e0 Update Ink dependencies (#1171)
Co-authored-by: Brandon Bayer <b@bayer.ws> (meta)
2020-10-13 19:28:26 -04:00
allcontributors[bot]
f93208e75f docs: add wanjuntham as a contributor (#1317)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-13 09:42:27 -04:00
wanjuntham
660c7fbb5e Update Next.js from 9.5.3 to 9.5.5 (#1289)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
Co-authored-by: Cody G <37571416+clgeoio@users.noreply.github.com>
Co-authored-by: engelkes-finstreet <36962022+engelkes-finstreet@users.noreply.github.com>
Co-authored-by: André Ericson <de.ericson@gmail.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Konrad Kalemba <konrad_kal@hotmail.com>
Co-authored-by: Domantas Mauruča <domantas.mauruca@gmail.com>
Co-authored-by: Carlos Fernández <c.fernandez@rpalatam.com.pe>
Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: Stratulat Alexandru <alexanderstratulat97@gmail.com>
Co-authored-by: Bruno Crosier <bruno.crosier@gmail.com>

(patch)
2020-10-13 09:39:31 -04:00
allcontributors[bot]
bcb88c72ea docs: add jamiedavenport as a contributor (#1314)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-12 21:00:43 -04:00
allcontributors[bot]
b81a3dd314 docs: add engelkes-finstreet as a contributor (#1313)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-12 20:59:53 -04:00
allcontributors[bot]
51bdaa118a docs: add sandulat as a contributor (#1312)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-12 20:58:59 -04:00
Satoshi Nitawaki
59cf61a26a Remove Ivan from L1 maintainers & Add Patrick Engelkes as Level1 maintainer (#1310)
(meta)
2020-10-12 20:31:05 -04:00
allcontributors[bot]
876eb8327f docs: add nitaking as a contributor (#1311)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-12 20:30:01 -04:00
allcontributors[bot]
018e462ce8 docs: add davidlutta as a contributor (#1307)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-12 18:23:47 -04:00
David Ezekiel Lutta
74cde8a871 Add getConfig export from core for next/config (#1304)
(minor)
2020-10-12 18:22:41 -04:00
Jamie Davenport
bc9f0e9d85 Add Jamie Davenport as a L1 maintainer (#1301)
(meta)
2020-10-12 17:46:46 -04:00
allcontributors[bot]
683c251693 docs: add alexnaiman as a contributor (#1299)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-11 15:11:34 -04:00
Alexandru Naiman
1d02efb21d Fix circular dependencies in blitz core (#1249)
Co-authored-by: Brandon Bayer <b@bayer.ws> (meta)
2020-10-11 15:08:37 -04:00
allcontributors[bot]
f35da93d6d docs: add aaronfulkerson as a contributor (#1295)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-10 18:50:33 -04:00
Bruno Crosier
cd2e29b286 Remove "--experimental" from "blitz db studio" (#1272)
Co-authored-by: Brandon Bayer <b@bayer.ws> (patch)
2020-10-10 17:12:20 -04:00
Stratulat Alexandru
82e4f7fd95 Remove Simon Debbarma and Jack Clancy from L1 maintainers. (#1290)
(meta)
2020-10-10 17:06:00 -04:00
Brandon Bayer
99e64fa2e0 Update @aericson as a contributor 2020-10-10 16:45:55 -04:00
Brandon Bayer
9b0dd2ccaa Add @Kosai106 as a contributor 2020-10-10 16:45:46 -04:00
allcontributors[bot]
0235395e54 docs: add cajotafer as a contributor (#1293)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-10 16:38:01 -04:00
Carlos Fernández
67ba766a87 (newapp) Add yarn/npx to global install instructions in readme (#1285) 2020-10-10 16:36:54 -04:00
Domantas Mauruča
85216555fc Fix to allow babel config modification in Recipes (#1280)
(patch)
2020-10-10 16:13:50 -04:00
Konrad Kalemba
25ebbc919b Fix all recipes to add their context providers above getLayout() (#1279)
(recipes)
2020-10-10 16:11:05 -04:00
allcontributors[bot]
312dc3a1a9 docs: add aericson as a contributor (#1292)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-10 16:09:17 -04:00
André Ericson
f31d2a9770 (newapp) Fix validateDOMNesting error from default home page (#1277) 2020-10-10 16:08:28 -04:00
engelkes-finstreet
0199605d07 Fix blitz generate model to add fields to existing model instead of duplicating (#1251)
(patch)
2020-10-10 16:01:44 -04:00
Cody G
092775a3f2 Fix to not run husky during new app creation (#1270)
(patch)
2020-10-10 15:44:45 -04:00
Cody G
aea6c88b1e Adds tests for useSession in core super tokens (#1258)
(meta)
2020-10-10 15:43:16 -04:00
Stratulat Alexandru
846194a5b1 Add Alexandru Stratulat as L1 Maintainer (#1271)
(meta)
2020-10-07 10:06:19 -04:00
Brandon Bayer
814ed2d59a v0.24.1 2020-10-06 20:33:25 -04:00
Brandon Bayer
41106588ff Fix page template to use useMutation (#1269)
(patch)
2020-10-06 20:32:04 -04:00
Brandon Bayer
6f50d77756 update patch for release script
(meta)
2020-10-06 19:28:52 -04:00
Brandon Bayer
99bf898cdc v0.24.0 2020-10-06 19:24:50 -04:00
Brandon Bayer
4ef7d81018 Few improvements to log colors (#1267)
(patch)
2020-10-06 19:19:56 -04:00
Brandon Bayer
37ce99a37a Fix global CLI on canary by dynamically require server package (#1265)
(patch)
2020-10-06 19:00:10 -04:00
Simon Knott
2f3be902e4 Promote Simon to L2 Maintainership (#1264)
(meta)
2020-10-06 13:55:24 -04:00
Brandon Bayer
968f1d0cb9 v0.24.0-canary.4 2020-10-06 12:11:31 -04:00
Brandon Bayer
0b103bccca Revert "Prefix session cookies with app name (#1229)"
This reverts commit 3d827c8506.
2020-10-06 12:07:42 -04:00
Brandon Bayer
406b643f94 Add @sandulat as a contributor 2020-10-06 12:01:40 -04:00
Brandon Bayer
33c7bec41f v0.24.0-canary.3 2020-10-06 11:23:48 -04:00
Stratulat Alexandru
3d827c8506 Prefix session cookies with app name (#1229)
(minor)
2020-10-06 11:21:46 -04:00
allcontributors[bot]
b04c6d7469 docs: add Dohxis as a contributor (#1261)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-06 11:18:54 -04:00
Domantas Mauruča
242e2eadee Add tests for add-dependency-executor (#1259)
(meta)
2020-10-06 11:17:02 -04:00
Brandon Bayer
08303d337b Add back RouterContext and BlitzRouter which got lost in last canary release (#1260)
(patch)
2020-10-06 11:13:46 -04:00
Brandon Bayer
be861c7919 v0.24.0-canary.2 2020-10-05 19:13:19 -04:00
allcontributors[bot]
092045e807 docs: add Alucard17 as a contributor (#1256)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-05 18:59:41 -04:00
Alucard17
1e0f17c93a Changed @blitzjs/core to only export public API (#1246)
Co-authored-by: Brandon Bayer <b@bayer.ws> (meta)
2020-10-05 18:58:57 -04:00
Jamie Davenport
310079b3bc Fix Safari compatibility: shim requestIdleCallback (#1247)
(patch)
2020-10-05 18:46:06 -04:00
Brandon Bayer
a81252aeb4 Fix regression on canary of loss of Prisma error code (#1254)
(patch)
2020-10-05 18:15:02 -04:00
allcontributors[bot]
cc58c72d94 docs: add konradkalemba as a contributor (#1255)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-05 18:14:09 -04:00
Konrad Kalemba
2162e1c6b4 Fix DocumentContext import in Material UI recipe (#1253)
(recipe)
2020-10-05 18:13:12 -04:00
अभिनाश (Avinash)
d46d860338 (newapp) Fix docs link on default homepage (#1250) 2020-10-05 18:10:55 -04:00
Satoshi Nitawaki
c65360de09 Fix name of blitz db seed command (was blitz seed) (#1239)
(patch)
2020-10-05 17:57:08 -04:00
Kotaro Chikuba
9873fc22de Fix isBlitzRoot() for blank deps/devDeps (#1242)
(patch)
2020-10-05 17:55:31 -04:00
allcontributors[bot]
e6954fbca8 docs: add mizchi as a contributor (#1252)
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> (meta)
2020-10-05 10:03:03 -04:00
Kotaro Chikuba
048ba5f5cb Fix middleware test for win and mac (#1245)
(meta)
2020-10-05 10:01:14 -04:00
Brandon Bayer
bd1063a965 Upgrade prisma version in examples apps (#1238)
(meta)
2020-10-03 12:34:11 -04:00
Brandon Bayer
ae6b22f4f0 v0.24.0-canary.1 2020-10-02 21:57:55 -04:00
Brandon Bayer
f45d2d5ee3 Change log color of query/mutation input args to yellow (#1237)
(minor)
2020-10-02 21:56:02 -04:00
491 changed files with 18966 additions and 12738 deletions

View File

@@ -609,7 +609,8 @@
"avatar_url": "https://avatars2.githubusercontent.com/u/1329874?v=4",
"profile": "https://jamiedavenport.dev",
"contributions": [
"code"
"code",
"maintenance"
]
},
{
@@ -993,7 +994,8 @@
"contributions": [
"code",
"maintenance",
"question"
"question",
"doc"
]
},
{
@@ -1002,7 +1004,8 @@
"avatar_url": "https://avatars2.githubusercontent.com/u/1430136?v=4",
"profile": "https://github.com/sirmyron",
"contributions": [
"doc"
"doc",
"code"
]
},
{
@@ -1012,7 +1015,8 @@
"profile": "https://github.com/engelkes-finstreet",
"contributions": [
"doc",
"code"
"code",
"maintenance"
]
},
{
@@ -1224,6 +1228,631 @@
"contributions": [
"code"
]
},
{
"login": "mizchi",
"name": "Kotaro Chikuba",
"avatar_url": "https://avatars2.githubusercontent.com/u/73962?v=4",
"profile": "https://mizchi.dev",
"contributions": [
"code",
"test"
]
},
{
"login": "konradkalemba",
"name": "Konrad Kalemba",
"avatar_url": "https://avatars0.githubusercontent.com/u/8682104?v=4",
"profile": "https://github.com/konradkalemba",
"contributions": [
"code"
]
},
{
"login": "Alucard17",
"name": "Alucard17",
"avatar_url": "https://avatars1.githubusercontent.com/u/26205172?v=4",
"profile": "https://github.com/Alucard17",
"contributions": [
"code"
]
},
{
"login": "Dohxis",
"name": "Domantas Mauruča",
"avatar_url": "https://avatars2.githubusercontent.com/u/8768909?v=4",
"profile": "https://github.com/Dohxis",
"contributions": [
"test",
"code"
]
},
{
"login": "sandulat",
"name": "Stratulat Alexandru",
"avatar_url": "https://avatars0.githubusercontent.com/u/7345874?v=4",
"profile": "https://sandulat.com/",
"contributions": [
"code",
"maintenance"
]
},
{
"login": "aericson",
"name": "André Ericson",
"avatar_url": "https://avatars3.githubusercontent.com/u/692542?v=4",
"profile": "https://github.com/aericson",
"contributions": [
"code",
"doc"
]
},
{
"login": "cajotafer",
"name": "Carlos Fernández",
"avatar_url": "https://avatars2.githubusercontent.com/u/41461969?v=4",
"profile": "http://Cajotafer.com",
"contributions": [
"doc"
]
},
{
"login": "Kosai106",
"name": "Kevin Østerkilde",
"avatar_url": "https://avatars1.githubusercontent.com/u/6379824?v=4",
"profile": "https://oesterkilde.dk/",
"contributions": [
"doc",
"code"
]
},
{
"login": "aaronfulkerson",
"name": "aaronfulkerson",
"avatar_url": "https://avatars0.githubusercontent.com/u/31112737?v=4",
"profile": "https://github.com/aaronfulkerson",
"contributions": [
"code",
"question"
]
},
{
"login": "alexnaiman",
"name": "Alexandru Naiman",
"avatar_url": "https://avatars3.githubusercontent.com/u/25799714?v=4",
"profile": "https://github.com/alexnaiman",
"contributions": [
"code"
]
},
{
"login": "davidlutta",
"name": "David Ezekiel Lutta",
"avatar_url": "https://avatars2.githubusercontent.com/u/14890315?v=4",
"profile": "https://davidlutta.github.io/portfolio/",
"contributions": [
"code"
]
},
{
"login": "wanjuntham",
"name": "wanjuntham",
"avatar_url": "https://avatars1.githubusercontent.com/u/49380551?v=4",
"profile": "https://github.com/wanjuntham",
"contributions": [
"code"
]
},
{
"login": "nahue",
"name": "Victor Nahuel Chaves",
"avatar_url": "https://avatars3.githubusercontent.com/u/96837?v=4",
"profile": "http://www.nahuelchaves.xyz",
"contributions": [
"code"
]
},
{
"login": "peter50216",
"name": "Peter Shih",
"avatar_url": "https://avatars3.githubusercontent.com/u/891109?v=4",
"profile": "https://github.com/peter50216",
"contributions": [
"code"
]
},
{
"login": "sewerynkalemba",
"name": "Seweryn Kalemba",
"avatar_url": "https://avatars3.githubusercontent.com/u/37031328?v=4",
"profile": "http://seweryn.kale.mba",
"contributions": [
"code"
]
},
{
"login": "nksaraf",
"name": "Nikhil Saraf",
"avatar_url": "https://avatars2.githubusercontent.com/u/11255148?v=4",
"profile": "https://nksaraf.github.io",
"contributions": [
"code",
"doc"
]
},
{
"login": "zanedb",
"name": "Zane",
"avatar_url": "https://avatars0.githubusercontent.com/u/16865690?v=4",
"profile": "https://zane.sh",
"contributions": [
"doc"
]
},
{
"login": "dulcehc",
"name": "Dulce Hernández",
"avatar_url": "https://avatars1.githubusercontent.com/u/19391835?v=4",
"profile": "https://github.com/dulcehc",
"contributions": [
"code"
]
},
{
"login": "markhaehnel",
"name": "Mark Hähnel",
"avatar_url": "https://avatars2.githubusercontent.com/u/1516205?v=4",
"profile": "https://markhaehnel.de",
"contributions": [
"code"
]
},
{
"login": "nemesv",
"name": "Viktor Nemes",
"avatar_url": "https://avatars0.githubusercontent.com/u/251330?v=4",
"profile": "http://stackoverflow.com/users/872395/nemesv",
"contributions": [
"code"
]
},
{
"login": "goleary",
"name": "Gabe O'Leary",
"avatar_url": "https://avatars1.githubusercontent.com/u/16123225?v=4",
"profile": "http://gabeoleary.com",
"contributions": [
"doc"
]
},
{
"login": "machadolucasvp",
"name": "Lucas Machado",
"avatar_url": "https://avatars0.githubusercontent.com/u/44952113?v=4",
"profile": "https://github.com/machadolucasvp",
"contributions": [
"code"
]
},
{
"login": "maciekgrzybek",
"name": "maciek_grzybek",
"avatar_url": "https://avatars2.githubusercontent.com/u/16546428?v=4",
"profile": "https://github.com/maciekgrzybek",
"contributions": [
"code"
]
},
{
"login": "mweibel",
"name": "Michael Weibel",
"avatar_url": "https://avatars1.githubusercontent.com/u/307427?v=4",
"profile": "https://github.com/mweibel",
"contributions": [
"code"
]
},
{
"login": "isoppp",
"name": "Hiroki Isogai",
"avatar_url": "https://avatars0.githubusercontent.com/u/16318727?v=4",
"profile": "https://isoppp.com",
"contributions": [
"code"
]
},
{
"login": "matamatanot",
"name": "matamatanot",
"avatar_url": "https://avatars2.githubusercontent.com/u/39780486?v=4",
"profile": "https://github.com/matamatanot",
"contributions": [
"doc"
]
},
{
"login": "ericsakmar",
"name": "Eric Sakmar",
"avatar_url": "https://avatars3.githubusercontent.com/u/5620709?v=4",
"profile": "https://github.com/ericsakmar",
"contributions": [
"doc"
]
},
{
"login": "leggsimon",
"name": "Simon Legg",
"avatar_url": "https://avatars2.githubusercontent.com/u/11544418?v=4",
"profile": "https://github.com/leggsimon",
"contributions": [
"doc"
]
},
{
"login": "wobsoriano",
"name": "Robert Soriano",
"avatar_url": "https://avatars3.githubusercontent.com/u/13049130?v=4",
"profile": "https://robsoriano.com",
"contributions": [
"code"
]
},
{
"login": "benediktms",
"name": "Benedikt Schnatterbeck",
"avatar_url": "https://avatars2.githubusercontent.com/u/48836135?v=4",
"profile": "https://github.com/benediktms",
"contributions": [
"code"
]
},
{
"login": "Talor-A",
"name": "Talor Anderson",
"avatar_url": "https://avatars2.githubusercontent.com/u/11509865?v=4",
"profile": "http://taloranderson.com",
"contributions": [
"code"
]
},
{
"login": "akirabaruah",
"name": "Akira Baruah",
"avatar_url": "https://avatars2.githubusercontent.com/u/6751517?v=4",
"profile": "https://github.com/akirabaruah",
"contributions": [
"code"
]
},
{
"login": "cwray-tech",
"name": "Christopher Wray",
"avatar_url": "https://avatars0.githubusercontent.com/u/53663762?v=4",
"profile": "https://chriswray.dev/",
"contributions": [
"code"
]
},
{
"login": "piotrski",
"name": "Piotrek Tomczewski",
"avatar_url": "https://avatars0.githubusercontent.com/u/244174?v=4",
"profile": "https://github.com/piotrski",
"contributions": [
"code"
]
},
{
"login": "rap2hpoutre",
"name": "Raphaël Huchet",
"avatar_url": "https://avatars3.githubusercontent.com/u/1575946?v=4",
"profile": "http://raph.site",
"contributions": [
"doc",
"test",
"code"
]
},
{
"login": "KATT",
"name": "Alex Johansson",
"avatar_url": "https://avatars1.githubusercontent.com/u/459267?v=4",
"profile": "http://kattcorp.com",
"contributions": [
"code"
]
},
{
"login": "dmzza",
"name": "David Mazza",
"avatar_url": "https://avatars0.githubusercontent.com/u/120893?v=4",
"profile": "http://davidmazza.com",
"contributions": [
"code"
]
},
{
"login": "rayandrews",
"name": "Ray Andrew",
"avatar_url": "https://avatars1.githubusercontent.com/u/4437323?v=4",
"profile": "https://github.com/rayandrews",
"contributions": [
"code",
"doc"
]
},
{
"login": "Mzaien",
"name": "Abdullah Mzaien",
"avatar_url": "https://avatars3.githubusercontent.com/u/43112535?v=4",
"profile": "http://Dal.Design",
"contributions": [
"code"
]
},
{
"login": "williamkwao",
"name": "William Kwao",
"avatar_url": "https://avatars2.githubusercontent.com/u/8839514?v=4",
"profile": "http://kwao.io",
"contributions": [
"doc"
]
},
{
"login": "sakulstra",
"name": "Lukas Strassel",
"avatar_url": "https://avatars3.githubusercontent.com/u/4396533?v=4",
"profile": "https://github.com/sakulstra",
"contributions": [
"code"
]
},
{
"login": "tpatel",
"name": "Thibaut Patel",
"avatar_url": "https://avatars3.githubusercontent.com/u/494686?v=4",
"profile": "https://thibpat.com",
"contributions": [
"code"
]
},
{
"login": "jonstuebe",
"name": "Jon Stuebe",
"avatar_url": "https://avatars0.githubusercontent.com/u/156722?v=4",
"profile": "http://jonstuebe.com",
"contributions": [
"code"
]
},
{
"login": "ugogo",
"name": "Ugo Onali",
"avatar_url": "https://avatars2.githubusercontent.com/u/5040476?v=4",
"profile": "https://ugogo.dev",
"contributions": [
"doc"
]
},
{
"login": "saintmalik",
"name": "SaintMalik",
"avatar_url": "https://avatars1.githubusercontent.com/u/37118134?v=4",
"profile": "https://saintmalik.me",
"contributions": [
"doc"
]
},
{
"login": "Khaledgarbaya",
"name": "Khaled Garbaya",
"avatar_url": "https://avatars1.githubusercontent.com/u/1156093?v=4",
"profile": "https://khaledgarbaya.net",
"contributions": [
"code"
]
},
{
"login": "tundera",
"name": "tundera",
"avatar_url": "https://avatars0.githubusercontent.com/u/61833561?v=4",
"profile": "https://tundera.dev",
"contributions": [
"code"
]
},
{
"login": "markylaing",
"name": "markylaing",
"avatar_url": "https://avatars2.githubusercontent.com/u/41469221?v=4",
"profile": "https://github.com/markylaing",
"contributions": [
"code",
"doc"
]
},
{
"login": "AkifumiSato",
"name": "Akifumi Sato",
"avatar_url": "https://avatars2.githubusercontent.com/u/25711332?v=4",
"profile": "https://akfm.dev/",
"contributions": [
"code"
]
},
{
"login": "beeplin",
"name": "Beep LIN",
"avatar_url": "https://avatars3.githubusercontent.com/u/13058150?v=4",
"profile": "https://github.com/beeplin",
"contributions": [
"code"
]
},
{
"login": "mattfwood",
"name": "Matt Wood",
"avatar_url": "https://avatars1.githubusercontent.com/u/22530815?v=4",
"profile": "https://mattwood.tech/",
"contributions": [
"code"
]
},
{
"login": "jackbravo",
"name": "Joaquin Bravo Contreras",
"avatar_url": "https://avatars1.githubusercontent.com/u/15214?v=4",
"profile": "http://joaquin.axai.mx",
"contributions": [
"code"
]
},
{
"login": "arjundubey-cr",
"name": "Arjun Dubey",
"avatar_url": "https://avatars0.githubusercontent.com/u/40758425?v=4",
"profile": "https://github.com/arjundubey-cr",
"contributions": [
"code"
]
},
{
"login": "chanand",
"name": "chanand",
"avatar_url": "https://avatars0.githubusercontent.com/u/1317789?v=4",
"profile": "https://github.com/chanand",
"contributions": [
"code"
]
},
{
"login": "phillipkregg",
"name": "phillipkregg",
"avatar_url": "https://avatars0.githubusercontent.com/u/1066044?v=4",
"profile": "https://github.com/phillipkregg",
"contributions": [
"doc"
]
},
{
"login": "timReynolds",
"name": "Tim Reynolds",
"avatar_url": "https://avatars1.githubusercontent.com/u/168870?v=4",
"profile": "http://timothyreynolds.co.uk",
"contributions": [
"doc"
]
},
{
"login": "linbudu599",
"name": "Linbudu",
"avatar_url": "https://avatars0.githubusercontent.com/u/48507806?v=4",
"profile": "https://linbudu.top/",
"contributions": [
"doc"
]
},
{
"login": "creimers",
"name": "C Reimers",
"avatar_url": "https://avatars0.githubusercontent.com/u/6090492?v=4",
"profile": "http://www.superservice-international.com",
"contributions": [
"doc"
]
},
{
"login": "kyken",
"name": "Tsuyoshi Osawa",
"avatar_url": "https://avatars2.githubusercontent.com/u/20137120?v=4",
"profile": "https://github.com/kyken",
"contributions": [
"code"
]
},
{
"login": "rembrandtreyes",
"name": "Rembrandt Reyes",
"avatar_url": "https://avatars1.githubusercontent.com/u/15057964?v=4",
"profile": "https://rembrandtreyes.com/",
"contributions": [
"code",
"doc",
"test"
]
},
{
"login": "doi-t",
"name": "Toshiya Doi",
"avatar_url": "https://avatars2.githubusercontent.com/u/5877477?v=4",
"profile": "https://doi-t.net",
"contributions": [
"doc"
]
},
{
"login": "koolii",
"name": "t.kuriyama",
"avatar_url": "https://avatars1.githubusercontent.com/u/3866581?v=4",
"profile": "https://www.koolii.net/",
"contributions": [
"code"
]
},
{
"login": "malkomalko",
"name": "Robert Malko",
"avatar_url": "https://avatars3.githubusercontent.com/u/763?v=4",
"profile": "https://github.com/malkomalko",
"contributions": [
"code"
]
},
{
"login": "ranjan-purbey",
"name": "Ranjan Purbey",
"avatar_url": "https://avatars3.githubusercontent.com/u/6953187?v=4",
"profile": "https://github.com/ranjan-purbey",
"contributions": [
"code"
]
},
{
"login": "tarunama",
"name": "tarunama",
"avatar_url": "https://avatars3.githubusercontent.com/u/6047881?v=4",
"profile": "https://github.com/tarunama",
"contributions": [
"code"
]
},
{
"login": "bacongravy",
"name": "David Kramer",
"avatar_url": "https://avatars3.githubusercontent.com/u/16848768?v=4",
"profile": "http://www.bacongravy.net/",
"contributions": [
"code"
]
},
{
"login": "mikeesto",
"name": "Michael Esteban",
"avatar_url": "https://avatars1.githubusercontent.com/u/21051488?v=4",
"profile": "https://mikeesto.com",
"contributions": [
"doc"
]
},
{
"login": "marina-ki",
"name": "marina",
"avatar_url": "https://avatars0.githubusercontent.com/u/54174518?v=4",
"profile": "https://github.com/marina-ki",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,

View File

@@ -8,7 +8,7 @@ module.exports = {
},
project: `./tsconfig.json`,
},
plugins: ["@typescript-eslint", "import", "unicorn"],
plugins: ["@typescript-eslint", "import", "unicorn", "simple-import-sort"],
extends: ["react-app"],
rules: {
"react/react-in-jsx-scope": "off", // React is always in scope with Blitz
@@ -30,6 +30,26 @@ module.exports = {
// note you must disable the base rule as it can report incorrect errors
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": ["error"],
"simple-import-sort/imports": [
"warn",
{
groups: [
[
// Side effect imports.
"^\\u0000",
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
"^@?\\w",
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything that does not start with a dot.
"^[^.]",
// Relative imports.
// Anything that starts with a dot.
"^\\.",
],
],
},
],
},
ignorePatterns: ["packages/cli/", "packages/generator/templates", ".eslintrc.js"],
overrides: [

9
.github/CODEOWNERS vendored
View File

@@ -1,11 +1,8 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
* @flybayer
*.md @merelinguist
packages/server/**/* @ryardley
packages/file-pipeline/**/* @ryardley
packages/cli/**/* @aem
packages/generator/**/* @aem
packages/cli/**/* @aem, @flybayer
packages/generator/**/* @aem @flybayer
packages/generator/templates**/* @flybayer
packages/installer/**/* @aem
packages/installer/**/* @aem @flybayer

View File

@@ -1,4 +1,4 @@
name: Compressed Size
name: CI
on:
pull_request:
@@ -6,14 +6,15 @@ on:
jobs:
build:
name: Compressed Size
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node and Yarn
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: "12.x"
node-version: "14"
- name: Install dependencies
run: |
yarn && yarn build

View File

@@ -1,4 +1,4 @@
name: Continuous Integration
name: CI
on:
push:
@@ -17,9 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: "12.16.1"
node-version: "14"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -32,9 +32,9 @@ jobs:
**/node_modules
/home/runner/.cache/Cypress
C:\Users\runneradmin\AppData\Local\Cypress\Cache
key: ${{ runner.os }}-yarn-v3-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v4-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v3-
${{ runner.os }}-${{ runner.node_version}}-yarn-v4-
- name: Install dependencies
run: yarn install --frozen-lockfile --silent
env:
@@ -44,17 +44,18 @@ jobs:
env:
CI: true
build_and_test_pkgs:
name: Build & Test Packages
name: Packages Tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node_version: [12, 14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: "12.16.1"
node-version: ${{ matrix.node_version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -66,9 +67,9 @@ jobs:
${{ steps.yarn-cache-dir-path.outputs.dir }}
/home/runner/.cache/Cypress
C:\Users\runneradmin\AppData\Local\Cypress\Cache
key: ${{ runner.os }}-yarn-v2-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v4-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v2-
${{ runner.os }}-${{ runner.node_version}}-yarn-v4-
- name: Install dependencies
run: yarn install --frozen-lockfile --silent
env:
@@ -85,17 +86,19 @@ jobs:
env:
CI: true
build_and_test_examples:
name: Build & Test Examples
timeout-minutes: 30
name: Example Apps Tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node_version: [12, 14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: "12.16.1"
node-version: ${{ matrix.node_version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -107,9 +110,9 @@ jobs:
${{ steps.yarn-cache-dir-path.outputs.dir }}
/home/runner/.cache/Cypress
C:\Users\runneradmin\AppData\Local\Cypress\Cache
key: ${{ runner.os }}-yarn-v2-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-${{ runner.node_version}}-yarn-v4-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v2-
${{ runner.os }}-${{ runner.node_version}}-yarn-v4-
- name: Install dependencies
run: yarn install --frozen-lockfile --silent
env:

4
.gitignore vendored
View File

@@ -20,3 +20,7 @@ dist
**/.envrc
.blitz-*
.blitz-cli-cache
.vscode
.tsbuildinfo
.nvmrc
**/.test*

5
.kodiak.toml Normal file
View File

@@ -0,0 +1,5 @@
# .kodiak.toml
# Minimal config. version is the only required field.
version = 1
merge.automerge_label = "0 - <(^_^)> - merge it! ✌️"
approve.auto_approve_usernames = ["flybayer", "depfu"]

View File

@@ -1 +1 @@
12.16.1
12.20.0

139
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-128-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-196-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">
@@ -40,7 +40,9 @@ You need Node.js 12 or newer
#### Install Blitz
Run `npm install -g blitz`
Run `npm install -g blitz` or `yarn global add blitz`
_You can alternatively use [`npx`](https://www.npmjs.com/package/npx)_
#### Create a New App
@@ -51,6 +53,12 @@ Run `npm install -g blitz`
<br><br>
<a aria-label="Bytes Newsletter" href="https://ui.dev/bytes/?r=blitzjs">
<img alt="Bytes Newsletter" src="https://files-8wtskjofb.vercel.app/smarter-16x1.jpg">
</a>
<br><br>
![Architecture diagram](https://blitzjs.now.sh/img/architecture-diagram.png)
<br><br>
@@ -116,16 +124,21 @@ Your financial contributions help ensure Blitz continues to be developed and mai
👉 View options and contribute at [GitHub Sponsors](https://github.com/sponsors/blitz-js), [PayPal](https://paypal.me/thebayers), or [Open Collective](https://opencollective.com/blitzjs)
### 🌱 Seedling Sponsors
<a aria-label="React Bricks" href="https://reactbricks.com/?utm_source=blitzjs&utm_medium=sponsorship&utm_campaign=blitzjs_sponsorship">
<img alt="" src="https://reactbricks.com/reactbricks_icon.svg" width="30px">
<img alt="" src="https://reactbricks.com/reactbricks_icon.svg" width="30px"/>
</a>
<a aria-label="Andreas Asprou" href="https://andreas.fyi">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/andreas.jpg" width="30px"/>
</a>
### 🥉 Bronze Sponsors
<a aria-label="Your Company" href="#">
<img alt="" src="https://dummyimage.com/1000x330/efe8ff/000000.png&text=Your+Logo+Here" width="100px">
<a aria-label="Render.com" href="https://render.com?utm_source=BlitzJS&utm_medium=sponsorship&utm_campaign=BlitzJS_Sponsorship_2020">
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/canary/assets/render-logo-color2.png" width="110px">
</a>
### 🥈 Silver Sponsors
@@ -136,9 +149,11 @@ Your financial contributions help ensure Blitz continues to be developed and mai
### 🏆 Gold Sponsors
<a aria-label="Your Company" href="#">
<img alt="" src="https://dummyimage.com/1000x330/efe8ff/000000.png&text=Your+Logo+Here" width="300px">
<div>
<a aria-label="G2i" href="http://g2i.co/sign-up?utm_source=blitz&utm_medium=referral&utm_campaign=blitz2020">
<img alt="" src="https://files-5oz00y7xp.vercel.app/G2i_Logo_wwords.png" width="160px">
</a>
</div>
### 💎 Diamond Sponsors
@@ -154,8 +169,6 @@ Your financial contributions help ensure Blitz continues to be developed and mai
<table>
<tr>
<td align="center"><a href="https://twitter.com/flybayer"><img src="https://avatars3.githubusercontent.com/u/8813276?v=4" width="100px;" alt=""/><br /><sub><b>Brandon Bayer</b></sub></a><br />Creator</td>
<td align="center"><a href="https://medium.com/@ryardley"><img src="https://avatars0.githubusercontent.com/u/1256409?v=4" width="100px;" alt=""/><br /><sub><b>Rudi Yardley</b></sub></a><br />Node.js Wizard</td>
<td align="center"><a href="https://merelinguist.now.sh"><img src="https://avatars3.githubusercontent.com/u/24858006?v=4" width="100px;" alt=""/><br /><sub><b>Dylan Brookes</b></sub></a><br />Friendly Generalist</td>
</tr>
</table>
<!-- markdownlint-enable -->
@@ -174,6 +187,7 @@ _Code ownership, pull request approvals and merging, etc_ (see [MAINTAINERS.md](
<tr>
<td align="center"><a href="https://github.com/aem"><img src="https://avatars0.githubusercontent.com/u/1909883?v=4" width="100px;" alt=""/><br /><sub><b>Adam Markon</b></sub></a><br />CLI</td>
<td align="center"><a href="http://robdrosenberg.com"><img src="https://avatars0.githubusercontent.com/u/20813991?v=4" width="100px;" alt=""/><br /><sub><b>Robert Rosenberg</b></sub></a><br />Website/Docs</td>
<td align="center"><a href="http://simonknott.de"><img src="https://avatars1.githubusercontent.com/u/14912729?v=4" width="100px;" alt=""/><br /><sub><b>Simon Knott</b></sub></a><br />SuperJSON</td>
</tr>
</table>
<!-- markdownlint-enable -->
@@ -192,15 +206,18 @@ _Issue triage, pull request triage, community encouragement and moderation, etc_
<tr>
<td align="center"><a href="https://github.com/LoriKarikari"><img src="https://avatars1.githubusercontent.com/u/7902980?v=4" width="100px;" alt=""/><br /><sub><b>Lori Karikari</b></sub></a></td>
<td align="center"><a href="https://corey-brown.com"><img src="https://avatars1.githubusercontent.com/u/12791148?v=4" width="100px;" alt=""/><br /><sub><b>Corey Brown</b></sub></a></td>
<td align="center"><a href="http://simonknott.de"><img src="https://avatars1.githubusercontent.com/u/14912729?v=4" width="100px;" alt=""/><br /><sub><b>Simon Knott</b></sub></a></td>
<td align="center"><a href="http://jeremyliberman.com/"><img src="https://avatars3.githubusercontent.com/u/2754163?v=4" width="100px;" alt=""/><br /><sub><b>Jeremy Liberman</b></td>
<td align="center"><a href="http://jagascript.com"><img src="https://avatars0.githubusercontent.com/u/4562878?v=4" width="100px;" alt=""/><br /><sub><b>Jaga Santagostino</b></sub></a></td>
<td align="center"><a href="https://simonpeterdebbarma.com"><img src="https://avatars3.githubusercontent.com/u/31207418?v=4" width="100px;" alt=""/><br /><sub><b>Simon Debbarma</b></sub></a></td>
<td align="center"><a href="https://github.com/jclancy93"><img src="https://avatars2.githubusercontent.com/u/7850202?v=4" width="100px;" alt=""/><br /><sub><b>Jack Clancy</b></sub></a></td>
<td align="center"><a href="https://twitter.com/nitaking_"><img src="https://avatars2.githubusercontent.com/u/10850034?v=4" width="100px;" alt=""/><br /><sub><b>Satoshi Nitawaki</b></sub></a></td>
<td align="center"><a href="https://twitter.com/sandulat"><img src="https://avatars2.githubusercontent.com/u/7345874?v=4" width="100px;" alt=""/><br /><sub><b>Alexandru Stratulat</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://twitter.com/ivandevp"><img src="https://avatars3.githubusercontent.com/u/9284690?v=4" width="100px;" alt=""/><br /><sub><b>Ivan Medina</b></sub></a></td>
<td align="center"><a href="https://twitter.com/nitaking_"><img src="https://avatars2.githubusercontent.com/u/10850034?v=4" width="100px;" alt=""/><br /><sub><b>Satoshi Nitawaki</b></sub></a></td>
<td align="center"><a href="https://github.com/engelkes-finstreet"><img src="https://avatars0.githubusercontent.com/u/36962022?s=460&u=34cfc4a3d6da0a87026f6068c371779c68daa3a2&v=4" width="100px;" alt=""/><br /><sub><b>Patrick Engelkes</b></sub></a></td>
<td align="center"><a href="https://twitter.com/jdavenport97"><img src="https://avatars2.githubusercontent.com/u/1329874?v=4" width="100px;" alt=""/><br /><sub><b>Jamie Davenport</b></sub></a></td>
<td align="center"><a href="https://twitter.com/myrondavis"><img src="https://avatars2.githubusercontent.com/u/1430136?v=4" width="100px;" alt=""/><br /><sub><b>Myron Davis</b></sub></a></td>
<td align="center"><a href="https://flavioander.com/"><img src="https://avatars2.githubusercontent.com/u/14948074?s=460&u=31d7ea58b5c5cd9f724d684ed578f68896c4af71&v=4" width="100px;" alt=""/><br /><sub><b>Flavio Andrade</b></sub></a></td>
<td align="center"><a href="https://twitter.com/NaReto1125_"><img src="https://avatars.githubusercontent.com/reo777" width="100px;" alt=""/><br /><sub><b>Reo Ishiyama</b></sub></a></td>
<td align="center"><a href="https://github.com/malkomalko"><img src="https://avatars.githubusercontent.com/malkomalko" width="100px;" alt=""/><br /><sub><b>Robert Malko</b></sub></a></td>
</tr>
</table>
<!-- markdownlint-enable -->
@@ -295,7 +312,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<td align="center"><a href="https://kevo.dev"><img src="https://avatars3.githubusercontent.com/u/15717067?v=4" width="100px;" alt=""/><br /><sub><b>Kevin Tovar</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=kevotovar" title="Code">💻</a></td>
<td align="center"><a href="http://anteprimorac.com.hr"><img src="https://avatars0.githubusercontent.com/u/972083?v=4" 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" 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" 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></td>
<td align="center"><a href="https://jamiedavenport.dev"><img src="https://avatars2.githubusercontent.com/u/1329874?v=4" 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" 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>
</tr>
<tr>
@@ -348,9 +365,9 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<td align="center"><a href="https://twitter.com/dillonraphael"><img src="https://avatars0.githubusercontent.com/u/3496193?v=4" 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://github.com/clgeoio"><img src="https://avatars2.githubusercontent.com/u/37571416?v=4" 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" 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" 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></td>
<td align="center"><a href="https://github.com/sirmyron"><img src="https://avatars2.githubusercontent.com/u/1430136?v=4" width="100px;" alt=""/><br /><sub><b>sirmyron</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sirmyron" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/engelkes-finstreet"><img src="https://avatars1.githubusercontent.com/u/36962022?v=4" width="100px;" alt=""/><br /><sub><b>engelkes-finstreet</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=engelkes-finstreet" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=engelkes-finstreet" title="Code">💻</a></td>
<td align="center"><a href="https://twitter.com/nitaking_"><img src="https://avatars2.githubusercontent.com/u/10850034?v=4" 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>
<td align="center"><a href="https://github.com/sirmyron"><img src="https://avatars2.githubusercontent.com/u/1430136?v=4" width="100px;" alt=""/><br /><sub><b>sirmyron</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sirmyron" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=sirmyron" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/engelkes-finstreet"><img src="https://avatars1.githubusercontent.com/u/36962022?v=4" width="100px;" alt=""/><br /><sub><b>engelkes-finstreet</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=engelkes-finstreet" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=engelkes-finstreet" title="Code">💻</a> <a href="#maintenance-engelkes-finstreet" title="Maintenance">🚧</a></td>
</tr>
<tr>
<td align="center"><a href="http://twitter.com/pixelscommander"><img src="https://avatars2.githubusercontent.com/u/810671?v=4" width="100px;" alt=""/><br /><sub><b>Denis Radin</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/pulls?q=is%3Apr+reviewed-by%3APixelsCommander" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/blitz-js/blitz/commits?author=PixelsCommander" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=PixelsCommander" title="Documentation">📖</a></td>
@@ -382,6 +399,92 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<tr>
<td align="center"><a href="https://github.com/phillippschmedt"><img src="https://avatars0.githubusercontent.com/u/16028406?v=4" width="100px;" alt=""/><br /><sub><b>Phillipp Schmedt</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=phillippschmedt" title="Code">💻</a></td>
<td align="center"><a href="https://haspar.us"><img src="https://avatars0.githubusercontent.com/u/15332326?v=4" width="100px;" alt=""/><br /><sub><b>Piotr Monwid-Olechnowicz</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=hasparus" title="Code">💻</a></td>
<td align="center"><a href="https://mizchi.dev"><img src="https://avatars2.githubusercontent.com/u/73962?v=4" width="100px;" alt=""/><br /><sub><b>Kotaro Chikuba</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=mizchi" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=mizchi" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/konradkalemba"><img src="https://avatars0.githubusercontent.com/u/8682104?v=4" width="100px;" alt=""/><br /><sub><b>Konrad Kalemba</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=konradkalemba" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Alucard17"><img src="https://avatars1.githubusercontent.com/u/26205172?v=4" width="100px;" alt=""/><br /><sub><b>Alucard17</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Alucard17" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Dohxis"><img src="https://avatars2.githubusercontent.com/u/8768909?v=4" width="100px;" alt=""/><br /><sub><b>Domantas Mauruča</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Dohxis" title="Tests">⚠️</a> <a href="https://github.com/blitz-js/blitz/commits?author=Dohxis" title="Code">💻</a></td>
<td align="center"><a href="https://sandulat.com/"><img src="https://avatars0.githubusercontent.com/u/7345874?v=4" width="100px;" alt=""/><br /><sub><b>Stratulat Alexandru</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sandulat" title="Code">💻</a> <a href="#maintenance-sandulat" title="Maintenance">🚧</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/aericson"><img src="https://avatars3.githubusercontent.com/u/692542?v=4" width="100px;" alt=""/><br /><sub><b>André Ericson</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=aericson" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=aericson" title="Documentation">📖</a></td>
<td align="center"><a href="http://Cajotafer.com"><img src="https://avatars2.githubusercontent.com/u/41461969?v=4" width="100px;" alt=""/><br /><sub><b>Carlos Fernández</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=cajotafer" title="Documentation">📖</a></td>
<td align="center"><a href="https://oesterkilde.dk/"><img src="https://avatars1.githubusercontent.com/u/6379824?v=4" width="100px;" alt=""/><br /><sub><b>Kevin Østerkilde</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Kosai106" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=Kosai106" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/aaronfulkerson"><img src="https://avatars0.githubusercontent.com/u/31112737?v=4" width="100px;" alt=""/><br /><sub><b>aaronfulkerson</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=aaronfulkerson" title="Code">💻</a> <a href="#question-aaronfulkerson" title="Answering Questions">💬</a></td>
<td align="center"><a href="https://github.com/alexnaiman"><img src="https://avatars3.githubusercontent.com/u/25799714?v=4" width="100px;" alt=""/><br /><sub><b>Alexandru Naiman</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=alexnaiman" title="Code">💻</a></td>
<td align="center"><a href="https://davidlutta.github.io/portfolio/"><img src="https://avatars2.githubusercontent.com/u/14890315?v=4" width="100px;" alt=""/><br /><sub><b>David Ezekiel Lutta</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=davidlutta" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/wanjuntham"><img src="https://avatars1.githubusercontent.com/u/49380551?v=4" width="100px;" alt=""/><br /><sub><b>wanjuntham</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=wanjuntham" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://www.nahuelchaves.xyz"><img src="https://avatars3.githubusercontent.com/u/96837?v=4" width="100px;" alt=""/><br /><sub><b>Victor Nahuel Chaves</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=nahue" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/peter50216"><img src="https://avatars3.githubusercontent.com/u/891109?v=4" width="100px;" alt=""/><br /><sub><b>Peter Shih</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=peter50216" title="Code">💻</a></td>
<td align="center"><a href="http://seweryn.kale.mba"><img src="https://avatars3.githubusercontent.com/u/37031328?v=4" width="100px;" alt=""/><br /><sub><b>Seweryn Kalemba</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sewerynkalemba" title="Code">💻</a></td>
<td align="center"><a href="https://nksaraf.github.io"><img src="https://avatars2.githubusercontent.com/u/11255148?v=4" width="100px;" alt=""/><br /><sub><b>Nikhil Saraf</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=nksaraf" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=nksaraf" title="Documentation">📖</a></td>
<td align="center"><a href="https://zane.sh"><img src="https://avatars0.githubusercontent.com/u/16865690?v=4" width="100px;" alt=""/><br /><sub><b>Zane</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=zanedb" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/dulcehc"><img src="https://avatars1.githubusercontent.com/u/19391835?v=4" width="100px;" alt=""/><br /><sub><b>Dulce Hernández</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=dulcehc" title="Code">💻</a></td>
<td align="center"><a href="https://markhaehnel.de"><img src="https://avatars2.githubusercontent.com/u/1516205?v=4" width="100px;" alt=""/><br /><sub><b>Mark Hähnel</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=markhaehnel" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://stackoverflow.com/users/872395/nemesv"><img src="https://avatars0.githubusercontent.com/u/251330?v=4" width="100px;" alt=""/><br /><sub><b>Viktor Nemes</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=nemesv" title="Code">💻</a></td>
<td align="center"><a href="http://gabeoleary.com"><img src="https://avatars1.githubusercontent.com/u/16123225?v=4" width="100px;" alt=""/><br /><sub><b>Gabe O'Leary</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=goleary" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/machadolucasvp"><img src="https://avatars0.githubusercontent.com/u/44952113?v=4" width="100px;" alt=""/><br /><sub><b>Lucas Machado</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=machadolucasvp" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/maciekgrzybek"><img src="https://avatars2.githubusercontent.com/u/16546428?v=4" width="100px;" alt=""/><br /><sub><b>maciek_grzybek</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=maciekgrzybek" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/mweibel"><img src="https://avatars1.githubusercontent.com/u/307427?v=4" width="100px;" alt=""/><br /><sub><b>Michael Weibel</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=mweibel" title="Code">💻</a></td>
<td align="center"><a href="https://isoppp.com"><img src="https://avatars0.githubusercontent.com/u/16318727?v=4" width="100px;" alt=""/><br /><sub><b>Hiroki Isogai</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=isoppp" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/matamatanot"><img src="https://avatars2.githubusercontent.com/u/39780486?v=4" width="100px;" alt=""/><br /><sub><b>matamatanot</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=matamatanot" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/ericsakmar"><img src="https://avatars3.githubusercontent.com/u/5620709?v=4" width="100px;" alt=""/><br /><sub><b>Eric Sakmar</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ericsakmar" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/leggsimon"><img src="https://avatars2.githubusercontent.com/u/11544418?v=4" width="100px;" alt=""/><br /><sub><b>Simon Legg</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=leggsimon" title="Documentation">📖</a></td>
<td align="center"><a href="https://robsoriano.com"><img src="https://avatars3.githubusercontent.com/u/13049130?v=4" width="100px;" alt=""/><br /><sub><b>Robert Soriano</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=wobsoriano" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/benediktms"><img src="https://avatars2.githubusercontent.com/u/48836135?v=4" width="100px;" alt=""/><br /><sub><b>Benedikt Schnatterbeck</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=benediktms" title="Code">💻</a></td>
<td align="center"><a href="http://taloranderson.com"><img src="https://avatars2.githubusercontent.com/u/11509865?v=4" width="100px;" alt=""/><br /><sub><b>Talor Anderson</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Talor-A" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/akirabaruah"><img src="https://avatars2.githubusercontent.com/u/6751517?v=4" width="100px;" alt=""/><br /><sub><b>Akira Baruah</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=akirabaruah" title="Code">💻</a></td>
<td align="center"><a href="https://chriswray.dev/"><img src="https://avatars0.githubusercontent.com/u/53663762?v=4" width="100px;" alt=""/><br /><sub><b>Christopher Wray</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=cwray-tech" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/piotrski"><img src="https://avatars0.githubusercontent.com/u/244174?v=4" width="100px;" alt=""/><br /><sub><b>Piotrek Tomczewski</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=piotrski" title="Code">💻</a></td>
<td align="center"><a href="http://raph.site"><img src="https://avatars3.githubusercontent.com/u/1575946?v=4" width="100px;" alt=""/><br /><sub><b>Raphaël Huchet</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=rap2hpoutre" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=rap2hpoutre" title="Tests">⚠️</a> <a href="https://github.com/blitz-js/blitz/commits?author=rap2hpoutre" title="Code">💻</a></td>
<td align="center"><a href="http://kattcorp.com"><img src="https://avatars1.githubusercontent.com/u/459267?v=4" width="100px;" alt=""/><br /><sub><b>Alex Johansson</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=KATT" title="Code">💻</a></td>
<td align="center"><a href="http://davidmazza.com"><img src="https://avatars0.githubusercontent.com/u/120893?v=4" width="100px;" alt=""/><br /><sub><b>David Mazza</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=dmzza" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/rayandrews"><img src="https://avatars1.githubusercontent.com/u/4437323?v=4" width="100px;" alt=""/><br /><sub><b>Ray Andrew</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=rayandrews" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=rayandrews" title="Documentation">📖</a></td>
<td align="center"><a href="http://Dal.Design"><img src="https://avatars3.githubusercontent.com/u/43112535?v=4" width="100px;" alt=""/><br /><sub><b>Abdullah Mzaien</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Mzaien" title="Code">💻</a></td>
<td align="center"><a href="http://kwao.io"><img src="https://avatars2.githubusercontent.com/u/8839514?v=4" width="100px;" alt=""/><br /><sub><b>William Kwao</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=williamkwao" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/sakulstra"><img src="https://avatars3.githubusercontent.com/u/4396533?v=4" width="100px;" alt=""/><br /><sub><b>Lukas Strassel</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sakulstra" title="Code">💻</a></td>
<td align="center"><a href="https://thibpat.com"><img src="https://avatars3.githubusercontent.com/u/494686?v=4" width="100px;" alt=""/><br /><sub><b>Thibaut Patel</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=tpatel" title="Code">💻</a></td>
<td align="center"><a href="http://jonstuebe.com"><img src="https://avatars0.githubusercontent.com/u/156722?v=4" width="100px;" alt=""/><br /><sub><b>Jon Stuebe</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=jonstuebe" title="Code">💻</a></td>
<td align="center"><a href="https://ugogo.dev"><img src="https://avatars2.githubusercontent.com/u/5040476?v=4" width="100px;" alt=""/><br /><sub><b>Ugo Onali</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ugogo" title="Documentation">📖</a></td>
<td align="center"><a href="https://saintmalik.me"><img src="https://avatars1.githubusercontent.com/u/37118134?v=4" width="100px;" alt=""/><br /><sub><b>SaintMalik</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=saintmalik" title="Documentation">📖</a></td>
<td align="center"><a href="https://khaledgarbaya.net"><img src="https://avatars1.githubusercontent.com/u/1156093?v=4" width="100px;" alt=""/><br /><sub><b>Khaled Garbaya</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Khaledgarbaya" title="Code">💻</a></td>
<td align="center"><a href="https://tundera.dev"><img src="https://avatars0.githubusercontent.com/u/61833561?v=4" width="100px;" alt=""/><br /><sub><b>tundera</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=tundera" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/markylaing"><img src="https://avatars2.githubusercontent.com/u/41469221?v=4" width="100px;" alt=""/><br /><sub><b>markylaing</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=markylaing" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=markylaing" title="Documentation">📖</a></td>
<td align="center"><a href="https://akfm.dev/"><img src="https://avatars2.githubusercontent.com/u/25711332?v=4" width="100px;" alt=""/><br /><sub><b>Akifumi Sato</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=AkifumiSato" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/beeplin"><img src="https://avatars3.githubusercontent.com/u/13058150?v=4" width="100px;" alt=""/><br /><sub><b>Beep LIN</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=beeplin" title="Code">💻</a></td>
<td align="center"><a href="https://mattwood.tech/"><img src="https://avatars1.githubusercontent.com/u/22530815?v=4" width="100px;" alt=""/><br /><sub><b>Matt Wood</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=mattfwood" title="Code">💻</a></td>
<td align="center"><a href="http://joaquin.axai.mx"><img src="https://avatars1.githubusercontent.com/u/15214?v=4" width="100px;" alt=""/><br /><sub><b>Joaquin Bravo Contreras</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=jackbravo" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/arjundubey-cr"><img src="https://avatars0.githubusercontent.com/u/40758425?v=4" width="100px;" alt=""/><br /><sub><b>Arjun Dubey</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=arjundubey-cr" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/chanand"><img src="https://avatars0.githubusercontent.com/u/1317789?v=4" width="100px;" alt=""/><br /><sub><b>chanand</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=chanand" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/phillipkregg"><img src="https://avatars0.githubusercontent.com/u/1066044?v=4" width="100px;" alt=""/><br /><sub><b>phillipkregg</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=phillipkregg" title="Documentation">📖</a></td>
<td align="center"><a href="http://timothyreynolds.co.uk"><img src="https://avatars1.githubusercontent.com/u/168870?v=4" width="100px;" alt=""/><br /><sub><b>Tim Reynolds</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=timReynolds" title="Documentation">📖</a></td>
<td align="center"><a href="https://linbudu.top/"><img src="https://avatars0.githubusercontent.com/u/48507806?v=4" width="100px;" alt=""/><br /><sub><b>Linbudu</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=linbudu599" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.superservice-international.com"><img src="https://avatars0.githubusercontent.com/u/6090492?v=4" width="100px;" alt=""/><br /><sub><b>C Reimers</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=creimers" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/kyken"><img src="https://avatars2.githubusercontent.com/u/20137120?v=4" width="100px;" alt=""/><br /><sub><b>Tsuyoshi Osawa</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=kyken" title="Code">💻</a></td>
<td align="center"><a href="https://rembrandtreyes.com/"><img src="https://avatars1.githubusercontent.com/u/15057964?v=4" width="100px;" alt=""/><br /><sub><b>Rembrandt Reyes</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=rembrandtreyes" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=rembrandtreyes" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=rembrandtreyes" title="Tests">⚠️</a></td>
<td align="center"><a href="https://doi-t.net"><img src="https://avatars2.githubusercontent.com/u/5877477?v=4" width="100px;" alt=""/><br /><sub><b>Toshiya Doi</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=doi-t" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://www.koolii.net/"><img src="https://avatars1.githubusercontent.com/u/3866581?v=4" width="100px;" alt=""/><br /><sub><b>t.kuriyama</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=koolii" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/malkomalko"><img src="https://avatars3.githubusercontent.com/u/763?v=4" width="100px;" alt=""/><br /><sub><b>Robert Malko</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=malkomalko" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ranjan-purbey"><img src="https://avatars3.githubusercontent.com/u/6953187?v=4" width="100px;" alt=""/><br /><sub><b>Ranjan Purbey</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ranjan-purbey" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/tarunama"><img src="https://avatars3.githubusercontent.com/u/6047881?v=4" width="100px;" alt=""/><br /><sub><b>tarunama</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=tarunama" title="Code">💻</a></td>
<td align="center"><a href="http://www.bacongravy.net/"><img src="https://avatars3.githubusercontent.com/u/16848768?v=4" width="100px;" alt=""/><br /><sub><b>David Kramer</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=bacongravy" title="Code">💻</a></td>
<td align="center"><a href="https://mikeesto.com"><img src="https://avatars1.githubusercontent.com/u/21051488?v=4" width="100px;" alt=""/><br /><sub><b>Michael Esteban</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=mikeesto" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/marina-ki"><img src="https://avatars0.githubusercontent.com/u/54174518?v=4" width="100px;" alt=""/><br /><sub><b>marina</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=marina-ki" title="Documentation">📖</a></td>
</tr>
</table>

BIN
assets/andreas.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -1,15 +1,3 @@
module.exports = {
env: {
es2020: true,
"cypress/globals": true,
},
extends: ["react-app", "plugin:jsx-a11y/recommended"],
plugins: ["jsx-a11y", "cypress"],
rules: {
"import/no-anonymous-default-export": "error",
"import/no-webpack-loader-syntax": "off",
"react/react-in-jsx-scope": "off", // React is always in scope with Blitz
"jsx-a11y/anchor-is-valid": "off", //Doesn't play well with Blitz/Next <Link> usage
"jsx-a11y/label-has-associated-control": "off", //Doesn't play well with form libraries
},
extends: ["blitz"],
}

View File

@@ -14,7 +14,7 @@ model Project {
2. DB migrate
```
blitz db migrate
blitz prisma migrate dev --preview-feature
```
3. Start the dev server

View File

@@ -23,109 +23,115 @@ assert(process.env.AUTH0_CLIENT_SECRET, "You must provide the AUTH0_CLIENT_SECRE
export default passportAuth({
successRedirectUrl: "/",
authenticateOptions: {scope: "openid email profile"}, //used for Auth0Strategy - without an empty profile is returned
strategies: [
new TwitterStrategy(
{
consumerKey: process.env.TWITTER_CONSUMER_KEY,
consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
callbackURL:
process.env.NODE_ENV === "production"
? "https://auth-example-flybayer.blitzjs.vercel.app/api/auth/twitter/callback"
: "http://localhost:3000/api/auth/twitter/callback",
includeEmail: true,
},
async function (_token, _tokenSecret, profile, done) {
const email = profile.emails && profile.emails[0]?.value
{
strategy: new TwitterStrategy(
{
consumerKey: process.env.TWITTER_CONSUMER_KEY,
consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
callbackURL:
process.env.NODE_ENV === "production"
? "https://auth-example-flybayer.blitzjs.vercel.app/api/auth/twitter/callback"
: "http://localhost:3000/api/auth/twitter/callback",
includeEmail: true,
},
async function (_token, _tokenSecret, profile, done) {
const email = profile.emails && profile.emails[0]?.value
if (!email) {
// This can happen if you haven't enabled email access in your twitter app permissions
return done(new Error("Twitter OAuth response doesn't have email."))
}
if (!email) {
// This can happen if you haven't enabled email access in your twitter app permissions
return done(new Error("Twitter OAuth response doesn't have email."))
}
const user = await db.user.upsert({
where: {email},
create: {
email,
name: profile.displayName,
},
update: {email},
})
const user = await db.user.upsert({
where: {email},
create: {
email,
name: profile.displayName,
},
update: {email},
})
const publicData = {userId: user.id, roles: [user.role], source: "twitter"}
done(null, {publicData})
},
),
new GitHubStrategy(
{
clientID: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
callbackURL:
process.env.NODE_ENV === "production"
? "https://auth-example-flybayer.blitzjs.vercel.app/api/auth/github/callback"
: "http://localhost:3000/api/auth/github/callback",
},
async function (_token, _tokenSecret, profile, done) {
const email = profile.emails && profile.emails[0]?.value
const publicData = {userId: user.id, roles: [user.role], source: "twitter"}
done(null, {publicData})
},
),
},
{
strategy: new GitHubStrategy(
{
clientID: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
callbackURL:
process.env.NODE_ENV === "production"
? "https://auth-example-flybayer.blitzjs.vercel.app/api/auth/github/callback"
: "http://localhost:3000/api/auth/github/callback",
},
async function (_token, _tokenSecret, profile, done) {
const email = profile.emails && profile.emails[0]?.value
if (!email) {
// This can happen if you haven't enabled email access in your twitter app permissions
return done(new Error("Twitter OAuth response doesn't have email."))
}
if (!email) {
// This can happen if you haven't enabled email access in your twitter app permissions
return done(new Error("Twitter OAuth response doesn't have email."))
}
const user = await db.user.upsert({
where: {email},
create: {
email,
name: profile.displayName,
},
update: {email},
})
const user = await db.user.upsert({
where: {email},
create: {
email,
name: profile.displayName,
},
update: {email},
})
const publicData = {
userId: user.id,
roles: [user.role],
source: "github",
githubUsername: profile.username,
}
done(null, {publicData})
},
),
new Auth0Strategy(
{
domain: process.env.AUTH0_DOMAIN,
clientID: process.env.AUTH0_CLIENT_ID,
clientSecret: process.env.AUTH0_CLIENT_SECRET,
callbackURL:
process.env.NODE_ENV === "production"
? "https://auth-example-flybayer.blitzjs.vercel.app/api/auth/auth0/callback"
: "http://localhost:3000/api/auth/auth0/callback",
},
async function (_token, _tokenSecret, extraParams, profile, done) {
const email = profile.emails && profile.emails[0]?.value
const publicData = {
userId: user.id,
roles: [user.role],
source: "github",
githubUsername: profile.username,
}
done(null, {publicData})
},
),
},
{
authenticateOptions: {scope: "openid email profile"},
strategy: new Auth0Strategy(
{
domain: process.env.AUTH0_DOMAIN,
clientID: process.env.AUTH0_CLIENT_ID,
clientSecret: process.env.AUTH0_CLIENT_SECRET,
callbackURL:
process.env.NODE_ENV === "production"
? "https://auth-example-flybayer.blitzjs.vercel.app/api/auth/auth0/callback"
: "http://localhost:3000/api/auth/auth0/callback",
},
async function (_token, _tokenSecret, extraParams, profile, done) {
const email = profile.emails && profile.emails[0]?.value
if (!email) {
// This can happen if you haven't enabled email access in your twitter app permissions
return done(new Error("GitHub OAuth response doesn't have email."))
}
if (!email) {
// This can happen if you haven't enabled email access in your twitter app permissions
return done(new Error("Auth0 response doesn't have email."))
}
const user = await db.user.upsert({
where: {email},
create: {
email,
name: profile.displayName,
},
update: {email},
})
const user = await db.user.upsert({
where: {email},
create: {
email,
name: profile.displayName,
},
update: {email},
})
const publicData = {
userId: user.id,
roles: [user.role],
source: "auth0",
githubUsername: profile.username,
}
done(undefined, {publicData})
},
),
const publicData = {
userId: user.id,
roles: [user.role],
source: "auth0",
githubUsername: profile.username,
}
done(undefined, {publicData})
},
),
},
],
})

View File

@@ -1,39 +0,0 @@
import {AuthenticationError} from "blitz"
import SecurePassword from "secure-password"
import db from "db"
const SP = new SecurePassword()
export const hashPassword = async (password: string) => {
const hashedBuffer = await SP.hash(Buffer.from(password))
return hashedBuffer.toString("base64")
}
export const verifyPassword = async (hashedPassword: string, password: string) => {
try {
return await SP.verify(Buffer.from(password), Buffer.from(hashedPassword, "base64"))
} catch (error) {
console.error(error)
return false
}
}
export const authenticateUser = async (email: string, password: string) => {
const user = await db.user.findOne({where: {email}})
if (!user || !user.hashedPassword) throw new AuthenticationError()
switch (await verifyPassword(user.hashedPassword, password)) {
case SecurePassword.VALID:
break
case SecurePassword.VALID_NEEDS_REHASH:
// Upgrade hashed password with a more secure hash
const improvedHash = await hashPassword(password)
await db.user.update({where: {id: user.id}, data: {hashedPassword: improvedHash}})
break
default:
throw new AuthenticationError()
}
const {hashedPassword, ...rest} = user
return rest
}

View File

@@ -1,8 +1,7 @@
import {Link, useMutation} from "blitz"
import {Link, useMutation, AuthenticationError} from "blitz"
import {LabeledTextField} from "app/components/LabeledTextField"
import {Form, FORM_ERROR} from "app/components/Form"
import login from "app/auth/mutations/login"
import {LoginInput} from "app/auth/validations"
import login, {LoginInput} from "app/auth/mutations/login"
type LoginFormProps = {
onSuccess?: () => void
@@ -14,7 +13,7 @@ export const LoginForm = (props: LoginFormProps) => {
<div>
<h1>Login</h1>
<Form
submitText="Log In"
submitText="Login"
schema={LoginInput}
initialValues={{email: undefined, password: undefined}}
onSubmit={async (values) => {
@@ -22,7 +21,7 @@ export const LoginForm = (props: LoginFormProps) => {
await loginMutation(values)
props.onSuccess && props.onSuccess()
} catch (error) {
if (error.name === "AuthenticationError") {
if (error instanceof AuthenticationError) {
return {[FORM_ERROR]: "Sorry, those credentials are invalid"}
} else {
return {

View File

@@ -1,6 +1,28 @@
import {Ctx} from "blitz"
import {authenticateUser} from "app/auth/auth-utils"
import {LoginInput, LoginInputType} from "../validations"
import {Ctx, SecurePassword, AuthenticationError} from "blitz"
import db from "db"
import * as z from "zod"
export const authenticateUser = async (email: string, password: string) => {
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 const LoginInput = z.object({
email: z.string().email(),
password: z.string(),
})
export type LoginInputType = z.infer<typeof LoginInput>
export default async function login(input: LoginInputType, {session}: Ctx) {
// This throws an error if input is invalid

View File

@@ -1,13 +1,18 @@
import {Ctx} from "blitz"
import {Ctx, SecurePassword} from "blitz"
import db from "db"
import {hashPassword} from "app/auth/auth-utils"
import {SignupInput, SignupInputType} from "app/auth/validations"
import * as z from "zod"
export const SignupInput = z.object({
email: z.string().email(),
password: z.string().min(10).max(100),
})
export type SignupInputType = z.infer<typeof SignupInput>
export default async function signup(input: SignupInputType, {session}: Ctx) {
// This throws an error if input is invalid
const {email, password} = SignupInput.parse(input)
const hashedPassword = await hashPassword(password)
const hashedPassword = await SecurePassword.hash(password)
const user = await db.user.create({
data: {email, hashedPassword, role: "user"},
select: {id: true, name: true, email: true, role: true},

View File

@@ -7,7 +7,7 @@ const SignupPage: BlitzPage = () => {
return (
<>
<Head>
<title>Log In</title>
<title>Login</title>
<link rel="icon" href="/favicon.ico" />
</Head>

View File

@@ -1,8 +1,7 @@
import {Head, useRouter, BlitzPage, useMutation} from "blitz"
import {Form, FORM_ERROR} from "app/components/Form"
import {LabeledTextField} from "app/components/LabeledTextField"
import signup from "app/auth/mutations/signup"
import {SignupInput} from "app/auth/validations"
import signup, {SignupInput} from "app/auth/mutations/signup"
const SignupPage: BlitzPage = () => {
const router = useRouter()

View File

@@ -1,10 +1,7 @@
import {useQuery, useSession} from "blitz"
import {useQuery} from "blitz"
import getCurrentUser from "app/users/queries/getCurrentUser"
export const useCurrentUser = () => {
// We wouldn't have to useSession() here, but doing so improves perf on initial
// load since we can skip the getCurrentUser() request.
const session = useSession()
const [user] = useQuery(getCurrentUser, null, {enabled: !!session.userId})
return session.userId ? user : null
const [user] = useQuery(getCurrentUser, null)
return user
}

View File

@@ -1,4 +1,4 @@
import {AppProps, ErrorComponent, useRouter} from "blitz"
import {AppProps, ErrorComponent, useRouter, AuthenticationError, AuthorizationError} from "blitz"
import {ErrorBoundary} from "react-error-boundary"
import {queryCache} from "react-query"
import LoginForm from "app/auth/components/LoginForm"
@@ -25,9 +25,9 @@ export default function App({Component, pageProps}: AppProps) {
}
function RootErrorFallback({error, resetErrorBoundary}) {
if (error.name === "AuthenticationError") {
if (error instanceof AuthenticationError) {
return <LoginForm onSuccess={resetErrorBoundary} />
} else if (error.name === "AuthorizationError") {
} else if (error instanceof AuthorizationError) {
return (
<ErrorComponent
statusCode={error.statusCode}

View File

@@ -0,0 +1,20 @@
import {render} from "test/utils"
import Home from "./index"
import {useCurrentUser} from "app/hooks/useCurrentUser"
jest.mock("app/hooks/useCurrentUser")
const mockUseCurrentUser = useCurrentUser as jest.MockedFunction<typeof useCurrentUser>
test("renders blitz documentation link", () => {
mockUseCurrentUser.mockReturnValue({
id: 1,
name: "User",
email: "user@email.com",
role: "user",
})
const {getByText} = render(<Home />)
const element = getByText(/powered by blitz/i)
expect(element).toBeInTheDocument()
})

View File

@@ -25,8 +25,6 @@ const UserStuff = () => {
if (session.isLoading) return <div>Loading...</div>
console.log(session.views)
return (
<div>
{!session.userId && (
@@ -35,7 +33,7 @@ const UserStuff = () => {
<Link href="/signup">Sign Up</Link>
</div>
<div>
<Link href="/login">Log In</Link>
<Link href="/login">Login</Link>
</div>
<a href="/api/auth/twitter" style={{display: "block"}}>
Login with Twitter

View File

@@ -7,6 +7,8 @@ import {
PromiseReturnType,
ErrorComponent as ErrorPage,
useMutation,
AuthenticationError,
AuthorizationError,
} from "blitz"
import getUser from "app/users/queries/getUser"
import logout from "app/auth/mutations/logout"
@@ -42,10 +44,10 @@ export const getServerSideProps: GetServerSideProps<PageProps> = async ({req, re
res.statusCode = 404
res.end()
return {props: {}}
} else if (error.name === "AuthenticationError") {
} else if (error instanceof AuthenticationError) {
res.writeHead(302, {location: "/login"}).end()
return {props: {}}
} else if (error.name === "AuthorizationError") {
} else if (error instanceof AuthorizationError) {
return {
props: {
error: {

View File

@@ -0,0 +1,60 @@
import {Suspense} from "react"
import Layout from "app/layouts/Layout"
import {Link, usePaginatedQuery, useRouter, BlitzPage} from "blitz"
import getUsers from "app/users/queries/getUsers"
const ITEMS_PER_PAGE = 100
export const UsersList = () => {
const router = useRouter()
const page = Number(router.query.page) || 0
const [{users, hasMore}] = usePaginatedQuery(getUsers, {
orderBy: {id: "asc"},
skip: ITEMS_PER_PAGE * page,
take: ITEMS_PER_PAGE,
})
const goToPreviousPage = () => router.push({query: {page: page - 1}})
const goToNextPage = () => router.push({query: {page: page + 1}})
return (
<div>
<ul>
{users.map((user) => (
<li key={user.id}>
<Link href="/users/[userId]" as={`/users/${user.id}`}>
<a>{user.email}</a>
</Link>
</li>
))}
</ul>
<button disabled={page === 0} onClick={goToPreviousPage}>
Previous
</button>
<button disabled={!hasMore} onClick={goToNextPage}>
Next
</button>
</div>
)
}
const UsersPage: BlitzPage = () => {
return (
<div>
<p>
<Link href="/users/new">
<a>Create User</a>
</Link>
</p>
<Suspense fallback={<div>Loading...</div>}>
<UsersList />
</Suspense>
</div>
)
}
UsersPage.getLayout = (page) => <Layout>{page}</Layout>
export default UsersPage

View File

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

View File

@@ -1,15 +1,14 @@
import {Ctx, NotFoundError} from "blitz"
import db, {FindOneUserArgs} from "db"
import db, {Prisma} from "db"
type GetUserInput = {
where: FindOneUserArgs["where"]
where: Prisma.FindUniqueUserArgs["where"]
}
export default async function getUser({where}: GetUserInput, ctx: Ctx) {
ctx.session.authorize()
console.log(ctx.session.userId)
const user = await db.user.findOne({where})
const user = await db.user.findFirst({where})
if (!user) throw new NotFoundError(`User with id ${where.id} does not exist`)

View File

@@ -1,28 +1,26 @@
import {Ctx} from "blitz"
import db, {FindManyUserArgs} from "db"
type GetUsersInput = {
where?: FindManyUserArgs["where"]
orderBy?: FindManyUserArgs["orderBy"]
cursor?: FindManyUserArgs["cursor"]
take?: FindManyUserArgs["take"]
skip?: FindManyUserArgs["skip"]
}
type GetUsersInput = Pick<FindManyUserArgs, "where" | "orderBy" | "skip" | "take">
export default async function getUsers(
{where, orderBy, cursor, take, skip}: GetUsersInput,
ctx: Ctx,
) {
ctx.session.authorize(["admin", "user"])
export default async function getUsers({where, orderBy, skip = 0, take}: GetUsersInput, ctx: Ctx) {
ctx.session.authorize()
const users = await db.user.findMany({
where,
select: {id: true},
orderBy,
cursor,
take,
skip,
})
return users
const count = await db.user.count()
const hasMore = typeof take === "number" ? skip + take < count : false
const nextPage = hasMore ? {take, skip: skip + take!} : null
return {
users,
nextPage,
hasMore,
count,
}
}

View File

@@ -1,4 +1,4 @@
const {sessionMiddleware, unstable_simpleRolesIsAuthorized} = require("@blitzjs/server")
const {sessionMiddleware, simpleRolesIsAuthorized} = require("@blitzjs/server")
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
})
@@ -6,10 +6,16 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
module.exports = withBundleAnalyzer({
middleware: [
sessionMiddleware({
unstable_isAuthorized: unstable_simpleRolesIsAuthorized,
isAuthorized: simpleRolesIsAuthorized,
sessionExpiryMinutes: 4,
}),
],
log: {
level: "trace",
},
experimental: {
isomorphicResolverImports: true,
},
/*
webpack: (config, {buildId, dev, isServer, defaultLoaders, webpack}) => {
// Note: we provide webpack above so you should not `require` it

View File

@@ -1,5 +1,6 @@
{
"baseUrl": "http://localhost:3099",
"defaultCommandTimeout": 10000,
"video": false
"video": false,
"chromeWebSecurity": false
}

View File

@@ -11,7 +11,7 @@ describe("index page", () => {
})
it("goes to the login page", () => {
cy.contains("a", "Log In").click()
cy.contains("a", /login/i).click()
cy.location("pathname").should("equal", "/login")
})
@@ -30,11 +30,11 @@ describe("index page", () => {
cy.signup(user)
cy.contains("button", "Logout").click()
cy.contains("a", "Log In").click()
cy.contains("a", /login/i).click()
cy.contains("Email").find("input").type(user.email)
cy.contains("Password").find("input").type(user.password)
cy.contains("button", "Log In").click()
cy.contains("button", /login/i).click()
cy.location("pathname").should("equal", "/")
cy.contains("button", "Logout")
@@ -48,7 +48,7 @@ describe("index page", () => {
cy.contains("button", "Logout").click()
cy.location("pathname").should("equal", "/")
cy.contains("a", "Log In")
cy.contains("a", /login/i)
})
it("tracks anonymous sessions", () => {

View File

@@ -1,15 +1,7 @@
import {makeServerOnlyPrisma} from "blitz"
import {PrismaClient} from "@prisma/client"
const ServerOnlyPrisma = makeServerOnlyPrisma(PrismaClient)
export * from "@prisma/client"
let prisma: PrismaClient
if (process.env.NODE_ENV === "production") {
prisma = new PrismaClient()
} else {
// Ensure the prisma instance is re-used during hot-reloading
// Otherwise, a new client will be created on every reload
globalThis["prisma"] = globalThis["prisma"] || new PrismaClient()
prisma = globalThis["prisma"]
}
export default prisma
export default new ServerOnlyPrisma()

View File

@@ -1,82 +0,0 @@
# Migration `20200704211726`
This migration has been generated by Brandon Bayer at 7/4/2020, 9:17:26 PM.
You can check out the [state of the schema](./schema.prisma) after the migration.
## Database Steps
```sql
PRAGMA foreign_keys=OFF;
CREATE TABLE "quaint"."User" (
"createdAt" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP ,"email" TEXT NOT NULL ,"hashedPassword" TEXT NOT NULL ,"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"name" TEXT ,"role" TEXT NOT NULL ,"updatedAt" DATE NOT NULL )
CREATE TABLE "quaint"."Session" (
"antiCSRFToken" TEXT ,"createdAt" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP ,"expiresAt" DATE ,"handle" TEXT NOT NULL ,"hashedSessionToken" TEXT ,"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"privateData" TEXT ,"publicData" TEXT ,"updatedAt" DATE NOT NULL ,"userId" INTEGER ,FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE)
CREATE UNIQUE INDEX "quaint"."User.email" ON "User"("email")
CREATE UNIQUE INDEX "quaint"."Session.handle" ON "Session"("handle")
PRAGMA "quaint".foreign_key_check;
PRAGMA foreign_keys=ON;
```
## Changes
```diff
diff --git schema.prisma schema.prisma
migration ..20200704211726
--- datamodel.dml
+++ datamodel.dml
@@ -1,0 +1,46 @@
+// This is your Prisma schema file,
+// learn more about it in the docs: https://pris.ly/d/prisma-schema
+
+datasource sqlite {
+ provider = "sqlite"
+ url = "***"
+}
+
+// SQLite is easy to start with, but if you use Postgres in production
+// you should also use it in development with the following:
+//datasource postgresql {
+// provider = "postgresql"
+// url = "***"
+//}
+
+generator client {
+ provider = "prisma-client-js"
+}
+
+
+// --------------------------------------
+
+model User {
+ id Int @default(autoincrement()) @id
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ name String?
+ email String @unique
+ hashedPassword String
+ role String
+ sessions Session[]
+}
+
+model Session {
+ id Int @default(autoincrement()) @id
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ expiresAt DateTime?
+ handle String @unique
+ user User? @relation(fields: [userId], references: [id])
+ userId Int?
+ hashedSessionToken String?
+ antiCSRFToken String?
+ publicData String?
+ privateData String?
+}
```

View File

@@ -1,46 +0,0 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource sqlite {
provider = "sqlite"
url = "***"
}
// SQLite is easy to start with, but if you use Postgres in production
// you should also use it in development with the following:
//datasource postgresql {
// provider = "postgresql"
// url = "***"
//}
generator client {
provider = "prisma-client-js"
}
// --------------------------------------
model User {
id Int @default(autoincrement()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String?
email String @unique
hashedPassword String
role String
sessions Session[]
}
model Session {
id Int @default(autoincrement()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
expiresAt DateTime?
handle String @unique
user User? @relation(fields: [userId], references: [id])
userId Int?
hashedSessionToken String?
antiCSRFToken String?
publicData String?
privateData String?
}

View File

@@ -1,373 +0,0 @@
{
"version": "0.3.14-fixed",
"steps": [
{
"tag": "CreateSource",
"source": "sqlite"
},
{
"tag": "CreateArgument",
"location": {
"tag": "Source",
"source": "sqlite"
},
"argument": "provider",
"value": "\"sqlite\""
},
{
"tag": "CreateArgument",
"location": {
"tag": "Source",
"source": "sqlite"
},
"argument": "url",
"value": "\"file:./db.sqlite\""
},
{
"tag": "CreateModel",
"model": "User"
},
{
"tag": "CreateField",
"model": "User",
"field": "id",
"type": "Int",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "User",
"field": "id"
},
"directive": "default"
}
},
{
"tag": "CreateArgument",
"location": {
"tag": "Directive",
"path": {
"tag": "Field",
"model": "User",
"field": "id"
},
"directive": "default"
},
"argument": "",
"value": "autoincrement()"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "User",
"field": "id"
},
"directive": "id"
}
},
{
"tag": "CreateField",
"model": "User",
"field": "createdAt",
"type": "DateTime",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "User",
"field": "createdAt"
},
"directive": "default"
}
},
{
"tag": "CreateArgument",
"location": {
"tag": "Directive",
"path": {
"tag": "Field",
"model": "User",
"field": "createdAt"
},
"directive": "default"
},
"argument": "",
"value": "now()"
},
{
"tag": "CreateField",
"model": "User",
"field": "updatedAt",
"type": "DateTime",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "User",
"field": "updatedAt"
},
"directive": "updatedAt"
}
},
{
"tag": "CreateField",
"model": "User",
"field": "name",
"type": "String",
"arity": "Optional"
},
{
"tag": "CreateField",
"model": "User",
"field": "email",
"type": "String",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "User",
"field": "email"
},
"directive": "unique"
}
},
{
"tag": "CreateField",
"model": "User",
"field": "hashedPassword",
"type": "String",
"arity": "Required"
},
{
"tag": "CreateField",
"model": "User",
"field": "role",
"type": "String",
"arity": "Required"
},
{
"tag": "CreateField",
"model": "User",
"field": "sessions",
"type": "Session",
"arity": "List"
},
{
"tag": "CreateModel",
"model": "Session"
},
{
"tag": "CreateField",
"model": "Session",
"field": "id",
"type": "Int",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "Session",
"field": "id"
},
"directive": "default"
}
},
{
"tag": "CreateArgument",
"location": {
"tag": "Directive",
"path": {
"tag": "Field",
"model": "Session",
"field": "id"
},
"directive": "default"
},
"argument": "",
"value": "autoincrement()"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "Session",
"field": "id"
},
"directive": "id"
}
},
{
"tag": "CreateField",
"model": "Session",
"field": "createdAt",
"type": "DateTime",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "Session",
"field": "createdAt"
},
"directive": "default"
}
},
{
"tag": "CreateArgument",
"location": {
"tag": "Directive",
"path": {
"tag": "Field",
"model": "Session",
"field": "createdAt"
},
"directive": "default"
},
"argument": "",
"value": "now()"
},
{
"tag": "CreateField",
"model": "Session",
"field": "updatedAt",
"type": "DateTime",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "Session",
"field": "updatedAt"
},
"directive": "updatedAt"
}
},
{
"tag": "CreateField",
"model": "Session",
"field": "expiresAt",
"type": "DateTime",
"arity": "Optional"
},
{
"tag": "CreateField",
"model": "Session",
"field": "handle",
"type": "String",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "Session",
"field": "handle"
},
"directive": "unique"
}
},
{
"tag": "CreateField",
"model": "Session",
"field": "user",
"type": "User",
"arity": "Optional"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "Session",
"field": "user"
},
"directive": "relation"
}
},
{
"tag": "CreateArgument",
"location": {
"tag": "Directive",
"path": {
"tag": "Field",
"model": "Session",
"field": "user"
},
"directive": "relation"
},
"argument": "fields",
"value": "[userId]"
},
{
"tag": "CreateArgument",
"location": {
"tag": "Directive",
"path": {
"tag": "Field",
"model": "Session",
"field": "user"
},
"directive": "relation"
},
"argument": "references",
"value": "[id]"
},
{
"tag": "CreateField",
"model": "Session",
"field": "userId",
"type": "Int",
"arity": "Optional"
},
{
"tag": "CreateField",
"model": "Session",
"field": "hashedSessionToken",
"type": "String",
"arity": "Optional"
},
{
"tag": "CreateField",
"model": "Session",
"field": "antiCSRFToken",
"type": "String",
"arity": "Optional"
},
{
"tag": "CreateField",
"model": "Session",
"field": "publicData",
"type": "String",
"arity": "Optional"
},
{
"tag": "CreateField",
"model": "Session",
"field": "privateData",
"type": "String",
"arity": "Optional"
}
]
}

View File

@@ -1,66 +0,0 @@
# Migration `20200711145940`
This migration has been generated by Brandon Bayer at 7/11/2020, 2:59:40 PM.
You can check out the [state of the schema](./schema.prisma) after the migration.
## Database Steps
```sql
PRAGMA foreign_keys=OFF;
CREATE TABLE "quaint"."new_User" (
"createdAt" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP ,"email" TEXT NOT NULL ,"hashedPassword" TEXT ,"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"name" TEXT ,"role" TEXT NOT NULL DEFAULT 'user' ,"updatedAt" DATE NOT NULL )
INSERT INTO "quaint"."new_User" ("createdAt", "email", "hashedPassword", "id", "name", "role", "updatedAt") SELECT "createdAt", "email", "hashedPassword", "id", "name", "role", "updatedAt" FROM "quaint"."User"
PRAGMA foreign_keys=off;
DROP TABLE "quaint"."User";;
PRAGMA foreign_keys=on
ALTER TABLE "quaint"."new_User" RENAME TO "User";
CREATE UNIQUE INDEX "quaint"."User.email" ON "User"("email")
PRAGMA "quaint".foreign_key_check;
PRAGMA foreign_keys=ON;
```
## Changes
```diff
diff --git schema.prisma schema.prisma
migration 20200704211726..20200711145940
--- datamodel.dml
+++ datamodel.dml
@@ -2,16 +2,16 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource sqlite {
provider = "sqlite"
- url = "***"
+ url = "***"
}
// SQLite is easy to start with, but if you use Postgres in production
// you should also use it in development with the following:
//datasource postgresql {
// provider = "postgresql"
-// url = "***"
+// url = "***"
//}
generator client {
provider = "prisma-client-js"
@@ -25,10 +25,10 @@
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String?
email String @unique
- hashedPassword String
- role String
+ hashedPassword String?
+ role String @default("user")
sessions Session[]
}
model Session {
```

View File

@@ -1,46 +0,0 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource sqlite {
provider = "sqlite"
url = "***"
}
// SQLite is easy to start with, but if you use Postgres in production
// you should also use it in development with the following:
//datasource postgresql {
// provider = "postgresql"
// url = "***"
//}
generator client {
provider = "prisma-client-js"
}
// --------------------------------------
model User {
id Int @default(autoincrement()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String?
email String @unique
hashedPassword String?
role String @default("user")
sessions Session[]
}
model Session {
id Int @default(autoincrement()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
expiresAt DateTime?
handle String @unique
user User? @relation(fields: [userId], references: [id])
userId Int?
hashedSessionToken String?
antiCSRFToken String?
publicData String?
privateData String?
}

View File

@@ -1,36 +0,0 @@
{
"version": "0.3.14-fixed",
"steps": [
{
"tag": "UpdateField",
"model": "User",
"field": "hashedPassword",
"arity": "Optional"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "User",
"field": "role"
},
"directive": "default"
}
},
{
"tag": "CreateArgument",
"location": {
"tag": "Directive",
"path": {
"tag": "Field",
"model": "User",
"field": "role"
},
"directive": "default"
},
"argument": "",
"value": "\"user\""
}
]
}

View File

@@ -0,0 +1,32 @@
-- 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,
"userId" INTEGER,
"hashedSessionToken" TEXT,
"antiCSRFToken" TEXT,
"publicData" TEXT,
"privateData" TEXT,
FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "User.email_unique" ON "User"("email");
-- CreateIndex
CREATE UNIQUE INDEX "Session.handle_unique" ON "Session"("handle");

View File

@@ -1,4 +0,0 @@
# Prisma Migrate lockfile v1
20200704211726
20200711145940

View File

@@ -0,0 +1,6 @@
import db from "./index"
const seed = async () => {
const user = await db.user.create({data: {name: "FooBar", email: "hey@" + new Date().getTime()}})
console.log("Created user", user)
}
export default seed

View File

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

View File

@@ -1,20 +1,25 @@
{
"name": "@examples/auth",
"version": "0.24.0-canary.0",
"version": "0.29.2",
"scripts": {
"start": "blitz start",
"studio": "blitz db studio",
"studio": "blitz prisma studio",
"build": "blitz build",
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
"analyze": "cross-env ANALYZE=true blitz build",
"cy:open": "cypress open",
"cy:run": "cypress run",
"test:start": "blitz db migrate && blitz start --production -p 3099",
"test": "cross-env NODE_ENV=test start-server-and-test test:start http://localhost:3099 cy:run"
"test": "prisma generate && yarn test:jest && yarn test:e2e",
"test:jest": "jest",
"test:server": "blitz prisma migrate deploy --preview-feature && blitz build && blitz start --production -p 3099",
"test:e2e": "cross-env NODE_ENV=test start-server-and-test test:server http://localhost:3099 cy:run"
},
"browserslist": [
"defaults"
],
"prisma": {
"schema": "db/schema.prisma"
},
"prettier": {
"semi": false,
"printWidth": 100,
@@ -33,47 +38,37 @@
]
},
"dependencies": {
"@prisma/cli": "2.4.1",
"@prisma/client": "2.4.1",
"blitz": "0.24.0-canary.0",
"@prisma/cli": "2.14.0",
"@prisma/client": "2.14.0",
"blitz": "0.29.2",
"final-form": "4.20.1",
"passport-auth0": "1.3.3",
"passport-github2": "0.1.11",
"passport-auth0": "1.4.0",
"passport-github2": "0.1.12",
"passport-twitter": "1.0.4",
"react": "0.0.0-experimental-7f28234f8",
"react-dom": "0.0.0-experimental-7f28234f8",
"react-error-boundary": "2.3.1",
"react-final-form": "6.5.1",
"secure-password": "4.0.0",
"zod": "1.10.0"
"react": "0.0.0-experimental-3310209d0",
"react-dom": "0.0.0-experimental-3310209d0",
"react-error-boundary": "3.1.0",
"react-final-form": "6.5.2",
"zod": "1.11.11"
},
"devDependencies": {
"@cypress/skip-test": "2.5.0",
"@cypress/skip-test": "2.5.1",
"@next/bundle-analyzer": "latest",
"@testing-library/react": "11.2.3",
"@testing-library/react-hooks": "4.0.1",
"@types/passport-auth0": "1.0.4",
"@types/passport-github2": "1.2.4",
"@types/passport-twitter": "1.0.36",
"@types/react": "16.9.38",
"@types/secure-password": "3.1.0",
"@typescript-eslint/eslint-plugin": "2.34.1-alpha.2",
"@typescript-eslint/parser": "2.34.1-alpha.2",
"babel-eslint": "10.1.0",
"cross-env": "latest",
"cypress": "4.11.0",
"eslint": "7.6.0",
"eslint-config-react-app": "5.2.1",
"eslint-plugin-cypress": "2.11.1",
"eslint-plugin-flowtype": "5.2.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jsx-a11y": "6.3.1",
"eslint-plugin-react": "7.20.5",
"eslint-plugin-react-hooks": "4.0.8",
"husky": "4.2.5",
"lint-staged": "10.2.13",
"prettier": "2.0.5",
"pretty-quick": "2.0.1",
"start-server-and-test": "1.11.2",
"typescript": "3.9.5"
"@types/react": "17.0.0",
"cross-env": "7.0.3",
"cypress": "6.2.1",
"eslint": "7.17.0",
"husky": "4.3.7",
"lint-staged": "10.5.3",
"prettier": "2.2.1",
"pretty-quick": "3.1.0",
"start-server-and-test": "1.11.7",
"typescript": "4.1.3"
},
"private": true
}

View File

@@ -0,0 +1,2 @@
// This is the jest 'setupFilesAfterEnv' setup file
// It's a good place to set globals, add global before/after hooks, etc

View File

@@ -0,0 +1,89 @@
import {RouterContext, BlitzRouter} 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.
// --------------------------------------------------------------------------------
type DefaultParams = Parameters<typeof defaultRender>
type RenderUI = DefaultParams[0]
type RenderOptions = DefaultParams[1] & {router?: Partial<BlitzRouter>}
type DefaultHookParams = Parameters<typeof defaultRenderHook>
type RenderHook = DefaultHookParams[0]
type RenderHookOptions = DefaultHookParams[1] & {router?: Partial<BlitzRouter>}
// --------------------------------------------------
// 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, ...options}: RenderOptions = {}) {
if (!wrapper) {
// Add a default context wrapper if one isn't supplied from the test
wrapper = ({children}) => (
<RouterContext.Provider value={{...mockRouter, ...router}}>{children}</RouterContext.Provider>
)
}
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, ...options}: RenderHookOptions = {},
) {
if (!wrapper) {
// Add a default context wrapper if one isn't supplied from the test
wrapper = ({children}) => (
<RouterContext.Provider value={{...mockRouter, ...router}}>{children}</RouterContext.Provider>
)
}
return defaultRenderHook(hook, {wrapper, ...options})
}
export const mockRouter: BlitzRouter = {
basePath: "",
pathname: "/",
route: "/",
asPath: "/",
params: {},
query: {},
isReady: true,
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,
}

View File

@@ -0,0 +1,2 @@
# This env file should be checked into source control
# This is the place for default values that should be used in all environments

View File

@@ -0,0 +1 @@
SESSION_SECRET_KEY=A4B979A108440A218DE8F11CBB13A7B0

View File

@@ -0,0 +1,14 @@
module.exports = {
parser: "@typescript-eslint/parser",
env: {
es2020: true,
},
extends: ["react-app", "plugin:jsx-a11y/recommended"],
plugins: ["@typescript-eslint", "jsx-a11y"],
rules: {
"import/no-anonymous-default-export": "error",
"import/no-webpack-loader-syntax": "off",
"react/react-in-jsx-scope": "off", // React is always in scope with Blitz
"jsx-a11y/anchor-is-valid": "off", //Doesn't play well with Blitz/Next <Link> usage
},
}

View File

@@ -13,17 +13,15 @@ web_modules/
*.sqlite
.now
.blitz-console-history
blitz-log.log
# misc
.DS_Store
# local env files
.env
.envrc
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.*.local
.envrc
# Logs
logs
@@ -36,7 +34,7 @@ pids
*.pid.lock
# Testing
coverage
.coverage
*.lcov
.nyc_output
lib-cov
@@ -52,3 +50,6 @@ lib-cov
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# Custom build
build

View File

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

View File

@@ -0,0 +1,29 @@
# custom-server
## Development
1. Install
```sh
yarn
```
2. Migrate
```sh
blitz prisma migrate dev --preview-feature
```
3. Start the dev server
```sh
blitz start
// Or if you want hot-reloading of server.js, use:
yarn start
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## Production
```sh
blitz build
blitz start --production
```

View File

@@ -0,0 +1,50 @@
import React from "react"
import { AuthenticationError, Link, useMutation } from "blitz"
import { LabeledTextField } from "app/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/components/Form"
import login from "app/auth/mutations/login"
import { LoginInput } from "app/auth/validations"
type LoginFormProps = {
onSuccess?: () => void
}
export const LoginForm = (props: LoginFormProps) => {
const [loginMutation] = useMutation(login)
return (
<div>
<h1>Login</h1>
<Form
submitText="Login"
schema={LoginInput}
initialValues={{ email: "", password: "" }}
onSubmit={async (values) => {
try {
await loginMutation(values)
props.onSuccess?.()
} catch (error) {
if (error instanceof AuthenticationError) {
return { [FORM_ERROR]: "Sorry, those credentials are invalid" }
} else {
return {
[FORM_ERROR]:
"Sorry, we had an unexpected error. Please try again. - " + error.toString(),
}
}
}
}}
>
<LabeledTextField name="email" label="Email" placeholder="Email" />
<LabeledTextField name="password" label="Password" placeholder="Password" type="password" />
</Form>
<div style={{ marginTop: "1rem" }}>
Or <Link href="/signup">Sign Up</Link>
</div>
</div>
)
}
export default LoginForm

View File

@@ -0,0 +1,44 @@
import React from "react"
import { useMutation } from "blitz"
import { LabeledTextField } from "app/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/components/Form"
import signup from "app/auth/mutations/signup"
import { SignupInput } 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={SignupInput}
initialValues={{ email: "", password: "" }}
onSubmit={async (values) => {
try {
await signupMutation(values)
props.onSuccess?.()
} catch (error) {
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,15 @@
import { Ctx } from "blitz"
import { authenticateUser } from "app/auth/auth-utils"
import { LoginInput, LoginInputType } from "../validations"
export default async function login(input: LoginInputType, { session }: Ctx) {
// This throws an error if input is invalid
const { email, password } = LoginInput.parse(input)
// This throws an error if credentials are invalid
const user = await authenticateUser(email, password)
await session.create({ userId: user.id, roles: [user.role] })
return user
}

View File

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

View File

@@ -0,0 +1,19 @@
import { Ctx } from "blitz"
import db from "db"
import { hashPassword } from "app/auth/auth-utils"
import { SignupInput, SignupInputType } from "app/auth/validations"
export default async function signup(input: SignupInputType, { session }: Ctx) {
// This throws an error if input is invalid
const { email, password } = SignupInput.parse(input)
const hashedPassword = await hashPassword(password)
const user = await db.user.create({
data: { email: email.toLowerCase(), hashedPassword, role: "user" },
select: { id: true, name: true, email: true, role: true },
})
await session.create({ userId: user.id, roles: [user.role] })
return user
}

View File

@@ -0,0 +1,18 @@
import React from "react"
import { useRouter, BlitzPage } from "blitz"
import Layout from "app/layouts/Layout"
import { LoginForm } from "app/auth/components/LoginForm"
const LoginPage: BlitzPage = () => {
const router = useRouter()
return (
<div>
<LoginForm onSuccess={() => router.push("/")} />
</div>
)
}
LoginPage.getLayout = (page) => <Layout title="Log In">{page}</Layout>
export default LoginPage

View File

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

View File

@@ -0,0 +1,62 @@
import React, { ReactNode, PropsWithoutRef } from "react"
import { Form as FinalForm, FormProps as FinalFormProps } from "react-final-form"
import * as z from "zod"
export { FORM_ERROR } from "final-form"
type FormProps<S extends z.ZodType<any, any>> = {
/** 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"]
} & Omit<PropsWithoutRef<JSX.IntrinsicElements["form"]>, "onSubmit">
export function Form<S extends z.ZodType<any, any>>({
children,
submitText,
schema,
initialValues,
onSubmit,
...props
}: FormProps<S>) {
return (
<FinalForm
initialValues={initialValues}
validate={(values) => {
if (!schema) return
try {
schema.parse(values)
} catch (error) {
return error.formErrors.fieldErrors
}
}}
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>
)}
<button type="submit" disabled={submitting}>
{submitText}
</button>
<style global jsx>{`
.form > * + * {
margin-top: 1rem;
}
`}</style>
</form>
)}
/>
)
}
export default Form

View File

@@ -0,0 +1,57 @@
import React, { PropsWithoutRef } from "react"
import { useField } 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"]>
}
export const LabeledTextField = React.forwardRef<HTMLInputElement, LabeledTextFieldProps>(
({ name, label, outerProps, ...props }, ref) => {
const {
input,
meta: { touched, error, submitError, submitting },
} = useField(name)
const normalizedError = Array.isArray(error) ? error.join(", ") : error || submitError
return (
<div {...outerProps}>
<label>
{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,22 @@
import { ReactNode } from "react"
import { Head } from "blitz"
type LayoutProps = {
title?: string
children: ReactNode
}
const Layout = ({ title, children }: LayoutProps) => {
return (
<>
<Head>
<title>{title || "custom-server"}</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, ErrorComponent, useRouter, AuthenticationError, AuthorizationError } from "blitz"
import { ErrorBoundary, FallbackProps } from "react-error-boundary"
import { queryCache } from "react-query"
import LoginForm from "app/auth/components/LoginForm"
export default function App({ Component, pageProps }: AppProps) {
const getLayout = Component.getLayout || ((page) => page)
const router = useRouter()
return (
<ErrorBoundary
FallbackComponent={RootErrorFallback}
resetKeys={[router.asPath]}
onReset={() => {
// This ensures the Blitz useQuery hooks will automatically refetch
// data any time you reset the error boundary
queryCache.resetErrorBoundaries()
}}
>
{getLayout(<Component {...pageProps} />)}
</ErrorBoundary>
)
}
function RootErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
if (error instanceof AuthenticationError) {
return <LoginForm onSuccess={resetErrorBoundary} />
} else if (error instanceof AuthorizationError) {
return (
<ErrorComponent
statusCode={(error as any).statusCode}
title="Sorry, you are not authorized to access this"
/>
)
} else {
return (
<ErrorComponent
statusCode={(error as any)?.statusCode || 400}
title={error?.message || error?.name}
/>
)
}
}

View File

@@ -1,4 +1,4 @@
import {Document, Html, DocumentHead, Main, BlitzScript /*DocumentContext*/} from "@blitzjs/core"
import { Document, Html, DocumentHead, Main, BlitzScript /*DocumentContext*/ } from "blitz"
class MyDocument extends Document {
// Only uncomment if you need to customize this behaviour

View File

@@ -0,0 +1,26 @@
import React from "react"
import { render } from "test/utils"
import Home from "./index"
import { useCurrentUser } from "app/hooks/useCurrentUser"
jest.mock("app/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,272 @@
import {Link, BlitzPage, useMutation} 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"
/*
* 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)
if (currentUser) {
return (
<>
<button
className="button small"
onClick={async () => {
await logoutMutation()
}}
>
Logout
</button>
<div>
User id: <code>{currentUser.id}</code>
<br />
User role: <code>{currentUser.role}</code>
</div>
</>
)
} else {
return (
<>
<Link href="/signup">
<a className="button small">
<strong>Sign Up</strong>
</a>
</Link>
<Link href="/login">
<a className="button small">
<strong>Login</strong>
</a>
</Link>
</>
)
}
}
const Home: BlitzPage = () => {
return (
<div className="container">
<main>
<div className="logo">
<img src="/logo.png" alt="blitz.js" />
</div>
<p>
<strong>Congrats!</strong> Your app is ready, including user sign-up and log-in.
</p>
<div className="buttons" style={{marginTop: "1rem", marginBottom: "1rem"}}>
<Suspense fallback="Loading...">
<UserInfo />
</Suspense>
</div>
<p>
<strong>
To add a new model to your app, <br />
run the following in your terminal:
</strong>
</p>
<pre>
<code>blitz generate all project name:string</code>
</pre>
<pre>
<code>blitz prisma migrate dev --preview-feature</code>
</pre>
<div>
<p>
Then <strong>restart the server</strong>
</p>
<pre>
<code>Ctrl + c</code>
</pre>
<pre>
<code>blitz start</code>
</pre>
<p>
and go to{" "}
<Link href="/projects">
<a>/projects</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"
>
Documentation
</a>
<a
className="button-outline"
href="https://github.com/blitz-js/blitz"
target="_blank"
rel="noopener noreferrer"
>
Github Repo
</a>
<a
className="button-outline"
href="https://slack.blitzjs.com"
target="_blank"
rel="noopener noreferrer"
>
Slack Community
</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"
>
Powered by Blitz.js
</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.getLayout = (page) => <Layout title="Home">{page}</Layout>
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.findOne({
where: { id: session.userId },
select: { id: true, name: true, email: true, role: true },
})
return user
}

View File

@@ -0,0 +1,17 @@
const { sessionMiddleware, simpleRolesIsAuthorized } = require("@blitzjs/server")
module.exports = {
middleware: [
sessionMiddleware({
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
},
*/
}

View File

@@ -0,0 +1,6 @@
{
"baseUrl": "http://localhost:3099",
"defaultCommandTimeout": 10000,
"video": false,
"chromeWebSecurity": false
}

View File

@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View File

@@ -0,0 +1,8 @@
/// <reference types="Cypress" />
/// <reference types="@cypress/skip-test" />
declare namespace Cypress {
interface Chainable {
signup(user: { email: string; password: string }): void
}
}

View File

@@ -0,0 +1,55 @@
import { createRandomUser } from "../support/helpers"
describe("index page", () => {
beforeEach(() => {
cy.visit("/")
})
it("goes to the signup page", () => {
cy.contains("a", "Sign Up").click()
cy.location("pathname").should("equal", "/signup")
})
it("goes to the login page", () => {
cy.contains("a", /login/i).click()
cy.location("pathname").should("equal", "/login")
})
it("allows the user to signup", () => {
const user = createRandomUser()
cy.signup(user)
cy.location("pathname").should("equal", "/")
cy.contains("button", "Logout")
})
it("allows the user to log in", () => {
const user = createRandomUser()
cy.signup(user)
cy.contains("button", "Logout").click()
cy.contains("a", /login/i).click()
cy.contains("Email").find("input").type(user.email)
cy.contains("Password").find("input").type(user.password)
cy.contains("button", /login/i).click()
cy.location("pathname").should("equal", "/")
cy.contains("button", "Logout")
})
it("allows the user to logout", () => {
const user = createRandomUser()
cy.signup(user)
cy.contains("button", "Logout").click()
cy.location("pathname").should("equal", "/")
cy.contains("a", /login/i)
})
})
export {}

View File

@@ -0,0 +1,22 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
/**
* @type {Cypress.PluginConfig}
*/
//@ts-ignore
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}

View File

@@ -0,0 +1,19 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
Cypress.Commands.add("signup", ({ email, password }) => {
cy.contains("a", "Sign Up").click()
cy.contains("Email").find("input").type(email)
cy.contains("Password").find("input").type(password)
cy.contains("button", "Create Account").click()
})

View File

@@ -0,0 +1,7 @@
export const createRandomUser = () => {
const random = Math.round(Math.random() * 100000).toString()
const email = `test_${random}@example.com`
const password = `password_${random}`
return { email, password }
}

View File

@@ -0,0 +1,26 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import "./commands"
// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress.Screenshot.defaults({
screenshotOnRunFailure: false,
})
require("@cypress/skip-test/support")

View File

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

View File

@@ -0,0 +1,32 @@
-- 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,
"userId" INTEGER,
"hashedSessionToken" TEXT,
"antiCSRFToken" TEXT,
"publicData" TEXT,
"privateData" TEXT,
FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "User.email_unique" ON "User"("email");
-- CreateIndex
CREATE UNIQUE INDEX "Session.handle_unique" ON "Session"("handle");

View File

@@ -0,0 +1,38 @@
// 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 @default(autoincrement()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String?
email String @unique
hashedPassword String?
role String @default("user")
sessions Session[]
}
model Session {
id Int @default(autoincrement()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
expiresAt DateTime?
handle String @unique
user User? @relation(fields: [userId], references: [id])
userId Int?
hashedSessionToken String?
antiCSRFToken String?
publicData String?
privateData String?
}

View File

@@ -0,0 +1,16 @@
// 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
* or https://github.com/Marak/Faker.js 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,3 @@
module.exports = {
preset: "blitz",
}

View File

@@ -0,0 +1,88 @@
{
"name": "@examples/custom-server",
"version": "0.29.2",
"scripts": {
"start": "nodemon --watch server.js --exec 'blitz start'",
"build": "blitz build",
"studio": "blitz prisma studio",
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
"test-watch": "jest --watch",
"cy-open": "cypress open",
"cy-run": "cypress run",
"test:migrate": "prisma generate && blitz prisma migrate deploy --preview-feature",
"test:jest": "jest",
"test-server": "blitz build && blitz start --production",
"test:e2e": "cross-env NODE_ENV=test PORT=3099 start-server-and-test test-server http://localhost:3099 cy-run",
"test": "run-s test:*"
},
"browserslist": [
"defaults"
],
"prisma": {
"schema": "db/schema.prisma"
},
"prettier": {
"semi": false,
"printWidth": 100,
"bracketSpacing": false,
"trailingComma": "all"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && pretty-quick --staged",
"pre-push": "tsc && npm run lint && npm run test"
}
},
"lint-staged": {
"*.{js,ts,tsx}": [
"eslint --fix"
]
},
"dependencies": {
"@prisma/cli": "2.14.0",
"@prisma/client": "2.14.0",
"blitz": "0.29.2",
"final-form": "4.20.1",
"react": "0.0.0-experimental-4ead6b530",
"react-dom": "0.0.0-experimental-4ead6b530",
"react-error-boundary": "2.3.2",
"react-final-form": "6.5.2",
"secure-password": "4.0.0",
"typescript": "4.1.3",
"zod": "1.11.11"
},
"devDependencies": {
"@cypress/skip-test": "2.5.0",
"@testing-library/jest-dom": "5.11.6",
"@testing-library/react": "11.2.3",
"@testing-library/react-hooks": "4.0.1",
"@types/jest": "26.0.20",
"@types/react": "16.14.1",
"@types/secure-password": "3.1.0",
"@typescript-eslint/eslint-plugin": "4.12.0",
"@typescript-eslint/parser": "4.12.0",
"babel-eslint": "10.1.0",
"cypress": "6.2.1",
"eslint": "7.17.0",
"eslint-config-react-app": "5.2.1",
"eslint-plugin-cypress": "2.11.1",
"eslint-plugin-flowtype": "5.2.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react-hooks": "4.2.0",
"husky": "4.3.7",
"jest": "26.6.3",
"jest-environment-jsdom-fourteen": "1.0.1",
"jest-watch-typeahead": "0.6.1",
"lint-staged": "10.5.1",
"nodemon": "2.0.7",
"npm-run-all": "4.1.5",
"prettier": "2.2.0",
"pretty-quick": "3.1.0",
"react-test-renderer": "16.14.0",
"start-server-and-test": "1.11.2",
"ts-jest": "26.4.4"
},
"private": true
}

View File

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,25 @@
const { createServer } = require("http")
const { parse } = require("url")
const blitz = require("@blitzjs/server")
const { log } = require("@blitzjs/display")
const { PORT = "3000" } = process.env
const dev = process.env.NODE_ENV !== "production"
const app = blitz({ dev })
const handle = app.getRequestHandler()
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
const { pathname } = parsedUrl
if (pathname === "/hello") {
res.writeHead(200).end("world")
return
}
handle(req, res, parsedUrl)
}).listen(PORT, () => {
log.success(`Ready on http://localhost:${PORT}`)
})
})

View File

@@ -0,0 +1,2 @@
// This is the jest 'setupFilesAfterEnv' setup file
// It's a good place to set globals, add global before/after hooks, etc

View File

@@ -0,0 +1,94 @@
import React from "react"
import { RouterContext, BlitzRouter } 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, ...options }: RenderOptions = {}) {
if (!wrapper) {
// Add a default context wrapper if one isn't supplied from the test
wrapper = ({ children }) => (
<RouterContext.Provider value={{ ...mockRouter, ...router }}>
{children}
</RouterContext.Provider>
)
}
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, ...options }: RenderHookOptions = {}
) {
if (!wrapper) {
// Add a default context wrapper if one isn't supplied from the test
wrapper = ({ children }) => (
<RouterContext.Provider value={{ ...mockRouter, ...router }}>
{children}
</RouterContext.Provider>
)
}
return defaultRenderHook(hook, { wrapper, ...options })
}
export const mockRouter: BlitzRouter = {
basePath: "",
pathname: "/",
route: "/",
asPath: "/",
params: {},
query: {},
isReady: true,
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> }
type DefaultHookParams = Parameters<typeof defaultRenderHook>
type RenderHook = DefaultHookParams[0]
type RenderHookOptions = DefaultHookParams[1] & { router?: Partial<BlitzRouter> }

View File

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

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