fix(api-docs/ts): derive package names from the manifest, restore the 7 dropped packages - #132
Conversation
… 7 dropped packages The TypeScript template carried two stale literals about resq-software/npm. Both were found by running the template's own extraction logic against a fresh clone of that repo, the same way the .NET read_version() bug was proven. 1. The top-level index rebuilt each entry as `@resq-sw/<dir>`. That scope was renamed to `@resq-systems/*` in npm#167 (July 2026), so the template renders install names that no longer resolve on the registry. It now reads `.name` out of the package manifest it already opens for `.version`, which is the point: a name derived from the source of truth survives the next rename without a template edit. 2. `PUBLIC_PACKAGES` listed 9 packages; the monorepo publishes 16. The missing 7 are constants, email-templates, map, math, nav, telemetry and types. This one bites hard because "Sync generated MDX" clears the target directory before copying: a run from the stale list would have dropped 6 already-published package doc trees from sdks/typescript/api/ and never added nav. The list now matches every packages/*/ that has a src/, which is exactly the set the generation step accepts. Verified against a clone of resq-software/npm at 39ea053: the patched index step emits all 16 packages under the correct scope with the versions their manifests carry. actionlint is clean on all five templates. The other three siblings were audited the same way and are NOT changed: - rust: already correct on the hybrid workspace. field_in() requires a double-quoted value, so `version.workspace = true` does not match and the `or ws_version` fallback supplies the inherited version. Run against resq-software/crates, all 8 crates matched their release-plz tags, including the 4 inheriting ones (v0.1.24). - python: resq-software/pypi configures python-semantic-release with version_toml = ["pyproject.toml:project.version"], so PSR writes a literal into [project] version on every release. resq-dsa v1.3.4 and resq-mcp v1.3.3 both read correctly. - cpp: resq-software/vcpkg carries a literal "version" in packages/resq-common/vcpkg.json, matching both the CMake project VERSION and the resq-common@v0.1.0 tag. Reads correctly.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe TypeDoc workflow template now includes more public packages and reads package names and versions from each package manifest. It also updates package scope references in comments, generated index output, and pull request text. ChangesAPI documentation package metadata
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The workflow updates generated TypeScript API documentation to include the restored packages and manifest-defined names and versions, with fallbacks for incomplete manifests. No concrete merge-blocking production risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Audit of the four sibling API-docs templates for the same class of bug that
broke the .NET one — a value the template reads or hardcodes that the source
repo no longer matches. One of the four is broken. Three are fine and are
not touched.
Every verdict below was reached by extracting the template's own Python
extraction logic and running it against a fresh clone of the corresponding
repo, the same method that proved the .NET
read_version()bug. No verdicthere rests on reading alone.
Scoped to the templates only; the .NET fix is a separate PR.
Per-template verdict
api-docs.rust.ymlcrates[package] version, falling back to[workspace.package] versionversion.workspace = trueapi-docs.python.ymlpypiversion = "…"inpyproject.toml[project] version, written by PSRapi-docs.cpp.ymlvcpkgversion/version-semver/version-string/version-dateinvcpkg.json"version": "0.1.0"api-docs.typescript.ymlnpm.versionfrompackage.json— but rebuilds the package name from a hardcoded scope, and generates from a stale package listrust — OK, no change
The suspicion was that the template would mis-read the hybrid workspace.
It does not.
field_in()is^\s*<name>\s*=\s*"([^"]+)", which requires adouble-quoted value, so
version.workspace = truecannot match it — the.breaks the\s*=andtrueis unquoted. The function returns""andfield_in(pkg, "version") or ws_versionfalls through to the inheritedworkspace version, which is the intended path (the neighbouring
licenseline documents exactly that inheritance).
Ran the real step against
crates@0ce9c87, README-stub path. All 8crates match their release-plz tags:
The
README.mdxstep, which re-reads the banner it just wrote, reproducesthe same 8 lines. 8/8, no
unknown.python — OK, no change
pypiconfigures python-semantic-release withversion_toml = ["pyproject.toml:project.version"]in both releasedpackages. That directs PSR to write a literal into
[project] versionon each release, so there is no dynamic source for the template to miss —
this is the opposite of the MinVer situation. Ran the index step against
pypi@acb1fbf:Matches the manifests and the
v1.3.4repo tag.cpp — OK, no change
vcpkghas one package.packages/resq-common/vcpkg.jsoncarries a literal"version": "0.1.0", agreeing withproject(resq-common VERSION 0.1.0 …)and the
resq-common@v0.1.0tag. Ran the index step againstvcpkg@446b1cd:typescript — BROKEN, fixed in this PR
The version read itself is fine, as expected:
package.jsonalways carriesa literal, and all 16 resolved. Two other stale literals in the same step
are not fine.
1. Hardcoded, dead npm scope. The index line was
print(f"- \@resq-sw/{pkg_dir.name}` — `v{version}`"). That scope was renamed to@resq-systems/inresq-software/npm#167("Rebrand to ResQ Systems: rename npm scope@resq-sw/→@resq-systems/*").@resq-swappears **0 times** across the monorepo'spackage.jsonfiles today;@resq-systems` appears 55 times. The template therefore renders installnames that no longer resolve.
Fixed by reading
.namefrom the manifest the function already opens for.version— same lesson as MinVer: derive from the source of truth insteadof restating it. The directory name stays as the fallback so a missing or
unparseable manifest still produces a readable entry.
2.
PUBLIC_PACKAGEShad drifted to 9 of 16. Missing:constants,email-templates,map,math,nav,telemetry,types.This is the damaging half.
Sync generated MDXclears the target directorybefore copying, so a tag-triggered run from the stale list would have
removed 6 already-published package doc trees from
sdks/typescript/api/(all 6 are live in this repo today) and never added
nav. The generationstep's own comment warns about precisely this — "a partial sync would delete
these packages' published docs" — but its guard only catches listed and
absent, not present and unlisted.
The list now equals every
packages/*/that has asrc/, which is exactlythe set the generation loop accepts. Verified equal by set-diff.
Proof for the fix
Patched index step, run against a clone of
resq-software/npm@39ea053:Before the fix the same run produced 16 lines under the dead
@resq-sw/scope, and
PUBLIC_PACKAGESwould have limited generation to 9 of them.actionlintis clean on all five templates.Worth a follow-up, deliberately not in this PR
The
npmcopy of this workflow has diverged from the template by 81 lines,and carries downstream-only fixes from July–September 2026 that were never
brought back here — including both items above, plus a
setup-buncache-poisoning mitigation. Conversely the template holds a newer
hardening the copy lacks (abort-on-any-package-failure, #113). Reconciling
that full divergence is a larger change and is left separate.
cratesandvcpkgdiffer only by Dependabot action bumps.pypialsocarries a
setup-uvcache-poisoning mitigation not present here.Test plan
crates,pypi,vcpkg,npmPUBLIC_PACKAGESset-diffed againstpackages/*/src/— exact matchactionlintclean on all five templatesresq-software/npmand confirm the next release-tag run publishes all 16 (post-merge; note the divergence above before syncing)Summary by CodeRabbit