Compare commits
12 Commits
dev
...
@blitzjs/g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6374f2ff0c | ||
|
|
6ec020c6d6 | ||
|
|
a3d8b287f1 | ||
|
|
4ed1fc1233 | ||
|
|
3fa3c70b39 | ||
|
|
a9b1989bb0 | ||
|
|
c3c789740a | ||
|
|
42a2cf951a | ||
|
|
d316d0db7f | ||
|
|
a8ce2325fc | ||
|
|
f58a0e42f7 | ||
|
|
cb63a0ea5b |
@@ -3794,7 +3794,8 @@
|
||||
"profile": "http://tobiasjordans.de",
|
||||
"contributions": [
|
||||
"code",
|
||||
"doc"
|
||||
"doc",
|
||||
"test"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -3816,6 +3817,26 @@
|
||||
"doc",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jhonnymichel",
|
||||
"name": "Jhonny Michel",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/7006387?v=4",
|
||||
"profile": "https://github.com/jhonnymichel",
|
||||
"contributions": [
|
||||
"doc",
|
||||
"code",
|
||||
"test"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "sweetliquid",
|
||||
"name": "sweetliquid",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/18693190?v=4",
|
||||
"profile": "sweetliquid.me",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
||||
5
.changeset/big-boats-lay.md
Normal file
5
.changeset/big-boats-lay.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Guard `blitz g` input via an allow-list of characters; throw if unwanted characters are found. Prevents to break the blitz command by accident (https://github.com/blitz-js/blitz/issues/4021).
|
||||
5
.changeset/perfect-baboons-relate.md
Normal file
5
.changeset/perfect-baboons-relate.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Remove useEffect from reset password templates.
|
||||
6
.changeset/plenty-kiwis-greet.md
Normal file
6
.changeset/plenty-kiwis-greet.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Updates internal functions and tests to support blitz apps that run tests with vitest
|
||||
@@ -51,6 +51,7 @@
|
||||
"changesets": [
|
||||
"afraid-dancers-juggle",
|
||||
"afraid-ears-repair",
|
||||
"big-boats-lay",
|
||||
"big-phones-bow",
|
||||
"blue-flowers-peel",
|
||||
"blue-pigs-tan",
|
||||
@@ -195,9 +196,11 @@
|
||||
"olive-sheep-rhyme",
|
||||
"orange-mirrors-tap",
|
||||
"orange-zebras-reflect",
|
||||
"perfect-baboons-relate",
|
||||
"perfect-eyes-repeat",
|
||||
"perfect-trains-double",
|
||||
"plenty-bottles-swim",
|
||||
"plenty-kiwis-greet",
|
||||
"polite-lizards-love",
|
||||
"poor-peas-lick",
|
||||
"poor-penguins-look",
|
||||
@@ -260,18 +263,21 @@
|
||||
"stupid-walls-sell",
|
||||
"sweet-kiwis-cross",
|
||||
"swift-drinks-dress",
|
||||
"swift-glasses-laugh",
|
||||
"swift-poets-travel",
|
||||
"tall-meals-learn",
|
||||
"tame-keys-reply",
|
||||
"tame-pumpkins-nail",
|
||||
"tasty-maps-fetch",
|
||||
"tasty-news-collect",
|
||||
"tasty-squids-sin",
|
||||
"ten-hairs-listen",
|
||||
"ten-rivers-burn",
|
||||
"tender-cooks-tie",
|
||||
"tender-pianos-check",
|
||||
"thick-moons-fry",
|
||||
"thick-parrots-float",
|
||||
"thick-peas-jog",
|
||||
"thirty-countries-build",
|
||||
"thirty-spies-applaud",
|
||||
"three-lies-pull",
|
||||
|
||||
5
.changeset/swift-glasses-laugh.md
Normal file
5
.changeset/swift-glasses-laugh.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Update all links to follow Next 13 format without a child anchor tag.
|
||||
7
.changeset/thick-peas-jog.md
Normal file
7
.changeset/thick-peas-jog.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@blitzjs/auth": major
|
||||
---
|
||||
|
||||
BREAKING CHANGE: secure-password is now an `optional peerDependency`, if you are using `SecurePassword` api, you need to now install `secure-password` in your application.
|
||||
|
||||
This helps users who do not use SecurePassword from having native package build issues.
|
||||
@@ -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-403-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-405-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">
|
||||
@@ -736,9 +736,11 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="a11rew.dev"><img src="https://avatars.githubusercontent.com/u/87580113?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrew Glago</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=a11rew" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=a11rew" title="Code">💻</a></td>
|
||||
<td align="center"><a href="http://tobiasjordans.de"><img src="https://avatars.githubusercontent.com/u/111561?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tobias</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=tordans" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=tordans" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="http://tobiasjordans.de"><img src="https://avatars.githubusercontent.com/u/111561?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tobias</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=tordans" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=tordans" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=tordans" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://www.linkedin.com/in/iagor-moraes/"><img src="https://avatars.githubusercontent.com/u/13892132?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Iagor Moraes</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=iagormoraes" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=iagormoraes" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://twitter.com/trensik"><img src="https://avatars.githubusercontent.com/u/18584155?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dawid Urbaniak</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=Trancever" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=Trancever" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/jhonnymichel"><img src="https://avatars.githubusercontent.com/u/7006387?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jhonny Michel</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=jhonnymichel" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=jhonnymichel" title="Code">💻</a> <a href="https://github.com/blitz-js/blitz/commits?author=jhonnymichel" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="sweetliquid.me"><img src="https://avatars.githubusercontent.com/u/18693190?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sweetliquid</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=sweetliquid" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"@hookform/error-message": "2.0.0",
|
||||
"@hookform/resolvers": "2.9.10",
|
||||
"@prisma/client": "4.6.0",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"next": "12.2.5",
|
||||
"openid-client": "5.2.1",
|
||||
"prisma": "4.6.0",
|
||||
|
||||
@@ -40,16 +40,16 @@ export const LoginForm = (props: LoginFormProps) => {
|
||||
<LabeledTextField name="email" label="Email" placeholder="Email" />
|
||||
<LabeledTextField name="password" label="Password" placeholder="Password" type="password" />
|
||||
<div>
|
||||
<Link href={Routes.ForgotPasswordPage()} passHref>
|
||||
<a>Forgot your password?</a>
|
||||
<Link href={Routes.ForgotPasswordPage()}>
|
||||
Forgot your password?
|
||||
</Link>
|
||||
</div>
|
||||
</Form>
|
||||
|
||||
<div style={{ marginTop: "1rem" }}>
|
||||
Or{" "}
|
||||
<Link href={Routes.SignupPage()} passHref>
|
||||
<a>Sign Up</a>
|
||||
<Link href={Routes.SignupPage()}>
|
||||
Sign Up
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,15 +38,11 @@ const UserInfo = () => {
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Link href={Routes.SignupPage()} passHref>
|
||||
<a className="button small">
|
||||
<strong>Sign Up</strong>
|
||||
</a>
|
||||
<Link href={Routes.SignupPage()}className="button small">
|
||||
<strong>Sign Up</strong>
|
||||
</Link>
|
||||
<Link href={Routes.LoginPage()} passHref>
|
||||
<a className="button small">
|
||||
<strong>Login</strong>
|
||||
</a>
|
||||
<Link href={Routes.LoginPage()} className="button small">
|
||||
<strong>Login</strong>
|
||||
</Link>
|
||||
</>
|
||||
)
|
||||
@@ -90,10 +86,7 @@ const Home: BlitzPage = () => {
|
||||
<code>blitz dev</code>
|
||||
</pre>
|
||||
<p>
|
||||
and go to{" "}
|
||||
<Link href="/projects">
|
||||
<a>/projects</a>
|
||||
</Link>
|
||||
and go to <Link href="/projects">/projects</Link>
|
||||
</p>
|
||||
</div>
|
||||
<div className="buttons" style={{ marginTop: "5rem" }}>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"@hookform/error-message": "2.0.0",
|
||||
"@hookform/resolvers": "2.9.10",
|
||||
"@prisma/client": "4.6.0",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"next": "12.2.5",
|
||||
"prisma": "4.6.0",
|
||||
"react": "18.2.0",
|
||||
|
||||
@@ -40,16 +40,16 @@ export const LoginForm = (props: LoginFormProps) => {
|
||||
<LabeledTextField name="email" label="Email" placeholder="Email" />
|
||||
<LabeledTextField name="password" label="Password" placeholder="Password" type="password" />
|
||||
<div>
|
||||
<Link href={Routes.ForgotPasswordPage()} passHref>
|
||||
<a>Forgot your password?</a>
|
||||
<Link href={Routes.ForgotPasswordPage()}>
|
||||
Forgot your password?
|
||||
</Link>
|
||||
</div>
|
||||
</Form>
|
||||
|
||||
<div style={{ marginTop: "1rem" }}>
|
||||
Or{" "}
|
||||
<Link href={Routes.SignupPage()} passHref>
|
||||
<a>Sign Up</a>
|
||||
<Link href={Routes.SignupPage()}>
|
||||
Sign Up
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ErrorFallbackProps, ErrorComponent, ErrorBoundary, AppProps } from "@blitzjs/next"
|
||||
import { AuthenticationError, AuthorizationError } from "blitz"
|
||||
import React from "react"
|
||||
import "src/styles/globals.css"
|
||||
import { withBlitz } from "src/blitz-client"
|
||||
|
||||
function RootErrorFallback({ error }: ErrorFallbackProps) {
|
||||
|
||||
@@ -10,14 +10,10 @@ import { useMutation } from "@blitzjs/rpc"
|
||||
import Link from "next/link"
|
||||
|
||||
const ResetPasswordPage: BlitzPage = () => {
|
||||
const [token, setToken] = useState("")
|
||||
const router = useRouter()
|
||||
const token = router.query.token?.toString()
|
||||
const [resetPasswordMutation, { isSuccess }] = useMutation(resetPassword)
|
||||
|
||||
useEffect(() => {
|
||||
setToken(router.query.token as string)
|
||||
}, [router.isReady])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Set a New Password</h1>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { Suspense } from "react"
|
||||
import Image from "next/image"
|
||||
import Link from "next/link"
|
||||
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"
|
||||
import styles from "src/styles/Home.module.css"
|
||||
|
||||
/*
|
||||
* This file is just for a pleasant getting started page for your new app.
|
||||
@@ -21,7 +20,7 @@ const UserInfo = () => {
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
className="button small"
|
||||
className={styles.button}
|
||||
onClick={async () => {
|
||||
await logoutMutation()
|
||||
}}
|
||||
@@ -38,15 +37,11 @@ const UserInfo = () => {
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Link href={Routes.SignupPage()} passHref>
|
||||
<a className="button small">
|
||||
<strong>Sign Up</strong>
|
||||
</a>
|
||||
<Link href={Routes.SignupPage()} className={styles.button}>
|
||||
<strong>Sign Up</strong>
|
||||
</Link>
|
||||
<Link href={Routes.LoginPage()} passHref>
|
||||
<a className="button small">
|
||||
<strong>Login</strong>
|
||||
</a>
|
||||
<Link href={Routes.LoginPage()} className={styles.loginButton}>
|
||||
<strong>Login</strong>
|
||||
</Link>
|
||||
</>
|
||||
)
|
||||
@@ -56,216 +51,142 @@ const UserInfo = () => {
|
||||
const Home: BlitzPage = () => {
|
||||
return (
|
||||
<Layout title="Home">
|
||||
<div className="container">
|
||||
<main>
|
||||
<div className="logo">
|
||||
<Image src={`${logo.src}`} alt="blitzjs" width="256px" height="118px" layout="fixed" />
|
||||
</div>
|
||||
<div className={styles.globe} />
|
||||
|
||||
<div className={styles.container}>
|
||||
<div className={styles.toastContainer}>
|
||||
<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>
|
||||
<div style={{ marginBottom: "1rem" }}>(And select Yes to run prisma migrate)</div>
|
||||
<div>
|
||||
<p>
|
||||
Then <strong>restart the server</strong>
|
||||
</p>
|
||||
<pre>
|
||||
<code>Ctrl + c</code>
|
||||
</pre>
|
||||
<pre>
|
||||
<code>blitz dev</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://discord.blitzjs.com"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Discord Community
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<main className={styles.main}>
|
||||
<div className={styles.wrapper}>
|
||||
<div className={styles.header}>
|
||||
<div className={styles.logo}>
|
||||
<svg viewBox="0 0 165 66">
|
||||
<path d="M104.292 56.033C104.292 56.408 104.206 56.6636 104.036 56.8C103.9 56.9363 103.627 57.0045 103.218 57.0045H99.7409C99.4001 57.0045 99.1615 56.9533 99.0251 56.8511C98.8888 56.7147 98.8206 56.4932 98.8206 56.1864L98.9229 19.8324C98.9229 19.3211 99.1444 19.0654 99.5876 19.0654H103.627C103.839 19.0654 104.292 19.0672 104.292 19.0672V19.8324V56.033ZM64.3531 57.0081C64.1145 57.0081 63.927 56.9399 63.7906 56.8035C63.6543 56.6672 63.5861 56.4968 63.5861 56.2922V19.9383C63.5861 19.3588 63.8588 19.069 64.4042 19.069H76.829C81.533 19.069 85.1463 19.9212 87.6687 21.6256C90.1912 23.2958 91.4524 25.7331 91.4524 28.9373C91.4524 30.9484 90.924 32.6528 89.8673 34.0504C88.8106 35.4138 87.1063 36.5217 84.7543 37.3739C84.6179 37.4079 84.5497 37.4932 84.5497 37.6295C84.5497 37.7318 84.6179 37.7999 84.7543 37.834C87.2767 38.5158 89.1686 39.5895 90.4298 41.0553C91.7251 42.521 92.3727 44.4469 92.3727 46.833C92.3727 50.2418 91.0945 52.7983 88.5379 54.5027C85.9814 56.1729 82.2318 57.0081 77.2892 57.0081H64.3531ZM77.5448 35.5843C79.6923 35.5843 81.516 35.1071 83.0158 34.1526C84.5157 33.1982 85.2656 31.6983 85.2656 29.6531C85.2656 27.6079 84.5157 26.0569 83.0158 25.0002C81.5501 23.9435 79.5219 23.4151 76.9313 23.4151H70.5399C70.0286 23.4151 69.7729 23.6367 69.7729 24.0798V34.8684C69.7729 35.3457 69.9604 35.5843 70.3354 35.5843H77.5448ZM77.0335 52.662C82.9647 52.662 85.9303 50.5997 85.9303 46.4751C85.9303 44.3276 85.1633 42.7255 83.6294 41.6688C82.0955 40.6121 80.0673 40.0838 77.5448 40.0838H70.591C70.2843 40.0838 70.0627 40.1349 69.9263 40.2372C69.8241 40.3394 69.7729 40.5099 69.7729 40.7485V51.895C69.7729 52.4063 69.9604 52.662 70.3354 52.662H77.0335ZM142.707 56.8624C142.81 56.9647 142.997 57.0158 143.27 57.0158H163.876C164.387 57.0158 164.643 56.7772 164.643 56.3V53.948V53.3344H163.978H149.866C149.593 53.3344 149.457 53.2492 149.457 53.0788C149.457 52.9765 149.508 52.8572 149.61 52.7208L163.876 33.8536C164.251 33.2741 164.438 32.7628 164.438 32.3197V30.479V29.9144C164.438 29.9144 164.051 29.9165 163.876 29.9165H144.241C143.866 29.9165 143.679 30.121 143.679 30.5301V32.831C143.679 33.1037 143.713 33.2911 143.781 33.3934C143.883 33.4957 144.071 33.5468 144.344 33.5468H157.075C157.382 33.5468 157.535 33.632 157.535 33.8025L157.382 34.1092L143.219 52.9765C142.946 53.3515 142.759 53.6412 142.656 53.8457C142.588 54.0502 142.554 54.3059 142.554 54.6127V56.3C142.554 56.5727 142.605 56.7602 142.707 56.8624ZM116.929 19.0676H111.51V27.7684C114.503 27.7684 116.929 25.3419 116.929 22.3486V19.0676ZM116.926 56.0308C116.926 56.4058 116.841 56.6614 116.67 56.7978C116.534 56.9341 116.278 57.0023 115.903 57.0023H112.427C112.086 57.0023 111.847 56.9512 111.711 56.8489C111.574 56.7126 111.506 56.491 111.506 56.1842V30.6699C111.506 30.3972 111.557 30.2098 111.66 30.1075C111.762 29.9712 111.949 29.903 112.222 29.903H117.028L116.926 56.0308ZM132.183 34.3137C132.183 33.9728 132.336 33.8024 132.643 33.8024H138.779C139.256 33.8024 139.495 33.5979 139.495 33.1888V30.4789V29.9165H138.881H132.745C132.439 29.9165 132.285 29.7631 132.285 29.4563V21.531V20.713L131.621 20.7129H128.093C127.752 20.7129 127.547 20.9515 127.479 21.4288L126.865 29.4563C126.865 29.7631 126.729 29.9165 126.456 29.9165H122.366C121.957 29.9165 121.752 30.1039 121.752 30.4789V33.1888C121.752 33.5979 121.974 33.8024 122.417 33.8024H126.252C126.593 33.8024 126.763 34.0069 126.763 34.416V50.6244C126.763 52.806 127.309 54.4252 128.399 55.4819C129.49 56.5045 131.16 57.0158 133.41 57.0158C135.796 57.0158 137.535 56.9306 138.625 56.7601C139.137 56.6579 139.392 56.3681 139.392 55.8909V53.6923V53.0787H138.779H135.507C134.348 53.0787 133.495 52.806 132.95 52.2606C132.439 51.7152 132.183 50.7267 132.183 49.295V34.3137Z"></path>
|
||||
<path d="M0.241243 33.2639H10.9742C15.0585 33.2639 18.9054 35.1835 21.3612 38.4471L31.9483 52.5165C32.1484 52.7824 32.1786 53.1393 32.026 53.435L25.9232 65.2592C25.6304 65.8265 24.8455 65.8932 24.4612 65.3835L0.241243 33.2639Z"></path>
|
||||
<path d="M42.4727 33.2822H31.7398C27.6555 33.2822 23.8086 31.3626 21.3528 28.0991L10.7656 14.0297C10.5656 13.7638 10.5354 13.4068 10.688 13.1111L16.7908 1.28696C17.0836 0.719654 17.8684 0.652924 18.2528 1.16266L42.4727 33.2822Z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<h1>Your database & authentication is ready. Try it by signing up.</h1>
|
||||
|
||||
{/* Auth */}
|
||||
|
||||
<div className={styles.buttonContainer}>
|
||||
<Suspense fallback="Loading...">
|
||||
<UserInfo />
|
||||
</Suspense>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.body}>
|
||||
{/* Instructions */}
|
||||
<div className={styles.instructions}>
|
||||
<p>
|
||||
<strong>Add a new model by running the following in your terminal:</strong>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<div className={styles.code}>
|
||||
<span>1</span>
|
||||
<pre>
|
||||
<code>blitz generate all project</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div className={styles.code}>
|
||||
<span>2</span>
|
||||
<pre>
|
||||
<code>Ctrl + c</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div className={styles.code}>
|
||||
<span>3</span>
|
||||
<pre>
|
||||
<code>blitz dev</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div className={styles.code}>
|
||||
<span>4</span>
|
||||
<pre>
|
||||
<code>
|
||||
Go to{" "}
|
||||
<Link href="/projects" className={styles.textLink}>
|
||||
/projects
|
||||
</Link>
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* Links */}
|
||||
<div className={styles.linkGrid}>
|
||||
<a
|
||||
href="https://blitzjs.com/docs/getting-started?utm_source=blitz-new&utm_medium=app-template&utm_campaign=blitz-new"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={styles.card}
|
||||
>
|
||||
Blitz Docs
|
||||
<span className={styles.arrowIcon} />
|
||||
</a>
|
||||
<a
|
||||
href="https://nextjs.org/docs/getting-started"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={styles.card}
|
||||
>
|
||||
Next.js Docs
|
||||
<span className={styles.arrowIcon} />
|
||||
</a>
|
||||
<a
|
||||
href="https://github.com/blitz-js/blitz"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={styles.card}
|
||||
>
|
||||
Github Repo
|
||||
<span className={styles.arrowIcon} />
|
||||
</a>
|
||||
<a
|
||||
href="https://twitter.com/blitz_js"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={styles.card}
|
||||
>
|
||||
Blitz Twitter
|
||||
<span className={styles.arrowIcon} />
|
||||
</a>
|
||||
<a
|
||||
href="https://discord.blitzjs.com"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={styles.card}
|
||||
>
|
||||
Discord Community
|
||||
<span className={styles.arrowIcon} />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<footer className={styles.footer}>
|
||||
<span>Powered by</span>
|
||||
<a
|
||||
href="https://blitzjs.com?utm_source=blitz-new&utm_medium=app-template&utm_campaign=blitz-new"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={styles.textLink}
|
||||
>
|
||||
Powered by Blitz.js
|
||||
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>
|
||||
</Layout>
|
||||
)
|
||||
|
||||
304
apps/toolkit-app/src/styles/Home.module.css
Normal file
304
apps/toolkit-app/src/styles/Home.module.css
Normal file
@@ -0,0 +1,304 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.main {
|
||||
flex: 1;
|
||||
padding: 0rem 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.frost {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
||||
backdrop-filter: blur(5px);
|
||||
-webkit-backdrop-filter: blur(5px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.31);
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 4rem 0rem 2rem 0rem;
|
||||
text-align: center;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
max-width: 620px;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.body {
|
||||
composes: frost;
|
||||
border-radius: var(--border-radius);
|
||||
display: flex;
|
||||
padding: 1rem;
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
align-self: center;
|
||||
max-width: calc(min(var(--screen-width), 700px));
|
||||
}
|
||||
|
||||
.instructions {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
padding: 1rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.globe {
|
||||
position: fixed;
|
||||
width: 350vmin;
|
||||
height: 75vmin;
|
||||
left: 20%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, calc(-50% + 40px));
|
||||
z-index: -1;
|
||||
border-radius: 100%;
|
||||
background-image: radial-gradient(
|
||||
95.63% 95.63% at 95.92% 0%,
|
||||
rgba(255, 255, 255, 0.62) 0%,
|
||||
#8155ff38 60.42%,
|
||||
#002fff5c 169%
|
||||
);
|
||||
filter: blur(8vmin);
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
padding: 2rem 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.footer span {
|
||||
margin-right: 0.2rem;
|
||||
}
|
||||
|
||||
.code {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.code span {
|
||||
background: rgba(124, 58, 237, 50%);
|
||||
border-radius: 50rem;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
padding: 17px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: rgb(57, 33, 97);
|
||||
}
|
||||
|
||||
.code pre {
|
||||
background: rgba(124, 58, 237, 12%);
|
||||
border-radius: 4px;
|
||||
padding: 0.7em 1.4em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.code code {
|
||||
font-size: 0.86em;
|
||||
font-weight: bold;
|
||||
color: rgb(124, 58, 237);
|
||||
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
||||
Bitstream Vera Sans Mono, Courier New, monospace;
|
||||
}
|
||||
|
||||
.toastContainer {
|
||||
border: 1px solid #edff;
|
||||
padding: 0 1rem;
|
||||
background: #eeff;
|
||||
color: #62af;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toastContainer strong {
|
||||
color: rgb(124, 58, 237);
|
||||
}
|
||||
|
||||
.textLink {
|
||||
color: rgb(124, 58, 237);
|
||||
background: linear-gradient(to right, rgba(231, 216, 246, 1), rgba(231, 216, 246, 1)),
|
||||
linear-gradient(to right, rgba(99, 1, 235, 1), rgba(124, 58, 237, 1), rgba(231, 216, 246, 1));
|
||||
background-size: 100% 1px, 0 1px;
|
||||
background-position: 100% 100%, 0 100%;
|
||||
background-repeat: no-repeat;
|
||||
transition: background-size 400ms;
|
||||
}
|
||||
|
||||
.textLink:hover,
|
||||
.textLink:focus,
|
||||
.textLink:active {
|
||||
background-size: 0 1px, 100% 1px;
|
||||
}
|
||||
|
||||
.arrowIcon {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-top: 2px solid;
|
||||
transform: scale(var(--ggs, 1));
|
||||
border-right: 2px solid;
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 6px;
|
||||
color: #b1a5c4;
|
||||
}
|
||||
|
||||
.arrowIcon::after {
|
||||
content: "";
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 2px;
|
||||
background: currentColor;
|
||||
transform: rotate(-45deg);
|
||||
top: 2px;
|
||||
right: -1px;
|
||||
}
|
||||
|
||||
.buttonContainer {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 1rem;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.button {
|
||||
background: linear-gradient(to top, rgb(124, 58, 237), rgb(117, 81, 236));
|
||||
border: 1px solid rgb(231, 216, 246);
|
||||
color: white;
|
||||
text-shadow: rgba(0, 0, 0, 0.25) 0px 3px 8px;
|
||||
padding: 0 24px;
|
||||
height: 48px;
|
||||
width: 200px;
|
||||
max-width: 300px;
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
user-select: none;
|
||||
white-space: nowrap;
|
||||
border-radius: 0.75rem;
|
||||
border-bottom-left-radius: 0px;
|
||||
font-size: 15px;
|
||||
transition: all 0.3s ease 0s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
color: white;
|
||||
text-shadow: rgb(0 0 0 / 56%) 0px 3px 12px;
|
||||
box-shadow: rgb(80 63 205 / 50%) 0px 1px 40px;
|
||||
}
|
||||
|
||||
.loginButton {
|
||||
composes: button;
|
||||
background: rgb(248 250 252);
|
||||
border: 1px solid rgb(231, 216, 246);
|
||||
color: rgb(30 41 59);
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.loginButton:hover {
|
||||
color: rgb(30 41 59);
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.card:hover .arrowIcon {
|
||||
color: #7450ec;
|
||||
}
|
||||
|
||||
.linkGrid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
composes: frost;
|
||||
padding: 1rem 0rem;
|
||||
text-align: center;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
border-radius: 10px;
|
||||
border-bottom-left-radius: 0px;
|
||||
transition: color 0.15s ease, border-color 0.15s ease;
|
||||
max-width: 200px;
|
||||
min-width: 200px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.card:hover,
|
||||
.card:focus,
|
||||
.card:active {
|
||||
color: #7450ec;
|
||||
border-color: #7450ec;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin: 0 0 1rem 0;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.card p {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.logo {
|
||||
flex: 1;
|
||||
padding: 1rem 2rem;
|
||||
}
|
||||
|
||||
.logo svg {
|
||||
height: 100%;
|
||||
width: 200px;
|
||||
fill: #7450ec;
|
||||
}
|
||||
|
||||
/* MOBILE */
|
||||
@media (max-width: 800px) {
|
||||
.linkGrid {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.body {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.buttonContainer {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
25
apps/toolkit-app/src/styles/globals.css
Normal file
25
apps/toolkit-app/src/styles/globals.css
Normal file
@@ -0,0 +1,25 @@
|
||||
:root {
|
||||
--border-radius: 0.75rem;
|
||||
--screen-width: 90vmin;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell,
|
||||
Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -14,7 +14,7 @@ vi.mock("public/logo.png", () => ({
|
||||
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
|
||||
// when you remove the default content from the page
|
||||
|
||||
// This is an example on how to mock api hooks when testing
|
||||
vi.mock("src/users/hooks/useCurrentUser", () => ({
|
||||
@@ -27,6 +27,6 @@ test.skip("renders blitz documentation link", () => {
|
||||
}))
|
||||
|
||||
const { getByText } = render(<Home />)
|
||||
const linkElement = getByText(/Documentation/i)
|
||||
const linkElement = getByText(/Blitz Docs/i)
|
||||
expect(linkElement).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
"prisma:studio": "prisma studio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"@hookform/error-message": "2.0.0",
|
||||
"@hookform/resolvers": "2.9.10",
|
||||
"@prisma/client": "4.6.0",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"delay": "5.0.0",
|
||||
"next": "12.2.5",
|
||||
"prisma": "4.6.0",
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
"prisma:studio": "prisma studio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@prisma/client": "4.6.0",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "12.2.5",
|
||||
"prisma": "4.6.0",
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
"schema": "db/schema.prisma"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"@prisma/client": "4.6.0",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "12.2.5",
|
||||
"prisma": "4.6.0",
|
||||
@@ -28,7 +28,7 @@
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
SESSION_SECRET_KEY=hsdenhJfpLHrGjgdgg3jdF8g2bYD2PaQ
|
||||
HEADLESS=true
|
||||
HEADLESS=true
|
||||
VITE_BLITZ_TEST_ENVIRONMENT=true
|
||||
@@ -11,10 +11,10 @@
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"next": "12.2.5",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
"prisma:studio": "prisma studio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"@prisma/client": "4.6.0",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "12.2.5",
|
||||
"prisma": "4.6.0",
|
||||
@@ -28,7 +28,7 @@
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
|
||||
1
integration-tests/qm/.env
Normal file
1
integration-tests/qm/.env
Normal file
@@ -0,0 +1 @@
|
||||
VITE_BLITZ_TEST_ENVIRONMENT=true
|
||||
@@ -8,13 +8,13 @@
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"@prisma/client": "4.6.0",
|
||||
"@tanstack/react-query": "4.0.10",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"next": "12.2.5",
|
||||
"prisma": "4.6.0",
|
||||
"react": "18.2.0",
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
"schema": "db/schema.prisma"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"@prisma/client": "4.6.0",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "12.2.5",
|
||||
"prisma": "4.6.0",
|
||||
@@ -27,7 +27,7 @@
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"next": "12.2.5",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
|
||||
1
integration-tests/rpc/.env
Normal file
1
integration-tests/rpc/.env
Normal file
@@ -0,0 +1 @@
|
||||
VITE_BLITZ_TEST_ENVIRONMENT=true
|
||||
@@ -7,10 +7,10 @@
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"next": "12.2.5",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
"schema": "db/schema.prisma"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.23",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.23",
|
||||
"@prisma/client": "4.6.0",
|
||||
"blitz": "workspace:2.0.0-beta.22",
|
||||
"blitz": "workspace:2.0.0-beta.23",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "12.2.5",
|
||||
"prisma": "4.6.0",
|
||||
@@ -28,7 +28,7 @@
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"clean": "turbo run clean && rm -rf node_modules",
|
||||
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
||||
"pre-publish": "changeset add && changeset version && pnpm build && git add . && git commit -v",
|
||||
"release": "pnpm build && changeset publish",
|
||||
"release": "cp README.md packages/blitz && pnpm build && changeset publish",
|
||||
"publish-release": "changeset publish && git push --follow-tags"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @blitzjs/auth
|
||||
|
||||
## 2.0.0-beta.23
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 42a2cf951: BREAKING CHANGE: secure-password is now an `optional peerDependency`, if you are using `SecurePassword` api, you need to now install `secure-password` in your application.
|
||||
|
||||
This helps users who do not use SecurePassword from having native package build issues.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c3c789740]
|
||||
- blitz@2.0.0-beta.23
|
||||
|
||||
## 2.0.0-beta.22
|
||||
|
||||
### Minor Changes
|
||||
|
||||
90
packages/blitz-auth/README.md
Normal file
90
packages/blitz-auth/README.md
Normal file
@@ -0,0 +1,90 @@
|
||||
[](https://blitzjs.com)
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
<p align="center">
|
||||
<a aria-label="Join our Discord Community" href="https://discord.blitzjs.com">
|
||||
<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-403-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">
|
||||
</a>
|
||||
<a aria-label="NPM version" href="https://www.npmjs.com/package/@blitzjs/auth">
|
||||
<img alt="" src="https://img.shields.io/npm/v/blitz.svg?style=for-the-badge&labelColor=000000&color=E65528">
|
||||
</a>
|
||||
</p>
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<br>
|
||||
|
||||
<h1 align="center">
|
||||
Blitz Auth - Framework Agnostic Authentication
|
||||
</h1>
|
||||
|
||||
<br>
|
||||
|
||||
### [Documentation Link](https://blitzjs.com/docs/auth)
|
||||
|
||||
### [GitHub Link](https://github.com/blitz-js/blitz/tree/main/packages/blitz-auth)
|
||||
|
||||
### Quick Start
|
||||
|
||||
#### Install Blitz Auth
|
||||
|
||||
```bash
|
||||
`npm i @blitzjs/auth`
|
||||
# yarn add @blitzjs/auth
|
||||
# pnpm add @blitzjs/auth
|
||||
```
|
||||
|
||||
_You can alternatively use [`npx`](https://www.npmjs.com/package/npx)_
|
||||
|
||||
### Framework Support
|
||||
|
||||
Currently Blitz Auth usage is only documented with Next.js. We are working on adding additional support for other frameworks.
|
||||
|
||||
#### Setup Blitz Auth in Next.js
|
||||
|
||||
##### Client setup
|
||||
|
||||
Add the following to your blitz-client.ts file:
|
||||
|
||||
```ts
|
||||
import {AuthClientPlugin} from "@blitzjs/auth"
|
||||
import {setupBlitzClient} from "@blitzjs/next"
|
||||
|
||||
export const authConfig = {
|
||||
cookiePrefix: "testapp",
|
||||
}
|
||||
|
||||
const {withBlitz} = setupBlitzClient({
|
||||
plugins: [AuthClientPlugin(authConfig)],
|
||||
})
|
||||
|
||||
export {withBlitz}
|
||||
```
|
||||
|
||||
##### Server setup
|
||||
|
||||
Then, add the following to the blitz-server.ts file:
|
||||
|
||||
```ts
|
||||
import {setupBlitzServer} from "@blitzjs/next"
|
||||
import {AuthServerPlugin, PrismaStorage, simpleRolesIsAuthorized} from "@blitzjs/auth"
|
||||
import {db} from "db"
|
||||
import {authConfig} from "./blitz-client"
|
||||
|
||||
const {gSSP, gSP, api} = setupBlitzServer({
|
||||
plugins: [
|
||||
AuthServerPlugin({
|
||||
...authConfig,
|
||||
storage: PrismaStorage(db),
|
||||
isAuthorized: simpleRolesIsAuthorized,
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
||||
export {gSSP, gSP, api}
|
||||
```
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@blitzjs/auth",
|
||||
"version": "2.0.0-beta.22",
|
||||
"version": "2.0.0-beta.23",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/blitz-js/blitz.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"predev": "wait-on -d 250 ../blitz/dist/index-server.d.ts",
|
||||
@@ -34,15 +39,20 @@
|
||||
"nanoid": "3.2.0",
|
||||
"passport": "0.5.2",
|
||||
"path": "0.12.7",
|
||||
"secure-password": "4.0.0",
|
||||
"supports-color": "8.1.1",
|
||||
"url": "0.11.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"blitz": "2.0.0-beta.22"
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"secure-password": "4.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"secure-password": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@testing-library/react": "13.4.0",
|
||||
"@testing-library/react-hooks": "8.0.1",
|
||||
"@types/cookie": "0.4.1",
|
||||
@@ -50,9 +60,10 @@
|
||||
"@types/jsonwebtoken": "8.5.8",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"secure-password": "4.0.0",
|
||||
"typescript": "^4.8.4",
|
||||
"unbuild": "0.7.6",
|
||||
"watch": "1.0.2"
|
||||
|
||||
@@ -1,43 +1,8 @@
|
||||
import * as crypto from "crypto"
|
||||
import {nanoid} from "nanoid"
|
||||
import SecurePasswordLib from "secure-password"
|
||||
import {AuthenticationError} from "blitz"
|
||||
|
||||
export const hash256 = (input: string = "") => {
|
||||
return crypto.createHash("sha256").update(input).digest("hex")
|
||||
}
|
||||
|
||||
export const generateToken = (numberOfCharacters: number = 32) => nanoid(numberOfCharacters)
|
||||
|
||||
const SP = () => new SecurePasswordLib()
|
||||
|
||||
export const SecurePassword = {
|
||||
...SecurePasswordLib,
|
||||
async hash(password: string | null | undefined) {
|
||||
if (!password) {
|
||||
throw new AuthenticationError()
|
||||
}
|
||||
const hashedBuffer = await SP().hash(Buffer.from(password))
|
||||
return hashedBuffer.toString("base64")
|
||||
},
|
||||
async verify(hashedPassword: string | null | undefined, password: string | null | undefined) {
|
||||
if (!hashedPassword || !password) {
|
||||
throw new AuthenticationError()
|
||||
}
|
||||
try {
|
||||
const result = await SP().verify(Buffer.from(password), Buffer.from(hashedPassword, "base64"))
|
||||
// Return result for valid results.
|
||||
switch (result) {
|
||||
case SecurePassword.VALID:
|
||||
case SecurePassword.VALID_NEEDS_REHASH:
|
||||
return result
|
||||
default:
|
||||
// For everything else throw AuthenticationError
|
||||
throw new AuthenticationError()
|
||||
}
|
||||
} catch (error) {
|
||||
// Could be error like failed to hash password
|
||||
throw new AuthenticationError()
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@ export * from "./auth-sessions"
|
||||
export * from "./auth-utils"
|
||||
export * from "./auth-plugin"
|
||||
export * from "./passport-adapter"
|
||||
export * from "./secure-password"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {expect, describe, it} from "vitest"
|
||||
import {SecurePassword} from "./auth-utils"
|
||||
import {SecurePassword} from "./secure-password"
|
||||
|
||||
describe("SecurePassword", () => {
|
||||
describe("hash", () => {
|
||||
35
packages/blitz-auth/src/server/secure-password.ts
Normal file
35
packages/blitz-auth/src/server/secure-password.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import SecurePasswordLib from "secure-password"
|
||||
import {AuthenticationError} from "blitz"
|
||||
|
||||
const SP = () => new SecurePasswordLib()
|
||||
|
||||
export const SecurePassword = {
|
||||
...SecurePasswordLib,
|
||||
async hash(password: string | null | undefined) {
|
||||
if (!password) {
|
||||
throw new AuthenticationError()
|
||||
}
|
||||
const hashedBuffer = await SP().hash(Buffer.from(password))
|
||||
return hashedBuffer.toString("base64")
|
||||
},
|
||||
async verify(hashedPassword: string | null | undefined, password: string | null | undefined) {
|
||||
if (!hashedPassword || !password) {
|
||||
throw new AuthenticationError()
|
||||
}
|
||||
try {
|
||||
const result = await SP().verify(Buffer.from(password), Buffer.from(hashedPassword, "base64"))
|
||||
// Return result for valid results.
|
||||
switch (result) {
|
||||
case SecurePassword.VALID:
|
||||
case SecurePassword.VALID_NEEDS_REHASH:
|
||||
return result
|
||||
default:
|
||||
// For everything else throw AuthenticationError
|
||||
throw new AuthenticationError()
|
||||
}
|
||||
} catch (error) {
|
||||
// Could be error like failed to hash password
|
||||
throw new AuthenticationError()
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -1,5 +1,13 @@
|
||||
# @blitzjs/next
|
||||
|
||||
## 2.0.0-beta.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c3c789740]
|
||||
- blitz@2.0.0-beta.23
|
||||
- @blitzjs/rpc@2.0.0-beta.23
|
||||
|
||||
## 2.0.0-beta.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
394
packages/blitz-next/README.md
Normal file
394
packages/blitz-next/README.md
Normal file
@@ -0,0 +1,394 @@
|
||||
[](https://blitzjs.com)
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
<p align="center">
|
||||
<a aria-label="Join our Discord Community" href="https://discord.blitzjs.com">
|
||||
<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-403-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">
|
||||
</a>
|
||||
<a aria-label="NPM version" href="https://www.npmjs.com/package/@blitzjs/next">
|
||||
<img alt="" src="https://img.shields.io/npm/v/blitz.svg?style=for-the-badge&labelColor=000000&color=E65528">
|
||||
</a>
|
||||
</p>
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<br>
|
||||
|
||||
<h1 align="center">
|
||||
Blitz Adapter for Next.js
|
||||
</h1>
|
||||
|
||||
<br>
|
||||
|
||||
### [Blitzjs Website](https://blitzjs.com)
|
||||
|
||||
### [GitHub](https://github.com/blitz-js/blitz/tree/main/packages/blitz-next)
|
||||
|
||||
## Overview
|
||||
|
||||
The `@blitzjs/next` adapter exposes functions & components specific for
|
||||
the Next.js framework.
|
||||
|
||||
## Setup
|
||||
|
||||
You can install `@blitzjs/next` by running the following command:
|
||||
|
||||
```bash
|
||||
npm i @blitzjs/next # yarn add @blitzjs/next # pnpm add @blitzjs/next
|
||||
```
|
||||
|
||||
### Next Config
|
||||
|
||||
Blitz.js extends the `next.config.js` file by accepting a `blitz`
|
||||
property.
|
||||
|
||||
```ts
|
||||
blitz?: {
|
||||
resolverPath?: ResolverPathOptions;
|
||||
customServer?: {
|
||||
hotReload?: boolean;
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
<Card type="note">
|
||||
For more information on setting a custom `resolverPath`, read more at
|
||||
the [RPC Specification](/docs/rpc-specification#url)
|
||||
</Card>
|
||||
|
||||
## Client
|
||||
|
||||
### Example
|
||||
|
||||
Inside `src/blitz-client.ts`:
|
||||
|
||||
```ts
|
||||
import {setupBlitzClient} from "@blitzjs/next"
|
||||
|
||||
export const {withBlitz} = setupBlitzClient({
|
||||
plugins: [],
|
||||
})
|
||||
```
|
||||
|
||||
Then inside `src/pages/_app.tsx` wrap `MyApp` function with the
|
||||
`withBlitz` HOC component.
|
||||
|
||||
```ts
|
||||
import {ErrorFallbackProps, ErrorComponent, ErrorBoundary} from "@blitzjs/next"
|
||||
import {AuthenticationError, AuthorizationError} from "blitz"
|
||||
import type {AppProps} from "next/app"
|
||||
import React, {Suspense} from "react"
|
||||
import {withBlitz} from "src/blitz-client"
|
||||
|
||||
function RootErrorFallback({error}: ErrorFallbackProps) {
|
||||
if (error instanceof AuthenticationError) {
|
||||
return <div>Error: You are not authenticated</div>
|
||||
} else if (error instanceof AuthorizationError) {
|
||||
return (
|
||||
<ErrorComponent
|
||||
statusCode={error.statusCode}
|
||||
title="Sorry, you are not authorized to access this"
|
||||
/>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<ErrorComponent
|
||||
statusCode={(error as any)?.statusCode || 400}
|
||||
title={error.message || error.name}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function MyApp({Component, pageProps}: AppProps) {
|
||||
return (
|
||||
<ErrorBoundary FallbackComponent={RootErrorFallback}>
|
||||
<Component {...pageProps} />
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
||||
|
||||
export default withBlitz(MyApp)
|
||||
```
|
||||
|
||||
<Card type="note">
|
||||
An `<ErrorBoundary />` provider and `<ErrorComponent />` component is
|
||||
supplied by `@blitzjs/next`
|
||||
</Card>
|
||||
|
||||
### API
|
||||
|
||||
```ts
|
||||
setupBlitzClient({
|
||||
plugins: [],
|
||||
})
|
||||
```
|
||||
|
||||
#### Arguments
|
||||
|
||||
- `plugins:` An array of Blitz.js plugins
|
||||
- **Required**
|
||||
|
||||
#### Returns
|
||||
|
||||
An object with the `withBlitz` HOC wrapper
|
||||
|
||||
## Server
|
||||
|
||||
### Example
|
||||
|
||||
Inside `src/blitz-server.ts`
|
||||
|
||||
```ts
|
||||
import {setupBlitzServer} from "@blitzjs/next"
|
||||
|
||||
export const {gSSP, gSP, api} = setupBlitzServer({
|
||||
plugins: [],
|
||||
})
|
||||
```
|
||||
|
||||
### API
|
||||
|
||||
```ts
|
||||
setupBlitzServer({
|
||||
plugins: [],
|
||||
onError?: (err) => void
|
||||
})
|
||||
```
|
||||
|
||||
#### Arguments
|
||||
|
||||
- `plugins:` An array of Blitz.js plugins
|
||||
- **Required**
|
||||
- `onError:` Catch all errors _(Great for services like sentry)_
|
||||
|
||||
#### Returns
|
||||
|
||||
An object with the [`gSSP`](#blitzjs-next-gssp),
|
||||
[`gSP`](#blitzjs-next-gsp) & [`api`](#blitzjs-next-api) wrappers.
|
||||
|
||||
### Custom Server
|
||||
|
||||
The Blitz CLI supports running custom Next.js servers. This means you can
|
||||
compile both javascript & typescript while using the Blitz.js CLI to
|
||||
inject env variables. By default, the CLI checks for
|
||||
`src/server/index.[ts | js]` or `src/server.[ts | js]`
|
||||
|
||||
For more information about custom Next.js servers, check the
|
||||
[`official docs`](https://nextjs.org/docs/advanced-features/custom-server)
|
||||
|
||||
## Wrappers
|
||||
|
||||
All Next.js wrapper functions are serialized with
|
||||
[`superjson`](https://github.com/blitz-js/superjson). That means you can
|
||||
use `Date`, `Map`, `Set` & `BigInt` when returning data. Another thing to
|
||||
note is that Blitz runs the middlewares from plugins before calling the
|
||||
Next.js request handler.
|
||||
|
||||
<Card type="note">
|
||||
The `gSSP`, `gSP` & `api` functions all pass down the context of the
|
||||
session if you're using the auth plugin. Read more about the auth plugin
|
||||
here [@blitzjs/auth](/docs/auth).
|
||||
</Card>
|
||||
|
||||
### Examples
|
||||
|
||||
#### getStaticProps
|
||||
|
||||
```ts
|
||||
import {gSP} from "src/blitz-server"
|
||||
|
||||
export const getStaticProps = gSP(async ({ctx}) => {
|
||||
return {
|
||||
props: {
|
||||
data: {
|
||||
userId: ctx?.session.userId,
|
||||
session: {
|
||||
id: ctx?.session.userId,
|
||||
publicData: ctx?.session.$publicData,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
#### getServerSideProps
|
||||
|
||||
```ts
|
||||
import {gSSP} from "src/blitz-server"
|
||||
|
||||
export const getServerSideProps = gSSP(async ({ctx}) => {
|
||||
return {
|
||||
props: {
|
||||
userId: ctx?.session.userId,
|
||||
publicData: ctx?.session.$publicData,
|
||||
},
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
#### api
|
||||
|
||||
```ts
|
||||
import {api} from "src/blitz-server"
|
||||
|
||||
export default api(async (req, res, ctx) => {
|
||||
res.status(200).json({userId: ctx?.session.userId})
|
||||
})
|
||||
```
|
||||
|
||||
_For more information about Next.js API routes, visit their docs at
|
||||
[https://nextjs.org/docs/api-routes/introduction](https://nextjs.org/docs/api-routes/introduction)_
|
||||
|
||||
## Concepts
|
||||
|
||||
### Authenticate user before page loads
|
||||
|
||||
You may want to check if the user is logged in before your page loads.
|
||||
We’re going to use the `getCurrentUser` query inside
|
||||
`getServerSideProps()` by calling the query directly. Then you can check
|
||||
if the user is logged in on the server and use the built-in Next.js
|
||||
redirect property.
|
||||
|
||||
```ts
|
||||
import {Routes, BlitzPage} from "@blitzjs/next"
|
||||
import {gSSP} from "src/blitz-server"
|
||||
import getCurrentUser from "src/users/queries/getCurrentUser"
|
||||
|
||||
export const getServerSideProps = gSSP(async ({ctx}) => {
|
||||
const currentUser = await getCurrentUser(null, ctx)
|
||||
|
||||
if (currentUser) {
|
||||
return {
|
||||
props: {
|
||||
user: currentUser,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
redirect: {
|
||||
destination: Routes.LoginPage(),
|
||||
permanent: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### Return types when data fetching on the server
|
||||
|
||||
You can set the types returned from the Next.js data fetching functions.
|
||||
All Blitz.js wrappers for the Next.js functions accept a generic. Same
|
||||
with the `BlitzPage` type.
|
||||
|
||||
So for example, we can use some typescript utilities to help use get the
|
||||
types returned by `getCurrentUser()`
|
||||
|
||||
```ts
|
||||
import {Routes, BlitzPage} from "@blitzjs/next"
|
||||
import {gSSP} from "src/blitz-server"
|
||||
import getCurrentUser from "src/users/queries/getCurrentUser"
|
||||
|
||||
type TCurrentUser = Awaited<ReturnType<typeof getCurrentUser>>
|
||||
|
||||
export const getServerSideProps = gSSP<{user: TCurrentUser}>(async ({ctx}) => {
|
||||
const currentUser = await getCurrentUser(null, ctx)
|
||||
|
||||
if (currentUser) {
|
||||
return {
|
||||
props: {
|
||||
user: currentUser,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
redirect: {
|
||||
destination: Routes.LoginPage(),
|
||||
permanent: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const Page: BlitzPage<{user: TCurrentUser}> = ({user}) => {
|
||||
return (
|
||||
<Layout title="Page">
|
||||
<div className="container">
|
||||
<p>User Page</p>
|
||||
{user && <p>{user.email}</p>}
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export default Page
|
||||
```
|
||||
|
||||
### Handling errors on initial page load
|
||||
|
||||
There’s an edge case where you may be throwing an error in a query that’s
|
||||
being called on an initial page load, causing a server error instead of
|
||||
hitting the `<ErrorBoundary />`. This is because when initially loading
|
||||
the page, there is no ErrorBoundary component rendered until `_app.tsx` is
|
||||
mounted. Though, this is expected behaviour, there is a workaround.
|
||||
|
||||
For an example, in a query where the user is not found you can create a
|
||||
`NotFoundError()` then return the status code.
|
||||
|
||||
```ts
|
||||
export default resolver.pipe(resolver.zod(GetUser), async (input) => {
|
||||
const {id} = input
|
||||
|
||||
const user = await db.user.findFirst({where: {id}})
|
||||
|
||||
if (!user) {
|
||||
const userError = new NotFoundError("User not found")
|
||||
return {
|
||||
error: userError.statusCode,
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
user,
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Then on the server (in this case `getServerSideProps()`) you can call the
|
||||
query and if the error key is found in the return object then show an
|
||||
error.
|
||||
|
||||
```ts
|
||||
export const getServerSideProps = gSSP(async ({ ctx }) => {
|
||||
|
||||
const user = await getUser({ 1 }, ctx)
|
||||
if("error" in user) {
|
||||
return { props: { error: user.error}}
|
||||
} else {
|
||||
return { props: { user }}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
You can also catch server errors in `_app.tsx` and show the errors with a
|
||||
toast component.
|
||||
|
||||
```tsx
|
||||
function MyApp({Component, pageProps}: AppProps) {
|
||||
const getLayout = Component.getLayout || ((page) => page)
|
||||
if (pageProps.error) {
|
||||
return <ToastComponent>{pageProps.error.statusCode}</ToastComponent>
|
||||
}
|
||||
return (
|
||||
<ErrorBoundary FallbackComponent={RootErrorFallback}>
|
||||
{getLayout(<Component {...pageProps} />)}
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
||||
```
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@blitzjs/next",
|
||||
"version": "2.0.0-beta.22",
|
||||
"version": "2.0.0-beta.23",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/blitz-js/blitz.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "pnpm predev && pnpm watch unbuild src --wait=0.2",
|
||||
@@ -24,7 +29,7 @@
|
||||
"eslint.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@blitzjs/rpc": "2.0.0-beta.22",
|
||||
"@blitzjs/rpc": "2.0.0-beta.23",
|
||||
"@tanstack/react-query": "4.0.10",
|
||||
"@types/hoist-non-react-statics": "3.3.1",
|
||||
"debug": "4.3.3",
|
||||
@@ -34,12 +39,12 @@
|
||||
"supports-color": "8.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"next": "*",
|
||||
"react": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@testing-library/dom": "8.13.0",
|
||||
"@testing-library/jest-dom": "5.16.3",
|
||||
"@testing-library/react": "13.4.0",
|
||||
@@ -49,7 +54,7 @@
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"@types/testing-library__react-hooks": "4.0.0",
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"cross-spawn": "7.0.3",
|
||||
"find-up": "4.1.0",
|
||||
"next": "12.2.5",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @blitzjs/rpc
|
||||
|
||||
## 2.0.0-beta.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c3c789740: Updates internal functions and tests to support blitz apps that run tests with vitest
|
||||
- Updated dependencies [c3c789740]
|
||||
- blitz@2.0.0-beta.23
|
||||
|
||||
## 2.0.0-beta.22
|
||||
|
||||
### Minor Changes
|
||||
|
||||
61
packages/blitz-rpc/README.md
Normal file
61
packages/blitz-rpc/README.md
Normal file
@@ -0,0 +1,61 @@
|
||||
[](https://blitzjs.com)
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
<p align="center">
|
||||
<a aria-label="Join our Discord Community" href="https://discord.blitzjs.com">
|
||||
<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-403-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">
|
||||
</a>
|
||||
<a aria-label="NPM version" href="https://www.npmjs.com/package/@blitzjs/auth">
|
||||
<img alt="" src="https://img.shields.io/npm/v/blitz.svg?style=for-the-badge&labelColor=000000&color=E65528">
|
||||
</a>
|
||||
</p>
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<br>
|
||||
|
||||
<h1 align="center">
|
||||
Blitz "Zero-API" data layer (Blitz RPC)
|
||||
</h1>
|
||||
|
||||
<br>
|
||||
|
||||
### [Documentation Link](https://blitzjs.com/docs/rpc-overview)
|
||||
|
||||
### [GitHub Link](https://github.com/blitz-js/blitz/tree/main/packages/blitz-rpc)
|
||||
|
||||
### Quick Start
|
||||
|
||||
#### Install Blitz RPC
|
||||
|
||||
```bash
|
||||
`npm i @blitzjs/rpc`
|
||||
# yarn add @blitzjs/rpc
|
||||
# pnpm add @blitzjs/rpc
|
||||
```
|
||||
|
||||
_You can alternatively use [`npx`](https://www.npmjs.com/package/npx)_
|
||||
|
||||
### Overview
|
||||
|
||||
Blitz "Zero-API" data layer (Blitz RPC) is focused on making the communication between server and client seamless. It lets you
|
||||
|
||||
import server code directly into your components instead of having to manually add API endpoints and do client-side fetching and caching.
|
||||
Here's a quick overview:
|
||||
|
||||

|
||||
|
||||
#### Queries and mutations
|
||||
|
||||
Queries and mutations only run on the server — at build time, the direct function import is replaced with an RPC network call. So the query function code is never included in your client code. It's instead moved to an API layer.
|
||||
|
||||
### Framework Support
|
||||
|
||||
Currently Blitz RPC is only supported in Next.js. We are working on adding support for other frameworks.
|
||||
|
||||
### [Setup Blitz RPC in Next.js](https://blitzjs.com/docs/rpc-setup)
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@blitzjs/rpc",
|
||||
"version": "2.0.0-beta.22",
|
||||
"version": "2.0.0-beta.23",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/blitz-js/blitz.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"predev": "wait-on -d 400 ../blitz/dist/index-server.d.ts && wait-on -d 400 ../blitz-auth/dist/index-browser.d.ts",
|
||||
@@ -30,17 +35,17 @@
|
||||
"supports-color": "8.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"next": "*",
|
||||
"react": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/auth": "2.0.0-beta.23",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@types/debug": "4.1.7",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"next": "12.2.5",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {describe, expect, it} from "vitest"
|
||||
import {describe, expect, it, vi} from "vitest"
|
||||
import superJson from "superjson"
|
||||
|
||||
import {getQueryKey, getQueryKeyFromUrlAndParams} from "./react-query-utils"
|
||||
import {getQueryKey, getQueryKeyFromUrlAndParams, validateQueryFn} from "./react-query-utils"
|
||||
import {RpcClient} from "./rpc"
|
||||
|
||||
const API_ENDPOINT = "http://localhost:3000"
|
||||
@@ -74,4 +74,65 @@ describe("react-query-utils", () => {
|
||||
expect(queryKey).toEqual([API_ENDPOINT])
|
||||
})
|
||||
})
|
||||
|
||||
describe("validateQueryFn", () => {
|
||||
const originalEnv = process.env
|
||||
|
||||
function mockEnv() {
|
||||
const originalEnv = process.env
|
||||
|
||||
process.env = {
|
||||
...originalEnv,
|
||||
}
|
||||
|
||||
delete process.env.JEST_WORKER_ID
|
||||
delete process.env.VITEST_WORKER_ID
|
||||
delete process.env.BLITZ_TEST_ENVIRONMENT
|
||||
|
||||
return process.env
|
||||
}
|
||||
|
||||
function restoreEnv() {
|
||||
process.env = originalEnv
|
||||
}
|
||||
|
||||
const notAQuery = vi.fn()
|
||||
const realQuery = vi.fn()
|
||||
//@ts-ignore
|
||||
realQuery._isRpcClient = true
|
||||
|
||||
vi.mock("blitz", async () => {
|
||||
const actualBlitz = await import("blitz")
|
||||
return {
|
||||
...actualBlitz,
|
||||
isClient: true,
|
||||
}
|
||||
})
|
||||
|
||||
describe("when called from test environments", () => {
|
||||
it("always validate as true, allowing query functions to be mocked in tests")
|
||||
const jestEnv = mockEnv()
|
||||
jestEnv.JEST_WORKER_ID = "123"
|
||||
expect(() => validateQueryFn(notAQuery)).not.toThrowError()
|
||||
expect(() => validateQueryFn(realQuery)).not.toThrowError()
|
||||
restoreEnv()
|
||||
|
||||
const vitestEnv = mockEnv()
|
||||
vitestEnv.VITEST_WORKER_ID = "123"
|
||||
expect(() => validateQueryFn(notAQuery)).not.toThrowError()
|
||||
expect(() => validateQueryFn(realQuery)).not.toThrowError()
|
||||
restoreEnv()
|
||||
})
|
||||
|
||||
describe("when called from outside of test environments", () => {
|
||||
it("throws an error when the passed function is not a query function")
|
||||
// removes jest and vitest env vars
|
||||
mockEnv()
|
||||
|
||||
expect(() => validateQueryFn(notAQuery)).toThrowError()
|
||||
expect(() => validateQueryFn(realQuery)).not.toThrowError()
|
||||
|
||||
restoreEnv()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {QueryClient} from "@tanstack/react-query"
|
||||
import {serialize} from "superjson"
|
||||
import {isClient, isServer, AsyncFunc} from "blitz"
|
||||
import {isClient, isServer, AsyncFunc, isNotInUserTestEnvironment} from "blitz"
|
||||
import {ResolverType, RpcClient} from "./rpc"
|
||||
|
||||
export type Resolver<TInput, TResult> = (input: TInput, ctx?: any) => Promise<TResult>
|
||||
@@ -83,13 +83,6 @@ export const emptyQueryFn: RpcClient<unknown, unknown> = (() => {
|
||||
return fn
|
||||
})()
|
||||
|
||||
const isNotInUserTestEnvironment = () => {
|
||||
if (process.env.JEST_WORKER_ID === undefined) return true
|
||||
if (process.env.VITEST_WORKER_ID === undefined) return true
|
||||
if (process.env.BLITZ_TEST_ENVIRONMENT !== undefined) return true
|
||||
return false
|
||||
}
|
||||
|
||||
export const validateQueryFn = <TInput, TResult>(
|
||||
queryFn: Resolver<TInput, TResult> | RpcClient<TInput, TResult>,
|
||||
) => {
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# blitz
|
||||
|
||||
## 2.0.0-beta.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c3c789740: Updates internal functions and tests to support blitz apps that run tests with vitest
|
||||
- Updated dependencies [cb63a0ea5]
|
||||
- Updated dependencies [6ec020c6d]
|
||||
- Updated dependencies [d316d0db7]
|
||||
- Updated dependencies [79c5e86d7]
|
||||
- @blitzjs/generator@2.0.0-beta.23
|
||||
|
||||
## 2.0.0-beta.22
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "blitz",
|
||||
"version": "2.0.0-beta.22",
|
||||
"version": "2.0.0-beta.23",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/blitz-js/blitz.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "rm -rf dist && pnpm run predev && watch unbuild src --wait=0.2",
|
||||
@@ -25,7 +30,7 @@
|
||||
"blitz": "bin/blitz"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/generator": "2.0.0-beta.22",
|
||||
"@blitzjs/generator": "2.0.0-beta.23",
|
||||
"@mrleebo/prisma-ast": "0.2.6",
|
||||
"@types/global-agent": "2.1.1",
|
||||
"arg": "5.0.1",
|
||||
@@ -74,7 +79,7 @@
|
||||
"watchpack": "2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.22",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.23",
|
||||
"@types/cookie": "0.4.1",
|
||||
"@types/cross-spawn": "6.0.2",
|
||||
"@types/debug": "4.1.7",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import _SuperJson from "superjson"
|
||||
import type {UrlObject} from "url"
|
||||
import {isNotInUserTestEnvironment} from "./utils"
|
||||
|
||||
declare module globalThis {
|
||||
let _BLITZ_ERROR_CLASS_REGISTERED: boolean
|
||||
@@ -9,7 +10,7 @@ const SuperJson: typeof _SuperJson =
|
||||
"default" in _SuperJson ? (_SuperJson as any).default : _SuperJson
|
||||
|
||||
const errorProps = ["name", "message", "code", "statusCode", "meta", "url"]
|
||||
if (process.env.JEST_WORKER_ID === undefined) {
|
||||
if (isNotInUserTestEnvironment()) {
|
||||
SuperJson.allowErrorProps(...errorProps)
|
||||
}
|
||||
|
||||
@@ -75,7 +76,7 @@ export class PaginationArgumentError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.JEST_WORKER_ID === undefined && !globalThis._BLITZ_ERROR_CLASS_REGISTERED) {
|
||||
if (isNotInUserTestEnvironment() && !globalThis._BLITZ_ERROR_CLASS_REGISTERED) {
|
||||
SuperJson.registerClass(AuthenticationError, {
|
||||
identifier: "BlitzAuthenticationError",
|
||||
allowProps: errorProps,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {spawn} from "cross-spawn"
|
||||
import which from "npm-which"
|
||||
import {isNotInUserTestEnvironment} from "../index-browser"
|
||||
|
||||
export interface Constructor<T = unknown> {
|
||||
new (...args: never[]): T
|
||||
@@ -19,7 +20,7 @@ export const enhancePrisma = <TPrismaClientCtor extends Constructor>(
|
||||
): EnhancedPrismaClientConstructor<TPrismaClientCtor> => {
|
||||
return new Proxy(client as EnhancedPrismaClientConstructor<TPrismaClientCtor>, {
|
||||
construct(target, args) {
|
||||
if (typeof window !== "undefined" && process.env.JEST_WORKER_ID === undefined) {
|
||||
if (typeof window !== "undefined" && isNotInUserTestEnvironment()) {
|
||||
// Return object with $use method if in the browser
|
||||
// Skip in Jest tests because window is defined in Jest tests
|
||||
return {$use: () => {}}
|
||||
|
||||
@@ -143,3 +143,11 @@ export function interopDefault(mod: any) {
|
||||
export function truncateString(str: string, maxLength: number): string {
|
||||
return str.length > maxLength ? str.substring(0, maxLength - 3) + "..." : str
|
||||
}
|
||||
|
||||
export function isNotInUserTestEnvironment() {
|
||||
if (process.env.VITE_BLITZ_TEST_ENVIRONMENT) {
|
||||
return true
|
||||
}
|
||||
|
||||
return process.env.JEST_WORKER_ID === undefined && process.env.VITEST_WORKER_ID === undefined
|
||||
}
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @blitzjs/codemod
|
||||
|
||||
## 2.0.0-beta.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [cb63a0ea5]
|
||||
- Updated dependencies [6ec020c6d]
|
||||
- Updated dependencies [c3c789740]
|
||||
- Updated dependencies [d316d0db7]
|
||||
- Updated dependencies [79c5e86d7]
|
||||
- @blitzjs/generator@2.0.0-beta.23
|
||||
- blitz@2.0.0-beta.23
|
||||
|
||||
## 2.0.0-beta.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/codemod",
|
||||
"version": "2.0.0-beta.22",
|
||||
"version": "2.0.0-beta.23",
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "watch unbuild src --wait=0.2",
|
||||
@@ -25,9 +25,9 @@
|
||||
"@babel/plugin-proposal-class-properties": "7.17.12",
|
||||
"@babel/plugin-syntax-jsx": "7.17.12",
|
||||
"@babel/plugin-syntax-typescript": "7.17.12",
|
||||
"@blitzjs/generator": "2.0.0-beta.22",
|
||||
"@blitzjs/generator": "2.0.0-beta.23",
|
||||
"arg": "5.0.1",
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"chalk": "^4.1.0",
|
||||
"cross-spawn": "7.0.3",
|
||||
"debug": "4.3.3",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @blitzjs/config
|
||||
|
||||
## 2.0.0-beta.23
|
||||
|
||||
## 2.0.0-beta.22
|
||||
|
||||
## 2.0.0-beta.21
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@blitzjs/config",
|
||||
"private": true,
|
||||
"version": "2.0.0-beta.22",
|
||||
"version": "2.0.0-beta.23",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "5.42.1",
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @blitzjs/generator
|
||||
|
||||
## 2.0.0-beta.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- cb63a0ea5: Guard `blitz g` input via an allow-list of characters; throw if unwanted characters are found. Prevents to break the blitz command by accident (https://github.com/blitz-js/blitz/issues/4021).
|
||||
- 6ec020c6d: Remove useEffect from reset password templates.
|
||||
- d316d0db7: Update all links to follow Next 13 format without a child anchor tag.
|
||||
- 79c5e86d7: Add missing Layout.tsx for generated mimimalapp
|
||||
|
||||
## 2.0.0-beta.22
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
# `generator`
|
||||
[](https://blitzjs.com)
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
<p align="center">
|
||||
<a aria-label="Join our Discord Community" href="https://discord.blitzjs.com">
|
||||
<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-403-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">
|
||||
</a>
|
||||
<a aria-label="NPM version" href="https://www.npmjs.com/package/blitz">
|
||||
<img alt="" src="https://img.shields.io/npm/v/blitz.svg?style=for-the-badge&labelColor=000000&color=E65528">
|
||||
</a>
|
||||
</p>
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<br>
|
||||
|
||||
<h1 align="center">The Missing Fullstack Toolkit for Next.js</h1>
|
||||
|
||||
# Blitz Generator
|
||||
|
||||
## `Generator`
|
||||
|
||||
This package houses all files related to Blitz codegen. In the main `src` directory you'll find the base `generator` class and a directory of `generators` that extend it. The subclasses aren't terribly interesting, most of the fun happens in the abstract parent class. Each generator may (depending on whether it's a net new addition or modifying existing files) have a corresponding template defined in the `templates` directory.
|
||||
|
||||
@@ -33,3 +58,5 @@ if (process.env.someValue === "some test") {
|
||||
console.log("dynamic condition")
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"name": "@blitzjs/generator",
|
||||
"version": "2.0.0-beta.22",
|
||||
"version": "2.0.0-beta.23",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/blitz-js/blitz.git"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "watch unbuild src --wait=0.2",
|
||||
"build": "unbuild && pnpm build:templates",
|
||||
@@ -47,7 +52,7 @@
|
||||
"vinyl": "2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.22",
|
||||
"@blitzjs/config": "2.0.0-beta.23",
|
||||
"@juanm04/cpx": "2.0.1",
|
||||
"@types/babel__core": "7.1.19",
|
||||
"@types/diff": "5.0.2",
|
||||
|
||||
@@ -2,11 +2,12 @@ import * as ast from "@mrleebo/prisma-ast"
|
||||
import {spawn} from "cross-spawn"
|
||||
import which from "npm-which"
|
||||
import path from "path"
|
||||
import {log} from "../utils/log"
|
||||
import {Generator, GeneratorOptions, SourceRootType} from "../generator"
|
||||
import {Field} from "../prisma/field"
|
||||
import {Model} from "../prisma/model"
|
||||
import {checkInputsOrRaise} from "../utils/checkInputOrRaise"
|
||||
import {getTemplateRoot} from "../utils/get-template-root"
|
||||
import {log} from "../utils/log"
|
||||
|
||||
export interface ModelGeneratorOptions extends GeneratorOptions {
|
||||
modelName: string
|
||||
@@ -59,9 +60,13 @@ export class ModelGenerator extends Generator<ModelGeneratorOptions> {
|
||||
const {modelName, extraArgs, dryRun} = this.options
|
||||
let updatedOrCreated = "created"
|
||||
|
||||
let fields = (
|
||||
extraArgs.length === 1 && extraArgs[0]?.includes(" ") ? extraArgs[0]?.split(" ") : extraArgs
|
||||
).flatMap((input) => Field.parse(input, schema))
|
||||
const splitInputCommans = (input: typeof extraArgs) => {
|
||||
const inputs = input.length === 1 && input[0]?.includes(" ") ? input[0]?.split(" ") : input
|
||||
checkInputsOrRaise(inputs)
|
||||
return inputs
|
||||
}
|
||||
|
||||
let fields = splitInputCommans(extraArgs).flatMap((input) => Field.parse(input, schema))
|
||||
|
||||
const modelDefinition = new Model(modelName, fields)
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as ast from "@mrleebo/prisma-ast"
|
||||
import {checkInputsOrRaise} from "../utils/checkInputOrRaise"
|
||||
import {capitalize, singlePascal, uncapitalize} from "../utils/inflector"
|
||||
|
||||
export enum FieldType {
|
||||
@@ -55,6 +56,8 @@ export class Field {
|
||||
|
||||
// 'name:type?[]:attribute' => Field
|
||||
static parse(input: string, schema?: ast.Schema): Field[] {
|
||||
checkInputsOrRaise(input)
|
||||
|
||||
const [_fieldName, _fieldType = "String", _attribute] = input.split(":")
|
||||
let attribute = _attribute as string
|
||||
let fieldName = uncapitalize(_fieldName as string)
|
||||
|
||||
28
packages/generator/src/utils/checkInputOrRaise.ts
Normal file
28
packages/generator/src/utils/checkInputOrRaise.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import chalk from "chalk"
|
||||
import {log} from "./log"
|
||||
|
||||
export const checkInputsOrRaise = (inputs: string[] | string) => {
|
||||
if (typeof inputs === "string") {
|
||||
checkInputOrRaise(inputs)
|
||||
} else {
|
||||
inputs.forEach((input) => checkInputOrRaise(input))
|
||||
}
|
||||
}
|
||||
|
||||
const checkInputOrRaise = (input: string) => {
|
||||
const regex = /^[a-zA-Z0-9-_:=\?[\]\s]+$/
|
||||
if (!regex.test(input)) {
|
||||
const firstInvalidCharacter = input.match(/[^a-zA-Z0-9-_:=\?[\]\s]/)
|
||||
if (firstInvalidCharacter) {
|
||||
log.branded(
|
||||
"Blitz Generator Parser Error: " +
|
||||
chalk.red(
|
||||
`Input contains invalid character: "${firstInvalidCharacter[0]}" in ${firstInvalidCharacter.input} at position ${firstInvalidCharacter.index}`,
|
||||
),
|
||||
)
|
||||
}
|
||||
throw new Error(
|
||||
"Input should only contain alphanumeric characters, spaces, and the following characters: - _ : = ? [ ]",
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
"prisma": "4.6.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"secure-password": "4.0.0",
|
||||
"zod": "3.19.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
"prisma": "4.6.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"secure-password": "4.0.0",
|
||||
"zod": "3.20.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -41,7 +41,7 @@ export const LoginForm = (props: LoginFormProps) => {
|
||||
<LabeledTextField name="password" label="Password" placeholder="Password" type="password" />
|
||||
<div>
|
||||
<Link href={Routes.ForgotPasswordPage()}>
|
||||
<a>Forgot your password?</a>
|
||||
Forgot your password?
|
||||
</Link>
|
||||
</div>
|
||||
</Form>
|
||||
@@ -49,7 +49,7 @@ export const LoginForm = (props: LoginFormProps) => {
|
||||
<div style={{ marginTop: "1rem" }}>
|
||||
Or{" "}
|
||||
<Link href={Routes.SignupPage()}>
|
||||
<a>Sign Up</a>
|
||||
Sign Up
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,14 +10,10 @@ import { useMutation } from "@blitzjs/rpc"
|
||||
import Link from "next/link"
|
||||
|
||||
const ResetPasswordPage: BlitzPage = () => {
|
||||
const [token, setToken] = useState("")
|
||||
const router = useRouter()
|
||||
const token = router.query.token?.toString()
|
||||
const [resetPasswordMutation, { isSuccess }] = useMutation(resetPassword)
|
||||
|
||||
useEffect(() => {
|
||||
setToken(router.query.token as string)
|
||||
}, [router.isReady])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Set a New Password</h1>
|
||||
@@ -40,7 +36,7 @@ const ResetPasswordPage: BlitzPage = () => {
|
||||
}}
|
||||
onSubmit={async (values) => {
|
||||
try {
|
||||
await resetPasswordMutation({...values, token})
|
||||
await resetPasswordMutation({ ...values, token })
|
||||
} catch (error: any) {
|
||||
if (error.name === "ResetPasswordError") {
|
||||
return {
|
||||
|
||||
@@ -61,10 +61,10 @@ const Home: BlitzPage = () => {
|
||||
</div>
|
||||
|
||||
<main className={styles.main}>
|
||||
|
||||
|
||||
<div className={styles.wrapper}>
|
||||
<div className={styles.header}>
|
||||
|
||||
|
||||
<div className={styles.logo}>
|
||||
<svg viewBox="0 0 165 66"><path d="M104.292 56.033C104.292 56.408 104.206 56.6636 104.036 56.8C103.9 56.9363 103.627 57.0045 103.218 57.0045H99.7409C99.4001 57.0045 99.1615 56.9533 99.0251 56.8511C98.8888 56.7147 98.8206 56.4932 98.8206 56.1864L98.9229 19.8324C98.9229 19.3211 99.1444 19.0654 99.5876 19.0654H103.627C103.839 19.0654 104.292 19.0672 104.292 19.0672V19.8324V56.033ZM64.3531 57.0081C64.1145 57.0081 63.927 56.9399 63.7906 56.8035C63.6543 56.6672 63.5861 56.4968 63.5861 56.2922V19.9383C63.5861 19.3588 63.8588 19.069 64.4042 19.069H76.829C81.533 19.069 85.1463 19.9212 87.6687 21.6256C90.1912 23.2958 91.4524 25.7331 91.4524 28.9373C91.4524 30.9484 90.924 32.6528 89.8673 34.0504C88.8106 35.4138 87.1063 36.5217 84.7543 37.3739C84.6179 37.4079 84.5497 37.4932 84.5497 37.6295C84.5497 37.7318 84.6179 37.7999 84.7543 37.834C87.2767 38.5158 89.1686 39.5895 90.4298 41.0553C91.7251 42.521 92.3727 44.4469 92.3727 46.833C92.3727 50.2418 91.0945 52.7983 88.5379 54.5027C85.9814 56.1729 82.2318 57.0081 77.2892 57.0081H64.3531ZM77.5448 35.5843C79.6923 35.5843 81.516 35.1071 83.0158 34.1526C84.5157 33.1982 85.2656 31.6983 85.2656 29.6531C85.2656 27.6079 84.5157 26.0569 83.0158 25.0002C81.5501 23.9435 79.5219 23.4151 76.9313 23.4151H70.5399C70.0286 23.4151 69.7729 23.6367 69.7729 24.0798V34.8684C69.7729 35.3457 69.9604 35.5843 70.3354 35.5843H77.5448ZM77.0335 52.662C82.9647 52.662 85.9303 50.5997 85.9303 46.4751C85.9303 44.3276 85.1633 42.7255 83.6294 41.6688C82.0955 40.6121 80.0673 40.0838 77.5448 40.0838H70.591C70.2843 40.0838 70.0627 40.1349 69.9263 40.2372C69.8241 40.3394 69.7729 40.5099 69.7729 40.7485V51.895C69.7729 52.4063 69.9604 52.662 70.3354 52.662H77.0335ZM142.707 56.8624C142.81 56.9647 142.997 57.0158 143.27 57.0158H163.876C164.387 57.0158 164.643 56.7772 164.643 56.3V53.948V53.3344H163.978H149.866C149.593 53.3344 149.457 53.2492 149.457 53.0788C149.457 52.9765 149.508 52.8572 149.61 52.7208L163.876 33.8536C164.251 33.2741 164.438 32.7628 164.438 32.3197V30.479V29.9144C164.438 29.9144 164.051 29.9165 163.876 29.9165H144.241C143.866 29.9165 143.679 30.121 143.679 30.5301V32.831C143.679 33.1037 143.713 33.2911 143.781 33.3934C143.883 33.4957 144.071 33.5468 144.344 33.5468H157.075C157.382 33.5468 157.535 33.632 157.535 33.8025L157.382 34.1092L143.219 52.9765C142.946 53.3515 142.759 53.6412 142.656 53.8457C142.588 54.0502 142.554 54.3059 142.554 54.6127V56.3C142.554 56.5727 142.605 56.7602 142.707 56.8624ZM116.929 19.0676H111.51V27.7684C114.503 27.7684 116.929 25.3419 116.929 22.3486V19.0676ZM116.926 56.0308C116.926 56.4058 116.841 56.6614 116.67 56.7978C116.534 56.9341 116.278 57.0023 115.903 57.0023H112.427C112.086 57.0023 111.847 56.9512 111.711 56.8489C111.574 56.7126 111.506 56.491 111.506 56.1842V30.6699C111.506 30.3972 111.557 30.2098 111.66 30.1075C111.762 29.9712 111.949 29.903 112.222 29.903H117.028L116.926 56.0308ZM132.183 34.3137C132.183 33.9728 132.336 33.8024 132.643 33.8024H138.779C139.256 33.8024 139.495 33.5979 139.495 33.1888V30.4789V29.9165H138.881H132.745C132.439 29.9165 132.285 29.7631 132.285 29.4563V21.531V20.713L131.621 20.7129H128.093C127.752 20.7129 127.547 20.9515 127.479 21.4288L126.865 29.4563C126.865 29.7631 126.729 29.9165 126.456 29.9165H122.366C121.957 29.9165 121.752 30.1039 121.752 30.4789V33.1888C121.752 33.5979 121.974 33.8024 122.417 33.8024H126.252C126.593 33.8024 126.763 34.0069 126.763 34.416V50.6244C126.763 52.806 127.309 54.4252 128.399 55.4819C129.49 56.5045 131.16 57.0158 133.41 57.0158C135.796 57.0158 137.535 56.9306 138.625 56.7601C139.137 56.6579 139.392 56.3681 139.392 55.8909V53.6923V53.0787H138.779H135.507C134.348 53.0787 133.495 52.806 132.95 52.2606C132.439 51.7152 132.183 50.7267 132.183 49.295V34.3137Z"></path><path d="M0.241243 33.2639H10.9742C15.0585 33.2639 18.9054 35.1835 21.3612 38.4471L31.9483 52.5165C32.1484 52.7824 32.1786 53.1393 32.026 53.435L25.9232 65.2592C25.6304 65.8265 24.8455 65.8932 24.4612 65.3835L0.241243 33.2639Z"></path><path d="M42.4727 33.2822H31.7398C27.6555 33.2822 23.8086 31.3626 21.3528 28.0991L10.7656 14.0297C10.5656 13.7638 10.5354 13.4068 10.688 13.1111L16.7908 1.28696C17.0836 0.719654 17.8684 0.652924 18.2528 1.16266L42.4727 33.2822Z"></path></svg>
|
||||
</div>
|
||||
@@ -173,7 +173,7 @@ const Home: BlitzPage = () => {
|
||||
<span className={styles.arrowIcon} />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
align-self: center;
|
||||
max-width: var(--screen-width);
|
||||
max-width: calc(min(var(--screen-width),800px));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
|
||||
import { expect, vi, test } from "vitest"
|
||||
import { render } from "test/utils"
|
||||
|
||||
|
||||
import Home from "../src/pages/index"
|
||||
|
||||
|
||||
vi.mock("public/logo.png", () => ({
|
||||
default: {src: "/logo.png"}
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
||||
// when you remove the default content from the page
|
||||
|
||||
// This is an example on how to mock api hooks when testing
|
||||
vi.mock("src/users/hooks/useCurrentUser", () => (
|
||||
{
|
||||
@@ -28,10 +28,9 @@
|
||||
})
|
||||
}
|
||||
))
|
||||
|
||||
|
||||
const { getByText } = render(<Home />)
|
||||
const linkElement = getByText(/Documentation/i)
|
||||
const linkElement = getByText(/Blitz Docs/i)
|
||||
expect(linkElement).toBeInTheDocument()
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
align-self: center;
|
||||
max-width: var(--screen-width);
|
||||
max-width: calc(min(var(--screen-width),800px));
|
||||
}
|
||||
|
||||
.globe {
|
||||
|
||||
@@ -31,11 +31,11 @@ export const __ModelName__ = () => {
|
||||
|
||||
<if condition="parentModel">
|
||||
<Link href={Routes.Edit__ModelName__Page({ __parentModelId__: __parentModelId__!, __modelId__: __modelName__.id })}>
|
||||
<a>Edit</a>
|
||||
Edit
|
||||
</Link>
|
||||
<else>
|
||||
<Link href={Routes.Edit__ModelName__Page({ __modelId__: __modelName__.id })}>
|
||||
<a>Edit</a>
|
||||
Edit
|
||||
</Link>
|
||||
</else>
|
||||
</if>
|
||||
@@ -71,11 +71,11 @@ const Show__ModelName__Page = () => {
|
||||
<p>
|
||||
<if condition="parentModel">
|
||||
<Link href={Routes.__ModelNames__Page({ __parentModelId__: __parentModelId__! })}>
|
||||
<a>__ModelNames__</a>
|
||||
__ModelNames__
|
||||
</Link>
|
||||
<else>
|
||||
<Link href={Routes.__ModelNames__Page()}>
|
||||
<a>__ModelNames__</a>
|
||||
__ModelNames__
|
||||
</Link>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
@@ -20,9 +20,9 @@ export const Edit__ModelName__ = () => {
|
||||
const [__modelName__, {setQueryData}] = useQuery(
|
||||
get__ModelName__,
|
||||
{id: __modelId__},
|
||||
{
|
||||
{
|
||||
// This ensures the query never refreshes and overwrites the form data while the user is editing.
|
||||
staleTime: Infinity
|
||||
staleTime: Infinity
|
||||
}
|
||||
)
|
||||
const [update__ModelName__Mutation] = useMutation(update__ModelName__)
|
||||
@@ -83,11 +83,11 @@ const Edit__ModelName__Page = () => {
|
||||
<p>
|
||||
<if condition="parentModel">
|
||||
<Link href={Routes.__ModelNames__Page({ __parentModelId__: __parentModelId__! })}>
|
||||
<a>__ModelNames__</a>
|
||||
__ModelNames__
|
||||
</Link>
|
||||
<else>
|
||||
<Link href={Routes.__ModelNames__Page()}>
|
||||
<a>__ModelNames__</a>
|
||||
__ModelNames__
|
||||
</Link>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
@@ -39,7 +39,7 @@ export const __ModelNames__List = () => {
|
||||
{__modelNames__.map((__modelName__) => (
|
||||
<li key={__modelName__.id}>
|
||||
<Link href={Routes.Show__ModelName__Page({ __modelId__: __modelName__.id })}>
|
||||
<a>{__modelName__.name}</a>
|
||||
{__modelName__.name}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
@@ -70,11 +70,11 @@ export const __ModelNames__List = () => {
|
||||
<li key={__modelName__.id}>
|
||||
<if condition="parentModel">
|
||||
<Link href={Routes.Show__ModelName__Page({ __parentModelId__: __parentModelId__!, __modelId__: __modelName__.id })}>
|
||||
<a>{__modelName__.name}</a>
|
||||
</Link>
|
||||
{__modelName__.name}
|
||||
</Link>
|
||||
<else>
|
||||
<Link href={Routes.Show__ModelName__Page({ __modelId__: __modelName__.id })}>
|
||||
<a>{__modelName__.name}</a>
|
||||
{__modelName__.name}
|
||||
</Link>
|
||||
</else>
|
||||
</if>
|
||||
@@ -108,11 +108,11 @@ const __ModelNames__Page = () => {
|
||||
<p>
|
||||
<if condition="parentModel">
|
||||
<Link href={Routes.New__ModelName__Page({ __parentModelId__: __parentModelId__! })}>
|
||||
<a>Create __ModelName__</a>
|
||||
Create __ModelName__
|
||||
</Link>
|
||||
<else>
|
||||
<Link href={Routes.New__ModelName__Page()}>
|
||||
<a>Create __ModelName__</a>
|
||||
Create __ModelName__
|
||||
</Link>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
@@ -55,11 +55,11 @@ const New__ModelName__Page = () => {
|
||||
<p>
|
||||
<if condition="parentModel">
|
||||
<Link href={Routes.__ModelNames__Page({ __parentModelId__: __parentModelId__! })}>
|
||||
<a>__ModelNames__</a>
|
||||
__ModelNames__
|
||||
</Link>
|
||||
<else>
|
||||
<Link href={Routes.__ModelNames__Page()}>
|
||||
<a>__ModelNames__</a>
|
||||
__ModelNames__
|
||||
</Link>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import {checkInputsOrRaise} from "../../../../generator/src/utils/checkInputOrRaise"
|
||||
import {describe, expect, it} from "vitest"
|
||||
|
||||
describe("checkInputsOrRaise()", () => {
|
||||
describe("with input string", () => {
|
||||
it("does not raise when input string OK", () => {
|
||||
expect(() => checkInputsOrRaise("Foo:foo=bar[]?:-_ ")).not.toThrow()
|
||||
})
|
||||
it("raisees when input has unwanted characters", () => {
|
||||
expect(() => checkInputsOrRaise("()!")).toThrowError(
|
||||
"Input should only contain alphanumeric characters, spaces, and the following characters: - _ : = ? [ ]",
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe("with input string[]", () => {
|
||||
it("does not raise when input strings OK", () => {
|
||||
expect(() => checkInputsOrRaise(["ok:ok=ok", "also ok:ok"])).not.toThrow()
|
||||
})
|
||||
it("raisees when one input has unwanted characters", () => {
|
||||
expect(() => checkInputsOrRaise(["ok:ok=ok", "not ok!"])).toThrowError(
|
||||
"Input should only contain alphanumeric characters, spaces, and the following characters: - _ : = ? [ ]",
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -28,6 +28,14 @@ describe("Field", () => {
|
||||
expect(field?.default).toMatchObject({name: "uuid"})
|
||||
})
|
||||
|
||||
it("disallow brackes `()` as default attribute", () => {
|
||||
expect(() => Field.parse("id:string:default=now()")).toThrow()
|
||||
})
|
||||
|
||||
it("disallow not allowed characters like `!`", () => {
|
||||
expect(() => Field.parse("id:string!")).toThrow()
|
||||
})
|
||||
|
||||
it("handles uuid convenience syntax", () => {
|
||||
const [field] = Field.parse("someSpecialToken:uuid")
|
||||
expect(field?.type).toBe("String")
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"@typescript-eslint/parser": "5.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.22",
|
||||
"@blitzjs/config": "2.0.0-beta.23",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"react": "18.2.0",
|
||||
|
||||
192
pnpm-lock.yaml
generated
192
pnpm-lock.yaml
generated
@@ -51,7 +51,7 @@ importers:
|
||||
"@types/react": 18.0.25
|
||||
"@typescript-eslint/eslint-plugin": 5.42.1
|
||||
"@vitejs/plugin-react": 2.2.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
eslint-config-next: 12.3.1
|
||||
eslint-config-prettier: 8.5.0
|
||||
@@ -129,7 +129,7 @@ importers:
|
||||
"@types/preview-email": 2.0.1
|
||||
"@types/react": 18.0.25
|
||||
"@typescript-eslint/eslint-plugin": 5.42.1
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
eslint-config-next: 12.3.1
|
||||
eslint-config-prettier: 8.5.0
|
||||
@@ -238,9 +238,9 @@ importers:
|
||||
|
||||
integration-tests/auth:
|
||||
specifiers:
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.23
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@next/bundle-analyzer": 12.0.8
|
||||
"@prisma/client": 4.6.0
|
||||
"@types/express": 4.17.13
|
||||
@@ -249,7 +249,7 @@ importers:
|
||||
"@types/node-fetch": 2.6.1
|
||||
"@types/react": 18.0.25
|
||||
b64-lite: 1.4.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
fs-extra: 10.0.1
|
||||
get-port: 6.1.2
|
||||
@@ -289,10 +289,10 @@ importers:
|
||||
|
||||
integration-tests/auth-with-rpc:
|
||||
specifiers:
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.23
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@hookform/error-message": 2.0.0
|
||||
"@hookform/resolvers": 2.9.10
|
||||
"@next/bundle-analyzer": 12.0.8
|
||||
@@ -305,7 +305,7 @@ importers:
|
||||
"@types/react": 18.0.25
|
||||
"@typescript-eslint/eslint-plugin": 5.42.1
|
||||
"@vitejs/plugin-react": 2.2.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
delay: 5.0.0
|
||||
eslint: 8.27.0
|
||||
eslint-config-next: 12.3.1
|
||||
@@ -372,10 +372,10 @@ importers:
|
||||
|
||||
integration-tests/get-initial-props:
|
||||
specifiers:
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.23
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@next/bundle-analyzer": 12.0.8
|
||||
"@prisma/client": 4.6.0
|
||||
"@types/express": 4.17.13
|
||||
@@ -383,7 +383,7 @@ importers:
|
||||
"@types/node-fetch": 2.6.1
|
||||
"@types/react": 18.0.25
|
||||
b64-lite: 1.4.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
fs-extra: 10.0.1
|
||||
get-port: 6.1.2
|
||||
@@ -421,15 +421,15 @@ importers:
|
||||
|
||||
integration-tests/middleware:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@next/bundle-analyzer": 12.0.8
|
||||
"@types/express": 4.17.13
|
||||
"@types/fs-extra": 9.0.13
|
||||
"@types/node-fetch": 2.6.1
|
||||
"@types/react": 18.0.25
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
fs-extra: 10.0.1
|
||||
get-port: 6.1.2
|
||||
@@ -460,10 +460,10 @@ importers:
|
||||
|
||||
integration-tests/no-suspense:
|
||||
specifiers:
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.23
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@next/bundle-analyzer": 12.0.8
|
||||
"@prisma/client": 4.6.0
|
||||
"@types/express": 4.17.13
|
||||
@@ -471,7 +471,7 @@ importers:
|
||||
"@types/node-fetch": 2.6.1
|
||||
"@types/react": 18.0.25
|
||||
b64-lite: 1.4.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
fs-extra: 10.0.1
|
||||
get-port: 6.1.2
|
||||
@@ -509,16 +509,16 @@ importers:
|
||||
|
||||
integration-tests/qm:
|
||||
specifiers:
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.23
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@prisma/client": 4.6.0
|
||||
"@tanstack/react-query": 4.0.10
|
||||
"@testing-library/react": 13.4.0
|
||||
"@types/react": 18.0.25
|
||||
"@vitejs/plugin-react": 1.3.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
delay: 5.0.0
|
||||
eslint: 8.27.0
|
||||
eslint-config-next: latest
|
||||
@@ -547,16 +547,16 @@ importers:
|
||||
"@vitejs/plugin-react": 1.3.0
|
||||
delay: 5.0.0
|
||||
eslint: 8.27.0
|
||||
eslint-config-next: 13.1.1_rmayb2veg2btbq6mbmnyivgasy
|
||||
eslint-config-next: 13.1.6_rmayb2veg2btbq6mbmnyivgasy
|
||||
eslint-plugin-testing-library: 5.0.1_rmayb2veg2btbq6mbmnyivgasy
|
||||
jsdom: 19.0.0
|
||||
typescript: 4.8.4
|
||||
|
||||
integration-tests/react-query-utils:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@next/bundle-analyzer": 12.0.8
|
||||
"@prisma/client": 4.6.0
|
||||
"@types/express": 4.17.13
|
||||
@@ -564,7 +564,7 @@ importers:
|
||||
"@types/node-fetch": 2.6.1
|
||||
"@types/react": 18.0.25
|
||||
b64-lite: 1.4.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
fs-extra: 10.0.1
|
||||
get-port: 6.1.2
|
||||
@@ -601,15 +601,15 @@ importers:
|
||||
|
||||
integration-tests/rpc:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@types/express": 4.17.13
|
||||
"@types/fs-extra": 9.0.13
|
||||
"@types/node-fetch": 2.6.1
|
||||
"@types/react": 18.0.25
|
||||
b64-lite: 1.4.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
fs-extra: 10.0.1
|
||||
next: 12.2.5
|
||||
@@ -636,15 +636,15 @@ importers:
|
||||
|
||||
integration-tests/rpc-path-root:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@types/express": 4.17.13
|
||||
"@types/fs-extra": 9.0.13
|
||||
"@types/node-fetch": 2.6.1
|
||||
"@types/react": 18.0.25
|
||||
b64-lite: 1.4.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
fs-extra: 10.0.1
|
||||
next: 12.2.5
|
||||
@@ -671,10 +671,10 @@ importers:
|
||||
|
||||
integration-tests/trailing-slash:
|
||||
specifiers:
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/next": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.22
|
||||
"@blitzjs/auth": workspace:2.0.0-beta.23
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/next": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": workspace:2.0.0-beta.23
|
||||
"@next/bundle-analyzer": 12.0.8
|
||||
"@prisma/client": 4.6.0
|
||||
"@types/express": 4.17.13
|
||||
@@ -682,7 +682,7 @@ importers:
|
||||
"@types/node-fetch": 2.6.1
|
||||
"@types/react": 18.0.25
|
||||
b64-lite: 1.4.0
|
||||
blitz: workspace:2.0.0-beta.22
|
||||
blitz: workspace:2.0.0-beta.23
|
||||
eslint: 8.27.0
|
||||
fs-extra: 10.0.1
|
||||
get-port: 6.1.2
|
||||
@@ -778,8 +778,8 @@ importers:
|
||||
|
||||
packages/blitz:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/generator": 2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/generator": 2.0.0-beta.23
|
||||
"@mrleebo/prisma-ast": 0.2.6
|
||||
"@types/cookie": 0.4.1
|
||||
"@types/cross-spawn": 6.0.2
|
||||
@@ -927,7 +927,7 @@ importers:
|
||||
|
||||
packages/blitz-auth:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@testing-library/react": 13.4.0
|
||||
"@testing-library/react-hooks": 8.0.1
|
||||
"@types/b64-lite": 1.3.0
|
||||
@@ -941,7 +941,7 @@ importers:
|
||||
"@types/secure-password": 3.1.1
|
||||
b64-lite: 1.4.0
|
||||
bad-behavior: 1.0.1
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
cookie: 0.4.1
|
||||
cookie-session: 2.0.0
|
||||
debug: 4.3.3
|
||||
@@ -973,7 +973,6 @@ importers:
|
||||
nanoid: 3.2.0
|
||||
passport: 0.5.2
|
||||
path: 0.12.7
|
||||
secure-password: 4.0.0
|
||||
supports-color: 8.1.1
|
||||
url: 0.11.0
|
||||
devDependencies:
|
||||
@@ -988,14 +987,15 @@ importers:
|
||||
blitz: link:../blitz
|
||||
react: 18.2.0
|
||||
react-dom: 18.2.0_react@18.2.0
|
||||
secure-password: 4.0.0
|
||||
typescript: 4.8.4
|
||||
unbuild: 0.7.6_supports-color@8.1.1
|
||||
watch: 1.0.2
|
||||
|
||||
packages/blitz-next:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/rpc": 2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@blitzjs/rpc": 2.0.0-beta.23
|
||||
"@tanstack/react-query": 4.0.10
|
||||
"@testing-library/dom": 8.13.0
|
||||
"@testing-library/jest-dom": 5.16.3
|
||||
@@ -1007,7 +1007,7 @@ importers:
|
||||
"@types/react": 18.0.25
|
||||
"@types/react-dom": 17.0.14
|
||||
"@types/testing-library__react-hooks": 4.0.0
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
cross-spawn: 7.0.3
|
||||
debug: 4.3.3
|
||||
find-up: 4.1.0
|
||||
@@ -1057,8 +1057,8 @@ importers:
|
||||
|
||||
packages/blitz-rpc:
|
||||
specifiers:
|
||||
"@blitzjs/auth": 2.0.0-beta.22
|
||||
"@blitzjs/config": workspace:2.0.0-beta.22
|
||||
"@blitzjs/auth": 2.0.0-beta.23
|
||||
"@blitzjs/config": workspace:2.0.0-beta.23
|
||||
"@swc/core": 1.3.7
|
||||
"@tanstack/react-query": 4.0.10
|
||||
"@types/debug": 4.1.7
|
||||
@@ -1066,7 +1066,7 @@ importers:
|
||||
"@types/react-dom": 17.0.14
|
||||
b64-lite: 1.4.0
|
||||
bad-behavior: 1.0.1
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
chalk: ^4.1.0
|
||||
debug: 4.3.3
|
||||
next: 12.2.5
|
||||
@@ -1110,12 +1110,12 @@ importers:
|
||||
"@babel/plugin-syntax-typescript": 7.17.12
|
||||
"@babel/preset-env": 7.12.10
|
||||
"@blitzjs/config": workspace:*
|
||||
"@blitzjs/generator": 2.0.0-beta.22
|
||||
"@blitzjs/generator": 2.0.0-beta.23
|
||||
"@types/jscodeshift": 0.11.2
|
||||
"@types/node": 18.11.9
|
||||
arg: 5.0.1
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
chalk: ^4.1.0
|
||||
cross-spawn: 7.0.3
|
||||
debug: 4.3.3
|
||||
@@ -1170,7 +1170,7 @@ importers:
|
||||
"@babel/plugin-transform-typescript": 7.12.1
|
||||
"@babel/preset-env": 7.12.10
|
||||
"@babel/types": 7.12.10
|
||||
"@blitzjs/config": 2.0.0-beta.22
|
||||
"@blitzjs/config": 2.0.0-beta.23
|
||||
"@juanm04/cpx": 2.0.1
|
||||
"@mrleebo/prisma-ast": 0.4.1
|
||||
"@types/babel__core": 7.1.19
|
||||
@@ -1265,7 +1265,7 @@ importers:
|
||||
|
||||
packages/pkg-template:
|
||||
specifiers:
|
||||
"@blitzjs/config": 2.0.0-beta.22
|
||||
"@blitzjs/config": 2.0.0-beta.23
|
||||
"@types/react": 18.0.25
|
||||
"@types/react-dom": 17.0.14
|
||||
"@typescript-eslint/eslint-plugin": 5.42.1
|
||||
@@ -1289,7 +1289,7 @@ importers:
|
||||
recipes/base-web:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1300,7 +1300,7 @@ importers:
|
||||
recipes/bulma:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1312,7 +1312,7 @@ importers:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1325,7 +1325,7 @@ importers:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1337,7 +1337,7 @@ importers:
|
||||
recipes/emotion:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1347,20 +1347,20 @@ importers:
|
||||
|
||||
recipes/gh-action-yarn-mariadb:
|
||||
specifiers:
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
|
||||
recipes/gh-action-yarn-postgres:
|
||||
specifiers:
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
|
||||
recipes/ghost:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1371,7 +1371,7 @@ importers:
|
||||
recipes/graphql-apollo-server:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
uuid: ^8.3.1
|
||||
dependencies:
|
||||
@@ -1384,7 +1384,7 @@ importers:
|
||||
recipes/logrocket:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1395,7 +1395,7 @@ importers:
|
||||
recipes/material-ui:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1407,7 +1407,7 @@ importers:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1418,13 +1418,13 @@ importers:
|
||||
|
||||
recipes/passenger:
|
||||
specifiers:
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
|
||||
recipes/quirrel:
|
||||
specifiers:
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
|
||||
@@ -1432,7 +1432,7 @@ importers:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1443,14 +1443,14 @@ importers:
|
||||
|
||||
recipes/render:
|
||||
specifiers:
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
|
||||
recipes/secureheaders:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
uuid: ^8.3.1
|
||||
dependencies:
|
||||
@@ -1463,7 +1463,7 @@ importers:
|
||||
recipes/stitches:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1475,7 +1475,7 @@ importers:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1487,7 +1487,7 @@ importers:
|
||||
recipes/tailwind:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1499,7 +1499,7 @@ importers:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -1511,7 +1511,7 @@ importers:
|
||||
recipes/vanilla-extract:
|
||||
specifiers:
|
||||
"@types/jscodeshift": 0.11.2
|
||||
blitz: 2.0.0-beta.22
|
||||
blitz: 2.0.0-beta.23
|
||||
jscodeshift: 0.13.0
|
||||
dependencies:
|
||||
blitz: link:../../packages/blitz
|
||||
@@ -5091,10 +5091,10 @@ packages:
|
||||
dependencies:
|
||||
glob: 7.1.7
|
||||
|
||||
/@next/eslint-plugin-next/13.1.1:
|
||||
/@next/eslint-plugin-next/13.1.6:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-SBrOFS8PC3nQ5aeZmawJkjKkWjwK9RoxvBSv/86nZp0ubdoVQoko8r8htALd9ufp16NhacCdqhu9bzZLDWtALQ==,
|
||||
integrity: sha512-o7cauUYsXjzSJkay8wKjpKJf2uLzlggCsGUkPu3lP09Pv97jYlekTC20KJrjQKmSv5DXV0R/uks2ZXhqjNkqAw==,
|
||||
}
|
||||
dependencies:
|
||||
glob: 7.1.7
|
||||
@@ -10952,10 +10952,10 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/eslint-config-next/13.1.1_rmayb2veg2btbq6mbmnyivgasy:
|
||||
/eslint-config-next/13.1.6_rmayb2veg2btbq6mbmnyivgasy:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-/5S2XGWlGaiqrRhzpn51ux5JUSLwx8PVK2keLi5xk7QmhfYB8PqE6R6SlVw6hgnf/VexvUXSrlNJ/su00NhtHQ==,
|
||||
integrity: sha512-0cg7h5wztg/SoLAlxljZ0ZPUQ7i6QKqRiP4M2+MgTZtxWwNKb2JSwNc18nJ6/kXBI6xYvPraTbQSIhAuVw6czw==,
|
||||
}
|
||||
peerDependencies:
|
||||
eslint: ^7.23.0 || ^8.0.0
|
||||
@@ -10964,7 +10964,7 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
"@next/eslint-plugin-next": 13.1.1
|
||||
"@next/eslint-plugin-next": 13.1.6
|
||||
"@rushstack/eslint-patch": 1.1.3
|
||||
"@typescript-eslint/parser": 5.43.0_rmayb2veg2btbq6mbmnyivgasy
|
||||
eslint: 8.27.0
|
||||
@@ -13976,7 +13976,7 @@ packages:
|
||||
pretty-format: 29.2.1
|
||||
slash: 3.0.0
|
||||
strip-json-comments: 3.1.1
|
||||
ts-node: 10.9.1_cbe7ovvae6zqfnmtgctpgpys54
|
||||
ts-node: 10.9.1_typescript@4.8.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
@@ -15923,7 +15923,7 @@ packages:
|
||||
{
|
||||
integrity: sha512-C40jQ3NzfkP53NsO8kEOFd79p4b9kDXQMwgiY1z8ZwrDZgUyom0AHwGegF4Dm99L+YoYhuaB0ceerUcXmqr1rQ==,
|
||||
}
|
||||
dev: false
|
||||
dev: true
|
||||
|
||||
/nanoid/3.2.0:
|
||||
resolution:
|
||||
@@ -16159,7 +16159,7 @@ packages:
|
||||
integrity: sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==,
|
||||
}
|
||||
hasBin: true
|
||||
dev: false
|
||||
dev: true
|
||||
|
||||
/node-int64/0.4.0:
|
||||
resolution:
|
||||
@@ -18410,7 +18410,7 @@ packages:
|
||||
dependencies:
|
||||
nanoassert: 1.1.0
|
||||
sodium-native: 3.3.0
|
||||
dev: false
|
||||
dev: true
|
||||
|
||||
/selderee/0.6.0:
|
||||
resolution:
|
||||
@@ -18843,7 +18843,7 @@ packages:
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
node-gyp-build: 4.4.0
|
||||
dev: false
|
||||
dev: true
|
||||
|
||||
/source-map-js/1.0.2:
|
||||
resolution:
|
||||
@@ -19754,6 +19754,7 @@ packages:
|
||||
typescript: 4.8.4
|
||||
v8-compile-cache-lib: 3.0.1
|
||||
yn: 3.1.1
|
||||
dev: false
|
||||
|
||||
/ts-node/10.9.1_ieummqxttktzud32hpyrer46t4:
|
||||
resolution:
|
||||
@@ -19820,7 +19821,6 @@ packages:
|
||||
typescript: 4.8.4
|
||||
v8-compile-cache-lib: 3.0.1
|
||||
yn: 3.1.1
|
||||
dev: false
|
||||
|
||||
/tsconfig-paths/3.14.1:
|
||||
resolution:
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22"
|
||||
"blitz": "2.0.0-beta.23"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22"
|
||||
"blitz": "2.0.0-beta.23"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -17,16 +17,14 @@ const GhostIndex: BlitzPage = () => {
|
||||
{featureImage && (
|
||||
<div className="image-card">
|
||||
<Link prefetch={true} href={Routes.GhostPostPage({slug})}>
|
||||
<a>
|
||||
<img loading="lazy" src={featureImage} />
|
||||
</a>
|
||||
<img loading="lazy" src={featureImage} />
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
<b>{title}</b>
|
||||
<p>{custom_excerpt ?? excerpt}</p>
|
||||
<Link prefetch={true} href={Routes.GhostPostPage({slug})}>
|
||||
<a>Read More...</a>
|
||||
Read More...
|
||||
</Link>
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0",
|
||||
"uuid": "^8.3.1"
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22"
|
||||
"blitz": "2.0.0-beta.23"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22"
|
||||
"blitz": "2.0.0-beta.23"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22"
|
||||
"blitz": "2.0.0-beta.23"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0",
|
||||
"uuid": "^8.3.1"
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.22",
|
||||
"blitz": "2.0.0-beta.23",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user