Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): improve READMEs for individual providers #369

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions src/readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ export class ReadmeFile extends FileBase {
: "";

return `
# Terraform CDK ${providerName} Provider tracks ${providerVersion}

This repo builds and publishes the Terraform ${providerName} Provider bindings for [CDK for Terraform](https://cdk.tf).
# CDKTF prebuilt bindings for ${fqpnURL} provider version ${
underlyingTerraformVersion !== "<unknown>"
? `${underlyingTerraformVersion}`
: `${providerVersion}`
}

${
underlyingTerraformVersion !== "<unknown>"
? `Is based directly on ${providerName} ${underlyingTerraformVersion}`
: ""
}
This repo builds and publishes the [Terraform ${providerName} provider](https://registry.terraform.io/providers/${fqpnURL}/${
underlyingTerraformVersion !== "<unknown>"
? underlyingTerraformVersion
: versionURL
}/docs) bindings for [CDK for Terraform](https://cdk.tf).

## Available Packages

Expand Down Expand Up @@ -118,45 +120,44 @@ You can also visit a hosted version of the documentation on [constructs.dev](htt

## Versioning

This project is explicitly not tracking the Terraform ${providerName} Provider version 1:1. In fact, it always tracks \`latest\` of \`${providerVersion}\` with every release. If there are scenarios where you explicitly have to pin your provider version, you can do so by generating the [provider constructs manually](https://cdk.tf/imports).
This project is explicitly not tracking the Terraform ${providerName} provider version 1:1. In fact, it always tracks \`latest\` of \`${providerVersion}\` with every release. If there are scenarios where you explicitly have to pin your provider version, you can do so by [generating the provider constructs manually](https://cdk.tf/imports).

These are the upstream dependencies:

- [Terraform CDK](https://cdk.tf)
- [Terraform ${providerName} Provider](https://registry.terraform.io/providers/${fqpnURL}/${
- [CDK for Terraform](https://cdk.tf)
- [Terraform ${providerName} provider](https://registry.terraform.io/providers/${fqpnURL}/${
underlyingTerraformVersion !== "<unknown>"
? underlyingTerraformVersion
: versionURL
})
- This links to the minimum version being tracked, you can find the latest released version [in our releases](https://github.com/cdktf/cdktf-provider-${providerName}/releases)
- [Terraform Engine](https://terraform.io)

If there are breaking changes (backward incompatible) in any of the above, the major version of this project will be bumped.

## Features / Issues / Bugs

Please report bugs and issues to the [terraform cdk](https://cdk.tf) project:
Please report bugs and issues to the [CDK for Terraform](https://cdk.tf) project:

- [Create bug report](https://cdk.tf/bug)
- [Create feature request](https://cdk.tf/feature)

## Contributing

### projen
### Projen

This is mostly based on [projen](https://github.com/eladb/projen), which takes care of generating the entire repository.
This is mostly based on [Projen](https://github.com/projen/projen), which takes care of generating the entire repository.

### cdktf-provider-project based on projen
### cdktf-provider-project based on Projen

There's a custom [project builder](https://github.com/hashicorp/cdktf-provider-project) which encapsulate the common settings for all \`cdktf\` providers.
There's a custom [project builder](https://github.com/cdktf/cdktf-provider-project) which encapsulate the common settings for all \`cdktf\` prebuilt providers.

### Provider Version

The provider version can be adjusted in [./.projenrc.js](./.projenrc.js).

### Repository Management

The repository is managed by [Repository Manager](https://github.com/hashicorp/cdktf-repository-manager/)
The repository is managed by [CDKTF Repository Manager](https://github.com/cdktf/cdktf-repository-manager/).
`;
}
}
75 changes: 33 additions & 42 deletions test/__snapshots__/index.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,14 @@ test("README contains provided Namespace", () => {

expect(snapshotWithVersion["README.md"]).toEqual(
expect.stringContaining(
"- [Terraform random Provider](https://registry.terraform.io/providers/hashicorp/random/3.1.0)"
) &&
expect.stringContaining(
"- This links to the minimum version being tracked, you can find the latest released version [in our releases](https://github.com/cdktf/cdktf-provider-random/releases)"
)
"- [Terraform random provider](https://registry.terraform.io/providers/hashicorp/random/3.1.0)"
)
);

expect(snapshotWithoutVersion["README.md"]).toEqual(
expect.stringContaining(
"- [Terraform random Provider](https://registry.terraform.io/providers/hashicorp/random/)"
) &&
expect.stringContaining(
"- This links to the minimum version being tracked, you can find the latest released version [in our releases](https://github.com/cdktf/cdktf-provider-random/releases)"
)
"- [Terraform random provider](https://registry.terraform.io/providers/hashicorp/random/)"
)
);
});

Expand Down