Skip to content

Make exported symbols on exports enumerable#19

Open
andsens wants to merge 1 commit into
winstonjs:masterfrom
orbit-online:fix-enumerable-symbols
Open

Make exported symbols on exports enumerable#19
andsens wants to merge 1 commit into
winstonjs:masterfrom
orbit-online:fix-enumerable-symbols

Conversation

@andsens

@andsens andsens commented Dec 4, 2024

Copy link
Copy Markdown

For reference: oven-sh/bun#4432 (comment)

Currently bun cannot import triple-beam symbols because of this issue.

It's probably a good idea to make the exports enumerable anyways.

EDIT: Replaces #18

@andsens

andsens commented Dec 4, 2024

Copy link
Copy Markdown
Author

Workaround for people using bun:

patches/triple-beam@1.4.1.patch
diff --git a/config/index.js b/config/index.js
index 96b6566d640c6daa3f6e75835619deabd006eb97..6e21e1e561ce0383c0ee1615c940f3c4cdcd5f67 100644
--- a/config/index.js
+++ b/config/index.js
@@ -12,6 +12,7 @@
  * @type {Object}
  */
 Object.defineProperty(exports, 'cli', {
+  enumerable: true,
   value: require('./cli')
 });
 
@@ -20,6 +21,7 @@ Object.defineProperty(exports, 'cli', {
  * @type {Object}
  */
 Object.defineProperty(exports, 'npm', {
+  enumerable: true,
   value: require('./npm')
 });
 
@@ -28,5 +30,6 @@ Object.defineProperty(exports, 'npm', {
  * @type {Object}
  */
 Object.defineProperty(exports, 'syslog', {
+  enumerable: true,
   value: require('./syslog')
 });
diff --git a/index.js b/index.js
index cf89cf0639480e602f5e42a0e808691d8e48526a..d0bf22afe98ef77eb4621bc66b253308e12ef3e9 100644
--- a/index.js
+++ b/index.js
@@ -9,6 +9,7 @@
  * @type {Symbol}
  */
 Object.defineProperty(exports, 'LEVEL', {
+  enumerable: true,
   value: Symbol.for('level')
 });
 
@@ -21,6 +22,7 @@ Object.defineProperty(exports, 'LEVEL', {
  * @type {Symbol}
  */
 Object.defineProperty(exports, 'MESSAGE', {
+  enumerable: true,
   value: Symbol.for('message')
 });
 
@@ -32,6 +34,7 @@ Object.defineProperty(exports, 'MESSAGE', {
  * @type {Symbol}
  */
 Object.defineProperty(exports, 'SPLAT', {
+  enumerable: true,
   value: Symbol.for('splat')
 });
 
@@ -42,5 +45,6 @@ Object.defineProperty(exports, 'SPLAT', {
  * @type {Object}
  */
 Object.defineProperty(exports, 'configs', {
+  enumerable: true,
   value: require('./config')
 });

Reference the patch in your package.json with

{
  "patchedDependencies": {
    "triple-beam@1.4.1": "patches/triple-beam@1.4.1.patch"
  }
}

@andsens

andsens commented Feb 17, 2026

Copy link
Copy Markdown
Author

*bump

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.

1 participant