PoC: All runtimes support

This commit is contained in:
Matej Bačo
2023-09-13 18:33:27 +02:00
parent ba877ef36f
commit a40f72aac7
+36 -30
View File
@@ -1,3 +1,28 @@
const Runtimes = {
NODE: { name: 'node', versions: ['20.0', '19.0', '18.0', '16.0', '14.5'] },
PHP: { name: 'php', versions: ['8.2', '8.1', '8.0'] },
RUBY: { name: 'ruby', versions: ['3.2', '3.1', '3.0'] },
PYTHON: { name: 'python', versions: ['3.11', '3.10', '3.9', '3.8'] },
DART: { name: 'dart', versions: ['3.0', '2.19', '2.18', '2.17', '2.16', '2.16'] },
BUN: { name: 'bun', versions: ['1.0'] }
};
const getRuntimes = (
runtime: any,
commands: string,
entrypoint: string,
providerRootDirectory: string
) => {
return runtime.versions.map((version) => {
return {
name: `${runtime.name}-${version}`,
commands,
entrypoint,
providerRootDirectory
};
});
};
export const marketplace: MarketplaceTemplate[] = [
{
icon: 'icon-lightning-bolt',
@@ -11,36 +36,17 @@ export const marketplace: MarketplaceTemplate[] = [
timeout: 15,
usecases: ['Starter'],
runtimes: [
{
name: 'node-18.0',
commands: 'npm install',
entrypoint: 'src/main.js',
providerRootDirectory: 'node/starter'
},
{
name: 'php-8.0',
commands: 'composer install',
entrypoint: 'src/index.php',
providerRootDirectory: 'php/starter'
},
{
name: 'ruby-3.0',
commands: 'bundle install',
entrypoint: 'lib/main.rb',
providerRootDirectory: 'ruby/starter'
},
{
name: 'python-3.9',
commands: 'pip install -r requirements.txt',
entrypoint: 'src/main.py',
providerRootDirectory: 'python/starter'
},
{
name: 'dart-2.17',
commands: 'dart pub get',
entrypoint: 'lib/main.dart',
providerRootDirectory: 'dart/starter'
}
...getRuntimes(Runtimes.NODE, 'npm install', 'src/main.js', 'node/starter'),
...getRuntimes(Runtimes.PHP, 'composer install', 'src/index.php', 'php/starter'),
...getRuntimes(Runtimes.RUBY, 'bundle install', 'lib/main.rb', 'ruby/starter'),
...getRuntimes(
Runtimes.PYTHON,
'pip install -r requirements.txt',
'src/main.py',
'python/starter'
),
...getRuntimes(Runtimes.DART, 'dart pub get', 'lib/main.dart', 'dart/starter'),
...getRuntimes(Runtimes.BUN, 'bun install', 'src/main.ts', 'bun/starter')
],
instructions: `For documentation and instructions check out <a target="_blank" rel="noopener noreferrer" class="link" href="https://github.com/appwrite/templates/tree/main/node/starter">file</a>.`,
vcsProvider: 'github',