From 1a90c8aab57d516dce24c68081f4307de3a306de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 12 Mar 2025 12:39:33 +0100 Subject: [PATCH] Add Vite framework --- .env | 2 +- app/config/frameworks.php | 15 +++++++++++++++ app/config/specs/open-api3-latest-console.json | 2 ++ app/config/specs/open-api3-latest-server.json | 2 ++ app/config/specs/swagger2-latest-console.json | 2 ++ app/config/specs/swagger2-latest-server.json | 2 ++ app/config/templates/site.php | 14 ++++++++++---- 7 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 945680114f..e8427cab7c 100644 --- a/.env +++ b/.env @@ -82,7 +82,7 @@ _APP_EXECUTOR_SECRET=your-secret-key _APP_EXECUTOR_HOST=http://exc1/v1 _APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 _APP_SITES_RUNTIMES=static-1,node-22,flutter-3.29 -_APP_SITES_FRAMEWORKS=sveltekit,nextjs,nuxt,astro,remix,flutter,other,react,vue,analog,angular +_APP_SITES_FRAMEWORKS=sveltekit,nextjs,nuxt,astro,remix,flutter,other,react,vue,analog,angular,vite _APP_MAINTENANCE_INTERVAL=86400 _APP_MAINTENANCE_DELAY= _APP_MAINTENANCE_RETENTION_CACHE=2592000 diff --git a/app/config/frameworks.php b/app/config/frameworks.php index 1cb6ac811b..e1b31a28ec 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -233,6 +233,21 @@ return [ ], ], ], + 'vite' => [ + 'key' => 'vite', + 'name' => 'Vite', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/server.sh', + ], + ] + ], 'other' => [ 'key' => 'other', 'name' => 'Other', diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 5dbb4e6b05..32bf94c6c1 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -24723,6 +24723,7 @@ "astro", "remix", "flutter", + "vite", "other" ], "x-enum-name": null, @@ -25352,6 +25353,7 @@ "astro", "remix", "flutter", + "vite", "other" ], "x-enum-name": null, diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index d46cc5c898..84179be2cd 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -16820,6 +16820,7 @@ "astro", "remix", "flutter", + "vite", "other" ], "x-enum-name": null, @@ -17224,6 +17225,7 @@ "astro", "remix", "flutter", + "vite", "other" ], "x-enum-name": null, diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 8cbdb8accd..4eec95c22d 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -25226,6 +25226,7 @@ "astro", "remix", "flutter", + "vite", "other" ], "x-enum-name": null, @@ -25869,6 +25870,7 @@ "astro", "remix", "flutter", + "vite", "other" ], "x-enum-name": null, diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 6db3ed277f..74bf68b1df 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -17289,6 +17289,7 @@ "astro", "remix", "flutter", + "vite", "other" ], "x-enum-name": null, @@ -17711,6 +17712,7 @@ "astro", "remix", "flutter", + "vite", "other" ], "x-enum-name": null, diff --git a/app/config/templates/site.php b/app/config/templates/site.php index 2b3bf57599..e90b27d97e 100644 --- a/app/config/templates/site.php +++ b/app/config/templates/site.php @@ -86,6 +86,15 @@ const TEMPLATE_FRAMEWORKS = [ 'adapter' => 'static', 'fallbackFile' => 'index.html', ], + 'VITE' => [ + 'key' => 'vite', + 'name' => 'Vite', + 'installCommand' => 'npm install', + 'buildCommand' => 'npm run build', + 'buildRuntime' => 'node-22', + 'adapter' => 'static', + 'outputDirectory' => './dist', + ], 'REACT' => [ 'key' => 'react', 'name' => 'React', @@ -195,11 +204,8 @@ return [ 'screenshotDark' => $url . '/images/sites/templates/starter-for-js-dark.png', 'screenshotLight' => $url . '/images/sites/templates/starter-for-js-light.png', 'frameworks' => [ - getFramework('OTHER', [ - 'installCommand' => 'npm install', - 'buildCommand' => 'npm run build', + getFramework('VITE', [ 'providerRootDirectory' => './', - 'outputDirectory' => './dist', ]), ], 'vcsProvider' => 'github',