ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
137 stars 58 forks source link

Introduce Ballerina connector templates #6745

Closed NipunaRanasinghe closed 2 months ago

NipunaRanasinghe commented 2 months ago

Description:

This proposal aims to introduce a new set of Ballerina connector templates to simplify and streamline the initialization process for new Ballerina connector library modules.

The primary focus of this effort is to create templates for the generated Ballerina connectors. However, the same approach can be extended to include templates for other library module types (e.g., handwritten connectors, stdlibs) in the future.

Each template will consist of workflow files, Gradle scripts, and documentation templates.

Objectives:

Action Items:

ayeshLK commented 2 months ago

@NipunaRanasinghe Maheshika has a template for Ballerina standard library projects (but it does not have the specific package structure and all), is it possible to improve that template into a connector/library template which package structure ?

Create a repository to house connector templates (and also any other library templates, if needed).

For this I think we might not need a repository itself, we could add this template into the ballerina-library repository (inside a directory called templates or library-templates) and use that.

ThisaruGuruge commented 2 months ago

@NipunaRanasinghe Maheshika has a template for Ballerina standard library projects (but it does not have the specific package structure and all), is it possible to improve that template into a connector/library template which package structure ?

I think we have considered this option and selected the other option due to some limitations in GitHub templates. GitHub templates aren't actually templates, it seems :)

For this I think we might not need a repository itself, we could add this template into the ballerina-library repository (inside a directory called templates or library-templates) and use that.

+1

NipunaRanasinghe commented 2 months ago

@NipunaRanasinghe Maheshika has a template for Ballerina standard library projects (but it does not have the specific package structure and all), is it possible to improve that template into a connector/library template which package structure ?

As Thisaru already mentioned, we have evaluated the GitHub template repository option, but they still do not support variables (as discussed here). This is one reason we have chosen our current approach.

Additionally, the proposed approach will be more scalable because I anticipate the number of templates to continue growing over time (For example, we will need to maintain special templates for S4HANA-generated connectors even though they fall under generated connectors). Therefore, having control over these templates on our side would be the better option, IMO.

For this I think we might not need a repository itself, we could add this template into the ballerina-library repository (inside a directory called templates or library-templates) and use that.

yes that makes sense. +1