Compare commits
11 Commits
@blitzjs/c
...
bb-fix-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e08e9a348a | ||
|
|
f0f66c6214 | ||
|
|
37e7614f0c | ||
|
|
617f20fb21 | ||
|
|
a5bbfe2187 | ||
|
|
d89c3ac8cf | ||
|
|
d0e4308d81 | ||
|
|
5203e7e6ff | ||
|
|
860d21bea3 | ||
|
|
f3c64ffbaf | ||
|
|
44169979ef |
@@ -3945,46 +3945,6 @@
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jayu",
|
||||
"name": "Jakub Mazurek",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/11561585?v=4",
|
||||
"profile": "jayu.dev",
|
||||
"contributions": [
|
||||
"doc",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "maciej-ka",
|
||||
"name": "Maciej Kasprzyk",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5403694?v=4",
|
||||
"profile": "https://github.com/maciej-ka",
|
||||
"contributions": [
|
||||
"doc",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "justinsmid",
|
||||
"name": "Justin Smid",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/34271675?v=4",
|
||||
"profile": "https://github.com/justinsmid",
|
||||
"contributions": [
|
||||
"doc",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "rodobre",
|
||||
"name": "rodobre",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/52138375?v=4",
|
||||
"profile": "https://github.com/rodobre",
|
||||
"contributions": [
|
||||
"doc",
|
||||
"code"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Update examples of generate all in docs to include one column in model.
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
"blitz": patch
|
||||
"@blitzjs/next": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Upgrade tslog to `4.9.0`.
|
||||
|
||||
This due a [tslog issue](https://github.com/fullstack-build/tslog/issues/227) that causes tslog to crash when attempting to log an error whose constructor expects more than one argument.
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
blitz-auth: Fix webpack from following next-auth
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
blitz-auth: Support for Prisma v5
|
||||
|
||||
Internal: Make `handle` a required paramter while updating the `session` modal.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
---
|
||||
|
||||
Updated `useAuthenticatedBlitzContext` to now return `AuthenticatedCtx`
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
Make Next.js version stick to 13.4.5 when generating a new app
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@blitzjs/auth": minor
|
||||
---
|
||||
|
||||
Stop exporting `useAuthenticatedBlitzContext` from `@blitzjs/auth` this must be imported from `app/blitz-server.ts` file in order to work correctly
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix for tslog error `TypeError: Cannot read properties of undefined (reading 'map')` while using custom errors.
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Allow `.tsx` & `.jsx` file extensions to be used for resolvers
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
blitz-rpc: Cleanup Event Listeners - Fix potential memory leak by cleaning up any residual event listeners set by blitz.
|
||||
@@ -55,7 +55,6 @@
|
||||
"afraid-ears-repair",
|
||||
"big-boats-lay",
|
||||
"big-phones-bow",
|
||||
"big-turtles-tease",
|
||||
"blue-flowers-peel",
|
||||
"blue-pigs-tan",
|
||||
"brave-zebras-deny",
|
||||
@@ -74,12 +73,10 @@
|
||||
"chatty-gifts-whisper",
|
||||
"chilled-carrots-own",
|
||||
"chilly-candles-care",
|
||||
"chilly-jeans-fix",
|
||||
"chilly-nails-nail",
|
||||
"clean-hats-pump",
|
||||
"clean-hounds-laugh",
|
||||
"clean-walls-wink",
|
||||
"clever-hornets-talk",
|
||||
"clever-radios-lie",
|
||||
"cool-doors-invent",
|
||||
"cool-horses-check",
|
||||
@@ -88,7 +85,6 @@
|
||||
"curly-rules-speak",
|
||||
"curly-seas-serve",
|
||||
"curvy-days-attend",
|
||||
"curvy-drinks-perform",
|
||||
"cyan-bulldogs-heal",
|
||||
"cyan-cars-greet",
|
||||
"dirty-monkeys-greet",
|
||||
@@ -113,10 +109,8 @@
|
||||
"fast-toys-wash",
|
||||
"fast-trainers-kneel",
|
||||
"few-dogs-fetch",
|
||||
"few-elephants-approve",
|
||||
"few-hounds-worry",
|
||||
"few-shrimps-leave",
|
||||
"fifty-drinks-cry",
|
||||
"flat-bees-approve",
|
||||
"fluffy-coats-flow",
|
||||
"fluffy-mangos-begin",
|
||||
@@ -126,7 +120,6 @@
|
||||
"four-meals-fry",
|
||||
"four-radios-tickle",
|
||||
"four-sheep-judge",
|
||||
"fresh-camels-return",
|
||||
"fresh-crews-chew",
|
||||
"funny-cups-pay",
|
||||
"fuzzy-bees-warn",
|
||||
@@ -140,7 +133,6 @@
|
||||
"gold-horses-punch",
|
||||
"good-apes-drum",
|
||||
"good-insects-wink",
|
||||
"good-oranges-pretend",
|
||||
"gorgeous-birds-warn",
|
||||
"gorgeous-buses-scream",
|
||||
"gorgeous-games-obey",
|
||||
@@ -170,7 +162,6 @@
|
||||
"khaki-ducks-cheer",
|
||||
"khaki-pens-rest",
|
||||
"kind-walls-suffer",
|
||||
"large-hairs-battle",
|
||||
"late-steaks-give",
|
||||
"lazy-maps-sort",
|
||||
"lemon-games-press",
|
||||
@@ -196,17 +187,14 @@
|
||||
"modern-games-dream",
|
||||
"modern-ligers-behave",
|
||||
"moody-bags-walk",
|
||||
"moody-crews-travel",
|
||||
"moody-spoons-rhyme",
|
||||
"moody-squids-cheer",
|
||||
"nasty-suns-wash",
|
||||
"nervous-beds-travel",
|
||||
"nervous-dolls-rule",
|
||||
"nervous-shrimps-serve",
|
||||
"new-coats-turn",
|
||||
"new-olives-protect",
|
||||
"nice-boxes-travel",
|
||||
"nice-cats-lay",
|
||||
"nice-deers-dream",
|
||||
"nice-starfishes-live",
|
||||
"nine-bags-rhyme",
|
||||
@@ -231,7 +219,6 @@
|
||||
"plenty-gifts-provide",
|
||||
"plenty-kiwis-greet",
|
||||
"polite-lizards-love",
|
||||
"poor-crabs-drum",
|
||||
"poor-peas-lick",
|
||||
"poor-penguins-look",
|
||||
"poor-shrimps-think",
|
||||
@@ -255,7 +242,6 @@
|
||||
"rotten-rocks-remember",
|
||||
"rude-trainers-visit",
|
||||
"serious-mugs-leave",
|
||||
"shaggy-boxes-exercise",
|
||||
"shaggy-carpets-brake",
|
||||
"sharp-falcons-begin",
|
||||
"sharp-olives-sip",
|
||||
@@ -268,13 +254,11 @@
|
||||
"silly-peas-work",
|
||||
"silly-shoes-agree",
|
||||
"six-apricots-kick",
|
||||
"sixty-rockets-count",
|
||||
"slimy-humans-impress",
|
||||
"slimy-needles-taste",
|
||||
"slow-impalas-tap",
|
||||
"slow-walls-camp",
|
||||
"slow-walls-poke",
|
||||
"small-monkeys-battle",
|
||||
"small-socks-confess",
|
||||
"smooth-planets-admire",
|
||||
"smooth-rice-clap",
|
||||
@@ -304,7 +288,6 @@
|
||||
"tall-radios-clean",
|
||||
"tame-keys-reply",
|
||||
"tame-pumpkins-nail",
|
||||
"tame-rocks-unite",
|
||||
"tasty-maps-fetch",
|
||||
"tasty-news-collect",
|
||||
"tasty-squids-sin",
|
||||
@@ -344,7 +327,6 @@
|
||||
"wise-frogs-give",
|
||||
"wise-lies-relate",
|
||||
"wise-rabbits-complain",
|
||||
"yellow-numbers-serve",
|
||||
"young-birds-talk"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
"@blitzjs/next": patch
|
||||
"blitz": patch
|
||||
"@blitzjs/generator": patch
|
||||
---
|
||||
|
||||
- Updates `ts-log` peer dependency to `4.9.0`
|
||||
- Removes `javascript` from `blitz new` menu
|
||||
- Hot Fix the `Update Schema` when using blitz generator
|
||||
@@ -1,68 +0,0 @@
|
||||
---
|
||||
"@blitzjs/rpc": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
### Now we can configure Blitz RPC in the following way,
|
||||
|
||||
In your `[[...blitz]].ts` api file you can see the following settings
|
||||
```ts
|
||||
logging?: {
|
||||
/**
|
||||
* allowList Represents the list of routes for which logging should be enabled
|
||||
* If whiteList is defined then only those routes will be logged
|
||||
*/
|
||||
allowList?: string[]
|
||||
/**
|
||||
* blockList Represents the list of routes for which logging should be disabled
|
||||
* If blockList is defined then all routes except those will be logged
|
||||
*/
|
||||
blockList?: string[]
|
||||
/**
|
||||
* verbose Represents the flag to enable/disable logging
|
||||
* If verbose is true then Blitz RPC will log the input and output of each resolver
|
||||
*/
|
||||
verbose?: boolean
|
||||
/**
|
||||
* disablelevel Represents the flag to enable/disable logging for a particular level
|
||||
*/
|
||||
disablelevel?: "debug" | "info"
|
||||
}
|
||||
```
|
||||
```ts
|
||||
import { rpcHandler } from "@blitzjs/rpc"
|
||||
import { api } from "src/blitz-server"
|
||||
|
||||
export default api(
|
||||
rpcHandler({
|
||||
onError: console.log,
|
||||
formatError: (error) => {
|
||||
error.message = `FormatError handler: ${error.message}`
|
||||
return error
|
||||
},
|
||||
logging: {
|
||||
...
|
||||
}
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
Example:
|
||||
```ts
|
||||
export default api(
|
||||
rpcHandler({
|
||||
onError: console.log,
|
||||
formatError: (error) => {
|
||||
error.message = `FormatError handler: ${error.message}`
|
||||
return error
|
||||
},
|
||||
logging: {
|
||||
verbose: true,
|
||||
blockList: ["getCurrentUser", ...], //just write the resolver name [which is the resolver file name]
|
||||
},
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
This is enable verbose blitz rpc logging for all resolvers except the resolvers `getCurrentUser` and others mentioned in the `blockList`
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
"@blitzjs/auth": patch
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix Next-Auth integration: `Unable to use next-auth with provider: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]`
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"blitz": patch
|
||||
---
|
||||
|
||||
Fix log formatting to not show the path of blitz rpc
|
||||
35
.github/workflows/main.yml
vendored
35
.github/workflows/main.yml
vendored
@@ -7,8 +7,8 @@ on:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
|
||||
jobs:
|
||||
@@ -17,9 +17,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: pnpm/action-setup@v2.2.4
|
||||
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
with:
|
||||
version: 8.6.5
|
||||
version: 8.6.0
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
@@ -38,9 +38,9 @@ jobs:
|
||||
name: Build
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: pnpm/action-setup@v2.2.4
|
||||
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
with:
|
||||
version: 8.6.5
|
||||
version: 8.6.0
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
@@ -68,9 +68,9 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v2.2.4
|
||||
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
with:
|
||||
version: 8.6.5
|
||||
version: 8.6.0
|
||||
|
||||
- name: Setup node@16
|
||||
uses: actions/setup-node@v2
|
||||
@@ -111,7 +111,7 @@ jobs:
|
||||
echo "folders=$folders" >> $GITHUB_OUTPUT
|
||||
|
||||
Integration-Tests:
|
||||
name: "Integration Test: ${{matrix.folder}} @ ${{ matrix.os }}"
|
||||
name: "Integration Test: ${{matrix.folder}} @ ${{ matrix.os }} "
|
||||
needs: [find-integration-tests]
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -124,39 +124,32 @@ jobs:
|
||||
steps:
|
||||
- run: echo ${{matrix.folder}}
|
||||
- name: Checkout
|
||||
if: matrix.folder != 'next-13-app-dir' || matrix.os != 'windows-latest'
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup PNPM
|
||||
if: matrix.folder != 'next-13-app-dir' || matrix.os != 'windows-latest'
|
||||
uses: pnpm/action-setup@v2.2.4
|
||||
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
with:
|
||||
version: 8.6.5
|
||||
version: 8.6.0
|
||||
|
||||
- name: Setup node@18
|
||||
if: matrix.folder != 'next-13-app-dir' || matrix.os != 'windows-latest'
|
||||
- name: Setup node@${{ matrix.NODE_VERSION }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: ${{ matrix.NODE_VERSION }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
if: matrix.folder != 'next-13-app-dir' || matrix.os != 'windows-latest'
|
||||
run: pnpm install --frozen-lockfile
|
||||
shell: bash
|
||||
|
||||
- name: Install playwright
|
||||
if: matrix.folder != 'next-13-app-dir' || matrix.os != 'windows-latest'
|
||||
run: |
|
||||
pnpx playwright@1.28.0 install --with-deps
|
||||
pnpx playwright@1.28.0 install --with-deps
|
||||
shell: bash
|
||||
|
||||
- name: Build
|
||||
if: matrix.folder != 'next-13-app-dir' || matrix.os != 'windows-latest'
|
||||
run: pnpm build
|
||||
shell: bash
|
||||
|
||||
- name: Test Packages
|
||||
if: matrix.folder != 'next-13-app-dir' || matrix.os != 'windows-latest'
|
||||
run: pnpm test -- --filter=./integration-tests/${{matrix.folder}}
|
||||
shell: bash
|
||||
|
||||
1
.npmrc
1
.npmrc
@@ -1,5 +1,4 @@
|
||||
save-exact=true
|
||||
dedupe-peer-dependents=true
|
||||
strict-peer-dependencies=false
|
||||
|
||||
public-hoist-pattern[]=secure-password
|
||||
|
||||
11
README.md
11
README.md
@@ -6,7 +6,7 @@
|
||||
<img alt="" src="https://img.shields.io/badge/Join%20our%20community-6700EB.svg?style=for-the-badge&labelColor=000000&logoWidth=20&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQ9SURBVHgB7d3dVdtAEIbhcSpICUoH0IEogQqSVBBSAU4FSSpIOoAORAfQgSghHXzZ1U/YcMD4R9rZmf2ec3y448LyiNf27iLiGIAmPLrweC9Un3DhrzG6EarLNP09nlwJ1SOZ/lQr5N80/S/p2QMVCBf5N17XCfm1Y/rBHqjAG9PPHvBsz+mf9WAP+HLA9M/YA14cOP2payH7jpj+VCtk1wnTP+vj7xCy6cTpn7EHLMLp059iD1iD8eveJbVCNsSLheX1YA/YgOWnf8YeKB3Wmf7Ud6Fy4f/FHmtpxbl3YlC4MJ/Cj0bWdwPnPbARg+L0S54XQHS32WwuxClzd4CM0z9rPfeAuTtA5ulPXYQ7wZ04Y+oOoDD9KZc9YOoOoDj9s4dwFzgXR6w1wIPoOvPWA9buAHEJ173o3gWiy3AnuBUHLEbgmYwvAk1/wuM8vAgexThzbwPDkx7/DHwVXfFOxP2GmsKd4Ab6zPeAyU8CI7AHFmH2BRCBPXAyk18GzUrqAXCTiR4ssyj0VFw/oCU8+e+RZ33AWz6KMaYbIIWxB+JSLs1bsbkeMN0AqakHvoku9oA2sAfqBvbAQdw0QArsgb25aYBUQT3QgT2gB+yBuqGcHij2UCqXDZACe2Anlw2QYg/QAOyBuoE98CL3DZDCuK4/rh/Q7oGL6U+TOvcNkJoijN8X1C48+T+g75eQDrAH/qmqAVJgDwyqaoAUe4AGYA/UDZX3QLUNkEIZPRCd5+6BahsgVUgPROwBTSijB7jpVAvGHriHvmw9wAZ4BpX1ABvgmakHtPcbRuwBTWAPULgAV9D/jKDY9YRvwvgEaurD44uQHvAol7qBW7WKluVtIHiUS7GyvA0s6CiXDnxrpQfsgbqBS7GKk/2jYHCrVlGyfxTMrVo0ALdq1Q3sgSKofh0M9oA61a+D2QM0AHugbmAPqClmSRjK2apVVQ8UsySsoK1aHdgDesCtWnUDeyCrIpeFg1u3sylyWTi3btMA7IG6gT2wuuK3hoE9sKrit4YVslWLPaAN7IG6ocKt2zmY2h4O9sDiTG0PZw/QANy6XTewBxZj9ogYVHy025LMHhEz9cBn0We6B0yfERReBLfhx0/R1YQHPx/QBPbA0VwcEwf2wNFcHBPHHjiem3MC2QPHcXdSaJjA+KfgTPQ8hhfjBzHC40mhlzJ+Xq9lK4a4PCs43AVaGTed5mZq+iOXZwWHi3AnOj2wFWNcnxYe7gTxLtBKHuamP/J+Wnh8a5irB7ZC5Yk9gPX1QuXC+usHWqGyhYvUYR0a7zboUOFCNVhnk0krZAOW7wFOvzXhom2xnEbIHizTA1wEYhWW6YFGyC6c1gOcfg9wfA80Qj7g8B7g9HuCww+haIR8wf49wOn3Cvv9k8tGyC/s7gFOv3fY3QONkH+v9MBWqB7PeqDn9FcIT//kcitUn6kHOu/T/xfWzlQy3dEHhwAAAABJRU5ErkJggg==">
|
||||
</a>
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||
<a aria-label="All Contributors" href="#contributors-"><img alt="" src="https://img.shields.io/badge/all_contributors-420-17BB8A.svg?style=for-the-badge&labelColor=000000"></a>
|
||||
<a aria-label="All Contributors" href="#contributors-"><img alt="" src="https://img.shields.io/badge/all_contributors-416-17BB8A.svg?style=for-the-badge&labelColor=000000"></a>
|
||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||
<a aria-label="License" href="https://github.com/blitz-js/blitz/blob/main/LICENSE">
|
||||
<img alt="" src="https://img.shields.io/npm/l/blitz.svg?style=for-the-badge&labelColor=000000&color=blue">
|
||||
@@ -94,11 +94,6 @@ Your financial contributions help ensure Blitz continues to be developed and mai
|
||||
<td><a aria-label="Boostry" href="https://boostry.co.jp/?utm_source=BlitzJS&utm_medium=sponsorship&utm_campaign=BlitzJS_Sponsorship_2021">
|
||||
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/main/assets/boostry.svg" width="200px">
|
||||
</a></td>
|
||||
<td>
|
||||
<a aria-label="Byteflow" href="https://byteflow.app/?ref=blitzjs">
|
||||
<img alt="" src="https://raw.githubusercontent.com/blitz-js/blitz/main/assets/byteflow.png" width="70px">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -736,10 +731,6 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
|
||||
<td align="center"><a href="https://ghken.com"><img src="https://avatars.githubusercontent.com/u/5304351?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tetsuya Fukuda</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=GHKEN" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=GHKEN" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/nerixim"><img src="https://avatars.githubusercontent.com/u/26106502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nikita Kamaev</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=nerixim" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://webredone.com/"><img src="https://avatars.githubusercontent.com/u/11588823?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nikola Ivanov</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=nikola-wd" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="jayu.dev"><img src="https://avatars.githubusercontent.com/u/11561585?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jakub Mazurek</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=jayu" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=jayu" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/maciej-ka"><img src="https://avatars.githubusercontent.com/u/5403694?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Maciej Kasprzyk</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=maciej-ka" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=maciej-ka" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/justinsmid"><img src="https://avatars.githubusercontent.com/u/34271675?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Justin Smid</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=justinsmid" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=justinsmid" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/rodobre"><img src="https://avatars.githubusercontent.com/u/52138375?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rodobre</b></sub></a><br /><a href="https://github.com/blitz-js/blitz/commits?author=rodobre" title="Documentation">📖</a> <a href="https://github.com/blitz-js/blitz/commits?author=rodobre" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -1,80 +1,5 @@
|
||||
# next-blitz-auth
|
||||
|
||||
## 0.1.1-beta.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [19898a488]
|
||||
- Updated dependencies [6811eab1a]
|
||||
- Updated dependencies [022392c12]
|
||||
- @blitzjs/rpc@2.0.0-beta.33
|
||||
- blitz@2.0.0-beta.33
|
||||
- @blitzjs/next@2.0.0-beta.33
|
||||
- @blitzjs/auth@2.0.0-beta.33
|
||||
- @blitzjs/config@2.0.0-beta.33
|
||||
|
||||
## 0.1.1-beta.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [82649f341]
|
||||
- Updated dependencies [8b01175b4]
|
||||
- blitz@2.0.0-beta.32
|
||||
- @blitzjs/next@2.0.0-beta.32
|
||||
- @blitzjs/auth@2.0.0-beta.32
|
||||
- @blitzjs/rpc@2.0.0-beta.32
|
||||
- @blitzjs/config@2.0.0-beta.32
|
||||
|
||||
## 0.1.1-beta.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [90f1741da]
|
||||
- Updated dependencies [df3265b85]
|
||||
- @blitzjs/auth@2.0.0-beta.31
|
||||
- blitz@2.0.0-beta.31
|
||||
- @blitzjs/rpc@2.0.0-beta.31
|
||||
- @blitzjs/next@2.0.0-beta.31
|
||||
- @blitzjs/config@2.0.0-beta.31
|
||||
|
||||
## 0.1.1-beta.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c5572bec6]
|
||||
- Updated dependencies [727734955]
|
||||
- @blitzjs/auth@2.0.0-beta.30
|
||||
- blitz@2.0.0-beta.30
|
||||
- @blitzjs/rpc@2.0.0-beta.30
|
||||
- @blitzjs/next@2.0.0-beta.30
|
||||
- @blitzjs/config@2.0.0-beta.30
|
||||
|
||||
## 0.1.1-beta.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b6b9a1c5a]
|
||||
- Updated dependencies [61888d1a3]
|
||||
- @blitzjs/auth@2.0.0-beta.29
|
||||
- blitz@2.0.0-beta.29
|
||||
- @blitzjs/rpc@2.0.0-beta.29
|
||||
- @blitzjs/next@2.0.0-beta.29
|
||||
- @blitzjs/config@2.0.0-beta.29
|
||||
|
||||
## 0.1.1-beta.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5166e5e03]
|
||||
- Updated dependencies [2533caf48]
|
||||
- Updated dependencies [c7ac86b85]
|
||||
- Updated dependencies [1bb3a6556]
|
||||
- @blitzjs/auth@2.0.0-beta.28
|
||||
- @blitzjs/next@2.0.0-beta.28
|
||||
- @blitzjs/rpc@2.0.0-beta.28
|
||||
- blitz@2.0.0-beta.28
|
||||
- @blitzjs/config@2.0.0-beta.28
|
||||
|
||||
## 0.1.1-beta.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "next-blitz-auth",
|
||||
"version": "0.1.1-beta.9",
|
||||
"version": "0.1.1-beta.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"blitz:dev": "next dev",
|
||||
@@ -9,15 +9,15 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:*",
|
||||
"@blitzjs/config": "workspace:*",
|
||||
"@blitzjs/next": "workspace:*",
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@hookform/error-message": "2.0.0",
|
||||
"@hookform/resolvers": "2.9.10",
|
||||
"@prisma/client": "^4.5.0",
|
||||
"@tanstack/react-query": "4.0.10",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:*",
|
||||
"flatted": "3.2.7",
|
||||
"next": "13.3.0",
|
||||
"prisma": "^4.5.0",
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:*",
|
||||
"@blitzjs/config": "workspace:*",
|
||||
"@blitzjs/next": "workspace:*",
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@hookform/error-message": "2.0.0",
|
||||
"@hookform/resolvers": "2.9.10",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"next": "13.3.0",
|
||||
"openid-client": "5.2.1",
|
||||
"prisma": "4.6.1",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const { withNextAuthAdapter } = require("@blitzjs/auth")
|
||||
const { withNextAuthAdapter } = require("@blitzjs/auth/next-auth")
|
||||
const { withBlitz } = require("@blitzjs/next")
|
||||
|
||||
/**
|
||||
* @type {import('next').NextConfig}
|
||||
* @type {import('@blitzjs/next').BlitzConfig}
|
||||
**/
|
||||
const config = {
|
||||
reactStrictMode: true,
|
||||
|
||||
@@ -24,14 +24,14 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:*",
|
||||
"@blitzjs/config": "workspace:*",
|
||||
"@blitzjs/next": "workspace:*",
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@hookform/error-message": "2.0.0",
|
||||
"@hookform/resolvers": "2.9.10",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"next": "13.3.0",
|
||||
"next-auth": "4.18.7",
|
||||
"prisma": "4.6.1",
|
||||
|
||||
@@ -8,9 +8,5 @@ export default api(
|
||||
error.message = `FormatError handler: ${error.message}`
|
||||
return error
|
||||
},
|
||||
// logging: {
|
||||
// verbose: true,
|
||||
// blockList: ["/getCurrentUser"],
|
||||
// },
|
||||
})
|
||||
)
|
||||
|
||||
@@ -38,10 +38,10 @@ const UserInfo = () => {
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Link href={"/signup"} className={styles.button}>
|
||||
<Link href={Routes.SignupPage()} className={styles.button}>
|
||||
<strong>Sign Up</strong>
|
||||
</Link>
|
||||
<Link href={"/login"} className={styles.loginButton}>
|
||||
<Link href={Routes.LoginPage()} className={styles.loginButton}>
|
||||
<strong>Login</strong>
|
||||
</Link>
|
||||
<Link href="/api/auth/github/login" passHref legacyBehavior>
|
||||
@@ -99,7 +99,7 @@ const Home: BlitzPage = () => {
|
||||
<div className={styles.code}>
|
||||
<span>1</span>
|
||||
<pre>
|
||||
<code>blitz generate all project name:string</code>
|
||||
<code>blitz generate all project</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
"schema": "./db/schema.prisma"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:*",
|
||||
"@blitzjs/config": "workspace:*",
|
||||
"@blitzjs/next": "workspace:*",
|
||||
"@blitzjs/rpc": "workspace:*",
|
||||
"@prisma/client": "4.6.1",
|
||||
"@types/jest": "29.2.2",
|
||||
"@types/passport-twitter": "1.0.37",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:*",
|
||||
"jest": "29.3.0",
|
||||
"jest-environment-jsdom": "29.3.0",
|
||||
"next": "13.3.0",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.9 KiB |
61
flake.lock
generated
61
flake.lock
generated
@@ -1,61 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1687709756,
|
||||
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1688221086,
|
||||
"narHash": "sha256-cdW6qUL71cNWhHCpMPOJjlw0wzSRP0pVlRn2vqX/VVg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "cd99c2b3c9f160cd004318e0697f90bbd5960825",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
39
flake.nix
39
flake.nix
@@ -1,39 +0,0 @@
|
||||
{
|
||||
description = "The Blitzjs Monorepo";
|
||||
nixConfig.bash-prompt = "\[nix:blitz\]$ ";
|
||||
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
formatter = pkgs.alejandra;
|
||||
|
||||
devShells = {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
nodejs-18_x
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
mkdir -p $out/bin
|
||||
${pkgs.nodejs-18_x}/bin/corepack enable --install-directory $out/bin
|
||||
export PATH="$out/bin:$PATH"
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -17,14 +17,14 @@
|
||||
"prisma:studio": "prisma studio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"@hookform/error-message": "2.0.0",
|
||||
"@hookform/resolvers": "2.9.10",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"delay": "5.0.0",
|
||||
"next": "13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
|
||||
@@ -13,10 +13,37 @@ import webdriver from "../../utils/next-webdriver"
|
||||
let app: any
|
||||
let appPort: number
|
||||
|
||||
let mode: "dev" | "server" = "dev"
|
||||
|
||||
const runTests = () => {
|
||||
describe("Auth", () => {
|
||||
/* TODO - Add a non flaky Integration Test for custom plugin
|
||||
describe("custom plugin", () => {
|
||||
it("custom plugin - events", async () => {
|
||||
const browser = await webdriver(appPort, "/custom-plugin")
|
||||
let text = await browser.elementByCss("#page").text()
|
||||
await waitFor(250)
|
||||
text = await browser.elementByCss("#page").text()
|
||||
expect(text).toBe("Custom plugin Session Created")
|
||||
await waitFor(3000)
|
||||
text = await browser.elementByCss("#page").text()
|
||||
expect(text).toBe("Custom plugin RPC Error")
|
||||
if (browser) {
|
||||
await browser.close()
|
||||
}
|
||||
})
|
||||
it("custom plugin - middleware", async () => {
|
||||
const browser = await webdriver(appPort, "/custom-plugin")
|
||||
await waitFor(100)
|
||||
let text = await browser.elementByCss("#before-req").text()
|
||||
expect(text).toBe("customHeaderValue")
|
||||
await waitFor(2000)
|
||||
text = await browser.elementByCss("#before-res").text()
|
||||
expect(text).toBe("55")
|
||||
if (browser) {
|
||||
await browser.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
*/
|
||||
describe("unauthenticated", () => {
|
||||
it("should render result for open query", async () => {
|
||||
const browser = await webdriver(appPort, "/noauth-query")
|
||||
@@ -31,11 +58,7 @@ const runTests = () => {
|
||||
const browser = await webdriver(appPort, "/authenticated-query")
|
||||
await browser.waitForElementByCss("#error")
|
||||
let text = await browser.elementByCss("#error").text()
|
||||
if (mode === "server") {
|
||||
expect(text).toMatch(/AuthenticationError/)
|
||||
} else {
|
||||
expect(text).toContain("Error")
|
||||
}
|
||||
expect(text).toMatch(/AuthenticationError/)
|
||||
if (browser) await browser.close()
|
||||
})
|
||||
|
||||
@@ -97,11 +120,7 @@ const runTests = () => {
|
||||
await waitFor(200)
|
||||
await browser.waitForElementByCss("#error")
|
||||
text = await browser.elementByCss("#error").text()
|
||||
if (mode === "server") {
|
||||
expect(text).toMatch(/AuthenticationError/)
|
||||
} else {
|
||||
expect(text).toContain("Error")
|
||||
}
|
||||
expect(text).toMatch(/AuthenticationError/)
|
||||
if (browser) await browser.close()
|
||||
})
|
||||
|
||||
@@ -243,7 +262,6 @@ const runTests = () => {
|
||||
describe("Auth Tests", () => {
|
||||
describe("dev mode", () => {
|
||||
beforeAll(async () => {
|
||||
mode = "dev"
|
||||
try {
|
||||
await runBlitzCommand(["prisma", "migrate", "reset", "--force"])
|
||||
appPort = await findPort()
|
||||
@@ -258,7 +276,6 @@ describe("Auth Tests", () => {
|
||||
|
||||
describe("server mode", () => {
|
||||
beforeAll(async () => {
|
||||
mode = "server"
|
||||
try {
|
||||
await runBlitzCommand(["prisma", "generate"])
|
||||
await runBlitzCommand(["prisma", "migrate", "deploy"])
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
"prisma:studio": "prisma studio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
|
||||
@@ -43,7 +43,7 @@ const runTests = (mode?: string) => {
|
||||
const browser = await webdriver(appPort, "/authenticated-page")
|
||||
let errorMsg = await browser.elementById(`error`).text()
|
||||
expect(errorMsg).toMatch(/Error: You are not authenticated/)
|
||||
if (browser) void browser.close()
|
||||
if (browser) browser.close()
|
||||
},
|
||||
5000 * 60 * 2,
|
||||
)
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
"schema": "db/schema.prisma"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
@@ -28,7 +28,7 @@
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"next": "13.3.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
"prisma:studio": "prisma studio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
"prisma:studio": "prisma studio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
@@ -28,7 +28,7 @@
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"@prisma/client": "4.6.1",
|
||||
"@tanstack/react-query": "4.0.10",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"next": "13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
"react": "18.2.0",
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
"schema": "db/schema.prisma"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
@@ -27,7 +27,7 @@
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"next": "13.3.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"next": "13.3.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
"schema": "db/schema.prisma"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/next": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/next": "workspace:2.0.0-beta.27",
|
||||
"@blitzjs/rpc": "workspace:2.0.0-beta.27",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "workspace:2.0.0-beta.27",
|
||||
"lowdb": "3.0.0",
|
||||
"next": "13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
@@ -28,7 +28,7 @@
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"prepare": "husky install",
|
||||
"build": "turbo run build",
|
||||
"build:apps": "turbo run buildapp --concurrency=1",
|
||||
"dev": "turbo run dev --filter='./packages/*'",
|
||||
"dev": "turbo run dev --no-cache --parallel",
|
||||
"lint": "turbo run lint",
|
||||
"test": "turbo run test",
|
||||
"clean": "turbo run clean && rm -rf node_modules",
|
||||
@@ -34,12 +34,12 @@
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-prisma": "4.4.0",
|
||||
"pretty-quick": "3.1.3",
|
||||
"turbo": "1.10.7",
|
||||
"turbo": "1.4.2",
|
||||
"vitest": "0.25.3",
|
||||
"wait-on": "6.0.1"
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"packageManager": "pnpm@8.6.6",
|
||||
"packageManager": "pnpm@7.11.0",
|
||||
"manypkg": {
|
||||
"ignoredRules": [
|
||||
"EXTERNAL_MISMATCH"
|
||||
|
||||
@@ -1,64 +1,5 @@
|
||||
# @blitzjs/auth
|
||||
|
||||
## 2.0.0-beta.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [19898a488]
|
||||
- Updated dependencies [6811eab1a]
|
||||
- Updated dependencies [022392c12]
|
||||
- blitz@2.0.0-beta.33
|
||||
|
||||
## 2.0.0-beta.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8b01175b4: Updated `useAuthenticatedBlitzContext` to now return `AuthenticatedCtx`
|
||||
- Updated dependencies [82649f341]
|
||||
- blitz@2.0.0-beta.32
|
||||
|
||||
## 2.0.0-beta.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 90f1741da: blitz-auth: Support for Prisma v5
|
||||
|
||||
Internal: Make `handle` a required paramter while updating the `session` modal.
|
||||
|
||||
- Updated dependencies [90f1741da]
|
||||
- Updated dependencies [df3265b85]
|
||||
- blitz@2.0.0-beta.31
|
||||
|
||||
## 2.0.0-beta.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c5572bec6: blitz-auth: Fix webpack from following next-auth
|
||||
- Updated dependencies [c5572bec6]
|
||||
- Updated dependencies [727734955]
|
||||
- blitz@2.0.0-beta.30
|
||||
|
||||
## 2.0.0-beta.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- b6b9a1c5a: Fix Next-Auth integration: `Unable to use next-auth with provider: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]`
|
||||
- Updated dependencies [b6b9a1c5a]
|
||||
- Updated dependencies [61888d1a3]
|
||||
- blitz@2.0.0-beta.29
|
||||
|
||||
## 2.0.0-beta.28
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 1bb3a6556: Stop exporting `useAuthenticatedBlitzContext` from `@blitzjs/auth` this must be imported from `app/blitz-server.ts` file in order to work correctly
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5166e5e03: (feat) upgrade tslog to v4.8.2
|
||||
- Updated dependencies [5166e5e03]
|
||||
- blitz@2.0.0-beta.28
|
||||
|
||||
## 2.0.0-beta.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/auth",
|
||||
"version": "2.0.0-beta.33",
|
||||
"version": "2.0.0-beta.27",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -37,7 +37,6 @@
|
||||
"cookie": "0.4.1",
|
||||
"cookie-session": "2.0.0",
|
||||
"debug": "4.3.3",
|
||||
"find-up": "4.1.0",
|
||||
"http": "0.0.1-security",
|
||||
"jsonwebtoken": "9.0.0",
|
||||
"nanoid": "3.2.0",
|
||||
@@ -45,12 +44,11 @@
|
||||
"openid-client": "5.2.1",
|
||||
"passport": "0.6.0",
|
||||
"path": "0.12.7",
|
||||
"resolve-from": "5.0.0",
|
||||
"supports-color": "8.1.1",
|
||||
"url": "0.11.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"next": "*",
|
||||
"next-auth": "*",
|
||||
"secure-password": "4.0.0"
|
||||
@@ -67,7 +65,7 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@testing-library/react": "13.4.0",
|
||||
"@testing-library/react-hooks": "8.0.1",
|
||||
"@types/cookie": "0.4.1",
|
||||
@@ -75,7 +73,7 @@
|
||||
"@types/jsonwebtoken": "8.5.8",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"next": "13.3.0",
|
||||
"next-auth": "4.18.7",
|
||||
"react": "18.2.0",
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
export * from "./passport/adapter"
|
||||
export * from "./next-auth/webpack"
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from "./next-auth/adapter"
|
||||
export * from "./next-auth/types"
|
||||
export * from "./next-auth/webpack"
|
||||
|
||||
@@ -27,9 +27,7 @@ import type {
|
||||
} from "./types"
|
||||
import {Provider} from "next-auth/providers"
|
||||
|
||||
import {init} from "next-auth/core/init"
|
||||
import getAuthorizationUrl from "next-auth/core/lib/oauth/authorization-url"
|
||||
import oAuthCallback from "next-auth/core/lib/oauth/callback"
|
||||
export {withNextAuthAdapter} from "./webpack"
|
||||
|
||||
const INTERNAL_REDIRECT_URL_KEY = "_redirectUrl"
|
||||
|
||||
@@ -104,6 +102,7 @@ export function NextAuthAdapter<P extends Provider[]>(
|
||||
if (providerId?.includes("?")) {
|
||||
providerId = providerId.split("?")[0]
|
||||
}
|
||||
const {init} = await import("next-auth/core/init").then((m) => m)
|
||||
const {options, cookies} = await init({
|
||||
// @ts-ignore
|
||||
url: new URL(
|
||||
@@ -159,6 +158,9 @@ async function AuthHandler<P extends Provider[]>(
|
||||
if (action === "login") {
|
||||
middleware.push(async (req, res, next) => {
|
||||
try {
|
||||
const getAuthorizationUrl = await import("next-auth/core/lib/oauth/authorization-url").then(
|
||||
(m) => m.default,
|
||||
)
|
||||
const _signin = await getAuthorizationUrl({options: options, query: req.query})
|
||||
if (_signin.cookies) cookies.push(..._signin.cookies)
|
||||
const session = res.blitzCtx.session as SessionContext
|
||||
@@ -189,6 +191,9 @@ async function AuthHandler<P extends Provider[]>(
|
||||
middleware.push(
|
||||
// eslint-disable-next-line no-shadow
|
||||
connectMiddleware(async (req, res, next) => {
|
||||
const oAuthCallback = await import("next-auth/core/lib/oauth/callback").then(
|
||||
(m) => m.default,
|
||||
)
|
||||
try {
|
||||
const {profile, account, OAuthProfile} = await oAuthCallback({
|
||||
query: internalRequest.query,
|
||||
|
||||
@@ -1,30 +1,15 @@
|
||||
//@ts-nocheck
|
||||
import path from "path"
|
||||
|
||||
export function withNextAuthAdapter(nextConfig) {
|
||||
const config = Object.assign({}, nextConfig)
|
||||
try {
|
||||
const nextAuthPath = path.dirname(require.resolve("next-auth"))
|
||||
const webpack = (config) => {
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
"next-auth/core/lib/oauth/callback": path.join(nextAuthPath, "core/lib/oauth/callback.js"),
|
||||
"next-auth/core/lib/oauth/authorization-url": path.join(
|
||||
nextAuthPath,
|
||||
"core/lib/oauth/authorization-url.js",
|
||||
),
|
||||
"next-auth/core/init": path.join(nextAuthPath, "core/init.js"),
|
||||
}
|
||||
return config
|
||||
}
|
||||
if (typeof nextConfig.webpack === "function") {
|
||||
config.webpack = (config, options) => {
|
||||
return nextConfig.webpack(webpack(config), options)
|
||||
}
|
||||
}
|
||||
config.webpack = webpack
|
||||
return config
|
||||
} catch (e) {
|
||||
config.webpack = (config) => {
|
||||
//add a required resolve alias
|
||||
config.resolve.alias["next-auth/core/lib/oauth/callback"] =
|
||||
process.cwd() + "/node_modules/next-auth/core/lib/oauth/callback.js"
|
||||
config.resolve.alias["next-auth/core/lib/oauth/authorization-url"] =
|
||||
process.cwd() + "/node_modules/next-auth/core/lib/oauth/authorization-url.js"
|
||||
config.resolve.alias["next-auth/core/init"] =
|
||||
process.cwd() + "/node_modules/next-auth/core/init.js"
|
||||
return config
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ interface PrismaClientWithSession {
|
||||
}): Promise<SessionModel>
|
||||
update(args: {
|
||||
data: Partial<SessionModel>
|
||||
where: {handle: SessionModel["handle"]}
|
||||
where: {handle?: SessionModel["handle"]}
|
||||
}): Promise<SessionModel>
|
||||
delete(args: {where: {handle?: SessionModel["handle"]}}): Promise<SessionModel>
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
log,
|
||||
baseLogger,
|
||||
chalk,
|
||||
AuthenticatedCtx,
|
||||
} from "blitz"
|
||||
import {
|
||||
EmptyPublicData,
|
||||
@@ -220,7 +219,7 @@ export async function useAuthenticatedBlitzContext({
|
||||
redirectTo?: string | RouteUrlObject
|
||||
redirectAuthenticatedTo?: string | RouteUrlObject | ((ctx: Ctx) => string | RouteUrlObject)
|
||||
role?: string | string[]
|
||||
}): Promise<AuthenticatedCtx> {
|
||||
}): Promise<void> {
|
||||
const log = baseLogger().getSubLogger({name: "useAuthenticatedBlitzContext"})
|
||||
const customChalk = new chalk.Instance({
|
||||
level: log.settings.type === "json" ? 0 : chalk.level,
|
||||
@@ -269,7 +268,6 @@ export async function useAuthenticatedBlitzContext({
|
||||
redirect(redirectTo)
|
||||
}
|
||||
}
|
||||
return ctx as AuthenticatedCtx
|
||||
}
|
||||
|
||||
const makeProxyToPublicData = <T extends SessionContextClass>(ctxClass: T): T => {
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
export * from "./auth-sessions"
|
||||
export * from "./auth-utils"
|
||||
export * from "./auth-plugin"
|
||||
export * from "./adapters"
|
||||
|
||||
export {
|
||||
SessionContextClass,
|
||||
getAllSessionHandlesForUser,
|
||||
getCookieParser,
|
||||
getSession,
|
||||
isLocalhost,
|
||||
setPublicDataForUser,
|
||||
setCookie,
|
||||
simpleRolesIsAuthorized,
|
||||
getBlitzContext,
|
||||
} from "./auth-sessions"
|
||||
export type {AnonymousSessionPayload, SimpleRolesIsAuthorized} from "./auth-sessions"
|
||||
|
||||
@@ -82,7 +82,7 @@ declare module "blitz" {
|
||||
export interface Ctx {
|
||||
session: SessionContext
|
||||
}
|
||||
export interface AuthenticatedCtx extends Omit<Ctx, "session"> {
|
||||
export interface AuthenticatedMiddlewareCtx extends Omit<Ctx, "session"> {
|
||||
session: AuthenticatedSessionContext
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"extends": ["//"],
|
||||
"pipeline": {
|
||||
"dev": {
|
||||
"dependsOn": ["blitz#build"],
|
||||
"persistent": true,
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +1,5 @@
|
||||
# @blitzjs/next
|
||||
|
||||
## 2.0.0-beta.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 022392c12: - Updates `ts-log` peer dependency to `4.9.0`
|
||||
- Removes `javascript` from `blitz new` menu
|
||||
- Hot Fix the `Update Schema` when using blitz generator
|
||||
- Updated dependencies [19898a488]
|
||||
- Updated dependencies [6811eab1a]
|
||||
- Updated dependencies [022392c12]
|
||||
- @blitzjs/rpc@2.0.0-beta.33
|
||||
- blitz@2.0.0-beta.33
|
||||
|
||||
## 2.0.0-beta.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 82649f341: Upgrade tslog to `4.9.0`.
|
||||
|
||||
This due a [tslog issue](https://github.com/fullstack-build/tslog/issues/227) that causes tslog to crash when attempting to log an error whose constructor expects more than one argument.
|
||||
|
||||
- Updated dependencies [82649f341]
|
||||
- blitz@2.0.0-beta.32
|
||||
- @blitzjs/rpc@2.0.0-beta.32
|
||||
|
||||
## 2.0.0-beta.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [90f1741da]
|
||||
- Updated dependencies [df3265b85]
|
||||
- blitz@2.0.0-beta.31
|
||||
- @blitzjs/rpc@2.0.0-beta.31
|
||||
|
||||
## 2.0.0-beta.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c5572bec6]
|
||||
- Updated dependencies [727734955]
|
||||
- blitz@2.0.0-beta.30
|
||||
- @blitzjs/rpc@2.0.0-beta.30
|
||||
|
||||
## 2.0.0-beta.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b6b9a1c5a]
|
||||
- Updated dependencies [61888d1a3]
|
||||
- blitz@2.0.0-beta.29
|
||||
- @blitzjs/rpc@2.0.0-beta.29
|
||||
|
||||
## 2.0.0-beta.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5166e5e03: (feat) upgrade tslog to v4.8.2
|
||||
- Updated dependencies [5166e5e03]
|
||||
- Updated dependencies [2533caf48]
|
||||
- Updated dependencies [c7ac86b85]
|
||||
- @blitzjs/rpc@2.0.0-beta.28
|
||||
- blitz@2.0.0-beta.28
|
||||
|
||||
## 2.0.0-beta.27
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/next",
|
||||
"version": "2.0.0-beta.33",
|
||||
"version": "2.0.0-beta.27",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -29,7 +29,7 @@
|
||||
"eslint.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@blitzjs/rpc": "2.0.0-beta.33",
|
||||
"@blitzjs/rpc": "2.0.0-beta.27",
|
||||
"@types/hoist-non-react-statics": "3.3.1",
|
||||
"debug": "4.3.3",
|
||||
"fs-extra": "10.0.1",
|
||||
@@ -38,24 +38,22 @@
|
||||
"supports-color": "8.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"next": "*",
|
||||
"react": "*",
|
||||
"tslog": "4.9.0"
|
||||
"react": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@testing-library/dom": "8.13.0",
|
||||
"@testing-library/jest-dom": "5.16.3",
|
||||
"@testing-library/react": "13.4.0",
|
||||
"@testing-library/react-hooks": "8.0.1",
|
||||
"@testing-library/user-event": "13.5.0",
|
||||
"@types/debug": "4.1.7",
|
||||
"@types/node": "18.11.9",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"@types/testing-library__react-hooks": "4.0.0",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"cross-spawn": "7.0.3",
|
||||
"find-up": "4.1.0",
|
||||
"next": "13.3.0",
|
||||
@@ -64,7 +62,6 @@
|
||||
"react-dom": "18.2.0",
|
||||
"resolve-from": "5.0.0",
|
||||
"ts-jest": "27.1.4",
|
||||
"tslog": "4.9.0",
|
||||
"typescript": "^4.8.4",
|
||||
"unbuild": "0.7.6",
|
||||
"watch": "1.0.2"
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"extends": ["//"],
|
||||
"pipeline": {
|
||||
"dev": {
|
||||
"dependsOn": ["@blitzjs/rpc#build", "blitz#build"],
|
||||
"persistent": true,
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,145 +1,5 @@
|
||||
# @blitzjs/rpc
|
||||
|
||||
## 2.0.0-beta.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 19898a488: Fix for tslog error `TypeError: Cannot read properties of undefined (reading 'map')` while using custom errors.
|
||||
- 6811eab1a: Allow `.tsx` & `.jsx` file extensions to be used for resolvers
|
||||
- Updated dependencies [19898a488]
|
||||
- Updated dependencies [6811eab1a]
|
||||
- Updated dependencies [022392c12]
|
||||
- blitz@2.0.0-beta.33
|
||||
|
||||
## 2.0.0-beta.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [82649f341]
|
||||
- blitz@2.0.0-beta.32
|
||||
|
||||
## 2.0.0-beta.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [90f1741da]
|
||||
- Updated dependencies [df3265b85]
|
||||
- blitz@2.0.0-beta.31
|
||||
|
||||
## 2.0.0-beta.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 727734955: ### Now we can configure Blitz RPC in the following way,
|
||||
|
||||
In your `[[...blitz]].ts` api file you can see the following settings
|
||||
|
||||
```ts
|
||||
logging?: {
|
||||
/**
|
||||
* allowList Represents the list of routes for which logging should be enabled
|
||||
* If whiteList is defined then only those routes will be logged
|
||||
*/
|
||||
allowList?: string[]
|
||||
/**
|
||||
* blockList Represents the list of routes for which logging should be disabled
|
||||
* If blockList is defined then all routes except those will be logged
|
||||
*/
|
||||
blockList?: string[]
|
||||
/**
|
||||
* verbose Represents the flag to enable/disable logging
|
||||
* If verbose is true then Blitz RPC will log the input and output of each resolver
|
||||
*/
|
||||
verbose?: boolean
|
||||
/**
|
||||
* disablelevel Represents the flag to enable/disable logging for a particular level
|
||||
*/
|
||||
disablelevel?: "debug" | "info"
|
||||
}
|
||||
```
|
||||
|
||||
```ts
|
||||
import { rpcHandler } from "@blitzjs/rpc"
|
||||
import { api } from "src/blitz-server"
|
||||
|
||||
export default api(
|
||||
rpcHandler({
|
||||
onError: console.log,
|
||||
formatError: (error) => {
|
||||
error.message = `FormatError handler: ${error.message}`
|
||||
return error
|
||||
},
|
||||
logging: {
|
||||
...
|
||||
}
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```ts
|
||||
export default api(
|
||||
rpcHandler({
|
||||
onError: console.log,
|
||||
formatError: (error) => {
|
||||
error.message = `FormatError handler: ${error.message}`
|
||||
return error
|
||||
},
|
||||
logging: {
|
||||
verbose: true,
|
||||
blockList: ["getCurrentUser", ...], //just write the resolver name [which is the resolver file name]
|
||||
},
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
This is enable verbose blitz rpc logging for all resolvers except the resolvers `getCurrentUser` and others mentioned in the `blockList`
|
||||
|
||||
- Updated dependencies [c5572bec6]
|
||||
- Updated dependencies [727734955]
|
||||
- blitz@2.0.0-beta.30
|
||||
|
||||
## 2.0.0-beta.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b6b9a1c5a]
|
||||
- Updated dependencies [61888d1a3]
|
||||
- blitz@2.0.0-beta.29
|
||||
|
||||
## 2.0.0-beta.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5166e5e03: (feat) upgrade tslog to v4.8.2
|
||||
- 2533caf48: Fix return type of `requestMiddlewares` in `RpcServerPlugin`
|
||||
- c7ac86b85: Fixes enormous memory consumption of the dev server by changing the default import strategy to "require" instead of "import" which in webpack causes multiple chunks to be created for each import.
|
||||
|
||||
## Blitz Configuration
|
||||
|
||||
To configure this behaviour, you can add the following to your next.config.js:
|
||||
|
||||
```js
|
||||
/**
|
||||
* @type {import('@blitzjs/next').BlitzConfig}
|
||||
**/
|
||||
const config = {
|
||||
blitz: {
|
||||
resolversDynamicImport: true,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
When `resolversDynamicImport` is set to `true`, the import strategy will be "import" instead of "require".
|
||||
|
||||
### On Vercel
|
||||
|
||||
If you are using Vercel, `resolversDynamicImport` will be set to `true` by default, since it is better for the separate chunks to be create for serverless lambdas.
|
||||
|
||||
- Updated dependencies [5166e5e03]
|
||||
- blitz@2.0.0-beta.28
|
||||
|
||||
## 2.0.0-beta.27
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/rpc",
|
||||
"version": "2.0.0-beta.33",
|
||||
"version": "2.0.0-beta.27",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -37,18 +37,18 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tanstack/query-core": "4.24.4",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"next": "*",
|
||||
"react": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/auth": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/auth": "2.0.0-beta.27",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@tanstack/query-core": "4.24.4",
|
||||
"@types/debug": "4.1.7",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"next": "13.3.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
|
||||
@@ -146,59 +146,6 @@ async function getResolverMap(): Promise<ResolverFiles | null | undefined> {
|
||||
interface RpcConfig {
|
||||
onError?: (error: Error) => void
|
||||
formatError?: (error: Error) => Error
|
||||
logging?: {
|
||||
/**
|
||||
* allowList Represents the list of routes for which logging should be enabled
|
||||
* If allowList is defined then only those routes will be logged
|
||||
*/
|
||||
allowList?: string[]
|
||||
/**
|
||||
* blockList Represents the list of routes for which logging should be disabled
|
||||
* If blockList is defined then all routes except those will be logged
|
||||
*/
|
||||
blockList?: string[]
|
||||
/**
|
||||
* verbose Represents the flag to enable/disable logging
|
||||
* If verbose is true then Blitz RPC will log the input and output of each resolver
|
||||
*/
|
||||
verbose?: boolean
|
||||
/**
|
||||
* disablelevel Represents the flag to enable/disable logging for a particular level
|
||||
*/
|
||||
disablelevel?: "debug" | "info"
|
||||
}
|
||||
}
|
||||
|
||||
function isBlitzRPCVerbose(resolverName: string, config: RpcConfig, level: string) {
|
||||
// blitz rpc is by default verbose - to keep current behaviour
|
||||
if (!config.logging) {
|
||||
return true
|
||||
}
|
||||
//if logging exists and verbose is not defined then default to true
|
||||
if (config.logging && !("verbose" in config.logging)) {
|
||||
return true
|
||||
}
|
||||
const isLevelDisabled = config.logging?.disablelevel === level
|
||||
if (config.logging?.verbose) {
|
||||
// If allowList array is defined then allow only those routes in allowList
|
||||
if (config.logging?.allowList) {
|
||||
if (config.logging?.allowList?.includes(resolverName) && !isLevelDisabled) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
// If blockList array is defined then allow all routes except those in blockList
|
||||
if (config.logging?.blockList) {
|
||||
if (!config.logging?.blockList?.includes(resolverName) && !isLevelDisabled) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
// if both allowList and blockList are not defined, then allow all routes
|
||||
if (!config.logging?.allowList && !config.logging?.blockList && !isLevelDisabled) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
export function rpcHandler(config: RpcConfig) {
|
||||
@@ -212,11 +159,10 @@ export function rpcHandler(config: RpcConfig) {
|
||||
|
||||
const relativeRoutePath = (req.query.blitz as string[])?.join("/")
|
||||
const routePath = "/" + relativeRoutePath
|
||||
const resolverName = routePath.replace(/(\/api\/rpc)?\//, "")
|
||||
|
||||
const log = baseLogger().getSubLogger({
|
||||
name: "blitz-rpc",
|
||||
prefix: [resolverName + "()"],
|
||||
prefix: [routePath.replace(/(\/api\/rpc)?\//, "") + "()"],
|
||||
})
|
||||
const customChalk = new chalk.Instance({
|
||||
level: log.settings.type === "json" ? 0 : chalk.level,
|
||||
@@ -267,16 +213,11 @@ export function rpcHandler(config: RpcConfig) {
|
||||
? parse(`${req.query.meta}`)
|
||||
: undefined,
|
||||
})
|
||||
if (isBlitzRPCVerbose(resolverName, config, "info")) {
|
||||
log.info(customChalk.dim("Starting with input:"), data ? data : JSON.stringify(data))
|
||||
}
|
||||
log.info(customChalk.dim("Starting with input:"), data ? data : JSON.stringify(data))
|
||||
const startTime = Date.now()
|
||||
const result = await resolver(data, (res as any).blitzCtx)
|
||||
const resolverDuration = Date.now() - startTime
|
||||
|
||||
if (isBlitzRPCVerbose(resolverName, config, "debug")) {
|
||||
log.debug(customChalk.dim("Result:"), result ? result : JSON.stringify(result))
|
||||
}
|
||||
log.info(customChalk.dim("Result:"), result ? result : JSON.stringify(result))
|
||||
|
||||
const serializerStartTime = Date.now()
|
||||
const serializedResult = superjsonSerialize(result)
|
||||
@@ -290,26 +231,21 @@ export function rpcHandler(config: RpcConfig) {
|
||||
result: serializedResult.meta,
|
||||
},
|
||||
})
|
||||
|
||||
if (isBlitzRPCVerbose(resolverName, config, "debug")) {
|
||||
log.debug(
|
||||
customChalk.dim(
|
||||
`Next.js serialization:${prettyMs(Date.now() - nextSerializerStartTime)}`,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
log.debug(
|
||||
customChalk.dim(
|
||||
`Next.js serialization:${prettyMs(Date.now() - nextSerializerStartTime)}`,
|
||||
),
|
||||
)
|
||||
const serializerDuration = Date.now() - serializerStartTime
|
||||
const duration = Date.now() - startTime
|
||||
if (isBlitzRPCVerbose(resolverName, config, "info")) {
|
||||
log.info(
|
||||
customChalk.dim(
|
||||
`Finished: resolver:${prettyMs(resolverDuration)} serializer:${prettyMs(
|
||||
serializerDuration,
|
||||
)} total:${prettyMs(duration)}`,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
log.debug(
|
||||
customChalk.dim(
|
||||
`Finished: resolver:${prettyMs(resolverDuration)} serializer:${prettyMs(
|
||||
serializerDuration,
|
||||
)} total:${prettyMs(duration)}`,
|
||||
),
|
||||
)
|
||||
newLine()
|
||||
|
||||
return
|
||||
@@ -320,7 +256,7 @@ export function rpcHandler(config: RpcConfig) {
|
||||
|
||||
config.onError?.(error)
|
||||
|
||||
log.error(new Error(error))
|
||||
log.error(error)
|
||||
newLine()
|
||||
|
||||
if (!error.statusCode) {
|
||||
|
||||
@@ -23,7 +23,7 @@ export async function loader(this: Loader, input: string): Promise<string> {
|
||||
if (isSSR) {
|
||||
this.cacheable(false)
|
||||
|
||||
const resolvers = await collectResolvers(root, rpcFolders, ["ts", "js", "tsx", "jsx"])
|
||||
const resolvers = await collectResolvers(root, rpcFolders, ["ts", "js"])
|
||||
return await transformBlitzRpcServer(
|
||||
input,
|
||||
toPosixPath(id),
|
||||
|
||||
@@ -3,7 +3,7 @@ import {posix, sep, win32, join, normalize} from "path"
|
||||
import {ResolverPathOptions} from "../../../index-server"
|
||||
|
||||
export interface LoaderOptions {
|
||||
resolverPath?: ResolverPathOptions
|
||||
resolverPath: ResolverPathOptions
|
||||
includeRPCFolders?: string[]
|
||||
resolversDynamicImport?: boolean
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type {SessionContext, SessionContextBase} from "@blitzjs/auth"
|
||||
import {Await, Ctx, EnsurePromise, AuthenticatedCtx} from "blitz"
|
||||
import {Await, Ctx, EnsurePromise, AuthenticatedMiddlewareCtx} from "blitz"
|
||||
import type {input as zInput, output as zOutput, ZodTypeAny} from "zod"
|
||||
|
||||
export type ParserType = "sync" | "async"
|
||||
@@ -271,7 +271,7 @@ interface ResolverAuthorize {
|
||||
<T, C = Ctx>(...args: Parameters<SessionContextBase["$authorize"]>): (
|
||||
input: T,
|
||||
ctx: C,
|
||||
) => ResultWithContext<T, AuthenticatedCtx>
|
||||
) => ResultWithContext<T, AuthenticatedMiddlewareCtx>
|
||||
}
|
||||
|
||||
const authorize: ResolverAuthorize = (...args) => {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"extends": ["//"],
|
||||
"pipeline": {
|
||||
"dev": {
|
||||
"dependsOn": ["@blitzjs/auth#build", "blitz#build"],
|
||||
"persistent": true,
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +1,5 @@
|
||||
# blitz
|
||||
|
||||
## 2.0.0-beta.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 19898a488: Fix for tslog error `TypeError: Cannot read properties of undefined (reading 'map')` while using custom errors.
|
||||
- 6811eab1a: Allow `.tsx` & `.jsx` file extensions to be used for resolvers
|
||||
- 022392c12: - Updates `ts-log` peer dependency to `4.9.0`
|
||||
- Removes `javascript` from `blitz new` menu
|
||||
- Hot Fix the `Update Schema` when using blitz generator
|
||||
- Updated dependencies [022392c12]
|
||||
- @blitzjs/generator@2.0.0-beta.33
|
||||
|
||||
## 2.0.0-beta.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 82649f341: Upgrade tslog to `4.9.0`.
|
||||
|
||||
This due a [tslog issue](https://github.com/fullstack-build/tslog/issues/227) that causes tslog to crash when attempting to log an error whose constructor expects more than one argument.
|
||||
|
||||
- Updated dependencies [47c6b62dc]
|
||||
- Updated dependencies [82649f341]
|
||||
- @blitzjs/generator@2.0.0-beta.32
|
||||
|
||||
## 2.0.0-beta.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 90f1741da: blitz-auth: Support for Prisma v5
|
||||
|
||||
Internal: Make `handle` a required paramter while updating the `session` modal.
|
||||
|
||||
- df3265b85: blitz-rpc: Cleanup Event Listeners - Fix potential memory leak by cleaning up any residual event listeners set by blitz.
|
||||
- @blitzjs/generator@2.0.0-beta.31
|
||||
|
||||
## 2.0.0-beta.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c5572bec6: blitz-auth: Fix webpack from following next-auth
|
||||
- 727734955: ### Now we can configure Blitz RPC in the following way,
|
||||
|
||||
In your `[[...blitz]].ts` api file you can see the following settings
|
||||
|
||||
```ts
|
||||
logging?: {
|
||||
/**
|
||||
* allowList Represents the list of routes for which logging should be enabled
|
||||
* If whiteList is defined then only those routes will be logged
|
||||
*/
|
||||
allowList?: string[]
|
||||
/**
|
||||
* blockList Represents the list of routes for which logging should be disabled
|
||||
* If blockList is defined then all routes except those will be logged
|
||||
*/
|
||||
blockList?: string[]
|
||||
/**
|
||||
* verbose Represents the flag to enable/disable logging
|
||||
* If verbose is true then Blitz RPC will log the input and output of each resolver
|
||||
*/
|
||||
verbose?: boolean
|
||||
/**
|
||||
* disablelevel Represents the flag to enable/disable logging for a particular level
|
||||
*/
|
||||
disablelevel?: "debug" | "info"
|
||||
}
|
||||
```
|
||||
|
||||
```ts
|
||||
import { rpcHandler } from "@blitzjs/rpc"
|
||||
import { api } from "src/blitz-server"
|
||||
|
||||
export default api(
|
||||
rpcHandler({
|
||||
onError: console.log,
|
||||
formatError: (error) => {
|
||||
error.message = `FormatError handler: ${error.message}`
|
||||
return error
|
||||
},
|
||||
logging: {
|
||||
...
|
||||
}
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```ts
|
||||
export default api(
|
||||
rpcHandler({
|
||||
onError: console.log,
|
||||
formatError: (error) => {
|
||||
error.message = `FormatError handler: ${error.message}`
|
||||
return error
|
||||
},
|
||||
logging: {
|
||||
verbose: true,
|
||||
blockList: ["getCurrentUser", ...], //just write the resolver name [which is the resolver file name]
|
||||
},
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
This is enable verbose blitz rpc logging for all resolvers except the resolvers `getCurrentUser` and others mentioned in the `blockList`
|
||||
|
||||
- @blitzjs/generator@2.0.0-beta.30
|
||||
|
||||
## 2.0.0-beta.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- b6b9a1c5a: Fix Next-Auth integration: `Unable to use next-auth with provider: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]`
|
||||
- 61888d1a3: Fix log formatting to not show the path of blitz rpc
|
||||
- Updated dependencies [7aef610d8]
|
||||
- @blitzjs/generator@2.0.0-beta.29
|
||||
|
||||
## 2.0.0-beta.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5166e5e03: (feat) upgrade tslog to v4.8.2
|
||||
- Updated dependencies [5166e5e03]
|
||||
- @blitzjs/generator@2.0.0-beta.28
|
||||
|
||||
## 2.0.0-beta.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "blitz",
|
||||
"version": "2.0.0-beta.33",
|
||||
"version": "2.0.0-beta.27",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -30,7 +30,7 @@
|
||||
"blitz": "bin/blitz"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blitzjs/generator": "2.0.0-beta.33",
|
||||
"@blitzjs/generator": "2.0.0-beta.27",
|
||||
"@mrleebo/prisma-ast": "0.2.6",
|
||||
"@types/global-agent": "2.1.1",
|
||||
"arg": "5.0.1",
|
||||
@@ -76,11 +76,11 @@
|
||||
"tar": "6.1.11",
|
||||
"ts-node": "10.9.1",
|
||||
"tsconfig-paths": "4.0.0",
|
||||
"tslog": "4.9.0",
|
||||
"tslog": "4.8.2",
|
||||
"watchpack": "2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:2.0.0-beta.27",
|
||||
"@types/cookie": "0.4.1",
|
||||
"@types/cross-spawn": "6.0.2",
|
||||
"@types/debug": "4.1.7",
|
||||
|
||||
@@ -12,13 +12,14 @@ import {codegenTasks} from "../utils/codegen-tasks"
|
||||
|
||||
type NotUndefined<T> = T extends undefined ? never : T
|
||||
const forms: Record<NotUndefined<AppGeneratorOptions["form"]>, string> = {
|
||||
formik: "Formik (recommended)",
|
||||
finalform: "React Final Form",
|
||||
finalform: "React Final Form (recommended)",
|
||||
hookform: "React Hook Form",
|
||||
formik: "Formik",
|
||||
}
|
||||
|
||||
const language = {
|
||||
typescript: "TypeScript",
|
||||
javascript: "JavaScript",
|
||||
}
|
||||
|
||||
type TLanguage = keyof typeof language
|
||||
|
||||
@@ -5,5 +5,4 @@ declare global {
|
||||
beforeHttpRequest: BeforeHttpRequest
|
||||
beforeHttpResponse: BeforeHttpResponse
|
||||
}
|
||||
var __BLITZ_CLEAN_UP_LISTENERS: () => void
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {ILogObj, ISettingsParam, Logger} from "tslog"
|
||||
import {ILogObj, ISettingsParam, Logger, IMeta} from "tslog"
|
||||
import c from "chalk"
|
||||
import {Table} from "console-table-printer"
|
||||
import ora from "ora"
|
||||
@@ -26,7 +26,7 @@ export const BlitzLogger = (settings: BlitzLoggerSettings = {}) => {
|
||||
maskValuesOfKeys: ["password", "passwordConfirmation", "currentPassword"],
|
||||
type: process.env.NODE_ENV === "production" ? "json" : "pretty",
|
||||
prettyLogTemplate:
|
||||
"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\t{{logLevelName}}\t[{{name}}]\t",
|
||||
"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\t{{logLevelName}}\t[{{filePathWithLine}}{{name}}]\t",
|
||||
...settings,
|
||||
})
|
||||
|
||||
|
||||
@@ -89,23 +89,13 @@ export function reduceBlitzClientPlugins<TPlugins extends readonly ClientPlugin<
|
||||
globalThis.__BLITZ_MIDDLEWARE_HOOKS = middleware
|
||||
|
||||
if (isClient) {
|
||||
if (globalThis.__BLITZ_CLEAN_UP_LISTENERS) {
|
||||
globalThis.__BLITZ_CLEAN_UP_LISTENERS()
|
||||
}
|
||||
const onSessionCreated = async () => {
|
||||
document.addEventListener("blitz:session-created", async () => {
|
||||
await Promise.all(events.onSessionCreated())
|
||||
}
|
||||
const onRpcError = async (e: Event): Promise<void> => {
|
||||
})
|
||||
document.addEventListener("blitz:rpc-error", async (e) => {
|
||||
const customEvent = e as CustomEvent<Error>
|
||||
await Promise.all(events.onRpcError(customEvent.detail))
|
||||
}
|
||||
document.addEventListener("blitz:session-created", onSessionCreated)
|
||||
document.addEventListener("blitz:rpc-error", onRpcError)
|
||||
|
||||
globalThis.__BLITZ_CLEAN_UP_LISTENERS = () => {
|
||||
document.removeEventListener("blitz:session-created", onSessionCreated)
|
||||
document.removeEventListener("blitz:rpc-error", onRpcError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const withPlugins = compose(...providers)
|
||||
|
||||
@@ -2,7 +2,7 @@ import {UrlObject} from "url"
|
||||
// Context for plugins to declaration merge stuff into
|
||||
export interface Ctx {}
|
||||
|
||||
export interface AuthenticatedCtx {}
|
||||
export interface AuthenticatedMiddlewareCtx {}
|
||||
|
||||
export type CodegenField = {
|
||||
component: string
|
||||
@@ -17,7 +17,7 @@ export interface RouteUrlObject extends Pick<UrlObject, "pathname" | "query" | "
|
||||
href: string
|
||||
}
|
||||
|
||||
export interface AuthenticatedCtx {}
|
||||
export interface AuthenticatedMiddlewareCtx {}
|
||||
|
||||
export type EventHooks = {
|
||||
onSessionCreated?: OnSessionCreated
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"extends": ["//"],
|
||||
"pipeline": {
|
||||
"dev": {
|
||||
"dependsOn": ["@blitzjs/generator#build"],
|
||||
"persistent": true,
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +1,5 @@
|
||||
# @blitzjs/codemod
|
||||
|
||||
## 2.0.0-beta.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [19898a488]
|
||||
- Updated dependencies [6811eab1a]
|
||||
- Updated dependencies [022392c12]
|
||||
- blitz@2.0.0-beta.33
|
||||
- @blitzjs/generator@2.0.0-beta.33
|
||||
|
||||
## 2.0.0-beta.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [47c6b62dc]
|
||||
- Updated dependencies [82649f341]
|
||||
- @blitzjs/generator@2.0.0-beta.32
|
||||
- blitz@2.0.0-beta.32
|
||||
|
||||
## 2.0.0-beta.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [90f1741da]
|
||||
- Updated dependencies [df3265b85]
|
||||
- blitz@2.0.0-beta.31
|
||||
- @blitzjs/generator@2.0.0-beta.31
|
||||
|
||||
## 2.0.0-beta.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c5572bec6]
|
||||
- Updated dependencies [727734955]
|
||||
- blitz@2.0.0-beta.30
|
||||
- @blitzjs/generator@2.0.0-beta.30
|
||||
|
||||
## 2.0.0-beta.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7aef610d8]
|
||||
- Updated dependencies [b6b9a1c5a]
|
||||
- Updated dependencies [61888d1a3]
|
||||
- @blitzjs/generator@2.0.0-beta.29
|
||||
- blitz@2.0.0-beta.29
|
||||
|
||||
## 2.0.0-beta.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5166e5e03]
|
||||
- blitz@2.0.0-beta.28
|
||||
- @blitzjs/generator@2.0.0-beta.28
|
||||
|
||||
## 2.0.0-beta.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/codemod",
|
||||
"version": "2.0.0-beta.33",
|
||||
"version": "2.0.0-beta.27",
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "watch unbuild src --wait=0.2",
|
||||
@@ -25,9 +25,9 @@
|
||||
"@babel/plugin-proposal-class-properties": "7.17.12",
|
||||
"@babel/plugin-syntax-jsx": "7.17.12",
|
||||
"@babel/plugin-syntax-typescript": "7.17.12",
|
||||
"@blitzjs/generator": "2.0.0-beta.33",
|
||||
"@blitzjs/generator": "2.0.0-beta.27",
|
||||
"arg": "5.0.1",
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"chalk": "^4.1.0",
|
||||
"cross-spawn": "7.0.3",
|
||||
"debug": "4.3.3",
|
||||
@@ -38,7 +38,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "7.12.10",
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "workspace:*",
|
||||
"@types/jscodeshift": "0.11.2",
|
||||
"@types/node": "18.11.9",
|
||||
"ast-types": "0.14.2",
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
# @blitzjs/config
|
||||
|
||||
## 2.0.0-beta.33
|
||||
|
||||
## 2.0.0-beta.32
|
||||
|
||||
## 2.0.0-beta.31
|
||||
|
||||
## 2.0.0-beta.30
|
||||
|
||||
## 2.0.0-beta.29
|
||||
|
||||
## 2.0.0-beta.28
|
||||
|
||||
## 2.0.0-beta.27
|
||||
|
||||
## 2.0.0-beta.26
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@blitzjs/config",
|
||||
"private": true,
|
||||
"version": "2.0.0-beta.33",
|
||||
"version": "2.0.0-beta.27",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "5.42.1",
|
||||
|
||||
@@ -1,38 +1,5 @@
|
||||
# @blitzjs/generator
|
||||
|
||||
## 2.0.0-beta.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 022392c12: - Updates `ts-log` peer dependency to `4.9.0`
|
||||
- Removes `javascript` from `blitz new` menu
|
||||
- Hot Fix the `Update Schema` when using blitz generator
|
||||
|
||||
## 2.0.0-beta.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 47c6b62dc: Update examples of generate all in docs to include one column in model.
|
||||
- 82649f341: Upgrade tslog to `4.9.0`.
|
||||
|
||||
This due a [tslog issue](https://github.com/fullstack-build/tslog/issues/227) that causes tslog to crash when attempting to log an error whose constructor expects more than one argument.
|
||||
|
||||
## 2.0.0-beta.31
|
||||
|
||||
## 2.0.0-beta.30
|
||||
|
||||
## 2.0.0-beta.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 7aef610d8: Make Next.js version stick to 13.4.5 when generating a new app
|
||||
|
||||
## 2.0.0-beta.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5166e5e03: (feat) upgrade tslog to v4.8.2
|
||||
|
||||
## 2.0.0-beta.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@blitzjs/generator",
|
||||
"version": "2.0.0-beta.33",
|
||||
"version": "2.0.0-beta.27",
|
||||
"homepage": "https://blitzjs.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -48,13 +48,13 @@
|
||||
"prettier": "^2.7.1",
|
||||
"recast": "0.20.5",
|
||||
"supports-color": "8.1.1",
|
||||
"tslog": "4.9.0",
|
||||
"tslog": "4.8.2",
|
||||
"username": "5.1.0",
|
||||
"vinyl": "2.2.1",
|
||||
"zod": "3.20.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.27",
|
||||
"@juanm04/cpx": "2.0.1",
|
||||
"@types/babel__core": "7.1.19",
|
||||
"@types/diff": "5.0.2",
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"@blitzjs/rpc": "latest",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "latest",
|
||||
"next": "13.4.5",
|
||||
"next": "^13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"@blitzjs/rpc": "latest",
|
||||
"@prisma/client": "4.6.1",
|
||||
"blitz": "latest",
|
||||
"next": "13.4.5",
|
||||
"next": "^13.3.0",
|
||||
"prisma": "4.6.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
@@ -36,7 +36,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@next/bundle-analyzer": "12.0.8",
|
||||
"@next/env": "13.4.19",
|
||||
"@testing-library/jest-dom": "5.16.5",
|
||||
"@testing-library/react": "13.4.0",
|
||||
"@testing-library/react-hooks": "8.0.1",
|
||||
|
||||
@@ -95,7 +95,7 @@ const Home: BlitzPage = () => {
|
||||
<div className={styles.code}>
|
||||
<span>1</span>
|
||||
<pre>
|
||||
<code>blitz generate all project name:string</code>
|
||||
<code>blitz generate all project</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"dependencies": {
|
||||
"@blitzjs/next": "latest",
|
||||
"blitz": "latest",
|
||||
"next": "13.4.5",
|
||||
"next": "^13.3.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"ts-node": "10.9.1"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"dependencies": {
|
||||
"@blitzjs/next": "latest",
|
||||
"blitz": "latest",
|
||||
"next": "13.4.5",
|
||||
"next": "^13.3.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"ts-node": "10.9.1"
|
||||
|
||||
@@ -12,14 +12,16 @@ if (process.env.parentModel) {
|
||||
}
|
||||
|
||||
if (process.env.parentModel) {
|
||||
export const Update__ModelName__Schema = Create__ModelName__Schema.merge(z.object({
|
||||
export const Update__ModelName__Schema = z.object({
|
||||
id: z.__modelIdZodType__(),
|
||||
__parentModelId__: z.__parentModelIdZodType__(),
|
||||
}))
|
||||
// template: __fieldName__: z.__zodType__(),
|
||||
})
|
||||
} else {
|
||||
export const Update__ModelName__Schema = Create__ModelName__Schema.merge(z.object({
|
||||
export const Update__ModelName__Schema = z.object({
|
||||
id: z.__modelIdZodType__(),
|
||||
}))
|
||||
// template: __fieldName__: z.__zodType__(),
|
||||
})
|
||||
}
|
||||
|
||||
export const Delete__ModelName__Schema = z.object({
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"@typescript-eslint/parser": "5.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blitzjs/config": "2.0.0-beta.33",
|
||||
"@blitzjs/config": "2.0.0-beta.27",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"react": "18.2.0",
|
||||
|
||||
1091
pnpm-lock.yaml
generated
1091
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33"
|
||||
"blitz": "2.0.0-beta.27"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33"
|
||||
"blitz": "2.0.0-beta.27"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0",
|
||||
"uuid": "^8.3.1"
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33",
|
||||
"blitz": "2.0.0-beta.27",
|
||||
"jscodeshift": "0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/blitz-js/blitz#readme",
|
||||
"dependencies": {
|
||||
"blitz": "2.0.0-beta.33"
|
||||
"blitz": "2.0.0-beta.27"
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user