Skip to content

Install cdktf-cli as part of TS template instead of relying on global installation #2488

Open
@acdoussan

Description

@acdoussan

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently, the docs (and default project template after running cdktf init) require cdktf-cli to be installed globally. This defeats the purpose of npm's package management, where every project contains all its dependencies and can be repeatably built in different environments.

Currently, if there is a breaking change to the way cdktf-cli works, and I create a new template, but also have to work with an existing template, I would have to uninstall / reinstall cdktf-cli each time I want to switch which package I am working on, or manually add cdktf-cli as a dependency for each project, and uninstall it globally.

I am proposing two changes:

  • Update the docs to use npx rather than instructing users to install cdktf-cli globally
    • See references for what it takes to make this work, but this should look something like npx create-react-app but for cdktf. So, for example, npx cdktf-init
  • Update the project template from cdktf init to depend on cdktf-cli directly in its dependencies.

This should be pretty straightforward, but requires a new repository / published npm package that y'all should create.

References

https://blog.deepgram.com/npx-script/

Metadata

Metadata

Assignees

No one assigned

    Labels

    cdktf-clienhancementNew feature or requestpriority/important-longtermMedium priority, to be worked on within the following 1-2 business quarters.size/smallestimated < 1 day

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions