Skip to content

[Discussion] SDK emitters, emitter options for package name/version #5758

Open
@weidongxu-microsoft

Description

@weidongxu-microsoft

Context

  • Package information (like package name/version) typically appear in package config file (e.g. pom.xml in Java, setup.py in Python, .csproj in .NET)
  • Though it could also appear in code, e.g. code setting the "UserAgent" header.
  • For Azure SDK, the package-name typically follows a pattern, and it may not need to be specified for typespec (e.g. it may be inferred from namespace)

For Azure, current options are

Question

Do we want to have consistent emitter options for this package information?

If we don't want to do this, we can tell user that "emitter generate the package config file, feel free to modify it as you see fit".
But this won't work for the info in code (if there is such code).

Candidate options, if we want to have a consistent emitter options

If we do a consistent solution, maybe we do like JS (however, typical emitter option is kebab casing, e.g. package-details).

One advantage is that emitter can have slightly different sub property. E.g. Java would use a group-id for the config of Maven "groupId".

  package-details:
    group-id: ..
    name: ..
    version: ..

Note that there be a current limitation on typespec compiler, that command line --option does not work on the sub property e.g. "@typespec/http-client-javascript.packageDetails.name=<name>"

Metadata

Metadata

Assignees

No one assigned

    Labels

    emitter:client:javaIssue for the Java client emitter: @typespec/http-client-java

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions