Skip to content

chore: Enable package.json exports support - #8294

Merged
devongovett merged 7 commits into
mainfrom
package-exports
May 23, 2025
Merged

devongovett merged 7 commits into
mainfrom
package-exports

Conversation

@devongovett

@devongovett devongovett commented May 23, 2025 •

Copy link
Copy Markdown
Member

In collaboration with @snowystinger. Prerequisite for Storybook 8 and RSC support for new website.

This enables package.json exports support in Parcel, and TypeScript's "moduleResolution": "bundler" mode. This makes our packages behave more like they do outside our repo. I added "source" fields to each export so that we can resolve without building the dist folders. And fallback "types" fields for source as well.

This means we can no longer access sub-paths from packages that are not exported. To do that, you can use relative paths (but be careful to only do that in tests/stories/docs, and not in published code).

@devongovett
devongovett marked this pull request as ready for review May 23, 2025 01:00
@rspbot

rspbot commented May 23, 2025

Copy link
Copy Markdown

@devongovett
devongovett added this pull request to the merge queue May 23, 2025
Merged via the queue into main with commit 8c33cba May 23, 2025
@devongovett
devongovett deleted the package-exports branch May 23, 2025 16:52
@somebody1234

somebody1234 commented Jun 18, 2025 •

Copy link
Copy Markdown

hey, not sure this is ideal - we have a stricter tsconfig so the addition of src/index.ts into the types field is causing type errors:

Found 1419 errors in 331 files.

😅

edit: my bad! we have "customConditions": ["source"] for some reason...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants