jsii-srcmak icon indicating copy to clipboard operation
jsii-srcmak copied to clipboard

Dependencies are always built with exact version contraints

Open jsteinich opened this issue 5 years ago • 7 comments

Any dependencies are passed to jsii by reading the version out of the module's package.json file. This results in an exact version being required. This makes it more difficult to use the generated code with other libraries which may use a different version of the dependency.

Changing Options.dep to { [module: string]: string } would allow specifying a SemVar version for each module dependency. Could instead add a new option or union type to maintain compatibility.

jsteinich avatar Jan 02 '21 17:01 jsteinich

Do you have an example reproduction for this? And which language are you experiencing this with?

The version ranges specified in the original library should be retained...

RomainMuller avatar Feb 24 '21 12:02 RomainMuller

I've observed this in c#, but I believe it applies to all languages. The reason is https://github.com/aws/jsii-srcmak/blob/5d14a0ce15a79e578ab01d5a16c8de59bc049229/src/compile.ts#L40 which is reading directly from the installed dependency module.

Not a simple example, but you can see it happening here: https://github.com/terraform-cdk-providers/cdktf-provider-aws/blob/845d01bb9cd97c9f4fcef96a4a8744f852750d1e/package.json#L41

Source package: https://github.com/terraform-cdk-providers/cdktf-provider-project/blob/8619150f4468bfa7949344879dae5fa5431b7998/src/cdktf-config.ts#L19

jsteinich avatar Feb 24 '21 13:02 jsteinich

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

github-actions[bot] avatar Jul 04 '21 01:07 github-actions[bot]

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.

github-actions[bot] avatar Jul 11 '21 01:07 github-actions[bot]

@RomainMuller can we reopen this and remove the stale label? We're now experiencing this with the constructs package which seems to update daily now 😅 Issue tracking this on our end: https://github.com/hashicorp/terraform-cdk/issues/1410

ansgarm avatar Jan 05 '22 10:01 ansgarm

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

github-actions[bot] avatar Mar 07 '22 01:03 github-actions[bot]

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

github-actions[bot] avatar Mar 14 '22 01:03 github-actions[bot]