Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to ES modules #308

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: migrate to ES modules #308

wants to merge 2 commits into from

Conversation

hlxid
Copy link
Member

@hlxid hlxid commented Dec 6, 2022

Closes codeoverflow-org/nodecg-io#829

This does run with node.js but only compiles using hacks and tests are failing because of (to me) mysterious errors.

Apparently, I am too dumb to understand ES modules given the time wasted on this, without getting it working.
The main two problems are:

  1. types require the actual module import (e.g. axios but node.js doesn't seem to understand the default export and requires axios.default. See my FIXME comments in the code. For axios this might be fixed by upgrading to an axios version that is written is ES modules (haven't tested that yet) but this still remains with CodeBlockWriter.
  2. Importing the isomorphic-git HTTP package fails in the tests because it assumes it to be commonjs and fails to parse the ES module of isomorphic-git even though es modules are enabled.

Config files (eslint, prettier, jest) are currently left at CommonJS and will be migrated if possible later.

I'll look into this later after some time has passed. Tips on what I am doing wrong are obviously very appreciated as well.

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