Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migration cli #769

Merged
merged 31 commits into from
Aug 18, 2023
Merged

Add migration cli #769

merged 31 commits into from
Aug 18, 2023

Conversation

paul-sachs
Copy link
Contributor

@paul-sachs paul-sachs commented Aug 15, 2023

Created a CLI that migrates from old packages to new.

  • Using jscodeshift to guarantee that we are only modifying imports and not arbitrary code
  • Testing with jest since jscodeshift have a bunch of helpers to use with jest. We can migrate those to jasmine for consistency

@paul-sachs paul-sachs changed the title Add migration step Add migration cli Aug 15, 2023
Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very promising, now we just have to sort out the details.

Blocking on jest, we already have enough dependencies. I'm okay with replacing it later, when we know better what needs testing.

packages/connect-migrate/package.json Outdated Show resolved Hide resolved
packages/connect-migrate/package.json Outdated Show resolved Hide resolved
packages/connect-migrate/src/cli.ts Outdated Show resolved Hide resolved
packages/connect-migrate/src/replacement-map.ts Outdated Show resolved Hide resolved
packages/connect-migrate/src/replacement-map.ts Outdated Show resolved Hide resolved
packages/connect-migrate/src/cli.ts Outdated Show resolved Hide resolved
packages/connect-migrate/src/cli.ts Outdated Show resolved Hide resolved
@paul-sachs
Copy link
Contributor Author

@timostamm all great points, i had started on this tool separate from connect-es, so i'll migrate the packages/testing to something more akin to what's in connectrpc already. This was mostly just porting things over as is. I'll tune it up.

@paul-sachs paul-sachs marked this pull request as ready for review August 16, 2023 18:29
packages/connect-migrate/package.json Outdated Show resolved Hide resolved
packages/connect-migrate/package.json Outdated Show resolved Hide resolved
packages/connect-migrate/src/arguments.ts Show resolved Hide resolved
packages/connect-migrate/src/cli.ts Outdated Show resolved Hide resolved
packages/connect-migrate/tsconfig.json Outdated Show resolved Hide resolved
@paul-sachs
Copy link
Contributor Author

paul-sachs commented Aug 17, 2023

@timostamm I've fixed the issue with parsing you had with the custom-transport.ts file and we now use different parsers for different filetypes. This does raise the risk that someone might have some custom babel setup but i've added a section to the readme to describe other ways to run our transforms.

@paul-sachs paul-sachs merged commit 9b6a44f into main Aug 18, 2023
2 checks passed
@paul-sachs paul-sachs deleted the psachs/migrate branch August 18, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants