From 8a555fd294307a746f4256e889fedc99b0c72444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 15 May 2025 16:21:36 +0200 Subject: [PATCH] Add react native --- app/config/frameworks.php | 17 +++++++++++++++++ app/config/templates/site.php | 15 ++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/config/frameworks.php b/app/config/frameworks.php index ae9830314d..f4d8ec7ffa 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -260,6 +260,23 @@ return [ ], ], ], + 'react-native' => [ + 'key' => 'react-native', + 'name' => 'React Native', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/server.sh', + 'fallbackFile' => 'index.html' + ] + ] + ], 'vite' => [ 'key' => 'vite', 'name' => 'Vite', diff --git a/app/config/templates/site.php b/app/config/templates/site.php index 7f8951d0f9..ab6d5c4d4d 100644 --- a/app/config/templates/site.php +++ b/app/config/templates/site.php @@ -106,6 +106,16 @@ const TEMPLATE_FRAMEWORKS = [ 'outputDirectory' => './dist', 'fallbackFile' => 'index.html', ], + 'REACT_NATIVE' => [ + 'key' => 'react-native', + 'name' => 'React Native', + 'installCommand' => 'npm install', + 'buildCommand' => 'npm run build', + 'buildRuntime' => 'node-22', + 'adapter' => 'static', + 'outputDirectory' => './dist', + 'fallbackFile' => '+not-found.html', + ], 'ANGULAR' => [ 'key' => 'angular', 'name' => 'Angular', @@ -866,9 +876,8 @@ return [ 'screenshotDark' => $url . '/images/sites/templates/starter-for-react-native-dark.png', 'screenshotLight' => $url . '/images/sites/templates/starter-for-react-native-light.png', 'frameworks' => [ - getFramework('REACT', [ + getFramework('REACT_NATIVE', [ 'providerRootDirectory' => './', - 'fallbackFile' => '+not-found.html', ]), ], 'vcsProvider' => 'github', @@ -1332,7 +1341,7 @@ return [ 'screenshotDark' => $url . '/images/sites/templates/playground-for-react-native-dark.png', 'screenshotLight' => $url . '/images/sites/templates/playground-for-react-native-light.png', 'frameworks' => [ - getFramework('REACT', [ + getFramework('REACT_NATIVE', [ 'providerRootDirectory' => './react-native/starter', ]), ],