Skip to content

fix(workspace-plugin): generate-api emits export-subpath rollups on Windows - #36672

Open
Ray Knight (ArrayKnight) wants to merge 1 commit into
microsoft:masterfrom
ArrayKnight:fix/generate-api-windows-subpaths-36654
Open

fix(workspace-plugin): generate-api emits export-subpath rollups on Windows#36672
Ray Knight (ArrayKnight) wants to merge 1 commit into
microsoft:masterfrom
ArrayKnight:fix/generate-api-windows-subpaths-36654

Conversation

@ArrayKnight

@ArrayKnight Ray Knight (ArrayKnight) commented Aug 31, 2026

Copy link
Copy Markdown

In getExportSubpathConfigs, the resolved primary entry is checked against the hard-coded posix suffix '/index.d.ts' — but path.resolve emits backslash-separated paths on Windows, so the guard fires for every project and every export-subpath API rollup is silently skipped on Windows machines. Linux CI is unaffected, which is why it has survived. Concretely: on a Windows checkout, generate-api for @fluentui/react-headless-components-preview emits 0 subpath rollups where it should emit 56, and a run that produces nothing looks identical to a run that had nothing to produce.

The fix normalizes the resolved path to posix separators before the suffix check, with a comment recording why. Verification on a Windows checkout: the package's generate-api jest suite goes from 8 failed / 5 passed on current master to 4 failed / 9 passed with this change — the four subpath-resolution tests this code path owns now pass; the remaining four failures are pre-existing Windows path-separator expectations elsewhere in the same spec file, unaffected by this change (everything passes on Linux).

Fixes #36654.

Extracted from #36656 per maintainer request — each in-tree fix from that PR as an isolated change.

…indows

getExportSubpathConfigs checks the resolved primary entry against the
posix suffix '/index.d.ts', but path.resolve emits backslash-separated
paths on Windows, so the guard fired for every project and every
export-subpath API rollup was silently skipped on Windows machines
(Linux CI unaffected). Normalize to posix separators before the check,
with a comment recording why.

Extracted from windmod branch commit d826380 (utils.ts hunk only).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aj9uA3rCVgosnh2zNn8qkc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: workspace-plugin generate-api silently skips every export-subpath rollup on Windows

1 participant