Description
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
- Java, none
- .NET,
library-name
- Python,
package-name
- JS,
packageDetails
with propertyname
,version
,description
(this option also applies to unbranded)
https://github.com/microsoft/typespec/blob/469c96a00df3a37b1f0c51c729647b1f47735a85/website/src/content/docs/docs/emitters/sdk-clients/introduction.md#packagedetails
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>"