-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking: use ESM and drop Node.js < 14
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
- Loading branch information
Showing
9 changed files
with
144 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env node | ||
'use strict' | ||
|
||
// Must be CommonJS to support Node.js < 12.20 | ||
if (process.version.match(/^v(\d+)\./)[1] < 14) { | ||
// Return silently to support hallmark in 'npm test' | ||
console.error('Skipping hallmark: Node 14 or greater is required.') | ||
process.exit(0) | ||
} | ||
|
||
// Wrapped again to avoid 'Unexpected token import' | ||
require('./import-cli.cjs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict' | ||
|
||
import('../cli.js').catch(function (err) { | ||
console.error(err) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.