Skip to content

Commit a5ff6fa

Browse files
so0kclaudevincenthsh
authored
chore: prepare v0.22.0 release (#32)
## Summary - Bump version to 0.22.0 in root `package.json` - Add v0.22.0 CHANGELOG entry documenting the `cdktf` → `cdktn` package rename and associated fixes - Update CONTRIBUTING.md release section: point upgrade guide and PR links to `open-constructs/cdk-terrain-docs`, remove HashiCorp-specific post-release steps, update Sentry org to `cdktn` - Fix `generate-documentation.js` frontmatter: `page_title` → `title` (Mintlify standard), `CDKTF` → `CDKTN` - Fix doc generation dependencies: `file:` → `link:`, add `jsii-rosetta` ## Test plan - [x] `yarn docs` runs successfully with fixed frontmatter - [x] Generated MDX files use `title:` (not `page_title:`) in frontmatter - [x] All 25 API reference MDX files generated (5 langs × 5 categories) - [ ] Verify release CI triggers correctly on merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent De Smet <vindes@handshakes.com.sg>
1 parent 9b0f820 commit a5ff6fa

File tree

9 files changed

+2362
-488
lines changed

9 files changed

+2362
-488
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@ test/.yarn
4343

4444
website/*
4545
!website/README.md
46+
!website/docs/
47+
website/docs/*
48+
!website/docs/cdktn/
49+
website/docs/cdktn/*
50+
!website/docs/cdktn/docs.json

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
## 0.22.0
2+
3+
**Breaking Changes**
4+
5+
### Package Rename: `cdktf` to `cdktn`
6+
7+
This is the first release under the CDK Terrain (CDKTN) project. All packages have been renamed:
8+
9+
- `cdktf``cdktn`
10+
- `cdktf-cli``cdktn-cli`
11+
- `@cdktf/*``@cdktn/*`
12+
13+
Internal symbols and logical IDs remain unchanged for backwards compatibility. Legacy config keys (`cdktf.json`, `CDKTF_*` env vars) are still supported.
14+
15+
Prebuilt providers now require `cdktn` as a peer dependency (major version bump).
16+
17+
### fix
18+
19+
- fix: release-next gh token permissions [\#2db8ee4](https://github.com/open-constructs/cdk-terrain/commit/2db8ee4f0)
20+
- fix: pin sentry-cli to last v2 release [\#31eceb8](https://github.com/open-constructs/cdk-terrain/commit/31eceb82d)
21+
- fix(release): Sentry org/project [\#16](https://github.com/open-constructs/cdk-terrain/pull/16)
22+
23+
### chore
24+
25+
- chore: Rename to CDK Terrain / cdktn [\#7](https://github.com/open-constructs/cdk-terrain/pull/7)
26+
- docs: Update reference to CDKTF in PR template [\#3](https://github.com/open-constructs/cdk-terrain/pull/3)
27+
128
## 0.21.0
229

330
**Breaking Changes**

CONTRIBUTING.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ Most of our tests are automated but there are some workflows we need to manually
403403
404404
- Test `cdktf` against Terraform Enterprise
405405
406-
#### Terraform CDK
406+
#### CDK Terrain
407407
408408
1. Create a new branch (e.g. `prepare-release-0.9.0`)
409409
2. Update the [CHANGELOG](./CHANGELOG.md): `./tools/create-changelog.sh` should get you a good start
@@ -412,15 +412,9 @@ Most of our tests are automated but there are some workflows we need to manually
412412
5. Merge the PR, a new release will be build and published because the version changed
413413
6. For major releases:
414414
415-
- Write an [upgrade guide](https://github.com/hashicorp/web-unified-docs/tree/main/content/terraform-cdk/v0.21.x/docs/cdktf/release)
415+
- Write an [upgrade guide](https://github.com/open-constructs/cdk-terrain-docs/tree/main/content/release)
416416
- Run `yarn generate-docs` to bring our api documentation up to date
417-
- Make a PR with the changes over in the [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs) repository
418-
419-
#### After the release
420-
421-
- Updates in our other repos should largely be automated, but some of the updates require manual approval before they'll be auto-merged
422-
- Update the learn examples and the end to end examples
423-
- Check if there are PRs left behind on our [triage board](https://github.com/orgs/hashicorp/projects/125/views/4)
417+
- Make a PR with the changes over in the [`open-constructs/cdk-terrain-docs`](https://github.com/open-constructs/cdk-terrain-docs) repository
424418
425419
#### Retrying a broken deployment
426420
@@ -431,18 +425,11 @@ The release workflow uses sentry as the source of truth for releases. The downsi
431425
npm i -g @sentry/cli
432426
sentry-cli login
433427
# List all releases (optional)
434-
sentry-cli releases list --org hashicorp
428+
sentry-cli releases list --org cdktn
435429
# Delete the release, Note: there will be no confirmation for deleting the release!
436-
sentry-cli releases delete --org hashicorp <release> # e.g. cdktf-cli-0.14.0
430+
sentry-cli releases delete --org cdktn <release> # e.g. cdktn-cli-0.14.0
437431
```
438432
439-
### Repositories to update
440-
441-
- [Docker E2E](https://github.com/hashicorp/docker-on-aws-ecs-with-terraform-cdk-using-typescript)
442-
- [Serverless E2E](https://github.com/hashicorp/cdktf-integration-serverless-example)
443-
- [Learn Lambda Demo](https://github.com/hashicorp/learn-cdktf-assets-stacks-lambda)
444-
- [AWS Adapter](https://github.com/hashicorp/cdktf-aws-cdk)
445-
446433
### Helper for creating the changelog
447434
448435
Just run the following script before bumping the version, it'll create a ready to copy markdown formatted changelog.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "root",
3-
"version": "0.21.0",
3+
"version": "0.22.0",
44
"private": true,
55
"scripts": {
66
"build-and-package": "lerna run --scope 'cdktn*' --scope @cdktn/* build,package && tools/collect-dist.sh",
@@ -44,7 +44,7 @@
4444
"prepare-next-release": "standard-version --prerelease pre --release-as minor --skip.changelog=true --skip.commit=true",
4545
"prepare-release": "tools/prepare-release.sh",
4646
"release": "standard-version",
47-
"generate-docs:api": "yarn && yarn build && yarn package && git clean -dfx . && mkdir -p website/docs/cdktf/api-reference && cd tools/documentation-generation && yarn && yarn docs && npx prettier --write ../../website/docs/cdktf/api-reference/**",
47+
"generate-docs:api": "yarn && yarn build && mkdir -p website/docs/cdktn/api-reference && cd tools/documentation-generation && yarn && yarn docs && npx prettier --write ../../website/docs/cdktn/api-reference/**",
4848
"generate-docs": "yarn generate-docs:api",
4949
"generate-function-bindings": "cd tools/generate-function-bindings && yarn && yarn fetch-metadata && yarn generate"
5050
},
Lines changed: 107 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,110 @@
11
# Documentation Generation
22

3-
A little node.js script that uses `jsii-docgen` to generate documentation for the `cdktn` package.
4-
Run `yarn && yarn docs` to generate the documentation.
3+
Generates API reference docs from the `cdktn` JSII assembly using [`jsii-docgen`](https://github.com/cdklabs/jsii-docgen), outputting Mintlify-compatible MDX files.
54

6-
This package is excluded from the hoisting because we need a locally installed copy of `cdktn` and `constructs`.
5+
## Usage
6+
7+
```bash
8+
# From repo root (builds all packages first):
9+
yarn generate-docs:api
10+
11+
# Or from this directory (assumes packages are already built):
12+
yarn && yarn docs
13+
```
14+
15+
Output: `website/docs/cdktn/api-reference/<language>/<topic>.mdx` (25 files total).
16+
17+
To publish, copy the output into the Mintlify docs site:
18+
19+
```bash
20+
cp -r website/docs/cdktn/api-reference/* ../docs/content/api-reference/
21+
```
22+
23+
## How It Works
24+
25+
### Pipeline
26+
27+
All transforms operate on the MDAST (abstract syntax tree) via remark/unified, so `code` and `inlineCode` nodes are naturally skipped — no placeholder hacks needed.
28+
29+
```
30+
packages/cdktn/.jsii (JSII assembly)
31+
32+
33+
jsii-docgen Generates one large markdown doc per language
34+
35+
36+
remark-parse Parse into MDAST (full AST)
37+
38+
39+
splitByHeading(tree, 2) Split by H2 into Map<topic, MDAST subtree>
40+
41+
42+
sanitizeAst(subtree) Walk text/html/link nodes, skip code/inlineCode
43+
44+
45+
remark-stringify Serialize back to clean markdown
46+
47+
48+
postProcessForMdx() MDX fixups: autolinks, `|` in <code>, lone `<`, `{`
49+
50+
51+
compose() Wrap with MDX frontmatter, write .mdx files
52+
```
53+
54+
### Languages and Topics
55+
56+
5 languages x 5 topics = 25 `.mdx` files:
57+
58+
| Languages | Topics |
59+
| ---------- | ---------- |
60+
| Typescript | Constructs |
61+
| Python | Structs |
62+
| Java | Classes |
63+
| CSharp | Protocols |
64+
| Go | Enums |
65+
66+
### Output Format
67+
68+
Each file gets Mintlify frontmatter:
69+
70+
```yaml
71+
---
72+
title: "Typescript: Constructs"
73+
sidebarTitle: Constructs
74+
description: CDKTN Core API Reference for Constructs in Typescript.
75+
---
76+
```
77+
78+
- `title` — page heading (e.g., "Typescript: Constructs")
79+
- `sidebarTitle` — short label for the nav sidebar (e.g., "Constructs"), since the language is already provided by the sidebar group
80+
- The original H2 topic heading from jsii-docgen is stripped to avoid duplication with the frontmatter title
81+
82+
### MDX Sanitization (`sanitizeAst`)
83+
84+
All sanitization is done at the AST level via a single `visit()` pass. The key advantage: `code` and `inlineCode` nodes are **skipped entirely**, so content like `import { Foo }` in TypeScript blocks and `-> str` in Python blocks is never corrupted.
85+
86+
**`text` nodes** (prose):
87+
88+
- `{@link URL text}` → spliced into proper MDAST link nodes
89+
- `<Foo>` generics → `< Foo >` (prevents MDX/HTML parsing; preserves `<code>`, `<a>`, `<sup>`)
90+
91+
**`html` nodes**:
92+
93+
- Angle bracket spacing, preserving real HTML tags (detected by tag name pattern)
94+
95+
**`link` nodes**:
96+
97+
- Relative terraform doc links (`/terraform/docs/...`) → absolute URLs (prefixes `https://developer.hashicorp.com`). Temporary workaround; see [#33](https://github.com/open-constructs/cdk-terrain/issues/33).
98+
99+
**`code` / `inlineCode` nodes**: skipped — `remark-stringify` outputs their values raw
100+
101+
**`postProcessForMdx`** (post-stringify string-level fixups, code-fence-aware):
102+
103+
- `<url>` autolinks → `[url](url)` (MDX treats `<...>` as JSX)
104+
- `|` inside `<code>...</code>``&#124;` (prevents MDX table cell splitting)
105+
- Lone `<` not starting HTML tags (e.g., `<=`, `<<a`) → `&lt;`
106+
- `{``\{` (MDX brace escaping; can't be done at AST level because `remark-stringify` would double-escape)
107+
108+
## Package Notes
109+
110+
This package is excluded from workspace hoisting because it needs a locally installed copy of `cdktn` and `constructs` in its own `node_modules/` for jsii-docgen to resolve the JSII assembly.

0 commit comments

Comments
 (0)