From ca65e01cacc5f93208e990a0cebb0d0fd7a08a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Sat, 3 May 2025 08:42:22 +0200 Subject: [PATCH 1/4] add currentCommand context --- tools/cli/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/cli/main.js b/tools/cli/main.js index a6742e3d08..6888765ad9 100644 --- a/tools/cli/main.js +++ b/tools/cli/main.js @@ -1544,6 +1544,9 @@ makeGlobalAsyncLocalStorage().run({}, async function () { }); } + // Set the currentCommand in the global object to spread context + global.currentCommand = { name: command.name, options }; + var ret = await command.func(options, { rawOptions }); } catch (e) { From 7c189700d50c45d8f3b8617b2809bd7e70ba3a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Sat, 3 May 2025 08:53:22 +0200 Subject: [PATCH 2/4] add METEOR_FORCE_INCLUDE_ARCHS and METEOR_FORCE_EXCLUDE_ARCHS envs to custom handling --- tools/cli/commands.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 5322a5dad0..2563973998 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -332,9 +332,21 @@ function filterWebArchs(webArchs, excludeArchsOption, appDir, options) { const excludeArchs = [...excludeArchsOptions, ...automaticallyIgnoredLegacyArchs]; webArchs = webArchs.filter(arch => !excludeArchs.includes(arch)); } - return webArchs; } } + + const forcedInclArchs = process.env.METEOR_FORCE_INCLUDE_ARCHS; + if (forcedInclArchs != null) { + const nextInclArchs = forcedInclArchs.trim().split(/\s*,\s*/); + webArchs = Array.from(new Set([...webArchs, ...nextInclArchs])); + } + + const forcedExclArchs = process.env.METEOR_FORCE_EXCLUDE_ARCHS; + if (forcedExclArchs != null) { + const nextExclArchs = forcedExclArchs.trim().split(/\s*,\s*/); + webArchs = webArchs.filter(_webArch => !nextExclArchs.includes(_webArch)); + } + return webArchs; } From 2dfcde49f57355f8b00a6a889bc5dc1954d4f01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Sat, 3 May 2025 09:07:20 +0200 Subject: [PATCH 3/4] add METEOR_CORDOVA_DISABLE env --- tools/cli/commands.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 2563973998..5cae318e1f 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -596,7 +596,8 @@ async function doRunCommand(options) { const buildMode = options.production ? 'production' : 'development'; let cordovaRunner; - if (!_.isEmpty(runTargets)) { + const shouldDisableCordova = Boolean(JSON.parse(process.env.METEOR_CORDOVA_DISABLE || 'false')); + if (!shouldDisableCordova && !_.isEmpty(runTargets)) { async function prepareCordovaProject() { import { CordovaProject } from '../cordova/project.js'; From 03080cfb23e6117ea59a226cb5254e8620e68a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Mon, 5 May 2025 16:32:21 +0200 Subject: [PATCH 4/4] resolve custom baseUrl to an absolute path pointing to the project root --- packages/babel-compiler/babel-compiler.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/babel-compiler/babel-compiler.js b/packages/babel-compiler/babel-compiler.js index aaec42177c..9824821746 100644 --- a/packages/babel-compiler/babel-compiler.js +++ b/packages/babel-compiler/babel-compiler.js @@ -153,6 +153,11 @@ BCp.initializeMeteorAppSwcrc = function () { lastModifiedSwcConfigTime = currentLastModifiedConfigTime; lastModifiedSwcConfig = getMeteorAppSwcrc(); + // Resolve custom baseUrl to an absolute path pointing to the project root + if (lastModifiedSwcConfig.jsc && lastModifiedSwcConfig.jsc.baseUrl) { + lastModifiedSwcConfig.jsc.baseUrl = path.resolve(process.cwd(), lastModifiedSwcConfig.jsc.baseUrl); + } + if (lastModifiedMeteorConfig?.modern?.transpiler?.verbose) { logConfigBlock('SWC Config', lastModifiedSwcConfig); }