From ce263876edacbc5ed5bce4d2190f87a0f4bcd33b Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Thu, 26 Nov 2026 21:51:49 +0100 Subject: [PATCH] Deploy with osls 4 by default, --osls3 to opt out --- src/Commands/Deploy.php | 4 +++- src/Components/ServerlessFramework.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Commands/Deploy.php b/src/Commands/Deploy.php index 338935a..e133bae 100644 --- a/src/Commands/Deploy.php +++ b/src/Commands/Deploy.php @@ -40,7 +40,9 @@ protected function configure(): void ->setName('deploy') ->setDescription('Deploy the application') ->addOption('force', null, InputOption::VALUE_NONE, 'Force the deployment') - ->addOption('osls4', null, InputOption::VALUE_NONE, 'Use osls@4 instead of osls@3') + ->addOption('osls3', null, InputOption::VALUE_NONE, 'Deploy with osls 3 instead of osls 4 (for applications that osls 4 rejects)') + // osls 4 is the default now, the option is kept for the scripts that pass it + ->addOption('osls4', null, InputOption::VALUE_NONE, 'Deprecated: osls 4 is the default') ->addOption('param', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Pass a parameter to serverless.yml, e.g. --param="key=value" (can be repeated)'); parent::configure(); } diff --git a/src/Components/ServerlessFramework.php b/src/Components/ServerlessFramework.php index 3aabdee..a3e8e8a 100644 --- a/src/Components/ServerlessFramework.php +++ b/src/Components/ServerlessFramework.php @@ -33,7 +33,8 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent if ($input->hasOption('force') && $input->getOption('force')) { $options[] = '--force'; } - $oslsPackage = ($input->hasOption('osls4') && $input->getOption('osls4')) ? 'osls@4' : 'osls@3'; + // A minimum version, not `osls@4`: npx would run any osls 4 already installed, e.g. one too old for Bref v4 + $oslsPackage = ($input->hasOption('osls3') && $input->getOption('osls3')) ? 'osls@3' : 'osls@^4.9.0'; $newLogs = ''; // The whole output ($newLogs is emptied when pushed to Bref Cloud)