vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.13k stars 1.8k forks source link

Add `turbo migrate` / `turbomod` package for automated migrations #555

Closed jaredpalmer closed 2 years ago

jaredpalmer commented 2 years ago

Describe the feature you'd like to request

We need a way to make breaking changes less painful and provide a smooth upgrade path between turbo versions.

Describe the solution you'd like

Add a new CLI package called turbo-migrate or turbomod that can hold turbo migration scripts / codemods for when we need to make breaking changes to user's monorepos, code, or turbo configurations.

At the moment, I think the package can be written in TypeScript. If we one day do need it written in Go, we can deal with it then. For now, we only need to modify package.json.

npx @turbo/migrate <transform> <path>

transform - name of transform, see available transforms below. path - files or directory to transform --dry Do a dry-run, no code will be edited --print Prints the changed output for comparison --force Force execute a codemod

Describe alternatives you've considered

N/A

samchouse commented 2 years ago
  • Add packageManager key to package.json in the root and in each workspace's package.json

I think it's only needed in the root package.json. It might be better backwards from wherever Turbo was run until we find the root package.json.