Skip to content

Commit 5561926

Browse files
azure-sdkcperaltahraych1mikeharder
authored
Sync eng/common directory with azure-sdk-tools for PR 12060 (#3026)
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#12060 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: catalinaperalta <[email protected]> Co-authored-by: ray chen <[email protected]> Co-authored-by: Mike Harder <[email protected]>
1 parent 966280c commit 5561926

File tree

3 files changed

+2374
-0
lines changed

3 files changed

+2374
-0
lines changed

eng/common/tsp-client/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# TypeSpec Client Generator CLI
2+
3+
This directory contains npm package definitions for `@azure-tools/typespec-client-generator-cli` (tsp-client) with pinned versions to ensure reproducible builds across environments.
4+
5+
## Files
6+
7+
- **`package.json`** - npm package definition with pinned tsp-client version
8+
- **`package-lock.json`** - Lock file ensuring exact dependency versions
9+
10+
## Prerequisites
11+
12+
- **Node.js** (with npm) - Required to install and run tsp-client
13+
14+
## Installation
15+
16+
### Install dependencies
17+
18+
```bash
19+
# Navigate to this directory
20+
cd eng/common/tsp-client
21+
22+
# Install dependencies
23+
npm ci
24+
25+
## Usage
26+
27+
After installation, you can run tsp-client by navigating to the directory and using npm exec:
28+
29+
```bash
30+
cd eng/common/tsp-client
31+
32+
# Get help
33+
npm exec --no -- tsp-client --help
34+
35+
# Check version
36+
npm exec --no -- tsp-client version
37+
38+
# Generate client code
39+
npm exec --no -- tsp-client generate --output-dir ./generated
40+
41+
# Initialize a new project
42+
npm exec --no -- tsp-client init --tsp-config ./tspconfig.yaml
43+
```
44+
45+
## CI/CD Best Practices
46+
47+
```bash
48+
cd eng/common/tsp-client
49+
npm ci
50+
npm exec --no -- tsp-client init --update-if-exists --tsp-config https://github.com/Azure/azure-rest-api-specs/blob/dee71463cbde1d416c47cf544e34f7966a94ddcb/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml
51+
```
52+
53+
## Package Management
54+
55+
### Automatic Updates via Dependabot
56+
57+
Dependabot is configured to automatically check for updates to `@azure-tools/typespec-client-generator-cli` daily and create pull requests with updated `package.json` and `package-lock.json` files. This ensures the package stays current with the latest versions while maintaining security through the PR review process.
58+
59+
### Manual Version Updates
60+
61+
If you need to manually update the tsp-client version:
62+
63+
1. Edit `package.json` to update the version:
64+
65+
```json
66+
{
67+
"dependencies": {
68+
"@azure-tools/typespec-client-generator-cli": "0.8.0"
69+
}
70+
}
71+
```
72+
73+
2. Update the lock file:
74+
75+
```bash
76+
npm install
77+
```
78+
79+
3. Commit both `package.json` and `package-lock.json`

0 commit comments

Comments
 (0)