mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-04 10:25:33 +01:00
refactor: rename node
to typescript
This commit is contained in:
parent
5f14dba7ad
commit
022315edd3
5 changed files with 7 additions and 7 deletions
|
@ -78,10 +78,10 @@ final class CreateListOfFilesToGenerate
|
|||
}
|
||||
}
|
||||
|
||||
if (static::isNode(Arr::get($configurationData, 'language'))) {
|
||||
if (static::isTypeScript(Arr::get($configurationData, 'language'))) {
|
||||
if ($isDocker) {
|
||||
$filesToGenerate[] = new TemplateFile(data: 'node/.yarnrc', name: '.yarnrc');
|
||||
$filesToGenerate[] = new TemplateFile(data: 'node/Dockerfile', name: 'Dockerfile');
|
||||
$filesToGenerate[] = new TemplateFile(data: 'typescript/.yarnrc', name: '.yarnrc');
|
||||
$filesToGenerate[] = new TemplateFile(data: 'typescript/Dockerfile', name: 'Dockerfile');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,13 +163,13 @@ final class CreateListOfFilesToGenerate
|
|||
return strtoupper($webServer) === WebServer::NGINX->name;
|
||||
}
|
||||
|
||||
private static function isNode(?string $language): bool
|
||||
private static function isTypeScript(?string $language): bool
|
||||
{
|
||||
if (is_null($language)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return strtoupper($language) === Language::NODE->name;
|
||||
return strtoupper($language) === Language::TYPESCRIPT->name;
|
||||
}
|
||||
|
||||
private static function isPhp(?string $language): bool
|
||||
|
|
|
@ -46,7 +46,7 @@ final class Config
|
|||
)]
|
||||
public array $experimental;
|
||||
|
||||
#[Assert\Choice(choices: ['node', 'php'])]
|
||||
#[Assert\Choice(choices: ['php', 'typescript'])]
|
||||
#[Assert\NotBlank]
|
||||
public string $language;
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ namespace App\Enum;
|
|||
|
||||
enum Language
|
||||
{
|
||||
case NODE;
|
||||
case PHP;
|
||||
case TYPESCRIPT;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue