From 93d8a28d509142bd274c88bfd2c51c6073feb01d Mon Sep 17 00:00:00 2001 From: jolov Date: Wed, 3 Sep 2025 19:30:58 -0700 Subject: [PATCH] Upgrade to version of generator with perf logging --- codegen/generator/src/OpenAI.Library.Plugin.csproj | 2 +- .../src/Visitors/ExperimentalAttributeVisitor.cs | 4 ++-- codegen/package.json | 2 +- package-lock.json | 8 ++++---- scripts/Invoke-CodeGen.ps1 | 9 ++++++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/codegen/generator/src/OpenAI.Library.Plugin.csproj b/codegen/generator/src/OpenAI.Library.Plugin.csproj index 27dd54f84..97bf3bd17 100644 --- a/codegen/generator/src/OpenAI.Library.Plugin.csproj +++ b/codegen/generator/src/OpenAI.Library.Plugin.csproj @@ -8,7 +8,7 @@ - + diff --git a/codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs b/codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs index a0c5fbe16..8b095979b 100644 --- a/codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs +++ b/codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs @@ -664,8 +664,8 @@ public class ExperimentalAttributeVisitor : ScmLibraryVisitor if (!_stableMethods.Contains(lookupName)) { - methodProvider.Update( - attributes: [.. methodProvider.Attributes, + methodProvider.Signature.Update( + attributes: [.. methodProvider.Signature.Attributes, methodProvider.EnclosingType.Type.Namespace.StartsWith(_realtimeNamespace) || (methodProvider.Signature.ReturnType?.Namespace.StartsWith(_realtimeNamespace) ?? false) ? _experimental002Attribute : _experimental001Attribute]); diff --git a/codegen/package.json b/codegen/package.json index f3e6a5b64..dd68766ba 100644 --- a/codegen/package.json +++ b/codegen/package.json @@ -31,7 +31,7 @@ "@open-ai/plugin": "file:", "@azure-tools/typespec-client-generator-core": "0.59.0", "@azure-tools/typespec-azure-core": "0.59.0", - "@typespec/http-client-csharp": "1.0.0-alpha.20250829.4", + "@typespec/http-client-csharp": "1.0.0-alpha.20250903.1", "@typespec/http": "1.3.0", "@typespec/openapi": "1.3.0" }, diff --git a/package-lock.json b/package-lock.json index 627915e70..1b2fd17fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@azure-tools/typespec-client-generator-core": "0.59.0", "@open-ai/plugin": "file:", "@typespec/http": "1.3.0", - "@typespec/http-client-csharp": "1.0.0-alpha.20250829.4", + "@typespec/http-client-csharp": "1.0.0-alpha.20250903.1", "@typespec/openapi": "1.3.0" }, "devDependencies": { @@ -1531,9 +1531,9 @@ } }, "node_modules/@typespec/http-client-csharp": { - "version": "1.0.0-alpha.20250829.4", - "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-1.0.0-alpha.20250829.4.tgz", - "integrity": "sha512-SxOwdLrI5sJ4dPC3j0jLn5DQHQg0g4qm5q4cZCsLMzHbT1Jiio5Z8kDZWlx9UrhfGeNaJ53WWHcccXKowlFw/A==", + "version": "1.0.0-alpha.20250903.1", + "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-1.0.0-alpha.20250903.1.tgz", + "integrity": "sha512-W3vbpxUhVJYBSoYPE4seMsDp/nvcqEwxsuYjVxBWMDliOOtO8ED05PYLvY5N4h+vKF2j30iT2d23NqpPo2qxeA==", "license": "MIT", "peerDependencies": { "@azure-tools/typespec-azure-core": ">=0.59.0 <0.60.0 || ~0.60.0-0", diff --git a/scripts/Invoke-CodeGen.ps1 b/scripts/Invoke-CodeGen.ps1 index 166961817..83fb5108a 100644 --- a/scripts/Invoke-CodeGen.ps1 +++ b/scripts/Invoke-CodeGen.ps1 @@ -269,10 +269,17 @@ Push-Location $repoRootPath try { Invoke-ScriptWithLogging { npm ci } + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + Invoke-ScriptWithLogging { npm run build -w $codegenFolderPath } + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } Set-Location $specificationFolderPath - Invoke-ScriptWithLogging { npm exec --no -- tsp compile . } + Invoke-ScriptWithLogging { npx tsp compile . --trace @typespec/http-client-csharp } } finally { Pop-Location