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: overide punycode built-in module #32502

Merged
merged 2 commits into from
Nov 13, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/config-validator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
// istanbul ignore file
import 'source-map-support/register';
import './punycode.cjs';
import { dequal } from 'dequal';
import { pathExists, readFile } from 'fs-extra';
import { configFileNames } from './config/app-strings';
Expand Down
10 changes: 10 additions & 0 deletions lib/punycode.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* punycode workaround
*
* Load punycode.js module to cache and override node built-in.
*
* See <https://github.com/renovatebot/renovate/issues/32395>
*/
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('punycode/');
require.cache.punycode = require.cache[require.resolve('punycode/')];
1 change: 1 addition & 0 deletions lib/renovate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

import 'source-map-support/register';
import './punycode.cjs';
import { instrument, shutdown as telemetryShutdown } from './instrumentation'; // has to be imported before logger and other libraries which are instrumentalised
import { logger } from './logger';
import { bootstrap } from './proxy';
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
"parse-link-header": "2.0.0",
"prettier": "3.3.3",
"protobufjs": "7.4.0",
"punycode": "2.3.1",
"redis": "4.7.0",
"remark": "13.0.0",
"remark-github": "10.1.0",
Expand Down Expand Up @@ -300,6 +301,7 @@
"@types/ms": "0.7.34",
"@types/node": "20.17.6",
"@types/parse-link-header": "2.0.3",
"@types/punycode": "2.1.4",
"@types/semver": "7.5.8",
"@types/semver-stable": "3.0.2",
"@types/semver-utils": "1.1.3",
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.