Skip to content

chore: correct stale exports comment - #10244

Closed
cryptodev-2s wants to merge 2 commits into
mainfrom
chore/fix-stale-exports-comment
Closed

cryptodev-2s wants to merge 2 commits into
mainfrom
chore/fix-stale-exports-comment

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Explanation

The comment above expectCorrectWorkspaceExports says packages set up "ESM- and CommonJS-compatible exports", but the function it introduces asserts the opposite:

expectWorkspaceField(workspace, 'exports["."].require', null);
expectWorkspaceField(workspace, 'exports["."].import', null);
expectWorkspaceField(workspace, 'main', null);

References

Part of WPC-1161.

Checklist

  • I've updated the test suite for new or updated code as appropriate (comment only)
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed (no published package is touched)
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Comment-only change to Yarn constraint documentation; no enforcement logic or package manifests are modified.

Overview
Updates the Yarn constraints comment above expectCorrectWorkspaceExports so it matches what the rule actually checks.

The old wording implied packages should configure ESM- and CommonJS-compatible exports; the constraint instead requires a single unconditional entrypoint (exports["."].types / default) and explicitly disallows separate require/import conditions plus legacy main/types. No runtime or manifest behavior changes—documentation only in yarn.config.cjs.

Reviewed by Cursor Bugbot for commit 7eb228e. Bugbot is set up for automated code reviews on this repo. Configure here.

@cryptodev-2s
cryptodev-2s deployed to default-branch September 15, 2026 13:43 — with GitHub Actions Active
@cryptodev-2s cryptodev-2s self-assigned this Sep 15, 2026
@cryptodev-2s
cryptodev-2s requested a review from a team September 15, 2026 13:43
@cryptodev-2s
cryptodev-2s added this pull request to the merge queue Sep 16, 2026

@Mrtenz Mrtenz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment is accurate actually.

@Mrtenz
Mrtenz removed this pull request from the merge queue due to a manual request Sep 16, 2026
Comment thread yarn.config.cjs Outdated
Comment on lines +171 to +172
// All non-root packages must set up ESM-only exports correctly (aside
// from tools).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be ESM-only if we used exports.import.types/default. exports.types/default keeps it possible to use require(esm) in CommonJS mode.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, reworded here 7eb228e

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I mean, the original comment is fine as-is, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right I did miss interpreted this

@cryptodev-2s
cryptodev-2s requested a review from Mrtenz September 16, 2026 12:31
@cryptodev-2s
cryptodev-2s deleted the chore/fix-stale-exports-comment branch September 16, 2026 12:40
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.

2 participants