Tempaltes: Fix react native, add Angular

This commit is contained in:
Matej Bačo
2025-03-11 14:16:27 +01:00
parent 95e96b3bfb
commit b79b320414
7 changed files with 65 additions and 2 deletions
+54
View File
@@ -96,6 +96,16 @@ const TEMPLATE_FRAMEWORKS = [
'outputDirectory' => './dist',
'fallbackFile' => 'index.html',
],
'ANGULAR' => [
'key' => 'angular',
'name' => 'Angular',
'installCommand' => 'npm install',
'buildCommand' => 'npm run build',
'buildRuntime' => 'node-22',
'adapter' => 'static',
'outputDirectory' => './dist/angular/browser',
'fallbackFile' => 'index.html',
],
'VUE' => [
'key' => 'vue',
'name' => 'Vue.js',
@@ -180,6 +190,50 @@ return [
],
]
],
[
'key' => 'starter-for-angular',
'name' => 'Angular starter',
'useCases' => ['starter'],
'screenshotDark' => $url . '/images/sites/templates/starter-for-angular-dark.png',
'screenshotLight' => $url . '/images/sites/templates/starter-for-angular-light.png',
'frameworks' => [
getFramework('ANGULAR', [
'providerRootDirectory' => './',
'outputDirectory' => './dist/angular-starter-kit-for-appwrite/browser',
'buildCommand' => 'sh prepare-env.sh && npm run build'
]),
],
'vcsProvider' => 'github',
'providerRepositoryId' => 'starter-for-angular',
'providerOwner' => 'appwrite',
'providerVersion' => '0.1.*',
'variables' => [
[
'name' => 'APPWRITE_ENDPOINT',
'description' => 'Endpoint of Appwrite server',
'value' => '{apiEndpoint}',
'placeholder' => '{apiEndpoint}',
'required' => true,
'type' => 'text'
],
[
'name' => 'APPWRITE_PROJECT_ID',
'description' => 'Your Appwrite project ID',
'value' => '{projectId}',
'placeholder' => '{projectId}',
'required' => true,
'type' => 'text'
],
[
'name' => 'APPWRITE_PROJECT_NAME',
'description' => 'Your Appwrite project name',
'value' => '{projectName}',
'placeholder' => '{projectName}',
'required' => true,
'type' => 'text'
],
]
],
[
'key' => 'starter-for-svelte',
'name' => 'Svelte starter',
+1 -1
View File
@@ -206,7 +206,7 @@ services:
appwrite-console:
<<: *x-logging
container_name: appwrite-console
image: appwrite/console:5.3.0-sites-rc.18
image: appwrite/console:5.3.0-sites-rc.20
restart: unless-stopped
networks:
- appwrite
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

+10 -1
View File
@@ -46,6 +46,10 @@ class Screenshot extends Action
// Register
$email = uniqid() . 'user@localhost.test';
$password = 'password';
Console::info("Email: {$email}");
Console::info("Pass: {$password}");
$user = $client->call(Client::METHOD_POST, '/account', [
'content-type' => 'application/json',
'x-appwrite-project' => 'console',
@@ -214,12 +218,17 @@ class Screenshot extends Action
$deploymentId = $deployment['body']['$id'];
// Await screenshot
$attempts = 50;
$attempts = 60; // 5 min
$sleep = 5;
$idLight = '';
$idDark = '';
if ($templateId === 'starter-for-react-native') {
Console::warning("React Native template takes long to build, increasing waiting time ...");
$attempts = 180; // 15 min
}
Console::log("Awaiting deployment (every $sleep seconds, $attempts attempts)");
for ($i = 0; $i < $attempts; $i++) {