Skip to content

Commit 2cdbfb4

Browse files
tjprescottcperaltahcatalinaperalta
authored
Refactor tsp-client to use yargs (#8607)
* Refactoring. * More refactoring. * [tsp-client] Fixes for yargs update + more testing (#8758) * refactor commands * add test files * add sync tests * rename test file * clean up test * fix update command tsp-location.yaml logic * add update tests * init fix and test --------- Co-authored-by: Catalina Peralta <caperal@microsoft.com> * Add "npm run purge" script * Fix command invocation. * Update tspconfig.json * Fix issue with `--no-prompt` * revert extra -- * update package-lock.json * init fixes * sync commands with upstream and update * update generateLockFileCommand * add back sort-swagger command * add generate lock file test * docs updates --------- Co-authored-by: Catalina Peralta <caperal@microsoft.com> Co-authored-by: catalinaperalta <catalinaperaltah@hotmail.com>
1 parent dcea849 commit 2cdbfb4

24 files changed

Lines changed: 1347 additions & 829 deletions

File tree

tools/tsp-client/.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

tools/tsp-client/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release
22

3+
## Unreleased - 0.11.0
4+
5+
- Added `generate-lock-file` command, see [README](https://github.com/Azure/azure-sdk-tools/blob/main/tools/tsp-client/README.md) for more information.
6+
- Removed the `--generate-lock-file` flag and replaced it with the command above.
7+
- Migrated tsp-client from `node:util` to `yargs` for commandline infrastructure.
8+
39
## 2024-08-05 - 0.10.0
410

511
- Added `sort-swagger` command, see [README](https://github.com/Azure/azure-sdk-tools/blob/main/tools/tsp-client/README.md) for more information.

tools/tsp-client/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@ Convert an existing swagger specification to a TypeSpec project. This command sh
4848
### sort-swagger
4949
Sort an existing swagger specification to be the same content order with TypeSpec generated swagger. This will allow you to easily compare and identify differences between the existing swagger and TypeSpec generated one. You should run this command on existing swagger files and check them in prior to creating converted TypeSpec PRs.
5050

51+
### generate-lock-file
52+
53+
Generate an emitter-package-lock.json under the eng/ directory based on existing `<repo-root>/eng/emitter-package.json`.
54+
5155
## Options
5256
```
5357
--arm Convert ARM swagger specification to TypeSpec [boolean]
5458
-c, --tsp-config The tspconfig.yaml file to use [string]
5559
--commit Commit to be used for project init or update [string]
5660
-d, --debug Enable debug logging [boolean]
5761
--emitter-options The options to pass to the emitter [string]
58-
--generate-lock-file Generate a lock file under the eng/ directory from
59-
an existing emitter-package.json [boolean]
6062
-h, --help Show help [boolean]
6163
--local-spec-repo Path to local repository with the TypeSpec project [string]
6264
--no-prompt Skip prompting for output directory confirmation [boolean]

0 commit comments

Comments
 (0)