appwrite/app/config/frameworks.php

313 lines
11 KiB
PHP
Raw Normal View History

2024-10-22 15:01:38 +00:00
<?php
/**
* List of Appwrite Sites supported frameworks
*/
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 [
2025-03-10 11:32:12 +00:00
'analog' => [
'key' => 'analog',
'name' => 'Analog',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-10 11:32:12 +00:00
'buildRuntime' => 'node-22',
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
2025-03-25 09:57:32 +00:00
'bundleCommand' => 'bash /usr/local/server/helpers/analog/bundle.sh',
2025-03-10 11:32:12 +00:00
'envCommand' => 'source /usr/local/server/helpers/analog/env.sh',
'adapters' => [
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist/analog',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/analog/server.sh',
2025-03-10 11:32:12 +00:00
],
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist/analog/public',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2025-03-10 11:32:12 +00:00
'fallbackFile' => 'index.html'
]
]
],
'angular' => [
'key' => 'angular',
'name' => 'Angular',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-10 11:32:12 +00:00
'buildRuntime' => 'node-22',
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
2025-03-25 09:57:32 +00:00
'bundleCommand' => 'bash /usr/local/server/helpers/angular/bundle.sh',
2025-03-10 11:32:12 +00:00
'envCommand' => 'source /usr/local/server/helpers/angular/env.sh',
'adapters' => [
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist/angular',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/angular/server.sh',
2025-03-10 11:32:12 +00:00
],
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist/angular/browser',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2025-03-10 11:32:12 +00:00
'fallbackFile' => 'index.csr.html'
]
]
],
2024-12-02 14:28:00 +00:00
'nextjs' => [
'key' => 'nextjs',
'name' => 'Next.js',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-07 14:46:49 +00:00
'buildRuntime' => 'node-22',
2024-12-02 12:20:54 +00:00
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
2025-03-25 09:57:32 +00:00
'bundleCommand' => 'bash /usr/local/server/helpers/next-js/bundle.sh',
2025-03-08 15:50:39 +00:00
'envCommand' => 'source /usr/local/server/helpers/next-js/env.sh',
2024-12-02 12:20:54 +00:00
'adapters' => [
2024-12-02 14:28:00 +00:00
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './.next',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/next-js/server.sh',
2024-12-02 14:28:00 +00:00
],
2024-12-02 12:20:54 +00:00
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
2024-12-02 14:28:00 +00:00
'outputDirectory' => './out',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2024-12-02 12:20:54 +00:00
]
]
2024-11-22 13:15:37 +00:00
],
2025-02-21 08:58:24 +00:00
'react' => [
'key' => 'react',
'name' => 'React',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-07 14:46:49 +00:00
'buildRuntime' => 'node-22',
2025-02-21 08:58:24 +00:00
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2025-02-21 08:58:24 +00:00
'fallbackFile' => 'index.html'
]
]
],
2024-12-02 14:28:00 +00:00
'nuxt' => [
'key' => 'nuxt',
'name' => 'Nuxt',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-07 14:46:49 +00:00
'buildRuntime' => 'node-22',
2024-12-02 12:20:54 +00:00
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
2025-03-25 09:57:32 +00:00
'bundleCommand' => 'bash /usr/local/server/helpers/nuxt/bundle.sh',
2025-03-08 15:50:39 +00:00
'envCommand' => 'source /usr/local/server/helpers/nuxt/env.sh',
2024-12-02 12:20:54 +00:00
'adapters' => [
2024-12-02 14:28:00 +00:00
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './.output',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/nuxt/server.sh',
2024-12-02 14:28:00 +00:00
],
2024-12-02 12:20:54 +00:00
'static' => [
'key' => 'static',
2024-12-02 14:28:00 +00:00
'buildCommand' => 'npm run generate',
2024-12-02 12:20:54 +00:00
'installCommand' => 'npm install',
2025-03-10 11:32:12 +00:00
'outputDirectory' => './output/public',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2024-12-02 12:20:54 +00:00
]
]
2024-11-22 13:15:37 +00:00
],
2025-02-21 09:51:53 +00:00
'vue' => [
'key' => 'vue',
'name' => 'Vue.js',
2025-03-26 11:59:05 +00:00
'screenshotSleep' => 5000,
2025-03-07 14:46:49 +00:00
'buildRuntime' => 'node-22',
2025-02-21 09:51:53 +00:00
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2025-02-21 09:51:53 +00:00
'fallbackFile' => 'index.html'
]
]
],
2024-12-02 14:28:00 +00:00
'sveltekit' => [
'key' => 'sveltekit',
'name' => 'SvelteKit',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-07 14:46:49 +00:00
'buildRuntime' => 'node-22',
2024-12-02 12:20:54 +00:00
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
2025-03-25 09:57:32 +00:00
'bundleCommand' => 'bash /usr/local/server/helpers/sveltekit/bundle.sh',
2025-03-08 15:50:39 +00:00
'envCommand' => 'source /usr/local/server/helpers/sveltekit/env.sh',
2024-12-02 12:20:54 +00:00
'adapters' => [
2024-12-02 14:28:00 +00:00
'ssr' => [
'key' => 'ssr',
2024-12-02 12:20:54 +00:00
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
2024-12-02 14:28:00 +00:00
'outputDirectory' => './build',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/sveltekit/server.sh',
2024-12-02 12:20:54 +00:00
],
2024-12-02 14:28:00 +00:00
'static' => [
'key' => 'static',
2024-12-02 12:20:54 +00:00
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './build',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2024-12-02 12:20:54 +00:00
]
]
],
2024-12-02 14:28:00 +00:00
'astro' => [
'key' => 'astro',
'name' => 'Astro',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-07 14:46:49 +00:00
'buildRuntime' => 'node-22',
2024-12-02 12:20:54 +00:00
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
2025-03-25 09:57:32 +00:00
'bundleCommand' => 'bash /usr/local/server/helpers/astro/bundle.sh',
2025-03-08 15:50:39 +00:00
'envCommand' => 'source /usr/local/server/helpers/astro/env.sh',
2024-12-02 12:20:54 +00:00
'adapters' => [
2024-12-02 14:28:00 +00:00
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/astro/server.sh',
2024-12-02 14:28:00 +00:00
],
2024-12-02 12:20:54 +00:00
'static' => [
'key' => 'static',
2024-12-02 14:28:00 +00:00
'buildCommand' => 'npm run build',
2024-12-02 12:20:54 +00:00
'installCommand' => 'npm install',
'outputDirectory' => './dist',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2024-12-02 12:20:54 +00:00
]
]
],
2024-12-02 14:28:00 +00:00
'remix' => [
'key' => 'remix',
'name' => 'Remix',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-07 14:46:49 +00:00
'buildRuntime' => 'node-22',
2024-12-02 12:20:54 +00:00
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
2025-03-25 09:57:32 +00:00
'bundleCommand' => 'bash /usr/local/server/helpers/remix/bundle.sh',
2025-03-08 15:50:39 +00:00
'envCommand' => 'source /usr/local/server/helpers/remix/env.sh',
2024-12-02 12:20:54 +00:00
'adapters' => [
2024-12-02 14:28:00 +00:00
'ssr' => [
'key' => 'ssr',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './build',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/remix/server.sh',
2024-12-02 14:28:00 +00:00
],
2024-12-02 12:20:54 +00:00
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
2024-12-02 14:28:00 +00:00
'outputDirectory' => './build/client',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2024-12-02 12:20:54 +00:00
]
]
2024-10-26 16:43:30 +00:00
],
2025-03-27 08:55:04 +00:00
'lynx' => [
'key' => 'lynx',
'name' => 'Lynx',
'screenshotSleep' => 5000,
'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'
]
]
],
2024-11-25 16:48:15 +00:00
'flutter' => [
'key' => 'flutter',
'name' => 'Flutter',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 5000,
2025-03-11 17:19:25 +00:00
'buildRuntime' => 'flutter-3.29',
2024-12-02 12:20:54 +00:00
'runtimes' => getVersions($templateRuntimes['FLUTTER']['versions'], 'flutter'),
'adapters' => [
'static' => [
'key' => 'static',
2025-05-15 09:50:09 +00:00
'buildCommand' => 'flutter build web --release -t lib/main.dart',
'installCommand' => 'flutter pub get',
2024-12-02 12:20:54 +00:00
'outputDirectory' => './build/web',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2024-12-02 12:20:54 +00:00
],
2024-10-25 13:56:28 +00:00
],
2024-12-02 14:05:26 +00:00
],
2025-05-15 14:21:36 +00:00
'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'
]
]
],
2025-03-12 11:39:33 +00:00
'vite' => [
'key' => 'vite',
'name' => 'Vite',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-12 11:39:33 +00:00
'buildRuntime' => 'node-22',
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => 'npm run build',
'installCommand' => 'npm install',
'outputDirectory' => './dist',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2025-03-12 11:39:33 +00:00
],
]
],
2024-12-02 14:05:26 +00:00
'other' => [
'key' => 'other',
'name' => 'Other',
2025-03-18 10:02:32 +00:00
'screenshotSleep' => 3000,
2025-03-07 14:46:49 +00:00
'buildRuntime' => 'node-22',
2024-12-02 14:05:26 +00:00
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
'adapters' => [
'static' => [
'key' => 'static',
'buildCommand' => '',
'installCommand' => '',
'outputDirectory' => './',
2025-03-25 09:57:32 +00:00
'startCommand' => 'bash helpers/server.sh',
2024-12-02 14:05:26 +00:00
],
]
],
2024-10-25 13:56:28 +00:00
];