diff --git a/app/config/templates/site.php b/app/config/templates/site.php index 69339596f0..cf2ffff56c 100644 --- a/app/config/templates/site.php +++ b/app/config/templates/site.php @@ -135,6 +135,51 @@ return [ 'providerVersion' => '0.1.*', 'variables' => [] ], + [ + 'key' => 'starter-for-js', + 'name' => 'JavaScript starter', + 'useCases' => ['starter'], + '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', + 'providerRootDirectory' => './', + 'outputDirectory' => './dist', + ]), + ], + 'vcsProvider' => 'github', + 'providerRepositoryId' => 'starter-for-js', + 'providerOwner' => 'appwrite', + 'providerVersion' => '0.1.*', + 'variables' => [ + [ + 'name' => 'VITE_APPWRITE_ENDPOINT', + 'description' => 'Endpoint of Appwrite server', + 'value' => '{apiEndpoint}', + 'placeholder' => '{apiEndpoint}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'VITE_APPWRITE_PROJECT_ID', + 'description' => 'Your Appwrite project ID', + 'value' => '{projectId}', + 'placeholder' => '{projectId}', + 'required' => true, + 'type' => 'text' + ], + [ + 'name' => 'VITE_APPWRITE_PROJECT_NAME', + 'description' => 'Your Appwrite project name', + 'value' => '{projectName}', + 'placeholder' => '{projectName}', + 'required' => true, + 'type' => 'text' + ], + ] + ], [ 'key' => 'starter-for-svelte', 'name' => 'Svelte starter', diff --git a/public/images/sites/templates/starter-for-js-dark.png b/public/images/sites/templates/starter-for-js-dark.png new file mode 100644 index 0000000000..435b619f35 Binary files /dev/null and b/public/images/sites/templates/starter-for-js-dark.png differ diff --git a/public/images/sites/templates/starter-for-js-light.png b/public/images/sites/templates/starter-for-js-light.png new file mode 100644 index 0000000000..435b619f35 Binary files /dev/null and b/public/images/sites/templates/starter-for-js-light.png differ diff --git a/src/Appwrite/Platform/Tasks/Screenshot.php b/src/Appwrite/Platform/Tasks/Screenshot.php index f368660855..275b069f8c 100644 --- a/src/Appwrite/Platform/Tasks/Screenshot.php +++ b/src/Appwrite/Platform/Tasks/Screenshot.php @@ -137,11 +137,11 @@ class Screenshot extends Action 'name' => $template["name"], 'framework' => $framework['key'], 'adapter' => $framework['adapter'], - 'buildCommand' => $framework['buildCommand'], + 'buildCommand' => $framework['buildCommand'] ?? '', 'buildRuntime' => $framework['buildRuntime'], - 'fallbackFile' => $framework['fallbackFile'], - 'installCommand' => $framework['installCommand'], - 'outputDirectory' => $framework['outputDirectory'], + 'fallbackFile' => $framework['fallbackFile'] ?? '', + 'installCommand' => $framework['installCommand'] ?? '', + 'outputDirectory' => $framework['outputDirectory'] ?? '', 'providerRootDirectory' => $framework['providerRootDirectory'], 'timeout' => 60 ]); @@ -279,7 +279,6 @@ class Screenshot extends Action foreach ($themes as $theme) { $file = $client->call(Client::METHOD_GET, '/storage/buckets/screenshots/files/' . $theme['fileId'] . '/download', [ 'x-appwrite-project' => 'console', - 'x-appwrite-mode' => 'admin', 'cookie' => $cookieConsole ]);