Compare commits
22 Commits
@blitzjs/a
...
@blitzjs/c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
891d91bf4d | ||
|
|
f96c953457 | ||
|
|
a80d2a8f77 | ||
|
|
b336ad05f4 | ||
|
|
39ca0ef8bf | ||
|
|
4cad9cca25 | ||
|
|
b6fc940bf2 | ||
|
|
a946dd5889 | ||
|
|
e3750b049d | ||
|
|
fb01cc7788 | ||
|
|
ac8c412da2 | ||
|
|
dfd2408e95 | ||
|
|
9741287050 | ||
|
|
0e9c81abdc | ||
|
|
9e05d6e155 | ||
|
|
17f70e65ef | ||
|
|
0ddc5a8169 | ||
|
|
e6fb09d494 | ||
|
|
d846fc6be9 | ||
|
|
f5e80e3835 | ||
|
|
17ce29e5e4 | ||
|
|
46d9f81adf |
5
.changeset/bright-mangos-run.md
Normal file
5
.changeset/bright-mangos-run.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Add queryClient to RPC Plugin exports
|
||||
6
.changeset/eleven-humans-sort.md
Normal file
6
.changeset/eleven-humans-sort.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
codemod fixes
|
||||
5
.changeset/gentle-dogs-reply.md
Normal file
5
.changeset/gentle-dogs-reply.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Update queryClient import in codemod
|
||||
5
.changeset/green-papayas-do.md
Normal file
5
.changeset/green-papayas-do.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Update codemod and template with a new queryClient import location
|
||||
7
.changeset/lucky-cows-try.md
Normal file
7
.changeset/lucky-cows-try.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/auth": patch
|
||||
"@blitzjs/next": patch
|
||||
---
|
||||
|
||||
rename middleware type for blitz server plugin
|
||||
5
.changeset/olive-bees-buy.md
Normal file
5
.changeset/olive-bees-buy.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Fix templates source in RPC codemod step
|
||||
@@ -22,23 +22,29 @@
|
||||
"changesets": [
|
||||
"big-phones-bow",
|
||||
"breezy-cameras-double",
|
||||
"bright-mangos-run",
|
||||
"cool-doors-invent",
|
||||
"dirty-monkeys-greet",
|
||||
"eleven-humans-sort",
|
||||
"empty-berries-rule",
|
||||
"fair-wombats-sneeze",
|
||||
"famous-kings-explain",
|
||||
"fast-trainers-kneel",
|
||||
"flat-bees-approve",
|
||||
"four-meals-fry",
|
||||
"gentle-dogs-reply",
|
||||
"great-months-train",
|
||||
"green-papayas-do",
|
||||
"healthy-rice-shout",
|
||||
"hot-drinks-approve",
|
||||
"lovely-colts-share",
|
||||
"lucky-cows-try",
|
||||
"modern-cameras-pull",
|
||||
"moody-squids-cheer",
|
||||
"nice-starfishes-live",
|
||||
"nine-onions-admire",
|
||||
"ninety-pets-heal",
|
||||
"olive-bees-buy",
|
||||
"olive-feet-rhyme",
|
||||
"plenty-bottles-swim",
|
||||
"poor-peas-lick",
|
||||
@@ -47,6 +53,7 @@
|
||||
"quiet-feet-travel",
|
||||
"rich-chairs-invent",
|
||||
"sharp-falcons-begin",
|
||||
"shy-olives-hang",
|
||||
"silent-colts-reply",
|
||||
"small-socks-confess",
|
||||
"stupid-walls-sell",
|
||||
@@ -54,10 +61,13 @@
|
||||
"tasty-news-collect",
|
||||
"ten-rivers-burn",
|
||||
"tender-pianos-check",
|
||||
"thick-parrots-float",
|
||||
"thirty-countries-build",
|
||||
"twenty-beans-pump",
|
||||
"two-kiwis-help",
|
||||
"unlucky-papayas-sleep",
|
||||
"violet-bags-leave",
|
||||
"violet-lions-help",
|
||||
"weak-suns-shave",
|
||||
"wicked-ghosts-cough",
|
||||
"wise-frogs-give"
|
||||
|
||||
6
.changeset/shy-olives-hang.md
Normal file
6
.changeset/shy-olives-hang.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Update RPC plugin setup in templates
|
||||
5
.changeset/thick-parrots-float.md
Normal file
5
.changeset/thick-parrots-float.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
allow extension catch in getAllFiles codemod util
|
||||
5
.changeset/violet-bags-leave.md
Normal file
5
.changeset/violet-bags-leave.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/codemod": patch
|
||||
---
|
||||
|
||||
Update templates directory for codemod
|
||||
5
.changeset/violet-lions-help.md
Normal file
5
.changeset/violet-lions-help.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
---
|
||||
|
||||
Add resolverBasePath to Blitz config to change the way rpc routes are generated
|
||||
1
.npmrc
1
.npmrc
@@ -6,3 +6,4 @@ public-hoist-pattern[]=*types*
|
||||
public-hoist-pattern[]=*eslint*
|
||||
public-hoist-pattern[]=@prettier/plugin-*
|
||||
public-hoist-pattern[]=*prettier-plugin-*
|
||||
strict-peer-dependencies=false
|
||||
|
||||
@@ -2,17 +2,11 @@ import { AuthClientPlugin } from "@blitzjs/auth"
|
||||
import { setupBlitzClient } from "@blitzjs/next"
|
||||
import { BlitzRpcPlugin } from "@blitzjs/rpc"
|
||||
|
||||
export const { withBlitz } = setupBlitzClient({
|
||||
export const { withBlitz, queryClient } = setupBlitzClient({
|
||||
plugins: [
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "web-cookie-prefix",
|
||||
}),
|
||||
BlitzRpcPlugin({
|
||||
reactQueryOptions: {
|
||||
queries: {
|
||||
staleTime: 7000,
|
||||
},
|
||||
},
|
||||
}),
|
||||
BlitzRpcPlugin({}),
|
||||
],
|
||||
})
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@hookform/resolvers": "2.8.8",
|
||||
"@prisma/client": "3.9.0",
|
||||
"blitz": "workspace:2.0.0-alpha.30",
|
||||
"blitz": "workspace:2.0.0-alpha.37",
|
||||
"next": "12.1.6-canary.17",
|
||||
"prisma": "3.9.0",
|
||||
"react": "18.0.0",
|
||||
|
||||
@@ -2,7 +2,7 @@ import {AuthClientPlugin} from "@blitzjs/auth"
|
||||
import {setupBlitzClient} from "@blitzjs/next"
|
||||
import {BlitzRpcPlugin} from "@blitzjs/rpc"
|
||||
|
||||
const {withBlitz} = setupBlitzClient({
|
||||
const {withBlitz, queryClient} = setupBlitzClient({
|
||||
plugins: [
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "webapp-cookie-prefix",
|
||||
@@ -17,4 +17,4 @@ const {withBlitz} = setupBlitzClient({
|
||||
],
|
||||
})
|
||||
|
||||
export {withBlitz}
|
||||
export {withBlitz, queryClient}
|
||||
|
||||
@@ -10,6 +10,7 @@ module.exports = withBlitz(
|
||||
customServer: {
|
||||
hotReload: false,
|
||||
},
|
||||
resolverBasePath: "root",
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -7,13 +7,7 @@ const {withBlitz} = setupBlitzClient({
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "no-suspense-tests-cookie-prefix",
|
||||
}),
|
||||
BlitzRpcPlugin({
|
||||
reactQueryOptions: {
|
||||
queries: {
|
||||
staleTime: 7000,
|
||||
},
|
||||
},
|
||||
}),
|
||||
BlitzRpcPlugin({}),
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
@@ -7,13 +7,7 @@ const {withBlitz} = setupBlitzClient({
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "trailing-slash-tests-cookie-prefix",
|
||||
}),
|
||||
BlitzRpcPlugin({
|
||||
reactQueryOptions: {
|
||||
queries: {
|
||||
staleTime: 7000,
|
||||
},
|
||||
},
|
||||
}),
|
||||
BlitzRpcPlugin({}),
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
@@ -80,21 +80,7 @@ const BlitzWrapper = ({plugins, children}) => {
|
||||
export function render(ui: RenderUI, {wrapper, router, ...options}: RenderOptions = {}) {
|
||||
if (!wrapper) {
|
||||
wrapper = ({children}) => {
|
||||
return (
|
||||
<BlitzWrapper
|
||||
plugins={[
|
||||
BlitzRpcPlugin({
|
||||
reactQueryOptions: {
|
||||
queries: {
|
||||
staleTime: 7000,
|
||||
},
|
||||
},
|
||||
}),
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</BlitzWrapper>
|
||||
)
|
||||
return <BlitzWrapper plugins={[BlitzRpcPlugin({})]}>{children}</BlitzWrapper>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,49 @@
|
||||
# @blitzjs/auth
|
||||
|
||||
## 2.0.0-alpha.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- a80d2a8f: rename middleware type for blitz server plugin
|
||||
- Updated dependencies [a80d2a8f]
|
||||
- blitz@2.0.0-alpha.37
|
||||
|
||||
## 2.0.0-alpha.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.36
|
||||
|
||||
## 2.0.0-alpha.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.35
|
||||
|
||||
## 2.0.0-alpha.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.34
|
||||
|
||||
## 2.0.0-alpha.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.33
|
||||
|
||||
## 2.0.0-alpha.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.32
|
||||
|
||||
## 2.0.0-alpha.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.31
|
||||
|
||||
## 2.0.0-alpha.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/auth",
|
||||
"version": "2.0.0-alpha.30",
|
||||
"version": "2.0.0-alpha.37",
|
||||
"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.30",
|
||||
"blitz": "2.0.0-alpha.37",
|
||||
"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.30",
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.37",
|
||||
"@testing-library/react": "13.0.0",
|
||||
"@testing-library/react-hooks": "7.0.2",
|
||||
"@types/cookie": "0.4.1",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type {BlitzServerPlugin, Middleware, Ctx} from "blitz"
|
||||
import type {BlitzServerPlugin, RequestMiddleware, Ctx} from "blitz"
|
||||
import {assert} from "blitz"
|
||||
import {IncomingMessage, ServerResponse} from "http"
|
||||
import {PublicData, SessionModel, SessionConfigMethods} from "../shared/types"
|
||||
@@ -101,7 +101,7 @@ export function AuthServerPlugin(options: AuthPluginOptions): BlitzServerPlugin<
|
||||
`The cookie prefix used has invalid characters. Only alphanumeric characters, "-" and "_" character are supported`,
|
||||
)
|
||||
|
||||
const blitzSessionMiddleware: Middleware<
|
||||
const blitzSessionMiddleware: RequestMiddleware<
|
||||
IncomingMessage,
|
||||
ServerResponse & {blitzCtx: Ctx}
|
||||
> = async (req, res, next) => {
|
||||
@@ -119,6 +119,6 @@ export function AuthServerPlugin(options: AuthPluginOptions): BlitzServerPlugin<
|
||||
return blitzSessionMiddleware
|
||||
}
|
||||
return {
|
||||
middlewares: [authPluginSessionMiddleware()],
|
||||
requestMiddlewares: [authPluginSessionMiddleware()],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
connectMiddleware,
|
||||
Ctx,
|
||||
handleRequestWithMiddleware,
|
||||
Middleware,
|
||||
RequestMiddleware,
|
||||
MiddlewareResponse,
|
||||
secureProxyMiddleware,
|
||||
} from "blitz"
|
||||
@@ -79,9 +79,9 @@ export function passportAuth(config: BlitzPassportConfig): ApiHandler {
|
||||
|
||||
const passportMiddleware = passport.initialize()
|
||||
|
||||
const middleware: Middleware<ApiHandlerIncomingMessage, MiddlewareResponse<Ctx>>[] = [
|
||||
connectMiddleware(cookieSessionMiddleware as Middleware),
|
||||
connectMiddleware(passportMiddleware as Middleware),
|
||||
const middleware: RequestMiddleware<ApiHandlerIncomingMessage, MiddlewareResponse<Ctx>>[] = [
|
||||
connectMiddleware(cookieSessionMiddleware as RequestMiddleware),
|
||||
connectMiddleware(passportMiddleware as RequestMiddleware),
|
||||
connectMiddleware(passport.session()),
|
||||
]
|
||||
|
||||
|
||||
@@ -1,5 +1,51 @@
|
||||
# @blitzjs/next
|
||||
|
||||
## 2.0.0-alpha.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- a80d2a8f: rename middleware type for blitz server plugin
|
||||
- @blitzjs/rpc@2.0.0-alpha.37
|
||||
|
||||
## 2.0.0-alpha.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4cad9cca]
|
||||
- @blitzjs/rpc@2.0.0-alpha.36
|
||||
|
||||
## 2.0.0-alpha.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/rpc@2.0.0-alpha.35
|
||||
|
||||
## 2.0.0-alpha.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [dfd2408e]
|
||||
- @blitzjs/rpc@2.0.0-alpha.34
|
||||
|
||||
## 2.0.0-alpha.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/rpc@2.0.0-alpha.33
|
||||
|
||||
## 2.0.0-alpha.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/rpc@2.0.0-alpha.32
|
||||
|
||||
## 2.0.0-alpha.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17ce29e5]
|
||||
- @blitzjs/rpc@2.0.0-alpha.31
|
||||
|
||||
## 2.0.0-alpha.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/next",
|
||||
"version": "2.0.0-alpha.30",
|
||||
"version": "2.0.0-alpha.37",
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "pnpm predev && pnpm watch unbuild src --wait=0.2",
|
||||
@@ -23,7 +23,7 @@
|
||||
"eslint.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@blitzjs/rpc": "2.0.0-alpha.30",
|
||||
"@blitzjs/rpc": "2.0.0-alpha.37",
|
||||
"@types/hoist-non-react-statics": "3.3.1",
|
||||
"debug": "4.3.3",
|
||||
"fs-extra": "10.0.1",
|
||||
@@ -32,7 +32,7 @@
|
||||
"superjson": "1.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.30",
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.37",
|
||||
"@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.30",
|
||||
"blitz": "2.0.0-alpha.37",
|
||||
"cross-spawn": "7.0.3",
|
||||
"find-up": "4.1.0",
|
||||
"lodash.frompairs": "4.0.1",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type {NextConfig} from "next"
|
||||
import {
|
||||
GetServerSideProps,
|
||||
GetServerSidePropsResult,
|
||||
@@ -7,21 +8,20 @@ import {
|
||||
NextApiResponse,
|
||||
} from "next"
|
||||
import type {
|
||||
Ctx as BlitzCtx,
|
||||
BlitzServerPlugin,
|
||||
Middleware,
|
||||
MiddlewareResponse,
|
||||
AsyncFunc,
|
||||
FirstParam,
|
||||
AddParameters,
|
||||
AsyncFunc,
|
||||
BlitzServerPlugin,
|
||||
Ctx as BlitzCtx,
|
||||
FirstParam,
|
||||
RequestMiddleware,
|
||||
MiddlewareResponse,
|
||||
} from "blitz"
|
||||
import {handleRequestWithMiddleware, startWatcher, stopWatcher} from "blitz"
|
||||
import type {NextConfig} from "next"
|
||||
import {getQueryKey, getInfiniteQueryKey, installWebpackConfig} from "@blitzjs/rpc"
|
||||
import {dehydrate} from "@blitzjs/rpc"
|
||||
import {dehydrate, getQueryKey, getInfiniteQueryKey, loaderClient, loaderServer} from "@blitzjs/rpc"
|
||||
import {DefaultOptions, QueryClient} from "react-query"
|
||||
import {IncomingMessage, ServerResponse} from "http"
|
||||
import {withSuperJsonProps} from "./superjson"
|
||||
import {ResolverBasePath} from "@blitzjs/rpc/src/index-server"
|
||||
|
||||
export * from "./index-browser"
|
||||
|
||||
@@ -38,7 +38,7 @@ export type NextApiHandler = (
|
||||
) => void | Promise<void>
|
||||
|
||||
type SetupBlitzOptions = {
|
||||
plugins: BlitzServerPlugin<Middleware, Ctx>[]
|
||||
plugins: BlitzServerPlugin<RequestMiddleware, Ctx>[]
|
||||
}
|
||||
|
||||
export type BlitzGSSPHandler<TProps> = ({
|
||||
@@ -60,7 +60,7 @@ export type BlitzAPIHandler = (
|
||||
) => ReturnType<NextApiHandler>
|
||||
|
||||
export const setupBlitzServer = ({plugins}: SetupBlitzOptions) => {
|
||||
const middlewares = plugins.flatMap((p) => p.middlewares)
|
||||
const middlewares = plugins.flatMap((p) => p.requestMiddlewares)
|
||||
const contextMiddleware = plugins.flatMap((p) => p.contextMiddleware).filter(Boolean)
|
||||
|
||||
const gSSP =
|
||||
@@ -133,12 +133,59 @@ export const setupBlitzServer = ({plugins}: SetupBlitzOptions) => {
|
||||
|
||||
export interface BlitzConfig extends NextConfig {
|
||||
blitz?: {
|
||||
resolverBasePath?: ResolverBasePath
|
||||
customServer?: {
|
||||
hotReload?: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface WebpackRuleOptions {
|
||||
resolverBasePath?: ResolverBasePath
|
||||
}
|
||||
|
||||
interface WebpackRule {
|
||||
test: RegExp
|
||||
use: Array<{
|
||||
loader: string
|
||||
options: WebpackRuleOptions
|
||||
}>
|
||||
}
|
||||
|
||||
interface InstallWebpackConfigOptions {
|
||||
webpackConfig: {
|
||||
module: {
|
||||
rules: WebpackRule[]
|
||||
}
|
||||
}
|
||||
nextConfig: BlitzConfig
|
||||
}
|
||||
|
||||
export function installWebpackConfig({webpackConfig, nextConfig}: InstallWebpackConfigOptions) {
|
||||
const options: WebpackRuleOptions = {
|
||||
resolverBasePath: nextConfig.blitz?.resolverBasePath,
|
||||
}
|
||||
|
||||
webpackConfig.module.rules.push({
|
||||
test: /\/\[\[\.\.\.blitz]]\.[jt]s$/,
|
||||
use: [
|
||||
{
|
||||
loader: loaderServer,
|
||||
options,
|
||||
},
|
||||
],
|
||||
})
|
||||
webpackConfig.module.rules.push({
|
||||
test: /[\\/](queries|mutations)[\\/]/,
|
||||
use: [
|
||||
{
|
||||
loader: loaderClient,
|
||||
options,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
export function withBlitz(nextConfig: BlitzConfig = {}) {
|
||||
if (
|
||||
process.env.NODE_ENV !== "production" &&
|
||||
@@ -158,8 +205,8 @@ export function withBlitz(nextConfig: BlitzConfig = {}) {
|
||||
}
|
||||
|
||||
const config = Object.assign({}, nextConfig, {
|
||||
webpack: (config: any, options: any) => {
|
||||
installWebpackConfig(config)
|
||||
webpack: (config: InstallWebpackConfigOptions["webpackConfig"], options: any) => {
|
||||
installWebpackConfig({webpackConfig: config, nextConfig})
|
||||
if (typeof nextConfig.webpack === "function") {
|
||||
return nextConfig.webpack(config, options)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,58 @@
|
||||
# @blitzjs/rpc
|
||||
|
||||
## 2.0.0-alpha.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [a80d2a8f]
|
||||
- blitz@2.0.0-alpha.37
|
||||
- @blitzjs/auth@2.0.0-alpha.37
|
||||
|
||||
## 2.0.0-alpha.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4cad9cca: Add queryClient to RPC Plugin exports
|
||||
- blitz@2.0.0-alpha.36
|
||||
- @blitzjs/auth@2.0.0-alpha.36
|
||||
|
||||
## 2.0.0-alpha.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- blitz@2.0.0-alpha.35
|
||||
- @blitzjs/auth@2.0.0-alpha.35
|
||||
|
||||
## 2.0.0-alpha.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- dfd2408e: Add resolverBasePath to Blitz config to change the way rpc routes are generated
|
||||
- @blitzjs/auth@2.0.0-alpha.34
|
||||
- blitz@2.0.0-alpha.34
|
||||
|
||||
## 2.0.0-alpha.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/auth@2.0.0-alpha.33
|
||||
- blitz@2.0.0-alpha.33
|
||||
|
||||
## 2.0.0-alpha.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/auth@2.0.0-alpha.32
|
||||
- blitz@2.0.0-alpha.32
|
||||
|
||||
## 2.0.0-alpha.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 17ce29e5: Update RPC plugin setup in templates
|
||||
- blitz@2.0.0-alpha.31
|
||||
- @blitzjs/auth@2.0.0-alpha.31
|
||||
|
||||
## 2.0.0-alpha.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/rpc",
|
||||
"version": "2.0.0-alpha.30",
|
||||
"version": "2.0.0-alpha.37",
|
||||
"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.30",
|
||||
"@blitzjs/auth": "2.0.0-alpha.37",
|
||||
"b64-lite": "1.4.0",
|
||||
"bad-behavior": "1.0.1",
|
||||
"chalk": "^4.1.0",
|
||||
@@ -30,11 +30,11 @@
|
||||
"zod": "3.10.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.30",
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.37",
|
||||
"@types/debug": "4.1.7",
|
||||
"@types/react": "18.0.1",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"blitz": "2.0.0-alpha.30",
|
||||
"blitz": "2.0.0-alpha.37",
|
||||
"next": "12.1.6-canary.17",
|
||||
"react": "18.0.0",
|
||||
"react-dom": "18.0.0",
|
||||
@@ -43,7 +43,7 @@
|
||||
"watch": "1.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"blitz": "2.0.0-alpha.30",
|
||||
"blitz": "2.0.0-alpha.37",
|
||||
"next": "*"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -2,11 +2,11 @@ export * from "./rpc"
|
||||
export {useQuery, usePaginatedQuery, useInfiniteQuery, useMutation} from "./react-query"
|
||||
export type {MutateFunction} from "./react-query"
|
||||
export {
|
||||
queryClient,
|
||||
getQueryKey,
|
||||
getInfiniteQueryKey,
|
||||
invalidateQuery,
|
||||
setQueryData,
|
||||
queryClient,
|
||||
} from "./react-query-utils"
|
||||
export {useQueryErrorResetBoundary, QueryClient} from "react-query"
|
||||
export {dehydrate} from "react-query/hydration"
|
||||
|
||||
@@ -2,7 +2,7 @@ import {normalizePathTrailingSlash} from "next/dist/client/normalize-trailing-sl
|
||||
import {addBasePath} from "next/dist/shared/lib/router/router"
|
||||
import {deserialize, serialize} from "superjson"
|
||||
import {SuperJSONResult} from "superjson/dist/types"
|
||||
import {isServer, CSRFTokenMismatchError} from "blitz"
|
||||
import {CSRFTokenMismatchError, isServer} from "blitz"
|
||||
import {getQueryKeyFromUrlAndParams, queryClient} from "./react-query-utils"
|
||||
import {
|
||||
getAntiCSRFToken,
|
||||
@@ -55,7 +55,7 @@ export function __internal_buildRpcClient({
|
||||
resolverType,
|
||||
routePath,
|
||||
}: BuildRpcClientParams): RpcClient {
|
||||
const fullRoutePath = normalizeApiRoute("/api/rpc/" + routePath)
|
||||
const fullRoutePath = normalizeApiRoute("/api/rpc" + routePath)
|
||||
|
||||
const httpClient: RpcClientBase = async (params, opts = {}) => {
|
||||
const debug = (await import("debug")).default("blitz:rpc")
|
||||
|
||||
@@ -4,14 +4,13 @@ import {DefaultOptions, QueryClient} from "react-query"
|
||||
|
||||
export * from "./data-client/index"
|
||||
|
||||
export const queryClient = globalThis.queryClient
|
||||
|
||||
interface BlitzRpcOptions {
|
||||
reactQueryOptions?: DefaultOptions
|
||||
}
|
||||
export const BlitzRpcPlugin = createClientPlugin<BlitzRpcOptions, any>(
|
||||
({reactQueryOptions}: BlitzRpcOptions) => {
|
||||
export const BlitzRpcPlugin = createClientPlugin<BlitzRpcOptions, {queryClient: QueryClient}>(
|
||||
(options?: BlitzRpcOptions) => {
|
||||
const initializeQueryClient = () => {
|
||||
const {reactQueryOptions} = options || {}
|
||||
let suspenseEnabled = reactQueryOptions?.queries?.suspense ?? true
|
||||
if (!process.env.CLI_COMMAND_CONSOLE && !process.env.CLI_COMMAND_DB) {
|
||||
globalThis.__BLITZ_SUSPENSE_ENABLED = suspenseEnabled
|
||||
@@ -36,12 +35,14 @@ export const BlitzRpcPlugin = createClientPlugin<BlitzRpcOptions, any>(
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
globalThis.queryClient = initializeQueryClient()
|
||||
const queryClient = initializeQueryClient()
|
||||
globalThis.queryClient = queryClient
|
||||
return {
|
||||
events: {},
|
||||
middleware: {},
|
||||
exports: () => {},
|
||||
exports: () => ({
|
||||
queryClient,
|
||||
}),
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import {assert, Ctx, baseLogger, prettyMs, newLine} from "blitz"
|
||||
import {assert, baseLogger, Ctx, newLine, prettyMs} from "blitz"
|
||||
import {NextApiRequest, NextApiResponse} from "next"
|
||||
import {deserialize, serialize as superjsonSerialize} from "superjson"
|
||||
import chalk from "chalk"
|
||||
import {resolve} from "path"
|
||||
|
||||
// TODO - optimize end user server bundles by not exporting all client stuff here
|
||||
export * from "./index-browser"
|
||||
@@ -24,6 +25,7 @@ function getGlobalObject<T extends Record<string, unknown>>(key: string, default
|
||||
|
||||
type Resolver = (...args: unknown[]) => Promise<unknown>
|
||||
type ResolverFiles = Record<string, () => Promise<{default?: Resolver}>>
|
||||
export type ResolverBasePath = "queries|mutations" | "root" | undefined
|
||||
|
||||
// We define `global.__internal_blitzRpcResolverFiles` to ensure we use the same global object.
|
||||
// Needed for Next.js. I'm guessing that Next.js is including the `node_modules/` files in a seperate bundle than user files.
|
||||
@@ -47,21 +49,9 @@ export function __internal_addBlitzRpcResolver(
|
||||
return resolver
|
||||
}
|
||||
|
||||
import {resolve} from "path"
|
||||
const dir = __dirname + (() => "")() // trick to avoid `@vercel/ncc` to glob import
|
||||
const loaderServer = resolve(dir, "./loader-server.cjs")
|
||||
const loaderClient = resolve(dir, "./loader-client.cjs")
|
||||
|
||||
export function installWebpackConfig<T extends any[]>(config: {module?: {rules?: T}}) {
|
||||
config.module!.rules!.push({
|
||||
test: /\/\[\[\.\.\.blitz]]\.[jt]s$/,
|
||||
use: [{loader: loaderServer}],
|
||||
})
|
||||
config.module!.rules!.push({
|
||||
test: /[\\/](queries|mutations)[\\/]/,
|
||||
use: [{loader: loaderClient}],
|
||||
})
|
||||
}
|
||||
export const loaderServer = resolve(dir, "./loader-server.cjs")
|
||||
export const loaderClient = resolve(dir, "./loader-client.cjs")
|
||||
|
||||
// ----------
|
||||
// END LOADER
|
||||
|
||||
@@ -3,20 +3,13 @@ import {
|
||||
convertFilePathToResolverName,
|
||||
convertFilePathToResolverType,
|
||||
convertPageFilePathToRoutePath,
|
||||
Loader,
|
||||
LoaderOptions,
|
||||
toPosixPath,
|
||||
} from "./loader-utils"
|
||||
import {assert} from "blitz"
|
||||
import {posix} from "path"
|
||||
|
||||
// Subset of `import type { LoaderDefinitionFunction } from 'webpack'`
|
||||
type Loader = {
|
||||
_compiler?: {
|
||||
name: string
|
||||
context: string
|
||||
}
|
||||
resource: string
|
||||
cacheable: (enabled: boolean) => void
|
||||
}
|
||||
|
||||
export async function loader(this: Loader, input: string): Promise<string> {
|
||||
const compiler = this._compiler!
|
||||
@@ -25,8 +18,12 @@ export async function loader(this: Loader, input: string): Promise<string> {
|
||||
|
||||
const isSSR = compiler.name === "server"
|
||||
if (!isSSR) {
|
||||
const code = await transformBlitzRpcResolverClient(input, toPosixPath(id), toPosixPath(root))
|
||||
return code
|
||||
return await transformBlitzRpcResolverClient(
|
||||
input,
|
||||
toPosixPath(id),
|
||||
toPosixPath(root),
|
||||
this.query,
|
||||
)
|
||||
}
|
||||
|
||||
return input
|
||||
@@ -34,13 +31,18 @@ export async function loader(this: Loader, input: string): Promise<string> {
|
||||
|
||||
module.exports = loader
|
||||
|
||||
export async function transformBlitzRpcResolverClient(_src: string, id: string, root: string) {
|
||||
export async function transformBlitzRpcResolverClient(
|
||||
_src: string,
|
||||
id: string,
|
||||
root: string,
|
||||
options?: LoaderOptions,
|
||||
) {
|
||||
assertPosixPath(id)
|
||||
assertPosixPath(root)
|
||||
|
||||
const resolverFilePath = "/" + posix.relative(root, id)
|
||||
assertPosixPath(resolverFilePath)
|
||||
const routePath = convertPageFilePathToRoutePath(resolverFilePath)
|
||||
const routePath = convertPageFilePathToRoutePath(resolverFilePath, options?.resolverBasePath)
|
||||
const resolverName = convertFilePathToResolverName(resolverFilePath)
|
||||
const resolverType = convertFilePathToResolverType(resolverFilePath)
|
||||
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
import {posix, join, dirname} from "path"
|
||||
import {dirname, join, posix} from "path"
|
||||
import {promises} from "fs"
|
||||
import {
|
||||
assertPosixPath,
|
||||
toPosixPath,
|
||||
buildPageExtensionRegex,
|
||||
getIsRpcFile,
|
||||
topLevelFoldersThatMayContainResolvers,
|
||||
convertPageFilePathToRoutePath,
|
||||
getIsRpcFile,
|
||||
Loader,
|
||||
LoaderOptions,
|
||||
topLevelFoldersThatMayContainResolvers,
|
||||
toPosixPath,
|
||||
} from "./loader-utils"
|
||||
|
||||
// Subset of `import type { LoaderDefinitionFunction } from 'webpack'`
|
||||
type Loader = {
|
||||
_compiler?: {
|
||||
name: string
|
||||
context: string
|
||||
}
|
||||
resource: string
|
||||
cacheable: (enabled: boolean) => void
|
||||
}
|
||||
|
||||
export async function loader(this: Loader, input: string): Promise<string> {
|
||||
const compiler = this._compiler!
|
||||
@@ -29,8 +23,13 @@ export async function loader(this: Loader, input: string): Promise<string> {
|
||||
this.cacheable(false)
|
||||
|
||||
const resolvers = await collectResolvers(root, ["ts", "js"])
|
||||
const code = await transformBlitzRpcServer(input, toPosixPath(id), toPosixPath(root), resolvers)
|
||||
return code
|
||||
return await transformBlitzRpcServer(
|
||||
input,
|
||||
toPosixPath(id),
|
||||
toPosixPath(root),
|
||||
resolvers,
|
||||
this.query,
|
||||
)
|
||||
}
|
||||
|
||||
return input
|
||||
@@ -43,6 +42,7 @@ export async function transformBlitzRpcServer(
|
||||
id: string,
|
||||
root: string,
|
||||
resolvers: string[],
|
||||
options?: LoaderOptions,
|
||||
) {
|
||||
assertPosixPath(id)
|
||||
assertPosixPath(root)
|
||||
@@ -55,7 +55,7 @@ export async function transformBlitzRpcServer(
|
||||
|
||||
for (let resolverFilePath of resolvers) {
|
||||
const relativeResolverPath = posix.relative(dirname(id), join(root, resolverFilePath))
|
||||
const routePath = convertPageFilePathToRoutePath(resolverFilePath)
|
||||
const routePath = convertPageFilePathToRoutePath(resolverFilePath, options?.resolverBasePath)
|
||||
code += `__internal_addBlitzRpcResolver('${routePath}', () => import('${relativeResolverPath}'));`
|
||||
code += "\n"
|
||||
}
|
||||
|
||||
24
packages/blitz-rpc/src/loader-utils.test.ts
Normal file
24
packages/blitz-rpc/src/loader-utils.test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {describe, expect, it} from "vitest"
|
||||
import {convertPageFilePathToRoutePath} from "./loader-utils"
|
||||
|
||||
const FILE_PATH = "app/queries/getData.ts"
|
||||
|
||||
describe("convertPageFilePathToRoutePath", () => {
|
||||
it("should return the full path when resolverBasePath is set to root", () => {
|
||||
const res = convertPageFilePathToRoutePath(FILE_PATH, "root")
|
||||
|
||||
expect(res).toEqual("app/queries/getData")
|
||||
})
|
||||
|
||||
it("should return the relative path when resolverBasePath is set to queries|mutations", () => {
|
||||
const res = convertPageFilePathToRoutePath(FILE_PATH, "queries|mutations")
|
||||
|
||||
expect(res).toEqual("/getData")
|
||||
})
|
||||
|
||||
it("should return the relative path when resolverBasePath is set to undefined", () => {
|
||||
const res = convertPageFilePathToRoutePath(FILE_PATH, undefined)
|
||||
|
||||
expect(res).toEqual("/getData")
|
||||
})
|
||||
})
|
||||
@@ -1,5 +1,20 @@
|
||||
import {assert} from "blitz"
|
||||
import {win32, posix, sep} from "path"
|
||||
import {posix, sep, win32} from "path"
|
||||
import {ResolverBasePath} from "./index-server"
|
||||
|
||||
export interface LoaderOptions {
|
||||
resolverBasePath?: ResolverBasePath
|
||||
}
|
||||
|
||||
export interface Loader {
|
||||
_compiler?: {
|
||||
name: string
|
||||
context: string
|
||||
}
|
||||
resource: string
|
||||
cacheable: (enabled: boolean) => void
|
||||
query: LoaderOptions
|
||||
}
|
||||
|
||||
export function assertPosixPath(path: string) {
|
||||
const errMsg = `Wrongly formatted path: ${path}`
|
||||
@@ -34,7 +49,14 @@ export function buildPageExtensionRegex(pageExtensions: string[]) {
|
||||
|
||||
const fileExtensionRegex = /\.([a-z]+)$/
|
||||
|
||||
export function convertPageFilePathToRoutePath(filePath: string) {
|
||||
export function convertPageFilePathToRoutePath(
|
||||
filePath: string,
|
||||
resolverBasePath: ResolverBasePath,
|
||||
) {
|
||||
if (resolverBasePath === "root") {
|
||||
return filePath.replace(fileExtensionRegex, "")
|
||||
}
|
||||
|
||||
return filePath
|
||||
.replace(/^.*?[\\/]queries[\\/]/, "/")
|
||||
.replace(/^.*?[\\/]mutations[\\/]/, "/")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Ctx} from "blitz"
|
||||
import {describe, it, expect} from "vitest"
|
||||
import {describe, expect, it} from "vitest"
|
||||
import {z} from "zod"
|
||||
import {ParserType, resolver} from "./resolver"
|
||||
|
||||
@@ -44,10 +44,9 @@ const asyncResolver = resolver.pipe(
|
||||
const resolverTest = async ({type}: {type?: ParserType}) => {
|
||||
const resolver1 = type === "sync" ? syncResolver : asyncResolver
|
||||
|
||||
const result1 = await resolver1(
|
||||
{email: "test@example.com"},
|
||||
{session: {$authorize: () => undefined} as Ctx},
|
||||
)
|
||||
const result1 = await resolver1({email: "test@example.com"}, {
|
||||
session: {$authorize: () => undefined},
|
||||
} as Ctx)
|
||||
expect(result1).toBe("test@example.com")
|
||||
|
||||
const resolver2 = resolver.pipe(
|
||||
@@ -55,9 +54,8 @@ const resolverTest = async ({type}: {type?: ParserType}) => {
|
||||
return input.email
|
||||
},
|
||||
)
|
||||
const result2 = await resolver2(
|
||||
{email: "test@example.com"},
|
||||
{session: {$authorize: () => undefined} as Ctx},
|
||||
)
|
||||
const result2 = await resolver2({email: "test@example.com"}, {
|
||||
session: {$authorize: () => undefined},
|
||||
} as Ctx)
|
||||
expect(result2).toBe("test@example.com")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,10 @@ import {assert, expect, test, beforeEach, describe, spyOn, it} from "vitest"
|
||||
|
||||
import {queryClient, invalidateQuery, setQueryData} from "../../src/data-client"
|
||||
|
||||
import {getQueryCacheFunctions} from "../../src/data-client/react-query-utils"
|
||||
import {
|
||||
getQueryCacheFunctions,
|
||||
initializeQueryClient,
|
||||
} from "../../src/data-client/react-query-utils"
|
||||
import {buildQueryRpc} from "../blitz-test-utils"
|
||||
|
||||
// eslint-disable-next-line require-await
|
||||
|
||||
@@ -1,5 +1,51 @@
|
||||
# blitz
|
||||
|
||||
## 2.0.0-alpha.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- a80d2a8f: rename middleware type for blitz server plugin
|
||||
- @blitzjs/generator@2.0.0-alpha.37
|
||||
|
||||
## 2.0.0-alpha.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [4cad9cca]
|
||||
- @blitzjs/generator@2.0.0-alpha.36
|
||||
|
||||
## 2.0.0-alpha.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [e3750b04]
|
||||
- @blitzjs/generator@2.0.0-alpha.35
|
||||
|
||||
## 2.0.0-alpha.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/generator@2.0.0-alpha.34
|
||||
|
||||
## 2.0.0-alpha.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/generator@2.0.0-alpha.33
|
||||
|
||||
## 2.0.0-alpha.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/generator@2.0.0-alpha.32
|
||||
|
||||
## 2.0.0-alpha.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [17ce29e5]
|
||||
- @blitzjs/generator@2.0.0-alpha.31
|
||||
|
||||
## 2.0.0-alpha.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "blitz",
|
||||
"version": "2.0.0-alpha.30",
|
||||
"version": "2.0.0-alpha.37",
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "watch unbuild src --wait=0.2",
|
||||
@@ -23,7 +23,7 @@
|
||||
"blitz": "bin/blitz"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/generator": "2.0.0-alpha.30",
|
||||
"@blitzjs/generator": "2.0.0-alpha.37",
|
||||
"arg": "5.0.1",
|
||||
"chalk": "^4.1.0",
|
||||
"console-table-printer": "2.10.0",
|
||||
@@ -52,7 +52,7 @@
|
||||
"watchpack": "2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.30",
|
||||
"@blitzjs/config": "workspace:2.0.0-alpha.37",
|
||||
"@types/cookie": "0.4.1",
|
||||
"@types/cross-spawn": "6.0.2",
|
||||
"@types/debug": "4.1.7",
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface MiddlewareResponse<C extends Ctx = Ctx> extends ServerResponse
|
||||
|
||||
export type MiddlewareNext = (error?: Error) => Promise<void> | void
|
||||
|
||||
export type Middleware<
|
||||
export type RequestMiddleware<
|
||||
TRequest extends IncomingMessage = IncomingMessage,
|
||||
TResponse = ServerResponse,
|
||||
> = {
|
||||
@@ -32,11 +32,11 @@ export type Middleware<
|
||||
}
|
||||
|
||||
export type BlitzServerPlugin<
|
||||
MiddlewareType = Middleware<any, any>,
|
||||
RequestMiddlewareType = RequestMiddleware<any, any>,
|
||||
TCtx extends Ctx = Ctx,
|
||||
TExports extends object = {},
|
||||
> = {
|
||||
middlewares: MiddlewareType[]
|
||||
requestMiddlewares: RequestMiddlewareType[]
|
||||
contextMiddleware?: (ctx: TCtx) => TCtx
|
||||
exports?: TExports
|
||||
}
|
||||
@@ -54,7 +54,7 @@ export function createServerPlugin<
|
||||
return pluginConstructor
|
||||
}
|
||||
|
||||
export function createSetupServer<TMiddleware extends Middleware, TExports extends object>(
|
||||
export function createSetupServer<TMiddleware extends RequestMiddleware, TExports extends object>(
|
||||
setupServerConstructor: (plugins: BlitzServerPlugin<TMiddleware>) => TExports,
|
||||
) {
|
||||
return setupServerConstructor
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {IncomingMessage, ServerResponse} from "http"
|
||||
import {compose, Ctx, Middleware, MiddlewareNext, MiddlewareResponse} from "./index-server"
|
||||
import {compose, Ctx, RequestMiddleware, MiddlewareNext, MiddlewareResponse} from "./index-server"
|
||||
|
||||
export async function handleRequestWithMiddleware<
|
||||
Req extends IncomingMessage = IncomingMessage,
|
||||
@@ -7,7 +7,7 @@ export async function handleRequestWithMiddleware<
|
||||
>(
|
||||
req: Req,
|
||||
res: Res,
|
||||
middleware: Middleware<Req, Res>[],
|
||||
middleware: RequestMiddleware<Req, Res>[],
|
||||
{
|
||||
throwOnError = true,
|
||||
stackPrintOnError = true,
|
||||
@@ -117,7 +117,7 @@ export async function handleRequestWithMiddleware<
|
||||
export function noCallbackHandler<
|
||||
Req extends IncomingMessage = IncomingMessage,
|
||||
Res = MiddlewareResponse,
|
||||
>(req: Req, res: Res, next: MiddlewareNext, middleware: Middleware<Req, Res>) {
|
||||
>(req: Req, res: Res, next: MiddlewareNext, middleware: RequestMiddleware<Req, Res>) {
|
||||
// Cast to any to call with two arguments for connect compatibility
|
||||
;(middleware as any)(req, res)
|
||||
return next()
|
||||
@@ -131,7 +131,7 @@ export function noCallbackHandler<
|
||||
export function withCallbackHandler<
|
||||
Req extends IncomingMessage = IncomingMessage,
|
||||
Res = MiddlewareResponse,
|
||||
>(req: Req, res: Res, next: MiddlewareNext, middleware: Middleware<Req, Res>) {
|
||||
>(req: Req, res: Res, next: MiddlewareNext, middleware: RequestMiddleware<Req, Res>) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Rule doesn't matter since we are inside new Promise()
|
||||
//eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
@@ -150,14 +150,14 @@ export function withCallbackHandler<
|
||||
export function connectMiddleware<
|
||||
Req extends IncomingMessage = IncomingMessage,
|
||||
Res extends MiddlewareResponse = MiddlewareResponse,
|
||||
>(middleware: Middleware<Req, Res>): Middleware<Req, Res> {
|
||||
>(middleware: RequestMiddleware<Req, Res>): RequestMiddleware<Req, Res> {
|
||||
const handler = middleware.length < 3 ? noCallbackHandler : withCallbackHandler
|
||||
return function connectHandler(req: Req, res, next) {
|
||||
return handler(req, res, next, middleware)
|
||||
} as Middleware<Req, Res>
|
||||
} as RequestMiddleware<Req, Res>
|
||||
}
|
||||
|
||||
export const secureProxyMiddleware: Middleware<
|
||||
export const secureProxyMiddleware: RequestMiddleware<
|
||||
IncomingMessage & {protocol?: string},
|
||||
MiddlewareResponse
|
||||
> = function (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Middleware} from "./index-server"
|
||||
import {RequestMiddleware} from "./index-server"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
@@ -76,7 +76,7 @@ export const setCookie = (name: string, value: string, expires: string) => {
|
||||
}
|
||||
export const deleteCookie = (name: string) => setCookie(name, "", "Thu, 01 Jan 1970 00:00:01 GMT")
|
||||
|
||||
export function compose(middleware: Middleware<any, any>[]) {
|
||||
export function compose(middleware: RequestMiddleware<any, any>[]) {
|
||||
if (!Array.isArray(middleware)) {
|
||||
throw new TypeError("Middleware stack must be an array!")
|
||||
}
|
||||
@@ -115,7 +115,7 @@ export function compose(middleware: Middleware<any, any>[]) {
|
||||
|
||||
// return next(result as any)
|
||||
return dispatch(0).then(next as any)
|
||||
} as Middleware
|
||||
} as RequestMiddleware
|
||||
}
|
||||
|
||||
function round(num: number, decimalPlaces: number) {
|
||||
|
||||
@@ -1,5 +1,63 @@
|
||||
# @blitzjs/codemod
|
||||
|
||||
## 2.0.0-alpha.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [a80d2a8f]
|
||||
- blitz@2.0.0-alpha.37
|
||||
- @blitzjs/generator@2.0.0-alpha.37
|
||||
|
||||
## 2.0.0-alpha.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4cad9cca: Update queryClient import in codemod
|
||||
- Updated dependencies [4cad9cca]
|
||||
- @blitzjs/generator@2.0.0-alpha.36
|
||||
- blitz@2.0.0-alpha.36
|
||||
|
||||
## 2.0.0-alpha.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e3750b04: codemod fixes
|
||||
- Updated dependencies [e3750b04]
|
||||
- @blitzjs/generator@2.0.0-alpha.35
|
||||
- blitz@2.0.0-alpha.35
|
||||
|
||||
## 2.0.0-alpha.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @blitzjs/generator@2.0.0-alpha.34
|
||||
- blitz@2.0.0-alpha.34
|
||||
|
||||
## 2.0.0-alpha.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 9e05d6e1: allow extension catch in getAllFiles codemod util
|
||||
- @blitzjs/generator@2.0.0-alpha.33
|
||||
- blitz@2.0.0-alpha.33
|
||||
|
||||
## 2.0.0-alpha.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e6fb09d4: Fix templates source in RPC codemod step
|
||||
- @blitzjs/generator@2.0.0-alpha.32
|
||||
- blitz@2.0.0-alpha.32
|
||||
|
||||
## 2.0.0-alpha.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 46d9f81a: Update templates directory for codemod
|
||||
- Updated dependencies [17ce29e5]
|
||||
- @blitzjs/generator@2.0.0-alpha.31
|
||||
- blitz@2.0.0-alpha.31
|
||||
|
||||
## 2.0.0-alpha.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/codemod",
|
||||
"version": "2.0.0-alpha.30",
|
||||
"version": "2.0.0-alpha.37",
|
||||
"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.30",
|
||||
"@blitzjs/generator": "2.0.0-alpha.37",
|
||||
"arg": "5.0.1",
|
||||
"blitz": "2.0.0-alpha.30",
|
||||
"blitz": "2.0.0-alpha.37",
|
||||
"chalk": "^4.1.0",
|
||||
"cross-spawn": "7.0.3",
|
||||
"debug": "4.3.3",
|
||||
|
||||
@@ -7,14 +7,18 @@ import {
|
||||
findDefaultExportPath,
|
||||
findFunction,
|
||||
findImport,
|
||||
findImportSpecifier,
|
||||
findVariable,
|
||||
getAllFiles,
|
||||
getCollectionFromSource,
|
||||
wrapDeclaration,
|
||||
findIdentifier,
|
||||
} from "./utils"
|
||||
import {log} from "blitz"
|
||||
|
||||
const isInternalBlitzMonorepoDevelopment = fs.existsSync(
|
||||
path.join(__dirname, "../../../blitz-next"),
|
||||
)
|
||||
|
||||
const upgradeLegacy = async () => {
|
||||
let isTypescript = fs.existsSync(path.resolve("tsconfig.json"))
|
||||
let blitzConfigFile = `blitz.config.${isTypescript ? "ts" : "js"}`
|
||||
@@ -60,7 +64,9 @@ const upgradeLegacy = async () => {
|
||||
j.assignmentExpression(
|
||||
"=",
|
||||
j.memberExpression(j.identifier("module"), j.identifier("exports")),
|
||||
j.callExpression(j.identifier("withBlitz"), []),
|
||||
j.callExpression(j.identifier("withBlitz"), [
|
||||
j.objectExpression([j.objectProperty(j.identifier("blitz"), j.objectExpression([]))]),
|
||||
]),
|
||||
),
|
||||
)
|
||||
parsedProgram.value.program.body.push(moduleExportExpression)
|
||||
@@ -128,7 +134,7 @@ const upgradeLegacy = async () => {
|
||||
GetServerSideProps: "next",
|
||||
InferGetServerSidePropsType: "next",
|
||||
GetServerSidePropsContext: "next",
|
||||
|
||||
AuthenticatedMiddlewareCtx: "@blitz/rpc",
|
||||
getAntiCSRFToken: "@blitzjs/rpc",
|
||||
useSession: "@blitzjs/auth",
|
||||
useAuthenticatedSession: "@blitzjs/auth",
|
||||
@@ -139,7 +145,7 @@ const upgradeLegacy = async () => {
|
||||
usePaginatedQuery: "@blitzjs/rpc",
|
||||
useInfiniteQuery: "@blitzjs/rpc",
|
||||
useMutation: "@blitzjs/rpc",
|
||||
queryClient: "@blitzjs/rpc",
|
||||
queryClient: "app/blitz-client",
|
||||
getQueryKey: "@blitzjs/rpc",
|
||||
getInfiniteQueryKey: "@blitzjs/rpc",
|
||||
invalidateQuery: "@blitzjs/rpc",
|
||||
@@ -169,7 +175,7 @@ const upgradeLegacy = async () => {
|
||||
BlitzLayout: "@blitzjs/next",
|
||||
}
|
||||
|
||||
getAllFiles(appDir, [], [], [".css"]).forEach((filename) => {
|
||||
getAllFiles(appDir, [], [], [".ts", ".tsx", ".js", ".jsx"]).forEach((filename) => {
|
||||
const program = getCollectionFromSource(path.resolve(appDir, filename))
|
||||
const parsedProgram = program.get()
|
||||
|
||||
@@ -212,7 +218,7 @@ const upgradeLegacy = async () => {
|
||||
steps.push({
|
||||
name: "update NextJS' default imports",
|
||||
action: async () => {
|
||||
getAllFiles(appDir, [], [], [".css"]).forEach((file) => {
|
||||
getAllFiles(appDir, [], [], [".ts", ".tsx", ".js", ".jsx"]).forEach((file) => {
|
||||
const program = getCollectionFromSource(file)
|
||||
|
||||
const nextImage = findImport(program, "next/image")
|
||||
@@ -260,6 +266,44 @@ const upgradeLegacy = async () => {
|
||||
},
|
||||
})
|
||||
|
||||
steps.push({
|
||||
name: "change BlitzApiRequest to NextApiRequest",
|
||||
action: async () => {
|
||||
getAllFiles(path.join(appDir, "api"), [], [], [".ts", ".tsx", ".js", ".jsx"]).forEach(
|
||||
(file) => {
|
||||
const program = getCollectionFromSource(file)
|
||||
|
||||
findIdentifier(program, "BlitzApiRequest")
|
||||
.paths()
|
||||
.forEach((path) => {
|
||||
if (path.parentPath.parentPath.parentPath.value.type === "ImportDeclaration") {
|
||||
path.parentPath.parentPath.parentPath.value.source.value = "next"
|
||||
}
|
||||
path.value.name = "NextApiRequest"
|
||||
})
|
||||
findIdentifier(program, "BlitzApiResponse")
|
||||
.paths()
|
||||
.forEach((path) => {
|
||||
if (path.parentPath.parentPath.parentPath.value.type === "ImportDeclaration") {
|
||||
path.parentPath.parentPath.parentPath.value.source.value = "next"
|
||||
}
|
||||
path.value.name = "NextApiResponse"
|
||||
})
|
||||
findIdentifier(program, "BlitzApiHandler")
|
||||
.paths()
|
||||
.forEach((path) => {
|
||||
if (path.parentPath.parentPath.parentPath.value.type === "ImportDeclaration") {
|
||||
path.parentPath.parentPath.parentPath.value.source.value = "next"
|
||||
}
|
||||
path.value.name = "NextApiHandler"
|
||||
})
|
||||
|
||||
fs.writeFileSync(path.join(path.resolve(file)), program.toSource())
|
||||
},
|
||||
)
|
||||
},
|
||||
})
|
||||
|
||||
steps.push({
|
||||
name: "create blitz-server.ts and blitz-client.ts setup files",
|
||||
action: async () => {
|
||||
@@ -270,7 +314,7 @@ const upgradeLegacy = async () => {
|
||||
require.resolve("@blitzjs/generator"),
|
||||
"..",
|
||||
"..",
|
||||
"templates",
|
||||
isInternalBlitzMonorepoDevelopment ? "templates" : "dist/templates",
|
||||
)
|
||||
const blitzServer = fs
|
||||
.readFileSync(path.join(templatePath, "app", "app", "blitz-server.ts"))
|
||||
@@ -307,7 +351,12 @@ const upgradeLegacy = async () => {
|
||||
name: "create pages/api/rpc directory and add [[...blitz]].ts wildecard API route",
|
||||
action: async () => {
|
||||
const pagesDir = path.resolve("pages/api/rpc")
|
||||
const templatePath = path.join(require.resolve("@blitzjs/generator"), "..", "..", "templates")
|
||||
const templatePath = path.join(
|
||||
require.resolve("@blitzjs/generator"),
|
||||
"..",
|
||||
"..",
|
||||
isInternalBlitzMonorepoDevelopment ? "templates" : "dist/templates",
|
||||
)
|
||||
const rpcRoute = fs
|
||||
.readFileSync(path.join(templatePath, "app", "pages", "api", "rpc", "blitzrpcroute.ts"))
|
||||
.toString()
|
||||
@@ -360,24 +409,66 @@ const upgradeLegacy = async () => {
|
||||
const getAllPagesDirs = (dirPath: string) => {
|
||||
let files = fs.readdirSync(dirPath)
|
||||
|
||||
const pageDir = files.reduce((arr: {model: string; path: string}[], file: string) => {
|
||||
if (fs.statSync(dirPath + "/" + file).isDirectory()) {
|
||||
let subs = fs.readdirSync(dirPath + "/" + file)
|
||||
if (subs.includes("pages")) {
|
||||
arr.push({
|
||||
model: file,
|
||||
path: dirPath + "/" + file + "/pages",
|
||||
})
|
||||
const pageDir = files.reduce(
|
||||
(arr: {model: string; path: string; subModel?: string}[], file: string) => {
|
||||
if (fs.statSync(dirPath + "/" + file).isDirectory()) {
|
||||
let subs = fs.readdirSync(dirPath + "/" + file)
|
||||
|
||||
if (subs.includes("pages")) {
|
||||
// Go a level deeper into "pages"
|
||||
let subSubs = fs.readdirSync(dirPath + "/" + file + "/pages")
|
||||
|
||||
for (let dir of subSubs) {
|
||||
if (fs.statSync(dirPath + "/" + file + "/pages" + "/" + dir).isDirectory()) {
|
||||
// If directory structure is like: DIRECTORY/PAGES/DIRECTORY
|
||||
if (dir === file) {
|
||||
arr.push({
|
||||
model: file,
|
||||
path: dirPath + "/" + file + "/pages" + "/" + dir,
|
||||
})
|
||||
} else {
|
||||
// If there is another directory that doesn't have the same name
|
||||
arr.push({
|
||||
model: file,
|
||||
subModel: dir,
|
||||
path: dirPath + "/" + file + "/pages" + "/" + dir,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
arr.push({
|
||||
model: file,
|
||||
path: dirPath + "/" + file + "/pages",
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return arr
|
||||
}, [])
|
||||
return arr
|
||||
},
|
||||
[],
|
||||
)
|
||||
|
||||
return pageDir
|
||||
}
|
||||
|
||||
getAllPagesDirs(appDir).forEach((pages) => {
|
||||
fs.moveSync(pages.path, path.join(path.resolve("pages"), pages.model))
|
||||
getAllPagesDirs(appDir).forEach((pages, index) => {
|
||||
if (pages.subModel) {
|
||||
fs.moveSync(pages.path, path.join(path.resolve("pages"), pages.model, pages.subModel))
|
||||
} else {
|
||||
fs.moveSync(pages.path, path.join(path.resolve("pages"), pages.model))
|
||||
}
|
||||
|
||||
// Delete left over pages directory
|
||||
let subs = fs.readdirSync(path.join(appDir, pages.model))
|
||||
// We can only delete a directory once 😅
|
||||
if (
|
||||
getAllPagesDirs(appDir)[index - 1]?.model !== getAllPagesDirs(appDir)[index]?.model &&
|
||||
index === getAllPagesDirs(appDir).length &&
|
||||
subs.includes("pages")
|
||||
) {
|
||||
fs.removeSync(path.join(appDir, pages.model, "pages"))
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
@@ -391,6 +482,8 @@ const upgradeLegacy = async () => {
|
||||
apiRoutes.forEach((dir) => {
|
||||
if (fs.statSync(appDir + "/api/" + dir).isDirectory()) {
|
||||
fs.moveSync(appDir + "/api/" + dir, path.join(path.resolve("pages"), "api", dir))
|
||||
} else {
|
||||
fs.moveSync(appDir + "/api/" + dir, path.join(path.resolve("pages"), "api", dir))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -414,11 +507,57 @@ const upgradeLegacy = async () => {
|
||||
j.Identifier,
|
||||
(node) => node.name === "blitz" || node.escapedText === "blitz",
|
||||
)
|
||||
const findBlitzCustomServerLiteral = program
|
||||
.find(j.StringLiteral, (node) => node.value === "blitz/custom-server")
|
||||
.get()
|
||||
const findBlitzCustomServerLiteral = program.find(
|
||||
j.StringLiteral,
|
||||
(node) => node.value === "blitz/custom-server",
|
||||
)
|
||||
|
||||
findBlitzCustomServerLiteral.value.value = "next"
|
||||
if (findBlitzCustomServerLiteral.length === 0) {
|
||||
log.error(
|
||||
`Failed to find "blitz/custom-server" import in ${customServerDir}/index.${
|
||||
isTypescript ? "ts" : "js"
|
||||
}. You will need to update your custom server manually.`,
|
||||
)
|
||||
} else {
|
||||
findBlitzCustomServerLiteral.get().value.value = "next"
|
||||
findBlitzCall.forEach((hit) => {
|
||||
// Loops through the blitz calls. Check if its a call expression, require statement or import statement. Will check everything to next instead of blitz
|
||||
switch (hit.name) {
|
||||
case "callee":
|
||||
hit.value.name = "next"
|
||||
case "id":
|
||||
hit.value.name = "next"
|
||||
case "local":
|
||||
hit.value.name = "next"
|
||||
}
|
||||
})
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join("server", `index.${isTypescript ? "ts" : "js"}`),
|
||||
program.toSource(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If custom server file found outside dir
|
||||
if (fs.existsSync(customServerFile)) {
|
||||
const program = getCollectionFromSource(customServerFile)
|
||||
const findBlitzCall = program.find(
|
||||
j.Identifier,
|
||||
(node) => node.name === "blitz" || node.escapedText === "blitz",
|
||||
)
|
||||
const findBlitzCustomServerLiteral = program.find(
|
||||
j.StringLiteral,
|
||||
(node) => node.value === "blitz/custom-server",
|
||||
)
|
||||
|
||||
if (findBlitzCustomServerLiteral.length === 0) {
|
||||
log.error(
|
||||
`Failed to find "blitz/custom-server" import in ${customServerFile}. You will need to update your custom server manually.`,
|
||||
)
|
||||
} else {
|
||||
findBlitzCustomServerLiteral.get().value.value = "next"
|
||||
findBlitzCall.forEach((hit) => {
|
||||
// Loops through the blitz calls. Check if its a call expression, require statement or import statement. Will check everything to next instead of blitz
|
||||
switch (hit.name) {
|
||||
@@ -430,39 +569,9 @@ const upgradeLegacy = async () => {
|
||||
hit.value.name = "next"
|
||||
}
|
||||
})
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join("server", `index.${isTypescript ? "ts" : "js"}`),
|
||||
program.toSource(),
|
||||
)
|
||||
fs.writeFileSync(customServerFile, program.toSource())
|
||||
}
|
||||
}
|
||||
|
||||
// If custom server file found outside dir
|
||||
if (fs.existsSync(customServerFile)) {
|
||||
const program = getCollectionFromSource(customServerFile)
|
||||
const findBlitzCall = program.find(
|
||||
j.Identifier,
|
||||
(node) => node.name === "blitz" || node.escapedText === "blitz",
|
||||
)
|
||||
const findBlitzCustomServerLiteral = program
|
||||
.find(j.StringLiteral, (node) => node.value === "blitz/custom-server")
|
||||
.get()
|
||||
|
||||
findBlitzCustomServerLiteral.value.value = "next"
|
||||
findBlitzCall.forEach((hit) => {
|
||||
// Loops through the blitz calls. Check if its a call expression, require statement or import statement. Will check everything to next instead of blitz
|
||||
switch (hit.name) {
|
||||
case "callee":
|
||||
hit.value.name = "next"
|
||||
case "id":
|
||||
hit.value.name = "next"
|
||||
case "local":
|
||||
hit.value.name = "next"
|
||||
}
|
||||
})
|
||||
fs.writeFileSync(customServerFile, program.toSource())
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -471,7 +580,7 @@ const upgradeLegacy = async () => {
|
||||
action: async () => {
|
||||
//First check ./pages
|
||||
const pagesDir = path.resolve("pages")
|
||||
getAllFiles(pagesDir, [], [], [".css"]).forEach((file) => {
|
||||
getAllFiles(pagesDir, [], [], [".ts", ".tsx", ".js", ".jsx"]).forEach((file) => {
|
||||
const filepath = path.resolve(pagesDir, file)
|
||||
const program = getCollectionFromSource(filepath)
|
||||
|
||||
@@ -514,7 +623,7 @@ const upgradeLegacy = async () => {
|
||||
fs.writeFileSync(filepath, program.toSource())
|
||||
})
|
||||
|
||||
getAllFiles(appDir, [], [], [".css"]).forEach((file) => {
|
||||
getAllFiles(appDir, [], [], [".ts", ".tsx", ".js", ".jsx"]).forEach((file) => {
|
||||
const filepath = path.resolve(appDir, file)
|
||||
const program = getCollectionFromSource(filepath)
|
||||
|
||||
@@ -644,7 +753,7 @@ const upgradeLegacy = async () => {
|
||||
name: "wrap getServerSideProps, getStaticProps and API handlers with gSSP, gSP, and api",
|
||||
action: async () => {
|
||||
const pagesDir = path.resolve("pages")
|
||||
getAllFiles(pagesDir, [], ["api"]).forEach((file) => {
|
||||
getAllFiles(pagesDir, [], ["api"], [".ts", ".tsx", ".js", ".jsx"]).forEach((file) => {
|
||||
const program = getCollectionFromSource(file)
|
||||
|
||||
// 1. getServerSideProps
|
||||
@@ -668,7 +777,12 @@ const upgradeLegacy = async () => {
|
||||
|
||||
// 3. api
|
||||
if (fs.existsSync(path.join(pagesDir, "api"))) {
|
||||
getAllFiles(path.join(pagesDir, "api"), [], ["rpc"]).forEach((file) => {
|
||||
getAllFiles(
|
||||
path.join(pagesDir, "api"),
|
||||
[],
|
||||
["rpc"],
|
||||
[".ts", ".tsx", ".js", ".jsx"],
|
||||
).forEach((file) => {
|
||||
const program = getCollectionFromSource(file)
|
||||
|
||||
const defaultExportPath = findDefaultExportPath(program)
|
||||
@@ -691,7 +805,7 @@ const upgradeLegacy = async () => {
|
||||
action: async () => {
|
||||
let errors = 0
|
||||
|
||||
getAllFiles(appDir, [], ["components"], [".css"]).forEach((file) => {
|
||||
getAllFiles(appDir, [], ["components"], [".ts", ".tsx", ".js", ".jsx"]).forEach((file) => {
|
||||
const program = getCollectionFromSource(file)
|
||||
const middlewarePath = findVariable(program, "middleware")
|
||||
if (middlewarePath?.length) {
|
||||
@@ -706,32 +820,70 @@ const upgradeLegacy = async () => {
|
||||
},
|
||||
})
|
||||
|
||||
steps.push({
|
||||
name: "update root types file",
|
||||
action: async () => {
|
||||
const typeFile = path.join(process.cwd(), "types.ts")
|
||||
|
||||
if (fs.existsSync(typeFile)) {
|
||||
const program = getCollectionFromSource(typeFile)
|
||||
|
||||
const findDefaultCtx = () => {
|
||||
return program.find(j.Identifier, (node) => node)
|
||||
}
|
||||
|
||||
findDefaultCtx().forEach((path) => {
|
||||
if (path.value.name === "Ctx") {
|
||||
path.parentPath.parentPath.value.declaration.extends = []
|
||||
}
|
||||
if (path.value.name === "DefaultCtx" && path.name === "imported") {
|
||||
j(path.parentPath).remove()
|
||||
}
|
||||
})
|
||||
|
||||
const findBlitzLiteral = () => {
|
||||
return program.find(j.StringLiteral, (node) => node.value === "blitz")
|
||||
}
|
||||
|
||||
findBlitzLiteral()
|
||||
.paths()
|
||||
.forEach((path) => {
|
||||
path.value.value = "@blitzjs/auth"
|
||||
})
|
||||
|
||||
fs.writeFileSync(typeFile, program.toSource())
|
||||
} else {
|
||||
log.error("There is no type file")
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
steps.push({
|
||||
name: "check for usages of invokeWithMiddleware",
|
||||
action: async () => {
|
||||
let errors = 0
|
||||
|
||||
getAllFiles(appDir, [], [], [".css"]).forEach((file) => {
|
||||
getAllFiles(appDir, [], [], [".ts", ".tsx", ".js", ".jsx"]).forEach((file) => {
|
||||
const program = getCollectionFromSource(file)
|
||||
const invokeWithMiddlewarePath = findCallExpression(program, "invokeWithMiddleware")
|
||||
if (invokeWithMiddlewarePath?.length) {
|
||||
console.error(`invokeWithMiddleware found at ${file}.`)
|
||||
log.error(`\n invokeWithMiddleware found at ${file}. \n`)
|
||||
errors++
|
||||
}
|
||||
})
|
||||
|
||||
getAllFiles(path.resolve("pages"), [], [], [".css"]).forEach((file) => {
|
||||
getAllFiles(path.resolve("pages"), [], [], [".ts", ".tsx", ".js", ".jsx"]).forEach((file) => {
|
||||
const program = getCollectionFromSource(file)
|
||||
const invokeWithMiddlewarePath = findCallExpression(program, "invokeWithMiddleware")
|
||||
if (invokeWithMiddlewarePath?.length) {
|
||||
console.error(`invokeWithMiddleware found at ${file}.`)
|
||||
log.error(`\n invokeWithMiddleware found at ${file}. \n`)
|
||||
errors++
|
||||
}
|
||||
})
|
||||
|
||||
if (errors > 0) {
|
||||
throw new Error(
|
||||
"invokeWithMiddleware is not supported. Use invokeWithCtx instead: https://canary.blitzjs.com/docs/resolver-server-utilities#invoke-with-ctx",
|
||||
"\n invokeWithMiddleware is not supported. \n Use invokeWithCtx instead: https://canary.blitzjs.com/docs/resolver-server-utilities#invoke-with-ctx \n Fix the files above, then run the codemod again.",
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -9,9 +9,14 @@ import j, {
|
||||
ImportDeclaration,
|
||||
CallExpression,
|
||||
ImportSpecifier,
|
||||
Identifier,
|
||||
} from "jscodeshift"
|
||||
import {parseSync} from "@babel/core"
|
||||
|
||||
export function findIdentifier(program: Collection<any>, name: string): Collection<Identifier> {
|
||||
return program.find(j.Identifier, (node) => node.name === name)
|
||||
}
|
||||
|
||||
export function findFunction(
|
||||
program: Collection<any>,
|
||||
declarationName: string,
|
||||
@@ -192,17 +197,21 @@ export function getAllFiles(
|
||||
dirPath: string,
|
||||
accFiles: string[] = [],
|
||||
skipDirs?: string[],
|
||||
skipExt?: string[],
|
||||
allowedExt?: string[],
|
||||
) {
|
||||
let currentFiles = fs.readdirSync(dirPath)
|
||||
|
||||
currentFiles.forEach((file) => {
|
||||
if (fs.statSync(dirPath + "/" + file).isDirectory()) {
|
||||
if (!skipDirs?.includes(file)) {
|
||||
accFiles = getAllFiles(dirPath + "/" + file, accFiles, skipDirs, skipExt)
|
||||
accFiles = getAllFiles(dirPath + "/" + file, accFiles, skipDirs, allowedExt)
|
||||
}
|
||||
} else {
|
||||
if (!skipExt?.includes(path.extname(file))) {
|
||||
if (allowedExt?.length) {
|
||||
if (allowedExt?.includes(path.extname(file))) {
|
||||
accFiles.push(path.join(dirPath, "/", file))
|
||||
}
|
||||
} else {
|
||||
accFiles.push(path.join(dirPath, "/", file))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# @blitzjs/config
|
||||
|
||||
## 2.0.0-alpha.37
|
||||
|
||||
## 2.0.0-alpha.36
|
||||
|
||||
## 2.0.0-alpha.35
|
||||
|
||||
## 2.0.0-alpha.34
|
||||
|
||||
## 2.0.0-alpha.33
|
||||
|
||||
## 2.0.0-alpha.32
|
||||
|
||||
## 2.0.0-alpha.31
|
||||
|
||||
## 2.0.0-alpha.30
|
||||
|
||||
## 2.0.0-alpha.29
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@blitzjs/config",
|
||||
"private": true,
|
||||
"version": "2.0.0-alpha.30",
|
||||
"version": "2.0.0-alpha.37",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "5.9.1",
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# @blitzjs/generator
|
||||
|
||||
## 2.0.0-alpha.37
|
||||
|
||||
## 2.0.0-alpha.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4cad9cca: Update codemod and template with a new queryClient import location
|
||||
|
||||
## 2.0.0-alpha.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e3750b04: codemod fixes
|
||||
|
||||
## 2.0.0-alpha.34
|
||||
|
||||
## 2.0.0-alpha.33
|
||||
|
||||
## 2.0.0-alpha.32
|
||||
|
||||
## 2.0.0-alpha.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 17ce29e5: Update RPC plugin setup in templates
|
||||
|
||||
## 2.0.0-alpha.30
|
||||
|
||||
## 2.0.0-alpha.29
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/generator",
|
||||
"version": "2.0.0-alpha.30",
|
||||
"version": "2.0.0-alpha.37",
|
||||
"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.30",
|
||||
"@blitzjs/config": "2.0.0-alpha.37",
|
||||
"@juanm04/cpx": "2.0.1",
|
||||
"@types/babel__core": "7.1.19",
|
||||
"@types/diff": "5.0.2",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NotFoundError, AuthenticationError } from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { authenticateUser } from "./login"
|
||||
import { ChangePassword } from "../validations"
|
||||
import { resolver } from "@blitzjs/rpc"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { hash256 } from "@blitzjs/auth"
|
||||
import forgotPassword from "./forgotPassword"
|
||||
import previewEmail from "preview-email"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { generateToken, hash256 } from "@blitzjs/auth"
|
||||
import { resolver } from "@blitzjs/rpc"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { forgotPasswordMailer } from "mailers/forgotPasswordMailer"
|
||||
import { ForgotPassword } from "../validations"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import resetPassword from "./resetPassword"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { SecurePassword, hash256 } from "@blitzjs/auth"
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SecurePassword, hash256 } from "@blitzjs/auth"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { ResetPassword } from "../validations"
|
||||
import login from "./login"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { SecurePassword } from "@blitzjs/auth"
|
||||
|
||||
export default async function signup(input, ctx) {
|
||||
|
||||
@@ -2,17 +2,11 @@ import { AuthClientPlugin } from "@blitzjs/auth"
|
||||
import { setupBlitzClient } from "@blitzjs/next"
|
||||
import { BlitzRpcPlugin } from "@blitzjs/rpc"
|
||||
|
||||
export const { withBlitz } = setupBlitzClient({
|
||||
export const { withBlitz, queryClient } = setupBlitzClient({
|
||||
plugins: [
|
||||
AuthClientPlugin({
|
||||
cookiePrefix: "__safeNameSlug__-cookie-prefix",
|
||||
}),
|
||||
BlitzRpcPlugin({
|
||||
reactQueryOptions: {
|
||||
queries: {
|
||||
staleTime: 7000,
|
||||
},
|
||||
},
|
||||
}),
|
||||
BlitzRpcPlugin({}),
|
||||
],
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { setupBlitzServer } from "@blitzjs/next"
|
||||
import { AuthServerPlugin, PrismaStorage } from "@blitzjs/auth"
|
||||
import {db} from "db"
|
||||
import db from "db"
|
||||
import { simpleRolesIsAuthorized } from "@blitzjs/auth"
|
||||
|
||||
export const { gSSP, gSP, api } = setupBlitzServer({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Ctx } from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
|
||||
export default async function getCurrentUser(_ = null, { session }: Ctx) {
|
||||
if (!session.userId) return null
|
||||
|
||||
@@ -5,4 +5,4 @@ const EnhancedPrisma = enhancePrisma(PrismaClient)
|
||||
|
||||
export * from "@prisma/client"
|
||||
const db = new EnhancedPrisma()
|
||||
export { db }
|
||||
export default db
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Ctx} from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import {z} from "zod"
|
||||
|
||||
if (process.env.parentModel) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Ctx} from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import {z} from "zod"
|
||||
|
||||
const Delete__ModelName__Input = z.object({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import {z} from "zod"
|
||||
|
||||
const Update__ModelName__Input = z.object({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Ctx, NotFoundError} from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import {z} from "zod"
|
||||
|
||||
const Get__ModelName__Input = z.object({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {paginate, Ctx} from "blitz"
|
||||
import { db } from "db"
|
||||
import db from "db"
|
||||
import { Prisma } from "@prisma/client"
|
||||
|
||||
interface Get__ModelNames__Input
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"@typescript-eslint/parser": "5.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-alpha.30",
|
||||
"@blitzjs/config": "2.0.0-alpha.37",
|
||||
"@types/react": "18.0.1",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"react": "18.0.0",
|
||||
|
||||
380
pnpm-lock.yaml
generated
380
pnpm-lock.yaml
generated
@@ -50,7 +50,7 @@ importers:
|
||||
"@types/node": 17.0.16
|
||||
"@types/preview-email": 2.0.1
|
||||
"@types/react": 18.0.1
|
||||
blitz: workspace:2.0.0-alpha.30
|
||||
blitz: workspace:2.0.0-alpha.37
|
||||
eslint: 7.32.0
|
||||
husky: 7.0.4
|
||||
jest: 27.5.1
|
||||
@@ -432,8 +432,8 @@ importers:
|
||||
|
||||
packages/blitz:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.30
|
||||
"@blitzjs/generator": 2.0.0-alpha.30
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.37
|
||||
"@blitzjs/generator": 2.0.0-alpha.37
|
||||
"@types/cookie": 0.4.1
|
||||
"@types/cross-spawn": 6.0.2
|
||||
"@types/debug": 4.1.7
|
||||
@@ -539,7 +539,7 @@ importers:
|
||||
|
||||
packages/blitz-auth:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.30
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.37
|
||||
"@testing-library/react": 13.0.0
|
||||
"@testing-library/react-hooks": 7.0.2
|
||||
"@types/b64-lite": 1.3.0
|
||||
@@ -553,7 +553,7 @@ importers:
|
||||
"@types/secure-password": 3.1.1
|
||||
b64-lite: 1.4.0
|
||||
bad-behavior: 1.0.1
|
||||
blitz: 2.0.0-alpha.30
|
||||
blitz: 2.0.0-alpha.37
|
||||
cookie: 0.4.1
|
||||
cookie-session: 2.0.0
|
||||
debug: 4.3.3
|
||||
@@ -604,8 +604,8 @@ importers:
|
||||
|
||||
packages/blitz-next:
|
||||
specifiers:
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.30
|
||||
"@blitzjs/rpc": 2.0.0-alpha.30
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.37
|
||||
"@blitzjs/rpc": 2.0.0-alpha.37
|
||||
"@testing-library/dom": 8.13.0
|
||||
"@testing-library/jest-dom": 5.16.3
|
||||
"@testing-library/react": 13.0.0
|
||||
@@ -617,7 +617,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.30
|
||||
blitz: 2.0.0-alpha.37
|
||||
cross-spawn: 7.0.3
|
||||
debug: 4.3.3
|
||||
find-up: 4.1.0
|
||||
@@ -669,14 +669,14 @@ importers:
|
||||
|
||||
packages/blitz-rpc:
|
||||
specifiers:
|
||||
"@blitzjs/auth": 2.0.0-alpha.30
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.30
|
||||
"@blitzjs/auth": 2.0.0-alpha.37
|
||||
"@blitzjs/config": workspace:2.0.0-alpha.37
|
||||
"@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.30
|
||||
blitz: 2.0.0-alpha.37
|
||||
chalk: ^4.1.0
|
||||
debug: 4.3.3
|
||||
next: 12.1.6-canary.17
|
||||
@@ -718,12 +718,12 @@ importers:
|
||||
"@babel/plugin-syntax-typescript": 7.17.12
|
||||
"@babel/preset-env": 7.12.10
|
||||
"@blitzjs/config": workspace:*
|
||||
"@blitzjs/generator": 2.0.0-alpha.30
|
||||
"@blitzjs/generator": 2.0.0-alpha.37
|
||||
"@types/jscodeshift": 0.11.2
|
||||
"@types/node": 17.0.16
|
||||
arg: 5.0.1
|
||||
ast-types: 0.14.2
|
||||
blitz: 2.0.0-alpha.30
|
||||
blitz: 2.0.0-alpha.37
|
||||
chalk: ^4.1.0
|
||||
cross-spawn: 7.0.3
|
||||
debug: 4.3.3
|
||||
@@ -778,7 +778,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.30
|
||||
"@blitzjs/config": 2.0.0-alpha.37
|
||||
"@juanm04/cpx": 2.0.1
|
||||
"@mrleebo/prisma-ast": 0.2.6
|
||||
"@types/babel__core": 7.1.19
|
||||
@@ -869,7 +869,7 @@ importers:
|
||||
|
||||
packages/pkg-template:
|
||||
specifiers:
|
||||
"@blitzjs/config": 2.0.0-alpha.30
|
||||
"@blitzjs/config": 2.0.0-alpha.37
|
||||
"@types/react": 18.0.1
|
||||
"@types/react-dom": 17.0.14
|
||||
"@typescript-eslint/eslint-plugin": 5.9.1
|
||||
@@ -940,7 +940,7 @@ packages:
|
||||
"@babel/parser": 7.18.4
|
||||
"@babel/template": 7.16.7
|
||||
"@babel/traverse": 7.18.2
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
convert-source-map: 1.8.0
|
||||
debug: 4.3.4
|
||||
gensync: 1.0.0-beta.2
|
||||
@@ -2293,7 +2293,7 @@ packages:
|
||||
"@babel/helper-module-imports": 7.16.7
|
||||
"@babel/helper-plugin-utils": 7.17.12
|
||||
"@babel/plugin-syntax-jsx": 7.17.12_@babel+core@7.18.2
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
dev: true
|
||||
|
||||
/@babel/plugin-transform-regenerator/7.18.0_@babel+core@7.12.10:
|
||||
@@ -2589,7 +2589,7 @@ packages:
|
||||
}
|
||||
engines: {node: ">=6.9.0"}
|
||||
dependencies:
|
||||
core-js-pure: 3.22.7
|
||||
core-js-pure: 3.22.8
|
||||
regenerator-runtime: 0.13.9
|
||||
|
||||
/@babel/runtime/7.18.3:
|
||||
@@ -3344,7 +3344,7 @@ packages:
|
||||
}
|
||||
dependencies:
|
||||
"@babel/runtime": 7.18.3
|
||||
"@types/node": 12.20.52
|
||||
"@types/node": 12.20.55
|
||||
find-up: 4.1.0
|
||||
fs-extra: 8.1.0
|
||||
dev: false
|
||||
@@ -3980,7 +3980,7 @@ packages:
|
||||
}
|
||||
dependencies:
|
||||
"@babel/parser": 7.18.4
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
"@types/babel__generator": 7.6.4
|
||||
"@types/babel__template": 7.4.1
|
||||
"@types/babel__traverse": 7.17.1
|
||||
@@ -3991,7 +3991,7 @@ packages:
|
||||
integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==,
|
||||
}
|
||||
dependencies:
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
|
||||
/@types/babel__template/7.4.1:
|
||||
resolution:
|
||||
@@ -4000,7 +4000,7 @@ packages:
|
||||
}
|
||||
dependencies:
|
||||
"@babel/parser": 7.18.4
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
|
||||
/@types/babel__traverse/7.17.1:
|
||||
resolution:
|
||||
@@ -4008,7 +4008,7 @@ packages:
|
||||
integrity: sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA==,
|
||||
}
|
||||
dependencies:
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
|
||||
/@types/body-parser/1.19.2:
|
||||
resolution:
|
||||
@@ -4260,10 +4260,10 @@ packages:
|
||||
jest-matcher-utils: 27.5.1
|
||||
pretty-format: 27.5.1
|
||||
|
||||
/@types/jest/27.5.1:
|
||||
/@types/jest/28.1.1:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-fUy7YRpT+rHXto1YlL+J9rs0uLGyiqVt3ZOTQR+4ROc47yNl8WLdVLgUloBRhOxP1PZvguHl44T3H0wAWxahYQ==,
|
||||
integrity: sha512-C2p7yqleUKtCkVjlOur9BWVA4HgUQmEj/HWCt5WzZ5mLXrWnyIfl0wGuArc+kBXsy0ZZfLp+7dywB4HtSVYGVA==,
|
||||
}
|
||||
dependencies:
|
||||
jest-matcher-utils: 27.5.1
|
||||
@@ -4400,10 +4400,10 @@ packages:
|
||||
form-data: 3.0.1
|
||||
dev: true
|
||||
|
||||
/@types/node/12.20.52:
|
||||
/@types/node/12.20.55:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-cfkwWw72849SNYp3Zx0IcIs25vABmFh73xicxhCkTcvtZQeIez15PpwQN8fY3RD7gv1Wrxlc9MEtfMORZDEsGw==,
|
||||
integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==,
|
||||
}
|
||||
dev: false
|
||||
|
||||
@@ -4486,10 +4486,10 @@ packages:
|
||||
}
|
||||
dev: true
|
||||
|
||||
/@types/prettier/2.6.1:
|
||||
/@types/prettier/2.6.3:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-XFjFHmaLVifrAKaZ+EKghFHtHSUonyw8P2Qmy2/+osBnrKbH9UYtlK10zg8/kCt47MFilll/DEDKy3DHfJ0URw==,
|
||||
integrity: sha512-ymZk3LEC/fsut+/Q5qejp6R9O1rMxz3XaRHDV6kX8MrGAhOSPqVARbDi+EZvInBpw+BnCX3TD240byVkOfQsHg==,
|
||||
}
|
||||
|
||||
/@types/preview-email/2.0.1:
|
||||
@@ -4652,7 +4652,7 @@ packages:
|
||||
integrity: sha512-oKZe+Mf4ioWlMuzVBaXQ9WDnEm1+umLx0InILg+yvZVBBDmzV5KfZyLrCvadtWcx8+916jLmHafcmqqffl+iIw==,
|
||||
}
|
||||
dependencies:
|
||||
"@types/jest": 27.5.1
|
||||
"@types/jest": 28.1.1
|
||||
dev: true
|
||||
|
||||
/@types/testing-library__react-hooks/4.0.0_zpnidt7m3osuk7shl3s4oenomq:
|
||||
@@ -4774,16 +4774,16 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@typescript-eslint/experimental-utils/5.26.0_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
/@typescript-eslint/experimental-utils/5.27.1_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-OgUGXC/teXD8PYOkn33RSwBJPVwL0I2ipm5OHr9g9cfAhVrPC2DxQiWqaq88MNO5mbr/ZWnav3EVBpuwDreS5Q==,
|
||||
integrity: sha512-Vd8uewIixGP93sEnmTRIH6jHZYRQRkGPDPpapACMvitJKX8335VHNyqKTE+mZ+m3E2c5VznTZfSsSsS5IF7vUA==,
|
||||
}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
dependencies:
|
||||
"@typescript-eslint/utils": 5.26.0_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
"@typescript-eslint/utils": 5.27.1_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
eslint: 7.32.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
@@ -4831,10 +4831,10 @@ packages:
|
||||
- typescript
|
||||
dev: false
|
||||
|
||||
/@typescript-eslint/parser/5.26.0_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
/@typescript-eslint/parser/5.27.1_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-n/IzU87ttzIdnAH5vQ4BBDnLPly7rC5VnjN3m0xBG82HK6rhRxnCb3w/GyWbNDghPd+NktJqB/wl6+YkzZ5T5Q==,
|
||||
integrity: sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==,
|
||||
}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
@@ -4844,9 +4844,9 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager": 5.26.0
|
||||
"@typescript-eslint/types": 5.26.0
|
||||
"@typescript-eslint/typescript-estree": 5.26.0_typescript@4.6.3
|
||||
"@typescript-eslint/scope-manager": 5.27.1
|
||||
"@typescript-eslint/types": 5.27.1
|
||||
"@typescript-eslint/typescript-estree": 5.27.1_typescript@4.6.3
|
||||
debug: 4.3.4
|
||||
eslint: 7.32.0
|
||||
typescript: 4.6.3
|
||||
@@ -4899,15 +4899,15 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@typescript-eslint/scope-manager/5.26.0:
|
||||
/@typescript-eslint/scope-manager/5.27.1:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-gVzTJUESuTwiju/7NiTb4c5oqod8xt5GhMbExKsCTp6adU3mya6AGJ4Pl9xC7x2DX9UYFsjImC0mA62BCY22Iw==,
|
||||
integrity: sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg==,
|
||||
}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.26.0
|
||||
"@typescript-eslint/visitor-keys": 5.26.0
|
||||
"@typescript-eslint/types": 5.27.1
|
||||
"@typescript-eslint/visitor-keys": 5.27.1
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/scope-manager/5.9.1:
|
||||
@@ -4963,10 +4963,10 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@typescript-eslint/types/5.26.0:
|
||||
/@typescript-eslint/types/5.27.1:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-8794JZFE1RN4XaExLWLI2oSXsVImNkl79PzTOOWt9h0UHROwJedNOD2IJyfL0NbddFllcktGIO2aOu10avQQyA==,
|
||||
integrity: sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg==,
|
||||
}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dev: true
|
||||
@@ -4978,10 +4978,10 @@ packages:
|
||||
}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
||||
/@typescript-eslint/typescript-estree/5.26.0_typescript@4.6.3:
|
||||
/@typescript-eslint/typescript-estree/5.27.1_typescript@4.6.3:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-EyGpw6eQDsfD6jIqmXP3rU5oHScZ51tL/cZgFbFBvWuCwrIptl+oueUZzSmLtxFuSOQ9vDcJIs+279gnJkfd1w==,
|
||||
integrity: sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw==,
|
||||
}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
@@ -4990,8 +4990,8 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.26.0
|
||||
"@typescript-eslint/visitor-keys": 5.26.0
|
||||
"@typescript-eslint/types": 5.27.1
|
||||
"@typescript-eslint/visitor-keys": 5.27.1
|
||||
debug: 4.3.4
|
||||
globby: 11.1.0
|
||||
is-glob: 4.0.3
|
||||
@@ -5025,19 +5025,19 @@ packages:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
/@typescript-eslint/utils/5.26.0_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
/@typescript-eslint/utils/5.27.1_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-PJFwcTq2Pt4AMOKfe3zQOdez6InIDOjUJJD3v3LyEtxHGVVRK3Vo7Dd923t/4M9hSH2q2CLvcTdxlLPjcIk3eg==,
|
||||
integrity: sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w==,
|
||||
}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
dependencies:
|
||||
"@types/json-schema": 7.0.11
|
||||
"@typescript-eslint/scope-manager": 5.26.0
|
||||
"@typescript-eslint/types": 5.26.0
|
||||
"@typescript-eslint/typescript-estree": 5.26.0_typescript@4.6.3
|
||||
"@typescript-eslint/scope-manager": 5.27.1
|
||||
"@typescript-eslint/types": 5.27.1
|
||||
"@typescript-eslint/typescript-estree": 5.27.1_typescript@4.6.3
|
||||
eslint: 7.32.0
|
||||
eslint-scope: 5.1.1
|
||||
eslint-utils: 3.0.0_eslint@7.32.0
|
||||
@@ -5046,14 +5046,14 @@ packages:
|
||||
- typescript
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/visitor-keys/5.26.0:
|
||||
/@typescript-eslint/visitor-keys/5.27.1:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-wei+ffqHanYDOQgg/fS6Hcar6wAWv0CUPQ3TZzOWd2BLfgP539rb49bwua8WRAs7R6kOSLn82rfEu2ro6Llt8Q==,
|
||||
integrity: sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ==,
|
||||
}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.26.0
|
||||
"@typescript-eslint/types": 5.27.1
|
||||
eslint-visitor-keys: 3.3.0
|
||||
dev: true
|
||||
|
||||
@@ -5508,10 +5508,10 @@ packages:
|
||||
}
|
||||
dev: false
|
||||
|
||||
/async/3.2.3:
|
||||
/async/3.2.4:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==,
|
||||
integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==,
|
||||
}
|
||||
dev: false
|
||||
|
||||
@@ -5643,7 +5643,7 @@ packages:
|
||||
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
|
||||
dependencies:
|
||||
"@babel/template": 7.16.7
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
"@types/babel__core": 7.1.19
|
||||
"@types/babel__traverse": 7.17.1
|
||||
|
||||
@@ -5689,7 +5689,7 @@ packages:
|
||||
}
|
||||
engines: {node: ">= 10.0.0"}
|
||||
dependencies:
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
dev: true
|
||||
|
||||
/babylon/6.18.0:
|
||||
@@ -6540,7 +6540,7 @@ packages:
|
||||
}
|
||||
dependencies:
|
||||
"@babel/parser": 7.18.4
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
dev: true
|
||||
|
||||
/content-disposition/0.5.4:
|
||||
@@ -6632,10 +6632,10 @@ packages:
|
||||
browserslist: 4.20.3
|
||||
semver: 7.0.0
|
||||
|
||||
/core-js-pure/3.22.7:
|
||||
/core-js-pure/3.22.8:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-wTriFxiZI+C8msGeh7fJcbC/a0V8fdInN1oS2eK79DMBGs8iIJiXhtFJCiT3rBa8w6zroHWW3p8ArlujZ/Mz+w==,
|
||||
integrity: sha512-bOxbZIy9S5n4OVH63XaLVXZ49QKicjowDx/UELyJ68vxfCRpYsbyh/WNZNfEfAk+ekA8vSjt+gCDpvh672bc3w==,
|
||||
}
|
||||
requiresBuild: true
|
||||
|
||||
@@ -7456,7 +7456,7 @@ packages:
|
||||
is-shared-array-buffer: 1.0.2
|
||||
is-string: 1.0.7
|
||||
is-weakref: 1.0.2
|
||||
object-inspect: 1.12.1
|
||||
object-inspect: 1.12.2
|
||||
object-keys: 1.1.1
|
||||
object.assign: 4.1.2
|
||||
regexp.prototype.flags: 1.4.3
|
||||
@@ -8325,11 +8325,11 @@ packages:
|
||||
dependencies:
|
||||
"@next/eslint-plugin-next": 12.1.6
|
||||
"@rushstack/eslint-patch": 1.1.3
|
||||
"@typescript-eslint/parser": 5.26.0_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
"@typescript-eslint/parser": 5.27.1_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
eslint: 7.32.0
|
||||
eslint-import-resolver-node: 0.3.6
|
||||
eslint-import-resolver-typescript: 2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy
|
||||
eslint-plugin-import: 2.26.0_y6whhoimfujgclng5bly5nyove
|
||||
eslint-plugin-import: 2.26.0_wpehoe7sv7ux6tdegk3fwlchdi
|
||||
eslint-plugin-jsx-a11y: 6.5.1_eslint@7.32.0
|
||||
eslint-plugin-react: 7.30.0_eslint@7.32.0
|
||||
eslint-plugin-react-hooks: 4.5.0_eslint@7.32.0
|
||||
@@ -8393,7 +8393,7 @@ packages:
|
||||
dependencies:
|
||||
debug: 4.3.4
|
||||
eslint: 7.32.0
|
||||
eslint-plugin-import: 2.26.0_y6whhoimfujgclng5bly5nyove
|
||||
eslint-plugin-import: 2.26.0_wpehoe7sv7ux6tdegk3fwlchdi
|
||||
glob: 7.2.0
|
||||
is-glob: 4.0.3
|
||||
resolve: 1.22.0
|
||||
@@ -8402,6 +8402,36 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/eslint-module-utils/2.7.3_4wf6ctbofaywkfx7kzk32kp7ge:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==,
|
||||
}
|
||||
engines: {node: ">=4"}
|
||||
peerDependencies:
|
||||
"@typescript-eslint/parser": "*"
|
||||
eslint-import-resolver-node: "*"
|
||||
eslint-import-resolver-typescript: "*"
|
||||
eslint-import-resolver-webpack: "*"
|
||||
peerDependenciesMeta:
|
||||
"@typescript-eslint/parser":
|
||||
optional: true
|
||||
eslint-import-resolver-node:
|
||||
optional: true
|
||||
eslint-import-resolver-typescript:
|
||||
optional: true
|
||||
eslint-import-resolver-webpack:
|
||||
optional: true
|
||||
dependencies:
|
||||
"@typescript-eslint/parser": 5.27.1_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
debug: 3.2.7
|
||||
eslint-import-resolver-node: 0.3.6
|
||||
eslint-import-resolver-typescript: 2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy
|
||||
find-up: 2.1.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/eslint-module-utils/2.7.3_dbnyosdljuntx5ukba4qoruhni:
|
||||
resolution:
|
||||
{
|
||||
@@ -8432,36 +8462,6 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/eslint-module-utils/2.7.3_yxrttxwxgn5axzfjkhhzgts2eq:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==,
|
||||
}
|
||||
engines: {node: ">=4"}
|
||||
peerDependencies:
|
||||
"@typescript-eslint/parser": "*"
|
||||
eslint-import-resolver-node: "*"
|
||||
eslint-import-resolver-typescript: "*"
|
||||
eslint-import-resolver-webpack: "*"
|
||||
peerDependenciesMeta:
|
||||
"@typescript-eslint/parser":
|
||||
optional: true
|
||||
eslint-import-resolver-node:
|
||||
optional: true
|
||||
eslint-import-resolver-typescript:
|
||||
optional: true
|
||||
eslint-import-resolver-webpack:
|
||||
optional: true
|
||||
dependencies:
|
||||
"@typescript-eslint/parser": 5.26.0_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
debug: 3.2.7
|
||||
eslint-import-resolver-node: 0.3.6
|
||||
eslint-import-resolver-typescript: 2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy
|
||||
find-up: 2.1.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/eslint-plugin-import/2.26.0_oisyptfcq77gha3jnxd6iiraai:
|
||||
resolution:
|
||||
{
|
||||
@@ -8495,7 +8495,7 @@ packages:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/eslint-plugin-import/2.26.0_y6whhoimfujgclng5bly5nyove:
|
||||
/eslint-plugin-import/2.26.0_wpehoe7sv7ux6tdegk3fwlchdi:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==,
|
||||
@@ -8508,14 +8508,14 @@ packages:
|
||||
"@typescript-eslint/parser":
|
||||
optional: true
|
||||
dependencies:
|
||||
"@typescript-eslint/parser": 5.26.0_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
"@typescript-eslint/parser": 5.27.1_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
array-includes: 3.1.5
|
||||
array.prototype.flat: 1.3.0
|
||||
debug: 2.6.9
|
||||
doctrine: 2.1.0
|
||||
eslint: 7.32.0
|
||||
eslint-import-resolver-node: 0.3.6
|
||||
eslint-module-utils: 2.7.3_yxrttxwxgn5axzfjkhhzgts2eq
|
||||
eslint-module-utils: 2.7.3_4wf6ctbofaywkfx7kzk32kp7ge
|
||||
has: 1.0.3
|
||||
is-core-module: 2.8.1
|
||||
is-glob: 4.0.3
|
||||
@@ -8658,7 +8658,7 @@ packages:
|
||||
peerDependencies:
|
||||
eslint: ^7.5.0 || ^8.0.0
|
||||
dependencies:
|
||||
"@typescript-eslint/experimental-utils": 5.26.0_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
"@typescript-eslint/experimental-utils": 5.27.1_hrkuebk64jiu2ut2d2sm4oylnu
|
||||
eslint: 7.32.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
@@ -10781,7 +10781,7 @@ packages:
|
||||
engines: {node: ">=10"}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
async: 3.2.3
|
||||
async: 3.2.4
|
||||
chalk: 4.1.2
|
||||
filelist: 1.0.4
|
||||
minimatch: 3.1.2
|
||||
@@ -11214,11 +11214,11 @@ packages:
|
||||
"@babel/generator": 7.18.2
|
||||
"@babel/plugin-syntax-typescript": 7.17.12_@babel+core@7.18.2
|
||||
"@babel/traverse": 7.18.2
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
"@jest/transform": 27.5.1
|
||||
"@jest/types": 27.5.1
|
||||
"@types/babel__traverse": 7.17.1
|
||||
"@types/prettier": 2.6.1
|
||||
"@types/prettier": 2.6.3
|
||||
babel-preset-current-node-syntax: 1.0.1_@babel+core@7.18.2
|
||||
chalk: 4.1.2
|
||||
expect: 27.5.1
|
||||
@@ -11341,10 +11341,10 @@ packages:
|
||||
engines: {node: ">=10"}
|
||||
dev: true
|
||||
|
||||
/jpeg-js/0.4.3:
|
||||
/jpeg-js/0.4.4:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ru1HWKek8octvUHFHvE5ZzQ1yAsJmIvRdGWvSoKV52XKyuyYA437QWDttXT8eZXDSbuMpHlLzPDZUPd6idIz+Q==,
|
||||
integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
@@ -11491,7 +11491,7 @@ packages:
|
||||
whatwg-encoding: 2.0.0
|
||||
whatwg-mimetype: 3.0.0
|
||||
whatwg-url: 10.0.0
|
||||
ws: 8.7.0
|
||||
ws: 8.8.0
|
||||
xml-name-validator: 4.0.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
@@ -11856,7 +11856,7 @@ packages:
|
||||
listr2: 3.14.0
|
||||
micromatch: 4.0.5
|
||||
normalize-path: 3.0.0
|
||||
object-inspect: 1.12.1
|
||||
object-inspect: 1.12.2
|
||||
string-argv: 0.3.1
|
||||
supports-color: 9.2.2
|
||||
yaml: 1.10.2
|
||||
@@ -12130,10 +12130,10 @@ packages:
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/macos-release/3.0.1:
|
||||
/macos-release/3.1.0:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-3l6OrhdDg2H2SigtuN3jBh+5dRJRWxNKuJTPBbGeNJTsmt/pj9PO25wYaNb05NuNmAsl435j4rDP6rgNXz7s7g==,
|
||||
integrity: sha512-/M/R0gCDgM+Cv1IuBG1XGdfTFnMEG6PZeT+KGWHO/OG+imqmaD9CH5vHBTycEM3+Kc4uG2Il+tFAuUWLqQOeUA==,
|
||||
}
|
||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
dev: false
|
||||
@@ -12588,10 +12588,10 @@ packages:
|
||||
}
|
||||
engines: {node: ">=4"}
|
||||
|
||||
/mrmime/1.0.0:
|
||||
/mrmime/1.0.1:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ==,
|
||||
integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==,
|
||||
}
|
||||
engines: {node: ">=10"}
|
||||
dev: true
|
||||
@@ -12996,10 +12996,10 @@ packages:
|
||||
kind-of: 3.2.2
|
||||
dev: false
|
||||
|
||||
/object-inspect/1.12.1:
|
||||
/object-inspect/1.12.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-Y/jF6vnvEtOPGiKD1+q+X0CiUYRQtEHp89MLLUJ7TUivtH8Ugn2+3A7Rynqk7BRsAoqeOQWnFnjpDrKSxDgIGA==,
|
||||
integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==,
|
||||
}
|
||||
|
||||
/object-keys/1.1.1:
|
||||
@@ -13205,7 +13205,7 @@ packages:
|
||||
}
|
||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
dependencies:
|
||||
macos-release: 3.0.1
|
||||
macos-release: 3.1.0
|
||||
windows-release: 5.0.1
|
||||
dev: false
|
||||
|
||||
@@ -13755,7 +13755,7 @@ packages:
|
||||
debug: 4.3.4
|
||||
extract-zip: 2.0.1
|
||||
https-proxy-agent: 5.0.1
|
||||
jpeg-js: 0.4.3
|
||||
jpeg-js: 0.4.4
|
||||
mime: 2.6.0
|
||||
pngjs: 5.0.0
|
||||
progress: 2.0.3
|
||||
@@ -14598,7 +14598,10 @@ packages:
|
||||
dev: false
|
||||
|
||||
/repeat-string/1.6.1:
|
||||
resolution: {integrity: sha1-jcrkcOHIirwtYA//Sndihtp15jc=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==,
|
||||
}
|
||||
engines: {node: ">=0.10"}
|
||||
dev: false
|
||||
|
||||
@@ -14611,7 +14614,10 @@ packages:
|
||||
dev: false
|
||||
|
||||
/require-directory/2.1.1:
|
||||
resolution: {integrity: sha1-jGStX9MNqxyXbiNE/+f3kqam30I=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
|
||||
/require-from-string/2.0.2:
|
||||
@@ -14659,7 +14665,10 @@ packages:
|
||||
engines: {node: ">=8"}
|
||||
|
||||
/resolve-url/0.2.1:
|
||||
resolution: {integrity: sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==,
|
||||
}
|
||||
deprecated: https://github.com/lydell/resolve-url#deprecated
|
||||
dev: false
|
||||
|
||||
@@ -14691,7 +14700,10 @@ packages:
|
||||
path-parse: 1.0.7
|
||||
|
||||
/responselike/1.0.2:
|
||||
resolution: {integrity: sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==,
|
||||
}
|
||||
dependencies:
|
||||
lowercase-keys: 1.0.1
|
||||
dev: false
|
||||
@@ -14723,7 +14735,10 @@ packages:
|
||||
engines: {node: ">=0.12"}
|
||||
|
||||
/retry/0.12.0:
|
||||
resolution: {integrity: sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==,
|
||||
}
|
||||
engines: {node: ">= 4"}
|
||||
dev: true
|
||||
|
||||
@@ -14836,7 +14851,10 @@ packages:
|
||||
}
|
||||
|
||||
/safe-regex/1.1.0:
|
||||
resolution: {integrity: sha1-QKNmnzsHfR6UPURinhV91IAjvy4=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==,
|
||||
}
|
||||
dependencies:
|
||||
ret: 0.1.15
|
||||
dev: false
|
||||
@@ -14899,7 +14917,7 @@ packages:
|
||||
dependencies:
|
||||
jszip: 3.10.0
|
||||
tmp: 0.2.1
|
||||
ws: 8.7.0
|
||||
ws: 8.8.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- utf-8-validate
|
||||
@@ -14986,7 +15004,10 @@ packages:
|
||||
dev: true
|
||||
|
||||
/set-blocking/2.0.0:
|
||||
resolution: {integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==,
|
||||
}
|
||||
dev: false
|
||||
|
||||
/set-value/2.0.1:
|
||||
@@ -15003,7 +15024,10 @@ packages:
|
||||
dev: false
|
||||
|
||||
/setimmediate/1.0.5:
|
||||
resolution: {integrity: sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/setprototypeof/1.2.0:
|
||||
@@ -15024,7 +15048,10 @@ packages:
|
||||
dev: false
|
||||
|
||||
/shebang-command/1.2.0:
|
||||
resolution: {integrity: sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dependencies:
|
||||
shebang-regex: 1.0.0
|
||||
@@ -15040,7 +15067,10 @@ packages:
|
||||
shebang-regex: 3.0.0
|
||||
|
||||
/shebang-regex/1.0.0:
|
||||
resolution: {integrity: sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dev: false
|
||||
|
||||
@@ -15066,7 +15096,7 @@ packages:
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
get-intrinsic: 1.1.1
|
||||
object-inspect: 1.12.1
|
||||
object-inspect: 1.12.2
|
||||
|
||||
/signal-exit/3.0.7:
|
||||
resolution:
|
||||
@@ -15089,7 +15119,7 @@ packages:
|
||||
engines: {node: ">= 10"}
|
||||
dependencies:
|
||||
"@polka/url": 1.0.0-next.21
|
||||
mrmime: 1.0.0
|
||||
mrmime: 1.0.1
|
||||
totalist: 1.1.0
|
||||
dev: true
|
||||
|
||||
@@ -15262,7 +15292,10 @@ packages:
|
||||
dev: false
|
||||
|
||||
/source-map/0.5.7:
|
||||
resolution: {integrity: sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
|
||||
/source-map/0.6.1:
|
||||
@@ -15342,7 +15375,10 @@ packages:
|
||||
dev: false
|
||||
|
||||
/sprintf-js/1.0.3:
|
||||
resolution: {integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==,
|
||||
}
|
||||
|
||||
/stack-utils/2.0.5:
|
||||
resolution:
|
||||
@@ -15354,7 +15390,10 @@ packages:
|
||||
escape-string-regexp: 2.0.0
|
||||
|
||||
/static-extend/0.1.2:
|
||||
resolution: {integrity: sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dependencies:
|
||||
define-property: 0.2.5
|
||||
@@ -15362,7 +15401,10 @@ packages:
|
||||
dev: false
|
||||
|
||||
/statuses/1.5.0:
|
||||
resolution: {integrity: sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==,
|
||||
}
|
||||
engines: {node: ">= 0.6"}
|
||||
dev: true
|
||||
|
||||
@@ -15493,14 +15535,20 @@ packages:
|
||||
ansi-regex: 6.0.1
|
||||
|
||||
/strip-bom-buf/1.0.0:
|
||||
resolution: {integrity: sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-1sUIL1jck0T1mhOLP2c696BIznzT525Lkub+n4jjMHjhjhoAQA6Ye659DxdlZBr0aLDMQoTxKIpnlqxgtwjsuQ==,
|
||||
}
|
||||
engines: {node: ">=4"}
|
||||
dependencies:
|
||||
is-utf8: 0.2.1
|
||||
dev: false
|
||||
|
||||
/strip-bom-stream/2.0.0:
|
||||
resolution: {integrity: sha1-+H217yYT9paKpUWr/h7HKLaoKco=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-yH0+mD8oahBZWnY43vxs4pSinn8SMKAdml/EOGBewoe1Y0Eitd0h2Mg3ZRiXruUW6L4P+lvZiEgbh0NgUGia1w==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dependencies:
|
||||
first-chunk-stream: 2.0.0
|
||||
@@ -15508,14 +15556,20 @@ packages:
|
||||
dev: false
|
||||
|
||||
/strip-bom/2.0.0:
|
||||
resolution: {integrity: sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dependencies:
|
||||
is-utf8: 0.2.1
|
||||
dev: false
|
||||
|
||||
/strip-bom/3.0.0:
|
||||
resolution: {integrity: sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==,
|
||||
}
|
||||
engines: {node: ">=4"}
|
||||
|
||||
/strip-bom/4.0.0:
|
||||
@@ -15526,7 +15580,10 @@ packages:
|
||||
engines: {node: ">=8"}
|
||||
|
||||
/strip-eof/1.0.0:
|
||||
resolution: {integrity: sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dev: false
|
||||
|
||||
@@ -15547,7 +15604,10 @@ packages:
|
||||
min-indent: 1.0.1
|
||||
|
||||
/strip-json-comments/2.0.1:
|
||||
resolution: {integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dev: false
|
||||
|
||||
@@ -15594,7 +15654,10 @@ packages:
|
||||
react: 18.0.0
|
||||
|
||||
/subarg/1.0.0:
|
||||
resolution: {integrity: sha1-9izxdYHplrSPyWVpn1TAauJouNI=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==,
|
||||
}
|
||||
dependencies:
|
||||
minimist: 1.2.6
|
||||
dev: true
|
||||
@@ -15741,7 +15804,10 @@ packages:
|
||||
dev: true
|
||||
|
||||
/text-table/0.2.0:
|
||||
resolution: {integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==,
|
||||
}
|
||||
|
||||
/throat/6.0.1:
|
||||
resolution:
|
||||
@@ -15750,7 +15816,10 @@ packages:
|
||||
}
|
||||
|
||||
/through/2.3.8:
|
||||
resolution: {integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==,
|
||||
}
|
||||
|
||||
/through2/3.0.2:
|
||||
resolution:
|
||||
@@ -15822,11 +15891,17 @@ packages:
|
||||
}
|
||||
|
||||
/to-fast-properties/2.0.0:
|
||||
resolution: {integrity: sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==,
|
||||
}
|
||||
engines: {node: ">=4"}
|
||||
|
||||
/to-object-path/0.3.0:
|
||||
resolution: {integrity: sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dependencies:
|
||||
kind-of: 3.2.2
|
||||
@@ -15841,7 +15916,10 @@ packages:
|
||||
dev: false
|
||||
|
||||
/to-regex-range/2.1.1:
|
||||
resolution: {integrity: sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==,
|
||||
}
|
||||
engines: {node: ">=0.10.0"}
|
||||
dependencies:
|
||||
is-number: 3.0.0
|
||||
@@ -16640,10 +16718,10 @@ packages:
|
||||
replace-ext: 1.0.1
|
||||
dev: false
|
||||
|
||||
/vite/2.9.9:
|
||||
/vite/2.9.12:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ffaam+NgHfbEmfw/Vuh6BHKKlI/XIAhxE5QSS7gFLIngxg171mg1P3a4LSRME0z2ZU1ScxoKzphkipcYwSD5Ew==,
|
||||
integrity: sha512-suxC36dQo9Rq1qMB2qiRorNJtJAdxguu5TMvBHOc/F370KvqAe9t48vYp+/TbPKRNrMh/J55tOUmkuIqstZaew==,
|
||||
}
|
||||
engines: {node: ">=12.2.0"}
|
||||
hasBin: true
|
||||
@@ -16696,7 +16774,7 @@ packages:
|
||||
local-pkg: 0.4.1
|
||||
tinypool: 0.1.3
|
||||
tinyspy: 0.3.2
|
||||
vite: 2.9.9
|
||||
vite: 2.9.12
|
||||
transitivePeerDependencies:
|
||||
- less
|
||||
- sass
|
||||
@@ -16980,7 +17058,7 @@ packages:
|
||||
engines: {node: ">= 10.0.0"}
|
||||
dependencies:
|
||||
"@babel/parser": 7.18.4
|
||||
"@babel/types": 7.17.12
|
||||
"@babel/types": 7.18.4
|
||||
assert-never: 1.2.1
|
||||
babel-walk: 3.0.0-canary-5
|
||||
dev: true
|
||||
@@ -17054,10 +17132,10 @@ packages:
|
||||
utf-8-validate:
|
||||
optional: true
|
||||
|
||||
/ws/8.7.0:
|
||||
/ws/8.8.0:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-c2gsP0PRwcLFzUiA8Mkr37/MI7ilIlHQxaEAtd0uNMbVMoy8puJyafRlm0bV9MbGSabUPeLrRRaqIBcFcA2Pqg==,
|
||||
integrity: sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==,
|
||||
}
|
||||
engines: {node: ">=10.0.0"}
|
||||
peerDependencies:
|
||||
|
||||
Reference in New Issue
Block a user