Skip to content

jsii assemblies contain redundant dependency information #453

@rix0rrr

Description

@rix0rrr

Looking at the start of the dependency section of the @aws-cdk/app-delivery assembly, it looks like this:

  "dependencies": {
    "@aws-cdk/aws-cloudformation": {
      "dependencies": {
        "@aws-cdk/aws-iam": {
          "dependencies": {
            "@aws-cdk/cdk": {
              "dependencies": {
                "@aws-cdk/cx-api": {
                  "peer": true,
                  "targets": {
                    "dotnet": {
                      "assemblyOriginatorKeyFile": "../../key.snk",
                      "namespace": "Amazon.CDK.CXAPI",
                      "packageId": "Amazon.CDK.CXAPI",
                      "signAssembly": true
                    },
                    "java": {
                      "maven": {
                        "artifactId": "cdk-cx-api",
                        "groupId": "software.amazon.awscdk"
                      },
                      "package": "software.amazon.awscdk.cxapi"
                    },
                    "js": {
                      "npm": "@aws-cdk/cx-api"
                    },
                    "python": {
                      "distName": "aws-cdk.cx-api",
                      "module": "aws_cdk.cx_api"
                    }
                  },
                  "version": "0.28.0"
                }
              },
              "peer": true,
              "targets": {
                "dotnet": {
                  "assemblyOriginatorKeyFile": "../../key.snk",
                  "namespace": "Amazon.CDK",
                  "packageId": "Amazon.CDK",
                  "signAssembly": true
  • Why does it contain transitive dependencies?
  • Why do the dependencies have information on the targets and their build instructions (../../key.snk???) in there?

For funzies... in a package with highly complex dependencies such as @aws-cdk/app-delivery, removing the dependencies node from the assembly reduces the file size from

8.2 MB

to

18 kB (!!!!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions