Skip to content

chore: "hide" ./defaultWorker entrypoint with types: null#9485

Merged
kodiakhq[bot] merged 7 commits intodiscordjs:mainfrom
Andarist:fix/types-condition
May 5, 2023
Merged

chore: "hide" ./defaultWorker entrypoint with types: null#9485
kodiakhq[bot] merged 7 commits intodiscordjs:mainfrom
Andarist:fix/types-condition

Conversation

@Andarist
Copy link
Copy Markdown
Contributor

@Andarist Andarist commented May 1, 2023

I moved types condition to the front. package.json#exports are order-sensitive - they are always matched from the top to the bottom. When a match is found then it should be used and no further matching should occur.

Right now, the current setup works in TypeScript but it's considered a bug and it should not be relied upon, see the thread and the comment here. For that reason, I would like to fix all popular packages that misconfigured their exports this way so the bug can be fixed in TypeScript.

⚠️ this PR focuses solely on fixing "🐛 Used fallback condition" problem but the "🎭 Masquerading as CJS" remains here. You can check how such an error is reported here

This is basically the same kind of a PR that was already merged in here: discordjs/discord-api-types#763

@Andarist Andarist requested review from a team as code owners May 1, 2023 12:01
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
discord-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2023 8:11pm
discord-js-guide ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2023 8:11pm

@Andarist Andarist changed the title fix: move types condition to the front chore: "hide" ./defaultWorker entrypoint with types: null May 5, 2023
@Andarist
Copy link
Copy Markdown
Contributor Author

Andarist commented May 5, 2023

@didinele adjusted the content and the PR's title, would you mind taking another look?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 99
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 100
🟠 PWA 70

Lighthouse ran on https://discord-js-git-fork-andarist-fix-types-condition-discordjs.vercel.app/

@Jiralite Jiralite self-assigned this May 5, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2023

Codecov Report

Merging #9485 (2719b97) into main (3e80f0b) will decrease coverage by 0.03%.
The diff coverage is n/a.

❗ Current head 2719b97 differs from pull request most recent head 49ab527. Consider uploading reports for the commit 49ab527 to get more accurate results

@@            Coverage Diff             @@
##             main    #9485      +/-   ##
==========================================
- Coverage   58.56%   58.53%   -0.03%     
==========================================
  Files         226      227       +1     
  Lines       14762    14769       +7     
  Branches     1266     1267       +1     
==========================================
  Hits         8645     8645              
- Misses       6077     6084       +7     
  Partials       40       40              
Flag Coverage Δ
next ∅ <ø> (∅)
ws 54.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants