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 version check into emitter #5627

Open
JoshLove-msft opened this issue Jan 15, 2025 · 0 comments
Open

Add version check into emitter #5627

JoshLove-msft opened this issue Jan 15, 2025 · 0 comments
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Comments

@JoshLove-msft
Copy link
Contributor

JoshLove-msft commented Jan 15, 2025

3P plugin authors will reference the MGC nuget package in their plugin. The typical pattern is to have a build step that copies the MGC dll that they build against into the dist folder. This will overwrite the dll that was packaged with the emitter from npm, which could lead to runtime errors if the version of the emitter is not compatible with the version of MGC.

In order to ensure that there are no incompatibilities, we could add logic into our npm publish workflow that stores off the versions of the MGC and MGC.CM dlls in a metadata file. As part of the npm build step, we would compare the versions in the dist folder to this metadata file, and error out if they are not the same.

Another possible approach is to establish a convention where the versions for the emitter and the nuget packages are always identical. This convention would make it clear which Nuget/emitter versions are being used without digging into the dist. It wouldn't prevent users from deviating but it would be more of a convention that we would need to document. We would still want to have a check in the emitter to guide users to the correct version.

@JoshLove-msft JoshLove-msft added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp
Projects
None yet
Development

No branches or pull requests

1 participant