fix(workspace-plugin): generate-api emits export-subpath rollups on Windows - #36672
Open
Ray Knight (ArrayKnight) wants to merge 1 commit into
Open
Conversation
…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
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.
In
getExportSubpathConfigs, the resolved primary entry is checked against the hard-coded posix suffix'/index.d.ts'— butpath.resolveemits 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-apifor@fluentui/react-headless-components-previewemits 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-apijest 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.