Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tsp-client] Miscellaneous fixes #8825

Merged
merged 6 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/tsp-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- Fix `--version` flag. (#8814)
- Added `compare` command to compare a hand-authored Swagger to a TypeSpec-generated Swagger to understand the relevant differences between them.
- Floating `@azure-tools/typespec-autorest` dependency from `>=0.44.0 <1.0.0`.
- Bump `@autorest/openapi-to-typespec` dependency to `0.9.0`.

## 2024-08-08 - 0.11.1

Expand Down
2 changes: 1 addition & 1 deletion tools/tsp-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/tsp-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"dependencies": {
"@autorest/csharp": "https://aka.ms/azsdk/openapi-to-typespec-csharp",
"@autorest/openapi-to-typespec": "0.9.0",
"@azure-tools/typespec-autorest": "^0.44.0",
"@azure-tools/typespec-autorest": ">=0.44.0 <1.0.0",
"@azure/core-rest-pipeline": "^1.12.0",
"@azure-tools/rest-api-diff": "^0.1.0",
"@types/yargs": "^17.0.32",
Expand Down
7 changes: 4 additions & 3 deletions tools/tsp-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import { dirname } from "path";

const __dirname = dirname(fileURLToPath(import.meta.url));

const { version } = JSON.parse(await readFile(joinPaths(__dirname, "..", "package.json"), "utf8"));
const packageJson = JSON.parse(await readFile(joinPaths(__dirname, "..", "package.json"), "utf8"));

function commandPreamble(argv: any) {
checkDebugLogging(argv);
printBanner();
yargs().showVersion();
Logger.info(packageJson.version);
}

/** Ensure the output directory exists and allow interactive users to confirm or override the value. */
Expand Down Expand Up @@ -57,7 +57,7 @@ export function resolveOutputDir(argv: any): string {
}

const parser = yargs(hideBin(process.argv))
.version(version)
.version(packageJson.version)
.alias("v", "version")
.scriptName("")
.usage(usageText)
Expand Down Expand Up @@ -225,6 +225,7 @@ const parser = yargs(hideBin(process.argv))
});
},
async (argv: any) => {
commandPreamble(argv);
await sortSwaggerCommand(argv);
},
)
Expand Down