Skip to content

feat(cli)!: rename --cdktf-version in init#228

Open
gabegorelick wants to merge 1 commit into
open-constructs:mainfrom
gabegorelick:init-cdktn-version
Open

feat(cli)!: rename --cdktf-version in init#228
gabegorelick wants to merge 1 commit into
open-constructs:mainfrom
gabegorelick:init-cdktn-version

Conversation

@gabegorelick
Copy link
Copy Markdown
Contributor

@gabegorelick gabegorelick commented May 31, 2026

The init CLI command currently accepts a --cdktf-version option. This change renames it to --cdktn-version.

Related issue

Fixes #

Description

cdktn init --cdktf-version -> cdktn init --cdktn-version

This is a breaking change, but should hopefully not be too disruptive.

Checklist

  • I have updated the PR title to match CDKTN's style guide
  • I have run the linter on my code locally
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation if applicable
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works if applicable
  • New and existing unit tests pass locally with my changes

The `init` CLI command currently accepts a `--cdktf-version` option.
This change renames it to `--cdktn-version`.
Comment thread packages/@cdktn/cli-core/src/lib/init.ts
@gabegorelick gabegorelick marked this pull request as ready for review June 1, 2026 01:49
@gabegorelick gabegorelick requested a review from a team as a code owner June 1, 2026 01:49
Copy link
Copy Markdown
Contributor

@jsteinich jsteinich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also prep a PR on https://github.com/open-constructs/cdk-terrain-docs about the change?

Likely going to hold this a bit since I think we'll have at least one more release before introducing breaking changes.

Comment on lines +371 to +374
if (
argv.fromTerraformProject &&
[".", process.cwd()].includes(argv.fromTerraformProject)
) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this now ignore having an empty string set for fromTerraformProject while previously it would have errored?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "" case was included in the .includes before, but it's now covered in the argv.fromTerraformProject conditional. The latter is needed for Typescript to discern that that field is defined.

@gabegorelick
Copy link
Copy Markdown
Contributor Author

Can you also prep a PR on https://github.com/open-constructs/cdk-terrain-docs about the change?

open-constructs/cdk-terrain-docs#13

Side note, it would be nice if the docs were merged into this repo so we didn't have split commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants