Visitar URL original
fix: export symbols for `declarations: true` by eranhirsch · Pull Request #1252 · remeda/remeda · GitHub
Skip to content

fix: export symbols for declarations: true - #1252

Merged
eranhirsch merged 5 commits into
mainfrom
eranhirsch/issue1175-2
Jan 13, 2026
Merged

eranhirsch merged 5 commits into
mainfrom
eranhirsch/issue1175-2

Conversation

@eranhirsch

Copy link
Copy Markdown
Member

Fixes: #1175

TypeScript is failing to serialize our internal types because the re-exported types can't access our internal symbols. Although we don't consider our internal symbols part of our API, we need them exported so we do this via our packaged monolith declaration file via an additional build step.

Copilot AI review requested due to automatic review settings January 13, 2026 16:28
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify

netlify Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for trusting-lumiere-9c7fad ready!

Name Link
🔨 Latest commit fa4d2ba
🔍 Latest deploy log https://app.netlify.com/projects/trusting-lumiere-9c7fad/deploys/696691fd9122ca00086f29de
😎 Deploy Preview https://deploy-preview-1252--trusting-lumiere-9c7fad.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4bdee70) to head (fa4d2ba).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1252   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          174       174           
  Lines         1622      1622           
  Branches       383       392    +9     
=========================================
  Hits          1622      1622           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Jan 13, 2026 •

Copy link
Copy Markdown

commit: fa4d2ba

Copilot AI 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.

Pull request overview

This pull request fixes TypeScript serialization errors (error TS2742) that occur when projects with declarations: true or composite: true try to re-export Remeda functions that return types using internal symbols. The fix exports internal branding symbols that TypeScript needs to properly serialize types in declaration files.

Changes:

  • Added a build step to export internal symbols through the main export statement in generated declaration files
  • Refactored type declaration update logic into a reusable helper function
  • Added defensive check to only write files when content actually changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/remeda/tsdown.config.ts Resolved

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/remeda/tsdown.config.ts Resolved
Comment thread packages/remeda/tsdown.config.ts Resolved
Comment thread packages/remeda/tsdown.config.ts Resolved
Comment thread packages/remeda/tsdown.config.ts Resolved
@eranhirsch
eranhirsch merged commit e3967b3 into main Jan 13, 2026
36 checks passed
@eranhirsch
eranhirsch deleted the eranhirsch/issue1175-2 branch January 13, 2026 18:46
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.33.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

exporting a function that returns a generic type based on the return type of remeda.values gives error TS2742 when there is "composite":true, "module": "node16" in tsconfig.json,

2 participants