Skip to content

Commit

Permalink
Resolve punycode deprecation by redirecting imports to userland module
Browse files Browse the repository at this point in the history
This commit addresses the Node.js DEP0040 deprecation warning for the punycode module by adjusting Rollup's output.paths configuration.
  • Loading branch information
paulsutherland committed Mar 1, 2024
1 parent 3d24bbc commit 3b19921
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,30 @@ const tests = [
];

function surpressWarnings(message, warn) {
if (message.code === "CIRCULAR_DEPENDENCY") return;
warn(message);
if (message.code === "CIRCULAR_DEPENDENCY") return;

Check failure on line 46 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 1 tab but found 2 spaces

Check failure on line 46 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 1 tab but found 2 spaces

Check failure on line 46 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 1 tab but found 2 spaces
warn(message);

Check failure on line 47 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 1 tab but found 2 spaces

Check failure on line 47 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 1 tab but found 2 spaces

Check failure on line 47 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 1 tab but found 2 spaces
}

export default [
{
input: "lib/main.js",
external: [...externals],
output: {
file: "dist/main.cjs",
format: "cjs",
},
onwarn: surpressWarnings,
},
{
input: [...tests],
external: [...externals,...devExternals],
output: {
dir: "test/dist/",
format: "cjs",
},
onwarn: surpressWarnings,
},
];
{

Check failure on line 51 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 1 tab but found 2 spaces

Check failure on line 51 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 1 tab but found 2 spaces

Check failure on line 51 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 1 tab but found 2 spaces
input: "lib/main.js",

Check failure on line 52 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 2 tabs but found 4 spaces

Check failure on line 52 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 2 tabs but found 4 spaces

Check failure on line 52 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 2 tabs but found 4 spaces
external: [...externals],

Check failure on line 53 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 2 tabs but found 4 spaces

Check failure on line 53 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 2 tabs but found 4 spaces

Check failure on line 53 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 2 tabs but found 4 spaces
output: {

Check failure on line 54 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 2 tabs but found 4 spaces

Check failure on line 54 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 2 tabs but found 4 spaces

Check failure on line 54 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 2 tabs but found 4 spaces
file: "dist/main.cjs",

Check failure on line 55 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 3 tabs but found 6 spaces

Check failure on line 55 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 3 tabs but found 6 spaces

Check failure on line 55 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 3 tabs but found 6 spaces
format: "cjs",

Check failure on line 56 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 3 tabs but found 6 spaces

Check failure on line 56 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 3 tabs but found 6 spaces

Check failure on line 56 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 3 tabs but found 6 spaces
paths: {

Check failure on line 57 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 3 tabs but found 6 spaces

Check failure on line 57 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 3 tabs but found 6 spaces

Check failure on line 57 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 3 tabs but found 6 spaces
'punycode': 'punycode/',

Check failure on line 58 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (ubuntu-latest, 20.x)

Expected indentation of 4 tabs but found 8 spaces

Check failure on line 58 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 18.x)

Expected indentation of 4 tabs but found 8 spaces

Check failure on line 58 in rollup.config.js

View workflow job for this annotation

GitHub Actions / test_node (macos-latest, 20.x)

Expected indentation of 4 tabs but found 8 spaces
}
},
onwarn: surpressWarnings,
},
{
input: [...tests],
external: [...externals,...devExternals],
output: {
dir: "test/dist/",
format: "cjs",
},
onwarn: surpressWarnings,
},
];

0 comments on commit 3b19921

Please sign in to comment.