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

Fix compatibility with node 18 #50

Merged
merged 1 commit into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [12, 14, 16]
node: [12, 14, 16, 18]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# Only run one Node version on Windows
include:
- os: windows-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
TODO.md
.idea
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function cacheDir(cacheDirPath) {

function cacheFile(tzdata, config, cacheDirPath) {
const key = cacheKey(tzdata, config);
const filename = crypto.createHash('md4')
const filename = crypto.createHash('md5')
.update(key)
.digest('hex') + '.json';
const filepath = path.join(cacheDir(cacheDirPath), filename);
Expand Down
3 changes: 2 additions & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ const rGeneratedFile = /[\\/]node_modules[\\/]\.cache[\\/]moment-timezone-data-w
function buildWebpack(pluginOptions, testOptions = {}) {
const compilerOptions = {
mode: 'development',
devtool: 'hidden-source-map',
devtool: 'eval',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a particular reason for this change? Just curious. (hidden-source-map is my usual default for dev projects, but in these tests it doesn't really matter.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hidden-source-map option also uses md4 hashing so throws the same error. I couldn't see an option to change this so just changed the source map option to something that didn't use md4

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, that makes sense. 😄

entry: path.resolve(__dirname, 'fixtures', 'index.js'),
output: {
path: __dirname,
filename: 'test-output.[filehash].js',
hashFunction: 'md5'
},
plugins: [
new MomentTimezoneDataPlugin(pluginOptions),
Expand Down