fix(apollo-wind): fix prism import issues on vitest for consumers#295
fix(apollo-wind): fix prism import issues on vitest for consumers#295CalinaCristian wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
📦 Dev Packages🧹 Dev packages cleaned up after PR close. Last updated: 2026-03-04 11:32:10 PT |
There was a problem hiding this comment.
Pull request overview
Updates the CodeBlock component in @uipath/apollo-wind to change how Prism theme styles are imported from react-syntax-highlighter, aiming to resolve Prism style import issues.
Changes:
- Replaced named-imports from
react-syntax-highlighter/dist/esm/styles/prismwith per-style direct imports. - Minor formatting change in
getBodyTheme()for readability.
You can also share your feedback on Copilot code review. Take the survey.
34c7bf7 to
f3b88be
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
f3b88be to
7517a1a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review. Take the survey.
Consumers running vitest/Jest fail when importing
@uipath/apollo-windbecause thecode-blockcomponent uses a directory import (react-syntax-highlighter/dist/esm/styles/prism) that Node's ESM resolver cannot resolve.Root cause
react-syntax-highlighterhas noexportsmap in itspackage.json— onlymain/module. Subpath imports resolve via the filesystem directly. Sinceapollo-windis built withbundle: false, the import passes through as-is intodist/. When a consumer's test runner uses Node ESM resolution on dependencies innode_modules, it rejects directory imports (Node ESM requires explicit file paths, unlike CJS which auto-resolvesindex.js).Fix
index.jsbarrel file (react-syntax-highlighter/dist/esm/styles/prism/index.js).d.tsdeclaration since@types/react-syntax-highlighteronly types the directory path