Skip to content

Generate metadata.json for Azure services#3169

Merged
MaryGao merged 19 commits intoAzure:mainfrom
v-jiaodi:generate-metadatajson
May 22, 2025
Merged

Generate metadata.json for Azure services#3169
MaryGao merged 19 commits intoAzure:mainfrom
v-jiaodi:generate-metadatajson

Conversation

@v-jiaodi
Copy link
Copy Markdown
Member

fixes #3005

@v-jiaodi v-jiaodi changed the title Generate metadata.json for enable azureSdkForJs Generate metadata.json for azureSdkForJs is true Apr 18, 2025
Comment thread packages/typespec-ts/src/index.ts Outdated
@MaryGao MaryGao changed the title Generate metadata.json for azureSdkForJs is true Generate metadata.json for Azure services May 16, 2025
@MaryGao MaryGao marked this pull request as ready for review May 20, 2025 05:03
@MaryGao MaryGao requested review from joheredi and qiaozha as code owners May 20, 2025 05:03
Comment thread packages/typespec-ts/src/index.ts Outdated
Comment thread packages/typespec-ts/src/index.ts Outdated
Comment thread packages/typespec-ts/src/index.ts
Comment thread packages/typespec-ts/src/index.ts Outdated
Comment thread packages/typespec-ts/src/index.ts Outdated
Comment thread packages/typespec-ts/src/index.ts Outdated
Comment thread packages/typespec-ts/src/index.ts Outdated
Comment thread packages/typespec-ts/src/index.ts Outdated
Comment thread packages/typespec-ts/src/lib.ts Outdated
Comment thread packages/typespec-ts/src/index.ts Outdated
@MaryGao MaryGao requested a review from Copilot May 22, 2025 01:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds metadata.json generation for Azure-flavored services by extracting the API and emitter versions and emitting the file alongside other outputs.

  • Introduces getTypespecTsVersion to fetch the Typespec-TS emitter version
  • Defines buildMetadataJson to create a metadata.json with apiVersion and/or emitterVersion
  • Emits the metadata.json file in the Azure flavor path
Comments suppressed due to low confidence (2)

packages/typespec-ts/src/index.ts:364

  • There are no unit tests covering the new buildMetadataJson logic. Consider adding tests to verify correct JSON output when apiVersion and/or emitterVersion are present or absent.
function buildMetadataJson() {

packages/typespec-ts/src/index.ts:503

  • The buildMetadataJson builder is invoked twice for Azure flavor—once inside generateMetadataAndTest and again after it. Removing the redundant call will prevent duplicate file emissions or overwrites.
if (isAzureFlavor) {

Comment thread packages/typespec-ts/src/index.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MaryGao MaryGao enabled auto-merge (squash) May 22, 2025 01:40
@MaryGao MaryGao merged commit 26cfab2 into Azure:main May 22, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate A Output File To Store Useful Information That Utilized By JS SDK Release Tool

3 participants