Skip to content

Conversation

@jonathantneal
Copy link
Collaborator

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

This fixes the issue where importing { parse } from the package does not work without a sugary Babel transformation.

@shellscape
Copy link
Owner

You sir, are quick on the trigger! 😄

Is there a way to accomplish this without a copy of index.js? I am loathe to have near identical copies of a file to remember to keep up to date (not that they'd change often, but still).

@jonathantneal
Copy link
Collaborator Author

@shellscape, if you wish to support Node without Babel transformations, you would either need to 1. automate this transformation yourself before publishing (producing the git-hidden mjs/js derivatives, or 2. move those individual functions into their own files, keeping the exporting lib/index.js and lib/index.mjs files clean of functionality.

Many libraries do the former (1), but your library does not currently generate files for publishing so you may prefer the later (2).

@jonathantneal
Copy link
Collaborator Author

This PR may be closed if you do not wish to support native exports. I was mistaken in what I saw in the README and what I thought you intended to support. Apologies for any time wasted on my behalf.

@shellscape
Copy link
Owner

I'll have a look into generating the mjs file as part of a (Aw man I wish you would have left that comment unedited, it vanished while I was typing a response!) pre-something script (publish, probably). If you have anything to send me way as a jump start, that would be cool.

I'd like to leave this open while we explore a way to make this work for you and my time limits. Zero time wasted, no worries at all.

@shellscape
Copy link
Owner

So some good news for MJS fans - I've got a working pretest/prepublish build script that converts index.js to mjs automagically. Unfortunately the lib I found to get the job done has some dependencies that are wildly out of date, as such npm audit fails very hard. Waiting on that to get resolved, and then I'll push some updates to this PR.

@shellscape
Copy link
Owner

Closing this one. I don't think there's a need for this any longer. Please ping if anyone disagrees!

@shellscape shellscape closed this Jan 28, 2020
@jonathantneal jonathantneal deleted the fix/export branch April 15, 2020 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants