Skip to content

Conversation

@tjprescott
Copy link
Member

@tjprescott tjprescott commented Jan 8, 2026

Closes Azure/azure-sdk-tools#13302

Here's an example output:

emitterVersion: 0.1.0
generatedAt: 2026-01-16T20:02:03.538Z
typespec:
  namespace: Storage.Blob
  type: data
languages:
  python:
    emitterName: "@azure-tools/typespec-python"
    packageName: azure-storage-blob
    namespace: azure.storage.blob
    outputDir: "{output-dir}/sdk/storage/azure-storage-blob"
    flavor: azure
    serviceDir: sdk/storage
  csharp:
    emitterName: "@azure-tools/typespec-csharp"
    packageName: Azure.Storage.Blob
    namespace: Azure.Storage.Blob
    outputDir: "{output-dir}/sdk/storage/Azure.Storage.Blob"
    flavor: azure
    serviceDir: sdk/storage
  typescript:
    emitterName: "@azure-tools/typespec-ts"
    packageName: "@azure-rest/azure-storage-blob"
    namespace: "@azure-rest/azure-storage-blob"
    outputDir: "{output-dir}/sdk/storage/azure-storage-blob-rest"
    flavor: azure
    serviceDir: sdk/storage
  java:
    emitterName: "@azure-tools/typespec-java"
    packageName: azure-storage-blob
    namespace: com.azure.storage.blob
    outputDir: "{output-dir}/sdk/storage/azure-storage-blob"
    flavor: azure
    serviceDir: sdk/storage
  rust:
    emitterName: "@azure-tools/typespec-rust"
    packageName: azure_storage_blob
    namespace: azure_storage_blob
    outputDir: "{output-dir}/sdk/storage/azure_storage_blob"
    flavor: azure
    serviceDir: sdk/storage
sourceConfigPath: C:/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/tspconfig.yaml

@tjprescott tjprescott requested a review from weshaggard January 8, 2026 18:58
@azure-sdk
Copy link
Collaborator

azure-sdk commented Jan 8, 2026

All changed packages have been documented.

  • @azure-tools/typespec-metadata
Show changes

@azure-tools/typespec-metadata - feature ✏️

Initial creation of typespec-metadata emitter.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 8, 2026

Open in StackBlitz

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-metadata@3734

commit: 198d93e

@azure-sdk
Copy link
Collaborator

azure-sdk commented Jan 8, 2026

You can try these changes here

🛝 Playground 🌐 Website

@tjprescott tjprescott force-pushed the typespecMetadata branch 2 times, most recently from 117fbad to badc240 Compare January 8, 2026 22:14
const includedEmitters = [
"@azure-tools/typespec-python",
"@azure-tools/typespec-java",
"@azure-tools/typespec-csharp",
Copy link
Member

Choose a reason for hiding this comment

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

Should we use a naming pattern instead of a hard-coded list? This already doesn't look complete as I know we have newer emitters for csharp.

Copy link
Member Author

Choose a reason for hiding this comment

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

I figured an include list made more sense than an exclude list. Otherwise it will collect information for any emitters in tsp-config including ones we don't care (or possibly know) about.

Copy link
Member

Choose a reason for hiding this comment

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

Does it hurt to collect for all emitters as long as the properties match the pattern we are looking for?

Copy link
Member Author

Choose a reason for hiding this comment

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

Arguably no, but if it's filled with weird random stuff, I figured it would be confusing for consumers.

* Rust-specific metadata parser.
* Uses crate-name as the primary identifier.
*/
function parseRust(
Copy link
Member

Choose a reason for hiding this comment

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

Is there a good way to share these with the language specific emitter? So, both are in-sync?

Copy link
Member Author

Choose a reason for hiding this comment

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

The emitters aren't libraries, so AFAIK no, but we could centralize the logic in TCGC, which is the library those emitters depend on (though obviously not for this logic or it would already be there). I'm not sure the added complexity makes sense since any external tool that wants this info would go through this emitter anyhow, so this becomes the single point of reference. I'm also not sure TCGC would welcome language-specific logic in it, since it's purpose is (AFAIK) to provide language agnostic library support.

But if there was any other place this logic should go, it's there.

@tjprescott tjprescott marked this pull request as ready for review January 16, 2026 20:00
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.

Script to parse package metadata from tspconfig.yaml URLs

4 participants