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: support CJS configs in ES packages #553
Conversation
Sorry for direct pings: @astone123 - I see you have merged pull requests before. This PR has been out for well over a year now. Any chance it can get reviewed? |
Hi @CharlesStover , sorry for the VERY slow response! This PR must have gotten lost in the shuffle. We have since implemented a more robust triage process to make sure issues do not sit like that going forward. I will have the team discuss this PR and see how we would like to proceed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine - it looks like you've followed the existing pattern, so I don't see any blocker on merging this.
I'd generally like to see a test, but we haven't got any of the other permutations - I'm not sure how much work it would be to add some tests around the various module formats, but since this follows and existing pattern, I think we can merge this up as is. CI is green, so I'm reasonably confident. Let me find one more reviewer. |
|
Hey @CharlesStover, just waiting on our infosec team to update the Snyk API key so the scan can run and we can ship this. I'm sorry for the delay. |
YES!!!! 🚀 |
🎉 This PR is included in version 3.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Problem statement
When writing an application with
"type": "module"
inpackage.json
, it becomes impossible to set the NYC config with JS, since it only supports the.js
extension and it only supports CommonJS. As a result, any configuration innyc.config.js
will fail for trying torequire
an ES module.This PR adds support for
nyc.config.cjs
, allowing packages with"type": "module"
to still configure anyc.config.cjs
file for a CommonJS configuration.