Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sdk emitters to arm template #1977

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

maririos
Copy link
Member

Fixes: #1842

We have been working on updating and reviewing the template for SDK emitters on arm. Adding values here so people get the template when they do tsp init

@azure-sdk
Copy link
Collaborator

No changes needing a change description found.

enableOperationGroup: true
packageDetails:
name: "@azure/{{#normalizePackageName}}{{parameters.ServiceNamespace}}{{/normalizePackageName}}"
"@azure-tools/typespec-go":
Copy link
Member Author

Choose a reason for hiding this comment

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

@tadelesh could you verify?

Copy link
Member

Choose a reason for hiding this comment

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

i don't know whether normalizePackageName represent for. this config value is always from arch board review. we could not use some common placeholder for them.

clear-output-folder: true
model-namespace: false
namespace: "{package-dir}"
"@azure-tools/typespec-python":
Copy link
Member Author

Choose a reason for hiding this comment

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

@msyyc could you verify?

Copy link
Member

Choose a reason for hiding this comment

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

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 copied it from the data plane template:

package-dir: "{{#normalizePackageName}}{{parameters.ServiceNamespace}}{{/normalizePackageName}}"

What do you recommend the generic value for package-dir should be?

package-dir: "{{#normalizePackageName}}{{parameters.ServiceNamespace}}{{/normalizePackageName}}"
namespace: com.{{#toLowerCase}}{{parameters.ServiceNamespace}}{{/toLowerCase}}
service-name: "{service-name}"
"@azure-tools/typespec-ts":
Copy link
Member Author

Choose a reason for hiding this comment

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

@wanlwanl could you verify? is modular what we recommend for the template?

Copy link
Member

Choose a reason for hiding this comment

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

@maririos Yes, modular is recommended for management plane. FYI. this describe how to set default type for different planes.

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

Comment on lines +34 to +35
service-dir: "{{#normalizePackageName}}{{parameters.ServiceNamespace}}{{/normalizePackageName}}"
package-dir: "{{#normalizePackageName}}{{parameters.ServiceNamespace}}"
Copy link
Member

@tadelesh tadelesh Jan 2, 2025

Choose a reason for hiding this comment

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

Suggested change
service-dir: "{{#normalizePackageName}}{{parameters.ServiceNamespace}}{{/normalizePackageName}}"
package-dir: "{{#normalizePackageName}}{{parameters.ServiceNamespace}}"
service-dir: "sdk/resourcemanager/{{normalizePackageName}}"
package-dir: "arm{{normalizePackageName}}"

namespace: com.{{#toLowerCase}}{{parameters.ServiceNamespace}}{{/toLowerCase}}
service-name: "{service-name}"
"@azure-tools/typespec-ts":
package-dir: "{{#normalizePackageName}}{{parameters.ServiceNamespace}}{{/normalizePackageName}}"
Copy link
Member

Choose a reason for hiding this comment

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

I may lack of some contexts, will this tspconfig be handled by some tool to replace these place holder? Could you please describe it? I can't verify it since I don't know what will be generated from {{#normalizePackageName}}, {{parameters.ServiceNamespace}} and {{/normalizePackageName}}.

But I can provide the following ts's emitter options rules based on modular config sample used by js doc.
e.g. add name: contoso in parameters

package-dir: "arm-{name}"
packageDetails:
      name: "@azure/{package-dir}"

Copy link
Member

Choose a reason for hiding this comment

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

@raych1 do you know about these placeholders {{#normalizePackageName}}, {{parameters.ServiceNamespace}} and {{/normalizePackageName}}? When and how to handle the placeholders?

Copy link
Member

Choose a reason for hiding this comment

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

@maririos I am also curious about what are the scenarios behind this PR?

Copy link
Member

Choose a reason for hiding this comment

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

This is the template project which will scaffold a new project based on the selected template when run tsp init command. The purpose is to ensure the generated tspconfig.yaml by these templates have the recommended settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tsp init] Azure project should be initiated with a tspconfig file with options for client code generation
7 participants