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

Transform class references in connect-migrate #1342

Merged
merged 11 commits into from
Jan 8, 2025

Conversation

timostamm
Copy link
Member

@timostamm timostamm commented Nov 26, 2024

This updates the connect-migrate command to replace imports for a message class with a schema import, and update:

  • "new" expressions to a create() call
  • calls to the static methods fromBinary, fromJson, fromJsonString
  • isMessage calls

When the identifier is used elsewhere, add a type import for the message type.
When the message is a well-known type, update to import from @bufbuild/protobuf/wkt.

Before we can merge this, we should:

  • not add type imports in .js files
  • handle import as
  • handle require calls

Signed-off-by: Timo Stamm <ts@timostamm.de>
Signed-off-by: Timo Stamm <ts@timostamm.de>
Signed-off-by: Timo Stamm <ts@timostamm.de>
Signed-off-by: Timo Stamm <ts@timostamm.de>
Signed-off-by: Timo Stamm <ts@timostamm.de>
@timostamm timostamm marked this pull request as ready for review December 2, 2024 15:44
@timostamm timostamm requested a review from smaye81 December 2, 2024 15:44
smaye81 and others added 5 commits January 6, 2025 17:06
* Add additional docs on options

Signed-off-by: Steve Ayers <sayers@buf.build>

* Remove WKT

Signed-off-by: Steve Ayers <sayers@buf.build>

* Format

Signed-off-by: Steve Ayers <sayers@buf.build>

* Update MIGRATING.md

Co-authored-by: Timo Stamm <ts@timostamm.de>
Signed-off-by: Steve Ayers <sayers@buf.build>

* Update MIGRATING.md

Co-authored-by: Timo Stamm <ts@timostamm.de>
Signed-off-by: Steve Ayers <sayers@buf.build>

---------

Signed-off-by: Steve Ayers <sayers@buf.build>
Co-authored-by: Timo Stamm <ts@timostamm.de>
@timostamm
Copy link
Member Author

CI failures appear to be an issue with npmjs.com. npm ci fails with

Invalid response body while trying to fetch https://registry.npmjs.org/typescript: aborted
npm error network This is a problem related to network connectivity.

Everything passes locally, so I'm going to merge.

@timostamm timostamm merged commit 70a4082 into main Jan 8, 2025
29 of 44 checks passed
@timostamm timostamm deleted the tstamm/Transform-class-references-in-connect-migrate branch January 8, 2025 15:54
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