You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/tsp-client/README.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,11 @@ use it to look for relevant configuration files. To specify a different output d
25
25
the `-o` or `--output-dir` option.
26
26
27
27
### 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.
29
29
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.
31
33
32
34
### update
33
35
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/
121
123
122
124
## Per repository set up
123
125
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.
125
127
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
127
129
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/`.
130
131
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.
132
132
133
133
### emitter-package.json (Required)
134
134
@@ -149,3 +149,10 @@ Example:
149
149
> NOTE: tsp compile currently requires the "main" line to be there.
150
150
151
151
> 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