Description
As part of adding Ruby as a jsii language (RFC: aws/aws-cdk-rfcs#935; jsii tracking issue: aws/jsii#5129), the compiler needs to recognise and validate a ruby block under jsii.targets in package.json — exactly as it already does for java, python, dotnet and go.
Today, a package that declares:
{
"jsii": {
"targets": {
"ruby": { "gem": "aws-cdk-lib", "module": "AWSCDK", "acronyms": ["AWS", "S3"] }
}
}
}
is not understood by the compiler: the ruby key isn't in the target type or the validateTargets allow-list, so the configuration is neither typed nor checked. Library authors can't declare Ruby packaging metadata, which blocks the downstream jsii-pacmak Ruby target (aws/jsii#5178) from generating gems.
Scope & safety
- Strictly additive. No existing target's behaviour changes; assemblies without a
ruby target are entirely unaffected.
- Assembly format unchanged.
jsii.targets is already an open map ([otherLanguage: string]: unknown); this only adds typing and validation for a key that was previously passed through untyped. Existing .jsii assemblies need no recompilation.
- Follows the established convention for adding a language target's metadata schema, so it's reviewable against the
java/python/go precedent.
- Covered by unit tests in
test/project-info.test.ts (valid config, nested module namespaces, and rejection of unknown keys / invalid module names).
References
Description
As part of adding Ruby as a jsii language (RFC: aws/aws-cdk-rfcs#935; jsii tracking issue: aws/jsii#5129), the compiler needs to recognise and validate a
rubyblock underjsii.targetsinpackage.json— exactly as it already does forjava,python,dotnetandgo.Today, a package that declares:
{ "jsii": { "targets": { "ruby": { "gem": "aws-cdk-lib", "module": "AWSCDK", "acronyms": ["AWS", "S3"] } } } }is not understood by the compiler: the
rubykey isn't in the target type or thevalidateTargetsallow-list, so the configuration is neither typed nor checked. Library authors can't declare Ruby packaging metadata, which blocks the downstreamjsii-pacmakRuby target (aws/jsii#5178) from generating gems.Scope & safety
rubytarget are entirely unaffected.jsii.targetsis already an open map ([otherLanguage: string]: unknown); this only adds typing and validation for a key that was previously passed through untyped. Existing.jsiiassemblies need no recompilation.java/python/goprecedent.test/project-info.test.ts(valid config, nested module namespaces, and rejection of unknown keys / invalid module names).References