Closed lmazuel closed 10 months ago
cc @raych1 @m-nash
Spec:
tsp-client sync
tsp-client sync # No parameters, means look for tsp-location.yaml here
tsp-client sync project_folder # Use that project folder to look for tsp-location.yaml and do the job
tsp-client sync project_folder --typespec-folder typespec_folder # Use that project folder to look for tsp-location.yaml and do the job
tsp-client generate
tsp-client generate # No parameters, means look for the temp folder
tsp-client generate project_folder # Use that project folder to look for the temp folder
tsp-client generate project_folder --typespec-additional-options=option1=value1;option2=value2
tsp-client generate project_folder --save-inputs
tsp-client init
(this is the Process powershell script)# This has to be run from the azure-sdk-for-language root cloned on a machine.
# This creates a project from a url
tsp-client init https://github.com/Azure/azure-rest-api-specs/blob/677e272f33a3eaa724abd769af79383a5ac2bba5/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml
# This creates a project from a folder with SHA and repo. If folder, SHA and repo are required.
tsp-client init ./specification/contosowidgetmanager/Contoso.WidgetManager 677e272f33a3eaa724abd769af79383a5ac2bba5 https://github.com/Azure/azure-rest-api-specs
# Keep flag --skip-sync-and-generate
# Also run sync and generate
tsp-client update
# This one can be run from the project folder directly. The logic is otherwise plugged to the same as init on principle
# Sync and generate asusming the tsp-location.yaml is here
tsp-client update
# Sync and generate assuming the tsp-location.yaml is in project_folder
tsp-client update project_folder
# Update tsp-location.yaml from a SHA as input + sync + generate
tsp-client update --sha=677e272f33a3eaa724abd769af79383a5ac2bba5
# Update tsp-location.yaml from a url + sync + generate
tsp-client update --commit-url=https://github.com/Azure/azure-rest-api-specs/blob/677e272f33a3eaa724abd769af79383a5ac2bba5/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml
# Update tsp-location.yaml from a SHA/repo as input + sync + generate
tsp-client update --sha=677e272f33a3eaa724abd769af79383a5ac2bba5 --repo=https://github.com/Azure/azure-rest-api-specs
# Also run sync and generate
There is a need to facilitate client library generation from TypeSpec into various language repositories.
We currently use the Sync, Generate, and Process Powershell scripts to facilitate this process. We would like to remove the dependency on Powershell and add a tool for TypeSpec users that is intuitive and exists in the same ecosystem.
Add a client
command to the tsp
cli.
tsp
release cycle.Expose the tsp-client
tool with a npx
script through tsp client
.
Publish the @<namespace tbd>/tsp-client
tool and have this be the recommended option to create and generate client libraries.
tsp
cli and versions independently.Closing as the initial package was released: https://www.npmjs.com/package/@azure-tools/typespec-client-generator-cli
Replace the three powershell scripts with a typescript CLI called "tsp-client". The story should:
tsp-client sync
is doing the job of TypeSpec-Project-Sync.ps1tsp-client generate
is doing the job of TypeSpec-Project-Generate.ps1tsp-client process
is doing the job of TypeSpec-Project-Process.ps1See https://github.com/Azure/azure-sdk-tools/blob/main/doc/common/TypeSpec-Project-Scripts.md for details.
Project has been started by @xirzec , and will be continued by @catalinaperalta
Step 1 is to re-implement this with the same features, to simplify adoption. Step 2 may be to add more convenient commands as needed as the project evolved.
CC @weshaggard