Skip to content

fix(docs): bump constructs pin to 10.6.0 in documentation-generation tool#305

Open
so0k wants to merge 3 commits into
mainfrom
worktree-fix-docgen-constructs-pin
Open

fix(docs): bump constructs pin to 10.6.0 in documentation-generation tool#305
so0k wants to merge 3 commits into
mainfrom
worktree-fix-docgen-constructs-pin

Conversation

@so0k

@so0k so0k commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • tools/documentation-generation pinned constructs@10.3.0, while every other package in the repo (packages/cdktn, @cdktn/cli-core, @cdktn/provider-generator, cdktn-cli, all examples) uses 10.6.0. The pin dates back to the cdktf era (2024-05-06) and was never bumped since.
  • jsii-docgen documents inherited Construct members by resolving the base-class assembly it's pointed at via assembliesDir. Since that assembly came from the stale constructs@10.3.0, which predates the with(...mixins: IMixin[]) mixin API, none of the generated construct docs (across all 5 languages) documented with()/IMixin at all.
  • Root cause: tools/documentation-generation was excluded from pnpm-workspace.yaml — a holdover from Yarn Classic days, when workspace hoisting could genuinely flatten constructs to a conflicting version. pnpm doesn't hoist, so that constraint stopped applying after the pnpm migration, but the exclusion was never revisited. Being outside the workspace made the package invisible to lerna exec-based tooling, including the existing upgradeJSII CI job that already keeps constructs/jsii-docgen/jsii-rosetta in lockstep everywhere else — which is exactly how this pin went stale in the first place.

Changes

  1. Bump constructs to 10.6.0 in tools/documentation-generation/package.json.
  2. Add tools/documentation-generation to pnpm-workspace.yaml.
  3. Switch its cdktn dependency to workspace:* (was a manual link:../../packages/cdktn).
  4. Align jsii-rosetta to ~5.9.0 (matches @cdktn/hcl2cdk) — this drift was invisible before and only surfaced once sherif/lerna could actually see the package.
  5. Drop its standalone pnpm-lock.yaml in favor of the root lockfile; simplify generate-docs:api now that a plain pnpm install covers this package too.

Test plan

  • Ran the full pnpm generate-docs:api pipeline (install + build + regenerate docs) twice — once for the version-bump-only fix, once after the workspace restructuring — from a clean worktree each time
  • Confirmed tools/documentation-generation/node_modules/constructs/package.json resolves to 10.6.0 and node_modules/cdktn symlinks correctly via the workspace protocol
  • Confirmed generated docs include with()/IMixin — verified across all 5 languages' constructs/ topic (40 construct files each, 0 before the fix)
  • website/docs/cdktn/** output is gitignored, so no generated-doc diff is part of this PR
  • Confirmed @tools/documentation-generation now shows up in lerna ls --all (so future upgradeJSII runs will enumerate it) and in npx sherif output (so future drift will be flagged) — verified by simulating the regression (reverting the pin) and confirming detection tooling behaves correctly both ways

🤖 Generated with Claude Code

…tool

The tools/documentation-generation package pinned constructs@10.3.0 for
resolving the jsii assembly via assembliesDir, while every other package
in the repo uses 10.6.0. jsii-docgen documents inherited Construct
members from that assembly, so the stale 10.3.0 copy predates the
with()/IMixin mixin API and silently omitted it from all generated
construct docs across every language.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@so0k so0k requested a review from a team as a code owner July 4, 2026 09:53
@so0k so0k added ci/skip-examples Skip Examples Testing in PR ci/skip-integration Skips Integration Testing on PR ci/skip-provider-integration Skips Provider Integration Tests on PR ci/skip-unit Skips Unit Testing on PR labels Jul 4, 2026
so0k and others added 2 commits July 4, 2026 18:29
tools/documentation-generation was excluded from pnpm-workspace.yaml, a
holdover from Yarn Classic days when workspace hoisting could flatten
`constructs` to a conflicting version. pnpm doesn't hoist, so that
constraint no longer applies, but the exclusion was never revisited.

Being outside the workspace made this package invisible to lerna-based
tooling, including the existing upgradeJSII CI job that already keeps
`constructs`/`jsii-docgen`/`jsii-rosetta` in lockstep everywhere else -
which is exactly how the constructs pin went stale (the prior commit
in this PR fixed the version; this restores the mechanism that would
have kept it correct going forward).

- Add tools/documentation-generation to pnpm-workspace.yaml
- Switch its `cdktn` dependency to `workspace:*` (was a manual `link:`)
- Align jsii-rosetta to ~5.9.0 (matches @cdktn/hcl2cdk) - drift sherif
  can now actually see now that the package is workspace-visible
- Drop its standalone pnpm-lock.yaml in favor of the root lockfile
- Simplify the generate-docs:api script now that a plain `pnpm install`
  covers this package too

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Now that tools/documentation-generation is a workspace member, knip
scans it and flags cdktn/constructs as unused — generate-documentation.js
only resolves them on disk through assembliesDir for jsii-docgen, never
via a static import, so knip's usage analysis can't see it. Same
pattern already used for constructs in packages/cdktn-cli's knip config.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/skip-examples Skip Examples Testing in PR ci/skip-integration Skips Integration Testing on PR ci/skip-provider-integration Skips Provider Integration Tests on PR ci/skip-unit Skips Unit Testing on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant