From bcafec734df03c5e6f17bd4e01053730513342ee Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:11:14 +0100 Subject: [PATCH] fix: reorder templates --- app/config/function-templates.php | 60 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/app/config/function-templates.php b/app/config/function-templates.php index dddd8596f4..d125405ee4 100644 --- a/app/config/function-templates.php +++ b/app/config/function-templates.php @@ -5,14 +5,6 @@ const TEMPLATE_RUNTIMES = [ 'name' => 'node', 'versions' => ['21.0', '20.0', '19.0', '18.0', '16.0', '14.5'] ], - 'PHP' => [ - 'name' => 'php', - 'versions' => ['8.3', '8.2', '8.1', '8.0'] - ], - 'RUBY' => [ - 'name' => 'ruby', - 'versions' => ['3.3', '3.2', '3.1', '3.0'] - ], 'PYTHON' => [ 'name' => 'python', 'versions' => ['3.12', '3.11', '3.10', '3.9', '3.8'] @@ -21,14 +13,22 @@ const TEMPLATE_RUNTIMES = [ 'name' => 'dart', 'versions' => ['3.3', '3.1', '3.0', '2.19', '2.18', '2.17', '2.16', '2.16'] ], + 'GO' => [ + 'name' => 'go', + 'versions' => ['1.22'] + ], + 'PHP' => [ + 'name' => 'php', + 'versions' => ['8.3', '8.2', '8.1', '8.0'] + ], 'BUN' => [ 'name' => 'bun', 'versions' => ['1.0'] ], - 'GO' => [ - 'name' => 'go', - 'versions' => ['1.22'] - ] + 'RUBY' => [ + 'name' => 'ruby', + 'versions' => ['3.3', '3.2', '3.1', '3.0'] + ], ]; function getRuntimes($runtime, $commands, $entrypoint, $providerRootDirectory, $versionsDenyList = []) @@ -59,13 +59,6 @@ return [ 'useCases' => ['starter'], 'runtimes' => [ ...getRuntimes(TEMPLATE_RUNTIMES['NODE'], 'npm install', 'src/main.js', 'node/starter'), - ...getRuntimes( - TEMPLATE_RUNTIMES['PHP'], - 'composer install', - 'src/index.php', - 'php/starter' - ), - ...getRuntimes(TEMPLATE_RUNTIMES['RUBY'], 'bundle install', 'lib/main.rb', 'ruby/starter'), ...getRuntimes( TEMPLATE_RUNTIMES['PYTHON'], 'pip install -r requirements.txt', @@ -73,8 +66,15 @@ return [ 'python/starter' ), ...getRuntimes(TEMPLATE_RUNTIMES['DART'], 'dart pub get', 'lib/main.dart', 'dart/starter'), + ...getRuntimes(TEMPLATE_RUNTIMES['GO'], '', 'main.go', 'go/starter'), + ...getRuntimes( + TEMPLATE_RUNTIMES['PHP'], + 'composer install', + 'src/index.php', + 'php/starter' + ), ...getRuntimes(TEMPLATE_RUNTIMES['BUN'], 'bun install', 'src/main.ts', 'bun/starter'), - ...getRuntimes(TEMPLATE_RUNTIMES['GO'], '', 'main.go', 'go/starter') + ...getRuntimes(TEMPLATE_RUNTIMES['RUBY'], 'bundle install', 'lib/main.rb', 'ruby/starter'), ], 'instructions' => 'For documentation and instructions check out file.', 'vcsProvider' => 'github', @@ -836,6 +836,12 @@ return [ 'src/main.py', 'python/whatsapp_with_vonage' ), + ...getRuntimes( + TEMPLATE_RUNTIMES['DART'], + 'dart pub get', + 'lib/main.dart', + 'dart/whatsapp-with-vonage' + ), ...getRuntimes( TEMPLATE_RUNTIMES['PHP'], 'composer install', @@ -843,10 +849,10 @@ return [ 'php/whatsapp-with-vonage' ), ...getRuntimes( - TEMPLATE_RUNTIMES['DART'], - 'dart pub get', - 'lib/main.dart', - 'dart/whatsapp-with-vonage' + TEMPLATE_RUNTIMES['BUN'], + 'bun install', + 'src/main.ts', + 'bun/whatsapp-with-vonage' ), ...getRuntimes( TEMPLATE_RUNTIMES['RUBY'], @@ -854,12 +860,6 @@ return [ 'lib/main.rb', 'ruby/whatsapp-with-vonage' ), - ...getRuntimes( - TEMPLATE_RUNTIMES['BUN'], - 'bun install', - 'src/main.ts', - 'bun/whatsapp-with-vonage' - ) ], 'instructions' => 'For documentation and instructions check out file.', 'vcsProvider' => 'github',