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

Setup repo to support client generation with tsp-client #1845

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

catalinaperalta
Copy link
Member

@catalinaperalta catalinaperalta commented Oct 10, 2024

Adding configs necessary to generate client libraries with tsp-client.

Example of how to update emitter-package.json in the future:

PS C:\repos\azure-sdk-for-rust> .\eng\common\scripts\typespec\New-EmitterPackageJson.ps1 -PackageJsonPath <path to>\typespec-rust\packages\typespec-rust\package.json -OutputDirectory .\eng\

There will be a tsp-client specific command coming soon!

To sync the lock file with the emitter-package.json file run: tsp-client generate-lock-file

@catalinaperalta catalinaperalta marked this pull request as ready for review October 10, 2024 23:46
@weshaggard weshaggard requested a review from hallipr October 11, 2024 15:22
@heaths
Copy link
Member

heaths commented Oct 11, 2024

Can we pass a URL instead of local file path? Currently, we have no plans to colocate the emitter source in this repo. Can we also specify it via config?

heaths
heaths previously requested changes Oct 11, 2024
@catalinaperalta
Copy link
Member Author

Can we pass a URL instead of local file path? Currently, we have no plans to colocate the emitter source in this repo. Can we also specify it via config?

@hallipr can you help answer this? On the tsp-client side, I can take this into consideration for the new command that will replace the pwsh script.

@hallipr
Copy link
Member

hallipr commented Oct 14, 2024

Can we pass a URL instead of local file path? Currently, we have no plans to colocate the emitter source in this repo. Can we also specify it via config?

When we use New-EmitterPackageJson for separate emitter and sdk repos, it's typically the emitter repo that calls the script. The sdk repo only contains the emitter-package.json file and has no config or code related to its creation.

@heaths heaths changed the base branch from feature/track2 to main October 18, 2024 23:55
@heaths heaths self-requested a review October 24, 2024 20:01
@catalinaperalta catalinaperalta dismissed stale reviews from hallipr and heaths October 29, 2024 01:57

Comment addressed

@catalinaperalta catalinaperalta enabled auto-merge (squash) October 29, 2024 02:05
Copy link
Member

@jhendrixMSFT jhendrixMSFT left a comment

Choose a reason for hiding this comment

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

I don't know enough about how this should be structured but the values for the Rust emitter look correct.

@catalinaperalta
Copy link
Member Author

I don't know enough about how this should be structured but the values for the Rust emitter look correct.

This is the final shape. The only action for you is to pin your devDependencies in the typespec-rust emitter to a specific version instead of a range (otherwise you'll have to do it manually in your emitter-package.json updates). In the future you'll follow these steps to update this file with new rust emitter releases:

  1. To sync emitter-package.json with the typespec-rust package.json, run:
PS C:\repos\azure-sdk-for-rust> .\eng\common\scripts\typespec\New-EmitterPackageJson.ps1 -PackageJsonPath <path to>\typespec-rust\packages\typespec-rust\package.json -OutputDirectory .\eng\

NOTE: I'll let you know when tsp-client has a command for this so you can stop using the pwsh script

  1. To sync your emitter-package-lock.json, run:
tsp-client generate-lock-file

And of course feel free to reach out if you have any questions!

@catalinaperalta catalinaperalta merged commit 2b6016b into main Oct 29, 2024
41 checks passed
@catalinaperalta catalinaperalta deleted the tspclient-setup branch October 29, 2024 18:48
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.

7 participants