Validate ruby target in jsii.targets
- Dominant language
- TypeScript
- Stars
- 50
- Forks
- 26
- Avg merge
- 7h 10m
- Merged PRs (30d)
- 37
Description
## Description
As part of adding Ruby as a jsii language ([RFC: aws/aws-cdk-rfcs#935](https://github.com/aws/aws-cdk-rfcs/issues/935); jsii tracking issue: [aws/jsii#5129](https://github.com/aws/jsii/issues/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:
```json
{
"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](https://github.com/aws/jsii/pull/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
- RFC (umbrella tracking): aws/aws-cdk-rfcs#935
- jsii tracking issue: aws/jsii#5129
- Implementing PR: #2663
- Downstream runtime + pacmak target: aws/jsii#5178
Contributor guide
Research direction
Start with test/project-info.test.ts and compare the existing java, python, dotnet, and go target cases. Trace the target typing and validateTargets behavior those tests exercise, then confirm completion with valid Ruby metadata, nested module namespaces, and rejection of unknown keys or invalid module names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100