Skip to content

chore: include package.json in package exports maps#1027

Merged
kylemcd merged 1 commit into
mainfrom
kyle-kno-14073-include-packagejson-in-exports-map
Jul 8, 2026
Merged

chore: include package.json in package exports maps#1027
kylemcd merged 1 commit into
mainfrom
kyle-kno-14073-include-packagejson-in-exports-map

Conversation

@kylemcd

@kylemcd kylemcd commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

Adds "./package.json": "./package.json" to the exports map of the five published packages that define one: @knocklabs/client, @knocklabs/react, @knocklabs/react-core, @knocklabs/react-native, and @knocklabs/expo.

Why: once a package declares an exports field, that field becomes a hard encapsulation boundary — any subpath not explicitly listed (including ./package.json) becomes unresolvable. A lot of tooling relies on being able to resolve a dependency's manifest: bundlers, version/feature detection, and test mockers like Storybook and Vitest. Without this entry, sb.mock(import("@knocklabs/react")) throws Package subpath './package.json' is not defined by "exports".

Exposing ./package.json is the accepted convention (React, Vite, Zod, most of @babel/*, etc. all do it) and is zero-risk — the file is already published.

@knocklabs/types is intentionally untouched because it has no exports map.

Checklist

  • No tests added — this is a package-manifest metadata change with no runtime code surface. Existing type-check/build cover manifest validity.

Closes #1026
KNO-14073

Expose "./package.json" in the exports map for client, react, react-core, react-native, and expo so tooling (bundlers, test mockers like Storybook/Vitest, version checks) can resolve the package manifest.

Closes #1026
@linear-code

linear-code Bot commented Jul 8, 2026

Copy link
Copy Markdown

KNO-14073

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
javascript-ms-teams-connect-example Ready Ready Preview, Comment Jul 8, 2026 1:39pm
javascript-nextjs-example Ready Ready Preview, Comment Jul 8, 2026 1:39pm
javascript-slack-connect-example Ready Ready Preview, Comment Jul 8, 2026 1:39pm
javascript-slack-kit-example Ready Ready Preview, Comment Jul 8, 2026 1:39pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dc8ef79

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@knocklabs/client Patch
@knocklabs/react Patch
@knocklabs/react-core Patch
@knocklabs/react-native Patch
@knocklabs/expo Patch
ms-teams-connect-example Patch
nextjs-app-dir-example Patch
slack-connect-example Patch
slack-kit-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kylemcd kylemcd marked this pull request as ready for review July 8, 2026 13:38
@kylemcd kylemcd requested a review from a team as a code owner July 8, 2026 13:38
@kylemcd kylemcd requested review from andy-knock, cjbell and thomaswhyyou and removed request for a team July 8, 2026 13:38
@kylemcd kylemcd marked this pull request as draft July 8, 2026 13:38

@cjbell cjbell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cjbell approved this PR from Slack with Graphite

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.46%. Comparing base (3dd0aa8) to head (dc8ef79).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1027      +/-   ##
==========================================
+ Coverage   63.95%   64.46%   +0.51%     
==========================================
  Files         212      212              
  Lines       10028    10211     +183     
  Branches     1321     1389      +68     
==========================================
+ Hits         6413     6583     +170     
- Misses       3590     3603      +13     
  Partials       25       25              

see 3 files with indirect coverage changes

@kylemcd kylemcd merged commit dd1b724 into main Jul 8, 2026
13 checks passed
@kylemcd kylemcd deleted the kyle-kno-14073-include-packagejson-in-exports-map branch July 8, 2026 13:57
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.

Include package.json in exports map

2 participants