Why does the typescript aws-cdk init-template include its app in the bin directory and as a binary in package.json?

Viewed 598

In the aws-cdk init-template for typescript, the template creates content in the bin directory and links it to the bin property of package.json.

I'd like to understand why.

I'm confused because the bin directory content has the default cdk app for the project, but it doesn't seem like an executable file on its own since it would usually be used inside the context of a cdk command like the one in the template's cdk.json

Is there a use case for node's symlinking behavior that I'm not seeing?

[edit: clarifying]

This isn't causing an issue other than my understanding of the intent and whether there is some use case inside the aws-cdk tooling for having the bin symlinking behavior (so I don't break that use case while modifying the project).

1 Answers

I think it is meant to signal to the developer the intent of the files.

The CDK App is what you execute to provision on environment, so it goes into the bin.

The lib contains a library of stacks/components that are used by the App.

Related