Skip to content

Commit

Permalink
Update Codemods “msw-upgrade-recipe”
Browse files Browse the repository at this point in the history
  • Loading branch information
mohab-sameh committed Nov 21, 2023
1 parent cd8edbe commit 4d21acd
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions cms/automations/msw-upgrade-recipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,18 @@ 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)
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)
### 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
export function mockFactory<T extends MyComplexType>(
Expand All @@ -39,13 +34,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 +54,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 4d21acd

Please sign in to comment.