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

Compare commits

...

4 Commits

Author SHA1 Message Date
github-actions[bot]
718a194891 Version Packages (alpha) (#3583)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-22 20:06:49 +02:00
Fran Zekan
0f18c68d63 Fix prefetching, again... (#3578)
Co-authored-by: beerose <alexsandra.sikora@gmail.com>
2022-07-22 18:08:12 +02:00
Aleksandra
3511d5b69b [temporary fix] skip version check until internal issues are resolved (#3584) 2022-07-22 17:05:40 +02:00
Aleksandra
716e188d13 Fix queries/mutations lookup on Windows (#3581) 2022-07-22 16:16:01 +02:00
25 changed files with 122 additions and 60 deletions

View File

@@ -0,0 +1,5 @@
---
"blitz": patch
---
Temporarily skip version check

View File

@@ -65,6 +65,7 @@
"nice-starfishes-live",
"nine-birds-confess",
"nine-onions-admire",
"ninety-lies-press",
"ninety-pets-heal",
"olive-bees-buy",
"olive-feet-rhyme",
@@ -85,6 +86,7 @@
"sharp-falcons-begin",
"shy-olives-hang",
"silent-colts-reply",
"silly-apricots-share",
"slimy-needles-taste",
"slow-walls-poke",
"small-socks-confess",
@@ -93,6 +95,7 @@
"sour-lemons-hunt",
"strong-apes-reply",
"stupid-walls-sell",
"sweet-kiwis-cross",
"swift-drinks-dress",
"tall-meals-learn",
"tame-keys-reply",

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/next": patch
---
Avoid reassigning queryClient in prefetch methods

View File

@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": patch
---
Fix queries/mutations lookup on Windows

View File

@@ -2,7 +2,7 @@
"name": "toolkit-app",
"version": "1.0.1-alpha.16",
"scripts": {
"start:dev": "pnpm run prisma:start && next dev",
"start:dev": "pnpm run prisma:start && blitz dev",
"buildapp": "NODE_ENV=production pnpm blitz codegen && pnpm prisma generate && next build",
"start": "next start",
"lint": "next lint",
@@ -29,7 +29,7 @@
"@blitzjs/rpc": "workspace:*",
"@hookform/resolvers": "2.8.8",
"@prisma/client": "3.9.0",
"blitz": "workspace:2.0.0-alpha.56",
"blitz": "workspace:2.0.0-alpha.57",
"next": "12.2.0",
"prisma": "4.0.0",
"react": "18.0.0",

View File

@@ -1,5 +1,12 @@
# @blitzjs/auth
## 2.0.0-alpha.57
### Patch Changes
- Updated dependencies [3511d5b6]
- blitz@2.0.0-alpha.57
## 2.0.0-alpha.56
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/auth",
"version": "2.0.0-alpha.56",
"version": "2.0.0-alpha.57",
"scripts": {
"build": "unbuild",
"predev": "wait-on -d 250 ../blitz/dist/index-server.d.ts",
@@ -26,7 +26,7 @@
"@types/secure-password": "3.1.1",
"b64-lite": "1.4.0",
"bad-behavior": "1.0.1",
"blitz": "2.0.0-alpha.56",
"blitz": "2.0.0-alpha.57",
"cookie": "0.4.1",
"cookie-session": "2.0.0",
"debug": "4.3.3",
@@ -39,7 +39,7 @@
"url": "0.11.0"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.56",
"@blitzjs/config": "workspace:2.0.0-alpha.57",
"@testing-library/react": "13.0.0",
"@testing-library/react-hooks": "7.0.2",
"@types/cookie": "0.4.1",

View File

@@ -1,5 +1,13 @@
# @blitzjs/next
## 2.0.0-alpha.57
### Patch Changes
- 0f18c68d: Avoid reassigning queryClient in prefetch methods
- Updated dependencies [716e188d]
- @blitzjs/rpc@2.0.0-alpha.57
## 2.0.0-alpha.56
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/next",
"version": "2.0.0-alpha.56",
"version": "2.0.0-alpha.57",
"scripts": {
"build": "unbuild",
"dev": "pnpm predev && pnpm watch unbuild src --wait=0.2",
@@ -24,7 +24,7 @@
"eslint.js"
],
"dependencies": {
"@blitzjs/rpc": "2.0.0-alpha.56",
"@blitzjs/rpc": "2.0.0-alpha.57",
"@types/hoist-non-react-statics": "3.3.1",
"debug": "4.3.3",
"fs-extra": "10.0.1",
@@ -33,7 +33,7 @@
"superjson": "1.8.0"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.56",
"@blitzjs/config": "workspace:2.0.0-alpha.57",
"@testing-library/dom": "8.13.0",
"@testing-library/jest-dom": "5.16.3",
"@testing-library/react": "13.0.0",
@@ -43,7 +43,7 @@
"@types/react": "18.0.1",
"@types/react-dom": "17.0.14",
"@types/testing-library__react-hooks": "4.0.0",
"blitz": "2.0.0-alpha.56",
"blitz": "2.0.0-alpha.57",
"cross-spawn": "7.0.3",
"find-up": "4.1.0",
"next": "12.2.0",

View File

@@ -83,13 +83,13 @@ export type BlitzAPIHandler = (
const prefetchQueryFactory = (
ctx: BlitzCtx,
): {
queryClient: QueryClient | null
getClient: () => QueryClient | null
prefetchQuery: AddParameters<PrefetchQueryFn, [boolean?]>
} => {
let queryClient: null | QueryClient = null
return {
queryClient,
getClient: () => queryClient,
prefetchQuery: async (fn, input, defaultOptions = {}, infinite = false) => {
if (!queryClient) {
queryClient = new QueryClient({defaultOptions})
@@ -116,14 +116,14 @@ export const setupBlitzServer = ({plugins, onError}: SetupBlitzOptions) => {
(res as MiddlewareResponse).blitzCtx,
)
const {queryClient, prefetchQuery} = prefetchQueryFactory(ctx)
const {getClient, prefetchQuery} = prefetchQueryFactory(ctx)
ctx.prefetchQuery = prefetchQuery
ctx.prefetchInfiniteQuery = (...args) => prefetchQuery(...args, true)
try {
const result = await handler({req, res, ctx, ...rest})
return withSuperJsonProps(withDehydratedState(result, queryClient))
return withSuperJsonProps(withDehydratedState(result, getClient()))
} catch (err: any) {
onError?.(err)
throw err
@@ -136,14 +136,14 @@ export const setupBlitzServer = ({plugins, onError}: SetupBlitzOptions) => {
): GetStaticProps<TProps, Query, PD> =>
async (context) => {
const ctx = contextMiddleware.reduceRight((y, f) => (f ? f(y) : y), {} as Ctx)
const {queryClient, prefetchQuery} = prefetchQueryFactory(ctx)
const {getClient, prefetchQuery} = prefetchQueryFactory(ctx)
ctx.prefetchQuery = prefetchQuery
ctx.prefetchInfiniteQuery = (...args) => prefetchQuery(...args, true)
try {
const result = await handler({...context, ctx: ctx})
return withSuperJsonProps(withDehydratedState(result, queryClient))
return withSuperJsonProps(withDehydratedState(result, getClient()))
} catch (err: any) {
onError?.(err)
throw err

View File

@@ -1,5 +1,14 @@
# @blitzjs/rpc
## 2.0.0-alpha.57
### Patch Changes
- 716e188d: Fix queries/mutations lookup on Windows
- Updated dependencies [3511d5b6]
- blitz@2.0.0-alpha.57
- @blitzjs/auth@2.0.0-alpha.57
## 2.0.0-alpha.56
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/rpc",
"version": "2.0.0-alpha.56",
"version": "2.0.0-alpha.57",
"scripts": {
"build": "unbuild",
"predev": "wait-on -d 250 ../blitz/dist/index-server.d.ts && wait-on -d 250 ../blitz-auth/dist/index-browser.d.ts",
@@ -20,7 +20,7 @@
"dist/**"
],
"dependencies": {
"@blitzjs/auth": "2.0.0-alpha.56",
"@blitzjs/auth": "2.0.0-alpha.57",
"b64-lite": "1.4.0",
"bad-behavior": "1.0.1",
"chalk": "^4.1.0",
@@ -30,11 +30,11 @@
"zod": "3.17.3"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.56",
"@blitzjs/config": "workspace:2.0.0-alpha.57",
"@types/debug": "4.1.7",
"@types/react": "18.0.1",
"@types/react-dom": "17.0.14",
"blitz": "2.0.0-alpha.56",
"blitz": "2.0.0-alpha.57",
"next": "12.2.0",
"react": "18.0.0",
"react-dom": "18.0.0",
@@ -43,7 +43,7 @@
"watch": "1.0.2"
},
"peerDependencies": {
"blitz": "2.0.0-alpha.56",
"blitz": "2.0.0-alpha.57",
"next": ">=12.2.0"
},
"publishConfig": {

View File

@@ -80,7 +80,7 @@ export function installWebpackConfig({
webpackRuleOptions,
}: InstallWebpackConfigOptions) {
webpackConfig.module.rules.push({
test: /\/\[\[\.\.\.blitz]]\.[jt]s$/,
test: /[\\/]\[\[\.\.\.blitz]]\.[jt]sx?$/,
use: [
{
loader: loaderServer,
@@ -146,10 +146,10 @@ export function rpcHandler(config: RpcConfig) {
"It seems your Blitz RPC endpoint file is not named [[...blitz]].(jt)s. Please ensure it is",
)
const relativeRoutePath = req.query.blitz.join("/")
const relativeRoutePath = (req.query.blitz as string[])?.join("/")
const routePath = "/" + relativeRoutePath
const loadableResolver = resolverMap[routePath]
const loadableResolver = resolverMap?.[routePath]
if (!loadableResolver) {
throw new Error("No resolver for path: " + routePath)
}

View File

@@ -1,4 +1,4 @@
import {dirname, join, posix} from "path"
import {dirname, join, posix, relative} from "path"
import {promises} from "fs"
import {
assertPosixPath,
@@ -37,6 +37,10 @@ export async function loader(this: Loader, input: string): Promise<string> {
module.exports = loader
function slash(str: string) {
return str.replace(/\\/g, "/")
}
export async function transformBlitzRpcServer(
src: string,
id: string,
@@ -54,7 +58,7 @@ export async function transformBlitzRpcServer(
code += "\n\n"
for (let resolverFilePath of resolvers) {
const relativeResolverPath = posix.relative(dirname(id), join(root, resolverFilePath))
const relativeResolverPath = slash(relative(dirname(id), join(root, resolverFilePath)))
const routePath = convertPageFilePathToRoutePath(resolverFilePath, options?.resolverPath)
code += `__internal_addBlitzRpcResolver('${routePath}', () => import('${relativeResolverPath}'));`
code += "\n"

View File

@@ -1,5 +1,12 @@
# blitz
## 2.0.0-alpha.57
### Patch Changes
- 3511d5b6: Temporarily skip version check
- @blitzjs/generator@2.0.0-alpha.57
## 2.0.0-alpha.56
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "blitz",
"version": "2.0.0-alpha.56",
"version": "2.0.0-alpha.57",
"scripts": {
"build": "unbuild",
"dev": "watch unbuild src --wait=0.2",
@@ -23,7 +23,7 @@
"blitz": "bin/blitz"
},
"dependencies": {
"@blitzjs/generator": "2.0.0-alpha.56",
"@blitzjs/generator": "2.0.0-alpha.57",
"arg": "5.0.1",
"boxen": "7.0.0",
"chalk": "^4.1.0",
@@ -54,7 +54,7 @@
"watchpack": "2.1.1"
},
"devDependencies": {
"@blitzjs/config": "workspace:2.0.0-alpha.56",
"@blitzjs/config": "workspace:2.0.0-alpha.57",
"@types/cookie": "0.4.1",
"@types/cross-spawn": "6.0.2",
"@types/debug": "4.1.7",

View File

@@ -219,7 +219,7 @@ const determinePkgManagerToInstallDeps = async () => {
}
const newApp: CliCommand = async (argv) => {
const shouldUpgrade = !args["--skip-upgrade"]
const shouldUpgrade = false // !args["--skip-upgrade"]
if (shouldUpgrade) {
await checkLatestVersion()
}

View File

@@ -1,5 +1,13 @@
# @blitzjs/codemod
## 2.0.0-alpha.57
### Patch Changes
- Updated dependencies [3511d5b6]
- blitz@2.0.0-alpha.57
- @blitzjs/generator@2.0.0-alpha.57
## 2.0.0-alpha.56
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/codemod",
"version": "2.0.0-alpha.56",
"version": "2.0.0-alpha.57",
"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-alpha.56",
"@blitzjs/generator": "2.0.0-alpha.57",
"arg": "5.0.1",
"blitz": "2.0.0-alpha.56",
"blitz": "2.0.0-alpha.57",
"chalk": "^4.1.0",
"cross-spawn": "7.0.3",
"debug": "4.3.3",

View File

@@ -1,5 +1,7 @@
# @blitzjs/config
## 2.0.0-alpha.57
## 2.0.0-alpha.56
## 2.0.0-alpha.55

View File

@@ -1,7 +1,7 @@
{
"name": "@blitzjs/config",
"private": true,
"version": "2.0.0-alpha.56",
"version": "2.0.0-alpha.57",
"license": "MIT",
"dependencies": {
"@typescript-eslint/eslint-plugin": "5.9.1",

View File

@@ -1,5 +1,7 @@
# @blitzjs/generator
## 2.0.0-alpha.57
## 2.0.0-alpha.56
## 2.0.0-alpha.55

View File

@@ -1,6 +1,6 @@
{
"name": "@blitzjs/generator",
"version": "2.0.0-alpha.56",
"version": "2.0.0-alpha.57",
"scripts": {
"dev": "watch unbuild src --wait=0.2",
"build": "unbuild && pnpm build:templates",
@@ -45,7 +45,7 @@
"vinyl": "2.2.1"
},
"devDependencies": {
"@blitzjs/config": "2.0.0-alpha.56",
"@blitzjs/config": "2.0.0-alpha.57",
"@juanm04/cpx": "2.0.1",
"@types/babel__core": "7.1.19",
"@types/diff": "5.0.2",

View File

@@ -25,7 +25,7 @@
"@typescript-eslint/parser": "5.9.1"
},
"devDependencies": {
"@blitzjs/config": "2.0.0-alpha.56",
"@blitzjs/config": "2.0.0-alpha.57",
"@types/react": "18.0.1",
"@types/react-dom": "17.0.14",
"react": "18.0.0",

45
pnpm-lock.yaml generated
View File

@@ -49,7 +49,7 @@ importers:
"@types/preview-email": 2.0.1
"@types/react": 18.0.1
"@typescript-eslint/eslint-plugin": 5.9.1
blitz: workspace:2.0.0-alpha.55
blitz: workspace:2.0.0-alpha.56
eslint: 7.32.0
eslint-config-next: 12.2.0
eslint-config-prettier: 8.5.0
@@ -324,7 +324,7 @@ importers:
"@vitejs/plugin-react": 1.3.0
delay: 5.0.0
eslint: 7.32.0
eslint-config-next: 12.2.2_hrkuebk64jiu2ut2d2sm4oylnu
eslint-config-next: 12.2.3_hrkuebk64jiu2ut2d2sm4oylnu
eslint-plugin-testing-library: 5.0.1_hrkuebk64jiu2ut2d2sm4oylnu
jsdom: 19.0.0
typescript: 4.6.3
@@ -475,8 +475,8 @@ importers:
packages/blitz:
specifiers:
"@blitzjs/config": workspace:2.0.0-alpha.55
"@blitzjs/generator": 2.0.0-alpha.55
"@blitzjs/config": workspace:2.0.0-alpha.56
"@blitzjs/generator": 2.0.0-alpha.56
"@types/cookie": 0.4.1
"@types/cross-spawn": 6.0.2
"@types/debug": 4.1.7
@@ -584,7 +584,7 @@ importers:
packages/blitz-auth:
specifiers:
"@blitzjs/config": workspace:2.0.0-alpha.55
"@blitzjs/config": workspace:2.0.0-alpha.56
"@testing-library/react": 13.0.0
"@testing-library/react-hooks": 7.0.2
"@types/b64-lite": 1.3.0
@@ -598,7 +598,7 @@ importers:
"@types/secure-password": 3.1.1
b64-lite: 1.4.0
bad-behavior: 1.0.1
blitz: 2.0.0-alpha.55
blitz: 2.0.0-alpha.56
cookie: 0.4.1
cookie-session: 2.0.0
debug: 4.3.3
@@ -649,8 +649,8 @@ importers:
packages/blitz-next:
specifiers:
"@blitzjs/config": workspace:2.0.0-alpha.55
"@blitzjs/rpc": 2.0.0-alpha.55
"@blitzjs/config": workspace:2.0.0-alpha.56
"@blitzjs/rpc": 2.0.0-alpha.56
"@testing-library/dom": 8.13.0
"@testing-library/jest-dom": 5.16.3
"@testing-library/react": 13.0.0
@@ -661,7 +661,7 @@ importers:
"@types/react": 18.0.1
"@types/react-dom": 17.0.14
"@types/testing-library__react-hooks": 4.0.0
blitz: 2.0.0-alpha.55
blitz: 2.0.0-alpha.56
cross-spawn: 7.0.3
debug: 4.3.3
find-up: 4.1.0
@@ -710,14 +710,14 @@ importers:
packages/blitz-rpc:
specifiers:
"@blitzjs/auth": 2.0.0-alpha.55
"@blitzjs/config": workspace:2.0.0-alpha.55
"@blitzjs/auth": 2.0.0-alpha.56
"@blitzjs/config": workspace:2.0.0-alpha.56
"@types/debug": 4.1.7
"@types/react": 18.0.1
"@types/react-dom": 17.0.14
b64-lite: 1.4.0
bad-behavior: 1.0.1
blitz: 2.0.0-alpha.55
blitz: 2.0.0-alpha.56
chalk: ^4.1.0
debug: 4.3.3
next: 12.2.0
@@ -759,12 +759,12 @@ importers:
"@babel/plugin-syntax-typescript": 7.17.12
"@babel/preset-env": 7.12.10
"@blitzjs/config": workspace:*
"@blitzjs/generator": 2.0.0-alpha.55
"@blitzjs/generator": 2.0.0-alpha.56
"@types/jscodeshift": 0.11.2
"@types/node": 17.0.16
arg: 5.0.1
ast-types: 0.14.2
blitz: 2.0.0-alpha.55
blitz: 2.0.0-alpha.56
chalk: ^4.1.0
cross-spawn: 7.0.3
debug: 4.3.3
@@ -819,7 +819,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-alpha.55
"@blitzjs/config": 2.0.0-alpha.56
"@juanm04/cpx": 2.0.1
"@mrleebo/prisma-ast": 0.2.6
"@types/babel__core": 7.1.19
@@ -910,7 +910,7 @@ importers:
packages/pkg-template:
specifiers:
"@blitzjs/config": 2.0.0-alpha.55
"@blitzjs/config": 2.0.0-alpha.56
"@types/react": 18.0.1
"@types/react-dom": 17.0.14
"@typescript-eslint/eslint-plugin": 5.9.1
@@ -3451,10 +3451,10 @@ packages:
dependencies:
glob: 7.1.7
/@next/eslint-plugin-next/12.2.2:
/@next/eslint-plugin-next/12.2.3:
resolution:
{
integrity: sha512-XOi0WzJhGH3Lk51SkSu9eZxF+IY1ZZhWcJTIGBycAbWU877IQa6+6KxMATWCOs7c+bmp6Sd8KywXJaDRxzu0JA==,
integrity: sha512-B2e8Yg1MpuLsGxhCx4rU8/Tcnr5wFmCx1O2eyLXBPnaCcsFXfGCo067ujagtDLtWASL3GNgzg78U1SB0dbc38A==,
}
dependencies:
glob: 7.1.7
@@ -4844,7 +4844,6 @@ packages:
typescript: 4.6.3
transitivePeerDependencies:
- supports-color
dev: false
/@typescript-eslint/experimental-utils/5.28.0_hrkuebk64jiu2ut2d2sm4oylnu:
resolution:
@@ -8442,12 +8441,11 @@ packages:
transitivePeerDependencies:
- eslint-import-resolver-webpack
- supports-color
dev: false
/eslint-config-next/12.2.2_hrkuebk64jiu2ut2d2sm4oylnu:
/eslint-config-next/12.2.3_hrkuebk64jiu2ut2d2sm4oylnu:
resolution:
{
integrity: sha512-oJhWBLC4wDYYUFv/5APbjHUFd0QRFCojMdj/QnMoOEktmeTvwnnoA8F8uaXs0fQgsaTK0tbUxBRv9/Y4/rpxOA==,
integrity: sha512-xAQqAqwa2bu9ZMRypz58ym4tNCo22Wc6LuoLpbpf3yW5c4ZkVib9934AgGDDvh2zKrP56Z6X0Pp6gNnuuZzcRw==,
}
peerDependencies:
eslint: ^7.23.0 || ^8.0.0
@@ -8456,7 +8454,7 @@ packages:
typescript:
optional: true
dependencies:
"@next/eslint-plugin-next": 12.2.2
"@next/eslint-plugin-next": 12.2.3
"@rushstack/eslint-patch": 1.1.3
"@typescript-eslint/parser": 5.28.0_hrkuebk64jiu2ut2d2sm4oylnu
eslint: 7.32.0
@@ -8480,7 +8478,6 @@ packages:
hasBin: true
peerDependencies:
eslint: ">=7.0.0"
dev: false
/eslint-config-prettier/8.5.0_eslint@7.32.0:
resolution: