-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
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.
- It should be modeled after https://github.com/vercel/next.js/tree/canary/packages/next-codemod. We aren't using jscodeshift so that part is irrelevant for now. The parts that are good are the CLI API, the ability to select codemod and run it, throwing if git status isn't clean.
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
- We should add a page to the documentation listing what each codemod does, just like https://nextjs.org/docs/advanced-features/codemods
- 2 codemods should be written / can be helpful for stubs
- Add
packageManagerkey topackage.jsonin the root and in each workspace'spackage.json - Move
turboconfig out ofpackage.jsonand into a newturbo.jsonthat lives at the root of the monorepo
- Add
Describe alternatives you've considered
N/A
ewnd9 and claudiorivera
Metadata
Metadata
Assignees
Labels
No labels