blitz-js / blitz

⚡️ The Missing Fullstack Toolkit for Next.js
https://Blitzjs.com
MIT License
13.69k stars 800 forks source link

Update recipes to work with blitz toolkit #3813

Closed dillondotzip closed 1 year ago

dillondotzip commented 2 years ago

What is the problem?

Some recipes are out of date and need to be updated.

The main thing that that needs to be updated is the use of paths.blitzConfig(). Blitz toolkit exports helpers for transforming next.config.js.

You can get the next.config.js path with paths.nextConfig(). transformNextConfig is exported from blitz and returns the following:

program: Program
configObj: []
pushToConfig: (property: j.ObjectProperty) => void
wrapConfig: (func: string | j.CallExpression) => {
   withBlitz: j.Identifier | j.CallExpression 
}
addRequireStatement: (identifier: string, packageName: string) => void

(wrapConfig().withBlitz returns whatever is inside withBlitz())

siddhsuresh commented 2 years ago

Hey @dillonraphael can I work on this?