Add more defaults to frameworks

This commit is contained in:
Matej Bačo
2024-11-22 14:55:52 +01:00
parent a5fc2e0ef7
commit 0d314c00a6
7 changed files with 222 additions and 79 deletions
@@ -28,12 +28,6 @@ class Framework extends Model
'default' => '',
'example' => 'sveltekit.png',
])
->addRule('defaultServeRuntime', [
'type' => self::TYPE_STRING,
'description' => 'Default runtime version.',
'default' => '',
'example' => 'static-1',
])
->addRule('serveRuntimes', [
'type' => self::TYPE_STRING,
'description' => 'List of supported runtime versions.',
@@ -41,12 +35,6 @@ class Framework extends Model
'example' => 'static-1',
'array' => true,
])
->addRule('defaultBuildRuntime', [
'type' => self::TYPE_STRING,
'description' => 'Default runtime version.',
'default' => '',
'example' => 'node-22',
])
->addRule('buildRuntimes', [
'type' => self::TYPE_STRING,
'description' => 'List of supported runtime versions.',
@@ -54,6 +42,36 @@ class Framework extends Model
'example' => 'node-21.0',
'array' => true,
])
->addRule('defaultServeRuntime', [
'type' => self::TYPE_STRING,
'description' => 'Default runtime version.',
'default' => '',
'example' => 'static-1',
])
->addRule('defaultBuildRuntime', [
'type' => self::TYPE_STRING,
'description' => 'Default runtime version.',
'default' => '',
'example' => 'node-22',
])
->addRule('defaultInstallCommand', [
'type' => self::TYPE_STRING,
'description' => 'Default command to download dependencies.',
'default' => '',
'example' => 'npm install',
])
->addRule('defaultBuildCommand', [
'type' => self::TYPE_STRING,
'description' => 'Default command to build site into output directory.',
'default' => '',
'example' => 'npm run build',
])
->addRule('defaultOutputDirectory', [
'type' => self::TYPE_STRING,
'description' => 'Default output directory of build.',
'default' => '',
'example' => './dist',
])
;
}
@@ -10,18 +10,18 @@ class TemplateFramework extends Model
public function __construct()
{
$this
->addRule('key', [
'type' => self::TYPE_STRING,
'description' => 'Parent framework key.',
'default' => '',
'example' => 'sveltekit',
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Framework Name.',
'default' => '',
'example' => 'SvelteKit'
])
->addRule('key', [
'type' => self::TYPE_STRING,
'description' => 'Parent framework key.',
'default' => '',
'example' => 'sveltekit',
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Framework Name.',
'default' => '',
'example' => 'SvelteKit'
])
->addRule('installCommand', [
'type' => self::TYPE_STRING,
'description' => 'The install command used to install the dependencies.',