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

Compare commits

...

34 Commits

Author SHA1 Message Date
github-actions[bot]
474b5494ac Version Packages (beta) (#3977)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-22 16:09:29 -05:00
Dillon Raphael
b33db08286 Ensure superjson registers error classes once (#3982)
* bump superjson version & ensure superjson register

* update changeset & use error name as property for check if class has been registered

* refactor
2022-11-22 16:04:42 -05:00
Brandon Bayer
c1e0040639 transpile packages to es2015 to support older browsers (#3983) 2022-11-22 13:39:11 -05:00
Blitz.js Bot
5a7e6e0bb8 (meta) updated @medihack contributions 2022-11-21 14:30:17 -05:00
Kai Schlamp
a6f32d1d0b Export enhancePrisma for client again (#3965)
* Export enhancePrisma for client again
2022-11-21 14:30:11 -05:00
Selçuk Fatih Sevinç
c126b8191b Fix builder execute command hangs up (#3958)
* fix: builder execute command hangs up

* using "blitz install" inside recipe with addRunCommandStep causes hangs up

Co-authored-by: Selçuk Fatih Sevinç <selcuk@hub.studio>
2022-11-21 10:20:46 -05:00
Blitz.js Bot
775004f23e (meta) added @selcukfatihsevinc as contributor 2022-11-21 09:43:43 -05:00
Selçuk Fatih Sevinç
696f48c4e8 some providers need extra attributes, update for wrapAppWithProvider (#3959)
Co-authored-by: Dillon Raphael <dillon@creatorsneverdie.com>
2022-11-21 09:43:36 -05:00
Paul
942536d9ad Extend paginate.ts to support more complex pagination object (#3970)
* Extend paginate.ts to support more complex pagination object

* change pagination object based on reviewer suggestion

* changest inclusion

* update paginate test

Co-authored-by: Paul Moss <paulmoss06@gmail.com>
2022-11-18 09:50:10 -05:00
Brandon Bayer
b493c93f8b fix resolverPath:root and make it work with monorepo resolvers (#3978) 2022-11-17 21:47:17 -05:00
Dillon Raphael
b80c3d92ca Fix form paths when running blitz generate all (#3961)
* Update form paths when running blitz generate all

* pnpmlock & update changeset

* Update changeset

* pnpmlock

* update playwright
2022-11-17 17:41:11 -05:00
github-actions[bot]
4c0024c468 Version Packages (beta) (#3967)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-16 18:56:59 -05:00
Brandon Bayer
72a4e594ae internal: remove unneeded useSession from useQuery hooks (#3968) 2022-11-14 18:00:20 -05:00
Blitz.js Bot
62212bcc78 (meta) added @paulm17 as contributor 2022-11-14 14:51:47 -05:00
Paul
ed2b0e22c5 Add feature for resolvers to exist outside of Blitz root (#3953)
Co-authored-by: Paul Moss <paulmoss06@gmail.com>
Co-authored-by: Brandon Bayer <b@bayer.ws>
Co-authored-by: Dillon Raphael <dillon@creatorsneverdie.com>
2022-11-14 14:51:42 -05:00
Blitz.js Bot
d250346d8b (meta) updated @tmcw contributions 2022-11-14 14:23:27 -05:00
Tom MacWright
c0a3b1ee36 Fix runaway mutability bug in httpMethod (#3963)
Co-authored-by: Brandon Bayer <b@bayer.ws>
Closes https://github.com/blitz-js/blitz/issues/3962
2022-11-14 14:23:22 -05:00
Brandon Bayer
aaed9caa82 CI - upgrade pnpm version (#3966) 2022-11-14 14:14:16 -05:00
Brandon Bayer
0020db295d Revert "try fix"
This reverts commit 9fd032106e.
2022-11-14 13:00:59 -05:00
Brandon Bayer
9fd032106e try fix 2022-11-14 13:00:35 -05:00
github-actions[bot]
936211a657 Version Packages (beta) (#3955)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-09 15:22:38 -05:00
Siddharth Suresh
97469a1265 Page authenticate role (#3902) 2022-11-09 14:57:02 -05:00
Aleksandra
8b4bf999ce Update deps (#3957) 2022-11-09 14:11:28 -05:00
Dillon Raphael
5ea068b28b Check location for blitz-server & blitz-client in blitz installer path utils (#3942)
* Check if blitz-server & blitz-client exists in app or src directory in the path utils for blitz recipes
2022-11-09 10:25:08 -05:00
Dillon Raphael
88caa18e61 patch next13 for suspense error (#3956) 2022-11-08 13:33:00 -05:00
Dillon Raphael
2a81af7b78 Update templates & generator to use src directory (#3947)
* update templates & generator to use src directory

* changeset

* fix imports for toolkit-app-passportjs example
2022-11-08 08:34:36 -05:00
Dillon Raphael
916692db74 update README 2022-11-04 20:06:53 -04:00
github-actions[bot]
0959a11fc6 Version Packages (beta) (#3930)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-04 15:52:57 -04:00
Siddharth Suresh
4545912936 Include resolvers in src in blitz console (#3933)
* optimse only-db flag and add src directory to find resolvers in console

* default parameter
2022-11-04 12:32:45 -04:00
Brandon Bayer
55a43ce1f8 maybe fix anon session CSRF issue + add ability to customize anon session expiry time (#3945)
* maybe fix anon session CSRF issue + add ability to customize anon session expiry time
2022-11-04 12:12:15 -04:00
Aleksandra
1569bd53e0 Upgrade tslog to latest version (#3946)
* Upgrade tslog to latest version
2022-11-04 11:59:13 -04:00
Siddharth Suresh
8e5903c0fa Fix cannot find module db error in JavaScript template (#3940)
* use AST to parse the config and allow blitz server to be in `src`
2022-11-02 09:22:49 -04:00
Brandon Bayer
11b548edee make logger optional (will default to BlitzLogger) (#3939)
* make logger optional (will default to BlitzLogger)
2022-11-01 15:28:57 -04:00
Siddharth Suresh
ceb7db274f Add GET support to RPC specification (#3891) 2022-10-29 17:10:27 -04:00
280 changed files with 4182 additions and 2742 deletions

View File

@@ -2314,7 +2314,9 @@
"avatar_url": "https://avatars.githubusercontent.com/u/32314?v=4",
"profile": "https://macwright.com/",
"contributions": [
"doc"
"doc",
"test",
"code"
]
},
{
@@ -2911,7 +2913,8 @@
"avatar_url": "https://avatars.githubusercontent.com/u/120626?v=4",
"profile": "https://github.com/medihack",
"contributions": [
"doc"
"doc",
"code"
]
},
{
@@ -3742,6 +3745,27 @@
"contributions": [
"doc"
]
},
{
"login": "paulm17",
"name": "Paul",
"avatar_url": "https://avatars.githubusercontent.com/u/387463?v=4",
"profile": "https://github.com/paulm17",
"contributions": [
"doc",
"code",
"test"
]
},
{
"login": "selcukfatihsevinc",
"name": "Selçuk Fatih Sevinç",
"avatar_url": "https://avatars.githubusercontent.com/u/384836?v=4",
"profile": "https://github.com/selcukfatihsevinc",
"contributions": [
"doc",
"code"
]
}
],
"contributorsPerLine": 7,

View File

@@ -0,0 +1,6 @@
---
"blitz": patch
"@blitzjs/generator": patch
---
Upgrade `tslog` to the latest version

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": minor
---
internal: remove unneeed useSession from useQuery hooks

View File

@@ -0,0 +1,8 @@
---
"blitz": minor
"@blitzjs/auth": minor
"@blitzjs/next": minor
"@blitzjs/rpc": minor
---
transpile packages to es2015 to support older browsers

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
Update generator templates to use the src directory instead of app

View File

@@ -0,0 +1,5 @@
---
"blitz": minor
---
some providers need extra attributes, update for wrapAppWithProvider

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Check if blitz-server & blitz-client is located in either the app or src directory and return the correct path for blitz recipes.

View File

@@ -0,0 +1,9 @@
---
"blitz": patch
"@blitzjs/auth": patch
"@blitzjs/next": patch
"@blitzjs/rpc": patch
"@blitzjs/generator": patch
---
Update dependencies

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---
Fix form paths when running blitz generate all

View File

@@ -0,0 +1,6 @@
---
"@blitzjs/auth": minor
"@blitzjs/rpc": minor
---
maybe fix anon session CSRF issue + add ability to customize anon session expiry time

View File

@@ -0,0 +1,7 @@
---
"blitz": patch
"@blitzjs/rpc": patch
---
Add an opt-in GET request support to RPC specification by exporting a `config` object that has the `httpMethod` property.
from `query` files.

View File

@@ -0,0 +1,6 @@
---
"blitz": patch
"@blitzjs/generator": patch
---
Fix `cannot find module db error` in JavaScript template. Replace requiring the config using `esbuild` with parsing using `jscodeshift` to get the `cliConfig` values. Added logic to find the `blitz-server` file in `src` directory

View File

@@ -0,0 +1,5 @@
---
"blitz": major
---
update paginate.ts, return more params for more complex pagination control

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Export enhancePrisma for client again (Fixes #3964)

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": minor
---
Change setupBlitzServer logger config to be optional. Will default to BlitzLogger

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": patch
---
Add ability to put your query and mutation resolvers in a separate monorepo folder, allowing you to use them in multiple apps.

View File

@@ -44,18 +44,22 @@
"@blitzjs/recipe-styled-components": "0.34.0-canary.0",
"@blitzjs/recipe-tailwind": "0.34.0-canary.0",
"@blitzjs/recipe-theme-ui": "0.34.0-canary.0",
"@blitzjs/recipe-vanilla-extract": "0.34.0-canary.0"
"@blitzjs/recipe-vanilla-extract": "0.34.0-canary.0",
"test-rpc-path-root": "0.0.0"
},
"changesets": [
"afraid-dancers-juggle",
"afraid-ears-repair",
"big-phones-bow",
"blue-flowers-peel",
"blue-pigs-tan",
"brave-zebras-deny",
"breezy-bees-beg",
"breezy-cameras-double",
"breezy-moose-behave",
"bright-mangos-run",
"brown-avocados-wink",
"calm-books-push",
"calm-carpets-deny",
"calm-horses-tie",
"calm-nails-wait",
@@ -85,8 +89,10 @@
"fair-wombats-sneeze",
"famous-kings-explain",
"fast-clocks-push",
"fast-papayas-grow",
"fast-trainers-kneel",
"few-dogs-fetch",
"few-hounds-worry",
"few-shrimps-leave",
"flat-bees-approve",
"fluffy-mangos-begin",
@@ -95,11 +101,14 @@
"four-brooms-juggle",
"four-meals-fry",
"four-sheep-judge",
"funny-cups-pay",
"fuzzy-bees-warn",
"fuzzy-dots-cross",
"fuzzy-jars-admire",
"gentle-dogs-reply",
"gentle-lions-explode",
"giant-mails-tap",
"giant-students-carry",
"gold-horses-punch",
"good-apes-drum",
"good-insects-wink",
@@ -117,6 +126,7 @@
"healthy-rice-shout",
"heavy-apes-judge",
"heavy-cobras-own",
"heavy-students-buy",
"hip-buttons-dance",
"honest-candles-yawn",
"honest-cherries-push",
@@ -125,6 +135,7 @@
"hot-drinks-approve",
"hungry-baboons-swim",
"hungry-pens-collect",
"itchy-cups-double",
"itchy-houses-marry",
"itchy-spoons-tan",
"khaki-ducks-cheer",
@@ -135,9 +146,11 @@
"lemon-pillows-switch",
"lemon-seas-push",
"light-donkeys-double",
"light-squids-draw",
"little-pears-ring",
"long-bees-hope",
"long-dancers-jog",
"long-hounds-melt",
"long-lobsters-drop",
"lovely-berries-sell",
"lovely-colts-share",
@@ -146,6 +159,7 @@
"lucky-years-turn",
"mean-gorillas-reply",
"modern-cameras-pull",
"modern-games-dream",
"modern-ligers-behave",
"moody-bags-walk",
"moody-spoons-rhyme",
@@ -162,7 +176,9 @@
"ninety-lies-press",
"ninety-pets-heal",
"ninety-rice-tickle",
"odd-bears-run",
"olive-bees-buy",
"olive-dragons-drum",
"olive-feet-rhyme",
"olive-kings-invent",
"olive-sheep-rhyme",
@@ -181,19 +197,23 @@
"purple-donkeys-smash",
"purple-singers-greet",
"quick-cycles-confess",
"quick-dots-fetch",
"quiet-feet-travel",
"quiet-pans-hunt",
"quiet-sloths-rule",
"rare-crews-sleep",
"red-badgers-retire",
"red-gorillas-marry",
"rich-chairs-invent",
"rich-queens-travel",
"rotten-rocks-remember",
"serious-mugs-leave",
"shaggy-carpets-brake",
"sharp-falcons-begin",
"sharp-olives-sip",
"shy-olives-hang",
"shy-pumpkins-try",
"shy-socks-eat",
"silent-colts-reply",
"silent-lies-run",
"silly-apricots-share",
@@ -218,6 +238,7 @@
"spotty-peas-hope",
"spotty-zoos-film",
"stale-jobs-drum",
"stale-parents-yawn",
"strong-apes-reply",
"strong-keys-lie",
"stupid-walls-sell",
@@ -230,12 +251,14 @@
"tasty-news-collect",
"ten-hairs-listen",
"ten-rivers-burn",
"tender-cooks-tie",
"tender-pianos-check",
"thick-parrots-float",
"thirty-countries-build",
"thirty-spies-applaud",
"three-lies-pull",
"tidy-clouds-smoke",
"tidy-llamas-compare",
"tough-toes-pull",
"twelve-hornets-sip",
"twelve-lemons-smile",

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": minor
---
Fix mutability bug in RPC configuration

View File

@@ -0,0 +1,6 @@
---
"@blitzjs/auth": patch
"@blitzjs/next": patch
---
Added option `role` to `authenticate` property of `BlitzPage` to authenticate page with respect to the role of the user. `String` value or `Array` of strings can be passed to authorize users.

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Patch next13 for suspense error

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
using "blitz install" inside recipe with addRunCommandStep causes hangs up

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Include resolvers in `src` directory in blitz console

View File

@@ -0,0 +1,7 @@
---
"blitz": patch
"@blitzjs/next": patch
"@blitzjs/rpc": patch
---
Fix ambigious class warning log & upgrade superjson from 1.9.1 to 1.11.0

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": minor
---
fix resolverPath:root and make it work with monorepo resolvers

View File

@@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
with:
version: 6.32.6
version: 7.11.0
- name: Setup node
uses: actions/setup-node@v2
with:
@@ -35,9 +35,9 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}
- name: Build
run: pnpm build -- --api="http://127.0.0.1:9080"
run: pnpm build
- name: Lint
run: pnpm lint -- --api="http://127.0.0.1:9080"
run: pnpm lint
build:
runs-on: ubuntu-latest
@@ -46,23 +46,22 @@ jobs:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
with:
version: 6.32.6
version: 7.11.0
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm manypkg check
- name: Turborepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}
- run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build -- --api="http://127.0.0.1:9080"
run: pnpm build
- name: Build Apps
run: pnpm build:apps -- --api="http://127.0.0.1:9080"
run: pnpm build:apps
Unit-Tests:
name: "Unit Test: ${{ matrix.os }} (node@16)"
@@ -82,7 +81,7 @@ jobs:
- name: Setup PNPM
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
with:
version: 6.32.6
version: 7.11.0
- name: Setup node@16
uses: actions/setup-node@v2
@@ -90,21 +89,18 @@ jobs:
node-version: 16
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
shell: bash
- run: pnpm manypkg check
shell: bash
- name: Turborepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
shell: bash
- name: Build
run: pnpm build -- --api="http://127.0.0.1:9080"
run: pnpm build
shell: bash
- name: Test Packages
@@ -150,7 +146,7 @@ jobs:
- name: Setup PNPM
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
with:
version: 6.32.6
version: 7.11.0
- name: Setup node@${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v2
@@ -158,25 +154,22 @@ jobs:
node-version: ${{ matrix.NODE_VERSION }}
cache: "pnpm"
- name: Link Blitz CLI
run: pnpm link ./packages/blitz
shell: bash
- name: Install dependencies
run: pnpm install --frozen-lockfile
shell: bash
- run: pnpm manypkg check
shell: bash
- name: Turborepo local server
uses: felixmosh/turborepo-gh-artifacts@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
shell: bash
- name: Install playwright
run: npx playwright install --with-deps
shell: bash
- name: Build
run: pnpm build -- --api="http://127.0.0.1:9080"
run: pnpm build
shell: bash
- name: Test Packages

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-396-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-398-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/main/LICENSE">
<img alt="" src="https://img.shields.io/npm/l/blitz.svg?style=for-the-badge&labelColor=000000&color=blue">
@@ -135,8 +135,9 @@ 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="http://aleksandra.codes"><img src="https://avatars.githubusercontent.com/u/9019397?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aleksandra Sikora</b></sub></a><br />Lead Maintainer</td>
<td align="center"><a href="http://twitter.com/dillonraphael"><img src="https://avatars.githubusercontent.com/u/3496193?v=4" width="100px;" alt=""/><br /><sub><b>Dillon Raphael</b></sub></a><br />Senior Maintainer</td>
<td align="center"><a href="http://twitter.com/dillonraphael"><img src="https://avatars.githubusercontent.com/u/3496193?v=4" width="100px;" alt=""/><br /><sub><b>Dillon Raphael</b></sub></a><br />Lead Maintainer</td>
<td align="center"><a href="http://aleksandra.codes"><img src="https://avatars.githubusercontent.com/u/9019397?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aleksandra Sikora</b></sub></a><br />Core Maintainer</td>
</tr>
</table>
@@ -534,7 +535,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<td align="center"><a href="https://bhanuteja.dev/"><img src="https://avatars.githubusercontent.com/u/17903466?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bhanu Teja Pachipulusu</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=pbteja1998" title="Code">💻</a></td>
<td align="center"><a href="https://twitter.com/pavestru"><img src="https://avatars.githubusercontent.com/u/10186479?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pavel Struhar</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=pavestru" title="Code">💻</a></td>
<td align="center"><a href="https://in-thepink.com/"><img src="https://avatars.githubusercontent.com/u/42126368?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Reo Ishiyama</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=reo777" title="Code">💻</a></td>
<td align="center"><a href="https://macwright.com/"><img src="https://avatars.githubusercontent.com/u/32314?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tom MacWright</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=tmcw" title="Documentation">📖</a></td>
<td align="center"><a href="https://macwright.com/"><img src="https://avatars.githubusercontent.com/u/32314?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tom MacWright</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=tmcw" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=tmcw" title="Tests">⚠️</a> <a href="https://github.com/blitz-js/blitz/commits?author=tmcw" title="Code">💻</a></td>
<td align="center"><a href="https://francoisbest.com"><img src="https://avatars.githubusercontent.com/u/1174092?v=4?s=100" width="100px;" alt=""/><br /><sub><b>François Best</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=franky47" title="Code">💻</a></td>
</tr>
<tr>
@@ -616,7 +617,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<td align="center"><a href="https://github.com/ricardo-rp"><img src="https://avatars.githubusercontent.com/u/30808767?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ricardo Romero</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=ricardo-rp" title="Documentation">📖</a></td>
<td align="center"><a href="exocortex.anothernode.com"><img src="https://avatars.githubusercontent.com/u/3286144?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Moritz Reiter</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=anothernode" title="Documentation">📖</a></td>
<td align="center"><a href="https://msich.dev"><img src="https://avatars.githubusercontent.com/u/38794918?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matt Sichterman</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=msichterman" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/medihack"><img src="https://avatars.githubusercontent.com/u/120626?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kai Schlamp</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=medihack" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/medihack"><img src="https://avatars.githubusercontent.com/u/120626?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kai Schlamp</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=medihack" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=medihack" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://muyiwa.me"><img src="https://avatars.githubusercontent.com/u/6832244?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Muyiwa Olu</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=muyiwaolu" title="Code">💻</a></td>
@@ -731,6 +732,8 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
<td align="center"><a href="https://github.com/oloost"><img src="https://avatars.githubusercontent.com/u/72395941?v=4?s=100" width="100px;" alt=""/><br /><sub><b>oloost</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=oloost" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/janvennemann"><img src="https://avatars.githubusercontent.com/u/1406024?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jan Vennemann</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=janvennemann" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=janvennemann" title="Code">💻</a></td>
<td align="center"><a href="https://kevinjones.engineer"><img src="https://avatars.githubusercontent.com/u/20748598?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kevin Jones</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=joneskj55" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/paulm17"><img src="https://avatars.githubusercontent.com/u/387463?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=paulm17" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=paulm17" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=paulm17" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/selcukfatihsevinc"><img src="https://avatars.githubusercontent.com/u/384836?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Selçuk Fatih Sevinç</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=selcukfatihsevinc" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=selcukfatihsevinc" title="Code">💻</a></td>
</tr>
</table>

View File

@@ -27,38 +27,40 @@
"@blitzjs/config": "workspace:*",
"@blitzjs/next": "workspace:*",
"@blitzjs/rpc": "workspace:*",
"@hookform/resolvers": "2.8.8",
"@prisma/client": "4.0.0",
"blitz": "workspace:2.0.0-beta.15",
"@hookform/error-message": "2.0.0",
"@hookform/resolvers": "2.9.10",
"@prisma/client": "4.6.0",
"blitz": "workspace:2.0.0-beta.19",
"next": "12.2.5",
"openid-client": "5.1.8",
"prisma": "4.0.0",
"openid-client": "5.2.1",
"prisma": "4.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.29.0",
"ts-node": "10.7.0",
"zod": "3.17.3"
"react-hook-form": "7.39.1",
"ts-node": "10.9.1",
"zod": "3.19.1"
},
"devDependencies": {
"@next/bundle-analyzer": "12.0.8",
"@testing-library/react": "13.0.0",
"@testing-library/react-hooks": "7.0.2",
"@types/jest": "27.4.1",
"@types/node": "17.0.16",
"@testing-library/react": "13.4.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.2.2",
"@types/node": "18.11.9",
"@types/preview-email": "2.0.1",
"@types/react": "18.0.17",
"@typescript-eslint/eslint-plugin": "5.9.1",
"eslint": "7.32.0",
"@types/react": "18.0.25",
"@typescript-eslint/eslint-plugin": "5.42.1",
"eslint": "8.27.0",
"eslint-config-next": "12.3.1",
"eslint-config-prettier": "8.5.0",
"husky": "7.0.4",
"jest": "27.5.1",
"lint-staged": "12.1.7",
"prettier": "^2.5.1",
"prettier-plugin-prisma": "3.8.0",
"husky": "8.0.2",
"jest": "29.3.0",
"jest-environment-jsdom": "29.3.0",
"lint-staged": "13.0.3",
"prettier": "^2.7.1",
"prettier-plugin-prisma": "4.4.0",
"pretty-quick": "3.1.3",
"preview-email": "3.x",
"typescript": "^4.5.3"
"preview-email": "3.0.7",
"typescript": "^4.8.4"
},
"private": true
}

View File

@@ -1,9 +1,9 @@
import { AuthenticationError, PromiseReturnType } from "blitz"
import Link from "next/link"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import login from "app/auth/mutations/login"
import { Login } from "app/auth/validations"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
import login from "src/auth/mutations/login"
import { Login } from "src/auth/validations"
import { useMutation } from "@blitzjs/rpc"
import { Routes } from "@blitzjs/next"

View File

@@ -1,7 +1,7 @@
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import signup from "app/auth/mutations/signup"
import { Signup } from "app/auth/validations"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
import signup from "src/auth/mutations/signup"
import { Signup } from "src/auth/validations"
import { useMutation } from "@blitzjs/rpc"
type SignupFormProps = {

View File

@@ -1,5 +1,6 @@
import { forwardRef, PropsWithoutRef, ComponentPropsWithoutRef } from "react"
import { useFormContext } from "react-hook-form"
import { ErrorMessage } from "@hookform/error-message"
export interface LabeledTextFieldProps extends PropsWithoutRef<JSX.IntrinsicElements["input"]> {
/** Field name. */
@@ -18,9 +19,6 @@ export const LabeledTextField = forwardRef<HTMLInputElement, LabeledTextFieldPro
register,
formState: { isSubmitting, errors },
} = useFormContext()
const error = Array.isArray(errors[name])
? errors[name].join(", ")
: errors[name]?.message || errors[name]
return (
<div {...outerProps}>
@@ -29,11 +27,15 @@ export const LabeledTextField = forwardRef<HTMLInputElement, LabeledTextFieldPro
<input disabled={isSubmitting} {...register(name)} {...props} />
</label>
{error && (
<div role="alert" style={{ color: "red" }}>
{error}
</div>
)}
<ErrorMessage
render={({ message }) => (
<div role="alert" style={{ color: "red" }}>
{message}
</div>
)}
errors={errors}
name={name}
/>
<style jsx>{`
label {

View File

@@ -1,7 +1,7 @@
import { ErrorFallbackProps, ErrorComponent, ErrorBoundary, AppProps } from "@blitzjs/next"
import { AuthenticationError, AuthorizationError } from "blitz"
import React from "react"
import { withBlitz } from "app/blitz-client"
import { withBlitz } from "src/blitz-client"
function RootErrorFallback({ error }: ErrorFallbackProps) {
if (error instanceof AuthenticationError) {

View File

@@ -1,5 +1,5 @@
import { passportAuth } from "@blitzjs/auth"
import { api } from "app/blitz-server"
import { api } from "src/blitz-server"
import db, { User } from "db"
import { Issuer, Strategy as OpenIdStrategy } from "openid-client"

View File

@@ -1,4 +1,4 @@
import { rpcHandler } from "@blitzjs/rpc"
import { api } from "app/blitz-server"
import { api } from "src/blitz-server"
export default api(rpcHandler({ onError: console.log }))

View File

@@ -1,8 +1,8 @@
import Layout from "app/core/layouts/Layout"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import { ForgotPassword } from "app/auth/validations"
import forgotPassword from "app/auth/mutations/forgotPassword"
import Layout from "src/core/layouts/Layout"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
import { ForgotPassword } from "src/auth/validations"
import forgotPassword from "src/auth/mutations/forgotPassword"
import { useMutation } from "@blitzjs/rpc"
import { BlitzPage } from "@blitzjs/next"

View File

@@ -1,5 +1,5 @@
import Layout from "app/core/layouts/Layout"
import { LoginForm } from "app/auth/components/LoginForm"
import Layout from "src/core/layouts/Layout"
import { LoginForm } from "src/auth/components/LoginForm"
import { useRouter } from "next/router"
import { BlitzPage } from "@blitzjs/next"
import Link from "next/link"

View File

@@ -1,8 +1,8 @@
import Layout from "app/core/layouts/Layout"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import { ResetPassword } from "app/auth/validations"
import resetPassword from "app/auth/mutations/resetPassword"
import Layout from "src/core/layouts/Layout"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
import { ResetPassword } from "src/auth/validations"
import resetPassword from "src/auth/mutations/resetPassword"
import { BlitzPage, Routes } from "@blitzjs/next"
import { useRouter } from "next/router"
import { useMutation } from "@blitzjs/rpc"

View File

@@ -1,6 +1,6 @@
import { useRouter } from "next/router"
import Layout from "app/core/layouts/Layout"
import { SignupForm } from "app/auth/components/SignupForm"
import Layout from "src/core/layouts/Layout"
import { SignupForm } from "src/auth/components/SignupForm"
import { BlitzPage, Routes } from "@blitzjs/next"
const SignupPage: BlitzPage = () => {

View File

@@ -1,9 +1,9 @@
import { Suspense } from "react"
import Image from "next/image"
import Link from "next/link"
import Layout from "app/core/layouts/Layout"
import { useCurrentUser } from "app/users/hooks/useCurrentUser"
import logout from "app/auth/mutations/logout"
import Layout from "src/core/layouts/Layout"
import { useCurrentUser } from "src/users/hooks/useCurrentUser"
import logout from "src/auth/mutations/logout"
import logo from "public/logo.png"
import { useMutation } from "@blitzjs/rpc"
import { Routes, BlitzPage } from "@blitzjs/next"

View File

@@ -1,5 +1,5 @@
import { useQuery } from "@blitzjs/rpc"
import getCurrentUser from "app/users/queries/getCurrentUser"
import getCurrentUser from "src/users/queries/getCurrentUser"
export const useCurrentUser = () => {
const [user] = useQuery(getCurrentUser, null)

View File

@@ -4,8 +4,4 @@ const createJestConfig = nextJest({
dir: "./",
})
const customJestConfig = {
testEnvironment: "jest-environment-jsdom",
}
module.exports = createJestConfig(customJestConfig)

View File

@@ -27,37 +27,39 @@
"@blitzjs/config": "workspace:*",
"@blitzjs/next": "workspace:*",
"@blitzjs/rpc": "workspace:*",
"@hookform/resolvers": "2.8.8",
"@prisma/client": "4.0.0",
"blitz": "workspace:2.0.0-beta.15",
"@hookform/error-message": "2.0.0",
"@hookform/resolvers": "2.9.10",
"@prisma/client": "4.6.0",
"blitz": "workspace:2.0.0-beta.19",
"next": "12.2.5",
"prisma": "4.0.0",
"prisma": "4.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.29.0",
"ts-node": "10.7.0",
"zod": "3.17.3"
"react-hook-form": "7.39.1",
"ts-node": "10.9.1",
"zod": "3.19.1"
},
"devDependencies": {
"@next/bundle-analyzer": "12.0.8",
"@testing-library/react": "13.0.0",
"@testing-library/react-hooks": "7.0.2",
"@types/jest": "27.4.1",
"@types/node": "17.0.16",
"@testing-library/react": "13.4.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.2.2",
"@types/node": "18.11.9",
"@types/preview-email": "2.0.1",
"@types/react": "18.0.17",
"@typescript-eslint/eslint-plugin": "5.9.1",
"eslint": "7.32.0",
"@types/react": "18.0.25",
"@typescript-eslint/eslint-plugin": "5.42.1",
"eslint": "8.27.0",
"eslint-config-next": "12.3.1",
"eslint-config-prettier": "8.5.0",
"husky": "7.0.4",
"jest": "27.5.1",
"lint-staged": "12.1.7",
"prettier": "^2.5.1",
"prettier-plugin-prisma": "3.8.0",
"husky": "8.0.2",
"jest": "29.3.0",
"jest-environment-jsdom": "29.3.0",
"lint-staged": "13.0.3",
"prettier": "^2.7.1",
"prettier-plugin-prisma": "4.4.0",
"pretty-quick": "3.1.3",
"preview-email": "3.x",
"typescript": "^4.5.3"
"preview-email": "3.0.7",
"typescript": "^4.8.4"
},
"private": true
}

View File

@@ -1,9 +1,9 @@
import { AuthenticationError, PromiseReturnType } from "blitz"
import Link from "next/link"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import login from "app/auth/mutations/login"
import { Login } from "app/auth/validations"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
import login from "src/auth/mutations/login"
import { Login } from "src/auth/validations"
import { useMutation } from "@blitzjs/rpc"
import { Routes } from "@blitzjs/next"

View File

@@ -1,7 +1,7 @@
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import signup from "app/auth/mutations/signup"
import { Signup } from "app/auth/validations"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
import signup from "src/auth/mutations/signup"
import { Signup } from "src/auth/validations"
import { useMutation } from "@blitzjs/rpc"
type SignupFormProps = {

View File

@@ -1,5 +1,6 @@
import { forwardRef, PropsWithoutRef, ComponentPropsWithoutRef } from "react"
import { useFormContext } from "react-hook-form"
import { ErrorMessage } from "@hookform/error-message"
export interface LabeledTextFieldProps extends PropsWithoutRef<JSX.IntrinsicElements["input"]> {
/** Field name. */
@@ -18,9 +19,6 @@ export const LabeledTextField = forwardRef<HTMLInputElement, LabeledTextFieldPro
register,
formState: { isSubmitting, errors },
} = useFormContext()
const error = Array.isArray(errors[name])
? errors[name].join(", ")
: errors[name]?.message || errors[name]
return (
<div {...outerProps}>
@@ -29,11 +27,15 @@ export const LabeledTextField = forwardRef<HTMLInputElement, LabeledTextFieldPro
<input disabled={isSubmitting} {...register(name)} {...props} />
</label>
{error && (
<div role="alert" style={{ color: "red" }}>
{error}
</div>
)}
<ErrorMessage
render={({ message }) => (
<div role="alert" style={{ color: "red" }}>
{message}
</div>
)}
errors={errors}
name={name}
/>
<style jsx>{`
label {

View File

@@ -1,7 +1,7 @@
import { ErrorFallbackProps, ErrorComponent, ErrorBoundary, AppProps } from "@blitzjs/next"
import { AuthenticationError, AuthorizationError } from "blitz"
import React from "react"
import { withBlitz } from "app/blitz-client"
import { withBlitz } from "src/blitz-client"
function RootErrorFallback({ error }: ErrorFallbackProps) {
if (error instanceof AuthenticationError) {

View File

@@ -1,4 +1,4 @@
import { rpcHandler } from "@blitzjs/rpc"
import { api } from "app/blitz-server"
import { api } from "src/blitz-server"
export default api(rpcHandler({ onError: console.log }))

View File

@@ -1,8 +1,8 @@
import Layout from "app/core/layouts/Layout"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import { ForgotPassword } from "app/auth/validations"
import forgotPassword from "app/auth/mutations/forgotPassword"
import Layout from "src/core/layouts/Layout"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
import { ForgotPassword } from "src/auth/validations"
import forgotPassword from "src/auth/mutations/forgotPassword"
import { useMutation } from "@blitzjs/rpc"
import { BlitzPage } from "@blitzjs/next"

View File

@@ -1,7 +1,7 @@
import { BlitzPage } from "@blitzjs/next"
import Layout from "app/core/layouts/Layout"
import { LoginForm } from "app/auth/components/LoginForm"
import Layout from "src/core/layouts/Layout"
import { LoginForm } from "src/auth/components/LoginForm"
import { useRouter } from "next/router"
import { BlitzPage } from "@blitzjs/next"
const LoginPage: BlitzPage = () => {
const router = useRouter()

View File

@@ -1,9 +1,9 @@
import { useEffect, useState } from "react"
import Layout from "app/core/layouts/Layout"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import { ResetPassword } from "app/auth/validations"
import resetPassword from "app/auth/mutations/resetPassword"
import Layout from "src/core/layouts/Layout"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
import { ResetPassword } from "src/auth/validations"
import resetPassword from "src/auth/mutations/resetPassword"
import { BlitzPage, Routes } from "@blitzjs/next"
import { useRouter } from "next/router"
import { useMutation } from "@blitzjs/rpc"

View File

@@ -1,6 +1,6 @@
import { useRouter } from "next/router"
import Layout from "app/core/layouts/Layout"
import { SignupForm } from "app/auth/components/SignupForm"
import Layout from "src/core/layouts/Layout"
import { SignupForm } from "src/auth/components/SignupForm"
import { BlitzPage, Routes } from "@blitzjs/next"
const SignupPage: BlitzPage = () => {

View File

@@ -1,9 +1,9 @@
import { Suspense } from "react"
import Image from "next/image"
import Link from "next/link"
import Layout from "app/core/layouts/Layout"
import { useCurrentUser } from "app/users/hooks/useCurrentUser"
import logout from "app/auth/mutations/logout"
import Layout from "src/core/layouts/Layout"
import { useCurrentUser } from "src/users/hooks/useCurrentUser"
import logout from "src/auth/mutations/logout"
import logo from "public/logo.png"
import { useMutation } from "@blitzjs/rpc"
import { Routes, BlitzPage } from "@blitzjs/next"

View File

@@ -1,5 +1,5 @@
import { useQuery } from "@blitzjs/rpc"
import getCurrentUser from "app/users/queries/getCurrentUser"
import getCurrentUser from "src/users/queries/getCurrentUser"
export const useCurrentUser = () => {
const [user] = useQuery(getCurrentUser, null)

View File

@@ -11,3 +11,7 @@ export default async function getCurrentUser(_ = null, { session }: Ctx) {
return user
}
export const config = {
httpMethod: "GET",
}

View File

@@ -1,9 +1,9 @@
import { useCurrentUser } from "app/users/hooks/useCurrentUser"
import { useCurrentUser } from "src/users/hooks/useCurrentUser"
import { render } from "test/utils"
import Home from "../pages/index"
import Home from "../src/pages/index"
jest.mock("app/users/hooks/useCurrentUser")
jest.mock("src/users/hooks/useCurrentUser")
const mockUseCurrentUser = useCurrentUser as jest.MockedFunction<typeof useCurrentUser>
describe("renders blitz documentation link", () => {

View File

@@ -4,8 +4,4 @@ const createJestConfig = nextJest({
dir: "./",
})
const customJestConfig = {
testEnvironment: "jest-environment-jsdom",
}
module.exports = createJestConfig(customJestConfig)
module.exports = createJestConfig({})

View File

@@ -20,23 +20,24 @@
"@blitzjs/config": "workspace:*",
"@blitzjs/next": "workspace:*",
"@blitzjs/rpc": "workspace:*",
"@prisma/client": "4.0.0",
"@types/jest": "27.4.1",
"@prisma/client": "4.6.0",
"@types/jest": "29.2.2",
"@types/passport-twitter": "1.0.37",
"blitz": "workspace:*",
"jest": "27.5.1",
"jest": "29.3.0",
"jest-environment-jsdom": "29.3.0",
"next": "12.2.5",
"passport-mock-strategy": "2.0.0",
"passport-twitter": "1.0.4",
"prisma": "4.0.0",
"prisma": "4.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"ts-node": "10.7.0"
"ts-node": "10.9.1"
},
"devDependencies": {
"@next/bundle-analyzer": "12.0.8",
"@types/react": "18.0.17",
"eslint": "7.32.0",
"typescript": "^4.5.3"
"@types/react": "18.0.25",
"eslint": "8.27.0",
"typescript": "^4.8.4"
}
}

View File

@@ -1,7 +1,7 @@
import {ErrorFallbackProps, ErrorComponent, ErrorBoundary, AppProps} from "@blitzjs/next"
import {AuthenticationError, AuthorizationError} from "blitz"
import React, {Suspense} from "react"
import {withBlitz} from "app/blitz-client"
import {withBlitz} from "src/blitz-client"
function RootErrorFallback({error}: ErrorFallbackProps) {
if (error instanceof AuthenticationError) {

View File

@@ -1,5 +1,5 @@
import {passportAuth} from "@blitzjs/auth"
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
import db from "db"
import {Strategy as TwitterStrategy} from "passport-twitter"

View File

@@ -1,4 +1,4 @@
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
import db from "db"
export default api(async (_req, res, ctx) => {

View File

@@ -1,4 +1,4 @@
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
export default api(async (_req, res, ctx) => {
const {session} = ctx

View File

@@ -1,4 +1,4 @@
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
export default api(async (_req, res, ctx) => {
const blitzContext = ctx

View File

@@ -1,4 +1,4 @@
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
import db from "db"
export default api(async (_req, res) => {

View File

@@ -1,4 +1,4 @@
import {rpcHandler} from "@blitzjs/rpc"
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
export default api(rpcHandler({onError: console.log}))

View File

@@ -1,5 +1,5 @@
import {setPublicDataForUser} from "@blitzjs/auth"
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
import db from "db"
export default api(async (req, res, ctx) => {

View File

@@ -1,4 +1,4 @@
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
import db from "db"
import {SecurePassword} from "@blitzjs/auth"

View File

@@ -1,4 +1,4 @@
import {api} from "app/blitz-server"
import {api} from "src/blitz-server"
import db from "db"
import {SecurePassword} from "@blitzjs/auth"

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