Skip to content

Commit

Permalink
regression: export enhancePrisma from the brower (#4326)
Browse files Browse the repository at this point in the history
* move it back to index-server

* fix turbopack

* Create big-cars-raise.md

* cleanup

* fix

* fix lint
  • Loading branch information
siddhsuresh authored May 9, 2024
1 parent 6e8eeb1 commit 5a14306
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changeset/big-cars-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@blitzjs/next": patch
"@blitzjs/rpc": patch
"blitz": patch
---

fix export `enhancePrisma` in client
5 changes: 5 additions & 0 deletions packages/blitz-next/scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ function codegen() {
const defaultIndexJsPath = path.join(dotBlitzDir, "index.js")
const defaultIndexBrowserJSPath = path.join(dotBlitzDir, "index-browser.js")
const defaultIndexDTSPath = path.join(dotBlitzDir, "index.d.ts")
const emptyJSPath = path.join(dotBlitzDir, "turbopack-empty.js")

if (!fs.existsSync(defaultIndexJsPath)) {
await copyFile(path.join(__dirname, "default-index.js"), defaultIndexJsPath)
Expand All @@ -181,6 +182,10 @@ function codegen() {
if (!fs.existsSync(defaultIndexDTSPath)) {
await copyFile(path.join(__dirname, "default-index.d.ts"), defaultIndexDTSPath)
}

if (!fs.existsSync(emptyJSPath)) {
await copyFile(path.join(__dirname, "turbopack-empty.js"), emptyJSPath)
}
} catch (e) {
console.error(e)
}
Expand Down
1 change: 1 addition & 0 deletions packages/blitz-next/scripts/turbopack-empty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
7 changes: 4 additions & 3 deletions packages/blitz-rpc/src/index-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ export function installWebpackConfig({
export function installTurboConfig() {
return {
resolveAlias: {
"cross-spawn": {browser: "./turbopack/empty.js"},
"npm-which": {browser: "./turbopack/empty.js"},
fs: {browser: "./turbopack/empty.js"},
"cross-spawn": {browser: ".blitz/turbopack-empty.js"},
"npm-which": {browser: ".blitz/turbopack-empty.js"},
fs: {browser: ".blitz/turbopack-empty.js"},
child_process: {browser: ".blitz/turbopack-empty.js"},
},
rules: {
"**/*...blitz*.{jsx,tsx,js,ts}": {
Expand Down
1 change: 1 addition & 0 deletions packages/blitz/src/index-browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export {
RedirectError,
OAuthError,
}
export * from "./utils/enhance-prisma"

export type BlitzProviderComponentType = <TProps = any>(
component: ComponentType<TProps>,
Expand Down
1 change: 0 additions & 1 deletion packages/blitz/src/index-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export {reduceBlitzServerPlugins} from "./plugin"
export {findNodeModulesRoot, findNodeModulesRootSync} from "./cli/utils/find-node-modules"

export {startWatcher, stopWatcher} from "./cli/utils/routes-manifest"
export * from "./utils/enhance-prisma"

export interface MiddlewareResponse<C extends Ctx = Ctx> extends ServerResponse {
blitzCtx: C
Expand Down

0 comments on commit 5a14306

Please sign in to comment.