Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
prismaPublic archive

About

A Collection of Codemods for Prisma 2

Resources

Code of conduct

Security policy

Stars

36 stars

Watchers

5 watching

Forks

Repository files navigation

npm

npm

A Collection of Codemods for Prisma

Usage

Usage

  $ npx @prisma/codemods <transform> <path> <...options>
  transform    One of the choices from https://github.com/prisma/codemods#transforms
  path         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

Development

git clone https://github.com/prisma/codemods.git
cd codemods
yarn cli --help

Testing

If you make changes be sure to use yarn watch or yarn build before running your tests

yarn test

About

A Collection of Codemods for Prisma 2

Resources

Code of conduct

Security policy

Stars

36 stars

Watchers

5 watching

Forks

Releases

Packages

Contributors

Languages