Skip to content

[tsp-client] Support emitter-output-dir#11626

Merged
jsquire merged 26 commits intomainfrom
emitter-output-dir
Aug 14, 2025
Merged

[tsp-client] Support emitter-output-dir#11626
jsquire merged 26 commits intomainfrom
emitter-output-dir

Conversation

@catalinaperalta
Copy link
Member

@catalinaperalta catalinaperalta commented Aug 11, 2025

  • Refactor init code to support emitter-output-dir and use a function for shared processing between the url and local spec scenario
  • Add tests
  • Some other minor refactoring/improvements to variable names.

Fixes #10823

@catalinaperalta catalinaperalta marked this pull request as ready for review August 12, 2025 19:19
Copilot AI review requested due to automatic review settings August 12, 2025 19:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the tsp-client tool to support the emitter-output-dir configuration option as an alternative to the legacy package-dir approach for determining client library output paths. The changes consolidate initialization logic into a shared function and add comprehensive test coverage for both new and legacy path resolution scenarios.

Key changes:

  • Introduces support for emitter-output-dir with preference over package-dir for path resolution
  • Refactors initialization code into a shared initProcessDataAndWriteTspLocation function
  • Adds deprecation warnings for package-dir usage to encourage migration
  • Updates test configurations and adds new test cases for legacy package directory resolution

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/tsp-client/src/commands.ts Major refactoring to support emitter-output-dir, consolidates init logic into shared function, adds deprecation warnings
tools/tsp-client/src/typespec.ts Updates compilation function to handle new output directory configuration and return structured result object
tools/tsp-client/test/commands.spec.ts Adds new test cases for legacy package directory resolution and updates existing tests
tools/tsp-client/test/examples/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml Updates configuration to use emitter-output-dir instead of package-dir
tools/tsp-client/test/examples/specification/contosowidgetmanager-legacy-package-dir/ Adds new test specification files demonstrating legacy package-dir usage
tools/tsp-client/src/utils.ts Minor comment improvement for clarity
tools/tsp-client/package.json Version bump to 0.28.0
tools/tsp-client/CHANGELOG.md Documents new features and deprecation notice
Files not reviewed (1)
  • tools/tsp-client/package-lock.json: Language not supported

@catalinaperalta
Copy link
Member Author

/check-enforcer override

@jsquire jsquire merged commit 14ddd21 into main Aug 14, 2025
5 checks passed
@jsquire jsquire deleted the emitter-output-dir branch August 14, 2025 01:01
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.

tsp-client should attempt to reuse emitter-output-dir rather than package-dir

6 participants