-
-
Notifications
You must be signed in to change notification settings - Fork 305
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] use file://
URLs for dynamic import()
#571
Conversation
This is required on Windows if the argument passed to `import()` is an absolute path. Without it `tape test.js` fails if test.js is ESM. Covered by existing tests: `node test/import.js` fails without this. See nodejs/node@a084632
CommonJS modules can no longer `require('hallmark')`. They must use ESM themselves, or a dynamic `import()`. For further guidance please see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c As for the `hallmark` CLI: in Node.js versions older than 14 it is now a noop. Needed for #80. Depends on tape-testing/tape#571
Codecov Report
@@ Coverage Diff @@
## master #571 +/- ##
=======================================
Coverage 96.49% 96.49%
=======================================
Files 4 4
Lines 627 627
Branches 145 145
=======================================
Hits 605 605
Misses 22 22 Continue to review full report at Codecov.
|
@vweevers and with this, do all the windows tests pass? or are there still some failures left. |
All but one ( Click to expand
And there's some problem with Click to expand
|
CommonJS modules can no longer `require('hallmark')`. They must use ESM themselves, or a dynamic `import()`. For further guidance please see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c As for the `hallmark` CLI: in Node.js versions older than 14 it is now a noop. Needed for #80. Depends on tape-testing/tape#571
- [Fix] use `file://` URLs for dynamic `import()` (#571, #559) - [readme] hard wraps bad, soft wraps good - [readme] fix markdown; github still has a rendering bug - [readme] add badges - [meta] Exclude `fs` from browser bundles (#565) - [Deps] update `glob`, `string.prototype.trim` - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `array.prototype.flatmap` - [actions] update codecov uploader - [Tests] handle carriage returns in stack traces on Windows - [Tests] node 17+ smooshes a version number on the end of the stack trace - [Tests] handle v8 6.9 changing an error message
Alternative to #559.
This is required on Windows if the argument passed to
import()
is an absolute path. Without ittape test.js
fails if test.js is ESM.Covered by existing tests:
node test/import.js
fails without this (as well as some other tests but those seem less relevant to the issue at hand).See nodejs/node@a084632