Skip to content

Commit

Permalink
Merge pull request #3 from intuita-inc/cms/automations/msw-upgrade-re…
Browse files Browse the repository at this point in the history
…cipe

Automatically generated. Merged on Netlify CMS.
  • Loading branch information
mohab-sameh committed Nov 21, 2023
2 parents cd8edbe + e1afa5d commit 070c9f9
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions cms/automations/msw-upgrade-recipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,38 @@ created-on: 2023-11-16T14:11:04.212Z
f_long-description: >-
## Description
This recipe is a set of codemods that will upgrade your project from using msw v1 to v2.
The recipe includes the following codemods:
- [imports](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/imports)
- [type-args](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/type-args)
- [request-changes](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/request-changes)
- [ctx-fetch](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/ctx-fetch)
- [req-passthrough](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/req-passthrough)
- [response-usages](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/response-usages)
- [callback-signature](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/callback-signature)
- [lifecycle-events-signature](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/lifecycle-events-signature)
- [print-handler](https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/print-handler)
* imports
* type-args
* request-changes
* ctx-fetch
* req-passthrough
* response-usages
* callback-signature
* lifecycle-events-signature
* print-handler
### FNs
This recipe does not change the signatures of MSW handlers, if they were called using a custom factory function, for example to provide more type-safety or else. For example, the following code will only be partially updated:
```ts
```typescript
export function mockFactory<T extends MyComplexType>(
url: string,
Expand All @@ -39,13 +53,16 @@ f_long-description: >-
```
### Links for more info
- [msw v1 to v2 migration guide -> upgrade recipe](https://mswjs.io/docs/migrations/1.x-to-2.x/)
* [msw v1 to v2 migration guide -> upgrade recipe](https://mswjs.io/docs/migrations/1.x-to-2.x/)
f_github-link: https://github.com/intuita-inc/codemod-registry/tree/main/msw/2/upgrade-recipe
f_vs-code-link: vscode://intuita.intuita-vscode-extension/showCodemod?chd=GZo687pOCc0ICc9ptHSWPJTErcM
f_cli-command: intuita msw/2/upgrade-recipe
f_framework: cms/framework/msw.md
f_applicability-criteria: "MSW version >= 1.0.0"
f_applicability-criteria: MSW version >= 1.0.0
f_verified-codemod: true
f_author: cms/authors/intuita.md
layout: "[automations].html"
Expand All @@ -56,7 +73,8 @@ published-on: 2023-11-17T15:18:58.613Z
f_slug-name: msw-upgrade-recipe
f_codemod-engine: cms/codemod-engines/ts-morph.md
f_change-mode-2: Assistive
f_estimated-time-saving: Depending on the size of the project, this recipe can save up to 6 hours of dedicated work and more.
f_estimated-time-saving: Depending on the size of the project, this recipe can
save up to 6 hours of dedicated work and more.
f_labels:
- cms/labels/msw-v1-v2.md
tags: automations
Expand Down

0 comments on commit 070c9f9

Please sign in to comment.