cdklabs / jsii-srcmak

Generate multi-language object-oriented source code from typescript
Apache License 2.0
19 stars 8 forks source link

Dependencies are always built with exact version contraints #271

Open jsteinich opened 3 years ago

jsteinich commented 3 years ago

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.

RomainMuller commented 3 years ago

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...

jsteinich commented 3 years ago

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

github-actions[bot] commented 3 years ago

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] commented 3 years ago

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

ansgarm commented 2 years ago

@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

github-actions[bot] commented 2 years ago

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] commented 2 years ago

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.