appwrite/app/config/frameworks.php

158 lines
5.4 KiB
PHP
Raw Normal View History

2024-10-22 15:01:38 +00:00
<?php
/**
* List of Appwrite Sites supported frameworks
*/
2024-12-02 12:20:54 +00:00
// TODO: @Meldiron Angular
2024-10-27 15:34:49 +00:00
use Utopia\Config\Config;
$templateRuntimes = Config::getParam('template-runtimes');
2024-10-26 16:43:30 +00:00
2024-10-26 18:47:43 +00:00
function getVersions(array $versions, string $prefix)
{
2024-10-26 16:43:30 +00:00
return array_map(function ($version) use ($prefix) {
return $prefix . '-' . $version;
}, $versions);
2024-10-26 18:47:43 +00:00
}
2024-10-26 16:43:30 +00:00
2024-10-25 13:56:28 +00:00
return [
2024-10-26 16:43:30 +00:00
'sveltekit' => [
2024-10-25 13:56:28 +00:00
'key' => 'sveltekit',
'name' => 'SvelteKit',
2024-12-02 12:20:54 +00:00
'buildRuntime' => 'node-22',
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './build',
'startCommand' => 'sh helpers/server.sh',
'bundleCommand' => '',
],
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './build',
'startCommand' => 'sh helpers/sveltekit/server.sh',
'bundleCommand' => 'sh /usr/local/server/helpers/sveltekit/bundle.sh',
]
]
2024-11-22 13:15:37 +00:00
],
'astro' => [
'key' => 'astro',
'name' => 'Astro',
2024-12-02 12:20:54 +00:00
'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',
'bundleCommand' => '',
],
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist',
'startCommand' => 'sh helpers/astro/server.sh',
'bundleCommand' => 'sh /usr/local/server/helpers/astro/bundle.sh',
]
]
2024-11-22 13:15:37 +00:00
],
'remix' => [
'key' => 'remix',
'name' => 'Remix',
2024-12-02 12:20:54 +00:00
'buildRuntime' => 'node-22',
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './build/client',
'startCommand' => 'sh helpers/server.sh',
'bundleCommand' => '',
],
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './build',
'startCommand' => 'sh helpers/remix/server.sh',
'bundleCommand' => 'sh /usr/local/server/helpers/remix/bundle.sh',
]
]
],
'nuxt' => [
'key' => 'nuxt',
'name' => 'Nuxt',
'buildRuntime' => 'node-22',
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => 'npm run generate',
'installCommand' => 'npm install',
'outputDirectory' => './dist',
'startCommand' => 'sh helpers/server.sh',
'bundleCommand' => '',
],
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './.output',
'startCommand' => 'sh helpers/nuxt/server.sh',
'bundleCommand' => 'sh /usr/local/server/helpers/nuxt/bundle.sh',
]
]
],
'nextjs' => [
'key' => 'nextjs',
'name' => 'Next.js',
'buildRuntime' => 'node-22',
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './out',
'startCommand' => 'sh helpers/server.sh',
'bundleCommand' => '',
],
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './.next',
'startCommand' => 'sh helpers/next-js/server.sh',
'bundleCommand' => 'sh /usr/local/server/helpers/next-js/bundle.sh',
]
]
2024-10-26 16:43:30 +00:00
],
2024-11-25 16:48:15 +00:00
'flutter' => [
'key' => 'flutter',
'name' => 'Flutter',
2024-12-02 12:20:54 +00:00
'buildRuntime' => 'flutter-3.24',
'runtimes' => getVersions($templateRuntimes['FLUTTER']['versions'], 'flutter'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => 'flutter build web',
'installCommand' => '',
'outputDirectory' => './build/web',
'startCommand' => 'sh helpers/server.sh',
'bundleCommand' => '',
],
2024-10-25 13:56:28 +00:00
],
]
];