Skip to content

Validate ruby target in jsii.targets #2667

Description

@omarqureshi

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions