Skip to content

Commit 50458c3

Browse files
committed
refactor(sea): move default SOCKET_NODE_DOWNLOAD_URL to constants
Moved the default URL from inline fallback to the ENV constant definition for better maintainability. Changes: - constants.mjs: Set default 'https://nodejs.org/download/release' in ENV - build.mjs: Removed inline '|| default' fallback, use constant directly Benefits: - Single source of truth for default URL - Cleaner code in downloadNodeBinary() - Easier to update default URL in the future
1 parent 414922a commit 50458c3

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

packages/node-sea-builder/scripts/build.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ async function downloadNodeBinary(version, platform, arch) {
183183
// Alpine uses unofficial musl builds from unofficial-builds.nodejs.org.
184184
const baseUrl = isAlpine
185185
? 'https://unofficial-builds.nodejs.org/download/release'
186-
: constants.ENV.SOCKET_NODE_DOWNLOAD_URL ||
187-
'https://nodejs.org/download/release'
186+
: constants.ENV.SOCKET_NODE_DOWNLOAD_URL
188187

189188
const archMap = {
190189
x64: 'x64',

packages/node-sea-builder/scripts/constants.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { versionSemver: NODE_VERSION } = nodeVersionConfig
1111
// Environment variables (can override defaults).
1212
const ENV = {
1313
SOCKET_CLI_SEA_NODE_VERSION: process.env.SOCKET_CLI_SEA_NODE_VERSION || NODE_VERSION,
14-
SOCKET_NODE_DOWNLOAD_URL: process.env.SOCKET_NODE_DOWNLOAD_URL,
14+
SOCKET_NODE_DOWNLOAD_URL: process.env.SOCKET_NODE_DOWNLOAD_URL || 'https://nodejs.org/download/release',
1515
}
1616

1717
export default {

0 commit comments

Comments
 (0)