blitz icon indicating copy to clipboard operation
blitz copied to clipboard

Store error for cookiePrefix if undefined & show error at the end of codemod

Open itsdillon opened this issue 3 years ago • 1 comments

What are the changes and their implications?

Noticed a weird user flow that if their cookiePrefix is parsed as undefined (due to reasons such as a ternary statement) that the codemod would error and the only way for the user to continue is modify their blitz.config.ts.

  • Instead this PR introduces an array called collectedErrors. So now in a step action if you want to store an error for later, you can push the error as an object, ie. {messages: string, step: number}

  • The type for the step object has now been updated to add a stepIndex parameter to the action key: type TStep = {name: string; action: (stepIndex?: number) => Promise<void>}

itsdillon avatar Aug 09 '22 19:08 itsdillon

🦋 Changeset detected

Latest commit: 57379fe1eb6b1f00635cb1612c6a72aea7f149d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@blitzjs/codemod Patch
@blitzjs/auth Patch
@blitzjs/next Patch
@blitzjs/rpc Patch
@blitzjs/config Patch
@blitzjs/generator Patch
blitz Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Aug 09 '22 19:08 changeset-bot[bot]