[PR #84] [MERGED] fix: allow explicit ESM import #92

Closed
opened 2026-02-16 12:27:00 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/stoatchat/javascript-client-sdk/pull/84
Author: @williamhorning
Created: 7/9/2023
Status: Merged
Merged: 6/8/2024
Merged by: @insertish

Base: masterHead: fix-explicit-esm


📝 Commits (7)

  • 68e3de9 fix: allow explicit ESM import
  • 2331d71 Merge branch 'master' into fix-explicit-esm
  • a451a61 Merge branch 'revoltchat:master' into fix-explicit-esm
  • 1333735 Merge branch 'master' into fix-explicit-esm
  • d172d54 Merge branch 'master' into fix-explicit-esm
  • 1a41abf update PR
  • d7468a5 Merge branch revoltchat:master into fix-explicit-esm

📊 Changes

53 files changed (+211 additions, -174 deletions)

View changed files

package-esm.json (+3 -0)
📝 package.json (+2 -2)
📝 src/Client.ts (+14 -7)
📝 src/classes/Bot.ts (+1 -1)
📝 src/classes/Channel.ts (+7 -4)
📝 src/classes/ChannelUnread.ts (+1 -1)
📝 src/classes/ChannelWebhook.ts (+2 -2)
📝 src/classes/Emoji.ts (+1 -1)
📝 src/classes/File.ts (+1 -1)
📝 src/classes/Invite.ts (+1 -1)
📝 src/classes/MFA.ts (+1 -1)
📝 src/classes/Message.ts (+2 -2)
📝 src/classes/MessageEmbed.ts (+1 -1)
📝 src/classes/PublicBot.ts (+1 -1)
📝 src/classes/PublicInvite.ts (+2 -2)
📝 src/classes/Server.ts (+12 -9)
📝 src/classes/ServerBan.ts (+1 -1)
📝 src/classes/ServerMember.ts (+9 -6)
📝 src/classes/Session.ts (+1 -1)
📝 src/classes/SystemMessage.ts (+1 -1)

...and 33 more files

📄 Description

This pull request fixes #83 by updating the build step to add a package.json to the lib/esm directory when building to allow people to explicitly import the ESM version when using something like Deno. It also updates all directory imports, making them explicitly import index.js so they don't throw ERR_UNSUPPORTED_DIR_IMPORT errors. This also fixes the issues fixed by #80.

  • I understand and have followed the contribution guide
  • I have tested my changes locally and they are working as intended (see test.mjs)
  • These changes do not have any notable side effects on other Revolt projects

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/stoatchat/javascript-client-sdk/pull/84 **Author:** [@williamhorning](https://github.com/williamhorning) **Created:** 7/9/2023 **Status:** ✅ Merged **Merged:** 6/8/2024 **Merged by:** [@insertish](https://github.com/insertish) **Base:** `master` ← **Head:** `fix-explicit-esm` --- ### 📝 Commits (7) - [`68e3de9`](https://github.com/stoatchat/javascript-client-sdk/commit/68e3de9bccd482a2a3e99ecc539e7b9436ed42b5) fix: allow explicit ESM import - [`2331d71`](https://github.com/stoatchat/javascript-client-sdk/commit/2331d71f3fa61cbf57e58f13b877897e23778569) Merge branch 'master' into fix-explicit-esm - [`a451a61`](https://github.com/stoatchat/javascript-client-sdk/commit/a451a61773bdfeff7238fa98b302aa2c08dd23c6) Merge branch 'revoltchat:master' into fix-explicit-esm - [`1333735`](https://github.com/stoatchat/javascript-client-sdk/commit/13337357b91b90a220a167dd7d357b9351788cb6) Merge branch 'master' into fix-explicit-esm - [`d172d54`](https://github.com/stoatchat/javascript-client-sdk/commit/d172d540ef9e70ddc4db04e22f3148daba1dae73) Merge branch 'master' into fix-explicit-esm - [`1a41abf`](https://github.com/stoatchat/javascript-client-sdk/commit/1a41abfbef5502a63cf01aba4ab31043183355da) update PR - [`d7468a5`](https://github.com/stoatchat/javascript-client-sdk/commit/d7468a5ea983ec70e4c652c27a3f063c5a3d1168) Merge branch `revoltchat:master` into fix-explicit-esm ### 📊 Changes **53 files changed** (+211 additions, -174 deletions) <details> <summary>View changed files</summary> ➕ `package-esm.json` (+3 -0) 📝 `package.json` (+2 -2) 📝 `src/Client.ts` (+14 -7) 📝 `src/classes/Bot.ts` (+1 -1) 📝 `src/classes/Channel.ts` (+7 -4) 📝 `src/classes/ChannelUnread.ts` (+1 -1) 📝 `src/classes/ChannelWebhook.ts` (+2 -2) 📝 `src/classes/Emoji.ts` (+1 -1) 📝 `src/classes/File.ts` (+1 -1) 📝 `src/classes/Invite.ts` (+1 -1) 📝 `src/classes/MFA.ts` (+1 -1) 📝 `src/classes/Message.ts` (+2 -2) 📝 `src/classes/MessageEmbed.ts` (+1 -1) 📝 `src/classes/PublicBot.ts` (+1 -1) 📝 `src/classes/PublicInvite.ts` (+2 -2) 📝 `src/classes/Server.ts` (+12 -9) 📝 `src/classes/ServerBan.ts` (+1 -1) 📝 `src/classes/ServerMember.ts` (+9 -6) 📝 `src/classes/Session.ts` (+1 -1) 📝 `src/classes/SystemMessage.ts` (+1 -1) _...and 33 more files_ </details> ### 📄 Description This pull request fixes #83 by updating the build step to add a package.json to the `lib/esm` directory when building to allow people to explicitly import the ESM version when using something like Deno. It also updates all directory imports, making them explicitly import `index.js` so they don't throw `ERR_UNSUPPORTED_DIR_IMPORT` errors. This also fixes the issues fixed by #80. * [X] I understand and have followed the [contribution guide](https://github.com/revoltchat/revolt/discussions/282) * [X] I have tested my changes locally and they are working as intended (see `test.mjs`) * [X] These changes do not have any notable side effects on other Revolt projects --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 12:27:00 -05:00
yindo closed this issue 2026-02-16 12:27:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/javascript-client-sdk#92