From 4b6fa5db8a6eee247b7895ec151b62e26cad156f Mon Sep 17 00:00:00 2001 From: Greg Pabian <35925521+grzpab@users.noreply.github.com> Date: Fri, 22 Dec 2023 14:55:47 +0100 Subject: [PATCH] chore: upgraded README.md files --- .../antd/5/props-changed-migration/README.md | 6 +- codemods/antd/5/remove-style-import/README.md | 6 +- .../5/removed-component-migration/README.md | 6 +- .../removed-static-method-migration/README.md | 6 +- codemods/msw/2/type-args/README.md | 4 +- codemods/next-i18next/copy-keys/README.md | 6 +- .../redwoodjs/core/4/auth-decoder/README.md | 84 +++++++++++++++++++ 7 files changed, 100 insertions(+), 18 deletions(-) create mode 100644 codemods/redwoodjs/core/4/auth-decoder/README.md diff --git a/codemods/antd/5/props-changed-migration/README.md b/codemods/antd/5/props-changed-migration/README.md index c7c166e1..2c93039a 100644 --- a/codemods/antd/5/props-changed-migration/README.md +++ b/codemods/antd/5/props-changed-migration/README.md @@ -7,7 +7,7 @@ This codemod changes the way the component props are applied. ### Before -```ts +```TypeScript import { Tag } from 'antd'; const Component = () => { @@ -19,7 +19,7 @@ const Component = () => { ### After -```ts +```TypeScript import { Tag } from 'antd'; const Component = () => { @@ -53,7 +53,7 @@ Up to 1 minutes per occurrence ### Owner -[Intuita](https://github.com/intuita-inc) +[Ant Design](https://github.com/ant-design) ### Links for more info diff --git a/codemods/antd/5/remove-style-import/README.md b/codemods/antd/5/remove-style-import/README.md index 809f3cd7..72a04feb 100644 --- a/codemods/antd/5/remove-style-import/README.md +++ b/codemods/antd/5/remove-style-import/README.md @@ -7,7 +7,7 @@ Comment out the style file import from antd (in js file). ### Before -```ts +```TypeScript import 'antd/es/auto-complete/style'; import 'antd/lib/button/style/index.less'; import 'antd/dist/antd.compact.min.css'; @@ -16,7 +16,7 @@ import 'antd/dist/antd.compact.min.css'; ### After -```ts +```TypeScript // import 'antd/es/auto-complete/style'; // import 'antd/lib/button/style/index.less'; // import 'antd/dist/antd.compact.min.css'; @@ -46,7 +46,7 @@ Up to 1 minutes per occurrence ### Owner -[Intuita](https://github.com/intuita-inc) +[Ant Design](https://github.com/ant-design) ### Links for more info diff --git a/codemods/antd/5/removed-component-migration/README.md b/codemods/antd/5/removed-component-migration/README.md index 31de96db..5e8e205e 100644 --- a/codemods/antd/5/removed-component-migration/README.md +++ b/codemods/antd/5/removed-component-migration/README.md @@ -7,14 +7,14 @@ Replace import for removed component in v5. ### Before -```ts +```TypeScript import { Avatar, BackTop, Comment, PageHeader } from 'antd'; ``` ### After -```ts +```TypeScript import { Comment } from '@ant-design/compatible'; import { PageHeader } from '@ant-design/pro-layout'; import { Avatar, FloatButton } from 'antd'; @@ -44,7 +44,7 @@ Up to 1 minutes per occurrence ### Owner -[Intuita](https://github.com/intuita-inc) +[Ant Design](https://github.com/ant-design) ### Links for more info diff --git a/codemods/antd/5/removed-static-method-migration/README.md b/codemods/antd/5/removed-static-method-migration/README.md index 43eb7cea..bd4b2a3c 100644 --- a/codemods/antd/5/removed-static-method-migration/README.md +++ b/codemods/antd/5/removed-static-method-migration/README.md @@ -8,7 +8,7 @@ Replace notification.close with notification.destroy. ### Before -```ts +```TypeScript import { message, notification } from 'antd'; const App = () => { @@ -36,7 +36,7 @@ const App = () => { ### After -```ts +```TypeScript import { message, notification } from 'antd'; const App = () => { @@ -84,7 +84,7 @@ Up to 1 minutes per occurrence ### Owner -[Intuita](https://github.com/intuita-inc) +[Ant Design](https://github.com/ant-design) ### Links for more info diff --git a/codemods/msw/2/type-args/README.md b/codemods/msw/2/type-args/README.md index d9820ce0..99e9b3f8 100644 --- a/codemods/msw/2/type-args/README.md +++ b/codemods/msw/2/type-args/README.md @@ -6,7 +6,7 @@ There is a change to generic type interface of `rest.method()` calls. This codem ### WARNING -This codemod runs `.fixUnusedIdentifiers()` on a source file you are running it on. This would remove any unused declarations in the file. This is due to atomicity of this mod, which blindly inserts the callback structure into each msw handler callback and then cleans up the variables that are not used. +This codemod runs `.fixUnusedIdentifiers()` on a target source file. This would remove any unused declarations in the file. This is due to the atomicity of this codemod, which blindly inserts the callback structure into each msw handler callback and then cleans up the variables that are not used anymore. ## Example @@ -117,5 +117,3 @@ v1.0.0 ### Owner [Intuita](https://github.com/intuita-inc) - -### Links for more info diff --git a/codemods/next-i18next/copy-keys/README.md b/codemods/next-i18next/copy-keys/README.md index 2fac99a4..349d9de7 100644 --- a/codemods/next-i18next/copy-keys/README.md +++ b/codemods/next-i18next/copy-keys/README.md @@ -1,4 +1,4 @@ -# next-i18next Copy Keys +# Next-i18next Copy Keys ## Description @@ -10,7 +10,7 @@ The codemod expects the following arguments: - `newNamespace` is the name of the namespace to which the keys are copied, - `keys` is a comma-separated list of keys. -You need to pass these arguments using the Codemod Arguments' settings or [Intuita CLI](https://www.npmjs.com/package/@intuita-inc/intuita). +You need to pass these arguments using the [Codemod Arguments' settings](https://docs.intuita.io/docs/vs-code-extension/advanced-usage#set-codemod-arguments) in Intuita VS Code extension or [Intuita CLI](https://docs.intuita.io/docs/cli/quickstart). ## Example: @@ -69,7 +69,7 @@ v1.0.0 ### **Codemod Engine** -Intuita File Transformation Engine +Filemod ### Estimated Time Saving diff --git a/codemods/redwoodjs/core/4/auth-decoder/README.md b/codemods/redwoodjs/core/4/auth-decoder/README.md new file mode 100644 index 00000000..ff5d4182 --- /dev/null +++ b/codemods/redwoodjs/core/4/auth-decoder/README.md @@ -0,0 +1,84 @@ +# Auth Decoder + +## Description + +This codemod for RedwoodJS v4 automatically inserts an `authDecoder` property into the `createGraphQLHandler` call if it's not already present. It also adds an import statement for `authDecoder` from `@redwoodjs/auth-auth0-api` at the beginning of the file, ensuring that the necessary functionality for authentication is correctly integrated. + +## Example + +### Before + +```ts +import { createGraphQLHandler } from '@redwoodjs/graphql-server'; + +import directives from 'src/directives/**/*.{js,ts}'; +import sdls from 'src/graphql/**/*.sdl.{js,ts}'; +import services from 'src/services/**/*.{js,ts}'; + +import { db } from 'src/lib/db'; +import { logger } from 'src/lib/logger'; + +export const handler = createGraphQLHandler({ + loggerConfig: { logger, options: {} }, + directives, + sdls, + services, + onException: () => { + // Disconnect from your database with an unhandled exception. + db.$disconnect(); + }, +}); +``` + +### After + +```ts +import { authDecoder } from '@redwoodjs/auth-auth0-api'; +import { createGraphQLHandler } from '@redwoodjs/graphql-server'; + +import directives from 'src/directives/**/*.{js,ts}'; +import sdls from 'src/graphql/**/*.sdl.{js,ts}'; +import services from 'src/services/**/*.{js,ts}'; + +import { db } from 'src/lib/db'; +import { logger } from 'src/lib/logger'; + +export const handler = createGraphQLHandler({ + authDecoder: authDecoder, + loggerConfig: { logger, options: {} }, + directives, + sdls, + services, + + onException: () => { + // Disconnect from your database with an unhandled exception. + db.$disconnect(); + } +}); +``` + +## Applicability Criteria + +RedwoodJS < v4.0.0 + +## Other Metadata + +### Codemod Version + +v1.0.0 + +### Change Mode + +**Assistive**: The automation partially completes changes. Human involvement is needed to make changes ready to be pushed and merged. + +### **Codemod Engine** + +[jscodeshift](https://github.com/facebook/jscodeshift) + +### Estimated Time Saving + +~6 minutes per occurrence + +### Owner + +[Rajasegar Chandran](https://github.com/rajasegar)