这是indexloc提供的服务,不要输入任何密码
Skip to content

Add turbo migrate / turbomod package for automated migrations #555

@jaredpalmer

Description

@jaredpalmer

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

  • 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 packageManager key to package.json in the root and in each workspace's package.json
    • Move turbo config out of package.json and into a new turbo.json that lives at the root of the monorepo

Describe alternatives you've considered

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions