diff --git a/meteor b/meteor index ab1a946258..976947c7d4 100755 --- a/meteor +++ b/meteor @@ -1,6 +1,6 @@ #!/usr/bin/env bash -BUNDLE_VERSION=22.10.0.4 +BUNDLE_VERSION=22.10.0.5 # OS Check. Put here because here is where we download the precompiled @@ -123,6 +123,7 @@ fi DEV_BUNDLE="$SCRIPT_DIR/dev_bundle" METEOR="$SCRIPT_DIR/tools/index.js" +PROCESS_REQUIRES="$SCRIPT_DIR/tools/node-process-requires.js" # Set the nofile ulimit as high as permitted by the hard-limit/kernel if [ "$(ulimit -Sn)" != "unlimited" ]; then @@ -137,6 +138,11 @@ if [ "$(ulimit -Sn)" != "unlimited" ]; then fi fi +# By default, we disable all the Node warnings +# Then we re-enable the warning on tools/node-process-warning +# The advantage of this is that we have full control of which warning we want to suppress +export NODE_OPTIONS="--no-warnings" + # We used to set $NODE_PATH here to include the node_modules from the dev # bundle, but now we just get them from the symlink at tools/node_modules. This # is better because node_modules directories found via the ancestor walk from diff --git a/packages/accounts-2fa/.npm/package/npm-shrinkwrap.json b/packages/accounts-2fa/.npm/package/npm-shrinkwrap.json index 64d0411523..17d5ae8af2 100644 --- a/packages/accounts-2fa/.npm/package/npm-shrinkwrap.json +++ b/packages/accounts-2fa/.npm/package/npm-shrinkwrap.json @@ -2,9 +2,9 @@ "lockfileVersion": 4, "dependencies": { "@types/node": { - "version": "22.7.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.6.tgz", - "integrity": "sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw==" + "version": "22.8.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.1.tgz", + "integrity": "sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg==" }, "@types/notp": { "version": "2.0.5", diff --git a/packages/email/.npm/package/npm-shrinkwrap.json b/packages/email/.npm/package/npm-shrinkwrap.json index 68404a03da..662abdbb5a 100644 --- a/packages/email/.npm/package/npm-shrinkwrap.json +++ b/packages/email/.npm/package/npm-shrinkwrap.json @@ -2,9 +2,9 @@ "lockfileVersion": 4, "dependencies": { "@types/node": { - "version": "22.7.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.6.tgz", - "integrity": "sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw==" + "version": "22.8.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.1.tgz", + "integrity": "sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg==" }, "@types/nodemailer": { "version": "6.4.14", diff --git a/scripts/dev-bundle-tool-package.js b/scripts/dev-bundle-tool-package.js index 8c5632939b..ddaea69a84 100644 --- a/scripts/dev-bundle-tool-package.js +++ b/scripts/dev-bundle-tool-package.js @@ -11,7 +11,6 @@ var packageJson = { // Explicit dependency because we are replacing it with a bundled version // and we want to make sure there are no dependencies on a higher version npm: "10.9.0", - "module-alias": "2.2.3", "node-gyp": "10.2.0", "@mapbox/node-pre-gyp": "1.0.11", typescript: "5.6.3", diff --git a/tools/index.js b/tools/index.js index 26b786bb9e..5967be9ed7 100644 --- a/tools/index.js +++ b/tools/index.js @@ -1,24 +1,22 @@ +require("./node-process-warnings"); const { getChildProcess } = require("./cli/dev-bundle-bin-commands"); -const { setupAlias } = require("./module-alias-setup"); -getChildProcess({ isFirstTry: true }) - .then(setupAlias) - .then( - (child) => { - if (!child) { - // Use process.nextTick here to prevent the Promise from swallowing - // errors from the rest of the setup code. - process.nextTick(continueSetup); - } - // If we spawned a process to handle a dev_bundle/bin command like - // `meteor npm` or `meteor node`, then don't run any other tool code. - }, - (error) => { - process.nextTick(function () { - throw error; - }); +getChildProcess({ isFirstTry: true }).then( + (child) => { + if (!child) { + // Use process.nextTick here to prevent the Promise from swallowing + // errors from the rest of the setup code. + process.nextTick(continueSetup); } - ); + // If we spawned a process to handle a dev_bundle/bin command like + // `meteor npm` or `meteor node`, then don't run any other tool code. + }, + (error) => { + process.nextTick(function () { + throw error; + }); + } +); function continueSetup() { // Set up the Babel transpiler diff --git a/tools/module-alias-setup.js b/tools/module-alias-setup.js deleted file mode 100644 index be07159bb2..0000000000 --- a/tools/module-alias-setup.js +++ /dev/null @@ -1,39 +0,0 @@ -const path = require("path"); -const moduleAlias = require("module-alias"); -const { getDevBundleDir } = require("./cli/dev-bundle"); - -moduleAlias.addAlias("punycode", "punycode/"); - -/* -* A warning was introduced in Node 22: -* -* "The `punycode` module is deprecated. Please use a userland alternative instead." -* -* The problem is that punycode is deeply integrated in the Node system. It's not a -* simple direct dependency. -* -* Check these issues for more details: -* https://github.com/mathiasbynens/punycode.js/issues/137 -* https://stackoverflow.com/questions/68774489/punycode-is-deprecated-in-npm-what-should-i-replace-it-with/78946745 -* -* This warning was, besides being annoying, breaking our tests. -* -* The solution below uses module-alias to "change" the punycode's name. -*/ -async function setupPunycodeAlias() { - const devBundleDir = await getDevBundleDir(); - const nodeModulesPath = path.join(devBundleDir, "lib", "node_modules"); - process.env.NODE_OPTIONS = `${process.env.NODE_OPTIONS || ""} -r ${path.join( - nodeModulesPath, - "module-alias", - "register" - )}`; -} - -async function setupAlias() { - return setupPunycodeAlias(); -} - -module.exports = { - setupAlias, -}; diff --git a/tools/node-process-warnings.js b/tools/node-process-warnings.js new file mode 100644 index 0000000000..a96bee9d5b --- /dev/null +++ b/tools/node-process-warnings.js @@ -0,0 +1,20 @@ +process.on("warning", (warn) => { + if (warn.message.includes("punycode")) { + /* + * A warning was introduced in Node 22: + * + * "The `punycode` module is deprecated. Please use a userland alternative instead." + * + * The problem is that punycode is deeply integrated in the Node system. It's not a + * simple direct dependency. + * + * Check these issues for more details: + * https://github.com/mathiasbynens/punycode.js/issues/137 + * https://stackoverflow.com/questions/68774489/punycode-is-deprecated-in-npm-what-should-i-replace-it-with/78946745 + * + * This warning was, besides being annoying, breaking our tests. + */ + return; + } + console.warn(warn); +});