Skip to content

Commit

Permalink
Codemods section (prisma#2301)
Browse files Browse the repository at this point in the history
* fix: broken links in mdx files

* add: initial full-text search docs

* Update content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx

* Update content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx

* Update content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx

* Update content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx

* Moved info from readme to page

Co-authored-by: Nilu <nilubava@gmail.com>
Co-authored-by: Matthew Mueller <mattmuelle@gmail.com>
  • Loading branch information
3 people committed Sep 9, 2021
1 parent 5cc864c commit 9c252a2
Showing 1 changed file with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,38 @@ metaDescription: 'Use codemods to upgrade your codebase as Prisma changes and ev

<TopBlock>

`@prisma/codemods` helps you to upgrade your codebase as Prisma evolves and changes. For more information, see: https://github.com/prisma/codemods
The `@prisma/codemods` package helps you to upgrade your codebase as Prisma evolves and changes.

<Admonition type="info">

You can checkout the repository, here: https://github.com/prisma/codemods

</Admonition>

</TopBlock>

## Usage

```terminal
$ npx @prisma/codemods <transform> <path> <...options>
```

- `<transform>` - See [Transforms](#transforms) for available choices
- `<path>` - The directory of your app. i.e ./my-awesome-project

## Options

- `(-f)orce` - Bypass Git safety checks and forcibly run codemods
- `(-s)chemaPath` - Specify a path to your ./prisma/schema.prisma
- `(-d)ry` - Dry run (no changes are made to files)
- `(-p)rint` - Print transformed files to your terminal
- `--instanceNames=myClient` - Useful when importing an already instantiated client (i.e import myClient from './myClient')

## Transforms

| `<transform>` | Description | Example |
| ------------- | ----------------------------------------------------------- | ----------------------------------------------- |
| `namespace` | Codemod for `@prisma/client` namespace change | `npx @prisma/codemods namespace ./my-project` |
| `findUnique` | Converts `prisma.x.findOne` to `prisma.x.findUnique` | `npx @prisma/codemods findUnique ./my-project` |
| `to$` | to\$: Converts deprecated `prisma.x` methods to `prisma.$x` | `npx @prisma/codemods to$ ./my-project` |
| `update-2.12` | Includes `namespace`/`findUnique`/`to$` | `npx @prisma/codemods update-2.12 ./my-project` |

0 comments on commit 9c252a2

Please sign in to comment.