aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.61k stars 3.91k forks source link

docs: source links for v2 point to files that don't exist in the source repository #17903

Open rix0rrr opened 2 years ago

rix0rrr commented 2 years ago

What is the problem?

image

I noticed that all the TypeScript github source links in the docs are not going to the correct destination. Example: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.EcsDeploymentGroup.html has https://github.com/aws/aws-cdk/blob/v2.0.0/packages/aws-cdk-lib/aws-codedeploy/lib/ecs/deployment-group.ts#L42.

Cause

The reason is that these source files are generated at build time -- they never exist in the source repository, and hence cannot be linked to.

Solution

We need to strip source locations of files that don't exist in the repository. This is complicated slightly by the fact that our build can run separately from a git clone, so we need to do the following:

eladb commented 2 years ago

I am wondering if perhaps we can add some kind of an annotation to the generated file that will tell JSII that this file is generated and it will not include a source location for it. WDYT?

rix0rrr commented 2 years ago

Mmm. That is probably a better approach indeed. Good call.

Naumel commented 2 years ago

Duplicate #21813