Skip to content

fix: correct exports map ordering#1529

Merged
kevinports merged 1 commit into
nextfrom
fix/exports-node-condition-order
Jul 2, 2026
Merged

fix: correct exports map ordering#1529
kevinports merged 1 commit into
nextfrom
fix/exports-node-condition-order

Conversation

@kevinports

Copy link
Copy Markdown
Contributor
🎫 Resolve ISSUE_ID

Context

  1. In Add render-diff and render-fixture subpath exports + MDX↔MDXish regression suite #1489 we added an exports map to support new regression test exports

    markdown/package.json

    Lines 9 to 26 in 928b36e

    "exports": {
    ".": {
    "types": "./dist/index.d.ts",
    "browser": "./dist/main.js",
    "node": "./dist/main.node.js",
    "default": "./dist/main.node.js"
    },
    "./render-diff": {
    "types": "./dist/lib/render-diff/index.d.ts",
    "default": "./dist/render-diff.node.js"
    },
    "./render-fixture": {
    "types": "./dist/lib/render-fixture/index.d.ts",
    "default": "./dist/render-fixture.node.js"
    },
    "./package.json": "./package.json",
    "./*": "./*"
    },

    But the map listed "browser" first. Some tools (like Jest, when testing React components) ask for both "browser" and "node" at once so Jest kept receiving the browser file when it needs the node file.

  2. This caused these test failures in the monorepo https://github.com/readmeio/readme/actions/runs/28407377427/job/84174978249?pr=19434

  3. We added this fix which forces jest to use the node file. But a simpler fix is to just re-order the entries in the @readme/markdown package

🎯 What does this PR do?

  • Fix the ordering of entries so we can clean up the monorepo bandaid
  • Export some types so we can use them correctly in the monorepo

🧪 QA tips

  • [ ]

📸 Screenshot or Loom

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b39a5e21-1f41-499d-9ddb-e94a9827fbc1

📥 Commits

Reviewing files that changed from the base of the PR and between 190e711 and e3f588e.

📒 Files selected for processing (3)
  • index.tsx
  • lib/index.ts
  • package.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • readmeio/ai (manual)
  • readmeio/gitto (manual)
  • readmeio/markdown (manual)
  • readmeio/readme (manual)

Walkthrough

This change adds TypeScript type re-exports for MdxishOpts, RenderMdxishOpts, and RunOpts in index.tsx and RunOpts in lib/index.ts, extending the module's public API surface. Additionally, package.json's exports["."] condition map was updated to list the node condition before the browser condition, reversing their previous order.

Changes

Area Change
index.tsx Added export type { MdxishOpts, RenderMdxishOpts, RunOpts } from './lib'
lib/index.ts Added export type { RunOpts } from './run'
package.json Reordered node/browser entries in exports["."]

Related PRs: None identified.

Suggested labels: types, dependencies

Suggested reviewers: None identified.

Poem
A rabbit hops through types anew,
RunOpts and Mdxish peeking through,
Node now leads where browser led,
Exports reordered, cleanly bred,
Small hops, big API view. 🐇

Warning

Tools execution failed with the following error:

Failed to run tools: 14 UNAVAILABLE: read ECONNRESET


Comment @coderabbitai help to get the list of available commands.

@kevinports kevinports merged commit 08a63dd into next Jul 2, 2026
8 checks passed
@kevinports kevinports deleted the fix/exports-node-condition-order branch July 2, 2026 14:06
rafegoldberg pushed a commit that referenced this pull request Jul 2, 2026
## Version 14.11.0
### ✨ New & Improved

* **mdxish:** replace brace-escaping preprocessing with lenient expression tokenizer ([#1531](#1531)) ([5c5a57c](5c5a57c))
* **mdxish:** support library imports in declarations ([#1530](#1530)) ([fa6ee97](fa6ee97))

### 🛠 Fixes & Updates

* correct exports map ordering ([#1529](#1529)) ([08a63dd](08a63dd))

<!--SKIP CI-->
@rafegoldberg

Copy link
Copy Markdown
Collaborator

This PR was released!

🚀 Changes included in v14.11.0

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants