Skip to content

Commit aeca529

Browse files
update readme (#7746)
Co-authored-by: Catalina Peralta <caperal@microsoft.com>
1 parent c7004b8 commit aeca529

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

tools/tsp-client/README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ use it to look for relevant configuration files. To specify a different output d
2525
the `-o` or `--output-dir` option.
2626

2727
### init
28-
Initialize the SDK project folder from a tspconfig.yaml. When using this command pass in a path to a local or remote tspconfig.yaml, using the `-c` or `--tsp-config` flag.
28+
Initialize the client library directory using a tspconfig.yaml. When running this command pass in a path to a local or remote tspconfig.yaml with the `-c` or `--tsp-config` flag.
2929

30-
The command generates the appropriate SDK folder in the repository, creates a [tsp-location.yaml](#tsp-locationyaml) file to control generation, and performs an initial generation of the client library. If you want to skip client library generation, then pass the `--skip-sync-and-generate` flag.
30+
The `init` command generates a directory structure following the standard pattern used across Azure SDK language repositories, creates a [tsp-location.yaml](#tsp-locationyaml) file to control generation, and performs an initial generation of the client library. If you want to skip client library generation, then pass the `--skip-sync-and-generate` flag.
31+
32+
> IMPORTANT: This command should be run from the root of the repository.
3133
3234
### update
3335
Sync and generate client libraries from a TypeSpec project. The `update` command will look for a [tsp-location.yaml](#tsp-locationyaml) file in your current directory to sync a TypeSpec project and generate a client library.
@@ -121,14 +123,12 @@ TempTypeSpecFiles/
121123

122124
## Per repository set up
123125

124-
Each repository that intends to support `tsp-client` for generating and updating client libraries will need the following configuration files:
126+
Each repository that intends to support `tsp-client` for generating and updating client libraries will need to set up an `emitter-package.json` file under the `eng/` directory at the root of the repository. Client libraries generated with this tool will be outputted based on the information in the tspconfig.yaml file of the TypeSpec specification. The service directory is specified through the `parameters.service-dir.default` parameter in the tspconfig.yaml, additionally the `package-dir` option for the specific emitter is appended to the end of the path.
125127

126-
### emitter-package-lock.json (Optional)
128+
See the following example of a valid tspconfig.yaml file: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml
127129

128-
`emitter-package-lock.json` will be used the same as a `package-lock.json`. The tool will run a clean npm installation before generating client libraries. This file allows consistent dependency trees and allows each repository to control their dependency installation.
129-
The file should be checked into this location: `<root of repo>/eng/emitter-package-lock.json`
130+
Using the tspconfig.yaml linked above, by default, the client libraries will be generated in the following directory for C#: `<repo>/sdk/contosowidgetmanager/Azure.Template.Contoso/`.
130131

131-
> NOTE: The tool will run `npm ci` to install dependencies, so ensure that the `emitter-package-lock.json` and `emitter-package.json` files both exist and are in sync with each other.
132132

133133
### emitter-package.json (Required)
134134

@@ -149,3 +149,10 @@ Example:
149149
> NOTE: tsp compile currently requires the "main" line to be there.
150150

151151
> NOTE: This file replaces the package.json checked into the `azure-rest-api-spec` repository.
152+
153+
### emitter-package-lock.json (Optional)
154+
155+
`emitter-package-lock.json` will be used the same as a `package-lock.json`. The tool will run a clean npm installation before generating client libraries. This file allows consistent dependency trees and allows each repository to control their dependency installation.
156+
The file should be checked into this location: `<root of repo>/eng/emitter-package-lock.json`
157+
158+
> NOTE: The tool will run `npm ci` to install dependencies, so ensure that the `emitter-package-lock.json` and `emitter-package.json` files both exist and are in sync with each other.

0 commit comments

Comments
 (0)