Skip to content

Commit f2da4f1

Browse files
Version Packages (beta) (#4083)
* Version Packages (beta) * pnpm lock --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Siddharth Suresh <[email protected]>
1 parent acc07ce commit f2da4f1

File tree

55 files changed

+677
-249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+677
-249
lines changed

.changeset/pre.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
"@blitzjs/recipe-theme-ui": "0.34.0-canary.0",
4747
"@blitzjs/recipe-vanilla-extract": "0.34.0-canary.0",
4848
"test-rpc-path-root": "0.0.0",
49-
"test-full-auth-with-rpc": "0.0.0"
49+
"test-full-auth-with-rpc": "0.0.0",
50+
"next-blitz-auth": "0.1.0",
51+
"test-app-dir": "0.0.0"
5052
},
5153
"changesets": [
5254
"afraid-dancers-juggle",
@@ -67,6 +69,7 @@
6769
"calm-nails-wait",
6870
"calm-papayas-protect",
6971
"calm-tomatoes-drive",
72+
"chatty-fireants-leave",
7073
"chilled-carrots-own",
7174
"chilly-candles-care",
7275
"chilly-nails-nail",
@@ -77,6 +80,7 @@
7780
"cool-doors-invent",
7881
"cool-horses-check",
7982
"cuddly-pugs-crash",
83+
"cuddly-singers-perform",
8084
"curly-rules-speak",
8185
"curly-seas-serve",
8286
"curvy-days-attend",
@@ -91,13 +95,17 @@
9195
"eleven-lobsters-drop",
9296
"empty-berries-rule",
9397
"empty-pants-search",
98+
"empty-spiders-lay",
9499
"empty-turkeys-wave",
95100
"fair-carrots-guess",
96101
"fair-kangaroos-clean",
97102
"fair-wombats-sneeze",
98103
"famous-kings-explain",
104+
"fast-adults-guess",
99105
"fast-clocks-push",
106+
"fast-pans-impress",
100107
"fast-papayas-grow",
108+
"fast-toys-wash",
101109
"fast-trainers-kneel",
102110
"few-dogs-fetch",
103111
"few-hounds-worry",
@@ -109,6 +117,7 @@
109117
"forty-timers-rhyme",
110118
"four-brooms-juggle",
111119
"four-meals-fry",
120+
"four-radios-tickle",
112121
"four-sheep-judge",
113122
"funny-cups-pay",
114123
"fuzzy-bees-warn",
@@ -169,6 +178,7 @@
169178
"lucky-cows-try",
170179
"lucky-months-guess",
171180
"lucky-years-turn",
181+
"mean-ears-speak",
172182
"mean-gorillas-reply",
173183
"modern-cameras-pull",
174184
"modern-games-dream",
@@ -234,6 +244,7 @@
234244
"silent-colts-reply",
235245
"silent-lies-run",
236246
"silly-apricots-share",
247+
"silly-peas-work",
237248
"silly-shoes-agree",
238249
"six-apricots-kick",
239250
"slimy-humans-impress",
@@ -258,6 +269,7 @@
258269
"stale-jobs-drum",
259270
"stale-parents-yawn",
260271
"strong-apes-reply",
272+
"strong-chicken-study",
261273
"strong-keys-lie",
262274
"stupid-rabbits-jump",
263275
"stupid-walls-sell",
@@ -266,6 +278,7 @@
266278
"swift-glasses-laugh",
267279
"swift-poets-travel",
268280
"tall-meals-learn",
281+
"tall-radios-clean",
269282
"tame-keys-reply",
270283
"tame-pumpkins-nail",
271284
"tasty-maps-fetch",

.changeset/tall-radios-clean.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
"next-blitz-auth": patch
32
"@blitzjs/auth": patch
43
"@blitzjs/rpc": patch
54
"blitz": patch
@@ -11,9 +10,10 @@ feature: Nextjs 13 App Directory Utility Methods
1110

1211
This hook is implemented as the replacement of the [`BlitzPage` seurity auth utilities](https://blitzjs.com/docs/authorization#secure-your-pages) provided for the pages directory to work with React Server Components in the Nextjs 13 app directory
1312
It can be used in any asynchronous server component be it in `page.ts` or in the layouts in `layout.ts`
14-
It uses the new [`redirect` function](https://beta.nextjs.org/docs/api-reference/redirect) to provide the required authorization in server side
13+
It uses the new [`redirect` function](https://beta.nextjs.org/docs/api-reference/redirect) to provide the required authorization in server side
1514

1615
#### API
16+
1717
```ts
1818
useAuthenticatedBlitzContext({
1919
redirectTo,
@@ -27,7 +27,9 @@ useAuthenticatedBlitzContext({
2727
```
2828

2929
#### Usage
30+
3031
**Example Usage in React Server Component in `app` directory in Next 13**
32+
3133
```ts
3234
import {getAppSession, useAuthenticatedBlitzContext} from "src/blitz-server"
3335
...
@@ -41,11 +43,12 @@ await useAuthenticatedBlitzContext({
4143
### 🔧 New Blitz RPC Hook `invokeResolver`
4244

4345
#### API
46+
4447
```ts
4548
invokeResolver<T extends (...args: any) => any, TInput = FirstParam<T>>(
4649
queryFn: T,
4750
params: TInput,
48-
): Promise<PromiseReturnType<T>>
51+
): Promise<PromiseReturnType<T>>
4952
```
5053

5154
#### Example Usage

apps/next13/CHANGELOG.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# next-blitz-auth
2+
3+
## 0.1.1-beta.0
4+
5+
### Patch Changes
6+
7+
- 37aeaa7fa: feature: Nextjs 13 App Directory Utility Methods
8+
9+
### 🔧 New Blitz Auth Hook `useAuthenticatedBlitzContext`
10+
11+
This hook is implemented as the replacement of the [`BlitzPage` seurity auth utilities](https://blitzjs.com/docs/authorization#secure-your-pages) provided for the pages directory to work with React Server Components in the Nextjs 13 app directory
12+
It can be used in any asynchronous server component be it in `page.ts` or in the layouts in `layout.ts`
13+
It uses the new [`redirect` function](https://beta.nextjs.org/docs/api-reference/redirect) to provide the required authorization in server side
14+
15+
#### API
16+
17+
```ts
18+
useAuthenticatedBlitzContext({
19+
redirectTo,
20+
redirectAuthenticatedTo,
21+
role,
22+
}: {
23+
redirectTo?: string | RouteUrlObject
24+
redirectAuthenticatedTo?: string | RouteUrlObject | ((ctx: Ctx) => string | RouteUrlObject)
25+
role?: string | string[]
26+
}): Promise<void>
27+
```
28+
29+
#### Usage
30+
31+
**Example Usage in React Server Component in `app` directory in Next 13**
32+
33+
```ts
34+
import {getAppSession, useAuthenticatedBlitzContext} from "src/blitz-server"
35+
...
36+
await useAuthenticatedBlitzContext({
37+
redirectTo: "/auth/login",
38+
role: ["admin"],
39+
redirectAuthenticatedTo: "/dashboard",
40+
})
41+
```
42+
43+
### 🔧 New Blitz RPC Hook `invokeResolver`
44+
45+
#### API
46+
47+
```ts
48+
invokeResolver<T extends (...args: any) => any, TInput = FirstParam<T>>(
49+
queryFn: T,
50+
params: TInput,
51+
): Promise<PromiseReturnType<T>>
52+
```
53+
54+
#### Example Usage
55+
56+
```ts
57+
...
58+
import {invokeResolver, useAuthenticatedBlitzContext} from "../src/blitz-server"
59+
import getCurrentUser from "../src/users/queries/getCurrentUser"
60+
61+
export default async function Home() {
62+
await useAuthenticatedBlitzContext({
63+
redirectTo: "/auth/login",
64+
})
65+
const user = await invokeResolver(getCurrentUser, null)
66+
...
67+
```
68+
69+
- Updated dependencies [cadefb88e]
70+
- Updated dependencies [6f18cbdc9]
71+
- Updated dependencies [acc07ce94]
72+
- Updated dependencies [ea7561b8e]
73+
- Updated dependencies [9529dbd6f]
74+
- Updated dependencies [ea7561b8e]
75+
- Updated dependencies [6e88a847f]
76+
- Updated dependencies [37aeaa7fa]
77+
78+
- @blitzjs/[email protected]
79+
- @blitzjs/[email protected]
80+
- @blitzjs/[email protected]
81+
- @blitzjs/[email protected]

apps/next13/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next-blitz-auth",
3-
"version": "0.1.0",
3+
"version": "0.1.1-beta.0",
44
"private": true,
55
"scripts": {
66
"blitz:dev": "next dev",

apps/toolkit-app-passportjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@hookform/error-message": "2.0.0",
3131
"@hookform/resolvers": "2.9.10",
3232
"@prisma/client": "4.6.1",
33-
"blitz": "workspace:2.0.0-beta.23",
33+
"blitz": "workspace:2.0.0-beta.24",
3434
"next": "13.2.4",
3535
"openid-client": "5.2.1",
3636
"prisma": "4.6.1",

apps/toolkit-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@hookform/error-message": "2.0.0",
3232
"@hookform/resolvers": "2.9.10",
3333
"@prisma/client": "4.6.1",
34-
"blitz": "workspace:2.0.0-beta.23",
34+
"blitz": "workspace:2.0.0-beta.24",
3535
"next": "13.2.4",
3636
"next-auth": "4.18.7",
3737
"prisma": "4.6.1",

integration-tests/auth-with-rpc/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"prisma:studio": "prisma studio"
1818
},
1919
"dependencies": {
20-
"@blitzjs/auth": "workspace:2.0.0-beta.23",
21-
"@blitzjs/config": "workspace:2.0.0-beta.23",
22-
"@blitzjs/next": "workspace:2.0.0-beta.23",
23-
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
20+
"@blitzjs/auth": "workspace:2.0.0-beta.24",
21+
"@blitzjs/config": "workspace:2.0.0-beta.24",
22+
"@blitzjs/next": "workspace:2.0.0-beta.24",
23+
"@blitzjs/rpc": "workspace:2.0.0-beta.24",
2424
"@hookform/error-message": "2.0.0",
2525
"@hookform/resolvers": "2.9.10",
2626
"@prisma/client": "4.6.1",
27-
"blitz": "workspace:2.0.0-beta.23",
27+
"blitz": "workspace:2.0.0-beta.24",
2828
"delay": "5.0.0",
2929
"next": "13.2.4",
3030
"prisma": "4.6.1",

integration-tests/auth/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"prisma:studio": "prisma studio"
1818
},
1919
"dependencies": {
20-
"@blitzjs/auth": "workspace:2.0.0-beta.23",
21-
"@blitzjs/config": "workspace:2.0.0-beta.23",
22-
"@blitzjs/next": "workspace:2.0.0-beta.23",
20+
"@blitzjs/auth": "workspace:2.0.0-beta.24",
21+
"@blitzjs/config": "workspace:2.0.0-beta.24",
22+
"@blitzjs/next": "workspace:2.0.0-beta.24",
2323
"@prisma/client": "4.6.1",
24-
"blitz": "workspace:2.0.0-beta.23",
24+
"blitz": "workspace:2.0.0-beta.24",
2525
"lowdb": "3.0.0",
2626
"next": "13.2.4",
2727
"prisma": "4.6.1",

integration-tests/get-initial-props/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
"schema": "db/schema.prisma"
1717
},
1818
"dependencies": {
19-
"@blitzjs/auth": "workspace:2.0.0-beta.23",
20-
"@blitzjs/next": "workspace:2.0.0-beta.23",
21-
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
19+
"@blitzjs/auth": "workspace:2.0.0-beta.24",
20+
"@blitzjs/next": "workspace:2.0.0-beta.24",
21+
"@blitzjs/rpc": "workspace:2.0.0-beta.24",
2222
"@prisma/client": "4.6.1",
23-
"blitz": "workspace:2.0.0-beta.23",
23+
"blitz": "workspace:2.0.0-beta.24",
2424
"lowdb": "3.0.0",
2525
"next": "13.2.4",
2626
"prisma": "4.6.1",
2727
"react": "18.2.0",
2828
"react-dom": "18.2.0"
2929
},
3030
"devDependencies": {
31-
"@blitzjs/config": "workspace:2.0.0-beta.23",
31+
"@blitzjs/config": "workspace:2.0.0-beta.24",
3232
"@next/bundle-analyzer": "12.0.8",
3333
"@types/express": "4.17.13",
3434
"@types/fs-extra": "9.0.13",

integration-tests/middleware/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
1212
},
1313
"dependencies": {
14-
"@blitzjs/config": "workspace:2.0.0-beta.23",
15-
"@blitzjs/next": "workspace:2.0.0-beta.23",
16-
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
17-
"blitz": "workspace:2.0.0-beta.23",
14+
"@blitzjs/config": "workspace:2.0.0-beta.24",
15+
"@blitzjs/next": "workspace:2.0.0-beta.24",
16+
"@blitzjs/rpc": "workspace:2.0.0-beta.24",
17+
"blitz": "workspace:2.0.0-beta.24",
1818
"next": "13.2.4",
1919
"react": "18.2.0",
2020
"react-dom": "18.2.0"

integration-tests/next-13-app-dir/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"prisma:studio": "prisma studio"
1818
},
1919
"dependencies": {
20-
"@blitzjs/auth": "workspace:2.0.0-beta.23",
21-
"@blitzjs/config": "workspace:2.0.0-beta.23",
22-
"@blitzjs/next": "workspace:2.0.0-beta.23",
23-
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
20+
"@blitzjs/auth": "workspace:2.0.0-beta.24",
21+
"@blitzjs/config": "workspace:2.0.0-beta.24",
22+
"@blitzjs/next": "workspace:2.0.0-beta.24",
23+
"@blitzjs/rpc": "workspace:2.0.0-beta.24",
2424
"@prisma/client": "4.6.1",
25-
"blitz": "workspace:2.0.0-beta.23",
25+
"blitz": "workspace:2.0.0-beta.24",
2626
"lowdb": "3.0.0",
2727
"next": "13.2.4",
2828
"prisma": "4.6.1",

integration-tests/no-suspense/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
"prisma:studio": "prisma studio"
1717
},
1818
"dependencies": {
19-
"@blitzjs/auth": "workspace:2.0.0-beta.23",
20-
"@blitzjs/next": "workspace:2.0.0-beta.23",
21-
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
19+
"@blitzjs/auth": "workspace:2.0.0-beta.24",
20+
"@blitzjs/next": "workspace:2.0.0-beta.24",
21+
"@blitzjs/rpc": "workspace:2.0.0-beta.24",
2222
"@prisma/client": "4.6.1",
23-
"blitz": "workspace:2.0.0-beta.23",
23+
"blitz": "workspace:2.0.0-beta.24",
2424
"lowdb": "3.0.0",
2525
"next": "13.2.4",
2626
"prisma": "4.6.1",
2727
"react": "18.2.0",
2828
"react-dom": "18.2.0"
2929
},
3030
"devDependencies": {
31-
"@blitzjs/config": "workspace:2.0.0-beta.23",
31+
"@blitzjs/config": "workspace:2.0.0-beta.24",
3232
"@next/bundle-analyzer": "12.0.8",
3333
"@types/express": "4.17.13",
3434
"@types/fs-extra": "9.0.13",

integration-tests/qm/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"clean": "rm -rf .turbo && rm -rf node_modules"
99
},
1010
"dependencies": {
11-
"@blitzjs/auth": "workspace:2.0.0-beta.23",
12-
"@blitzjs/config": "workspace:2.0.0-beta.23",
13-
"@blitzjs/next": "workspace:2.0.0-beta.23",
14-
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
11+
"@blitzjs/auth": "workspace:2.0.0-beta.24",
12+
"@blitzjs/config": "workspace:2.0.0-beta.24",
13+
"@blitzjs/next": "workspace:2.0.0-beta.24",
14+
"@blitzjs/rpc": "workspace:2.0.0-beta.24",
1515
"@prisma/client": "4.6.1",
1616
"@tanstack/react-query": "4.0.10",
17-
"blitz": "workspace:2.0.0-beta.23",
17+
"blitz": "workspace:2.0.0-beta.24",
1818
"next": "13.2.4",
1919
"prisma": "4.6.1",
2020
"react": "18.2.0",

integration-tests/react-query-utils/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
"schema": "db/schema.prisma"
1717
},
1818
"dependencies": {
19-
"@blitzjs/next": "workspace:2.0.0-beta.23",
20-
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
19+
"@blitzjs/next": "workspace:2.0.0-beta.24",
20+
"@blitzjs/rpc": "workspace:2.0.0-beta.24",
2121
"@prisma/client": "4.6.1",
22-
"blitz": "workspace:2.0.0-beta.23",
22+
"blitz": "workspace:2.0.0-beta.24",
2323
"lowdb": "3.0.0",
2424
"next": "13.2.4",
2525
"prisma": "4.6.1",
2626
"react": "18.2.0",
2727
"react-dom": "18.2.0"
2828
},
2929
"devDependencies": {
30-
"@blitzjs/config": "workspace:2.0.0-beta.23",
30+
"@blitzjs/config": "workspace:2.0.0-beta.24",
3131
"@next/bundle-analyzer": "12.0.8",
3232
"@types/express": "4.17.13",
3333
"@types/fs-extra": "9.0.13",

0 commit comments

Comments
 (0)