fix(ci): unbreak the documentation workflow - #79
Merged
Conversation
typedoc@0.28.20 only supports typescript up to 6.0.x and crashes reading its internal TS API against this repo's typescript@7.0.2 (the golar native-typechecker migration). pnpm has no way to give a single devDependency its own nested peer version, so scripts/generate-docs.mjs installs typedoc plus a compatible typescript into a throwaway npm-managed directory and runs it from there; TypeScript's own module resolution still walks up from the real source files, so workspace packages and @types/node resolve normally. Separately, typedoc.json's entryPoints only listed src/index.ts, so src/register.ts (the only file importing @wolfstar/http-framework) was never in typedoc's program, making the http-framework module augmentation in index.ts unresolvable. This has been failing since before the typescript bump; adding register.ts as an entry point fixes it.
scripts/generate-docs.mjs installs its own throwaway typedoc instead of using the root one, so knip's unused-code check correctly flagged the root devDependency as dead weight.
commit: |
RedStar071
pushed a commit
that referenced
this pull request
Sep 7, 2026
Resolves a conflict in AGENTS.md between this branch's typecheck/pnpm documentation updates and main's docs-workflow fix (#79), keeping both sets of changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UZGPFfbvNYKHrDdQouBPQG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
N/A — no tracking issue, found while investigating why the
documentationGitHub Actions workflow was failing on every push tomain.🧭 Context
The
documentationworkflow (.github/workflows/documentation.yml) has been failing on every run. Digging into the CI logs turned up two separate, unrelated bugs:typedoc@0.28.20's peer range tops out attypescript@6.0.x. This repo's roottypescriptwas bumped to7.0.2in build: replace tsc with golar as typechecker, bump typescript to 7.0.2 #68 for the newgolarnative-typechecker migration, and typedoc crashes at import time reading its internal TS API against TS 7's experimental API surface (TypeError: Cannot read properties of undefined (reading 'PropertyDeclaration')). pnpm has no working mechanism to give a single devDependency (typedoc) its own nested/non-hoisted peer version distinct from the root's — I tried bothpnpm.overridesandpackageExtensionsinpnpm-workspace.yamland neither actually isolates a peer dependency edge, they only rewrite the recorded constraint text in the lockfile while still resolving to whatever's hoisted at the root.typedoc.json'spackageOptions.entryPointsonly listedsrc/index.ts. Every package here also has asrc/register.ts, and inplugin-i18nextthat file is the only place that actually imports@wolfstar/http-framework—index.tsonly has adeclare module "@wolfstar/http-framework" { ... }augmentation with no real import establishing that module in typedoc's isolated per-package program, so typedoc couldn't resolve the module being augmented. This bug predates the typescript 7.0.2 bump — confirmed thedocumentationworkflow was already failing this same way as far back as August 30 — the TS 7 crash just happened to run first and mask it afterwards.📚 Description
scripts/generate-docs.mjs, which installstypedoc@0.28.20+ a compatibletypescript@^5.9.3into a throwawaynpm-managed directory (viamkdtempSync) and runs typedoc's binary from there. This works because Node resolvesrequire("typescript")from typedoc's own install location in that throwaway directory, while TypeScript's own module resolution still walks up from the real source files being analyzed (which live in this repo), so workspace-linked packages and@types/noderesolve normally against the realnode_modules. Verified this locally against the real repo before committing to the approach — a plainpnpm dlx typedocdoes not work here, since it can't see the real project'snode_modulesfor@types/node/workspace packages.package.json'sdocsscript and.github/workflows/documentation.yml'sdocgen-commandto go through the new script instead of invokingtypedocdirectly.src/register.tstotypedoc.json'spackageOptions.entryPointsalongsidesrc/index.ts, fixing the module-augmentation resolution error.pnpm run docsdescription inAGENTS.mdto match.Ran both
pnpm run docsand the exact CI invocation locally — both now exit 0 withFound 0 errors and 68 warnings(pre-existing@linkresolution warnings, unrelated to this fix) and produce the expectedapi/HTML output anddocs-output/api.json.Key changes
scripts/generate-docs.mjspackage.jsondocsscript now delegates to the new wrapper script.github/workflows/documentation.ymldocgen-commandnow delegates to the new wrapper scripttypedoc.jsonsrc/register.tstopackageOptions.entryPointsAGENTS.mdpnpm run docsdescriptionNot in scope: the
releaseworkflow is also currently failing, but that's a separate, pre-existing issue —@wolfstar/plugin-apiand@wolfstar/plugin-subcommands-advanced404 on every OIDC trusted-publish attempt since #77 removed the static npm token fallback, while@wolfstar/plugin-i18nextpublishes fine every time. That looks like an npm Trusted Publisher misconfiguration for those two packages specifically (not the intermittent multi-package OIDC race documented in.changeset/README.md), and needs an npm org/package owner to check npmjs.com settings — it isn't fixable from this repo.Type of Change
Pre-flight Checklist
AGENTS.md)