-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
fix: add back CJS support, with a test #154
Conversation
"@sindresorhus/is": "^6.0.0", | ||
"char-regex": "^2.0.0", | ||
"@sindresorhus/is": "^4.6.0", | ||
"char-regex": "^1.0.2", |
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.
#149 also broke CJS support with char-regex@2
.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 14
Lines 263 263
Branches 28 28
=========================================
Hits 263 263 ☔ View full report in Codecov by Sentry. |
FYI @omnidan - I can merge this in tomorrow if you don't have a chance to look (to unbreak what I broke over the weekend) |
assert.any([is.undefined, is.function], fallbackFunction) | ||
assert.function(format) | ||
is.assert.string(input) | ||
is.assert.any([is.default.undefined, is.default.function_], fallbackFunction) |
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.
I played around with these a bit but couldn't find anything cleaner. Ran out of time today. But not super please about using a .default.
🤔
@JoshuaKGoldberg please do so, I quickly checked and, while it is annoying that we have to downgrade, it is fine for now. We will have to look at dropping CJS support in the future I guess, but for now I believe it's still too frequently used. |
I think we have to stop the renovate bot from upgrading those packages though 😅 |
Yeah a test that fails on CJS breakages should stop it. Renovate can also be told to hush for particular packages |
PR Checklist
status: accepting prs
Overview
Downgrades
@sindresorhus/is
down to v4, its last major version that still supported CommonJS.Adds a test with a
.cjs
extension andrequire
that will fail if CommonJS support is broken again.Also adds explicit
exports.types
topackage.json
, as I've had to do that in past packages.