CircleCI-Public / circleci-config-sdk-ts

Generate CircleCI Configuration YAML from JavaScript or TypeScript. Use Dynamic Configuration and the Config SDK together for live generative config.
https://circleci-public.github.io/circleci-config-sdk-ts/
Apache License 2.0
82 stars 29 forks source link

Feature: Multi-language support via aws/jsii #51

Open KyleTryon opened 3 years ago

KyleTryon commented 3 years ago

Enable support to utilize the CircleCI Config SDK with multiple target languages beyond TypeScript and JavaScript by utilizing aws/jsii.

Language Support

JSII build support is targeted for the 1.0.0 release of the CircleCI Config SDK. Language support is dependant on the current availability in the library.

Language Version
TypeScript 1.0.0
JavaScript 1.0.0
Python 1.0.0
Java 1.0.0
C# 1.0.0
Kotlin TBD
Go TBD

(https://aws.github.io/jsii/overview/features/#target-languages)

🚨 Blocking Issue 🚨

Current patterns utilized in the Config SDK which are appropriate for TypeScript are not available in the JSII build system due to compatibility with .NET Core 3.1.

In the current design, Components are extended from an abstract class where a generate() function is defined. This function will return the JSON schema of the component. Components such as jobs, commands, executors and workflows all extend Component, but each carry more specific definitions for their generate() function. This overriding of type of the generate() command is allowed in TypeScript as long as the types overlap, however in JSII this functionality is not available.

Issues on aws/jsii

Alternative Solutions:

An alternative design pattern must be considered to resolve the issue described above, allowing the use of JSII, without losing type defintions.